aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-15 18:55:03 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-15 18:55:03 +0100
commite929355eca10b1d8d4e55ddd41549d5bf0a685aa (patch)
tree872ab3701dcd27207fab5531269a66d205c74539
parenta230b438e025c5878b8d17e11d3928cbad95bb28 (diff)
parent9a98d8e99acf8acd40b2153847a37551d2a8d0f4 (diff)
Merge #129
129: 2018 r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--.travis.yml2
-rw-r--r--README.md3
-rw-r--r--appveyor.yml2
-rw-r--r--crates/ra_analysis/Cargo.toml1
-rw-r--r--crates/ra_analysis/src/db/imp.rs4
-rw-r--r--crates/ra_analysis/src/db/mod.rs6
-rw-r--r--crates/ra_analysis/src/descriptors.rs4
-rw-r--r--crates/ra_analysis/src/imp.rs4
-rw-r--r--crates/ra_analysis/src/lib.rs8
-rw-r--r--crates/ra_analysis/src/module_map.rs4
-rw-r--r--crates/ra_analysis/src/queries.rs4
-rw-r--r--crates/ra_analysis/src/roots.rs12
-rw-r--r--crates/ra_analysis/src/symbol_index.rs2
-rw-r--r--crates/ra_cli/Cargo.toml1
-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
-rw-r--r--crates/ra_lsp_server/Cargo.toml1
-rw-r--r--crates/ra_lsp_server/src/conv.rs6
-rw-r--r--crates/ra_lsp_server/src/lib.rs6
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop/mod.rs2
-rw-r--r--crates/ra_lsp_server/src/project_model.rs2
-rw-r--r--crates/ra_lsp_server/src/server_world.rs2
-rw-r--r--crates/ra_lsp_server/src/thread_watcher.rs2
-rw-r--r--crates/ra_lsp_server/src/vfs.rs2
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs2
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs2
-rw-r--r--crates/ra_syntax/Cargo.toml1
-rw-r--r--crates/ra_syntax/src/algo/mod.rs2
-rw-r--r--crates/ra_syntax/src/algo/visit.rs2
-rw-r--r--crates/ra_syntax/src/algo/walk.rs2
-rw-r--r--crates/ra_syntax/src/ast/generated.rs2
-rw-r--r--crates/ra_syntax/src/ast/generated.rs.tera2
-rw-r--r--crates/ra_syntax/src/ast/mod.rs2
-rw-r--r--crates/ra_syntax/src/grammar/expressions/atom.rs2
-rw-r--r--crates/ra_syntax/src/grammar/mod.rs2
-rw-r--r--crates/ra_syntax/src/lexer/comments.rs4
-rw-r--r--crates/ra_syntax/src/lexer/mod.rs2
-rw-r--r--crates/ra_syntax/src/lexer/numbers.rs6
-rw-r--r--crates/ra_syntax/src/lexer/ptr.rs2
-rw-r--r--crates/ra_syntax/src/lexer/strings.rs4
-rw-r--r--crates/ra_syntax/src/lib.rs4
-rw-r--r--crates/ra_syntax/src/parser_api.rs2
-rw-r--r--crates/ra_syntax/src/parser_impl/event.rs2
-rw-r--r--crates/ra_syntax/src/parser_impl/input.rs2
-rw-r--r--crates/ra_syntax/src/parser_impl/mod.rs4
-rw-r--r--crates/ra_syntax/src/reparsing.rs16
-rw-r--r--crates/ra_syntax/src/syntax_kinds/mod.rs2
-rw-r--r--crates/ra_syntax/src/text_utils.rs2
-rw-r--r--crates/ra_syntax/src/token_set.rs4
-rw-r--r--crates/ra_syntax/src/utils.rs2
-rw-r--r--crates/ra_syntax/src/yellow/builder.rs2
-rw-r--r--crates/ra_syntax/src/yellow/mod.rs14
-rw-r--r--crates/ra_syntax/src/yellow/syntax_text.rs2
-rw-r--r--crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs3
-rw-r--r--crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt41
-rw-r--r--crates/test_utils/Cargo.toml1
-rw-r--r--crates/tools/Cargo.toml1
66 files changed, 154 insertions, 98 deletions
diff --git a/.travis.yml b/.travis.yml
index acf1af028..33dc7803e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
1matrix: 1matrix:
2 include: 2 include:
3 - language: rust 3 - language: rust
4 rust: stable 4 rust: beta
5 script: 5 script:
6 - cargo gen-kinds --verify 6 - cargo gen-kinds --verify
7 - cargo gen-tests --verify 7 - cargo gen-tests --verify
diff --git a/README.md b/README.md
index 1c6facbbd..c3056bcfd 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,8 @@ functionality is provided via a language server.
16 16
17## Quick Start 17## Quick Start
18 18
19Rust analyzer builds on stable Rust >= 1.29.0. 19Rust analyzer builds on Rust >= 1.30.0 (currently in beta) and uses
20the 2018 edition.
20 21
21``` 22```
22# run tests 23# run tests
diff --git a/appveyor.yml b/appveyor.yml
index a6ba3b0e1..a32a1e7b8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,7 +2,7 @@ os: Visual Studio 2015
2 2
3install: 3install:
4 - curl https://win.rustup.rs/ --output rustup-init.exe 4 - curl https://win.rustup.rs/ --output rustup-init.exe
5 - rustup-init -yv --default-toolchain stable --default-host x86_64-pc-windows-msvc 5 - rustup-init -yv --default-toolchain beta --default-host x86_64-pc-windows-msvc
6 - set PATH=%PATH%;%USERPROFILE%\.cargo\bin 6 - set PATH=%PATH%;%USERPROFILE%\.cargo\bin
7 - rustc -vV 7 - rustc -vV
8 - cargo -vV 8 - cargo -vV
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index a82e1761c..28d95c581 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "ra_analysis" 3name = "ra_analysis"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
diff --git a/crates/ra_analysis/src/db/imp.rs b/crates/ra_analysis/src/db/imp.rs
index 36f6cf290..7669b6184 100644
--- a/crates/ra_analysis/src/db/imp.rs
+++ b/crates/ra_analysis/src/db/imp.rs
@@ -7,7 +7,7 @@ use std::{
7}; 7};
8use rustc_hash::FxHashMap; 8use rustc_hash::FxHashMap;
9use salsa; 9use salsa;
10use {FileId, imp::FileResolverImp}; 10use crate::{FileId, imp::FileResolverImp};
11use super::{State, Query, QueryCtx}; 11use super::{State, Query, QueryCtx};
12 12
13pub(super) type Data = Arc<Any + Send + Sync + 'static>; 13pub(super) type Data = Arc<Any + Send + Sync + 'static>;
@@ -51,7 +51,7 @@ pub(crate) trait EvalQuery {
51 type Output; 51 type Output;
52 fn query_type(&self) -> salsa::QueryTypeId; 52 fn query_type(&self) -> salsa::QueryTypeId;
53 fn f(&self) -> salsa::QueryFn<State, Data>; 53 fn f(&self) -> salsa::QueryFn<State, Data>;
54 fn get(&self, &QueryCtx, Self::Params) -> Arc<Self::Output>; 54 fn get(&self, ctx: &QueryCtx, params: Self::Params) -> Arc<Self::Output>;
55} 55}
56 56
57impl<T, R> EvalQuery for Query<T, R> 57impl<T, R> EvalQuery for Query<T, R>
diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs
index 22769d112..4eb7d922d 100644
--- a/crates/ra_analysis/src/db/mod.rs
+++ b/crates/ra_analysis/src/db/mod.rs
@@ -5,7 +5,7 @@ use std::{
5}; 5};
6use im; 6use im;
7use salsa; 7use salsa;
8use {FileId, imp::FileResolverImp}; 8use crate::{FileId, imp::FileResolverImp};
9 9
10#[derive(Debug, Default, Clone)] 10#[derive(Debug, Default, Clone)]
11pub(crate) struct State { 11pub(crate) struct State {
@@ -75,8 +75,8 @@ pub(crate) fn file_set(ctx: QueryCtx) -> Arc<(Vec<FileId>, FileResolverImp)> {
75impl QueryRegistry { 75impl QueryRegistry {
76 fn new() -> QueryRegistry { 76 fn new() -> QueryRegistry {
77 let mut reg = QueryRegistry { imp: imp::QueryRegistry::new() }; 77 let mut reg = QueryRegistry { imp: imp::QueryRegistry::new() };
78 ::queries::register_queries(&mut reg); 78 crate::queries::register_queries(&mut reg);
79 ::module_map::register_queries(&mut reg); 79 crate::module_map::register_queries(&mut reg);
80 reg 80 reg
81 } 81 }
82 pub(crate) fn add<Q: imp::EvalQuery>(&mut self, q: Q, name: &'static str) { 82 pub(crate) fn add<Q: imp::EvalQuery>(&mut self, q: Q, name: &'static str) {
diff --git a/crates/ra_analysis/src/descriptors.rs b/crates/ra_analysis/src/descriptors.rs
index faf945a41..f26dac875 100644
--- a/crates/ra_analysis/src/descriptors.rs
+++ b/crates/ra_analysis/src/descriptors.rs
@@ -7,7 +7,7 @@ use ra_syntax::{
7 ast::{self, NameOwner, AstNode}, 7 ast::{self, NameOwner, AstNode},
8 text_utils::is_subrange 8 text_utils::is_subrange
9}; 9};
10use { 10use crate::{
11 FileId, 11 FileId,
12 imp::FileResolverImp, 12 imp::FileResolverImp,
13}; 13};
@@ -271,4 +271,4 @@ impl FnDescriptor {
271 } 271 }
272 res 272 res
273 } 273 }
274} \ No newline at end of file 274}
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index aad54b977..26f5e175b 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -17,7 +17,7 @@ use ra_syntax::{
17 ast::{self, NameOwner, ArgListOwner, Expr}, 17 ast::{self, NameOwner, ArgListOwner, Expr},
18}; 18};
19 19
20use { 20use crate::{
21 FileId, FileResolver, Query, Diagnostic, SourceChange, SourceFileEdit, Position, FileSystemEdit, 21 FileId, FileResolver, Query, Diagnostic, SourceChange, SourceFileEdit, Position, FileSystemEdit,
22 JobToken, CrateGraph, CrateId, 22 JobToken, CrateGraph, CrateId,
23 roots::{SourceRoot, ReadonlySourceRoot, WritableSourceRoot}, 23 roots::{SourceRoot, ReadonlySourceRoot, WritableSourceRoot},
@@ -458,4 +458,4 @@ impl<'a> FnCallNode<'a> {
458 FnCallNode::MethodCallExpr(expr) => expr.arg_list() 458 FnCallNode::MethodCallExpr(expr) => expr.arg_list()
459 } 459 }
460 } 460 }
461} \ No newline at end of file 461}
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 1aca72ae0..86c66236c 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -29,16 +29,18 @@ use std::{
29 29
30use relative_path::{RelativePath, RelativePathBuf}; 30use relative_path::{RelativePath, RelativePathBuf};
31use ra_syntax::{File, TextRange, TextUnit, AtomEdit}; 31use ra_syntax::{File, TextRange, TextUnit, AtomEdit};
32use imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
33use rustc_hash::FxHashMap; 32use rustc_hash::FxHashMap;
33use crate::imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
34 34
35pub use ra_editor::{ 35pub use ra_editor::{
36 StructureNode, LineIndex, FileSymbol, 36 StructureNode, LineIndex, FileSymbol,
37 Runnable, RunnableKind, HighlightedRange, CompletionItem, 37 Runnable, RunnableKind, HighlightedRange, CompletionItem,
38 Fold, FoldKind 38 Fold, FoldKind
39}; 39};
40pub use job::{JobToken, JobHandle}; 40pub use crate::{
41pub use descriptors::FnDescriptor; 41 job::{JobToken, JobHandle},
42 descriptors::FnDescriptor,
43};
42 44
43#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] 45#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
44pub struct FileId(pub u32); 46pub struct FileId(pub u32);
diff --git a/crates/ra_analysis/src/module_map.rs b/crates/ra_analysis/src/module_map.rs
index a21f55fff..c77c5cec6 100644
--- a/crates/ra_analysis/src/module_map.rs
+++ b/crates/ra_analysis/src/module_map.rs
@@ -1,5 +1,5 @@
1use std::sync::Arc; 1use std::sync::Arc;
2use { 2use crate::{
3 FileId, 3 FileId,
4 db::{ 4 db::{
5 Query, QueryRegistry, QueryCtx, 5 Query, QueryRegistry, QueryCtx,
@@ -38,7 +38,7 @@ mod tests {
38 use std::collections::HashMap; 38 use std::collections::HashMap;
39 use im; 39 use im;
40 use relative_path::{RelativePath, RelativePathBuf}; 40 use relative_path::{RelativePath, RelativePathBuf};
41 use { 41 use crate::{
42 db::{Db}, 42 db::{Db},
43 imp::FileResolverImp, 43 imp::FileResolverImp,
44 FileId, FileResolver, 44 FileId, FileResolver,
diff --git a/crates/ra_analysis/src/queries.rs b/crates/ra_analysis/src/queries.rs
index 062a2f420..613bf1e61 100644
--- a/crates/ra_analysis/src/queries.rs
+++ b/crates/ra_analysis/src/queries.rs
@@ -1,13 +1,13 @@
1use std::sync::Arc; 1use std::sync::Arc;
2use ra_syntax::File; 2use ra_syntax::File;
3use ra_editor::LineIndex; 3use ra_editor::LineIndex;
4use { 4use crate::{
5 FileId, 5 FileId,
6 db::{Query, QueryCtx, QueryRegistry}, 6 db::{Query, QueryCtx, QueryRegistry},
7 symbol_index::SymbolIndex, 7 symbol_index::SymbolIndex,
8}; 8};
9 9
10pub(crate) use db::{file_text, file_set}; 10pub(crate) use crate::db::{file_text, file_set};
11 11
12pub(crate) fn file_syntax(ctx: QueryCtx, file_id: FileId) -> File { 12pub(crate) fn file_syntax(ctx: QueryCtx, file_id: FileId) -> File {
13 (&*ctx.get(FILE_SYNTAX, file_id)).clone() 13 (&*ctx.get(FILE_SYNTAX, file_id)).clone()
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs
index 32a8c5bd0..208acc4c2 100644
--- a/crates/ra_analysis/src/roots.rs
+++ b/crates/ra_analysis/src/roots.rs
@@ -9,7 +9,7 @@ use rustc_hash::FxHashMap;
9use ra_editor::LineIndex; 9use ra_editor::LineIndex;
10use ra_syntax::File; 10use ra_syntax::File;
11 11
12use { 12use crate::{
13 FileId, 13 FileId,
14 imp::FileResolverImp, 14 imp::FileResolverImp,
15 symbol_index::SymbolIndex, 15 symbol_index::SymbolIndex,
@@ -62,23 +62,23 @@ impl WritableSourceRoot {
62 62
63impl SourceRoot for WritableSourceRoot { 63impl SourceRoot for WritableSourceRoot {
64 fn module_tree(&self) -> Arc<ModuleTreeDescriptor> { 64 fn module_tree(&self) -> Arc<ModuleTreeDescriptor> {
65 self.db.make_query(::module_map::module_tree) 65 self.db.make_query(crate::module_map::module_tree)
66 } 66 }
67 67
68 fn contains(&self, file_id: FileId) -> bool { 68 fn contains(&self, file_id: FileId) -> bool {
69 self.db.state().file_map.contains_key(&file_id) 69 self.db.state().file_map.contains_key(&file_id)
70 } 70 }
71 fn lines(&self, file_id: FileId) -> Arc<LineIndex> { 71 fn lines(&self, file_id: FileId) -> Arc<LineIndex> {
72 self.db.make_query(|ctx| ::queries::file_lines(ctx, file_id)) 72 self.db.make_query(|ctx| crate::queries::file_lines(ctx, file_id))
73 } 73 }
74 fn syntax(&self, file_id: FileId) -> File { 74 fn syntax(&self, file_id: FileId) -> File {
75 self.db.make_query(|ctx| ::queries::file_syntax(ctx, file_id)) 75 self.db.make_query(|ctx| crate::queries::file_syntax(ctx, file_id))
76 } 76 }
77 fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) { 77 fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) {
78 self.db.make_query(|ctx| { 78 self.db.make_query(|ctx| {
79 let file_set = ::queries::file_set(ctx); 79 let file_set = crate::queries::file_set(ctx);
80 let syms = file_set.0.iter() 80 let syms = file_set.0.iter()
81 .map(|file_id| ::queries::file_symbols(ctx, *file_id)); 81 .map(|file_id| crate::queries::file_symbols(ctx, *file_id));
82 acc.extend(syms); 82 acc.extend(syms);
83 }); 83 });
84 } 84 }
diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs
index ffbb6a29f..e5d83d365 100644
--- a/crates/ra_analysis/src/symbol_index.rs
+++ b/crates/ra_analysis/src/symbol_index.rs
@@ -9,7 +9,7 @@ use ra_syntax::{
9}; 9};
10use fst::{self, Streamer}; 10use fst::{self, Streamer};
11use rayon::prelude::*; 11use rayon::prelude::*;
12use {Query, FileId, JobToken}; 12use crate::{Query, FileId, JobToken};
13 13
14#[derive(Debug)] 14#[derive(Debug)]
15pub(crate) struct SymbolIndex { 15pub(crate) struct SymbolIndex {
diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml
index 5e7bf3ed4..0b8d6f3dd 100644
--- a/crates/ra_cli/Cargo.toml
+++ b/crates/ra_cli/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "ra_cli" 3name = "ra_cli"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
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| {
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index 1fe6b2ebe..2b3257117 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "ra_lsp_server" 3name = "ra_lsp_server"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index 08a656569..a75b160c5 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -7,7 +7,7 @@ use ra_editor::{LineIndex, LineCol, Edit, AtomEdit};
7use ra_syntax::{SyntaxKind, TextUnit, TextRange}; 7use ra_syntax::{SyntaxKind, TextUnit, TextRange};
8use ra_analysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit}; 8use ra_analysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit};
9 9
10use { 10use crate::{
11 Result, 11 Result,
12 server_world::ServerWorld, 12 server_world::ServerWorld,
13 req, 13 req,
@@ -299,7 +299,7 @@ pub fn to_location(
299 Ok(loc) 299 Ok(loc)
300} 300}
301 301
302pub trait MapConvWith<'a>: Sized { 302pub trait MapConvWith<'a>: Sized + 'a {
303 type Ctx; 303 type Ctx;
304 type Output; 304 type Output;
305 305
@@ -309,7 +309,7 @@ pub trait MapConvWith<'a>: Sized {
309} 309}
310 310
311impl<'a, I> MapConvWith<'a> for I 311impl<'a, I> MapConvWith<'a> for I
312 where I: Iterator, 312 where I: Iterator + 'a,
313 I::Item: ConvWith 313 I::Item: ConvWith
314{ 314{
315 type Ctx = <I::Item as ConvWith>::Ctx; 315 type Ctx = <I::Item as ConvWith>::Ctx;
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs
index 60652d55e..7224b1476 100644
--- a/crates/ra_lsp_server/src/lib.rs
+++ b/crates/ra_lsp_server/src/lib.rs
@@ -34,5 +34,7 @@ mod project_model;
34pub mod thread_watcher; 34pub mod thread_watcher;
35 35
36pub type Result<T> = ::std::result::Result<T, ::failure::Error>; 36pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
37pub use caps::server_capabilities; 37pub use crate::{
38pub use main_loop::main_loop; 38 main_loop::main_loop,
39 caps::server_capabilities,
40};
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index f65e2a889..1fe78f3d0 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -13,7 +13,7 @@ use ra_syntax::{
13 text_utils::contains_offset_nonstrict 13 text_utils::contains_offset_nonstrict
14}; 14};
15 15
16use ::{ 16use crate::{
17 req::{self, Decoration}, Result, 17 req::{self, Decoration}, Result,
18 conv::{Conv, ConvWith, TryConvWith, MapConvWith, to_location}, 18 conv::{Conv, ConvWith, TryConvWith, MapConvWith, to_location},
19 server_world::ServerWorld, 19 server_world::ServerWorld,
diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs
index f4e7cfc33..773501efe 100644
--- a/crates/ra_lsp_server/src/main_loop/mod.rs
+++ b/crates/ra_lsp_server/src/main_loop/mod.rs
@@ -16,7 +16,7 @@ use gen_lsp_server::{
16}; 16};
17use rustc_hash::FxHashMap; 17use rustc_hash::FxHashMap;
18 18
19use { 19use crate::{
20 req, 20 req,
21 Result, 21 Result,
22 vfs::{self, FileEvent}, 22 vfs::{self, FileEvent},
diff --git a/crates/ra_lsp_server/src/project_model.rs b/crates/ra_lsp_server/src/project_model.rs
index 43e4fd654..c144d9596 100644
--- a/crates/ra_lsp_server/src/project_model.rs
+++ b/crates/ra_lsp_server/src/project_model.rs
@@ -5,7 +5,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
5use cargo_metadata::{metadata_run, CargoOpt}; 5use cargo_metadata::{metadata_run, CargoOpt};
6use ra_syntax::SmolStr; 6use ra_syntax::SmolStr;
7 7
8use { 8use crate::{
9 Result, 9 Result,
10 thread_watcher::{Worker, ThreadWatcher}, 10 thread_watcher::{Worker, ThreadWatcher},
11}; 11};
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index c4cdf83d4..c931afa02 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
8use languageserver_types::Url; 8use languageserver_types::Url;
9use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver}; 9use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
10 10
11use { 11use crate::{
12 Result, 12 Result,
13 path_map::{PathMap, Root}, 13 path_map::{PathMap, Root},
14 vfs::{FileEvent, FileEventKind}, 14 vfs::{FileEvent, FileEventKind},
diff --git a/crates/ra_lsp_server/src/thread_watcher.rs b/crates/ra_lsp_server/src/thread_watcher.rs
index 86a3a91e0..3257effcb 100644
--- a/crates/ra_lsp_server/src/thread_watcher.rs
+++ b/crates/ra_lsp_server/src/thread_watcher.rs
@@ -1,7 +1,7 @@
1use std::thread; 1use std::thread;
2use crossbeam_channel::{bounded, unbounded, Sender, Receiver}; 2use crossbeam_channel::{bounded, unbounded, Sender, Receiver};
3use drop_bomb::DropBomb; 3use drop_bomb::DropBomb;
4use Result; 4use crate::Result;
5 5
6pub struct Worker<I, O> { 6pub struct Worker<I, O> {
7 pub inp: Sender<I>, 7 pub inp: Sender<I>,
diff --git a/crates/ra_lsp_server/src/vfs.rs b/crates/ra_lsp_server/src/vfs.rs
index a1c1783f2..d8f9b1aac 100644
--- a/crates/ra_lsp_server/src/vfs.rs
+++ b/crates/ra_lsp_server/src/vfs.rs
@@ -5,7 +5,7 @@ use std::{
5 5
6use walkdir::WalkDir; 6use walkdir::WalkDir;
7 7
8use { 8use crate::{
9 thread_watcher::{Worker, ThreadWatcher}, 9 thread_watcher::{Worker, ThreadWatcher},
10}; 10};
11 11
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index dced45f55..7265b5999 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -12,7 +12,7 @@ mod support;
12 12
13use ra_lsp_server::req::{Runnables, RunnablesParams}; 13use ra_lsp_server::req::{Runnables, RunnablesParams};
14 14
15use support::project; 15use crate::support::project;
16 16
17 17
18const LOG: &'static str = ""; 18const LOG: &'static str = "";
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index 8fe2aa816..d1339f62f 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -25,7 +25,7 @@ use ra_lsp_server::{main_loop, req, thread_watcher::{ThreadWatcher, Worker}};
25 25
26pub fn project(fixture: &str) -> Server { 26pub fn project(fixture: &str) -> Server {
27 static INIT: Once = Once::new(); 27 static INIT: Once = Once::new();
28 INIT.call_once(|| Logger::with_env_or_str(::LOG).start().unwrap()); 28 INIT.call_once(|| Logger::with_env_or_str(crate::LOG).start().unwrap());
29 29
30 let tmp_dir = TempDir::new("test-project") 30 let tmp_dir = TempDir::new("test-project")
31 .unwrap(); 31 .unwrap();
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index 6345e4725..34bb1c591 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "ra_syntax" 3name = "ra_syntax"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
diff --git a/crates/ra_syntax/src/algo/mod.rs b/crates/ra_syntax/src/algo/mod.rs
index a6678093d..e686a5704 100644
--- a/crates/ra_syntax/src/algo/mod.rs
+++ b/crates/ra_syntax/src/algo/mod.rs
@@ -1,7 +1,7 @@
1pub mod walk; 1pub mod walk;
2pub mod visit; 2pub mod visit;
3 3
4use { 4use crate::{
5 SyntaxNodeRef, TextUnit, TextRange, 5 SyntaxNodeRef, TextUnit, TextRange,
6 text_utils::{contains_offset_nonstrict, is_subrange}, 6 text_utils::{contains_offset_nonstrict, is_subrange},
7}; 7};
diff --git a/crates/ra_syntax/src/algo/visit.rs b/crates/ra_syntax/src/algo/visit.rs
index 9f1c127c7..1ae988a87 100644
--- a/crates/ra_syntax/src/algo/visit.rs
+++ b/crates/ra_syntax/src/algo/visit.rs
@@ -1,5 +1,5 @@
1use std::marker::PhantomData; 1use std::marker::PhantomData;
2use {SyntaxNodeRef, AstNode}; 2use crate::{SyntaxNodeRef, AstNode};
3 3
4 4
5pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> { 5pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> {
diff --git a/crates/ra_syntax/src/algo/walk.rs b/crates/ra_syntax/src/algo/walk.rs
index 8e294d965..d34415626 100644
--- a/crates/ra_syntax/src/algo/walk.rs
+++ b/crates/ra_syntax/src/algo/walk.rs
@@ -1,4 +1,4 @@
1use { 1use crate::{
2 SyntaxNodeRef, 2 SyntaxNodeRef,
3 algo::generate, 3 algo::generate,
4}; 4};
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 4db1bcbf9..160d186b8 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -1,7 +1,7 @@
1// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run 1// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run
2// Do not edit manually 2// Do not edit manually
3 3
4use { 4use crate::{
5 ast, 5 ast,
6 SyntaxNodeRef, AstNode, 6 SyntaxNodeRef, AstNode,
7 SyntaxKind::*, 7 SyntaxKind::*,
diff --git a/crates/ra_syntax/src/ast/generated.rs.tera b/crates/ra_syntax/src/ast/generated.rs.tera
index ffa9c4134..5cb7a35ed 100644
--- a/crates/ra_syntax/src/ast/generated.rs.tera
+++ b/crates/ra_syntax/src/ast/generated.rs.tera
@@ -3,7 +3,7 @@ the below applies to the result of this template
3#}// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run 3#}// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run
4// Do not edit manually 4// Do not edit manually
5 5
6use { 6use crate::{
7 ast, 7 ast,
8 SyntaxNodeRef, AstNode, 8 SyntaxNodeRef, AstNode,
9 SyntaxKind::*, 9 SyntaxKind::*,
diff --git a/crates/ra_syntax/src/ast/mod.rs b/crates/ra_syntax/src/ast/mod.rs
index 12ddc0210..88193a1ed 100644
--- a/crates/ra_syntax/src/ast/mod.rs
+++ b/crates/ra_syntax/src/ast/mod.rs
@@ -4,7 +4,7 @@ use std::marker::PhantomData;
4 4
5use itertools::Itertools; 5use itertools::Itertools;
6 6
7use { 7use crate::{
8 SmolStr, SyntaxNodeRef, SyntaxKind::*, 8 SmolStr, SyntaxNodeRef, SyntaxKind::*,
9 yellow::{RefRoot, SyntaxNodeChildren}, 9 yellow::{RefRoot, SyntaxNodeChildren},
10}; 10};
diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs
index a720d255f..e21de68c5 100644
--- a/crates/ra_syntax/src/grammar/expressions/atom.rs
+++ b/crates/ra_syntax/src/grammar/expressions/atom.rs
@@ -30,7 +30,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet =
30 token_set_union![ 30 token_set_union![
31 LITERAL_FIRST, 31 LITERAL_FIRST,
32 token_set![L_CURLY, L_PAREN, L_BRACK, PIPE, MOVE_KW, IF_KW, WHILE_KW, MATCH_KW, UNSAFE_KW, 32 token_set![L_CURLY, L_PAREN, L_BRACK, PIPE, MOVE_KW, IF_KW, WHILE_KW, MATCH_KW, UNSAFE_KW,
33 RETURN_KW, IDENT, SELF_KW, SUPER_KW, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ], 33 RETURN_KW, IDENT, SELF_KW, SUPER_KW, CRATE_KW, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ],
34 ]; 34 ];
35 35
36const EXPR_RECOVERY_SET: TokenSet = 36const EXPR_RECOVERY_SET: TokenSet =
diff --git a/crates/ra_syntax/src/grammar/mod.rs b/crates/ra_syntax/src/grammar/mod.rs
index 2cb11dc1e..1199ba230 100644
--- a/crates/ra_syntax/src/grammar/mod.rs
+++ b/crates/ra_syntax/src/grammar/mod.rs
@@ -31,7 +31,7 @@ mod type_args;
31mod type_params; 31mod type_params;
32mod types; 32mod types;
33 33
34use { 34use crate::{
35 token_set::TokenSet, 35 token_set::TokenSet,
36 parser_api::{Marker, CompletedMarker, Parser}, 36 parser_api::{Marker, CompletedMarker, Parser},
37 SyntaxKind::{self, *}, 37 SyntaxKind::{self, *},
diff --git a/crates/ra_syntax/src/lexer/comments.rs b/crates/ra_syntax/src/lexer/comments.rs
index eb417c2dc..afe6886a1 100644
--- a/crates/ra_syntax/src/lexer/comments.rs
+++ b/crates/ra_syntax/src/lexer/comments.rs
@@ -1,6 +1,6 @@
1use lexer::ptr::Ptr; 1use crate::lexer::ptr::Ptr;
2 2
3use SyntaxKind::{self, *}; 3use crate::SyntaxKind::{self, *};
4 4
5pub(crate) fn scan_shebang(ptr: &mut Ptr) -> bool { 5pub(crate) fn scan_shebang(ptr: &mut Ptr) -> bool {
6 if ptr.at_str("!/") { 6 if ptr.at_str("!/") {
diff --git a/crates/ra_syntax/src/lexer/mod.rs b/crates/ra_syntax/src/lexer/mod.rs
index 3e11db88b..9dc0b63d6 100644
--- a/crates/ra_syntax/src/lexer/mod.rs
+++ b/crates/ra_syntax/src/lexer/mod.rs
@@ -4,7 +4,7 @@ mod numbers;
4mod ptr; 4mod ptr;
5mod strings; 5mod strings;
6 6
7use { 7use crate::{
8 SyntaxKind::{self, *}, 8 SyntaxKind::{self, *},
9 TextUnit, 9 TextUnit,
10}; 10};
diff --git a/crates/ra_syntax/src/lexer/numbers.rs b/crates/ra_syntax/src/lexer/numbers.rs
index 22e7d4e99..46daf5e52 100644
--- a/crates/ra_syntax/src/lexer/numbers.rs
+++ b/crates/ra_syntax/src/lexer/numbers.rs
@@ -1,7 +1,7 @@
1use lexer::classes::*; 1use crate::lexer::classes::*;
2use lexer::ptr::Ptr; 2use crate::lexer::ptr::Ptr;
3 3
4use SyntaxKind::{self, *}; 4use crate::SyntaxKind::{self, *};
5 5
6pub(crate) fn scan_number(c: char, ptr: &mut Ptr) -> SyntaxKind { 6pub(crate) fn scan_number(c: char, ptr: &mut Ptr) -> SyntaxKind {
7 if c == '0' { 7 if c == '0' {
diff --git a/crates/ra_syntax/src/lexer/ptr.rs b/crates/ra_syntax/src/lexer/ptr.rs
index c9a5354ea..c4708cb1c 100644
--- a/crates/ra_syntax/src/lexer/ptr.rs
+++ b/crates/ra_syntax/src/lexer/ptr.rs
@@ -1,4 +1,4 @@
1use TextUnit; 1use crate::TextUnit;
2 2
3use std::str::Chars; 3use std::str::Chars;
4 4
diff --git a/crates/ra_syntax/src/lexer/strings.rs b/crates/ra_syntax/src/lexer/strings.rs
index 5ff483d14..bceacdcac 100644
--- a/crates/ra_syntax/src/lexer/strings.rs
+++ b/crates/ra_syntax/src/lexer/strings.rs
@@ -1,6 +1,6 @@
1use SyntaxKind::{self, *}; 1use crate::SyntaxKind::{self, *};
2 2
3use lexer::ptr::Ptr; 3use crate::lexer::ptr::Ptr;
4 4
5pub(crate) fn is_string_literal_start(c: char, c1: Option<char>, c2: Option<char>) -> bool { 5pub(crate) fn is_string_literal_start(c: char, c1: Option<char>, c2: Option<char>) -> bool {
6 match (c, c1, c2) { 6 match (c, c1, c2) {
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 703469629..5bb54aba1 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -46,7 +46,7 @@ mod yellow;
46pub mod utils; 46pub mod utils;
47pub mod text_utils; 47pub mod text_utils;
48 48
49pub use { 49pub use crate::{
50 rowan::{SmolStr, TextRange, TextUnit}, 50 rowan::{SmolStr, TextRange, TextUnit},
51 ast::AstNode, 51 ast::AstNode,
52 lexer::{tokenize, Token}, 52 lexer::{tokenize, Token},
@@ -55,7 +55,7 @@ pub use {
55 reparsing::AtomEdit, 55 reparsing::AtomEdit,
56}; 56};
57 57
58use { 58use crate::{
59 yellow::{GreenNode}, 59 yellow::{GreenNode},
60}; 60};
61 61
diff --git a/crates/ra_syntax/src/parser_api.rs b/crates/ra_syntax/src/parser_api.rs
index 772d753af..cc23bb75e 100644
--- a/crates/ra_syntax/src/parser_api.rs
+++ b/crates/ra_syntax/src/parser_api.rs
@@ -1,4 +1,4 @@
1use { 1use crate::{
2 token_set::TokenSet, 2 token_set::TokenSet,
3 parser_impl::ParserImpl, 3 parser_impl::ParserImpl,
4 SyntaxKind::{self, ERROR}, 4 SyntaxKind::{self, ERROR},
diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs
index 95e5ce4cc..928d2cc7a 100644
--- a/crates/ra_syntax/src/parser_impl/event.rs
+++ b/crates/ra_syntax/src/parser_impl/event.rs
@@ -8,7 +8,7 @@
8//! `start node`, `finish node`, and `FileBuilder` converts 8//! `start node`, `finish node`, and `FileBuilder` converts
9//! this stream to a real tree. 9//! this stream to a real tree.
10use std::mem; 10use std::mem;
11use { 11use crate::{
12 TextUnit, TextRange, SmolStr, 12 TextUnit, TextRange, SmolStr,
13 lexer::Token, 13 lexer::Token,
14 parser_impl::Sink, 14 parser_impl::Sink,
diff --git a/crates/ra_syntax/src/parser_impl/input.rs b/crates/ra_syntax/src/parser_impl/input.rs
index c0fe4d488..ac6d900d8 100644
--- a/crates/ra_syntax/src/parser_impl/input.rs
+++ b/crates/ra_syntax/src/parser_impl/input.rs
@@ -1,4 +1,4 @@
1use {lexer::Token, SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit}; 1use crate::{lexer::Token, SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit};
2 2
3use std::ops::{Add, AddAssign}; 3use std::ops::{Add, AddAssign};
4 4
diff --git a/crates/ra_syntax/src/parser_impl/mod.rs b/crates/ra_syntax/src/parser_impl/mod.rs
index 8d74cef0e..c2a6448e7 100644
--- a/crates/ra_syntax/src/parser_impl/mod.rs
+++ b/crates/ra_syntax/src/parser_impl/mod.rs
@@ -3,7 +3,7 @@ mod input;
3 3
4use std::cell::Cell; 4use std::cell::Cell;
5 5
6use { 6use crate::{
7 TextUnit, SmolStr, 7 TextUnit, SmolStr,
8 lexer::Token, 8 lexer::Token,
9 parser_api::Parser, 9 parser_api::Parser,
@@ -13,7 +13,7 @@ use {
13 }, 13 },
14}; 14};
15 15
16use SyntaxKind::{self, EOF, TOMBSTONE}; 16use crate::SyntaxKind::{self, EOF, TOMBSTONE};
17 17
18pub(crate) trait Sink { 18pub(crate) trait Sink {
19 type Tree; 19 type Tree;
diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs
index d8b6a6a10..16272fe88 100644
--- a/crates/ra_syntax/src/reparsing.rs
+++ b/crates/ra_syntax/src/reparsing.rs
@@ -1,14 +1,14 @@
1use algo; 1use crate::algo;
2use grammar; 2use crate::grammar;
3use lexer::{tokenize, Token}; 3use crate::lexer::{tokenize, Token};
4use yellow::{self, GreenNode, SyntaxNodeRef, SyntaxError}; 4use crate::yellow::{self, GreenNode, SyntaxNodeRef, SyntaxError};
5use parser_impl; 5use crate::parser_impl;
6use parser_api::Parser; 6use crate::parser_api::Parser;
7use { 7use crate::{
8 TextUnit, TextRange, 8 TextUnit, TextRange,
9 SyntaxKind::*, 9 SyntaxKind::*,
10}; 10};
11use text_utils::replace_range; 11use crate::text_utils::replace_range;
12 12
13#[derive(Debug, Clone)] 13#[derive(Debug, Clone)]
14pub struct AtomEdit { 14pub struct AtomEdit {
diff --git a/crates/ra_syntax/src/syntax_kinds/mod.rs b/crates/ra_syntax/src/syntax_kinds/mod.rs
index 332cd13ac..3041e5633 100644
--- a/crates/ra_syntax/src/syntax_kinds/mod.rs
+++ b/crates/ra_syntax/src/syntax_kinds/mod.rs
@@ -1,7 +1,7 @@
1mod generated; 1mod generated;
2 2
3use std::fmt; 3use std::fmt;
4use SyntaxKind::*; 4use crate::SyntaxKind::*;
5 5
6pub use self::generated::SyntaxKind; 6pub use self::generated::SyntaxKind;
7 7
diff --git a/crates/ra_syntax/src/text_utils.rs b/crates/ra_syntax/src/text_utils.rs
index 58ae1e43e..adf26ef30 100644
--- a/crates/ra_syntax/src/text_utils.rs
+++ b/crates/ra_syntax/src/text_utils.rs
@@ -1,4 +1,4 @@
1use {TextRange, TextUnit}; 1use crate::{TextRange, TextUnit};
2 2
3pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool { 3pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
4 range.start() <= offset && offset <= range.end() 4 range.start() <= offset && offset <= range.end()
diff --git a/crates/ra_syntax/src/token_set.rs b/crates/ra_syntax/src/token_set.rs
index c83fba81b..d407dfa48 100644
--- a/crates/ra_syntax/src/token_set.rs
+++ b/crates/ra_syntax/src/token_set.rs
@@ -1,4 +1,4 @@
1use SyntaxKind; 1use crate::SyntaxKind;
2 2
3#[derive(Clone, Copy)] 3#[derive(Clone, Copy)]
4pub(crate) struct TokenSet(pub(crate) u128); 4pub(crate) struct TokenSet(pub(crate) u128);
@@ -29,7 +29,7 @@ macro_rules! token_set_union {
29 29
30#[test] 30#[test]
31fn token_set_works_for_tokens() { 31fn token_set_works_for_tokens() {
32 use SyntaxKind::*; 32 use crate::SyntaxKind::*;
33 let ts = token_set! { EOF, SHEBANG }; 33 let ts = token_set! { EOF, SHEBANG };
34 assert!(ts.contains(EOF)); 34 assert!(ts.contains(EOF));
35 assert!(ts.contains(SHEBANG)); 35 assert!(ts.contains(SHEBANG));
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs
index e274f7471..df1f4b372 100644
--- a/crates/ra_syntax/src/utils.rs
+++ b/crates/ra_syntax/src/utils.rs
@@ -1,5 +1,5 @@
1use std::fmt::Write; 1use std::fmt::Write;
2use { 2use crate::{
3 algo::walk::{walk, WalkEvent}, 3 algo::walk::{walk, WalkEvent},
4 SyntaxKind, File, SyntaxNodeRef 4 SyntaxKind, File, SyntaxNodeRef
5}; 5};
diff --git a/crates/ra_syntax/src/yellow/builder.rs b/crates/ra_syntax/src/yellow/builder.rs
index c307b2bd0..67a1a382b 100644
--- a/crates/ra_syntax/src/yellow/builder.rs
+++ b/crates/ra_syntax/src/yellow/builder.rs
@@ -1,5 +1,5 @@
1use rowan::GreenNodeBuilder; 1use rowan::GreenNodeBuilder;
2use { 2use crate::{
3 TextUnit, SmolStr, 3 TextUnit, SmolStr,
4 parser_impl::Sink, 4 parser_impl::Sink,
5 yellow::{GreenNode, SyntaxError, RaTypes}, 5 yellow::{GreenNode, SyntaxError, RaTypes},
diff --git a/crates/ra_syntax/src/yellow/mod.rs b/crates/ra_syntax/src/yellow/mod.rs
index 710320f47..ab9bca0f0 100644
--- a/crates/ra_syntax/src/yellow/mod.rs
+++ b/crates/ra_syntax/src/yellow/mod.rs
@@ -6,7 +6,7 @@ use std::{
6 hash::{Hash, Hasher}, 6 hash::{Hash, Hasher},
7}; 7};
8use rowan::Types; 8use rowan::Types;
9use {SyntaxKind, TextUnit, TextRange, SmolStr}; 9use crate::{SyntaxKind, TextUnit, TextRange, SmolStr};
10use self::syntax_text::SyntaxText; 10use self::syntax_text::SyntaxText;
11 11
12pub use rowan::{TreeRoot}; 12pub use rowan::{TreeRoot};
@@ -70,16 +70,16 @@ impl<'a> SyntaxNodeRef<'a> {
70 self.0.leaf_text() 70 self.0.leaf_text()
71 } 71 }
72 pub fn ancestors(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { 72 pub fn ancestors(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
73 ::algo::generate(Some(self), |&node| node.parent()) 73 crate::algo::generate(Some(self), |&node| node.parent())
74 } 74 }
75 pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { 75 pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
76 ::algo::walk::walk(self).filter_map(|event| match event { 76 crate::algo::walk::walk(self).filter_map(|event| match event {
77 ::algo::walk::WalkEvent::Enter(node) => Some(node), 77 crate::algo::walk::WalkEvent::Enter(node) => Some(node),
78 ::algo::walk::WalkEvent::Exit(_) => None, 78 crate::algo::walk::WalkEvent::Exit(_) => None,
79 }) 79 })
80 } 80 }
81 pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> { 81 pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
82 ::algo::generate(Some(self), move |&node| match direction { 82 crate::algo::generate(Some(self), move |&node| match direction {
83 Direction::Next => node.next_sibling(), 83 Direction::Next => node.next_sibling(),
84 Direction::Prev => node.prev_sibling(), 84 Direction::Prev => node.prev_sibling(),
85 }) 85 })
@@ -156,7 +156,7 @@ impl<R: TreeRoot<RaTypes>> Iterator for SyntaxNodeChildren<R> {
156 156
157 157
158fn has_short_text(kind: SyntaxKind) -> bool { 158fn has_short_text(kind: SyntaxKind) -> bool {
159 use SyntaxKind::*; 159 use crate::SyntaxKind::*;
160 match kind { 160 match kind {
161 IDENT | LIFETIME | INT_NUMBER | FLOAT_NUMBER => true, 161 IDENT | LIFETIME | INT_NUMBER | FLOAT_NUMBER => true,
162 _ => false, 162 _ => false,
diff --git a/crates/ra_syntax/src/yellow/syntax_text.rs b/crates/ra_syntax/src/yellow/syntax_text.rs
index 0db1049de..ae33b993d 100644
--- a/crates/ra_syntax/src/yellow/syntax_text.rs
+++ b/crates/ra_syntax/src/yellow/syntax_text.rs
@@ -2,7 +2,7 @@ use std::{
2 fmt, ops, 2 fmt, ops,
3}; 3};
4 4
5use { 5use crate::{
6 SyntaxNodeRef, TextRange, TextUnit, 6 SyntaxNodeRef, TextRange, TextUnit,
7 text_utils::{intersect, contains_offset_nonstrict}, 7 text_utils::{intersect, contains_offset_nonstrict},
8}; 8};
diff --git a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
new file mode 100644
index 000000000..f1ed30220
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
@@ -0,0 +1,3 @@
1fn main() {
2 make_query(crate::module_map::module_tree);
3}
diff --git a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt
new file mode 100644
index 000000000..364315180
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt
@@ -0,0 +1,41 @@
1ROOT@[0; 62)
2 FN_DEF@[0; 61)
3 FN_KW@[0; 2)
4 WHITESPACE@[2; 3)
5 NAME@[3; 7)
6 IDENT@[3; 7) "main"
7 PARAM_LIST@[7; 9)
8 L_PAREN@[7; 8)
9 R_PAREN@[8; 9)
10 WHITESPACE@[9; 10)
11 BLOCK@[10; 61)
12 L_CURLY@[10; 11)
13 WHITESPACE@[11; 16)
14 EXPR_STMT@[16; 59)
15 CALL_EXPR@[16; 58)
16 PATH_EXPR@[16; 26)
17 PATH@[16; 26)
18 PATH_SEGMENT@[16; 26)
19 NAME_REF@[16; 26)
20 IDENT@[16; 26) "make_query"
21 ARG_LIST@[26; 58)
22 L_PAREN@[26; 27)
23 PATH_EXPR@[27; 57)
24 PATH@[27; 57)
25 PATH@[27; 44)
26 PATH@[27; 32)
27 PATH_SEGMENT@[27; 32)
28 CRATE_KW@[27; 32)
29 COLONCOLON@[32; 34)
30 PATH_SEGMENT@[34; 44)
31 NAME_REF@[34; 44)
32 IDENT@[34; 44) "module_map"
33 COLONCOLON@[44; 46)
34 PATH_SEGMENT@[46; 57)
35 NAME_REF@[46; 57)
36 IDENT@[46; 57) "module_tree"
37 R_PAREN@[57; 58)
38 SEMI@[58; 59)
39 WHITESPACE@[59; 60)
40 R_CURLY@[60; 61)
41 WHITESPACE@[61; 62)
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml
index 41316581e..fe0998ab8 100644
--- a/crates/test_utils/Cargo.toml
+++ b/crates/test_utils/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "test_utils" 3name = "test_utils"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
diff --git a/crates/tools/Cargo.toml b/crates/tools/Cargo.toml
index d03910986..e2fecc60d 100644
--- a/crates/tools/Cargo.toml
+++ b/crates/tools/Cargo.toml
@@ -1,4 +1,5 @@
1[package] 1[package]
2edition = "2018"
2name = "tools" 3name = "tools"
3version = "0.1.0" 4version = "0.1.0"
4authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]