diff options
author | Robert Findley <rfindley@google.com> | 2022-01-13 11:04:02 -0500 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2022-01-13 20:54:45 +0000 |
commit | 3f6aab191a6439e502bf4c7a340de41e578bd442 (patch) | |
tree | 49dc1671f51dc2797c3133e79c189b2d3519847a /internal/lsp/references.go | |
parent | 68b574acb93f20740454b88e98bd021cef52527b (diff) | |
download | golang-x-tools-3f6aab191a6439e502bf4c7a340de41e578bd442.tar.gz |
internal/lsp: honor the file kind provided by clients for overlays
Honor the file kind provided by clients for overlays, by passing the
FileHandle into View.FileKind and checking for overlays.
For golang/vscode-go#1957
Change-Id: I4a767cb64dc5205f1d10c3126a2cbe67c21a34e4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378314
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Diffstat (limited to 'internal/lsp/references.go')
-rw-r--r-- | internal/lsp/references.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/lsp/references.go b/internal/lsp/references.go index b5bb00f69..f96e5532c 100644 --- a/internal/lsp/references.go +++ b/internal/lsp/references.go @@ -18,7 +18,7 @@ func (s *Server) references(ctx context.Context, params *protocol.ReferenceParam if !ok { return nil, err } - if snapshot.View().FileKind(fh.URI()) == source.Tmpl { + if snapshot.View().FileKind(fh) == source.Tmpl { return template.References(ctx, snapshot, fh, params) } references, err := source.References(ctx, snapshot, fh, params.Position, params.Context.IncludeDeclaration) |