eclipse-xtext / eclipse-xtext/xtext
ISE in Content Assist Parser
Open
@szarnekow is already working on this.
Since Jul 13, 2018.
bug
confirmed
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
Given the grammar
Model:
'model' name=Identifier '{'(
(b=B)? &
(cl=CList)?
)'}';
B: {B}'b' '{' '}';
CList:
-> c+=C+;
C:
{C}
'c' sr+=SomeReference ('+' sr+=SomeReference)* '{'
xc1b=SomeEnum?
'}';
SomeReference: target=Identifier;
enum SomeEnum: bla='Bla' | blubb='Blubb';
Identifier: ID;
and the sample model
model MyModel {
c A+B+C {}
c D{Blubb}
c <|>
b{}
}
with <|> beeing the cursor content assist gives
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.xtext.ide.editor.contentassist.antlr.BaseContentAssistParser.getFollowElements(BaseContentAssistParser.java:171)
at org.eclipse.xtext.ide.editor.contentassist.antlr.BaseContentAssistParser.getFollowElements(BaseContentAssistParser.java:241)
... 12 more
Caused by: java.lang.IllegalStateException: expected element: 'org.eclipse.xtext.impl.RuleCallImpl@1edcfb88 (cardinality: null, predicated: false, firstSetPredicated: false) (explicitlyCalled: false)', but was: 'org.eclipse.xtext.impl.AssignmentImpl@680410ec (cardinality: +, predicated: false, firstSetPredicated: true) (feature: c, operator: +=)'
at org.eclipse.xtext.ide.editor.contentassist.antlr.internal.BaseInternalContentAssistParser.after(BaseInternalContentAssistParser.java:153)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__ClAssignment_3_1(InternalMyDslParser.java:2659)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__UnorderedGroup_3__Impl(InternalMyDslParser.java:2411)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__UnorderedGroup_3__0(InternalMyDslParser.java:2467)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__UnorderedGroup_3(InternalMyDslParser.java:2281)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__Group__3__Impl(InternalMyDslParser.java:1069)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__Group__3(InternalMyDslParser.java:1022)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__Group__2(InternalMyDslParser.java:948)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__Group__1(InternalMyDslParser.java:859)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.rule__Model__Group__0(InternalMyDslParser.java:780)
at org.xtext.example.mydsl1.ide.contentassist.antlr.internal.InternalMyDslParser.ruleModel(InternalMyDslParser.java:134)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.