Anatol Ulrich
b251a30819
# This is a combination of 3 commits.
...
# This is the 1st commit message:
add multi-token mappings for hover
# The commit message #2 will be skipped:
# make fallback an Option instead of vec
# The commit message #3 will be skipped:
# fix indentation
2021-09-15 18:04:45 +02:00
Lukas Wirth
95746a99b4
Use correct file syntax node for decl_access computation in find_all_refs
2021-09-12 23:19:23 +02:00
bors[bot]
317059985a
Merge #10202
...
10202: fix: Type param hover shows correct sized bounds. r=flodiebold a=iDawer
Closes #9949
This adds implicit `: Sized` bound to type parameters at lowering step.
Hovering on type parameter does not show it's `: Sized` bound be it set explicitly or implicitly. This is because it doesn't track that the bound was set implicitly.
### Perf
```rust
./target/rust-analyzer-baseline-3dae94bf -q analysis-stats --memory-usage .
Database loaded: 4.51s, 311minstr, 110mb (metadata 1.08s, 22minstr, 743kb; build 3.20s, 8730kinstr, -237kb)
crates: 38, mods: 770, decls: 17173, fns: 12835
Item Collection: 29.63s, 85ginstr, 372mb
exprs: 353460, ??ty: 364 (0%), ?ty: 232 (0%), !ty: 144
Inference: 118.25s, 284ginstr, 601mb
Total: 147.88s, 370ginstr, 973mb
./target/rust-analyzer-hover-ty-param-dfb15292 -q analysis-stats --memory-usage .
Database loaded: 4.53s, 311minstr, 110mb (metadata 1.10s, 22minstr, 743kb; build 3.20s, 8672kinstr, -189kb)
crates: 38, mods: 770, decls: 17173, fns: 12835
Item Collection: 29.59s, 85ginstr, 372mb
exprs: 353460, ??ty: 364 (0%), ?ty: 232 (0%), !ty: 144
Inference: 121.69s, 296ginstr, 601mb
Total: 151.28s, 382ginstr, 974mb
```
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-09-12 07:54:56 +00:00
Dawer
964c7b3211
minor: fix tests.
2021-09-10 23:02:37 +05:00
Dawer
dfb15292c2
fix: Type param hover shows correct sized bounds.
2021-09-10 20:48:39 +05:00
Dawer
9ce3c075ad
internal: add implicit : Sized
bound to type parameters.
2021-09-10 20:41:53 +05:00
bors[bot]
92ce768ea3
Merge #10188
...
10188: fix: add multi-token mapping support to runnables r=jonas-schievink a=lnicola
Closes #10184
changelog fix (first contribution) add multi-token mapping support to runnables
Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
2021-09-09 15:07:43 +00:00
Anatol Ulrich
5d08ac20d9
implement #10070 in runnables
...
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-09-09 18:02:53 +03:00
Dezhi Wu
87436a08fa
fix super
path wrong display
2021-09-07 17:49:46 +08:00
Dezhi Wu
6d2154e409
cargo fmt
2021-09-07 14:50:33 +08:00
Dezhi Wu
82ae228d98
fix: path display error when start with crate
2021-09-07 14:44:30 +08:00
Lukas Wirth
e2ede38d47
Use correct search scopes for macros
2021-09-02 17:30:55 +02:00
Jonas Schievink
bdba35cc93
fix: multi-token mapping aware find references
2021-09-01 19:19:16 +02:00
Lukas Wirth
68bf359363
fix: make goto_implementation
multi-token mapping aware
2021-09-01 14:51:37 +02:00
bors[bot]
25368d2430
Merge #9954
...
9954: feat: Show try operator propogated types on ranged hover r=matklad a=Veykril
Basically this just shows the type of the inner expression of the `?` expression as well as the type of the expression that the `?` returns from:
![Code_wIrCxMqLH9](https://user-images.githubusercontent.com/3757771/130111025-f7ee0742-214a-493b-947a-b4a671e4be92.png )
Unless both of these types are `core::result::Result` in which case we show the error types only.
![Code_Xruw5FCBNI](https://user-images.githubusercontent.com/3757771/130111024-f9caef82-92e4-4070-b3dd-f2ff9e5d87a9.png )
If both types are `core::option::Option` with different type params we do not show this special hover either as it would be pointless(instead fallback to default type hover)
Very much open to changes to the hover text here(I suppose we also want to show the actual type of the `?` expression, that is its output type?).
Fixes #9931
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-01 09:26:10 +00:00
Lukas Wirth
8bbfd45d97
Minor fixes
2021-09-01 11:25:42 +02:00
Aleksey Kladov
6317292cd5
internal: more obviously correct code for cache priming progerss
...
It doesn't make sense for the prime_caches itself send begin/end events
-- the caller knows perfectly fine when they happen!
2021-08-30 19:18:48 +03:00
Dezhi Wu
ba0947dded
switch log
crate to tracing
2021-08-30 15:11:42 +08:00
Aleksey Kladov
78365c64c8
internal: slightly improve compile times
...
As per style guide, avoid monomorphisations
2021-08-29 12:53:56 +03:00
Lukas Wirth
99f1e66997
Only report unique text ranges in highlight_related
2021-08-29 01:11:29 +02:00
Lukas Wirth
72bfbb0691
Return all usages inside macros in usage searches
2021-08-29 00:49:57 +02:00
Lukas Wirth
512135920d
Highlight all related tokens in macro inputs
2021-08-29 00:49:57 +02:00
Lukas Wirth
0f3617f76f
fix: Fix multiple derives in one attribute not expanding all in expand_macro
2021-08-26 03:32:45 +02:00
Lukas Wirth
3f9f63c1bd
Improve expand_macro
2021-08-26 02:36:33 +02:00
Lukas Wirth
d99b81f839
Expand derive macros under cursor in Expand Macro Recursively
2021-08-24 16:33:52 +02:00
bors[bot]
49c02b93b3
Merge #9993
...
9993: feat: join lines merges assignments r=matklad a=unexge
Closes https://github.com/rust-analyzer/rust-analyzer/issues/9967 .
![Peek 2021-08-22 21-46](https://user-images.githubusercontent.com/16212576/130366571-3ebb1753-f8d5-4884-be8f-222cda71a2a7.gif )
Co-authored-by: unexge <unexge@gmail.com>
2021-08-24 12:14:25 +00:00
Lukas Wirth
631bca786f
Highlight declarations and references for both defs in field shorthands
2021-08-24 03:15:41 +02:00
unexge
3a9ba0e506
feat: join lines merges assignments
2021-08-22 21:28:39 +03:00
bors[bot]
996300f4a0
Merge #9989
...
9989: Fix two more “a”/“an” typos (this time the other way) r=lnicola a=steffahn
Follow-up to #9987
you guys are still merging these fast 😅
_this time I thought – for sure – that I’d get this commit into #9987 before it’s merged…_
Co-authored-by: Frank Steffahn <frank.steffahn@stu.uni-kiel.de>
2021-08-22 16:10:48 +00:00
Frank Steffahn
75073451c6
Fix three more (reverse) “a”/“an” typos
2021-08-22 17:48:15 +02:00
Florian Diebold
424dda8113
Refactor & improve handling of overloaded binary operators
...
Fixes #9971 . Also records them as method resolutions, which we could use
later.
2021-08-22 17:35:50 +02:00
Frank Steffahn
ab23af439d
Fix another “a”/“an” typo
2021-08-22 16:45:58 +02:00
Lukas Wirth
2f179adc41
Expand attributes recursively in expand_macro
2021-08-21 23:24:12 +02:00
Lukas Wirth
a0d5290b7f
Show try operator propogated types on ranged hover
2021-08-21 22:21:27 +02:00
Lukas Wirth
557df6ff3f
Use correct HirFileId in find_related_test
2021-08-20 13:50:40 +02:00
Lukas Wirth
7342dcf0b0
Fix runnables not seeing test and bench attributes
2021-08-20 13:50:06 +02:00
bors[bot]
8dd3a71730
Merge #9955
...
9955: fix: Rename fails on renaming definitions created by macros instead of renaming the macro invocation r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-19 22:13:09 +00:00
Lukas Wirth
c67ecbebc4
Rename fails on renaming definitions created by macros
2021-08-20 00:12:47 +02:00
Lukas Wirth
04076bc5fb
Don't trigger related highlighting on unrelated tokens
2021-08-18 15:03:39 +02:00
bors[bot]
8d7eea9e3a
Merge #9929
...
9929: fix: Handle all rename special cases for record pattern fields r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-17 13:25:08 +00:00
Lukas Wirth
daf3094958
Emit more concise text edits in ide_db::rename
2021-08-17 15:24:01 +02:00
Lukas Wirth
995c8f50a2
some code docs for the ide_db/rename module
2021-08-16 23:06:51 +02:00
Lukas Wirth
5e533e5900
Handle all rename special cases for all record pattern fields
2021-08-16 22:48:38 +02:00
Lukas Wirth
40455db088
Highlight function exit points on fn
keyword
2021-08-16 21:25:22 +02:00
Lukas Wirth
0c0142f61a
Simplify
2021-08-16 16:12:20 +02:00
Lukas Wirth
894a09b749
Simplify
2021-08-14 18:02:51 +02:00
Aleksey Kladov
6df00f8495
internal: make naming consistent
2021-08-14 17:01:28 +03:00
bors[bot]
baf1494374
Merge #9807
...
9807: Implicit `Sized` bounds r=iDawer a=iDawer
This should close #8984
`hir_ty`:
- Type parameters, associated types and `impl Trait` are `Sized` by deafault except `Self` in a trait.
- Implicit `Sized` bound is added to end of predicate list. It does not check if such bound is present already. Also it does not track the bound is implicit.
- Allowed ambiguous unsize coercion if Chalk returns definite guidance.
- Allowed ambiguous autoderef if Chalk returns definite guidance.
`hir_def`:
- `ItemTree` pretty printing shows `?Sized` bounds.
`HirDisplay`:
- `impl Trait` with weird bounds rendered correctly.
- `Sized`/`?Sized` bounds are not shown if they are default.
### Perf
`./target/rust-analyzer-baseline_8a843113 -q analysis-stats --memory-usage .`
```
Database loaded: 1.63s, 287minstr, 91mb
crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection: 26.80s, 73ginstr, 338mb
exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 174
Inference: 50.28s, 116ginstr, 516mb
Total: 77.08s, 189ginstr, 855mb
```
`./target/rust-analyzer-sized-fixed_ambig_coercion-de074fe6 -q analysis-stats --memory-usage .`
```
Database loaded: 1.63s, 287minstr, 91mb
crates: 38, mods: 741, decls: 15914, fns: 11835
Item Collection: 26.95s, 73ginstr, 338mb
exprs: 318994, ??ty: 398 (0%), ?ty: 435 (0%), !ty: 166
Inference: 96.39s, 234ginstr, 543mb
Total: 123.33s, 307ginstr, 881mb
```
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-08-12 17:55:29 +00:00
Lukas Wirth
ec443886ea
Show type actions on ranged type hover
2021-08-11 13:52:57 +02:00
Yoshua Wuyts
4b5139e8a5
impl gen hash for structs
2021-08-10 12:37:10 +02:00