Giter Club home page Giter Club logo

Comments (6)

rchl avatar rchl commented on June 25, 2024 2

If there was a setting to keep the server running as long as I have a Rust project open, that would be ideal to me.

There could be a global setting that changes the current behavior. It would affect all servers though.

Alternatively there could be a per-server setting to decide that.

Some servers like LSP-json start very fast and are not really project-aware so in those cases it shouldn't be noticeable if those are closed so maybe a per-server setting makes more sense.

from lsp.

LPGhatguy avatar LPGhatguy commented on June 25, 2024 1

VS Code does not have this issue, at least with rust-analyzer. Once a Rust file is opened in a workspace, the server is started and it isn't closed until the workspace is closed. I think this is a significantly better behavior.

This is a standard behavior of https://github.com/sublimelsp/LSP that the server is closed after few seconds once the last file using it is closed. This is to not keep unused servers in memory taking space unnecessarily.

Is that behavior implemented in the LSP extension, or here, in LSP-rust-analyzer?

In my personal workflow I tend to always keep some files open and don't clean up the whole workspace before opening a new file. And I imagine this to be the most common flow since there seems to be little benefit in closing all files IMO.

I don't think it's that uncommon. Once I've completed working on one task, especially within one part of the codebase, it's nice to be able to clear my plate and close some files. Waiting for the server to start back up again is not fun.

Not sure what would be a satisfying solution for you? Maybe just extending the time before the server shutsdown to 30s or so?

I don't think the server should shut down at all in this case. If I have a Rust project open, I am likely to work in that Rust project and use the LSP features. If I am done working on the project, I'll close it. Especially in a large project, the cost of restarting the server is extremely high.

If there was a setting to keep the server running as long as I have a Rust project open, that would be ideal to me.

from lsp.

rchl avatar rchl commented on June 25, 2024

This is a standard behavior of https://github.com/sublimelsp/LSP that the server is closed after few seconds once the last file using it is closed. This is to not keep unused servers in memory taking space unnecessarily.

In my personal workflow I tend to always keep some files open and don't clean up the whole workspace before opening a new file. And I imagine this to be the most common flow since there seems to be little benefit in closing all files IMO.

Not sure what would be a satisfying solution for you? Maybe just extending the time before the server shutsdown to 30s or so?

from lsp.

LPGhatguy avatar LPGhatguy commented on June 25, 2024

I've opened an issue in the LSP repo about the possibility of having that setting.

from lsp.

rwols avatar rwols commented on June 25, 2024

Related, and the root cause: rust-lang/rust-analyzer#4712

from lsp.

LPGhatguy avatar LPGhatguy commented on June 25, 2024

I tried configuring ra-multiplex, the workaround folks have mentioned in rust-lang/rust-analyzer#4712.

I wasn't able to get it running in Sublime Text on my system. I'm not sure if it's a Windows compatibility issue, something with the LSP mechanism, or something I didn't do correctly.

from lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.