Since majority of qontract’s syntax is just Gherkin, you can leverage Cucumber plugins for syntax highlighting. Below steps helps you work with the .qontract files in Intellij Idea with syntax highlighting, auto-suggest (only Gherkin keywords) and formatting.
We’ve covered 2 of the most popular editors below. But most well known editors and IDEs should have a way to enable syntax highlighting for files containing Gherkin text.
- Install Cucumber Plugin
- Go to Preference > Editor > File Types and under recognized file types select “Cucumber Scenario”
- Under “Registered Patterns” add “*.qontract” as shown below
This should highlight the Gherkin keywords in your qontract file.
- Install the Cucumber (Gherkin) Full Support plugin
- Open a .qontract file
- Open the command palette by pressing Ctrl+Shift+P on Windows and Cmd+Shift+P on MacOS.
- Select Change Language Mode
- Select feature
In future, .qontract files should open up in this language mode automatically.