diff --git a/src/main/kotlin/snyk/common/lsp/LSCodeVisionProvider.kt b/src/main/kotlin/snyk/common/lsp/LSCodeVisionProvider.kt index 5fa13b200..11458acd6 100644 --- a/src/main/kotlin/snyk/common/lsp/LSCodeVisionProvider.kt +++ b/src/main/kotlin/snyk/common/lsp/LSCodeVisionProvider.kt @@ -16,6 +16,7 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.util.TextRange import com.intellij.psi.PsiDocumentManager import icons.SnykIcons +import io.snyk.plugin.isSnykCodeLSEnabled import org.eclipse.lsp4j.CodeLens import org.eclipse.lsp4j.CodeLensParams import org.eclipse.lsp4j.ExecuteCommandParams @@ -42,7 +43,7 @@ class LSCodeVisionProvider : CodeVisionProvider { } override fun computeCodeVision(editor: Editor, uiData: Unit): CodeVisionState { - if (editor.project?.let { isAvailableFor(it) } == false) return CodeVisionState.READY_EMPTY + if (!isSnykCodeLSEnabled()) return CodeVisionState.READY_EMPTY LanguageServerWrapper.getInstance().ensureLanguageServerInitialized() return ReadAction.compute { val project = editor.project ?: return@compute CodeVisionState.READY_EMPTY