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

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

Open
GopherJ opened this issue Mar 7, 2022 · 11 comments
Open

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

GopherJ opened this issue Mar 7, 2022 · 11 comments

Comments

@GopherJ
Copy link
Contributor

GopherJ commented Mar 7, 2022

No description provided.

@kkiyama117
Copy link
Owner

kkiyama117 commented Mar 7, 2022

@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
Copy link
Contributor Author

GopherJ commented Mar 11, 2022

@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
Copy link
Owner

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

@kkiyama117
Copy link
Owner

@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
Copy link
Contributor Author

GopherJ commented Mar 14, 2022

@kkiyama117

  "toml.formatter.reorderKeys": true,
  "toml.formatter.alignEntries": true,

@GopherJ
Copy link
Contributor Author

GopherJ commented Mar 14, 2022

@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
Copy link
Contributor Author

GopherJ commented Mar 14, 2022

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
Copy link
Owner

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
Copy link
Owner

@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
Copy link
Owner

kkiyama117 commented Mar 14, 2022

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.

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

No branches or pull requests

3 participants
@kkiyama117 @GopherJ and others