]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #6470
bors[bot] [Thu, 5 Nov 2020 13:09:22 +0000 (13:09 +0000)]
Merge #6470

6470: Restore semantic token flickering workaround removed in #5697 r=kjeremy a=charlespierce

Closes #6452

Info
-----
* As discussed in #6452, the `Error('busy')` workaround for semantic token flickering was removed because the underlying issue was believed to be fixed in VS Code.
* It turns out that the fix isn't yet complete, so this caused flickering of the semantic highlighting when making rapid edits (e.g. typing quickly).
* This PR restores that workaround and makes it slightly more robust, covering all areas of semantic token middleware.

Changes
-----
* Added middleware functions for `provideDocumentSemanticTokens`, `provideDocumentSemanticTokensEdits`, and `provideDocumentRangeSemanticTokens` to match the 3 possible middleware hooks defined in https://github.com/microsoft/vscode-languageserver-node/blob/master/client/src/common/semanticTokens.ts#L33
* Each intercepts a `null` or `undefined` return and throws an error with the message `busy` instead, which prevents the tokens from being removed and re-added (causing the flickering behavior)

Tested
-----
* Tested locally that the flickering behavior is gone.
* There don't appear to be any significant tests of the VS Code plugin side of things, other than that it loads. Is there somewhere I can / should add tests to cover this behavior?

Co-authored-by: Charles Pierce <cpierce.grad@gmail.com>
3 years agoMerge #6471
bors[bot] [Thu, 5 Nov 2020 03:02:46 +0000 (03:02 +0000)]
Merge #6471

6471: cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo update
kjeremy [Thu, 5 Nov 2020 03:01:19 +0000 (22:01 -0500)]
cargo update

3 years agoMerge #6468
bors[bot] [Wed, 4 Nov 2020 18:35:57 +0000 (18:35 +0000)]
Merge #6468

6468: Add common issues to the bug report template r=flodiebold a=lnicola

Closes #6298

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoRestore semantic token flickering workaround removed in #5697
Charles Pierce [Wed, 4 Nov 2020 18:26:58 +0000 (10:26 -0800)]
Restore semantic token flickering workaround removed in #5697

3 years agoAdd common issues to the bug report template
Laurențiu Nicola [Wed, 4 Nov 2020 14:57:15 +0000 (16:57 +0200)]
Add common issues to the bug report template

3 years agoMerge #6467
bors[bot] [Wed, 4 Nov 2020 14:38:19 +0000 (14:38 +0000)]
Merge #6467

6467: Don't stack overflow on circular modules r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDon't stack overflow on circular modules
Aleksey Kladov [Wed, 4 Nov 2020 14:31:35 +0000 (15:31 +0100)]
Don't stack overflow on circular modules

closes #6453

3 years agoMerge #6456
bors[bot] [Wed, 4 Nov 2020 12:37:29 +0000 (12:37 +0000)]
Merge #6456

6456: Support record variants in extract_struct_from_enum_variant r=matklad a=Veykril

As requested :)

This also prevents the assist from being disabled if a definition in the value namespace exists with the same name as our new struct since that won't cause a collision

#4468

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6458
bors[bot] [Wed, 4 Nov 2020 12:30:09 +0000 (12:30 +0000)]
Merge #6458

6458: Qualify trait impl created by add_custom_impl assist r=matklad a=Veykril

When we find at least one trait with the same name as the derive accessible from the current module we now generate a qualified path to that trait in the generated impl.
If we don't find any we just do what was done before and emit the trait name in the generated impl.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoCreate issue templates
Aleksey Kladov [Wed, 4 Nov 2020 10:32:46 +0000 (11:32 +0100)]
Create issue templates

3 years agoQualify trait impl created by add_custom_impl assist
Lukas Wirth [Tue, 3 Nov 2020 22:29:53 +0000 (23:29 +0100)]
Qualify trait impl created by add_custom_impl assist

3 years agoSupport struct variants in extract_struct_from_enum_variant
Lukas Wirth [Tue, 3 Nov 2020 19:54:44 +0000 (20:54 +0100)]
Support struct variants in extract_struct_from_enum_variant

3 years agoMerge #6454
bors[bot] [Tue, 3 Nov 2020 18:59:15 +0000 (18:59 +0000)]
Merge #6454

6454: Fix overflow panic in convert_interger_literal assist r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix overflow panic in convert_interger_literal assist
Aleksey Kladov [Tue, 3 Nov 2020 18:49:15 +0000 (19:49 +0100)]
Fix overflow panic in convert_interger_literal assist

This also seizes the opportunity to move integer literal parsing to
the syntax crate, were it logically belongs.

Note though that this is still done in an ad hoc manner -- we probably
should split kitchen sink ast::Literal into a separate APIs for
strings, ints, etc

3 years agoonly check type namespace in extract_struct_from_enum_variant for collisions
Lukas Wirth [Tue, 3 Nov 2020 18:55:14 +0000 (19:55 +0100)]
only check type namespace in extract_struct_from_enum_variant for collisions

3 years agoMerge #6287
bors[bot] [Tue, 3 Nov 2020 17:34:59 +0000 (17:34 +0000)]
Merge #6287

6287: Don't replace entire module and file nodes when inserting imports r=matklad a=Veykril

This change minifies the resulting diff of import insertions by inserting or replacing the produced use tree directly through an `action` return value instead replacing the entire container node. This action has to be applied by the caller now. This unfortunately pulls the `AssistBuilder` into scope of `insert_use` back again but I tried to at least keep it away from the `insert_use` fn itself.

I'm open to more/better ideas regarding this :)

Fixes #6196

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6401
bors[bot] [Tue, 3 Nov 2020 16:43:26 +0000 (16:43 +0000)]
Merge #6401

6401: Only show `self` ident when showing parameter self hints r=matklad a=Veykril

This just hints all self parameters with the `self` token, this is therefor equal to how all other parameters are displayed, but given the self param special in how its defined in a function signature it might make sense to keep the `&`/`&mut` parts as well as emitting those tokens for explict `Self` types that are taken by ref like `self: &Rc<Self>`?

Fixes #6400

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6435
bors[bot] [Tue, 3 Nov 2020 16:36:34 +0000 (16:36 +0000)]
Merge #6435

6435: Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot. r=matklad a=rickvanprim

Updates `module_resolution_relative_path_outside_root` test to check valid paths outside of the root, by moving the root to a subpath so that paths outside of it are possible.  If this would be more appropriate as a new test, or if the original check for an invalid path should be left, I'm happy to update.

Co-authored-by: James Leitch <rickvanprim@gmail.com>
3 years agoMerge #6450
bors[bot] [Tue, 3 Nov 2020 12:55:38 +0000 (12:55 +0000)]
Merge #6450

6450: Textmate grammar: Distinguish turbofish function calls from namespaces r=dustypomerleau a=dustypomerleau

Fixes #6446.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agofix: distinguish turbofish function calls from namespaces
Dusty Pomerleau [Tue, 3 Nov 2020 12:47:15 +0000 (23:47 +1100)]
fix: distinguish turbofish function calls from namespaces

3 years agoMerge #6430
bors[bot] [Tue, 3 Nov 2020 07:54:45 +0000 (07:54 +0000)]
Merge #6430

6430: Move completions rendering into a separate module r=popzxc a=popzxc

This PR extracts rendering-related things from `Completions` structure to the new `render` module.

`render` module declares a `Render` structure (which is a generic renderer interface), `RenderContext` (interface for data/methods not required for completions generating, but required for rendering), and a bunch of smaller `*Render` structures which encapsulate logic behind rendering a certain item.

This is just a step in full separation direction, since the following this are still to be done:

- Move some data from `CompletionContext` to the `RenderContext`;
- Forbid any kind of rendering outside of `render` module;
- Extract score computing into a separate module.

This PR is already pretty big, so not to make it even harder to review I decided to split this process into several subsequent PRs.

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
3 years agoMerge #6447
bors[bot] [Tue, 3 Nov 2020 07:48:24 +0000 (07:48 +0000)]
Merge #6447

6447: Textmate grammar: allow function declarations without curly brackets r=lnicola a=dustypomerleau

Functions inside trait declarations can break subsequent highlighting, because they have no curly brackets. In a case such as:

```rust
pub trait Summary {
    fn summarize(&self) -> String;
}
```

the scope `meta.function.definition.rust` will continue past the end of the block looking for `{` after `fn`. This PR allows `meta.function.definition.rust` to terminate with `;` in these cases.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agofix: allow functions without curly brackets
Dusty Pomerleau [Tue, 3 Nov 2020 07:37:43 +0000 (18:37 +1100)]
fix: allow functions without curly brackets

3 years agoMerge #6421
bors[bot] [Tue, 3 Nov 2020 07:36:49 +0000 (07:36 +0000)]
Merge #6421

6421: Check for allow(..) attributes in case check diagnostic r=popzxc a=popzxc

Resolves #6348

This is not a full-fledged solution, as it doesn't looks up for parent elements (e.g. function -> module -> parent module -> crate root), but it does at least checks attributes of item being checked.
I played a bit with code, and it seems that implementing a proper solution (which will also check for `deny` / `warn` attributes overriding values for `allow`s from above).

So, this solution should fix all the macros which intentionally do "weird" naming and wrap it with `allow`, such as `lazy_static`.

cc @ArifRoktim

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
3 years agoRemove intra-crate facade from completions
Igor Aleksanov [Tue, 3 Nov 2020 07:36:01 +0000 (10:36 +0300)]
Remove intra-crate facade from completions

3 years agoGet rid of do-er antipattern
Igor Aleksanov [Tue, 3 Nov 2020 07:33:13 +0000 (10:33 +0300)]
Get rid of do-er antipattern

3 years agoProvide only explicit constructor for RenderContext
Igor Aleksanov [Tue, 3 Nov 2020 07:17:59 +0000 (10:17 +0300)]
Provide only explicit constructor for RenderContext

3 years agoAdd doc-comments to the new files
Igor Aleksanov [Sun, 1 Nov 2020 10:48:42 +0000 (13:48 +0300)]
Add doc-comments to the new files

3 years agoMake structures order more logical in render.rs
Igor Aleksanov [Sun, 1 Nov 2020 10:39:05 +0000 (13:39 +0300)]
Make structures order more logical in render.rs

3 years agoMove rendering tests to the render module
Igor Aleksanov [Sun, 1 Nov 2020 10:36:30 +0000 (13:36 +0300)]
Move rendering tests to the render module

3 years agoAdd TypeAliasRender
Igor Aleksanov [Sun, 1 Nov 2020 10:10:02 +0000 (13:10 +0300)]
Add TypeAliasRender

3 years agoAdd ConstRender
Igor Aleksanov [Sun, 1 Nov 2020 09:59:43 +0000 (12:59 +0300)]
Add ConstRender

3 years agoIntroduce render module
Igor Aleksanov [Sun, 1 Nov 2020 09:35:04 +0000 (12:35 +0300)]
Introduce render module

3 years agoImprove decl_check module readability
Igor Aleksanov [Tue, 3 Nov 2020 07:13:49 +0000 (10:13 +0300)]
Improve decl_check module readability

3 years agoRemove numbers from comments in decl_check.rs
Igor Aleksanov [Sat, 31 Oct 2020 09:43:03 +0000 (12:43 +0300)]
Remove numbers from comments in decl_check.rs

3 years agoCheck for allow(..) attributes for case diagnostic
Igor Aleksanov [Sat, 31 Oct 2020 08:53:47 +0000 (11:53 +0300)]
Check for allow(..) attributes for case diagnostic

3 years agoOnly show `self` ident when showing parameter self hints
Lukas Wirth [Thu, 29 Oct 2020 12:02:34 +0000 (13:02 +0100)]
Only show `self` ident when showing parameter self hints

3 years agoMake insert_use return a SyntaxRewriter
Lukas Wirth [Mon, 2 Nov 2020 20:40:52 +0000 (21:40 +0100)]
Make insert_use return a SyntaxRewriter

3 years agoFeedback.
James Leitch [Mon, 2 Nov 2020 17:57:31 +0000 (10:57 -0700)]
Feedback.

3 years agoMerge #6445
bors[bot] [Mon, 2 Nov 2020 17:54:01 +0000 (17:54 +0000)]
Merge #6445

6445: Fix coalescing of prime_caches updates r=jonas-schievink a=jonas-schievink

The previous implementation could try to create a progress bar when one
was already registered.

bors r+ :robot:

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoFix coalescing of prime_caches updates
Jonas Schievink [Mon, 2 Nov 2020 17:48:19 +0000 (18:48 +0100)]
Fix coalescing of prime_caches updates

The previous implementation could try to create a progress bar when one
was  already registered

3 years agoMerge #6365
bors[bot] [Mon, 2 Nov 2020 17:47:08 +0000 (17:47 +0000)]
Merge #6365

6365: Do insertion lookahead in algo::diff r=matklad a=Veykril

This is the last blocker for #6287 after this I can update that PR to properly fix things through using `SyntaxRewriter`.

This PR also shuffles tests around a bit and adds some more.

Ideally this is just a hack until we implement a "proper" diff algorithm that approximates a minimal diff. Maybe something like [gumtree](https://github.com/GumTreeDiff/gumtree)?

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6393 #6399
bors[bot] [Mon, 2 Nov 2020 17:40:47 +0000 (17:40 +0000)]
Merge #6393 #6399

6393: Remove repetitive inlay hints (take 2) r=matklad a=lnicola

6399: Keep generic annotations when qualifying things r=matklad a=Veykril

The `qualify_path` assists currently eats up already annotated generics in all but one cases which can be annoying if one already pre-fills generics of a type before it's been qualified.

Co-authored-by: Matthew Sanetra <matthewsanetra@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6443
bors[bot] [Mon, 2 Nov 2020 17:34:41 +0000 (17:34 +0000)]
Merge #6443

6443: Remove unnecessary clone r=jonas-schievink a=jonas-schievink

bors r+ :robot:

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoRemove unnecessary clone
Jonas Schievink [Mon, 2 Nov 2020 17:33:46 +0000 (18:33 +0100)]
Remove unnecessary clone

3 years agoMerge #6441
bors[bot] [Mon, 2 Nov 2020 17:12:08 +0000 (17:12 +0000)]
Merge #6441

6441: Coalesce prime_caches updates r=matklad a=jonas-schievink

This reduces the number of progress bar updates we send to the client by collapsing subsequent updates into one. This doesn't work as well as I'd hoped (which is that we end up sending *no* updates, or only `start` and `end`, when the cache is already fresh), but it does reduce the number considerably: instead of ~720 updates on the rust-analyzer codebase, we now only send ~60.

It uses the same approach that is already in use for coalescing VFS events.

Hopefully this is enough to fix https://github.com/rust-analyzer/rust-analyzer/issues/6413.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoMerge #6442
bors[bot] [Mon, 2 Nov 2020 17:02:21 +0000 (17:02 +0000)]
Merge #6442

6442: Bump chalk and lexer r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoBump chalk and lexer
kjeremy [Mon, 2 Nov 2020 17:00:58 +0000 (12:00 -0500)]
Bump chalk and lexer

3 years agoRemove debug print
Jonas Schievink [Mon, 2 Nov 2020 16:20:35 +0000 (17:20 +0100)]
Remove debug print

3 years agoCoalesce prime_caches updates
Jonas Schievink [Mon, 2 Nov 2020 16:06:49 +0000 (17:06 +0100)]
Coalesce prime_caches updates

3 years agoMerge #6440
bors[bot] [Mon, 2 Nov 2020 16:01:38 +0000 (16:01 +0000)]
Merge #6440

6440: Deny unreachable pub r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpdate crates
Aleksey Kladov [Mon, 2 Nov 2020 16:00:05 +0000 (17:00 +0100)]
Update crates

This is to bust the caches

3 years agoRemove more unreachable pubs
Aleksey Kladov [Mon, 2 Nov 2020 15:31:38 +0000 (16:31 +0100)]
Remove more unreachable pubs

3 years agoMerge #6438
bors[bot] [Mon, 2 Nov 2020 13:08:53 +0000 (13:08 +0000)]
Merge #6438

6438: Deny unreachable-pub r=matklad a=matklad

It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!

Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDeny unreachable-pub
Aleksey Kladov [Mon, 2 Nov 2020 12:13:32 +0000 (13:13 +0100)]
Deny unreachable-pub

It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!

Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.

3 years agoMerge #6437
bors[bot] [Mon, 2 Nov 2020 11:18:03 +0000 (11:18 +0000)]
Merge #6437

6437: Document doer object anti-pattern r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpdate docs/dev/style.md
Aleksey Kladov [Mon, 2 Nov 2020 11:17:34 +0000 (12:17 +0100)]
Update docs/dev/style.md

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
3 years agoDocument doer object anti-pattern
Aleksey Kladov [Mon, 2 Nov 2020 11:08:49 +0000 (12:08 +0100)]
Document doer object anti-pattern

3 years agoMerge #6436
bors[bot] [Mon, 2 Nov 2020 04:46:09 +0000 (04:46 +0000)]
Merge #6436

6436: Textmate grammar: allow comments in attributes r=dustypomerleau a=dustypomerleau

Fixes #6419

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agofix: allow comments in attributes
Dusty Pomerleau [Mon, 2 Nov 2020 04:33:11 +0000 (15:33 +1100)]
fix: allow comments in attributes

3 years agoTest Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot.
James Leitch [Mon, 2 Nov 2020 00:20:55 +0000 (17:20 -0700)]
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot.

3 years agoMerge #6423
bors[bot] [Sat, 31 Oct 2020 14:22:36 +0000 (14:22 +0000)]
Merge #6423

6423: cargo update r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agocargo update
Jeremy Kolb [Sat, 31 Oct 2020 14:20:25 +0000 (10:20 -0400)]
cargo update

3 years agoMerge #6420
bors[bot] [Sat, 31 Oct 2020 09:00:26 +0000 (09:00 +0000)]
Merge #6420

6420: Update Cargo.toml r=flodiebold a=pksunkara

This was blocking the automated publishing.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
3 years agoUpdate Cargo.toml
Pavan Kumar Sunkara [Sat, 31 Oct 2020 07:49:57 +0000 (08:49 +0100)]
Update Cargo.toml

3 years agoMerge #6416
bors[bot] [Fri, 30 Oct 2020 19:07:29 +0000 (19:07 +0000)]
Merge #6416

6416: Respond with JSON-RPC error if we failed to deserialize request r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoRespond with JSON-RPC error if we failed to deserialize request
Aleksey Kladov [Fri, 30 Oct 2020 18:38:29 +0000 (19:38 +0100)]
Respond with JSON-RPC error if we failed to deserialize request

Historically, we intentinally violated JSON-RPC spec here by hard
crashing. The idea was to poke both the clients and servers to fix
stuff.

However, this is confusing for server implementors, and falls down in
one important place -- protocol extension are not always backwards
compatible, which causes crashes simply due to version mismatch. We
had once such case with our own extension, and one for semantic
tokens.

So let's be less adventerous and just err on the err side!

3 years agoMerge #6415
bors[bot] [Fri, 30 Oct 2020 18:22:03 +0000 (18:22 +0000)]
Merge #6415

6415: Upgrade Chalk to 0.36 r=flodiebold a=flodiebold

Quite a few changes, because Chalk got rid of the `ApplicationTy` nesting.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
3 years agoUpgrade Chalk to 0.36
Florian Diebold [Fri, 30 Oct 2020 17:57:16 +0000 (18:57 +0100)]
Upgrade Chalk to 0.36

Quite a few changes, because Chalk got rid of the `ApplicationTy` nesting.

3 years agoMerge #6411
bors[bot] [Fri, 30 Oct 2020 07:10:31 +0000 (07:10 +0000)]
Merge #6411

6411: remove FIXME after rust 1.47 comes out r=lnicola a=qy3u

Remove 'FIXME' after rust 1.47 comes out.  And for compatibility with versions before 1.47, did't remove 'src'.

Co-authored-by: yuqing <yuqing@ipfsforce.com>
3 years agoremove FIXME after rust 1.47 comes out
yuqing [Fri, 30 Oct 2020 06:58:59 +0000 (14:58 +0800)]
remove FIXME after rust 1.47 comes out

3 years agoMerge #6403
bors[bot] [Thu, 29 Oct 2020 15:16:22 +0000 (15:16 +0000)]
Merge #6403

6403: docs: Update Neovim nvim-lspconfig repository link r=lnicola a=rockerBOO

`nvim-lsp` updated their repository to `nvim-lspconfig` to lessen confusion about what it does.

Co-authored-by: Dave Lage <rockerboo@gmail.com>
3 years agodocs: Update Neovim nvim-lspconfig repository link
Dave Lage [Thu, 29 Oct 2020 15:08:12 +0000 (11:08 -0400)]
docs: Update Neovim nvim-lspconfig repository link

3 years agoKeep generic annotations when qualifying things
Lukas Wirth [Thu, 29 Oct 2020 09:25:15 +0000 (10:25 +0100)]
Keep generic annotations when qualifying things

3 years agoMerge #6398
bors[bot] [Wed, 28 Oct 2020 19:38:57 +0000 (19:38 +0000)]
Merge #6398

6398: cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo update
kjeremy [Wed, 28 Oct 2020 19:37:40 +0000 (15:37 -0400)]
cargo update

3 years agoMerge #6396
bors[bot] [Wed, 28 Oct 2020 17:06:25 +0000 (17:06 +0000)]
Merge #6396

6396: refactor(hir_ty): do not override DisplayTarget in hir_fmt r=flodiebold a=bnjjj

Linked to bug discovery from #6387

The main goal is to not use `display()` method inside `hir_fmt` to not override any parameters (like `DisplayTarget`).
cc @flodiebold

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agorefactor(hir_ty): do not override DisplayTarget in hir_fmt
Benjamin Coenen [Wed, 28 Oct 2020 16:58:16 +0000 (17:58 +0100)]
refactor(hir_ty): do not override DisplayTarget in hir_fmt

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6394
bors[bot] [Wed, 28 Oct 2020 15:00:25 +0000 (15:00 +0000)]
Merge #6394

6394: Smaller inlay hints r=SomeoneToIgnore a=kjeremy

This makes things a lot more readable but isn't officially supported by vscode: https://github.com/Microsoft/vscode/issues/9078

Inspired by Visual Studio, IntelliJ and Resharper.

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoMerge #6387
bors[bot] [Wed, 28 Oct 2020 14:54:00 +0000 (14:54 +0000)]
Merge #6387

6387: do not use associated types placeholder for inlay hint  r=flodiebold a=bnjjj

close #6191

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agodo not use associated types placeholder for inlay hint
Benjamin Coenen [Wed, 28 Oct 2020 14:42:51 +0000 (15:42 +0100)]
do not use associated types placeholder for inlay hint

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agodo not use associated types placeholder for inlay hint
Benjamin Coenen [Wed, 28 Oct 2020 14:09:47 +0000 (15:09 +0100)]
do not use associated types placeholder for inlay hint

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoSmaller inlay hints
kjeremy [Wed, 28 Oct 2020 13:52:23 +0000 (09:52 -0400)]
Smaller inlay hints

This makes things a lot more readable but isn't officially supported by vscode: https://github.com/Microsoft/vscode/issues/9078

Inspired by Visual Studio, IntelliJ and Resharper.

3 years agoMerge #6384
bors[bot] [Wed, 28 Oct 2020 13:15:28 +0000 (13:15 +0000)]
Merge #6384

6384: add doctest runnables on struct r=lnicola a=bnjjj

I will check for how to do the same on trait implementation on another PR.

#6356

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agodo not use associated types placeholder for inlay hint
Benjamin Coenen [Wed, 28 Oct 2020 11:29:42 +0000 (12:29 +0100)]
do not use associated types placeholder for inlay hint

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoAdd check if param name is similar to fn name
Matthew Sanetra [Thu, 1 Oct 2020 18:05:39 +0000 (19:05 +0100)]
Add check if param name is similar to fn name

3 years agoMerge #6392
bors[bot] [Wed, 28 Oct 2020 12:36:51 +0000 (12:36 +0000)]
Merge #6392

6392: Also set textDecoration: none on inlay hints r=SomeoneToIgnore a=lnicola

Closes #6380

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoAlso set textDecoration: none on inlay hints
Laurențiu Nicola [Wed, 28 Oct 2020 11:49:38 +0000 (13:49 +0200)]
Also set textDecoration: none on inlay hints

3 years agodo not use associated types placeholder for inlay hint
Benjamin Coenen [Wed, 28 Oct 2020 10:20:05 +0000 (11:20 +0100)]
do not use associated types placeholder for inlay hint

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agodo not use associated types placeholder for inlay hint #6191
Benjamin Coenen [Tue, 27 Oct 2020 19:23:09 +0000 (20:23 +0100)]
do not use associated types placeholder for inlay hint #6191

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6379
bors[bot] [Tue, 27 Oct 2020 14:49:37 +0000 (14:49 +0000)]
Merge #6379

6379: Highlight never type as BuiltinType r=matklad a=Veykril

Fixes #6374

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6382
bors[bot] [Tue, 27 Oct 2020 14:31:28 +0000 (14:31 +0000)]
Merge #6382

6382: Set font-wieght: normal on inlay hints r=SomeoneToIgnore a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #6383
bors[bot] [Tue, 27 Oct 2020 13:54:39 +0000 (13:54 +0000)]
Merge #6383

6383: Update client install command in dev docs r=kjeremy a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoadd doctest runnables on struct #6356
Benjamin Coenen [Tue, 27 Oct 2020 13:11:27 +0000 (14:11 +0100)]
add doctest runnables on struct #6356

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6376
bors[bot] [Tue, 27 Oct 2020 09:51:49 +0000 (09:51 +0000)]
Merge #6376

6376: Avoid impls_fnonce to return true when the trait solving is ambiguous  r=flodiebold a=GrayJack

This PR should fix #6375

This adds a variation of `method_resolution::implements_trait` called `method_resolution::implements_trait_unique`, that only returns true when the trait solving is unique, and also change `impls_fnonce` to use the later instead.

I also added a test just to be sure.

Co-authored-by: GrayJack <gr41.j4ck@gmail.com>
3 years agoadd doctest runnables on struct #6356
Benjamin Coenen [Tue, 27 Oct 2020 09:07:33 +0000 (10:07 +0100)]
add doctest runnables on struct #6356

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoUpdate client install command in dev docs
Laurențiu Nicola [Tue, 27 Oct 2020 07:48:20 +0000 (09:48 +0200)]
Update client install command in dev docs

3 years agoSet font-wieght: normal on inlay hints
Laurențiu Nicola [Tue, 27 Oct 2020 07:18:25 +0000 (09:18 +0200)]
Set font-wieght: normal on inlay hints

3 years agoMerge #6257
bors[bot] [Mon, 26 Oct 2020 21:40:56 +0000 (21:40 +0000)]
Merge #6257

6257: Don't suggest extracting out 1-tuple enum variants r=matklad a=repnop

Fixes #6241.

Co-authored-by: Wesley Norris <repnop@outlook.com>