Closed cybersonic closed 6 years ago
Hey guys I also just released a commandbox command for it - might be able to integrate with that
@pfreitag Your commandbox command currently only works on whole files, correct? It is relatively easy to run a box command on the current file by adding a build system entry for it. For example you could create a cfscriptme.sublime-build
file in your ST User package folder with the following contents:
{
"shell_cmd": "box cfscriptme sourcePath=\"$file_name\" force=true",
"selector": "embedding.cfml"
}
Then when a CFML file is open you can use CTRL+SHIFT+B to call up the build menu and select cfscriptme
. This will work on the entire contents of the current file. Unfortunately it can be very slow to execute as it has the overhead of starting the box binary each time.
What about posting to your cfscript.me api endpoint? Is that doable, and are you comfortable with that approach? (I have no idea if and how much traffic that might generate.) I suspect going that route would be faster and would have the added benefit of allowing for the conversion of selections rather than having to do it on whole files. But I certainly understand you might not want that.
Long term I would like to figure out how to open and maintain a box shell session via ST so that commands could be run without having to start the box binary each time. I think that is doable, but I haven't had time to look into it. I certainly don't want to do it incorrectly and start bringing down ST users' machines.
@jcberquist This is probably something that I could open up an API for in the future, but in the near term I think the local execution route is preferable.
@pfreitag Makes sense to me, thanks. @cybersonic so for now I would recommend adding a build system entry to your user package folder, and maybe down the road I can do something more comprehensive.
As it happens, I wrote a Sublime command that does the same thing a while back. It has advantages and disadvantages compared to sublime.me. If native Sublime integration is a sticking point, this command might be of use.
@Thom1729: If you want to contribute it, I would happily include it in this package. Or you could submit it to Package Control directly. Either way, I think it would be great to make it available.
cfscript.me is a great resource by @pfreitag that would be great to add to the plugin so you can convert selections or whole files.