|
1 | 1 | { |
2 | 2 | "comments": { |
3 | | - "blockComment": [ |
4 | | - "<!--", |
5 | | - "-->" |
6 | | - ] |
| 3 | + "blockComment": ["<!--", "-->"] |
7 | 4 | }, |
8 | 5 | "brackets": [ |
9 | | - [ |
10 | | - "<!--", |
11 | | - "-->" |
12 | | - ], |
13 | | - [ |
14 | | - "<", |
15 | | - ">" |
16 | | - ], |
17 | | - [ |
18 | | - "{", |
19 | | - "}" |
20 | | - ], |
21 | | - [ |
22 | | - "(", |
23 | | - ")" |
24 | | - ] |
| 6 | + // html |
| 7 | + ["<!--", "-->"], |
| 8 | + ["{", "}"], |
| 9 | + ["(", ")"] |
25 | 10 | ], |
26 | 11 | "autoClosingPairs": [ |
27 | 12 | // html |
28 | | - { |
29 | | - "open": "{", |
30 | | - "close": "}" |
31 | | - }, |
32 | | - { |
33 | | - "open": "[", |
34 | | - "close": "]" |
35 | | - }, |
36 | | - { |
37 | | - "open": "(", |
38 | | - "close": ")" |
39 | | - }, |
40 | | - { |
41 | | - "open": "'", |
42 | | - "close": "'" |
43 | | - }, |
44 | | - { |
45 | | - "open": "\"", |
46 | | - "close": "\"" |
47 | | - }, |
48 | | - { |
49 | | - "open": "<!--", |
50 | | - "close": "-->", |
51 | | - "notIn": [ |
52 | | - "comment", |
53 | | - "string" |
54 | | - ] |
55 | | - }, |
| 13 | + { "open": "{", "close": "}" }, |
| 14 | + { "open": "[", "close": "]" }, |
| 15 | + { "open": "(", "close": ")" }, |
| 16 | + { "open": "'", "close": "'" }, |
| 17 | + { "open": "\"", "close": "\"" }, |
| 18 | + { "open": "<!--", "close": "-->", "notIn": ["comment", "string"] }, |
56 | 19 | // javascript |
57 | | - { |
58 | | - "open": "`", |
59 | | - "close": "`", |
60 | | - "notIn": [ |
61 | | - "string", |
62 | | - "comment" |
63 | | - ] |
64 | | - }, |
65 | | - { |
66 | | - "open": "/**", |
67 | | - "close": " */", |
68 | | - "notIn": [ |
69 | | - "string" |
70 | | - ] |
71 | | - } |
| 20 | + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, |
| 21 | + { "open": "/**", "close": " */", "notIn": ["string"] } |
72 | 22 | ], |
| 23 | + // #1437 |
73 | 24 | "autoCloseBefore": ";:.,=}])><`'\" \n\t", |
74 | 25 | "surroundingPairs": [ |
75 | 26 | // html |
76 | | - { |
77 | | - "open": "'", |
78 | | - "close": "'" |
79 | | - }, |
80 | | - { |
81 | | - "open": "\"", |
82 | | - "close": "\"" |
83 | | - }, |
84 | | - { |
85 | | - "open": "{", |
86 | | - "close": "}" |
87 | | - }, |
88 | | - { |
89 | | - "open": "[", |
90 | | - "close": "]" |
91 | | - }, |
92 | | - { |
93 | | - "open": "(", |
94 | | - "close": ")" |
95 | | - }, |
96 | | - { |
97 | | - "open": "<", |
98 | | - "close": ">" |
99 | | - }, |
| 27 | + { "open": "'", "close": "'" }, |
| 28 | + { "open": "\"", "close": "\"" }, |
| 29 | + { "open": "{", "close": "}" }, |
| 30 | + { "open": "[", "close": "]" }, |
| 31 | + { "open": "(", "close": ")" }, |
| 32 | + { "open": "<", "close": ">" }, |
100 | 33 | // javascript |
101 | | - [ |
102 | | - "`", |
103 | | - "`" |
104 | | - ] |
| 34 | + ["`", "`"] |
105 | 35 | ], |
106 | 36 | "colorizedBracketPairs": [], |
107 | 37 | "folding": { |
|
114 | 44 | "onEnterRules": [ |
115 | 45 | { |
116 | 46 | "beforeText": { |
117 | | - "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", |
118 | | - "flags": "i" |
119 | | - }, |
120 | | - "afterText": { |
121 | | - "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", |
| 47 | + "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", |
122 | 48 | "flags": "i" |
123 | 49 | }, |
| 50 | + "afterText": { "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", "flags": "i" }, |
124 | 51 | "action": { |
125 | 52 | "indent": "indentOutdent" |
126 | 53 | } |
127 | 54 | }, |
128 | 55 | { |
129 | 56 | "beforeText": { |
130 | | - "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", |
| 57 | + "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", |
131 | 58 | "flags": "i" |
132 | 59 | }, |
133 | 60 | "action": { |
134 | 61 | "indent": "indent" |
135 | 62 | } |
136 | 63 | } |
137 | 64 | ], |
138 | | - // https://github.com/vuejs/language-tools/issues/1762 |
139 | 65 | "indentationRules": { |
140 | | - // "increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$", |
141 | | - // add (?!\\s*\\() to fix https://github.com/vuejs/language-tools/issues/1847#issuecomment-1246101071 |
142 | | - "increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!\\s*\\()(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$", |
| 66 | + "increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$", |
143 | 67 | "decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})" |
144 | 68 | } |
145 | 69 | } |
0 commit comments