Skip to content

Add LanguageClient onDispose #1195

Open

Description

This could be useful for clients willing to cleanup when the languageclient is "disposed"

[Tho maybe I'm over-engineering here]

Activity

  1. dbaeumer commented on Feb 22, 2023

    @dbaeumer
    Member

    Not convinced yet :-) since extensions usually dispose the client. It doesn't dispose itself.

  2. ejgallego commented on Feb 22, 2023

    @ejgallego
    Author

    Indeed, that's a good point.

    That my use scenario today:

    • I have a client that I dispose and recreate when the user wants to restart the server (so new settings are picked, etc...)
    • Once the new client is alive, I do some regular setup such as:
    perfDataHook = client.onNotification(coqPerfData, (data) => {
          perfDataView.update(data);
        })
    • But we current setup, I need to remember to also update the stop () function that calls client.dispose then disposes of the hooks.
    • Being able to do:
    client.onDispose(perfDataHook.dispose)
    

    would be tad more modular as registering a new hook could be made local.

    But indeed happy to close this if that seems overkill.

  3. added
    feature-request
    and removed on Nov 17, 2023
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

    feature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions