Page 1 of 1

Notepad++ Function List

Posted: 15 Sep 2018, 21:22
by Masonjar13
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

Re: Notepad++ Function List

Posted: 15 Dec 2019, 12:11
by rediffusion
@Masonjar13

How do you use it can you tell the manual? :silent: :think:
Also here's some interesting topic about the `Functions`. And «NotePad++» has building feature, check it - View > Function List

Re: Notepad++ Function List

Posted: 11 Feb 2020, 01:23
by TheArkive
@Masonjar13
Very nice man. Works like a charm.