
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
Separators
Advanced tools
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.
|
|
|
It improves the readability of your source code, by drawing lines on top of each symbol or specific folding ranges.

Here are some of the features that Separators provides:
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.
The extension only draws separators for specific (special) folding ranges, like Comments, Imports and Regions. Just like in Symbols, the only requirement is that the language itself does support these folding ranges.
Separators: Toggle VisibilitySeparators: Select SymbolsSeparators: Select Folding RangesYou can customize the appearance of each kind of Symbol.
// globally (user/workspace setting)
"separators.enabledSymbols": [
"Classes",
"Constructors",
"Enums",
"Functions",
"Interfaces",
"Methods",
"Namespaces",
"Structs",
"Properties"
],
// per-language setting
"[typescript]": {
"separators.enabledSymbols": [
"Enums",
"Interfaces"
],
}
false) // globally (user/workspace setting)
"separators.functions.ignoreCallbackInline": true
// per-language setting
"[javascript]": {
"separators.functions.ignoreCallbackInline": true
}
For now, only JavaScript, TypeScript and Lua languages are supported. If you would like to see it on other languages, please open an issue providing details/samples
true) // globally (user/workspace setting)
"separators.properties.onlyGetterAndSetter": false
// per-language setting
"[javascript]": {
"separators.properties.onlyGetterAndSetter": false
}
For now, only JavaScript, TypeScript and Lua languages are supported. If you would like to see it on other languages, please open an issue providing details/samples
0) "separators.maxDepth": 1
// per-language setting
"[javascript]": {
"separators.maxDepth": 2
}
0 - unlimited) "separators.minimumLineCount": 2
// per-language setting
"[javascript]": {
"separators.minimumLineCount": 2
}
px) "separators.classes.borderWidth": 1,
"separators.constructors.borderWidth": 1,
"separators.enums.borderWidth": 1,
"separators.functions.borderWidth": 1,
"separators.interfaces.borderWidth": 1,
"separators.methods.borderWidth": 1,
"separators.namespaces.borderWidth": 1,
"separators.structs.borderWidth": 1,
"separators.properties.borderWidth": 1,
solid, dotted, dashed or double) "separators.classes.borderStyle": "solid",
"separators.constructors.borderStyle": "solid",
"separators.enums.borderStyle": "solid",
"separators.functions.borderStyle": "solid",
"separators.interfaces.borderStyle": "solid",
"separators.methods.borderStyle": "solid",
"separators.namespaces.borderStyle": "solid",
"separators.structs.borderStyle": "solid",
"separators.properties.borderStyle": "solid",
aboveTheSymbol)| 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:
// this is a single line comment
/* this is a multi line comment
this is a multi line comment */
// this is a single line comment
{ this is a multi line comment
this is a multi line comment }
(* this is an old school multi line comment
this is an old school multi line comment *)
-- this is a single line comment
--[[ this is a multi line comment
this is a multi line comment ]]
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\
// globally (user/workspace setting)
"separators.enabledFoldingRanges": [
"Comments",
"Imports",
"Regions"
],
// per-language setting
"[csharp]": {
"separators.enabledFoldingRanges": [
"Regions"
],
}
px) "separators.foldingRanges.comments.borderWidth": 1,
"separators.foldingRanges.imports.borderWidth": 1,
"separators.foldingRanges.regions.borderWidth": 1
solid, dotted, dashed or double) "separators.foldingRanges.comments.borderStyle": "solid",
"separators.foldingRanges.imports.borderStyle": "solid",
"separators.foldingRanges.regions.borderStyle": "solid",
For more information about customizing colors in VSCode, see Theme Color.
"workbench.colorCustomizations": {
"separators.classes.borderColor": "#65EAB9",
"separators.constructors.borderColor": "#65EAB9",
"separators.enums.borderColor": "#65EAB9",
"separators.functions.borderColor": "#65EAB9",
"separators.interfaces.borderColor": "#65EAB9",
"separators.methods.borderColor": "#65EAB9",
"separators.namespaces.borderColor": "#65EAB9",
"separators.structs.borderColor": "#65EAB9",
"separators.foldingRanges.comments.borderColor": "#65EAB9",
"separators.foldingRanges.imports.borderColor": "#65EAB9",
"separators.foldingRanges.regions.borderColor": "#65EAB9",
}
GPL-3.0 © Alessandro Fragnani
FAQs
Improve the readability of your source code with lines on top of each method
We found that alefragnani.separators demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.