diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-09-12 20:57:01 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-14 18:27:20 +0200 |
| commit | bcf421b4e7f164dfc8aca8a94949adda2bdda10f (patch) | |
| tree | 2a5d4c5c91f37a81058986bf3d3598beb257d3b6 /queries | |
| parent | Folds: rename query files to folds.scm to be consistent (diff) | |
| download | nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar.gz nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar.bz2 nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar.lz nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar.xz nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.tar.zst nvim-treesitter-bcf421b4e7f164dfc8aca8a94949adda2bdda10f.zip | |
Fix #307: Use and document TSVariable/TSVariableBuiltin in all languages
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/c/highlights.scm | 2 | ||||
| -rw-r--r-- | queries/c_sharp/highlights.scm | 1 | ||||
| -rw-r--r-- | queries/cpp/highlights.scm | 2 | ||||
| -rw-r--r-- | queries/java/highlights.scm | 7 | ||||
| -rw-r--r-- | queries/javascript/highlights.scm | 4 | ||||
| -rw-r--r-- | queries/lua/highlights.scm | 3 | ||||
| -rw-r--r-- | queries/php/highlights.scm | 4 | ||||
| -rw-r--r-- | queries/python/highlights.scm | 11 | ||||
| -rw-r--r-- | queries/ruby/highlights.scm | 5 |
9 files changed, 31 insertions, 8 deletions
diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index 6d6d75dcd..96b43cf0d 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -1,3 +1,5 @@ +(identifier) @variable + [ "const" "default" diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index af37e5498..d6098acbc 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -1,3 +1,4 @@ +(identifier) @variable (method_declaration name: (identifier) @method) diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm index 0b727c3ad..15bc3ac72 100644 --- a/queries/cpp/highlights.scm +++ b/queries/cpp/highlights.scm @@ -77,7 +77,7 @@ ; Constants -(this) @constant.builtin +(this) @variable.builtin (nullptr) @constant (true) @boolean diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index 7f3a7aa49..70cbb28a7 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -1,7 +1,10 @@ ; CREDITS @maxbrunsfeld (maxbrunsfeld@gmail.com) -; Methods +; Variables +(identifier) @variable + +; Methods (method_declaration name: (identifier) @method) @@ -105,7 +108,7 @@ ((identifier) @constant (#vim-match? @constant "^_*[A-Z][A-Z\d_]+")) -(this) @constant.builtin +(this) @variable.builtin ; Literals diff --git a/queries/javascript/highlights.scm b/queries/javascript/highlights.scm index 03ffcb57f..627c4b2d1 100644 --- a/queries/javascript/highlights.scm +++ b/queries/javascript/highlights.scm @@ -2,6 +2,10 @@ ; Javascript +; Variables +;----------- +(identifier) @variable + ; Properties ;----------- diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 439f570bd..b66d33c45 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -91,6 +91,9 @@ "}" ] @punctuation.bracket +;; Variables +(identifier) @variable + ;; Constants [ (false) diff --git a/queries/php/highlights.scm b/queries/php/highlights.scm index 3ec2b5916..04cce08b2 100644 --- a/queries/php/highlights.scm +++ b/queries/php/highlights.scm @@ -1,3 +1,7 @@ +; Variables + +(variable_name) @variable + ; Types [ diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index e991e28d3..b71544eca 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -1,6 +1,9 @@ ;; From tree-sitter-python licensed under MIT License ; Copyright (c) 2016 Max Brunsfeld +; Variables +(identifier) @variable + ; Reset highlighing in f-string interpolations (interpolation) @Normal @@ -105,8 +108,8 @@ (none) @constant.builtin [(true) (false)] @boolean -((identifier) @constant.builtin - (#match? @constant.builtin "self")) +((identifier) @variable.builtin + (#match? @variable.builtin "self")) (integer) @number (float) @float @@ -232,8 +235,8 @@ ((class_definition body: (block (function_definition - parameters: (parameters . (identifier) @constant.builtin)))) - (#vim-match? @constant.builtin "^(self|obj|cls)$")) + parameters: (parameters . (identifier) @variable.builtin)))) + (#vim-match? @variable.builtin "^(self|obj|cls)$")) ;; Error (ERROR) @error diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm index 3733279d8..d18dbccdd 100644 --- a/queries/ruby/highlights.scm +++ b/queries/ruby/highlights.scm @@ -1,3 +1,6 @@ +; Variables +(identifier) @variable + ; Keywords [ @@ -100,7 +103,7 @@ [ (self) (super) - ] @constant.builtin + ] @variable.builtin (method_parameters (identifier) @parameter) (lambda_parameters (identifier) @parameter) |
