Skip to content
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

[Request] Please support XML via lsp4xml #578

Closed
bmix opened this issue Apr 28, 2019 · 8 comments

Comments

@bmix
Copy link

commented Apr 28, 2019

@tomv564

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

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.

@rwols rwols added the question label May 1, 2019

@AmjadHD

This comment has been minimized.

Copy link
Contributor

commented May 25, 2019

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.

@tomv564

This comment has been minimized.

Copy link
Owner

commented May 26, 2019

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!

@AmjadHD

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

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

@NikolasKomonen

This comment has been minimized.

Copy link

commented May 28, 2019

@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.

@AmjadHD

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

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

@tomv564

This comment has been minimized.

Copy link
Owner

commented Jun 1, 2019

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

@tomv564

This comment has been minimized.

Copy link
Owner

commented Jun 9, 2019

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!

@tomv564 tomv564 closed this Jun 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.