Include export declare pattern in declaration matching

Fixes #642
This commit is contained in:
Sheetal Nandi 2018-08-02 09:15:34 -07:00
Родитель 4a620294f8
Коммит 69d78f07f2
13 изменённых файлов: 298 добавлений и 127 удалений

Просмотреть файл

@ -52,6 +52,7 @@ variables:
matchingBraces: (\{([^\{\}]|(\{[^\{\}]*\}))*\})
matchingBrackets: (\[([^\[\]]|(\[[^\[\]]*\]))*\])
inlineComment: \/\*([^\*]|(\*[^\/]))*\*\/
startOfDeclaration: '{{startOfIdentifier}}(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?'
lookBehindOfPossiblyMultilineArrowWithDestructuring: (?<=[(=,])
lookBehindOfPossiblyMultilineArrow: (?<=[(=,]|=>)
lookBehindOfObjectMemberPossiblyMultilineArrow: (?<=:)
@ -144,17 +145,19 @@ repository:
declaration:
patterns:
- include: '#decorator'
- include: '#var-expr'
- include: '#function-declaration'
- include: '#class-declaration'
- include: '#interface-declaration'
- include: '#enum-declaration'
- include: '#namespace-declaration'
- include: '#type-alias-declaration'
- include: '#import-equals-declaration'
- include: '#import-declaration'
- include: '#export-declaration'
- include: '#decorator'
- include: '#var-expr'
- include: '#function-declaration'
- include: '#class-declaration'
- include: '#interface-declaration'
- include: '#enum-declaration'
- include: '#namespace-declaration'
- include: '#type-alias-declaration'
- include: '#import-equals-declaration'
- include: '#import-declaration'
- include: '#export-declaration'
- name: storage.modifier.ts
match: '{{startOfIdentifier}}(declare){{endOfIdentifier}}'
control-statement:
patterns:
@ -180,8 +183,6 @@ repository:
match: '{{startOfIdentifier}}(package){{endOfIdentifier}}'
- name: keyword.other.debugger.ts
match: '{{startOfIdentifier}}(debugger){{endOfIdentifier}}'
- name: storage.modifier.ts
match: '{{startOfIdentifier}}(declare){{endOfIdentifier}}'
label:
patterns:
@ -244,10 +245,11 @@ repository:
patterns:
# let/var
- name: meta.var.expr.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(var|let){{endOfIdentifier}}'
begin: '{{startOfDeclaration}}\b(var|let){{endOfIdentifier}}'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.type.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.ts }
end: ((?=;|}|(\s+(of|in)\s+)|^\s*$|{{endOfStatement}})|((?<=\S)(?<!{{lookBehindLet}}|{{lookBehindVar}})(?=\s*$)))
patterns:
- include: '#destructuring-variable'
@ -266,10 +268,11 @@ repository:
- include: '#punctuation-comma'
# const
- name: meta.var.expr.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(const(?!\s+enum\b)){{endOfIdentifier}}'
begin: '{{startOfDeclaration}}\b(const(?!\s+enum\b)){{endOfIdentifier}}'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.type.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.ts }
end: ((?=;|}|(\s+(of|in)\s+)|^\s*$|{{endOfStatement}})|((?<=\S)(?<!{{lookBehindConst}})(?=\s*$)))
patterns:
- include: '#destructuring-const'
@ -629,13 +632,14 @@ repository:
#functions, methods, function expressions, arrows, indexers
function-declaration:
name: meta.function.ts
begin: '{{startOfIdentifier}}(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))({{identifier}}))?\s*'
begin: '{{startOfDeclaration}}(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))({{identifier}}))?\s*'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.async.ts }
'3': { name: storage.type.function.ts }
'4': { name: keyword.generator.asterisk.ts }
'5': { name: meta.definition.function.ts entity.name.function.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.modifier.async.ts }
'4': { name: storage.type.function.ts }
'5': { name: keyword.generator.asterisk.ts }
'6': { name: meta.definition.function.ts entity.name.function.ts }
end: (?=$|^|;)|(?<=\})
patterns:
- include: '#function-name'
@ -836,11 +840,12 @@ repository:
#class declaration and expression, interface
class-declaration:
name: meta.class.ts
begin: '{{startOfIdentifier}}(?:(export)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
begin: '{{startOfDeclaration}}\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.class.ts }
'3': { name: storage.modifier.ts }
'4': { name: storage.type.class.ts }
end: (?<=\})
patterns:
- include: '#class-declaration-or-expression-patterns'
@ -867,11 +872,12 @@ repository:
interface-declaration:
name: meta.interface.ts
begin: '{{startOfIdentifier}}(?:(export)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
begin: '{{startOfDeclaration}}\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.interface.ts }
'3': { name: storage.modifier.ts }
'4': { name: storage.type.interface.ts }
end: (?<=\})
patterns:
- include: '#comment'
@ -945,12 +951,13 @@ repository:
#enum
enum-declaration:
name: meta.enum.declaration.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?(?:\b(const)\s+)?\b(enum)\s+({{identifier}})'
begin: '{{startOfDeclaration}}(?:\b(const)\s+)?\b(enum)\s+({{identifier}})'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.ts}
'3': { name: storage.type.enum.ts }
'4': { name: entity.name.type.enum.ts }
'3': { name: storage.modifier.ts}
'4': { name: storage.type.enum.ts }
'5': { name: entity.name.type.enum.ts }
end: (?<=\})
patterns:
- include: '#comment'
@ -981,10 +988,11 @@ repository:
#namespace
namespace-declaration:
name: meta.namespace.declaration.ts
begin: (?:{{startOfIdentifier}}(?:(\bexport)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))
begin: (?:{{startOfDeclaration}}\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.type.namespace.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.namespace.ts }
end: (?<=\})|(?={{endOfStatement}})
patterns:
- include: '#comment'
@ -997,11 +1005,12 @@ repository:
#type alias
type-alias-declaration:
name: meta.type.declaration.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(type)\b\s+({{identifier}})\s*'
begin: '{{startOfDeclaration}}\b(type)\b\s+({{identifier}})\s*'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.type.type.ts }
'3': { name: entity.name.type.alias.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.type.ts }
'4': { name: entity.name.type.alias.ts }
end: (?=\}|{{endOfStatement}})
patterns:
- include: '#comment'
@ -1017,14 +1026,15 @@ repository:
import-equals-declaration:
patterns:
- name: meta.import-equals.external.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(import)\s+({{identifier}})\s*(=)\s*(require)\s*(\()'
begin: '{{startOfDeclaration}}\b(import)\s+({{identifier}})\s*(=)\s*(require)\s*(\()'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: keyword.control.import.ts }
'3': { name: variable.other.readwrite.alias.ts }
'4': { name: keyword.operator.assignment.ts }
'5': { name: keyword.control.require.ts }
'6': { name: meta.brace.round.ts }
'2': { name: storage.modifier.ts }
'3': { name: keyword.control.import.ts }
'4': { name: variable.other.readwrite.alias.ts }
'5': { name: keyword.operator.assignment.ts }
'6': { name: keyword.control.require.ts }
'7': { name: meta.brace.round.ts }
end: \)
endCaptures:
'0': { name: meta.brace.round.ts }
@ -1032,12 +1042,13 @@ repository:
- include: '#comment'
- include: '#string'
- name: meta.import-equals.internal.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(import)\s+({{identifier}})\s*(=)\s*(?!require\b)'
begin: '{{startOfDeclaration}}\b(import)\s+({{identifier}})\s*(=)\s*(?!require\b)'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: keyword.control.import.ts }
'3': { name: variable.other.readwrite.alias.ts }
'4': { name: keyword.operator.assignment.ts }
'2': { name: storage.modifier.ts }
'3': { name: keyword.control.import.ts }
'4': { name: variable.other.readwrite.alias.ts }
'5': { name: keyword.operator.assignment.ts }
end: (?=;|$|^)
patterns:
- include: '#comment'
@ -1051,10 +1062,11 @@ repository:
import-declaration:
name: meta.import.ts
begin: '{{startOfIdentifier}}(?:(\bexport)\s+)?\b(import)(?!\s*[:\(]){{endOfIdentifier}}'
begin: '{{startOfDeclaration}}\b(import)(?!\s*[:\(]){{endOfIdentifier}}'
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: keyword.control.import.ts }
'2': { name: storage.modifier.ts }
'3': { name: keyword.control.import.ts }
end: (?<!{{lookBehindImport}})(?=;|$|^)
patterns:
- include: '#comment'

Просмотреть файл

@ -133,6 +133,12 @@
<key>include</key>
<string>#export-declaration</string>
</dict>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
</array>
</dict>
<key>control-statement</key>
@ -212,12 +218,6 @@
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
</array>
</dict>
<key>label</key>
@ -411,7 +411,7 @@
<key>name</key>
<string>meta.var.expr.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -420,6 +420,11 @@
<string>keyword.control.export.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.ts</string>
@ -488,7 +493,7 @@
<key>name</key>
<string>meta.var.expr.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -497,6 +502,11 @@
<string>keyword.control.export.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.ts</string>
@ -2002,7 +2012,7 @@
<key>name</key>
<string>meta.function.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2013,19 +2023,24 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.async.ts</string>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.function.ts</string>
<string>storage.modifier.async.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
<string>storage.type.function.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>meta.definition.function.ts entity.name.function.ts</string>
@ -2701,7 +2716,7 @@
<key>name</key>
<string>meta.class.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2715,6 +2730,11 @@
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.class.ts</string>
@ -2793,7 +2813,7 @@
<key>name</key>
<string>meta.interface.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2807,6 +2827,11 @@
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.interface.ts</string>
@ -3034,7 +3059,7 @@
<key>name</key>
<string>meta.enum.declaration.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3050,9 +3075,14 @@
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.enum.ts</string>
<string>storage.modifier.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.enum.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.type.enum.ts</string>
@ -3156,7 +3186,7 @@
<key>name</key>
<string>meta.namespace.declaration.ts</string>
<key>begin</key>
<string>(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))</string>
<string>(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3165,6 +3195,11 @@
<string>keyword.control.export.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.namespace.ts</string>
@ -3203,7 +3238,7 @@
<key>name</key>
<string>meta.type.declaration.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3214,9 +3249,14 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.type.ts</string>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.type.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.type.alias.ts</string>
@ -3265,7 +3305,7 @@
<key>name</key>
<string>meta.import-equals.external.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3276,24 +3316,29 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.import.ts</string>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.ts</string>
<string>keyword.control.import.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.ts</string>
<string>variable.other.readwrite.alias.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.control.require.ts</string>
<string>keyword.operator.assignment.ts</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>keyword.control.require.ts</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>meta.brace.round.ts</string>
@ -3325,7 +3370,7 @@
<key>name</key>
<string>meta.import-equals.internal.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3336,14 +3381,19 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.import.ts</string>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.ts</string>
<string>keyword.control.import.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.ts</string>
@ -3394,7 +3444,7 @@
<key>name</key>
<string>meta.import.ts</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3403,6 +3453,11 @@
<string>keyword.control.export.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.control.import.ts</string>

Просмотреть файл

@ -133,6 +133,12 @@
<key>include</key>
<string>#export-declaration</string>
</dict>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
</array>
</dict>
<key>control-statement</key>
@ -212,12 +218,6 @@
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
</array>
</dict>
<key>label</key>
@ -415,7 +415,7 @@
<key>name</key>
<string>meta.var.expr.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -424,6 +424,11 @@
<string>keyword.control.export.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.tsx</string>
@ -492,7 +497,7 @@
<key>name</key>
<string>meta.var.expr.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -501,6 +506,11 @@
<string>keyword.control.export.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.tsx</string>
@ -2006,7 +2016,7 @@
<key>name</key>
<string>meta.function.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2017,19 +2027,24 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.async.tsx</string>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.function.tsx</string>
<string>storage.modifier.async.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.tsx</string>
<string>storage.type.function.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.tsx</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>meta.definition.function.tsx entity.name.function.tsx</string>
@ -2705,7 +2720,7 @@
<key>name</key>
<string>meta.class.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2719,6 +2734,11 @@
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.class.tsx</string>
@ -2797,7 +2817,7 @@
<key>name</key>
<string>meta.interface.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2811,6 +2831,11 @@
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.interface.tsx</string>
@ -3038,7 +3063,7 @@
<key>name</key>
<string>meta.enum.declaration.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3054,9 +3079,14 @@
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.enum.tsx</string>
<string>storage.modifier.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.enum.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.type.enum.tsx</string>
@ -3160,7 +3190,7 @@
<key>name</key>
<string>meta.namespace.declaration.tsx</string>
<key>begin</key>
<string>(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))</string>
<string>(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"'`]))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3169,6 +3199,11 @@
<string>keyword.control.export.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.namespace.tsx</string>
@ -3207,7 +3242,7 @@
<key>name</key>
<string>meta.type.declaration.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3218,9 +3253,14 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.type.tsx</string>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.type.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.type.alias.tsx</string>
@ -3269,7 +3309,7 @@
<key>name</key>
<string>meta.import-equals.external.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3280,24 +3320,29 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.import.tsx</string>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.tsx</string>
<string>keyword.control.import.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.tsx</string>
<string>variable.other.readwrite.alias.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.control.require.tsx</string>
<string>keyword.operator.assignment.tsx</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>keyword.control.require.tsx</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>meta.brace.round.tsx</string>
@ -3329,7 +3374,7 @@
<key>name</key>
<string>meta.import-equals.internal.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3340,14 +3385,19 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.import.tsx</string>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.tsx</string>
<string>keyword.control.import.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.alias.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.tsx</string>
@ -3398,7 +3448,7 @@
<key>name</key>
<string>meta.import.tsx</string>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3407,6 +3457,11 @@
<string>keyword.control.export.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.control.import.tsx</string>

Просмотреть файл

@ -18,9 +18,9 @@ Grammar: TypeScript.tmLanguage
source.ts
>declare module 'goog:goog.i18n.NumberFormatSymbols_en_TT' {
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^

Просмотреть файл

@ -16,7 +16,7 @@ Grammar: TypeScript.tmLanguage
>
>declare module 'goog:goog.i18n.NumberFormatSymbols_en_TT' {
^^^^^^^
[3, 1]: source.ts storage.modifier.ts
[3, 1]: source.ts meta.namespace.declaration.ts storage.modifier.ts
^^^^^^
[3, 9]: source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^

Просмотреть файл

@ -11,9 +11,9 @@ Grammar: TypeScript.tmLanguage
-----------------------------------
>declare function foo(): any
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.function.ts storage.modifier.ts
^
source.ts
source.ts meta.function.ts
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
@ -32,9 +32,9 @@ Grammar: TypeScript.tmLanguage
source.ts meta.function.ts meta.return.type.ts support.type.primitive.ts
>declare function foo(): any
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.function.ts storage.modifier.ts
^
source.ts
source.ts meta.function.ts
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^

Просмотреть файл

@ -9,9 +9,9 @@ Grammar: TypeScript.tmLanguage
-----------------------------------
>declare module ILogin{
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^

Просмотреть файл

@ -12,9 +12,9 @@ Grammar: TypeScript.tmLanguage
-----------------------------------
>declare module 'foo';
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^
@ -29,9 +29,9 @@ Grammar: TypeScript.tmLanguage
source.ts punctuation.terminator.statement.ts
>declare module 'bar';
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^
@ -46,9 +46,9 @@ Grammar: TypeScript.tmLanguage
source.ts punctuation.terminator.statement.ts
>declare module 'baz';
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^

Просмотреть файл

@ -8,9 +8,9 @@ Grammar: TypeScript.tmLanguage
-----------------------------------
>declare function f<T, U>(): void;
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.function.ts storage.modifier.ts
^
source.ts
source.ts meta.function.ts
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^

Просмотреть файл

@ -0,0 +1,46 @@
original file
-----------------------------------
export declare class TestClient {
private readonly test1;
}
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>export declare class TestClient {
^^^^^^
source.ts meta.class.ts keyword.control.export.ts
^
source.ts meta.class.ts
^^^^^^^
source.ts meta.class.ts storage.modifier.ts
^
source.ts meta.class.ts
^^^^^
source.ts meta.class.ts storage.type.class.ts
^
source.ts meta.class.ts
^^^^^^^^^^
source.ts meta.class.ts entity.name.type.class.ts
^
source.ts meta.class.ts
^
source.ts meta.class.ts punctuation.definition.block.ts
> private readonly test1;
^^^^
source.ts meta.class.ts
^^^^^^^
source.ts meta.class.ts storage.modifier.ts
^
source.ts meta.class.ts
^^^^^^^^
source.ts meta.class.ts storage.modifier.ts
^
source.ts meta.class.ts
^^^^^
source.ts meta.class.ts variable.other.readwrite.ts
^
source.ts meta.class.ts punctuation.terminator.statement.ts
>}
^
source.ts meta.class.ts punctuation.definition.block.ts

Просмотреть файл

@ -353,9 +353,9 @@ Grammar: TypeScript.tmLanguage
source.ts
>declare let cond: boolean;
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.var.expr.ts storage.modifier.ts
^
source.ts
source.ts meta.var.expr.ts
^^^
source.ts meta.var.expr.ts storage.type.ts
^

Просмотреть файл

@ -41,9 +41,9 @@ Grammar: TypeScript.tmLanguage
source.ts meta.namespace.declaration.ts meta.block.ts punctuation.definition.block.ts
>declare namespace ts {}
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^
@ -58,9 +58,9 @@ Grammar: TypeScript.tmLanguage
source.ts meta.namespace.declaration.ts meta.block.ts punctuation.definition.block.ts
>declare module ts {}
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^
@ -75,9 +75,9 @@ Grammar: TypeScript.tmLanguage
source.ts meta.namespace.declaration.ts meta.block.ts punctuation.definition.block.ts
>declare module "x" {}
^^^^^^^
source.ts storage.modifier.ts
source.ts meta.namespace.declaration.ts storage.modifier.ts
^
source.ts
source.ts meta.namespace.declaration.ts
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^

3
tests/cases/Issue642.ts Normal file
Просмотреть файл

@ -0,0 +1,3 @@
export declare class TestClient {
private readonly test1;
}