alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
41 stars 6 forks source link
separators typescript visual-studio-code vscode vscode-extension


Separators Logo

What's new in Separators 2.7

Support

Separators is an open source extension created for Visual Studio Code. While being free and open source, if you find it useful, please consider supporting it.

Separators

It improves the readability of your source code, by drawing lines on top of each symbol.

Print

Here are some of the features that Separators provides:

Language Support

The extension will automatically work with any language you have installed in VS Code. The only requirement is that the language itself does support Go to Symbol.

To be sure your desired language will work on Separators, take a look at Outline view in VS Code. If it display contents, then Separators will work perfectly.

Features

Available commands

Available settings

You can customize the appearance of each kind of Symbol.

Option Behavior
aboveTheSymbol A single separator located above the symbol
aboveTheComment A single separator located above the comment of the symbol
belowTheSymbol A single separator located below the symbol
surroundingTheSymbol A pair of separators located above and below the symbol
   "separators.location": "aboveTheSymbol"

Out of the box, the extension supports three patterns of comments:

If you want to add support for a custom language, you can add a new rule to the separators.aboveComments.rules setting. Here is an example for Lua:

   "separators.aboveComments.rules": [
        {
            "name": "Lua",
            "languageIds": [
                "lua"
            ],
            "rules": {
                "singleLine": "^\\s*--",
                "multiLine": [
                    {
                        "start": "^\\s*\\-\\-\\[\\[",
                        "end": "\\]\\]\\s*$"
                    }
                ]
            }
        }
    ],

Or you can open a PR, an contribute to the built in rules in the extension. These are located in the ./rules.json file

Be aware that regex must be escaped, so \\ is used instead of \

Available colors

For more information about customizing colors in VSCode, see Theme Color.

License

GPL-3.0 © Alessandro Fragnani