nosami/OmniSharpServer — pull request #16 by sp3ctum (2013-07-13 21:25:31+00:00)
Title: Add feature: complete method overrides

I hacked together an implementation of having the OmniSharp server
complete superclasses' overrideable members (methods / properties /
events) with a skeleton member in the currently open buffer.

Here is a use case:

* The user sends an AutoCompleteRequest to an API called
/getoverridetargets.

* The API responds with GetOverrideTargetsResponses.
Each member currently contains only one field called
OverrideTargetName. This is a string representation of the
signature of the member to override.

Here is an example from
OmniSharp.AutoComplete.Overrides.RunOverrideTargetModule:

```csharp
public virtual bool Equals (object obj);
public virtual int GetHashCode ();
public virtual string ToString ();
public virtual System.Collections.Generic.IEnumerable Routes {
get;
}

public virtual Request Request {
get;
set;
}

public virtual Nancy.Validation.ModelValidationResult ModelValidationResult {
get;
set;
}
```

* The editor shows the returned member signatures to the user.

* The user selects one of the signatures to override.

* The editor posts the selected string in its entirety to the API
/runoverridetarget wrapped in a RunOverrideTargetRequest
class.

* The API responds with the new contents for the buffer, as well as
the new editor cursor position.

Examples from
OmniSharp.AutoComplete.Overrides.RunOverrideTargetModule:

```csharp
public override System.Collections.Generic.IEnumerable Routes {
get {
throw new System.NotImplementedException();
}
}

public override bool Equals(object obj) {
throw new System.NotImplementedException();
}
```

Note that the types depend on the current context; more
specifically its using directives.

* The editor replaces the buffer's contents with the ones from the API.

* The editor sets the cursor position to the one from the API.

----------------------------------------------------------------------

Mostly everything works, but there are a few things I'd like to get
cleared up. I'm submitting this as a pull request as if it were a
request for comments.