diff --git a/content/notes/how-typescript-is-integrated-in-your-editor/en/index.mdx b/content/notes/how-typescript-is-integrated-in-your-editor/en/index.mdx new file mode 100644 index 00000000..6331e791 --- /dev/null +++ b/content/notes/how-typescript-is-integrated-in-your-editor/en/index.mdx @@ -0,0 +1,50 @@ + + +_My notes on the "How TypeScript is integrated in your editor" tech talk by Maria Solano_ + +--- + + + +When running this code: + +```js +function printGreeting() { + const greeting = 'Hola amigos!'; + console.log(greeting); +} +``` + +- There's a lightbulb after the `greeting` variable declaration +- How the items get displayed when clicking on it? +- How this experience is uniform across editor? + +## Trigger Event + +- The cursor is in a spot where a code fix (or refactoring) can be applied. +- Manually invoked (via a key binding) + +Handling the trigger event + +- The editor records the position (line and column) +- The editor records the content type + +In visual studio code you can use the LSP (Language Server Protocol). But it can also be done by hooking up an extension to the code action like ESLint. + +## TSServer: The language server + +A node executable that encapsulates the TypeScript compiler and language services and exposes them through a JSON protocol. + +Isn't this just `tsc`? No, TSServer isn't resposible for compilation. + +--- + + diff --git a/content/notes/how-typescript-is-integrated-in-your-editor/en/metadata.json b/content/notes/how-typescript-is-integrated-in-your-editor/en/metadata.json new file mode 100644 index 00000000..babc15bf --- /dev/null +++ b/content/notes/how-typescript-is-integrated-in-your-editor/en/metadata.json @@ -0,0 +1,19 @@ +{ + "title": "How TypeScript is integrated in your editor", + "description": "Notes: How TypeScript is integrated in your editor", + "date": "2023-10-07", + "tags": [ + { + "href": "/tags/web-performance", + "name": "webperf" + } + ], + "coverImage": { + "src": "/notes/starting-a-dedicated-web-performance-team.png", + "width": "640", + "height": "334", + "alt": "The cover of sarah's talk", + "authorHref": "", + "authorName": "" + } +}