inlay parameter hint does not work for dependent function templates

未关闭
#9,744 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp
领域
devtools

调研方向

首先,使用 VS Code C/C++ extension 重现 issue 中的依赖函数模板示例,并确认显式模板调用会收到内嵌提示,而推导调用不会收到。完成的标准是:推导调用在 val 前显示 arg: 提示,同时不改变显式模板调用的行为。

由索引模型根据 Issue 内容生成。

描述

enhancement Feature: Inlay Hint Language Service Visual Studio
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_
主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
14 小时 46 分钟
30 天内合并 PR
61

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。