Skip to content

Commit 250b519

Browse files
authored
fix(analyze/js): index ts constructor methods in semantic model (regression) (#8479)
1 parent 90e8684 commit 250b519

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

.changeset/lemon-mirrors-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Fixed [#8473](https://github.com/biomejs/biome/issues/8473): The semantic model now indexes typescript constructor method definitions, and no longer panics if you use one (a regression in 2.3.9).

crates/biome_js_semantic/src/semantic_model/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ impl SemanticModelBuilder {
9191
| TS_DECLARE_FUNCTION_DECLARATION
9292
| TS_DECLARE_FUNCTION_EXPORT_DEFAULT_DECLARATION
9393
| TS_CALL_SIGNATURE_TYPE_MEMBER
94+
| TS_CONSTRUCT_SIGNATURE_TYPE_MEMBER
9495
| TS_METHOD_SIGNATURE_CLASS_MEMBER
9596
| TS_METHOD_SIGNATURE_TYPE_MEMBER
9697
| TS_INDEX_SIGNATURE_CLASS_MEMBER

crates/biome_js_semantic/src/semantic_model/tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,14 @@ mod test {
272272
assert!(globals[0].is_read());
273273
assert_eq!(globals[0].syntax().text_trimmed(), "console");
274274
}
275+
276+
#[test]
277+
pub fn ok_semantic_model_ts_construct_signature_member() {
278+
let r = biome_js_parser::parse(
279+
"export interface TypedEventConstructor<T, I> { new(): Event & TypedEvent; }",
280+
JsFileSource::ts(),
281+
JsParserOptions::default(),
282+
);
283+
let _model = semantic_model(&r.tree(), SemanticModelOptions::default());
284+
}
275285
}

0 commit comments

Comments
 (0)