Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from Aug 9, 2022

Conversation

fkling
Copy link
Contributor

@fkling fkling commented Aug 9, 2022

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)

sg-cm-blob-rp.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.

…hings)

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.
@fkling fkling added team/code-navigation codemirror PRs and issues related to migrating to CodeMirror labels Aug 9, 2022
@fkling fkling requested review from oleggromov and umpox August 9, 2022 08:08
@cla-bot cla-bot bot added the cla-signed label Aug 9, 2022
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment super helpful, looks good but I noticed some off behaviour when I did a quick test:

RefPanel

Current ref panel supports the HoverOverlay within the panel view too

Known issue?

@fkling
Copy link
Contributor Author

fkling commented Aug 9, 2022

@umpox Thanks for catching that, I didn't test that :-/

@fkling
Copy link
Contributor Author

fkling commented Aug 9, 2022

I disabled hovercards for the reference panel.

@fkling fkling requested a review from umpox August 9, 2022 13:11
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fkling fkling merged commit 93788b3 into main Aug 9, 2022
@fkling fkling deleted the fkling/cm-blob-view-reference-panel branch August 9, 2022 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed codemirror PRs and issues related to migrating to CodeMirror team/code-navigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants