diff --git a/src/languageservice/services/jsonSchemaService.ts b/src/languageservice/services/jsonSchemaService.ts index 0e08a4cd..e7b6fa0b 100644 --- a/src/languageservice/services/jsonSchemaService.ts +++ b/src/languageservice/services/jsonSchemaService.ts @@ -518,7 +518,7 @@ export class JSONSchemaService implements IJSONSchemaService { return entry.getCombinedSchema(this).getResolvedSchema(); } } - return null; + return this.promise.resolve(null); }; if (this.customSchemaProvider) { return this.customSchemaProvider(resource).then(schemaUri => { diff --git a/test/schema.test.ts b/test/schema.test.ts index 3ff77b91..cf5fe55a 100644 --- a/test/schema.test.ts +++ b/test/schema.test.ts @@ -279,4 +279,14 @@ suite('JSON Schema', () => { testDone(error); }); }); + + test('Null Schema', function (testDone) { + let service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); + + service.getSchemaForResource('test.json').then((schema) => { + assert.equal(schema, null); + }).then(() => testDone(), (error) => { + testDone(error); + }); + }); }); \ No newline at end of file