-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
252 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
250 changes: 250 additions & 0 deletions
250
src/vs/workbench/contrib/codeEditor/test/node/language-configuration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,250 @@ | ||
{ | ||
// Note that this file should stay in sync with 'javascript-language-basics/javascript-language-configuration.json' | ||
"comments": { | ||
"lineComment": "//", | ||
"blockComment": [ | ||
"/*", | ||
"*/" | ||
] | ||
}, | ||
"brackets": [ | ||
[ | ||
"${", | ||
"}" | ||
], | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"(", | ||
")" | ||
] | ||
], | ||
"autoClosingPairs": [ | ||
{ | ||
"open": "{", | ||
"close": "}" | ||
}, | ||
{ | ||
"open": "[", | ||
"close": "]" | ||
}, | ||
{ | ||
"open": "(", | ||
"close": ")" | ||
}, | ||
{ | ||
"open": "'", | ||
"close": "'", | ||
"notIn": [ | ||
"string", | ||
"comment" | ||
] | ||
}, | ||
{ | ||
"open": "\"", | ||
"close": "\"", | ||
"notIn": [ | ||
"string" | ||
] | ||
}, | ||
{ | ||
"open": "`", | ||
"close": "`", | ||
"notIn": [ | ||
"string", | ||
"comment" | ||
] | ||
}, | ||
{ | ||
"open": "/**", | ||
"close": " */", | ||
"notIn": [ | ||
"string" | ||
] | ||
} | ||
], | ||
"surroundingPairs": [ | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"(", | ||
")" | ||
], | ||
[ | ||
"'", | ||
"'" | ||
], | ||
[ | ||
"\"", | ||
"\"" | ||
], | ||
[ | ||
"`", | ||
"`" | ||
], | ||
[ | ||
"<", | ||
">" | ||
] | ||
], | ||
"colorizedBracketPairs": [ | ||
[ | ||
"(", | ||
")" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"<", | ||
">" | ||
] | ||
], | ||
"autoCloseBefore": ";:.,=}])>` \n\t", | ||
"folding": { | ||
"markers": { | ||
"start": "^\\s*//\\s*#?region\\b", | ||
"end": "^\\s*//\\s*#?endregion\\b" | ||
} | ||
}, | ||
"wordPattern": { | ||
"pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", | ||
}, | ||
"indentationRules": { | ||
"decreaseIndentPattern": { | ||
"pattern": "^\\s*[\\}\\]\\)].*$" | ||
}, | ||
"increaseIndentPattern": { | ||
"pattern": "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" | ||
}, | ||
// e.g. * ...| or */| or *-----*/| | ||
"unIndentedLinePattern": { | ||
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" | ||
}, | ||
"indentNextLinePattern": { | ||
"pattern": "^((.*=>\\s*)|((.*[^\\w]+|\\s*)(if|while|for)\\s*\\(.*\\)\\s*))$" | ||
} | ||
}, | ||
"onEnterRules": [ | ||
{ | ||
// e.g. /** | */ | ||
"beforeText": { | ||
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" | ||
}, | ||
"afterText": { | ||
"pattern": "^\\s*\\*/$" | ||
}, | ||
"action": { | ||
"indent": "indentOutdent", | ||
"appendText": " * " | ||
} | ||
}, | ||
{ | ||
// e.g. /** ...| | ||
"beforeText": { | ||
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" | ||
}, | ||
"action": { | ||
"indent": "none", | ||
"appendText": " * " | ||
} | ||
}, | ||
{ | ||
// e.g. * ...| | ||
"beforeText": { | ||
"pattern": "^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" | ||
}, | ||
"previousLineText": { | ||
"pattern": "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" | ||
}, | ||
"action": { | ||
"indent": "none", | ||
"appendText": "* " | ||
} | ||
}, | ||
{ | ||
// e.g. */| | ||
"beforeText": { | ||
"pattern": "^(\\t|[ ])*[ ]\\*/\\s*$" | ||
}, | ||
"action": { | ||
"indent": "none", | ||
"removeText": 1 | ||
}, | ||
}, | ||
{ | ||
// e.g. *-----*/| | ||
"beforeText": { | ||
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" | ||
}, | ||
"action": { | ||
"indent": "none", | ||
"removeText": 1 | ||
}, | ||
}, | ||
{ | ||
"beforeText": { | ||
"pattern": "^\\s*(\\bcase\\s.+:|\\bdefault:)$" | ||
}, | ||
"afterText": { | ||
"pattern": "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" | ||
}, | ||
"action": { | ||
"indent": "indent" | ||
} | ||
}, | ||
{ | ||
// Decrease indentation after single line if/else if/else, for, or while | ||
"previousLineText": "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", | ||
// But make sure line doesn't have braces or is not another if statement | ||
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))", | ||
"action": { | ||
"indent": "outdent" | ||
} | ||
}, | ||
// Indent when pressing enter from inside () | ||
{ | ||
"beforeText": "^.*\\([^\\)]*$", | ||
"afterText": "^\\s*\\).*$", | ||
"action": { | ||
"indent": "indentOutdent", | ||
"appendText": "\t", | ||
} | ||
}, | ||
// Indent when pressing enter from inside {} | ||
{ | ||
"beforeText": "^.*\\{[^\\}]*$", | ||
"afterText": "^\\s*\\}.*$", | ||
"action": { | ||
"indent": "indentOutdent", | ||
"appendText": "\t", | ||
} | ||
}, | ||
// Indent when pressing enter from inside [] | ||
{ | ||
"beforeText": "^.*\\[[^\\]]*$", | ||
"afterText": "^\\s*\\].*$", | ||
"action": { | ||
"indent": "indentOutdent", | ||
"appendText": "\t", | ||
} | ||
}, | ||
] | ||
} |