crates.nvim icon indicating copy to clipboard operation
crates.nvim copied to clipboard

Multiline arrays and features

Open ten3roberts opened this issue 2 years ago • 5 comments

Current behavior

Features which are in a multi line array are not recognized.

The multiline arrays happen automatically after a certain number of features using lsp-format with taplo, or any other toml formatter or outputter.

Expected behavior

The features on multiline arrays are all parsed and when adding a feature it added to the end of the list rather than at the end of the line without a comma.

Additional context/Screenshots

image image

Neovim version

nvim --version
NVIM v0.10.0-dev-2158+g3d948a4dc-Homebrew
Build type: Release
LuaJIT 2.1.0-beta3
Run "nvim -V1 -v" for more info

ten3roberts avatar Aug 11 '23 12:08 ten3roberts

This is a limitation of the parser, which currently is just a bunch of regexes. As described in #56 I don't think it is feasible to build out the current model in order to support any kind of syntax, but rather a lenient toml parser is the proper solution.

I don't know when I'll have the time to make this change.

saecki avatar Aug 11 '23 15:08 saecki

I see, feared that was the case.

Using a proper parser would definitely be preferred, as it would solve the ultimate source of this issue and a quite a few other existing and future ones. Perhaps there are ready made parsers in lua which we can integrate

ten3roberts avatar Aug 15 '23 10:08 ten3roberts

For anyone interested, I've been working on said parser lately.

saecki avatar Dec 17 '23 15:12 saecki