Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
75cf5c46
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 搜索 >>
提交
75cf5c46
编写于
2月 05, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
history - only allow file inputs for persisted history
上级
a376041e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
14 deletion
+25
-14
src/vs/code/electron-main/launch.ts
src/vs/code/electron-main/launch.ts
+1
-0
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+3
-3
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
+7
-6
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+3
-0
src/vs/workbench/parts/files/electron-browser/files.contribution.ts
...kbench/parts/files/electron-browser/files.contribution.ts
+4
-0
src/vs/workbench/services/history/electron-browser/history.ts
...vs/workbench/services/history/electron-browser/history.ts
+7
-5
未找到文件。
src/vs/code/electron-main/launch.ts
浏览文件 @
75cf5c46
...
...
@@ -191,6 +191,7 @@ export class LaunchService implements ILaunchService {
public
getLogsPath
():
TPromise
<
string
>
{
this
.
logService
.
trace
(
'
Received request for logs path from other instance.
'
);
return
TPromise
.
as
(
this
.
environmentService
.
logsPath
);
}
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
75cf5c46
...
...
@@ -52,13 +52,13 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
widgetShadow
,
editorWidgetBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
deepClone
}
from
'
vs/base/common/objects
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
// TODO@Sandeep layer breaker
// tslint:disable-next-line:import-patterns
import
{
IPreferencesService
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
deepClone
}
from
'
vs/base/common/objects
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
function
toEditorWithEncodingSupport
(
input
:
IEditorInput
):
IEncodingSupport
{
if
(
input
instanceof
SideBySideEditorInput
)
{
...
...
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
浏览文件 @
75cf5c46
...
...
@@ -16,7 +16,7 @@ import types = require('vs/base/common/types');
import
{
IDiffEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IDiffEditorOptions
,
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
BaseTextEditor
,
IEditorConfiguration
}
from
'
vs/workbench/browser/parts/editor/textEditor
'
;
import
{
TextEditorOptions
,
EditorInput
,
EditorOptions
,
TEXT_DIFF_EDITOR_ID
,
I
FileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
TextEditorOptions
,
EditorInput
,
EditorOptions
,
TEXT_DIFF_EDITOR_ID
,
I
EditorInputFactoryRegistry
,
Extensions
as
EditorInputExtensions
}
from
'
vs/workbench/common/editor
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
import
{
DiffNavigator
}
from
'
vs/editor/browser/widget/diffNavigator
'
;
...
...
@@ -32,10 +32,10 @@ import { IWorkbenchEditorService, DelegatingWorkbenchEditorService } from 'vs/wo
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IEditorInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
/**
* The text editor that leverages the diff text editor for the editing experience.
...
...
@@ -205,12 +205,13 @@ export class TextDiffEditor extends BaseTextEditor {
const
binaryDiffInput
=
new
DiffEditorInput
(
input
.
getName
(),
input
.
getDescription
(),
originalInput
,
modifiedInput
,
true
);
// Forward binary flag to input if supported
if
(
types
.
isFunction
(((
originalInput
as
IEditorInput
)
as
IFileEditorInput
).
setForceOpenAsBinary
))
{
((
originalInput
as
IEditorInput
)
as
IFileEditorInput
).
setForceOpenAsBinary
();
const
fileInputFactory
=
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
getFileInputFactory
();
if
(
fileInputFactory
.
isFileInput
(
originalInput
))
{
originalInput
.
setForceOpenAsBinary
();
}
if
(
types
.
isFunction
(((
modifiedInput
as
IEditorInput
)
as
IFileEditorInput
).
setForceOpenAsBinary
))
{
((
modifiedInput
as
IEditorInput
)
as
IFileEditorInput
)
.
setForceOpenAsBinary
();
if
(
fileInputFactory
.
isFileInput
(
modifiedInput
))
{
modifiedInput
.
setForceOpenAsBinary
();
}
this
.
editorService
.
openEditor
(
binaryDiffInput
,
options
,
this
.
position
).
done
(
null
,
onUnexpectedError
);
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
75cf5c46
...
...
@@ -36,7 +36,10 @@ export const TEXT_DIFF_EDITOR_ID = 'workbench.editors.textDiffEditor';
export
const
BINARY_DIFF_EDITOR_ID
=
'
workbench.editors.binaryResourceDiffEditor
'
;
export
interface
IFileInputFactory
{
createFileInput
(
resource
:
URI
,
encoding
:
string
,
instantiationService
:
IInstantiationService
):
IFileEditorInput
;
isFileInput
(
obj
:
any
):
obj
is
IFileEditorInput
;
}
export
interface
IEditorInputFactoryRegistry
{
...
...
src/vs/workbench/parts/files/electron-browser/files.contribution.ts
浏览文件 @
75cf5c46
...
...
@@ -100,6 +100,10 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
registerFileInputFactory
({
createFileInput
:
(
resource
,
encoding
,
instantiationService
):
IFileEditorInput
=>
{
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
encoding
);
},
isFileInput
:
(
obj
):
obj
is
IFileEditorInput
=>
{
return
obj
instanceof
FileEditorInput
;
}
});
...
...
src/vs/workbench/services/history/electron-browser/history.ts
浏览文件 @
75cf5c46
...
...
@@ -10,7 +10,7 @@ import errors = require('vs/base/common/errors');
import
URI
from
'
vs/base/common/uri
'
;
import
{
IEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditor
as
IBaseEditor
,
IEditorInput
,
ITextEditorOptions
,
IResourceInput
,
ITextEditorSelection
,
Position
as
GroupPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
Extensions
as
EditorExtensions
,
EditorInput
,
IEditorCloseEvent
,
IEditorGroup
,
IEditorInputFactoryRegistry
,
toResource
}
from
'
vs/workbench/common/editor
'
;
import
{
Extensions
as
EditorExtensions
,
EditorInput
,
IEditorCloseEvent
,
IEditorGroup
,
IEditorInputFactoryRegistry
,
toResource
,
Extensions
as
EditorInputExtensions
,
IFileInputFactory
}
from
'
vs/workbench/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
import
{
FileChangesEvent
,
IFileService
,
FileChangeType
,
FILES_EXCLUDE_CONFIG
}
from
'
vs/platform/files/common/files
'
;
...
...
@@ -125,6 +125,8 @@ export class HistoryService implements IHistoryService {
private
loaded
:
boolean
;
private
resourceFilter
:
ResourceGlobMatcher
;
private
fileInputFactory
:
IFileInputFactory
;
constructor
(
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
IEditorGroupService
private
editorGroupService
:
IEditorGroupService
,
...
...
@@ -139,6 +141,8 @@ export class HistoryService implements IHistoryService {
this
.
toUnbind
=
[];
this
.
activeEditorListeners
=
[];
this
.
fileInputFactory
=
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
getFileInputFactory
();
this
.
index
=
-
1
;
this
.
lastIndex
=
-
1
;
this
.
stack
=
[];
...
...
@@ -572,10 +576,8 @@ export class HistoryService implements IHistoryService {
}
private
preferResourceInput
(
input
:
IEditorInput
):
IEditorInput
|
IResourceInput
{
const
resource
=
input
?
input
.
getResource
()
:
void
0
;
const
preferResourceInput
=
resource
&&
this
.
fileService
.
canHandleResource
(
resource
);
// file'ish things prefer resources
if
(
preferResourceInput
)
{
return
{
resource
};
if
(
this
.
fileInputFactory
.
isFileInput
(
input
))
{
return
{
resource
:
input
.
getResource
()
};
}
return
input
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录