indentationRules are being ignored

Viewed 71

I'm creating a vscode extension for a simple data format and everything works except indentation rules. Whatever I try it seems that it's being ignored.

My language-configuration.json looks like this

{
    ...,
    "brackets": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"]
    ],
    "indentationRules": {
        "increaseIndentPattern": "^(( *+(?!#))[^\\n]+(:|: ))$",
        "decreaseIndentPattern": "^[^ ]$"
    }
}

Basically I want to increase indentation if my line ends with a ":" or ": " (a space after semicolon), but not if it starts with a # sign (with optional spaces before the #). I tested the regex: https://regex101.com/r/wjrtK9/1 and it seems to work just fine.

I've even tried with the example from the documentation, removed brackets object, but it always works like I don't have any indentation rules defined (VS code then uses brackets object for indentation).

I'm running VS code

Version: 1.52.1 (user setup)
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042
1 Answers

I've recently had the same issues, but drilled down to other extensions interfering with it. I would disable all extensions first.

Related