monaco-editor-core 0.55.0-dev-20251009 → 0.55.0-dev-20251010

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/history.js.map +1 -1
  11. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  12. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  13. package/esm/vs/base/common/history.js.map +1 -1
  14. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  15. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  16. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +6 -11
  17. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  18. package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
  19. package/esm/vs/editor/browser/widget/markdownRenderer/browser/{markdownRenderer.js → editorMarkdownCodeBlockRenderer.js} +20 -59
  20. package/esm/vs/editor/browser/widget/markdownRenderer/browser/editorMarkdownCodeBlockRenderer.js.map +1 -0
  21. package/esm/vs/editor/common/config/editorConfiguration.js.map +1 -1
  22. package/esm/vs/editor/common/config/editorZoom.js.map +1 -1
  23. package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
  24. package/esm/vs/editor/common/editorCommon.js.map +1 -1
  25. package/esm/vs/editor/common/languages/language.js.map +1 -1
  26. package/esm/vs/editor/common/languages/languageConfigurationRegistry.js.map +1 -1
  27. package/esm/vs/editor/common/languages.js.map +1 -1
  28. package/esm/vs/editor/common/textModelBracketPairs.js.map +1 -1
  29. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -2
  30. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  31. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +2 -2
  32. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  33. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +1 -1
  34. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js.map +1 -1
  35. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  36. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js.map +1 -1
  37. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  38. package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
  39. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +2 -2
  40. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  41. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  42. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js.map +1 -1
  43. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  44. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  45. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  46. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js.map +1 -1
  47. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +1 -1
  48. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  49. package/esm/vs/editor/editor.api.d.ts +5 -4
  50. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +10 -5
  51. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  52. package/esm/vs/platform/actions/browser/actionViewItemService.js.map +1 -1
  53. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +16 -13
  54. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  55. package/esm/vs/platform/actions/common/actions.js +1 -0
  56. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  57. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  58. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  59. package/esm/vs/platform/keybinding/common/keybinding.js.map +1 -1
  60. package/esm/vs/platform/log/common/log.js.map +1 -1
  61. package/esm/vs/platform/markdown/browser/markdownRenderer.js +72 -0
  62. package/esm/vs/platform/markdown/browser/markdownRenderer.js.map +1 -0
  63. package/esm/vs/platform/quickinput/browser/quickInput.js +20 -10
  64. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  65. package/esm/vs/platform/quickinput/browser/quickInputController.js +1 -0
  66. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  67. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  68. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  69. package/esm/vs/platform/workspace/common/workspaceTrust.js.map +1 -1
  70. package/monaco.d.ts +5 -4
  71. package/package.json +2 -2
  72. package/version.txt +1 -1
  73. package/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/editorCommon.ts","vs/editor/common/editorCommon.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA+jBhG;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,uBAAuB;CACpC,CAAC","file":"editorCommon.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../base/common/event.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { URI } from '../../base/common/uri.js';\nimport { IEditorOptions } from './config/editorOptions.js';\nimport { IDimension } from './core/2d/dimension.js';\nimport { IPosition, Position } from './core/position.js';\nimport { IRange, Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation } from './model.js';\nimport { IModelDecorationsChangedEvent } from './textModelEvents.js';\nimport { ICommandMetadata } from '../../platform/commands/common/commands.js';\n\n/**\n * A builder and helper for edit operations for a command.\n */\nexport interface IEditOperationBuilder {\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Track `selection` when applying edit operations.\n\t * A best effort will be made to not grow/expand the selection.\n\t * An empty selection will clamp to a nearby character.\n\t * @param selection The selection to track.\n\t * @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection\n\t * should clamp to the previous or the next character.\n\t * @return A unique identifier.\n\t */\n\ttrackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;\n}\n\n/**\n * A helper for computing cursor state after a command.\n */\nexport interface ICursorStateComputerData {\n\t/**\n\t * Get the inverse edit operations of the added edit operations.\n\t */\n\tgetInverseEditOperations(): IValidEditOperation[];\n\t/**\n\t * Get a previously tracked selection.\n\t * @param id The unique identifier returned by `trackSelection`.\n\t * @return The selection.\n\t */\n\tgetTrackedSelection(id: string): Selection;\n}\n\n/**\n * A command that modifies text / cursor state on a model.\n */\nexport interface ICommand {\n\n\t/**\n\t * Signal that this command is inserting automatic whitespace that should be trimmed if possible.\n\t * @internal\n\t */\n\treadonly insertsAutoWhitespace?: boolean;\n\n\t/**\n\t * Get the edit operations needed to execute this command.\n\t * @param model The model the command will execute on.\n\t * @param builder A helper to collect the needed edit operations and to track selections.\n\t */\n\tgetEditOperations(model: ITextModel, builder: IEditOperationBuilder): void;\n\n\t/**\n\t * Compute the cursor state after the edit operations were applied.\n\t * @param model The model the command has executed on.\n\t * @param helper A helper to get inverse edit operations and to get previously tracked selections.\n\t * @return The cursor state after the command executed.\n\t */\n\tcomputeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection;\n}\n\n/**\n * A model for the diff editor.\n */\nexport interface IDiffEditorModel {\n\t/**\n\t * Original model.\n\t */\n\toriginal: ITextModel;\n\t/**\n\t * Modified model.\n\t */\n\tmodified: ITextModel;\n}\n\nexport interface IDiffEditorViewModel extends IDisposable {\n\treadonly model: IDiffEditorModel;\n\n\twaitForDiff(): Promise<void>;\n}\n\n/**\n * An event describing that an editor has had its model reset (i.e. `editor.setModel()`).\n */\nexport interface IModelChangedEvent {\n\t/**\n\t * The `uri` of the previous model or null.\n\t */\n\treadonly oldModelUrl: URI | null;\n\t/**\n\t * The `uri` of the new model or null.\n\t */\n\treadonly newModelUrl: URI | null;\n}\n\n// --- view\n\nexport interface IScrollEvent {\n\treadonly scrollTop: number;\n\treadonly scrollLeft: number;\n\treadonly scrollWidth: number;\n\treadonly scrollHeight: number;\n\n\treadonly scrollTopChanged: boolean;\n\treadonly scrollLeftChanged: boolean;\n\treadonly scrollWidthChanged: boolean;\n\treadonly scrollHeightChanged: boolean;\n}\n\nexport interface IContentSizeChangedEvent {\n\treadonly contentWidth: number;\n\treadonly contentHeight: number;\n\n\treadonly contentWidthChanged: boolean;\n\treadonly contentHeightChanged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITriggerEditorOperationEvent {\n\tsource: string | null | undefined;\n\thandlerId: string;\n\tpayload: unknown;\n}\n\nexport interface INewScrollPosition {\n\tscrollLeft?: number;\n\tscrollTop?: number;\n}\n\nexport interface IEditorAction {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly alias: string;\n\treadonly metadata: ICommandMetadata | undefined;\n\tisSupported(): boolean;\n\trun(args?: unknown): Promise<void>;\n}\n\nexport type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;\n\n/**\n * A (serializable) state of the cursors.\n */\nexport interface ICursorState {\n\tinSelectionMode: boolean;\n\tselectionStart: IPosition;\n\tposition: IPosition;\n}\n/**\n * A (serializable) state of the view.\n */\nexport interface IViewState {\n\t/** written by previous versions */\n\tscrollTop?: number;\n\t/** written by previous versions */\n\tscrollTopWithoutViewZones?: number;\n\tscrollLeft: number;\n\tfirstPosition: IPosition;\n\tfirstPositionDeltaTop: number;\n}\n/**\n * A (serializable) state of the code editor.\n */\nexport interface ICodeEditorViewState {\n\tcursorState: ICursorState[];\n\tviewState: IViewState;\n\tcontributionsState: { [id: string]: unknown };\n}\n/**\n * (Serializable) View state for the diff editor.\n */\nexport interface IDiffEditorViewState {\n\toriginal: ICodeEditorViewState | null;\n\tmodified: ICodeEditorViewState | null;\n\tmodelState?: unknown;\n}\n/**\n * An editor view state.\n */\nexport type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;\n\nexport const enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1,\n}\n\n/**\n * An editor.\n */\nexport interface IEditor {\n\t/**\n\t * An event emitted when the editor has been disposed.\n\t * @event\n\t */\n\tonDidDispose(listener: () => void): IDisposable;\n\n\t/**\n\t * Dispose the editor.\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Get a unique id for this editor instance.\n\t */\n\tgetId(): string;\n\n\t/**\n\t * Get the editor type. Please see `EditorType`.\n\t * This is to avoid an instanceof check\n\t */\n\tgetEditorType(): string;\n\n\t/**\n\t * Update the editor's options after the editor has been created.\n\t */\n\tupdateOptions(newOptions: IEditorOptions): void;\n\n\t/**\n\t * Instructs the editor to remeasure its container. This method should\n\t * be called when the container of the editor gets resized.\n\t *\n\t * If a dimension is passed in, the passed in value will be used.\n\t *\n\t * By default, this will also render the editor immediately.\n\t * If you prefer to delay rendering to the next animation frame, use postponeRendering == true.\n\t */\n\tlayout(dimension?: IDimension, postponeRendering?: boolean): void;\n\n\t/**\n\t * Brings browser focus to the editor text\n\t */\n\tfocus(): void;\n\n\t/**\n\t * Returns true if the text inside this editor is focused (i.e. cursor is blinking).\n\t */\n\thasTextFocus(): boolean;\n\n\t/**\n\t * Returns all actions associated with this editor.\n\t */\n\tgetSupportedActions(): IEditorAction[];\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): IEditorViewState | null;\n\n\t/**\n\t * Restores the view state of the editor from a serializable object generated by `saveViewState`.\n\t */\n\trestoreViewState(state: IEditorViewState | null): void;\n\n\t/**\n\t * Given a position, returns a column number that takes tab-widths into account.\n\t */\n\tgetVisibleColumnFromPosition(position: IPosition): number;\n\n\t/**\n\t * Returns the primary position of the cursor.\n\t */\n\tgetPosition(): Position | null;\n\n\t/**\n\t * Set the primary position of the cursor. This will remove any secondary cursors.\n\t * @param position New primary cursor's position\n\t * @param source Source of the call that caused the position\n\t */\n\tsetPosition(position: IPosition, source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line.\n\t */\n\trevealLine(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically.\n\t */\n\trevealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.\n\t */\n\trevealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position.\n\t */\n\trevealPosition(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically.\n\t */\n\trevealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.\n\t */\n\trevealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Returns the primary selection of the editor.\n\t */\n\tgetSelection(): Selection | null;\n\n\t/**\n\t * Returns all the selections of the editor.\n\t */\n\tgetSelections(): Selection[] | null;\n\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: IRange, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Range, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: ISelection, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Selection, source?: string): void;\n\n\t/**\n\t * Set the selections for all the cursors of the editor.\n\t * Cursors will be removed or added, as necessary.\n\t * @param selections The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelections(selections: readonly ISelection[], source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines.\n\t */\n\trevealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically.\n\t */\n\trevealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.\n\t */\n\trevealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range.\n\t */\n\trevealRange(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically.\n\t */\n\trevealRangeInCenter(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.\n\t */\n\trevealRangeAtTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.\n\t */\n\trevealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealRangeNearTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition. Only if it lies outside the viewport.\n\t */\n\trevealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Directly trigger a handler or an editor action.\n\t * @param source The source of the call.\n\t * @param handlerId The id of the handler or the id of a contribution.\n\t * @param payload Extra data to be sent to the handler.\n\t */\n\ttrigger(source: string | null | undefined, handlerId: string, payload: unknown): void;\n\n\t/**\n\t * Gets the current model attached to this editor.\n\t */\n\tgetModel(): IEditorModel | null;\n\n\t/**\n\t * Sets the current model attached to this editor.\n\t * If the previous model was created by the editor via the value key in the options\n\t * literal object, it will be destroyed. Otherwise, if the previous model was set\n\t * via setModel, or the model key in the options literal object, the previous model\n\t * will not be destroyed.\n\t * It is safe to call setModel(null) to simply detach the current model from the editor.\n\t */\n\tsetModel(model: IEditorModel | null): void;\n\n\t/**\n\t * Create a collection of decorations. All decorations added through this collection\n\t * will get the ownerId of the editor (meaning they will not show up in other editors).\n\t * These decorations will be automatically cleared when the editor's model changes.\n\t */\n\tcreateDecorationsCollection(decorations?: IModelDeltaDecoration[]): IEditorDecorationsCollection;\n\n\t/**\n\t * Change the decorations. All decorations added through this changeAccessor\n\t * will get the ownerId of the editor (meaning they will not show up in other\n\t * editors).\n\t * @see {@link ITextModel.changeDecorations}\n\t * @internal\n\t */\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;\n}\n\n/**\n * A diff editor.\n *\n * @internal\n */\nexport interface IDiffEditor extends IEditor {\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): IDiffEditorModel | null;\n}\n\n/**\n * @internal\n */\nexport interface ICompositeCodeEditor {\n\n\t/**\n\t * An event that signals that the active editor has changed\n\t */\n\treadonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;\n\n\t/**\n\t * The active code editor iff any\n\t */\n\treadonly activeCodeEditor: IEditor | undefined;\n\t// readonly editors: readonly ICodeEditor[] maybe supported with uris\n}\n\n/**\n * A collection of decorations\n */\nexport interface IEditorDecorationsCollection {\n\t/**\n\t * An event emitted when decorations change in the editor,\n\t * but the change is not caused by us setting or clearing the collection.\n\t */\n\tonDidChange: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * Get the decorations count.\n\t */\n\tlength: number;\n\t/**\n\t * Get the range for a decoration.\n\t */\n\tgetRange(index: number): Range | null;\n\t/**\n\t * Get all ranges for decorations.\n\t */\n\tgetRanges(): Range[];\n\t/**\n\t * Determine if a decoration is in this collection.\n\t */\n\thas(decoration: IModelDecoration): boolean;\n\t/**\n\t * Replace all previous decorations with `newDecorations`.\n\t */\n\tset(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Append `newDecorations` to this collection.\n\t */\n\tappend(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Remove all previous decorations.\n\t */\n\tclear(): void;\n}\n\n/**\n * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.\n */\nexport interface IEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n\t/**\n\t * Store view state.\n\t */\n\tsaveViewState?(): unknown;\n\t/**\n\t * Restore view state.\n\t */\n\trestoreViewState?(state: unknown): void;\n}\n\n/**\n * A diff editor contribution that gets created every time a new diffeditor gets created and gets disposed when the diff editor gets disposed.\n * @internal\n */\nexport interface IDiffEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The type of the `IEditor`.\n */\nexport const EditorType = {\n\tICodeEditor: 'vs.editor.ICodeEditor',\n\tIDiffEditor: 'vs.editor.IDiffEditor'\n};\n\n/**\n * Built-in commands.\n * @internal\n */\nexport const enum Handler {\n\tCompositionStart = 'compositionStart',\n\tCompositionEnd = 'compositionEnd',\n\tType = 'type',\n\tReplacePreviousChar = 'replacePreviousChar',\n\tCompositionType = 'compositionType',\n\tPaste = 'paste',\n\tCut = 'cut',\n}\n\n/**\n * @internal\n */\nexport interface TypePayload {\n\ttext: string;\n}\n\n/**\n * @internal\n */\nexport interface ReplacePreviousCharPayload {\n\ttext: string;\n\treplaceCharCnt: number;\n}\n\n/**\n * @internal\n */\nexport interface CompositionTypePayload {\n\ttext: string;\n\treplacePrevCharCnt: number;\n\treplaceNextCharCnt: number;\n\tpositionDelta: number;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../base/common/event.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { URI } from '../../base/common/uri.js';\nimport { IEditorOptions } from './config/editorOptions.js';\nimport { IDimension } from './core/2d/dimension.js';\nimport { IPosition, Position } from './core/position.js';\nimport { IRange, Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation } from './model.js';\nimport { IModelDecorationsChangedEvent } from './textModelEvents.js';\nimport { ICommandMetadata } from '../../platform/commands/common/commands.js';\n\n/**\n * A builder and helper for edit operations for a command.\n */\nexport interface IEditOperationBuilder {\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Track `selection` when applying edit operations.\n\t * A best effort will be made to not grow/expand the selection.\n\t * An empty selection will clamp to a nearby character.\n\t * @param selection The selection to track.\n\t * @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection\n\t * should clamp to the previous or the next character.\n\t * @return A unique identifier.\n\t */\n\ttrackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;\n}\n\n/**\n * A helper for computing cursor state after a command.\n */\nexport interface ICursorStateComputerData {\n\t/**\n\t * Get the inverse edit operations of the added edit operations.\n\t */\n\tgetInverseEditOperations(): IValidEditOperation[];\n\t/**\n\t * Get a previously tracked selection.\n\t * @param id The unique identifier returned by `trackSelection`.\n\t * @return The selection.\n\t */\n\tgetTrackedSelection(id: string): Selection;\n}\n\n/**\n * A command that modifies text / cursor state on a model.\n */\nexport interface ICommand {\n\n\t/**\n\t * Signal that this command is inserting automatic whitespace that should be trimmed if possible.\n\t * @internal\n\t */\n\treadonly insertsAutoWhitespace?: boolean;\n\n\t/**\n\t * Get the edit operations needed to execute this command.\n\t * @param model The model the command will execute on.\n\t * @param builder A helper to collect the needed edit operations and to track selections.\n\t */\n\tgetEditOperations(model: ITextModel, builder: IEditOperationBuilder): void;\n\n\t/**\n\t * Compute the cursor state after the edit operations were applied.\n\t * @param model The model the command has executed on.\n\t * @param helper A helper to get inverse edit operations and to get previously tracked selections.\n\t * @return The cursor state after the command executed.\n\t */\n\tcomputeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection;\n}\n\n/**\n * A model for the diff editor.\n */\nexport interface IDiffEditorModel {\n\t/**\n\t * Original model.\n\t */\n\toriginal: ITextModel;\n\t/**\n\t * Modified model.\n\t */\n\tmodified: ITextModel;\n}\n\nexport interface IDiffEditorViewModel extends IDisposable {\n\treadonly model: IDiffEditorModel;\n\n\twaitForDiff(): Promise<void>;\n}\n\n/**\n * An event describing that an editor has had its model reset (i.e. `editor.setModel()`).\n */\nexport interface IModelChangedEvent {\n\t/**\n\t * The `uri` of the previous model or null.\n\t */\n\treadonly oldModelUrl: URI | null;\n\t/**\n\t * The `uri` of the new model or null.\n\t */\n\treadonly newModelUrl: URI | null;\n}\n\n// --- view\n\nexport interface IScrollEvent {\n\treadonly scrollTop: number;\n\treadonly scrollLeft: number;\n\treadonly scrollWidth: number;\n\treadonly scrollHeight: number;\n\n\treadonly scrollTopChanged: boolean;\n\treadonly scrollLeftChanged: boolean;\n\treadonly scrollWidthChanged: boolean;\n\treadonly scrollHeightChanged: boolean;\n}\n\nexport interface IContentSizeChangedEvent {\n\treadonly contentWidth: number;\n\treadonly contentHeight: number;\n\n\treadonly contentWidthChanged: boolean;\n\treadonly contentHeightChanged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITriggerEditorOperationEvent {\n\tsource: string | null | undefined;\n\thandlerId: string;\n\tpayload: unknown;\n}\n\nexport interface INewScrollPosition {\n\tscrollLeft?: number;\n\tscrollTop?: number;\n}\n\nexport interface IEditorAction {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly alias: string;\n\treadonly metadata: ICommandMetadata | undefined;\n\tisSupported(): boolean;\n\trun(args?: unknown): Promise<void>;\n}\n\nexport type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;\n\n/**\n * A (serializable) state of the cursors.\n */\nexport interface ICursorState {\n\tinSelectionMode: boolean;\n\tselectionStart: IPosition;\n\tposition: IPosition;\n}\n/**\n * A (serializable) state of the view.\n */\nexport interface IViewState {\n\t/** written by previous versions */\n\tscrollTop?: number;\n\t/** written by previous versions */\n\tscrollTopWithoutViewZones?: number;\n\tscrollLeft: number;\n\tfirstPosition: IPosition;\n\tfirstPositionDeltaTop: number;\n}\n/**\n * A (serializable) state of the code editor.\n */\nexport interface ICodeEditorViewState {\n\tcursorState: ICursorState[];\n\tviewState: IViewState;\n\tcontributionsState: { [id: string]: unknown };\n}\n/**\n * (Serializable) View state for the diff editor.\n */\nexport interface IDiffEditorViewState {\n\toriginal: ICodeEditorViewState | null;\n\tmodified: ICodeEditorViewState | null;\n\tmodelState?: unknown;\n}\n/**\n * An editor view state.\n */\nexport type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;\n\nexport const enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1,\n}\n\n/**\n * An editor.\n */\nexport interface IEditor {\n\t/**\n\t * An event emitted when the editor has been disposed.\n\t * @event\n\t */\n\tonDidDispose(listener: () => void): IDisposable;\n\n\t/**\n\t * Dispose the editor.\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Get a unique id for this editor instance.\n\t */\n\tgetId(): string;\n\n\t/**\n\t * Get the editor type. Please see `EditorType`.\n\t * This is to avoid an instanceof check\n\t */\n\tgetEditorType(): string;\n\n\t/**\n\t * Update the editor's options after the editor has been created.\n\t */\n\tupdateOptions(newOptions: IEditorOptions): void;\n\n\t/**\n\t * Instructs the editor to remeasure its container. This method should\n\t * be called when the container of the editor gets resized.\n\t *\n\t * If a dimension is passed in, the passed in value will be used.\n\t *\n\t * By default, this will also render the editor immediately.\n\t * If you prefer to delay rendering to the next animation frame, use postponeRendering == true.\n\t */\n\tlayout(dimension?: IDimension, postponeRendering?: boolean): void;\n\n\t/**\n\t * Brings browser focus to the editor text\n\t */\n\tfocus(): void;\n\n\t/**\n\t * Returns true if the text inside this editor is focused (i.e. cursor is blinking).\n\t */\n\thasTextFocus(): boolean;\n\n\t/**\n\t * Returns all actions associated with this editor.\n\t */\n\tgetSupportedActions(): IEditorAction[];\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): IEditorViewState | null;\n\n\t/**\n\t * Restores the view state of the editor from a serializable object generated by `saveViewState`.\n\t */\n\trestoreViewState(state: IEditorViewState | null): void;\n\n\t/**\n\t * Given a position, returns a column number that takes tab-widths into account.\n\t */\n\tgetVisibleColumnFromPosition(position: IPosition): number;\n\n\t/**\n\t * Returns the primary position of the cursor.\n\t */\n\tgetPosition(): Position | null;\n\n\t/**\n\t * Set the primary position of the cursor. This will remove any secondary cursors.\n\t * @param position New primary cursor's position\n\t * @param source Source of the call that caused the position\n\t */\n\tsetPosition(position: IPosition, source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line.\n\t */\n\trevealLine(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically.\n\t */\n\trevealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.\n\t */\n\trevealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position.\n\t */\n\trevealPosition(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically.\n\t */\n\trevealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.\n\t */\n\trevealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Returns the primary selection of the editor.\n\t */\n\tgetSelection(): Selection | null;\n\n\t/**\n\t * Returns all the selections of the editor.\n\t */\n\tgetSelections(): Selection[] | null;\n\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: IRange, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Range, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: ISelection, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Selection, source?: string): void;\n\n\t/**\n\t * Set the selections for all the cursors of the editor.\n\t * Cursors will be removed or added, as necessary.\n\t * @param selections The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelections(selections: readonly ISelection[], source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines.\n\t */\n\trevealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically.\n\t */\n\trevealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.\n\t */\n\trevealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range.\n\t */\n\trevealRange(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically.\n\t */\n\trevealRangeInCenter(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.\n\t */\n\trevealRangeAtTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.\n\t */\n\trevealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealRangeNearTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition. Only if it lies outside the viewport.\n\t */\n\trevealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Directly trigger a handler or an editor action.\n\t * @param source The source of the call.\n\t * @param handlerId The id of the handler or the id of a contribution.\n\t * @param payload Extra data to be sent to the handler.\n\t */\n\ttrigger(source: string | null | undefined, handlerId: string, payload: unknown): void;\n\n\t/**\n\t * Gets the current model attached to this editor.\n\t */\n\tgetModel(): IEditorModel | null;\n\n\t/**\n\t * Sets the current model attached to this editor.\n\t * If the previous model was created by the editor via the value key in the options\n\t * literal object, it will be destroyed. Otherwise, if the previous model was set\n\t * via setModel, or the model key in the options literal object, the previous model\n\t * will not be destroyed.\n\t * It is safe to call setModel(null) to simply detach the current model from the editor.\n\t */\n\tsetModel(model: IEditorModel | null): void;\n\n\t/**\n\t * Create a collection of decorations. All decorations added through this collection\n\t * will get the ownerId of the editor (meaning they will not show up in other editors).\n\t * These decorations will be automatically cleared when the editor's model changes.\n\t */\n\tcreateDecorationsCollection(decorations?: IModelDeltaDecoration[]): IEditorDecorationsCollection;\n\n\t/**\n\t * Change the decorations. All decorations added through this changeAccessor\n\t * will get the ownerId of the editor (meaning they will not show up in other\n\t * editors).\n\t * @see {@link ITextModel.changeDecorations}\n\t * @internal\n\t */\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;\n}\n\n/**\n * A diff editor.\n *\n * @internal\n */\nexport interface IDiffEditor extends IEditor {\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): IDiffEditorModel | null;\n}\n\n/**\n * @internal\n */\nexport interface ICompositeCodeEditor {\n\n\t/**\n\t * An event that signals that the active editor has changed\n\t */\n\treadonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;\n\n\t/**\n\t * The active code editor iff any\n\t */\n\treadonly activeCodeEditor: IEditor | undefined;\n\t// readonly editors: readonly ICodeEditor[] maybe supported with uris\n}\n\n/**\n * A collection of decorations\n */\nexport interface IEditorDecorationsCollection {\n\t/**\n\t * An event emitted when decorations change in the editor,\n\t * but the change is not caused by us setting or clearing the collection.\n\t */\n\tonDidChange: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * Get the decorations count.\n\t */\n\tlength: number;\n\t/**\n\t * Get the range for a decoration.\n\t */\n\tgetRange(index: number): Range | null;\n\t/**\n\t * Get all ranges for decorations.\n\t */\n\tgetRanges(): Range[];\n\t/**\n\t * Determine if a decoration is in this collection.\n\t */\n\thas(decoration: IModelDecoration): boolean;\n\t/**\n\t * Replace all previous decorations with `newDecorations`.\n\t */\n\tset(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Append `newDecorations` to this collection.\n\t */\n\tappend(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Remove all previous decorations.\n\t */\n\tclear(): void;\n}\n\n/**\n * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.\n */\nexport interface IEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n\t/**\n\t * Store view state.\n\t */\n\tsaveViewState?(): unknown;\n\t/**\n\t * Restore view state.\n\t */\n\trestoreViewState?(state: unknown): void;\n}\n\n/**\n * A diff editor contribution that gets created every time a new diffeditor gets created and gets disposed when the diff editor gets disposed.\n * @internal\n */\nexport interface IDiffEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The type of the `IEditor`.\n */\nexport const EditorType = {\n\tICodeEditor: 'vs.editor.ICodeEditor',\n\tIDiffEditor: 'vs.editor.IDiffEditor'\n};\n\n/**\n * Built-in commands.\n * @internal\n */\nexport const enum Handler {\n\tCompositionStart = 'compositionStart',\n\tCompositionEnd = 'compositionEnd',\n\tType = 'type',\n\tReplacePreviousChar = 'replacePreviousChar',\n\tCompositionType = 'compositionType',\n\tPaste = 'paste',\n\tCut = 'cut',\n}\n\n/**\n * @internal\n */\nexport interface TypePayload {\n\ttext: string;\n}\n\n/**\n * @internal\n */\nexport interface ReplacePreviousCharPayload {\n\ttext: string;\n\treplaceCharCnt: number;\n}\n\n/**\n * @internal\n */\nexport interface CompositionTypePayload {\n\ttext: string;\n\treplacePrevCharCnt: number;\n\treplaceNextCharCnt: number;\n\tpositionDelta: number;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/editorCommon.ts","vs/editor/common/editorCommon.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA+jBhG;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,uBAAuB;CACpC,CAAC","file":"editorCommon.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../base/common/event.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { URI } from '../../base/common/uri.js';\nimport { IEditorOptions } from './config/editorOptions.js';\nimport { IDimension } from './core/2d/dimension.js';\nimport { IPosition, Position } from './core/position.js';\nimport { IRange, Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation } from './model.js';\nimport { IModelDecorationsChangedEvent } from './textModelEvents.js';\nimport { ICommandMetadata } from '../../platform/commands/common/commands.js';\n\n/**\n * A builder and helper for edit operations for a command.\n */\nexport interface IEditOperationBuilder {\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Track `selection` when applying edit operations.\n\t * A best effort will be made to not grow/expand the selection.\n\t * An empty selection will clamp to a nearby character.\n\t * @param selection The selection to track.\n\t * @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection\n\t * should clamp to the previous or the next character.\n\t * @return A unique identifier.\n\t */\n\ttrackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;\n}\n\n/**\n * A helper for computing cursor state after a command.\n */\nexport interface ICursorStateComputerData {\n\t/**\n\t * Get the inverse edit operations of the added edit operations.\n\t */\n\tgetInverseEditOperations(): IValidEditOperation[];\n\t/**\n\t * Get a previously tracked selection.\n\t * @param id The unique identifier returned by `trackSelection`.\n\t * @return The selection.\n\t */\n\tgetTrackedSelection(id: string): Selection;\n}\n\n/**\n * A command that modifies text / cursor state on a model.\n */\nexport interface ICommand {\n\n\t/**\n\t * Signal that this command is inserting automatic whitespace that should be trimmed if possible.\n\t * @internal\n\t */\n\treadonly insertsAutoWhitespace?: boolean;\n\n\t/**\n\t * Get the edit operations needed to execute this command.\n\t * @param model The model the command will execute on.\n\t * @param builder A helper to collect the needed edit operations and to track selections.\n\t */\n\tgetEditOperations(model: ITextModel, builder: IEditOperationBuilder): void;\n\n\t/**\n\t * Compute the cursor state after the edit operations were applied.\n\t * @param model The model the command has executed on.\n\t * @param helper A helper to get inverse edit operations and to get previously tracked selections.\n\t * @return The cursor state after the command executed.\n\t */\n\tcomputeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection;\n}\n\n/**\n * A model for the diff editor.\n */\nexport interface IDiffEditorModel {\n\t/**\n\t * Original model.\n\t */\n\toriginal: ITextModel;\n\t/**\n\t * Modified model.\n\t */\n\tmodified: ITextModel;\n}\n\nexport interface IDiffEditorViewModel extends IDisposable {\n\treadonly model: IDiffEditorModel;\n\n\twaitForDiff(): Promise<void>;\n}\n\n/**\n * An event describing that an editor has had its model reset (i.e. `editor.setModel()`).\n */\nexport interface IModelChangedEvent {\n\t/**\n\t * The `uri` of the previous model or null.\n\t */\n\treadonly oldModelUrl: URI | null;\n\t/**\n\t * The `uri` of the new model or null.\n\t */\n\treadonly newModelUrl: URI | null;\n}\n\n// --- view\n\nexport interface IScrollEvent {\n\treadonly scrollTop: number;\n\treadonly scrollLeft: number;\n\treadonly scrollWidth: number;\n\treadonly scrollHeight: number;\n\n\treadonly scrollTopChanged: boolean;\n\treadonly scrollLeftChanged: boolean;\n\treadonly scrollWidthChanged: boolean;\n\treadonly scrollHeightChanged: boolean;\n}\n\nexport interface IContentSizeChangedEvent {\n\treadonly contentWidth: number;\n\treadonly contentHeight: number;\n\n\treadonly contentWidthChanged: boolean;\n\treadonly contentHeightChanged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITriggerEditorOperationEvent {\n\tsource: string | null | undefined;\n\thandlerId: string;\n\tpayload: unknown;\n}\n\nexport interface INewScrollPosition {\n\tscrollLeft?: number;\n\tscrollTop?: number;\n}\n\nexport interface IEditorAction {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly alias: string;\n\treadonly metadata: ICommandMetadata | undefined;\n\tisSupported(): boolean;\n\trun(args?: unknown): Promise<void>;\n}\n\nexport type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;\n\n/**\n * A (serializable) state of the cursors.\n */\nexport interface ICursorState {\n\tinSelectionMode: boolean;\n\tselectionStart: IPosition;\n\tposition: IPosition;\n}\n/**\n * A (serializable) state of the view.\n */\nexport interface IViewState {\n\t/** written by previous versions */\n\tscrollTop?: number;\n\t/** written by previous versions */\n\tscrollTopWithoutViewZones?: number;\n\tscrollLeft: number;\n\tfirstPosition: IPosition;\n\tfirstPositionDeltaTop: number;\n}\n/**\n * A (serializable) state of the code editor.\n */\nexport interface ICodeEditorViewState {\n\tcursorState: ICursorState[];\n\tviewState: IViewState;\n\tcontributionsState: { [id: string]: unknown };\n}\n/**\n * (Serializable) View state for the diff editor.\n */\nexport interface IDiffEditorViewState {\n\toriginal: ICodeEditorViewState | null;\n\tmodified: ICodeEditorViewState | null;\n\tmodelState?: unknown;\n}\n/**\n * An editor view state.\n */\nexport type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;\n\nexport const enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1,\n}\n\n/**\n * An editor.\n */\nexport interface IEditor {\n\t/**\n\t * An event emitted when the editor has been disposed.\n\t * @event\n\t */\n\tonDidDispose(listener: () => void): IDisposable;\n\n\t/**\n\t * Dispose the editor.\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Get a unique id for this editor instance.\n\t */\n\tgetId(): string;\n\n\t/**\n\t * Get the editor type. Please see `EditorType`.\n\t * This is to avoid an instanceof check\n\t */\n\tgetEditorType(): string;\n\n\t/**\n\t * Update the editor's options after the editor has been created.\n\t */\n\tupdateOptions(newOptions: IEditorOptions): void;\n\n\t/**\n\t * Instructs the editor to remeasure its container. This method should\n\t * be called when the container of the editor gets resized.\n\t *\n\t * If a dimension is passed in, the passed in value will be used.\n\t *\n\t * By default, this will also render the editor immediately.\n\t * If you prefer to delay rendering to the next animation frame, use postponeRendering == true.\n\t */\n\tlayout(dimension?: IDimension, postponeRendering?: boolean): void;\n\n\t/**\n\t * Brings browser focus to the editor text\n\t */\n\tfocus(): void;\n\n\t/**\n\t * Returns true if the text inside this editor is focused (i.e. cursor is blinking).\n\t */\n\thasTextFocus(): boolean;\n\n\t/**\n\t * Returns all actions associated with this editor.\n\t */\n\tgetSupportedActions(): IEditorAction[];\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): IEditorViewState | null;\n\n\t/**\n\t * Restores the view state of the editor from a serializable object generated by `saveViewState`.\n\t */\n\trestoreViewState(state: IEditorViewState | null): void;\n\n\t/**\n\t * Given a position, returns a column number that takes tab-widths into account.\n\t */\n\tgetVisibleColumnFromPosition(position: IPosition): number;\n\n\t/**\n\t * Returns the primary position of the cursor.\n\t */\n\tgetPosition(): Position | null;\n\n\t/**\n\t * Set the primary position of the cursor. This will remove any secondary cursors.\n\t * @param position New primary cursor's position\n\t * @param source Source of the call that caused the position\n\t */\n\tsetPosition(position: IPosition, source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line.\n\t */\n\trevealLine(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically.\n\t */\n\trevealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.\n\t */\n\trevealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position.\n\t */\n\trevealPosition(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically.\n\t */\n\trevealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.\n\t */\n\trevealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Returns the primary selection of the editor.\n\t */\n\tgetSelection(): Selection | null;\n\n\t/**\n\t * Returns all the selections of the editor.\n\t */\n\tgetSelections(): Selection[] | null;\n\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: IRange, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Range, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: ISelection, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Selection, source?: string): void;\n\n\t/**\n\t * Set the selections for all the cursors of the editor.\n\t * Cursors will be removed or added, as necessary.\n\t * @param selections The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelections(selections: readonly ISelection[], source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines.\n\t */\n\trevealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically.\n\t */\n\trevealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.\n\t */\n\trevealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range.\n\t */\n\trevealRange(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically.\n\t */\n\trevealRangeInCenter(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.\n\t */\n\trevealRangeAtTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.\n\t */\n\trevealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealRangeNearTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition. Only if it lies outside the viewport.\n\t */\n\trevealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Directly trigger a handler or an editor action.\n\t * @param source The source of the call.\n\t * @param handlerId The id of the handler or the id of a contribution.\n\t * @param payload Extra data to be sent to the handler.\n\t */\n\ttrigger(source: string | null | undefined, handlerId: string, payload: unknown): void;\n\n\t/**\n\t * Gets the current model attached to this editor.\n\t */\n\tgetModel(): IEditorModel | null;\n\n\t/**\n\t * Sets the current model attached to this editor.\n\t * If the previous model was created by the editor via the value key in the options\n\t * literal object, it will be destroyed. Otherwise, if the previous model was set\n\t * via setModel, or the model key in the options literal object, the previous model\n\t * will not be destroyed.\n\t * It is safe to call setModel(null) to simply detach the current model from the editor.\n\t */\n\tsetModel(model: IEditorModel | null): void;\n\n\t/**\n\t * Create a collection of decorations. All decorations added through this collection\n\t * will get the ownerId of the editor (meaning they will not show up in other editors).\n\t * These decorations will be automatically cleared when the editor's model changes.\n\t */\n\tcreateDecorationsCollection(decorations?: IModelDeltaDecoration[]): IEditorDecorationsCollection;\n\n\t/**\n\t * Change the decorations. All decorations added through this changeAccessor\n\t * will get the ownerId of the editor (meaning they will not show up in other\n\t * editors).\n\t * @see {@link ITextModel.changeDecorations}\n\t * @internal\n\t */\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;\n}\n\n/**\n * A diff editor.\n *\n * @internal\n */\nexport interface IDiffEditor extends IEditor {\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): IDiffEditorModel | null;\n}\n\n/**\n * @internal\n */\nexport interface ICompositeCodeEditor {\n\n\t/**\n\t * An event that signals that the active editor has changed\n\t */\n\treadonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;\n\n\t/**\n\t * The active code editor iff any\n\t */\n\treadonly activeCodeEditor: IEditor | undefined;\n\t// readonly editors: readonly ICodeEditor[] maybe supported with uris\n}\n\n/**\n * A collection of decorations\n */\nexport interface IEditorDecorationsCollection {\n\t/**\n\t * An event emitted when decorations change in the editor,\n\t * but the change is not caused by us setting or clearing the collection.\n\t */\n\treadonly onDidChange: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * Get the decorations count.\n\t */\n\tlength: number;\n\t/**\n\t * Get the range for a decoration.\n\t */\n\tgetRange(index: number): Range | null;\n\t/**\n\t * Get all ranges for decorations.\n\t */\n\tgetRanges(): Range[];\n\t/**\n\t * Determine if a decoration is in this collection.\n\t */\n\thas(decoration: IModelDecoration): boolean;\n\t/**\n\t * Replace all previous decorations with `newDecorations`.\n\t */\n\tset(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Append `newDecorations` to this collection.\n\t */\n\tappend(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Remove all previous decorations.\n\t */\n\tclear(): void;\n}\n\n/**\n * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.\n */\nexport interface IEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n\t/**\n\t * Store view state.\n\t */\n\tsaveViewState?(): unknown;\n\t/**\n\t * Restore view state.\n\t */\n\trestoreViewState?(state: unknown): void;\n}\n\n/**\n * A diff editor contribution that gets created every time a new diffeditor gets created and gets disposed when the diff editor gets disposed.\n * @internal\n */\nexport interface IDiffEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The type of the `IEditor`.\n */\nexport const EditorType = {\n\tICodeEditor: 'vs.editor.ICodeEditor',\n\tIDiffEditor: 'vs.editor.IDiffEditor'\n};\n\n/**\n * Built-in commands.\n * @internal\n */\nexport const enum Handler {\n\tCompositionStart = 'compositionStart',\n\tCompositionEnd = 'compositionEnd',\n\tType = 'type',\n\tReplacePreviousChar = 'replacePreviousChar',\n\tCompositionType = 'compositionType',\n\tPaste = 'paste',\n\tCut = 'cut',\n}\n\n/**\n * @internal\n */\nexport interface TypePayload {\n\ttext: string;\n}\n\n/**\n * @internal\n */\nexport interface ReplacePreviousCharPayload {\n\ttext: string;\n\treplaceCharCnt: number;\n}\n\n/**\n * @internal\n */\nexport interface CompositionTypePayload {\n\ttext: string;\n\treplacePrevCharCnt: number;\n\treplaceNextCharCnt: number;\n\tpositionDelta: number;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../base/common/event.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { URI } from '../../base/common/uri.js';\nimport { IEditorOptions } from './config/editorOptions.js';\nimport { IDimension } from './core/2d/dimension.js';\nimport { IPosition, Position } from './core/position.js';\nimport { IRange, Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation } from './model.js';\nimport { IModelDecorationsChangedEvent } from './textModelEvents.js';\nimport { ICommandMetadata } from '../../platform/commands/common/commands.js';\n\n/**\n * A builder and helper for edit operations for a command.\n */\nexport interface IEditOperationBuilder {\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Add a new edit operation (a replace operation).\n\t * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`\n\t * @param range The range to replace (delete). May be empty to represent a simple insert.\n\t * @param text The text to replace with. May be null to represent a simple delete.\n\t */\n\taddTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;\n\n\t/**\n\t * Track `selection` when applying edit operations.\n\t * A best effort will be made to not grow/expand the selection.\n\t * An empty selection will clamp to a nearby character.\n\t * @param selection The selection to track.\n\t * @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection\n\t * should clamp to the previous or the next character.\n\t * @return A unique identifier.\n\t */\n\ttrackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;\n}\n\n/**\n * A helper for computing cursor state after a command.\n */\nexport interface ICursorStateComputerData {\n\t/**\n\t * Get the inverse edit operations of the added edit operations.\n\t */\n\tgetInverseEditOperations(): IValidEditOperation[];\n\t/**\n\t * Get a previously tracked selection.\n\t * @param id The unique identifier returned by `trackSelection`.\n\t * @return The selection.\n\t */\n\tgetTrackedSelection(id: string): Selection;\n}\n\n/**\n * A command that modifies text / cursor state on a model.\n */\nexport interface ICommand {\n\n\t/**\n\t * Signal that this command is inserting automatic whitespace that should be trimmed if possible.\n\t * @internal\n\t */\n\treadonly insertsAutoWhitespace?: boolean;\n\n\t/**\n\t * Get the edit operations needed to execute this command.\n\t * @param model The model the command will execute on.\n\t * @param builder A helper to collect the needed edit operations and to track selections.\n\t */\n\tgetEditOperations(model: ITextModel, builder: IEditOperationBuilder): void;\n\n\t/**\n\t * Compute the cursor state after the edit operations were applied.\n\t * @param model The model the command has executed on.\n\t * @param helper A helper to get inverse edit operations and to get previously tracked selections.\n\t * @return The cursor state after the command executed.\n\t */\n\tcomputeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection;\n}\n\n/**\n * A model for the diff editor.\n */\nexport interface IDiffEditorModel {\n\t/**\n\t * Original model.\n\t */\n\toriginal: ITextModel;\n\t/**\n\t * Modified model.\n\t */\n\tmodified: ITextModel;\n}\n\nexport interface IDiffEditorViewModel extends IDisposable {\n\treadonly model: IDiffEditorModel;\n\n\twaitForDiff(): Promise<void>;\n}\n\n/**\n * An event describing that an editor has had its model reset (i.e. `editor.setModel()`).\n */\nexport interface IModelChangedEvent {\n\t/**\n\t * The `uri` of the previous model or null.\n\t */\n\treadonly oldModelUrl: URI | null;\n\t/**\n\t * The `uri` of the new model or null.\n\t */\n\treadonly newModelUrl: URI | null;\n}\n\n// --- view\n\nexport interface IScrollEvent {\n\treadonly scrollTop: number;\n\treadonly scrollLeft: number;\n\treadonly scrollWidth: number;\n\treadonly scrollHeight: number;\n\n\treadonly scrollTopChanged: boolean;\n\treadonly scrollLeftChanged: boolean;\n\treadonly scrollWidthChanged: boolean;\n\treadonly scrollHeightChanged: boolean;\n}\n\nexport interface IContentSizeChangedEvent {\n\treadonly contentWidth: number;\n\treadonly contentHeight: number;\n\n\treadonly contentWidthChanged: boolean;\n\treadonly contentHeightChanged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITriggerEditorOperationEvent {\n\tsource: string | null | undefined;\n\thandlerId: string;\n\tpayload: unknown;\n}\n\nexport interface INewScrollPosition {\n\tscrollLeft?: number;\n\tscrollTop?: number;\n}\n\nexport interface IEditorAction {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly alias: string;\n\treadonly metadata: ICommandMetadata | undefined;\n\tisSupported(): boolean;\n\trun(args?: unknown): Promise<void>;\n}\n\nexport type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;\n\n/**\n * A (serializable) state of the cursors.\n */\nexport interface ICursorState {\n\tinSelectionMode: boolean;\n\tselectionStart: IPosition;\n\tposition: IPosition;\n}\n/**\n * A (serializable) state of the view.\n */\nexport interface IViewState {\n\t/** written by previous versions */\n\tscrollTop?: number;\n\t/** written by previous versions */\n\tscrollTopWithoutViewZones?: number;\n\tscrollLeft: number;\n\tfirstPosition: IPosition;\n\tfirstPositionDeltaTop: number;\n}\n/**\n * A (serializable) state of the code editor.\n */\nexport interface ICodeEditorViewState {\n\tcursorState: ICursorState[];\n\tviewState: IViewState;\n\tcontributionsState: { [id: string]: unknown };\n}\n/**\n * (Serializable) View state for the diff editor.\n */\nexport interface IDiffEditorViewState {\n\toriginal: ICodeEditorViewState | null;\n\tmodified: ICodeEditorViewState | null;\n\tmodelState?: unknown;\n}\n/**\n * An editor view state.\n */\nexport type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;\n\nexport const enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1,\n}\n\n/**\n * An editor.\n */\nexport interface IEditor {\n\t/**\n\t * An event emitted when the editor has been disposed.\n\t * @event\n\t */\n\tonDidDispose(listener: () => void): IDisposable;\n\n\t/**\n\t * Dispose the editor.\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Get a unique id for this editor instance.\n\t */\n\tgetId(): string;\n\n\t/**\n\t * Get the editor type. Please see `EditorType`.\n\t * This is to avoid an instanceof check\n\t */\n\tgetEditorType(): string;\n\n\t/**\n\t * Update the editor's options after the editor has been created.\n\t */\n\tupdateOptions(newOptions: IEditorOptions): void;\n\n\t/**\n\t * Instructs the editor to remeasure its container. This method should\n\t * be called when the container of the editor gets resized.\n\t *\n\t * If a dimension is passed in, the passed in value will be used.\n\t *\n\t * By default, this will also render the editor immediately.\n\t * If you prefer to delay rendering to the next animation frame, use postponeRendering == true.\n\t */\n\tlayout(dimension?: IDimension, postponeRendering?: boolean): void;\n\n\t/**\n\t * Brings browser focus to the editor text\n\t */\n\tfocus(): void;\n\n\t/**\n\t * Returns true if the text inside this editor is focused (i.e. cursor is blinking).\n\t */\n\thasTextFocus(): boolean;\n\n\t/**\n\t * Returns all actions associated with this editor.\n\t */\n\tgetSupportedActions(): IEditorAction[];\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): IEditorViewState | null;\n\n\t/**\n\t * Restores the view state of the editor from a serializable object generated by `saveViewState`.\n\t */\n\trestoreViewState(state: IEditorViewState | null): void;\n\n\t/**\n\t * Given a position, returns a column number that takes tab-widths into account.\n\t */\n\tgetVisibleColumnFromPosition(position: IPosition): number;\n\n\t/**\n\t * Returns the primary position of the cursor.\n\t */\n\tgetPosition(): Position | null;\n\n\t/**\n\t * Set the primary position of the cursor. This will remove any secondary cursors.\n\t * @param position New primary cursor's position\n\t * @param source Source of the call that caused the position\n\t */\n\tsetPosition(position: IPosition, source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line.\n\t */\n\trevealLine(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically.\n\t */\n\trevealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.\n\t */\n\trevealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal a line close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position.\n\t */\n\trevealPosition(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically.\n\t */\n\trevealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.\n\t */\n\trevealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;\n\n\t/**\n\t * Returns the primary selection of the editor.\n\t */\n\tgetSelection(): Selection | null;\n\n\t/**\n\t * Returns all the selections of the editor.\n\t */\n\tgetSelections(): Selection[] | null;\n\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: IRange, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Range, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: ISelection, source?: string): void;\n\t/**\n\t * Set the primary selection of the editor. This will remove any secondary cursors.\n\t * @param selection The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelection(selection: Selection, source?: string): void;\n\n\t/**\n\t * Set the selections for all the cursors of the editor.\n\t * Cursors will be removed or added, as necessary.\n\t * @param selections The new selection\n\t * @param source Source of the call that caused the selection\n\t */\n\tsetSelections(selections: readonly ISelection[], source?: string): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines.\n\t */\n\trevealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically.\n\t */\n\trevealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.\n\t */\n\trevealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically as necessary and reveal lines close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range.\n\t */\n\trevealRange(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically.\n\t */\n\trevealRangeInCenter(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.\n\t */\n\trevealRangeAtTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.\n\t */\n\trevealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition.\n\t */\n\trevealRangeNearTop(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,\n\t * optimized for viewing a code definition. Only if it lies outside the viewport.\n\t */\n\trevealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;\n\n\t/**\n\t * Directly trigger a handler or an editor action.\n\t * @param source The source of the call.\n\t * @param handlerId The id of the handler or the id of a contribution.\n\t * @param payload Extra data to be sent to the handler.\n\t */\n\ttrigger(source: string | null | undefined, handlerId: string, payload: unknown): void;\n\n\t/**\n\t * Gets the current model attached to this editor.\n\t */\n\tgetModel(): IEditorModel | null;\n\n\t/**\n\t * Sets the current model attached to this editor.\n\t * If the previous model was created by the editor via the value key in the options\n\t * literal object, it will be destroyed. Otherwise, if the previous model was set\n\t * via setModel, or the model key in the options literal object, the previous model\n\t * will not be destroyed.\n\t * It is safe to call setModel(null) to simply detach the current model from the editor.\n\t */\n\tsetModel(model: IEditorModel | null): void;\n\n\t/**\n\t * Create a collection of decorations. All decorations added through this collection\n\t * will get the ownerId of the editor (meaning they will not show up in other editors).\n\t * These decorations will be automatically cleared when the editor's model changes.\n\t */\n\tcreateDecorationsCollection(decorations?: IModelDeltaDecoration[]): IEditorDecorationsCollection;\n\n\t/**\n\t * Change the decorations. All decorations added through this changeAccessor\n\t * will get the ownerId of the editor (meaning they will not show up in other\n\t * editors).\n\t * @see {@link ITextModel.changeDecorations}\n\t * @internal\n\t */\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;\n}\n\n/**\n * A diff editor.\n *\n * @internal\n */\nexport interface IDiffEditor extends IEditor {\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): IDiffEditorModel | null;\n}\n\n/**\n * @internal\n */\nexport interface ICompositeCodeEditor {\n\n\t/**\n\t * An event that signals that the active editor has changed\n\t */\n\treadonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;\n\n\t/**\n\t * The active code editor iff any\n\t */\n\treadonly activeCodeEditor: IEditor | undefined;\n\t// readonly editors: readonly ICodeEditor[] maybe supported with uris\n}\n\n/**\n * A collection of decorations\n */\nexport interface IEditorDecorationsCollection {\n\t/**\n\t * An event emitted when decorations change in the editor,\n\t * but the change is not caused by us setting or clearing the collection.\n\t */\n\treadonly onDidChange: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * Get the decorations count.\n\t */\n\tlength: number;\n\t/**\n\t * Get the range for a decoration.\n\t */\n\tgetRange(index: number): Range | null;\n\t/**\n\t * Get all ranges for decorations.\n\t */\n\tgetRanges(): Range[];\n\t/**\n\t * Determine if a decoration is in this collection.\n\t */\n\thas(decoration: IModelDecoration): boolean;\n\t/**\n\t * Replace all previous decorations with `newDecorations`.\n\t */\n\tset(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Append `newDecorations` to this collection.\n\t */\n\tappend(newDecorations: readonly IModelDeltaDecoration[]): string[];\n\t/**\n\t * Remove all previous decorations.\n\t */\n\tclear(): void;\n}\n\n/**\n * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.\n */\nexport interface IEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n\t/**\n\t * Store view state.\n\t */\n\tsaveViewState?(): unknown;\n\t/**\n\t * Restore view state.\n\t */\n\trestoreViewState?(state: unknown): void;\n}\n\n/**\n * A diff editor contribution that gets created every time a new diffeditor gets created and gets disposed when the diff editor gets disposed.\n * @internal\n */\nexport interface IDiffEditorContribution {\n\t/**\n\t * Dispose this contribution.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The type of the `IEditor`.\n */\nexport const EditorType = {\n\tICodeEditor: 'vs.editor.ICodeEditor',\n\tIDiffEditor: 'vs.editor.IDiffEditor'\n};\n\n/**\n * Built-in commands.\n * @internal\n */\nexport const enum Handler {\n\tCompositionStart = 'compositionStart',\n\tCompositionEnd = 'compositionEnd',\n\tType = 'type',\n\tReplacePreviousChar = 'replacePreviousChar',\n\tCompositionType = 'compositionType',\n\tPaste = 'paste',\n\tCut = 'cut',\n}\n\n/**\n * @internal\n */\nexport interface TypePayload {\n\ttext: string;\n}\n\n/**\n * @internal\n */\nexport interface ReplacePreviousCharPayload {\n\ttext: string;\n\treplaceCharCnt: number;\n}\n\n/**\n * @internal\n */\nexport interface CompositionTypePayload {\n\ttext: string;\n\treplacePrevCharCnt: number;\n\treplaceNextCharCnt: number;\n\tpositionDelta: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/language.ts","vs/editor/common/languages/language.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAE1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAmB,iBAAiB,CAAC,CAAC","file":"language.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../../base/common/event.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ILanguageIdCodec } from '../languages.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\n\nexport const ILanguageService = createDecorator<ILanguageService>('languageService');\n\nexport interface ILanguageExtensionPoint {\n\tid: string;\n\textensions?: string[];\n\tfilenames?: string[];\n\tfilenamePatterns?: string[];\n\tfirstLine?: string;\n\taliases?: string[];\n\tmimetypes?: string[];\n\tconfiguration?: URI;\n\t/**\n\t * @internal\n\t */\n\ticon?: ILanguageIcon;\n}\n\nexport interface ILanguageSelection {\n\treadonly languageId: string;\n\treadonly onDidChange: Event<string>;\n}\n\nexport interface ILanguageIcon {\n}\n\nexport interface ILanguageService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * A codec which can encode and decode a string `languageId` as a number.\n\t */\n\treadonly languageIdCodec: ILanguageIdCodec;\n\n\t/**\n\t * An event emitted when basic language features are requested for the first time.\n\t * This event is emitted when embedded languages are encountered (e.g. JS code block inside Markdown)\n\t * or when a language is associated to a text model.\n\t *\n\t * **Note**: Basic language features refers to language configuration related features.\n\t * **Note**: This event is a superset of `onDidRequestRichLanguageFeatures`\n\t */\n\tonDidRequestBasicLanguageFeatures: Event<string>;\n\n\t/**\n\t * An event emitted when rich language features are requested for the first time.\n\t * This event is emitted when a language is associated to a text model.\n\t *\n\t * **Note**: Rich language features refers to tokenizers, language features based on providers, etc.\n\t * **Note**: This event is a subset of `onDidRequestRichLanguageFeatures`\n\t */\n\tonDidRequestRichLanguageFeatures: Event<string>;\n\n\t/**\n\t * Check if `languageId` is registered.\n\t */\n\tisRegisteredLanguageId(languageId: string): boolean;\n\n\t/**\n\t * Look up a language by its name case insensitive.\n\t */\n\tgetLanguageIdByLanguageName(languageName: string): string | null;\n\n\t/**\n\t * Look up a language by its mime type.\n\t */\n\tgetLanguageIdByMimeType(mimeType: string | null | undefined): string | null;\n\n\t/**\n\t * Guess the language id for a resource.\n\t */\n\tguessLanguageIdByFilepathOrFirstLine(resource: URI, firstLine?: string): string | null;\n\n\t/**\n\t * Will fall back to 'plaintext' if `languageId` is unknown.\n\t */\n\tcreateById(languageId: string | null | undefined): ILanguageSelection;\n\n\t/**\n\t * Will fall back to 'plaintext' if the `languageId` cannot be determined.\n\t */\n\tcreateByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection;\n\n\t/**\n\t * Request basic language features for a language.\n\t */\n\trequestBasicLanguageFeatures(languageId: string): void;\n\n\t/**\n\t * Request rich language features for a language.\n\t */\n\trequestRichLanguageFeatures(languageId: string): void;\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../../base/common/event.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ILanguageIdCodec } from '../languages.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\n\nexport const ILanguageService = createDecorator<ILanguageService>('languageService');\n\nexport interface ILanguageExtensionPoint {\n\tid: string;\n\textensions?: string[];\n\tfilenames?: string[];\n\tfilenamePatterns?: string[];\n\tfirstLine?: string;\n\taliases?: string[];\n\tmimetypes?: string[];\n\tconfiguration?: URI;\n\t/**\n\t * @internal\n\t */\n\ticon?: ILanguageIcon;\n}\n\nexport interface ILanguageSelection {\n\treadonly languageId: string;\n\treadonly onDidChange: Event<string>;\n}\n\nexport interface ILanguageIcon {\n}\n\nexport interface ILanguageService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * A codec which can encode and decode a string `languageId` as a number.\n\t */\n\treadonly languageIdCodec: ILanguageIdCodec;\n\n\t/**\n\t * An event emitted when basic language features are requested for the first time.\n\t * This event is emitted when embedded languages are encountered (e.g. JS code block inside Markdown)\n\t * or when a language is associated to a text model.\n\t *\n\t * **Note**: Basic language features refers to language configuration related features.\n\t * **Note**: This event is a superset of `onDidRequestRichLanguageFeatures`\n\t */\n\tonDidRequestBasicLanguageFeatures: Event<string>;\n\n\t/**\n\t * An event emitted when rich language features are requested for the first time.\n\t * This event is emitted when a language is associated to a text model.\n\t *\n\t * **Note**: Rich language features refers to tokenizers, language features based on providers, etc.\n\t * **Note**: This event is a subset of `onDidRequestRichLanguageFeatures`\n\t */\n\tonDidRequestRichLanguageFeatures: Event<string>;\n\n\t/**\n\t * Check if `languageId` is registered.\n\t */\n\tisRegisteredLanguageId(languageId: string): boolean;\n\n\t/**\n\t * Look up a language by its name case insensitive.\n\t */\n\tgetLanguageIdByLanguageName(languageName: string): string | null;\n\n\t/**\n\t * Look up a language by its mime type.\n\t */\n\tgetLanguageIdByMimeType(mimeType: string | null | undefined): string | null;\n\n\t/**\n\t * Guess the language id for a resource.\n\t */\n\tguessLanguageIdByFilepathOrFirstLine(resource: URI, firstLine?: string): string | null;\n\n\t/**\n\t * Will fall back to 'plaintext' if `languageId` is unknown.\n\t */\n\tcreateById(languageId: string | null | undefined): ILanguageSelection;\n\n\t/**\n\t * Will fall back to 'plaintext' if the `languageId` cannot be determined.\n\t */\n\tcreateByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection;\n\n\t/**\n\t * Request basic language features for a language.\n\t */\n\trequestBasicLanguageFeatures(languageId: string): void;\n\n\t/**\n\t * Request rich language features for a language.\n\t */\n\trequestRichLanguageFeatures(languageId: string): void;\n\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/language.ts","vs/editor/common/languages/language.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAE1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAmB,iBAAiB,CAAC,CAAC","file":"language.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../../base/common/event.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ILanguageIdCodec } from '../languages.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\n\nexport const ILanguageService = createDecorator<ILanguageService>('languageService');\n\nexport interface ILanguageExtensionPoint {\n\tid: string;\n\textensions?: string[];\n\tfilenames?: string[];\n\tfilenamePatterns?: string[];\n\tfirstLine?: string;\n\taliases?: string[];\n\tmimetypes?: string[];\n\tconfiguration?: URI;\n\t/**\n\t * @internal\n\t */\n\ticon?: ILanguageIcon;\n}\n\nexport interface ILanguageSelection {\n\treadonly languageId: string;\n\treadonly onDidChange: Event<string>;\n}\n\nexport interface ILanguageIcon {\n}\n\nexport interface ILanguageService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * A codec which can encode and decode a string `languageId` as a number.\n\t */\n\treadonly languageIdCodec: ILanguageIdCodec;\n\n\t/**\n\t * An event emitted when basic language features are requested for the first time.\n\t * This event is emitted when embedded languages are encountered (e.g. JS code block inside Markdown)\n\t * or when a language is associated to a text model.\n\t *\n\t * **Note**: Basic language features refers to language configuration related features.\n\t * **Note**: This event is a superset of `onDidRequestRichLanguageFeatures`\n\t */\n\treadonly onDidRequestBasicLanguageFeatures: Event<string>;\n\n\t/**\n\t * An event emitted when rich language features are requested for the first time.\n\t * This event is emitted when a language is associated to a text model.\n\t *\n\t * **Note**: Rich language features refers to tokenizers, language features based on providers, etc.\n\t * **Note**: This event is a subset of `onDidRequestRichLanguageFeatures`\n\t */\n\treadonly onDidRequestRichLanguageFeatures: Event<string>;\n\n\t/**\n\t * Check if `languageId` is registered.\n\t */\n\tisRegisteredLanguageId(languageId: string): boolean;\n\n\t/**\n\t * Look up a language by its name case insensitive.\n\t */\n\tgetLanguageIdByLanguageName(languageName: string): string | null;\n\n\t/**\n\t * Look up a language by its mime type.\n\t */\n\tgetLanguageIdByMimeType(mimeType: string | null | undefined): string | null;\n\n\t/**\n\t * Guess the language id for a resource.\n\t */\n\tguessLanguageIdByFilepathOrFirstLine(resource: URI, firstLine?: string): string | null;\n\n\t/**\n\t * Will fall back to 'plaintext' if `languageId` is unknown.\n\t */\n\tcreateById(languageId: string | null | undefined): ILanguageSelection;\n\n\t/**\n\t * Will fall back to 'plaintext' if the `languageId` cannot be determined.\n\t */\n\tcreateByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection;\n\n\t/**\n\t * Request basic language features for a language.\n\t */\n\trequestBasicLanguageFeatures(languageId: string): void;\n\n\t/**\n\t * Request rich language features for a language.\n\t */\n\trequestRichLanguageFeatures(languageId: string): void;\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from '../../../base/common/event.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { ILanguageIdCodec } from '../languages.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\n\nexport const ILanguageService = createDecorator<ILanguageService>('languageService');\n\nexport interface ILanguageExtensionPoint {\n\tid: string;\n\textensions?: string[];\n\tfilenames?: string[];\n\tfilenamePatterns?: string[];\n\tfirstLine?: string;\n\taliases?: string[];\n\tmimetypes?: string[];\n\tconfiguration?: URI;\n\t/**\n\t * @internal\n\t */\n\ticon?: ILanguageIcon;\n}\n\nexport interface ILanguageSelection {\n\treadonly languageId: string;\n\treadonly onDidChange: Event<string>;\n}\n\nexport interface ILanguageIcon {\n}\n\nexport interface ILanguageService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * A codec which can encode and decode a string `languageId` as a number.\n\t */\n\treadonly languageIdCodec: ILanguageIdCodec;\n\n\t/**\n\t * An event emitted when basic language features are requested for the first time.\n\t * This event is emitted when embedded languages are encountered (e.g. JS code block inside Markdown)\n\t * or when a language is associated to a text model.\n\t *\n\t * **Note**: Basic language features refers to language configuration related features.\n\t * **Note**: This event is a superset of `onDidRequestRichLanguageFeatures`\n\t */\n\treadonly onDidRequestBasicLanguageFeatures: Event<string>;\n\n\t/**\n\t * An event emitted when rich language features are requested for the first time.\n\t * This event is emitted when a language is associated to a text model.\n\t *\n\t * **Note**: Rich language features refers to tokenizers, language features based on providers, etc.\n\t * **Note**: This event is a subset of `onDidRequestRichLanguageFeatures`\n\t */\n\treadonly onDidRequestRichLanguageFeatures: Event<string>;\n\n\t/**\n\t * Check if `languageId` is registered.\n\t */\n\tisRegisteredLanguageId(languageId: string): boolean;\n\n\t/**\n\t * Look up a language by its name case insensitive.\n\t */\n\tgetLanguageIdByLanguageName(languageName: string): string | null;\n\n\t/**\n\t * Look up a language by its mime type.\n\t */\n\tgetLanguageIdByMimeType(mimeType: string | null | undefined): string | null;\n\n\t/**\n\t * Guess the language id for a resource.\n\t */\n\tguessLanguageIdByFilepathOrFirstLine(resource: URI, firstLine?: string): string | null;\n\n\t/**\n\t * Will fall back to 'plaintext' if `languageId` is unknown.\n\t */\n\tcreateById(languageId: string | null | undefined): ILanguageSelection;\n\n\t/**\n\t * Will fall back to 'plaintext' if the `languageId` cannot be determined.\n\t */\n\tcreateByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection;\n\n\t/**\n\t * Request basic language features for a language.\n\t */\n\trequestBasicLanguageFeatures(languageId: string): void;\n\n\t/**\n\t * Request rich language features for a language.\n\t */\n\trequestRichLanguageFeatures(languageId: string): void;\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/languageConfigurationRegistry.ts","vs/editor/common/languages/languageConfigurationRegistry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAe,eAAe,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAuF,gBAAgB,EAAgD,MAAM,4BAA4B,CAAC;AACjM,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,M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D,QAAQ,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACP,QAAQ,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC;gBAC5D,QAAQ,CAAC,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;YACjE,CAAC;QACF,CAAC;QACD,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;YAC9B,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC;YACxD,QAAQ,CAAC,sBAAsB,GAAG,UAAU,CAAC;YAC7C,QAAQ,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAED,iBAAiB,CAAC,6BAA6B,EAAE,4BAA4B,oCAA4B,CAAC","file":"languageConfigurationRegistry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { Disposable, IDisposable, markAsSingleton, toDisposable } from '../../../base/common/lifecycle.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { ITextModel } from '../model.js';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from './languageConfiguration.js';\nimport { CharacterPairSupport } from './supports/characterPair.js';\nimport { BracketElectricCharacterSupport } from './supports/electricCharacter.js';\nimport { IndentRulesSupport } from './supports/indentRules.js';\nimport { OnEnterSupport } from './supports/onEnter.js';\nimport { RichEditBrackets } from './supports/richEditBrackets.js';\nimport { EditorAutoIndentStrategy } from '../config/editorOptions.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { ILanguageService } from './language.js';\nimport { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js';\nimport { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js';\nimport { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js';\n\n/**\n * Interface used to support insertion of mode specific comments.\n */\nexport interface ICommentsConfiguration {\n\tlineCommentToken?: string;\n\tlineCommentNoIndent?: boolean;\n\tblockCommentStartToken?: string;\n\tblockCommentEndToken?: string;\n}\n\nexport interface ILanguageConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidChange: Event<LanguageConfigurationServiceChangeEvent>;\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tregister(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable;\n\n\tgetLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;\n\n}\n\nexport class LanguageConfigurationServiceChangeEvent {\n\tconstructor(public readonly languageId: string | undefined) { }\n\n\tpublic affects(languageId: string): boolean {\n\t\treturn !this.languageId ? true : this.languageId === languageId;\n\t}\n}\n\nexport const ILanguageConfigurationService = createDecorator<ILanguageConfigurationService>('languageConfigurationService');\n\nexport class LanguageConfigurationService extends Disposable implements ILanguageConfigurationService {\n\t_serviceBrand: undefined;\n\n\tprivate readonly _registry = this._register(new LanguageConfigurationRegistry());\n\n\tprivate readonly onDidChangeEmitter = this._register(new Emitter<LanguageConfigurationServiceChangeEvent>());\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate readonly configurations = new Map<string, ResolvedLanguageConfiguration>();\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILanguageService private readonly languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tconst languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));\n\n\t\tthis._register(this.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tconst globalConfigChanged = e.change.keys.some((k) =>\n\t\t\t\tlanguageConfigKeys.has(k)\n\t\t\t);\n\t\t\tconst localConfigChanged = e.change.overrides\n\t\t\t\t.filter(([overrideLangName, keys]) =>\n\t\t\t\t\tkeys.some((k) => languageConfigKeys.has(k))\n\t\t\t\t)\n\t\t\t\t.map(([overrideLangName]) => overrideLangName);\n\n\t\t\tif (globalConfigChanged) {\n\t\t\t\tthis.configurations.clear();\n\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(undefined));\n\t\t\t} else {\n\t\t\t\tfor (const languageId of localConfigChanged) {\n\t\t\t\t\tif (this.languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t\t\t\tthis.configurations.delete(languageId);\n\t\t\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._registry.onDidChange((e) => {\n\t\t\tthis.configurations.delete(e.languageId);\n\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));\n\t\t}));\n\t}\n\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable {\n\t\treturn this._registry.register(languageId, configuration, priority);\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\tlet result = this.configurations.get(languageId);\n\t\tif (!result) {\n\t\t\tresult = computeConfig(languageId, this._registry, this.configurationService, this.languageService);\n\t\t\tthis.configurations.set(languageId, result);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction computeConfig(\n\tlanguageId: string,\n\tregistry: LanguageConfigurationRegistry,\n\tconfigurationService: IConfigurationService,\n\tlanguageService: ILanguageService,\n): ResolvedLanguageConfiguration {\n\tlet languageConfig = registry.getLanguageConfiguration(languageId);\n\n\tif (!languageConfig) {\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t// this happens for the null language, which can be returned by monarch.\n\t\t\t// Instead of throwing an error, we just return a default config.\n\t\t\treturn new ResolvedLanguageConfiguration(languageId, {});\n\t\t}\n\t\tlanguageConfig = new ResolvedLanguageConfiguration(languageId, {});\n\t}\n\n\tconst customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);\n\tconst data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);\n\tconst config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);\n\treturn config;\n}\n\nconst customizedLanguageConfigKeys = {\n\tbrackets: 'editor.language.brackets',\n\tcolorizedBracketPairs: 'editor.language.colorizedBracketPairs'\n};\n\nfunction getCustomizedLanguageConfig(languageId: string, configurationService: IConfigurationService): LanguageConfiguration {\n\tconst brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\tconst colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\treturn {\n\t\tbrackets: validateBracketPairs(brackets),\n\t\tcolorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),\n\t};\n}\n\nfunction validateBracketPairs(data: unknown): CharacterPair[] | undefined {\n\tif (!Array.isArray(data)) {\n\t\treturn undefined;\n\t}\n\treturn data.map(pair => {\n\t\tif (!Array.isArray(pair) || pair.length !== 2) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn [pair[0], pair[1]] as CharacterPair;\n\t}).filter((p): p is CharacterPair => !!p);\n}\n\nexport function getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\tconst lineText = model.getLineContent(lineNumber);\n\tlet indentation = strings.getLeadingWhitespace(lineText);\n\tif (indentation.length > column - 1) {\n\t\tindentation = indentation.substring(0, column - 1);\n\t}\n\treturn indentation;\n}\n\nclass ComposedLanguageConfiguration {\n\tprivate readonly _entries: LanguageConfigurationContribution[];\n\tprivate _order: number;\n\tprivate _resolved: ResolvedLanguageConfiguration | null = null;\n\n\tconstructor(public readonly languageId: string) {\n\t\tthis._entries = [];\n\t\tthis._order = 0;\n\t\tthis._resolved = null;\n\t}\n\n\tpublic register(\n\t\tconfiguration: LanguageConfiguration,\n\t\tpriority: number\n\t): IDisposable {\n\t\tconst entry = new LanguageConfigurationContribution(\n\t\t\tconfiguration,\n\t\t\tpriority,\n\t\t\t++this._order\n\t\t);\n\t\tthis._entries.push(entry);\n\t\tthis._resolved = null;\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tfor (let i = 0; i < this._entries.length; i++) {\n\t\t\t\tif (this._entries[i] === entry) {\n\t\t\t\t\tthis._entries.splice(i, 1);\n\t\t\t\t\tthis._resolved = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic getResolvedConfiguration(): ResolvedLanguageConfiguration | null {\n\t\tif (!this._resolved) {\n\t\t\tconst config = this._resolve();\n\t\t\tif (config) {\n\t\t\t\tthis._resolved = new ResolvedLanguageConfiguration(\n\t\t\t\t\tthis.languageId,\n\t\t\t\t\tconfig\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this._resolved;\n\t}\n\n\tprivate _resolve(): LanguageConfiguration | null {\n\t\tif (this._entries.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tthis._entries.sort(LanguageConfigurationContribution.cmp);\n\t\treturn combineLanguageConfigurations(this._entries.map(e => e.configuration));\n\t}\n}\n\nfunction combineLanguageConfigurations(configs: LanguageConfiguration[]): LanguageConfiguration {\n\tlet result: ExplicitLanguageConfiguration = {\n\t\tcomments: undefined,\n\t\tbrackets: undefined,\n\t\twordPattern: undefined,\n\t\tindentationRules: undefined,\n\t\tonEnterRules: undefined,\n\t\tautoClosingPairs: undefined,\n\t\tsurroundingPairs: undefined,\n\t\tautoCloseBefore: undefined,\n\t\tfolding: undefined,\n\t\tcolorizedBracketPairs: undefined,\n\t\t__electricCharacterSupport: undefined,\n\t};\n\tfor (const entry of configs) {\n\t\tresult = {\n\t\t\tcomments: entry.comments || result.comments,\n\t\t\tbrackets: entry.brackets || result.brackets,\n\t\t\twordPattern: entry.wordPattern || result.wordPattern,\n\t\t\tindentationRules: entry.indentationRules || result.indentationRules,\n\t\t\tonEnterRules: entry.onEnterRules || result.onEnterRules,\n\t\t\tautoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs,\n\t\t\tsurroundingPairs: entry.surroundingPairs || result.surroundingPairs,\n\t\t\tautoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore,\n\t\t\tfolding: entry.folding || result.folding,\n\t\t\tcolorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs,\n\t\t\t__electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport,\n\t\t};\n\t}\n\n\treturn result;\n}\n\nclass LanguageConfigurationContribution {\n\tconstructor(\n\t\tpublic readonly configuration: LanguageConfiguration,\n\t\tpublic readonly priority: number,\n\t\tpublic readonly order: number\n\t) { }\n\n\tpublic static cmp(a: LanguageConfigurationContribution, b: LanguageConfigurationContribution) {\n\t\tif (a.priority === b.priority) {\n\t\t\t// higher order last\n\t\t\treturn a.order - b.order;\n\t\t}\n\t\t// higher priority last\n\t\treturn a.priority - b.priority;\n\t}\n}\n\nexport class LanguageConfigurationChangeEvent {\n\tconstructor(public readonly languageId: string) { }\n}\n\nexport class LanguageConfigurationRegistry extends Disposable {\n\tprivate readonly _entries = new Map<string, ComposedLanguageConfiguration>();\n\n\tprivate readonly _onDidChange = this._register(new Emitter<LanguageConfigurationChangeEvent>());\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._register(this.register(PLAINTEXT_LANGUAGE_ID, {\n\t\t\tbrackets: [\n\t\t\t\t['(', ')'],\n\t\t\t\t['[', ']'],\n\t\t\t\t['{', '}'],\n\t\t\t],\n\t\t\tsurroundingPairs: [\n\t\t\t\t{ open: '{', close: '}' },\n\t\t\t\t{ open: '[', close: ']' },\n\t\t\t\t{ open: '(', close: ')' },\n\t\t\t\t{ open: '<', close: '>' },\n\t\t\t\t{ open: '\\\"', close: '\\\"' },\n\t\t\t\t{ open: '\\'', close: '\\'' },\n\t\t\t\t{ open: '`', close: '`' },\n\t\t\t],\n\t\t\tcolorizedBracketPairs: [],\n\t\t\tfolding: {\n\t\t\t\toffSide: true\n\t\t\t}\n\t\t}, 0));\n\t}\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority: number = 0): IDisposable {\n\t\tlet entries = this._entries.get(languageId);\n\t\tif (!entries) {\n\t\t\tentries = new ComposedLanguageConfiguration(languageId);\n\t\t\tthis._entries.set(languageId, entries);\n\t\t}\n\n\t\tconst disposable = entries.register(configuration, priority);\n\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tdisposable.dispose();\n\t\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\t\t}));\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration | null {\n\t\tconst entries = this._entries.get(languageId);\n\t\treturn entries?.getResolvedConfiguration() || null;\n\t}\n}\n\n/**\n * Immutable.\n*/\nexport class ResolvedLanguageConfiguration {\n\tprivate _brackets: RichEditBrackets | null;\n\tprivate _electricCharacter: BracketElectricCharacterSupport | null;\n\tprivate readonly _onEnterSupport: OnEnterSupport | null;\n\n\tpublic readonly comments: ICommentsConfiguration | null;\n\tpublic readonly characterPair: CharacterPairSupport;\n\tpublic readonly wordDefinition: RegExp;\n\tpublic readonly indentRulesSupport: IndentRulesSupport | null;\n\tpublic readonly indentationRules: IndentationRule | undefined;\n\tpublic readonly foldingRules: FoldingRules;\n\tpublic readonly bracketsNew: LanguageBracketsConfiguration;\n\n\tconstructor(\n\t\tpublic readonly languageId: string,\n\t\tpublic readonly underlyingConfig: LanguageConfiguration\n\t) {\n\t\tthis._brackets = null;\n\t\tthis._electricCharacter = null;\n\t\tthis._onEnterSupport =\n\t\t\tthis.underlyingConfig.brackets ||\n\t\t\t\tthis.underlyingConfig.indentationRules ||\n\t\t\t\tthis.underlyingConfig.onEnterRules\n\t\t\t\t? new OnEnterSupport(this.underlyingConfig)\n\t\t\t\t: null;\n\t\tthis.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);\n\t\tthis.characterPair = new CharacterPairSupport(this.underlyingConfig);\n\n\t\tthis.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP;\n\t\tthis.indentationRules = this.underlyingConfig.indentationRules;\n\t\tif (this.underlyingConfig.indentationRules) {\n\t\t\tthis.indentRulesSupport = new IndentRulesSupport(\n\t\t\t\tthis.underlyingConfig.indentationRules\n\t\t\t);\n\t\t} else {\n\t\t\tthis.indentRulesSupport = null;\n\t\t}\n\t\tthis.foldingRules = this.underlyingConfig.folding || {};\n\n\t\tthis.bracketsNew = new LanguageBracketsConfiguration(\n\t\t\tlanguageId,\n\t\t\tthis.underlyingConfig\n\t\t);\n\t}\n\n\tpublic getWordDefinition(): RegExp {\n\t\treturn ensureValidWordDefinition(this.wordDefinition);\n\t}\n\n\tpublic get brackets(): RichEditBrackets | null {\n\t\tif (!this._brackets && this.underlyingConfig.brackets) {\n\t\t\tthis._brackets = new RichEditBrackets(\n\t\t\t\tthis.languageId,\n\t\t\t\tthis.underlyingConfig.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._brackets;\n\t}\n\n\tpublic get electricCharacter(): BracketElectricCharacterSupport | null {\n\t\tif (!this._electricCharacter) {\n\t\t\tthis._electricCharacter = new BracketElectricCharacterSupport(\n\t\t\t\tthis.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._electricCharacter;\n\t}\n\n\tpublic onEnter(\n\t\tautoIndent: EditorAutoIndentStrategy,\n\t\tpreviousLineText: string,\n\t\tbeforeEnterText: string,\n\t\tafterEnterText: string\n\t): EnterAction | null {\n\t\tif (!this._onEnterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._onEnterSupport.onEnter(\n\t\t\tautoIndent,\n\t\t\tpreviousLineText,\n\t\t\tbeforeEnterText,\n\t\t\tafterEnterText\n\t\t);\n\t}\n\n\tpublic getAutoClosingPairs(): AutoClosingPairs {\n\t\treturn new AutoClosingPairs(this.characterPair.getAutoClosingPairs());\n\t}\n\n\tpublic getAutoCloseBeforeSet(forQuotes: boolean): string {\n\t\treturn this.characterPair.getAutoCloseBeforeSet(forQuotes);\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this.characterPair.getSurroundingPairs();\n\t}\n\n\tprivate static _handleComments(\n\t\tconf: LanguageConfiguration\n\t): ICommentsConfiguration | null {\n\t\tconst commentRule = conf.comments;\n\t\tif (!commentRule) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// comment configuration\n\t\tconst comments: ICommentsConfiguration = {};\n\n\t\tif (commentRule.lineComment) {\n\t\t\tif (typeof commentRule.lineComment === 'string') {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment;\n\t\t\t} else {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment.comment;\n\t\t\t\tcomments.lineCommentNoIndent = commentRule.lineComment.noIndent;\n\t\t\t}\n\t\t}\n\t\tif (commentRule.blockComment) {\n\t\t\tconst [blockStart, blockEnd] = commentRule.blockComment;\n\t\t\tcomments.blockCommentStartToken = blockStart;\n\t\t\tcomments.blockCommentEndToken = blockEnd;\n\t\t}\n\n\t\treturn comments;\n\t}\n}\n\nregisterSingleton(ILanguageConfigurationService, LanguageConfigurationService, InstantiationType.Delayed);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { Disposable, IDisposable, markAsSingleton, toDisposable } from '../../../base/common/lifecycle.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { ITextModel } from '../model.js';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from './languageConfiguration.js';\nimport { CharacterPairSupport } from './supports/characterPair.js';\nimport { BracketElectricCharacterSupport } from './supports/electricCharacter.js';\nimport { IndentRulesSupport } from './supports/indentRules.js';\nimport { OnEnterSupport } from './supports/onEnter.js';\nimport { RichEditBrackets } from './supports/richEditBrackets.js';\nimport { EditorAutoIndentStrategy } from '../config/editorOptions.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { ILanguageService } from './language.js';\nimport { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js';\nimport { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js';\nimport { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js';\n\n/**\n * Interface used to support insertion of mode specific comments.\n */\nexport interface ICommentsConfiguration {\n\tlineCommentToken?: string;\n\tlineCommentNoIndent?: boolean;\n\tblockCommentStartToken?: string;\n\tblockCommentEndToken?: string;\n}\n\nexport interface ILanguageConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidChange: Event<LanguageConfigurationServiceChangeEvent>;\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tregister(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable;\n\n\tgetLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;\n\n}\n\nexport class LanguageConfigurationServiceChangeEvent {\n\tconstructor(public readonly languageId: string | undefined) { }\n\n\tpublic affects(languageId: string): boolean {\n\t\treturn !this.languageId ? true : this.languageId === languageId;\n\t}\n}\n\nexport const ILanguageConfigurationService = createDecorator<ILanguageConfigurationService>('languageConfigurationService');\n\nexport class LanguageConfigurationService extends Disposable implements ILanguageConfigurationService {\n\t_serviceBrand: undefined;\n\n\tprivate readonly _registry = this._register(new LanguageConfigurationRegistry());\n\n\tprivate readonly onDidChangeEmitter = this._register(new Emitter<LanguageConfigurationServiceChangeEvent>());\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate readonly configurations = new Map<string, ResolvedLanguageConfiguration>();\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILanguageService private readonly languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tconst languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));\n\n\t\tthis._register(this.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tconst globalConfigChanged = e.change.keys.some((k) =>\n\t\t\t\tlanguageConfigKeys.has(k)\n\t\t\t);\n\t\t\tconst localConfigChanged = e.change.overrides\n\t\t\t\t.filter(([overrideLangName, keys]) =>\n\t\t\t\t\tkeys.some((k) => languageConfigKeys.has(k))\n\t\t\t\t)\n\t\t\t\t.map(([overrideLangName]) => overrideLangName);\n\n\t\t\tif (globalConfigChanged) {\n\t\t\t\tthis.configurations.clear();\n\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(undefined));\n\t\t\t} else {\n\t\t\t\tfor (const languageId of localConfigChanged) {\n\t\t\t\t\tif (this.languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t\t\t\tthis.configurations.delete(languageId);\n\t\t\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._registry.onDidChange((e) => {\n\t\t\tthis.configurations.delete(e.languageId);\n\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));\n\t\t}));\n\t}\n\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable {\n\t\treturn this._registry.register(languageId, configuration, priority);\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\tlet result = this.configurations.get(languageId);\n\t\tif (!result) {\n\t\t\tresult = computeConfig(languageId, this._registry, this.configurationService, this.languageService);\n\t\t\tthis.configurations.set(languageId, result);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction computeConfig(\n\tlanguageId: string,\n\tregistry: LanguageConfigurationRegistry,\n\tconfigurationService: IConfigurationService,\n\tlanguageService: ILanguageService,\n): ResolvedLanguageConfiguration {\n\tlet languageConfig = registry.getLanguageConfiguration(languageId);\n\n\tif (!languageConfig) {\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t// this happens for the null language, which can be returned by monarch.\n\t\t\t// Instead of throwing an error, we just return a default config.\n\t\t\treturn new ResolvedLanguageConfiguration(languageId, {});\n\t\t}\n\t\tlanguageConfig = new ResolvedLanguageConfiguration(languageId, {});\n\t}\n\n\tconst customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);\n\tconst data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);\n\tconst config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);\n\treturn config;\n}\n\nconst customizedLanguageConfigKeys = {\n\tbrackets: 'editor.language.brackets',\n\tcolorizedBracketPairs: 'editor.language.colorizedBracketPairs'\n};\n\nfunction getCustomizedLanguageConfig(languageId: string, configurationService: IConfigurationService): LanguageConfiguration {\n\tconst brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\tconst colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\treturn {\n\t\tbrackets: validateBracketPairs(brackets),\n\t\tcolorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),\n\t};\n}\n\nfunction validateBracketPairs(data: unknown): CharacterPair[] | undefined {\n\tif (!Array.isArray(data)) {\n\t\treturn undefined;\n\t}\n\treturn data.map(pair => {\n\t\tif (!Array.isArray(pair) || pair.length !== 2) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn [pair[0], pair[1]] as CharacterPair;\n\t}).filter((p): p is CharacterPair => !!p);\n}\n\nexport function getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\tconst lineText = model.getLineContent(lineNumber);\n\tlet indentation = strings.getLeadingWhitespace(lineText);\n\tif (indentation.length > column - 1) {\n\t\tindentation = indentation.substring(0, column - 1);\n\t}\n\treturn indentation;\n}\n\nclass ComposedLanguageConfiguration {\n\tprivate readonly _entries: LanguageConfigurationContribution[];\n\tprivate _order: number;\n\tprivate _resolved: ResolvedLanguageConfiguration | null = null;\n\n\tconstructor(public readonly languageId: string) {\n\t\tthis._entries = [];\n\t\tthis._order = 0;\n\t\tthis._resolved = null;\n\t}\n\n\tpublic register(\n\t\tconfiguration: LanguageConfiguration,\n\t\tpriority: number\n\t): IDisposable {\n\t\tconst entry = new LanguageConfigurationContribution(\n\t\t\tconfiguration,\n\t\t\tpriority,\n\t\t\t++this._order\n\t\t);\n\t\tthis._entries.push(entry);\n\t\tthis._resolved = null;\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tfor (let i = 0; i < this._entries.length; i++) {\n\t\t\t\tif (this._entries[i] === entry) {\n\t\t\t\t\tthis._entries.splice(i, 1);\n\t\t\t\t\tthis._resolved = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic getResolvedConfiguration(): ResolvedLanguageConfiguration | null {\n\t\tif (!this._resolved) {\n\t\t\tconst config = this._resolve();\n\t\t\tif (config) {\n\t\t\t\tthis._resolved = new ResolvedLanguageConfiguration(\n\t\t\t\t\tthis.languageId,\n\t\t\t\t\tconfig\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this._resolved;\n\t}\n\n\tprivate _resolve(): LanguageConfiguration | null {\n\t\tif (this._entries.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tthis._entries.sort(LanguageConfigurationContribution.cmp);\n\t\treturn combineLanguageConfigurations(this._entries.map(e => e.configuration));\n\t}\n}\n\nfunction combineLanguageConfigurations(configs: LanguageConfiguration[]): LanguageConfiguration {\n\tlet result: ExplicitLanguageConfiguration = {\n\t\tcomments: undefined,\n\t\tbrackets: undefined,\n\t\twordPattern: undefined,\n\t\tindentationRules: undefined,\n\t\tonEnterRules: undefined,\n\t\tautoClosingPairs: undefined,\n\t\tsurroundingPairs: undefined,\n\t\tautoCloseBefore: undefined,\n\t\tfolding: undefined,\n\t\tcolorizedBracketPairs: undefined,\n\t\t__electricCharacterSupport: undefined,\n\t};\n\tfor (const entry of configs) {\n\t\tresult = {\n\t\t\tcomments: entry.comments || result.comments,\n\t\t\tbrackets: entry.brackets || result.brackets,\n\t\t\twordPattern: entry.wordPattern || result.wordPattern,\n\t\t\tindentationRules: entry.indentationRules || result.indentationRules,\n\t\t\tonEnterRules: entry.onEnterRules || result.onEnterRules,\n\t\t\tautoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs,\n\t\t\tsurroundingPairs: entry.surroundingPairs || result.surroundingPairs,\n\t\t\tautoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore,\n\t\t\tfolding: entry.folding || result.folding,\n\t\t\tcolorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs,\n\t\t\t__electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport,\n\t\t};\n\t}\n\n\treturn result;\n}\n\nclass LanguageConfigurationContribution {\n\tconstructor(\n\t\tpublic readonly configuration: LanguageConfiguration,\n\t\tpublic readonly priority: number,\n\t\tpublic readonly order: number\n\t) { }\n\n\tpublic static cmp(a: LanguageConfigurationContribution, b: LanguageConfigurationContribution) {\n\t\tif (a.priority === b.priority) {\n\t\t\t// higher order last\n\t\t\treturn a.order - b.order;\n\t\t}\n\t\t// higher priority last\n\t\treturn a.priority - b.priority;\n\t}\n}\n\nexport class LanguageConfigurationChangeEvent {\n\tconstructor(public readonly languageId: string) { }\n}\n\nexport class LanguageConfigurationRegistry extends Disposable {\n\tprivate readonly _entries = new Map<string, ComposedLanguageConfiguration>();\n\n\tprivate readonly _onDidChange = this._register(new Emitter<LanguageConfigurationChangeEvent>());\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._register(this.register(PLAINTEXT_LANGUAGE_ID, {\n\t\t\tbrackets: [\n\t\t\t\t['(', ')'],\n\t\t\t\t['[', ']'],\n\t\t\t\t['{', '}'],\n\t\t\t],\n\t\t\tsurroundingPairs: [\n\t\t\t\t{ open: '{', close: '}' },\n\t\t\t\t{ open: '[', close: ']' },\n\t\t\t\t{ open: '(', close: ')' },\n\t\t\t\t{ open: '<', close: '>' },\n\t\t\t\t{ open: '\\\"', close: '\\\"' },\n\t\t\t\t{ open: '\\'', close: '\\'' },\n\t\t\t\t{ open: '`', close: '`' },\n\t\t\t],\n\t\t\tcolorizedBracketPairs: [],\n\t\t\tfolding: {\n\t\t\t\toffSide: true\n\t\t\t}\n\t\t}, 0));\n\t}\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority: number = 0): IDisposable {\n\t\tlet entries = this._entries.get(languageId);\n\t\tif (!entries) {\n\t\t\tentries = new ComposedLanguageConfiguration(languageId);\n\t\t\tthis._entries.set(languageId, entries);\n\t\t}\n\n\t\tconst disposable = entries.register(configuration, priority);\n\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tdisposable.dispose();\n\t\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\t\t}));\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration | null {\n\t\tconst entries = this._entries.get(languageId);\n\t\treturn entries?.getResolvedConfiguration() || null;\n\t}\n}\n\n/**\n * Immutable.\n*/\nexport class ResolvedLanguageConfiguration {\n\tprivate _brackets: RichEditBrackets | null;\n\tprivate _electricCharacter: BracketElectricCharacterSupport | null;\n\tprivate readonly _onEnterSupport: OnEnterSupport | null;\n\n\tpublic readonly comments: ICommentsConfiguration | null;\n\tpublic readonly characterPair: CharacterPairSupport;\n\tpublic readonly wordDefinition: RegExp;\n\tpublic readonly indentRulesSupport: IndentRulesSupport | null;\n\tpublic readonly indentationRules: IndentationRule | undefined;\n\tpublic readonly foldingRules: FoldingRules;\n\tpublic readonly bracketsNew: LanguageBracketsConfiguration;\n\n\tconstructor(\n\t\tpublic readonly languageId: string,\n\t\tpublic readonly underlyingConfig: LanguageConfiguration\n\t) {\n\t\tthis._brackets = null;\n\t\tthis._electricCharacter = null;\n\t\tthis._onEnterSupport =\n\t\t\tthis.underlyingConfig.brackets ||\n\t\t\t\tthis.underlyingConfig.indentationRules ||\n\t\t\t\tthis.underlyingConfig.onEnterRules\n\t\t\t\t? new OnEnterSupport(this.underlyingConfig)\n\t\t\t\t: null;\n\t\tthis.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);\n\t\tthis.characterPair = new CharacterPairSupport(this.underlyingConfig);\n\n\t\tthis.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP;\n\t\tthis.indentationRules = this.underlyingConfig.indentationRules;\n\t\tif (this.underlyingConfig.indentationRules) {\n\t\t\tthis.indentRulesSupport = new IndentRulesSupport(\n\t\t\t\tthis.underlyingConfig.indentationRules\n\t\t\t);\n\t\t} else {\n\t\t\tthis.indentRulesSupport = null;\n\t\t}\n\t\tthis.foldingRules = this.underlyingConfig.folding || {};\n\n\t\tthis.bracketsNew = new LanguageBracketsConfiguration(\n\t\t\tlanguageId,\n\t\t\tthis.underlyingConfig\n\t\t);\n\t}\n\n\tpublic getWordDefinition(): RegExp {\n\t\treturn ensureValidWordDefinition(this.wordDefinition);\n\t}\n\n\tpublic get brackets(): RichEditBrackets | null {\n\t\tif (!this._brackets && this.underlyingConfig.brackets) {\n\t\t\tthis._brackets = new RichEditBrackets(\n\t\t\t\tthis.languageId,\n\t\t\t\tthis.underlyingConfig.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._brackets;\n\t}\n\n\tpublic get electricCharacter(): BracketElectricCharacterSupport | null {\n\t\tif (!this._electricCharacter) {\n\t\t\tthis._electricCharacter = new BracketElectricCharacterSupport(\n\t\t\t\tthis.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._electricCharacter;\n\t}\n\n\tpublic onEnter(\n\t\tautoIndent: EditorAutoIndentStrategy,\n\t\tpreviousLineText: string,\n\t\tbeforeEnterText: string,\n\t\tafterEnterText: string\n\t): EnterAction | null {\n\t\tif (!this._onEnterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._onEnterSupport.onEnter(\n\t\t\tautoIndent,\n\t\t\tpreviousLineText,\n\t\t\tbeforeEnterText,\n\t\t\tafterEnterText\n\t\t);\n\t}\n\n\tpublic getAutoClosingPairs(): AutoClosingPairs {\n\t\treturn new AutoClosingPairs(this.characterPair.getAutoClosingPairs());\n\t}\n\n\tpublic getAutoCloseBeforeSet(forQuotes: boolean): string {\n\t\treturn this.characterPair.getAutoCloseBeforeSet(forQuotes);\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this.characterPair.getSurroundingPairs();\n\t}\n\n\tprivate static _handleComments(\n\t\tconf: LanguageConfiguration\n\t): ICommentsConfiguration | null {\n\t\tconst commentRule = conf.comments;\n\t\tif (!commentRule) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// comment configuration\n\t\tconst comments: ICommentsConfiguration = {};\n\n\t\tif (commentRule.lineComment) {\n\t\t\tif (typeof commentRule.lineComment === 'string') {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment;\n\t\t\t} else {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment.comment;\n\t\t\t\tcomments.lineCommentNoIndent = commentRule.lineComment.noIndent;\n\t\t\t}\n\t\t}\n\t\tif (commentRule.blockComment) {\n\t\t\tconst [blockStart, blockEnd] = commentRule.blockComment;\n\t\t\tcomments.blockCommentStartToken = blockStart;\n\t\t\tcomments.blockCommentEndToken = blockEnd;\n\t\t}\n\n\t\treturn comments;\n\t}\n}\n\nregisterSingleton(ILanguageConfigurationService, LanguageConfigurationService, InstantiationType.Delayed);\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/languageConfigurationRegistry.ts","vs/editor/common/languages/languageConfigurationRegistry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAe,eAAe,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAuF,gBAAgB,EAAgD,MAAM,4BAA4B,CAAC;AACjM,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAqB,iBAAi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AC;YACxD,QAAQ,CAAC,sBAAsB,GAAG,UAAU,CAAC;YAC7C,QAAQ,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAED,iBAAiB,CAAC,6BAA6B,EAAE,4BAA4B,oCAA4B,CAAC","file":"languageConfigurationRegistry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { Disposable, IDisposable, markAsSingleton, toDisposable } from '../../../base/common/lifecycle.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { ITextModel } from '../model.js';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from './languageConfiguration.js';\nimport { CharacterPairSupport } from './supports/characterPair.js';\nimport { BracketElectricCharacterSupport } from './supports/electricCharacter.js';\nimport { IndentRulesSupport } from './supports/indentRules.js';\nimport { OnEnterSupport } from './supports/onEnter.js';\nimport { RichEditBrackets } from './supports/richEditBrackets.js';\nimport { EditorAutoIndentStrategy } from '../config/editorOptions.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { ILanguageService } from './language.js';\nimport { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js';\nimport { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js';\nimport { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js';\n\n/**\n * Interface used to support insertion of mode specific comments.\n */\nexport interface ICommentsConfiguration {\n\tlineCommentToken?: string;\n\tlineCommentNoIndent?: boolean;\n\tblockCommentStartToken?: string;\n\tblockCommentEndToken?: string;\n}\n\nexport interface ILanguageConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\treadonly onDidChange: Event<LanguageConfigurationServiceChangeEvent>;\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tregister(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable;\n\n\tgetLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;\n\n}\n\nexport class LanguageConfigurationServiceChangeEvent {\n\tconstructor(public readonly languageId: string | undefined) { }\n\n\tpublic affects(languageId: string): boolean {\n\t\treturn !this.languageId ? true : this.languageId === languageId;\n\t}\n}\n\nexport const ILanguageConfigurationService = createDecorator<ILanguageConfigurationService>('languageConfigurationService');\n\nexport class LanguageConfigurationService extends Disposable implements ILanguageConfigurationService {\n\t_serviceBrand: undefined;\n\n\tprivate readonly _registry = this._register(new LanguageConfigurationRegistry());\n\n\tprivate readonly onDidChangeEmitter = this._register(new Emitter<LanguageConfigurationServiceChangeEvent>());\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate readonly configurations = new Map<string, ResolvedLanguageConfiguration>();\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILanguageService private readonly languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tconst languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));\n\n\t\tthis._register(this.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tconst globalConfigChanged = e.change.keys.some((k) =>\n\t\t\t\tlanguageConfigKeys.has(k)\n\t\t\t);\n\t\t\tconst localConfigChanged = e.change.overrides\n\t\t\t\t.filter(([overrideLangName, keys]) =>\n\t\t\t\t\tkeys.some((k) => languageConfigKeys.has(k))\n\t\t\t\t)\n\t\t\t\t.map(([overrideLangName]) => overrideLangName);\n\n\t\t\tif (globalConfigChanged) {\n\t\t\t\tthis.configurations.clear();\n\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(undefined));\n\t\t\t} else {\n\t\t\t\tfor (const languageId of localConfigChanged) {\n\t\t\t\t\tif (this.languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t\t\t\tthis.configurations.delete(languageId);\n\t\t\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._registry.onDidChange((e) => {\n\t\t\tthis.configurations.delete(e.languageId);\n\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));\n\t\t}));\n\t}\n\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable {\n\t\treturn this._registry.register(languageId, configuration, priority);\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\tlet result = this.configurations.get(languageId);\n\t\tif (!result) {\n\t\t\tresult = computeConfig(languageId, this._registry, this.configurationService, this.languageService);\n\t\t\tthis.configurations.set(languageId, result);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction computeConfig(\n\tlanguageId: string,\n\tregistry: LanguageConfigurationRegistry,\n\tconfigurationService: IConfigurationService,\n\tlanguageService: ILanguageService,\n): ResolvedLanguageConfiguration {\n\tlet languageConfig = registry.getLanguageConfiguration(languageId);\n\n\tif (!languageConfig) {\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t// this happens for the null language, which can be returned by monarch.\n\t\t\t// Instead of throwing an error, we just return a default config.\n\t\t\treturn new ResolvedLanguageConfiguration(languageId, {});\n\t\t}\n\t\tlanguageConfig = new ResolvedLanguageConfiguration(languageId, {});\n\t}\n\n\tconst customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);\n\tconst data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);\n\tconst config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);\n\treturn config;\n}\n\nconst customizedLanguageConfigKeys = {\n\tbrackets: 'editor.language.brackets',\n\tcolorizedBracketPairs: 'editor.language.colorizedBracketPairs'\n};\n\nfunction getCustomizedLanguageConfig(languageId: string, configurationService: IConfigurationService): LanguageConfiguration {\n\tconst brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\tconst colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\treturn {\n\t\tbrackets: validateBracketPairs(brackets),\n\t\tcolorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),\n\t};\n}\n\nfunction validateBracketPairs(data: unknown): CharacterPair[] | undefined {\n\tif (!Array.isArray(data)) {\n\t\treturn undefined;\n\t}\n\treturn data.map(pair => {\n\t\tif (!Array.isArray(pair) || pair.length !== 2) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn [pair[0], pair[1]] as CharacterPair;\n\t}).filter((p): p is CharacterPair => !!p);\n}\n\nexport function getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\tconst lineText = model.getLineContent(lineNumber);\n\tlet indentation = strings.getLeadingWhitespace(lineText);\n\tif (indentation.length > column - 1) {\n\t\tindentation = indentation.substring(0, column - 1);\n\t}\n\treturn indentation;\n}\n\nclass ComposedLanguageConfiguration {\n\tprivate readonly _entries: LanguageConfigurationContribution[];\n\tprivate _order: number;\n\tprivate _resolved: ResolvedLanguageConfiguration | null = null;\n\n\tconstructor(public readonly languageId: string) {\n\t\tthis._entries = [];\n\t\tthis._order = 0;\n\t\tthis._resolved = null;\n\t}\n\n\tpublic register(\n\t\tconfiguration: LanguageConfiguration,\n\t\tpriority: number\n\t): IDisposable {\n\t\tconst entry = new LanguageConfigurationContribution(\n\t\t\tconfiguration,\n\t\t\tpriority,\n\t\t\t++this._order\n\t\t);\n\t\tthis._entries.push(entry);\n\t\tthis._resolved = null;\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tfor (let i = 0; i < this._entries.length; i++) {\n\t\t\t\tif (this._entries[i] === entry) {\n\t\t\t\t\tthis._entries.splice(i, 1);\n\t\t\t\t\tthis._resolved = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic getResolvedConfiguration(): ResolvedLanguageConfiguration | null {\n\t\tif (!this._resolved) {\n\t\t\tconst config = this._resolve();\n\t\t\tif (config) {\n\t\t\t\tthis._resolved = new ResolvedLanguageConfiguration(\n\t\t\t\t\tthis.languageId,\n\t\t\t\t\tconfig\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this._resolved;\n\t}\n\n\tprivate _resolve(): LanguageConfiguration | null {\n\t\tif (this._entries.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tthis._entries.sort(LanguageConfigurationContribution.cmp);\n\t\treturn combineLanguageConfigurations(this._entries.map(e => e.configuration));\n\t}\n}\n\nfunction combineLanguageConfigurations(configs: LanguageConfiguration[]): LanguageConfiguration {\n\tlet result: ExplicitLanguageConfiguration = {\n\t\tcomments: undefined,\n\t\tbrackets: undefined,\n\t\twordPattern: undefined,\n\t\tindentationRules: undefined,\n\t\tonEnterRules: undefined,\n\t\tautoClosingPairs: undefined,\n\t\tsurroundingPairs: undefined,\n\t\tautoCloseBefore: undefined,\n\t\tfolding: undefined,\n\t\tcolorizedBracketPairs: undefined,\n\t\t__electricCharacterSupport: undefined,\n\t};\n\tfor (const entry of configs) {\n\t\tresult = {\n\t\t\tcomments: entry.comments || result.comments,\n\t\t\tbrackets: entry.brackets || result.brackets,\n\t\t\twordPattern: entry.wordPattern || result.wordPattern,\n\t\t\tindentationRules: entry.indentationRules || result.indentationRules,\n\t\t\tonEnterRules: entry.onEnterRules || result.onEnterRules,\n\t\t\tautoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs,\n\t\t\tsurroundingPairs: entry.surroundingPairs || result.surroundingPairs,\n\t\t\tautoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore,\n\t\t\tfolding: entry.folding || result.folding,\n\t\t\tcolorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs,\n\t\t\t__electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport,\n\t\t};\n\t}\n\n\treturn result;\n}\n\nclass LanguageConfigurationContribution {\n\tconstructor(\n\t\tpublic readonly configuration: LanguageConfiguration,\n\t\tpublic readonly priority: number,\n\t\tpublic readonly order: number\n\t) { }\n\n\tpublic static cmp(a: LanguageConfigurationContribution, b: LanguageConfigurationContribution) {\n\t\tif (a.priority === b.priority) {\n\t\t\t// higher order last\n\t\t\treturn a.order - b.order;\n\t\t}\n\t\t// higher priority last\n\t\treturn a.priority - b.priority;\n\t}\n}\n\nexport class LanguageConfigurationChangeEvent {\n\tconstructor(public readonly languageId: string) { }\n}\n\nexport class LanguageConfigurationRegistry extends Disposable {\n\tprivate readonly _entries = new Map<string, ComposedLanguageConfiguration>();\n\n\tprivate readonly _onDidChange = this._register(new Emitter<LanguageConfigurationChangeEvent>());\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._register(this.register(PLAINTEXT_LANGUAGE_ID, {\n\t\t\tbrackets: [\n\t\t\t\t['(', ')'],\n\t\t\t\t['[', ']'],\n\t\t\t\t['{', '}'],\n\t\t\t],\n\t\t\tsurroundingPairs: [\n\t\t\t\t{ open: '{', close: '}' },\n\t\t\t\t{ open: '[', close: ']' },\n\t\t\t\t{ open: '(', close: ')' },\n\t\t\t\t{ open: '<', close: '>' },\n\t\t\t\t{ open: '\\\"', close: '\\\"' },\n\t\t\t\t{ open: '\\'', close: '\\'' },\n\t\t\t\t{ open: '`', close: '`' },\n\t\t\t],\n\t\t\tcolorizedBracketPairs: [],\n\t\t\tfolding: {\n\t\t\t\toffSide: true\n\t\t\t}\n\t\t}, 0));\n\t}\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority: number = 0): IDisposable {\n\t\tlet entries = this._entries.get(languageId);\n\t\tif (!entries) {\n\t\t\tentries = new ComposedLanguageConfiguration(languageId);\n\t\t\tthis._entries.set(languageId, entries);\n\t\t}\n\n\t\tconst disposable = entries.register(configuration, priority);\n\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tdisposable.dispose();\n\t\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\t\t}));\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration | null {\n\t\tconst entries = this._entries.get(languageId);\n\t\treturn entries?.getResolvedConfiguration() || null;\n\t}\n}\n\n/**\n * Immutable.\n*/\nexport class ResolvedLanguageConfiguration {\n\tprivate _brackets: RichEditBrackets | null;\n\tprivate _electricCharacter: BracketElectricCharacterSupport | null;\n\tprivate readonly _onEnterSupport: OnEnterSupport | null;\n\n\tpublic readonly comments: ICommentsConfiguration | null;\n\tpublic readonly characterPair: CharacterPairSupport;\n\tpublic readonly wordDefinition: RegExp;\n\tpublic readonly indentRulesSupport: IndentRulesSupport | null;\n\tpublic readonly indentationRules: IndentationRule | undefined;\n\tpublic readonly foldingRules: FoldingRules;\n\tpublic readonly bracketsNew: LanguageBracketsConfiguration;\n\n\tconstructor(\n\t\tpublic readonly languageId: string,\n\t\tpublic readonly underlyingConfig: LanguageConfiguration\n\t) {\n\t\tthis._brackets = null;\n\t\tthis._electricCharacter = null;\n\t\tthis._onEnterSupport =\n\t\t\tthis.underlyingConfig.brackets ||\n\t\t\t\tthis.underlyingConfig.indentationRules ||\n\t\t\t\tthis.underlyingConfig.onEnterRules\n\t\t\t\t? new OnEnterSupport(this.underlyingConfig)\n\t\t\t\t: null;\n\t\tthis.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);\n\t\tthis.characterPair = new CharacterPairSupport(this.underlyingConfig);\n\n\t\tthis.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP;\n\t\tthis.indentationRules = this.underlyingConfig.indentationRules;\n\t\tif (this.underlyingConfig.indentationRules) {\n\t\t\tthis.indentRulesSupport = new IndentRulesSupport(\n\t\t\t\tthis.underlyingConfig.indentationRules\n\t\t\t);\n\t\t} else {\n\t\t\tthis.indentRulesSupport = null;\n\t\t}\n\t\tthis.foldingRules = this.underlyingConfig.folding || {};\n\n\t\tthis.bracketsNew = new LanguageBracketsConfiguration(\n\t\t\tlanguageId,\n\t\t\tthis.underlyingConfig\n\t\t);\n\t}\n\n\tpublic getWordDefinition(): RegExp {\n\t\treturn ensureValidWordDefinition(this.wordDefinition);\n\t}\n\n\tpublic get brackets(): RichEditBrackets | null {\n\t\tif (!this._brackets && this.underlyingConfig.brackets) {\n\t\t\tthis._brackets = new RichEditBrackets(\n\t\t\t\tthis.languageId,\n\t\t\t\tthis.underlyingConfig.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._brackets;\n\t}\n\n\tpublic get electricCharacter(): BracketElectricCharacterSupport | null {\n\t\tif (!this._electricCharacter) {\n\t\t\tthis._electricCharacter = new BracketElectricCharacterSupport(\n\t\t\t\tthis.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._electricCharacter;\n\t}\n\n\tpublic onEnter(\n\t\tautoIndent: EditorAutoIndentStrategy,\n\t\tpreviousLineText: string,\n\t\tbeforeEnterText: string,\n\t\tafterEnterText: string\n\t): EnterAction | null {\n\t\tif (!this._onEnterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._onEnterSupport.onEnter(\n\t\t\tautoIndent,\n\t\t\tpreviousLineText,\n\t\t\tbeforeEnterText,\n\t\t\tafterEnterText\n\t\t);\n\t}\n\n\tpublic getAutoClosingPairs(): AutoClosingPairs {\n\t\treturn new AutoClosingPairs(this.characterPair.getAutoClosingPairs());\n\t}\n\n\tpublic getAutoCloseBeforeSet(forQuotes: boolean): string {\n\t\treturn this.characterPair.getAutoCloseBeforeSet(forQuotes);\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this.characterPair.getSurroundingPairs();\n\t}\n\n\tprivate static _handleComments(\n\t\tconf: LanguageConfiguration\n\t): ICommentsConfiguration | null {\n\t\tconst commentRule = conf.comments;\n\t\tif (!commentRule) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// comment configuration\n\t\tconst comments: ICommentsConfiguration = {};\n\n\t\tif (commentRule.lineComment) {\n\t\t\tif (typeof commentRule.lineComment === 'string') {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment;\n\t\t\t} else {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment.comment;\n\t\t\t\tcomments.lineCommentNoIndent = commentRule.lineComment.noIndent;\n\t\t\t}\n\t\t}\n\t\tif (commentRule.blockComment) {\n\t\t\tconst [blockStart, blockEnd] = commentRule.blockComment;\n\t\t\tcomments.blockCommentStartToken = blockStart;\n\t\t\tcomments.blockCommentEndToken = blockEnd;\n\t\t}\n\n\t\treturn comments;\n\t}\n}\n\nregisterSingleton(ILanguageConfigurationService, LanguageConfigurationService, InstantiationType.Delayed);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { Disposable, IDisposable, markAsSingleton, toDisposable } from '../../../base/common/lifecycle.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { ITextModel } from '../model.js';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from './languageConfiguration.js';\nimport { CharacterPairSupport } from './supports/characterPair.js';\nimport { BracketElectricCharacterSupport } from './supports/electricCharacter.js';\nimport { IndentRulesSupport } from './supports/indentRules.js';\nimport { OnEnterSupport } from './supports/onEnter.js';\nimport { RichEditBrackets } from './supports/richEditBrackets.js';\nimport { EditorAutoIndentStrategy } from '../config/editorOptions.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { ILanguageService } from './language.js';\nimport { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js';\nimport { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js';\nimport { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js';\n\n/**\n * Interface used to support insertion of mode specific comments.\n */\nexport interface ICommentsConfiguration {\n\tlineCommentToken?: string;\n\tlineCommentNoIndent?: boolean;\n\tblockCommentStartToken?: string;\n\tblockCommentEndToken?: string;\n}\n\nexport interface ILanguageConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\treadonly onDidChange: Event<LanguageConfigurationServiceChangeEvent>;\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tregister(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable;\n\n\tgetLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;\n\n}\n\nexport class LanguageConfigurationServiceChangeEvent {\n\tconstructor(public readonly languageId: string | undefined) { }\n\n\tpublic affects(languageId: string): boolean {\n\t\treturn !this.languageId ? true : this.languageId === languageId;\n\t}\n}\n\nexport const ILanguageConfigurationService = createDecorator<ILanguageConfigurationService>('languageConfigurationService');\n\nexport class LanguageConfigurationService extends Disposable implements ILanguageConfigurationService {\n\t_serviceBrand: undefined;\n\n\tprivate readonly _registry = this._register(new LanguageConfigurationRegistry());\n\n\tprivate readonly onDidChangeEmitter = this._register(new Emitter<LanguageConfigurationServiceChangeEvent>());\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate readonly configurations = new Map<string, ResolvedLanguageConfiguration>();\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILanguageService private readonly languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tconst languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));\n\n\t\tthis._register(this.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tconst globalConfigChanged = e.change.keys.some((k) =>\n\t\t\t\tlanguageConfigKeys.has(k)\n\t\t\t);\n\t\t\tconst localConfigChanged = e.change.overrides\n\t\t\t\t.filter(([overrideLangName, keys]) =>\n\t\t\t\t\tkeys.some((k) => languageConfigKeys.has(k))\n\t\t\t\t)\n\t\t\t\t.map(([overrideLangName]) => overrideLangName);\n\n\t\t\tif (globalConfigChanged) {\n\t\t\t\tthis.configurations.clear();\n\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(undefined));\n\t\t\t} else {\n\t\t\t\tfor (const languageId of localConfigChanged) {\n\t\t\t\t\tif (this.languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t\t\t\tthis.configurations.delete(languageId);\n\t\t\t\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._registry.onDidChange((e) => {\n\t\t\tthis.configurations.delete(e.languageId);\n\t\t\tthis.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));\n\t\t}));\n\t}\n\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable {\n\t\treturn this._registry.register(languageId, configuration, priority);\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\tlet result = this.configurations.get(languageId);\n\t\tif (!result) {\n\t\t\tresult = computeConfig(languageId, this._registry, this.configurationService, this.languageService);\n\t\t\tthis.configurations.set(languageId, result);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction computeConfig(\n\tlanguageId: string,\n\tregistry: LanguageConfigurationRegistry,\n\tconfigurationService: IConfigurationService,\n\tlanguageService: ILanguageService,\n): ResolvedLanguageConfiguration {\n\tlet languageConfig = registry.getLanguageConfiguration(languageId);\n\n\tif (!languageConfig) {\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\t// this happens for the null language, which can be returned by monarch.\n\t\t\t// Instead of throwing an error, we just return a default config.\n\t\t\treturn new ResolvedLanguageConfiguration(languageId, {});\n\t\t}\n\t\tlanguageConfig = new ResolvedLanguageConfiguration(languageId, {});\n\t}\n\n\tconst customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);\n\tconst data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);\n\tconst config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);\n\treturn config;\n}\n\nconst customizedLanguageConfigKeys = {\n\tbrackets: 'editor.language.brackets',\n\tcolorizedBracketPairs: 'editor.language.colorizedBracketPairs'\n};\n\nfunction getCustomizedLanguageConfig(languageId: string, configurationService: IConfigurationService): LanguageConfiguration {\n\tconst brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\tconst colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {\n\t\toverrideIdentifier: languageId,\n\t});\n\n\treturn {\n\t\tbrackets: validateBracketPairs(brackets),\n\t\tcolorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),\n\t};\n}\n\nfunction validateBracketPairs(data: unknown): CharacterPair[] | undefined {\n\tif (!Array.isArray(data)) {\n\t\treturn undefined;\n\t}\n\treturn data.map(pair => {\n\t\tif (!Array.isArray(pair) || pair.length !== 2) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn [pair[0], pair[1]] as CharacterPair;\n\t}).filter((p): p is CharacterPair => !!p);\n}\n\nexport function getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\tconst lineText = model.getLineContent(lineNumber);\n\tlet indentation = strings.getLeadingWhitespace(lineText);\n\tif (indentation.length > column - 1) {\n\t\tindentation = indentation.substring(0, column - 1);\n\t}\n\treturn indentation;\n}\n\nclass ComposedLanguageConfiguration {\n\tprivate readonly _entries: LanguageConfigurationContribution[];\n\tprivate _order: number;\n\tprivate _resolved: ResolvedLanguageConfiguration | null = null;\n\n\tconstructor(public readonly languageId: string) {\n\t\tthis._entries = [];\n\t\tthis._order = 0;\n\t\tthis._resolved = null;\n\t}\n\n\tpublic register(\n\t\tconfiguration: LanguageConfiguration,\n\t\tpriority: number\n\t): IDisposable {\n\t\tconst entry = new LanguageConfigurationContribution(\n\t\t\tconfiguration,\n\t\t\tpriority,\n\t\t\t++this._order\n\t\t);\n\t\tthis._entries.push(entry);\n\t\tthis._resolved = null;\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tfor (let i = 0; i < this._entries.length; i++) {\n\t\t\t\tif (this._entries[i] === entry) {\n\t\t\t\t\tthis._entries.splice(i, 1);\n\t\t\t\t\tthis._resolved = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic getResolvedConfiguration(): ResolvedLanguageConfiguration | null {\n\t\tif (!this._resolved) {\n\t\t\tconst config = this._resolve();\n\t\t\tif (config) {\n\t\t\t\tthis._resolved = new ResolvedLanguageConfiguration(\n\t\t\t\t\tthis.languageId,\n\t\t\t\t\tconfig\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this._resolved;\n\t}\n\n\tprivate _resolve(): LanguageConfiguration | null {\n\t\tif (this._entries.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tthis._entries.sort(LanguageConfigurationContribution.cmp);\n\t\treturn combineLanguageConfigurations(this._entries.map(e => e.configuration));\n\t}\n}\n\nfunction combineLanguageConfigurations(configs: LanguageConfiguration[]): LanguageConfiguration {\n\tlet result: ExplicitLanguageConfiguration = {\n\t\tcomments: undefined,\n\t\tbrackets: undefined,\n\t\twordPattern: undefined,\n\t\tindentationRules: undefined,\n\t\tonEnterRules: undefined,\n\t\tautoClosingPairs: undefined,\n\t\tsurroundingPairs: undefined,\n\t\tautoCloseBefore: undefined,\n\t\tfolding: undefined,\n\t\tcolorizedBracketPairs: undefined,\n\t\t__electricCharacterSupport: undefined,\n\t};\n\tfor (const entry of configs) {\n\t\tresult = {\n\t\t\tcomments: entry.comments || result.comments,\n\t\t\tbrackets: entry.brackets || result.brackets,\n\t\t\twordPattern: entry.wordPattern || result.wordPattern,\n\t\t\tindentationRules: entry.indentationRules || result.indentationRules,\n\t\t\tonEnterRules: entry.onEnterRules || result.onEnterRules,\n\t\t\tautoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs,\n\t\t\tsurroundingPairs: entry.surroundingPairs || result.surroundingPairs,\n\t\t\tautoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore,\n\t\t\tfolding: entry.folding || result.folding,\n\t\t\tcolorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs,\n\t\t\t__electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport,\n\t\t};\n\t}\n\n\treturn result;\n}\n\nclass LanguageConfigurationContribution {\n\tconstructor(\n\t\tpublic readonly configuration: LanguageConfiguration,\n\t\tpublic readonly priority: number,\n\t\tpublic readonly order: number\n\t) { }\n\n\tpublic static cmp(a: LanguageConfigurationContribution, b: LanguageConfigurationContribution) {\n\t\tif (a.priority === b.priority) {\n\t\t\t// higher order last\n\t\t\treturn a.order - b.order;\n\t\t}\n\t\t// higher priority last\n\t\treturn a.priority - b.priority;\n\t}\n}\n\nexport class LanguageConfigurationChangeEvent {\n\tconstructor(public readonly languageId: string) { }\n}\n\nexport class LanguageConfigurationRegistry extends Disposable {\n\tprivate readonly _entries = new Map<string, ComposedLanguageConfiguration>();\n\n\tprivate readonly _onDidChange = this._register(new Emitter<LanguageConfigurationChangeEvent>());\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._register(this.register(PLAINTEXT_LANGUAGE_ID, {\n\t\t\tbrackets: [\n\t\t\t\t['(', ')'],\n\t\t\t\t['[', ']'],\n\t\t\t\t['{', '}'],\n\t\t\t],\n\t\t\tsurroundingPairs: [\n\t\t\t\t{ open: '{', close: '}' },\n\t\t\t\t{ open: '[', close: ']' },\n\t\t\t\t{ open: '(', close: ')' },\n\t\t\t\t{ open: '<', close: '>' },\n\t\t\t\t{ open: '\\\"', close: '\\\"' },\n\t\t\t\t{ open: '\\'', close: '\\'' },\n\t\t\t\t{ open: '`', close: '`' },\n\t\t\t],\n\t\t\tcolorizedBracketPairs: [],\n\t\t\tfolding: {\n\t\t\t\toffSide: true\n\t\t\t}\n\t\t}, 0));\n\t}\n\n\t/**\n\t * @param priority Use a higher number for higher priority\n\t */\n\tpublic register(languageId: string, configuration: LanguageConfiguration, priority: number = 0): IDisposable {\n\t\tlet entries = this._entries.get(languageId);\n\t\tif (!entries) {\n\t\t\tentries = new ComposedLanguageConfiguration(languageId);\n\t\t\tthis._entries.set(languageId, entries);\n\t\t}\n\n\t\tconst disposable = entries.register(configuration, priority);\n\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\n\t\treturn markAsSingleton(toDisposable(() => {\n\t\t\tdisposable.dispose();\n\t\t\tthis._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n\t\t}));\n\t}\n\n\tpublic getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration | null {\n\t\tconst entries = this._entries.get(languageId);\n\t\treturn entries?.getResolvedConfiguration() || null;\n\t}\n}\n\n/**\n * Immutable.\n*/\nexport class ResolvedLanguageConfiguration {\n\tprivate _brackets: RichEditBrackets | null;\n\tprivate _electricCharacter: BracketElectricCharacterSupport | null;\n\tprivate readonly _onEnterSupport: OnEnterSupport | null;\n\n\tpublic readonly comments: ICommentsConfiguration | null;\n\tpublic readonly characterPair: CharacterPairSupport;\n\tpublic readonly wordDefinition: RegExp;\n\tpublic readonly indentRulesSupport: IndentRulesSupport | null;\n\tpublic readonly indentationRules: IndentationRule | undefined;\n\tpublic readonly foldingRules: FoldingRules;\n\tpublic readonly bracketsNew: LanguageBracketsConfiguration;\n\n\tconstructor(\n\t\tpublic readonly languageId: string,\n\t\tpublic readonly underlyingConfig: LanguageConfiguration\n\t) {\n\t\tthis._brackets = null;\n\t\tthis._electricCharacter = null;\n\t\tthis._onEnterSupport =\n\t\t\tthis.underlyingConfig.brackets ||\n\t\t\t\tthis.underlyingConfig.indentationRules ||\n\t\t\t\tthis.underlyingConfig.onEnterRules\n\t\t\t\t? new OnEnterSupport(this.underlyingConfig)\n\t\t\t\t: null;\n\t\tthis.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);\n\t\tthis.characterPair = new CharacterPairSupport(this.underlyingConfig);\n\n\t\tthis.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP;\n\t\tthis.indentationRules = this.underlyingConfig.indentationRules;\n\t\tif (this.underlyingConfig.indentationRules) {\n\t\t\tthis.indentRulesSupport = new IndentRulesSupport(\n\t\t\t\tthis.underlyingConfig.indentationRules\n\t\t\t);\n\t\t} else {\n\t\t\tthis.indentRulesSupport = null;\n\t\t}\n\t\tthis.foldingRules = this.underlyingConfig.folding || {};\n\n\t\tthis.bracketsNew = new LanguageBracketsConfiguration(\n\t\t\tlanguageId,\n\t\t\tthis.underlyingConfig\n\t\t);\n\t}\n\n\tpublic getWordDefinition(): RegExp {\n\t\treturn ensureValidWordDefinition(this.wordDefinition);\n\t}\n\n\tpublic get brackets(): RichEditBrackets | null {\n\t\tif (!this._brackets && this.underlyingConfig.brackets) {\n\t\t\tthis._brackets = new RichEditBrackets(\n\t\t\t\tthis.languageId,\n\t\t\t\tthis.underlyingConfig.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._brackets;\n\t}\n\n\tpublic get electricCharacter(): BracketElectricCharacterSupport | null {\n\t\tif (!this._electricCharacter) {\n\t\t\tthis._electricCharacter = new BracketElectricCharacterSupport(\n\t\t\t\tthis.brackets\n\t\t\t);\n\t\t}\n\t\treturn this._electricCharacter;\n\t}\n\n\tpublic onEnter(\n\t\tautoIndent: EditorAutoIndentStrategy,\n\t\tpreviousLineText: string,\n\t\tbeforeEnterText: string,\n\t\tafterEnterText: string\n\t): EnterAction | null {\n\t\tif (!this._onEnterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._onEnterSupport.onEnter(\n\t\t\tautoIndent,\n\t\t\tpreviousLineText,\n\t\t\tbeforeEnterText,\n\t\t\tafterEnterText\n\t\t);\n\t}\n\n\tpublic getAutoClosingPairs(): AutoClosingPairs {\n\t\treturn new AutoClosingPairs(this.characterPair.getAutoClosingPairs());\n\t}\n\n\tpublic getAutoCloseBeforeSet(forQuotes: boolean): string {\n\t\treturn this.characterPair.getAutoCloseBeforeSet(forQuotes);\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this.characterPair.getSurroundingPairs();\n\t}\n\n\tprivate static _handleComments(\n\t\tconf: LanguageConfiguration\n\t): ICommentsConfiguration | null {\n\t\tconst commentRule = conf.comments;\n\t\tif (!commentRule) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// comment configuration\n\t\tconst comments: ICommentsConfiguration = {};\n\n\t\tif (commentRule.lineComment) {\n\t\t\tif (typeof commentRule.lineComment === 'string') {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment;\n\t\t\t} else {\n\t\t\t\tcomments.lineCommentToken = commentRule.lineComment.comment;\n\t\t\t\tcomments.lineCommentNoIndent = commentRule.lineComment.noIndent;\n\t\t\t}\n\t\t}\n\t\tif (commentRule.blockComment) {\n\t\t\tconst [blockStart, blockEnd] = commentRule.blockComment;\n\t\t\tcomments.blockCommentStartToken = blockStart;\n\t\t\tcomments.blockCommentEndToken = blockEnd;\n\t\t}\n\n\t\treturn comments;\n\t}\n}\n\nregisterSingleton(ILanguageConfigurationService, LanguageConfigurationService, InstantiationType.Delayed);\n"]}