diff options
Diffstat (limited to 'crates/ide_completion/src/completions/keyword.rs')
-rw-r--r-- | crates/ide_completion/src/completions/keyword.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs index 0bfdf9603..7970e75c7 100644 --- a/crates/ide_completion/src/completions/keyword.rs +++ b/crates/ide_completion/src/completions/keyword.rs | |||
@@ -90,11 +90,13 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
90 | } | 90 | } |
91 | 91 | ||
92 | if expects_item || has_block_expr_parent { | 92 | if expects_item || has_block_expr_parent { |
93 | if !ctx.has_visibility_prev_sibling() { | ||
94 | add_keyword("impl", "impl $1 {\n $0\n}"); | ||
95 | add_keyword("extern", "extern $0"); | ||
96 | } | ||
93 | add_keyword("use", "use $0"); | 97 | add_keyword("use", "use $0"); |
94 | add_keyword("impl", "impl $1 {\n $0\n}"); | ||
95 | add_keyword("trait", "trait $1 {\n $0\n}"); | 98 | add_keyword("trait", "trait $1 {\n $0\n}"); |
96 | add_keyword("static", "static $0"); | 99 | add_keyword("static", "static $0"); |
97 | add_keyword("extern", "extern $0"); | ||
98 | add_keyword("mod", "mod $0"); | 100 | add_keyword("mod", "mod $0"); |
99 | } | 101 | } |
100 | 102 | ||
@@ -241,11 +243,11 @@ mod tests { | |||
241 | kw fn | 243 | kw fn |
242 | kw const | 244 | kw const |
243 | kw type | 245 | kw type |
244 | kw use | ||
245 | kw impl | 246 | kw impl |
247 | kw extern | ||
248 | kw use | ||
246 | kw trait | 249 | kw trait |
247 | kw static | 250 | kw static |
248 | kw extern | ||
249 | kw mod | 251 | kw mod |
250 | kw match | 252 | kw match |
251 | kw while | 253 | kw while |
@@ -269,11 +271,11 @@ mod tests { | |||
269 | kw fn | 271 | kw fn |
270 | kw const | 272 | kw const |
271 | kw type | 273 | kw type |
272 | kw use | ||
273 | kw impl | 274 | kw impl |
275 | kw extern | ||
276 | kw use | ||
274 | kw trait | 277 | kw trait |
275 | kw static | 278 | kw static |
276 | kw extern | ||
277 | kw mod | 279 | kw mod |
278 | kw match | 280 | kw match |
279 | kw while | 281 | kw while |
@@ -297,11 +299,11 @@ mod tests { | |||
297 | kw fn | 299 | kw fn |
298 | kw const | 300 | kw const |
299 | kw type | 301 | kw type |
300 | kw use | ||
301 | kw impl | 302 | kw impl |
303 | kw extern | ||
304 | kw use | ||
302 | kw trait | 305 | kw trait |
303 | kw static | 306 | kw static |
304 | kw extern | ||
305 | kw mod | 307 | kw mod |
306 | kw match | 308 | kw match |
307 | kw while | 309 | kw while |
@@ -399,11 +401,11 @@ fn quux() -> i32 { | |||
399 | kw fn | 401 | kw fn |
400 | kw const | 402 | kw const |
401 | kw type | 403 | kw type |
402 | kw use | ||
403 | kw impl | 404 | kw impl |
405 | kw extern | ||
406 | kw use | ||
404 | kw trait | 407 | kw trait |
405 | kw static | 408 | kw static |
406 | kw extern | ||
407 | kw mod | 409 | kw mod |
408 | kw match | 410 | kw match |
409 | kw while | 411 | kw while |