aboutsummaryrefslogtreecommitdiffstats
path: root/queries/julia
diff options
context:
space:
mode:
authorSergio A. Vargas <savargasqu+git@unal.edu.co>2022-12-14 03:06:08 -0500
committerGitHub <noreply@github.com>2022-12-14 09:06:08 +0100
commitd31c71c959348b7b15f7e69608a47aea05ed7bc6 (patch)
tree6d57fba104ede150cc39d7aea7abe16dc7d183b9 /queries/julia
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar.gz
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar.bz2
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar.lz
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar.xz
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.tar.zst
nvim-treesitter-d31c71c959348b7b15f7e69608a47aea05ed7bc6.zip
julia: update queries to parser change (#3956)
Diffstat (limited to 'queries/julia')
-rw-r--r--queries/julia/highlights.scm25
-rw-r--r--queries/julia/indents.scm7
-rw-r--r--queries/julia/injections.scm9
3 files changed, 21 insertions, 20 deletions
diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm
index e8d9ac9ff..5e4922e14 100644
--- a/queries/julia/highlights.scm
+++ b/queries/julia/highlights.scm
@@ -15,17 +15,9 @@
(quote_expression ":" (identifier)) @symbol
-
-;;; Fields and indexes
-
(field_expression
(identifier) @field .)
-(index_expression
- (_)
- (range_expression
- (identifier) @constant.builtin .)
- (#eq? @constant.builtin "end"))
;;; Function names
@@ -79,13 +71,14 @@
;; Definitions
(abstract_definition
- name: (identifier) @type.definition
- (subtype_clause (identifier) @type))
+ name: (identifier) @type.definition)
(primitive_definition
- name: (identifier) @type.definition
- (subtype_clause (identifier) @type))
+ name: (identifier) @type.definition)
(struct_definition
name: (identifier) @type)
+(subtype_clause [
+ (identifier) @type
+ (field_expression (identifier) @type .)])
;; Annotations
@@ -109,6 +102,8 @@
;;; Keywords
[
+ "global"
+ "local"
"macro"
"struct"
"type"
@@ -117,9 +112,6 @@
"end" @keyword
-((identifier) @keyword
- (#any-of? @keyword "global" "local")) ; Grammar error
-
(compound_statement
["begin" "end"] @keyword)
(quote_statement
@@ -185,11 +177,10 @@
(operator) @operator
(for_binding ["in" "=" "∈"] @operator)
-(pair_expression "=>" @operator)
(range_expression ":" @operator)
(slurp_parameter "..." @operator)
-(spread_expression "..." @operator)
+(splat_expression "..." @operator)
"." @operator
["::" "<:"] @operator
diff --git a/queries/julia/indents.scm b/queries/julia/indents.scm
index 47be570f2..5e88c697c 100644
--- a/queries/julia/indents.scm
+++ b/queries/julia/indents.scm
@@ -3,24 +3,25 @@
(macro_definition)
(function_definition)
+ (compound_statement)
(if_statement)
(try_statement)
(for_statement)
(while_statement)
(let_statement)
(quote_statement)
-
(do_clause)
- (compound_statement)
(assignment)
+ (for_binding)
(binary_expression)
(call_expression)
- (array_expression)
(tuple_expression)
+ (comprehension_expression)
(matrix_expression)
+ (vector_expression)
] @indent
[
diff --git a/queries/julia/injections.scm b/queries/julia/injections.scm
index ac1721b33..ff79619c0 100644
--- a/queries/julia/injections.scm
+++ b/queries/julia/injections.scm
@@ -1,4 +1,13 @@
+;; Inject markdown in docstrings
((string_literal) @markdown
+ . [
+ (module_definition)
+ (abstract_definition)
+ (struct_definition)
+ (function_definition)
+ (assignment)
+ (const_declaration)
+ ]
(#match? @markdown "^\"\"\"")
(#offset! @markdown 0 3 0 -3))