Skip to content

Conversation

@aiday-mar
Copy link
Contributor

@aiday-mar aiday-mar commented Feb 21, 2023

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

  • Outline Model -> Folding Model -> Indentation Model
  • Folding Model -> Indentation Model
  • Indentation Model

…fallbacks, whether it is the outline model or the folding model
…lding model to be used to define which sticky lines to stick
@aiday-mar aiday-mar added this to the March 2023 milestone Feb 21, 2023
@aiday-mar aiday-mar changed the title Adding option in settings to determine which model (outline or folding) should be used by default by sticky scroll Adding option in settings to determine which model (outline, folding or indentation) should be used by default by sticky scroll Feb 27, 2023
@aiday-mar aiday-mar dismissed a stale review via b8412be February 28, 2023 11:37
@aiday-mar aiday-mar marked this pull request as ready for review March 1, 2023 17:33
@aiday-mar aiday-mar requested a review from aeschli March 1, 2023 17:33
@aiday-mar aiday-mar marked this pull request as draft March 1, 2023 17:34
break;
}

this._updateDebounceInfo = _languageFeatureDebounceService.for(_languageFeaturesService.foldingRangeProvider, 'Sticky Scroll Folding', { min: 200 });
Copy link
Contributor

@aeschli aeschli Mar 10, 2023

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

@aiday-mar aiday-mar dismissed a stale review via 70158bf March 12, 2023 18:57
@aiday-mar aiday-mar merged commit e9b9394 into main Mar 13, 2023
@aiday-mar aiday-mar deleted the aiday/issue162904 branch March 13, 2023 20:54
@Andarist
Copy link
Contributor

Andarist commented Apr 5, 2023

Is there a way to customize this provider through an extension? Is this kind of a feature something that you'd consider supporting? :)

@aiday-mar
Copy link
Contributor Author

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.

@Andarist
Copy link
Contributor

Andarist commented Apr 6, 2023

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:

states
  a
    states
      b

and in the ideal world, I'd like to "fold" this into

a > b (states path)

I think that perhaps folding object paths into a single line could be desirable for most people in general-purpose situations:

states > a > states > b

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" states keys (in this example) for domain-specific objects then it would be even cooler.

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!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 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.

Please allow Sticky Scroll to be based on indentation instead of scope

4 participants