Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
count++;
if ((!LSIF.Edge.is11(edge) && !(LSIF.Edge.is1N(edge))) || edge.outV === undefined) {
// This error was caught before
return;
}
if (edge.label === undefined || !Object.values(LSIF.EdgeLabels).includes(edge.label)) {
errors.push(new Error(edges[key].element, edge.label ? `requires property "label"` : `unknown label`));
edges[key].invalidate();
return;
}
let validation: ValidatorResult;
switch (edge.label) {
case LSIF.EdgeLabels.item:
validation = validateSchema(edge, itemSchema);
break;
case LSIF.EdgeLabels.contains:
validation = validateSchema(edge, e1NSchema);
break;
default:
validation = validateSchema(edge, e11Schema);
}
const validationErrors: ValidationError[] = validation.errors.filter((error) => error.property === 'instance');
if (validationErrors.length > 0) {
edges[key].invalidate();
errors.push(new Error(edges[key].element, validationErrors.join('; ')));
}
});
ids.forEach((key: string) => {
const edge: LSIF.Edge = edges[key].element as LSIF.Edge;
outputMessage = `Verifying edge ${count} of ${length}...`;
process.stdout.write(`${outputMessage}\r`);
count++;
if ((!LSIF.Edge.is11(edge) && !(LSIF.Edge.is1N(edge))) || edge.outV === undefined) {
// This error was caught before
return;
}
if (edge.label === undefined || !Object.values(LSIF.EdgeLabels).includes(edge.label)) {
errors.push(new Error(edges[key].element, edge.label ? `requires property "label"` : `unknown label`));
edges[key].invalidate();
return;
}
let validation: ValidatorResult;
switch (edge.label) {
case LSIF.EdgeLabels.item:
validation = validateSchema(edge, itemSchema);
break;
case LSIF.EdgeLabels.contains:
validation = validateSchema(edge, e1NSchema);
break;
default:
validation = validateSchema(edge, e11Schema);
}
if (element.type === lsif.ElementTypes.edge) {
switch (element.label) {
case lsif.EdgeLabels.contains:
this.handleContains(element)
break
case lsif.EdgeLabels.next:
this.handleNextEdge(element)
break
case lsif.EdgeLabels.item:
this.handleItemEdge(element)
break
case lsif.EdgeLabels.textDocument_definition:
this.handleDefinitionEdge(element)
break
case lsif.EdgeLabels.textDocument_references:
this.handleReferenceEdge(element)
break
case lsif.EdgeLabels.textDocument_hover:
this.handleHoverEdge(element)
break
case lsif.EdgeLabels.moniker:
this.handleMonikerEdge(element)
break
case lsif.EdgeLabels.nextMoniker: