8000 fix: Dot in a string breaks the highlighting in Terraform. Fixes #988 by esacteksab · Pull Request #1065 · alecthomas/chroma · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Dot in a string breaks the highlighting in Terraform. Fixes #988 #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 31, 2025

Conversation

esacteksab
Copy link
Contributor

Admittedly, I set how to make Chroma look more like Pygments.

Pygments:

pygments-string-capture

Chroma:

chroma-string-current-capture

Pygments in my opinion does this correctly, with everything between " ... " is a string. Chroma does some inner interpolation to pull out those inner pieces. I can see both sides and in that spirit, I chose to keep the current convention. I do have a branch that will make Chroma like Pygments if that's the desired behavior.

While looking into existing Terraform issues and Pull requests, I encountered #988 and wondered if I could solve it.

As it currently exists:

988-current-capture

Fixed in this PR:

chroma-988-fixed-capture

A silver lining is punctuation actually works and mirrors Pygments. There is a possible regression depending on one's point of view and I wanted to call it out or not hide it.

Current:

current-chroma-iam-policy-doc-github-dark-capture

This PR:

chroma-proposed-fixed-iam-policy-document-github-dark-capture

The punctuation inside strings is highlighted differently. I don't know whether this solution is worth it or if it is a regression not worth considering, of if it is even a regression at all.

But I've spent too much time and admittedly, I don't understand the syntax well enough. I solved my problem, maybe another one, maybe not. I'll understand if you close this PR, perhaps someone else can pick it up and address the regression if it is considered a regression. If you treat everything inside " ... " as a string, then this possible regression becomes moot.

@alecthomas
Copy link
Owner

I must admit I don't fully understand the nuance of what you're referring to, but it does seem to fix #988 so that's LGTM!

@alecthomas
Copy link
Owner

Thanks for the PR!

@alecthomas alecthomas merged commit 88084b6 into alecthomas:master Mar 31, 2025
2 checks passed
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Apr 4, 2025
…7459)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) | require | minor | `v2.15.0` -> `v2.16.0` |

---

### Release Notes

<details>
<summary>alecthomas/chroma (github.com/alecthomas/chroma/v2)</summary>

### [`v2.16.0`](https://github.com/alecthomas/chroma/releases/tag/v2.16.0)

[Compare Source](alecthomas/chroma@v2.15.0...v2.16.0)

#### Changelog

-   [`ad6f149`](alecthomas/chroma@ad6f149) chore: clean up Makefile
-   [`9909f65`](alecthomas/chroma@9909f65) fix: switch to jsdelivr as unpkg was throwing CORS errors
-   [`34bf362`](alecthomas/chroma@34bf362) chore(deps): update all non-major dependencies ([#&#8203;1066](alecthomas/chroma#1066))
-   [`88084b6`](alecthomas/chroma@88084b6) fix: Dot in a string breaks the highlighting in Terraform. Fixes [#&#8203;988](alecthomas/chroma#988) ([#&#8203;1065](alecthomas/chroma#1065))
-   [`62197e9`](alecthomas/chroma@62197e9) Add lexers.Aliases() method to display only lexers' aliases ([#&#8203;1057](alecthomas/chroma#1057))
-   [`7feb358`](alecthomas/chroma@7feb358) chore(deps): update dependency svu to v3 ([#&#8203;1053](alecthomas/chroma#1053))
-   [`30e0bc6`](alecthomas/chroma@30e0bc6) chore(deps): update all non-major dependencies ([#&#8203;1061](alecthomas/chroma#1061))
-   [`e0c7747`](alecthomas/chroma@e0c7747)  Fix IP address as name detection in nginx conf ([#&#8203;1060](alecthomas/chroma#1060))
-   [`0bf0e9f`](alecthomas/chroma@0bf0e9f) Add luau file extension and alias to lua lexer ([#&#8203;1056](alecthomas/chroma#1056))
-   [`0e0e282`](alecthomas/chroma@0e0e282) chore(deps): update all non-major dependencies ([#&#8203;1049](alecthomas/chroma#1049))
-   [`4b0882a`](alecthomas/chroma@4b0882a) add Janet lexer ([#&#8203;1045](alecthomas/chroma#1045))
-   [`81fecd5`](alecthomas/chroma@81fecd5) chore(deps): update all non-major dependencies ([#&#8203;1041](alecthomas/chroma#1041))
-   [`dc982d2`](alecthomas/chroma@dc982d2) Add Mojo lexer ([#&#8203;1044](alecthomas/chroma#1044))
-   [`79621af`](alecthomas/chroma@79621af) Fix solidity lexer's handling of inline assembly ([#&#8203;1040](alecthomas/chroma#1040))
-   [`9da461e`](alecthomas/chroma@9da461e) chore(deps): update module github.com/mattn/go-colorable to v0.1.14 ([#&#8203;1039](alecthomas/chroma#1039))
-   [`f0d460e`](alecthomas/chroma@f0d460e) Update Odin lexer for new build tag feature ([#&#8203;1038](alecthomas/chroma#1038))
-   [`0bd7c68`](alecthomas/chroma@0bd7c68) chore: bump go.mod to Go 1.22 + add Iterator.Stdlib()
-   [`d829579`](alecthomas/chroma@d829579) fix(ocaml): support multistring ([#&#8203;1035](alecthomas/chroma#1035))
-   [`e79c813`](alecthomas/chroma@e79c813) chore(deps): update all non-major dependencies ([#&#8203;1029](alecthomas/chroma#1029))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7459
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0