mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
[language-typescript] Various highlighting fixes…
* Declared namespaces should be `entity` only, not `support` * `<` and `>` in type parameters should always have the proper `punctuation` scopes applied * All TSX tags should have the surrounding `meta.tag.ts.tsx` scope applied * TSX fragments (`<>`) should be highlighted
This commit is contained in:
parent
a0595b275d
commit
f1ce722f33
@ -294,7 +294,8 @@
|
||||
; ==========
|
||||
|
||||
(interface_declaration
|
||||
name: (_) @entity.name.type.interface._LANG_)
|
||||
name: (_) @entity.name.type.interface._LANG_
|
||||
(#set! capture.final))
|
||||
|
||||
|
||||
; TYPES
|
||||
@ -310,6 +311,11 @@
|
||||
(type_arguments ">" @punctuation.definition.parameters.end.bracket.angle.js
|
||||
(#set! capture.final))
|
||||
|
||||
(type_parameters "<" @punctuation.definition.parameters.begin.bracket.angle.js
|
||||
(#set! capture.final))
|
||||
(type_parameters ">" @punctuation.definition.parameters.end.bracket.angle.js
|
||||
(#set! capture.final))
|
||||
|
||||
"=>" @storage.type.arrow._LANG_
|
||||
|
||||
; TODO: If I allow scopes like `storage.type.string._LANG_`, I will make a lot of
|
||||
|
@ -9,24 +9,27 @@
|
||||
|
||||
; The "Foo" in `<Foo>`.
|
||||
(jsx_opening_element
|
||||
name: (identifier) @entity.name.tag.ts.tsx)
|
||||
name: (identifier) @entity.name.tag.ts.tsx) @meta.tag.ts.tsx
|
||||
|
||||
; The "Foo.Bar" in `<Foo.Bar>`.
|
||||
(jsx_opening_element
|
||||
name: (nested_identifier) @entity.name.tag.ts.tsx)
|
||||
name: (nested_identifier) @entity.name.tag.ts.tsx) @meta.tag.ts.tsx
|
||||
|
||||
; The "Foo" in `</Foo>`.
|
||||
(jsx_closing_element
|
||||
name: (identifier) @entity.name.tag.ts.tsx)
|
||||
name: (identifier) @entity.name.tag.ts.tsx) @meta.tag.ts.tsx
|
||||
|
||||
; The "Foo.Bar" in `</Foo.Bar>`.
|
||||
(jsx_closing_element
|
||||
name: (nested_identifier) @entity.name.tag.ts.tsx)
|
||||
name: (nested_identifier) @entity.name.tag.ts.tsx) @meta.tag.ts.tsx
|
||||
|
||||
; The "bar" in `<Foo bar={true} />`.
|
||||
(jsx_attribute
|
||||
(property_identifier) @entity.other.attribute-name.ts.tsx)
|
||||
|
||||
; The empty tag used as a shorthand for a fragment: `<>`.
|
||||
(jsx_fragment) @meta.tag.ts.tsx
|
||||
|
||||
; The slashes in closing tags should not be interpreted as math operators.
|
||||
(jsx_self_closing_element "/" @punctuation.definition.tag.end.ts.tsx
|
||||
(#set! capture.final true))
|
||||
@ -48,6 +51,10 @@
|
||||
"<" @punctuation.definition.tag.begin.ts.tsx
|
||||
">" @punctuation.definition.tag.end.ts.tsx)
|
||||
|
||||
(jsx_fragment
|
||||
"<" @punctuation.definition.tag.begin.ts.tsx
|
||||
">" @punctuation.definition.tag.end.ts.tsx)
|
||||
|
||||
(jsx_self_closing_element
|
||||
"<" @punctuation.definition.tag.begin.ts.tsx
|
||||
(#set! capture.final true))
|
||||
|
Loading…
Reference in New Issue
Block a user