This Cargo.toml code is crashing the Even Better Toml extension.
[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.
+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
I am getting this error as well
@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 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
@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 @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.
So Is there any work around for the unexpected errors for profile.release?
At the top of the file add
#:schema https://raw.githubusercontent.com/SchemaStore/schemastore/d8d4ddd2dfa7aee57c15dad08fb95ab038007a20/src/schemas/json/cargo.json
For me, 39460faa601f33e114271ad513ad5162c2e57bbf works too, the commit right before https://github.com/SchemaStore/schemastore/commit/e0ac0b8b8490958f08c8f66ae2833d29cc184f56
@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.).
Reverted changes that caused 🙏
https://github.com/tamasfe/taplo/issues/755#issuecomment-2711334336
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)