Skip to content

Commit 8f2aef5

Browse files
authored
feat: unify string insert text for array and property (#29)
1 parent 37ab7f0 commit 8f2aef5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/languageservice/services/yamlCompletion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ export class YamlCompletion {
13821382
insertText = `\${${insertIndex++}:0}`;
13831383
break;
13841384
case 'string':
1385-
insertText = `\${${insertIndex++}:""}`;
1385+
insertText = `\${${insertIndex++}}`;
13861386
break;
13871387
case 'object':
13881388
{

test/autoCompletion.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ describe('Auto Completion Tests', () => {
13661366
const completion = parseSetup(content, content.lastIndexOf('Ba') + 2); // pos: 3+2
13671367
completion
13681368
.then(function (result) {
1369-
assert.strictEqual('fooBar:\n - ${1:""}', result.items[0].insertText);
1369+
assert.strictEqual('fooBar:\n - ${1}', result.items[0].insertText);
13701370
})
13711371
.then(done, done);
13721372
});

test/autoCompletionFix.test.ts

+1-1
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)