tauri-vscode icon indicating copy to clipboard operation
tauri-vscode copied to clipboard

Support for validation in Tauri.toml

Open KevinT3Hu opened this issue 1 year ago • 3 comments

This extension now supports validation for tauri.conf.json, but not for Tauri.toml.

It would be nice to be able to switch to toml since that's common practice in the Rust community so I think this is quite needed.

KevinT3Hu avatar Feb 18 '24 08:02 KevinT3Hu

Toml validation in vscode is only available if using Even Better Toml extenstion which supports reading schemas from other extensions, see https://taplo.tamasfe.dev/configuration/developing-schemas.html#visual-studio-code-extensions. However, it only works with external URLs and doesn't support reading from internal vscode urls (which we use).

amrbashir avatar Apr 24 '24 16:04 amrbashir

I think the next step would be to look into uploading tauri config schema to https://www.schemastore.org/json/ and let Even Better Toml auto detect our config and pull the schema from the store.

amrbashir avatar Apr 24 '24 16:04 amrbashir

btw you can explicitly set the schema in your Tauri.toml like this:

"$schema" = "https://github.com/tauri-apps/tauri/releases/download/tauri-build-v1.5.0/schema.json"

[build]
before-build-command = ""

# ..etc

Notice that you need to match the version in the URL to the version of tauri-build in your Cargo.toml

amrbashir avatar Apr 24 '24 17:04 amrbashir