GeezerVison is showing github.com — Keep track of why files are in the program by sheetalkamat · Pull Request #40011 · microsoft/TypeScript
Conversation
- Instead of keeping reference file reasons tracking, we also keep track of all reasons file is included in the program.
- The configFileSpecs are stored on tsconfigFile so we dont have to pass them around any more.
- 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)
- They are also used to report errors about the file eg its not in
rootDir or doesn't match casing etc
- 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
…ut related file information is reattached to correct location
…and related information location changes
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I like the idea, I would prefer different output. Maybe one line per file for easier regex/grepping?
fileName.ts: Explanation goes here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Huh, didn't catch that from the example 😅- I would say to repeat the file name on both lines. Would that be reasonable?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I see that the configFileSpecs has been removed from the output of getParsedCommandLineOfConfigFile. What's is alternative to get access to it?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The configFileSpecs are stored on tsconfigFile so we dont have to pass them around any more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I read that, but looking for the ways to access them. Is there is any new API for the same?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It was always internal (meaning subject to change). We do not plan to expose that through API.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Any easily parseable format would be nice JSON or directly graphviz style files; would allow for visualizations and tooling.
|
whschultz reacted with heart emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|