···1111### Language Server
12121313### Bug Fixes
1414+1515+- Fixes a bug with import cycle detection when there is more than 2 imports in the cycle
1616+ ([Ameen Radwan](https://github.com/Acepie))
···286286 .enumerate()
287287 .map(|(i, module)| {
288288 // cycles are in order of reference so get next in list or loop back to first
289289- let ind = if i == modules.len() - 1 { 0 } else { i + 1 };
290290- let next = modules.get(ind).expect("next module must exist");
289289+ let index_of_importer = if i == 0 { modules.len() - 1 } else { i - 1 };
290290+ let importing_module = modules
291291+ .get(index_of_importer)
292292+ .expect("importing module must exist");
291293 let input = dep_location_map.get(module).expect("dependency must exist");
292294 let location = match input {
293295 Input::New(module) => {
294296 let (_, location) = module
295297 .dependencies
296298 .iter()
297297- .find(|d| &d.0 == next)
299299+ .find(|d| &d.0 == importing_module)
298300 .expect("import must exist for there to be a cycle");
299301 ImportCycleLocationDetails {
300302 location: *location,
···306308 let (_, location) = cached_module
307309 .dependencies
308310 .iter()
309309- .find(|d| &d.0 == next)
311311+ .find(|d| &d.0 == importing_module)
310312 .expect("import must exist for there to be a cycle");
311313 let src = self
312314 .io