atom-supercollider icon indicating copy to clipboard operation
atom-supercollider copied to clipboard

Method help file look up fails

Open madskjeldgaard opened this issue 6 years ago • 4 comments

When moving the cursor to a method name and calling the atom-supercollider open help file command, I get the following error (as opposed to when I move to the cursor to a class name, the help file opens fine). In the folliwing I tried it on the play method in {SinOsc.ar(110)!2 * 0.1}.play.

I'm on MacOS 10.14 using SC 3.9.3 and the latest version of Atom and the atom-supercollider package.

ERROR: Message 'openHelpFile' not understood.7:58:00.919
Receiver	String "{SinOsc.ar(110)!2 * 0.1}.play"
Selector	openHelpFile
Object:doesNotUnderstand
Args
this	String "{SinOsc.ar(110)!2 * 0.1}.play"
selector	Symbol 'openHelpFile'
args	nil
a Function defined in undefined:undefined
Function:prTry
Args
this	
▶ a Function
Vars
result	nil
thread	
▶ a Thread
next	nil
wasInProtectedFunc	false
Function:try
Args
this	
▶ a Function
handler	
▶ a Function
Vars
result	nil
Meta_SuperColliderJS:*interpret
Args
this	SuperColliderJS
guid	String "cjnm19ans0001lbnraz7z1cpc"
escapedCode	String "\"{SinOsc.ar(110)!2 * 0.1}.play\".openHelpFile"
executingPath	nil
returnResultAsString	true
reportError	false
getBacktrace	true
Vars
code	String "\"{SinOsc.ar(110)!2 * 0.1}.play\".openHelpFile"
compiled	
▶ a Function
result	nil
error	nil
saveExecutingPath	nil
Interpreter:interpretPrintCmdLine
Args
this	
▶ an Interpreter
Vars
res	nil
func	
▶ a Function
code	String "SuperColliderJS.interpret(\"cjnm19ans0001lbnraz7z1cpc\",\"\\\"{SinOsc.ar(110)!2 * 0.1}.play\\\".openHelpFile\",nil,true,false,true);"
doc	nil
ideClass	nil
Process:interpretPrintCmdLine
Args
this	a Main

madskjeldgaard avatar Oct 23 '18 18:10 madskjeldgaard

As far as I know, SC helpfiles are for classes only, not methods. However, it also seems that the entire string {SinOsc.ar(110)!2 * 0.1}.play was passed to .openHelpfile (instead of just the .play method) which is why the error was generated.

Makes me also think (somewhat unrelated) that the openHelpfile() method in lib/controller.coffee will need to be updated as Object.openHelpfile is deprecated in recent versions of SC: WARNING: Called from Interpreter:interpretPrintCmdLine, method Object:openHelpFile is deprecated and will be removed.

woolgathering avatar Oct 24 '18 04:10 woolgathering

No, help file lookup is also for methods. Method lookup works in the SuperCollider IDE (even though it's often ineffective lol)

madskjeldgaard avatar Oct 24 '18 07:10 madskjeldgaard

What happens in the IDE is that the method is searched in the helpfiles but there are no helpfiles for methods as such in the same way that there are helpfiles for classes. A list of helpfiles for classes that use that method is provided.

But I think the problem is that something with the Regex is messed up where it passed the entire line to .openHelpfile instead of just play. I would check it on my end but I just compiled the bleeding edge of SC 3.10 and the help is messed up for reasons not related to Atom... I'll try to get around to testing it on the stable version of 3.9.3.

woolgathering avatar Oct 24 '18 17:10 woolgathering

I'm not sure if SuperCollider changed, but previously it was a method on String.

I guess you figured it out: the bleeding edge is bleeding. They shouldn't break APIs like that, there's really no point. There are tons of ancient methods and 18 year old obsolete garbage, but they don't remove those. Instead it's things like this that are core functionality. They should just redirect the call to the new api.

Anyway...

In this case the string is a bunch of source code String "{SinOsc.ar(110)!2 * 0.1}.play", but that shouldn't result in Object:doesNotUnderstand.

Help should work for method names, class names and some general subjects that have help files. It just looks for matching names.

crucialfelix avatar Oct 24 '18 19:10 crucialfelix