Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
801d3eaa
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,发现更多精彩内容 >>
提交
801d3eaa
编写于
4月 17, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add onDidCommentThreadsChange
上级
99ce8b1b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
77 addition
and
2 deletion
+77
-2
extensions/git-extended/src/prView/prProvider.ts
extensions/git-extended/src/prView/prProvider.ts
+4
-0
extensions/git-extended/src/review/reviewMode.ts
extensions/git-extended/src/review/reviewMode.ts
+3
-1
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+19
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+16
-0
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+18
-0
src/vs/workbench/api/electron-browser/mainThreadComments.ts
src/vs/workbench/api/electron-browser/mainThreadComments.ts
+3
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-0
src/vs/workbench/api/node/extHostComments.ts
src/vs/workbench/api/node/extHostComments.ts
+13
-0
未找到文件。
extensions/git-extended/src/prView/prProvider.ts
浏览文件 @
801d3eaa
...
@@ -158,7 +158,11 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
...
@@ -158,7 +158,11 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
}
}
];
];
const
_onDidChangeCommentThreads
=
new
vscode
.
EventEmitter
<
vscode
.
CommentThreadChangedEvent
>
();
setTimeout
(()
=>
_onDidChangeCommentThreads
.
fire
({
changed
:
[],
added
:
[],
removed
:
[]
}),
5000
);
vscode
.
workspace
.
registerCommentProvider
({
vscode
.
workspace
.
registerCommentProvider
({
onDidChangeCommentThreads
:
_onDidChangeCommentThreads
.
event
,
provideNewCommentRange
:
async
(
document
:
vscode
.
TextDocument
,
token
:
vscode
.
CancellationToken
)
=>
{
provideNewCommentRange
:
async
(
document
:
vscode
.
TextDocument
,
token
:
vscode
.
CancellationToken
)
=>
{
if
(
document
.
uri
.
scheme
===
'
pr
'
)
{
if
(
document
.
uri
.
scheme
===
'
pr
'
)
{
let
params
=
JSON
.
parse
(
document
.
uri
.
query
);
let
params
=
JSON
.
parse
(
document
.
uri
.
query
);
...
...
extensions/git-extended/src/review/reviewMode.ts
浏览文件 @
801d3eaa
...
@@ -170,7 +170,9 @@ export class ReviewMode {
...
@@ -170,7 +170,9 @@ export class ReviewMode {
return
ret
;
return
ret
;
}
}
this
.
_commentProvider
=
vscode
.
workspace
.
registerCommentProvider
({
const
_onDidChangeCommentThreads
=
new
vscode
.
EventEmitter
<
vscode
.
CommentThreadChangedEvent
>
();
vscode
.
workspace
.
registerCommentProvider
({
onDidChangeCommentThreads
:
_onDidChangeCommentThreads
.
event
,
provideNewCommentRange
:
async
(
document
:
vscode
.
TextDocument
,
token
:
vscode
.
CancellationToken
)
=>
{
provideNewCommentRange
:
async
(
document
:
vscode
.
TextDocument
,
token
:
vscode
.
CancellationToken
)
=>
{
if
(
document
.
uri
.
scheme
===
'
review
'
||
document
.
uri
.
scheme
===
'
file
'
)
{
if
(
document
.
uri
.
scheme
===
'
review
'
||
document
.
uri
.
scheme
===
'
file
'
)
{
let
lastLine
=
document
.
lineCount
;
let
lastLine
=
document
.
lineCount
;
...
...
src/vs/editor/common/modes.ts
浏览文件 @
801d3eaa
...
@@ -957,10 +957,29 @@ export interface Comment {
...
@@ -957,10 +957,29 @@ export interface Comment {
readonly
gravatar
:
string
;
readonly
gravatar
:
string
;
}
}
export
interface
CommentThreadChangedEvent
{
/**
* Added comment threads.
*/
readonly
added
:
CommentThread
[];
/**
* Removed comment threads.
*/
readonly
removed
:
CommentThread
[];
/**
* Changed comment threads.
*/
readonly
changed
:
CommentThread
[];
}
export
interface
CommentProvider
{
export
interface
CommentProvider
{
provideComments
(
model
:
model
.
ITextModel
,
token
:
CancellationToken
):
CommentThread
[];
provideComments
(
model
:
model
.
ITextModel
,
token
:
CancellationToken
):
CommentThread
[];
provideNewCommentRange
(
model
:
model
.
ITextModel
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideNewCommentRange
(
model
:
model
.
ITextModel
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideAllComments
(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
provideAllComments
(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
onDidChangeCommentThreads
():
Event
<
CommentThreadChangedEvent
>
;
}
}
export
interface
ICodeLensSymbol
{
export
interface
ICodeLensSymbol
{
...
...
src/vs/monaco.d.ts
浏览文件 @
801d3eaa
...
@@ -5047,10 +5047,26 @@ declare namespace monaco.languages {
...
@@ -5047,10 +5047,26 @@ declare namespace monaco.languages {
readonly
gravatar
:
string
;
readonly
gravatar
:
string
;
}
}
export
interface
CommentThreadChangedEvent
{
/**
* Added comment threads.
*/
readonly
added
:
CommentThread
[];
/**
* Removed comment threads.
*/
readonly
removed
:
CommentThread
[];
/**
* Changed comment threads.
*/
readonly
changed
:
CommentThread
[];
}
export
interface
CommentProvider
{
export
interface
CommentProvider
{
provideComments
(
model
:
editor
.
ITextModel
,
token
:
CancellationToken
):
CommentThread
[];
provideComments
(
model
:
editor
.
ITextModel
,
token
:
CancellationToken
):
CommentThread
[];
provideNewCommentRange
(
model
:
editor
.
ITextModel
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideNewCommentRange
(
model
:
editor
.
ITextModel
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideAllComments
(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
provideAllComments
(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
onDidChangeCommentThreads
():
IEvent
<
CommentThreadChangedEvent
>
;
}
}
export
interface
ICodeLensSymbol
{
export
interface
ICodeLensSymbol
{
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
801d3eaa
...
@@ -789,6 +789,23 @@ declare module 'vscode' {
...
@@ -789,6 +789,23 @@ declare module 'vscode' {
gravatar
:
string
;
gravatar
:
string
;
}
}
export
interface
CommentThreadChangedEvent
{
/**
* Added comment threads.
*/
readonly
added
:
CommentThread
[];
/**
* Removed comment threads.
*/
readonly
removed
:
CommentThread
[];
/**
* Changed comment threads.
*/
readonly
changed
:
CommentThread
[];
}
/**
/**
* TODO: force update event?
* TODO: force update event?
* TODO: resolve step?
* TODO: resolve step?
...
@@ -797,6 +814,7 @@ declare module 'vscode' {
...
@@ -797,6 +814,7 @@ declare module 'vscode' {
provideComments
(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
provideComments
(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
provideNewCommentRange
(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideNewCommentRange
(
document
:
TextDocument
,
token
:
CancellationToken
):
Promise
<
NewCommentAction
>
;
provideAllComments
?(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
provideAllComments
?(
token
:
CancellationToken
):
Promise
<
CommentThread
[]
>
;
onDidChangeCommentThreads
?:
Event
<
CommentThreadChangedEvent
>
;
}
}
namespace
workspace
{
namespace
workspace
{
...
...
src/vs/workbench/api/electron-browser/mainThreadComments.ts
浏览文件 @
801d3eaa
...
@@ -67,8 +67,10 @@ export class MainThreadComments extends Disposable implements MainThreadComments
...
@@ -67,8 +67,10 @@ export class MainThreadComments extends Disposable implements MainThreadComments
this
.
_panelService
.
setPanelEnablement
(
COMMENTS_PANEL_ID
,
true
);
this
.
_panelService
.
setPanelEnablement
(
COMMENTS_PANEL_ID
,
true
);
}
}
});
});
}
$onDidCommentThreadsChange
(
handle
:
number
,
event
:
modes
.
CommentThreadChangedEvent
)
{
// notify comment service
}
}
$unregisterCommentProvider
(
handle
:
number
):
void
{
$unregisterCommentProvider
(
handle
:
number
):
void
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
801d3eaa
...
@@ -107,6 +107,7 @@ export interface MainThreadCommandsShape extends IDisposable {
...
@@ -107,6 +107,7 @@ export interface MainThreadCommandsShape extends IDisposable {
export
interface
MainThreadCommentsShape
extends
IDisposable
{
export
interface
MainThreadCommentsShape
extends
IDisposable
{
$registerCommentProvider
(
handle
:
number
):
void
;
$registerCommentProvider
(
handle
:
number
):
void
;
$unregisterCommentProvider
(
handle
:
number
):
void
;
$unregisterCommentProvider
(
handle
:
number
):
void
;
$onDidCommentThreadsChange
(
handle
:
number
,
event
:
modes
.
CommentThreadChangedEvent
):
void
;
}
}
export
interface
MainThreadConfigurationShape
extends
IDisposable
{
export
interface
MainThreadConfigurationShape
extends
IDisposable
{
...
...
src/vs/workbench/api/node/extHostComments.ts
浏览文件 @
801d3eaa
...
@@ -37,6 +37,15 @@ export class ExtHostComments implements ExtHostCommentsShape {
...
@@ -37,6 +37,15 @@ export class ExtHostComments implements ExtHostCommentsShape {
this
.
_providers
.
set
(
handle
,
provider
);
this
.
_providers
.
set
(
handle
,
provider
);
this
.
_proxy
.
$registerCommentProvider
(
handle
);
this
.
_proxy
.
$registerCommentProvider
(
handle
);
provider
.
onDidChangeCommentThreads
(
event
=>
{
this
.
_proxy
.
$onDidCommentThreadsChange
(
handle
,
{
changed
:
event
.
changed
.
map
(
x
=>
convertCommentThread
(
x
,
this
.
_commandsConverter
)),
added
:
event
.
added
.
map
(
x
=>
convertCommentThread
(
x
,
this
.
_commandsConverter
)),
removed
:
event
.
removed
.
map
(
x
=>
convertCommentThread
(
x
,
this
.
_commandsConverter
))
});
});
return
{
return
{
dispose
:
()
=>
{
dispose
:
()
=>
{
this
.
_proxy
.
$unregisterCommentProvider
(
handle
);
this
.
_proxy
.
$unregisterCommentProvider
(
handle
);
...
@@ -45,6 +54,10 @@ export class ExtHostComments implements ExtHostCommentsShape {
...
@@ -45,6 +54,10 @@ export class ExtHostComments implements ExtHostCommentsShape {
};
};
}
}
$onDidCommentThreadsChange
(
handle
:
number
,
commentThreadEvent
:
vscode
.
CommentThreadChangedEvent
)
{
return
TPromise
.
as
(
null
);
}
$provideComments
(
handle
:
number
,
uri
:
UriComponents
):
TPromise
<
modes
.
CommentThread
[]
>
{
$provideComments
(
handle
:
number
,
uri
:
UriComponents
):
TPromise
<
modes
.
CommentThread
[]
>
{
const
data
=
this
.
_documents
.
getDocumentData
(
URI
.
revive
(
uri
));
const
data
=
this
.
_documents
.
getDocumentData
(
URI
.
revive
(
uri
));
if
(
!
data
||
!
data
.
document
)
{
if
(
!
data
||
!
data
.
document
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录