Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
44a8a1f1
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44a8a1f1
编写于
5月 27, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
getId() => getTypeId() for (#6324)
上级
29b583c3
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
33 addition
and
42 deletion
+33
-42
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+0
-5
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+1
-1
src/vs/workbench/browser/parts/quickopen/editorHistoryModel.ts
...s/workbench/browser/parts/quickopen/editorHistoryModel.ts
+3
-3
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+5
-5
src/vs/workbench/common/editor/diffEditorInput.ts
src/vs/workbench/common/editor/diffEditorInput.ts
+1
-1
src/vs/workbench/common/editor/editorStacksModel.ts
src/vs/workbench/common/editor/editorStacksModel.ts
+4
-4
src/vs/workbench/common/editor/iframeEditorInput.ts
src/vs/workbench/common/editor/iframeEditorInput.ts
+1
-1
src/vs/workbench/common/editor/resourceEditorInput.ts
src/vs/workbench/common/editor/resourceEditorInput.ts
+1
-1
src/vs/workbench/common/editor/stringEditorInput.ts
src/vs/workbench/common/editor/stringEditorInput.ts
+1
-1
src/vs/workbench/common/editor/untitledEditorInput.ts
src/vs/workbench/common/editor/untitledEditorInput.ts
+1
-1
src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts
.../workbench/parts/files/browser/editors/fileEditorInput.ts
+1
-1
src/vs/workbench/parts/files/browser/saveErrorHandler.ts
src/vs/workbench/parts/files/browser/saveErrorHandler.ts
+1
-1
src/vs/workbench/parts/git/browser/gitEditorInputs.ts
src/vs/workbench/parts/git/browser/gitEditorInputs.ts
+3
-7
src/vs/workbench/parts/markdown/common/markdownEditorInput.ts
...vs/workbench/parts/markdown/common/markdownEditorInput.ts
+1
-1
src/vs/workbench/parts/output/common/outputEditorInput.ts
src/vs/workbench/parts/output/common/outputEditorInput.ts
+1
-1
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
...vs/workbench/test/browser/parts/editor/baseEditor.test.ts
+5
-5
src/vs/workbench/test/common/editor/editorInput.test.ts
src/vs/workbench/test/common/editor/editorInput.test.ts
+1
-1
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
...vs/workbench/test/common/editor/editorStacksModel.test.ts
+2
-2
未找到文件。
src/vs/platform/editor/common/editor.ts
浏览文件 @
44a8a1f1
...
...
@@ -116,11 +116,6 @@ export enum Direction {
export
interface
IEditorInput
extends
IEventEmitter
{
/**
* Returns the identifier of this input or null if none.
*/
getId
():
string
;
/**
* Returns the display name of this input.
*/
...
...
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
44a8a1f1
...
...
@@ -450,7 +450,7 @@ export class EditorInputActionContributor extends ActionBarContributor {
/* Subclasses can override to provide a custom cache implementation */
protected
toId
(
context
:
IEditorInputActionContext
):
string
{
return
context
.
editor
.
getId
()
+
context
.
input
.
getId
();
return
context
.
editor
.
getId
()
+
context
.
input
.
get
Type
Id
();
}
private
clearInputsFromCache
(
position
:
Position
,
isPrimary
:
boolean
):
void
{
...
...
src/vs/workbench/browser/parts/quickopen/editorHistoryModel.ts
浏览文件 @
44a8a1f1
...
...
@@ -175,7 +175,7 @@ export class EditorHistoryModel extends QuickOpenModel {
}
// Using the factory we try to recreate the input
const
factory
=
this
.
registry
.
getEditorInputFactory
(
input
.
getId
());
const
factory
=
this
.
registry
.
getEditorInputFactory
(
input
.
get
Type
Id
());
if
(
factory
)
{
const
inputRaw
=
factory
.
serialize
(
input
);
if
(
inputRaw
)
{
...
...
@@ -217,12 +217,12 @@ export class EditorHistoryModel extends QuickOpenModel {
let
entry
=
this
.
entries
[
i
];
let
input
=
(
<
EditorHistoryEntry
>
entry
).
getInput
();
let
factory
=
this
.
registry
.
getEditorInputFactory
(
input
.
getId
());
let
factory
=
this
.
registry
.
getEditorInputFactory
(
input
.
get
Type
Id
());
if
(
factory
)
{
let
value
=
factory
.
serialize
(
input
);
if
(
types
.
isString
(
value
))
{
entries
.
push
({
id
:
input
.
getId
(),
id
:
input
.
get
Type
Id
(),
value
:
value
});
}
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
44a8a1f1
...
...
@@ -32,11 +32,6 @@ export abstract class EditorInput extends EventEmitter implements IEditorInput {
this
.
disposed
=
false
;
}
/**
* Returns the unique id of this input.
*/
public
abstract
getId
():
string
;
/**
* Returns the name of this input that can be shown to the user. Examples include showing the name of the input
* above the editor area when the input is shown.
...
...
@@ -55,6 +50,11 @@ export abstract class EditorInput extends EventEmitter implements IEditorInput {
return
null
;
}
/**
* Returns the unique type identifier of this input.
*/
public
abstract
getTypeId
():
string
;
/**
* Returns the preferred editor for this input. A list of candidate editors is passed in that whee registered
* for the input. This allows subclasses to decide late which editor to use for the input on a case by case basis.
...
...
src/vs/workbench/common/editor/diffEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -63,7 +63,7 @@ export class DiffEditorInput extends BaseDiffEditorInput {
return
this
.
_toUnbind
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
DiffEditorInput
.
ID
;
}
...
...
src/vs/workbench/common/editor/editorStacksModel.ts
浏览文件 @
44a8a1f1
...
...
@@ -556,11 +556,11 @@ export class EditorGroup implements IEditorGroup {
let
serializedEditors
:
ISerializedEditorInput
[]
=
[];
let
serializablePreviewIndex
:
number
;
this
.
editors
.
forEach
(
e
=>
{
let
factory
=
registry
.
getEditorInputFactory
(
e
.
getId
());
let
factory
=
registry
.
getEditorInputFactory
(
e
.
get
Type
Id
());
if
(
factory
)
{
let
value
=
factory
.
serialize
(
e
);
if
(
typeof
value
===
'
string
'
)
{
serializedEditors
.
push
({
id
:
e
.
getId
(),
value
});
serializedEditors
.
push
({
id
:
e
.
get
Type
Id
(),
value
});
serializableEditors
.
push
(
e
);
if
(
this
.
preview
===
e
)
{
...
...
@@ -1095,11 +1095,11 @@ export class EditorStacksModel implements IEditorStacksModel {
if
(
event
.
pinned
)
{
const
registry
=
Registry
.
as
<
IEditorRegistry
>
(
Extensions
.
Editors
);
const
factory
=
registry
.
getEditorInputFactory
(
editor
.
getId
());
const
factory
=
registry
.
getEditorInputFactory
(
editor
.
get
Type
Id
());
if
(
factory
)
{
let
value
=
factory
.
serialize
(
editor
);
if
(
typeof
value
===
'
string
'
)
{
this
.
recentlyClosedEditors
.
push
({
id
:
editor
.
getId
(),
value
});
this
.
recentlyClosedEditors
.
push
({
id
:
editor
.
get
Type
Id
(),
value
});
if
(
this
.
recentlyClosedEditors
.
length
>
EditorStacksModel
.
MAX_RECENTLY_CLOSED_EDITORS
)
{
this
.
recentlyClosedEditors
=
this
.
recentlyClosedEditors
.
slice
(
this
.
recentlyClosedEditors
.
length
-
EditorStacksModel
.
MAX_RECENTLY_CLOSED_EDITORS
);
// upper bound of recently closed
}
...
...
src/vs/workbench/common/editor/iframeEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -28,7 +28,7 @@ export abstract class IFrameEditorInput extends EditorInput {
this
.
description
=
description
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
IFrameEditorInput
.
ID
;
}
...
...
src/vs/workbench/common/editor/resourceEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -133,7 +133,7 @@ export class ResourceEditorInput extends EditorInput {
this
.
resource
=
resource
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
ResourceEditorInput
.
ID
;
}
...
...
src/vs/workbench/common/editor/stringEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -48,7 +48,7 @@ export class StringEditorInput extends EditorInput {
return
null
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
StringEditorInput
.
ID
;
}
...
...
src/vs/workbench/common/editor/untitledEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -48,7 +48,7 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
this
.
modeId
=
modeId
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
UntitledEditorInput
.
ID
;
}
...
...
src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -111,7 +111,7 @@ export class FileEditorInput extends CommonFileEditorInput {
}
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
FILE_EDITOR_INPUT_ID
;
}
...
...
src/vs/workbench/parts/files/browser/saveErrorHandler.ts
浏览文件 @
44a8a1f1
...
...
@@ -148,7 +148,7 @@ export class ConflictResolutionDiffEditorInput extends DiffEditorInput {
return
this
.
model
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
ConflictResolutionDiffEditorInput
.
ID
;
}
}
...
...
src/vs/workbench/parts/git/browser/gitEditorInputs.ts
浏览文件 @
44a8a1f1
...
...
@@ -37,10 +37,6 @@ export class GitDiffEditorInput
this
.
status
=
status
;
}
public
getId
():
string
{
throw
new
Error
(
'
To implement.
'
);
}
public
getFileStatus
():
git
.
IFileStatus
{
return
this
.
status
;
}
...
...
@@ -72,7 +68,7 @@ export class GitWorkingTreeDiffEditorInput extends GitDiffEditorInput {
super
(
name
,
description
,
originalInput
,
modifiedInput
,
status
);
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
GitWorkingTreeDiffEditorInput
.
ID
;
}
}
...
...
@@ -85,7 +81,7 @@ export class GitIndexDiffEditorInput extends GitDiffEditorInput {
super
(
name
,
description
,
originalInput
,
modifiedInput
,
status
);
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
GitIndexDiffEditorInput
.
ID
;
}
}
...
...
@@ -123,7 +119,7 @@ export class NativeGitIndexStringEditorInput
this
.
toDispose
.
push
(
this
.
gitService
.
addListener2
(
git
.
ServiceEvents
.
OPERATION_END
,
()
=>
this
.
onGitServiceStateChange
()));
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
NativeGitIndexStringEditorInput
.
ID
;
}
...
...
src/vs/workbench/parts/markdown/common/markdownEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -35,7 +35,7 @@ export class MarkdownEditorInput extends IFrameEditorInput {
return
this
.
instantiationService
.
createInstance
(
MarkdownEditorInput
,
resource
,
void
0
,
void
0
);
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
MarkdownEditorInput
.
ID
;
}
...
...
src/vs/workbench/parts/output/common/outputEditorInput.ts
浏览文件 @
44a8a1f1
...
...
@@ -105,7 +105,7 @@ export class OutputEditorInput extends StringEditorInput {
}
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
OUTPUT_EDITOR_INPUT_ID
;
}
...
...
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
浏览文件 @
44a8a1f1
...
...
@@ -72,7 +72,7 @@ class MyInput extends EditorInput {
return
ids
[
1
];
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
''
;
}
...
...
@@ -82,7 +82,7 @@ class MyInput extends EditorInput {
}
class
MyOtherInput
extends
EditorInput
{
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
''
;
}
...
...
@@ -138,14 +138,14 @@ suite('Workbench BaseEditor', () => {
assert
.
strictEqual
(
input
,
e
.
getInput
());
assert
.
strictEqual
(
options
,
e
.
getOptions
());
e
.
setVisible
(
true
)
e
.
setVisible
(
true
)
;
assert
(
e
.
isVisible
());
input
.
addListener2
(
'
dispose
'
,
function
()
{
assert
(
false
);
});
e
.
dispose
();
e
.
clearInput
();
e
.
setVisible
(
false
)
e
.
setVisible
(
false
)
;
assert
(
!
e
.
isVisible
());
assert
(
!
e
.
getInput
());
assert
(
!
e
.
getOptions
());
...
...
@@ -255,7 +255,7 @@ suite('Workbench BaseEditor', () => {
// other input causes actions to loose input context
let
myInput
=
new
MyInput
();
myInput
.
getId
=
function
()
{
myInput
.
get
Type
Id
=
function
()
{
return
'
foo.id
'
;
};
...
...
src/vs/workbench/test/common/editor/editorInput.test.ts
浏览文件 @
44a8a1f1
...
...
@@ -14,7 +14,7 @@ class MyEditorInput extends EditorInput {
return
'
text/css
'
;
}
public
getId
():
string
{
public
get
Type
Id
():
string
{
return
''
;
}
...
...
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
浏览文件 @
44a8a1f1
...
...
@@ -94,7 +94,7 @@ class TestEditorInput extends EditorInput {
constructor
(
public
id
:
string
)
{
super
();
}
public
getId
()
{
return
'
testEditorInput
'
;
}
public
get
Type
Id
()
{
return
'
testEditorInput
'
;
}
public
resolve
()
{
return
null
;
}
public
matches
(
other
:
TestEditorInput
):
boolean
{
...
...
@@ -106,7 +106,7 @@ class NonSerializableTestEditorInput extends EditorInput {
constructor
(
public
id
:
string
)
{
super
();
}
public
getId
()
{
return
'
testEditorInput-nonSerializable
'
;
}
public
get
Type
Id
()
{
return
'
testEditorInput-nonSerializable
'
;
}
public
resolve
()
{
return
null
;
}
public
matches
(
other
:
TestEditorInput
):
boolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录