Commit Graph

25440 Commits

Author SHA1 Message Date
Lukas Wirth
76432d39cb Reformat VSCode client code 2023-05-02 10:48:38 -03:00
bruno-ortiz
364308d1dc removing unused function 2023-05-02 10:48:38 -03:00
bruno-ortiz
77a4bfd34f fixing linting problemas 2023-05-02 10:48:38 -03:00
bruno-ortiz
68aa20bb8a fixing stblib loading 2023-05-02 10:48:38 -03:00
bruno-ortiz
795a1cbe89 Creating rust dependencies tree view 2023-05-02 10:48:33 -03:00
bors
cffc402c05 Auto merge of #14716 - Veykril:trait-deps-query, r=Veykril
Don't merge trait_impls_in_deps results

Closes https://github.com/rust-lang/rust-analyzer/issues/9167

We effectively keep a lot of copies of `TraitImpl` results in memory by merging them into the result of this query. This wastes a lot of memory unnecessarily. The change here brings memory usage of self down by 50mb (at a slight cost of trait solving unfortunately, though I'm hopeful it was just noice)
2023-05-02 12:02:26 +00:00
Lukas Wirth
3fdff0ae4b Don't merge trait_impls_in_deps results 2023-05-02 14:00:18 +02:00
bors
94ac1cdbf5 Auto merge of #14715 - Veykril:symbol-index, r=Veykril
Refactor symbol index

Closes https://github.com/rust-lang/rust-analyzer/issues/14677

instead of eagerly fetching the source data in symbol index we do it lazily now, this shouldn't make it much more expensive as we had to parse the source most of the time anyways even after fetching.
2023-05-02 10:34:53 +00:00
Lukas Wirth
f501c6a516 Refactor symbol index 2023-05-02 12:11:42 +02:00
bors
86b14c2458 Auto merge of #14705 - HKalbasi:mir, r=lnicola
Fix some mir related bugs

fix #14701
fix #14704
2023-05-02 09:29:46 +00:00
hkalbasi
38544f56ab Catch overflow in shift binop evaluation 2023-05-02 12:57:34 +03:30
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
Ralf Jung
3a75e19258 Merge from rustc 2023-04-30 22:35:29 +02: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
Ralf Jung
77cdbe653e Merge from rustc 2023-04-28 15:49:39 +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
Matthias Krüger
e99a9904aa Rollup merge of #110766 - m-ou-se:fmt-rt, r=jyn514
More core::fmt::rt cleanup.

- Removes the `V1` suffix from the `Argument` and `Flag` types.

- Moves more of the format_args lang items into the `core::fmt::rt` module. (The only remaining lang item in `core::fmt` is `Arguments` itself, which is a public type.)

Part of https://github.com/rust-lang/rust/issues/99012

Follow-up to https://github.com/rust-lang/rust/pull/110616
2023-04-28 07:34:02 +02: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