What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I would like to start working on a patch for WMD for one of the most annoying areas I have with it.

Say I select a method from Visual Studio (like so):

string PartialFileName {
            get {
                return System.IO.Path.Combine(VodCast.DownloadPath, CleanName + ".partial");
            }
        }

And then I would like it formatted nicely. So I highlight it and click the code button like so:

string PartialFileName {
            get {
                return System.IO.Path.Combine(VodCast.DownloadPath, CleanName + ".partial");
            }
        }

Oh you are so ugly girl.

So I'm thinking of some sort of patch that heuristically detects this use case and fixes up the formatting.

Good idea? Bad idea? Is it just me? have you any suggested heuristic that does not interfere with any other normal use cases?

share|improve this question
2  
Stop coding in Visual Studio. All your problems solved. –  random Jan 29 '10 at 7:12
    
@random: I never understood the following mentality: "don't let tools help you; do everything yourself, it's better". Are you one of the people who agree with Linus Torvalds who keeps refusing to add a kernel debugger because they are "evil"? –  Andreas Bonini Jan 29 '10 at 7:15
    
99% of my time these days is spent in vim :) this does affect anyone cutting and pasting code snippets from existing projects. –  waffles Jan 29 '10 at 7:16
    
@Kop: If you do not find the bugs while reading the code, then do not touch the Linux kernel ;) –  Ladybug Killer Jan 29 '10 at 8:32
add comment

1 Answer

In a number of languages the whitespace and formatting is significant. It already struggles to cope with many languages - trying to understand the implications of changing the code is a huge job, even if you writing an IDE/tool for a single language.

Why not format it before you copy it? (in VS: Ctrl+E,F or Ctrl+E,D) Or better; don't write bug-ugly code in the first place.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .