Community
    • Login

    JavaScript Function List not working

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 7.6k Views 2 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.
    • Jason StineJ Offline
      Jason Stine
      last edited by

      Hi, I have the latest version of Notepad++ installed (7.3.2) and I can’t get the function list to display anything when I edit my .js files. I checked the functionList.xml file, and there’s code there for JavaScript, so why doesn’t it work? This is what’s in my functionList.xml file:

      Line 29: L_COFFEESCRIPT = 56 | L_JAVASCRIPT = 58 | L_PS = 35 | L_XML = 9

      Line 38: 3 = L_CPP | 19 = L_JS | 35 = L_PS | 51 = L_GUI4CLI

      Line 45: 10 = L_MAKEFILE | 26 = L_BASH | 42 = L_ADA | 58 = L_JAVASCRIPT

      Line 1165:
      <!-- ================================================ [ J(ava)Script ] -->

      		<parser
      			displayName="JavaScript"
      			id         ="javascript_function"
      			commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
      		>
      			<function
      				mainExpr="((^|\s+|[;\}\.])([A-Za-z_]\w*\.)*[A-Za-z_]\w*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_]?\w*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{"
      			>
      				<functionName>
      					<nameExpr expr="[A-Za-z_]\w*\s*[=:]|[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>
      		</parser>
      

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • MAPJe71M Offline
        MAPJe71
        last edited by

        See this topic

        1 Reply Last reply Reply Quote 0
        • Jason StineJ Offline
          Jason Stine
          last edited by

          Hi thanks for replying to my question! I tried changing the language IDs (58 and 19), trying both functionList.xml files in the two different directories mentioned… but still no list is appearing! What would you suggest I try next?

          1 Reply Last reply Reply Quote 0
          • t12122013 FinkT Offline
            t12122013 Fink
            last edited by t12122013 Fink

            Hi
            I found that javascript function list does not work when there is a comment between the function (parameter list) and the opening curly bracket { of the function body.
            My solution is to remove the search for curly bracket {.
            In addition I added the construct d = new Function(“parameter1”,“parameter2”,“function body”).
            I tried a lot of things, changing the commentExpr did not help. I frequently do have comments between the function header and the opening curly bracket of the function body.

            It concerns the mainExpr

            mainExpr=“((^|\s+|[;}.])([A-Za-z_]\w*.)[A-Za-z_]\w\s*[=:]|^|[\s;}]+)\s*(?:new\s*)?function(\s+[A-Za-z_]?\w*\s*([^)(])|([^)(]))”

            (please excuse my formatting, and for tail-posting. I want to post my findings but I’m not fluent).

            1 Reply Last reply Reply Quote 0

            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