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

Bind object type literals in JSDoc #51066

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Oct 4, 2022

Object type literals are a specific instance of types that really need to have their own symbol table for language service operations.

We could try binding everything from JSDoc, but that does "extra" work like declaring types from JSDoc, which is undesirable. Instead, this PR just adds a lightweight walk to perform local binding within type literals in JSDoc, rather than parameterizing bindWorker.

It might be the case that we have to account for function types, constructor types, and mapped types, which all implicitly create their own symbol tables, and that might be fine too.

Fixes #51054
Alternative fix for #50750
Ref #51057, #51055

CC @a-tarasyuk who's been working on these issues.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot run dt slower
@typescript-bot perf test this faster
@typescript-bot user test tsserver
@typescript-bot test tsserver top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2022

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at 1d901bf. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2022

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at 1d901bf. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2022

Heya @DanielRosenwasser, I've started to run the abridged perf test suite on this PR at 1d901bf. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2022

Heya @DanielRosenwasser, I've started to run the Definitely Typed test suite on this PR at 1d901bf. You can monitor the build here.

@jakebailey
Copy link
Member

I'm somewhat nervous about binding more things in JSDoc just because we seem to have existing issues with JSDoc nodes being bound more than once; see #50069.

If we already bind JSDoc nodes like this, then I'm less worried, but if we normally only set the parent and such, I don't quite know what'll happen if we visit these nodes more than once.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/51066/merge:

Everything looks good!

@DanielRosenwasser
Copy link
Member Author

We already bind these nodes in JS files - so I think we should be good. If it were up to me, I would just do a full bind and decide do be more selective on what JSDoc does in TS files, but this is a more conservative first step.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I think we should decide on the semantics before playing with possible implementations. I don't think the compiler should acknowledge type-based annotations in .ts files at all.

setParent(node, parent);
const saveParent = parent;
parent = node;
if (node.kind === SyntaxKind.TypeLiteral) {
Copy link
Member

Choose a reason for hiding this comment

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

won't this also bind type literals inside a @typedef? Maybe it won't matter because there's some required intermediate binding needed for the checker to check the type.

@@ -0,0 +1,47 @@
// === /a.ts ===
// /**
// * @type {"[|foo|]" | "bar"}
Copy link
Member

Choose a reason for hiding this comment

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

I think find-all-refs should ignore @type in ts files and not offer completions either.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..51066

Metric main 51066 Delta Best Worst
Angular - node (v14.15.1, x64)
Memory used 346,865k (± 0.00%) 346,857k (± 0.02%) -8k (- 0.00%) 346,699k 346,943k
Parse Time 2.09s (± 0.94%) 2.09s (± 0.86%) +0.00s (+ 0.10%) 2.06s 2.15s
Bind Time 0.79s (± 0.59%) 0.78s (± 0.83%) -0.01s (- 1.01%) 0.77s 0.80s
Check Time 5.96s (± 0.46%) 5.97s (± 0.48%) +0.01s (+ 0.10%) 5.91s 6.04s
Emit Time 6.22s (± 0.41%) 6.26s (± 0.88%) +0.04s (+ 0.72%) 6.14s 6.38s
Total Time 15.05s (± 0.24%) 15.10s (± 0.47%) +0.05s (+ 0.31%) 14.97s 15.24s
Compiler-Unions - node (v14.15.1, x64)
Memory used 190,807k (± 0.68%) 190,117k (± 0.13%) -690k (- 0.36%) 189,103k 190,303k
Parse Time 0.86s (± 0.58%) 0.86s (± 0.52%) +0.00s (+ 0.35%) 0.85s 0.87s
Bind Time 0.48s (± 1.02%) 0.48s (± 0.46%) -0.00s (- 0.62%) 0.48s 0.49s
Check Time 6.76s (± 0.68%) 6.78s (± 0.58%) +0.02s (+ 0.33%) 6.67s 6.85s
Emit Time 2.41s (± 0.96%) 2.42s (± 0.55%) +0.01s (+ 0.46%) 2.39s 2.45s
Total Time 10.51s (± 0.53%) 10.54s (± 0.40%) +0.03s (+ 0.28%) 10.41s 10.62s
Monaco - node (v14.15.1, x64)
Memory used 326,578k (± 0.01%) 326,564k (± 0.01%) -14k (- 0.00%) 326,493k 326,608k
Parse Time 1.58s (± 0.64%) 1.60s (± 1.56%) +0.02s (+ 1.33%) 1.57s 1.69s
Bind Time 0.72s (± 0.62%) 0.73s (± 0.71%) +0.01s (+ 0.97%) 0.72s 0.74s
Check Time 5.72s (± 0.65%) 5.77s (± 0.48%) +0.04s (+ 0.73%) 5.71s 5.83s
Emit Time 3.36s (± 0.63%) 3.37s (± 0.83%) +0.01s (+ 0.42%) 3.33s 3.44s
Total Time 11.38s (± 0.38%) 11.47s (± 0.36%) +0.08s (+ 0.74%) 11.39s 11.60s
TFS - node (v14.15.1, x64)
Memory used 289,706k (± 0.00%) 289,689k (± 0.01%) -17k (- 0.01%) 289,637k 289,730k
Parse Time 1.29s (± 0.70%) 1.30s (± 0.69%) +0.00s (+ 0.39%) 1.28s 1.32s
Bind Time 0.79s (± 1.90%) 0.79s (± 1.12%) +0.00s (+ 0.13%) 0.76s 0.81s
Check Time 5.37s (± 0.34%) 5.40s (± 0.71%) +0.04s (+ 0.67%) 5.34s 5.50s
Emit Time 3.61s (± 0.58%) 3.62s (± 0.64%) +0.02s (+ 0.50%) 3.57s 3.66s
Total Time 11.05s (± 0.33%) 11.11s (± 0.43%) +0.06s (+ 0.53%) 11.00s 11.24s
material-ui - node (v14.15.1, x64)
Memory used 435,679k (± 0.00%) 435,566k (± 0.06%) -113k (- 0.03%) 434,493k 435,740k
Parse Time 1.88s (± 0.56%) 1.88s (± 0.58%) +0.00s (+ 0.11%) 1.86s 1.91s
Bind Time 0.58s (± 0.58%) 0.57s (± 0.59%) -0.01s (- 1.72%) 0.57s 0.58s
Check Time 12.84s (± 0.51%) 12.94s (± 0.75%) +0.10s (+ 0.80%) 12.78s 13.23s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.30s (± 0.42%) 15.40s (± 0.66%) +0.10s (+ 0.66%) 15.23s 15.71s
xstate - node (v14.15.1, x64)
Memory used 544,084k (± 0.00%) 544,075k (± 0.00%) -9k (- 0.00%) 544,026k 544,128k
Parse Time 2.61s (± 0.36%) 2.62s (± 0.31%) +0.02s (+ 0.61%) 2.61s 2.65s
Bind Time 0.97s (± 1.31%) 0.97s (± 0.89%) 0.00s ( 0.00%) 0.96s 0.99s
Check Time 1.52s (± 0.64%) 1.52s (± 0.50%) +0.01s (+ 0.39%) 1.51s 1.54s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.18s (± 0.43%) 5.20s (± 0.26%) +0.02s (+ 0.44%) 5.17s 5.23s
Angular - node (v10.16.3, x64)
Memory used 371,327k (± 0.02%) 371,339k (± 0.03%) +13k (+ 0.00%) 371,087k 371,543k
Parse Time 2.08s (± 0.45%) 2.09s (± 0.46%) +0.01s (+ 0.34%) 2.06s 2.11s
Bind Time 0.78s (± 1.33%) 0.78s (± 1.21%) -0.01s (- 0.64%) 0.76s 0.80s
Check Time 6.28s (± 0.48%) 6.34s (± 0.50%) +0.06s (+ 0.94%) 6.26s 6.42s
Emit Time 6.04s (± 0.54%) 6.12s (± 0.59%) +0.08s (+ 1.31%) 6.03s 6.18s
Total Time 15.18s (± 0.38%) 15.32s (± 0.43%) +0.14s (+ 0.91%) 15.15s 15.45s
Compiler-Unions - node (v10.16.3, x64)
Memory used 206,310k (± 0.05%) 206,359k (± 0.05%) +49k (+ 0.02%) 206,166k 206,524k
Parse Time 0.83s (± 0.99%) 0.84s (± 0.58%) +0.01s (+ 1.20%) 0.83s 0.85s
Bind Time 0.47s (± 0.85%) 0.47s (± 0.71%) -0.00s (- 0.21%) 0.46s 0.48s
Check Time 8.41s (± 0.62%) 8.51s (± 0.57%) +0.10s (+ 1.20%) 8.38s 8.61s
Emit Time 2.46s (± 1.50%) 2.46s (± 1.07%) +0.00s (+ 0.08%) 2.41s 2.53s
Total Time 12.17s (± 0.63%) 12.29s (± 0.49%) +0.12s (+ 0.95%) 12.12s 12.40s
Monaco - node (v10.16.3, x64)
Memory used 344,826k (± 0.02%) 344,844k (± 0.01%) +18k (+ 0.01%) 344,747k 344,939k
Parse Time 1.60s (± 0.78%) 1.62s (± 0.42%) +0.01s (+ 0.81%) 1.60s 1.63s
Bind Time 0.70s (± 0.67%) 0.70s (± 0.52%) +0.00s (+ 0.57%) 0.70s 0.71s
Check Time 6.21s (± 0.41%) 6.22s (± 0.39%) +0.02s (+ 0.24%) 6.18s 6.30s
Emit Time 3.21s (± 0.62%) 3.26s (± 0.91%) +0.05s (+ 1.53%) 3.19s 3.34s
Total Time 11.73s (± 0.39%) 11.80s (± 0.41%) +0.08s (+ 0.64%) 11.69s 11.96s
TFS - node (v10.16.3, x64)
Memory used 306,111k (± 0.03%) 306,079k (± 0.02%) -32k (- 0.01%) 305,936k 306,281k
Parse Time 1.29s (± 0.45%) 1.29s (± 0.73%) +0.00s (+ 0.23%) 1.27s 1.31s
Bind Time 0.67s (± 1.11%) 0.67s (± 0.66%) -0.00s (- 0.15%) 0.66s 0.68s
Check Time 5.52s (± 0.50%) 5.53s (± 0.81%) +0.01s (+ 0.16%) 5.42s 5.61s
Emit Time 3.41s (± 0.77%) 3.42s (± 1.21%) +0.01s (+ 0.26%) 3.31s 3.53s
Total Time 10.90s (± 0.41%) 10.92s (± 0.40%) +0.02s (+ 0.19%) 10.82s 11.02s
material-ui - node (v10.16.3, x64)
Memory used 458,123k (± 0.02%) 458,126k (± 0.01%) +3k (+ 0.00%) 458,021k 458,255k
Parse Time 1.82s (± 0.64%) 1.85s (± 0.75%) +0.03s (+ 1.48%) 1.82s 1.88s
Bind Time 0.58s (± 1.89%) 0.56s (± 1.96%) 🟩-0.02s (- 4.29%) 0.54s 0.58s
Check Time 15.80s (± 0.73%) 15.74s (± 0.82%) -0.05s (- 0.32%) 15.51s 16.01s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 18.20s (± 0.66%) 18.15s (± 0.73%) -0.05s (- 0.29%) 17.91s 18.43s
xstate - node (v10.16.3, x64)
Memory used 581,059k (± 0.01%) 581,124k (± 0.01%) +65k (+ 0.01%) 580,957k 581,256k
Parse Time 2.60s (± 0.18%) 2.61s (± 0.38%) +0.01s (+ 0.27%) 2.59s 2.63s
Bind Time 0.90s (± 0.58%) 0.90s (± 0.68%) +0.00s (+ 0.22%) 0.89s 0.91s
Check Time 1.60s (± 0.59%) 1.61s (± 0.58%) +0.01s (+ 0.56%) 1.59s 1.63s
Emit Time 0.07s (± 4.66%) 0.07s (± 3.14%) -0.00s (- 2.74%) 0.07s 0.08s
Total Time 5.18s (± 0.21%) 5.19s (± 0.36%) +0.02s (+ 0.29%) 5.15s 5.23s
Angular - node (v12.1.0, x64)
Memory used 348,785k (± 0.02%) 348,882k (± 0.03%) +98k (+ 0.03%) 348,753k 349,099k
Parse Time 2.08s (± 0.80%) 2.11s (± 0.73%) +0.02s (+ 1.10%) 2.08s 2.15s
Bind Time 0.76s (± 0.64%) 0.76s (± 0.85%) -0.00s (- 0.26%) 0.75s 0.78s
Check Time 5.96s (± 0.44%) 6.00s (± 0.53%) +0.04s (+ 0.72%) 5.92s 6.06s
Emit Time 6.29s (± 0.75%) 6.33s (± 0.68%) +0.03s (+ 0.52%) 6.25s 6.44s
Total Time 15.09s (± 0.38%) 15.19s (± 0.48%) +0.10s (+ 0.65%) 15.00s 15.40s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,247k (± 0.44%) 193,098k (± 0.45%) -149k (- 0.08%) 190,967k 194,109k
Parse Time 0.83s (± 0.99%) 0.83s (± 0.91%) -0.00s (- 0.00%) 0.82s 0.85s
Bind Time 0.47s (± 0.85%) 0.47s (± 0.72%) +0.00s (+ 0.42%) 0.47s 0.48s
Check Time 6.70s (± 0.69%) 6.76s (± 0.53%) +0.06s (+ 0.94%) 6.67s 6.82s
Emit Time 2.47s (± 1.10%) 2.47s (± 0.95%) +0.00s (+ 0.04%) 2.41s 2.51s
Total Time 10.48s (± 0.44%) 10.54s (± 0.44%) +0.07s (+ 0.63%) 10.44s 10.63s
Monaco - node (v12.1.0, x64)
Memory used 327,807k (± 0.02%) 327,813k (± 0.02%) +6k (+ 0.00%) 327,651k 327,934k
Parse Time 1.57s (± 0.70%) 1.59s (± 0.63%) +0.01s (+ 0.89%) 1.56s 1.61s
Bind Time 0.70s (± 0.72%) 0.71s (± 0.95%) +0.01s (+ 1.73%) 0.70s 0.73s
Check Time 5.82s (± 0.24%) 5.87s (± 0.52%) +0.04s (+ 0.70%) 5.81s 5.93s
Emit Time 3.33s (± 1.18%) 3.32s (± 0.80%) -0.01s (- 0.27%) 3.28s 3.39s
Total Time 11.42s (± 0.39%) 11.48s (± 0.40%) +0.06s (+ 0.49%) 11.39s 11.58s
TFS - node (v12.1.0, x64)
Memory used 290,728k (± 0.02%) 290,609k (± 0.06%) -118k (- 0.04%) 289,940k 290,814k
Parse Time 1.30s (± 1.11%) 1.30s (± 0.78%) -0.00s (- 0.15%) 1.29s 1.34s
Bind Time 0.67s (± 1.01%) 0.68s (± 1.33%) +0.01s (+ 1.04%) 0.66s 0.70s
Check Time 5.39s (± 0.26%) 5.43s (± 0.65%) +0.03s (+ 0.63%) 5.35s 5.51s
Emit Time 3.52s (± 0.85%) 3.52s (± 1.00%) -0.00s (- 0.06%) 3.43s 3.59s
Total Time 10.89s (± 0.36%) 10.93s (± 0.43%) +0.04s (+ 0.37%) 10.83s 11.04s
material-ui - node (v12.1.0, x64)
Memory used 437,434k (± 0.02%) 437,321k (± 0.07%) -113k (- 0.03%) 436,163k 437,518k
Parse Time 1.84s (± 0.55%) 1.84s (± 0.52%) 0.00s ( 0.00%) 1.81s 1.85s
Bind Time 0.55s (± 0.68%) 0.54s (± 0.67%) -0.00s (- 0.18%) 0.54s 0.55s
Check Time 12.79s (± 0.50%) 12.87s (± 0.82%) +0.08s (+ 0.60%) 12.70s 13.26s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.18s (± 0.46%) 15.25s (± 0.65%) +0.08s (+ 0.50%) 15.10s 15.61s
xstate - node (v12.1.0, x64)
Memory used 546,300k (± 0.01%) 546,492k (± 0.01%) +192k (+ 0.04%) 546,320k 546,670k
Parse Time 2.54s (± 0.48%) 2.58s (± 0.45%) +0.04s (+ 1.38%) 2.56s 2.61s
Bind Time 0.88s (± 0.83%) 0.87s (± 0.60%) -0.01s (- 1.03%) 0.86s 0.88s
Check Time 1.49s (± 0.66%) 1.50s (± 0.69%) +0.01s (+ 0.94%) 1.48s 1.52s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 4.99s (± 0.35%) 5.02s (± 0.45%) +0.04s (+ 0.70%) 4.97s 5.07s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v14.15.1, x64)
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
Scenarios
  • Angular - node (v14.15.1, x64)
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
Benchmark Name Iterations
Current 51066 10
Baseline main 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/51066/merge:

Something interesting changed - please have a look.

Details

apache/echarts

⚠️ Note that built also had errors ⚠️
Req #22425 - references
    at formatMessage (/typescript-main/built/local/tsserver.js:178945:29)
    at IOSession.Session.writeMessage (/typescript-main/built/local/tsserver.js:180020:31)
    at IOSession.Session.send (/typescript-main/built/local/tsserver.js:180017:22)
    at IOSession.Session.doOutput (/typescript-main/built/local/tsserver.js:180070:22)
    at IOSession.Session.onMessage (/typescript-main/built/local/tsserver.js:181715:30)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:185822:31)
Req #22425 - references
    at formatMessage (/typescript-51066/built/local/tsserver.js:178952:29)
    at IOSession.Session.writeMessage (/typescript-51066/built/local/tsserver.js:180027:31)
    at IOSession.Session.send (/typescript-51066/built/local/tsserver.js:180024:22)
    at IOSession.Session.doOutput (/typescript-51066/built/local/tsserver.js:180077:22)
    at IOSession.Session.onMessage (/typescript-51066/built/local/tsserver.js:181722:30)
    at Interface.<anonymous> (/typescript-51066/built/local/tsserver.js:185829:31)

Last few requests

{"seq":22422,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/dist/echarts.simple.js","line":15468,"offset":12,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":2,"triggerCharacter":"."}}
{"seq":22423,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/dist/echarts.simple.js","line":15471,"offset":26,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":22424,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/dist/echarts.simple.js","line":15471,"offset":26,"entryNames":["__extends"]}}
{"seq":22425,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/dist/echarts.simple.js","line":15512,"offset":13}}

Repro Steps

  1. git clone https://github.com/apache/echarts --recurse-submodules
  2. In dir echarts, run git reset --hard 81321a63a91d98378114153d446a2713e9c10844
  3. Install packages (exact steps are below, but it might be easier to follow the repo readme)
    1. In dir echarts, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    2. In dir echarts/test/runTest, run npm install --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
  4. Download RepoResults1/apache.echarts.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./echarts ./apache.echarts.replay.txt path/to/tsserver.js

palantir/blueprint

⚠️ Note that built also had errors ⚠️
Req #12859 - references
    at formatMessage (/typescript-main/built/local/tsserver.js:178945:29)
    at IOSession.Session.writeMessage (/typescript-main/built/local/tsserver.js:180020:31)
    at IOSession.Session.send (/typescript-main/built/local/tsserver.js:180017:22)
    at IOSession.Session.doOutput (/typescript-main/built/local/tsserver.js:180070:22)
    at IOSession.Session.onMessage (/typescript-main/built/local/tsserver.js:181715:30)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:185822:31)
Req #12859 - references
    at formatMessage (/typescript-51066/built/local/tsserver.js:178952:29)
    at IOSession.Session.writeMessage (/typescript-51066/built/local/tsserver.js:180027:31)
    at IOSession.Session.send (/typescript-51066/built/local/tsserver.js:180024:22)
    at IOSession.Session.doOutput (/typescript-51066/built/local/tsserver.js:180077:22)
    at IOSession.Session.onMessage (/typescript-51066/built/local/tsserver.js:181722:30)
    at Interface.<anonymous> (/typescript-51066/built/local/tsserver.js:185829:31)

Last few requests

{"seq":12856,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":781346,"entryNames":["_"]}}
{"seq":12857,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":782838}}
{"seq":12858,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":782939}}
{"seq":12859,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":783155}}

Repro Steps

  1. git clone https://github.com/palantir/blueprint --recurse-submodules
  2. In dir blueprint, run git reset --hard 9eeeeb84acf0f9f2f15291a1f556ab25df346327
  3. Download RepoResults4/palantir.blueprint.replay.txt from the artifact folder
  4. npm install --no-save @typescript/server-replay
  5. npx tsreplay ./blueprint ./palantir.blueprint.replay.txt path/to/tsserver.js

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

I think, to pair with current work to try to parse jsdoc maybe a bit more lazily, we'd want to think of an approach where we could bind these lazily - maybe on demand in the services layer, since for normal compiler error-checking operation, we don't really want to consider them. (But we do want references in them to be available in find-all-refs in services, I assume!)

But, ignoring that, I think binding these is a pretty required step to get decent ls results that involve them. I guess the interesting part is that we want to be able to know these reference other things, but not let them make new references in TS code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions in object type argument fails in JSDoc comment
6 participants