cameron-martin / bazel-lsp

A language server implementation for Bazel
Apache License 2.0
35 stars 1 forks source link

Add verbose mode debugging porposes #37

Open Akiyamka opened 1 month ago

Akiyamka commented 1 month ago

bazel-lsp in pair with vscode-bazel spams endlessly with an error when hovering over rules imported from other files.

Log from bazel-lsp:

Request textDocument/hover failed.
  Message: Os {
    code: 2,
    kind: NotFound,
    message: "No such file or directory",
}
  Code: 0 
[Error - 1:50:32 PM] Request textDocument/definition failed.
  Message: Os {
    code: 2,
    kind: NotFound,
    message: "No such file or directory",
}
  Code: 0 
[Error - 1:50:33 PM] Request textDocument/hover failed.
  Message: Os {
    code: 2,
    kind: NotFound,
    message: "No such file or directory",
}
  Code: 0 

... and so on.

Unfortunately this information is not enough to understand what file or directory it is trying to find, and where. Would be cool to add more info to those messages, probably under --verbose flag

bazel-lsp version: 0.6.0

P.S. One another bug - incorrect version reporting

$ ./bazel-lsp-0.6.0-linux-amd64 -V
bazel-lsp 0.0.0
cameron-martin commented 1 month ago

I suspect this is an issue in https://github.com/facebook/starlark-rust. Do you mind opening an issue there?

cameron-martin commented 1 week ago

I think this is actually the result of directly converting io::Error to anyhow::Error, and io::Error doesn't contain great info on which file you are trying to open. It would be great if we could get the language server to print stack traces, so we know where this is coming from.

Do you have a reproducer for this, so I can have a play around?

Akiyamka commented 1 week ago

I don't have anything on hand that I can post publicly, but I'll try to create a new project on bazel 6.5 like I have, I think it will work, let me check

Akiyamka commented 1 week ago

unfortunately I was unable to reproduce it separately