use explict api instead of commands for commenting.

This commit is contained in:
Peng Lyu
2018-05-16 19:14:13 -07:00
parent 26ec624af6
commit 41f1722166
11 changed files with 299 additions and 178 deletions

View File

@@ -58,12 +58,21 @@ export class MainThreadComments extends Disposable implements MainThreadComments
});
for (const handle of keys(this._documentProviders)) {
_commentService.registerDataProvider({
provideDocumentComments: async (model, token) => {
return this._proxy.$provideDocumentComments(handle, model.uri);
},
onDidChangeCommentThreads: null
});
_commentService.registerDataProvider(
handle,
{
provideDocumentComments: async (uri, token) => {
return this._proxy.$provideDocumentComments(handle, uri);
},
onDidChangeCommentThreads: null,
createNewCommentThread: async (uri, range, text, token) => {
return this._proxy.$createNewCommentThread(handle, uri, range, text);
},
replyToCommentThread: async (uri, range, thread, text, token) => {
return this._proxy.$replyToCommentThread(handle, uri, range, thread, text);
}
}
);
}
});
}