lemminx icon indicating copy to clipboard operation
lemminx copied to clipboard

document settings

Open AmjadHD opened this issue 6 years ago • 9 comments

I can't find the settings supported by this language server.

AmjadHD avatar Jun 22 '19 23:06 AmjadHD

Check here: https://github.com/redhat-developer/vscode-xml/blob/master/README.md#supported-vs-code-settings

NikolasKomonen avatar Jun 24 '19 11:06 NikolasKomonen

yeah, I already checked that but it's specific to vscode

AmjadHD avatar Jun 24 '19 22:06 AmjadHD

It's not specific to vscode. The JSON stream that you must send to the server, should look like this if I remember https://github.com/angelozerr/lsp4xml/wiki/Configuration

angelozerr avatar Jun 24 '19 22:06 angelozerr

I think xml.server.vmargs is specific to vscode, is it not ?

AmjadHD avatar Jun 24 '19 23:06 AmjadHD

I think xml.server.vmargs is specific to vscode, is it not ?

Indeed for this preferences it's specific to vscode-xml but other settings comes from the XML Language Server. (have you tried it?)

angelozerr avatar Jun 25 '19 05:06 angelozerr

I tried several of them, i found that at least xml.symbols.enabled is vscode specific too, but for some, I may not be able to test whether they're specific to vscode or not, as sublime LSP client may not be able to handle them yet, and frankly, I'm not tempted to spend much time on testing 😪 , as I was trying to do this as a part of documenting all (most) language servers settings for sublime's LSP. I think there should be a full reference of settings supported by lsp4xml (in this repo and not anywhere else) regardless of the editor, that shouldn't be hard since most of the work is already done in the vscode extension, only left to strip vscode specific settings.

AmjadHD avatar Jun 25 '19 11:06 AmjadHD

I tried several of them, i found that at least xml.symbols.enabled is vscode specific too

No it's not specific vscode settings. It should work if you use 0.7.0. I think your problem is what JSON I need to send to the server when it starts. Here the JSON sent by vscode-xml when server is started.

{
    "processId": 41212,
    "rootPath": null,
    "rootUri": null,
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ]
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {
        "settings": {
            "xml": {
                "trace": {
                    "server": "verbose"
                },
                "catalogs": [],
                "logs": {
                    "client": false,
                    "file": "C:\\Users\\azerr\\.lsp4xml\\lsp4xml.log"
                },
                "format": {
                    "splitAttributes": false,
                    "joinCDATALines": false,
                    "joinCommentLines": false,
                    "spaceBeforeEmptyCloseTag": true,
                    "joinContentLines": false,
                    "preserveEmptyContent": false,
                    "preservedNewlines": 2,
                    "enabled": true,
                    "quotations": "doubleQuotes"
                },
                "fileAssociations": [],
                "completion": {
                    "autoCloseTags": true
                },
                "java": {
                    "home": null
                },
                "server": {
                    "vmargs": "-noverify -Xmx1024M -XX:+UseG1GC -XX:+UseStringDeduplication",
                    "workDir": "~/.lsp4xml"
                },
                "validation": {
                    "noGrammar": "hint",
                    "enabled": true,
                    "schema": true
                },
                "symbols": {
                    "enabled": false
                },
                "useCache": true
            }
        }
    },
    "trace": "verbose",
    "workspaceFolders": null
}

The piece of configuration which is interesting for you is:

 "initializationOptions": {
        "settings": {
            "xml": {
                "symbols": {
                    "enabled": false
                }
   

I think there should be a full reference of settings supported by lsp4xml (in this repo and not anywhere else)

I agree with you, but as we (Red Hat) provide vscode-xml (for end user) we spend our time to write good documentation for vscode-xml. But if you wish to contribute to our lsp4xml wiki at https://github.com/angelozerr/lsp4xml/wiki/Configuration please do it

angelozerr avatar Jun 25 '19 12:06 angelozerr

Hi. Sorry to revive this thread but I wish to ask: I am using Lemminx with Neovim - trying to configure some formatting settings, and which documentation site should I use? There are

  • The VSCode-XML documentation: https://github.com/redhat-developer/vscode-xml/blob/main/docs/Formatting.md
  • The eclipse/lemminx documentation: https://github.com/eclipse/lemminx/blob/main/docs/Configuration.md

And these two documentation differs. For example, the VSCode-XML doc says it support changing xml.format.maxLineWidth, but that is not present in this repo's documentation. Or for splitAttributes, VSCode version supports preserve, splitNewLine, or alignWithFirstAttr, whereas in this Repo there seems only to be true/false.

I hope to ask which documentation site should I use if I use Lemminx with Neovim

bhuynhdev avatar Jul 01 '24 14:07 bhuynhdev

And these two documentation differs. For example, the VSCode-XML doc says it support changing xml.format.maxLineWidth, but that is not present in this repo's documentation.

Indeed as we consume LemMinX inside vscode-xml, we have done documentation in vscode-xml, we have badly no time to maintain doc in LemMinx side.

So please use vscode-xml doc.

angelozerr avatar Jul 01 '24 14:07 angelozerr