Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Diff and Details not showing #35

Open
Iamafnan opened this issue Dec 11, 2021 · 11 comments
Open

Diff and Details not showing #35

Iamafnan opened this issue Dec 11, 2021 · 11 comments

Comments

@Iamafnan
Copy link

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
Copy link
Author

Update: Now it is showing details

Screenshot

IMG_20211212_105031

@weilbith
Copy link
Owner

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

@Iamafnan
Copy link
Author

It is not showing diff

@weilbith
Copy link
Owner

weilbith commented Dec 13, 2021

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

@Iamafnan
Copy link
Author

This is the output
IMG_20211213_221417

@Iamafnan
Copy link
Author

Iamafnan commented Dec 13, 2021

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

@jrafaaael
Copy link

same error for diff section here

@mmirus
Copy link

mmirus commented Jan 17, 2022

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

@gxt-kt
Copy link

gxt-kt commented Feb 3, 2023

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.

@gennaro-tedesco
Copy link

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.

@mblarsen
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants