Lukas Wirth
e2f1a9a558
feat: Attempt to format expand_macro output with rustfmt if possible
2022-04-17 13:33:39 +02:00
bors
a912f2a9f6
Auto merge of #12001 - Veykril:refs, r=Veykril
...
fix: Do reference search on all downmapped tokens with the same kind only
cc https://github.com/rust-lang/rust-analyzer/issues/11668
2022-04-15 17:43:24 +00:00
Lukas Wirth
58660dee2a
fix: Do reference search on all downmapped tokens with the same kind only
2022-04-15 19:42:48 +02:00
bors
5e41205e9c
Auto merge of #12000 - Veykril:hlmac, r=Veykril
...
fix: Tag `macro_rules` macro bang with `MacroBang` tag
cc https://github.com/rust-lang/rust-analyzer/issues/11996
2022-04-15 17:19:33 +00:00
Lukas Wirth
be27efabfa
fix: Tag macro_rules
macro bang with MacroBang
tag
2022-04-15 19:16:18 +02:00
Jonas Schievink
f96fd40104
add docs
2022-04-14 13:23:19 +02:00
Jonas Schievink
99e9e52fbc
Remove trailing ;
when turning assignment into ==
comparison
2022-04-13 16:01:09 +02:00
Jonas Schievink
b9dd7db817
Add more no-op tests
2022-04-13 15:47:33 +02:00
Jonas Schievink
cde2a1de36
Add trailing ;
when typing =
in assignment
2022-04-12 19:39:19 +02:00
bors[bot]
49847a25ae
Merge #11883
...
11883: fix(ide): move moudle directory when rename r=rainy-me a=rainy-me
fix : #10992
Added `FileSystemEdit::MoveDir` variant for move dirs. Original implemented as recursively move child mod files but had many issues like
1. left empty dir after rename file
2. only affect rust file
3. not performant
so changed to current version
Co-authored-by: rainy-me <github@yue.coffee>
2022-04-12 15:17:00 +00:00
rainy-me
3dd581b97d
fix: move dir on rename mod
2022-04-12 23:01:53 +09:00
Lukas Wirth
7f3572fa0d
Simplify
2022-04-10 20:02:06 +02:00
Lukas Wirth
15e7112da3
fix: Check whether a parameter can be converted to a local
2022-04-09 00:55:45 +02:00
Jonas Schievink
5d8b4c40eb
Determine function unsafety semantically
2022-04-07 18:33:03 +02:00
Lukas Wirth
3632d5946f
minor: Remove pointless rebindings
2022-04-07 01:29:31 +02:00
Lukas Wirth
96b641e95e
internal: Add more doc-link tests
2022-04-06 20:58:46 +02:00
Lukas Wirth
4a1423337f
fix: Attempt to resolve paths in const arguments heuristically
...
While we don't support const args in type inference yet, we can at least
make use of the fallback path resolution to resolve paths in const args
in the IDE layer to enable some features for them.
2022-04-06 20:24:24 +02:00
Lukas Wirth
7959c24876
fix: Fix path qualifiers not resolving generic type params when shadowed by trait
2022-04-06 19:38:45 +02:00
Jonas Schievink
872b7b9660
Wrap macros in expr position in MacroExpr
node
2022-04-05 17:43:34 +02:00
Lukas Wirth
f610e2c2ed
Simplify completion import insertion
2022-04-02 01:42:21 +02:00
bors[bot]
ce8e028e9b
Merge #11872
...
11872: internal: Remove `PathResolution::AssocItem` r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-01 17:12:44 +00:00
Lukas Wirth
c290e68ff9
internal: Remove PathResolution::AssocItem
2022-04-01 18:32:05 +02:00
bors[bot]
50225fe630
Merge #11869
...
11869: fix: code blocks with tilde also works like code block r=Veykril a=moreal
The `rustdoc` uses the `pulldown_cmark` package to parse *doc_comment* and the package also treat triple `~` characters also as code block fences. So when we run `cargo doc`, they will be placed also.
<img width="965" alt="image" src="https://user-images.githubusercontent.com/26626194/161208072-5a09a209-57fc-4a52-b190-b0a9be9ffcd6.png ">
But `rust-analyzer` doesn't support it so it doesn't have any injected code highlights and any `Run doctest` hint. This pull request tries to allow also them. 🙇🏻♂️
Before:
<img width="224" alt="image" src="https://user-images.githubusercontent.com/26626194/161207405-b1d6cfda-82b1-4f60-8e42-c51d0ed98f38.png ">
After:
<img width="161" alt="image" src="https://user-images.githubusercontent.com/26626194/161207693-8e39997c-9ca6-4e69-8c65-e9b70899f7db.png ">
Co-authored-by: Lee Dogeon <dev.moreal@gmail.com>
2022-04-01 12:40:51 +00:00
Lee Dogeon
e3f32d13e1
Code blocks with tilde also works like code block
2022-04-01 20:29:32 +09:00
Lukas Wirth
75689f2ad8
internal: Enforce Resolver to always have a module scope
2022-03-31 11:12:08 +02:00
Lukas Wirth
ef92453dfe
internal: Refactor FamousDefs builtin crate search
2022-03-30 22:23:54 +02:00
Lukas Wirth
0ae795136d
Sort runnable test results to make them deterministic
2022-03-26 19:38:20 +01:00
hkalbasi
22eaee25b8
organize const eval tests
2022-03-24 13:20:35 +04:30
hkalbasi
0e2989e421
Support constants in const eval
2022-03-24 13:09:22 +04:30
bors[bot]
75fada4aab
Merge #11805
...
11805: fix: Don't try to resolve methods on unknown types r=Veykril a=flodiebold
Fixes #10454 , and some type mismatches.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-23 20:20:09 +00:00
Florian Diebold
fa923f9b19
Adjust value in syntax highlighting benchmark
2022-03-23 19:28:01 +01:00
bors[bot]
652233283b
Merge #11791
...
11791: fix: some fixes and improvements to signature help r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-23 00:36:11 +00:00
Lukas Wirth
8e91bb7660
minor: Bump dependencies
2022-03-22 17:42:24 +01:00
Jonas Schievink
4e07864f59
signature help: skip lifetimes when non-lifetime arguments are present
2022-03-22 16:44:27 +01:00
Jonas Schievink
4bb5df0ce5
Avoid signature help inside multiline expressions
...
Fixes #11768
2022-03-22 16:08:46 +01:00
Jonas Schievink
c9cefb9916
Improve readability of signature help tests
2022-03-22 15:03:19 +01:00
Laurențiu Nicola
1a37b17162
Replace write! with direct calls
2022-03-21 10:43:36 +02:00
bors[bot]
6f2b118605
Merge #11775
...
11775: internal: Treat `global_asm` and `asm` macros as unsafe r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:31:27 +00:00
Lukas Wirth
ddf144051a
internal: Treat {global_}asm macros as unsafe
2022-03-20 19:31:00 +01:00
bors[bot]
fedf724d82
Merge #11774
...
11774: feat: Tag macro calls as unsafe if they expand to unsafe expressions r=Veykril a=Veykril
as long as they aren't inside an unsafe block inside the macro that is.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:15:29 +00:00
Lukas Wirth
68de7b30e0
feat: Tag macro calls as unsafe if they expand to unsafe expressions
2022-03-20 19:07:44 +01:00
bors[bot]
966b692422
Merge #11771
...
11771: feat: Visualize compiler inserted reborrows via inlay hints r=Veykril a=Veykril
Disabled by default.
![image](https://user-images.githubusercontent.com/3757771/159165178-baaf968a-4381-468e-933f-5326ca1b203d.png )
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11275
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 13:47:16 +00:00
Lukas Wirth
5a87f09a71
Update inlay hint feature docs
2022-03-20 14:41:27 +01:00
Lukas Wirth
37b48ceb8f
feat: Visualize compiler inserted reborrows via inlay hints
2022-03-20 14:38:16 +01:00
bors[bot]
a82caff588
Merge #11765
...
11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:26:34 +00:00
Lukas Wirth
2598575a35
fix: Fix closure hints using macro ranges
2022-03-19 20:24:09 +01:00
bors[bot]
7315d97347
Merge #11755
...
11755: feat: Implement lifetime elision hints r=Veykril a=Veykril
With names on:
![Code_erl26zKvuf](https://user-images.githubusercontent.com/3757771/159134856-e2c75d2d-f17c-45c7-9a78-3da5ee8b1acd.png )
With names off:
![Code_MRP1Pbfe9d](https://user-images.githubusercontent.com/3757771/159134857-30fac3a1-825e-4f49-ba9b-9fa0bb215694.png )
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:15:06 +00:00
Lukas Wirth
7da5b80f25
Change skip trivial behaviour
2022-03-19 20:12:14 +01:00
Lukas Wirth
7ab0aaa82a
Add option to skip trivial cases
2022-03-19 19:01:19 +01:00
Lukas Wirth
45756c823f
Use numbers for lifetimes by default, add setting to prefer using parameter names
2022-03-19 18:11:56 +01:00