Function pointer variables should be colorized as functions when they're called.

Offen
#13,015 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp, vscode
Bereich
tooling

Rechercherichtung

Reproduziere das Beispiel in einer C- oder C++-Datei und untersuche, wie der semantische Analysator Aufrufe über Funktionszeiger behandelt, wobei die verknüpften Diagnose- und LSP-Protokolle als Kontext dienen. Erledigt ist die Aufgabe, wenn die aufgerufene Variable f und das Strukturelement ptr dieselbe Funktionsfarbgebung wie func erhalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug Feature: Colorization Language Service Visual Studio
Environment
  • OS and Version: NixOS 24.11
  • VS Code Version: 1.94.2
  • C/C++ Extension Version: 1.22.2
  • If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce

Bug Summary:
Executing a function call from a function pointer has mostly the same relevance as any normal function call; as such it should be colorized in a similar way.

Minimal example: Image
Note how the syntactic token type is easily detected thanks to the parentheses (and is identified as "entity.name.function.c" for the bare function pointer and as "entity.name.function.member.c" for the function pointer struct member), but the semantic analyzer ignores this particular property

Steps to reproduce:

  1. Define a function in a C or C++ file;
  2. Place the functions' address in a function pointer variable;
  3. Call the function from the variable.

Expected behavior:
In the above screenshot, the text f on line 11 and ptr on line 12 should be colorized as func on line 10 is (i.e. purple)

Configuration and Logs
No "c_cpp_properties.json" present
Diagnostic logs: https://pastebin.com/nRDFDEKL
LSP logs: https://pastebin.com/Z0iZDQ56
Other Extensions

No response

Additional context

No response

Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/vscode-cpptools

Alle Issues in microsoft/vscode-cpptools

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.