Not all candidate sorts detected in completion
There are certain classes of grammars for which the (completion) parser doesn’t return all sorts that are allowed at a particular position.
How to reproduce:
- Add the following grammar to EntityLang:
context-free syntax
“if” ID “then” Property* ElseIfPart* ElsePart? “end” -> Property {cons(“If”)}
“elseif” ID “then” Property* -> ElseIfPart {cons(“ElseIf”)}
“else” Property* -> ElsePart {cons(“Else”)}
- Now insert something like this in an entity:
if cond then
elseif cond then
//cursor
end
- Trigger completion at the marked cursor location. Only
Property
is in the list of candidate sorts. I expectedElseIfPart
andElsePart
to be in the list too. The correct sorts are reported when I trigger completion with the cursor right after the lastthen
keyword.As far as I have seen it happens often when there are consecutive
*
and?
symbols in a production.It doesn’t appear to be fixable by inserting extra (recovery) productions.
Submitted by Tobi Vollebregt on 18 April 2011 at 16:57
Issue Log
The sorts do not seem to show up in the console message, unless there is a completion template for that sort. Is this intended behavior?
fixed in new completion handling (Spoofax 1.1).
Log in to post comments