Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/schemaProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,23 @@ describe('Tests for schema provider feature', () => {
}
]
});
});

it('Multiple contributors with one throwing an error', async () => {
const client = await activate(docUri);
client._customSchemaContributors = {};
client.registerContributor(SCHEMA2, onRequestSchema2URI, onRequestSchema2Content);
client.registerContributor("schemathrowingerror", onRequestSchemaURIThrowError, onRequestSchemaContentThrowError);

await testCompletion(docUri, new vscode.Position(0, 0), {
items: [
{
label: "apple",
kind: 9,
documentation: "An apple"
}
]
});
});
});

Expand Down Expand Up @@ -165,6 +182,14 @@ function onRequestSchema1Content(schemaUri: string): string | undefined {
return schemaJSON;
}

function onRequestSchemaURIThrowError(resource: string): string | undefined {
throw new Error('test what happens when an error is thrown and not caught');
}

function onRequestSchemaContentThrowError(schemaUri: string): string | undefined {
throw new Error('test what happens when an error is thrown and not caught');
}

const schemaJSON2 = JSON.stringify({
"type": "object",
"properties": {
Expand Down