You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO(rstambler): We should be able to parse the build tags in the
232
+
// file and show a more specific error message. For now, put the diagnostic
233
+
// on the package declaration.
234
+
return&source.Diagnostic{
235
+
Range: rng,
236
+
Message: fmt.Sprintf(`No packages found for open file %s: %v.
237
+
If this file contains build tags, try adding "-tags=<build tag>" to your gopls "buildFlag" configuration (see (https://github.com/golang/tools/blob/master/gopls/doc/settings.md#buildflags-string).
238
+
Otherwise, see the troubleshooting guidelines for help investigating (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md).
239
+
`, uri.Filename(), err),
240
+
Severity: protocol.SeverityWarning,
241
+
Source: "compiler",
242
+
}
243
+
}
244
+
209
245
// diagnosticKey creates a unique identifier for a given diagnostic, since we
210
246
// cannot use source.Diagnostics as map keys. This is used to de-duplicate
Message: fmt.Sprintf(`No packages found for open file %s: %v.
342
-
If this file contains build tags, try adding "-tags=<build tag>" to your gopls "buildFlag" configuration (see (https://github.com/golang/tools/blob/master/gopls/doc/settings.md#buildflags-string).
343
-
Otherwise, see the troubleshooting guidelines for help investigating (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md).
344
-
`, uri.Filename(), err),
345
-
}); err!=nil {
346
-
event.Error(ctx, "warnAboutBuildTags: failed to show message", err, tag.URI.Of(uri))
0 commit comments