From a9ec312792211a4c72899c1fbf807a2157e22a20 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 8 Apr 2024 21:28:18 +0100 Subject: [PATCH] Add modules highlighting Still debating whether modules should be highlighted as namespaces or as function calls. --- queries/highlights.scm | 7 +++++++ test/highlight/modules.bp | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/highlight/modules.bp diff --git a/queries/highlights.scm b/queries/highlights.scm index af38e25..9541314 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -24,6 +24,13 @@ ; Declarations {{{ (identifier) @variable + +(module + type: (identifier) @module) + +(module + (property + field: (identifier) @variable.member)) ; }}} ; vim: sw=2 foldmethod=marker diff --git a/test/highlight/modules.bp b/test/highlight/modules.bp new file mode 100644 index 0000000..248acdf --- /dev/null +++ b/test/highlight/modules.bp @@ -0,0 +1,21 @@ +foo {} +// <- module + +foo () +// <- module + +foo { +// <- module + field: 12, + // <- variable.member + another_field: 27, + // <- variable.member +} + +foo ( +// <- module + field = 42, + // <- variable.member + done = false, + // <- variable.member +)