feat: Shim vim.ui.select to reuse as much of the code_action code#48
feat: Shim vim.ui.select to reuse as much of the code_action code#48IndianBoy42 wants to merge 1 commit into
Conversation
TODO: does code action resolve work properly?
0df482c to
086ef6c
Compare
|
Please help testing, I haven't found any problems with rust-analyzer using it for a few days, if you use another LSP then it would be good to check if it does something different. |
|
Great job! Since breaking changes are acceptable, it would be good to make I will test this for a several days. |
|
Ah, but with this change, we can't enforce the use of actions-preview.nvim, can we? It might cause issues when used alongside dressing.nvim, etc. It would be great if there's a solution for this. |
|
So currently the way it works is that you still have to call I wish there was a more fundamental direct way to do this kind of "override for only a specific kind" thing. There was some discussion in github issues about a provider based method but I don't know if its backwards compatible so it might not happen. Currently I check if |
In-progress PR because I noticed that a large part of this repo is a copy of
vim.lsp.buf.code_action, which has changed since it was copied into thisrepository. To make it less possible for it to get out of date we can just call
vim.lsp.buf.code_actiondirectly and use a shim that interceptsvim.ui.selectto use theactions-previewbackend only ifkind == "codeaction".I chose to add the shim the first time
actions-previewis called, otherwise(say if it was wrapped in
setup) ifactions-previewis loaded beforesomething else replaces
vim.ui.selectthen we lose the shim. There may besome edge-cases around this wrapping that needs to be considered.
TODO: