Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics section #35

Open
RAprogramm opened this issue Jan 20, 2022 · 26 comments
Open

Diagnostics section #35

RAprogramm opened this issue Jan 20, 2022 · 26 comments
Labels
bug Something isn't working

Comments

@RAprogramm
Copy link

Not showing python diagnostic

@davysson
Copy link
Collaborator

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

@RAprogramm
Copy link
Author

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

@GustavoKatel
Copy link
Member

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

  • nvim version
  • language server name
  • your sidebar setup

@GustavoKatel GustavoKatel added the bug Something isn't working label Jan 21, 2022
@RAprogramm
Copy link
Author

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

sidebar_config

@RAprogramm
Copy link
Author

maybe problem with virtual enviroment?

@RAprogramm
Copy link
Author

diagnostics
here is what i am telling about

@RAprogramm
Copy link
Author

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

@GustavoKatel
Copy link
Member

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

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

@GustavoKatel
Copy link
Member

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

@RAprogramm
Copy link
Author

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

@GustavoKatel
Copy link
Member

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

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

hi @ghostbuster91

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

if so, what version of neovim are you using?

@Suyashtnt
Copy link

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

@GustavoKatel
Copy link
Member

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

@Suyashtnt
Copy link

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

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

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

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

Suyashtnt commented Jul 4, 2022

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

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

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

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

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants