Lukas Wirth
ba3e3282da
Deduplicate inserted parentheses in binding mode hints
2022-12-16 21:17:10 +01:00
Lukas Wirth
b6c2bb21ab
Add parentheses for binding mode hints when they attach to an Or-pattern
2022-12-16 20:52:31 +01:00
bors
14492043db
Auto merge of #13749 - WaffleLapkin:remove_some_redudant_adjustment_hints, r=Veykril
...
fix: Don't show duplicated adjustment hints for blocks, ifs and matches
Before:
![2022-12-09_21-10](https://user-images.githubusercontent.com/38225716/206761100-5511d91b-2543-4166-aa2c-abdb8bad3613.png )
After:
![2022-12-09_21-22](https://user-images.githubusercontent.com/38225716/206761113-c58dbb5a-8616-4287-a3b4-69c13703294d.png )
----
I want to improve adjustment hints, this is the first step :)
2022-12-09 19:36:05 +00:00
Maybe Waffle
7c9a85bc43
fix: Don't show duplicated adjustment hints for blocks, ifs and matches
2022-12-09 18:45:01 +00:00
Lukas Wirth
e80674e6b3
Show type info on hover of enum variant fields
2022-12-09 10:09:55 +01:00
hkalbasi
05906da0ec
use rustc crates instead of copy paste
2022-12-07 01:59:38 +03:30
hkalbasi
86b5b609f1
Compute data layout of types
2022-12-04 00:29:34 +03:30
Allan Brondum Rasmussen
30736b54c9
fmt
2022-12-03 01:20:27 +01:00
Allan Brondum Rasmussen
cc4f9db086
remove unneeded test
2022-12-03 00:53:56 +01:00
Allan Brondum Rasmussen
bce3b63700
check reference is a NameRef (and not Name)
2022-12-02 23:50:39 +01:00
Jonas Schievink
b65b02fd97
Fix signature help not showing up when cursor is between ))
or >>
2022-11-29 18:50:21 +01:00
bors
99daf23e11
Auto merge of #13671 - Veykril:goto-decl, r=Veykril
...
Improve goto declaration
Closes https://github.com/rust-lang/rust-analyzer/issues/13599
- goto decl now goes to assoc items of trait declarations over the items of trait implementations
- goto decl now goes to the field declaration (opposed to goto def which shows both the field decl and binding created/local being used)
- also adds back the goto definition fallback that seems to have been dropped at some point.
2022-11-25 09:28:39 +00:00
Lukas Wirth
ae0bdffcc9
Go to declaration goes to field declaration in pattern and expression shorthands
2022-11-25 10:27:54 +01:00
Lukas Wirth
3c794a34da
Go to declaration goes to assoc items of trait declarations
2022-11-25 10:27:49 +01:00
Kartavya Vashishtha
a26aef9055
fix formatting
2022-11-25 12:22:06 +05:30
Kartavya Vashishtha
91e7624de0
add hover tests
2022-11-25 12:20:38 +05:30
Kartavya Vashishtha
e86d451484
fix token method call
2022-11-25 12:20:34 +05:30
Kartavya Vashishtha
132d5ffc7d
add back [] in hover documentation
2022-11-25 12:04:14 +05:30
Kartavya Vashishtha
f64feeb11a
Correct node traversal to look at parent instead
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-11-24 22:32:15 -08:00
Kartavya Vashishtha
29951f9766
fix formatting
2022-11-19 21:23:33 +05:30
Kartavya Vashishtha
87658c8173
refactor hover
...
change struct_rest_pat to guarentee a HoverResult
Move token and node matching out of struct_rest_pat into hover
2022-11-19 21:22:10 +05:30
Kartavya Vashishtha
8b17681058
fix formatting
...
and remove unnecessary check
2022-11-19 11:34:49 +05:30
Kartavya Vashishtha
a778203db9
simplify ancestor climbing to not consider macros
2022-11-19 11:17:43 +05:30
Kartavya Vashishtha
0ffb361eb9
feat: adds hover hint to ".." in record pattern
...
currently only works with struct pattern
2022-11-19 11:10:47 +05:30
bors
add85397ae
Auto merge of #13604 - Veykril:hover-attr, r=Veykril
...
fix: Fix hover in attributed items not preferring similar kinded tokens
2022-11-11 12:48:48 +00:00
Lukas Wirth
e50712cf2c
fix: Fix hover in attributed items not preferring similar kinded tokens
2022-11-11 13:38:07 +01:00
Ryo Yoshida
19306c070d
Fix tests that depended on loose visibility restriction
2022-11-11 20:31:46 +09:00
Jonas Schievink
9be0615bde
Don't canonicalize self type when querying FnOnce signature
2022-11-08 18:05:07 +01:00
bors
0aa0da9dda
Auto merge of #13572 - Veykril:cancellable, r=Veykril
...
internal: Use Cancellable in favor of Result for clarity
2022-11-07 16:22:33 +00:00
Lukas Wirth
fa70b0a86e
internal: Use Cancellable in favor of Result for clarity
2022-11-07 17:21:37 +01:00
bors
a27e4dad37
Auto merge of #13571 - Veykril:unique-references, r=Veykril
...
minor: Deduplicate reference search results
Fixes https://github.com/rust-lang/rust-analyzer/issues/13407
2022-11-07 15:49:54 +00:00
Lukas Wirth
6a06f6f724
Deduplicate reference search results
2022-11-07 16:48:50 +01:00
bors
8a633fe986
Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
...
minor: Remove code duplication
2022-11-07 14:52:05 +00:00
Lukas Wirth
b169e1e5de
Remove code duplication
2022-11-07 15:49:26 +01:00
bors
b0e56ef5e8
Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril
...
Generalize reborrow hints as adjustment hints
Like reborrow hints, these are still mainly useful for teaching/learning
![image](https://user-images.githubusercontent.com/3757771/200073606-b5cd3b95-a9ad-454d-a3c4-d4d89bf45928.png )
2022-11-07 14:38:59 +00:00
Lukas Wirth
ffd7bf8bf9
Bump Cargo rust-version fields to latest stable
2022-11-07 12:59:51 +01:00
Lukas Wirth
ee2dd934ca
Don't trigger adjustment hints in all inlay hint tests
2022-11-07 12:49:52 +01:00
Lukas Wirth
17619de711
fix: Fix reference searching only accounting substrings instead of whole identifiers
2022-11-05 13:00:02 +01:00
Lukas Wirth
d841ad116a
Fix up adjustment hints configurations
2022-11-04 22:59:07 +01:00
Lukas Wirth
95d20fccd7
Add adjustment hint tests
2022-11-04 22:40:06 +01:00
Lukas Wirth
c98fc537e6
Generalize reborrow hints as adjustment hints
2022-11-04 21:53:23 +01:00
bors
bbcb77ea6f
Auto merge of #13456 - emilio:scip-local-symbol, r=Veykril
...
scip: Generate symbols for local crates.
Consider something like:
```
// a.rs
pub struct Foo { .. } // Foo is "local 1"
fn something() {
crate:🅱️ :Bar::new() // Bar is "local 1", but of "b.rs"
}
// b.rs
pub struct Bar { .. } // "local 1"
```
Without this there's no way to disambiguate whether "local 1" references "Bar" or "Foo".
2022-11-03 13:58:36 +00:00
Jonas Schievink
ecad1a9a6e
Create Callable
s for generic types implementing FnOnce
2022-11-01 16:38:19 +01:00
Ryo Yoshida
67f1d8fe2c
Test all generic args for trait when finding matching impl
2022-10-25 23:28:40 +09:00
Emilio Cobos Álvarez
8039a07a5e
ide: Generate monikers for local crates.
2022-10-22 19:33:47 +02:00
Emilio Cobos Álvarez
bd49d01906
ide: Remove unnecessary continue.
2022-10-22 15:15:10 +02:00
Lukas Wirth
de195ff97c
fix: Fix DidSaveDocument requests blocking the server on startup
2022-10-20 19:55:04 +02:00
Lukas Wirth
8047512dca
Revert "feat: Diagnose some incorrect usages of the question mark operator"
2022-10-18 14:18:59 +02:00
Lukas Wirth
a762baca02
fix: Fix formatting requests hanging when r-a is still starting
...
The reason for that was that we were calculating the crate defmaps
of the file we are saving by accident causing us to get stuck waiting
on their expensive computation, while we only need the relevant crate
id.
2022-10-17 18:21:18 +02:00
Lukas Wirth
381366f1dd
Diagnose incorrect usages of the question mark operator
2022-10-16 12:58:24 +02:00