From 1a388587df350106474380948322a49909bf4a73 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Tue, 8 Oct 2024 17:46:04 +0200 Subject: [PATCH] feat: add get sdks callback listener --- CHANGELOG.md | 2 +- src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fc1ff5f..d53372a21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - added ai fix feedback support - enable for IntelliJ 2024.3 platform - require LS protocol version 16 -- transmit project sdks to language server +- transmit project sdks to language server when requested by a scan ### Fixes - add name to code vision provider diff --git a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt index 92c16b9ba..d9df12bf8 100644 --- a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt +++ b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt @@ -282,10 +282,10 @@ class SnykLanguageClient : } } - @JsonRequest(value = "$/snyk.getSDKs") - fun getSdks(workspaceFolder: WorkspaceFolder) : List { - val project = guessProjectForFile(workspaceFolder.uri.toVirtualFile()) ?: return emptyList() - return SdkHelper.getSdks(project) + @JsonRequest(value = "workspace/snyk.sdks") + fun getSdks(workspaceFolder: WorkspaceFolder) : CompletableFuture> { + val project = guessProjectForFile(workspaceFolder.uri.toVirtualFile()) ?: return CompletableFuture.completedFuture(emptyList()) + return CompletableFuture.completedFuture(SdkHelper.getSdks(project)) }