]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agominor: simplify
Aleksey Kladov [Wed, 28 Jul 2021 09:25:14 +0000 (12:25 +0300)]
minor: simplify

2 years agorefactor: Reuse the from_proto call in handle_hover
Alexander Gonzalez [Tue, 27 Jul 2021 22:21:47 +0000 (18:21 -0400)]
refactor: Reuse the from_proto call in handle_hover

2 years agofeat: Add the Hover Range server capability
Alexander Gonzalez [Tue, 27 Jul 2021 22:13:22 +0000 (18:13 -0400)]
feat: Add the Hover Range server capability

2 years agofix: Typos
Alexander Gonzalez [Tue, 27 Jul 2021 22:00:22 +0000 (18:00 -0400)]
fix: Typos

2 years agorefactor: Apply PR suggestions
Alexander Gonzalez [Tue, 27 Jul 2021 21:50:26 +0000 (17:50 -0400)]
refactor: Apply PR suggestions

2 years agochore: Remove unnecessary println! call
Alexander Gonzalez [Mon, 26 Jul 2021 21:42:36 +0000 (17:42 -0400)]
chore: Remove unnecessary println! call

2 years agolint: Format the typescript files properly
Alexander Gonzalez [Mon, 26 Jul 2021 21:33:21 +0000 (17:33 -0400)]
lint: Format the typescript files properly

2 years agotest: Update lsp_ext.rs hash
Alexander Gonzalez [Mon, 26 Jul 2021 21:07:04 +0000 (17:07 -0400)]
test: Update lsp_ext.rs hash

2 years agodocs: Update the lsp-extensions.md with the Hover Range capability
Alexander Gonzalez [Mon, 26 Jul 2021 21:05:59 +0000 (17:05 -0400)]
docs: Update the lsp-extensions.md with the Hover Range capability

2 years agotest: Add tests for when hovering fails
Alexander Gonzalez [Mon, 26 Jul 2021 20:19:12 +0000 (16:19 -0400)]
test: Add tests for when hovering fails

2 years agodocs: Improve the comments in crates/ide/src/hover.rs
Alexander Gonzalez [Mon, 26 Jul 2021 19:55:09 +0000 (15:55 -0400)]
docs: Improve the comments in crates/ide/src/hover.rs

2 years agotest: Add hover_range tests
Alexander Gonzalez [Mon, 26 Jul 2021 19:34:44 +0000 (15:34 -0400)]
test: Add hover_range tests

2 years agorefactor: Make handle_hover handle ranges too
Alexander Gonzalez [Mon, 26 Jul 2021 16:14:14 +0000 (12:14 -0400)]
refactor: Make handle_hover handle ranges too

2 years agofix: Unregister the removed command
Alexander Gonzalez [Sun, 25 Jul 2021 21:54:06 +0000 (17:54 -0400)]
fix: Unregister the removed command

2 years agorefactor: Remove unnecessary command
Alexander Gonzalez [Sun, 25 Jul 2021 21:50:16 +0000 (17:50 -0400)]
refactor: Remove unnecessary command

2 years agochore: Remove unnecessary log
Alexander Gonzalez [Sun, 25 Jul 2021 21:28:25 +0000 (17:28 -0400)]
chore: Remove unnecessary log

2 years agofeat: Completed the client side implementation of rust-analyzer/hoverRange
Alexander Gonzalez [Sun, 25 Jul 2021 21:26:54 +0000 (17:26 -0400)]
feat: Completed the client side implementation of rust-analyzer/hoverRange

2 years agofeat: Add the hover_range capability
Alexander Gonzalez [Sun, 25 Jul 2021 01:54:48 +0000 (21:54 -0400)]
feat: Add the hover_range capability

2 years agofeat: Extend the server with the hover_range capability
Alexander Gonzalez [Fri, 23 Jul 2021 02:08:28 +0000 (22:08 -0400)]
feat: Extend the server with the hover_range capability

2 years agoRemove some redundant clones
Laurențiu Nicola [Tue, 27 Jul 2021 09:28:58 +0000 (12:28 +0300)]
Remove some redundant clones

2 years agoMerge #9710
bors[bot] [Tue, 27 Jul 2021 17:30:37 +0000 (17:30 +0000)]
Merge #9710

9710: fix: Don't qualify self as crate in add_missing_impl_members assist r=Veykril a=Veykril

Fixes #7499

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't qualify self as crate in add_missing_impl_members assist
Lukas Wirth [Tue, 27 Jul 2021 17:29:47 +0000 (19:29 +0200)]
Don't qualify self as crate in add_missing_impl_members assist

2 years agoMerge #9709
bors[bot] [Tue, 27 Jul 2021 16:41:02 +0000 (16:41 +0000)]
Merge #9709

9709: fix: add capability for "open cargo.toml" lsp extension r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agofix: add capability for "open cargo.toml" lsp extension
Aleksey Kladov [Tue, 27 Jul 2021 16:40:19 +0000 (19:40 +0300)]
fix: add capability for "open cargo.toml" lsp extension

2 years agoMerge #9703
bors[bot] [Mon, 26 Jul 2021 22:23:35 +0000 (22:23 +0000)]
Merge #9703

9703: docs: Fix several typos and grammar mistakes r=matklad a=alexfertel

I took some time to clean up the dev docs a bit since I spent the whole week reading them. I am not a native speaker, so if you find something wrong please tell me and I'll fix it 😁

Co-authored-by: Alexander Gonzalez <alexfertel97@gmail.com>
2 years agodocs: Fix several typos and grammar mistakes
Alexander Gonzalez [Mon, 26 Jul 2021 22:15:40 +0000 (18:15 -0400)]
docs: Fix several typos and grammar mistakes

2 years agoMerge #9702
bors[bot] [Mon, 26 Jul 2021 18:28:32 +0000 (18:28 +0000)]
Merge #9702

9702: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Mon, 26 Jul 2021 11:30:41 +0000 (13:30 +0200)]
Simplify

2 years agoMerge #9701
bors[bot] [Mon, 26 Jul 2021 18:22:29 +0000 (18:22 +0000)]
Merge #9701

9701: fix: correctly update diagnostics when files are opened and closed r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agofix: correctly update diagnostics when files are opened and closed
Aleksey Kladov [Mon, 26 Jul 2021 18:18:22 +0000 (21:18 +0300)]
fix: correctly update diagnostics when files are opened and closed

Basically, this tracks the changes to `subscriptions` we use when
issuing a publish_diagnostics.

2 years agoRemove the legacy macro scoping hack
Jonas Schievink [Mon, 26 Jul 2021 17:58:14 +0000 (19:58 +0200)]
Remove the legacy macro scoping hack

2 years agointernal: prepare to track changes to mem_docs
Aleksey Kladov [Mon, 26 Jul 2021 17:16:47 +0000 (20:16 +0300)]
internal: prepare to track changes to mem_docs

2 years agoMerge #9558
bors[bot] [Mon, 26 Jul 2021 14:53:05 +0000 (14:53 +0000)]
Merge #9558

9558: Do not erase Cargo diagnostics from the closed documents r=matklad a=SomeoneToIgnore

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

The LSP specification at https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textDocument_publishDiagnostics states that

> Diagnostics notification are sent from the server to the client to signal results of validation runs.
>
> Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary. The following rule is used for VS Code servers that generate diagnostics:
>
>  *  if a language is single file only (for example HTML) then diagnostics are cleared by the server when the file is closed.
>  *  if a language has a project system (for example C#) diagnostics are not cleared when a file closes. When a project is opened all diagnostics for all files are recomputed (or read from a cache).
>
> When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side.

So for projects we should not clear any diagnostics from cargo/json projects.
Our "standalone file" mode is in a way a project too, with sysroot attached and a potential support for dynamic standalone files.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2 years agoMerge #9699
bors[bot] [Mon, 26 Jul 2021 13:23:17 +0000 (13:23 +0000)]
Merge #9699

9699: fix: Fix generic_arg not parsing opt_generic_arg_list properly in arg lists r=Veykril a=Veykril

Fixes #9697
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix generic_arg not parsing opt_generic_arg_list properly in arg lists
Lukas Wirth [Mon, 26 Jul 2021 13:21:19 +0000 (15:21 +0200)]
Fix generic_arg not parsing opt_generic_arg_list properly in arg lists

2 years agoMerge #9593
bors[bot] [Mon, 26 Jul 2021 10:36:31 +0000 (10:36 +0000)]
Merge #9593

9593: fix: Adding remove_unused_param for method and fixing same for assoc func r=matklad a=feniljain

Solves #9571

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
2 years agoMerge #9692
bors[bot] [Mon, 26 Jul 2021 10:29:24 +0000 (10:29 +0000)]
Merge #9692

9692: Use same cancelled spelling in doc and code. r=matklad a=mattiasgronlund

Right thing might be to update the spelling in the code to
follow American instead of English spelling, that is
using only canceled. But they should at least be aligned.

Co-authored-by: Mattias Grönlund <mattias@gronlund.se>
2 years agoMerge #9696
bors[bot] [Mon, 26 Jul 2021 08:43:58 +0000 (08:43 +0000)]
Merge #9696

9696: Fix some grammar / spelling mistakes r=lnicola a=jplatte

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2 years agoFix some grammar / spelling mistakes
Jonas Platte [Mon, 26 Jul 2021 08:12:41 +0000 (10:12 +0200)]
Fix some grammar / spelling mistakes

2 years agoUse same cancelled spelling in doc and code.
Mattias Grönlund [Sun, 25 Jul 2021 21:12:28 +0000 (23:12 +0200)]
Use same cancelled spelling in doc and code.

Right thing might be to update the spelling in the code to
follow American instead of English spelling, that is
using only canceled. But they should at least be aligned.

2 years agoMerge #9691
bors[bot] [Sun, 25 Jul 2021 13:52:35 +0000 (13:52 +0000)]
Merge #9691

9691: fix: Keep catch-all arm in fill_match_arms if it has a non-empty expression r=Veykril a=Veykril

Fixes #4165
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoKepp catch-all arm in fill_match_arms if it has a non-empty expression
Lukas Wirth [Sun, 25 Jul 2021 13:50:40 +0000 (15:50 +0200)]
Kepp catch-all arm in fill_match_arms if it has a non-empty expression

2 years agoMerge #9688
bors[bot] [Sat, 24 Jul 2021 18:37:13 +0000 (18:37 +0000)]
Merge #9688

9688: feat: Resolve derive attribute input macro paths in ide layer r=Veykril a=Veykril

Enables goto def, syntax highlighting and hover for `Foo` in `#[derive(Foo)]`.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4413
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoResolve derive attribute input macro paths in ide layer
Lukas Wirth [Sat, 24 Jul 2021 18:35:38 +0000 (20:35 +0200)]
Resolve derive attribute input macro paths in ide layer

2 years agoMerge #9686
bors[bot] [Sat, 24 Jul 2021 08:21:31 +0000 (08:21 +0000)]
Merge #9686

9686: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix typo
Laurențiu Nicola [Sat, 24 Jul 2021 08:20:40 +0000 (11:20 +0300)]
Fix typo

2 years agoBump deps
Laurențiu Nicola [Sat, 24 Jul 2021 08:16:32 +0000 (11:16 +0300)]
Bump deps

2 years agoMerge #9685
bors[bot] [Fri, 23 Jul 2021 18:22:09 +0000 (18:22 +0000)]
Merge #9685

9685: internal: add tests for tuple struct field completion and resolve a FIXME r=jonas-schievink a=jonas-schievink

This removes the last FIXME related to visibility and thus fixes https://github.com/rust-analyzer/rust-analyzer/issues/824

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoResolve tuple field visibility FIXME
Jonas Schievink [Fri, 23 Jul 2021 18:20:41 +0000 (20:20 +0200)]
Resolve tuple field visibility FIXME

2 years agoAdd tests for tuple struct field completion
Jonas Schievink [Fri, 23 Jul 2021 18:20:23 +0000 (20:20 +0200)]
Add tests for tuple struct field completion

2 years agoMerge #9684
bors[bot] [Fri, 23 Jul 2021 18:00:35 +0000 (18:00 +0000)]
Merge #9684

9684: Complete editable private items r=jonas-schievink a=jonas-schievink

This checks if a private item's location is editable (local source root), and completes them anyways if that's the case.

In order to test this, the `new_source_root` fixture command has been changed to take a `local` or `library` value, and to apply to all *following* files instead of the preceding ones (which would be hard to understand).

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoComplete editable private items
Jonas Schievink [Fri, 23 Jul 2021 17:57:16 +0000 (19:57 +0200)]
Complete editable private items

2 years agoMerge #9683
bors[bot] [Fri, 23 Jul 2021 15:07:10 +0000 (15:07 +0000)]
Merge #9683

9683: internal: Move out expression based `unqualified_path` completion tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd a Union to the base item completion test fixture
Lukas Wirth [Fri, 23 Jul 2021 15:02:39 +0000 (17:02 +0200)]
Add a Union to the base item completion test fixture

2 years agoMerge #9681
bors[bot] [Fri, 23 Jul 2021 14:59:26 +0000 (14:59 +0000)]
Merge #9681

9681: Respect `#[doc(hidden)]` in dot-completion r=jonas-schievink a=jonas-schievink

This adds `CompletionContext::is_visible` as a convenience method that checks visibility, presence of `doc(hidden)`, and whether the completed item is in the same crate as the completion site or not. We only complete `doc(hidden)` items from the same crate.

This doesn't yet work for *all* completions: `qualified_path` completions use `Module::scope` and `ScopeDef`, which doesn't work with this.

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

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoFix formatting and use `Iterator::any`
Jonas Schievink [Fri, 23 Jul 2021 14:45:14 +0000 (16:45 +0200)]
Fix formatting and use `Iterator::any`

2 years agoMove out unqualified_path completion tests
Lukas Wirth [Fri, 23 Jul 2021 14:37:19 +0000 (16:37 +0200)]
Move out unqualified_path completion tests

2 years agoAdd functions to base items completion test fixture
Lukas Wirth [Fri, 23 Jul 2021 14:09:30 +0000 (16:09 +0200)]
Add functions to base items completion test fixture

2 years agoMerge #9678
bors[bot] [Fri, 23 Jul 2021 13:56:57 +0000 (13:56 +0000)]
Merge #9678

9678: Add Configuration for Highlight Related Feature r=kdelorey a=kdelorey

# Summary
Adds basic configuration that allows you to control when the highlight related feature is activated. You can control this for references, break points, exit points, and yield points.

Resolves #9618

![config](https://user-images.githubusercontent.com/2295721/126728849-a38b560c-b687-42c1-9c41-7584ad718469.gif)

Co-authored-by: Kevin DeLorey <kdelorey.dev@gmail.com>
2 years agoRemoved all dead config accessors.
Kevin DeLorey [Fri, 23 Jul 2021 13:50:37 +0000 (07:50 -0600)]
Removed all dead config accessors.

2 years agoremoved dead code
Kevin DeLorey [Fri, 23 Jul 2021 13:41:55 +0000 (07:41 -0600)]
removed dead code

2 years agoRespect `#[doc(hidden)]` in dot-completion
Jonas Schievink [Fri, 23 Jul 2021 13:36:43 +0000 (15:36 +0200)]
Respect `#[doc(hidden)]` in dot-completion

2 years agoUpdated docs.
Kevin DeLorey [Fri, 23 Jul 2021 01:04:27 +0000 (19:04 -0600)]
Updated docs.

2 years agoAdded tests to ensure config behavior.
Kevin DeLorey [Fri, 23 Jul 2021 00:59:31 +0000 (18:59 -0600)]
Added tests to ensure config behavior.

2 years agoInitial commit of highlight related configuration w/ implementation.
Kevin DeLorey [Thu, 22 Jul 2021 01:44:16 +0000 (19:44 -0600)]
Initial commit of highlight related configuration w/ implementation.

2 years agoMerge #9677
bors[bot] [Fri, 23 Jul 2021 00:15:43 +0000 (00:15 +0000)]
Merge #9677

9677: fix: Correctly classify Rename Names r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoCorrectly classify Rename Names
Lukas Wirth [Fri, 23 Jul 2021 00:14:59 +0000 (02:14 +0200)]
Correctly classify Rename Names

2 years agoMerge #9676
bors[bot] [Thu, 22 Jul 2021 18:19:11 +0000 (18:19 +0000)]
Merge #9676

9676: minor: Describe the current lifetime/label completion specifics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDescribe the current lifetime/label completion specifics
Lukas Wirth [Thu, 22 Jul 2021 18:16:17 +0000 (20:16 +0200)]
Describe the current lifetime/label completion specifics

2 years agoMerge #9675
bors[bot] [Thu, 22 Jul 2021 18:04:09 +0000 (18:04 +0000)]
Merge #9675

9675: internal: Move and clean up record completion tests r=Veykril a=Veykril

Now all that's left are the expression related tests which will take some time to go through
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoClarify what the outline test module is for
Lukas Wirth [Thu, 22 Jul 2021 17:59:01 +0000 (19:59 +0200)]
Clarify what the outline test module is for

2 years agoMove out record completion tests
Lukas Wirth [Thu, 22 Jul 2021 17:38:49 +0000 (19:38 +0200)]
Move out record completion tests

2 years agoMerge #9674
bors[bot] [Thu, 22 Jul 2021 11:49:18 +0000 (11:49 +0000)]
Merge #9674

9674: fix: Fix pattern name resolution when name is also occupied in type namespace r=flodiebold a=jonas-schievink

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

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoMerge #9634
bors[bot] [Thu, 22 Jul 2021 11:43:05 +0000 (11:43 +0000)]
Merge #9634

9634: minor update to excludeDirs doc r=lnicola a=dae

I saw reference to globs in #7755, but it doesn't look like they're
actually supported, and I had to dig through the source to discover
that the folders are relative to the workspace root. Further digging
was required to get VS Code from hanging for long periods trying to
watch giant Bazel folders that had already been excluded from Rust
Analyzer. Hopefully this tweak will save others the confusion :-)

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2 years agoResolve tuple variants in value namespace
Jonas Schievink [Thu, 22 Jul 2021 11:40:18 +0000 (13:40 +0200)]
Resolve tuple variants in value namespace

2 years agomention files.watcherExclude
Damien Elmes [Thu, 22 Jul 2021 11:03:06 +0000 (21:03 +1000)]
mention files.watcherExclude

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2 years agoMerge #9453
bors[bot] [Thu, 22 Jul 2021 10:33:05 +0000 (10:33 +0000)]
Merge #9453

9453: Add first-class limits. r=matklad,lnicola a=rbartlensky

Partially fixes #9286.

This introduces a new `Limits` structure which is passed as an input
to `SourceDatabase`. This makes limits accessible almost everywhere in
the code, since most places have a database in scope.

One downside of this approach is that whenever you query limits, you
essentially do an `Arc::clone` which is less than ideal.

Let me know if I missed anything, or would like me to take a different approach!

Co-authored-by: Robert Bartlensky <bartlensky.robert@gmail.com>
2 years agoMerge #9671
bors[bot] [Thu, 22 Jul 2021 06:04:25 +0000 (06:04 +0000)]
Merge #9671

9671: minor: Fix a couple of clippy nits r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix a couple of clippy nits
Laurențiu Nicola [Thu, 22 Jul 2021 06:03:54 +0000 (09:03 +0300)]
Fix a couple of clippy nits

2 years agoMerge #9669
bors[bot] [Wed, 21 Jul 2021 19:41:59 +0000 (19:41 +0000)]
Merge #9669

9669: minor: Move out fn_param tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMove out fn_param tests
Lukas Wirth [Wed, 21 Jul 2021 19:39:40 +0000 (21:39 +0200)]
Move out fn_param tests

2 years agoMerge #9668
bors[bot] [Wed, 21 Jul 2021 18:52:49 +0000 (18:52 +0000)]
Merge #9668

9668: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix some more basic clippy lints
Lukas Wirth [Wed, 21 Jul 2021 18:52:08 +0000 (20:52 +0200)]
Fix some more basic clippy lints

2 years agoMerge #9667
bors[bot] [Wed, 21 Jul 2021 18:38:51 +0000 (18:38 +0000)]
Merge #9667

9667: minor: Remove proc macro ABI issue from bug report template r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRemove proc macro ABI issue from bug report template
Laurențiu Nicola [Wed, 21 Jul 2021 18:03:06 +0000 (21:03 +0300)]
Remove proc macro ABI issue from bug report template

2 years agoMerge #9666
bors[bot] [Wed, 21 Jul 2021 17:52:57 +0000 (17:52 +0000)]
Merge #9666

9666: minor: Fix some clippy lints in ide_completion r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix some clippy lints in ide_completion
Lukas Wirth [Wed, 21 Jul 2021 17:50:28 +0000 (19:50 +0200)]
Fix some clippy lints in ide_completion

2 years agoMerge #9665
bors[bot] [Wed, 21 Jul 2021 17:05:44 +0000 (17:05 +0000)]
Merge #9665

9665: Only complete ancestors and self in visibility path completions r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoOnly complete ancestors and self in visibility path completions
Lukas Wirth [Wed, 21 Jul 2021 16:54:12 +0000 (18:54 +0200)]
Only complete ancestors and self in visibility path completions

2 years agoMerge #9664
bors[bot] [Wed, 21 Jul 2021 16:47:41 +0000 (16:47 +0000)]
Merge #9664

9664: Minor completions cleanup r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Wed, 21 Jul 2021 16:31:12 +0000 (18:31 +0200)]
Simplify

2 years agoMerge #9663
bors[bot] [Wed, 21 Jul 2021 16:00:08 +0000 (16:00 +0000)]
Merge #9663

9663: fix: Don't offer extract_variable assist when there is no surrounding block r=Veykril a=Veykril

Fixes #9143
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #9662
bors[bot] [Wed, 21 Jul 2021 15:53:06 +0000 (15:53 +0000)]
Merge #9662

9662: fix: filter visiblities when resolving in extern crate r=jonas-schievink a=jonas-schievink

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

Also fixes a bunch of incorrect tests that were importing private items.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoDon't offer extract_variable assist when there is no surrounding block
Lukas Wirth [Wed, 21 Jul 2021 15:52:17 +0000 (17:52 +0200)]
Don't offer extract_variable assist when there is no surrounding block

2 years agofilter visiblities when resolving in extern crate
Jonas Schievink [Wed, 21 Jul 2021 15:51:56 +0000 (17:51 +0200)]
filter visiblities when resolving in extern crate

2 years agoMerge #9660
bors[bot] [Wed, 21 Jul 2021 12:57:30 +0000 (12:57 +0000)]
Merge #9660

9660: hide keyword suggestions in non trivial paths r=Veykril a=Freax13

This pr hides keyword suggestions in non trivial paths:
![now](https://user-images.githubusercontent.com/14952658/126479635-819127d8-322b-4e34-acd2-194d1e9ba504.png)

Previously rust analyzer suggested a lot of keywords even when completing non trivial paths:
![prev](https://user-images.githubusercontent.com/14952658/126478222-54c742bb-2bd3-4e5b-b533-f835264604be.png)

This had 2 problems:
1. Suggesting a keyword in this position doesn't make sense.
2. There are a lot of keywords, so they make it a lot harder to find the things you're actually looking for (note the scrollbar and that `instructions`, `registers` and `structures` are not visible).

Co-authored-by: Tom Dohrmann <erbse.13@gmx.de>
2 years agohide keyword suggestions in non trivial paths
Tom Dohrmann [Wed, 21 Jul 2021 10:53:50 +0000 (12:53 +0200)]
hide keyword suggestions in non trivial paths

2 years agoMerge #9658
bors[bot] [Wed, 21 Jul 2021 09:07:54 +0000 (09:07 +0000)]
Merge #9658

9658: docs: fix typo r=lnicola a=jsejcksn

tree -> three

Co-authored-by: Jesse Jackson <jsejcksn@users.noreply.github.com>
2 years agodocs: fix typo
Jesse Jackson [Wed, 21 Jul 2021 09:06:19 +0000 (04:06 -0500)]
docs: fix typo

tree -> three

2 years agoMerge #9656
bors[bot] [Tue, 20 Jul 2021 20:55:21 +0000 (20:55 +0000)]
Merge #9656

9656: Revert #9655 because it breaks some type inference r=flodiebold a=flodiebold

This reverts commit 8c8c6fb73da613b915e4b18decd74f06d46ab76a, reversing
changes made to ec7b4cbf8f7d6d88ae5280b72a93a7e5d0adb7c4.

bors r+

Co-authored-by: Florian Diebold <flodiebold@gmail.com>