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

Missing Proposals inside Datatype/Parser rules with "List"/repeat pattern #1583

Open
cdietrich opened this issue Jul 17, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@cdietrich
Copy link
Contributor

cdietrich commented Jul 17, 2024

Given the datatype rule

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

with

ID returns string: RawId | EscapedId;
terminal RawId: /[_a-zA-Z][\w_-]*/;
terminal EscapedId: /`[^`]*`/;

and a bit more lenient proposal provider

export class HelloWorldCompletionProvider extends DefaultCompletionProvider {

    protected override filterKeyword(_context: CompletionContext, _keyword: GrammarAST.Keyword): boolean {
        return true
      }

      protected override continueCompletion(items: CompletionItem[]): boolean {
          return true
      }

      protected override performNextTokenCompletion(document: LangiumDocument, text: string, _offset: number, _end: number): boolean {
          return true
      }

}

given model

a| the . will be proposed,

at

a.b| the . will NOT be proposed,

same for normal parser rule

Thing:
    "thing" names+=ID ("." names+=ID)*;
@cdietrich cdietrich added the bug Something isn't working label Jul 17, 2024
@cdietrich
Copy link
Contributor Author

cdietrich commented Jul 18, 2024

possible workaround

Thing:
    "thing" names+=ID ThingyRestList*;

fragment ThingyRestList:
    ("." names+=ID);
ID returns string: RawId | EscapedId;
QualifiedName returns string: ID QNF*;
fragment QNF returns string: ('.' ID);

@cdietrich
Copy link
Contributor Author

hmmm
grafik

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