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

step definition supports in php file #28

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

shth
Copy link
Contributor

@shth shth commented Apr 6, 2022

🤔 What's changed?

Added queries for tree sitter to grep the step definition node.

⚡️ What's your motivation?

I want to have code completion in php files

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

First of all, thanks to the person reviewing this 🙇. I am new to cucumber and tree-sitter and new to contributing to open source in general. So forgive me if something is obviously wrong.

Back to the code:
I could not find any docs about defining parameter types in PHP. Can anyone give me some pointers to docs/guides on how to do it? Thanks!

📋 Checklist:

  • finish parameter types query
  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@aslakhellesoy
Copy link
Contributor

Hi @shth - thanks for contributing this! I'm going to be away for little over a week - hope to look into this when I'm back.

@shth
Copy link
Contributor Author

shth commented Apr 9, 2022

@aslakhellesoy No problem! Thanks in advance for the help

Copy link
Contributor

@aslakhellesoy aslakhellesoy left a comment

Choose a reason for hiding this comment

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

This looks like a good start. I haven't had a chance to run the code yet. Could you please update your PR with the main branch? The changes from #30 will introduce some merge conflicts, but overall it should simplify the code a bit.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/tree-sitter/helpers.ts Outdated Show resolved Hide resolved
@aslakhellesoy
Copy link
Contributor

I've made some more changes on main to make it easier to add support for a new language. Please see CONTRIBUTING.md

@shth shth force-pushed the add-php-tree-sitter branch from b9a3ba6 to 52a346f Compare April 26, 2022 17:47
@shth
Copy link
Contributor Author

shth commented Apr 26, 2022

Hi @aslakhellesoy, I have rebased to the main branch. Please have a look.

Sorry I went silent for a few days.

@shth shth marked this pull request as ready for review April 26, 2022 17:49
@shth shth requested a review from aslakhellesoy April 26, 2022 17:49
@shth
Copy link
Contributor Author

shth commented Apr 26, 2022

Also thanks for the refactoring! It feels much cleaner to add languages now.

Copy link
Contributor

@aslakhellesoy aslakhellesoy left a comment

Choose a reason for hiding this comment

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

Excellent work @shth! Regarding parameter types - this is a Cucumber Expressions concept. Since Cucumber Expressions aren't yet ported to PHP and integrated into Behat, it's correct to leave the defineParameterTypeQueries as an empty array.

/cc @ciaranmcnulty

@shth
Copy link
Contributor Author

shth commented Apr 27, 2022

@aslakhellesoy thanks for the explanation. I have fixed the eslint errors btw.

@shth shth changed the title [Help Needed] Support building step definitions from php files step definition supports in php file Apr 27, 2022
@aslakhellesoy aslakhellesoy merged commit a91ac28 into cucumber:main Apr 27, 2022
@aslakhellesoy
Copy link
Contributor

Hi @shth,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@shth shth deleted the add-php-tree-sitter branch April 28, 2022 03:42
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.

2 participants