Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,11 @@ pub struct TSInterfaceDeclaration<'a> {
pub span: Span,
/// The identifier (name) of the interface.
pub id: BindingIdentifier<'a>,
/// Other interfaces/types this interface extends.
#[scope(enter_before)]
pub extends: Vec<'a, TSInterfaceHeritage<'a>>,
/// Type parameters that get bound to the interface.
#[scope(enter_before)]
pub type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
/// Other interfaces/types this interface extends.
pub extends: Vec<'a, TSInterfaceHeritage<'a>>,
pub body: Box<'a, TSInterfaceBody<'a>>,
/// `true` for `declare interface Foo {}`
pub declare: bool,
Expand Down
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/generated/assert_layouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,8 @@ const _: () = {
assert!(align_of::<TSInterfaceDeclaration>() == 8);
assert!(offset_of!(TSInterfaceDeclaration, span) == 0);
assert!(offset_of!(TSInterfaceDeclaration, id) == 8);
assert!(offset_of!(TSInterfaceDeclaration, extends) == 40);
assert!(offset_of!(TSInterfaceDeclaration, type_parameters) == 72);
assert!(offset_of!(TSInterfaceDeclaration, type_parameters) == 40);
assert!(offset_of!(TSInterfaceDeclaration, extends) == 48);
assert!(offset_of!(TSInterfaceDeclaration, body) == 80);
assert!(offset_of!(TSInterfaceDeclaration, declare) == 88);
assert!(offset_of!(TSInterfaceDeclaration, scope_id) == 92);
Expand Down Expand Up @@ -2523,8 +2523,8 @@ const _: () = {
assert!(align_of::<TSInterfaceDeclaration>() == 4);
assert!(offset_of!(TSInterfaceDeclaration, span) == 0);
assert!(offset_of!(TSInterfaceDeclaration, id) == 8);
assert!(offset_of!(TSInterfaceDeclaration, extends) == 28);
assert!(offset_of!(TSInterfaceDeclaration, type_parameters) == 44);
assert!(offset_of!(TSInterfaceDeclaration, type_parameters) == 28);
assert!(offset_of!(TSInterfaceDeclaration, extends) == 32);
assert!(offset_of!(TSInterfaceDeclaration, body) == 48);
assert!(offset_of!(TSInterfaceDeclaration, declare) == 52);
assert!(offset_of!(TSInterfaceDeclaration, scope_id) == 56);
Expand Down
48 changes: 24 additions & 24 deletions crates/oxc_ast/src/generated/ast_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4128,17 +4128,17 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
#[inline]
pub fn declaration_ts_interface<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
) -> Declaration<'a>
Expand All @@ -4149,8 +4149,8 @@ impl<'a> AstBuilder<'a> {
Declaration::TSInterfaceDeclaration(self.alloc_ts_interface_declaration(
span,
id,
extends,
type_parameters,
extends,
body,
declare,
))
Expand All @@ -4163,8 +4163,8 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
/// * `scope_id`
Expand All @@ -4173,8 +4173,8 @@ impl<'a> AstBuilder<'a> {
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
scope_id: ScopeId,
Expand All @@ -4186,8 +4186,8 @@ impl<'a> AstBuilder<'a> {
Declaration::TSInterfaceDeclaration(self.alloc_ts_interface_declaration_with_scope_id(
span,
id,
extends,
type_parameters,
extends,
body,
declare,
scope_id,
Expand Down Expand Up @@ -8132,17 +8132,17 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
#[inline]
pub fn export_default_declaration_kind_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
) -> ExportDefaultDeclarationKind<'a>
Expand All @@ -8153,8 +8153,8 @@ impl<'a> AstBuilder<'a> {
ExportDefaultDeclarationKind::TSInterfaceDeclaration(self.alloc_ts_interface_declaration(
span,
id,
extends,
type_parameters,
extends,
body,
declare,
))
Expand All @@ -8167,8 +8167,8 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
/// * `scope_id`
Expand All @@ -8177,8 +8177,8 @@ impl<'a> AstBuilder<'a> {
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
scope_id: ScopeId,
Expand All @@ -8191,8 +8191,8 @@ impl<'a> AstBuilder<'a> {
self.alloc_ts_interface_declaration_with_scope_id(
span,
id,
extends,
type_parameters,
extends,
body,
declare,
scope_id,
Expand Down Expand Up @@ -12070,17 +12070,17 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
#[inline]
pub fn ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
) -> TSInterfaceDeclaration<'a>
Expand All @@ -12091,8 +12091,8 @@ impl<'a> AstBuilder<'a> {
TSInterfaceDeclaration {
span,
id,
extends,
type_parameters: type_parameters.into_in(self.allocator),
extends,
body: body.into_in(self.allocator),
declare,
scope_id: Default::default(),
Expand All @@ -12107,17 +12107,17 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
#[inline]
pub fn alloc_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
) -> Box<'a, TSInterfaceDeclaration<'a>>
Expand All @@ -12126,7 +12126,7 @@ impl<'a> AstBuilder<'a> {
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
{
Box::new_in(
self.ts_interface_declaration(span, id, extends, type_parameters, body, declare),
self.ts_interface_declaration(span, id, type_parameters, extends, body, declare),
self.allocator,
)
}
Expand All @@ -12139,8 +12139,8 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
/// * `scope_id`
Expand All @@ -12149,8 +12149,8 @@ impl<'a> AstBuilder<'a> {
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
scope_id: ScopeId,
Expand All @@ -12162,8 +12162,8 @@ impl<'a> AstBuilder<'a> {
TSInterfaceDeclaration {
span,
id,
extends,
type_parameters: type_parameters.into_in(self.allocator),
extends,
body: body.into_in(self.allocator),
declare,
scope_id: Cell::new(Some(scope_id)),
Expand All @@ -12178,8 +12178,8 @@ impl<'a> AstBuilder<'a> {
/// ## Parameters
/// * `span`: The [`Span`] covering this node
/// * `id`: The identifier (name) of the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `type_parameters`: Type parameters that get bound to the interface.
/// * `extends`: Other interfaces/types this interface extends.
/// * `body`
/// * `declare`: `true` for `declare interface Foo {}`
/// * `scope_id`
Expand All @@ -12188,8 +12188,8 @@ impl<'a> AstBuilder<'a> {
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
type_parameters: T1,
extends: Vec<'a, TSInterfaceHeritage<'a>>,
body: T2,
declare: bool,
scope_id: ScopeId,
Expand All @@ -12202,8 +12202,8 @@ impl<'a> AstBuilder<'a> {
self.ts_interface_declaration_with_scope_id(
span,
id,
extends,
type_parameters,
extends,
body,
declare,
scope_id,
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_ast/src/generated/derive_clone_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6884,8 +6884,8 @@ impl<'new_alloc> CloneIn<'new_alloc> for TSInterfaceDeclaration<'_> {
TSInterfaceDeclaration {
span: CloneIn::clone_in(&self.span, allocator),
id: CloneIn::clone_in(&self.id, allocator),
extends: CloneIn::clone_in(&self.extends, allocator),
type_parameters: CloneIn::clone_in(&self.type_parameters, allocator),
extends: CloneIn::clone_in(&self.extends, allocator),
body: CloneIn::clone_in(&self.body, allocator),
declare: CloneIn::clone_in(&self.declare, allocator),
scope_id: Default::default(),
Expand All @@ -6896,8 +6896,8 @@ impl<'new_alloc> CloneIn<'new_alloc> for TSInterfaceDeclaration<'_> {
TSInterfaceDeclaration {
span: CloneIn::clone_in_with_semantic_ids(&self.span, allocator),
id: CloneIn::clone_in_with_semantic_ids(&self.id, allocator),
extends: CloneIn::clone_in_with_semantic_ids(&self.extends, allocator),
type_parameters: CloneIn::clone_in_with_semantic_ids(&self.type_parameters, allocator),
extends: CloneIn::clone_in_with_semantic_ids(&self.extends, allocator),
body: CloneIn::clone_in_with_semantic_ids(&self.body, allocator),
declare: CloneIn::clone_in_with_semantic_ids(&self.declare, allocator),
scope_id: CloneIn::clone_in_with_semantic_ids(&self.scope_id, allocator),
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_content_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,8 @@ impl ContentEq for TSClassImplements<'_> {
impl ContentEq for TSInterfaceDeclaration<'_> {
fn content_eq(&self, other: &Self) -> bool {
ContentEq::content_eq(&self.id, &other.id)
&& ContentEq::content_eq(&self.extends, &other.extends)
&& ContentEq::content_eq(&self.type_parameters, &other.type_parameters)
&& ContentEq::content_eq(&self.extends, &other.extends)
&& ContentEq::content_eq(&self.body, &other.body)
&& ContentEq::content_eq(&self.declare, &other.declare)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2345,8 +2345,8 @@ impl<'a> Dummy<'a> for TSInterfaceDeclaration<'a> {
Self {
span: Dummy::dummy(allocator),
id: Dummy::dummy(allocator),
extends: Dummy::dummy(allocator),
type_parameters: Dummy::dummy(allocator),
extends: Dummy::dummy(allocator),
body: Dummy::dummy(allocator),
declare: Dummy::dummy(allocator),
scope_id: Dummy::dummy(allocator),
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2865,8 +2865,8 @@ impl ESTree for TSInterfaceDeclaration<'_> {
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_field("id", &self.id);
state.serialize_field("extends", &self.extends);
state.serialize_field("typeParameters", &self.type_parameters);
state.serialize_field("extends", &self.extends);
state.serialize_field("body", &self.body);
state.serialize_field("declare", &self.declare);
state.end();
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast_visit/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3622,10 +3622,10 @@ pub mod walk {
visitor.visit_span(&it.span);
visitor.visit_binding_identifier(&it.id);
visitor.enter_scope(ScopeFlags::empty(), &it.scope_id);
visitor.visit_ts_interface_heritages(&it.extends);
if let Some(type_parameters) = &it.type_parameters {
visitor.visit_ts_type_parameter_declaration(type_parameters);
}
visitor.visit_ts_interface_heritages(&it.extends);
visitor.visit_ts_interface_body(&it.body);
visitor.leave_scope();
visitor.leave_node(kind);
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast_visit/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3819,10 +3819,10 @@ pub mod walk_mut {
visitor.visit_span(&mut it.span);
visitor.visit_binding_identifier(&mut it.id);
visitor.enter_scope(ScopeFlags::empty(), &it.scope_id);
visitor.visit_ts_interface_heritages(&mut it.extends);
if let Some(type_parameters) = &mut it.type_parameters {
visitor.visit_ts_type_parameter_declaration(type_parameters);
}
visitor.visit_ts_interface_heritages(&mut it.extends);
visitor.visit_ts_interface_body(&mut it.body);
visitor.leave_scope();
visitor.leave_node(kind);
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/ts/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ impl<'a> ParserImpl<'a> {
Ok(self.ast.declaration_ts_interface(
self.end_span(span),
id,
extends,
type_parameters,
extends,
body,
modifiers.contains_declare(),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaratio
"flags": "ReferenceFlags(Type)",
"id": 1,
"name": "T",
"node_id": 13
"node_id": 16
}
]
}
Expand All @@ -57,7 +57,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaratio
"flags": "ReferenceFlags(Type)",
"id": 0,
"name": "A",
"node_id": 9
"node_id": 12
}
]
},
Expand Down
Loading
Loading