Skip to content

Editor Jumps When Code Lenses Are Inserted #216824

Closed as not planned
Closed as not planned

Description

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?

Activity

  1. jrieken commented on Jun 21, 2024

    @jrieken
    Contributor

    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
  2. alexdima commented on Jun 24, 2024

    @alexdima
    Member

    Henning Dieterichs (@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.

  3. added
    feature-request
    on Jun 24, 2024
  4. hediet commented on Jun 25, 2024

    @hediet
    MemberAuthor

    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

  5. jrieken commented on Jun 25, 2024

    @jrieken
    Contributor

    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)

  6. hediet commented on Jul 8, 2024

    @hediet
    MemberAuthor

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

  7. 25 remaining items

  8. added a commit that references this issue on Jul 31, 2024
    d90ab31
  9. removed
    unreleased
    on Jul 31, 2024
  10. vs-code-engineering commented on Jul 31, 2024

    @vs-code-engineering
    Contributor

    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.

  11. added
    unreleased
    on Jul 31, 2024
  12. vs-code-engineering commented on Jul 31, 2024

    @vs-code-engineering
    Contributor
    		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
    
  13. added
    unreleased
    and removed
    unreleased
    on Jul 31, 2024
  14. hediet commented on Aug 6, 2024

    @hediet
    MemberAuthor

    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.

  15. removed
    feature-request
    on Aug 27, 2024
  16. added a commit that references this issue on Sep 2, 2024
    61c48f7
  17. locked and limited conversation to collaborators on Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-core

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions