python: Add `label_for_symbol` for ty adapter (#51355)

Ported `label_for_symbol` logic directly from the basedpyright adapter
without adjustments.

Given Python's dynamic nature, the current implementation provides
sufficient coverage. No further modifications are needed for now.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed missing syntax highlighting in symbol search when using the ty
language server.
e0881e38f9Xin Zhao committed on 3/12/2026, 12:24:51 PM· committed by GitHubparentd28fc4e
1 file changedLine totals unavailable