xudong yellow
xudong yellow

Reputation: 3

Source Insight can not jump to function definition

My language is lua. Many functions in the file table.lua is named as "Table_XXX",like pictue1.In table.lua's symbol window,all they are marked as the same symbol----"Table",like picture 1.while function call in other files(enven in the same file),Source Insight can not recognizes the function and jump to its definition. so,what should I do to solve this problem? thanks a lot. Sample Image

Sample Image

Upvotes: 0

Views: 1446

Answers (1)

ZXX
ZXX

Reputation: 4772

Unfortunately you can't expect any help from SI folks so it will have to be a DIY thing.

Open Lua.xclf (it's XML, you can even drag&drop it into SI itself). Notice:

    <Expression
        SymbolType="Function"
        Pattern="function\w+\([a-zA-Z][a-zA-Z0-9]*\)"
        RegexType="Source Insight"
        />

and that regex function\w+\([a-zA-Z][a-zA-Z0-9]*\) doesn't have [ _ ] char. If you are already playing, do yourself a favor and switch type to "Perl Compatible" to have much better control.

You can also edit that in Options / Preferences / Languages double click the language and Custom Parsing.

Also notice that in Keywords [function] is declared as "control" and you'd probably want "Declare Function" or "Declare Method".

You'll have to scrutinize it in great detail (wither in XML or UI) and you'll probably find many other problems. If you reach a good state you'll have to publish it on your own (say on https://pastebin.com/) and then publish the link here.

In theory you could write to their support to ask them do they want a better file but don't expect much. SI ended up being so neglected that you could start crying if you remember it's golden days (whole Windows shipped with SI - several times). That's why people gave up. So, now it's DIY - find some highlighter files from other editors and copy regexs is you can.

Maybe IBM could buy them - right after they pay for Red Hat :-)

Upvotes: 0

Related Questions