# editor: Fix TypeScript auto-import breaking generic function calls \(\#30312\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/9e5d115e72ce5ec33a383851d00cdb62e515e9bb)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 9e5d115e72ce5ec33a383851d00cdb62e515e9bb

Requested commit: 9e5d115e72ce5ec33a383851d00cdb62e515e9bb

Commit: 9e5d115e72ce5ec33a383851d00cdb62e515e9bb

Tree: d86545c67175860fc942c451274bc455b00db16b

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix TypeScript auto-import breaking generic function calls (#30312)

Closes #29982

When auto-importing TypeScript functions with generic type arguments
(like `useRef<HTMLDivElement>(null)`), the language server returns
snippets with placeholders (e.g., `useRef(${1:initialValue})$0`). While
useful for new function calls, this behavior breaks existing code when
renaming functions that already have parameters.

For example, completing `useR^<HTMLDivElement>(null)` incorrectly
results in `useRef(initialValue)^<HTMLDivElement>(null)`.

Related upstream issue:
https://github.com/microsoft/TypeScript/issues/51758
Similar workaround fix:
https://github.com/pmizio/typescript-tools.nvim/pull/147

Release Notes:

- Fixed TypeScript auto-import behavior where functions with generic
type arguments (like `useRef<HTMLDivElement>(null)`) would incorrectly
insert snippet placeholders, breaking the syntax.
```

## Parents

- [822580cb1261f1b86a1026f268a7f26aeda66355](https://git.cafe/gitcafe/zed/commit/822580cb1261f1b86a1026f268a7f26aeda66355?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/9e5d115e72ce5ec33a383851d00cdb62e515e9bb?format=markdown)
