aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/regtest
diff options
context:
space:
mode:
Diffstat (limited to 'gopls/internal/lsp/regtest')
-rw-r--r--gopls/internal/lsp/regtest/marker.go4
-rw-r--r--gopls/internal/lsp/regtest/regtest.go2
-rw-r--r--gopls/internal/lsp/regtest/runner.go8
3 files changed, 5 insertions, 9 deletions
diff --git a/gopls/internal/lsp/regtest/marker.go b/gopls/internal/lsp/regtest/marker.go
index c10445ba0..6a6e616ff 100644
--- a/gopls/internal/lsp/regtest/marker.go
+++ b/gopls/internal/lsp/regtest/marker.go
@@ -258,8 +258,8 @@ func RunMarkerTests(t *testing.T, dir string) {
}
// Opt: use a shared cache.
- // TODO: opt: use a memoize store with no eviction.
- cache := cache.New(nil, nil)
+ // TODO(rfindley): opt: use a memoize store with no eviction.
+ cache := cache.New(nil)
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
diff --git a/gopls/internal/lsp/regtest/regtest.go b/gopls/internal/lsp/regtest/regtest.go
index b2ef3575e..5a5232f3e 100644
--- a/gopls/internal/lsp/regtest/regtest.go
+++ b/gopls/internal/lsp/regtest/regtest.go
@@ -8,7 +8,6 @@ import (
"context"
"flag"
"fmt"
- "go/token"
"io/ioutil"
"os"
"runtime"
@@ -118,7 +117,6 @@ func Main(m *testing.M, hook func(*source.Options)) {
PrintGoroutinesOnFailure: *printGoroutinesOnFailure,
SkipCleanup: *skipCleanup,
OptionsHook: hook,
- fset: token.NewFileSet(),
store: memoize.NewStore(memoize.NeverEvict),
}
diff --git a/gopls/internal/lsp/regtest/runner.go b/gopls/internal/lsp/regtest/runner.go
index 20dac8423..5f556b282 100644
--- a/gopls/internal/lsp/regtest/runner.go
+++ b/gopls/internal/lsp/regtest/runner.go
@@ -8,7 +8,6 @@ import (
"bytes"
"context"
"fmt"
- "go/token"
"io"
"io/ioutil"
"net"
@@ -118,7 +117,6 @@ type Runner struct {
// Immutable state shared across test invocations
goplsPath string // path to the gopls executable (for SeparateProcess mode)
tempDir string // shared parent temp directory
- fset *token.FileSet // shared FileSet
store *memoize.Store // shared store
// Lazily allocated resources
@@ -336,7 +334,7 @@ func (s *loggingFramer) printBuffers(testname string, w io.Writer) {
// defaultServer handles the Default execution mode.
func (r *Runner) defaultServer(optsHook func(*source.Options)) jsonrpc2.StreamServer {
- return lsprpc.NewStreamServer(cache.New(r.fset, r.store), false, optsHook)
+ return lsprpc.NewStreamServer(cache.New(r.store), false, optsHook)
}
// experimentalServer handles the Experimental execution mode.
@@ -345,7 +343,7 @@ func (r *Runner) experimentalServer(optsHook func(*source.Options)) jsonrpc2.Str
optsHook(o)
o.EnableAllExperiments()
}
- return lsprpc.NewStreamServer(cache.New(nil, nil), false, options)
+ return lsprpc.NewStreamServer(cache.New(nil), false, options)
}
// forwardedServer handles the Forwarded execution mode.
@@ -353,7 +351,7 @@ func (r *Runner) forwardedServer(optsHook func(*source.Options)) jsonrpc2.Stream
r.tsOnce.Do(func() {
ctx := context.Background()
ctx = debug.WithInstance(ctx, "", "off")
- ss := lsprpc.NewStreamServer(cache.New(nil, nil), false, optsHook)
+ ss := lsprpc.NewStreamServer(cache.New(nil), false, optsHook)
r.ts = servertest.NewTCPServer(ctx, ss, nil)
})
return newForwarder("tcp", r.ts.Addr)