diff options
| author | Olivia Kinnear <git@superatomic.dev> | 2025-12-11 12:58:40 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-11 13:58:40 -0500 |
| commit | 054eaf8493cbcf35ad386675fcaa0cc38d6b63e7 (patch) | |
| tree | 4989e7c3190a0d035986e140ee0bf1654bbaf84c /runtime/lua/vim | |
| parent | 8619dc251c4837b5a8bdb74cc3f1ed766c0bbab0 (diff) | |
| download | rneovim-054eaf8493cbcf35ad386675fcaa0cc38d6b63e7.tar.gz rneovim-054eaf8493cbcf35ad386675fcaa0cc38d6b63e7.tar.bz2 rneovim-054eaf8493cbcf35ad386675fcaa0cc38d6b63e7.zip | |
feat(lsp): warn about unknown filetype #36910
Diffstat (limited to 'runtime/lua/vim')
| -rw-r--r-- | runtime/lua/vim/lsp/health.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua index 34a6dd59ab..17f2a81139 100644 --- a/runtime/lua/vim/lsp/health.lua +++ b/runtime/lua/vim/lsp/health.lua @@ -215,6 +215,8 @@ end local function check_enabled_configs() vim.health.start('vim.lsp: Enabled Configurations') + local valid_filetypes = vim.fn.getcompletion('', 'filetype') + for name in vim.spairs(vim.lsp._enabled_configs) do local config = vim.lsp.config[name] local text = {} --- @type string[] @@ -242,6 +244,16 @@ local function check_enabled_configs() report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1])) 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 text[#text + 1] = ('- %s: %s'):format(k, v_str) end |