Community
Participate
Working Groups
The template syntax problems that need to be solved are the following: (1) ${var} -> use the "var" word without necessarily having the following form "${ID:var}" (2) ${type:link(String,int)} -> the problem here is the word "int". Types need to be used as proposals as well (for the moment the 'Proposal' rule only allows QualifiedNames and JavaLiterals) (3) allow the use of annotations. @Johannes: There are 2 ignored tests ("nls.cSnip" and "fall-through.cSnip") marked with "Comments are ignored by the parser for now". Can you please explain what is the issue here? For me comments are marked as in java. Thank you!
Hi Stefan, (In reply to Stefan Prisca from comment #0) > @Johannes: There are 2 ignored tests ("nls.cSnip" and "fall-through.cSnip") > marked with "Comments are ignored by the parser for now". Can you please > explain what is the issue here? For me comments are marked as in java. Thank > you! I put in this comment when I created (and @Ignored) the tests. The issue is that the Xtext default lexer/tokenizer (not the parser, as the comment states) already throws away anything after a "//" and between "/*" and "*/". This means that the parser, who receives its input token stream from the lexer never sees the special $-constructs within in the comments. So, naturally, we cannot offer any syntax highlighting or (more importantly) code completion in comments with the current "throw away comments prior to parsing" strategy. Does this explain things?
(In reply to Andreas Sewe from comment #1) Hi Andreas, Thanks for clarifying that out! I understand now. I'll have to look into it, but AFAIK the comment terminals are defined in the XText.terminals grammar, the one that we use to build our grammar. Maybe re-writing our own terminals for comments would change something?(It's just an idea, it most probably won't work).
Well, our parent Terminals grammar doesn't define terrible many items, so copy & paste doesn't sound too bad. That being said, maybe a sub-grammar can redefine tokens or what is treated as a comment.
Resolved by patch-set <http://git.eclipse.org/c/recommenders.incubator/org.eclipse.recommenders.snipmatch.git/commit/?id=3ed29e520825ce17789b7405df98e957f5ab5fcb>