mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 21:39:43 +00:00
Fixes #25437
This commit is contained in:
parent
1bd2b99b9f
commit
8c82a6c615
|
@ -254,7 +254,7 @@ class LanguageProvider {
|
|||
// ^(.*\*/)?\s*\}.*$
|
||||
decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/,
|
||||
// ^.*\{[^}"']*$
|
||||
increaseIndentPattern: /^.*\{[^}"']*$/
|
||||
increaseIndentPattern: /^.*\{[^}"'`]*$/
|
||||
},
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
onEnterRules: [
|
||||
|
|
|
@ -2318,7 +2318,7 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|||
suite('Editor Controller - Indentation Rules', () => {
|
||||
let mode = new IndentRulesMode({
|
||||
decreaseIndentPattern: /^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
increaseIndentPattern: /(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
increaseIndentPattern: /(\{[^}"'`]*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/,
|
||||
unIndentedLinePattern: /^(?!.*([;{}]|\S:)\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!.*(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$))/
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ suite('OnEnter', () => {
|
|||
var support = new OnEnterSupport({
|
||||
indentationRules: {
|
||||
decreaseIndentPattern: /^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
increaseIndentPattern: /(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
increaseIndentPattern: /(\{[^}"'`]*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/,
|
||||
indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/,
|
||||
unIndentedLinePattern: /^(?!.*([;{}]|\S:)\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!.*(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$))/
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ suite('OnEnter', () => {
|
|||
testIndentAction('', 'if (true)', '', IndentAction.Indent);
|
||||
testIndentAction('', ' ', '}', IndentAction.Outdent);
|
||||
testIndentAction('if(true)', '\treturn false', '', IndentAction.Outdent);
|
||||
testIndentAction('', 'var foo = `{`;', '', IndentAction.None);
|
||||
});
|
||||
|
||||
test('uses brackets', () => {
|
||||
|
|
Loading…
Reference in a new issue