nixvim
nixvim copied to clipboard
Deprecate `helpers.mkRaw` in favour of `lib.generators.mkLuaInline`
Overview
Historically we have used our own mkRaw which produces an attrset that looks like { __raw = expr; }, however nixpkgs has had mkLuaInline for a while now (for use with its toLua generator). The nixpkgs function produces an attrset that looks like { _type = "lua-inline"; inherit expr; }.
We should add support for this in our toLua and begin transitioning usage of mkRaw to mkLuaInline.
Eventually we can deprecate our function in favour of mkLuaInline.
Even further in the future, we can deprecate __raw support in toLua.
See upstream usage in lib.generators.toLua and lib.generators.mkLuaInline definition.
TODO
- [x]
helpers.lua.mkLuashould support nixpkg's "lua-inline" type. #2012 - [ ] Transition internal
__rawto usemkLuaInline - [ ] Documentation should recommend
mkLuaInline - [ ] Add a deprecation warning to
helpers.mkRaw - [ ] (eventually) Add a deprecation warning to
toLuawhen encountering__raw
Note: there's now also a lib.generators.toLua in nixpkgs, however we currently can't use it, because it has no support for mixed list+attrs tables.