Skip to content

Commit 81ff679

Browse files
docs(ast): improve docs for TS types (#12053)
Clarify which parts of the examples are the `TSTypeReference` / `TSQualifiedName`.
1 parent 6dbacea commit 81ff679

File tree

1 file changed

+9
-5
lines changed
  • crates/oxc_ast/src/ast

1 file changed

+9
-5
lines changed

crates/oxc_ast/src/ast/ts.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,12 @@ pub struct TSBigIntKeyword {
751751
///
752752
/// ## Example
753753
/// ```ts
754-
/// type C = A;
755-
/// type D = B.a;
756-
/// type E = D.c.b.a;
754+
/// type A = X;
755+
/// // ^
756+
/// type B = Y.a;
757+
/// // ^^^
758+
/// type C<T> = Z.b<T>;
759+
/// // ^^^^^^
757760
/// ```
758761
#[ast(visit)]
759762
#[derive(Debug)]
@@ -764,9 +767,9 @@ pub struct TSTypeReference<'a> {
764767
pub type_arguments: Option<Box<'a, TSTypeParameterInstantiation<'a>>>,
765768
}
766769

767-
/// TypeName:
770+
/// TSTypeName:
768771
/// IdentifierReference
769-
/// NamespaceName . IdentifierReference
772+
/// TSTypeName . IdentifierName
770773
#[ast(visit)]
771774
#[derive(Debug)]
772775
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)]
@@ -792,6 +795,7 @@ pub use match_ts_type_name;
792795
/// ## Example
793796
/// ```ts
794797
/// type Foo = A.B.C;
798+
/// // ^^^^^
795799
/// ```
796800
#[ast(visit)]
797801
#[derive(Debug)]

0 commit comments

Comments
 (0)