Skip to content

Instantly share code, notes, and snippets.

@elpete
Created June 28, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpete/b40d27472b1be91379a91da351e8d9da to your computer and use it in GitHub Desktop.
Save elpete/b40d27472b1be91379a91da351e8d9da to your computer and use it in GitHub Desktop.
Dump out Sublime Text CFML Plugin settings
import sublime, sublime_plugin, json
import CFML
class DumpCfmlSettings(sublime_plugin.WindowCommand):
def run(self):
projects = list(CFML.src.cfcs.cfcs.projects.keys())
self.window.show_quick_panel(projects, lambda i: self.types(projects[i]))
def types(self, project):
dumpTypes = ["Variable Names", "Indexed Files"]
self.window.show_quick_panel(dumpTypes, lambda i: self.dumps(project, dumpTypes[i]))
def dumps(self, project, dumpType):
view = self.window.new_file();
view.set_syntax_file("Packages/JavaScript/JSON.sublime-syntax")
if dumpType == "Variable Names":
view.run_command("append", {"characters": json.dumps(CFML.src.cfcs.cfcs.projects[project], indent=2)})
else:
view.run_command("append", {"characters": json.dumps(CFML.src.model_index.component_index.projects[project], indent=2)})
self.window.focus_view(view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment