diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 1ca402bf14f..ac1f80cae0e 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -10,7 +10,7 @@ import { Ref, RefType, Git, GitErrorCodes, Branch } from './git'; import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository'; import { Model } from './model'; import { toGitUri, fromGitUri } from './uri'; -import { grep, isDescendant } from './util'; +import { grep, isDescendant, pathEquals } from './util'; import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange, getModifiedRange } from './staging'; import * as path from 'path'; import { lstat, Stats } from 'fs'; @@ -1737,7 +1737,7 @@ export class CommandCenter { } // Could it be a submodule? - if (resource.fsPath === repository.root) { + if (pathEquals(resource.fsPath, repository.root)) { repository = this.model.getRepositoryForSubmodule(resource) || repository; } diff --git a/extensions/git/src/contentProvider.ts b/extensions/git/src/contentProvider.ts index 67b36b3feca..443dd774f2a 100644 --- a/extensions/git/src/contentProvider.ts +++ b/extensions/git/src/contentProvider.ts @@ -9,7 +9,7 @@ import { workspace, Uri, Disposable, Event, EventEmitter, window } from 'vscode' import { debounce, throttle } from './decorators'; import { fromGitUri, toGitUri } from './uri'; import { Model, ModelChangeEvent, OriginalResourceChangeEvent } from './model'; -import { filterEvent, eventToPromise, isDescendant } from './util'; +import { filterEvent, eventToPromise, isDescendant, pathEquals } from './util'; interface CacheRow { uri: Uri; @@ -130,7 +130,7 @@ export class GitContentProvider { const { path } = fromGitUri(row.uri); const isOpen = workspace.textDocuments .filter(d => d.uri.scheme === 'file') - .some(d => d.uri.fsPath === path); + .some(d => pathEquals(d.uri.fsPath, path)); if (isOpen || now - row.timestamp < THREE_MINUTES) { cache[row.uri.toString()] = row; diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts index ec3f7887e98..c65b56a3686 100644 --- a/extensions/git/src/util.ts +++ b/extensions/git/src/util.ts @@ -324,3 +324,13 @@ export function isDescendant(parent: string, descendant: string): boolean { return descendant.startsWith(parent); } + +export function pathEquals(a: string, b: string): boolean { + // Windows is case insensitive + if (isWindowsPath(a)) { + a = a.toLowerCase(); + b = b.toLowerCase(); + } + + return a === b; +} \ No newline at end of file diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 62f27b14835..05859b26f37 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -260,7 +260,7 @@ const editorConfiguration: IConfigurationNode = { 'editor.scrollBeyondLastColumn': { 'type': 'number', 'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn, - 'description': nls.localize('scrollBeyondLastColumn', "Controls if the editor will scroll beyond the last column") + 'description': nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally") }, 'editor.smoothScrolling': { 'type': 'boolean', diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index 19618c36a72..8c0c2affb4a 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -49,7 +49,7 @@ export class InstantiationService implements IInstantiationService { get: (id: ServiceIdentifier, isOptional?: typeof optional) => { const result = this._getOrCreateServiceInstance(id); if (!result && isOptional !== optional) { - throw new Error(`[invokeFunction] unkown service '${id}'`); + throw new Error(`[invokeFunction] unknown service '${id}'`); } return result; } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e0ae923769c..8ce7c11aaf3 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -6056,6 +6056,18 @@ declare module 'vscode' { export function createTreeView(viewId: string, options: { treeDataProvider: TreeDataProvider }): TreeView; } + /** + * The event that is fired when an element in the [TreeView](#TreeView) is expanded or collapsed + */ + export interface TreeViewExpansionEvent { + + /** + * Element that is expanded or collapsed. + */ + element: T; + + } + /** * Represents a Tree view */ @@ -6064,12 +6076,12 @@ declare module 'vscode' { /** * Event that is fired when an element is expanded */ - readonly onDidExpandElement: Event; + readonly onDidExpandElement: Event>; /** * Event that is fired when an element is collapsed */ - readonly onDidCollapseElement: Event; + readonly onDidCollapseElement: Event>; /** * Currently selected elements. diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts index c332e599c2f..499e859b46f 100644 --- a/src/vs/workbench/api/node/extHostTreeViews.ts +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -116,11 +116,11 @@ class ExtHostTreeView extends Disposable { private _selectedElements: T[] = []; get selectedElements(): T[] { return this._selectedElements; } - private _onDidExpandElement: Emitter = this._register(new Emitter()); - readonly onDidExpandElement: Event = this._onDidExpandElement.event; + private _onDidExpandElement: Emitter> = this._register(new Emitter>()); + readonly onDidExpandElement: Event> = this._onDidExpandElement.event; - private _onDidCollapseElement: Emitter = this._register(new Emitter()); - readonly onDidCollapseElement: Event = this._onDidCollapseElement.event; + private _onDidCollapseElement: Emitter> = this._register(new Emitter>()); + readonly onDidCollapseElement: Event> = this._onDidCollapseElement.event; private refreshPromise: TPromise = TPromise.as(null); @@ -174,9 +174,9 @@ class ExtHostTreeView extends Disposable { const element = this.getExtensionElement(treeItemHandle); if (element) { if (expanded) { - this._onDidExpandElement.fire(element); + this._onDidExpandElement.fire({ element }); } else { - this._onDidCollapseElement.fire(element); + this._onDidCollapseElement.fire({ element }); } } } diff --git a/src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts b/src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts index 42a1f7bdcc5..f6dd6bb695b 100644 --- a/src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts +++ b/src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts @@ -37,14 +37,14 @@ import { IDecorationOptions } from 'vs/editor/common/editorCommon'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; const $ = dom.$; -const IPrivateBreakopintWidgetService = createDecorator('privateBreakopintWidgetService'); -export interface IPrivateBreakopintWidgetService { +const IPrivateBreakpointWidgetService = createDecorator('privateBreakopintWidgetService'); +export interface IPrivateBreakpointWidgetService { _serviceBrand: any; close(success: boolean): void; } const DECORATION_KEY = 'breakpointwidgetdecoration'; -export class BreakpointWidget extends ZoneWidget implements IPrivateBreakopintWidgetService { +export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWidgetService { public _serviceBrand: any; private selectContainer: HTMLElement; @@ -201,7 +201,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakopintWi this.toDispose.push(scopedContextKeyService); const scopedInstatiationService = this.instantiationService.createChild(new ServiceCollection( - [IContextKeyService, scopedContextKeyService], [IPrivateBreakopintWidgetService, this])); + [IContextKeyService, scopedContextKeyService], [IPrivateBreakpointWidgetService, this])); const options = SimpleDebugEditor.getEditorOptions(); const codeEditorWidgetOptions = SimpleDebugEditor.getCodeEditorWidgetOptions(); @@ -306,7 +306,7 @@ class AcceptBreakpointWidgetInputAction extends EditorCommand { } public runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor): void { - accessor.get(IPrivateBreakopintWidgetService).close(true); + accessor.get(IPrivateBreakpointWidgetService).close(true); } } @@ -331,7 +331,7 @@ class CloseBreakpointWidgetCommand extends EditorCommand { return debugContribution.closeBreakpointWidget(); } - accessor.get(IPrivateBreakopintWidgetService).close(false); + accessor.get(IPrivateBreakpointWidgetService).close(false); } } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index 3c6856c9960..bb190693b18 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -195,7 +195,9 @@ export class DebugEditorContribution implements IDebugEditorContribution { const breakpoints = this.debugService.getModel().getBreakpoints({ uri, lineNumber }); if (breakpoints.length) { - if (breakpoints.some(bp => !!bp.condition || !!bp.logMessage || !!bp.hitCondition)) { + // Show the dialog if there is a potential condition to be accidently lost. + // Do not show dialog on linux due to electron issue freezing the mouse #50026 + if (!env.isLinux && breakpoints.some(bp => !!bp.condition || !!bp.logMessage || !!bp.hitCondition)) { const logPoint = breakpoints.every(bp => !!bp.logMessage); const breakpointType = logPoint ? nls.localize('logPoint', "Logpoint") : nls.localize('breakpoint', "Breakpoint"); this.dialogService.show(severity.Info, nls.localize('breakpointHasCondition', "This {0} has a {1} that will get lost on remove. Consider disabling the {0} instead.", diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts index b996540352b..e8f75087d6f 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts @@ -374,9 +374,9 @@ export class ExtensionEditor extends BaseEditor { this.navbar.clear(); this.navbar.onChange(this.onNavbarChange.bind(this, extension), this, this.transientDisposables); this.navbar.push(NavbarSection.Readme, localize('details', "Details"), localize('detailstooltip', "Extension details, rendered from the extension's 'README.md' file")); - this.navbar.push(NavbarSection.Contributions, localize('contributions', "Contributions"), localize('contributionstooltip', "Extension contributions to the VS Code editor")); + this.navbar.push(NavbarSection.Contributions, localize('contributions', "Contributions"), localize('contributionstooltip', "Lists contributions to VS Code by this extension")); this.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"), localize('changelogtooltip', "Extension update history, rendered from the extension's 'CHANGELOG.md' file")); - this.navbar.push(NavbarSection.Dependencies, localize('dependencies', "Dependencies"), localize('dependenciestooltip', "Extension dependencies, lists other extensions this extension depends on")); + this.navbar.push(NavbarSection.Dependencies, localize('dependencies', "Dependencies"), localize('dependenciestooltip', "Lists extensions this extension depends on")); this.editorLoadComplete = true; return super.setInput(input, options, token); diff --git a/src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts b/src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts index 3b8c5844fc1..68a32a1d0b1 100644 --- a/src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts +++ b/src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts @@ -8,6 +8,7 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { localize } from 'vs/nls'; import { IViewsService, ViewLocation, ViewsRegistry, IViewDescriptor } from 'vs/workbench/common/views'; import { OutlinePanel } from './outlinePanel'; +import { MenuRegistry } from 'vs/platform/actions/common/actions'; const _outlineDesc = { id: 'code.outline', @@ -25,3 +26,9 @@ CommandsRegistry.registerCommand('outline.focus', accessor => { let viewsService = accessor.get(IViewsService); return viewsService.openView(_outlineDesc.id, true); }); + +MenuRegistry.addCommand({ + id: 'outline.focus', + category: localize('category.focus', "File"), + title: localize('label.focus', "Focus on Outline") +}); diff --git a/src/vs/workbench/parts/outline/electron-browser/outlineModel.ts b/src/vs/workbench/parts/outline/electron-browser/outlineModel.ts index 80adc3d19e7..2f02c46a0e9 100644 --- a/src/vs/workbench/parts/outline/electron-browser/outlineModel.ts +++ b/src/vs/workbench/parts/outline/electron-browser/outlineModel.ts @@ -13,6 +13,7 @@ import { IPosition } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { first, size } from 'vs/base/common/collections'; import { isFalsyOrEmpty } from 'vs/base/common/arrays'; +import { commonPrefixLength } from 'vs/base/common/strings'; export type FuzzyScore = [number, number[]]; @@ -21,20 +22,38 @@ export abstract class TreeElement { abstract children: { [id: string]: TreeElement }; abstract parent: TreeElement | any; - static findId(candidate: string, container: TreeElement): string { + static findId(candidate: SymbolInformation | string, container: TreeElement): string { // complex id-computation which contains the origin/extension, // the parent path, and some dedupe logic when names collide - let id = container.id + candidate; - for (let i = 1; container.children[id] !== void 0; i++) { - id = container.id + candidate + i; + let candidateId: string; + if (typeof candidate === 'string') { + candidateId = `${container.id}/${candidate}`; + } else { + candidateId = `${container.id}/${candidate.name}`; + if (container.children[candidateId] !== void 0) { + candidateId = `${container.id}/${candidate.name}_${candidate.definingRange.startLineNumber}_${candidate.definingRange.startColumn}`; + } } + + let id = candidateId; + for (let i = 0; container.children[id] !== void 0; i++) { + id = `${candidateId}_${i}`; + } + return id; } static getElementById(id: string, element: TreeElement): TreeElement { - if (element.id === id) { + if (!id) { + return undefined; + } + let len = commonPrefixLength(id, element.id); + if (len === id.length) { return element; } + if (len < element.id.length) { + return undefined; + } for (const key in element.children) { let candidate = TreeElement.getElementById(id, element.children[key]); if (candidate) { @@ -174,7 +193,7 @@ export class OutlineModel extends TreeElement { } private static _makeOutlineElement(info: SymbolInformation, container: OutlineGroup | OutlineElement): void { - let id = TreeElement.findId(info.name, container); + let id = TreeElement.findId(info, container); let res = new OutlineElement(id, container, info); if (info.children) { for (const childInfo of info.children) { diff --git a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts b/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts index c2e19eb1320..7d05b564bb6 100644 --- a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts +++ b/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts @@ -96,6 +96,7 @@ class RequestOracle { } if (!codeEditor || !codeEditor.getModel()) { + this._lastState = undefined; this._callback(undefined, undefined); return; } @@ -116,13 +117,17 @@ class RequestOracle { this._callback(codeEditor, undefined); let handle: number; - let listener = codeEditor.onDidChangeModelContent(event => { + let contentListener = codeEditor.onDidChangeModelContent(event => { handle = setTimeout(() => this._callback(codeEditor, event), 150); }); + let modeListener = codeEditor.onDidChangeModelLanguage(_ => { + this._callback(codeEditor, undefined); + }); this._sessionDisposable = { dispose() { - listener.dispose(); + contentListener.dispose(); clearTimeout(handle); + modeListener.dispose(); } }; } @@ -372,7 +377,6 @@ export class OutlinePanel extends ViewsViewletPanel { return this._showMessage(localize('no-editor', "There are no editors open that can provide outline information.")); } - dom.removeClass(this._domNode, 'message'); let textModel = editor.getModel(); let model = await asDisposablePromise(OutlineModel.create(textModel), undefined, this._editorDisposables).promise; @@ -380,12 +384,18 @@ export class OutlinePanel extends ViewsViewletPanel { return; } + let newSize = TreeElement.size(model); + if (newSize > 7500) { + // this is a workaround for performance issues with the tree: https://github.com/Microsoft/vscode/issues/18180 + return this._showMessage(localize('too-many-symbols', "We are sorry, but this file is too large for showing an outline.")); + } + + dom.removeClass(this._domNode, 'message'); let oldModel = this._tree.getInput(); if (event && oldModel) { // heuristic: when the symbols-to-lines ratio changes by 50% between edits // wait a little (and hope that the next change isn't as drastic). - let newSize = TreeElement.size(model); let newLength = textModel.getValueLength(); let newRatio = newSize / newLength; let oldSize = TreeElement.size(oldModel); diff --git a/src/vs/workbench/parts/outline/electron-browser/outlineTree.ts b/src/vs/workbench/parts/outline/electron-browser/outlineTree.ts index f2728ea95a3..a5c7c781a3c 100644 --- a/src/vs/workbench/parts/outline/electron-browser/outlineTree.ts +++ b/src/vs/workbench/parts/outline/electron-browser/outlineTree.ts @@ -70,15 +70,17 @@ export class OutlineDataSource implements IDataSource { return element.id; } - hasChildren(tree: ITree, element: TreeElement): boolean { + hasChildren(tree: ITree, element: OutlineModel | OutlineGroup | OutlineElement): boolean { if (element instanceof OutlineModel) { return true; } if (element instanceof OutlineElement && !element.score) { return false; } - for (const _ in element.children) { - return true; + for (const id in element.children) { + if (element.children[id].score) { + return true; + } } return false; } diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts index 2c0ca2a7e8e..ab0cfe703ed 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts @@ -198,16 +198,13 @@ export class DefineKeybindingWidget extends Widget { printExisting(numberOfExisting: number): void { if (numberOfExisting > 0) { - let outputString: string = nls.localize('defineKeybinding.existing', "Existing"); - outputString = numberOfExisting + ' ' + outputString; - let textNode = document.createTextNode(outputString); - let textSpan = document.createElement('span'); - dom.addClass(textSpan, 'existingText'); - textSpan.appendChild(textNode); - this._showExistingKeybindingsNode.appendChild(textSpan); - textSpan.onmousedown = (e) => { e.preventDefault(); }; - textSpan.onmouseup = (e) => { e.preventDefault(); }; - textSpan.onclick = () => { this._onShowExistingKeybindings.fire(this.getUserSettingsLabel()); }; + const existingElement = dom.$('span.existingText'); + const text = numberOfExisting === 1 ? nls.localize('defineKeybinding.oneExists', "1 existing command has this keybinding", numberOfExisting) : nls.localize('defineKeybinding.existing', "{0} existing commands have this keybinding", numberOfExisting); + dom.append(existingElement, document.createTextNode(text)); + this._showExistingKeybindingsNode.appendChild(existingElement); + existingElement.onmousedown = (e) => { e.preventDefault(); }; + existingElement.onmouseup = (e) => { e.preventDefault(); }; + existingElement.onclick = () => { this._onShowExistingKeybindings.fire(this.getUserSettingsLabel()); }; } } diff --git a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts index 518a6146d12..a5adc6ab4b7 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts @@ -23,6 +23,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IEditorInput } from 'vs/workbench/common/editor'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { isEqual } from 'vs/base/common/paths'; +import { isLinux } from 'vs/base/common/platform'; const schemaRegistry = Registry.as(JSONContributionRegistry.Extensions.JSONContribution); @@ -79,7 +81,7 @@ export class PreferencesContribution implements IWorkbenchContribution { } // Global User Settings File - if (resource.fsPath === this.environmentService.appSettingsPath) { + if (isEqual(resource.fsPath, this.environmentService.appSettingsPath, !isLinux)) { return { override: this.preferencesService.openGlobalSettings(options, group) }; } diff --git a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts index 6f8a8293ada..ecf1f0dac18 100644 --- a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts @@ -603,7 +603,7 @@ configurationRegistry.registerConfiguration({ type: 'string', enum: ['sidebar', 'panel'], default: 'sidebar', - description: nls.localize('search.location', "Controls if the search will be shown as a view in the sidebar or as a panel in the panel area for more horizontal space. Next release search in panel will have improved horizontal layout and this will no longer be a preview."), + description: nls.localize('search.location', "Controls if the search will be shown as a view in the sidebar or as a panel in the panel area for more horizontal space."), } } }); diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 6b86202d1a1..8106f9cf483 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -32,6 +32,7 @@ import { ITextBufferFactory } from 'vs/editor/common/model'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; import { INotificationService } from 'vs/platform/notification/common/notification'; +import { isLinux } from 'vs/base/common/platform'; /** * The text file editor model listens to changes to its underlying code editor model and saves these changes through the file service back to the disk. @@ -780,7 +781,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private isSettingsFile(): boolean { // Check for global settings file - if (this.resource.fsPath === this.environmentService.appSettingsPath) { + if (path.isEqual(this.resource.fsPath, this.environmentService.appSettingsPath, !isLinux)) { return true; } diff --git a/test/smoke/src/areas/debug/debug.test.ts b/test/smoke/src/areas/debug/debug.test.ts index 468bd358ba9..b193d856cfa 100644 --- a/test/smoke/src/areas/debug/debug.test.ts +++ b/test/smoke/src/areas/debug/debug.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -// import * as http from 'http'; +import * as http from 'http'; import * as path from 'path'; import * as fs from 'fs'; import * as stripJsonComments from 'strip-json-comments'; @@ -43,74 +43,74 @@ export function setup() { await app.workbench.debug.setBreakpointOnLine(6); }); - // let port: number; - // it('start debugging', async function () { - // const app = this.app as Application; + let port: number; + it('start debugging', async function () { + const app = this.app as Application; - // // TODO@isidor - // await new Promise(c => setTimeout(c, 100)); + // TODO@isidor + await new Promise(c => setTimeout(c, 100)); - // port = await app.workbench.debug.startDebugging(); + port = await app.workbench.debug.startDebugging(); - // await new Promise((c, e) => { - // const request = http.get(`http://localhost:${port}`); - // request.on('error', e); - // app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, 'looking for index.js and line 6').then(c, e); - // }); - // }); + await new Promise((c, e) => { + const request = http.get(`http://localhost:${port}`); + request.on('error', e); + app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, 'looking for index.js and line 6').then(c, e); + }); + }); - // it('focus stack frames and variables', async function () { - // const app = this.app as Application; + it('focus stack frames and variables', async function () { + const app = this.app as Application; - // await app.workbench.debug.waitForVariableCount(4); + await app.workbench.debug.waitForVariableCount(4); - // await app.workbench.debug.focusStackFrame('layer.js', 'looking for layer.js'); - // await app.workbench.debug.waitForVariableCount(5); + await app.workbench.debug.focusStackFrame('layer.js', 'looking for layer.js'); + await app.workbench.debug.waitForVariableCount(5); - // await app.workbench.debug.focusStackFrame('route.js', 'looking for route.js'); - // await app.workbench.debug.waitForVariableCount(3); + await app.workbench.debug.focusStackFrame('route.js', 'looking for route.js'); + await app.workbench.debug.waitForVariableCount(3); - // await app.workbench.debug.focusStackFrame('index.js', 'looking for index.js'); - // await app.workbench.debug.waitForVariableCount(4); - // }); + await app.workbench.debug.focusStackFrame('index.js', 'looking for index.js'); + await app.workbench.debug.waitForVariableCount(4); + }); - // it('stepOver, stepIn, stepOut', async function () { - // const app = this.app as Application; + it('stepOver, stepIn, stepOut', async function () { + const app = this.app as Application; - // await app.workbench.debug.stepIn(); + await app.workbench.debug.stepIn(); - // const first = await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js', 'looking for response.js'); - // await app.workbench.debug.stepOver(); + const first = await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js', 'looking for response.js'); + await app.workbench.debug.stepOver(); - // await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js' && sf.lineNumber === first.lineNumber + 1, `looking for response.js and line ${first.lineNumber + 1}`); - // await app.workbench.debug.stepOut(); + await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js' && sf.lineNumber === first.lineNumber + 1, `looking for response.js and line ${first.lineNumber + 1}`); + await app.workbench.debug.stepOut(); - // await app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 7, `looking for index.js and line 7`); - // }); + await app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 7, `looking for index.js and line 7`); + }); - // it('continue', async function () { - // const app = this.app as Application; + it('continue', async function () { + const app = this.app as Application; - // await app.workbench.debug.continue(); + await app.workbench.debug.continue(); - // await new Promise((c, e) => { - // const request = http.get(`http://localhost:${port}`); - // request.on('error', e); - // app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, `looking for index.js and line 6`).then(c, e); - // }); + await new Promise((c, e) => { + const request = http.get(`http://localhost:${port}`); + request.on('error', e); + app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, `looking for index.js and line 6`).then(c, e); + }); - // }); + }); - // it('debug console', async function () { - // const app = this.app as Application; + it('debug console', async function () { + const app = this.app as Application; - // await app.workbench.debug.waitForReplCommand('2 + 2', r => r === '4'); - // }); + await app.workbench.debug.waitForReplCommand('2 + 2', r => r === '4'); + }); - // it('stop debugging', async function () { - // const app = this.app as Application; + it('stop debugging', async function () { + const app = this.app as Application; - // await app.workbench.debug.stopDebugging(); - // }); + await app.workbench.debug.stopDebugging(); + }); }); } \ No newline at end of file diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 9d2262a1dc7..98b654dcbb1 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -188,8 +188,8 @@ async function setupRepository(): Promise { cp.spawnSync('git', ['clean', '-xdf'], { cwd: workspacePath }); } - console.log('*** Running npm install...'); - cp.execSync('npm install', { cwd: workspacePath, stdio: 'inherit' }); + console.log('*** Running yarn...'); + cp.execSync('yarn --verbose', { cwd: workspacePath, stdio: 'inherit' }); } }