meanmail-dev / nginx-intellij-plugin

Intellij Plugin for Nginx configuration file
https://meanmail.dev/plugin/7
MIT License
56 stars 6 forks source link

Code highlighting breaks when using return with text content #7

Open LsHallo opened 2 years ago

LsHallo commented 2 years ago

Describe the bug Code highlighting breaks when using return with text content.

To Reproduce Paste this config:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    location / {
        add_header Content-Type "text/plain";
        return 200 "LB";
    }

    location ~ ^(.*)\.rss {
        resolver 127.0.0.11 ipv6=off;
        rewrite ^ $request_uri break;
        return 400;
        proxy_pass http://nginx_target$uri;
    }
}

Code highlighting breaks after the return 200 "LB" block: image

Expected behavior Code highlighting will continue to work further down in the config file.

IDE (please complete the following information. See Main Menu -> Help -> About):

Plugin (please complete the following information. See Main Menu -> File -> Settings -> Plugins):

Additional Information return code [text] is supported: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return

d-pollard commented 2 years ago

it isn't the return I believe it's the quotes that cause this; not sure why

michaelboyles commented 3 weeks ago

Same problem with proxy_set_header Connection "upgrade";

Don't know if the quotes are strictly necessary, but that's the exact form used by the docs http://nginx.org/en/docs/http/websocket.html