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)) }