# typescript: Fix type import highlighting when alias is not present \(\#47190\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 04d878eef8cabf320c7b860a8092f17eb2c38719

Requested commit: 04d878eef8cabf320c7b860a8092f17eb2c38719

Commit: 04d878eef8cabf320c7b860a8092f17eb2c38719

Tree: c3871184c70ba728fa45e8dc8aa0f70971856e27

Author: Delyan Haralanov

Committer: GitHub

## Message

```
typescript: Fix type import highlighting when alias is not present (#47190)

## Problem
The existing tree-sitter queries for type imports required both name and
alias fields to match. This caused `import type { Foo }` and `import {
type Foo }` to fall back to the generic identifier/variable highlighting
instead of being colored as types.

- `import type { Foo }` → **NOT matched** (no alias)
- `import { type Foo }` → **NOT matched** (no alias)  
- `import type { Foo as Bar }` → Matched ✓
- `import { type Foo as Bar }` → Matched ✓

## Solution
Split the patterns to handle name and alias captures independently.

~## Disclaimer~
~DEBUGGING AND IMPLEMENTATION WAS DONE WITH **AI ASSISTANCE**.~
~**THE FIX HAS NOT BEEN TESTED** - I HAVE NOT COMPILED FROM SOURCE~
- @KyleBarton built from source and verified


Release Notes:

- Fixed typescript type import highlighting
```

## Parents

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

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