Community
    • Login

    Configure Function List to show JavaScript class functions created with prototype

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    1 Posts 1 Posters 2.8k Views 1 Watching
    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 Offline
      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
      • N NESblast referenced this topic on

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors