https://symflower.com/en/company/blog/2022/getting-started-with-visual-studio-code-extension-development/ (30/01/24)
- Ext activation events are command-based, in the past you must specify
"activationEvents": ["onCommand:helloword.helloWorld"]
inpackage.json
, but now that options is built-in. - Use
"activationEvents": ["onStartupFinished"]
, which fires right after VSCode has started. - The more specific Act Events, the better. Less ext to start at once makes VSC faster.
- Some items are Disposables, if you think about it they do get disappeared right instance or after an amount of time.
- LSP decouples dev tooling (servers) and text editors (clients) over a tech-neutral base layer. Don't have to write glue code when targeting editor that supports LSP. Server can be written in any languages.
- LSP runs over RPC, using JSON-RPCv2 protocol. 1 client and 1 server exchange msg (req, res, notification).
- Req = func calls with a given set of arguments, require res.
- Res = return value / error
- Notification ~ Req, do not require res, completely async
- Despite using term client-server, the protocol is bi-dir. The transmission can be WebSockets, raw TCP connections, UNIX domain sockets, easiest to implement, and also in practice, is stdin / stdout.
- LSP defines a set of standard reqs and notis for servers to expose features to clients.