Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c5c15eb7
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,发现更多精彩内容 >>
提交
c5c15eb7
编写于
12月 18, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add document parameter to draft methods on comments provider
上级
26084201
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
51 addition
and
33 deletion
+51
-33
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+3
-3
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+3
-3
src/vs/workbench/api/electron-browser/mainThreadComments.ts
src/vs/workbench/api/electron-browser/mainThreadComments.ts
+6
-6
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-3
src/vs/workbench/api/node/extHostComments.ts
src/vs/workbench/api/node/extHostComments.ts
+24
-6
src/vs/workbench/parts/comments/electron-browser/commentService.ts
...rkbench/parts/comments/electron-browser/commentService.ts
+9
-9
src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts
...ch/parts/comments/electron-browser/commentThreadWidget.ts
+3
-3
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
c5c15eb7
...
...
@@ -1245,9 +1245,9 @@ export interface DocumentCommentProvider {
replyToCommentThread
(
resource
:
URI
,
range
:
Range
,
thread
:
CommentThread
,
text
:
string
,
token
:
CancellationToken
):
Promise
<
CommentThread
>
;
editComment
(
resource
:
URI
,
comment
:
Comment
,
text
:
string
,
token
:
CancellationToken
):
Promise
<
void
>
;
deleteComment
(
resource
:
URI
,
comment
:
Comment
,
token
:
CancellationToken
):
Promise
<
void
>
;
startDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
deleteDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
finishDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
startDraft
?(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
void
>
;
deleteDraft
?(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
void
>
;
finishDraft
?(
resource
:
URI
,
token
:
CancellationToken
):
Promise
<
void
>
;
startDraftLabel
?:
string
;
deleteDraftLabel
?:
string
;
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
c5c15eb7
...
...
@@ -868,9 +868,9 @@ declare module 'vscode' {
*/
deleteComment
?(
document
:
TextDocument
,
comment
:
Comment
,
token
:
CancellationToken
):
Promise
<
void
>
;
startDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
deleteDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
finishDraft
?(
token
:
CancellationToken
):
Promise
<
void
>
;
startDraft
?(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
void
>
;
deleteDraft
?(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
void
>
;
finishDraft
?(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
void
>
;
startDraftLabel
?:
string
;
deleteDraftLabel
?:
string
;
...
...
src/vs/workbench/api/electron-browser/mainThreadComments.ts
浏览文件 @
c5c15eb7
...
...
@@ -54,14 +54,14 @@ export class MainThreadDocumentCommentProvider implements modes.DocumentCommentP
return
this
.
_proxy
.
$deleteComment
(
this
.
_handle
,
uri
,
comment
);
}
async
startDraft
(
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$startDraft
(
this
.
_handle
);
async
startDraft
(
uri
,
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$startDraft
(
this
.
_handle
,
uri
);
}
async
deleteDraft
(
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$deleteDraft
(
this
.
_handle
);
async
deleteDraft
(
uri
,
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$deleteDraft
(
this
.
_handle
,
uri
);
}
async
finishDraft
(
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$finishDraft
(
this
.
_handle
);
async
finishDraft
(
uri
,
token
):
Promise
<
void
>
{
return
this
.
_proxy
.
$finishDraft
(
this
.
_handle
,
uri
);
}
onDidChangeCommentThreads
=
null
;
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
c5c15eb7
...
...
@@ -1044,9 +1044,9 @@ export interface ExtHostCommentsShape {
$replyToCommentThread
(
handle
:
number
,
document
:
UriComponents
,
range
:
IRange
,
commentThread
:
modes
.
CommentThread
,
text
:
string
):
Promise
<
modes
.
CommentThread
>
;
$editComment
(
handle
:
number
,
document
:
UriComponents
,
comment
:
modes
.
Comment
,
text
:
string
):
Promise
<
void
>
;
$deleteComment
(
handle
:
number
,
document
:
UriComponents
,
comment
:
modes
.
Comment
):
Promise
<
void
>
;
$startDraft
(
handle
:
number
):
Promise
<
void
>
;
$deleteDraft
(
handle
:
number
):
Promise
<
void
>
;
$finishDraft
(
handle
:
number
):
Promise
<
void
>
;
$startDraft
(
handle
:
number
,
document
:
UriComponents
):
Promise
<
void
>
;
$deleteDraft
(
handle
:
number
,
document
:
UriComponents
):
Promise
<
void
>
;
$finishDraft
(
handle
:
number
,
document
:
UriComponents
):
Promise
<
void
>
;
$provideWorkspaceComments
(
handle
:
number
):
Promise
<
modes
.
CommentThread
[]
>
;
}
...
...
src/vs/workbench/api/node/extHostComments.ts
浏览文件 @
c5c15eb7
...
...
@@ -121,24 +121,42 @@ export class ExtHostComments implements ExtHostCommentsShape {
});
}
$startDraft
(
handle
:
number
):
Promise
<
void
>
{
$startDraft
(
handle
:
number
,
uri
:
UriComponents
):
Promise
<
void
>
{
const
data
=
this
.
_documents
.
getDocumentData
(
URI
.
revive
(
uri
));
if
(
!
data
||
!
data
.
document
)
{
throw
new
Error
(
'
Unable to retrieve document from URI
'
);
}
const
provider
=
this
.
_documentProviders
.
get
(
handle
);
return
asPromise
(()
=>
{
return
provider
.
startDraft
(
CancellationToken
.
None
);
return
provider
.
startDraft
(
data
.
document
,
CancellationToken
.
None
);
});
}
$deleteDraft
(
handle
:
number
):
Promise
<
void
>
{
$deleteDraft
(
handle
:
number
,
uri
:
UriComponents
):
Promise
<
void
>
{
const
data
=
this
.
_documents
.
getDocumentData
(
URI
.
revive
(
uri
));
if
(
!
data
||
!
data
.
document
)
{
throw
new
Error
(
'
Unable to retrieve document from URI
'
);
}
const
provider
=
this
.
_documentProviders
.
get
(
handle
);
return
asPromise
(()
=>
{
return
provider
.
deleteDraft
(
CancellationToken
.
None
);
return
provider
.
deleteDraft
(
data
.
document
,
CancellationToken
.
None
);
});
}
$finishDraft
(
handle
:
number
):
Promise
<
void
>
{
$finishDraft
(
handle
:
number
,
uri
:
UriComponents
):
Promise
<
void
>
{
const
data
=
this
.
_documents
.
getDocumentData
(
URI
.
revive
(
uri
));
if
(
!
data
||
!
data
.
document
)
{
throw
new
Error
(
'
Unable to retrieve document from URI
'
);
}
const
provider
=
this
.
_documentProviders
.
get
(
handle
);
return
asPromise
(()
=>
{
return
provider
.
finishDraft
(
CancellationToken
.
None
);
return
provider
.
finishDraft
(
data
.
document
,
CancellationToken
.
None
);
});
}
...
...
src/vs/workbench/parts/comments/electron-browser/commentService.ts
浏览文件 @
c5c15eb7
...
...
@@ -49,9 +49,9 @@ export interface ICommentService {
editComment
(
owner
:
string
,
resource
:
URI
,
comment
:
Comment
,
text
:
string
):
Promise
<
void
>
;
deleteComment
(
owner
:
string
,
resource
:
URI
,
comment
:
Comment
):
Promise
<
boolean
>
;
getComments
(
resource
:
URI
):
Promise
<
ICommentInfo
[]
>
;
startDraft
(
owner
:
string
):
void
;
deleteDraft
(
owner
:
string
):
void
;
finishDraft
(
owner
:
string
):
void
;
startDraft
(
owner
:
string
,
resource
:
URI
):
void
;
deleteDraft
(
owner
:
string
,
resource
:
URI
):
void
;
finishDraft
(
owner
:
string
,
resource
:
URI
):
void
;
getStartDraftLabel
(
owner
:
string
):
string
;
getDeleteDraftLabel
(
owner
:
string
):
string
;
getFinishDraftLabel
(
owner
:
string
):
string
;
...
...
@@ -148,31 +148,31 @@ export class CommentService extends Disposable implements ICommentService {
return
Promise
.
resolve
(
false
);
}
async
startDraft
(
owner
:
string
):
Promise
<
void
>
{
async
startDraft
(
owner
:
string
,
resource
:
URI
):
Promise
<
void
>
{
const
commentProvider
=
this
.
_commentProviders
.
get
(
owner
);
if
(
commentProvider
&&
commentProvider
.
startDraft
)
{
return
commentProvider
.
startDraft
(
CancellationToken
.
None
);
return
commentProvider
.
startDraft
(
resource
,
CancellationToken
.
None
);
}
else
{
throw
new
Error
(
'
Not supported
'
);
}
}
async
deleteDraft
(
owner
:
string
):
Promise
<
void
>
{
async
deleteDraft
(
owner
:
string
,
resource
:
URI
):
Promise
<
void
>
{
const
commentProvider
=
this
.
_commentProviders
.
get
(
owner
);
if
(
commentProvider
&&
commentProvider
.
deleteDraft
)
{
return
commentProvider
.
deleteDraft
(
CancellationToken
.
None
);
return
commentProvider
.
deleteDraft
(
resource
,
CancellationToken
.
None
);
}
else
{
throw
new
Error
(
'
Not supported
'
);
}
}
async
finishDraft
(
owner
:
string
):
Promise
<
void
>
{
async
finishDraft
(
owner
:
string
,
resource
:
URI
):
Promise
<
void
>
{
const
commentProvider
=
this
.
_commentProviders
.
get
(
owner
);
if
(
commentProvider
&&
commentProvider
.
finishDraft
)
{
return
commentProvider
.
finishDraft
(
CancellationToken
.
None
);
return
commentProvider
.
finishDraft
(
resource
,
CancellationToken
.
None
);
}
else
{
throw
new
Error
(
'
Not supported
'
);
}
...
...
src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts
浏览文件 @
c5c15eb7
...
...
@@ -412,7 +412,7 @@ export class ReviewZoneWidget extends ZoneWidget {
deletedraftButton
.
onDidClick
(
async
()
=>
{
try
{
await
this
.
commentService
.
deleteDraft
(
this
.
_owner
);
await
this
.
commentService
.
deleteDraft
(
this
.
_owner
,
this
.
editor
.
getModel
().
uri
);
}
catch
(
e
)
{
this
.
handleError
(
e
);
}
...
...
@@ -430,7 +430,7 @@ export class ReviewZoneWidget extends ZoneWidget {
try
{
let
lineNumber
=
this
.
_commentGlyph
.
getPosition
().
position
.
lineNumber
;
await
this
.
createComment
(
lineNumber
);
await
this
.
commentService
.
finishDraft
(
this
.
_owner
);
await
this
.
commentService
.
finishDraft
(
this
.
_owner
,
this
.
editor
.
getModel
().
uri
);
}
catch
(
e
)
{
this
.
handleError
(
e
);
}
...
...
@@ -456,7 +456,7 @@ export class ReviewZoneWidget extends ZoneWidget {
draftButton
.
onDidClick
(
async
()
=>
{
try
{
await
this
.
commentService
.
startDraft
(
this
.
_owner
);
await
this
.
commentService
.
startDraft
(
this
.
_owner
,
this
.
editor
.
getModel
().
uri
);
let
lineNumber
=
this
.
_commentGlyph
.
getPosition
().
position
.
lineNumber
;
await
this
.
createComment
(
lineNumber
);
}
catch
(
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录