Question

Now before you shoot me for bringing up a duplicate question on SOF, let me first acquaint you with exactly what I'm looking for, and I will address other questions and answers and why it is insufficient.

Question #1:

I'm looking for a way to perform live collaborative edits, while the source is maintained on a centralized source control server. For example, if Me and Joe Blow are editing file X.cs at the same time, we should be able to see each-other's edits as we type. Almost as if we were sitting together at the same computer. Now take the following scenario: Me and Joe go offline, and Nimha Smith decides she wants to update some code. When I come back online the following day, I get pushed the code that Nimha updated while I was sleeping/away from the server.

This is a combination of the idea of live collaboration, and a source control system like SVN, etc.

Addressing of the possible duplicates:

There was a similar question, here: Collaborative editing for .NET development - what are the possibilities, however it does not give me anything useful and I'll explain why:

  • VsAnywhere: It runs through a central public server (right direction..?) except all parties involved need to have the exact same code on their machine before joining a session, and once you go offline the session is destroyed.
  • SourceMeet: Runs with a P2P system, so no server to keep track of changes while offline etc. Have not tried it, so I can not attest to how well it can merge code (if it can at all)
  • CollabEdit: Not VisualStudio
  • Cloud 9: Not VisualStudio

And there is obviously this question and this one that are questions directly about source control software such as SVN or GIT. Now, I tried to get VSAnywhere and SVN to play nice together, (SVN for getting changes made while offline, and VSAnywhere for the online developers) but it simply does not work.

<edit>

I recently found this bachelor thesis project named Collab, and it seems like a good idea, but I could not seem to get it working to try it. If anyone else has any success with it please let me know what you did. It looks like if I can get this collab project working it seems like it would be a good start into creating something to fit my needs.

<edit2>

I've also come across BeWeeVee which had a Visual Studio extension for it's service, but all the links for it have gone dead. And CodeALike which was probably their replacement for VS real-time collaboration has a FAQ entry explaining that it's real-time features have been removed and will be re-implemented in the "future".

Question #2:

Now this brings me to the second part of my question because I fully realise there may not be a program out there that fits my tall order. Where could I start implementing software such as this myself? Are there some existing open-source source-control / real-time editing code that I can begin to build off of to create this? Or am I pretty much stuck starting from scratch if I want to implement this. And I'm sure you can see by the tags that I would like to tackle a task like this in C#, if I have to tackle it at all.

Update 2017

As there has been some continued interest expressed in the comments I've created a gitter where we can gather anyone interested and potentially make this a reality: https://gitter.im/sof-centrailized-collab-editing/Lobby.

Was it helpful?

Solution

If you want to tackle this yourself, you might like to do it as a Visual Studio extension. Notice that there are two different types of plug-ins: “add-ons” and “extensions”. Personally I think you should write an extension, but either way, you can write them in C#.

You will need to hook into Visual Studio’s text editor. You could either google for how to do this, or just look at an existing example: a Visual Studio extension for elastic tabstops. Your extension will have to monitor your changes as you make them and then send them to the server via some protocol you design. You’ll have to write the server yourself, but in the first version all it needs to be able to do is just send your edits to everyone else who is using the extension. The extension would then make everyone’s edit in everyone else’s editor.

If someone connects to the server with an older version of the code, the extension could just download the newest version from the server. However, if the user has made edits while offline (i.e. while not connected to the server), then you will need to do some clever merging. This is non-trivial, but I know how to do it because I’ve done it before. If you ask very nicely, I’ll write the merge algorithm for you. Then you’ll only need to feed it three text files: the base (the version that was last in sync with the server) and the two edited versions (the one edited offline and the newest from the server).

If you manage to get this to work, you will potentially create something invaluably useful. Please do make sure that you publicise your work! :)

OTHER TIPS

Well, to see other people type stuff and then have cursor wars with them in the editor has already been done by Google Wave. Iirc it got pushed out as open source or something after the project itself failed. It does take care of all your update issues though, and is built on an underlying update model that is quite robust and solid from a computer science perspective. It provides history and all kinds of things analogous to a source code system.

You could implement what you want as a special editing widget on top of that. If you do a good job you can resurrect Google Wave as a useful and re purposed collaborative editing platform.

About VS Anywhere, probably, to the time you tried VSA, (around May), Software version was Release Candidate 2 (=buggy), so its normal you found some problems with SVN Integration as well as we had open issues with TFS and Git.

Currently, on latest RC3 some of those SVN problems has been solved, we expect to have everything ready for final version soon

There is a possibility to run your own VS Anywhere Server instance in your LAN, so you really do not need to use our Public Servers, if you are a Student or you have a Open Source Project, VS Anywhere Client and Server is Free for you, if not is for commercial use and there is a small fee you should pay.

As stated by Timwi resynchronisation from offline coding is non-trivial and really complex to implement, we think a SCM is the right tool to do this work and this is because we do not yet worked in this direction, our opinion is at least until we work on this area, you can use standard SCMs to pull latest changes and merge with your local copy before setup a session

VSA will simplify the process to bootstrap the sessions, allowing you to 1) check the differences from remote Visual Studio copies and 2) if any, merge them in your local copy to be in the right state, just when opening the session. ("1)" is implemented "2)" is coming)

Session management is not trivial and really complex stuff, there are lots of possible scenarios and this is because we cleanup the session when finish, however you can start the session again at any time with just one click...

Hope this information helps you and if you have more question feel free to contact VS Anywhere Support anytime

About If you want to begin a project to implement such plugin we can offer you information on how to do things, a nice starting point is to understand Operational Transformation as you will need this approach to implement concurrent editing, also you will need a P2P or Client/Server protocol to transfer data between clients.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top