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

Function BenchmarkHandler_DidChange

pkg/lsp/handler_bench_test.go:321–341  ·  view source on GitHub ↗

BenchmarkHandler_DidChange benchmarks document change notification

(b *testing.B)

Source from the content-addressed store, hash-verified

319
320// BenchmarkHandler_DidChange benchmarks document change notification
321func BenchmarkHandler_DidChange(b *testing.B) {
322 server := setupTestServer()
323 server.Documents().Open("file:///test.sql", "sql", 1, "SELECT * FROM users")
324
325 didChangeParams := DidChangeTextDocumentParams{
326 TextDocument: VersionedTextDocumentIdentifier{
327 TextDocumentIdentifier: TextDocumentIdentifier{URI: "file:///test.sql"},
328 Version: 2,
329 },
330 ContentChanges: []TextDocumentContentChangeEvent{
331 {Text: "SELECT id, name FROM users WHERE active = true"},
332 },
333 }
334 paramsJSON, _ := json.Marshal(didChangeParams)
335
336 b.ReportAllocs()
337 b.ResetTimer()
338 for i := 0; i < b.N; i++ {
339 server.handler.HandleNotification("textDocument/didChange", paramsJSON)
340 }
341}
342
343// BenchmarkHandler_Initialize benchmarks initialization
344func BenchmarkHandler_Initialize(b *testing.B) {

Callers

nothing calls this directly

Calls 4

setupTestServerFunction · 0.85
OpenMethod · 0.80
DocumentsMethod · 0.80
HandleNotificationMethod · 0.80

Tested by

no test coverage detected