Commit graph

24966 commits

Author SHA1 Message Date
bors
466b4ec547 Auto merge of #14714 - jhgg:hover/exclude-sized-trait-in-goto-actions, r=Veykril
fix: ide: exclude sized in go-to actions in hover

fixes #13163

i opted to just simply omit `Sized` entirely from go-to actions, as opposed to including it if even someone writes an explicit `T: Sized`, as i think a go-to on Sized is of dubious value practically.
2023-05-02 08:30:17 +00:00
Jake Heinz
3132a9e7fc fix: ide: exclude sized in go-to actions 2023-05-02 08:19:59 +00:00
hkalbasi
266ceb7b4d Fix floating point binop evaluation 2023-05-02 11:48:04 +03:30
bors
7d48bbadd4 Auto merge of #14713 - jhgg:fix/do-not-highlight-escapes-in-raw-strings, r=Veykril
fix: ide: do not highlight escapes in raw strings

fixes #14688
2023-05-02 07:39:02 +00:00
bors
1ad58a42aa Auto merge of #14711 - Veykril:highlight-captures, r=Veykril
feat: Highlight closure captures when cursor is on pipe or move keyword

This runs into the same issue on vscode as exit points for `->`, where highlights are only triggered on identifiers, https://github.com/rust-lang/rust-analyzer/issues/9395

Though putting the cursor on `move` should at least work.
2023-05-02 07:22:43 +00:00
Jake Heinz
157069e232 fix: ide: do not highlight escapes in raw strings 2023-05-02 07:16:25 +00:00
Lukas Wirth
5a97a326a9 Simplify 2023-05-02 09:05:28 +02:00
Lukas Wirth
8907533536 Highlight defs in highlight related 2023-05-02 08:59:43 +02:00
Lukas Wirth
a64626d99e Highlight closure captures when cursor is on pipe 2023-05-02 08:59:40 +02:00
bors
98e76bd90f Auto merge of #14710 - jhgg:chore/refactor-notification-handlers, r=Veykril
chore: rust-analyzer: refactor notification handlers

Fixes the FIXME in `on_notification`.

```rust
// FIXME: Move these implementations out into a module similar to on_request
```

No code has changed, this just moves stuff around.
2023-05-02 06:59:27 +00:00
Jake Heinz
b9007a26a0 add module docs 2023-05-02 06:48:29 +00:00
Jake Heinz
f4d2044528 rust-analyzer: refactor notification handlers 2023-05-02 06:28:26 +00:00
bors
9c0c13ec8e Auto merge of #14707 - jhgg:fix/generate-delegate-method-filtering, r=lnicola
fix: generate delegate methods filters out functions that already exist on the struct's impls

fixes #14703
2023-05-02 05:38:23 +00:00
Jake Heinz
a86c431f45 fix: generate delegate methods filters out functions that already exist
on the struct's impls
2023-05-02 03:36:35 +00:00
hkalbasi
3a3c3630a2 fix break-outside-of-loop false positive in try block 2023-05-02 03:11:56 +03:30
bors
2fdd1ac510 Auto merge of #14664 - HKalbasi:mir, r=HKalbasi
MIR episode 4

In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet).

In evaluating, it now can evaluate associated constants in traits (so now typenum's `U5::ToConst` should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in #14275. I also added a `Interpret` code lens to `Run` and `Debug` when the experimental `interpret tests` is enabled (previously it showed result in hover, which was unusable even for debugging)

Changes in unrelated files are:
* Changes substitutions of closures, now it includes parent substs ~~before~~ after `sig_ty`.
* ~~A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.~~
* Normalizing associated types in layout computing
2023-05-01 20:48:50 +00:00
hkalbasi
6312fbf521 MIR episode 4 2023-05-01 23:23:10 +03:30
bors
001607fdb4 Auto merge of #14697 - cuishuang:master, r=lnicola
fix some typos
2023-05-01 07:14:16 +00:00
cui fliter
41632fac86 fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-01 14:53:25 +08:00
bors
3a27518fee Auto merge of #14690 - HKalbasi:closure-hover, r=HKalbasi
Add hover for closure
2023-04-30 20:35:15 +00:00
hkalbasi
5df545b3f0 Add hover for closure 2023-04-30 14:31:43 +03:30
bors
7bcb4c2ef2 Auto merge of #14689 - Veykril:patch-vscode-paths, r=Veykril
fix: Force InitializeParams windows path drives to uppercase

Should fix https://github.com/rust-lang/rust-analyzer/issues/14683
cc `@jyn514`
2023-04-29 18:14:42 +00:00
Lukas Wirth
1edcefb685 fix: Force InitializeParams windows path drives to uppercase 2023-04-29 20:14:17 +02:00
bors
83cc5ef4c1 Auto merge of #14686 - matklad:matklad/angry-chain, r=Veykril
fix: don't wavy-underline iterator chains
2023-04-29 16:35:37 +00:00
Aleksey Kladov
f3de9d8f54 fix: don't wavy-underline iterator chains 2023-04-29 17:31:53 +01:00
bors
07e535b6df Auto merge of #14682 - wackbyte:grammar, r=lnicola
fix grammar
2023-04-29 06:29:11 +00:00
wackbyte
01c59812ae
fix grammar 2023-04-28 23:04:08 -04:00
bors
370b72c7dd Auto merge of #14678 - Veykril:restart-server, r=Veykril
fix: Fix restart server button trying to start instead of restart the server
2023-04-28 19:35:05 +00:00
Lukas Wirth
cf8f13b531 fix: Fix restart server button trying to start instead of restart the server 2023-04-28 21:34:31 +02:00
bors
3ad835faa9 Auto merge of #14671 - Veykril:proc-macro-srv-conf, r=Veykril
fix: Fix proc-macro-srv path config not working
2023-04-28 19:18:14 +00:00
Lukas Wirth
3b97978c49 fix: Fix proc-macro-srv path config not working 2023-04-28 21:17:18 +02:00
bors
62c81d6293 Auto merge of #14672 - whentojump:patch-1, r=lnicola
minor: fix typos
2023-04-28 10:58:13 +00:00
wtj
c533ac3573 minor: fix typos 2023-04-28 18:49:05 +08:00
bors
237ffa3997 Auto merge of #14667 - unexge:nested-types-in-unwrap-result-type, r=HKalbasi
Handle nested types in `unwrap_result_return_type` assist

Fixes https://github.com/rust-lang/rust-analyzer/issues/14496
2023-04-27 06:38:36 +00:00
unexge
a2ab7ee3bd Address code review comments 2023-04-27 03:03:13 +01:00
unexge
734fe66f71 Handle nested types in unwrap_result_return_type assist 2023-04-26 22:07:06 +01:00
bors
797c2f1dde Auto merge of #14659 - Veykril:dedup-crates, r=Veykril
Deduplicate crates when extending crate graphs

This is quadratic in runtime per deduplication attempt, but I don't think that'll be a problem for the workload here. Don't be scared of the diff, the actual diff is +42 -22, the rest is tests and test data.
Fixes https://github.com/rust-lang/rust-analyzer/issues/14476
2023-04-26 09:44:27 +00:00
Lukas Wirth
968850d7bf Deduplicate crates when extending crate graphs 2023-04-26 11:44:11 +02:00
bors
e68e47ffd8 Auto merge of #14658 - Veykril:proc-macro-ra-srv, r=Veykril
Remove proc-macro server command from the rust-analyzer binary

We dropped support for concrete proc-macro abi versions so this no longer serves any purposes.
2023-04-26 08:20:36 +00:00
Lukas Wirth
c21860bd6a Remove proc-macro server command from the rust-analyzer binary 2023-04-26 08:19:28 +02:00
bors
943d2a8a1c Auto merge of #14642 - jakhh8:master, r=Veykril
minor: Use `CargoConfig.extra_args` for fetching metadata

Fixes #14510
2023-04-25 12:46:29 +00:00
bors
59fcd00447 Auto merge of #14657 - rust-lang:revert-14475-crate-origins, r=Veykril
Revert "Handle dev-dependency cycles"

Reverts rust-lang/rust-analyzer#14475

I managed to fix the problem that causes the metric failures, but this still severely degrades IDE features in a way that makes the user experience ***worse*** than before. I am not sure how to address this, I wonder what the jetbrains plugin is doing in these cases.
2023-04-25 12:30:51 +00:00
Lukas Wirth
10d7d7304b
Revert "Handle dev-dependency cycles" 2023-04-25 14:29:26 +02:00
bors
a96bb452a7 Auto merge of #14475 - Veykril:crate-origins, r=Veykril
Handle dev-dependency cycles

cc https://github.com/rust-lang/rust-analyzer/issues/14167

This should fix cycles errors mostly (it fixes the one on rome/tools at least, but not on rustc. Though  there it might just be because of rustc workspace being rustc workspace). Unfortunately this will effectively duplicate all crates currently, since if we want to be completely correct we'd need to set the test cfg for all dev dependencies and the transitive dependencies of those, something I worry we should try to avoid.
2023-04-25 10:07:25 +00:00
Lukas Wirth
e205af259d Prefer test duped crates for ide features 2023-04-25 11:39:58 +02:00
bors
e46d7a030f Auto merge of #14651 - Veykril:workspace-vscode-fix, r=Veykril
fix: Fix vscode workspaces not working properly

Fixes https://github.com/rust-lang/rust-analyzer/issues/14571
2023-04-25 09:09:31 +00:00
Lukas Wirth
a4c7a87755 Handle dev-dependency cycles 2023-04-25 10:57:25 +02:00
Lukas Wirth
980c75bc91 Add more complex project-model test 2023-04-25 10:49:48 +02:00
Lukas Wirth
49fcd4edda fix: Fix vscode workspaces not working properly 2023-04-25 10:47:33 +02:00
bors
6f10ddc122 Auto merge of #14654 - Veykril:status-fix, r=Veykril
fix: Fix status command panicking when additional LRU caches are set up
2023-04-25 08:42:25 +00:00