Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Is go-plus not suppose to analyze your code if its open on a different pane? #44

Closed
brando90 opened this issue Jul 25, 2014 · 13 comments
Closed

Comments

@brando90
Copy link

Is go-plus not suppose to analyze your code if its open on a different pane?

I had a different file open on a right pane and when I saved, it didn't do syntax analysis or anything like that. Is that expected behaviour?

Also, when I save only with one file, two little windows at the bottom with the same message open, even though there is only one file open. These bugs are happening only after the update to 2.0.1, not sure if I should open a new gitissue...

@joefitzgerald
Copy link
Owner

@brando90 Currently go-plus analyzes the currently active EditorView. This means that if you have multiple files open (e.g. in different panes) that only the one with focus when you save will be analyzed and have warnings / errors displayed. Coverage works across all files in a package.

@joefitzgerald
Copy link
Owner

I can think of a few alternative behaviors that might be helpful:

  • run go build / go test on the current package instead of just the file in question
  • run go build ./... / go test ./... on the current package instead of just the file in question
  • iterate through all panes and find the active EditorView in each, and run go build / go test on the relevant file
  • try to find the root of the app / library and run go build ./... / go test ./... there << requires some level of magic or configuration, neither of which I like

@cryptix
Copy link

cryptix commented Jul 26, 2014

I would argue for running go test on the current package. If I accidentally change a type/variable/whatever name in one file which is used in another I want to know that immediately. Running it on all packages in the subtree seems a bit wasteful but might be handy as an extra command in the palette.

@joefitzgerald
Copy link
Owner

The issue with running go test on save is that some people write integration tests and then we could have minutes worth of tests running. The coverage feature does run go test -coverprofile on save if you have Coverage On Save turned on, but see #45 for an enhancement request for that.

The syntax check feature does not actually run the tests but simply checks if the file can be compiled. Switching to trying to compile the entire package would not have a huge speed penalty (go's compiler is fast), but would achieve the outcome you're looking for.

That paired with #45 would probably address your requirements?

@cryptix
Copy link

cryptix commented Jul 26, 2014

Ok, I see.

The syntax check feature does not actually run the tests but simply checks if the file can be compiled.

I didn't even know that this is possible. Maybe we could allign it with the Coverage On Save flag. Since to run the tests you have to compile the whole package anyway, right?

@brando90
Copy link
Author

Hi @joefitzgerald.

I would have expected the behaviour you described, i.e. that it analyzes the currently active EditorView. However, as far as I can tell, the little window at the bottom for go-plus does not come out when my cursor is on the file I want go-plus to analyze. It might be analyzing it but its not telling me anything about it. I do see at the bottom of the atom window that the correct file is being described (i.e. I am sure I am on the correct file). Do you experience this behaviour or is it just me?

@brando90
Copy link
Author

Also, when I save only with one file, two little windows at the bottom with the same message open, even though there is only one file open. These bugs are happening only after the update to 2.0.1, not sure if I should open a new gitissue...

@joefitzgerald
Copy link
Owner

@brando90 sounds like I need some tests for a two-pane workspace! Yes, please create a new issue.

@joefitzgerald
Copy link
Owner

Actually, nevermind I will track both issues in this issue.

@Omegaice
Copy link

I got the multiple (I had three at one point) message windows. I fixed it by either reinstalling go-plus (uninstall and then install) or by force quitting atom and then restarting it. It seemed to coincide with updating through the gui package interface in atom.

Edit: I managed to reproduce the problem. If you have go-plus installed and have an editor window open with go code with an error it produces one window. If you then uninstall go-plus and reinstall and go back to that editor and save again it produces two windows. This can be repeated and it will keep creating more windows. The workaround is to close atom and reopen it after updating go-plus.

joefitzgerald added a commit that referenced this issue Jul 27, 2014
- Use 'file' feature of atom-message-panel
- Fixes #35
- Addresses first part of #44
@joefitzgerald
Copy link
Owner

I can confirm I have reproduced the bug where you get two message panels after an update.

The workaround for now is to quit atom and relaunch it after and upgrade or initial install. I need to dig further to determine if this is an issue with atom-message-panel itself or something I'm doing.

@joefitzgerald
Copy link
Owner

I'm going to track the second issue reported here as a separate bug: #49. The original issue reported here (that syntax issues were not identified across an entire package) has been resolved in 2.0.2.

@brando90
Copy link
Author

also, related to the window for the go code warning appearing, is there a keyboard way of closing it? Not sure if this should be a new gitissue or something...

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

4 participants