Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2e3358d5
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,体验更适合开发者的 AI 搜索 >>
提交
2e3358d5
编写于
1月 11, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get rid of ITextInput and IFileInput
上级
e4821577
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
27 addition
and
52 deletion
+27
-52
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+1
-4
src/vs/workbench/browser/quickopen.ts
src/vs/workbench/browser/quickopen.ts
+5
-4
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+8
-8
src/vs/workbench/parts/search/browser/openFileHandler.ts
src/vs/workbench/parts/search/browser/openFileHandler.ts
+4
-3
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
+4
-3
src/vs/workbench/services/editor/browser/editorService.ts
src/vs/workbench/services/editor/browser/editorService.ts
+1
-5
src/vs/workbench/services/editor/common/editorService.ts
src/vs/workbench/services/editor/common/editorService.ts
+1
-21
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
.../workbench/test/browser/parts/quickOpen/quickopen.test.ts
+1
-1
src/vs/workbench/test/browser/servicesTestUtils.ts
src/vs/workbench/test/browser/servicesTestUtils.ts
+2
-3
未找到文件。
src/vs/platform/editor/common/editor.ts
浏览文件 @
2e3358d5
...
...
@@ -33,15 +33,12 @@ export interface ITextEditorModel extends IEditorModel {
textEditorModel
:
any
;
}
export
interface
IResourceInput
extends
ITextInput
{
export
interface
IResourceInput
{
/**
* The resource URL of the resource to open.
*/
resource
:
URI
;
}
export
interface
ITextInput
{
/**
* The mime type of the text input if known.
...
...
src/vs/workbench/browser/quickopen.ts
浏览文件 @
2e3358d5
...
...
@@ -15,7 +15,8 @@ import {Registry} from 'vs/platform/platform';
import
{
Mode
,
IContext
,
IAutoFocus
,
IModel
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
import
{
QuickOpenEntry
,
IHighlight
,
QuickOpenEntryGroup
,
QuickOpenModel
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
EditorOptions
,
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IFileInput
,
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
AsyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
@@ -194,7 +195,7 @@ export interface IEditorQuickOpenEntry {
/**
* The editor input used for this entry when opening.
*/
getInput
():
I
Fil
eInput
|
EditorInput
;
getInput
():
I
Resourc
eInput
|
EditorInput
;
/**
* The editor options used for this entry when opening.
...
...
@@ -215,7 +216,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick
return
this
.
_editorService
;
}
public
getInput
():
I
Fil
eInput
|
EditorInput
{
public
getInput
():
I
Resourc
eInput
|
EditorInput
{
return
null
;
}
...
...
@@ -232,7 +233,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick
if
(
input
instanceof
EditorInput
)
{
this
.
editorService
.
openEditor
(
input
,
this
.
getOptions
(),
sideBySide
).
done
(
null
,
errors
.
onUnexpectedError
);
}
else
{
this
.
editorService
.
openEditor
(
<
I
Fil
eInput
>
input
,
sideBySide
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
editorService
.
openEditor
(
<
I
Resourc
eInput
>
input
,
sideBySide
).
done
(
null
,
errors
.
onUnexpectedError
);
}
return
true
;
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
2e3358d5
...
...
@@ -10,7 +10,7 @@ import types = require('vs/base/common/types');
import
URI
from
'
vs/base/common/uri
'
;
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
{
IEditor
,
IEditorViewState
,
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
I
Text
Input
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
I
Resource
Input
}
from
'
vs/platform/editor/common/editor
'
;
/**
* A simple bag for input related status that can be shown in the UI
...
...
@@ -308,23 +308,23 @@ export class TextEditorOptions extends EditorOptions {
private
endColumn
:
number
;
private
editorViewState
:
IEditorViewState
;
public
static
from
(
textInput
:
IText
Input
):
TextEditorOptions
{
public
static
from
(
input
:
IResource
Input
):
TextEditorOptions
{
let
options
:
TextEditorOptions
=
null
;
if
(
textInput
&&
textI
nput
.
options
)
{
if
(
textInput
.
options
.
selection
||
textInput
.
options
.
forceOpen
||
textI
nput
.
options
.
preserveFocus
)
{
if
(
input
&&
i
nput
.
options
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
i
nput
.
options
.
preserveFocus
)
{
options
=
new
TextEditorOptions
();
}
if
(
textI
nput
.
options
.
selection
)
{
let
selection
=
textI
nput
.
options
.
selection
;
if
(
i
nput
.
options
.
selection
)
{
let
selection
=
i
nput
.
options
.
selection
;
options
.
selection
(
selection
.
startLineNumber
,
selection
.
startColumn
,
selection
.
endLineNumber
,
selection
.
endColumn
);
}
if
(
textI
nput
.
options
.
forceOpen
)
{
if
(
i
nput
.
options
.
forceOpen
)
{
options
.
forceOpen
=
true
;
}
if
(
textI
nput
.
options
.
preserveFocus
)
{
if
(
i
nput
.
options
.
preserveFocus
)
{
options
.
preserveFocus
=
true
;
}
}
...
...
src/vs/workbench/parts/search/browser/openFileHandler.ts
浏览文件 @
2e3358d5
...
...
@@ -17,7 +17,8 @@ import {QuickOpenHandler, EditorQuickOpenEntry} from 'vs/workbench/browser/quick
import
{
QueryBuilder
}
from
'
vs/workbench/parts/search/common/searchQuery
'
;
import
{
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IWorkbenchEditorService
,
IFileInput
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
...
...
@@ -65,8 +66,8 @@ export class FileEntry extends EditorQuickOpenEntry {
this
.
range
=
range
;
}
public
getInput
():
I
Fil
eInput
|
EditorInput
{
let
input
:
I
Fil
eInput
=
{
public
getInput
():
I
Resourc
eInput
|
EditorInput
{
let
input
:
I
Resourc
eInput
=
{
resource
:
this
.
resource
,
};
...
...
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
浏览文件 @
2e3358d5
...
...
@@ -15,7 +15,8 @@ import filters = require('vs/base/common/filters');
import
{
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
labels
=
require
(
'
vs/base/common/labels
'
);
import
{
IWorkbenchEditorService
,
IFileInput
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
...
...
@@ -65,8 +66,8 @@ class SymbolEntry extends EditorQuickOpenEntry {
return
this
.
type
;
}
public
getInput
():
I
Fil
eInput
|
EditorInput
{
let
input
:
I
Fil
eInput
=
{
public
getInput
():
I
Resourc
eInput
|
EditorInput
{
let
input
:
I
Resourc
eInput
=
{
resource
:
this
.
resource
,
};
...
...
src/vs/workbench/services/editor/browser/editorService.ts
浏览文件 @
2e3358d5
...
...
@@ -17,7 +17,7 @@ import {EditorInput, EditorOptions, IFileEditorInput, TextEditorOptions} from 'v
import
{
UntitledEditorInput
}
from
'
vs/workbench/common/editor/untitledEditorInput
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
IWorkbenchEditorService
,
EditorArrangement
,
IFileInput
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
,
EditorArrangement
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
AsyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
@@ -100,7 +100,6 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
public
setEditors
(
inputs
:
IEditorInput
[],
options
?:
IEditorOptions
[]):
TPromise
<
IEditor
[]
>
;
public
setEditors
(
inputs
:
IResourceInput
[]):
TPromise
<
IEditor
[]
>
;
public
setEditors
(
inputs
:
IFileInput
[]):
TPromise
<
IEditor
[]
>
;
public
setEditors
(
inputs
:
any
[],
options
?:
any
[]):
TPromise
<
IEditor
[]
>
{
return
Promise
.
join
(
inputs
.
map
((
input
)
=>
this
.
inputToType
(
input
))).
then
((
typedInputs
)
=>
{
return
this
.
editorPart
.
setEditors
(
typedInputs
,
options
||
inputs
.
map
(
input
=>
{
...
...
@@ -117,8 +116,6 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
public
openEditor
(
input
:
IEditorInput
,
options
?:
IEditorOptions
,
position
?:
Position
):
TPromise
<
IEditor
>
;
public
openEditor
(
input
:
IResourceInput
,
position
?:
Position
):
TPromise
<
IEditor
>
;
public
openEditor
(
input
:
IResourceInput
,
sideBySide
?:
boolean
):
TPromise
<
IEditor
>
;
public
openEditor
(
input
:
IFileInput
,
position
?:
Position
):
TPromise
<
IEditor
>
;
public
openEditor
(
input
:
IFileInput
,
sideBySide
?:
boolean
):
TPromise
<
IEditor
>
;
public
openEditor
(
input
:
any
,
arg2
?:
any
,
arg3
?:
any
):
TPromise
<
IEditor
>
{
// Support for closing an opened editor at a position by passing null as input
...
...
@@ -218,7 +215,6 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
public
resolveEditorModel
(
input
:
IEditorInput
,
refresh
?:
boolean
):
TPromise
<
IEditorModel
>
;
public
resolveEditorModel
(
input
:
IResourceInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
public
resolveEditorModel
(
input
:
IFileInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
public
resolveEditorModel
(
input
:
any
,
refresh
?:
boolean
):
TPromise
<
IEditorModel
>
{
return
this
.
inputToType
(
input
).
then
((
workbenchInput
:
IEditorInput
)
=>
{
if
(
workbenchInput
)
{
...
...
src/vs/workbench/services/editor/common/editorService.ts
浏览文件 @
2e3358d5
...
...
@@ -7,15 +7,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorService
,
IEditor
,
IEditorInput
,
IEditorOptions
,
Position
,
IResourceInput
,
ITextInput
,
IEditorModel
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
export
interface
IFileInput
extends
ITextInput
{
/**
* The file resource of the file.
*/
resource
:
URI
;
}
import
{
IEditorService
,
IEditor
,
IEditorInput
,
IEditorOptions
,
Position
,
IResourceInput
,
IEditorModel
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
export
enum
EditorArrangement
{
MINIMIZE_OTHERS
,
...
...
@@ -68,19 +60,12 @@ export interface IWorkbenchEditorService extends IEditorService {
openEditor
(
input
:
IResourceInput
,
position
?:
Position
):
TPromise
<
IEditor
>
;
openEditor
(
input
:
IResourceInput
,
sideBySide
?:
boolean
):
TPromise
<
IEditor
>
;
/**
* Specific overload to open an instance of IFileInput.
*/
openEditor
(
input
:
IFileInput
,
position
?:
Position
):
TPromise
<
IEditor
>
;
openEditor
(
input
:
IFileInput
,
sideBySide
?:
boolean
):
TPromise
<
IEditor
>
;
/**
* Opens the set of inputs replacing any other editor that is currently open. Use #openEditor() instead to open
* a single editor.
*/
setEditors
(
inputs
:
IEditorInput
[]):
TPromise
<
IEditor
[]
>
;
setEditors
(
inputs
:
IResourceInput
[]):
TPromise
<
IEditor
[]
>
;
setEditors
(
inputs
:
IFileInput
[]):
TPromise
<
IEditor
[]
>
;
/**
* Closes the editor at the provided position. If position is not provided, the current active editor is closed.
...
...
@@ -121,11 +106,6 @@ export interface IWorkbenchEditorService extends IEditorService {
*/
resolveEditorModel
(
input
:
IResourceInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
/**
* Specific overload to resolve a IFileInput to an editor model with a text representation.
*/
resolveEditorModel
(
input
:
IFileInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
/**
* Allows to resolve an untyped input to a workbench typed instanceof editor input
*/
...
...
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
浏览文件 @
2e3358d5
...
...
@@ -23,7 +23,7 @@ import URI from 'vs/base/common/uri';
import
{
create
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
EventType
,
EditorEvent
}
from
'
vs/workbench/common/events
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
ITextInput
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
function
toResource
(
path
)
{
return
URI
.
file
(
join
(
'
C:
\\
'
,
path
));
...
...
src/vs/workbench/test/browser/servicesTestUtils.ts
浏览文件 @
2e3358d5
...
...
@@ -38,7 +38,7 @@ import WorkspaceContextService = require('vs/workbench/services/workspace/common
import
ViewletCommon
=
require
(
'
vs/workbench/common/viewlet
'
);
import
Files
=
require
(
'
vs/platform/files/common/files
'
);
import
{
BaseWorkspaceContextService
}
from
'
vs/platform/workspace/common/baseWorkspaceContextService
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
ITextInput
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
...
...
@@ -397,7 +397,6 @@ export class TestEditorService implements WorkbenchEditorService.IWorkbenchEdito
public
resolveEditorModel
(
input
:
IEditorInput
,
refresh
?:
boolean
):
TPromise
<
IEditorModel
>
;
public
resolveEditorModel
(
input
:
IResourceInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
public
resolveEditorModel
(
input
:
WorkbenchEditorService
.
IFileInput
,
refresh
?:
boolean
):
TPromise
<
ITextEditorModel
>
;
public
resolveEditorModel
(
input
:
any
,
refresh
?:
boolean
):
Promise
{
this
.
callback
(
'
resolveEditorModel
'
);
...
...
@@ -421,7 +420,7 @@ export class TestEditorService implements WorkbenchEditorService.IWorkbenchEdito
return
TPromise
.
as
(
null
);
}
public
inputToType
(
input
:
I
Text
Input
):
TPromise
<
IEditorInput
>
{
public
inputToType
(
input
:
I
Resource
Input
):
TPromise
<
IEditorInput
>
{
return
Promise
.
as
(
null
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录