简体   繁体   中英

A Code Scratchpad Extension in Visual Studio 2010 - How to?

Maybe it's somehow freaky, but I'd like to write an extension for Visual Studio 2010, which mimics the behavior of the Command Window in Visual Foxpro. For those of you who don't know about it:

In Foxpro, you could enter code in the command window, which got executed directly. This way, you where able to try things out without messing with your project or "real code". And you had some kind of Intellisense. If you created an object via CREATEOBJECT, you got an Intellisense with all available methods and functions in the next step. Somehow like a Code Scratchpad. This is something I'm missing in VS 2010.

I've seen the EditorToolwindow - Demo from the Visual Studio 2010 SDK, but I'd like to have a Syntax Highlighter and Intellisense, and provide my own logic for dealing with the code in this window, eg on-the-fly execution etc. A little bit like LINQPad.

Does anyone have an idea how I could accomplish this?

Have a look at Jon Skeet's Snippy utility which allows you to execute dot net code in a stand alone editor. There is also a Snippy Reflector add-in .

You could take a look through reflection to see how Snippy was built and go from there. Or just use it on it's own merit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM