Skip to content

Program to take ParsedCommandLine as config instead of separate options, root names, diagnostics etc #999

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 4 commits into from
Jun 3, 2025

Conversation

sheetalkamat
Copy link
Member

No description provided.

@sheetalkamat sheetalkamat marked this pull request as ready for review May 30, 2025 22:32
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 the codebase to use a unified ParsedCommandLine struct in place of separate compiler options, root file lists, and diagnostics across compiler creation and test harness logic.

  • Pass a single ParsedCommandLine config object into NewProgram and related functions.
  • Update ProgramOptions and remove NewProgramFromParsedCommandLine.
  • Adjust test utilities and runner components to construct or forward the new config type.

Reviewed Changes

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

Show a summary per file
File Description
internal/tsoptions/parsedcommandline.go Removed commented-out legacy TypeAquisition field
internal/testutil/tsbaseline/js_emit_baseline.go Updated compileDeclarationFiles call to include an extra nil argument for new tsconfig parameter
internal/testutil/harnessutil/harnessutil.go Changed CompileFiles/CompileFilesEx to accept and inline a ParsedCommandLine instance
internal/testrunner/compiler_runner.go Renamed tsConfigOptions to tsConfig and forwarded the new config pointer
internal/project/project.go Introduced programConfig caching field and invalidated it on relevant project updates
internal/execute/watch.go Replaced NewProgramFromParsedCommandLine with NewProgram using ProgramOptions
internal/execute/tsc.go Updated program instantiation to use the new ProgramOptions struct
internal/execute/export_test.go Applied same replacement in export tests
internal/compiler/program_test.go Refactored tests to supply ParsedCommandLine rather than separate root files and options
internal/compiler/program.go Simplified ProgramOptions to only include Config and removed deprecated fields
internal/checker/checker_test.go Updated checker tests to use ProgramOptions{Config: …}
Comments suppressed due to low confidence (2)

internal/compiler/program_test.go:301

  • [nitpick] The variable name opts here shadows the earlier opts used for core.CompilerOptions and mixes distinct types. Consider renaming this to progOpts or similar for clarity.
opts := ProgramOptions{

internal/execute/watch.go:37

  • [nitpick] This commented-out call looks outdated after replacing program initialization; consider removing the stale // updateProgram() comment.
// updateProgram()

@sheetalkamat sheetalkamat added this pull request to the merge queue Jun 3, 2025
Merged via the queue into main with commit bd9d43f Jun 3, 2025
23 checks passed
@sheetalkamat sheetalkamat deleted the parsedCommandLine branch June 3, 2025 23:23
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.

2 participants