deprecate old Help class
[supercollider.git] / SCClassLibrary / DefaultLibrary / extHelpMethodArgs.sc
blob66a3e6a10b408821030da049fc4474ecd8ac9a06
1 + Help {
2     *methodArgs {|string|
3         var class, meth, f, m;
4         f = string.findRegexp("(\\w*)\\.(\\w+)").flop[1];
5         if(f.notNil) {#class, meth = f[1..]} {
6             if(string[0].isUpper) {
7                 class = string;
8                 meth = \new;
9             } {
10                 meth = string;
11             }
12         };
13         f = {|m,c|
14             class = (c ?? {m.ownerClass}).name;
15             class = if(class.isMetaClassName) {class.asString[5..]++" *"} {class.asString++" -"};
16             class++m.name++" ("++m.argNames[1..].collect {|n,i|
17                 n.asString++":"+m.prototypeFrame[i+1];
18             }.join(", ")++")";
19         };
20         class = class.asSymbol.asClass;
21         if(class.notNil) {
22             m = class.class.findRespondingMethodFor(meth.asSymbol);
23             ^if(m.notNil) {f.value(m,class.class)} {""};
24         } {
25             ^Class.allClasses.reject{|c|c.isMetaClass}.collect {|c|
26                 c.findMethod(meth.asSymbol);
27             }.reject{|m|m.isNil}.collect {|m|
28                 f.value(m);
29             }.join($\n);
30         }
31     }