diff --git a/package-lock.json b/package-lock.json index b53587f11a..1f3b688e25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1318,7 +1318,7 @@ "decompress-tar": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha1-cYy9P8sWIJcW5womuE57pFkuWvE=", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, "requires": { "file-type": "^5.2.0", @@ -1337,7 +1337,7 @@ "decompress-tarbz2": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha1-MIKluIDqQEOBY0nzeLVsUWvho5s=", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "dev": true, "requires": { "decompress-tar": "^4.1.0", @@ -1350,7 +1350,7 @@ "file-type": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha1-5QzXXTVv/tTjBtxPW89Sp5kDqRk=", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", "dev": true } } @@ -1358,7 +1358,7 @@ "decompress-targz": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha1-wJvDXE0R894J8tLaU+neI+fOHu4=", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "dev": true, "requires": { "decompress-tar": "^4.1.1", @@ -1512,7 +1512,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -2593,9 +2593,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true } } @@ -5232,7 +5232,7 @@ "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", - "integrity": "sha1-SYdzYmT8NEzyD2w0rKnRPR1O1sU=", + "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "dev": true, "requires": { "is-natural-number": "^4.0.1" @@ -5947,23 +5947,13 @@ "dev": true }, "vscode-languageclient": { - "version": "7.1.0-next.5", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.5.tgz", - "integrity": "sha512-TpzpAhpdCNJHaLzptFRs54xsU6xTmaiVPCse0W0rRB5jJBPjOBKilrFPMMm/sJA0y8Yxa9sOvZaNu6WPg3dYAw==", + "version": "8.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.0-next.4.tgz", + "integrity": "sha512-G8lDUJYZZsq3xN2kSi7FXg2+YRRAx5npganZYZHJyOUEXvpDRalOmPWGVrYGJ3+tDmZqvy2tOaplWn0Bba78Hg==", "requires": { "minimatch": "^3.0.4", - "semver": "^7.3.4", - "vscode-languageserver-protocol": "3.17.0-next.6" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - } + "semver": "^7.3.5", + "vscode-languageserver-protocol": "3.17.0-next.9" } }, "vscode-languageserver": { @@ -5995,25 +5985,25 @@ } }, "vscode-languageserver-protocol": { - "version": "3.17.0-next.6", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.6.tgz", - "integrity": "sha512-f1kGsoOpISB5jSqQNeMDl2446enxVahyux2e5vZap6pu/TC+2UlvPT4DCR0gPph95KOQZweL9zq1SzLoPdqhuA==", + "version": "3.17.0-next.9", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.9.tgz", + "integrity": "sha512-DGkRmbI1hRBMY6HU6MOyza5AvYp0+HcbMf2qdmI98luyQJ26dOfHY5K38OS4hlTHhdJg9RypTQ/uBbLZehmn1Q==", "requires": { - "vscode-jsonrpc": "7.0.0-next.1", - "vscode-languageserver-types": "3.17.0-next.2" + "vscode-jsonrpc": "8.0.0-next.3", + "vscode-languageserver-types": "3.17.0-next.4" }, "dependencies": { "vscode-jsonrpc": { - "version": "7.0.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-7.0.0-next.1.tgz", - "integrity": "sha512-dEmliPZGbSyIcEeKRGzosCy7y7zsc8FXg1l5BBOGgMUbemlo3vUnsa2GFqpILJwJvlbvkRcF2QASNwIlKe9J7g==" + "version": "8.0.0-next.3", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.0-next.3.tgz", + "integrity": "sha512-2wRiBR5tZAXZ4UxIO4F0cT/zN6OpruoWO0vc7EpQZxVfumb0pYiSegB+PaOzXCuFQzh7YEshW/XMg4zTz3FGVQ==" } } }, "vscode-languageserver-types": { - "version": "3.17.0-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.0-next.2.tgz", - "integrity": "sha512-L5S2kNLCgYJMVWgsZjBaorMM/6+itAfvOyl6Kv1bgFzDNaUKm9HsnUlehjpWPdV5DqnfJhJ5E03Z+/3Mw8ii+Q==" + "version": "3.17.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.0-next.4.tgz", + "integrity": "sha512-MraVkZDhfqa3ftnKW9rEDeqsV+ji8OrtEjx6mVjzVGm5U2XXT+mdqDWyQ+y0Gvb2/aa2oJJQyTAaDmRTUKiUbg==" }, "vscode-test": { "version": "1.4.0", diff --git a/package.json b/package.json index 8a73986f38..100cdb9a52 100644 --- a/package.json +++ b/package.json @@ -1185,7 +1185,7 @@ "glob": "^7.1.3", "jdk-utils": "^0.4.3", "semver": "^7.3.5", - "vscode-languageclient": "7.1.0-next.5", + "vscode-languageclient": "8.0.0-next.4", "winreg-utf8": "^0.1.1", "winston": "^3.2.1", "winston-daily-rotate-file": "^3.10.0" diff --git a/src/extension.ts b/src/extension.ts index a8c22ab0f4..ec185e62df 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -252,8 +252,8 @@ export function activate(context: ExtensionContext): Promise { }, middleware: { workspace: { - didChangeConfiguration: () => { - standardClient.getClient().sendNotification(DidChangeConfigurationNotification.type, { + didChangeConfiguration: async () => { + await standardClient.getClient().sendNotification(DidChangeConfigurationNotification.type, { settings: { java: getJavaConfig(requirements.java_home), } @@ -263,7 +263,7 @@ export function activate(context: ExtensionContext): Promise { // https://github.com/redhat-developer/vscode-java/issues/2130 // include all diagnostics for the current line in the CodeActionContext params for the performance reason provideCodeActions: (document, range, context, token, next) => { - const client: any = standardClient.getClient(); + const client: LanguageClient = standardClient.getClient(); const params: CodeActionParams = { textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document), range: client.code2ProtocolConverter.asRange(range), @@ -285,8 +285,8 @@ export function activate(context: ExtensionContext): Promise { } const codeActionContext: CodeActionContext = { diagnostics: allDiagnostics, + triggerKind: CodeActionTriggerKind?.Automatic, only: context.only, - triggerKind: CodeActionTriggerKind.Invoke, }; params.context = client.code2ProtocolConverter.asCodeActionContext(codeActionContext); } @@ -306,7 +306,6 @@ export function activate(context: ExtensionContext): Promise { } return result; }, (error) => { - client.logFailedRequest(CodeActionRequest.type, error); return Promise.resolve([]); }); } diff --git a/src/refactorAction.ts b/src/refactorAction.ts index 69c4f47c2e..65123bc496 100644 --- a/src/refactorAction.ts +++ b/src/refactorAction.ts @@ -214,7 +214,7 @@ async function applyRefactorEdit(languageClient: LanguageClient, refactorEdit: R } if (refactorEdit.edit) { - const edit = languageClient.protocol2CodeConverter.asWorkspaceEdit(refactorEdit.edit); + const edit = await languageClient.protocol2CodeConverter.asWorkspaceEdit(refactorEdit.edit); if (edit) { await workspace.applyEdit(edit); } diff --git a/src/standardLanguageClient.ts b/src/standardLanguageClient.ts index 0cc05743c2..0fc78bceaa 100644 --- a/src/standardLanguageClient.ts +++ b/src/standardLanguageClient.ts @@ -315,7 +315,7 @@ export class StandardLanguageClient { commands.executeCommand(Commands.SHOW_REFERENCES, Uri.parse(uri), this.languageClient.protocol2CodeConverter.asPosition(position), locations.map(this.languageClient.protocol2CodeConverter.asLocation)); })); - context.subscriptions.push(commands.registerCommand(Commands.CONFIGURATION_UPDATE, uri => projectConfigurationUpdate(this.languageClient, uri))); + context.subscriptions.push(commands.registerCommand(Commands.CONFIGURATION_UPDATE, async (uri) => projectConfigurationUpdate(this.languageClient, uri))); context.subscriptions.push(commands.registerCommand(Commands.IGNORE_INCOMPLETE_CLASSPATH, () => setIncompleteClasspathSeverity('ignore'))); @@ -323,7 +323,7 @@ export class StandardLanguageClient { commands.executeCommand(Commands.OPEN_BROWSER, Uri.parse('https://github.com/redhat-developer/vscode-java/wiki/%22Classpath-is-incomplete%22-warning')); })); - context.subscriptions.push(commands.registerCommand(Commands.PROJECT_CONFIGURATION_STATUS, (uri, status) => setProjectConfigurationUpdate(this.languageClient, uri, status))); + context.subscriptions.push(commands.registerCommand(Commands.PROJECT_CONFIGURATION_STATUS, async (uri, status) => setProjectConfigurationUpdate(this.languageClient, uri, status))); context.subscriptions.push(commands.registerCommand(Commands.APPLY_WORKSPACE_EDIT, (obj) => { applyWorkspaceEdit(obj, this.languageClient); @@ -582,7 +582,7 @@ function setIncompleteClasspathSeverity(severity: string) { ); } -function projectConfigurationUpdate(languageClient: LanguageClient, uri?: Uri) { +async function projectConfigurationUpdate(languageClient: LanguageClient, uri?: Uri) { let resource = uri; if (!(resource instanceof Uri)) { if (window.activeTextEditor) { @@ -593,7 +593,7 @@ function projectConfigurationUpdate(languageClient: LanguageClient, uri?: Uri) { return window.showWarningMessage('No Java project to update!').then(() => false); } if (isJavaConfigFile(resource.path)) { - languageClient.sendNotification(ProjectConfigurationUpdateRequest.type, { + await languageClient.sendNotification(ProjectConfigurationUpdateRequest.type, { uri: resource.toString() }); } @@ -605,7 +605,7 @@ function isJavaConfigFile(filePath: string) { return regEx.test(fileName); } -function setProjectConfigurationUpdate(languageClient: LanguageClient, uri: Uri, status: FeatureStatus) { +async function setProjectConfigurationUpdate(languageClient: LanguageClient, uri: Uri, status: FeatureStatus) { const config = getJavaConfiguration(); const section = 'configuration.updateBuildConfiguration'; @@ -615,7 +615,7 @@ function setProjectConfigurationUpdate(languageClient: LanguageClient, uri: Uri, (error) => logger.error(error) ); if (status !== FeatureStatus.disabled) { - projectConfigurationUpdate(languageClient, uri); + await projectConfigurationUpdate(languageClient, uri); } } diff --git a/src/syntaxLanguageClient.ts b/src/syntaxLanguageClient.ts index 8c886740ec..4632f62e14 100644 --- a/src/syntaxLanguageClient.ts +++ b/src/syntaxLanguageClient.ts @@ -21,8 +21,8 @@ export class SyntaxLanguageClient { const newClientOptions: LanguageClientOptions = Object.assign({}, clientOptions, { middleware: { workspace: { - didChangeConfiguration: () => { - this.languageClient.sendNotification(DidChangeConfigurationNotification.type, { + didChangeConfiguration: async () => { + await this.languageClient.sendNotification(DidChangeConfigurationNotification.type, { settings: { java: getJavaConfig(requirements.java_home), }