dirkgroot / structurizr-dsl-intellij-plugin

IntelliJ plugin for the Structurizr DSL
MIT License
53 stars 3 forks source link

A single line comment on the same line as `}` causes parser error and disables syntax highlighting #140

Open psvo opened 6 months ago

psvo commented 6 months ago

A single line comment on the same line as } is accepted by the upstream parser, but not by the plugin. The parser error caused by such comment also disable syntax highlighting for the whole file.

  1. The following results in "CRLF expected, got '#'"
    workspace {
        model {
            a = softwareSystem a
        }
    } # comment
  2. The following results in "CRLF expected, got 'model'"
    workspace {
        model {
            a = softwareSystem a
        } # comment
    }

On the other hand, single line comments on the same line as { (e.g., model { # comment) are sometimes accepted and sometimes rejected by the upstream parser. It seems they are allowed after model, views, but they are not allowed after anything that takes arguments. Note, for comments after { the plugin does not produce misleading errors like (2) and they do not disable the syntax highlighting. Also, such comments are must less useful, so it does not seem worth supporting them in the few cases where upstream parser allows them.