kkiyama117 / coc-toml

Toml extension for coc-nvim, using taplo for lsp engine
https://www.npmjs.com/package/coc-toml
MIT License
59 stars 1 forks source link

formatter like alignEntries doesn't work anymore after v1.1.0 #32

Open GopherJ opened 2 years ago

kkiyama117 commented 2 years ago

@GopherJ I believe issues like this and #21 have been resolved in coc-toml v1.2.5. If the problem still occurs after updating to the latest version, please let me know how to reproduce the problem.

GopherJ commented 2 years ago

@kkiyama117 I think it's broken, testing using our code https://github.com/parallel-finance/parallel/runtime/heiko/Cargo.toml, it cannot align the entries

kkiyama117 commented 2 years ago

@GopherJ Thanks, I will check it out. If possible, please let me know your coc-toml configuration (CocConfig description).

kkiyama117 commented 2 years ago

@GopherJ Do you have a issue with the indentation being aligned for each table, but not as a whole? I think it's not a coc-toml problem but taplo spec. We can see the same behavior when using evenBetterToml with vscode or github codespace. I think that taplo itself needs to provide it for us to get back to the previous behavior.

GopherJ commented 2 years ago

@kkiyama117

  "toml.formatter.reorderKeys": true,
  "toml.formatter.alignEntries": true,
GopherJ commented 2 years ago

@GopherJ Do you have a issue with the indentation being aligned for each table, but not as a whole? I think it's not a coc-toml problem but taplo spec. We can see the same behavior when using evenBetterToml with vscode or github codespace. I think that taplo itself needs to provide it for us to get back to the previous behavior.

the current align entries looks strange, it used to align = for me, but now no

GopherJ commented 2 years ago

coc-toml used to align like this according to = but now this feature doesn't work anymore maybe broken

cumulus-pallet-aura-ext         = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-dmp-queue        = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-parachain-system = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcm              = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcmp-queue       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-core         = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-timestamp    = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-utility      = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
pallet-collator-selection       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
parachain-info                  = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
kkiyama117 commented 2 years ago

In my environment Format works(like this) with your coc-toml config. Is this different from yours? If you think this behavior strange, it is a taplo problem and we must make changes there. t-rec

kkiyama117 commented 2 years ago

@GopherJ Sorry, this gif didn't show the whole screen.

[test]
tests = "test"
[OK]
aaaa     = "OKKKK"
cumulus-pallet-aura-ext = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-dmp-queue        = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-parachain-system = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcm   = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcmp-queue  = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-core = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-timestamp    = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-utility  = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
pallet-collator-selection       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
parachain-info       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
tests        = "test"

becomes

[test]
tests = "test"
[OK]
aaaa                            = "OKKKK"
cumulus-pallet-aura-ext         = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-dmp-queue        = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-parachain-system = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcm              = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-pallet-xcmp-queue       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-core         = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-timestamp    = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
cumulus-primitives-utility      = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
pallet-collator-selection       = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
parachain-info                  = { git = 'https://github.com/paritytech/cumulus.git', branch = 'polkadot-v0.9.16', default-features = false }
tests                           = "test"
kkiyama117 commented 2 years ago

Since the specs of Taplo have changed, I think we need to add an "old mode" and a "new mode" or something in Taplo to make it behave the same as the old one.