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

Go step definitions support #130

Merged
merged 7 commits into from
Apr 7, 2024
Merged

Conversation

mirogta
Copy link
Contributor

@mirogta mirogta commented Feb 27, 2023

🤔 What's changed?

Used https://tree-sitter.github.io/tree-sitter/playground to figure out the syntax tree.

godog doesn't have support for Parameter Types so not using it. (The other BDD library in Go, https://github.com/go-bdd/gobdd has support for Parameter Types, but it's obsolete…)

godog doesn't use Given, When or Then keywords, but instead a generic Step keyword.

  • You probably don't want .vscode/launch.json and .vscode/settings.json committed, but I've left it there for my own sake to be able to debug this faster. Happy to remove them for the final commit before merging.

⚡️ What's your motivation?

  • To make this finally usable in Go

🏷️ What kind of change is this?

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

♻️ Anything particular you want feedback on?

Unit tests are passing… I'm new to vscode extension development, so please bear with me.
I'm trying to follow this and have added go support to both cucumber/language-server and cucumber/vscode locally, but somehow I can't get it work. Can someone please advise how do I debug that? The guide in cucumber/vscode says "Chose Run -> Run without debugging".

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

@mirogta mirogta marked this pull request as ready for review February 27, 2023 23:09
@CodiumAI-Agent
Copy link

How to use PR-Agent

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review - Request a review of the latest update to the PR.
/describe - Modify the PR title and description based on the contents of the PR.
/improve - Suggest improvements to the code in the PR. These will be provided as pull request comments, ready to commit.
/ask - Pose a question about the PR.

@GadiZimerman
Copy link

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Adding support for Go language
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: Yes
  • Focused PR: Yes, the PR is focused as it is primarily concerned with adding support for the Go language. The title and description clearly state this, and the code changes align with this objective.
  • 🔒 Security concerns: No, the PR does not introduce any obvious security concerns. It primarily involves adding support for a new language and does not deal with user input or database operations.

PR Feedback

  • 💡 General PR suggestions: The PR is well-structured and the changes are well-documented. However, there are some .vscode settings files included in the PR that might not be necessary for the project and could be removed before merging. Also, it would be beneficial to add more detailed comments in the new Go language support code for better maintainability.

How to use

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review - Request a review of the latest update to the PR.
/describe - Modify the PR title and description based on the contents of the PR.
/improve - Suggest improvements to the code in the PR. These will be provided as pull request comments, ready to commit.
/ask - Pose a question about the PR.

@cpunion
Copy link

cpunion commented Aug 24, 2023

What is the status of this PR?

@iamNoah1
Copy link

hei @mirogta wanna to check in what the progress is here and if you need some help by any chance?!

@mirogta
Copy link
Contributor Author

mirogta commented Sep 21, 2023

@cpunion @iamNoah1 - if this looks abandoned, that's because I had other priorities. Happy for anyone else to pick this up and continue/get it done. I won't have bandwidth for it anytime soon.

@lucas-deangelis
Copy link

What are the current blockers for this PR to be merged? I'm assuming that the first two comments raised by @CodiumAI-Agent should be fixed, but the third is not specific to the integration of Go, but I'm not certain. Is there anything else needed?

@CodiumAI-Agent
Copy link

How to use PR-Agent

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@mirogta
Copy link
Contributor Author

mirogta commented Oct 12, 2023

What are the current blockers for this PR to be merged? I'm assuming that the first two comments raised by @CodiumAI-Agent should be fixed, but the third is not specific to the integration of Go, but I'm not certain. Is there anything else needed?

That + the two branch conflicts + running a test that this actually works

@CodiumAI-Agent
Copy link

How to use PR-Agent

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@kieran-ryan kieran-ryan added the ⚡ enhancement Request for new functionality label Jan 7, 2024
- Support for new 'Given', 'When', 'Then' step definitions
- Support for 'interpreted_string_literal' with tree-sitter
- Support tree-sitter-go v0.20.0
- Changed Go snippet implementation away from Rust version
- Removed Rust snippet string prefix check from Go implementation
- Removed commented Go language support code
- Missing 'expression_statement' in tree-sitter query
- Redundant VSCode extension settings
- Redundant Go testdata lock files
@kieran-ryan kieran-ryan self-assigned this Apr 7, 2024
@kieran-ryan kieran-ryan changed the title Add support for go Godog step definitions support Apr 7, 2024
@kieran-ryan kieran-ryan changed the title Godog step definitions support Go step definitions support Apr 7, 2024
@kieran-ryan
Copy link
Sponsor Member

Sincere thanks for this contribution @mirogta! We'll roll this into a coming release. Have tested and made the following changes:

  • Support for Given, When and Then step definition keywords - introduced through Implement unambiguous keywords godog#509
  • Support for interpreted_string_literal ("the bee's knees") further to raw_string_literal (^a regexp$)
  • Added required expression_statement to the tree-sitter query
  • Removed the VSCode extension settings, Go test data lock files; and commented code highlighted by @CodiumAI-Agent
  • Bumped tree-sitter-go to v0.20.0
  • Replaced Rust step definition in Go implementation with a Go sample
  • Added unit test for the Go string literal function

I'm trying to follow this and have added go support to both cucumber/language-server and cucumber/vscode locally, but somehow I can't get it work. Can someone please advise how do I debug that? The guide in cucumber/vscode says "Chose Run -> Run without debugging".

Have recently overhauled the VSCode extension contributing guidelines, feel free to give it a go and raise a PR or issue if any improvements or feedback.

@kieran-ryan kieran-ryan merged commit 9c4cec5 into cucumber:main Apr 7, 2024
6 checks passed
@aslakhellesoy
Copy link
Contributor

Hi @mirogta,

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

@mirogta mirogta deleted the add-go-godog branch April 9, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Go (Godog)
8 participants