taplo icon indicating copy to clipboard operation
taplo copied to clipboard

vscode find/replace breaks

Open azdavis opened this issue 3 years ago • 1 comments

I confirmed the bug happens when this vscode extension is the only one enabled.

As you can see in the video, if you find-replace in toml files with the extension enabled it often doesn't work entirely or works only partially.

https://www.dropbox.com/s/mcuy3r4p7wyifw4/find-replace-toml-bug.mov

azdavis avatar Jan 01 '23 02:01 azdavis

Looks like a race condition between Search/Replace all and Format on save VS Code features, which triggers when using taplo as the TOML formatter.

When Format on save is enabled, and there are matched in multiple TOML files, replacing works for some files but not all. And sometimes, it does not work at all.

When Format on save is disabled, replacing all occurrences works fine across all files, every time.

As a work-around to avoid having to disable Format on save altogether, one can just disable it for TOML file with:

    "[toml]": {
        "editor.formatOnSave": false,
    }

pdecat avatar Jan 06 '23 10:01 pdecat