atuttle / atom-language-cfml

:space_invader: A CFML Language for the Atom Editor
38 stars 24 forks source link

Syntax highlighting after the hash character #83

Closed marty80 closed 6 years ago

marty80 commented 8 years ago

The syntax highlighting stops working after the hash character, but it shouldn't.

screenshot

thecfguy commented 8 years ago

Similar issue with string has // and variable with # sign,

<cfset myurl = "http://localsite.com/q=#variables.query#">
willthemoor commented 8 years ago

Came to report something similar. Think it might have something to do with the scope within cfoutput tags.

image

<a href="foo.html#anchor">Link text</a>
<p> Working <em>fine</em>.</p>

<a href="http://blah.cc/foo.html#anchor">Link text</a>
<p> Working <em>fine</em>.</p>

<a href="https://blah.cc/my.cfm?paramid=#get_current_paramID()#">Link text</a>
<p>
  This text is fine. The scope |here| is:
   text.html.cfml
</p>

<cfoutput>
<a href="https://blah.cc/my.cfm?paramid=#get_current_paramID()#">Link text</a>
<p>
  This text and tag have the same highlighting as a string. The scope |here| is:

  text.html.cfml
  meta.scope.cfoutput.cfml
  meta.tag.inline.any.html
  string.quoted.double.html
  string.quoted.double.cfml

</p>
</cfoutput> <!-- Hey, that works -->

<p> Still broken here though! The scope |here| is:
  text.html.cfml
  meta.scope.cfoutput.cfml
  meta.tag.inline.any.html
  string.quoted.double.html
  string.quoted.double.cfml
</p>

I poked around the source but couldn't make heads or tails of the what/why. Hope this helps someone with a bigger brain than me.

Mootly commented 8 years ago

I am getting this too:

Breaks: <li><a href="mailto:#application.emailHelp#">Contact Support</a></li> Correct: <li><a href="mailto&##58;#application.emailHelp#">Contact Support</a></li>

Removing the cfoutput block does indeed fix the color coding, as does moving it directly into the string.

Add that to the stuff above, and it looks like the syntax highlighter does not like hash marks after certain bits of punctuation when inside a cfoutput block.

dnando commented 7 years ago

I'm seeing a similar issue where both syntax highlighting and code completion is breaking after an & in the query string of an a href tag. See attached screenshot.

screen shot 2016-11-21 at 14 57

A clue to what might be going on here is if I remove the quotation marks around the href attribute, functionality is restored.

Mootly commented 7 years ago

The color coding starting at the ampersand may be complicated by any error or validation parsing you have. Mine flags them as needing to be escaped to &. Could certainly be some contention adding to the wonkiness.