Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since I've last touched the lexer in #363 #365 we've had plenty of minor syntax adjustments to the Caddyfile. Took me a long time to get in the headspace to want to tackle updating the lexer, it's quite complicated!
We use this lexer for the official Caddy docs https://caddyserver.com/docs/caddyfile/concepts where Caddy itself serves its own syntax via Markdown. It's awesome that Caddy can highlight its own code 😁
I went through every page in the docs we have to find all the edgecases that were broken in one way or another. I used a
go.mod
replace
in Caddy to point to my checkout of Chroma which I was editing, and used https://github.com/cespare/reflex to watch for my file changes and rebuild+restart Caddy so I could just refresh my browser to see effect of my changes to the lexer. I used this crazy command to do this (had to cross through 3 different git repos withcd
😂)Added lots more contrived config examples to the
caddyfile.actual
test to cover most of the changes I've made.I'm not satisfied with the heredoc (see #929) because I'd like to be able to parse the placeholders (
LiteralStringEscape
) inside the heredoc text, but I'd probably need to write a custom Mutator to do that and that felt daunting. But good enough for now I think.