microsoft / microsoft/vscode-cpptools
inlay parameter hint does not work for dependent function templates
オープン
まだ誰も着手していません。
enhancement
Feature: Inlay Hint
Language Service
Visual Studio
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 14時間 46分
- マージ済み PR(30日)
- 61
説明
Environment
- OS and version: Ubuntu 20.04
- VS Code: 1.70.0
- C/C++ extension: 1.20.0
- Other extensions you installed (and if the issue persists after disabling them):
- If using SSH remote, specify OS of remote machine:
- 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
Bug Summary:
I'm not quite sure this should be a bug or a feature request, since it seems to be highly related with #2973
Steps to reproduce:
template <typename T>
void func1 (T arg);
template <typename T>
void func2 () {
T val;
func1(val); // no inlay hint for `val`
func1<int>(42); // OK
}
Expected behavior
an inlay hint arg: appears before val, because there's no other overload besides the main template.
Code sample and Logs
template <typename T>
void func1 (T arg);
template <typename T>
void func2 () {
T val;
func1(val); // no inlay hint for `val`
func1<int>(42); // OK
}
```json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
],
"defines": [
],
"compilerPath": "/usr/bin/g++-10",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
]
}
}
],
"version": 4
}
### Screenshots
_No response_
### Additional context
_No response_
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、VS Code C/C++ extension を使って issue にある依存関数テンプレートの例を再現し、明示的なテンプレート呼び出しにはインレイヒントが表示される一方で、推論された呼び出しには表示されないことを確認します。推論された呼び出しで val の前に arg: ヒントが表示され、明示的なテンプレート呼び出しの動作が変わらなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100