-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to types and testing #12
Conversation
I would really like to hear what you think about these ideas, especially if you'd like to take the project in another direction in some way. I wasn't able to find a similar/simple example in the nvim plugin developer community, so I hacked something together myself 😄 I think in general, a simple "how to get started" experience would be good, but I am not sure the specifics are good fits, etc. |
922b771
to
3780a17
Compare
Hmm looks like I forgot to make the test environment initialization quit neovim - now it probably can't proceed automatically. I can fix this later. |
Hey sorry I've been a bit busy lately, I haven't forgotten about these and I'll take a look this weekend. |
This project is meant to be a really small, simple plugin - I think this overcomplicates setup. Plenary is the only testing dependency. We don't need nvim-treesitter or tree-sitter-lua as dependencies since neovim ships with treesitter and a lua parser. This plugin doesn't ever do anything language specific (we won't do queries) so the built-in stuff is all we'll ever need for testing. I don't think a contributing guide is necessary in this project since there shouldn't be any dev setup. I do think the types will be useful here, but the rest are overkill for this project. For plugin examples, I usually take a look at the bigger neovim plugins (like lazy or telescope) and check their github workflows. I think the ideas in this PR would be good to explore in a separate experimental repo for neovim dev things, though for consistency I'd lean more towards a dev container than lazy + lockfile (so you can pin the neovim version as well). It's not generally necessary though since neovim plugins don't have deep dependency trees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets just stick to adding types here
lua/tshjkl/init.lua
Outdated
local function toggle(outermost) | ||
return function() | ||
print('HELLO WORLD') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to strip this out as well!
3780a17
to
3ad61e2
Compare
I made some changes and only left the type additions in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Here are some updates that don't add new features, but should make maintaining the project and contributing to it that much easier:
refactor(types): add explicit types
No runtime change, but maybe slightly easier to understand and maintain the code.
chore: all development dependencies are locked and reliably installable
This is a change that builds on the base of the build system I worked on a few days ago. It adds the following improvements:
feat(development): controlled playground nvim instance
This is a side effect of the previous one. The testing setup can also be used to launch a minimal nvim that can be used to try the plugin out.
Here is a mini demo. In the demo, I first install dependencies (according to the lock file) and then run tests.
Untitled.mov
docs: contribution instructions
These are pretty basic but should cover the essentials.