Skip to content

Commit

Permalink
Updated extension ts
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jul 19, 2019
1 parent bb2b4bd commit 60e4f85
Showing 1 changed file with 40 additions and 22 deletions.
62 changes: 40 additions & 22 deletions vscode-testextension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,70 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
// tslint:disable
'use strict';
"use strict";

import * as path from 'path';
import * as path from "path";

import { workspace, Disposable, ExtensionContext } from 'vscode';
import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind, InitializeParams } from 'vscode-languageclient';
import { Trace } from 'vscode-jsonrpc';
import { workspace, Disposable, ExtensionContext } from "vscode";
import {
LanguageClient,
LanguageClientOptions,
SettingMonitor,
ServerOptions,
TransportKind,
InitializeParams
} from "vscode-languageclient";
import { Trace } from "vscode-jsonrpc";

export function activate(context: ExtensionContext) {

// The server is implemented in node
// let serverExe = 'dotnet';
let serverExe = 'C:/Users/mb/src/gh/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio.Driver/win7-x64/OmniSharp.exe';
// let serverExe = context.asAbsolutePath('D:/Development/Omnisharp/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/win7-x64/OmniSharp.exe');

// let serverExe = 'D:\\Development\\Omnisharp\\csharp-language-server-protocol\\sample\\SampleServer\\bin\\Debug\\netcoreapp2.0\\win7-x64\\SampleServer.exe';
let serverExe =
"D:/Development/Omnisharp/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio.Driver/win7-x64/OmniSharp.exe";
// The debug options for the server
// let debugOptions = { execArgv: ['-lsp', '-d' };
// let debugOptions = { execArgv: ['-lsp', '-d' };5

// If the extension is launched in debug mode then the debug server options are used
// Otherwise the run options are used
let serverOptions: ServerOptions = {
run: { command: serverExe, args: ['-lsp'] },
debug: { command: serverExe, args: ['-lsp'] }
}
// run: { command: serverExe, args: ['-lsp', '-d'] },
run: { command: serverExe, args: ["-lsp"] },
// debug: { command: serverExe, args: ['-lsp', '-d'] }
debug: { command: serverExe, args: ["-lsp"] }
};

// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: [
{
pattern: '**/*.cs',
}, {
pattern: '**/*.cake',
pattern: "**/*.cs"
},
{
pattern: "**/*.csx"
},
{
pattern: "**/*.cake"
}
],
synchronize: {
// Synchronize the setting section 'languageServerExample' to the server
configurationSection: 'languageServerExample',
fileEvents: workspace.createFileSystemWatcher('**/*.cs')
configurationSection: "languageServerExample",
fileEvents: workspace.createFileSystemWatcher("**/*.cs")
}

}
};

// Create the language client and start the client.
const client = new LanguageClient('languageServerExample', 'Language Server Example', serverOptions, clientOptions);
client.trace = Trace.Verbose;
client.clientOptions.errorHandler
const client = new LanguageClient(
"languageServerExample",
"Language Server Example",
serverOptions,
clientOptions
);
// client.trace = Trace.Verbose;
client.clientOptions.errorHandler;
let disposable = client.start();

// Push the disposable to the context's subscriptions so that the
Expand Down

0 comments on commit 60e4f85

Please sign in to comment.