[Pharo-project] Cmd-q autocompletion?

Guillermo Polito guillermopolito at gmail.com
Fri Jan 13 08:59:22 EST 2012


I've just realized that we have an autocompletion mechanism that is not
OCompletion in the image, typing cmd-q.  And also, it is just querying the
Symbol table:

selectorsFromPrefix: aPrefix
    "returns the value of labels from a selector prefix"
    | key applicants |
    aPrefix isEmptyOrNil  ifTrue: [^ #()].
    applicants := aPrefix first canBeGlobalVarInitial
        ifTrue: [Array streamContents: [:strm |
            Symbol allSymbolTablesDo: [:each |
                (each notEmpty and: [each first canBeGlobalVarInitial])
                    ifTrue: [strm nextPut: each]]]]
        ifFalse: [Array streamContents: [:strm |
            Symbol allSymbolTablesDo: [:each |
                (each notEmpty and: [each first canBeGlobalVarInitial not])
                    ifTrue: [strm nextPut: each]]]].
    key := aPrefix asLowercase.
    ^ (applicants select: [:each | (each asLowercase beginsWith: key) and:
[each noneSatisfy: [:c | c tokenish not]]]) sort


Does anybody use it?  Is it useful?  Because I was loading OCompletion into
1.4 to see if it was working and I found that the 2 mechanisms live
together...

Guille
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120113/e7323207/attachment-0001.html>


More information about the Pharo-dev mailing list