Flutter-intellij: Add a tooltip suggesting to add trailing commas

Created on 19 Dec 2018  路  4Comments  路  Source: flutter/flutter-intellij

From a recent UX study, one participant was frustrated by the reformat feature, because it didn鈥檛 always work with her programming style, i.e., not using trailing commas.
image

New Flutter user may not know --

optional trailing commas help the automatic formatter to insert an appropriate amount of line breaks for Flutter-style code.

Can we add a tooltip suggesting to add trailing commas?

cc: @jayoung-lee @InMatrix

enhancement study topic-editing

Most helpful comment

Yes having an option on plugin settings to fix this automatically would be awesome :)

All 4 comments

This is a great idea. If we agree that this should be enforced for Flutter projects generally, I'd say we implement a lint rule and add it to the template for new Flutter projects. If we get even more ambitious we could implement a quick fix in the analysis server which adds the trailing commas on demand too. 馃憤

Yes having an option on plugin settings to fix this automatically would be awesome :)

I opened a lint request https://github.com/dart-lang/linter/issues/1338; feedback there welcome! 馃憤

As a simpler alternative to lint rules, can we consider showing a tip in a dialog window when the user tried to format code that misses trailing commas? We could potentially reuse the Tip of the Day dialog in IntelliJ. WDYT? @pq

Was this page helpful?
0 / 5 - 0 ratings