Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d50c9d86
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,发现更多精彩内容 >>
提交
d50c9d86
编写于
2月 11, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check if users can operate on reactions
上级
b7bedc41
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
4 deletion
+14
-4
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-0
src/vs/workbench/api/node/extHostComments.ts
src/vs/workbench/api/node/extHostComments.ts
+10
-1
src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
...orkbench/contrib/comments/electron-browser/commentNode.ts
+1
-1
src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts
...b/comments/electron-browser/commentsEditorContribution.ts
+2
-2
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
d50c9d86
...
...
@@ -1235,6 +1235,7 @@ export interface NewCommentAction {
export
interface
CommentReaction
{
readonly
label
?:
string
;
readonly
hasReacted
?:
boolean
;
readonly
canEdit
?:
boolean
;
}
/**
...
...
src/vs/workbench/api/node/extHostComments.ts
浏览文件 @
d50c9d86
...
...
@@ -258,6 +258,9 @@ function convertToComment(provider: vscode.DocumentCommentProvider | vscode.Work
const
canEdit
=
!!
(
provider
as
vscode
.
DocumentCommentProvider
).
editComment
&&
vscodeComment
.
canEdit
;
const
canDelete
=
!!
(
provider
as
vscode
.
DocumentCommentProvider
).
deleteComment
&&
vscodeComment
.
canDelete
;
const
iconPath
=
vscodeComment
.
userIconPath
?
vscodeComment
.
userIconPath
.
toString
()
:
vscodeComment
.
gravatar
;
const
providerCanDeleteReaction
=
!!
(
provider
as
vscode
.
DocumentCommentProvider
).
deleteReaction
;
const
providerCanAddReaction
=
!!
(
provider
as
vscode
.
DocumentCommentProvider
).
addReaction
;
return
{
commentId
:
vscodeComment
.
commentId
,
body
:
extHostTypeConverter
.
MarkdownString
.
from
(
vscodeComment
.
body
),
...
...
@@ -267,6 +270,12 @@ function convertToComment(provider: vscode.DocumentCommentProvider | vscode.Work
canDelete
:
canDelete
,
command
:
vscodeComment
.
command
?
commandsConverter
.
toInternal
(
vscodeComment
.
command
)
:
null
,
isDraft
:
vscodeComment
.
isDraft
,
commentReactions
:
vscodeComment
.
commentReactions
commentReactions
:
vscodeComment
.
commentReactions
.
map
(
reaction
=>
{
return
{
label
:
reaction
.
label
,
hasReacted
:
reaction
.
hasReacted
,
canEdit
:
(
reaction
.
hasReacted
&&
providerCanDeleteReaction
)
||
(
!
reaction
.
hasReacted
&&
providerCanAddReaction
)
};
})
};
}
src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
浏览文件 @
d50c9d86
...
...
@@ -180,7 +180,7 @@ export class CommentNode extends Disposable {
this
.
_toDispose
.
push
(
this
.
_reactionsActionBar
);
let
reactionActions
=
this
.
comment
.
commentReactions
!
.
map
(
reaction
=>
{
return
new
Action
(
`reaction.
${
reaction
.
label
}
`
,
`
${
reaction
.
label
}
`
,
reaction
.
hasReacted
?
'
active
'
:
''
,
true
,
async
()
=>
{
return
new
Action
(
`reaction.
${
reaction
.
label
}
`
,
`
${
reaction
.
label
}
`
,
reaction
.
hasReacted
&&
reaction
.
canEdit
?
'
active
'
:
''
,
reaction
.
canEdit
,
async
()
=>
{
try
{
if
(
reaction
.
hasReacted
)
{
await
this
.
commentService
.
deleteReaction
(
this
.
owner
,
this
.
resource
,
this
.
comment
,
reaction
);
...
...
src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts
浏览文件 @
d50c9d86
...
...
@@ -748,13 +748,13 @@ registerThemingParticipant((theme, collector) => {
const
statusBarItemHoverBackground
=
theme
.
getColor
(
STATUS_BAR_ITEM_HOVER_BACKGROUND
);
if
(
statusBarItemHoverBackground
)
{
collector
.
addRule
(
`.monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:hover { background-color:
${
statusBarItemHoverBackground
}
; border: 1px solid grey;
collector
.
addRule
(
`.monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label
.active
:hover { background-color:
${
statusBarItemHoverBackground
}
; border: 1px solid grey;
border-radius: 3px; }`
);
}
const
statusBarItemActiveBackground
=
theme
.
getColor
(
STATUS_BAR_ITEM_ACTIVE_BACKGROUND
);
if
(
statusBarItemActiveBackground
)
{
collector
.
addRule
(
`.monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active { background-color:
${
statusBarItemActiveBackground
}
; border: 1px solid grey;
collector
.
addRule
(
`.monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label
.active
:active { background-color:
${
statusBarItemActiveBackground
}
; border: 1px solid grey;
border-radius: 3px;}`
);
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录