I’m having a similar issue trying to get Gherkin files to auto-indent correctly. Gherkin language is more keyword-based, and there really is no “decreateIndentPattern”. Example:
Feature: description of the feature
... description can continue here.
Scenario: describe the scenario
Given some precondition
When I take some action
Then I verify some outcome
Scenario: another scenario starts here
So if the
increaseIndentPattern is “(Feature|Scenario):”, the indentation is correct for a single Scenario, but once you hit the 2nd Scenario line, Atom keeps it at the indentation of “Then”, and the following lines are then indented further. So if you have 8 Scenarios in the file, the last one is indented 8 times, and that’s obviously wrong.
decreaseIndentPattern to “Scenario:” actually undoes the indentation from “Feature”, so then all the Scenario lines are left-aligned (same level as “Feature”), and that is also wrong.
I can’t seem to find a way to do it the Right Way™ in Atom. It’s kind of similar to Python, where there is no end-of-scope demarcation.
On the other hand, Atom’s code folding does work correctly, and it is able to properly identify that each Scenario can be folded down. So it would be nice if there were a way to treat the code folding patterns as a kind of “tree” (think of a directory structure, where “/” is the root, and each child is indented to the same level of indentation), and automatically indent the file based on the tree.