Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Code intel hover: non-deterministic hover message when two identical ranges point to different result sets #32044

@olafurpg

Description

@olafurpg

Reported by @wchau in this discussion here sourcegraph/scip-java#404 (comment)

To reproduce, refresh the following page multiple times and hover over B in case class B. The hover message changes between refreshes

https://sourcegraph.com/github.com/sourcegraph/sbt-sourcegraph@e2f71270ea518766c65097b1f17e97b55059d792/-/blob/example/foo.scala?L3:13#tab=references

CleanShot 2022-03-01 at 10 25 45

After chatting with @efritz, the relevant place to fix this issue is around this location https://sourcegraph.com/github.com/sourcegraph/sourcegraph@d479784/-/blob/enterprise/internal/codeintel/stores/lsifstore/hover.go?L34#L14:17-14:22

There are different approaches we can use to fix this issue:

  • aggregate hover messages
  • sort hover messages and pick the first one
  • encode the priority of hover messages somehow in the LSIF protocol

I lean towards the second option as the quickest fix and we should consider the third option as we start storing LSIF Typed natively since it should be fairly easy to specify which ranges enclose a synthetic symbol definition (which should have a lower priority compared to non-synthetic symbol definitions).

Metadata

Metadata

Assignees

Labels

iteration-22-6team/graphGraph Team (previously Code Intel/Language Tools/Language Platform)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions