Closed fvet closed 2 years ago
My extension creates separate code action containing document edits for each missing parenthesis warning reported by the Microsoft al code analyzer. VS Code applies these edits when file is saved. Your error is thrown by AL compiler that runs in the background and rebuilds syntax tree and runs code analyzers when you edit al files.
I will check how VS Code sends notification about document changes to the language server when multiple code actions are applied during save. Maybe it triggers "DocumentChanged" event after each code action, so language server receivers very quickly a lot of notifications while background code analyzer is still processing al file? If that's the case, I will modify my code to report one big code action for all missing brackets and check if it helps. I will also stop creating my "Missing parenthesis" code action if you don't want to run it automatically on save as Microsoft AL Compiler also creates it and that implementation is better than mine.
@fvet - are you still able to reproduce this on the latest version of the VSIX?
@thloke I've stopped using any 'OnSave...' settings (CodeActions, FormatDocument, ...) since it slowed down the development experience a lot. Instead, I'm now manually running the 'Cleanup' actions from Andrzej Zwierzchowski extension, which is way faster than running actions upon save.
So for me, this issue can be closed if needed.
Describe the bug
Performing Code Actions upon save crashes 9 out of 10.
AL file
Settings.json (reduced version)
Whenever I save a file, I would expect the CodeCop warning for missing Parentheses to be fix (by the alOutline extension), although it always results in the error below:
5. Versions: