Notepad++ Function List for PL/SQL

匿名 (未验证) 提交于 2019-12-03 01:34:02

问题:

I'm trying to create a function list for my pl/sql source files. I have spc and bdy files (spec and body for packages).

This is what I defined as associations inside functionList.xml (also tried with a "." before the extension):

 <association ext="bdy" id="plsql_func"/>  <association ext="spc" id="plsql_func"/> 

Now, inside <parsers> (at the same level as the other parsers):

 <parser id="plsql_func" displayName="PLSQL Function Parser" commentExp="--.*$">     <function        mainExpr="^[\t ]*FUNCTION[\t ]*[\w]*\(*"        displayMode="$functionName">        <functionName>           <nameExpr expr="[\w]+\("/>        </functionName>     </function>  </parser> 

The regular expression ^[\t ]*FUNCTION[\t ]*[\w]*\(* matches all the function names when I do a search inside a file (no problem there).

I also tried ".*" as the name parser but still, no luck. The function list pane stays empty.

Am I missing something?

ps:

Example function header:

FUNCTION TEST_FUNCTION(O_error    VARCHAR2(300),                        I_args     VARCHAR2(10)) return BOOLEAN IS 

回答1:

My pl/sql source file have extension sql so I defined:

        <association langID="17" id="plsql_func"/> 

and improve a litle your parser.

        <parser id="plsql_func" displayName="PL/SQL" commentExpr="((/\*.*?\*)/|(--.**$))">             <function                 mainExpr="^[\t ]*(FUNCTION|PROCEDURE)[\s]*[\w]*[\s]*(\(|IS|AS)*"                 displayMode="$functionName">                 <functionName>                     <nameExpr expr="[\w]+[\s]*(\(|IS|AS)"/>                 </functionName>             </function>         </parser> 

in my case it work ( notepad++ v6.6.9 )



回答2:

I'm guessing you're using a user defined language for PL-SQL.

Try adding this in your functionList.xml

<association userDefinedLangName="PL-SQL" id="plsql_func"/> 

Where PL-SQL is whatever you call your user defined lanuage.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!