Skip to content

Commit

Permalink
fix: disallow language servers in light edit mode
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Oct 30, 2023
1 parent 1a457e7 commit 29372f8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
******************************************************************************/
package com.redhat.devtools.intellij.lsp4ij;

import com.intellij.ide.lightEdit.LightEdit;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
Expand Down Expand Up @@ -56,6 +57,9 @@ public void projectClosing(@NotNull Project project) {
@Override
public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
Project project = source.getProject();
if (LightEdit.owns(project)) {
return; // Don't run in light edit mode
}
boolean readAccessAllowed = ApplicationManager.getApplication().isReadAccessAllowed();
boolean dumb = DumbService.isDumb(project);
// As document matcher requires read action, we try to open the file in read action and when indexing is finishsed.
Expand Down

0 comments on commit 29372f8

Please sign in to comment.