• S
    Make defaultValue a required parameter · 2365f288
    Shyam N 提交于
    for ExtensionManager.PerformFunction*()
    
    Fixes internal TFS bug 1166482.
    
    In cases where a fix provider throws an unhandled exception, ExtensionManager.PerformFunction*() was correctly handling the exception by displaying an 'info bar' alerting the user about the crash. However, because the defaultValue parameter for ExtensionManager.PerformFunction*() was optional, in some cases, we would end up returning default(ImmutableArray<T>) as opposed to ImmutableArray<T>.Empty to the VS platform's light bulb  engine. The difference is significant in this case since ImmutableArray<T> is a struct and since it is returned as an IEnumerable<T>. The platform code checks whether the returned IEnumerable<T> is 'null' (which it won't be) and then calls '.Any()' on it and this results in an InvalidOperationException from ImmutableArray<T>...
    
    In addition to supplying the correct defaultValue of ImmutableArray<T>.Empty to avoid the above crash, I am also making defaultValue a required parameter (so that future consumers of ExtensionManager.PerformFunction*() don't run into this problem).
    2365f288
SuggestedAction.cs 11.8 KB