TAdvMultiFileMemo - Auto Completion Issues

Hi can I customize it to better support other languages. It seems to support Pascal type languages best. I'm working on a Lua based project and need proper code completion for it. It will work fine using just routines with no "." or ":" in the names, but I have some Lua code like this:

Display.Open(...)

and even like this:

file:open()

When I fill out the completion list, its expecting a format like this:

function Class.Method

If I return Class.Method, it will cut off Class and only return Method. It's only if I pass:

sometext<space>Class.Method

it works so it always expecting formatting like a Pascal language. Can I override this behavior? My first thought was just to hack the code, but next update all changes are lost and it will become a hassle to keep it maintained. So if I can already override the behavior cool, just tell me how.

In AdvMemo.AutoCompletion you can use AdvMemo.AutoCompletion.StartToken to set the token in text after which it should try to autocomplete. So, you could add the ':' char there.

It expects that the autocompletion list returns the type + space + identifier, so I'm not familiar with the Lua language and what identifiers exist in the Lua language but I would guess you can use identifier words similar to function/method/procedure.... for Lua class methods.

I got it working to an acceptable level for now.

The next issue is that Lua is case sensitive and GetParameterHintEvent will return a token in all caps. The problem with this is that now I am unable to check for:
myFunction(a,b,c)
vs.
MyFunction(x,y,z)

In Lua they are two different functions. Since you uppercased the token, I can't figure out which function I need to return the params from and the first one will always be used.

This I need to fix. How?

Ahh just found it, I can set NewMemo.CaseSensitive := True; in the InitMemo event handler.
Cool!

1 Like