1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:54:57 -07:00
go/internal/lsp/cache
Rob Findley b4fe758a9b internal/lsp/source: don't allow mutating DefaultOptions
DefaultOptions was a value type, but held map values. This CL changes it
to a function that returns an Options value that has new instances of
all reference types. It would be better if this function returned a
pointer, but that change ended up being too large. I will need to
refactor handling of options later anyway, in order to support sessions
with differing options for golang.org/issues/34111.

This fixes a race in internal/lsp/tests: internal/hooks/analysis.go
mutates the Analyzers map.

See for example the trybots result at:
https://storage.googleapis.com/go-build-log/0d34f5f0/linux-amd64-race_4ecdf9c8.log

Change-Id: I41be450b590a3f3104ac9a1cb9cb312ea3ff7ff4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/217077
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-01-31 15:48:08 +00:00
..
analysis.go internal/lsp/cache: handle invalid analysis Pos 2020-01-29 01:28:57 +00:00
cache.go internal/lsp/source: don't allow mutating DefaultOptions 2020-01-31 15:48:08 +00:00
check.go internal/lsp/cache: fix GOPATH vendoring 2020-01-24 00:03:48 +00:00
debug.go internal/lsp: don't clear file contents on save 2019-12-19 23:08:27 +00:00
error_test.go internal/lsp: refactor error handling code in type-checking 2019-10-21 18:57:46 +00:00
errors.go internal/lsp: don't show list errors unless necessary 2020-01-27 19:59:09 +00:00
external.go internal/lsp: check that a file handle is unmodified before read 2020-01-23 20:52:07 +00:00
load.go internal/lsp: set workspace packages during (*snapshot).load 2020-01-30 00:17:45 +00:00
mod_tidy.go internal/lsp: surface missing dependencies for imports not in go.mod 2020-01-27 22:30:17 +00:00
overlay.go internal/lsp: support multiple URIs in (*view).invalidateContent 2020-01-23 20:19:14 +00:00
parse.go internal/lsp: don't invalidate workspace when a mod file is opened 2020-01-10 21:20:43 +00:00
pkg.go internal/lsp: push more build-specific logic into the view 2020-01-24 21:10:25 +00:00
session.go internal/lsp: push more build-specific logic into the view 2020-01-24 21:10:25 +00:00
snapshot.go internal/lsp: set workspace packages during (*snapshot).load 2020-01-30 00:17:45 +00:00
view.go internal/lsp: set workspace packages during (*snapshot).load 2020-01-30 00:17:45 +00:00