Skip to content

Keep language servers alive when all files are closed #489

Closed

Description

@harry-xm

In a large project, it might take quite some time for rust-analyzer to initialize itself.

If someone clicked "Close All Tabs" and subsequently opens another file, the language server is restarted and I have to wait until it finishes loading.

I'm thinking of keeping the language server running until the IDE window is closed, or after an inactivity timeout. IMHO, either the user should be given an option, or plugin authors should be able to control it via some API.

Originally posted in #487

Activity

  1. added
    enhancement
    on Aug 28, 2024
  2. turkeylurkey commented on Aug 28, 2024

    @turkeylurkey
    Contributor

    When you define your server <server id="XXXlsp" you can add the parameter lastDocumentDisconnectedTimeout="3600" which is an inactivity timeout.

  3. angelozerr commented on Aug 30, 2024

    @angelozerr
    Contributor

    @harry-xm as @turkeylurkey suggested, you can define lastDocumentDisconnectedTimeout="3600" for the moment.

  4. harry-xm commented on Aug 30, 2024

    @harry-xm
    Author

    Thanks. I guess if I set it to a year, that is effectively keeping servers alive.

  5. added
    duplicate
    on Oct 2, 2024
  6. angelozerr commented on Oct 2, 2024

    @angelozerr
    Contributor

    Duplicate of #556

    which will be covered in 0.7.0 with #543

    Please read #556 (comment) and give me your feedback about the name of the method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-customizationduplicateenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions