Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/typescript.xml
Show All 32 Lines | 14 | <!-- | |||
---|---|---|---|---|---|
33 | included in the JavaScript highlighter. | 33 | included in the JavaScript highlighter. | ||
34 | Ex: | 34 | Ex: | ||
35 | /// <reference no-default-lib="true"/> | 35 | /// <reference no-default-lib="true"/> | ||
36 | 36 | | |||
37 | Tags: reference, amd-dependency, amd-module | 37 | Tags: reference, amd-dependency, amd-module | ||
38 | Attributes: path, types, no-default-lib, name | 38 | Attributes: path, types, no-default-lib, name | ||
39 | 39 | | |||
40 | Change log: | 40 | Change log: | ||
41 | * v8 [2019-12-12]: Add "bigint" primitive type. | ||||
41 | * v7 [2019-11-20]: Move keywords of built-in object to "javascript.xml" and adapt. | 42 | * v7 [2019-11-20]: Move keywords of built-in object to "javascript.xml" and adapt. | ||
42 | * v6 [2019-10-01]: Add "asserts" keyword in type predicates. | 43 | * v6 [2019-10-01]: Add "asserts" keyword in type predicates. | ||
43 | Highlight types after the "as" keyword. | 44 | Highlight types after the "as" keyword. | ||
44 | * v5 [2019-08-30]: Avoid that ?: be used as conditional expressions. | 45 | * v5 [2019-08-30]: Avoid that ?: be used as conditional expressions. | ||
45 | * v4 [2019-07-16]: Fixed highlighting of keywords before ":" in conditional expressions. | 46 | * v4 [2019-07-16]: Fixed highlighting of keywords before ":" in conditional expressions. | ||
46 | * v3 [2019-02-18]: Add support to bigint and the "is" keyword. | 47 | * v3 [2019-02-18]: Add support to bigint and the "is" keyword. | ||
47 | Fixes keyword delimiters. Don't highlight regex | 48 | Fixes keyword delimiters. Don't highlight regex | ||
48 | after "]" and ")". Multiple fixes and improvements. | 49 | after "]" and ")". Multiple fixes and improvements. | ||
49 | * v2 [2018-12-29]: Don't highlight built-in classes as functions, | 50 | * v2 [2018-12-29]: Don't highlight built-in classes as functions, | ||
50 | fix float-points, improve types detection and other fixes. | 51 | fix float-points, improve types detection and other fixes. | ||
51 | * v1 [2018-11-18]: Initial version | 52 | * v1 [2018-11-18]: Initial version | ||
52 | --> | 53 | --> | ||
53 | 54 | | |||
54 | <language name="TypeScript" | 55 | <language name="TypeScript" | ||
55 | version="7" | 56 | version="8" | ||
56 | kateversion="5.53" | 57 | kateversion="5.53" | ||
57 | section="Scripts" | 58 | section="Scripts" | ||
58 | extensions="*.ts" | 59 | extensions="*.ts" | ||
59 | priority="9" | 60 | priority="9" | ||
60 | mimetype="text/typescript;application/typescript;text/x-typescript;application/x-typescript" | 61 | mimetype="text/typescript;application/typescript;text/x-typescript;application/x-typescript" | ||
61 | indenter="cstyle" | 62 | indenter="cstyle" | ||
62 | author="Nibaldo González (nibgonz@gmail.com)" | 63 | author="Nibaldo González (nibgonz@gmail.com)" | ||
63 | license="MIT"> | 64 | license="MIT"> | ||
Show All 38 Lines | 101 | <list name="control_export_types"> | |||
102 | <item>namespace</item> | 103 | <item>namespace</item> | ||
103 | <item>module</item> | 104 | <item>module</item> | ||
104 | </list> | 105 | </list> | ||
105 | <list name="types_operator_expression"> | 106 | <list name="types_operator_expression"> | ||
106 | <item>keyof</item> | 107 | <item>keyof</item> | ||
107 | <item>infer</item> | 108 | <item>infer</item> | ||
108 | <!-- Also: is, typeof --> | 109 | <!-- Also: is, typeof --> | ||
109 | </list> | 110 | </list> | ||
110 | <!-- Datatypes --> | 111 | <!-- Datatypes & Primitive Types --> | ||
111 | <list name="types"> | 112 | <list name="types"> | ||
112 | <item>string</item> | 113 | <item>string</item> | ||
113 | <item>number</item> | 114 | <item>number</item> | ||
115 | <item>bigint</item> | ||||
114 | <item>boolean</item> | 116 | <item>boolean</item> | ||
115 | <item>symbol</item> | 117 | <item>symbol</item> | ||
116 | <item>any</item> | 118 | <item>any</item> | ||
117 | <item>void</item> | 119 | <item>void</item> | ||
118 | <item>never</item> | 120 | <item>never</item> | ||
119 | <item>unknown</item> | 121 | <item>unknown</item> | ||
122 | | ||||
120 | <item>undefined</item> | 123 | <item>undefined</item> | ||
121 | <item>null</item> | 124 | <item>null</item> | ||
122 | <item>object</item> | 125 | <item>object</item> | ||
123 | </list> | 126 | </list> | ||
124 | 127 | | |||
125 | <!-- Built-in Classes, Functions & Constants --> | 128 | <!-- Built-in Classes, Functions & Constants --> | ||
126 | 129 | | |||
127 | <list name="class_builtin"> | 130 | <list name="class_builtin"> | ||
▲ Show 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 420 | <context name="DefaultTypes" attribute="Normal Text" lineEndContext="#stay"> | |||
419 | <keyword context="NoRegExpSameLine" attribute="Types" String="types" /> | 422 | <keyword context="NoRegExpSameLine" attribute="Types" String="types" /> | ||
420 | <!-- Assertions --> | 423 | <!-- Assertions --> | ||
421 | <WordDetect context="NoRegExpSameLine" attribute="Keyword" String="asserts" /> | 424 | <WordDetect context="NoRegExpSameLine" attribute="Keyword" String="asserts" /> | ||
422 | <!-- Type Guards --> | 425 | <!-- Type Guards --> | ||
423 | <WordDetect context="NoRegExpSameLine" attribute="Keyword" String="is" /> | 426 | <WordDetect context="NoRegExpSameLine" attribute="Keyword" String="is" /> | ||
424 | 427 | | |||
425 | <!-- FIXME: For a strange reason, the keywords before "}" are not highlighted. | 428 | <!-- FIXME: For a strange reason, the keywords before "}" are not highlighted. | ||
426 | This rule fixes it provisionally. --> | 429 | This rule fixes it provisionally. --> | ||
427 | <RegExpr context="#stay" attribute="Types" String="\b(?:string|number|boolean|symbol|any|void|never|unknown|undefined|null|object)(?=\})" /> | 430 | <RegExpr context="#stay" attribute="Types" String="\b(?:string|number|bigint|boolean|symbol|any|void|never|unknown|undefined|null|object)(?=\})" /> | ||
428 | 431 | | |||
429 | <!-- Don't start this context again --> | 432 | <!-- Don't start this context again --> | ||
430 | <AnyChar context="#stay" attribute="Symbol" String="?:" /> | 433 | <AnyChar context="#stay" attribute="Symbol" String="?:" /> | ||
431 | <WordDetect context="#stay" attribute="Module" String="as" /> | 434 | <WordDetect context="#stay" attribute="Module" String="as" /> | ||
432 | </context> | 435 | </context> | ||
433 | <context name="TypesFindBrackets" attribute="Normal Text" lineEndContext="#stay"> | 436 | <context name="TypesFindBrackets" attribute="Normal Text" lineEndContext="#stay"> | ||
434 | <DetectChar context="TypesSquareBracket" attribute="Normal Text" char="[" beginRegion="List" /> | 437 | <DetectChar context="TypesSquareBracket" attribute="Normal Text" char="[" beginRegion="List" /> | ||
435 | <DetectChar context="TypesCurlyBracket" attribute="Normal Text" char="{" beginRegion="Brace" /> | 438 | <DetectChar context="TypesCurlyBracket" attribute="Normal Text" char="{" beginRegion="Brace" /> | ||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |