Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy api used only by vs4mac. #73724

Merged
merged 1 commit into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

17 changes: 4 additions & 13 deletions src/Workspaces/Core/Portable/Workspace/Solution/ProjectState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,9 @@ private StructuredAnalyzerConfigOptions GetOptions(in AnalyzerConfigOptionsCache
}

var filePath = GetEffectiveFilePath(documentState);
if (filePath == null)
{
return StructuredAnalyzerConfigOptions.Empty;
}

var legacyDocumentOptionsProvider = services.GetService<ILegacyDocumentOptionsProvider>();
if (legacyDocumentOptionsProvider != null)
{
return StructuredAnalyzerConfigOptions.Create(legacyDocumentOptionsProvider.GetOptions(projectState.Id, filePath));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was working in this method, trying to understand the contract of what it returned (like if it would always return a cached vlaue once computed). this was hte only codepath that always returned a new instance. But it seems to only be for VS4Mac. so we can reomve that api and this code here.

}

return GetOptionsForSourcePath(cache, filePath);
return filePath == null
? StructuredAnalyzerConfigOptions.Empty
: GetOptionsForSourcePath(cache, filePath);
}

public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)
Expand Down Expand Up @@ -490,7 +481,7 @@ private readonly struct AnalyzerConfigOptionsCache(AnalyzerConfigSet configSet)
{
private readonly ConcurrentDictionary<string, AnalyzerConfigData> _sourcePathToResult = [];
private readonly Func<string, AnalyzerConfigData> _computeFunction = path => new AnalyzerConfigData(configSet.GetOptionsForSourcePath(path));
private readonly Lazy<AnalyzerConfigData> _global = new Lazy<AnalyzerConfigData>(() => new AnalyzerConfigData(configSet.GlobalConfigOptions));
private readonly Lazy<AnalyzerConfigData> _global = new(() => new AnalyzerConfigData(configSet.GlobalConfigOptions));

public AnalyzerConfigData GlobalConfigOptions
=> _global.Value;
Expand Down
Loading