Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indentation with extra spaces after cursor. #764

Conversation

rickcowan
Copy link
Contributor

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.

@coveralls
Copy link

coveralls commented Aug 8, 2022

Coverage Status

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

Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rickcowan can you please add additional test cases for array of array items as well?

Copy link
Collaborator

@gorkem gorkem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks for the contribution

@msivasubramaniaan msivasubramaniaan merged commit f190916 into redhat-developer:main Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants