alexkrechik / VSCucumberAutoComplete

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

Lack of line break support for formatting and autocompletion #452

Open Clement398 opened 2 years ago

Clement398 commented 2 years ago

Describe the bug When auto-formatting a .feature, if there are line breaks between two example lines, the alignment of the vertical bars will be done individually on each line block instead of all lines. Moreover, if a step expects a number and the first example line is separated from the following ones by a line break, the autocompletion will consider the line in error.

To Reproduce Format a .feature whose example lines are separated by line breaks. Separated the first example line from the others by a line break while one of the steps expects a number.

Expected behavior When formatting, the vertical bars of the example lines align, ignoring line breaks. Autocompletion interprets the lines of examples ignoring line breaks.

Screenshots Before formatting: Image 1 After formatting: Image 2

Step without line break: Image 3 Step with line break: Image 4

Step definition:

Then("I must have delivery fees of {int} on my {string} page", (deliveryCost, page) => {});

Gherkin step line

Feature: Test

  Scenario Outline: Test
    Then I must have delivery fees of <deliveryCost> on my 'confirmation' page

    Examples:
      | lang | country | currency | product          | number | deliveryCost |

      | en   | AR      | EUR      | women jewelry WH | 1      | 25           |