• Login
Community
  • Login

Functionlist no longer working on .vb files

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
16 Posts 4 Posters 859 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.
  • D
    Diedrich Hesmer
    last edited by Feb 14, 2021, 1:31 PM

    Since several days the functionlist panel is empty for vb files on Notepad++ 7.9.1. For other files its still working as usual.
    I checked the functionlist folder and there is no vb.xml file available.
    How to get it work again on vb files?

    best regards
    Diedrich

    E 1 Reply Last reply Feb 14, 2021, 1:40 PM Reply Quote 0
    • E
      Ekopalypse @Diedrich Hesmer
      last edited by Feb 14, 2021, 1:40 PM

      @Diedrich-Hesmer

      @MAPJe71 has a comprehensive list of function lists for different languages here

      D 1 Reply Last reply Feb 15, 2021, 3:20 PM Reply Quote 2
      • D
        Diedrich Hesmer @Ekopalypse
        last edited by Feb 15, 2021, 3:20 PM

        @Ekopalypse
        Thanks for the answer.
        But its still not working.
        I copied the 43 lines of vb-3.0.FL.xml to an empty file, renamed it to vb.xml and copied the file to the functionlist folder, where the other xml files are located.
        What did I wrong?

        best regards
        Diedrich

        P D 2 Replies Last reply Feb 15, 2021, 4:02 PM Reply Quote 0
        • E
          Ekopalypse
          last edited by Feb 15, 2021, 3:51 PM

          Can you try this one?

          <?xml version="1.0" encoding="UTF-8" ?>
          <NotepadPlus>
            <functionList>
              <associationMap>
                <association langID="18" id="vb_function"         /> <!-- L_VB           -->
              </associationMap>
               <!--                                                     [vb_function] -->
                <parser 
                    id="vb_function" 
                    displayName="Visual Basic (.NET|Script|for Applications)"  
                    commentExpr="(?m:((?&lt;=&apos;).*?$)|((?i:REM)([\t ].*?)?$))"> 
                  <classRange
                      mainExpr="(?s:(?&lt;SCOPE&gt;(?i:CLASS|TYPE)).*?(?i:END[\t ]\k&lt;SCOPE&gt;))"
                      displayMode="node" >
                    <className>
                      <nameExpr expr="(?i:CLASS|TYPE)[\t ]+(?:[A-Za-z_][\w]*\b)(?:.*?[\r\n])" />
                      <nameExpr expr="[\t ]+(?:[A-Za-z_][\w]*\b)" />
                      <nameExpr expr="[A-Za-z_][\w]*" />
                    </className>
                    <function
                        mainExpr="(?m:^[\t ]*(?i:(?:(?:PRIVATE|PROTECTED|PUBLIC)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$))" >
                      <functionName>
                        <funcNameExpr expr="(?i:(?:(?:PRIVATE|PROTECTED|PUBLIC)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        <funcNameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        <funcNameExpr expr="[A-Za-z_][\w]*(?=[\t ]*\()"/>
                      </functionName>
                    </function>
                  </classRange>
                  <function 
                      mainExpr="^[\t ]*(?i:(?:(?:PRIVATE|PROTECTED|PUBLIC)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY))[\t ].*?[A-Za-z_][\w]*(?:[\t ]*\(|$)" 
                      displayMode="$functionName">
                    <functionName>
                      <nameExpr expr="(?i:(?:(?:PRIVATE|PROTECTED|PUBLIC)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY))[\t ].*?[A-Za-z_][\w]*(?:[\t ]*\(|$)"/>
                      <nameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY))[\t ].*?[A-Za-z_][\w]*(?:[\t ]*\(|$)"/>
                      <nameExpr expr="[A-Za-z_][\w]*(?=[\t ]*\()"/>
                    </functionName>
                  </function>
                </parser>      
                <!--                                                                [] -->
            </functionList>
          </NotepadPlus>
          
          D 1 Reply Last reply Feb 16, 2021, 7:38 AM Reply Quote 0
          • P
            PeterJones @Diedrich Hesmer
            last edited by Feb 15, 2021, 4:02 PM

            @Diedrich-Hesmer said in Functionlist no longer working on .vb files:

            What did I wrong?

            Did you remember to exit all copies of Notepad++ and restart Notepad++ after putting that file in the right location? Because Notepad++ won’t re-read the configuration files until you restart.

            Are you sure it got saved as vb.xml and not vb.xml.txt?

            E 1 Reply Last reply Feb 15, 2021, 4:05 PM Reply Quote 0
            • E
              Ekopalypse @PeterJones
              last edited by Feb 15, 2021, 4:05 PM

              @PeterJones

              It looks like the parsers tag was removed. I’m currently trying
              to find out when this happened.

              P 1 Reply Last reply Feb 15, 2021, 4:10 PM Reply Quote 0
              • E
                Ekopalypse
                last edited by Feb 15, 2021, 4:08 PM

                Seems this has been introduce with version 7.9.1.

                1 Reply Last reply Reply Quote 1
                • P
                  PeterJones @Ekopalypse
                  last edited by Feb 15, 2021, 4:10 PM

                  @Ekopalypse ,

                  Correct, the new syntax doesn’t include the <parsers> tag wrapped around the <parser> tag anymore.

                  The file you posted works:
                  30c5c1aa-bec1-4459-80fb-0f39c6bc9fca-image.png

                  Hmm, looks like the documentation for Function List and especially function list section of config files could use slight improvement to make it more clear that you don’t need the <parsers>...</parsers> with v7.9.1 and newer.

                  1 Reply Last reply Reply Quote 1
                  • E
                    Ekopalypse
                    last edited by Ekopalypse Feb 15, 2021, 4:44 PM Feb 15, 2021, 4:43 PM

                    The new solution seems not cover lexer plugins.
                    I was trying to use

                    <association id= "v.xml"		langID= "86"/>
                    

                    or

                    <association id= "v.xml"				userDefinedLangName="VLang"/>
                    

                    But both failed. Technically lexer plugins do get an unique ID
                    assigned but this varies depending how much lexer plugins you are using.
                    So … any ideas?
                    I assume I have to open an issue.

                    P 1 Reply Last reply Feb 15, 2021, 4:56 PM Reply Quote 0
                    • P
                      PeterJones @Ekopalypse
                      last edited by Feb 15, 2021, 4:56 PM

                      @Ekopalypse ,

                      Did you remember to also update the overrideMap.xml? For default builtin lexers, the overrideMap defaults to a reasonable value (shown in comments); but for any others (like UDL and presumably lexer plugins), you have to update the overrideMap.

                      E 1 Reply Last reply Feb 15, 2021, 5:21 PM Reply Quote 1
                      • D
                        dinkumoil @Diedrich Hesmer
                        last edited by Feb 15, 2021, 5:03 PM

                        @Diedrich-Hesmer

                        I use this file and it works:

                        <?xml version="1.0" encoding="UTF-8" ?>
                        <!-- ==========================================================================\
                        |
                        |   To learn how to make your own language parser, please check the following
                        |   link:
                        |       https://npp-user-manual.org/docs/function-list/
                        |
                        \=========================================================================== -->
                        <NotepadPlus>
                        	<functionList>
                        		<!-- ================================================== [ VB/VBS/VBA ] -->
                        
                        		<parser
                        			displayName="Visual Basic (.NET|Script|for Applications)"
                        			id         ="vb_function"
                        			commentExpr="(?m:((?&lt;=&apos;).*?$|((?i:REM)([\t ].*?)?$))"
                        		>
                        			<classRange
                        				mainExpr="(?s:(?&lt;SCOPE&gt;(?i:CLASS|TYPE)).*?(?i:END[\t ]\k&lt;SCOPE&gt;))"
                        				displayMode="node"
                        			>
                        				<className>
                        					<nameExpr expr="(?i:CLASS|TYPE)[\t ]+(?:[A-Za-z_][\w]*\b)(?:.*?[\r\n])" />
                        					<nameExpr expr="[\t ]+(?:[A-Za-z_][\w]*\b)" />
                        					<nameExpr expr="[A-Za-z_][\w]*" />
                        				</className>
                        
                        				<function
                        					mainExpr="(?m:^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|SHARED|SHADOWS|OVERRIDABLE|OVERRIDES|READONLY|WRITEONLY)[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$))"
                        				>
                        					<functionName>
                        						<funcNameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        						<funcNameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        						<funcNameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?=[\t ]*(?:\(|$))"/>
                        					</functionName>
                        				</function>
                        			</classRange>
                        
                        			 <function
                        				mainExpr="^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"
                        				displayMode="$functionName"
                        			>
                        				<functionName>
                        					<nameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(?:ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        					<nameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
                        					<nameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?i:[\t ]+(LIB|ALIAS)[\t ]+[\w&quot;\.]+)*(?=[\t ]*(?:\(|$))"/>
                        				</functionName>
                        			</function>
                        		</parser>
                        	</functionList>
                        </NotepadPlus>
                        
                        1 Reply Last reply Reply Quote 2
                        • E
                          Ekopalypse @PeterJones
                          last edited by Feb 15, 2021, 5:21 PM

                          @PeterJones

                          Sorry, I should have clarified that these changes were made in overrideMap.xml.

                          P 1 Reply Last reply Feb 15, 2021, 5:46 PM Reply Quote 2
                          • P
                            PeterJones @Ekopalypse
                            last edited by Feb 15, 2021, 5:46 PM

                            @Ekopalypse ,

                            These overrideMap customizations work for me

                            			<!-- ==================== Peter's Customizations ============================ -->
                                        <association id= "my_perl.xml"			langID= "21" />
                            			<association id= "udl_markdown.xml"		userDefinedLangName="Markdown"/>
                            			<association id= "udl_cadence.xml"		userDefinedLangName="Cadence"/>
                            			<!-- ======================================================================== -->
                            

                            The first overrides where the default perl (#21) file is named. The other two are for UDL maps.

                            So what you showed does look like the syntax you should use. Maybe a bug in the implementation that doesn’t allow for plugin-based lexers to work with functionList?

                            E 1 Reply Last reply Feb 15, 2021, 5:54 PM Reply Quote 1
                            • E
                              Ekopalypse @PeterJones
                              last edited by Feb 15, 2021, 5:54 PM

                              @PeterJones said in Functionlist no longer working on .vb files:

                              Maybe a bug in the implementation that doesn’t allow for plugin-based lexers to work with functionList?

                              I am currently assuming this is the case, but am struggling to really understand the code. Will have to check this further.

                              1 Reply Last reply Reply Quote 1
                              • E
                                Ekopalypse
                                last edited by Feb 15, 2021, 6:59 PM

                                Issue, perhaps better called question, 9519 opened.

                                1 Reply Last reply Reply Quote 1
                                • D
                                  Diedrich Hesmer @Ekopalypse
                                  last edited by Feb 16, 2021, 7:38 AM

                                  @Ekopalypse
                                  I’m back to normal. Thanks for your help, this copy did it.

                                  best regards
                                  Diedrich

                                  1 Reply Last reply Reply Quote 2
                                  9 out of 16
                                  • First post
                                    9/16
                                    Last post
                                  The Community of users of the Notepad++ text editor.
                                  Powered by NodeBB | Contributors