mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
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:
parent
5e3891c255
commit
6e24321e45
13 changed files with 79 additions and 65 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue