The LSP Protocol 4.16 now supports two types of save notifications boolean or SaveOptions:
export interface TextDocumentSyncOptions {
/**
* Open and close notifications are sent to the server. If omitted open
* close notification should not be sent.
*/
openClose?: boolean;
/**
* Change notifications are sent to the server. See
* TextDocumentSyncKind.None, TextDocumentSyncKind.Full and
* TextDocumentSyncKind.Incremental. If omitted it defaults to
* TextDocumentSyncKind.None.
*/
change?: TextDocumentSyncKind;
/**
* If present will save notifications are sent to the server. If omitted
* the notification should not be sent.
*/
willSave?: boolean;
/**
* If present will save wait until requests are sent to the server. If
* omitted the request should not be sent.
*/
willSaveWaitUntil?: boolean;
/**
* If present save notifications are sent to the server. If omitted the
* notification should not be sent.
*/
save?: boolean | SaveOptions;
}
Use a language server implemented with LSP Protocol 4.16, such as pygls;
Initialize the server so spyder can request serve capabilities.
Traceback
File "c:\users\hendr\anaconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\editor\plugin.py", line 318, in register_completion_capabilities
editorstack.register_completion_capabilities(
File "c:\users\hendr\anaconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\editor\widgets\editor.py", line 1845, in register_completion_capabilities
editor.register_completion_capabilities(capabilities)
File "c:\users\hendr\anaconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1176, in register_completion_capabilities
self.save_include_text = sync_options['save']['includeText']
TypeError: 'bool' object is not subscriptable
Description
The LSP Protocol 4.16 now supports two types of save notifications
boolean
orSaveOptions
:See LSP Reference for more details.
Currently spyder only supports
SaveOptions
with:in
spyder/plugins/editor/widgets/codeeditor.py
.What steps will reproduce the problem?
pygls
;Traceback
Versions
Dependencies