I don't know if that functionality is built into Eclipse, but I doubt it. I think you would have to write some custom code to do it.
What you're describing would have nothing to do with MODX, since MODX wouldn't even need to be running. It would depend entirely on the editor.
For snippets and plugins, BTW, you can have the code in files and use something like this for the snippet or plugin code:
return include "path/to/file"
Then you could use any editor to edit the files.