Skip to content

Commit 4b91dd3

Browse files
authored
feat: unify string insert text for array and property (#934)
1 parent dfccc6f commit 4b91dd3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/languageservice/services/yamlCompletion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ export class YamlCompletion {
12051205
insertText = `\${${insertIndex++}:0}`;
12061206
break;
12071207
case 'string':
1208-
insertText = `\${${insertIndex++}:""}`;
1208+
insertText = `\${${insertIndex++}}`;
12091209
break;
12101210
case 'object':
12111211
{

test/autoCompletion.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ describe('Auto Completion Tests', () => {
10471047
const completion = parseSetup(content, content.lastIndexOf('Ba') + 2); // pos: 3+2
10481048
completion
10491049
.then(function (result) {
1050-
assert.strictEqual('fooBar:\n - ${1:""}', result.items[0].insertText);
1050+
assert.strictEqual('fooBar:\n - ${1}', result.items[0].insertText);
10511051
})
10521052
.then(done, done);
10531053
});

test/autoCompletionFix.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ objB:
482482

483483
expect(completion.items.length).equal(1);
484484
expect(completion.items[0]).to.be.deep.equal(
485-
createExpectedCompletion('objectWithArray', 'objectWithArray:\n - ${1:""}', 1, 4, 1, 4, 10, 2, {
485+
createExpectedCompletion('objectWithArray', 'objectWithArray:\n - ${1}', 1, 4, 1, 4, 10, 2, {
486486
documentation: '',
487487
})
488488
);

0 commit comments

Comments
 (0)