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

Use Wild Web developer instead of Eclipse WTP #354

Closed
vogella opened this issue Aug 29, 2019 · 36 comments
Closed

Use Wild Web developer instead of Eclipse WTP #354

vogella opened this issue Aug 29, 2019 · 36 comments
Milestone

Comments

@vogella
Copy link

vogella commented Aug 29, 2019

https://github.com/eclipse/wildwebdeveloper is currently developed by Red Hat with the intention to provide light-weight language server based support for JavaScript, JSon, etc.

I suggest you evaluate if this package can be used instead of Eclipse WTP.

The EPPs are also planning to do that https://bugs.eclipse.org/bugs/show_bug.cgi?id=544355

@vogella
Copy link
Author

vogella commented Aug 29, 2019

Update: Just learned from @mickaelistria that this migration was already done for the Eclipse packages. So you should also consider to switch.

@mickaelistria
Copy link

It's been done for the JavaScript package, not (yet) for the Enterprise Java package.
The reason is that we still need WTP for JSP and JSF support, and Wild Web Developer doesn't (and probably never will) support those.

@martinlippert
Copy link
Member

I would love to replace large parts of WTP in the Spring Tools 4 for Eclipse distribution with the Wild Web Developer pieces (it is on my to do list for quite a while already), but I need to figure out all the dependencies among the various WTP features that we would still need.

@vogella
Copy link
Author

vogella commented Aug 29, 2019

@martinlippert thanks, looking forward to it.

@martinlippert
Copy link
Member

Since there are no concrete plans to incorporate this into any STS 3.x distributions, I will move this over to the Spring Tools 4 issue tracker.

@martinlippert martinlippert transferred this issue from spring-attic/spring-ide Aug 29, 2019
@martinlippert martinlippert added this to the 4.4.0.RELEASE milestone Aug 29, 2019
@martinlippert
Copy link
Member

I am pulling this from the upcoming 4.4 release, this requires a bit more thought and testing. Ripping out the right pieces of the WTP tools and replacing them with the Wild Web tooling is a major change and probably needs more work.

One area that we need to investigate is the XML tooling that comes with the Wild Web package and whether we can use that as a full replacement of the existing tooling:

  • make sure the project-related XML namespace resolution works with the new tooling (no idea yet how to integrate that)
  • make sure the boot-ls contributed content-assist etc. works (should actually get easier with the Wild Web package due to everything being ls-based)

Other areas of work need to be identified and worked on. Nothing we can get done for the upcoming 4.4. release - unfortunately.

@vogella
Copy link
Author

vogella commented Feb 26, 2020

One nice thing is that WWD has also support for *.scss files.

@vogella
Copy link
Author

vogella commented Feb 26, 2020

Also using WWD should get rid of multiple UI freezes I get with the STS like the following:

Stack Trace
at org.eclipse.swt.internal.gtk.OS.g_utf16_offset_to_pointer(Native Method)
at org.eclipse.swt.graphics.TextLayout.computeRuns(TextLayout.java:200)
at org.eclipse.swt.graphics.TextLayout.getLineCount(TextLayout.java:1013)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1248)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:886)
at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:296)
at org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:325)
at org.eclipse.swt.custom.StyledText.resetCache(StyledText.java:8093)
at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:10297)
at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:8006)
at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4693)
at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4770)
at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.applyTextRegionCollection(StructuredPresentationReconciler.java:903)
at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processDamage(StructuredPresentationReconciler.java:878)
at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler$InternalListener.textChanged(StructuredPresentationReconciler.java:422)
at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2709)
at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3329)
at org.eclipse.jface.text.TextViewer.initializeWidgetContents(TextViewer.java:3377)
at org.eclipse.jface.text.TextViewer.setVisibleDocument(TextViewer.java:3416)
at org.eclipse.jface.text.source.projection.ProjectionViewer.setVisibleDocument(ProjectionViewer.java:700)
at org.eclipse.jface.text.source.projection.ProjectionViewer.executeReplaceVisibleDocument(ProjectionViewer.java:755)
at org.eclipse.jface.text.source.projection.ProjectionViewer.replaceVisibleDocument(ProjectionViewer.java:743)
at org.eclipse.jface.text.source.projection.ProjectionViewer.reinitializeProjection(ProjectionViewer.java:1219)
at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWithProjectionAnnotationModel(ProjectionViewer.java:937)
at org.eclipse.jface.text.source.projection.ProjectionViewer.lambda$0(ProjectionViewer.java:891)
at org.eclipse.jface.text.source.projection.ProjectionViewer$$Lambda$1521/305204106.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4930)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4451)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
at org.eclipse.ui.internal.Workbench$$Lambda$130/1402211887.run(Unknown Source)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

@mauromol
Copy link

Confused non-polemic Eclipse user point of view: shouldn't be Eclipse teams responsibility first to clarify the relationships between WTP and Wild Web Developer first and perhaps integrate them better with one another? For instance, as a long time Eclipse & WTP user, it's not clear to me if and how WTP and WWD can coexist with each other on the same Eclipse installation, especially wrt HTML, XML, CSS and JS tools. And, assuming I am able to install just WWD editors for HTML, XML, CSS and JS, will JSF, JSP, WSDL editors from WTP still work?

Is there some discussion about this? I tried to search on Google but just found https://www.eclipse.org/lists/wtp-dev/msg10917.html and https://bugs.eclipse.org/bugs/show_bug.cgi?id=544355, which however seem to be just one side of the story. What is WTP developers point of view on this?

Perhaps this could also help STS developers to better identify how to proceed?

@vogella
Copy link
Author

vogella commented Feb 27, 2020 via email

@mauromol
Copy link

Hi Lars, thanks to that link I found https://bugs.eclipse.org/bugs/show_bug.cgi?id=551408, which however is about just providing both WTP and WWD editors to the Eclipse IDE for JEE developers package for HTML, XML, CSS and JavaScript, with overlapping features, correct me if I'm wrong. I'm still perplexed on the whole picture, especially when you don't use an EPP package and you possibly install both WTP and WWD (on purpose or by chance). Having duplicate plugins for the same feature I think is quite confusing for end users.
Don't get me wrong, but the feeling here is that there's a will to replace WTP with too much of a hurry, while probably it's still a bit premature, considering the existence of JSP/JSF editors (probably WSDL as well, I don't know how much further WWD goes in that area) and related tools.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

When moving forward with this, we need to think about integrating our XML tooling with the XML language server in Wild Web Developer. Some interesting references about that can be found in this email:

https://www.eclipse.org/lists/m2e-dev/msg02233.html

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

Another source: eclipse-lemminx/lemminx#596 (comment)

@martinlippert
Copy link
Member

In order to push this forward, I went ahead and added Wild Web Developer to th Eclipse 4.17-based CI builds, which you can download from here: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html.

However, the result is still not what I would like to see from the user experience point of view. Even though https://git.eclipse.org/r/157414 removed some standard WTP editors from the product (and I don't include those in the STS4 product either), they are being dragged into the product nevertheless by other features, like m2e-wtp (as far as I've seen).

The Wild Web Developer extension seems to work fine, but as a user you need to explicitly choose to "Open With..." to open specific files (like HTML, XML or JavaScript) with the generic editor instead of the WTP ones. So coming back to your initial request to add the extension, @vogella, I am wondering what exactly you would expect here.

We can try to walk the feature and plugin dependency chains and try to get rid of specific dependencies and feature inclusions for sure, but I am not sure people are willing to give up their traditional pom.xml editor with all those tabs and extra features (for example) in order to get rid of the WTP XML editor (which is included there).

@vogella Do you have any additional thoughts on this?

@vogella
Copy link
Author

vogella commented Aug 12, 2020

I think m2e-wtp should not drag in the outdated WTP editors. Please open a bug for m2e and cc @mickaelistria (and myself) to the bug. Mickael works on reducing the dependencies before.

My hope for this change is that the language based editors are using by default.

@kdvolder
Copy link
Member

... I am not sure people are willing to give up their traditional pom.xml editor with all those tabs and extra features (for example) in order to get rid of the WTP XML editor (which is included there).

For myself... I am sure that I do not want to loose at least some of the features in the pom editor. Specifically the dependency related funtionality that lets you view and search the dependency tree. This is an extremely useful feature. Other than that the 'textual' component of the pom.xml editor... it isn't the greatest experience and probably won't be missed. (I do use it of course, but if its replaced by another 'xml-schema-aware' editor it would probably be just as good or probably better.

@martinlippert
Copy link
Member

Here is the related item at m2e: https://bugs.eclipse.org/bugs/show_bug.cgi?id=553183

@martinlippert
Copy link
Member

And I filed an additional one to discuss dependencies around m2e-wtp: https://bugs.eclipse.org/bugs/show_bug.cgi?id=566077

@mauromol
Copy link

Hi @martinlippert, I see this is closed now, does it mean next STS 4.8.0 will ship WWD instead of WTP then?

@martinlippert
Copy link
Member

Not exactly... ;-)

The upcoming Spring Tools 4 for Eclipse release (4.8.0) will include WWD by default for the Eclipse 2020-09-based distribution as an experimental part of the distribution. Therefore I closed this ticket and marked it for the upcoming 4.8.0 release.

Due to various dependencies across multiple bundles and features, we were not able to fully remove WTP UI tooling from the distribution. As a result, you will see a set of duplication across several features, including HTML and JavaScript editors, and a few more. You will be able to switch to the WWD editors, but due to the duplication they are not the default editors yet. This is all work-in-progress and we try to make progress on further reducing dependencies on WTP UI features across the board.

Another piece that we haven't ported yet to WWD is the project-related XSD namespace resolution, that is also be to done for one of the upcoming releases. So we are making progress, but we aren't there yet.

@mauromol
Copy link

Does it mean that 4.8.0 will present issue #447 "out-of-the-box"?

@martinlippert
Copy link
Member

Not "out-of-the-box", since the default XML editor will still be the WTP one. But if you switch to the WWD-based generic editor to work on Spring XML config files, the problem will appear.

@mickaelistria
Copy link

Not "out-of-the-box", since the default XML editor will still be the WTP one. But if you switch to the WWD-based generic editor to work on Spring XML config files, the problem will appear.

That's not really true as Wild Web Developer plugs its analysis at document level, so it can show reports on other editors.
If there is a bug in LemMinX that returns invalid errors, then it should be reported and fixed in LemMinX itself.

@martinlippert
Copy link
Member

@mickaelistria Thanks for the pointer, wasn't aware of that. The "problem" is not really a bug in LemMinx, but a special XSD namespace resolution mechanism that we need to plug into LemMinx (as we did in the past for WTP). So lets double check whether the issue actually occurs.

If this happens, can users disable or switch the severity of specific validations in LemMinx? (as a workaround)

@mickaelistria
Copy link

If this happens, can users disable or switch the severity of specific validations in LemMinx? (as a workaround)

Nope, they'd most likely need to disable the LemMinX LS as advised in the other bug.
On client-side, it's possible to tweak LemMinX options (with some limitations at the moment). You can see an example of how to do that in m2e.

@mauromol
Copy link

@martinlippert if you recall from bug #447, the problem was not about using the WWD XML editor in place of the WTP one, but rather that the WWD XML language server was "on" by default and this interfered with STS special XSD namespace resolution. The workaround was to disable the WWD XML language server. So perhaps you may evaluate to ship STS with WWD language servers disabled by default and perhaps document this known issue in some way...

@martinlippert
Copy link
Member

@mauromol You are absolutely right, I mixed #447 up with another bug I had in mind. Sorry about that. We need to carefully document that limitation, I absolutely agree. I don't think we can easily disable the XML language server by default.

@martinlippert
Copy link
Member

If this happens, can users disable or switch the severity of specific validations in LemMinx? (as a workaround)

Nope, they'd most likely need to disable the LemMinX LS as advised in the other bug.
On client-side, it's possible to tweak LemMinX options (with some limitations at the moment). You can see an example of how to do that in m2e.

@mickaelistria Any concrete pointer which part of m2e you mean here?

@martinlippert
Copy link
Member

@mickaelistria Any concrete pointer which part of m2e you mean here?

Never mind, I think I found the code... :-)

@mickaelistria
Copy link

I don't think we can easily disable the XML language server by default.

Technically, you can as it's just a matter of setting preference org.eclipse.wildwebdeveloper.xml/org.eclipse.core.runtime.xml=false in LSP4E store. However, is this what you desire for all your users, that's trickier to decide.

@mickaelistria Any concrete pointer which part of m2e you mean here?

MavenLemminxExtension can be interesting if you want to consider it a lemminx extension, I'm not sure a lemminx extension allows to ignore some files though...
InitializationOptionsProvider shows for example how you can statically add schemas or other settings on LS startup.
MavenRuntimeClasspathProvider shows how you can listen to preferences to retrieve active instances of the LS and tweak them.
And Wild Web Developer/LemMinX actually offer a way to add schema catalogs, via preferences.

By order of preference, I think you should investigate:

  1. schema catalogs with Wild Web Developer prefs
  2. initializationOptions
  3. LemMinX extensions
  4. Some more complex glue

@martinlippert
Copy link
Member

@mickaelistria Thanks a lot for the additional insights and ideas, much appreciated. I think the "correct" solution to this would be to implement a lemminx extension that registers a URIResolverExtension.

But even that is not trivial to implement as an extension to lemminx for our case, since the URI resolution mechanism that we need is project-specific, so you need some sort of project context when resolving the namespace and look up things on the classpath of the specific project. Therefore a schema catalog doesn't really help.

Since lemminx doesn't seem to have any project-specific information around (let aside the classpath information of a project), it might be necessary to implement some kind of language-server communication to get that information into the lemminx extension to do the resolving.

I don't really have an idea for a short-term solution or workaround beyond disabling the XML language server. Given the fact that this issue appears only for very specific situations, I am reluctant to disable the entire XML language server by default for everybody. But to be honest, I am not very happy either way.

@martinlippert
Copy link
Member

The next step here will be to find a way to implement the project-specific resolver as an extension to the lemminx project. I will start to work on that once we have the 4.8.0 release out the door and follow up on the lemminx project for more help with that extension authoring and possible or necessary changes in lemminx. Looks like I will have to investigate this a bit... :-)

@mickaelistria Thanks again for the feedback and ideas, much appreciated. Lets continue on the lemminx project with it.

@ENate
Copy link

ENate commented Oct 3, 2024

I still see issues with Angular templates in eclipse 2024! Can anyone let me know where to remove the old HTML package from Eclipse Java EE? Thanks

@martinlippert
Copy link
Member

I still see issues with Angular templates in eclipse 2024! Can anyone let me know where to remove the old HTML package from Eclipse Java EE? Thanks

The Spring Tools for Eclipse distributions do not ship with the old HTML tooling anymore. In case you are referring to the standard Eclipse JEE package, the question is probably a better for fit for https://github.com/eclipse-packaging/packages

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

No branches or pull requests

7 participants