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

support inlay hints #2099

Closed
Eskibear opened this issue Sep 6, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2019 or #2354
Closed

support inlay hints #2099

Eskibear opened this issue Sep 6, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2019 or #2354

Comments

@Eskibear
Copy link
Contributor

Eskibear commented Sep 6, 2021

It's available in IntelliJ IDEA,
https://www.jetbrains.com/help/idea/inlay-hints.html

Supported in TS/JS since vscode v1.60
image
See: https://code.visualstudio.com/updates/v1_60#_inlay-hints-for-javascript-and-typescript

Proposed API in VS Code:
https://github.com/microsoft/vscode/blob/997228d528d687fd17cbf3ba117a0d4f668c1393/src/vs/vscode.proposed.d.ts#L1773-L1793

LSP proposal:
microsoft/language-server-protocol#956

@rgrunber
Copy link
Member

rgrunber commented Sep 10, 2021

It's also supported in Eclipse since 4.12 (2019-06) https://www.eclipse.org/eclipse/news/4.12/jdt.php#parameter-name-codemining.

https://git.eclipse.org/c/gerrit/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/codemining/CalleeJavaMethodParameterVisitor.java

I don't think we can use the class since it's in UI and ICodeMining is tied to some UI rendering elements. However the AST logic is pretty straightforward to copy over, or we could refactor the relevant parts we need in JDT.

@jayy2kok
Copy link

I have adopted VS Code for full time java IDE, I love it, just this one feature I am missing.

@rgrunber
Copy link
Member

rgrunber commented Oct 1, 2021

I think we should watch out for things like https://bugs.eclipse.org/bugs/show_bug.cgi?id=568844 , and maybe look at possible solutions. The jumpiness is caused when a method temporarily can't be resolved to a proper signature (due to syntax error?) and then switches to resolved. The effect is annotations flickering which affect the user's ability to type.

@jdneo
Copy link
Collaborator

jdneo commented Mar 4, 2022

Update: inlay hint is available as client side API in VS Code 1.65.0.

Maybe we can first make a client side implementation. I can volunteer for that. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment