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

オープン
#13,015 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp, vscode
領域
tooling

調査の方向性

C または C++ ファイルで例を再現し、リンクされた diagnostic と LSP のログをコンテキストとして使用して、semantic analyzer が function-pointer calls をどのように処理するかを調査します。呼び出される変数 f と struct member ptr が func と同じ function colorization を受ければ完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-cpptools のほかの issue

microsoft/vscode-cpptools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。