Skip to content

Fix listFiles/listFilesOnly #964

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

Merged
merged 3 commits into from
May 28, 2025
Merged

Fix listFiles/listFilesOnly #964

merged 3 commits into from
May 28, 2025

Conversation

jakebailey
Copy link
Member

Fixes #963

I redid this function, copying the structure of emitFilesAndReportErrors from Strada. This now matches in behavior and --listFiles/--listFilesOnly now work.

Copy link
Contributor

@Copilot 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 file emission to use a unified emitFilesAndReportErrors workflow and ensures --listFiles/--listFilesOnly flags produce the expected output.

  • Replaced calls to compileAndEmit with emitFilesAndReportErrors in watcher and CLI paths.
  • Copied and adapted emission logic from Strada into tsc.go, including diagnostic collection and timing.
  • Added a new listFiles helper to output source file names when requested.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/execute/watcher.go Swapped compileAndEmit for emitFilesAndReportErrors
internal/execute/tsc.go Replaced emission function, updated diagnostics flow, added listFiles and imported slices
Comments suppressed due to low confidence (2)

internal/execute/tsc.go:328

  • Add unit tests for listFiles to verify correct behavior under both --listFiles and --listFilesOnly flags, ensuring coverage of the new listing functionality.
func listFiles(sys System, program *compiler.Program) {

internal/execute/tsc.go:276

  • [nitpick] Consider implementing declaration diagnostics or removing this placeholder comment to keep the codebase clean and maintainable.
// !!! GetDeclarationDiagnostics

@jakebailey jakebailey added this pull request to the merge queue May 28, 2025
Merged via the queue into main with commit 2536c79 May 28, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/fix-listfiles branch May 29, 2025 03:46
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.

listFiles/listFilesOnly don't do anything
3 participants