Closed nbransby closed 2 years ago
Just a tip:
VS Code have Hover and SignatureHelp tips:
@nbransby thanks for opening this up. I watched the video... what specifically are you missing? VS Code does provide parameter hints as @mrmlnc shows in his screenshots.
inline parameters hints aka the args names prefixed on each value passed into a function invocation swift / objective c style. I think its a great idea to bring this to other languages, and its a perfect feature for an ide to take care of instead of actually introducing it to the language.
@nbransby can you show me a screenshot? This is what we do today and I'm not seeing how what you are suggesting (args names prefixed on each value passed into a function invocation) is different:
Difference is that its inline in the editor and present at all times - not in a popup
Ok interesting. Thank you for clarifying.
For the record, here is child issue in vscode-python that I think depends on this one: https://github.com/Microsoft/vscode-python/issues/53
Note that this is already possible using decorations:
Adapting this sample:
vscode.window.createTextEditorDecorationType({
before: {
contentText: "myParam:",
border: "1px solid gray",
backgroundColor: "#333",
margin: "1px",
textDecoration: "test",
}
});
I'm not sure how to get information from the running typescript language server though...
I'm not sure how to get information from the running typescript language server though...
Looks like this is not possible. Other plugins that manipulate typescript either use regexes (typescript importer), a separate Typescript parser (Typescript Hero) or load the files into the typescript compiler themselves (Move TS). None of these methods really seem viable for this problem...
Please make this a simple to install extension! <3 <3 <3 :3
So I've wanted this feature in VS Code as well and I ended up making it myself. I currently support JS files at the moment but am interested in adding support for other languages in the future.
Here's a example of it being used in an example JS file:
Here's the extension: https://marketplace.visualstudio.com/items?itemName=lannonbr.vscode-js-annotations
Looking for such an extension for Golang
This feature looks really useful - has it been considered for the language server protocol?
Using @phiresky's example, this could be done through the semantic highlighting api - see Microsoft/language-server-protocol#18, Microsoft/language-server-protocol#513, etc. for the proposals.
However, in my opinion contentText
is an implementation oddity, and the protocol should not require all editors to support that part of the diagnostics api. Indeed, Microsoft/language-server-protocol#513 would not support this as it uses textmate scopes. Therefore, it should probably be a seperate feature similar in use to textDocument/publishDiagnostics
.
CC. @dbaeumer, who appears to manage the language-server-protocol repo. A tracking/discussion issue there would probably be useful too, with your blessing.
As a further note https://github.com/rust-lang/rfcs/issues/323#issuecomment-391735876 discusses a further use for this to supercede keyword args in Rust.
Is there any plan to support this feature in VSCode any time soon ?
Looking for such an extension for Java
WebStorm 2018.3 just added this for javascript files:
We'd love to get this on vscode as well, especially for typescript.
@brunolemos If you scroll up a little in this thread, I made a VS Code extension that currently does this for JS / TS.
@lannonbr that extension not works with TS files, right?
@lannonbr thanks! It's a great alternative for now, unfortunately there's some pain points that would be great to be addressed:
JavaScript React
neither TypeScript React
, which are most of my files (and also Babel JavaScript
cc https://github.com/lannonbr/vscode-js-annotations/issues/37)Add a more freely customization option to the styling, e.g. I'd like to make the font smaller and add an opacity to it
EDIT: Opacity is supported via the annotationForeground setting, but I don't think it can take the theme color in consideration:
"workbench.colorCustomizations": { "jsannotations.annotationForeground": "#FFFFFF40" },
I think it should use the theme comment color by default
It would be neat for something very similar, to add decorators for inferred types (which we already know from language servers). Again as an example, taken from IntelliJ:
This information we already have on hover, this is just a way to do the same thing using decorations.
Hover doesn't have to display the type, it's just encouraged to in the protocol spec so you would need a different mechanism. I'm wondering if we can use #66418 for this?
What happened ? I am waiting for this in Java ? Is it implemented :) ? Even Eclipse has it now ... https://github.com/angelozerr/jdt-codemining
I am missing this feature so much. I really hope they will implement it.
The main advantage of this feature is that it allows you to see the parameter hints without masking the code above it. Currently, the parameter hints make it difficult to look at the lines just above them:
(I actually wanted to draw inspiration from the commented line above)
+1 This is a great feature from IntelliJ that should definitetly be ported to vscode.
I would really like to have this for python!
+1 for JS
Would greatly help with cases like this (from Typescript file) where you can't see what an individual parameter is by hover. (Real example with randomised content.)
const myVar = new this(
id,
'https://example.com:6010',
'FeZJlIDPbvSxHaZ5DSDFJDSFJksksjfjhyralaklasda',
false,
'00YISYSYDYYYFY33423423',
'https://example.com:6020',
'https://example.com:6030',
'https://example.com:6030',
'xxxdc9f3',
'sldfkjjjewrjioweurfiopjdkasl;kdl;asd'
);
Jetbrains have a good post on the benefits of inline parameter hints. Would love to get it in VS Code!
https://www.jetbrains.com/help/resharper/Inline_Parameter_Name_Hints.html
yes please add this to vscode!
Also this https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag it should be a part of the ide, not an addon
intelij's out of the box html tag editing is vastly better atm
@lannonbr that extension not works with TS files, right?
It is works for ts if you donwload the latest and greatest
Would be great if this could work well for default parameters as well as specified parameters. For example, if a default parameter is used (due to parameter missing or specified as undefined
) it would be great to see both the default parameter name and value that will be used in the hints. This would save a function definition lookup to understand the function call which is exactly the point of this feature. 😀
Just saw this feature in my coworkers WebStorm, now I want this feature in VSCode. :smiley:
Add me to the waiting list. It looks really cool on Intellij.
It would be a very helpful feature.
I agree with the others!
Need!
This would be really useful.
phpstorm has it. I saw this and wanted in Vscode :)
@mjbvz Requesting this feature too - could we know the status, will it be implemented by the VS Code team?
Would love to see this in VS Code.
One extra thing to consider for the future implementation in VS Code is the fact that those hints may be interactive. Here's an example from the intellij-rust plugin: https://github.com/intellij-rust/intellij-rust/pull/4217
any news on this?
any news on this?
any news on this?
If there were, I am quite certain the vscode team would post an appropriate update to this thread.
2020 is approaching and this feature is not implemented yet !! would be a great improvement :smiley:
Please add this! It would be such a useful feature and, at least in my use, IntelliJ would have nothing over VS Code. Please!!!
OT, but @rajkundu I read your comment in my head using the Chamberlain's voice: https://www.youtube.com/watch?v=lm9E3NQOuh0. It fit.
Not terribly dissimilar 😆
any new on this , i see my friend have this This is awesome, how activate this in vscode ?? Or a plugin ?
Would be useful for typescript: https://youtu.be/ZfYOddEmaRw