]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd support for mallinfo2 on glibc Linux
Jonas Schievink [Thu, 10 Jun 2021 12:58:52 +0000 (14:58 +0200)]
Add support for mallinfo2 on glibc Linux

3 years agoMerge #9202
bors[bot] [Thu, 10 Jun 2021 12:09:54 +0000 (12:09 +0000)]
Merge #9202

9202: feat: Make `MemoryUsage` work on Windows r=jonas-schievink a=jonas-schievink

Unfortunately there is no convenient API for heap statistics, so this instead uses the Commit Charge value, which is the amount of memory that needs to be allocated either in physical RAM or in the page file. This approximation seems to be good enough to find queries that waste a large amount of memory, but it should generally be expected to be off by several MB.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMake `MemoryUsage` work on Windows
Jonas Schievink [Wed, 9 Jun 2021 20:55:50 +0000 (22:55 +0200)]
Make `MemoryUsage` work on Windows

3 years agoMerge #9196
bors[bot] [Wed, 9 Jun 2021 22:27:07 +0000 (22:27 +0000)]
Merge #9196

9196: fix: Don't classify attributes on macro-calls are the macro itself r=Veykril a=Veykril

Fixes #9184
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't classify attributes on macro-calls are the macro itself
Lukas Wirth [Wed, 9 Jun 2021 22:25:36 +0000 (00:25 +0200)]
Don't classify attributes on macro-calls are the macro itself

3 years agoMerge #9195
bors[bot] [Wed, 9 Jun 2021 21:45:35 +0000 (21:45 +0000)]
Merge #9195

9195: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSimplify
Lukas Wirth [Wed, 9 Jun 2021 21:43:22 +0000 (23:43 +0200)]
Simplify

3 years agoMerge #9193
bors[bot] [Wed, 9 Jun 2021 17:21:50 +0000 (17:21 +0000)]
Merge #9193

9193: Implement dummy expansions for builtin attributes r=jonas-schievink a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRemove unnecessary duplication
Lukas Wirth [Wed, 9 Jun 2021 16:42:01 +0000 (18:42 +0200)]
Remove unnecessary duplication

3 years agoImplement dummy expansions for builtin attributes
Lukas Wirth [Wed, 9 Jun 2021 16:02:31 +0000 (18:02 +0200)]
Implement dummy expansions for builtin attributes

3 years agoMerge #9191
bors[bot] [Wed, 9 Jun 2021 13:17:38 +0000 (13:17 +0000)]
Merge #9191

9191: fix: Don't descend MacroCall TokenTree delimiters r=jonas-schievink a=Veykril

Fixes #9190

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't descend MacroCall TokenTree delimiters
Lukas Wirth [Wed, 9 Jun 2021 13:02:11 +0000 (15:02 +0200)]
Don't descend MacroCall TokenTree delimiters

3 years agoMerge #9186
bors[bot] [Tue, 8 Jun 2021 21:08:58 +0000 (21:08 +0000)]
Merge #9186

9186: fix: Prefer attr macros in "expand macro recursively" r=jonas-schievink a=jonas-schievink

This allows expanding attribute macros on fn-like macro invocations

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #9183
bors[bot] [Tue, 8 Jun 2021 20:47:10 +0000 (20:47 +0000)]
Merge #9183

9183: Fix typo r=lnicola a=phynalle

Co-authored-by: phynalle <phynalism@gmail.com>
3 years agoPrefer attr macros in "expand macro recursively"
Jonas Schievink [Tue, 8 Jun 2021 20:13:22 +0000 (22:13 +0200)]
Prefer attr macros in "expand macro recursively"

3 years agoMerge #9187
bors[bot] [Tue, 8 Jun 2021 20:18:54 +0000 (20:18 +0000)]
Merge #9187

9187: fix: Fix edge case for ImportGranularity guessing r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix edge case for ImportGranularity guessing
Lukas Wirth [Tue, 8 Jun 2021 20:14:30 +0000 (22:14 +0200)]
Fix edge case for ImportGranularity guessing

3 years agoFix typo
phynalle [Tue, 8 Jun 2021 19:51:28 +0000 (04:51 +0900)]
Fix typo

3 years agoMerge #9181 #9182
bors[bot] [Tue, 8 Jun 2021 19:09:13 +0000 (19:09 +0000)]
Merge #9181 #9182

9181: Don't complete values in type position r=jonas-schievink a=Veykril

Will add some proper tests in a bit

9182: fix: don't complete derive macros as fn-like macros r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #9180
bors[bot] [Tue, 8 Jun 2021 19:01:23 +0000 (19:01 +0000)]
Merge #9180

9180: fix: fix some IDE functionality inside attribute macros r=jonas-schievink a=jonas-schievink

In `SourceToDefCtx::find_container`, we might encounter a container that has an attribute macro. We need to skip that item, instead of bailing out and creating an empty `Resolver`, otherwise all names in the macro stay unresolved.

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd tests checking no value completion in type pos
Lukas Wirth [Tue, 8 Jun 2021 18:27:25 +0000 (20:27 +0200)]
Add tests checking no value completion in type pos

3 years agofix: don't complete derive macros as fn-like macros
Jonas Schievink [Tue, 8 Jun 2021 15:31:47 +0000 (17:31 +0200)]
fix: don't complete derive macros as fn-like macros

3 years agoDon't complete values in type position
Lukas Wirth [Tue, 8 Jun 2021 14:50:10 +0000 (16:50 +0200)]
Don't complete values in type position

3 years agosource_to_def: skip items with no def
Jonas Schievink [Tue, 8 Jun 2021 14:42:48 +0000 (16:42 +0200)]
source_to_def: skip items with no def

3 years agoRevert "Merge #9177"
Aleksey Kladov [Tue, 8 Jun 2021 12:31:36 +0000 (15:31 +0300)]
Revert "Merge #9177"

This reverts commit f1818cb7ba2808cba3fd9bf8f199c382060a1f19, reversing
changes made to 6c9362d61b895c11b1d0cf6837ada9f2a0a30eaf.

This broke things

3 years agoMerge #9177
bors[bot] [Tue, 8 Jun 2021 11:00:19 +0000 (11:00 +0000)]
Merge #9177

9177: :arrow_up: npm packages r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: npm packages
Aleksey Kladov [Tue, 8 Jun 2021 10:55:20 +0000 (13:55 +0300)]
:arrow_up: npm packages

3 years agoMerge #9153
bors[bot] [Tue, 8 Jun 2021 10:53:20 +0000 (10:53 +0000)]
Merge #9153

9153: QOL: VSCode status bar icon on click now shows server status r=matklad a=Milo123459

Now, when you click the little status bar text, it will automatically reload the server. I don't think I've ever seen anyone click it randomly, and, it's there to save you a few clicks.

Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
3 years agoMerge #9171
bors[bot] [Mon, 7 Jun 2021 18:46:18 +0000 (18:46 +0000)]
Merge #9171

9171: internal: simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agosimplify
Lukas Wirth [Mon, 7 Jun 2021 18:45:17 +0000 (20:45 +0200)]
simplify

3 years agoMerge #9170
bors[bot] [Mon, 7 Jun 2021 17:47:23 +0000 (17:47 +0000)]
Merge #9170

9170: internal: Remove unnecessary `completion::macro_in_item_position` module r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRemove unnecessary completion::macro_in_item_position
Lukas Wirth [Mon, 7 Jun 2021 17:35:24 +0000 (19:35 +0200)]
Remove unnecessary completion::macro_in_item_position

3 years agoMerge #9169
bors[bot] [Mon, 7 Jun 2021 17:37:48 +0000 (17:37 +0000)]
Merge #9169

9169: internal: steps towards attribute macro token mapping r=jonas-schievink a=jonas-schievink

This doesn't work yet, but we seem to be getting a bit further along (for example, we now stop highlighting `use` items inside item with attribute macros as if they were written verbatim).

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAttempt to track attr macros during highlighting
Jonas Schievink [Mon, 7 Jun 2021 17:32:28 +0000 (19:32 +0200)]
Attempt to track attr macros during highlighting

3 years agoReorder CompletionContext fields
Lukas Wirth [Mon, 7 Jun 2021 17:06:03 +0000 (19:06 +0200)]
Reorder CompletionContext fields

3 years agofix
Milo [Mon, 7 Jun 2021 16:56:40 +0000 (17:56 +0100)]
fix

3 years agoMerge #9144
bors[bot] [Mon, 7 Jun 2021 16:17:14 +0000 (16:17 +0000)]
Merge #9144

9144: Extend convert_tuple_struct_to_named_struct to also apply to enum tuple variants r=matklad a=joshuawarner32

This is largely copied and adapted from the existing `convert_tuple_struct_to_named_struct` code.

Not sure if maybe some of this code can/should be shared between those two assists - but the differences are significant enough to make it at least seem like a non-trivial refactor.

Co-authored-by: Joshua Warner <joshuawarner32@gmail.com>
3 years agoMerge #9166
bors[bot] [Mon, 7 Jun 2021 15:49:50 +0000 (15:49 +0000)]
Merge #9166

9166: Clarify label documentation r=matklad a=flodiebold

Also some other cleanups while I'm there.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoMake "expand macro" command work with attribute macros
Jonas Schievink [Mon, 7 Jun 2021 14:05:36 +0000 (16:05 +0200)]
Make "expand macro" command work with attribute macros

3 years agoFurther clarification
Florian Diebold [Mon, 7 Jun 2021 12:50:03 +0000 (14:50 +0200)]
Further clarification

3 years agoOne additional grammar fix
Florian Diebold [Mon, 7 Jun 2021 12:43:58 +0000 (14:43 +0200)]
One additional grammar fix

3 years agoClarify label documentation
Florian Diebold [Mon, 7 Jun 2021 12:34:41 +0000 (14:34 +0200)]
Clarify label documentation

Also some other cleanups while I'm there.

3 years agoMerge #9164
bors[bot] [Mon, 7 Jun 2021 12:17:28 +0000 (12:17 +0000)]
Merge #9164

9164: internal: Reduce the number of direct fields in `CompletionContext` some more r=Veykril a=Veykril

Doesn't make the code much simpler yet.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMove more things into PathCompletionContext
Lukas Wirth [Mon, 7 Jun 2021 10:29:46 +0000 (12:29 +0200)]
Move more things into PathCompletionContext

3 years agoMerge #9161
bors[bot] [Mon, 7 Jun 2021 10:33:13 +0000 (10:33 +0000)]
Merge #9161

9161: Fix incorrect config usage in hover references r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix incorrect config usage in hover references
Lukas Wirth [Mon, 7 Jun 2021 10:32:25 +0000 (12:32 +0200)]
Fix incorrect config usage in hover references

3 years agoMerge #9160
bors[bot] [Mon, 7 Jun 2021 09:59:32 +0000 (09:59 +0000)]
Merge #9160

9160: internal: make `Documentation::new` non-generic r=lnicola a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMake Documentation::new non-generic
Laurențiu Nicola [Mon, 7 Jun 2021 09:58:51 +0000 (12:58 +0300)]
Make Documentation::new non-generic

3 years agoMerge #9157
bors[bot] [Mon, 7 Jun 2021 07:40:52 +0000 (07:40 +0000)]
Merge #9157

9157: minor: Use HTTPS for clippy lint JSON r=lnicola a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoUse HTTPS for clippy lint JSON
Laurențiu Nicola [Mon, 7 Jun 2021 07:40:12 +0000 (10:40 +0300)]
Use HTTPS for clippy lint JSON

3 years agoMerge #9106
bors[bot] [Mon, 7 Jun 2021 04:52:38 +0000 (04:52 +0000)]
Merge #9106

9106: feat: goto definition on an impl fn goes to that fn in the trait r=lf- a=lf-

e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.

![ra goto def trait the other way](https://user-images.githubusercontent.com/6652840/120403989-39aa3280-c2fa-11eb-9359-639346878acd.gif)

Co-authored-by: Jade <software@lfcode.ca>
3 years agofeat: goto def on impl items also goes to the defn in the trait
Jade [Mon, 7 Jun 2021 04:48:06 +0000 (21:48 -0700)]
feat: goto def on impl items also goes to the defn in the trait

It was trivial to extend this to associated consts/associated types and
I just didn't think of it.

3 years agofeat: goto definition on an impl fn goes to that fn in the trait
Jade [Tue, 1 Jun 2021 23:16:59 +0000 (16:16 -0700)]
feat: goto definition on an impl fn goes to that fn in the trait

e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.

3 years agoSimplify CompletionContext by introducing a path CallKind enum
Lukas Wirth [Sun, 6 Jun 2021 18:02:26 +0000 (20:02 +0200)]
Simplify CompletionContext by introducing a path CallKind enum

3 years agoHandle attribute macros in `descend_into_macros`
Jonas Schievink [Sun, 6 Jun 2021 13:51:05 +0000 (15:51 +0200)]
Handle attribute macros in `descend_into_macros`

3 years agoMerge #9155
bors[bot] [Sun, 6 Jun 2021 14:50:06 +0000 (14:50 +0000)]
Merge #9155

9155: internal: replace attribute with equivalent whitespace r=jonas-schievink a=jonas-schievink

This is needed to that the `TokenMap` we create contains offsets that match the source. Currently the offsets don't match because the attribute is removed, shifting all subsequent token offsets by the attribute's text length.

Currently this fix has no visible effect because we don't remap tokens in attribute macros.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoReplace attribute with equivalent whitespace
Jonas Schievink [Sun, 6 Jun 2021 13:51:49 +0000 (15:51 +0200)]
Replace attribute with equivalent whitespace

This is needed to that the `TokenMap` we create contains offsets that
match the source.

3 years agofmt
Joshua Warner [Sun, 6 Jun 2021 00:09:56 +0000 (17:09 -0700)]
fmt

3 years agofix
Milo [Sat, 5 Jun 2021 23:21:50 +0000 (00:21 +0100)]
fix

3 years agowhen you click status bar icon it now restarts server
Milo [Sat, 5 Jun 2021 23:17:16 +0000 (00:17 +0100)]
when you click status bar icon it now restarts server

3 years agoRefactor to be just one assist
Joshua Warner [Sat, 5 Jun 2021 22:29:29 +0000 (15:29 -0700)]
Refactor to be just one assist

3 years agoMerge #9149
bors[bot] [Sat, 5 Jun 2021 19:26:33 +0000 (19:26 +0000)]
Merge #9149

9149: feat: Support goto-definition for include macros input path r=Veykril a=Veykril

![0l6l9iWPNE](https://user-images.githubusercontent.com/3757771/120891155-3fa85800-c607-11eb-9b20-7ac330dceb4b.gif)
Fixes #5871

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9150
bors[bot] [Sat, 5 Jun 2021 18:16:57 +0000 (18:16 +0000)]
Merge #9150

9150: Unescape generated clippy lints r=lnicola a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9140
bors[bot] [Sat, 5 Jun 2021 17:23:40 +0000 (17:23 +0000)]
Merge #9140

9140: feat: Render documentation for derive completion r=Veykril a=Veykril

![eEzGiq2wNa](https://user-images.githubusercontent.com/3757771/120847308-9c5a3300-c573-11eb-958d-e0f22f4757ed.gif)

Nothing fancy as all the std derives aren't really documented though maybe some 3rd party crates document them equally to their trait counterparts.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUnescape generated clippy lints
Lukas Wirth [Sat, 5 Jun 2021 17:14:53 +0000 (19:14 +0200)]
Unescape generated clippy lints

3 years agoSupport goto-definition for include macro paths
Lukas Wirth [Sat, 5 Jun 2021 12:02:36 +0000 (14:02 +0200)]
Support goto-definition for include macro paths

3 years agoMerge #9147
bors[bot] [Sat, 5 Jun 2021 12:29:52 +0000 (12:29 +0000)]
Merge #9147

9147: internal: enable proc macros and build scripts in cli r=flodiebold a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoEnable proc macros and build scripts by default in CLI
Laurențiu Nicola [Sat, 5 Jun 2021 11:03:56 +0000 (14:03 +0300)]
Enable proc macros and build scripts by default in CLI

3 years agoMerge #9148
bors[bot] [Sat, 5 Jun 2021 11:16:46 +0000 (11:16 +0000)]
Merge #9148

9148: minor: Prevent renaming of aliases on usages r=Veykril a=Veykril

Otherwise trying to rename a usage that goes through an alias will still rename the aliased item instead, cc https://github.com/rust-analyzer/rust-analyzer/issues/5671
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoPrevent renaming of aliases on usages
Lukas Wirth [Sat, 5 Jun 2021 11:15:07 +0000 (13:15 +0200)]
Prevent renaming of aliases on usages

3 years agoMerge #9146
bors[bot] [Sat, 5 Jun 2021 10:44:36 +0000 (10:44 +0000)]
Merge #9146

9146: minor: Fix incorrect list nesting in format_like feature description r=Veykril a=Veykril

bors r+
Closes #6261

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix incorrect list nesting in format_like feature description
Lukas Wirth [Sat, 5 Jun 2021 10:43:45 +0000 (12:43 +0200)]
Fix incorrect list nesting in format_like feature description

3 years agoMerge #9145
bors[bot] [Sat, 5 Jun 2021 09:32:40 +0000 (09:32 +0000)]
Merge #9145

9145: internal: Enable attribute macro expansion in `analysis-stats` r=flodiebold a=flodiebold

Before:
```
> $ rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded:     19.08s, 277minstr
  crates: 34, mods: 688, decls: 13202, fns: 10412
Item Collection:     16.21s, 76ginstr
  exprs: 290580, ??ty: 2508 (0%), ?ty: 1814 (0%), !ty: 947
Inference:           27.46s, 108ginstr
Total:               43.67s, 184ginstr
```
After:
```
> $ ./target/release/rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded:     1.09s, 277minstr
  crates: 34, mods: 688, decls: 14790, fns: 11006
Item Collection:     18.20s, 78ginstr
  exprs: 297826, ??ty: 493 (0%), ?ty: 558 (0%), !ty: 342
Inference:           28.34s, 111ginstr
Total:               46.54s, 190ginstr
```

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoEnable attribute macro expansion in `analysis-stats`
Florian Diebold [Sat, 5 Jun 2021 09:29:24 +0000 (11:29 +0200)]
Enable attribute macro expansion in `analysis-stats`

Before:
```
> $ rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded:     19.08s, 277minstr
  crates: 34, mods: 688, decls: 13202, fns: 10412
Item Collection:     16.21s, 76ginstr
  exprs: 290580, ??ty: 2508 (0%), ?ty: 1814 (0%), !ty: 947
Inference:           27.46s, 108ginstr
Total:               43.67s, 184ginstr
```
After:
```
> $ ./target/release/rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs .
Database loaded:     1.09s, 277minstr
  crates: 34, mods: 688, decls: 14790, fns: 11006
Item Collection:     18.20s, 78ginstr
  exprs: 297826, ??ty: 493 (0%), ?ty: 558 (0%), !ty: 342
Inference:           28.34s, 111ginstr
Total:               46.54s, 190ginstr
```

3 years agoAdd assist for converting a tuple enum variant to a named variant
Joshua Warner [Sat, 5 Jun 2021 04:48:32 +0000 (21:48 -0700)]
Add assist for converting a tuple enum variant to a named variant

3 years agoComplete third-party attributes
Lukas Wirth [Fri, 4 Jun 2021 19:07:19 +0000 (21:07 +0200)]
Complete third-party attributes

3 years agoRender documentation for derive completion
Lukas Wirth [Fri, 4 Jun 2021 18:25:16 +0000 (20:25 +0200)]
Render documentation for derive completion

3 years agoMerge #9141
bors[bot] [Fri, 4 Jun 2021 18:44:22 +0000 (18:44 +0000)]
Merge #9141

9141: fix: Don't inline mutable locals in 'inline_local_variable' r=Veykril a=Veykril

Fixes #9139

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't inline mutable locals in 'inline_local_variable'
Lukas Wirth [Fri, 4 Jun 2021 18:36:43 +0000 (20:36 +0200)]
Don't inline mutable locals in 'inline_local_variable'

3 years agoMerge #9138
bors[bot] [Fri, 4 Jun 2021 17:45:37 +0000 (17:45 +0000)]
Merge #9138

9138: feat: Implement hover for lints r=Veykril a=Veykril

fixes https://github.com/rust-analyzer/rust-analyzer/issues/8857, fixes https://github.com/rust-analyzer/rust-analyzer/issues/3941

![URXBanNxYe](https://user-images.githubusercontent.com/3757771/120830905-4bd8da80-c55f-11eb-9f55-ff5a321726fa.gif)

We also generate the default lints(and lint groups ðŸŽ‰) instead now by invoking `rustc -W help` and parsing the output from that.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoExclude `crates/ide_db/src/helpers/generated_lints.rs` from `tidy::check_todo`
Lukas Wirth [Fri, 4 Jun 2021 17:18:45 +0000 (19:18 +0200)]
Exclude `crates/ide_db/src/helpers/generated_lints.rs` from `tidy::check_todo`

3 years agoReplace `-` with `_` in generated lint names
Lukas Wirth [Fri, 4 Jun 2021 17:03:45 +0000 (19:03 +0200)]
Replace `-` with `_` in generated lint names

3 years agoGenerate default lint groups
Lukas Wirth [Fri, 4 Jun 2021 16:55:08 +0000 (18:55 +0200)]
Generate default lint groups

3 years agoGenerate default lint completions
Lukas Wirth [Fri, 4 Jun 2021 16:35:19 +0000 (18:35 +0200)]
Generate default lint completions

3 years agoImplement hover for lints
Lukas Wirth [Fri, 4 Jun 2021 15:03:18 +0000 (17:03 +0200)]
Implement hover for lints

3 years agoMerge #9137
bors[bot] [Fri, 4 Jun 2021 14:51:39 +0000 (14:51 +0000)]
Merge #9137

9137: fix: fix incorrect "unresolved import" error when using derive helpers r=jonas-schievink a=jonas-schievink

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

cursed bug

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoReturn `ReachedFixedPoint::No` when resolving derive helper
Jonas Schievink [Fri, 4 Jun 2021 14:50:35 +0000 (16:50 +0200)]
Return `ReachedFixedPoint::No` when resolving derive helper

3 years agoMerge #9136
bors[bot] [Fri, 4 Jun 2021 13:55:49 +0000 (13:55 +0000)]
Merge #9136

9136: feat: Add function references hover action r=Veykril a=Veykril

![image](https://user-images.githubusercontent.com/3757771/120811670-8422ed80-c54c-11eb-87f5-dd65c1f8ef7d.png)
This is off by default as this can slow down hover messages significantly for very big projects I believe.
Fixes #6590
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd function references hover action
Lukas Wirth [Fri, 4 Jun 2021 13:49:43 +0000 (15:49 +0200)]
Add function references hover action

3 years agoMerge #9135
bors[bot] [Fri, 4 Jun 2021 12:10:21 +0000 (12:10 +0000)]
Merge #9135

9135: Reorganize inlay_hints tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoCleanup parameter_hint_heuristics inlay hints test
Lukas Wirth [Fri, 4 Jun 2021 12:09:20 +0000 (14:09 +0200)]
Cleanup parameter_hint_heuristics inlay hints test

3 years agoReorganize inlay_hints tests
Lukas Wirth [Fri, 4 Jun 2021 11:47:39 +0000 (13:47 +0200)]
Reorganize inlay_hints tests

3 years agoMerge #9128
bors[bot] [Thu, 3 Jun 2021 16:17:25 +0000 (16:17 +0000)]
Merge #9128

9128: feat: expand procedural attribute macros r=jonas-schievink a=jonas-schievink

This adds experimental support for attribute macros. They can be enabled by setting `rust-analyzer.experimental.procAttrMacros` to `true`.

Known issues:
* Tokens aren't remapped, presumably because we edit the input syntax tree (this causes IDE features to not work inside items with attribute macros on them)
* Macro errors aren't reported correctly

Closes https://github.com/rust-analyzer/rust-analyzer/issues/8971
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8964 / https://github.com/la10736/rstest/issues/120
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2984
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5412
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6029
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6687

https://github.com/rust-analyzer/rust-analyzer/issues/6740 is still not fixed â€“ we now expand `#[proc_macro_hack]`, but fail to expand the resulting `proc_macro_call!()` macro.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSet enable_proc_attr_macros in hir_ty TestDB
Jonas Schievink [Thu, 3 Jun 2021 16:11:33 +0000 (18:11 +0200)]
Set enable_proc_attr_macros in hir_ty TestDB

3 years agoUpdate list of built-in attributes
Jonas Schievink [Thu, 3 Jun 2021 16:06:17 +0000 (18:06 +0200)]
Update list of built-in attributes

3 years agoMake it opt-in
Jonas Schievink [Thu, 3 Jun 2021 14:11:20 +0000 (16:11 +0200)]
Make it opt-in

3 years agoExpand procedural attribute macros
Jonas Schievink [Mon, 31 May 2021 11:37:11 +0000 (13:37 +0200)]
Expand procedural attribute macros

3 years agoMerge #9130
bors[bot] [Thu, 3 Jun 2021 14:26:07 +0000 (14:26 +0000)]
Merge #9130

9130: Prefix/suffix parameter inlay hint hiding heuristic is more strict r=Veykril a=Veykril

Instead of just plainly checking prefix/suffix of the argument string to the parameter name we only check for prefixes and suffixes if they are split apart via an underscore meaning, with the argument `foo`, it will be hidden for the parameter name `foo_bar` but not for `foobar`.

bors r+
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8878

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoPrefix/suffix parameter inlay hint hiding heuristic is more strict
Lukas Wirth [Thu, 3 Jun 2021 14:22:24 +0000 (16:22 +0200)]
Prefix/suffix parameter inlay hint hiding heuristic is more strict

3 years agoMerge #9129
bors[bot] [Thu, 3 Jun 2021 13:45:17 +0000 (13:45 +0000)]
Merge #9129

9129: NFC: remove redundant clones (clippy::perf) r=Veykril a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>