Closed syyyr closed 3 years ago
@syyyr The stack trace above seem to be not from master, right? It's difficult to say without a reproducible example. Yang lsp scoping process computation in different phases, the error message says that somehow a processing request was added to phase A where phase A already finished and phase B is started.
Okay, I did some research on this. The error only happens if my current directory has this kind structure:
$ ls
first.yang other.yang
Contents of the files:
first.yang
:
submodule first {
include other;
}
other.yang
submodule other {
}
If I try to run the server with these files in my current directory, the server fails with an error. This error is a bit different than what I posted in the original post: here is the log. The version is current master.
If I remove one of the files, or remove the include
statement, the server runs fine and works correctly (for this example, it says that a submodule needs a belongs-to
statement - which is correct).
I don't know how to run the server without coc.nvim (which serves is my LSP client), but I would be glad to follow your instructions on how to run the server without it. Just running the executable seems to do nothing (I know nothing about LSP communication).
@syyyr
This error is a bit different
The error is very different from the original post. This error is a NullPointer exception because of missing belongs-to
. I Fixed that in current master.
There must be a different constellation of module/submodule/import that causes the original exception you posted. Please try to reproduce your exception with the current state. It looks like a bad bug in the current scoping implementation and I would like to fix it.
The current version now fixes the null pointer exception.
How to reproduce the other error: 1) Put these files into your working directory:
Side note: the way I found out about this is that I use libyang as a submodule in my main repository. That's why everytime I opened a .yang file, the server would recurse into the submodule and crash on libyang's schemas. Even my previous reproducer is based on these two files. It might be possible that more errors would occur if one were to copy all of the yang schemas from the tests/schema/yang/files
subdirectory to their working directory.
@syyyr
The exception occurs because the main_mod
doesn't exists e.g. here belongs-to main_mod
This should definitely not prevent the language server to start.
I added a try catch around the problematic call, you will probably see the exception logged, but the server should start anyway. Please try the current master state
With the new version, I can no longer reproduce this bug, so I'm closing this issue. Thank you for the fix. I do have another problem, but I think I'll create a new issue for that.
Hi, I'm not sure when, but at some point the server stopped working for me. I suspect it is because of some sort of a system update, but I'm not sure. I use Arch Linux. This is the error message I get:
Do you know what causes this? I tried using version 0.3.1, 0.4.0, and current master. Although I do remember, that it did work at some point and then stopped working (without changing the version of yang-lsp).