Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
070d4f38
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,发现更多精彩内容 >>
提交
070d4f38
编写于
4月 23, 2018
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
filter comments by file
上级
faa4bd1f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
36 deletion
+40
-36
extensions/git-extended/src/prView/prProvider.ts
extensions/git-extended/src/prView/prProvider.ts
+0
-1
extensions/git-extended/src/review/reviewMode.ts
extensions/git-extended/src/review/reviewMode.ts
+38
-33
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
...s/comments/electron-browser/commentsEditorContribution.ts
+2
-2
未找到文件。
extensions/git-extended/src/prView/prProvider.ts
浏览文件 @
070d4f38
...
...
@@ -162,7 +162,6 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
};
const
_onDidChangeCommentThreads
=
new
vscode
.
EventEmitter
<
vscode
.
CommentThreadChangedEvent
>
();
setTimeout
(()
=>
_onDidChangeCommentThreads
.
fire
({
changed
:
[],
added
:
[],
removed
:
[]
}),
5000
);
vscode
.
workspace
.
registerDocumentCommentProvider
({
onDidChangeCommentThreads
:
_onDidChangeCommentThreads
.
event
,
provideDocumentComments
:
async
(
document
:
vscode
.
TextDocument
,
token
:
vscode
.
CancellationToken
)
=>
{
...
...
extensions/git-extended/src/review/reviewMode.ts
浏览文件 @
070d4f38
...
...
@@ -281,36 +281,41 @@ export class ReviewMode implements vscode.DecorationProvider {
return
[];
}
let
sections
=
_
.
groupBy
(
comments
,
comment
=>
comment
.
position
);
let
fileCommentGroups
=
_
.
groupBy
(
comments
,
comment
=>
comment
.
path
);
let
ret
:
vscode
.
CommentThread
[]
=
[];
for
(
let
i
in
sections
)
{
let
comments
=
sections
[
i
];
const
comment
=
comments
[
0
];
// If the position is null, the comment is on a line that has been changed. Fall back to using original position.
const
commentPosition
=
comment
.
position
===
null
?
comment
.
original_position
:
comment
.
position
-
1
;
const
commentAbsolutePosition
=
comment
.
diff_hunk_range
.
start
+
commentPosition
;
const
pos
=
new
vscode
.
Position
(
comment
.
currentPosition
?
comment
.
currentPosition
-
1
-
1
:
commentAbsolutePosition
-
/* after line */
1
-
/* it's zero based*/
1
,
0
);
const
range
=
new
vscode
.
Range
(
pos
,
pos
);
ret
.
push
({
threadId
:
comment
.
id
,
resource
:
vscode
.
Uri
.
file
(
path
.
resolve
(
this
.
_repository
.
path
,
comment
.
path
)),
range
,
comments
:
comments
.
map
(
comment
=>
{
return
{
commentId
:
comment
.
id
,
body
:
new
vscode
.
MarkdownString
(
comment
.
body
),
userName
:
comment
.
user
.
login
,
gravatar
:
comment
.
user
.
avatar_url
};
}),
collapsibleState
:
collapsibleState
,
reply
:
this
.
_reply
});
}
for
(
let
file
in
fileCommentGroups
)
{
let
fileComments
=
fileCommentGroups
[
file
];
let
sections
=
_
.
groupBy
(
fileComments
,
comment
=>
comment
.
position
);
for
(
let
i
in
sections
)
{
let
comments
=
sections
[
i
];
const
comment
=
comments
[
0
];
// If the position is null, the comment is on a line that has been changed. Fall back to using original position.
const
commentPosition
=
comment
.
position
===
null
?
comment
.
original_position
:
comment
.
position
-
1
;
const
commentAbsolutePosition
=
comment
.
diff_hunk_range
.
start
+
commentPosition
;
const
pos
=
new
vscode
.
Position
(
comment
.
currentPosition
?
comment
.
currentPosition
-
1
-
1
:
commentAbsolutePosition
-
/* after line */
1
-
/* it's zero based*/
1
,
0
);
const
range
=
new
vscode
.
Range
(
pos
,
pos
);
ret
.
push
({
threadId
:
comment
.
id
,
resource
:
vscode
.
Uri
.
file
(
path
.
resolve
(
this
.
_repository
.
path
,
comment
.
path
)),
range
,
comments
:
comments
.
map
(
comment
=>
{
return
{
commentId
:
comment
.
id
,
body
:
new
vscode
.
MarkdownString
(
comment
.
body
),
userName
:
comment
.
user
.
login
,
gravatar
:
comment
.
user
.
avatar_url
};
}),
collapsibleState
:
collapsibleState
,
reply
:
this
.
_reply
});
}
}
return
ret
;
}
...
...
@@ -391,12 +396,12 @@ export class ReviewMode implements vscode.DecorationProvider {
async
switch
(
pr
:
PullRequest
)
{
try
{
if
(
pr
.
prItem
.
maintainer_can_modify
)
{
await
this
.
_repository
.
checkoutPR
(
pr
);
}
else
{
await
this
.
_repository
.
fetch
(
pr
.
remote
.
remoteName
,
`pull/
${
pr
.
prItem
.
number
}
/head:pull-request-
${
pr
.
prItem
.
number
}
`
);
await
this
.
_repository
.
checkout
(
`pull-request-
${
pr
.
prItem
.
number
}
`
);
}
//
if (pr.prItem.maintainer_can_modify) {
//
await this._repository.checkoutPR(pr);
//
} else {
await
this
.
_repository
.
fetch
(
pr
.
remote
.
remoteName
,
`pull/
${
pr
.
prItem
.
number
}
/head:pull-request-
${
pr
.
prItem
.
number
}
`
);
await
this
.
_repository
.
checkout
(
`pull-request-
${
pr
.
prItem
.
number
}
`
);
//
}
}
catch
(
e
)
{
vscode
.
window
.
showErrorMessage
(
e
);
return
;
...
...
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
浏览文件 @
070d4f38
...
...
@@ -192,7 +192,7 @@ export class ReviewZoneWidget extends ZoneWidget {
this
.
_actionbarWidget
=
new
ActionBar
(
actionsContainer
.
getHTMLElement
(),
{});
this
.
_disposables
.
push
(
this
.
_actionbarWidget
);
this
.
_toggleAction
=
new
Action
(
'
review.expand
'
,
nls
.
localize
(
'
label.expand
'
,
"
Expand
"
),
this
.
_isCollapsed
?
EXPAND_ACTION_CLASS
:
COLLAPSE_ACTION_CLASS
,
true
,
()
=>
{
/*
this._toggleAction = new Action('review.expand', nls.localize('label.expand', "Expand"), this._isCollapsed ? EXPAND_ACTION_CLASS : COLLAPSE_ACTION_CLASS, true, () => {
if (this._isCollapsed) {
}
else {
...
...
@@ -201,7 +201,7 @@ export class ReviewZoneWidget extends ZoneWidget {
return null;
});
this
.
_actionbarWidget
.
push
(
this
.
_toggleAction
,
{
label
:
false
,
icon
:
true
});
this._actionbarWidget.push(this._toggleAction, { label: false, icon: true });
*/
}
toggleExpand
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录