Does anyone know how to get argument name automatically in Visual Studio Code? [duplicate]
Asked Answered
G

3

9

Look at the below-given image of Intellij IDEA - Automatic argument names(image of Intellij IDEA)

When we use a function it automatically provides the argument name and when we copy a code-snippet then that argument name is not copied(it is just for our reference).

I want to do the same in my vs-code editor but, I can't find any way to do it.

Gabor answered 21/10, 2021 at 2:45 Comment(0)
W
5

Looks like Inline Parameters for VSCode extension you looking for.

enter image description here

Women answered 21/10, 2021 at 3:23 Comment(1)
Thanks a lot That extension is very helpful, but do you know another extension which supports languages such as C/C++, Python, Java etcGabor
L
2

This feature, called "parameter hints", requires support from the language server, so whether or not this is currently supported varies from language to language.

For C++, clangd has experimental support for this (enabled by adding --inlay-hints=true to "clangd.arguments") starting from clangd 13.

I'm not familiar with the status for other languages, so will let others answer on that front.

Larocca answered 21/10, 2021 at 5:29 Comment(0)
L
1

There is a new version of VS Code, there they had given support for Parameter hint highlight enter image description here See the release notes

Luteal answered 5/11, 2021 at 16:40 Comment(1)
That's not what the OP is asking for. This VSCode feature is about the parameter hint inside the parameters tooltip, not the parameter variable name displayed inline next to each parameter.Unbending

© 2022 - 2024 — McMap. All rights reserved.