Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1c9015ae
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,发现更多精彩内容 >>
提交
1c9015ae
编写于
1月 27, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
types
💄
上级
3c6f6af7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
19 deletion
+20
-19
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+7
-5
src/vs/workbench/common/editor/diffEditorInput.ts
src/vs/workbench/common/editor/diffEditorInput.ts
+2
-2
src/vs/workbench/common/editor/resourceEditorInput.ts
src/vs/workbench/common/editor/resourceEditorInput.ts
+5
-5
src/vs/workbench/common/editor/untitledTextEditorInput.ts
src/vs/workbench/common/editor/untitledTextEditorInput.ts
+4
-4
src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts
...ices/textmodelResolver/common/textModelResolverService.ts
+1
-2
src/vs/workbench/services/untitled/common/untitledTextEditorService.ts
...nch/services/untitled/common/untitledTextEditorService.ts
+1
-1
未找到文件。
src/vs/workbench/common/editor.ts
浏览文件 @
1c9015ae
...
...
@@ -416,18 +416,20 @@ export interface IEditorInput extends IDisposable {
* to e.g. preserve view state of the editor and re-open it
* in the correct group after saving.
*
* @returns the resulting editor input of this operation. Can
* be the same editor input.
* @returns the resulting editor input (typically the same) of
* this operation or `undefined` to indicate that the operation
* failed or was canceled.
*/
save
(
group
:
GroupIdentifier
,
options
?:
ISaveOptions
):
Promise
<
IEditorInput
|
undefined
>
;
/**
* Saves the editor to a different location. The provided
groupId
* Saves the editor to a different location. The provided
`group`
* helps implementors to e.g. preserve view state of the editor
* and re-open it in the correct group after saving.
*
* @returns the resulting editor input of this operation. Typically
* a different editor input.
* @returns the resulting editor input (typically a different one)
* of this operation or `undefined` to indicate that the operation
* failed or was canceled.
*/
saveAs
(
group
:
GroupIdentifier
,
options
?:
ISaveOptions
):
Promise
<
IEditorInput
|
undefined
>
;
...
...
src/vs/workbench/common/editor/diffEditorInput.ts
浏览文件 @
1c9015ae
...
...
@@ -17,7 +17,7 @@ export class DiffEditorInput extends SideBySideEditorInput {
static
readonly
ID
=
'
workbench.editors.diffEditorInput
'
;
private
cachedModel
:
DiffEditorModel
|
null
=
null
;
private
cachedModel
:
DiffEditorModel
|
undefined
=
undefined
;
constructor
(
protected
name
:
string
|
undefined
,
...
...
@@ -96,7 +96,7 @@ export class DiffEditorInput extends SideBySideEditorInput {
// them without sideeffects.
if
(
this
.
cachedModel
)
{
this
.
cachedModel
.
dispose
();
this
.
cachedModel
=
null
;
this
.
cachedModel
=
undefined
;
}
super
.
dispose
();
...
...
src/vs/workbench/common/editor/resourceEditorInput.ts
浏览文件 @
1c9015ae
...
...
@@ -21,8 +21,8 @@ export class ResourceEditorInput extends TextEditorInput implements IModeSupport
static
readonly
ID
:
string
=
'
workbench.editors.resourceEditorInput
'
;
private
cachedModel
:
ResourceEditorModel
|
null
=
null
;
private
modelReference
:
Promise
<
IReference
<
ITextEditorModel
>>
|
null
=
null
;
private
cachedModel
:
ResourceEditorModel
|
undefined
=
undefined
;
private
modelReference
:
Promise
<
IReference
<
ITextEditorModel
>>
|
undefined
=
undefined
;
constructor
(
private
name
:
string
|
undefined
,
...
...
@@ -91,7 +91,7 @@ export class ResourceEditorInput extends TextEditorInput implements IModeSupport
// Ensure the resolved model is of expected type
if
(
!
(
model
instanceof
ResourceEditorModel
))
{
ref
.
dispose
();
this
.
modelReference
=
null
;
this
.
modelReference
=
undefined
;
throw
new
Error
(
`Unexpected model for ResourceInput:
${
this
.
resource
}
`
);
}
...
...
@@ -122,10 +122,10 @@ export class ResourceEditorInput extends TextEditorInput implements IModeSupport
dispose
():
void
{
if
(
this
.
modelReference
)
{
this
.
modelReference
.
then
(
ref
=>
ref
.
dispose
());
this
.
modelReference
=
null
;
this
.
modelReference
=
undefined
;
}
this
.
cachedModel
=
null
;
this
.
cachedModel
=
undefined
;
super
.
dispose
();
}
...
...
src/vs/workbench/common/editor/untitledTextEditorInput.ts
浏览文件 @
1c9015ae
...
...
@@ -28,9 +28,9 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin
private
readonly
_onDidModelChangeEncoding
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidModelChangeEncoding
=
this
.
_onDidModelChangeEncoding
.
event
;
private
cachedModel
:
UntitledTextEditorModel
|
null
=
null
;
private
cachedModel
:
UntitledTextEditorModel
|
undefined
=
undefined
;
private
modelResolve
:
Promise
<
UntitledTextEditorModel
&
IResolvedTextEditorModel
>
|
null
=
null
;
private
modelResolve
:
Promise
<
UntitledTextEditorModel
&
IResolvedTextEditorModel
>
|
undefined
=
undefined
;
private
preferredMode
:
string
|
undefined
;
...
...
@@ -255,8 +255,8 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin
}
dispose
():
void
{
this
.
cachedModel
=
null
;
this
.
modelResolve
=
null
;
this
.
cachedModel
=
undefined
;
this
.
modelResolve
=
undefined
;
super
.
dispose
();
}
...
...
src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts
浏览文件 @
1c9015ae
...
...
@@ -139,7 +139,7 @@ export class TextModelResolverService implements ITextModelService {
private
async
doCreateModelReference
(
resource
:
URI
):
Promise
<
IReference
<
IResolvedTextEditorModel
>>
{
// Untitled Schema: go through
cached input
// Untitled Schema: go through
untitled text service
if
(
resource
.
scheme
===
network
.
Schemas
.
untitled
)
{
const
model
=
await
this
.
untitledTextEditorService
.
resolve
({
untitledResource
:
resource
});
...
...
@@ -149,7 +149,6 @@ export class TextModelResolverService implements ITextModelService {
// InMemory Schema: go through model service cache
if
(
resource
.
scheme
===
network
.
Schemas
.
inMemory
)
{
const
cachedModel
=
this
.
modelService
.
getModel
(
resource
);
if
(
!
cachedModel
)
{
throw
new
Error
(
'
Cant resolve inmemory resource
'
);
}
...
...
src/vs/workbench/services/untitled/common/untitledTextEditorService.ts
浏览文件 @
1c9015ae
...
...
@@ -140,7 +140,7 @@ export class UntitledTextEditorService extends Disposable implements IUntitledTe
private
readonly
_onDidChangeLabel
=
this
.
_register
(
new
Emitter
<
URI
>
());
readonly
onDidChangeLabel
=
this
.
_onDidChangeLabel
.
event
;
pr
otected
readonly
mapResourceToInput
=
new
ResourceMap
<
UntitledTextEditorInput
>
();
pr
ivate
readonly
mapResourceToInput
=
new
ResourceMap
<
UntitledTextEditorInput
>
();
private
readonly
mapResourceToAssociatedFilePath
=
new
ResourceMap
<
boolean
>
();
constructor
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录