dotnet/roslyn

Make intellisense provide suggestions for generic lists where <T> is the class inherited.

オープン

#54,929 opened on 2021/07/19

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEConcept-Continuous ImprovementDeveloper CommunityIDE-IntelliSensehelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

This issue has been moved from a ticket on Developer Community.


Please restrict intellisense to types allowed for a generic type parameter. The entry will scroll down a list of all types that contains the class inherited. Let's say:

public T AddComponent<T>() where T : Component, new()
        {
            var component = new T();
            component. Entity = this;
            Components.Add(component);
            component. Initialize();
            return component;
        }

So all the classes that are inherited from Component Example: Public Class Ninja: Component Will be displayed whenever i use: AddComponent (< -Intellisense display of options where it suggests the classes that inherits the Component Class- >) So it will appears: AddComponent (<Ninja>)

Thanks in advance, Luke.


Original Comments

Feedback Bot on 6/20/2021, 07:55 PM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.

コントリビューターガイド