dprint / dprint-intellij

A dprint plugin for Intellij.
https://plugins.jetbrains.com/plugin/18192-dprint
MIT License
12 stars 2 forks source link

Run format tasks in background task queue. #1

Closed ryan-rushton closed 2 years ago

ryan-rushton commented 2 years ago

Overview

This provides some safety around running multiple formats at once.

First we use a background task queue to run the formats. This should fix issues when intellij triggers multiple saves.

Second, I have added a safety switch to ensure the editor service isn't sent a new job while it's in the middle of an old one. I am not sure this is actually needed yet but it provides some safety anyway.

Finally I set notifications to not log, we already log when we need it and the notification logging was a little noisy when you had syntax errors in the code that was getting formatted.