microsoft / microsoft/vscode-cpptools
Support adding source/header extensions for Switch Header/Source functionality
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
- 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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal comando Switch Header/Source nell’estensione vscode-cpptools e verifica come vengono selezionate le estensioni di file supportate. Conferma il comportamento desiderato per .inl e per le altre estensioni elencate, inclusi i progetti con file Header, Source e Inline, e verifica che il passaggio raggiunga il file corrispondente previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, vscode
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100