From 49d5f33731e4463ee448377b9ebb6b64cce52395 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 29 Apr 2020 20:38:13 +0200 Subject: [PATCH] Fix #93902 --- src/vs/platform/userDataSync/common/snippetsSync.ts | 2 +- .../userDataSync/test/common/snippetsSync.test.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/userDataSync/common/snippetsSync.ts b/src/vs/platform/userDataSync/common/snippetsSync.ts index 3f710d0b44a..d802e543cf4 100644 --- a/src/vs/platform/userDataSync/common/snippetsSync.ts +++ b/src/vs/platform/userDataSync/common/snippetsSync.ts @@ -417,7 +417,7 @@ export class SnippetsSynchroniser extends AbstractSynchroniser implements IUserD for (const entry of stat.children || []) { const resource = entry.resource; const extension = extname(resource); - if (extension === '.json' || extension === '.code-snippet') { + if (extension === '.json' || extension === '.code-snippets') { const key = relativePath(this.snippetsFolder, resource)!; const content = await this.fileService.readFile(resource); snippets[key] = content; diff --git a/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts b/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts index 5546792c101..7943e35359f 100644 --- a/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts @@ -597,7 +597,7 @@ suite('SnippetsSync', () => { }); test('sync global and language snippet', async () => { - await updateSnippet('global.code-snippet', globalSnippet, client2); + await updateSnippet('global.code-snippets', globalSnippet, client2); await updateSnippet('html.json', htmlSnippet1, client2); await client2.sync(); @@ -607,17 +607,17 @@ suite('SnippetsSync', () => { const actual1 = await readSnippet('html.json', testClient); assert.equal(actual1, htmlSnippet1); - const actual2 = await readSnippet('global.code-snippet', testClient); + const actual2 = await readSnippet('global.code-snippets', testClient); assert.equal(actual2, globalSnippet); const { content } = await testClient.read(testObject.resource); assert.ok(content !== null); const actual = parseSnippets(content!); - assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'global.code-snippet': globalSnippet }); + assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'global.code-snippets': globalSnippet }); }); test('sync should ignore non snippets', async () => { - await updateSnippet('global.code-snippet', globalSnippet, client2); + await updateSnippet('global.code-snippets', globalSnippet, client2); await updateSnippet('html.html', htmlSnippet1, client2); await updateSnippet('typescript.json', tsSnippet1, client2); await client2.sync(); @@ -628,7 +628,7 @@ suite('SnippetsSync', () => { const actual1 = await readSnippet('typescript.json', testClient); assert.equal(actual1, tsSnippet1); - const actual2 = await readSnippet('global.code-snippet', testClient); + const actual2 = await readSnippet('global.code-snippets', testClient); assert.equal(actual2, globalSnippet); const actual3 = await readSnippet('html.html', testClient); assert.equal(actual3, null); @@ -636,7 +636,7 @@ suite('SnippetsSync', () => { const { content } = await testClient.read(testObject.resource); assert.ok(content !== null); const actual = parseSnippets(content!); - assert.deepEqual(actual, { 'typescript.json': tsSnippet1, 'global.code-snippet': globalSnippet }); + assert.deepEqual(actual, { 'typescript.json': tsSnippet1, 'global.code-snippets': globalSnippet }); }); function parseSnippets(content: string): IStringDictionary { -- GitLab