Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.
This repository was 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

Description

@brando90

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...

Activity

  1. joefitzgerald commented on Jul 25, 2014

    @joefitzgerald
    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.

  2. joefitzgerald commented on Jul 25, 2014

    @joefitzgerald
    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
  3. cryptix commented on Jul 26, 2014

    @cryptix

    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.

  4. joefitzgerald commented on Jul 26, 2014

    @joefitzgerald
    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?

  5. cryptix commented on Jul 26, 2014

    @cryptix

    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?

  6. brando90 commented on Jul 26, 2014

    @brando90
    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?

  7. brando90 commented on Jul 26, 2014

    @brando90
    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...

  8. joefitzgerald commented on Jul 26, 2014

    @joefitzgerald
    Owner

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

  9. joefitzgerald commented on Jul 26, 2014

    @joefitzgerald
    Owner

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

  10. Omegaice commented on Jul 26, 2014

    @Omegaice

    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.

  11. joefitzgerald commented on Jul 28, 2014

    @joefitzgerald
    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.

  12. joefitzgerald commented on Jul 28, 2014

    @joefitzgerald
    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.

  13. brando90 commented on Jul 28, 2014

    @brando90
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions