jcberquist / sublimetext-cfml

CFML (ColdFusion and Lucee) package for Sublime Text
MIT License
115 stars 24 forks source link

Syntax Highlighting #107

Open Siddley opened 6 years ago

Siddley commented 6 years ago

H Johni,

A few years ago I wrote a package for SublimeText 2 that does full and detailed syntax highlighting for CF and also enhanced highlighting for HTML. You can find it at https://github.com/Siddley/Enhanced.HTML.CFML

It is based on the Coldfusion package at https://github.com/SublimeText/ColdFusion

This has been very popular with over 10,000 downloads, but sadly is not compatible with your CFML package and SublimeText 3

As I built this a long time ago and have really not done anything like this since, I am at a bit of a loss about how to get it modified to work with your package and ST3.

Would you be willing to help with this, maybe a few pointers?

I assure you it is worth it, the syntax highlighting it provides is VASTLY more intricate and intuitive than anything else available. it is not simply "a different colour for tags".

I'd love to see this working again if you (or anyone else) is willing to help, or take over the project.

Thanks!

jcberquist commented 6 years ago

Hi @Siddley:

I took a look at your color schemes. I think the fundamental issue is that scope names used in your color schemes don't match what I have in the CFML syntax for this package. So to make it work you would need to go through a CFML file and inspect the scopes to find out what the updated scope names should be. The HTML, CSS, and JavaScript syntaxes have all been significantly updated as well, and would need similar treatment. (To inspect the scopes you can use the Show Scope Name command which comes with ST3. I think it is bound to CTRL+ALT+SHIFT+P on Windows and CMD+ALT+P on OSX.)

If you are going to update the package for ST3, I would recommend moving from branch based releases to tag based releases on Package Control. You can see your package's current entry here: e.json#L800-L809, where you are using branch based releases. That approach has been deprecated (though it should still work for now).

I don't know if you worked with the PackageDev package in the past, but you might find it convenient to edit the .tmTheme files in a format other than plist. PackageDev makes this easy as it has tools to convert files between plist, JSON, and YAML formats. So you could edit a JSON or YAML file, and then build to the plist tmTheme format. I at least would find that easier to do.

Finally, just to mention it, there is a new color scheme format in the works that is available only in the ST3 dev builds for now. It uses a .sublime-color-scheme extension and uses JSON. You can read about it here: https://forum.sublimetext.com/t/dev-build-3149/32549. It is more powerful, and is what I would recommend long term for color schemes. PackageDev does come with tools to help work with that format already, but it is still only available in the dev builds, and I don't know when it will become more widely available.