in src/controller/commentController.ts [75:88]
async addComment() {
const editor = vscode.window.activeTextEditor;
if (editor) {
const document = editor.document;
const selection = editor.selections[0];
const endCharacter = document.lineAt(selection.end).text.length;
const range = RangeHelper.fromSelection(selection, endCharacter);
const comment = await this.createComment(document.uri, range);
await this.saveCommentToCache(comment);
return comment;
} else {
throw new Error("No active text editor found.");
}
}