diff options
| author | Steven Sojka <steelsojka@users.noreply.github.com> | 2020-08-16 11:27:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-16 11:27:15 -0500 |
| commit | 4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6 (patch) | |
| tree | 4ef42a5f7c195784f46f1153547d8d0ec3075589 /queries/javascript/highlights.scm | |
| parent | Merge pull request #295 from steelsojka/feature/set-scopes-for-definitions (diff) | |
| parent | feat(highlights): add is predicate (diff) | |
| download | nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar.gz nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar.bz2 nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar.lz nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar.xz nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.tar.zst nvim-treesitter-4a747aa30cc7d1ac73ebe5ac5cee97bf5fccc6d6.zip | |
Merge pull request #296 from steelsojka/feat-is-predicate
feat(highlights): add is predicate
Diffstat (limited to 'queries/javascript/highlights.scm')
| -rw-r--r-- | queries/javascript/highlights.scm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/queries/javascript/highlights.scm b/queries/javascript/highlights.scm index fe373e617..6cc7ab43d 100644 --- a/queries/javascript/highlights.scm +++ b/queries/javascript/highlights.scm @@ -1,9 +1,17 @@ ; Types ; Javascript + +; Properties +;----------- + +(property_identifier) @property + ; Special identifiers ;-------------------- +(identifier) @variable + ((identifier) @constant (#match? @constant "^[A-Z_][A-Z\\d_]+$")) @@ -14,11 +22,17 @@ (#match? @constructor "^[A-Z]")) ((identifier) @variable.builtin + (#not-is? @variable.builtin import var parameter) (#match? @variable.builtin "^(arguments|module|console|window|document)$")) ((identifier) @function.builtin + (#not-is? @function.builtin import var parameter) (#eq? @function.builtin "require")) +((identifier) @parameter.reference + (#is? @parameter.reference parameter)) + + ; Function and method definitions ;-------------------------------- @@ -78,13 +92,6 @@ (rest_parameter (identifier) @parameter)) -(identifier) @variable - -; Properties -;----------- - -(property_identifier) @property - ; Literals ;--------- |
