yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

Fix indentation with extra spaces after cursor.

Open rickcowan opened this issue 3 years ago • 1 comments

What does this PR do?

Fixes an indentation issue when you have trailing spaces after the hyphen.

Given the schema:

{
  type: 'object',
  properties: {
    test: {
      type: 'array',
      items: {
        type: 'object',
        properties: {
          objA: {
            type: 'object',
            required: ['itemA'],
            properties: {
              itemA: {
                type: 'string',
              }
            }
          }
        }
      }
    }
  }
}

The following yaml:

test:
  - #________(# = cursor, _ = spaces)

Would be autocompleted to:

test:
  - objA:
             itemA: 

After the fix it autocompletes to:

test:
  - objA:
      itemA: 

What issues does this PR fix or reference?

no ref

Is it tested? How?

Manual and unit test.

rickcowan avatar Aug 08 '22 20:08 rickcowan

Coverage Status

Coverage increased (+0.006%) to 82.861% when pulling 49ea2672abd3217ad5757b6e74738c9962adcb5f on jigx-com:fix/main-wrong-autocomplete-indentation into bb0d33fda7e2e9776c130b17f5e420a6f8aba757 on redhat-developer:main.

coveralls avatar Aug 08 '22 20:08 coveralls