Last active
October 3, 2018 23:18
-
-
Save ordovician/9427938 to your computer and use it in GitHub Desktop.
[Text Mate Bundle for Go] Method, variable and function completion for the Go language written in Julia. Put this in a TextMate bundle. Currently too slow to be practical due to slow Julia startuptime #tmbundle #go #plugin
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
#!/usr/bin/env julia | |
using PList | |
import GoTMSupport | |
bundle_support = ENV["TM_BUNDLE_SUPPORT"] | |
dialog = ENV["DIALOG"] | |
gocode = ENV["TM_GOCODE"] | |
filepath = ENV["TM_FILEPATH"] | |
row = int(ENV["TM_LINE_NUMBER"]) | |
col = int(ENV["TM_LINE_INDEX"]) + 1 | |
function register_icons() | |
icons = icon_plist() | |
run(`$dialog images --register $icons`) | |
end | |
function icon_plist() | |
writeplist_string(map({"const", "func", "package", "type", "var"}) do v | |
{v => string(bundle_support, "/icons/$v.png")} | |
end) | |
end | |
suggestions = GoTMSupport.completion_choices_plist(filepath, row, col, gocode) | |
register_icons() | |
# suggestions = "( { display = law; }, { display = laws; } )" | |
print(readall(`$dialog popup --suggestions $suggestions`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment