Skip to content

code-intel, code-intel-extensions, extension API

Created by: mrnugget

This ticket is a dumping ground for thoughts on the code-intel-extensions, hoverify, the hover tooltip, the extension-api and things revolving around the UX of code intelligence.

Bugs, glitches, UX problems

https://user-images.githubusercontent.com/1185253/149927199-05eae8a2-0335-4094-8a29-baffaeaf7225.mp4

https://user-images.githubusercontent.com/1185253/149927332-6c6b60fb-1f63-4279-8c2a-4014585b425b.mp4

  • Empty tooltip showing up then disappearing

https://user-images.githubusercontent.com/1185253/149927547-5e71100f-af43-42ca-9c71-1e6d44d37486.mp4

  • Highlighting of occurrences in diff view really hard to see screenshot_2022-01-11_10 12 24@2x

Thoughts on using the extension-api for code intelligence

  • Document highlighting and hover information are split from each other, which gives us this weird delay between a token being highlighted on hover and the hover tooltip showing up. For the best experience, I think, it would be better (and more efficient) if we’d have a single entry point per event and one result (that contains highlights, hover, etc.)
  • It feels bending-over-backwards-y that defs/refs are built into Sourcegraph, but only their presentation, and the actual locationProvider comes from the extension, which has to match up the IDs of the built-in panels…
  • Logic in package.json
  • I’m completely ignorant of how efficient that is on the backend, but I’m also starting to wonder whether we can’t get a better experience if we’d have a single request from client to server when looking at a code file that tells us everything we need: stencils, hover tooltips, highlighting, etc. I think the RTT here is higher than the amount of data that would need to be transferred.
  • Another thing I just ran into: we cache our definitionAndHover queries so we don’t send the same request for the same token every time we hover. But every time we hover there is a references query that could already be included in the definitionAndHover query, but it's part of documentHighlights, so we'd need to cache under the hood (which is what we already do for definitionAndHover)