Bug + trying to learn

3 views
Skip to first unread message

Raffaele Castagno

unread,
Nov 5, 2009, 11:22:49 AM11/5/09
to CFEclipse Users
I'm trying to solve myself an annoying bug.

This line

//writeoutput("abbin_in_cache -> " & abbin_in_cache & "<br>");

makes the syntax highlighting go weird.

Variations.

This is OK (removed the last double quotes):
//writeoutput("abbin_in_cache -> " & abbin_in_cache & "<br>);

but this is KO (removed only the <br>):
//writeoutput("abbin_in_cache -> " & abbin_in_cache & "");

What I think is that comments should be ignored by all highlight
processes except the one related to comments, as it seems that the one
related to "strings" is coming in the way.

What should be the correct fix to that? And where should it go?

Thanks.

Raffaele

Steven Durette

unread,
Nov 5, 2009, 6:05:28 PM11/5/09
to cfeclip...@googlegroups.com
I have a similar issue...

If I do:

<cfloop...>
<!--- bunch of code --->

<cfset Variables.myTestVar = "Items:" />
<cfset Variables.myTestVar2 =
         "This is a test. "
         & Variables.myTestVar
         & "1, 2, 3, 4" />

<!--- more code --->
</cfloop>

The Red dot shows up at the opening of the cfloop and says: CFLoop is missing a closing tag. All CF tags that surround that cfloop also display that they are missing a closing tag.

Changing the second cfset to:
<cfset Variables.myTestVar2 = "This is a test. " & Variables.myTestVar
     & "1, 2, 3, 4" />

solves the problem, but sometimes I want it to look the other way.  Specifically making sure that the first & is on the same line as the cfset fixes the problem.

Steve

Peter Boughton

unread,
Nov 5, 2009, 6:14:48 PM11/5/09
to cfeclip...@googlegroups.com
Hi Steve,

Have you tested this with the latest nightly?

There's a fix in that to allow newlines in tags - was done for syntax like this:
<cfdirectory
name = "qryDir"
directory = "#Arguments.DirName#"
sort = "type ASC,name ASC"
/>

But it should also work for your cfset stuff. Unless you are using the
nightly, in which case I need to check what I did and fix it properly.

Thanks,

Peter

Steven Durette

unread,
Nov 5, 2009, 7:04:55 PM11/5/09
to cfeclip...@googlegroups.com
Nope not using the nightly. How do I set it up to use the nightly?

Peter Boughton

unread,
Nov 5, 2009, 7:10:42 PM11/5/09
to cfeclip...@googlegroups.com
Um, I can't remember. :$

I think you can just change the update site to point at
http://cfeclipse.org/update-nightly/ but I couldn't say if that will
correctly replace your current cfe install.

Probably best to wait for someone to confirm/correct the procedure -
unless you've got your cfe install & data all fully backed up and are
feeling adventurous. :)

Randy

unread,
Nov 5, 2009, 7:11:17 PM11/5/09
to CFEclipse Users
Just point your update site to http://cfeclipse.org/update-nightly

Although it's not *really* nightly... :)

Randy

unread,
Nov 5, 2009, 7:33:47 PM11/5/09
to CFEclipse Users
Playing around with this in the nightly it is still having the same
issue. It seems that the < character is blowing up the syntax
highlighter. Peter you probably know more about how to fix it than I
do...?

I checked in a build from the repository and the < is killing the
highlighter.

I checked Steven's code in the build from the repository and it's
working as expected. I didn't see any errors when I did:

<cfloop from="1" to="10" index="i">
<cfset Variables.myTestVar = "Items:" />

<cfset Variables.myTestVar2 =
"This is a test. "
& Variables.myTestVar
& "1, 2, 3, 4" />
</cfloop>

Randy

Peter Boughton

unread,
Nov 5, 2009, 8:05:01 PM11/5/09
to cfeclip...@googlegroups.com
> Playing around with this in the nightly it is still having the same
> issue. It seems that the < character is blowing up the syntax
> highlighter. Peter you probably know more about how to fix it than I
> do...?

Dunno - I've not actually looked at the syntax highlighting stuff before.

I did have a quick look earlier and it's using some jface rules thing
I'm not familiar with - would need to look further into how all that
works.

Ok, so from some quick digging, the problem is caused by line 212 of
/org.cfeclipse.cfml/src/org/cfeclipse/cfml/editors/partitioner/scanners/CFPartitionScanner.java
- where it sets up the partition rules for HTML tags.

Commenting that line out fixes the syntax highlighting, but presumably
would fail to work for actual HTML also.

There must be a way to say "while in a comment, stop processing other
rules", but unless there's someone familiar with all that stuff
already, I'd need to go investigate how it all works to determine how
to do that.

However, it's just gone 1am here and I have to be up early, so all
that will need to wait for tomorrow evening, and I better say
goodnight to all and hurry to bed.

denstar

unread,
Nov 5, 2009, 8:13:58 PM11/5/09
to cfeclip...@googlegroups.com
On Thu, Nov 5, 2009 at 5:33 PM, Randy wrote:
>
> Playing around with this in the nightly it is still having the same
> issue. It seems that the < character is blowing up the syntax
> highlighter. Peter you probably know more about how to fix it than I
> do...?

That, I think *must* be the change I made to the string coloring. The
odd thing is, the < shouldn't affect the ", which is all I changed.
Heh. I said "shouldn't affect" and "all I changed" in one sintence.

--
To exist is a habit I do not despair of acquiring.
Emile M. Cioran

Message has been deleted

denstar

unread,
Dec 15, 2010, 5:11:17 PM12/15/10
to cfeclip...@googlegroups.com
On Wed, Dec 15, 2010 at 10:26 AM, MarcAndre wrote:
> I have found a similar problem with the quotes.
> This code makes the parser / highlighter bug :
> Replace(session.Filtre.MotsCles, " ' ", " ' ' ", "all")
>
> When there is a single quote inside a double quoted string (or vise-versa)
> the inside quotes should be ignored, but instead it tries to find the ending
> quote to the third single quote (inside the second string) and it messes up
> the entire file.

Are you guys on the latest dev build? I'm not able to reproduce this locally.

Can anybody else running the latest dev build verify?

:Den

--
Science must begin with myths, and with the criticism of myths.
Karl Popper

Message has been deleted

MarcAndre

unread,
Dec 15, 2010, 6:41:28 PM12/15/10
to cfeclip...@googlegroups.com
I have found a similar problem with the quotes.

This code makes the parser / highlighter bug : 

Replace(session.Filtre.MotsCles, " ' ", " ' ' ", "all")

When there is a single quote inside a double quoted string (or vise-versa) the inside quotes should be ignored, but instead it tries to find the ending quote to the third single quote (inside the second string) and it messes up the entire file.

I am using version 1.4.3 on Eclipse 3.5.1 32 bit on Windows 7 64 bit. 

denstar

unread,
Dec 16, 2010, 2:44:38 AM12/16/10
to cfeclip...@googlegroups.com
On Wed, Dec 15, 2010 at 4:38 PM, MarcAndre wrote:
> I am using version 1.4.3 on Eclipse 3.5.1 32 bit on Windows 7 64 bit.

I just pushed out a build to the preview update site, can you try it
out and let me know if you're still seeing this?

The preview site update url is :

http://cfeclipse.org/update-preview

:Den

--
I can never read this book, just like I can never see a movie that I
wrote a screenplay for. I can read it and see it physically, but I
can't accurately judge it. I'm too close to it. If I read it ten times
I'll have ten different reactions.
Richard Price

Reply all
Reply to author
Forward
0 new messages