Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rickg22 on December 03, 2010, 01:42:56 am

Title: Code Folding in ASP (VBScript) doesn't work
Post by: rickg22 on December 03, 2010, 01:42:56 am
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!
Title: Re: Code Folding in ASP (VBScript) doesn't work
Post by: MortenMacFly on December 03, 2010, 06:47:14 am
IHMO this was a bug in the scintilla version we are currently using. I've a patch pending though... stay tuned.
Title: Re: Code Folding in ASP (VBScript) doesn't work
Post by: rickg22 on April 13, 2011, 08:33:45 pm
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:

Code
function myfunction(blah) '  ' {

end function '  '}

EDIT: On reloading, the above trick doesn't work! :'(
Title: Re: Code Folding in ASP (VBScript) doesn't work
Post by: MortenMacFly on April 14, 2011, 06:32:49 am
...did you try with SciTE?

I've no idea about how well scintilla supports vbscript. :-(
Title: Re: Code Folding in ASP (VBScript) doesn't work
Post by: rickg22 on April 14, 2011, 06:51:10 am
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":

Code
<%
class myclass

function myfunc(a,b,c)
blah
blah

end function


end class
%>
Title: Re: Code Folding in ASP (VBScript) doesn't work
Post by: rickg22 on April 14, 2011, 05:40:42 pm
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 :(