Skip to content

Commit 3703333

Browse files
angelozerrmickaelistria
authored andcommitted
OnEnterRules support for html files
Signed-off-by: azerr <[email protected]>
1 parent adf04ab commit 3703333

File tree

3 files changed

+72
-43
lines changed

3 files changed

+72
-43
lines changed

org.eclipse.wildwebdeveloper/language-configurations/html/language-configuration.json

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* Copyright (c) 2015-2017 Angelo ZERR.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Initial code from https://github.com/Microsoft/vscode/
9+
* Initial copyright Copyright (C) Microsoft Corporation. All rights reserved.
10+
* Initial license: MIT
11+
*
12+
* Contributors:
13+
* - Microsoft Corporation: Initial code licensed under MIT license
14+
*
15+
* @see https://github.com/Microsoft/vscode/blob/master/extensions/html/language-configuration.json
16+
*/
17+
{
18+
"comments": {
19+
"blockComment": [ "<!--", "-->" ]
20+
},
21+
"brackets": [
22+
["<!--", "-->"],
23+
["<", ">"],
24+
["{", "}"],
25+
["(", ")"]
26+
],
27+
"autoClosingPairs": [
28+
{ "open": "{", "close": "}"},
29+
{ "open": "[", "close": "]"},
30+
{ "open": "(", "close": ")" },
31+
{ "open": "'", "close": "'" },
32+
{ "open": "\"", "close": "\"" },
33+
{ "open": "<!--", "close": "-->", "notIn": [ "comment", "string" ]}
34+
],
35+
"surroundingPairs": [
36+
{ "open": "'", "close": "'" },
37+
{ "open": "\"", "close": "\"" },
38+
{ "open": "{", "close": "}"},
39+
{ "open": "[", "close": "]"},
40+
{ "open": "(", "close": ")" },
41+
{ "open": "<", "close": ">" }
42+
],
43+
"colorizedBracketPairs": [
44+
],
45+
"folding": {
46+
"markers": {
47+
"start": "^\\s*<!--\\s*#region\\b.*-->",
48+
"end": "^\\s*<!--\\s*#endregion\\b.*-->"
49+
}
50+
},
51+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)",
52+
"onEnterRules": [
53+
{
54+
"beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", "flags": "i" },
55+
"afterText": { "pattern": "^<\\/([_:\\w][_:\\w\\-.\\d]*)\\s*>", "flags": "i" },
56+
"action": {
57+
"indent": "indentOutdent"
58+
}
59+
},
60+
{
61+
"beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w\\-.\\d]*)(?:(?:[^'\"/>]|\"[^\"]*\"|'[^']*')*?(?!\\/)>)[^<]*$", "flags": "i" },
62+
"action": {
63+
"indent": "indent"
64+
}
65+
}
66+
],
67+
"indentationRules": {
68+
"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>)|<!--(?!.*-->)|\\{[^}\"']*$",
69+
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})"
70+
}
71+
}

org.eclipse.wildwebdeveloper/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
point="org.eclipse.tm4e.languageconfiguration.languageConfigurations">
309309
<languageConfiguration
310310
contentTypeId="org.eclipse.wildwebdeveloper.html"
311-
path="language-configurations/html/language-configuration.json">
311+
path="language-configurations/html/language-configuration.jsonc">
312312
</languageConfiguration>
313313
</extension>
314314

0 commit comments

Comments
 (0)