Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
imteekay committed Oct 7, 2023
1 parent 60f7430 commit 227adc4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<SmoothRender>

_My notes on the "How TypeScript is integrated in your editor" tech talk by Maria Solano_

---

<iframe
width="100%"
height="315"
src="https://www.youtube.com/embed/ne_UYfDmDYc"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
></iframe>

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.

---

</SmoothRender>
Original file line number Diff line number Diff line change
@@ -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": ""
}
}

0 comments on commit 227adc4

Please sign in to comment.