async copyLineNumber()

in src/controller/commentController.ts [50:69]


  async copyLineNumber() {
    const editor = vscode.window.activeTextEditor;
    if (editor) {
      const document = editor.document;
      const selection = editor.selections[0];
      const range = RangeHelper.toString(RangeHelper.fromSelection(selection));
      const { filepath } = await this.directoryController.splitUri(
        document.uri
      );
      const commentString = CommentCacheController.getCommentString(
        filepath,
        range
      );
      vscode.env.clipboard.writeText(commentString);
      vscode.window.showInformationMessage("Line number copied to clipboard.");
      return commentString;
    } else {
      throw new Error("No active text editor found.");
    }
  }