aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-10-15 18:05:26 +0100
committerAleksey Kladov <[email protected]>2018-10-15 18:05:26 +0100
commit1624bf2d7f8c60620830149ac2f88e94dfdb036e (patch)
treec92ef6d7811360c138830abd182ec3c4ce301cc2
parent94349206483ad78de71e1546d74a355bbdf764c4 (diff)
switch editor to 2018
-rw-r--r--crates/ra_editor/Cargo.toml1
-rw-r--r--crates/ra_editor/src/code_actions.rs4
-rw-r--r--crates/ra_editor/src/completion.rs2
-rw-r--r--crates/ra_editor/src/edit.rs2
-rw-r--r--crates/ra_editor/src/lib.rs2
-rw-r--r--crates/ra_editor/src/line_index.rs2
-rw-r--r--crates/ra_editor/src/scope/fn_scope.rs4
-rw-r--r--crates/ra_editor/src/symbols.rs2
-rw-r--r--crates/ra_editor/src/test_utils.rs4
-rw-r--r--crates/ra_editor/src/typing.rs4
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 @@
1[package] 1[package]
2edition = "2018"
2name = "ra_editor" 3name = "ra_editor"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
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::{
11 }, 11 },
12}; 12};
13 13
14use {EditBuilder, Edit, find_node_at_offset}; 14use crate::{EditBuilder, Edit, find_node_at_offset};
15 15
16#[derive(Debug)] 16#[derive(Debug)]
17pub struct LocalEdit { 17pub struct LocalEdit {
@@ -136,7 +136,7 @@ fn non_trivia_sibling(node: SyntaxNodeRef, direction: Direction) -> Option<Synta
136#[cfg(test)] 136#[cfg(test)]
137mod tests { 137mod tests {
138 use super::*; 138 use super::*;
139 use test_utils::{check_action, check_action_range}; 139 use crate::test_utils::{check_action, check_action_range};
140 140
141 #[test] 141 #[test]
142 fn test_swap_comma() { 142 fn test_swap_comma() {
diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs
index 20b8484b3..b6095dca9 100644
--- a/crates/ra_editor/src/completion.rs
+++ b/crates/ra_editor/src/completion.rs
@@ -9,7 +9,7 @@ use ra_syntax::{
9 text_utils::is_subrange, 9 text_utils::is_subrange,
10}; 10};
11 11
12use { 12use crate::{
13 AtomEdit, find_node_at_offset, 13 AtomEdit, find_node_at_offset,
14 scope::{FnScopes, ModuleScope}, 14 scope::{FnScopes, ModuleScope},
15}; 15};
diff --git a/crates/ra_editor/src/edit.rs b/crates/ra_editor/src/edit.rs
index 2839ac20a..46e687319 100644
--- a/crates/ra_editor/src/edit.rs
+++ b/crates/ra_editor/src/edit.rs
@@ -1,4 +1,4 @@
1use {TextRange, TextUnit}; 1use crate::{TextRange, TextUnit};
2use ra_syntax::{ 2use ra_syntax::{
3 AtomEdit, 3 AtomEdit,
4 text_utils::contains_offset_nonstrict, 4 text_utils::contains_offset_nonstrict,
diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs
index 710afc65d..bd61fd191 100644
--- a/crates/ra_editor/src/lib.rs
+++ b/crates/ra_editor/src/lib.rs
@@ -164,7 +164,7 @@ pub fn resolve_local_name(file: &File, offset: TextUnit, name_ref: ast::NameRef)
164#[cfg(test)] 164#[cfg(test)]
165mod tests { 165mod tests {
166 use super::*; 166 use super::*;
167 use test_utils::{assert_eq_dbg, extract_offset, add_cursor}; 167 use crate::test_utils::{assert_eq_dbg, extract_offset, add_cursor};
168 168
169 #[test] 169 #[test]
170 fn test_highlighting() { 170 fn test_highlighting() {
diff --git a/crates/ra_editor/src/line_index.rs b/crates/ra_editor/src/line_index.rs
index 9cd8da3a8..6ccfdbd83 100644
--- a/crates/ra_editor/src/line_index.rs
+++ b/crates/ra_editor/src/line_index.rs
@@ -1,5 +1,5 @@
1use superslice::Ext; 1use superslice::Ext;
2use ::TextUnit; 2use crate::TextUnit;
3 3
4#[derive(Clone, Debug, Hash)] 4#[derive(Clone, Debug, Hash)]
5pub struct LineIndex { 5pub struct LineIndex {
diff --git a/crates/ra_editor/src/scope/fn_scope.rs b/crates/ra_editor/src/scope/fn_scope.rs
index 9a48bda02..99d698b60 100644
--- a/crates/ra_editor/src/scope/fn_scope.rs
+++ b/crates/ra_editor/src/scope/fn_scope.rs
@@ -174,7 +174,7 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) {
174 } 174 }
175 } 175 }
176 ast::Expr::LambdaExpr(e) => { 176 ast::Expr::LambdaExpr(e) => {
177 let mut scope = scopes.new_scope(scope); 177 let scope = scopes.new_scope(scope);
178 scopes.add_params_bindings(scope, e.param_list()); 178 scopes.add_params_bindings(scope, e.param_list());
179 if let Some(body) = e.body() { 179 if let Some(body) = e.body() {
180 scopes.set_scope(body.syntax(), scope); 180 scopes.set_scope(body.syntax(), scope);
@@ -256,7 +256,7 @@ pub fn resolve_local_name<'a>(name_ref: ast::NameRef, scopes: &'a FnScopes) -> O
256mod tests { 256mod tests {
257 use super::*; 257 use super::*;
258 use ra_syntax::File; 258 use ra_syntax::File;
259 use {find_node_at_offset, test_utils::extract_offset}; 259 use crate::{find_node_at_offset, test_utils::extract_offset};
260 260
261 fn do_check(code: &str, expected: &[&str]) { 261 fn do_check(code: &str, expected: &[&str]) {
262 let (off, code) = extract_offset(code); 262 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::{
6 walk::{walk, WalkEvent}, 6 walk::{walk, WalkEvent},
7 }, 7 },
8}; 8};
9use TextRange; 9use crate::TextRange;
10 10
11#[derive(Debug, Clone)] 11#[derive(Debug, Clone)]
12pub struct StructureNode { 12pub 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 @@
1use ra_syntax::{File, TextUnit, TextRange}; 1use ra_syntax::{File, TextUnit, TextRange};
2pub use _test_utils::*; 2pub use crate::_test_utils::*;
3use LocalEdit; 3use crate::LocalEdit;
4 4
5pub fn check_action<F: Fn(&File, TextUnit) -> Option<LocalEdit>> ( 5pub fn check_action<F: Fn(&File, TextUnit) -> Option<LocalEdit>> (
6 before: &str, 6 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::{
10 SyntaxKind::*, 10 SyntaxKind::*,
11}; 11};
12 12
13use {LocalEdit, EditBuilder, find_node_at_offset}; 13use crate::{LocalEdit, EditBuilder, find_node_at_offset};
14 14
15pub fn join_lines(file: &File, range: TextRange) -> LocalEdit { 15pub fn join_lines(file: &File, range: TextRange) -> LocalEdit {
16 let range = if range.is_empty() { 16 let range = if range.is_empty() {
@@ -244,7 +244,7 @@ fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str {
244#[cfg(test)] 244#[cfg(test)]
245mod tests { 245mod tests {
246 use super::*; 246 use super::*;
247 use test_utils::{check_action, extract_range, extract_offset, add_cursor}; 247 use crate::test_utils::{check_action, extract_range, extract_offset, add_cursor};
248 248
249 fn check_join_lines(before: &str, after: &str) { 249 fn check_join_lines(before: &str, after: &str) {
250 check_action(before, after, |file, offset| { 250 check_action(before, after, |file, offset| {