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

POM Editor formatting and code completion doesn't work #1907

Open
gerib opened this issue Dec 27, 2024 · 13 comments
Open

POM Editor formatting and code completion doesn't work #1907

gerib opened this issue Dec 27, 2024 · 13 comments

Comments

@gerib
Copy link

gerib commented Dec 27, 2024

Neither

Update: Code completion doesn't work either. When typing a ‚<‘ no drop-down with possible XML tags is shown.

Happens with:

Linux 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux


Operating System: Debian GNU/Linux 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-28-amd64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-6700 CPU @ 3.40GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NV124
Manufacturer: XMG
Product Name: P7xxDM(-G)
System Version: Not Applicable


After $ sudo apt full-upgrade,

Last updates today (if that matters):

  • libjavascriptcoregtk-4.1-0:amd64 (2.46.5-1~deb12u1)
  • libwebkit2gtk-4.1-0:amd64 (2.46.5-1~deb12u1)

and Eclipse > Help > Check for updates > No updates found.


Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)

Version: 2024-12 (4.34.0)
Build id: 20241128-0757


Preferences > Language Servers >:

  • ✅ | XML | LemMinX
  • ✅ | Pom XML | Spring Boot Language Server

Deactivating both or either of them doesn't change anything to the better.

Preferences > Language Servers > Logs >:

  • LemMinX | Log to Console > ✔
  • Spring Boot Language Server | Log to Console > ✔

show nothing in the Console on Ctrl+Shift+F.


Plug-ins:

  • 03/10/2024, 18:53 Eclipse.org - m2e M2E Maven POM File Editor using Wild Web Developer, LemMinX and Maven LS extension (requires Incubating components) 2.0.700.20240928-0605 org.eclipse.m2e.editor.lemminx
  • 10/09/2024, 20:51 Broadcom Spring Boot Language Server 1.57.0.202409101848 org.springframework.tooling.boot.ls

This also has a history of regressions:

  • Format source doesn't work
@mickaelistria
Copy link
Contributor

Thanks for reporting.
So formatting seems rather fragile... Would you be interesting in submitting in a PR a test case that reproduces this issue? Once we have such test, working on a fix will be much easier, and we'll less likely face regressions.
Such test could be added to https://github.com/eclipse-m2e/m2e-core/blob/master/org.eclipse.m2e.editor.lemminx.tests/src/org/eclipse/m2e/editor/lemminx/tests/EditorTest.java

@laeubi
Copy link
Member

laeubi commented Jan 6, 2025

I noticed that it works to first select all (STRG+SHIFT+A) the format (STRG+SHIFT+F) looks like an issue of WWD/lemminx to me.

@mickaelistria
Copy link
Contributor

@laeubi Thanks.
@gerib do you confirm you see the exact same issue about formatting for all XML files in general?

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@mickaelistria Re:

Would you be interesting in submitting in a PR a test case that reproduces this issue? Once we have such test, working on a fix will be much easier, and we'll less likely face regressions. Such test could be added to https://github.com/eclipse-m2e/m2e-core/blob/master/org.eclipse.m2e.editor.lemminx.tests/src/org/eclipse/m2e/editor/lemminx/tests/EditorTest.java

I am interested and I know about Eclipse's plug-in architecture in principle. However, I'm not familiar with Eclipse's plug-in development in general and its IInterfaces in particular. So I have no clue how I could check for the behavior described above in EditorTest.java.

If it helps I can put the pom.xml with which this happens here somewhere on GitHub.

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@laeubi Usually the default for Select All is Ctrl+A. Anyway, Ctrl+A > Ctrl+Shift+F doesn't work here in POM Editor.

@mickaelistria Formatting of sample-6.xml works in all three ways: key combination, context menu, menu Source (the file is opened with XML Editor).

If I open my pom.xml with XML Editor explicitly formatting works and also POM code completion. But XML Editor is not the default for POMs. So, when I just double-click on a pom.xml it opens in Maven POM Editor where neither formatting nor––as an additional issue––code completion works.

@gerib gerib changed the title POM Editor formatting doesn't work POM Editor formatting and code completion doesn't work Jan 6, 2025
@mickaelistria
Copy link
Contributor

Can you please share a screenshot of the editor you're using? The "XML Editor" is most likely the WTP one.
Also, can you please try your pom.xml with the "Generic Code Editor"?

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@mickaelistria
I can but what's the point of a screenshot? You just see the editor's icon and the file's name (pom.xml) in the editor's tab and its contents below.

With Generic Code Editor formatting and code completion don't work. But that's fine. Generic doesn't know anything about XML element hierarchy or POM elements.

@mickaelistria
Copy link
Contributor

what's the point of a screenshot?

The WTP-based editor and the Generic Editor look different by default. A screenshot would help in ensure which text editor is being used by the pom editor. But according to your feedback, it seems like the Generic Editor that's being used (so the screenshot is not useful anymore).

With Generic Code Editor formatting and code completion don't work. But that's fine. Generic doesn't know anything about XML element hierarchy or POM elements.

With m2e properly configured, the Generic Code Editor is fully capable of handling XML and pom files. So the fact that it doesn't work is related.
Do you have anything in your log file mentioning some wildwebdeveloper or lemminx error? What about plain XML files in the Generic Code Editor.

I cannot tell whether the Spring Boot Language Server could be harming.

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@mickaelistria

With m2e properly configured

Is this a configuration I can change (or "destroy", for that matter)?

Do you have anything in your log file mentioning some wildwebdeveloper or lemminx error? What about plain XML files in the Generic Code Editor.

Plain XML (sample-6.xml mentioned above) doesn't format in GCE. Menu item Format is grayed out in context menu and isn't shown in Source menu.

Do you want me to check more combinations of:

  • editors: Generic, XML, POM
  • files: plain XML, POM

And it becomes even more weird: There's no .log in my .../eclipse.wksp/.metadata/. There are just a few .bak_[0-6].log with the latest .bak_0.log last modified on 2024-12-27.

@mickaelistria
Copy link
Contributor

There's no .log in my .../eclipse.wksp/.metadata/. There are just a few .bak_[0-6].log with the latest .bak_0.log last modified on 2024-12-27.

And does that last one contain a potentially related stacktrace ?

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@mickaelistria

Now there is a 6. Jan 14:36 .log. It contains just 2 entries regarding Git:

!ENTRY org.eclipse.ui.workbench 4 0 2025-01-06 14:36:20.789
!MESSAGE Dynamic menu contribution 'DynamicContributionItems(id=org.eclipse.tm.terminal.connector.local.LocalLauncherDynamicContributionItems, visible=true)' threw an unexpected exception
!STACK 0
org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico (Datei oder Verzeichnis nicht gefunden))
...
ENTRY org.eclipse.ui.workbench 4 0 2025-01-06 14:36:22.493
!MESSAGE Dynamic menu contribution 'DynamicContributionItems(id=org.eclipse.tm.terminal.connector.local.LocalLauncherDynamicContributionItems, visible=true)' threw an unexpected exception
!STACK 0
org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico (Datei oder Verzeichnis nicht gefunden))
...

This is a workspace I copied from a prior one (which was created by Eclipse on Windows) and it has been upgraded to the current Eclipse version at first opening.

@mickaelistria
Copy link
Contributor

Have you tried opening an xml file with the generic editor in this new upgraded instance? If we're lucky, doing so should populate the log with useful stack traces.

@gerib
Copy link
Author

gerib commented Jan 6, 2025

@mickaelistria

I've always been working with this upgraded workspace since creating this issue report (and before).

I closed Eclipse, started it again, sample-6.xml can't be formatted in GCE. There's the session log so far.

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

3 participants