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

text-objects: add test capture & elixir queries #2807

Merged
merged 2 commits into from Jun 21, 2022

Conversation

connorlay
Copy link
Contributor

See #2792

@the-mikedavis
Copy link
Member

This is looking good :)

I might push a commit or two with queries for more languages if that's alright

@connorlay
Copy link
Contributor Author

I might push a commit or two with queries for more languages if that's alright

Go for it! Which languages did you have in mind?

@the-mikedavis
Copy link
Member

I was thinking at least Rust but also Erlang for my sake 😄

For Rust, we can capture the function following the #[test] attribute.

For a few of languages (Erlang EUnit tests and Gleam Gleeunit for example) we could have the captures be pretty much the same as @function.* but only for those functions with a name that have a name that ends in _test.

@connorlay
Copy link
Contributor Author

@the-mikedavis What do you think about queries for languages that have a number of popular test frameworks, like JavaScript?

This leads me to wonder if Helix should support some kind of opt-in queries for specific frameworks? Highlights and textobjects for the Phoenix router DSL would be handy to have available, but I don't think belongs in the core Elixir queries.

@the-mikedavis
Copy link
Member

Hmm I think we should aim to only support official language tooling in the core and leave framework-specific features to plugins (once implemented). Especially if two frameworks conflict, it's hard to be rigorous about which one should get support.

For this feature in particular though I don't see any harm in supporting javascript testing frameworks for example

@connorlay connorlay marked this pull request as ready for review June 21, 2022 14:58
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @connorlay, this is great!

@the-mikedavis the-mikedavis merged commit 9f676da into helix-editor:master Jun 21, 2022
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.

None yet

3 participants