microsoft / microsoft/vscode-cpptools
X-Macro expansion false error.
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: Debian GNU/Linux 13 Trixie
- VS Code Version: 1.119.0
- C/C++ Extension Version: 1.32.2
Bug Summary and Steps to Reproduce
Bug Summary:
False error with X-Macros.
Steps to reproduce:
- Create a new C file colors.def for example with this content :
COLOR(RED)
COLOR(GREEN)
COLOR(BLUE)
- Create another C file like main.c with this content :
enum colors_t {
#define COLOR(NAME) NAME,
#include "colors.def"
#undef COLOR
};
- See the false error "expected an identifier" but compilation works perfectly.
Expected behavior:
No false error as the macro should expand and complete the enum.
Configuration and Logs
{
"configurations": [
{
"name": "Default",
}
],
"version": 4
}
Other Extensions
Issue still persist after disabling any other extensions.
Additional context
This is not a fatal error since it is only visual but it is a problem in intellisense that shows up error even if there are not...
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
Reproduziere die Diagnose mit den beiden im Bericht genannten Dateien, colors.def und main.c, unter Verwendung des gezeigten X-macro-Musters. Verfolge, wie IntelliSense die eingebundene Makroexpansion analysiert, und ermittle, warum es „expected an identifier“ meldet; abgeschlossen ist die Aufgabe, wenn die falsche Diagnose verschwindet, während das Beispiel weiterhin erfolgreich kompiliert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100