rust/crates
bors c2eebd7a50 Auto merge of #12877 - zachs18:inline-def-in-macro, r=zachs18
fix: Insert spaces when inlining a function defined in a macro.

(partially) fixes #12860.

This PR (only) addresses the whitespace issue when inlining functions defined in macros.

Additionally, the indentation/spacing is not ideal, but works, e.g.
```rs
macro_rules! define_function {
    () => { fn test_function_macro() {
        if let Some(3) = 3i32.checked_add(0) {
            println!("3 + 0 == 3");
        }
    } };
}
define_function!();
fn main() {
    test_function_macro();
}
// previously became
// ...
fn main() {
    ifletSome(3)=3i32.checked_add(0){println!("3 + 0 == 3");};
}
// now becomes
// ...
fn main() {
    if let Some(3) = 3i32.checked_add(0){
        println!("3 + 0 == 3");

      };
}
```

The `self` -> `this` problem[^this] is (probably?) a separate problem that I am also looking into.

[^this]: As mentioned in [my comment on the above issue](https://github.com/rust-lang/rust-analyzer/issues/12860#issuecomment-1193231766), inlining a method defined in a macro does not properly replace `self` with the new local `this`.
2022-07-26 16:14:51 +00:00
..
base-db Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
cfg Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
flycheck Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
hir Allow name querying for derive helpers 2022-07-26 09:27:22 +02:00
hir-def Allow name querying for derive helpers 2022-07-26 09:27:22 +02:00
hir-expand Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
hir-ty fix: consider assignee expressions in record fields exhaustiveness check 2022-07-24 22:40:04 +09:00
ide Allow name querying for derive helpers 2022-07-26 09:27:22 +02:00
ide-assists Remove FIXME comment for unreachable fallback. 2022-07-26 10:59:19 -05:00
ide-completion Record derive helper attributes, resolve them in IDE layer 2022-07-26 09:26:51 +02:00
ide-db Allow name querying for derive helpers 2022-07-26 09:27:22 +02:00
ide-diagnostics Merge remote-tracking branch 'origin/master' into sync-from-rust-2 2022-07-25 14:07:07 +02:00
ide-ssr Run cargo fmt 2022-07-20 15:06:15 +02:00
limit Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
mbe Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
parser Run cargo fmt 2022-07-20 15:06:15 +02:00
paths Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
proc-macro-api Gate and rename binary, use it if it's in the sysroot 2022-07-25 16:22:39 +02:00
proc-macro-srv Add comment about replacing crossbeam with std scoped threads when they land 2022-07-22 14:23:36 +02:00
proc-macro-srv-cli Gate and rename binary, use it if it's in the sysroot 2022-07-25 16:22:39 +02:00
proc-macro-test revert nightly rustfmt formatting that accidentally slipped in 2022-07-25 14:18:30 +02:00
profile Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
project-model Allow specifying sysroot OR sysroot_src 2022-07-25 17:52:38 +02:00
rust-analyzer fix: Fix server panicking on project loading when proc-macros are disabled 2022-07-26 16:30:45 +02:00
sourcegen Disable all source-gen tests at compile time 2022-07-24 10:38:28 +02:00
stdx Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
syntax Fix .gitattributes for test_data 2022-07-24 14:05:35 +02:00
test-utils Don't run slow tests in Rust CI, only RA CI 2022-07-24 10:38:19 +02:00
text-edit Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
toolchain Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
tt Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
vfs Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
vfs-notify Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00