caddyserver / vscode-caddyfile

Rich Caddyfile support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=matthewpi.caddyfile-support
MIT License
79 stars 3 forks source link

Caddyfile detecting "}" as duplicate global options #254

Closed U5B closed 1 year ago

U5B commented 2 years ago

System Information

Describe the bug Caddyfile detects the "}" as a duplicate.

Steps to Reproduce Steps to reproduce the behavior: Create two global options that use "{" and "}" on different lines.

Expected Behavior No error should appear.

Screenshots image

Additional Context Add any other context about the problem here.

francislavoie commented 2 years ago

Works fine for me. I think the problem is that ne you have in there, which makes the { token immediately before it not match as a valid opening brace token.

image

U5B commented 2 years ago

hmm I added a newline to the top and that removed the error I removed ne (that wasn't supposed to be there anyway)

This is what I have now

# comment to prevent error?
{
    servers {
        log_credentials
        protocol {
            strict_sni_host on
        }
    }
    log {
        output file /home/bot/web/caddy/logs/caddy.log
        format json {
            time_format unix_milli_float
            duration_format seconds
        }
        level INFO
        include http.log.access
    }
}
matthewpi commented 1 year ago

This should be resolved by https://github.com/matthewpi/vscode-caddyfile-support/commit/ee91c9af970d6fea298cfd4bcf877413656f1714