News

TypeScript 2.9 Adds Notable Editor Features

TypeScript 2.9 has shipped with several new editor features added along with some language/compiler features.

The open source programming language is primarily developed and maintained by Microsoft, providing a strict syntactical superset of JavaScript with the addition of optional static typing.

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."

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube