eclipse-xtext / eclipse-xtext/xtext
Regression in content assist follow elements calculation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
After updating to Xtext 2.25 (from 2.21) we see unwanted } proposals given the grammar
Specification:
{Specification}
'specification' name=ID '{'
((a+=A) |
(b+=B) |
(c+=C) |
(d+=D) |
(e+=E) |
(s+=S) |
(f+=F) |
(g+=G))*
'}';
A:
"A" name=ID;
B:
"B" name=ID;
C:
"C" name=ID;
D:
"D" name=ID;
E:
"E" name=ID;
Fqn:
ID ('.' ID)*;
F:
'pi' xxxxxx=ID name=ID '{'
'}';
G:
'something' 'pi' i=Fqn '{'
'}';
S:
'something' xxx=Fqn s=ID '{'
'}';
and model
specification xxxx {
something aaaa bbbb {
}
}
invoking content assist at aaaa gives the unwanted } proposal.
debugging 2.21 vs 2.25 i can see a difference in
Dfa.error which leads to failedPredicateAtEOF be set to true respecively not set to true


which then leads to different paths in
org.eclipse.xtext.ide.editor.contentassist.antlr.internal.new StreamAdapter() {...}.announceEof(int)
cause seems to be this change:
https://github.com/eclipse/xtext-core/pull/1469
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.
Research direction
Start with the supplied grammar and model, then compare Xtext 2.21 and 2.25 around Dfa.error and failedPredicateAtEOF. Trace the content-assist path through StreamAdapter.announceEof(int) and review PR 1469. Done means invoking content assist at aaaa no longer proposes an unwanted closing brace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100