PhilippeChab / nwscript-ee-language-server

A NWScript Language Server.
https://marketplace.visualstudio.com/items?itemName=PhilippeChab.nwscript-ee-language-server
MIT License
20 stars 7 forks source link

Formatter bug #56

Open Aschent89 opened 1 year ago

Aschent89 commented 1 year ago

It appears that the auto-formatter is eating code when encountering color codes that are commonly used by NWN. This break happens regardless of whether the color code is in comments or not.

Repro Steps:

void testFunction(object oPC) { int nFoo = foo(oPC); int nFooBarFooBar = nFoo(oPC); }

- Save the file with formatter enabled.

You should notice the following: https://gyazo.com/fc3ee592f76cc5c26fa85ba4243568e6

## Formatter settings.json:
"nwscript-ee-lsp.formatter": {
    "enabled": true,
    "BasedOnStyle": "Google",
    "AlignTrailingComments": true,
    "AlignConsecutiveAssignments": true,
    "ColumnLimit": 250,
    "BreakBeforeBraces": "Allman",
    "AlignEscapedNewlinesLeft": true,
    "AlwaysBreakBeforeMultilineStrings": true,
    "MaxEmptyLinesToKeep": 1,
    "TabWidth": 4,
    "IndentWidth": 4,
    "UseTab": "Always",
    "ignoredGlobs": [
        "src/core/nui/**/*"
    ]
}
Aschent89 commented 1 year ago

Also, I updated to the following formatter settings and the issue did not subside.

        "enabled": true,
        "executable": "clang-format",
        "ignoredGlobs": [
            "src/core/nui/**/*"
        ],
        "style": {
            "BasedOnStyle": "Google",
            "AlignTrailingComments": true,
            "AlignConsecutiveAssignments": true,
            "ColumnLimit": 250,
            "BreakBeforeBraces": "Allman",
            "AlignEscapedNewlinesLeft": true,
            "AlwaysBreakBeforeMultilineStrings": true,
            "MaxEmptyLinesToKeep": 1,
            "TabWidth": 4,
            "IndentWidth": 4,
            "UseTab": "Always"