ahmadalli / vscode-nginx-conf

:pencil: VS Code extension: Nginx config file hint(auto-completion)
GNU General Public License v3.0
24 stars 3 forks source link

Formatter doesn't work with certain certbot comments #2

Open acrogenesis opened 3 years ago

acrogenesis commented 3 years ago

The nginx conf contains the following:

server {
  if ($host = mydomain.com) {
    return 301 https://$host$request_uri;
  } # managed by Certbot

  listen 80 ;
  listen [::]:80 ;
  server_name mydomain.com;
  return 404; # managed by Certbot
}

the formatter doesn't identify the closing } on the if. It formats it like the following:

server {
  if ($host = mydomain.com) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 ;
    listen [::]:80 ;
    server_name mydomain.com;
    return 404; # managed by Certbot
  }
r-work commented 1 year ago

Same issue here, that messes up the whole http section

ahmadalli commented 8 months ago

This is caused by this: https://github.com/raynigon/vscode-nginx-formatter/issues/207.