提交 a968f8bc 编写于 作者: J Jason Malinowski

Add an overload to DocumentOptionSet.WithChangedOption

This adds a convenience overload where WithChangedOption can be more
easily used with a PerLanguageOption, but also returns a strongly
typed DocumentOptionSet so you don't lose the distinction.
上级 3a677853
......@@ -35,6 +35,14 @@ public override OptionSet WithChangedOption(OptionKey optionAndLanguage, object
return new DocumentOptionSet(_backingOptionSet.WithChangedOption(optionAndLanguage, value), _language);
}
/// <summary>
/// Creates a new <see cref="DocumentOptionSet" /> that contains the changed value.
/// </summary>
public DocumentOptionSet WithChangedOption<T>(PerLanguageOption<T> option, T value)
{
return (DocumentOptionSet)WithChangedOption(option, _language, value);
}
internal override IEnumerable<OptionKey> GetChangedOptions(OptionSet optionSet)
{
return _backingOptionSet.GetChangedOptions(optionSet);
......
*REMOVED*Microsoft.CodeAnalysis.TextDocument.Project.set -> void
*REMOVED*Microsoft.CodeAnalysis.TextDocument.TextDocument() -> void
Microsoft.CodeAnalysis.Options.DocumentOptionSet.WithChangedOption<T>(Microsoft.CodeAnalysis.Options.PerLanguageOption<T> option, T value) -> Microsoft.CodeAnalysis.Options.DocumentOptionSet
static Microsoft.CodeAnalysis.Formatting.Formatter.OrganizeImportsAsync(Microsoft.CodeAnalysis.Document document, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document>
static Microsoft.CodeAnalysis.Simplification.Simplifier.AddImportsAnnotation.get -> Microsoft.CodeAnalysis.SyntaxAnnotation
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册