summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-03-05 14:34:46 -0500
committerGitHub <noreply@github.com>2021-03-05 14:34:46 -0500
commit860d17b6876822ef7023fdce70c725d3f8be37b1 (patch)
tree1ed058603b789a59103886c8e1f77a3d4e69adb1 /source/slang/slang.cpp
parentdc7110858ecdb7c7567de360787b9adc4defa04a (diff)
Doc tooling improvements (#1734)
* #include an absolute path didn't work - because paths were taken to always be relative. * Split out AST 'printing'. * Replace listener with List<Section> * Section -> Part. * Kind -> Type Flags -> Kind for ASTPrinter::Part * Improve comments around ASTPrinter. * toString -> toText on Val derived types. toText appends to a StringBuilder. * Added toSlice free function. Added operator<< for Val derived types. Use << where appropriate in doing toText. * More work at mark down output. * Fill in sourceloc for enum case. Add more sophisticated location determination for EnumCase. Refactored documentation output into DocMarkdownWriter. * Improvements for sig output. * Split up slang-doc into extractor and writer. * WIP generic support for doc support. * Some refactoring to make DocExtractor have potential to be used without Decls. * Made doc extraction work without Decls. * Output generic parameters. * Add generic parameter extraction. * Added writing variables. * Add an interface test. * Fix toArray. * Support for extensions, and inheritance. * Disable the doc test. Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 21f60c090..1820b24e5 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -30,7 +30,8 @@
#include "slang-serialize-ir.h"
#include "slang-serialize-container.h"
-#include "slang-doc.h"
+#include "slang-doc-extractor.h"
+#include "slang-doc-mark-down.h"
#include "slang-check-impl.h"
@@ -1808,8 +1809,7 @@ SlangResult FrontEndCompileRequest::executeActionsInner()
for (TranslationUnitRequest* translationUnit : translationUnits)
{
RefPtr<DocMarkup> markup(new DocMarkup);
-
- markup->extract(translationUnit->getModuleDecl(), getSourceManager(), getSink());
+ DocMarkupExtractor::extract(translationUnit->getModuleDecl(), getSourceManager(), getSink(), markup);
// Hmm.. we can have multiple sourcefiles. So fir now we just pick the first, so as to come up with
// a reasonable name
@@ -1822,10 +1822,10 @@ SlangResult FrontEndCompileRequest::executeActionsInner()
String fileName = Path::getFileNameWithoutExt(path);
fileName.append(".md");
- StringBuilder buf;
- DocumentationUtil::writeMarkdown(markup, astBuilder, buf);
+ DocMarkDownWriter writer(markup, astBuilder);
+ writer.writeAll();
- File::writeAllText(fileName, buf);
+ File::writeAllText(fileName, writer.getOutput());
}
}
}