MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / BenchmarkHandler_Hover

Function BenchmarkHandler_Hover

pkg/lsp/handler_bench_test.go:28–44  ·  view source on GitHub ↗

BenchmarkHandler_Hover benchmarks hover operation

(b *testing.B)

Source from the content-addressed store, hash-verified

26
27// BenchmarkHandler_Hover benchmarks hover operation
28func BenchmarkHandler_Hover(b *testing.B) {
29 server := setupTestServer()
30 sql := "SELECT id, name FROM users WHERE active = true"
31 server.Documents().Open("file:///test.sql", "sql", 1, sql)
32
33 params := TextDocumentPositionParams{
34 TextDocument: TextDocumentIdentifier{URI: "file:///test.sql"},
35 Position: Position{Line: 0, Character: 0}, // On SELECT
36 }
37 paramsJSON, _ := json.Marshal(params)
38
39 b.ReportAllocs()
40 b.ResetTimer()
41 for i := 0; i < b.N; i++ {
42 _, _ = server.handler.HandleRequest("textDocument/hover", paramsJSON)
43 }
44}
45
46// BenchmarkHandler_HoverKeyword benchmarks hover on different keywords
47func BenchmarkHandler_HoverKeyword(b *testing.B) {

Callers

nothing calls this directly

Calls 4

setupTestServerFunction · 0.85
OpenMethod · 0.80
DocumentsMethod · 0.80
HandleRequestMethod · 0.80

Tested by

no test coverage detected