taplo icon indicating copy to clipboard operation
taplo copied to clipboard

request: red squiggily lines indicating bad paths

Open gilescope opened this issue 3 years ago • 3 comments

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)

gilescope avatar Jul 07 '21 16:07 gilescope

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

tamasfe avatar Jul 10 '21 04:07 tamasfe

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 .

gilescope avatar Jul 10 '21 15:07 gilescope

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.

tamasfe avatar Jul 10 '21 15:07 tamasfe