I've implemented a language server which provides some linting. The linter checks for required properties and issues 'missing property' errors. I would like to have corresponding 'insert missing property' quickfixes for these errors.
I think the general area of the LSP protocol meant for this is:
With this, the server could return a 'insert missing property' command for a 'missing property' diagnostic marker.
But how does the server implement the 'insert missing property' command itself?
Looking through the lsp spec, I can't find anything that lets the server register commands.
I did find some info about vscode apis for registering commands on the client side here: https://code.visualstudio.com/docs/extensionAPI/vscode-api
So I suppose I could register and implement the 'insert missing properties' on the client side, but...
The client side is only a 'dumb' wrapper delegating most work to the server. As such it doesn't really understand the document structure and isn't a very good place to implement transformations of the document that require understanding that structure.
It seems my best option is to add some 'custom' protocol to my language server so that I can implement the 'insert missing properties' command on the client side, but delegate the hard part of computing the edits for the quickfix back to the server.
Or... is there a better way?