microsoft / microsoft/vscode-cpptools

Compile single file, Preprocess single file

Aperta
#8,345 5 commenti 17 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Feature Request help wanted Language Service tasks/build/debug
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Type: Feature Request

In a separate discussion regarding compile_commands.json I outlined that the data contained within this json could be a great stepping-off point for a compile single file / preprocess single file feature in vscode: https://github.com/microsoft/vscode-cpptools/discussions/8308

Since the json has the path to the compiler and all the compiler arguments, it's all the information one needs to implement this feature. Typically compile single / preprocess single typically decorates a TU alongside a module compilation unit, its frequently overlooked, and tricky to add later (omit sibling TUs, skip calling linker). It's not unreasonable to "compile" arbitrary .h files, anything with compiler rules, just to a temp object. Likewise with preprocessing a file, it doesn't matter if the file in question is directly mentioned in a module build unit to be able to preprocess and present the preprocessor output in a temp document.

These features are useful in a tight iteration loop because full-bore builds may consider dozens or hundreds of units that end up generating redundant errors, and waste precious seconds delivering a round of errors into the eyeballs of the engineer. Likewise, preprocessing a file to a temp is a key iteration loop when authoring and testing tricky macro expansions.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla discussione collegata su compile_commands.json e dal contesto dell’estensione vscode-cpptools per capire come vengono esposti i percorsi e gli argomenti del compilatore. La funzionalità sarebbe completa quando un file selezionato può essere compilato o preprocessato in modo indipendente, producendo un oggetto temporaneo o un documento di output del preprocessore senza eseguire la build completa o il linker.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, typescript, vscode
Ambito
build-system, compilers, devtools
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.