sidebar-nvim / sidebar.nvim

A generic and modular lua sidebar for Neovim
758 stars 32 forks source link

Diagnostics section #35

Open RAprogramm opened 2 years ago

RAprogramm commented 2 years ago

Not showing python diagnostic

davysson commented 2 years ago

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

RAprogramm commented 2 years ago

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

GustavoKatel commented 2 years ago

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

RAprogramm commented 2 years ago
  1. nvim v0.6.1 build type: release
  2. i tryed pyright, jedi and pyls.
  3. sidebar_config

RAprogramm commented 2 years ago

maybe problem with virtual enviroment?

RAprogramm commented 2 years ago

diagnostics here is what i am telling about

RAprogramm commented 2 years ago

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

GustavoKatel commented 2 years ago

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?

RAprogramm commented 2 years ago

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

GustavoKatel commented 2 years ago

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

RAprogramm commented 2 years ago

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

GustavoKatel commented 2 years ago

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.

ghostbuster91 commented 2 years ago

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     
GustavoKatel commented 2 years ago

hi @ghostbuster91

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

if so, what version of neovim are you using?

Suyashtnt commented 2 years ago

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

GustavoKatel commented 2 years ago

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

Suyashtnt commented 2 years ago

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

GustavoKatel commented 2 years ago

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?

Suyashtnt commented 2 years ago

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

GustavoKatel commented 2 years ago

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

Suyashtnt commented 2 years ago

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

GustavoKatel commented 2 years ago

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?

Suyashtnt commented 2 years ago

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

rodrigoEsquel commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.