What is Caddyfile file type?
Asked Answered
G

1

6

I'm using PhpStorm to develop a project.

I have created a Caddyfile to configure my caddy server.

But PhpStorm doesn't format or highlight the code of the Caddyfile.

I know that I can change the File Type for specific file but I don't know which File Type I should choose for Caddyfile.

What is Caddyfile File type in intellij idea?

Gurkha answered 13/9, 2021 at 21:23 Comment(2)
I don't think that Caddyfile can be associated with a known file type in IntelliJ IDEA, based on their documentation: caddyserver.com/docs/caddyfile/concepts. There's also no feature request to support it, so feel free to be the first at youtrack.jetbrains.com/newIssueLogia
It's currently marked as "won't fix": youtrack.jetbrains.com/issue/OC-22098Swisher
G
5

As mentioned here: https://youtrack.jetbrains.com/issue/OC-22098, Jetbrains do not plans to support Caddyfile syntax natively.

So I created a custom FileType like so:

enter image description here

List of keywords (taken from Caddyfile directicves)

abort
acme_server
basicauth
bind
encode
error
file_server
forward_auth
handle
handle_errors
handle_path
header
import
invoke
log
map
method
metrics
php_fastcgi
push
redir
request_body
request_header
respond
reverse_proxy
rewrite
root
route
skip_log
templates
tls
tracing
try_files
uri
vars

Result look like this:

enter image description here

Might be possible to create a plugin to support the Caddyfile concept and add it to https://plugins.jetbrains.com/

Gurkha answered 1/9, 2023 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.