Skip to content

Commit 8b02005

Browse files
committed
fix bug in RiderFileClosedListener
Signed-off-by: shalom <[email protected]>
1 parent ee80005 commit 8b02005

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rider/src/main/java/org/digma/intellij/plugin/rider/editor/RiderFileClosedListener.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import com.intellij.openapi.fileEditor.FileEditorManager;
44
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
55
import com.intellij.openapi.project.Project;
6+
import com.intellij.openapi.vcs.vfs.ContentRevisionVirtualFile;
67
import com.intellij.openapi.vfs.VirtualFile;
78
import com.intellij.psi.PsiManager;
9+
import com.intellij.testFramework.BinaryLightVirtualFile;
810
import org.digma.intellij.plugin.document.DocumentInfoService;
911
import org.digma.intellij.plugin.psi.LanguageService;
1012
import org.digma.intellij.plugin.rider.protocol.CodeObjectHost;
@@ -28,6 +30,12 @@ public RiderFileClosedListener(Project project) {
2830
@Override
2931
public void fileClosed(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
3032

33+
//its vcs revision files that we open so not relevant for file closed
34+
if (file instanceof BinaryLightVirtualFile &&
35+
((BinaryLightVirtualFile) file).getOriginalFile() instanceof ContentRevisionVirtualFile) {
36+
return;
37+
}
38+
3139
//when a file is closed or deleted while open we want to clear its document from the rider protocol and from
3240
//and the DocumentInfo from documentInfoService
3341
var psiFile = PsiManager.getInstance(project).findFile(file);

0 commit comments

Comments
 (0)