-
Notifications
You must be signed in to change notification settings - Fork 70
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 XML formatter sometimes gets confused with normal XML and hallucinates errors #1251
Comments
I suspect that it is an error from https://github.com/eclipse/lemminx-maven , @vrubezhny what do you think about that? |
I don't think it's an error in lemminx-maven, lemminx-maven behaves OK according to document state, and here it seems like the document state is incorrect. But the document state is a shared responsibility between the client and the server. So either LSP4E sends incorrect change event, or misses to send some; or lemminx fails to properly handle some document changed events. |
I sure will! As you might imagine I don't have time to try to find exact steps, as this sort of thing is probably due to some sort of special circumstances, timing, or whatever. I would say to try it with the Although I can't readily reproduce this particular issue, I'm surprised that anyone using this editor to edit POMs daily doesn't run into similar things all the time. I know I do. There's the one where you are adding an artifact and it pops up an autocomplete for the version and just … does nothing. Then there's the one where closing a tag results in a half-close-tag and a full-close-tag. And the one where undoing ondoes not-what-was done before undoing. Etc. I just don't have time to file all of them because I know many of them are hard to reproduce. I'm just surprised you don't see them all the time if you're using this plugin day-to-day. Anyway good luck and have a good weekend. I'll be sure to pass along any more information I discover. |
@garretwilson Could you please gather and share the Eclipse and Language server logs while reproducing the issue? To do that:
Then start your Eclipse again and try reproducing the issue. Once reproduced, please share all the Also please attach the minimal test project that allows you to reproduce the issue if possible (please do not share any restricted information here) - you can also zip it before attaching. Thanks for your help. |
I remember that when I try to port LSP4E on IJ, I had a problem with change event. LSP4E takes care of one change event (so it can be ignore another change event. Perhaps the fix is to manage a list of change event instead of one change event. |
I think I've hit this bug myself. After adding the M2E snapshots Eclipse plugin repository and installing "M2E - POM Editor using LemMinX language server (includes Incubating components)" (I got version 2.0.5.20230630-2007), this appears to be fixed. |
Indeed it was fixed in eclipse/lemminx-maven#447 thank's @vrubezhny ! |
I'm using Eclipse EE 2023-06 with Java 17 on Windows 10.
Sometimes when I'm editing a POM, the new XML editor will get confused and show an error. The error will look like this:
(That's all. Really. There is nothing after "Code:".)
However there is no problem in the XML file. It looks like this. (Note that I am indenting using tabs.)
The error is shown on the first
e
of<dependency>
.This happens when I open an existing pom and do something like this:
<dependency>
section from above.If I close the file and reopen it, the same error appears, but a different line is indicated; now it indicates the
v
of<version>
.If I delete the entire
<dependency>
section, then the error jumps to the section after that.Arg, now I even did a Git "replace with HEAD" to remove all changes. When I close the file there is no error. When I open the file, it there's there is this imaginary error. Now even with the file I started with (which showed no errors) before making any changes!
Wow the only way I found around this was to exit Eclipse completely, come back in, and paste the entire section you see above. No typing allowed, because one never knows when it will start seeing imaginary errors again!
The text was updated successfully, but these errors were encountered: