nvim-code-action-menu
nvim-code-action-menu copied to clipboard
Diff and Details not showing
I recently found your plugin and found it very useful but I have some bug related to code action menu here is the screenshot of the menu

I have set vim.g.code_action_menu_show_details to true and vim.g.code_action_menu_show_diff to true but they are not showing to me
Configuration
https://github.com/Iamafnan/my-nvimrc
Neovim Version
NVIM 0.7.0-dev
Update: Now it is showing details
Screenshot

Okay. So is this still an issue? Can it be closed? 😆
It is not showing diff
That must not be wrong. Though it looks like it could have one. We have two options to figure this out. Either you investigate it yourself with some help of mine or you give me the code, your language server with its version and your NeoVim setup. In case you want to inspect it yourself, please to the same location, execute the following command and post the output in a comment here:
:lua print(vim.inspect(vim.lsp.buf_request_sync(0, 'textDocument/codeAction', vim.lsp.util.make_range_params())))
This is the output

My Neovim Config Language server: tsserver Neovim Version: 0.7.0-dev Language server version: 0.8.1
same error for diff section here
I'm also not seeing a diff here! Happy to help troubleshoot. FWIW, the code action (adding the missing import) does apply correctly when selected.

Note that the details do show up fine; I just have them disabled in my config.
Language server: tsserver 0.9.3 Neovim version: 0.6.1
{ {
result = {}
},
[3] = {
error = {
code = -32603,
message = "Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'diagnostics')",
<metatable> = {
__tostring = <function 1>
}
}
},
[4] = {
error = {
code = -32603,
message = "Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'only')",
<metatable> = {
__tostring = <function 1>
}
}
}
}
I meet the same problem. Can't show the diff window.
Here is my log of execing :lua print(vim.inspect(vim.lsp.buf_request_sync(0, 'textDocument/codeAction', vim.lsp.util.make_range_params())))
{ {
error = {
code = -32602,
message = "failed to decode textDocument/codeAction request: missing valu
e at (root).context",
<metatable> = {
__tostring = <function 1>
}
}
} }
Do you have resolved the problem? Thank you.
I too am seeing a similar case where the diff isn't shown, though all the rest works perfectly (actions are being applied, context is fully displayed): in particular this happens with the gopls language server.
For use with tsserver and null-ls
[3] = {
error = {
code = -32603,
message = "Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'only')",
<metatable> = {
__tostring = <function 1>
}
}
}
Details
NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3