Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content assist not working at specific grammar element #1301

Open
cdietrich opened this issue Nov 27, 2023 · 0 comments
Open

Content assist not working at specific grammar element #1301

cdietrich opened this issue Nov 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@cdietrich
Copy link
Contributor

cdietrich commented Nov 27, 2023

Given the grammar

grammar Cabug2

entry Model:
    'package' package=QualifiedName
    (content+=Thing)*;


ActionParameter:
    (optional?='optional')? name=ID ':' type=Type;

Type: name="Text";

CustomAction:
    (query?='query')? 'action' name=ID '(' (inputParameters+=ActionParameter (',' inputParameters+=ActionParameter)*)? ')' ':' outputValues=Type;

ThingContent:
    ValidationBlock | CustomAction;

Thing:
    'thing' name=ID '{'
        (content+=ThingContent)*
    '}';

ValidationBlock: 'validations' '{' (content+=Statement)* '}';


When: 'when' condition=Expression '{' '}';

Statement:  When ;

QualifiedName returns string:
    ID ('.' ID)*;

Expression:
    Primary;

Primary infers Expression:
    {infer Parenthesis} '(' expr=Expression ')' |
    RefExpression |
    ActionCallExpression ;

ActionArgument:
    parameter=[ActionParameter:ID] '=' value=Expression;

ActionCallExpression:
    action=[CustomAction:ID] '(' (args+=ActionArgument (',' args+=ActionArgument)*)? ')';

RefExpression:
    target=[Thing:ID];

ID returns string: RawId | EscapedId;

hidden terminal WS: /\s+/;
terminal RawId: /[_a-zA-Z][\w_-]*/;
terminal EscapedId: /`[^`]*`/;

hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;

content assist does not work at

package demo

thing Parent {

    validations {
        when myaction ( <|> ) {}
    }

    query action myaction ( p1: Text , p2: Text, optional p3: Text  ) : Text

}

when i comment out

 RefExpression |

it does

@cdietrich cdietrich added the bug Something isn't working label Nov 27, 2023
@msujew msujew changed the title Content assist not working Content assist not working at specific grammar element Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant