TypeScript and JavaScript support for Sublime's LSP plugin provided through typescript-go (and more specifically the @typescript/native-preview package).
Note
Microsoft plans to merge typescript-go into the main typescript branch at some point. This package will likely follow and get merged into LSP-typescript then.
- Install
LSPandLSP-tsgofrom Package Control. - Restart Sublime.
Open the configuration file using the Command Palette Preferences: LSP-tsgo Settings command or open it from the Sublime menu.
The server supports the following code actions that can be specified in the global lsp_code_actions_on_save setting and run on saving files:
source.fixAll- despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interfacesource.organizeImports- organizes and removes unused importssource.removeUnusedImports- removes unused importssource.sortImports- sorts imports