]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agointernal: perpare to remove ModuleData::default
Aleksey Kladov [Mon, 12 Jul 2021 17:02:56 +0000 (20:02 +0300)]
internal: perpare to remove ModuleData::default

3 years agointernal: remove erroneous Default impl for ModuleOrigin
Aleksey Kladov [Mon, 12 Jul 2021 17:00:17 +0000 (20:00 +0300)]
internal: remove erroneous Default impl for ModuleOrigin

In rust-analyzer, we avoid defualt impls for types which don't have
sensible, "empty" defaults. In particular, we avoid using invalid
indices for defaults and similar hacks.

3 years agoMerge #9179
bors[bot] [Mon, 12 Jul 2021 14:45:48 +0000 (14:45 +0000)]
Merge #9179

9179: Update npm deps r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #9579
bors[bot] [Mon, 12 Jul 2021 13:37:12 +0000 (13:37 +0000)]
Merge #9579

9579: fix: Set more `CARGO_` env vars r=jonas-schievink a=jonas-schievink

Set `CARGO_CRATE_NAME` to the package name, with `-` replaced by `_`. This is wrong, but better than not setting the variable at all.

Also set `CARGO_PKG_HOMEPAGE` since it's easy.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSet more `CARGO_` env vars
Jonas Schievink [Mon, 12 Jul 2021 13:34:49 +0000 (15:34 +0200)]
Set more `CARGO_` env vars

3 years agoMerge #9535
bors[bot] [Mon, 12 Jul 2021 13:23:26 +0000 (13:23 +0000)]
Merge #9535

9535: internal: remove proc macro management thread r=jonas-schievink a=jonas-schievink

Communication with the proc macro server process has always happened one request at a time, so the additional thread isn't really needed (it just forwarded each request, and sent back the response). This removes some indirection that was a bit hard to understand (a channel was allocated and sent over another channel to return the response).

Hope I'm not missing anything here

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAddress review comments
Jonas Schievink [Mon, 12 Jul 2021 13:19:53 +0000 (15:19 +0200)]
Address review comments

3 years agoMerge #9569
bors[bot] [Sun, 11 Jul 2021 14:28:08 +0000 (14:28 +0000)]
Merge #9569

9569: internal: Explicitly check for reference locals or fields in Name classification r=Veykril a=Veykril

Closes #7524
Inlines all the calls to reference related name classification as well as emits both goto definition targets for field shorthands.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9572
bors[bot] [Sun, 11 Jul 2021 14:19:25 +0000 (14:19 +0000)]
Merge #9572

9572: fix: Work around older synstructure derives r=lnicola a=flodiebold

Fixes #9562, until the proper fix rust-lang/chalk#717 works which requires mystor/synstructure#47 to be released.

Also add an unrelated test, for #9560.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoReturn both field and local references for shorthands in goto_def
Lukas Wirth [Sun, 11 Jul 2021 14:16:16 +0000 (16:16 +0200)]
Return both field and local references for shorthands in goto_def

3 years agoAdd test for #9560
Florian Diebold [Sun, 11 Jul 2021 14:14:22 +0000 (16:14 +0200)]
Add test for #9560

3 years agoAdd workaround for #9562
Florian Diebold [Sun, 11 Jul 2021 11:22:11 +0000 (13:22 +0200)]
Add workaround for #9562

This treats the consts generated by older synstructure versions like
unnamed consts. We should remove this at some point (at least after
Chalk has switched).

3 years agoInline name classification reference calls
Lukas Wirth [Sun, 11 Jul 2021 13:39:09 +0000 (15:39 +0200)]
Inline name classification reference calls

3 years agoExplicitly check for reference locals or fields in Name classification
Lukas Wirth [Sun, 11 Jul 2021 12:03:35 +0000 (14:03 +0200)]
Explicitly check for reference locals or fields in Name classification

3 years agoMerge #9567 #9568
bors[bot] [Sun, 11 Jul 2021 12:51:33 +0000 (12:51 +0000)]
Merge #9567 #9568

9567: remove unneded special case r=matklad a=matklad

bors r+
🤖

9568: feat: add 'for' postfix completion r=lnicola a=mahdi-frms

![Peek 2021-07-11 16-45](https://user-images.githubusercontent.com/62165556/125194692-a0aaf780-e267-11eb-952a-81de7955d9a1.gif)

adds #9561

used ```ele``` as identifier for each element in the iteration

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
3 years agointernal: remove one more needless extern crate
Aleksey Kladov [Sun, 11 Jul 2021 12:48:49 +0000 (15:48 +0300)]
internal: remove one more needless extern crate

3 years agoMerge #9570
bors[bot] [Sun, 11 Jul 2021 12:44:31 +0000 (12:44 +0000)]
Merge #9570

9570: minor: Simplify Semantics::type_of_expr_with_coercion r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSimplify Semantics::type_of_expr_with_coercion
Lukas Wirth [Sun, 11 Jul 2021 12:43:05 +0000 (14:43 +0200)]
Simplify Semantics::type_of_expr_with_coercion

3 years agoadd 'for' postfix completion
mahdi-frms [Sun, 11 Jul 2021 11:58:02 +0000 (16:28 +0430)]
add 'for' postfix completion

3 years agotypo
Aleksey Kladov [Sun, 11 Jul 2021 12:13:42 +0000 (15:13 +0300)]
typo

3 years agointernal: remove unused param
Aleksey Kladov [Sun, 11 Jul 2021 12:07:32 +0000 (15:07 +0300)]
internal: remove unused param

3 years agointernal: add a test for broken refactor
Aleksey Kladov [Sun, 11 Jul 2021 12:05:16 +0000 (15:05 +0300)]
internal: add a test for broken refactor

3 years agointernal: remove needless distinction between a carte and its root mod
Aleksey Kladov [Sun, 11 Jul 2021 11:55:24 +0000 (14:55 +0300)]
internal: remove needless distinction between a carte and its root mod

3 years agoMerge #9565
bors[bot] [Sun, 11 Jul 2021 11:41:51 +0000 (11:41 +0000)]
Merge #9565

9565: internal: document NameClass and NameRefClass r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: document NameClass and NameRefClass
Aleksey Kladov [Sun, 11 Jul 2021 11:39:25 +0000 (14:39 +0300)]
internal: document NameClass and NameRefClass

3 years agoMerge #9563
bors[bot] [Sun, 11 Jul 2021 11:07:56 +0000 (11:07 +0000)]
Merge #9563

9563: internal: move some presentation-specific concerns out of IDE crate r=Veykril a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoupdate tests
Aleksey Kladov [Sun, 11 Jul 2021 10:55:00 +0000 (13:55 +0300)]
update tests

3 years agodrop unused fields
Aleksey Kladov [Sun, 11 Jul 2021 10:51:52 +0000 (13:51 +0300)]
drop unused fields

3 years agosimplify
Aleksey Kladov [Sun, 11 Jul 2021 10:49:38 +0000 (13:49 +0300)]
simplify

3 years agodrop unused field
Aleksey Kladov [Sun, 11 Jul 2021 10:48:26 +0000 (13:48 +0300)]
drop unused field

3 years agosimplify
Aleksey Kladov [Sun, 11 Jul 2021 10:45:58 +0000 (13:45 +0300)]
simplify

3 years agobe explicit about what we *can't* debug
Aleksey Kladov [Sun, 11 Jul 2021 10:44:28 +0000 (13:44 +0300)]
be explicit about what we *can't* debug

3 years agobetter name
Aleksey Kladov [Sun, 11 Jul 2021 10:43:43 +0000 (13:43 +0300)]
better name

3 years agoLet the client care about presentation
Aleksey Kladov [Sun, 11 Jul 2021 10:42:19 +0000 (13:42 +0300)]
Let the client care about presentation

3 years agoprepare to move run/debug splitting to handlers
Aleksey Kladov [Sun, 11 Jul 2021 10:34:22 +0000 (13:34 +0300)]
prepare to move run/debug splitting to handlers

3 years agoMerge #9449
bors[bot] [Sun, 11 Jul 2021 09:37:33 +0000 (09:37 +0000)]
Merge #9449

9449: feat: Emit test names in `Run test` runnables if they come from a macro expansion r=matklad a=Veykril

Fixes #8964
Before:
![Code_D1Tu5Iuh5I](https://user-images.githubusercontent.com/3757771/124174685-f552b380-daac-11eb-9086-c97db014b77c.png)
After:
![image](https://user-images.githubusercontent.com/3757771/124174493-bb81ad00-daac-11eb-96c7-3de6545a62e1.png)

Basically when a macro emits more than one test we name the test functions/modules name in the runnable instead to not emit a bunch of equally named `Run Test` annotations which don't really tell much.

Note that the `Run fibonacci_test Tests` line is below the attributes due to the fact that the function name span is being reused for the generated module in rstest's expansion.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9557
bors[bot] [Sat, 10 Jul 2021 17:25:16 +0000 (17:25 +0000)]
Merge #9557

9557: fix: Respect coercions in `inline_call` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRespect coercions in `inline_call`
Lukas Wirth [Sat, 10 Jul 2021 17:16:32 +0000 (19:16 +0200)]
Respect coercions in `inline_call`

3 years agoExpose coercions for patterns and expressions in semantics
Lukas Wirth [Sat, 10 Jul 2021 17:03:46 +0000 (19:03 +0200)]
Expose coercions for patterns and expressions in semantics

3 years agoMerge #9552
bors[bot] [Sat, 10 Jul 2021 16:25:58 +0000 (16:25 +0000)]
Merge #9552

9552: internal: `add_explicit_type` respects coercions r=Veykril a=Veykril

or so I'd like to say but there is one odd case here where it doesn't work(see [review](https://github.com/rust-analyzer/rust-analyzer/pull/9552#discussion_r667351856))

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years ago`add_explicit_type` respects coercions
Lukas Wirth [Sat, 10 Jul 2021 16:19:46 +0000 (18:19 +0200)]
`add_explicit_type` respects coercions

3 years agoResolve type adjustments
Lukas Wirth [Sat, 10 Jul 2021 16:19:23 +0000 (18:19 +0200)]
Resolve type adjustments

3 years agoMerge #9553
bors[bot] [Sat, 10 Jul 2021 16:07:01 +0000 (16:07 +0000)]
Merge #9553

9553: minor: Disambiguate replace with if let assist labels r=Veykril a=Veykril

Turns out we have two assists for replacing something with `if let` constructs, so having the cursor on a `let` keyword inside a match gave you two identical assist labels which is rather confusing.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDisambiguate replace with if let assist labels
Lukas Wirth [Sat, 10 Jul 2021 15:41:25 +0000 (17:41 +0200)]
Disambiguate replace with if let assist labels

3 years agoMerge #9555 #9556
bors[bot] [Sat, 10 Jul 2021 15:59:26 +0000 (15:59 +0000)]
Merge #9555 #9556

9555: feat: Enable `auto_import` on ident patterns r=Veykril a=Veykril

Helpful for when you want to import a type in a pattern right before destructuring it.

9556: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBump chalk
Laurențiu Nicola [Sat, 10 Jul 2021 15:56:56 +0000 (18:56 +0300)]
Bump chalk

3 years agoBump rustc_lexer a little
Laurențiu Nicola [Sat, 10 Jul 2021 15:51:35 +0000 (18:51 +0300)]
Bump rustc_lexer a little

3 years agoEnable `auto_import` on ident patterns
Lukas Wirth [Sat, 10 Jul 2021 15:57:33 +0000 (17:57 +0200)]
Enable `auto_import` on ident patterns

3 years agoBump deps
Laurențiu Nicola [Sat, 10 Jul 2021 15:38:41 +0000 (18:38 +0300)]
Bump deps

3 years agoRemove unnecessary .vscodeignore entry
Laurențiu Nicola [Sat, 10 Jul 2021 15:37:19 +0000 (18:37 +0300)]
Remove unnecessary .vscodeignore entry

3 years agoUpdate eslint
Laurențiu Nicola [Sat, 10 Jul 2021 15:34:48 +0000 (18:34 +0300)]
Update eslint

3 years agoUpdate vsce
Laurențiu Nicola [Sat, 10 Jul 2021 15:32:31 +0000 (18:32 +0300)]
Update vsce

3 years agoUpdate vscode
Laurențiu Nicola [Sat, 10 Jul 2021 15:31:42 +0000 (18:31 +0300)]
Update vscode

3 years agoUpdate @types/node
Laurențiu Nicola [Sat, 10 Jul 2021 15:31:33 +0000 (18:31 +0300)]
Update @types/node

3 years agoUpdate @types/node-fetch
Laurențiu Nicola [Sat, 10 Jul 2021 15:28:32 +0000 (18:28 +0300)]
Update @types/node-fetch

3 years agoUpdate tslib
Laurențiu Nicola [Sat, 10 Jul 2021 15:26:06 +0000 (18:26 +0300)]
Update tslib

3 years agoUpdate typescript
Laurențiu Nicola [Sat, 10 Jul 2021 15:25:53 +0000 (18:25 +0300)]
Update typescript

3 years agoUpdate mocha
Laurențiu Nicola [Sat, 10 Jul 2021 15:23:32 +0000 (18:23 +0300)]
Update mocha

3 years agoUpdate npm packages
Laurențiu Nicola [Tue, 8 Jun 2021 14:02:41 +0000 (17:02 +0300)]
Update npm packages

3 years agoUpdate vsce
Laurențiu Nicola [Tue, 8 Jun 2021 14:01:46 +0000 (17:01 +0300)]
Update vsce

3 years agoMake .vscodeignore more strict
Laurențiu Nicola [Tue, 8 Jun 2021 13:59:37 +0000 (16:59 +0300)]
Make .vscodeignore more strict

3 years agoSet output.exports to make rollup happy
Laurențiu Nicola [Tue, 8 Jun 2021 13:58:45 +0000 (16:58 +0300)]
Set output.exports to make rollup happy

3 years agoUpdate vsce a little
Laurențiu Nicola [Tue, 8 Jun 2021 13:29:35 +0000 (16:29 +0300)]
Update vsce a little

3 years agoUpdate plugin-node-resolve
Laurențiu Nicola [Tue, 8 Jun 2021 13:09:07 +0000 (16:09 +0300)]
Update plugin-node-resolve

3 years agoUpdate typescript
Laurențiu Nicola [Tue, 8 Jun 2021 13:08:14 +0000 (16:08 +0300)]
Update typescript

3 years agoUpdate eslint some more
Laurențiu Nicola [Tue, 8 Jun 2021 13:05:04 +0000 (16:05 +0300)]
Update eslint some more

3 years agoUpdate rollup
Laurențiu Nicola [Tue, 8 Jun 2021 13:04:03 +0000 (16:04 +0300)]
Update rollup

3 years agoUpdate eslint plugins
Laurențiu Nicola [Tue, 8 Jun 2021 13:03:05 +0000 (16:03 +0300)]
Update eslint plugins

3 years agoUpdate eslint
Laurențiu Nicola [Tue, 8 Jun 2021 13:01:34 +0000 (16:01 +0300)]
Update eslint

3 years agoUpdate @types/node
Laurențiu Nicola [Tue, 8 Jun 2021 12:59:52 +0000 (15:59 +0300)]
Update @types/node

3 years agoMerge #9551
bors[bot] [Sat, 10 Jul 2021 15:04:15 +0000 (15:04 +0000)]
Merge #9551

9551: fix: `replace_qualified_name_with_use` keeps qualifier for import r=Veykril a=Veykril

Fixes #9537, #9540
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years ago`replace_qualified_name_with_use` keeps qualifier for import
Lukas Wirth [Sat, 10 Jul 2021 15:03:24 +0000 (17:03 +0200)]
`replace_qualified_name_with_use` keeps qualifier for import

3 years agoMerge #9548
bors[bot] [Sat, 10 Jul 2021 11:39:13 +0000 (11:39 +0000)]
Merge #9548

9548: add: Adding self keyword completion in complete_fn_param r=lnicola a=feniljain

Solves #9522

I haven't added Arc<self> for now as there were some conflicting opinions on it

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
3 years agoadd: Adding self keyword completion in complete_fn_param
vi_mi [Sat, 10 Jul 2021 09:42:16 +0000 (15:12 +0530)]
add: Adding self keyword completion in complete_fn_param

3 years agoMerge #9545
bors[bot] [Sat, 10 Jul 2021 10:27:16 +0000 (10:27 +0000)]
Merge #9545

9545: Record autoderef adjustments r=flodiebold a=Veykril

cc #9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRecord autoderef adjustments
Lukas Wirth [Fri, 9 Jul 2021 17:12:56 +0000 (19:12 +0200)]
Record autoderef adjustments

3 years agoMerge #9542
bors[bot] [Fri, 9 Jul 2021 15:09:44 +0000 (15:09 +0000)]
Merge #9542

9542: cargo_metadata 0.14 r=matklad a=kjeremy

Removes the following dependent crates:
* semver-parser
* pest
* ucd-trie

Removes project_model's dependency on itertools

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo_metadata 0.14
kjeremy [Fri, 9 Jul 2021 15:01:55 +0000 (11:01 -0400)]
cargo_metadata 0.14

Removes the following dependent crates:
* semver-parser
* pest
* ucd-trie

Removes project_model's dependency on itertools

3 years agoMerge #9541
bors[bot] [Fri, 9 Jul 2021 14:42:39 +0000 (14:42 +0000)]
Merge #9541

9541: Adding async keyword when await is present in generate_function assist r=feniljain a=feniljain

Solves #9394

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
3 years agofix: Adding async keyword when await is present in generate_function assist
vi_mi [Fri, 9 Jul 2021 13:48:22 +0000 (19:18 +0530)]
fix: Adding async keyword when await is present in generate_function assist

3 years agoMerge #9512
bors[bot] [Fri, 9 Jul 2021 14:07:23 +0000 (14:07 +0000)]
Merge #9512

9512: Record coercion adjustments r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUse `CoerceMany` in `BreakableContext`
Lukas Wirth [Fri, 9 Jul 2021 12:56:49 +0000 (14:56 +0200)]
Use `CoerceMany` in `BreakableContext`

3 years agoEmit test name in Run test runnables if it comes from a macro expansion
Lukas Wirth [Thu, 1 Jul 2021 18:40:31 +0000 (20:40 +0200)]
Emit test name in Run test runnables if it comes from a macro expansion

3 years agoMerge #9536
bors[bot] [Thu, 8 Jul 2021 19:41:03 +0000 (19:41 +0000)]
Merge #9536

9536: Represent opaque types with TyKind::OpaqueType r=flodiebold a=flodiebold

... instead of using `AliasTy`. Chalk turns the alias type into the
placeholder during unification anyway, which confuses our method
resolution logic.

Fixes #9530.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoRepresent opaque types with TyKind::OpaqueType
Florian Diebold [Thu, 8 Jul 2021 19:19:53 +0000 (21:19 +0200)]
Represent opaque types with TyKind::OpaqueType

... instead of using `AliasTy`. Chalk turns the alias type into the
placeholder during unification anyway, which confuses our method
resolution logic.

Fixes #9530.

3 years agoUse `#[derive(Debug)]`
Jonas Schievink [Thu, 8 Jul 2021 15:10:35 +0000 (17:10 +0200)]
Use `#[derive(Debug)]`

3 years agoRemove proc macro management thread
Jonas Schievink [Thu, 8 Jul 2021 14:40:14 +0000 (16:40 +0200)]
Remove proc macro management thread

3 years agoMerge #9534
bors[bot] [Thu, 8 Jul 2021 14:19:06 +0000 (14:19 +0000)]
Merge #9534

9534: minor: one more usless type r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: one more usless type
Aleksey Kladov [Thu, 8 Jul 2021 14:18:44 +0000 (17:18 +0300)]
minor: one more usless type

3 years agoMerge #9533
bors[bot] [Thu, 8 Jul 2021 13:51:27 +0000 (13:51 +0000)]
Merge #9533

9533: minor: Update list of safe intrinsics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUpdate list of safe intrinsics
Lukas Wirth [Thu, 8 Jul 2021 13:49:39 +0000 (15:49 +0200)]
Update list of safe intrinsics

3 years agoMerge #9532
bors[bot] [Thu, 8 Jul 2021 13:05:54 +0000 (13:05 +0000)]
Merge #9532

9532: Shorten thread names r=lnicola a=weirdsmiley

Threads on Linux have an upper limit of 16 characters, hence dropping `Thread` from their names.

Co-authored-by: Manas <manas18244@iiitd.ac.in>
3 years agoAdd some more adjustment test annotations
Lukas Wirth [Thu, 8 Jul 2021 13:03:57 +0000 (15:03 +0200)]
Add some more adjustment test annotations

3 years agoThis patch shortens the spawned threads' names, as threads on Linux
Manas [Thu, 8 Jul 2021 12:39:41 +0000 (18:09 +0530)]
This patch shortens the spawned threads' names, as threads on Linux
have an upper limit of 16 characters for their names.

3 years agoCopy some comments from rustc
Lukas Wirth [Thu, 8 Jul 2021 12:31:16 +0000 (14:31 +0200)]
Copy some comments from rustc

3 years agoMinor cleanup
Lukas Wirth [Thu, 8 Jul 2021 12:27:54 +0000 (14:27 +0200)]
Minor cleanup

3 years agoImplement `CoerceMany`
Lukas Wirth [Thu, 8 Jul 2021 12:16:23 +0000 (14:16 +0200)]
Implement `CoerceMany`

3 years agoRecord coercion adjustments
Lukas Wirth [Tue, 6 Jul 2021 16:05:40 +0000 (18:05 +0200)]
Record coercion adjustments

3 years agoMerge #9529
bors[bot] [Thu, 8 Jul 2021 09:55:27 +0000 (09:55 +0000)]
Merge #9529

9529: fix: Don't unify arrays with their elements r=flodiebold a=lnicola

Addresses https://github.com/rust-analyzer/rust-analyzer/pull/9526#issuecomment-876206100.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoDon't unify array elements with their arrays
Laurențiu Nicola [Thu, 8 Jul 2021 08:22:29 +0000 (11:22 +0300)]
Don't unify array elements with their arrays