aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-07-22 16:24:39 +0200
committerThomas Vigouroux <39092278+vigoux@users.noreply.github.com>2020-07-22 17:30:48 +0200
commit5d696053e598f946ace25e38a643e2a618573376 (patch)
tree65abfdb2b15cadff60bb6f8bf42299e83748643b /queries/python
parentPython highlights: add lambda parameters (diff)
downloadnvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar.gz
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar.bz2
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar.lz
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar.xz
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.tar.zst
nvim-treesitter-5d696053e598f946ace25e38a643e2a618573376.zip
Fix #198: prefer method highlighting over attribute
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 9f7a8b7bc..9e0ff2dca 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -13,6 +13,10 @@
((identifier) @constant.builtin
(match? @constant.builtin "^__[a-zA-Z0-9_]*__$"))
+((attribute
+ attribute: (identifier) @field)
+ (match? @field "^([A-Z])@!.*$"))
+
; Function calls
(decorator) @function
@@ -200,10 +204,6 @@
superclasses: (argument_list
(identifier) @type))
-((attribute
- attribute: (identifier) @field)
- (match? @field "^([A-Z])@!.*$"))
-
((class_definition
body: (block
(expression_statement