Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Test Plan for Sept 2018 (0.6.90) #1939

Closed
ramya-rao-a opened this issue Sep 24, 2018 · 29 comments
Closed

Test Plan for Sept 2018 (0.6.90) #1939

ramya-rao-a opened this issue Sep 24, 2018 · 29 comments

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 24, 2018

If you got a notification from this issue, then you are part of the next update to the Go extension.
Thanks and Welcome!

Here I will be listing the features and the bug fixes that will go in the next update along with the the folks who logged the bugs/feature requests, those who upvoted it, and those who fixed it by sending PRs.

The idea is to get the folks behind this update to give the update a trial run before I release it.
I always do basic testing before every update. But because I dont work with Go in my day job, I always feel that someone who does Go more than me can help in testing tremendously.

And when I say "test", you can do a minimum pass of just installing the update and then do nothing special other than going about using VS Code like you do everyday. Or you can test the feature you requested/implemented or the bug you logged/fixed. Or you can test all of the below. Every bit helps.

Drop in a comment in this issue after 2 or 3 days of installing the update with your findings.

If you are using Go modules:

  • Go to definition, symbol info on hover and Signature Help when the setting go.docsTool is set to gogetdoc will now work. You will be prompted to update gogetdoc. @zmb3
  • Go to definition feature will work event if you havent changed the go.docsTool setting. You will be prompted to install a fork of godef that we are testing. @stamblerre
  • Auto-completion. You will be prompted to install a fork of gocode that we are testing as well as to update the gopkgs tool. Currently it only works if the package is already imported and used atleast once. @stamblerre, @uudashr
  • Go: Add Import & Go: Browse Packages commands that will show the appropriate packages from the current module instead of GOPATH @uudashr
  • Go modules in VS Code is the wiki that will track the status of Go module support

Features not related to Go modules

  • @biancarosa, @lkarlslund

    • New commands Go: Benchmark File, Go: Benchmark Package and codelens to run all the benchmarks in current file & package respectively. Feature Request 1522 with PR 1898 & PR 1899
  • @jeffbean

    • New setting go.generateTestsFlags to provide flags for the gotests tool when generating tests using any of the Go: Generate Unit Tests... commands. PR 1841
  • @johan-lejdung

    • New setting go.testTags to be used for running tests. This way, you can use the existing go.buildTags for compiling and a different set of tags for running tests. Feature Request 1842 implemented with PR 1877
  • @ragurney, @mgood

    • Skip the blank identifiers in file outline feature. Be it in the outline view in the explorer or the one that shows up when running Go to symbol in file command. Bug 1889 fixed with PR 1893
  • @svipben

    • Fix accessibility issues with the Analysis Tools Missing button in the status bar which shows up when you don't have the required Go tools installed. PR 1922
  • @alecthomas

  • @Charliekenney23, @antong

    • Create new tmp directory for each session to avoid insecure use of the temporary files created by the extension. Fixes Bug 1905 with PR 1912
  • @shreyu86

    • Provide auto-completions for symbols from unimported packages even when the package name has multiple matches. Fixes Bug 1884 with PR 1900
  • @ramya-rao-a

@svipas
Copy link
Contributor

svipas commented Sep 24, 2018

image

Everything is fine and working as supposed to.

@shreyaskarnik
Copy link
Contributor

✅ Provide auto-completions for symbols from unimported packages even when the package name has multiple matches. and testing other new features and fixes.

@johan-lejdung
Copy link
Contributor

go.testTags is working fine 👌😍

@ragurney
Copy link
Contributor

Blank identifiers in outline fix looks good :shipit:

@ramya-rao-a
Copy link
Contributor Author

@shreyu86, @johan-lejdung, @ragurney Thanks for confirming!
Would you mind giving some of the other features a look as well?

@antong
Copy link

antong commented Sep 25, 2018

I've been casually using this for two days now. Nothing out of the ordinary has happened. The tempdir stuff seems to be working in that tempdirs do appear with expected contents. vscode-go-debug.txt still goes directly into TEMP with the predictable name, so that fix seems to not have gone in. I noticed the iferr snippet improvement, and that is cool!

@alecthomas
Copy link
Contributor

Snippets look good!

@gertcuykens
Copy link
Contributor

Not in the list but I think setting export GO111MODULE=on in your shell so that modules are always used has performance issues. Unfortunately I don't have more details and time to investigate, I can only mention that I think using modules has a more sophisticated inpact on vscode-go

@ramya-rao-a
Copy link
Contributor Author

@gertcuykens That can very well be the case. If you find more details, please do log a new issue and we can investigate further.

@lkarlslund
Copy link

Great job on this release so far.

I have a huge project using Go Modules, with many local subpackages imported). The latest vsix (beta 6) works way better than the previous versions. It does not seem bogged down on CPU nearly as much. Previously I had like 10-12 go.exe running under VS Code when saving stuff, but this seems to have dissapeared.

The version of godef that the plugin installs does not support Go Modules, and that breaks that functionality. There is a fork at https://github.com/ianthehat/godef which works, and you might consider switching to that.

When are you enabling languageserver for Windows? :)

@lkarlslund
Copy link

Benchmark file and package works great!

@uudashr
Copy link
Contributor

uudashr commented Sep 26, 2018

@lkarlslund better to ask the owner of https://github.com/ianthehat/godef to merge godef to the original. Last commit https://github.com/rogpeppe/godef Sep 12, 2018, still active.

@jeffbean
Copy link
Contributor

The go.generateTestsFlags settings change tested. Looking good!

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Sep 26, 2018

To those who use Go modules:

The Go tools team have forks of the godef and gocode tools that work with Go modules. These 2 tools drive the Go to definition and auto-completion features respectively. The latest beta version of this extension has support for both.

Please install this beta version, follow through the prompts to install/update the tools and let us know how the Go to definition and auto-completion features are working out for you.

@lkarlslund Nice timing :) I wanted to complete the testing of the forks and adding the right prompts in the right places before releasing them in the beta version. So now you have them.

When are you enabling languageserver for Windows? :)

As soon as the upstream item sourcegraph/go-langserver#113 is resolved

@alecthomas
Copy link
Contributor

With that new beta I no longer get completions on packages:

image

Previous beta:
image

@ramya-rao-a
Copy link
Contributor Author

@alecthomas

  • Are you using Go modules?
  • Run gocode close and/or gocode-gomod close and try again.
  • If that still doesnt work, run gocode close and gocode -s -debug. (Replace with gocode-gomod if using modules). This will start gocode in debug mode. Try for completions in VS Code. The terminal running gocode in debug mode should print out results (number of candidates or error message)
  • If you see results in debug mode, but not in VS Code, then our last resort is to debug VS Code. Get latest from master and add a breakpoint at https://github.com/Microsoft/vscode-go/blob/master/src/goSuggest.ts#L170 to see if gocode-gomod or gocode is being used. Another breakpoint at https://github.com/Microsoft/vscode-go/blob/master/src/goSuggest.ts#L211 will show the output from gocode itself

@alecthomas
Copy link
Contributor

I am using Go modules yes. I can see that vscode is starting gocode-gomod. I ran it with -s -debug and got the following:

2018/09/27 12:20:10 -------------------------------------------------------
2018/09/27 12:20:10 Elapsed duration: 303.543208ms
2018/09/27 12:20:10 Offset: 0
2018/09/27 12:20:10 Number of candidates found: 0
2018/09/27 12:20:10 Candidates are:
2018/09/27 12:20:10 =======================================================

@alecthomas
Copy link
Contributor

Also FYI the reason completion works with normal gocode is that I am also vendoring my dependencies.

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Sep 27, 2018

@alecthomas So from what I can understand you are using modules but are also vendoring the dependencies. And it is for such vendored dependencies that you are not getting completions? If so, can you open a new issue with a sample code (preferably a small repo that I can just clone)?

@wolfeidau
Copy link
Contributor

@ramya-rao-a Just been testing out the beta plugin and as per @alecthomas auto complete doesn't seem to be working for stdlib. I uploaded a repo https://github.com/wolfeidau/test-gocode hope that helps.

go version
go version go1.11 darwin/amd64

@stamblerre
Copy link
Contributor

@wolfeidau I wasn't able to reproduce using your case. The very first completion is a little slow, but after that, the stdlib was completing fine.

@alecthomas
Copy link
Contributor

alecthomas commented Oct 3, 2018

Another data point: gocode-gomod is much slower than gocode, when it does work. On a large codebase it takes ~5 seconds to bring up a local receiver completion list whereas gocode is basically instantaneous 🙁

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Oct 3, 2018

@alecthomas It is known that gocode-gomod is generally slower. But it is to be used when using modules because gocode doesnt work with modules.

If what you said before still holds and you see gocode working when you vendor your dependencies and use modules at the same time, then as requested in #1939 (comment), can you please log a new issue with a small sample repo?

@alecthomas
Copy link
Contributor

@ramya-rao-a I'm guessing it is environment-specific, as @wolfeidau has produced a test repo that fails for him, but does not for @stamblerre. So I don't think I'd be able to add anything that @wolfeidau 's existing repo doesn't already.

@uudashr
Copy link
Contributor

uudashr commented Oct 3, 2018

Same here with me... the autocomplete doesn't works by using @wolfeidau case

@ramya-rao-a
Copy link
Contributor Author

@wolfeidau

Using your repo and the repro steps in the README of your repo, I do see that there is no completions for the base64 package. But, once I save the file after typing base64.anything(), subsequent completions work as expected.

#1944 is tracking the case where auto-completions dont work, unless a package has been imported and used atleast once in the saved version of the file. I believe that is what is happening in this case.

Can you try saving the file after any usage of the stdlib and try again?

@alecthomas
I am specifically interested in your case because it is the case of gocode working but not gocode-mod when using Go modules along with vendored dependencies. This is different from @wolfeidau's case.

@wolfeidau
Copy link
Contributor

@ramya-rao-a I have tried doing as you instructed.

Open main.go and add a line with base64.anything(), then save the file, then remove .anything() and type something else and I still get.

2018/10/04 07:35:48 -------------------------------------------------------
package main
import "encoding/base64"

import "github.com/sirupsen/logrus"

func main() {
	logrus.Printf("logging")

	base64.#

}
2018/10/04 07:35:48 -------------------------------------------------------
go list stderr <<# main.go
./main.go:8:2: undefined: base64
>>
2018/10/04 07:35:48 Elapsed duration: 150.517592ms
2018/10/04 07:35:48 Offset: 0
2018/10/04 07:35:48 Number of candidates found: 0
2018/10/04 07:35:48 Candidates are:
2018/10/04 07:35:48 =======================================================

I started digging into the fork which @stamblerre is currently maintaining, then quickly got lost in the go tools packages adding printf statements.

We really need to know where gocode-mod is looking for things, we only know what it found at the moment..

It would be amazing if there was a bit more tracing in the gocode-mod and more importantly the underlying libraries / routines as they don't give up their secrets willingly :)

I have updated the readme in my with my go env https://github.com/wolfeidau/test-gocode repo.

@ramya-rao-a
Copy link
Contributor Author

@wolfeidau I've logged #1963 to continue the discussion

@ramya-rao-a
Copy link
Contributor Author

Everyone,

Thanks a lot for the participation!

0.6.90 version is now released.

If you have further feedback, please feel free to open an issue.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests