locked
read javascript text file RRS feed

  • Question

  • I need to read a list of .js files (looking for a function) thats not open in Vs2010.  It doesn't seem neccessary to open them just to use the dte.document function.  Do I read them with io stream? or do I open them to VS2010 (and close them), or is there some other way this is dealt with.  If I do find the function I want, I will open that one and go to that line.

    Thanks.

    TM


    BS
    Monday, January 30, 2012 5:49 AM

Answers

  • I would just use a .NET FileStream. VS extensibility is really intended for more complex interactions and integrating multiple systems (source files, editors, language services, build systems, source control, etc..). There really isn't anything easier/better than a raw stream in some cases.

    Ryan

    • Marked as answer by TallmanBS Monday, January 30, 2012 1:42 PM
    Monday, January 30, 2012 6:16 AM

All replies

  • I would just use a .NET FileStream. VS extensibility is really intended for more complex interactions and integrating multiple systems (source files, editors, language services, build systems, source control, etc..). There really isn't anything easier/better than a raw stream in some cases.

    Ryan

    • Marked as answer by TallmanBS Monday, January 30, 2012 1:42 PM
    Monday, January 30, 2012 6:16 AM
  • I agree with  Ryan. Since you know the solution directory, Using .Net FileStream to recursion read those JS file is more easy than DTE.
    Monday, January 30, 2012 8:44 AM
  • Perfect!  Thanks.

    TM


    BS
    Monday, January 30, 2012 1:43 PM