1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:28:33 -06:00
go/internal/lsp/cache
Rob Findley c4d4ea9c79 internal/lsp/cache: return concrete types where possible
For testability, and to allow the exchange of debug information when
forwarding the LSP, it will be necessary to access debug information
stored in cache objects. This is cumbersome to do if our constructors
return source interfaces rather than concrete types.

This CL changes cache.New and (*Cache).NewSession to return concrete
types. This required removing NewSession from source.Cache. I would
argue that this makes sense from a philosophical perspective: everything
in the source package operates in a context where the Session and Cache
already exist.

Updates golang/go#34111

Change-Id: I01721db827d51117f9479f1544b15cedae0c5921
Reviewed-on: https://go-review.googlesource.com/c/tools/+/220077
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-02-19 18:42:16 +00:00
..
analysis.go internal/lsp/cache: hardcode parse modes instead of guessing them 2020-02-07 20:00:15 +00:00
cache.go internal/lsp/cache: return concrete types where possible 2020-02-19 18:42:16 +00:00
check.go internal/lsp/cache: add file contents to ParseGoHandle 2020-02-13 05:05:14 +00:00
debug.go internal/lsp/cache: return concrete types where possible 2020-02-19 18:42:16 +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/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +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/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +00:00
mod.go internal/lsp/cache: parse go.mod file before running go mod tidy 2020-02-14 20:11:35 +00:00
parse.go internal/lsp/cache: return concrete types where possible 2020-02-19 18:42:16 +00:00
pkg.go internal/lsp/cache: add file contents to ParseGoHandle 2020-02-13 05:05:14 +00:00
session.go internal/lsp/cache: return concrete types where possible 2020-02-19 18:42:16 +00:00
snapshot.go internal/lsp: fix error handling when getting go.mod codelens 2020-02-14 19:54:16 +00:00
view.go internal/lsp/cache: return concrete types where possible 2020-02-19 18:42:16 +00:00