Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const create: Create = (writer: Writer, idGenerator: () => Id): Emitter => {
let vertices: Map;
const labelMap: Map = new Map([
[EdgeLabels.item, 'item'],
[EdgeLabels.contains, 'contains'],
[EdgeLabels.next, 'next'],
[EdgeLabels.textDocument_documentSymbol, 'textDocument.documentSymbol'],
[EdgeLabels.textDocument_foldingRange, 'textDocument.foldingRange'],
[EdgeLabels.textDocument_diagnostic, 'textDocument.diagnostic'],
[EdgeLabels.textDocument_documentLink, 'textDocument.documentLink'],
[EdgeLabels.textDocument_definition, 'textDocument.definition'],
[EdgeLabels.textDocument_typeDefinition, 'textDocument.typeDefinition'],
[EdgeLabels.textDocument_hover, 'textDocument.hover'],
[EdgeLabels.textDocument_references, 'textDocument.references'],
[EdgeLabels.textDocument_implementation, 'textDocument.implementation'],
]);
return {
start: () => {
vertices = new Map();
},
emit: (element: Vertex | Edge) => {
if (element.type === ElementTypes.vertex) {
let gs: GraphSonVertex;
let values: GraphSonProperty[];
switch (element.label) {
case 'project':
gs = {
export const create: Create = (idGenerator: () => Id): Emitter => {
let vertices: Map;
const labelMap: Map = new Map([
[EdgeLabels.item, 'item'],
[EdgeLabels.contains, 'contains'],
[EdgeLabels.refersTo, 'refersTo'],
[EdgeLabels.textDocument_documentSymbol, 'textDocument.documentSymbol'],
[EdgeLabels.textDocument_foldingRange, 'textDocument.foldingRange'],
[EdgeLabels.textDocument_diagnostic, 'textDocument.diagnostic'],
[EdgeLabels.textDocument_documentLink, 'textDocument.documentLink'],
[EdgeLabels.textDocument_definition, 'textDocument.definition'],
[EdgeLabels.textDocument_typeDefinition, 'textDocument.typeDefinition'],
[EdgeLabels.textDocument_hover, 'textDocument.hover'],
[EdgeLabels.textDocument_references, 'textDocument.references'],
[EdgeLabels.textDocument_implementation, 'textDocument.implementation'],
]);
return {
start: () => {
vertices = new Map();
},
emit: (element: Vertex | Edge) => {
if (element.type === ElementTypes.vertex) {
let gs: GraphSonVertex;
let values: GraphSonProperty[];
switch (element.label) {
case 'project':
gs = {
case EdgeLabels.refersTo:
this.out.refersTo.set(from.id, to as ResultSet);
break;
case EdgeLabels.textDocument_documentSymbol:
this.out.documentSymbol.set(from.id, to as DocumentSymbolResult);
break;
case EdgeLabels.textDocument_foldingRange:
this.out.foldingRange.set(from.id, to as FoldingRangeResult);
break;
case EdgeLabels.textDocument_documentLink:
this.out.documentLink.set(from.id, to as DocumentLinkResult);
break;
case EdgeLabels.textDocument_diagnostic:
this.out.diagnostic.set(from.id, to as DiagnosticResult);
break;
case EdgeLabels.textDocument_definition:
this.out.definition.set(from.id, to as DefinitionResult);
break;
case EdgeLabels.textDocument_typeDefinition:
this.out.typeDefinition.set(from.id, to as TypeDefinitionResult);
break;
case EdgeLabels.textDocument_hover:
this.out.hover.set(from.id, to as HoverResult);
break;
case EdgeLabels.textDocument_references:
this.out.references.set(from.id, to as ReferenceResult);
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;
case EdgeLabels.textDocument_hover:
this.handleHoverEdge(element);
break;
case EdgeLabels.textDocument_declaration:
this.handleDeclarationEdge(element);
break;
case EdgeLabels.textDocument_definition:
this.handleDefinitionEdge(element);
break;
case EdgeLabels.textDocument_references:
this.handleReferenceEdge(element);
break;
case EdgeLabels.item:
this.handleItemEdge(element);
break;
case EdgeLabels.contains:
this.handleContains(element);
break;
}
}
}