filetype configs with named files. has telescope
fixed typing
1 file changed, +3 -6
+3-6lua/ftconfig/init.lua
| @@ -10,7 +10,7 @@ local augroup = vim.api.nvim_create_augroup("ftconfig", { clear = true }) | ||
| 10 | 10 | |
| 11 | 11 | ---@class FTConformSpec |
| 12 | 12 | ---@field use string[] |
| 13 | ----@field formatters? conform.FileFormatterConfig[] | |
| 13 | +---@field formatters? table<string, conform.FileFormatterConfig> | |
| 14 | 14 | |
| 15 | 15 | ---@class FTSpec |
| 16 | 16 | ---@field indent? integer |
| @@ -23,11 +23,8 @@ function M.load_file(filename) | ||
| 23 | 23 | local ft = vim.fn.fnamemodify(filename, ":r") |
| 24 | 24 | table.insert(M.filetypes, ft) |
| 25 | 25 | local mod = "ftconfig." .. ft |
| 26 | - local ok, spec = pcall(require, mod) | |
| 27 | - if not ok then | |
| 28 | - return | |
| 29 | - end | |
| 30 | - ---@cast spec FTSpec? | |
| 26 | + ---@type FTSpec? | |
| 27 | + local spec = require(mod) | |
| 31 | 28 | if not spec then |
| 32 | 29 | return |
| 33 | 30 | end |