Skip to content

Remove compiler runner libFiles option entirely - #63060

Merged
Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
jakebailey:remove-libFiles
Jan 28, 2026
Merged

Remove compiler runner libFiles option entirely#63060
Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
jakebailey:remove-libFiles

Conversation

@jakebailey

Copy link
Copy Markdown
Member

We've had two ways to include things from /.lib; @libFiles: react.d.ts and /// <reference path="/.lib/react.d.ts" />. We use the former 93 times, and the latter 220 times.

I think it'd be best to get rid of this special option and just use plain references, now that we don't use @libFiles: lib.d.ts after #63056.

Only sucky thing is that it changes positions and therefore a lot of baselines change.

Copilot AI review requested due to automatic review settings January 28, 2026 20:14
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Jan 28, 2026
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes the @libFiles compiler test runner option in favor of using standard /// <reference path="/.lib/..." /> directives. This consolidates the two methods previously available for including library files from /tests/lib, standardizing on the reference directive approach which was already more widely used (220 times vs 93 times for @libFiles).

Changes:

  • Removed libFiles option from test harness infrastructure
  • Updated test baselines to reflect new reference directive positioning
  • Modified baseline output to preserve full test paths instead of removing prefixes

Reviewed changes

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

Show a summary per file
File Description
src/harness/harnessIO.ts Removed libFiles option from test harness and updated file output formatting
tests/baselines/reference/*.errors.txt Updated error line numbers due to added reference directives
tests/baselines/reference/*.types Updated type baseline line numbers
tests/baselines/reference/*.symbols Updated symbol baseline line numbers
tests/baselines/reference/*.js Added /// <reference path="/.lib/..." /> directives to compiled output

Comment thread src/harness/harnessIO.ts

function fileOutput(file: documents.TextDocument, harnessSettings: TestCaseParser.CompilerSettings): string {
const fileName = harnessSettings.fullEmitPaths ? Utils.removeTestPathPrefixes(file.file) : ts.getBaseFileName(file.file);
return "//// [" + fileName + "]\r\n" + Utils.removeTestPathPrefixes(file.text);

@jakebailey Jake Bailey (jakebailey) Jan 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was mistakenly changing paths in emitted reference directives, leaving them in a confusingly broken state. See the first commit for examples.


//// [jsxDeclarationsWithEsModuleInteropNoCrash.d.ts]
/// <reference path="..react16.d.ts" preserve="true" />
/// <reference path="../.lib/react16.d.ts" preserve="true" />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was broken before due to an overzealous replacement.

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Jan 28, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Jan 28, 2026
Merged via the queue into microsoft:main with commit c1592ad Jan 28, 2026
33 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the remove-libFiles branch January 28, 2026 21:05
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Jan 28, 2026
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants