How to get typescript syntax highlight working in sublime 4
Asked Answered
D

1

6

On sublime 3 I prevously always just used the package control to install the typescript plugin, which would generally pick up on the tsconfig.json file and automatically start showing me syntax and type errors in code.

However since sublime 4 it seems the plugin is no longer available and I can't find a way to get syntax highlighting working at all. Sublime 4 doesn't show anything for typescript. How can I get this working?

Below is what I see. 3 packages. The normal typescript one that's usually there, written by microsoft, no longer shows up on that list. The other packages there are like 7 years old and not the one that should normally be there.

What I see

https://forum.sublimetext.com/t/sublime-4-doesnt-show-ts-errors/57641/5

There is another link I found before where they say sublime is supposed to support it out of the box now, but it does not at all, nothing about typescript syntax or errors works in sublime 4, at least not out of the box.

https://github.com/sublimelsp/LSP-typescript#installation, there they also say it's supposed to support it out of the box.

Dunghill answered 2/7, 2022 at 17:24 Comment(4)
Have you tried this plugin ?Countercharge
Please be clearer about your previous researches ..Countercharge
Edited the question to add it. The package you link to there is the one I expect to see in the list, but it doesn't show up any more since sublime 4.Dunghill
I installed it into packages folder, not via packages control and it works.Cawnpore
P
3

To use the plugin in sublime text 4, you somehow have to manually clone the repo into your Sublime plugin folder. For example, in Mac:

cd ~/Library/Application\ Support/Sublime\ Text/Packages
git clone --depth 1 https://github.com/Microsoft/TypeScript-Sublime-Plugin.git TypeScript

And this works for me!

See https://packagecontrol.io/packages/TypeScript Installation section for more information.

Pretor answered 13/3, 2023 at 15:39 Comment(1)
Actually this package is deprecated on purpose for Sublime Text 4, see github.com/microsoft/TypeScript-Sublime-Plugin/issues/786Mccarley

© 2022 - 2024 — McMap. All rights reserved.