-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
server must always send publishDiagnostics with a URI #169
Comments
I have the same issue. When I intercepted the message in the diagnostics handling code I got the following: {
diagnostics = { {
message = "`GOBJECT' is already defined",
severity = 2
} }
} The Neovim client expect there to be a URI entry as well, and the specification for textDocument/publishDiagnostics seems to agree: interface PublishDiagnosticsParams {
/**
* The URI for which diagnostic information is reported.
*/
uri: DocumentUri;
/**
* Optional the version number of the document the diagnostics are published
* for.
*
* @since 3.15.0
*/
version?: uinteger;
/**
* An array of diagnostic information items.
*/
diagnostics: Diagnostic[];
} EDIT: Here is a sample Vala file which triggered the behaviour: /**
* Baby's first Vala class.
*
* I have no idea what I'm doing here.
*/
public class MyClass : GLib.Object {
public int i = 3;
} |
If a diagnostic is not associated with a file, associate it with the project root folder, rather than sending "null"
@EbonJaeger @HiPhish could you test VLS from the |
@Prince781 thanks for looking into this! I have good news and bad news. The good news: the particular error no longer appears. The bad news: instead it throws a few of these errors: --- Store Diagnostic[] by line
---
---@param diagnostics Diagnostic[]
---@return table<number, Diagnostic[]>
local _diagnostic_lines = function(diagnostics)
if not diagnostics then return end
local diagnostics_by_line = {}
for _, diagnostic in ipairs(diagnostics) do
local start = diagnostic.range.start -- <= Line 220
local line_diagnostics = diagnostics_by_line[start.line]
if not line_diagnostics then
line_diagnostics = {}
diagnostics_by_line[start.line] = line_diagnostics
end
table.insert(line_diagnostics, diagnostic)
end
return diagnostics_by_line
end I'm not really familiar enough with the protocol to be of much help, unfortunately. :/ |
If a diagnostic is not associated with a file, associate it with the project root folder, rather than sending "null"
@EbonJaeger try again now |
I get a seqfault:
The same happens on |
Everything seems to be working fine for me now. :D |
@HiPhish I think you should produce a stack trace and then create a new bug report. |
If a diagnostic is not associated with a file, associate it with the project root folder, rather than sending "null"
Describe the bug
I know this is probably unsupported, but I am trying to get vala-language-server to work with Neovim's built-in LSP support in the 0.5.0 nightlies. For the short time it's usable, it seems to work well, but there seems to be an issue with diagnostics reporting. I'm not sure yet if this is an issue with the language server, or Neovim's implementation, but figured I'd try here first.
The error shown inside Neovim is:
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/uri.lua:116: attempt to index local 'uri' (a nil value)
I traced this back to the diagnostics reporting seemingly passing a
nil
code location here:https://github.com/neovim/neovim/blob/35325ddac04b1b59b7982797021cdaabdabc87fb/runtime/lua/vim/lsp/diagnostic.lua#L956
Configuration
I think these are the minimum things needed to replicate the environment:
~/.config/nvim/lua/lsp_config/vala_language_server.lua
:~/.config/nvim/lua/lsp_config.lua
:~/.config/nvim/lua/init.lua
:~/.config/nvim/init.vim
:Software
OS and version (e.g. Ubuntu 20.04): Solus 4.1
Code editor (e.g. VSCode): Neovim
Vala Language Server (e.g. git commit, or PPA/AUR version): 0.48.1 (
a22be6b8faf7099db5b04e92ffedcb1e4792828c
)Vala version (
valac --version
): 0.48.9 and 0.50.1To Reproduce
Source code repo: https://github.com/solus-project/budgie-desktop
Steps to reproduce the behavior:
src/raven/raven.vala
The text was updated successfully, but these errors were encountered: