提交 7514e0d1 编写于 作者: M Manish Vasani

Simplify code

上级 04d7c720
......@@ -75,7 +75,7 @@ internal partial class CodeFixService : ForegroundThreadAffinitizedObject, ICode
var fixersPerLanguageMap = fixers.ToPerLanguageMapWithMultipleLanguages();
var configurationProvidersPerLanguageMap = configurationProviders.ToPerLanguageMapWithMultipleLanguages();
_getWorkspaceFixersMap = workspace => GetFixerPerLanguageMap(fixersPerLanguageMap, null, workspace);
_getWorkspaceFixersMap = workspace => GetFixerPerLanguageMap(fixersPerLanguageMap, workspace);
_configurationProvidersMap = GetConfigurationProvidersPerLanguageMap(configurationProvidersPerLanguageMap);
// REVIEW: currently, fixer's priority is statically defined by the fixer itself. might considering making it more dynamic or configurable.
......@@ -814,10 +814,10 @@ private static ImmutableArray<string> GetAndTestFixableDiagnosticIds(CodeFixProv
private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap(
Dictionary<LanguageKind, List<Lazy<CodeFixProvider, CodeChangeProviderMetadata>>> fixersPerLanguage,
IExtensionManager? extensionManager,
Workspace workspace)
{
var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>();
var extensionManager = workspace.Services.GetService<IExtensionManager>();
foreach (var languageKindAndFixers in fixersPerLanguage)
{
var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() =>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册