未验证 提交 855509af 编写于 作者: J Jason Malinowski 提交者: GitHub

Merge pull request #38689 from jasonmalinowski/delete-nullable-analysis-checkbox

Delete the checkbox to control nullable analysis in the IDE
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.QuickInfo; using Microsoft.CodeAnalysis.QuickInfo;
using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.Utilities;
using Roslyn.Test.Utilities; using Roslyn.Test.Utilities;
using Roslyn.Utilities; using Roslyn.Utilities;
using Xunit; using Xunit;
...@@ -6569,31 +6568,9 @@ void N() ...@@ -6569,31 +6568,9 @@ void N()
} }
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)] [Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
public async Task NullableNotShownWithoutFeatureFlag() public async Task NullableNotShownInNullableDisable()
{ {
var options = TestOptions.Regular8.WithFeature(CompilerFeatureFlags.RunNullableAnalysis, "false"); await TestWithOptionsAsync(TestOptions.Regular8,
await TestWithOptionsAsync(options,
@"#nullable enable
using System.Collections.Generic;
class X
{
void N()
{
string s = """";
string s2 = $$s;
}
}",
MainDescription($"({FeaturesResources.local_variable}) string s"),
NullabilityAnalysis(""));
}
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
public async Task NullableNotShownInNullableDisableContextEvenIfAnalysisIsRunning()
{
var options = TestOptions.Regular8.WithFeature(CompilerFeatureFlags.RunNullableAnalysis, "true");
await TestWithOptionsAsync(options,
@"#nullable disable @"#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
......
...@@ -84,16 +84,6 @@ internal static class FeatureOnOffOptions ...@@ -84,16 +84,6 @@ internal static class FeatureOnOffOptions
nameof(FeatureOnOffOptions), nameof(UseEnhancedColors), defaultValue: 1, nameof(FeatureOnOffOptions), nameof(UseEnhancedColors), defaultValue: 1,
storageLocations: new RoamingProfileStorageLocation("WindowManagement.Options.UseEnhancedColorsForManagedLanguages")); storageLocations: new RoamingProfileStorageLocation("WindowManagement.Options.UseEnhancedColorsForManagedLanguages"));
/// <summary>
/// Feature to enable <see cref="CompilerFeatureFlags.RunNullableAnalysis"/> in the compiler flags for all csharp projects.
/// 0 = default, which leaves the flag unset.
/// 1 = set to true
/// -1 = set to false
/// </summary>
public static readonly Option<int> UseNullableReferenceTypeAnalysis = new Option<int>(
nameof(FeatureOnOffOptions), nameof(UseNullableReferenceTypeAnalysis), defaultValue: 0,
storageLocations: new RoamingProfileStorageLocation($"TextEditor.CSharp.{nameof(UseNullableReferenceTypeAnalysis)}"));
// Note: no storage location since this is intentionally a session variable // Note: no storage location since this is intentionally a session variable
public static readonly Option<bool> AcceptedDecompilerDisclaimer = new Option<bool>( public static readonly Option<bool> AcceptedDecompilerDisclaimer = new Option<bool>(
nameof(FeatureOnOffOptions), nameof(AcceptedDecompilerDisclaimer), defaultValue: false); nameof(FeatureOnOffOptions), nameof(AcceptedDecompilerDisclaimer), defaultValue: false);
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_full_solution_analysis}" /> Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_full_solution_analysis}" />
<CheckBox x:Name="Enable_navigation_to_decompiled_sources" <CheckBox x:Name="Enable_navigation_to_decompiled_sources"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_navigation_to_decompiled_sources}" /> Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_navigation_to_decompiled_sources}" />
<CheckBox x:Name="Enable_use_nullable_reference_types"
IsThreeState="True"
Content="{x:Static local:AdvancedOptionPageStrings.Option_use_nullable_reference_analysis_IDE_features}" />
<CheckBox x:Name="Use_editorconfig_compatibility_mode" <CheckBox x:Name="Use_editorconfig_compatibility_mode"
Content="{x:Static local:AdvancedOptionPageStrings.Option_use_editorconfig_compatibility_mode}" /> Content="{x:Static local:AdvancedOptionPageStrings.Option_use_editorconfig_compatibility_mode}" />
</StackPanel> </StackPanel>
......
...@@ -24,7 +24,6 @@ public AdvancedOptionPageControl(OptionStore optionStore) : base(optionStore) ...@@ -24,7 +24,6 @@ public AdvancedOptionPageControl(OptionStore optionStore) : base(optionStore)
BindToFullSolutionAnalysisOption(Enable_full_solution_analysis, LanguageNames.CSharp); BindToFullSolutionAnalysisOption(Enable_full_solution_analysis, LanguageNames.CSharp);
BindToOption(Enable_navigation_to_decompiled_sources, FeatureOnOffOptions.NavigateToDecompiledSources); BindToOption(Enable_navigation_to_decompiled_sources, FeatureOnOffOptions.NavigateToDecompiledSources);
BindTristateToOption(Enable_use_nullable_reference_types, FeatureOnOffOptions.UseNullableReferenceTypeAnalysis);
BindToOption(Use_editorconfig_compatibility_mode, EditorConfigDocumentOptionsProviderFactory.UseLegacyEditorConfigSupport); BindToOption(Use_editorconfig_compatibility_mode, EditorConfigDocumentOptionsProviderFactory.UseLegacyEditorConfigSupport);
BindToOption(PlaceSystemNamespaceFirst, GenerationOptions.PlaceSystemNamespaceFirst, LanguageNames.CSharp); BindToOption(PlaceSystemNamespaceFirst, GenerationOptions.PlaceSystemNamespaceFirst, LanguageNames.CSharp);
......
...@@ -18,9 +18,6 @@ public static string Option_Enable_full_solution_analysis ...@@ -18,9 +18,6 @@ public static string Option_Enable_full_solution_analysis
public static string Option_Enable_navigation_to_decompiled_sources public static string Option_Enable_navigation_to_decompiled_sources
=> ServicesVSResources.Enable_navigation_to_decompiled_sources; => ServicesVSResources.Enable_navigation_to_decompiled_sources;
public static string Option_use_nullable_reference_analysis_IDE_features
=> ServicesVSResources.Enable_nullable_reference_analysis_IDE_features;
public static string Option_use_editorconfig_compatibility_mode public static string Option_use_editorconfig_compatibility_mode
=> ServicesVSResources.Use_editorconfig_compatibility_mode; => ServicesVSResources.Use_editorconfig_compatibility_mode;
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using System.IO; using System.IO;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Utilities;
using Roslyn.Utilities; using Roslyn.Utilities;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
...@@ -27,7 +24,6 @@ internal class VisualStudioProjectOptionsProcessor : IDisposable ...@@ -27,7 +24,6 @@ internal class VisualStudioProjectOptionsProcessor : IDisposable
private CommandLineArguments _commandLineArgumentsForCommandLine; private CommandLineArguments _commandLineArgumentsForCommandLine;
private string _explicitRuleSetFilePath; private string _explicitRuleSetFilePath;
private IReferenceCountedDisposable<ICacheEntry<string, IRuleSetFile>> _ruleSetFile = null; private IReferenceCountedDisposable<ICacheEntry<string, IRuleSetFile>> _ruleSetFile = null;
private readonly IOptionService _optionService;
public VisualStudioProjectOptionsProcessor(VisualStudioProject project, HostWorkspaceServices workspaceServices) public VisualStudioProjectOptionsProcessor(VisualStudioProject project, HostWorkspaceServices workspaceServices)
{ {
...@@ -37,15 +33,6 @@ public VisualStudioProjectOptionsProcessor(VisualStudioProject project, HostWork ...@@ -37,15 +33,6 @@ public VisualStudioProjectOptionsProcessor(VisualStudioProject project, HostWork
// Set up _commandLineArgumentsForCommandLine to a default. No lock taken since we're in the constructor so nothing can race. // Set up _commandLineArgumentsForCommandLine to a default. No lock taken since we're in the constructor so nothing can race.
ReparseCommandLine_NoLock(); ReparseCommandLine_NoLock();
_optionService = workspaceServices.GetRequiredService<IOptionService>();
// For C#, we need to listen to the options for NRT analysis
// that can change in VS through tools > options
if (_project.Language == LanguageNames.CSharp)
{
_optionService.OptionChanged += OptionService_OptionChanged;
}
} }
public string CommandLine public string CommandLine
...@@ -113,15 +100,6 @@ public string EffectiveRuleSetFilePath ...@@ -113,15 +100,6 @@ public string EffectiveRuleSetFilePath
} }
} }
private void OptionService_OptionChanged(object sender, OptionChangedEventArgs e)
{
if (e.Option.Name == FeatureOnOffOptions.UseNullableReferenceTypeAnalysis.Name
&& e.Option.Feature == FeatureOnOffOptions.UseNullableReferenceTypeAnalysis.Feature)
{
UpdateProjectForNewHostValues();
}
}
private void DisposeOfRuleSetFile_NoLock() private void DisposeOfRuleSetFile_NoLock()
{ {
if (_ruleSetFile != null) if (_ruleSetFile != null)
...@@ -178,8 +156,6 @@ private void UpdateProjectOptions_NoLock() ...@@ -178,8 +156,6 @@ private void UpdateProjectOptions_NoLock()
var parseOptions = _commandLineArgumentsForCommandLine.ParseOptions var parseOptions = _commandLineArgumentsForCommandLine.ParseOptions
.WithDocumentationMode(documentationMode); .WithDocumentationMode(documentationMode);
parseOptions = ComputeOptionsServiceParseOptions(parseOptions);
// We've computed what the base values should be; we now give an opportunity for any host-specific settings to be computed // We've computed what the base values should be; we now give an opportunity for any host-specific settings to be computed
// before we apply them // before we apply them
compilationOptions = ComputeCompilationOptionsWithHostValues(compilationOptions, this._ruleSetFile?.Target.Value); compilationOptions = ComputeCompilationOptionsWithHostValues(compilationOptions, this._ruleSetFile?.Target.Value);
...@@ -198,25 +174,6 @@ private void UpdateProjectOptions_NoLock() ...@@ -198,25 +174,6 @@ private void UpdateProjectOptions_NoLock()
_project.ParseOptions = parseOptions; _project.ParseOptions = parseOptions;
} }
private ParseOptions ComputeOptionsServiceParseOptions(ParseOptions parseOptions)
{
if (_project.Language == LanguageNames.CSharp)
{
var useNullableReferenceAnalysisOption = _optionService.GetOption(FeatureOnOffOptions.UseNullableReferenceTypeAnalysis);
if (useNullableReferenceAnalysisOption == -1)
{
parseOptions = parseOptions.WithFeatures(new[] { KeyValuePairUtil.Create(CompilerFeatureFlags.RunNullableAnalysis, "false") });
}
else if (useNullableReferenceAnalysisOption == 1)
{
parseOptions = parseOptions.WithFeatures(new[] { KeyValuePairUtil.Create(CompilerFeatureFlags.RunNullableAnalysis, "true") });
}
}
return parseOptions;
}
private void RuleSetFile_UpdatedOnDisk(object sender, EventArgs e) private void RuleSetFile_UpdatedOnDisk(object sender, EventArgs e)
{ {
lock (_gate) lock (_gate)
...@@ -275,7 +232,6 @@ public void Dispose() ...@@ -275,7 +232,6 @@ public void Dispose()
lock (_gate) lock (_gate)
{ {
DisposeOfRuleSetFile_NoLock(); DisposeOfRuleSetFile_NoLock();
_optionService.OptionChanged -= OptionService_OptionChanged;
} }
} }
} }
......
...@@ -886,15 +886,6 @@ internal class ServicesVSResources { ...@@ -886,15 +886,6 @@ internal class ServicesVSResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Enable nullable reference analysis IDE features.
/// </summary>
internal static string Enable_nullable_reference_analysis_IDE_features {
get {
return ResourceManager.GetString("Enable_nullable_reference_analysis_IDE_features", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to --- End of inner exception stack trace ---. /// Looks up a localized string similar to --- End of inner exception stack trace ---.
/// </summary> /// </summary>
......
...@@ -1166,9 +1166,6 @@ I agree to all of the foregoing:</value> ...@@ -1166,9 +1166,6 @@ I agree to all of the foregoing:</value>
<data name="Use_enhanced_colors_for_C_and_Basic" xml:space="preserve"> <data name="Use_enhanced_colors_for_C_and_Basic" xml:space="preserve">
<value>Use enhanced colors for C# and Basic</value> <value>Use enhanced colors for C# and Basic</value>
</data> </data>
<data name="Enable_nullable_reference_analysis_IDE_features" xml:space="preserve">
<value>Enable nullable reference analysis IDE features</value>
</data>
<data name="Move_to_namespace" xml:space="preserve"> <data name="Move_to_namespace" xml:space="preserve">
<value>Move to Namespace</value> <value>Move to Namespace</value>
</data> </data>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">Element není platný.</target> <target state="translated">Element není platný.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Povolit funkce rozhraní IDE pro analýzu odkazů, které můžou mít hodnotu null</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Vyhodnocování (počet úloh ve frontě: {0})</target> <target state="translated">Vyhodnocování (počet úloh ve frontě: {0})</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">Das Element ist ungültig.</target> <target state="translated">Das Element ist ungültig.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">IDE-Features zur Analyse von Nullable-Verweisen aktivieren</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Auswertung ({0} Tasks in der Warteschlange)</target> <target state="translated">Auswertung ({0} Tasks in der Warteschlange)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">El elemento no es válido.</target> <target state="translated">El elemento no es válido.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Habilitar características de IDE de análisis de referencias que aceptan valores NULL</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Evaluando ({0} tareas en cola)</target> <target state="translated">Evaluando ({0} tareas en cola)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">L'élément n'est pas valide.</target> <target state="translated">L'élément n'est pas valide.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Activer les fonctionnalités de l'IDE pour l'analyse des références Nullable</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Évaluation ({0} tâches en file d'attente)</target> <target state="translated">Évaluation ({0} tâches en file d'attente)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">L'elemento non è valido.</target> <target state="translated">L'elemento non è valido.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Abilita le funzionalità IDE per l'analisi dei riferimenti nullable</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">In fase di valutazione ({0} attività in coda)</target> <target state="translated">In fase di valutazione ({0} attività in coda)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">要素が有効ではありません。</target> <target state="translated">要素が有効ではありません。</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">NULL 許容参照分析の IDE 機能を有効にします</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">評価中 ({0} 個のタスクがキューにあります)</target> <target state="translated">評価中 ({0} 個のタスクがキューにあります)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">요소가 잘못되었습니다.</target> <target state="translated">요소가 잘못되었습니다.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">nullable 참조 분석 IDE 기능 사용</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">평가 중(큐의 {0}개 작업)</target> <target state="translated">평가 중(큐의 {0}개 작업)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">Element jest nieprawidłowy.</target> <target state="translated">Element jest nieprawidłowy.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Włącz funkcje środowiska IDE do analizy odwołań dopuszczających wartość null</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Szacowanie (zadania w kolejce: {0})</target> <target state="translated">Szacowanie (zadania w kolejce: {0})</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">O elemento é inválido.</target> <target state="translated">O elemento é inválido.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Habilitar recursos do IDE de análise de referência que permite valor nulo</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Avaliando ({0} tarefas na fila)</target> <target state="translated">Avaliando ({0} tarefas na fila)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">Элемент недопустим.</target> <target state="translated">Элемент недопустим.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Включить функции IDE для анализа ссылок, допускающих значение NULL</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Оценка (задач в очереди: {0})</target> <target state="translated">Оценка (задач в очереди: {0})</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">Öğe geçerli değil.</target> <target state="translated">Öğe geçerli değil.</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">Boş değer atanabilir başvuru analizi IDE özelliklerini etkinleştir</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">Değerlendiriliyor (kuyrukta {0} görev var)</target> <target state="translated">Değerlendiriliyor (kuyrukta {0} görev var)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">元素无效。</target> <target state="translated">元素无效。</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">启用可为 null 的引用分析 IDE 功能</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">正在评估(队列中有 {0} 个任务)</target> <target state="translated">正在评估(队列中有 {0} 个任务)</target>
......
...@@ -97,11 +97,6 @@ ...@@ -97,11 +97,6 @@
<target state="translated">元素無效。</target> <target state="translated">元素無效。</target>
<note /> <note />
</trans-unit> </trans-unit>
<trans-unit id="Enable_nullable_reference_analysis_IDE_features">
<source>Enable nullable reference analysis IDE features</source>
<target state="translated">啟用可為 null 的參考分析 IDE 功能</target>
<note />
</trans-unit>
<trans-unit id="Evaluating_0_tasks_in_queue"> <trans-unit id="Evaluating_0_tasks_in_queue">
<source>Evaluating ({0} tasks in queue)</source> <source>Evaluating ({0} tasks in queue)</source>
<target state="translated">正在評估 (佇列中的 {0} 工作)</target> <target state="translated">正在評估 (佇列中的 {0} 工作)</target>
......
...@@ -81,22 +81,6 @@ protected void BindToOption(CheckBox checkbox, Option<int> optionKey) ...@@ -81,22 +81,6 @@ protected void BindToOption(CheckBox checkbox, Option<int> optionKey)
_bindingExpressions.Add(bindingExpression); _bindingExpressions.Add(bindingExpression);
} }
protected void BindTristateToOption(CheckBox checkbox, Option<int> optionKey)
{
Debug.Assert(checkbox.IsThreeState);
var binding = new Binding()
{
Source = new OptionBinding<int>(OptionStore, optionKey),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Default,
Converter = new CheckBoxTristateCheckedToIntConverter(),
};
var bindingExpression = checkbox.SetBinding(CheckBox.IsCheckedProperty, binding);
_bindingExpressions.Add(bindingExpression);
}
protected void BindToOption(CheckBox checkbox, PerLanguageOption<bool> optionKey, string languageName) protected void BindToOption(CheckBox checkbox, PerLanguageOption<bool> optionKey, string languageName)
{ {
var binding = new Binding() var binding = new Binding()
...@@ -212,27 +196,4 @@ public class CheckBoxCheckedToIntConverter : IValueConverter ...@@ -212,27 +196,4 @@ public class CheckBoxCheckedToIntConverter : IValueConverter
return value.Equals(true) ? 1 : -1; return value.Equals(true) ? 1 : -1;
} }
} }
public class CheckBoxTristateCheckedToIntConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || value.Equals(0))
{
return null;
}
return !value.Equals(-1);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return 0;
}
return value.Equals(true) ? 1 : -1;
}
}
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.CodeAnalysis.Utilities
{
internal static class CompilerFeatureFlags
{
public const string RunNullableAnalysis = "run-nullable-analysis";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册