aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-12-24 10:00:20 +0100
committerChristian Clason <c.clason@uni-graz.at>2024-01-19 16:58:37 +0100
commit1ae9b0e4558fe7868f8cda2db65239cfb14836d0 (patch)
tree4eea14b40b8b81d9388fb35cbc9e35b341a75c98 /tests/query
parentchore(tests): consistent captures (diff)
downloadnvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar.gz
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar.bz2
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar.lz
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar.xz
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.tar.zst
nvim-treesitter-1ae9b0e4558fe7868f8cda2db65239cfb14836d0.zip
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
Diffstat (limited to 'tests/query')
-rw-r--r--tests/query/highlights/capnp/test.capnp28
-rw-r--r--tests/query/highlights/clojure/test.clj14
-rw-r--r--tests/query/highlights/cpp/concepts.cpp2
-rw-r--r--tests/query/highlights/cpp/enums-as-constants.cpp2
-rw-r--r--tests/query/highlights/cpp/test.cpp4
-rw-r--r--tests/query/highlights/ecma/test.ts8
-rw-r--r--tests/query/highlights/fusion/basic.fusion14
-rw-r--r--tests/query/highlights/fusion/expressions.fusion4
-rw-r--r--tests/query/highlights/gitattributes/test.gitattributes6
-rw-r--r--tests/query/highlights/gleam/assert.gleam2
-rw-r--r--tests/query/highlights/gleam/function.gleam20
-rw-r--r--tests/query/highlights/gleam/import.gleam16
-rw-r--r--tests/query/highlights/hack/as-foreach.hack2
-rw-r--r--tests/query/highlights/hack/generics.hack6
-rw-r--r--tests/query/highlights/hack/shapes.hack2
-rw-r--r--tests/query/highlights/hack/use.hack14
-rw-r--r--tests/query/highlights/haskell/test.hs124
-rw-r--r--tests/query/highlights/hocon/test.conf4
-rw-r--r--tests/query/highlights/markdown/test.md30
-rw-r--r--tests/query/highlights/nix/test.nix8
-rw-r--r--tests/query/highlights/python/fields.py6
-rw-r--r--tests/query/highlights/python/future_import.py4
-rw-r--r--tests/query/highlights/python/pattern_matching.py22
-rw-r--r--tests/query/highlights/python/raise_from.py4
-rw-r--r--tests/query/highlights/python/yield_from.py4
-rw-r--r--tests/query/highlights/r/test.r18
-rw-r--r--tests/query/highlights/rust/for.rs2
-rw-r--r--tests/query/highlights/rust/super-crate-imports.rs8
-rw-r--r--tests/query/highlights/smali/baksmali_test_class.smali26
-rw-r--r--tests/query/highlights/solidity/test.sol12
-rw-r--r--tests/query/highlights/t32/keywords.cmm20
-rw-r--r--tests/query/highlights/t32/literals.cmm10
-rw-r--r--tests/query/highlights/t32/var.cmm2
-rw-r--r--tests/query/highlights/tiger/functions.tig4
-rw-r--r--tests/query/highlights/tiger/identifiers.tig4
-rw-r--r--tests/query/highlights/tiger/imports.tig4
-rw-r--r--tests/query/highlights/tiger/keywords.tig12
-rw-r--r--tests/query/highlights/tiger/object-oriented.tig4
-rw-r--r--tests/query/highlights/typescript/as.ts4
-rw-r--r--tests/query/highlights/usd/prims.usda18
-rw-r--r--tests/query/highlights/usd/properties.usda6
-rw-r--r--tests/query/highlights/usd/subLayers.usda2
-rw-r--r--tests/query/highlights/wing/class.w2
-rw-r--r--tests/query/highlights/wing/nested_method.w2
-rw-r--r--tests/query/highlights/xhp-intro.hack2
45 files changed, 256 insertions, 256 deletions
diff --git a/tests/query/highlights/capnp/test.capnp b/tests/query/highlights/capnp/test.capnp
index 9ba376c7d..ce12b07ac 100644
--- a/tests/query/highlights/capnp/test.capnp
+++ b/tests/query/highlights/capnp/test.capnp
@@ -20,15 +20,15 @@
# THE SOFTWARE.
@0xd508eebdc2dc42b8;
-# <- @preproc
+# <- @keyword.directive
# ^ @punctuation.delimiter
using Cxx = import "c++.capnp";
-# <- @include
+# <- @keyword.import
# ^^^ @type
# ^ @operator
-# ^^^^^^ @include
-# ^^^^^^^^^^^ @string
+# ^^^^^^ @keyword.import
+# ^^^^^^^^^^^ @string.special.path
# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified
# names for stuff in the capnproto namespace.
@@ -53,7 +53,7 @@ enum TestEnum {
struct TestAllTypes {
# <- @keyword
voidField @0 : Void;
-# ^^^^^^^^^ @field
+# ^^^^^^^^^ @variable.member
# ^ @punctuation.special
# ^^^^ @type.builtin
boolField @1 : Bool;
@@ -150,7 +150,7 @@ struct TestUnionDefaults {
struct TestUsing {
using OuterNestedEnum = TestNestedTypes.NestedEnum;
-# ^^^^^ @include
+# ^^^^^ @keyword.import
using TestNestedTypes.NestedStruct.NestedEnum;
outerNestedEnum @1 :OuterNestedEnum = bar;
@@ -179,7 +179,7 @@ struct TestWholeFloatDefault {
bigField @1 :Float32 = 2e30;
const constant :Float32 = 456;
const bigConstant :Float32 = 4e30;
-# ^^^^ @float
+# ^^^^ @number.float
}
struct TestGenerics(Foo, Bar) {
@@ -217,7 +217,7 @@ struct TestGenerics(Foo, Bar) {
# ^^^^^^^^^ @keyword
# At one time this failed to compile.
call @0 () -> ();
-# ^^^^ @method
+# ^^^^ @function.method
# ^^ @punctuation.delimiter
}
}
@@ -225,14 +225,14 @@ struct TestGenerics(Foo, Bar) {
interface Interface(Qux) {
call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));
-# ^^^ @parameter
-# ^^^ @parameter
+# ^^^ @variable.parameter
+# ^^^ @variable.parameter
}
annotation ann(struct) :Foo;
# ^^^^^^^^^^ @keyword
-# ^^^ @method
-# ^^^^^^ @parameter.builtin
+# ^^^ @function.method
+# ^^^^^^ @variable.parameter.builtin
using AliasFoo = Foo;
using AliasInner = Inner;
@@ -423,7 +423,7 @@ const genericConstant :TestGenerics(TestAllTypes, Text) =
(foo = (int16Field = 123), rev = (foo = "text", rev = (foo = (int16Field = 321))));
const embeddedData :Data = embed "testdata/packed";
-# ^^^^^ @include
+# ^^^^^ @keyword.import
const embeddedText :Text = embed "testdata/short.txt";
const embeddedStruct :TestAllTypes = embed "testdata/binary";
@@ -452,7 +452,7 @@ const anyPointerConstants :TestAnyPointerConstants = (
interface TestInterface {
foo @0 (i :UInt32, j :Bool) -> (x :Text);
-# ^ @parameter
+# ^ @variable.parameter
bar @1 () -> ();
baz @2 (s: TestAllTypes);
}
diff --git a/tests/query/highlights/clojure/test.clj b/tests/query/highlights/clojure/test.clj
index f40e9b0c4..5c9ca649b 100644
--- a/tests/query/highlights/clojure/test.clj
+++ b/tests/query/highlights/clojure/test.clj
@@ -1,7 +1,7 @@
(ns test {:clj-kondo/ignore true})
; <- @punctuation.bracket
-; ^ @include
-; ^ @namespace
+; ^ @keyword.import
+; ^ @module
; asdf
;^^^^^^ @comment
@@ -19,7 +19,7 @@
; ^ ^^ ^^ @variable.builtin
&
-;^ @parameter
+;^ @variable.parameter
->abc
;^^^^^ @constructor
@@ -31,16 +31,16 @@
;^^ ^^ ^^ ^^ @variable.builtin
(.method)
-;^^^^^^^ @method
+;^^^^^^^ @function.method
(.-field)
-;^^^^^^^ @field
+;^^^^^^^ @variable.member
Abc/method
-;^^^^^^^^^^ @field
+;^^^^^^^^^^ @variable.member
(Abc/method)
-;^^^^^^^^^^ @method
+;^^^^^^^^^^ @function.method
Abc
;^^^ @type
diff --git a/tests/query/highlights/cpp/concepts.cpp b/tests/query/highlights/cpp/concepts.cpp
index 6fe6af436..09d975c98 100644
--- a/tests/query/highlights/cpp/concepts.cpp
+++ b/tests/query/highlights/cpp/concepts.cpp
@@ -7,7 +7,7 @@ concept Derived = std::is_base_of<U, T>::value;
template<typename T>
concept Hashable = requires(T a) {
// ^ @keyword
-// ^ @parameter
+// ^ @variable.parameter
// ^ @type
{ std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
typename CommonType<T, U>; // CommonType<T, U> is valid and names a type
diff --git a/tests/query/highlights/cpp/enums-as-constants.cpp b/tests/query/highlights/cpp/enums-as-constants.cpp
index ae773e8d3..d6b93d5ec 100644
--- a/tests/query/highlights/cpp/enums-as-constants.cpp
+++ b/tests/query/highlights/cpp/enums-as-constants.cpp
@@ -11,7 +11,7 @@ void foo(Foo f){
switch ( f ) {
case Foo::a:
// ^ @type
- // ^ @namespace
+ // ^ @module
// ^ @constant
break;
case Foo::aa:
diff --git a/tests/query/highlights/cpp/test.cpp b/tests/query/highlights/cpp/test.cpp
index 3f903a55f..4a4c6238a 100644
--- a/tests/query/highlights/cpp/test.cpp
+++ b/tests/query/highlights/cpp/test.cpp
@@ -1,11 +1,11 @@
#include <iostream>
#include <cstdlib>
-// ^ @include
+// ^ @keyword.import
// ^ @string
auto main( int argc, char** argv ) -> int
// ^ @type.builtin
- // ^ @parameter
+ // ^ @variable.parameter
// ^ @type.builtin
// ^ @type.builtin
// ^ @operator
diff --git a/tests/query/highlights/ecma/test.ts b/tests/query/highlights/ecma/test.ts
index 9ecd50c76..ecdfa8929 100644
--- a/tests/query/highlights/ecma/test.ts
+++ b/tests/query/highlights/ecma/test.ts
@@ -6,21 +6,21 @@ class H {
// ^ @property
#private_method() {
- // ^ @method
+ // ^ @function.method
return `${this.pub_field} -- ${this.#priv_field}`;
// ^ @property
// ^ @property
}
public_method() {
- // ^ @method
+ // ^ @function.method
return this.#private_method();
- // ^ @method.call
+ // ^ @function.method.call
}
ok() {
return this.public_method();
- // ^ @method.call
+ // ^ @function.method.call
}
}
diff --git a/tests/query/highlights/fusion/basic.fusion b/tests/query/highlights/fusion/basic.fusion
index e63c86eea..16b99f431 100644
--- a/tests/query/highlights/fusion/basic.fusion
+++ b/tests/query/highlights/fusion/basic.fusion
@@ -1,12 +1,12 @@
include: SomeFile.fusion
-//<- @include
-// ^ @text.uri
+//<- @keyword.import
+// ^ @string.special.url
namespace: ns = Neos.Fusion.Space
//<- @keyword
-// ^ @namespace
+// ^ @module
// ^ @operator
-// ^ @namespace
+// ^ @module
prototype(MyType) < prototype(ns:SuperType) {
//<-keyword
@@ -14,7 +14,7 @@ prototype(MyType) < prototype(ns:SuperType) {
// ^ @type
// ^ @punctuation.bracket
// ^ @operator
-// ^ @namespace
+// ^ @module
// ^ @type
deleteProp >
@@ -48,12 +48,12 @@ prototype(MyType) < prototype(ns:SuperType) {
property.aliasedType = ns:SomeType
//<- @property
- // ^ @namespace
+ // ^ @module
// ^ @type
property.fullQualifiedType = SomeNamespace:SomeType
//<- @property
- // ^ @namespace
+ // ^ @module
// ^ @type
}
diff --git a/tests/query/highlights/fusion/expressions.fusion b/tests/query/highlights/fusion/expressions.fusion
index ae6e2db33..b1822dda8 100644
--- a/tests/query/highlights/fusion/expressions.fusion
+++ b/tests/query/highlights/fusion/expressions.fusion
@@ -76,7 +76,7 @@ logic = ${!foo && !(bar || baz) and not 'string'}
// ^operator
ternary = ${ check ? true : false}
-// ^@conditional.ternary
-// ^@conditional.ternary
+// ^@keyword.conditional.ternary
+// ^@keyword.conditional.ternary
diff --git a/tests/query/highlights/gitattributes/test.gitattributes b/tests/query/highlights/gitattributes/test.gitattributes
index a16c233e6..4595b94f2 100644
--- a/tests/query/highlights/gitattributes/test.gitattributes
+++ b/tests/query/highlights/gitattributes/test.gitattributes
@@ -1,5 +1,5 @@
[attr]nodiff -diff -merge
-# <- @preproc
+# <- @keyword.directive
# ^^^^^^ @property
# ^ @operator
# ^^^^ @variable.builtin
@@ -9,7 +9,7 @@
vendor/** linguist-vendored=true
# ^ @punctuation.delimiter
# ^^ @character.special
-# ^^^^^^^^^^^^^^^^^ @parameter
+# ^^^^^^^^^^^^^^^^^ @variable.parameter
# ^ @operator
# ^^^^ @boolean
@@ -22,7 +22,7 @@ vendor/** linguist-vendored=true
# ^^^^^^^^^ @constant
# ^ @punctuation.bracket
# ^ @operator
-# ^^^^^^^^^^ @parameter
+# ^^^^^^^^^^ @variable.parameter
"_\u4E00\t\56txt" encoding=UTF-16
# <- @punctuation.special
diff --git a/tests/query/highlights/gleam/assert.gleam b/tests/query/highlights/gleam/assert.gleam
index d36716a3f..8be39923d 100644
--- a/tests/query/highlights/gleam/assert.gleam
+++ b/tests/query/highlights/gleam/assert.gleam
@@ -1,6 +1,6 @@
pub fn main() {
assert Ok(i) = parse_int("123")
- // <- @exception
+ // <- @keyword.exception
// ^^ @constructor
// ^ @punctuation.bracket
// ^ @variable
diff --git a/tests/query/highlights/gleam/function.gleam b/tests/query/highlights/gleam/function.gleam
index aed4879dc..ff2b690ca 100644
--- a/tests/query/highlights/gleam/function.gleam
+++ b/tests/query/highlights/gleam/function.gleam
@@ -3,11 +3,11 @@ pub fn add(x: Int, y: Int) -> Int {
// ^^ @keyword.function
// ^^^ @function
// ^ @punctuation.bracket
-// ^ @parameter
+// ^ @variable.parameter
// ^ @punctuation.delimiter
// ^^^ @type.builtin
// ^ @punctuation.delimiter
-// ^ @parameter
+// ^ @variable.parameter
// ^ @punctuation.delimiter
// ^^^ @type.builtin
// ^ @punctuation.bracket
@@ -22,7 +22,7 @@ pub fn twice(f: fn(t) -> t, x: t) -> t {
// ^ @keyword.function
// ^^^^^ @function
// ^ @punctuation.bracket
-// ^ @parameter
+// ^ @variable.parameter
// ^ @punctuation.delimiter
// ^^ @keyword.function
// ^ @punctuation.bracket
@@ -31,7 +31,7 @@ pub fn twice(f: fn(t) -> t, x: t) -> t {
// ^^ @punctuation.delimiter
// ^ @type
// ^ @punctuation.delimiter
-// ^ @parameter
+// ^ @variable.parameter
// ^ @punctuation.delimiter
// ^ @type
// ^ @punctuation.bracket
@@ -45,7 +45,7 @@ fn list_of_two(my_value: a) -> List(a) {
// <- @keyword.function
// ^ @function
// ^ @punctuation.bracket
-// ^ @parameter
+// ^ @variable.parameter
// ^ @punctuation.delimiter
// ^ @type
// ^ @punctuation.bracket
@@ -64,19 +64,19 @@ fn replace(
// ^ @punctuation.bracket
in string: String,
// <- @label
- // ^^^^^^ @parameter
+ // ^^^^^^ @variable.parameter
// ^ @punctuation.delimiter
// ^^^^^^ @type.builtin
// ^ @punctuation.delimiter
each pattern: String,
// <- @label
- // ^^^^^^^ @parameter
+ // ^^^^^^^ @variable.parameter
// ^ @punctuation.delimiter
// ^^^^^^ @type.builtin
// ^ @punctuation.delimiter
with replacement: String,
// <- @label
- // ^^^^^^^^^^^ @parameter
+ // ^^^^^^^^^^^ @variable.parameter
// ^ @punctuation.delimiter
// ^^^^^^ @type.builtin
// ^ @punctuation.delimiter
@@ -109,7 +109,7 @@ pub external fn random_float() -> Float = "rand" "uniform"
// ^^ @punctuation.delimiter
// ^^^^^ @type.builtin
// ^ @operator
-// ^^^^^^ @namespace
+// ^^^^^^ @module
// ^^^^^^^^^ @function
pub external fn inspect(a) -> a = "Elixir.IO" "inspect"
@@ -123,5 +123,5 @@ pub external fn inspect(a) -> a = "Elixir.IO" "inspect"
// ^^ @punctuation.delimiter
// ^ @type
// ^ @operator
-// ^^^^^^^^^^^ @namespace
+// ^^^^^^^^^^^ @module
// ^^^^^^^^^ @function
diff --git a/tests/query/highlights/gleam/import.gleam b/tests/query/highlights/gleam/import.gleam
index 3ee141513..ac452d157 100644
--- a/tests/query/highlights/gleam/import.gleam
+++ b/tests/query/highlights/gleam/import.gleam
@@ -1,18 +1,18 @@
import gleam/io
-// <- @include
-// ^ @namespace
+// <- @keyword.import
+// ^ @module
// ^ @operator
-// ^ @namespace
+// ^ @module
import cat as kitten
-// <- @include
-// ^ @namespace
+// <- @keyword.import
+// ^ @module
// ^ @keyword
-// ^ @namespace
+// ^ @module
import animal/cat.{Cat, stroke}
-// <- @include
-// ^ @namespace
+// <- @keyword.import
+// ^ @module
// ^ @operator
// ^ @punctuation.delimiter
// ^ @punctuation.bracket
diff --git a/tests/query/highlights/hack/as-foreach.hack b/tests/query/highlights/hack/as-foreach.hack
index d7a66875b..611027131 100644
--- a/tests/query/highlights/hack/as-foreach.hack
+++ b/tests/query/highlights/hack/as-foreach.hack
@@ -1,5 +1,5 @@
foreach (($array as vec[]) as $item) {}
-// ^ @repeat
+// ^ @keyword.repeat
// ^ @type
# Our expectation test for the code below intentionally includes an ERROR.
diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack
index 66b008aa4..fc41a86a9 100644
--- a/tests/query/highlights/hack/generics.hack
+++ b/tests/query/highlights/hack/generics.hack
@@ -7,15 +7,15 @@ class Box<T> {
public function __construct(T $data) {
// ^ @type
- // ^ @parameter
+ // ^ @variable.parameter
// ^ @keyword.function
// ^ @type.qualifier
- // ^ @method
+ // ^ @function.method
$this->data = $data;
}
public function getData(): T {
- // ^ @method
+ // ^ @function.method
// ^ @type.qualifier
return $this->data;
// ^ @operator
diff --git a/tests/query/highlights/hack/shapes.hack b/tests/query/highlights/hack/shapes.hack
index bc8732433..f111689d0 100644
--- a/tests/query/highlights/hack/shapes.hack
+++ b/tests/query/highlights/hack/shapes.hack
@@ -1,7 +1,7 @@
class C extends Superclass implements Iface {
// ^ @keyword ^ @keyword
use Trait;
- // <- @include
+ // <- @keyword.import
const type X = shape(
// <- @keyword ^ @type.builtin
"a" => int,
diff --git a/tests/query/highlights/hack/use.hack b/tests/query/highlights/hack/use.hack
index 353838a18..0b1fde364 100644
--- a/tests/query/highlights/hack/use.hack
+++ b/tests/query/highlights/hack/use.hack
@@ -8,21 +8,21 @@ use type Space\Type\T;
// ^ @keyword
use namespace Space\Name\N as M;
// ^ @keyword
-// ^ @namespace
+// ^ @module
use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,;
-// ^ @namespace
+// ^ @module
// ^ @type
use namespace Space\Name\N10\{A as A2, B\};
-// ^ @namespace
-// ^ @namespace
-// ^ @namespace
+// ^ @module
+// ^ @module
+// ^ @module
use namespace Space\Name\{\C, Slash as Forward};
use \What\Is\This\{function A as A2, B, const H\S\L as stdlib, function F};
use type \{kind,};
use Q\B\{kind2,};
-// ^ @namespace
+// ^ @module
use type Q\B\{kind3,};
-// <- @include
+// <- @keyword.import
diff --git a/tests/query/highlights/haskell/test.hs b/tests/query/highlights/haskell/test.hs
index bf7e939a0..7734a448b 100644
--- a/tests/query/highlights/haskell/test.hs
+++ b/tests/query/highlights/haskell/test.hs
@@ -1,33 +1,33 @@
{-# LANGUAGE QuasiQuotes #-}
--- ^ @preproc
+-- ^ @keyword.directive
module Main
--- ^ @include
- -- ^ @namespace
+-- ^ @keyword.import
+ -- ^ @module
( main
) where
-- ^ @keyword
import Prelude hiding (show)
--- ^ @include
- -- ^ @namespace
+-- ^ @keyword.import
+ -- ^ @module
-- ^ @keyword
-- ^ @variable
import Data.Map (fromList)
- -- ^ @namespace
+ -- ^ @module
import qualified Data.Map as Map
-- ^ @constructor
- -- ^ @namespace
+ -- ^ @module
import qualified Chronos
- -- ^ @namespace
+ -- ^ @module
import qualified Chronos as C
-- ^ @constructor
- -- ^ @namespace
+ -- ^ @module
import FooMod (BarTy (barField))
- -- ^ @field
+ -- ^ @variable.member
x = mempty { field = 5 }
- -- ^ @field
+ -- ^ @variable.member
data ADT
-- ^ @keyword
@@ -62,31 +62,31 @@ newtype Rec
-- ^ @constructor
{ field :: Double
-- ^ @punctuation.bracket
- -- ^ @field
+ -- ^ @variable.member
-- ^ @type
}
-- ^ @punctuation.bracket
deriving Eq
-- ^ @type
recordWildCard Rec { field } = field
- -- ^ @field
+ -- ^ @variable.member
recordDotSyntax rec = rec.field
- -- ^ @field
+ -- ^ @variable.member
main :: IO ()
-- ^ @function
-- ^ @operator
-- ^ @type
- -- ^ @symbol
+ -- ^ @string.special.symbol
main = undefined
-- ^ @function
- -- ^ @exception
+ -- ^ @keyword.exception
someFunc0 :: Int -> Int
-- ^ @operator
someFunc0 x = someFunc1 x
- -- ^ @parameter
+ -- ^ @variable.parameter
-- ^ @function.call
where
-- ^ @keyword
@@ -94,9 +94,9 @@ someFunc0 x = someFunc1 x
-- ^ @function
-- ^ @number
scopedTypeParam (x :: Int) = someFunc x
- -- ^ @parameter
+ -- ^ @variable.parameter
scopedTypeParam (Just x :: Int) = someFunc x
- -- ^ @parameter
+ -- ^ @variable.parameter
someInfix :: Integral a => a -> Double
-- ^ @type
@@ -118,7 +118,7 @@ someInfix x = fromIntegral x `myAdd` floatVal
-- ^ @variable
floatVal = 5.5
-- ^ @variable
- -- ^ @float
+ -- ^ @number.float
intVal :: Int
-- ^ @variable
intVal = getInt 5
@@ -138,12 +138,12 @@ someInfix x = fromIntegral x `myAdd` floatVal
isInt :: Either Double Int -> Bool
-- ^ @function
isInt eith@Left{} = False
- -- ^ @parameter
+ -- ^ @variable.parameter
isInt eith@(Left x) = False
-- ^ @function
- -- ^ @parameter
+ -- ^ @variable.parameter
isInt (Left x) = False
- -- ^ @parameter
+ -- ^ @variable.parameter
isInt (Right _) = True
-- ^ @function
@@ -153,19 +153,19 @@ someIOaction = do
-- ^ @keyword
foo <- SomeModule.someFun <$> getArgs
-- ^ @variable
- -- ^ @namespace
+ -- ^ @module
-- ^ @function.call
-- ^ @operator
_ <- someFunc0 =<< someIOAction
-- ^ @function.call
let bar = SomeModule.doSomething $ "a" "b"
-- ^ @variable
- -- ^ @namespace
+ -- ^ @module
-- ^ @function.call
-- ^ @operator
func x y = x + y - 7
-- ^ @function
- -- ^ @parameter
+ -- ^ @variable.parameter
-- ^ @variable
-- ^ @variable
gunc x y = func x $ y + 7
@@ -216,26 +216,26 @@ condVal = if otherwise
else True
getLambda x = \y -> x `SomeModule.someInfix` y
- -- ^ @parameter
- -- ^ @namespace
+ -- ^ @variable.parameter
+ -- ^ @module
-- ^ @operator
lambdaTyped = \(y :: Int) -> x
- -- ^ @parameter
+ -- ^ @variable.parameter
lambdaPattern = \(Just x) -> x
- -- ^ @parameter
+ -- ^ @variable.parameter
lambdaPatternTyped = \(Just x :: Int) -> x
- -- ^ @parameter
+ -- ^ @variable.parameter
isVowel = (`elem` "AEIOU")
-- ^ @operator
isVowelQualified = (`SomeModule.elem` "AEIOU")
- -- ^ @namespace
+ -- ^ @module
-- ^ @operator
hasVowels = ("AEIOU" `elem`)
-- ^ @operator
hasVowelsQualified = ("AEIOU" `SomeModule.elem`)
- -- ^ @namespace
+ -- ^ @module
-- ^ @operator
quasiQuotedString = [qq|Some string|]
@@ -243,7 +243,7 @@ quasiQuotedString = [qq|Some string|]
-- ^ @function.call
-- ^ @string
quasiQuotedString2 = [SomeModule.qq|Some string|]
- -- ^ @namespace
+ -- ^ @module
-- ^ @function.call
composition f g = f . g
@@ -270,42 +270,42 @@ appliedComposition f g var = (NS.f . NS.g) var
-- ^ @function.call
-- ^ @function.call
param1 |*| param2 = Qu $ param1 * param2
--- ^ @parameter
- -- ^ @parameter
+-- ^ @variable.parameter
+ -- ^ @variable.parameter
(param1 :: Int) |*| (param2 :: Int) = Qu $ param1 * param2
--- ^ @parameter
- -- ^ @parameter
+-- ^ @variable.parameter
+ -- ^ @variable.parameter
(Qu a) |/| (SomeModule.Qu b) = a / b
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
(Qu a :: Int) |/| (SomeModule.Qu b :: Int) = a / b
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
(Qu a, b, c :: Int) |/| x = undefined
- -- ^ @parameter
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
[Qu a, b, c :: Int] >< x = undefined
- -- ^ @parameter
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
listParam [a, b :: Int, Just c] = undefined
- -- ^ @parameter
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
tupleParam (a :: Int, b, Just c) = undefined
- -- ^ @parameter
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
listLambda = \[a, a :: Int, Just c] -> undefined
- -- ^ @parameter
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
tupleLambda = \(a, b :: Int, Just c) -> undefined
- -- ^ @parameter
- -- ^ @parameter
+ -- ^ @variable.parameter
+ -- ^ @variable.parameter
nestedDestructure (Left (Just a)) = undefined
- -- ^ @parameter
+ -- ^ @variable.parameter
typeApplication x y = someFun @ty x y
-- ^ @variable
-- ^ @variable
@@ -317,9 +317,9 @@ recordUpdate x y rec = someFun rec {field = 5} (x, x) y
-- ^ @variable
viewPattern (func -> var) = 5
-- ^ @function.call
- -- ^ @parameter
+ -- ^ @variable.parameter
g (func :: a -> b) x = func y
- -- ^ @parameter
+ -- ^ @variable.parameter
-- ^ @function
lambdaAlias :: LambdaAlias
lambdaAlias _ _ _ = undefined
diff --git a/tests/query/highlights/hocon/test.conf b/tests/query/highlights/hocon/test.conf
index acfe4f975..55f4c03e7 100644
--- a/tests/query/highlights/hocon/test.conf
+++ b/tests/query/highlights/hocon/test.conf
@@ -1,5 +1,5 @@
HOCON = Human-Optimized Config Object Notation
-// ^ @field
+// ^ @variable.member
// ^ @string
// ^ @string
// ^ @string
@@ -31,7 +31,7 @@ specs url: "https://github.com/lightbend/config/blob/master/HOCON.md"
includes: {
include required(file("~/prog/tree-sitter-hocon/grammar.js"))
// ^ @keyword
-//^ @include
+//^ @keyword.import
// ^ @punctuation.bracket
// ^ @punctuation.bracket
override = true
diff --git a/tests/query/highlights/markdown/test.md b/tests/query/highlights/markdown/test.md
index 20953a863..87b28520e 100644
--- a/tests/query/highlights/markdown/test.md
+++ b/tests/query/highlights/markdown/test.md
@@ -1,28 +1,28 @@
# H1
-<!-- <- @text.title.1.marker -->
+<!-- <- @markup.heading.1.marker -->
## H2
-<!-- <- @text.title.2.marker -->
+<!-- <- @markup.heading.2.marker -->
- Item 1
- Item 2
-<!-- <- @punctuation.special -->
+<!-- <- @markup.list -->
1. Item 1
2. Item 2
-<!-- <- @punctuation.special -->
+<!-- <- @markup.list -->
----![image_description](https://example.com/image.jpg "awesome image title")
-<!-- ^ @text.reference -->
-<!-- ^ @text.uri -->
-<!-- ^ @text.literal -->
-<!--^ @punctuation.special -->
-<!-- ^ @punctuation.bracket -->
-<!-- ^ @punctuation.bracket -->
+<!-- ^ @markup.link.label -->
+<!-- ^ @markup.link.url -->
+<!-- ^ @markup.link.label -->
+<!--^ @markup.link -->
+<!-- ^ @markup.link -->
+<!-- ^ @markup.link -->
[link_text](#local_reference "link go brr...")
-<!-- ^ @text.reference -->
-<!-- ^ @text.uri -->
-<!-- ^ @text.literal -->
-<!-- <- @punctuation.bracket -->
-<!-- ^ @punctuation.bracket -->
+<!-- ^ @markup.link.label -->
+<!-- ^ @markup.link.url -->
+<!-- ^ @markup.link.label -->
+<!-- <- @markup.link -->
+<!-- ^ @markup.link -->
diff --git a/tests/query/highlights/nix/test.nix b/tests/query/highlights/nix/test.nix
index d5fb13de8..8ab067a2e 100644
--- a/tests/query/highlights/nix/test.nix
+++ b/tests/query/highlights/nix/test.nix
@@ -1,16 +1,16 @@
{
func1 = param: builtins.readFile param;
# ^ @function
- # ^ @parameter
+ # ^ @variable.parameter
# ^ @constant.builtin
# ^ @function.builtin
func2 = { p1, p2 }: p2;
# ^ @function
- # ^ @parameter
+ # ^ @variable.parameter
readFile' = readFile;
# ^ @function.builtin
x = func1 ./path/to/file.nix;
-# ^ @field
+# ^ @variable.member
# ^ @function.call
- # ^ @string.special
+ # ^ @string.special.path
}
diff --git a/tests/query/highlights/python/fields.py b/tests/query/highlights/python/fields.py
index fb36a6311..deb280622 100644
--- a/tests/query/highlights/python/fields.py
+++ b/tests/query/highlights/python/fields.py
@@ -3,10 +3,10 @@ class Fields:
# ^^^ @type.builtin
# ^^^^ @constant.builtin
self.fields = fields
-# ^^^^^^ @field
+# ^^^^^^ @variable.member
self.__dunderfield__ = None
-# ^^^^^^^^^^^^^^^ @field
+# ^^^^^^^^^^^^^^^ @variable.member
self._FunKyFielD = 0
-# ^^^^^^^^^^^ @field
+# ^^^^^^^^^^^ @variable.member
self.NOT_A_FIELD = "IM NOT A FIELD"
# ^^^^^^^^^^^ @constant
diff --git a/tests/query/highlights/python/future_import.py b/tests/query/highlights/python/future_import.py
index 7495588a9..6790b9b6b 100644
--- a/tests/query/highlights/python/future_import.py
+++ b/tests/query/highlights/python/future_import.py
@@ -1,4 +1,4 @@
from __future__ import print_function
-# ^ @include
+# ^ @keyword.import
# ^ @constant.builtin
-# ^ @include
+# ^ @keyword.import
diff --git a/tests/query/highlights/python/pattern_matching.py b/tests/query/highlights/python/pattern_matching.py
index cd359a48f..2762781b0 100644
--- a/tests/query/highlights/python/pattern_matching.py
+++ b/tests/query/highlights/python/pattern_matching.py
@@ -1,29 +1,29 @@
match command.split():
-# ^ @conditional
+# ^ @keyword.conditional
case ["quit"]:
- # ^ @conditional
+ # ^ @keyword.conditional
print("Goodbye!")
quit_game()
case ["look"]:
- # ^ @conditional
+ # ^ @keyword.conditional
current_room.describe()
case ["get", obj]:
- # ^ @conditional
+ # ^ @keyword.conditional
character.get(obj, current_room)
case ["go", direction]:
- # ^ @conditional
+ # ^ @keyword.conditional
current_room = current_room.neighbor(direction)
# The rest of your commands go here
match command.split():
-# ^ @conditional
+# ^ @keyword.conditional
case ["drop", *objects]:
- # ^ @conditional
+ # ^ @keyword.conditional
for obj in objects:
character.drop(obj, current_room)
match command.split():
-# ^ @conditional
+# ^ @keyword.conditional
case ["quit"]: ... # Code omitted for brevity
case ["go", direction]: pass
case ["drop", *objects]: pass
@@ -32,12 +32,12 @@ match command.split():
# ^^ @@function.macro
match command.split():
-# ^ @conditional
+# ^ @keyword.conditional
case ["north"] | ["go", "north"]:
- # ^ @conditional
+ # ^ @keyword.conditional
current_room = current_room.neighbor("north")
case ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"]:
- # ^ @conditional
+ # ^ @keyword.conditional
pass
match = 2
diff --git a/tests/query/highlights/python/raise_from.py b/tests/query/highlights/python/raise_from.py
index 8a48a222b..fb30f4252 100644
--- a/tests/query/highlights/python/raise_from.py
+++ b/tests/query/highlights/python/raise_from.py
@@ -2,5 +2,5 @@ try:
print(1 / 0)
except Exception:
raise RuntimeError from None
- # ^ @exception
- # ^ @exception
+ # ^ @keyword.exception
+ # ^ @keyword.exception
diff --git a/tests/query/highlights/python/yield_from.py b/tests/query/highlights/python/yield_from.py
index 2f3238379..6ada002c6 100644
--- a/tests/query/highlights/python/yield_from.py
+++ b/tests/query/highlights/python/yield_from.py
@@ -1,6 +1,6 @@
from foo import bar
-# ^ @include
-# ^ @include
+# ^ @keyword.import
+# ^ @keyword.import
def generator():
yield from bar(42)
# ^ @keyword.return
diff --git a/tests/query/highlights/r/test.r b/tests/query/highlights/r/test.r
index b6bfd1ff5..c67df6096 100644
--- a/tests/query/highlights/r/test.r
+++ b/tests/query/highlights/r/test.r
@@ -1,7 +1,7 @@
init <- 1
# ^ @variable
# ^ @operator
-# ^ @float
+# ^ @number.float
r"{(\1\2)}" -> `%r%`
# ^ @string
@@ -21,27 +21,27 @@ b <- list(TRUE, FALSE, NA, Inf)
# ^ @constant.builtin
b <- list(name = "r", version = R.version$major)
-# ^ @parameter
+# ^ @variable.parameter
# ^ @string
# ^ @operator
-# ^ @field
+# ^ @variable.member
Lang$new(name = "r")$print()
-# ^ @method.call
+# ^ @function.method.call
for(i in 1:10) {
-# <- @repeat
-# ^ @repeat
+# <- @keyword.repeat
+# ^ @keyword.repeat
}
add <- function(a, b = 1, ...) {
# ^ @keyword.function
-# ^ @parameter
-# ^ @parameter
+# ^ @variable.parameter
+# ^ @variable.parameter
# ^ @keyword
return(a + b)
}
base::letters
-# ^ @namespace
+# ^ @module
# ^ @variable
diff --git a/tests/query/highlights/rust/for.rs b/tests/query/highlights/rust/for.rs
index 27f072847..e8c085fa3 100644
--- a/tests/query/highlights/rust/for.rs
+++ b/tests/query/highlights/rust/for.rs
@@ -9,7 +9,7 @@ impl Drop for Foo {
fn main() {
for i in 0..128 {
- // <- @repeat
+ // <- @keyword.repeat
println!("{i}");
}
}
diff --git a/tests/query/highlights/rust/super-crate-imports.rs b/tests/query/highlights/rust/super-crate-imports.rs
index 59354a32c..93263098e 100644
--- a/tests/query/highlights/rust/super-crate-imports.rs
+++ b/tests/query/highlights/rust/super-crate-imports.rs
@@ -1,12 +1,12 @@
use crate::a;
-// ^ @namespace
+// ^ @module
// ^ !keyword
use crate::{b, c};
-// ^ @namespace
+// ^ @module
// ^ !keyword
use super::a;
-// ^ @namespace
+// ^ @module
// ^ !keyword
use super::{b, c};
-// ^ @namespace
+// ^ @module
// ^ !keyword
diff --git a/tests/query/highlights/smali/baksmali_test_class.smali b/tests/query/highlights/smali/baksmali_test_class.smali
index 77eb0c83b..6412f8784 100644
--- a/tests/query/highlights/smali/baksmali_test_class.smali
+++ b/tests/query/highlights/smali/baksmali_test_class.smali
@@ -7,18 +7,18 @@
# ^ @punctuation.delimiter
.source "baksmali_test_class.smali"
-# <- @include
+# <- @keyword.import
.implements Lsome/interface;
.implements Lsome/other/interface;
.annotation build Lsome/annotation;
-# ^^^^^ @storageclass
+# ^^^^^ @keyword.storage
# ^^^^ @type
# ^ @punctuation.delimiter
value1 = "test"
-# ^^^^^^ @field
+# ^^^^^^ @variable.member
# ^ @operator
# ^^^^^^ @string
value2 = .subannotation Lsome/annotation;
@@ -50,7 +50,7 @@
.field public static byteNegStaticField:B = 0xAAt
.field public static floatStaticField:F = 3.1415926f
-# ^^^^^^^^^^ @float
+# ^^^^^^^^^^ @number.float
.field public static doubleStaticField:D = 3.141592653589793
@@ -73,7 +73,7 @@
.field public static methodStaticField:Ljava/lang/reflect/Method; = Lbaksmali/test/class;->testMethod(ILjava/lang/String;)Ljava/lang/String;
# ^^ @punctuation.delimiter
-# ^^^^^^^^^^ @method.call
+# ^^^^^^^^^^ @function.method.call
.field public static arrayStaticField:[I = {1, 2, 3, {1, 2, 3, 4}}
# ^ @punctuation.special
@@ -81,7 +81,7 @@
# ^ @punctuation.delimiter
.field public static enumStaticField:Lsome/enum; = .enum Lsome/enum;->someEnumValue:Lsome/enum;
-# ^^^^^^^^^^^^^ @field
+# ^^^^^^^^^^^^^ @variable.member
.field public static annotationStaticField:Lsome/annotation; = .subannotation Lsome/annotation;
value1 = "test"
@@ -93,7 +93,7 @@
.field public static staticFieldWithAnnotation:I
.annotation runtime La/field/annotation;
-# ^^^^^^^ @storageclass
+# ^^^^^^^ @keyword.storage
this = "is"
a = "test"
.end annotation
@@ -112,13 +112,13 @@
.registers 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
# ^^^^^^^^^^^^^ @keyword.operator
-# ^^ @parameter.builtin
+# ^^ @variable.parameter.builtin
return-void
# ^^^^^^^^^^^ @keyword.return
.end method
.method public testMethod(ILjava/lang/String;)Ljava/lang/String;
-# ^^^^^^^^^^ @method
+# ^^^^^^^^^^ @function.method
.registers 3
.annotation runtime Lorg/junit/Test;
.end annotation
@@ -144,9 +144,9 @@
nop
try_end:
.catch Ljava/lang/Exception; {try_start: .. try_end:} handler:
-# ^^^^^^ @exception
+# ^^^^^^ @keyword.exception
.catchall {try_start: .. try_end:} handler2:
-# ^^^^^^^^^ @exception
+# ^^^^^^^^^ @keyword.exception
# ^^ @operator
handler:
@@ -232,9 +232,9 @@
nop
.source "somefile.java"
-# ^^^^^^^ @include
+# ^^^^^^^ @keyword.import
.line 101
-# ^^^ @text.literal
+# ^^^ @string.special
nop
diff --git a/tests/query/highlights/solidity/test.sol b/tests/query/highlights/solidity/test.sol
index 99117bb55..b53dd857d 100644
--- a/tests/query/highlights/solidity/test.sol
+++ b/tests/query/highlights/solidity/test.sol
@@ -3,11 +3,11 @@
// SPDX-License-Identifier: GPL-3.0
// ^ @comment
pragma solidity >=0.7.0 <0.9.0;
-// ^ @preproc
-// ^ @preproc
+// ^ @keyword.directive
+// ^ @keyword.directive
import * as something from "anotherFile";
-// ^ ^ ^ @include
+// ^ ^ ^ @keyword.import
/// @title Voting with delegation.
// <- @comment
@@ -21,7 +21,7 @@ contract Ballot {
// ^ @type
uint weight; // weight is accumulated by delegation
// ^ @type.builtin
-// ^ @field
+// ^ @variable.member
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
@@ -63,7 +63,7 @@ contract Ballot {
// appends it to the end of `proposals`.
proposals.push(Proposal({
name: proposalNames[i],
-// ^ @field
+// ^ @variable.member
voteCount: 0
}));
}
@@ -74,7 +74,7 @@ contract Ballot {
function giveRightToVote(address voter) external {
// ^ @keyword.function
// ^ @function
-// ^ @parameter
+// ^ @variable.parameter
// If the first argument of `require` evaluates
// to `false`, execution terminates and all
// changes to the state and to Ether balances
diff --git a/tests/query/highlights/t32/keywords.cmm b/tests/query/highlights/t32/keywords.cmm
index a4013d72f..f04df3ed1 100644
--- a/tests/query/highlights/t32/keywords.cmm
+++ b/tests/query/highlights/t32/keywords.cmm
@@ -3,15 +3,15 @@ PRIVATE &password
; ^ @variable.builtin
ENTRY &password
; <- @keyword
-; ^ @parameter
+; ^ @variable.parameter
ENTRY %LINE &salt
; <- @keyword
; ^ @constant.builtin
-; ^ @parameter
+; ^ @variable.parameter
IF "&password"==""
-; <- @conditional
+; <- @keyword.conditional
; ^ @string
; ^ @variable.builtin
; ^ @operator
@@ -21,7 +21,7 @@ IF "&password"==""
; ^ @keyword.return
)
ELSE
-; <- @conditional
+; <- @keyword.conditional
(
PRIVATE &pass
@@ -33,9 +33,9 @@ ELSE
GOSUB verify_password "&password"
; ^ @function.call
RETURNVALUES &pass
-; ^ @parameter
+; ^ @variable.parameter
WAIT 10.ms
-; ^ @float
+; ^ @number.float
)
IF !&pass
@@ -63,7 +63,7 @@ FramePOS ,,,,Maximized
; ^ @punctuation.delimiter
; ^ @constant.builtin
WinPOS 0% 50% 100% 35%
-; ^ @float
+; ^ @number.float
COVerage.ListFunc
ENDDO
@@ -80,11 +80,11 @@ verify_password:
; <- @function
(
PARAMETERS &password
-; ^ @parameter
+; ^ @variable.parameter
SYStem.Option.KEYCODE "&password"
SYStem.JtagClock 1kHz
-; ^ @float
+; ^ @number.float
SYStem.Mode.Attach
Data.Set N: EAXI:0x34000000 %Long 0x34000100 0x34000021 /verify
@@ -107,7 +107,7 @@ SUBROUTINE start_debug
COVerage.ListModule %MULTI.OBC \sieve
; ^ @keyword
; ^ @constant.builtin
-; ^ @symbol
+; ^ @string.special.symbol
Var.DRAW flags[0..16] /Alternate 3
; ^ @keyword
diff --git a/tests/query/highlights/t32/literals.cmm b/tests/query/highlights/t32/literals.cmm
index 8c63ce96d..a9d72e441 100644
--- a/tests/query/highlights/t32/literals.cmm
+++ b/tests/query/highlights/t32/literals.cmm
@@ -8,19 +8,19 @@ sYmbol.NEW _InitialSP 0x34000100
; ^ @number
DO ~~~~/test.cmm
-; ^ @string.special
+; ^ @string.special.path
WAIT 1.ns
-; ^ @float
+; ^ @number.float
SYStem.JtagClock 100.GHZ
-; ^ @float
+; ^ @number.float
DATA.SET P:&HEAD+0x4 %LONG DATA.LONG(EA:&HEAD+0x4)&0xFFFFFF
; ^ @constant.builtin
List `main`
-; ^ @symbol
+; ^ @string.special.symbol
&range = 'a'--'z'||'0'--'9'
; ^ @character
@@ -34,6 +34,6 @@ Data.Set N: 0xffff800000 0y0011xx01xx&&a
; ^ @operator
WinPOS 0% 85% 100% 15%
-; ^ @float
+; ^ @number.float
// vim: set ft=t32:
diff --git a/tests/query/highlights/t32/var.cmm b/tests/query/highlights/t32/var.cmm
index de67278a0..8e251afef 100644
--- a/tests/query/highlights/t32/var.cmm
+++ b/tests/query/highlights/t32/var.cmm
@@ -34,7 +34,7 @@ Var.Assign (*ap)[2..4] = &a
Var.Assign sp = &s.n+offset
; ^ @variable
; ^ @variable
-; ^ @field
+; ^ @variable.member
; ^ @variable
Var.Assign padd = (CAddition const * volatile)&d
; ^ @variable
diff --git a/tests/query/highlights/tiger/functions.tig b/tests/query/highlights/tiger/functions.tig
index 6505d20fe..706f1991a 100644
--- a/tests/query/highlights/tiger/functions.tig
+++ b/tests/query/highlights/tiger/functions.tig
@@ -1,9 +1,9 @@
primitive print(s: string)
/* ^ @function */
-/* ^ @parameter */
+/* ^ @variable.parameter */
function func(a: int) : int = (print("Hello World!"); a)
/* ^ @function */
-/* ^ @parameter */
+/* ^ @variable.parameter */
/* ^ @function.builtin */
/* vim: set ft=tiger: */
diff --git a/tests/query/highlights/tiger/identifiers.tig b/tests/query/highlights/tiger/identifiers.tig
index e712e57de..e38749071 100644
--- a/tests/query/highlights/tiger/identifiers.tig
+++ b/tests/query/highlights/tiger/identifiers.tig
@@ -22,9 +22,9 @@ var array := int_array[12] of 27;
/* ^ @type */
primitive func(a: int, b: string) : array
-/* ^ @parameter */
+/* ^ @variable.parameter */
/* ^ @type.builtin */
-/* ^ @parameter */
+/* ^ @variable.parameter */
/* ^ @type.builtin */
/* ^ @type */
/* vim: set ft=tiger: */
diff --git a/tests/query/highlights/tiger/imports.tig b/tests/query/highlights/tiger/imports.tig
index f20a0bc1a..1c7ce308d 100644
--- a/tests/query/highlights/tiger/imports.tig
+++ b/tests/query/highlights/tiger/imports.tig
@@ -1,4 +1,4 @@
import "lib.tih"
-/* <- @include */
-/* ^ @string.special */
+/* <- @keyword.import */
+/* ^ @string.special.path */
/* vim: set ft=tiger: */
diff --git a/tests/query/highlights/tiger/keywords.tig b/tests/query/highlights/tiger/keywords.tig
index 7deb0288d..c92cd929a 100644
--- a/tests/query/highlights/tiger/keywords.tig
+++ b/tests/query/highlights/tiger/keywords.tig
@@ -10,7 +10,7 @@ let
/* <- @keyword.function */
import "lib.tih"
- /* <- @include */
+ /* <- @keyword.import */
type array_of_int = array of int
/* <- @keyword */
@@ -28,13 +28,13 @@ in
/* ^ @keyword */
for i := 12 to 27 do 42;
- /* <- @repeat */
- /* ^ @repeat */
- /* ^ @repeat */
+ /* <- @keyword.repeat */
+ /* ^ @keyword.repeat */
+ /* ^ @keyword.repeat */
while 12 do break
- /* <- @repeat */
- /* ^ @repeat */
+ /* <- @keyword.repeat */
+ /* ^ @keyword.repeat */
/* ^ @keyword */
end
diff --git a/tests/query/highlights/tiger/object-oriented.tig b/tests/query/highlights/tiger/object-oriented.tig
index 607efec8c..bf1632485 100644
--- a/tests/query/highlights/tiger/object-oriented.tig
+++ b/tests/query/highlights/tiger/object-oriented.tig
@@ -13,7 +13,7 @@ let
method meth() : int = self.a
/* <- @keyword.function */
- /* ^ @method */
+ /* ^ @function.method */
/* ^ @variable.builtin */
}
@@ -24,6 +24,6 @@ in
/* ^ @property */
object.meth()
- /* ^ @method */
+ /* ^ @function.method */
end
/* vim: set ft=tiger: */
diff --git a/tests/query/highlights/typescript/as.ts b/tests/query/highlights/typescript/as.ts
index 71221f410..30be1ffae 100644
--- a/tests/query/highlights/typescript/as.ts
+++ b/tests/query/highlights/typescript/as.ts
@@ -1,8 +1,8 @@
import * as foo from 'foo';
-// ^ @include
+// ^ @keyword.import
export { foo as bar };
-// ^ @include
+// ^ @keyword.import
const n = 5 as number;
// ^ @keyword.operator
diff --git a/tests/query/highlights/usd/prims.usda b/tests/query/highlights/usd/prims.usda
index eeeeae920..da9a5d6fe 100644
--- a/tests/query/highlights/usd/prims.usda
+++ b/tests/query/highlights/usd/prims.usda
@@ -4,8 +4,8 @@ def Xform "cube" (
asset[] payloadAssetDependencies = [@fizz.usd@, @buzz.usd@]
# <- @type
# ^ @keyword
- # ^ @text.uri
- # ^ @text.uri
+ # ^ @string.special.url
+ # ^ @string.special.url
}
)
{
@@ -13,13 +13,13 @@ def Xform "cube" (
def "root" (
add references = @foo.usda@</Model> (offset = 1; scale = 2.0)
- # <- @text.uri
+ # <- @string.special.url
# ^ @string.special
# ^ @keyword
# ^ @number
# ^ @punctuation.delimiter
# ^ @keyword
- # ^ @float
+ # ^ @number.float
)
{
}
@@ -93,7 +93,7 @@ over "Parent" (
# <- @function.call
# ^ @keyword
# ^ @string.special
- # ^ @text.uri
+ # ^ @string.special.url
# ^ @string.special
)
{
@@ -107,12 +107,12 @@ def "foo"
# ^ @property
-414: 14.4
# <- @number
- # ^ @float
+ # ^ @number.float
10: 201.0,
# <- @number
- # ^ @float
+ # ^ @number.float
10.123: 201.0123,
- # <- @float
- # ^ @float
+ # <- @number.float
+ # ^ @number.float
}
}
diff --git a/tests/query/highlights/usd/properties.usda b/tests/query/highlights/usd/properties.usda
index e518c73f7..790ccfab7 100644
--- a/tests/query/highlights/usd/properties.usda
+++ b/tests/query/highlights/usd/properties.usda
@@ -11,11 +11,11 @@ token[] purpose = ["default", "render"]
rel material:binding:collection:Erasers = None
# <- @type
-# ^ @namespace
+# ^ @module
# ^ @punctuation.delimiter
-# ^ @namespace
+# ^ @module
# ^ @punctuation.delimiter
-# ^ @namespace
+# ^ @module
# ^ @punctuation.delimiter
# ^ @variable
# ^ @constant.builtin
diff --git a/tests/query/highlights/usd/subLayers.usda b/tests/query/highlights/usd/subLayers.usda
index 24581b90a..ddd1dd7af 100644
--- a/tests/query/highlights/usd/subLayers.usda
+++ b/tests/query/highlights/usd/subLayers.usda
@@ -3,7 +3,7 @@
subLayers = [
# <- @keyword
@./model_sub.usda@ (offset = 1)
- # <- @text.uri
+ # <- @string.special.url
# ^ @keyword
]
)
diff --git a/tests/query/highlights/wing/class.w b/tests/query/highlights/wing/class.w
index b102db891..c210fc611 100644
--- a/tests/query/highlights/wing/class.w
+++ b/tests/query/highlights/wing/class.w
@@ -6,7 +6,7 @@ class Foo {
// ^ @variable
// ^ @punctuation.bracket
name: str;
-//^ @field
+//^ @variable.member
// ^ @type.builtin
// ^ @punctuation.delimiter
new(name: str) {
diff --git a/tests/query/highlights/wing/nested_method.w b/tests/query/highlights/wing/nested_method.w
index 8a454b34c..4fe5ceb6a 100644
--- a/tests/query/highlights/wing/nested_method.w
+++ b/tests/query/highlights/wing/nested_method.w
@@ -1,4 +1,4 @@
test1.test2.test3();
// <- @variable
// ^ @property
-// ^ @method.call
+// ^ @function.method.call
diff --git a/tests/query/highlights/xhp-intro.hack b/tests/query/highlights/xhp-intro.hack
index ccbe60c57..06f7e30a2 100644
--- a/tests/query/highlights/xhp-intro.hack
+++ b/tests/query/highlights/xhp-intro.hack
@@ -38,7 +38,7 @@ final xhp class a_post extends x\element {
'document.getElementById("'.$id.'").submit(); return false;',
);
$anchor->setAttribute('href', '#');
- // ^ @method.call
+ // ^ @function.method.call
return $form;
}