Vscode Slow Formatting Fix [Solved]

Issue Primary Cause Fastest Solution
“Formatting…” Message Hanging Conflicting Extensions Disable redundant formatters
Slow “Format on Save” Large File/High Latency Increase editor.formatOnSaveTimeout
General Lag During Format High CPU Usage Disable “Follow Symlinks” or heavy plugins

VS Code slow formatting fix optimization guide.

What is VS Code Slow Formatting?

VS Code slow formatting occurs when the editor hangs or shows a “Formatting…” progress bar for several seconds after saving a file. This delay disrupts the coding flow and is often caused by multiple extensions fighting for control.

A “fix” involves optimizing the way Visual Studio Code communicates with Language Server Protocols (LSP) and ensuring that your settings aren’t causing unnecessary computation every time you hit Save.

Whether you are working with Prettier, ESLint, or language-specific tools like Black or Gofmt, performance bottlenecks usually stem from configuration conflicts or hardware resource limitations.

Step-by-Step Solutions

1. Identify and Remove Extension Conflicts

If you have multiple formatters installed for the same language, VS Code may struggle to decide which one to use. This causes a significant delay.

Open your Command Palette (Ctrl+Shift+P) and type “Configure Default Formatter”. Select the specific tool you want to use (e.g., Prettier) to stop the editor from searching for others.

2. Adjust the Formatting Timeout

By default, VS Code has a 750ms timeout for formatting. If your project is large or your machine is slow, the formatter might time out, causing it to retry or hang.

Open settings.json and increase the timeout value:

"editor.formatOnSaveTimeout": 3000

This allows the extension up to 3 seconds to finish its work before the editor gives up, preventing the “stuck” UI state.

3. Check for Heavy Background Processes

Sometimes the slow formatting isn’t the formatter’s fault—it’s the CPU. Check if a specific extension is consuming too many resources.

Run the following command in your terminal to launch VS Code without any extensions to see if the speed improves:

code --disable-extensions

If the formatting is instant, re-enable your extensions one by one to find the culprit. Often, “Bracket Pair Colorizer” or heavy “Git” extensions are the hidden cause of lag.

4. Disable “Follow Symlinks” in Large Projects

If your workspace contains many symbolic links (common in monorepos), VS Code might be spending too much time indexing files before it even starts the formatting process.

Try adding this to your workspace settings:

"search.followSymlinks": false

5. Use Local Language Servers

Ensure that your formatter is installed locally in your project (e.g., npm install --save-dev prettier) rather than relying solely on a global VS Code extension. This ensures the version used is compatible with your code, reducing processing overhead.