aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
author再生花 <hoangtun0810@gmail.com>2024-02-23 17:42:01 +0900
committerGitHub <noreply@github.com>2024-02-23 10:42:01 +0200
commit31641d72a4c33536e9d5fc8f829d2ba84211af8a (patch)
tree65d4edd50b87eacb993dab1fd27347d6686d3c0e /queries/python
parentfeat(faust): better highlighting of function calls, built-in variables, and m... (diff)
downloadnvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar.gz
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar.bz2
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar.lz
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar.xz
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.tar.zst
nvim-treesitter-31641d72a4c33536e9d5fc8f829d2ba84211af8a.zip
feat(format-scripts): linewrap predicates
"format-ignore".kick()
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm40
1 files changed, 23 insertions, 17 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 0c7147b51..fea97bed3 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -17,11 +17,9 @@
(#lua-match? @constant.builtin "^__[a-zA-Z0-9_]*__$"))
((identifier) @constant.builtin
- ; format-ignore
- (#any-of? @constant.builtin
+ (#any-of? @constant.builtin
; https://docs.python.org/3/library/constants.html
- "NotImplemented" "Ellipsis"
- "quit" "exit" "copyright" "credits" "license"))
+ "NotImplemented" "Ellipsis" "quit" "exit" "copyright" "credits" "license"))
"_" @constant.builtin ; match wildcard
@@ -89,7 +87,14 @@
; Builtin functions
((call
function: (identifier) @function.builtin)
- (#any-of? @function.builtin "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview" "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed" "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" "vars" "zip" "__import__"))
+ (#any-of? @function.builtin
+ "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr"
+ "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec"
+ "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id"
+ "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview"
+ "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed"
+ "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type"
+ "vars" "zip" "__import__"))
; Function definitions
(function_definition
@@ -408,23 +413,24 @@
(#any-of? @constructor "__new__" "__init__"))
((identifier) @type.builtin
- ; format-ignore
(#any-of? @type.builtin
; https://docs.python.org/3/library/exceptions.html
- "BaseException" "Exception" "ArithmeticError" "BufferError" "LookupError" "AssertionError" "AttributeError"
- "EOFError" "FloatingPointError" "GeneratorExit" "ImportError" "ModuleNotFoundError" "IndexError" "KeyError"
- "KeyboardInterrupt" "MemoryError" "NameError" "NotImplementedError" "OSError" "OverflowError" "RecursionError"
- "ReferenceError" "RuntimeError" "StopIteration" "StopAsyncIteration" "SyntaxError" "IndentationError" "TabError"
- "SystemError" "SystemExit" "TypeError" "UnboundLocalError" "UnicodeError" "UnicodeEncodeError" "UnicodeDecodeError"
- "UnicodeTranslateError" "ValueError" "ZeroDivisionError" "EnvironmentError" "IOError" "WindowsError"
- "BlockingIOError" "ChildProcessError" "ConnectionError" "BrokenPipeError" "ConnectionAbortedError"
- "ConnectionRefusedError" "ConnectionResetError" "FileExistsError" "FileNotFoundError" "InterruptedError"
- "IsADirectoryError" "NotADirectoryError" "PermissionError" "ProcessLookupError" "TimeoutError" "Warning"
+ "BaseException" "Exception" "ArithmeticError" "BufferError" "LookupError" "AssertionError"
+ "AttributeError" "EOFError" "FloatingPointError" "GeneratorExit" "ImportError"
+ "ModuleNotFoundError" "IndexError" "KeyError" "KeyboardInterrupt" "MemoryError" "NameError"
+ "NotImplementedError" "OSError" "OverflowError" "RecursionError" "ReferenceError" "RuntimeError"
+ "StopIteration" "StopAsyncIteration" "SyntaxError" "IndentationError" "TabError" "SystemError"
+ "SystemExit" "TypeError" "UnboundLocalError" "UnicodeError" "UnicodeEncodeError"
+ "UnicodeDecodeError" "UnicodeTranslateError" "ValueError" "ZeroDivisionError" "EnvironmentError"
+ "IOError" "WindowsError" "BlockingIOError" "ChildProcessError" "ConnectionError"
+ "BrokenPipeError" "ConnectionAbortedError" "ConnectionRefusedError" "ConnectionResetError"
+ "FileExistsError" "FileNotFoundError" "InterruptedError" "IsADirectoryError"
+ "NotADirectoryError" "PermissionError" "ProcessLookupError" "TimeoutError" "Warning"
"UserWarning" "DeprecationWarning" "PendingDeprecationWarning" "SyntaxWarning" "RuntimeWarning"
"FutureWarning" "ImportWarning" "UnicodeWarning" "BytesWarning" "ResourceWarning"
; https://docs.python.org/3/library/stdtypes.html
- "bool" "int" "float" "complex" "list" "tuple" "range" "str"
- "bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object"))
+ "bool" "int" "float" "complex" "list" "tuple" "range" "str" "bytes" "bytearray" "memoryview"
+ "set" "frozenset" "dict" "type" "object"))
; Regex from the `re` module
(call