Discussion:
Notepad++ functions list
(too old to reply)
oc_forums
2013-09-03 12:38:53 UTC
Permalink
Hi,

From version 6.4.3 the new feature "function list" seems usable. ( http://notepad-plus-plus.org/features/function-list.html ). I want to list everything that is a procedure so I added in the file functionList.xml the following lines :

After the association map :
--------------------------

<association langID = "29" id="tcl_procedure"/>

And then, in the parser section, the lines :
--------------------------------------------

<parser id="tcl_procedure" displayName="Tcl source" commentExpr="(#)">
<function
mainExpr="^[\t ]*((proc)[\s]+)"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w]|:)+"/>
</functionName>
<className>
<nameExpr expr="[\w_]+"/>
</className>
</function>
</parser>

But the display only gives :
--------------------------------

-- (Filename)
-----"proc" as a class
------- proc
------- proc
------- .... (there is a proc foreach procedure that has been found )

I cannot catch the name of the procedure.

Has anyone tried to use this feature ( with success ;-) ) ?

Thanks,

Olivier.
DDG
2013-09-13 08:35:27 UTC
Permalink
Hi Olivier,

Indeed Npp looks promising with the function list.

You made the error of just grabbing only the (proc) part in the main expression.

This works for me:

<parser id="tcl_procedure" displayName="Tcl source" commentExpr="(#)">
<function
mainExpr="^[\t ]*((proc)[\s]+)[^\n]+\{"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="[\w: ]+ \{.*\}"/>
</functionName>
<className>
<nameExpr expr="[\w_]+"/>
</className>
</function>
</parser>

It would be rather nice to extend this for Itcl and the Other OO-frameworks writing the mixed parser.

regards,
Detlef
Post by oc_forums
Hi,
--------------------------
<association langID = "29" id="tcl_procedure"/>
--------------------------------------------
<parser id="tcl_procedure" displayName="Tcl source" commentExpr="(#)">
<function
mainExpr="^[\t ]*((proc)[\s]+)"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w]|:)+"/>
</functionName>
<className>
<nameExpr expr="[\w_]+"/>
</className>
</function>
</parser>
--------------------------------
-- (Filename)
-----"proc" as a class
------- proc
------- proc
------- .... (there is a proc foreach procedure that has been found )
I cannot catch the name of the procedure.
Has anyone tried to use this feature ( with success ;-) ) ?
Thanks,
Olivier.
oc_forums
2013-11-15 09:46:09 UTC
Permalink
Hi Detlef ,
Post by DDG
You made the error of just grabbing only the (proc) part in the main expression.
Thank you for the hint and help, it works fine now ! Concerning object procedures, I am not used to it , and the number of writing possibilities would be puzzling to me.

Best regards,

Olivier
e***@gmail.com
2013-11-14 16:46:07 UTC
Permalink
Post by oc_forums
Hi,
--------------------------
<association langID = "29" id="tcl_procedure"/>
--------------------------------------------
<parser id="tcl_procedure" displayName="Tcl source" commentExpr="(#)">
<function
mainExpr="^[\t ]*((proc)[\s]+)"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w]|:)+"/>
</functionName>
<className>
<nameExpr expr="[\w_]+"/>
</className>
</function>
</parser>
--------------------------------
-- (Filename)
-----"proc" as a class
------- proc
------- proc
------- .... (there is a proc foreach procedure that has been found )
I cannot catch the name of the procedure.
Has anyone tried to use this feature ( with success ;-) ) ?
Thanks,
Olivier.
aw99
2014-04-18 09:46:31 UTC
Permalink
Hi Guys,
I've created a functionList.xml which supports Tcl and Bash. You can download it from my site: http://99-developer-tools.com/notepad-function-list-tcl-bash/
Best Regards, Andreas
oc_forums
2014-04-18 18:51:55 UTC
Permalink
Post by aw99
I've created a functionList.xml which supports Tcl and Bash. You can download it from my site: http://99-developer-tools.com/notepad-function-list-tcl-bash/
Best Regards, Andreas
Hi,

I've tried it : replacing only the Tcl part, or using your file available for download. It keeps crashing on 6.4.3 version of NotePad++ though it works well with Detlef version. What version of NotePad++ are you using ?

Olivier
aw99
2014-04-18 11:28:16 UTC
Permalink
Hi Guys,
I've created a functionList.xml which supports Tcl and Bash. You can download it from my site: http://99-developer-tools.com/notepad-function-list-tcl-bash/
Best Regards, Andreas
aw99
2014-04-21 23:42:00 UTC
Permalink
Hi Olivier,

Oh, shi**. I'm using 6.5.5.
Andreas
aw99
2014-04-21 23:43:38 UTC
Permalink
Hi Olivier,
I've rechecked this, you are right. My functionList.xml does not work with Npp 6.4.3. It does work at least with versions 6.4.5, 6.5 and 6.5.5, though.
Regards, Andreas
che2n
2020-06-02 22:00:06 UTC
Permalink
I have added TclOO and namespace. methods, constructor, destructor should be visible and nested, but there is no multi-level nesting.



<parser id="tcl_procedure" displayName="TCL" commentExpr="(#)">
<classRange
mainExpr="^[\t ]*((oo::class[\s]+create)|(namespace[\s]+eval))[\s]+[^\n]+\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
<className>
<nameExpr expr="(create|eval)[\t ]+[\w:_\-.]+"/>
<nameExpr expr="[\t ]+[\w:]+"/>
<nameExpr expr="[\w:]+"/>
</className>
<function
mainExpr="^[\t ]*(((proc|method)\s+[\x21-\x7E]+)|constructor|destructor)[^\n]+?\{">
<functionName>
<funcNameExpr expr="[\w_\-.]+[\s]+\{"/>
<funcNameExpr expr="[\w_\-.]+"/>
</functionName>
</function>
</classRange>
<function
mainExpr="^[\t ]*(((proc|method)\s+[\x21-\x7E]+)|constructor|destructor)[^\n]+?\{"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="[\w_\-.]+[\s]+\{"/>
<nameExpr expr="[\w_\-.]+"/>
</functionName>
<className>
<nameExpr expr="([\w_\-.]+((::[\w_\-.]+)+)?)(?=[\s]*::)"/>
</className>
</function>
</parser>

Loading...