microsoft / microsoft/vscode-cpptools
Single line comment after `#if` directives spoil scope highlight.
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
Environment
- OS and Version:
tested with Windows and SSH(Windows + Linux)- Windows 11 22000.1098
- (ssh) Windows 11 22000.1098 + Pop!_OS 22.04 LTS
- VS Code Version:1.72.2
- C/C++ Extension Version: v1.12.4
- Other extensions you installed (and if the issue persists after disabling them):
- MS-CEINTL.vscode-language-pack-ko
- ms-vscode.cpptools-extension-pack
- twxs.cmake
- ms-vscode.cmake-tools
yes the issue peresists after disable thoese.
- If using SSH remote, specify OS of remote machine:
- Pop!_OS 22.04 LTS
- A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
Bug Summary and Steps to Reproduce
Just create single main.c file and paste the code.
Expected behavior
Brace next #if 0 should be ignored but it is not.
When I put new line it fine.
And multi line comment also fine.
Code sample and Logs
main.c
int main(void)
{
#if 0 // a
{
printf("hello");
#else
{
printf("good bye");
#endif
printf(" world");
}
}
setting.json
{
"[c]": {
"editor.semanticHighlighting.enabled": true,
"editor.tabSize": 4
},
"files.associations": {
"*.h": "c"
}
}
no notable output from C/C++: Log Diagnostics and language server.
Screenshots
Additional context
No response
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 main.c-Reproduktion im Issue und untersuche, wie die C/C++-Erweiterung das semantische Hervorheben von #if-Direktiven mit einem einzeiligen Kommentar behandelt. Überprüfe das Verhalten mit der bereitgestellten setting.json und bestätige, dass geschweifte Klammern unter #if 0 vom Scope-Hervorheben ausgeschlossen werden, während die Fälle mit mehreren Zeilen und Zeilenumbrüchen weiterhin korrekt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, typescript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100