Commit graph

23094 commits

Author SHA1 Message Date
Kartavya Vashishtha cc7200891b
new lint: move_format_string_arg
The name might need some improving.

extract format_like's parser to it's own module in ide-db

reworked the parser's API to be more direct

added assist to extract expressions in format args
2022-09-10 20:13:46 +05:30
Kartavya Vashishtha 2584d48508
wip 2022-09-10 20:13:46 +05:30
Lukas Wirth 9c97997af9 Remove the toggleInlayHints command from VSCode
Inlay hints are no longer something specifc to r-a as it has been
upstreamed into the LSP, we don't have a reason to give the config
for this feature special treatment in regards to toggling. There are
plenty of other options out there in the VSCode marketplace to create
toggle commands/hotkeys for configurations in general which I believe
we should nudge people towards instead.
2022-09-10 11:50:55 +02:00
Spencer Sharkey 54fe5b7fc2 use ubuntu 18.04 container for release 2022-09-09 21:23:02 -07:00
Lukas Wirth 7d19971666 Add config to unconditionally prefer core imports over std
Fixes https://github.com/rust-lang/rust-analyzer/issues/12979
2022-09-09 20:04:56 +02:00
Stanislav f7f4792f4f fixes 2022-09-09 20:58:06 +03:00
bors b7e8b9a6b8 Auto merge of #13207 - randomicon00:semicol#13196, r=lnicola
fix: add semicolon completion to mod

fixes #13196

`@Veykril` The tests are passing. I added one specifically for this case.
2022-09-09 04:15:20 +00:00
Stanislav 773f9b38e3 fix. round 4 2022-09-09 01:19:34 +03:00
Peh bd3feea8bc fix: removed swap file 2022-09-08 22:44:10 +01:00
Peh c7fefd5223 fix: add semicolon completion to mod 2022-09-08 22:37:31 +01:00
Stanislav ab0b64b26c fix comment round 3 2022-09-08 22:55:04 +03:00
Stanislav 0240294759 fix comment round 2 2022-09-08 22:47:39 +03:00
Stanislav 1764c42518 fix comment 2022-09-08 22:36:36 +03:00
bors 4e1a3da8f2 Auto merge of #13158 - jonas-schievink:inlayhint-links, r=jonas-schievink
feat: make clicking a closing brace inlay hint go to the opening brace
2022-09-08 16:38:40 +00:00
Jonas Schievink c4eadab016
Update crates/rust-analyzer/src/to_proto.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-09-08 18:33:53 +02:00
Jonas Schievink 064c9ef9e2 Make clicking closing brace hint go to the opening brace 2022-09-08 17:25:28 +02:00
Stanislav 9f6553e1d6 add config for import filtering 2022-09-08 01:53:20 +03:00
bors 6909556435 Auto merge of #13200 - P1n3appl3:sysroot, r=Veykril
Use proc-macro-srv from sysroot in rust-project.json workspaces

This was discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/.60sysroot.60.20vs.20.60sysroot_src.60.20for.20.60rust-project.2Ejson.60.3F/near/293023920), basically in `rust-project.json` workspaces RA doesn't respect the `sysroot` setting when picking which `proc-macro-srv` to launch, and this causes abi mismatches in practice.

This is the simple fix that `@Veykril` suggested, and I've verified that it works on Fuchsia by inspecting the cmdline with `pgrep rust-analyzer | xargs ps -fp` to check that it's using the `proc-macro-srv` from our prebuilts which matches the `sysroot` specified in our `rust-project.json`.

Can this be merged as is, or do we need to add tests that exercise this?
2022-09-07 09:36:03 +00:00
Joseph Ryan 5d126a18b4 Use proc-macro-srv from sysroot in rust-project.json 2022-09-06 18:27:17 -07:00
Stanislav eba54c2fc9 pretty solition works 2022-09-07 04:09:25 +03:00
Stanislav 92d54f9b30 typo and draft 2022-09-07 03:24:55 +03:00
Stanislav bd0eeb3f04
Update crates/ide/src/references.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-09-07 03:01:06 +03:00
bors 6dfd8aebdf Auto merge of #13192 - lowr:fix/dyn-sort-all-bounds, r=Veykril
fix: sort all bounds on trait object types

Fixes #13181

#12793 allowed different ordering of trait bounds in trait object types but failed to account for the ordering of projection bounds. I opted for sorting all the bounds at once rather than splitting them into `SmallVec`s so it's easier to do the same thing for other bounds when we have them.
2022-09-05 11:24:54 +00:00
bors 5be2e6574d Auto merge of #13185 - ChayimFriedman2:insert-ws-in-static-const-macro, r=Veykril
fix: Insert whitespaces into static & const bodies if they are expanded from macro on hover

Partially fixes #13143.

To resolve the other part we need to expand macros in unevaluated static & const bodies, and I'm not sure we want to. If for example it includes a call to `assert!()`, expanding it will lead to worse hover.
2022-09-05 11:10:40 +00:00
bors 4790916876 Auto merge of #13139 - Austaras:enum, r=Veykril
Suggest struct when completing enum

closes #13107
2022-09-05 10:59:38 +00:00
bors a1c26530ec Auto merge of #13091 - ice1k:hey, r=Veykril
Remove type alias definition on inline

Fix #13079
2022-09-05 10:49:19 +00:00
Ryo Yoshida 265c75c53f
fix: sort all bounds on trait object types 2022-09-05 19:13:32 +09:00
austaras 748567cba5 complete full struct in enum varaint 2022-09-05 03:36:14 +08:00
bors 67920f7975 Auto merge of #13187 - matklad:return, r=Veykril
fix: correct broken logic for return complition

It seems that we've accidentally deleted the tests here couple of years
ago, and then fairly recently made a typo during refactor as well.

Reinstall tests, with coverage marks this time :-)
2022-09-04 18:25:55 +00:00
Aleksey Kladov d7ef3f51ec fix: correct broken logic for return complition
It seems that we've accidentally deleted the tests here couple of years
ago, and then fairly recently made a typo during refactor as well.

Reinstall tests, with coverage marks this time :-)
2022-09-04 18:12:55 +01:00
Stanislav 6001e7dfb1 fix 2022-09-04 19:45:50 +03:00
Stanislav ba40aa72ac
Update crates/ide/src/references.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2022-09-04 19:41:06 +03:00
Stanislav 29729abc3c Retain imports on find-all-references 2022-09-04 19:14:52 +03:00
Chayim Refael Friedman 26b5f1f92f Do not insert a newline after ; if the next token is a }
This creates double newline.
2022-09-04 14:33:15 +00:00
Chayim Refael Friedman e295f0c29c Insert whitespaces into static & const bodies if they are expanded from macro on hover
Macro expansion erases whitespace information, and so we end with invalid Rust code.
2022-09-04 14:33:15 +00:00
bors 8ddb8b7e8e Auto merge of #13183 - Veykril:break-break, r=Veykril
Fix nested break expressions, expecting unknown types
2022-09-03 15:33:21 +00:00
Lukas Wirth 020f6895e5 Fix nested break expressions, expecting unknown types 2022-09-03 17:32:21 +02:00
ice1000 364d9c4910 Fmt 2022-09-02 21:18:36 +00:00
ice1000 68eabf1bf1 Fix test 2022-09-02 21:18:36 +00:00
ice1000 a695e900f6 Create trait Removable, replace ted APIs with builder APIs 2022-09-02 21:18:36 +00:00
ice1000 37e20decad Address comments 2022-09-02 21:18:36 +00:00
ice1000 277df02ff5 This should work, but I got mysterious errors 2022-09-02 21:18:36 +00:00
ice1000 79e5c366cd Extract shared logic 2022-09-02 21:18:36 +00:00
ice1000 fcc61337a8 Remove alias definition naively 2022-09-02 21:18:36 +00:00
bors afa374e58e Auto merge of #13175 - Veykril:resolver, r=Veykril
Clarify the state of (extern) preludes for block def maps
2022-09-02 17:38:26 +00:00
Lukas Wirth 894aa0ed0d Clarify the state of (extern) preludes for block def maps 2022-09-02 17:43:20 +02:00
bors f27f98d4bb Auto merge of #13174 - Veykril:resolver, r=Veykril
Lift out the module scope into a field in the Resolver

A Resolver *always* has a module scope at the end of its scope stack,
instead of encoding this as an invariant we can just lift this scope
out into a field, allowing us to skip going through the scope vec
indirection entirely.
2022-09-02 15:03:29 +00:00
Lukas Wirth 8828049b23 Lift out the module scope into a field in the Resolver
A Resolver *always* has a module scope at the end of its scope stack,
instead of encoding this as an invariant we can just lift this scope
out into a field, allowing us to skip going through the scope vec
indirection entirely.
2022-09-02 17:02:12 +02:00
bors 2bb6635a85 Auto merge of #13173 - Veykril:synthetic, r=Veykril
Don't store SyntheticSyntax in the reverse maps in BodySourceMap

They are ZSTs which we can just create on missing access instead.
2022-09-02 13:17:16 +00:00
Lukas Wirth fe0a106256 Don't store SyntheticSyntax in the reverse maps in BodySourceMap
They are ZSTs which we can just create on missing access instead.
2022-09-02 15:08:48 +02:00