Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor create property #223

Open
jamlen opened this issue Dec 16, 2016 · 2 comments
Open

Refactor create property #223

jamlen opened this issue Dec 16, 2016 · 2 comments

Comments

@jamlen
Copy link

jamlen commented Dec 16, 2016

I'm on day one of using OmniSharp but once I got it running in Spacemacs (via omnisharp-emacs), the result of a refactor (omnisharp-run-code-action-refactoring) was not what I was expecting.

Given this:

public class MyType
{
  public string Name { get; set; }
}

var a = new MyType
  {
    Name = "Talula",
    NewField = 1234  // <- Refactor create property
  };

I was expecting:

public class MyType
{
  public string Name { get; set; }
  int NewField { get; set; }
}


var a = new MyType
  {
    Name = "Talula",
    NewField = 1234
  };

But what I got was:

public class MyType
{
  public string Name { get; set; }
}

int NewField
{
  get; 
  set;
}

var a = new MyType
  {
    Name = "Talula",
    NewField = 1234
  };
@nosami
Copy link
Contributor

nosami commented Dec 16, 2016

Think you are using omnisharp-server backend here based on NRefactory. There is a newer backend (omnisharp-roslyn) but I don't think omnisharp-emacs supports it. Most of the omnisharp-roslyn backend will work with master omnisharp-emacs (with the exception of refactorings!! - the API changed)

There is a branch here https://github.com/OmniSharp/omnisharp-emacs/tree/feature-omnisharp-roslyn-support but I don't think it was ever finished. Not sure what state this branch is in.

If that doesn't work for you, you're probably SOL unless you want to get your hands dirty. The omnisharp-emacs author (@sp3ctum) doesn't work on the project any more.

@mikavilpas
Copy link
Contributor

Hi, I can confirm what @nosami said. I've been putting off laying the project off my shoulders for way too long now. I'll add something to the readme files to make it official.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants