File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
crates/oxc_semantic/src/jsdoc/parser Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11use oxc_span:: Span ;
22
3- /// Used for `JSDoc.comment` and `JSDocTag.comment`
3+ /// Represents the raw text of a JSDoc tag *outside* the type expression (`{}`) and tag name (e.g., `@param`),
4+ /// such as the parameter name or trailing description.
5+ ///
6+ /// This is used to capture parts of a JSDoc tag that aren't types but still carry semantic meaning,
7+ /// for example, the name `bar` or the description text in `@param {foo=} bar Some description`.
8+ ///
9+ /// ```js
10+ /// /**
11+ /// * @param {foo=} bar Some description
12+ /// * ^^^^^^^^^^^^^^^^^^^^
13+ /// * This is the `JSDocCommentPart`
14+ /// */
15+ /// ```
16+ ///
17+ /// Used to populate the `.comment` field on `JSDoc` and `JSDocTag` nodes.
418#[ derive( Debug , Clone , Copy ) ]
519pub struct JSDocCommentPart < ' a > {
20+ /// The raw string content, such as a parameter name or freeform description text.
621 raw : & ' a str ,
22+
23+ /// The span in the source text corresponding to this part.
724 pub span : Span ,
825}
26+
927impl < ' a > JSDocCommentPart < ' a > {
1028 pub fn new ( part_content : & ' a str , span : Span ) -> Self {
1129 Self { raw : part_content, span }
You can’t perform that action at this time.
0 commit comments