- TypeScript
- Advanced TypeScript and JavaScript language support for Nova
- 52926 Installs
-
This extension is allowed to:
- Read & Write Files
- Launch Subprocesses
Readme
TypeScript Extension
This extension provides rich TypeScript integration through a dedicated language server for both TypeScript and javascript code. Hover over symbols to see type information, receive better autocomplete suggestions, and see type warnings and errors inline. Quickly search for symbols across your project and type dependencies using the "Find Symbol" command. Apply common code refactors such with code actions. Clean your code with import organization and document formatting.
Usage
Editor functionality
The main functionality is found inline in the editor.
Inline errors
Inline errors can also be found in the Issues sidebar (View > Sidebars > Show Issues Sidebar).
Type info on hover
Editor commands
Right click source code and choose the following from the TypeScript menu.
- Find References
- Rename Symbol
- Organize Imports
- Format Document
- Offer Suggestions (experimental)
Workspace commands
From the menu, select Extensions > TypeScript.
- Find Symbol
Code actions
From the menu, select Editor > Show Code Actions, or click the "Lightbulb" icon in your editor.
These code actions are specific to your version of typescript and to the code you've selected. Here's an example to convert to optional chaining.
Sidebar
The TS/JS sidebar shows status information about the extension including the version of typescript it's using and if it's started successfully. To access the sidebar, click the “All Sidebars” button or View > Sidebars > Show All Sidebars, then the TS/JS item. It can be dragged into the sidebar header for quick access.
Find Symbol
Find Symbol performs a project search for a symbol. Results are shown in the TS/JS sidebar.
Find References
Find References shows all usages of a given variable, function, or other symbol. Results are shown in the TS/JS sidebar.
Using the workspace version of TypeScript
This extension will automatically find the workspace version of TypeScript installed under node_modules
in your workspace root. If one isn't installed it will use a recent, bundled version of typescript.
To customize this you can specify the TypeScript library location in workspace preferences (Extensions > TypeScript > Preferences > TypeScript Library) as an absolute or workspace-relative path. This should point to a directory containing the TypeScript tsserver.js
file, generally ending with node_modules/typescript/lib
. If installed globally, you can find the installation location using npm list -g typescript
(e.g. "/usr/local/lib/node_modules/typescript/lib"). (You should only need this if your workspace doesn't install typescript under the workspace's root node_modules
directory or you use a global installation of TypeScript)
Enable/Disable for Javascript
In certain situations, such as when working with Flow types, you may need to disable this in javascript files. You can do this by configuring preferences per-project in Project Settings or globally in the Extension Library.
Troubleshooting
Many issues are caused by a missing or improperly configured local node/npm installation.
Check the Extension Console by turning on extension development in Nova in Preferences > General > Extension Development, then Extensions > Show Extension Console, then filter by Source.
- Check for any warnings or errors. They might indicate a problem with your local environment or a bug with the extension.
- If you see
activating... Already locked
and do not seeactivated
something may have gone wrong. Try running the "Force Unlock Dependency Installation" command for this extension.
Changelog
Changelog
v2.6.0
Added
- Upgrade to TypeScript 4.9
- Add additional configuration option support
- Upgrade underlying
typescript-language-server
from v0.11.0 to v3.0.2 (changelog) - Config option to prevent deleting unused imports when auto-organizing imports
Changed
- When search results are ready, display a notification instead of an alert.
v2.5.0
- Upgrade to TypeScript 4.7
- Add additional configuration option support
- Add partial support for new file types:
.cts
and.d.cts
(CommonJS modules) and.mts
and.d.mts
(ES modules) - Upgrade underlying
typescript-language-server
from v0.5.4 to v0.11.0 (changelog)
v2.4.0
Added
tsserver
user preferences- Extension development debug preferences
Fixed
- Fix failure to dispose handlers on subsequent extension reloads
- Fix false-positive detection of server crashes
- Language server timeout crashes (via https://github.com/theia-ide/typescript-language-server/pull/189)
v2.3.0
Added
- Pre-populate Rename Symbol palette with current value (#133)
v2.2.0
Added
- "Format Document" command
Fixed
- Configure correct formatting before organizing imports
Changed
- Upgrade bundled TypeScript
v2.1.1
Changed
- Update bundled language server with crash fix
v2.1.0
Added
- "Organize Imports" command
- Global/workspace preference to automatically organize imports on save
Changed
- Upgrade bundled TypeScript
v2.0.1
Fixed
- Handle language server crashes more gracefully
v2.0.0
Fixed
- Fix paths cleaning in search results sidebar
Breaking
- Remove functionality now supplied by Nova directly (Go to Definition, Code Action, Offer Suggestions)
v1.8.2
Fixed
- Fix bad bundled dependency location
v1.8.1
Fixed
- Fix issue with dependency installation locking during failures
v1.8.0
Changed
- Major behind the scene changes to dependency management
- Performance improvements
- More reliability with multiple open workspaces
Fixed
- Use full completion result in manual auto-suggest command
v1.7.0
Added
- Support disabling processing on javascript files
Fixed
- Display global tsserver path configuration in UI
Changed
- Display error message with more details when activation fails
- Documentation updates
v1.6.2
Changed
- Removed stub language syntax
- When using bundled TypeScript, don't emit npm update checks
v1.6.1
Changed
- Remove confirmation/documentation message from "Offer Suggestions"
v1.6.0
Added
- Add "Find References" command
- Add experimental "Offer Suggestions" command
Changed
- Auto activates in javascript workspaces
- Search results now opened by double clicking instead of selecting
- Find Symbol now uses builtin nova images for types of symbols
- Search results UI cleanup
Fixed
- Properly dispose of more resources when extension reloads
v1.5.3
Changed
- Add extension to "Completions" category
Fixed
- Fix error message when symbol can't be found
- Fix async startup failures not being logged
v1.5.2
Mistakenly released from dev branch.
v1.5.1
Changed
- Emit install errors in dev console
- Upgrade bundled typescript
- Add mock typescript syntax (https://dev.panic.com/panic/nova-issues/-/issues/1454)
v1.5.0
Changed
- Improve documentation in readme and throughout extension
- Sidebar "refresh" button now restarts language server
Added
- Custom TypeScript library location support (now actually works!)
- Preference type changed to string
- Relative path support
- Auto-restart on preference change
v1.4.2
Changed
- Upgrade bundled version of TypeScript to 3.9
v1.4.1
Changed
- New sidebar icons from Sam Gwilym
v1.4.0
Added
- Add images to sidebar
Changed
- Dev functionality and error handling
v1.3.0
Added
- Show "Go to Definition" results in sidebar for multiple results
Fixed
- Allow "Code Actions" and "Go to Definition" when editor doesn't have focus.
v1.2.1
Fixed
- Fix tsx/jsx language support
v1.2.0
Added
- Display active TypeScript version to sidebar
- Improved "Find Symbol" sidebar UI
- Extension falls back to it's own installation of TypeScript
Fixed
- Fewer warnings about misconfigured TypeScript
Changed
- Configuration for custom TypeScript installation has changed
- Language server isn't bundled with published extension
v1.1.0
Added
- "Find Symbol" command and sidebar
- "Code Actions" editor command
- Support for language server driven edits
Fixed
- Cleaner deactivation logic
v1.0.1
Fixed
- Fix issue preventing language server startup when installed from extension library
v1.0.0
Initial release
- Language Server support
- Custom TypeScript installation support
- "Go to Definition" editor command
- "Rename" editor command