microsoft / microsoft/vscode-cpptools
Compile single file, Preprocess single file
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
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.
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 mit der verlinkten Diskussion zu compile_commands.json und dem Kontext der vscode-cpptools-Erweiterung, um zu verstehen, wie Compilerpfade und -argumente offengelegt werden. Das Feature wäre vollständig, wenn eine ausgewählte Datei unabhängig kompiliert oder vorverarbeitet werden kann und dabei ein temporäres Objekt oder ein Präprozessorausgabedokument erzeugt, ohne den vollständigen Build oder Linker auszuführen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, typescript, vscode
- Bereich
- build-system, compilers, devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100