Closed hpopov closed 1 year ago
Why I cannot use LSP Code actions to create new tasks: because in Code Actions you have no context about existing tasks, which mean, you cannot guarantee, that newly created task will have semantically valid name. The only case is to create tasks with empty name, but I would rather make empty names invalid too (e.g., when I create new task with 'next' Code Action, it creates both a new task and a reference to it from the current one).
I will not be able to use LangiumFormatter (or any other implementation of LSP formatter I guess), because vscode-languageserver-types FormattingOptions
do not suggest a possibility of inserting custom symbols (only whitespaces and newlines). However, the possibility is there -- Langium's AbstractFormatter
returns an array of VSCode TextEdit
, and vscode-languageserver Connection
can register a handle for Document Formatting.
It seems, you can push document edit from LS to LSP client, using Workspace ApplyEdit command from server (i.e. Langium) to client (e.g., VSCode Monaco). Moreover, I think that I should not register custom client-to-server command on the LSP side, but instead use LMS API: since:
I do believe, that Code Actions are invoked programmatically by sending a corresponding action message from LSP client to LS. But since at the moment I decided not to use LSP Code Actions for LMS backward model modification (see Zettelkasten journal for 2023-07-20), I will skip learning them in more depth
Moved LMS Content Assist discovering into a separate subtask: #26
Learn LSP capabilities, such as formatting (how LS changes are propagated back to the editor?), code actions (the API used in Sprotty Server to enable graphical editing), and LSP content assist (used in form of a VSCode-like popup to change cross-references)
This is a preliminary task for #20