Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SpectronApplication } from '../../spectron/application';
export enum ProblemSeverity {
WARNING = 0,
ERROR = 1
};
export class Problems {
static PROBLEMS_VIEW_SELECTOR = '.panel.markers-panel';
constructor(private spectron: SpectronApplication) {
// noop
}
public async showProblemsView(): Promise<any> {
if (!await this.isVisible()) {
await this.spectron.runCommand('workbench.actions.view.problems');
await this.waitForProblemsView();
}
}
public async hideProblemsView(): Promise<any> {
if (await this.isVisible()) {
await this.spectron.runCommand('workbench.actions.view.problems');
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR, el => !el);
}
}
public async isVisible(): Promise<boolean> {
const element = await this.spectron.client.element(Problems.PROBLEMS_VIEW_SELECTOR);
return !!element;
}
public async waitForProblemsView(): Promise<void> {
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
}
public static getSelectorInProblemsView(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'warning' : 'error';
return `div[aria-label="Problems grouped by files"] .icon.${selector}`;
}
public static getSelectorInEditor(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'warningsquiggly' : 'errorsquiggly';
return `.view-overlays .cdr.${selector}`;
}
}