chore: remove older deprecation notices

This commit is contained in:
shadmansaleh 2022-01-12 22:34:28 +06:00
parent bc5c2f5658
commit 750a94baef
2 changed files with 6 additions and 39 deletions

View File

@ -89,3 +89,9 @@ function my_comp:init(options)
end
```
### Type option(luae & vimf) rename
These were hard to understand before. Now the name should convey more info.
- luae -> lua_expr
- vimf -> vim_fun

View File

@ -90,44 +90,6 @@ component type '%s' isn't recognised. Check if spelling is correct.]],
end
end
local function option_deprecatation_notice(component)
local types = {
type_name = function()
local changed_to = component.type == 'luae' and 'lua_expr' or 'vim_fun'
modules.notice.add_notice(string.format(
[[
### option.type.%s
type name `%s` has been deprecated.
Please use `%s`.
You have some thing like this in your config config for %s component:
```lua
type = %s,
```
You'll have to change it to this to retain old behavior:
```lua
type = %s
```
]],
component.type,
component.type,
changed_to,
tostring(component[1]),
component.type,
changed_to
))
component.type = changed_to
end,
}
if component.type == 'luae' or component.type == 'vimf' then
types.type_name()
end
end
--- Shows notice about invalid types passed as component
--- @param index number the index of component jn section table
--- @param component table containing component elements
@ -182,7 +144,6 @@ local function load_sections(sections, options)
component.self.section = section_name
-- apply default args
component = vim.tbl_extend('keep', component, options)
option_deprecatation_notice(component)
section[index] = component_loader(component)
end
end