News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Code Folding in ASP (VBScript) doesn't work

Started by rickg22, December 03, 2010, 01:42:56 AM

Previous topic - Next topic

rickg22

Hi guys. I don't know if this is a bug or I'm missing some plugin...

I have an .asp file that I'm editing. It has a <% tag at the beginning and a  %> tag at the end.

There is a folding indicator for those tags, but inside, I can see no folds between a begin and and end. I even tried the custom //{ and //} folding, but that doesn't work either.

Checking on the syntax highlighting I saw that the file is marked as "HTML/ASP/JS/PHP". If I change it to "VBSCRIPT" I get no folding between the <% and %> tags, but all the code becomes squiggly underlined.

Am I missing something?

Thanks!

MortenMacFly

IHMO this was a bug in the scintilla version we are currently using. I've a patch pending though... stay tuned.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

rickg22

#2
I downloaded revision 7075 which according to the post, has a streamlined wxscintilla... but the folding still doesn't work :( Do I have to assume that scintilla just doesn't fold well with ASP?

EDIT: I managed a workaround. Since Codeblocks assumes the " ' " character is a string delimiter (and not a comment delimiter as VBSCRIPT specifies), I only create a "fake string" commenting a bracket:


function myfunction(blah) '  ' {

end function '  '}


EDIT: On reloading, the above trick doesn't work! :'(

MortenMacFly

...did you try with SciTE?

I've no idea about how well scintilla supports vbscript. :-(
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

rickg22

#4
I tried with SciTE, and if I select "VBScript", I can fold properly.

EDIT: This is interesting. In an older version of C::B (5686), I can select "vbscript" as the highlighting mode, and the blocks show Ok. But in the newest version, the change had no effect.  I'll try tomorrow at work (where I have the latest C::B) to confirm.

Here's the sample "test.asp":


<%
class myclass

function myfunc(a,b,c)
blah
blah

end function


end class
%>

rickg22

I tried in C::B at work.

If I change to VBScript, the folding doesn't change automatically. I need to configure in the editor settings to use VBScript for ASP files, and then the folding will appear.

But then another problem comes: ALL the file is squiggly-underlined in green. I can't understand why, as nothing in the editor settings is underlined :(