nvim-code-action-menu icon indicating copy to clipboard operation
nvim-code-action-menu copied to clipboard

Diff and Details not showing

Open Iamafnan opened this issue 3 years ago • 11 comments

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 IMG_20211211_183951

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

Iamafnan avatar Dec 11 '21 13:12 Iamafnan

Update: Now it is showing details

Screenshot

IMG_20211212_105031

Iamafnan avatar Dec 12 '21 05:12 Iamafnan

Okay. So is this still an issue? Can it be closed? 😆

weilbith avatar Dec 13 '21 10:12 weilbith

It is not showing diff

Iamafnan avatar Dec 13 '21 10:12 Iamafnan

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())))

weilbith avatar Dec 13 '21 10:12 weilbith

This is the output IMG_20211213_221417

Iamafnan avatar Dec 13 '21 16:12 Iamafnan

My Neovim Config Language server: tsserver Neovim Version: 0.7.0-dev Language server version: 0.8.1

Iamafnan avatar Dec 13 '21 16:12 Iamafnan

same error for diff section here

jrafaaael avatar Jan 03 '22 21:01 jrafaaael

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.

image

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>                                                                                                                                                              
      }                                                                                                                                                                                        
    }                                                                                                                                                                                          
  }                                                                                                                                                                                            
}

mmirus avatar Jan 17 '22 20:01 mmirus

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.

gogongxt avatar Feb 03 '23 19:02 gogongxt

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.

gennaro-tedesco avatar Feb 07 '23 13:02 gennaro-tedesco

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

mblarsen avatar Jun 21 '23 01:06 mblarsen