Skip to content

Format action disabled when editing pom.xml file in source editor #1660

Open

Description

@martinlippert

Having the latest lsp4e installed and editing a pom.xml file in the source editor, the Format menu item (in the context-menu) is disabled. The keyboard shortcut for that action doesn't work either.

This seems to be a regression, it seems to work fine with lsp4e 0.19.13.
This also seems to be like a high severity item, since I guess many people would stumble upon when after upgrading to or downloading Eclipse 2026-12.

Activity

  1. changed the title [-]Format action disabled when editing `pom.xml` file in source editorr[/-] [+]Format action disabled when editing `pom.xml` file in source editor[/+] on Nov 23, 2026
  2. rubenporras commented on Nov 23, 2026

    @rubenporras
    Contributor

    Hi @martinlippert ,

    thanks for the report. I think it is so:

    LSP4E 0.30.9 started telling servers that it supports dynamic registration for textDocument/rangeFormatting (commit a341692). When a client says that, LemMinX stops declaring range formatting when the server starts. It registers formatting and range formatting later instead, but only if its xml.format.enabled setting is true.

    Wild Web Developer sends a number of xml.format.* settings but never xml.format.enabled. LemMinX's XMLFormattingOptions defaults enabled to false, and merge() copies that value over the server's default of true. As a result, LemMinX turns formatting off and never registers it, so LSP4E correctly sees that the server can't format and disables the Format action.

    Before 0.30.9 this only worked by accident: LemMinX declared documentRangeFormattingProvider=true at startup, and LSP4E used range formatting over the whole document. I reproduced this against LemMinX 0.31.2. With the dynamic range-formatting capability, no formatting registration is sent unless xml.format.enabled=true is passed, and when it is passed, both registrations arrive as expected.

    The underlying bug is in LemMinX, could you file a bug with them?

  3. martinlippert commented on Nov 23, 2026

    @martinlippert
    ContributorAuthor

    Thank you very very much @rubenporras for the detailed analysis, very very much appreciated. I filed an issue for lemminx: eclipse-lemminx/lemminx#1928.

  4. angelozerr commented on Nov 23, 2026

    @angelozerr
    Contributor

    Hi @martinlippert ,

    thanks for the report. I think it is so:

    LSP4E 0.30.9 started telling servers that it supports dynamic registration for textDocument/rangeFormatting (commit a341692). When a client says that, LemMinX stops declaring range formatting when the server starts. It registers formatting and range formatting later instead, but only if its xml.format.enabled setting is true.

    Wild Web Developer sends a number of xml.format.* settings but never xml.format.enabled. LemMinX's XMLFormattingOptions defaults enabled to false, and merge() copies that value over the server's default of true. As a result, LemMinX turns formatting off and never registers it, so LSP4E correctly sees that the server can't format and disables the Format action.

    Before 0.30.9 this only worked by accident: LemMinX declared documentRangeFormattingProvider=true at startup, and LSP4E used range formatting over the whole document. I reproduced this against LemMinX 0.31.2. With the dynamic range-formatting capability, no formatting registration is sent unless xml.format.enabled=true is passed, and when it is passed, both registrations arrive as expected.

    The underlying bug is in LemMinX, could you file a bug with them?

    Hi @rubenporras,

    I will look into this; however, please be aware that formatting has long been functional in VS Code. I therefore suspect the bug lies on the LSP4E or WWD side, but let me investigate your issue.

  5. angelozerr commented on Nov 23, 2026

    @angelozerr
    Contributor

    Wild Web Developer sends a number of xml.format.* settings but never xml.format.enabled.

    Good catch @rubenporras !

    I can reproduce the issue with vscode xml when it doesnt send the xml.fromat.enabled.

    But please note that incomming LemMinx release should not be integrated in WWD before lemminx-maven migrate to LSP4J 1.0.0 since LemMinx did that.

    I plan to do a LemMinx release, but I don't know when lemminx maven will able to do a release

    //cc @vrubezhny @akurtakov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions