How to use the lsif-protocol.Edge.is11 function in lsif-protocol

To help you get started, we’ve selected a few lsif-protocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / lsif-node / util / src / filter.ts View on Github external
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) => {
github microsoft / lsif-node / tsc / src / emitters / vis.ts View on Github external
case 'reference':
									label = `${element.tag.text} [ref]`;
									break;
							}
						}
						break;
					default:
						label = element.label;
				}
				let node: VisNode = {
					id: element.id as number,
					label: label
				}
				data.nodes.push(node);
			} else if (element.type === 'edge') {
				if (Edge.is11(element)) {
					data.edges.push({
						from: element.outV as number,
						to: element.inV as number,
						label: element.label
					});
				} else {
					for (let inV of element.inVs) {
						data.edges.push({
							from: element.outV as number,
							to: inV as number,
							label: element.label
						});
					}
				}
			}
		},
github microsoft / lsif-node / sqlite / src / graphStore.ts View on Github external
private insertEdge(edge: Edge): void {
		let label = this.shortForm(edge);
		if (Edge.is11(edge)) {
			this.edgeInserter.do(edge.id, label, edge.outV, edge.inV);
		} else if (Edge.is1N(edge)) {
			for (let inV of edge.inVs) {
				this.edgeInserter.do(edge.id, label, edge.outV, inV);
			}
		}
	}