-
-
Notifications
You must be signed in to change notification settings - Fork 639
docs(#2934): add nvim_tree.config* classes and generated help #3235
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
base: master
Are you sure you want to change the base?
Conversation
…tors to main help
…at and order nvim_tree.Config
…ries populate others placeholder
…ree source to prevent luals upset
…ree source to prevent luals upset
gegoune
left a comment
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.
Great job! LGTM with single worry: anchors are no longer mapped 1:1 to corresponding options, won't that be an issue?
doc/nvim-tree-lua.txt
Outdated
| ============================================================================== | ||
| Class: Config.HijackDirectories *nvim-tree-config-hijack-directories* | ||
|
|
||
| *nvim_tree.Config.HijackDirectories* |
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.
Currently we have nvim-tree.hijack_directories.enable which maps 1:1 to actual option, won't it be bit confusing being HijackDirectories now?
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.
Ah yes, I didn't think of that. We had it for every config option in the hierarchy and should continue to have that.
I'll see what I can do with gen_vimdoc_config.lua. tags and sections are quite configurable. Possibilities:
- Try to change the class names, lowercase etc. to match. Nvim kind of does that.
- Add extra tags to each class.
- Change the section tags e.g.
*nvim-tree-config-hijack-directories*->*nvim-tree.hijack_directories*
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.
1 worked out reasonably well, class and alias names all match the options:
- we can
:help actions.expand_allor:help nvim_tree.config.actions.expand_all - we can't
:help use_system_clipboard, we have to:helpgrep use_system_clipboardas the generator can't do it - we can't use
nvim-treein class or function names as lua can't do dashes, hence it'snvim_tree.config.hijack_directories
I left a note at the top: https://github.com/nvim-tree/nvim-tree.lua/pull/3235/changes#diff-b5b2d1abcb86ead5a2319f7e065a7545b834a407cc9f420590d7acebb285fca9R1-R10
Edit: I moved the default config to the end, so that helpgrep finds the config class doc first.
Good to go?
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.
Go for it, nicely done!
fixes #2934
I'd be most grateful for your review @gegoune ... and apologies for the massive PR. There are no code changes, just annotations/docs.
I can't ask anyone to review the whole thing, but I'd be most grateful for a review of the overall structure, format conventions, dev/CI scripts. Also comments on the contentious bits please.
An AI tool was used, however it added very little value, only able to create the skeleton. It made a mess of all documentation, which I ended up doing with scripts.
In scope:
_metaclasses for all config*nvim_tree.config*is deleted and rewritten*nvim-tree-icons-highlighting*to link everything together*nvim-tree-hidden-display*to be addressed via Documentation: Renderer.HiddenDisplay luals Annotations And Help #3243Out of scope:
CI and build:
scripts/gen_vimdoc.shuses Nvim source (not compiled) to generate all class docs from_metagen_vimdoc_config.luawhich is hackily injected into Nvim'ssrc/gen/gen_vimdoc.luascripts/lintdoc.shuses Nvim compiled source to lint. The value for us is validating tags.Notable annoyances:
*nvim_tree.Config.View.WidthSpec**nvim_tree.Config.Bookmarks*added to*nvim_tree.Config*{bookmarks}--ignore-blank-linesin thehelp-checktarget.TODO
renamemoved root Config field descriptions into class description for readabilityhijack_unnamed_buffer_when_openingas it messes up the formatting of other fieldsuse (exact) classes for better UX when creating configdoesn't add value as it doesn't prevent invalid fields when defining yournvim_tree.Configdecide on lower case classnames, as nvim does for anything that's a parameterthere's no real convention for other plugins, capitalised classnames match nvim-tree and general lua OO@typeor@parameverything that usesnvim_tree.Configadd an on-attach typedid not end up necessary