Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e17a5f49
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,发现更多精彩内容 >>
提交
e17a5f49
编写于
6月 29, 2017
作者:
H
Hui Zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set placeholder text in SourceControlInputBox
上级
8b942faa
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
46 addition
and
2 deletion
+46
-2
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+1
-0
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+5
-0
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+10
-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
+2
-2
src/vs/workbench/services/scm/common/scm.ts
src/vs/workbench/services/scm/common/scm.ts
+2
-0
src/vs/workbench/services/scm/common/scmService.ts
src/vs/workbench/services/scm/common/scmService.ts
+14
-0
未找到文件。
extensions/git/src/repository.ts
浏览文件 @
e17a5f49
...
@@ -385,6 +385,7 @@ export class Repository implements Disposable {
...
@@ -385,6 +385,7 @@ export class Repository implements Disposable {
const
label
=
`
${
path
.
basename
(
repository
.
root
)}
(Git)`
;
const
label
=
`
${
path
.
basename
(
repository
.
root
)}
(Git)`
;
this
.
_sourceControl
=
scm
.
createSourceControl
(
'
git
'
,
label
);
this
.
_sourceControl
=
scm
.
createSourceControl
(
'
git
'
,
label
);
this
.
_sourceControl
.
inputBox
.
placeholder
=
localize
(
'
commitMessage
'
,
"
Message (press {0} to commit)
"
,
process
.
platform
===
'
darwin
'
?
'
Cmd+Enter
'
:
'
Ctrl+Enter
'
);
this
.
_sourceControl
.
acceptInputCommand
=
{
command
:
'
git.commitWithInput
'
,
title
:
localize
(
'
commit
'
,
"
Commit
"
),
arguments
:
[
this
.
_sourceControl
]
};
this
.
_sourceControl
.
acceptInputCommand
=
{
command
:
'
git.commitWithInput
'
,
title
:
localize
(
'
commit
'
,
"
Commit
"
),
arguments
:
[
this
.
_sourceControl
]
};
this
.
_sourceControl
.
quickDiffProvider
=
this
;
this
.
_sourceControl
.
quickDiffProvider
=
this
;
this
.
disposables
.
push
(
this
.
_sourceControl
);
this
.
disposables
.
push
(
this
.
_sourceControl
);
...
...
src/vs/vscode.d.ts
浏览文件 @
e17a5f49
...
@@ -5326,6 +5326,11 @@ declare module 'vscode' {
...
@@ -5326,6 +5326,11 @@ declare module 'vscode' {
* Setter and getter for the contents of the input box.
* Setter and getter for the contents of the input box.
*/
*/
value
:
string
;
value
:
string
;
/**
* A string to show as place holder in the input box to guide the user.
*/
placeholder
:
string
;
}
}
interface
QuickDiffProvider
{
interface
QuickDiffProvider
{
...
...
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
e17a5f49
...
@@ -343,4 +343,14 @@ export class MainThreadSCM implements MainThreadSCMShape {
...
@@ -343,4 +343,14 @@ export class MainThreadSCM implements MainThreadSCMShape {
repository
.
input
.
value
=
value
;
repository
.
input
.
value
=
value
;
}
}
$setInputBoxPlaceholder
(
sourceControlHandle
:
number
,
placeholder
:
string
):
void
{
const
repository
=
this
.
_repositories
[
sourceControlHandle
];
if
(
!
repository
)
{
return
;
}
repository
.
input
.
placeholder
=
placeholder
;
}
}
}
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
e17a5f49
...
@@ -348,6 +348,7 @@ export interface MainThreadSCMShape extends IDisposable {
...
@@ -348,6 +348,7 @@ export interface MainThreadSCMShape extends IDisposable {
$unregisterGroup
(
sourceControlHandle
:
number
,
handle
:
number
):
void
;
$unregisterGroup
(
sourceControlHandle
:
number
,
handle
:
number
):
void
;
$setInputBoxValue
(
sourceControlHandle
:
number
,
value
:
string
):
void
;
$setInputBoxValue
(
sourceControlHandle
:
number
,
value
:
string
):
void
;
$setInputBoxPlaceholder
(
sourceControlHandle
:
number
,
placeholder
:
string
):
void
;
}
}
export
type
DebugSessionUUID
=
string
;
export
type
DebugSessionUUID
=
string
;
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
e17a5f49
...
@@ -43,6 +43,17 @@ export class ExtHostSCMInputBox {
...
@@ -43,6 +43,17 @@ export class ExtHostSCMInputBox {
return
this
.
_onDidChange
.
event
;
return
this
.
_onDidChange
.
event
;
}
}
private
_placeholder
:
string
=
''
;
get
placeholder
():
string
{
return
this
.
_placeholder
;
}
set
placeholder
(
placeholder
:
string
)
{
this
.
_proxy
.
$setInputBoxPlaceholder
(
this
.
_sourceControlHandle
,
placeholder
);
this
.
_placeholder
=
placeholder
;
}
constructor
(
private
_proxy
:
MainThreadSCMShape
,
private
_sourceControlHandle
:
number
)
{
constructor
(
private
_proxy
:
MainThreadSCMShape
,
private
_sourceControlHandle
:
number
)
{
// noop
// noop
}
}
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
e17a5f49
...
@@ -48,7 +48,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
...
@@ -48,7 +48,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import
{
ViewSizing
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
ViewSizing
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
IExtensionsViewlet
,
VIEWLET_ID
as
EXTENSIONS_VIEWLET_ID
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IExtensionsViewlet
,
VIEWLET_ID
as
EXTENSIONS_VIEWLET_ID
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
...
@@ -307,15 +306,16 @@ class SourceControlView extends CollapsibleView {
...
@@ -307,15 +306,16 @@ class SourceControlView extends CollapsibleView {
this
.
inputBoxContainer
=
append
(
container
,
$
(
'
.scm-editor
'
));
this
.
inputBoxContainer
=
append
(
container
,
$
(
'
.scm-editor
'
));
this
.
inputBox
=
new
InputBox
(
this
.
inputBoxContainer
,
this
.
contextViewService
,
{
this
.
inputBox
=
new
InputBox
(
this
.
inputBoxContainer
,
this
.
contextViewService
,
{
placeholder
:
localize
(
'
commitMessage
'
,
"
Message (press {0} to commit)
"
,
platform
.
isMacintosh
?
'
Cmd+Enter
'
:
'
Ctrl+Enter
'
),
flexibleHeight
:
true
flexibleHeight
:
true
});
});
this
.
disposables
.
push
(
attachInputBoxStyler
(
this
.
inputBox
,
this
.
themeService
));
this
.
disposables
.
push
(
attachInputBoxStyler
(
this
.
inputBox
,
this
.
themeService
));
this
.
disposables
.
push
(
this
.
inputBox
);
this
.
disposables
.
push
(
this
.
inputBox
);
this
.
inputBox
.
value
=
this
.
repository
.
input
.
value
;
this
.
inputBox
.
value
=
this
.
repository
.
input
.
value
;
this
.
inputBox
.
setPlaceHolder
(
this
.
repository
.
input
.
placeholder
);
this
.
inputBox
.
onDidChange
(
value
=>
this
.
repository
.
input
.
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
);
this
.
repository
.
input
.
onDidChange
(
value
=>
this
.
inputBox
.
value
=
value
,
null
,
this
.
disposables
);
this
.
repository
.
input
.
onDidChangePlaceholder
(
placeholder
=>
this
.
inputBox
.
setPlaceHolder
(
placeholder
),
null
,
this
.
disposables
);
this
.
disposables
.
push
(
this
.
inputBox
.
onDidHeightChange
(()
=>
this
.
layoutBody
()));
this
.
disposables
.
push
(
this
.
inputBox
.
onDidHeightChange
(()
=>
this
.
layoutBody
()));
chain
(
domEvent
(
this
.
inputBox
.
inputElement
,
'
keydown
'
))
chain
(
domEvent
(
this
.
inputBox
.
inputElement
,
'
keydown
'
))
...
...
src/vs/workbench/services/scm/common/scm.ts
浏览文件 @
e17a5f49
...
@@ -58,6 +58,8 @@ export interface ISCMProvider extends IDisposable {
...
@@ -58,6 +58,8 @@ export interface ISCMProvider extends IDisposable {
export
interface
ISCMInput
{
export
interface
ISCMInput
{
value
:
string
;
value
:
string
;
readonly
onDidChange
:
Event
<
string
>
;
readonly
onDidChange
:
Event
<
string
>
;
placeholder
:
string
;
readonly
onDidChangePlaceholder
:
Event
<
string
>
;
}
}
export
interface
ISCMRepository
extends
IDisposable
{
export
interface
ISCMRepository
extends
IDisposable
{
...
...
src/vs/workbench/services/scm/common/scmService.ts
浏览文件 @
e17a5f49
...
@@ -24,6 +24,20 @@ class SCMInput implements ISCMInput {
...
@@ -24,6 +24,20 @@ class SCMInput implements ISCMInput {
private
_onDidChange
=
new
Emitter
<
string
>
();
private
_onDidChange
=
new
Emitter
<
string
>
();
get
onDidChange
():
Event
<
string
>
{
return
this
.
_onDidChange
.
event
;
}
get
onDidChange
():
Event
<
string
>
{
return
this
.
_onDidChange
.
event
;
}
private
_placeholder
=
''
;
get
placeholder
():
string
{
return
this
.
_placeholder
;
}
set
placeholder
(
placeholder
:
string
)
{
this
.
_placeholder
=
placeholder
;
this
.
_onDidChangePlaceholder
.
fire
(
placeholder
);
}
private
_onDidChangePlaceholder
=
new
Emitter
<
string
>
();
get
onDidChangePlaceholder
():
Event
<
string
>
{
return
this
.
_onDidChangePlaceholder
.
event
;
}
}
}
class
SCMRepository
implements
ISCMRepository
{
class
SCMRepository
implements
ISCMRepository
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录