in src/controller/commentController.ts [118:136]
async copyLinkFromContext() {
const editor = vscode.window.activeTextEditor;
if (editor) {
const document = editor.document;
const { guid, version, filepath } =
await this.directoryController.splitUri(document.uri);
const selection = editor.selections[0];
const endCharacter = document.lineAt(selection.end).text.length;
const range = RangeHelper.fromSelection(selection, endCharacter);
return this.createLink(
guid,
version,
filepath,
RangeHelper.toString(range)
);
} else {
throw new Error("No active text editor found.");
}
}