Code Folding for ColdFusion files very erratic

Code Folding for ColdFusion files very erratic

7
NewbieNewbie
7

    Sep 02, 2006#1

    Hello all,

    I am hoping this is the right forum for this question.. I seem to think it is related to the wordfile and syntax highlighting..

    Anyway, i am frustrated with how erratic and essentially unusable the code folding feature is for my ColdFusion files. On extremely simple stuff it works, but even if it gets just a little more complex, code folding completely falls apart and acts totally bizarre.

    Here is a good example of code that never code folds right. I have also put my coldfusion wordfile up on my website at http://reubenavery.freepgs.com/coldfusion_wordfile.txt

    thanks for any help!
    ~r

    Code: Select all

    <cffunction name="drawPageFooter">
    	<cfif not isDate(request.launchEndTime)><cfset request.launchEndTime = now() /></cfif>
    	<cfif StructKeyExists(request, 'debugMsgs') and IsArray(request.debugMsgs) and ArrayLen(request.debugMsgs)>
    		<!--- The request.debugMsgs array holds misc errors and messages generated here and within CFC's --->
    		<cfoutput>
    			<hr/>
    			<ul>
    			<cfloop index="i" from="1" to="#ArrayLen(request.debugMsgs)#">
    				<li>#request.debugMsgs[i]#</li>
    			</cfloop>
    			</ul>
    		</cfoutput>
    	</cfif>
    	<cfoutput>
    		<hr/>
    		<div id="footer">
    			<p>
    				job run began
    				#DateFormat(request.launchStartTime, 'm/dd/yy')# #TimeFormat(request.launchStartTime, 'HH:mm:ss')#, 
    				finished #TimeFormat(request.launchEndTime, 'HH:mm:ss')# 
    				(elapsed time #DateDiff('s', request.launchStartTime, request.launchEndTime)# secs)
    			<p>
    		</div>
    		</body>
    		</html>
    	</cfoutput>
    </cffunction>
    

      Sep 02, 2006#2

      by the way, even if i take out that poorly formed html, the cold-folding still does not work right:

      Code: Select all

      <cffunction name="drawPageFooter">
      	<cfif not isDate(request.launchEndTime)><cfset request.launchEndTime = now() /></cfif>
      	<cfif StructKeyExists(request, 'debugMsgs') and IsArray(request.debugMsgs) and ArrayLen(request.debugMsgs)>
      		<!--- The request.debugMsgs array holds misc errors and messages generated here and within CFC's --->
      		<cfoutput>
      			<hr />
      			<ul>
      			<cfloop index="i" from="1" to="#ArrayLen(request.debugMsgs)#">
      				<li>#request.debugMsgs[i]#</li>
      			</cfloop>
      			</ul>
      		</cfoutput>
      	</cfif>
      	<cfoutput>
      		<hr />
      		<div id="footer">
      			<p>
      				job run began
      				#DateFormat(request.launchStartTime, 'm/dd/yy')# #TimeFormat(request.launchStartTime, 'HH:mm:ss')#, 
      				finished #TimeFormat(request.launchEndTime, 'HH:mm:ss')# 
      				(elapsed time #DateDiff('s', request.launchStartTime, request.launchEndTime)# secs)
      			</p>
      		</div>
      	</cfoutput>
      </cffunction>
      

      6,683583
      Grand MasterGrand Master
      6,683583

        Sep 02, 2006#3

        I have not looked deeply into your problem because your wordfile lets me already think where the problem could be. Your language definition contains no code folding string specifications. Read carefully the help of UltraEdit/UEStudio about Syntax Highlighting or look at Syntax.txt in the program directory of UE/UES. There all available code folding settings for your version of UE/UES are explained in details.

        I can see you use HTML_LANG for your cold fusion files. So you use the built-in code folding strings for HTML. Hopefully you don't have a second language definition in your wordfile with the language marker HTML_LANG because this is not allowed. From syntax.txt:
        Note that if your wordfile contains multiple occurrences of the HTML_LANG language marker, this must be corrected or some languages may not highlight correctly. UE/UES allows only one instance of a language marker (i.e., C_LANG, COBOL_LANG, HTML_LANG) in a wordfile.
        Best regards from an UC/UE/UES for Windows user from Austria

        7
        NewbieNewbie
        7

          Sep 03, 2006#4

          Thanks. I read that syntax.txt .. mucked around a bit with the wordfile... still cannot get it to act nicely with the cold folding.

          the ColdFusion wordfiles available here are almost worthless. "Almost" because at least they have a bunch of the CFML tags and attributes in there.. but not all...

          pretty hokey

          :-(

          yeah yeah so what i know coldfusion is just a lame proprietary platform that is fading away in the face of php et al..... it pays the rent, though. i hate using dreamweaver, that bloated buggy piece of garbage..

            Sep 03, 2006#5

            Okay, I have been mucking around.. have gotten a bit more familiar with subtleties of the wordfile however still cannot quite get the code folding to work.

            I am trying the following which has no effect:

            Code: Select all

            /Open Fold Strings = "<^([A-Za-z_]+[A-Za-z0-9_]^)+[A-Za-z0-9_=]++>"
            /Close Fold Strings = "</^1>"
            The regex there works fine to nail down a html/cfml tag. i was hoping that the </^1> in the close string would indicate that something structured like

            Code: Select all

            <tag attr=1>
            ..
            </tag>
            .. would work since the open regex would identify "tag" as ^1, effectively stating that <tag..> to </tag> is a foldable block of code

            but nada!

            Maybe I cannot use regexs in the code folding strings? If so, that is a bummer.

            I need to be able to instruct ultraedit to intelligently match an open-tag with its corresponding close-tag. Not 'any' close tag, but the correct close tag. And be smart about nesting.. and what about dynamic generated stuff like WriteOutput('<div id="#op#">').. uedit needs to ignore what is inside this kind of statement..

            etc..

            I am asking too much?

            :(

            112
            Power UserPower User
            112

              Sep 03, 2006#6

              puffbunny wrote:Maybe I cannot use RegExs in the code folding strings? If so, that is a bummer.
              Unfortunately yes...
              You can't use RegEx in code folding strings (as far as I'm aware).
              Since UE is NOT a language compiler it's pretty hard to get it to fold properly - I've reported a number of code folding bugs but I realize that without UE understanding not just the syntax of the language, but also quite a bit of its semantics, it can't fold to our satisfaction.

              HTH,
              Paolo
              There is no such thing as an inconsistently correct system...
              Therefore, aim for consistency; in the expectation of reaching correctness!

              7
              NewbieNewbie
              7

                Sep 03, 2006#7

                if it were to accept regex's kind of like i described above, that could give enough power to deal with the uniqueness of the CF language quite effectively..

                and what is up with not being able to use Unix/perl regex's in the wordfile??

                c'mon guys.... lazy