Skip to content

Clojure support - #309

Open
p14n wants to merge 7 commits into
cucumber:mainfrom
p14n:clojure
Open

Clojure support#309
p14n wants to merge 7 commits into
cucumber:mainfrom
p14n:clojure

Conversation

@p14n

@p14n p14n commented Jul 23, 2026

Copy link
Copy Markdown

🤔 What's changed?

Added support for the Clojure language.

⚡️ What's your motivation?

Currently, the Cucumber plugin in Vscode does not recognise step definitions written in clojure. This is the first step.

  • Add Clojure language support (src/language/clojureLanguage.ts)

    • Step definition detection via tree-sitter queries (Given, When, Then, And, But)
    • Handles both cucumber expressions ("I am user {string}") and regex patterns (#"^a regexp$")
    • Strings containing regex capture groups are automatically treated as regular expressions
    • Snippet generation for step definitions
  • Add 'clojure' to LanguageNames in src/language/types.ts

  • Register Clojure in src/language/languages.ts

  • Add @yogthos/tree-sitter-clojure as optional dependency for parsing

  • Add Clojure parser loading in src/tree-sitter-node/clojureParser.ts

  • Add Clojure to NodeParserAdapter and wasm build script

  • Add test data (test/language/testdata/clojure/StepDefinitions.clj)

  • Update README.md to list Clojure as a supported language

Companion PRs needed:

  • cucumber/language-server — add .clj/.cljc/.cljs to glue file extensions
  • cucumber/vscode — add clojure to document selector and default glue patterns

🏷️ What kind of change is this?

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

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

@p14n
p14n marked this pull request as ready for review July 23, 2026 21:51
@p14n

p14n commented Jul 26, 2026

Copy link
Copy Markdown
Author

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.

1 participant