aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYorick Peterse <git@yorickpeterse.com>2024-05-03 22:06:54 +0200
committerGitHub <noreply@github.com>2024-05-03 13:06:54 -0700
commit4ae2b452e9bd67ff618e3bb0e3488e49c98465e9 (patch)
tree9df92690e60b8cb63dbda3d998b7d994ed9843e4
parentfeat: add support for Tact (#6554) (diff)
downloadnvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar.gz
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar.bz2
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar.lz
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar.xz
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.tar.zst
nvim-treesitter-4ae2b452e9bd67ff618e3bb0e3488e49c98465e9.zip
fix(inko): highlighting of numeric call names (#6566)
Inko allows for syntax such as `some_value.42.to_string`, where `42` is a method name. Similar to other languages that allow this (e.g. Rust), these numeric names should be highlighted as numbers instead of identifiers. To fix this, the query to highlight call names is adjusted to only highlight "name" and "constant" nodes as the function group, ensuring the remaining possible node ("integer") continues to use the same group as regular numbers.
-rw-r--r--queries/inko/highlights.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/queries/inko/highlights.scm b/queries/inko/highlights.scm
index c19eb3a3a..eff00fc02 100644
--- a/queries/inko/highlights.scm
+++ b/queries/inko/highlights.scm
@@ -190,6 +190,9 @@
name: _ @variable.parameter)
(call
- name: _ @function)
+ name: [
+ (name)
+ (constant)
+ ] @function)
(field) @variable.member