Describe the bug
We're actively using FormatOnSave for our _al_ files. Until a week ago, everything worked fine and we did not notice a major delay when saving our files.
"[al]": {"editor.formatOnSave": true }
However, since the VSCode January '20 update, the release notes states that background tasks of extensions during save (such as the Format Document) now show in a notification window ("Running Save Participants ...")
We've seen cases where autoFormat now takes several minutes instead, forcing us to close the notification window. Maybe related, but since the last VS Code update, we also faced numerous times that files cannot be saved / closed, forcing us to kill VS Code.
Screenshots

Versions:

I have the same exact issue since this update. Happening on vscode insiders and regular.
I'm getting the same thing. Everything worked fine before the update, I am formatting using the Prettier extension.
Seeing the same issue
Disabling formatonsave and doing a manual format document seems to improve speed a lot ...
Still seeing this in, format on save used to be fast and worked always, not only for [al], but happens also with .js, .jsx and stylus files.
Version: 1.42.1
Commit: c47d83b293181d9be64f27ff093689e8e7aed054
Date: 2020-02-11T14:44:27.652Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.0.0
I've also encountered this problem, “Quick Fixes” runs a long time.
This issue is very annoying. I'm using PHP, PHP Code Beautifier, and PHP Codesniffer. I had to disable all three.

vsocde is trying to execute ESLint in my .sh files in an endless loop.
it is not definied in any config file that he should format it with eslint^^
// settings.json
{
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[json]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"atomKeymap.promptV3Features": true,
"colorize.languages": ["css", "sass", "scss", "less", "postcss", "sss", "stylus", "xml", "svg", "javascript", "javascriptreact", "typescript", "typescriptreact"],
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.largeFileOptimizations": false,
"editor.minimap.enabled": true,
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "none",
"editor.rulers": [100],
"editor.showFoldingControls": "always",
"editor.tabSize": 2,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.syntaxProfiles": {
"javascript": ["js", "jsx"]
},
"eslint._legacyModuleResolve": true,
"eslint.alwaysShowStatus": true,
"eslint.packageManager": "yarn",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.associations": {
"*.graphqls": "graphql"
},
"files.autoSave": "off",
"files.eol": "\n",
"files.participants.timeout": 0,
"git.autofetch": true,
"git.enableSmartCommit": true,
"git.inputValidationSubjectLength": 72,
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.validate.enable": false,
"material-icon-theme.showUpdateMessage": false,
"npm.enableScriptExplorer": true,
"npm.scriptExplorerAction": "run",
"peacock.affectActivityBar": false,
"peacock.affectTitleBar": false,
"peacock.favoriteColors": [{
"name": "Angular Red",
"value": "#b52e31"
}, {
"name": "Auth0 Orange",
"value": "#eb5424"
}, {
"name": "Azure Blue",
"value": "#007fff"
}, {
"name": "C# Purple",
"value": "#68217A"
}, {
"name": "Gatsby Purple",
"value": "#639"
}, {
"name": "Go Cyan",
"value": "#5dc9e2"
}, {
"name": "Java Blue-Gray",
"value": "#557c9b"
}, {
"name": "JavaScript Yellow",
"value": "#f9e64f"
}, {
"name": "Mandalorian Blue",
"value": "#1857a4"
}, {
"name": "Node Green",
"value": "#215732"
}, {
"name": "React Blue",
"value": "#00b3e6"
}, {
"name": "Something Different",
"value": "#832561"
}, {
"name": "Vue Green",
"value": "#42b883"
}],
"scm.defaultViewMode": "tree",
"sync.autoDownload": false,
"sync.autoUpload": false,
"sync.forceDownload": false,
"sync.gist": "140cb49bd5ae6404af78e9636059cd89",
"sync.quietSync": false,
"sync.removeExtensions": true,
"sync.syncExtensions": true,
"terminal.integrated.rendererType": "auto",
"terminal.integrated.scrollback": 10000,
"typescript.tsserver.log": "verbose",
"window.zoomLevel": 0,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "One Monokai",
"workbench.editor.showTabs": true,
"workbench.iconTheme": "material-icon-theme",
"workbench.sideBar.location": "left",
"workbench.startupEditor": "welcomePage",
"workbench.tree.renderIndentGuides": "none"
}
@ChiefORZ it looks like vscode-eslint is your formatter for javascript and JSON.
@photocurio ya, of course. but isnt it strange that he tried to convert a .sh with a formatter associated with javascript and JSON 😜
experiencing this also lately. it works ok for a while after restart but then becomes slow.
@fvet Would you be able to provide some more information? Are you still experiencing this issue with the newest version of the AL extension and with a newer version of VS Code different from 1.42?
If you are still experiencing, would you please provide a minimal working example which reproduces the issue?
I suspect this issue might be more related to VS Code itself as per these two:
https://github.com/microsoft/vscode/issues/88149
https://github.com/microsoft/vscode/issues/92652
Past weeks, I've worked on the AL insider vsix (6.x version), now I'm working on AL Version 5.0.320540 and still experiencing the delay a lot, all linked to the 'FormatOnSave', disabling this solves the issue. I can't provide a repro here, since the project I'm working in contains 4500+ files. You can always remotely debug if really needed.
VS Code
Version: 1.48.2 (user setup)
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:13:11.295Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.14393
Thanks @fvet ! We were concerned that the FormatOnSave is completely blocking the save experience. From our testing, it appears to be related to the performance of the format command when working with large projects. We will continue working on performance improvements in the next months and follow up.
I had a similar problem with saving AL files: it took several minutes to do that. After setting the property "al.enableCodeAnalysis" to "false" in settings.json file the problem was solved. I don't know if it is exactly the same problem/reason, but VS Code was also showing, that the Formatter is running.
@yurim108, disabling CodeAnalysis is only a workaround. VS Code should be able to support both CodeAnalysis and AutoFormat next to each other in a single workspace. I'm often updating lots of objects (regex replace, ...) or when working with 'larger' objects / objects used in a wide area of the application, FormatOnSave just slows down the entire process, but don't want to give up CodeAnalysis, since we expect to be alerted on warnings / errors in the same operation.
I've had this issue seemingly for the life of BC AL development and it appears to be getting worse. Over the past two days, simple file changes will completely lock up VS Code not infrequently
Most helpful comment
I have the same exact issue since this update. Happening on vscode insiders and regular.