Do some `npm update`s including upgrading to language server v8 (#102)
This commit is contained in:
Родитель
0e4f7e4f56
Коммит
a94b2558fb
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -36,12 +36,12 @@
|
|||
"chai": "^4.3.0",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"eslint": "^8.4.1",
|
||||
"mocha": "^9.1.1",
|
||||
"typescript": "^4.5.4"
|
||||
"mocha": "^10.0.0",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-languageserver": "^7.0.0",
|
||||
"vscode-languageserver": "^8.0.2",
|
||||
"vscode-languageserver-textdocument": "^1.0.3",
|
||||
"yaml": "^2.0.0"
|
||||
"yaml": "^2.1.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ErrorCodes, Position, Range, ResponseError, TextDocumentIdentifier, TextDocumentsConfiguration } from 'vscode-languageserver';
|
||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import { Document as YamlDocument, isDocument, parseDocument } from 'yaml';
|
||||
import { DocumentUri, TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import { Document as YamlDocument, isDocument, Node as YamlNode, parseDocument } from 'yaml';
|
||||
import { CRLF, DocumentSettings, DocumentSettingsParams, DocumentSettingsRequest, LF } from '../client/DocumentSettings';
|
||||
import { ExtendedPositionParams, PositionInfo } from './ExtendedParams';
|
||||
import { getCurrentContext } from './utils/ActionContext';
|
||||
|
@ -30,6 +30,10 @@ export class ComposeDocument {
|
|||
};
|
||||
}
|
||||
|
||||
public get uri(): DocumentUri {
|
||||
return this.textDocument.uri;
|
||||
}
|
||||
|
||||
private constructor(doc: TextDocument) {
|
||||
this.#textDocument = doc;
|
||||
}
|
||||
|
@ -147,7 +151,7 @@ export class ComposeDocument {
|
|||
update: (document, changes, version) => document.update(TextDocument.update(document.textDocument, changes, version)),
|
||||
};
|
||||
|
||||
private buildYamlDocument(): YamlDocument {
|
||||
private buildYamlDocument(): YamlDocument<YamlNode> {
|
||||
const yamlDocument = parseDocument(this.textDocument.getText(), { merge: true, prettyErrors: true });
|
||||
|
||||
if (!isDocument(yamlDocument)) {
|
||||
|
|
|
@ -43,7 +43,7 @@ export class DiagnosticProvider extends ProviderBase<TextDocumentChangeEvent<Com
|
|||
);
|
||||
}
|
||||
|
||||
ctx.connection.sendDiagnostics({
|
||||
void ctx.connection.sendDiagnostics({
|
||||
uri: params.document.textDocument.uri,
|
||||
diagnostics: diagnostics,
|
||||
});
|
||||
|
|
|
@ -690,7 +690,7 @@ describe('ComposeDocument', () => {
|
|||
tabSize: 3,
|
||||
};
|
||||
|
||||
testConnection.client.sendNotification(DocumentSettingsNotification.type, params);
|
||||
void testConnection.client.sendNotification(DocumentSettingsNotification.type, params);
|
||||
|
||||
// Wait for the service to process the notification
|
||||
await new Promise<void>((resolve) => {
|
||||
|
|
|
@ -56,7 +56,7 @@ export class TestConnection implements Disposable {
|
|||
textDocument: TextDocumentItem.create(uri, 'dockercompose', 1, text),
|
||||
};
|
||||
|
||||
this.client.sendNotification(DidOpenTextDocumentNotification.type, openParams);
|
||||
void this.client.sendNotification(DidOpenTextDocumentNotification.type, openParams);
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import type { ClientCapabilities, StaticFeature } from 'vscode-languageclient';
|
||||
import type { ClientCapabilities, DocumentSelector, FeatureState, InitializeParams, ServerCapabilities, StaticFeature } from 'vscode-languageclient';
|
||||
import type { LanguageClient } from 'vscode-languageclient/node';
|
||||
import type { DocumentSettings, DocumentSettingsNotificationParams, DocumentSettingsParams } from '../../../lib/client/DocumentSettings'; // Dev-time-only imports, with `require` below for the real imports, to avoid desync issues or needing to actually install the langserver package
|
||||
|
||||
|
@ -13,6 +13,12 @@ export class DocumentSettingsClientFeature implements StaticFeature, vscode.Disp
|
|||
|
||||
public constructor(private readonly client: LanguageClient) { }
|
||||
|
||||
public getState(): FeatureState {
|
||||
return {
|
||||
kind: 'static'
|
||||
};
|
||||
}
|
||||
|
||||
public fillClientCapabilities(capabilities: ClientCapabilities): void {
|
||||
const documentSettings = {
|
||||
notify: true,
|
||||
|
@ -28,7 +34,7 @@ export class DocumentSettingsClientFeature implements StaticFeature, vscode.Disp
|
|||
public initialize(): void {
|
||||
this.disposables.push(
|
||||
this.client.onRequest(
|
||||
require('../../../../lib/client/DocumentSettings').DocumentSettingsRequest.type,
|
||||
require('../../../../lib/client/DocumentSettings').DocumentSettingsRequest.method,
|
||||
(params: DocumentSettingsParams): DocumentSettings | undefined => {
|
||||
const textEditor = vscode.window.visibleTextEditors.find(e => e.document.uri.toString() === params.textDocument.uri);
|
||||
|
||||
|
@ -53,7 +59,7 @@ export class DocumentSettingsClientFeature implements StaticFeature, vscode.Disp
|
|||
tabSize: Number(e.options.tabSize),
|
||||
};
|
||||
|
||||
this.client.sendNotification(require('../../../../lib/client/DocumentSettings').DocumentSettingsNotification.type, params);
|
||||
this.client.sendNotification(require('../../../../lib/client/DocumentSettings').DocumentSettingsNotification.method, params);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as vscode from 'vscode';
|
|||
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node';
|
||||
import { DocumentSettingsClientFeature } from './DocumentSettingsClientFeature';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||
const serverModule = context.asAbsolutePath('../../../lib/server.js');
|
||||
|
||||
const serverOptions: ServerOptions = {
|
||||
|
@ -44,7 +44,8 @@ export function activate(context: vscode.ExtensionContext): void {
|
|||
clientOutputChannel.appendLine(JSON.stringify(e));
|
||||
}));
|
||||
|
||||
context.subscriptions.push(client.start());
|
||||
context.subscriptions.push(client);
|
||||
await client.start();
|
||||
}
|
||||
|
||||
export function deactivate(): void {
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
"name": "compose-languageserver-testclient",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"vscode-languageclient": "^7.0.0"
|
||||
"vscode-languageclient": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "1.52"
|
||||
"@types/vscode": "1.69.0"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.52.0"
|
||||
"vscode": "^1.69.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/vscode": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.52.0.tgz",
|
||||
"integrity": "sha512-Kt3bvWzAvvF/WH9YEcrCICDp0Z7aHhJGhLJ1BxeyNP6yRjonWqWnAIh35/pXAjswAnWOABrYlF7SwXR9+1nnLA==",
|
||||
"version": "1.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.69.0.tgz",
|
||||
"integrity": "sha512-RlzDAnGqUoo9wS6d4tthNyAdZLxOIddLiX3djMoWk29jFfSA1yJbIwr0epBYqqYarWB6s2Z+4VaZCQ80Jaa3kA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
|
@ -79,39 +79,39 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vscode-jsonrpc": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz",
|
||||
"integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz",
|
||||
"integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==",
|
||||
"engines": {
|
||||
"node": ">=8.0.0 || >=10.0.0"
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vscode-languageclient": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz",
|
||||
"integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.2.tgz",
|
||||
"integrity": "sha512-lHlthJtphG9gibGb/y72CKqQUxwPsMXijJVpHEC2bvbFqxmkj9LwQ3aGU9dwjBLqsX1S4KjShYppLvg1UJDF/Q==",
|
||||
"dependencies": {
|
||||
"minimatch": "^3.0.4",
|
||||
"semver": "^7.3.4",
|
||||
"vscode-languageserver-protocol": "3.16.0"
|
||||
"semver": "^7.3.5",
|
||||
"vscode-languageserver-protocol": "3.17.2"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.52.0"
|
||||
"vscode": "^1.67.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vscode-languageserver-protocol": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz",
|
||||
"integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==",
|
||||
"version": "3.17.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz",
|
||||
"integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==",
|
||||
"dependencies": {
|
||||
"vscode-jsonrpc": "6.0.0",
|
||||
"vscode-languageserver-types": "3.16.0"
|
||||
"vscode-jsonrpc": "8.0.2",
|
||||
"vscode-languageserver-types": "3.17.2"
|
||||
}
|
||||
},
|
||||
"node_modules/vscode-languageserver-types": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz",
|
||||
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA=="
|
||||
"version": "3.17.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz",
|
||||
"integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA=="
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
|
@ -121,9 +121,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@types/vscode": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.52.0.tgz",
|
||||
"integrity": "sha512-Kt3bvWzAvvF/WH9YEcrCICDp0Z7aHhJGhLJ1BxeyNP6yRjonWqWnAIh35/pXAjswAnWOABrYlF7SwXR9+1nnLA==",
|
||||
"version": "1.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.69.0.tgz",
|
||||
"integrity": "sha512-RlzDAnGqUoo9wS6d4tthNyAdZLxOIddLiX3djMoWk29jFfSA1yJbIwr0epBYqqYarWB6s2Z+4VaZCQ80Jaa3kA==",
|
||||
"dev": true
|
||||
},
|
||||
"balanced-match": {
|
||||
|
@ -170,33 +170,33 @@
|
|||
}
|
||||
},
|
||||
"vscode-jsonrpc": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz",
|
||||
"integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg=="
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz",
|
||||
"integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ=="
|
||||
},
|
||||
"vscode-languageclient": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz",
|
||||
"integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.2.tgz",
|
||||
"integrity": "sha512-lHlthJtphG9gibGb/y72CKqQUxwPsMXijJVpHEC2bvbFqxmkj9LwQ3aGU9dwjBLqsX1S4KjShYppLvg1UJDF/Q==",
|
||||
"requires": {
|
||||
"minimatch": "^3.0.4",
|
||||
"semver": "^7.3.4",
|
||||
"vscode-languageserver-protocol": "3.16.0"
|
||||
"semver": "^7.3.5",
|
||||
"vscode-languageserver-protocol": "3.17.2"
|
||||
}
|
||||
},
|
||||
"vscode-languageserver-protocol": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz",
|
||||
"integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==",
|
||||
"version": "3.17.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz",
|
||||
"integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==",
|
||||
"requires": {
|
||||
"vscode-jsonrpc": "6.0.0",
|
||||
"vscode-languageserver-types": "3.16.0"
|
||||
"vscode-jsonrpc": "8.0.2",
|
||||
"vscode-languageserver-types": "3.17.2"
|
||||
}
|
||||
},
|
||||
"vscode-languageserver-types": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz",
|
||||
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA=="
|
||||
"version": "3.17.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz",
|
||||
"integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA=="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"publisher": "ms-azuretools",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.52.0"
|
||||
"vscode": "^1.69.0"
|
||||
},
|
||||
"activationEvents": [
|
||||
"onLanguage:dockercompose",
|
||||
|
@ -11,10 +11,10 @@
|
|||
],
|
||||
"main": "./dist/extension.js",
|
||||
"dependencies": {
|
||||
"vscode-languageclient": "^7.0.0"
|
||||
"vscode-languageclient": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "1.52"
|
||||
"@types/vscode": "1.69.0"
|
||||
},
|
||||
"contributes": {
|
||||
"configurationDefaults": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче