Command System
The extra features are exposed via LSP's workspace/executeCommand
workspace/executeCommand
request, forming a command system. The commands in the system share a name convention.
-
export
export
Fmt
Fmt
. these commands perform export on some document, with a specific format (Fmt
Fmt
), e.g.exportPdf
exportPdf
. -
interactCodeContext({
interactCodeContext({
kind
kind
}[])
}[])
. The code context requests are useful for Editor Frontends to extend some semantic actions. A batch of requests are sent at the same time, to get code context atomically. -
getResources(
getResources(
"path/to/resource/"
"path/to/resource/"
,
,
opts
opts
)
)
. The resources required by Editor Frontends should be arranged in paths. A second arguments can be passed as options to request a resource. This resemebles a restfulPOST
POST
action to LSP, with a url path and a HTTP body, or a RPC with a method name and params.Note you can also hide some commands in list of commands in UI by putting them in
getResources
getResources
command. -
do
do
Xxx
Xxx
. these commands are internally for Editor Frontends, and you'd better not to invoke them directly. You can still invoke them manually, as long as you know what would happen. -
The rest commands are public and tend to be user-friendly.
The code context requests are useful for Editor Frontends to check syntax and semantic the multiple positions. For example an editor frontend can filter some completion list by acquire the code context at current position.