Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f8fcaf44
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,发现更多精彩内容 >>
提交
f8fcaf44
编写于
8月 15, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git: open file, open changes
上级
fb60b01d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
18 deletion
+24
-18
extensions/git/package.json
extensions/git/package.json
+5
-5
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+19
-13
未找到文件。
extensions/git/package.json
浏览文件 @
f8fcaf44
...
...
@@ -665,27 +665,27 @@
{
"command"
:
"git.openFile"
,
"group"
:
"navigation"
,
"when"
:
"config.git.enabled &&
scmProvider == git &&
isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
"when"
:
"config.git.enabled && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
},
{
"command"
:
"git.openChange"
,
"group"
:
"navigation"
,
"when"
:
"config.git.enabled &&
scmProvider == git &&
!isInDiffEditor && resourceScheme != extension"
"when"
:
"config.git.enabled && !isInDiffEditor && resourceScheme != extension"
},
{
"command"
:
"git.stageSelectedRanges"
,
"group"
:
"2_git@1"
,
"when"
:
"config.git.enabled &&
scmProvider == git &&
isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
"when"
:
"config.git.enabled && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
},
{
"command"
:
"git.unstageSelectedRanges"
,
"group"
:
"2_git@2"
,
"when"
:
"config.git.enabled &&
scmProvider == git &&
isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
"when"
:
"config.git.enabled && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
},
{
"command"
:
"git.revertSelectedRanges"
,
"group"
:
"2_git@3"
,
"when"
:
"config.git.enabled &&
scmProvider == git &&
isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
"when"
:
"config.git.enabled && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
}
]
},
...
...
extensions/git/src/commands.ts
浏览文件 @
f8fcaf44
...
...
@@ -150,14 +150,14 @@ export class CommandCenter {
await
repository
.
status
();
}
@
command
(
'
git.openResource
'
,
{
repository
:
true
}
)
async
openResource
(
re
pository
:
Repository
,
re
source
:
Resource
):
Promise
<
void
>
{
await
this
.
_openResource
(
re
pository
,
re
source
);
@
command
(
'
git.openResource
'
)
async
openResource
(
resource
:
Resource
):
Promise
<
void
>
{
await
this
.
_openResource
(
resource
);
}
private
async
_openResource
(
re
pository
:
Repository
,
re
source
:
Resource
,
preview
?:
boolean
):
Promise
<
void
>
{
private
async
_openResource
(
resource
:
Resource
,
preview
?:
boolean
):
Promise
<
void
>
{
const
left
=
this
.
getLeftResource
(
resource
);
const
right
=
this
.
getRightResource
(
re
pository
,
re
source
);
const
right
=
this
.
getRightResource
(
resource
);
const
title
=
this
.
getTitle
(
resource
);
if
(
!
right
)
{
...
...
@@ -201,7 +201,7 @@ export class CommandCenter {
}
}
private
getRightResource
(
re
pository
:
Repository
,
re
source
:
Resource
):
Uri
|
undefined
{
private
getRightResource
(
resource
:
Resource
):
Uri
|
undefined
{
switch
(
resource
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
case
Status
.
INDEX_ADDED
:
...
...
@@ -217,6 +217,12 @@ export class CommandCenter {
case
Status
.
MODIFIED
:
case
Status
.
UNTRACKED
:
case
Status
.
IGNORED
:
const
repository
=
this
.
model
.
getRepository
(
resource
.
resourceUri
);
if
(
!
repository
)
{
return
;
}
const
uriString
=
resource
.
resourceUri
.
toString
();
const
[
indexStatus
]
=
repository
.
indexGroup
.
resourceStates
.
filter
(
r
=>
r
.
resourceUri
.
toString
()
===
uriString
);
...
...
@@ -306,8 +312,8 @@ export class CommandCenter {
// await model.init();
}
@
command
(
'
git.openFile
'
,
{
repository
:
true
}
)
async
openFile
(
repository
:
Repository
,
arg
?:
Resource
|
Uri
,
...
resourceStates
:
SourceControlResourceState
[]):
Promise
<
void
>
{
@
command
(
'
git.openFile
'
)
async
openFile
(
arg
?:
Resource
|
Uri
,
...
resourceStates
:
SourceControlResourceState
[]):
Promise
<
void
>
{
let
uris
:
Uri
[]
|
undefined
;
if
(
arg
instanceof
Uri
)
{
...
...
@@ -356,8 +362,8 @@ export class CommandCenter {
}
}
@
command
(
'
git.openHEADFile
'
,
{
repository
:
true
}
)
async
openHEADFile
(
repository
:
Repository
,
arg
?:
Resource
|
Uri
):
Promise
<
void
>
{
@
command
(
'
git.openHEADFile
'
)
async
openHEADFile
(
arg
?:
Resource
|
Uri
):
Promise
<
void
>
{
let
resource
:
Resource
|
undefined
=
undefined
;
if
(
arg
instanceof
Resource
)
{
...
...
@@ -382,8 +388,8 @@ export class CommandCenter {
return
await
commands
.
executeCommand
<
void
>
(
'
vscode.open
'
,
HEAD
);
}
@
command
(
'
git.openChange
'
,
{
repository
:
true
}
)
async
openChange
(
repository
:
Repository
,
arg
?:
Resource
|
Uri
,
...
resourceStates
:
SourceControlResourceState
[]):
Promise
<
void
>
{
@
command
(
'
git.openChange
'
)
async
openChange
(
arg
?:
Resource
|
Uri
,
...
resourceStates
:
SourceControlResourceState
[]):
Promise
<
void
>
{
let
resources
:
Resource
[]
|
undefined
=
undefined
;
if
(
arg
instanceof
Uri
)
{
...
...
@@ -411,7 +417,7 @@ export class CommandCenter {
const
preview
=
resources
.
length
===
1
?
undefined
:
false
;
for
(
const
resource
of
resources
)
{
await
this
.
_openResource
(
re
pository
,
re
source
,
preview
);
await
this
.
_openResource
(
resource
,
preview
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录