-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
Refactoring the sticky scroll #157483
Refactoring the sticky scroll #157483
Conversation
…ly on the outline model. Consider perhaps checking for the kind of the outline element.
There seems to be still an issue with the sticky scroll, I am looking into it. |
The issue was the unnecessary deep cloning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the following regression:
- open a file with the contents
- fold
public getName()
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
namespace One {
namespace Two {
namespace Three {
class A {
public getName() {
}
public getAge() {
}
}
}
}
}
In Insiders, I see that getName()
and getAge()
become sticky (as expected):
Kapture.2022-08-08.at.13.02.19.mp4
With the proposed changes, getAge()
does not become sticky:
Kapture.2022-08-08.at.13.03.50.mp4
I believe this might be caused by only considering the first visible range in the editor i.e. getCandidateStickyLinesIntersecting(this.editor.getVisibleRanges()[0])
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Looks good!! I just left a few comments.
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts
Outdated
Show resolved
Hide resolved
Refactoring the sticky scroll
Refactoring the sticky scroll, the code is more concise.