Skip to content

Commit

Permalink
Dropped the .?
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel authored and daveaglick committed Sep 1, 2023
1 parent 6401c00 commit 21b6d77
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Buildalyzer.Workspaces/AnalyzerResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,27 +267,27 @@ private static IEnumerable<IProjectAnalyzer> GetReferencedAnalyzerProjects(IAnal
.Where(x => x != null)
?? Array.Empty<ProjectAnalyzer>();

private static IEnumerable<DocumentInfo> GetDocuments(IAnalyzerResult analyzerResult, ProjectId projectId) =>
GetDocuments(analyzerResult.SourceFiles, projectId);
private static IEnumerable<DocumentInfo> GetDocuments(IAnalyzerResult analyzerResult, ProjectId projectId)
{
string[] sourceFiles = analyzerResult.SourceFiles ?? Array.Empty<string>();
return GetDocuments(sourceFiles, projectId);
}

private static IEnumerable<DocumentInfo> GetDocuments(IEnumerable<string> files, ProjectId projectId) =>
files?.Where(File.Exists)
files.Where(File.Exists)
.Select(x => DocumentInfo.Create(
DocumentId.CreateNewId(projectId),
Path.GetFileName(x),
loader: TextLoader.From(
TextAndVersion.Create(
SourceText.From(File.ReadAllText(x), Encoding.Unicode), VersionStamp.Create())),
filePath: x))
?? Array.Empty<DocumentInfo>();
filePath: x));

private static IEnumerable<DocumentInfo> GetAdditionalDocuments(IAnalyzerResult analyzerResult, ProjectId projectId)
{
string projectDirectory = Path.GetDirectoryName(analyzerResult.ProjectFilePath);

return GetDocuments(
analyzerResult.AdditionalFiles?.Select(x => Path.Combine(projectDirectory, x)),
projectId);
string[] additionalFiles = analyzerResult.AdditionalFiles ?? Array.Empty<string>();
return GetDocuments(additionalFiles.Select(x => Path.Combine(projectDirectory, x)), projectId);
}

private static IEnumerable<MetadataReference> GetMetadataReferences(IAnalyzerResult analyzerResult) =>
Expand Down

0 comments on commit 21b6d77

Please sign in to comment.