From 425890a6fc1545d271bfcd866c08d8b58d69881d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 4 Jun 2022 21:29:27 +0200 Subject: [PATCH] Add methods high-lighting --- queries/highlights.scm | 7 ++++++- test/highlight/object-oriented.tig | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/queries/highlights.scm b/queries/highlights.scm index de56d2b..415dac3 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -75,7 +75,7 @@ ] @punctuation.bracket ; }}} -; Functions {{{ +; Functions and methods {{{ (function_call function: (identifier) @function) (function_declaration @@ -83,6 +83,11 @@ (primitive_declaration name: (identifier) @function) +(method_call + method: (identifier) @method) +(method_declaration + name: (identifier) @method) + (parameters name: (identifier) @variable.parameter) ; }}} diff --git a/test/highlight/object-oriented.tig b/test/highlight/object-oriented.tig index 94bfc91..bcacffa 100644 --- a/test/highlight/object-oriented.tig +++ b/test/highlight/object-oriented.tig @@ -13,6 +13,7 @@ let method meth() : int = self.a /* <- keyword */ + /* ^ method */ /* ^ variable */ } @@ -21,4 +22,7 @@ let in object.a := 27; /* ^ property */ + + object.meth() + /* ^ method */ end