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