Skip to content

- array item suggestion gives extra line #930

@p-spacek

Description

@p-spacek

Describe the bug

after applying PR #901 (- (array item) suggestion was missing for some specific situations, for example: enums.)

the inserted text - (array item) includes also a new line symbol
the problem was there before that PR, but it's possible to reproduce it by the test case mentioned inside the PR:

https://user-images.githubusercontent.com/38421337/252634068-a856895b-f708-4dc9-917f-7b97a7b9988b.png

{
          type: 'object',
          properties: {
            references: {
              type: 'array',
              items: {
                enum: ['item1', 'item2']
              }
           }
      }
 }

Expected Behavior

the yaml after insert should looks like

stories:
  - item1
  - 

so no extra new line

Current Behavior

stories:
  - item1
  -
  # extra line

Environment

probably all

  • Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions