Skip to content

Embedding LUA breaks the syntax highlighting #24

@zambotn

Description

@zambotn

When I am embedding LUA code in nginx.conf highlights breaks.

pid /tmp/nginx.pid;

daemon off;

worker_processes 48;

worker_rlimit_nofile 20821;

worker_shutdown_timeout 240s ;

events {
	multi_accept        on;
	worker_connections  16384;
	use                 epoll;
}

http {
	lua_package_path "/etc/nginx/lua/?.lua;;";
	
	lua_shared_dict balancer_ewma 10M;
	lua_shared_dict balancer_ewma_last_touched_at 10M;
	lua_shared_dict balancer_ewma_locks 1M;
	lua_shared_dict certificate_data 20M;
	lua_shared_dict certificate_servers 5M;
	lua_shared_dict configuration_data 20M;
	lua_shared_dict ocsp_response_cache 5M;
	
	server {
		listen 127.0.0.1:10247;
		
		access_log off;
		
        content_by_lua_block {
            ngx.say('Hey!')
	}
    }
	
	# TCP services
	
	# UDP services
	
}

using VimR Version 0.43.0 (20221115.195322), which itself is using NeoVim 0.8.1
is rendered as follow:

immagine

there are different problems and I don't know if they are related or not:

  • closed parenthesis is always grouped as luaParenError.

  • It looks like the ngxLua region starts but doesn't end with the matching } (i.e. the lines starting with # in the NGINX part, later on, are not marked as comments).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions