R#5.1 IntelliSense Filter members by [EditorBrowsable] attribute and overloads

I'm using the setting in Options | IntelliSense | Completion Appearance to Filter members by [EditorBrowsable] attribute.

If I start typing this code:

var command = new SqlCommand();
command.Parameters.

I expect to see the Add method appear. But it doesn't.

If I use Visual Studio's IntelliSense by suspending ReSharper and in Options | Text Editor | All Languages | General enabling Auto list members and Hide advanced members, I do get the Add method.

I suppose the reason is that there are 6 overloads of SqlParameterCollection.Add of which two have their EditorBrowsable attribute set to EditorBrowsable.Never. Using Visual Studio's IntelliSense I do see the Add method, and it shows me four overloads. Using ReSharper's IntelliSense, it doesn't show me the Add method at all.


This occurs in both ReSharper 5.1.1 and 5.1.2.

Can you reproduce this behavior and if so, can you confirm it is not supposed to work like this?
3 comments

A quick check with a self created class in which one overload has the EditorBrowsable.Never attribute shows R# does not remove all overloads of the method from Intellisense like I suggested in my original post. In fact, it shows all overloads, including the one it shouldn't show!

I have a Class Library project with a ClassWithHiddenMembers class in it:

using System.ComponentModel;

namespace ClassLibraryWithHiddenMembers {
    public class ClassWithHiddenMembers {
        [EditorBrowsable(EditorBrowsableState.Never)]
        public void OneOverloadHidden() {}

        public void OneOverloadHidden(string str) {}

        [EditorBrowsable(EditorBrowsableState.Never)]
        public void AllOverloadsHidden() {}

        [EditorBrowsable(EditorBrowsableState.Never)]
        public void AllOverloadsHidden(string str) {}

        public void NoOverloadHidden() {}

        public void NoOverloadHidden(string str) {}
    }
}



In a test application, I use

using ClassLibraryWithHiddenMembers;

namespace TestDriverApplication {
    internal class Program {
        private static void Main(string[] args) {
            var test = new ClassWithHiddenMembers();
            test.
        }
    }
}



The ReSharper  IntelliSense shows methods NoOverloadHidden and OneOverloadHidden, both with two overloads.
ReSharper1.PNG
After selecting method OneOverloadHidden, it shows both overloads, including the hidden one.
ReSharper2.PNG

Visual Studio IntelliSense shows methods NoOverloadHidden and OneOverloadHidden, both with one extra overload.
VS2008_1.PNG
After selecting method OneOverloadHidden however, it only shows the not hidden overload.
VS2008_2.PNG

This also seems like a bug. Maybe I should have posted this in a separate thread, but I tried this out because of my problem in this thread's first post, so I'll just keep it here.

0

Hi

if you open Resharper -> Options you will find Environment ->IntelliSense -> Completion Appearance where there is the last option named "Filter membery by [EditorBrowsable] attribute" which is deactivated by default.

Perhaps this is what you are looking for?

Best regards,
Sven

0

Hello Dick,

This sure seems to be a bug, so I've added a bug report at http://youtrack.jetbrains.net/issue/RSRP-206067
and you can monitor its status. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'm using the setting in Options | IntelliSense | Completion
Appearance to Filter members by attribute.

If I start typing this code:

 SqlCommand();
> command.Parameters.]]>

I expect to see the Add method appear. But it doesn't.
If I use Visual Studio's IntelliSense by suspending ReSharper and in
Options | Text Editor | All Languages | General enabling Auto list
members and Hide advanced members, I do get the Add method.

I suppose the reason is that there are 6 overloads of
SqlParameterCollection.Add of which two have their EditorBrowsable
attribute set to EditorBrowsable.Never. Using Visual Studio's
IntelliSense I do see the Add method, and it shows me four overloads.
Using ReSharper's IntelliSense, it doesn't show me the Add method at
all.

This occurs in both ReSharper 5.1.1 and 5.1.2.

Can you reproduce this behavior and if so, can you confirm it is not
supposed to work like this?

---
Original message URL:
http://devnet.jetbrains.net/message/5284126#5284126



0

Please sign in to leave a comment.