FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add folding reconciler by sebthom · Pull Request #897 · eclipse-tm4e/tm4e · GitHub

feat: add folding reconciler - #897

Merged
sebthom merged 1 commit into
eclipse-tm4e:mainfrom
sebthom:foldingRegions
Jun 4, 2025
Merged

feat: add folding reconciler#897
sebthom merged 1 commit into
eclipse-tm4e:mainfrom
sebthom:foldingRegions

Conversation

sebthom commented Jun 2, 2025
edited
Loading

Copy link
Copy Markdown
Member

Addresses #50

sebthom mentioned this pull request Jun 2, 2025

Copy link
Copy Markdown
Contributor

Thanks @sebthom! I wonder what is the behavior when a file:

  • is associated to a textmate which defines folding
  • is associated to a language-configuration.json which defines folding
  • is associated to a language server which provide folding

Is there the 3 folding strategies which are executed?

sebthom commented Jun 3, 2025

Copy link
Copy Markdown
Member Author

That indeed is an interesting question. I gave it a try, the TMFoldingStrategy applied the language-configuration.json foldings and the CSS language server applied it's own overlapping foldings. they get merged. even if both apply foldings for the same regions you only see one folding indicator.

sebthom marked this pull request as draft June 3, 2025 10:27

Copy link
Copy Markdown
Contributor

It was my fear.

I think folding should be done with one folding strategy.

Use lsp at first. if not defined use language config and if it is not defined use textmate

sebthom commented Jun 3, 2025

Copy link
Copy Markdown
Member Author

@angelozerr I updated the code so that the folding reconciler is deactivated when an LS is available for a document.

Copy link
Copy Markdown
Contributor

I updated the code so that the folding reconciler is deactivated when an LS is available for a document.

Could it be instead deactivated if some other folding annotations, not coming from TM4E, are present?

sebthom force-pushed the foldingRegions branch 2 times, most recently from 1569485 to 4aedd8e Compare June 4, 2025 11:18
sebthom marked this pull request as ready for review June 4, 2025 11:53

sebthom commented Jun 4, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

Could it be instead deactivated if some other folding annotations, not coming from TM4E, are present?

@mickaelistria This is not possible I believe. The order in which reconcilers are applied is not predictable. I guess it depends on plugin load order.

The TM4E folding reconciler activation now works as follows:
If folding markers are found in a language-configuration.js file or the TextMate grammar - and no language server is associated with the TextViewer - TM4E applies custom folding based on whitespace indentation and the configured fold markers.

sebthom merged commit c2e635f into eclipse-tm4e:main Jun 4, 2025
sebthom deleted the foldingRegions branch June 11, 2025 13:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL