microsoft / microsoft/vscode-cpptools

inlay parameter hint does not work for dependent function templates

Open
#9,744 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Inlay Hint Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dependent function template example in the issue with the VS Code C/C++ extension and confirm that the explicit-template call receives an inlay hint while the inferred call does not. Done means the inferred call displays an arg: hint before val without changing the explicit-template behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.