mirror of
https://github.com/neovim/neovim.git
synced 2026-11-02 09:49:02 -06:00
feat(lsp): warn about unknown filetype #36910
(cherry picked from commit 054eaf8493)
This commit is contained in:
1 parent
91fd4d127e
commit
808d973fb0
1 file changed
+12
@@ -183,6 +183,8 @@ end
|
|||||||
local function check_enabled_configs()
|
local function check_enabled_configs()
|
||||||
vim.health.start('vim.lsp: Enabled Configurations')
|
vim.health.start('vim.lsp: Enabled Configurations')
|
||||||
|
|
||||||
|
local valid_filetypes = vim.fn.getcompletion('', 'filetype')
|
||||||
|
|
||||||
for name in vim.spairs(vim.lsp._enabled_configs) do
|
for name in vim.spairs(vim.lsp._enabled_configs) do
|
||||||
local config = vim.lsp.config[name]
|
local config = vim.lsp.config[name]
|
||||||
local text = {} --- @type string[]
|
local text = {} --- @type string[]
|
||||||
@@ -210,6 +212,16 @@ local function check_enabled_configs()
|
|||||||
report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
|
report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if k == 'filetypes' and type(v) == 'table' then
|
||||||
|
for _, filetype in
|
||||||
|
ipairs(v --[[@as string[] ]])
|
||||||
|
do
|
||||||
|
if not vim.list_contains(valid_filetypes, filetype) then
|
||||||
|
report_warn(("Unknown filetype '%s'."):format(filetype))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if v_str then
|
if v_str then
|
||||||
text[#text + 1] = ('- %s: %s'):format(k, v_str)
|
text[#text + 1] = ('- %s: %s'):format(k, v_str)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user