Vscode: automatic indentation for line continuation?

Hi - so, I noticed that when I was tying some rust code in vscode, that it doesn't auto-indent line continuations. Ie, if I have this, then hit enter:

MyStruct::some_method()

...it puts the indentation at the same level as MyStruct. My intention is to write something like:

MyStruct::some_method()
    .other_method()
    .end_chain(); 

...which, according to this, should be indented as above.

Right now, I'm just using the "official" Rust (rls) vscode extension. So:

  • Is this supposed to work? Is there some option I'm missing / can set?
  • Will this work if I install some other extension?

I did see this, but I guess that was only fixing scope-level indentation (which seems to work).

Also - yes, I know I can just indent manually - and will do so if needed - but I've been spoiled by other lanaguages / editors that support this sort of thing, and was surprised that the rust vscode extension didn't support this.

Thanks!

I've been using the same setup and definitely notice that the RLS extension has some things it misses. Maybe raise the issue on the RLS repository?

For what it is worth, if you manually tab the first line as in your example, subsequent lines will indent too.

Ok, thanks for letting me know it isn't just me, anyway!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.