mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-27 19:59:07 +00:00
fix(els): use NormalizedPathBuf
for AbsLocation
This commit is contained in:
parent
138c6ff3d8
commit
38f44e8d31
10 changed files with 40 additions and 14 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue