functionlist problem
-
To make copy/paste easy, I would say change it (with an italic footnote)
-
@Michael-Vincent Thanks Michael, I put the vb.xml file in the function list folder but when I open npp the function list window is empty. So I forget something?
-
@Andrea-Dotta Ok. I tried to copy the second version in the https://community.notepad-plus-plus.org/post/64288 link and now it works!! There is something different into the code. but doesn’t matter.
Thanks a lot Peter and Michael!Cheers.
-
Thanks. Can the updated vb.xml be sent in to be made part of the NPP install package? Is there a UDL file that goes with this?
I use VB6 and both would be useful.
-
@swegmike said in functionlist problem:
Thanks. Can the updated vb.xml be sent in to be made part of the NPP install package?
If the owner of that functionList definition for VB decided to submit it to the NPP repo, it could be.
Is there a UDL file that goes with this?
No. There is a built-in language for Visual Basic (Language > V > Visual Basic), so there is no need for a UDL (because the builtin lexers have more features available that the UDL cannot replicate).
I use VB6 and both would be useful.
One of the great things about the design philosophy of Notepad++ is that these config files are made as config files, so that you can configure these things yourself, or download from alternate sources, even if Notepad++ doesn’t distribute them in the installer. It’s a one-time action that you can take, based on what was talked about here, that will survive every update/upgrade on your current computer. So if you’ve already added it based on this discussion, you will have it even as Notepad++ continues to be updated – no extra work on your part.
-
@PeterJones Sorry, I missed the VB in the language list. I wonder which VB version it supports i.e. VB6 or an older version. I guess one can run it against older versions to see what happens.
-
@swegmike said in functionlist problem:
I wonder which VB version it supports i.e. VB6 or an older version
Probably a mix of versions, including VB6, VBA, VBScript, and similar. The syntax is all quite similar between those… at least similar enough that the essential parsing is probably all the same. (The same is true for C/C++: the same LexCPP source code is used for C, C++, Java, and JavaScript.)
That lexer is maintained in Scintilla’s Lexilla project; you might be able to dig into the history there if you want to know more about what versions they claim to support. But you can look at Notepad++'s defaul list of keywords for Visual Basic highlighting in Settings > Style Configurator > VB / VBS > WORD.
-
@Michael Vincent
I copied your modified vb code above and used it against my simple vb program. It will work after the following fixes.
-
replace the < and > with
<
and>
commentExpr=“(?x)(?m:((?
<
=').?$)|((?i:REM)([\t ].?)?$))”mainExpr=“(?s:(?
<
SCOPE>
(?i:CLASS|TYPE)).*?(?i:END[\t ]\k<
SCOPE>
))”In functionname it complains that it is expecting whitespace. 2). remove the " that was in the statement below; otherwise, if the regular expression needs it change it to `"` I don't know how your regular expression is supposed to work for this step. Is it supposed to do the same thing as the class one that is similar? ``` <nameExpr expr= "(?x)(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?i:[\t ]+(LIB|ALIAS)[\t ]+[\w\.]+)*(?=[\t ]*\(|$)"/>
You may want to add (?x) after each expr name so that # comments can be added to document the code.
-
-
@swegmike I’m not sure how to get the forum to show the xml equivalent with ampersand and name without it displaying the actual character. The website keeps flagging any variation as spam. For example an ampersand with gt and semicolon or ampersand with lt and semicolon or ampersand with quot and semicolon.
When it sees the ampersand symbol by itself it flags as spam.
When I use the code block it makes it worse.
Peter help fix it.
-
@swegmike said in functionlist problem:
When it sees the ampersand symbol by itself it flags as spam.
When I use the code block it makes it worse.For me,
<
and>
and"
all work find in the forum.I think your initial was trying to say something like:
commentExpr="(?x)(?m:((?<=').*?$)|((?i:REM)([\t ].*?)?$))" vs commentExpr="(?x)(?m:((?<=').*?$)|((?i:REM)([\t ].*?)?$))"
-
For me,
<
and>
and"
all work find in the forum.But when I tried to edit that
find
intofine
after posting, the forum editor kindly turned the HTML escapes into the raw characters in the editor window, so I aborted the edit and changed to a reply. I was also going to add that putting markdown between backticks (like this: `&`
to render like this:&
… or, as I have above,`<` and `>` and `"`
to render as<
and>
and"
) works properly (as long as you aren’t editing your post again later).So now I think maybe your repeated edits were messing things up even more than whatever forum markdown you originally had.
BTW: instead of using
"
in the regex embedded in XML to try to make the XML convert the entity into the actual character, I might recommend\x22
in the regex to match a literal quote. -
@PeterJones
I think the ability to modify a post til it shows correctly needs to be fixed so that one doesn’t have to get it right on the first post. Some keys on this old company laptop don’t always work and must be redone. Moreover, the back tick comment that shows how to get the xml ampersand codes into a forum post isn’t in the FAQ. So I guessed alot.
Af for the original VB code by mike vincent, there are errors such that npp doesn’t like " or < and > in the regular expression. Thus the vs. part of your post is the correct one for both amperand lt and ampersand gt along with the error in the functionname that has a ". When this is removed, NPP doesn’t complaain on save. Perhaps this was mike vincents typo or if it is needed the regexp needs fixing along with changing it to ampersan quot.The back ticks seem o work. need to add this to the FAQ.
-
@swegmike said in functionlist problem:
Moreover, the back tick comment that shows how to get the xml ampersand codes into a forum post isn’t in the FAQ.
Where “isn’t in the FAQ” means “has a whole paragraph devoted just to that feature”. Look at https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts , especially the Red Typewriter Text section.
-
@PeterJones The brief section talks about back ticks and there is some red typewriter text to; however, I wouldn’t have thought that it applied to the xml ampersand strings since I was looking specifically how to encode the ampersand strings. Perhaps you can add this as other examples pertaining to ampersand strings.
I’ve fixed my post above to correct the vb functionlist parser errors to include the ampersand strings; however, mike vincent will need to chime in to say if the functioname required the double quote within the regexp and or fix the error by removing it or marking it as the xml ampersand quote along with any regexpresson processing fixes.
-
On a side question I have on the functionlist parser is
that my dxl parser regexpression using regex101 tester can find and highlight the following function code. NPP using my regexp can find them to, but will not display the function name found completely, but only the first line for functions add1,2 and add5 to include its parameters.
Is there a way to have the functionlist show multiple lines that describe a given function name with its parameters or where the regexp can manipulate the multiline into one for the functionlist to display it completely? I don’t think regexp in NPP allow me to replace the EOL at the end of the line with null and then stop when { found so that the multilines are joined into one line for display by functionlist.add0(){{}} int add1 (int a, int b ) { real add2 (int c_) { return } } test real add3 (int d()) { } int add4 (int &e[]) { return f } bool add5(array[] b, int c, real d, book e_ ) { Array add6 () { // overload tests with :: ::do( int a, Skip CP_KOR, 1.5e-04, 'A', "MIKE keyword", a <>) { // string ::*(string s, int n) { :if(a ,b) {
-
@swegmike said in functionlist problem:
think the ability to modify a post til it shows correctly needs to be fixed
NodeBB are the authors of the forum software. The Notepad++ just uses an instance (that NodeBB team also kindly donates the server space for our Community). Neither I nor Don have any ability to change the base code for NodeBB, nor do we have any particular sway with NodeBB in getting code changed.
-
@swegmike said in functionlist problem:
Is there a way to have the functionlist show multiple lines
Nope
Or where the regexp can manipulate the multiline into one for the functionlist to display it completely
I believe the manual explicitly stated that the functionalist regex cannot change the text; it is a match-only expression