BenchmarkHandler_DidChange benchmarks document change notification
(b *testing.B)
| 319 | |
| 320 | // BenchmarkHandler_DidChange benchmarks document change notification |
| 321 | func 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 |
| 344 | func BenchmarkHandler_Initialize(b *testing.B) { |
nothing calls this directly
no test coverage detected