<commit_before>require('date-format-lite');

const vscode = require('vscode');

exports.activate = function activate(context) {
  const disposable = vscode.commands.registerCommand('extension.insertdatestring', () => {
    const editor = vscode.window.activeTextEditor;
    const selections = editor.selections;

    editor.edit((editBuilder) => {
      const userFormat = vscode.workspace.getConfiguration('insertdatestring').get('format');
      const date = (new Date()).format(userFormat);

      for (let i = 0; i < selections.length; i++) {
        editBuilder.replace(selections[i], '');
        editBuilder.insert(selections[i].active, date);
      }
    });
  });<commit_msg>Replace loop with forEach<commit_after>require('date-format-lite');

const vscode = require('vscode');

exports.activate = function activate(context) {
  const disposable = vscode.commands.registerCommand('extension.insertdatestring', () => {
    const editor = vscode.window.activeTextEditor;
    const selections = editor.selections;

    editor.edit((editBuilder) => {
      const userFormat = vscode.workspace.getConfiguration('insertdatestring').get('format');
      const date = (new Date()).format(userFormat);

      selections.forEach((selection) => {
        editBuilder.replace(selection, '');
        editBuilder.insert(selection.active, date);
      });
    });
  });
{'fraction_non_alphanumeric': 0.14882697947214077, 'fraction_numerical': 0.0007331378299120235, 'mean_word_length': 4.112359550561798, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7510537', 'n_tokens_mistral': 398, 'n_tokens_neox': 385, 'n_words': 65}