Functionlist no longer working on .vb files
-
It looks like the parser
s
tag was removed. I’m currently trying
to find out when this happened. -
Seems this has been introduce with version 7.9.1.
-
Correct, the new syntax doesn’t include the
<parsers>
tag wrapped around the<parser>
tag anymore.Hmm, looks like the documentation for Function List and especially function list section of config files could use slight improvement to make it more clear that you don’t need the
<parsers>...</parsers>
with v7.9.1 and newer. -
The new solution seems not cover lexer plugins.
I was trying to use<association id= "v.xml" langID= "86"/>
or
<association id= "v.xml" userDefinedLangName="VLang"/>
But both failed. Technically lexer plugins do get an unique ID
assigned but this varies depending how much lexer plugins you are using.
So … any ideas?
I assume I have to open an issue. -
Did you remember to also update the
overrideMap.xml
? For default builtin lexers, the overrideMap defaults to a reasonable value (shown in comments); but for any others (like UDL and presumably lexer plugins), you have to update the overrideMap. -
I use this file and it works:
<?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> <!-- ================================================== [ VB/VBS/VBA ] --> <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>
-
Sorry, I should have clarified that these changes were made in overrideMap.xml.
-
These overrideMap customizations work for me
<!-- ==================== Peter's Customizations ============================ --> <association id= "my_perl.xml" langID= "21" /> <association id= "udl_markdown.xml" userDefinedLangName="Markdown"/> <association id= "udl_cadence.xml" userDefinedLangName="Cadence"/> <!-- ======================================================================== -->
The first overrides where the default perl (#21) file is named. The other two are for UDL maps.
So what you showed does look like the syntax you should use. Maybe a bug in the implementation that doesn’t allow for plugin-based lexers to work with functionList?
-
@PeterJones said in Functionlist no longer working on .vb files:
Maybe a bug in the implementation that doesn’t allow for plugin-based lexers to work with functionList?
I am currently assuming this is the case, but am struggling to really understand the code. Will have to check this further.
-
Issue, perhaps better called question, 9519 opened.
-
@Ekopalypse
I’m back to normal. Thanks for your help, this copy did it.best regards
Diedrich