Repository navigation
Slow IntelliSense with react-hook-form resolvers on commands completionInfo, completionEntryDetails, and, encodedSemanticClassifications-full #46726
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
7.0 LS MigrationDomain: PerformanceReports of unusually slow behaviorReports of unusually slow behaviorNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
Bug Report
When adding react-hook-form with their resolver library and zod, the IntelliSense time blows up on three commands: completionInfo, completionEntryDetails, and, encodedSemanticClassifications-full.
Before adding the resolver the logs output:
Info 139 [22:19:17.358] getCompletionData: Get current token: 0.021499991416931152
Info 140 [22:19:17.358] getCompletionData: Is inside comment: 0.057999998331069946
Info 141 [22:19:17.358] getCompletionData: Get previous token: 0.05949999392032623
Info 142 [22:19:17.358] getCompletionsAtPosition: isCompletionListBlocker: 0.26919999718666077
Info 143 [22:19:17.369] getExportInfoMap: cache miss or empty; calculating new results
Info 144 [22:19:17.382] getExportInfoMap: done in 19.083700001239777 ms
Info 145 [22:19:17.394] collectAutoImports: resolved 4 module specifiers, plus 0 ambient and -3 from cache
Info 146 [22:19:17.394] collectAutoImports: response is complete
Info 147 [22:19:17.394] collectAutoImports: 4.513700008392334
Info 148 [22:19:17.394] getCompletionData: Semantic work: 35.378199994564056
Info 149 [22:19:17.413] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 19.212099999189377
Perf 150 [22:19:17.422] 27::completionInfo: elapsed time (in milliseconds) 70.9448
Info 159 [22:19:17.525] getCompletionData: Get current token: 0.03389999270439148
Info 160 [22:19:17.525] getCompletionData: Is inside comment: 0.008000001311302185
Info 161 [22:19:17.526] getCompletionData: Get previous token: 0.07129999995231628
Info 162 [22:19:17.526] getCompletionsAtPosition: isCompletionListBlocker: 0.010899990797042847
Info 163 [22:19:17.528] getCompletionData: Semantic work: 2.452999994158745
Perf 164 [22:19:17.732] 29::completionEntryDetails: elapsed time (in milliseconds) 212.3927
Perf 179 [22:19:17.974] 34::encodedSemanticClassifications-full: elapsed time (in milliseconds) 163.9209
After adding the resolver the logs output:
Info 323 [22:22:49.786] getCompletionData: Get current token: 0.04549999535083771
Info 324 [22:22:49.786] getCompletionData: Is inside comment: 0.009299993515014648
Info 325 [22:22:49.786] getCompletionData: Get previous token: 0.12800000607967377
Info 326 [22:22:49.787] getCompletionsAtPosition: isCompletionListBlocker: 0.23919999599456787
Info 327 [22:22:49.803] getExportInfoMap: cache hit
Info 328 [22:22:49.815] collectAutoImports: resolved 7 module specifiers, plus 0 ambient and -38 from cache
Info 329 [22:22:49.815] collectAutoImports: response is complete
Info 330 [22:22:49.815] collectAutoImports: 6.50730000436306
Info 331 [22:22:49.815] getCompletionData: Semantic work: 28.06919999420643
Info 332 [22:22:50.599] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 14.070700004696846
Perf 333 [22:22:50.602] 74::completionInfo: elapsed time (in milliseconds) 822.7960
Info 344 [22:22:50.762] getCompletionData: Get current token: 0.05060000717639923
Info 345 [22:22:50.762] getCompletionData: Is inside comment: 0.010499998927116394
Info 346 [22:22:50.762] getCompletionData: Get previous token: 0.10969999432563782
Info 347 [22:22:50.762] getCompletionsAtPosition: isCompletionListBlocker: 0.008100003004074097
Info 348 [22:22:50.764] getCompletionData: Semantic work: 1.965599998831749
Perf 349 [22:22:51.360] 83::completionEntryDetails: elapsed time (in milliseconds) 598.5825
Perf 444 [22:22:59.443] 108::encodedSemanticClassifications-full: elapsed time (in milliseconds) 670.2304
What seems to be an identical issue was previously reported in a now closed ticket (#44851).
🔎 Search Terms
🕗 Version & Regression Information
As noted in the ticket Typescript 4.3 introduced the regression. When downgrading to Typescript 4.2, I do not see this issue. The issue persists when using the PR (#46429) that closed the previously reported issue (#44851). The PR landed in Typescript 4.5.1-rc.
⏯ Playground Link
Example repo can be found:
https://github.com/JSin/type-resolve-bug
💻 Code
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod/dist/zod";
import { z } from "zod";
const schema = z.object({
first: z.string().nonempty(),
second: z.number().gte(0),
});
const Index = () => {
/*
If you were to pass no parameters to useForm, IntelliSense is still quick.
Once you add the object with the resolver property with a zodResolver... IntelliSense speed blows up.
*/
const { register } = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
});
};🙁 Actual behavior
Extremely Slow IntelliSense
🙂 Expected behavior
Fast IntelliSense
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
7.0 LS MigrationDomain: PerformanceReports of unusually slow behaviorReports of unusually slow behaviorNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Activity
[-]Extremely slow IntelliSense with react-hook-form resolvers on commands `completionInfo`, `completionEntryDetails`, and, `encodedSemanticClassifications-full`[/-][+]Slow IntelliSense with react-hook-form resolvers on commands `completionInfo`, `completionEntryDetails`, and, `encodedSemanticClassifications-full`[/+]andrewbranch commentedon Nov 8, 2021
We need to know exactly where you were requesting the completions seen in those logs, and it would also help to know which completion item was highlighted (which is the one details are requested for).
JSin commentedon Nov 8, 2021
In the simplified example above, I was trying to get the completions for
register. Below is what I forgot to add to the example above.Below is an picture example of the completion item highlighted:

andrewbranch commentedon Nov 8, 2021
What’s showing in your screenshot is actually a feature called “signature help,” and that request is not in the logs you shared. I’m guessing this is actually what we’re looking at?
I get completions very fast here. Can you give more detailed instructions on exactly what you’re doing step by step that triggers the issue? Does it repro with such slow completions every time?
JSin commentedon Nov 8, 2021
Apologies that is my misunderstanding with the commands. The "signature help" perf log is always sub 10 ms so I didn't see it as a culprit.
For
completionInfo, the subsequent calls are fast and only the first time was it slow.completionEntryDetailsandencodedSemanticClassifications-fullcalls are still around 800 ms in the repo (around 150 ms in 4.2.4).The detailed instructions:
(Exactly what I noticed as the problem was the signature helper above taking a long time to show (4.4.4 could take seconds) which previously in 4.2.4 felt immediate. Honestly 800 ms isn't the end of the world and this issue was greatly improved in 4.5.1-rc. Let me know your thoughts if I am being nitpicky here.
andrewbranch commentedon Nov 9, 2021
No, 800ms is pretty bad for
completionEntryDetails, it’s worth a look. Thanks!Zain-ul-din commentedon Apr 24, 2026
Same issue here, even in a simple file, it gets stuck on loading forever
andrewbranch commentedon Apr 24, 2026
Closing language service bugs related to the 6.0 implementation. For more information, see #62827
Zain-ul-din commentedon May 3, 2026
Actually, my bad here, Claude Code installed version 3 of the package, where the latest is i think, 5 rn.