diff --git a/Src/Workspaces/Core/Formatting/Formatter.cs b/Src/Workspaces/Core/Formatting/Formatter.cs index 2241ecc299285f3cd34d3ef0e90463c5df68dc24..5d8cadacaf0b8d4a36f895d8a17f4151adf815a3 100644 --- a/Src/Workspaces/Core/Formatting/Formatter.cs +++ b/Src/Workspaces/Core/Formatting/Formatter.cs @@ -286,7 +286,7 @@ internal static SyntaxNode Format(SyntaxNode node, IEnumerable spans, var languageFormatter = workspace.Services.GetLanguageServices(node.Language).GetService(); if (languageFormatter != null) { - options = options ?? workspace.GetOptions(); + options = options ?? workspace.Options; rules = rules ?? GetDefaultFormattingRules(workspace, node.Language); return languageFormatter.Format(node, spans, options, rules, cancellationToken).GetFormattedRoot(cancellationToken); } @@ -321,7 +321,7 @@ internal static IList GetFormattedTextChanges(SyntaxNode node, IEnum var languageFormatter = workspace.Services.GetLanguageServices(node.Language).GetService(); if (languageFormatter != null) { - options = options ?? workspace.GetOptions(); + options = options ?? workspace.Options; rules = rules ?? GetDefaultFormattingRules(workspace, node.Language); return languageFormatter.Format(node, spans, options, rules, cancellationToken).GetTextChanges(cancellationToken); } diff --git a/Src/Workspaces/Core/Recommendations/Recommender.cs b/Src/Workspaces/Core/Recommendations/Recommender.cs index 580ed8a89e95bab32fe9dd558b9f6ea7e6a4e200..26bb49609d990967f6a9805c12e4d69956c97cca 100644 --- a/Src/Workspaces/Core/Recommendations/Recommender.cs +++ b/Src/Workspaces/Core/Recommendations/Recommender.cs @@ -17,7 +17,7 @@ public static class Recommender OptionSet options = null, CancellationToken cancellationToken = default(CancellationToken)) { - options = options ?? workspace.GetOptions(); + options = options ?? workspace.Options; var languageRecommender = workspace.Services.GetLanguageServices(semanticModel.Language).GetService(); return languageRecommender.GetRecommendedSymbolsAtPosition(workspace, semanticModel, position, options, cancellationToken); diff --git a/Src/Workspaces/Core/Rename/ConflictEngine/RenamedSpansTracker.cs b/Src/Workspaces/Core/Rename/ConflictEngine/RenamedSpansTracker.cs index 7cea6a5bb6bc9a738c1d9bf81caca98114d6ba2b..6bf14323b5d8af25d4d096c799c464cc7056645f 100644 --- a/Src/Workspaces/Core/Rename/ConflictEngine/RenamedSpansTracker.cs +++ b/Src/Workspaces/Core/Rename/ConflictEngine/RenamedSpansTracker.cs @@ -195,7 +195,7 @@ internal async Task SimplifyAsync(Solution solution, IEnumerable ReduceAsync(Document document, IEnumerable return document; } - optionSet = optionSet ?? document.Project.Solution.Workspace.GetOptions(); + optionSet = optionSet ?? document.Project.Solution.Workspace.Options; var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); diff --git a/Src/Workspaces/Core/Workspace/Workspace.cs b/Src/Workspaces/Core/Workspace/Workspace.cs index a77ffb57e0c00908bca42b4890f176260d3ef9b6..0237bc376584433d131493f70ca0cfaeb7263dfc 100644 --- a/Src/Workspaces/Core/Workspace/Workspace.cs +++ b/Src/Workspaces/Core/Workspace/Workspace.cs @@ -153,11 +153,19 @@ protected Solution SetCurrentSolution(Solution solution) } /// - /// Get's the set of all global options. + /// Gets or sets the set of all global options. /// - public OptionSet GetOptions() + public OptionSet Options { - return this.services.GetService().GetOptions(); + get + { + return this.services.GetService().GetOptions(); + } + + set + { + this.services.GetService().SetOptions(value); + } } /// diff --git a/Src/Workspaces/CoreTest/Formatting/FormattingTestBase.cs b/Src/Workspaces/CoreTest/Formatting/FormattingTestBase.cs index 29363cbf9a269157954666edafc883bde9818861..2c0a887c8e4906e526cdb68fd043f0c7ae7c69d0 100644 --- a/Src/Workspaces/CoreTest/Formatting/FormattingTestBase.cs +++ b/Src/Workspaces/CoreTest/Formatting/FormattingTestBase.cs @@ -43,7 +43,7 @@ public abstract class FormattingTestBase var syntaxTree = document.GetSyntaxTreeAsync().Result; - var options = workspace.GetOptions(); + var options = workspace.Options; if (changedOptionSet != null) { foreach (var entry in changedOptionSet)