Skip to content
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

header Content-Type text/* ruins highlighting #231

Closed
tomquas opened this issue Jul 18, 2022 · 6 comments
Closed

header Content-Type text/* ruins highlighting #231

tomquas opened this issue Jul 18, 2022 · 6 comments
Labels
🐛 type/bug Describes or resolves a bug (unintended behavior or problem)

Comments

@tomquas
Copy link

tomquas commented Jul 18, 2022

System Information

  • Operating System: macos
  • Extension Version: 0.2.0
  • VSCode Version: 1.69.0
  • caddy Version: 2.5.2

Describe the bug
i defined the section below to import from host specs:

(encode) {
  encode {
    gzip
    zstd
    match {
      header Content-Type application/json*
      header Content-Type application/protobuf*
      header Content-Type application/javascript*
      header Content-Type text/*
    }
  }
}

the last header statement's text/* ruins highlighting such that all following statements are shown without coloring. By moving that line up and down you can track the effect to this part of the header statement.

Expected Behavior
Keep highlighting going.

@tomquas tomquas added the 🐛 type/bug Describes or resolves a bug (unintended behavior or problem) label Jul 18, 2022
@matthewpi
Copy link
Member

matthewpi commented Jul 18, 2022

I'm not sure I can reproduce this. Here is how that content is highlighted for me Screenshot from 2022-07-18 10-19-21.
Screenshot from 2022-07-18 10-18-11

@tomquas
Copy link
Author

tomquas commented Jul 19, 2022

hmm, can i ask what theme you're using? here's a shot of my view on this...
Screen Shot 2022-07-19 at 08 53 35

@francislavoie
Copy link
Member

Are you sure you're using the Caddyfile syntax highlighting? Check the bottom-right of your IDE, does it say "Caddyfile"?

Looks like the /* is being parsed as a comment, but /* is not a comment in the Caddyfile, so it must be from some other language.

@tomquas
Copy link
Author

tomquas commented Jul 19, 2022

you're totally right. and i feel stupid...

the file was named 'Caddyfile-dev' and VS chose the Groovy highlighter.
copied to file to 'Caddyfile' and all works well.
sorry.

is there a way for the plugin to register 'Caddyfile*' for caddy-style highlighting?

@matthewpi
Copy link
Member

is there a way for the plugin to register 'Caddyfile*' for caddy-style highlighting?

I believe there is a manual file association option you can set, otherwise I could add the association to the extension by default.

@francislavoie
Copy link
Member

FWIW I'd appreciate having Caddyfile* work too, but it should exclude caddyfile.go and caddyfile.md which tend to come up reasonably often in the Caddy codebase and docs.

matthewpi added a commit that referenced this issue Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug Describes or resolves a bug (unintended behavior or problem)
Projects
None yet
Development

No branches or pull requests

3 participants