From 1624bf2d7f8c60620830149ac2f88e94dfdb036e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 15 Oct 2018 20:05:26 +0300 Subject: switch editor to 2018 --- crates/ra_editor/Cargo.toml | 1 + crates/ra_editor/src/code_actions.rs | 4 ++-- crates/ra_editor/src/completion.rs | 2 +- crates/ra_editor/src/edit.rs | 2 +- crates/ra_editor/src/lib.rs | 2 +- crates/ra_editor/src/line_index.rs | 2 +- crates/ra_editor/src/scope/fn_scope.rs | 4 ++-- crates/ra_editor/src/symbols.rs | 2 +- crates/ra_editor/src/test_utils.rs | 4 ++-- crates/ra_editor/src/typing.rs | 4 ++-- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/crates/ra_editor/Cargo.toml b/crates/ra_editor/Cargo.toml index 91cefc8d7..7791da156 100644 --- a/crates/ra_editor/Cargo.toml +++ b/crates/ra_editor/Cargo.toml @@ -1,4 +1,5 @@ [package] +edition = "2018" name = "ra_editor" version = "0.1.0" authors = ["Aleksey Kladov "] diff --git a/crates/ra_editor/src/code_actions.rs b/crates/ra_editor/src/code_actions.rs index 216d592ff..7b0a48c81 100644 --- a/crates/ra_editor/src/code_actions.rs +++ b/crates/ra_editor/src/code_actions.rs @@ -11,7 +11,7 @@ use ra_syntax::{ }, }; -use {EditBuilder, Edit, find_node_at_offset}; +use crate::{EditBuilder, Edit, find_node_at_offset}; #[derive(Debug)] pub struct LocalEdit { @@ -136,7 +136,7 @@ fn non_trivia_sibling(node: SyntaxNodeRef, direction: Direction) -> Option { - let mut scope = scopes.new_scope(scope); + let scope = scopes.new_scope(scope); scopes.add_params_bindings(scope, e.param_list()); if let Some(body) = e.body() { scopes.set_scope(body.syntax(), scope); @@ -256,7 +256,7 @@ pub fn resolve_local_name<'a>(name_ref: ast::NameRef, scopes: &'a FnScopes) -> O mod tests { use super::*; use ra_syntax::File; - use {find_node_at_offset, test_utils::extract_offset}; + use crate::{find_node_at_offset, test_utils::extract_offset}; fn do_check(code: &str, expected: &[&str]) { let (off, code) = extract_offset(code); diff --git a/crates/ra_editor/src/symbols.rs b/crates/ra_editor/src/symbols.rs index e5cc5ca28..6211ed547 100644 --- a/crates/ra_editor/src/symbols.rs +++ b/crates/ra_editor/src/symbols.rs @@ -6,7 +6,7 @@ use ra_syntax::{ walk::{walk, WalkEvent}, }, }; -use TextRange; +use crate::TextRange; #[derive(Debug, Clone)] pub struct StructureNode { diff --git a/crates/ra_editor/src/test_utils.rs b/crates/ra_editor/src/test_utils.rs index c4ea4db6c..49eb530d5 100644 --- a/crates/ra_editor/src/test_utils.rs +++ b/crates/ra_editor/src/test_utils.rs @@ -1,6 +1,6 @@ use ra_syntax::{File, TextUnit, TextRange}; -pub use _test_utils::*; -use LocalEdit; +pub use crate::_test_utils::*; +use crate::LocalEdit; pub fn check_action Option> ( before: &str, diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs index 1dc658f9b..542b9e10b 100644 --- a/crates/ra_editor/src/typing.rs +++ b/crates/ra_editor/src/typing.rs @@ -10,7 +10,7 @@ use ra_syntax::{ SyntaxKind::*, }; -use {LocalEdit, EditBuilder, find_node_at_offset}; +use crate::{LocalEdit, EditBuilder, find_node_at_offset}; pub fn join_lines(file: &File, range: TextRange) -> LocalEdit { let range = if range.is_empty() { @@ -244,7 +244,7 @@ fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str { #[cfg(test)] mod tests { use super::*; - use test_utils::{check_action, extract_range, extract_offset, add_cursor}; + use crate::test_utils::{check_action, extract_range, extract_offset, add_cursor}; fn check_join_lines(before: &str, after: &str) { check_action(before, after, |file, offset| { -- cgit v1.2.3