-
Notifications
You must be signed in to change notification settings - Fork 234
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
refactor(type): add type annotation for defaults.lua #1333
base: main
Are you sure you want to change the base?
Conversation
…m into add-type-annotations
I think the type annotations are a great idea. One thing I would consider though is putting the config types in a separate file from the defaults.lua just because there is so much to it and we are using the defaults.lua file as an example and part of the documentation. With the workflow, I normally prefer code formatting to be applied as a pre-commit hook, but I guess that's hard to enforce as an open source project with so many one time contributors. I'd say go ahead with that too. As far the rest in your Roadmap, there are a lot of good ideas there but I think each one desrves it's own extended discussion. How about starting separate discussions for each one in /~https://github.com/nvim-neo-tree/neo-tree.nvim/discussions/categories/internal-development? |
Thanks for your feedback @cseickel !
Roger, moved type definitions to Along with that, I think examples for I don't know how to manage the wiki pages so could you create a page for me? I'll gather people's code posted on issues / discussions later. This code could also be moved to the wiki, or shall we just add it to the default config values? |
Sure.
I'm not entirely clear on that one. I think it's for the document symbols source and I have never had to use those settings. I don't know if it belongs there, the docs, or the wiki. |
Most of the events were either already there or pointless example code. I did add the hide cursor example events though: /~https://github.com/nvim-neo-tree/neo-tree.nvim/wiki/Recipes#events |
Thanks <3
I think we can simply delete it. |
I think we should ask @nhat-vo about where the best location for this example is, he's the one that created the document symbols source. I'd say it is probably better either as an addition to the docs or the wiki. |
Great ideas, this will make configurations and development a more comfortable way. |
Hi ;)
I think I can start working on the big rewrite.
I am going to bring a huge diff to the codebase, so I'd like to ask your opinion first.
Add Type Annotations
.github/workflows/{.luarc.json,lua_ls-typecheck.yml}
lua/neo-tree/defaults.lua
: /~https://github.com/pysan3/neo-tree.nvim/blob/add-type-annotations/lua/neo-tree/defaults.luaI've refactored
defaults.lua
to have type annotations for every field in the table.With a recent change to GitHub's desktop UI, you should be able to jump to references to see the description.
lua_ls-typecheck.yml
is configured to only check types ondefaults.lua
for now, and I will gradually make the list longer as I add the correct annotations.Apply
stylua
.github/workflows/stylua.yml
This is a github action to format the code automatically.
Changes other than
defaults.lua
are all made by this action (' -> "
etc), and I'd like to add this action as well.Roadmap
@cseickel I've written my roadmap about what I'm planning to do (no due date tho). May I hear your opinion about the list?
This PR is not meant to be merged, but just a POC.
I'd like to fill in
NeotreeTypes.node
andNeotreeTypes.state
before this gets merged.Thanks in advance.