Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
GSmithApps committed Jan 20, 2025
1 parent 940cfd5 commit 8da7535
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions gopls/internal/golang/hover.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,17 +779,18 @@ func hoverPackageIdent(ctx context.Context, snapshot *cache.Snapshot, pkg *cache
if err != nil {
return protocol.Range{}, nil, err
}
if importPathString == path {
rng, err := pgf.NodeRange(ident)
if err != nil {
return protocol.Range{}, nil, err
}
hoverRes, err := hoverPackageRef(ctx, snapshot, pkg, spec)
if err != nil {
return protocol.Range{}, nil, err
}
return rng, hoverRes, nil // (hoverRes may be nil)
if importPathString != path {
continue
}
rng, err := pgf.NodeRange(ident)
if err != nil {
return protocol.Range{}, nil, err
}
hoverRes, err := hoverPackageRef(ctx, snapshot, pkg, spec)
if err != nil {
return protocol.Range{}, nil, err
}
return rng, hoverRes, nil // (hoverRes may be nil)
}

return protocol.Range{}, nil, fmt.Errorf("invalid import path")
Expand Down

0 comments on commit 8da7535

Please sign in to comment.