My usecase is to make an abstraction of two functions that are in the same file and are quite similar.
I want to diff these two functions to make sure I don't miss any details where they differ.
But I'm sure there are many other usecases. Two paragraphs in a single text document, etc...
I can't seem to find a way to do this in VSCode, or indeed anybody asking about it.
Is this possible and I just don't know it?
Failing that, is there a nice little trick to achieve it without specific support for it?
Failing that, is there a nice little trick to achieve it without specific support for it?
Yes. Copy the sections into each their own text file, and then compare those two files. You can select them in the Explorer and use the "Compare Selected" context menu action, or individually select using "Select for Compare". Or via commandline with code -diff <file> <file>
.
There's also the extension ryu1kn.partial-diff
(I have no affiliation with this extension) which sounds like it does what you're looking for.