go/internal/lsp/cache
Rebecca Stambler b53d4cbd60 internal/lsp/cache: check for symlinks when checking "isSubdirectory"
This change copies the logic from the go command's inDir function
(https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/search/search.go;drc=3931cc113f3f3e7d484842d6e4f53b7a78311e8e;l=570)
to replace gopls's "isSubdirectory" function. This function resolves
symlinks, which isSubdirectory did not previously do.

The only adjustments are to flip the arguments to match the previous
signature of isSubdirectory and to return a boolean instead of a string.

Fixes golang/go#38558

Change-Id: I9c64604222ac277eae81a4111eef432ead887e9f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/266200
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-11-02 04:30:06 +00:00
..
analysis.go internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +00:00
cache.go internal/lsp/cache: introduce a workspace abstraction 2020-10-30 19:58:30 +00:00
check.go internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +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: add support for RelatedInformation in diagnostics 2020-09-04 18:57:47 +00:00
imports.go internal/lsp/cache: introduce a workspace abstraction 2020-10-30 19:58:30 +00:00
keys.go internal/lsp: decouple client and server debug 2020-06-11 13:49:48 +00:00
load.go internal/lsp/cache: set a 15 minute deadline on calls to packages.Load 2020-11-02 02:19:07 +00:00
mod.go internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +00:00
mod_tidy.go internal/lsp: change `go mod vendor` warning into a diagnostic 2020-11-02 00:57:53 +00:00
os_darwin.go internal/lsp: add a mutex around the view's options 2020-04-02 16:41:49 +00:00
os_windows.go internal/lsp/cache: validate workspace path case 2020-03-27 19:55:53 +00:00
parse.go internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +00:00
parse_test.go internal/lsp/cache: trim ellipsis array literals 2020-08-12 23:16:40 +00:00
pkg.go internal/lsp: prepare for deletion of view.modURI 2020-09-28 20:19:43 +00:00
session.go internal/lsp: move initialization entirely into the snapshot 2020-11-02 01:26:20 +00:00
snapshot.go internal/lsp/cache: check for symlinks when checking "isSubdirectory" 2020-11-02 04:30:06 +00:00
view.go internal/lsp/cache: check for symlinks when checking "isSubdirectory" 2020-11-02 04:30:06 +00:00
view_test.go internal/lsp: change `go mod vendor` warning into a diagnostic 2020-11-02 00:57:53 +00:00
workspace.go internal/lsp/cache: check for symlinks when checking "isSubdirectory" 2020-11-02 04:30:06 +00:00
workspace_test.go internal/lsp/cache: introduce a workspace abstraction 2020-10-30 19:58:30 +00:00