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

[change] new foldingStrategy behaviour #7541

Closed
daiyam opened this issue Apr 9, 2020 · 6 comments
Closed

[change] new foldingStrategy behaviour #7541

daiyam opened this issue Apr 9, 2020 · 6 comments
Labels
proposal feature proposals (potential future features) question user / developer questions

Comments

@daiyam
Copy link

daiyam commented Apr 9, 2020

Description

I would like to change how the folding ranges are provided.

VSCode behaviour

The editor is using the folding ranges provided:

  • by the folding range provider defined by the setting editor.foldingStrategy (auto or indentation)
  • and by the folding range provider defined by an extension

Expected behaviour

The editor is using the folding ranges provided:

  • by the folding range provider defined by the setting editor.foldingStrategy (auto or indentation)
  • or by the folding range provider, defined by an extension, whose id is the value of the setting editor.foldingStrategy

I already have a patch to change that behaviour in VSCode and the extension Explicit Folding which support the old and new behaviours.

Do you think it is a reasonable change and can be included in a future version of theia? Thx

@daiyam daiyam changed the title [change] new foldingStrategy behaviour [change] new foldingStrategy behaviour Apr 9, 2020
@vince-fugnitto
Copy link
Member

Do you think it is a reasonable change and can be included in a future version of theia? Thx

@daiyam thank you for the issue!

A couple of discussion points:

  • do you have the pull-request link to vscode from which you suggesting updating the folding strategy? (I'd like to see/reference any discussions that might have been had with the proposal and why it was not accepted).
  • what issue are you attempting to fix/enhance by introducing a different folding strategy?
  • another possibility would be to create a custom theia extension which overrides the default folding strategy to meet your requirements (if the overall community disagrees in changing the default behaviour directly in the framework). Ideally we'd like to have a similar behavior as that of vscode unless there is a clear need to diverge. Once the second question is answered can we really agree/disagree on the feature.

@vince-fugnitto vince-fugnitto added proposal feature proposals (potential future features) question user / developer questions labels Apr 9, 2020
@daiyam
Copy link
Author

daiyam commented Apr 9, 2020

@vince-fugnitto thx for the answer.

  • the PR is add custom folding strategy microsoft/vscode#54200.
  • I'm used to manually control how the code is folded which improve, for me, the code readability. It's come from Emacs.
  • Can a theia extension change the default behaviour? I'm asking because in VSCode, it can't be done.

@vince-fugnitto
Copy link
Member

  • Can a theia extension change the default behaviour?
    I'm asking because in VSCode, it can't be done.

Theia is a framework for building IDE-like applications, while VS Code is a product so it is possible for application developers to customize their applications to suit their needs.

In the framework we attempt to make things highly customizable and extensible meaning that any feature or behavior present can in theory be overridden/extended. In the case of the folding regions, we might rely directly on the behavior from the monaco editor and I am unsure at the moment how one can update it easily.

Perhaps @akosyakov you might have some ideas?

@akosyakov
Copy link
Member

@vince-fugnitto Yes, it can be changed only in the upstream.

@vince-fugnitto
Copy link
Member

@vince-fugnitto Yes, it can be changed only in the upstream.

@goyalyashpal
Copy link

goyalyashpal commented Nov 29, 2023

the PR is add custom folding strategy microsoft/vscode#54200.
- @ daiyam at #7541 (comment)

just noticed today that it was merged upstream at microsoft/vscode#157434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal feature proposals (potential future features) question user / developer questions
Projects
None yet
Development

No branches or pull requests

4 participants