# editor: Adjust scope for prefer label for snippet workaround \(\#32515\) · gitcafe/zed

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

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

Visibility: public

Requested revision: fc4ca346bead15667e3841a78666827afb7df597

Requested commit: fc4ca346bead15667e3841a78666827afb7df597

Commit: fc4ca346bead15667e3841a78666827afb7df597

Tree: 3ea1fb9860b2c16bffe8c10f59b36981ec5c8ee6

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Adjust scope for prefer label for snippet workaround (#32515)

Closes #32159

This PR refines the scope to match just the function name with **the
type argument** instead of the whole call expression.

Matching to whole call expression prevented methods from expanding
inside the function argument. For example, `const foo =
bar(someMethod(2)^);` instead of `const foo = bar(someMethod^)`;

Follow-up for https://github.com/zed-industries/zed/pull/30312,
https://github.com/zed-industries/zed/pull/30351. Mistakenly regressed
since https://github.com/zed-industries/zed/pull/31872 when we stopped
receiving `insert_range` for this particular case and fallback to
`replace_range`.

Release Notes:

- Fixed issue where code completion in TypeScript function arguments
sometimes omitted the dot separator, for example resulting in
`NumberparseInt` instead of `Number.parseInt(string)`.

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Michael Sloan <mgsloan@gmail.com>
```

## Parents

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

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