Commit Graph

21423 Commits

Author SHA1 Message Date
Chayim Refael Friedman
fe1e324694 Type-inference for let expressions 2022-02-21 08:34:35 +02:00
Chayim Refael Friedman
6bf6f4ff1d Lower let expressions 2022-02-21 08:34:34 +02:00
Chayim Refael Friedman
de8633f15f Parse let expressions in order to support let chains
We still need to reject freestanding `let` expressions: see https://github.com/rust-analyzer/rust-analyzer/issues/11320#issuecomment-1018212465.
2022-02-21 08:34:34 +02:00
Heyward Fann
1988ea2b48
chore(manual): update coc-rust-analyzer manual
Semantic tokens highlighting is added now
2022-02-21 11:04:39 +08:00
bors[bot]
d6ed146a1c
Merge #11512
11512: internal: Remove `name` fields from `MacroCallKind` r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-20 23:16:59 +00:00
Lukas Wirth
035bedc28b internal: Remove name fields from MacroCallKind 2022-02-21 00:02:10 +01:00
bors[bot]
e534702e3a
Merge #11511
11511: internal: Wrap MacroCallKind::Attr attr_args field in an Arc r=Veykril a=Veykril

This is stored in `MacroCallLoc` which is returned from a query, so cloning should be made cheap.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-20 21:54:12 +00:00
Lukas Wirth
fbe787ee10 internal: Wrap MacroCallKind::Attr attr_args field in an Arc 2022-02-20 22:53:04 +01:00
bors[bot]
1d53f695f0
Merge #11504
11504: Fix a typo in server_capabilities.experimental r=lnicola a=nemethf

Commit 27c4be6b4f wasn't really complex, but I still managed to make a mistake there, which this PR fixes.  Sorry.

Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2022-02-19 10:09:22 +00:00
Felicián Németh
2bcde5953a Fix a typo in server_capabilities.experimental 2022-02-19 10:58:10 +01:00
bors[bot]
acf5874b39
Merge #11498
11498: minor: Update issue template r=lnicola a=lnicola

 - remove fixed #11098
 - ask about settings and environment variables

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-02-18 17:32:36 +00:00
Laurențiu Nicola
e8d490e7ef Update issue template 2022-02-18 19:30:15 +02:00
Jeroen Vannevel
d1fc208c9c
re-added FIXME 2022-02-18 09:12:52 +00:00
KarlWithK
5f3327a6b8
Correctly fix formatting doc tests with generics
Before the doc_test would be outputted like this:
"Foo<T, U>::t"
However, this would cause shells with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under escape
chanters as so:
"\"Foo<T, U>::t\""

Note:
At the cost of adding this, I had to allocate a new string via
format!{}. However, I argue this is alright as this for just for
outputting the name of the doc test.

The following tests have been changed:
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
2022-02-17 20:27:37 -06:00
bors[bot]
89faff7477
Merge #11484
11484: Infer the array size for slice patterns r=flodiebold a=ChayimFriedman2

Fixes #11478 (feat or fix?),

I don't know much about the type-checking in RA, so maybe I did some obvious mistake.

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2022-02-16 15:13:54 +00:00
Chayim Refael Friedman
4b2985a23e Infer the array size for slice patterns 2022-02-16 12:19:26 +00:00
Jeroen Vannevel
794105c18b
removed double map 2022-02-15 19:37:24 +00:00
Jeroen Vannevel
f083c86890
simplified write 2022-02-15 19:27:56 +00:00
Jeroen Vannevel
842ffde43d
test names 2022-02-15 19:22:36 +00:00
Jeroen Vannevel
d985394ce2
add test for function pointer without identifier 2022-02-15 19:20:50 +00:00
Jeroen Vannevel
c8cd7a68b3
use Name instead of String 2022-02-15 19:12:23 +00:00
Jeroen Vannevel
e1df78820e
removed unwrap 2022-02-15 14:58:06 +00:00
Jeroen Vannevel
0a80cc82b1
cleaning 2022-02-15 14:55:21 +00:00
Jeroen Vannevel
3bba811e92
fmt 2022-02-15 14:47:51 +00:00
Jeroen Vannevel
c450d0ce41
cleanup 2022-02-15 14:47:23 +00:00
Jeroen Vannevel
73e49493bd
rough, but appears to work 2022-02-15 14:39:22 +00:00
bors[bot]
f0210f8a43
Merge #11475
11475: Impr mbe: remove unecessary temporary vec r=bellau a=bellau

It's a micro optimization. I don't know if it's really necessary (less alloc is always better).

Co-authored-by: bellau <laurent.belmonte@gmail.com>
2022-02-15 09:36:22 +00:00
bors[bot]
e5b6020e55
Merge #11480
11480: fix: keyword hover works on non-keyword tokens if expanded to keyword r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-15 09:29:28 +00:00
bellau
ff4024eebd Impr mbe: remove unecessary temporary vec 2022-02-15 10:21:14 +01:00
Lukas Wirth
95db3c1476 fix: keyword hover works on non-keyword tokens if expanded to keyword 2022-02-15 10:09:19 +01:00
bors[bot]
9bc2ee34b0
Merge #11477
11477: fix: Fix cases where `Merge Imports` would drop imports. r=DropDemBits a=DropDemBits

Fixes #11466 

Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
2022-02-15 01:50:25 +00:00
DropDemBits
a1a23d343a
Apply review fixes 2022-02-14 20:41:01 -05:00
DropDemBits
86c1251afb
fix: Don't drop glob with nested self 2022-02-14 19:45:31 -05:00
DropDemBits
df2eb3c7cb
fix: Don't drop tree when the other has self 2022-02-14 19:37:01 -05:00
bors[bot]
aafa40cebd
Merge #11369
11369: feat: Add type hint for keyword expression hovers r=Veykril a=danii

Adds the return type of keywords to tool-tips where it makes sense. This applies to: `if`, `else`, `match`, `loop`, `unsafe` and `await`. Thanks to `@Veykril` for sharing the idea of putting return type highlighting on other keywords!
![image](https://user-images.githubusercontent.com/39541871/151611737-12325c23-a1f9-4fca-ae48-279b374bdcdf.png)

Closes #11359

Co-authored-by: Daniel Conley <himself@danii.dev>
2022-02-14 21:07:41 +00:00
Daniel Conley
768804f11d
Hide Keyword Expression Hover For Units ()
Cleaned up the code for keyword expression hovers.

Added a check to hide units `()` in keyword expression hovers.
2022-02-14 15:26:40 -05:00
bors[bot]
014d3ef1a4
Merge #11458
11458: Fix  Immovable generator syntax (static ||) not recognized #11448 r=Veykril a=bellau



Co-authored-by: bellau <laurent.belmonte@gmail.com>
2022-02-14 17:35:12 +00:00
bors[bot]
0247e50676
Merge #11470
11470: correct the description of Struct GlobalState r=lnicola a=doki23

Fixes #11469

The description of GlobalState should be 'more than one impl'

Co-authored-by: doki <11144133+doki23@users.noreply.github.com>
2022-02-14 12:05:21 +00:00
doki
94b6038657
correct the description of Struct GlobalState 2022-02-14 19:30:21 +08:00
bellau
06452cd102 Fix style 2022-02-14 07:41:50 +01:00
bors[bot]
02904e99ac
Merge #11464
11464: minor: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-02-13 16:15:37 +00:00
Laurențiu Nicola
60c698bbcf Bump deps 2022-02-13 18:14:49 +02:00
bors[bot]
59c49a9c81
Merge #11442 #11460
11442: fix(rename): Use text range of a mod name after macro expansion r=Veykril a=tysg

Fixes #11417. 

11460: fix: documentation of SsrParams r=Veykril a=nemethf

Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'.  Copy its description from lsp_ext.rs.

Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2022-02-13 12:43:16 +00:00
bors[bot]
e1acbd08ca
Merge #11459
11459: fix: add missing experimental capabilities r=Veykril a=nemethf

Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems.  Also, sort entries
alphabetically.

Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2022-02-13 12:35:11 +00:00
Tianyi Song
aa8c982c3a Address PR comments 2022-02-13 18:14:39 +08:00
bellau
dc68b89469 oops, remove println 2022-02-13 09:11:35 +01:00
bellau
0a18a050b5 fix handle static async and static async move 2022-02-13 09:09:44 +01:00
Jonas Goronczy
c203cd4cb7 Extract struct from enum variant filters generics
Extracting a struct from an enum variant now filters out only the
generic parameters necessary for the new struct.
Bounds will be copied to the new struct, but unneeded ones are not
filtered out.
Extracting bounds in a where clause are still not implemented.
2022-02-12 23:21:41 +01:00
bellau
3ed19d54db Fix style 2022-02-12 17:31:17 +01:00
bellau
2008607946 support static move too 2022-02-12 16:07:58 +01:00