From 7344d28768c43d8955bf23c183d606be08f27c64 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Mon, 10 Dec 2018 22:09:12 +0100 Subject: extract AtomEdit and Edit into new ra_text_edit crate --- crates/ra_lsp_server/Cargo.toml | 1 + crates/ra_lsp_server/src/conv.rs | 3 ++- crates/ra_lsp_server/src/main_loop/handlers.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 5ee218b6b..133decc52 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml @@ -28,6 +28,7 @@ rustc-hash = "1.0" ra_syntax = { path = "../ra_syntax" } ra_editor = { path = "../ra_editor" } +ra_text_edit = { path = "../ra_text_edit" } ra_analysis = { path = "../ra_analysis" } gen_lsp_server = { path = "../gen_lsp_server" } diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 28368787c..8bf8576be 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -3,7 +3,8 @@ use languageserver_types::{ TextDocumentItem, TextDocumentPositionParams, TextEdit, Url, VersionedTextDocumentIdentifier, }; use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileNodeEdit, FilePosition}; -use ra_editor::{AtomEdit, Edit, LineCol, LineIndex}; +use ra_editor::{LineCol, LineIndex}; +use ra_text_edit::{AtomEdit, Edit}; use ra_syntax::{SyntaxKind, TextRange, TextUnit}; use crate::{req, server_world::ServerWorld, Result}; diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 92e92f836..21ca22c5c 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -9,7 +9,8 @@ use languageserver_types::{ WorkspaceEdit, ParameterInformation, SignatureInformation, Hover, HoverContents, }; use ra_analysis::{FileId, FoldKind, Query, RunnableKind, FilePosition}; -use ra_syntax::{TextUnit, text_utils::{contains_offset_nonstrict, intersect}}; +use ra_syntax::{TextUnit, text_utils::intersect}; +use ra_text_edit::text_utils::contains_offset_nonstrict; use rustc_hash::FxHashMap; use serde_json::to_value; -- cgit v1.2.3