taplo icon indicating copy to clipboard operation
taplo copied to clipboard

VSCode Extension doesn't use extension settings

Open rfuzzo opened this issue 1 year ago • 2 comments

Hej,

it seems the VSCode extension does not use the extension formatter settings at all.

  • I checked compact entries, but nothing is formatted
  • in the workspace, all toml files display "this document has been excluded"
  • adding a .taplo.toml with includes does nothing

Is there anything I am missing?

rfuzzo avatar Sep 13 '24 06:09 rfuzzo

The VS Code extension should recognize .taplo.toml (we use it in all our repositories), but you have to reload the window (restart) if you modify any of the settings there.

The VS Code extension does not respect all the latest configuration options though, because it is outdated. See https://github.com/tamasfe/taplo/issues/624#issuecomment-2228145196.

redeboer avatar Oct 04 '24 08:10 redeboer

Here's what worked for me to get the VS Code extension to recognize my custom rules:

  1. Put a file called .taplo.toml in the root of your project with the configuration settings
  2. Close VSCode and re-open it

Here are things that did NOT work. I tried saving and restarting VSCode after each one:

  • Naming the config file taplo.toml
  • Putting the following settings in either my User settings.json or .vscode/settings.json
{
    // ... other VSCode settings ...
    "evenBetterToml.rules": [
        {
            "path": "rust-toolchain.toml",
            "rules": {
                "schema": {
                    "enabled": false
                }
            }
        }
    ]
}

Note, I was trying to resolve the same issue as described here.

morphatic avatar Jan 05 '25 00:01 morphatic