Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter Hints shown inline all the time (like IntelliJ) #16221

Closed
nbransby opened this issue Nov 29, 2016 · 83 comments
Closed

Parameter Hints shown inline all the time (like IntelliJ) #16221

nbransby opened this issue Nov 29, 2016 · 83 comments
Assignees
Labels
api-finalization feature-request Request for new features or functionality inlay-hints on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@nbransby
Copy link

Would be useful for typescript: https://youtu.be/ZfYOddEmaRw

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 29, 2016

Just a tip:

VS Code have Hover and SignatureHelp tips:

Hover

image

SignatureHelp

image

@chrmarti chrmarti added the feature-request Request for new features or functionality label Nov 29, 2016
@aeschli aeschli assigned waderyan and unassigned aeschli Nov 29, 2016
@waderyan
Copy link

waderyan commented Dec 1, 2016

@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.

@nbransby
Copy link
Author

nbransby commented Dec 1, 2016

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.

@waderyan
Copy link

waderyan commented Dec 2, 2016

@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:

image

@nbransby
Copy link
Author

nbransby commented Dec 2, 2016

Difference is that its inline in the editor and present at all times - not in a popup

image

@waderyan
Copy link

waderyan commented Dec 2, 2016

Ok interesting. Thank you for clarifying.

@waderyan waderyan changed the title IntelliJ style parameter hints Parameter Hints shown inline all the time (like IntelliJ) Dec 2, 2016
@mjbvz mjbvz self-assigned this Feb 1, 2017
@mjbvz mjbvz added javascript JavaScript support issues typescript Typescript support issues labels Feb 1, 2017
@mjbvz mjbvz added this to the Backlog milestone Apr 25, 2017
@jrieken jrieken added suggest IntelliSense, Auto Complete and removed intellisense labels Aug 31, 2017
@balta2ar
Copy link

For the record, here is child issue in vscode-python that I think depends on this one: microsoft/vscode-python#53

@phiresky
Copy link

phiresky commented Feb 5, 2018

Note that this is already possible using decorations:

image

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...

@phiresky
Copy link

phiresky commented Feb 5, 2018

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...

@shiMusa
Copy link

shiMusa commented Feb 19, 2018

Please make this a simple to install extension!
<3 <3 <3
:3

@lannonbr
Copy link
Contributor

lannonbr commented Aug 16, 2018

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:

JS Param Hints / Annotations

Here's the extension: https://marketplace.visualstudio.com/items?itemName=lannonbr.vscode-js-annotations

@krulik
Copy link

krulik commented Aug 21, 2018

Looking for such an extension for Golang

@DJMcNab
Copy link
Contributor

DJMcNab commented Aug 29, 2018

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 rust-lang/rfcs#323 (comment) discusses a further use for this to supercede keyword args in Rust.

sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 18, 2022
Commit: 519638efac9604318bcbd4643e0fed4b2b5955da
jrieken added a commit that referenced this issue Jan 19, 2022
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 19, 2022
Commit: 8ef8933a1af8bc3613dcc375d7483c2fd6da6add
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 19, 2022
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 20, 2022
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 20, 2022
jrieken added a commit that referenced this issue Jan 20, 2022
…d append command to context menu, add more jsdoc for API, remove dead code, #16221 (comment)
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 20, 2022
…ation and append command to context menu, add more jsdoc for API, remove dead code, microsoft/vscode#16221 (comment)

Commit: a24000a9a35f0f9badd9d2be4634be5316f3f1c2
@jrieken jrieken modified the milestones: January 2022, February 2022 Jan 24, 2022
jrieken added a commit that referenced this issue Feb 8, 2022
@jrieken
Copy link
Member

jrieken commented Feb 9, 2022

The API has been finalised, the feature is implemented. All further work is tracked with the inlay-hints-label

@jrieken
Copy link
Member

jrieken commented Feb 21, 2022

To verify ensure that registerInlayHintsProvider is in latest vscode.d.ts

@jrieken jrieken added the verification-needed Verification of issue is requested label Feb 21, 2022
@tanhakabir tanhakabir added the verified Verification succeeded label Feb 23, 2022
@jrieken jrieken added the on-release-notes Issue/pull request mentioned in release notes label Feb 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-finalization feature-request Request for new features or functionality inlay-hints on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests