Skip to content

Commit 81a5aa6

Browse files
committed
reorganize first time plugin loaded persistence and event
1 parent 6ac91c9 commit 81a5aa6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ide-common/src/main/java/org/digma/intellij/plugin/common/IDEUtilsService.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
import org.digma.intellij.plugin.psi.*;
66
import org.jetbrains.annotations.*;
77

8+
/*
9+
This class is not perfect but it does serve our needs.
10+
see the comments in com.intellij.util.PlatformUtils, PlatformUtils is marked internal API so its better not to user it.
11+
for what we need its probably ok:
12+
isIdeaIDE() is for sure Idea if we have JavaLanguageService installed.
13+
isRiderIDE() is for sure rider if we have CHarpLanguageService installed.
14+
isPyCharmIDE() is for sure pycharm if we have PythonLanguageService installed and it's not Idea.
15+
if we need more capabilities here we need to explore the technics suggested in com.intellij.util.PlatformUtils
16+
*/
17+
818
@Service(Service.Level.PROJECT)
919
public final class IDEUtilsService {
1020

@@ -38,6 +48,7 @@ public boolean isJavaProject() {
3848
return idea.is();
3949
}
4050

51+
//this is not accurate, it may be rider but not a C# project
4152
public boolean isCSharpProject() {
4253
return rider.is();
4354
}
@@ -52,7 +63,8 @@ public boolean isRiderIDE() {
5263
}
5364

5465
public boolean isPyCharmIDE() {
55-
return pycharm.is();
66+
//python plugin may also be installed on Idea
67+
return pycharm.is() && !idea.is();
5668
}
5769

5870

0 commit comments

Comments
 (0)