Halaman

Jumat, 31 Januari 2014

Lua, Function List on Notepad++

New feature for the notepad++ version 6.5.2! it could shows you the function list for the currently viewed document, function list for php, c++, c, perl is supported out-of the box

For those of you Lua programmer using notepad++, here is a simple how to add Lua function list to the notepad++
  1. Locate your %APP_DATA% folder, if you are using the zip distribution, go to your extraction directory
  2. Open functionList.xml
  3. On NotepadPlus >> functionList >> associationMap , see the commented LangID for LUA, on my installation it is 23
  4. Add the following
    <association langID="23" id="lua_function"/> on that section
  5. Creating the parser:
    on NotepadPlus >> functionList >> parsers add the following section
    <parser id="lua_function" displayName="Lua" commentExpr="((--\[\[.*--\]\])|(--.*?$))">
     <function
      mainExpr="function\s+(\w+[:\.])?(\w+\s*\(\s*[\w,\s]*\s*\))"
      displayMode="$className->$functionName">
      <functionName>
       <nameExpr expr="\w+\s*\(\s*[\w,\s]*\s*\)"/>
      </functionName>
      <className>
       <nameExpr expr="[\w]+(?=[\s]*[:.])"/>
      </className>
     </function>
    </parser>
    
  6. Warning: if you copy paste xml content on line 5, please make sure that the xml properties are in one line, if they appear to be 2 line, it is because html page wordwrapping ;)
  7. Restart notepad++
  8. Open your lua file, open function list panel (Menu >> View >> FunctionList)
If the functions is not showing, chances are :
  1. You are using Gary's mod lua lexer.. uninstalling it should overcome the problem
  2. Wrong language ID noted from step 3
That's all! :)
Have fun!

1 komentar:

  1. Thank you so much for this! I have been googling for the past 30 minutes to find a solution. I love notepad++ and I need lua function list.

    BalasHapus