|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | * ------------------------------------------------------------------------------------------ */
|
5 | 5 | // tslint:disable
|
6 |
| -'use strict'; |
| 6 | +"use strict"; |
7 | 7 |
|
8 |
| -import * as path from 'path'; |
| 8 | +import * as path from "path"; |
9 | 9 |
|
10 |
| -import { workspace, Disposable, ExtensionContext } from 'vscode'; |
11 |
| -import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind, InitializeParams } from 'vscode-languageclient'; |
12 |
| -import { Trace } from 'vscode-jsonrpc'; |
| 10 | +import { workspace, Disposable, ExtensionContext } from "vscode"; |
| 11 | +import { |
| 12 | + LanguageClient, |
| 13 | + LanguageClientOptions, |
| 14 | + SettingMonitor, |
| 15 | + ServerOptions, |
| 16 | + TransportKind, |
| 17 | + InitializeParams |
| 18 | +} from "vscode-languageclient"; |
| 19 | +import { Trace } from "vscode-jsonrpc"; |
13 | 20 |
|
14 | 21 | export function activate(context: ExtensionContext) {
|
15 |
| - |
16 | 22 | // The server is implemented in node
|
17 | 23 | // let serverExe = 'dotnet';
|
18 |
| - let serverExe = 'C:/Users/mb/src/gh/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio.Driver/win7-x64/OmniSharp.exe'; |
19 |
| - // let serverExe = context.asAbsolutePath('D:/Development/Omnisharp/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/win7-x64/OmniSharp.exe'); |
| 24 | + |
| 25 | + // let serverExe = 'D:\\Development\\Omnisharp\\csharp-language-server-protocol\\sample\\SampleServer\\bin\\Debug\\netcoreapp2.0\\win7-x64\\SampleServer.exe'; |
| 26 | + let serverExe = |
| 27 | + "D:/Development/Omnisharp/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio.Driver/win7-x64/OmniSharp.exe"; |
20 | 28 | // The debug options for the server
|
21 |
| - // let debugOptions = { execArgv: ['-lsp', '-d' }; |
| 29 | + // let debugOptions = { execArgv: ['-lsp', '-d' };5 |
22 | 30 |
|
23 | 31 | // If the extension is launched in debug mode then the debug server options are used
|
24 | 32 | // Otherwise the run options are used
|
25 | 33 | let serverOptions: ServerOptions = {
|
26 |
| - run: { command: serverExe, args: ['-lsp'] }, |
27 |
| - debug: { command: serverExe, args: ['-lsp'] } |
28 |
| - } |
| 34 | + // run: { command: serverExe, args: ['-lsp', '-d'] }, |
| 35 | + run: { command: serverExe, args: ["-lsp"] }, |
| 36 | + // debug: { command: serverExe, args: ['-lsp', '-d'] } |
| 37 | + debug: { command: serverExe, args: ["-lsp"] } |
| 38 | + }; |
29 | 39 |
|
30 | 40 | // Options to control the language client
|
31 | 41 | let clientOptions: LanguageClientOptions = {
|
32 | 42 | // Register the server for plain text documents
|
33 | 43 | documentSelector: [
|
34 | 44 | {
|
35 |
| - pattern: '**/*.cs', |
36 |
| - }, { |
37 |
| - pattern: '**/*.cake', |
| 45 | + pattern: "**/*.cs" |
| 46 | + }, |
| 47 | + { |
| 48 | + pattern: "**/*.csx" |
38 | 49 | },
|
| 50 | + { |
| 51 | + pattern: "**/*.cake" |
| 52 | + } |
39 | 53 | ],
|
40 | 54 | synchronize: {
|
41 | 55 | // Synchronize the setting section 'languageServerExample' to the server
|
42 |
| - configurationSection: 'languageServerExample', |
43 |
| - fileEvents: workspace.createFileSystemWatcher('**/*.cs') |
| 56 | + configurationSection: "languageServerExample", |
| 57 | + fileEvents: workspace.createFileSystemWatcher("**/*.cs") |
44 | 58 | }
|
45 |
| - |
46 |
| - } |
| 59 | + }; |
47 | 60 |
|
48 | 61 | // Create the language client and start the client.
|
49 |
| - const client = new LanguageClient('languageServerExample', 'Language Server Example', serverOptions, clientOptions); |
50 |
| - client.trace = Trace.Verbose; |
51 |
| - client.clientOptions.errorHandler |
| 62 | + const client = new LanguageClient( |
| 63 | + "languageServerExample", |
| 64 | + "Language Server Example", |
| 65 | + serverOptions, |
| 66 | + clientOptions |
| 67 | + ); |
| 68 | + // client.trace = Trace.Verbose; |
| 69 | + client.clientOptions.errorHandler; |
52 | 70 | let disposable = client.start();
|
53 | 71 |
|
54 | 72 | // Push the disposable to the context's subscriptions so that the
|
|
0 commit comments