rust/crates
bors[bot] 34138379b5
Merge #11322
11322: Extract function also extracts comments r=Vannevelj a=Vannevelj

Fixes #9011

The difficulty I came across is that the original assist works from the concept of a `ast::StmtList`, a node, but that does not allow me to (easily) represent comments, which are tokens. To combat this, I do a whole bunch of roundtrips: from the `ast::StmtList` I retrieve the `NodeOrToken`s it encompasses. 

I then cast all `Node` ones back to a `Stmt` so I can apply indentation to it, after which it is again parsed as a `NodeOrToken`.

Lastly, I add a new `make::` api that accepts `NodeOrToken` rather than `StmtList` so we can write the comment tokens.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2022-02-01 23:05:28 +00:00
..
base_db feat: Honor recursion limit configuration 2022-01-28 11:31:59 +03:00
cfg Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
flycheck Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
hir fix: Complete functions and methods from block level impls 2022-02-01 23:29:40 +01:00
hir_def Fix cfg_attr invalidating derive identifier IDE functionality 2022-01-30 22:47:16 +01:00
hir_expand Make more precise range macro upmapping 2022-01-31 15:53:44 +01:00
hir_ty fix: Complete functions and methods from block level impls 2022-02-01 23:29:40 +01:00
ide fix: Fix proc-macro server not using the supplied span in Ident::new 2022-01-31 17:02:57 +01:00
ide_assists Merge #11322 2022-02-01 23:05:28 +00:00
ide_completion fix: Complete functions and methods from block level impls 2022-02-01 23:29:40 +01:00
ide_db fix: Complete functions and methods from block level impls 2022-02-01 23:29:40 +01:00
ide_diagnostics More correct $crate handling in eager macros 2022-01-27 16:57:53 +01:00
ide_ssr fix: Complete functions and methods from block level impls 2022-02-01 23:29:40 +01:00
limit Use compare_exchange_weak in limit::Limit::check 2022-01-28 18:19:35 +03:00
mbe Make syntax bridge fully infallible 2022-01-24 17:27:39 +01:00
parser Allow macros to expand to or-patterns 2022-01-17 16:52:53 +01:00
paths Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
proc_macro_api Set current working directory for procedural macros 2022-01-27 16:18:12 +03:00
proc_macro_srv fix: Fix proc-macro server not using the supplied span in Ident::new 2022-01-31 17:02:57 +01:00
proc_macro_test Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
profile Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
project_model minor: Add some debug traces for cfg fetching 2022-02-01 13:35:34 +01:00
rust-analyzer Merge #11182 2022-01-31 11:16:22 +00:00
sourcegen Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
stdx Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
syntax Merge #11322 2022-02-01 23:05:28 +00:00
test_utils fix: Do not complete Drop::drop, complete std::mem::drop instead 2021-12-22 02:25:38 +01:00
text_edit Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
toolchain Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
tt Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
vfs Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
vfs-notify Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00