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

How to update the list of extensions? #343

Open
payne911 opened this issue Nov 21, 2023 · 0 comments
Open

How to update the list of extensions? #343

payne911 opened this issue Nov 21, 2023 · 0 comments

Comments

@payne911
Copy link
Contributor

payne911 commented Nov 21, 2023

This is what we run in a StartupActivity:

    val manager = OurLspExtensionManager()
    for (ext in SUPPORTED_FILE_EXTENSIONS) {
      IntellijLanguageClient.addExtensionManager(ext, manager)
    }
    val serverDefinition = OurServerDefinition(SUPPORTED_FILE_EXTENSIONS_STRING, command, repoRoot)
    IntellijLanguageClient.addServerDefinition(serverDefinition)

After startup, we want to allow users to add or remove to that list of supported file extensions. From what I gather, we should:

  1. Update the ServerDefinition and ExtensionManagers via methods provided by IntellijLanguageClient
  2. Call EditorEventManagerBase.forEditor(editor).wrapper.restart()

But it seems like there is no way to remove an extension in the step 1. What is the recommended way to approach this problem?

@payne911 payne911 changed the title How to update accepted the list of extensions? How to update the list of extensions? Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants