Skip to content

Commit

Permalink
Unregister language server extension on LS shutdown
Browse files Browse the repository at this point in the history
fix eclipse-lemminx#605

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
  • Loading branch information
AObuchow committed Feb 6, 2020
1 parent e8dd978 commit af0c989
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
import org.eclipse.lsp4xml.services.IXMLDocumentProvider;
import org.eclipse.lsp4xml.services.XMLLanguageService;
import org.eclipse.lsp4xml.settings.AllXMLSettings;
import org.eclipse.lsp4xml.settings.XMLCompletionSettings;
import org.eclipse.lsp4xml.settings.InitializationOptionsSettings;
import org.eclipse.lsp4xml.settings.LogsSettings;
import org.eclipse.lsp4xml.settings.ServerSettings;
import org.eclipse.lsp4xml.settings.SharedSettings;
import org.eclipse.lsp4xml.settings.XMLCodeLensSettings;
import org.eclipse.lsp4xml.settings.XMLCompletionSettings;
import org.eclipse.lsp4xml.settings.XMLFormattingOptions;
import org.eclipse.lsp4xml.settings.XMLGeneralClientSettings;
import org.eclipse.lsp4xml.settings.XMLSymbolSettings;
Expand Down Expand Up @@ -176,6 +176,7 @@ public synchronized void updateSettings(Object initializationOptionsSettings) {

@Override
public CompletableFuture<Object> shutdown() {
xmlLanguageService.disposeExtensions();
return computeAsync(cc -> new Object());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ void unregisterExtension(IXMLExtension extension) {
extensions.remove(extension);
extension.stop(this);
}

public void disposeExtensions() {
for (IXMLExtension extension : extensions) {
unregisterExtension(extension);
}
}

public void registerCompletionParticipant(ICompletionParticipant completionParticipant) {
completionParticipants.add(completionParticipant);
Expand Down

0 comments on commit af0c989

Please sign in to comment.