summaryrefslogtreecommitdiff
path: root/source/compiler-core/slang-doc-extractor.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-30 14:19:39 -0700
committerGitHub <noreply@github.com>2022-06-30 14:19:39 -0700
commit2c09275388d4c88ea26bf709132b8be4a9e342bc (patch)
treeac0049c3bc484aca9e36b489337771e90973bf0a /source/compiler-core/slang-doc-extractor.h
parent5eee6b03c391d0bb6ed0ded2d8d91c2e525fdb97 (diff)
Language server: extract documentation from ordinary comments (#2308)
* Language server: improved documentation formatting. * Extend doc extractor to search in ordinary comments. Reuse language server instance between tests. * Fix test case. * Fix comment. * Fix crash. * Fix enum case doc extraction. * Doc extractor fixes. * Fix. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/compiler-core/slang-doc-extractor.h')
-rw-r--r--source/compiler-core/slang-doc-extractor.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/compiler-core/slang-doc-extractor.h b/source/compiler-core/slang-doc-extractor.h
index 5b4c67782..fc486250e 100644
--- a/source/compiler-core/slang-doc-extractor.h
+++ b/source/compiler-core/slang-doc-extractor.h
@@ -42,13 +42,17 @@ public:
BlockBefore, /// /** */ or /*! */.
LineBangBefore, /// //! Can be multiple lines
LineSlashBefore, /// /// Can be multiple lines
+ OrdinaryBlockBefore,
+ OrdinaryLineBefore,
BlockAfter, /// /*!< */ or /**< */
LineBangAfter, /// //!< Can be multiple lines
LineSlashAfter, /// ///< Can be multiple lines
+ OrdinaryLineAfter,
+
};
- static bool isBefore(MarkupType type) { return Index(type) >= Index(MarkupType::BlockBefore) && Index(type) <= Index(MarkupType::LineSlashBefore); }
+ static bool isBefore(MarkupType type) { return Index(type) >= Index(MarkupType::BlockBefore) && Index(type) <= Index(MarkupType::OrdinaryLineBefore); }
static bool isAfter(MarkupType type) { return Index(type) >= Index(MarkupType::BlockAfter); }
struct IndexRange
@@ -121,6 +125,10 @@ public:
Index lineIndex; ///< The line number for the decl
};
+ void setSearchInOrdinaryComments(bool val)
+ {
+ m_searchInOrindaryComments = val;
+ }
/// Extracts 'markup' doc information for the specified input items
/// The output is placed in out - with the items now in the source order *not* the order of the input items
@@ -156,6 +164,8 @@ protected:
static bool _isTokenOnLineIndex(SourceView* sourceView, MarkupType type, const Token& tok, Index lineIndex);
DiagnosticSink* m_sink;
+
+ bool m_searchInOrindaryComments = false;
};
} // namespace Slang