[Pharo-project] Cmd-q autocompletion?
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
On 13 January 2012 14:59, Guillermo Polito <guillermopolito@gmail.com> wrote:
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...
yes, i using it a lot. because often i'm not using the image with all tools loaded. and this simple completion is quite helpful
Guille
-- Best regards, Igor Stasenko.
How about (maybe for 1.5) think in making it pluggable? :P On Fri, Jan 13, 2012 at 11:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 13 January 2012 14:59, Guillermo Polito <guillermopolito@gmail.com> wrote:
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...
yes, i using it a lot. because often i'm not using the image with all tools loaded. and this simple completion is quite helpful
Guille
-- Best regards, Igor Stasenko.
There's a lot of fuzzy stuff in OCompletion/ECompletion too. Would be nice to clean it up and make things more uniform. On 13 January 2012 15:21, Guillermo Polito <guillermopolito@gmail.com> wrote:
How about (maybe for 1.5) think in making it pluggable? :P
On Fri, Jan 13, 2012 at 11:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 13 January 2012 14:59, Guillermo Polito <guillermopolito@gmail.com> wrote:
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...
yes, i using it a lot. because often i'm not using the image with all tools loaded. and this simple completion is quite helpful
Guille
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
On 13 Jan 2012, at 14:59, Guillermo Polito wrote:
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:
Amazing, great ! It seems like a 'cheap' mechanism, let's keep it. Sven
participants (3)
-
Guillermo Polito -
Igor Stasenko -
Sven Van Caekenberghe