microsoft / microsoft/vscode-cpptools
inlay parameter hint does not work for dependent function templates
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
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_
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Beispiel für ein abhängiges Funktionstemplate im Issue mit der VS Code C/C++ extension zu reproduzieren, und bestätige, dass der explizite Template-Aufruf einen Inlay-Hinweis erhält, während der inferierte Aufruf keinen erhält. Erledigt ist dies, wenn der inferierte Aufruf vor val einen arg:-Hinweis anzeigt, ohne das Verhalten des expliziten Template-Aufrufs zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100