Commit Graph

20960 Commits

Author SHA1 Message Date
Chayim Refael Friedman
9881614db1 Upgrade ungrammar to 1.15.0 2022-02-21 08:34:36 +02:00
Chayim Refael Friedman
821b791b6d Validate let expressions
Emit an error if they're found in an invalid position.
2022-02-21 08:34:35 +02:00
Chayim Refael Friedman
a1b7169b48 Update tests
Unfortunately, we lost some recovery for expressions.
2022-02-21 08:34:35 +02:00
Chayim Refael Friedman
13ac5c3491 Fix various IDE features
As a side benefit, we got `let` guard support for `move_guard` for free.
2022-02-21 08:34:35 +02:00
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
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
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
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
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
Felicián Németh
7c7d6991dd fix: documentation of SsrParams
Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'.  Copy its description from lsp_ext.rs.
2022-02-12 15:47:54 +01:00
Felicián Németh
27c4be6b4f fix: add missing experimental capabilities
Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems.  Also, sort entries
alphabetically.
2022-02-12 15:37:13 +01:00
bellau
1284bc0af3 Fix styles 2022-02-12 15:35:06 +01:00
bellau
ccab6afabc Fix Immovable generator syntax (static ||) not recognized #11448 2022-02-12 15:17:10 +01:00
bors[bot]
7a17fb9c43
Merge #11444
11444: feat: Fix up syntax errors in attribute macro inputs to make completion work more often r=flodiebold a=flodiebold

This implements the "fix up syntax nodes" workaround mentioned in #11014. It isn't much more than a proof of concept; I have only implemented a few cases, but it already helps quite a bit.

Some notes:
 - I'm not super happy about how much the fixup procedure needs to interact with the syntax node -> token tree conversion code (e.g. needing to share the token map). This could maybe be simplified with some refactoring of that code.
 - It would maybe be nice to have the fixup procedure reuse or share information with the parser, though I'm not really sure how much that would actually help.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-02-12 12:48:46 +00:00
bors[bot]
4449a336f6
Merge #11453
11453: internal: Make `ascend_call_token` iterative instead of recursive r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-11 21:21:57 +00:00
Lukas Wirth
1c77f36311 internal: Make ascend_call_token iterative instead of recursive 2022-02-11 22:21:35 +01:00
Tianyi Song
e62e926a8a Use text range of name after macro expansion 2022-02-11 14:17:12 +08:00
Florian Diebold
ccb789b94a Format again 2022-02-09 17:52:15 +01:00
Florian Diebold
577f70cc9c Reduce visibility 2022-02-09 17:43:37 +01:00