eclipse-wildwebdeveloper / wildwebdeveloper

Simple and productive Web Development Tools in the Eclipse IDE
https://projects.eclipse.org/projects/tools.wildwebdeveloper
Eclipse Public License 2.0
192 stars 71 forks source link

Prettier Integration #465

Open AObuchow opened 4 years ago

AObuchow commented 4 years ago

It'd be nice to integrate Prettier into Wild Web Developer to enable features such as CSS formatting.

Originally, I wanted to propose having a Node.JS project builder, which would use the embedded Node.JS instance from Wild Web Developer to allow running Node applications as a build action. This would allow users to create a package.json for their workspace, add prettier as a dev-dependency and run prettier to format on save/automatic build.

However there are issues with this approach:

So instead, it might be desirable to integrate Prettier directly into Wild Web Developer, and have it run on format.

Prettier is configurable with a configuration file, which will give users nice options such as ignoring certain files when formatting, using single/double quotes, etc.

Prettier is already being used in Spectrum Theme as a project build action.

PyvesB commented 4 years ago

I spotted this project which integrates with Prettier for Java. However, the author does state that:

This is currently only available for prettier JAVA, but if there is more interest it can be extended to other languages.

I'm in two minds though. As Prettier is such a common tool for web development (unlike Prettier for Java, which is currently a very niche thing), should it be integrated natively with WWD? Or is a third-party extension a more desirable solution?

PyvesB commented 4 years ago

CC @TheGreatGooo for awareness. :)

AObuchow commented 4 years ago

@PyvesB personally I'd like to see prettier integrated natively into WWD as I think CSS formatting would be nice in WWD. However, improving @TheGreatGooo 's project to support other languages might be more effective (less reinventing the wheel). I'm kind of undecided on how to proceed :P

@mickaelistria @jabby any thoughts?

TheGreatGooo commented 4 years ago

I can spend a few cycles this weekend on integration with CSS formatter. Unless someone has a suggestion for a more effective place to start.

TheGreatGooo commented 4 years ago

Finally made some progress on the css formatter, still a bunch of bugs to figure out but progress css_formatter

AObuchow commented 4 years ago

@TheGreatGooo OOou that still looks awesome and quite promising to me :) Great work so far!!

mickaelistria commented 4 years ago

@TheGreatGooo that looks very good! I'm eager to see how this is done (hopefully in a PR ;)