Lsp: [Request] Please support XML via lsp4xml

Created on 28 Apr 2019  路  8Comments  路  Source: sublimelsp/LSP

questioheldebug

All 8 comments

With schema validation, nice. I personally won't look into it but I think the instructions and code at https://github.com/redhat-developer/vscode-xml should be helpful for you to:

  • Install the server on your machine
  • Add a client config to LSP so it knows how to start / talk to the server.

After examining the vscode extension, I succeded to make it work with this command.

"xml-ls":
{
    "command":
    [
        "java",

        // the vscode extension uses this, I don't know why, but it's not necessary
        "-DwatchParentProcess=false",
        // JVM options (not necessary) but the vscode extension uses them by default
        "-noverify",  // bypass class verification
        "-Xmx64M",  // set the maximum heap size
        "-XX:+UseG1GC",  // use the G1 garbage collector
        "-XX:+UseStringDeduplication",  // enable string deduplication optimisation

        "-jar",
        "D:/Downloads/Archives/vscode-xml-0.7.0-3159/extension/server/org.eclipse.lsp4xml-uber.jar"
    ],
    "enabled": true,
    "languageId": "xml",
    "scopes":
    [
        "text.xml"
    ],
    "syntaxes":
    [
        "Packages/XML/XML.sublime-syntax"
    ]
}

I couldn't build it, so I had to use the one in the vscode extension, but it's working fine.

Nice work!
The jar can be downloaded from https://github.com/angelozerr/lsp4xml/releases, we should add your config and this link to our documentation!

can you verify more the -DwatchParentProcess option, i guess it's only set to false on Windows.
https://github.com/redhat-developer/vscode-xml/blob/master/src/javaServerStarter.ts#L31

@AmjadHD

can you verify more the -DwatchParentProcess option

There are sometimes issues that the client does not tell the server to shut down (eg: crash), and the server will run as an orphan process. The server will check if it's parent has disappeared and ends if it has.

The reason we dont need this flag on Windows is because it has better management of orphan processes, but on other OS's this issue can happen.

Thanks for the explanation @NikolasKomonen , just out of curiosity can you provide further details about the options used, especially the G1 GC ?

@AmjadHD They improve performance on the JVM, you could google them as they're not specific to this language server.

I added the details from this issue to our documentation.
I think this is workable for the time being, but happy to update our docs/config should installation and launching be simplified in the future!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

predragnikolic picture predragnikolic  路  3Comments

olegbl picture olegbl  路  5Comments

arsham picture arsham  路  3Comments

predragnikolic picture predragnikolic  路  7Comments

tomv564 picture tomv564  路  4Comments