Visual D issues and suggestions
Laurent Tréguier
laurent.treguier.sink at gmail.com
Mon Oct 22 20:58:44 UTC 2018
On Monday, 22 October 2018 at 17:50:04 UTC, Rainer Schuetze wrote:
> I was considering integrating dfmt at some point but it seems
> formatting just a selection doesn't work too well with it.
I was able to do some decent (at least, from I've tested it
seemed decent) selection formatting with dfmt. I don't know how
formatting is handled in Visual Studio, but if it's similar to
VSCode (which is basically just text replacement), then it might
be possible to do the same.
I simply do a diff between the code before and after formatting,
to extract the portions of code that have actually changed, and
then I only apply the changes affecting the selected zone of text.
It's certainly not the most efficient way to do it, as it still
requires formatting the whole file in the background, but it
works.
More information about the Digitalmars-d-ide
mailing list