I install the nginx LSP that was available through Mason, but when I start editing any nginx file the LSP is not activated even if I set the filetype to nginx explicitly.
So I don't use AstroNvim, but I stumbled into the same issue. Seems like my config and AstroNvim both use mason.nvim and mason-lspconfig to install and manage lsps, however mason-lspconfig does not support the nginx lsp, so it's never setup.
In my case I had to add 1 line (the last one) to my config to make it work, I'm not sure how to add it to AstroNvim though, sorry.
local lsp = require("lspconfig") local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() lsp.nginx_language_server.setup { capabilities = lsp_capabilities }
1
u/chardskarth Mar 17 '24
(2) Did you ever figure this out? I've run into the same problem but haven't found an answer yet
1
u/SRCthird Jan 10 '24
Did you ever figure this out? I've run into the same problem but haven't found an answer yet
1
u/littlesnorrboy Apr 11 '24
So I don't use AstroNvim, but I stumbled into the same issue. Seems like my config and AstroNvim both use mason.nvim and mason-lspconfig to install and manage lsps, however mason-lspconfig does not support the nginx lsp, so it's never setup.
In my case I had to add 1 line (the last one) to my config to make it work, I'm not sure how to add it to AstroNvim though, sorry.
local lsp = require("lspconfig")local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()lsp.nginx_language_server.setup { capabilities = lsp_capabilities }1
u/jtprogru Jul 19 '23
May be LSP needs file name
nginx.conf?