From e5226d96d5097fec3040cb938ff76eec74869c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sat, 20 Jun 2026 14:49:53 +0900 Subject: [PATCH] Add highlight corpus --- tests/query/highlights/bash/calls.sh | 2 ++ tests/query/highlights/bicep/members.bicep | 4 ++++ tests/query/highlights/c-sharp/calls.cs | 6 ++++++ tests/query/highlights/c-sharp/constructs.cs | 10 ++++++++++ tests/query/highlights/c-sharp/edge.cs | 6 ++++++ tests/query/highlights/c-sharp/members.cs | 4 ++++ tests/query/highlights/c/constructs.c | 9 +++++++++ tests/query/highlights/c/enums.c | 5 +++++ tests/query/highlights/c3/calls.c3 | 6 ++++++ tests/query/highlights/cairo/calls.cairo | 2 ++ tests/query/highlights/clojure/calls.clj | 6 ++++++ tests/query/highlights/clojure/forms.clj | 10 ++++++++++ tests/query/highlights/cpp/calls.cpp | 4 ++++ tests/query/highlights/cpp/constructs.cpp | 11 +++++++++++ tests/query/highlights/cpp/qualified.cpp | 10 ++++++++++ tests/query/highlights/crystal/calls.cr | 6 ++++++ tests/query/highlights/cue/calls.cue | 2 ++ tests/query/highlights/cython/members.pyx | 5 +++++ tests/query/highlights/d/calls.d | 3 +++ tests/query/highlights/d/members.d | 6 ++++++ tests/query/highlights/dart/calls.dart | 6 ++++++ tests/query/highlights/elixir/calls.ex | 10 ++++++++++ tests/query/highlights/elixir/constructs.ex | 10 ++++++++++ tests/query/highlights/elixir/structs.ex | 8 ++++++++ tests/query/highlights/elm/constructors.elm | 11 +++++++++++ tests/query/highlights/erlang/calls.erl | 5 +++++ tests/query/highlights/erlang/constructs.erl | 10 ++++++++++ tests/query/highlights/freebasic/calls.bas | 4 ++++ tests/query/highlights/fsharp/calls.fs | 4 ++++ tests/query/highlights/go/calls.go | 6 ++++++ tests/query/highlights/go/constructs.go | 12 ++++++++++++ tests/query/highlights/go/generics.go | 9 +++++++++ tests/query/highlights/gren/members.gren | 6 ++++++ tests/query/highlights/groovy/calls.groovy | 6 ++++++ tests/query/highlights/groovy/members.groovy | 5 +++++ tests/query/highlights/haskell/calls.hs | 2 ++ tests/query/highlights/haxe/members.hx | 4 ++++ tests/query/highlights/hcl/members.hcl | 4 ++++ tests/query/highlights/java/constructs.java | 12 ++++++++++++ tests/query/highlights/java/members.java | 4 ++++ tests/query/highlights/java/methods.java | 9 +++++++++ tests/query/highlights/javascript/constructs.js | 8 ++++++++ tests/query/highlights/jsx/components.jsx | 7 +++++++ tests/query/highlights/jsx/elements.jsx | 12 ++++++++++++ tests/query/highlights/julia/calls.jl | 8 ++++++++ tests/query/highlights/kotlin/calls.kt | 6 ++++++ tests/query/highlights/kotlin/constructs.kt | 7 +++++++ tests/query/highlights/kotlin/edge.kt | 4 ++++ tests/query/highlights/koto/params.koto | 4 ++++ tests/query/highlights/lua/calls.lua | 4 ++++ tests/query/highlights/luau/calls.luau | 6 ++++++ tests/query/highlights/meson/members.meson | 4 ++++ tests/query/highlights/mojo/calls.mojo | 5 +++++ tests/query/highlights/move/members.move | 8 ++++++++ tests/query/highlights/nickel/members.ncl | 2 ++ tests/query/highlights/nim/calls.nim | 5 +++++ tests/query/highlights/nim/members.nim | 5 +++++ tests/query/highlights/nix/calls.nix | 7 +++++++ tests/query/highlights/nix/constructs.nix | 13 +++++++++++++ tests/query/highlights/nu/calls.nu | 4 ++++ tests/query/highlights/ocaml/calls.ml | 5 +++++ tests/query/highlights/ocaml/constructs.ml | 10 ++++++++++ tests/query/highlights/perl/calls.pl | 6 ++++++ tests/query/highlights/php/calls.php | 5 +++++ tests/query/highlights/php/constructs.php | 9 +++++++++ tests/query/highlights/php/edge.php | 3 +++ tests/query/highlights/pkl/members.pkl | 4 ++++ tests/query/highlights/python/calls.py | 3 +++ tests/query/highlights/python/constructs.py | 11 +++++++++++ tests/query/highlights/python/edge.py | 8 ++++++++ tests/query/highlights/r/calls.r | 6 ++++++ tests/query/highlights/r/members.r | 3 +++ tests/query/highlights/rescript/calls.res | 5 +++++ tests/query/highlights/ripple/calls.ripple | 9 +++++++++ tests/query/highlights/ruby/calls.rb | 4 ++++ tests/query/highlights/ruby/constructs.rb | 9 +++++++++ tests/query/highlights/ruby/edge.rb | 2 ++ tests/query/highlights/rust/calls.rs | 6 ++++++ tests/query/highlights/rust/chains.rs | 7 +++++++ tests/query/highlights/rust/constructs.rs | 13 +++++++++++++ tests/query/highlights/rust/edge.rs | 10 ++++++++++ tests/query/highlights/rust/match_patterns.rs | 15 +++++++++++++++ tests/query/highlights/rust/parameters.rs | 5 +++++ tests/query/highlights/scala/edge.scala | 4 ++++ tests/query/highlights/scala/methods.scala | 10 ++++++++++ tests/query/highlights/scheme/calls.scm | 5 +++++ tests/query/highlights/scheme/forms.scm | 7 +++++++ tests/query/highlights/solidity/calls.sol | 10 ++++++++++ tests/query/highlights/sourcepawn/calls.sp | 2 ++ tests/query/highlights/sql/calls.sql | 3 +++ tests/query/highlights/sway/calls.sw | 8 ++++++++ tests/query/highlights/swift/methods.swift | 8 ++++++++ tests/query/highlights/tsx/components.tsx | 8 ++++++++ tests/query/highlights/tsx/elements.tsx | 11 +++++++++++ tests/query/highlights/typescript/calls.ts | 6 ++++++ tests/query/highlights/typescript/constructs.ts | 12 ++++++++++++ tests/query/highlights/typescript/edge.ts | 7 +++++++ tests/query/highlights/v/members.v | 6 ++++++ tests/query/highlights/vala/members.vala | 4 ++++ tests/query/highlights/vim/members.vim | 6 ++++++ tests/query/highlights/wesl/calls.wesl | 7 +++++++ tests/query/highlights/wgsl/members.wgsl | 8 ++++++++ tests/query/highlights/zig/calls.zig | 10 ++++++++++ tests/query/highlights/zig/locals.zig | 11 +++++++++++ 104 files changed, 694 insertions(+) create mode 100644 tests/query/highlights/bash/calls.sh create mode 100644 tests/query/highlights/bicep/members.bicep create mode 100644 tests/query/highlights/c-sharp/calls.cs create mode 100644 tests/query/highlights/c-sharp/constructs.cs create mode 100644 tests/query/highlights/c-sharp/edge.cs create mode 100644 tests/query/highlights/c-sharp/members.cs create mode 100644 tests/query/highlights/c/constructs.c create mode 100644 tests/query/highlights/c/enums.c create mode 100644 tests/query/highlights/c3/calls.c3 create mode 100644 tests/query/highlights/cairo/calls.cairo create mode 100644 tests/query/highlights/clojure/calls.clj create mode 100644 tests/query/highlights/clojure/forms.clj create mode 100644 tests/query/highlights/cpp/calls.cpp create mode 100644 tests/query/highlights/cpp/constructs.cpp create mode 100644 tests/query/highlights/cpp/qualified.cpp create mode 100644 tests/query/highlights/crystal/calls.cr create mode 100644 tests/query/highlights/cue/calls.cue create mode 100644 tests/query/highlights/cython/members.pyx create mode 100644 tests/query/highlights/d/calls.d create mode 100644 tests/query/highlights/d/members.d create mode 100644 tests/query/highlights/dart/calls.dart create mode 100644 tests/query/highlights/elixir/calls.ex create mode 100644 tests/query/highlights/elixir/constructs.ex create mode 100644 tests/query/highlights/elixir/structs.ex create mode 100644 tests/query/highlights/elm/constructors.elm create mode 100644 tests/query/highlights/erlang/calls.erl create mode 100644 tests/query/highlights/erlang/constructs.erl create mode 100644 tests/query/highlights/freebasic/calls.bas create mode 100644 tests/query/highlights/fsharp/calls.fs create mode 100644 tests/query/highlights/go/calls.go create mode 100644 tests/query/highlights/go/constructs.go create mode 100644 tests/query/highlights/go/generics.go create mode 100644 tests/query/highlights/gren/members.gren create mode 100644 tests/query/highlights/groovy/calls.groovy create mode 100644 tests/query/highlights/groovy/members.groovy create mode 100644 tests/query/highlights/haskell/calls.hs create mode 100644 tests/query/highlights/haxe/members.hx create mode 100644 tests/query/highlights/hcl/members.hcl create mode 100644 tests/query/highlights/java/constructs.java create mode 100644 tests/query/highlights/java/members.java create mode 100644 tests/query/highlights/java/methods.java create mode 100644 tests/query/highlights/javascript/constructs.js create mode 100644 tests/query/highlights/jsx/components.jsx create mode 100644 tests/query/highlights/jsx/elements.jsx create mode 100644 tests/query/highlights/julia/calls.jl create mode 100644 tests/query/highlights/kotlin/calls.kt create mode 100644 tests/query/highlights/kotlin/constructs.kt create mode 100644 tests/query/highlights/kotlin/edge.kt create mode 100644 tests/query/highlights/koto/params.koto create mode 100644 tests/query/highlights/lua/calls.lua create mode 100644 tests/query/highlights/luau/calls.luau create mode 100644 tests/query/highlights/meson/members.meson create mode 100644 tests/query/highlights/mojo/calls.mojo create mode 100644 tests/query/highlights/move/members.move create mode 100644 tests/query/highlights/nickel/members.ncl create mode 100644 tests/query/highlights/nim/calls.nim create mode 100644 tests/query/highlights/nim/members.nim create mode 100644 tests/query/highlights/nix/calls.nix create mode 100644 tests/query/highlights/nix/constructs.nix create mode 100644 tests/query/highlights/nu/calls.nu create mode 100644 tests/query/highlights/ocaml/calls.ml create mode 100644 tests/query/highlights/ocaml/constructs.ml create mode 100644 tests/query/highlights/perl/calls.pl create mode 100644 tests/query/highlights/php/calls.php create mode 100644 tests/query/highlights/php/constructs.php create mode 100644 tests/query/highlights/php/edge.php create mode 100644 tests/query/highlights/pkl/members.pkl create mode 100644 tests/query/highlights/python/calls.py create mode 100644 tests/query/highlights/python/constructs.py create mode 100644 tests/query/highlights/python/edge.py create mode 100644 tests/query/highlights/r/calls.r create mode 100644 tests/query/highlights/r/members.r create mode 100644 tests/query/highlights/rescript/calls.res create mode 100644 tests/query/highlights/ripple/calls.ripple create mode 100644 tests/query/highlights/ruby/calls.rb create mode 100644 tests/query/highlights/ruby/constructs.rb create mode 100644 tests/query/highlights/ruby/edge.rb create mode 100644 tests/query/highlights/rust/calls.rs create mode 100644 tests/query/highlights/rust/chains.rs create mode 100644 tests/query/highlights/rust/constructs.rs create mode 100644 tests/query/highlights/rust/edge.rs create mode 100644 tests/query/highlights/rust/match_patterns.rs create mode 100644 tests/query/highlights/rust/parameters.rs create mode 100644 tests/query/highlights/scala/edge.scala create mode 100644 tests/query/highlights/scala/methods.scala create mode 100644 tests/query/highlights/scheme/calls.scm create mode 100644 tests/query/highlights/scheme/forms.scm create mode 100644 tests/query/highlights/solidity/calls.sol create mode 100644 tests/query/highlights/sourcepawn/calls.sp create mode 100644 tests/query/highlights/sql/calls.sql create mode 100644 tests/query/highlights/sway/calls.sw create mode 100644 tests/query/highlights/swift/methods.swift create mode 100644 tests/query/highlights/tsx/components.tsx create mode 100644 tests/query/highlights/tsx/elements.tsx create mode 100644 tests/query/highlights/typescript/calls.ts create mode 100644 tests/query/highlights/typescript/constructs.ts create mode 100644 tests/query/highlights/typescript/edge.ts create mode 100644 tests/query/highlights/v/members.v create mode 100644 tests/query/highlights/vala/members.vala create mode 100644 tests/query/highlights/vim/members.vim create mode 100644 tests/query/highlights/wesl/calls.wesl create mode 100644 tests/query/highlights/wgsl/members.wgsl create mode 100644 tests/query/highlights/zig/calls.zig create mode 100644 tests/query/highlights/zig/locals.zig diff --git a/tests/query/highlights/bash/calls.sh b/tests/query/highlights/bash/calls.sh new file mode 100644 index 00000000..277d3020 --- /dev/null +++ b/tests/query/highlights/bash/calls.sh @@ -0,0 +1,2 @@ +invokeit foo +# ^ @function diff --git a/tests/query/highlights/bicep/members.bicep b/tests/query/highlights/bicep/members.bicep new file mode 100644 index 00000000..dfc5a3c3 --- /dev/null +++ b/tests/query/highlights/bicep/members.bicep @@ -0,0 +1,4 @@ +var y = obj.field +// ^ @variable.other.member +var z = az.resourceId('t') +// ^ @function.method diff --git a/tests/query/highlights/c-sharp/calls.cs b/tests/query/highlights/c-sharp/calls.cs new file mode 100644 index 00000000..f80a1f4a --- /dev/null +++ b/tests/query/highlights/c-sharp/calls.cs @@ -0,0 +1,6 @@ +class C { + void M() { + Invokeit(); +// ^ @function + } +} diff --git a/tests/query/highlights/c-sharp/constructs.cs b/tests/query/highlights/c-sharp/constructs.cs new file mode 100644 index 00000000..d46bb659 --- /dev/null +++ b/tests/query/highlights/c-sharp/constructs.cs @@ -0,0 +1,10 @@ +class Box { +// ^ @type + void M() { +// ^ @function + Helper(1); +// ^ @function + obj.Do(); +// ^ @function + } +} diff --git a/tests/query/highlights/c-sharp/edge.cs b/tests/query/highlights/c-sharp/edge.cs new file mode 100644 index 00000000..dbe37c56 --- /dev/null +++ b/tests/query/highlights/c-sharp/edge.cs @@ -0,0 +1,6 @@ +class C { + void m() { + var x = $"{obj.Compute()}"; +// ^ @function + } +} diff --git a/tests/query/highlights/c-sharp/members.cs b/tests/query/highlights/c-sharp/members.cs new file mode 100644 index 00000000..b986e0cd --- /dev/null +++ b/tests/query/highlights/c-sharp/members.cs @@ -0,0 +1,4 @@ +class C { void G(O o){ o.meth(); int y = o.fld; freefn(); } } +// ^ @function +// ^ @variable.other.member +// ^ @function diff --git a/tests/query/highlights/c/constructs.c b/tests/query/highlights/c/constructs.c new file mode 100644 index 00000000..f10662c6 --- /dev/null +++ b/tests/query/highlights/c/constructs.c @@ -0,0 +1,9 @@ +struct Point { int x; }; +// ^ @type +// ^ @variable.other.member +int add(int a) { +// ^ @function +// ^ @variable.parameter + return helper(a); +// ^ @function +} diff --git a/tests/query/highlights/c/enums.c b/tests/query/highlights/c/enums.c new file mode 100644 index 00000000..5be47e18 --- /dev/null +++ b/tests/query/highlights/c/enums.c @@ -0,0 +1,5 @@ +enum E { RED, GREEN }; +// ^ @constant +// ^ @constant +int f(void) { return RED; } +// ^ @constant diff --git a/tests/query/highlights/c3/calls.c3 b/tests/query/highlights/c3/calls.c3 new file mode 100644 index 00000000..5db49e34 --- /dev/null +++ b/tests/query/highlights/c3/calls.c3 @@ -0,0 +1,6 @@ +fn void main() { + helper(1); +// ^ @function + obj.doThing(); +// ^ @function +} diff --git a/tests/query/highlights/cairo/calls.cairo b/tests/query/highlights/cairo/calls.cairo new file mode 100644 index 00000000..e299e7a7 --- /dev/null +++ b/tests/query/highlights/cairo/calls.cairo @@ -0,0 +1,2 @@ +fn f() { foo(); } +// ^ @function diff --git a/tests/query/highlights/clojure/calls.clj b/tests/query/highlights/clojure/calls.clj new file mode 100644 index 00000000..2562e0a6 --- /dev/null +++ b/tests/query/highlights/clojure/calls.clj @@ -0,0 +1,6 @@ +(reduce + 0 items) +;^ @function.builtin +; ^ @constant.numeric +(my-helper x) +;^ @function +; ^ @variable diff --git a/tests/query/highlights/clojure/forms.clj b/tests/query/highlights/clojure/forms.clj new file mode 100644 index 00000000..8a852c6a --- /dev/null +++ b/tests/query/highlights/clojure/forms.clj @@ -0,0 +1,10 @@ +(defn process [items] +;^ @function.macro +; ^ @function +; ^ @variable + (let [n 1] n)) +; ^ @function.macro +(def x :status) +;^ @function.macro +; ^ @function +; ^ @string.special.symbol diff --git a/tests/query/highlights/cpp/calls.cpp b/tests/query/highlights/cpp/calls.cpp new file mode 100644 index 00000000..a0d7e8c3 --- /dev/null +++ b/tests/query/highlights/cpp/calls.cpp @@ -0,0 +1,4 @@ +int main() { + invokeit(); +// ^ @function +} diff --git a/tests/query/highlights/cpp/constructs.cpp b/tests/query/highlights/cpp/constructs.cpp new file mode 100644 index 00000000..90d1f20f --- /dev/null +++ b/tests/query/highlights/cpp/constructs.cpp @@ -0,0 +1,11 @@ +class Widget { +// ^ @type + int field; +// ^ @variable.other.member + bool method(int count) { +// ^ @function +// ^ @variable.parameter + return helper(count); +// ^ @function + } +}; diff --git a/tests/query/highlights/cpp/qualified.cpp b/tests/query/highlights/cpp/qualified.cpp new file mode 100644 index 00000000..0756681b --- /dev/null +++ b/tests/query/highlights/cpp/qualified.cpp @@ -0,0 +1,10 @@ +void g(int x) { + auto a = Color::Red; +// ^ @type.enum.variant + auto b = Limits::MAX; +// ^ @type.enum.variant + std::cout << x; +// ^ @variable +} +enum class Status { ON }; +// ^ @type.enum.variant diff --git a/tests/query/highlights/crystal/calls.cr b/tests/query/highlights/crystal/calls.cr new file mode 100644 index 00000000..95efdf6c --- /dev/null +++ b/tests/query/highlights/crystal/calls.cr @@ -0,0 +1,6 @@ +def f + obj.first.second +# ^ @function.method + helper(1) +# ^ @function.method +end diff --git a/tests/query/highlights/cue/calls.cue b/tests/query/highlights/cue/calls.cue new file mode 100644 index 00000000..d35d1935 --- /dev/null +++ b/tests/query/highlights/cue/calls.cue @@ -0,0 +1,2 @@ +x: foo(1) +// ^ @function diff --git a/tests/query/highlights/cython/members.pyx b/tests/query/highlights/cython/members.pyx new file mode 100644 index 00000000..a336f38d --- /dev/null +++ b/tests/query/highlights/cython/members.pyx @@ -0,0 +1,5 @@ +def f(o): + o.do_thing() +// ^ @function.method + y = o.attr +// ^ @variable.other.member diff --git a/tests/query/highlights/d/calls.d b/tests/query/highlights/d/calls.d new file mode 100644 index 00000000..8dbc1641 --- /dev/null +++ b/tests/query/highlights/d/calls.d @@ -0,0 +1,3 @@ +void f() { foo(); } +// ^ @function +// ^ @function diff --git a/tests/query/highlights/d/members.d b/tests/query/highlights/d/members.d new file mode 100644 index 00000000..bd0e4362 --- /dev/null +++ b/tests/query/highlights/d/members.d @@ -0,0 +1,6 @@ +void f(Obj o) { + auto x = o.field; +// ^ @variable.other.member + o.method(1); +// ^ @function +} diff --git a/tests/query/highlights/dart/calls.dart b/tests/query/highlights/dart/calls.dart new file mode 100644 index 00000000..3fd9e7af --- /dev/null +++ b/tests/query/highlights/dart/calls.dart @@ -0,0 +1,6 @@ +class C { + void m() { + invokeit(); +// ^ @function.method + } +} diff --git a/tests/query/highlights/elixir/calls.ex b/tests/query/highlights/elixir/calls.ex new file mode 100644 index 00000000..033840f8 --- /dev/null +++ b/tests/query/highlights/elixir/calls.ex @@ -0,0 +1,10 @@ +def f(x) do + helper(x) +# ^ @function + x |> Mod.doThing() +# ^ @function + "#{String.upcase(x)}" +# ^ @function + is_binary(x) +# ^ @function +end diff --git a/tests/query/highlights/elixir/constructs.ex b/tests/query/highlights/elixir/constructs.ex new file mode 100644 index 00000000..8555bf53 --- /dev/null +++ b/tests/query/highlights/elixir/constructs.ex @@ -0,0 +1,10 @@ +defmodule App do +# ^ @namespace + def greet(name) do +# ^ @function + s = :ok +# ^ @string.special.symbol + re = ~r/foo/ +# ^ @string.regexp + end +end diff --git a/tests/query/highlights/elixir/structs.ex b/tests/query/highlights/elixir/structs.ex new file mode 100644 index 00000000..ef4a431d --- /dev/null +++ b/tests/query/highlights/elixir/structs.ex @@ -0,0 +1,8 @@ +@timeout :infinity +#^ @variable.other.member +def area(%Shape{size: w}) do +# ^ @namespace +# ^ @variable + w * 2 +# ^ @variable +end diff --git a/tests/query/highlights/elm/constructors.elm b/tests/query/highlights/elm/constructors.elm new file mode 100644 index 00000000..34697cc0 --- /dev/null +++ b/tests/query/highlights/elm/constructors.elm @@ -0,0 +1,11 @@ +type Color = Red | Blue +-- ^ @type +-- ^ @constructor +-- ^ @constructor +f x = case x of + Just y -> y +--^ @constructor + Nothing -> 0 +--^ @constructor +a = Just 1 +-- ^ @constructor diff --git a/tests/query/highlights/erlang/calls.erl b/tests/query/highlights/erlang/calls.erl new file mode 100644 index 00000000..681e68ad --- /dev/null +++ b/tests/query/highlights/erlang/calls.erl @@ -0,0 +1,5 @@ +f() -> + mod:func(X), +% ^ @function + helper(Y). +% ^ @function diff --git a/tests/query/highlights/erlang/constructs.erl b/tests/query/highlights/erlang/constructs.erl new file mode 100644 index 00000000..d53da069 --- /dev/null +++ b/tests/query/highlights/erlang/constructs.erl @@ -0,0 +1,10 @@ +-record(user, {name, age}). +% ^ @type +% ^ @variable.other.member +handle(Msg) -> +%^ @function +% ^ @variable.parameter + lists:map(F, Msg). +% ^ @namespace +% ^ @function +% ^ @variable.parameter diff --git a/tests/query/highlights/freebasic/calls.bas b/tests/query/highlights/freebasic/calls.bas new file mode 100644 index 00000000..415d2b9a --- /dev/null +++ b/tests/query/highlights/freebasic/calls.bas @@ -0,0 +1,4 @@ +sub f() + foo() +' ^ @function +end sub diff --git a/tests/query/highlights/fsharp/calls.fs b/tests/query/highlights/fsharp/calls.fs new file mode 100644 index 00000000..ae4172b9 --- /dev/null +++ b/tests/query/highlights/fsharp/calls.fs @@ -0,0 +1,4 @@ +let helper x = x +let _ = Mod.doThing 1 +// ^ @namespace +// ^ @function diff --git a/tests/query/highlights/go/calls.go b/tests/query/highlights/go/calls.go new file mode 100644 index 00000000..c7e3f4b4 --- /dev/null +++ b/tests/query/highlights/go/calls.go @@ -0,0 +1,6 @@ +package main + +func main() { + invokeit() +// ^ @function +} diff --git a/tests/query/highlights/go/constructs.go b/tests/query/highlights/go/constructs.go new file mode 100644 index 00000000..732dfd32 --- /dev/null +++ b/tests/query/highlights/go/constructs.go @@ -0,0 +1,12 @@ +package main +// ^ @namespace +type Point struct { X int } +// ^ @type.definition +// ^ @variable.other.member +// ^ @type.builtin +func (p Point) Dist(count int) bool { +// ^ @function.method +// ^ @variable.parameter + return helper(count) +// ^ @function +} diff --git a/tests/query/highlights/go/generics.go b/tests/query/highlights/go/generics.go new file mode 100644 index 00000000..af3df172 --- /dev/null +++ b/tests/query/highlights/go/generics.go @@ -0,0 +1,9 @@ +package main +func Sum[T Number](xs []T) T { +// ^ @type.parameter +// ^ @type + var f = obj.Method +// ^ @variable.other.member + return obj.field +// ^ @variable.other.member +} diff --git a/tests/query/highlights/gren/members.gren b/tests/query/highlights/gren/members.gren new file mode 100644 index 00000000..51772775 --- /dev/null +++ b/tests/query/highlights/gren/members.gren @@ -0,0 +1,6 @@ +module Main exposing (..) +g x = foo x +-- ^ @variable.parameter +h o = o.field +-- ^ @variable.parameter +-- ^ @variable.other.member diff --git a/tests/query/highlights/groovy/calls.groovy b/tests/query/highlights/groovy/calls.groovy new file mode 100644 index 00000000..fff81ba7 --- /dev/null +++ b/tests/query/highlights/groovy/calls.groovy @@ -0,0 +1,6 @@ +def f() { + obj.doThing() +// ^ @function + helper() +//^ @function +} diff --git a/tests/query/highlights/groovy/members.groovy b/tests/query/highlights/groovy/members.groovy new file mode 100644 index 00000000..7ac8b465 --- /dev/null +++ b/tests/query/highlights/groovy/members.groovy @@ -0,0 +1,5 @@ +def g(o) { o.meth(); def y = o.fld; def z = o.CONST; freefn() } +// ^ @function +// ^ @variable.other.member +// ^ @constant +// ^ @function diff --git a/tests/query/highlights/haskell/calls.hs b/tests/query/highlights/haskell/calls.hs new file mode 100644 index 00000000..1fb28c51 --- /dev/null +++ b/tests/query/highlights/haskell/calls.hs @@ -0,0 +1,2 @@ +main = invokeit x +-- ^ @function diff --git a/tests/query/highlights/haxe/members.hx b/tests/query/highlights/haxe/members.hx new file mode 100644 index 00000000..a12e6d1d --- /dev/null +++ b/tests/query/highlights/haxe/members.hx @@ -0,0 +1,4 @@ +class C { function g(o) { o.meth(); var y = o.fld; freefn(); } } +// ^ @function +// ^ @variable.other.member +// ^ @function diff --git a/tests/query/highlights/hcl/members.hcl b/tests/query/highlights/hcl/members.hcl new file mode 100644 index 00000000..f2424142 --- /dev/null +++ b/tests/query/highlights/hcl/members.hcl @@ -0,0 +1,4 @@ +a = obj.field +# ^ @variable.other.member +c = foo(2) +# ^ @function.method diff --git a/tests/query/highlights/java/constructs.java b/tests/query/highlights/java/constructs.java new file mode 100644 index 00000000..5097a08c --- /dev/null +++ b/tests/query/highlights/java/constructs.java @@ -0,0 +1,12 @@ +class Box { +// ^ @type + boolean method(int count) { +// ^ @type.builtin +// ^ @function.method + String s = "a\tb"; +// ^ @type +// ^ @constant.character.escape + return helper(count); +// ^ @function.method + } +} diff --git a/tests/query/highlights/java/members.java b/tests/query/highlights/java/members.java new file mode 100644 index 00000000..de7b0cac --- /dev/null +++ b/tests/query/highlights/java/members.java @@ -0,0 +1,4 @@ +class C { void g(O o) { o.meth(); int y = o.fld; int z = Color.RED; } } +// ^ @function.method +// ^ @variable.other.member +// ^ @constant diff --git a/tests/query/highlights/java/methods.java b/tests/query/highlights/java/methods.java new file mode 100644 index 00000000..b3e81958 --- /dev/null +++ b/tests/query/highlights/java/methods.java @@ -0,0 +1,9 @@ +class C { + int m() { + invokeit(); +// ^ @function.method + obj.doThing(); +// ^ @function.method + return 0; + } +} diff --git a/tests/query/highlights/javascript/constructs.js b/tests/query/highlights/javascript/constructs.js new file mode 100644 index 00000000..facd64e0 --- /dev/null +++ b/tests/query/highlights/javascript/constructs.js @@ -0,0 +1,8 @@ +class Box { +// ^ @constructor + method(count) { +//^ @function.method + return helper(count); +// ^ @function + } +} diff --git a/tests/query/highlights/jsx/components.jsx b/tests/query/highlights/jsx/components.jsx new file mode 100644 index 00000000..2eadaa9a --- /dev/null +++ b/tests/query/highlights/jsx/components.jsx @@ -0,0 +1,7 @@ +function App(props) { + const x = obj.field; +// ^ @variable.other.member + return