Hi list,

in the most recent dev image (9.10.5), OCompletion is broken for me.

I lost my reproducible test case, but the gist was that sometimes when
OCompletion had no idea which type a temporal variable would be, you
were unable to insert code behind that variable, because if you tried,
a debugger would show up.

The problem appears to be Debugger>guessTypeForName:. debuggerMap can
be nil and if it is, the method fails. I changed the method to the
following, and then the strange errors that occur on my image
disappear:

guessTypeForName: aString
        | index object |
        index := debuggerMap ifNotNil: [(debuggerMap tempNamesForContext:
self selectedContext)
                                indexOf: aString
                                ifAbsent: []].
        object := index
                                ifNil: [index := self receiver class 
allInstVarNames
                                                                indexOf: aString
                                                                ifAbsent: [].
                                                index ifNil: [^ nil].
                                        self receiver instVarAt: index]
                                ifNotNil: [self selectedContext tempAt: index].
        ^ object class

Essentially, I leave index at nil, if debugerMap is nil.

I don't know enough about OCompletion to tell whether this is a fix,
or makes things worse somehow.

Cheers,

Niko

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to