Skip to content

Commit

Permalink
Warning on all settings.json: `$ref 'definitions/length' in {1} can n…
Browse files Browse the repository at this point in the history
…ot be resolved'. Fixes microsoft/vscode#31932
  • Loading branch information
aeschli committed Aug 8, 2017
1 parent b041209 commit f49b655
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/jsonSchemaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export class JSONSchemaService implements IJSONSchemaService {
return current;
};

let resolveLink = (node: any, linkedSchema: JSONSchema, linkPath: string): void => {
let resolveLink = (node: any, linkedSchema: JSONSchema, linkedSchemaURI: string, linkPath: string): void => {
let section = findSection(linkedSchema, linkPath);
if (section) {
for (let key in section) {
Expand All @@ -405,7 +405,7 @@ export class JSONSchemaService implements IJSONSchemaService {
}
}
} else {
resolveErrors.push(localize('json.schema.invalidref', '$ref \'{0}\' in {1} can not be resolved.', linkPath, linkedSchema.id));
resolveErrors.push(localize('json.schema.invalidref', '$ref \'{0}\' in \'{1}\' can not be resolved.', linkPath, linkedSchemaURI));
}
delete node.$ref;
};
Expand All @@ -420,7 +420,7 @@ export class JSONSchemaService implements IJSONSchemaService {
let loc = linkPath ? uri + '#' + linkPath : uri;
resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0]));
}
resolveLink(node, unresolvedSchema.schema, linkPath);
resolveLink(node, unresolvedSchema.schema, uri, linkPath);
return resolveRefs(node, unresolvedSchema.schema, uri);
});
};
Expand Down Expand Up @@ -471,7 +471,7 @@ export class JSONSchemaService implements IJSONSchemaService {
openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL));
continue;
} else {
resolveLink(next, parentSchema, segments[1]);
resolveLink(next, parentSchema, parentSchemaURL, segments[1]);
}
}
collectEntries(next.items, next.additionalProperties, next.not);
Expand Down

0 comments on commit f49b655

Please sign in to comment.