"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const gotoLineQuickAccess = require("../../../contrib/quickAccess/browser/gotoLineQuickAccess.js");
const platform = require("../../../../platform/registry/common/platform.js");
const quickAccess = require("../../../../platform/quickinput/common/quickAccess.js");
const codeEditorService = require("../../../browser/services/codeEditorService.js");
const types = require("../../../../base/common/types.js");
const standaloneStrings = require("../../../common/standaloneStrings.js");
const event = require("../../../../base/common/event.js");
const editorExtensions = require("../../../browser/editorExtensions.js");
const editorContextKeys = require("../../../common/editorContextKeys.js");
const quickInput = require("../../../../platform/quickinput/common/quickInput.js");
var __decorate = globalThis && globalThis.__decorate || function(decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
    r = Reflect.decorate(decorators, target, key, desc);
  else
    for (var i = decorators.length - 1; i >= 0; i--)
      if (d = decorators[i])
        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param = globalThis && globalThis.__param || function(paramIndex, decorator) {
  return function(target, key) {
    decorator(target, key, paramIndex);
  };
};
exports.StandaloneGotoLineQuickAccessProvider = class StandaloneGotoLineQuickAccessProvider extends gotoLineQuickAccess.AbstractGotoLineQuickAccessProvider {
  constructor(editorService) {
    super();
    this.editorService = editorService;
    this.onDidActiveTextEditorControlChange = event.Event.None;
  }
  get activeTextEditorControl() {
    return types.withNullAsUndefined(this.editorService.getFocusedCodeEditor());
  }
};
exports.StandaloneGotoLineQuickAccessProvider = __decorate([
  __param(0, codeEditorService.ICodeEditorService)
], exports.StandaloneGotoLineQuickAccessProvider);
platform.Registry.as(quickAccess.Extensions.Quickaccess).registerQuickAccessProvider({
  ctor: exports.StandaloneGotoLineQuickAccessProvider,
  prefix: exports.StandaloneGotoLineQuickAccessProvider.PREFIX,
  helpEntries: [{ description: standaloneStrings.GoToLineNLS.gotoLineActionLabel, needsEditor: true }]
});
class GotoLineAction extends editorExtensions.EditorAction {
  constructor() {
    super({
      id: "editor.action.gotoLine",
      label: standaloneStrings.GoToLineNLS.gotoLineActionLabel,
      alias: "Go to Line/Column...",
      precondition: void 0,
      kbOpts: {
        kbExpr: editorContextKeys.EditorContextKeys.focus,
        primary: 2048 | 37,
        mac: {
          primary: 256 | 37
          /* KeyG */
        },
        weight: 100
        /* EditorContrib */
      }
    });
  }
  run(accessor) {
    accessor.get(quickInput.IQuickInputService).quickAccess.show(exports.StandaloneGotoLineQuickAccessProvider.PREFIX);
  }
}
editorExtensions.registerEditorAction(GotoLineAction);
exports.GotoLineAction = GotoLineAction;
