Introduce anchored_path

They allow to represent paths like `#[path = "C:\path.rs"] mod foo;`
in a lossless cross-platform & network-transparent way.
This commit is contained in:
Aleksey Kladov 2020-12-09 19:01:15 +03:00
parent 5e3891c255
commit 6e24321e45
13 changed files with 79 additions and 65 deletions

View file

@ -3,7 +3,7 @@
//!
//! It can be viewed as a dual for `AnalysisChange`.
use base_db::FileId;
use base_db::{AnchoredPathBuf, FileId};
use text_edit::TextEdit;
#[derive(Default, Debug, Clone)]
@ -44,8 +44,8 @@ impl From<Vec<SourceFileEdit>> for SourceChange {
#[derive(Debug, Clone)]
pub enum FileSystemEdit {
CreateFile { anchor: FileId, dst: String },
MoveFile { src: FileId, anchor: FileId, dst: String },
CreateFile { dst: AnchoredPathBuf },
MoveFile { src: FileId, dst: AnchoredPathBuf },
}
impl From<FileSystemEdit> for SourceChange {