Commit graph

9305 commits

Author SHA1 Message Date
Jonas Schievink
c31c3246a8 Basic support for decl macros 2.0 2020-12-15 18:43:34 +01:00
bors[bot]
eb9ba457b0
Merge #6879
6879: Change HasChildSource::ChildId assoc item to generic param r=matklad a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-15 17:22:03 +00:00
Lukas Wirth
2c67a4abe4 Change HasChildSource::ChildId assoc item to generic param 2020-12-15 18:21:01 +01:00
Jesse Bakker
0f42a71806 Parenthesize composite if condition before inverting in invert-if assist 2020-12-15 16:25:57 +01:00
Jonas Schievink
479babf874 Reject visibilities on macro_rules! 2020-12-15 15:37:49 +01:00
Jonas Schievink
c1cb595382 Move to upstream macro_rules! model 2020-12-15 15:37:37 +01:00
bors[bot]
39aae835fd
Merge #6886
6886: Expand statements for macros in lowering r=matklad a=edwin0cheng

Fixes #6811

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-12-15 12:41:07 +00:00
bors[bot]
435d46b183
Merge #6888
6888: Use standard test style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-15 12:34:37 +00:00
Edwin Cheng
1f4da7098c Remove obsolete comment 2020-12-15 17:25:59 +08:00
bors[bot]
a9d19200f2
Merge #6889
6889: Resolve `macro-error` diagnostics on asm & llvm_asm r=matklad a=lf-

We currently stub these out as returning unit.

This fixes spurious RA `macro-error` diagnostics introduced somewhere around 0.2.400 in the following:
```rust
unsafe { asm!(""); llvm_asm!(""); }
```

I'd ideally like to write a unit test for this, but I'm not familiar with where the tests for `hir_expand` are.

Thanks to @edwin0cheng for help on resolving this issue.

Co-authored-by: lf- <lf-@users.noreply.github.com>
2020-12-15 09:15:41 +00:00
lf-
090a59970d Resolve macro-error diagnostics on asm & llvm_asm
We currently stub these out as returning unit.

This fixes spurious RA diagnostics in the following:
```rust
unsafe { asm!(""); llvm_asm!(""); }
```
2020-12-15 01:06:53 -08:00
Aleksey Kladov
c582e52a1b Use standard test style 2020-12-15 11:53:16 +03:00
Benjamin Coenen
490475ee19 generate default implementation for an enum from an enum variant #6860
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-12-15 09:46:02 +01:00
bors[bot]
65e31a1b5b
Merge #6875
6875: Add find usages for enum constructors r=matklad a=sasurau4

Fix #2549 for enum

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
2020-12-15 08:38:08 +00:00
Edwin Cheng
9da1eee436 Add regression test 2020-12-15 15:24:35 +08:00
Edwin Cheng
a68ff269a9 Expand statements for mbe in lowering 2020-12-15 14:39:15 +08:00
Daiki Ihara
36a9daac70 Add find usages for enum constructors 2020-12-15 00:39:42 +09:00
bors[bot]
34f7b5383a
Merge #6874
6874: Implement `module_path!()` r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-14 15:39:31 +00:00
Jonas Schievink
81820fe52c Implement module_path!() 2020-12-14 16:38:53 +01:00
bors[bot]
817fbebbb5
Merge #6862
6862: Add LifetimeParam resolving to Semantics r=matklad a=Veykril

This is stuff required for the lifetime references/definitions PR. I pulled this out to make it easier to review as well as because there is one thing that still has to be addressed which can be found in the review comments.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-14 15:15:52 +00:00
bors[bot]
134c7563be
Merge #6817
6817: Replace goblin crate with object r=matklad a=lnicola

Continuation of #4385.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-12-14 15:04:47 +00:00
Lukas Wirth
c6172f3f6d Add LifetimeParam resolving to Semantics 2020-12-14 16:04:28 +01:00
Benjamin Coenen
08090d81b1 generate default implementation for an enum from an enum variant #6860
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-12-14 09:44:24 +01:00
Florian Diebold
4788aaa5f0 Add test for #6852 2020-12-13 14:53:04 +01:00
Laurențiu Nicola
dc519b88af Replace goblin crate with object 2020-12-13 14:08:59 +02:00
Florian Diebold
7d7949b315 Change recommendation when source can't be loaded from sysroot
Since we just tried running `rustup component add`, it doesn't make sense to me
to recommend trying that again. If we're reaching this case, it's probably more
likely that rustc was installed via package manager, in which case the source
should be installed the same way (e.g. if you install the rust-src package on
Ubuntu it will install a symlink in the right place to make our sysroot
detection work).
2020-12-13 13:04:50 +01:00
bors[bot]
ca3a54f0a4
Merge #6852
6852: Ignore lifetime params in substitutions r=matklad a=Veykril

[`hir_ty::utils::Generics`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/utils.rs#L153) currently only assumes type parameters but not lifetime parameters and therefor creates incorrect index and length calculations, this PR just makes the use sites ignore LifetimeGenerics for now.

This fixes the panic at least locally for me for `analysis-stats`. Funnily enough this panic prevented me from using reference search for the `args` field to fix this problem.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-13 11:34:43 +00:00
Lukas Wirth
ae8a802085 Ignore lifetime params in substitutions 2020-12-13 11:34:44 +01:00
bors[bot]
a15d19619e
Merge #6845
6845: Don't HirDisplay unknown types when displaying for source r=Veykril a=Veykril

Was wondering why the add missing impl assist didn't do anything here:
![Code_JCA1Qo0V9P](https://user-images.githubusercontent.com/3757771/101990300-7af44a80-3ca6-11eb-8431-e5eb4de4e78c.png)
Turns out me forgetting to set the Index::Idx type in the trait causes RA to panic due to it trying to to create an unparsable type in the `make` module.
Now we get this instead which imo is definitely better to have.
![Code_MUFPJUCULY](https://user-images.githubusercontent.com/3757771/101990347-c9094e00-3ca6-11eb-9c6a-146bddf64b7c.png)



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-12 18:06:36 +00:00
Lukas Wirth
69b78edb5e Don't HirDisplay unknown types when displaying for source 2020-12-12 19:05:00 +01:00
Jeremy Kolb
26a1675764 Remove some redundant allocations 2020-12-12 12:27:09 -05:00
bors[bot]
479d1f7eec
Merge #6818
6818: Add Lifetimes to the HIR r=matklad a=Veykril

This doesn't handle resolve yet as I don't know yet how that will be used. I'll get to that once I start moving the lifetime reference PR to the hir.

This also adds a new `hir` name type for lifetimes and labels, `hir::LifetimeName`.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-12 14:35:38 +00:00
ivan770
f7f4f366ac
Added remove this semicolon test 2020-12-12 13:50:11 +02:00
bors[bot]
70db57cc59
Merge #6839
6839: Infer labeled blocks r=flodiebold a=Veykril

The test should cover all the interesting cases I believe(main part of it is copied from the loop label break test above it).

The test is indented to stay consistent with the rest of the tests in the file, I can dedent all the tests in the file in a follow up PR if desired.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-12 10:18:16 +00:00
Lukas Wirth
11f8664182 Add Lifetimes to the HIR 2020-12-12 00:56:52 +01:00
Lukas Wirth
378ec2841b Infer labeled blocks 2020-12-12 00:06:48 +01:00
bors[bot]
4998807039
Merge #6813
6813: negative sign matching in mbe matching for literal r=edwin0cheng a=edwin0cheng

Fix #6292

r @jonas-schievink 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-12-11 22:17:40 +00:00
Edwin Cheng
ae29fb0211 Add missing arg for eat_char 2020-12-12 06:14:11 +08:00
Lukas Wirth
8ed8e4f25a Use Attrs::docs in NavigationTarget instead of DocCommentsOwner 2020-12-11 21:19:58 +01:00
bors[bot]
91bf15a2f5
Merge #6834
6834: Use Attrs::docs in runnables instead of DocCommentsOwner r=kjeremy a=Veykril

I figured that we should probably move as much of the doc usage to the HIR as possible hence this PR. If we should keep this AST-based feel free to close.

This change does have the nice(but not really useful as I doubt anyones gonna write doc tests like these) side effect that these two doc string snippets allow being run now.
![image](https://user-images.githubusercontent.com/3757771/101945607-bf241400-3bee-11eb-96ce-ccae80028b1f.png)
![image](https://user-images.githubusercontent.com/3757771/101946375-2e9a0380-3bef-11eb-9950-e35168fdd048.png)


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-11 19:57:08 +00:00
Lukas Wirth
ac19a71459 Use Attrs::docs in runnables instead of DocCommentsOwner 2020-12-11 20:11:03 +01:00
Jonas Schievink
00c34b048e Add upstream commit to builtin_attr.rs 2020-12-11 19:12:06 +01:00
bors[bot]
3674e494ca
Merge #6819
6819: Add builtin attributes for use in nameres r=jonas-schievink a=jonas-schievink

These are not yet used, but have to go through nameres later in order to support procedural macro attributes

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-11 18:03:09 +00:00
Jonas Schievink
2fdde98b5c Move print_memory_usage to cli.rs 2020-12-11 18:24:27 +01:00
Jonas Schievink
c007ac3830 Avoid panic when collecting memory metrics 2020-12-11 18:18:27 +01:00
Lukas Wirth
37c5b82938 Don't highlight parent nodes of comments on hover 2020-12-11 16:00:52 +01:00
Aleksey Kladov
4015ff0e0b Improve code structure
Make sure that there's only one entry point, analyze, remove awkard
analyzer2 name
2020-12-11 17:06:21 +03:00
Jonas Schievink
253678ead2 Add builtin attributes for use in nameres 2020-12-11 14:04:33 +01:00
Aleksey Kladov
e179ed6f53 Use natural trait ordering in derive completion
derive(Clone, Copy) reads better than derive(Copy, Clone).

However, we preserve the reverse ordering in the lookup text for
sorting purposes. That way, it's convenient to type just `Ord` to
derive everything.
2020-12-11 15:45:53 +03:00
Edwin Cheng
175229ab3d negative sign matching in mbe matching for literal 2020-12-11 17:59:04 +08:00
bors[bot]
41321d9678
Merge #6807
6807: Replicate Cargo environment variables r=jonas-schievink a=jonas-schievink

These might be relied on by procedural macros, and can also be accessed via `env!`.

Required for fixing https://github.com/rust-analyzer/rust-analyzer/issues/6696. We do not yet propagate these to any proc macros though.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-10 18:30:11 +00:00
Jonas Schievink
4d4b91117a Use itertools 2020-12-10 19:29:11 +01:00
bors[bot]
814e31957e
Merge #6804
6804: Bump the macro token limit r=jonas-schievink a=jonas-schievink

Should fix https://github.com/rust-analyzer/rust-analyzer/issues/6504

Not entirely sure what the previous limit was based on, but it looks like it does get hit in practice.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-10 18:14:17 +00:00
Jonas Schievink
41d73d1312 Replicate Cargo environment variables 2020-12-10 18:51:39 +01:00
bors[bot]
0baff25d99
Merge #6805
6805: Fix accidently quadratic syntax rewriter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-10 17:08:59 +00:00
Aleksey Kladov
3d5be5ba5b Fix accidently quadratic syntax rewriter
Switching from SyntaxNode to GreenNode is a costly operation (b/c
dereferencing a synax ptr in `with_green` is linear), so we should
avoid that.
2020-12-10 20:07:37 +03:00
Jonas Schievink
829d9d36eb Use decimal notation 2020-12-10 18:03:37 +01:00
Jonas Schievink
19508b474f Double the macro token limit 2020-12-10 17:51:39 +01:00
Jonas Schievink
614e5a2272 Improve macro limit error and move to const 2020-12-10 17:50:56 +01:00
bors[bot]
44978acf51
Merge #6769
6769: Add native "remove this semicolon" diagnostics r=matklad a=ivan770

Closes #6739 
![demo2](https://user-images.githubusercontent.com/14003886/101530533-b76c3180-399a-11eb-9d18-5c8457721655.gif)


Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
2020-12-10 16:18:49 +00:00
ivan770
bbb0bc7b04
Cast to ExprStmt, style fixes 2020-12-10 18:10:39 +02:00
Aleksey Kladov
78de7f0d4a Remove debug print 2020-12-10 18:30:49 +03:00
bors[bot]
a6c8098113
Merge #6798
6798: Ignore extern items in incorrect-case check r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-10 15:08:30 +00:00
Aleksey Kladov
076945e47c Minor, more orthogonal code
It's better to accept things as arguments rather than store them.
2020-12-10 18:01:02 +03:00
Jonas Schievink
05d4a5a150 Use mark/hit 2020-12-10 15:56:04 +01:00
Jonas Schievink
d338513e95 Remove item tree tests
They were useful during initial development of the item tree, but
now just cause churn
2020-12-10 15:53:48 +01:00
Aleksey Kladov
17f236c2b0 Normalize spelling to American English 2020-12-10 17:51:56 +03:00
Jonas Schievink
d82292e1ce Ignore extern items in incorrect-case check 2020-12-10 15:45:01 +01:00
Jonas Schievink
f57ce36988 Fix FileId computation in IncorrectCase fix 2020-12-10 14:16:34 +01:00
Jonas Schievink
948832d10b format_args: handle key-value arguments 2020-12-10 13:46:47 +01:00
kjeremy
78dd2ba196 Send a CodeLensRefresh when we reload 2020-12-09 14:36:47 -05:00
Jonas Schievink
dedd888570 Implement HirDisplay for FnSig
This could be useful for diagnostics, but isn't used right now
2020-12-09 18:06:56 +01:00
bors[bot]
243ba330dd
Merge #6785
6785: Fix "no value set for FileTextQuery(FileId(..))" r=jonas-schievink a=jonas-schievink

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

Let's hope I got it right this time, but I feel like I slowly begin to understand the main loop logic.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-09 16:32:03 +00:00
Jonas Schievink
6857989f6f Fix "no value set for FileTextQuery(FileId(..))" 2020-12-09 17:30:46 +01:00
Aleksey Kladov
6e24321e45 Introduce anchored_path
They allow to represent paths like `#[path = "C:\path.rs"] mod foo;`
in a lossless cross-platform & network-transparent way.
2020-12-09 19:07:05 +03:00
Aleksey Kladov
5e3891c255 . 2020-12-09 18:42:07 +03:00
Jonas Schievink
d477c09c8a Avoid nesting Subtrees when parsing TokenStream 2020-12-09 14:58:46 +01:00
bors[bot]
ef989880ff
Merge #6771
6771: Properly attach inner attributes in Attrs::new r=matklad a=Veykril

Properly attach inner and outer attributes to the things they actually belong to in the HIR. ~~I can add some tests for this if wanted once I know where to put them/how to test for this.~~ Put some tests into `hover.rs`.
 
So the following snippet
```rust
mod foo {
	//! Hello
}
```
now shows `Hello` on hover 🎉

Fixes #2148


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-09 13:16:39 +00:00
bors[bot]
7bda4c722b
Merge #6776
6776: Include config into the manual r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-09 13:07:33 +00:00
Aleksey Kladov
0890512e1c Include config into the manual 2020-12-09 15:31:10 +03:00
bors[bot]
8fbaa8e495
Merge #6775
6775: Fix MissingFields DiagnosticFix trigger range r=lnicola a=Veykril

Fixes #5950

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-09 12:12:43 +00:00
Lukas Wirth
1d54c49271 Fix MissingFields DiagnosticFix trigger range 2020-12-09 12:45:39 +01:00
bors[bot]
cd83ded8ee
Merge #6774
6774: Increment recursion count in Expander only on success r=lnicola a=Veykril

Fixes #6764

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-09 11:35:18 +00:00
Lukas Wirth
ec415618df Properly decrement recursion count in Expander 2020-12-09 12:26:33 +01:00
Lukas Wirth
da3b5e35a6 Test inner and outer doc comments in hover 2020-12-09 09:42:15 +01:00
Lukas Wirth
f8823e8cbc Properly fetch inner and outer docs on hir-level 2020-12-09 09:22:41 +01:00
ivan770
35006eba79 Apply rustfmt changes 2020-12-09 08:22:13 +00:00
ivan770
86c183716c
Apply suggestions from code review
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2020-12-09 10:17:28 +02:00
Lukas Wirth
eac77997bf Properly fetch inner and outer attributes on hir-level 2020-12-08 23:21:20 +01:00
ivan770
7738467e0a Format code 2020-12-08 19:25:21 +00:00
Jonas Schievink
bb28aef918 Fix concat! with integer literals 2020-12-08 20:06:41 +01:00
ivan770
f2950a1350
Remove unused use 2020-12-08 20:50:40 +02:00
ivan770
581567a4c8
Remove use via super 2020-12-08 20:50:13 +02:00
ivan770
cb66bb8ff9
Remove this semicolon 2020-12-08 20:47:20 +02:00
Jonas Schievink
6c4d5164d9 Better error when a proc macro panics 2020-12-08 19:43:58 +01:00
bors[bot]
b3ceee2a27
Merge #6761
6761: Make config.rs a single source of truth for configuration. r=matklad a=matklad

Configuration is editor-independent. For this reason, we pick
JSON-schema as the repr of the source of truth. We do specify it using
rust-macros and some quick&dirty hackery though.

The idea for syncing truth with package.json is to just do that
manually, but there's a test to check that they are actually synced.

I'll add something like `rust-analyzer --config-schema` in a follow-up
commit.


Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-08 18:21:28 +00:00
Jonas Schievink
da5027138d Fix logic for determining macro calls
I believe this currently goes back all the way to the initial
user-written call, but that seems better than the current broken
behavior.
2020-12-08 19:11:12 +01:00
Jonas Schievink
306c6cbaac Use original_file_range in TestDB 2020-12-08 19:03:24 +01:00
Jonas Schievink
4943ef085d Make original_range a method on InFile<&SyntaxNode> 2020-12-08 19:01:27 +01:00
Aleksey Kladov
2544abbf86 Make config.rs a single source of truth for configuration.
Configuration is editor-independent. For this reason, we pick
JSON-schema as the repr of the source of truth. We do specify it using
rust-macros and some quick&dirty hackery though.

The idea for syncing truth with package.json is to just do that
manually, but there's a test to check that they are actually synced.

There's CLI to print config's json schema:

    $ rust-analyzer --print-config-schema

We go with a CLI rather than LSP request/response to make it easier to
incorporate the thing into extension's static config. This is roughtly
how we put the thing in package.json.
2020-12-08 19:25:41 +03:00
Jonas Schievink
6c1d292569 Add test for $crate in builtin macros
Fixes #6716
2020-12-08 17:17:30 +01:00
Jonas Schievink
678c74430b Handle macros in TestDB::check_diagnostics 2020-12-08 17:16:18 +01:00
bors[bot]
e2e6b709e6
Merge #6760
6760: Open Cargo.toml opens more specific manifest r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-08 13:30:16 +00:00
Aleksey Kladov
944f30bd69 Open Cargo.toml opens more specific manifest 2020-12-08 16:28:21 +03:00
bors[bot]
2aa7f2ece5
Merge #6750
6750: Remove documentation query, move doc handling to attributes r=matklad a=Veykril

Fixes #3182

Removes the documentation query in favor of `Attrs::docs`. Attrs already handlded doc comments partially but the alloc saving check was wrong so it only worked when other attributes existed as well. Unfortunately the `new` constructor has to do an intermediate allocation now because we need to keep the order of mixed doc attributes and doc comments.

I've also partially adjusted the `hover` module to have its tests check the changes, it still has some `HasSource` trait usage due to the `ShortLabel` trait usage, as that is only implemented on the Ast parts and not the Hir, should this ideally be implemented for the Hir types as well?(would be a follow up PR of course)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-08 13:23:12 +00:00
Aleksey Kladov
ecd1c11f9e cleanup: match over unwrap 2020-12-08 16:17:46 +03:00
Lukas Wirth
3174e941db Simplify ast::Comment api surface 2020-12-08 14:15:41 +01:00
Kirill Bulatov
bf24cb3e8d Tweak the search query params for better lookup speed 2020-12-08 15:05:09 +02:00
Lukas Wirth
2facd9517f Escape string literals in Attr::from_src 2020-12-08 13:47:58 +01:00
Kirill Bulatov
cbd3717f2c Better config name 2020-12-08 14:27:18 +02:00
Kirill Bulatov
3183ff3a7b Disable the completion for no corresponding client resolve capabilities 2020-12-08 01:07:20 +02:00
Kirill Bulatov
9656ceb896 Document the feature 2020-12-07 23:41:08 +02:00
Kirill Bulatov
19cfa5802e Simplify 2020-12-07 23:41:08 +02:00
Kirill Bulatov
6badf705b3 Check lsp completions' edits for disjointness 2020-12-07 23:41:08 +02:00
Kirill Bulatov
077c1c3c1f Less panic, more tests 2020-12-07 23:41:08 +02:00
Kirill Bulatov
045d7f096f Fix the profiling label 2020-12-07 23:41:08 +02:00
Kirill Bulatov
deda74edd8 Use stateless completion resolve 2020-12-07 23:41:08 +02:00
Kirill Bulatov
93bc009a59 Remove the state 2020-12-07 23:41:08 +02:00
Kirill Bulatov
74c3bbacc9 Make completion resolve async 2020-12-07 23:41:08 +02:00
Kirill Bulatov
f6d2540df0 Simplify import edit calculation 2020-12-07 23:41:08 +02:00
Kirill Bulatov
68a747efe0 Remove redundant code 2020-12-07 23:41:08 +02:00
Kirill Bulatov
50e06ee95a Refactor the code 2020-12-07 23:41:08 +02:00
Kirill Bulatov
d9bd1f171d Add eager resolve capability 2020-12-07 23:41:08 +02:00
Kirill Bulatov
2a7be4afb0 Better support client completion resolve caps 2020-12-07 23:41:08 +02:00
Kirill Bulatov
47464e556c Properly fill client completion resolve capabilities data 2020-12-07 23:41:08 +02:00
Kirill Bulatov
9a4daffe16 Resolve import inserts better 2020-12-07 23:41:08 +02:00
Kirill Bulatov
a539267c3b Remove unnecessary leftovers 2020-12-07 23:41:08 +02:00
Kirill Bulatov
6d2d279389 Working resolve completion imports prototype 2020-12-07 23:41:08 +02:00
Kirill Bulatov
48acd7d455 Draft the new lsp handler 2020-12-07 23:41:08 +02:00
Lukas Wirth
7a338e5207 Replace Arc<[str]> with String in attr::Documentation 2020-12-07 21:55:00 +01:00
Jonas Schievink
eeeacc4727 Apply environment set by build scripts 2020-12-07 20:52:31 +01:00
bors[bot]
d6aa1ba7d4
Merge #6752
6752: Pass `--target` when loading out dirs from check r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-07 19:42:08 +00:00
Jonas Schievink
a69996933a Pass --target when loading out dirs from check 2020-12-07 20:39:29 +01:00
Lukas Wirth
b064f6da9e Keep doc attribute order 2020-12-07 20:38:28 +01:00
Lukas Wirth
efe86a42dc Remove raw pre and suffixes from string attr literals 2020-12-07 19:58:17 +01:00
Lukas Wirth
1caaa201fa Remove hir_def/docs.rs module 2020-12-07 19:58:17 +01:00
Lukas Wirth
b3652ef288 Remove documentation query 2020-12-07 19:58:17 +01:00
bors[bot]
03b886de53
Merge #6719
6719: Use items can also have doc comments r=matklad a=Veykril

Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-07 18:48:35 +00:00
Jonas Schievink
881c7a680b Use the right def_crate for builtin macros 2020-12-07 19:38:13 +01:00
bors[bot]
c1824b4933
Merge #6745
6745: Some more proc macro cleanups r=jonas-schievink a=jonas-schievink

* Remove `ProcMacroClient::dummy` and just use `Option<ProcMacroClient>` instead
* Remember the type of proc macros (later allows us to reject using an incorrect macro type)
* Prepare a few internals for procedural attribute macros

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-07 16:21:51 +00:00
Jonas Schievink
577d5f1c33 Remove resolved FIXME 2020-12-07 17:17:31 +01:00
Jonas Schievink
2b2318e695 Remove dummy ProcMacroClient in favor of Option 2020-12-07 17:16:50 +01:00
Jonas Schievink
fb21a215be Retain types of proc macros and allow attr. macros 2020-12-07 17:06:14 +01:00
bors[bot]
9a88332452
Merge #6743
6743: Don't insert blank lines between doc attributes r=Veykril a=Veykril

Fixes #6742.
Doc attributes should be concatenated via a single linebreak as written in the [rustdoc book](https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html).
Also changed the loop to use an iterator to get rid of the `docs.trim_end_matches("\n\n").to_owned()` part using `Itertools::intersperse`.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-07 15:12:53 +00:00
Lukas Wirth
93262c750e Don't insert blank lines between doc attributes 2020-12-07 16:10:46 +01:00
bors[bot]
6df91a84dc
Merge #6731
6731: Add replace_match_with_if_let assist r=matklad a=Veykril

Basically the counterpart to `replace_if_let_with_match`, I personally sometimes want to replace matches like
```rust
match foo {
    pat => expr,
    _ => (),
}
``` 
into the corresponding
```rust
if let pat = foo {
    expr
}
```
which is the main reasoning behind this.
I put this into the same file as `replace_if_let_with_match` because the are complementing each other and I would probably rename the file to something like `replace_if_let_match` but I didn't do that for now because I was unsure whether git would still view this as a rename or not due to the amount of changes in the file so that the diff is still properly visible for now.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-07 15:00:07 +00:00
Jonas Schievink
e8a19e24ea Make ProcMacroProcessExpander private 2020-12-07 14:11:17 +01:00
Jonas Schievink
e42e6f9ab9 ProcMacroProcessExpander: support attribute macros 2020-12-07 14:02:27 +01:00
Florian Diebold
78dd548243 Upgrade Chalk
Also make overflow depth and max type size configurable through env variables.
This can be helpful at least for debugging.

Fixes #6628.
2020-12-07 11:48:58 +01:00
bors[bot]
a0fa522fda
Merge #6733
6733: Update attributes completion list r=jonas-schievink a=Veykril

Might be nice to have them grouped for readability/maintainability similar to how the [reference](https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index) does it but that would require the use of a `OnceCell` for sorting the entries back after construction.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-06 16:00:03 +00:00
Lukas Wirth
2ff1ebe8f3 Update attributes completion list 2020-12-06 16:46:24 +01:00
Jonas Schievink
45b8b3d57f
Apply suggestions from code review
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-12-06 14:23:55 +01:00
Jonas Schievink
2a6c246184 Update expect tests 2020-12-06 01:39:52 +01:00
Jonas Schievink
9d96a6d7af Emit additional diagnostics for hints/help/etc 2020-12-06 01:24:37 +01:00
Lukas Wirth
44c76d6550 Add replace_match_with_if_let assist 2020-12-05 15:41:36 +01:00
Jonas Schievink
b9d947cc6f Add slightly more profiling details 2020-12-04 20:26:28 +01:00
bors[bot]
571f247fbc
Merge #6725
6725: Don't respawn proc macro server on crash r=jonas-schievink a=jonas-schievink

Now the thread managing IPC will exit when the server process crashes instead of respawning it.

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-04 19:12:49 +00:00
Jonas Schievink
869ad13cf1 Don't respawn proc macro server on crash 2020-12-04 20:11:56 +01:00
bors[bot]
2756abb167
Merge #6721
6721: Use METHOD semantic token type r=kjeremy a=lnicola

Closes #6685

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-12-04 18:46:44 +00:00
bors[bot]
b6def6575c
Merge #6724
6724: Fix `diagnostics` subcommand, look at all modules r=jonas-schievink a=jonas-schievink

The `diagnostics` subcommand used to only compute diagnostics for `lib.rs` / the root module of all workspace crates. This fixed it and makes it look at every module.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-04 18:39:04 +00:00
Jonas Schievink
e45ab7e0ec Fix diagnostics subcommand, look at all modules 2020-12-04 19:37:37 +01:00
Florian Diebold
e5fd550dfd Use correct, full substs for self type in impl
Without arbitrary self types, the self type could never refer to the method type
parameters, so this wasn't a problem; but with arbitrary self types, it can.

This fixes the crash from #6668; but it doesn't make method resolution work for
these methods.
2020-12-04 18:43:47 +01:00
Laurențiu Nicola
72f013b3b9 Use METHOD semantic token type 2020-12-04 18:27:10 +02:00
Lukas Wirth
a1c8bdecfd Use items can also have doc comments 2020-12-04 17:09:40 +01:00
Jonas Schievink
b857149720 Unwrap process.stdio() result
If this is ever `None` here, that's a bug
2020-12-04 14:03:06 +01:00
Jonas Schievink
2845ce5bc6 Destructure in for loop 2020-12-04 13:57:33 +01:00
Jonas Schievink
c50d9f3683 Remove unnecessary Option 2020-12-04 13:54:09 +01:00
Jonas Schievink
6e1c87eb92 Don't diagnose #[cfg] in macros 2020-12-03 20:46:16 +01:00
Jonas Schievink
957fb18799 Make compile_error! message match upstream rustc
It only consists of the argument passed to it
2020-12-03 19:07:37 +01:00
Jonas Schievink
3e6ffa5124 Fix proc macro token mapping 2020-12-03 18:38:05 +01:00
bors[bot]
d46fce88f5
Merge #6700
6700: More macro diagnostics improvements r=jonas-schievink a=jonas-schievink

This threads macro expansion errors through `eager.rs` and the `AsMacroCall` trait, improving macro diagnostics emitted during body lowering.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-03 16:55:15 +00:00
Jonas Schievink
bca1e5fcb8 Rename error_sink to diagnostic_sink 2020-12-03 17:54:43 +01:00
Daiki Ihara
f486640682 Extract tests module to file in ide_db crate 2020-12-04 00:05:39 +09:00
Jonas Schievink
883c8d177d Make compile_error! lazy and emit a diagnostic 2020-12-03 15:48:29 +01:00
Jonas Schievink
4634bfb332 Give better diagnostic if OUT_DIR is unset 2020-12-03 15:48:29 +01:00
Jonas Schievink
17542d08b4 Update/Fix tests 2020-12-03 15:48:29 +01:00
Jonas Schievink
a634243634 Propagate eager expansion errors 2020-12-03 15:48:29 +01:00
Jonas Schievink
6da651f5da Don't prime caches when just opening a file 2020-12-02 20:18:28 +01:00
Jonas Schievink
f4866bb05c Test macro diagnostics in body lowering 2020-12-02 15:03:21 +01:00
bors[bot]
3e1fb112af
Merge #6698
6698: Attach macro expansion errors to the right file r=jonas-schievink a=jonas-schievink

Previously it attached them to the result of the macro expansion (or, if no result was produced, to the file containing the invocation). Always use the file containing the invocation.

This doesn't seem to have any observable difference, but seems better in theory.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-02 13:25:54 +00:00
Jonas Schievink
319fcd01ac Attach macro expansion errors to the right file 2020-12-02 14:23:51 +01:00
bors[bot]
dc09d97fb2
Merge #6649
6649: Accept more than just the standard rust literal suffixes in *Number::suffix r=matklad a=Veykril

I am not entirely sure whether to keep or remove the `SUFFIXES` but I figured we can always bring them back once they are needed.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 13:13:01 +00:00
bors[bot]
1db60512b6
Merge #6673
6673: Show type of Self on hover r=matklad a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 13:06:34 +00:00
bors[bot]
a8f04712d6
Merge #6679
6679: Extract tests module to file in vfs crate r=matklad a=sasurau4

Helps with #6522 

- [x] passed `cargo test`

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
2020-12-02 12:34:19 +00:00
bors[bot]
14086e3118
Merge #6697
6697: Don't discard PathKind::Abs information in lower_use::convert_path r=matklad a=Veykril

Fixes #6694

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 12:16:19 +00:00
Lukas Wirth
7b456552b8 Don't discard PathKind::Abs information in lower_use::convert_path 2020-12-02 09:54:03 +01:00
kjeremy
e4ffd70c91 Fix OptionalVersionedTextDocumentIdentifier type
Fixes #6654
2020-12-01 08:33:21 -05:00
bors[bot]
a18392bd90
Merge #6689
6689: Trigger .let postfix snippet in the middle of the block r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-01 12:38:45 +00:00
Aleksey Kladov
21d962f0ac Trigger .let postfix snippet in the middle of the block 2020-12-01 15:38:06 +03:00
bors[bot]
eb7f969510
Merge #6683
6683: Emit macro diagnostics when lowering bodies r=matklad a=jonas-schievink

Changes `Expander::enter_expand` to return an `ExpandResult`, and adds any contained errors to the body diagnostic list.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-01 12:27:52 +00:00
Jonas Schievink
ea7b81fef9 Emit unresolved proc macro errors 2020-12-01 12:40:03 +01:00
Aleksey Kladov
9d94ffad44 Place cursor correctly when completing assoc fns with self 2020-12-01 14:28:50 +03:00
Aleksey Kladov
02955661a0 Fix typo 2020-12-01 13:56:46 +03:00
Aleksey Kladov
6f51f728a1 Type-safer API for dealing with parameter lists with optional self 2020-12-01 13:53:39 +03:00
Jonas Schievink
be50908a50 Emit macro diagnostics when lowering bodies 2020-11-30 20:26:35 +01:00
Jonas Schievink
92f52c5c9a builtin_macro: move to mbe::ExpandResult 2020-11-30 19:21:25 +01:00
bors[bot]
70eb170271
Merge #6680
6680: Fix use merging not using the first path segment r=Veykril a=Veykril

Finally figured out why nested imports don't properly merge in some cases

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-30 16:22:56 +00:00
Lukas Wirth
ec94657077 Fix use merging not using the first path segment 2020-11-30 17:21:07 +01:00
Daiki Ihara
59bd6e2eea Extract tests module to file in vfs crate 2020-12-01 00:10:12 +09:00
kjeremy
0a95201243 bump lexer 2020-11-30 09:29:09 -05:00
Aleksey Kladov
8c3472b6f9 Minor cleanup 2020-11-30 13:47:38 +03:00
Lukas Wirth
9349d9ee48 Show type of Self on hover 2020-11-29 22:49:12 +01:00
bors[bot]
ac30710ada
Merge #6665
6665: Support self in reference search r=matklad a=Veykril

The approach here is simply checking the descendants of the function body for `PathExpr` then checking whether it only contains a single `self` `PathSegment`, this is to prevent us from picking up `self` tokens from local `UseTree`s.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-29 20:03:44 +00:00
Lukas Wirth
de4ada22d4 Support self in reference search 2020-11-29 20:54:17 +01:00
bors[bot]
25ebcca224
Merge #6599
6599: Add attribute highlight modifier to all tokens inside attributes r=matklad a=Veykril

This has the side effect that we also emit `attribute.attribute` highlights now, as in, the tokens that get the attribute semantic type also get the attribute modifier. I personally don't think it's really a problem but maybe it is to some? It's just that it was really simple to implement it this way, which is why I just went this route for now.

Fixes #6536

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-29 19:35:12 +00:00
bors[bot]
f8726d781a
Merge #6601
6601: add let and letm postfix to turn expressions into variables r=matklad a=bnjjj

Partially resolve #6426 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-11-29 19:21:25 +00:00
Lukas Wirth
4c33ae33e9 Reject more cases of invalid parameter to self renames 2020-11-29 19:02:59 +01:00
Lukas Wirth
f4a77f34da Fix renaming owned self to parameter emitting ref 2020-11-29 17:56:44 +01:00
Florian Diebold
21d256de72 Align default importMergeBehaviour with VSCode 2020-11-29 16:43:46 +01:00
bors[bot]
05f75d601f
Merge #6666
6666: Support 'go to definition' for self r=jonas-schievink a=Veykril

Also reverts #6660, instead of showing the type it now works like it does for names by returning the declaration we are already on. This for example enables VSCode to show all references(#6665) when executing `go to definition` on the declaration.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-29 14:35:38 +00:00
Lukas Wirth
37438c3335 Support 'go to definition' for self 2020-11-29 12:28:47 +01:00
bors[bot]
c8a2ff6ecc
Merge #6664
6664: Show type of self param on hover r=jonas-schievink a=Veykril

Show the type of `self` when hovering the token in a `SelfParam`.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-28 23:38:18 +00:00
Lukas Wirth
ee8afff714 Show type of self param on hover 2020-11-28 22:59:24 +01:00
Benjamin Coenen
474ebd60d1 add let and letm postfix to turn expressions into variables
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-11-28 17:38:16 +01:00
bors[bot]
a6f26ded00
Merge #6660
6660: Support "go to definition" for SelfParams r=jonas-schievink a=Veykril

Fixes #6657

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-28 16:04:35 +00:00
Lukas Wirth
49fbfffb48 Add ast::*Number::suffix tests unit tests 2020-11-28 16:22:28 +01:00
bors[bot]
e437e38d7a
Merge #6659
6659: Explain how we get precise spans for diagnostics. r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-11-28 15:16:33 +00:00
Aleksey Kladov
5a42e6bff5 Explain how we get precise spans for diagnostics. 2020-11-28 18:14:08 +03:00
bors[bot]
7f3ba7d57f
Merge #6645
6645: Publish diagnostics for macro expansion errors r=matklad a=jonas-schievink

This adds 2 new diagnostics, emitted during name resolution:

* `unresolved-proc-macro`, a weak warning that is emitted when a proc macro is supposed to be expanded, but was not provided by the build system. This usually means that proc macro support is turned off, but may also indicate setup issues when using rust-project.json. Being a weak warning, this should help set expectations when users see it, while not being too obstructive. We do not yet emit this for attribute macros though, just custom derives and `!` macros.
* `macro-error`, which is emitted when any macro (procedural or `macro_rules!`) fails to expand due to some error. This is an error-level diagnostic, but currently still marked as experimental, because there might be spurious errors and this hasn't been tested too well.

This does not yet emit diagnostics when expansion in item bodies fails, just for module-level macros.

Known bug: The "proc macro not found" diagnostic points at the whole item for custom derives, it should just point at the macro's name in the `#[derive]` list, but I haven't found an easy way to do that.

Screenshots:

![screenshot-2020-11-26-19:54:14](https://user-images.githubusercontent.com/1786438/100385782-f8bc2300-3023-11eb-9f27-e8f8ce9d6114.png)
![screenshot-2020-11-26-19:55:39](https://user-images.githubusercontent.com/1786438/100385784-f954b980-3023-11eb-9617-ac2eb0a0a9dc.png)


Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-11-28 15:10:00 +00:00
Lukas Wirth
b006856381 Support goto definition for ADT-SelfParams 2020-11-28 16:07:07 +01:00
bors[bot]
b7ece77af4
Merge #6650
6650: Make completion and assists module independent r=matklad a=SomeoneToIgnore

A follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/6553#discussion_r524402907

Move the common code for both assists and completion modules into a separate crate.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-11-28 14:33:57 +00:00
Kirill Bulatov
3f612d37c6 Move the helpers into ide_db 2020-11-28 16:30:39 +02:00
Jonas Schievink
f52abbe62d Coalesce flycheck events 2020-11-27 22:52:22 +01:00
Jonas Schievink
e49ba0d1df Downgrade "failed to load" error to warning 2020-11-27 18:35:22 +01:00
Jonas Schievink
ec7d2bbe42 Add/Fix macro expansion profiling 2020-11-27 18:07:16 +01:00
Kirill Bulatov
7b145bd99c Rustdocs fixes 2020-11-27 19:05:10 +02:00
Kirill Bulatov
f75f07019b Group import data in a struct 2020-11-27 18:30:10 +02:00
Kirill Bulatov
f4ae3650d8 Extract the import code into the shared module 2020-11-27 18:28:41 +02:00
Kirill Bulatov
04cd4b17bb
Fix the profiling string
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-11-27 18:13:02 +02:00
Kirill Bulatov
b2e6ca46ca Profile completions better 2020-11-27 18:00:03 +02:00
Jonas Schievink
d171838d63 More accurately place proc-macro diagnostic 2020-11-27 16:29:40 +01:00
Jonas Schievink
0432aa0ed7 Publish diagnostics for macro expansion errors 2020-11-27 13:50:22 +01:00
Jonas Schievink
1b26520971 Add dedicated error for "proc macro not found" 2020-11-27 13:50:20 +01:00
bors[bot]
c66d477f5a
Merge #6648
6648: Avoid allocation in ast::String::value if the string needs no unescaping r=lnicola a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-27 11:14:14 +00:00
Lukas Wirth
347da74eda Avoid allocation in ast::String::value if the string needs no unescaping 2020-11-27 12:03:58 +01:00
bors[bot]
572081f1c4
Merge #6586
6586: Don't call a closure a function in the infer_function_return_type assist label r=lnicola a=Veykril

`Add this function's return type` becomes `Add this closure's return type` for closures. This makes it more obvious that we are indeed planning on modifying the closure and not its containing function.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-27 09:49:37 +00:00
Lukas Wirth
931493e949 Accept more than just the standard rust literal suffixes in *Number::suffix 2020-11-27 00:00:18 +01:00
Lukas Wirth
6501c9445e Don't use raw identifiers 2020-11-26 21:44:17 +01:00
bors[bot]
fc0354b280
Merge #6635
6635: Complete struct in irrefutable let r=Veykril a=Veykril

Fixes #6210

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-26 20:30:16 +00:00
Lukas Wirth
ee06c07f50 Complete struct in irrefutable let 2020-11-26 21:28:43 +01:00
Laurențiu Nicola
3aca697511 Simplify error formatting 2020-11-26 21:07:15 +02:00
Laurențiu Nicola
a5477d7f29 Remove unused import 2020-11-26 19:25:59 +02:00
Jonas Schievink
519d870c11 Don't store SyntaxNodePtr in CrateDefMap
It is volatile across reparses and makes incrementality worse.
2020-11-26 17:29:09 +01:00
Jonas Schievink
74cb3e96a5 Test def map invalidation with #[cfg] below change 2020-11-26 17:28:00 +01:00
Jonas Schievink
2c85db8eb6 Implement Display for macro expansion errors 2020-11-26 16:56:22 +01:00
Jonas Schievink
6a9338e979 Use ExpandResult instead of MacroResult
`MacroResult` is redundant
2020-11-26 16:48:17 +01:00
Jonas Schievink
c784c8ec76 Use named fields in ExpandResult 2020-11-26 16:04:23 +01:00
Jonas Schievink
9ed883f373 Publish diagnostics on file open
Diagnostics are sometimes only showing up when typing.
This should fix that.
2020-11-26 13:33:47 +01:00
bors[bot]
db6988d4e7
Merge #6614 #6632
6614: Improve autoimports on completion speed r=matklad a=SomeoneToIgnore

Presumably closes https://github.com/rust-analyzer/rust-analyzer/issues/6594
May help https://github.com/rust-analyzer/rust-analyzer/issues/6612

* Ignore modules eaferly
* Do less completion string rendering

6632: Pin cargo_metadata r=matklad a=kjeremy

See: https://github.com/oli-obk/cargo_metadata/pull/142#issuecomment-733653275

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-11-26 10:43:35 +00:00
kjeremy
9a3142664b Pin cargo_metadata 2020-11-25 10:11:53 -05:00