Skip to content

Commit 15e412b

Browse files
author
Gregor Woiwode
committed
Applies grammar for html syntax highlighting to ts.cson and tsx.cson
This is done by running `npm run build` TypeStrong#818
1 parent 3d8ed48 commit 15e412b

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

grammars/ts.cson

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is generated by `scripts/grammar.js`
2-
# Last generated: Mon, 18 Apr 2016 17:58:05 GMT
2+
# Last generated: Fri, 13 May 2016 07:22:32 GMT
33
name: "TypeScript"
44
scopeName: "source.ts"
55
fileTypes: [
@@ -609,6 +609,22 @@ repository:
609609
expression:
610610
name: "meta.expression.ts"
611611
patterns: [
612+
{
613+
comment: "Match Angular 2 Component html templates"
614+
begin: "(?:(?<=^|\\stemplate:)|(?<=/\\*\\* @html \\*/))\\s*(`)"
615+
beginCaptures:
616+
"1":
617+
name: "name: string.template.ts"
618+
end: "`"
619+
endCaptures:
620+
"0":
621+
name: "name: string.template.ts"
622+
patterns: [
623+
{
624+
include: "text.html.basic"
625+
}
626+
]
627+
}
612628
{
613629
comment: "Match ES6 \"import from\" syntax"
614630
match: "\\b(import)\\b.*\\b(from)\\b\\s+((['\"]).*\\4)"
@@ -868,13 +884,13 @@ repository:
868884
match: "\\*|/|\\-\\-|\\-|\\+\\+|\\+|%"
869885
"relational-operator":
870886
name: "keyword.operator.comparison.ts"
871-
match: "===|==|=|!=|!==|<=|>=|<>|<|>"
887+
match: "===|!==|==|!=|<=|>=|<>|=|<|>"
872888
"assignment-operator":
873889
name: "keyword.operator.assignment.ts"
874-
match: "<<=|>>=|>>>=|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^="
890+
match: "<<=|>>>=|>>=|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^="
875891
"logic-operator":
876892
name: "keyword.operator.arithmetic.ts"
877-
match: "\\!|&|~|\\^|\\||&&|\\|\\|"
893+
match: "\\!|&&|&|~|\\^|\\|\\||\\|"
878894
"storage-keyword":
879895
name: "storage.type.ts"
880896
match: "\\b(var|let|function|const|module|namespace|void|export)\\b"

grammars/tsx.cson

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is generated by `scripts/grammar.js`
2-
# Last generated: Mon, 18 Apr 2016 17:58:05 GMT
2+
# Last generated: Fri, 13 May 2016 07:22:32 GMT
33
name: "TypeScriptReact"
44
scopeName: "source.tsx"
55
fileTypes: [
@@ -609,6 +609,22 @@ repository:
609609
expression:
610610
name: "meta.expression.tsx"
611611
patterns: [
612+
{
613+
comment: "Match Angular 2 Component html templates"
614+
begin: "(?:(?<=^|\\stemplate:)|(?<=/\\*\\* @html \\*/))\\s*(`)"
615+
beginCaptures:
616+
"1":
617+
name: "name: string.template.ts"
618+
end: "`"
619+
endCaptures:
620+
"0":
621+
name: "name: string.template.ts"
622+
patterns: [
623+
{
624+
include: "text.html.basic"
625+
}
626+
]
627+
}
612628
{
613629
comment: "Match ES6 \"import from\" syntax"
614630
match: "\\b(import)\\b.*\\b(from)\\b\\s+((['\"]).*\\4)"
@@ -853,13 +869,13 @@ repository:
853869
match: "\\*|/|\\-\\-|\\-|\\+\\+|\\+|%"
854870
"relational-operator":
855871
name: "keyword.operator.comparison.tsx"
856-
match: "===|==|=|!=|!==|<=|>=|<>|<|>"
872+
match: "===|!==|==|!=|<=|>=|<>|=|<|>"
857873
"assignment-operator":
858874
name: "keyword.operator.assignment.tsx"
859-
match: "<<=|>>=|>>>=|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^="
875+
match: "<<=|>>>=|>>=|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^="
860876
"logic-operator":
861877
name: "keyword.operator.arithmetic.tsx"
862-
match: "\\!|&|~|\\^|\\||&&|\\|\\|"
878+
match: "\\!|&&|&|~|\\^|\\|\\||\\|"
863879
"storage-keyword":
864880
name: "storage.type.tsx"
865881
match: "\\b(var|let|function|const|module|namespace|void|export)\\b"

0 commit comments

Comments
 (0)