tamasfe / taplo

A TOML toolkit written in Rust
https://taplo.tamasfe.dev
MIT License
1.36k stars 115 forks source link

request: red squiggily lines indicating bad paths #134

Open gilescope opened 3 years ago

gilescope commented 3 years ago

Would be grea if anything element named path could be checked to make sure that the value did seem to exist:

sp-api = { version = "3.0.0", path = "../../foo/bar" }

(super good for Cargo.toml)

tamasfe commented 3 years ago

Simply guessing paths would be really unreliable/inefficient, this could probably work as a schema extension though.

gilescope commented 3 years ago

I notice that clion/intellirust does this kind of thing for Cargo.toml files but you're right they've got access to a lot of metadata.

On Sat, 10 Jul 2021 at 05:30, Ferenc Tamás @.***> wrote:

Simply guessing paths would be really unreliable/inefficient, this could probably work as a schema extension though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tamasfe/taplo/issues/134#issuecomment-877563295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCARTRCDHU5E6IKI4MDTW7EHVANCNFSM477APQRQ .

tamasfe commented 3 years ago

Taplo by default tries to be environment-agnostic, so it has no idea whether the TOML file belongs to python/cargo/whatever, the only thing it sees is a JSON schema that can be applied to any TOML file.

I'd like not to bloat the vscode extension as well with environment-specific features, but I'm looking for a way to make it extensible.

Fortunately path validation can be applied to most environments, so a JSON schema extension and some extra validation logic would be fine by me.