From f6e1266493d4819eec508a7a2727ca39a4efd45e Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 10 Apr 2024 15:21:07 +0000 Subject: [PATCH] Consider module as function call for highlighting Their semantic is closer to a function call (like i.e: Bazel rules) rather than a module/namespace. Similarly for their properties, which are more like parameters than members. --- queries/highlights.scm | 4 ++-- test/highlight/modules.bp | 16 ++++++++-------- test/highlight/properties.bp | 2 +- test/highlight/select.bp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/queries/highlights.scm b/queries/highlights.scm index 7422e6f..17c5692 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -42,11 +42,11 @@ (identifier) @variable (module - type: (identifier) @module) + type: (identifier) @function.call) (module (property - field: (identifier) @variable.member)) + field: (identifier) @variable.parameter)) ; }}} ; Built-ins {{{ diff --git a/test/highlight/modules.bp b/test/highlight/modules.bp index 248acdf..e115e6a 100644 --- a/test/highlight/modules.bp +++ b/test/highlight/modules.bp @@ -1,21 +1,21 @@ foo {} -// <- module +// <- function.call foo () -// <- module +// <- function.call foo { -// <- module +// <- function.call field: 12, - // <- variable.member + // <- variable.parameter another_field: 27, - // <- variable.member + // <- variable.parameter } foo ( -// <- module +// <- function.call field = 42, - // <- variable.member + // <- variable.parameter done = false, - // <- variable.member + // <- variable.parameter ) diff --git a/test/highlight/properties.bp b/test/highlight/properties.bp index 6bc97ef..8ad2c55 100644 --- a/test/highlight/properties.bp +++ b/test/highlight/properties.bp @@ -1,6 +1,6 @@ foo { field: { - // <- variable.member + // <- variable.parameter key: 42, // <- property }, diff --git a/test/highlight/select.bp b/test/highlight/select.bp index 831608d..b857c1e 100644 --- a/test/highlight/select.bp +++ b/test/highlight/select.bp @@ -11,5 +11,5 @@ select = 42 // Or module property foo { select: 42, - // <- variable.member + // <- variable.parameter }