Search code examples
dartemacsindentation

Setting lsp-dart indentation


The Flutter/Dart project recommends using the lsp-dart package.

I'm quite partial to an indentation of 4 spaces. What's the appropriate way to set it in ~/.emacs?

Curiously, flutter format itself doesn't offer such an option, making for a rather heavy-handed set of tools.


Solution

  • flutter format uses the heavily road-tested values from the home office. And yes, it's highly opinionated, and ensures whitespace or rewrapping doesn't needlessly occur when editing someone else's code and submitting a pull request. Considering the hoarde of people working on Dart at Google, this is a wise choice.