tamasfe / taplo

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

spurious taplo/didChangeSchemaAssociation messages #692

Open notpeter opened 3 weeks ago

notpeter commented 3 weeks ago

I used Taplo via the Zed TOML extension.

Recently I've noticed that when I have multiple open TOML files, opening a new file triggers taplo/didChangeSchemaAssociation events on all the existing files I have open. They look like this:

2024-10-31T08:41:20.755921-04:00 [INFO] Language server with id 8 sent unhandled notification taplo/didChangeSchemaAssociation:
{
  "documentUri": "file:///Users/peter/zcode/zed/docs/book.toml",
  "schemaUri": null,
  "meta": null
}
2024-10-31T08:41:20.756075-04:00 [INFO] Language server with id 8 sent unhandled notification taplo/didChangeSchemaAssociation:
{
  "documentUri": "file:///Users/peter/zcode/zed/crates/assistant/Cargo.toml",
  "schemaUri": "https://json.schemastore.org/cargo.json",
  "meta": {
    "name": "Cargo Manifest",
    "description": "Manifest for Cargo, the Rust package manager and build tool",
    "source": "catalog",
    "catalog_url": "https://www.schemastore.org/api/json/catalog.json"
  }
}

For example:

  1. Open a.toml
  2. Open b.toml (get taplo/didChangeSchemaAssociation for a.toml)
  3. Open c.toml (get taplo/didChangeSchemaAssociation for a.toml, b.toml)
  4. Open d.toml (get taplo/didChangeSchemaAssociation for a.toml, b.toml, c.toml) etc

It seems harmless, but the fact that it scales with the number of open TOML files is especially annoying.

Also, it's wrong? taplo "didn't" change the schema association.

Associated Zed issue: