taplo icon indicating copy to clipboard operation
taplo copied to clipboard

This Cargo.toml code is crashing the Even Better Toml extension.

Open hq-zyrosk opened this issue 9 months ago • 12 comments

[profile.release]
strip = true            # Strip symbols from binary (doesn't affect runtime speed)
panic = "abort"         # Terminate on panic (faster than unwinding)
overflow-checks = false # Disable integer overflow checks for speed
opt-level = 3           # Maximum optimization for speed
lto = true              # Link-time optimization (beneficial for speed)
incremental = false     # Disable incremental compilation for better optimization
debug = false           # No debug info for maximum performance
codegen-units = 1     # Fewer codegen units allow more aggressive inter-procedural optimizations

[profile.dev]
opt-level = 0 # No optimization for faster compilation
debug = true  # Full debug info

[workspace]
resolver = "3"
members = ["cl", "en", "hq", "xx", "zz"]

Crashes at line which begins with codegen-units.

hq-zyrosk avatar Mar 01 '25 19:03 hq-zyrosk

+1

Have never had this issue for the past 2 years.

Even reverting to old versions of the extension doesn't fix this. According to Cargo Book: Profiles the format below is correct, yet it yields the following error:

[profile.release]
lto = true
strip = true
opt-level = 3
panic = "abort"
codegen-units = 1
Additional properties are not allowed ('lto', 'strip', 'opt-level', 'panic', 'codegen-units' were unexpected)Even Better TOML

arpadav avatar Mar 10 '25 16:03 arpadav

I am getting this error as well

Image

genusistimelord avatar Mar 10 '25 17:03 genusistimelord

@arpadav @genusistimelord this is not the same issue, issue mentioned by OP is crashing due to comment.

Your issue is most likely due to recent changes that were made to Cargo schema.

panekj avatar Mar 10 '25 17:03 panekj

@panekj According to https://doc.rust-lang.org/cargo/reference/profiles.html this schema has not changed. I am still using Rust 2021 edition with 0 changes to my project. Even for Rust 2024 edition this seems to be the same. Or am I missing something? If so I would like to update to the most recent schema, I just can't find anything on this

arpadav avatar Mar 10 '25 18:03 arpadav

@panekj Or I think I understand what you mean. Cargo.toml schema has not changed, but there are changes within SchemaStore/schemastore repo. If so, then yea that must be reverted / fixed.

arpadav avatar Mar 10 '25 18:03 arpadav

@arpadav @genusistimelord this is not the same issue, issue mentioned by OP is crashing due to comment.

Your issue is most likely due to recent changes that were made to Cargo schema.

oh sorry, I did not fully look at the first one and saw the second post made. thank you for the fix.

genusistimelord avatar Mar 10 '25 18:03 genusistimelord

So Is there any work around for the unexpected errors for profile.release?

starwing avatar Mar 10 '25 19:03 starwing

At the top of the file add

#:schema https://raw.githubusercontent.com/SchemaStore/schemastore/d8d4ddd2dfa7aee57c15dad08fb95ab038007a20/src/schemas/json/cargo.json

panekj avatar Mar 10 '25 19:03 panekj

For me, 39460faa601f33e114271ad513ad5162c2e57bbf works too, the commit right before https://github.com/SchemaStore/schemastore/commit/e0ac0b8b8490958f08c8f66ae2833d29cc184f56

arpadav avatar Mar 10 '25 19:03 arpadav

@panekj thanks for the excellent work.

Can you add semantic highlights for "support.type.property-name.toml" and "support.type.property-name.table.toml" (like there is one for tomlArrayKey)?

Were you able to solve the comment glitch originally posted?

Your work is helping us tremendously dealing with toml files, especially the ability to be able to sort the keys, I wish we could also sort the "support.type.property-name.table.toml" (keys inside [], example [workspace], [workspace.dev] etc.).

hq-zyrosk avatar Mar 10 '25 19:03 hq-zyrosk

Reverted changes that caused 🙏

https://github.com/tamasfe/taplo/issues/755#issuecomment-2711334336

ya7010 avatar Mar 11 '25 11:03 ya7010

Were you able to solve the comment glitch originally posted?

Please follow https://github.com/tamasfe/taplo/issues/741 for updates (as current issue has been slightly hijacked)

panekj avatar Mar 11 '25 13:03 panekj