"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../../base/common/codicons.js");
require("../../../../base/browser/ui/codicons/codicon/codicon.css.js");
require("../../../../base/browser/ui/codicons/codicon/codicon-modifiers.css.js");
require("../../../contrib/symbolIcons/browser/symbolIcons.js");
const gotoSymbolQuickAccess = require("../../../contrib/quickAccess/browser/gotoSymbolQuickAccess.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");
const outlineModel = require("../../../contrib/documentSymbols/browser/outlineModel.js");
const languageFeatures = require("../../../common/services/languageFeatures.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.StandaloneGotoSymbolQuickAccessProvider = class StandaloneGotoSymbolQuickAccessProvider extends gotoSymbolQuickAccess.AbstractGotoSymbolQuickAccessProvider {
  constructor(editorService, languageFeaturesService, outlineModelService) {
    super(languageFeaturesService, outlineModelService);
    this.editorService = editorService;
    this.onDidActiveTextEditorControlChange = event.Event.None;
  }
  get activeTextEditorControl() {
    return types.withNullAsUndefined(this.editorService.getFocusedCodeEditor());
  }
};
exports.StandaloneGotoSymbolQuickAccessProvider = __decorate([
  __param(0, codeEditorService.ICodeEditorService),
  __param(1, languageFeatures.ILanguageFeaturesService),
  __param(2, outlineModel.IOutlineModelService)
], exports.StandaloneGotoSymbolQuickAccessProvider);
platform.Registry.as(quickAccess.Extensions.Quickaccess).registerQuickAccessProvider({
  ctor: exports.StandaloneGotoSymbolQuickAccessProvider,
  prefix: gotoSymbolQuickAccess.AbstractGotoSymbolQuickAccessProvider.PREFIX,
  helpEntries: [
    { description: standaloneStrings.QuickOutlineNLS.quickOutlineActionLabel, prefix: gotoSymbolQuickAccess.AbstractGotoSymbolQuickAccessProvider.PREFIX, needsEditor: true },
    { description: standaloneStrings.QuickOutlineNLS.quickOutlineByCategoryActionLabel, prefix: gotoSymbolQuickAccess.AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY, needsEditor: true }
  ]
});
class GotoLineAction extends editorExtensions.EditorAction {
  constructor() {
    super({
      id: "editor.action.quickOutline",
      label: standaloneStrings.QuickOutlineNLS.quickOutlineActionLabel,
      alias: "Go to Symbol...",
      precondition: editorContextKeys.EditorContextKeys.hasDocumentSymbolProvider,
      kbOpts: {
        kbExpr: editorContextKeys.EditorContextKeys.focus,
        primary: 2048 | 1024 | 45,
        weight: 100
        /* EditorContrib */
      },
      contextMenuOpts: {
        group: "navigation",
        order: 3
      }
    });
  }
  run(accessor) {
    accessor.get(quickInput.IQuickInputService).quickAccess.show(gotoSymbolQuickAccess.AbstractGotoSymbolQuickAccessProvider.PREFIX);
  }
}
editorExtensions.registerEditorAction(GotoLineAction);
exports.GotoLineAction = GotoLineAction;
