diff options
-rw-r--r-- | crates/ra_hir/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 13 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_scope.rs | 26 |
3 files changed, 19 insertions, 22 deletions
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 64b55860d..ea06a4a58 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -59,7 +59,7 @@ pub use hir_def::{ | |||
59 | ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. | 59 | ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. |
60 | }; | 60 | }; |
61 | pub use hir_expand::{ | 61 | pub use hir_expand::{ |
62 | name::{known, Name}, | 62 | name::{name, Name}, |
63 | HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, | 63 | HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, |
64 | }; | 64 | }; |
65 | pub use hir_ty::{display::HirDisplay, CallableDef}; | 65 | pub use hir_ty::{display::HirDisplay, CallableDef}; |
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index 44b47ec91..133805bdb 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs | |||
@@ -143,9 +143,6 @@ pub mod known { | |||
143 | std, | 143 | std, |
144 | core, | 144 | core, |
145 | alloc, | 145 | alloc, |
146 | hash, | ||
147 | fmt, | ||
148 | io, | ||
149 | iter, | 146 | iter, |
150 | ops, | 147 | ops, |
151 | future, | 148 | future, |
@@ -170,9 +167,6 @@ pub mod known { | |||
170 | Neg, | 167 | Neg, |
171 | Not, | 168 | Not, |
172 | Index, | 169 | Index, |
173 | Display, | ||
174 | Iterator, | ||
175 | Hasher, | ||
176 | // Builtin macros | 170 | // Builtin macros |
177 | file, | 171 | file, |
178 | column, | 172 | column, |
@@ -193,6 +187,13 @@ pub mod known { | |||
193 | PartialOrd, | 187 | PartialOrd, |
194 | Eq, | 188 | Eq, |
195 | PartialEq, | 189 | PartialEq, |
190 | // FIXME delete those after `ImportResolver` is removed. | ||
191 | hash, | ||
192 | fmt, | ||
193 | io, | ||
194 | Display, | ||
195 | Iterator, | ||
196 | Hasher, | ||
196 | ); | 197 | ); |
197 | 198 | ||
198 | // self/Self cannot be used as an identifier | 199 | // self/Self cannot be used as an identifier |
diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs index fe0795984..64b04ec2b 100644 --- a/crates/ra_ide/src/completion/complete_scope.rs +++ b/crates/ra_ide/src/completion/complete_scope.rs | |||
@@ -72,62 +72,58 @@ pub(crate) struct ImportResolver { | |||
72 | 72 | ||
73 | impl ImportResolver { | 73 | impl ImportResolver { |
74 | pub(crate) fn new() -> Self { | 74 | pub(crate) fn new() -> Self { |
75 | use hir::name; | ||
76 | |||
75 | let dummy_names = vec![ | 77 | let dummy_names = vec![ |
76 | ( | 78 | ( |
77 | SmolStr::new("fmt"), | 79 | SmolStr::new("fmt"), |
78 | ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::fmt] }, | 80 | ModPath { kind: PathKind::Plain, segments: vec![name![std], name![fmt]] }, |
79 | ), | 81 | ), |
80 | ( | 82 | ( |
81 | SmolStr::new("io"), | 83 | SmolStr::new("io"), |
82 | ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::io] }, | 84 | ModPath { kind: PathKind::Plain, segments: vec![name![std], name![io]] }, |
83 | ), | 85 | ), |
84 | ( | 86 | ( |
85 | SmolStr::new("iter"), | 87 | SmolStr::new("iter"), |
86 | ModPath { | 88 | ModPath { kind: PathKind::Plain, segments: vec![name![std], name![iter]] }, |
87 | kind: PathKind::Plain, | ||
88 | segments: vec![hir::known::std, hir::known::iter], | ||
89 | }, | ||
90 | ), | 89 | ), |
91 | ( | 90 | ( |
92 | SmolStr::new("hash"), | 91 | SmolStr::new("hash"), |
93 | ModPath { | 92 | ModPath { kind: PathKind::Plain, segments: vec![name![std], name![hash]] }, |
94 | kind: PathKind::Plain, | ||
95 | segments: vec![hir::known::std, hir::known::hash], | ||
96 | }, | ||
97 | ), | 93 | ), |
98 | ( | 94 | ( |
99 | SmolStr::new("Debug"), | 95 | SmolStr::new("Debug"), |
100 | ModPath { | 96 | ModPath { |
101 | kind: PathKind::Plain, | 97 | kind: PathKind::Plain, |
102 | segments: vec![hir::known::std, hir::known::fmt, hir::known::Debug], | 98 | segments: vec![name![std], name![fmt], name![Debug]], |
103 | }, | 99 | }, |
104 | ), | 100 | ), |
105 | ( | 101 | ( |
106 | SmolStr::new("Display"), | 102 | SmolStr::new("Display"), |
107 | ModPath { | 103 | ModPath { |
108 | kind: PathKind::Plain, | 104 | kind: PathKind::Plain, |
109 | segments: vec![hir::known::std, hir::known::fmt, hir::known::Display], | 105 | segments: vec![name![std], name![fmt], name![Display]], |
110 | }, | 106 | }, |
111 | ), | 107 | ), |
112 | ( | 108 | ( |
113 | SmolStr::new("Hash"), | 109 | SmolStr::new("Hash"), |
114 | ModPath { | 110 | ModPath { |
115 | kind: PathKind::Plain, | 111 | kind: PathKind::Plain, |
116 | segments: vec![hir::known::std, hir::known::hash, hir::known::Hash], | 112 | segments: vec![name![std], name![hash], name![Hash]], |
117 | }, | 113 | }, |
118 | ), | 114 | ), |
119 | ( | 115 | ( |
120 | SmolStr::new("Hasher"), | 116 | SmolStr::new("Hasher"), |
121 | ModPath { | 117 | ModPath { |
122 | kind: PathKind::Plain, | 118 | kind: PathKind::Plain, |
123 | segments: vec![hir::known::std, hir::known::hash, hir::known::Hasher], | 119 | segments: vec![name![std], name![hash], name![Hasher]], |
124 | }, | 120 | }, |
125 | ), | 121 | ), |
126 | ( | 122 | ( |
127 | SmolStr::new("Iterator"), | 123 | SmolStr::new("Iterator"), |
128 | ModPath { | 124 | ModPath { |
129 | kind: PathKind::Plain, | 125 | kind: PathKind::Plain, |
130 | segments: vec![hir::known::std, hir::known::iter, hir::known::Iterator], | 126 | segments: vec![name![std], name![iter], name![Iterator]], |
131 | }, | 127 | }, |
132 | ), | 128 | ), |
133 | ]; | 129 | ]; |