-
Notifications
You must be signed in to change notification settings - Fork 71
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
Formatter incorrectly breaks short lines in POM XML. #1216
Comments
The formatter is making crazy decisions. It takes this: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
</plugin> and produces this: <plugin>
<groupId>
org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
</plugin> It takes this: <tag>
<name>return</name>
</tag>
<tag>
<name>throws</name>
</tag>
<tag>
<name>since</name>
</tag> and produces this: <tag>
<name>return</name>
</tag>
<tag>
<name>
throws</name>
</tag>
<tag>
<name>since</name>
</tag> What? (See how it split |
Is not the same issue than #1205 ? |
I think yes, it's the same as #1205. @garretwilson Please consider updating to M2E-Core 2.3.0 (https://download.eclipse.org/technology/m2e/snapshots/2.3.0/) and WWD 1.1.0 (https://download.eclipse.org/wildwebdeveloper/releases/1.1.0/) together in order to fix the issue. Feel free to re-open in case of issue still persists after upgrading. |
Does #1205 refer to adding line breaks to short lines? I couldn't find that. Which comment in that ticket are you referring to? @vrubezhny I can see your comment in that ticket:
But in my case I have the max line width set to 999. |
@garretwilson Sure. But in my case I have a different set of versions for WWD/Lemminx/TM4E/LSP4E/whatever else. Yes, it is possible that, for example, formatting the |
You're saying that the version you are using did not wrap the |
That's exactly what I said. If And yes. Using the versions I mentioned above and
There was a similar issue in 2023-03 and it was fixed. Please update to the latest versions and give it a try . |
I updated to Eclipse EE 2023-06 RC1. Unfortunately even line width set to <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> to <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> In addition, just normal editing of the file in Eclipse EE 2023-06 RC1 will hang for a couple of seconds (i.e. my cursor will just stop and not respond to the keyboard), every few seconds. (Note that this happens sporadically, and I can't always reproduce it. It may be related to eclipse-tm4e/tm4e#544. Or not.) Should I file a new bug, or would you like to reopen this one, as it still isn't fixed? |
Note that the Red Hat XML Language Support extension on VS Code (which I understand to use the same underlying library—is that correct?) correctly does not wrap the line mentioned when the max line length is set to e.g. |
Indeed vscode-xml and wildwebdeveloper uses the same XML language server https://github.com/eclipse/lemminx
It should have the same behavior than vscode-xml perhaps wildwebdeloper doesn't use the same version of lemminx? |
At the moment WWD uses Lemminx v.0.25.0 (the latest released one as of today). |
Thats strange. |
Does anyone know why this issue was closed? As I mentioned above, this wasn't fixed in 2023-06 RC1. And now I'm on 2023-09 RC1, and it's still not fixed. Even though I have a max line length set to <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> to this: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> You can test with this Do I need to open another ticket? (I'm not sure why; this ticket was never fixed, so it should never have been closed.) |
I'm using Eclipse EE 2023-03 on Windows 10. I have this Maven
pom.xml
file. It has the following lines:I have "Max line width" set to
999
in the configuration.I use
Ctrl+Shift+F
to format the file. The lines above are changed to:You'll note that the second line was split after "defaults to", seemingly for no reason all.
It also incorrectly wraps this line:
The result is:
Neither of these lines should have been wrapped, because neither of them are anywhere near 999 characters in length.
The text was updated successfully, but these errors were encountered: