-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On OSX / VSCode, "Go to Definition" not working for me #163
Comments
It seems that the golang extension for VSCode does "Go to Definition" (using gogetdoc or godef+godoc) |
I have this problem, too, but I don't think this is specific to VSCode. I'm using VSCode on Windows and Vim on OSX and I have this problem in both. Both rely on gocode internally, which presumably is choking on the size of the generated code. This isn't specific to this project; I've seen this with other projects, too. Generally when I'm having this problem, I use "godoc" on the command line. E.g., "godoc github.com/therecipe/qt". |
Yes, code-autocompletion (and so probably definition lookup as well) is a bit buggy in some editors/IDEs. The auto-completion issues for So I suspect, that the plugin(s) in VSCode simply timeout while waiting for Another idea, would be to use But that's just speculation. |
@therecipe BTW, for IDEA the
That is of course assuming the host has enough RAM. My current host has 8 GB, works quite okay without freezing etc. |
@akamensky |
I dont want to change to IDEA, and prefer VSCode. I will ask the maintinaer of the go extension to have a look at it. |
@therecipe can you see if this is a good idea ? |
@joeblew99 edit: also there seems to be an open pr that solves this issue in godef rogpeppe/godef#44 |
Thanks for the reply. Now i get typeahead as i type, showing the function call, but not showing the signature variables. For example: When i type window., i get the list of functions. But after i choose AcceptsDrops, i dont get any of the values its expects to be passed in. rogpeppe/godef#44 has been marked as fixed and closed. what should we do ? |
maybe your example is a bit unfortunately selected as does it work for
As I said in the other issue, I'm currently working on reducing the binding code. Thats why I would like to wait until this is done, to see if it maybe solves this and the other (probably related) issues. |
made the changes to the code-generator yesterday and now there should be a lot less Go code. you can also set |
i just did a clean install of 5.8 qt and the repo. is now worse then before :( for example:
hovering over gui, showing the import overlay as it should. hovering over gui.NewQGuiApplication, does nothing typing gui.NewQAccessibleEvent, does bring up the functions list. But on choosing one, no function signature help happen. Hope i have explained it enough ? |
Did you use |
yes i think its using the master of rogpeppe/godef. When you install the standand VSCode golang plugin it installs about 10 golang binaries. i am pretty sure its using the master version of godef. Here is the source code that kicks it off: I tried deleting all my binary files in the golang bin, and the VSCode plugin asked to redownload it using: So i am not doing anything different from everyones install.
After VSCode gets all the golang binaries installed i have:
|
yes, they are using the (broken) master, using rogpeppe/godef#44 however diff --git a/go/parser/parser.go b/go/parser/parser.go
index b6bfef7..69e4cfe 100644
--- a/go/parser/parser.go
+++ b/go/parser/parser.go
@@ -1967,6 +1967,9 @@ func parseImportSpec(p *parser, doc *ast.CommentGroup, decl *ast.GenDecl, _ int)
if declIdent == nil {
filename := p.fset.Position(path.Pos()).Filename
name, err := p.pathToName(litToString(path), filepath.Dir(filename))
+ if litToString(path) == "C" {
+ name = "C"
+ }
if name == "" {
p.error(path.Pos(), fmt.Sprintf("cannot find identifier for package %q: %v", litToString(path), err))
} else { made "go to definition" work for me. I also got the function list somewhat working by:
and the input parameter help seems to work as well. So, there is definitely something wrong with how vsc makes the code-completion work. After further investigation is seems that the file size limit is somewhere between 1.2mb and 1.5mb. |
thanks for looking into this deeper. Geez so crappy of vscode. I think that i need to change to another IDE. What do you use ? |
Intellij community edition + golang plug-in |
ok ta. I am going to ry the new Will report back ... |
I'm currently using Atom + go-plus ("go to definition" isn't working there for me as well, even with the patched godef). |
i tried out gogland. https://www.jetbrains.com/go/download/ Setup it fast. The Intellisense is much much better. It picked up lots of warnings in the code. On the widgets.go file it blew up the intellisense buffer, giving a warning. Really curious what you think... I really think its worth a shot |
Tested Gogland as well, and it works so far. What I observed is, that the code-competition works without the need to install the packages with "go install", which is really nice. The other editors seems to use gocode and therefore depend on the *.a files created during "go install" But the "go to definition" function, even though it works out of the box, is way slower for me then with vsc. And the code competition for the "widgets" package seems to be broken as well, but I got it working by using the IntelliJ Idea settings from: https://github.com/therecipe/qt#code-editor-settings-for-code-completion |
I tested LiteIDE, which is a golang IDE written in QT. Its really nice actually.
I just had to tell is my goroot in the menu: I use homebrew to install go, and so all i had to do was give it the exact same thing i have in my .bash_profile:
So far its the fastest IDE i have used by far. I would recommend trying it. Also its works on all OS's. |
Yeah, I already have had experience with that one :) |
i have been using it for 5 days and all ok on OSX for me. No crashs.
they did a release a few days ago, try it.
key bindings are not well done at the moment, and i raised a issue for it.
my issues was that on a non english keyboard the keybindings conflict with
the way you write a "[]" and {}.
I fixed it by editting the key bindings myself for now.
so far this is easily the best IDE i have used for golang.
debugging with DLV works too very well.
Its ironic that its using QT, but programmed in c :)
I was seriously thinking about how easy a pot could be. Not that hard i
think, but i am stopping my scope creepy self !!
…On Tue, Mar 7, 2017 at 5:54 PM therecipe ***@***.***> wrote:
Yeah, I already have had experience with that one :)
And it was great overall, but there was an exausting bug when I used it (2
years ago or so) that made it crash, when you pressed the wrong key
combination.
Sadly I can't exactly recall what it was, but it had something todo with
ctrl or cmd on mac. And so I switched, but these things are probably
sorted out by now, so I will maybe switch back.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALcac2e8qBvquSFBl9f0_T6Pw_7YJi0cks5rjYvhgaJpZM4LXhQk>
.
|
:D I will give it a try |
@therecipe Curious what you think ? For me its been clear sailing for everything and much more productive |
Yes, I had time to test it. I will try to use it from time to time and maybe fully switch at some points, but currently I'm (too) used to Atom and its git integration. So I will need some time to acclimatize with LiteIDE. |
ok. This was originally about VSCOde and got highjacked along the way by me. |
i am using VSCode on OSX.
i remember reading something about how to get QT golang to work with finding references.
I use VSCode, and when i right click on an object and choose "Go to Definition", nothing happens.
Mhh... Would be nice and make it quicker for me :)
i have the full QT 5.7 installed, rather than using brew.
I think that is one of the prerequisites to have "go to definition" to work ?
Any ideas ?
#90 ?
The text was updated successfully, but these errors were encountered: