fix(els): use NormalizedPathBuf for AbsLocation

This commit is contained in:
Shunsuke Shibayama 2023-09-13 23:26:05 +09:00
parent 138c6ff3d8
commit 38f44e8d31
10 changed files with 40 additions and 14 deletions

View file

@ -3,6 +3,7 @@ use std::fmt;
use std::path::{Path, PathBuf};
use erg_common::dict::Dict;
use erg_common::pathutil::NormalizedPathBuf;
use erg_common::set;
use erg_common::set::Set;
use erg_common::shared::{MappedRwLockReadGuard, RwLockReadGuard, Shared};
@ -112,6 +113,7 @@ impl ModuleIndex {
}
pub fn rename_path(&mut self, old: &Path, new: PathBuf) {
let new = NormalizedPathBuf::new(new);
let mut new_members = Dict::new();
for (loc, mut value) in std::mem::take(&mut self.members) {
if value.vi.def_loc.module.as_deref() == Some(old) {