summaryrefslogtreecommitdiff
path: root/cli/tsc/99_main_compiler.js
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-03-26 15:52:20 +0000
committerGitHub <noreply@github.com>2024-03-26 15:52:20 +0000
commit3b61104e2a8984255f74827b0f1c23476ccd8209 (patch)
tree43228946e39342e6c71f87ae720f93e7f8c63901 /cli/tsc/99_main_compiler.js
parentd6452b39460ee46ade1ed9a5c95e469fd23a812c (diff)
refactor(lsp): unify config file data into ConfigTree (#23032)
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r--cli/tsc/99_main_compiler.js30
1 files changed, 11 insertions, 19 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index 32c3bf035..e6123d25e 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -503,9 +503,6 @@ delete Object.prototype.__proto__;
}
}
- /** @type {ts.CompilerOptions} */
- let compilationSettings = {};
-
/** @type {ts.LanguageService} */
let languageService;
@@ -720,7 +717,17 @@ delete Object.prototype.__proto__;
if (logDebug) {
debug("host.getCompilationSettings()");
}
- return compilationSettings;
+ const tsConfig = normalizeConfig(ops.op_ts_config());
+ const { options, errors } = ts
+ .convertCompilerOptionsFromJson(tsConfig, "");
+ Object.assign(options, {
+ allowNonTsExtensions: true,
+ allowImportingTsExtensions: true,
+ });
+ if (errors.length > 0 && logDebug) {
+ debug(ts.formatDiagnostics(errors, host));
+ }
+ return options;
},
getScriptFileNames() {
if (logDebug) {
@@ -1010,21 +1017,6 @@ delete Object.prototype.__proto__;
serverRestart();
return respond(id, true);
}
- case "$configure": {
- const config = normalizeConfig(args[0]);
- const { options, errors } = ts
- .convertCompilerOptionsFromJson(config, "");
- Object.assign(options, {
- allowNonTsExtensions: true,
- allowImportingTsExtensions: true,
- });
- if (errors.length > 0 && logDebug) {
- debug(ts.formatDiagnostics(errors, host));
- }
- compilationSettings = options;
- moduleSpecifierCache.clear();
- return respond(id, true);
- }
case "$getSupportedCodeFixes": {
return respond(
id,