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

Editor Jumps When Code Lenses Are Inserted #216824

Closed
hediet opened this issue Jun 21, 2024 · 8 comments · Fixed by #221031
Closed

Editor Jumps When Code Lenses Are Inserted #216824

hediet opened this issue Jun 21, 2024 · 8 comments · Fixed by #221031
Assignees
Labels
editor-core Editor basic functionality
Milestone

Comments

@hediet
Copy link
Member

hediet commented Jun 21, 2024

I think the editor used to preserve the vertical position of the line where the the cursor is in.
It jumps now:
aHV2ZN34RN

Repro steps:

  • Enable Code Lenses for TypeScript
  • Navigate to a symbol in a file that has not been opened yet
  • Notice that the editor reveals the symbol correctly, but without code lenses yet
  • Notice that the editor jumps once code lenses appear

Verification steps:

  • Observe that the line the cursor is in does not jump anymore.

If I don't misremember, there was a change made here recently?

@hediet hediet assigned jrieken, hediet and alexdima and unassigned hediet Jun 21, 2024
@jrieken
Copy link
Member

jrieken commented Jun 21, 2024

If I don't misremember, there was a change made here recently?

No changes for code lens since long. Doesn't reproduce for me. Can yo consistently repro? Can you try without custom settings?

Screen.Recording.2024-06-21.at.18.14.03.mov

@alexdima
Copy link
Member

alexdima commented Jun 24, 2024

@hediet The current logic is to keep the first line in the viewport stable. A good improvement might be to keep the line where the cursor is stable (if it's in the viewport), but that is not what we have implemented. PR welcome.

@alexdima alexdima added the feature-request Request for new features or functionality label Jun 24, 2024
@alexdima alexdima added this to the Backlog milestone Jun 24, 2024
@alexdima alexdima removed their assignment Jun 24, 2024
@hediet
Copy link
Member Author

hediet commented Jun 25, 2024

Oh, somehow I didn't realizing the jumping then.

No changes for code lens since long. Doesn't reproduce for me. Can yo consistently repro? Can you try without custom settings?

Did you open this file before in the VS Code session?
In the first frame of your screenrecording where editorBrowser.ts shows, the code lens feature already reserved some (empty) space to prevent layout shifts (which I don't think the feature knows the first time the text model is opened):

chrome_BNUwjdyg7w

@jrieken
Copy link
Member

jrieken commented Jun 25, 2024

the code lens feature already reserved some (empty) space to prevent layout shifts (which I don't think the feature knows the first time the text model is opened):

Between reloads the slots are persisted and optimistically shown for a couple of seconds so that the actual extension/provider can compute theirs (which is usually the same)

@hediet
Copy link
Member Author

hediet commented Jul 8, 2024

I think there is something fishy going on with persisting the code lens cache (#221005).

@hediet hediet modified the milestones: Backlog, July 2024 Jul 8, 2024
@hediet hediet assigned hediet and unassigned jrieken Jul 8, 2024
@hediet hediet added editor-core Editor basic functionality and removed code-lens labels Jul 8, 2024
hediet added a commit that referenced this issue Jul 8, 2024
@hediet hediet mentioned this issue Jul 8, 2024
hediet added a commit that referenced this issue Jul 8, 2024
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jul 8, 2024
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 8, 2024
aaronchucarroll pushed a commit to aaronchucarroll/vscode that referenced this issue Jul 10, 2024
@hediet hediet added the verification-needed Verification of issue is requested label Jul 22, 2024
@rzhao271 rzhao271 added the verified Verification succeeded label Jul 23, 2024
alexdima added a commit that referenced this issue Jul 30, 2024
This reverts commit f46e922.
alexdima added a commit that referenced this issue Jul 30, 2024
This reverts commit f46e922.
ulugbekna pushed a commit that referenced this issue Jul 30, 2024
Revert "Fixes #216824"

This reverts commit f46e922.
@alexdima alexdima reopened this Jul 30, 2024
@alexdima alexdima modified the milestones: July 2024, August 2024 Jul 30, 2024
@alexdima alexdima removed verified Verification succeeded verification-needed Verification of issue is requested insiders-released Patch has been released in VS Code Insiders labels Jul 30, 2024
alexdima added a commit to microsoft/vscode-docs that referenced this issue Jul 30, 2024
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 31, 2024
@vs-code-engineering vs-code-engineering bot removed the unreleased Patch has not yet been released in VS Code Insiders label Jul 31, 2024
Copy link

Issue marked as unreleased but unable to locate closing commit in repo history. If this was closed in a separate repo you can add the insiders-released label directly, or comment \closedWith someShaThatWillbeReleasedWhenThisIsRelesed.

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jul 31, 2024
Copy link

		Issue marked as unreleased but unable to locate closing commit in issue timeline. You can manually reference a commit by commenting `\closedWith someCommitSha`, or directly add the `insiders-released` label if you know this has already been releaased

@vs-code-engineering vs-code-engineering bot added unreleased Patch has not yet been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 31, 2024
@alexdima alexdima reopened this Aug 5, 2024
@hediet
Copy link
Member Author

hediet commented Aug 6, 2024

Closing in favor of #224822 (which proposes one possible solution to this).

To be honest though, I think #221005 is what caused my feeling of this happening much more often.

@hediet hediet closed this as completed Aug 6, 2024
@hediet hediet closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
@hediet hediet removed the feature-request Request for new features or functionality label Aug 27, 2024
mustard-mh pushed a commit to gitpod-io/openvscode-server that referenced this issue Sep 2, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants