Real-time co-editing of code in Eclipse

This weekend I ran across a great way to collaboratively work on Salesforce.com code in Eclipse. The Docshare plugin for Eclipse that as part of the Eclipse Communications Framework allows you to collaboratively edit an Eclipse text document with another developer anywhere on the Internet.

DocShare is similar to subEthaEdit, a Mac text editor that allows multiple editors at once. It’s kind of freaky when you first see it, because it breaks one of the fundamental rules of how computers work. Two people can actually edit the document at the exact same time, making different changes, and all of it happening in real-time with very little latency.

There are a couple cool things about DocShare. First, it’s embedded in Eclipse where I already work on my code. Second, it works over XMPP, the Jabber protocol that Google Talk is based on. So, you can share your code with anyone with a Google Talk account. It also works with Skype, IRC, and a number of other protocols.

There is one limitation which makes this hard to use with Salesforce.com code–it doesn’t currently work with the Force.com editors (HTML, Apex). Aparently, it’s not hard to add it to the context menus, but I don’t have the info I’d need to make that work.

Even without working with the Force.com editors, it’s worth checking out.

Setting it up is pretty easy. First, go here to get the update site URL. Install the ECF.

Once you install it, you’ll need to modify your Force.com perspective to show the communications Views and Commands. Once you do that, you can add one of your XMPP accounts:

screenshot

When you do that, you’ll see your list of IM contacts. You now have a full IM client in Eclipse.

screenshot

Ideally, now you’d share your Apex classes. But like I said, you can’t do that yet. So take your class and copy the text.

screenshot

Paste the text into a temporary txt file.

screenshot

Then you’ll have a Share item on your right-click menu in that text file.

screenshot

Pick your friend and share away. If they are logged into Eclipse, they’ll get a pop up asking them if they want to accept your shared file. If they do, you can both start editing! When you’re done, just copy the contents of the text file and put it back in the class.

It’s a great way to do remote code reviews. I’ve used it to get help with an issue today from Matthew in Bellingham–worked very well. And he even fixed my problem while I watched.

So, if any Salesforce.com staff are listening, make the minor changes necessary to have this work with the Force.com editors and you’ve got a killer Dreamforce demo!

Leave a Reply