GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep track of why files are in the program by sheetalkamat · Pull Request #40011 · microsoft/TypeScript

Conversation

@sheetalkamat

@sheetalkamat Sheetal Nandi (sheetalkamat) commented Aug 12, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  1. Instead of keeping reference file reasons tracking, we also keep track of all reasons file is included in the program.
  2. The configFileSpecs are stored on tsconfigFile so we dont have to pass them around any more.
  3. The reasons are used to write explanations for files when new option --explainFiles is specified and program can use it too (earlier program wasnt aware of these)
  4. They are also used to report errors about the file eg its not in rootDir or doesn't match casing etc
  5. Because it is used to report errors while file processing is going on and program is still under construction, we store the metadata for errors instead of converting them in diagnostic right away. This is so we can reuse this data when program is completely reused and still give error locations at correct position.(Because the related information location can change without change but the diagnostic can be in different file)

Fixes #33515

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser, LauraBeatris, escaton, and spiffytech reacted with hooray emoji a-tarasyuk, LauraBeatris, yats, guyzmo, escaton, and muryoh reacted with heart emoji
All reactions
  • 🎉 4 reactions
  • ❤️ 6 reactions
Sheetal Nandi (sheetalkamat) added 9 commits August 11, 2020 17:07
@sheetalkamat
--explainFiles currently hardcoded
462d1c2
@sheetalkamat
Move configFileSpecs to configFile so it can be used in program later
69c404e
@sheetalkamat
Explain root file inclusion reason and explain include files in the log
8cc74e1
@sheetalkamat
Baseline explainFiles
ada028d
@sheetalkamat
Fix incorrectly reporting of file list two times in --b mode
b2f8929
@sheetalkamat
Fix unnecessary new lines in output represented incorretly in the bas…
beac081
…eline
@sheetalkamat
More tests
5761f24
@sheetalkamat
More cleaning up
ab73d96
@sheetalkamat
Keep listing files in same order as list files, just add explaination
52f9df4
@typescript-bot TypeScript Bot (typescript-bot) assigned Sheetal Nandi (sheetalkamat) Aug 12, 2020
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 12, 2020
@sheetalkamat
Merge branch 'master' into explainFiles
5287168
@sheetalkamat Sheetal Nandi (sheetalkamat) mentioned this pull request Sep 24, 2020
Fix unnecessary new lines in output represented incorrectly in the baselines #40751
Merged
Sheetal Nandi (sheetalkamat) added 15 commits September 24, 2020 13:13
@sheetalkamat
Merge branch 'master' into explainFiles
aaee0c2
@sheetalkamat
Fix double listing of file names when the program has errors
afc5293
@sheetalkamat
Make diagnostic chains for file include reason
c25b0ba
@sheetalkamat
Add explaination for the file include to diagnostics for program
0ecf2ea
@sheetalkamat
Harness ls incorrectly adding tsconfig as the root file
f5566d4
@sheetalkamat
Fix incorrect use of path for calculating absolute path
cc40fd8
@sheetalkamat
Merge branch 'master' into explainFiles
f90f7b7
@sheetalkamat
Fix the root file in fourslash
7ab1483
@sheetalkamat
Test project service options merge
f78adcf
@sheetalkamat
Add config file name to matched by include explaination
6f0f075
@sheetalkamat
Add test for when the file changes and program is reused completely b…
237809f
…ut related file information is reattached to correct location
@sheetalkamat
Handle file preprocessing diagnostics updates when program is reused …
69fd49c
…and related information location changes
@sheetalkamat
Moved types to types.ts
d79c94c
@sheetalkamat
Refactoring and cleanup
5c5a528
@sheetalkamat
More cleanup
652dbd3
@sheetalkamat
Sheetal Nandi (sheetalkamat) force-pushed the explainFiles branch from 831475a to 300c727 Compare September 30, 2020 23:15
@sheetalkamat
Merge branch 'master' into explainFiles
3a4613e
@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Dec 3, 2020

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) pack this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 3, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Sheetal Nandi (@sheetalkamat), I've started to run the tarball bundle task on this PR at 3a4613e. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat
Merge branch 'master' into explainFiles
87ca884
@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Dec 3, 2020

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) pack this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 3, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Sheetal Nandi (@sheetalkamat), I've started to run the tarball bundle task on this PR at 87ca884. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 3, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hey Sheetal Nandi (@sheetalkamat), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/90322/artifacts?artifactName=tgz&fileId=41E4437F40EC197DEB7906352B4A844350F4EE385720380498BA5240C44E9B9602&fileName=/typescript-4.2.0-insiders.20201203.tgz"
    }
}

and then running npm install.


There is also a playground for this build.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh

Ryan Cavanaugh (RyanCavanaugh) commented Dec 3, 2020

Copy link
Copy Markdown
Member

Trying on a local build just to see how it feels

D:\github\TypeScript\src\services>tsc --explainFiles
C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es5.d.ts
  Library 'lib.es5.d.ts' specified in compilerOptions
C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.generator.d.ts
  Library 'lib.es2015.generator.d.ts' specified in compilerOptions
C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.iterable.d.ts
  Library 'lib.es2015.iterable.d.ts' specified in compilerOptions
  Library referenced via 'es2015.iterable' from file 'C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.generator.d.ts'
C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.symbol.d.ts
  Library referenced via 'es2015.symbol' from file 'C:/Users/Ryan/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.iterable.d.ts'
../../built/local/shims.d.ts
  Output from referenced project '../shims/tsconfig.json' included because '--outFile' specified
../../node_modules/@types/microsoft__typescript-etw/index.d.ts
  Imported via "@microsoft/typescript-etw" from file '../../built/local/compiler.d.ts' with packageId '@types/microsoft__typescript-etw/[email protected]'
../../built/local/compiler.d.ts
  Output from referenced project '../compiler/tsconfig.json' included because '--outFile' specified
../../built/local/jsTyping.d.ts
  Output from referenced project '../jsTyping/tsconfig.json' included because '--outFile' specified
types.ts
  Part of 'files' list in tsconfig.json
utilities.ts
  Part of 'files' list in tsconfig.json
classifier.ts
  Part of 'files' list in tsconfig.json
stringCompletions.ts
  Part of 'files' list in tsconfig.json
completions.ts
  Part of 'files' list in tsconfig.json
documentHighlights.ts
  Part of 'files' list in tsconfig.json
documentRegistry.ts
  Part of 'files' list in tsconfig.json
importTracker.ts
  Part of 'files' list in tsconfig.json
findAllReferences.ts
  Part of 'files' list in tsconfig.json
callHierarchy.ts
  Part of 'files' list in tsconfig.json
getEditsForFileRename.ts
  Part of 'files' list in tsconfig.json
goToDefinition.ts
  Part of 'files' list in tsconfig.json
jsDoc.ts
  Part of 'files' list in tsconfig.json
navigateTo.ts
  Part of 'files' list in tsconfig.json
(many more, truncated)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) mentioned this pull request Dec 3, 2020
Error "Cannot write file ... because it would overwrite input file." #27436
Closed
@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Dec 4, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I like the idea, I would prefer different output. Maybe one line per file for easier regex/grepping?

fileName.ts: Explanation goes here.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh

Ryan Cavanaugh (RyanCavanaugh) commented Dec 4, 2020

Copy link
Copy Markdown
Member

I would prefer different output.

Files can have multiple reasons for being in the program - how do you think that should be handled as a single-line format?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Dec 4, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Huh, didn't catch that from the example 😅- I would say to repeat the file name on both lines. Would that be reasonable?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Dec 4, 2020
Design Meeting Notes, 12/4/2020 #41824
Closed
@sheetalkamat
Merge branch 'master' into explainFiles
de22f1e
@sheetalkamat
Sheetal Nandi (sheetalkamat) requested review from Andrew Branch (andrewbranch) and Wesley Wigham (weswigham) December 4, 2020 23:20
@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Dec 4, 2020

Copy link
Copy Markdown
Member Author

Ready for review.
Quick question Daniel Rosenwasser (@DanielRosenwasser): do you want me to rename the flag to explainInputFiles ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sheetal Nandi (sheetalkamat) added 3 commits December 4, 2020 15:34
@sheetalkamat
Merge branch 'master' into explainFiles
975b07d
@sheetalkamat
Baselines after merge
0c00d40
@sheetalkamat
Merge branch 'master' into explainFiles
91be6e4
RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) approved these changes Dec 8, 2020
View reviewed changes
@sheetalkamat
Sheetal Nandi (sheetalkamat) merged commit 2eca17d into master Dec 9, 2020
@sheetalkamat
Sheetal Nandi (sheetalkamat) deleted the explainFiles branch December 9, 2020 00:10
@thetutlage

Harminder Virk (thetutlage) commented Feb 24, 2021

Copy link
Copy Markdown

I see that the configFileSpecs has been removed from the output of getParsedCommandLineOfConfigFile. What's is alternative to get access to it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Feb 24, 2021

Copy link
Copy Markdown
Member Author

The configFileSpecs are stored on tsconfigFile so we dont have to pass them around any more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thetutlage

Harminder Virk (thetutlage) commented Feb 24, 2021

Copy link
Copy Markdown

I read that, but looking for the ways to access them. Is there is any new API for the same?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Feb 24, 2021

Copy link
Copy Markdown
Member Author

It was always internal (meaning subject to change). We do not plan to expose that through API.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@octogonz Pete Gonzalez (octogonz) mentioned this pull request Apr 9, 2021
[eslint-plugin-packlets] Linting TypeError with typescript version >=4.2.0 microsoft/rushstack#2591
Closed
@pelikhan

Peli de Halleux (pelikhan) commented May 27, 2021

Copy link
Copy Markdown
Member

Any easily parseable format would be nice JSON or directly graphviz style files; would allow for visualizations and tooling.

whschultz reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) RyanCavanaugh approved these changes
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Awaiting requested review from DanielRosenwasser
@sandersn Nathan Shively-Sanders (sandersn) Awaiting requested review from sandersn
@weswigham Wesley Wigham (weswigham) Awaiting requested review from weswigham
@andrewbranch Andrew Branch (andrewbranch) Awaiting requested review from andrewbranch

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@sheetalkamat Sheetal Nandi (sheetalkamat)

Labels

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

Projects

PR Backlog
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Keep track of why files are in the program

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@sheetalkamat @DanielRosenwasser @typescript-bot @RyanCavanaugh @thetutlage @pelikhan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.