-
Notifications
You must be signed in to change notification settings - Fork 796
Option to run diagnostics only on current package #1275
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Isn't it possible to utilize cc @stamblerre |
@hyangah If I only ever worked on one part of the monorepo, yes, I could use that and ignore everything else. However, I often work on different parts, and its nice to have the compiler simply compile whatever package I am working on at the moment, instead of having to keep those filters up-to-date manually. |
Thanks @wackywendell That makes sense. Does your monorepo have multiple go modules in it? If not, is it possible to open only the directory that you are working on? I was told recent versions of But I imagine, in certain situations, working only with one directory of a large monorepo doesn't work. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Sorry for the delayed response.
It has multiple packages, but it doesn't use go modules; we've had issues transitioning to go modules, and haven't gotten there.
Not really; sometimes I start in |
Problem
I work in a large "monorepo", with many packages in it. With the default settings for
gopls
, on save I get 4K+ errors from parts of the repo I don't work on, due to all sorts of setup issues (e.g. settingCGO_CFLAGS
) in those packages. I could try and get the setup correct for all of them, but this would be very time-consuming, and I already have the setup working correctly for the packages I am interested in.Previous Behavior
Before using gopls, I had the setting
"go.buildOnSave": "package"
, and as such, on save I would only see compiler errors for the package I was currently editing. This worked fine with the monorepo. Withgopls
, this is apparently not an option; as the option text for "Build on Save" says, "Options are 'workspace', 'package', or 'off'. Not applicable when using the language server's diagnostics. See 'go.languageServerExperimentalFeatures.diagnostics' setting.".Workarounds
I can disable that experimental
diagnostics
setting (as discussed in #50), but this isn't really what I want, and will likely be deprecated eventually - I'm happy to get compiler errors from gopls, I just want them limited to the current package (and its dependencies in the current workspace), the same as if I calledgo build .
in that package.The text was updated successfully, but these errors were encountered: