Language Server Shenanigans—Glint, LSP, TSServer, and the VS Code extension
Channel: Sympolymathesy by Chris Krycho
Date: 2023-10-19

Chris Krycho and Dan Freeman finish their tour of Glint, showing how the VS Code extension (and others like it) invoke the Glint language server and through it the #TypeScript language server ("tsserver").

The series:
1: https://www.youtube.com/watch?v=MLpP8D3cY7M&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=1
2: https://www.youtube.com/watch?v=Xhv1jAV5cZI&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=2
3: https://www.youtube.com/watch?v=6-TWGx8j9RU&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=3
4: https://www.youtube.com/watch?v=9RjaREOmFAA&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=4
5: https://www.youtube.com/watch?v=oqIAyLbp6Rc&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=5
6: https://www.youtube.com/watch?v=VUXROd82Ljk&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=6

• Language Server Protocol: https://microsoft.github.io/language-server-protocol/
• TypeScript LSP: https://github.com/typescript-language-server/typescript-language-server
• Tracking issue for switching TS to LSP: https://github.com/microsoft/TypeScript/issues/39459#issuecomment-696179304
• rust-analyzer: https://rust-analyzer.github.io
• ocaml-lsp: https://github.com/ocaml/ocaml-lsp

00:00 Intro
02:28 The VS Code Extension
08:22 Which TS and Glint version do we use?
11:22 Finding the right language server
12:39 Making the language client debuggable
13:38 Modularity, performance, and bundling
16:04 Basic wiring for Glint's language server
18:21 A pool of language servers
22:12 Diagnostics in the CLI vs. the LS
27:27 Actually wiring up LSP hooks
32:23 LanguageServerPool
36:28 Handling Diagnostics, and the “problems” view
38:45 GlintLanguageServer and mapping between servers
47:00 How "findSymbols" works
49:54 How "getCompletions" works
58:02 A rant about good commit messages
59:14 Finishing up "getCompletions"
01:02:14 CodeAction: "insertGlintIgnore"
01:05:08 CLI vs. LSP vs. editor extension
01:08:42 Versioning the VS Code extension
01:09:46 That’s it!