Debian Codegraph @

gopls/internal/test/integration/bench/semtok_test.go

raw symbols SCIP
1 // Copyright 2026 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package bench
6
7 import (
8 "testing"
9
10 . "golang.org/x/tools/gopls/internal/test/integration"
11 "golang.org/x/tools/gopls/internal/test/integration/fake"
12 )
13
14 func BenchmarkSemanticTokens(b *testing.B) {
15 env := getRepo(b, "tools").newEnv(b, fake.EditorConfig{
16 Settings: map[string]any{
17 "semanticTokens": true,
18 },
19 }, "SemanticTokens", false)
20
21 env.Await(InitialWorkspaceLoad)
22
23 env.AfterChange()
24
25 const path = "internal/lsp/cache/snapshot.go"
26 env.OpenFile(path)
27
28 for b.Loop() {
29 env.SemanticTokensFull(path)
30 }
31 }