Is there a Visual Studio 2013 extension that

  • displays the size of the current file in bytes and/or characters (best would be both)
  • updates while typing, not only when saving
  • is gratis (free of cost)

Not much more to say, it's so simple that I wonder why I can't find it in the gallery.

Why do I need it?

  • I want to participate in code golfing, where the file size matters
  • Because Visual Studio displays line numbers only
  • 1
    Can you code golf your own extension? msdn.microsoft.com/en-us/library/… – Mawg Mar 6 '15 at 8:48
  • @Mawg: oh, if it would only be the FileInfo.Length property... First I need the Visual Studio SDK, become familiar with it, implement the extension, display the value somewhere and finally, FileInfo.Length would only help if the file is saved. Remember that I also want it during live typing. Then I need to package it into a vsix file, sign it and distribute it. All in all, that's probably 2 days of work. But I've already started... – Thomas Weller Mar 6 '15 at 19:17
up vote 4 down vote accepted

Maybe I'm a bit impatient waiting for an answer. I checked out how difficult it is to implement such an extension and I'm proud to provide you the Code Golf File Size Extension for Visual Studio 2013.

Notice the green number on the bottom right of the text editor.

Screenshot of the extension in action

Why it is an answer:

  • Is a Visual Studio 2013 extension
  • Works on Windows 7 SP1 x64
  • Displays the number of printable characters, accurately measured using StringInfo.LengthInTextElements() and not string.Length. It does not display the length in bytes, because I was unable to determine the encoding at the moment.
  • Updates while typing
  • Free, published under MIT license

Full disclaimer: I'm the author of the tool.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.