Initial VS Code 1.19 source merge (#571)

* Initial 1.19 xcopy

* Fix yarn build

* Fix numerous build breaks

* Next batch of build break fixes

* More build break fixes

* Runtime breaks

* Additional post merge fixes

* Fix windows setup file

* Fix test failures.

* Update license header blocks to refer to source eula
This commit is contained in:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

View File

@@ -9,7 +9,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ActivityBarPosition {
LEFT = 0,
RIGHT = 1
};
}
export class ActivityBar {

View File

@@ -12,6 +12,7 @@ import * as stripJsonComments from 'strip-json-comments';
import { SpectronApplication, Quality } from '../../spectron/application';
describe('Debug', () => {
let skip = false;
before(async function () {
const app = this.app as SpectronApplication;
@@ -27,11 +28,13 @@ describe('Debug', () => {
if (!debugExists) {
console.warn(`Skipping debug tests because vscode-node-debug extension was not found in ${extensionsPath}`);
skip = true;
return;
}
if (!debug2Exists) {
console.warn(`Skipping debug tests because vscode-node-debug2 extension was not found in ${extensionsPath}`);
skip = true;
return;
}
@@ -44,6 +47,11 @@ describe('Debug', () => {
});
it('configure launch json', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.debug.openDebugViewlet();
@@ -69,6 +77,11 @@ describe('Debug', () => {
});
it('breakpoints', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.quickopen.openFile('index.js');
@@ -78,6 +91,11 @@ describe('Debug', () => {
let port: number;
it('start debugging', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
port = await app.workbench.debug.startDebugging();
@@ -93,6 +111,11 @@ describe('Debug', () => {
});
it('focus stack frames and variables', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.client.waitFor(() => app.workbench.debug.getLocalVariableCount(), c => c === 4, 'there should be 4 local variables');
@@ -108,6 +131,11 @@ describe('Debug', () => {
});
it('stepOver, stepIn, stepOut', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.debug.stepIn();
@@ -125,6 +153,11 @@ describe('Debug', () => {
});
it('continue', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.debug.continue();
@@ -140,12 +173,22 @@ describe('Debug', () => {
});
it('debug console', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.debug.waitForReplCommand('2 + 2', r => r === '4');
});
it('stop debugging', async function () {
if (skip) {
this.skip();
return;
}
const app = this.app as SpectronApplication;
await app.workbench.debug.stopDebugging();

View File

@@ -12,10 +12,10 @@ const RENAME_INPUT = `${RENAME_BOX} .rename-input`;
export class Editor {
private static VIEW_LINES = '.monaco-editor .view-lines';
private static LINE_NUMBERS = '.monaco-editor .margin .margin-view-overlays .line-numbers';
private static FOLDING_EXPANDED = '.monaco-editor .margin .margin-view-overlays>:nth-child(${INDEX}) .folding';
private static FOLDING_COLLAPSED = `${Editor.FOLDING_EXPANDED}.collapsed`;
private static readonly VIEW_LINES = '.monaco-editor .view-lines';
private static readonly LINE_NUMBERS = '.monaco-editor .margin .margin-view-overlays .line-numbers';
private static readonly FOLDING_EXPANDED = '.monaco-editor .margin .margin-view-overlays>:nth-child(${INDEX}) .folding';
private static readonly FOLDING_COLLAPSED = `${Editor.FOLDING_EXPANDED}.collapsed`;
constructor(private spectron: SpectronApplication) {
}

View File

@@ -7,10 +7,10 @@ import { SpectronApplication } from '../../spectron/application';
export class References {
private static REFERENCES_WIDGET = '.monaco-editor .zone-widget .zone-widget-container.peekview-widget.reference-zone-widget.results-loaded';
private static REFERENCES_TITLE_FILE_NAME = `${References.REFERENCES_WIDGET} .head .peekview-title .filename`;
private static REFERENCES_TITLE_COUNT = `${References.REFERENCES_WIDGET} .head .peekview-title .meta`;
private static REFERENCES = `${References.REFERENCES_WIDGET} .body .ref-tree.inline .monaco-tree-row .reference`;
private static readonly REFERENCES_WIDGET = '.monaco-editor .zone-widget .zone-widget-container.peekview-widget.reference-zone-widget.results-loaded';
private static readonly REFERENCES_TITLE_FILE_NAME = `${References.REFERENCES_WIDGET} .head .peekview-title .filename`;
private static readonly REFERENCES_TITLE_COUNT = `${References.REFERENCES_WIDGET} .head .peekview-title .meta`;
private static readonly REFERENCES = `${References.REFERENCES_WIDGET} .body .ref-tree.inline .monaco-tree-row .reference`;
constructor(private spectron: SpectronApplication) {
}

View File

@@ -9,8 +9,8 @@ import { Viewlet } from '../workbench/viewlet';
export class Explorer extends Viewlet {
private static EXPLORER_VIEWLET = 'div[id="workbench.view.explorer"]';
private static OPEN_EDITORS_VIEW = `${Explorer.EXPLORER_VIEWLET} .split-view-view:nth-child(1) .title`;
private static readonly EXPLORER_VIEWLET = 'div[id="workbench.view.explorer"]';
private static readonly OPEN_EDITORS_VIEW = `${Explorer.EXPLORER_VIEWLET} .split-view-view:nth-child(1) .title`;
constructor(spectron: SpectronApplication) {
super(spectron);

View File

@@ -52,12 +52,6 @@ describe('Git', () => {
it('stages correctly', async function () {
const app = this.app as SpectronApplication;
// TODO@joao get these working once joh fixes scm viewlet
if (!false) {
this.skip();
return;
}
await app.workbench.scm.openSCMViewlet();
const appJs = await app.workbench.scm.waitForChange(c => c.name === 'app.js' && c.type === 'Modified');
@@ -72,13 +66,6 @@ describe('Git', () => {
it(`stages, commits changes and verifies outgoing change`, async function () {
const app = this.app as SpectronApplication;
// TODO@joao get these working once joh fixes scm viewlet
if (!false) {
cp.execSync('git reset --hard origin/master', { cwd: app.workspacePath });
this.skip();
return;
}
await app.workbench.scm.openSCMViewlet();
const appJs = await app.workbench.scm.waitForChange(c => c.name === 'app.js' && c.type === 'Modified');

View File

@@ -13,7 +13,7 @@ const SCM_RESOURCE = `${VIEWLET} .monaco-list-row > .resource`;
const SCM_RESOURCE_GROUP = `${VIEWLET} .monaco-list-row > .resource-group`;
const REFRESH_COMMAND = `div[id="workbench.parts.sidebar"] .actions-container a.action-label[title="Refresh"]`;
const COMMIT_COMMAND = `div[id="workbench.parts.sidebar"] .actions-container a.action-label[title="Commit"]`;
const SCM_RESOURCE_CLICK = name => `${SCM_RESOURCE} .monaco-icon-label[title$="${name}"]`;
const SCM_RESOURCE_CLICK = name => `${SCM_RESOURCE} .monaco-icon-label[title*="${name}"]`;
const SCM_RESOURCE_GROUP_COMMAND_CLICK = name => `${SCM_RESOURCE_GROUP} .actions .action-label[title="${name}"]`;
export interface Change {
@@ -49,7 +49,7 @@ export class SCM extends Viewlet {
const result = await this.spectron.webclient.selectorExecute(SCM_RESOURCE,
div => (Array.isArray(div) ? div : [div]).map(element => {
const name = element.querySelector('.label-name') as HTMLElement;
const icon = element.querySelector('.monaco-icon-label') as HTMLElement;
const icon = element.querySelector('.decoration-icon') as HTMLElement;
const actionElementList = element.querySelectorAll('.actions .action-label');
const actionElements: any[] = [];
@@ -60,7 +60,7 @@ export class SCM extends Viewlet {
return {
name: name.textContent,
type: (icon.title || '').replace(/^([^,]+),.*$/, '$1'),
type: (icon.title || ''),
element,
actionElements
};

View File

@@ -17,7 +17,7 @@ describe('Multiroot', () => {
// for some reason Code opens 2 windows at this point
// so let's select the last one
await app.client.windowByIndex(2);
await app.client.windowByIndex(1);
});
it('shows results from all folders', async function () {

View File

@@ -10,7 +10,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ActivityBarPosition {
LEFT = 0,
RIGHT = 1
};
}
const SEARCH_INPUT = '.settings-search-input input';
const EDITOR = '.editable-preferences-editor-container .monaco-editor textarea';

View File

@@ -8,7 +8,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ProblemSeverity {
WARNING = 0,
ERROR = 1
};
}
export class Problems {
@@ -47,7 +47,7 @@ export class Problems {
}
public static getSelectorInEditor(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'warningsquiggly' : 'errorsquiggly';
let selector = problemType === ProblemSeverity.WARNING ? 'squiggly-b-warning' : 'squiggly-c-error';
return `.view-overlays .cdr.${selector}`;
}
}

View File

@@ -15,7 +15,7 @@ describe('Search', () => {
await app.workbench.search.openSearchViewlet();
await app.workbench.search.searchFor('body');
await app.workbench.search.waitForResultText('7 results in 4 files');
await app.workbench.search.waitForResultText('14 results in 5 files');
});
it('searches only for *.js files & checks for correct result number', async function () {
@@ -34,7 +34,7 @@ describe('Search', () => {
const app = this.app as SpectronApplication;
await app.workbench.search.searchFor('body');
await app.workbench.search.removeFileMatch(1);
await app.workbench.search.waitForResultText('3 results in 3 files');
await app.workbench.search.waitForResultText('10 results in 4 files');
});
it('replaces first search result with a replace term', async function () {
@@ -46,7 +46,7 @@ describe('Search', () => {
await app.workbench.search.replaceFileMatch(1);
await app.workbench.saveOpenedFile();
await app.workbench.search.waitForResultText('3 results in 3 files');
await app.workbench.search.waitForResultText('10 results in 4 files');
await app.workbench.search.searchFor('ydob');
await app.workbench.search.setReplaceText('body');

View File

@@ -195,7 +195,7 @@ async function setup(): Promise<void> {
* @see https://github.com/webdriverio/webdriverio/issues/2076
*/
// Filter out the following messages:
const wdioDeprecationWarning = /^WARNING: the "\w+" command will be depcrecated soon./; // [sic]
const wdioDeprecationWarning = /^WARNING: the "\w+" command will be deprecated soon../; // [sic]
// Monkey patch:
const warn = console.warn;
console.warn = function suppressWebdriverWarnings(message) {

View File

@@ -271,9 +271,9 @@ export class SpectronApplication {
await this.webclient.waitUntilWindowLoaded();
// Spectron opens multiple terminals in Windows platform
// Workaround to focus the right window - https://github.com/electron/spectron/issues/60
await this.client.windowByIndex(1);
// await this.client.windowByIndex(1);
// await this.app.browserWindow.focus();
await this.client.waitForHTML('[id="workbench.main.container"]');
await this.client.waitForElement('.monaco-workbench');
}
private async waitForWelcome(): Promise<any> {
@@ -332,6 +332,6 @@ export class SpectronApplication {
return 'Meta';
default:
return key.length === 1 ? key : key.charAt(0).toUpperCase() + key.slice(1);
};
}
}
}

View File

@@ -54,10 +54,6 @@ export class SpectronClient {
return this.waitFor(() => this.spectron.client.getValue(selector), accept, `getValue with selector ${selector}`);
}
async waitForHTML(selector: string, accept: (result: string) => boolean = (result: string) => !!result): Promise<any> {
return this.waitFor(() => this.spectron.client.getHTML(selector), accept, `getHTML with selector ${selector}`);
}
async waitAndClick(selector: string): Promise<any> {
return this.waitFor(() => this.spectron.client.click(selector), void 0, `click with selector ${selector}`);
}

1645
test/smoke/yarn.lock Normal file

File diff suppressed because it is too large Load Diff