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

feat: add folding range provider #445

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NJichev
Copy link
Collaborator

@NJichev NJichev commented May 3, 2024

Closes #56
Adds a folding range provider. For now it only works on do end blocks.
Things to consider:

  • typespecs and docs and whether to fold them together with their respsective function - makes this PR a bit harder and maybe it's not necessary for starters?
  • folding on fn -> end blocks - I think this should be added as well in the first version

@mhanberg
Copy link
Collaborator

mhanberg commented May 3, 2024

The folds I added to nvim-treesitter currently consist of


[
  (anonymous_function)
  (stab_clause)
  (arguments)
  (block)
  (do_block)
  (list)
  (map)
  (tuple)
] @fold

So should at least do those.

Eventually it would be nice to fold consecutive alias Foo.Bar, as we have a lot of them in the Next LS code base, would be cool to fold them up.

@NJichev
Copy link
Collaborator Author

NJichev commented May 3, 2024

Thanks for the feedback, I'll go and implement them, will edit the original comment with a todo list for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

folding
2 participants