]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agocollect blocks from unnamed consts too
Jake Heinz [Mon, 29 Nov 2021 01:11:31 +0000 (01:11 +0000)]
collect blocks from unnamed consts too

2 years agocollect defs from body blocks
Jake Heinz [Mon, 29 Nov 2021 01:09:39 +0000 (01:09 +0000)]
collect defs from body blocks

2 years agocleanups
Jake Heinz [Sun, 28 Nov 2021 00:42:42 +0000 (00:42 +0000)]
cleanups

2 years agomake navigation target go to original file location
Jake Heinz [Sat, 27 Nov 2021 13:48:50 +0000 (13:48 +0000)]
make navigation target go to original file location

2 years agoremove file symbols
Jake Heinz [Sat, 27 Nov 2021 13:00:02 +0000 (13:00 +0000)]
remove file symbols

2 years agocontainer name?
Jake Heinz [Sat, 27 Nov 2021 12:26:03 +0000 (12:26 +0000)]
container name?

2 years agouse Semantics::parse_or_expand in another place
Jake Heinz [Sat, 27 Nov 2021 11:55:03 +0000 (11:55 +0000)]
use Semantics::parse_or_expand in another place

2 years agosema parse_or_expand
Jake Heinz [Sat, 27 Nov 2021 11:49:51 +0000 (11:49 +0000)]
sema parse_or_expand

2 years agowip
Jake Heinz [Sat, 27 Nov 2021 11:25:05 +0000 (11:25 +0000)]
wip

2 years agoide: fix expansion for 'as _'
Jake Heinz [Sat, 27 Nov 2021 02:22:21 +0000 (02:22 +0000)]
ide: fix expansion for 'as _'

2 years agoMerge #10865
bors[bot] [Fri, 26 Nov 2021 02:59:07 +0000 (02:59 +0000)]
Merge #10865

10865: internal: Use the right `ItemTree` when re-resolving attr r=jonas-schievink a=jonas-schievink

Followup to https://github.com/rust-analyzer/rust-analyzer/pull/10863, which caused a panic when analyzing diesel

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoUse the right `ItemTree` when re-resolving attr
Jonas Schievink [Fri, 26 Nov 2021 02:57:25 +0000 (03:57 +0100)]
Use the right `ItemTree` when re-resolving attr

2 years agoMerge #10863
bors[bot] [Fri, 26 Nov 2021 00:52:02 +0000 (00:52 +0000)]
Merge #10863

10863: internal: build per-block `ItemTree`s r=Veykril a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7717
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8911
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8614

`ItemTree`s are now flat lists of items, so they should probably be renamed at some point.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoBuild per-block `ItemTree`s
Jonas Schievink [Thu, 25 Nov 2021 23:17:20 +0000 (00:17 +0100)]
Build per-block `ItemTree`s

2 years agoMerge #10859
bors[bot] [Thu, 25 Nov 2021 15:35:18 +0000 (15:35 +0000)]
Merge #10859

10859: fix: Prioritize tuple fields in highlight_related r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Prioritize tuple fields in highlight_related
Lukas Wirth [Thu, 25 Nov 2021 15:34:32 +0000 (16:34 +0100)]
fix: Prioritize tuple fields in highlight_related

2 years agoMerge #10824
bors[bot] [Thu, 25 Nov 2021 15:12:38 +0000 (15:12 +0000)]
Merge #10824

10824: project_model: print full cargo command if cargo metadata fails to run r=Veykril a=jhgg

well, `Command` implements a sensible `Debug` which *roughly* does what we want to do. Unfortunately it's got a bit of a quote situation,

So it'd output something like `"cargo" "metadata"  "--format-version" "1" "--features" "foo,bar,baz"`.

Which although is a bit verbose with the quotes, it's at the very least, not entirely incorrect/misleading.

fixes #10797

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agoMerge #10847
bors[bot] [Wed, 24 Nov 2021 15:33:00 +0000 (15:33 +0000)]
Merge #10847

10847: fix: derive attr path handling in `replace_derive_with_manual_impl` r=rainy-me a=rainy-me

partially fixes #10666

renaming issues mentioned in https://github.com/rust-analyzer/rust-analyzer/issues/10666#issuecomment-955671021 doesn't seem to be fixable at this moment since it's not searchable?(not recorded?) by name.

<del>I'm not sure if it's appropriate to move `parse_comma_sep_paths` function to a method in `ast/node_ext`, maybe `ide_db::helpers` also make sense.</del> put into `ide_db::` instead.

Co-authored-by: rainy-me <github@yue.coffee>
2 years agofix: derive path handling
rainy-me [Wed, 24 Nov 2021 15:21:29 +0000 (00:21 +0900)]
fix: derive path handling

2 years agoMerge #10853
bors[bot] [Wed, 24 Nov 2021 15:08:44 +0000 (15:08 +0000)]
Merge #10853

10853: fix: Remove possible multiline details in completions r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10316
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7531(this has already been fixed prior, from what I've seen)
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove possible multiline details in completions
Lukas Wirth [Wed, 24 Nov 2021 15:01:33 +0000 (16:01 +0100)]
Remove possible multiline details in completions

2 years agoMerge #10846
bors[bot] [Tue, 23 Nov 2021 21:22:27 +0000 (21:22 +0000)]
Merge #10846

10846: fix: qualify struct name in struct constructor completion r=Veykril a=andrewleverette

* Alter `add_struct_literal` method signature to take an optional module path
* Update `render_literal` method to use a qualified

Relates to issue #10771

Side note: This is my first contribution. Any feedback is welcome!

Co-authored-by: Andrew Leverette <andrewleverette@gmail.com>
2 years agoMerge #10849
bors[bot] [Tue, 23 Nov 2021 21:13:35 +0000 (21:13 +0000)]
Merge #10849

10849: fix: Disable string highlight injection for macros changing string literals r=Veykril a=Veykril

Fixes #10845
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDisable string highlight injection for macros changing string literals
Lukas Wirth [Tue, 23 Nov 2021 21:05:52 +0000 (22:05 +0100)]
Disable string highlight injection for macros changing string literals

2 years agoAdd optimization for not allocating in case of no module path for struct literal
Andrew Leverette [Tue, 23 Nov 2021 20:41:31 +0000 (14:41 -0600)]
Add optimization for not allocating in case of no module path for struct literal

2 years agoAdd support for qualified struct names
Andrew Leverette [Tue, 23 Nov 2021 16:57:29 +0000 (10:57 -0600)]
Add support for qualified struct names

2 years agoMerge #10840
bors[bot] [Tue, 23 Nov 2021 15:21:47 +0000 (15:21 +0000)]
Merge #10840

10840: fix: Omit generic defaults for types in hover messages r=jonas-schievink a=Veykril

Fixes #9198

We have ranged hovers now which query specifically for the type of an expression/pattern, so if interested in seeing the default, the user can use that functionality instead.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #10834
bors[bot] [Mon, 22 Nov 2021 19:03:07 +0000 (19:03 +0000)]
Merge #10834

10834: Make lint groups work correctly with `warningsAsInfo` and `warningsAsHint` r=Veykril a=Emilgardis

this change makes it possible to specify

```json
{
   "rust-analyzer.diagnostics.warningsAsInfo": ["unused"],
}
```

to make all lints in the `unused` group show as info, etc.

Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
2 years agoMake lint groups work correctly with `warningsAsInfo` and `warningsAsHint`
Emil Gardström [Mon, 22 Nov 2021 13:14:21 +0000 (14:14 +0100)]
Make lint groups work correctly with `warningsAsInfo` and `warningsAsHint`

2 years agofix: Omit generic defaults for types in hover messages
Lukas Wirth [Mon, 22 Nov 2021 17:27:03 +0000 (18:27 +0100)]
fix: Omit generic defaults for types in hover messages

2 years agoMerge #10839
bors[bot] [Mon, 22 Nov 2021 17:01:40 +0000 (17:01 +0000)]
Merge #10839

10839: fix: Fix mbe::Shift::new not accounting for non-ident token ids r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix mbe::Shift::new not accounting for non-ident token ids
Lukas Wirth [Mon, 22 Nov 2021 17:00:32 +0000 (18:00 +0100)]
Fix mbe::Shift::new not accounting for non-ident token ids

2 years agoDocument token up/down mapping
Lukas Wirth [Mon, 22 Nov 2021 16:58:36 +0000 (17:58 +0100)]
Document token up/down mapping

2 years agoMerge #10838
bors[bot] [Mon, 22 Nov 2021 15:59:52 +0000 (15:59 +0000)]
Merge #10838

10838: internal: Add the ability to emit token map ids in macro expansion tests r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd to macro testing infra to emit token map ids
Lukas Wirth [Mon, 22 Nov 2021 14:59:41 +0000 (15:59 +0100)]
Add to macro testing infra to emit token map ids

2 years agoMerge #10809
bors[bot] [Mon, 22 Nov 2021 14:29:24 +0000 (14:29 +0000)]
Merge #10809

10809: fix: don't discard formatting of `use` lines r=Veykril a=iDawer

Use mutable syntax trees in `merge_imports`, `split_imports`. This tries to resolve #9013. But I haven't much managed to simplify code of merging.

Also resolve #9361. It reuses a use tree under the cursor so that comments+indentation are preserved. Merged trees are just appended to the end.

This touches bunch of tests. I removed the sorting of use trees as it needs a proper implementation that takes into account comments and line wrapping. I think it is rustfmt's job or at least until we get a close implementation.

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2 years agoMerge #10835
bors[bot] [Mon, 22 Nov 2021 13:47:25 +0000 (13:47 +0000)]
Merge #10835

10835: internal: pull website before generating new changelog r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoPull website before generating new changelog
Jonas Schievink [Mon, 22 Nov 2021 13:45:47 +0000 (14:45 +0100)]
Pull website before generating new changelog

2 years agoMerge #10833
bors[bot] [Mon, 22 Nov 2021 12:42:03 +0000 (12:42 +0000)]
Merge #10833

10833: internal: set upstream branch when promoting r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoSet upstream branch when promoting
Jonas Schievink [Mon, 22 Nov 2021 12:39:07 +0000 (13:39 +0100)]
Set upstream branch when promoting

2 years agoMerge #10832
bors[bot] [Mon, 22 Nov 2021 12:23:58 +0000 (12:23 +0000)]
Merge #10832

10832: internal: Split parts of `ide_db::call_info` off into `ide` r=Veykril a=Veykril

`call_info` itself is just an ide feature and thus should not reside in `ide_db` itself.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSplit parts of `ide_db::call_info` off into `ide`
Lukas Wirth [Mon, 22 Nov 2021 12:19:46 +0000 (13:19 +0100)]
Split parts of `ide_db::call_info` off into `ide`

2 years agoMerge #10831
bors[bot] [Mon, 22 Nov 2021 12:05:57 +0000 (12:05 +0000)]
Merge #10831

10831: minor: Unnest `ide::display::navigation_target` module r=Veykril a=Veykril

This module contained multiple submodules before, but those were removed some time ago so there is no point in having this one module two layers deep anymore.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUnnest ide::display::navigation_target module
Lukas Wirth [Mon, 22 Nov 2021 12:04:28 +0000 (13:04 +0100)]
Unnest ide::display::navigation_target module

2 years agoMerge #10828
bors[bot] [Mon, 22 Nov 2021 10:07:23 +0000 (10:07 +0000)]
Merge #10828

10828: doc: document absence of stability guarantees r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agodoc: document absence of stability guarantees
Aleksey Kladov [Mon, 22 Nov 2021 10:06:37 +0000 (13:06 +0300)]
doc: document absence of stability guarantees

2 years agoMerge #10823
bors[bot] [Sun, 21 Nov 2021 20:01:07 +0000 (20:01 +0000)]
Merge #10823

10823: fix: better `Fn` traits formatting r=jonas-schievink a=veber-alex

This makes it so formatting `Fn` traits properly handles:

1. An `Fn` trait with only a single argument -> removes the trailing comma.
2. An `Fn` trait which returns nothing (an empty tuple) -> don't show `-> ()` as the return type.

before:
![before](https://user-images.githubusercontent.com/29788806/142745038-44ac68ce-de42-4396-a809-ffdb883be699.png)

after:
![after](https://user-images.githubusercontent.com/29788806/142745040-485feaa2-cc21-4a05-9576-5410ea355029.png)

Co-authored-by: Alex Veber <alexveber@gmail.com>
2 years agoproject_model: print full cargo command if it fails to run
Jake Heinz [Sun, 21 Nov 2021 01:18:42 +0000 (01:18 +0000)]
project_model: print full cargo command if it fails to run

2 years agofix: better `Fn` traits formatting
Alex Veber [Sun, 21 Nov 2021 00:39:22 +0000 (02:39 +0200)]
fix: better `Fn` traits formatting

2 years agoMerge #10810
bors[bot] [Sat, 20 Nov 2021 20:24:31 +0000 (20:24 +0000)]
Merge #10810

10810: feat: Add toggle to disable cache priming r=jonas-schievink a=lnicola

Even if it doesn't prevent the rest of the features from working, cache priming tends to be quite CPU-intensive and can make people think that the load times are worse than they actually are.

It's also less useful in Code and `rust-tools` because the inlay hints and semantic highlighting trigger quite a bit of computation assuming you have a file open in the editor.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #10821
bors[bot] [Sat, 20 Nov 2021 17:25:17 +0000 (17:25 +0000)]
Merge #10821

10821: fix: wrap `inline_call` and `inline_into_callers` if it inlines into the left side of a binary expression r=Veykril a=rainy-me

close #10359

Co-authored-by: rainy-me <github@yue.coffee>
2 years agofix: check inline left of binary_expression
rainy-me [Sat, 20 Nov 2021 16:48:04 +0000 (01:48 +0900)]
fix: check inline left of binary_expression

2 years agoMerge #10820
bors[bot] [Sat, 20 Nov 2021 16:26:50 +0000 (16:26 +0000)]
Merge #10820

10820: minor: Move incorrect case diagnostic things into their module r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMove incorrect case diagnostic things into their module
Lukas Wirth [Sat, 20 Nov 2021 16:19:19 +0000 (17:19 +0100)]
Move incorrect case diagnostic things into their module

2 years agoMerge #10819
bors[bot] [Sat, 20 Nov 2021 15:40:56 +0000 (15:40 +0000)]
Merge #10819

10819: internal: Replace some `Vec` occurences with `Box`  r=Veykril a=Veykril

Shaves off ~15mb from self analysis

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoReplace Vec with Box in Path.generic_args field
Lukas Wirth [Sat, 20 Nov 2021 15:37:41 +0000 (16:37 +0100)]
Replace Vec with Box in Path.generic_args field

2 years agointernal: Replace Vec with Box in hir Pat
Lukas Wirth [Sat, 20 Nov 2021 15:17:16 +0000 (16:17 +0100)]
internal: Replace Vec with Box in hir Pat

2 years agointernal: Replace Vec with Box in hir Expr
Lukas Wirth [Sat, 20 Nov 2021 15:00:45 +0000 (16:00 +0100)]
internal: Replace Vec with Box in hir Expr

2 years agoMerge #10817
bors[bot] [Sat, 20 Nov 2021 12:01:22 +0000 (12:01 +0000)]
Merge #10817

10817: ide: hover omits unnamed where preds r=Veykril a=jhgg

fixes #10800

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agoide: hover omits unnamed where preds
Jake Heinz [Sat, 20 Nov 2021 11:30:53 +0000 (11:30 +0000)]
ide: hover omits unnamed where preds

2 years agoMerge #10812
bors[bot] [Fri, 19 Nov 2021 20:02:26 +0000 (20:02 +0000)]
Merge #10812

10812: feat: Format `Fn` traits using parentheses r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoFormat `Fn` traits using parentheses
Jonas Schievink [Fri, 19 Nov 2021 18:58:00 +0000 (19:58 +0100)]
Format `Fn` traits using parentheses

2 years agoAdd toggle to disable cache priming
Laurențiu Nicola [Fri, 19 Nov 2021 15:56:46 +0000 (17:56 +0200)]
Add toggle to disable cache priming

2 years agoMerge #10808
bors[bot] [Fri, 19 Nov 2021 15:35:09 +0000 (15:35 +0000)]
Merge #10808

10808: fix: show custom check-command r=Veykril a=Florian-Schoenherr

just realized this is a lot cleaner and actually shows something on a custom command,
also debugged it this time.

Co-authored-by: Florian-Schoenherr <65456722+Florian-Schoenherr@users.noreply.github.com>
2 years agofix: show custom check-command
Florian-Schoenherr [Fri, 19 Nov 2021 15:22:39 +0000 (16:22 +0100)]
fix: show custom check-command

2 years agoUse mutable syntax trees in `merge_imports`, `split_imports`
iDawer [Fri, 19 Nov 2021 09:06:36 +0000 (14:06 +0500)]
Use mutable syntax trees in `merge_imports`, `split_imports`

2 years agoMerge #10807
bors[bot] [Fri, 19 Nov 2021 12:20:13 +0000 (12:20 +0000)]
Merge #10807

10807: fix: Diagnose invalid derive attribute input r=Veykril a=Veykril

Doesn't yet diagnose incorrect syntax between the `(`, `)` braces as we discard those problems currently.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Diagnose invalid derive attribute input
Lukas Wirth [Fri, 19 Nov 2021 12:17:35 +0000 (13:17 +0100)]
fix: Diagnose invalid derive attribute input

2 years agoMerge #10806
bors[bot] [Fri, 19 Nov 2021 11:46:49 +0000 (11:46 +0000)]
Merge #10806

10806: fix: inlay param hint hiding heurstic is case unsensitive r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: inlay param hint hiding heurstic is case unsensitive
Lukas Wirth [Fri, 19 Nov 2021 11:46:03 +0000 (12:46 +0100)]
fix: inlay param hint hiding heurstic is case unsensitive

2 years agoMerge #10804
bors[bot] [Fri, 19 Nov 2021 11:34:22 +0000 (11:34 +0000)]
Merge #10804

10804: fix: Diagnose using `derive` on non-adt items r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Diagnose using `derive` on non-adt items
Lukas Wirth [Thu, 18 Nov 2021 21:17:22 +0000 (22:17 +0100)]
fix: Diagnose using `derive` on non-adt items

2 years agoMerge #10805
bors[bot] [Fri, 19 Nov 2021 10:59:49 +0000 (10:59 +0000)]
Merge #10805

10805: ide: dedupe or merge hover actions r=Veykril a=jhgg

fixes #10780

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agoide: dedupe or merge hover actions
Jake Heinz [Thu, 18 Nov 2021 11:34:33 +0000 (11:34 +0000)]
ide: dedupe or merge hover actions

2 years agoMerge #10803
bors[bot] [Thu, 18 Nov 2021 20:45:20 +0000 (20:45 +0000)]
Merge #10803

10803: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Simplify
Lukas Wirth [Thu, 18 Nov 2021 20:43:54 +0000 (21:43 +0100)]
minor: Simplify

2 years agoMerge #10798
bors[bot] [Thu, 18 Nov 2021 09:56:44 +0000 (09:56 +0000)]
Merge #10798

10798: ide: show go to for function hover return type r=Veykril a=jhgg

I've found myself wanting this...  adds to the hover quick go-to for a function's return type:

![image](https://user-images.githubusercontent.com/5489149/142375722-4a385216-494b-45a4-be1c-59664213b8d6.png)

This is particularly useful when you are hovering over a function in a long chain, like:

```rust
foo.bar().b$0az().some_trait_fn();
```

where `baz`'s return type is not immediately obvious, but the chain is not long enough to trigger chain inlay hints...

i guess I could just select `foo.bar().baz()` too to get the types too...

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agoMerge #10796
bors[bot] [Thu, 18 Nov 2021 09:48:10 +0000 (09:48 +0000)]
Merge #10796

10796: ide: display static values in hover r=Veykril a=jhgg

Continuation from #10785 - does the same thing, but for `static`'s as well.

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agoMerge #10795
bors[bot] [Thu, 18 Nov 2021 09:40:59 +0000 (09:40 +0000)]
Merge #10795

10795: Remove unwrap in doc path resolution r=Veykril a=udoprog

I keep hitting this constantly in my project, and I haven't dug very deep into the root cause. But seeing as the project otherwise compiles it appears to be something unsupported is being incorrectly parsed in rust-analyzer which for other cases is handled by returning `None`.

Co-authored-by: John-John Tedro <udoprog@tedro.se>
2 years agoMerge #10794
bors[bot] [Thu, 18 Nov 2021 09:33:47 +0000 (09:33 +0000)]
Merge #10794

10794: fix: parse the range pat inside the tuple pat r=lnicola a=XFFXFF

fixes #10784

Co-authored-by: zhoufan <1247714429@qq.com>
2 years agoMerge #10799
bors[bot] [Thu, 18 Nov 2021 08:38:07 +0000 (08:38 +0000)]
Merge #10799

10799: fix: Fix proc macro ABI version checks r=lnicola a=lnicola

If I'm reading this right, we used to pick `Abi1_55` for `1.54` and `Abi_1_58` for `1.57`.

CC `@alexjg` (just in case I'm misinterpreting the code), CC #10772.

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix proc macro ABI version checks
Laurențiu Nicola [Thu, 18 Nov 2021 08:12:29 +0000 (10:12 +0200)]
Fix proc macro ABI version checks

2 years agoide: show go to for function hover return type
Jake Heinz [Thu, 18 Nov 2021 08:00:22 +0000 (08:00 +0000)]
ide: show go to for function hover return type

2 years agoide: display static values in hover
Jake Heinz [Thu, 18 Nov 2021 04:47:07 +0000 (04:47 +0000)]
ide: display static values in hover

2 years agoRemove unwrap in doc path resolution
John-John Tedro [Thu, 18 Nov 2021 04:19:58 +0000 (05:19 +0100)]
Remove unwrap in doc path resolution

2 years agoMerge #10785
bors[bot] [Thu, 18 Nov 2021 04:17:16 +0000 (04:17 +0000)]
Merge #10785

10785: ide: show const value in hover r=jhgg a=jhgg

fixes #10783

I think my original attempt was incorrect, because it looks like `HirDisplay` is used in more places than just the hover.

So, I've attempted it again in 312eafe, this time specifically just rendering the value in `hover::render`

pictoral:

![image](https://user-images.githubusercontent.com/5489149/142163890-b6aa2ab4-7bd0-4dd3-b35d-5eaa83fffb7f.png)

Co-authored-by: Jake Heinz <jh@discordapp.com>
Co-authored-by: Jake <jh@discordapp.com>
2 years agomore complicated const test
Jake Heinz [Thu, 18 Nov 2021 04:14:11 +0000 (04:14 +0000)]
more complicated const test

2 years agofix: parse the range pat inside the tuple pat
zhoufan [Thu, 18 Nov 2021 03:11:37 +0000 (11:11 +0800)]
fix: parse the range pat inside the tuple pat

2 years agoMerge #10789
bors[bot] [Wed, 17 Nov 2021 20:11:21 +0000 (20:11 +0000)]
Merge #10789

10789: internal: Check for derive attributes by item path, not `derive` identifier r=Veykril a=Veykril

Prior we only checked if an attribute is the exact `derive` identifier and nothing else to collect derive attributes. That means when we encounter the following:
```rs
#[::core::macros::builtin::derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ModPath {
    pub kind: PathKind,
    segments: Vec<Name>,
}
```
We won't actually expand the derive attributes, but instead we just expand the `derive` attribute with our dummy identity expander.

The changes here make it so we actually lookup the attribute path, check if it is the derive attribute and then collect the derives.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Wed, 17 Nov 2021 19:51:15 +0000 (20:51 +0100)]
Simplify

2 years agoCheck for derive attributes by item path, not `derive` identifier
Lukas Wirth [Wed, 17 Nov 2021 18:46:32 +0000 (19:46 +0100)]
Check for derive attributes by item path, not `derive` identifier

2 years agoApply suggestions from code review
Jake [Wed, 17 Nov 2021 17:53:24 +0000 (09:53 -0800)]
Apply suggestions from code review

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #10787
bors[bot] [Wed, 17 Nov 2021 14:55:18 +0000 (14:55 +0000)]
Merge #10787

10787: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Wed, 17 Nov 2021 14:30:12 +0000 (15:30 +0100)]
Simplify

2 years agoMerge #10786
bors[bot] [Wed, 17 Nov 2021 10:39:19 +0000 (10:39 +0000)]
Merge #10786

10786: minor: remove duplicate calls r=Veykril a=XFFXFF

`scopes.set_scope(*expr, scope)` is duplicate, because we always call it in `compute_expr_scopes`  https://github.com/rust-analyzer/rust-analyzer/blob/add6cccd4c923fbb5c83cc27b06aa84b2cbc9557/crates/hir_def/src/body/scope.rs#L175-L180

Co-authored-by: zhoufan <1247714429@qq.com>
2 years agominor: remove duplicate calls
zhoufan [Wed, 17 Nov 2021 10:16:25 +0000 (18:16 +0800)]
minor: remove duplicate calls

2 years agomaybe this is better??
Jake Heinz [Wed, 17 Nov 2021 07:00:24 +0000 (07:00 +0000)]
maybe this is better??

2 years agohir: show const value in hover
Jake Heinz [Wed, 17 Nov 2021 05:49:27 +0000 (05:49 +0000)]
hir: show const value in hover

2 years agoMerge #10781
bors[bot] [Tue, 16 Nov 2021 20:51:09 +0000 (20:51 +0000)]
Merge #10781

10781: internal: Do not use reference search in `runnables::related_tests` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #10778
bors[bot] [Tue, 16 Nov 2021 20:33:58 +0000 (20:33 +0000)]
Merge #10778

10778: internal: Skip test/bench attr expansion in resolution instead of collection r=Veykril a=Veykril

This way we skip any path resolving to the test and bench attributes instead of just the lone identifiers(which could very well point to non-builtin attributes).
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>