Commit Graph

18749 Commits

Author SHA1 Message Date
bors[bot]
b07c83f8b0
Merge #9810
9810: Add reference here r=matklad a=ivan770

Superseds #6853 

Co-authored-by: ivan770 <ivan@ivan770.me>
2021-08-08 10:35:00 +00:00
ivan770
be3e70c604
Add reference here diagnostic 2021-08-08 10:12:40 +02:00
Lukas Wirth
50d46863ef Look for enum variants and trait assoc functions when looking for lang items 2021-08-07 22:30:13 +02:00
bors[bot]
6ea07fc26f
Merge #9809
9809: internal: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-07 20:16:58 +00:00
Lukas Wirth
c4a119f433 Simplify 2021-08-07 22:16:15 +02:00
Dawer
14898729f4 Account sized bounds in parentheses printing inside of ptr/ref of rpit. 2021-08-08 00:54:38 +05:00
bors[bot]
c5bde08f6e
Merge #9806
9806: Add proc_macro crate for the 1.56 ABI r=lnicola a=alexjg

I've copied the latest proc macro source from Rust nightly and modified it to compile on `stable`. This fixes #9795 . Almost everything here is uninteresting copy and paste, the interesting stuff is in `crates/proc_macro_srv/src/abis/mod.rs`. I've left the 1.55 ABI implementation in for now. We did discuss only supporting one nightly ABI so we may want to remove 1.55. That will break code which is pinned to older nightly releases but that seems acceptable to me, what do people think?

Co-authored-by: Alex Good <alex@memoryandthought.me>
2021-08-07 15:42:26 +00:00
Alex Good
b111357b54
Copy the proc_macro crate for the 1.56 ABI 2021-08-07 16:34:59 +01:00
bors[bot]
a9f115b36f
Merge #9805
9805: internal: Upgrade Chalk r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-08-07 11:32:08 +00:00
Florian Diebold
16ab75a83a Upgrade Chalk 2021-08-07 13:12:35 +02:00
bors[bot]
b8800fd85d
Merge #9801
9801: fix: Don't publish diagnostics in crates.io or sysroot files r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9766

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-08-06 14:16:24 +00:00
Jonas Schievink
a310d74536 Don't publish diagnostics in library source roots 2021-08-06 16:14:54 +02:00
bors[bot]
40e9c97d61
Merge #9800
9800: feat: Include suggested replacement in diagnostics r=jonas-schievink a=jonas-schievink

rustc renders the diagnostic text for suggestions by including the suggested replacement at the end (`` help: a function with a similar name exists: `boo` ``), but the emitted JSON diagnostic does not include this in the message. This causes our diagnostics to lack some useful info, so this PR fixes that by appending any suggested replacements to the message.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9797

Before:
![screenshot-2021-08-06-15:54:19](https://user-images.githubusercontent.com/1786438/128521003-105a43a3-e386-4afc-9d5c-7806631f53d7.png)

After:
![screenshot-2021-08-06-15:53:16](https://user-images.githubusercontent.com/1786438/128521022-c16e0967-6cc6-410d-917d-5db5cfbb96be.png)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-08-06 14:00:29 +00:00
Jonas Schievink
5386dc648e Bless tests 2021-08-06 15:59:58 +02:00
Jonas Schievink
30e472a12a Don't include empty suggestions 2021-08-06 15:58:55 +02:00
Jonas Schievink
efe662d474 Include suggested replacement in diagnostics 2021-08-06 15:52:47 +02:00
bors[bot]
85d80df889
Merge #9794
9794: Fix binders with bare dyn trait r=flodiebold a=flodiebold

Fixes #9639.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-08-05 20:45:49 +00:00
Florian Diebold
ac4f3e61f8 Fix binders with bare dyn trait
Fixes #9639.
2021-08-05 22:44:38 +02:00
bors[bot]
a16b06afa7
Merge #9793
9793: Remove unused structs in ide_db r=matklad a=michalmuskala



Co-authored-by: Michał Muskała <michal@muskala.eu>
2021-08-05 17:56:19 +00:00
bors[bot]
a7178cabf5
Merge #9785
9785: feature: Add completion for struct literals in which all fields are visible. r=Veykril a=Afourcat

This PR adds a new completion for struct literal.

It Implements the feature discussed in the issue #9610.

![RAExample3](https://user-images.githubusercontent.com/35599359/128211142-116361e9-7a69-425f-83ea-473c6ea47b26.gif)

This PR introduce a repetition in the source files `crates/ide_completion/render/pattern.rs` and `crates/ide_completion/render/struct_literal.rs` that may be fix in another PR.

Co-authored-by: Alexandre Fourcat <afourcat@gmail.com>
2021-08-05 16:17:38 +00:00
Michał Muskała
33c7c23b03 Remove unused structs in ide_db 2021-08-05 12:04:37 +01:00
bors[bot]
80f522091a
Merge #9790
9790: fix: extract_type_alias extracts generics correctly r=Veykril a=Veykril

Fixes #8335
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-05 00:54:49 +00:00
Lukas Wirth
b6d574642d extract_type_alias extracts generics correctly 2021-08-05 02:54:06 +02:00
bors[bot]
950efff5c6
Merge #9780
9780: Support exclusive_range_pattern r=matklad a=lf-

Fix #9779

Co-authored-by: Jade <software@lfcode.ca>
2021-08-04 18:12:37 +00:00
bors[bot]
ec753847bd
Merge #9788
9788: fix: extract_function does not move locals defined outside of loops r=Veykril a=Veykril

Fixes #8234

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-04 18:03:41 +00:00
Lukas Wirth
01413dd7d4 extract_function does not move locals defined outside of loops 2021-08-04 20:00:45 +02:00
Lukas Wirth
f55441f7ed Document reference highlighting mod 2021-08-04 19:00:52 +02:00
Alexandre Fourcat
9beefef8f9
Add completion for struct literal in which all fields are visible.
Fix ide_completion tests.

Move 'complete_record_literal' call to the main completion function.

Fix a rendering bug when snippet not available.

Checks if an expression is expected before adding completion for struct literal.

Move 'completion struct literal with private field' test to 'expressions.rs' test file.

Update 'expect' tests with new check in 'complete record literal'.
2021-08-04 18:52:58 +02:00
bors[bot]
294cfd61c7
Merge #9786
9786: fix: Fix detection of macro file in inactive-code diag r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9753

`HirFileId::expansion_info` can return `None` for builtin macros or if there's an error in the macro call or definition, so add a `HirFileId::is_macro` method that checks the right thing.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-08-04 16:04:35 +00:00
Jonas Schievink
260936d0b7 Fix detection of macro file in inactive-code diag 2021-08-04 18:02:45 +02:00
Dawer
d9ec88ea23 Adjust fn_hints test 2021-08-04 20:26:51 +05:00
Dawer
98ae530f2a Fix missing ?Sized bounds in tests. 2021-08-04 20:24:52 +05:00
Dawer
0f6621fbfa Fix tests. 2021-08-04 20:20:14 +05:00
Dawer
5f2486e9a8 Handle impl ?Sized. Fix tests. 2021-08-04 20:20:10 +05:00
Dawer
421979bc68 HirDisplay prints ?Sized bounds now; impl Trait: Sized by default. 2021-08-04 20:05:46 +05:00
Dawer
d9e6377b91 adjust hir_def::TypeBound::as_path 2021-08-04 19:49:19 +05:00
Dawer
b217e9cc50 add implicit Sized bound to associated types 2021-08-04 19:41:05 +05:00
Dawer
8f2a040d10 add implicit sized to impl Trait parameters 2021-08-04 19:40:57 +05:00
Dawer
72002b401d internal: allow ambiguous unsize coercion. 2021-08-04 19:15:23 +05:00
Dawer
3981373b93 internal: add implicit Sized bounds to type parameters. 2021-08-04 19:04:21 +05:00
Jade
775670e32c Split the test 2021-08-04 03:01:48 -07:00
bors[bot]
1b02cafa43
Merge #9734
9734: semantic highlighting: add reference hlmod r=matklad a=jhgg

This PR adds the "reference" highlight modifier! 

I basically went around and looked for `HlMod::Mutable` to find the callsites to add a reference. I think these all make sense! 

Co-authored-by: Jake Heinz <jh@discordapp.com>
Co-authored-by: Jake <jh@discordapp.com>
2021-08-04 09:37:30 +00:00
Jake Heinz
19b1d505db match style 2021-08-04 06:14:58 +00:00
Jake Heinz
44726b6ca3 fix + update expects 2021-08-04 06:12:41 +00:00
Jake
e01ff775ae
Apply suggestions from code review
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-03 23:07:46 -07:00
Jade
b90ed92a5c Support exclusive_range_pattern
Fix #9779
2021-08-03 21:36:29 -07:00
Jade
e3a67ccec6 tree-wide: fix rustdoc warnings, add some links 2021-08-03 21:34:20 -07:00
bors[bot]
8a8431133e
Merge #9775
9775: internal: extract_assist is aware of the expression owner r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-03 18:48:43 +00:00
Lukas Wirth
29c4ae6f9a extract_assist is aware of the expression owner 2021-08-03 20:47:51 +02:00
Jake
28b6a30752
Update crates/ide/src/syntax_highlighting/highlight.rs
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-08-03 09:54:27 -07:00