Posted 18 years ago
by Joris Koster
-
Paragon Decision Technology

I'm not sure what is right or wrong in this case; suppose that one has a namespace 'MyNamespace' with only 1 member 'MyMember' in it. Next I'm typing that 'MyNamespace' followed by a dot; what would the CompleteWord method do (assuming I feed the memberlist with that 1 member only) ?
According to the help it 'performs an auto-complete if the text with which the member list is initialized causes a single selection', and therefore I would expect the 'MyMember' to be immediately completed, since it is the one and only possibility. On the other hand, one could argue that a nil string only matches an empty list... Right now the implementation seems the latter, since a memberlist of lenght 1 is shown.
As a sidenote: I think this falls in the same category as having a typo in the supposed member-item that would otherwise be uniquely matched. (e.g. have the memberlist 'chapel cheer church' while invoking the CompleteWord on 'chaos' it would alter 'chaos' into 'chapel' :) ).
I have no problem with the current implementation, but it might be nice to extend the CompleteWord functionality with an extra boolean argument or member-var 'CorrectOnUniqueMatch' that triggers the auto-correcting.
According to the help it 'performs an auto-complete if the text with which the member list is initialized causes a single selection', and therefore I would expect the 'MyMember' to be immediately completed, since it is the one and only possibility. On the other hand, one could argue that a nil string only matches an empty list... Right now the implementation seems the latter, since a memberlist of lenght 1 is shown.
As a sidenote: I think this falls in the same category as having a typo in the supposed member-item that would otherwise be uniquely matched. (e.g. have the memberlist 'chapel cheer church' while invoking the CompleteWord on 'chaos' it would alter 'chaos' into 'chapel' :) ).
I have no problem with the current implementation, but it might be nice to extend the CompleteWord functionality with an extra boolean argument or member-var 'CorrectOnUniqueMatch' that triggers the auto-correcting.