Say for example I have a yaml file
immutable_class: Foo
A: int
B: string
which according to an imagined MSBUILD rule will generate
partial class Foo {
public int A { set ; private get; }
public string B { set; private get; }
private Foo(){}
public static Foo Default = new Foo();
public Foo SetA(int value){
var r = (Foo) this.Clone();
r.A = value;
return r;
}
public Foo SetB(string value){
var r = (Foo) this.Clone();
r.B = value;
return r;
}
}
now somewhere in my source code I will have
Foo foo = Foo.Default;
foo = foo
.SetA(1)
.SetB("Hello");
var tmp = foo.B;
I now tell resharper I wish to refactor rename B and the plugin will recognise that the source of this property is the DSL that generates the class and refactor that DSL accordingly. Assume that I have the tools to actually refactor the DSL myself once I have been triggered with the correct information.
Is the Resharper API open enough to do this kind of thing?