tauri-apps / tauri-vscode

Visual Studio Code Extension for Tauri apps development
https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode
Apache License 2.0
447 stars 28 forks source link

Support for validation in Tauri.toml #240

Open KevinT3Hu opened 4 months ago

KevinT3Hu commented 4 months ago

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.

amrbashir commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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