code-d
code-d copied to clipboard
Syntax error prevents from saving a file
If I have a syntax error in my file I cannot save it because dfmt locks it or prevents from saving. A popup appears
Saving 'abc.d': Running 'D Programming Language (code-d)' Formatter (configure)
which is annoying since it doesn't display the error and compiler cannot tell me since the file isn't updated yet.
Can you share the code that breaks this? Normally dfmt shouldn't run on save or prevent the save process from running, did you manually enable format on save?
Also it's possible if you try using serve-d nightly (change user setting d.servedReleaseChannel to nightly, then reload window) it might be fixed
Yes, I have enabled Format on Save.
The code can be arbitrary, it can happen if I just forget a bracket. Sometimes than the code gets just deformatted on save but sometimes it also hangs till the syntax was fixed. I see this popup sometime also if the file was updated already. It just not disappears then.
I'm on Windows. Ok, I 'll try the nightly and let you know if it happen again.
So it happens again. There can be various reasons - that one that the compiler sees as fatal and cannot recover - for example:
Error: import ABC is used as a type
will trigger this.