Commit Graph

9285 Commits

Author SHA1 Message Date
Aleksey Kladov
b12cbd6062 Don't break onEnter if rust-analyzer fails to start
closes #3253
2020-02-24 12:32:15 +01:00
Veetaha
ef4dfab3cc
Quick fix circular json error when sanity-check fails
Related issue: #3280
2020-02-24 11:56:52 +02:00
bors[bot]
1d1c1b0d85
Merge #3287
3287: Omit type hints for enum variant bind pats r=matklad a=SomeoneToIgnore

After using new hints for a while, I've started to think that hints for enum variants are an overkill.
Another user also shares the same toughts: https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-590172297

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-24 08:46:07 +00:00
Kirill Bulatov
7f3c0e8564 Omit type hints for enum variant bind pats 2020-02-24 10:32:46 +03:00
adamrk
4f1d90e73b Handle trivia in strucural search and replace 2020-02-23 22:14:47 +01:00
bors[bot]
cd01e72a9e
Merge #3277
3277: vscode: gracefully handle cancellation errors r=matklad a=Veetaha

This PR fixes a fleet of errors that rapidly populate the Developer Tools console.
![image](https://user-images.githubusercontent.com/36276403/75097665-0c7aba80-55b6-11ea-8edd-ab5dc5f89e1e.png)


Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-23 15:26:20 +00:00
bors[bot]
3d6ec45a01
Merge #3282
3282: Add suggestion for failed path resolution r=matklad a=yoshuawuyts

This adds https://github.com/rust-analyzer/rust-analyzer/issues/3245 as an inline help text for when path resolution fails. I saw this error, but also `"Failed to read Cargo metadata from Cargo.toml file"` several times while trying to debug what was failing.

There's probably a more structured way of displaying help texts in VS Code popups. But this would've saved me 20 mins of debugging when installing `rust-analyzer` under WSL today. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2020-02-23 15:17:08 +00:00
Yoshua Wuyts
b4970b0fe9 Add suggestion for failed path resolution
This adds https://github.com/rust-analyzer/rust-analyzer/issues/3245 as an inline help text for when path resolution fails.
2020-02-23 15:51:32 +01:00
Veetaha
4cee7cddc8 vscode: gracefully handle cancellation errors 2020-02-23 15:49:09 +02:00
bors[bot]
838ad6bcfb
Merge #3279
3279: Add basic parameter name hints heuristics r=matklad a=SomeoneToIgnore



Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-23 10:09:35 +00:00
bors[bot]
58d44c6ba2
Merge #3261
3261: Extract client-side logging r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-23 10:02:08 +00:00
Kirill Bulatov
b2a7b29bb9 Style fixes 2020-02-23 13:02:00 +03:00
Kirill Bulatov
c200dba167 Add basic parameter name hints heuristics 2020-02-23 12:49:53 +03:00
bors[bot]
dea1d957e5
Merge #3275
3275: Add Structural Search and Replace doc r=matklad a=adamrk

Addresses the first point of https://github.com/rust-analyzer/rust-analyzer/issues/3186.

Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
2020-02-23 09:49:26 +00:00
bors[bot]
1651ce0ebe
Merge #3278
3278: Show more inlay hints r=matklad a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/3273

As suggested in https://github.com/rust-analyzer/rust-analyzer/pull/1606#discussion_r308146363 , there is a simpler way to handle inlay hints after https://github.com/rust-analyzer/rust-analyzer/issues/1618 is closed.

This PR uses the approach suggested (which results in more type hints for various bindings) and also adds more name hints for function parameters.

Examples can be found in the issue:
* https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-589998051
* https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-590002839

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-23 09:25:40 +00:00
Kirill Bulatov
ca4557ac52 Fix the tests 2020-02-23 01:44:15 +03:00
Kirill Bulatov
6670868d09 Show more parameter name hints 2020-02-23 01:44:15 +03:00
Kirill Bulatov
4ca22f3a88 Simplify inlay hints processing 2020-02-23 01:44:15 +03:00
bors[bot]
650586a838
Merge #3276
3276: Bump crossbeam crates r=kjeremy a=lnicola

This removes a duplicate `autocfg` dependency and was supposed to upgrade `rand`, but it got reverted in `crossbeam` to keep it compiling on pre-2018 edition compilers.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-22 21:23:06 +00:00
Adam Bratschi-Kaye
28367f7e4f
rewording and typo fix
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-22 18:07:43 +01:00
Laurențiu Nicola
9077942212 Bump crossbeam crates 2020-02-22 18:22:09 +02:00
adamrk
8ebd50fb99 add ssr doc 2020-02-22 17:19:24 +01:00
bors[bot]
e91375c763
Merge #3274
3274: Simplify r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-22 15:59:58 +00:00
Aleksey Kladov
fda118f4e9 Simplify 2020-02-22 16:59:31 +01:00
bors[bot]
46dbe4dc80
Merge #3272
3272: ra_db: removed a couple of explicit lifetimes r=matklad a=Veetaha



Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-22 15:07:36 +00:00
Aleksey Kladov
49844ab717 Extract client-side logging 2020-02-22 16:03:47 +01:00
Veetaha
4255bc70e8 ra_db: removed a couple of explicit lifetimes 2020-02-22 17:00:39 +02:00
bors[bot]
2cbe8a4c4b
Merge #3263
3263: Implement unsizing coercions using Chalk r=matklad a=flodiebold

These are coercions like `&[T; n] -> &[T]`, which are handled by the `Unsize` and `CoerceUnsized` traits. The impls for `Unsize` are all built in to the compiler and require special handling, so we need to provide them to Chalk.

This adds the following `Unsize` impls:
 - `Unsize<[T]> for [T; _]`
 - `Unsize<dyn Trait> for T where T: Trait`
 - `Unsize<dyn SuperTrait> for dyn SubTrait`

Hence we are still missing the 'unsizing the last field of a generic struct' case.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-02-22 12:31:30 +00:00
bors[bot]
7836720f2e
Merge #3271
3271: Fix dat comment r=matklad a=Veetaha



Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-02-22 12:24:58 +00:00
Veetaha
59dc797eb3
Fix dat comment 2020-02-22 14:16:13 +02:00
Florian Diebold
5a6e770f99 Shorten some code 2020-02-22 13:15:54 +01:00
Florian Diebold
3e106c77ff Rework find_super_trait_path to protect against cycles 2020-02-22 13:14:39 +01:00
bors[bot]
70ad904012
Merge #3205
3205: vscode: migrate to tripple equals r=matklad a=Veetaha



Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-22 12:01:27 +00:00
bors[bot]
9999660c90
Merge #3269
3269: Add inlay hints documentation r=flodiebold a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/3267

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-22 11:50:36 +00:00
Veetaha
d905abfb11 vscode: migrate to tripple equals 2020-02-22 13:46:11 +02:00
Kirill Bulatov
818a4ea272
Fix a typo 2020-02-22 14:35:48 +03:00
bors[bot]
f9acb4333f
Merge #3260
3260: Refactor how builtins are resolved r=matklad a=flodiebold

This fixes autocompletion suggesting e.g. `self::usize`. (I thought we had a bug for that, but I didn't find it.)

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-02-22 11:25:09 +00:00
bors[bot]
62ddf617e2
Merge #3230
3230: ra_mbe: convert_literal now works with malformed tokens r=edwin0cheng a=Veetaha

Fixes: #3226

Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-02-22 11:17:23 +00:00
Veetaha
5f15e3aeb0
ra_mbe: Remove explicit type annotation 2020-02-22 13:14:46 +02:00
Veetaha
28bdb65407 ra_mbe: added test for malformed token in macro invokation
There was a panic where lexer returned None on malformed tokens.
But now we just ignore tokenization errors in mbe.
2020-02-22 13:10:54 +02:00
Veetaha
93a19bda17 ra_mbe: convert_literal now works with malformed tokens 2020-02-22 13:10:54 +02:00
Kirill Bulatov
6f8d70363d
One more tiny doc fix 2020-02-22 13:52:49 +03:00
Kirill Bulatov
68c34d1f63
Code review fixes
Co-Authored-By: Florian Diebold <flodiebold@googlemail.com>
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-22 12:51:08 +02:00
Florian Diebold
c200025794 Fix shift_bound_vars
It should only shift free vars (maybe the name isn't the best...)
2020-02-22 11:09:21 +01:00
Florian Diebold
463df6720c Fix wrong handling of bare dyn Trait exposed by canonicalizer fix
The self type in the `dyn Trait` trait ref should always be ^0, but we didn't
put that in there in the bare case.
2020-02-22 11:09:21 +01:00
Florian Diebold
2d5ab63247 Add &dyn Trait -> &dyn SuperTrait coercion, and fix &T -> &dyn Trait 2020-02-22 11:09:21 +01:00
Florian Diebold
f126808b2e Fix handling of binders in canonicalization
I'm looking forward to getting rid of this in favor of Chalk's implementation.
2020-02-22 11:09:21 +01:00
Florian Diebold
0dfbbaf03b Implement dyn Trait unsizing as well 2020-02-22 11:09:21 +01:00
Florian Diebold
de39d221a1 Implement unsize coercion using proper trait solving 2020-02-22 11:09:21 +01:00
Kirill Bulatov
64051ac5c7 Add inlay hints documentation 2020-02-22 10:23:03 +03:00