Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 2 additions & 26 deletions Godef.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,8 @@ def run(self):
print("=================[Godef]Begin=================")
settings = sublime.load_settings("Godef.sublime-settings")
gopath = settings.get("gopath", os.getenv('GOPATH'))
if gopath is None:
print("[Godef]ERROR: no GOPATH defined")
print("=================[Godef] End =================")
return

gopaths = gopath.split(":")
found = False
godefpath = ""
for path in gopaths:
godefpath = os.path.join(path, "bin", "godef")

if not os.path.isfile(godefpath):
print("[Godef]WARN: godef not found at" + godefpath)
continue
else:
print("[Godef]INFO: godef found at" + godefpath)
found = True
break

if found == False:
print("[Godef]ERROR: godef not found!")
print("=================[Godef] End =================")
return
else:
print("[Godef]INFO: using godef:" + godefpath)

godefpath = "godef"
print("[Godef]INFO: using godef:" + godefpath)
view = self.window.active_view()

# row, col = view.rowcol(view.sel()[0].begin())
Expand Down