dotnet/roslyn

"Add Constraints" Code-Fix

オープン

#50,479 opened on 2021/01/14

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

Repository metrics

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

説明

Brief description: When working with a generic class, it would be nice if I could run a code-fix to automatically add missing constraints from a base class.

Languages applicable: All languages

Code example that the analyzer should report:

public class Derived<TKey, TJson, TStorage> : base<TKey, TJson, TStorage> {

}

 public abstract class Base<TKey, TJson, TStorage>
        where TKey : notnull
        where TJson : JsonBase<TKey>, new()
        where TStorage : StorageBase<TKey, TJson>, new()
        {

}

Additional information: None.

Documentation requirements:

When this analyzer is implemented, it must be documented by following the steps at Documentation for IDE CodeStyle analyzers.

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