diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts index 2844d654431b92d68fefb19e116dc65cdba8e38e..97926f7e12a7435c6832685826092b445bf9748a 100644 --- a/src/vs/editor/browser/controller/textAreaInput.ts +++ b/src/vs/editor/browser/controller/textAreaInput.ts @@ -11,7 +11,7 @@ import * as strings from 'vs/base/common/strings'; import Event, { Emitter } from 'vs/base/common/event'; import { KeyCode } from 'vs/base/common/keyCodes'; import { Disposable } from 'vs/base/common/lifecycle'; -import { ITypeData, TextAreaState, ITextAreaWrapper, log } from 'vs/editor/browser/controller/textAreaState'; +import { ITypeData, TextAreaState, ITextAreaWrapper } from 'vs/editor/browser/controller/textAreaState'; import * as browser from 'vs/base/browser/browser'; import * as platform from 'vs/base/common/platform'; import * as dom from 'vs/base/browser/dom'; @@ -220,7 +220,6 @@ export class TextAreaInput extends Disposable { })); this._register(dom.addDisposableListener(textArea.domNode, 'input', () => { - log.push(`${Date.now()}: input, last known state: ${this._textAreaState}, current state: ${this._textAreaState.readFromTextArea(this._textArea)}`); // Pretend here we touched the text area, as the `input` event will most likely // result in a `selectionchange` event which we want to ignore this._textArea.setIgnoreSelectionChangeTime('received input event'); diff --git a/src/vs/editor/browser/controller/textAreaState.ts b/src/vs/editor/browser/controller/textAreaState.ts index 9c9220681a60facb4acc32cb517706b20474d504..88389a1c9245f3a578ab615469302b172e91c738 100644 --- a/src/vs/editor/browser/controller/textAreaState.ts +++ b/src/vs/editor/browser/controller/textAreaState.ts @@ -9,9 +9,6 @@ import { Position } from 'vs/editor/common/core/position'; import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; import * as strings from 'vs/base/common/strings'; -export let log: string[] = []; -(this).myLog = log; - export interface ITextAreaWrapper { getValue(): string; setValue(reason: string, value: string): void; @@ -76,7 +73,6 @@ export class TextAreaState { } public writeToTextArea(reason: string, textArea: ITextAreaWrapper, select: boolean): void { - log.push(`${Date.now()}: writeToTextArea - ${reason} - ${this}`); // console.log(Date.now() + ': applyToTextArea ' + reason + ': ' + this.toString()); textArea.setValue(reason, this.value); if (select) { diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index 1dc419d8d79ee98eb06d6549789f09b1db8afafb..e44a52866656907ce1c5ef842ccd1463f79fc130 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -14,7 +14,6 @@ import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents'; import { CoreNavigationCommands, CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; import { Configuration } from 'vs/editor/browser/config/configuration'; -import { log } from 'vs/editor/browser/controller/textAreaState'; export interface ExecCoreEditorCommandFunc { (editorCommand: CoreEditorCommand, args: any): void; @@ -64,7 +63,6 @@ export class ViewController { } public paste(source: string, text: string, pasteOnNewLine: boolean): void { - log.push(`${Date.now()}: viewController.paste: ${text}, ${pasteOnNewLine}`); this.commandService.executeCommand(editorCommon.Handler.Paste, { text: text, pasteOnNewLine: pasteOnNewLine, @@ -72,14 +70,12 @@ export class ViewController { } public type(source: string, text: string): void { - log.push(`${Date.now()}: viewController.type: ${text}`); this.commandService.executeCommand(editorCommon.Handler.Type, { text: text }); } public replacePreviousChar(source: string, text: string, replaceCharCnt: number): void { - log.push(`${Date.now()}: viewController.replacePreviousChar: ${text}, ${replaceCharCnt}`); this.commandService.executeCommand(editorCommon.Handler.ReplacePreviousChar, { text: text, replaceCharCnt: replaceCharCnt @@ -87,22 +83,18 @@ export class ViewController { } public compositionStart(source: string): void { - log.push(`${Date.now()}: viewController.compositionStart`); this.commandService.executeCommand(editorCommon.Handler.CompositionStart, {}); } public compositionEnd(source: string): void { - log.push(`${Date.now()}: viewController.compositionEnd`); this.commandService.executeCommand(editorCommon.Handler.CompositionEnd, {}); } public cut(source: string): void { - log.push(`${Date.now()}: viewController.cut`); this.commandService.executeCommand(editorCommon.Handler.Cut, {}); } public setSelection(source: string, modelSelection: Selection): void { - log.push(`${Date.now()}: viewController.setSelection: ${modelSelection}`); this._execCoreEditorCommandFunc(CoreNavigationCommands.SetSelection, { source: source, selection: modelSelection diff --git a/test/smoke/src/areas/workbench/data-loss.test.ts b/test/smoke/src/areas/workbench/data-loss.test.ts index 5eb4a801fd6ccd17cb33ffd2fad871644b007968..68d7dd1b377c3d53ee5a82cffdde5fc553e56069 100644 --- a/test/smoke/src/areas/workbench/data-loss.test.ts +++ b/test/smoke/src/areas/workbench/data-loss.test.ts @@ -8,41 +8,32 @@ import { SpectronApplication } from '../../spectron/application'; describe('Dataloss', () => { let app: SpectronApplication; before(() => { app = new SpectronApplication(); return app.start('Dataloss'); }); - after(async () => { - const log = await app.client.spectron.client.execute(() => { - return (window as any).myLog as string[]; - }); - - console.log(log.value.join('\n')); - - await app.stop(); - - }); + after(() => app.stop()); it(`verifies that 'hot exit' works for dirty files`, async function () { await app.workbench.newUntitledFile(); const untitled = 'Untitled-1'; - const textToTypeInUntitled = 'Hello, Unitled Code alexandru dimaaaaa joao moreno'; + const textToTypeInUntitled = 'Hello, Unitled Code'; await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled); await app.screenCapturer.capture('Untitled file before reload'); - await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1); const readmeMd = 'readme.md'; - const textToType = 'Hello, Code alexandru dimaaaaa joao moreno'; + const textToType = 'Hello, Code'; await app.workbench.explorer.openFile(readmeMd); await app.workbench.editor.waitForTypeInEditor(readmeMd, textToType); await app.screenCapturer.capture(`${readmeMd} before reload`); - await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1); - // await app.reload(); - // await app.screenCapturer.capture('After reload'); + await app.reload(); + await app.screenCapturer.capture('After reload'); - // await app.workbench.waitForActiveTab(readmeMd, true); - // await app.screenCapturer.capture(`${readmeMd} after reload`); + await app.workbench.waitForActiveTab(readmeMd, true); + await app.screenCapturer.capture(`${readmeMd} after reload`); + await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1); - // await app.workbench.waitForTab(untitled, true); - // await app.workbench.selectTab(untitled, true); - // await app.screenCapturer.capture('Untitled file after reload'); + await app.workbench.waitForTab(untitled, true); + await app.workbench.selectTab(untitled, true); + await app.screenCapturer.capture('Untitled file after reload'); + await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1); }); }); \ No newline at end of file