Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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

@connorlay connorlay force-pushed the clay-textobject-test branch from cc1d4eb to abb865a Compare June 18, 2022 23:05
@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
@archseer archseer requested a review from the-mikedavis June 21, 2022 16:25
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants