aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/conv.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 09:18:14 +0000
committerAleksey Kladov <[email protected]>2018-12-21 09:18:14 +0000
commitb5b44659a42cf982590519317ede9ead354f9c4e (patch)
tree460d82184faa07256e77cf8b353e135f2b935d1e /crates/ra_lsp_server/src/conv.rs
parent0063f03e86f4222a5027720142eb20db4adc485d (diff)
edits use source-root API
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r--crates/ra_lsp_server/src/conv.rs17
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 };