Skip to content

Formatter bug #56

@Aschent89

Description

@Aschent89

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:

  • Make a new .nss file
  • Use the following code:
// "<c ¤|>"
// "<c ¥ÿ>"
// "<c¡¡¡>"
// "<cÔ ¶>"
// "<c|  >"
// "<cÿ? >"

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/**/*"
        ]
    }

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions