]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agosimplify
Lukas Wirth [Thu, 27 May 2021 01:47:20 +0000 (03:47 +0200)]
simplify

3 years agosimplify
Lukas Wirth [Thu, 27 May 2021 01:01:46 +0000 (03:01 +0200)]
simplify

3 years agoCollapse more CompletionContext booleans into enums
Lukas Wirth [Thu, 27 May 2021 00:54:49 +0000 (02:54 +0200)]
Collapse more CompletionContext booleans into enums

3 years agoMerge #9017
bors[bot] [Wed, 26 May 2021 23:06:59 +0000 (23:06 +0000)]
Merge #9017

9017: internal: Reduce the number of traits passed through chalk during applicable trait lookup r=SomeoneToIgnore a=SomeoneToIgnore

Inherent traits can be omitted before trait solving, presumably slightly helping https://github.com/rust-analyzer/rust-analyzer/issues/7542 and slightly simplifying the code.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoExclude inherent traits more eagerly
Kirill Bulatov [Wed, 26 May 2021 23:00:23 +0000 (02:00 +0300)]
Exclude inherent traits more eagerly

3 years agoMerge #9016
bors[bot] [Wed, 26 May 2021 21:49:06 +0000 (21:49 +0000)]
Merge #9016

9016: Set `record_pat_syntax` more precisely in CompletionContext r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSet `record_pat_syntax` more precisely in CompletionContext
Lukas Wirth [Wed, 26 May 2021 21:46:00 +0000 (23:46 +0200)]
Set `record_pat_syntax` more precisely in CompletionContext

3 years agoMerge #8995
bors[bot] [Wed, 26 May 2021 20:58:07 +0000 (20:58 +0000)]
Merge #8995

8995: fix: Create tasks for all workspaces r=matklad a=SomeoneToIgnore

Follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/8955#discussion_r637897170

Before:
<img width="593" alt="image" src="https://user-images.githubusercontent.com/2690773/119575267-712b5300-bdbf-11eb-833c-f688f7a7dd0f.png">

After:
<img width="643" alt="image" src="https://user-images.githubusercontent.com/2690773/119575273-74264380-bdbf-11eb-8283-a78bbcb7346e.png">

This is the first time I've used multiple workspaces feature in VSCode, but so far looks like
* opening detached files works
* run and debug lens work
* Rust Analyzer: Run action works
* run task works and now shows tasks for all workspaces
* there are no platform-specific changes involved

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoMerge #9015
bors[bot] [Wed, 26 May 2021 20:43:53 +0000 (20:43 +0000)]
Merge #9015

9015: Merge pattern completion related bools into an enum r=Veykril a=Veykril

The two bools can never both be set so this is basically just a tri-state enum.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge pattern completion related bools into an enum
Lukas Wirth [Wed, 26 May 2021 20:39:47 +0000 (22:39 +0200)]
Merge pattern completion related bools into an enum

3 years agoMerge #9012
bors[bot] [Wed, 26 May 2021 20:29:52 +0000 (20:29 +0000)]
Merge #9012

9012: feat: add tab stops for keyword completions r=matklad a=eduardocanellas

Add tab stops for all the keywords that I judged fit. I also introduced some line breaks and spaces, following the pattern I saw in the `postfix` module.

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
3 years agoMerge #9014
bors[bot] [Wed, 26 May 2021 19:11:47 +0000 (19:11 +0000)]
Merge #9014

9014: simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agosimplify
Lukas Wirth [Wed, 26 May 2021 19:09:27 +0000 (21:09 +0200)]
simplify

3 years agofeat: add tab stops for keyword completions
Eduardo Canellas [Wed, 26 May 2021 17:24:54 +0000 (14:24 -0300)]
feat: add tab stops for keyword completions

3 years agoMerge #9008
bors[bot] [Wed, 26 May 2021 17:04:09 +0000 (17:04 +0000)]
Merge #9008

9008: fix: remove undesired completions from trait/impl blocks r=Veykril a=eduardocanellas

Related to #8518

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
3 years agofix: remove undesired completions from trait/impl blocks
Eduardo Canellas [Wed, 26 May 2021 16:21:27 +0000 (13:21 -0300)]
fix: remove undesired completions from trait/impl blocks

3 years agoMerge #9007
bors[bot] [Wed, 26 May 2021 15:36:14 +0000 (15:36 +0000)]
Merge #9007

9007: Internal: `clippy::redundant_clone` fixes r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoclippy::redundant_clone fixes
Laurențiu Nicola [Wed, 26 May 2021 15:34:50 +0000 (18:34 +0300)]
clippy::redundant_clone fixes

3 years agoMerge #9003
bors[bot] [Wed, 26 May 2021 12:08:56 +0000 (12:08 +0000)]
Merge #9003

9003: minor: Document semantic token modifiers r=Veykril a=Veykril

Part of #6457

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDocument semantic token modifiers
Lukas Wirth [Wed, 26 May 2021 11:29:00 +0000 (13:29 +0200)]
Document semantic token modifiers

3 years agoMerge #9002
bors[bot] [Wed, 26 May 2021 10:26:19 +0000 (10:26 +0000)]
Merge #9002

9002: Move annotations below item attributes r=Veykril a=Veykril

This moves annotations/code lenses below attributes in items, bringing them inline with functions where this is already the case. This is done by changing the annotations covering range to just the name node's range which is also more inline with what the lsp expects which is that the range should ideally only cover a single line.

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMove annotations below item attributes
Lukas Wirth [Wed, 26 May 2021 10:23:51 +0000 (12:23 +0200)]
Move annotations below item attributes

3 years agoMerge #9001
bors[bot] [Wed, 26 May 2021 10:04:37 +0000 (10:04 +0000)]
Merge #9001

9001: minor: explicitly set the focus to false r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: explicitly set the focus to false
Aleksey Kladov [Wed, 26 May 2021 10:04:01 +0000 (13:04 +0300)]
minor: explicitly set the focus to false

3 years agoMerge #8996
bors[bot] [Tue, 25 May 2021 23:28:02 +0000 (23:28 +0000)]
Merge #8996

8996: Fix bug where library functions were not highlighted as such r=arzg a=arzg

Sorry about forgetting to test this in my last PR.

Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
3 years agoFix bug where library functions were not highlighted as such
Aramis Razzaghipour [Tue, 25 May 2021 23:12:59 +0000 (09:12 +1000)]
Fix bug where library functions were not highlighted as such

3 years agoCreate tasks for all workspaces
Kirill Bulatov [Tue, 25 May 2021 22:11:52 +0000 (01:11 +0300)]
Create tasks for all workspaces

3 years agoMerge #8973
bors[bot] [Tue, 25 May 2021 20:33:21 +0000 (20:33 +0000)]
Merge #8973

8973: internal: move diagnostics to hir r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #8993
bors[bot] [Tue, 25 May 2021 19:58:49 +0000 (19:58 +0000)]
Merge #8993

8993: fix: don't show pd/ppd completions where it shouldn't be r=flodiebold a=eduardocanellas

Closes #8992

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
3 years agoMerge #8994
bors[bot] [Tue, 25 May 2021 16:40:57 +0000 (16:40 +0000)]
Merge #8994

8994: Check for subdirs in vfs loader exclusions. r=matklad a=ammkrn

The current logic used to transfer global_excludes into vfs exclusions
only transfers global_excludes that are the parent of an item in
dirs.include.
This commit additionally adds an item from global_exclude to the vfs
exclusions if the global_exclude is a child of an included item.

Co-authored-by: ammkrn <ammkrn@tuta.io>
3 years agoCheck for subdirs in vfs loader exclusions.
ammkrn [Tue, 25 May 2021 15:07:01 +0000 (10:07 -0500)]
Check for subdirs in vfs loader exclusions.

The current logic used to transfer global_excludes into vfs exclusions
only transfers global_excludes that are the parent of an item in
dirs.include.
This commit additionally adds an item from global_exclude to the vfs
exclusions if the global_exclude is a child of an included item.

3 years agofix: don't show pd/ppd completions where it shouldn't be
Eduardo Canellas [Tue, 25 May 2021 14:42:16 +0000 (11:42 -0300)]
fix: don't show pd/ppd completions where it shouldn't be

3 years agointernal: move diagnostics to hir
Aleksey Kladov [Sun, 23 May 2021 20:31:59 +0000 (23:31 +0300)]
internal: move diagnostics to hir

The idea here is to eventually get rid of `dyn Diagnostic` and
`DiagnosticSink` infrastructure altogether, and just have a `enum
hir::Diagnostic` instead.

The problem with `dyn Diagnostic` is that it is defined in the lowest
level of the stack (hir_expand), but is used by the highest level (ide).

As a first step, we free hir_expand and hir_def from `dyn Diagnostic`
and kick the can up to `hir_ty`, as an intermediate state. The plan is
then to move DiagnosticSink similarly to the hir crate, and, as final
third step, remove its usage from the ide.

One currently unsolved problem is testing. You can notice that the test
which checks precise diagnostic ranges, unresolved_import_in_use_tree,
was moved to the ide layer. Logically, only IDE should have the infra to
render a specific range.

At the same time, the range is determined with the data produced in
hir_def and hir crates, so this layering is rather unfortunate. Working
on hir_def shouldn't require compiling `ide` for testing.

3 years agoMerge #8991
bors[bot] [Tue, 25 May 2021 14:47:46 +0000 (14:47 +0000)]
Merge #8991

8991: Consider trait to be in scope for trait-impls r=Veykril a=Veykril

Fixes #8912
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoConsider trait to be in scope for trait-impl
Lukas Wirth [Tue, 25 May 2021 14:08:18 +0000 (16:08 +0200)]
Consider trait to be in scope for trait-impl

3 years agoMerge #8990
bors[bot] [Tue, 25 May 2021 13:33:07 +0000 (13:33 +0000)]
Merge #8990

8990: feat: Also do goto implementation on assoc consts r=lnicola a=lf-

I forgot to put this into #8988, sorry.

Goto implementation on a const on the trait will go to the
implementations with their respective definitions of the const, if
present.

Co-authored-by: Jade <software@lfcode.ca>
3 years agoAlso do goto implementation on assoc consts
Jade [Tue, 25 May 2021 13:27:41 +0000 (06:27 -0700)]
Also do goto implementation on assoc consts

I forgot to put this into #8988, sorry.

Goto implementation on a const on the trait will go to the
implementations with their respective definitions of the const, if
present.

3 years agoMerge #8987
bors[bot] [Tue, 25 May 2021 13:25:15 +0000 (13:25 +0000)]
Merge #8987

8987: Fix lowering of FnOnce() without return type r=flodiebold a=flodiebold

This should result in an implicit `-> ()`, not leaving out the binding.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoHide `-> ()` in Fn traits
Florian Diebold [Tue, 25 May 2021 13:23:52 +0000 (15:23 +0200)]
Hide `-> ()` in Fn traits

3 years agoMerge #8988
bors[bot] [Tue, 25 May 2021 13:14:34 +0000 (13:14 +0000)]
Merge #8988

8988: feat: go to implementation on trait functions r=matklad a=lf-

Fix #8537.

GIF:
![output](https://user-images.githubusercontent.com/6652840/119501981-45a45c00-bd1e-11eb-8336-9145f2888643.gif)

Co-authored-by: Jade <software@lfcode.ca>
3 years agoMerge #8989
bors[bot] [Tue, 25 May 2021 13:02:31 +0000 (13:02 +0000)]
Merge #8989

8989: fix: Fix type inference not working for new Try trait r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix type inference not working for new Try trait
Lukas Wirth [Tue, 25 May 2021 12:59:54 +0000 (14:59 +0200)]
Fix type inference not working for new Try trait

3 years agofeat: go to implementation on trait functions
Jade [Tue, 25 May 2021 12:46:15 +0000 (05:46 -0700)]
feat: go to implementation on trait functions

Fix #8537.

GIF:
https://user-images.githubusercontent.com/6652840/119501981-45a45c00-bd1e-11eb-8336-9145f2888643.gif

3 years agoFix lowering of FnOnce() without return type
Florian Diebold [Tue, 25 May 2021 12:24:08 +0000 (14:24 +0200)]
Fix lowering of FnOnce() without return type

This should result in an implicit `-> ()`, not leaving out the binding.

3 years agoMerge #8767
bors[bot] [Tue, 25 May 2021 12:15:48 +0000 (12:15 +0000)]
Merge #8767

8767: implement range formatting r=matklad a=euclio

Fixes #7580.

This PR implements the `textDocument/rangeFormatting` request using `rustfmt`'s `--file-lines` option.

Still needs some tests. What I want to know is how I should handle the instability of the `--file-lines` option. It's still unstable in rustfmt, so it's only available on nightly, and needs a special flag to enable. Is there a way for `rust-analyzer` to detect if it's using nightly rustfmt, or for users to opt-in?

Co-authored-by: Andy Russell <arussell123@gmail.com>
3 years agoMerge #8986
bors[bot] [Tue, 25 May 2021 11:25:00 +0000 (11:25 +0000)]
Merge #8986

8986: Add go to type definition for struct fields within struct r=matklad a=lf-

Example:

```rust
struct A;

struct B {
    a/*<- cursor*/: A,
}
```

Go to type definition used to not work on this position. It now goes to
`A` as expected.

Co-authored-by: Jade <software@lfcode.ca>
3 years agoMerge #8985
bors[bot] [Tue, 25 May 2021 11:07:50 +0000 (11:07 +0000)]
Merge #8985

8985: minor: Minor test fixes / new tests r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoMinor test fixes / new tests
Florian Diebold [Tue, 25 May 2021 11:03:54 +0000 (13:03 +0200)]
Minor test fixes / new tests

3 years agoAdd go to type definition for struct fields within struct
Jade [Tue, 25 May 2021 11:06:54 +0000 (04:06 -0700)]
Add go to type definition for struct fields within struct

Example:

```rust
struct A;

struct B {
    a/*<- cursor*/: A,
}
```

Go to type definition used to not work on this position. It now goes to
`A` as expected.

3 years agoMerge #8983
bors[bot] [Tue, 25 May 2021 09:21:46 +0000 (09:21 +0000)]
Merge #8983

8983: Fix type mismatch caused by macros r=flodiebold a=flodiebold

MacroStmts should be completely transparent, but it prevented
coercion. (I should maybe give `infer_expr` and `infer_expr_inner`
better names.)

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoFix type mismatch caused by macros
Florian Diebold [Tue, 25 May 2021 09:15:02 +0000 (11:15 +0200)]
Fix type mismatch caused by macros

MacroStmts should be completely transparent, but it prevented
coercion. (I should maybe give `infer_expr` and `infer_expr_inner`
better names.)

3 years agoMerge #8942
bors[bot] [Tue, 25 May 2021 02:30:47 +0000 (02:30 +0000)]
Merge #8942

8942: Add `library` semantic token modifier to items from other crates r=arzg a=arzg

Closes #5772.

A lot of code here is pretty repetitive; please let me know if you have any ideas how to improve it, or whether it’s fine as-is.

Side-note: How can I add tests for this? I don’t see a way for the test Rust code in `test_highlighting` to reference other crates to observe the new behaviour.

Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
3 years agoRefactor application of `library` semantic token modifier
Aramis Razzaghipour [Mon, 24 May 2021 22:50:54 +0000 (08:50 +1000)]
Refactor application of `library` semantic token modifier

3 years agoMerge #8979
bors[bot] [Mon, 24 May 2021 22:58:43 +0000 (22:58 +0000)]
Merge #8979

8979: minor: update `CrateGraph` comment r=jonas-schievink a=jonas-schievink

`cfg` flags are now implemented, and crates *may* have names, it doesn't
doesn't matter for name resolution

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUpdate `CrateGraph` comment
Jonas Schievink [Mon, 24 May 2021 22:56:19 +0000 (00:56 +0200)]
Update `CrateGraph` comment

`cfg` flags are now implemented, and crates *may* have names, it doesn't
doesn't matter for name resolution

3 years agoMerge #8978
bors[bot] [Mon, 24 May 2021 22:51:57 +0000 (22:51 +0000)]
Merge #8978

8978: internal: intern `AttrInput` r=jonas-schievink a=jonas-schievink

saves ~10 MB on r-a

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agointernal: intern `AttrInput`
Jonas Schievink [Mon, 24 May 2021 22:50:19 +0000 (00:50 +0200)]
internal: intern `AttrInput`

3 years agoMerge #8975
bors[bot] [Mon, 24 May 2021 19:59:51 +0000 (19:59 +0000)]
Merge #8975

8975: Use todo!() as placeholder body for generated match arms r=matklad a=jDomantas

`todo!()` seems to be a better fit for this than `{}`. Seeing that this assist predates stabilization of `todo` my guess is that simply no one bothered to change it yet.

Also fixed the issue where if the last arm was not block-like, rust-analyzer would not add a comma after it and would generate invalid code.

Co-authored-by: Domantas Jadenkus <djadenkus@gmail.com>
3 years agoMerge #8977
bors[bot] [Mon, 24 May 2021 19:52:01 +0000 (19:52 +0000)]
Merge #8977

8977: internal: minor `TokenMap` cleanups r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFixup
Jonas Schievink [Mon, 24 May 2021 19:47:01 +0000 (21:47 +0200)]
Fixup

3 years agoMerge #8976
bors[bot] [Mon, 24 May 2021 19:22:34 +0000 (19:22 +0000)]
Merge #8976

8976: internal: rename hypothetical -> speculative r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: rename hypothetical -> speculative
Aleksey Kladov [Mon, 24 May 2021 19:21:25 +0000 (22:21 +0300)]
internal: rename hypothetical -> speculative

Lets steal this good naming from Roslyn before I forget about it yet
again.

3 years agoadd test that it does not create extraneous commas
Domantas Jadenkus [Mon, 24 May 2021 19:01:26 +0000 (22:01 +0300)]
add test that it does not create extraneous commas

3 years agotidy
Domantas Jadenkus [Mon, 24 May 2021 18:53:58 +0000 (21:53 +0300)]
tidy

3 years agogenerate match arms with todo!() as placeholder body
Domantas Jadenkus [Mon, 24 May 2021 18:53:42 +0000 (21:53 +0300)]
generate match arms with todo!() as placeholder body

3 years agoMake `TokenTextRange` private
Jonas Schievink [Mon, 24 May 2021 18:29:48 +0000 (20:29 +0200)]
Make `TokenTextRange` private

3 years agoMove `TokenMap` to its own file
Jonas Schievink [Mon, 24 May 2021 16:43:42 +0000 (18:43 +0200)]
Move `TokenMap` to its own file

3 years agoMerge #8970
bors[bot] [Mon, 24 May 2021 16:38:15 +0000 (16:38 +0000)]
Merge #8970

8970: fix: duplicate dependencies that have multiple DepKinds r=jonas-schievink a=jonas-schievink

Cargo collapses identical dependencies that are listed under `[dependencies]` and `[build-dependencies]` into a single `NodeDep`. We have to undo that by duplicating the dependency for each of its listed `DepKind`s.

Not doing that would incorrectly treat a dependency as `DepKind::Normal`, even though it is *also* meant to be a `DepKind::Build`.

Fixes https://github.com/rust-analyzer/rust-analyzer/pull/8812#issuecomment-847125395

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoDuplicate dependencies that have multiple DepKinds
Jonas Schievink [Mon, 24 May 2021 16:31:43 +0000 (18:31 +0200)]
Duplicate dependencies that have multiple DepKinds

3 years agoMerge #8967
bors[bot] [Mon, 24 May 2021 16:28:28 +0000 (16:28 +0000)]
Merge #8967

8967: fix cursor position after item move command r=matklad a=eduardocanellas

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
3 years agofix: cursor position after item move command
Eduardo Canellas [Mon, 24 May 2021 16:09:26 +0000 (13:09 -0300)]
fix: cursor position after item move command

closes Item movers need some fixes #8492

3 years agoMerge #8963
bors[bot] [Mon, 24 May 2021 15:34:52 +0000 (15:34 +0000)]
Merge #8963

8963: Bump deps r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoUpdate test fixtures
Laurențiu Nicola [Mon, 24 May 2021 13:59:06 +0000 (16:59 +0300)]
Update test fixtures

3 years agoMerge #8969
bors[bot] [Mon, 24 May 2021 14:58:06 +0000 (14:58 +0000)]
Merge #8969

8969: fix: Update download instructions r=cschmatzler a=lnicola

Closes #8966

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoUpdate download instructions
Laurențiu Nicola [Mon, 24 May 2021 14:48:15 +0000 (17:48 +0300)]
Update download instructions

3 years agoMerge #8968
bors[bot] [Mon, 24 May 2021 14:41:49 +0000 (14:41 +0000)]
Merge #8968

8968: docs: fix binary installation instructions r=matklad a=cschmatzler

fixes #8966

Co-authored-by: Christoph Schmatzler <christoph@schmatzler.name>
3 years agodocs: fix binary installation instructions
Christoph Schmatzler [Mon, 24 May 2021 14:38:33 +0000 (16:38 +0200)]
docs: fix binary installation instructions

issue #8926 removed uncompressed release artifacts. This updates the documentation to update instructions accordingly.

3 years agoMerge #8965
bors[bot] [Mon, 24 May 2021 13:58:44 +0000 (13:58 +0000)]
Merge #8965

8965: internal: intern `TypeBound` and `GenericArgs` r=jonas-schievink a=jonas-schievink

Saves a few MB, but not much

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoBump rustc_lexer
Laurențiu Nicola [Mon, 24 May 2021 13:39:19 +0000 (16:39 +0300)]
Bump rustc_lexer

3 years agoDisable `unaliged` feature of `object`
Laurențiu Nicola [Mon, 24 May 2021 13:35:52 +0000 (16:35 +0300)]
Disable `unaliged` feature of `object`

3 years agoIntern `GenericArgs`
Jonas Schievink [Mon, 24 May 2021 13:35:46 +0000 (15:35 +0200)]
Intern `GenericArgs`

This shaves off another ~4 mb or so

3 years agoBump object
Laurențiu Nicola [Mon, 24 May 2021 13:35:23 +0000 (16:35 +0300)]
Bump object

3 years agoBump misc deps
Laurențiu Nicola [Mon, 24 May 2021 13:31:54 +0000 (16:31 +0300)]
Bump misc deps

3 years agoBump chalk
Laurențiu Nicola [Mon, 24 May 2021 13:27:24 +0000 (16:27 +0300)]
Bump chalk

3 years agointernal: intern `TypeBound`s
Jonas Schievink [Mon, 24 May 2021 13:13:23 +0000 (15:13 +0200)]
internal: intern `TypeBound`s

Doesn't save much memory (~2 mb), but interning things is generally a
good pattern to follow

3 years agoMerge #8955
bors[bot] [Mon, 24 May 2021 12:40:25 +0000 (12:40 +0000)]
Merge #8955

8955: feature: Support standalone Rust files r=matklad a=SomeoneToIgnore

![standalone](https://user-images.githubusercontent.com/2690773/119277037-0b579380-bc26-11eb-8d77-20d46ab4916a.gif)

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

Caveats:

* I've decided to support multiple detached files in the code (anticipating the scratch files), but I found no way to open multiple files in VSCode at once: running `code *.rs` makes the plugin to register in the `vscode.workspace.textDocuments` only the first file, while code actually displays all files later.
Apparently what happens is the same as when you have VSCode open at some workplace already and then run `code some_other_file.rs`: it gets opened in the same workspace of the same VSCode with no server to support it.
If there's a way to override it, I'd appreciate the pointer.

* No way to toggle inlay hints, since the setting is updated for the workspace (which does not exist for a single file opened)
> [2021-05-24 00:22:49.100] [exthost] [error] Error: Unable to write to Workspace Settings because no workspace is opened. Please open a workspace first and try again.

* No runners/lens to run or check the code are implemented for this mode.
In theory, we can detect `rustc`, run it on a file and run the resulting binary, but not sure if worth doing it at this stage.

Otherwise imports, hints, completion and other features work.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoAdd a FIXME
Kirill Bulatov [Mon, 24 May 2021 11:52:57 +0000 (14:52 +0300)]
Add a FIXME

3 years agoMerge #8962
bors[bot] [Mon, 24 May 2021 11:52:09 +0000 (11:52 +0000)]
Merge #8962

8962: internal: try re-enabling debug info on releases again r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSmall file error display fix
Kirill Bulatov [Mon, 24 May 2021 11:47:20 +0000 (14:47 +0300)]
Small file error display fix

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: try re-enabling debug info on releases again
Aleksey Kladov [Mon, 24 May 2021 11:41:31 +0000 (14:41 +0300)]
internal: try re-enabling debug info on releases again

full LTO OOMs the LLVM, lets try thin

cc https://github.com/rust-lang/rust/issues/85598

3 years agoMerge #8959
bors[bot] [Mon, 24 May 2021 08:53:55 +0000 (08:53 +0000)]
Merge #8959

8959: fix: can download server binary on windows again r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofix: can download server binary on windows again
Aleksey Kladov [Mon, 24 May 2021 08:52:25 +0000 (11:52 +0300)]
fix: can download server binary on windows again

Closes #8956

See https://github.com/rust-analyzer/rust-analyzer/pull/8951#issuecomment-846716999

3 years agoRemove superfluous early-returns
Aramis Razzaghipour [Mon, 24 May 2021 04:53:15 +0000 (14:53 +1000)]
Remove superfluous early-returns

3 years agoRename ‘foreign’ semantic token modifier to ‘library’
Aramis Razzaghipour [Mon, 24 May 2021 04:48:42 +0000 (14:48 +1000)]
Rename ‘foreign’ semantic token modifier to ‘library’

3 years agoAdd testing of foreign item highlighting
Aramis Razzaghipour [Mon, 24 May 2021 03:16:08 +0000 (13:16 +1000)]
Add testing of foreign item highlighting

3 years agoHighlight foreign modules as such
Aramis Razzaghipour [Mon, 24 May 2021 03:15:54 +0000 (13:15 +1000)]
Highlight foreign modules as such

3 years agoRemove hir krate methods
Aramis Razzaghipour [Sun, 23 May 2021 23:42:06 +0000 (09:42 +1000)]
Remove hir krate methods

3 years agoAdd highlighting of items from other crates
Aramis Razzaghipour [Sun, 23 May 2021 13:45:26 +0000 (23:45 +1000)]
Add highlighting of items from other crates

3 years agoMerge #8945
bors[bot] [Sun, 23 May 2021 21:55:51 +0000 (21:55 +0000)]
Merge #8945

8945: fix: Make expected type work in more situations r=flodiebold a=flodiebold

Also makes call info show the correct types for generic methods.

![2021-05-23-182952_1134x616_scrot](https://user-images.githubusercontent.com/906069/119269023-dd5a5b00-bbf5-11eb-993a-b6e122c3b9a6.png)
![2021-05-23-183117_922x696_scrot](https://user-images.githubusercontent.com/906069/119269025-dfbcb500-bbf5-11eb-983c-fc415b8428e0.png)

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoGet rid of field_type again
Florian Diebold [Sun, 23 May 2021 21:54:35 +0000 (23:54 +0200)]
Get rid of field_type again