示例#1
0
def init():
    try:
        if gs.settings_obj().get('gsbundle_enabled') is True:
            do_install()
    except Exception:
        gs.show_traceback(DOMAIN)
示例#2
0
def init():
	try:
		if gs.settings_obj().get('gsbundle_enabled') is True:
			do_install()
	except Exception:
		gs.show_traceback(DOMAIN)
示例#3
0
    gsshell.run(cmd=[BUNDLE_GOCODE, 'close'])


def init():
    try:
        if gs.settings_obj().get('gsbundle_enabled') is True:
            do_install()
    except Exception:
        gs.show_traceback(DOMAIN)


try:
    # We have to build absolute paths so that some os/exec.Command calls work as expected on
    # Windows. When calling subprocesses, Go always completes partial names with PATHEXT values
    # (unlike CreateProcess). If there is a margo.* executable in the current directory and it isn't
    # the expected margo.exe binary, MarGo.exe will throw an error or behave unexpectedly.
    # See: https://github.com/DisposaBoy/GoSublime/issues/126 (#126)
    ext = '.exe' if gs.os_is_windows() else ''
    BUNDLE_GOPATH = os.path.join(sublime.packages_path(), 'GoSublime', '9')
    BUNDLE_GOBIN = os.path.join(sublime.packages_path(), 'User', 'GoSublime',
                                '9', 'bin')
    BUNDLE_GOSUBLIME9 = os.path.join(BUNDLE_GOBIN, 'gosublime9%s' % ext)
    BUNDLE_GOCODE = os.path.join(BUNDLE_GOBIN, 'gocode%s' % ext)
    BUNDLE_MARGO = os.path.join(BUNDLE_GOBIN, 'margo%s' % ext)
    os.environ['PATH'] = '%s%s%s' % (BUNDLE_GOBIN, os.pathsep,
                                     os.environ.get('PATH', ''))

    sublime.set_timeout(init, 1000)
except Exception:
    gs.show_traceback(DOMAIN)
示例#4
0
	c.on_done = on_margo_done
	c.start()

	gsshell.run(cmd=[BUNDLE_GOCODE, 'close'])

def init():
	try:
		if gs.settings_obj().get('gsbundle_enabled') is True:
			do_install()
	except Exception:
		gs.show_traceback(DOMAIN)


try:
	# We have to build absolute paths so that some os/exec.Command calls work as expected on
	# Windows. When calling subprocesses, Go always completes partial names with PATHEXT values
	# (unlike CreateProcess). If there is a margo.* executable in the current directory and it isn't
	# the expected margo.exe binary, MarGo.exe will throw an error or behave unexpectedly.
	# See: https://github.com/DisposaBoy/GoSublime/issues/126 (#126)
	ext = '.exe' if gs.os_is_windows() else ''
	BUNDLE_GOPATH = os.path.join(sublime.packages_path(), 'GoSublime', '9')
	BUNDLE_GOBIN = os.path.join(sublime.packages_path(), 'User', 'GoSublime', '9', 'bin')
	BUNDLE_GOSUBLIME9 = os.path.join(BUNDLE_GOBIN, 'gosublime9%s' % ext)
	BUNDLE_GOCODE = os.path.join(BUNDLE_GOBIN, 'gocode%s' % ext)
	BUNDLE_MARGO = os.path.join(BUNDLE_GOBIN, 'margo%s' % ext)
	os.environ['PATH'] = '%s%s%s' % (BUNDLE_GOBIN, os.pathsep, os.environ.get('PATH', ''))

	sublime.set_timeout(init, 1000)
except Exception:
	gs.show_traceback(DOMAIN)