microsoft / microsoft/vscode-cpptools
Support adding source/header extensions for Switch Header/Source functionality
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
- OS and Version: Windows 10
- VS Code Version: 1.40.1
- C/C++ Extension Version: 0.26.2-insiders
I have a codebase I'm writing right now where template implementation code is split up into .inl files (also typically used for inline/constexpr functions). While they're mainly just to keep header files "clean", I was thinking it would be nice to be able to swap to them from the header files themselves via the Switch Header/Source command.
I can see it either being implemented as swapping between 3 files with the same name if they exist (h/hpp,cpp,inl), or favoring just the header/source file swap if the source file exists, and header/inline file if an inl exists,
typical pattern:
(with all 3 files, a lot of cases could be just .hpp/.inl)
InlTest.hpp
#ifndef INL_TEST_H
#define INL_TEST_H
struct InlTest
{
void foo(const int& inFoo);
template <typename T>
void bar(const T& inBar);
};
#include "InlTest.inl"
#endif // INL_TEST_H
InlTest.cpp
#include "inlTest.hpp"
void InlTest::foo(const int& inFoo);
{
std::cout << inFoo << std::endl;
}
InlTest.inl
#include "inlTest.hpp" // Actually not needed, but helps with intellisense sometimes
#include <iostream>
template <typename T>
void InlTest::bar(const T& inBar);
{
std::cout << inBar << std::endl;
}
Out of the file types supported by the builtin C/C++ extension, the following could also be candidates for this toggle too:
.i .ii .ino .inl .ipp .hpp.in .h.in
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne beim Befehl Switch Header/Source in der vscode-cpptools-Erweiterung und untersuche, wie die unterstützten Dateierweiterungen ausgewählt werden. Bestätige das gewünschte Verhalten für .inl und die anderen aufgelisteten Erweiterungen, einschließlich Projekten mit Header-, Source- und Inline-Dateien, und überprüfe, dass das Umschalten das erwartete Gegenstück erreicht.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, vscode
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100