Skip to content

Custom Formatter Error #624

Answered by snarkipus
snarkipus asked this question in Q&A
Aug 9, 2022 · 3 comments · 8 replies
Discussion options

You must be logged in to vote

Tag: @msujew

Disregard - I'll leave this here in case anyone else is curious. I'm assuming that since we don't have dynamic dispatch (Xtend) that means that we have to call format() on all of the nodes of the AST and select which nodes to apply formatting to using the utility isSomeType() function. Please feel free to clarify if I'm off the mark.

    protected format(node: AstNode): void {

        if (ast.isModel(node)) {
            const lastEntity = node.entities[node.entities.length - 1];

            node.entities.forEach(entity => {
                const formatter = this.getNodeFormatter(entity);
                const node = formatter.node(entity);
                if (entity === la…

Replies: 3 comments 8 replies

Comment options

snarkipus
Aug 9, 2022
Collaborator Author

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

Answer selected by snarkipus
Comment options

snarkipus
Aug 9, 2022
Collaborator Author

You must be logged in to vote
4 replies
@msujew
Comment options

@snarkipus
Comment options

snarkipus Aug 9, 2022
Collaborator Author

@msujew
Comment options

@msujew
Comment options

Comment options

snarkipus
Aug 10, 2022
Collaborator Author

You must be logged in to vote
3 replies
@msujew
Comment options

@snarkipus
Comment options

snarkipus Aug 11, 2022
Collaborator Author

@snarkipus
Comment options

snarkipus Aug 11, 2022
Collaborator Author

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