aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Kegley <hi@bryankegley.me>2020-11-26 13:33:17 -0600
committerThomas Vigouroux <tomvig38@gmail.com>2020-11-27 14:06:27 +0100
commit322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4 (patch)
treec35e52d0482f69ef5fe517b7204613aa35352a5a
parentfeat: add graphql grammar (diff)
downloadnvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar.gz
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar.bz2
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar.lz
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar.xz
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.tar.zst
nvim-treesitter-322a4690c506ab0a55aeb91dcd80f4bbb0e9dac4.zip
graphql: add highlights
-rw-r--r--queries/graphql/highlights.scm148
1 files changed, 148 insertions, 0 deletions
diff --git a/queries/graphql/highlights.scm b/queries/graphql/highlights.scm
new file mode 100644
index 000000000..4846606cb
--- /dev/null
+++ b/queries/graphql/highlights.scm
@@ -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
+