提交 d7b32274 编写于 作者: S Sam Harwell

Remove unused options in EditorCompletionOptions

上级 8ae1811e
......@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Editor.Options;
using Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion
......@@ -13,7 +12,6 @@ internal static class OptionSetExtensions
public static OptionSet WithDebuggerCompletionOptions(this OptionSet options)
{
return options
.WithChangedOption(EditorCompletionOptions.UseSuggestionMode, options.GetOption(EditorCompletionOptions.UseSuggestionMode_Debugger))
.WithChangedOption(CompletionControllerOptions.FilterOutOfScopeLocals, false)
.WithChangedOption(CompletionControllerOptions.ShowXmlDocCommentCompletion, false);
}
......
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;
namespace Microsoft.CodeAnalysis.Editor.Options
{
internal static class EditorCompletionOptions
{
public const string FeatureName = "EditorCompletion";
// Intentionally not persisted
public static readonly Option<bool> UseSuggestionMode = new Option<bool>(FeatureName, nameof(UseSuggestionMode), defaultValue: false);
// Default into suggestion mode in the watch/immediate windows but respect the
// user's preferences if they switch away from it.
// Intentionally not persisted
public static readonly Option<bool> UseSuggestionMode_Debugger = new Option<bool>(FeatureName, nameof(UseSuggestionMode_Debugger), defaultValue: true);
}
[ExportOptionProvider, Shared]
internal class EditorCompletionOptionsProvider : IOptionProvider
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public EditorCompletionOptionsProvider()
{
}
public ImmutableArray<IOption> Options { get; } = ImmutableArray.Create<IOption>(
EditorCompletionOptions.UseSuggestionMode,
EditorCompletionOptions.UseSuggestionMode_Debugger);
}
}
......@@ -104,21 +104,21 @@ public bool IsUseSuggestionModeOn()
var options = textView.Options.GlobalOptions;
EditorOptionKey<bool> optionKey;
Option<bool> roslynOption;
bool defaultOption;
if (IsDebuggerTextView(textView))
{
optionKey = new EditorOptionKey<bool>(PredefinedCompletionNames.SuggestionModeInDebuggerCompletionOptionName);
roslynOption = EditorCompletionOptions.UseSuggestionMode_Debugger;
defaultOption = true;
}
else
{
optionKey = new EditorOptionKey<bool>(PredefinedCompletionNames.SuggestionModeInCompletionOptionName);
roslynOption = EditorCompletionOptions.UseSuggestionMode;
defaultOption = false;
}
if (!options.IsOptionDefined(optionKey, localScopeOnly: false))
{
return roslynOption.DefaultValue;
return defaultOption;
}
return options.GetOptionValue(optionKey);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册