alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 79 forks source link

Version 3.0.1 does not honor 0 tab for Scenario in cucumberautocomplete.formatConfOverride #494

Closed jonyo closed 3 weeks ago

jonyo commented 3 weeks ago

Describe the bug In cucumberautocomplete.formatConfOverride I have set:

  "cucumberautocomplete.formatConfOverride": {
    "Feature": 0,
    "Background": 0,
    "Scenario": 0,
    "Step": 1,
    "Given": 1,
    "When": 1,
    "Then": 1,
    "And": 1,
    "But": 1,
    "\\*": 1,
    "Examples": 0,
    "Example": 1
  },

After updating to version 3.0.1, when I save an existing file, it adds tabs to all the Scenario lines. This breaks the gherkin linting since we have the linter set to use 0 tabs for scenario.

If I downgrade to version 2.15.2 and save the file, it fixes the formatting to have 0 tabs as expected.

Cucumberautocomplete part of VSCode settings:

{
  "cucumberautocomplete.steps": ["tests/**/steps/*.ts"],
  "cucumberautocomplete.syncfeatures": "tests/**/feature/*.feature",
  "cucumberautocomplete.strictGherkinCompletion": true,
  "cucumberautocomplete.onTypeFormat": true,
  "cucumberautocomplete.formatConfOverride": {
    "Feature": 0,
    "Background": 0,
    "Scenario": 0,
    "Step": 1,
    "Given": 1,
    "When": 1,
    "Then": 1,
    "And": 1,
    "But": 1,
    "\\*": 1,
    "Examples": 0,
    "Example": 1
  },
}
alexkrechik commented 3 weeks ago

Nice case. Please retest in the 3.0.2 version of the extension and open a new issue if some problems still exist.