|
@@ -25,6 +25,8 @@ export function executableExists(exe: string): boolean {
|
25
|
25
|
return out.status === 0 || (isWindows && fs.existsSync(exe));
|
26
|
26
|
}
|
27
|
27
|
|
|
28
|
+let client: LanguageClient;
|
|
29
|
+
|
28
|
30
|
export function activate(context: ExtensionContext) {
|
29
|
31
|
|
30
|
32
|
if (executableExists('vhdl-tool')) {
|
|
@@ -46,13 +48,21 @@ export function activate(context: ExtensionContext) {
|
46
|
48
|
}
|
47
|
49
|
|
48
|
50
|
// Create the language client and start the client.
|
49
|
|
- let disposable = new LanguageClient('vhdltool', 'Language Server VHDL', serverOptions, clientOptions).start();
|
|
51
|
+ let client = new LanguageClient('vhdltool', 'Language Server VHDL', serverOptions, clientOptions);
|
50
|
52
|
|
51
|
53
|
// Push the disposable to the context's subscriptions so that the client can be deactivated on extension deactivation
|
52
|
|
- context.subscriptions.push(disposable);
|
|
54
|
+ client.start();
|
53
|
55
|
} else {
|
54
|
56
|
const notInstalledMsg: string =
|
55
|
57
|
'Please download VHDL-Tool from https://www.vhdltool.com/download and place it somewhere in your $PATH';
|
56
|
58
|
window.showErrorMessage(notInstalledMsg);
|
57
|
59
|
}
|
58
|
60
|
}
|
|
61
|
+
|
|
62
|
+export function deactivate(): Thenable<void> | undefined {
|
|
63
|
+ if (!client) {
|
|
64
|
+ return undefined;
|
|
65
|
+ }
|
|
66
|
+ return client.stop();
|
|
67
|
+}
|
|
68
|
+
|