# agent_ui: Add file name and line number to symbol completions \(\#40508\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d00ad02b05981c79942b3bdff957e2384e68b89f

Requested commit: d00ad02b05981c79942b3bdff957e2384e68b89f

Commit: d00ad02b05981c79942b3bdff957e2384e68b89f

Tree: 2a0d344b9c2b729ecd5d32f07846663944974cbd

Author: Paweł Kondzior

Committer: GitHub

## Message

```
agent_ui: Add file name and line number to symbol completions (#40508)

Symbol completions in the context picker now show "SymbolName
filename.txt L123" instead of just "SymbolName". This helps distinguish
between symbols with the same name in different files.

## Motivation

I noticed that the message prompt editor only showed symbol names
without any context, making it hard to use in large projects with many
symbols sharing the same name. The inline prompt editor already includes
file context for symbol completions, so I brought that same UX
improvement to the message prompt editor. I've decided to match the
highlighting style with directory completion entries from the message
editor.

## Changes

- Extract file name from both InProject and OutsideProject symbol
locations
- Add `build_symbol_label` helper to format labels with file context
- Update test expectation for new label format

## Screenshots
Inline Prompt Editor
<img width="843" height="334" alt="Screenshot 2025-10-17 at 17 47 52"
src="https://github.com/user-attachments/assets/16752e1a-0b8c-4f58-a0b2-25ae5130f18c"
/>
Old Message Editor:
<img width="466" height="363" alt="Screenshot 2025-10-17 at 17 31 44"
src="https://github.com/user-attachments/assets/900659f3-0632-4dff-bc9a-ab2dad351964"
/>
New Message Editor:
<img width="482" height="359" alt="Screenshot 2025-10-17 at 17 31 23"
src="https://github.com/user-attachments/assets/bf382167-f88b-4f3d-ba3e-1e251a8df962"
/>


Release Notes:

- Added file names and line numbers to symbol completions in the agent
panel
```

## Parents

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

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