Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
479368e2
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
479368e2
编写于
5月 14, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not show new comment button on files with no possible commenting ranges
上级
8c5c75f2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
8 deletion
+26
-8
src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts
...ch/parts/comments/electron-browser/commentThreadWidget.ts
+6
-6
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
...s/comments/electron-browser/commentsEditorContribution.ts
+15
-2
src/vs/workbench/parts/comments/electron-browser/media/review.css
...orkbench/parts/comments/electron-browser/media/review.css
+5
-0
未找到文件。
src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts
浏览文件 @
479368e2
...
...
@@ -77,17 +77,17 @@ export class ReviewZoneWidget extends ZoneWidget {
private
_toggleAction
:
Action
;
private
_commentThread
:
modes
.
CommentThread
;
private
_commentGlyph
:
CommentGlyphWidget
;
public
get
commentThread
():
modes
.
CommentThread
{
return
this
.
_commentThread
;
}
private
_replyCommand
:
modes
.
Command
;
private
_owner
:
number
;
private
_decorationIDs
:
string
[];
private
_localToDispose
:
IDisposable
[];
public
get
owner
():
number
{
return
this
.
_owner
;
}
private
_decorationIDs
:
string
[]
;
private
_localToDispose
:
IDisposable
[];
public
get
commentThread
():
modes
.
CommentThread
{
return
this
.
_commentThread
;
}
constructor
(
editor
:
ICodeEditor
,
...
...
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
浏览文件 @
479368e2
...
...
@@ -71,6 +71,7 @@ export class ReviewController implements IEditorContribution {
private
_commentInfos
:
modes
.
CommentInfo
[];
private
_reviewModel
:
ReviewModel
;
private
_newCommentGlyph
:
CommentGlyphWidget
;
private
_hasSetComments
:
boolean
;
constructor
(
editor
:
ICodeEditor
,
...
...
@@ -90,6 +91,7 @@ export class ReviewController implements IEditorContribution {
this
.
_commentWidgets
=
[];
this
.
_newCommentWidget
=
null
;
this
.
_newCommentGlyph
=
null
;
this
.
_hasSetComments
=
false
;
this
.
_reviewPanelVisible
=
ctxReviewPanelVisible
.
bindTo
(
contextKeyService
);
this
.
_reviewModel
=
new
ReviewModel
();
...
...
@@ -161,6 +163,11 @@ export class ReviewController implements IEditorContribution {
this
.
_newCommentWidget
=
null
;
}
if
(
this
.
_newCommentGlyph
)
{
this
.
editor
.
removeContentWidget
(
this
.
_newCommentGlyph
);
this
.
_newCommentGlyph
=
null
;
}
this
.
_commentWidgets
.
forEach
(
zone
=>
{
zone
.
dispose
();
});
...
...
@@ -231,7 +238,12 @@ export class ReviewController implements IEditorContribution {
}
private
onEditorMouseMove
(
e
:
IEditorMouseEvent
):
void
{
if
(
e
.
target
.
position
&&
e
.
target
.
position
.
lineNumber
!==
undefined
)
{
if
(
!
this
.
_hasSetComments
)
{
return
;
}
const
hasCommentingRanges
=
this
.
_commentInfos
.
length
&&
this
.
_commentInfos
.
some
(
info
=>
!!
info
.
commentingRanges
.
length
);
if
(
hasCommentingRanges
&&
e
.
target
.
position
&&
e
.
target
.
position
.
lineNumber
!==
undefined
)
{
if
(
this
.
_newCommentGlyph
&&
e
.
target
.
element
.
className
!==
'
comment-hint
'
)
{
this
.
editor
.
removeContentWidget
(
this
.
_newCommentGlyph
);
}
...
...
@@ -251,7 +263,7 @@ export class ReviewController implements IEditorContribution {
}
}
getNewCommentAction
(
line
:
number
):
{
replyCommand
:
modes
.
Command
,
ownerId
:
number
}
{
private
getNewCommentAction
(
line
:
number
):
{
replyCommand
:
modes
.
Command
,
ownerId
:
number
}
{
for
(
let
i
=
0
;
i
<
this
.
_commentInfos
.
length
;
i
++
)
{
const
commentInfo
=
this
.
_commentInfos
[
i
];
const
lineWithinRange
=
commentInfo
.
commentingRanges
.
some
(
range
=>
...
...
@@ -291,6 +303,7 @@ export class ReviewController implements IEditorContribution {
setComments
(
commentInfos
:
modes
.
CommentInfo
[]):
void
{
this
.
_commentInfos
=
commentInfos
;
this
.
_hasSetComments
=
true
;
this
.
editor
.
changeDecorations
(
accessor
=>
{
this
.
commentingRangeDecorationMap
.
forEach
((
val
,
index
)
=>
{
...
...
src/vs/workbench/parts/comments/electron-browser/media/review.css
浏览文件 @
479368e2
...
...
@@ -143,6 +143,11 @@
cursor
:
text
;
}
.monaco-editor
.review-widget
.body
.comment-form
.review-thread-reply-button
:focus
{
outline-style
:
solid
;
outline-width
:
1px
;
}
.monaco-editor
.review-widget
.body
.comment-form
textarea
{
display
:
none
;
width
:
100%
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录