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

Keep space before word after inserting completion #363

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

evidolob
Copy link
Collaborator

What does this PR do?

When completion invoked on field which has value:
name: <cursor>aName and file has scheme which contains defaultSnippets for name:

"properties": {
      "name": {
          "type": "string",
          "defaultSnippets": [
              {
                  "label": "some",
                  "body": "some"
              }
          ]
      },
}

it contains one option some, but inserting of that item will break yaml, as it 'eats' space after ::
name:someaName, this PR fix that, and now it no break yaml, so editor should contain name: someaName.

What issues does this PR fix or reference?

Found during work on redhat-developer/vscode-tekton#429

Is it tested? How?

You may use schema example from this description, or try complete any yaml mapping value. Completion shouldn't breck yaml syntax.

Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob evidolob self-assigned this Nov 26, 2020
@coveralls
Copy link

coveralls commented Nov 26, 2020

Coverage Status

Coverage decreased (-0.2%) to 80.061% when pulling 53b10c9 on evidolob:fix-insertion into ce1609d on redhat-developer:master.

Copy link
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

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

The test case worked for me. I just found out we have another semi-related issue that is present on master as well though

If we have an empty document and then auto complete at the root with the schema given we will get:

name:some

instead of

name: some

It's unrelated to this PR but I found it while testing 😄. I'll open an issue for it

EDIT: The issue is here: #364

@evidolob evidolob merged commit 1501f11 into redhat-developer:master Nov 30, 2020
@evidolob evidolob deleted the fix-insertion branch November 30, 2020 13:06
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