BenchmarkHandler_Hover benchmarks hover operation
(b *testing.B)
| 26 | |
| 27 | // BenchmarkHandler_Hover benchmarks hover operation |
| 28 | func 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 |
| 47 | func BenchmarkHandler_HoverKeyword(b *testing.B) { |
nothing calls this directly
no test coverage detected