Incomplete list of properties/methods in IntelliSe

2020-02-15 03:40发布

问题:

I am using VB.NET in Visual Studio Community 2017. I noticed that in some cases the list of available properties and methods for an object is incomplete.

One example can be seen here:

As depicted, I want to use the RowCount property of the dgv object, that is of type System.Windows.Forms.DataGridView. You can see, that right above it the property is there and working fine, I can just type it by hand. It just takes a second or two, before the background compiler (for lack of better term) acknowledges it as correct. The behavior messes up the typing flow, since often IntelliSense autocorrects what it perceives as typos.

Note: This is not exclusive to the shown property. I noticed it for other examples, and also in function calls and other random places, but I could not find a clear methodology of what is missing and what isn't.

Looking around I found e.g. this question, however it deals with a completely different problem.

Is this just a bug in Visual Studio (and if so, is it reported somewhere?), can someone confirm this, and does someone know of a fix?

回答1:

Followed your steps and I got the same result like yours, I already reported this issue to the VS Product Team, please check this: VS 2017--VB: the intellisense for the DataGridView control not works like VS 2015, you can vote it or add a comment, then we need to waiting for the confirmation from the VS Product Team, thank you for your feedback. Meanwhile, I tried it in C#>Windows Forms application and the intellisense works fine just like the VS 2015.



回答2:

Albano Gheller posted an answer on the Visual Studio Community page.

To quote him and the required step for a fix:

I've fixed the problem in this way:

1. I've exported my settings from Tool - Import/Export settings
2. I've set the property HideAdvancedMembers = true inside
   <ToolsOptionsSubCategory name="Basic" RegisteredName="Basic" PackageName="Text Management Package">
   because C# has true and works
3. I've imported this modified settings.

So to summarize:

Find the part: <PropertyValue name="HideAdvancedMembers">false</PropertyValue> in the exported settings document's Basic ToolsOptionsSubCategory. Change this to <PropertyValue name="HideAdvancedMembers">true</PropertyValue>, save, and then reimport the settings.

I don't know why hiding members leads to showing more members, but whatever ;-)