# lsp: Add clangd readonly token modifier to semantic token rules to highlight constant variables as constant \(\#49065\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e5a69d89497e37cca1a7e7407225d3b0c142d5b0

Requested commit: e5a69d89497e37cca1a7e7407225d3b0c142d5b0

Commit: e5a69d89497e37cca1a7e7407225d3b0c142d5b0

Tree: b0f52cec2bce46fa53473229ca93d09926371e99

Author: ozacod

Committer: GitHub

## Message

```
lsp: Add clangd readonly token modifier to semantic token rules to highlight constant variables as constant (#49065)

Clangd uses the "readonly" token modifier instead of "constant".
Therefore, "readonly" should be mapped to highlight constant variables
as constants.

Before:
<img width="706" height="48" alt="before"
src="https://github.com/user-attachments/assets/8cc2a310-7825-490b-b868-58ea231612fa"
/>

After:
<img width="762" height="46" alt="after"
src="https://github.com/user-attachments/assets/e271d4cd-cc59-45f9-a8b4-2885857915db"
/>

- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Added clangd readonly token modifier to semantic token rules to
highlight constant variables as constant.

Co-authored-by: ozacod <ozacod@users.noreply.github.com>
```

## Parents

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

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