Accessing the language services API

The language services API is built on top of the core compiler APIs, and it was designed to provide software engineers with a great developer experience independent of their IDE or code editor of choice.

We are going to use ts-simple-ast to access the language services API. We can access the language services API using the getLanguageService method in an AST instance:

myAst.getLanguageService(); 

The language services API implements methods that allow us to perform a common editing task, such as renaming a variable or automatically implementing an interface. The following screenshot shows some of the available methods in the language services API:

We are now going to create a very small application that ...

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.