Skip to content

Commit 7fb437d

Browse files
author
Alberto Venturini
committed
Fix remaining compatibility issues. PluginVerifier is successful
1 parent d9cf54e commit 7fb437d

File tree

6 files changed

+33
-21
lines changed

6 files changed

+33
-21
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=0.1.2
1+
version=0.1.3
22

33
# Intellij SDK
44
intellijSdkVersion=2022.2

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
Graph database plugin for the IntelliJ Platform
1212
</a>
1313
</p>
14-
1514
<p>
1615
<b>Features:</b>
1716
<ul>
@@ -52,6 +51,16 @@
5251
</ul>
5352
</ul>
5453
</p>
54+
<p>
55+
This plugin is based on the 'Graph Database Support plugin'
56+
developed by Neueda Technologies, Ltd. The original plugin has not been updated
57+
in a long time.
58+
</p>
59+
<p>
60+
This plugin has been updated to run with modern versions of IntelliJ and related IDEs.
61+
Just like the original plugin, it supports Neo4j and Cypher data sources; however, support for
62+
Gremlin data sources (such as Cosmos DB) has been dropped.
63+
</p>
5564
]]></description>
5665

5766
<change-notes><![CDATA[

language/cypher/src/main/java/com/albertoventurini/graphdbplugin/language/cypher/references/CypherInvocation.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ default List<InvokableInformation> resolve() {
6767
return matchedInvocations;
6868
}
6969

70+
String name = getFullName();
71+
7072
matchedInvocations.addAll(CypherBuiltInFunctions.FUNCTIONS.stream()
7173
.map(CypherBuiltInFunctionElement::getInvokable)
72-
.filter(invokable -> Objects.equals(invokable.getName(), getFullName()))
74+
.filter(invokable -> Objects.equals(invokable.getName(), name))
7375
.collect(toList()));
76+
7477
if (matchedInvocations.isEmpty()) {
7578
svc.findUserFunction(getFullName())
7679
.map(CypherUserFunctionElement::getInvokableInformation)

language/cypher/src/main/java/com/albertoventurini/graphdbplugin/language/cypher/references/CypherVariableElement.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package com.albertoventurini.graphdbplugin.language.cypher.references;
88

9+
import com.albertoventurini.graphdbplugin.language.cypher.completion.metadata.atoms.CypherSimpleType;
910
import com.albertoventurini.graphdbplugin.language.cypher.psi.CypherMaybeVariableLength;
1011
import com.albertoventurini.graphdbplugin.language.cypher.psi.CypherNodePattern;
1112
import com.albertoventurini.graphdbplugin.language.cypher.psi.CypherPatternPart;
@@ -15,6 +16,8 @@
1516
import com.intellij.psi.PsiReference;
1617
import com.albertoventurini.graphdbplugin.language.cypher.completion.metadata.atoms.CypherList;
1718
import com.albertoventurini.graphdbplugin.language.cypher.completion.metadata.atoms.CypherType;
19+
import com.intellij.psi.PsiReferenceService;
20+
import org.jetbrains.annotations.NotNull;
1821
import org.jetbrains.annotations.Nullable;
1922

2023
import java.util.Optional;
@@ -43,16 +46,13 @@ default CypherType getType() {
4346
} else if (node instanceof CypherPatternPart) {
4447
return PATH;
4548
} else if (node instanceof CypherRelationshipDetail) {
46-
return resolveRelationshipType((CypherRelationshipDetail) node);
49+
CypherMaybeVariableLength maybeVariableLength =
50+
((CypherRelationshipDetail) node).getMaybeVariableLength();
51+
return nonNull(maybeVariableLength) ? CypherList.of(RELATIONSHIP) : RELATIONSHIP;
4752
}
4853

4954
return null;
5055
})
5156
.orElse(ANY);
5257
}
53-
54-
default CypherType resolveRelationshipType(CypherRelationshipDetail relationshipDetail) {
55-
CypherMaybeVariableLength maybeVariableLength = relationshipDetail.getMaybeVariableLength();
56-
return nonNull(maybeVariableLength) ? CypherList.of(RELATIONSHIP) : RELATIONSHIP;
57-
}
5858
}
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
updater.title=Graph Database plugin updated to v{0}
22
updater.notification=Initial release of Graph Database Plugin.<br/>\
3-
This plugin is based on the 'Graph Database Support plugin' \
4-
developed by Neueda. The original plugin has not been updated\
5-
in a long time. <br/>\
6-
<br/>\
7-
This plugin adds support for newer versions of IntelliJ\
8-
and related IDEs.\
9-
<br/>\
10-
This plugin supports Neo4j data sources but does not support\
11-
Gremlin-based data sources such as Cosmos DB.\
12-
\
3+
This plugin is based on the 'Graph Database Support plugin' \
4+
developed by Neueda Technologies, Ltd. The original plugin has not been updated \
5+
in a long time. <br/>\
136
<br/>\
14-
<a href="https://github.com/albertoventurini/graphdb-intellij-plugin">Github</a>
7+
This plugin has been updated to run with modern versions of IntelliJ and related IDEs. \
8+
Just like the original plugin, it supports Neo4j and Cypher data sources; however, support for \
9+
Gremlin data sources (such as Cosmos DB) has been dropped. \
10+
<br/>\
11+
For more information, please see the \
12+
<a href="https://github.com/albertoventurini/graphdb-intellij-plugin">Github</a> \
13+
repository.

ui/jetbrains/src/main/java/com/albertoventurini/graphdbplugin/jetbrains/inspection/CypherExplainWarningInspection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.intellij.codeInspection.LocalInspectionTool;
1313
import com.intellij.codeInspection.LocalInspectionToolSession;
1414
import com.intellij.codeInspection.ProblemsHolder;
15+
import com.intellij.openapi.application.ApplicationManager;
1516
import com.intellij.psi.PsiElement;
1617
import com.intellij.psi.PsiElementVisitor;
1718
import com.albertoventurini.graphdbplugin.database.api.GraphDatabaseApi;
@@ -52,7 +53,7 @@ public void visitElement(@NotNull PsiElement element) {
5253
private void checkStatement(@NotNull PsiElement statement, @NotNull ProblemsHolder problemsHolder) {
5354
if (statement.getNode().getElementType() == CypherTypes.SINGLE_QUERY) {
5455
final DatabaseManagerService databaseManagerService =
55-
statement.getProject().getService(DatabaseManagerService.class);
56+
ApplicationManager.getApplication().getService(DatabaseManagerService.class);
5657

5758
final DataSourcesComponent dataSourcesComponent =
5859
statement.getProject().getService(DataSourcesComponent.class);

0 commit comments

Comments
 (0)