I used Copilot to finally get VSCode to debug D apps on both
Windows and Linux.
This version is for Windows.
I noticed that write("Foo"); is eager like writeln(), and doesn't
need stdout.flush() to display on the console.
Is this due to my config files?
What would need to change in the config files to still maintain
debugging, but with write("Foo"); being buffered?
As this is a non-trivial project, I've saved it in adrive.com.
Here is the link, no credentials needed:
https://www.adrive.com/public/6XH96j/c02_p5_b_writeln_and_write_verbose.zip
source/app.d
```
void main()
{
import std.stdio : write, writeln, stderr, stdout;
// Let's first print what we have available:
stderr.write("Hello,");
// ... let's assume more operations at this point ...
stderr.write("World!");
// ... and finally this completes the writing to the console
with a newline
stderr.writeln();
// This writes: "Greetings, " to the stdout cache.
write("Greetings, ");
// This flushes the stdout cache, so the console displays:
Greetings,
stdout.flush();
// This writes: "World!" to the stdout cache.
write("World!");
// This flushes the stdout cache, so the console displays:
Greetings, World!
writeln();
write("I'm hiding! ");
write("Why don't you see me on the console!");
writeln; // Violates D Style Guidelines as this is a Command,
which should always have parentheses
}
```