[json] Trying to set local JSON Schema file, generates empty files while typing the filename. Fixes #92300

This commit is contained in:
Martin Aeschlimann 2020-03-11 15:28:10 +01:00
parent d2d9498c73
commit 0da9f3f250

View file

@ -188,6 +188,9 @@ export function activate(context: ExtensionContext) {
// handle content request
client.onRequest(VSCodeContentRequest.type, (uriPath: string) => {
const uri = Uri.parse(uriPath);
if (uri.scheme === 'untitled') {
return Promise.reject(new Error(localize('untitled.schema', 'Unable to load {0}', uri.toString())));
}
if (uri.scheme !== 'http' && uri.scheme !== 'https') {
return workspace.openTextDocument(uri).then(doc => {
schemaDocuments[uri.toString()] = true;