File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
crates/oxc_semantic/src/jsdoc/parser Expand file tree Collapse file tree 1 file changed +20
-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+ /// It does **not** include the type (inside `{}`) or the tag name (`@param`).
18+ /// Used to populate the `.comment` field on `JSDoc` and `JSDocTag` nodes.
419#[ derive( Debug , Clone , Copy ) ]
520pub struct JSDocCommentPart < ' a > {
21+ /// The raw string content, such as a parameter name or freeform description text.
622 raw : & ' a str ,
23+
24+ /// The span in the source text corresponding to this part.
725 pub span : Span ,
826}
27+
928impl < ' a > JSDocCommentPart < ' a > {
1029 pub fn new ( part_content : & ' a str , span : Span ) -> Self {
1130 Self { raw : part_content, span }
You can’t perform that action at this time.
0 commit comments