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

Issues with VS Code 1.1 #322

Closed
aaronkavlie-wf opened this issue May 10, 2016 · 21 comments
Closed

Issues with VS Code 1.1 #322

aaronkavlie-wf opened this issue May 10, 2016 · 21 comments

Comments

@aaronkavlie-wf
Copy link

aaronkavlie-wf commented May 10, 2016

After upgrading to Visual Studio Code 1.1, some important features of this plugin don't seem to work properly:

  • Linting and code error notifications seem to be entirely broken; even basic build errors are not showing up.
  • The "Format Code" command doesn't do anything most of the time (no errors are shown)
@aaronkavlie-wf
Copy link
Author

I do have one (and only one, that I can see) green underline, suggesting that the exported method should have a comment or be unexported. If I add a comment to that method, the next method above it that is lacking a comment is then underlined, and so on.

In other words, there are a number of public methods lacking comments in this file, but only the last one gets a green underline.

@mattetti
Copy link
Contributor

I do see something weird too, it looks like one of the tools is dying in a panic but I can't see any logs (in the output panes or developer tools)

serum_go_-_serum

@egamma
Copy link
Member

egamma commented May 12, 2016

CC @jrieken did we change anything in the area of diagnostics and linting between 1.0 and 1.1?

@jrieken
Copy link
Member

jrieken commented May 12, 2016

things have changed wrt to being able to read the diagnostics in the extension host but nothing else. Since those changes have great self host coverage I am confident. Debugging this, I see that the extension computes an empty array of errors:

screen shot 2016-05-12 at 11 28 55

@jrieken
Copy link
Member

jrieken commented May 12, 2016

Having a simple syntax error like this,

fumc bar(){
    bioklr();
}

makes golint produce an error, but somehow go check is configured to read from stdout but not from stderr.

screen shot 2016-05-12 at 11 35 40

@vastbinderj
Copy link

vastbinderj commented May 13, 2016

Linting and format won't fire on save if there are no changes in the file. I found this annoying, that to lint a file for a code review, I had to edit it and save it... This was even before 1.1 was released.

I thought it was expected behavior.

@mattetti
Copy link
Contributor

@jrieken any clue on how to debug this issue? I'd be glad to give a hand

@deejross
Copy link

I'm noticing the same behavior and would be happy to help resolve it. This issue makes VSCode nearly unusable for Go development. I've had to fallback to IntelliJ and using fmt.Println() statements for debugging since the Go plugin for IntelliJ doesn't work with debugging on the Mac.

@lukehoban
Copy link
Contributor

@jrieken I don't think you previous note is right. The vscode-go extension is computing the errors correctly, and passing them to diagnosticsCollection.set, but only the first item of the array passed to that function is showing up in VS Code.

pic

No matter what the original source of the errors, VS Code is only ever displaying the first item of the array passed to DiagnosticsCollection#set. If the same set of items are permuted, the new first item will be the one VS Code displays.

I'll open an issue in the vscode repo on this. But in the meantime the Go extension will need to find a way to work around this.

@OneOfOne
Copy link
Contributor

@mattetti nsf/gocode#305 (comment) that's a gocode bug with go 1.7, either use < go 1.7 or apply the patch to your git tree.

@mattetti
Copy link
Contributor

@OneOfOne thanks a lot, I went back to VSCode 1.0 and still saw the error. I'm indeed on 1.7 and not planning on going back ;)

@OneOfOne
Copy link
Contributor

@mattetti no problem, gocode got fixed and the patch isn't needed anymore.

@tchoomak
Copy link

@lukehoban after upgrading vscode to 1.1.1 have the same - code errors and warnings notification seems to be entirely broken. Whether the plugin to be updated too?

@luca-moser
Copy link

luca-moser commented May 17, 2016

Same as @tchoomak on 1.1.1, I still don't get any errors inside VS Code, for example when a package import is missing. Works without problems on 1.0.0.

@jrieken
Copy link
Member

jrieken commented May 17, 2016

@lukehoban Yes, DiagnosticsCollection#set when called with an array of uri/diagnostics tuples has changes such that repeating tuples for one uri overwrites the previous data. The change wasn't on purpose.

Ultimately, the grouping here which was also in a way the root cause for this (#328) won't be needed anymore which I believe will yield in more easy to use API.

@AlekSi
Copy link
Contributor

AlekSi commented May 21, 2016

vscode-go update released and works as expected. Thank you!

@stiofand
Copy link

Same issue now with latest go code and plugin, can no longer use vs code for go dev, until this is fixed

@mirza-s
Copy link

mirza-s commented Oct 17, 2016

@stevematdavies you might want to try updating gocode.

gocode close && go get -u github.com/nsf/gocode

@stiofand
Copy link

@gargamelius Ive done that, and reinstalled the tools, now nothing works, no linting, formatting etc

@stiofand
Copy link

stiofand commented Oct 17, 2016

Switched to vim for now, working very well.

@giefferre
Copy link

@mirza-s this solved the problem, thank you

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