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

make some parts of the grammar easier to read and more DRY, format with the default Langium formatter #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trusktr
Copy link

@trusktr trusktr commented May 8, 2023

I felt like the formatting of the grammar was a little difficult to read, namely the function/method calls, so I formatted them and took out the arguments lists into a shared fragment. I also formatted the rest of the file using Langium's default grammar formatter.

The new formatting is also closer to how JavaScript/TypeScript people format code.

Sidenote, the formatter wants to un-indent the comment, which was out of my controls:

    ({infer MemberCall.previous=current} 
        "." element=[NamedElement:ID] ( FunctionCallArguments )? 
    // Chained function call
        | ( FunctionCallArguments )
    )*;

The formatter would need a tweak so that it will instead do this:

    ({infer MemberCall.previous=current} 
        "." element=[NamedElement:ID] ( FunctionCallArguments )? 
        // Chained function call
        | ( FunctionCallArguments )
    )*;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant