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

Adding folding toggle icons in sticky scroll #190873

Merged
merged 37 commits into from Aug 25, 2023
Merged

Conversation

aiday-mar
Copy link
Contributor

Fixes: #189482

@aiday-mar aiday-mar self-assigned this Aug 21, 2023
@aiday-mar aiday-mar marked this pull request as ready for review August 22, 2023 13:30
@VSCodeTriageBot VSCodeTriageBot added this to the August 2023 milestone Aug 22, 2023
@alexdima alexdima requested review from aeschli and removed request for alexdima August 24, 2023 07:59
@aeschli
Copy link
Contributor

aeschli commented Aug 24, 2023

I see the following log statement in the console:

[404952:0824/142840.013853:INFO:CONSOLE(210)] "Error: Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!
    at DisposableStore.add (vscode-file://vscode-app/home/martin/workspaces/vscode/out/vs/base/common/lifecycle.js:210:34)
    at StickyScrollWidget._renderFoldingIconForLine (vscode-file://vscode-app/home/martin/workspaces/vscode/out/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js:227:36)
    at StickyScrollWidget._renderChildNode (vscode-file://vscode-app/home/martin/workspaces/vscode/out/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js:206:18)
    at StickyScrollWidget._renderRootNode (vscode-file://vscode-app/home/martin/workspaces/vscode/out/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js:114:73)", source: vscode-file://vscode-app/home/martin/workspaces/vscode/out/vs/base/common/lifecycle.js (210)

@aeschli
Copy link
Contributor

aeschli commented Aug 24, 2023

PR is good. Some suggestions:

  • Change this._foldingIconStore.dispose(); to this._foldingIconStore.clear() to make it reusable and move it up to the beginning of setState. There I would first dispose everything before starting rendering sticky scroll ranges again. I would also move the !this._editor._getViewModel() check there (after the disposes)
  • topOfEndLine and endLineNumber only need to be computed when needed (on click, if not collapsed, before toggling)
  • I see a small UI shifting going on when folding/expanding
    Peek 2023-08-24 15-40

Note that we always show folded icons (not only on hover). There's also a setting to control more: editor.showFoldingControls

Unrelated to the PR:
this._editor.getOption(EditorOption.lineHeight) is requested multiple times while rendering

@aiday-mar aiday-mar merged commit 60892bd into main Aug 25, 2023
6 checks passed
@aiday-mar aiday-mar deleted the aiday/toggleIconsStickyScroll branch August 25, 2023 15:24
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Collapse Region In Sticky Scroll
3 participants