Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d4758821
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d4758821
编写于
10月 13, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke: let's catch the sucker
上级
28fcacfd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
13 deletion
+37
-13
src/vs/editor/browser/controller/textAreaInput.ts
src/vs/editor/browser/controller/textAreaInput.ts
+2
-1
src/vs/editor/browser/controller/textAreaState.ts
src/vs/editor/browser/controller/textAreaState.ts
+4
-0
src/vs/editor/browser/view/viewController.ts
src/vs/editor/browser/view/viewController.ts
+8
-0
test/smoke/src/areas/editor/editor.ts
test/smoke/src/areas/editor/editor.ts
+2
-0
test/smoke/src/areas/workbench/data-loss.test.ts
test/smoke/src/areas/workbench/data-loss.test.ts
+21
-12
未找到文件。
src/vs/editor/browser/controller/textAreaInput.ts
浏览文件 @
d4758821
...
...
@@ -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
}
from
'
vs/editor/browser/controller/textAreaState
'
;
import
{
ITypeData
,
TextAreaState
,
ITextAreaWrapper
,
log
}
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,6 +220,7 @@ 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
'
);
...
...
src/vs/editor/browser/controller/textAreaState.ts
浏览文件 @
d4758821
...
...
@@ -9,6 +9,9 @@ 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
[]
=
[];
(
<
any
>
this
).
myLog
=
log
;
export
interface
ITextAreaWrapper
{
getValue
():
string
;
setValue
(
reason
:
string
,
value
:
string
):
void
;
...
...
@@ -73,6 +76,7 @@ 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
)
{
...
...
src/vs/editor/browser/view/viewController.ts
浏览文件 @
d4758821
...
...
@@ -14,6 +14,7 @@ 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
;
...
...
@@ -63,6 +64,7 @@ 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
,
...
...
@@ -70,12 +72,14 @@ 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
...
...
@@ -83,18 +87,22 @@ 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
...
...
test/smoke/src/areas/editor/editor.ts
浏览文件 @
d4758821
...
...
@@ -114,6 +114,8 @@ export class Editor {
await
new
Promise
(
c
=>
setTimeout
(
c
,
50
));
}
// this.spectron.client.spectron.client.keys([text, 'NULL']);
await
this
.
waitForEditorContents
(
filename
,
c
=>
c
.
indexOf
(
text
)
>
-
1
,
selectorPrefix
);
}
...
...
test/smoke/src/areas/workbench/data-loss.test.ts
浏览文件 @
d4758821
...
...
@@ -8,32 +8,41 @@ import { SpectronApplication } from '../../spectron/application';
describe
(
'
Dataloss
'
,
()
=>
{
let
app
:
SpectronApplication
;
before
(()
=>
{
app
=
new
SpectronApplication
();
return
app
.
start
(
'
Dataloss
'
);
});
after
(()
=>
app
.
stop
());
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
();
});
it
(
`verifies that 'hot exit' works for dirty files`
,
async
function
()
{
await
app
.
workbench
.
newUntitledFile
();
const
untitled
=
'
Untitled-1
'
;
const
textToTypeInUntitled
=
'
Hello, Unitled Code
'
;
const
textToTypeInUntitled
=
'
Hello, Unitled Code
alexandru dimaaaaa joao moreno
'
;
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
'
;
const
textToType
=
'
Hello, Code
alexandru dimaaaaa joao moreno
'
;
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
.
editor
.
waitForEditorContents
(
readmeMd
,
c
=>
c
.
indexOf
(
textToType
)
>
-
1
);
// await app.workbench.waitForActiveTab(readmeMd, true);
// await app.screenCapturer.capture(`${readmeMd} 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
);
// await app.workbench.waitForTab(untitled, true);
// await app.workbench.selectTab(untitled, true);
// await app.screenCapturer.capture('Untitled file after reload');
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录