microsoft / microsoft/TypeScript

Cache importFixes/fixMissingImport in getCodeFixes requests

Aperta
#41,909 9 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@andrewbranch ci sta già lavorando.

Dal 10/12/2020.

Needs Investigation
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

Search Terms

  • getCodeFixes cache

Suggestion

In tsserver, the completionInfo request benefits from a cache of import suggestions.

https://github.com/microsoft/TypeScript/blob/d156bb805eba314be2fbe86e4c4ca0179380580e/src/services/completions.ts#L1627-L1631

Could the getCodeFixes request be extended to use a suggestion imports cache as well?

https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/services/codefixes/importFixes.ts#L234

Both call codeFixes.forEachExternalModuleToImportFrom, which can be very slow in a large project. Thanks!

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.