1 | "use strict"; |
---|
2 | Object.defineProperty(exports, "__esModule", { value: true }); |
---|
3 | // The module 'vscode' contains the VS Code extensibility API |
---|
4 | // Import the module and reference it with the alias vscode in your code below |
---|
5 | const path = require("path"); |
---|
6 | const vscode = require("vscode"); |
---|
7 | |
---|
8 | |
---|
9 | const vscode_lc = require('vscode-languageclient'); |
---|
10 | |
---|
11 | let client = {} |
---|
12 | |
---|
13 | // this method is called when your extension is activated |
---|
14 | // your extension is activated the very first time the command is executed |
---|
15 | function activate(context) { |
---|
16 | vscode.window.showInformationMessage('Cforall Extension Starting'); |
---|
17 | |
---|
18 | // The debug options for the server |
---|
19 | // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging |
---|
20 | let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] }; |
---|
21 | |
---|
22 | // If the extension is launched in debug mode then the debug server options are used |
---|
23 | // Otherwise the run options are used |
---|
24 | let serverOptions = { |
---|
25 | run: { command: 'cfa-ls', transport: vscode_lc.TransportKind.stdio }, |
---|
26 | debug: { |
---|
27 | command: 'cfa-ls', |
---|
28 | transport: vscode_lc.TransportKind.stdio, |
---|
29 | options: debugOptions |
---|
30 | } |
---|
31 | }; |
---|
32 | |
---|
33 | // Options to control the language client |
---|
34 | let selector = [{ scheme: 'file', language: 'cforall' }]; |
---|
35 | let clientOptions = { |
---|
36 | // Register the server for cforall documents |
---|
37 | documentSelector: selector |
---|
38 | }; |
---|
39 | |
---|
40 | // Create the language client and start the client. |
---|
41 | client = new vscode_lc.LanguageClient( |
---|
42 | 'cforall', |
---|
43 | 'Cforall Language Server', |
---|
44 | serverOptions, |
---|
45 | clientOptions |
---|
46 | ); |
---|
47 | |
---|
48 | // Start the client. This will also launch the server |
---|
49 | client.start(); |
---|
50 | |
---|
51 | } |
---|
52 | exports.activate = activate; |
---|
53 | |
---|
54 | // this method is called when your extension is deactivated |
---|
55 | function deactivate() { } |
---|
56 | exports.deactivate = deactivate; |
---|