Skip to content
Discussion options

You must be logged in to vote

Hey @Serhioromano,

unfortunately, we cannot infer completion results from regex terminals automatically. You could try something like this instead:

grammar HelloWorld

entry Model:
    (funcs+=Funct | types+=Type)*;

Funct:
    'function' name=ID ':' (commonType=CommonType | type=[Type:ID]) 'end_func';

CommonType returns string: 'BOOL' | 'BYTE'; 

Type:
    'type' name=ID 'end_type';

hidden terminal WS: /\s+/;
terminal ID: /[_a-zA-Z][\w_]*/;

Alternatively, you can adjust the CompletionProvider to give you completion results for these terminals nonetheless. But using the approach above is likely more maintainable.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Serhioromano
Comment options

Answer selected by msujew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants