VS Code Extension API – bizzare javascript behaviour

I have a normal js file for vscode extension api. When debugging, js seems to be broken (I know, impossible). Here is my code …

context.subscriptions.push(
  vscode.commands.registerCommand("stickyBookmarks.toggleBookmark", 
    () => {
      const textEditor = vscode.window.activeTextEditor;
      if (!textEditor) return;

      const document   = textEditor.document;
      const lineNum    = document.lineCount-1;

      const textLine   = document.lineAt(lineNum-2);
      const lineRange  = textLine.range;

      const rgtChrIdx  = lineRange.end.character;
      const lftChrIdx  = rgtChrIdx-4;

      // debugger breakpoint here
      const lftPos     = new vscode.Position(lineNum, lftChrIdx);
      const rgtPos     = new vscode.Position(lineNum, rgtChrIdx);
      const chrRange   = new vscode.Range(lftPos, rgtPos);
      const text       = document.getText(chrRange);

      if(text === "/**/") textEditor.edit(
        editBuilder => editBuilder.replace(chrRange, ""));
    }
  )
);

At the breakpoint rgtChrIdx == 14 and lftChrIdx == 0. I have tried a breakpoint on every line. Does anyone have any idea what is going on?