Skip to content

Commit

Permalink
fix: only display code vision when feature flag enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Feb 20, 2024
1 parent 4f0c6bd commit 8623724
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/snyk/common/lsp/LSCodeVisionProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +43,7 @@ class LSCodeVisionProvider : CodeVisionProvider<Unit> {
}

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<CodeVisionState, RuntimeException> {
val project = editor.project ?: return@compute CodeVisionState.READY_EMPTY
Expand Down

0 comments on commit 8623724

Please sign in to comment.