-
Notifications
You must be signed in to change notification settings - Fork 1.4k
More precise descriptions of project reference-related editor options. #3384
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
base: v2
Are you sure you want to change the base?
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3384.centralus.5.azurestaticapps.net |
@@ -1,7 +1,49 @@ | |||
--- | |||
display: "Disable Source Project Reference Redirect" | |||
oneline: "Disable preferring source files instead of declaration files when referencing composite projects." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the onelines come from the CLI flag descriptions, if that matters to you.
@@ -465,7 +465,7 @@ tsc app.ts util.ts --target esnext --outfile index.js | |||
</td> | |||
</tr> | |||
<tr class="option-description odd"><td colspan="3"> | |||
<p>Reduce the number of projects loaded automatically by TypeScript.</p> | |||
<p>Avoid searching for symbols across referenced projects in code editors.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also stops loading reference projects and looking up in it for default project for file.
we don't want to stop what we're doing and build `projectB` before we can get accurate errors in `projectA`, so TypeScript prefers reading source `.ts` files instead of generated `.d.ts` files if they're around. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always get source file even if project is not yet built and hence no d.ts file
In larger codebases, this extra work can feel very slow. | ||
|
||
The `disableSourceOfProjectReferenceRedirect` option allows developers to opt out of loading source files over declaration files in the editor ([just as it worked before TypeScript 3.7](/docs/handbook/release-notes/typescript-3-7.html#build-free-editing-with-project-references)). | ||
As a result, dependencies will need to be build with declaration files in order to get accurate error-checking, code completion, and other editor features in a project with references. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And with declarationMap if you want the definition to jump to original source file instead of d.ts
No description provided.