Skip to content

codemirror blob view: Add support for reference panel (and fix some things)

Warren Gifford requested to merge fkling/cm-blob-view-reference-panel into main

Created by: fkling

This commit adds support for using the blob view in the reference panel. Besides handling the reference panel specific props (disableStatusBar, disableDecorations), I also had to make some changes to make selecting lines and scrolling them into view work properly.

The biggest change is which selection information is sent to the extension host. Instead of sending the editor's cursor position, I'm now sending the selected lines, which is what the old blob view does. This also fixes the issue with showing line decorations for selected lines (instead of just line where the current cursor is).

Having a real cursor is still enabled because we need that for search (Meta+f) to work.

Demo: (the first part shows how line decorations are updated as the user selects additional lines)

https://user-images.githubusercontent.com/179026/183598410-b361f3ba-fef0-4446-abbf-8ef0af96302b.mp4

Test plan

  • Enable CodeMirror file view, enable the new references panel.
  • Open a file, hover over a symbol and click "find references"
  • Click on a couple of entries in the reference panel. The preview appears, scrolled to the selected line.
    • Clicking on other entries in the same file doesn't give the impression that the preview reloads.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading