vscode-nginx-formatter icon indicating copy to clipboard operation
vscode-nginx-formatter copied to clipboard

waterfall like formatting of curly brackets

Open tobiasschuerg opened this issue 3 years ago • 0 comments

this is what I get running this formatter:

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


    if ($host = xxx.foo.bar) {
      return 301 https://$host$request_uri;
      } # managed by Certbot


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


        server_name foo.bar www.foo.bar xxx.foo.bar;
        listen 80;
        return 404; # managed by Certbot
      }

this is what I would expect instead:

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


  if ($host = xxx.foo.bar) {
    return 301 https://$host$request_uri;
  } # managed by Certbot


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


  server_name foo.bar www.foo.bar xxx.foo.bar;
  listen 80;
  return 404; # managed by Certbot
}

Is this intendet?

tobiasschuerg avatar Jan 23 '22 21:01 tobiasschuerg