How to use the lsif-protocol.ElementTypes.edge 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 / vscode-lsif-extension / server / src / json.ts View on Github external
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', () => {
github microsoft / lsif-node / npm / src / main.ts View on Github external
protected createNextMonikerEdge(outV: Id, inV: Id): nextMoniker {
		return {
			id: this.idGenerator(),
			type: ElementTypes.edge,
			label: EdgeLabels.nextMoniker,
			outV: outV,
			inV: inV
		};
	}
github microsoft / lsif-node / sqlite / src / blobStore.ts View on Github external
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;