VB script function list
-
Please, did anyone write a function list for the visual basic script? The old functionList.xml no longer works in the new version of N ++ ;-().
-
I made file vbs.xml:
<?xml version=“1.0” encoding=“UTF-8” ?>
<!-- ==========================================================================\To learn how to make your own language parser, please check the following link: https://npp-user-manual.org/docs/function-list/ |
=========================================================================== -->
<NotepadPlus>
<functionList>
<!-- ========================================================== [ VBS ] --><!-- | Based on: | http://sourceforge.net/p/notepad-plus/patches/613/ \--> <parser displayName="Visual Basic (.NET|Script|for Applications)" id ="vb_function" commentExpr="(?m:((?<=').*?$)|((?i:REM)([\t ].*?)?$))" > <classRange mainExpr="(?s:(?<SCOPE>(?i:CLASS|TYPE)).*?(?i:END[\t ]\k<SCOPE>))" displayMode="node" > <className> <nameExpr expr="(?i:CLASS|TYPE)[\t ]+(?:[A-Za-z_][\w]*\b)(?:.*?[\r\n])" /> <nameExpr expr="[\t ]+(?:[A-Za-z_][\w]*\b)" /> <nameExpr expr="[A-Za-z_][\w]*" /> </className> <function mainExpr="(?m:^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|SHARED|SHADOWS|OVERRIDABLE|OVERRIDES|READONLY|WRITEONLY)[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$))" > <functionName> <funcNameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/> <funcNameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/> <funcNameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?=[\t ]*\()"/> </functionName> </function> </classRange> <function mainExpr="^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)" displayMode="$functionName"> <functionName> <nameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(?:ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/> <nameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/> <nameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?i:[\t ]+(LIB|ALIAS)[\t ]+[\w"\.]+)*(?=[\t ]*\()"/> </functionName> </function> </parser>
</functionList>
</NotepadPlus> -
I reverted to version 7.8.6 now ;-()
All OK… -
You were actually pretty close.
The old functionList.xml never had a pre-defined VB parser (that I can find in any of my old version zipfiles), so yours is apparently one that you added at some point.
Looking in old functionList.xml, the language ID constant is
18
forL_VB
, which is the language constant for Language > V > Visual Basic.Looking in the new
overrideMap.xml
,<association id= "vb.xml" langID= "18"/>
… that same language appears to want
vb.xml
as the filename, notvbs.xml
. To get it to work in v7.9.1, you would either need to rename your file fromvbs.xml
tovb.xml
, or you would need to move the line I showed out of the comment section, and change it to<association id= "vbs.xml" langID= "18"/>
… to match your filename, something like:
-
@Jiří-Basler said in VB script function list:
I reverted to version 7.8.6 now ;-()
I have another solution.
I wrote a lot of development scripts for myself.
They are in this repository. https://github.com/trdm/jn-npp-scripts
There is also navigation through the VBS functions.
-
Yes. When I saved a file from this site as
tryFunctionList.vb
, and saved yourvbs.xml
as%AppData%\notepad++\functionList\vb.xml
(note that it’svb.xml
), then reloaded Notepad++, the Function List displayed:Similarly, if I renamed it to
vbs.xml
, editedoverrideMap.xml
to match the screenshot from my previous post,
… then exited and re-entered Notepad++, it also parsed the VB function list as shown.Either of my suggestions worked for me.