]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoThread proc-macro types through the HIR
Jonas Schievink [Sat, 29 May 2021 18:32:57 +0000 (20:32 +0200)]
Thread proc-macro types through the HIR

3 years agoMerge #9050
bors[bot] [Sat, 29 May 2021 17:39:15 +0000 (17:39 +0000)]
Merge #9050

9050: hir_ty: use async ret type for inference inside async bodies r=flodiebold a=cynecx

Fixes #9004.

Co-authored-by: cynecx <me@cynecx.net>
3 years agoMerge #9054
bors[bot] [Sat, 29 May 2021 16:33:20 +0000 (16:33 +0000)]
Merge #9054

9054: fix: fix `matches!` macro on nightly toolchains r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoTreat `pat_param` like `pat` fragments
Jonas Schievink [Sat, 29 May 2021 16:32:32 +0000 (18:32 +0200)]
Treat `pat_param` like `pat` fragments

3 years agoMerge #9051
bors[bot] [Sat, 29 May 2021 16:23:59 +0000 (16:23 +0000)]
Merge #9051

9051: Fix incorrect setting descriptions r=lnicola a=sclu1034

Descriptions for diagnostic warning hint and info display were swapped.

Fixes #8485.

Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
3 years agohir_ty: use async ret type for inference inside async bodies
cynecx [Sat, 29 May 2021 16:16:20 +0000 (18:16 +0200)]
hir_ty: use async ret type for inference inside async bodies

3 years agoFix incorrect setting descriptions
Lucas Schwiderski [Sat, 29 May 2021 16:08:14 +0000 (18:08 +0200)]
Fix incorrect setting descriptions

Descriptions for diagnostic warning hint and info display were swapped.

Fixes #8485.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
3 years agoMerge #9048
bors[bot] [Sat, 29 May 2021 15:33:57 +0000 (15:33 +0000)]
Merge #9048

9048: Add some lint completion tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd some lint completion tests
Lukas Wirth [Sat, 29 May 2021 15:19:49 +0000 (17:19 +0200)]
Add some lint completion tests

3 years agoMerge #9046
bors[bot] [Sat, 29 May 2021 15:19:44 +0000 (15:19 +0000)]
Merge #9046

9046: fix: make `include!` etc. work in expression position r=jonas-schievink a=jonas-schievink

This PR removes determination of fragment kinds from the eager macro implementations. The fragment kind is always determined by the syntax position in which a macro is invoked, not by the macro implementation, even for eager macros.

This makes `include!` work in expression position, and should have the same effect for all macros that may be used in different positions.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove fragment kind knowledge from builtin macros
Jonas Schievink [Sat, 29 May 2021 15:17:08 +0000 (17:17 +0200)]
Remove fragment kind knowledge from builtin macros

3 years agoMerge #9027
bors[bot] [Sat, 29 May 2021 12:14:16 +0000 (12:14 +0000)]
Merge #9027

9027: feat: Attribute completion is context aware r=Veykril a=Veykril

This splits off the `lint` and `derive` completions into their own submodules of `attribute`.

The idea is to create a lazy global hashmap that maps `SyntaxKind` to attribute names(`&[&str]`) in which we index with the syntax kind of the "thing" we are attributing giving us the attributes back that are valid for this kind. Then we use this name to do a binary search on the attribute list to fetch and build the corresponding completion item.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agosimplify
Lukas Wirth [Sat, 29 May 2021 12:02:06 +0000 (14:02 +0200)]
simplify

3 years agoMerge #9041
bors[bot] [Fri, 28 May 2021 21:21:37 +0000 (21:21 +0000)]
Merge #9041

9041: internal: Implement prev sibling determination for `CompletionContext ` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMore completion pattern tests
Lukas Wirth [Fri, 28 May 2021 20:18:52 +0000 (22:18 +0200)]
More completion pattern tests

3 years agoImplement prev sibling determination for `CompletionContext`
Lukas Wirth [Fri, 28 May 2021 20:03:31 +0000 (22:03 +0200)]
Implement prev sibling determination for `CompletionContext`

3 years agosimplify
Lukas Wirth [Fri, 28 May 2021 18:46:09 +0000 (20:46 +0200)]
simplify

3 years agoMerge #9028
bors[bot] [Fri, 28 May 2021 15:26:20 +0000 (15:26 +0000)]
Merge #9028

9028: only advertise range formatting support if enabled r=Veykril a=euclio

Fixes #9009.

Co-authored-by: Andy Russell <arussell123@gmail.com>
3 years agoMerge #9040
bors[bot] [Fri, 28 May 2021 12:59:54 +0000 (12:59 +0000)]
Merge #9040

9040: Don't label derive macros with their banged_name r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/7072#issuecomment-850396203
This doesn't fix it non builtin derives yet I think cause of a FIXME somewhere that doesn't categorize proc-macro derives as derives yet
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't label derive macros with their banged_name
Lukas Wirth [Fri, 28 May 2021 12:55:12 +0000 (14:55 +0200)]
Don't label derive macros with their banged_name

3 years agoMerge #9038
bors[bot] [Fri, 28 May 2021 12:16:18 +0000 (12:16 +0000)]
Merge #9038

9038: Folding range for return types r=Veykril a=MozarellaMan

For issue #8957

![return type fold](https://user-images.githubusercontent.com/48062697/119979082-5c62e100-bfb2-11eb-9729-1dea1ce74de1.gif)

Co-authored-by: Ayomide Bamidele <48062697+MozarellaMan@users.noreply.github.com>
3 years agoTest for correct amount of emitted folds
Ayomide Bamidele [Fri, 28 May 2021 12:10:41 +0000 (13:10 +0100)]
Test for correct amount of emitted folds

3 years agoFolding range for return types
Ayomide Bamidele [Fri, 28 May 2021 11:39:02 +0000 (12:39 +0100)]
Folding range for return types

3 years agoMerge #9037
bors[bot] [Fri, 28 May 2021 11:03:18 +0000 (11:03 +0000)]
Merge #9037

9037: minor: Move runnable lenses below attributes r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMove runnable lenses below attributes
Lukas Wirth [Fri, 28 May 2021 10:55:07 +0000 (12:55 +0200)]
Move runnable lenses below attributes

3 years agoMerge #9036
bors[bot] [Fri, 28 May 2021 10:36:13 +0000 (10:36 +0000)]
Merge #9036

9036: Remove undocumented `TextDocumentSyncKind::Full` support r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoRemove undocumented `TextDocumentSyncKind::Full` support
Laurențiu Nicola [Fri, 28 May 2021 10:01:04 +0000 (13:01 +0300)]
Remove undocumented `TextDocumentSyncKind::Full` support

3 years agoMerge #9033
bors[bot] [Fri, 28 May 2021 01:21:45 +0000 (01:21 +0000)]
Merge #9033

9033: Complete keywords in (Assoc)ItemList with leading attribute r=Veykril a=Veykril

Fixes #7673
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoComplete keywords in (Assoc)ItemList with leading attribute
Lukas Wirth [Fri, 28 May 2021 01:20:55 +0000 (03:20 +0200)]
Complete keywords in (Assoc)ItemList with leading attribute

3 years agoMerge #9032
bors[bot] [Fri, 28 May 2021 00:43:16 +0000 (00:43 +0000)]
Merge #9032

9032: Only complete modules in empty use-statements r=Veykril a=Veykril

bors r+
Part of #8518

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoOnly complete modules in empty use-statements
Lukas Wirth [Fri, 28 May 2021 00:40:40 +0000 (02:40 +0200)]
Only complete modules in empty use-statements

3 years agoAdd another attribute completion test
Lukas Wirth [Thu, 27 May 2021 23:09:22 +0000 (01:09 +0200)]
Add another attribute completion test

3 years agoAdd attribute completion tests
Lukas Wirth [Thu, 27 May 2021 22:54:52 +0000 (00:54 +0200)]
Add attribute completion tests

3 years agoMerge #9029
bors[bot] [Thu, 27 May 2021 22:47:04 +0000 (22:47 +0000)]
Merge #9029

9029: minor: test that `ItemTree` makes `hir_def` queries syntax-independent r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoTest that `ItemTree` works as intended
Jonas Schievink [Thu, 27 May 2021 22:46:05 +0000 (00:46 +0200)]
Test that `ItemTree` works as intended

3 years agott muncher time
Lukas Wirth [Thu, 27 May 2021 22:35:21 +0000 (00:35 +0200)]
tt muncher time

3 years agoSplit attribute completion module into attribute, derive and lint modules
Lukas Wirth [Thu, 27 May 2021 21:40:33 +0000 (23:40 +0200)]
Split attribute completion module into attribute, derive and lint modules

3 years agoonly advertise range formatting support if enabled
Andy Russell [Thu, 27 May 2021 21:36:13 +0000 (17:36 -0400)]
only advertise range formatting support if enabled

3 years agoAttribute completion is context aware
Lukas Wirth [Thu, 27 May 2021 21:28:14 +0000 (23:28 +0200)]
Attribute completion is context aware

3 years agoMerge #9026
bors[bot] [Thu, 27 May 2021 19:13:34 +0000 (19:13 +0000)]
Merge #9026

9026: Complete modules in assoc item lists r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoComplete modules in item lists
Lukas Wirth [Thu, 27 May 2021 19:12:50 +0000 (21:12 +0200)]
Complete modules in item lists

3 years agoComplete modules in assoc item lists
Lukas Wirth [Thu, 27 May 2021 18:53:38 +0000 (20:53 +0200)]
Complete modules in assoc item lists

3 years agoMove hir_ty incremental test to its own file
Jonas Schievink [Thu, 27 May 2021 18:21:52 +0000 (20:21 +0200)]
Move hir_ty incremental test to its own file

3 years agoMerge #9020
bors[bot] [Thu, 27 May 2021 16:34:46 +0000 (16:34 +0000)]
Merge #9020

9020: fix: Don't complete non-macro item paths in impls and modules r=Veykril a=Veykril

Part of #8518
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoCleanup `ImmediateLocation` determination
Lukas Wirth [Thu, 27 May 2021 16:15:18 +0000 (18:15 +0200)]
Cleanup `ImmediateLocation` determination

3 years agoMerge #9024
bors[bot] [Thu, 27 May 2021 14:27:56 +0000 (14:27 +0000)]
Merge #9024

9024: internal: Don't store supertraits in ItemTree r=jonas-schievink a=lnicola

Closes #9010

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoDon't store supertraits in ItemTree
Laurențiu Nicola [Thu, 27 May 2021 13:52:15 +0000 (16:52 +0300)]
Don't store supertraits in ItemTree

3 years agoMerge #8997
bors[bot] [Thu, 27 May 2021 11:56:26 +0000 (11:56 +0000)]
Merge #8997

8997: internal: stop expanding UseTrees during ItemTree lowering r=jonas-schievink a=jonas-schievink

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

Messy diff, but `ItemTree` lowering got simpler, since we now have a strict 1-to-1 mapping between `ast::Item` and `ModItem`.

The most messy part is mapping a single `UseTree` back to its `ast::UseTree` counterpart for diagnostics, but I think the ad-hoc source map built during lowering does the job.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoDrop `ignore` from doctests
Jonas Schievink [Thu, 27 May 2021 11:55:31 +0000 (13:55 +0200)]
Drop `ignore` from doctests

3 years agoDon't complete non-macro item paths in impls and modules
Lukas Wirth [Thu, 27 May 2021 02:34:21 +0000 (04:34 +0200)]
Don't complete non-macro item paths in impls and modules

3 years agoMerge #9022
bors[bot] [Thu, 27 May 2021 08:59:53 +0000 (08:59 +0000)]
Merge #9022

9022: internal: disable debuginfo afterall r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: disable debuginfo afterall
Aleksey Kladov [Thu, 27 May 2021 08:53:33 +0000 (11:53 +0300)]
internal: disable debuginfo afterall

3 years agoMerge #9021
bors[bot] [Thu, 27 May 2021 08:17:10 +0000 (08:17 +0000)]
Merge #9021

9021: internal: explain the motivation behind early configuration r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: explain the motivation behind early configuration
Aleksey Kladov [Thu, 27 May 2021 08:16:14 +0000 (11:16 +0300)]
internal: explain the motivation behind early configuration

3 years agoMerge #9005
bors[bot] [Thu, 27 May 2021 07:04:15 +0000 (07:04 +0000)]
Merge #9005

9005: internal: Document semantic token tags r=matklad a=Veykril

Closes #6457

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9019
bors[bot] [Thu, 27 May 2021 01:48:36 +0000 (01:48 +0000)]
Merge #9019

9019: internal: simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agosimplify
Lukas Wirth [Thu, 27 May 2021 01:47:20 +0000 (03:47 +0200)]
simplify

3 years agoMerge #9018
bors[bot] [Thu, 27 May 2021 01:22:28 +0000 (01:22 +0000)]
Merge #9018

9018: Collapse more CompletionContext booleans into enums r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
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 agoDocument semantic token tags
Lukas Wirth [Wed, 26 May 2021 13:23:05 +0000 (15:23 +0200)]
Document semantic token tags

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 agoReduce memory usage a bit
Jonas Schievink [Tue, 25 May 2021 23:26:16 +0000 (01:26 +0200)]
Reduce memory usage a bit

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 agoClean up ItemTree lowering now that it's 1:1
Jonas Schievink [Tue, 25 May 2021 23:09:31 +0000 (01:09 +0200)]
Clean up ItemTree lowering now that it's 1:1

3 years agoStop expanding UseTrees during ItemTree lowering
Jonas Schievink [Tue, 25 May 2021 23:01:58 +0000 (01:01 +0200)]
Stop expanding UseTrees during ItemTree lowering

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