# editor: Fix completions menu flashes on every keystroke in TSX files with emmet \(\#38320\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 86834887da048b504373acc184135011aa3390b2

Requested commit: 86834887da048b504373acc184135011aa3390b2

Commit: 86834887da048b504373acc184135011aa3390b2

Tree: c00f90650f9d2a9c28fa41f358533413b9cfc35d

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix completions menu flashes on every keystroke in TSX files with emmet (#38320)

Closes https://github.com/zed-industries/zed/issues/37774

Bug in https://github.com/zed-industries/zed/pull/32927

Instead of using trigger characters to clear cached completions items,
now we check if the query is empty to clear it. Turns out Emmet defines
whole [alphanumeric as trigger
characters](https://github.com/olrtg/emmet-language-server/blob/279be108725fb391c167690b697ce154fd32657b/index.ts#L116)
which causes flickering.

Clear on trigger characters was introduced to get rid of cached
completions like in the case of "Parent.Foo.Bar", where "." is one of
the trigger characters. This works still since "." is not part of
`completion_query_characters` and hence we use it as a boundary while
building the current query. i.e in this case, the query would be empty
after typing ".", clearing cached completions.

Release Notes:

- Fixed issue where completions menu flashed on every keystroke in TSX
files with emmet extension installed.
```

## Parents

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

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