views:

103

answers:

1

I need to modify some logic of Javascript Intellisense on Visual Studio 2008 SP1 like some build-in function such as ScriptEngine, ScriptEngineBuildVersion and etc. Moreover, I need to dynamically generate function depend on opened docuement.

A: 

In Visual Studio, language services are provided via VSPackages. Most built-in language services in Visual Studio 2008 do not really offer any kind of extensibility or customization that would enable what you're trying to achieve.

There are a couple of options you could consider though:

  1. Write your own Javascript language service. Obviously, this would be non-trivial, but it would allow you to get the precise behavior you're after. Language services are responsible for parsing the file to provide colorization, quick info, Intellisense, auto-completion, and other features to the core text editor. The simplest example of a language service is a sample in the Visual Studio 2008 SDK 1.1 called the RegExLangService. There is also a detailed walkthrough for the sample.
  2. You could attempt implementing either an Add-in or a VSPackage which would insert/manipulate text in the editor based on the contents of the open document. Your question doesn't really say exactly what kind of behavior you need (other than dynamically generating a function). This would certainly be possible with the Visual Studio SDK and much less work than writing your own Javascript language service.

Good Luck!

Aaron Marten
I think so. Visual Studio doesn't allow me to directly modify JavaScript Intellisense.
Soul_Master
Similar question: http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/65a06008-58f3-4846-be84-4a1861f7f6a2
mykhaylo