Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Processing diagnostics are now accumulated on tasks during file loading rather than directly added to includeProcessor. The includeProcessor is created locally in getProcessedFiles() where task diagnostics are consolidated.

Changes

  • resolveTypeReferenceDirectives(): Append unresolved reference diagnostics to task.processingDiagnostics instead of calling includeProcessor.addProcessingDiagnostic()
  • parseTask.load(): Append lib reference diagnostics to task.processingDiagnostics instead of calling includeProcessor.addProcessingDiagnostic()
  • fileLoader: Remove includeProcessor field
  • getProcessedFiles(): Create local includeProcessor variable and pass it to addIncludeReason() instead of accessing via loader
// Before
p.includeProcessor.addProcessingDiagnostic(&processingDiagnostic{
    kind: processingDiagnosticKindUnknownReference,
    data: includeReason,
})

// After
t.processingDiagnostics = append(t.processingDiagnostics, &processingDiagnostic{
    kind: processingDiagnosticKindUnknownReference,
    data: includeReason,
})

This maintains task-level diagnostic ownership during parsing and consolidates them only when assembling the final processedFiles result.

Original prompt

Instead of using includeProcessor.addProcessingDiagnostic from resolveTypeReferenceDirectives store it on task


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…var in getProcessedFiles

Co-authored-by: sheetalkamat <8052792+sheetalkamat@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor resolveTypeReferenceDirectives to store diagnostics on task Store processing diagnostics on task instead of includeProcessor during file loading Dec 4, 2025
Copilot AI requested a review from sheetalkamat December 4, 2025 20:01
Copilot finished work on behalf of sheetalkamat December 4, 2025 20:01
@sheetalkamat sheetalkamat marked this pull request as ready for review December 4, 2025 20:29
Copilot finished reviewing on behalf of sheetalkamat December 4, 2025 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors how processing diagnostics are collected during file loading by storing them on individual tasks rather than directly on a shared includeProcessor instance. The includeProcessor is now created locally when needed and populated from task diagnostics.

Key Changes

  • Processing diagnostics are accumulated on parseTask instances during file loading
  • includeProcessor is created locally in getProcessedFiles() where task diagnostics are consolidated
  • The fileLoader no longer maintains an includeProcessor field

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/compiler/fileloader.go Removed includeProcessor field from fileLoader struct and updated resolveTypeReferenceDirectives() to append diagnostics to task instead
internal/compiler/filesparser.go Updated parseTask.load() to store diagnostics on task, created local includeProcessor in getProcessedFiles(), and updated addIncludeReason() to accept includeProcessor parameter

@sheetalkamat sheetalkamat added this pull request to the merge queue Dec 4, 2025
Merged via the queue into main with commit 2ae4101 Dec 4, 2025
48 checks passed
@sheetalkamat sheetalkamat deleted the copilot/refactor-resolve-type-reference-directives branch December 4, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants