diff --git a/scripts/dependencies.json b/scripts/dependencies.json index cc2c3dfc8..c75ab9534 100644 --- a/scripts/dependencies.json +++ b/scripts/dependencies.json @@ -2,7 +2,7 @@ { "groupId": "org.sonarsource.sonarlint.ls", "artifactId": "sonarlint-language-server", - "version": "3.13.0.75685", + "version": "3.13.0.75690", "output": "server/sonarlint-ls.jar" }, { diff --git a/src/extension.ts b/src/extension.ts index 832ae8630..6dc1c4fce 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -634,7 +634,10 @@ function installCustomRequestHandlers(context: VSCode.ExtensionContext) { languageClient.onNotification(protocol.SubmitNewCodeDefinition.type, newCodeDefinitionForFolderUri => { NewCodeDefinitionService.instance.updateNewCodeDefinitionForFolderUri(newCodeDefinitionForFolderUri); }); - languageClient.onNotification(protocol.SuggestConnection.type, (params) => SharedConnectedModeSettingsService.instance.handleSuggestConnectionNotification(params.suggestionsByConfigScopeId)) + languageClient.onNotification(protocol.SuggestConnection.type, (params) => SharedConnectedModeSettingsService.instance.handleSuggestConnectionNotification(params.suggestionsByConfigScopeId)); + languageClient.onRequest(protocol.IsOpenInEditor.type, async (fileUri) => { + return VSCode.window.visibleTextEditors.some(editor => editor.document.uri.toString(true) === fileUri); + }); } function updateSonarLintViewContainerBadge() { diff --git a/src/lsp/protocol.ts b/src/lsp/protocol.ts index bc996aaef..e7f7232f6 100644 --- a/src/lsp/protocol.ts +++ b/src/lsp/protocol.ts @@ -753,8 +753,13 @@ export interface ShowFixSuggestionParams { textEdits: Change[]; fileUri: string; } + export namespace ShowFixSuggestion { export const type = new lsp.NotificationType('sonarlint/showFixSuggestion'); } +export namespace IsOpenInEditor { + export const type = new lsp.RequestType('sonarlint/isOpenInEditor'); +} + //#endregion