Commit Graph

19170 Commits

Author SHA1 Message Date
Lukas Wirth
00303c3b67 Abstract over ItemTreeLoc 2024-02-10 11:37:59 +01:00
Lukas Wirth
2ebf0c87c2 Deduplicate some code 2024-02-10 01:51:22 +01:00
Tetsuharu Ohzeki
c6637f39c0 clippy: Enable borrowed_box rule 2024-02-10 00:14:17 +09:00
Tetsuharu Ohzeki
d45cabd029 clippy: Enable derived_hash_with_manual_eq rule 2024-02-10 00:14:17 +09:00
Tetsuharu Ohzeki
adddd14afb ide: Fix cargo test -p ide --doc 2024-02-10 00:14:17 +09:00
Tetsuharu Ohzeki
a3e60e7f7a clippy: Enable needless_doctest_main rule 2024-02-10 00:14:17 +09:00
Tetsuharu Ohzeki
3365e50180 clippy: Enable forget_non_drop rule 2024-02-09 23:10:43 +09:00
bors
cdc3e83c2c Auto merge of #16518 - tetsuharuohzeki:enable-some-minor-lints, r=Veykril
Enable some minor lints that we should tackles

This enables these lint rules that are commented as we should tackle at some points.

- non_canonical_clone_impl
- non_canonical_partial_ord_impl
- self_named_constructors
2024-02-09 13:54:36 +00:00
bors
65a644190d Auto merge of #16424 - dfireBird:let-stmt-guarded-return-assist, r=Veykril
implement convert to guarded return assist for `let` statement with type that implements `std::ops::Try`

I've tried to implement the assist that #16390 talked about

If there are any improvements that I can make in implementation, please suggest them.

![Peek 2024-02-05 19-01](https://github.com/rust-lang/rust-analyzer/assets/40687700/d6af3222-4f23-4ade-a930-8a78cc75e821)
2024-02-09 13:42:20 +00:00
Tetsuharu Ohzeki
2601d19bac clippy: Enable non_canonical_clone_impl rule 2024-02-09 22:37:42 +09:00
Tetsuharu Ohzeki
7669619f9a clippy: Enable self_named_constructors rule 2024-02-09 22:31:21 +09:00
David Barsky
2d09d69fbe internal: fix crash inside filter_unnecessary_bounds for a missing generic param 2024-02-08 20:58:48 -05:00
DropDemBits
05b8ccc378
Fix clippy lints 2024-02-08 19:39:04 -05:00
DropDemBits
1161082051
Remove unused code in utils
All usages of `render_snippet` and `Cursor` have been removed as part of the migration
2024-02-08 19:13:10 -05:00
DropDemBits
8eebf1701b
Migrate replace_derive_with_manual_impl to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
18ea09feca
Migrate generate_new to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
e28f5514e1
Add AssocItemList::add_item_at_start
Needed to recreate the behavior of `generate_new` addding the `new` method at the start of the impl
2024-02-08 19:13:10 -05:00
DropDemBits
e0117154cf
Migrate generate_impl to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
ab2233e562
Migrate generate_getter_or_setter to mutable ast 2024-02-08 19:13:09 -05:00
DropDemBits
f1293a8fc4
Add newline to body when where clause is present 2024-02-08 19:13:09 -05:00
DropDemBits
0519414c19
Make ReferenceConversion methods return ast types 2024-02-08 19:13:09 -05:00
DropDemBits
039b3d0abb
Add make::ext::expr_self
Shortcut version of `make::expr_path(make::path_unqualified(make::path_segment_self()))`
2024-02-08 19:09:33 -05:00
DropDemBits
0e39257e5b
Migrate extract_function to mutable ast 2024-02-08 19:09:33 -05:00
DropDemBits
3924a0ef7c
Add ast versions of generate{_trait}_impl_text{_intransitive} 2024-02-08 19:09:33 -05:00
DropDemBits
8c0661b2de
Use GenericArgList for make::impl{_trait}
`make::impl_` no longer merges generic params and args in order to be in line
with `make::impl_`, which doesn't do it either.
2024-02-08 19:09:32 -05:00
bors
13707845f7 Auto merge of #15863 - davidbarsky:davidbarsky/start-of-monorepo-mode, r=Veykril
feature: Create `UnindexedProject` notification to be sent to the client

(Note that this branch contains commits from https://github.com/rust-lang/rust-analyzer/pull/15830, which I'll rebase atop of as needed.)

Based on the discussion in https://github.com/rust-lang/rust-analyzer/issues/15837, I've added a notification and off-by-default toggle to send that notification from `handle_did_open_text_document`. I'm happy to rename/tweak this as needed.

I've been using this for a little bit, and it does seem to cause a little bit more indexing/work in rust-analyzer, but it's something that I'll profile as needed, I think.
2024-02-08 19:36:09 +00:00
David Barsky
6330b028b3 feature: Add a UnindexedProject notification and a corresponding setting. 2024-02-08 14:23:00 -05:00
davidsemakula
602acfcb70 fix conflicting "unnecessary else" and "trailing return" diagnostics tests 2024-02-08 19:32:53 +03:00
davidsemakula
a250c2dde0 refactor remove trailing return diagnostic 2024-02-08 19:32:53 +03:00
davidsemakula
98e6f43a2f remove trailing return in trailing match expression 2024-02-08 19:32:53 +03:00
davidsemakula
cad222ff1b remove trailing return in trailing if expression 2024-02-08 19:32:53 +03:00
davidsemakula
2987fac76f diagnostic to remove trailing return 2024-02-08 19:32:53 +03:00
bors
e07183461f Auto merge of #16487 - ShoyuVanilla:deref-generate-getter, r=Veykril
Remove unnecessary `.as_ref()` in generate getter assist

Resolves #12389
2024-02-08 15:15:52 +00:00
bors
5812b693c3 Auto merge of #16484 - Austaras:master, r=Veykril
fix: preserve where clause when builtin derive

Closes #16432.
2024-02-08 15:03:55 +00:00
austaras
dad0fdb13f fix: preserve where clause when builtin derive 2024-02-08 22:44:39 +08:00
bors
0e5766b0d8 Auto merge of #16477 - davidsemakula:trait-incorrect-case-diagnostic, r=Veykril
feat: Add incorrect case diagnostics for traits and their associated items

Updates incorrect case diagnostic to:
- Check traits and their associated items
- Ignore trait implementations except for patterns in associated function bodies

Also cleans up `hir-ty::diagnostics::decl_check` a bit (mostly to make it a bit more DRY and easier to maintain)

Also fixes: #8675 and fixes: #8225
2024-02-08 14:40:16 +00:00
bors
e9d3565cd1 Auto merge of #16502 - davidsemakula:unnecessary-else-diagnostic, r=Veykril
feat: Add "unnecessary else" diagnostic and fix

Fixes #9457
2024-02-08 14:25:00 +00:00
bors
82674e21be Auto merge of #16454 - Veykril:break-return-postfix, r=Veykril
feat: Add break and return postfix keyword completions
2024-02-08 14:09:04 +00:00
Lukas Wirth
ddddc9c0e2 Update test outputs 2024-02-08 14:57:21 +01:00
Lukas Wirth
15bffe25bd feat: Add break and return postfix keyword completions 2024-02-08 14:56:10 +01:00
Lukas Wirth
545382db25 Fix warnings 2024-02-08 14:54:52 +01:00
Lukas Wirth
91dab4d720 Better error message for when proc-macros have not yet been built 2024-02-08 14:53:12 +01:00
Lukas Wirth
4bf6b160a9 Fix incorrect range uses in missing_fields quick fixes 2024-02-08 14:53:11 +01:00
bors
5c80ad05ae Auto merge of #16124 - ohno418:call-expr-missing-arg, r=Veykril
fix: Recover from missing argument in call expressions

Previously, when parsing an argument list with a missing argument (e.g., `(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected token (at the second comma in the example), resulting in an incorrect parse tree.

This commit improves error handling in such cases, ensuring a more accurate parse tree is built.

---

Fixes https://github.com/rust-lang/rust-analyzer/issues/15683.
2024-02-08 10:16:36 +00:00
Lukas Wirth
974e69b0c5 Recover from missing slots in delimited parsing 2024-02-08 11:14:37 +01:00
Yutaro Ohno
e865d45904 fix: Recover from missing argument in call expressions
Previously, when parsing an argument list with a missing argument (e.g.,
`(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected
token (at the second comma in the example), resulting in an incorrect
parse tree.

This commit improves error handling in such cases, ensuring a more
accurate parse tree is built.
2024-02-08 10:54:04 +01:00
Lukas Wirth
0258f60cfe feat: Allow cargo check to run on only the current package 2024-02-08 10:40:42 +01:00
Lukas Wirth
81ea48a573 fix: Fix tuple structs not rendering visibility in their fields 2024-02-08 10:05:28 +01:00
clubby789
79e4111442 Remove ffi_returns_twice references 2024-02-07 19:42:07 +00:00
Lukas Wirth
97cd68097a Optimize input queries that take no arguments 2024-02-07 18:04:02 +01:00