Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Quick Info, only ObsoleteAttribute is being displayed #781

Closed
dsaf opened this issue Feb 23, 2015 · 3 comments
Closed

In Quick Info, only ObsoleteAttribute is being displayed #781

dsaf opened this issue Feb 23, 2015 · 3 comments
Assignees
Labels
Area-IDE Bug Resolution-By Design The behavior reported in the issue matches the current design Verified

Comments

@dsaf
Copy link

dsaf commented Feb 23, 2015

Demonstration:

  1. copy-paste:
    public class SampleUsage : SampleBase
    {
        void SampleMethodUsage()
        {
            var sampleEnumUsage = SampleEnum.One;

            SampleMethod(sampleEnumUsage);
        }
    }

    [Obsolete("asdasd"), Serializable, SampleAttribute]
    public abstract class SampleBase
    {
        [Obsolete, Conditional("DEBUG")]
        protected void SampleMethod(SampleEnum sample) {}
    }

    [Obsolete, Serializable, CLSCompliant(true), Flags]
    public enum SampleEnum
    {
        [Obsolete]
        One,
        Two,
        Thee
    }

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
    public class SampleAttributeAttribute : Attribute
    {
    }
  1. in SampleUsage hover mouse over: SampleBase, SampleEnum, SampleMethod
  2. observe that only ObsoleteAttribute is being displayed

Issues:

  1. it makes a developer incorrectly assume that this is the only attribute applied or relevant
  2. creates a disparity between core platform and third-party developers in terms of IDE API treatment

Resolutions:

  1. quick fix: either hide or show all custom attributes (including inherited!)
  2. proper fix: show complete attribute information including non-default attribute arguments
@dsaf
Copy link
Author

dsaf commented Feb 23, 2015

Relevant: #780 , #711 , #534

@gafter gafter changed the title [Area-IDE][Bug] In Quick Info, only ObsoleteAttribute is being displayed In Quick Info, only ObsoleteAttribute is being displayed Feb 23, 2015
@Pilchie
Copy link
Member

Pilchie commented Feb 24, 2015

This is our intended design. The Obsolete attribute is special because it affects compilation and causes errors.

@Pilchie Pilchie closed this as completed Feb 24, 2015
@Pilchie Pilchie added the Resolution-By Design The behavior reported in the issue matches the current design label Feb 24, 2015
@dsaf
Copy link
Author

dsaf commented Feb 24, 2015

"The Obsolete attribute is special because it affects compilation and causes errors."

Same can be said about this one:

https://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute%28v=vs.110%29.aspx

"Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined."

... and these:

http://research.microsoft.com/en-us/projects/contracts

I don't think Obsolete is really special, it was just chosen to be. Wouldn't it better to be consistent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Resolution-By Design The behavior reported in the issue matches the current design Verified
Projects
None yet
Development

No branches or pull requests

3 participants