Skip to content
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

support quick info and go to definition on mapped keys #61061

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Zzzen
Copy link
Contributor

@Zzzen Zzzen commented Jan 28, 2025

Fixes #50715, Fixes #56019, Fixes #61094

As mentioned in this comment on GitHub (#50715 (comment)), the @inheritDoc tag is necessary to enable features like quick info and go to definition.

@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@jakebailey
Copy link
Member

Honestly this feels right to me?

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 194,697k (± 1.01%) 194,113k (± 0.95%) ~ 192,907k 196,503k p=0.936 n=6
Parse Time 1.31s (± 0.96%) 1.31s (± 0.75%) ~ 1.30s 1.32s p=0.931 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.73s (± 0.31%) 9.74s (± 0.53%) ~ 9.68s 9.82s p=0.936 n=6
Emit Time 2.73s (± 0.57%) 2.73s (± 0.64%) ~ 2.71s 2.76s p=0.869 n=6
Total Time 14.50s (± 0.19%) 14.51s (± 0.29%) ~ 14.44s 14.55s p=0.871 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 948,488 948,488 ~ ~ ~ p=1.000 n=6
Types 411,006 411,006 ~ ~ ~ p=1.000 n=6
Memory used 1,224,307k (± 0.00%) 1,224,348k (± 0.01%) ~ 1,224,283k 1,224,482k p=0.689 n=6
Parse Time 8.03s (± 1.07%) 7.98s (± 0.89%) ~ 7.90s 8.08s p=0.258 n=6
Bind Time 2.28s (± 0.48%) 2.29s (± 0.39%) ~ 2.28s 2.30s p=0.111 n=6
Check Time 37.98s (± 0.40%) 37.99s (± 0.27%) ~ 37.90s 38.15s p=1.000 n=6
Emit Time 18.39s (± 0.55%) 18.41s (± 0.57%) ~ 18.29s 18.54s p=0.748 n=6
Total Time 66.67s (± 0.29%) 66.67s (± 0.17%) ~ 66.52s 66.85s p=0.873 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,347,440 2,347,440 ~ ~ ~ p=1.000 n=6
Types 845,526 845,526 ~ ~ ~ p=1.000 n=6
Memory used 2,120,436k (± 0.00%) 2,120,390k (± 0.00%) ~ 2,120,347k 2,120,443k p=0.230 n=6
Parse Time 7.26s (± 0.16%) 7.26s (± 0.14%) ~ 7.25s 7.28s p=0.801 n=6
Bind Time 2.47s (± 1.14%) 2.45s (± 0.26%) ~ 2.44s 2.46s p=0.180 n=6
Check Time 72.48s (± 1.10%) 72.67s (± 0.50%) ~ 72.24s 73.11s p=1.000 n=6
Emit Time 0.15s (± 2.75%) 0.14s (± 3.60%) ~ 0.14s 0.15s p=0.112 n=6
Total Time 82.36s (± 0.92%) 82.53s (± 0.43%) ~ 82.10s 82.97s p=1.000 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,588 1,226,606 +18 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,986 266,996 +10 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,723,670k (±14.66%) 3,088,615k (± 0.03%) ~ 3,087,232k 3,089,492k p=0.093 n=6
Parse Time 6.61s (± 1.48%) 6.72s (± 0.35%) +0.11s (+ 1.64%) 6.69s 6.75s p=0.030 n=6
Bind Time 2.16s (± 1.64%) 2.16s (± 1.36%) ~ 2.12s 2.20s p=0.688 n=6
Check Time 42.83s (± 0.17%) 42.78s (± 0.22%) ~ 42.69s 42.95s p=0.336 n=6
Emit Time 3.56s (± 2.15%) 3.42s (± 2.87%) 🟩-0.14s (- 3.93%) 3.24s 3.50s p=0.013 n=6
Total Time 55.17s (± 0.18%) 55.07s (± 0.23%) ~ 54.92s 55.29s p=0.173 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,588 1,226,606 +18 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,986 266,996 +10 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,153,474k (± 0.05%) 3,032,491k (± 9.76%) ~ 2,427,482k 3,154,109k p=1.000 n=6
Parse Time 7.00s (± 0.53%) 6.97s (± 0.52%) ~ 6.91s 7.00s p=0.260 n=6
Bind Time 2.14s (± 1.40%) 2.14s (± 1.45%) ~ 2.09s 2.17s p=0.747 n=6
Check Time 42.86s (± 0.21%) 42.85s (± 0.56%) ~ 42.44s 43.10s p=0.873 n=6
Emit Time 3.53s (± 2.19%) 3.54s (± 2.01%) ~ 3.43s 3.62s p=0.748 n=6
Total Time 55.52s (± 0.25%) 55.49s (± 0.44%) ~ 55.07s 55.79s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,667 262,676 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,849 106,854 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 440,455k (± 0.01%) 440,425k (± 0.02%) ~ 440,289k 440,493k p=0.422 n=6
Parse Time 3.54s (± 0.66%) 3.56s (± 0.92%) ~ 3.50s 3.59s p=0.167 n=6
Bind Time 1.32s (± 1.17%) 1.32s (± 0.62%) ~ 1.31s 1.33s p=0.315 n=6
Check Time 18.97s (± 0.37%) 18.95s (± 0.27%) ~ 18.87s 19.00s p=0.296 n=6
Emit Time 1.52s (± 1.38%) 1.52s (± 1.13%) ~ 1.49s 1.54s p=0.807 n=6
Total Time 25.35s (± 0.32%) 25.35s (± 0.30%) ~ 25.22s 25.42s p=0.872 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,113 226,113 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,400k (± 0.05%) 371,346k (± 0.01%) ~ 371,309k 371,432k p=0.873 n=6
Parse Time 2.89s (± 1.29%) 2.90s (± 1.08%) ~ 2.86s 2.94s p=0.748 n=6
Bind Time 1.60s (± 1.31%) 1.59s (± 1.47%) ~ 1.55s 1.61s p=0.567 n=6
Check Time 16.47s (± 0.54%) 16.46s (± 0.60%) ~ 16.35s 16.64s p=0.296 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.96s (± 0.47%) 20.94s (± 0.62%) ~ 20.78s 21.16s p=0.521 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,230,018 3,230,018 ~ ~ ~ p=1.000 n=6
Types 1,095,648 1,095,648 ~ ~ ~ p=1.000 n=6
Memory used 3,306,590k (± 0.00%) 3,306,652k (± 0.00%) ~ 3,306,510k 3,306,785k p=0.378 n=6
Parse Time 11.71s (± 0.15%) 11.74s (± 0.27%) ~ 11.70s 11.79s p=0.124 n=6
Bind Time 3.82s (± 0.51%) 3.80s (± 0.45%) ~ 3.78s 3.82s p=0.102 n=6
Check Time 74.91s (± 0.40%) 74.94s (± 0.44%) ~ 74.51s 75.37s p=0.936 n=6
Emit Time 23.23s (± 0.28%) 23.20s (± 0.48%) ~ 22.98s 23.26s p=0.870 n=6
Total Time 113.67s (± 0.27%) 113.67s (± 0.36%) ~ 113.02s 114.17s p=0.689 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 293,866 293,866 ~ ~ ~ p=1.000 n=6
Types 119,628 119,628 ~ ~ ~ p=1.000 n=6
Memory used 446,935k (± 0.01%) 446,999k (± 0.02%) ~ 446,939k 447,132k p=0.066 n=6
Parse Time 3.31s (± 0.37%) 3.29s (± 0.17%) ~ 3.29s 3.30s p=0.090 n=6
Bind Time 1.48s (± 0.70%) 1.46s (± 0.57%) -0.02s (- 1.24%) 1.45s 1.47s p=0.010 n=6
Check Time 15.62s (± 0.24%) 15.65s (± 0.31%) ~ 15.57s 15.70s p=0.224 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.41s (± 0.15%) 20.42s (± 0.22%) ~ 20.34s 20.46s p=0.572 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 559,094 559,094 ~ ~ ~ p=1.000 n=6
Types 187,011 187,011 ~ ~ ~ p=1.000 n=6
Memory used 496,166k (± 0.03%) 496,152k (± 0.03%) ~ 495,878k 496,285k p=0.873 n=6
Parse Time 3.42s (± 0.75%) 3.43s (± 1.13%) ~ 3.40s 3.48s p=0.806 n=6
Bind Time 1.20s (± 0.86%) 1.19s (± 1.14%) ~ 1.17s 1.21s p=0.241 n=6
Check Time 19.71s (± 1.06%) 19.83s (± 2.07%) ~ 19.57s 20.66s p=0.688 n=6
Emit Time 0.01s (±154.76%) 0.00s ~ ~ ~ p=0.174 n=6
Total Time 24.34s (± 0.89%) 24.46s (± 1.80%) ~ 24.15s 25.34s p=0.748 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/61061/merge:

Everything looks good!

@@ -595,7 +597,8 @@ function isExpandoDeclaration(node: Declaration): boolean {
}

function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node, failedAliasResolution?: boolean, declarationFilter?: (d: Declaration) => boolean): DefinitionInfo[] | undefined {
const filteredDeclarations = declarationFilter !== undefined ? filter(symbol.declarations, declarationFilter) : symbol.declarations;
const declarations = isTransientSymbol(symbol) && symbol.links.checkFlags & CheckFlags.Mapped && !symbol.declarations?.length ? symbol.links.syntheticOrigin?.declarations : symbol.declarations;
Copy link
Member

Choose a reason for hiding this comment

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

I find it sort of concerning to reach into the links like this; I can see maybe one or two other cases where we've done symbol.links outside the checker and I can't say I like those either. Is there no other way to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your concern about reaching into symbol.links. I think there might be a better way to handle this. Maybe we can create a helper function that gets the documentation from the original symbol without directly accessing links. That would make the code more maintainable and less dependent on internal implementation details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not started
3 participants