Function semantic_references_to_edges

Source
pub fn semantic_references_to_edges(
    references: &[SemanticReference],
) -> Vec<SymbolEdge>
Expand description

Copies semantic references into source-agnostic symbol edges.

Order and duplicates are preserved; each input’s source field is dropped.

§Examples

use ailloli_ui_editor::{code::{semantic_references_to_edges, SemanticReference}, SymbolEdgeKind, SymbolId, SymbolSource};
let references = [SemanticReference { from: SymbolId(1), to: SymbolId(2), kind: SymbolEdgeKind::References, source: SymbolSource::Lsp }];
let edges = semantic_references_to_edges(&references);
assert_eq!((edges[0].from, edges[0].to), (SymbolId(1), SymbolId(2)));