Skip to content

Feature/enable transformer capture #234

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

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

luke-hill
Copy link
Contributor

@luke-hill luke-hill commented Oct 5, 2023

🤔 What's changed?

Expose transformer arg on ParameterType.

⚡️ What's your motivation?

Needed for CCK conformancy (v12/v13) for cucumber-ruby. We need to store the SourceLocation proc for the ParameterType, this is currently not possible.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)
  • 💥 Breaking change (incompatible changes to the API)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • 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.

@mpkorstanje
Copy link
Contributor

Needed for CCK conformancy (v12/v13) for cucumber-ruby

@luke-hill could you elaborate on this? For the CCK I would expect transform would be sufficient.

@luke-hill
Copy link
Contributor Author

Sure. Basically we don't have this reader. So this reader will enable us to grab the transformer proc. Specifically it's SourceLocation

This is what the other languages do I believe, but it wasn't present in ruby. This will now enable us to use v12/v13 cck and fix up the final hard-coded bit of logic in the CCK conformancy PR.

@mpkorstanje
Copy link
Contributor

Check, looks like Java is the exception here (no easy way to get a source location). So that makes sense. See it's public in JS too.

@luke-hill
Copy link
Contributor Author

Out of curiousity. How do you conform to the CCK that stipulates you need a SourceLocation for the ParameterType in java then? Requested here: https://github.com/cucumber/cucumber-jvm/pull/2739/files

@luke-hill luke-hill merged commit 66964f5 into main Oct 6, 2023
@luke-hill luke-hill deleted the feature/enable_transformer_capture branch October 6, 2023 10:54
@mpkorstanje
Copy link
Contributor

Cucumber-JVM doesn't expose the API from Cucumber Expressions to the end user. So instead of having the user register a parameter type, they annotate a method and Cucumber JVM maps that annotated method to a parameter type and registers it. The messages are then created based on the parameter type registered and the source location of the annotated method.

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