3232 [" {" , " }" ],
3333 [" [" , " ]" ]
3434 ],
35+ // markers that can be folded
3536 "folding" : {
3637 "offSide" : true ,
3738 "markers" : {
3839 "start" : " ^[ \t ]*#[ \t ]*region\\ b|^---[ \t ]*(#.*)?$" ,
3940 "end" : " ^[ \t ]*#[ \t ]*endregion\\ b|^\\ .{3}[ \t ]*(#.*)?$"
4041 }
4142 },
42- "indentationRules" : {
43- "increaseIndentPattern" : " ^\\ s*.*(:|-) ?(&\\ w+)?(\\ {[^}\" ']*|\\ [[^\\ ]\" ']*)?$" ,
44- "decreaseIndentPattern" : " ^\\ s+[\\ ]\\ }]$"
45- }
43+ // Only the first successful rule is chosen
44+ "onEnterRules" : [
45+ {
46+ // indent 1 space after block-scalar with indentation-indicator
47+ "action" : {
48+ "appendText" : " " ,
49+ "indent" : " none" ,
50+ },
51+ "afterText" : " ^(?![ \t ]*#)" ,
52+ "beforeText" : " ([ \t ]+|^)[|>][+-]?1"
53+ },
54+ {
55+ "action" : {
56+ "appendText" : " " ,
57+ "indent" : " none" ,
58+ },
59+ "afterText" : " ^(?![ \t ]*#)" ,
60+ "beforeText" : " ([ \t ]+|^)[|>][+-]?2"
61+ },
62+ {
63+ "action" : {
64+ "appendText" : " " ,
65+ "indent" : " none" ,
66+ },
67+ "afterText" : " ^(?![ \t ]*#)" ,
68+ "beforeText" : " ([ \t ]+|^)[|>][+-]?3"
69+ },
70+ {
71+ "action" : {
72+ "appendText" : " " ,
73+ "indent" : " none" ,
74+ },
75+ "afterText" : " ^(?![ \t ]*#)" ,
76+ "beforeText" : " ([ \t ]+|^)[|>][+-]?4"
77+ },
78+ {
79+ "action" : {
80+ "appendText" : " " ,
81+ "indent" : " none" ,
82+ },
83+ "afterText" : " ^(?![ \t ]*#)" ,
84+ "beforeText" : " ([ \t ]+|^)[|>][+-]?5"
85+ },
86+ {
87+ "action" : {
88+ "appendText" : " " ,
89+ "indent" : " none" ,
90+ },
91+ "afterText" : " ^(?![ \t ]*#)" ,
92+ "beforeText" : " ([ \t ]+|^)[|>][+-]?6"
93+ },
94+ {
95+ "action" : {
96+ "appendText" : " " ,
97+ "indent" : " none" ,
98+ },
99+ "afterText" : " ^(?![ \t ]*#)" ,
100+ "beforeText" : " ([ \t ]+|^)[|>][+-]?7"
101+ },
102+ {
103+ "action" : {
104+ "appendText" : " " ,
105+ "indent" : " none" ,
106+ },
107+ "afterText" : " ^(?![ \t ]*#)" ,
108+ "beforeText" : " ([ \t ]+|^)[|>][+-]?8"
109+ },
110+ {
111+ // indent 9 spaces after block-scalar with indentation-indicator
112+ "action" : {
113+ "appendText" : " " ,
114+ "indent" : " none" ,
115+ },
116+ "afterText" : " ^(?![ \t ]*#)" ,
117+ "beforeText" : " ([ \t ]+|^)[|>][+-]?9"
118+ },
119+ {
120+ // - block-map: # with an empty value OR block-scalar. Prefixed with a block-seq
121+ "action" : {
122+ "appendText" : " " ,
123+ "indent" : " none"
124+ },
125+ "beforeText" : " (^| |\t )-[ \t ]+[^#,\\ [\\ ]{}].*:(([ \t ]+[|>][+-]?)?([ \t ]+#.*)?|[ \t ]*)$"
126+ },
127+ {
128+ // indent 2 spaces after non-root block-scalar
129+ "action" : {
130+ "appendText" : " " ,
131+ "indent" : " none" ,
132+ },
133+ "afterText" : " ^(?![ \t ]*#)" ,
134+ "beforeText" : " [-?:][ \t ]+[|>][+-]?[ \t ]*(#.*)?$"
135+ },
136+ {
137+ // block-map: cursor_must_be_before_value
138+ "action" : {
139+ "appendText" : " " ,
140+ "indent" : " none"
141+ },
142+ "beforeText" : " (?<!( |\t |^)(#|\\ ?[ \t ]).*):([ \t ]*|[ \t ]+#.*)$"
143+ },
144+ {
145+ // - #empty block-seq
146+ "action" : {
147+ "appendText" : " " ,
148+ "indent" : " none"
149+ },
150+ "beforeText" : " (^| |\t )-([ \t ]*|[ \t ]+#.*)$"
151+ },
152+ {
153+ // - block-seq
154+ "action" : {
155+ "appendText" : " - " ,
156+ "indent" : " none"
157+ },
158+ "beforeText" : " (^| |\t )-[ \t ].*$"
159+ }
160+ ]
46161}
0 commit comments