summaryrefslogtreecommitdiff
path: root/cli/tsc
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-12-28 00:13:57 +0000
committerGitHub <noreply@github.com>2023-12-28 00:13:57 +0000
commit48dae2441c2085db345a8d2d225b2c063e740600 (patch)
tree15c7533f1ce8d830d36df2c1e74fc80a51634c0d /cli/tsc
parentc2414db1f68d27db8ca6f192f0ff877f1394164c (diff)
perf(lsp): use LanguageServiceHost::getProjectVersion() (#21719)
Diffstat (limited to 'cli/tsc')
-rw-r--r--cli/tsc/99_main_compiler.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index e1b7b462c..b4b5398bc 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -534,6 +534,9 @@ delete Object.prototype.__proto__;
// createLanguageService will call this immediately and cache it
return new CancellationToken();
},
+ getProjectVersion() {
+ return ops.op_project_version();
+ },
getSourceFile(
specifier,
languageVersion,
@@ -584,6 +587,9 @@ delete Object.prototype.__proto__;
);
sourceFile.moduleName = specifier;
sourceFile.version = version;
+ if (specifier.startsWith(ASSETS_URL_PREFIX)) {
+ sourceFile.version = "1";
+ }
sourceFileCache.set(specifier, sourceFile);
scriptVersionCache.set(specifier, version);
return sourceFile;
@@ -721,6 +727,9 @@ delete Object.prototype.__proto__;
if (logDebug) {
debug(`host.getScriptVersion("${specifier}")`);
}
+ if (specifier.startsWith(ASSETS_URL_PREFIX)) {
+ return "1";
+ }
// tsc requests the script version multiple times even though it can't
// possibly have changed, so we will memoize it on a per request basis.
if (scriptVersionCache.has(specifier)) {