Here is the checkin log for rev 3408 of the trunk: QQQ Created AutoCompleterScanner in leoKeys.leo. To test this, execute this script:
import leo.core.leoKeys as leoKeys leoKeys.AutoCompleterScanner(c).scan() You may generate verbose dumps by setting verbose=True in scan. Changed leoGlobals.py so it sets leoGlobals.g rather than g.g. This avoid polluting the completions for g. On my machine, a complete scan of leoPy.leo takes about 0.6 sec. [The checkin log mistakenly said that the scan of leoGlobals.py.] QQQ The new code is about three times faster than the old because scan calls g.scanForAtLanguage(c,p) only for @<file> nodes (!!) This is proof that we could scan for completions when enabling them the first time, and similarly for calltips. There are some language- specific hacks (regexes) for calltips, but that's just a nit. This is *big* progress: - Because the scans are fast, we can just do them. - Because the scans are general in nature, we can use them for any language. - There is no longer any need to do AI to compute in-context completions. Thus, the auto-complete will be *much* faster than at present. The only slight drawback is the reverse of not doing AI: the completer will no longer know enough context to eliminate some invalid completions or calltips. Thus, there will, in general, be several of each. This can be handled by presenting a list of options, as Ville has already done in a plugin. Still to do: rewrite the AutoCompleterClass. This class will eventually be substantially simpler, but none of this work has been done yet. I may play around with an experimental version of this class, but it won't happen before a1. Unless I get real excited :-) Edward P.S. The (long) dumps enabled in scan are quite interesting to look at. P.P.S. The original code, now much revised, came from LeoUser. EKR -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
