-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HTML] Add support for mime type completions (#4061)
This commit... 1. scopes `type="..."` attributes with unique `meta.attribute-with-value.type` 2. adds basic completions for known mime types. This change is probably of lower importance for basic HTML, but this change may help improving DX for template languages, which support more mime types like TypeScript, LiveScript, Babel, CoffeScript, ... .
- Loading branch information
Showing
9 changed files
with
145 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"scope": "text.html.asp meta.tag.script meta.attribute-with-value.lang", | ||
"completions": [ | ||
{ | ||
"trigger": "js", | ||
"kind": ["type", "t", "Language Type"], | ||
"details": "JavaScript" | ||
}, | ||
{ | ||
"trigger": "jscript", | ||
"kind": ["type", "t", "Language Type"], | ||
"details": "JavaScript" | ||
}, | ||
{ | ||
"trigger": "vb", | ||
"kind": ["type", "t", "Language Type"], | ||
"details": "VisualBasicScript" | ||
}, | ||
{ | ||
"trigger": "vbscript", | ||
"kind": ["type", "t", "Language Type"], | ||
"details": "VisualBasicScript" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"scope": "text.html.asp meta.tag.script meta.attribute-with-value.type", | ||
"completions": [ | ||
{ | ||
"trigger": "application/vbscript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "Visual Basic Script" | ||
}, | ||
{ | ||
"trigger": "text/vbscript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "Visual Basic Script" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"scope": "text.html meta.tag.script meta.attribute-with-value.type", | ||
"completions": [ | ||
{ | ||
"trigger": "application/ecmascript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "ECMA Script" | ||
}, | ||
{ | ||
"trigger": "application/javascript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "JavaScript" | ||
}, | ||
{ | ||
"trigger": "application/json", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "JSON" | ||
}, | ||
{ | ||
"trigger": "text/ecmascript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "ECMA Script" | ||
}, | ||
{ | ||
"trigger": "text/html", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "HTML" | ||
}, | ||
{ | ||
"trigger": "text/javascript", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "JavaScript" | ||
}, | ||
{ | ||
"trigger": "text/json", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "JSON" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"scope": "text.html meta.tag.style meta.attribute-with-value.type", | ||
"completions": [ | ||
{ | ||
"trigger": "text/css", | ||
"kind": ["type", "t", "Mime Type"], | ||
"details": "Cascading Stylesheet" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters