OpenLiberty / liberty-language-server

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.
Eclipse Public License 2.0
6 stars 12 forks source link

Comments throws off diagnostic (cvc-complex-type.2.3) mark onto the wrong location in server.xml #163

Closed dshimo closed 1 year ago

dshimo commented 1 year ago

The expected behavior is for the diagnostics/markers to appear on the text. This behavior is also observed in pom.xml image

When a comment is in between the text and the server element, the diagnostic marks the comment on line 4 rather than line 12. image This issue does not seem to occur on pom.xml

Steps to recreate:

  1. Create a server.xml with a server element
  2. Put a comment with content into it
  3. Type any text anywhere in the server element

This bug appears in IntelliJ and VSCode image

evie-lau commented 1 year ago

Reproduced the same issue in a pom.xml file in VS Code without our language server installed via any plugins - only XML by redhat should be affecting XML files. image

cherylking commented 1 year ago

This may be an error in LemMinX itself since LCLS only does diagnostics for certain elements (featureManager/feature and include). All other elements are validate against the schema with LemMinX afaik.

cherylking commented 1 year ago

Reproduced the same issue in a pom.xml file in VS Code.

So that means it is not a LCLS issue, correct?

kathrynkodama commented 1 year ago

I've opened https://github.com/eclipse/lemminx/issues/1495

angelozerr commented 1 year ago

We will invedtigate the problem on lemminx, but when you say that you have the problem with IJ, it means that you have integrated lemminx in IJ?

If the answer is yes, could you give me a link to the repository which does that. Thanks!

kathrynkodama commented 1 year ago

@angelozerr yes, in Liberty Tools for IntelliJ we are running LemMinX with the Liberty LS ext: https://github.com/OpenLiberty/liberty-tools-intellij

angelozerr commented 1 year ago

Wow thats great! Thanks @kathrynkodama for your answer.

kathrynkodama commented 1 year ago

With https://github.com/eclipse/lemminx/issues/1495 fixed, lemminx-liberty, LT for IntelliJ and LT for Eclipse will have to update to the latest LemMinX version containing the fix.

cherylking commented 1 year ago

@kathrynkodama Any outlook on when that next version of Eclipse LemMinX is expected?

angelozerr commented 1 year ago

For the moment it is not planned, but we would like to create 1.0.0 https://github.com/eclipse/lemminx/issues/1470 which will break API participant. Please follow this issue.

cherylking commented 1 year ago

Release 0.25.0 was released today - https://github.com/eclipse/lemminx/blob/main/CHANGELOG.md

cherylking commented 1 year ago

This is fixed in the 2.0-snapshot branch which will be merged into the main branch once the 1.0 release is published. Closing this issue.