]>
git.lizzy.rs Git - rust.git/log
Kirill Bulatov [Tue, 8 Dec 2020 12:27:18 +0000 (14:27 +0200)]
Better config name
Kirill Bulatov [Mon, 7 Dec 2020 22:46:56 +0000 (00:46 +0200)]
Disable the completion for no corresponding client resolve capabilities
Kirill Bulatov [Sun, 6 Dec 2020 22:39:03 +0000 (00:39 +0200)]
Document the feature
Kirill Bulatov [Sun, 6 Dec 2020 21:58:15 +0000 (23:58 +0200)]
Simplify
Kirill Bulatov [Fri, 4 Dec 2020 20:55:36 +0000 (22:55 +0200)]
Check lsp completions' edits for disjointness
Kirill Bulatov [Fri, 4 Dec 2020 19:23:30 +0000 (21:23 +0200)]
Less panic, more tests
Kirill Bulatov [Fri, 4 Dec 2020 18:02:42 +0000 (20:02 +0200)]
Fix the profiling label
Kirill Bulatov [Fri, 4 Dec 2020 14:03:22 +0000 (16:03 +0200)]
Use stateless completion resolve
Kirill Bulatov [Fri, 4 Dec 2020 08:02:22 +0000 (10:02 +0200)]
Remove the state
Kirill Bulatov [Thu, 3 Dec 2020 13:58:18 +0000 (15:58 +0200)]
Make completion resolve async
Kirill Bulatov [Thu, 3 Dec 2020 09:13:28 +0000 (11:13 +0200)]
Simplify import edit calculation
Kirill Bulatov [Wed, 2 Dec 2020 22:27:26 +0000 (00:27 +0200)]
Remove redundant code
Kirill Bulatov [Wed, 2 Dec 2020 22:13:32 +0000 (00:13 +0200)]
Refactor the code
Kirill Bulatov [Wed, 2 Dec 2020 21:55:35 +0000 (23:55 +0200)]
Add eager resolve capability
Kirill Bulatov [Tue, 1 Dec 2020 23:02:15 +0000 (01:02 +0200)]
Better support client completion resolve caps
Kirill Bulatov [Tue, 1 Dec 2020 20:46:06 +0000 (22:46 +0200)]
Properly fill client completion resolve capabilities data
Kirill Bulatov [Tue, 1 Dec 2020 13:25:26 +0000 (15:25 +0200)]
Resolve import inserts better
Kirill Bulatov [Tue, 1 Dec 2020 08:59:41 +0000 (10:59 +0200)]
Remove unnecessary leftovers
Kirill Bulatov [Mon, 30 Nov 2020 20:28:19 +0000 (22:28 +0200)]
Working resolve completion imports prototype
Kirill Bulatov [Sat, 28 Nov 2020 14:26:30 +0000 (16:26 +0200)]
Draft the new lsp handler
bors[bot] [Mon, 7 Dec 2020 19:53:34 +0000 (19:53 +0000)]
Merge #6754
6754: Apply environment set by build scripts r=jonas-schievink a=jonas-schievink
Fixes inclusion of generated files in typenum/heapless/defmt etc.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 7 Dec 2020 19:52:31 +0000 (20:52 +0100)]
Apply environment set by build scripts
bors[bot] [Mon, 7 Dec 2020 19:42:08 +0000 (19:42 +0000)]
Merge #6752
6752: Pass `--target` when loading out dirs from check r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 7 Dec 2020 19:39:29 +0000 (20:39 +0100)]
Pass `--target` when loading out dirs from check
bors[bot] [Mon, 7 Dec 2020 19:20:35 +0000 (19:20 +0000)]
Merge #6749
6749: cargo update r=lnicola a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Mon, 7 Dec 2020 19:19:10 +0000 (14:19 -0500)]
Update expect-test and remove outdated license
bors[bot] [Mon, 7 Dec 2020 18:48:35 +0000 (18:48 +0000)]
Merge #6719
6719: Use items can also have doc comments r=matklad a=Veykril
Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Mon, 7 Dec 2020 18:41:07 +0000 (18:41 +0000)]
Merge #6751
6751: Use the right `def_crate` for builtin macros r=jonas-schievink a=jonas-schievink
Fixes the incorrect macro resolution in https://github.com/rust-analyzer/rust-analyzer/issues/6716
No test, because diagnostics do not get remapped correctly for some reason. I've checked manually that this fixes the resolution errors.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 7 Dec 2020 18:37:38 +0000 (19:37 +0100)]
Use the right `def_crate` for builtin macros
kjeremy [Mon, 7 Dec 2020 18:01:07 +0000 (13:01 -0500)]
cargo update
bors[bot] [Mon, 7 Dec 2020 17:46:21 +0000 (17:46 +0000)]
Merge #6748
6748: Update npm packages r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Mon, 7 Dec 2020 17:12:40 +0000 (12:12 -0500)]
Update npm packages
bors[bot] [Mon, 7 Dec 2020 16:21:51 +0000 (16:21 +0000)]
Merge #6745
6745: Some more proc macro cleanups r=jonas-schievink a=jonas-schievink
* Remove `ProcMacroClient::dummy` and just use `Option<ProcMacroClient>` instead
* Remember the type of proc macros (later allows us to reject using an incorrect macro type)
* Prepare a few internals for procedural attribute macros
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 7 Dec 2020 16:17:31 +0000 (17:17 +0100)]
Remove resolved FIXME
Jonas Schievink [Mon, 7 Dec 2020 16:16:50 +0000 (17:16 +0100)]
Remove dummy ProcMacroClient in favor of Option
Jonas Schievink [Mon, 7 Dec 2020 16:06:14 +0000 (17:06 +0100)]
Retain types of proc macros and allow attr. macros
bors[bot] [Mon, 7 Dec 2020 15:12:53 +0000 (15:12 +0000)]
Merge #6743
6743: Don't insert blank lines between doc attributes r=Veykril a=Veykril
Fixes #6742.
Doc attributes should be concatenated via a single linebreak as written in the [rustdoc book](https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html).
Also changed the loop to use an iterator to get rid of the `docs.trim_end_matches("\n\n").to_owned()` part using `Itertools::intersperse`.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 7 Dec 2020 14:55:52 +0000 (15:55 +0100)]
Don't insert blank lines between doc attributes
bors[bot] [Mon, 7 Dec 2020 15:00:07 +0000 (15:00 +0000)]
Merge #6731
6731: Add replace_match_with_if_let assist r=matklad a=Veykril
Basically the counterpart to `replace_if_let_with_match`, I personally sometimes want to replace matches like
```rust
match foo {
pat => expr,
_ => (),
}
```
into the corresponding
```rust
if let pat = foo {
expr
}
```
which is the main reasoning behind this.
I put this into the same file as `replace_if_let_with_match` because the are complementing each other and I would probably rename the file to something like `replace_if_let_match` but I didn't do that for now because I was unsure whether git would still view this as a rename or not due to the amount of changes in the file so that the diff is still properly visible for now.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Jonas Schievink [Mon, 7 Dec 2020 13:11:17 +0000 (14:11 +0100)]
Make `ProcMacroProcessExpander` private
Jonas Schievink [Mon, 7 Dec 2020 12:55:41 +0000 (13:55 +0100)]
ProcMacroProcessExpander: support attribute macros
bors[bot] [Mon, 7 Dec 2020 10:49:37 +0000 (10:49 +0000)]
Merge #6597
6597: Upgrade Chalk r=flodiebold a=flodiebold
Also make overflow depth and max type size configurable through env variables. This can be helpful at least for debugging.
Tests currently fail because of rust-lang/chalk#656, so we'll need to wait for the next update to merge this.
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Florian Diebold [Fri, 20 Nov 2020 17:00:34 +0000 (18:00 +0100)]
Upgrade Chalk
Also make overflow depth and max type size configurable through env variables.
This can be helpful at least for debugging.
Fixes #6628.
bors[bot] [Sun, 6 Dec 2020 16:00:03 +0000 (16:00 +0000)]
Merge #6733
6733: Update attributes completion list r=jonas-schievink a=Veykril
Might be nice to have them grouped for readability/maintainability similar to how the [reference](https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index) does it but that would require the use of a `OnceCell` for sorting the entries back after construction.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 5 Dec 2020 21:23:13 +0000 (22:23 +0100)]
Update attributes completion list
bors[bot] [Sun, 6 Dec 2020 13:26:54 +0000 (13:26 +0000)]
Merge #6734
6734: Emit additional diagnostics for hints/help/etc r=lnicola a=jonas-schievink
This makes rust-analyzer diagnostics match native rustc diagnostics in the terminal more closely. Unfortunately all of this is a bodge, since we already provide this information to the client in the form of `DiagnosticRelatedInformation`, but at least VS Code chooses such a poor UI for these that they don't help much, as evidenced [here](https://twitter.com/yaahc_/status/
1335297260444250112 ) and in https://github.com/rust-lang/rust/issues/79741.
This PR papers over these client UI problems by taking the `DiagnosticRelatedInformation` and turning each one into its own hint-level diagnostic, which makes it show up in the source code. Quick fixes are attached to all resulting diagnostics, which makes them more discoverable.
### Example: "Consider removing this semicolon"
![screenshot-2020-12-06-01:27:29](https://user-images.githubusercontent.com/
1786438 /
101268366 -
46423980 -3762-11eb-9a69-
1ff0b1806c2f .png)
![screenshot-2020-12-06-01:27:39](https://user-images.githubusercontent.com/
1786438 /
101268367 -
46dad000 -3762-11eb-81fa-
afd234d44f17 .png)
![screenshot-2020-12-06-01:27:46](https://user-images.githubusercontent.com/
1786438 /
101268368 -
46dad000 -3762-11eb-9205-
4b9bd9f4406d .png)
### Example: "Value used after move"
![screenshot-2020-12-06-01:33:00](https://user-images.githubusercontent.com/
1786438 /
101268447 -
22332800 -3763-11eb-85ce-
8c742927a2c8 .png)
![screenshot-2020-12-06-01:33:07](https://user-images.githubusercontent.com/
1786438 /
101268448 -
22cbbe80 -3763-11eb-8f16-
0590895d8bc6 .png)
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Sun, 6 Dec 2020 13:23:55 +0000 (14:23 +0100)]
Apply suggestions from code review
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
Jonas Schievink [Sun, 6 Dec 2020 00:39:52 +0000 (01:39 +0100)]
Update expect tests
Jonas Schievink [Sun, 6 Dec 2020 00:24:37 +0000 (01:24 +0100)]
Emit additional diagnostics for hints/help/etc
Lukas Wirth [Sat, 5 Dec 2020 14:41:36 +0000 (15:41 +0100)]
Add replace_match_with_if_let assist
bors[bot] [Fri, 4 Dec 2020 19:28:34 +0000 (19:28 +0000)]
Merge #6726
6726: Add slightly more profiling details r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 4 Dec 2020 19:26:28 +0000 (20:26 +0100)]
Add slightly more profiling details
bors[bot] [Fri, 4 Dec 2020 19:12:49 +0000 (19:12 +0000)]
Merge #6725
6725: Don't respawn proc macro server on crash r=jonas-schievink a=jonas-schievink
Now the thread managing IPC will exit when the server process crashes instead of respawning it.
Closes https://github.com/rust-analyzer/rust-analyzer/issues/6707
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 4 Dec 2020 18:59:58 +0000 (19:59 +0100)]
Don't respawn proc macro server on crash
bors[bot] [Fri, 4 Dec 2020 18:46:44 +0000 (18:46 +0000)]
Merge #6721
6721: Use METHOD semantic token type r=kjeremy a=lnicola
Closes #6685
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
bors[bot] [Fri, 4 Dec 2020 18:39:04 +0000 (18:39 +0000)]
Merge #6724
6724: Fix `diagnostics` subcommand, look at all modules r=jonas-schievink a=jonas-schievink
The `diagnostics` subcommand used to only compute diagnostics for `lib.rs` / the root module of all workspace crates. This fixed it and makes it look at every module.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 4 Dec 2020 18:37:37 +0000 (19:37 +0100)]
Fix `diagnostics` subcommand, look at all modules
bors[bot] [Fri, 4 Dec 2020 17:44:37 +0000 (17:44 +0000)]
Merge #6723
6723: Use correct, full substs for self type in impl r=flodiebold a=flodiebold
Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it can.
This fixes the crash from #6668; but it doesn't make method resolution work for these methods.
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Florian Diebold [Fri, 4 Dec 2020 17:41:37 +0000 (18:41 +0100)]
Use correct, full substs for self type in impl
Without arbitrary self types, the self type could never refer to the method type
parameters, so this wasn't a problem; but with arbitrary self types, it can.
This fixes the crash from #6668; but it doesn't make method resolution work for
these methods.
bors[bot] [Fri, 4 Dec 2020 17:09:12 +0000 (17:09 +0000)]
Merge #6722
6722: Minor proc macro cleanups r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Laurențiu Nicola [Fri, 4 Dec 2020 16:27:10 +0000 (18:27 +0200)]
Use METHOD semantic token type
Lukas Wirth [Fri, 4 Dec 2020 14:51:23 +0000 (15:51 +0100)]
Use items can also have doc comments
Jonas Schievink [Fri, 4 Dec 2020 13:03:06 +0000 (14:03 +0100)]
Unwrap `process.stdio()` result
If this is ever `None` here, that's a bug
Jonas Schievink [Fri, 4 Dec 2020 12:57:33 +0000 (13:57 +0100)]
Destructure in for loop
Jonas Schievink [Fri, 4 Dec 2020 12:54:09 +0000 (13:54 +0100)]
Remove unnecessary `Option`
bors[bot] [Thu, 3 Dec 2020 19:47:00 +0000 (19:47 +0000)]
Merge #6715
6715: Don't diagnose `#[cfg]` in macros r=jonas-schievink a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6363
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Dec 2020 19:46:16 +0000 (20:46 +0100)]
Don't diagnose `#[cfg]` in macros
bors[bot] [Thu, 3 Dec 2020 18:08:17 +0000 (18:08 +0000)]
Merge #6713
6713: Make `compile_error!` message match upstream rustc r=jonas-schievink a=jonas-schievink
It only consists of the argument passed to it.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Dec 2020 18:07:37 +0000 (19:07 +0100)]
Make `compile_error!` message match upstream rustc
It only consists of the argument passed to it
bors[bot] [Thu, 3 Dec 2020 17:40:18 +0000 (17:40 +0000)]
Merge #6712
6712: Fix proc macro token mapping r=jonas-schievink a=jonas-schievink
Diagnostics inside proc macros are currently incorrectly placed at their original offset, but inside the containing file. This fixes that, by allowing the creation of `ExpansionInfo` from non-`macro_rules!` macro invocations.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Dec 2020 17:38:05 +0000 (18:38 +0100)]
Fix proc macro token mapping
bors[bot] [Thu, 3 Dec 2020 16:55:15 +0000 (16:55 +0000)]
Merge #6700
6700: More macro diagnostics improvements r=jonas-schievink a=jonas-schievink
This threads macro expansion errors through `eager.rs` and the `AsMacroCall` trait, improving macro diagnostics emitted during body lowering.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 3 Dec 2020 16:54:43 +0000 (17:54 +0100)]
Rename `error_sink` to `diagnostic_sink`
bors[bot] [Thu, 3 Dec 2020 15:31:36 +0000 (15:31 +0000)]
Merge #6711
6711: cargo update: bump libloading to fix a double-free r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 3 Dec 2020 15:30:28 +0000 (10:30 -0500)]
cargo update: bump libloading to fix a double-free
bors[bot] [Thu, 3 Dec 2020 15:13:55 +0000 (15:13 +0000)]
Merge #6710
6710: Extract tests module to file in ide_db crate r=matklad a=sasurau4
Helps with #6522
- pass `cargo test`
Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
Aleksey Kladov [Thu, 3 Dec 2020 15:08:27 +0000 (18:08 +0300)]
Document statelessness invariant
Daiki Ihara [Thu, 3 Dec 2020 15:05:39 +0000 (00:05 +0900)]
Extract tests module to file in ide_db crate
Jonas Schievink [Thu, 3 Dec 2020 14:31:04 +0000 (15:31 +0100)]
Make `compile_error!` lazy and emit a diagnostic
Jonas Schievink [Wed, 2 Dec 2020 16:03:18 +0000 (17:03 +0100)]
Give better diagnostic if `OUT_DIR` is unset
Jonas Schievink [Wed, 2 Dec 2020 16:00:48 +0000 (17:00 +0100)]
Update/Fix tests
Jonas Schievink [Wed, 2 Dec 2020 15:52:14 +0000 (16:52 +0100)]
Propagate eager expansion errors
bors[bot] [Wed, 2 Dec 2020 21:07:28 +0000 (21:07 +0000)]
Merge #6702
6702: Bump mio for safety goodness r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Wed, 2 Dec 2020 21:06:36 +0000 (16:06 -0500)]
Bump mio for safety goodness
bors[bot] [Wed, 2 Dec 2020 19:19:19 +0000 (19:19 +0000)]
Merge #6701
6701: Don't prime caches when just opening a file r=jonas-schievink a=jonas-schievink
Fixes occasional "progress handler already registered" errors.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Wed, 2 Dec 2020 19:18:28 +0000 (20:18 +0100)]
Don't prime caches when just opening a file
bors[bot] [Wed, 2 Dec 2020 14:03:57 +0000 (14:03 +0000)]
Merge #6699
6699: Test macro diagnostics in body lowering r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Wed, 2 Dec 2020 13:54:25 +0000 (14:54 +0100)]
Test macro diagnostics in body lowering
bors[bot] [Wed, 2 Dec 2020 13:25:54 +0000 (13:25 +0000)]
Merge #6698
6698: Attach macro expansion errors to the right file r=jonas-schievink a=jonas-schievink
Previously it attached them to the result of the macro expansion (or, if no result was produced, to the file containing the invocation). Always use the file containing the invocation.
This doesn't seem to have any observable difference, but seems better in theory.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Wed, 2 Dec 2020 13:23:51 +0000 (14:23 +0100)]
Attach macro expansion errors to the right file
bors[bot] [Wed, 2 Dec 2020 13:13:01 +0000 (13:13 +0000)]
Merge #6649
6649: Accept more than just the standard rust literal suffixes in *Number::suffix r=matklad a=Veykril
I am not entirely sure whether to keep or remove the `SUFFIXES` but I figured we can always bring them back once they are needed.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Wed, 2 Dec 2020 13:06:34 +0000 (13:06 +0000)]
Merge #6673
6673: Show type of Self on hover r=matklad a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Wed, 2 Dec 2020 12:34:19 +0000 (12:34 +0000)]
Merge #6679
6679: Extract tests module to file in vfs crate r=matklad a=sasurau4
Helps with #6522
- [x] passed `cargo test`
Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
bors[bot] [Wed, 2 Dec 2020 12:16:19 +0000 (12:16 +0000)]
Merge #6697
6697: Don't discard PathKind::Abs information in lower_use::convert_path r=matklad a=Veykril
Fixes #6694
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Wed, 2 Dec 2020 08:52:08 +0000 (09:52 +0100)]
Don't discard PathKind::Abs information in lower_use::convert_path
bors[bot] [Tue, 1 Dec 2020 13:36:02 +0000 (13:36 +0000)]
Merge #6690
6690: lsp-types 0.85: Fixes OptionalVersionedTextDocumentIdentifier specification r=kjeremy a=kjeremy
Fixes #6654
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Tue, 1 Dec 2020 13:33:21 +0000 (08:33 -0500)]
Fix OptionalVersionedTextDocumentIdentifier type
Fixes #6654
bors[bot] [Tue, 1 Dec 2020 12:38:45 +0000 (12:38 +0000)]
Merge #6689
6689: Trigger .let postfix snippet in the middle of the block r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 1 Dec 2020 12:38:06 +0000 (15:38 +0300)]
Trigger .let postfix snippet in the middle of the block
bors[bot] [Tue, 1 Dec 2020 12:27:52 +0000 (12:27 +0000)]
Merge #6683
6683: Emit macro diagnostics when lowering bodies r=matklad a=jonas-schievink
Changes `Expander::enter_expand` to return an `ExpandResult`, and adds any contained errors to the body diagnostic list.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>