bors[bot]
36f302355b
Merge #11516
...
11516: fix: Don't count commas when looking for the derive attribute in diagnostics r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com >
2022-02-21 12:44:10 +00:00
Lukas Wirth
8cdef2ffcf
fix: Don't count commas when looking for the derive attribute in diagnostics
2022-02-21 13:43:42 +01:00
Jeroen Vannevel
9c6542f209
parameters.split_last()
2022-02-21 10:29:38 +00:00
bors[bot]
b0e293bf69
Merge #11424
...
11424: Pass required features to cargo when using run action r=Veykril a=WaffleLapkin
When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its `required-features` to `cargo run`. This allows to run examples that were otherwise impossible to run with RA.
Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com >
2022-02-21 10:21:39 +00:00
Chayim Refael Friedman
f70512cc17
Change single_let() and is_pattern_cond() to free functions
2022-02-21 08:34:36 +02:00
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
Lukas Wirth
035bedc28b
internal: Remove name fields from MacroCallKind
2022-02-21 00:02:10 +01:00
Lukas Wirth
fbe787ee10
internal: Wrap MacroCallKind::Attr attr_args field in an Arc
2022-02-20 22:53:04 +01:00
Felicián Németh
2bcde5953a
Fix a typo in server_capabilities.experimental
2022-02-19 10:58:10 +01: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
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
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!

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
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]
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
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
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