提交 e8b998b8 编写于 作者: M Manish Vasani

Re-add ServiceFeatureOnOffOptions.ClosedFileDiagnostic to fix the break for TS and F#

Recent PR #39699 introduced a breaking API and functionality change for TypeScript and F# as they are using our internal option ClosedFileDiagnostics for controlling their full solution analysis experience. This PR restores the ClosedFileDiagnostics option and functionality for non C#/VB languages. Additionally, the newly added option SolutionCrawlerOptions.BackgroundAnalysisScope has been made a per-language option so that all languages can have different UI/setting for this option.
上级 59cd90fd
......@@ -53,7 +53,7 @@ public async Task TestHasSuccessfullyLoadedBeingFalse()
public async Task TestHasSuccessfullyLoadedBeingFalseFSAOn()
{
var workspace = new AdhocWorkspace();
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution);
var document = GetDocumentFromIncompleteProject(workspace);
// open document
......@@ -90,7 +90,7 @@ public async Task TestHasSuccessfullyLoadedBeingFalseWhenFileOpenedWithCompilerA
public async Task TestHasSuccessfullyLoadedBeingFalseWithCompilerAnalyzerFSAOn()
{
var workspace = new AdhocWorkspace();
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution);
var document = GetDocumentFromIncompleteProject(workspace);
await TestAnalyzerAsync(workspace, document, new CSharpCompilerDiagnosticAnalyzer(), CompilerAnalyzerResultSetter, expectedSyntax: true, expectedSemantic: false);
......@@ -305,7 +305,7 @@ public async Task TestHostAnalyzerErrorNotLeaking()
loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")),
filePath: "test.cs")}));
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution);
// create listener/service/analyzer
var listener = new AsynchronousOperationListener();
......
......@@ -389,12 +389,12 @@ public async Task Test_BackgroundAnalysisScopeOptionChanged_ActiveFile()
MakeFirstDocumentActive(workspace.CurrentSolution.Projects.First());
await WaitWaiterAsync(workspace.ExportProvider);
Assert.Equal(BackgroundAnalysisScope.Default, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options));
Assert.Equal(BackgroundAnalysisScope.Default, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options, LanguageNames.CSharp));
var newAnalysisScope = BackgroundAnalysisScope.ActiveFile;
var worker = await ExecuteOperation(workspace, w => w.Options = w.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, newAnalysisScope));
var worker = await ExecuteOperation(workspace, w => w.Options = w.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, newAnalysisScope));
Assert.Equal(newAnalysisScope, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options));
Assert.Equal(newAnalysisScope, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options, LanguageNames.CSharp));
Assert.Equal(1, worker.SyntaxDocumentIds.Count);
Assert.Equal(1, worker.DocumentIds.Count);
Assert.Equal(1, worker.ProjectIds.Count);
......@@ -408,12 +408,12 @@ public async Task Test_BackgroundAnalysisScopeOptionChanged_FullSolution()
workspace.OnSolutionAdded(solutionInfo);
await WaitWaiterAsync(workspace.ExportProvider);
Assert.Equal(BackgroundAnalysisScope.Default, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options));
Assert.Equal(BackgroundAnalysisScope.Default, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options, LanguageNames.CSharp));
var newAnalysisScope = BackgroundAnalysisScope.FullSolution;
var worker = await ExecuteOperation(workspace, w => w.Options = w.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, newAnalysisScope));
var worker = await ExecuteOperation(workspace, w => w.Options = w.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, newAnalysisScope));
Assert.Equal(newAnalysisScope, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options));
Assert.Equal(newAnalysisScope, SolutionCrawlerOptions.GetBackgroundAnalysisScope(workspace.Options, LanguageNames.CSharp));
Assert.Equal(10, worker.SyntaxDocumentIds.Count);
Assert.Equal(10, worker.DocumentIds.Count);
Assert.Equal(2, worker.ProjectIds.Count);
......@@ -1391,7 +1391,7 @@ public WorkCoordinatorWorkspace(string workspaceKind = null, bool disablePartial
public static WorkCoordinatorWorkspace CreateWithAnalysisScope(BackgroundAnalysisScope analysisScope, string workspaceKind = null, bool disablePartialSolutions = true)
{
var workspace = new WorkCoordinatorWorkspace(workspaceKind, disablePartialSolutions);
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, analysisScope);
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, analysisScope);
return workspace;
}
......
......@@ -280,7 +280,8 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
If Not enabled Then
workspace.Options = workspace.Options _
.WithChangedOption(ServiceComponentOnOffOptions.DiagnosticProvider, False) _
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.Default)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.Default) _
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.VisualBasic, BackgroundAnalysisScope.Default)
End If
Dim registrationService = workspace.Services.GetService(Of ISolutionCrawlerRegistrationService)()
......
......@@ -1984,7 +1984,7 @@ class MyClass
</Workspace>
Using workspace = TestWorkspace.CreateWorkspace(test)
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution)
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution)
Dim project = workspace.CurrentSolution.Projects.Single()
......
......@@ -84,7 +84,10 @@ public bool NeedsReanalysisOnOptionChanged(object sender, OptionChangedEventArgs
{
return e.Option.Feature == nameof(SimplificationOptions) ||
e.Option.Feature == nameof(CodeStyleOptions) ||
e.Option == SolutionCrawlerOptions.BackgroundAnalysisScopeOption;
e.Option == SolutionCrawlerOptions.BackgroundAnalysisScopeOption ||
#pragma warning disable CS0618 // Type or member is obsolete - TypeScript and F# are still on the older ClosedFileDiagnostic option.
e.Option == ServiceFeatureOnOffOptions.ClosedFileDiagnostic;
#pragma warning restore CS0618 // Type or member is obsolete
}
private void OnProjectAnalyzerReferenceChanged(object sender, ProjectAnalyzerReferenceChangedEventArgs e)
......
......@@ -106,7 +106,7 @@ public void Enqueue(WorkItem item)
Contract.ThrowIfNull(item.DocumentId);
var options = _registration.Workspace.Options;
var analysisScope = SolutionCrawlerOptions.GetBackgroundAnalysisScope(options);
var analysisScope = SolutionCrawlerOptions.GetBackgroundAnalysisScope(options, item.Language);
if (ShouldEnqueueForAllQueues(item, analysisScope))
{
......
......@@ -212,8 +212,7 @@ private void OnActiveDocumentChanged(object sender, DocumentId activeDocumentId)
var solution = _registration.Workspace.CurrentSolution;
// Check if we are only performing backgroung analysis for active file.
if (SolutionCrawlerOptions.GetBackgroundAnalysisScope(solution.Options) == BackgroundAnalysisScope.ActiveFile &&
activeDocumentId != null)
if (activeDocumentId != null)
{
// Change to active document needs to trigger following events in active file analysis scope:
// 1. Request analysis for newly active file, similar to a newly opened file.
......@@ -223,7 +222,8 @@ private void OnActiveDocumentChanged(object sender, DocumentId activeDocumentId)
// As soon as user switches to a source document, we will perform the appropriate analysis callbacks
// on the next active document changed event.
var activeDocument = solution.GetDocument(activeDocumentId);
if (activeDocument != null)
if (activeDocument != null &&
SolutionCrawlerOptions.GetBackgroundAnalysisScope(activeDocument.Project) == BackgroundAnalysisScope.ActiveFile)
{
lock (_gate)
{
......
......@@ -100,15 +100,6 @@ private void Rebuild(Solution solution, ProjectId initialProject = null)
// build the current compilations without rebuilding the entire DeclarationTable
CancelBuild(releasePreviousCompilations: false);
if (SolutionCrawlerOptions.GetBackgroundAnalysisScope(solution.Options) == BackgroundAnalysisScope.ActiveFile)
{
// Avoid performing any background compilation if the user has explicitly
// set the background analysis scope to only analyze active files.
// Note that we bail out after executing CancelBuild to ensure
// all the current background compilation tasks are cancelled.
return;
}
var allProjects = _workspace.GetOpenDocumentIds().Select(d => d.ProjectId).ToSet();
// don't even get started if there is nothing to do
......@@ -160,7 +151,13 @@ private void CancelBuild(bool releasePreviousCompilations)
var logger = Logger.LogBlock(FunctionId.BackgroundCompiler_BuildCompilationsAsync, cancellationToken);
var compilationTasks = allProjectIds.Select(solution.GetProject).Where(p => p != null).Select(p => p.GetCompilationAsync(cancellationToken)).ToArray();
// Skip performing any background compilation for projects where user has explicitly
// set the background analysis scope to only analyze active files.
var compilationTasks = allProjectIds
.Select(solution.GetProject)
.Where(p => p != null && SolutionCrawlerOptions.GetBackgroundAnalysisScope(p) != BackgroundAnalysisScope.ActiveFile)
.Select(p => p.GetCompilationAsync(cancellationToken))
.ToArray();
return Task.WhenAll(compilationTasks).SafeContinueWith(t =>
{
logger.Dispose();
......
......@@ -38,7 +38,8 @@ internal async Task RunAsync(Workspace workspace, CancellationToken cancellation
workspace.Options = workspace.Options
.WithChangedOption(StorageOptions.SolutionSizeThreshold, _options.UsePersistentStorage ? 0 : int.MaxValue)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, _options.AnalysisScope);
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, _options.AnalysisScope)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.VisualBasic, _options.AnalysisScope);
if (!string.IsNullOrEmpty(_options.ProfileRoot))
{
......
......@@ -13,9 +13,7 @@ internal static class FSharpServiceFeatureOnOffOptions
/// this option doesn't mean we will show all diagnostics that belong to opened files when turned off,
/// rather it means we will only show diagnostics that are cheap to calculate for small scope such as opened files.
/// </summary>
[Obsolete("Use the new option FSharpServiceFeatureOnOffOptions.BackgroundAnalysisScope'")]
public static PerLanguageOption<bool?> ClosedFileDiagnostic => new PerLanguageOption<bool?>("FSharpServiceFeatureOnOffOptions", "Closed File Diagnostic", defaultValue: null);
public static Option<BackgroundAnalysisScope> BackgroundAnalysisScope => SolutionCrawlerOptions.BackgroundAnalysisScopeOption;
[Obsolete("Use the new option SolutionCrawlerOptions.BackgroundAnalysisScopeOption")]
public static PerLanguageOption<bool?> ClosedFileDiagnostic => Microsoft.CodeAnalysis.Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic;
}
}
......@@ -23,9 +23,9 @@ public AdvancedOptionPageControl(OptionStore optionStore) : base(optionStore)
{
InitializeComponent();
BindToOption(Background_analysis_scope_active_file, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.ActiveFile);
BindToOption(Background_analysis_scope_open_files, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.OpenFilesAndProjects);
BindToOption(Background_analysis_scope_full_solution, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
BindToOption(Background_analysis_scope_active_file, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.ActiveFile, LanguageNames.CSharp);
BindToOption(Background_analysis_scope_open_files, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.OpenFilesAndProjects, LanguageNames.CSharp);
BindToOption(Background_analysis_scope_full_solution, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution, LanguageNames.CSharp);
BindToOption(Enable_navigation_to_decompiled_sources, FeatureOnOffOptions.NavigateToDecompiledSources);
BindToOption(Use_editorconfig_compatibility_mode, EditorConfigDocumentOptionsProviderFactory.UseLegacyEditorConfigSupport);
......
......@@ -121,7 +121,7 @@ private bool ShouldDisableBackgroundAnalysis(long availableMemory)
// 3. Background analysis memory monitor is on (user can set it off using registry to prevent turning off background analysis)
return availableMemory < MemoryThreshold &&
SolutionCrawlerOptions.GetBackgroundAnalysisScope(_workspace.Options) != BackgroundAnalysisScope.Minimal &&
!SolutionCrawlerOptions.LowMemoryForcedMinimalBackgroundAnalysis &&
_workspace.Options.GetOption(InternalFeatureOnOffOptions.BackgroundAnalysisMemoryMonitor);
}
......
......@@ -120,21 +120,6 @@ protected void BindToOption(TextBox textBox, PerLanguageOption<int> optionKey, s
_bindingExpressions.Add(bindingExpression);
}
protected void BindToOption<T>(RadioButton radiobutton, Option<T> optionKey, T optionValue)
{
var binding = new Binding()
{
Source = new OptionBinding<T>(OptionStore, optionKey),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Default,
Converter = new RadioButtonCheckedConverter(),
ConverterParameter = optionValue
};
var bindingExpression = radiobutton.SetBinding(RadioButton.IsCheckedProperty, binding);
_bindingExpressions.Add(bindingExpression);
}
protected void BindToOption<T>(RadioButton radiobutton, PerLanguageOption<T> optionKey, T optionValue, string languageName)
{
var binding = new Binding()
......
......@@ -235,7 +235,8 @@ public async Task TestRequestNewRemoteHost()
{
workspace = workspace ?? new AdhocWorkspace(TestHostServices.CreateHostServices());
workspace.Options = workspace.Options.WithChangedOption(RemoteHostOptions.RemoteHostTest, true)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.VisualBasic, BackgroundAnalysisScope.FullSolution);
var analyzerService = GetDiagnosticAnalyzerService(hostAnalyzerReferences ?? SpecializedCollections.EmptyEnumerable<AnalyzerReference>());
......
......@@ -271,7 +271,8 @@ private TestWorkspace CreateWorkspace(string language, string code, ParseOptions
TestWorkspace.CreateVisualBasic(code, parseOptions: options, exportProvider: TestHostServices.CreateExportProvider());
workspace.Options = workspace.Options.WithChangedOption(RemoteHostOptions.RemoteHostTest, true)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution);
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution)
.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.VisualBasic, BackgroundAnalysisScope.FullSolution);
return workspace;
}
......
......@@ -253,7 +253,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
Dim waiter = New AsynchronousOperationListener()
' turn on FSA
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution)
workspace.Options = workspace.Options.WithChangedOption(SolutionCrawlerOptions.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution)
Dim project = workspace.CurrentSolution.Projects.First()
......
......@@ -73,9 +73,16 @@ public void SetImportCompletionOption(bool value)
public void SetFullSolutionAnalysis(bool value)
{
SetOption(
SetPerLanguageOption(
optionName: SolutionCrawlerOptions.BackgroundAnalysisScopeOption.Name,
feature: SolutionCrawlerOptions.BackgroundAnalysisScopeOption.Feature,
language: LanguageNames.CSharp,
value: value ? BackgroundAnalysisScope.FullSolution : BackgroundAnalysisScope.Default);
SetPerLanguageOption(
optionName: SolutionCrawlerOptions.BackgroundAnalysisScopeOption.Name,
feature: SolutionCrawlerOptions.BackgroundAnalysisScopeOption.Feature,
language: LanguageNames.VisualBasic,
value: value ? BackgroundAnalysisScope.FullSolution : BackgroundAnalysisScope.Default);
}
......
......@@ -22,9 +22,9 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options
InitializeComponent()
BindToOption(Background_analysis_scope_active_file, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.ActiveFile)
BindToOption(Background_analysis_scope_open_files, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.OpenFilesAndProjects)
BindToOption(Background_analysis_scope_full_solution, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution)
BindToOption(Background_analysis_scope_active_file, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.ActiveFile, LanguageNames.VisualBasic)
BindToOption(Background_analysis_scope_open_files, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.OpenFilesAndProjects, LanguageNames.VisualBasic)
BindToOption(Background_analysis_scope_full_solution, SolutionCrawlerOptions.BackgroundAnalysisScopeOption, BackgroundAnalysisScope.FullSolution, LanguageNames.VisualBasic)
BindToOption(Use_editorconfig_compatibility_mode, EditorConfigDocumentOptionsProviderFactory.UseLegacyEditorConfigSupport)
BindToOption(PlaceSystemNamespaceFirst, GenerationOptions.PlaceSystemNamespaceFirst, LanguageNames.VisualBasic)
......
using System;
using Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.Shared.Options
{
internal static class ServiceFeatureOnOffOptions
{
/// <summary>
/// This option is used by TypeScript.
/// </summary>
[Obsolete("Use the new option SolutionCrawlerOptions.BackgroundAnalysisScopeOption")]
public static readonly PerLanguageOption<bool?> ClosedFileDiagnostic = new PerLanguageOption<bool?>(
"ServiceFeaturesOnOff", "Closed File Diagnostic", defaultValue: null,
storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.Closed File Diagnostic"));
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Options;
namespace Microsoft.CodeAnalysis.SolutionCrawler
{
......@@ -9,9 +10,9 @@ internal static class SolutionCrawlerOptions
/// <summary>
/// Option to turn configure background analysis scope.
/// </summary>
public static readonly Option<BackgroundAnalysisScope> BackgroundAnalysisScopeOption = new Option<BackgroundAnalysisScope>(
public static readonly PerLanguageOption<BackgroundAnalysisScope> BackgroundAnalysisScopeOption = new PerLanguageOption<BackgroundAnalysisScope>(
nameof(SolutionCrawlerOptions), nameof(BackgroundAnalysisScopeOption), defaultValue: BackgroundAnalysisScope.Default,
storageLocations: new RoamingProfileStorageLocation($"TextEditor.BackgroundAnalysisScopeOption"));
storageLocations: new RoamingProfileStorageLocation($"TextEditor.%LANGUAGE%.Specific.BackgroundAnalysisScopeOption"));
/// <summary>
/// Enables forced <see cref="BackgroundAnalysisScope.Minimal"/> scope when low VM is detected to improve performance.
......@@ -19,16 +20,34 @@ internal static class SolutionCrawlerOptions
public static bool LowMemoryForcedMinimalBackgroundAnalysis = false;
public static BackgroundAnalysisScope GetBackgroundAnalysisScope(Project project)
=> GetBackgroundAnalysisScope(project.Solution.Options);
=> GetBackgroundAnalysisScope(project.Solution.Options, project.Language);
public static BackgroundAnalysisScope GetBackgroundAnalysisScope(OptionSet options)
public static BackgroundAnalysisScope GetBackgroundAnalysisScope(OptionSet options, string language)
{
if (LowMemoryForcedMinimalBackgroundAnalysis)
{
return BackgroundAnalysisScope.Minimal;
}
return options.GetOption(BackgroundAnalysisScopeOption);
switch (language)
{
case LanguageNames.CSharp:
case LanguageNames.VisualBasic:
return options.GetOption(BackgroundAnalysisScopeOption, language);
default:
#pragma warning disable CS0618 // Type or member is obsolete - TypeScript and F# are still on the older ClosedFileDiagnostic option.
var option = options.GetOption(ServiceFeatureOnOffOptions.ClosedFileDiagnostic, language);
#pragma warning restore CS0618 // Type or member is obsolete
// Note that the default value for this option is 'true' for these languages.
if (!option.HasValue || option.Value)
{
return BackgroundAnalysisScope.FullSolution;
}
return BackgroundAnalysisScope.Default;
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册