Skip to content

Commit

Permalink
feat: Improve highlighting & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwh committed Apr 29, 2024
1 parent 4ff708e commit 0153006
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
4 changes: 4 additions & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
"->"
] @punctuation.special

(result
"_" @variable.parameter.builtin)


[
"/"
";"
Expand Down
46 changes: 42 additions & 4 deletions test/highlight/design-doc-interface.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>;
// ^ 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<string>; // no "err" type
// ^ keyword.type
// ^ type.definition
// ^ operator
// ^ type.builtin
// ^ type.builtin
// ^ punctuation.delimiter
type t7 = result<char, errno>; // 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<string>;
// ^ keyword.type
// ^ type.definition
// ^ operator
// ^ type.builtin
// ^ type.builtin
// ^ punctuation.delimiter
type t10 = t9;
// ^ keyword.type
// ^ type.definition
// ^ operator
// ^ type
// ^ punctuation.delimiter
}

0 comments on commit 0153006

Please sign in to comment.