buaazp / godef Goto Github PK
View Code? Open in Web Editor NEWPlugin of sublime to use godef to go to definitions accurately.
License: BSD 3-Clause "New" or "Revised" License
Plugin of sublime to use godef to go to definitions accurately.
License: BSD 3-Clause "New" or "Revised" License
input "height" will see "heit"
sublime text3
If there is multiple path in env GOPATH, such as /opt/golang:/home/my/Go,
the plugin source code can't find the correct path of godef bin
godef_bin = os.path.join(self.gopath, "bin", "godef")
I suggest setup godef path in the settings file Godef.sublime-settings explicitly,
self.godefpath = settings.get("godef")
or use the first path of GOPATH, self.gopath.split(":")[0]
I have test first, and it work well.
is it better to hide the window of subprocess execution?
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
p = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, env=env,
startupinfo=startupinfo)
Is it right, use ":" to seprate each go path.
Platform windows.
{
"goroot": "C:\Go",
"gopath": "D:\Github:E:\Work",
}
before Go 1.4, STD path was src/pkg
, but after Go 1.4, it became src
only.
sublime build 3083 packages: SideBarEnhancements, GoSublime, Godef
when I install godef then sublime was keeping 50% cpu useage
They're doing Advent 2014 blog posing, you can post for Godef at https://github.com/gopheracademy/gopheracademy-web
按readme里设置了插件的gopat、goroot和快捷键,当我用的时候报这个错:
`=================[Godef]Begin=================
[Godef]INFO: using godef: /home/lstbao/work/listomego/bin/godef
[Godef]INFO: selcet_begin: 134 offset: 134
[Godef]INFO: spawning: /home/lstbao/work/listomego/bin/godef -f /home/lstbao/bao/program/javascript/myPaintOnline/main.go -o 134
[Godef]ERROR: no definition found: b'godef: no declaration found for socketio.NewServer\n'
=================[Godef] End =================
`
配置如下:
{ "goroot": "/home/lstbao/software/go", "gopath": "/home/lstbao/work/listomego" }
sublime版本3103, 系统ubuntu 16.04 64 位
following attempt to install :
$ go get -v code.google.com/p/rog-go/exp/cmd/godef
Fetching https://9fans.net/go/acme?go-get=1
https fetch failed.
Fetching http://9fans.net/go/acme?go-get=1
import "9fans.net/go/acme": http/https fetch: Get http://9fans.net/go/acme?go-get=1: dial tcp 71.249.206.161:80: i/o timeout
package 9fans.net/go/acme: unrecognized import path "9fans.net/go/acme"
9fans.net seems to have been down for last few days, spotted this trying to install vim tools for go :
:GoInstallBinaries ....
vim-go: godef not found. Installing github.com/rogpeppe/godef to folder /home/jon/go/bin/
Error installing github.com/rogpeppe/godef: github.com/rogpeppe/godef (download)
Fetching https://9fans.net/go/acme?go-get=1
https fetch failed.
Fetching http://9fans.net/go/acme?go-get=1
import "9fans.net/go/acme": http/https fetch: Get http://9fans.net/go/acme?go-get=1: dial tcp 71.249.206.161:80: i/o
timeout
package github.com/rogpeppe/godef
imports 9fans.net/go/acme: unrecognized import path "9fans.net/go/acme"
The default key bindings "gd" and "gh" are triggered when you attempt to write those character sequences as text. You can't, for example, write "height" without Godef getting in the way. This is very annoying.
#25 is a manifestation of this.
As a matter of convenience, how to support right-click menu and ctrl+mouse click ?
I usually use 2 columns under "View"->"Layout".
I have source fileA in Col1, and another source fileB containing the definition of a function is in Col2.
Using "GoTo definition" in the source fileA sometimes reopens fileB in Col1 and goes to the definition.
It would be better if it found the source fileB in Col2 that is already open, and went to the definition there. No need to have the same file open twice.
Thx
=================[Godef]Begin=================
[Godef]INFO: using godef: /Users/me/go/bin/godef
[Godef]INFO: selcet_begin: 834 offset: 834
[Godef]INFO: spawning: /Users/me/go/bin/godef -f /Users/me/go/src/snippets/playground.go -o 834
[Godef]ERROR: no definition found: b'godef: no declaration found for net.ResolveUDPAddr\n'
=================[Godef] End =================
but working for fmt
=================[Godef]Begin=================
[Godef]INFO: using godef: /Users/me/go/bin/godef
[Godef]INFO: selcet_begin: 822 offset: 822
[Godef]INFO: spawning: /Users/me/go/bin/godef -f /Users/me/go/src/snippets/playground.go -o 822
[Godef]INFO: godef output: b'/usr/local/opt/go/libexec/src/fmt/print.go:263:6\n'
[Godef]INFO: opening definition at /usr/local/opt/go/libexec/src/fmt/print.go:263:6
=================[Godef] End =================
Use GoDef just working when source file opened.
Can not go to definition when xxx.go not opened.
Ok when XXX.go opened.
Platform windows, install GoSublime and GoDef.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.