@@ -190,7 +190,7 @@ repository:
190190 - name : keyword.control.loop.ts
191191 match : (?<!\.|\$)\b(break|continue|do|goto|while)\b(?!\$)
192192 - name : keyword.control.flow.ts
193- match : (?<!\.|\$)\b(await| return)\b(?!\$)
193+ match : (?<!\.|\$)\b(return)\b(?!\$)
194194 - match : (?<!\.|\$)\b(yield)\b(?!\$)(?:\s*(\*))?
195195 captures :
196196 ' 1 ' : { name: keyword.control.flow.ts }
@@ -1333,11 +1333,10 @@ repository:
13331333 patterns :
13341334 - include : ' #expression'
13351335 - name : meta.object.member.ts
1336- begin : ([_$[:alpha:]][_$[:alnum:]]*)\s*(:)
1336+ begin : (?: [_$[:alpha:]][_$[:alnum:]]*)\s*(:)
13371337 beginCaptures :
13381338 ' 0 ' : { name: meta.object-literal.key.ts }
1339- ' 1 ' : { name: entity.name.type.attribute-name.ts }
1340- ' 2 ' : { name: punctuation.separator.key-value.ts }
1339+ ' 1 ' : { name: punctuation.separator.key-value.ts }
13411340 end : (?=,|\})
13421341 patterns :
13431342 - include : ' #expression'
@@ -1349,6 +1348,8 @@ repository:
13491348
13501349 expression-operator :
13511350 patterns :
1351+ - name : keyword.control.flow.ts
1352+ match : (?<!\.|\$)\b(await)\b(?!\$)
13521353 - name : keyword.operator.delete.ts
13531354 match : (?<!\.|\$)\bdelete\b(?!\$)
13541355 - name : keyword.operator.in.ts
@@ -1596,42 +1597,6 @@ repository:
15961597 patterns :
15971598 - include : ' #expression'
15981599
1599- comment :
1600- patterns :
1601- - name : comment.block.documentation.ts
1602- begin : /\*\*(?!/)
1603- end : \*/
1604- captures :
1605- ' 0 ' : {name: punctuation.definition.comment.ts}
1606- patterns :
1607- - include : ' #docblock'
1608- - name : comment.block.ts
1609- begin : /\*
1610- end : \*/
1611- captures :
1612- ' 0 ' : {name: punctuation.definition.comment.ts}
1613- - begin : (^[ \t]+)?(?=//)
1614- beginCaptures :
1615- ' 1 ' : {name: punctuation.whitespace.comment.leading.ts}
1616- end : (?=$)
1617- patterns :
1618- - name : comment.line.double-slash.ts
1619- begin : //
1620- beginCaptures :
1621- ' 0 ' : {name: punctuation.definition.comment.ts}
1622- end : (?=$)
1623-
1624- docblock :
1625- patterns :
1626- - name : storage.type.class.jsdoc
1627- match : (?<!\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file|fileoverview|final|fires|for|function|global|host|ignore|implements|inherit[Dd]oc|inner|instance|interface|kind|lends|license|listens|main|member|memberof|method|mixex|mixins?|module|name|namespace|nocollapse|nosideeffects|override|overview|package|param|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce)\b
1628- - match : ({\b(?:[_$[:alpha:]][_$[:alnum:]]*)\b})\s+\b([_$[:alpha:]][_$[:alnum:]]*)\b\s*((?:(?!\*\/).)*)
1629- captures :
1630- ' 0 ' : {name: other.meta.jsdoc}
1631- ' 1 ' : {name: entity.name.type.instance.jsdoc}
1632- ' 2 ' : {name: variable.other.jsdoc}
1633- ' 3 ' : {name: other.description.jsdoc}
1634-
16351600 literal :
16361601 name : literal.ts
16371602 patterns :
@@ -1727,4 +1692,179 @@ repository:
17271692 name : storage.type.property.ts
17281693 match : (?<!\.|\$)\b(get|set)\b(?!\$)
17291694
1695+ comment :
1696+ patterns :
1697+ - name : comment.block.documentation.ts
1698+ begin : /\*\*(?!/)
1699+ end : \*/
1700+ captures :
1701+ ' 0 ' : {name: punctuation.definition.comment.ts}
1702+ patterns :
1703+ - include : ' #docblock'
1704+ - name : comment.block.ts
1705+ begin : /\*
1706+ end : \*/
1707+ captures :
1708+ ' 0 ' : {name: punctuation.definition.comment.ts}
1709+ - begin : (^[ \t]+)?(?=//)
1710+ beginCaptures :
1711+ ' 1 ' : {name: punctuation.whitespace.comment.leading.ts}
1712+ end : (?=$)
1713+ patterns :
1714+ - name : comment.line.double-slash.ts
1715+ begin : //
1716+ beginCaptures :
1717+ ' 0 ' : {name: punctuation.definition.comment.ts}
1718+ end : (?=$)
1719+
1720+ docblock :
1721+ patterns :
1722+ - name : storage.type.class.jsdoc
1723+ match : (?<!\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file|fileoverview|final|fires|for|function|global|host|ignore|implements|inherit[Dd]oc|inner|instance|interface|kind|lends|license|listens|main|member|memberof|method|mixex|mixins?|module|name|namespace|nocollapse|nosideeffects|override|overview|package|param|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce)\b
1724+ - match : |-
1725+ (?x)
1726+ (?:(?<=@param)|(?<=@type))
1727+ \s+
1728+ ({(?:
1729+ \* | # {*} any type
1730+ \? | # {?} unknown type
1731+
1732+ (?: # Check for a prefix
1733+ \? | # {?string} nullable type
1734+ ! | # {!string} non-nullable type
1735+ \.{3} # {...string} variable number of parameters
1736+ )?
1737+
1738+ (?:
1739+ \( # Opening bracket of multiple types with parenthesis {(string|number)}
1740+ [a-zA-Z_$]+
1741+ (?:
1742+ (?:
1743+ [\w$]*
1744+ (?:\[\])? # {(string[]|number)} type application, an array of strings or a number
1745+ ) |
1746+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1747+ )
1748+ (?:
1749+ [\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback
1750+ [a-zA-Z_$]+
1751+ (?:
1752+ (?:
1753+ [\w$]*
1754+ (?:\[\])? # {(string|number[])} type application, a string or an array of numbers
1755+ ) |
1756+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1757+ )
1758+ )*
1759+ \) |
1760+ [a-zA-Z_$]+
1761+ (?:
1762+ (?:
1763+ [\w$]*
1764+ (?:\[\])? # {string[]|number} type application, an array of strings or a number
1765+ ) |
1766+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1767+ )
1768+ (?:
1769+ [\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback
1770+ [a-zA-Z_$]+
1771+ (?:
1772+ [\w$]* |
1773+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1774+ )
1775+ )*
1776+ )
1777+ # Check for suffix
1778+ (?:\[\])? # {string[]} type application, an array of strings
1779+ =? # {string=} optional parameter
1780+ )})
1781+ \s+
1782+ (
1783+ \[ # [foo] optional parameter
1784+ \s*
1785+ (?:
1786+ [a-zA-Z_$][\w$]*
1787+ (?:
1788+ (?:\[\])? # Foo[].bar properties within an array
1789+ \. # Foo.Bar namespaced parameter
1790+ [a-zA-Z_$][\w$]*
1791+ )*
1792+ (?:
1793+ \s*
1794+ = # [foo=bar] Default parameter value
1795+ \s*
1796+ [\w$\s]*
1797+ )?
1798+ )
1799+ \s*
1800+ \] |
1801+ (?:
1802+ [a-zA-Z_$][\w$]*
1803+ (?:
1804+ (?:\[\])? # Foo[].bar properties within an array
1805+ \. # Foo.Bar namespaced parameter
1806+ [a-zA-Z_$][\w$]*
1807+ )*
1808+ )?
1809+ )
1810+ \s+
1811+ ((?:(?!\*\/).)*) # The type description
1812+ captures:
1813+ '0': { name: other.meta.jsdoc }
1814+ '1': { name: entity.name.type.instance.jsdoc }
1815+ '2': { name: variable.other.jsdoc }
1816+ '3': { name: other.description.jsdoc }
1817+ - match : |-
1818+ (?x)
1819+ ({(?:
1820+ \* | # {*} any type
1821+ \? | # {?} unknown type
1822+
1823+ (?: # Check for a prefix
1824+ \? | # {?string} nullable type
1825+ ! | # {!string} non-nullable type
1826+ \.{3} # {...string} variable number of parameters
1827+ )?
1828+
1829+ (?:
1830+ \( # Opening bracket of multiple types with parenthesis {(string|number)}
1831+ [a-zA-Z_$]+
1832+ (?:
1833+ [\w$]* |
1834+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1835+ )
1836+ (?:
1837+ [\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback
1838+ [a-zA-Z_$]+
1839+ (?:
1840+ [\w$]* |
1841+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1842+ )
1843+ )*
1844+ \) |
1845+ [a-zA-Z_$]+
1846+ (?:
1847+ [\w$]* |
1848+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1849+ )
1850+ (?:
1851+ [\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback
1852+ [a-zA-Z_$]+
1853+ (?:
1854+ [\w$]* |
1855+ <[\w$]+(?:,\s+[\w$]+)*> # {Array<string>} or {Object<string, number>} type application
1856+ )
1857+ )*
1858+ )
1859+ # Check for suffix
1860+ (?:\[\])? # {string[]} type application, an array of strings
1861+ =? # {string=} optional parameter
1862+ )})
1863+ \s+
1864+ ((?:(?!\*\/).)*) # The type description
1865+ captures:
1866+ '0': { name: other.meta.jsdoc }
1867+ '1': { name: entity.name.type.instance.jsdoc }
1868+ '2': { name: other.description.jsdoc }
1869+
17301870 ...
0 commit comments