Originally Posted by kurapica.igas
Normally, we only need the keywords and identifiers for auto-completation.
I see you are using the kristofer's Indent.lua. I think you can record those words when the lib scan for identifiers(tokentype == tokens.TOKEN_IDENTIFIER, record it) .
Using a dichotomy search can quickly check if the identifier existed or not, or just keep a cache table for checking.
Making an editor is fun, but with wow, it's a pain in the ass.
Attachment 8650
|
Do you have a code snippet for that? I was thinking of thinning out the table by matching each letter, which will of course remove unwanted results with each iteration, but it's by no means a binary algorithm.