Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to provide intellisense for dynamic objects in visual studio?

I am using dynamic objects in a project, and I'd like to provide intellisense for the object. I understand that Visual Studio can't know what to show for intellisense, but if I can plug into the intellisense, I do know what entries should show up.

Is there a way to extend Visual Studio's intellisense? If so, any pointers?

Thanks!

like image 229
Erick T Avatar asked Sep 28 '12 18:09

Erick T


People also ask

Is it good practice to use dynamic in C#?

The short answer is YES, it is a bad practice to use dynamic. Why? dynamic keyword refers to type late binding, which means the system will check type only during execution instead of during compilation. It will then mean that user, instead of programmer, is left to discover the potential error.

What does IntelliSense do in Visual Studio?

IntelliSense is a code-completion aid that includes a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you're using, keep track of the parameters you're typing, and add calls to properties and methods with only a few keystrokes.

What is dynamic object in C#?

Dynamic objects expose members such as properties and methods at run time, instead of at compile time. This enables you to create objects to work with structures that do not match a static type or format.


1 Answers

You can use Editor Extension Points.

You can find specific information for extending Intellisense near the bottom of this page:

Editor Extension Points

From this page you can get information about ICompletionSource and ICompletionSourceProvider which are the two interfaces you must implement to provide autocompletion.

like image 61
JotaBe Avatar answered Oct 31 '22 05:10

JotaBe