Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve warning message about global namespace class #457

Merged
merged 2 commits into from
Jul 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@ public override MetadataItem VisitAssembly(IAssemblySymbol symbol)
};
item.Type = MemberType.Assembly;
_references = new Dictionary<string, ReferenceItem>();
var namespaces = symbol.GlobalNamespace.GetNamespaceMembers().ToList();
if (namespaces.Count == 0)

var typeMembers = symbol.GlobalNamespace.GetTypeMembers();
if (typeMembers.Any())
{
Logger.LogWarning($"No namespace is found in assembly {symbol.MetadataName}. DocFX currently only supports generating metadata with namespace defined.");
Logger.LogWarning($"DocFX currently only supports generating metadata with namespace defined. The following types in assembly \"{symbol.MetadataName}\" will have no metadata generated: {string.Join(", ", typeMembers.Select(m => m.MetadataName))}. ");
}

var namespaces = symbol.GlobalNamespace.GetNamespaceMembers().ToList();
item.Items = VisitDescendants(
namespaces,
ns => ns.GetMembers().OfType<INamespaceSymbol>(),
Expand Down