summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-doc-ast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-doc-ast.cpp')
-rw-r--r--source/slang/slang-doc-ast.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-doc-ast.cpp b/source/slang/slang-doc-ast.cpp
index 172f31b32..4d35f32be 100644
--- a/source/slang/slang-doc-ast.cpp
+++ b/source/slang/slang-doc-ast.cpp
@@ -3,6 +3,7 @@
#include "../core/slang-string-util.h"
+#include "slang/slang-ast-support-types.h"
//#include "slang-ast-builder.h"
//#include "slang-ast-print.h"
@@ -47,9 +48,14 @@ namespace Slang {
}
}
+bool shouldDocumentDecl(Decl* decl)
+{
+ return !getText(decl->getName()).startsWith("$__syn") && !decl->hasModifier<SynthesizedModifier>();
+}
+
static void _addDeclRec(Decl* decl, List<Decl*>& outDecls)
{
- if (decl == nullptr)
+ if (decl == nullptr || !shouldDocumentDecl(decl))
{
return;
}
@@ -109,7 +115,7 @@ SlangResult ASTMarkupUtil::extract(ModuleDecl* moduleDecl, SourceManager* source
item.searchStyle = getSearchStyle(decl);
// Don't generate documentation for synthesized members.
- if (getText(decl->getName()).startsWith("$__syn"))
+ if (!shouldDocumentDecl(decl))
item.searchStyle = DocMarkupExtractor::SearchStyle::None;
}