Debian Codegraph @

gopls/internal/test/marker/testdata/mcptools/search.txt

raw
1 This test exercises the "go_search" MCP tool.
2
3 -- flags --
4 -mcp
5 -ignore_extra_diags
6
7 -- go.mod --
8 module example.com
9
10 go 1.21
11
12 //@mcptool("go_search", `{"query": "foo"}`, output=foo)
13 //@mcptool("go_search", `{"query": "bar"}`, output=bar)
14 //@mcptool("go_search", `{"query": "baz"}`, output=baz)
15
16 -- main.go --
17 package main
18
19 import (
20 "example.com/a"
21 "example.com/b"
22 )
23
24 func FOO() {}
25
26 type baz int
27
28 func main() {
29 println(a.Foo + b.Ar)
30 }
31 -- a/a.go --
32 package a
33
34 const (
35 Foo = 1
36 Bar = 2
37 )
38
39 type B struct {
40 ar string
41 }
42
43 -- b/b.go --
44 package b
45
46 const (
47 aZ = 1
48 Ar = 2
49 )
50
51 var fOo = 3
52
53 -- @foo --
54 Top symbol matches:
55 FOO (Function in `$WORKDIR/main.go`)
56 Foo (Constant in `$WORKDIR/a/a.go`)
57 fOo (Variable in `$WORKDIR/b/b.go`)
58 -- @bar --
59 Top symbol matches:
60 Bar (Constant in `$WORKDIR/a/a.go`)
61 b.Ar (Constant in `$WORKDIR/b/b.go`)
62 B.ar (Field in `$WORKDIR/a/a.go`)
63 -- @baz --
64 Top symbol matches:
65 baz (Type in `$WORKDIR/main.go`)
66 b.aZ (Constant in `$WORKDIR/b/b.go`)