aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_path.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-15 09:56:24 +0000
committerAleksey Kladov <[email protected]>2019-11-15 09:56:24 +0000
commit3564fbb7f5fc7fc91530c441a6dacce88762fcc9 (patch)
tree5674794ed5d5eb7be2026d6cf2105602fa87d882 /crates/ra_ide_api/src/completion/complete_path.rs
parente05fc9455dd64c240ddc5896f739ea3842838210 (diff)
Auto-upgrade some insta snapshots
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs332
1 files changed, 176 insertions, 156 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index 09ca40179..5d974cf6d 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -152,18 +152,20 @@ mod tests {
152 } 152 }
153 " 153 "
154 ), 154 ),
155 @r###"[ 155 @r###"
156 CompletionItem { 156 [
157 label: "my", 157 CompletionItem {
158 source_range: [27; 29), 158 label: "my",
159 delete: [27; 29), 159 source_range: [27; 29),
160 insert: "my", 160 delete: [27; 29),
161 kind: Module, 161 insert: "my",
162 documentation: Documentation( 162 kind: Module,
163 "Some simple\ndocs describing `mod my`.", 163 documentation: Documentation(
164 ), 164 "Some simple\ndocs describing `mod my`.",
165 }, 165 ),
166]"### 166 },
167 ]
168 "###
167 ); 169 );
168 } 170 }
169 171
@@ -179,15 +181,17 @@ mod tests {
179 } 181 }
180 " 182 "
181 ), 183 ),
182 @r###"[ 184 @r###"
183 CompletionItem { 185 [
184 label: "Bar", 186 CompletionItem {
185 source_range: [30; 30), 187 label: "Bar",
186 delete: [30; 30), 188 source_range: [30; 30),
187 insert: "Bar", 189 delete: [30; 30),
188 kind: Struct, 190 insert: "Bar",
189 }, 191 kind: Struct,
190]"### 192 },
193 ]
194 "###
191 ); 195 );
192 } 196 }
193 197
@@ -203,22 +207,24 @@ mod tests {
203 use crate::Sp<|> 207 use crate::Sp<|>
204 " 208 "
205 ), 209 ),
206 @r###"[ 210 @r###"
207 CompletionItem { 211 [
208 label: "Spam", 212 CompletionItem {
209 source_range: [11; 13), 213 label: "Spam",
210 delete: [11; 13), 214 source_range: [11; 13),
211 insert: "Spam", 215 delete: [11; 13),
212 kind: Struct, 216 insert: "Spam",
213 }, 217 kind: Struct,
214 CompletionItem { 218 },
215 label: "foo", 219 CompletionItem {
216 source_range: [11; 13), 220 label: "foo",
217 delete: [11; 13), 221 source_range: [11; 13),
218 insert: "foo", 222 delete: [11; 13),
219 kind: Module, 223 insert: "foo",
220 }, 224 kind: Module,
221]"### 225 },
226 ]
227 "###
222 ); 228 );
223 } 229 }
224 230
@@ -234,22 +240,24 @@ mod tests {
234 use crate::{Sp<|>}; 240 use crate::{Sp<|>};
235 " 241 "
236 ), 242 ),
237 @r###"[ 243 @r###"
238 CompletionItem { 244 [
239 label: "Spam", 245 CompletionItem {
240 source_range: [12; 14), 246 label: "Spam",
241 delete: [12; 14), 247 source_range: [12; 14),
242 insert: "Spam", 248 delete: [12; 14),
243 kind: Struct, 249 insert: "Spam",
244 }, 250 kind: Struct,
245 CompletionItem { 251 },
246 label: "foo", 252 CompletionItem {
247 source_range: [12; 14), 253 label: "foo",
248 delete: [12; 14), 254 source_range: [12; 14),
249 insert: "foo", 255 delete: [12; 14),
250 kind: Module, 256 insert: "foo",
251 }, 257 kind: Module,
252]"### 258 },
259 ]
260 "###
253 ); 261 );
254 } 262 }
255 263
@@ -269,15 +277,17 @@ mod tests {
269 use crate::{bar::{baz::Sp<|>}}; 277 use crate::{bar::{baz::Sp<|>}};
270 " 278 "
271 ), 279 ),
272 @r###"[ 280 @r###"
273 CompletionItem { 281 [
274 label: "Spam", 282 CompletionItem {
275 source_range: [23; 25), 283 label: "Spam",
276 delete: [23; 25), 284 source_range: [23; 25),
277 insert: "Spam", 285 delete: [23; 25),
278 kind: Struct, 286 insert: "Spam",
279 }, 287 kind: Struct,
280]"### 288 },
289 ]
290 "###
281 ); 291 );
282 } 292 }
283 293
@@ -297,30 +307,32 @@ mod tests {
297 fn foo() { let _ = E::<|> } 307 fn foo() { let _ = E::<|> }
298 " 308 "
299 ), 309 ),
300 @r###"[ 310 @r###"
301 CompletionItem { 311 [
302 label: "Bar", 312 CompletionItem {
303 source_range: [116; 116), 313 label: "Bar",
304 delete: [116; 116), 314 source_range: [116; 116),
305 insert: "Bar", 315 delete: [116; 116),
306 kind: EnumVariant, 316 insert: "Bar",
307 detail: "(i32)", 317 kind: EnumVariant,
308 documentation: Documentation( 318 detail: "(i32)",
309 "Bar Variant with i32", 319 documentation: Documentation(
310 ), 320 "Bar Variant with i32",
311 }, 321 ),
312 CompletionItem { 322 },
313 label: "Foo", 323 CompletionItem {
314 source_range: [116; 116), 324 label: "Foo",
315 delete: [116; 116), 325 source_range: [116; 116),
316 insert: "Foo", 326 delete: [116; 116),
317 kind: EnumVariant, 327 insert: "Foo",
318 detail: "()", 328 kind: EnumVariant,
319 documentation: Documentation( 329 detail: "()",
320 "Foo Variant", 330 documentation: Documentation(
321 ), 331 "Foo Variant",
322 }, 332 ),
323]"### 333 },
334 ]
335 "###
324 ); 336 );
325 } 337 }
326 338
@@ -343,41 +355,43 @@ mod tests {
343 fn foo() { let _ = E::<|> } 355 fn foo() { let _ = E::<|> }
344 " 356 "
345 ), 357 ),
346 @r###"[ 358 @r###"
347 CompletionItem { 359 [
348 label: "Bar", 360 CompletionItem {
349 source_range: [180; 180), 361 label: "Bar",
350 delete: [180; 180), 362 source_range: [180; 180),
351 insert: "Bar", 363 delete: [180; 180),
352 kind: EnumVariant, 364 insert: "Bar",
353 detail: "(i32, u32)", 365 kind: EnumVariant,
354 documentation: Documentation( 366 detail: "(i32, u32)",
355 "Bar Variant with i32 and u32", 367 documentation: Documentation(
356 ), 368 "Bar Variant with i32 and u32",
357 }, 369 ),
358 CompletionItem { 370 },
359 label: "Foo", 371 CompletionItem {
360 source_range: [180; 180), 372 label: "Foo",
361 delete: [180; 180), 373 source_range: [180; 180),
362 insert: "Foo", 374 delete: [180; 180),
363 kind: EnumVariant, 375 insert: "Foo",
364 detail: "()", 376 kind: EnumVariant,
365 documentation: Documentation( 377 detail: "()",
366 "Foo Variant (empty)", 378 documentation: Documentation(
367 ), 379 "Foo Variant (empty)",
368 }, 380 ),
369 CompletionItem { 381 },
370 label: "S", 382 CompletionItem {
371 source_range: [180; 180), 383 label: "S",
372 delete: [180; 180), 384 source_range: [180; 180),
373 insert: "S", 385 delete: [180; 180),
374 kind: EnumVariant, 386 insert: "S",
375 detail: "(S)", 387 kind: EnumVariant,
376 documentation: Documentation( 388 detail: "(S)",
377 "", 389 documentation: Documentation(
378 ), 390 "",
379 }, 391 ),
380]"### 392 },
393 ]
394 "###
381 ); 395 );
382 } 396 }
383 397
@@ -434,19 +448,21 @@ mod tests {
434 fn foo() { let _ = S::<|> } 448 fn foo() { let _ = S::<|> }
435 " 449 "
436 ), 450 ),
437 @r###"[ 451 @r###"
438 CompletionItem { 452 [
439 label: "C", 453 CompletionItem {
440 source_range: [107; 107), 454 label: "C",
441 delete: [107; 107), 455 source_range: [107; 107),
442 insert: "C", 456 delete: [107; 107),
443 kind: Const, 457 insert: "C",
444 detail: "const C: i32 = 42;", 458 kind: Const,
445 documentation: Documentation( 459 detail: "const C: i32 = 42;",
446 "An associated const", 460 documentation: Documentation(
447 ), 461 "An associated const",
448 }, 462 ),
449]"### 463 },
464 ]
465 "###
450 ); 466 );
451 } 467 }
452 468
@@ -467,19 +483,21 @@ mod tests {
467 fn foo() { let _ = S::<|> } 483 fn foo() { let _ = S::<|> }
468 " 484 "
469 ), 485 ),
470 @r###"[ 486 @r###"
471 CompletionItem { 487 [
472 label: "T", 488 CompletionItem {
473 source_range: [101; 101), 489 label: "T",
474 delete: [101; 101), 490 source_range: [101; 101),
475 insert: "T", 491 delete: [101; 101),
476 kind: TypeAlias, 492 insert: "T",
477 detail: "type T = i32;", 493 kind: TypeAlias,
478 documentation: Documentation( 494 detail: "type T = i32;",
479 "An associated type", 495 documentation: Documentation(
480 ), 496 "An associated type",
481 }, 497 ),
482]"### 498 },
499 ]
500 "###
483 ); 501 );
484 } 502 }
485 503
@@ -569,15 +587,17 @@ mod tests {
569 } 587 }
570 " 588 "
571 ), 589 ),
572 @r###"[ 590 @r###"
573 CompletionItem { 591 [
574 label: "bar", 592 CompletionItem {
575 source_range: [9; 9), 593 label: "bar",
576 delete: [9; 9), 594 source_range: [9; 9),
577 insert: "bar", 595 delete: [9; 9),
578 kind: Module, 596 insert: "bar",
579 }, 597 kind: Module,
580]"### 598 },
599 ]
600 "###
581 ); 601 );
582 } 602 }
583 603