Commit Graph

9459 Commits

Author SHA1 Message Date
bors[bot]
6a0a47dd14
Merge #6980
6980: Implement to support intra-doc link r=matklad a=sasurau4

Helps with #6168 

This PR is very limited implementation to support intra-doc. It only support links indicate same file function.

I want someone to feedback me about this implementation. If the approach is good, I will continue this PR to support other symbols like enum and struct. 

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
2021-01-10 10:02:10 +00:00
bors[bot]
4fddf40f5b
Merge #7224
7224: Remove unnecessary allocation when checking whether to hide argument name hint r=jhpratt a=jhpratt

The case-insensitive prefix/suffix check can be performed
character-by-character. This allows the check to be done without having
to allocate a new string. As a side effect, it's also no longer
necessary to convert the entire string to lowercase, as it's done as
needed. As the only case equality we're handling is ASCII, this
operation can be further optimized by using byte equality, rather than
character equality.

cc @SomeoneToIgnore, as it's an update on my PR from yesterday.

Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>
2021-01-10 09:34:24 +00:00
Jacob Pratt
5e81892d4d
Skip leading underscores unconditionally 2021-01-10 04:23:32 -05:00
Aleksey Kladov
083986030e Replace state with function 2021-01-10 11:57:17 +03:00
Jacob Pratt
22566ecd1b
Short-circuit boolean operation 2021-01-10 03:05:52 -05:00
Jacob Pratt
bd8a903548
Remove unnecessary allocation
The case-insensitive prefix/suffix check can be performed
character-by-character. This allows the check to be done without having
to allocate a new string. As a side effect, it's also no longer
necessary to convert the entire string to lowercase, as it's done as
needed. As the only case equality we're handling is ASCII, this
operation can be further optimized by using byte equality, rather than
character equality.
2021-01-09 21:36:38 -05:00
Aleksey Kladov
eeceff3179 Refactor highlighting 2021-01-09 23:07:32 +03:00
Aleksey Kladov
92dac67d0c Simplify 2021-01-09 17:31:22 +03:00
Aleksey Kladov
4a8d2c098d Better highlight for fixtures 2021-01-09 16:07:41 +03:00
Aleksey Kladov
62b17bac92 Simplify 2021-01-09 15:54:38 +03:00
Aleksey Kladov
d4fb7476ef Better names 2021-01-09 15:38:32 +03:00
Aleksey Kladov
8a0bd50036 Reduce duplication 2021-01-09 15:12:21 +03:00
Aleksey Kladov
3dfa2768ac Shorten names 2021-01-09 14:48:15 +03:00
Aleksey Kladov
c6150a3706 Reorder modules 2021-01-09 14:45:47 +03:00
Aleksey Kladov
64a6ee4535 Shorten frequent names 2021-01-09 14:44:01 +03:00
Aleksey Kladov
6fb52af521 Rename dummy -> none 2021-01-09 14:41:31 +03:00
Jacob Pratt
38dd9aa284
Hide argument name hint regardless of case 2021-01-09 04:05:59 -05:00
bors[bot]
5fe8cb1fba
Merge #7213
7213: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-08 23:20:54 +00:00
Lukas Wirth
5889bb27d6 Simplify 2021-01-09 00:17:34 +01:00
bors[bot]
056cabf25d
Merge #7212
7212: Simplify highlighting r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-08 20:48:30 +00:00
Aleksey Kladov
e30c1c3fbf Simplify highlighting infra
This also fixes the killer whale bug
2021-01-08 23:47:35 +03:00
Daiki Ihara
65c45083cf Support intra_doc links 2021-01-08 22:23:03 +09:00
Edwin Cheng
bced02c5dc Add test 2021-01-08 14:00:23 +08:00
Edwin Cheng
74a24adc8e Fix bug when $crate in LHS in mbe 2021-01-08 14:00:16 +08:00
bors[bot]
1a29934c37
Merge #7145
7145: Proper handling $crate Take 2 [DO NOT MERGE] r=edwin0cheng a=edwin0cheng

Similar to previous PR (#7133) , but improved the following things :

1. Instead of storing the whole `ExpansionInfo`, we store a similar but stripped version `HygieneInfo`.
2. Instread of storing the `SyntaxNode` (because every token we are interested are IDENT), we store the `TextRange` only.
3. Because of 2, we now can put it in Salsa.
4. And most important improvement: Instead of computing the whole frames every single time, we compute it recursively through salsa: (Such that in the best scenario, we only need to compute the first layer of frame)

```rust
        let def_site = db.hygiene_frame(info.def.file_id);
        let call_site = db.hygiene_frame(info.arg.file_id);

        HygieneFrame { expansion: Some(info), local_inner, krate, call_site, def_site }
```

The overall speed compared to previous PR is much faster (65s vs 45s) :
```
[WITH old PR]
Database loaded 644.86ms, 284mi
Crates in this dir: 36
Total modules found: 576
Total declarations: 11153
Total functions: 8715
Item Collection: 15.78s, 91562mi
Total expressions: 240721
Expressions of unknown type: 2635 (1%)
Expressions of partially unknown type: 2064 (0%)
Type mismatches: 865
Inference: 49.84s, 250747mi
Total: 65.62s, 342310mi
rust-analyzer -q analysis-stats .  66.72s user 0.57s system 99% cpu 1:07.40 total

[WITH this PR]
Database loaded 665.83ms, 284mi
Crates in this dir: 36
Total modules found: 577
Total declarations: 11188
Total functions: 8743
Item Collection: 15.28s, 84919mi
Total expressions: 241229
Expressions of unknown type: 2637 (1%)
Expressions of partially unknown type: 2064 (0%)
Type mismatches: 868
Inference: 30.15s, 135293mi
Total: 45.43s, 220213mi   
rust-analyzer -q analysis-stats .  46.26s user 0.74s system 99% cpu 47.294 total
```

*HOWEVER*,  it is still a perf regression (35s vs 45s):
```
[WITHOUT this PR]
Database loaded 657.42ms, 284mi
Crates in this dir: 36
Total modules found: 577
Total declarations: 11177
Total functions: 8735
Item Collection: 12.87s, 72407mi
Total expressions: 239380
Expressions of unknown type: 2643 (1%)
Expressions of partially unknown type: 2064 (0%)
Type mismatches: 868
Inference: 22.88s, 97889mi
Total: 35.74s, 170297mi
rust-analyzer -q analysis-stats .  36.71s user 0.63s system 99% cpu 37.498 total
```



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-08 03:57:11 +00:00
Lukas Wirth
6dca2cbba5 Simplify mod completion 2021-01-07 23:33:52 +01:00
Lukas Wirth
ca6db58762 Tidy up attribute completion match 2021-01-07 22:48:54 +01:00
Phil Ellison
7066bff9c3 Switch test marker 2021-01-07 19:01:33 +00:00
Phil Ellison
554ee6ea02 cargo fmt 2021-01-07 19:01:33 +00:00
Phil Ellison
b2dbe6e43a Add fix to wrap return expression in Some 2021-01-07 19:01:33 +00:00
bors[bot]
4ddf075673
Merge #7193
7193: Show progress for fetching workspace (cargo-metadata and loadOutDirsFromCheck) r=matklad a=edwin0cheng


![Peek 2021-01-07 21-57](https://user-images.githubusercontent.com/11014119/103902132-0db4c780-5135-11eb-94d3-32429445be87.gif)


Fixes #7188 
Fixes #3300

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-07 18:07:01 +00:00
bors[bot]
c29d353623
Merge #7191
7191: Adjust vfs crate documentation r=matklad a=arnaudgolfouse

This removes an outdated comment, and uses intra-doc links

Co-authored-by: Arnaud <arnaud.golfouse@free.fr>
2021-01-07 17:57:48 +00:00
Edwin Cheng
2b2d699b35 Report progress for cargo metadata and output-dir 2021-01-08 01:18:58 +08:00
Edwin Cheng
54eb87de03 Refactor out JodChild 2021-01-08 01:08:34 +08:00
Aleksey Kladov
f459375f48 Better fixture highlight 2021-01-07 19:11:27 +03:00
bors[bot]
7967ce85cf
Merge #7184
7184: Changes Cursor Marker To $0 r=matklad a=kevaundray



Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
2021-01-07 12:27:17 +00:00
Kevaundray Wedderburn
72b9a4fbd3 Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
Aleksey Kladov
037caec62c Use american spelling for config
As per

171c3c08fe/docs/dev/style.md (variable-naming)

Also implement config aliasing, for pain-free settings migrations in the future
2021-01-07 15:07:19 +03:00
Arnaud
d216d718bf Use file_set::FileSet and FileSet consistently in doc
The first occurrence of `FileSet` has the full path (`file_set::FileSet`),
while every other is simply `FileSet`.
2021-01-07 12:18:25 +01:00
Arnaud
f80f4ff223 Use intra-doc links in vfs crate documentation 2021-01-07 12:17:38 +01:00
Arnaud
b6669b1c9b Remove the reference to WalkdirLoaderHandle in vfs documentation
This structure was deleted in commit #dad1333
2021-01-07 12:10:02 +01:00
Aleksey Kladov
c8ace3a295 Remove some stale deprecations 2021-01-07 13:54:18 +03:00
Edwin Cheng
76f2b9d2ef Proper handling $crate Take 2 2021-01-07 13:08:32 +08:00
Aleksey Kladov
f8a0561178 Align config's API with usage
The config now is mostly immutable, optimize for that.
2021-01-06 21:22:24 +03:00
bors[bot]
7ae4b8bdb6
Merge #7183
7183: YAGNI active_resolve_capabilities r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-06 17:29:18 +00:00
Aleksey Kladov
6e87828756 YAGNI active_resolve_capabilities
This leaks a lot of LSP details into ide layer, which we want to avoid:

c9cec381bc/docs/dev (lsp-independence)

Additionally, all what this infra does is providing a toggle for
auto-import completion, but we already have one!
2021-01-06 20:23:53 +03:00
Jesse Bakker
974313eb87 Replace last usages of difference with dissimilar 2021-01-06 18:13:29 +01:00
bors[bot]
c9cec381bc
Merge #7181
7181: Document project_model::PackageData and project_model::TargetData r=arnaudgolfouse a=arnaudgolfouse

This PR adds some documentation for the `project_model` crate.

Some of the field descriptions were taken directly from their `cargo_metadata` counterpart :
- `PackageData` -> `cargo_metadata::Package`
- `TargetData` -> `cargo_metadata::Target`

Co-authored-by: Arnaud <arnaud.golfouse@free.fr>
2021-01-06 16:41:22 +00:00
Arnaud
ef636ba346 Document project_model::TargetData
This adds a description for `TargetData` and all its fields.
2021-01-06 17:26:21 +01:00
Arnaud
0abe487f1c Document project_model::PackageData
This adds a description for `PackageData` and all its fields.
2021-01-06 17:26:15 +01:00