feat(lsp): add workspace symbol search

Assisted-by: MiMo V2.5 Pro
This commit is contained in:
2026-08-21 01:20:35 +02:00
parent f5fcaf9fa6
commit e4c9d78968
4 changed files with 89 additions and 0 deletions
+25
View File
@@ -450,6 +450,31 @@ func TestDocumentHighlights(t *testing.T) {
}
}
func TestWorkspaceSymbols(t *testing.T) {
in := session("file:///f_amd64.s", cleanDoc) +
frame(13, "workspace/symbol", map[string]any{
"query": "foo",
}) + frame(nil, "exit", nil)
msgs := run(t, in)
resp := findByID(msgs, 13)
if resp == nil {
t.Fatal("no workspace/symbol response")
}
var syms []WorkspaceSymbol
if err := json.Unmarshal(mustResult(t, resp), &syms); err != nil {
t.Fatal(err)
}
found := false
for _, s := range syms {
if s.Name == "foo" {
found = true
}
}
if !found {
t.Fatalf("want symbol foo in results, got %+v", syms)
}
}
func TestMethodNotFound(t *testing.T) {
in := frame(9, "bogus/method", map[string]any{}) + frame(nil, "exit", nil)
msgs := run(t, in)