Community
    • Login

    Can't seem to get functionList.xml to recognize my UDL

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.7k 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.
    • AzannahA Offline
      Azannah
      last edited by

      I’m working with text files and would like to use the function list to display sections in my files. Sections are denoted by the word, “Section”. For example:

      Section Test1
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam imperdiet leo eu tincidunt iaculis. Suspendisse potenti. Vestibulum sodales lacinia nisl, a bibendum quam laoreet et. Donec ut quam sagittis, pretium lorem non, iaculis turpis. Morbi ante neque, lacinia in libero quis, maximus efficitur nibh. Mauris sit amet nunc varius, pharetra urna id, vestibulum tortor. Curabitur eu elit ut mi pellentesque tincidunt. Sed gravida suscipit est quis interdum.
      
      Section Test 2
      Mauris auctor diam in ante elementum vestibulum. Proin at auctor enim. Curabitur dignissim, erat non rutrum fringilla, purus mauris condimentum nunc, sed varius risus velit et nisi. Praesent ac fermentum ligula. Nam cursus orci tincidunt mauris semper pharetra. Etiam ultrices ipsum ut felis iaculis efficitur. Quisque consequat arcu vitae tincidunt tincidunt. Praesent viverra tincidunt diam id pharetra.
      

      I have a user defined language called, SA Network v0.2.

      My functionList.xml (I’ve been working with the file in %appdata%, but have also tried editing the file in \program files\)

      ...
      <association userDefinedLangName="SA Network v0.2" id="sanet_sections"/>
      ...
      
      <parser id="sanet_sections" displayName="Configuration Sections">
        <function mainExpr="Section.+" displayMode="$functionName">
        </function>
      </parser>
      

      I’ve simplified the configuration as much as possible, but I still can’t get anything to display in the function list. What am I doing wrong?

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

        @Azannah Please try the following association/parser:

        			<association id=       "sanet_section"       userDefinedLangName="SANET"           />
        			<association id=       "sanet_section"       ext=".san"                            />
        
        			<!--
        			|   https://notepad-plus-plus.org/community/topic/14808/can-t-seem-to-get-functionlist-xml-to-recognize-my-udl
        			\-->
        			<parser
        				displayName="[UDL] SA Network Configuration Section"
        				id         ="sanet_section"
        			>
        				<function
        					mainExpr="(?x)                                              # free-spacing (see `RegEx - Pattern Modifiers`)
        							(?im)                                               # case-insensitive, ^ and $ match at line-breaks
        							^\h*                                                # optional leading white-space at start-of-line
        							SECTION
        							\K                                                  # discard text matched so far
        							[^\r\n]+                                            # whatever,
        							$                                                   # ...up till end-of-line
        						"
        				/>
        			</parser>
        

        REMARK:
        Make sure the value for “userDefinedLangName” (e.g. “SANET” in my case) exactly matches the name of your UDL i.e. as visible in the N++ “Language” menu.

        1 Reply Last reply Reply Quote 3
        • AzannahA Offline
          Azannah
          last edited by

          Thanks, @MAPJe71 - that worked! You’r comment style for RegEx is also helpful.

          Best regards

          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