Skip to content

Commit

Permalink
fix #24: get rid of vscode-base-languageclient
Browse files Browse the repository at this point in the history
vscode compatiblity layer is introduced to make use of vscode-languageclient directly instead of vscode-base-languageclient.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
  • Loading branch information
akosyakov committed Jul 24, 2018
1 parent b79d075 commit cab889e
Show file tree
Hide file tree
Showing 20 changed files with 3,947 additions and 718 deletions.
2,251 changes: 1,669 additions & 582 deletions example/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"rimraf": "^2.6.2",
"source-map-loader": "^0.2.3",
"style-loader": "^0.20.3",
"typescript": "^2.7.2",
"typescript": "^2.9.2",
"uglifyjs-webpack-plugin": "^1.2.4",
"webpack": "^3.11.0",
"webpack-merge": "^4.1.2"
Expand Down
6 changes: 5 additions & 1 deletion example/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
* Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { listen, MessageConnection } from 'vscode-ws-jsonrpc';
import * as vscode from "vscode";
window.alert(vscode.version);
/*import { listen, MessageConnection } from 'vscode-ws-jsonrpc';
import {
BaseLanguageClient, CloseAction, ErrorAction,
createMonacoServices, createConnection
Expand Down Expand Up @@ -84,3 +87,4 @@ function createWebSocket(url: string): WebSocket {
};
return new ReconnectingWebSocket(url, undefined, socketOptions);
}
*/
6 changes: 3 additions & 3 deletions example/src/json-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TextDocument, Diagnostic, Command, CompletionList, CompletionItem, Hover,
SymbolInformation, DocumentSymbolParams, TextEdit
} from "vscode-languageserver-types";
import { TextDocumentPositionParams, DocumentRangeFormattingParams, ExecuteCommandParams, CodeActionParams } from 'vscode-base-languageclient/lib/protocol';
import { TextDocumentPositionParams, DocumentRangeFormattingParams, ExecuteCommandParams, CodeActionParams } from 'vscode-languageserver-protocol';
import { getLanguageService, LanguageService, JSONDocument } from "vscode-json-languageservice";

export function start(reader: MessageReader, writer: MessageWriter): JsonServer {
Expand Down Expand Up @@ -137,7 +137,7 @@ export class JsonServer {
}
}

protected hover(params: TextDocumentPositionParams): Thenable<Hover> {
protected hover(params: TextDocumentPositionParams): Thenable<Hover | null> {
const document = this.documents.get(params.textDocument.uri);
const jsonDocument = this.getJSONDocument(document);
return this.jsonService.doHover(document, params.position, jsonDocument);
Expand All @@ -163,7 +163,7 @@ export class JsonServer {
return this.jsonService.doResolve(item);
}

protected completion(params: TextDocumentPositionParams): Thenable<CompletionList> {
protected completion(params: TextDocumentPositionParams): Thenable<CompletionList | null> {
const document = this.documents.get(params.textDocument.uri);
const jsonDocument = this.getJSONDocument(document);
return this.jsonService.doComplete(document, params.position, jsonDocument);
Expand Down
5 changes: 5 additions & 0 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const common = {
child_process: 'empty',
net: 'empty',
crypto: 'empty'
},
resolve: {
alias: {
'vscode': 'monaco-languageclient/lib/vscode-compatibility'
}
}
};

Expand Down
Loading

0 comments on commit cab889e

Please sign in to comment.