Skip to content

Commit 2dea76a

Browse files
committed
1 parent 76cd05d commit 2dea76a

File tree

5 files changed

+234
-241
lines changed

5 files changed

+234
-241
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,12 @@ repository:
22052205
\s+
22062206
(?:
22072207
# URL
2208+
(
2209+
(?=https?://)
2210+
(?:[^\s*]|\*[^/])+
2211+
)
2212+
|
2213+
# JSDoc namepath
22082214
(
22092215
(?!
22102216
# Avoid matching bare URIs (also acceptable as links)
@@ -2215,12 +2221,6 @@ repository:
22152221
{@(?:link|linkcode|linkplain|tutorial)\b
22162222
)
22172223
# Matched namepath
2218-
(?:[^\s*]|\*[^/])+
2219-
)
2220-
|
2221-
# JSDoc namepath
2222-
(
2223-
(?!https?://)
22242224
(?:[^@\s*/]|\*[^/])+
22252225
)
22262226
)
@@ -2235,21 +2235,24 @@ repository:
22352235
((@)template)
22362236
\s+
22372237
# One or more valid identifiers
2238-
(?:
2239-
([A-Za-z_$] # First character: non-numeric word character
2240-
[\w$.\[\]]*) # Rest of identifier
2238+
(
2239+
[A-Za-z_$] # First character: non-numeric word character
2240+
[\w$.\[\]]* # Rest of identifier
22412241
(?: # Possible list of additional identifiers
2242-
\s* (,) \s*
2243-
([A-Za-z_$]
2244-
[\w$.\[\]]*)
2242+
\s* , \s*
2243+
[A-Za-z_$]
2244+
[\w$.\[\]]*
22452245
)*
22462246
)
22472247
captures:
22482248
'1': { name: storage.type.class.jsdoc }
22492249
'2': { name: punctuation.definition.block.tag.jsdoc }
2250-
'3': { name: variable.other.jsdoc }
2251-
'4': { name: punctuation.delimiter.object.comma.jsdoc }
2252-
'5': { name: variable.other.jsdoc }
2250+
'3':
2251+
name: variable.other.jsdoc
2252+
# Commenting out the embedded pattern matching since sublime doesnt support this
2253+
# patterns:
2254+
# - name: punctuation.delimiter.object.comma.jsdoc
2255+
# match: ','
22532256
# Tags followed by an identifier token
22542257
# - @<tag> identifier
22552258
- match: |-
@@ -2307,11 +2310,11 @@ repository:
23072310
\s*
23082311
(
23092312
# The inner regexes are to stop the match early at */ and to not stop at escaped quotes
2310-
(?:
2311-
"(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted
2312-
'(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted
2313-
\[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal
2314-
(?:(?:\*(?!/))|[^*])*? # Everything else
2313+
(?>
2314+
"(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted
2315+
'(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted
2316+
\[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal
2317+
(?:(?:\*(?!/))|\s(?!\s*\])|\[.*?(?:\]|(?=\*/))|[^*\s\[\]])* # Everything else
23152318
)*
23162319
)
23172320
)?
@@ -2327,25 +2330,17 @@ repository:
23272330
# - include: source.js
23282331
'4': { name: punctuation.definition.optional-value.end.bracket.square.jsdoc }
23292332
'5': { name: invalid.illegal.syntax.jsdoc }
2330-
2331-
begin: '\['
2332-
end: '\]|(?=\*/)'
2333-
patterns:
2334-
- match: (=)((?:[^\]*]|\*[^/])*)
2335-
captures:
2336-
'1': { name: keyword.operator.assignment.jsdoc }
2337-
'2':
2338-
name: source.embedded.ts
2339-
# Commenting out the embedded pattern matching since sublime doesnt support this
2340-
# patterns:
2341-
# - include: '#inline-tags'
2342-
# - include: source.ts
2343-
- include: '#brackets'
2344-
- include: '#quotes'
23452333
# Tags followed by a type expression
23462334
# - @<tag> {type}
2347-
- begin: >-
2348-
((@)(?:define|enum|exception|implements|modifies|namespace|private|protected|returns?|suppress|throws|type))\s+(?={)
2335+
- begin: |-
2336+
(?x)
2337+
(
2338+
(@)
2339+
(?:define|enum|exception|export|extends|lends|implements|modifies
2340+
|namespace|private|protected|returns?|suppress|this|throws|type
2341+
|yields?)
2342+
)
2343+
\s+(?={)
23492344
beginCaptures:
23502345
'1': { name: storage.type.class.jsdoc }
23512346
'2': { name: punctuation.definition.block.tag.jsdoc }
@@ -2407,12 +2402,13 @@ repository:
24072402
|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright
24082403
|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception
24092404
|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func
2410-
|function|global|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface
2411-
|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module
2412-
|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|preserve
2413-
|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static
2414-
|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted
2415-
|uses|var|variation|version|virtual|writeOnce)
2405+
|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc
2406+
|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method
2407+
|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects
2408+
|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected
2409+
|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary
2410+
|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation
2411+
|version|virtual|writeOnce|yields?)
24162412
\b
24172413
captures:
24182414
'1': { name: punctuation.definition.block.tag.jsdoc }
@@ -2458,18 +2454,6 @@ repository:
24582454
'1': { name: variable.other.description.jsdoc }
24592455
'2': { name: punctuation.separator.pipe.jsdoc }
24602456

2461-
quotes:
2462-
# Balanced quotes
2463-
patterns:
2464-
- begin: ''''
2465-
end: '''|(?=\*/)'
2466-
patterns:
2467-
- include: '#quotes'
2468-
- begin: '"'
2469-
end: '"|(?=\*/)'
2470-
patterns:
2471-
- include: '#quotes'
2472-
24732457
jsdoctype:
24742458
# {type}
24752459
patterns:

TypeScript.tmLanguage

Lines changed: 26 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -6058,6 +6058,12 @@
60586058
\s+
60596059
(?:
60606060
# URL
6061+
(
6062+
(?=https?://)
6063+
(?:[^\s*]|\*[^/])+
6064+
)
6065+
|
6066+
# JSDoc namepath
60616067
(
60626068
(?!
60636069
# Avoid matching bare URIs (also acceptable as links)
@@ -6068,12 +6074,6 @@
60686074
{@(?:link|linkcode|linkplain|tutorial)\b
60696075
)
60706076
# Matched namepath
6071-
(?:[^\s*]|\*[^/])+
6072-
)
6073-
|
6074-
# JSDoc namepath
6075-
(
6076-
(?!https?://)
60776077
(?:[^@\s*/]|\*[^/])+
60786078
)
60796079
)</string>
@@ -6107,13 +6107,13 @@
61076107
((@)template)
61086108
\s+
61096109
# One or more valid identifiers
6110-
(?:
6111-
([A-Za-z_$] # First character: non-numeric word character
6112-
[\w$.\[\]]*) # Rest of identifier
6110+
(
6111+
[A-Za-z_$] # First character: non-numeric word character
6112+
[\w$.\[\]]* # Rest of identifier
61136113
(?: # Possible list of additional identifiers
6114-
\s* (,) \s*
6115-
([A-Za-z_$]
6116-
[\w$.\[\]]*)
6114+
\s* , \s*
6115+
[A-Za-z_$]
6116+
[\w$.\[\]]*
61176117
)*
61186118
)</string>
61196119
<key>captures</key>
@@ -6133,16 +6133,6 @@
61336133
<key>name</key>
61346134
<string>variable.other.jsdoc</string>
61356135
</dict>
6136-
<key>4</key>
6137-
<dict>
6138-
<key>name</key>
6139-
<string>punctuation.delimiter.object.comma.jsdoc</string>
6140-
</dict>
6141-
<key>5</key>
6142-
<dict>
6143-
<key>name</key>
6144-
<string>variable.other.jsdoc</string>
6145-
</dict>
61466136
</dict>
61476137
</dict>
61486138
<dict>
@@ -6256,11 +6246,11 @@
62566246
\s*
62576247
(
62586248
# The inner regexes are to stop the match early at */ and to not stop at escaped quotes
6259-
(?:
6260-
"(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted
6261-
'(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted
6262-
\[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal
6263-
(?:(?:\*(?!/))|[^*])*? # Everything else
6249+
(?&gt;
6250+
"(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted
6251+
'(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted
6252+
\[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal
6253+
(?:(?:\*(?!/))|\s(?!\s*\])|\[.*?(?:\]|(?=\*/))|[^*\s\[\]])* # Everything else
62646254
)*
62656255
)
62666256
)?
@@ -6293,44 +6283,19 @@
62936283
<string>invalid.illegal.syntax.jsdoc</string>
62946284
</dict>
62956285
</dict>
6296-
<key>begin</key>
6297-
<string>\[</string>
6298-
<key>end</key>
6299-
<string>\]|(?=\*/)</string>
6300-
<key>patterns</key>
6301-
<array>
6302-
<dict>
6303-
<key>match</key>
6304-
<string>(=)((?:[^\]*]|\*[^/])*)</string>
6305-
<key>captures</key>
6306-
<dict>
6307-
<key>1</key>
6308-
<dict>
6309-
<key>name</key>
6310-
<string>keyword.operator.assignment.jsdoc</string>
6311-
</dict>
6312-
<key>2</key>
6313-
<dict>
6314-
<key>name</key>
6315-
<string>source.embedded.ts</string>
6316-
</dict>
6317-
</dict>
6318-
</dict>
6319-
<dict>
6320-
<key>include</key>
6321-
<string>#brackets</string>
6322-
</dict>
6323-
<dict>
6324-
<key>include</key>
6325-
<string>#quotes</string>
6326-
</dict>
6327-
</array>
63286286
</dict>
63296287
</array>
63306288
</dict>
63316289
<dict>
63326290
<key>begin</key>
6333-
<string>((@)(?:define|enum|exception|implements|modifies|namespace|private|protected|returns?|suppress|throws|type))\s+(?={)</string>
6291+
<string>(?x)
6292+
(
6293+
(@)
6294+
(?:define|enum|exception|export|extends|lends|implements|modifies
6295+
|namespace|private|protected|returns?|suppress|this|throws|type
6296+
|yields?)
6297+
)
6298+
\s+(?={)</string>
63346299
<key>beginCaptures</key>
63356300
<dict>
63366301
<key>1</key>
@@ -6458,7 +6423,7 @@
64586423
<key>name</key>
64596424
<string>storage.type.class.jsdoc</string>
64606425
<key>match</key>
6461-
<string>(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|global|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface |internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module |name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|preserve |private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static |struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted |uses|var|variation|version|virtual|writeOnce) \b</string>
6426+
<string>(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \b</string>
64626427
<key>captures</key>
64636428
<dict>
64646429
<key>1</key>
@@ -6602,38 +6567,6 @@
66026567
</dict>
66036568
</array>
66046569
</dict>
6605-
<key>quotes</key>
6606-
<dict>
6607-
<key>patterns</key>
6608-
<array>
6609-
<dict>
6610-
<key>begin</key>
6611-
<string>'</string>
6612-
<key>end</key>
6613-
<string>'|(?=\*/)</string>
6614-
<key>patterns</key>
6615-
<array>
6616-
<dict>
6617-
<key>include</key>
6618-
<string>#quotes</string>
6619-
</dict>
6620-
</array>
6621-
</dict>
6622-
<dict>
6623-
<key>begin</key>
6624-
<string>"</string>
6625-
<key>end</key>
6626-
<string>"|(?=\*/)</string>
6627-
<key>patterns</key>
6628-
<array>
6629-
<dict>
6630-
<key>include</key>
6631-
<string>#quotes</string>
6632-
</dict>
6633-
</array>
6634-
</dict>
6635-
</array>
6636-
</dict>
66376570
<key>jsdoctype</key>
66386571
<dict>
66396572
<key>patterns</key>

0 commit comments

Comments
 (0)