Skip to content

Commit 43c6fd4

Browse files
authoredOct 5, 2022
Covert some of the config testing to baselines for easy validation (#51063)
* Baseline config tests for easy validation * Refactor * Fix incorrect pick * Dont print unnecessary plugin host not implemented msg in logs
1 parent fc5e72b commit 43c6fd4

File tree

635 files changed

+42505
-42961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

635 files changed

+42505
-42961
lines changed
 

‎src/server/project.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,7 @@ namespace ts.server {
16051605
}
16061606

16071607
protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void {
1608+
if (!this.projectService.globalPlugins.length) return;
16081609
const host = this.projectService.host;
16091610

16101611
if (!host.require && !host.importPlugin) {
@@ -1619,20 +1620,18 @@ namespace ts.server {
16191620
combinePaths(this.projectService.getExecutingFilePath(), "../../.."),
16201621
];
16211622

1622-
if (this.projectService.globalPlugins) {
1623-
// Enable global plugins with synthetic configuration entries
1624-
for (const globalPluginName of this.projectService.globalPlugins) {
1625-
// Skip empty names from odd commandline parses
1626-
if (!globalPluginName) continue;
1623+
// Enable global plugins with synthetic configuration entries
1624+
for (const globalPluginName of this.projectService.globalPlugins) {
1625+
// Skip empty names from odd commandline parses
1626+
if (!globalPluginName) continue;
16271627

1628-
// Skip already-locally-loaded plugins
1629-
if (options.plugins && options.plugins.some(p => p.name === globalPluginName)) continue;
1628+
// Skip already-locally-loaded plugins
1629+
if (options.plugins && options.plugins.some(p => p.name === globalPluginName)) continue;
16301630

1631-
// Provide global: true so plugins can detect why they can't find their config
1632-
this.projectService.logger.info(`Loading global plugin ${globalPluginName}`);
1631+
// Provide global: true so plugins can detect why they can't find their config
1632+
this.projectService.logger.info(`Loading global plugin ${globalPluginName}`);
16331633

1634-
this.enablePlugin({ name: globalPluginName, global: true } as PluginImport, searchPaths, pluginConfigOverrides);
1635-
}
1634+
this.enablePlugin({ name: globalPluginName, global: true } as PluginImport, searchPaths, pluginConfigOverrides);
16361635
}
16371636
}
16381637

@@ -2521,6 +2520,7 @@ namespace ts.server {
25212520

25222521
/*@internal*/
25232522
enablePluginsWithOptions(options: CompilerOptions, pluginConfigOverrides: ESMap<string, any> | undefined): void {
2523+
if (!options.plugins?.length && !this.projectService.globalPlugins.length) return;
25242524
const host = this.projectService.host;
25252525
if (!host.require && !host.importPlugin) {
25262526
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");

‎src/testRunner/unittests/config/commandLineParsing.ts

+147-960
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.