taplo
taplo copied to clipboard
Watch `evenBetterToml.schema.associations` and auto-reload on change
actual
"json.schemas": [
{
"fileMatch": [
"**/.cargo/config.json"
],
"url": "http://127.0.0.1:8000/schema/cargo-config.schema.json?from=json&ts=v1"
}
],
"yaml.schemas": {
"http://127.0.0.1:8000/schema/cargo-config.schema.json?from=yaml&ts=v1": [
"**/.cargo/config.yaml"
]
},
"evenBetterToml.schema.associations": {
"^.*/\\.cargo/config\\.toml$": "http://127.0.0.1:8000/schema/cargo-config.schema.json?from=toml&ts=v1"
},
Change
ts=v1
To
ts=v2
See http.server log
127.0.0.1 - - [xxx] "GET /schema/cargo-config.schema.json?ts=v2&from=json HTTP/1.1" 200 -
127.0.0.1 - - [xxx] "GET /schema/cargo-config.schema.json?ts=v2&from=yaml HTTP/1.1" 200 -
vscode builtin json and redhat.vscode-yaml auto reload schema, but tamasfe.even-better-toml does not auto reload schema.
Thus, need to Ctrl+p Reload Window
expected
tamasfe.even-better-toml auto reload schema, like json and redhat.vscode-yaml.
This is a duplicate of #375 that has been closed after updating the documentation in #452. I'll keep this open in case someone wants to write a PR. But note that there are others LSP that behave similarly, like rust-analyzer for Rust (needs a reload to change the config because they are provided as initializationParams).
I don't mean to watch all config.
Just watch jsonschema related config, such as evenBetterToml.schema.associations, should be fine.
Like vscode watch json.schemas, and redhat.vscode-yaml watch yaml.schemas.
I see, I misunderstood. But then this looks even more niche, because those configs should very rarely change. This looks only useful for schema development. Still keeping open in case someone wants to implement it.
This looks only useful for schema development
Yes, partial schema as workaround for https://github.com/rust-lang/cargo/issues/12883