Beispiel #1
0
    def run(self):
        v = self.window.new_file()
        v.settings().set('default_dir', root_at_data('Packages/User'))
        v.set_syntax_file(BUILD_SYSTEM_SYNTAX)
        v.set_name('untitled.sublime-build')

        template = """{\n\t"cmd": ["${0:make}"]\n}"""
        v.run_command("insert_snippet", {"contents": template})
Beispiel #2
0
    def run(self):
        v = self.window.new_file()
        v.settings().set('default_dir', root_at_data('Packages/User'))
        v.set_syntax_file(BUILD_SYSTEM_SYNTAX)
        v.set_name('untitled.sublime-build')

        template = """{\n\t"cmd": ["${0:make}"]\n}"""
        v.run_command("insert_snippet", {"contents": template})
Beispiel #3
0
    def run(self, **kwargs):
        v = self.window.active_view()
        path = v.file_name()
        if not (os.path.exists(path) and has_file_ext(v, 'JSON-tmLanguage')):
            # XXX: Can we/Should we use sublimelog.log?
            print "[AAAPackageDev] Not a valid JSON-tmLanguage file. (%s)" % path
            return

        build_cmd = root_at_data("Packages/AAAPackageDev/Support/make_tmlanguage.py")
        file_regex = r"Error:\s+'(.*?)'\s+.*?\s+line\s+(\d+)\s+column\s+(\d+)"
        cmd = ["python", build_cmd, path]

        self.window.run_command("exec", {"cmd": cmd, "file_regex": file_regex})
Beispiel #4
0
    def run(self, **kwargs):
        v = self.window.active_view()
        path = v.file_name()
        if not (os.path.exists(path) and has_file_ext(v, 'JSON-tmLanguage')):
            # XXX: Can we/Should we use sublimelog.log?
            print "[AAAPackageDev] Not a valid JSON-tmLanguage file. (%s)" % path
            return

        build_cmd = root_at_data(
            "Packages/AAAPackageDev/Support/make_tmlanguage.py")
        file_regex = r"Error:\s+'(.*?)'\s+.*?\s+line\s+(\d+)\s+column\s+(\d+)"
        cmd = ["python", build_cmd, path]

        self.window.run_command("exec", {"cmd": cmd, "file_regex": file_regex})
Beispiel #5
0
def test_root_at_data():
    sublime.packages_path = mock.Mock()
    sublime.packages_path.return_value = "XXX\\YYY"
    expected = os.path.join("XXX", "ZZZ")
    assert su_path.root_at_data("ZZZ") == expected