Notepad++ Function List

Discuss features, issues, about Editors for AHK
User avatar
Masonjar13
Posts: 1405
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Notepad++ Function List

15 Sep 2018, 21:22

I know there is already a function list available, but it's buggy and over-the-top. This one supports just functions and classes, giving just the names (not parameters or extended classes), and properly ignores comments (at least for what I've tested).

As noted as a bug on the other thread, the closing bracket of a class can not be the last character in the file for the list to propagate. There needs to be a space or line, something, anything after it. Limitation of their parsing, it seems. Doesn't apply to functions, just classes.

Code: Select all

            <association userDefinedLangName="AutoHotkey" id="ahk"/>

Code: Select all

           <parser id="ahk" displayName="AutoHotkey" commentExpr="((/\*.*?\*/)|(;.*?$))">
                <classRange
                   mainExpr="^(/\*|\})?[\t ]*(class)[\t ]+[$\w]+[\t ]*(extends[\t ]+[$\w]+[\s]*)?\{"
                   openSymbole = "\{"
                   closeSymbole = "\}"
                   displayMode="node">
                    <className>
                        <nameExpr expr="class[\t ]+\K[$\w]+"/>
                    </className>
                    <function
                       mainExpr="^(/\*|\})?[\t ]*(?!(if|while|loop))[$\w]+\s*\([^\r\n]*?\)[^.\r\n]*?\s*?\{">
                        <functionName>
                            <funcNameExpr expr="(?!(if|while|loop))[$\w]+"/>
                        </functionName>
                    </function>
                </classRange>
                <function
                   mainExpr="^(/\*|\})?[\t ]*(?!(if|while|loop))[$\w]+\s*\([^\r\n]*?\)[^.\r\n]*?\s*?\{"
                   displayMode="$className->$functionName">
                    <functionName>
                        <nameExpr expr="(?!(if|while|loop))[$\w]+"/>
                    </functionName>
                    <className>
                    </className>
                </function>
            </parser>
Updated: fixed some inconsistencies

Return to “Editors”

Who is online

Users browsing this forum: No registered users and 3 guests