aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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/mod.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
24 files changed, 44 insertions, 44 deletions
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/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/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};