Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5c112d77
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,发现更多精彩内容 >>
提交
5c112d77
编写于
7月 01, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/microsoft/vscode
上级
faf9bda0
f813a020
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
14 deletion
+52
-14
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+1
-0
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
...s/workbench/contrib/extensions/browser/extensionEditor.ts
+6
-6
src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css
...ench/contrib/extensions/browser/media/extensionEditor.css
+3
-4
src/vs/workbench/contrib/views/browser/treeView.ts
src/vs/workbench/contrib/views/browser/treeView.ts
+6
-2
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
...workbench/services/keybinding/common/keybindingEditing.ts
+26
-2
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+10
-0
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
5c112d77
...
@@ -64,6 +64,7 @@ const vscodeResources = [
...
@@ -64,6 +64,7 @@ const vscodeResources = [
'
out-build/paths.js
'
,
'
out-build/paths.js
'
,
'
out-build/vs/**/*.{svg,png,html}
'
,
'
out-build/vs/**/*.{svg,png,html}
'
,
'
!out-build/vs/code/browser/**/*.html
'
,
'
!out-build/vs/code/browser/**/*.html
'
,
'
!out-build/vs/editor/standalone/**/*.svg
'
,
'
out-build/vs/base/common/performance.js
'
,
'
out-build/vs/base/common/performance.js
'
,
'
out-build/vs/base/node/languagePacks.js
'
,
'
out-build/vs/base/node/languagePacks.js
'
,
'
out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}
'
,
'
out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}
'
,
...
...
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
浏览文件 @
5c112d77
...
@@ -224,23 +224,23 @@ export class ExtensionEditor extends BaseEditor {
...
@@ -224,23 +224,23 @@ export class ExtensionEditor extends BaseEditor {
builtin
.
textContent
=
localize
(
'
builtin
'
,
"
Built-in
"
);
builtin
.
textContent
=
localize
(
'
builtin
'
,
"
Built-in
"
);
const
subtitle
=
append
(
details
,
$
(
'
.subtitle
'
));
const
subtitle
=
append
(
details
,
$
(
'
.subtitle
'
));
const
publisher
=
append
(
subtitle
,
$
(
'
span.publisher.clickable
'
,
{
title
:
localize
(
'
publisher
'
,
"
Publisher name
"
),
tabIndex
:
0
}));
const
publisher
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.publisher.clickable
'
,
{
title
:
localize
(
'
publisher
'
,
"
Publisher name
"
),
tabIndex
:
0
}));
const
installCount
=
append
(
subtitle
,
$
(
'
span.install
'
,
{
title
:
localize
(
'
install count
'
,
"
Install count
"
),
tabIndex
:
0
}));
const
installCount
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.install
'
,
{
title
:
localize
(
'
install count
'
,
"
Install count
"
),
tabIndex
:
0
}));
const
rating
=
append
(
subtitle
,
$
(
'
span.rating.clickable
'
,
{
title
:
localize
(
'
rating
'
,
"
Rating
"
),
tabIndex
:
0
}));
const
rating
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.rating.clickable
'
,
{
title
:
localize
(
'
rating
'
,
"
Rating
"
),
tabIndex
:
0
}));
const
repository
=
append
(
subtitle
,
$
(
'
span.repository.clickable
'
));
const
repository
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.repository.clickable
'
));
repository
.
textContent
=
localize
(
'
repository
'
,
'
Repository
'
);
repository
.
textContent
=
localize
(
'
repository
'
,
'
Repository
'
);
repository
.
style
.
display
=
'
none
'
;
repository
.
style
.
display
=
'
none
'
;
repository
.
tabIndex
=
0
;
repository
.
tabIndex
=
0
;
const
license
=
append
(
subtitle
,
$
(
'
span.license.clickable
'
));
const
license
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.license.clickable
'
));
license
.
textContent
=
localize
(
'
license
'
,
'
License
'
);
license
.
textContent
=
localize
(
'
license
'
,
'
License
'
);
license
.
style
.
display
=
'
none
'
;
license
.
style
.
display
=
'
none
'
;
license
.
tabIndex
=
0
;
license
.
tabIndex
=
0
;
const
version
=
append
(
subtitle
,
$
(
'
span.version
'
));
const
version
=
append
(
append
(
subtitle
,
$
(
'
.subtitle-entry
'
))
,
$
(
'
span.version
'
));
version
.
textContent
=
localize
(
'
version
'
,
'
Version
'
);
version
.
textContent
=
localize
(
'
version
'
,
'
Version
'
);
const
description
=
append
(
details
,
$
(
'
.description
'
));
const
description
=
append
(
details
,
$
(
'
.description
'
));
...
...
src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css
浏览文件 @
5c112d77
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
line-height
:
20px
;
line-height
:
20px
;
}
}
.extension-editor
>
.header
>
.details
>
.subtitle
>
.publisher
{
.extension-editor
>
.header
>
.details
>
.subtitle
.publisher
{
font-size
:
18px
;
font-size
:
18px
;
}
}
...
@@ -124,12 +124,11 @@
...
@@ -124,12 +124,11 @@
align-items
:
center
;
align-items
:
center
;
}
}
.extension-editor
>
.header
>
.details
>
.subtitle
>
.install
>
.count
{
.extension-editor
>
.header
>
.details
>
.subtitle
.install
>
.count
{
margin-left
:
6px
;
margin-left
:
6px
;
}
}
.extension-editor
>
.header
>
.details
>
.subtitle
>
span
:not
(
:first-child
)
:not
(
:empty
),
.extension-editor
>
.header
>
.details
>
.subtitle
>
div
:not
(
:first-child
)
:not
(
:empty
)
{
.extension-editor
>
.header
>
.details
>
.subtitle
>
a
:not
(
:first-child
)
:not
(
:empty
)
{
border-left
:
1px
solid
rgba
(
128
,
128
,
128
,
0.7
);
border-left
:
1px
solid
rgba
(
128
,
128
,
128
,
0.7
);
margin-left
:
14px
;
margin-left
:
14px
;
padding-left
:
14px
;
padding-left
:
14px
;
...
...
src/vs/workbench/contrib/views/browser/treeView.ts
浏览文件 @
5c112d77
...
@@ -38,7 +38,7 @@ import { FuzzyScore, createMatches } from 'vs/base/common/filters';
...
@@ -38,7 +38,7 @@ import { FuzzyScore, createMatches } from 'vs/base/common/filters';
import
{
CollapseAllAction
}
from
'
vs/base/browser/ui/tree/treeDefaults
'
;
import
{
CollapseAllAction
}
from
'
vs/base/browser/ui/tree/treeDefaults
'
;
import
{
isFalsyOrWhitespace
}
from
'
vs/base/common/strings
'
;
import
{
isFalsyOrWhitespace
}
from
'
vs/base/common/strings
'
;
import
{
SIDE_BAR_BACKGROUND
,
PANEL_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
SIDE_BAR_BACKGROUND
,
PANEL_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IHoverService
}
from
'
vs/workbench/services/hover/browser/hover
'
;
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/services/hover/browser/hover
'
;
class
Root
implements
ITreeItem
{
class
Root
implements
ITreeItem
{
label
=
{
label
:
'
root
'
};
label
=
{
label
:
'
root
'
};
...
@@ -795,6 +795,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
...
@@ -795,6 +795,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
const
resolvableNode
:
ResolvableTreeItem
=
node
;
const
resolvableNode
:
ResolvableTreeItem
=
node
;
const
hoverService
=
this
.
hoverService
;
const
hoverService
=
this
.
hoverService
;
const
hoverDelay
=
this
.
hoverDelay
;
const
hoverDelay
=
this
.
hoverDelay
;
let
hoverOptions
:
IHoverOptions
|
undefined
;
function
mouseOver
(
this
:
HTMLElement
,
e
:
MouseEvent
):
any
{
function
mouseOver
(
this
:
HTMLElement
,
e
:
MouseEvent
):
any
{
let
isHovering
=
true
;
let
isHovering
=
true
;
function
mouseLeave
(
this
:
HTMLElement
,
e
:
MouseEvent
):
any
{
function
mouseLeave
(
this
:
HTMLElement
,
e
:
MouseEvent
):
any
{
...
@@ -805,7 +806,10 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
...
@@ -805,7 +806,10 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
await
resolvableNode
.
resolve
();
await
resolvableNode
.
resolve
();
const
tooltip
=
resolvableNode
.
tooltip
??
label
;
const
tooltip
=
resolvableNode
.
tooltip
??
label
;
if
(
isHovering
&&
tooltip
)
{
if
(
isHovering
&&
tooltip
)
{
hoverService
.
showHover
({
text
:
isString
(
tooltip
)
?
{
value
:
tooltip
}
:
tooltip
,
target
:
this
});
if
(
!
hoverOptions
)
{
hoverOptions
=
{
text
:
isString
(
tooltip
)
?
{
value
:
tooltip
}
:
tooltip
,
target
:
this
};
}
hoverService
.
showHover
(
hoverOptions
);
}
}
this
.
removeEventListener
(
DOM
.
EventType
.
MOUSE_LEAVE
,
mouseLeave
);
this
.
removeEventListener
(
DOM
.
EventType
.
MOUSE_LEAVE
,
mouseLeave
);
},
hoverDelay
);
},
hoverDelay
);
...
...
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
浏览文件 @
5c112d77
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
Queue
}
from
'
vs/base/common/async
'
;
import
{
Queue
}
from
'
vs/base/common/async
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
{
setProperty
}
from
'
vs/base/common/jsonEdit
'
;
import
{
setProperty
}
from
'
vs/base/common/jsonEdit
'
;
import
{
Edit
}
from
'
vs/base/common/jsonFormatter
'
;
import
{
Edit
}
from
'
vs/base/common/jsonFormatter
'
;
import
{
Disposable
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
...
@@ -143,7 +144,11 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
...
@@ -143,7 +144,11 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
const
eol
=
model
.
getEOL
();
const
eol
=
model
.
getEOL
();
const
key
=
keybindingItem
.
resolvedKeybinding
?
keybindingItem
.
resolvedKeybinding
.
getUserSettingsLabel
()
:
null
;
const
key
=
keybindingItem
.
resolvedKeybinding
?
keybindingItem
.
resolvedKeybinding
.
getUserSettingsLabel
()
:
null
;
if
(
key
)
{
if
(
key
)
{
this
.
applyEditsToBuffer
(
setProperty
(
model
.
getValue
(),
[
-
1
],
this
.
asObject
(
key
,
keybindingItem
.
command
,
keybindingItem
.
when
?
keybindingItem
.
when
.
serialize
()
:
undefined
,
true
),
{
tabSize
,
insertSpaces
,
eol
})[
0
],
model
);
const
entry
:
IUserFriendlyKeybinding
=
this
.
asObject
(
key
,
keybindingItem
.
command
,
keybindingItem
.
when
?
keybindingItem
.
when
.
serialize
()
:
undefined
,
true
);
const
userKeybindingEntries
=
<
IUserFriendlyKeybinding
[]
>
json
.
parse
(
model
.
getValue
());
if
(
userKeybindingEntries
.
every
(
e
=>
!
this
.
areSame
(
e
,
entry
)))
{
this
.
applyEditsToBuffer
(
setProperty
(
model
.
getValue
(),
[
-
1
],
entry
,
{
tabSize
,
insertSpaces
,
eol
})[
0
],
model
);
}
}
}
}
}
...
@@ -196,6 +201,26 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
...
@@ -196,6 +201,26 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
return
object
;
return
object
;
}
}
private
areSame
(
a
:
IUserFriendlyKeybinding
,
b
:
IUserFriendlyKeybinding
):
boolean
{
if
(
a
.
command
!==
b
.
command
)
{
return
false
;
}
if
(
a
.
key
!==
b
.
key
)
{
return
false
;
}
const
whenA
=
ContextKeyExpr
.
deserialize
(
a
.
when
);
const
whenB
=
ContextKeyExpr
.
deserialize
(
b
.
when
);
if
((
whenA
&&
!
whenB
)
||
(
!
whenA
&&
whenB
))
{
return
false
;
}
if
(
whenA
&&
whenB
&&
!
whenA
.
equals
(
whenB
))
{
return
false
;
}
if
(
!
objects
.
equals
(
a
.
args
,
b
.
args
))
{
return
false
;
}
return
true
;
}
private
applyEditsToBuffer
(
edit
:
Edit
,
model
:
ITextModel
):
void
{
private
applyEditsToBuffer
(
edit
:
Edit
,
model
:
ITextModel
):
void
{
const
startPosition
=
model
.
getPositionAt
(
edit
.
offset
);
const
startPosition
=
model
.
getPositionAt
(
edit
.
offset
);
...
@@ -206,7 +231,6 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
...
@@ -206,7 +231,6 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
model
.
pushEditOperations
([
new
Selection
(
startPosition
.
lineNumber
,
startPosition
.
column
,
startPosition
.
lineNumber
,
startPosition
.
column
)],
[
editOperation
],
()
=>
[]);
model
.
pushEditOperations
([
new
Selection
(
startPosition
.
lineNumber
,
startPosition
.
column
,
startPosition
.
lineNumber
,
startPosition
.
column
)],
[
editOperation
],
()
=>
[]);
}
}
private
resolveModelReference
():
Promise
<
IReference
<
IResolvedTextEditorModel
>>
{
private
resolveModelReference
():
Promise
<
IReference
<
IResolvedTextEditorModel
>>
{
return
this
.
fileService
.
exists
(
this
.
resource
)
return
this
.
fileService
.
exists
(
this
.
resource
)
.
then
(
exists
=>
{
.
then
(
exists
=>
{
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
5c112d77
...
@@ -220,6 +220,16 @@ suite('KeybindingsEditing', () => {
...
@@ -220,6 +220,16 @@ suite('KeybindingsEditing', () => {
.
then
(()
=>
assert
.
deepEqual
(
getUserKeybindings
(),
expected
));
.
then
(()
=>
assert
.
deepEqual
(
getUserKeybindings
(),
expected
));
});
});
test
(
'
remove a default keybinding should not ad duplicate entries
'
,
async
()
=>
{
const
expected
:
IUserFriendlyKeybinding
[]
=
[{
key
:
'
alt+c
'
,
command
:
'
-a
'
}];
await
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
a
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
}
}));
await
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
a
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
}
}));
await
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
a
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
}
}));
await
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
a
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
}
}));
await
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
a
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
}
}));
assert
.
deepEqual
(
getUserKeybindings
(),
expected
);
});
test
(
'
remove a user keybinding
'
,
()
=>
{
test
(
'
remove a user keybinding
'
,
()
=>
{
writeToKeybindingsFile
({
key
:
'
alt+c
'
,
command
:
'
b
'
});
writeToKeybindingsFile
({
key
:
'
alt+c
'
,
command
:
'
b
'
});
return
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
b
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
},
isDefault
:
false
}))
return
testObject
.
removeKeybinding
(
aResolvedKeybindingItem
({
command
:
'
b
'
,
firstPart
:
{
keyCode
:
KeyCode
.
KEY_C
,
modifiers
:
{
altKey
:
true
}
},
isDefault
:
false
}))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录