redhat-developer / yaml-language-server

Language Server for YAML Files
MIT License
1.01k stars 244 forks source link

`- array item` suggestion gives extra line #930

Closed p-spacek closed 8 months ago

p-spacek commented 8 months ago

Describe the bug

after applying PR https://github.com/redhat-developer/yaml-language-server/pull/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

p-spacek commented 8 months ago

closing this, it's not worth bothering with it, I think...