diff options
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 3531b727e..218ded4ee 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -283,16 +283,17 @@ impl TryConvWith for FileSystemEdit { | |||
283 | type Output = req::FileSystemEdit; | 283 | type Output = req::FileSystemEdit; |
284 | fn try_conv_with(self, world: &ServerWorld) -> Result<req::FileSystemEdit> { | 284 | fn try_conv_with(self, world: &ServerWorld) -> Result<req::FileSystemEdit> { |
285 | let res = match self { | 285 | let res = match self { |
286 | FileSystemEdit::CreateFile { anchor, path } => { | 286 | FileSystemEdit::CreateFile { source_root, path } => { |
287 | let uri = world.file_id_to_uri(anchor)?; | 287 | let uri = world.path_to_uri(source_root, &path)?; |
288 | let path = &path.as_str()[3..]; // strip `../` b/c url is weird | ||
289 | let uri = uri.join(path)?; | ||
290 | req::FileSystemEdit::CreateFile { uri } | 288 | req::FileSystemEdit::CreateFile { uri } |
291 | } | 289 | } |
292 | FileSystemEdit::MoveFile { file, path } => { | 290 | FileSystemEdit::MoveFile { |
293 | let src = world.file_id_to_uri(file)?; | 291 | src, |
294 | let path = &path.as_str()[3..]; // strip `../` b/c url is weird | 292 | dst_source_root, |
295 | let dst = src.join(path)?; | 293 | dst_path, |
294 | } => { | ||
295 | let src = world.file_id_to_uri(src)?; | ||
296 | let dst = world.path_to_uri(dst_source_root, &dst_path)?; | ||
296 | req::FileSystemEdit::MoveFile { src, dst } | 297 | req::FileSystemEdit::MoveFile { src, dst } |
297 | } | 298 | } |
298 | }; | 299 | }; |