LSP
LSP copied to clipboard
Logging panel is too short
I am trying to debug an issue with rust-analyzer. According to the RA docs I can get some useful information out of it by increasing logging. When I do that, by the time I can open the LSP log panel, the relevant messages are gone.
To Reproduce Steps to reproduce the behavior:
-
Go to Preferences > Package Settings > LSP > Settings.
-
Add:
{ "clients": { "rust-analyzer": { "command": ["~/.cargo/bin/rustup", "run", "nightly", "rust-analyzer"], "enabled": true, "env": { "RA_LOG": "rust_analyzer=info", } }, }, "log_max_size": 0, }(Note that the
commandwill probably have to change depending on how you installed RA.) -
Restart the language server, or open a Rust project.
-
Open the LSP log panel.
-
Watch as the relevant messages disappear out of the top of the panel.
I am not just talking about scrolling here, scrolling the panel contents up will still hit this limit.
This information is not available via the remote log setting.
Expected behavior I would expect to be able to set this somewhere.
Screenshots
Here's a GIF! I did not want to capture my actual code, but shortly after the GIF starts, I am restarting the RA language server.

Environment:
- OS: Ubuntu 21.04
- Sublime Text version: 4113
- LSP version: 1.7.0
- Language servers used:
rust-analyzer
There is the log_max_size setting that you can increase.
Though maybe if the server has so much output, it would be best to also support logging to file.
I could be wrong, but I think that setting is for line length, not total number of lines. At any rate, setting it to zero did not change this.
Found the cause.
There is a hard-coded value. https://github.com/sublimelsp/LSP/blob/fe36b2d2c05126e9469fa3882dbff6731ce4a6b8/plugin/core/panels.py#L8
The content of the panel is deleted with this code: https://github.com/sublimelsp/LSP/blob/fe36b2d2c05126e9469fa3882dbff6731ce4a6b8/plugin/core/panels.py#L191-L192
IMO not sure if the delete code is necessary.
Well, without it the log would fill up with no end. Could easily reach megabytes of text. Also I guess the syntax highlighting would stop working after some point.