TypeScript 2.9 Adds Notable Editor Features
TypeScript 2.9 has shipped with several new editor features added along with some language/compiler features.
While TypeScript 2.8, which shipped in March, was known for its addition of support for conditional types, v2.9 adds some interesting editor features. The language figures prominently in many editors including Visual Studio, Sublime Text, Eclipse and especially Visual Studio Code, which just came out in a May update -- version 1.24 -- that supports TypeScript 2.9.
New editor features added to v2.9 include:
- Rename file and move declaration to new file: This was implemented in response to "much community demand," Daniel Rosenwasser, Microsoft's program manager for TypeScript, said in a blog post last week. The new feature enables moving declarations to their own new files along with the ability to rename files while at the same time updating import paths. Rosenwasser said the functionality might not be implemented in all editors immediately but should soon be propagated broadly.
- Unused span reporting: With this feature, declared but unused spans that typically generate errors can now be manifested as "unused" suggestion spans. For example, VS Code displays them as grayed-out test. Other editors may handle them differently.
- Convert property to getter/setter: This editor feature comes courtesy of community developer Wenlu Wang, providing support to easily convert properties to get- and set- accessors.
While Rosenwasser said that while new editor features are often more applicable to users, v2.9 also includes many notable core language/compiler features -- some causing breaking changes that developers have complained about -- including:
Going forward, Rosenwasser said TypeScript 3.0 will feature "an experience around project-to-project references, a new unknown type, a stricter any type, and more." These and other planned features can be seen in the TypeScript Roadmap. Meanwhile, features requested and implemented -- or not -- can be seen on this GitHub issues site. There, the most-commented issue is a 2014 post calling for the language to "Support some non-structural (nominal) type matching."
David Ramel is the editor of Visual Studio Magazine.