Skip to content

Commit

Permalink
feat: unify string insert text for array and property
Browse files Browse the repository at this point in the history
  • Loading branch information
p-spacek committed Nov 8, 2023
1 parent ed03cbf commit 5a61da9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/languageservice/services/yamlCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ export class YamlCompletion {
insertText = `\${${insertIndex++}:0}`;
break;
case 'string':
insertText = `\${${insertIndex++}:""}`;
insertText = `\${${insertIndex++}}`;
break;
case 'object':
{
Expand Down
2 changes: 1 addition & 1 deletion test/autoCompletion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ describe('Auto Completion Tests', () => {
const completion = parseSetup(content, content.lastIndexOf('Ba') + 2); // pos: 3+2
completion
.then(function (result) {
assert.strictEqual('fooBar:\n - ${1:""}', result.items[0].insertText);
assert.strictEqual('fooBar:\n - ${1}', result.items[0].insertText);
})
.then(done, done);
});
Expand Down
2 changes: 1 addition & 1 deletion test/autoCompletionFix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ objB:

expect(completion.items.length).equal(1);
expect(completion.items[0]).to.be.deep.equal(
createExpectedCompletion('objectWithArray', 'objectWithArray:\n - ${1:""}', 1, 4, 1, 4, 10, 2, {
createExpectedCompletion('objectWithArray', 'objectWithArray:\n - ${1}', 1, 4, 1, 4, 10, 2, {
documentation: '',
})
);
Expand Down

0 comments on commit 5a61da9

Please sign in to comment.