Skip to content

vscode extension: rename the id property and all its references in scope #1817

Answered by shutterfreak
shutterfreak asked this question in Q&A
Discussion options

You must be logged in to vote

I got it to work thanks to your input!

I added the diagnostic codes to my validators, for instance:

  checkUniqueElementNames = (
    model: Model,
    accept: ValidationAcceptor,
  ): void => {
    // Create a set of identifiers while traversing the AST
    const identifiers = new Set<string>();

    function traverseElement(element: Element): void {
      const preamble = `traverseElement(${element.$type} element (${element.id ?? "<no name>"}))`;
      console.log(chalk.white(`${preamble} - START`));
      if (
        (isNode(element) || isGraph(element)) &&
        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
        (element.id === undefined || element.id.l…

Replies: 3 comments 15 replies

Comment options

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

@cdietrich
Comment options

@shutterfreak
Comment options

@msujew
Comment options

@shutterfreak
Comment options

Comment options

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

@shutterfreak
Comment options

@cdietrich
Comment options

@shutterfreak
Comment options

@cdietrich
Comment options

Comment options

You must be logged in to vote
0 replies
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
3 participants