]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoprettyfy
Aleksey Kladov [Sun, 12 Dec 2021 16:36:14 +0000 (19:36 +0300)]
prettyfy

2 years agoconsistency
Aleksey Kladov [Sun, 12 Dec 2021 16:32:04 +0000 (19:32 +0300)]
consistency

2 years agosimplify
Aleksey Kladov [Sun, 12 Dec 2021 16:31:32 +0000 (19:31 +0300)]
simplify

2 years agotighten up invariants
Aleksey Kladov [Sun, 12 Dec 2021 16:22:37 +0000 (19:22 +0300)]
tighten up invariants

2 years agoadd cross-crate inlines
Aleksey Kladov [Sun, 12 Dec 2021 16:17:04 +0000 (19:17 +0300)]
add cross-crate inlines

2 years agoport mbe to soa tokens
Aleksey Kladov [Sun, 12 Dec 2021 16:06:40 +0000 (19:06 +0300)]
port mbe to soa tokens

2 years agomore orthogonal interface
Aleksey Kladov [Sun, 12 Dec 2021 15:38:49 +0000 (18:38 +0300)]
more orthogonal interface

2 years agoparser tests work
Aleksey Kladov [Sun, 12 Dec 2021 14:58:45 +0000 (17:58 +0300)]
parser tests work

2 years agoSwitch parser to use tokens
Aleksey Kladov [Sun, 14 Nov 2021 19:13:44 +0000 (22:13 +0300)]
Switch parser to use tokens

2 years agouse eof token pattenr
Aleksey Kladov [Sun, 14 Nov 2021 18:37:10 +0000 (21:37 +0300)]
use eof token pattenr

2 years agostart SOA parser interface
Aleksey Kladov [Sun, 14 Nov 2021 13:47:13 +0000 (16:47 +0300)]
start SOA parser interface

2 years agoMerge #10993
bors[bot] [Sun, 12 Dec 2021 11:11:50 +0000 (11:11 +0000)]
Merge #10993

10993: minor: Bump deps r=lnicola a=lnicola

Gets `coutme 2.0`.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump deps
Laurențiu Nicola [Sat, 11 Dec 2021 16:39:23 +0000 (18:39 +0200)]
Bump deps

2 years agoMerge #10951
bors[bot] [Sat, 11 Dec 2021 22:58:49 +0000 (22:58 +0000)]
Merge #10951

10951: feat: assist to generate documentation templates r=Veykril a=numero-744

Closes #10878, #1915 and #4767

Full description is in #10878, better read [the tests](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R424) to understand what this feature does.

- [x] There is one remaining thing about non-`pub` functions, what do you think about it?
- [x] In this PR [empty examples are generated](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R99) for `trait` functions, but maybe no examples should be provided at all.
- [x] If there is already a documentation, add another one with a separator ([currently done](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R74)) or simply disable this assist?
- [x] I will check once more that the generated examples are correct (ie. they are easy to fill before that they are built and tested)

Comments appreciated :smile:

Co-authored-by: Côme ALLART <come.allart@etu.emse.fr>
2 years agofeat: remove should_panic example generation
Côme ALLART [Sat, 11 Dec 2021 21:46:54 +0000 (22:46 +0100)]
feat: remove should_panic example generation

2 years agorefactor: use hir to test if a value is returned
Côme ALLART [Sat, 11 Dec 2021 19:52:14 +0000 (20:52 +0100)]
refactor: use hir to test if a value is returned

2 years agorefactor: use Itertools::intersperse
Côme ALLART [Sat, 11 Dec 2021 19:41:23 +0000 (20:41 +0100)]
refactor: use Itertools::intersperse

2 years agorefactor: use hir to compare returned and self types
Côme ALLART [Sat, 11 Dec 2021 19:33:08 +0000 (20:33 +0100)]
refactor: use hir to compare returned and self types

2 years agoMerge #10988
bors[bot] [Sat, 11 Dec 2021 17:51:02 +0000 (17:51 +0000)]
Merge #10988

10988: Fix expected type calculation in struct literal if followed by comma r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoFix expected type calculation in struct literal if followed by comma
Florian Diebold [Sat, 11 Dec 2021 17:47:21 +0000 (18:47 +0100)]
Fix expected type calculation in struct literal if followed by comma

2 years agoMerge #10987
bors[bot] [Sat, 11 Dec 2021 17:20:14 +0000 (17:20 +0000)]
Merge #10987

10987: fix: respect inner attributes for Structs and Enums r=lnicola a=rainy-me

fix: #10980 (the allow/deny issue is not fully resolved though.)

Co-authored-by: rainy-me <github@yue.coffee>
2 years agofix: lookup upwards for struct and enum
rainy-me [Sat, 11 Dec 2021 16:23:27 +0000 (01:23 +0900)]
fix: lookup upwards for struct and enum

2 years agoMerge #10965
bors[bot] [Sat, 11 Dec 2021 15:06:52 +0000 (15:06 +0000)]
Merge #10965

10965: minor: Remove dead assists-related function r=Veykril a=lnicola

Unless I'm missing something, `assists_with_fixes` seems to be always used and ends up in the same code path.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #10956 #10986
bors[bot] [Sat, 11 Dec 2021 14:58:07 +0000 (14:58 +0000)]
Merge #10956 #10986

10956: minor: Bump deps r=Veykril a=lnicola

bors r+

10986: fix: Fix lint completions not working for unclosed attributes r=Veykril a=Veykril

Fixes #10682
Uses keywords and nested `TokenTree`s as a heuristic to figure out when to stop parsing in case the attribute is unclosed which should work pretty well as attributes are usually followed by either of those.
bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix lint completions not working for unclosed attributes
Lukas Wirth [Sat, 11 Dec 2021 14:55:25 +0000 (15:55 +0100)]
fix: Fix lint completions not working for unclosed attributes

2 years agoMerge #10877
bors[bot] [Sat, 11 Dec 2021 14:49:29 +0000 (14:49 +0000)]
Merge #10877

10877: feat: make hightlighting linear r=matklad a=matklad

In https://youtu.be/qvIZZf5dmTE, we've noticed that AstIdMap does a
linear lookup when going from SyntaxNode to Id. This leads to
accidentally quadratic overall performance. Replace linear lookup with a
O(1) hashmap lookup.

Future work: don't duplicate `SyntaxNodePtr` in `AstIdMap` and switch to
"call site dependency injection" style storage (eg, store a
`HashSet<ErasedFileAstId>`).

See the explanation of the work here on YouTube :-)

As you can see from then benchmark results, this doesn't actually make analysis stats fastre. I am a bit mystified as to why this is happening to be honest.

Baseline
```
Database loaded:     598.40ms, 304minstr, 118mb (metadata 390.57ms, 21minstr, 841kb; build 111.31ms, 8764kinstr, -214kb)
  crates: 39, mods: 824, decls: 18647, fns: 13910
Item Collection:     9.70s, 75ginstr, 377mb
  exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145
Inference:           43.16s, 342ginstr, 641mb
Total:               52.86s, 417ginstr, 1018mb
```

This PR:
```
Database loaded:     626.34ms, 304minstr, 118mb (metadata 416.26ms, 21minstr, 841kb; build 113.67ms, 8750kinstr, -209kb)
  crates: 39, mods: 824, decls: 18647, fns: 13910
Item Collection:     10.16s, 75ginstr, 389mb
  exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145
Inference:           44.51s, 342ginstr, 644mb
Total:               54.67s, 417ginstr, 1034mb
```

I think we probably should merge the first commit here, but not the second.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agomore frugal map
Aleksey Kladov [Sun, 5 Dec 2021 14:19:48 +0000 (17:19 +0300)]
more frugal map

2 years agoMerge #10985
bors[bot] [Sat, 11 Dec 2021 14:32:29 +0000 (14:32 +0000)]
Merge #10985

10985: minor: Remove unnecessary clones r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Remove unnecessary clones
Lukas Wirth [Sat, 11 Dec 2021 14:27:36 +0000 (15:27 +0100)]
minor: Remove unnecessary clones

2 years agoMerge #10976
bors[bot] [Sat, 11 Dec 2021 13:50:55 +0000 (13:50 +0000)]
Merge #10976

10976: fix: Show case-insensitive exact matches instead of fuzzy flyimport for short paths r=Veykril a=Veykril

And raise the fuzzy trigger from 2 to 3 chars. This way we keep the ability of flyimporting short names like `Rc`.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6917
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoShow case-insensitive exact matches instead of fuzzy flyimport for short paths
Lukas Wirth [Thu, 9 Dec 2021 18:18:11 +0000 (19:18 +0100)]
Show case-insensitive exact matches instead of fuzzy flyimport for short paths

2 years agoMerge #10978
bors[bot] [Fri, 10 Dec 2021 22:31:55 +0000 (22:31 +0000)]
Merge #10978

10978: internal: Only prime direct dependencies of the workspace crates r=jonas-schievink a=lnicola

This reduces the number of primed crates on `self` from 177 to 105.

```text
# baseline
  86521 me   20   0 2939M  562M 14320 S  0.0  0.9  0:07.10   37 rust-analyzer

# pr
  99947 me   20   0 2935M  549M 14424 S  0.0  0.9  0:07.10   37 rust-analyzer
```

The RAM usage seems to vary a lot, so I'm not sure the improvement shown above is real.

We also drop the topological sorting, although it might still make sense to do the dependencies before the workspace crates. But since it's only used to make the progress reporting a bit more fine, it probably doesn't matter too much.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #10981
bors[bot] [Fri, 10 Dec 2021 19:02:51 +0000 (19:02 +0000)]
Merge #10981

10981: internal: Remove some allocations r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove some allocations
Lukas Wirth [Fri, 10 Dec 2021 19:01:24 +0000 (20:01 +0100)]
Remove some allocations

2 years agoMerge #10979
bors[bot] [Fri, 10 Dec 2021 18:19:02 +0000 (18:19 +0000)]
Merge #10979

10979: fix: Don't show trait flyimports for impl trait and placeholders r=Veykril a=Veykril

cc #8539
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't show trait flyimports for impl trait and placeholders
Lukas Wirth [Fri, 10 Dec 2021 18:18:21 +0000 (19:18 +0100)]
Don't show trait flyimports for impl trait and placeholders

2 years agoShow enum completions for single variant enums in irrefutable patterns
Lukas Wirth [Fri, 10 Dec 2021 17:25:54 +0000 (18:25 +0100)]
Show enum completions for single variant enums in irrefutable patterns

2 years agofeat: trait fn: add panicking example only if default panicks
Côme ALLART [Fri, 10 Dec 2021 14:53:43 +0000 (15:53 +0100)]
feat: trait fn: add panicking example only if default panicks

2 years agoOnly prime direct dependencies of the workspace crates
Laurențiu Nicola [Fri, 10 Dec 2021 14:24:07 +0000 (16:24 +0200)]
Only prime direct dependencies of the workspace crates

2 years agoMerge #10977
bors[bot] [Fri, 10 Dec 2021 14:19:51 +0000 (14:19 +0000)]
Merge #10977

10977: fix: fix `concat!` with captured expression r=jonas-schievink a=jonas-schievink

Adds another hack on top of https://github.com/rust-analyzer/rust-analyzer/pull/10623 to fix `concat!`.

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix `concat!` with captured expression
Jonas Schievink [Fri, 10 Dec 2021 14:17:31 +0000 (15:17 +0100)]
Fix `concat!` with captured expression

2 years agorefactor: use hir to check if fn in trait/impl
Côme ALLART [Fri, 10 Dec 2021 14:16:04 +0000 (15:16 +0100)]
refactor: use hir to check if fn in trait/impl

2 years agofix: check correctly if function is exported
Côme ALLART [Fri, 10 Dec 2021 13:16:07 +0000 (14:16 +0100)]
fix: check correctly if function is exported

2 years agoMerge #10975
bors[bot] [Thu, 9 Dec 2021 17:41:01 +0000 (17:41 +0000)]
Merge #10975

10975: internal: Shrink TraitImpls and InherentImpls HashMaps r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Shrink TraitImpls and InherentImpls HashMaps
Lukas Wirth [Thu, 9 Dec 2021 17:39:46 +0000 (18:39 +0100)]
internal: Shrink TraitImpls and InherentImpls HashMaps

2 years agoMerge #10974
bors[bot] [Thu, 9 Dec 2021 17:28:53 +0000 (17:28 +0000)]
Merge #10974

10974: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Thu, 9 Dec 2021 17:28:10 +0000 (18:28 +0100)]
Simplify

2 years agoUse known names instead of string literals
Lukas Wirth [Thu, 9 Dec 2021 17:13:15 +0000 (18:13 +0100)]
Use known names instead of string literals

2 years agoRemove some allocs
Lukas Wirth [Thu, 9 Dec 2021 17:04:32 +0000 (18:04 +0100)]
Remove some allocs

2 years agoMerge #10972
bors[bot] [Thu, 9 Dec 2021 15:18:41 +0000 (15:18 +0000)]
Merge #10972

10972: minor: Bump vscode to 1.62 r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump eslint
Laurențiu Nicola [Thu, 9 Dec 2021 15:16:30 +0000 (17:16 +0200)]
Bump eslint

2 years agoBump vscode
Laurențiu Nicola [Thu, 9 Dec 2021 15:15:21 +0000 (17:15 +0200)]
Bump vscode

2 years agoMerge #10966
bors[bot] [Wed, 8 Dec 2021 16:12:37 +0000 (16:12 +0000)]
Merge #10966

10966: fix: Fix library target overriding sysroot deps r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix library target overriding sysroot deps
Jonas Schievink [Wed, 8 Dec 2021 16:05:00 +0000 (17:05 +0100)]
Fix library target overriding sysroot deps

2 years agoRemove dead assists-related function
Laurențiu Nicola [Wed, 8 Dec 2021 14:55:25 +0000 (16:55 +0200)]
Remove dead assists-related function

2 years agoMerge #10964
bors[bot] [Wed, 8 Dec 2021 14:46:13 +0000 (14:46 +0000)]
Merge #10964

10964: minor: Move synstructure hack out of ItemTree lowering r=jonas-schievink a=jonas-schievink

Don't set the name to `None` for the rest of the IDE if it's generated by synstructure.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoMove synstructure hack out of ItemTree lowering
Jonas Schievink [Wed, 8 Dec 2021 14:44:52 +0000 (15:44 +0100)]
Move synstructure hack out of ItemTree lowering

2 years agofix: add mod files in path in generated examples
Côme ALLART [Tue, 7 Dec 2021 22:34:53 +0000 (23:34 +0100)]
fix: add mod files in path in generated examples

2 years agoMerge #10950
bors[bot] [Tue, 7 Dec 2021 21:57:59 +0000 (21:57 +0000)]
Merge #10950

10950: internal: completion: split out more PathKinds from ImmediateLocation r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: completion: split out more PathKinds from ImmediateLocation
Lukas Wirth [Mon, 6 Dec 2021 14:51:33 +0000 (15:51 +0100)]
internal: completion: split out more PathKinds from ImmediateLocation

2 years agofix: disable assist for documented functions
Côme ALLART [Tue, 7 Dec 2021 17:02:18 +0000 (18:02 +0100)]
fix: disable assist for documented functions

2 years agoMerge #10960
bors[bot] [Tue, 7 Dec 2021 16:52:21 +0000 (16:52 +0000)]
Merge #10960

10960: fix: fix handling of macros in `extern` blocks r=jonas-schievink a=jonas-schievink

- Removes knowledge of what's in an extern block from `ItemTree`.
- Treats extern blocks as `AssocContainerId` and renames the latter to `ItemContainerId`.
- Threads the container through name resolution (which is a bit messy).
- Considers statics to be associated items, since they can be in an extern block. (it might be better to further distinguish potentially-associated-items from potentially-in-an-extern-block-items, but currently I don't expect much of a benefit)
- Adds a test for the incorrect-case diagnostic demonstrating the impact of this change.

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoTreat extern blocks as item containers
Jonas Schievink [Tue, 7 Dec 2021 16:31:26 +0000 (17:31 +0100)]
Treat extern blocks as item containers

2 years agoMerge #10958
bors[bot] [Tue, 7 Dec 2021 15:44:05 +0000 (15:44 +0000)]
Merge #10958

10958: internal: add "Shuffle Crate Graph" command r=jonas-schievink a=jonas-schievink

May be useful for debugging issues like https://github.com/rust-analyzer/rust-analyzer/issues/10084

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoUpdate lsp-extensions.md
Jonas Schievink [Tue, 7 Dec 2021 15:41:24 +0000 (16:41 +0100)]
Update lsp-extensions.md

2 years agointernal: add "Shuffle Crate Graph" command
Jonas Schievink [Tue, 7 Dec 2021 14:38:12 +0000 (15:38 +0100)]
internal: add "Shuffle Crate Graph" command

2 years agoMerge #10957
bors[bot] [Tue, 7 Dec 2021 14:51:07 +0000 (14:51 +0000)]
Merge #10957

10957: fix: Fix some TryToNav impls not upmapping ranges out of macros r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdjust incorrect runnable tests
Lukas Wirth [Tue, 7 Dec 2021 14:42:54 +0000 (15:42 +0100)]
Adjust incorrect runnable tests

2 years agoSimplify
Lukas Wirth [Tue, 7 Dec 2021 14:06:56 +0000 (15:06 +0100)]
Simplify

2 years agoFix some TryToNav impls not upmapping ranges out of macros
Lukas Wirth [Tue, 7 Dec 2021 14:02:22 +0000 (15:02 +0100)]
Fix some TryToNav impls not upmapping ranges out of macros

2 years agoBump deps
Laurențiu Nicola [Tue, 7 Dec 2021 11:09:42 +0000 (13:09 +0200)]
Bump deps

2 years agofix: reduce assist scope: pub fn's in pub modules
Côme ALLART [Mon, 6 Dec 2021 22:33:24 +0000 (23:33 +0100)]
fix: reduce assist scope: pub fn's in pub modules

2 years agoMerge #10953
bors[bot] [Mon, 6 Dec 2021 19:26:51 +0000 (19:26 +0000)]
Merge #10953

10953: minor: Bump `tracing` r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump tracing
Laurențiu Nicola [Mon, 6 Dec 2021 18:47:02 +0000 (20:47 +0200)]
Bump tracing

2 years agofix: format assist doc for sourcegen_assists_docs
Côme ALLART [Mon, 6 Dec 2021 18:04:44 +0000 (19:04 +0100)]
fix: format assist doc for sourcegen_assists_docs

2 years agofeat: assist to generate documentation templates
Côme ALLART [Mon, 6 Dec 2021 17:32:25 +0000 (18:32 +0100)]
feat: assist to generate documentation templates

2 years agoMerge #10949
bors[bot] [Mon, 6 Dec 2021 09:50:49 +0000 (09:50 +0000)]
Merge #10949

10949: Bump parser step limit a little r=lnicola a=lnicola

Fixes #10948

This doesn't actually make the limit configurable, but at least uses the same `Limit` struct, so we can fix all of them at once when we get to it.

We also bump the limit from 10 to 15M, which is a small enough increase to not worry about making the experience worse for non-`windows` users. We still crash when we reach the limit.

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump parser step limit a little
Laurențiu Nicola [Mon, 6 Dec 2021 09:47:36 +0000 (11:47 +0200)]
Bump parser step limit a little

2 years agoMerge #10944
bors[bot] [Sun, 5 Dec 2021 15:28:28 +0000 (15:28 +0000)]
Merge #10944

10944: internal: Prefer resolution of inert attributes r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Prefer resolution of inert attributes
Lukas Wirth [Sun, 5 Dec 2021 15:23:20 +0000 (16:23 +0100)]
internal: Prefer resolution of inert attributes

2 years agoMerge #10943
bors[bot] [Sun, 5 Dec 2021 15:14:10 +0000 (15:14 +0000)]
Merge #10943

10943: feat: Enable completions for attributes r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofeat: Enable flyimport completions for attributes
Lukas Wirth [Sun, 5 Dec 2021 14:57:28 +0000 (15:57 +0100)]
feat: Enable flyimport completions for attributes

2 years agotry to optimize things unsuccessfully
Aleksey Kladov [Sat, 27 Nov 2021 18:13:07 +0000 (21:13 +0300)]
try to optimize things unsuccessfully

Baseline
```
Database loaded:     598.40ms, 304minstr, 118mb (metadata 390.57ms, 21minstr, 841kb; build 111.31ms, 8764kinstr, -214kb)
  crates: 39, mods: 824, decls: 18647, fns: 13910
Item Collection:     9.70s, 75ginstr, 377mb
  exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145
Inference:           43.16s, 342ginstr, 641mb
Total:               52.86s, 417ginstr, 1018mb
```

Eager
```
Database loaded:     625.86ms, 304minstr, 118mb (metadata 414.52ms, 21minstr, 841kb; build 113.81ms, 8764kinstr, -230kb)
  crates: 39, mods: 824, decls: 18647, fns: 13910
Item Collection:     10.09s, 75ginstr, 389mb
  exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145
Inference:           43.27s, 341ginstr, 644mb
Total:               53.37s, 417ginstr, 1034mb
```

Lazy
```
Database loaded:     626.34ms, 304minstr, 118mb (metadata 416.26ms, 21minstr, 841kb; build 113.67ms, 8750kinstr, -209kb)
  crates: 39, mods: 824, decls: 18647, fns: 13910
Item Collection:     10.16s, 75ginstr, 389mb
  exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145
Inference:           44.51s, 342ginstr, 644mb
Total:               54.67s, 417ginstr, 1034mb
```

2 years agofeat: make hightlighting linear
Aleksey Kladov [Sat, 27 Nov 2021 17:50:07 +0000 (20:50 +0300)]
feat: make hightlighting linear

In https://youtu.be/qvIZZf5dmTE, we've noticed that AstIdMap does a
linear lookup when going from SyntaxNode to Id. This leads to
accidentally quadratic overall performance. Replace linear lookup with a
O(1) hashmap lookup.

Future work: don't duplicate `SyntaxNodePtr` in `AstIdMap` and switch to
"call site dependency injection" style storage (eg, store a
`HashSet<ErasedFileAstId>`).

See the explanation of the work here on YouTube
https://youtu.be/wvEgymUm7cY :-)

2 years agoMerge #10940
bors[bot] [Sun, 5 Dec 2021 12:12:44 +0000 (12:12 +0000)]
Merge #10940

10940: minor: Fix HttpsProxyAgent creation and avoid deprecated call r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix HttpsProxyAgent creation and avoid deprecated call
Laurențiu Nicola [Sun, 5 Dec 2021 12:11:49 +0000 (14:11 +0200)]
Fix HttpsProxyAgent creation and avoid deprecated call

2 years agoMerge #10939
bors[bot] [Sun, 5 Dec 2021 11:55:36 +0000 (11:55 +0000)]
Merge #10939

10939: minor: Clean up some unused cross-crate dependencies r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoClean up some unused cross-crate dependencies
Laurențiu Nicola [Sun, 5 Dec 2021 11:54:35 +0000 (13:54 +0200)]
Clean up some unused cross-crate dependencies

2 years agoMerge #10938
bors[bot] [Sun, 5 Dec 2021 11:40:23 +0000 (11:40 +0000)]
Merge #10938

10938: minor: Bump d3 r=lnicola a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump d3
Laurențiu Nicola [Sun, 5 Dec 2021 11:38:31 +0000 (13:38 +0200)]
Bump d3

2 years agoMerge #10937
bors[bot] [Sun, 5 Dec 2021 11:02:55 +0000 (11:02 +0000)]
Merge #10937

10937: fix: Add highlighting hack back for unresolved attributes r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/10935
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Add highlighting hack back for unresolved attributes
Lukas Wirth [Sun, 5 Dec 2021 10:59:07 +0000 (11:59 +0100)]
fix: Add highlighting hack back for unresolved attributes

2 years agoMerge #10902
bors[bot] [Sun, 5 Dec 2021 10:52:54 +0000 (10:52 +0000)]
Merge #10902

10902: Handle multiple cargo check quick fix spans r=Veykril a=brandondong

Resolves https://github.com/rust-analyzer/rust-analyzer/issues/10705.

**Cause:**
- For a cargo check diagnostic with multiple spans, only a single quick fix action would be created at the location of `spans[0]`. Additionally, the hover window details would only show the location of `spans[0]` next to the message.

**Fix:**
- Allow cargo check quick fix actions to be triggerable from multiple selection ranges. Specifically, if the selection intersects with any of the replacement spans, the quick fix action is shown.
- No change in behavior for the hover window details. It's pretty minor and I think showing multiple locations next to the message may be more confusing anyways.

Co-authored-by: Brandon <brandondong604@hotmail.com>
2 years agoUpdate expected test results
Brandon [Sun, 5 Dec 2021 05:26:07 +0000 (21:26 -0800)]
Update expected test results

2 years agoHandle multiple cargo check quick fix spans
Brandon [Sun, 5 Dec 2021 04:59:26 +0000 (20:59 -0800)]
Handle multiple cargo check quick fix spans

2 years agoRefactor away unnecessary Vec
Brandon [Sun, 5 Dec 2021 03:59:05 +0000 (19:59 -0800)]
Refactor away unnecessary Vec

2 years agoMerge #10930
bors[bot] [Sat, 4 Dec 2021 18:08:11 +0000 (18:08 +0000)]
Merge #10930

10930: fix: Fix self keyword not being tagged as such in highlighting properly r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix self keyword not being tagged as such in highlighting properly
Lukas Wirth [Sat, 4 Dec 2021 18:07:18 +0000 (19:07 +0100)]
fix: Fix self keyword not being tagged as such in highlighting properly

2 years agoMerge #10929
bors[bot] [Sat, 4 Dec 2021 17:33:16 +0000 (17:33 +0000)]
Merge #10929

10929: internal: Split up macro/attribute semantic tokens a bit more r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate semantic token docs
Lukas Wirth [Sat, 4 Dec 2021 17:23:25 +0000 (18:23 +0100)]
Update semantic token docs