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