Skip to content

Commit 60e4f85

Browse files
Updated extension ts
1 parent bb2b4bd commit 60e4f85

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

vscode-testextension/src/extension.ts

+40-22
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,70 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55
// tslint:disable
6-
'use strict';
6+
"use strict";
77

8-
import * as path from 'path';
8+
import * as path from "path";
99

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";
1320

1421
export function activate(context: ExtensionContext) {
15-
1622
// The server is implemented in node
1723
// 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";
2028
// The debug options for the server
21-
// let debugOptions = { execArgv: ['-lsp', '-d' };
29+
// let debugOptions = { execArgv: ['-lsp', '-d' };5
2230

2331
// If the extension is launched in debug mode then the debug server options are used
2432
// Otherwise the run options are used
2533
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+
};
2939

3040
// Options to control the language client
3141
let clientOptions: LanguageClientOptions = {
3242
// Register the server for plain text documents
3343
documentSelector: [
3444
{
35-
pattern: '**/*.cs',
36-
}, {
37-
pattern: '**/*.cake',
45+
pattern: "**/*.cs"
46+
},
47+
{
48+
pattern: "**/*.csx"
3849
},
50+
{
51+
pattern: "**/*.cake"
52+
}
3953
],
4054
synchronize: {
4155
// Synchronize the setting section 'languageServerExample' to the server
42-
configurationSection: 'languageServerExample',
43-
fileEvents: workspace.createFileSystemWatcher('**/*.cs')
56+
configurationSection: "languageServerExample",
57+
fileEvents: workspace.createFileSystemWatcher("**/*.cs")
4458
}
45-
46-
}
59+
};
4760

4861
// 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;
5270
let disposable = client.start();
5371

5472
// Push the disposable to the context's subscriptions so that the

0 commit comments

Comments
 (0)