Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fd94a29f
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,发现更多精彩内容 >>
提交
fd94a29f
编写于
5月 22, 2017
作者:
P
Phil Price
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Localization for codelens and warning messages.
上级
a8fe17a8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
24 deletion
+29
-24
extensions/merge-conflict/src/codelensProvider.ts
extensions/merge-conflict/src/codelensProvider.ts
+6
-4
extensions/merge-conflict/src/commandHandler.ts
extensions/merge-conflict/src/commandHandler.ts
+19
-18
extensions/merge-conflict/src/mergeDecorator.ts
extensions/merge-conflict/src/mergeDecorator.ts
+4
-2
未找到文件。
extensions/merge-conflict/src/codelensProvider.ts
浏览文件 @
fd94a29f
...
...
@@ -5,6 +5,8 @@
import
*
as
vscode
from
'
vscode
'
;
import
*
as
interfaces
from
'
./interfaces
'
;
import
{
loadMessageBundle
}
from
'
vscode-nls
'
;
const
localize
=
loadMessageBundle
();
export
default
class
MergeConflictCodeLensProvider
implements
vscode
.
CodeLensProvider
,
vscode
.
Disposable
{
...
...
@@ -47,25 +49,25 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
conflicts
.
forEach
(
conflict
=>
{
let
acceptCurrentCommand
:
vscode
.
Command
=
{
command
:
'
merge-conflict.accept.current
'
,
title
:
`Accept current change`
,
title
:
localize
(
'
acceptCurrentChange
'
,
'
Accept current change
'
)
,
arguments
:
[
'
known-conflict
'
,
conflict
]
};
let
acceptIncomingCommand
:
vscode
.
Command
=
{
command
:
'
merge-conflict.accept.incoming
'
,
title
:
`Accept incoming change`
,
title
:
localize
(
'
acceptIncomingChange
'
,
'
Accept incoming change
'
)
,
arguments
:
[
'
known-conflict
'
,
conflict
]
};
let
acceptBothCommand
:
vscode
.
Command
=
{
command
:
'
merge-conflict.accept.both
'
,
title
:
`Accept both changes`
,
title
:
localize
(
'
acceptBothChanges
'
,
'
Accept both changes
'
)
,
arguments
:
[
'
known-conflict
'
,
conflict
]
};
let
diffCommand
:
vscode
.
Command
=
{
command
:
'
git.merge.compare
'
,
title
:
`Compare changes`
,
title
:
localize
(
'
compareChanges
'
,
'
Compare changes
'
)
,
arguments
:
[
conflict
]
};
...
...
extensions/merge-conflict/src/commandHandler.ts
浏览文件 @
fd94a29f
...
...
@@ -6,8 +6,9 @@ import * as vscode from 'vscode';
import
*
as
interfaces
from
'
./interfaces
'
;
import
ContentProvider
from
'
./contentProvider
'
;
import
*
as
path
from
'
path
'
;
import
{
loadMessageBundle
}
from
'
vscode-nls
'
;
const
localize
=
loadMessageBundle
();
// TODO: Localization
const
messages
=
{
cursorNotInConflict
:
'
Editor cursor is not within a merge conflict
'
,
cursorOnSplitterRange
:
'
Editor cursor is within the merge conflict splitter, please move it to either the "current" or "incoming" block
'
,
...
...
@@ -34,16 +35,16 @@ export default class CommandHandler implements vscode.Disposable {
begin
()
{
this
.
disposables
.
push
(
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.current
'
,
this
.
acceptCurrent
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.incoming
'
,
this
.
acceptIncoming
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.selection
'
,
this
.
acceptSelection
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.both
'
,
this
.
acceptBoth
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.all-current
'
,
this
.
acceptAllCurrent
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.all-incoming
'
,
this
.
acceptAllIncoming
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.accept.all-both
'
,
this
.
acceptAllBoth
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.next
'
,
this
.
navigateNext
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.previous
'
,
this
.
navigatePrevious
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
git.merge
.compare
'
,
this
.
compare
,
this
)
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.current
'
,
this
.
acceptCurrent
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.incoming
'
,
this
.
acceptIncoming
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.selection
'
,
this
.
acceptSelection
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.both
'
,
this
.
acceptBoth
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.all-current
'
,
this
.
acceptAllCurrent
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.all-incoming
'
,
this
.
acceptAllIncoming
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.accept.all-both
'
,
this
.
acceptAllBoth
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.next
'
,
this
.
navigateNext
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.previous
'
,
this
.
navigatePrevious
,
this
),
vscode
.
commands
.
registerTextEditorCommand
(
'
merge-conflict
.compare
'
,
this
.
compare
,
this
)
);
}
...
...
@@ -80,7 +81,7 @@ export default class CommandHandler implements vscode.Disposable {
// Still failed to find conflict, warn the user and exit
if
(
!
conflict
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
cursorNotInConflict
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
cursorNotInConflict
'
,
messages
.
cursorNotInConflict
)
);
return
;
}
}
...
...
@@ -114,7 +115,7 @@ export default class CommandHandler implements vscode.Disposable {
let
conflict
=
await
this
.
findConflictContainingSelection
(
editor
);
if
(
!
conflict
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
cursorNotInConflict
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
cursorNotInConflict
'
,
messages
.
cursorNotInConflict
)
);
return
;
}
...
...
@@ -132,7 +133,7 @@ export default class CommandHandler implements vscode.Disposable {
typeToAccept
=
interfaces
.
CommitType
.
Incoming
;
}
else
{
vscode
.
window
.
showWarningMessage
(
messages
.
cursorOnSplitterRange
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
cursorOnSplitterRange
'
,
messages
.
cursorOnSplitterRange
)
);
return
;
}
...
...
@@ -149,11 +150,11 @@ export default class CommandHandler implements vscode.Disposable {
let
navigationResult
=
await
this
.
findConflictForNavigation
(
editor
,
direction
);
if
(
!
navigationResult
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
noConflicts
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
noConflicts
'
,
messages
.
noConflicts
)
);
return
;
}
else
if
(
!
navigationResult
.
canNavigate
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
noOtherConflictsInThisFile
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
noOtherConflictsInThisFile
'
,
messages
.
noOtherConflictsInThisFile
)
);
return
;
}
else
if
(
!
navigationResult
.
conflict
)
{
...
...
@@ -180,7 +181,7 @@ export default class CommandHandler implements vscode.Disposable {
}
if
(
!
conflict
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
cursorNotInConflict
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
cursorNotInConflict
'
,
messages
.
cursorNotInConflict
)
);
return
;
}
...
...
@@ -193,7 +194,7 @@ export default class CommandHandler implements vscode.Disposable {
let
conflicts
=
await
this
.
tracker
.
getConflicts
(
editor
.
document
);
if
(
!
conflicts
||
conflicts
.
length
===
0
)
{
vscode
.
window
.
showWarningMessage
(
messages
.
noConflicts
);
vscode
.
window
.
showWarningMessage
(
localize
(
'
noConflicts
'
,
messages
.
noConflicts
)
);
return
;
}
...
...
extensions/merge-conflict/src/mergeDecorator.ts
浏览文件 @
fd94a29f
...
...
@@ -4,6 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
vscode
from
'
vscode
'
;
import
*
as
interfaces
from
'
./interfaces
'
;
import
{
loadMessageBundle
}
from
'
vscode-nls
'
;
const
localize
=
loadMessageBundle
();
export
default
class
MergeDectorator
implements
vscode
.
Disposable
{
...
...
@@ -82,7 +84,7 @@ export default class MergeDectorator implements vscode.Disposable {
backgroundColor
:
`rgba(
${
this
.
currentColorRgb
}
, 1.0)`
,
color
:
'
white
'
,
after
:
{
contentText
:
'
(Current change)
'
,
contentText
:
'
'
+
localize
(
'
currentChange
'
,
'
(Current change)
'
)
,
color
:
'
rgba(0, 0, 0, 0.7)
'
}
});
...
...
@@ -98,7 +100,7 @@ export default class MergeDectorator implements vscode.Disposable {
color
:
'
white
'
,
isWholeLine
:
this
.
decorationUsesWholeLine
,
after
:
{
contentText
:
'
(Incoming change)
'
,
contentText
:
'
'
+
localize
(
'
incomingChange
'
,
'
(Incoming change)
'
)
,
color
:
'
rgba(0, 0, 0, 0.7)
'
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录