aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorMartin Asquino <[email protected]>2019-11-02 22:33:34 +0000
committerMartin Asquino <[email protected]>2019-11-02 22:33:34 +0000
commitccf8817d181ab9430a00c38d96b481a07af701bb (patch)
tree3ebe6c1e70f859eff504f3081c057060e04c2c5d /crates/ra_ide_api
parentdc3848a6a3e659004ba4f2160503be28ea0f9051 (diff)
Use `bool` instead of `Option<bool>` and print it's value only when `true`
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/completion/complete_dot.rs11
-rw-r--r--crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs4
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs17
-rw-r--r--crates/ra_ide_api/src/completion/complete_record_literal.rs4
-rw-r--r--crates/ra_ide_api/src/completion/complete_record_pattern.rs3
-rw-r--r--crates/ra_ide_api/src/completion/complete_scope.rs19
-rw-r--r--crates/ra_ide_api/src/completion/completion_item.rs10
-rw-r--r--crates/ra_ide_api/src/completion/presentation.rs15
8 files changed, 5 insertions, 78 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs
index 9c0abd590..b4df6ee2a 100644
--- a/crates/ra_ide_api/src/completion/complete_dot.rs
+++ b/crates/ra_ide_api/src/completion/complete_dot.rs
@@ -96,7 +96,6 @@ mod tests {
96 ⋮ insert: "the_field", 96 ⋮ insert: "the_field",
97 ⋮ kind: Field, 97 ⋮ kind: Field,
98 ⋮ detail: "u32", 98 ⋮ detail: "u32",
99 ⋮ deprecated: false,
100 ⋮ }, 99 ⋮ },
101 ⋮] 100 ⋮]
102 "### 101 "###
@@ -129,7 +128,6 @@ mod tests {
129 kind: Method, 128 kind: Method,
130 lookup: "foo", 129 lookup: "foo",
131 detail: "fn foo(self)", 130 detail: "fn foo(self)",
132 deprecated: false,
133 }, 131 },
134 CompletionItem { 132 CompletionItem {
135 label: "the_field", 133 label: "the_field",
@@ -141,7 +139,6 @@ mod tests {
141 documentation: Documentation( 139 documentation: Documentation(
142 "This is the_field", 140 "This is the_field",
143 ), 141 ),
144 deprecated: false,
145 }, 142 },
146 ] 143 ]
147 "### 144 "###
@@ -171,7 +168,6 @@ mod tests {
171 kind: Method, 168 kind: Method,
172 lookup: "foo", 169 lookup: "foo",
173 detail: "fn foo(&self)", 170 detail: "fn foo(&self)",
174 deprecated: false,
175 }, 171 },
176 CompletionItem { 172 CompletionItem {
177 label: "the_field", 173 label: "the_field",
@@ -180,7 +176,6 @@ mod tests {
180 insert: "the_field", 176 insert: "the_field",
181 kind: Field, 177 kind: Field,
182 detail: "(u32, i32)", 178 detail: "(u32, i32)",
183 deprecated: false,
184 }, 179 },
185 ] 180 ]
186 "### 181 "###
@@ -226,7 +221,6 @@ mod tests {
226 kind: Method, 221 kind: Method,
227 lookup: "the_method", 222 lookup: "the_method",
228 detail: "fn the_method(&self)", 223 detail: "fn the_method(&self)",
229 deprecated: false,
230 }, 224 },
231 ] 225 ]
232 "### 226 "###
@@ -256,7 +250,6 @@ mod tests {
256 kind: Method, 250 kind: Method,
257 lookup: "the_method", 251 lookup: "the_method",
258 detail: "fn the_method(&self)", 252 detail: "fn the_method(&self)",
259 deprecated: false,
260 }, 253 },
261 ] 254 ]
262 "### 255 "###
@@ -286,7 +279,6 @@ mod tests {
286 kind: Method, 279 kind: Method,
287 lookup: "the_method", 280 lookup: "the_method",
288 detail: "fn the_method(&self)", 281 detail: "fn the_method(&self)",
289 deprecated: false,
290 }, 282 },
291 ] 283 ]
292 "### 284 "###
@@ -339,7 +331,6 @@ mod tests {
339 kind: Method, 331 kind: Method,
340 lookup: "the_method", 332 lookup: "the_method",
341 detail: "fn the_method(&self)", 333 detail: "fn the_method(&self)",
342 deprecated: false,
343 }, 334 },
344 ] 335 ]
345 "### 336 "###
@@ -410,7 +401,6 @@ mod tests {
410 kind: Method, 401 kind: Method,
411 lookup: "blah", 402 lookup: "blah",
412 detail: "pub fn blah(&self)", 403 detail: "pub fn blah(&self)",
413 deprecated: false,
414 }, 404 },
415 ] 405 ]
416 "### 406 "###
@@ -437,7 +427,6 @@ mod tests {
437 ⋮ insert: "the_field", 427 ⋮ insert: "the_field",
438 ⋮ kind: Field, 428 ⋮ kind: Field,
439 ⋮ detail: "u32", 429 ⋮ detail: "u32",
440 ⋮ deprecated: false,
441 ⋮ }, 430 ⋮ },
442 ⋮] 431 ⋮]
443 "### 432 "###
diff --git a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs
index a082a3c7c..09f743c66 100644
--- a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs
+++ b/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs
@@ -45,7 +45,6 @@ mod tests {
45 insert: "foo!($0)", 45 insert: "foo!($0)",
46 kind: Macro, 46 kind: Macro,
47 detail: "macro_rules! foo", 47 detail: "macro_rules! foo",
48 deprecated: false,
49 }, 48 },
50]"## 49]"##
51 ); 50 );
@@ -87,7 +86,6 @@ mod tests {
87 documentation: Documentation( 86 documentation: Documentation(
88 "Creates a [`Vec`] containing the arguments.\n\n- Create a [`Vec`] containing a given list of elements:\n\n```\nlet v = vec![1, 2, 3];\nassert_eq!(v[0], 1);\nassert_eq!(v[1], 2);\nassert_eq!(v[2], 3);\n```", 87 "Creates a [`Vec`] containing the arguments.\n\n- Create a [`Vec`] containing a given list of elements:\n\n```\nlet v = vec![1, 2, 3];\nassert_eq!(v[0], 1);\nassert_eq!(v[1], 2);\nassert_eq!(v[2], 3);\n```",
89 ), 88 ),
90 deprecated: false,
91 }, 89 },
92]"## 90]"##
93 ); 91 );
@@ -123,7 +121,6 @@ mod tests {
123 documentation: Documentation( 121 documentation: Documentation(
124 "Foo\n\nNot call `fooo!()` `fooo!()`, or `_foo![]` `_foo![]`.\nCall as `let _=foo! { hello world };`", 122 "Foo\n\nNot call `fooo!()` `fooo!()`, or `_foo![]` `_foo![]`.\nCall as `let _=foo! { hello world };`",
125 ), 123 ),
126 deprecated: false,
127 }, 124 },
128 CompletionItem { 125 CompletionItem {
129 label: "main()", 126 label: "main()",
@@ -133,7 +130,6 @@ mod tests {
133 kind: Function, 130 kind: Function,
134 lookup: "main", 131 lookup: "main",
135 detail: "fn main()", 132 detail: "fn main()",
136 deprecated: false,
137 }, 133 },
138] 134]
139 "### 135 "###
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index 2c9c8645b..9ac9768af 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -308,7 +308,6 @@ mod tests {
308 documentation: Documentation( 308 documentation: Documentation(
309 "Bar Variant with i32", 309 "Bar Variant with i32",
310 ), 310 ),
311 deprecated: false,
312 }, 311 },
313 CompletionItem { 312 CompletionItem {
314 label: "Foo", 313 label: "Foo",
@@ -320,7 +319,6 @@ mod tests {
320 documentation: Documentation( 319 documentation: Documentation(
321 "Foo Variant", 320 "Foo Variant",
322 ), 321 ),
323 deprecated: false,
324 }, 322 },
325]"### 323]"###
326 ); 324 );
@@ -356,7 +354,6 @@ mod tests {
356 documentation: Documentation( 354 documentation: Documentation(
357 "Bar Variant with i32 and u32", 355 "Bar Variant with i32 and u32",
358 ), 356 ),
359 deprecated: false,
360 }, 357 },
361 CompletionItem { 358 CompletionItem {
362 label: "Foo", 359 label: "Foo",
@@ -368,7 +365,6 @@ mod tests {
368 documentation: Documentation( 365 documentation: Documentation(
369 "Foo Variant (empty)", 366 "Foo Variant (empty)",
370 ), 367 ),
371 deprecated: false,
372 }, 368 },
373 CompletionItem { 369 CompletionItem {
374 label: "S", 370 label: "S",
@@ -380,7 +376,6 @@ mod tests {
380 documentation: Documentation( 376 documentation: Documentation(
381 "", 377 "",
382 ), 378 ),
383 deprecated: false,
384 }, 379 },
385]"### 380]"###
386 ); 381 );
@@ -416,7 +411,6 @@ mod tests {
416 documentation: Documentation( 411 documentation: Documentation(
417 "An associated method", 412 "An associated method",
418 ), 413 ),
419 deprecated: false,
420 }, 414 },
421 ] 415 ]
422 "### 416 "###
@@ -451,7 +445,6 @@ mod tests {
451 documentation: Documentation( 445 documentation: Documentation(
452 "An associated const", 446 "An associated const",
453 ), 447 ),
454 deprecated: false,
455 }, 448 },
456]"### 449]"###
457 ); 450 );
@@ -485,7 +478,6 @@ mod tests {
485 documentation: Documentation( 478 documentation: Documentation(
486 "An associated type", 479 "An associated type",
487 ), 480 ),
488 deprecated: false,
489 }, 481 },
490]"### 482]"###
491 ); 483 );
@@ -521,7 +513,6 @@ mod tests {
521 documentation: Documentation( 513 documentation: Documentation(
522 "An associated method", 514 "An associated method",
523 ), 515 ),
524 deprecated: false,
525 }, 516 },
526 ] 517 ]
527 "### 518 "###
@@ -558,7 +549,6 @@ mod tests {
558 documentation: Documentation( 549 documentation: Documentation(
559 "An associated method", 550 "An associated method",
560 ), 551 ),
561 deprecated: false,
562 }, 552 },
563 ] 553 ]
564 "### 554 "###
@@ -618,7 +608,6 @@ mod tests {
618 documentation: Documentation( 608 documentation: Documentation(
619 "A trait method", 609 "A trait method",
620 ), 610 ),
621 deprecated: false,
622 }, 611 },
623 ] 612 ]
624 "### 613 "###
@@ -655,7 +644,6 @@ mod tests {
655 documentation: Documentation( 644 documentation: Documentation(
656 "A trait method", 645 "A trait method",
657 ), 646 ),
658 deprecated: false,
659 }, 647 },
660 ] 648 ]
661 "### 649 "###
@@ -692,7 +680,6 @@ mod tests {
692 documentation: Documentation( 680 documentation: Documentation(
693 "A trait method", 681 "A trait method",
694 ), 682 ),
695 deprecated: false,
696 }, 683 },
697 ] 684 ]
698 "### 685 "###
@@ -724,7 +711,6 @@ mod tests {
724 kind: Function, 711 kind: Function,
725 lookup: "bar", 712 lookup: "bar",
726 detail: "fn bar()", 713 detail: "fn bar()",
727 deprecated: false,
728 }, 714 },
729 CompletionItem { 715 CompletionItem {
730 label: "foo()", 716 label: "foo()",
@@ -734,7 +720,6 @@ mod tests {
734 kind: Function, 720 kind: Function,
735 lookup: "foo", 721 lookup: "foo",
736 detail: "fn foo()", 722 detail: "fn foo()",
737 deprecated: false,
738 }, 723 },
739 ] 724 ]
740 "### 725 "###
@@ -765,7 +750,6 @@ mod tests {
765 insert: "foo!($0)", 750 insert: "foo!($0)",
766 kind: Macro, 751 kind: Macro,
767 detail: "#[macro_export]\nmacro_rules! foo", 752 detail: "#[macro_export]\nmacro_rules! foo",
768 deprecated: false,
769 }, 753 },
770 CompletionItem { 754 CompletionItem {
771 label: "main()", 755 label: "main()",
@@ -775,7 +759,6 @@ mod tests {
775 kind: Function, 759 kind: Function,
776 lookup: "main", 760 lookup: "main",
777 detail: "fn main()", 761 detail: "fn main()",
778 deprecated: false,
779 }, 762 },
780 ] 763 ]
781 "### 764 "###
diff --git a/crates/ra_ide_api/src/completion/complete_record_literal.rs b/crates/ra_ide_api/src/completion/complete_record_literal.rs
index 33bea411f..0295b8101 100644
--- a/crates/ra_ide_api/src/completion/complete_record_literal.rs
+++ b/crates/ra_ide_api/src/completion/complete_record_literal.rs
@@ -78,7 +78,6 @@ mod tests {
78 ⋮ insert: "the_field", 78 ⋮ insert: "the_field",
79 ⋮ kind: Field, 79 ⋮ kind: Field,
80 ⋮ detail: "u32", 80 ⋮ detail: "u32",
81 ⋮ deprecated: false,
82 ⋮ }, 81 ⋮ },
83 ⋮] 82 ⋮]
84 "###); 83 "###);
@@ -105,7 +104,6 @@ mod tests {
105 ⋮ insert: "a", 104 ⋮ insert: "a",
106 ⋮ kind: Field, 105 ⋮ kind: Field,
107 ⋮ detail: "u32", 106 ⋮ detail: "u32",
108 ⋮ deprecated: false,
109 ⋮ }, 107 ⋮ },
110 ⋮] 108 ⋮]
111 "###); 109 "###);
@@ -132,7 +130,6 @@ mod tests {
132 ⋮ insert: "b", 130 ⋮ insert: "b",
133 ⋮ kind: Field, 131 ⋮ kind: Field,
134 ⋮ detail: "u32", 132 ⋮ detail: "u32",
135 ⋮ deprecated: false,
136 ⋮ }, 133 ⋮ },
137 ⋮] 134 ⋮]
138 "###); 135 "###);
@@ -158,7 +155,6 @@ mod tests {
158 ⋮ insert: "a", 155 ⋮ insert: "a",
159 ⋮ kind: Field, 156 ⋮ kind: Field,
160 ⋮ detail: "u32", 157 ⋮ detail: "u32",
161 ⋮ deprecated: false,
162 ⋮ }, 158 ⋮ },
163 ⋮] 159 ⋮]
164 "###); 160 "###);
diff --git a/crates/ra_ide_api/src/completion/complete_record_pattern.rs b/crates/ra_ide_api/src/completion/complete_record_pattern.rs
index 93c26f229..d20fa796c 100644
--- a/crates/ra_ide_api/src/completion/complete_record_pattern.rs
+++ b/crates/ra_ide_api/src/completion/complete_record_pattern.rs
@@ -52,7 +52,6 @@ mod tests {
52 ⋮ insert: "foo", 52 ⋮ insert: "foo",
53 ⋮ kind: Field, 53 ⋮ kind: Field,
54 ⋮ detail: "u32", 54 ⋮ detail: "u32",
55 ⋮ deprecated: false,
56 ⋮ }, 55 ⋮ },
57 ⋮] 56 ⋮]
58 "###); 57 "###);
@@ -82,7 +81,6 @@ mod tests {
82 ⋮ insert: "bar", 81 ⋮ insert: "bar",
83 ⋮ kind: Field, 82 ⋮ kind: Field,
84 ⋮ detail: "()", 83 ⋮ detail: "()",
85 ⋮ deprecated: false,
86 ⋮ }, 84 ⋮ },
87 ⋮ CompletionItem { 85 ⋮ CompletionItem {
88 ⋮ label: "foo", 86 ⋮ label: "foo",
@@ -91,7 +89,6 @@ mod tests {
91 ⋮ insert: "foo", 89 ⋮ insert: "foo",
92 ⋮ kind: Field, 90 ⋮ kind: Field,
93 ⋮ detail: "u32", 91 ⋮ detail: "u32",
94 ⋮ deprecated: false,
95 ⋮ }, 92 ⋮ },
96 ⋮] 93 ⋮]
97 "###); 94 "###);
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs
index 9d2deee75..4e56de3f5 100644
--- a/crates/ra_ide_api/src/completion/complete_scope.rs
+++ b/crates/ra_ide_api/src/completion/complete_scope.rs
@@ -155,7 +155,6 @@ mod tests {
155 kind: Function, 155 kind: Function,
156 lookup: "quux", 156 lookup: "quux",
157 detail: "fn quux(x: i32)", 157 detail: "fn quux(x: i32)",
158 deprecated: false,
159 }, 158 },
160 CompletionItem { 159 CompletionItem {
161 label: "x", 160 label: "x",
@@ -219,7 +218,6 @@ mod tests {
219 kind: Function, 218 kind: Function,
220 lookup: "quux", 219 lookup: "quux",
221 detail: "fn quux()", 220 detail: "fn quux()",
222 deprecated: false,
223 }, 221 },
224 ] 222 ]
225 "### 223 "###
@@ -248,7 +246,6 @@ mod tests {
248 kind: Function, 246 kind: Function,
249 lookup: "quux", 247 lookup: "quux",
250 detail: "fn quux()", 248 detail: "fn quux()",
251 deprecated: false,
252 }, 249 },
253 CompletionItem { 250 CompletionItem {
254 label: "x", 251 label: "x",
@@ -289,7 +286,6 @@ mod tests {
289 kind: Function, 286 kind: Function,
290 lookup: "quux", 287 lookup: "quux",
291 detail: "fn quux<T>()", 288 detail: "fn quux<T>()",
292 deprecated: false,
293 }, 289 },
294 ] 290 ]
295 "### 291 "###
@@ -395,7 +391,6 @@ mod tests {
395 kind: Function, 391 kind: Function,
396 lookup: "quux", 392 lookup: "quux",
397 detail: "fn quux()", 393 detail: "fn quux()",
398 deprecated: false,
399 }, 394 },
400 ] 395 ]
401 "### 396 "###
@@ -455,7 +450,6 @@ mod tests {
455 kind: Function, 450 kind: Function,
456 lookup: "quux", 451 lookup: "quux",
457 detail: "fn quux()", 452 detail: "fn quux()",
458 deprecated: false,
459 }, 453 },
460 ] 454 ]
461 "### 455 "###
@@ -488,7 +482,6 @@ mod tests {
488 kind: Function, 482 kind: Function,
489 lookup: "x", 483 lookup: "x",
490 detail: "fn x()", 484 detail: "fn x()",
491 deprecated: false,
492 }, 485 },
493 ] 486 ]
494 "### 487 "###
@@ -527,7 +520,6 @@ mod tests {
527 kind: Function, 520 kind: Function,
528 lookup: "foo", 521 lookup: "foo",
529 detail: "fn foo()", 522 detail: "fn foo()",
530 deprecated: false,
531 }, 523 },
532 ] 524 ]
533 "### 525 "###
@@ -592,7 +584,6 @@ mod tests {
592 kind: Function, 584 kind: Function,
593 lookup: "foo", 585 lookup: "foo",
594 detail: "fn foo()", 586 detail: "fn foo()",
595 deprecated: false,
596 }, 587 },
597 CompletionItem { 588 CompletionItem {
598 label: "std", 589 label: "std",
@@ -648,7 +639,6 @@ mod tests {
648 insert: "bar!($0)", 639 insert: "bar!($0)",
649 kind: Macro, 640 kind: Macro,
650 detail: "macro_rules! bar", 641 detail: "macro_rules! bar",
651 deprecated: false,
652 }, 642 },
653 CompletionItem { 643 CompletionItem {
654 label: "baz!", 644 label: "baz!",
@@ -657,7 +647,6 @@ mod tests {
657 insert: "baz!($0)", 647 insert: "baz!($0)",
658 kind: Macro, 648 kind: Macro,
659 detail: "#[macro_export]\nmacro_rules! baz", 649 detail: "#[macro_export]\nmacro_rules! baz",
660 deprecated: false,
661 }, 650 },
662 CompletionItem { 651 CompletionItem {
663 label: "foo!", 652 label: "foo!",
@@ -666,7 +655,6 @@ mod tests {
666 insert: "foo!($0)", 655 insert: "foo!($0)",
667 kind: Macro, 656 kind: Macro,
668 detail: "macro_rules! foo", 657 detail: "macro_rules! foo",
669 deprecated: false,
670 }, 658 },
671 CompletionItem { 659 CompletionItem {
672 label: "m1", 660 label: "m1",
@@ -690,7 +678,6 @@ mod tests {
690 kind: Function, 678 kind: Function,
691 lookup: "main", 679 lookup: "main",
692 detail: "fn main()", 680 detail: "fn main()",
693 deprecated: false,
694 }, 681 },
695 ] 682 ]
696 "### 683 "###
@@ -721,7 +708,6 @@ mod tests {
721 insert: "foo!($0)", 708 insert: "foo!($0)",
722 kind: Macro, 709 kind: Macro,
723 detail: "macro_rules! foo", 710 detail: "macro_rules! foo",
724 deprecated: false,
725 }, 711 },
726 CompletionItem { 712 CompletionItem {
727 label: "foo()", 713 label: "foo()",
@@ -731,7 +717,6 @@ mod tests {
731 kind: Function, 717 kind: Function,
732 lookup: "foo", 718 lookup: "foo",
733 detail: "fn foo()", 719 detail: "fn foo()",
734 deprecated: false,
735 }, 720 },
736 ] 721 ]
737 "### 722 "###
@@ -762,7 +747,6 @@ mod tests {
762 insert: "foo!($0)", 747 insert: "foo!($0)",
763 kind: Macro, 748 kind: Macro,
764 detail: "macro_rules! foo", 749 detail: "macro_rules! foo",
765 deprecated: false,
766 }, 750 },
767 CompletionItem { 751 CompletionItem {
768 label: "main()", 752 label: "main()",
@@ -772,7 +756,6 @@ mod tests {
772 kind: Function, 756 kind: Function,
773 lookup: "main", 757 lookup: "main",
774 detail: "fn main()", 758 detail: "fn main()",
775 deprecated: false,
776 }, 759 },
777 ] 760 ]
778 "### 761 "###
@@ -803,7 +786,6 @@ mod tests {
803 insert: "foo!($0)", 786 insert: "foo!($0)",
804 kind: Macro, 787 kind: Macro,
805 detail: "macro_rules! foo", 788 detail: "macro_rules! foo",
806 deprecated: false,
807 }, 789 },
808 CompletionItem { 790 CompletionItem {
809 label: "main()", 791 label: "main()",
@@ -813,7 +795,6 @@ mod tests {
813 kind: Function, 795 kind: Function,
814 lookup: "main", 796 lookup: "main",
815 detail: "fn main()", 797 detail: "fn main()",
816 deprecated: false,
817 }, 798 },
818 ] 799 ]
819 "### 800 "###
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs
index 6753672ca..93f336370 100644
--- a/crates/ra_ide_api/src/completion/completion_item.rs
+++ b/crates/ra_ide_api/src/completion/completion_item.rs
@@ -46,7 +46,7 @@ pub struct CompletionItem {
46 documentation: Option<Documentation>, 46 documentation: Option<Documentation>,
47 47
48 /// Whether this item is marked as deprecated 48 /// Whether this item is marked as deprecated
49 deprecated: Option<bool>, 49 deprecated: bool,
50} 50}
51 51
52// We use custom debug for CompletionItem to make `insta`'s diffs more readable. 52// We use custom debug for CompletionItem to make `insta`'s diffs more readable.
@@ -73,8 +73,8 @@ impl fmt::Debug for CompletionItem {
73 if let Some(documentation) = self.documentation() { 73 if let Some(documentation) = self.documentation() {
74 s.field("documentation", &documentation); 74 s.field("documentation", &documentation);
75 } 75 }
76 if let Some(deprecated) = self.deprecated { 76 if self.deprecated {
77 s.field("deprecated", &deprecated); 77 s.field("deprecated", &true);
78 } 78 }
79 s.finish() 79 s.finish()
80 } 80 }
@@ -174,7 +174,7 @@ impl CompletionItem {
174 self.kind 174 self.kind
175 } 175 }
176 176
177 pub fn deprecated(&self) -> Option<bool> { 177 pub fn deprecated(&self) -> bool {
178 self.deprecated 178 self.deprecated
179 } 179 }
180} 180}
@@ -220,7 +220,7 @@ impl Builder {
220 lookup: self.lookup, 220 lookup: self.lookup,
221 kind: self.kind, 221 kind: self.kind,
222 completion_kind: self.completion_kind, 222 completion_kind: self.completion_kind,
223 deprecated: self.deprecated, 223 deprecated: self.deprecated.unwrap_or(false),
224 } 224 }
225 } 225 }
226 pub(crate) fn lookup_by(mut self, lookup: impl Into<String>) -> Builder { 226 pub(crate) fn lookup_by(mut self, lookup: impl Into<String>) -> Builder {
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs
index d98201887..cb55d1875 100644
--- a/crates/ra_ide_api/src/completion/presentation.rs
+++ b/crates/ra_ide_api/src/completion/presentation.rs
@@ -335,7 +335,6 @@ mod tests {
335 kind: Function, 335 kind: Function,
336 lookup: "main", 336 lookup: "main",
337 detail: "fn main()", 337 detail: "fn main()",
338 deprecated: false,
339 }, 338 },
340 CompletionItem { 339 CompletionItem {
341 label: "something_deprecated()", 340 label: "something_deprecated()",
@@ -382,7 +381,6 @@ mod tests {
382 kind: Function, 381 kind: Function,
383 lookup: "main", 382 lookup: "main",
384 detail: "fn main()", 383 detail: "fn main()",
385 deprecated: false,
386 }, 384 },
387 CompletionItem { 385 CompletionItem {
388 label: "no_args()", 386 label: "no_args()",
@@ -392,7 +390,6 @@ mod tests {
392 kind: Function, 390 kind: Function,
393 lookup: "no_args", 391 lookup: "no_args",
394 detail: "fn no_args()", 392 detail: "fn no_args()",
395 deprecated: false,
396 }, 393 },
397 ] 394 ]
398 "### 395 "###
@@ -414,7 +411,6 @@ mod tests {
414 kind: Function, 411 kind: Function,
415 lookup: "main", 412 lookup: "main",
416 detail: "fn main()", 413 detail: "fn main()",
417 deprecated: false,
418 }, 414 },
419 CompletionItem { 415 CompletionItem {
420 label: "with_args(…)", 416 label: "with_args(…)",
@@ -424,7 +420,6 @@ mod tests {
424 kind: Function, 420 kind: Function,
425 lookup: "with_args", 421 lookup: "with_args",
426 detail: "fn with_args(x: i32, y: String)", 422 detail: "fn with_args(x: i32, y: String)",
427 deprecated: false,
428 }, 423 },
429 ] 424 ]
430 "### 425 "###
@@ -451,7 +446,6 @@ mod tests {
451 kind: Method, 446 kind: Method,
452 lookup: "foo", 447 lookup: "foo",
453 detail: "fn foo(&self)", 448 detail: "fn foo(&self)",
454 deprecated: false,
455 }, 449 },
456 ] 450 ]
457 "### 451 "###
@@ -476,7 +470,6 @@ mod tests {
476 insert: "foo", 470 insert: "foo",
477 kind: Function, 471 kind: Function,
478 detail: "pub fn foo()", 472 detail: "pub fn foo()",
479 deprecated: false,
480 }, 473 },
481]"# 474]"#
482 ); 475 );
@@ -502,7 +495,6 @@ mod tests {
502 insert: "frobnicate", 495 insert: "frobnicate",
503 kind: Function, 496 kind: Function,
504 detail: "fn frobnicate()", 497 detail: "fn frobnicate()",
505 deprecated: false,
506 }, 498 },
507 CompletionItem { 499 CompletionItem {
508 label: "main", 500 label: "main",
@@ -511,7 +503,6 @@ mod tests {
511 insert: "main", 503 insert: "main",
512 kind: Function, 504 kind: Function,
513 detail: "fn main()", 505 detail: "fn main()",
514 deprecated: false,
515 }, 506 },
516]"# 507]"#
517 ); 508 );
@@ -534,7 +525,6 @@ mod tests {
534 insert: "new", 525 insert: "new",
535 kind: Function, 526 kind: Function,
536 detail: "fn new() -> Foo", 527 detail: "fn new() -> Foo",
537 deprecated: false,
538 }, 528 },
539]"# 529]"#
540 ); 530 );
@@ -568,7 +558,6 @@ mod tests {
568 kind: Function, 558 kind: Function,
569 lookup: "foo", 559 lookup: "foo",
570 detail: "fn foo(xs: Ve)", 560 detail: "fn foo(xs: Ve)",
571 deprecated: false,
572 }, 561 },
573 ] 562 ]
574 "### 563 "###
@@ -598,7 +587,6 @@ mod tests {
598 kind: Function, 587 kind: Function,
599 lookup: "foo", 588 lookup: "foo",
600 detail: "fn foo(xs: Ve)", 589 detail: "fn foo(xs: Ve)",
601 deprecated: false,
602 }, 590 },
603 ] 591 ]
604 "### 592 "###
@@ -627,7 +615,6 @@ mod tests {
627 kind: Function, 615 kind: Function,
628 lookup: "foo", 616 lookup: "foo",
629 detail: "fn foo(xs: Ve)", 617 detail: "fn foo(xs: Ve)",
630 deprecated: false,
631 }, 618 },
632 ] 619 ]
633 "### 620 "###
@@ -656,7 +643,6 @@ mod tests {
656 kind: Function, 643 kind: Function,
657 lookup: "foo", 644 lookup: "foo",
658 detail: "fn foo(xs: Ve<i128>)", 645 detail: "fn foo(xs: Ve<i128>)",
659 deprecated: false,
660 }, 646 },
661 ] 647 ]
662 "### 648 "###
@@ -687,7 +673,6 @@ mod tests {
687 insert: "frobnicate", 673 insert: "frobnicate",
688 kind: Macro, 674 kind: Macro,
689 detail: "#[macro_export]\nmacro_rules! frobnicate", 675 detail: "#[macro_export]\nmacro_rules! frobnicate",
690 deprecated: false,
691 }, 676 },
692 ] 677 ]
693 "### 678 "###