![]() Once again, the only reason we took these steps was because the TypeScript service was very young and didn’t have the functionality we wanted. We worked out that we could extend the TypeScript Language Service’s functionality and provide several more commands that we can use in the IDE, such as compiling and other similar actions. In the end, we decided to extend the API on the service side with our own commands to supplement the limited number of native commands you were able to use to communicate with the language service. The TypeScript Language Service API was highly restrictive and had a small API surface, as the TypeScript team had only really just started working on it. Eventually, they introduced the TypeScript Language Service, which is like an API that any editor can use to integrate with the TypeScript compiler and get information from it. ![]() Then the TypeScript team recognized that they needed some kind of TypeScript support inside their IDEs (they were working on VS Code at the time). We ignored the compilation result but did use it to provide error highlighting and some other useful stuff. To start with, I just implemented a kind of host that communicated with the TypeScript compiler directly and sent the information to WebStorm. It was at this moment that I started working on TypeScript support for WebStorm. This was around 2013.Īt some point, we recognized that TypeScript was going to be something big, and we needed to ensure better integration with it. It was okay at the time because we had similar functionality for other languages like CoffeeScript. In most cases, it would just compile the file and provide any errors. The first version of our TypeScript integration just ran the TypeScript compiler under the hood for the current file. WebStorm has a long history of supporting TypeScript, which all started with the File Watchers plugin. TypeScript Language Service, what are the essential differences? Indeed, many ideas from the TypeScript LS were taken into consideration when LSP was designed. You can think of it as an ancestor of LSP. The TypeScript Language Service is close to the LSP specification, only with several minor tweaks. ![]() This means you end up with all the errors for a single file, code completion for an exact position in the code, and lots of other useful things. Meanwhile, the TypeScript Language Service is a layer over the compiler that provides a way to communicate with it and get extended information about the project. The TypeScript compiler transpiles TypeScript files to plain JavaScript and enumerates the corresponding errors. To set the stage, can you help me distinguish between the TypeScript Language Server and the TypeScript compiler? Relax into this fireside chat with WebStorm lead developer and Team Lead, Andrey Starovoyt, as we pull back the curtain on TypeScript’s integration in WebStorm. Ever tense up when a new TypeScript version drops? You cross your fingers and hope it plays nice with your IDE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |