Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a6dee4c4
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,发现更多精彩内容 >>
提交
a6dee4c4
编写于
3月 04, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check textDiffEditor
上级
873b17fc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
8 deletion
+10
-8
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+1
-1
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
+8
-7
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
a6dee4c4
...
...
@@ -116,6 +116,7 @@
"./vs/workbench/browser/parts/editor/rangeDecorations.ts"
,
"./vs/workbench/browser/parts/editor/resourceViewer.ts"
,
"./vs/workbench/browser/parts/editor/sideBySideEditor.ts"
,
"./vs/workbench/browser/parts/editor/textDiffEditor.ts"
,
"./vs/workbench/browser/parts/editor/textEditor.ts"
,
"./vs/workbench/browser/parts/editor/textResourceEditor.ts"
,
"./vs/workbench/browser/parts/quickinput/quickInputBox.ts"
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
a6dee4c4
...
...
@@ -469,7 +469,7 @@ export interface IDiffEditor extends IEditor {
/**
* Type the getModel() of IEditor.
*/
getModel
():
IDiffEditorModel
;
getModel
():
IDiffEditorModel
|
null
;
/**
* Get the `original` editor.
...
...
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
浏览文件 @
a6dee4c4
...
...
@@ -61,7 +61,7 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
return
new
EditorMemento
(
this
.
getId
(),
key
,
Object
.
create
(
null
),
limit
,
editorGroupService
);
// do not persist in storage as diff editors are never persisted
}
getTitle
():
string
{
getTitle
():
string
|
null
{
if
(
this
.
input
)
{
return
this
.
input
.
getName
();
}
...
...
@@ -120,6 +120,7 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
// Readonly flag
diffEditor
.
updateOptions
({
readOnly
:
resolvedDiffEditorModel
.
isReadonly
()
});
return
undefined
;
},
error
=>
{
// In case we tried to open a file and the response indicates that this is not a text file, fallback to binary diff.
...
...
@@ -262,7 +263,7 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
return
super
.
loadTextEditorViewState
(
resource
)
as
IDiffEditorViewState
;
// overridden for text diff editor support
}
private
saveTextDiffEditorViewState
(
input
:
EditorInput
):
void
{
private
saveTextDiffEditorViewState
(
input
:
EditorInput
|
null
):
void
{
if
(
!
(
input
instanceof
DiffEditorInput
))
{
return
;
// only supported for diff editor inputs
}
...
...
@@ -288,11 +289,11 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
}
}
protected
retrieveTextEditorViewState
(
resource
:
URI
):
IDiffEditorViewState
{
protected
retrieveTextEditorViewState
(
resource
:
URI
):
IDiffEditorViewState
|
null
{
return
this
.
retrieveTextDiffEditorViewState
(
resource
);
// overridden for text diff editor support
}
private
retrieveTextDiffEditorViewState
(
resource
:
URI
):
IDiffEditorViewState
{
private
retrieveTextDiffEditorViewState
(
resource
:
URI
):
IDiffEditorViewState
|
null
{
const
control
=
this
.
getControl
();
const
model
=
control
.
getModel
();
if
(
!
model
||
!
model
.
modified
||
!
model
.
original
)
{
...
...
@@ -311,9 +312,9 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
return
control
.
saveViewState
();
}
private
toDiffEditorViewStateResource
(
modelOrInput
:
IDiffEditorModel
|
DiffEditorInput
):
URI
{
let
original
:
URI
;
let
modified
:
URI
;
private
toDiffEditorViewStateResource
(
modelOrInput
:
IDiffEditorModel
|
DiffEditorInput
):
URI
|
null
{
let
original
:
URI
|
null
;
let
modified
:
URI
|
null
;
if
(
modelOrInput
instanceof
DiffEditorInput
)
{
original
=
modelOrInput
.
originalInput
.
getResource
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录