Dart-code: `pub get` on save + auto-save is super aggro

Created on 27 Jan 2019  ·  8Comments  ·  Source: Dart-Code/Dart-Code

If you have VS Code's "Auto Save" option enabled, the behavior of "Run pub get / flutter packages get on save" runs way too often, to the point that it's difficult to type. If Auto Save is enabled, maybe ratchet up the debounce to 10sec or so?

in commands in editor is bug

Most helpful comment

@thosakwe that's what the dart.runPubGetOnPubspecChanges setting should do. Pubspec changes are the only thing that should result in automatic pub get. If you've set that setting to false and still see it running automatically, please open an issue with details.

All 8 comments

Oh dear, this does sound terrible :(

Weirdly, we can receive the reason for save (TextDocumentSaveReason) in TextDocumentWillSaveEvent but not for did-save, which would allow us to handle this better (we could delay it when autosaved, but still do it immediately if you hit Ctrl+S).

I'll file a request to see if they'll add that, and see what I can come up with in the meantime (we can query the settings, so your idea of debouncing if it's enabled may work - though it means you'll see a delay even if you Ctrl+S).

I opened https://github.com/Microsoft/vscode/issues/67190, feel free to add a 👍 :)

VS Code response:

Closing this because it would require API breakage and because the information asked for is available in the onWillSave-event

I guess we'll need to do something a little more hackyimaginative...

No problem, thanks for looking into it!

@paulcbetts there's a new beta build here that includes this functionality. Please try it out and let me know if you have any issues!

https://github.com/Dart-Code/Dart-Code/releases/tag/v2.23.0-beta.2

Question - is there an option to completely disable automatically running pub get?

@thosakwe that's what the dart.runPubGetOnPubspecChanges setting should do. Pubspec changes are the only thing that should result in automatic pub get. If you've set that setting to false and still see it running automatically, please open an issue with details.

Thanks, I’ll try that setting. And thanks for all the great work!

On Mon, Sep 30, 2019 at 8:24 AM Danny Tuppeny notifications@github.com
wrote:

@thosakwe https://github.com/thosakwe that's what the
dart.runPubGetOnPubspecChanges setting should do. Pubspec changes are the
only thing that should result in automatic pub get. If you've set that
setting to false and still see it running automatically, please open an
issue with details.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Dart-Code/Dart-Code/issues/1427?email_source=notifications&email_token=ACMIUPA4WXSHPEI6OJXZGFDQMHVWFA5CNFSM4GSTV5EKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75OQPY#issuecomment-536537151,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACMIUPFTTEF4KBGS4G4VHI3QMHVWFANCNFSM4GSTV5EA
.

>

--
Tobe Osakwe
Student, B.S. Comp. Sci, Florida State University
https://thosakwe.com

Was this page helpful?
0 / 5 - 0 ratings