rust-analyzer/editors/code/src
bors 8011029d3a Auto merge of #13975 - DropDemBits:on-enter-after-dot-chains, r=DropDemBits
fix: Suppress extra indent after the end of field and function chains

(spurred on by <https://github.com/rust-lang/rust-analyzer/issues/4182#issuecomment-671275652>)

Caveat that this doesn't work for after tail expressions, although there shouldn't be anything after those anyways.

This also complicates when to reload the language configuration by nature of now always having a language configuration applicable.

Examples of indentation fixes:

```rs
fn main() {
    println!("Hello!"); // < enter here!
    // ... indents down here

    fs::read_to_string("soup") // < enter here!
    // ... still indents down here :(
        .map(|_| ())
        .map(|_| ()) // < enter here!
        // ... still indents down here :D
        .map_err(|_| ())
        .unwrap(); // < enter here!
    // ... indents down here :D

    // ... and subsequent enters stay at the same indent

    0.0f64
        .to_radians()
        .to_radians()
        .to_radians() // force semi on a new line
        ; // < enter here!
    // ... indents down here :D
}

fn tail_end() -> i32 {
    0i32.wrapping_abs()
        .wrapping_abs()
        .wrapping_abs()
        .wrapping_abs() // < enter here!
        // ... still indents here 🤷
}
```
2023-02-10 20:10:54 +00:00
..
ast_inspector.ts Make more things private 2022-10-17 15:05:20 +02:00
bootstrap.ts Substitute VSCode variables more generally 2023-01-24 13:46:56 +01:00
client.ts 🧹 lsp_ext.ts 2023-01-23 16:58:35 +01:00
commands.ts 🧹 lsp_ext.ts 2023-01-23 16:58:35 +01:00
config.ts Auto merge of #13975 - DropDemBits:on-enter-after-dot-chains, r=DropDemBits 2023-02-10 20:10:54 +00:00
ctx.ts Lazily create the trace output channel 2023-01-31 15:43:47 +01:00
debug.ts Substitute VSCode variables more generally 2023-01-24 13:46:56 +01:00
diagnostics.ts Parse + decorate rendered ANSI cargo output 2023-01-09 11:46:29 -05:00
lsp_ext.ts 🧹 lsp_ext.ts 2023-01-23 16:58:35 +01:00
main.ts Parse + decorate rendered ANSI cargo output 2023-01-09 11:46:29 -05:00
persistent_state.ts prettier run 2022-05-17 18:15:06 +01:00
run.ts Always set up VSCode commands 2022-10-29 00:44:37 +02:00
snippets.ts automate braceless return substitution for long lines 2022-05-17 18:31:51 +01:00
tasks.ts Revert "fix: in VSCode, correctly resolve relative paths to errors" 2022-10-14 09:28:44 +02:00
toolchain.ts fix: a bunch of typos 2022-08-17 21:44:58 +08:00
util.ts Remove some types ¯\_(ツ)_/¯ 2023-01-31 15:49:39 +01:00