ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)
https://ace.c9.io
Other
26.74k stars 5.28k forks source link

CFML CFC support #2305

Open bdw429s opened 9 years ago

bdw429s commented 9 years ago

Cloud9's CFML support does not recognize the CFC extension (ColdFusion Component). CFCs can have tags in them like this:

https://github.com/ColdBox/coldbox-platform/blob/3.8.1/system/web/Controller.cfc

or FULL script like this version of the same component:

https://github.com/ColdBox/coldbox-platform/blob/development/system/web/Controller.cfc

nightwing commented 9 years ago

@bdw429s is there a textmate mode for cfc?

bdw429s commented 9 years ago

I'm afraid I don't know enough about textmate to answer that question. I do know that .cfm files do format markup correctly. I assume .cfc files might need to be associated with ColdFusion, but it should be noted that unlike .cfm files which are always markup (tags), a .cfc file might be tags or script and one must parse the contents to detect if it has a tag in it.

nightwing commented 9 years ago

Ah, so the issue is only about recognizing cfm extension, not about adding a new mode. For detecting tags/script initial state, is it enough to just check for a < at the start of the file?

bdw429s commented 9 years ago

Perhaps. I don't know if the existing CFML mode will handle script outside of a tag so it may need amended. Comments and other text are allowed at the start of a CFC file before the actual component definition so I would be tempted to test for the full string.

That said, I'm not sure exactly how ColdFusion parses them since I suppose the following would be a valid script CFC though probably an edge case:

component {
  myString = '<cfcomponent>';
}
nightwing commented 9 years ago

Comments and other text are allowed at the start of a CFC file before the actual component definition

you mean the following should be in tag mode?

foo bar baz
<cfcomponent hint="this is a tag">

<cfcomponent>

btw which other editors support CFC?

bdw429s commented 9 years ago

Yes, that would be a valid tag-based component.

There are a lot of editors that support CFML, but I'm not sure if you're just asking about web-based editors or any IDE in general. IDEs include ColdFusion Builder, CFEclipse, Dreamweaver, SublimeText. FWIW, the GitHub website file viewer supports CFCs correctly. I helped make that happen last year. I'm not sure about any web-based editors, but honestly I've never personally used a web-based editor for CFML other than on Runnable.com -- which come to think of it uses ACE editor too. I recall bugging them about CFML support too. So I guess this will be killing two birds with one stone.

javruben commented 9 years ago

https://github.com/textmate/coldfusion.tmbundle

gpickin commented 9 years ago

Would love to see the support for this.

stphnwlkr commented 9 years ago

Please add support for this.

malpaso commented 8 years ago

Any update on this. Looks like cloud9 still doesn't support a .cfc

randy-johnson commented 7 years ago

@nightwing, Any updates on this?

wesleywarren commented 7 years ago

Please just make .cfc behave the same exact way as .cfm - that would solve 90% of the problem (maybe 100%) - just add it as another recognized extension - it's very difficult to edit cfc files without any highlighting.

github-actions[bot] commented 2 years ago

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

bdw429s commented 2 years ago

Yes, this feature is still desired.

whazor commented 1 year ago

There are already ColdFusion highlighting rules, and it is possible to extend on those if needed for ColdFusion components. Just like how ColdFusion now extends HTML highlighting rules, and HTML highlighting rules in turn extends XML highlighting rules. Be sure to add the tests as well. We have a guide for adding syntax highlighting to Ace, feel free to create a PR for the ColdFusion Components: https://ace.c9.io/#nav=higlighter

I created a PR (#5072) for using the ColdFusion mode for .cfc, as suggested in this ticket.