[json/css/html] adopt lsp 316

This commit is contained in:
Martin Aeschlimann
2020-12-14 18:18:51 +01:00
parent c2a8940127
commit a22b5d54ad
24 changed files with 326 additions and 239 deletions

View File

@@ -8,14 +8,14 @@ import { RequestType, Connection } from 'vscode-languageserver';
import { RuntimeEnvironment } from './cssServer';
export namespace FsContentRequest {
export const type: RequestType<{ uri: string; encoding?: string; }, string, any, any> = new RequestType('fs/content');
export const type: RequestType<{ uri: string; encoding?: string; }, string, any> = new RequestType('fs/content');
}
export namespace FsStatRequest {
export const type: RequestType<string, FileStat, any, any> = new RequestType('fs/stat');
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');
}
export namespace FsReadDirRequest {
export const type: RequestType<string, [string, FileType][], any, any> = new RequestType('fs/readDir');
export const type: RequestType<string, [string, FileType][], any> = new RequestType('fs/readDir');
}
export enum FileType {

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ResponseError, ErrorCodes, CancellationToken } from 'vscode-languageserver';
import { ResponseError, CancellationToken, LSPErrorCodes } from 'vscode-languageserver';
export function formatError(message: string, err: any): string {
if (err instanceof Error) {
@@ -39,5 +39,5 @@ export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessa
}
function cancelValue<E>() {
return new ResponseError<E>(ErrorCodes.RequestCancelled, 'Request cancelled');
return new ResponseError<E>(LSPErrorCodes.RequestCancelled, 'Request cancelled');
}