sidebar.nvim icon indicating copy to clipboard operation
sidebar.nvim copied to clipboard

Diagnostics section

Open RAprogramm opened this issue 2 years ago • 26 comments

Not showing python diagnostic

RAprogramm avatar Jan 20 '22 10:01 RAprogramm

Do you have a language server configured? Diagnostic information will only be available if you have Neovim lsp configured.

davysson avatar Jan 20 '22 15:01 davysson

yes. all configured. but still. all good for lua, but problem with python

RAprogramm avatar Jan 20 '22 15:01 RAprogramm

hi @RAprogramm we need a bit more info to track this down.

  • nvim version
  • language server name
  • your sidebar setup

GustavoKatel avatar Jan 21 '22 02:01 GustavoKatel

  1. nvim v0.6.1 build type: release
  2. i tryed pyright, jedi and pyls.

sidebar_config

RAprogramm avatar Jan 21 '22 09:01 RAprogramm

maybe problem with virtual enviroment?

RAprogramm avatar Jan 21 '22 10:01 RAprogramm

diagnostics here is what i am telling about

RAprogramm avatar Jan 21 '22 11:01 RAprogramm

also i find this icons_problem not critical, but sometimes icons looks pretty, and sometimes like this

RAprogramm avatar Jan 21 '22 11:01 RAprogramm

in sidebar.lua you don't have diagnostics listed as one of the sections enabled (lines 8-12) and yet you have it in the sidebar.

1- Please make sure to have diagnostics listed in the enabled sections. 2- How and where are calling sidebar.lua in your dotfiles?

GustavoKatel avatar Jan 22 '22 18:01 GustavoKatel

No no, when I posted previous screenshot, "diagnostocs" was in my config section. .nvim/lua/config/sidebar.lua

RAprogramm avatar Jan 22 '22 19:01 RAprogramm

hi @RAprogramm did u manage to get it working? if not, do you have your dotfiles available so I can take a look?

GustavoKatel avatar Feb 05 '22 01:02 GustavoKatel

https://github.com/RAprogramm/neovim-IDE this is my neovim config. diagnostic still not working in virtualenvironment python. in lua works good.

RAprogramm avatar Feb 05 '22 06:02 RAprogramm

image

I cannot reproduce unfortunately. In the screenshot I'm using your dotenv, pyright, debian (sid) and neovim 0.6.1. It works in both a virtualenv and outside of a virtualenv.

A couple of things you can try tho:

1- try running :LspInfo and check that your lsp is running properly. 2- run :lua vim.diagnostic.setqflist() and see if the quickfix is populated correctly.

Let me know what you get with the commands above.

GustavoKatel avatar Feb 13 '22 20:02 GustavoKatel

I've just run into the same issue but with lua. My diagnostic section is empty. My sidebar configuration:

require("sidebar-nvim").setup({
	["diagnostics"] = {
		icon = "",
	},
	sections = { "datetime", "git", "diagnostics" },
})

Results of :LspInfo:

   Language client log: /home/kghost/.cache/nvim/lsp.log
           Detected filetype:   lua
  
      1 client(s) attached to this buffer:

   Client: sumneko_lua (id: 1, pid: 480206, bufnr: [12])
       filetypes:       lua
       autostart:       true
       root directory:  /home/kghost/workspace/dot-files
       cmd:             lua-language-server

   Configured servers list: vimls, rnix, yamlls, sumneko_lua, tsserver, bashls

Results of :lua vim.diagnostic.setqflist():

programs/neovim/init.lua|2 col 20-23 warning| Undefined global `vim`.
  1 programs/neovim/init.lua|19 col 1-4 warning| Undefined global `vim`.
  2 programs/neovim/init.lua|23 col 1-4 warning| Undefined global `vim`.
  3 programs/neovim/init.lua|24 col 1-4 warning| Undefined global `vim`.
  4 programs/neovim/init.lua|31 col 3-6 warning| Undefined global `vim`.
  5 programs/neovim/init.lua|53 col 3-6 warning| Undefined global `vim`.
  6 programs/neovim/init.lua|64 col 22-25 warning| Undefined global `vim`.
  7 programs/neovim/init.lua|82 col 11-14 warning| Undefined global `vim`.
  8 programs/neovim/init.lua|83 col 4-7 warning| Undefined global `vim`.
  9 programs/neovim/init.lua|261 col 1-4 warning| Undefined global `vim`.
[Quickfix List] Diagnostics     

ghostbuster91 avatar May 01 '22 15:05 ghostbuster91

hi @ghostbuster91

are you still experiencing this issue with the latest Sidebar updates?

if so, what version of neovim are you using?

GustavoKatel avatar Jun 04 '22 22:06 GustavoKatel

It seems that diagnostics only update on file save, while it should update every time e.g enter normal mode

Suyashtnt avatar Jun 23 '22 16:06 Suyashtnt

it actually updates using an autocommand event called DiagnosticChanged (see: https://neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

GustavoKatel avatar Jun 23 '22 16:06 GustavoKatel

it actually updates using an autocommand event called DiagnosticChanged (see: neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

For me it only updated on file save. Strange

Suyashtnt avatar Jun 23 '22 16:06 Suyashtnt

it actually updates using an autocommand event called DiagnosticChanged (see: neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

For me it only updated on file save. Strange

🤔 what happens if you call :lua vim.diagnostic.setqflist({open = true }) before saving? Does it show the expected results?

also what language server and neovim version are you using?

GustavoKatel avatar Jun 23 '22 16:06 GustavoKatel

it actually updates using an autocommand event called DiagnosticChanged (see: neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

For me it only updated on file save. Strange

thinking what happens if you call :lua vim.diagnostic.setqflist({open = true }) before saving? Does it show the expected results?

also what language server and neovim version are you using?

Doesnt show any results. Neovim nightly, LSP is eslint and tsserver

Suyashtnt avatar Jun 23 '22 17:06 Suyashtnt

it actually updates using an autocommand event called DiagnosticChanged (see: neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

For me it only updated on file save. Strange

thinking what happens if you call :lua vim.diagnostic.setqflist({open = true }) before saving? Does it show the expected results? also what language server and neovim version are you using?

Doesnt show any results. Neovim nightly, LSP is eslint and tsserver

Any chance it's an issue with your setup? I'm also using both eslint and tsserver and they update fine the qflist, but I'm using 0.7

GustavoKatel avatar Jun 23 '22 17:06 GustavoKatel

it actually updates using an autocommand event called DiagnosticChanged (see: neovim.io/doc/user/diagnostic.html#DiagnosticChanged)

For me it only updated on file save. Strange

thinking what happens if you call :lua vim.diagnostic.setqflist({open = true }) before saving? Does it show the expected results? also what language server and neovim version are you using?

Doesnt show any results. Neovim nightly, LSP is eslint and tsserver

Any chance it's an issue with your setup? I'm also using both eslint and tsserver and they update fine the qflist, but I'm using 0.7

What I mean is setqflist works fine, its just sidebar isnt showing anything when i run the cmd

Suyashtnt avatar Jul 04 '22 13:07 Suyashtnt

you're saying that you can see the qflist populated with the diagnostics?

both setqflist and the diagnostics section uses the same source of diagnostics 🤔

would you be able to create a minimal config that replicates the problem?

GustavoKatel avatar Jul 04 '22 14:07 GustavoKatel

you're saying that you can see the qflist populated with the diagnostics?

both setqflist and the diagnostics section uses the same source of diagnostics thinking

would you be able to create a minimal config that replicates the problem?

I am not very good with minimal configs sadly. My full config is in https://github.com/Suyashtnt/dotfiles/tree/master/users/tntman/config/nvim

Suyashtnt avatar Jul 04 '22 14:07 Suyashtnt

I also encountered the same issue. I'm also in nightly so maybe there is something with that.

Ran :lua vim.diagnostic.setqflist({open = true }) and everything seems fine image

Editing and saving the buffer I was able to make it work once. but just for a while

rodrigoEsquel avatar Sep 12 '23 10:09 rodrigoEsquel

I'll try to do a minimal replication of the error because I'd really like it to get it working. I love the plugin!

rodrigoEsquel avatar Sep 12 '23 10:09 rodrigoEsquel

I was able to get it working by removing one of the two checks that see if the buffers are open in tho diagnostic component.

Particularly, open_bufs[bufnr] was almost always throwing nil

image

I don't know what side effects this can bring, tho.

rodrigoEsquel avatar Sep 29 '23 10:09 rodrigoEsquel