Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CommentProvider, panel, and editor contribution #50501

Merged
merged 228 commits into from
Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
b4195ab
dynamic height review widget
rebornix Mar 26, 2018
094a469
Working on adding comment api
mjbvz Apr 4, 2018
770587a
add missing copyright
rebornix Apr 4, 2018
f5e216d
Dispose view zone.
rebornix Apr 4, 2018
f2ee416
remove commits provider
rebornix Apr 4, 2018
b1020fb
better icon
rebornix Apr 4, 2018
0036c96
click should always work
rebornix Apr 4, 2018
fbd34d3
Fix build failure
rebornix Apr 4, 2018
785b206
Format.
rebornix Apr 4, 2018
f7f4f3c
Do not show comments panel when there is no comment.
rebornix Apr 4, 2018
36d3155
Use octokit/rest.js instead of octokat.
rebornix Apr 4, 2018
a6e471b
configuration for github tokens
rebornix Apr 4, 2018
82c41c9
remove uncessary code.
rebornix Apr 4, 2018
1c7c3c9
move comment analyze to common
rebornix Apr 4, 2018
0671a03
diff view when the file does not exist in a commit
rebornix Apr 4, 2018
bc23a02
review requested PR.
rebornix Apr 5, 2018
df52ca0
Mine PRs.
rebornix Apr 5, 2018
b3ef6d4
Show comments in problem panel.
rebornix Apr 5, 2018
211af8c
crazy idea of injecting resource groups into git scm viewlet
rebornix Apr 5, 2018
d3c0f36
bad copyright
rebornix Apr 6, 2018
d707e64
fetch PR branch (readonly) and checkout locally
rebornix Apr 6, 2018
7307023
Rename webviewInput to webviewEditorInput
mjbvz Apr 6, 2018
7870796
Reduce duplicate state for active webviews
mjbvz Apr 6, 2018
5a0ead5
Make sure we don't try posting mesages to disposed markdown previews
mjbvz Apr 6, 2018
082d403
Gravatar is cool.
rebornix Apr 6, 2018
b4afa20
Avoid large function.
rebornix Apr 6, 2018
96153d1
Moving common code out of prProvider.
rebornix Apr 6, 2018
54d3602
typing is always good
rebornix Apr 6, 2018
300756d
use 64 bits for user gravatar.
rebornix Apr 6, 2018
d7e0604
Prototype webview widget
mjbvz Apr 6, 2018
c810428
Fix compile error
mjbvz Apr 6, 2018
89d6db5
Show at a specific position
mjbvz Apr 6, 2018
7fa3fa2
Allow closing webview widgets
mjbvz Apr 6, 2018
88ac101
deleted lines should be ignored.
rebornix Apr 6, 2018
105ba50
gravatar, title bar for comment thread, show comment titles when file…
rebornix Apr 6, 2018
245ccf5
Merge remote-tracking branch 'upstream/mjbvz/webviewWidgetProto' into…
rebornix Apr 6, 2018
3c9fc88
remove viewzones when disposed.
rebornix Apr 9, 2018
768ec4c
Restore Review Mode, Git content provider and extract comments provid…
rebornix Apr 9, 2018
206b78d
Fast return if the content doesn't exist.
rebornix Apr 9, 2018
92719c3
Minimal code change to the git extension exposed API.
rebornix Apr 9, 2018
f354e9b
Merge remote-tracking branch 'upstream/master' into rebornix/review
rebornix Apr 9, 2018
5dd148f
New comment actions.
rebornix Apr 10, 2018
bd83b6d
Removing webview widget api. Will go with more declarative approach
mjbvz Apr 10, 2018
260d299
Prototyping declarative action contribution for threads
mjbvz Apr 10, 2018
ec3c967
Add review mode overlay in the editor.
rebornix Apr 10, 2018
d638b29
No review overlay when there is no comment.
rebornix Apr 10, 2018
3e6538c
Comments based on markers
rebornix Apr 11, 2018
7b25031
Show my prs with correct filter
rebornix Apr 11, 2018
7f99293
Reply comment.
rebornix Apr 11, 2018
63c90eb
Collapse review zone by default, no review toggle overlay, show all r…
rebornix Apr 11, 2018
985253d
new comment.
rebornix Apr 11, 2018
159234d
Add comments panel
Apr 12, 2018
58a859e
unregister comment provider when dispose, otherwise we see duplicates.
rebornix Apr 12, 2018
05716c1
should not run providers twice.
rebornix Apr 12, 2018
54a7a3a
Comment provider with correct registration and dispose.
rebornix Apr 12, 2018
bd94f5e
move review model logic out of tree view.
rebornix Apr 12, 2018
9c58b4e
use content provider for pr diff view.
rebornix Apr 12, 2018
7c0f400
remove unused.
rebornix Apr 12, 2018
81e99dc
add open file action to diff view
rebornix Apr 12, 2018
09b7be3
organize disposals
rebornix Apr 12, 2018
f3d38c3
Associate comments with files, open editor when selecting top-level n…
Apr 12, 2018
3ac86b3
Navigate to comment in editor from comments panel
Apr 13, 2018
0cdeb41
Align command id naming.
rebornix Apr 12, 2018
36672be
add new comment.
rebornix Apr 13, 2018
64fb9e8
refactor
rebornix Apr 16, 2018
8107cbf
move comment widget out of editor
rebornix Apr 16, 2018
e30aba6
Fetch PR when switching to or storing from review mode
rebornix Apr 17, 2018
985e0e3
explicit return types and remove unused files
rebornix Apr 17, 2018
bb8e244
map file change from PR directly to SCM scheme
rebornix Apr 17, 2018
3a297dc
Add provideAllComments method to comments provider
Apr 17, 2018
ebf39ff
Add user name and icon
Apr 17, 2018
f323084
use localFileChanges for getting all comments, fix file label
Apr 17, 2018
0d39d57
use $.
rebornix Apr 17, 2018
d15c0dc
Display message when PR has no comments
Apr 17, 2018
b71bbac
new PR group
rebornix Apr 17, 2018
5691967
DRY
rebornix Apr 17, 2018
aec17d0
no infinite loop
rebornix Apr 17, 2018
58bd181
comment thread should never be null
rebornix Apr 17, 2018
cc30022
get ready for incremental update.
rebornix Apr 17, 2018
c9b93ad
fix build error
rebornix Apr 17, 2018
9045d45
Fall back to comment's original position if position is null
Apr 17, 2018
99ce8b1
fetch from the pr branch directly
rebornix Apr 17, 2018
801d3ea
Add onDidCommentThreadsChange
Apr 17, 2018
aed94ae
comment service fetch
rebornix Apr 18, 2018
ee9328b
no need to implement comment provider api in comment service
rebornix Apr 18, 2018
e1bb620
Fix build
Apr 18, 2018
5c25f50
rough incremental update.
rebornix Apr 18, 2018
fdff889
fix reply new comment
rebornix Apr 18, 2018
12b80dd
Add polling for updating comments
Apr 18, 2018
17e9aee
update comment content.
rebornix Apr 18, 2018
db3c354
Compare comment threads instead of comments
Apr 18, 2018
c78a872
Fix issue with entering review mode on load by adding missing await
Apr 19, 2018
94f8f0f
Listen to update comment threads event in comment panel
Apr 19, 2018
4ef7518
update comment cache
rebornix Apr 19, 2018
8730f96
explicit reply comment thread command
rebornix Apr 19, 2018
55198cb
huge refactoring, remove getNewCommentRange
rebornix Apr 19, 2018
c0508af
dispose comment provider when switching between branches
rebornix Apr 19, 2018
c1bf9a4
some decorations for scm
rebornix Apr 19, 2018
4b4e012
tree view does not support decoration now, use icon
rebornix Apr 19, 2018
3970770
comments decoration for file explorer
rebornix Apr 20, 2018
b25496d
Fix comment thread update calculation
Apr 20, 2018
a8bc299
Flat list of comments for each resource in comments panel
Apr 20, 2018
ebf08c6
Show comment threads with one level of indentation
Apr 20, 2018
e1c6d45
small reply textarea
rebornix Apr 20, 2018
5a3c4d1
commentProvider can control collapse state of a thread
rebornix Apr 20, 2018
1920a28
Separate WorkspaceCommentProvider and DocumentCommentProvider
Apr 20, 2018
49b409c
Avoid multiple calls to status when switching PRs
Apr 20, 2018
819d690
make validateState a no op when prNumber hasn't changed, revert previous
Apr 20, 2018
1ef418b
Add counter to comments panel title, collapse all action
Apr 20, 2018
27daa6a
Properly preserve focus when opening editor
Apr 20, 2018
1604153
collapsable comment widget
rebornix Apr 22, 2018
faa4bd1
null check
rebornix Apr 23, 2018
070d4f3
filter comments by file
rebornix Apr 23, 2018
7b4394d
auto expand for comments in PR view
rebornix Apr 23, 2018
5d5681d
collapse action
rebornix Apr 23, 2018
6889469
reveal and expand comments
rebornix Apr 23, 2018
ba255e7
Null check
Apr 23, 2018
ac97398
the position mapping between diff hunk and file is correct now
rebornix Apr 23, 2018
eef8588
comments need paging as well
rebornix Apr 23, 2018
2029f6e
vscode.range is 0 based. mouse up on gutter should be marker based.
rebornix Apr 23, 2018
cbee2c0
Merge remote-tracking branch 'upstream/master' into rebornix/review
rebornix Apr 24, 2018
97505be
Fix merge error
rebornix Apr 24, 2018
12d9d65
Move Pull Request Panel to SCM
rebornix Apr 24, 2018
d567fbe
add new comment range is marker based now.
rebornix Apr 24, 2018
b7a2c2c
save pr status to git config
rebornix May 2, 2018
6206211
red color in the overview ruler
rebornix May 4, 2018
316e3d3
Small styling changes to comment editor contribution
May 5, 2018
dff6558
Use button widget
May 5, 2018
9c5d101
overviewruler foreground should be controllable.
rebornix May 8, 2018
59ad3ec
no git extension api hack
rebornix May 9, 2018
0f0e1bb
restore PR branch from git status
rebornix May 9, 2018
59de892
Use status bar item to indictate review mode switching.
rebornix May 9, 2018
aba56da
use git-branch icon for PR
rebornix May 9, 2018
1c7b91d
start error handling
rebornix May 10, 2018
51c1949
Progress bar for pr switching
rebornix May 10, 2018
bbb4ada
Check dirty workspace before switching to Review mode.
rebornix May 10, 2018
31760c4
Singleton and commands registration
rebornix May 10, 2018
9da6cea
open PR in browser when clicking on status bar item.
rebornix May 10, 2018
1dc3521
position comments at right position for scm tree view
rebornix May 10, 2018
a1fd23d
show local branches for PR
rebornix May 10, 2018
5cb1807
show indicator for current pr branch
rebornix May 11, 2018
0f04cff
Move new comment button to content widget
May 11, 2018
3570471
check null and undefined.
rebornix May 11, 2018
f32bea5
Fix reply command for first comment in thread
May 11, 2018
5e2b219
Don't show reply button for first comment in thread
May 11, 2018
015a7ba
Remove new comment when no content is entered on collapse/escape
May 11, 2018
db6e2f1
Dispose all zone widgets in editor contribution; show low opacity ico…
May 11, 2018
a9ad68e
Some code cleanup
May 14, 2018
8c5c75f
Reveal comment range in center
May 14, 2018
479368e
Do not show new comment button on files with no possible commenting r…
May 14, 2018
fa0981b
use monaco editor for commenting.
rebornix May 14, 2018
ccf2d0b
no escape in new comment editor and use random number as model id whe…
rebornix May 14, 2018
4cd0aff
reveal comment in thread.
rebornix May 14, 2018
c8e5576
focus on comment and highlight
rebornix May 14, 2018
48179d7
Fix updates to comment glyph position
May 14, 2018
48be3eb
Fix error for get prs
rebornix May 14, 2018
d1ddcb4
keyboard navigation and aria
rebornix May 15, 2018
d298248
git refactor
rebornix May 15, 2018
bd647b7
remove unused code
rebornix May 15, 2018
83b8d60
wording
rebornix May 16, 2018
b127d65
Fix mapOldPositionToNew
May 16, 2018
4d4a44f
Merge branch 'rebornix/review' of https://github.com/Microsoft/vscode…
rebornix May 16, 2018
cd6cb3b
max img size should be 100%
rebornix May 16, 2018
734f48c
Update comment position when reopening dirty files
May 16, 2018
26ec624
Fix position updating on file changes when comment widget has not bee…
May 16, 2018
41f1722
use explict api instead of commands for commenting.
rebornix May 17, 2018
ca4f18d
remove unsed command service and reorder constructor paramaters.
rebornix May 17, 2018
414bc2c
Render comments as markdown in comments panel
May 17, 2018
31a5864
Add null check to mapCommentsToHead
May 17, 2018
31acdf5
remove duplicate comment editor background.
rebornix May 17, 2018
b2300ee
dispose empty comment widget and hide others.
rebornix May 17, 2018
c724adb
description
rebornix May 17, 2018
64084e0
description svg
rebornix May 17, 2018
b9368d8
Add webview description
May 18, 2018
5d6cca6
update comments in editor when a data provider is registered.
rebornix May 18, 2018
9acfd66
Merge remote-tracking branch 'upstream/master' into rebornix/review
rebornix May 18, 2018
062084c
Refactoring
May 18, 2018
d415a74
webview infra
rebornix May 18, 2018
ed1ff12
ignore js error for webpack
rebornix May 18, 2018
b20bb83
Add checkout button to overview
May 18, 2018
6056020
Styling update
May 19, 2018
7770759
fix failure for api change
rebornix May 19, 2018
2f2f03b
comment textarea in description page, styling
rebornix May 21, 2018
75a6aec
send create issue comment request and update UI.
rebornix May 21, 2018
a857fd5
description node for changes in pr treeview.
rebornix May 21, 2018
2ccad33
close pull request
rebornix May 21, 2018
afc5558
fix build error for upstream merging
rebornix May 21, 2018
072e970
Some small fixes to overview page, fix remaining build errors
May 21, 2018
f86589c
Workaround for comments panel not opening
May 21, 2018
f1dcaae
Some styling tweaks, fix status calculation
May 21, 2018
31055b3
Fix author link in pull request overview
May 22, 2018
bc47393
Remove deps of lodash.
rebornix May 22, 2018
3ef1b53
Show outdated comments.
rebornix May 22, 2018
c4efd00
show diff view editor for outdated comments.
rebornix May 22, 2018
c7b6ea5
Remove unused
May 22, 2018
52b9e85
Dispose of comment widgets in editor contribuation dispose
May 22, 2018
bd85c58
use DiffLine whenever possible.
rebornix May 22, 2018
cfbc615
Add 'Pull' button when local branch is out of date
May 22, 2018
d84f135
refactor...
rebornix May 22, 2018
1c93c77
Track all comments with _comments property in ReviewManager
May 22, 2018
1281feb
md renderer for description view.
rebornix May 23, 2018
0ae17e6
css for comment markdown content.
rebornix May 23, 2018
b65bf5c
show commit id in the file path for comments outdated
rebornix May 23, 2018
b332182
warning message for comments whose base commit doesn't exist locally.
rebornix May 23, 2018
e9f5dc8
Unregister data providers from comment service
May 23, 2018
16214f1
fallback to partial diff when the commit does not exist locally.
rebornix May 23, 2018
d0f6ed7
Ensure widgets and file decorations are removed when exiting review mode
May 23, 2018
74bbf79
Remove count badges from comments panel
May 23, 2018
72d1a4c
textarea in iframe keybinding issue.
rebornix May 24, 2018
439be25
show review comments and diffview in description page.
rebornix May 24, 2018
ec22a1e
Fix reloading description webview
May 24, 2018
a96e877
A bit of code cleanup
May 25, 2018
1d2334e
Fix diff line type for diffhunk header.
rebornix May 25, 2018
2c64d63
refactor of tree view nodes.
rebornix May 25, 2018
429a2da
remove unused code.
rebornix May 25, 2018
b95920f
generic comment icon
rebornix May 25, 2018
4780fef
fix infinite loop patch parsing.
rebornix May 25, 2018
fb3fbbb
empty string is a valid branchName parameter for git fetch.
rebornix May 25, 2018
1834af8
group comments related api in a region and add warning comment.
rebornix May 25, 2018
a1b48a0
Remove unused code
May 25, 2018
2c0b7e6
Small fix to comment icon calculation
May 25, 2018
0445060
Remove git-extended folder
May 26, 2018
8b39ee1
Revert changes to hygiene file
May 26, 2018
1c5a196
Remove erroneous changes from past merges
May 26, 2018
ad635f2
Merge remote-tracking branch 'upstream/master' into rmacfarlane/review
rebornix Jun 4, 2018
311e44f
adopt new grid APIs
bpasero Jun 2, 2018
d835b9c
move comments service into comments part instead of registering it as…
rebornix Jun 4, 2018
0543770
Remove unused code
Jun 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"name": "vs/workbench/parts/codeEditor",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/comments",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/debug",
"project": "vscode-workbench"
Expand Down
3 changes: 2 additions & 1 deletion src/vs/code/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ export class CodeWindow implements ICodeWindow {
title: product.nameLong,
webPreferences: {
'backgroundThrottling': false, // by default if Code is in the background, intervals and timeouts get throttled,
disableBlinkFeatures: 'Auxclick' // disable auxclick events (see https://developers.google.com/web/updates/2016/10/auxclick)
disableBlinkFeatures: 'Auxclick', // disable auxclick events (see https://developers.google.com/web/updates/2016/10/auxclick)
experimentalFeatures: true
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/controller/coreCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ registerCommand(new EditorOrNativeTextInputCommand({
editorHandler: CoreNavigationCommands.SelectAll,
inputHandler: 'selectAll',
id: 'editor.action.selectAll',
precondition: null,
precondition: EditorContextKeys.focus,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: null,
Expand Down
75 changes: 75 additions & 0 deletions src/vs/editor/common/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,81 @@ export interface Command {
tooltip?: string;
arguments?: any[];
}

export interface CommentInfo {
owner: number;
threads: CommentThread[];
commentingRanges?: IRange[];
reply?: Command;
}

export enum CommentThreadCollapsibleState {
/**
* Determines an item is collapsed
*/
Collapsed = 0,
/**
* Determines an item is expanded
*/
Expanded = 1
}

export interface CommentThread {
threadId: string;
resource: string;
range: IRange;
comments: Comment[];
collapsibleState?: CommentThreadCollapsibleState;
reply?: Command;
}

export interface NewCommentAction {
ranges: IRange[];
actions: Command[];
}

export interface Comment {
readonly commentId: string;
readonly body: IMarkdownString;
readonly userName: string;
readonly gravatar: string;
readonly command?: Command;
}

export interface CommentThreadChangedEvent {
readonly owner: number;
/**
* Added comment threads.
*/
readonly added: CommentThread[];

/**
* Removed comment threads.
*/
readonly removed: CommentThread[];

/**
* Changed comment threads.
*/
readonly changed: CommentThread[];
}


export interface DocumentCommentProvider {
provideDocumentComments(resource: URI, token: CancellationToken): Promise<CommentInfo>;
createNewCommentThread(resource: URI, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread(resource: URI, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>;
}


export interface WorkspaceCommentProvider {
provideWorkspaceComments(token: CancellationToken): Promise<CommentThread[]>;
createNewCommentThread(resource: URI, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread(resource: URI, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
onDidChangeCommentThreads(): Event<CommentThreadChangedEvent>;
}

export interface ICodeLensSymbol {
range: IRange;
id?: string;
Expand Down
1 change: 1 addition & 0 deletions src/vs/editor/standalone/browser/standaloneLanguages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
SymbolKind: modes.SymbolKind,
IndentAction: IndentAction,
SuggestTriggerKind: modes.SuggestTriggerKind,
CommentThreadCollapsibleState: modes.CommentThreadCollapsibleState,
FoldingRangeKind: modes.FoldingRangeKind
};
}
70 changes: 70 additions & 0 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5147,6 +5147,76 @@ declare namespace monaco.languages {
arguments?: any[];
}

export interface CommentInfo {
owner: number;
threads: CommentThread[];
commentingRanges?: IRange[];
reply?: Command;
}

export enum CommentThreadCollapsibleState {
/**
* Determines an item is collapsed
*/
Collapsed = 0,
/**
* Determines an item is expanded
*/
Expanded = 1,
}

export interface CommentThread {
threadId: string;
resource: string;
range: IRange;
comments: Comment[];
collapsibleState?: CommentThreadCollapsibleState;
reply?: Command;
}

export interface NewCommentAction {
ranges: IRange[];
actions: Command[];
}

export interface Comment {
readonly commentId: string;
readonly body: IMarkdownString;
readonly userName: string;
readonly gravatar: string;
readonly command?: Command;
}

export interface CommentThreadChangedEvent {
readonly owner: number;
/**
* Added comment threads.
*/
readonly added: CommentThread[];
/**
* Removed comment threads.
*/
readonly removed: CommentThread[];
/**
* Changed comment threads.
*/
readonly changed: CommentThread[];
}

export interface DocumentCommentProvider {
provideDocumentComments(resource: Uri, token: CancellationToken): Promise<CommentInfo>;
createNewCommentThread(resource: Uri, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread(resource: Uri, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
onDidChangeCommentThreads(): IEvent<CommentThreadChangedEvent>;
}

export interface WorkspaceCommentProvider {
provideWorkspaceComments(token: CancellationToken): Promise<CommentThread[]>;
createNewCommentThread(resource: Uri, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread(resource: Uri, range: Range, thread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
onDidChangeCommentThreads(): IEvent<CommentThreadChangedEvent>;
}

export interface ICodeLensSymbol {
range: IRange;
id?: string;
Expand Down
74 changes: 74 additions & 0 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,80 @@ declare module 'vscode' {

//#endregion

//#region Comments
/**
* Comments provider related APIs are still in early stages, they may be changed significantly during our API experiments.
*/

interface CommentInfo {
threads: CommentThread[];
commentingRanges?: Range[];
}

export enum CommentThreadCollapsibleState {
/**
* Determines an item is collapsed
*/
Collapsed = 0,
/**
* Determines an item is expanded
*/
Expanded = 1
}

interface CommentThread {
threadId: string;
resource: Uri;
range: Range;
comments: Comment[];
collapsibleState?: CommentThreadCollapsibleState;
}

interface Comment {
commentId: string;
body: MarkdownString;
userName: string;
gravatar: string;
command?: Command;
}

export interface CommentThreadChangedEvent {
/**
* Added comment threads.
*/
readonly added: CommentThread[];

/**
* Removed comment threads.
*/
readonly removed: CommentThread[];

/**
* Changed comment threads.
*/
readonly changed: CommentThread[];
}

interface DocumentCommentProvider {
provideDocumentComments(document: TextDocument, token: CancellationToken): Promise<CommentInfo>;
createNewCommentThread?(document: TextDocument, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread?(document: TextDocument, range: Range, commentThread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
onDidChangeCommentThreads?: Event<CommentThreadChangedEvent>;
}

interface WorkspaceCommentProvider {
provideWorkspaceComments(token: CancellationToken): Promise<CommentThread[]>;
createNewCommentThread?(document: TextDocument, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread?(document: TextDocument, range: Range, commentThread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;

onDidChangeCommentThreads?: Event<CommentThreadChangedEvent>;
}

namespace workspace {
export function registerDocumentCommentProvider(provider: DocumentCommentProvider): Disposable;
export function registerWorkspaceCommentProvider(provider: WorkspaceCommentProvider): Disposable;
}
//#endregion

//#region Terminal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import './mainThreadTerminalService';
import './mainThreadTreeViews';
import './mainThreadLogService';
import './mainThreadWebview';
import './mainThreadComments';
import './mainThreadUrls';
import './mainThreadWindow';
import './mainThreadWorkspace';
Expand Down