Vagrant + external editor that actually connects to vagrant?

I’m new to Vagrant and currently I’m using WebStorm. The suggested workflow should be to use your editor while compiling stuff in vagrant. My question is: at what point should I stop and use my own compilers?

WebStorm is cool because it connects to your stuff and do things like REPL and autocompletion based on your code etc.

How does that works if my nodejs interpreter is on the VM? Should I install my own nodejs? If so, what’s the point of having a virtual machine?

Maybe there is a way to tell Webstorm to use the VM interpreter but how?