Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
4925df27
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
4925df27
编写于
10月 23, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge commit 'refs/pull/60051/head' of github.com:Microsoft/vscode into pr/60051
上级
5661a5a5
212aade6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
54 deletion
+80
-54
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+5
-0
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+1
-0
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-0
src/vs/workbench/api/node/extHostSCM.ts
src/vs/workbench/api/node/extHostSCM.ts
+11
-0
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+60
-54
src/vs/workbench/services/scm/common/scm.ts
src/vs/workbench/services/scm/common/scm.ts
+2
-0
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
4925df27
...
@@ -720,6 +720,11 @@ declare module 'vscode' {
...
@@ -720,6 +720,11 @@ declare module 'vscode' {
* An event signaling when the selection state changes.
* An event signaling when the selection state changes.
*/
*/
readonly
onDidChangeSelection
:
Event
<
boolean
>
;
readonly
onDidChangeSelection
:
Event
<
boolean
>
;
/**
* Whether the input box is hidden.
*/
hideInputBox
:
boolean
;
}
}
//#endregion
//#endregion
...
...
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
4925df27
...
@@ -119,6 +119,7 @@ class MainThreadSCMProvider implements ISCMProvider {
...
@@ -119,6 +119,7 @@ class MainThreadSCMProvider implements ISCMProvider {
get
acceptInputCommand
():
Command
|
undefined
{
return
this
.
features
.
acceptInputCommand
;
}
get
acceptInputCommand
():
Command
|
undefined
{
return
this
.
features
.
acceptInputCommand
;
}
get
statusBarCommands
():
Command
[]
|
undefined
{
return
this
.
features
.
statusBarCommands
;
}
get
statusBarCommands
():
Command
[]
|
undefined
{
return
this
.
features
.
statusBarCommands
;
}
get
count
():
number
|
undefined
{
return
this
.
features
.
count
;
}
get
count
():
number
|
undefined
{
return
this
.
features
.
count
;
}
get
hideInputBox
():
boolean
|
undefined
{
return
this
.
features
.
hideInputBox
;
}
private
_onDidChangeCommitTemplate
=
new
Emitter
<
string
>
();
private
_onDidChangeCommitTemplate
=
new
Emitter
<
string
>
();
get
onDidChangeCommitTemplate
():
Event
<
string
>
{
return
this
.
_onDidChangeCommitTemplate
.
event
;
}
get
onDidChangeCommitTemplate
():
Event
<
string
>
{
return
this
.
_onDidChangeCommitTemplate
.
event
;
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
4925df27
...
@@ -535,6 +535,7 @@ export interface SCMProviderFeatures {
...
@@ -535,6 +535,7 @@ export interface SCMProviderFeatures {
commitTemplate
?:
string
;
commitTemplate
?:
string
;
acceptInputCommand
?:
modes
.
Command
;
acceptInputCommand
?:
modes
.
Command
;
statusBarCommands
?:
modes
.
Command
[];
statusBarCommands
?:
modes
.
Command
[];
hideInputBox
?:
boolean
;
}
}
export
interface
SCMGroupFeatures
{
export
interface
SCMGroupFeatures
{
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
4925df27
...
@@ -439,6 +439,17 @@ class ExtHostSourceControl implements vscode.SourceControl {
...
@@ -439,6 +439,17 @@ class ExtHostSourceControl implements vscode.SourceControl {
return
this
.
_selected
;
return
this
.
_selected
;
}
}
private
_hideInputBox
:
boolean
=
false
;
get
hideInputBox
():
boolean
{
return
this
.
_hideInputBox
;
}
set
hideInputBox
(
hideInputBox
:
boolean
|
undefined
)
{
this
.
_hideInputBox
=
hideInputBox
;
this
.
_proxy
.
$updateSourceControl
(
this
.
handle
,
{
hideInputBox
:
!!
hideInputBox
});
}
private
_onDidChangeSelection
=
new
Emitter
<
boolean
>
();
private
_onDidChangeSelection
=
new
Emitter
<
boolean
>
();
readonly
onDidChangeSelection
=
this
.
_onDidChangeSelection
.
event
;
readonly
onDidChangeSelection
=
this
.
_onDidChangeSelection
.
event
;
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
4925df27
...
@@ -814,57 +814,59 @@ export class RepositoryPanel extends ViewletPanel {
...
@@ -814,57 +814,59 @@ export class RepositoryPanel extends ViewletPanel {
this
.
disposables
.
push
(
focusTracker
);
this
.
disposables
.
push
(
focusTracker
);
// Input
// Input
this
.
inputBoxContainer
=
append
(
container
,
$
(
'
.scm-editor
'
));
if
(
!
this
.
repository
.
provider
.
hideInputBox
)
{
this
.
inputBoxContainer
=
append
(
container
,
$
(
'
.scm-editor
'
));
const
updatePlaceholder
=
()
=>
{
const
binding
=
this
.
keybindingService
.
lookupKeybinding
(
'
scm.acceptInput
'
);
const
updatePlaceholder
=
()
=>
{
const
label
=
binding
?
binding
.
getLabel
()
:
(
platform
.
isMacintosh
?
'
Cmd+Enter
'
:
'
Ctrl+Enter
'
);
const
binding
=
this
.
keybindingService
.
lookupKeybinding
(
'
scm.acceptInput
'
);
const
placeholder
=
format
(
this
.
repository
.
input
.
placeholder
,
label
);
const
label
=
binding
?
binding
.
getLabel
()
:
(
platform
.
isMacintosh
?
'
Cmd+Enter
'
:
'
Ctrl+Enter
'
);
const
placeholder
=
format
(
this
.
repository
.
input
.
placeholder
,
label
);
this
.
inputBox
.
setPlaceHolder
(
placeholder
);
};
this
.
inputBox
.
setPlaceHolder
(
placeholder
);
};
const
validationDelayer
=
new
ThrottledDelayer
<
any
>
(
200
);
const
validate
=
()
=>
{
const
validationDelayer
=
new
ThrottledDelayer
<
any
>
(
200
);
return
this
.
repository
.
input
.
validateInput
(
this
.
inputBox
.
value
,
this
.
inputBox
.
inputElement
.
selectionStart
).
then
(
result
=>
{
const
validate
=
()
=>
{
if
(
!
result
)
{
return
this
.
repository
.
input
.
validateInput
(
this
.
inputBox
.
value
,
this
.
inputBox
.
inputElement
.
selectionStart
).
then
(
result
=>
{
this
.
inputBox
.
inputElement
.
removeAttribute
(
'
aria-invalid
'
);
if
(
!
result
)
{
this
.
inputBox
.
hideMessage
();
this
.
inputBox
.
inputElement
.
removeAttribute
(
'
aria-invalid
'
);
}
else
{
this
.
inputBox
.
hideMessage
();
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-invalid
'
,
'
true
'
);
}
else
{
this
.
inputBox
.
showMessage
({
content
:
result
.
message
,
type
:
convertValidationType
(
result
.
type
)
});
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-invalid
'
,
'
true
'
);
}
this
.
inputBox
.
showMessage
({
content
:
result
.
message
,
type
:
convertValidationType
(
result
.
type
)
});
});
}
};
});
};
const
triggerValidation
=
()
=>
validationDelayer
.
trigger
(
validate
);
const
triggerValidation
=
()
=>
validationDelayer
.
trigger
(
validate
);
this
.
inputBox
=
new
InputBox
(
this
.
inputBoxContainer
,
this
.
contextViewService
,
{
flexibleHeight
:
true
});
this
.
disposables
.
push
(
attachInputBoxStyler
(
this
.
inputBox
,
this
.
themeService
));
this
.
inputBox
=
new
InputBox
(
this
.
inputBoxContainer
,
this
.
contextViewService
,
{
flexibleHeight
:
true
});
this
.
disposables
.
push
(
this
.
inputBox
);
this
.
disposables
.
push
(
attachInputBoxStyler
(
this
.
inputBox
,
this
.
themeService
));
this
.
disposables
.
push
(
this
.
inputBox
);
this
.
inputBox
.
onDidChange
(
triggerValidation
,
null
,
this
.
disposables
);
this
.
inputBox
.
onDidChange
(
triggerValidation
,
null
,
this
.
disposables
);
const
onKeyUp
=
domEvent
(
this
.
inputBox
.
inputElement
,
'
keyup
'
);
const
onMouseUp
=
domEvent
(
this
.
inputBox
.
inputElement
,
'
mouseup
'
);
const
onKeyUp
=
domEvent
(
this
.
inputBox
.
inputElement
,
'
keyup
'
);
anyEvent
<
any
>
(
onKeyUp
,
onMouseUp
)(
triggerValidation
,
null
,
this
.
disposables
);
const
onMouseUp
=
domEvent
(
this
.
inputBox
.
inputElement
,
'
mouseup
'
);
anyEvent
<
any
>
(
onKeyUp
,
onMouseUp
)(
triggerValidation
,
null
,
this
.
disposables
);
this
.
inputBox
.
value
=
this
.
repository
.
input
.
value
;
this
.
inputBox
.
onDidChange
(
value
=>
this
.
repository
.
input
.
value
=
value
,
null
,
this
.
disposables
);
this
.
inputBox
.
value
=
this
.
repository
.
input
.
value
;
this
.
repository
.
input
.
onDidChange
(
value
=>
this
.
inputBox
.
value
=
value
,
null
,
this
.
disposables
);
this
.
inputBox
.
onDidChange
(
value
=>
this
.
repository
.
input
.
value
=
value
,
null
,
this
.
disposables
);
this
.
repository
.
input
.
onDidChange
(
value
=>
this
.
inputBox
.
value
=
value
,
null
,
this
.
disposables
);
updatePlaceholder
();
this
.
repository
.
input
.
onDidChangePlaceholder
(
updatePlaceholder
,
null
,
this
.
disposables
);
updatePlaceholder
();
this
.
keybindingService
.
onDidUpdateKeybindings
(
updatePlaceholder
,
null
,
this
.
disposables
);
this
.
repository
.
input
.
onDidChangePlaceholder
(
updatePlaceholder
,
null
,
this
.
disposables
);
this
.
keybindingService
.
onDidUpdateKeybindings
(
updatePlaceholder
,
null
,
this
.
disposables
);
this
.
disposables
.
push
(
this
.
inputBox
.
onDidHeightChange
(()
=>
this
.
layoutBody
()));
this
.
disposables
.
push
(
this
.
inputBox
.
onDidHeightChange
(()
=>
this
.
layoutBody
()));
if
(
this
.
repository
.
provider
.
onDidChangeCommitTemplate
)
{
this
.
repository
.
provider
.
onDidChangeCommitTemplate
(
this
.
updateInputBox
,
this
,
this
.
disposables
);
}
if
(
this
.
repository
.
provider
.
onDidChangeCommitTemplate
)
{
this
.
updateInputBox
();
this
.
repository
.
provider
.
onDidChangeCommitTemplate
(
this
.
updateInputBox
,
this
,
this
.
disposables
);
}
}
this
.
updateInputBox
();
// List
// List
this
.
listContainer
=
append
(
container
,
$
(
'
.scm-status.show-file-icons
'
));
this
.
listContainer
=
append
(
container
,
$
(
'
.scm-status.show-file-icons
'
));
...
@@ -918,20 +920,24 @@ export class RepositoryPanel extends ViewletPanel {
...
@@ -918,20 +920,24 @@ export class RepositoryPanel extends ViewletPanel {
}
}
this
.
cachedHeight
=
height
;
this
.
cachedHeight
=
height
;
this
.
inputBox
.
layout
();
if
(
this
.
inputBox
)
{
this
.
inputBox
.
layout
();
}
const
editorHeight
=
this
.
inputBox
.
height
;
const
editorHeight
=
this
.
inputBox
?
this
.
inputBox
.
height
:
0
;
const
listHeight
=
height
-
(
editorHeight
+
12
/* margin */
);
const
listHeight
=
height
-
(
editorHeight
+
(
editorHeight
?
12
:
0
)
/* margin */
);
this
.
listContainer
.
style
.
height
=
`
${
listHeight
}
px`
;
this
.
listContainer
.
style
.
height
=
`
${
listHeight
}
px`
;
this
.
list
.
layout
(
listHeight
);
this
.
list
.
layout
(
listHeight
);
toggleClass
(
this
.
inputBoxContainer
,
'
scroll
'
,
editorHeight
>=
134
);
if
(
this
.
inputBoxContainer
)
{
toggleClass
(
this
.
inputBoxContainer
,
'
scroll
'
,
editorHeight
>=
134
);
}
}
}
focus
():
void
{
focus
():
void
{
super
.
focus
();
super
.
focus
();
if
(
this
.
isExpanded
())
{
if
(
this
.
isExpanded
()
&&
this
.
inputBox
)
{
this
.
inputBox
.
focus
();
this
.
inputBox
.
focus
();
}
}
}
}
...
@@ -991,7 +997,7 @@ export class RepositoryPanel extends ViewletPanel {
...
@@ -991,7 +997,7 @@ export class RepositoryPanel extends ViewletPanel {
}
}
private
updateInputBox
():
void
{
private
updateInputBox
():
void
{
if
(
typeof
this
.
repository
.
provider
.
commitTemplate
===
'
undefined
'
||
this
.
inputBox
.
value
)
{
if
(
typeof
this
.
repository
.
provider
.
commitTemplate
===
'
undefined
'
||
!
this
.
inputBox
||
this
.
inputBox
.
value
)
{
return
;
return
;
}
}
...
...
src/vs/workbench/services/scm/common/scm.ts
浏览文件 @
4925df27
...
@@ -63,6 +63,8 @@ export interface ISCMProvider extends IDisposable {
...
@@ -63,6 +63,8 @@ export interface ISCMProvider extends IDisposable {
readonly
statusBarCommands
?:
Command
[];
readonly
statusBarCommands
?:
Command
[];
readonly
onDidChange
:
Event
<
void
>
;
readonly
onDidChange
:
Event
<
void
>
;
readonly
hideInputBox
?:
boolean
|
undefined
;
getOriginalResource
(
uri
:
URI
):
TPromise
<
URI
>
;
getOriginalResource
(
uri
:
URI
):
TPromise
<
URI
>
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录