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

insertTextFormat (and other values) provided as null #39

Open
puremourning opened this issue Apr 20, 2021 · 1 comment
Open

insertTextFormat (and other values) provided as null #39

puremourning opened this issue Apr 20, 2021 · 1 comment

Comments

@puremourning
Copy link

Values in LSP may only be null where explicitly stated in the spec, i.e. with their type including | null.

insertTextFormat has the specification:

	/**
	 * The format of the insert text. The format applies to both the
	 * `insertText` property and the `newText` property of a provided
	 * `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
	 */
	insertTextFormat?: InsertTextFormat;

And therefore may not be null (but may be omitted, hence the ?).

But cmake-language-server returns null for insertTextFormat. this is not valid, and breaks conforming clients.

Example:

2021-04-20 17:32:21,948 - DEBUG - RX: Received message: b'{"id": 3, "jsonrpc": "2.0", "result": {"isIncomplete": false, "items": [{"label": "set", "kind": 3, "detail": null, "documentation": "```cmake\\nset()\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}, {"label": "set_directory_properties", "kind": 3, "detail": null, "documentation": "```cmake\\nset_directory_properties(PROPERTIES prop1 value1 [prop2 value2] ...)\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set_directory_properties", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}, {"label": "set_property", "kind": 3, "detail": null, "documentation": "```cmake\\nset_property(<GLOBAL                      |\\n              DIRECTORY [<dir>]           |\\n              TARGET    [<target1> ...]   |\\n              SOURCE    [<src1> ...]\\n                        [DIRECTORY <dirs> ...] |\\n                        [TARGET_DIRECTORY <targets> ...]\\n              INSTALL   [<file1> ...]     |\\n              TEST      [<test1> ...]     |\\n              CACHE     [<entry1> ...]    >\\n             [APPEND] [APPEND_STRING]\\n             PROPERTY <name> [<value1> ...])\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set_property", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}, {"label": "set_source_files_properties", "kind": 3, "detail": null, "documentation": "```cmake\\nset_source_files_properties(<files> ...\\n                            [DIRECTORY <dirs> ...]\\n                            [TARGET_DIRECTORY <targets> ...]\\n                            PROPERTIES <prop1> <value1>\\n                            [<prop2> <value2>] ...)\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set_source_files_properties", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}, {"label": "set_target_properties", "kind": 3, "detail": null, "documentation": "```cmake\\nset_target_properties(target1 target2 ...\\n                      PROPERTIES prop1 value1\\n                      prop2 value2 ...)\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set_target_properties", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}, {"label": "set_tests_properties", "kind": 3, "detail": null, "documentation": "```cmake\\nset_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)\\n```", "deprecated": false, "preselect": false, "sortText": null, "filterText": null, "insertText": "set_tests_properties", "insertTextFormat": null, "textEdit": null, "additionalTextEdits": null, "commitCharacters": null, "command": null, "data": null}]}}'

I was led to believe that this was fixed in pygls under openlawlibrary/pygls#139

@regen100
Copy link
Owner

Thank you for reporting.
If you tried the PyPI released version, would you please try the latest master? The master requires pygls 0.10, which includes openlawlibrary/pygls#139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants