Skip to content

Commit

Permalink
fix hoverPackageName
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Oct 20, 2023
1 parent 71f6a46 commit 31ccc71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gopls/internal/lsp/source/hover.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func hover(ctx context.Context, snapshot Snapshot, fh FileHandle, pp protocol.Po
// Handle hovering over the package name, which does not have an associated
// object.
// As with import paths, we allow hovering just after the package name.
if pgf.File.Name != nil && pgf.File.Name.Pos() <= pos && pos <= pgf.File.Name.Pos() {
if pgf.File.Name != nil && pgf.File.Name.Pos() <= pos && pos <= pgf.File.Name.End() {
return hoverPackageName(pkg, pgf)
}

Expand Down

0 comments on commit 31ccc71

Please sign in to comment.