Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

FunctionList - Notepad++ V6.4.1

stepher
2013-07-03
2013-07-05
  • stepher
    stepher
    2013-07-03

    UPDATE: Since no one has responded I assume there is no way to make FunctionList sort alphabetically (and I have not been able to find anything in the docs or in exploring any of NPP/FunctionList's menus or options that tell me I can do this. So, for the time being, I will remain on NPP V6.3.3 until if/when FunctionList has sort options (which is a feature I'd like to see...again :)

    I love Notepad++. Thanks to all who invested the time to make this a great piece of s/w!!!

    I am using V6.4.1 and am trying to get FunctionList to work w/my assembly source programs for 8051...I'd been using earlier versions of NPP w/the FunctionList plugin and have never had any problems (The plugin also had a window where you only needed to enter the search/match expressions).

    I am not well-versed with Scintilla so I'm not sure if I've got the right approach (The FunctionList window remains empty :(

    Here's what I want in the FunctionList window:

    LABELXXX:

    where label LABELXXX: is the label for a jump, call, etc. Classical assembly language programming.

    Here's what I coded in the functionList.xml file (I've also tried other variations, to no avail :(

            </parser>
            <parser id="asm_funct" displayName="Assembly" commentExpr=";">
                <function
                    mainExpr="^[\t]*[A-Za-z0-9_]+:"
                    displayMode="$className->$functionName">
                    <functionName>
                        <nameExpr expr="[A-Za-z0-9_]+:"/>
                    </functionName>
                    <className>
                        <nameExpr expr="[A-Za-z0-9_]+:"/>
                    </className>
                </function>
            </parser>
    

    where "32" is the id for L_ASM in the associationmap above this command.

    Any help is greatly appreciated. I'm expecting this is something more straightforward than I seem to be able to see at the moment.

    Thanks in advance...Cheers...Steph

     
    Last edit: stepher 2013-07-08
  • Rob Kodey
    Rob Kodey
    2013-07-03

    Actually, your parser definition worked for me.
    Did you try restarting Notepad++ after making the edits to FunctionList.xml?
    Where is the FunctionList.xml file that you're editing? (Which folder?)
    Do you get anything in the functionList panel?

    I suggest a couple tweaks to your parser:
    - Since ASM doesn't have classes, you probably want to replace your className nameExpr to something that actually won't match anything. Like the Javascript parser, you can reuse the C++ expr since it won't match anything in ASM.
    - Optionally, in your functionName expr, remove the ":" at the end, so that it won't be included in the listed function name.

    Result:

    <parser id="asm_funct" displayName="Assembly" commentExpr=";">
      <function
        mainExpr="^[\s]*[\w]+:"
        displayMode="$className->$functionName">
        <functionName>
          <nameExpr expr="[\w]+"/>
        </functionName>
        <className>
          <nameExpr expr="[\w]+(?=[\s]*::)"/>
        </className>
      </function>
    </parser>
    
     
    • stepher
      stepher
      2013-07-04

      Rod,

      Thanks much for your input. It's nice to know I'm not the complete noob I was beginning to think I was :(

      Really, you got it to work for you?? All I get is the window with nothing in it (Even incorporated your sage suggestions). Yes, I've done a NPP restart each time I made a change to the file.

      I've found 2 functionList.xml files. One under Users\xxx...Roaming...This is where I've been making the changes (I also looked thru the other Users...\AppData directories and did not see anything for NPP). Just to cover the bases, I also copied the file over to the Program Files (86)\Notepad++ directory (renamed the one that was already there).

      Is there 1 somewhere else?

      It's driving me a bit nuts. Like I said, it must be something obvious I've missed.

      One note: I did not do an .exe install of NPP_V6.4.1. I renamed the original NPP directory (NPP_V6.3.3) in both the Apps Data and Program Files (86) so I could keep it around just in case of moments like this :( and created new Notepad++ directories and dropped the unzipped files into it. Could this be a part of causing the problem?

      Could there be some issue with permissions?

      Additional Note: In the past few minutes I went back and did an .exe install just to see the results. No change, same problem (I kinda expected it :(

      Additional Note No.2: After I did the .exe install I went back and found another copy (now a total of 3) of the functionList.xml file located in a different User subdir (admin_<username>). It wasn't there before I did the .exe install. I placed a copy of my modified version of the file in this location. However, no change. Get the window, nothing in it.

      Again, I appreciate the help.

      Cheers....Steph

       
      Last edit: stepher 2013-07-04
  • stepher
    stepher
    2013-07-04

    OK. Since my computer was restarted this morning, I decided to see if anything changed with NPP. Same as it was :(

    I even tried some C/C++ code to see if I could get FunctionList show any procedures and/or functions. Still nothing. There seems to be some "disconnect" between function list and the "search" expressions. I still get the FunctionList window, but it is completely empty.

    I am open to suggestions and ideas here. Thanks.

    Happy 4th (to those who celebrate it)...Steph

     
  • Rob Kodey
    Rob Kodey
    2013-07-04

    Hmm... You're already trying all the right things. In my particular case, I use NPP in "portable" mode by selecting "Don't use %APPDATA%" during the install. Thus, the only location for me is right in the Notepad++ install directory.

    Now, I can't imagine the "Don't use %APPDATA%" would make any difference. I would NOT try it, unless you're comfortable relocating everything from your users AppData Notepad++ directory to your install directory.

    The documentation suggests the file you should be editing is in your %APPDATA% directory. Do you want to attach your current FunctionList.xml file to this thread? Maybe there's a simple XML error. (they're easy to miss!)

     
  • Don HO
    Don HO
    2013-07-04

    @Steph:
    1. Make sure you use v6.4.1
    2. Make sure you DON'T have doLocalConf.xml in your Notepad++ installed directory.
    3. Remove %APPDATA%\Notepad++\functionList.xml so Notepad++ will copy this file fom his installed directory into %APPDATA%\Notepad++.
    4. Check the attached file with functionList. If it does work, then you can modify %APPDATA%\Notepad++\functionList.xml for adding your parser.

    Don

     
    Last edit: Don HO 2013-07-04
    Attachments
  • stepher
    stepher
    2013-07-05

    Update: I figured out item No. 1 below. For some reason, one file was set for UNIX/OSX EOL Format. Once I changed it to Windows Format (Edit/EOL Conversion/Windows Format), everything worked fine. I am on Win7.

    Still need to figure out if I can change the FL sorting process (No. 2 below).

    Rod/Don,

    Thanks so much for the help and continued support.

    I followed Don's suggestions and actually got Function List (FL) to work with the .cpp file he attached. I then copied over my original assembler parser code and restarted. Back to the same problem. I deleted my parser code and it worked. So I copied/pasted the js (java) parser code in the "new" file and modified/edited it for my assembler parser and, voila', success (to a point :) I now had assembler labels showing up in the FL window. Thank you for the help!!!

    I suspected some cntl code slipped into my orig mods (klutzy keyboarding, maybe :) causing the failure. However, I did turn on VIEW/SHOW SYMBOLS/ALL while looking at the "failing" parser code and only saw the typical tabs, crs and lfs, but nothing I would consider unusual. So, I have no idea what happened (May explain why it worked for you, Rod, and not me).

    Rod....I appreciated your suggestions of regexpr but I had to go back to my orig regexpr because your code wasn't exclusive enough for what I needed. It was picking up words as labels from the comments area if they were followed by a ":" (i.e. "; created:" would generate a label even tho it was really part of the comments)

    I still have 2 things still to work out.

    1. I noticed that if the next line after a label is a comment line (starting with a ";") the label doesn't get listed. If there's an instruction, blank or any other kind of line after the label, the label is captured and displayed. Any suggestions for how to code for this?

    2. When FL was a plugin in previous versions, it provided a choice (buttons at the top of the Function List window) to list functions/labels sorted either by program flow/structure (which the current Function List does now) or alphabetical. I prefer alphabetical sort. Is there a setting I missed that allows this option, or is there anyway to program it into the parser code (I guess hard-coded)?

    This is more of an observation than an issue. FL as a plugin would regen/update a list of labels every time a change was made to the screen. This new FL seems to require a disabling/re-enabling to update its window. Don't know if there is any setting to change that.

    Again, thanks for the assistance.

    Cheers...Steph

    PS - Here's what my current (working!) parser code looks like:

            <parser id="asm_funct" displayName="Assembly" commentExpr=";">
                <function
                    mainExpr="(^[\s]*[A-Za-z0-9_]+:)"
                    displayMode="$className->$functionName">
                    <functionName>
                        <nameExpr expr="^[\s]*[A-Za-z0-9_]+"/>
                    </functionName>
                    <className>
                        <nameExpr expr="[\w_]+(?=[\s]*::)"/>
                    </className>
                </function>
            </parser>
    

    Note: While an assembler label typically should not contain any leading spaces (nor any leading char other than alphanumeric or "_"), I decided to allow for it (spaces anyway). I may change my mind at some point, tho.

     
    Last edit: stepher 2013-07-06