-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
LSP Type Hints #2070
Comments
(ignore) |
I don't think the LSP protocol defines this, so it would probably have to be implemented by a plugin. Edit; Never mind, seems to have been recently added. |
What's the current status on this? Is #417 the PR to look out for? |
TypeScript 4.4 just added inlay hints: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#inlay-hints Deno 1.27 added inlay hints: https://deno.com/blog/v1.27#language-serveride-improvements Would be fantastic to get virtual text up and running and get inlay hints available! |
This feature is blocked om two PRs:
|
Excited for this |
With both blocking MR being merged and an Is there someone already working on it so we can help or is it available for pickup ? |
Somebody posted a screenshot of a prototype on the matrix channel. He said he may do a PR but never heard back from him. So I am guessing nobody is currently working on it. This feature should be pretty easy to implement now. |
There is now #5934, I recommand testing it on your side since I only really tested with Rust-Analyzer and other LSPs may have different behaviours |
I tested with go, typescript, and Lua, It's very cool to me. If anyone needs to config to LSP. # language.toml config for inlay hit
[[language]]
name = "go"
[language.config.hints]
assignVariableTypes = true
compositeLiteralFields = true
constantValues = true
functionTypeParameters = true
parameterNames = true
rangeVariableTypes = true
[[language]]
name = "lua"
[language.config.Lua.hint]
enable = true
arrayIndex = "Enable"
setType = true
paramName = "All"
paramType = true
await = true
[[language]]
name = "typescript"
[language.config]
hostInfo = "helix"
[language.config.typescript.inlayHints]
includeInlayEnumMemberValueHints = true
includeInlayFunctionLikeReturnTypeHints = true
includeInlayFunctionParameterTypeHints = true
includeInlayParameterNameHints = "all" # 'none' | 'literals' | 'all';
includeInlayParameterNameHintsWhenArgumentMatchesName = true
includeInlayPropertyDeclarationTypeHints = true
includeInlayVariableTypeHints = true
[[language]]
name = "tsx"
[language.config]
hostInfo = "helix"
[language.config.typescript.inlayHints]
includeInlayEnumMemberValueHints = true
includeInlayFunctionLikeReturnTypeHints = true
includeInlayFunctionParameterTypeHints = true
includeInlayParameterNameHints = "all" # 'none' | 'literals' | 'all';
includeInlayParameterNameHintsWhenArgumentMatchesName = true
includeInlayPropertyDeclarationTypeHints = true
includeInlayVariableTypeHints = true
[[language]]
name = "javascript"
[language.config]
hostInfo = "helix"
[language.config.javascript.inlayHints]
includeInlayEnumMemberValueHints = true
includeInlayFunctionLikeReturnTypeHints = true
includeInlayFunctionParameterTypeHints = true
includeInlayParameterNameHints = "all" # 'none' | 'literals' | 'all';
includeInlayParameterNameHintsWhenArgumentMatchesName = true
includeInlayPropertyDeclarationTypeHints = true
includeInlayVariableTypeHints = true
[[language]]
name = "jsx"
[language.config]
hostInfo = "helix"
locale = "zh-CN"
[language.config.javascript.inlayHints]
includeInlayEnumMemberValueHints = true
includeInlayFunctionLikeReturnTypeHints = true
includeInlayFunctionParameterTypeHints = true
includeInlayParameterNameHints = "all" # 'none' | 'literals' | 'all';
includeInlayParameterNameHintsWhenArgumentMatchesName = true
includeInlayPropertyDeclarationTypeHints = true
includeInlayVariableTypeHints = true
ref: |
Nice, glad to know it worked with all of them, thanks for testing! |
I'm not sure how straightforward this would be to implement.
Type hints could be given on hover, or overlaid on the text like this: rust-lang/vscode-rust#374
The text was updated successfully, but these errors were encountered: