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

Function BenchmarkHandler_DidOpen

pkg/lsp/handler_bench_test.go:299–318  ·  view source on GitHub ↗

BenchmarkHandler_DidOpen benchmarks document open notification

(b *testing.B)

Source from the content-addressed store, hash-verified

297
298// BenchmarkHandler_DidOpen benchmarks document open notification
299func BenchmarkHandler_DidOpen(b *testing.B) {
300 sql := "SELECT * FROM users WHERE id = 1"
301
302 didOpenParams := DidOpenTextDocumentParams{
303 TextDocument: TextDocumentItem{
304 URI: "file:///test.sql",
305 LanguageID: "sql",
306 Version: 1,
307 Text: sql,
308 },
309 }
310 paramsJSON, _ := json.Marshal(didOpenParams)
311
312 b.ReportAllocs()
313 b.ResetTimer()
314 for i := 0; i < b.N; i++ {
315 server := setupTestServer()
316 server.handler.HandleNotification("textDocument/didOpen", paramsJSON)
317 }
318}
319
320// BenchmarkHandler_DidChange benchmarks document change notification
321func BenchmarkHandler_DidChange(b *testing.B) {

Callers

nothing calls this directly

Calls 2

setupTestServerFunction · 0.85
HandleNotificationMethod · 0.80

Tested by

no test coverage detected