Skip to content
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

Logging panel is too short #1810

Closed
detly opened this issue Jul 26, 2021 · 4 comments · Fixed by #2047
Closed

Logging panel is too short #1810

detly opened this issue Jul 26, 2021 · 4 comments · Fixed by #2047

Comments

@detly
Copy link

detly commented Jul 26, 2021

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:

  1. Go to Preferences > Package Settings > LSP > Settings.

  2. 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 command will probably have to change depending on how you installed RA.)

  3. Restart the language server, or open a Rust project.

  4. Open the LSP log panel.

  5. 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.

Peek 2021-07-26 13-08

Environment:

  • OS: Ubuntu 21.04
  • Sublime Text version: 4113
  • LSP version: 1.7.0
  • Language servers used: rust-analyzer
@rchl
Copy link
Member

rchl commented Jul 26, 2021

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.

@detly
Copy link
Author

detly commented Jul 26, 2021

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.

@predragnikolic
Copy link
Member

Found the cause.

There is a hard-coded value.

SERVER_PANEL_MAX_LINES = 500

The content of the panel is deleted with this code:

LSP/plugin/core/panels.py

Lines 191 to 192 in fe36b2d

if not erase_region.empty():
self.view.erase(edit, erase_region)

IMO not sure if the delete code is necessary.

@rchl
Copy link
Member

rchl commented Sep 6, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants