4 ms·
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
by veidr 5y ago
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).
- brundolf 5y agoThere's also a base LSP package you need, unfortunately, but I think those are all that I needed to get it working If it were up to me Package Control and maybe the generic LSP package would be included out of the box, but LSP-typescript wouldn't be
- veidr 5y agoThanks! 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)."
- tehnub 5y agoWhat 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? [0]: https://www.sublimelinter.com/en/v3.10.10/global_settings.html#delay https://www.sublimelinter.com/en/v3.10.10/global_settings.ht....
- veidr 5y agoMy 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. https://github.com/microsoft/vscode/issues/74798 https://github.com/microsoft/vscode/issues/74798