Skip to content

Commit 7a337ab

Browse files
committed
add edge listener
1 parent 7ffd74f commit 7a337ab

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

graph-database-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ intellij {
3535
// See https://plugins.jetbrains.com/docs/intellij/configuring-plugin-project.html#patching-the-plugin-configuration-file
3636
patchPluginXml {
3737
sinceBuild = "223.0"
38-
untilBuild = "232.*"
38+
untilBuild = ""
3939

4040
def allChanges = {
4141
changelog.getAll().values()

graph-database-plugin/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
7777
<!-- These versions are automatically replaced by the patchPluginXml task -->
78-
<idea-version since-build="999.0" until-build="999.0" />
78+
<idea-version since-build="223.0" />
7979

8080
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
8181
on how to target different products -->

ui/jetbrains/src/main/java/com/albertoventurini/graphdbplugin/jetbrains/ui/console/graph/EdgeNavigateAction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ public void navigateToInvocation(GraphRelationship relationship, VisualItem item
3030
}
3131

3232
public PsiCallExpression getPsiMethodCall(JavaInvokeInsn invocation, PsiMethod method){
33+
PsiMethod psiMethod = null;
34+
if (method.getContainingFile().getName().endsWith(".java")){
35+
psiMethod = method;
36+
}else{
37+
UsageInfo usage = new UsageInfo(method);
38+
psiMethod = PsiTreeUtil.getParentOfType(usage.getFile().findElementAt(usage.getSegment().getEndOffset()), PsiMethod.class);
39+
}
40+
Collection<PsiCallExpression> callExpressions = PsiTreeUtil.collectElementsOfType(psiMethod, PsiCallExpression.class);
41+
return callExpressions.stream().filter(call -> matchInvocation(call, invocation)).findFirst().get();
42+
}
43+
44+
public PsiCallExpression getPsiMethodCall1(JavaInvokeInsn invocation, PsiMethod method){
3345
UsageInfo usage = new UsageInfo(method);
3446
PsiMethod psiMethod = PsiTreeUtil.getParentOfType(usage.getFile().findElementAt(usage.getSegment().getEndOffset()), PsiMethod.class);
3547
Collection<PsiCallExpression> callExpressions = PsiTreeUtil.collectElementsOfType(psiMethod, PsiCallExpression.class);

0 commit comments

Comments
 (0)