I bought Sublime Text through v3 but didn't really use it anymore, so declined to buy v4 (so far).
It's interesting you mention LSP support, because that is basically why I stopped using it — the as-you-type auto-completion, error/warning highlighting, and doc/reminder/hint functionality was sorely lacking (compared to leading non-native editors like VS Code / Jetbrains).
I just fired up Sublime Text 4 and opened a vanilla Angular project to try the TypeScript support.
const foo = new Hoge();
foo.titleId = 69;
Unfortunately, while it did offer to autocomplete the titleId property, that property is from a completely unrelated class to Hoge that isn't imported in the current file (but I can see in the hover popup where it Sublime is getting the definition), and also that property is a string, but Sublime lets me go ahead and assign a number to the property without flagging it as an error.
To me, these basic features are table stakes for an editor in 2022, and should hopefully "just work" if you open a TypeScript file. But are you saying these features can now be made to work in Sublime (perhaps with some configuration, or something)?
There was a lot I liked about Sublime back in the day, but I felt like it just failed to keep up with the basic-level state of the art for a code editor. I'd be happy to find that I'm wrong about that, though.
You need to install a couple extensions and then it works well enough. It could be a slightly smoother process, but I think it's reasonable. Even in VSCode you have to install and configure plugins for all non-TypeScript languages; TS gets special support because Microsoft wants it to. Sublime is unopinionated.
(I still use VSCode myself, but I don't think your criticism was being fair to Sublime)
Cool. Not really trying to criticize it; just noticing that it doesn't work out of the box, and I personally have never had the time to fiddle with it to see if it can be made to work.
However, since we are in the thread I googled it with duckduckgo.com, and then followed the top blog post results, which involved:
- install "Package Control"
- use that to install Package → LSP-typescript
- restarted Sublime Text 4 (just in case)
But it still didn't work.
(For any reasonable value of "work"... I mean it didn't highlight errors in TypeScript as a typed them, and "go to definition" didn't jump to the correct definition, but rather offered me a list of every place in the project where a symbol with that name was defined (including the correct one, but also several incorrect ones).)
So, maybe I'm doing it wrong, or maybe it doesn't work.
I'd love to be wrong, though, and see an example (blog post, youtube, whatever) of Sublime working for TypeScript development with all/most of what VS Code offers out of the box (even if it involves some configuration steps).
Thanks! Indeed the blog post omitted that step, probably since they already had it installed or something.
Once I installed the base LSP package, and restarted Sublime, then it gave me an error[1] at startup, explaining that it couldn't initialize the LSP for TypeScript. The error message included a button to fix it.
After that, yeah, it works a lot better! Jump to definition works, and the as-you-type errors I mentioned before now do appear. Also, the auto-complete list looks fairly sane, without all the "random guesses from all the text in this project" entries it had before.
So... not bad! At a glance I think it is still probably not as good a VS Code, but it might be usable. I will give it a closer look later.
[1] The error was: "Could not start LSP-typescript due to not being able to find Node.js runtime on the PATH. Press the "Install Node.js" button to install Node.js automatically (note that it will be installed locally for LSP and will not affect your system otherwise)."
What are your thoughts on as-you-type errors? I personally don't like seeing errors on every keystroke, so in sublime, I set the lint mode to "background" and set the "delay" [0] to 2 or 3 seconds. Do you know if such a thing is possible in vscode?
My own thoughts on it are that yes, that is definitely something that should be user-controllable, but as far as I know it's not possible in VS Code. I remember the old issue below, which was closed without actually fixing that.
Personally, though, I've learned to live with it, so it no longer bothers me, except in principle. ;-)
I'd much rather have annoyingly-instant error highlighting than missing or incomplete error highlighting. It will look good once I've finished the code.
It's interesting you mention LSP support, because that is basically why I stopped using it — the as-you-type auto-completion, error/warning highlighting, and doc/reminder/hint functionality was sorely lacking (compared to leading non-native editors like VS Code / Jetbrains).
I just fired up Sublime Text 4 and opened a vanilla Angular project to try the TypeScript support.
Unfortunately, while it did offer to autocomplete the titleId property, that property is from a completely unrelated class to Hoge that isn't imported in the current file (but I can see in the hover popup where it Sublime is getting the definition), and also that property is a string, but Sublime lets me go ahead and assign a number to the property without flagging it as an error.To me, these basic features are table stakes for an editor in 2022, and should hopefully "just work" if you open a TypeScript file. But are you saying these features can now be made to work in Sublime (perhaps with some configuration, or something)?
There was a lot I liked about Sublime back in the day, but I felt like it just failed to keep up with the basic-level state of the art for a code editor. I'd be happy to find that I'm wrong about that, though.