[MonoDevelop] Stub generation addin for MonoDevelop
Anirudh
anirudh at anirudhsanjeev.org
Wed Apr 1 12:10:15 EDT 2009
Hi,
I want to try and write a stub generation addin because I've always wanted
this feature.
Working:
Suppose you're writing a function, implementing API calls and calling
functions that don't exist, you're going to have to implement those
functions sooner or later.
I think it's better if you don't break your focus and concentration and
finish the current method, and implement the functions later.
So if your code looks like this:
void someFunction()
{
int x=42,y=5;
string s = "so long and thanks for all the fish";
boringMethod1(x, y);
ExoticType t;;
t = boringMethod2(y, s);
boringMethod1(t, out s);
}
I can right click on one of the unimplemented methods and generate a stub
which is aware of the types that are arguments.
So the above example would produce
void boringMethod1(int intData, int intData)
{
raise NotImplementedError;
}
ExoticType boringMethod2(int intData, string stringData)
{
raise NotImplementedError;
}
void boringMethod1(ExoticType ExoticTypeData, out string stringData)
{
raise NotImplementedError;
}
I was hoping to later evolve this to be able to generate stubs for classes
that don't exist. Or to be able to put a comment "// STUB" next to your
function that would be used to flag functions that need generation. I really
think this can help test-oriented development, where you can write functions
that need testing and generate the functions from the tests later on.
The trouble, as Michael had pointed out on IRC, was that it'd be hard for
the IDE to know what methods aren't implemented yet, so it's difficult to
make a single button to generate stubs. But it is seemingly possible to
blindly generate snippets of code and paste it right before/after the
function if need be.
How do I make the logging more verbose, and preferably see which file/module
fired it? I'd want to see how the "find all instances of" feature is
implemented, and start from there. Since all the functionality I need is
already implemented, it'd really help to know where to look to get an idea
on what methods to call.
Thanks,
Anirudh
--
Fourth Year Undergraduate Student, Indian Institute of Technology, Kharagpur
E-Mail/jabber/googletalk: anirudh -at- anirudhsanjeev -dot- org
Phone: +91-97335-04828
My PGP key: anirudhsanjeev.org/pubkey.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20090401/d77144f7/attachment.html
More information about the Monodevelop-list
mailing list