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.
-
@Jiří-Basler In recent versions of Notepad++, the functionList.xml structure may have changed, leading to compatibility issues with older files. The functionList.xml file typically specifies how Notepad++ recognizes functions for various languages, including Visual Basic Script (VBScript). Here’s how you can create or update a functionList.xml for VBScript in the latest version of Notepad++.
Steps to Create/Update a Custom functionList.xml for VBScript
Locate the Function List Folder:Go to Notepad++'s installation directory.
Open the functionList folder (usually located at C:\Program Files\Notepad++\functionList).
Create a New functionList.xml (or Update It):If the functionList.xml file exists, open it.
If it doesn’t exist, you can create a new one specifically for VBScript.
Edit the functionList.xml for VBScript: Use the following template to recognize Function, Sub, and Property declarations in VBScript. -
@Kanesaga said in VB script function list:
Open the functionList folder (usually located at C:\Program Files\Notepad++\functionList).
Create a New functionList.xml (or Update It):
If the functionList.xml file exists, open it.
If it doesn’t exist, you can create a new one specifically for VBScript.
Edit the functionList.xml for VBScript: Use the following template to recognize Function, Sub, and Property declarations in VBScript.There are already instructions for “Function List” in the user manual, and those are way less vague than what you’ve described here, so I’d dub your posting of no value (sorry).
-
To future readers,
To expand on what @Alan-Kilborn said,
There are already instructions for “Function List” in the user manual
@Kanesaga’s post was not only probably trying to spam (I just deleted the poorly-inserted link – to a site completely unrelated to Notepad++ or FunctionList – which fortunately, the anti-spam measures prevented from being a hidden link), but also appears to be the instructions for the pre-v7.9.1 single-
functionList.xml
, instead of for the v7.9.1-and-newer that the original poster was asking about 4 years ago.Please understand that the instructions given in that recent post are out of date, and will not work on modern Notepad++ versions. As was said four years ago, the answer to the original question was just a slight tweak to the
overrideMap.xml
file.