Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1b16063c
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 搜索 >>
提交
1b16063c
编写于
8月 19, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #76573
上级
3e25e268
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
14 deletion
+11
-14
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+11
-14
未找到文件。
src/vs/workbench/browser/labels.ts
浏览文件 @
1b16063c
...
...
@@ -317,40 +317,31 @@ class ResourceLabelWidget extends IconLabel {
}
notifyFormattersChange
():
void
{
if
(
this
.
label
&&
this
.
label
.
resource
)
{
this
.
setFile
(
this
.
label
.
resource
,
this
.
options
);
}
this
.
render
(
false
);
}
setResource
(
label
:
IResourceLabelProps
,
options
?:
IResourceLabelOptions
):
void
{
const
hasResourceChanged
=
this
.
hasResourceChanged
(
label
,
options
);
this
.
label
=
label
;
this
.
options
=
options
;
if
(
hasResourceChanged
)
{
if
(
this
.
hasPathLabelChanged
(
label
,
options
)
)
{
this
.
computedPathLabel
=
undefined
;
// reset path label due to resource change
}
this
.
render
(
hasResourceChanged
);
this
.
render
(
this
.
clearIconCache
(
label
,
options
)
);
}
private
hasResourceChanged
(
label
:
IResourceLabelProps
,
o
ptions
?:
IResourceLabelOptions
):
boolean
{
const
newResource
=
label
?
l
abel
.
resource
:
undefined
;
private
clearIconCache
(
newLabel
:
IResourceLabelProps
,
newO
ptions
?:
IResourceLabelOptions
):
boolean
{
const
newResource
=
newLabel
?
newL
abel
.
resource
:
undefined
;
const
oldResource
=
this
.
label
?
this
.
label
.
resource
:
undefined
;
const
newFileKind
=
options
?
o
ptions
.
fileKind
:
undefined
;
const
newFileKind
=
newOptions
?
newO
ptions
.
fileKind
:
undefined
;
const
oldFileKind
=
this
.
options
?
this
.
options
.
fileKind
:
undefined
;
if
(
newFileKind
!==
oldFileKind
)
{
return
true
;
// same resource but different kind (file, folder)
}
if
(
newResource
&&
this
.
computedPathLabel
!==
this
.
labelService
.
getUriLabel
(
newResource
))
{
return
true
;
}
if
(
newResource
&&
oldResource
)
{
return
newResource
.
toString
()
!==
oldResource
.
toString
();
}
...
...
@@ -362,6 +353,12 @@ class ResourceLabelWidget extends IconLabel {
return
true
;
}
private
hasPathLabelChanged
(
newLabel
:
IResourceLabelProps
,
newOptions
?:
IResourceLabelOptions
):
boolean
{
const
newResource
=
newLabel
?
newLabel
.
resource
:
undefined
;
return
!!
newResource
&&
this
.
computedPathLabel
!==
this
.
labelService
.
getUriLabel
(
newResource
);
}
setEditor
(
editor
:
IEditorInput
,
options
?:
IResourceLabelOptions
):
void
{
this
.
setResource
({
resource
:
toResource
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
MASTER
}),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录