Skip to content
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

docs(options): take ownership of options.txt #24528

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

lewis6991
Copy link
Member

@lewis6991 lewis6991 commented Aug 1, 2023

- `src/nvim/options.lua` is now the source of truth
- generate runtime/lua/vim/_meta/options.lua

Credit to: https://github.com/ii14/emmylua-nvim/tree/master

@justinmk
Copy link
Member

justinmk commented Aug 1, 2023

Nice! Is the plan here to bootstrap src/nvim/options.lua with the docs, as with eval.lua? Or alternatively, use _meta/options.lua to generate options.txt.

@lucario387
Copy link
Contributor

Is there any plan to do the same to vim.opt and vim.opt_local ? 🤔

I think referencing https://github.com/folke/neodev.nvim/blob/main/lua/neodev/build/options.lua for generating it would also be nice

@lewis6991
Copy link
Member Author

Nice! Is the plan here to bootstrap src/nvim/options.lua with the docs, as with eval.lua?

Assuming we are ok to take ownership of options.txt. Since you're asking I'll take that as a yes.

Is there any plan to do the same to vim.opt and vim.opt_local ? 🤔

Yes.

@lucario387
Copy link
Contributor

lucario387 commented Aug 2, 2023

In the generated file, vim.o.backupdir has the value of
vim.o.backupdir = ".,/Users/lewrus01/.local/state/nvim/backup//"

I think $XDG_* needs to be gsubbed.

@lewis6991 lewis6991 marked this pull request as draft August 2, 2023 11:15
@github-actions github-actions bot removed the request for review from justinmk August 2, 2023 11:15
@lewis6991
Copy link
Member Author

Reworking this PR to take ownership of the options documentation, similar for what we've done for builtin.txt.

@justinmk
Copy link
Member

justinmk commented Aug 2, 2023

Is there any plan to do the same to vim.opt and vim.opt_local ? 🤔

Yes.

Not in favor of that. We shouldn't add more "armor" around vim.opt, we need to deprecate it and enhance vim.o to serve any missing important use-case. #20107

@lewis6991 lewis6991 force-pushed the feat/opttypes branch 3 times, most recently from 021e1a6 to 5f5510d Compare August 2, 2023 17:07
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
@lewis6991 lewis6991 force-pushed the feat/opttypes branch 2 times, most recently from 48806f7 to 5b2981d Compare August 3, 2023 14:22
@lewis6991 lewis6991 changed the title feat(lua-types): types for vim.o/vim.bo/vim.wo/vim.go docs(options): take ownership of options.txt Aug 3, 2023
@lewis6991 lewis6991 marked this pull request as ready for review August 3, 2023 14:26
@lucario387
Copy link
Contributor

vim.o.packpath and vim.o.runtimepath currently still have paths that should be gsubbed.

vim.o.packpath = "/Users/lewis/projects/dotfiles/config/nvim,/etc/xdg/nvim,/Users/lewis/.data/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/local/share/nvim/runtime,/usr/local/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/Users/lewis/.data/nvim/site/after,/etc/xdg/nvim/after,/Users/lewis/projects/dotfiles/config/nvim/after"

Almost similar thing for rtp too

@lewis6991 lewis6991 force-pushed the feat/opttypes branch 4 times, most recently from 7c49308 to b3d6443 Compare August 3, 2023 16:18
@@ -2,3 +2,4 @@
/src
/test
/runtime/lua/vim/re.lua
/runtime/lua/vim/_meta/options.lua
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is failing on stylua however adding this line doesn't seem to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it failing? Is it feasible to fix the warnings?

@clason
Copy link
Member

clason commented Aug 3, 2023

language annotations? 🥺

@zeertzjq zeertzjq added documentation options configuration, settings labels Aug 3, 2023
@lewis6991
Copy link
Member Author

As with the eval.lua, I'd like to avoid that in this PR just to make the diffs reviewable. The larger the diff, the higher the risk of mistakes not getting caught.

@lewis6991
Copy link
Member Author

Unless anyone wants me to hold off, I'll merge this sometime tomorrow.

runtime/doc/options.txt Outdated Show resolved Hide resolved
runtime/doc/options.txt Outdated Show resolved Hide resolved
src/nvim/options.lua Outdated Show resolved Hide resolved
.luacheckrc Outdated Show resolved Hide resolved
@zeertzjq
Copy link
Member

zeertzjq commented Aug 4, 2023

Needs rebase and regeneration of docs

@lewis6991 lewis6991 merged commit 6fa17da into neovim:master Aug 4, 2023
@github-actions github-actions bot removed the request for review from clason August 4, 2023 20:27
clason pushed a commit to clason/neovim that referenced this pull request Aug 8, 2023
* docs(options): take ownership of options.txt

- `src/nvim/options.lua` is now the source of truth
- generate runtime/lua/vim/_meta/options.lua

* fixup! zeer comments

* fixup! zeer comments (2)

* fixup! re-enable luacheck

* fixup! regen
catlee pushed a commit to catlee/neovim that referenced this pull request Aug 8, 2023
* docs(options): take ownership of options.txt

- `src/nvim/options.lua` is now the source of truth
- generate runtime/lua/vim/_meta/options.lua

* fixup! zeer comments

* fixup! zeer comments (2)

* fixup! re-enable luacheck

* fixup! regen
@lewis6991 lewis6991 deleted the feat/opttypes branch September 13, 2023 08:38
@bew
Copy link
Contributor

bew commented Sep 20, 2023

Will https://github.com/ii14/emmylua-nvim still be necessary with this PR / once nvim 0.10.0 gets released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation options configuration, settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants