Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e42c30a2
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,发现更多精彩内容 >>
提交
e42c30a2
编写于
3月 04, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CommentController.
上级
61c634d8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
72 deletion
+80
-72
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+10
-2
src/vs/workbench/api/electron-browser/mainThreadComments.ts
src/vs/workbench/api/electron-browser/mainThreadComments.ts
+26
-26
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
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
+35
-35
src/vs/workbench/contrib/comments/electron-browser/commentService.ts
...bench/contrib/comments/electron-browser/commentService.ts
+4
-4
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
e42c30a2
...
...
@@ -980,7 +980,7 @@ declare module 'vscode' {
input
:
string
;
}
export
interface
CommentControl
{
export
interface
CommentControl
ler
{
readonly
id
:
string
;
readonly
label
:
string
;
/**
...
...
@@ -997,11 +997,19 @@ declare module 'vscode' {
}
namespace
comment
{
export
function
createCommentControl
(
id
:
string
,
label
:
string
):
CommentControl
;
export
function
createCommentControl
ler
(
id
:
string
,
label
:
string
):
CommentController
;
}
namespace
workspace
{
/**
* DEPRECATED
* Use vscode.comment.createCommentController instead.
*/
export
function
registerDocumentCommentProvider
(
provider
:
DocumentCommentProvider
):
Disposable
;
/**
* DEPRECATED
* Use vscode.comment.createCommentController instead and we don't differentiate document comments and workspace comments anymore.
*/
export
function
registerWorkspaceCommentProvider
(
provider
:
WorkspaceCommentProvider
):
Disposable
;
}
...
...
src/vs/workbench/api/electron-browser/mainThreadComments.ts
浏览文件 @
e42c30a2
...
...
@@ -132,7 +132,7 @@ export class MainThreadCommentThread implements modes.CommentThread2 {
constructor
(
public
commentThreadHandle
:
number
,
public
control
:
MainThreadCommentControl
,
public
control
ler
:
MainThreadCommentController
,
public
extensionId
:
string
,
public
threadId
:
string
,
public
resource
:
string
,
...
...
@@ -151,7 +151,7 @@ export class MainThreadCommentThread implements modes.CommentThread2 {
toJSON
():
any
{
return
{
$mid
:
7
,
commentControlHandle
:
this
.
control
.
handle
,
commentControlHandle
:
this
.
control
ler
.
handle
,
commentThreadHandle
:
this
.
commentThreadHandle
,
};
}
...
...
@@ -180,7 +180,7 @@ export class MainThreadCommentingRanges implements modes.CommentingRanges {
constructor
(
public
commentingRangesHandle
:
number
,
public
control
:
MainThreadCommentControl
,
public
control
ler
:
MainThreadCommentController
,
public
resource
:
URI
,
private
_ranges
:
IRange
[],
private
_newCommentThreadCommand
:
modes
.
Command
,
...
...
@@ -192,7 +192,7 @@ export class MainThreadCommentingRanges implements modes.CommentingRanges {
}
}
export
class
MainThreadCommentControl
{
export
class
MainThreadCommentControl
ler
{
get
handle
():
number
{
return
this
.
_handle
;
}
...
...
@@ -352,7 +352,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
private
_documentProviders
=
new
Map
<
number
,
IDisposable
>
();
private
_workspaceProviders
=
new
Map
<
number
,
IDisposable
>
();
private
_handlers
=
new
Map
<
number
,
string
>
();
private
_commentControl
s
=
new
Map
<
number
,
MainThreadCommentControl
>
();
private
_commentControl
lers
=
new
Map
<
number
,
MainThreadCommentController
>
();
private
_activeCommentThread
?:
MainThreadCommentThread
;
private
_activeComment
?:
modes
.
Comment
;
...
...
@@ -372,9 +372,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments
this
.
_activeCommentThreadDisposables
=
[];
this
.
_proxy
=
extHostContext
.
getProxy
(
ExtHostContext
.
ExtHostComments
);
this
.
_disposables
.
push
(
this
.
_commentService
.
onDidChangeActiveCommentThread
(
async
thread
=>
{
let
control
=
(
thread
as
MainThreadCommentThread
).
control
;
let
control
ler
=
(
thread
as
MainThreadCommentThread
).
controller
;
if
(
!
control
)
{
if
(
!
control
ler
)
{
return
;
}
...
...
@@ -383,26 +383,26 @@ export class MainThreadComments extends Disposable implements MainThreadComments
this
.
_activeCommentThreadDisposables
.
push
(
this
.
_activeCommentThread
.
onDidChangeInput
(
input
=>
{
// todo, dispose
this
.
_input
=
input
;
this
.
_proxy
.
$onActiveCommentWidgetChange
(
control
.
handle
,
this
.
_activeCommentThread
,
this
.
_activeComment
,
this
.
_input
?
this
.
_input
.
value
:
undefined
);
this
.
_proxy
.
$onActiveCommentWidgetChange
(
control
ler
.
handle
,
this
.
_activeCommentThread
,
this
.
_activeComment
,
this
.
_input
?
this
.
_input
.
value
:
undefined
);
}));
await
this
.
_proxy
.
$onActiveCommentWidgetChange
(
control
.
handle
,
this
.
_activeCommentThread
,
this
.
_activeComment
,
this
.
_input
?
this
.
_input
.
value
:
undefined
);
await
this
.
_proxy
.
$onActiveCommentWidgetChange
(
control
ler
.
handle
,
this
.
_activeCommentThread
,
this
.
_activeComment
,
this
.
_input
?
this
.
_input
.
value
:
undefined
);
}));
this
.
_disposables
.
push
(
this
.
_commentService
.
onDidChangeActiveCommentingRange
(
value
=>
{
let
control
=
(
value
.
commentingRangesInfo
as
MainThreadCommentingRanges
).
control
;
let
control
ler
=
(
value
.
commentingRangesInfo
as
MainThreadCommentingRanges
).
controller
;
if
(
!
control
)
{
if
(
!
control
ler
)
{
return
;
}
this
.
_proxy
.
$onActiveCommentingRangeChange
(
control
.
handle
,
value
.
range
);
this
.
_proxy
.
$onActiveCommentingRangeChange
(
control
ler
.
handle
,
value
.
range
);
}));
}
$registerCommentControl
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
{
const
provider
=
new
MainThreadCommentControl
(
this
.
_proxy
,
this
.
_commentService
,
handle
,
id
,
label
);
this
.
_commentService
.
registerCommentControl
(
String
(
handle
),
provider
);
this
.
_commentControls
.
set
(
handle
,
provider
);
$registerCommentControl
ler
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
{
const
provider
=
new
MainThreadCommentControl
ler
(
this
.
_proxy
,
this
.
_commentService
,
handle
,
id
,
label
);
this
.
_commentService
.
registerCommentControl
ler
(
String
(
handle
),
provider
);
this
.
_commentControl
ler
s
.
set
(
handle
,
provider
);
const
commentsPanelAlreadyConstructed
=
this
.
_panelService
.
getPanels
().
some
(
panel
=>
panel
.
id
===
COMMENTS_PANEL_ID
);
if
(
!
commentsPanelAlreadyConstructed
)
{
...
...
@@ -412,7 +412,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$createCommentThread
(
handle
:
number
,
commentThreadHandle
:
number
,
threadId
:
string
,
resource
:
UriComponents
,
range
:
IRange
,
comments
:
modes
.
Comment
[],
commands
:
modes
.
Command
[],
collapseState
:
modes
.
CommentThreadCollapsibleState
):
modes
.
CommentThread2
|
undefined
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
undefined
;
...
...
@@ -422,7 +422,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$deleteCommentThread
(
handle
:
number
,
commentThreadHandle
:
number
)
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -432,7 +432,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$createCommentingRanges
(
handle
:
number
,
commentingRangesHandle
:
number
,
resource
:
UriComponents
,
ranges
:
IRange
[],
command
:
modes
.
Command
)
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
undefined
;
...
...
@@ -442,7 +442,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$deleteCommentingRanges
(
handle
:
number
,
commentingRangesHandle
:
number
)
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
undefined
;
...
...
@@ -453,7 +453,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$updateCommentingRanges
(
handle
:
number
,
commentingRangesHandle
:
number
,
newRanges
:
IRange
[]):
void
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -462,7 +462,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
provider
.
updateCommentingRanges
(
commentingRangesHandle
,
newRanges
);
}
$updateCommentingRangesCommands
(
handle
:
number
,
commentingRangesHandle
:
number
,
command
:
modes
.
Command
):
void
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -472,7 +472,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$updateComments
(
handle
:
number
,
commentThreadHandle
:
number
,
comments
:
modes
.
Comment
[])
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -482,7 +482,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$setInputValue
(
handle
:
number
,
commentThreadHandle
:
number
,
input
:
string
)
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -493,7 +493,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$updateCommentThreadCommands
(
handle
:
number
,
commentThreadHandle
:
number
,
acceptInputCommands
:
modes
.
Command
[])
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
@@ -503,7 +503,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
}
$updateCommentThreadRange
(
handle
:
number
,
commentThreadHandle
:
number
,
range
:
any
):
void
{
let
provider
=
this
.
_commentControls
.
get
(
handle
);
let
provider
=
this
.
_commentControl
ler
s
.
get
(
handle
);
if
(
!
provider
)
{
return
;
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
e42c30a2
...
...
@@ -670,8 +670,8 @@ export function createApiFactory(
};
const
comment
:
typeof
vscode
.
comment
=
{
createCommentControl
(
id
:
string
,
label
:
string
)
{
return
extHostComment
.
createCommentControl
(
extension
,
id
,
label
);
createCommentControl
ler
(
id
:
string
,
label
:
string
)
{
return
extHostComment
.
createCommentControl
ler
(
extension
,
id
,
label
);
}
};
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
e42c30a2
...
...
@@ -119,7 +119,7 @@ export interface CommentProviderFeatures {
}
export
interface
MainThreadCommentsShape
extends
IDisposable
{
$registerCommentControl
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
;
$registerCommentControl
ler
(
handle
:
number
,
id
:
string
,
label
:
string
):
void
;
$createCommentThread
(
handle
:
number
,
commentThreadHandle
:
number
,
threadId
:
string
,
resource
:
UriComponents
,
range
:
IRange
,
comments
:
modes
.
Comment
[],
commands
:
modes
.
Command
[],
collapseState
:
modes
.
CommentThreadCollapsibleState
):
modes
.
CommentThread2
|
undefined
;
$deleteCommentThread
(
handle
:
number
,
commentThreadHandle
:
number
):
void
;
$updateComments
(
handle
:
number
,
commentThreadHandle
:
number
,
comments
:
modes
.
Comment
[]):
void
;
...
...
@@ -1105,8 +1105,8 @@ export interface ExtHostProgressShape {
export
interface
ExtHostCommentsShape
{
$provideDocumentComments
(
handle
:
number
,
document
:
UriComponents
):
Promise
<
modes
.
CommentInfo
>
;
$createNewCommentThread
(
handle
:
number
,
document
:
UriComponents
,
range
:
IRange
,
text
:
string
):
Promise
<
modes
.
CommentThread
>
;
$onActiveCommentWidgetChange
(
commentControl
h
andle
:
number
,
commentThread
:
modes
.
CommentThread2
,
comment
:
modes
.
Comment
|
undefined
,
input
:
string
):
Promise
<
number
|
undefined
>
;
$onActiveCommentingRangeChange
(
commentControl
h
andle
:
number
,
range
:
IRange
):
void
;
$onActiveCommentWidgetChange
(
commentControl
lerH
andle
:
number
,
commentThread
:
modes
.
CommentThread2
,
comment
:
modes
.
Comment
|
undefined
,
input
:
string
):
Promise
<
number
|
undefined
>
;
$onActiveCommentingRangeChange
(
commentControl
lerH
andle
:
number
,
range
:
IRange
):
void
;
$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
>
;
...
...
src/vs/workbench/api/node/extHostComments.ts
浏览文件 @
e42c30a2
...
...
@@ -30,9 +30,9 @@ export class ExtHostComments implements ExtHostCommentsShape {
private
_proxy
:
MainThreadCommentsShape
;
private
_commentControl
s
:
Map
<
ProviderHandle
,
ExtHostCommentControl
>
=
new
Map
<
ProviderHandle
,
ExtHostCommentControl
>
();
private
_commentControl
lers
:
Map
<
ProviderHandle
,
ExtHostCommentController
>
=
new
Map
<
ProviderHandle
,
ExtHostCommentController
>
();
private
_commentControl
sByExtension
:
Map
<
string
,
ExtHostCommentControl
[]
>
=
new
Map
<
string
,
ExtHostCommentControl
[]
>
();
private
_commentControl
lersByExtension
:
Map
<
string
,
ExtHostCommentController
[]
>
=
new
Map
<
string
,
ExtHostCommentController
[]
>
();
private
_documentProviders
=
new
Map
<
number
,
HandlerData
<
vscode
.
DocumentCommentProvider
>>
();
private
_workspaceProviders
=
new
Map
<
number
,
HandlerData
<
vscode
.
WorkspaceCommentProvider
>>
();
...
...
@@ -47,21 +47,21 @@ export class ExtHostComments implements ExtHostCommentsShape {
_commands
.
registerArgumentProcessor
({
processArgument
:
arg
=>
{
if
(
arg
&&
arg
.
$mid
===
6
)
{
const
commentControl
=
this
.
_commentControl
s
.
get
(
arg
.
handle
);
const
commentControl
ler
=
this
.
_commentController
s
.
get
(
arg
.
handle
);
if
(
!
commentControl
)
{
if
(
!
commentControl
ler
)
{
return
arg
;
}
return
commentControl
;
return
commentControl
ler
;
}
else
if
(
arg
&&
arg
.
$mid
===
7
)
{
const
commentControl
=
this
.
_commentControl
s
.
get
(
arg
.
commentControlHandle
);
const
commentControl
ler
=
this
.
_commentController
s
.
get
(
arg
.
commentControlHandle
);
if
(
!
commentControl
)
{
if
(
!
commentControl
ler
)
{
return
arg
;
}
const
commentThread
=
commentControl
.
getCommentThread
(
arg
.
commentThreadHandle
);
const
commentThread
=
commentControl
ler
.
getCommentThread
(
arg
.
commentThreadHandle
);
if
(
!
commentThread
)
{
return
arg
;
...
...
@@ -75,48 +75,48 @@ export class ExtHostComments implements ExtHostCommentsShape {
});
}
createCommentControl
(
extension
:
IExtensionDescription
,
id
:
string
,
label
:
string
):
vscode
.
CommentControl
{
createCommentControl
ler
(
extension
:
IExtensionDescription
,
id
:
string
,
label
:
string
):
vscode
.
CommentController
{
const
handle
=
ExtHostComments
.
handlePool
++
;
const
commentControl
=
new
ExtHostCommentControl
(
extension
,
handle
,
this
.
_commands
.
converter
,
this
.
_proxy
,
id
,
label
);
this
.
_commentControl
s
.
set
(
commentControl
.
handle
,
commentControl
);
const
commentControl
ler
=
new
ExtHostCommentController
(
extension
,
handle
,
this
.
_commands
.
converter
,
this
.
_proxy
,
id
,
label
);
this
.
_commentControl
lers
.
set
(
commentController
.
handle
,
commentController
);
const
commentControl
s
=
this
.
_commentControl
sByExtension
.
get
(
ExtensionIdentifier
.
toKey
(
extension
.
identifier
))
||
[];
commentControl
s
.
push
(
commentControl
);
this
.
_commentControl
sByExtension
.
set
(
ExtensionIdentifier
.
toKey
(
extension
.
identifier
),
commentControl
s
);
const
commentControl
lers
=
this
.
_commentController
sByExtension
.
get
(
ExtensionIdentifier
.
toKey
(
extension
.
identifier
))
||
[];
commentControl
lers
.
push
(
commentController
);
this
.
_commentControl
lersByExtension
.
set
(
ExtensionIdentifier
.
toKey
(
extension
.
identifier
),
commentController
s
);
return
commentControl
;
return
commentControl
ler
;
}
$onActiveCommentWidgetChange
(
commentControl
h
andle
:
number
,
commentThread
:
modes
.
CommentThread2
,
comment
:
modes
.
Comment
|
undefined
,
input
:
string
):
Promise
<
number
|
undefined
>
{
const
commentControl
=
this
.
_commentControls
.
get
(
commentControlh
andle
);
$onActiveCommentWidgetChange
(
commentControl
lerH
andle
:
number
,
commentThread
:
modes
.
CommentThread2
,
comment
:
modes
.
Comment
|
undefined
,
input
:
string
):
Promise
<
number
|
undefined
>
{
const
commentControl
ler
=
this
.
_commentControllers
.
get
(
commentControllerH
andle
);
if
(
!
commentControl
)
{
if
(
!
commentControl
ler
)
{
return
Promise
.
resolve
(
undefined
);
}
commentControl
.
$onActiveCommentWidgetChange
(
commentThread
,
comment
,
input
);
return
Promise
.
resolve
(
commentControl
h
andle
);
commentControl
ler
.
$onActiveCommentWidgetChange
(
commentThread
,
comment
,
input
);
return
Promise
.
resolve
(
commentControl
lerH
andle
);
}
$onCommentWidgetInputChange
(
commentControl
h
andle
:
number
,
value
:
string
):
Promise
<
void
>
{
const
commentControl
=
this
.
_commentControls
.
get
(
commentControlh
andle
);
$onCommentWidgetInputChange
(
commentControl
lerH
andle
:
number
,
value
:
string
):
Promise
<
void
>
{
const
commentControl
ler
=
this
.
_commentControllers
.
get
(
commentControllerH
andle
);
if
(
!
commentControl
||
!
commentControl
.
widget
)
{
if
(
!
commentControl
ler
||
!
commentController
.
widget
)
{
return
Promise
.
resolve
(
undefined
);
}
commentControl
.
widget
.
input
=
value
;
commentControl
ler
.
widget
.
input
=
value
;
return
Promise
.
resolve
(
undefined
);
}
$onActiveCommentingRangeChange
(
commentControl
h
andle
:
number
,
range
:
IRange
)
{
const
commentControl
=
this
.
_commentControls
.
get
(
commentControlh
andle
);
$onActiveCommentingRangeChange
(
commentControl
lerH
andle
:
number
,
range
:
IRange
)
{
const
commentControl
ler
=
this
.
_commentControllers
.
get
(
commentControllerH
andle
);
if
(
!
commentControl
)
{
if
(
!
commentControl
ler
)
{
return
;
}
commentControl
.
setActiveCommentingRange
(
extHostTypeConverter
.
Range
.
to
(
range
));
commentControl
ler
.
setActiveCommentingRange
(
extHostTypeConverter
.
Range
.
to
(
range
));
}
registerWorkspaceCommentProvider
(
...
...
@@ -412,7 +412,7 @@ export class ExtHostCommentingRanges implements vscode.CommentingRanges {
set
ranges
(
newRanges
:
vscode
.
Range
[])
{
this
.
_ranges
=
newRanges
;
this
.
_proxy
.
$updateCommentingRanges
(
this
.
_commentControlHandle
,
this
.
handle
,
this
.
_ranges
.
map
(
extHostTypeConverter
.
Range
.
from
));
this
.
_proxy
.
$updateCommentingRanges
(
this
.
_commentControl
ler
Handle
,
this
.
handle
,
this
.
_ranges
.
map
(
extHostTypeConverter
.
Range
.
from
));
}
get
newCommentThreadCommand
():
vscode
.
Command
{
...
...
@@ -423,19 +423,19 @@ export class ExtHostCommentingRanges implements vscode.CommentingRanges {
this
.
_command
=
command
;
const
internal
=
this
.
_commandsConverter
.
toInternal
(
command
);
this
.
_proxy
.
$updateCommentingRangesCommands
(
this
.
_commentControlHandle
,
this
.
handle
,
internal
);
this
.
_proxy
.
$updateCommentingRangesCommands
(
this
.
_commentControl
ler
Handle
,
this
.
handle
,
internal
);
}
constructor
(
private
_proxy
:
MainThreadCommentsShape
,
private
readonly
_commandsConverter
:
CommandsConverter
,
private
_commentControlHandle
:
number
,
private
_commentControl
ler
Handle
:
number
,
private
_resource
:
vscode
.
Uri
,
private
_ranges
:
vscode
.
Range
[],
private
_command
:
vscode
.
Command
,
)
{
this
.
_proxy
.
$createCommentingRanges
(
this
.
_commentControlHandle
,
this
.
_commentControl
ler
Handle
,
this
.
handle
,
this
.
_resource
,
this
.
_ranges
.
map
(
extHostTypeConverter
.
Range
.
from
),
...
...
@@ -444,11 +444,11 @@ export class ExtHostCommentingRanges implements vscode.CommentingRanges {
}
dispose
()
{
this
.
_proxy
.
$deleteCommentingRanges
(
this
.
_commentControlHandle
,
this
.
handle
);
this
.
_proxy
.
$deleteCommentingRanges
(
this
.
_commentControl
ler
Handle
,
this
.
handle
);
}
}
class
ExtHostCommentControl
implements
vscode
.
CommentControl
{
class
ExtHostCommentControl
ler
implements
vscode
.
CommentController
{
get
id
():
string
{
return
this
.
_id
;
}
...
...
@@ -475,7 +475,7 @@ class ExtHostCommentControl implements vscode.CommentControl {
private
_id
:
string
,
private
_label
:
string
)
{
this
.
_proxy
.
$registerCommentControl
(
this
.
handle
,
_id
,
_label
);
this
.
_proxy
.
$registerCommentControl
ler
(
this
.
handle
,
_id
,
_label
);
}
createCommentThread
(
id
:
string
,
resource
:
vscode
.
Uri
,
range
:
vscode
.
Range
,
comments
:
vscode
.
Comment
[],
acceptInputCommands
:
vscode
.
Command
[],
collapsibleState
?:
vscode
.
CommentThreadCollapsibleState
):
vscode
.
CommentThread
{
...
...
src/vs/workbench/contrib/comments/electron-browser/commentService.ts
浏览文件 @
e42c30a2
...
...
@@ -13,7 +13,7 @@ import { keys } from 'vs/base/common/map';
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
ICommentThreadChangedEvent
}
from
'
vs/workbench/contrib/comments/common/commentModel
'
;
import
{
MainThreadCommentControl
}
from
'
vs/workbench/api/electron-browser/mainThreadComments
'
;
import
{
MainThreadCommentControl
ler
}
from
'
vs/workbench/api/electron-browser/mainThreadComments
'
;
export
const
ICommentService
=
createDecorator
<
ICommentService
>
(
'
commentService
'
);
...
...
@@ -44,7 +44,7 @@ export interface ICommentService {
setDocumentComments
(
resource
:
URI
,
commentInfos
:
ICommentInfo
[]):
void
;
setWorkspaceComments
(
owner
:
string
,
commentsByResource
:
CommentThread
[]):
void
;
removeWorkspaceComments
(
owner
:
string
):
void
;
registerCommentControl
(
owner
:
string
,
commentControl
:
MainThreadCommentControl
):
void
;
registerCommentControl
ler
(
owner
:
string
,
commentControl
:
MainThreadCommentController
):
void
;
registerDataProvider
(
owner
:
string
,
commentProvider
:
DocumentCommentProvider
):
void
;
unregisterDataProvider
(
owner
:
string
):
void
;
updateComments
(
ownerId
:
string
,
event
:
CommentThreadChangedEvent
):
void
;
...
...
@@ -101,7 +101,7 @@ export class CommentService extends Disposable implements ICommentService {
private
_commentProviders
=
new
Map
<
string
,
DocumentCommentProvider
>
();
private
_commentControls
=
new
Map
<
string
,
MainThreadCommentControl
>
();
private
_commentControls
=
new
Map
<
string
,
MainThreadCommentControl
ler
>
();
constructor
()
{
super
();
...
...
@@ -132,7 +132,7 @@ export class CommentService extends Disposable implements ICommentService {
this
.
_onDidSetAllCommentThreads
.
fire
({
ownerId
:
owner
,
commentThreads
:
[]
});
}
registerCommentControl
(
owner
:
string
,
commentControl
:
MainThreadCommentControl
):
void
{
registerCommentControl
ler
(
owner
:
string
,
commentControl
:
MainThreadCommentController
):
void
{
this
.
_commentControls
.
set
(
owner
,
commentControl
);
this
.
_onDidSetDataProvider
.
fire
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录