Skip to content

Commit

Permalink
address review comment:
Browse files Browse the repository at this point in the history
- move preferences to right location
- remove unused code
- remove confusing Test Explorer preference
  • Loading branch information
rschnekenbu committed Jun 26, 2024
1 parent 5d98e70 commit 7ff7879
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class PreferenceTreeGenerator {
['search', 'features'],
['task', 'features'],
['terminal', 'features'],
['testing', 'features'],
['toolbar', 'features'],
['webview', 'features'],
['workspace', 'application'],
Expand Down
18 changes: 1 addition & 17 deletions packages/test/src/browser/test-execution-progress-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
// *****************************************************************************

import { inject, injectable } from '@theia/core/shared/inversify';
import { ApplicationShell, Widget, WidgetManager } from '@theia/core/lib/browser';
import { Widget } from '@theia/core/lib/browser';
import { TestResultViewContribution } from './view/test-result-view-contribution';
import { TestService } from './test-service';
import { TestViewContribution } from './view/test-view-contribution';
import { TestPreferences } from './test-preferences';

Expand All @@ -30,21 +29,12 @@ export const TestExecutionProgressService = Symbol('TestExecutionProgressService
@injectable()
export class DefaultTestExecutionProgressService implements TestExecutionProgressService {

@inject(WidgetManager)
protected readonly widgetManager: WidgetManager;

@inject(ApplicationShell)
protected readonly shell: ApplicationShell;

@inject(TestResultViewContribution)
protected readonly testResultView: TestResultViewContribution;

@inject(TestViewContribution)
protected readonly testView: TestViewContribution;

@inject(TestService)
protected readonly testService: TestService;

@inject(TestPreferences)
protected readonly testPreferences: TestPreferences;

Expand All @@ -53,17 +43,11 @@ export class DefaultTestExecutionProgressService implements TestExecutionProgres
const openTesting = this.testPreferences['testing.openTesting'];
if (openTesting === 'openOnTestStart') {
this.openTestResultView();
} else if (openTesting === 'openExplorerOnTestStart') {
this.openTestExplorerView();
}
}
}

async openTestResultView(): Promise<Widget> {
return this.testResultView.openView({ activate: true });
}

async openTestExplorerView(): Promise<Widget> {
return this.testView.openView({ activate: true });
}
}
5 changes: 2 additions & 3 deletions packages/test/src/browser/test-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ export const TestConfigSchema: PreferenceSchema = {
properties: {
'testing.openTesting': {
type: 'string',
enum: ['neverOpen', 'openOnTestStart', 'openExplorerOnTestStart'],
enum: ['neverOpen', 'openOnTestStart'],
enumDescriptions: [
nls.localizeByDefault('Never automatically open the testing views'),
nls.localizeByDefault('Open the test results view when tests start'),
nls.localizeByDefault('Open the test explorer when tests start'),
],
description: nls.localizeByDefault('Controls when the testing view should open.'),
default: 'neverOpen',
Expand All @@ -37,7 +36,7 @@ export const TestConfigSchema: PreferenceSchema = {
};

export interface TestConfiguration {
'testing.openTesting': 'neverOpen' | 'openOnTestStart' | 'openExplorerOnTestStart';
'testing.openTesting': 'neverOpen' | 'openOnTestStart';
}

export const TestPreferenceContribution = Symbol('TestPreferenceContribution');
Expand Down

0 comments on commit 7ff7879

Please sign in to comment.