mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
perf(lsp): use host-owned cache for auto-import completions (#21852)
This commit is contained in:
parent
5ef16d0a08
commit
8a25d21380
1 changed files with 14 additions and 0 deletions
|
@ -537,6 +537,14 @@ delete Object.prototype.__proto__;
|
||||||
getProjectVersion() {
|
getProjectVersion() {
|
||||||
return ops.op_project_version();
|
return ops.op_project_version();
|
||||||
},
|
},
|
||||||
|
// @ts-ignore Undocumented method.
|
||||||
|
getModuleSpecifierCache() {
|
||||||
|
return moduleSpecifierCache;
|
||||||
|
},
|
||||||
|
// @ts-ignore Undocumented method.
|
||||||
|
getCachedExportInfoMap() {
|
||||||
|
return exportMapCache;
|
||||||
|
},
|
||||||
getSourceFile(
|
getSourceFile(
|
||||||
specifier,
|
specifier,
|
||||||
languageVersion,
|
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
|
// override the npm install @types package diagnostics to be deno specific
|
||||||
ts.setLocalizedDiagnosticMessages((() => {
|
ts.setLocalizedDiagnosticMessages((() => {
|
||||||
const nodeMessage = "Cannot find name '{0}'."; // don't offer any suggestions
|
const nodeMessage = "Cannot find name '{0}'."; // don't offer any suggestions
|
||||||
|
|
Loading…
Reference in a new issue