Helper to assert no duplicate locations exist in the results.
(results: &[tower_lsp::lsp_types::Location], label: &str)
| 107 | |
| 108 | /// Helper to assert no duplicate locations exist in the results. |
| 109 | fn assert_no_duplicates(results: &[tower_lsp::lsp_types::Location], label: &str) { |
| 110 | let mut seen = std::collections::HashSet::new(); |
| 111 | for loc in results { |
| 112 | let key = format!( |
| 113 | "{}:{}:{}:{}:{}", |
| 114 | loc.uri, |
| 115 | loc.range.start.line, |
| 116 | loc.range.start.character, |
| 117 | loc.range.end.line, |
| 118 | loc.range.end.character, |
| 119 | ); |
| 120 | assert!( |
| 121 | seen.insert(key.clone()), |
| 122 | "Duplicate reference found ({}): {}", |
| 123 | label, |
| 124 | key |
| 125 | ); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | // ─── Class reference tests ────────────────────────────────────────────────── |
| 130 |
no outgoing calls