Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTools code formatting options not used by Wild Web Developer #240

Open
nimo23 opened this issue Sep 2, 2019 · 21 comments
Open

WebTools code formatting options not used by Wild Web Developer #240

nimo23 opened this issue Sep 2, 2019 · 21 comments
Labels

Comments

@nimo23
Copy link

nimo23 commented Sep 2, 2019

Open a css file in generic editor and try to reformat it. User expects that the built in eclipse formatting settings are also work within the "generic editor".

@nimo23 nimo23 changed the title eclipse code formatting does not work in generic editor eclipse css code formatting does not work in generic editor Sep 2, 2019
@mickaelistria
Copy link
Contributor

Which specific setting do you have in mind?

@nimo23
Copy link
Author

nimo23 commented Sep 2, 2019

The typical eclipse built in formatter settings used within css files should also be used as the default within the generic editor for css:

eclipse formatter

@mickaelistria
Copy link
Contributor

This formatter settings are downstream of Eclipse Platform (in WTP), so Wild Web Developer, which doesn't depend on WTP, doesn't and won't care about them. You can just uninstall the other CSS editor and things will be less confusing.
Instead, we can think about a mechanism to allow migration or copy of preferences, and pass them to the language server. But this would first require that we have preferences for CSS code formatting in Wild Web Developer, which we don't have so far. It's somehow related to #225.

@nimo23
Copy link
Author

nimo23 commented Sep 2, 2019

which doesn't depend on WTP, doesn't and won't care about them. You can just uninstall the other CSS editor and things will be less confusing.

Would be fine, if wwd has a seamless integration within eclipse.. I guess, thats the main reason why to use wwd in eclipse instead of, for example, "vs code" or "intellij".

Would be good, to take the best of the both worlds of WTP and language server. This what is bad in the one can be compensated by the other..

Why should the wwd built in eclipse does not care about the overall eclipse platform settings? If I must treat the wwd in complete isolation to the rest of eclipse, why should I use wwd at all?

@mickaelistria
Copy link
Contributor

Why should the wwd built in eclipse does not care about the overall eclipse platform settings?

Wild Web Developer should (and does to some extent) care about Platform settings, but WTP editors are not in Platform, they're a downstream project of Platform and parallel project to Wild Web Developer, and we want to avoid technical intersections between them. However, we can consider some tricks allowing to "transfer" some settings from one project to the other.

But first, we'd need to investigate how to customize the CSS formatting using the VSCode CSS language server, and leverage this customization.
Then, once we know how to customize, we can look for tricks to get the customization loaded according to WTP editors preferences when we have no better input.

@angelozerr
Copy link
Contributor

But first, we'd need to investigate how to customize the CSS formatting using the VSCode CSS language server, and leverage this customization.

Please see my comments #237 (comment)

@mickaelistria mickaelistria changed the title eclipse css code formatting does not work in generic editor WebTools code formatting options not used by Wild Web Developer Sep 4, 2019
@dantran
Copy link

dantran commented Mar 17, 2022

this long overdue is bug is now impacting Eclipse 2022-03 pom editor nolonger using XML Editor indentation configuration

@agentgt
Copy link

agentgt commented Jun 8, 2022

@mickaelistria Regardless of WTP why does Wild Web Developer use or rely on the "Generic Editor".

I just recently upgraded Eclipse (for enterprise developers) and found it rather confusing with both WTP and WWD being installed.

It seems like most of the bugs being filed are because fundamentally the only editing config is through Generic/Structured Editor when people expect each mode (e.g. yaml, javascript, etc) would have its own configuration. Combine this with the existing WTP and it is super confusing.

As for Maven it appears the WWD XML Editor takes over the Maven Pom Editor but I'm not sure if that is actually the case. It is very bizarre because the WTP XML editor was used in the past.

I'm just surprised some one OK'd having WWD in base installs of Eclipse for Java Enterprise developers. I don't think it is ready yet.

@mickaelistria
Copy link
Contributor

@agentgt please read https://github.com/eclipse/wildwebdeveloper#-design-and-architecture

I don't think it is ready yet.

It's more ready that former editors that were getting slowly out of sync with most languages/modern features. But some features are also missing. Contributions to fill that gap are welcome.

@dantran
Copy link

dantran commented Jun 8, 2022

an alternative would be Spring STS4, which works for me while waiting for this fix

@agentgt
Copy link

agentgt commented Jun 8, 2022

It's more ready that former editors that were getting slowly out of sync with most languages/modern features. But some features are also missing. Contributions to fill that gap are welcome.

Its not that I don't think it would be useful for things like YAML or Javascript where obviously WTP doesn't work well but things like HTML, XML and arguably CSS were already working fine.

XML especially since Eclipse has always had great support for XML.

@agentgt please read https://github.com/eclipse/wildwebdeveloper#-design-and-architecture

I don't care about the technical reasons of why all modes are configured through one Generic Editor. I care because it doesn't make since and I'm curious how you are going to make each mode configurable since it just uses the Generic Editor. If you say its possible I'm fine with Generic Editor.

For example some modes like XML or HTML I might want tabs for indent and others I might want spaces (which is broken for YAML as I prefer my "Generic Editor" to use tabs).

Also for "Generic Editor" I expect it to be a plain text editor. I'm not a fan of how WWD just commandeers what is normally a plain text editor and then calls it "Generic" regardless of what mode.

So yeah thats what I meant by not ready. Its just not ready to be included with the "Eclipse for Java Enterprise..." but for an addon to get better JS/TS I agree it is superior to WTP.

@mauromol
Copy link

mauromol commented Jun 9, 2022

Also for "Generic Editor" I expect it to be a plain text editor. I'm not a fan of how WWD just commandeers what is normally a plain text editor and then calls it "Generic" regardless of what mode.

I perfectly agree with this. It's totally confusing that I need to use a "generic" editor (suggesting a plain text editor, as Adam says) to get indeed a "more specialised"/feature rich editor...

I think the question about WTP and WWD living together, especially once they are bundled in Eclipse for JEE package, should be a topic for discussion on the Eclipse IDE working group (and/or perhaps for the cross-project mailing list, I don't know how things are handled at that level). However years have passed now and the situation has not improved so much, therefore I'm wondering if anyone really cares about proper all-round Eclipse IDE support for web technologies...

@angelozerr
Copy link
Contributor

angelozerr commented Jun 9, 2022

However years have passed now and the situation has not improved so much, therefore I'm wondering if anyone really cares about proper all-round Eclipse IDE support for web technologies...

Do you speak about XML and HTML features of WWD? If it is for XML, could you please give us issues which are annoying for you? I have fixed several issues (like false positive validation for XML language server) and we will soon create a release to integrate those annoying false positive validation.

@mauromol
Copy link

mauromol commented Jun 9, 2022

I'm talking about problems (either bugs or just confusing behaviours) introduced by WTP and WWD living together. This is just an example: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577715

But, once again, the issue is not WWD per se or WTP per se: bugs may exist in both products and they can (hopefully) be fixed. IMHO the problem lies in making them play well together, so that the Eclipse IDE is out-of-the-box coherent with regards to web development features, with no "surprise effect" to the user. Otherwise the feeling to the end user is that the IDE, as a product, is not yet mature enough on this front, despite the enhancements introduced by WWD.

@angelozerr
Copy link
Contributor

This is just an example: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577715

It is this kind of bug that I fixed (false positive validation).

@cebaa
Copy link

cebaa commented Jul 15, 2022

@angelozerr

If it is for XML, could you please give us issues which are annoying for you?

Not sure about others, but for me it's pom.xml not being formatted in the same way (same issue as noted in #240 (comment)). That basically makes people in the same team using different versions of eclipse (last year's version vs this year's version) formatting pom.xml in a different way, which is not ideal.

@dantran
Copy link

dantran commented Sep 23, 2022

STS 4.16 is now hitting pom xml formatting issue. likely it is now pulling in latest m2e :(

@angelozerr
Copy link
Contributor

@mickaelistria could confirm that, but I'm not sure that WWD will use the WTP Settings.

For XML, I created a Formatting preference page #860 (comment) which provides the main format settings (not the whole but the main important).

But I think the main problem is about spaces/tabs indentation preferences. It requires a big change in Eclipse Platform to provide the capability to provide custom spaces/tabs indentation for XML but we need really that.

To try fixing this problem, I have started to contribute with .editorconfig support with eclipse-platform/eclipse.platform.text#90

Once this PR will be merged (I need to find time to work on it), it will give the capability to customize indentation, and other standard settings specified in https://editorconfig.org/

But I'm pretty sure that some people would like to have the capability to customize indentation with an UI preferences like #872 and in this case, Eclipse Platform will required to provide a new extension point to add custom preferences to the generic editor. The .editorconfig contribution is a sample of custom preferences store, but for the moment there is no extension point (just Adapter Eclipse mechanism to validate the .editorconfig mechanism).

Once .editorconfig will be validate, we could work on a nex extension point and provide teh capability to add custom preferences store to the generic editor.

@dantran
Copy link

dantran commented Oct 28, 2022

Does anyone have a workaround to get maven pom.xml to use 2 space indent with the latest eclipse/STS4?

@dantran
Copy link

dantran commented Nov 7, 2022

the word around is to install eclipse XML editor from the market place. or via https://download.eclipse.org/releases/latest using feature org.eclipse.wst.xml_ui.feature.feature.group

ensure to switch to XML editor for foramtting

@bbezanson
Copy link

Does anyone have a workaround to get maven pom.xml to use 2 space indent with the latest eclipse/STS4?

As of today with the latest Spring STS and associated tools, the "Maven POM Editor" in Eclipse uses the format settings from in the Preferences: General -> Editors -> Text Editors at least for "Displayed Tab Width" and "Insert Spaces for Tabs".

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

No branches or pull requests

8 participants