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 for textDocument/InlayHint #595

Closed
angelozerr opened this issue Mar 13, 2022 · 14 comments · Fixed by #593
Closed

Support for textDocument/InlayHint #595

angelozerr opened this issue Mar 13, 2022 · 14 comments · Fixed by #593

Comments

@angelozerr
Copy link
Contributor

Display the Java type of parameter name as inlay hint.

See inlay hints rendererd with gray background:

image

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 13, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 13, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr changed the title Support for textDocument/InlayHint Support for textDocument/InlayHint Mar 13, 2022
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 13, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 13, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 13, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor Author

@FroMage @mkouba @maxandersen do you like this feature? Any ferdback ideas are welcome

@maxandersen
Copy link
Collaborator

If that can be done reliably and without slowing down editing I'm all for it. very nice!

@maxandersen
Copy link
Collaborator

I assume if type can't be inferred it just don't put any hint?

@angelozerr
Copy link
Contributor Author

that can be done reliably and without slowing down editing I'm all for it. very nice!

No problem with that. InlayHint belongs to lsp specification. It works like codelens. If the compute of inlay hint takes time the will not be displayed but no problem with slow down

I assume if type can't be inferred it just don't put any hint?

Yes

I will record a demo to show more the inlay hint in action

@angelozerr
Copy link
Contributor Author

@maxandersen here a little demo:

InlayHintDemo

@maxandersen
Copy link
Collaborator

Looks very nice. Awesome!

@angelozerr
Copy link
Contributor Author

Glad it pleases you!

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 13, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 13, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 13, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 13, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 14, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
@mkouba
Copy link
Collaborator

mkouba commented Mar 14, 2022

No problem with that. InlayHint belongs to lsp specification. It works like codelens. If the compute of inlay hint takes time the will not be displayed but no problem with slow down

So if the type info is not available it will just show nothing and cancel the computation in the background?

@angelozerr
Copy link
Contributor Author

So if the type info is not available it will just show nothing and cancel the computation in the background?

Yes, you can see this behavior inthe demo when there is item in items where items doesn't exists, so item java type ca,,ot be computed. In this case it displays nothing.

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 14, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
@FroMage
Copy link

FroMage commented Mar 14, 2022

I like displaying the type on declaration, that makes sense (think var in Java, IDEs do the same). But on usage, when you pass it as parameter, I find it weird, no? Do IDEs do that, normally? I don't think they do.

@angelozerr
Copy link
Contributor Author

I like displaying the type on declaration, that makes sense (think var in Java, IDEs do the same). But on usage, when you pass it as parameter, I find it weird, no? Do IDEs do that, normally? I don't think they do.

At first there is a settings to show type for method parameter.

Eclipse IDE provides this feature for parameter name (not type):

image

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 14, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 14, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor Author

I like displaying the type on declaration, that makes sense (think var in Java, IDEs do the same). But on usage, when you pass it as parameter, I find it weird, no? Do IDEs do that, normally? I don't think they do.

@fbricon @maxandersen @mkouba do you think we should remove display of type for method parameter? Perhaps you would prefer displaying parameter name or nothing?

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 15, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
@mkouba
Copy link
Collaborator

mkouba commented Mar 15, 2022

Perhaps you would prefer displaying parameter name or nothing?

I'm not sure but I think that displaying the parameter name would be a bit more practical as the param type is validated anyway, or? AFAIK ides show the param names on the left side too.

@angelozerr
Copy link
Contributor Author

I'm not sure but I think that displaying the parameter name would be a bit more practical as the param type is validated anyway, or? AFAIK ides show the param names on the left side too.

Thanks for your feedback @mkouba !

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 15, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 15, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr self-assigned this Mar 16, 2022
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 17, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 18, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 18, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Mar 28, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the v0.12.0 milestone Mar 31, 2022
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 31, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Apr 1, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Apr 1, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Apr 1, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Apr 1, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Apr 1, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/vscode-quarkus that referenced this issue Apr 1, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Apr 1, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Apr 1, 2022
Fixes redhat-developer#595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit that referenced this issue Apr 1, 2022
Fixes #595

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to redhat-developer/vscode-quarkus that referenced this issue Apr 1, 2022
See redhat-developer/quarkus-ls#595

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants