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

feat: Add support for setting/adding entire tables/arrays #40

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

simifalaye
Copy link
Contributor

#38 Added support for reading and editing toml array values but there was no way to add an array into the toml document since it would always be interpreted as a table. This PR aims to add support for setting/adding entire tables (including nested tables) and arrays by looking at the keys of the lua table in the __newindex meta-method to determine which one it is. Note that just like the last PR, only arrays of basic value types are supported (no arrays of tables).

@simifalaye
Copy link
Contributor Author

@vhyrro @mrcjkb

@mrcjkb mrcjkb merged commit caee16f into nvim-neorocks:main Oct 31, 2024
2 checks passed
@vhyrro vhyrro mentioned this pull request Oct 31, 2024
@mrcjkb
Copy link
Member

mrcjkb commented Nov 7, 2024

@simifalaye I updated toml-edit to version 0.6.0 in nvim-neorocks/rocks.nvim#574.
The tests are failing, for example with

bad argument #2: error converting Lua string to i64 (expected number or string coercible to number)
stack traceback:
        [C]: in function '__newindex'
        spec/operations/pin_commands_spec.lua:104: in function <spec/operations/pin_commands_spec.lua:101>

It appears that one of the changes in this PR was breaking.
Pinning toml-edit to 0.5.0 in rocks.nvim, until this has been fixed.

@mrcjkb
Copy link
Member

mrcjkb commented Nov 7, 2024

Posting this for linking purposes: #42

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

Successfully merging this pull request may close these issues.

2 participants