dartboard icon indicating copy to clipboard operation
dartboard copied to clipboard

How to configure max line length in formatter

Open sebthom opened this issue 5 years ago • 3 comments

The source code formatter (Ctrl+Shift+F) currently inserts line breaks into lines longer than 80 characters.

How can the line length be increased/configured?

sebthom avatar Feb 26 '20 11:02 sebthom

This is somewhat a limitation of the Eclipse platform (see https://github.com/eclipse/dartboard/issues/5).

How can the line length be increased/configured?

This can't be configured manually, as the Dart formatter is very opinionated and doesn't allow for much (if any) configuration from the user.

As for synchronizing the Dart formatter settings with Eclipse: It is currently not possible to set these formatting settings (indentation style for example) just for Dart files.

A workaround for you is, to set the Dart formatter settings manually in the settings for all Editors.

I have been reluctant to set these by default, because users might want other settings for different files types.

jonas-jonas avatar Feb 28 '20 08:02 jonas-jonas

I don't know how dartboard invokes the dart formatter, but on the command line you can do something like "dartfmt --line-length 120" I think. So maybe that line length could be configured globally in the dartboard settings and/or per project.

sebthom avatar Feb 28 '20 09:02 sebthom

The formatter is invoked by the Dart SDK, specifically the Dart analysis server. That's why we don't have much freedom here to configure.

Again, the solution here should be to add the option in the Eclipse Platform to configure these settings on a file type basis, which is a rather complex undertaking. That's why there is no progress on this yet.

jonas-jonas avatar Mar 01 '20 21:03 jonas-jonas