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

Test Plan for April 2019 release #2410

Closed
ramya-rao-a opened this issue Apr 3, 2019 · 41 comments
Closed

Test Plan for April 2019 release #2410

ramya-rao-a opened this issue Apr 3, 2019 · 41 comments

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 3, 2019

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

Here, I am listing some of the features and the bug fixes that will go in the next update and for which I need some help in testing. Since 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.

Also mentioned are the folks who logged the bugs/feature requests, those who upvoted it, and those who fixed it by sending PRs as these are the people with the most context on what the issue is.

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 i.e the beta version with your findings.

Those using modules will get a prompt to use gopls, the language server from Google as it performs much better especially for code completions. Please try it out.

Go Modules support improvements

New features

Debugging improvements

Others

@oneslash
Copy link
Contributor

oneslash commented Apr 3, 2019

fix for #2240 works fine for me

@mafredri
Copy link

mafredri commented Apr 3, 2019

This might actually be a gopls issue, I haven't investigated it further, but sometimes invalid code can cause code to be erased. It's as if we're trying to create a valid Go expression out of it.

Reporting it now as it can lead to a pretty poor user experience if released as-is.

Example (see trailing comma, not yet saved):

image

Save:

image

@stamblerre
Copy link
Contributor

@mafredri: this is a gopls bug, if you want to open it there. 2 questions though - could you share the full contents of the file (I'm not able to reproduce), and what does gofmt do to this file?

@nezorflame
Copy link
Contributor

@ramya-rao-a you didn't attach the released beta extension :)
I've built myself one from the 0.9.3-beta.7 tag, sharing it here in case someone needs it: Go-0.9.3-beta.7.zip

@nezorflame
Copy link
Contributor

I can confirm that #2238 has been fixed.

@primalmotion
Copy link
Contributor

With gopls, hovering on a structure shows the attributes and all on one line instead of being nicely formatted like before.

@nezorflame
Copy link
Contributor

@primalmotion there's a fork of gopls by @saibing which has ported hover and some more functions from bingo, you might want to check it out: https://github.com/saibing/tools

@mafredri
Copy link

mafredri commented Apr 3, 2019

@stamblerre I can reproduce it, for example, by adding a comma at the end of this file/line: js/net/types_js.go#L11. It deletes tmp.Release().

When adding the comma to the file outside of vscode, and running gofmt, I see this error:

types_js.go:11:2: expected 1 expression

gofmt -w does not modify the file. I'll gather a trace and open a report on the Go issue tracker soon(ish).

@ramya-rao-a
Copy link
Contributor Author

I've built myself one from the 0.9.3-beta.7 tag, sharing it here in case someone needs it

@nezorflame Thanks! I just realized the same. I clicked on the "Publish Release" button before the upload was complete :(. The release has been updated with the vsix file now.

@stamblerre Are there issues with a particular label somewhere where I can point folks to for known issues or features that are being tracked at? A few things I see are

  • Hover info, signature help, auto-completion should show docs as well
  • Hover info not formatted as expected
  • Auto-completion doesn't respect the setting go.useCodeSnippetsOnFunctionSuggest (This might need some work on my end to plumb through the settings)
  • Missing imports don't get added on file save (@stamblerre, I recall you mentioned that gopls has a on save hook where you run something similar to goimports to find missing imports and add them)

@lucashtc
Copy link

lucashtc commented Apr 3, 2019

Using go mod here got incredibly fast.

@FiloSottile
Copy link
Contributor

FiloSottile commented Apr 3, 2019

Formatting seems to be broken when working on the standard library. It works correctly for my other projects. When working on the standard library, even forcing a "Format Document" action does nothing. Nothing appears in the developer console.

This is my entire workspace settings.json, so I don't think it's caused by my wrokspace.

{
    "go.goroot": "~/go",
    "go.toolsGopath": "~/.vscode/godev",
    "spellright.documentTypes": [
        "git-commit"
    ],
    "[html]": {
        "editor.formatOnSave": false
    }
}

Manually running ~/.vscode/godev/bin/goimports -w works.

@mxschmitt
Copy link
Member

Now the debug file will be deleted after I stop debugging. Good Job! @ramya-rao-a

@FiloSottile
Copy link
Contributor

Turns out #2410 (comment) is a known gopls issue.

@stamblerre
Copy link
Contributor

@ramya-rao-a: All of the gopls issues can be found here: https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Agopls. The only one I'm not sure of how to handle is getting the settings for function placeholders, but we can discuss that offline.

@FiloSottile: I actually just checked, but I was wrong earlier - gopls should work fine in the Go standard library. Looking at your settings, it doesn't seem like you have gopls enabled? Also getting imports on save with gopls does require the additional setting of:

"editor.codeActionsOnSave": {
    "source.organizeImports": true
},

@kidlj
Copy link

kidlj commented Apr 4, 2019

Hi, @ramya-rao-a

Here I have a problem of vscode-go-beta consuming too much memory.

I have a fresh new vscode-insiders with no custom settings. With only vscode-go-beta activated, the editor consumed about ~10G memory, and the log says [warning] UNRESPONSIVE extension host, 'ms-vscode.Go' took 98% of 5664.527ms.

Environment:
OS: macOS 10.14.4
Code version: 1.33.0-insider (1.33.0-insider)
vscode-go version: Go-0.9.3-beta.7.vsix

code_memory_10g

extension_log

The PROFILE is here:

exthost-c2aaf2.cpuprofile.txt

@nezorflame
Copy link
Contributor

nezorflame commented Apr 4, 2019

@ramya-rao-a it seems like the goreturns is still being preferred instead of goimports for me in spite of change from #2309.
Removing "go.formatTool": "goimports" instantly makes the editor ask to install goreturns.
My setup:

  • macOS 10.14.4
  • Go 1.12.1
  • VSCode 1.32.3
  • vscode-go 0.9.3-beta.7
  • GO111MODULE=on is globally set in my ENV in .zprofile, so modules are enabled

@primalmotion
Copy link
Contributor

I also have an issue with package completion. The choices are ... weird

Screen Shot 2019-04-04 at 10 51 04

It doesn't even show the standard json package. Is there a map overwriting itself somewhere?

@ahmetb
Copy link

ahmetb commented Apr 4, 2019

This release solves my intellisense slowness with Go modules I reported at #2366.

@ahmetb
Copy link

ahmetb commented Apr 4, 2019

I found a problem that some of my code gets deleted when I hit save (maybe gofmt issue?)

image

when my cursor is on context., I hit save and I get a few lines of code deleted (for some reason, the u remains):

image

@shreyaskarnik
Copy link
Contributor

shreyaskarnik commented Apr 4, 2019

Environment:
OS: macOS 10.14.4
VSCode: 1.32.3
Go: go1.12.1 darwin/amd64

I found an issue when using gopls along with modules. I have all my dependencies resolved fine but see this in the editor
image

image

Here is output from gopls
image

@stamblerre
Copy link
Contributor

For all of the people who are finding issues with gopls, it'd be really helpful if you could file them at golang.org/issue. It will be a lot easier for me to diagnose and resolve them that way.

Since gopls is still opt-in (even though it's the default language server, it's still an experimental setting), I don't think that all of the issues with gopls should necessarily be considered blockers, but I will do my best to resolve them ASAP.

@conradwt
Copy link

conradwt commented Apr 4, 2019

@shreyu86 Do you have a test case (i.e. runnable code sample) which exhibits this issue?

@ramya-rao-a
Copy link
Contributor Author

@kidlj Please log a new issue with your go related setting changes and details from the Process explorer by running the command Developer -> Open Process Explorer

@nezorflame If you have removed the setting "go.formatTool": "goimports", then for the remainder of that VS Code session, the extension will assume that you wanted goreturns and so the prompt when it attempts to format. When reloaded or a new window is opened for a project using modules, you will be notified about the switch back to goimports. We can look into showing a notification when user chooses anything other than gofmt or goimports when using modules asking them not to do so. Please log a new issue for this.

@primalmotion Can you log a new issue for the issue with package completion? We can then see if those are coming from the extension or gopls and handle it appropriately

@shreyu86 I don't think that is from gopls. Diagnostics from the language server are not enabled by default. Please log a new issue.

@nezorflame
Copy link
Contributor

nezorflame commented Apr 5, 2019

@ramya-rao-a actually the warning is still there even after the VSCode restart.
I'll file a new issue.
EDIT: #2416

@lggomez
Copy link
Contributor

lggomez commented Apr 5, 2019

I can confirm #1682 fix

@calebdoxsey
Copy link
Contributor

I've seen no issues with "Feature Request 1886" (syntax highlighting for go.mod/go.sum).

@shreyaskarnik
Copy link
Contributor

@ramya-rao-a the errors I was seeing went away when I switched off diagnostics

"go.languageServerExperimentalFeatures": {
    "diagnostics": false
  },

I can open a new issue if this is not being tracked.

@stamblerre
Copy link
Contributor

@shreyu86: I don't think those errors were from gopls, like Ramya said. If you notice, on the right side of them, they say the source, which in the case of gopls, would be "LSP".

@shreyaskarnik
Copy link
Contributor

@stamblerre Thanks for the response, #2410 (comment) made the errors I was seeing go away.

@monkeyWie
Copy link

@ramya-rao-a
The issue #2265 has been fixed. Thanks!

@jclc
Copy link

jclc commented Apr 6, 2019

go.mod syntax highlighting doesn't work for comments right after some tokens unless there's a space in between. Seems to work for gofmt'd files. Doesn't provide paren completion like editing .go files would.

@brainsnail
Copy link
Contributor

It looks like @jclc is right - these are the following scenarios where the comment highlighting doesn't work as expected without a space:

Doesn't recognize the comment

  • After the go keyword and version
  • After the module keyword and module

image

Recognizes the comment string, but breaks subsequent highlighting

  • After the replace keyword before a paren

image

Are there any other areas where you encountered this?

The paren autocompletion is also something I verified. I think this is driven by a setting - maybe we haven't flagged the .mod file as being applicable for autocomplete? Isn't the parenthesis driven by a snippet? That being said, I think that most users would be using the Go toolchain to generate their .mod files and wouldn't be manually updating them.

@ramya-rao-a
Copy link
Contributor Author

@brainsnail Thanks for those screenshots, can you log a new issue for that?

@jclc, @brainsnail We will not be providing editing support for go.mod files, and so no auto-completion

@brainsnail
Copy link
Contributor

@ramya-rao-a Yep, thanks Ramya!

gopherbot pushed a commit to golang/tools that referenced this issue Apr 8, 2019
This change will stop formatting from working on any file that does not
parse. This is a temporary fix to handle the formatting problems
mentioned here: microsoft/vscode-go#2410, but
is not a long-term solution.

Change-Id: Ie34b1876519832d6859db95fdcad7cc37a20b769
Reviewed-on: https://go-review.googlesource.com/c/tools/+/171019
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
@treeder
Copy link

treeder commented Apr 10, 2019

This doesn't seem to work for me to fill in missing imports:

"editor.codeActionsOnSave": {
    "source.organizeImports": true
},

I've also tried to increase the format on save value and that doesn't work either.

@kyleferguson
Copy link

Auto imports and auto complete for unimported seem to be broken now when working with modules. If I turn off the use language server setting, it seems to fix it but then goes back to being super slow.

@nezorflame
Copy link
Contributor

nezorflame commented Apr 12, 2019

@kyleferguson you could also use Go: Add import command from Palette to add required import. It works pretty well with gopls.

@kyleferguson
Copy link

Yea this does work. The auto import is really handy when working with large libraries though, like Kubernetes where you may have many definitions named the same thing. Auto import would correctly guess which one base on signatures etc.

@nezorflame
Copy link
Contributor

nezorflame commented Apr 12, 2019

Agreed, this needs to work.
@kyleferguson you could also try a fork of gopls by the author of bingo LSP who has ported some features to the gopls - it's a little unstable, but autoimport works there: https://github.com/saibing/tools

I use these settings with it (latest vscode-go beta release):

"go.useLanguageServer": true,
"go.languageServerExperimentalFeatures": {
    "autoComplete": true,
    "diagnostics": true,
    "documentSymbols": true,
    "findReferences": true,
    "format": true,
    "goToDefinition": true,
    "goToTypeDefinition": true,
    "hover": true,
    "rename": true,
    "signatureHelp": true,
    "workspaceSymbols": true,
},
"[go]": {
    "editor.defaultFormatter": "ms-vscode.Go",
    "editor.snippetSuggestions": "top",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.organizeImports": true
    },
}

@jclc
Copy link

jclc commented Apr 17, 2019

I'm running into this issue while running the beta:

When editing a file with the following contents, gopls repeatedly panics until the extension refuses to restart it.

package vulkan

func (r *Renderer) freeResources

gopls logs:
https://gist.github.com/jclc/fe0cafdc2682356e7f277e4ba10aa9a6

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Apr 23, 2019

Thanks for all the help everyone! The next version of the extension has been released (0.10.0)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 7, 2019
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