mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
graphql: add highlights
This commit is contained in:
parent
4cc4c6f8b1
commit
322a4690c5
1 changed files with 148 additions and 0 deletions
148
queries/graphql/highlights.scm
Normal file
148
queries/graphql/highlights.scm
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
; Types
|
||||||
|
;------
|
||||||
|
|
||||||
|
(scalar_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(object_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(interface_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(union_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(enum_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(input_object_type_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(directive_definition
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(scalar_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(object_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(interface_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(union_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(enum_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(input_object_type_extension
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(named_type
|
||||||
|
(name) @type)
|
||||||
|
|
||||||
|
(directive) @type
|
||||||
|
|
||||||
|
; Properties
|
||||||
|
;-----------
|
||||||
|
|
||||||
|
(field
|
||||||
|
(name) @property)
|
||||||
|
|
||||||
|
(field
|
||||||
|
(alias
|
||||||
|
(name) @property))
|
||||||
|
|
||||||
|
(field_definition
|
||||||
|
(name) @property)
|
||||||
|
|
||||||
|
(object_value
|
||||||
|
(object_field
|
||||||
|
(name) @property))
|
||||||
|
|
||||||
|
; Variable Definitions and Arguments
|
||||||
|
;-----------------------------------
|
||||||
|
|
||||||
|
(operation_definition
|
||||||
|
(name) @variable)
|
||||||
|
|
||||||
|
(argument
|
||||||
|
(name) @parameter)
|
||||||
|
|
||||||
|
(arguments_definition
|
||||||
|
(input_value_definition
|
||||||
|
(name) @parameter))
|
||||||
|
|
||||||
|
(variable_definition
|
||||||
|
(variable) @parameter)
|
||||||
|
|
||||||
|
(argument
|
||||||
|
(value
|
||||||
|
(variable) @variable))
|
||||||
|
|
||||||
|
; Constants
|
||||||
|
;----------
|
||||||
|
|
||||||
|
(string_value) @string
|
||||||
|
|
||||||
|
(int_value) @number
|
||||||
|
|
||||||
|
(float_value) @float
|
||||||
|
|
||||||
|
(boolean_value) @boolean
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
;---------
|
||||||
|
|
||||||
|
(description) @comment
|
||||||
|
|
||||||
|
(directive_location
|
||||||
|
(executable_directive_location) @type.builtin)
|
||||||
|
|
||||||
|
(directive_location
|
||||||
|
(type_system_directive_location) @type.builtin)
|
||||||
|
|
||||||
|
; Keywords
|
||||||
|
;----------
|
||||||
|
|
||||||
|
[
|
||||||
|
"query"
|
||||||
|
"mutation"
|
||||||
|
"subscription"
|
||||||
|
"fragment"
|
||||||
|
"scalar"
|
||||||
|
"type"
|
||||||
|
"interface"
|
||||||
|
"union"
|
||||||
|
"enum"
|
||||||
|
"input"
|
||||||
|
"extend"
|
||||||
|
"directive"
|
||||||
|
"schema"
|
||||||
|
"on"
|
||||||
|
"repeatable"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
; Punctuation
|
||||||
|
;------------
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
"=" @operator
|
||||||
|
|
||||||
|
"|" @punctuation.delimiter
|
||||||
|
"&" @punctuation.delimiter
|
||||||
|
":" @punctuation.delimiter
|
||||||
|
|
||||||
|
"..." @punctuation.special
|
||||||
|
"!" @punctuation.special
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue