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

No Diagnostics in Projects with NeoVim and autoCheckFile = false #281

Open
janAkali opened this issue Jan 14, 2025 · 2 comments
Open

No Diagnostics in Projects with NeoVim and autoCheckFile = false #281

janAkali opened this issue Jan 14, 2025 · 2 comments

Comments

@janAkali
Copy link

janAkali commented Jan 14, 2025

System:

Linux openSUSE Tumbleweed 20250109 x86_64
Kernel: Linux 6.12.8-2-default

Neovim:

$ nvim -v
NVIM v0.10.3
Build type: RelWithDebInfo
LuaJIT 2.1.1731601260

Langserver (tested github release, stable from nimble and latest commit):

$ nimlangserver --version
1.6.0

Nimsuggest (comes with Nim 2.0.14 by default):

$ nimsuggest --version
Nim Compiler Version 2.0.14 [Linux: amd64]
Compiled at 2024-12-23
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: bf4de6a394e040d9810cba8c69fb2829ff04dcc6
active boot switches: -d:release -d:danger --gc:markAndSweep

Neovim config:

local Plug = vim.fn['plug#']
vim.call('plug#begin', '~/.config/nvim/plugged')
  Plug 'neovim/nvim-lspconfig'
vim.call('plug#end')


-- LSP completion
vim.api.nvim_create_autocmd('LspAttach', {
  group = vim.api.nvim_create_augroup('UserLspConfig', {}),
  callback = function(ev)
    -- Enable completion triggered by <c-x><c-o>
    vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
  end
})

require('lspconfig').nim_langserver.setup{
  settings = {
    nim = {
      autoCheckProject = true,
      autoCheckFile = false,
      nimsuggestTimeout = 300000,
    }
  }
}

:LspInfo :

lspconfig: require("lspconfig.health").check()

LSP configs active in this session (globally) ~
- Configured servers: nim_langserver
- OK Deprecated servers: (none)

LSP configs active in this buffer (bufnr: 1) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `nim`
- 1 client(s) attached to this buffer
- Client: `nim_langserver` (id: 1, bufnr: [1])
  root directory:    ~/Fluffy/code/playground/lsp_bug/
  filetypes:         nim
  cmd:               ~/.nimble/bin/nimlangserver
  version:           `1.6.0`
  executable:        true
  autostart:         true

...

:checkhealth lsp :

vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /home/janakali/.local/state/nvim/lsp.log
- Log size: 147 KB

vim.lsp: Active Clients
- nim_langserver (id: 1)
    Root directory: ~/Fluffy/code/playground/lsp_bug
    Command: /home/janakali/.nimble/bin/nimlangserver
    Settings: {
      nim = {
        autoCheckFile = false,
        autoCheckProject = true,
        nimsuggestTimeout = 300000
      }
    }
    Attached buffers: 1

vim.lsp: File Watcher
- file watching "(workspace/didChangeWatchedFiles)" disabled on all clients

vim.lsp: Position Encodings
- No buffers contain mixed position encodings

Reproduction steps:

$ mkdir lsp_bug
$ cd lsp_bug
$ nimble init -y
<edit `src/lsp_bug.nim` to introduce syntax error>
$ nvim src/ls_bug.nim
<no diagnostics, no errors, lsp completion works>
<edit something again>
:w
<still no diagnostics or errors>

Single source files outside of projects work as expected.

I can definitely remember this working more than a month ago, but can't get diagnostics to work with old langserver + old neovim. Very weird.

@janAkali
Copy link
Author

~/.local/state/nvim/lsp.log

[START][2025-01-14 12:33:38] LSP logging initiated
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Starting nimlangserver                     version=1.6.0 params="(clientProcessId: none(int), transport: some(stdio), port: 0)"\nDBG Starting stdio server                     \n'
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"initialize\\""\n'
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Initialize received...                    \nDBG Registering monitor for process            pid=87916\n"
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Initialize completed. Trying to start nimsuggest instances\n"
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Starting nimsuggest for entry point        entry=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Starting createOrRestartNimsuggest         projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim uri=\n"
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Using {nimVersion}                         nimVersion="Nim Compiler Version 2.0.14 [Linux: amd64] from /home/janakali/.local/share/grabnim/current/bin"\nDBG Creating new nimsuggest project            projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\n'
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"INF Starting nimsuggest                        root=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim timeout=120000 path=/home/janakali/.local/share/grabnim/current/bin/nimsuggest workingDir=/home/janakali/Fluffy/code/playground/lsp_bug\n"
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Parsing nimsuggest capability              capability=con\n"
[ERROR][2025-01-14 12:33:38] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Parsing nimsuggest capability              capability=unknownFile\nDBG Nimsuggest Capabilities                    capabilities="{con, unknownFile}"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Nimsuggest port                            portLine=43615\n"
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Nimsuggest initialized successfully        projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG ShowMessage                                message="Nimsuggest initialized for /home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim"\nDBG [Processsing Message]                      request="\\"initialized\\""\nDBG Client initialized.                       \nDBG Requesting configuration from the client  \nDBG [Processsing Message]                      request="\\"workspace/didChangeConfiguration\\""\nDBG Changed configuration:                     conf="{\\"settings\\":{\\"nim\\":{\\"autoCheckProject\\":true,\\"autoCheckFile\\":false,\\"nimsuggestTimeout\\":300000}}}"\nDBG [Processsing Message]                      request="\\"textDocument/didOpen\\""\nDBG New document opened for URI:               uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Auto-guessing project file for             file=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Found nimble project                       projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG processQueue                               size=1\nDBG Started...                                 benchmark="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG timeoutCallback is set                     timeout=120000 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Received the following configuration       configuration="[{\\"autoCheckProject\\":true,\\"autoCheckFile\\":false,\\"nimsuggestTimeout\\":300000}]"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Sending result(s)                          length=1 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG CPU Time                                   benchmark="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" time=0.247 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG isKnown                                    filePath=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim sug=true\n"
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG getProjectFile                             project=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim fileUri=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Document associated with the following projectFile uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\n"
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG ShowMessage                                message="Opening file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim"\n'
[ERROR][2025-01-14 12:33:39] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG processQueue                               size=1\nDBG Started...                                 benchmark="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG timeoutCallback is set                     timeout=120000 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:40] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Sending result(s)                          length=1 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:40] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG CPU Time                                   benchmark="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" time=0.249 command="known \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG isKnown                                    filePath=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim sug=true\n'
[ERROR][2025-01-14 12:33:53] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didChange\\""\n'
[ERROR][2025-01-14 12:33:53] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didChange\\""\n'
[ERROR][2025-01-14 12:33:54] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didChange\\""\n'
[ERROR][2025-01-14 12:33:54] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didChange\\""\n'
[ERROR][2025-01-14 12:33:57] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didSave\\""\n'
[ERROR][2025-01-14 12:33:57] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG processQueue                               size=1\n"
[ERROR][2025-01-14 12:33:57] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Started...                                 benchmark="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG timeoutCallback is set                     timeout=120000 command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:57] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Checking project                           uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\n"
[ERROR][2025-01-14 12:33:57] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	"DBG Running diagnostics                        uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\n"
[ERROR][2025-01-14 12:33:58] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG Sending result(s)                          length=0 command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:33:58] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG CPU Time                                   benchmark="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" time=0.130 command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\n'
[ERROR][2025-01-14 12:34:14] .../vim/lsp/rpc.lua:770	"rpc"	"/home/janakali/.nimble/bin/nimlangserver"	"stderr"	'DBG [Processsing Message]                      request="\\"textDocument/didSave\\""\nDBG processQueue                               size=1\nDBG Started...                                 benchmark="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0" command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG timeoutCallback is set                     timeout=120000 command="changed \\"/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\\":0:0"\nDBG Checking project                           uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Running diagnostics                        uri=file:///home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG [Processsing Message]                      request="\\"shutdown\\""\nDBG Shutting down                             \nDBG stopping child nimsuggest processes       \nDBG Stopping nimsuggest for                    root=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Stopped nimsuggest                         res=ok()\nDBG NimSuggest needed to be restarted due to an error \nWRN Server stopped.                            projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim\nDBG Starting createOrRestartNimsuggest         projectFile=/home/janakali/Fluffy/code/playground/lsp_bug/src/lsp_bug.nim uri=\n'

@janAkali
Copy link
Author

Also, probably related: with autoCheckFile = true and inside a project LSP doesn't check file until you type something.

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

No branches or pull requests

1 participant