Commit Graph

20768 Commits

Author SHA1 Message Date
bors[bot]
22adcfde03
Merge #11086
11086: internal: Simplify completion rendering r=Veykril a=Veykril

Removes all the helper render structs in favor of simple functions, making things a lot easier to oversee(imho)
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-21 15:22:51 +00:00
Lukas Wirth
929cae74b1 fmt +stable 2021-12-21 15:48:12 +01:00
Lukas Wirth
95ae67b0b0 Simplify type alias rendering, remove constructor structs 2021-12-21 15:37:43 +01:00
Lukas Wirth
97f7865c56 Simplify macro rendering, remove constructor structs 2021-12-21 15:20:15 +01:00
Lukas Wirth
2b60d80eaf Simplify const rendering, remove constructor structs 2021-12-21 15:04:19 +01:00
Lukas Wirth
e99ed3e407 Simplify enum variant rendering, remove constructor structs 2021-12-21 15:01:52 +01:00
Lukas Wirth
a720fc8e3a Simplify function rendering, remove constructor structs 2021-12-21 14:51:06 +01:00
Lukas Wirth
22b2c2fdf7 Simplify 2021-12-21 14:07:48 +01:00
bors[bot]
a406574ee8
Merge #11083
11083: fix: Fix inline local assist not working in let stmt initializer r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-21 13:04:43 +00:00
Lukas Wirth
539b0c2582 fix: Fix inline local assist not working in let stmt initializer 2021-12-21 14:03:59 +01:00
bors[bot]
22987c73e9
Merge #11082
11082: internal: Do less work in `hir::Semantics` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-21 12:39:32 +00:00
Lukas Wirth
8e084132f8 internal: Do less work in hir::Semantics 2021-12-21 13:38:58 +01:00
bors[bot]
7ce8906326
Merge #11078
11078: minor: Fix typo in reformat number assist label r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-21 08:00:59 +00:00
Laurențiu Nicola
01143c6600 Fix typo in reformat number assist label 2021-12-21 09:45:20 +02:00
Laurențiu Nicola
89cecff2bd Bump vscode in package.json 2021-12-20 20:58:09 +02:00
Laurențiu Nicola
2d9c14afb5 Build and publish pre-release Code extension versions 2021-12-20 20:58:09 +02:00
bors[bot]
851af5a52b
Merge #11074
11074: Bump default CHALK_SOLVER_MAX_SIZE to 150 r=lnicola a=lnicola

Fixes #11072

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-20 18:38:47 +00:00
Laurențiu Nicola
3f3aee53b4 Bump default CHALK_SOLVER_MAX_SIZE to 150 2021-12-20 20:35:45 +02:00
bors[bot]
c5722a66c5
Merge #11073
11073: fix: Fix windows not finding the pdb file r=lnicola a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 18:20:08 +00:00
Lukas Wirth
4a5c8c6ad2 fix: Fix windows not finding the pdb file 2021-12-20 19:17:31 +01:00
bors[bot]
d3aa2579cc
Merge #11069
11069: fix: Partially fix `ide_db::search` for crate roots r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10007
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 16:50:35 +00:00
Lukas Wirth
5206946674 fix: Partially fix ide_db::search for crate roots 2021-12-20 17:48:47 +01:00
bors[bot]
8dc3a270f6
Merge #11067
11067: internal: Store function param names in ItemTree r=Veykril a=Veykril

This prevents us reparsing source files for completions, sometimes slowing them down massively if the source file is not cached at the expense of a slightly bigger memory usage.

related info https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Completion.20performance

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 14:43:39 +00:00
Lukas Wirth
8eb7ee9099 Update test output 2021-12-20 15:43:15 +01:00
Lukas Wirth
cd9d76e0ca internal: Store function param names in ItemTree 2021-12-20 15:24:37 +01:00
bors[bot]
f46731a230
Merge #11028
11028: Bump MSRV (1.57) r=Veykril a=iDawer

This bumps MSRV on all crates to 1.57 except `la-arena`

#10986 requires >=1.57 

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2021-12-20 13:45:35 +00:00
Lukas Wirth
f609efff87 Simplify 2021-12-20 14:38:22 +01:00
iDawer
929e6ccf73 Don't bump la-arena 2021-12-20 18:10:37 +05:00
bors[bot]
14ff3d7e5f
Merge #11065
11065: internal: Don't kick off inference in `Semantics::descend_into_macros_impl` r=Veykril a=Veykril

We do not need inference info here so there is no point in calculating it
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 12:49:48 +00:00
Lukas Wirth
a574434c3f Simplify NameClass::classify 2021-12-20 13:47:06 +01:00
Lukas Wirth
37a87708ae internal: Don't kick off inference in Semantics::descend_into_macros_impl 2021-12-20 13:19:48 +01:00
bors[bot]
48d6cef436
Merge #10484
10484: internal: Update match checking algorithm r=lnicola a=iDawer

Sync match checking algorithm with rust-lang/rust f31622a50 2021-11-12 (https://github.com/rust-lang/rust/pull/90813)

This update brings huge simplification to the match checking and introduces an easy to use machinery for pattern destructuring and also:

1. Add a function to do post-inference normalization `hir_ty::infer::normalize(...)`.
2. Store binding modes in `InferenceResult`.

Todo:

- [x] Rebase & test (https://github.com/rust-analyzer/rust-analyzer/pull/10484#issuecomment-996669665)

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2021-12-20 12:05:23 +00:00
bors[bot]
2ca3834c9f
Merge #11062
11062: fix: Don't say "a reference to" for `Copy` types in the generate getter assist r=Veykril a=patrick-gu

This changes the generate getter assist to not say "a reference to" in the documentation stub if the type is `Copy`, as the getter does not return a reference.

To determine whether the type is `Copy`, I have added an `is_copy` method to `ReferenceConversion`.

Co-authored-by: patrick-gu <55641350+patrick-gu@users.noreply.github.com>
2021-12-20 09:14:38 +00:00
patrick-gu
76b50f14f7 Don't say "a reference to" for Copy types
This changes the generate getter assist to not say "a reference to" in the documentation stub if the type is Copy, as the getter does not return a reference.
2021-12-19 17:28:31 -08:00
iDawer
a9ad7be748 Respect binding mode of a binding pattern for exhaustiveness check 2021-12-20 00:14:39 +05:00
iDawer
b17aefb83a internal: Normalize field type after substituting 2021-12-20 00:14:39 +05:00
iDawer
1280961b51 internal: sync match checking with rust-lang/rust f31622a50 2021-11-12 2021-12-20 00:10:01 +05:00
Dawer
deb05930ef internal: Sync match checking algorithm with rustc
Original version: rust-lang/rust  68b76a483 2021-10-01
2021-12-20 00:10:01 +05:00
Wang Ruochen
71676ae89d
Support "move if to guard" for if else chains 2021-12-19 09:26:52 -08:00
bors[bot]
0add6e95e5
Merge #11060
11060: minor: Bump deps r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-19 17:02:40 +00:00
Laurențiu Nicola
c9ca77f641 Bump object 2021-12-19 19:00:42 +02:00
Laurențiu Nicola
32b6f103a6 Bump chalk 2021-12-19 18:58:39 +02:00
Laurențiu Nicola
e687e53695 Bump deps 2021-12-19 18:44:18 +02:00
bors[bot]
638cc3e59f
Merge #11054
11054: fix #11049 by removing double trimming r=Veykril a=Heinenen

The `unwrap_trivial_block()` removes the braces around trivial blocks (as the name suggests). This violates the precondition of `update_expr_string()` which removes the first and the last non-whitespace character and thus expects braces to still exist around all blocks.

Co-authored-by: ucrhh <ucrrh@sutdent.kit.edu>
2021-12-19 00:17:01 +00:00
ucrhh
b289f13c75 fix unwrap_block by removing double trimming 2021-12-18 23:19:53 +01:00
bors[bot]
b65d9c3e62
Merge #11053
11053: feat: Publish platform-specific Code VSIXes r=me a=lnicola

Closes #10483
CC #10371

Some notes:

 - we still build a plain VSIX, just in case
 - we build the extension on every platform to make the release workflow arguably cleaner
 - the Windows VSIX includes the PDB (but let's leave  #10371 open until we change the Windows stand-alone release to a ZIP file)
 - `npm` doesn't run if started from `xtask`, possibly something related to path mapping; I moved the `npm` calls outside, but..
 - the `Patch` thingy doesn't work any more, so you'll end up with a dirty `package.json` of you run `cargo xtask --client-patch-version`; I don't think we should block on this
 - there's an untested Alpine build; for better or worse, we special-case `musl` distros as `alpine`
 - I tested this as much as I could, but not the publishing and nightly updates
 - you can find some sample artifacts under https://github.com/lnicola/rust-analyzer/releases
 - we can now run the server from the install location (is Code planning to switch to compressed extensions?), except on NixOS
 - Code lets you install a VSIX for the wrong platform (with the results one would expect)
 - I don't know what happens if we try to publish a VSIX without a target

This is a relatively risky, but we'll probably have to take our chances with it.

r? `@rust-analyzer/review`

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-18 21:16:19 +00:00
Laurențiu Nicola
9c74f646f4 Publish platform-specific Code VSIXes 2021-12-18 22:49:11 +02:00
bors[bot]
0dbbf14bd6
Merge #11042
11042: minor: clarify RA_LOG env var troubleshooting r=lnicola a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/pull/10261

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-18 20:21:29 +00:00
Lukas Wirth
dc9257682c
Fix typo 2021-12-18 21:02:03 +01:00
bors[bot]
4c686721c0
Merge #11047
11047: internal: Prepare Code extension for bundling r=lnicola a=lnicola

CC #10483

This is slightly ugly, but we'll be able to clean it up after ripping the download parts (unless we decide to temporarily drop support for the nightlies).

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-18 18:32:20 +00:00