Community
    • Login

    Configure Function List to show JavaScript class functions created with prototype

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    1 Posts 1 Posters 2.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Peter BrandP
      Peter Brand
      last edited by

      Looked around for help on setting up functionList.xml to get it to display JavaScript classes set up using the prototype keyword and couldn’t find anything. Also wanted to suppress the listing of blank anonymous functions and found a tweak on http://superuser.com/questions/759322/how-can-i-filter-out-from-function-list. For what it is worth, here is my parser section:

      <parser id="js_function" displayName="Javascript" commentExpr="((/\*.*?\*)/|(//.*?$))"> <function mainExpr="((^|[\s]+|[;\}\.])([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*[\s]*=|^|[\s;\}]+)[\s]*function([\s]+[_A-Za-z]?[\w_]*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{" displayMode="$className->$functionName"> <functionName> <nameExpr expr="[_A-Za-z][\w_]*[\s]*[=:]|(?<=function )[_A-Za-z]+[\w_]*[\s]*\("/> <nameExpr expr="[_A-Za-z]+[\w_]*"/> </functionName> <className> <nameExpr expr="([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*\."/> <nameExpr expr="([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*"/> </className> </function> <classRange mainExpr="^[\t ]*([_A-Za-z]?[\w_]*)(\.prototype)+[\s]+(=)+[\s]*\{" openSymbole = "\{" closeSymbole = "\}" displayMode="node"> <className> <nameExpr expr="[_A-Za-z]+[\w_]*"/> </className> <function mainExpr="^[\t ]*([_A-Za-z]?[\w_])+[\s]*+:+[\s]*+function+[\s]*\("> <functionName> <funcNameExpr expr="^[\t ]*([_A-Za-z]?[\w_]*)"/> </functionName> </function> </classRange> </parser>

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors