# Rework access to \`ThemeRegistry\` global \(\#7023\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 76560968149daf88a95d3f579be029dd54656a02

Requested commit: 76560968149daf88a95d3f579be029dd54656a02

Commit: 76560968149daf88a95d3f579be029dd54656a02

Tree: eff82fa92189cd1f9418838f80ab487012250f81

Author: Marshall Bowers

Committer: GitHub

## Message

```
Rework access to `ThemeRegistry` global (#7023)

This PR reworks how we access the `ThemeRegistry` global.

Previously we were making calls directly on the context, like
`cx.global::<ThemeRegistry>`. However, one problem with this is that it
spreads out the knowledge of exactly what type is stored in the global.

In order to make it easier to adjust the type we store in the context
(e.g., wrapping the `ThemeRegistry` in an `Arc`), we now call methods on
the `ThemeRegistry` itself for accessing the global.

It would also be interesting to see how we could prevent access to the
`ThemeRegistry` without going through one of these dedicated methods 🤔

Release Notes:

- N/A
```

## Parents

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

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