diff options
author | Blaž Hrastnik | 2021-11-06 15:28:19 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-11-06 15:28:19 +0000 |
commit | f2b709a3c3a9cc036bfea46734efd7e4100eb34b (patch) | |
tree | ad5f921f13659e5ba395442e13389af317ee81b0 /runtime/queries/python | |
parent | cde57dae356021c6ca8c2a2ed68777bd9d0bc0b2 (diff) | |
parent | f979bdc442ab3150a369ff8bee0703e90e32e2a4 (diff) |
Merge branch 'master' into debug
Diffstat (limited to 'runtime/queries/python')
-rw-r--r-- | runtime/queries/python/highlights.scm | 11 | ||||
-rw-r--r-- | runtime/queries/python/indents.toml | 39 | ||||
-rw-r--r-- | runtime/queries/python/textobjects.scm | 14 |
3 files changed, 57 insertions, 7 deletions
diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index f64fecb2..9131acc5 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -29,7 +29,7 @@ name: (identifier) @function) (identifier) @variable -(attribute attribute: (identifier) @property) +(attribute attribute: (identifier) @variable.other.member) (type (identifier) @type) ; Literals @@ -40,14 +40,11 @@ (false) ] @constant.builtin -[ - (integer) - (float) -] @number - +(integer) @constant.numeric.integer +(float) @constant.numeric.float (comment) @comment (string) @string -(escape_sequence) @escape +(escape_sequence) @constant.character.escape (interpolation "{" @punctuation.special diff --git a/runtime/queries/python/indents.toml b/runtime/queries/python/indents.toml new file mode 100644 index 00000000..6bc68486 --- /dev/null +++ b/runtime/queries/python/indents.toml @@ -0,0 +1,39 @@ +indent = [ + "list", + "tuple", + "dictionary", + "set", + + "if_statement", + "for_statement", + "while_statement", + "with_statement", + "try_statement", + "import_from_statement", + + "parenthesized_expression", + "generator_expression", + "list_comprehension", + "set_comprehension", + "dictionary_comprehension", + + "tuple_pattern", + "list_pattern", + "argument_list", + "parameters", + "binary_operator", + + "function_definition", + "class_definition", +] + +outdent = [ + ")", + "]", + "}", + "return_statement", + "pass_statement", + "raise_statement", +] + +ignore = ["string"] diff --git a/runtime/queries/python/textobjects.scm b/runtime/queries/python/textobjects.scm new file mode 100644 index 00000000..a52538af --- /dev/null +++ b/runtime/queries/python/textobjects.scm @@ -0,0 +1,14 @@ +(function_definition + body: (block)? @function.inside) @function.around + +(class_definition + body: (block)? @class.inside) @class.around + +(parameters + (_) @parameter.inside) + +(lambda_parameters + (_) @parameter.inside) + +(argument_list + (_) @parameter.inside) |