Proper autocomplete is the one thing I’m missing in Sublime Text
I’ve tried Tern.js Meteor for Sublime Text 3 a couple of times over the year, and every time I’ve had issues with it crashing and given up on it. I thought it might be abandoned, but it seems people are still using it, so it must be working for them.
Every time I start typing something and it tries to autocomplete it, I get this:
Failed to start server:
fs.js:439
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EMFILE, too many open files '/home/simon/.config/sublime-text-3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/defs/ecma5.json'
at Object.fs.openSync (fs.js:439:18)
at Object.fs.readFileSync (fs.js:290:15)
at readJSON (/home/simon/.config/sublime-text-3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:72:17)
at findDefs (/home/simon/.config/sublime-text-3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:126:26)
at startServer (/home/simon/.config/sublime-text-3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:241:14)
at Object.<anonymous> (/home/simon/.config/sublime-text-3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:232:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
It’s apprantly a Node error, where it reaches the system limit on how many files it can read at once. Some have suggested typing ulimit -n 2048 in the command line to change the global limit, but that did nothing for me.
I’ve also tried SublimeCodeIntel, but haven’t managed to get it to work consistently either, it mostly seems to fail scanning the js files of my packages.
Are any of you managed to get code completion working? How did you do it?
I tried regular non-meteor TernJS now. It’s not great at picking up dependencies, but at least it works without crashing. It doesn’t understand import, but require() works. And it has definitions for underscore built in.
Maybe getting autocompletion to really work properly will take more time than it would save
(Btw, it’s not about saving keystrokes, it’s about having to check less documentation, because you get quick reminders right in the editor)
Maybe not particularly helpful to your original question, but I switched from Sublime to VS Code and have never looked back. I installed Meteor, Meteor snippets and MeteorHelper from the extension library. There’s also a Sublime keymappings extension if your muscle memory is deeply embedded.
As a bonus, the Git and ESLint built-in integrations are awesome.
But that is just predefined completions right? Can it scan and understand your code too? That’s what IntelliSense is supposed to do, right? But I read somewhere that it didn’t work with Javascript?
GitSavvy for Sublime Text is really good, with line by line commit/discard and everything, so in terms of git integration I’m good I think.
In what way is the ESLint integration awesome? Does it do more than mark errors?
Very impressed with VS Code so far. The Git integration is very slick! Only issue now is that multi-cursors is bound to Alt instead of Ctrl, and there seems to be no way to change it
I guess I could relearn, but for some reason on my Linux Mint installation, Alt doesn’t work in applications…
Which reminds me: Were you able to use the breakpoint feature for debugging? Because sticking debugger; everywhere always triggers a rebuild/ reload which makes it a bit cumbersome.
When I tried to use VSCode’s features for that I always got the grey circle which means that the source code couldn’t be mapped.
I loved VS Code, but switched to WebStorm a while ago and never looked back. The inspection features are just awesome.
Some years ago, I gave it a pass, because it was too slow. But on modern hardware, it feels just right. It has some UX quirks, though.
(The only thing I am missing is proper support for all Meteor package imports. Some packages are recognized, while others aren’t. Which means that I get warnings about missing packages that are actually there.)