Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Respect the Dart style guide by default #5

Open
jonas-jonas opened this issue Jan 15, 2019 · 7 comments
Open

Respect the Dart style guide by default #5

jonas-jonas opened this issue Jan 15, 2019 · 7 comments
Assignees
Labels

Comments

@jonas-jonas
Copy link
Contributor

The Dart style guide sets some rules (recommendations) on how to format Dart code: https://www.dartlang.org/guides/language/effective-dart/style

We should set these by default from the plugin.

@jonas-jonas
Copy link
Contributor Author

#2 Related

@jonas-jonas
Copy link
Contributor Author

  • Set indentation (at first plugin start, for dart files)

@jonas-jonas
Copy link
Contributor Author

Currently it doesn't seem to be possible to set these settings per editor/contentType. It would be nice to have this set for only the Dart contentType as the formatter is quite inflexible. See dart-lang/sdk#37451

@jonas-jonas
Copy link
Contributor Author

@mickaelistria

Do you know if it's possible to set the indentation settings (for example TabWidth), and related settings, on a per contentType basis?

For us it would be nice to set these settings for only Dart files as the Dart formatter is very opinionated and forces 2-space indentation on every file. Thus it would be nice to just set these settings for all Dart files.

@mickaelistria
Copy link

Do you know if it's possible to set the indentation settings (for example TabWidth), and related settings, on a per contentType basis?

I don't think it's possible right now. But there are things in Platform that might allow to implement it efficiently. This could for example be a new PreferenceScope for a given content-type, and then this Scope could be added to other scopes used by editors. In any case, it seems more like work to do in Platform first.

@jonas-jonas
Copy link
Contributor Author

I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=549447 for this.

@jonas-jonas
Copy link
Contributor Author

As this "feature" in the platform will likely not be addressed in the near future, I think we should show a Dialog on first access of preferences (which translates to creating or importing a new project or opening a Dart file) indicating, what the current situation is. The dialog should also give an option for the user to select if he wants to update the global settings for indentation or not.

I feel like this is a major usability issue (having the formatter & IDE not working together properly). So I will see if I find the time to work on this in the platform in the next month.

It might also be something for @lak-proddev to work on?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants