Website may be up and down over next few months. I'm currently doing a complete overhaul of everything. Going back to simple individual .htm pages, new overall site theme, sanitizing and cleaning up html of all pages and blog posts, attempting to implement a new tooling and publishing system etc etc.

Code search woes

Published 11/27/2013 by createdbyx in News

As a programmer I am getting a bit frustrated when it comes to repeating my self. 

I have started a few hundred .net projects over the last 10+ years and too often I find myself needing to write a piece of code that I am sure I've written before. As soon as I get a sense of dejavu I stop and think OK where and in what project could that piece of code be located. 

Performing windows explorer searches are useless in this case as you never know what the method name was or if it was a piece of code within a method. Simple text based file contents searches are just not up to the task. And they are painfully slow and can return hundreds of files.

There are similar solutions like Krugle, or Ack etc but many of these are on-line search tools. 

What I am looking for is something for windows that can run on my local machine and parse/understand C# .cs and .vb code files. 

A visual studio extension would be ideal, but the ones I've found only search the open solution not a entire folder hierarchy containing multiple projects etc.

For example I have written a piece of code that you give a directory path and it will return a list of files from that directory structure even files that are in sub folders. But here is what I know...

  1. It uses GetDirectory or GetFiles but does not use GetDirectories
  2. It's a method that takes at least 1 string parameter
  3. It returns a List<> string[] or some type that implements a IEnumerable interface
  4. It's less then 100 lines of code give or take
  5. It may or may not recursively call it self

Given these points of data search every folder and sub folder for methods within code files that contain the closest match.

If I can't find a utility to do this I'm going to say screw it and write my own. Even though I don't really want to have to.

Add comment

  • Comment
  • Preview

Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume