Commit Graph

13140 Commits

Author SHA1 Message Date
bors[bot]
7dd09a7b34
Merge #6236
6236: Code: Insert a ZWNJ before `after` type hints r=matklad a=lnicola

to prevent the editor from displaying a ligature there. 

Fixes #6235

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-15 10:50:26 +00:00
bors[bot]
ba6679dc6c
Merge #6239
6239: Cleanup alloc advice r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-15 10:22:01 +00:00
Aleksey Kladov
dedfaa3844 Cleanup alloc advice 2020-10-15 12:21:38 +02:00
Laurențiu Nicola
010d123f23 Insert a ZWNJ before type hints 2020-10-15 10:56:28 +03:00
bors[bot]
3a38554f86
Merge #6231
6231: Factor macro_rules and format-string highlighting out into submodules r=Veykril a=Veykril

This moves `format`-like macro string highlighting and macro_rules highlight skipping out of the main module.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-14 20:52:41 +00:00
Lukas Wirth
bab29e65eb Default::default the highlighters 2020-10-14 22:50:26 +02:00
Vlad Shcherbina
e6fbb94edd Fix hover over field pattern shorthand
Instead of the information about the field, it now shows the information
about the local.

Fixes #6146
2020-10-14 21:22:00 +03:00
Lukas Wirth
d983f18df7 Add mark tests to qualify_path assist 2020-10-14 20:04:57 +02:00
bors[bot]
b2205bd107
Merge #6233
6233: Style: default over new r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-14 18:02:36 +00:00
Aleksey Kladov
9c285b0341 Style: default over new 2020-10-14 20:02:03 +02:00
Lukas Wirth
9f41f074be Add qualify path assist 2020-10-14 19:56:20 +02:00
Lukas Wirth
8c6dc5f28a Factor macro_rules! highlighting out 2020-10-14 19:23:59 +02:00
Lukas Wirth
df87be88d8 Factor format string highlighting out 2020-10-14 19:23:45 +02:00
Roland Ruckerbauer
0e9d1e17d6 binary operator overload type inference: add test mark 2020-10-14 19:00:04 +02:00
bors[bot]
84d6cdef86
Merge #6230
6230: Log around sysroot discovery r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-14 15:23:02 +00:00
Aleksey Kladov
1b3b8c7fda Log around sysroot discovery 2020-10-14 17:22:07 +02:00
bors[bot]
f7144dcd52
Merge #6229
6229: Add docs for dbgr and call r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-14 13:32:32 +00:00
Laurențiu Nicola
8cc175ee9b Add docs for dbgr and call 2020-10-14 16:23:51 +03:00
bors[bot]
f9b2dea0d7
Merge #6228
6228: Introduce S-actionable and S-unactionable labels r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-14 13:23:45 +00:00
Aleksey Kladov
190011168d Introduce S-actionable and S-unactionable labels
I've noticed that a significant fraction of issues are inert.
They are valid, acknowledged and useful, but effectively can't be
fixed for variety of reasons (no reproduction, dependencies on some
other issues, no review capacity, etc).

Marking issues that can be fixed by just applying some elbow grease
seems useful!
2020-10-14 15:20:31 +02:00
bors[bot]
3e450cf89f
Merge #6207 #6224 #6226 #6227
6207: Extract ImportAssets out of auto_import r=matklad a=Veykril

See https://github.com/rust-analyzer/rust-analyzer/pull/6172#issuecomment-707182140

I couldn't fully pull out `AssistContext` as `find_node_at_offset_with_descend`: 81fa00c5b5/crates/assists/src/assist_context.rs (L90-L92) requires the `SourceFile` which is private in it and I don't think making it public just for this is the right call?

6224: ⬆️ salsa r=matklad a=matklad

bors r+
🤖

6226: Add reminder to update lsp-extensions.md r=matklad a=matklad

bors r+
🤖

6227: Reduce bors timeout r=matklad a=matklad

bors r+
🤖

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-14 11:37:51 +00:00
Aleksey Kladov
74b5f7cd82 Reduce bors timeout 2020-10-14 13:37:20 +02:00
Aleksey Kladov
d852189e56 Add reminder to update lsp-extensions.md 2020-10-14 13:30:06 +02:00
Aleksey Kladov
41e2639f35 ⬆️ salsa 2020-10-14 12:40:48 +02:00
bors[bot]
b62f48f535
Merge #6217
6217: Bump pulldown-cmark r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-14 10:26:13 +00:00
bors[bot]
69f1c8aa6e
Merge #6222
6222: Fix stackoverflow in insert_use::recursive_merge r=matklad a=Veykril

Fixes #6221.

#6108 shouldn't be related to this as autocompletion doesn't depend on this code.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-14 10:15:51 +00:00
Lukas Wirth
03b77b03fe Fix stackoverflow in insert_use::recursive_merge 2020-10-14 01:43:56 +02:00
Roland Ruckerbauer
4e49b2f731 Implement binary operator overloading type inference 2020-10-13 20:48:08 +02:00
Lukas Wirth
01b410c69a Slightly cleanup import_assets module 2020-10-13 20:02:14 +02:00
Laurențiu Nicola
e559066bed Bump pulldown-cmark 2020-10-13 20:41:49 +03:00
Lukas Wirth
02b844e9fb Adhere to style guidelines in import_assets 2020-10-13 18:58:37 +02:00
Lukas Wirth
256104d78e Extract ImportAssets out of auto_import 2020-10-13 18:58:37 +02:00
bors[bot]
0fb069c5b0
Merge #6216
6216: Bump deps r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-13 15:13:55 +00:00
Laurențiu Nicola
baf84d4a93 Bump regex 2020-10-13 18:06:40 +03:00
Laurențiu Nicola
9937c0d50a Bump rustc_lexer 2020-10-13 18:06:23 +03:00
Laurențiu Nicola
017a04f424 Bump crossbeam-channel and lsp-server in rust-analyzer 2020-10-13 18:05:06 +03:00
bors[bot]
5091b5e973
Merge #6209
6209: Fix MergeBehaviour::Full/Last not working when merging nested long paths r=matklad a=Veykril

Prior to this inserting `std::foo::bar::Baz` with a nested import containing a multi segment path like `use std::{foo::bar::Qux};` present would result in `use std::{foo::bar::Baz, foo::bar::Qux};` with Full/Last Mergebehaviour.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-13 14:59:37 +00:00
Laurențiu Nicola
db7813ef2c Bump crossbeam-channel in crates 2020-10-13 16:57:01 +03:00
Laurențiu Nicola
c6605affe4 Bump some deps 2020-10-13 16:46:36 +03:00
Laurențiu Nicola
852b2481a4 Remove Cargo.lock comment 2020-10-13 16:46:22 +03:00
bors[bot]
2d79bb9413
Merge #6213
6213: Fix resolveCodeAction request r=SomeoneToIgnore a=lnicola

Fixes #6204

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-13 11:31:39 +00:00
Laurențiu Nicola
513d25cf03 Fix resolveCodeAction request 2020-10-13 12:47:01 +03:00
Lukas Wirth
2620b8d42f Fix MergeBehaviour::Full not working when merging nested long paths 2020-10-13 10:44:16 +02:00
bors[bot]
3d13939260
Merge #6208
6208: macOS: install GNU tar r=jonas-schievink a=jonas-schievink

CI runs on macOS have started to fail due to https://github.com/actions/cache/issues/403. Use GNU tar instead of BSD tar to work around that.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-10-12 19:49:09 +00:00
Jonas Schievink
e99cb578c9
Remove disabled builder 2020-10-12 21:48:42 +02:00
Jonas Schievink
1cb64a70d6 Add comment and link to upstream issue 2020-10-12 19:55:55 +02:00
Jonas Schievink
8f61ee6b9b Reenable bors gate for macOS 2020-10-12 19:53:03 +02:00
Jonas Schievink
f8be6c636c macOS: install GNU tar 2020-10-12 19:51:49 +02:00
bors[bot]
c518fe7f6c
Merge #6130 #6135
6130: Items case quick fix (snake_case / UPPER_SNAKE_CASE / CamelCase) r=matklad a=popzxc

Resolves #4598.

After a third try, it finally works. Boy, it appeared tougher than it seemed.

Initially I thought like "Ha, `rustc` already tells us where idents are named incorrectly. It shouldn't be that hard, should it?".

Well, the problems with the information provided by `rustc` appeared shortly:

- `rustc` warnings are `flycheck` warnings, which are slightly aside from our diagnostics with fixes.
  When we map flycheck diagnostic to LSP, we can convert it into a fix, but only if it's marked as `Applicability::MachineApplicable`.
  Name case fix is marked `Applicability::MaybeIncorrect`, and for a reason: it only suggest to rename symbol under cursor, without tracking any references.
- Warning spawned by `rustc` are identified by string labels rather than enum. It means that if one day the diagnostic will be renamed in `rustc`, `rust-analyzer` code will still compile, but won't find the required diagnostic by name anymore. If by chance this will happen when some unlucky guy will decide to create their first pull request, they'll be confused by suddenly failing tests  (likely) not related to their changes.
- Even if we'll try to build fixes atop of `rustc` warnings, we'll have to do it in the `rust_analyzer::diagnostics::to_proto` module, which is far less
  convenient for that matter than `ide` crate.

That's why I decided that it's worth a separate `rust-analyzer` diagnostic, which will implement `DiagnosticWithFix` trait.

After that, I discovered that currently `hir_ty::diagnostics` only check `DefWithBody` types, like function bodies. I had to add support for diagnostics
which look at any `ModuleDef`.

And of course, since I'd added a lot of new functionality, it required extensive testing.

That explains why the diff is so big for a (looking) relatively small feature.

I hope that this PR doesn't only add a small feature, but also creates a base for building another features.

## Example:

![case_quick_fix](https://user-images.githubusercontent.com/12111581/95008475-e07ee780-0622-11eb-9978-62a9ea0e7782.gif)

P.S. My eyes were bleeding when I had to write the code for the example...


6135: when generating new function, focus on return type instead of body r=matklad a=bnjjj

I made a little change when we use the assist to generate a new function, instead of focusing on the function body, it will focus on return type

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-12 16:00:13 +00:00
bors[bot]
ef33953c70
Merge #6205
6205: Fix iterator hint shortening heuristic r=SomeoneToIgnore a=Veykril

Turns out I made a mistake with the heuristic check which is always true, so all iterators exposed from `core` were shortened, including things like ranges. 😅 

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-12 15:53:32 +00:00