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

Add elm treesitter textobjects #6084

Conversation

magopian
Copy link
Contributor

@magopian magopian commented Feb 23, 2023

Fixes #6083

This is a first (naive) attempt at adding treesitter text objects for the elm language.

To test this out, copy the textobjects.scm file to your runtime folder in runtime/queries/elm and restart helix.

To find where your runtime folder is, use hx --health | grep runtime.

It should now allow you to select

  • the code of function with mif
  • the function itself with its optional type annotation with maf
  • a function parameter with mia or mac
  • a line of block comment with mic or mac

And you can navigate with the same text objects, so

  • previous or next function with [f or ]f
  • previous or next parameter with [a or ]a
  • previous or next comment with [c or ]c

@magopian magopian force-pushed the 6083-add-elm-treesitter-textobjects branch from dc57ee2 to fc72db9 Compare February 23, 2023 09:12
@magopian magopian force-pushed the 6083-add-elm-treesitter-textobjects branch from fc72db9 to a0cd5bc Compare February 23, 2023 09:59
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Feb 23, 2023
@the-mikedavis the-mikedavis merged commit 98a3d46 into helix-editor:master Feb 25, 2023
estin pushed a commit to estin/helix that referenced this pull request Mar 4, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add treesitter text objects for the elm language
2 participants