]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agofix: comletion detail shows `{unknown}` for `impl Trait` in return position
iDawer [Tue, 12 Apr 2022 15:40:31 +0000 (20:40 +0500)]
fix: comletion detail shows `{unknown}` for `impl Trait` in return position

2 years agoAuto merge of #12006 - lnicola:toggle-inlay-hints, r=lnicola
bors [Sat, 16 Apr 2022 05:10:17 +0000 (05:10 +0000)]
Auto merge of #12006 - lnicola:toggle-inlay-hints, r=lnicola

fix: Remove old inlay hints settings

Closes #11998

2 years agoRemove old inlay hints settings
Laurențiu Nicola [Sat, 16 Apr 2022 05:04:52 +0000 (08:04 +0300)]
Remove old inlay hints settings

2 years agoAuto merge of #12005 - Veykril:hir-ty-simplify, r=Veykril
bors [Fri, 15 Apr 2022 20:23:15 +0000 (20:23 +0000)]
Auto merge of #12005 - Veykril:hir-ty-simplify, r=Veykril

internal: Remove frequent `Arc<Body>` clones in type checking

bors r+

2 years agominor: Remove frequent `Arc<Body>` clones in type checking
Lukas Wirth [Fri, 15 Apr 2022 19:44:47 +0000 (21:44 +0200)]
minor: Remove frequent `Arc<Body>` clones in type checking

2 years agoSimplify
Lukas Wirth [Fri, 15 Apr 2022 19:25:44 +0000 (21:25 +0200)]
Simplify

2 years agoAuto merge of #12003 - Veykril:hir-ty-simplify, r=Veykril
bors [Fri, 15 Apr 2022 18:25:02 +0000 (18:25 +0000)]
Auto merge of #12003 - Veykril:hir-ty-simplify, r=Veykril

internal: Remove duplicated crate id field from hir::Type

2 years agoSlightly optimize `Resolver::krate`
Lukas Wirth [Fri, 15 Apr 2022 18:17:50 +0000 (20:17 +0200)]
Slightly optimize `Resolver::krate`

2 years agoAuto merge of #11997 - lnicola:es-target, r=lnicola
bors [Fri, 15 Apr 2022 18:17:23 +0000 (18:17 +0000)]
Auto merge of #11997 - lnicola:es-target, r=lnicola

minor: Bump target JS version

2 years agoRemove duplicated crate id field from hir::Type
Lukas Wirth [Fri, 15 Apr 2022 18:14:35 +0000 (20:14 +0200)]
Remove duplicated crate id field from hir::Type

2 years agoAuto merge of #12002 - Veykril:proc-macro-change-panic, r=Veykril
bors [Fri, 15 Apr 2022 18:02:40 +0000 (18:02 +0000)]
Auto merge of #12002 - Veykril:proc-macro-change-panic, r=Veykril

fix: Fix source root panic in global state when checking out older git revs

Fixes https://github.com/rust-lang/rust-analyzer/issues/11357

2 years agofix: Fix source root panic in global state when checking out older git revs
Lukas Wirth [Fri, 15 Apr 2022 18:02:15 +0000 (20:02 +0200)]
fix: Fix source root panic in global state when checking out older git revs

2 years agoAuto merge of #12001 - Veykril:refs, r=Veykril
bors [Fri, 15 Apr 2022 17:43:24 +0000 (17:43 +0000)]
Auto merge of #12001 - Veykril:refs, r=Veykril

fix: Do reference search on all downmapped tokens with the same kind only

cc https://github.com/rust-lang/rust-analyzer/issues/11668

2 years agofix: Do reference search on all downmapped tokens with the same kind only
Lukas Wirth [Fri, 15 Apr 2022 17:42:48 +0000 (19:42 +0200)]
fix: Do reference search on all downmapped tokens with the same kind only

2 years agoAuto merge of #12000 - Veykril:hlmac, r=Veykril
bors [Fri, 15 Apr 2022 17:19:33 +0000 (17:19 +0000)]
Auto merge of #12000 - Veykril:hlmac, r=Veykril

fix: Tag `macro_rules` macro bang with `MacroBang` tag

cc https://github.com/rust-lang/rust-analyzer/issues/11996

2 years agofix: Tag `macro_rules` macro bang with `MacroBang` tag
Lukas Wirth [Fri, 15 Apr 2022 17:16:18 +0000 (19:16 +0200)]
fix: Tag `macro_rules` macro bang with `MacroBang` tag

2 years agoAuto merge of #11999 - Veykril:config-valid, r=Veykril
bors [Fri, 15 Apr 2022 17:12:26 +0000 (17:12 +0000)]
Auto merge of #11999 - Veykril:config-valid, r=Veykril

Update feature listing in extension README

2 years agoUpdate feature listing in extension README
Lukas Wirth [Fri, 15 Apr 2022 17:11:56 +0000 (19:11 +0200)]
Update feature listing in extension README

2 years agoBump target JS version
Laurențiu Nicola [Fri, 15 Apr 2022 15:14:51 +0000 (18:14 +0300)]
Bump target JS version

2 years agoAuto merge of #11993 - jonas-schievink:adt-completions-in-block, r=jonas-schievink
bors [Thu, 14 Apr 2022 16:40:15 +0000 (16:40 +0000)]
Auto merge of #11993 - jonas-schievink:adt-completions-in-block, r=jonas-schievink

fix: enable ADT keyword completions in block expressions

fixes https://github.com/rust-lang/rust-analyzer/issues/11576

2 years agoEnable ADT keyword completions in block expression
Jonas Schievink [Thu, 14 Apr 2022 16:39:27 +0000 (18:39 +0200)]
Enable ADT keyword completions in block expression

2 years agoAuto merge of #11992 - jonas-schievink:unresolved-primitive-module-fallback, r=jonas...
bors [Thu, 14 Apr 2022 13:53:18 +0000 (13:53 +0000)]
Auto merge of #11992 - jonas-schievink:unresolved-primitive-module-fallback, r=jonas-schievink

fix: resolve `uN::method` even when `use std::uN;` is present

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

2 years agoFallback to primitive when path doesn't resolve
Jonas Schievink [Thu, 14 Apr 2022 13:51:38 +0000 (15:51 +0200)]
Fallback to primitive when path doesn't resolve

2 years agoAuto merge of #11971 - jonas-schievink:on-type-fmt-assignments, r=jonas-schievink
bors [Thu, 14 Apr 2022 12:36:17 +0000 (12:36 +0000)]
Auto merge of #11971 - jonas-schievink:on-type-fmt-assignments, r=jonas-schievink

feat: Add trailing `;` when typing `=` in assignment

![Peek 2022-04-12 19-41](https://user-images.githubusercontent.com/1786438/163022079-1ed114ef-7c75-490f-a8ed-731a13f0b44d.gif)

This does have a false positive to keep in mind, it will add a trailing `;` in the following snippet too, which is probably not desired:

```rust
fn is_zero(i: i32) -> bool {
    i $0 0
}
```

However, that function is unlikely to be written from the "inside out" like that, so it might be acceptable. Typically `=` is only inserted last when the author realizes that an existing expression should be assigned to some variable.

2 years agoAuto merge of #11990 - jonas-schievink:improve-itemtree-prettyprint, r=jonas-schievink
bors [Thu, 14 Apr 2022 12:28:01 +0000 (12:28 +0000)]
Auto merge of #11990 - jonas-schievink:improve-itemtree-prettyprint, r=jonas-schievink

internal: Improve ItemTree pretty print output

Expand `FnFlags` into what they actually mean and omit `AttrId`s, since those are sequential numbers in the item tree

2 years agoImprove ItemTree pretty print output
Jonas Schievink [Thu, 14 Apr 2022 12:24:27 +0000 (14:24 +0200)]
Improve ItemTree pretty print output

2 years agoadd docs
Jonas Schievink [Thu, 14 Apr 2022 11:23:19 +0000 (13:23 +0200)]
add docs

2 years agoAuto merge of #11988 - jonas-schievink:expand-glob, r=jonas-schievink
bors [Thu, 14 Apr 2022 11:03:02 +0000 (11:03 +0000)]
Auto merge of #11988 - jonas-schievink:expand-glob, r=jonas-schievink

minor: reenable simplify glob import test

2 years agoreenable test
Jonas Schievink [Thu, 14 Apr 2022 11:02:20 +0000 (13:02 +0200)]
reenable test

2 years agosimplify
Jonas Schievink [Thu, 14 Apr 2022 11:00:08 +0000 (13:00 +0200)]
simplify

2 years agoAuto merge of #11985 - Veykril:config-valid, r=Veykril
bors [Thu, 14 Apr 2022 10:16:58 +0000 (10:16 +0000)]
Auto merge of #11985 - Veykril:config-valid, r=Veykril

minor: Simplify config.rs a bit

2 years agominor: Cleanup config.rs a bit
Lukas Wirth [Thu, 14 Apr 2022 10:15:58 +0000 (12:15 +0200)]
minor: Cleanup config.rs a bit

2 years agoAuto merge of #11960 - Veykril:config-valid, r=Veykril
bors [Thu, 14 Apr 2022 09:36:08 +0000 (09:36 +0000)]
Auto merge of #11960 - Veykril:config-valid, r=Veykril

internal: Show more project building errors to the user

Should help out with https://github.com/rust-analyzer/rust-analyzer/issues/9720
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11223

2 years agointernal: Show more project building errors to the user
Lukas Wirth [Mon, 11 Apr 2022 12:38:30 +0000 (14:38 +0200)]
internal: Show more project building errors to the user

2 years agoAuto merge of #11980 - atouchet:repo, r=Veykril
bors [Thu, 14 Apr 2022 09:26:24 +0000 (09:26 +0000)]
Auto merge of #11980 - atouchet:repo, r=Veykril

Update repo URL

2 years agoAuto merge of #11979 - Veykril:ci, r=lnicola
bors [Thu, 14 Apr 2022 06:36:09 +0000 (06:36 +0000)]
Auto merge of #11979 - Veykril:ci, r=lnicola

minor: Don't run CI on master branch

2 years agoUpdate repo URL
Alex Touchet [Wed, 13 Apr 2022 23:54:24 +0000 (16:54 -0700)]
Update repo URL

2 years agoAuto merge of #11956 - fee1-dead:master, r=flodiebold
bors [Wed, 13 Apr 2022 22:53:31 +0000 (22:53 +0000)]
Auto merge of #11956 - fee1-dead:master, r=flodiebold

feat: allow customizing the command for running build scripts

I have tested this locally and it fixed #9201 with some small changes on the compiler side with suggestions from https://github.com/rust-analyzer/rust-analyzer/issues/9201#issuecomment-1019554086.

I have also added an environment variable `IS_RA_BUILDSCRIPT_CHECK` for crates to detect that it is a check for buildscripts, and allows defaulting to bogus values for expected environment variables.

2 years agominor: Don't run CI on master branch
Lukas Wirth [Wed, 13 Apr 2022 22:42:51 +0000 (00:42 +0200)]
minor: Don't run CI on master branch

2 years agoAuto merge of #11976 - Veykril:rust-lang-test, r=Veykril
bors [Wed, 13 Apr 2022 17:24:18 +0000 (17:24 +0000)]
Auto merge of #11976 - Veykril:rust-lang-test, r=Veykril

minor: fix ide docs link

Let's test if bors listens to me here
bors r+

2 years agoUpdate CI for Rust bors
Deadbeef [Wed, 13 Apr 2022 14:13:36 +0000 (00:13 +1000)]
Update CI for Rust bors

2 years agoRemove trailing `;` when turning assignment into `==` comparison
Jonas Schievink [Wed, 13 Apr 2022 14:01:09 +0000 (16:01 +0200)]
Remove trailing `;` when turning assignment into `==` comparison

2 years agoAdd more no-op tests
Jonas Schievink [Wed, 13 Apr 2022 13:47:33 +0000 (15:47 +0200)]
Add more no-op tests

2 years agofeat: allow customizing the command for running build scripts
Deadbeef [Mon, 11 Apr 2022 03:13:50 +0000 (13:13 +1000)]
feat: allow customizing the command for running build scripts

2 years agominor: fix ide docs link
Lukas Wirth [Wed, 13 Apr 2022 11:22:45 +0000 (13:22 +0200)]
minor: fix ide docs link

2 years agoMerge #11974
bors[bot] [Wed, 13 Apr 2022 10:28:45 +0000 (10:28 +0000)]
Merge #11974

11974: minor: prepare CI for rust-lang move r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: prepare CI for rust-lang move
Lukas Wirth [Wed, 13 Apr 2022 10:26:24 +0000 (12:26 +0200)]
minor: prepare CI for rust-lang move

2 years agoAdd trailing `;` when typing `=` in assignment
Jonas Schievink [Tue, 12 Apr 2022 17:39:19 +0000 (19:39 +0200)]
Add trailing `;` when typing `=` in assignment

2 years agoMerge #11970
bors[bot] [Tue, 12 Apr 2022 17:14:16 +0000 (17:14 +0000)]
Merge #11970

11970: Bump chalk r=lnicola a=lnicola

Closes #9990, but not #6418, #10653

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump chalk
Laurențiu Nicola [Tue, 12 Apr 2022 17:10:10 +0000 (20:10 +0300)]
Bump chalk

2 years agoMerge #11969
bors[bot] [Tue, 12 Apr 2022 16:29:48 +0000 (16:29 +0000)]
Merge #11969

11969: fix: Add trailing `;` when completing assoc const/type in trait impl r=jonas-schievink a=jonas-schievink

Final item of https://github.com/rust-analyzer/rust-analyzer/issues/11860, thus closes https://github.com/rust-analyzer/rust-analyzer/issues/11860 :tada:

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoAdd trailing `;` when completing assoc const/type
Jonas Schievink [Tue, 12 Apr 2022 16:28:43 +0000 (18:28 +0200)]
Add trailing `;` when completing assoc const/type

2 years agoMerge #11967
bors[bot] [Tue, 12 Apr 2022 16:03:12 +0000 (16:03 +0000)]
Merge #11967

11967: fix: Fix trait impl completions not triggering after `fn`/`const`/`type` r=jonas-schievink a=jonas-schievink

![screenshot-2022-04-12-17:13:01](https://user-images.githubusercontent.com/1786438/162996087-56540f5e-a6be-4111-a4a5-8de21f483a5e.png)

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11467
cc https://github.com/rust-analyzer/rust-analyzer/issues/11860

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix trait impl completions' `lookup_by` text
Jonas Schievink [Tue, 12 Apr 2022 15:17:31 +0000 (17:17 +0200)]
Fix trait impl completions' `lookup_by` text

2 years agoMerge #11883
bors[bot] [Tue, 12 Apr 2022 15:17:00 +0000 (15:17 +0000)]
Merge #11883

11883: fix(ide): move moudle directory when rename r=rainy-me a=rainy-me

fix: #10992

Added `FileSystemEdit::MoveDir` variant for move dirs. Original implemented as recursively move child mod files but had many issues like

1. left empty dir after rename file
2. only affect rust file
3. not performant

so changed to current version

Co-authored-by: rainy-me <github@yue.coffee>
2 years agofix: move dir on rename mod
rainy-me [Tue, 12 Apr 2022 14:01:53 +0000 (23:01 +0900)]
fix: move dir on rename mod

2 years agoMerge #11966
bors[bot] [Tue, 12 Apr 2022 13:34:52 +0000 (13:34 +0000)]
Merge #11966

11966: minor: simplify r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agosimplify
Jonas Schievink [Tue, 12 Apr 2022 13:34:12 +0000 (15:34 +0200)]
simplify

2 years agoMerge #11964
bors[bot] [Mon, 11 Apr 2022 22:21:57 +0000 (22:21 +0000)]
Merge #11964

11964: internal: Show more project building errors to the user r=Veykril a=Veykril

Something very fishy is going on with the `rustc_workspace` handling, which caused this bug to only manifest in the `std` library but not other library crate... So there is either a bug there or just the fact that we seem to add duplicate dependencies (I think this is what we are doing with this right?) might be tripping something up somewhere.

cc https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Rust-analyzer.20use.20inside.20stdlib

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Unset test feature in rustc source crates
Lukas Wirth [Mon, 11 Apr 2022 22:18:49 +0000 (00:18 +0200)]
fix: Unset test feature in rustc source crates

2 years agoMerge #11961
bors[bot] [Mon, 11 Apr 2022 16:50:00 +0000 (16:50 +0000)]
Merge #11961

11961: feature: deprioritize already-imported names in `use` items r=jonas-schievink a=jonas-schievink

![screenshot-2022-04-11-18:48:46](https://user-images.githubusercontent.com/1786438/162790376-6b133925-7cf9-46c5-b0e2-d8c3cba61d47.png)

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoDeprioritize already-imported names
Jonas Schievink [Mon, 11 Apr 2022 16:48:27 +0000 (18:48 +0200)]
Deprioritize already-imported names

2 years agoMerge #11958
bors[bot] [Mon, 11 Apr 2022 11:12:55 +0000 (11:12 +0000)]
Merge #11958

11958: Show config deseralization failures on start up r=Veykril a=Veykril

We now also show deserialization errors to the user when starting the server.
This PR also adds a small validation "pass" on the config that we will probably populate over time with more checks.

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

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd simplistic config validation
Lukas Wirth [Mon, 11 Apr 2022 11:10:43 +0000 (13:10 +0200)]
Add simplistic config validation

2 years agoShow config deseralization failures on start up
Lukas Wirth [Mon, 11 Apr 2022 11:05:34 +0000 (13:05 +0200)]
Show config deseralization failures on start up

2 years agoMerge #11935
bors[bot] [Mon, 11 Apr 2022 09:29:15 +0000 (09:29 +0000)]
Merge #11935

11935: feat: Switch to LSP inlay hints r=lnicola a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #11957
bors[bot] [Mon, 11 Apr 2022 08:03:50 +0000 (08:03 +0000)]
Merge #11957

11957: fix panic on GAT r=flodiebold a=skyzh

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This is still a workaround on GAT panic, and didn't solve the full problem. But at least we won't panic now. False positive is better than panicking and letting VSCode constantly pop out the warning 🤣

This PR is simple -- only apply the https://github.com/rust-analyzer/rust-analyzer/pull/11878 fix on const generics. For normal GATs, just follow the previous approach.

This PR fixes https://github.com/rust-analyzer/rust-analyzer/issues/11939, I've added it as a test case.

This PR didn't fully fix / https://github.com/rust-analyzer/rust-analyzer/issues/11923. But at least it won't panic now -- will only give a type mismatch error.

Not sure if it fixes / https://github.com/rust-analyzer/rust-analyzer/issues/11921, I'll test it later.

cc `@flodiebold` for review, thanks!

Co-authored-by: Alex Chi <iskyzh@gmail.com>
2 years agofix panic on GAT
Alex Chi [Mon, 11 Apr 2022 05:44:01 +0000 (13:44 +0800)]
fix panic on GAT

Signed-off-by: Alex Chi <iskyzh@gmail.com>
2 years agoMerge #11951
bors[bot] [Sun, 10 Apr 2022 18:21:54 +0000 (18:21 +0000)]
Merge #11951

11951: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sun, 10 Apr 2022 10:42:16 +0000 (12:42 +0200)]
Simplify

2 years agoMerge #11955
bors[bot] [Sun, 10 Apr 2022 16:28:40 +0000 (16:28 +0000)]
Merge #11955

11955: Fix typo in the manual r=lnicola a=okuramasafumi

The -> There

Co-authored-by: OKURA Masafumi <masafumi.o1988@gmail.com>
2 years agoFix typo in the manual
OKURA Masafumi [Sun, 10 Apr 2022 16:17:39 +0000 (01:17 +0900)]
Fix typo in the manual

The -> There

2 years agoMerge #11954
bors[bot] [Sun, 10 Apr 2022 15:59:38 +0000 (15:59 +0000)]
Merge #11954

11954: Parse `for<'a>` closure syntax r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoParse for<'a> closure syntax
Lukas Wirth [Sun, 10 Apr 2022 15:50:14 +0000 (17:50 +0200)]
Parse for<'a> closure syntax

2 years agoMerge #11953
bors[bot] [Sun, 10 Apr 2022 13:31:33 +0000 (13:31 +0000)]
Merge #11953

11953: fix: `extract_module` is too eager r=Veykril a=iDawer

Refactored `extract_module`.
Searching for usages and import resolving are done lazily.

Close #11944

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2 years ago`extract_module`: Refactor loops
iDawer [Sat, 9 Apr 2022 17:07:44 +0000 (22:07 +0500)]
`extract_module`: Refactor loops

2 years agoextract_module: Resolve imports lazily
iDawer [Mon, 28 Mar 2022 16:31:07 +0000 (21:31 +0500)]
extract_module: Resolve imports lazily

2 years agoRefactor `extract_module`
iDawer [Mon, 28 Mar 2022 14:10:13 +0000 (19:10 +0500)]
Refactor `extract_module`

2 years agoClean up `extract_module`
iDawer [Mon, 28 Mar 2022 11:31:18 +0000 (16:31 +0500)]
Clean up `extract_module`

2 years agoMerge #11946
bors[bot] [Sat, 9 Apr 2022 11:41:47 +0000 (11:41 +0000)]
Merge #11946

11946: internal: Revert #11912 as it parses all visited files r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRevert #11912 as it parses all visited files
Lukas Wirth [Sat, 9 Apr 2022 11:40:48 +0000 (13:40 +0200)]
Revert #11912 as it parses all visited files

2 years agoMerge #11943
bors[bot] [Fri, 8 Apr 2022 23:09:18 +0000 (23:09 +0000)]
Merge #11943

11943: fix: Don't create `hir::Local`s from const path patterns r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Don't create `hir::Local`s from const path patterns
Lukas Wirth [Fri, 8 Apr 2022 23:08:13 +0000 (01:08 +0200)]
fix: Don't create `hir::Local`s from const path patterns

2 years agoMerge #11942
bors[bot] [Fri, 8 Apr 2022 22:56:57 +0000 (22:56 +0000)]
Merge #11942

11942: fix: Check whether a parameter can be converted to a local r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Check whether a parameter can be converted to a local
Lukas Wirth [Fri, 8 Apr 2022 22:55:45 +0000 (00:55 +0200)]
fix: Check whether a parameter can be converted to a local

2 years agoMerge #11940
bors[bot] [Fri, 8 Apr 2022 22:14:48 +0000 (22:14 +0000)]
Merge #11940

11940: minor: bump lsp-server version r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: bump lsp-server version
Lukas Wirth [Fri, 8 Apr 2022 22:13:47 +0000 (00:13 +0200)]
minor: bump lsp-server version

2 years agoMerge #11938
bors[bot] [Fri, 8 Apr 2022 18:00:41 +0000 (18:00 +0000)]
Merge #11938

11938: feat: improve assoc. item completion in trait impls r=jonas-schievink a=jonas-schievink

Account for macro-generated items, increase the score of these completions since they're very relevant, and allow them to trigger when the cursor is directly in the assoc. item list without requiring further input.

![screenshot-2022-04-08-18:12:06](https://user-images.githubusercontent.com/1786438/162481277-2a0d2f21-dc20-4452-804d-6370766216b6.png)

Part of https://github.com/rust-analyzer/rust-analyzer/issues/11860

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoMake trait item completions work in a bare impl and score them
Jonas Schievink [Fri, 8 Apr 2022 16:06:18 +0000 (18:06 +0200)]
Make trait item completions work in a bare impl and score them

2 years agoAccount for macros in `get_missing_assoc_items`
Jonas Schievink [Fri, 8 Apr 2022 16:05:34 +0000 (18:05 +0200)]
Account for macros in `get_missing_assoc_items`

2 years agoMerge #11936
bors[bot] [Fri, 8 Apr 2022 12:34:12 +0000 (12:34 +0000)]
Merge #11936

11936: Ignore `Drop` and `Destruct` bounds for now r=flodiebold a=flodiebold

- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement. (So ideally, we'd only ignore `~const Drop`, but this should be fine for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies), so until the builtin impls are supported by Chalk, we ignore them as well. Since `Destruct` is implemented for everything in non-const contexts IIUC, this should also work fine.

Fixes #11932.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoIgnore `Drop` and `Destruct` bounds for now
Florian Diebold [Fri, 8 Apr 2022 12:29:43 +0000 (14:29 +0200)]
Ignore `Drop` and `Destruct` bounds for now

- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement.
  (So ideally, we'd only ignore `~const Drop`, but this should be fine
  for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies as of 08-04-2022), so until
  the builtin impls are supported by Chalk, we ignore them as well.
  Since `Destruct` is implemented for everything in non-const contexts
  IIUC, this should also work fine.

Fixes #11932.

2 years agoUpdate for languageclient API changes
Laurențiu Nicola [Fri, 8 Apr 2022 11:24:28 +0000 (14:24 +0300)]
Update for languageclient API changes

2 years agoSwitch to LSP inlay hints
Laurențiu Nicola [Fri, 8 Apr 2022 10:20:21 +0000 (13:20 +0300)]
Switch to LSP inlay hints

2 years agoMerge #11931
bors[bot] [Thu, 7 Apr 2022 18:05:21 +0000 (18:05 +0000)]
Merge #11931

11931: fix: flyimport: omit types when completing where-clause r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoflyimport: omit types when completing where-clause
Jonas Schievink [Thu, 7 Apr 2022 18:02:33 +0000 (20:02 +0200)]
flyimport: omit types when completing where-clause

2 years agoMerge #11920
bors[bot] [Thu, 7 Apr 2022 17:08:02 +0000 (17:08 +0000)]
Merge #11920

11920: Consider types of const generics r=flodiebold a=HKalbasi

fix #11913

We should emit type_mismatch in const generics, probably after #7434. Currently they will lead to a misleading, time of use type error (like the added test).

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agoMerge #11930
bors[bot] [Thu, 7 Apr 2022 16:38:42 +0000 (16:38 +0000)]
Merge #11930

11930: internal: move function unsafety determination out of the ItemTree r=jonas-schievink a=jonas-schievink

Resolves some FIXMEs.

I've also renamed some FnFlags to be more explicit about what they represent (presence of keywords, not necessarily presence of semantics)

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoDetermine function unsafety semantically
Jonas Schievink [Thu, 7 Apr 2022 16:33:03 +0000 (18:33 +0200)]
Determine function unsafety semantically

2 years agoMerge #11925
bors[bot] [Thu, 7 Apr 2022 14:38:46 +0000 (14:38 +0000)]
Merge #11925

11925: internal: Add and use `HirFormatter::write_{str,char}` r=Veykril a=lnicola

Saves slightly over 3 KB of `text`, but comparing the total with that from two weeks ago in #11776, this is a losing battle (we're 951 KB larger).

```
   text    data     bss     dec     hex filename
24693512 1542704    4424 26240640 1906680 rust-analyzer-baseline
24690216 1542112    4424 26236752 1905750 rust-analyzer-pr
```

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>