Lukas Wirth
143a30aa51
Show case-insensitive exact matches instead of fuzzy flyimport for short paths
2021-12-11 14:47:11 +01:00
bors[bot]
d03397fe11
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>
2021-12-10 22:31:55 +00:00
Lukas Wirth
1bbc255ec5
Remove some allocations
2021-12-10 20:01:24 +01:00
Lukas Wirth
c81aa68afe
Don't show trait flyimports for impl trait and placeholders
2021-12-10 19:18:21 +01:00
Lukas Wirth
a7fc2061ea
Show enum completions for single variant enums in irrefutable patterns
2021-12-10 18:25:54 +01:00
Côme ALLART
9c0f9d02bf
feat: trait fn: add panicking example only if default panicks
2021-12-10 15:53:43 +01:00
Laurențiu Nicola
d012a20f25
Only prime direct dependencies of the workspace crates
2021-12-10 16:24:07 +02:00
bors[bot]
bc8efca0c8
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>
2021-12-10 14:19:51 +00:00
Jonas Schievink
95ddeaed8e
Fix concat!
with captured expression
2021-12-10 15:17:31 +01:00
Côme ALLART
f5e0998402
refactor: use hir to check if fn in trait/impl
2021-12-10 15:16:04 +01:00
Côme ALLART
c3d151ada6
fix: check correctly if function is exported
2021-12-10 14:42:31 +01:00
Lukas Wirth
c469f8abcb
internal: Shrink TraitImpls and InherentImpls HashMaps
2021-12-09 18:39:46 +01:00
Lukas Wirth
e1a236d65e
Simplify
2021-12-09 18:28:10 +01:00
Lukas Wirth
f9c59d3752
Use known names instead of string literals
2021-12-09 18:13:15 +01:00
Lukas Wirth
067d87e8a9
Remove some allocs
2021-12-09 18:04:32 +01:00
Jonas Schievink
58ce331baa
Fix library target overriding sysroot deps
2021-12-08 17:05:00 +01:00
Laurențiu Nicola
f5968cfc84
Remove dead assists-related function
2021-12-08 16:55:25 +02:00
Jonas Schievink
c0a30ff21d
Move synstructure hack out of ItemTree lowering
2021-12-08 15:44:52 +01:00
Côme ALLART
dc4e4c7daa
fix: add mod files in path in generated examples
2021-12-07 23:34:53 +01:00
bors[bot]
77f2d34930
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>
2021-12-07 21:57:59 +00:00
Lukas Wirth
ae0c7268f7
internal: completion: split out more PathKinds from ImmediateLocation
2021-12-07 22:49:42 +01:00
Côme ALLART
220137f1cf
fix: disable assist for documented functions
2021-12-07 18:02:18 +01:00
Jonas Schievink
b365b6119c
Treat extern blocks as item containers
2021-12-07 17:31:26 +01:00
bors[bot]
b7afb6fc6c
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>
2021-12-07 15:44:05 +00:00
Jonas Schievink
deb5c1426d
internal: add "Shuffle Crate Graph" command
2021-12-07 16:37:19 +01:00
bors[bot]
bf484d9d99
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>
2021-12-07 14:51:07 +00:00
Lukas Wirth
f781e599cc
Adjust incorrect runnable tests
2021-12-07 15:42:54 +01:00
Lukas Wirth
e09d410dcd
Simplify
2021-12-07 15:06:56 +01:00
Lukas Wirth
b66f181bc0
Fix some TryToNav impls not upmapping ranges out of macros
2021-12-07 15:02:22 +01:00
Laurențiu Nicola
9a624abc84
Bump deps
2021-12-07 13:15:14 +02:00
Côme ALLART
3a82548c5e
fix: reduce assist scope: pub fn's in pub modules
2021-12-06 23:33:24 +01:00
Laurențiu Nicola
3678cbd12e
Bump tracing
2021-12-06 20:54:45 +02:00
Côme ALLART
d55d3b63cb
fix: format assist doc for sourcegen_assists_docs
2021-12-06 19:04:44 +01:00
Côme ALLART
998b91af9c
feat: assist to generate documentation templates
2021-12-06 18:32:25 +01:00
Laurențiu Nicola
f5db6e0e95
Bump parser step limit a little
2021-12-06 11:47:36 +02:00
bors[bot]
7d6fcbc0be
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>
2021-12-05 15:28:28 +00:00
Lukas Wirth
89e1d19ec5
internal: Prefer resolution of inert attributes
2021-12-05 16:28:08 +01:00
bors[bot]
6f84bbfa1e
Merge #10943
...
10943: feat: Enable completions for attributes r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-05 15:14:10 +00:00
Lukas Wirth
1f254dd855
feat: Enable flyimport completions for attributes
2021-12-05 15:57:28 +01:00
Aleksey Kladov
4f3fc6fa1a
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
```
2021-12-05 15:32:39 +03:00
Aleksey Kladov
c603b9043f
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 :-)
2021-12-05 15:32:39 +03:00
Laurențiu Nicola
bff377c712
Clean up some unused cross-crate dependencies
2021-12-05 13:54:49 +02:00
bors[bot]
1cf1359c55
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>
2021-12-05 11:02:55 +00:00
Lukas Wirth
9b4ca77572
fix: Add highlighting hack back for unresolved attributes
2021-12-05 11:59:07 +01:00
bors[bot]
8a084e6aca
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>
2021-12-05 10:52:54 +00:00
Brandon
fa2818551e
Update expected test results
2021-12-04 21:42:13 -08:00
Brandon
0d1910c6fb
Handle multiple cargo check quick fix spans
2021-12-04 21:41:56 -08:00
Brandon
de05c3d406
Refactor away unnecessary Vec
2021-12-04 19:59:05 -08:00
bors[bot]
6434ada19e
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>
2021-12-04 18:08:11 +00:00
Lukas Wirth
b35a50cb10
fix: Fix self keyword not being tagged as such in highlighting properly
2021-12-04 19:07:18 +01:00