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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube