-
Notifications
You must be signed in to change notification settings - Fork 217
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 inlay hints #498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some manual testing, and it seems to work really great 🙂 Awesome work! 👍 Looking forward to seeing the tests, which I see in your todo-list.
server/src/main/kotlin/org/javacs/kt/KotlinTextDocumentService.kt
Outdated
Show resolved
Hide resolved
Added tests, let me know how it looks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 😄 Some minor comments below. Some of the detekt issues will be gone by itself once #513 is merged (once rebased/merged into your branch ofc), but the ones that will not I have commented below.
Pretty sure this is ready for merge after that is done. Will have a final look and approve at that time 🙂 Also to give @fwcd time to have a look in case they want to.
In general, one can use the I see you have fixed the issues while waiting for our reply. Good job! Sorry for being a bit slow, have been busy in the last few days 🙁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me! 🙂 Thanks again for fixing the detekt issues.
Also see my previous comment. I'm open to merging this PR without it, but if it is reasonable we should create an issue for it.
@themkat let me know what you think but I believe we can merge this now. lspconfig.kotlin_language_server.setup {
cmd = { ... },
capabilities = capabilities,
on_attach = on_attach,
settings = {
kotlin = {
hints = {
typeHints = true,
parameterHints = true,
chainedHints = false,
},
},
},
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your build fails after the latest commits 🙁 Also fails locally, which I tried just to make sure. Probably the toggling-properties not being set for the tests and therefore defaulting to false?
As long as it doesn't crash without these properties, then we are okay for now. Tried it in VSCode, and it doesn't seem to crash at least. Feel free to create the issue in vscode-kotlin once we are closer to merging this PR 🙂 Most clients probably need to add them in some shape or form in the future anyway. |
My bad, tests fail it seems due to setting the defaults to false (not rendering hints and why it dosen't show up in your editor):
Is there a clean way to call config through tests? or would we prefer to set defaults as true i.e. leaving all hints on and having the option to disable them (tests will work that way too) |
The language server test fixture creates a kotlin-language-server/server/src/main/kotlin/org/javacs/kt/KotlinLanguageServer.kt Line 26 in 2f03112
|
Seems like there are only detekt issues now. If you don't see any other ways to write the functions, I suggest a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, and works great 🙂 Awesome job! 🎉
Will give @fwcd a day or two before merging in case he wants to have a look.
Let's merge it so people can start trying it! 😄 Good job @ElamC ! 🎉 |
Closes #473
Adds inlay hint support for inferred types and parameter names.
Todo:
consider adding a resolve method for versioning to solve textDocument/inlayHint request failure