Skip to content

Fix parsing of commandline string array #1565

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
Aug 12, 2025
Merged

Fix parsing of commandline string array #1565

merged 3 commits into from
Aug 12, 2025

Conversation

sheetalkamat
Copy link
Member

Discovered that we were not handling parsing of say --typeRoots in tests which was because of making []string instead of []any which is what parseCompilerOptions expects

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 fixes the parsing of command-line string array options like --typeRoots in tests by correcting the type conversion from []string to []any that the parseCompilerOptions function expects.

  • Fixed the list type parsing functions to return []any instead of []string
  • Updated file path handling logic to properly check if an option's elements have the IsFilePath property
  • Modified test utilities to handle the new array type structure for harness options

Reviewed Changes

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

Show a summary per file
File Description
internal/tsoptions/commandlineparser.go Changed return type of list parsing functions from []string to []any and improved element type checking
internal/tsoptions/parsinghelpers.go Fixed conditional logic to check both list type and element file path properties
internal/testutil/harnessutil/harnessutil.go Updated option parsing to handle file paths in list options and modified harness option parsing
internal/incremental/snapshottobuildinfo.go Updated file path checking logic to match the new structure
internal/fourslash/fourslash.go Added missing currentDirectory parameter to function call

@sheetalkamat sheetalkamat added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit e86ed12 Aug 12, 2025
22 checks passed
@sheetalkamat sheetalkamat deleted the commanlineArray branch August 12, 2025 05:13
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