From 7a2ec0970cd801172e123c9bfeba3cc29daae25a Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Mon, 2 Aug 2021 22:28:43 -0400 Subject: [PATCH] internal/lsp/cache: clarify an error message about mismatching casing Fixes golang/go#47509 Change-Id: I7a72470b7281277ece301cda4486aed83baaa08d Reviewed-on: https://go-review.googlesource.com/c/tools/+/339352 Trust: Robert Findley Run-TryBot: Robert Findley gopls-CI: kokoro Reviewed-by: Hyang-Ah Hana Kim --- internal/lsp/cache/os_darwin.go | 2 +- internal/lsp/cache/os_windows.go | 2 +- internal/lsp/cache/view.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/lsp/cache/os_darwin.go b/internal/lsp/cache/os_darwin.go index 73c26fd429..2c88be1fcb 100644 --- a/internal/lsp/cache/os_darwin.go +++ b/internal/lsp/cache/os_darwin.go @@ -52,7 +52,7 @@ func darwinCheckPathCase(path string) error { break } if g != w { - return fmt.Errorf("case mismatch in path %q: component %q should be %q", path, g, w) + return fmt.Errorf("case mismatch in path %q: component %q is listed by macOS as %q", path, g, w) } } return nil diff --git a/internal/lsp/cache/os_windows.go b/internal/lsp/cache/os_windows.go index 4bf51702f4..7ff1cce746 100644 --- a/internal/lsp/cache/os_windows.go +++ b/internal/lsp/cache/os_windows.go @@ -48,7 +48,7 @@ func windowsCheckPathCase(path string) error { } for got, want := path, longstr; !isRoot(got) && !isRoot(want); got, want = filepath.Dir(got), filepath.Dir(want) { if g, w := filepath.Base(got), filepath.Base(want); g != w { - return fmt.Errorf("case mismatch in path %q: component %q should be %q", path, g, w) + return fmt.Errorf("case mismatch in path %q: component %q is listed by Windows as %q", path, g, w) } } return nil diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index 3f39882469..1989a62d5f 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -727,7 +727,7 @@ func (v *View) updateWorkspaceLocked(ctx context.Context) error { func (s *Session) getWorkspaceInformation(ctx context.Context, folder span.URI, options *source.Options) (*workspaceInformation, error) { if err := checkPathCase(folder.Filename()); err != nil { - return nil, errors.Errorf("invalid workspace configuration: %w", err) + return nil, errors.Errorf("invalid workspace folder path: %w; check that the casing of the configured workspace folder path agrees with the casing reported by the operating system", err) } var err error inv := gocommand.Invocation{