import { StopWatch } from "../../../../base/common/stopwatch.mjs";
import { registerEditorAction, EditorAction } from "../../../browser/editorExtensions.mjs";
import { localize } from "../../../../nls.mjs";
class ForceRetokenizeAction extends EditorAction {
  constructor() {
    super({
      id: "editor.action.forceRetokenize",
      label: 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(true);
    model.forceTokenization(model.getLineCount());
    sw.stop();
    console.log(`tokenization took ${sw.elapsed()}`);
  }
}
registerEditorAction(ForceRetokenizeAction);
