Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
036c2b0e
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,发现更多精彩内容 >>
提交
036c2b0e
编写于
12月 02, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
setInput: make options optional
上级
0763cc88
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
16 addition
and
16 deletion
+16
-16
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts
src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/binaryEditor.ts
src/vs/workbench/browser/parts/editor/binaryEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
+6
-6
src/vs/workbench/browser/parts/editor/stringEditor.ts
src/vs/workbench/browser/parts/editor/stringEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugErrorEditor.ts
src/vs/workbench/parts/debug/browser/debugErrorEditor.ts
+1
-1
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
...s/workbench/parts/files/browser/editors/textFileEditor.ts
+1
-1
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
+1
-1
src/vs/workbench/parts/output/browser/outputPanel.ts
src/vs/workbench/parts/output/browser/outputPanel.ts
+1
-1
未找到文件。
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -67,7 +67,7 @@ export abstract class BaseEditor extends Panel implements IEditor {
* Sets the given input with the options to the part. An editor has to deal with the
* situation that the same input is being set with different options.
*/
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
this
.
_input
=
input
;
this
.
_options
=
options
;
...
...
src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -91,7 +91,7 @@ export class BinaryResourceDiffEditor extends BaseEditor implements IVerticalSas
$
(
this
.
rightScrollbar
.
getDomNode
()).
addClass
(
'
binarydiff-right
'
);
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
this
.
getInput
();
super
.
setInput
(
input
,
options
);
...
...
src/vs/workbench/browser/parts/editor/binaryEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -57,7 +57,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
parent
.
getHTMLElement
().
appendChild
(
this
.
scrollbar
.
getDomNode
());
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
this
.
getInput
();
super
.
setInput
(
input
,
options
);
...
...
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -47,7 +47,7 @@ export class SideBySideEditor extends BaseEditor {
this
.
createSash
(
parentElement
);
}
public
setInput
(
newInput
:
SideBySideEditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
newInput
:
SideBySideEditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
<
SideBySideEditorInput
>
this
.
getInput
();
return
super
.
setInput
(
newInput
,
options
)
.
then
(()
=>
this
.
updateInput
(
oldInput
,
newInput
,
options
));
...
...
@@ -86,7 +86,7 @@ export class SideBySideEditor extends BaseEditor {
return
null
;
}
private
updateInput
(
oldInput
:
SideBySideEditorInput
,
newInput
:
SideBySideEditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
private
updateInput
(
oldInput
:
SideBySideEditorInput
,
newInput
:
SideBySideEditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
if
(
!
newInput
.
matches
(
oldInput
))
{
if
(
oldInput
)
{
this
.
disposeEditors
();
...
...
@@ -94,19 +94,19 @@ export class SideBySideEditor extends BaseEditor {
this
.
createEditorContainers
();
return
this
.
setNewInput
(
newInput
,
options
);
}
else
{
this
.
detailsEditor
.
setInput
(
newInput
.
details
,
new
EditorOptions
()
);
this
.
detailsEditor
.
setInput
(
newInput
.
details
);
this
.
masterEditor
.
setInput
(
newInput
.
master
,
options
);
}
}
private
setNewInput
(
newInput
:
SideBySideEditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
private
setNewInput
(
newInput
:
SideBySideEditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
return
TPromise
.
join
([
this
.
_createEditor
(
<
EditorInput
>
newInput
.
details
,
this
.
detailsEditorContainer
,
new
EditorOptions
()),
//TODO@ben why do you have to provide options
this
.
_createEditor
(
<
EditorInput
>
newInput
.
details
,
this
.
detailsEditorContainer
),
this
.
_createEditor
(
<
EditorInput
>
newInput
.
master
,
this
.
masterEditorContainer
,
options
)
]).
then
(
result
=>
this
.
onEditorsCreated
(
result
[
0
],
result
[
1
]));
}
private
_createEditor
(
editorInput
:
EditorInput
,
container
:
HTMLElement
,
options
:
EditorOptions
):
TPromise
<
BaseEditor
>
{
private
_createEditor
(
editorInput
:
EditorInput
,
container
:
HTMLElement
,
options
?
:
EditorOptions
):
TPromise
<
BaseEditor
>
{
const
descriptor
=
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
).
getEditor
(
editorInput
);
if
(
!
descriptor
)
{
return
TPromise
.
wrapError
(
new
Error
(
strings
.
format
(
'
Can not find a registered editor for the input {0}
'
,
editorInput
)));
...
...
src/vs/workbench/browser/parts/editor/stringEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -68,7 +68,7 @@ export class StringEditor extends BaseTextEditor {
return
nls
.
localize
(
'
textEditor
'
,
"
Text Editor
"
);
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
this
.
getInput
();
super
.
setInput
(
input
,
options
);
...
...
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -117,7 +117,7 @@ export class TextDiffEditor extends BaseTextEditor {
return
diffEditorInstantiator
.
createInstance
(
DiffEditorWidget
,
parent
.
getHTMLElement
(),
this
.
getCodeEditorOptions
());
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
this
.
getInput
();
super
.
setInput
(
input
,
options
);
...
...
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -142,7 +142,7 @@ export abstract class BaseTextEditor extends BaseEditor {
return
this
.
instantiationService
.
createInstance
(
CodeEditor
,
parent
.
getHTMLElement
(),
this
.
getCodeEditorOptions
());
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
return
super
.
setInput
(
input
,
options
).
then
(()
=>
{
this
.
editorControl
.
updateOptions
(
this
.
getCodeEditorOptions
());
// support input specific editor options
});
...
...
src/vs/workbench/parts/debug/browser/debugErrorEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -29,7 +29,7 @@ export class DebugErrorEditor extends BaseEditor {
this
.
container
.
style
.
height
=
`
${
dimension
.
height
}
px`
;
}
public
setInput
(
input
:
DebugErrorEditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
DebugErrorEditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
this
.
container
.
textContent
=
input
.
value
;
return
super
.
setInput
(
input
,
options
);
}
...
...
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
浏览文件 @
036c2b0e
...
...
@@ -83,7 +83,7 @@ export class TextFileEditor extends BaseTextEditor {
return
<
FileEditorInput
>
super
.
getInput
();
}
public
setInput
(
input
:
FileEditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
FileEditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
const
oldInput
=
this
.
getInput
();
super
.
setInput
(
input
,
options
);
...
...
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
浏览文件 @
036c2b0e
...
...
@@ -138,7 +138,7 @@ export class HtmlPreviewPart extends BaseEditor {
this
.
webview
.
focus
();
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
if
(
this
.
input
===
input
&&
this
.
_hasValidModel
())
{
return
TPromise
.
as
(
undefined
);
...
...
src/vs/workbench/parts/output/browser/outputPanel.ts
浏览文件 @
036c2b0e
...
...
@@ -98,7 +98,7 @@ export class OutputPanel extends StringEditor {
return
options
;
}
public
setInput
(
input
:
EditorInput
,
options
:
EditorOptions
):
TPromise
<
void
>
{
public
setInput
(
input
:
EditorInput
,
options
?
:
EditorOptions
):
TPromise
<
void
>
{
return
super
.
setInput
(
input
,
options
).
then
(()
=>
this
.
revealLastLine
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录