summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2019-08-28 15:09:04 +0000
committerHaojian Wu <hokein@google.com>2019-08-28 15:09:04 +0000
commit92e09b2f56d635bf92c32089fdf81a819026d0bf (patch)
treeabc91663802aa0e62c5fc7d5f35f6451412677b2
parentaf118bb6d0c4b847617d6660f8bae0073f5812b7 (diff)
downloadbcm5719-llvm-92e09b2f56d635bf92c32089fdf81a819026d0bf.tar.gz
bcm5719-llvm-92e09b2f56d635bf92c32089fdf81a819026d0bf.zip
[clangd][vscode] Don't leak the resources
Summary: We miss a few places where we need to add them to the subscriptions. Reviewers: jvikstrom Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66881 llvm-svn: 370218
-rw-r--r--clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts b/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
index f06b2f1ef3d..fa787f9f029 100644
--- a/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
+++ b/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
@@ -111,6 +111,8 @@ export function activate(context: vscode.ExtensionContext) {
serverOptions, clientOptions);
const semanticHighlightingFeature =
new semanticHighlighting.SemanticHighlightingFeature();
+ context.subscriptions.push(
+ vscode.Disposable.from(semanticHighlightingFeature));
clangdClient.registerFeature(semanticHighlightingFeature);
console.log('Clang Language Server is now active!');
context.subscriptions.push(clangdClient.start());
@@ -133,9 +135,10 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showTextDocument(doc);
}));
const status = new FileStatus();
+ context.subscriptions.push(vscode.Disposable.from(status));
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(
() => { status.updateStatus(); }));
- clangdClient.onDidChangeState(({newState}) => {
+ context.subscriptions.push(clangdClient.onDidChangeState(({newState}) => {
if (newState == vscodelc.State.Running) {
// clangd starts or restarts after crash.
clangdClient.onNotification(
@@ -150,7 +153,7 @@ export function activate(context: vscode.ExtensionContext) {
status.clear();
semanticHighlightingFeature.dispose();
}
- })
+ }));
// An empty place holder for the activate command, otherwise we'll get an
// "command is not registered" error.
context.subscriptions.push(vscode.commands.registerCommand(
OpenPOWER on IntegriCloud