julia-vscode / LanguageServer.jl

An implementation of the Microsoft Language Server Protocol for the Julia language.
Other
355 stars 75 forks source link

No diagnostics on NeoVim in single file mode #1287

Open head-gardener opened 1 month ago

head-gardener commented 1 month ago

I've tried both Mason and nvim-lspconfig, both accompanied by the configuration from wiki. Server reports no errors on startup, but responds with empty diagnostics:

[DEBUG][2024-05-17 15:44:55] .../vim/lsp/rpc.lua:286       "rpc.send"      {  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    text = "function func(a, b)\n    println(a)\n    println(b)\nend\n\nfunc(a, b, c)\n",    textDocument = {      uri = "file:///home/hunter/uni/nm/1.jl"    }  }}
[DEBUG][2024-05-17 15:44:55] .../vim/lsp/rpc.lua:408       "rpc.receive"   {  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///home/hunter/uni/nm/1.jl",    version = 0  }}

vscode works fine. I run NixOS, nvim is 0.10.0, server is 4.5.1.

pfitzseb commented 1 month ago

What's the julia.lint.call option set to in those configs?

head-gardener commented 1 month ago

What's the julia.lint.call option set to in those configs?

It's true, as per the defaults. Server returns no diagnostics regardless of the code though.

ronisbr commented 1 month ago

Same thing here! However, I saw that the problem only happens if I open file in standalone mode. For example, if I create a project and open a file inside this project, I see:

Captura de Tela 2024-05-17 às 11 29 46

However, if the file is outside this project folder, I see:

Captura de Tela 2024-05-17 às 11 30 31
ronisbr commented 1 month ago

Notice that the server is working in the standalone mode because I am seeing inlay hints. I also tried with an empty default environment.

head-gardener commented 1 month ago

Thanks, I confirm that too. touch Project.toml does add diagnostics.