未验证 提交 ea5cb41b 编写于 作者: M Manish Vasani 提交者: GitHub

Merge pull request #39980 from mavasani/MoveType

Move the ClosedFileDiagnostic option used by TS back to Features layer
using System;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.SolutionCrawler;
namespace Microsoft.CodeAnalysis.Shared.Options
{
......@@ -9,8 +10,6 @@ internal static class ServiceFeatureOnOffOptions
/// This option is used by TypeScript.
/// </summary>
[Obsolete("Currently used by TypeScript - should move to 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"));
public static readonly PerLanguageOption<bool?> ClosedFileDiagnostic = SolutionCrawlerOptions.ClosedFileDiagnostic;
}
}
......@@ -13,7 +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 SolutionCrawlerOptions.BackgroundAnalysisScopeOption")]
public static PerLanguageOption<bool?> ClosedFileDiagnostic => Microsoft.CodeAnalysis.Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic;
[Obsolete("Currently used by F# - should move to the new option SolutionCrawlerOptions.BackgroundAnalysisScopeOption")]
public static PerLanguageOption<bool?> ClosedFileDiagnostic => SolutionCrawlerOptions.ClosedFileDiagnostic;
}
}
// 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 System;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Options;
namespace Microsoft.CodeAnalysis.SolutionCrawler
{
......@@ -14,6 +14,14 @@ internal static class SolutionCrawlerOptions
nameof(SolutionCrawlerOptions), nameof(BackgroundAnalysisScopeOption), defaultValue: BackgroundAnalysisScope.Default,
storageLocations: new RoamingProfileStorageLocation($"TextEditor.%LANGUAGE%.Specific.BackgroundAnalysisScopeOption"));
/// <summary>
/// This option is used by TypeScript and F#.
/// </summary>
[Obsolete("Currently used by TypeScript and F# - should move to the new option SolutionCrawlerOptions.BackgroundAnalysisScopeOption")]
internal static readonly PerLanguageOption<bool?> ClosedFileDiagnostic = new PerLanguageOption<bool?>(
"ServiceFeaturesOnOff", "Closed File Diagnostic", defaultValue: null,
storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.Closed File Diagnostic"));
/// <summary>
/// Enables forced <see cref="BackgroundAnalysisScope.Minimal"/> scope when low VM is detected to improve performance.
/// </summary>
......@@ -37,7 +45,7 @@ public static BackgroundAnalysisScope GetBackgroundAnalysisScope(OptionSet optio
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);
var option = options.GetOption(ClosedFileDiagnostic, language);
#pragma warning restore CS0618 // Type or member is obsolete
// Note that the default value for this option is 'true' for these languages.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册