Open wbthomason opened 1 year ago
Tagging @akinsho, @EdenEast, anyone else interested in contributing to the rewrite.
@wbthomason thanks for opening it, looks good 👍🏿. I was thinking I'd raise some PRs against this to help move it on, but will probably start with smaller things like adding Emmy Lua annotations to as many places as possible. I personally heavily rely on those when writing Lua, so would be nice if the types in the code base were clearer.
I've also been using the lazy loading pattern popularized by TJ in https://github.com/tjdevries/lazy.nvim and thought I might add it here? It defers the requiring of modules till they are actually indexed, so you can require all modules at the top of a file, but they won't actually be required till they are used. You can then combine this with sumneko
's @module
syntax to keep the type information, e.g.
local lazy = require('packer.lazy')
--- @module 'packer.config'
local config = lazy.require('packer.config')
Primarily because you've talked about reducing the cost of requiring packer, so this should help.
Oh, brilliant! That looks quite useful. Separately, more annotations is also a great way to start - that's a stated goal of the rewrite and will make working with the codebase substantially nicer. Thanks!
This is a WIP PR to complete the first stage of this roadmap, at least through the
load
function.Current progress:
The next steps are:
packer
module and your plugin specs.Contributions to this PR are welcome!