From 01530063c31e9156a471b7fa0f04ce259f2d262e Mon Sep 17 00:00:00 2001 From: Liam Woodleigh-Hardinge Date: Fri, 26 Apr 2024 13:28:45 +0200 Subject: [PATCH] feat: Improve highlighting & tests --- queries/highlights.scm | 4 +++ test/highlight/design-doc-interface.wit | 46 ++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/queries/highlights.scm b/queries/highlights.scm index 983987b..b47c120 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -133,6 +133,10 @@ "->" ] @punctuation.special +(result + "_" @variable.parameter.builtin) + + [ "/" ";" diff --git a/test/highlight/design-doc-interface.wit b/test/highlight/design-doc-interface.wit index 8c1f199..fce9164 100644 --- a/test/highlight/design-doc-interface.wit +++ b/test/highlight/design-doc-interface.wit @@ -84,26 +84,64 @@ interface foo { // ^ type.definition // ^ operator // ^ type.builtin - // ^ punctuation.delimiter // ^ type.builtin // ^ punctuation.delimiter // ^ type.builtin - // ^ punctuation.delimiter - // ^ punctuation.bracket - // ^ keyword.type + // ^ punctuation.delimiter type t3 = string; // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ punctuation.delimiter type t4 = option; // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ type.builtin + // ^ punctuation.delimiter type t5 = result<_, errno>; // no "ok" type // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ variable.parameter.builtin + // ^ punctuation.delimiter + // ^ type + // ^ punctuation.delimiter type t6 = result; // no "err" type // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ type.builtin + // ^ punctuation.delimiter type t7 = result; // both types specified // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ type.builtin + // ^ type + // ^ punctuation.delimiter type t8 = result; // no "ok" or "err" type // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ punctuation.delimiter type t9 = list; // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type.builtin + // ^ type.builtin + // ^ punctuation.delimiter type t10 = t9; + // ^ keyword.type + // ^ type.definition + // ^ operator + // ^ type + // ^ punctuation.delimiter }