Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = result.filter((element: LSIF.Element) => {
/* ToDo@jumattos The element is a vertex here as well. Uncomment the if and test are failing*/
if (element.type !== ElementTypes.edge) {
return false;
}
let edge: Edge = element as Edge;
if (Edge.is11(edge)) {
return includes(inV, edge.inV);
} else {
console.log(JSON.stringify(edge, undefined, 0));
for (let item of edge.inVs) {
if (includes(inV, item)) {
return true;
}
}
return false;
}
});
result = result.filter((element: LSIF.Element) => {
rd.on('line', (line: string) => {
if (!line || line.length === 0) {
return;
}
let element: Edge | Vertex = JSON.parse(line);
switch (element.type) {
case ElementTypes.vertex:
this.processVertex(element);
break;
case ElementTypes.edge:
this.processEdge(element);
break;
}
});
rd.on('close', () => {
protected createNextMonikerEdge(outV: Id, inV: Id): nextMoniker {
return {
id: this.idGenerator(),
type: ElementTypes.edge,
label: EdgeLabels.nextMoniker,
outV: outV,
inV: inV
};
}
this.handleReferenceResult(element);
break;
case VertexLabels.foldingRangeResult:
this.handleFoldingRange(element);
break;
case VertexLabels.documentSymbolResult:
this.handleDocumentSymbols(element);
break;
case VertexLabels.diagnosticResult:
this.handleDiagnostics(element);
break;
case VertexLabels.event:
this.handleEvent(element);
break;
}
} else if (element.type === ElementTypes.edge) {
switch(element.label) {
case EdgeLabels.next:
this.handleNextEdge(element);
break;
case EdgeLabels.moniker:
this.handleMonikerEdge(element);
break;
case EdgeLabels.textDocument_foldingRange:
this.handleFoldingRangeEdge(element);
break;
case EdgeLabels.textDocument_documentSymbol:
this.handleDocumentSymbolEdge(element);
break;
case EdgeLabels.textDocument_diagnostic:
this.handleDiagnosticsEdge(element);
break;