Skip to content

Commit

Permalink
SLVSCODE-877 do not analyze files not open in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
sophio-japharidze-sonarsource committed Nov 26, 2024
1 parent 60557c2 commit 04d3291
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 5 additions & 0 deletions src/lsp/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,13 @@ export interface ShowFixSuggestionParams {
textEdits: Change[];
fileUri: string;
}

export namespace ShowFixSuggestion {
export const type = new lsp.NotificationType<ShowFixSuggestionParams>('sonarlint/showFixSuggestion');
}

export namespace IsOpenInEditor {
export const type = new lsp.RequestType<string, boolean, void>('sonarlint/isOpenInEditor');
}

//#endregion

0 comments on commit 04d3291

Please sign in to comment.