Community
    • Login

    Function list tuning

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    13 Posts 3 Posters 11.0k 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.
    • MAPJe71M
      MAPJe71
      last edited by

      Notepad++ has a build-in FunctionList these days which can not be disabled. What you can do is install the Customize Toolbar-plugin and use it to remove the button from the task-bar.

      The images in the FunctionList tree view can not be changed by settings. You’ll have to change and rebuild Notepad++ to accomplish that. The images of the FunctionList-plugin (be aware that it has instability issues) and the SourceCookifier-plugin can be customized with settings.

      The parsers of FunctionList (build-in) and FunctionList-plugin are defined in FunctionList.xml and FunctionListRules.xml respectively and are not directly exchangeable.

      1 Reply Last reply Reply Quote 0
      • Българският ВойнБ
        Българският Войн
        last edited by A Former User

        Where to change regex to avoid this malfunction showed in the images? I think that the problem is here:

        mainExpr="^[\s]*(class|abstract[\s]+class|final[\s]+class)[\t ]+[\w]+([\s]*|[\s]*(extends|implements)[\s]+[\w\\]+[\s]*)?\{"
                        openSymbole = "\{"
                        closeSymbole = "\}"
                        displayMode="node">
        

        Please help me to change the code to match } with nothing after the bracket. closeSymbole = "\}" is addet but when it is not have some space or symbol after

        class PHP {
        
        } //here it is not show function list and no clas there because is not match the regular expresion.
        

        Image 1 the cursor is ok and function list showed matches!

        Image 2 the cursor is NOT ok and function list is not showed matches!

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

          The required trailing space is most probably a bug and might be related to or is the same bug as the required two spaces before an inline comment.

          1 Reply Last reply Reply Quote 0
          • Българският ВойнБ
            Българският Войн
            last edited by

            How can i modifed this?

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

              Duh … if you have any C/C++ knowledge by improving the Notepad++ source code. Otherwise I’d opt for adding a bug-report (i.e. issue) on Notepad++'s GitHub page.

              1 Reply Last reply Reply Quote 0
              • Българският ВойнБ
                Българският Войн
                last edited by

                Man the regular expresion for PHP is bad not the exe file. Just we can make changes and improove it. I show here in images the problem.

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

                  Yes, there is a problem with the regular expression in your first post but correcting that will not solve the problem of the required space after the closing curly-brace.

                  The closing curly-brace requires a white-space after it. This is a BUG in the Notepad++ source code. It can NOT be solved by changing the regular expression of the parser.

                  This is what I used as the PHP parser:

                        <parser
                            id         ="php_syntax" 
                            displayName="PHP" 
                            commentExpr="(?'MLC'(?s-m)/\*.*?\*/)|(?'SLC'(?m-s)(?:#|/{2}).*$)|(?'STRLIT'(?s-m)&quot;[^&quot;\\]*(?:\\.[^&quot;\\]*)*&quot;|&apos;[^&apos;\\]*(?:\\.[^&apos;\\]*)*&apos;)"
                            version    ="0.0.0.0" 
                          >
                          <classRange
                              mainExpr    ="^\s*(?:(?-i:abstract|final)\s+)?(?-i:class)[\t ]+[A-Za-z_\x7f-\xff][\w\x7f-\xff]*(\s+(extends|implements|extends\s+(\\|[A-Za-z_\x7f-\xff][\w\x7f-\xff]*)+\s+implements)\s+(,\s*|(\\|[A-Za-z_\x7f-\xff][\w\x7f-\xff]*))+)?\s*\{"
                              openSymbole ="\{"
                              closeSymbole="\}"
                            >
                            <className>
                              <nameExpr expr="(?:(?-i:abstract|final)\s+)?(?-i:class)[\t ]+[A-Za-z_\x7f-\xff][\w\x7f-\xff]*" />
                              <nameExpr expr="\s+[A-Za-z_\x7f-\xff][\w\x7f-\xff]*\Z" />
                              <nameExpr expr="[A-Za-z_\x7f-\xff][\w\x7f-\xff]*\Z" />
                            </className>
                            <function mainExpr="\s*(?:(?-i:static|public|protected|private|final)*(\s+(?-i:static|public|protected|private|final))+\s+)?(?-i:function\s+)([A-Za-z_\x7f-\xff][\w\x7f-\xff]*(\s+[A-Za-z_\x7f-\xff][\w\x7f-\xff]*)?(\s+|\*\s+|\s+\*|\s+\*\s+))?([A-Za-z_\x7f-\xff][\w\x7f-\xff]*\s*:{2})?(?:\b(?!(?-i:if|while|for|switch)\b))[A-Za-z_\x7f-\xff][\w\x7f-\xff]*\s*\([^\{]*\{" >
                              <functionName>
                                <funcNameExpr expr="(?:\b(?!(?-i:if|while|for|switch)\b))[A-Za-z_\x7f-\xff][\w\x7f-\xff]*\s*\([^{]*" />
                                <!-- comment out the following node to display the method with its parameters -->
                                <funcNameExpr expr="[A-Za-z_\x7f-\xff][\w\x7f-\xff]*" />
                              </functionName>
                            </function>
                          </classRange>
                          <function mainExpr="\s*function\s+\w+\(" >
                            <functionName>
                              <nameExpr expr="(?!(?-i:if|while|for)\b)~?[A-Za-z_]\w*\s*\(" />
                              <nameExpr expr="~?[A-Za-z_]\w*" />
                            </functionName>
                            <className>
                              <nameExpr expr="\w+(?=\s*:{2})" />
                            </className>
                          </function>
                        </parser>
                  

                  NOTE: it still won’t solve your problem i.e. it also requires a white-space after the closing curly-brace.

                  1 Reply Last reply Reply Quote 0
                  • Българският ВойнБ
                    Българският Войн
                    last edited by

                    Is yours regular expression is better than my? If so what is better and what is better coincide with it? What are the differences between yours and mine?

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

                      I guess you’re smart enough to figure that out for yourself.

                      1 Reply Last reply Reply Quote 0
                      • Joseph CasellaJ
                        Joseph Casella
                        last edited by

                        this is very helpful i’m looking on dev-ing a website for some microsoft guy and he is trying to figure out the proper way for notepad++ for shopping.

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