diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-04-25 11:23:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 11:23:24 -0400 |
commit | c0e3b6096d37e9a4243c7ad461487db291c824fa (patch) | |
tree | 83a2cd2c0c002cb84a4f3f1accbc8805daa56701 /cli/tsc/99_main_compiler.js | |
parent | 12f7581ed9ee5324a425074d30aedd38b89d4838 (diff) |
refactor(lsp): store all the assets in Rust when initializing (#14367)
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index c124703a8..68f4f37f6 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -611,12 +611,17 @@ delete Object.prototype.__proto__; ), ); } - case "getAsset": { - const sourceFile = host.getSourceFile( - request.specifier, - ts.ScriptTarget.ESNext, - ); - return respond(id, sourceFile && sourceFile.text); + case "getAssets": { + const assets = []; + for (const sourceFile of sourceFileCache.values()) { + if (sourceFile.fileName.startsWith(ASSETS)) { + assets.push({ + specifier: sourceFile.fileName, + text: sourceFile.text, + }); + } + } + return respond(id, assets); } case "getApplicableRefactors": { return respond( |