Skip to content

Commit

Permalink
Remove argument that was always passed the same value
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Feb 5, 2025
1 parent 40ec700 commit c5480f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public async Task<DiagnosticAnalysisResult> GetAnalysisDataAsync(Project project
/// <summary>
/// Return all diagnostics for the given document stored in this state including non local diagnostics for this document
/// </summary>
public async Task<DiagnosticAnalysisResult> GetAnalysisDataAsync(TextDocument document, bool avoidLoadingData, CancellationToken cancellationToken)
public async Task<DiagnosticAnalysisResult> GetAnalysisDataAsync(TextDocument document, CancellationToken cancellationToken)
{
// make a copy of last result.
var lastResult = _lastResult;
Expand All @@ -125,10 +125,6 @@ public async Task<DiagnosticAnalysisResult> GetAnalysisDataAsync(TextDocument do
}

var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false);
if (avoidLoadingData && lastResult.Version != version)
{
return lastResult;
}

// if given document doesnt have any diagnostics, return empty.
if (IsEmpty(lastResult, document.Id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task<bool> OnDocumentOpenedAsync(TextDocument document)
return false;
}

var result = await projectState.GetAnalysisDataAsync(document, avoidLoadingData: false, CancellationToken.None).ConfigureAwait(false);
var result = await projectState.GetAnalysisDataAsync(document, CancellationToken.None).ConfigureAwait(false);
var text = await document.GetValueTextAsync(CancellationToken.None).ConfigureAwait(false);

// store analysis result to active file state:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static async Task<ImmutableArray<DiagnosticData>> GetProjectStateDiagnos
return [];
}

var result = await state.GetAnalysisDataAsync(document, avoidLoadingData: false, cancellationToken).ConfigureAwait(false);
var result = await state.GetAnalysisDataAsync(document, cancellationToken).ConfigureAwait(false);
return result.GetDocumentDiagnostics(documentId, kind);
}

Expand Down

0 comments on commit c5480f8

Please sign in to comment.