Skip to content

Commit 5aeec87

Browse files
committed
Added PSI support for arguments in Endpoint Language (#35)
1 parent 746eb99 commit 5aeec87

20 files changed

+328
-73
lines changed

gen/com/intellij/lang/jsgraphql/endpoint/JSGraphQLEndpointTokenTypes.java

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/parser/JSGraphQLEndpointParser.java

Lines changed: 19 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/psi/JSGraphQLEndpointInputValueDefinition.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/psi/JSGraphQLEndpointInputValueDefinitionIdentifier.java

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/psi/JSGraphQLEndpointVisitor.java

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/psi/impl/JSGraphQLEndpointInputValueDefinitionIdentifierImpl.java

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/com/intellij/lang/jsgraphql/endpoint/psi/impl/JSGraphQLEndpointInputValueDefinitionImpl.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/com/intellij/lang/jsgraphql/endpoint/JSGraphQLEndpointParser.bnf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ private RecoverArgumentsDefinition ::= !(COLON | RBRACE | AT_ANNOTATION | identi
9898

9999
InputValueDefinitions ::= InputValueDefinition (COMMA InputValueDefinition)*
100100

101-
InputValueDefinition ::= identifier COLON CompositeType {pin=1}
101+
InputValueDefinition ::= InputValueDefinitionIdentifier COLON CompositeType {pin=1}
102+
103+
InputValueDefinitionIdentifier ::= identifier {mixin="com.intellij.lang.jsgraphql.endpoint.psi.JSGraphQLEndpointInputValueDefinitionIdentifierPsiElement" implements="com.intellij.psi.PsiNameIdentifierOwner"}
102104

103105
Annotations ::= Annotation+
104106

src/main/com/intellij/lang/jsgraphql/endpoint/doc/ide/annotator/JSGraphQLEndpointDocHighlightAnnotator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder hold
6868
boolean found = false;
6969
if(inputValues != null) {
7070
for (JSGraphQLEndpointInputValueDefinition inputValue: inputValues) {
71-
if(inputValue.getIdentifier().getText().equals(paramName)) {
71+
if(inputValue.getInputValueDefinitionIdentifier().getText().equals(paramName)) {
7272
found = true;
7373
break;
7474
}

src/main/com/intellij/lang/jsgraphql/endpoint/doc/ide/completion/JSGraphQLEndpointDocCompletionContributor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected void addCompletions(@NotNull final CompletionParameters parameters, Pr
5858
if (fieldDefinition != null && fieldDefinition.getArgumentsDefinition() != null) {
5959
final List<String> otherDocTagValues = JSGraphQLEndpointDocPsiUtil.getOtherDocTagValues(comment);
6060
for (JSGraphQLEndpointInputValueDefinition arg : PsiTreeUtil.findChildrenOfType(fieldDefinition.getArgumentsDefinition(), JSGraphQLEndpointInputValueDefinition.class)) {
61-
final String argName = arg.getIdentifier().getText();
61+
final String argName = arg.getInputValueDefinitionIdentifier().getText();
6262
if (!otherDocTagValues.contains(argName)) {
6363
result.addElement(LookupElementBuilder.create(argName).withInsertHandler(AddSpaceInsertHandler.INSTANCE));
6464
}

0 commit comments

Comments
 (0)