"use strict";
const stopwatch = require("../../../../base/common/stopwatch.js");
const editorExtensions = require("../../../browser/editorExtensions.js");
const nls = require("../../../../nls.js");
class ForceRetokenizeAction extends editorExtensions.EditorAction {
  constructor() {
    super({
      id: "editor.action.forceRetokenize",
      label: nls.localize("forceRetokenize", "Developer: Force Retokenize"),
      alias: "Developer: Force Retokenize",
      precondition: void 0
    });
  }
  run(accessor, editor) {
    if (!editor.hasModel()) {
      return;
    }
    const model = editor.getModel();
    model.resetTokenization();
    const sw = new stopwatch.StopWatch(true);
    model.forceTokenization(model.getLineCount());
    sw.stop();
    console.log(`tokenization took ${sw.elapsed()}`);
  }
}
editorExtensions.registerEditorAction(ForceRetokenizeAction);
