[language-(java|type)script] Highlight wildcard export specifiers…

…like `export * from 'foo'`.
This commit is contained in:
Andrew Dupont 2024-04-03 23:32:48 -07:00
parent 9583449e57
commit 22b27afd32
2 changed files with 26 additions and 2 deletions

View File

@ -573,15 +573,27 @@
(export_statement
(identifier) @variable.other.assignment.export.js)
; The "*" in `import * as Foo`
; The "*" in `import * as Foo from 'bar'`
(import_clause
(namespace_import "*" @variable.other.assignment.import.all.js))
; The "Foo" in `import * as Foo`
; The "Foo" in `import * as Foo from 'bar'`
(import_clause
(namespace_import
(identifier) @variable.other.assignment.import.alias.js))
; The "*" in `export * from 'bar'`
(export_statement "*" @variable.other.assignment.export.all.js)
; The "*" in `export * as Foo from 'bar'`
(export_statement
(namespace_export "*" @variable.other.assignment.export.all.js))
; The "*" in `export * as Foo from 'bar'`
(export_statement
(namespace_export
(identifier) @variable.other.assignment.export.alias.js))
; COMMENTS
; ========

View File

@ -17,6 +17,18 @@
(namespace_import
(identifier) @variable.other.assignment.import.namespace._LANG_)
; The "*" in `export * from 'bar'`
(export_statement "*" @variable.other.assignment.export.all.js)
; The "*" in `export * as Foo from 'bar'`
(export_statement
(namespace_export "*" @variable.other.assignment.export.all.js))
; The "*" in `export * as Foo from 'bar'`
(export_statement
(namespace_export
(identifier) @variable.other.assignment.export.alias.js))
; The "Foo" in `export { Foo }`
(export_specifier
name: (identifier) @variable.other.assignment.export._LANG_)