navigator.lua icon indicating copy to clipboard operation
navigator.lua copied to clipboard

error in disgnostics.lua

Open ExpandingMan opened this issue 1 month ago • 6 comments

I get the following error whenever I have navigator installed and inabled and type something that brings up LSP completions (with cmp).

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:573: Unexpected option type: "D"
stack traceback:                                                                                                                                                                                                                                             
        [C]: in function 'error'                                                                                                                                                                                                                             
        /usr/share/nvim/runtime/lua/vim/diagnostic.lua:573: in function 'resolve_optional_value'                                                                                                                                                             
        /usr/share/nvim/runtime/lua/vim/diagnostic.lua:586: in function 'get_resolved_options'                                                                                                                                                               
        /usr/share/nvim/runtime/lua/vim/diagnostic.lua:2119: in function 'show'                                                                                                                                                                              
        /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1174: in function 'set'                                                                                                                                                                               
        /usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:229: in function 'handle_diagnostics'                                                                                                                                                             
        /usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:240: in function 'on_publish_diagnostics'                                                                                                                                                         
        ...re/nvim/lazy/navigator.lua/lua/navigator/diagnostics.lua:206: in function 'handler'                                                                                                                                                               
        /usr/share/nvim/runtime/lua/vim/lsp/client.lua:1117: in function ''                                                                                                                                                                                  
        vim/_editor.lua: in function <vim/_editor.lua:0>     

Obviously it's coming from inside the diagnostics module, but I haven't figured out a work around.

ExpandingMan avatar Nov 03 '25 23:11 ExpandingMan

Thanks for raising the issue. I have not seen this issue so far. Do you have a specific setup for diagnostic? When will the error pop up?

ray-x avatar Nov 04 '25 09:11 ray-x

My full config can be found here (navigator.lua currently commented out).

It seems to happen whenever I do something that triggers cmp, it's not entirely clear to me what's causing it.

ExpandingMan avatar Nov 04 '25 14:11 ExpandingMan

Do you enabled diagnostics in edit mode(so diagnostic will run on every keystroke?) What language server are you using?

ray-x avatar Nov 05 '25 01:11 ray-x

This was tinymist. I think it happened also with nushell but I'd have to verify that. I didn't think I have diagnostics on in edit mode, but I still have some lspsaga defaults, so I think I might. I see I have Lspsaga.setup{diagnostic={keys={exec_action="e"}}}} so that might be what that is.

ExpandingMan avatar Nov 05 '25 14:11 ExpandingMan

I am also seeing this same error. As soon as I make a change on a PHP file I get this error. If I disable LSP with :LspStop the error goes away (but basically that turns off LSP).

I'm using LazyVim on NeoVim v0.12. This is the exact error trace:

vim.schedule callback: ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/diagnostic.lua:600: Unexpected option type: "D"                                                                                                                           
stack traceback:                                                                                                                                                                                                                              
        [C]: in function 'error'                                                                                                                                                                                                              
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/diagnostic.lua:600: in function 'resolve_optional_value'                                                                                                                                 
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/diagnostic.lua:613: in function 'get_resolved_options'                                                                                                                                   
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/diagnostic.lua:2264: in function 'show'                                                                                                                                                  
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/diagnostic.lua:1354: in function 'set'                                                                                                                                                   
        ...bkMAaN/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:242: in function 'handle_diagnostics'                                                                                                                                     
        ...bkMAaN/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:253: in function 'on_publish_diagnostics'                                                                                                                                 
        ...re/nvim/lazy/navigator.lua/lua/navigator/diagnostics.lua:206: in function 'handler'                                                                                                                                                
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/lsp/client.lua:1182: in function '_notification'                                                                                                                                         
        ...nvimbkMAaN/usr/share/nvim/runtime/lua/vim/lsp/client.lua:450: in function ''                                                                                                                                                       
        vim/_editor.lua: in function <vim/_editor.lua:0>

If I run :lua =vim.diagnostic.config() (As ChatGPT suggested) I see the following:

{                                                                                                                                                                                                                                             
  bufferline = true,                                                                                                                                                                                                                          
  enable = true,                                                                                                                                                                                                                              
  float = {                                                                                                                                                                                                                                   
    border = "rounded",                                                                                                                                                                                                                       
    focusable = false,                                                                                                                                                                                                                        
    header = "",                                                                                                                                                                                                                              
    prefix = "",                                                                                                                                                                                                                             
    source = "always",                                                                                                                                                                                                                        
    style = "minimal"                                                                                                                                                                                                                         
  },                                                                                                                                                                                                                                          
  hdlr = false,                                                                                                                                                                                                                               
  jump = {                                                                                                                                                                                                                                    
    wrap = true                                                                                                                                                                                                                               
  },                                                                                                                                                                                                                                          
  register = "D",                                                                                                                                                                                                                             
  severity_sort = {                                                                                                                                                                                                                           
    reverse = true                                                                                                                                                                                                                            
  },                                                                                                                                                                                                                                          
  signs = {                                                                                                                                                                                                                                   
    text = { "📛", "👎", "👩", "💁" }                                                                                                                                                                                                         
  },                                                                                                                                                                                                                                          
  underline = true,                                                                                                                                                                                                                           
  update_in_insert = false,                                                                                                                                                                                                                   
  virtual_lines = {                                                                                                                                                                                                                           
    current_line = false                                                                                                                                                                                                                      
  },                                                                                                                                                                                                                                          
  virtual_text = {                                                                                                                                                                                                                            
    prefix = "🦊",                                                                                                                                                                                                                            
    source = true,                                                                                                                                                                                                                            
    spacing = 3                                                                                                                                                                                                                               
  }                                                                                                                                                                                                                                           
} 

I suspect the issue is with the line register = "D" but I'm pretty clueless of why that line is causing issues and I don't seem to have anything like that in my config in the ~/.config/nvim/lua

cesarmiquel avatar Nov 06 '25 04:11 cesarmiquel

I can try to collect some more info later on the cause, but I lazy-solved this at some point by adding to my navigator config

lsp = {diagnostic = { register= true}}

I'm not entirely sure what I've given up, but I don't get the error and seem to get everything I want...

jcristy avatar Nov 18 '25 18:11 jcristy