Completion with Enum [message #1693692] |
Mon, 27 April 2015 14:30 |
naseclipse naseclipse Messages: 14 Registered: April 2015 |
Junior Member |
|
|
Hello,
When it comes to completion for Enum literals, I see some problem when a certain literal is part of another literal. For example, 'may' and 'may have' are literals, where 'may' is part of 'may have'. During completion 'may have' overrides 'may'.
How is it possible to complete 'may' if i choose to, and ignore 'may have'?
/* Editor */
Type pronoun
Type verb
Statement s1 she:pronoun may have togo:verb
Statement s2 she:pronoun may go:verb // shows error in this line
Error: mismatched character 'g' expecting 'h'
/* the grammar */
grammar org.xtext.example.langdsl.LangDsl with org.eclipse.xtext.common.Terminals
generate langDsl "http://www.xtext.org/example/langdsl/LangDsl"
LanguageModel:
elements += LangModel*
;
LangModel:
Type | Statement
;
Type:
"Type" name = ID
;
Statement:
"Statement" name = ID
subject = ID ':' subType = [Type] verb = VerbEnum object = ID ':' objType = [Type]
;
enum VerbEnum:
MAY = 'may' | MAYHAVE = 'may have'
;
/* END: grammar */
Thank you.
Regards,
Nas
[Updated on: Mon, 27 April 2015 14:35] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02970 seconds