Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
4a380384
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a380384
编写于
7月 16, 2019
作者:
P
pi1024e
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added clear input method to clear disposables.
上级
16219067
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
294 addition
and
291 deletion
+294
-291
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+70
-68
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
...s/workbench/contrib/extensions/browser/extensionEditor.ts
+224
-223
未找到文件。
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
4a380384
...
...
@@ -208,15 +208,15 @@ export class Sash extends Disposable {
}
}
if
(
!
this
.
state
)
{
return
;
}
if
(
this
.
state
)
{
// Select both iframes and webviews; internally Electron nests an iframe
// in its <webview> component, but this isn't queryable.
const
iframes
=
[
...
getElementsByTagName
(
'
iframe
'
),
...
getElementsByTagName
(
'
webview
'
),
...
getElementsByTagName
(
'
iframe
'
),
];
for
(
const
iframe
of
iframes
)
{
...
...
@@ -294,6 +294,8 @@ export class Sash extends Disposable {
domEvent
(
window
,
'
mousemove
'
)(
onMouseMove
,
null
,
disposables
);
domEvent
(
window
,
'
mouseup
'
)(
onMouseUp
,
null
,
disposables
);
}
}
private
onMouseDoubleClick
(
event
:
MouseEvent
):
void
{
this
.
_onDidReset
.
fire
();
...
...
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
浏览文件 @
4a380384
...
...
@@ -483,6 +483,13 @@ export class ExtensionEditor extends BaseEditor {
}));
}
clearInput
():
void
{
this
.
contentDisposables
.
clear
();
this
.
transientDisposables
.
clear
();
super
.
clearInput
();
}
focus
():
void
{
if
(
this
.
activeElement
)
{
this
.
activeElement
.
focus
();
...
...
@@ -584,9 +591,7 @@ export class ExtensionEditor extends BaseEditor {
const
content
=
$
(
'
div
'
,
{
class
:
'
subcontent
'
,
tabindex
:
'
0
'
});
return
this
.
loadContents
(()
=>
this
.
extensionManifest
!
.
get
())
.
then
(
manifest
=>
{
if
(
!
manifest
)
{
return
content
;
}
if
(
manifest
)
{
const
scrollableContent
=
new
DomScrollableElement
(
content
,
{});
...
...
@@ -618,6 +623,7 @@ export class ExtensionEditor extends BaseEditor {
append
(
this
.
content
,
scrollableContent
.
getDomNode
());
this
.
contentDisposables
.
add
(
scrollableContent
);
}
}
return
content
;
},
()
=>
{
append
(
content
,
$
(
'
p.nocontent
'
)).
textContent
=
localize
(
'
noContributions
'
,
"
No Contributions
"
);
...
...
@@ -684,10 +690,7 @@ export class ExtensionEditor extends BaseEditor {
}
const
contrib
=
properties
?
Object
.
keys
(
properties
)
:
[];
if
(
!
contrib
.
length
)
{
return
false
;
}
if
(
contrib
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
settings
'
,
"
Settings ({0})
"
,
contrib
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -707,15 +710,14 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderDebuggers
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
contrib
=
contributes
&&
contributes
.
debuggers
||
[];
if
(
!
contrib
.
length
)
{
return
false
;
}
if
(
contrib
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
debuggers
'
,
"
Debuggers ({0})
"
,
contrib
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -732,6 +734,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderViewContainers
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
...
...
@@ -743,10 +747,7 @@ export class ExtensionEditor extends BaseEditor {
return
result
;
},
[]
as
Array
<
{
id
:
string
,
title
:
string
,
location
:
string
}
>
);
if
(
!
viewContainers
.
length
)
{
return
false
;
}
if
(
viewContainers
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
viewContainers
'
,
"
View Containers ({0})
"
,
viewContainers
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -758,6 +759,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderViews
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
...
...
@@ -769,10 +772,7 @@ export class ExtensionEditor extends BaseEditor {
return
result
;
},
[]
as
Array
<
{
id
:
string
,
name
:
string
,
location
:
string
}
>
);
if
(
!
views
.
length
)
{
return
false
;
}
if
(
views
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
views
'
,
"
Views ({0})
"
,
views
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -784,6 +784,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderLocalizations
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
...
...
@@ -843,9 +845,9 @@ export class ExtensionEditor extends BaseEditor {
const
contributes
=
manifest
.
contributes
;
const
colors
=
contributes
&&
contributes
.
colors
;
if
(
!
colors
||
!
colors
.
length
)
{
return
false
;
}
if
(
colors
&&
colors
.
length
)
{
function
colorPreview
(
colorReference
:
string
):
Node
[]
{
let
result
:
Node
[]
=
[];
...
...
@@ -882,16 +884,15 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderJSONValidation
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
contrib
=
contributes
&&
contributes
.
jsonValidation
||
[];
if
(
!
contrib
.
length
)
{
return
false
;
}
if
(
contrib
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
JSON Validation
'
,
"
JSON Validation ({0})
"
,
contrib
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -907,6 +908,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderCommands
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
...
...
@@ -941,24 +944,23 @@ export class ExtensionEditor extends BaseEditor {
rawKeybindings
.
forEach
(
rawKeybinding
=>
{
const
keybinding
=
this
.
resolveKeybinding
(
rawKeybinding
);
if
(
!
keybinding
)
{
return
;
}
if
(
keybinding
)
{
let
command
=
byId
[
rawKeybinding
.
command
];
if
(
!
command
)
{
if
(
command
)
{
command
.
keybindings
.
push
(
keybinding
);
}
else
{
command
=
{
id
:
rawKeybinding
.
command
,
title
:
''
,
keybindings
:
[
keybinding
],
menus
:
[]
};
byId
[
command
.
id
]
=
command
;
commands
.
push
(
command
);
}
else
{
command
.
keybindings
.
push
(
keybinding
);
}
}
return
;
});
if
(
!
commands
.
length
)
{
return
false
;
}
if
(
commands
.
length
)
{
const
renderKeybinding
=
(
keybinding
:
ResolvedKeybinding
):
HTMLElement
=>
{
const
element
=
$
(
''
);
...
...
@@ -987,6 +989,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
renderLanguages
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
...
...
@@ -1006,12 +1010,12 @@ export class ExtensionEditor extends BaseEditor {
grammars
.
forEach
(
grammar
=>
{
let
language
=
byId
[
grammar
.
language
];
if
(
!
language
)
{
if
(
language
)
{
language
.
hasGrammar
=
true
;
}
else
{
language
=
{
id
:
grammar
.
language
,
name
:
grammar
.
language
,
extensions
:
[],
hasGrammar
:
true
,
hasSnippets
:
false
};
byId
[
language
.
id
]
=
language
;
languages
.
push
(
language
);
}
else
{
language
.
hasGrammar
=
true
;
}
});
...
...
@@ -1020,19 +1024,16 @@ export class ExtensionEditor extends BaseEditor {
snippets
.
forEach
(
snippet
=>
{
let
language
=
byId
[
snippet
.
language
];
if
(
!
language
)
{
if
(
language
)
{
language
.
hasSnippets
=
true
;
}
else
{
language
=
{
id
:
snippet
.
language
,
name
:
snippet
.
language
,
extensions
:
[],
hasGrammar
:
false
,
hasSnippets
:
true
};
byId
[
language
.
id
]
=
language
;
languages
.
push
(
language
);
}
else
{
language
.
hasSnippets
=
true
;
}
});
if
(
!
languages
.
length
)
{
return
false
;
}
if
(
languages
.
length
)
{
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
undefined
,
localize
(
'
languages
'
,
"
Languages ({0})
"
,
languages
.
length
)),
$
(
'
table
'
,
undefined
,
...
...
@@ -1056,6 +1057,8 @@ export class ExtensionEditor extends BaseEditor {
append
(
container
,
details
);
return
true
;
}
return
false
;
}
private
resolveKeybinding
(
rawKeyBinding
:
IKeyBinding
):
ResolvedKeybinding
|
null
{
let
key
:
string
|
undefined
;
...
...
@@ -1067,12 +1070,11 @@ export class ExtensionEditor extends BaseEditor {
}
const
keyBinding
=
KeybindingParser
.
parseKeybinding
(
key
||
rawKeyBinding
.
key
,
OS
);
if
(
!
keyBinding
)
{
return
null
;
}
if
(
keyBinding
)
{
return
this
.
keybindingService
.
resolveKeybinding
(
keyBinding
)[
0
];
}
return
null
;
}
private
loadContents
<
T
>
(
loadingTask
:
()
=>
CacheResult
<
T
>
):
Promise
<
T
>
{
addClass
(
this
.
content
,
'
loading
'
);
...
...
@@ -1094,7 +1096,6 @@ export class ExtensionEditor extends BaseEditor {
if
(
isPromiseCanceledError
(
err
))
{
return
;
}
this
.
notificationService
.
error
(
err
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录