File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -584,12 +584,20 @@ static SmallString<16> determineFileName(Info *I, SmallString<128> &Path) {
584584 FileName = RecordSymbolInfo->MangledName ;
585585 } else if (I->USR == GlobalNamespaceID)
586586 FileName = " index" ;
587- else
587+ else if (I->IT == InfoType::IT_namespace) {
588+ for (const auto &NS : I->Namespace ) {
589+ FileName += NS.Name ;
590+ FileName += " _" ;
591+ }
592+ FileName += I->Name ;
593+ } else
588594 FileName = I->Name ;
589595 sys::path::append (Path, FileName + " .json" );
590596 return FileName;
591597}
592598
599+ // FIXME: Revert back to creating nested directories for namespaces instead of
600+ // putting everything in a flat directory structure.
593601Error JSONGenerator::generateDocs (
594602 StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
595603 const ClangDocContext &CDCtx) {
Original file line number Diff line number Diff line change 1+ // RUN: rm -rf %t && mkdir -p %t
2+ // RUN: clang-doc --output=%t --format=json --executor=standalone %s
3+ // RUN: FileCheck %s < %t/json/foo_tools.json --check-prefix=CHECK-FOO
4+ // RUN: FileCheck %s < %t/json/bar_tools.json --check-prefix=CHECK-BAR
5+
6+ namespace foo {
7+ namespace tools {
8+ class FooTools {};
9+ } // namespace tools
10+ } // namespace foo
11+
12+ namespace bar {
13+ namespace tools {
14+ class BarTools {};
15+ } // namespace tools
16+ } // namespace bar
17+
18+ // CHECK-FOO: "Name": "tools"
19+
20+ // CHECK-BAR: "Name": "tools"
Original file line number Diff line number Diff line change 11// RUN: rm -rf %t && mkdir -p %t
22// RUN: clang-doc --output=%t --format=json --executor=standalone %s
33// RUN: FileCheck %s < %t/json/nested.json --check-prefix=NESTED
4- // RUN: FileCheck %s < %t/json/inner .json --check-prefix=INNER
4+ // RUN: FileCheck %s < %t/json/nested_inner .json --check-prefix=INNER
55
66namespace nested {
77 int Global;
You can’t perform that action at this time.
0 commit comments