Closed msujew closed 4 months ago
Yay - this cleans up my request from #591!
Do you plan to filter code completion based on the look-behind patterns, too?
@szarnekow Can you give an example? I don't think the completion takes the specific token pattern into account at all right now.
I see. The completion engine doesn't use the terminal rules to check inserted tokens for validity at all.
Yes, it will currently just insert whatever the scope provider returns, ignoring any potential parser/lexer error that this might result in.
grammar test
entry Main: things=AorB+;
AorB: A|B;
A: ('A' | 'C') b=[B:B_TERMINAL]? ';';
B: name=B_TERMINAL ';'
terminal B_TERMINAL: (?<!'A')'B';
hidden terminal WS: /\\s+/;
Model with cursor positions <1>
and <2>
where I'd invoke CA:
B;
A<1>;
C<2>;
I wouldn't expect B to show up at <1>
but at <2>
- though I wouldn't get any proposals in either case because of the default reg filter in the completion engine.
I see, thanks for the example. I have created a separate issue, see https://github.com/eclipse-langium/langium/issues/1368 👍
Closes https://github.com/eclipse-langium/langium/issues/1355
Allows adopters to write positive/negative lookbehind in both EBNF and Regex notation, with full support in the lexer/parser phase.