Skip to content

Support inlay hints for parameter names #2354

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

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

jdneo
Copy link
Collaborator

@jdneo jdneo commented Mar 11, 2022

fix #2099

requires eclipse-jdtls/eclipse.jdt.ls#2019

Signed-off-by: sheche [email protected]

@rgrunber
Copy link
Member

rgrunber commented Mar 16, 2022

I need to :

  • Test this against Theia
  • Play around with the change and see how it behaves
  • Look up some of our pain points on the Eclipse IDE side and see if there's more issues to be aware of (eg. hints flickering)

@angelozerr
Copy link
Contributor

Look up some of our pain points on the Eclipse IDE side and see if there's more issues to be aware of (eg. hints flickering)

You will not able to do that, since LSP4E doesn't support InlayHint because LSP4J doesn't provide InlayHint eclipse-lsp4j/lsp4j#570

@rgrunber
Copy link
Member

Look up some of our pain points on the Eclipse IDE side and see if there's more issues to be aware of (eg. hints flickering)

You will not able to do that, since LSP4E doesn't support InlayHint because LSP4J doesn't provide InlayHint eclipse/lsp4j#570

Yes but Eclipse does have Parameter Name Code Minings ;) . I meant more just things about the feature which users may have complained about.

This PR supports inlay hints for parameter names. Meanwhile, a new
client setting 'java.inlayHints.parameterNames.enabled' is added to
specify how the inlay hints will be displayed in editor, where:
  - none: disable parameter name hints
  - literals: enable parameter name hints only for literal arguments
  - all: enable parameter name hints for literal and non-literal arguments

Signed-off-by: sheche <[email protected]>
Copy link
Member

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks fine to me.

One thing I noticed (maybe on Linux?) is that I would be near the top of a file (line 0) with maybe 30 lines being shown below. However, I would see the client requesting inlay hints for a range of line 0 to 85. This is probably more to do with the OS / Desktop Environment but just wondering if others have seen this behaviour.

@jdneo
Copy link
Collaborator Author

jdneo commented Mar 30, 2022

This is probably more to do with the OS / Desktop Environment but just wondering if others have seen this behaviour.

I can also observe this behavior in VS Code running on Windows. Might be related with VS Code's viewport calculation strategy? Or maybe a bug in VS Code.

@testforstephen testforstephen added this to the Early April 2022 milestone Mar 30, 2022
@testforstephen testforstephen merged commit 536d72a into redhat-developer:master Mar 30, 2022
@testforstephen testforstephen removed this from the Early April 2022 milestone Mar 30, 2022
@jdneo jdneo deleted the cs/inlay-hint branch March 30, 2022 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support inlay hints
4 participants