-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Missing Code Actions for TypeScript LSP #2994
Comments
I've debugged this further. It looks like the Sublime Text {
"range":{
"start":{
"line":3,
"character":28
},
"end":{
"line":3,
"character":36
}
},
"context":{
"diagnostics":[
{
"range":{
"start":{
"line":3,
"character":28
},
"end":{
"line":3,
"character":36
}
},
"tags":[
],
"message":"Cannot find name 'useState'.",
"code":2304,
"severity":1,
"source":"typescript"
}
]
},
"textDocument":{
"uri":"file:///Users/kevin/code/helix-ts-testcase/src/App.tsx"
}
} Helix {
"jsonrpc":"2.0",
"method":"textDocument/codeAction",
"params":{
"context":{
"diagnostics":[
{
"message":"Cannot find name 'useState'.",
"range":{
"end":{
"character":36,
"line":3
},
"start":{
"character":28,
"line":3
}
},
"severity":1
}
]
},
"range":{
"end":{
"character":29,
"line":3
},
"start":{
"character":28,
"line":3
}
},
"textDocument":{
"uri":"file:///Users/kevin/code/helix-ts-testcase/src/App.tsx"
}
},
"id":1
} |
When you were generating the logs, did you make a selection or did you only have a cursor? The logs seem to indicate you just had a 1 character width cursor. |
No selection, just moved to the word |
We use the range of the selection. Try to make a matching selection. It could also be fixed by #3012 |
This problem still exists with TS |
@archseer I'm not sure I follow. If the diagnostics point out a problem and I move my cursor somewhere within the diagnostic range, I'd assume the Code Actions apply using the range of the diagnostic. I believe this is how it's implemented in other editors. I've verified that I get the correct behaviour in Vim, Neovim, Sublime Text and VSCode. As long as I'm in within the diagnostic range, the Code Actions are listed as expected. |
This PR provides a solution to resolve helix-editor#2994. missing Code Actions for lsp
* add code for diagnostic. This PR provides a solution to resolve helix-editor#2994. missing Code Actions for lsp * remote unused import
Summary
No code actions are available at places where one expect code actions to be available. I've created this repo to showcase the problem. See the attached videos below in which I compare Sublime Text and Helix.
Sublime Text
sublime.mov
Helix
helix.mov
Reproduction Steps
README
.Helix log
~/.cache/helix/helix.log
Platform
macOS
Terminal Emulator
kitty 0.25.2
Helix Version
helix 22.05 (230ba26)
The text was updated successfully, but these errors were encountered: