Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit c0a9df7

Browse files
authored
Update decreaseIndentPattern to match Atom
Atom's [decrease regexp](https://github.com/atom/language-ruby/blob/d88a4cfb32876295ec5b090a2994957e62130f4a/settings/language-ruby.cson) handles cases like this: ``` @Date = Date.today() @name = "Test Name" @DaTa = { id: 8, foo: Foo.new( id: 1, phone_number: "412-555-7640" ), bar: Bar.new( id: 1, name: "Valentine", vin: "DF5S6HFG365HGDCVG", status: :AVAILABLE ), start_time: start_time.to_s, end_time: end_time.to_s, cost: 23.45, rating: 3, } ```
1 parent db79753 commit c0a9df7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/languageConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const languageConfiguration = {
22
indentationRules: {
33
increaseIndentPattern: /^(\s*(module|class|((private|protected)\s+)?def|unless|if|else|elsif|case|when|begin|rescue|ensure|for|while|until|(?=.*?\b(do|begin|case|if|unless)\b)("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\s(do|begin|case)|[-+=&|*/~%^<>~]\s*(if|unless)))\b(?![^;]*;.*?\bend\b)|("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\((?![^\)]*\))|\{(?![^\}]*\})|\[(?![^\]]*\]))).*$/,
4-
decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/,
4+
decreaseIndentPattern: /^\s*([}\])](,?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/,
55
},
66
wordPattern: /(-?\d+(?:\.\d+))|([A-Za-z][^-`~@#%^&()=+[{}|;:'",<>/.*\]\s\\!?]*[!?]?)/,
77
};

0 commit comments

Comments
 (0)