Sublime Forum

Sublime 4: Doesn't show TS errors

#1

Sublime 4 doesn’t underlines the TS error code in red

0 Likes

Typescript autocomplete bug
#2

Sublime Text is only a text editor. You’d either require a linter package or LSP to do something like that.

1 Like

#4

It’s strange. I saw news where said that now it supports TS. And I’m as developer just want to download app and start using it. It’s really annoying that I need to spend time for that. If it doesn’t show TS errors then it doesn’t support TS for me. In 2021 text editor for developers can’t spend developer time for dev environment setting. It must work out of the box.

I installed LSP and LSP-typescript. And nothing happen. It doenst work. LSP docs page give link to github page of LSP-typescript for installing instructions. But there is no info about setup.

So know I’m as regular developer spent 30 min of my time and after that I can’t get it work. And you think that it’s okay?

0 Likes

#5

It supports JSX, TypeScript & TS syntax out of the box. So you get the syntax highlighting without installing anything additional.

I am not a regular LSP user so if you can post details of what’s not working etc, someone may eventually answer.

Well, I really have no answer to that. If your looking for smart IDE like completions out of the box (the AC system in ST4 has gotten pretty good than ST3 but not to an LSP level) and frustrated
with how ST doesn’t provide everything out of the box, maybe ST is not the right tool for you

0 Likes

#7

I don’t want to use VS Code because it uses Electron and web for rendering. It uses a lot of ram and not so fast. Sublime without electronjs works really fast . Webstorm is too heavy.

So ideally I wanted to get Sublime but with build in functionality for web dev. Eslint, Prettier, TS, Code error highlight and so on. Sublime 4 could be cool but again nothing works out of the box. Saad! ))

0 Likes

#8

Feel free to join the official discord server, though. There is a dedicated lsp channel where the maintainers usually help out if you have hiccups in setting up LSP & LSP helper packages (if something is confusing in the docs or not working as you might expect)

0 Likes

#10

Thank you. :slightly_smiling_face:

0 Likes

#11

I’ll throw an answer in here to help other folks:

I had ST3, lots of TypeScript coding. I was using the plugins. Syntax and errors were showing up as expected.

Upgraded to ST4. Deleted all my TS plugins, as I saw “TS is supported in ST4”. Ok… but, no. I had absolutely plain white files.

Ohhhh, ok, close all files in the project, restart ST4, open files, syntax coloring is back. How about error checking? No, nothing.

Reinstall just the “typescript” plugin. Error checking is back.

So my current state is: ST4, with just the “typescript” plug in, and syntax and error checking is working. Good luck out there!

Side note: would LSP and LSP-typescript also do that, but differently? I have no idea. It would be great to see a writeup somewhere of “there are X ways to do this and here’s how you pick what fits your flow best”.

0 Likes

#12

The support for TypeScript that ships by default includes a syntax definition, which is superior to the one that ships with the Microsoft TypeScript plugin which uses the older, less feature filled and less performant tmLanguage syntax specification.

With the syntax also comes the integration with Sublime’s built in functionality for symbol navigation and the like. What it doesn’t contain (because Sublime doesn’t provide that functionality in the core) is the sort of code intelligence/code linting/code formatting functionality you might be expecting.

In case you want that, your best bet is to steer clear of the Typescript package from Microsoft and install LSP instead and the associated TypeScript server, which is the same one that’s used by VSC and which provides that functionality.

LSP uses the new enhancements that ST4 has added to provide a much better experience than the Microsoft TypeScript package does.

2 Likes

#13

I believe you need to install sublimelinter package and sublimelinter-eslint for that. Be sure to also have nodejs installed on the computer.

0 Likes

#14

Maybe you must enable the package after installation of LSP and LSP-Typescript :
Go to Menu > Tools > LSP : maybe all is disabled, it’s normal, Open the Package Control, and choose Enable Package, here you’ll see the installed but not enabled package(s), like LSP-Typescript : then validate and check if errors detection and other features work.

0 Likes

#15

@OdatNurd Do you know why LSP-TypeScript is labeled as only working for ST3 in PackageControl?

lsp-typescript-st3

I must’ve looked at it 10 times and ignored it because I thought it wouldn’t be compatible with ST4.

0 Likes

#16

With some rare exceptions (of which I cannot think of any examples at the moment so that might just be theoretical) anything that works in ST3 should also work in ST4 ; you may see something mark itself as only working in ST4 if it specifically takes advantage of a feature that is not available in previous versions.

The display in package control is more specifying a minimum version requirement than a specific version alignment.

The only hard specifics that sit there are platform requirements; assume all platforms are supported unless it specifically says a platform or platforms, in which case it is only supported on those specific platforms.

0 Likes