Created
June 28, 2016 20:11
-
-
Save elpete/b40d27472b1be91379a91da351e8d9da to your computer and use it in GitHub Desktop.
Dump out Sublime Text CFML Plugin settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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