diff --git a/Commands/Complete.tmCommand b/Commands/Complete.tmCommand index 01f0001..898b23f 100644 --- a/Commands/Complete.tmCommand +++ b/Commands/Complete.tmCommand @@ -12,8 +12,6 @@ require ENV['TM_SUPPORT_PATH'] + "/lib/tm/require_cmd.rb" require ENV['TM_SUPPORT_PATH'] + "/lib/tm/htmloutput.rb" require ENV['TM_SUPPORT_PATH'] + "/lib/web_preview" -TextMate.require_cmd("gocode") - # current document document = [] File.open(ENV['TM_FILEPATH'], "r+") do |file| @@ -22,7 +20,7 @@ end # byte offset of cursor position from the beginning of file cursor = document[ 0, ENV['TM_LINE_NUMBER'].to_i - 1].join().length + ENV['TM_LINE_INDEX'].to_i -output = `gocode -f=csv -in=#{e_sh ENV['TM_FILEPATH']} autocomplete #{cursor}` +output = `$TM_GOCODE -f=csv -in=#{e_sh ENV['TM_FILEPATH']} autocomplete #{cursor}` # quit if no completions found TextMate.exit_show_tool_tip("No completions found.") if output.length == 0 @@ -129,6 +127,17 @@ end text outputLocation atCaret + requiredCommands + + + command + gocode + moreInfoURL + https://github.com/nsf/gocode + variable + TM_GOCODE + + scope source.go uuid