diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-01-08 17:05:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 17:05:05 +0000 |
commit | ee45d5bf8f2e1826b2a106b030abe891cfc0b37c (patch) | |
tree | f1106d46d3558b8d3eac2e5fcdcb4642413d1560 /cli/tsc/99_main_compiler.js | |
parent | 43d2ecd4f056bf38fe5f5656e550061c68c717f0 (diff) |
perf(lsp): use host-owned cache for auto-import completions (#21852)
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 766bc0e6e..5009807e1 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -537,6 +537,14 @@ delete Object.prototype.__proto__; getProjectVersion() { return ops.op_project_version(); }, + // @ts-ignore Undocumented method. + getModuleSpecifierCache() { + return moduleSpecifierCache; + }, + // @ts-ignore Undocumented method. + getCachedExportInfoMap() { + return exportMapCache; + }, getSourceFile( specifier, languageVersion, @@ -766,6 +774,12 @@ delete Object.prototype.__proto__; }, }; + // @ts-ignore Undocumented function. + const moduleSpecifierCache = ts.server.createModuleSpecifierCache(host); + + // @ts-ignore Undocumented function. + const exportMapCache = ts.createCacheableExportInfoMap(host); + // override the npm install @types package diagnostics to be deno specific ts.setLocalizedDiagnosticMessages((() => { const nodeMessage = "Cannot find name '{0}'."; // don't offer any suggestions |