-
Notifications
You must be signed in to change notification settings - Fork 37k
Adding option in settings to determine which model (outline, folding or indentation) should be used by default by sticky scroll #174958
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
Conversation
…fallbacks, whether it is the outline model or the folding model
…lding model to be used to define which sticky lines to stick
…ding model and indentation model
…when the folding functionality is turned off
…n a sticky model inste
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
| break; | ||
| } | ||
|
|
||
| this._updateDebounceInfo = _languageFeatureDebounceService.for(_languageFeaturesService.foldingRangeProvider, 'Sticky Scroll Folding', { min: 200 }); |
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.
_languageFeaturesService.foldingRangeProvider needs to match the provider used.
So the _updateDebounceInfo needs to go inside modelProvider.computeStickyModel
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts
Outdated
Show resolved
Hide resolved
|
Is there a way to customize this provider through an extension? Is this kind of a feature something that you'd consider supporting? :) |
|
Hi thanks for commenting. The outline model provider and folding model provider are both generated from your installed extensions. You can implement your own DocumentSymbolProvider in an extension for example which would be used to generate the sticky scroll model. |
|
Oh, that's super awesome - I will have to explore this more in-depth! A thing that I'd like to implement is to "fold" multiple levels into one in JavaScript/TS files. For example, for an object like this: const machine = createMachine({
states: {
a: {
states: {
b: {}
}
}
}
})we get a sticky header like: and in the ideal world, I'd like to "fold" this into I think that perhaps folding object paths into a single line could be desirable for most people in general-purpose situations: Otherwise, the allowed nested levels run out pretty quickly (5 by default) for schema-like objects that tend to have many nesting levels. I could probably live with the full object path in a single line - but if I could customize this (through an extension) even further to discard the "redundant" Anyway, I realize this is really a feature request so I will stop babbling (and might create an actual feature request for this in the future)... Thank you for the answer! |
Fixes #162904
Allowing the users to choose between the folding model, indentation model and the outline model to decide what lines to stick. The user may choose between three setting values which lead to different fall backs