{"version":3,"sources":["out-editor/vs/editor/fake","out-editor/vs/editor/vs/css.js","out-editor/vs/editor/vs/nls.js","out-editor/vs/editor/vs/base/browser/dompurify/dompurify.js","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/fastDomNode.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/iframe.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/list.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/splice.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarState.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/tree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/arrays.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/assert.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/buffer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/cache.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/codicons.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/collections.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/color.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/decorators.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/diff/diffChange.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/errors.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/functional.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/idGenerator.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/iterator.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/keyCodes.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/keybindings.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/lazy.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/lifecycle.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/linkedList.ts","out-editor/vs/editor/vs/base/common/marked/marked.js","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/mime.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/dnd.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/navigator.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/history.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/numbers.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/platform.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/process.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/path.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/range.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/rangeMap.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/stopwatch.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/event.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/browser.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/canIUse.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/event.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/keyboardEvent.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/mouseEvent.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/cancellation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/async.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/comparers.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/scrollable.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/strings.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/extpath.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/hash.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/diff/diff.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/indexTreeModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/objectTreeModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/compressedObjectTreeModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/map.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/filters.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/fuzzyScorer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/glob.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/iconLabels.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/htmlContent.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/search.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/severity.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/types.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/objects.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/uint.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/uri.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/marshalling.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/network.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/dom.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/formattedTextRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/globalMouseMoveMonitor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/touch.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabels.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/rowCache.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/widget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/resources.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/markdownRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/labels.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/uuid.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/worker/simpleWorker.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/defaultWorkerFactory.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/quickinput/common/quickInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/storage/common/storage.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/aria/aria.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/button/button.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/checkbox/checkbox.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/codicons/codiconStyles.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/countBadge/countBadge.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/mouseCursor/mouseCursor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/progressbar/progressbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/sash/sash.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollableElement.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/hover/hoverWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/listView.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/listWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/list/listPaging.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/splitview/splitview.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/table/tableWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/quickinput/browser/quickInputUtils.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/elementSizeObserver.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/migrateOptions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/tabFocus.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/stableEditorScroll.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/renderingContext.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/viewUserInputEvents.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/lines/rangeUtil.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimapCharSheet.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/config/editorZoom.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/config/fontInfo.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/characterClassifier.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/cursorColumns.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/eolCounter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/indentation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/position.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/range.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/textAreaState.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/diffNavigator.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/editOperation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/rgba.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/selection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/textAreaInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/commands/replaceCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/commands/surroundSelectionCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/stringBuilder.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/viewLayer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/textChange.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/textModelDefaults.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/wordCharacterClassifier.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/wordHelper.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorAtomicMoveOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorContext.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/diff/diffComputer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/editorAction.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/editorCommon.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/editorBrowser.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/editorTheme.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languageSelector.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/languageConfiguration.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/linkComputer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursorCommon.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorColumnSelection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorMoveOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorDeleteOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorWordOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorMoveCommands.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/oneCursor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorCollection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/characterPair.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/indentRules.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/onEnter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/richEditBrackets.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/electricCharacter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/supports/tokenization.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languageFeatureRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/indentationGuesser.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/intervalTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/prefixSumComputer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/mirrorTextModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/textModelPart.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/textModelSearch.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/utils.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/modelLineProjectionData.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languagesAssociations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/semanticTokensDto.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/unicodeTextModelHighlighter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/standalone/standaloneEnums.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/textModelBracketPairs.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/textModelEvents.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/textModelGuides.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/guidesTextModelPart.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokenizationRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/nullTokenize.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/editorBaseApi.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/editorSimpleWorker.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/contiguousMultilineTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/contiguousMultilineTokensBuilder.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/lineTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/textToHtmlTokenizer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/textModelTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/contiguousTokensEditing.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/contiguousTokensStore.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/sparseMultilineTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/tokens/sparseTokensStore.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewEventHandler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/dynamicViewOverlay.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/viewPart.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/decorations/decorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/margin/margin.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/viewZones/viewZones.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewEvents.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewLayout/lineDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewLayout/linesLayout.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewLayout/viewLineRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewLayout/viewLinesViewportData.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/minimapTokensColorTracker.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/modelLineProjection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/overviewZoneManager.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/viewContext.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModelEventDispatcher.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewLayout/viewLayout.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/caretOperations/browser/moveCaretCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/types.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorPickerModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/comment/browser/blockCommentCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/dnd/browser/dragAndDropCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/replaceAllCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/replacePattern.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/foldingRanges.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/foldingModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/hiddenRangeModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/indentRangeProvider.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/syntaxRangeProvider.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/intializingRangeProvider.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/format/browser/formattingEdit.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/hoverOperation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/hoverTypes.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/indentation/browser/indentUtils.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHints.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/consts.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/ghostText.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionToGhostText.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/utils.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/linesOperations/browser/sortLinesCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/smartSelect/browser/bracketSelections.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/smartSelect/browser/wordSelections.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/snippet/browser/snippetParser.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/completionModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/resizable.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/wordDistance.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCommon.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCompile.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchLexer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/colorizer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/findinput/findInputCheckboxes.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabelHover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/abstractTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/dataTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/objectTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/tree/asyncDataTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/actions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/actionbar/actionViewItems.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/actionbar/actionbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/dropdown/dropdown.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/inputbox/inputBox.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/findinput/findInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/findinput/replaceInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/menu/menu.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/quickinput/browser/quickInputBox.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/errorMessage.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/common/keybindingLabels.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/quickinput/browser/quickInputList.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/base/parts/quickinput/browser/quickInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/inlineDiffMargin.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/config/editorOptions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/domFontInfo.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/charWidthReader.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/fontMeasurements.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/domLineBreaksComputer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/viewOverlays.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/viewModelDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/editStack.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/standaloneStrings.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/referencesModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/editor/common/editor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/extensions/common/extensions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/files/common/files.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/history/browser/historyWidgetKeybindingHint.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/descriptors.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/extensions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/graph.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/instantiation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/bulkEditService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/codeEditorService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/language.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/editorWorker.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languageFeatures.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languageFeaturesService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/markerDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/model.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/resolverService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/textResourceConfiguration.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/common/standaloneTheme.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/clipboard/common/clipboardService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/commands/common/commands.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/getSemanticTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codelens/browser/codelens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/color.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/links/browser/getLinks.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/configuration/common/configuration.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/languageConfigurationRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/commands/shiftCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursorTypeOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/cursor/cursor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/comment/browser/lineCommentCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextkey/common/contextkey.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/editorContextKeys.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestAlternatives.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/wordContextKey.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/accessibility/common/accessibility.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/config/editorConfiguration.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/accessibility/browser/accessibilityService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextkey/browser/contextKeyService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextkey/common/contextkeys.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextview/browser/contextView.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/dialogs/common/dialogs.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/serviceCollection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/instantiation/common/instantiationService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/abstractKeybindingService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/baseResolvedKeybinding.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/keybinding.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/keybindingResolver.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/resolvedKeybindingItem.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/label/common/label.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/layout/browser/layoutService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneLayoutService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextview/browser/contextViewService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/log/common/log.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/editorWorkerService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/webWorker.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languageFeatureDebounce.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/documentSymbols/browser/documentSymbols.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/clipboard/browser/clipboardService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/markers/common/markers.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/markers/common/markerService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/notification/common/notification.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/opener/common/opener.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/openerService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/progress/common/progress.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/browser/pickerQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/common/quickInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/registry/common/platform.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/configuration/common/configurationRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/config/editorConfigurationSchema.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/languages/modesRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/getIconClasses.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languagesRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/languageService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/markdownRenderer/browser/markdownRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/marginHover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/configuration/common/configurationModels.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/keybinding/common/keybindingsRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/history/browser/contextScopedHistoryWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/common/quickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/browser/helpQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/browser/quickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/storage/common/storage.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codelens/browser/codeLensCache.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestMemory.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/telemetry/common/telemetry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/browser/commandsQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/common/colorRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/editorDom.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/common/styler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextview/browser/contextMenuHandler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/common/theme.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/lines/viewLine.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/mouseTarget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/mouseHandler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/pointerHandler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/lines/viewLines.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/common/themeService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/abstractCodeEditorService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimap.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/selections/selections.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/core/editorColorRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/controller/textAreaHandler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/rulers/rulers.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/markerDecorationsService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/semanticTokensProviderStyling.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/rename/browser/renameInputField.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneCodeEditorService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/common/themes.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/actions/common/actions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/editorExtensions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/coreCommands.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/services/markerDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view/viewController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/view.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/anchorSelect/browser/anchorSelect.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/caretOperations/browser/caretOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/caretOperations/browser/transpose.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/clipboard/browser/clipboard.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/comment/browser/comment.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/contextmenu/browser/contextmenu.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/cursorUndo/browser/cursorUndo.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/editorState/browser/editorState.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeAction.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeActionModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/fontZoom/browser/fontZoom.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/format/browser/format.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/format/browser/formatActions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/getHover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/indentation/browser/indentation.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/lineSelection/browser/lineSelection.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/linesOperations/browser/linesOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/message/browser/messageController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeActionUi.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeActionCommands.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/rename/browser/rename.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/smartSelect/browser/smartSelect.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggest.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/tokenization/browser/tokenization.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/wordOperations/browser/wordOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/actions/browser/menuEntryActionViewItem.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/actions/common/menuService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/contextview/browser/contextMenuService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/list/browser/listService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/opener/browser/link.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/quickinput/browser/quickInput.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/severityIcon/common/severityIcon.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/common/iconRegistry.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/diffReview.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/parameterHints/browser/parameterHints.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/theme/browser/iconsStyleSheet.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneThemeService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/undoRedo/common/undoRedo.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/model/textModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/services/modelService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/viewModelLines.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/common/viewModel/viewModelImpl.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/codeEditorWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/diffEditorWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/bracketMatching/browser/bracketMatching.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codelens/browser/codelensWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/codelens/browser/codelensController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/dnd/browser/dnd.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findOptionsWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findState.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/find/browser/findController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/foldingDecorations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/folding/browser/folding.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/links/browser/links.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/multicursor/browser/multicursor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/viewportSemanticTokens/browser/viewportSemanticTokens.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/peekView/browser/peekView.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoError/browser/gotoError.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/hover/browser/hover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorContributions.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/undoRedo/common/undoRedoService.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/workspace/common/workspace.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/snippet/browser/snippetVariables.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/snippet/browser/snippetSession.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/snippet/browser/snippetController2.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetPreviewModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/ghostTextModel.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/ghostTextController.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHoverParticipant.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsContribution.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/platform/workspace/common/workspaceTrust.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/editor.all.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneServices.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneCodeEditor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneEditor.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/standalone/browser/standaloneLanguages.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/editor.api.ts","out-editor/vs/editor/file:/home/runner/work/monaco-editor/monaco-editor/vscode/out-editor-src/vs/editor/editor.main.ts"],"sourcesContent":["}).call(this);","/*---------------------------------------------------------------------------------------------\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/*---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nvar CSSLoaderPlugin;\n(function (CSSLoaderPlugin) {\n /**\n * Known issue:\n * - In IE there is no way to know if the CSS file loaded successfully or not.\n */\n var BrowserCSSLoader = /** @class */ (function () {\n function BrowserCSSLoader() {\n this._pendingLoads = 0;\n }\n BrowserCSSLoader.prototype.attachListeners = function (name, linkNode, callback, errorback) {\n var unbind = function () {\n linkNode.removeEventListener('load', loadEventListener);\n linkNode.removeEventListener('error', errorEventListener);\n };\n var loadEventListener = function (e) {\n unbind();\n callback();\n };\n var errorEventListener = function (e) {\n unbind();\n errorback(e);\n };\n linkNode.addEventListener('load', loadEventListener);\n linkNode.addEventListener('error', errorEventListener);\n };\n BrowserCSSLoader.prototype._onLoad = function (name, callback) {\n this._pendingLoads--;\n callback();\n };\n BrowserCSSLoader.prototype._onLoadError = function (name, errorback, err) {\n this._pendingLoads--;\n errorback(err);\n };\n BrowserCSSLoader.prototype._insertLinkNode = function (linkNode) {\n this._pendingLoads++;\n var head = document.head || document.getElementsByTagName('head')[0];\n head.appendChild(linkNode);\n };\n BrowserCSSLoader.prototype.createLinkTag = function (name, cssUrl, externalCallback, externalErrorback) {\n var _this = this;\n var linkNode = document.createElement('link');\n linkNode.setAttribute('rel', 'stylesheet');\n linkNode.setAttribute('type', 'text/css');\n linkNode.setAttribute('data-name', name);\n var callback = function () { return _this._onLoad(name, externalCallback); };\n var errorback = function (err) { return _this._onLoadError(name, externalErrorback, err); };\n this.attachListeners(name, linkNode, callback, errorback);\n linkNode.setAttribute('href', cssUrl);\n return linkNode;\n };\n BrowserCSSLoader.prototype._linkTagExists = function (name, cssUrl) {\n var i, len, nameAttr, hrefAttr, links = document.getElementsByTagName('link');\n for (i = 0, len = links.length; i < len; i++) {\n nameAttr = links[i].getAttribute('data-name');\n hrefAttr = links[i].getAttribute('href');\n if (nameAttr === name || hrefAttr === cssUrl) {\n return true;\n }\n }\n return false;\n };\n BrowserCSSLoader.prototype.load = function (name, cssUrl, externalCallback, externalErrorback) {\n if (this._linkTagExists(name, cssUrl)) {\n externalCallback();\n return;\n }\n var linkNode = this.createLinkTag(name, cssUrl, externalCallback, externalErrorback);\n this._insertLinkNode(linkNode);\n };\n return BrowserCSSLoader;\n }());\n // ------------------------------ Finally, the plugin\n var CSSPlugin = /** @class */ (function () {\n function CSSPlugin() {\n this._cssLoader = new BrowserCSSLoader();\n }\n CSSPlugin.prototype.load = function (name, req, load, config) {\n config = config || {};\n var cssConfig = config['vs/css'] || {};\n if (cssConfig.disabled) {\n // the plugin is asked to not create any style sheets\n load({});\n return;\n }\n var cssUrl = req.toUrl(name + '.css');\n this._cssLoader.load(name, cssUrl, function (contents) {\n load({});\n }, function (err) {\n if (typeof load.error === 'function') {\n load.error('Could not find ' + cssUrl + ' or it was empty');\n }\n });\n };\n return CSSPlugin;\n }());\n CSSLoaderPlugin.CSSPlugin = CSSPlugin;\n define('vs/css', new CSSPlugin());\n})(CSSLoaderPlugin || (CSSLoaderPlugin = {}));\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/*---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar NLSLoaderPlugin;\n(function (NLSLoaderPlugin) {\n var Environment = /** @class */ (function () {\n function Environment() {\n this._detected = false;\n this._isPseudo = false;\n }\n Object.defineProperty(Environment.prototype, \"isPseudo\", {\n get: function () {\n this._detect();\n return this._isPseudo;\n },\n enumerable: false,\n configurable: true\n });\n Environment.prototype._detect = function () {\n if (this._detected) {\n return;\n }\n this._detected = true;\n this._isPseudo = (typeof document !== 'undefined' && document.location && document.location.hash.indexOf('pseudo=true') >= 0);\n };\n return Environment;\n }());\n function _format(message, args, env) {\n var result;\n if (args.length === 0) {\n result = message;\n }\n else {\n result = message.replace(/\\{(\\d+)\\}/g, function (match, rest) {\n var index = rest[0];\n var arg = args[index];\n var result = match;\n if (typeof arg === 'string') {\n result = arg;\n }\n else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n result = String(arg);\n }\n return result;\n });\n }\n if (env.isPseudo) {\n // FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n result = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n }\n return result;\n }\n function findLanguageForModule(config, name) {\n var result = config[name];\n if (result)\n return result;\n result = config['*'];\n if (result)\n return result;\n return null;\n }\n function localize(env, data, message) {\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return _format(message, args, env);\n }\n function createScopedLocalize(scope, env) {\n return function (idx, defaultValue) {\n var restArgs = Array.prototype.slice.call(arguments, 2);\n return _format(scope[idx], restArgs, env);\n };\n }\n var NLSPlugin = /** @class */ (function () {\n function NLSPlugin(env) {\n var _this = this;\n this._env = env;\n this.localize = function (data, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return localize.apply(void 0, __spreadArrays([_this._env, data, message], args));\n };\n }\n NLSPlugin.prototype.setPseudoTranslation = function (value) {\n this._env._isPseudo = value;\n };\n NLSPlugin.prototype.create = function (key, data) {\n return {\n localize: createScopedLocalize(data[key], this._env)\n };\n };\n NLSPlugin.prototype.load = function (name, req, load, config) {\n var _this = this;\n config = config || {};\n if (!name || name.length === 0) {\n load({\n localize: this.localize\n });\n }\n else {\n var pluginConfig = config['vs/nls'] || {};\n var language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null;\n var suffix = '.nls';\n if (language !== null && language !== NLSPlugin.DEFAULT_TAG) {\n suffix = suffix + '.' + language;\n }\n var messagesLoaded_1 = function (messages) {\n if (Array.isArray(messages)) {\n messages.localize = createScopedLocalize(messages, _this._env);\n }\n else {\n messages.localize = createScopedLocalize(messages[name], _this._env);\n }\n load(messages);\n };\n if (typeof pluginConfig.loadBundle === 'function') {\n pluginConfig.loadBundle(name, language, function (err, messages) {\n // We have an error. Load the English default strings to not fail\n if (err) {\n req([name + '.nls'], messagesLoaded_1);\n }\n else {\n messagesLoaded_1(messages);\n }\n });\n }\n else {\n req([name + suffix], messagesLoaded_1);\n }\n }\n };\n NLSPlugin.DEFAULT_TAG = 'i-default';\n return NLSPlugin;\n }());\n NLSLoaderPlugin.NLSPlugin = NLSPlugin;\n define('vs/nls', new NLSPlugin(new Environment()));\n})(NLSLoaderPlugin || (NLSLoaderPlugin = {}));\n","/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar hasOwnProperty = Object.hasOwnProperty,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\n\nvar _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\n\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\n\nif (!construct) {\n construct = function construct(Func, args) {\n return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();\n };\n}\n\nvar arrayForEach = unapply(Array.prototype.forEach);\nvar arrayPop = unapply(Array.prototype.pop);\nvar arrayPush = unapply(Array.prototype.push);\n\nvar stringToLowerCase = unapply(String.prototype.toLowerCase);\nvar stringMatch = unapply(String.prototype.match);\nvar stringReplace = unapply(String.prototype.replace);\nvar stringIndexOf = unapply(String.prototype.indexOf);\nvar stringTrim = unapply(String.prototype.trim);\n\nvar regExpTest = unapply(RegExp.prototype.test);\n\nvar typeErrorCreate = unconstruct(TypeError);\n\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return apply(func, thisArg, args);\n };\n}\n\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return construct(func, args);\n };\n}\n\n/* Add properties to a lookup table */\nfunction addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/* Shallow clone an object */\nfunction clone(object) {\n var newObject = create(null);\n\n var property = void 0;\n for (property in object) {\n if (apply(hasOwnProperty, object, [property])) {\n newObject[property] = object[property];\n }\n }\n\n return newObject;\n}\n\n/* IE10 doesn't support __lookupGetter__ so lets'\n * simulate it. It also automatically checks\n * if the prop is function or getter and behaves\n * accordingly. */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n var desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n}\n\nvar html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n// SVG\nvar svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n\nvar svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nvar svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n\nvar mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nvar mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n\nvar text = freeze(['#text']);\n\nvar html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n\nvar svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n\nvar mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n\nvar xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nvar MUSTACHE_EXPR = seal(/\\{\\{[\\s\\S]*|[\\s\\S]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nvar ERB_EXPR = seal(/<%[\\s\\S]*|[\\s\\S]*%>/gm);\nvar DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nvar ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nvar IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nvar IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nvar ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {Document} document The document object (to determine policy name suffix)\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported).\n */\nvar _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {\n if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n var suffix = null;\n var ATTR_NAME = 'data-tt-policy-suffix';\n if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {\n suffix = document.currentScript.getAttribute(ATTR_NAME);\n }\n\n var policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML: function createHTML(html$$1) {\n return html$$1;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\n\nfunction createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '2.3.1';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n Text = window.Text,\n Comment = window.Comment,\n DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n\n\n var ElementPrototype = Element.prototype;\n\n var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n var getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);\n var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';\n\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n createDocumentFragment = _document.createDocumentFragment,\n getElementsByTagName = _document.getElementsByTagName;\n var importNode = originalDocument.importNode;\n\n\n var documentMode = {};\n try {\n documentMode = clone(document).documentMode ? document.documentMode : {};\n } catch (_) {}\n\n var hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;\n\n var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,\n ERB_EXPR$$1 = ERB_EXPR,\n DATA_ATTR$$1 = DATA_ATTR,\n ARIA_ATTR$$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));\n\n /* Allowed attribute names */\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n var FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n var FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n var ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n var ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n var SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with <html>... should be returned */\n var WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n var SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n var FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n var RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n var RETURN_DOM_FRAGMENT = false;\n\n /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM\n * `Node` is imported into the current `Document`. If this flag is not enabled the\n * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by\n * DOMPurify.\n *\n * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`\n * might cause XSS from attacks hidden in closed shadowroots in case the browser\n * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/\n */\n var RETURN_DOM_IMPORT = true;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n var RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks? */\n var SANITIZE_DOM = true;\n\n /* Keep element content when removing element? */\n var KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n var IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n var USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n var FORBID_CONTENTS = null;\n var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n var DATA_URI_TAGS = null;\n var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n var URI_SAFE_ATTRIBUTES = null;\n var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n\n var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n var NAMESPACE = HTML_NAMESPACE;\n var IS_EMPTY_INPUT = false;\n\n /* Keep a reference to config to pass to hooks */\n var CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n var _parseConfig = function _parseConfig(cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html);\n addToSet(ALLOWED_ATTR, html$1);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl);\n addToSet(ALLOWED_ATTR, mathMl$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n\n var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n var ALL_SVG_TAGS = addToSet({}, svg);\n addToSet(ALL_SVG_TAGS, svgFilters);\n addToSet(ALL_SVG_TAGS, svgDisallowed);\n\n var ALL_MATHML_TAGS = addToSet({}, mathMl);\n addToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n var _checkValidNamespace = function _checkValidNamespace(element) {\n var parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: HTML_NAMESPACE,\n tagName: 'template'\n };\n }\n\n var tagName = stringToLowerCase(element.tagName);\n var parentTagName = stringToLowerCase(parent.tagName);\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erronously deleted from\n // HTML namespace.\n var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG or MathML). Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n var _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, { element: node });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n try {\n node.outerHTML = emptyHTML;\n } catch (_) {\n node.remove();\n }\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc = void 0;\n var leadingWhitespace = void 0;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n var matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n var body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n var _isClobbered = function _isClobbered(elm) {\n if (elm instanceof Text || elm instanceof Comment) {\n return false;\n }\n\n if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {\n return true;\n }\n\n return false;\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n var _isNode = function _isNode(object) {\n return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content = void 0;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check if tagname contains Unicode */\n if (stringMatch(currentNode.nodeName, /[\\u0080-\\uFFFF]/)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n var tagName = stringToLowerCase(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Mitigate a problem with templates inside select */\n if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n var parentNode = getParentNode(currentNode) || currentNode.parentNode;\n var childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n var childCount = childNodes.length;\n\n for (var i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\\/no(script|embed)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');\n content = stringReplace(content, ERB_EXPR$$1, ' ');\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n return false;\n\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {\n return false;\n }\n\n return true;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n var attr = void 0;\n var value = void 0;\n var lcName = void 0;\n var l = void 0;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n var attributes = currentNode.attributes;\n\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n var hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n var _attr = attr,\n name = _attr.name,\n namespaceURI = _attr.namespaceURI;\n\n value = stringTrim(attr.value);\n lcName = stringToLowerCase(name);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');\n value = stringReplace(value, ERB_EXPR$$1, ' ');\n }\n\n /* Is `value` valid for this attribute? */\n var lcTag = currentNode.nodeName.toLowerCase();\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n var shadowNode = void 0;\n var shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg) {\n var body = void 0;\n var importedNode = void 0;\n var currentNode = void 0;\n var oldNode = void 0;\n var returnNode = void 0;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw typeErrorCreate('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) ; else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : emptyHTML;\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n var nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n oldNode = null;\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n var lcTag = stringToLowerCase(tag);\n var lcName = stringToLowerCase(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nvar purify = createDOMPurify();\n\n// ESM-comment-begin\ndefine(\"vs/base/browser/dompurify/dompurify\", function () { return purify; });\n// ESM-comment-end\n\n// ESM-uncomment-begin\n// export default purify;\n// export const version = purify.version;\n// export const isSupported = purify.isSupported;\n// export const sanitize = purify.sanitize;\n// export const setConfig = purify.setConfig;\n// export const clearConfig = purify.clearConfig;\n// export const isValidAttribute = purify.isValidAttribute;\n// export const addHook = purify.addHook;\n// export const removeHook = purify.removeHook;\n// export const removeHooks = purify.removeHooks;\n// export const removeAllHooks = purify.removeAllHooks;\n// ESM-uncomment-end\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\nexport class FastDomNode<T extends HTMLElement> {\n\n\tprivate _maxWidth: number = -1;\n\tprivate _width: number = -1;\n\tprivate _height: number = -1;\n\tprivate _top: number = -1;\n\tprivate _left: number = -1;\n\tprivate _bottom: number = -1;\n\tprivate _right: number = -1;\n\tprivate _fontFamily: string = '';\n\tprivate _fontWeight: string = '';\n\tprivate _fontSize: number = -1;\n\tprivate _fontStyle: string = '';\n\tprivate _fontFeatureSettings: string = '';\n\tprivate _textDecoration: string = '';\n\tprivate _lineHeight: number = -1;\n\tprivate _letterSpacing: number = -100;\n\tprivate _className: string = '';\n\tprivate _display: string = '';\n\tprivate _position: string = '';\n\tprivate _visibility: string = '';\n\tprivate _color: string = '';\n\tprivate _backgroundColor: string = '';\n\tprivate _layerHint: boolean = false;\n\tprivate _contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint' = 'none';\n\tprivate _boxShadow: string = '';\n\n\tconstructor(\n\t\tpublic readonly domNode: T\n\t) { }\n\n\tpublic setMaxWidth(maxWidth: number): void {\n\t\tif (this._maxWidth === maxWidth) {\n\t\t\treturn;\n\t\t}\n\t\tthis._maxWidth = maxWidth;\n\t\tthis.domNode.style.maxWidth = this._maxWidth + 'px';\n\t}\n\n\tpublic setWidth(width: number): void {\n\t\tif (this._width === width) {\n\t\t\treturn;\n\t\t}\n\t\tthis._width = width;\n\t\tthis.domNode.style.width = this._width + 'px';\n\t}\n\n\tpublic setHeight(height: number): void {\n\t\tif (this._height === height) {\n\t\t\treturn;\n\t\t}\n\t\tthis._height = height;\n\t\tthis.domNode.style.height = this._height + 'px';\n\t}\n\n\tpublic setTop(top: number): void {\n\t\tif (this._top === top) {\n\t\t\treturn;\n\t\t}\n\t\tthis._top = top;\n\t\tthis.domNode.style.top = this._top + 'px';\n\t}\n\n\tpublic unsetTop(): void {\n\t\tif (this._top === -1) {\n\t\t\treturn;\n\t\t}\n\t\tthis._top = -1;\n\t\tthis.domNode.style.top = '';\n\t}\n\n\tpublic setLeft(left: number): void {\n\t\tif (this._left === left) {\n\t\t\treturn;\n\t\t}\n\t\tthis._left = left;\n\t\tthis.domNode.style.left = this._left + 'px';\n\t}\n\n\tpublic setBottom(bottom: number): void {\n\t\tif (this._bottom === bottom) {\n\t\t\treturn;\n\t\t}\n\t\tthis._bottom = bottom;\n\t\tthis.domNode.style.bottom = this._bottom + 'px';\n\t}\n\n\tpublic setRight(right: number): void {\n\t\tif (this._right === right) {\n\t\t\treturn;\n\t\t}\n\t\tthis._right = right;\n\t\tthis.domNode.style.right = this._right + 'px';\n\t}\n\n\tpublic setFontFamily(fontFamily: string): void {\n\t\tif (this._fontFamily === fontFamily) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fontFamily = fontFamily;\n\t\tthis.domNode.style.fontFamily = this._fontFamily;\n\t}\n\n\tpublic setFontWeight(fontWeight: string): void {\n\t\tif (this._fontWeight === fontWeight) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fontWeight = fontWeight;\n\t\tthis.domNode.style.fontWeight = this._fontWeight;\n\t}\n\n\tpublic setFontSize(fontSize: number): void {\n\t\tif (this._fontSize === fontSize) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fontSize = fontSize;\n\t\tthis.domNode.style.fontSize = this._fontSize + 'px';\n\t}\n\n\tpublic setFontStyle(fontStyle: string): void {\n\t\tif (this._fontStyle === fontStyle) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fontStyle = fontStyle;\n\t\tthis.domNode.style.fontStyle = this._fontStyle;\n\t}\n\n\tpublic setFontFeatureSettings(fontFeatureSettings: string): void {\n\t\tif (this._fontFeatureSettings === fontFeatureSettings) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fontFeatureSettings = fontFeatureSettings;\n\t\tthis.domNode.style.fontFeatureSettings = this._fontFeatureSettings;\n\t}\n\n\tpublic setTextDecoration(textDecoration: string): void {\n\t\tif (this._textDecoration === textDecoration) {\n\t\t\treturn;\n\t\t}\n\t\tthis._textDecoration = textDecoration;\n\t\tthis.domNode.style.textDecoration = this._textDecoration;\n\t}\n\n\tpublic setLineHeight(lineHeight: number): void {\n\t\tif (this._lineHeight === lineHeight) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lineHeight = lineHeight;\n\t\tthis.domNode.style.lineHeight = this._lineHeight + 'px';\n\t}\n\n\tpublic setLetterSpacing(letterSpacing: number): void {\n\t\tif (this._letterSpacing === letterSpacing) {\n\t\t\treturn;\n\t\t}\n\t\tthis._letterSpacing = letterSpacing;\n\t\tthis.domNode.style.letterSpacing = this._letterSpacing + 'px';\n\t}\n\n\tpublic setClassName(className: string): void {\n\t\tif (this._className === className) {\n\t\t\treturn;\n\t\t}\n\t\tthis._className = className;\n\t\tthis.domNode.className = this._className;\n\t}\n\n\tpublic toggleClassName(className: string, shouldHaveIt?: boolean): void {\n\t\tthis.domNode.classList.toggle(className, shouldHaveIt);\n\t\tthis._className = this.domNode.className;\n\t}\n\n\tpublic setDisplay(display: string): void {\n\t\tif (this._display === display) {\n\t\t\treturn;\n\t\t}\n\t\tthis._display = display;\n\t\tthis.domNode.style.display = this._display;\n\t}\n\n\tpublic setPosition(position: string): void {\n\t\tif (this._position === position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._position = position;\n\t\tthis.domNode.style.position = this._position;\n\t}\n\n\tpublic setVisibility(visibility: string): void {\n\t\tif (this._visibility === visibility) {\n\t\t\treturn;\n\t\t}\n\t\tthis._visibility = visibility;\n\t\tthis.domNode.style.visibility = this._visibility;\n\t}\n\n\tpublic setColor(color: string): void {\n\t\tif (this._color === color) {\n\t\t\treturn;\n\t\t}\n\t\tthis._color = color;\n\t\tthis.domNode.style.color = this._color;\n\t}\n\n\tpublic setBackgroundColor(backgroundColor: string): void {\n\t\tif (this._backgroundColor === backgroundColor) {\n\t\t\treturn;\n\t\t}\n\t\tthis._backgroundColor = backgroundColor;\n\t\tthis.domNode.style.backgroundColor = this._backgroundColor;\n\t}\n\n\tpublic setLayerHinting(layerHint: boolean): void {\n\t\tif (this._layerHint === layerHint) {\n\t\t\treturn;\n\t\t}\n\t\tthis._layerHint = layerHint;\n\t\tthis.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : '';\n\t}\n\n\tpublic setBoxShadow(boxShadow: string): void {\n\t\tif (this._boxShadow === boxShadow) {\n\t\t\treturn;\n\t\t}\n\t\tthis._boxShadow = boxShadow;\n\t\tthis.domNode.style.boxShadow = boxShadow;\n\t}\n\n\tpublic setContain(contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint'): void {\n\t\tif (this._contain === contain) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contain = contain;\n\t\t(<any>this.domNode.style).contain = this._contain;\n\t}\n\n\tpublic setAttribute(name: string, value: string): void {\n\t\tthis.domNode.setAttribute(name, value);\n\t}\n\n\tpublic removeAttribute(name: string): void {\n\t\tthis.domNode.removeAttribute(name);\n\t}\n\n\tpublic appendChild(child: FastDomNode<T>): void {\n\t\tthis.domNode.appendChild(child.domNode);\n\t}\n\n\tpublic removeChild(child: FastDomNode<T>): void {\n\t\tthis.domNode.removeChild(child.domNode);\n\t}\n}\n\nexport function createFastDomNode<T extends HTMLElement>(domNode: T): FastDomNode<T> {\n\treturn new FastDomNode(domNode);\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\n/**\n * Represents a window in a possible chain of iframes\n */\nexport interface IWindowChainElement {\n\t/**\n\t * The window object for it\n\t */\n\twindow: Window;\n\t/**\n\t * The iframe element inside the window.parent corresponding to window\n\t */\n\tiframeElement: Element | null;\n}\n\nlet hasDifferentOriginAncestorFlag: boolean = false;\nlet sameOriginWindowChainCache: IWindowChainElement[] | null = null;\n\nfunction getParentWindowIfSameOrigin(w: Window): Window | null {\n\tif (!w.parent || w.parent === w) {\n\t\treturn null;\n\t}\n\n\t// Cannot really tell if we have access to the parent window unless we try to access something in it\n\ttry {\n\t\tlet location = w.location;\n\t\tlet parentLocation = w.parent.location;\n\t\tif (location.origin !== 'null' && parentLocation.origin !== 'null' && location.origin !== parentLocation.origin) {\n\t\t\thasDifferentOriginAncestorFlag = true;\n\t\t\treturn null;\n\t\t}\n\t} catch (e) {\n\t\thasDifferentOriginAncestorFlag = true;\n\t\treturn null;\n\t}\n\n\treturn w.parent;\n}\n\nexport class IframeUtils {\n\n\t/**\n\t * Returns a chain of embedded windows with the same origin (which can be accessed programmatically).\n\t * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin.\n\t * To distinguish if at one point the current execution environment is running inside a window with a different origin, see hasDifferentOriginAncestor()\n\t */\n\tpublic static getSameOriginWindowChain(): IWindowChainElement[] {\n\t\tif (!sameOriginWindowChainCache) {\n\t\t\tsameOriginWindowChainCache = [];\n\t\t\tlet w: Window | null = window;\n\t\t\tlet parent: Window | null;\n\t\t\tdo {\n\t\t\t\tparent = getParentWindowIfSameOrigin(w);\n\t\t\t\tif (parent) {\n\t\t\t\t\tsameOriginWindowChainCache.push({\n\t\t\t\t\t\twindow: w,\n\t\t\t\t\t\tiframeElement: w.frameElement || null\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tsameOriginWindowChainCache.push({\n\t\t\t\t\t\twindow: w,\n\t\t\t\t\t\tiframeElement: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tw = parent;\n\t\t\t} while (w);\n\t\t}\n\t\treturn sameOriginWindowChainCache.slice(0);\n\t}\n\n\t/**\n\t * Returns true if the current execution environment is chained in a list of iframes which at one point ends in a window with a different origin.\n\t * Returns false if the current execution environment is not running inside an iframe or if the entire chain of iframes have the same origin.\n\t */\n\tpublic static hasDifferentOriginAncestor(): boolean {\n\t\tif (!sameOriginWindowChainCache) {\n\t\t\tthis.getSameOriginWindowChain();\n\t\t}\n\t\treturn hasDifferentOriginAncestorFlag;\n\t}\n\n\t/**\n\t * Returns the position of `childWindow` relative to `ancestorWindow`\n\t */\n\tpublic static getPositionOfChildWindowRelativeToAncestorWindow(childWindow: Window, ancestorWindow: Window | null) {\n\n\t\tif (!ancestorWindow || childWindow === ancestorWindow) {\n\t\t\treturn {\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0\n\t\t\t};\n\t\t}\n\n\t\tlet top = 0, left = 0;\n\n\t\tlet windowChain = this.getSameOriginWindowChain();\n\n\t\tfor (const windowChainEl of windowChain) {\n\n\t\t\ttop += windowChainEl.window.scrollY;\n\t\t\tleft += windowChainEl.window.scrollX;\n\n\t\t\tif (windowChainEl.window === ancestorWindow) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!windowChainEl.iframeElement) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet boundingRect = windowChainEl.iframeElement.getBoundingClientRect();\n\t\t\ttop += boundingRect.top;\n\t\t\tleft += boundingRect.left;\n\t\t}\n\n\t\treturn {\n\t\t\ttop: top,\n\t\t\tleft: left\n\t\t};\n\t}\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 { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { GestureEvent } from 'vs/base/browser/touch';\n\nexport interface IListVirtualDelegate<T> {\n\tgetHeight(element: T): number;\n\tgetTemplateId(element: T): string;\n\thasDynamicHeight?(element: T): boolean;\n\tgetDynamicHeight?(element: T): number | null;\n\tsetDynamicHeight?(element: T, height: number): void;\n}\n\nexport interface IListRenderer<T, TTemplateData> {\n\treadonly templateId: string;\n\trenderTemplate(container: HTMLElement): TTemplateData;\n\trenderElement(element: T, index: number, templateData: TTemplateData, height: number | undefined): void;\n\tdisposeElement?(element: T, index: number, templateData: TTemplateData, height: number | undefined): void;\n\tdisposeTemplate(templateData: TTemplateData): void;\n}\n\nexport interface IListEvent<T> {\n\telements: T[];\n\tindexes: number[];\n\tbrowserEvent?: UIEvent;\n}\n\nexport interface IListMouseEvent<T> {\n\tbrowserEvent: MouseEvent;\n\telement: T | undefined;\n\tindex: number | undefined;\n}\n\nexport interface IListTouchEvent<T> {\n\tbrowserEvent: TouchEvent;\n\telement: T | undefined;\n\tindex: number | undefined;\n}\n\nexport interface IListGestureEvent<T> {\n\tbrowserEvent: GestureEvent;\n\telement: T | undefined;\n\tindex: number | undefined;\n}\n\nexport interface IListDragEvent<T> {\n\tbrowserEvent: DragEvent;\n\telement: T | undefined;\n\tindex: number | undefined;\n}\n\nexport interface IListContextMenuEvent<T> {\n\tbrowserEvent: UIEvent;\n\tindex: number | undefined;\n}\n\nexport interface IIdentityProvider<T> {\n\tgetId(element: T): { toString(): string };\n}\n\nexport interface IKeyboardNavigationLabelProvider<T> {\n\n\t/**\n\t * Return a keyboard navigation label(s) which will be used by\n\t * the list for filtering/navigating. Return `undefined` to make\n\t * an element always match.\n\t */\n\tgetKeyboardNavigationLabel(element: T): { toString(): string | undefined } | { toString(): string | undefined }[] | undefined;\n}\n\nexport interface IKeyboardNavigationDelegate {\n\tmightProducePrintableCharacter(event: IKeyboardEvent): boolean;\n}\n\nexport const enum ListDragOverEffect {\n\tCopy,\n\tMove\n}\n\nexport interface IListDragOverReaction {\n\taccept: boolean;\n\teffect?: ListDragOverEffect;\n\tfeedback?: number[]; // use -1 for entire list\n}\n\nexport interface IListDragAndDrop<T> {\n\tgetDragURI(element: T): string | null;\n\tgetDragLabel?(elements: T[], originalEvent: DragEvent): string | undefined;\n\tonDragStart?(data: IDragAndDropData, originalEvent: DragEvent): void;\n\tonDragOver(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): boolean | IListDragOverReaction;\n\tonDragLeave?(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): void;\n\tdrop(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): void;\n\tonDragEnd?(originalEvent: DragEvent): void;\n}\n\nexport class ListError extends Error {\n\n\tconstructor(user: string, message: string) {\n\t\tsuper(`ListError [${user}] ${message}`);\n\t}\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 { ISpliceable } from 'vs/base/common/sequence';\n\nexport class CombinedSpliceable<T> implements ISpliceable<T> {\n\n\tconstructor(private spliceables: ISpliceable<T>[]) { }\n\n\tsplice(start: number, deleteCount: number, elements: T[]): void {\n\t\tthis.spliceables.forEach(s => s.splice(start, deleteCount, elements));\n\t}\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\n/**\n * The minimal size of the slider (such that it can still be clickable) -- it is artificially enlarged.\n */\nconst MINIMUM_SLIDER_SIZE = 20;\n\nexport class ScrollbarState {\n\n\t/**\n\t * For the vertical scrollbar: the width.\n\t * For the horizontal scrollbar: the height.\n\t */\n\tprivate _scrollbarSize: number;\n\n\t/**\n\t * For the vertical scrollbar: the height of the pair horizontal scrollbar.\n\t * For the horizontal scrollbar: the width of the pair vertical scrollbar.\n\t */\n\tprivate _oppositeScrollbarSize: number;\n\n\t/**\n\t * For the vertical scrollbar: the height of the scrollbar's arrows.\n\t * For the horizontal scrollbar: the width of the scrollbar's arrows.\n\t */\n\tprivate readonly _arrowSize: number;\n\n\t// --- variables\n\t/**\n\t * For the vertical scrollbar: the viewport height.\n\t * For the horizontal scrollbar: the viewport width.\n\t */\n\tprivate _visibleSize: number;\n\n\t/**\n\t * For the vertical scrollbar: the scroll height.\n\t * For the horizontal scrollbar: the scroll width.\n\t */\n\tprivate _scrollSize: number;\n\n\t/**\n\t * For the vertical scrollbar: the scroll top.\n\t * For the horizontal scrollbar: the scroll left.\n\t */\n\tprivate _scrollPosition: number;\n\n\t// --- computed variables\n\n\t/**\n\t * `visibleSize` - `oppositeScrollbarSize`\n\t */\n\tprivate _computedAvailableSize: number;\n\t/**\n\t * (`scrollSize` > 0 && `scrollSize` > `visibleSize`)\n\t */\n\tprivate _computedIsNeeded: boolean;\n\n\tprivate _computedSliderSize: number;\n\tprivate _computedSliderRatio: number;\n\tprivate _computedSliderPosition: number;\n\n\tconstructor(arrowSize: number, scrollbarSize: number, oppositeScrollbarSize: number, visibleSize: number, scrollSize: number, scrollPosition: number) {\n\t\tthis._scrollbarSize = Math.round(scrollbarSize);\n\t\tthis._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);\n\t\tthis._arrowSize = Math.round(arrowSize);\n\n\t\tthis._visibleSize = visibleSize;\n\t\tthis._scrollSize = scrollSize;\n\t\tthis._scrollPosition = scrollPosition;\n\n\t\tthis._computedAvailableSize = 0;\n\t\tthis._computedIsNeeded = false;\n\t\tthis._computedSliderSize = 0;\n\t\tthis._computedSliderRatio = 0;\n\t\tthis._computedSliderPosition = 0;\n\n\t\tthis._refreshComputedValues();\n\t}\n\n\tpublic clone(): ScrollbarState {\n\t\treturn new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);\n\t}\n\n\tpublic setVisibleSize(visibleSize: number): boolean {\n\t\tconst iVisibleSize = Math.round(visibleSize);\n\t\tif (this._visibleSize !== iVisibleSize) {\n\t\t\tthis._visibleSize = iVisibleSize;\n\t\t\tthis._refreshComputedValues();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic setScrollSize(scrollSize: number): boolean {\n\t\tconst iScrollSize = Math.round(scrollSize);\n\t\tif (this._scrollSize !== iScrollSize) {\n\t\t\tthis._scrollSize = iScrollSize;\n\t\t\tthis._refreshComputedValues();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic setScrollPosition(scrollPosition: number): boolean {\n\t\tconst iScrollPosition = Math.round(scrollPosition);\n\t\tif (this._scrollPosition !== iScrollPosition) {\n\t\t\tthis._scrollPosition = iScrollPosition;\n\t\t\tthis._refreshComputedValues();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic setScrollbarSize(scrollbarSize: number): void {\n\t\tthis._scrollbarSize = Math.round(scrollbarSize);\n\t}\n\n\tpublic setOppositeScrollbarSize(oppositeScrollbarSize: number): void {\n\t\tthis._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);\n\t}\n\n\tprivate static _computeValues(oppositeScrollbarSize: number, arrowSize: number, visibleSize: number, scrollSize: number, scrollPosition: number) {\n\t\tconst computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize);\n\t\tconst computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize);\n\t\tconst computedIsNeeded = (scrollSize > 0 && scrollSize > visibleSize);\n\n\t\tif (!computedIsNeeded) {\n\t\t\t// There is no need for a slider\n\t\t\treturn {\n\t\t\t\tcomputedAvailableSize: Math.round(computedAvailableSize),\n\t\t\t\tcomputedIsNeeded: computedIsNeeded,\n\t\t\t\tcomputedSliderSize: Math.round(computedRepresentableSize),\n\t\t\t\tcomputedSliderRatio: 0,\n\t\t\t\tcomputedSliderPosition: 0,\n\t\t\t};\n\t\t}\n\n\t\t// We must artificially increase the size of the slider if needed, since the slider would be too small to grab with the mouse otherwise\n\t\tconst computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize)));\n\n\t\t// The slider can move from 0 to `computedRepresentableSize` - `computedSliderSize`\n\t\t// in the same way `scrollPosition` can move from 0 to `scrollSize` - `visibleSize`.\n\t\tconst computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize);\n\t\tconst computedSliderPosition = (scrollPosition * computedSliderRatio);\n\n\t\treturn {\n\t\t\tcomputedAvailableSize: Math.round(computedAvailableSize),\n\t\t\tcomputedIsNeeded: computedIsNeeded,\n\t\t\tcomputedSliderSize: Math.round(computedSliderSize),\n\t\t\tcomputedSliderRatio: computedSliderRatio,\n\t\t\tcomputedSliderPosition: Math.round(computedSliderPosition),\n\t\t};\n\t}\n\n\tprivate _refreshComputedValues(): void {\n\t\tconst r = ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);\n\t\tthis._computedAvailableSize = r.computedAvailableSize;\n\t\tthis._computedIsNeeded = r.computedIsNeeded;\n\t\tthis._computedSliderSize = r.computedSliderSize;\n\t\tthis._computedSliderRatio = r.computedSliderRatio;\n\t\tthis._computedSliderPosition = r.computedSliderPosition;\n\t}\n\n\tpublic getArrowSize(): number {\n\t\treturn this._arrowSize;\n\t}\n\n\tpublic getScrollPosition(): number {\n\t\treturn this._scrollPosition;\n\t}\n\n\tpublic getRectangleLargeSize(): number {\n\t\treturn this._computedAvailableSize;\n\t}\n\n\tpublic getRectangleSmallSize(): number {\n\t\treturn this._scrollbarSize;\n\t}\n\n\tpublic isNeeded(): boolean {\n\t\treturn this._computedIsNeeded;\n\t}\n\n\tpublic getSliderSize(): number {\n\t\treturn this._computedSliderSize;\n\t}\n\n\tpublic getSliderPosition(): number {\n\t\treturn this._computedSliderPosition;\n\t}\n\n\t/**\n\t * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider.\n\t * `offset` is based on the same coordinate system as the `sliderPosition`.\n\t */\n\tpublic getDesiredScrollPositionFromOffset(offset: number): number {\n\t\tif (!this._computedIsNeeded) {\n\t\t\t// no need for a slider\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2;\n\t\treturn Math.round(desiredSliderPosition / this._computedSliderRatio);\n\t}\n\n\t/**\n\t * Compute a desired `scrollPosition` from if offset is before or after the slider position.\n\t * If offset is before slider, treat as a page up (or left). If after, page down (or right).\n\t * `offset` and `_computedSliderPosition` are based on the same coordinate system.\n\t * `_visibleSize` corresponds to a \"page\" of lines in the returned coordinate system.\n\t */\n\tpublic getDesiredScrollPositionFromOffsetPaged(offset: number): number {\n\t\tif (!this._computedIsNeeded) {\n\t\t\t// no need for a slider\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst correctedOffset = offset - this._arrowSize; // compensate if has arrows\n\t\tlet desiredScrollPosition = this._scrollPosition;\n\t\tif (correctedOffset < this._computedSliderPosition) {\n\t\t\tdesiredScrollPosition -= this._visibleSize; // page up/left\n\t\t} else {\n\t\t\tdesiredScrollPosition += this._visibleSize; // page down/right\n\t\t}\n\t\treturn desiredScrollPosition;\n\t}\n\n\t/**\n\t * Compute a desired `scrollPosition` such that the slider moves by `delta`.\n\t */\n\tpublic getDesiredScrollPositionFromDelta(delta: number): number {\n\t\tif (!this._computedIsNeeded) {\n\t\t\t// no need for a slider\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst desiredSliderPosition = this._computedSliderPosition + delta;\n\t\treturn Math.round(desiredSliderPosition / this._computedSliderRatio);\n\t}\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 { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { IListDragAndDrop, IListDragOverReaction, IListRenderer } from 'vs/base/browser/ui/list/list';\nimport { Event } from 'vs/base/common/event';\n\nexport const enum TreeVisibility {\n\n\t/**\n\t * The tree node should be hidden.\n\t */\n\tHidden,\n\n\t/**\n\t * The tree node should be visible.\n\t */\n\tVisible,\n\n\t/**\n\t * The tree node should be visible if any of its descendants is visible.\n\t */\n\tRecurse\n}\n\n/**\n * A composed filter result containing the visibility result as well as\n * metadata.\n */\nexport interface ITreeFilterDataResult<TFilterData> {\n\n\t/**\n\t * Whether the node should be visible.\n\t */\n\tvisibility: boolean | TreeVisibility;\n\n\t/**\n\t * Metadata about the element's visibility which gets forwarded to the\n\t * renderer once the element gets rendered.\n\t */\n\tdata: TFilterData;\n}\n\n/**\n * The result of a filter call can be a boolean value indicating whether\n * the element should be visible or not, a value of type `TreeVisibility` or\n * an object composed of the visibility result as well as additional metadata\n * which gets forwarded to the renderer once the element gets rendered.\n */\nexport type TreeFilterResult<TFilterData> = boolean | TreeVisibility | ITreeFilterDataResult<TFilterData>;\n\n/**\n * A tree filter is responsible for controlling the visibility of\n * elements in a tree.\n */\nexport interface ITreeFilter<T, TFilterData = void> {\n\n\t/**\n\t * Returns whether this elements should be visible and, if affirmative,\n\t * additional metadata which gets forwarded to the renderer once the element\n\t * gets rendered.\n\t *\n\t * @param element The tree element.\n\t */\n\tfilter(element: T, parentVisibility: TreeVisibility): TreeFilterResult<TFilterData>;\n}\n\nexport interface ITreeSorter<T> {\n\tcompare(element: T, otherElement: T): number;\n}\n\nexport interface ITreeElement<T> {\n\treadonly element: T;\n\treadonly children?: Iterable<ITreeElement<T>>;\n\treadonly collapsible?: boolean;\n\treadonly collapsed?: boolean;\n}\n\nexport interface ITreeNode<T, TFilterData = void> {\n\treadonly element: T;\n\treadonly children: ITreeNode<T, TFilterData>[];\n\treadonly depth: number;\n\treadonly visibleChildrenCount: number;\n\treadonly visibleChildIndex: number;\n\treadonly collapsible: boolean;\n\treadonly collapsed: boolean;\n\treadonly visible: boolean;\n\treadonly filterData: TFilterData | undefined;\n}\n\nexport interface ICollapseStateChangeEvent<T, TFilterData> {\n\tnode: ITreeNode<T, TFilterData>;\n\tdeep: boolean;\n}\n\nexport interface ITreeModelSpliceEvent<T, TFilterData> {\n\tinsertedNodes: ITreeNode<T, TFilterData>[];\n\tdeletedNodes: ITreeNode<T, TFilterData>[];\n}\n\nexport interface ITreeModel<T, TFilterData, TRef> {\n\n\treadonly onDidSplice: Event<ITreeModelSpliceEvent<T, TFilterData>>;\n\treadonly onDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>>;\n\n\thas(location: TRef): boolean;\n\n\tgetListIndex(location: TRef): number;\n\tgetListRenderCount(location: TRef): number;\n\tgetNode(location?: TRef): ITreeNode<T, any>;\n\tgetNodeLocation(node: ITreeNode<T, any>): TRef;\n\tgetParentNodeLocation(location: TRef): TRef | undefined;\n\n\tgetFirstElementChild(location: TRef): T | undefined;\n\n\tisCollapsible(location: TRef): boolean;\n\tsetCollapsible(location: TRef, collapsible?: boolean): boolean;\n\tisCollapsed(location: TRef): boolean;\n\tsetCollapsed(location: TRef, collapsed?: boolean, recursive?: boolean): boolean;\n\texpandTo(location: TRef): void;\n\n\trerender(location: TRef): void;\n\trefilter(): void;\n}\n\nexport interface ITreeRenderer<T, TFilterData = void, TTemplateData = void> extends IListRenderer<ITreeNode<T, TFilterData>, TTemplateData> {\n\trenderTwistie?(element: T, twistieElement: HTMLElement): boolean;\n\tonDidChangeTwistieState?: Event<T>;\n}\n\nexport interface ITreeEvent<T> {\n\telements: T[];\n\tbrowserEvent?: UIEvent;\n}\n\nexport enum TreeMouseEventTarget {\n\tUnknown,\n\tTwistie,\n\tElement\n}\n\nexport interface ITreeMouseEvent<T> {\n\tbrowserEvent: MouseEvent;\n\telement: T | null;\n\ttarget: TreeMouseEventTarget;\n}\n\nexport interface IDataSource<TInput, T> {\n}\n\nexport interface IAsyncDataSource<TInput, T> {\n\thasChildren(element: TInput | T): boolean;\n\tgetChildren(element: TInput | T): Iterable<T> | Promise<Iterable<T>>;\n}\n\nexport const enum TreeDragOverBubble {\n\tDown,\n\tUp\n}\n\nexport interface ITreeDragOverReaction extends IListDragOverReaction {\n\tbubble?: TreeDragOverBubble;\n\tautoExpand?: boolean;\n}\n\nexport interface ITreeDragAndDrop<T> extends IListDragAndDrop<T> {\n\tonDragOver(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): boolean | ITreeDragOverReaction;\n}\n\nexport class TreeError extends Error {\n\n\tconstructor(user: string, message: string) {\n\t\tsuper(`TreeError [${user}] ${message}`);\n\t}\n}\n\nexport class WeakMapper<K extends object, V> {\n\n\tconstructor(private fn: (k: K) => V) { }\n\n\tprivate _map = new WeakMap<K, V>();\n\n\tmap(key: K): V {\n\t\tlet result = this._map.get(key);\n\n\t\tif (!result) {\n\t\t\tresult = this.fn(key);\n\t\t\tthis._map.set(key, result);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n","\n\n/**\n * Returns the last element of an array.\n * @param array The array.\n * @param n Which element from the end (default is zero).\n */\nexport function tail<T>(array: ArrayLike<T>, n: number = 0): T {\n\treturn array[array.length - (1 + n)];\n}\n\nexport function tail2<T>(arr: T[]): [T[], T] {\n\tif (arr.length === 0) {\n\t\tthrow new Error('Invalid tail call');\n\t}\n\n\treturn [arr.slice(0, arr.length - 1), arr[arr.length - 1]];\n}\n\nexport function equals<T>(one: ReadonlyArray<T> | undefined, other: ReadonlyArray<T> | undefined, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {\n\tif (one === other) {\n\t\treturn true;\n\t}\n\n\tif (!one || !other) {\n\t\treturn false;\n\t}\n\n\tif (one.length !== other.length) {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0, len = one.length; i < len; i++) {\n\t\tif (!itemEquals(one[i], other[i])) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport function binarySearch<T>(array: ReadonlyArray<T>, key: T, comparator: (op1: T, op2: T) => number): number {\n\tlet low = 0,\n\t\thigh = array.length - 1;\n\n\twhile (low <= high) {\n\t\tconst mid = ((low + high) / 2) | 0;\n\t\tconst comp = comparator(array[mid], key);\n\t\tif (comp < 0) {\n\t\t\tlow = mid + 1;\n\t\t} else if (comp > 0) {\n\t\t\thigh = mid - 1;\n\t\t} else {\n\t\t\treturn mid;\n\t\t}\n\t}\n\treturn -(low + 1);\n}\n\n/**\n * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false\n * are located before all elements where p(x) is true.\n * @returns the least x for which p(x) is true or array.length if no element fullfills the given function.\n */\nexport function findFirstInSorted<T>(array: ReadonlyArray<T>, p: (x: T) => boolean): number {\n\tlet low = 0, high = array.length;\n\tif (high === 0) {\n\t\treturn 0; // no children\n\t}\n\twhile (low < high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tif (p(array[mid])) {\n\t\t\thigh = mid;\n\t\t} else {\n\t\t\tlow = mid + 1;\n\t\t}\n\t}\n\treturn low;\n}\n\ntype Compare<T> = (a: T, b: T) => number;\n\n\nexport function quickSelect<T>(nth: number, data: T[], compare: Compare<T>): T {\n\n\tnth = nth | 0;\n\n\tif (nth >= data.length) {\n\t\tthrow new TypeError('invalid index');\n\t}\n\n\tlet pivotValue = data[Math.floor(data.length * Math.random())];\n\tlet lower: T[] = [];\n\tlet higher: T[] = [];\n\tlet pivots: T[] = [];\n\n\tfor (let value of data) {\n\t\tconst val = compare(value, pivotValue);\n\t\tif (val < 0) {\n\t\t\tlower.push(value);\n\t\t} else if (val > 0) {\n\t\t\thigher.push(value);\n\t\t} else {\n\t\t\tpivots.push(value);\n\t\t}\n\t}\n\n\tif (nth < lower.length) {\n\t\treturn quickSelect(nth, lower, compare);\n\t} else if (nth < lower.length + pivots.length) {\n\t\treturn pivots[0];\n\t} else {\n\t\treturn quickSelect(nth - (lower.length + pivots.length), higher, compare);\n\t}\n}\n\nexport function groupBy<T>(data: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[][] {\n\tconst result: T[][] = [];\n\tlet currentGroup: T[] | undefined = undefined;\n\tfor (const element of data.slice(0).sort(compare)) {\n\t\tif (!currentGroup || compare(currentGroup[0], element) !== 0) {\n\t\t\tcurrentGroup = [element];\n\t\t\tresult.push(currentGroup);\n\t\t} else {\n\t\t\tcurrentGroup.push(element);\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * @returns New array with all falsy values removed. The original array IS NOT modified.\n */\nexport function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {\n\treturn <T[]>array.filter(e => !!e);\n}\n\n/**\n * @returns false if the provided object is an array and not empty.\n */\nexport function isFalsyOrEmpty(obj: any): boolean {\n\treturn !Array.isArray(obj) || obj.length === 0;\n}\n\n/**\n * @returns True if the provided object is an array and has at least one element.\n */\nexport function isNonEmptyArray<T>(obj: T[] | undefined | null): obj is T[];\nexport function isNonEmptyArray<T>(obj: readonly T[] | undefined | null): obj is readonly T[];\nexport function isNonEmptyArray<T>(obj: T[] | readonly T[] | undefined | null): obj is T[] | readonly T[] {\n\treturn Array.isArray(obj) && obj.length > 0;\n}\n\n/**\n * Removes duplicates from the given array. The optional keyFn allows to specify\n * how elements are checked for equality by returning an alternate value for each.\n */\nexport function distinct<T>(array: ReadonlyArray<T>, keyFn: (value: T) => any = value => value): T[] {\n\tconst seen = new Set<any>();\n\n\treturn array.filter(element => {\n\t\tconst key = keyFn!(element);\n\t\tif (seen.has(key)) {\n\t\t\treturn false;\n\t\t}\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\n\nexport function findLast<T>(arr: readonly T[], predicate: (item: T) => boolean): T | undefined {\n\tconst idx = lastIndex(arr, predicate);\n\tif (idx === -1) {\n\t\treturn undefined;\n\t}\n\treturn arr[idx];\n}\n\nexport function lastIndex<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): number {\n\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\tconst element = array[i];\n\n\t\tif (fn(element)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nexport function firstOrDefault<T, NotFound = T>(array: ReadonlyArray<T>, notFoundValue: NotFound): T | NotFound;\nexport function firstOrDefault<T>(array: ReadonlyArray<T>): T | undefined;\nexport function firstOrDefault<T, NotFound = T>(array: ReadonlyArray<T>, notFoundValue?: NotFound): T | NotFound | undefined {\n\treturn array.length > 0 ? array[0] : notFoundValue;\n}\n\nexport function flatten<T>(arr: T[][]): T[] {\n\treturn (<T[]>[]).concat(...arr);\n}\n\nexport function range(to: number): number[];\nexport function range(from: number, to: number): number[];\nexport function range(arg: number, to?: number): number[] {\n\tlet from = typeof to === 'number' ? arg : 0;\n\n\tif (typeof to === 'number') {\n\t\tfrom = arg;\n\t} else {\n\t\tfrom = 0;\n\t\tto = arg;\n\t}\n\n\tconst result: number[] = [];\n\n\tif (from <= to) {\n\t\tfor (let i = from; i < to; i++) {\n\t\t\tresult.push(i);\n\t\t}\n\t} else {\n\t\tfor (let i = from; i > to; i--) {\n\t\t\tresult.push(i);\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Insert `insertArr` inside `target` at `insertIndex`.\n * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array\n */\nexport function arrayInsert<T>(target: T[], insertIndex: number, insertArr: T[]): T[] {\n\tconst before = target.slice(0, insertIndex);\n\tconst after = target.slice(insertIndex);\n\treturn before.concat(insertArr, after);\n}\n\n/**\n * Pushes an element to the start of the array, if found.\n */\nexport function pushToStart<T>(arr: T[], value: T): void {\n\tconst index = arr.indexOf(value);\n\n\tif (index > -1) {\n\t\tarr.splice(index, 1);\n\t\tarr.unshift(value);\n\t}\n}\n\n/**\n * Pushes an element to the end of the array, if found.\n */\nexport function pushToEnd<T>(arr: T[], value: T): void {\n\tconst index = arr.indexOf(value);\n\n\tif (index > -1) {\n\t\tarr.splice(index, 1);\n\t\tarr.push(value);\n\t}\n}\n\nexport function asArray<T>(x: T | T[]): T[];\nexport function asArray<T>(x: T | readonly T[]): readonly T[];\nexport function asArray<T>(x: T | T[]): T[] {\n\treturn Array.isArray(x) ? x : [x];\n}\n\n/**\n * Insert the new items in the array.\n * @param array The original array.\n * @param start The zero-based location in the array from which to start inserting elements.\n * @param newItems The items to be inserted\n */\nexport function insertInto<T>(array: T[], start: number, newItems: T[]): void {\n\tconst startIdx = getActualStartIndex(array, start);\n\tconst originalLength = array.length;\n\tconst newItemsLength = newItems.length;\n\tarray.length = originalLength + newItemsLength;\n\t// Move the items after the start index, start from the end so that we don't overwrite any value.\n\tfor (let i = originalLength - 1; i >= startIdx; i--) {\n\t\tarray[i + newItemsLength] = array[i];\n\t}\n\n\tfor (let i = 0; i < newItemsLength; i++) {\n\t\tarray[i + startIdx] = newItems[i];\n\t}\n}\n\n/**\n * Removes elements from an array and inserts new elements in their place, returning the deleted elements. Alternative to the native Array.splice method, it\n * can only support limited number of items due to the maximum call stack size limit.\n * @param array The original array.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @returns An array containing the elements that were deleted.\n */\nexport function splice<T>(array: T[], start: number, deleteCount: number, newItems: T[]): T[] {\n\tconst index = getActualStartIndex(array, start);\n\tconst result = array.splice(index, deleteCount);\n\tinsertInto(array, index, newItems);\n\treturn result;\n}\n\n/**\n * Determine the actual start index (same logic as the native splice() or slice())\n * If greater than the length of the array, start will be set to the length of the array. In this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided.\n * If negative, it will begin that many elements from the end of the array. (In this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) If array.length + start is less than 0, it will begin from index 0.\n * @param array The target array.\n * @param start The operation index.\n */\nfunction getActualStartIndex<T>(array: T[], start: number): number {\n\treturn start < 0 ? Math.max(start + array.length, 0) : Math.min(start, array.length);\n}\n\n/**\n * A comparator `c` defines a total order `<=` on `T` as following:\n * `c(a, b) <= 0` iff `a` <= `b`.\n * We also have `c(a, b) == 0` iff `c(b, a) == 0`.\n*/\nexport type Comparator<T> = (a: T, b: T) => number;\n\nexport function compareBy<TItem, TCompareBy>(selector: (item: TItem) => TCompareBy, comparator: Comparator<TCompareBy>): Comparator<TItem> {\n\treturn (a, b) => comparator(selector(a), selector(b));\n}\n\n/**\n * The natural order on numbers.\n*/\nexport const numberComparator: Comparator<number> = (a, b) => a - b;\n\n/**\n * Returns the first item that is equal to or greater than every other item.\n*/\nexport function findMaxBy<T>(items: readonly T[], comparator: Comparator<T>): T | undefined {\n\tif (items.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tlet max = items[0];\n\tfor (let i = 1; i < items.length; i++) {\n\t\tconst item = items[i];\n\t\tif (comparator(item, max) > 0) {\n\t\t\tmax = item;\n\t\t}\n\t}\n\treturn max;\n}\n\n/**\n * Returns the last item that is equal to or greater than every other item.\n*/\nexport function findLastMaxBy<T>(items: readonly T[], comparator: Comparator<T>): T | undefined {\n\tif (items.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tlet max = items[0];\n\tfor (let i = 1; i < items.length; i++) {\n\t\tconst item = items[i];\n\t\tif (comparator(item, max) >= 0) {\n\t\t\tmax = item;\n\t\t}\n\t}\n\treturn max;\n}\n\n/**\n * Returns the first item that is equal to or less than every other item.\n*/\nexport function findMinBy<T>(items: readonly T[], comparator: Comparator<T>): T | undefined {\n\treturn findMaxBy(items, (a, b) => -comparator(a, b));\n}\n\nexport class ArrayQueue<T> {\n\tprivate firstIdx = 0;\n\tprivate lastIdx = this.items.length - 1;\n\n\t/**\n\t * Constructs a queue that is backed by the given array. Runtime is O(1).\n\t*/\n\tconstructor(private readonly items: T[]) { }\n\n\t/**\n\t * Consumes elements from the beginning of the queue as long as the predicate returns true.\n\t * If no elements were consumed, `null` is returned. Has a runtime of O(result.length).\n\t*/\n\ttakeWhile(predicate: (value: T) => boolean): T[] | null {\n\t\t// P(k) := k <= this.lastIdx && predicate(this.items[k])\n\t\t// Find s := min { k | k >= this.firstIdx && !P(k) } and return this.data[this.firstIdx...s)\n\n\t\tlet startIdx = this.firstIdx;\n\t\twhile (startIdx < this.items.length && predicate(this.items[startIdx])) {\n\t\t\tstartIdx++;\n\t\t}\n\t\tconst result = startIdx === this.firstIdx ? null : this.items.slice(this.firstIdx, startIdx);\n\t\tthis.firstIdx = startIdx;\n\t\treturn result;\n\t}\n\n\t/**\n\t * Consumes elements from the end of the queue as long as the predicate returns true.\n\t * If no elements were consumed, `null` is returned.\n\t * The result has the same order as the underlying array!\n\t*/\n\ttakeFromEndWhile(predicate: (value: T) => boolean): T[] | null {\n\t\t// P(k) := this.firstIdx >= k && predicate(this.items[k])\n\t\t// Find s := max { k | k <= this.lastIdx && !P(k) } and return this.data(s...this.lastIdx]\n\n\t\tlet endIdx = this.lastIdx;\n\t\twhile (endIdx >= 0 && predicate(this.items[endIdx])) {\n\t\t\tendIdx--;\n\t\t}\n\t\tconst result = endIdx === this.lastIdx ? null : this.items.slice(endIdx + 1, this.lastIdx + 1);\n\t\tthis.lastIdx = endIdx;\n\t\treturn result;\n\t}\n\n\tpeek(): T | undefined {\n\t\treturn this.items[this.firstIdx];\n\t}\n\n\tdequeue(): T | undefined {\n\t\tconst result = this.items[this.firstIdx];\n\t\tthis.firstIdx++;\n\t\treturn result;\n\t}\n\n\ttakeCount(count: number): T[] {\n\t\tconst result = this.items.slice(this.firstIdx, this.firstIdx + count);\n\t\tthis.firstIdx += count;\n\t\treturn result;\n\t}\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\n/**\n * Throws an error with the provided message if the provided value does not evaluate to a true Javascript value.\n */\nexport function ok(value?: unknown, message?: string) {\n\tif (!value) {\n\t\tthrow new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');\n\t}\n}\n","\n\ndeclare const Buffer: any;\n\nconst hasBuffer = (typeof Buffer !== 'undefined');\nlet textDecoder: TextDecoder | null;\n\nexport class VSBuffer {\n\n\t/**\n\t * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for\n\t * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool,\n\t * which is not transferrable.\n\t */\n\tstatic wrap(actual: Uint8Array): VSBuffer {\n\t\tif (hasBuffer && !(Buffer.isBuffer(actual))) {\n\t\t\t// https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\n\t\t\t// Create a zero-copy Buffer wrapper around the ArrayBuffer pointed to by the Uint8Array\n\t\t\tactual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength);\n\t\t}\n\t\treturn new VSBuffer(actual);\n\t}\n\n\treadonly buffer: Uint8Array;\n\treadonly byteLength: number;\n\n\tprivate constructor(buffer: Uint8Array) {\n\t\tthis.buffer = buffer;\n\t\tthis.byteLength = this.buffer.byteLength;\n\t}\n\n\ttoString(): string {\n\t\tif (hasBuffer) {\n\t\t\treturn this.buffer.toString();\n\t\t} else {\n\t\t\tif (!textDecoder) {\n\t\t\t\ttextDecoder = new TextDecoder();\n\t\t\t}\n\t\t\treturn textDecoder.decode(this.buffer);\n\t\t}\n\t}\n}\n\nexport function readUInt16LE(source: Uint8Array, offset: number): number {\n\treturn (\n\t\t((source[offset + 0] << 0) >>> 0) |\n\t\t((source[offset + 1] << 8) >>> 0)\n\t);\n}\n\nexport function writeUInt16LE(destination: Uint8Array, value: number, offset: number): void {\n\tdestination[offset + 0] = (value & 0b11111111);\n\tvalue = value >>> 8;\n\tdestination[offset + 1] = (value & 0b11111111);\n}\n\nexport function readUInt32BE(source: Uint8Array, offset: number): number {\n\treturn (\n\t\tsource[offset] * 2 ** 24\n\t\t+ source[offset + 1] * 2 ** 16\n\t\t+ source[offset + 2] * 2 ** 8\n\t\t+ source[offset + 3]\n\t);\n}\n\nexport function writeUInt32BE(destination: Uint8Array, value: number, offset: number): void {\n\tdestination[offset + 3] = value;\n\tvalue = value >>> 8;\n\tdestination[offset + 2] = value;\n\tvalue = value >>> 8;\n\tdestination[offset + 1] = value;\n\tvalue = value >>> 8;\n\tdestination[offset] = value;\n}\n\nexport function readUInt8(source: Uint8Array, offset: number): number {\n\treturn source[offset];\n}\n\nexport function writeUInt8(destination: Uint8Array, value: number, offset: number): void {\n\tdestination[offset] = value;\n}\n","\n\n/**\n * Uses a LRU cache to make a given parametrized function cached.\n * Caches just the last value.\n * The key must be JSON serializable.\n*/\nexport class LRUCachedComputed<TArg, TComputed> {\n\tprivate lastCache: TComputed | undefined = undefined;\n\tprivate lastArgKey: string | undefined = undefined;\n\n\tconstructor(private readonly computeFn: (arg: TArg) => TComputed) {\n\t}\n\n\tpublic get(arg: TArg): TComputed {\n\t\tconst key = JSON.stringify(arg);\n\t\tif (this.lastArgKey !== key) {\n\t\t\tthis.lastArgKey = key;\n\t\t\tthis.lastCache = this.computeFn(arg);\n\t\t}\n\t\treturn this.lastCache!;\n\t}\n}\n","\n\n// Selects all codicon names encapsulated in the `$()` syntax and wraps the\n// results with spaces so that screen readers can read the text better.\nexport function getCodiconAriaLabel(text: string | undefined) {\n\tif (!text) {\n\t\treturn '';\n\t}\n\n\treturn text.replace(/\\$\\((.*?)\\)/g, (_match, codiconName) => ` ${codiconName} `).trim();\n}\n\n/**\n * The Codicon library is a set of default icons that are built-in in VS Code.\n *\n * In the product (outside of base) Codicons should only be used as defaults. In order to have all icons in VS Code\n * themeable, component should define new, UI component specific icons using `iconRegistry.registerIcon`.\n * In that call a Codicon can be named as default.\n */\nexport class Codicon implements CSSIcon {\n\n\tprivate constructor(public readonly id: string, public readonly definition: IconDefinition, public description?: string) {\n\t\tCodicon._allCodicons.push(this);\n\t}\n\tpublic get classNames() { return 'codicon codicon-' + this.id; }\n\t// classNamesArray is useful for migrating to ES6 classlist\n\tpublic get classNamesArray() { return ['codicon', 'codicon-' + this.id]; }\n\tpublic get cssSelector() { return '.codicon.codicon-' + this.id; }\n\n\t// registry\n\tprivate static _allCodicons: Codicon[] = [];\n\n\t/**\n\t * @returns Returns all default icons covered by the codicon font. Only to be used by the icon registry in platform.\n\t */\n\tpublic static getAll(): readonly Codicon[] {\n\t\treturn Codicon._allCodicons;\n\t}\n\n\t// built-in icons, with image name\n\tpublic static readonly add = new Codicon('add', { fontCharacter: '\\\\ea60' });\n\tpublic static readonly plus = new Codicon('plus', Codicon.add.definition);\n\tpublic static readonly gistNew = new Codicon('gist-new', Codicon.add.definition);\n\tpublic static readonly repoCreate = new Codicon('repo-create', Codicon.add.definition);\n\tpublic static readonly lightbulb = new Codicon('lightbulb', { fontCharacter: '\\\\ea61' });\n\tpublic static readonly lightBulb = new Codicon('light-bulb', { fontCharacter: '\\\\ea61' });\n\tpublic static readonly repo = new Codicon('repo', { fontCharacter: '\\\\ea62' });\n\tpublic static readonly repoDelete = new Codicon('repo-delete', { fontCharacter: '\\\\ea62' });\n\tpublic static readonly gistFork = new Codicon('gist-fork', { fontCharacter: '\\\\ea63' });\n\tpublic static readonly repoForked = new Codicon('repo-forked', { fontCharacter: '\\\\ea63' });\n\tpublic static readonly gitPullRequest = new Codicon('git-pull-request', { fontCharacter: '\\\\ea64' });\n\tpublic static readonly gitPullRequestAbandoned = new Codicon('git-pull-request-abandoned', { fontCharacter: '\\\\ea64' });\n\tpublic static readonly recordKeys = new Codicon('record-keys', { fontCharacter: '\\\\ea65' });\n\tpublic static readonly keyboard = new Codicon('keyboard', { fontCharacter: '\\\\ea65' });\n\tpublic static readonly tag = new Codicon('tag', { fontCharacter: '\\\\ea66' });\n\tpublic static readonly tagAdd = new Codicon('tag-add', { fontCharacter: '\\\\ea66' });\n\tpublic static readonly tagRemove = new Codicon('tag-remove', { fontCharacter: '\\\\ea66' });\n\tpublic static readonly person = new Codicon('person', { fontCharacter: '\\\\ea67' });\n\tpublic static readonly personFollow = new Codicon('person-follow', { fontCharacter: '\\\\ea67' });\n\tpublic static readonly personOutline = new Codicon('person-outline', { fontCharacter: '\\\\ea67' });\n\tpublic static readonly personFilled = new Codicon('person-filled', { fontCharacter: '\\\\ea67' });\n\tpublic static readonly gitBranch = new Codicon('git-branch', { fontCharacter: '\\\\ea68' });\n\tpublic static readonly gitBranchCreate = new Codicon('git-branch-create', { fontCharacter: '\\\\ea68' });\n\tpublic static readonly gitBranchDelete = new Codicon('git-branch-delete', { fontCharacter: '\\\\ea68' });\n\tpublic static readonly sourceControl = new Codicon('source-control', { fontCharacter: '\\\\ea68' });\n\tpublic static readonly mirror = new Codicon('mirror', { fontCharacter: '\\\\ea69' });\n\tpublic static readonly mirrorPublic = new Codicon('mirror-public', { fontCharacter: '\\\\ea69' });\n\tpublic static readonly star = new Codicon('star', { fontCharacter: '\\\\ea6a' });\n\tpublic static readonly starAdd = new Codicon('star-add', { fontCharacter: '\\\\ea6a' });\n\tpublic static readonly starDelete = new Codicon('star-delete', { fontCharacter: '\\\\ea6a' });\n\tpublic static readonly starEmpty = new Codicon('star-empty', { fontCharacter: '\\\\ea6a' });\n\tpublic static readonly comment = new Codicon('comment', { fontCharacter: '\\\\ea6b' });\n\tpublic static readonly commentAdd = new Codicon('comment-add', { fontCharacter: '\\\\ea6b' });\n\tpublic static readonly alert = new Codicon('alert', { fontCharacter: '\\\\ea6c' });\n\tpublic static readonly warning = new Codicon('warning', { fontCharacter: '\\\\ea6c' });\n\tpublic static readonly search = new Codicon('search', { fontCharacter: '\\\\ea6d' });\n\tpublic static readonly searchSave = new Codicon('search-save', { fontCharacter: '\\\\ea6d' });\n\tpublic static readonly logOut = new Codicon('log-out', { fontCharacter: '\\\\ea6e' });\n\tpublic static readonly signOut = new Codicon('sign-out', { fontCharacter: '\\\\ea6e' });\n\tpublic static readonly logIn = new Codicon('log-in', { fontCharacter: '\\\\ea6f' });\n\tpublic static readonly signIn = new Codicon('sign-in', { fontCharacter: '\\\\ea6f' });\n\tpublic static readonly eye = new Codicon('eye', { fontCharacter: '\\\\ea70' });\n\tpublic static readonly eyeUnwatch = new Codicon('eye-unwatch', { fontCharacter: '\\\\ea70' });\n\tpublic static readonly eyeWatch = new Codicon('eye-watch', { fontCharacter: '\\\\ea70' });\n\tpublic static readonly circleFilled = new Codicon('circle-filled', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly primitiveDot = new Codicon('primitive-dot', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly closeDirty = new Codicon('close-dirty', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly debugBreakpoint = new Codicon('debug-breakpoint', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly debugBreakpointDisabled = new Codicon('debug-breakpoint-disabled', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly debugHint = new Codicon('debug-hint', { fontCharacter: '\\\\ea71' });\n\tpublic static readonly primitiveSquare = new Codicon('primitive-square', { fontCharacter: '\\\\ea72' });\n\tpublic static readonly edit = new Codicon('edit', { fontCharacter: '\\\\ea73' });\n\tpublic static readonly pencil = new Codicon('pencil', { fontCharacter: '\\\\ea73' });\n\tpublic static readonly info = new Codicon('info', { fontCharacter: '\\\\ea74' });\n\tpublic static readonly issueOpened = new Codicon('issue-opened', { fontCharacter: '\\\\ea74' });\n\tpublic static readonly gistPrivate = new Codicon('gist-private', { fontCharacter: '\\\\ea75' });\n\tpublic static readonly gitForkPrivate = new Codicon('git-fork-private', { fontCharacter: '\\\\ea75' });\n\tpublic static readonly lock = new Codicon('lock', { fontCharacter: '\\\\ea75' });\n\tpublic static readonly mirrorPrivate = new Codicon('mirror-private', { fontCharacter: '\\\\ea75' });\n\tpublic static readonly close = new Codicon('close', { fontCharacter: '\\\\ea76' });\n\tpublic static readonly removeClose = new Codicon('remove-close', { fontCharacter: '\\\\ea76' });\n\tpublic static readonly x = new Codicon('x', { fontCharacter: '\\\\ea76' });\n\tpublic static readonly repoSync = new Codicon('repo-sync', { fontCharacter: '\\\\ea77' });\n\tpublic static readonly sync = new Codicon('sync', { fontCharacter: '\\\\ea77' });\n\tpublic static readonly clone = new Codicon('clone', { fontCharacter: '\\\\ea78' });\n\tpublic static readonly desktopDownload = new Codicon('desktop-download', { fontCharacter: '\\\\ea78' });\n\tpublic static readonly beaker = new Codicon('beaker', { fontCharacter: '\\\\ea79' });\n\tpublic static readonly microscope = new Codicon('microscope', { fontCharacter: '\\\\ea79' });\n\tpublic static readonly vm = new Codicon('vm', { fontCharacter: '\\\\ea7a' });\n\tpublic static readonly deviceDesktop = new Codicon('device-desktop', { fontCharacter: '\\\\ea7a' });\n\tpublic static readonly file = new Codicon('file', { fontCharacter: '\\\\ea7b' });\n\tpublic static readonly fileText = new Codicon('file-text', { fontCharacter: '\\\\ea7b' });\n\tpublic static readonly more = new Codicon('more', { fontCharacter: '\\\\ea7c' });\n\tpublic static readonly ellipsis = new Codicon('ellipsis', { fontCharacter: '\\\\ea7c' });\n\tpublic static readonly kebabHorizontal = new Codicon('kebab-horizontal', { fontCharacter: '\\\\ea7c' });\n\tpublic static readonly mailReply = new Codicon('mail-reply', { fontCharacter: '\\\\ea7d' });\n\tpublic static readonly reply = new Codicon('reply', { fontCharacter: '\\\\ea7d' });\n\tpublic static readonly organization = new Codicon('organization', { fontCharacter: '\\\\ea7e' });\n\tpublic static readonly organizationFilled = new Codicon('organization-filled', { fontCharacter: '\\\\ea7e' });\n\tpublic static readonly organizationOutline = new Codicon('organization-outline', { fontCharacter: '\\\\ea7e' });\n\tpublic static readonly newFile = new Codicon('new-file', { fontCharacter: '\\\\ea7f' });\n\tpublic static readonly fileAdd = new Codicon('file-add', { fontCharacter: '\\\\ea7f' });\n\tpublic static readonly newFolder = new Codicon('new-folder', { fontCharacter: '\\\\ea80' });\n\tpublic static readonly fileDirectoryCreate = new Codicon('file-directory-create', { fontCharacter: '\\\\ea80' });\n\tpublic static readonly trash = new Codicon('trash', { fontCharacter: '\\\\ea81' });\n\tpublic static readonly trashcan = new Codicon('trashcan', { fontCharacter: '\\\\ea81' });\n\tpublic static readonly history = new Codicon('history', { fontCharacter: '\\\\ea82' });\n\tpublic static readonly clock = new Codicon('clock', { fontCharacter: '\\\\ea82' });\n\tpublic static readonly folder = new Codicon('folder', { fontCharacter: '\\\\ea83' });\n\tpublic static readonly fileDirectory = new Codicon('file-directory', { fontCharacter: '\\\\ea83' });\n\tpublic static readonly symbolFolder = new Codicon('symbol-folder', { fontCharacter: '\\\\ea83' });\n\tpublic static readonly logoGithub = new Codicon('logo-github', { fontCharacter: '\\\\ea84' });\n\tpublic static readonly markGithub = new Codicon('mark-github', { fontCharacter: '\\\\ea84' });\n\tpublic static readonly github = new Codicon('github', { fontCharacter: '\\\\ea84' });\n\tpublic static readonly terminal = new Codicon('terminal', { fontCharacter: '\\\\ea85' });\n\tpublic static readonly console = new Codicon('console', { fontCharacter: '\\\\ea85' });\n\tpublic static readonly repl = new Codicon('repl', { fontCharacter: '\\\\ea85' });\n\tpublic static readonly zap = new Codicon('zap', { fontCharacter: '\\\\ea86' });\n\tpublic static readonly symbolEvent = new Codicon('symbol-event', { fontCharacter: '\\\\ea86' });\n\tpublic static readonly error = new Codicon('error', { fontCharacter: '\\\\ea87' });\n\tpublic static readonly stop = new Codicon('stop', { fontCharacter: '\\\\ea87' });\n\tpublic static readonly variable = new Codicon('variable', { fontCharacter: '\\\\ea88' });\n\tpublic static readonly symbolVariable = new Codicon('symbol-variable', { fontCharacter: '\\\\ea88' });\n\tpublic static readonly array = new Codicon('array', { fontCharacter: '\\\\ea8a' });\n\tpublic static readonly symbolArray = new Codicon('symbol-array', { fontCharacter: '\\\\ea8a' });\n\tpublic static readonly symbolModule = new Codicon('symbol-module', { fontCharacter: '\\\\ea8b' });\n\tpublic static readonly symbolPackage = new Codicon('symbol-package', { fontCharacter: '\\\\ea8b' });\n\tpublic static readonly symbolNamespace = new Codicon('symbol-namespace', { fontCharacter: '\\\\ea8b' });\n\tpublic static readonly symbolObject = new Codicon('symbol-object', { fontCharacter: '\\\\ea8b' });\n\tpublic static readonly symbolMethod = new Codicon('symbol-method', { fontCharacter: '\\\\ea8c' });\n\tpublic static readonly symbolFunction = new Codicon('symbol-function', { fontCharacter: '\\\\ea8c' });\n\tpublic static readonly symbolConstructor = new Codicon('symbol-constructor', { fontCharacter: '\\\\ea8c' });\n\tpublic static readonly symbolBoolean = new Codicon('symbol-boolean', { fontCharacter: '\\\\ea8f' });\n\tpublic static readonly symbolNull = new Codicon('symbol-null', { fontCharacter: '\\\\ea8f' });\n\tpublic static readonly symbolNumeric = new Codicon('symbol-numeric', { fontCharacter: '\\\\ea90' });\n\tpublic static readonly symbolNumber = new Codicon('symbol-number', { fontCharacter: '\\\\ea90' });\n\tpublic static readonly symbolStructure = new Codicon('symbol-structure', { fontCharacter: '\\\\ea91' });\n\tpublic static readonly symbolStruct = new Codicon('symbol-struct', { fontCharacter: '\\\\ea91' });\n\tpublic static readonly symbolParameter = new Codicon('symbol-parameter', { fontCharacter: '\\\\ea92' });\n\tpublic static readonly symbolTypeParameter = new Codicon('symbol-type-parameter', { fontCharacter: '\\\\ea92' });\n\tpublic static readonly symbolKey = new Codicon('symbol-key', { fontCharacter: '\\\\ea93' });\n\tpublic static readonly symbolText = new Codicon('symbol-text', { fontCharacter: '\\\\ea93' });\n\tpublic static readonly symbolReference = new Codicon('symbol-reference', { fontCharacter: '\\\\ea94' });\n\tpublic static readonly goToFile = new Codicon('go-to-file', { fontCharacter: '\\\\ea94' });\n\tpublic static readonly symbolEnum = new Codicon('symbol-enum', { fontCharacter: '\\\\ea95' });\n\tpublic static readonly symbolValue = new Codicon('symbol-value', { fontCharacter: '\\\\ea95' });\n\tpublic static readonly symbolRuler = new Codicon('symbol-ruler', { fontCharacter: '\\\\ea96' });\n\tpublic static readonly symbolUnit = new Codicon('symbol-unit', { fontCharacter: '\\\\ea96' });\n\tpublic static readonly activateBreakpoints = new Codicon('activate-breakpoints', { fontCharacter: '\\\\ea97' });\n\tpublic static readonly archive = new Codicon('archive', { fontCharacter: '\\\\ea98' });\n\tpublic static readonly arrowBoth = new Codicon('arrow-both', { fontCharacter: '\\\\ea99' });\n\tpublic static readonly arrowDown = new Codicon('arrow-down', { fontCharacter: '\\\\ea9a' });\n\tpublic static readonly arrowLeft = new Codicon('arrow-left', { fontCharacter: '\\\\ea9b' });\n\tpublic static readonly arrowRight = new Codicon('arrow-right', { fontCharacter: '\\\\ea9c' });\n\tpublic static readonly arrowSmallDown = new Codicon('arrow-small-down', { fontCharacter: '\\\\ea9d' });\n\tpublic static readonly arrowSmallLeft = new Codicon('arrow-small-left', { fontCharacter: '\\\\ea9e' });\n\tpublic static readonly arrowSmallRight = new Codicon('arrow-small-right', { fontCharacter: '\\\\ea9f' });\n\tpublic static readonly arrowSmallUp = new Codicon('arrow-small-up', { fontCharacter: '\\\\eaa0' });\n\tpublic static readonly arrowUp = new Codicon('arrow-up', { fontCharacter: '\\\\eaa1' });\n\tpublic static readonly bell = new Codicon('bell', { fontCharacter: '\\\\eaa2' });\n\tpublic static readonly bold = new Codicon('bold', { fontCharacter: '\\\\eaa3' });\n\tpublic static readonly book = new Codicon('book', { fontCharacter: '\\\\eaa4' });\n\tpublic static readonly bookmark = new Codicon('bookmark', { fontCharacter: '\\\\eaa5' });\n\tpublic static readonly debugBreakpointConditionalUnverified = new Codicon('debug-breakpoint-conditional-unverified', { fontCharacter: '\\\\eaa6' });\n\tpublic static readonly debugBreakpointConditional = new Codicon('debug-breakpoint-conditional', { fontCharacter: '\\\\eaa7' });\n\tpublic static readonly debugBreakpointConditionalDisabled = new Codicon('debug-breakpoint-conditional-disabled', { fontCharacter: '\\\\eaa7' });\n\tpublic static readonly debugBreakpointDataUnverified = new Codicon('debug-breakpoint-data-unverified', { fontCharacter: '\\\\eaa8' });\n\tpublic static readonly debugBreakpointData = new Codicon('debug-breakpoint-data', { fontCharacter: '\\\\eaa9' });\n\tpublic static readonly debugBreakpointDataDisabled = new Codicon('debug-breakpoint-data-disabled', { fontCharacter: '\\\\eaa9' });\n\tpublic static readonly debugBreakpointLogUnverified = new Codicon('debug-breakpoint-log-unverified', { fontCharacter: '\\\\eaaa' });\n\tpublic static readonly debugBreakpointLog = new Codicon('debug-breakpoint-log', { fontCharacter: '\\\\eaab' });\n\tpublic static readonly debugBreakpointLogDisabled = new Codicon('debug-breakpoint-log-disabled', { fontCharacter: '\\\\eaab' });\n\tpublic static readonly briefcase = new Codicon('briefcase', { fontCharacter: '\\\\eaac' });\n\tpublic static readonly broadcast = new Codicon('broadcast', { fontCharacter: '\\\\eaad' });\n\tpublic static readonly browser = new Codicon('browser', { fontCharacter: '\\\\eaae' });\n\tpublic static readonly bug = new Codicon('bug', { fontCharacter: '\\\\eaaf' });\n\tpublic static readonly calendar = new Codicon('calendar', { fontCharacter: '\\\\eab0' });\n\tpublic static readonly caseSensitive = new Codicon('case-sensitive', { fontCharacter: '\\\\eab1' });\n\tpublic static readonly check = new Codicon('check', { fontCharacter: '\\\\eab2' });\n\tpublic static readonly checklist = new Codicon('checklist', { fontCharacter: '\\\\eab3' });\n\tpublic static readonly chevronDown = new Codicon('chevron-down', { fontCharacter: '\\\\eab4' });\n\tpublic static readonly dropDownButton = new Codicon('drop-down-button', Codicon.chevronDown.definition);\n\tpublic static readonly chevronLeft = new Codicon('chevron-left', { fontCharacter: '\\\\eab5' });\n\tpublic static readonly chevronRight = new Codicon('chevron-right', { fontCharacter: '\\\\eab6' });\n\tpublic static readonly chevronUp = new Codicon('chevron-up', { fontCharacter: '\\\\eab7' });\n\tpublic static readonly chromeClose = new Codicon('chrome-close', { fontCharacter: '\\\\eab8' });\n\tpublic static readonly chromeMaximize = new Codicon('chrome-maximize', { fontCharacter: '\\\\eab9' });\n\tpublic static readonly chromeMinimize = new Codicon('chrome-minimize', { fontCharacter: '\\\\eaba' });\n\tpublic static readonly chromeRestore = new Codicon('chrome-restore', { fontCharacter: '\\\\eabb' });\n\tpublic static readonly circleOutline = new Codicon('circle-outline', { fontCharacter: '\\\\eabc' });\n\tpublic static readonly debugBreakpointUnverified = new Codicon('debug-breakpoint-unverified', { fontCharacter: '\\\\eabc' });\n\tpublic static readonly circleSlash = new Codicon('circle-slash', { fontCharacter: '\\\\eabd' });\n\tpublic static readonly circuitBoard = new Codicon('circuit-board', { fontCharacter: '\\\\eabe' });\n\tpublic static readonly clearAll = new Codicon('clear-all', { fontCharacter: '\\\\eabf' });\n\tpublic static readonly clippy = new Codicon('clippy', { fontCharacter: '\\\\eac0' });\n\tpublic static readonly closeAll = new Codicon('close-all', { fontCharacter: '\\\\eac1' });\n\tpublic static readonly cloudDownload = new Codicon('cloud-download', { fontCharacter: '\\\\eac2' });\n\tpublic static readonly cloudUpload = new Codicon('cloud-upload', { fontCharacter: '\\\\eac3' });\n\tpublic static readonly code = new Codicon('code', { fontCharacter: '\\\\eac4' });\n\tpublic static readonly collapseAll = new Codicon('collapse-all', { fontCharacter: '\\\\eac5' });\n\tpublic static readonly colorMode = new Codicon('color-mode', { fontCharacter: '\\\\eac6' });\n\tpublic static readonly commentDiscussion = new Codicon('comment-discussion', { fontCharacter: '\\\\eac7' });\n\tpublic static readonly compareChanges = new Codicon('compare-changes', { fontCharacter: '\\\\eafd' });\n\tpublic static readonly creditCard = new Codicon('credit-card', { fontCharacter: '\\\\eac9' });\n\tpublic static readonly dash = new Codicon('dash', { fontCharacter: '\\\\eacc' });\n\tpublic static readonly dashboard = new Codicon('dashboard', { fontCharacter: '\\\\eacd' });\n\tpublic static readonly database = new Codicon('database', { fontCharacter: '\\\\eace' });\n\tpublic static readonly debugContinue = new Codicon('debug-continue', { fontCharacter: '\\\\eacf' });\n\tpublic static readonly debugDisconnect = new Codicon('debug-disconnect', { fontCharacter: '\\\\ead0' });\n\tpublic static readonly debugPause = new Codicon('debug-pause', { fontCharacter: '\\\\ead1' });\n\tpublic static readonly debugRestart = new Codicon('debug-restart', { fontCharacter: '\\\\ead2' });\n\tpublic static readonly debugStart = new Codicon('debug-start', { fontCharacter: '\\\\ead3' });\n\tpublic static readonly debugStepInto = new Codicon('debug-step-into', { fontCharacter: '\\\\ead4' });\n\tpublic static readonly debugStepOut = new Codicon('debug-step-out', { fontCharacter: '\\\\ead5' });\n\tpublic static readonly debugStepOver = new Codicon('debug-step-over', { fontCharacter: '\\\\ead6' });\n\tpublic static readonly debugStop = new Codicon('debug-stop', { fontCharacter: '\\\\ead7' });\n\tpublic static readonly debug = new Codicon('debug', { fontCharacter: '\\\\ead8' });\n\tpublic static readonly deviceCameraVideo = new Codicon('device-camera-video', { fontCharacter: '\\\\ead9' });\n\tpublic static readonly deviceCamera = new Codicon('device-camera', { fontCharacter: '\\\\eada' });\n\tpublic static readonly deviceMobile = new Codicon('device-mobile', { fontCharacter: '\\\\eadb' });\n\tpublic static readonly diffAdded = new Codicon('diff-added', { fontCharacter: '\\\\eadc' });\n\tpublic static readonly diffIgnored = new Codicon('diff-ignored', { fontCharacter: '\\\\eadd' });\n\tpublic static readonly diffModified = new Codicon('diff-modified', { fontCharacter: '\\\\eade' });\n\tpublic static readonly diffRemoved = new Codicon('diff-removed', { fontCharacter: '\\\\eadf' });\n\tpublic static readonly diffRenamed = new Codicon('diff-renamed', { fontCharacter: '\\\\eae0' });\n\tpublic static readonly diff = new Codicon('diff', { fontCharacter: '\\\\eae1' });\n\tpublic static readonly discard = new Codicon('discard', { fontCharacter: '\\\\eae2' });\n\tpublic static readonly editorLayout = new Codicon('editor-layout', { fontCharacter: '\\\\eae3' });\n\tpublic static readonly emptyWindow = new Codicon('empty-window', { fontCharacter: '\\\\eae4' });\n\tpublic static readonly exclude = new Codicon('exclude', { fontCharacter: '\\\\eae5' });\n\tpublic static readonly extensions = new Codicon('extensions', { fontCharacter: '\\\\eae6' });\n\tpublic static readonly eyeClosed = new Codicon('eye-closed', { fontCharacter: '\\\\eae7' });\n\tpublic static readonly fileBinary = new Codicon('file-binary', { fontCharacter: '\\\\eae8' });\n\tpublic static readonly fileCode = new Codicon('file-code', { fontCharacter: '\\\\eae9' });\n\tpublic static readonly fileMedia = new Codicon('file-media', { fontCharacter: '\\\\eaea' });\n\tpublic static readonly filePdf = new Codicon('file-pdf', { fontCharacter: '\\\\eaeb' });\n\tpublic static readonly fileSubmodule = new Codicon('file-submodule', { fontCharacter: '\\\\eaec' });\n\tpublic static readonly fileSymlinkDirectory = new Codicon('file-symlink-directory', { fontCharacter: '\\\\eaed' });\n\tpublic static readonly fileSymlinkFile = new Codicon('file-symlink-file', { fontCharacter: '\\\\eaee' });\n\tpublic static readonly fileZip = new Codicon('file-zip', { fontCharacter: '\\\\eaef' });\n\tpublic static readonly files = new Codicon('files', { fontCharacter: '\\\\eaf0' });\n\tpublic static readonly filter = new Codicon('filter', { fontCharacter: '\\\\eaf1' });\n\tpublic static readonly flame = new Codicon('flame', { fontCharacter: '\\\\eaf2' });\n\tpublic static readonly foldDown = new Codicon('fold-down', { fontCharacter: '\\\\eaf3' });\n\tpublic static readonly foldUp = new Codicon('fold-up', { fontCharacter: '\\\\eaf4' });\n\tpublic static readonly fold = new Codicon('fold', { fontCharacter: '\\\\eaf5' });\n\tpublic static readonly folderActive = new Codicon('folder-active', { fontCharacter: '\\\\eaf6' });\n\tpublic static readonly folderOpened = new Codicon('folder-opened', { fontCharacter: '\\\\eaf7' });\n\tpublic static readonly gear = new Codicon('gear', { fontCharacter: '\\\\eaf8' });\n\tpublic static readonly gift = new Codicon('gift', { fontCharacter: '\\\\eaf9' });\n\tpublic static readonly gistSecret = new Codicon('gist-secret', { fontCharacter: '\\\\eafa' });\n\tpublic static readonly gist = new Codicon('gist', { fontCharacter: '\\\\eafb' });\n\tpublic static readonly gitCommit = new Codicon('git-commit', { fontCharacter: '\\\\eafc' });\n\tpublic static readonly gitCompare = new Codicon('git-compare', { fontCharacter: '\\\\eafd' });\n\tpublic static readonly gitMerge = new Codicon('git-merge', { fontCharacter: '\\\\eafe' });\n\tpublic static readonly githubAction = new Codicon('github-action', { fontCharacter: '\\\\eaff' });\n\tpublic static readonly githubAlt = new Codicon('github-alt', { fontCharacter: '\\\\eb00' });\n\tpublic static readonly globe = new Codicon('globe', { fontCharacter: '\\\\eb01' });\n\tpublic static readonly grabber = new Codicon('grabber', { fontCharacter: '\\\\eb02' });\n\tpublic static readonly graph = new Codicon('graph', { fontCharacter: '\\\\eb03' });\n\tpublic static readonly gripper = new Codicon('gripper', { fontCharacter: '\\\\eb04' });\n\tpublic static readonly heart = new Codicon('heart', { fontCharacter: '\\\\eb05' });\n\tpublic static readonly home = new Codicon('home', { fontCharacter: '\\\\eb06' });\n\tpublic static readonly horizontalRule = new Codicon('horizontal-rule', { fontCharacter: '\\\\eb07' });\n\tpublic static readonly hubot = new Codicon('hubot', { fontCharacter: '\\\\eb08' });\n\tpublic static readonly inbox = new Codicon('inbox', { fontCharacter: '\\\\eb09' });\n\tpublic static readonly issueClosed = new Codicon('issue-closed', { fontCharacter: '\\\\eba4' });\n\tpublic static readonly issueReopened = new Codicon('issue-reopened', { fontCharacter: '\\\\eb0b' });\n\tpublic static readonly issues = new Codicon('issues', { fontCharacter: '\\\\eb0c' });\n\tpublic static readonly italic = new Codicon('italic', { fontCharacter: '\\\\eb0d' });\n\tpublic static readonly jersey = new Codicon('jersey', { fontCharacter: '\\\\eb0e' });\n\tpublic static readonly json = new Codicon('json', { fontCharacter: '\\\\eb0f' });\n\tpublic static readonly kebabVertical = new Codicon('kebab-vertical', { fontCharacter: '\\\\eb10' });\n\tpublic static readonly key = new Codicon('key', { fontCharacter: '\\\\eb11' });\n\tpublic static readonly law = new Codicon('law', { fontCharacter: '\\\\eb12' });\n\tpublic static readonly lightbulbAutofix = new Codicon('lightbulb-autofix', { fontCharacter: '\\\\eb13' });\n\tpublic static readonly linkExternal = new Codicon('link-external', { fontCharacter: '\\\\eb14' });\n\tpublic static readonly link = new Codicon('link', { fontCharacter: '\\\\eb15' });\n\tpublic static readonly listOrdered = new Codicon('list-ordered', { fontCharacter: '\\\\eb16' });\n\tpublic static readonly listUnordered = new Codicon('list-unordered', { fontCharacter: '\\\\eb17' });\n\tpublic static readonly liveShare = new Codicon('live-share', { fontCharacter: '\\\\eb18' });\n\tpublic static readonly loading = new Codicon('loading', { fontCharacter: '\\\\eb19' });\n\tpublic static readonly location = new Codicon('location', { fontCharacter: '\\\\eb1a' });\n\tpublic static readonly mailRead = new Codicon('mail-read', { fontCharacter: '\\\\eb1b' });\n\tpublic static readonly mail = new Codicon('mail', { fontCharacter: '\\\\eb1c' });\n\tpublic static readonly markdown = new Codicon('markdown', { fontCharacter: '\\\\eb1d' });\n\tpublic static readonly megaphone = new Codicon('megaphone', { fontCharacter: '\\\\eb1e' });\n\tpublic static readonly mention = new Codicon('mention', { fontCharacter: '\\\\eb1f' });\n\tpublic static readonly milestone = new Codicon('milestone', { fontCharacter: '\\\\eb20' });\n\tpublic static readonly mortarBoard = new Codicon('mortar-board', { fontCharacter: '\\\\eb21' });\n\tpublic static readonly move = new Codicon('move', { fontCharacter: '\\\\eb22' });\n\tpublic static readonly multipleWindows = new Codicon('multiple-windows', { fontCharacter: '\\\\eb23' });\n\tpublic static readonly mute = new Codicon('mute', { fontCharacter: '\\\\eb24' });\n\tpublic static readonly noNewline = new Codicon('no-newline', { fontCharacter: '\\\\eb25' });\n\tpublic static readonly note = new Codicon('note', { fontCharacter: '\\\\eb26' });\n\tpublic static readonly octoface = new Codicon('octoface', { fontCharacter: '\\\\eb27' });\n\tpublic static readonly openPreview = new Codicon('open-preview', { fontCharacter: '\\\\eb28' });\n\tpublic static readonly package_ = new Codicon('package', { fontCharacter: '\\\\eb29' });\n\tpublic static readonly paintcan = new Codicon('paintcan', { fontCharacter: '\\\\eb2a' });\n\tpublic static readonly pin = new Codicon('pin', { fontCharacter: '\\\\eb2b' });\n\tpublic static readonly play = new Codicon('play', { fontCharacter: '\\\\eb2c' });\n\tpublic static readonly run = new Codicon('run', { fontCharacter: '\\\\eb2c' });\n\tpublic static readonly plug = new Codicon('plug', { fontCharacter: '\\\\eb2d' });\n\tpublic static readonly preserveCase = new Codicon('preserve-case', { fontCharacter: '\\\\eb2e' });\n\tpublic static readonly preview = new Codicon('preview', { fontCharacter: '\\\\eb2f' });\n\tpublic static readonly project = new Codicon('project', { fontCharacter: '\\\\eb30' });\n\tpublic static readonly pulse = new Codicon('pulse', { fontCharacter: '\\\\eb31' });\n\tpublic static readonly question = new Codicon('question', { fontCharacter: '\\\\eb32' });\n\tpublic static readonly quote = new Codicon('quote', { fontCharacter: '\\\\eb33' });\n\tpublic static readonly radioTower = new Codicon('radio-tower', { fontCharacter: '\\\\eb34' });\n\tpublic static readonly reactions = new Codicon('reactions', { fontCharacter: '\\\\eb35' });\n\tpublic static readonly references = new Codicon('references', { fontCharacter: '\\\\eb36' });\n\tpublic static readonly refresh = new Codicon('refresh', { fontCharacter: '\\\\eb37' });\n\tpublic static readonly regex = new Codicon('regex', { fontCharacter: '\\\\eb38' });\n\tpublic static readonly remoteExplorer = new Codicon('remote-explorer', { fontCharacter: '\\\\eb39' });\n\tpublic static readonly remote = new Codicon('remote', { fontCharacter: '\\\\eb3a' });\n\tpublic static readonly remove = new Codicon('remove', { fontCharacter: '\\\\eb3b' });\n\tpublic static readonly replaceAll = new Codicon('replace-all', { fontCharacter: '\\\\eb3c' });\n\tpublic static readonly replace = new Codicon('replace', { fontCharacter: '\\\\eb3d' });\n\tpublic static readonly repoClone = new Codicon('repo-clone', { fontCharacter: '\\\\eb3e' });\n\tpublic static readonly repoForcePush = new Codicon('repo-force-push', { fontCharacter: '\\\\eb3f' });\n\tpublic static readonly repoPull = new Codicon('repo-pull', { fontCharacter: '\\\\eb40' });\n\tpublic static readonly repoPush = new Codicon('repo-push', { fontCharacter: '\\\\eb41' });\n\tpublic static readonly report = new Codicon('report', { fontCharacter: '\\\\eb42' });\n\tpublic static readonly requestChanges = new Codicon('request-changes', { fontCharacter: '\\\\eb43' });\n\tpublic static readonly rocket = new Codicon('rocket', { fontCharacter: '\\\\eb44' });\n\tpublic static readonly rootFolderOpened = new Codicon('root-folder-opened', { fontCharacter: '\\\\eb45' });\n\tpublic static readonly rootFolder = new Codicon('root-folder', { fontCharacter: '\\\\eb46' });\n\tpublic static readonly rss = new Codicon('rss', { fontCharacter: '\\\\eb47' });\n\tpublic static readonly ruby = new Codicon('ruby', { fontCharacter: '\\\\eb48' });\n\tpublic static readonly saveAll = new Codicon('save-all', { fontCharacter: '\\\\eb49' });\n\tpublic static readonly saveAs = new Codicon('save-as', { fontCharacter: '\\\\eb4a' });\n\tpublic static readonly save = new Codicon('save', { fontCharacter: '\\\\eb4b' });\n\tpublic static readonly screenFull = new Codicon('screen-full', { fontCharacter: '\\\\eb4c' });\n\tpublic static readonly screenNormal = new Codicon('screen-normal', { fontCharacter: '\\\\eb4d' });\n\tpublic static readonly searchStop = new Codicon('search-stop', { fontCharacter: '\\\\eb4e' });\n\tpublic static readonly server = new Codicon('server', { fontCharacter: '\\\\eb50' });\n\tpublic static readonly settingsGear = new Codicon('settings-gear', { fontCharacter: '\\\\eb51' });\n\tpublic static readonly settings = new Codicon('settings', { fontCharacter: '\\\\eb52' });\n\tpublic static readonly shield = new Codicon('shield', { fontCharacter: '\\\\eb53' });\n\tpublic static readonly smiley = new Codicon('smiley', { fontCharacter: '\\\\eb54' });\n\tpublic static readonly sortPrecedence = new Codicon('sort-precedence', { fontCharacter: '\\\\eb55' });\n\tpublic static readonly splitHorizontal = new Codicon('split-horizontal', { fontCharacter: '\\\\eb56' });\n\tpublic static readonly splitVertical = new Codicon('split-vertical', { fontCharacter: '\\\\eb57' });\n\tpublic static readonly squirrel = new Codicon('squirrel', { fontCharacter: '\\\\eb58' });\n\tpublic static readonly starFull = new Codicon('star-full', { fontCharacter: '\\\\eb59' });\n\tpublic static readonly starHalf = new Codicon('star-half', { fontCharacter: '\\\\eb5a' });\n\tpublic static readonly symbolClass = new Codicon('symbol-class', { fontCharacter: '\\\\eb5b' });\n\tpublic static readonly symbolColor = new Codicon('symbol-color', { fontCharacter: '\\\\eb5c' });\n\tpublic static readonly symbolCustomColor = new Codicon('symbol-customcolor', { fontCharacter: '\\\\eb5c' });\n\tpublic static readonly symbolConstant = new Codicon('symbol-constant', { fontCharacter: '\\\\eb5d' });\n\tpublic static readonly symbolEnumMember = new Codicon('symbol-enum-member', { fontCharacter: '\\\\eb5e' });\n\tpublic static readonly symbolField = new Codicon('symbol-field', { fontCharacter: '\\\\eb5f' });\n\tpublic static readonly symbolFile = new Codicon('symbol-file', { fontCharacter: '\\\\eb60' });\n\tpublic static readonly symbolInterface = new Codicon('symbol-interface', { fontCharacter: '\\\\eb61' });\n\tpublic static readonly symbolKeyword = new Codicon('symbol-keyword', { fontCharacter: '\\\\eb62' });\n\tpublic static readonly symbolMisc = new Codicon('symbol-misc', { fontCharacter: '\\\\eb63' });\n\tpublic static readonly symbolOperator = new Codicon('symbol-operator', { fontCharacter: '\\\\eb64' });\n\tpublic static readonly symbolProperty = new Codicon('symbol-property', { fontCharacter: '\\\\eb65' });\n\tpublic static readonly wrench = new Codicon('wrench', { fontCharacter: '\\\\eb65' });\n\tpublic static readonly wrenchSubaction = new Codicon('wrench-subaction', { fontCharacter: '\\\\eb65' });\n\tpublic static readonly symbolSnippet = new Codicon('symbol-snippet', { fontCharacter: '\\\\eb66' });\n\tpublic static readonly tasklist = new Codicon('tasklist', { fontCharacter: '\\\\eb67' });\n\tpublic static readonly telescope = new Codicon('telescope', { fontCharacter: '\\\\eb68' });\n\tpublic static readonly textSize = new Codicon('text-size', { fontCharacter: '\\\\eb69' });\n\tpublic static readonly threeBars = new Codicon('three-bars', { fontCharacter: '\\\\eb6a' });\n\tpublic static readonly thumbsdown = new Codicon('thumbsdown', { fontCharacter: '\\\\eb6b' });\n\tpublic static readonly thumbsup = new Codicon('thumbsup', { fontCharacter: '\\\\eb6c' });\n\tpublic static readonly tools = new Codicon('tools', { fontCharacter: '\\\\eb6d' });\n\tpublic static readonly triangleDown = new Codicon('triangle-down', { fontCharacter: '\\\\eb6e' });\n\tpublic static readonly triangleLeft = new Codicon('triangle-left', { fontCharacter: '\\\\eb6f' });\n\tpublic static readonly triangleRight = new Codicon('triangle-right', { fontCharacter: '\\\\eb70' });\n\tpublic static readonly triangleUp = new Codicon('triangle-up', { fontCharacter: '\\\\eb71' });\n\tpublic static readonly twitter = new Codicon('twitter', { fontCharacter: '\\\\eb72' });\n\tpublic static readonly unfold = new Codicon('unfold', { fontCharacter: '\\\\eb73' });\n\tpublic static readonly unlock = new Codicon('unlock', { fontCharacter: '\\\\eb74' });\n\tpublic static readonly unmute = new Codicon('unmute', { fontCharacter: '\\\\eb75' });\n\tpublic static readonly unverified = new Codicon('unverified', { fontCharacter: '\\\\eb76' });\n\tpublic static readonly verified = new Codicon('verified', { fontCharacter: '\\\\eb77' });\n\tpublic static readonly versions = new Codicon('versions', { fontCharacter: '\\\\eb78' });\n\tpublic static readonly vmActive = new Codicon('vm-active', { fontCharacter: '\\\\eb79' });\n\tpublic static readonly vmOutline = new Codicon('vm-outline', { fontCharacter: '\\\\eb7a' });\n\tpublic static readonly vmRunning = new Codicon('vm-running', { fontCharacter: '\\\\eb7b' });\n\tpublic static readonly watch = new Codicon('watch', { fontCharacter: '\\\\eb7c' });\n\tpublic static readonly whitespace = new Codicon('whitespace', { fontCharacter: '\\\\eb7d' });\n\tpublic static readonly wholeWord = new Codicon('whole-word', { fontCharacter: '\\\\eb7e' });\n\tpublic static readonly window = new Codicon('window', { fontCharacter: '\\\\eb7f' });\n\tpublic static readonly wordWrap = new Codicon('word-wrap', { fontCharacter: '\\\\eb80' });\n\tpublic static readonly zoomIn = new Codicon('zoom-in', { fontCharacter: '\\\\eb81' });\n\tpublic static readonly zoomOut = new Codicon('zoom-out', { fontCharacter: '\\\\eb82' });\n\tpublic static readonly listFilter = new Codicon('list-filter', { fontCharacter: '\\\\eb83' });\n\tpublic static readonly listFlat = new Codicon('list-flat', { fontCharacter: '\\\\eb84' });\n\tpublic static readonly listSelection = new Codicon('list-selection', { fontCharacter: '\\\\eb85' });\n\tpublic static readonly selection = new Codicon('selection', { fontCharacter: '\\\\eb85' });\n\tpublic static readonly listTree = new Codicon('list-tree', { fontCharacter: '\\\\eb86' });\n\tpublic static readonly debugBreakpointFunctionUnverified = new Codicon('debug-breakpoint-function-unverified', { fontCharacter: '\\\\eb87' });\n\tpublic static readonly debugBreakpointFunction = new Codicon('debug-breakpoint-function', { fontCharacter: '\\\\eb88' });\n\tpublic static readonly debugBreakpointFunctionDisabled = new Codicon('debug-breakpoint-function-disabled', { fontCharacter: '\\\\eb88' });\n\tpublic static readonly debugStackframeActive = new Codicon('debug-stackframe-active', { fontCharacter: '\\\\eb89' });\n\tpublic static readonly debugStackframeDot = new Codicon('debug-stackframe-dot', { fontCharacter: '\\\\eb8a' });\n\tpublic static readonly debugStackframe = new Codicon('debug-stackframe', { fontCharacter: '\\\\eb8b' });\n\tpublic static readonly debugStackframeFocused = new Codicon('debug-stackframe-focused', { fontCharacter: '\\\\eb8b' });\n\tpublic static readonly debugBreakpointUnsupported = new Codicon('debug-breakpoint-unsupported', { fontCharacter: '\\\\eb8c' });\n\tpublic static readonly symbolString = new Codicon('symbol-string', { fontCharacter: '\\\\eb8d' });\n\tpublic static readonly debugReverseContinue = new Codicon('debug-reverse-continue', { fontCharacter: '\\\\eb8e' });\n\tpublic static readonly debugStepBack = new Codicon('debug-step-back', { fontCharacter: '\\\\eb8f' });\n\tpublic static readonly debugRestartFrame = new Codicon('debug-restart-frame', { fontCharacter: '\\\\eb90' });\n\tpublic static readonly callIncoming = new Codicon('call-incoming', { fontCharacter: '\\\\eb92' });\n\tpublic static readonly callOutgoing = new Codicon('call-outgoing', { fontCharacter: '\\\\eb93' });\n\tpublic static readonly menu = new Codicon('menu', { fontCharacter: '\\\\eb94' });\n\tpublic static readonly expandAll = new Codicon('expand-all', { fontCharacter: '\\\\eb95' });\n\tpublic static readonly feedback = new Codicon('feedback', { fontCharacter: '\\\\eb96' });\n\tpublic static readonly groupByRefType = new Codicon('group-by-ref-type', { fontCharacter: '\\\\eb97' });\n\tpublic static readonly ungroupByRefType = new Codicon('ungroup-by-ref-type', { fontCharacter: '\\\\eb98' });\n\tpublic static readonly account = new Codicon('account', { fontCharacter: '\\\\eb99' });\n\tpublic static readonly bellDot = new Codicon('bell-dot', { fontCharacter: '\\\\eb9a' });\n\tpublic static readonly debugConsole = new Codicon('debug-console', { fontCharacter: '\\\\eb9b' });\n\tpublic static readonly library = new Codicon('library', { fontCharacter: '\\\\eb9c' });\n\tpublic static readonly output = new Codicon('output', { fontCharacter: '\\\\eb9d' });\n\tpublic static readonly runAll = new Codicon('run-all', { fontCharacter: '\\\\eb9e' });\n\tpublic static readonly syncIgnored = new Codicon('sync-ignored', { fontCharacter: '\\\\eb9f' });\n\tpublic static readonly pinned = new Codicon('pinned', { fontCharacter: '\\\\eba0' });\n\tpublic static readonly githubInverted = new Codicon('github-inverted', { fontCharacter: '\\\\eba1' });\n\tpublic static readonly debugAlt = new Codicon('debug-alt', { fontCharacter: '\\\\eb91' });\n\tpublic static readonly serverProcess = new Codicon('server-process', { fontCharacter: '\\\\eba2' });\n\tpublic static readonly serverEnvironment = new Codicon('server-environment', { fontCharacter: '\\\\eba3' });\n\tpublic static readonly pass = new Codicon('pass', { fontCharacter: '\\\\eba4' });\n\tpublic static readonly stopCircle = new Codicon('stop-circle', { fontCharacter: '\\\\eba5' });\n\tpublic static readonly playCircle = new Codicon('play-circle', { fontCharacter: '\\\\eba6' });\n\tpublic static readonly record = new Codicon('record', { fontCharacter: '\\\\eba7' });\n\tpublic static readonly debugAltSmall = new Codicon('debug-alt-small', { fontCharacter: '\\\\eba8' });\n\tpublic static readonly vmConnect = new Codicon('vm-connect', { fontCharacter: '\\\\eba9' });\n\tpublic static readonly cloud = new Codicon('cloud', { fontCharacter: '\\\\ebaa' });\n\tpublic static readonly merge = new Codicon('merge', { fontCharacter: '\\\\ebab' });\n\tpublic static readonly exportIcon = new Codicon('export', { fontCharacter: '\\\\ebac' });\n\tpublic static readonly graphLeft = new Codicon('graph-left', { fontCharacter: '\\\\ebad' });\n\tpublic static readonly magnet = new Codicon('magnet', { fontCharacter: '\\\\ebae' });\n\tpublic static readonly notebook = new Codicon('notebook', { fontCharacter: '\\\\ebaf' });\n\tpublic static readonly redo = new Codicon('redo', { fontCharacter: '\\\\ebb0' });\n\tpublic static readonly checkAll = new Codicon('check-all', { fontCharacter: '\\\\ebb1' });\n\tpublic static readonly pinnedDirty = new Codicon('pinned-dirty', { fontCharacter: '\\\\ebb2' });\n\tpublic static readonly passFilled = new Codicon('pass-filled', { fontCharacter: '\\\\ebb3' });\n\tpublic static readonly circleLargeFilled = new Codicon('circle-large-filled', { fontCharacter: '\\\\ebb4' });\n\tpublic static readonly circleLargeOutline = new Codicon('circle-large-outline', { fontCharacter: '\\\\ebb5' });\n\tpublic static readonly combine = new Codicon('combine', { fontCharacter: '\\\\ebb6' });\n\tpublic static readonly gather = new Codicon('gather', { fontCharacter: '\\\\ebb6' });\n\tpublic static readonly table = new Codicon('table', { fontCharacter: '\\\\ebb7' });\n\tpublic static readonly variableGroup = new Codicon('variable-group', { fontCharacter: '\\\\ebb8' });\n\tpublic static readonly typeHierarchy = new Codicon('type-hierarchy', { fontCharacter: '\\\\ebb9' });\n\tpublic static readonly typeHierarchySub = new Codicon('type-hierarchy-sub', { fontCharacter: '\\\\ebba' });\n\tpublic static readonly typeHierarchySuper = new Codicon('type-hierarchy-super', { fontCharacter: '\\\\ebbb' });\n\tpublic static readonly gitPullRequestCreate = new Codicon('git-pull-request-create', { fontCharacter: '\\\\ebbc' });\n\tpublic static readonly runAbove = new Codicon('run-above', { fontCharacter: '\\\\ebbd' });\n\tpublic static readonly runBelow = new Codicon('run-below', { fontCharacter: '\\\\ebbe' });\n\tpublic static readonly notebookTemplate = new Codicon('notebook-template', { fontCharacter: '\\\\ebbf' });\n\tpublic static readonly debugRerun = new Codicon('debug-rerun', { fontCharacter: '\\\\ebc0' });\n\tpublic static readonly workspaceTrusted = new Codicon('workspace-trusted', { fontCharacter: '\\\\ebc1' });\n\tpublic static readonly workspaceUntrusted = new Codicon('workspace-untrusted', { fontCharacter: '\\\\ebc2' });\n\tpublic static readonly workspaceUnspecified = new Codicon('workspace-unspecified', { fontCharacter: '\\\\ebc3' });\n\tpublic static readonly terminalCmd = new Codicon('terminal-cmd', { fontCharacter: '\\\\ebc4' });\n\tpublic static readonly terminalDebian = new Codicon('terminal-debian', { fontCharacter: '\\\\ebc5' });\n\tpublic static readonly terminalLinux = new Codicon('terminal-linux', { fontCharacter: '\\\\ebc6' });\n\tpublic static readonly terminalPowershell = new Codicon('terminal-powershell', { fontCharacter: '\\\\ebc7' });\n\tpublic static readonly terminalTmux = new Codicon('terminal-tmux', { fontCharacter: '\\\\ebc8' });\n\tpublic static readonly terminalUbuntu = new Codicon('terminal-ubuntu', { fontCharacter: '\\\\ebc9' });\n\tpublic static readonly terminalBash = new Codicon('terminal-bash', { fontCharacter: '\\\\ebca' });\n\tpublic static readonly arrowSwap = new Codicon('arrow-swap', { fontCharacter: '\\\\ebcb' });\n\tpublic static readonly copy = new Codicon('copy', { fontCharacter: '\\\\ebcc' });\n\tpublic static readonly personAdd = new Codicon('person-add', { fontCharacter: '\\\\ebcd' });\n\tpublic static readonly filterFilled = new Codicon('filter-filled', { fontCharacter: '\\\\ebce' });\n\tpublic static readonly wand = new Codicon('wand', { fontCharacter: '\\\\ebcf' });\n\tpublic static readonly debugLineByLine = new Codicon('debug-line-by-line', { fontCharacter: '\\\\ebd0' });\n\tpublic static readonly inspect = new Codicon('inspect', { fontCharacter: '\\\\ebd1' });\n\tpublic static readonly layers = new Codicon('layers', { fontCharacter: '\\\\ebd2' });\n\tpublic static readonly layersDot = new Codicon('layers-dot', { fontCharacter: '\\\\ebd3' });\n\tpublic static readonly layersActive = new Codicon('layers-active', { fontCharacter: '\\\\ebd4' });\n\tpublic static readonly compass = new Codicon('compass', { fontCharacter: '\\\\ebd5' });\n\tpublic static readonly compassDot = new Codicon('compass-dot', { fontCharacter: '\\\\ebd6' });\n\tpublic static readonly compassActive = new Codicon('compass-active', { fontCharacter: '\\\\ebd7' });\n\tpublic static readonly azure = new Codicon('azure', { fontCharacter: '\\\\ebd8' });\n\tpublic static readonly issueDraft = new Codicon('issue-draft', { fontCharacter: '\\\\ebd9' });\n\tpublic static readonly gitPullRequestClosed = new Codicon('git-pull-request-closed', { fontCharacter: '\\\\ebda' });\n\tpublic static readonly gitPullRequestDraft = new Codicon('git-pull-request-draft', { fontCharacter: '\\\\ebdb' });\n\tpublic static readonly debugAll = new Codicon('debug-all', { fontCharacter: '\\\\ebdc' });\n\tpublic static readonly debugCoverage = new Codicon('debug-coverage', { fontCharacter: '\\\\ebdd' });\n\tpublic static readonly runErrors = new Codicon('run-errors', { fontCharacter: '\\\\ebde' });\n\tpublic static readonly folderLibrary = new Codicon('folder-library', { fontCharacter: '\\\\ebdf' });\n\tpublic static readonly debugContinueSmall = new Codicon('debug-continue-small', { fontCharacter: '\\\\ebe0' });\n\tpublic static readonly beakerStop = new Codicon('beaker-stop', { fontCharacter: '\\\\ebe1' });\n\tpublic static readonly graphLine = new Codicon('graph-line', { fontCharacter: '\\\\ebe2' });\n\tpublic static readonly graphScatter = new Codicon('graph-scatter', { fontCharacter: '\\\\ebe3' });\n\tpublic static readonly pieChart = new Codicon('pie-chart', { fontCharacter: '\\\\ebe4' });\n\tpublic static readonly bracket = new Codicon('bracket', Codicon.json.definition);\n\tpublic static readonly bracketDot = new Codicon('bracket-dot', { fontCharacter: '\\\\ebe5' });\n\tpublic static readonly bracketError = new Codicon('bracket-error', { fontCharacter: '\\\\ebe6' });\n\tpublic static readonly lockSmall = new Codicon('lock-small', { fontCharacter: '\\\\ebe7' });\n\tpublic static readonly azureDevops = new Codicon('azure-devops', { fontCharacter: '\\\\ebe8' });\n\tpublic static readonly verifiedFilled = new Codicon('verified-filled', { fontCharacter: '\\\\ebe9' });\n\tpublic static readonly newLine = new Codicon('newline', { fontCharacter: '\\\\ebea' });\n\tpublic static readonly layout = new Codicon('layout', { fontCharacter: '\\\\ebeb' });\n\tpublic static readonly layoutActivitybarLeft = new Codicon('layout-activitybar-left', { fontCharacter: '\\\\ebec' });\n\tpublic static readonly layoutActivitybarRight = new Codicon('layout-activitybar-right', { fontCharacter: '\\\\ebed' });\n\tpublic static readonly layoutPanelLeft = new Codicon('layout-panel-left', { fontCharacter: '\\\\ebee' });\n\tpublic static readonly layoutPanelCenter = new Codicon('layout-panel-center', { fontCharacter: '\\\\ebef' });\n\tpublic static readonly layoutPanelJustify = new Codicon('layout-panel-justify', { fontCharacter: '\\\\ebf0' });\n\tpublic static readonly layoutPanelRight = new Codicon('layout-panel-right', { fontCharacter: '\\\\ebf1' });\n\tpublic static readonly layoutPanel = new Codicon('layout-panel', { fontCharacter: '\\\\ebf2' });\n\tpublic static readonly layoutSidebarLeft = new Codicon('layout-sidebar-left', { fontCharacter: '\\\\ebf3' });\n\tpublic static readonly layoutSidebarRight = new Codicon('layout-sidebar-right', { fontCharacter: '\\\\ebf4' });\n\tpublic static readonly layoutStatusbar = new Codicon('layout-statusbar', { fontCharacter: '\\\\ebf5' });\n\tpublic static readonly layoutMenubar = new Codicon('layout-menubar', { fontCharacter: '\\\\ebf6' });\n\tpublic static readonly layoutCentered = new Codicon('layout-centered', { fontCharacter: '\\\\ebf7' });\n\tpublic static readonly target = new Codicon('target', { fontCharacter: '\\\\ebf8' });\n\tpublic static readonly indent = new Codicon('indent', { fontCharacter: '\\\\ebf9' });\n\tpublic static readonly recordSmall = new Codicon('record-small', { fontCharacter: '\\\\ebfa' });\n\tpublic static readonly errorSmall = new Codicon('error-small', { fontCharacter: '\\\\ebfb' });\n\tpublic static readonly arrowCircleDown = new Codicon('arrow-circle-down', { fontCharacter: '\\\\ebfc' });\n\tpublic static readonly arrowCircleLeft = new Codicon('arrow-circle-left', { fontCharacter: '\\\\ebfd' });\n\tpublic static readonly arrowCircleRight = new Codicon('arrow-circle-right', { fontCharacter: '\\\\ebfe' });\n\tpublic static readonly arrowCircleUp = new Codicon('arrow-circle-up', { fontCharacter: '\\\\ebff' });\n\n\n\t// derived icons, that could become separate icons\n\n\tpublic static readonly dialogError = new Codicon('dialog-error', Codicon.error.definition);\n\tpublic static readonly dialogWarning = new Codicon('dialog-warning', Codicon.warning.definition);\n\tpublic static readonly dialogInfo = new Codicon('dialog-info', Codicon.info.definition);\n\tpublic static readonly dialogClose = new Codicon('dialog-close', Codicon.close.definition);\n\n\tpublic static readonly treeItemExpanded = new Codicon('tree-item-expanded', Codicon.chevronDown.definition); // collapsed is done with rotation\n\n\tpublic static readonly treeFilterOnTypeOn = new Codicon('tree-filter-on-type-on', Codicon.listFilter.definition);\n\tpublic static readonly treeFilterOnTypeOff = new Codicon('tree-filter-on-type-off', Codicon.listSelection.definition);\n\tpublic static readonly treeFilterClear = new Codicon('tree-filter-clear', Codicon.close.definition);\n\n\tpublic static readonly treeItemLoading = new Codicon('tree-item-loading', Codicon.loading.definition);\n\n\tpublic static readonly menuSelection = new Codicon('menu-selection', Codicon.check.definition);\n\tpublic static readonly menuSubmenu = new Codicon('menu-submenu', Codicon.chevronRight.definition);\n\n\tpublic static readonly menuBarMore = new Codicon('menubar-more', Codicon.more.definition);\n\n\tpublic static readonly scrollbarButtonLeft = new Codicon('scrollbar-button-left', Codicon.triangleLeft.definition);\n\tpublic static readonly scrollbarButtonRight = new Codicon('scrollbar-button-right', Codicon.triangleRight.definition);\n\n\tpublic static readonly scrollbarButtonUp = new Codicon('scrollbar-button-up', Codicon.triangleUp.definition);\n\tpublic static readonly scrollbarButtonDown = new Codicon('scrollbar-button-down', Codicon.triangleDown.definition);\n\n\tpublic static readonly toolBarMore = new Codicon('toolbar-more', Codicon.more.definition);\n\n\tpublic static readonly quickInputBack = new Codicon('quick-input-back', Codicon.arrowLeft.definition);\n}\n\nexport interface CSSIcon {\n\treadonly id: string;\n}\n\n\nexport namespace CSSIcon {\n\texport const iconNameSegment = '[A-Za-z0-9]+';\n\texport const iconNameExpression = '[A-Za-z0-9-]+';\n\texport const iconModifierExpression = '~[A-Za-z]+';\n\texport const iconNameCharacter = '[A-Za-z0-9~-]';\n\n\tconst cssIconIdRegex = new RegExp(`^(${iconNameExpression})(${iconModifierExpression})?$`);\n\n\texport function asClassNameArray(icon: CSSIcon): string[] {\n\t\tif (icon instanceof Codicon) {\n\t\t\treturn ['codicon', 'codicon-' + icon.id];\n\t\t}\n\t\tconst match = cssIconIdRegex.exec(icon.id);\n\t\tif (!match) {\n\t\t\treturn asClassNameArray(Codicon.error);\n\t\t}\n\t\tlet [, id, modifier] = match;\n\t\tconst classNames = ['codicon', 'codicon-' + id];\n\t\tif (modifier) {\n\t\t\tclassNames.push('codicon-modifier-' + modifier.substr(1));\n\t\t}\n\t\treturn classNames;\n\t}\n\n\texport function asClassName(icon: CSSIcon): string {\n\t\treturn asClassNameArray(icon).join(' ');\n\t}\n\n\texport function asCSSSelector(icon: CSSIcon): string {\n\t\treturn '.' + asClassNameArray(icon).join('.');\n\t}\n}\n\n\ninterface IconDefinition {\n\tfontCharacter: string;\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\n/**\n * An interface for a JavaScript object that\n * acts a dictionary. The keys are strings.\n */\nexport type IStringDictionary<V> = Record<string, V>;\n\n\n/**\n * An interface for a JavaScript object that\n * acts a dictionary. The keys are numbers.\n */\nexport type INumberDictionary<V> = Record<number, V>;\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Iterates over each entry in the provided dictionary. The iterator allows\n * to remove elements and will stop when the callback returns {{false}}.\n */\nexport function forEach<T>(from: IStringDictionary<T> | INumberDictionary<T>, callback: (entry: { key: any; value: T }, remove: () => void) => any): void {\n\tfor (let key in from) {\n\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\tconst result = callback({ key: key, value: (from as any)[key] }, function () {\n\t\t\t\tdelete (from as any)[key];\n\t\t\t});\n\t\t\tif (result === false) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\nexport class SetMap<K, V> {\n\n\tprivate map = new Map<K, Set<V>>();\n\n\tadd(key: K, value: V): void {\n\t\tlet values = this.map.get(key);\n\n\t\tif (!values) {\n\t\t\tvalues = new Set<V>();\n\t\t\tthis.map.set(key, values);\n\t\t}\n\n\t\tvalues.add(value);\n\t}\n\n\tdelete(key: K, value: V): void {\n\t\tconst values = this.map.get(key);\n\n\t\tif (!values) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalues.delete(value);\n\n\t\tif (values.size === 0) {\n\t\t\tthis.map.delete(key);\n\t\t}\n\t}\n\n\tforEach(key: K, fn: (value: V) => void): void {\n\t\tconst values = this.map.get(key);\n\n\t\tif (!values) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalues.forEach(fn);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\n\nfunction roundFloat(number: number, decimalPoints: number): number {\n\tconst decimal = Math.pow(10, decimalPoints);\n\treturn Math.round(number * decimal) / decimal;\n}\n\nexport class RGBA {\n\t_rgbaBrand: void = undefined;\n\n\t/**\n\t * Red: integer in [0-255]\n\t */\n\treadonly r: number;\n\n\t/**\n\t * Green: integer in [0-255]\n\t */\n\treadonly g: number;\n\n\t/**\n\t * Blue: integer in [0-255]\n\t */\n\treadonly b: number;\n\n\t/**\n\t * Alpha: float in [0-1]\n\t */\n\treadonly a: number;\n\n\tconstructor(r: number, g: number, b: number, a: number = 1) {\n\t\tthis.r = Math.min(255, Math.max(0, r)) | 0;\n\t\tthis.g = Math.min(255, Math.max(0, g)) | 0;\n\t\tthis.b = Math.min(255, Math.max(0, b)) | 0;\n\t\tthis.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n\t}\n\n\tstatic equals(a: RGBA, b: RGBA): boolean {\n\t\treturn a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;\n\t}\n}\n\nexport class HSLA {\n\n\t_hslaBrand: void = undefined;\n\n\t/**\n\t * Hue: integer in [0, 360]\n\t */\n\treadonly h: number;\n\n\t/**\n\t * Saturation: float in [0, 1]\n\t */\n\treadonly s: number;\n\n\t/**\n\t * Luminosity: float in [0, 1]\n\t */\n\treadonly l: number;\n\n\t/**\n\t * Alpha: float in [0, 1]\n\t */\n\treadonly a: number;\n\n\tconstructor(h: number, s: number, l: number, a: number) {\n\t\tthis.h = Math.max(Math.min(360, h), 0) | 0;\n\t\tthis.s = roundFloat(Math.max(Math.min(1, s), 0), 3);\n\t\tthis.l = roundFloat(Math.max(Math.min(1, l), 0), 3);\n\t\tthis.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n\t}\n\n\tstatic equals(a: HSLA, b: HSLA): boolean {\n\t\treturn a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;\n\t}\n\n\t/**\n\t * Converts an RGB color value to HSL. Conversion formula\n\t * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n\t * Assumes r, g, and b are contained in the set [0, 255] and\n\t * returns h in the set [0, 360], s, and l in the set [0, 1].\n\t */\n\tstatic fromRGBA(rgba: RGBA): HSLA {\n\t\tconst r = rgba.r / 255;\n\t\tconst g = rgba.g / 255;\n\t\tconst b = rgba.b / 255;\n\t\tconst a = rgba.a;\n\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet h = 0;\n\t\tlet s = 0;\n\t\tconst l = (min + max) / 2;\n\t\tconst chroma = max - min;\n\n\t\tif (chroma > 0) {\n\t\t\ts = Math.min((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - (2 * l))), 1);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r: h = (g - b) / chroma + (g < b ? 6 : 0); break;\n\t\t\t\tcase g: h = (b - r) / chroma + 2; break;\n\t\t\t\tcase b: h = (r - g) / chroma + 4; break;\n\t\t\t}\n\n\t\t\th *= 60;\n\t\t\th = Math.round(h);\n\t\t}\n\t\treturn new HSLA(h, s, l, a);\n\t}\n\n\tprivate static _hue2rgb(p: number, q: number, t: number): number {\n\t\tif (t < 0) {\n\t\t\tt += 1;\n\t\t}\n\t\tif (t > 1) {\n\t\t\tt -= 1;\n\t\t}\n\t\tif (t < 1 / 6) {\n\t\t\treturn p + (q - p) * 6 * t;\n\t\t}\n\t\tif (t < 1 / 2) {\n\t\t\treturn q;\n\t\t}\n\t\tif (t < 2 / 3) {\n\t\t\treturn p + (q - p) * (2 / 3 - t) * 6;\n\t\t}\n\t\treturn p;\n\t}\n\n\t/**\n\t * Converts an HSL color value to RGB. Conversion formula\n\t * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n\t * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and\n\t * returns r, g, and b in the set [0, 255].\n\t */\n\tstatic toRGBA(hsla: HSLA): RGBA {\n\t\tconst h = hsla.h / 360;\n\t\tconst { s, l, a } = hsla;\n\t\tlet r: number, g: number, b: number;\n\n\t\tif (s === 0) {\n\t\t\tr = g = b = l; // achromatic\n\t\t} else {\n\t\t\tconst q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst p = 2 * l - q;\n\t\t\tr = HSLA._hue2rgb(p, q, h + 1 / 3);\n\t\t\tg = HSLA._hue2rgb(p, q, h);\n\t\t\tb = HSLA._hue2rgb(p, q, h - 1 / 3);\n\t\t}\n\n\t\treturn new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a);\n\t}\n}\n\nexport class HSVA {\n\n\t_hsvaBrand: void = undefined;\n\n\t/**\n\t * Hue: integer in [0, 360]\n\t */\n\treadonly h: number;\n\n\t/**\n\t * Saturation: float in [0, 1]\n\t */\n\treadonly s: number;\n\n\t/**\n\t * Value: float in [0, 1]\n\t */\n\treadonly v: number;\n\n\t/**\n\t * Alpha: float in [0, 1]\n\t */\n\treadonly a: number;\n\n\tconstructor(h: number, s: number, v: number, a: number) {\n\t\tthis.h = Math.max(Math.min(360, h), 0) | 0;\n\t\tthis.s = roundFloat(Math.max(Math.min(1, s), 0), 3);\n\t\tthis.v = roundFloat(Math.max(Math.min(1, v), 0), 3);\n\t\tthis.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n\t}\n\n\tstatic equals(a: HSVA, b: HSVA): boolean {\n\t\treturn a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a;\n\t}\n\n\t// from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm\n\tstatic fromRGBA(rgba: RGBA): HSVA {\n\t\tconst r = rgba.r / 255;\n\t\tconst g = rgba.g / 255;\n\t\tconst b = rgba.b / 255;\n\t\tconst cmax = Math.max(r, g, b);\n\t\tconst cmin = Math.min(r, g, b);\n\t\tconst delta = cmax - cmin;\n\t\tconst s = cmax === 0 ? 0 : (delta / cmax);\n\t\tlet m: number;\n\n\t\tif (delta === 0) {\n\t\t\tm = 0;\n\t\t} else if (cmax === r) {\n\t\t\tm = ((((g - b) / delta) % 6) + 6) % 6;\n\t\t} else if (cmax === g) {\n\t\t\tm = ((b - r) / delta) + 2;\n\t\t} else {\n\t\t\tm = ((r - g) / delta) + 4;\n\t\t}\n\n\t\treturn new HSVA(Math.round(m * 60), s, cmax, rgba.a);\n\t}\n\n\t// from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm\n\tstatic toRGBA(hsva: HSVA): RGBA {\n\t\tconst { h, s, v, a } = hsva;\n\t\tconst c = v * s;\n\t\tconst x = c * (1 - Math.abs((h / 60) % 2 - 1));\n\t\tconst m = v - c;\n\t\tlet [r, g, b] = [0, 0, 0];\n\n\t\tif (h < 60) {\n\t\t\tr = c;\n\t\t\tg = x;\n\t\t} else if (h < 120) {\n\t\t\tr = x;\n\t\t\tg = c;\n\t\t} else if (h < 180) {\n\t\t\tg = c;\n\t\t\tb = x;\n\t\t} else if (h < 240) {\n\t\t\tg = x;\n\t\t\tb = c;\n\t\t} else if (h < 300) {\n\t\t\tr = x;\n\t\t\tb = c;\n\t\t} else if (h <= 360) {\n\t\t\tr = c;\n\t\t\tb = x;\n\t\t}\n\n\t\tr = Math.round((r + m) * 255);\n\t\tg = Math.round((g + m) * 255);\n\t\tb = Math.round((b + m) * 255);\n\n\t\treturn new RGBA(r, g, b, a);\n\t}\n}\n\nexport class Color {\n\n\tstatic fromHex(hex: string): Color {\n\t\treturn Color.Format.CSS.parseHex(hex) || Color.red;\n\t}\n\n\treadonly rgba: RGBA;\n\tprivate _hsla?: HSLA;\n\tget hsla(): HSLA {\n\t\tif (this._hsla) {\n\t\t\treturn this._hsla;\n\t\t} else {\n\t\t\treturn HSLA.fromRGBA(this.rgba);\n\t\t}\n\t}\n\n\tprivate _hsva?: HSVA;\n\tget hsva(): HSVA {\n\t\tif (this._hsva) {\n\t\t\treturn this._hsva;\n\t\t}\n\t\treturn HSVA.fromRGBA(this.rgba);\n\t}\n\n\tconstructor(arg: RGBA | HSLA | HSVA) {\n\t\tif (!arg) {\n\t\t\tthrow new Error('Color needs a value');\n\t\t} else if (arg instanceof RGBA) {\n\t\t\tthis.rgba = arg;\n\t\t} else if (arg instanceof HSLA) {\n\t\t\tthis._hsla = arg;\n\t\t\tthis.rgba = HSLA.toRGBA(arg);\n\t\t} else if (arg instanceof HSVA) {\n\t\t\tthis._hsva = arg;\n\t\t\tthis.rgba = HSVA.toRGBA(arg);\n\t\t} else {\n\t\t\tthrow new Error('Invalid color ctor argument');\n\t\t}\n\t}\n\n\tequals(other: Color | null): boolean {\n\t\treturn !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva);\n\t}\n\n\t/**\n\t * http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.\n\t */\n\tgetRelativeLuminance(): number {\n\t\tconst R = Color._relativeLuminanceForComponent(this.rgba.r);\n\t\tconst G = Color._relativeLuminanceForComponent(this.rgba.g);\n\t\tconst B = Color._relativeLuminanceForComponent(this.rgba.b);\n\t\tconst luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n\n\t\treturn roundFloat(luminance, 4);\n\t}\n\n\tprivate static _relativeLuminanceForComponent(color: number): number {\n\t\tconst c = color / 255;\n\t\treturn (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4);\n\t}\n\n\t/**\n\t *\thttp://24ways.org/2010/calculating-color-contrast\n\t * Return 'true' if lighter color otherwise 'false'\n\t */\n\tisLighter(): boolean {\n\t\tconst yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000;\n\t\treturn yiq >= 128;\n\t}\n\n\tisLighterThan(another: Color): boolean {\n\t\tconst lum1 = this.getRelativeLuminance();\n\t\tconst lum2 = another.getRelativeLuminance();\n\t\treturn lum1 > lum2;\n\t}\n\n\tisDarkerThan(another: Color): boolean {\n\t\tconst lum1 = this.getRelativeLuminance();\n\t\tconst lum2 = another.getRelativeLuminance();\n\t\treturn lum1 < lum2;\n\t}\n\n\tlighten(factor: number): Color {\n\t\treturn new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a));\n\t}\n\n\tdarken(factor: number): Color {\n\t\treturn new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a));\n\t}\n\n\ttransparent(factor: number): Color {\n\t\tconst { r, g, b, a } = this.rgba;\n\t\treturn new Color(new RGBA(r, g, b, a * factor));\n\t}\n\n\tisTransparent(): boolean {\n\t\treturn this.rgba.a === 0;\n\t}\n\n\tisOpaque(): boolean {\n\t\treturn this.rgba.a === 1;\n\t}\n\n\topposite(): Color {\n\t\treturn new Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));\n\t}\n\n\tprivate _toString?: string;\n\ttoString(): string {\n\t\tif (!this._toString) {\n\t\t\tthis._toString = Color.Format.CSS.format(this);\n\t\t}\n\t\treturn this._toString;\n\t}\n\n\tstatic getLighterColor(of: Color, relative: Color, factor?: number): Color {\n\t\tif (of.isLighterThan(relative)) {\n\t\t\treturn of;\n\t\t}\n\t\tfactor = factor ? factor : 0.5;\n\t\tconst lum1 = of.getRelativeLuminance();\n\t\tconst lum2 = relative.getRelativeLuminance();\n\t\tfactor = factor * (lum2 - lum1) / lum2;\n\t\treturn of.lighten(factor);\n\t}\n\n\tstatic getDarkerColor(of: Color, relative: Color, factor?: number): Color {\n\t\tif (of.isDarkerThan(relative)) {\n\t\t\treturn of;\n\t\t}\n\t\tfactor = factor ? factor : 0.5;\n\t\tconst lum1 = of.getRelativeLuminance();\n\t\tconst lum2 = relative.getRelativeLuminance();\n\t\tfactor = factor * (lum1 - lum2) / lum1;\n\t\treturn of.darken(factor);\n\t}\n\n\tstatic readonly white = new Color(new RGBA(255, 255, 255, 1));\n\tstatic readonly black = new Color(new RGBA(0, 0, 0, 1));\n\tstatic readonly red = new Color(new RGBA(255, 0, 0, 1));\n\tstatic readonly blue = new Color(new RGBA(0, 0, 255, 1));\n\tstatic readonly green = new Color(new RGBA(0, 255, 0, 1));\n\tstatic readonly cyan = new Color(new RGBA(0, 255, 255, 1));\n\tstatic readonly lightgrey = new Color(new RGBA(211, 211, 211, 1));\n\tstatic readonly transparent = new Color(new RGBA(0, 0, 0, 0));\n}\n\nexport namespace Color {\n\texport namespace Format {\n\t\texport namespace CSS {\n\n\t\t\texport function formatRGB(color: Color): string {\n\t\t\t\tif (color.rgba.a === 1) {\n\t\t\t\t\treturn `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`;\n\t\t\t\t}\n\n\t\t\t\treturn Color.Format.CSS.formatRGBA(color);\n\t\t\t}\n\n\t\t\texport function formatRGBA(color: Color): string {\n\t\t\t\treturn `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+(color.rgba.a).toFixed(2)})`;\n\t\t\t}\n\n\t\t\texport function formatHSL(color: Color): string {\n\t\t\t\tif (color.hsla.a === 1) {\n\t\t\t\t\treturn `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`;\n\t\t\t\t}\n\n\t\t\t\treturn Color.Format.CSS.formatHSLA(color);\n\t\t\t}\n\n\t\t\texport function formatHSLA(color: Color): string {\n\t\t\t\treturn `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`;\n\t\t\t}\n\n\t\t\tfunction _toTwoDigitHex(n: number): string {\n\t\t\t\tconst r = n.toString(16);\n\t\t\t\treturn r.length !== 2 ? '0' + r : r;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Formats the color as #RRGGBB\n\t\t\t */\n\t\t\texport function formatHex(color: Color): string {\n\t\t\t\treturn `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Formats the color as #RRGGBBAA\n\t\t\t * If 'compact' is set, colors without transparancy will be printed as #RRGGBB\n\t\t\t */\n\t\t\texport function formatHexA(color: Color, compact = false): string {\n\t\t\t\tif (compact && color.rgba.a === 1) {\n\t\t\t\t\treturn Color.Format.CSS.formatHex(color);\n\t\t\t\t}\n\n\t\t\t\treturn `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * The default format will use HEX if opaque and RGBA otherwise.\n\t\t\t */\n\t\t\texport function format(color: Color): string {\n\t\t\t\tif (color.isOpaque()) {\n\t\t\t\t\treturn Color.Format.CSS.formatHex(color);\n\t\t\t\t}\n\n\t\t\t\treturn Color.Format.CSS.formatRGBA(color);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Converts an Hex color value to a Color.\n\t\t\t * returns r, g, and b are contained in the set [0, 255]\n\t\t\t * @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA).\n\t\t\t */\n\t\t\texport function parseHex(hex: string): Color | null {\n\t\t\t\tconst length = hex.length;\n\n\t\t\t\tif (length === 0) {\n\t\t\t\t\t// Invalid color\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (hex.charCodeAt(0) !== CharCode.Hash) {\n\t\t\t\t\t// Does not begin with a #\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (length === 7) {\n\t\t\t\t\t// #RRGGBB format\n\t\t\t\t\tconst r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n\t\t\t\t\tconst g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n\t\t\t\t\tconst b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n\t\t\t\t\treturn new Color(new RGBA(r, g, b, 1));\n\t\t\t\t}\n\n\t\t\t\tif (length === 9) {\n\t\t\t\t\t// #RRGGBBAA format\n\t\t\t\t\tconst r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n\t\t\t\t\tconst g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n\t\t\t\t\tconst b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n\t\t\t\t\tconst a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));\n\t\t\t\t\treturn new Color(new RGBA(r, g, b, a / 255));\n\t\t\t\t}\n\n\t\t\t\tif (length === 4) {\n\t\t\t\t\t// #RGB format\n\t\t\t\t\tconst r = _parseHexDigit(hex.charCodeAt(1));\n\t\t\t\t\tconst g = _parseHexDigit(hex.charCodeAt(2));\n\t\t\t\t\tconst b = _parseHexDigit(hex.charCodeAt(3));\n\t\t\t\t\treturn new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b));\n\t\t\t\t}\n\n\t\t\t\tif (length === 5) {\n\t\t\t\t\t// #RGBA format\n\t\t\t\t\tconst r = _parseHexDigit(hex.charCodeAt(1));\n\t\t\t\t\tconst g = _parseHexDigit(hex.charCodeAt(2));\n\t\t\t\t\tconst b = _parseHexDigit(hex.charCodeAt(3));\n\t\t\t\t\tconst a = _parseHexDigit(hex.charCodeAt(4));\n\t\t\t\t\treturn new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255));\n\t\t\t\t}\n\n\t\t\t\t// Invalid color\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tfunction _parseHexDigit(charCode: CharCode): number {\n\t\t\t\tswitch (charCode) {\n\t\t\t\t\tcase CharCode.Digit0: return 0;\n\t\t\t\t\tcase CharCode.Digit1: return 1;\n\t\t\t\t\tcase CharCode.Digit2: return 2;\n\t\t\t\t\tcase CharCode.Digit3: return 3;\n\t\t\t\t\tcase CharCode.Digit4: return 4;\n\t\t\t\t\tcase CharCode.Digit5: return 5;\n\t\t\t\t\tcase CharCode.Digit6: return 6;\n\t\t\t\t\tcase CharCode.Digit7: return 7;\n\t\t\t\t\tcase CharCode.Digit8: return 8;\n\t\t\t\t\tcase CharCode.Digit9: return 9;\n\t\t\t\t\tcase CharCode.a: return 10;\n\t\t\t\t\tcase CharCode.A: return 10;\n\t\t\t\t\tcase CharCode.b: return 11;\n\t\t\t\t\tcase CharCode.B: return 11;\n\t\t\t\t\tcase CharCode.c: return 12;\n\t\t\t\t\tcase CharCode.C: return 12;\n\t\t\t\t\tcase CharCode.d: return 13;\n\t\t\t\t\tcase CharCode.D: return 13;\n\t\t\t\t\tcase CharCode.e: return 14;\n\t\t\t\t\tcase CharCode.E: return 14;\n\t\t\t\t\tcase CharCode.f: return 15;\n\t\t\t\t\tcase CharCode.F: return 15;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n}\n","\n\nexport function memoize(_target: any, key: string, descriptor: any) {\n\tlet fnKey: string | null = null;\n\tlet fn: Function | null = null;\n\n\tif (typeof descriptor.value === 'function') {\n\t\tfnKey = 'value';\n\t\tfn = descriptor.value;\n\n\t\tif (fn!.length !== 0) {\n\t\t\tconsole.warn('Memoize should only be used in functions with zero parameters');\n\t\t}\n\t} else if (typeof descriptor.get === 'function') {\n\t\tfnKey = 'get';\n\t\tfn = descriptor.get;\n\t}\n\n\tif (!fn) {\n\t\tthrow new Error('not supported');\n\t}\n\n\tconst memoizeKey = `$memoize$${key}`;\n\tdescriptor[fnKey!] = function (...args: any[]) {\n\t\tif (!this.hasOwnProperty(memoizeKey)) {\n\t\t\tObject.defineProperty(this, memoizeKey, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t\tvalue: fn!.apply(this, args)\n\t\t\t});\n\t\t}\n\n\t\treturn this[memoizeKey];\n\t};\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\n/**\n * Represents information about a specific difference between two sequences.\n */\nexport class DiffChange {\n\n\t/**\n\t * The position of the first element in the original sequence which\n\t * this change affects.\n\t */\n\tpublic originalStart: number;\n\n\t/**\n\t * The number of elements from the original sequence which were\n\t * affected.\n\t */\n\tpublic originalLength: number;\n\n\t/**\n\t * The position of the first element in the modified sequence which\n\t * this change affects.\n\t */\n\tpublic modifiedStart: number;\n\n\t/**\n\t * The number of elements from the modified sequence which were\n\t * affected (added).\n\t */\n\tpublic modifiedLength: number;\n\n\t/**\n\t * Constructs a new DiffChange with the given sequence information\n\t * and content.\n\t */\n\tconstructor(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number) {\n\t\t//Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\n\t\tthis.originalStart = originalStart;\n\t\tthis.originalLength = originalLength;\n\t\tthis.modifiedStart = modifiedStart;\n\t\tthis.modifiedLength = modifiedLength;\n\t}\n\n\t/**\n\t * The end point (exclusive) of the change in the original sequence.\n\t */\n\tpublic getOriginalEnd() {\n\t\treturn this.originalStart + this.originalLength;\n\t}\n\n\t/**\n\t * The end point (exclusive) of the change in the modified sequence.\n\t */\n\tpublic getModifiedEnd() {\n\t\treturn this.modifiedStart + this.modifiedLength;\n\t}\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\nexport interface ErrorListenerCallback {\n\t(error: any): void;\n}\n\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nexport class ErrorHandler {\n\tprivate unexpectedErrorHandler: (e: any) => void;\n\tprivate listeners: ErrorListenerCallback[];\n\n\tconstructor() {\n\n\t\tthis.listeners = [];\n\n\t\tthis.unexpectedErrorHandler = function (e: any) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (e.stack) {\n\t\t\t\t\tthrow new Error(e.message + '\\n\\n' + e.stack);\n\t\t\t\t}\n\n\t\t\t\tthrow e;\n\t\t\t}, 0);\n\t\t};\n\t}\n\n\tprivate emit(e: any): void {\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistener(e);\n\t\t});\n\t}\n\n\tonUnexpectedError(e: any): void {\n\t\tthis.unexpectedErrorHandler(e);\n\t\tthis.emit(e);\n\t}\n\n\t// For external errors, we don't want the listeners to be called\n\tonUnexpectedExternalError(e: any): void {\n\t\tthis.unexpectedErrorHandler(e);\n\t}\n}\n\nexport const errorHandler = new ErrorHandler();\n\nexport function onUnexpectedError(e: any): undefined {\n\t// ignore errors from cancelled promises\n\tif (!isCancellationError(e)) {\n\t\terrorHandler.onUnexpectedError(e);\n\t}\n\treturn undefined;\n}\n\nexport function onUnexpectedExternalError(e: any): undefined {\n\t// ignore errors from cancelled promises\n\tif (!isCancellationError(e)) {\n\t\terrorHandler.onUnexpectedExternalError(e);\n\t}\n\treturn undefined;\n}\n\nexport interface SerializedError {\n}\n\nexport function transformErrorForSerialization(error: Error): SerializedError;\nexport function transformErrorForSerialization(error: any): any;\nexport function transformErrorForSerialization(error: any): any {\n\tif (error instanceof Error) {\n\t\tlet { name, message } = error;\n\t\tconst stack: string = (<any>error).stacktrace || (<any>error).stack;\n\t\treturn {\n\t\t\t$isError: true,\n\t\t\tname,\n\t\t\tmessage,\n\t\t\tstack\n\t\t};\n\t}\n\n\t// return as is\n\treturn error;\n}\n\nconst canceledName = 'Canceled';\n\n/**\n * Checks if the given error is a promise in canceled state\n */\nexport function isCancellationError(error: any): boolean {\n\tif (error instanceof CancellationError) {\n\t\treturn true;\n\t}\n\treturn error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n\n// !!!IMPORTANT!!!\n// Do NOT change this class because it is also used as an API-type.\nexport class CancellationError extends Error {\n\tconstructor() {\n\t\tsuper(canceledName);\n\t\tthis.name = this.message;\n\t}\n}\n\n/**\n * @deprecated use {@link CancellationError `new CancellationError()`} instead\n */\nexport function canceled(): Error {\n\tconst error = new Error(canceledName);\n\terror.name = error.message;\n\treturn error;\n}\n\nexport function illegalArgument(name?: string): Error {\n\tif (name) {\n\t\treturn new Error(`Illegal argument: ${name}`);\n\t} else {\n\t\treturn new Error('Illegal argument');\n\t}\n}\n\nexport function illegalState(name?: string): Error {\n\tif (name) {\n\t\treturn new Error(`Illegal state: ${name}`);\n\t} else {\n\t\treturn new Error('Illegal state');\n\t}\n}\n\nexport class NotSupportedError extends Error {\n\tconstructor(message?: string) {\n\t\tsuper('NotSupported');\n\t\tif (message) {\n\t\t\tthis.message = message;\n\t\t}\n\t}\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\nexport function once<T extends Function>(this: unknown, fn: T): T {\n\tconst _this = this;\n\tlet didCall = false;\n\tlet result: unknown;\n\n\treturn function () {\n\t\tif (didCall) {\n\t\t\treturn result;\n\t\t}\n\n\t\tdidCall = true;\n\t\tresult = fn.apply(_this, arguments);\n\n\t\treturn result;\n\t} as unknown as T;\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\nexport class IdGenerator {\n\n\tprivate _prefix: string;\n\tprivate _lastId: number;\n\n\tconstructor(prefix: string) {\n\t\tthis._prefix = prefix;\n\t\tthis._lastId = 0;\n\t}\n\n\tpublic nextId(): string {\n\t\treturn this._prefix + (++this._lastId);\n\t}\n}\n\nexport const defaultGenerator = new IdGenerator('id#');","/*---------------------------------------------------------------------------------------------\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\nexport namespace Iterable {\n\n\texport function is<T = any>(thing: any): thing is IterableIterator<T> {\n\t\treturn thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function';\n\t}\n\n\tconst _empty: Iterable<any> = Object.freeze([]);\n\texport function empty<T = any>(): Iterable<T> {\n\t\treturn _empty;\n\t}\n\n\texport function* single<T>(element: T): Iterable<T> {\n\t\tyield element;\n\t}\n\n\texport function from<T>(iterable: Iterable<T> | undefined | null): Iterable<T> {\n\t\treturn iterable || _empty;\n\t}\n\n\texport function isEmpty<T>(iterable: Iterable<T> | undefined | null): boolean {\n\t\treturn !iterable || iterable[Symbol.iterator]().next().done === true;\n\t}\n\n\texport function first<T>(iterable: Iterable<T>): T | undefined {\n\t\treturn iterable[Symbol.iterator]().next().value;\n\t}\n\n\texport function some<T>(iterable: Iterable<T>, predicate: (t: T) => unknown): boolean {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\texport function find<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\texport function filter<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): Iterable<R>;\n\texport function filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T>;\n\texport function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* map<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => R): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield fn(element, index++);\n\t\t}\n\t}\n\n\texport function* concat<T>(...iterables: Iterable<T>[]): Iterable<T> {\n\t\tfor (const iterable of iterables) {\n\t\t\tfor (const element of iterable) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* concatNested<T>(iterables: Iterable<Iterable<T>>): Iterable<T> {\n\t\tfor (const iterable of iterables) {\n\t\t\tfor (const element of iterable) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function reduce<T, R>(iterable: Iterable<T>, reducer: (previousValue: R, currentValue: T) => R, initialValue: R): R {\n\t\tlet value = initialValue;\n\t\tfor (const element of iterable) {\n\t\t\tvalue = reducer(value, element);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n\t */\n\texport function* slice<T>(arr: ReadonlyArray<T>, from: number, to = arr.length): Iterable<T> {\n\t\tif (from < 0) {\n\t\t\tfrom += arr.length;\n\t\t}\n\n\t\tif (to < 0) {\n\t\t\tto += arr.length;\n\t\t} else if (to > arr.length) {\n\t\t\tto = arr.length;\n\t\t}\n\n\t\tfor (; from < to; from++) {\n\t\t\tyield arr[from];\n\t\t}\n\t}\n\n\t/**\n\t * Consumes `atMost` elements from iterable and returns the consumed elements,\n\t * and an iterable for the rest of the elements.\n\t */\n\texport function consume<T>(iterable: Iterable<T>, atMost: number = Number.POSITIVE_INFINITY): [T[], Iterable<T>] {\n\t\tconst consumed: T[] = [];\n\n\t\tif (atMost === 0) {\n\t\t\treturn [consumed, iterable];\n\t\t}\n\n\t\tconst iterator = iterable[Symbol.iterator]();\n\n\t\tfor (let i = 0; i < atMost; i++) {\n\t\t\tconst next = iterator.next();\n\n\t\t\tif (next.done) {\n\t\t\t\treturn [consumed, Iterable.empty()];\n\t\t\t}\n\n\t\t\tconsumed.push(next.value);\n\t\t}\n\n\t\treturn [consumed, { [Symbol.iterator]() { return iterator; } }];\n\t}\n\n\t/**\n\t * Returns whether the iterables are the same length and all items are\n\t * equal using the comparator function.\n\t */\n\texport function equals<T>(a: Iterable<T>, b: Iterable<T>, comparator = (at: T, bt: T) => at === bt) {\n\t\tconst ai = a[Symbol.iterator]();\n\t\tconst bi = b[Symbol.iterator]();\n\t\twhile (true) {\n\t\t\tconst an = ai.next();\n\t\t\tconst bn = bi.next();\n\n\t\t\tif (an.done !== bn.done) {\n\t\t\t\treturn false;\n\t\t\t} else if (an.done) {\n\t\t\t\treturn true;\n\t\t\t} else if (!comparator(an.value, bn.value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\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\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport const enum KeyCode {\n\tDependsOnKbLayout = -1,\n\n\t/**\n\t * Placed first to cover the 0 value of the enum.\n\t */\n\tUnknown = 0,\n\n\tBackspace,\n\tTab,\n\tEnter,\n\tShift,\n\tCtrl,\n\tAlt,\n\tPauseBreak,\n\tCapsLock,\n\tEscape,\n\tSpace,\n\tPageUp,\n\tPageDown,\n\tEnd,\n\tHome,\n\tLeftArrow,\n\tUpArrow,\n\tRightArrow,\n\tDownArrow,\n\tInsert,\n\tDelete,\n\n\tDigit0,\n\tDigit1,\n\tDigit2,\n\tDigit3,\n\tDigit4,\n\tDigit5,\n\tDigit6,\n\tDigit7,\n\tDigit8,\n\tDigit9,\n\n\tKeyA,\n\tKeyB,\n\tKeyC,\n\tKeyD,\n\tKeyE,\n\tKeyF,\n\tKeyG,\n\tKeyH,\n\tKeyI,\n\tKeyJ,\n\tKeyK,\n\tKeyL,\n\tKeyM,\n\tKeyN,\n\tKeyO,\n\tKeyP,\n\tKeyQ,\n\tKeyR,\n\tKeyS,\n\tKeyT,\n\tKeyU,\n\tKeyV,\n\tKeyW,\n\tKeyX,\n\tKeyY,\n\tKeyZ,\n\n\tMeta,\n\tContextMenu,\n\n\tF1,\n\tF2,\n\tF3,\n\tF4,\n\tF5,\n\tF6,\n\tF7,\n\tF8,\n\tF9,\n\tF10,\n\tF11,\n\tF12,\n\tF13,\n\tF14,\n\tF15,\n\tF16,\n\tF17,\n\tF18,\n\tF19,\n\n\tNumLock,\n\tScrollLock,\n\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ';:' key\n\t */\n\tSemicolon,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tEqual,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tComma,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tMinus,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tPeriod,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '/?' key\n\t */\n\tSlash,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '`~' key\n\t */\n\tBackquote,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '[{' key\n\t */\n\tBracketLeft,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '\\|' key\n\t */\n\tBackslash,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ']}' key\n\t */\n\tBracketRight,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ''\"' key\n\t */\n\tQuote,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t */\n\tOEM_8,\n\t/**\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n\t */\n\tIntlBackslash,\n\n\tNumpad0, // VK_NUMPAD0, 0x60, Numeric keypad 0 key\n\tNumpad1, // VK_NUMPAD1, 0x61, Numeric keypad 1 key\n\tNumpad2, // VK_NUMPAD2, 0x62, Numeric keypad 2 key\n\tNumpad3, // VK_NUMPAD3, 0x63, Numeric keypad 3 key\n\tNumpad4, // VK_NUMPAD4, 0x64, Numeric keypad 4 key\n\tNumpad5, // VK_NUMPAD5, 0x65, Numeric keypad 5 key\n\tNumpad6, // VK_NUMPAD6, 0x66, Numeric keypad 6 key\n\tNumpad7, // VK_NUMPAD7, 0x67, Numeric keypad 7 key\n\tNumpad8, // VK_NUMPAD8, 0x68, Numeric keypad 8 key\n\tNumpad9, // VK_NUMPAD9, 0x69, Numeric keypad 9 key\n\n\tNumpadMultiply,\t// VK_MULTIPLY, 0x6A, Multiply key\n\tNumpadAdd,\t\t// VK_ADD, 0x6B, Add key\n\tNUMPAD_SEPARATOR,\t// VK_SEPARATOR, 0x6C, Separator key\n\tNumpadSubtract,\t// VK_SUBTRACT, 0x6D, Subtract key\n\tNumpadDecimal,\t// VK_DECIMAL, 0x6E, Decimal key\n\tNumpadDivide,\t// VK_DIVIDE, 0x6F,\n\n\t/**\n\t * Cover all key codes when IME is processing input.\n\t */\n\tKEY_IN_COMPOSITION,\n\n\tABNT_C1, // Brazilian (ABNT) Keyboard\n\tABNT_C2, // Brazilian (ABNT) Keyboard\n\n\tAudioVolumeMute,\n\tAudioVolumeUp,\n\tAudioVolumeDown,\n\n\tBrowserSearch,\n\tBrowserHome,\n\tBrowserBack,\n\tBrowserForward,\n\n\tMediaTrackNext,\n\tMediaTrackPrevious,\n\tMediaStop,\n\tMediaPlayPause,\n\tLaunchMediaPlayer,\n\tLaunchMail,\n\tLaunchApp2,\n\n\t/**\n\t * VK_CLEAR, 0x0C, CLEAR key\n\t */\n\tClear,\n\n\t/**\n\t * Placed last to cover the length of the enum.\n\t * Please do not depend on this value!\n\t */\n\tMAX_VALUE\n}\n\n/**\n * keyboardEvent.code\n */\nexport const enum ScanCode {\n\tDependsOnKbLayout = -1,\n\tNone,\n\tHyper,\n\tSuper,\n\tFn,\n\tFnLock,\n\tSuspend,\n\tResume,\n\tTurbo,\n\tSleep,\n\tWakeUp,\n\tKeyA,\n\tKeyB,\n\tKeyC,\n\tKeyD,\n\tKeyE,\n\tKeyF,\n\tKeyG,\n\tKeyH,\n\tKeyI,\n\tKeyJ,\n\tKeyK,\n\tKeyL,\n\tKeyM,\n\tKeyN,\n\tKeyO,\n\tKeyP,\n\tKeyQ,\n\tKeyR,\n\tKeyS,\n\tKeyT,\n\tKeyU,\n\tKeyV,\n\tKeyW,\n\tKeyX,\n\tKeyY,\n\tKeyZ,\n\tDigit1,\n\tDigit2,\n\tDigit3,\n\tDigit4,\n\tDigit5,\n\tDigit6,\n\tDigit7,\n\tDigit8,\n\tDigit9,\n\tDigit0,\n\tEnter,\n\tEscape,\n\tBackspace,\n\tTab,\n\tSpace,\n\tMinus,\n\tEqual,\n\tBracketLeft,\n\tBracketRight,\n\tBackslash,\n\tIntlHash,\n\tSemicolon,\n\tQuote,\n\tBackquote,\n\tComma,\n\tPeriod,\n\tSlash,\n\tCapsLock,\n\tF1,\n\tF2,\n\tF3,\n\tF4,\n\tF5,\n\tF6,\n\tF7,\n\tF8,\n\tF9,\n\tF10,\n\tF11,\n\tF12,\n\tPrintScreen,\n\tScrollLock,\n\tPause,\n\tInsert,\n\tHome,\n\tPageUp,\n\tDelete,\n\tEnd,\n\tPageDown,\n\tArrowRight,\n\tArrowLeft,\n\tArrowDown,\n\tArrowUp,\n\tNumLock,\n\tNumpadDivide,\n\tNumpadMultiply,\n\tNumpadSubtract,\n\tNumpadAdd,\n\tNumpadEnter,\n\tNumpad1,\n\tNumpad2,\n\tNumpad3,\n\tNumpad4,\n\tNumpad5,\n\tNumpad6,\n\tNumpad7,\n\tNumpad8,\n\tNumpad9,\n\tNumpad0,\n\tNumpadDecimal,\n\tIntlBackslash,\n\tContextMenu,\n\tPower,\n\tNumpadEqual,\n\tF13,\n\tF14,\n\tF15,\n\tF16,\n\tF17,\n\tF18,\n\tF19,\n\tF20,\n\tF21,\n\tF22,\n\tF23,\n\tF24,\n\tOpen,\n\tHelp,\n\tSelect,\n\tAgain,\n\tUndo,\n\tCut,\n\tCopy,\n\tPaste,\n\tFind,\n\tAudioVolumeMute,\n\tAudioVolumeUp,\n\tAudioVolumeDown,\n\tNumpadComma,\n\tIntlRo,\n\tKanaMode,\n\tIntlYen,\n\tConvert,\n\tNonConvert,\n\tLang1,\n\tLang2,\n\tLang3,\n\tLang4,\n\tLang5,\n\tAbort,\n\tProps,\n\tNumpadParenLeft,\n\tNumpadParenRight,\n\tNumpadBackspace,\n\tNumpadMemoryStore,\n\tNumpadMemoryRecall,\n\tNumpadMemoryClear,\n\tNumpadMemoryAdd,\n\tNumpadMemorySubtract,\n\tNumpadClear,\n\tNumpadClearEntry,\n\tControlLeft,\n\tShiftLeft,\n\tAltLeft,\n\tMetaLeft,\n\tControlRight,\n\tShiftRight,\n\tAltRight,\n\tMetaRight,\n\tBrightnessUp,\n\tBrightnessDown,\n\tMediaPlay,\n\tMediaRecord,\n\tMediaFastForward,\n\tMediaRewind,\n\tMediaTrackNext,\n\tMediaTrackPrevious,\n\tMediaStop,\n\tEject,\n\tMediaPlayPause,\n\tMediaSelect,\n\tLaunchMail,\n\tLaunchApp2,\n\tLaunchApp1,\n\tSelectTask,\n\tLaunchScreenSaver,\n\tBrowserSearch,\n\tBrowserHome,\n\tBrowserBack,\n\tBrowserForward,\n\tBrowserStop,\n\tBrowserRefresh,\n\tBrowserFavorites,\n\tZoomToggle,\n\tMailReply,\n\tMailForward,\n\tMailSend,\n\n\tMAX_VALUE\n}\n\nclass KeyCodeStrMap {\n\n\tpublic _keyCodeToStr: string[];\n\tpublic _strToKeyCode: { [str: string]: KeyCode };\n\n\tconstructor() {\n\t\tthis._keyCodeToStr = [];\n\t\tthis._strToKeyCode = Object.create(null);\n\t}\n\n\tdefine(keyCode: KeyCode, str: string): void {\n\t\tthis._keyCodeToStr[keyCode] = str;\n\t\tthis._strToKeyCode[str.toLowerCase()] = keyCode;\n\t}\n\n\tkeyCodeToStr(keyCode: KeyCode): string {\n\t\treturn this._keyCodeToStr[keyCode];\n\t}\n\n\tstrToKeyCode(str: string): KeyCode {\n\t\treturn this._strToKeyCode[str.toLowerCase()] || KeyCode.Unknown;\n\t}\n}\n\nconst uiMap = new KeyCodeStrMap();\nconst userSettingsUSMap = new KeyCodeStrMap();\nconst userSettingsGeneralMap = new KeyCodeStrMap();\nexport const EVENT_KEY_CODE_MAP: { [keyCode: number]: KeyCode } = new Array(230);\nexport const NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE: { [nativeKeyCode: string]: KeyCode } = {};\nconst scanCodeIntToStr: string[] = [];\nconst scanCodeStrToInt: { [code: string]: number } = Object.create(null);\nconst scanCodeLowerCaseStrToInt: { [code: string]: number } = Object.create(null);\n\n/**\n * -1 if a ScanCode => KeyCode mapping depends on kb layout.\n */\nexport const IMMUTABLE_CODE_TO_KEY_CODE: KeyCode[] = [];\n\n/**\n * -1 if a KeyCode => ScanCode mapping depends on kb layout.\n */\nexport const IMMUTABLE_KEY_CODE_TO_CODE: ScanCode[] = [];\n\nfor (let i = 0; i <= ScanCode.MAX_VALUE; i++) {\n\tIMMUTABLE_CODE_TO_KEY_CODE[i] = KeyCode.DependsOnKbLayout;\n}\n\nfor (let i = 0; i <= KeyCode.MAX_VALUE; i++) {\n\tIMMUTABLE_KEY_CODE_TO_CODE[i] = ScanCode.DependsOnKbLayout;\n}\n\n(function () {\n\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n\t// See https://github.com/microsoft/node-native-keymap/blob/master/deps/chromium/keyboard_codes_win.h\n\n\tconst empty = '';\n\ttype IMappingEntry = [number, 0 | 1, ScanCode, string, KeyCode, string, number, string, string, string];\n\tconst mappings: IMappingEntry[] = [\n\t\t// keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel\n\t\t[0, 1, ScanCode.None, 'None', KeyCode.Unknown, 'unknown', 0, 'VK_UNKNOWN', empty, empty],\n\t\t[0, 1, ScanCode.Hyper, 'Hyper', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Super, 'Super', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Fn, 'Fn', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.FnLock, 'FnLock', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Suspend, 'Suspend', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Resume, 'Resume', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Turbo, 'Turbo', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Sleep, 'Sleep', KeyCode.Unknown, empty, 0, 'VK_SLEEP', empty, empty],\n\t\t[0, 1, ScanCode.WakeUp, 'WakeUp', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[31, 0, ScanCode.KeyA, 'KeyA', KeyCode.KeyA, 'A', 65, 'VK_A', empty, empty],\n\t\t[32, 0, ScanCode.KeyB, 'KeyB', KeyCode.KeyB, 'B', 66, 'VK_B', empty, empty],\n\t\t[33, 0, ScanCode.KeyC, 'KeyC', KeyCode.KeyC, 'C', 67, 'VK_C', empty, empty],\n\t\t[34, 0, ScanCode.KeyD, 'KeyD', KeyCode.KeyD, 'D', 68, 'VK_D', empty, empty],\n\t\t[35, 0, ScanCode.KeyE, 'KeyE', KeyCode.KeyE, 'E', 69, 'VK_E', empty, empty],\n\t\t[36, 0, ScanCode.KeyF, 'KeyF', KeyCode.KeyF, 'F', 70, 'VK_F', empty, empty],\n\t\t[37, 0, ScanCode.KeyG, 'KeyG', KeyCode.KeyG, 'G', 71, 'VK_G', empty, empty],\n\t\t[38, 0, ScanCode.KeyH, 'KeyH', KeyCode.KeyH, 'H', 72, 'VK_H', empty, empty],\n\t\t[39, 0, ScanCode.KeyI, 'KeyI', KeyCode.KeyI, 'I', 73, 'VK_I', empty, empty],\n\t\t[40, 0, ScanCode.KeyJ, 'KeyJ', KeyCode.KeyJ, 'J', 74, 'VK_J', empty, empty],\n\t\t[41, 0, ScanCode.KeyK, 'KeyK', KeyCode.KeyK, 'K', 75, 'VK_K', empty, empty],\n\t\t[42, 0, ScanCode.KeyL, 'KeyL', KeyCode.KeyL, 'L', 76, 'VK_L', empty, empty],\n\t\t[43, 0, ScanCode.KeyM, 'KeyM', KeyCode.KeyM, 'M', 77, 'VK_M', empty, empty],\n\t\t[44, 0, ScanCode.KeyN, 'KeyN', KeyCode.KeyN, 'N', 78, 'VK_N', empty, empty],\n\t\t[45, 0, ScanCode.KeyO, 'KeyO', KeyCode.KeyO, 'O', 79, 'VK_O', empty, empty],\n\t\t[46, 0, ScanCode.KeyP, 'KeyP', KeyCode.KeyP, 'P', 80, 'VK_P', empty, empty],\n\t\t[47, 0, ScanCode.KeyQ, 'KeyQ', KeyCode.KeyQ, 'Q', 81, 'VK_Q', empty, empty],\n\t\t[48, 0, ScanCode.KeyR, 'KeyR', KeyCode.KeyR, 'R', 82, 'VK_R', empty, empty],\n\t\t[49, 0, ScanCode.KeyS, 'KeyS', KeyCode.KeyS, 'S', 83, 'VK_S', empty, empty],\n\t\t[50, 0, ScanCode.KeyT, 'KeyT', KeyCode.KeyT, 'T', 84, 'VK_T', empty, empty],\n\t\t[51, 0, ScanCode.KeyU, 'KeyU', KeyCode.KeyU, 'U', 85, 'VK_U', empty, empty],\n\t\t[52, 0, ScanCode.KeyV, 'KeyV', KeyCode.KeyV, 'V', 86, 'VK_V', empty, empty],\n\t\t[53, 0, ScanCode.KeyW, 'KeyW', KeyCode.KeyW, 'W', 87, 'VK_W', empty, empty],\n\t\t[54, 0, ScanCode.KeyX, 'KeyX', KeyCode.KeyX, 'X', 88, 'VK_X', empty, empty],\n\t\t[55, 0, ScanCode.KeyY, 'KeyY', KeyCode.KeyY, 'Y', 89, 'VK_Y', empty, empty],\n\t\t[56, 0, ScanCode.KeyZ, 'KeyZ', KeyCode.KeyZ, 'Z', 90, 'VK_Z', empty, empty],\n\t\t[22, 0, ScanCode.Digit1, 'Digit1', KeyCode.Digit1, '1', 49, 'VK_1', empty, empty],\n\t\t[23, 0, ScanCode.Digit2, 'Digit2', KeyCode.Digit2, '2', 50, 'VK_2', empty, empty],\n\t\t[24, 0, ScanCode.Digit3, 'Digit3', KeyCode.Digit3, '3', 51, 'VK_3', empty, empty],\n\t\t[25, 0, ScanCode.Digit4, 'Digit4', KeyCode.Digit4, '4', 52, 'VK_4', empty, empty],\n\t\t[26, 0, ScanCode.Digit5, 'Digit5', KeyCode.Digit5, '5', 53, 'VK_5', empty, empty],\n\t\t[27, 0, ScanCode.Digit6, 'Digit6', KeyCode.Digit6, '6', 54, 'VK_6', empty, empty],\n\t\t[28, 0, ScanCode.Digit7, 'Digit7', KeyCode.Digit7, '7', 55, 'VK_7', empty, empty],\n\t\t[29, 0, ScanCode.Digit8, 'Digit8', KeyCode.Digit8, '8', 56, 'VK_8', empty, empty],\n\t\t[30, 0, ScanCode.Digit9, 'Digit9', KeyCode.Digit9, '9', 57, 'VK_9', empty, empty],\n\t\t[21, 0, ScanCode.Digit0, 'Digit0', KeyCode.Digit0, '0', 48, 'VK_0', empty, empty],\n\t\t[3, 1, ScanCode.Enter, 'Enter', KeyCode.Enter, 'Enter', 13, 'VK_RETURN', empty, empty],\n\t\t[9, 1, ScanCode.Escape, 'Escape', KeyCode.Escape, 'Escape', 27, 'VK_ESCAPE', empty, empty],\n\t\t[1, 1, ScanCode.Backspace, 'Backspace', KeyCode.Backspace, 'Backspace', 8, 'VK_BACK', empty, empty],\n\t\t[2, 1, ScanCode.Tab, 'Tab', KeyCode.Tab, 'Tab', 9, 'VK_TAB', empty, empty],\n\t\t[10, 1, ScanCode.Space, 'Space', KeyCode.Space, 'Space', 32, 'VK_SPACE', empty, empty],\n\t\t[83, 0, ScanCode.Minus, 'Minus', KeyCode.Minus, '-', 189, 'VK_OEM_MINUS', '-', 'OEM_MINUS'],\n\t\t[81, 0, ScanCode.Equal, 'Equal', KeyCode.Equal, '=', 187, 'VK_OEM_PLUS', '=', 'OEM_PLUS'],\n\t\t[87, 0, ScanCode.BracketLeft, 'BracketLeft', KeyCode.BracketLeft, '[', 219, 'VK_OEM_4', '[', 'OEM_4'],\n\t\t[89, 0, ScanCode.BracketRight, 'BracketRight', KeyCode.BracketRight, ']', 221, 'VK_OEM_6', ']', 'OEM_6'],\n\t\t[88, 0, ScanCode.Backslash, 'Backslash', KeyCode.Backslash, '\\\\', 220, 'VK_OEM_5', '\\\\', 'OEM_5'],\n\t\t[0, 0, ScanCode.IntlHash, 'IntlHash', KeyCode.Unknown, empty, 0, empty, empty, empty], // has been dropped from the w3c spec\n\t\t[80, 0, ScanCode.Semicolon, 'Semicolon', KeyCode.Semicolon, ';', 186, 'VK_OEM_1', ';', 'OEM_1'],\n\t\t[90, 0, ScanCode.Quote, 'Quote', KeyCode.Quote, '\\'', 222, 'VK_OEM_7', '\\'', 'OEM_7'],\n\t\t[86, 0, ScanCode.Backquote, 'Backquote', KeyCode.Backquote, '`', 192, 'VK_OEM_3', '`', 'OEM_3'],\n\t\t[82, 0, ScanCode.Comma, 'Comma', KeyCode.Comma, ',', 188, 'VK_OEM_COMMA', ',', 'OEM_COMMA'],\n\t\t[84, 0, ScanCode.Period, 'Period', KeyCode.Period, '.', 190, 'VK_OEM_PERIOD', '.', 'OEM_PERIOD'],\n\t\t[85, 0, ScanCode.Slash, 'Slash', KeyCode.Slash, '/', 191, 'VK_OEM_2', '/', 'OEM_2'],\n\t\t[8, 1, ScanCode.CapsLock, 'CapsLock', KeyCode.CapsLock, 'CapsLock', 20, 'VK_CAPITAL', empty, empty],\n\t\t[59, 1, ScanCode.F1, 'F1', KeyCode.F1, 'F1', 112, 'VK_F1', empty, empty],\n\t\t[60, 1, ScanCode.F2, 'F2', KeyCode.F2, 'F2', 113, 'VK_F2', empty, empty],\n\t\t[61, 1, ScanCode.F3, 'F3', KeyCode.F3, 'F3', 114, 'VK_F3', empty, empty],\n\t\t[62, 1, ScanCode.F4, 'F4', KeyCode.F4, 'F4', 115, 'VK_F4', empty, empty],\n\t\t[63, 1, ScanCode.F5, 'F5', KeyCode.F5, 'F5', 116, 'VK_F5', empty, empty],\n\t\t[64, 1, ScanCode.F6, 'F6', KeyCode.F6, 'F6', 117, 'VK_F6', empty, empty],\n\t\t[65, 1, ScanCode.F7, 'F7', KeyCode.F7, 'F7', 118, 'VK_F7', empty, empty],\n\t\t[66, 1, ScanCode.F8, 'F8', KeyCode.F8, 'F8', 119, 'VK_F8', empty, empty],\n\t\t[67, 1, ScanCode.F9, 'F9', KeyCode.F9, 'F9', 120, 'VK_F9', empty, empty],\n\t\t[68, 1, ScanCode.F10, 'F10', KeyCode.F10, 'F10', 121, 'VK_F10', empty, empty],\n\t\t[69, 1, ScanCode.F11, 'F11', KeyCode.F11, 'F11', 122, 'VK_F11', empty, empty],\n\t\t[70, 1, ScanCode.F12, 'F12', KeyCode.F12, 'F12', 123, 'VK_F12', empty, empty],\n\t\t[0, 1, ScanCode.PrintScreen, 'PrintScreen', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[79, 1, ScanCode.ScrollLock, 'ScrollLock', KeyCode.ScrollLock, 'ScrollLock', 145, 'VK_SCROLL', empty, empty],\n\t\t[7, 1, ScanCode.Pause, 'Pause', KeyCode.PauseBreak, 'PauseBreak', 19, 'VK_PAUSE', empty, empty],\n\t\t[19, 1, ScanCode.Insert, 'Insert', KeyCode.Insert, 'Insert', 45, 'VK_INSERT', empty, empty],\n\t\t[14, 1, ScanCode.Home, 'Home', KeyCode.Home, 'Home', 36, 'VK_HOME', empty, empty],\n\t\t[11, 1, ScanCode.PageUp, 'PageUp', KeyCode.PageUp, 'PageUp', 33, 'VK_PRIOR', empty, empty],\n\t\t[20, 1, ScanCode.Delete, 'Delete', KeyCode.Delete, 'Delete', 46, 'VK_DELETE', empty, empty],\n\t\t[13, 1, ScanCode.End, 'End', KeyCode.End, 'End', 35, 'VK_END', empty, empty],\n\t\t[12, 1, ScanCode.PageDown, 'PageDown', KeyCode.PageDown, 'PageDown', 34, 'VK_NEXT', empty, empty],\n\t\t[17, 1, ScanCode.ArrowRight, 'ArrowRight', KeyCode.RightArrow, 'RightArrow', 39, 'VK_RIGHT', 'Right', empty],\n\t\t[15, 1, ScanCode.ArrowLeft, 'ArrowLeft', KeyCode.LeftArrow, 'LeftArrow', 37, 'VK_LEFT', 'Left', empty],\n\t\t[18, 1, ScanCode.ArrowDown, 'ArrowDown', KeyCode.DownArrow, 'DownArrow', 40, 'VK_DOWN', 'Down', empty],\n\t\t[16, 1, ScanCode.ArrowUp, 'ArrowUp', KeyCode.UpArrow, 'UpArrow', 38, 'VK_UP', 'Up', empty],\n\t\t[78, 1, ScanCode.NumLock, 'NumLock', KeyCode.NumLock, 'NumLock', 144, 'VK_NUMLOCK', empty, empty],\n\t\t[108, 1, ScanCode.NumpadDivide, 'NumpadDivide', KeyCode.NumpadDivide, 'NumPad_Divide', 111, 'VK_DIVIDE', empty, empty],\n\t\t[103, 1, ScanCode.NumpadMultiply, 'NumpadMultiply', KeyCode.NumpadMultiply, 'NumPad_Multiply', 106, 'VK_MULTIPLY', empty, empty],\n\t\t[106, 1, ScanCode.NumpadSubtract, 'NumpadSubtract', KeyCode.NumpadSubtract, 'NumPad_Subtract', 109, 'VK_SUBTRACT', empty, empty],\n\t\t[104, 1, ScanCode.NumpadAdd, 'NumpadAdd', KeyCode.NumpadAdd, 'NumPad_Add', 107, 'VK_ADD', empty, empty],\n\t\t[3, 1, ScanCode.NumpadEnter, 'NumpadEnter', KeyCode.Enter, empty, 0, empty, empty, empty],\n\t\t[94, 1, ScanCode.Numpad1, 'Numpad1', KeyCode.Numpad1, 'NumPad1', 97, 'VK_NUMPAD1', empty, empty],\n\t\t[95, 1, ScanCode.Numpad2, 'Numpad2', KeyCode.Numpad2, 'NumPad2', 98, 'VK_NUMPAD2', empty, empty],\n\t\t[96, 1, ScanCode.Numpad3, 'Numpad3', KeyCode.Numpad3, 'NumPad3', 99, 'VK_NUMPAD3', empty, empty],\n\t\t[97, 1, ScanCode.Numpad4, 'Numpad4', KeyCode.Numpad4, 'NumPad4', 100, 'VK_NUMPAD4', empty, empty],\n\t\t[98, 1, ScanCode.Numpad5, 'Numpad5', KeyCode.Numpad5, 'NumPad5', 101, 'VK_NUMPAD5', empty, empty],\n\t\t[99, 1, ScanCode.Numpad6, 'Numpad6', KeyCode.Numpad6, 'NumPad6', 102, 'VK_NUMPAD6', empty, empty],\n\t\t[100, 1, ScanCode.Numpad7, 'Numpad7', KeyCode.Numpad7, 'NumPad7', 103, 'VK_NUMPAD7', empty, empty],\n\t\t[101, 1, ScanCode.Numpad8, 'Numpad8', KeyCode.Numpad8, 'NumPad8', 104, 'VK_NUMPAD8', empty, empty],\n\t\t[102, 1, ScanCode.Numpad9, 'Numpad9', KeyCode.Numpad9, 'NumPad9', 105, 'VK_NUMPAD9', empty, empty],\n\t\t[93, 1, ScanCode.Numpad0, 'Numpad0', KeyCode.Numpad0, 'NumPad0', 96, 'VK_NUMPAD0', empty, empty],\n\t\t[107, 1, ScanCode.NumpadDecimal, 'NumpadDecimal', KeyCode.NumpadDecimal, 'NumPad_Decimal', 110, 'VK_DECIMAL', empty, empty],\n\t\t[92, 0, ScanCode.IntlBackslash, 'IntlBackslash', KeyCode.IntlBackslash, 'OEM_102', 226, 'VK_OEM_102', empty, empty],\n\t\t[58, 1, ScanCode.ContextMenu, 'ContextMenu', KeyCode.ContextMenu, 'ContextMenu', 93, empty, empty, empty],\n\t\t[0, 1, ScanCode.Power, 'Power', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadEqual, 'NumpadEqual', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[71, 1, ScanCode.F13, 'F13', KeyCode.F13, 'F13', 124, 'VK_F13', empty, empty],\n\t\t[72, 1, ScanCode.F14, 'F14', KeyCode.F14, 'F14', 125, 'VK_F14', empty, empty],\n\t\t[73, 1, ScanCode.F15, 'F15', KeyCode.F15, 'F15', 126, 'VK_F15', empty, empty],\n\t\t[74, 1, ScanCode.F16, 'F16', KeyCode.F16, 'F16', 127, 'VK_F16', empty, empty],\n\t\t[75, 1, ScanCode.F17, 'F17', KeyCode.F17, 'F17', 128, 'VK_F17', empty, empty],\n\t\t[76, 1, ScanCode.F18, 'F18', KeyCode.F18, 'F18', 129, 'VK_F18', empty, empty],\n\t\t[77, 1, ScanCode.F19, 'F19', KeyCode.F19, 'F19', 130, 'VK_F19', empty, empty],\n\t\t[0, 1, ScanCode.F20, 'F20', KeyCode.Unknown, empty, 0, 'VK_F20', empty, empty],\n\t\t[0, 1, ScanCode.F21, 'F21', KeyCode.Unknown, empty, 0, 'VK_F21', empty, empty],\n\t\t[0, 1, ScanCode.F22, 'F22', KeyCode.Unknown, empty, 0, 'VK_F22', empty, empty],\n\t\t[0, 1, ScanCode.F23, 'F23', KeyCode.Unknown, empty, 0, 'VK_F23', empty, empty],\n\t\t[0, 1, ScanCode.F24, 'F24', KeyCode.Unknown, empty, 0, 'VK_F24', empty, empty],\n\t\t[0, 1, ScanCode.Open, 'Open', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Help, 'Help', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Select, 'Select', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Again, 'Again', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Undo, 'Undo', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Cut, 'Cut', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Copy, 'Copy', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Paste, 'Paste', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Find, 'Find', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.AudioVolumeMute, 'AudioVolumeMute', KeyCode.AudioVolumeMute, 'AudioVolumeMute', 173, 'VK_VOLUME_MUTE', empty, empty],\n\t\t[0, 1, ScanCode.AudioVolumeUp, 'AudioVolumeUp', KeyCode.AudioVolumeUp, 'AudioVolumeUp', 175, 'VK_VOLUME_UP', empty, empty],\n\t\t[0, 1, ScanCode.AudioVolumeDown, 'AudioVolumeDown', KeyCode.AudioVolumeDown, 'AudioVolumeDown', 174, 'VK_VOLUME_DOWN', empty, empty],\n\t\t[105, 1, ScanCode.NumpadComma, 'NumpadComma', KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator', 108, 'VK_SEPARATOR', empty, empty],\n\t\t[110, 0, ScanCode.IntlRo, 'IntlRo', KeyCode.ABNT_C1, 'ABNT_C1', 193, 'VK_ABNT_C1', empty, empty],\n\t\t[0, 1, ScanCode.KanaMode, 'KanaMode', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 0, ScanCode.IntlYen, 'IntlYen', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Convert, 'Convert', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NonConvert, 'NonConvert', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Lang1, 'Lang1', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Lang2, 'Lang2', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Lang3, 'Lang3', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Lang4, 'Lang4', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Lang5, 'Lang5', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Abort, 'Abort', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.Props, 'Props', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadParenLeft, 'NumpadParenLeft', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadParenRight, 'NumpadParenRight', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadBackspace, 'NumpadBackspace', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadMemoryStore, 'NumpadMemoryStore', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadMemoryRecall, 'NumpadMemoryRecall', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadMemoryClear, 'NumpadMemoryClear', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadMemoryAdd, 'NumpadMemoryAdd', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadMemorySubtract, 'NumpadMemorySubtract', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.NumpadClear, 'NumpadClear', KeyCode.Clear, 'Clear', 12, 'VK_CLEAR', empty, empty],\n\t\t[0, 1, ScanCode.NumpadClearEntry, 'NumpadClearEntry', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[5, 1, ScanCode.None, empty, KeyCode.Ctrl, 'Ctrl', 17, 'VK_CONTROL', empty, empty],\n\t\t[4, 1, ScanCode.None, empty, KeyCode.Shift, 'Shift', 16, 'VK_SHIFT', empty, empty],\n\t\t[6, 1, ScanCode.None, empty, KeyCode.Alt, 'Alt', 18, 'VK_MENU', empty, empty],\n\t\t[57, 1, ScanCode.None, empty, KeyCode.Meta, 'Meta', 0, 'VK_COMMAND', empty, empty],\n\t\t[5, 1, ScanCode.ControlLeft, 'ControlLeft', KeyCode.Ctrl, empty, 0, 'VK_LCONTROL', empty, empty],\n\t\t[4, 1, ScanCode.ShiftLeft, 'ShiftLeft', KeyCode.Shift, empty, 0, 'VK_LSHIFT', empty, empty],\n\t\t[6, 1, ScanCode.AltLeft, 'AltLeft', KeyCode.Alt, empty, 0, 'VK_LMENU', empty, empty],\n\t\t[57, 1, ScanCode.MetaLeft, 'MetaLeft', KeyCode.Meta, empty, 0, 'VK_LWIN', empty, empty],\n\t\t[5, 1, ScanCode.ControlRight, 'ControlRight', KeyCode.Ctrl, empty, 0, 'VK_RCONTROL', empty, empty],\n\t\t[4, 1, ScanCode.ShiftRight, 'ShiftRight', KeyCode.Shift, empty, 0, 'VK_RSHIFT', empty, empty],\n\t\t[6, 1, ScanCode.AltRight, 'AltRight', KeyCode.Alt, empty, 0, 'VK_RMENU', empty, empty],\n\t\t[57, 1, ScanCode.MetaRight, 'MetaRight', KeyCode.Meta, empty, 0, 'VK_RWIN', empty, empty],\n\t\t[0, 1, ScanCode.BrightnessUp, 'BrightnessUp', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.BrightnessDown, 'BrightnessDown', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MediaPlay, 'MediaPlay', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MediaRecord, 'MediaRecord', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MediaFastForward, 'MediaFastForward', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MediaRewind, 'MediaRewind', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[114, 1, ScanCode.MediaTrackNext, 'MediaTrackNext', KeyCode.MediaTrackNext, 'MediaTrackNext', 176, 'VK_MEDIA_NEXT_TRACK', empty, empty],\n\t\t[115, 1, ScanCode.MediaTrackPrevious, 'MediaTrackPrevious', KeyCode.MediaTrackPrevious, 'MediaTrackPrevious', 177, 'VK_MEDIA_PREV_TRACK', empty, empty],\n\t\t[116, 1, ScanCode.MediaStop, 'MediaStop', KeyCode.MediaStop, 'MediaStop', 178, 'VK_MEDIA_STOP', empty, empty],\n\t\t[0, 1, ScanCode.Eject, 'Eject', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[117, 1, ScanCode.MediaPlayPause, 'MediaPlayPause', KeyCode.MediaPlayPause, 'MediaPlayPause', 179, 'VK_MEDIA_PLAY_PAUSE', empty, empty],\n\t\t[0, 1, ScanCode.MediaSelect, 'MediaSelect', KeyCode.LaunchMediaPlayer, 'LaunchMediaPlayer', 181, 'VK_MEDIA_LAUNCH_MEDIA_SELECT', empty, empty],\n\t\t[0, 1, ScanCode.LaunchMail, 'LaunchMail', KeyCode.LaunchMail, 'LaunchMail', 180, 'VK_MEDIA_LAUNCH_MAIL', empty, empty],\n\t\t[0, 1, ScanCode.LaunchApp2, 'LaunchApp2', KeyCode.LaunchApp2, 'LaunchApp2', 183, 'VK_MEDIA_LAUNCH_APP2', empty, empty],\n\t\t[0, 1, ScanCode.LaunchApp1, 'LaunchApp1', KeyCode.Unknown, empty, 0, 'VK_MEDIA_LAUNCH_APP1', empty, empty],\n\t\t[0, 1, ScanCode.SelectTask, 'SelectTask', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.LaunchScreenSaver, 'LaunchScreenSaver', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.BrowserSearch, 'BrowserSearch', KeyCode.BrowserSearch, 'BrowserSearch', 170, 'VK_BROWSER_SEARCH', empty, empty],\n\t\t[0, 1, ScanCode.BrowserHome, 'BrowserHome', KeyCode.BrowserHome, 'BrowserHome', 172, 'VK_BROWSER_HOME', empty, empty],\n\t\t[112, 1, ScanCode.BrowserBack, 'BrowserBack', KeyCode.BrowserBack, 'BrowserBack', 166, 'VK_BROWSER_BACK', empty, empty],\n\t\t[113, 1, ScanCode.BrowserForward, 'BrowserForward', KeyCode.BrowserForward, 'BrowserForward', 167, 'VK_BROWSER_FORWARD', empty, empty],\n\t\t[0, 1, ScanCode.BrowserStop, 'BrowserStop', KeyCode.Unknown, empty, 0, 'VK_BROWSER_STOP', empty, empty],\n\t\t[0, 1, ScanCode.BrowserRefresh, 'BrowserRefresh', KeyCode.Unknown, empty, 0, 'VK_BROWSER_REFRESH', empty, empty],\n\t\t[0, 1, ScanCode.BrowserFavorites, 'BrowserFavorites', KeyCode.Unknown, empty, 0, 'VK_BROWSER_FAVORITES', empty, empty],\n\t\t[0, 1, ScanCode.ZoomToggle, 'ZoomToggle', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MailReply, 'MailReply', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MailForward, 'MailForward', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\t\t[0, 1, ScanCode.MailSend, 'MailSend', KeyCode.Unknown, empty, 0, empty, empty, empty],\n\n\t\t// See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html\n\t\t// If an Input Method Editor is processing key input and the event is keydown, return 229.\n\t\t[109, 1, ScanCode.None, empty, KeyCode.KEY_IN_COMPOSITION, 'KeyInComposition', 229, empty, empty, empty],\n\t\t[111, 1, ScanCode.None, empty, KeyCode.ABNT_C2, 'ABNT_C2', 194, 'VK_ABNT_C2', empty, empty],\n\t\t[91, 1, ScanCode.None, empty, KeyCode.OEM_8, 'OEM_8', 223, 'VK_OEM_8', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_KANA', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_HANGUL', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_JUNJA', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_FINAL', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_HANJA', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_KANJI', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_CONVERT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_NONCONVERT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_ACCEPT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_MODECHANGE', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_SELECT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_PRINT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_EXECUTE', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_SNAPSHOT', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_HELP', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_APPS', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_PROCESSKEY', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_PACKET', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_DBE_SBCSCHAR', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_DBE_DBCSCHAR', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_ATTN', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_CRSEL', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_EXSEL', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_EREOF', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_PLAY', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_ZOOM', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_NONAME', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_PA1', empty, empty],\n\t\t[0, 1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, 'VK_OEM_CLEAR', empty, empty],\n\t];\n\n\tlet seenKeyCode: boolean[] = [];\n\tlet seenScanCode: boolean[] = [];\n\tfor (const mapping of mappings) {\n\t\tconst [_keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;\n\t\tif (!seenScanCode[scanCode]) {\n\t\t\tseenScanCode[scanCode] = true;\n\t\t\tscanCodeIntToStr[scanCode] = scanCodeStr;\n\t\t\tscanCodeStrToInt[scanCodeStr] = scanCode;\n\t\t\tscanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;\n\t\t\tif (immutable) {\n\t\t\t\tIMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;\n\t\t\t\tif (\n\t\t\t\t\t(keyCode !== KeyCode.Unknown)\n\t\t\t\t\t&& (keyCode !== KeyCode.Enter)\n\t\t\t\t\t&& (keyCode !== KeyCode.Ctrl)\n\t\t\t\t\t&& (keyCode !== KeyCode.Shift)\n\t\t\t\t\t&& (keyCode !== KeyCode.Alt)\n\t\t\t\t\t&& (keyCode !== KeyCode.Meta)\n\t\t\t\t) {\n\t\t\t\t\tIMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!seenKeyCode[keyCode]) {\n\t\t\tseenKeyCode[keyCode] = true;\n\t\t\tif (!keyCodeStr) {\n\t\t\t\tthrow new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);\n\t\t\t}\n\t\t\tuiMap.define(keyCode, keyCodeStr);\n\t\t\tuserSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);\n\t\t\tuserSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);\n\t\t}\n\t\tif (eventKeyCode) {\n\t\t\tEVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;\n\t\t}\n\t\tif (vkey) {\n\t\t\tNATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;\n\t\t}\n\t}\n\t// Manually added due to the exclusion above (due to duplication with NumpadEnter)\n\tIMMUTABLE_KEY_CODE_TO_CODE[KeyCode.Enter] = ScanCode.Enter;\n\n})();\n\nexport namespace KeyCodeUtils {\n\texport function toString(keyCode: KeyCode): string {\n\t\treturn uiMap.keyCodeToStr(keyCode);\n\t}\n\texport function fromString(key: string): KeyCode {\n\t\treturn uiMap.strToKeyCode(key);\n\t}\n\n\texport function toUserSettingsUS(keyCode: KeyCode): string {\n\t\treturn userSettingsUSMap.keyCodeToStr(keyCode);\n\t}\n\texport function toUserSettingsGeneral(keyCode: KeyCode): string {\n\t\treturn userSettingsGeneralMap.keyCodeToStr(keyCode);\n\t}\n\texport function fromUserSettings(key: string): KeyCode {\n\t\treturn userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\n\t}\n\n\texport function toElectronAccelerator(keyCode: KeyCode): string | null {\n\t\tif (keyCode >= KeyCode.Numpad0 && keyCode <= KeyCode.NumpadDivide) {\n\t\t\t// [Electron Accelerators] Electron is able to parse numpad keys, but unfortunately it\n\t\t\t// renders them just as regular keys in menus. For example, num0 is rendered as \"0\",\n\t\t\t// numdiv is rendered as \"/\", numsub is rendered as \"-\".\n\t\t\t//\n\t\t\t// This can lead to incredible confusion, as it makes numpad based keybindings indistinguishable\n\t\t\t// from keybindings based on regular keys.\n\t\t\t//\n\t\t\t// We therefore need to fall back to custom rendering for numpad keys.\n\t\t\treturn null;\n\t\t}\n\n\t\tswitch (keyCode) {\n\t\t\tcase KeyCode.UpArrow:\n\t\t\t\treturn 'Up';\n\t\t\tcase KeyCode.DownArrow:\n\t\t\t\treturn 'Down';\n\t\t\tcase KeyCode.LeftArrow:\n\t\t\t\treturn 'Left';\n\t\t\tcase KeyCode.RightArrow:\n\t\t\t\treturn 'Right';\n\t\t}\n\n\t\treturn uiMap.keyCodeToStr(keyCode);\n\t}\n}\n\nexport const enum KeyMod {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n}\n\nexport function KeyChord(firstPart: number, secondPart: number): number {\n\tconst chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;\n\treturn (firstPart | chordPart) >>> 0;\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 { illegalArgument } from 'vs/base/common/errors';\nimport { KeyCode, ScanCode } from 'vs/base/common/keyCodes';\nimport { OperatingSystem } from 'vs/base/common/platform';\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000FF\n}\n\nexport function createKeybinding(keybinding: number, OS: OperatingSystem): Keybinding | null {\n\tif (keybinding === 0) {\n\t\treturn null;\n\t}\n\tconst firstPart = (keybinding & 0x0000FFFF) >>> 0;\n\tconst chordPart = (keybinding & 0xFFFF0000) >>> 16;\n\tif (chordPart !== 0) {\n\t\treturn new ChordKeybinding([\n\t\t\tcreateSimpleKeybinding(firstPart, OS),\n\t\t\tcreateSimpleKeybinding(chordPart, OS)\n\t\t]);\n\t}\n\treturn new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]);\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): SimpleKeybinding {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport interface Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n}\n\nexport interface IBaseKeybinding extends Modifiers {\n\tisDuplicateModifierCase(): boolean;\n}\n\nexport class SimpleKeybinding implements IBaseKeybinding {\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly keyCode: KeyCode;\n\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, keyCode: KeyCode) {\n\t\tthis.ctrlKey = ctrlKey;\n\t\tthis.shiftKey = shiftKey;\n\t\tthis.altKey = altKey;\n\t\tthis.metaKey = metaKey;\n\t\tthis.keyCode = keyCode;\n\t}\n\n\tpublic equals(other: SimpleKeybinding): boolean {\n\t\treturn (\n\t\t\tthis.ctrlKey === other.ctrlKey\n\t\t\t&& this.shiftKey === other.shiftKey\n\t\t\t&& this.altKey === other.altKey\n\t\t\t&& this.metaKey === other.metaKey\n\t\t\t&& this.keyCode === other.keyCode\n\t\t);\n\t}\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\tpublic toChord(): ChordKeybinding {\n\t\treturn new ChordKeybinding([this]);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\nexport class ChordKeybinding {\n\tpublic readonly parts: SimpleKeybinding[];\n\n\tconstructor(parts: SimpleKeybinding[]) {\n\t\tif (parts.length === 0) {\n\t\t\tthrow illegalArgument(`parts`);\n\t\t}\n\t\tthis.parts = parts;\n\t}\n}\n\nexport type Keybinding = ChordKeybinding;\n\nexport class ScanCodeBinding implements IBaseKeybinding {\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly scanCode: ScanCode;\n\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, scanCode: ScanCode) {\n\t\tthis.ctrlKey = ctrlKey;\n\t\tthis.shiftKey = shiftKey;\n\t\tthis.altKey = altKey;\n\t\tthis.metaKey = metaKey;\n\t\tthis.scanCode = scanCode;\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))\n\t\t\t|| (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))\n\t\t\t|| (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))\n\t\t\t|| (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))\n\t\t);\n\t}\n}\n\nexport class ResolvedKeybindingPart {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\n\treadonly keyLabel: string | null;\n\treadonly keyAriaLabel: string | null;\n\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string | null, kbAriaLabel: string | null) {\n\t\tthis.ctrlKey = ctrlKey;\n\t\tthis.shiftKey = shiftKey;\n\t\tthis.altKey = altKey;\n\t\tthis.metaKey = metaKey;\n\t\tthis.keyLabel = kbLabel;\n\t\tthis.keyAriaLabel = kbAriaLabel;\n\t}\n}\n\nexport type KeybindingModifier = 'ctrl' | 'shift' | 'alt' | 'meta';\n\n/**\n * A resolved keybinding. Can be a simple keybinding or a chord keybinding.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string | null;\n\n\t/**\n\t * Is the binding a chord?\n\t */\n\tpublic abstract isChord(): boolean;\n\n\t/**\n\t * Returns the parts that comprise of the keybinding.\n\t * Simple keybindings return one element.\n\t */\n\tpublic abstract getParts(): ResolvedKeybindingPart[];\n\n\t/**\n\t * Returns the parts that should be used for dispatching.\n\t * Returns null for parts consisting of only modifier keys\n\t * @example keybinding \"Shift\" -> null\n\t * @example keybinding (\"D\" with shift == true) -> \"shift+D\"\n\t */\n\tpublic abstract getDispatchParts(): (string | null)[];\n\n\t/**\n\t * Returns the parts that should be used for dispatching single modifier keys\n\t * Returns null for parts that contain more than one modifier or a regular key.\n\t * @example keybinding \"Shift\" -> \"shift\"\n\t * @example keybinding (\"D\" with shift == true\") -> null\n\t */\n\tpublic abstract getSingleModifierDispatchParts(): (KeybindingModifier | null)[];\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\n/**\n * A value that is resolved synchronously when it is first needed.\n */\nexport interface Lazy<T> {\n\n\n\tgetValue(): T;\n}\n\nexport class Lazy<T> {\n\n\tprivate _didRun: boolean = false;\n\tprivate _value?: T;\n\tprivate _error: Error | undefined;\n\n\tconstructor(\n\t\tprivate readonly executor: () => T,\n\t) { }\n\n\t/**\n\t * Get the wrapped value.\n\t *\n\t * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only\n\t * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value\n\t */\n\tgetValue(): T {\n\t\tif (!this._didRun) {\n\t\t\ttry {\n\t\t\t\tthis._value = this.executor();\n\t\t\t} catch (err) {\n\t\t\t\tthis._error = err;\n\t\t\t} finally {\n\t\t\t\tthis._didRun = true;\n\t\t\t}\n\t\t}\n\t\tif (this._error) {\n\t\t\tthrow this._error;\n\t\t}\n\t\treturn this._value!;\n\t}\n\n\t/**\n\t * Get the wrapped value without forcing evaluation.\n\t */\n\tget rawValue(): T | undefined { return this._value; }\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 { once } from 'vs/base/common/functional';\nimport { Iterable } from 'vs/base/common/iterator';\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker: IDisposableTracker | null = null;\n\nexport interface IDisposableTracker {\n\t/**\n\t * Is called on construction of a disposable.\n\t*/\n\ttrackDisposable(disposable: IDisposable): void;\n\n\t/**\n\t * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).\n\t * If parent is `null`, the disposable is removed from its former parent.\n\t*/\n\tsetParent(child: IDisposable, parent: IDisposable | null): void;\n\n\t/**\n\t * Is called after a disposable is disposed.\n\t*/\n\tmarkAsDisposed(disposable: IDisposable): void;\n\n\t/**\n\t * Indicates that the given object is a singleton which does not need to be disposed.\n\t*/\n\tmarkAsSingleton(disposable: IDisposable): void;\n}\n\nexport function setDisposableTracker(tracker: IDisposableTracker | null): void {\n\tdisposableTracker = tracker;\n}\n\nif (TRACK_DISPOSABLES) {\n\tconst __is_disposable_tracked__ = '__is_disposable_tracked__';\n\tsetDisposableTracker(new class implements IDisposableTracker {\n\t\ttrackDisposable(x: IDisposable): void {\n\t\t\tconst stack = new Error('Potentially leaked disposable').stack!;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!(x as any)[__is_disposable_tracked__]) {\n\t\t\t\t\tconsole.log(stack);\n\t\t\t\t}\n\t\t\t}, 3000);\n\t\t}\n\n\t\tsetParent(child: IDisposable, parent: IDisposable | null): void {\n\t\t\tif (child && child !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t(child as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarkAsDisposed(disposable: IDisposable): void {\n\t\t\tif (disposable && disposable !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t(disposable as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkAsSingleton(disposable: IDisposable): void { }\n\t});\n}\n\nfunction trackDisposable<T extends IDisposable>(x: T): T {\n\tdisposableTracker?.trackDisposable(x);\n\treturn x;\n}\n\nfunction markAsDisposed(disposable: IDisposable): void {\n\tdisposableTracker?.markAsDisposed(disposable);\n}\n\nfunction setParentOfDisposable(child: IDisposable, parent: IDisposable | null): void {\n\tdisposableTracker?.setParent(child, parent);\n}\n\nfunction setParentOfDisposables(children: IDisposable[], parent: IDisposable | null): void {\n\tif (!disposableTracker) {\n\t\treturn;\n\t}\n\tfor (const child of children) {\n\t\tdisposableTracker.setParent(child, parent);\n\t}\n}\n\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton<T extends IDisposable>(singleton: T): T {\n\tdisposableTracker?.markAsSingleton(singleton);\n\treturn singleton;\n}\n\nexport class MultiDisposeError extends Error {\n\tconstructor(\n\t\tpublic readonly errors: any[]\n\t) {\n\t\tsuper(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);\n\t}\n}\n\nexport interface IDisposable {\n\tdispose(): void;\n}\n\nexport function isDisposable<E extends object>(thing: E): thing is E & IDisposable {\n\treturn typeof (<IDisposable>thing).dispose === 'function' && (<IDisposable>thing).dispose.length === 0;\n}\n\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\nexport function dispose<T extends IDisposable, A extends IterableIterator<T> = IterableIterator<T>>(disposables: IterableIterator<T>): A;\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\nexport function dispose<T extends IDisposable>(arg: T | IterableIterator<T> | undefined): any {\n\tif (Iterable.is(arg)) {\n\t\tlet errors: any[] = [];\n\n\t\tfor (const d of arg) {\n\t\t\tif (d) {\n\t\t\t\ttry {\n\t\t\t\t\td.dispose();\n\t\t\t\t} catch (e) {\n\t\t\t\t\terrors.push(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t} else if (errors.length > 1) {\n\t\t\tthrow new MultiDisposeError(errors);\n\t\t}\n\n\t\treturn Array.isArray(arg) ? [] : arg;\n\t} else if (arg) {\n\t\targ.dispose();\n\t\treturn arg;\n\t}\n}\n\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n\tconst parent = toDisposable(() => dispose(disposables));\n\tsetParentOfDisposables(disposables, parent);\n\treturn parent;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n\tconst self = trackDisposable({\n\t\tdispose: once(() => {\n\t\t\tmarkAsDisposed(self);\n\t\t\tfn();\n\t\t})\n\t});\n\treturn self;\n}\n\nexport class DisposableStore implements IDisposable {\n\n\tstatic DISABLE_DISPOSED_WARNING = false;\n\n\tprivate _toDispose = new Set<IDisposable>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Dispose of all registered disposables and mark this object as disposed.\n\t *\n\t * Any future disposables added to this object will be disposed of on `add`.\n\t */\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clear();\n\t}\n\n\t/**\n\t * Returns `true` if this object has been disposed\n\t */\n\tpublic get isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\t/**\n\t * Dispose of all registered disposables but do not mark this object as disposed.\n\t */\n\tpublic clear(): void {\n\t\ttry {\n\t\t\tdispose(this._toDispose.values());\n\t\t} finally {\n\t\t\tthis._toDispose.clear();\n\t\t}\n\t}\n\n\tpublic add<T extends IDisposable>(o: T): T {\n\t\tif (!o) {\n\t\t\treturn o;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\n\t\tsetParentOfDisposable(o, this);\n\t\tif (this._isDisposed) {\n\t\t\tif (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n\t\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._toDispose.add(o);\n\t\t}\n\n\t\treturn o;\n\t}\n}\n\nexport abstract class Disposable implements IDisposable {\n\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected readonly _store = new DisposableStore();\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t\tsetParentOfDisposable(this._store, this);\n\t}\n\n\tpublic dispose(): void {\n\t\tmarkAsDisposed(this);\n\n\t\tthis._store.dispose();\n\t}\n\n\tprotected _register<T extends IDisposable>(o: T): T {\n\t\tif ((o as unknown as Disposable) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\t\treturn this._store.add(o);\n\t}\n}\n\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\n\tprivate _value?: T;\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\tget value(): T | undefined {\n\t\treturn this._isDisposed ? undefined : this._value;\n\t}\n\n\tset value(value: T | undefined) {\n\t\tif (this._isDisposed || value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value?.dispose();\n\t\tif (value) {\n\t\t\tsetParentOfDisposable(value, this);\n\t\t}\n\t\tthis._value = value;\n\t}\n\n\tclear() {\n\t\tthis.value = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._value?.dispose();\n\t\tthis._value = undefined;\n\t}\n\n\t/**\n\t * Clears the value, but does not dispose it.\n\t * The old value is returned.\n\t*/\n\tclearAndLeak(): T | undefined {\n\t\tconst oldValue = this._value;\n\t\tthis._value = undefined;\n\t\tif (oldValue) {\n\t\t\tsetParentOfDisposable(oldValue, null);\n\t\t}\n\t\treturn oldValue;\n\t}\n}\n\n/**\n * A safe disposable can be `unset` so that a leaked reference (listener)\n * can be cut-off.\n */\nexport class SafeDisposable implements IDisposable {\n\n\tdispose: () => void = () => { };\n\tunset: () => void = () => { };\n\tisset: () => boolean = () => false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\tset(fn: Function) {\n\t\tlet callback: Function | undefined = fn;\n\t\tthis.unset = () => callback = undefined;\n\t\tthis.isset = () => callback !== undefined;\n\t\tthis.dispose = () => {\n\t\t\tif (callback) {\n\t\t\t\tcallback();\n\t\t\t\tcallback = undefined;\n\t\t\t\tmarkAsDisposed(this);\n\t\t\t}\n\t\t};\n\t\treturn this;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\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\nclass Node<E> {\n\n\tstatic readonly Undefined = new Node<any>(undefined);\n\n\telement: E;\n\tnext: Node<E>;\n\tprev: Node<E>;\n\n\tconstructor(element: E) {\n\t\tthis.element = element;\n\t\tthis.next = Node.Undefined;\n\t\tthis.prev = Node.Undefined;\n\t}\n}\n\nexport class LinkedList<E> {\n\n\tprivate _first: Node<E> = Node.Undefined;\n\tprivate _last: Node<E> = Node.Undefined;\n\tprivate _size: number = 0;\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this._first === Node.Undefined;\n\t}\n\n\tclear(): void {\n\t\tlet node = this._first;\n\t\twhile (node !== Node.Undefined) {\n\t\t\tconst next = node.next;\n\t\t\tnode.prev = Node.Undefined;\n\t\t\tnode.next = Node.Undefined;\n\t\t\tnode = next;\n\t\t}\n\n\t\tthis._first = Node.Undefined;\n\t\tthis._last = Node.Undefined;\n\t\tthis._size = 0;\n\t}\n\n\tunshift(element: E): () => void {\n\t\treturn this._insert(element, false);\n\t}\n\n\tpush(element: E): () => void {\n\t\treturn this._insert(element, true);\n\t}\n\n\tprivate _insert(element: E, atTheEnd: boolean): () => void {\n\t\tconst newNode = new Node(element);\n\t\tif (this._first === Node.Undefined) {\n\t\t\tthis._first = newNode;\n\t\t\tthis._last = newNode;\n\n\t\t} else if (atTheEnd) {\n\t\t\t// push\n\t\t\tconst oldLast = this._last!;\n\t\t\tthis._last = newNode;\n\t\t\tnewNode.prev = oldLast;\n\t\t\toldLast.next = newNode;\n\n\t\t} else {\n\t\t\t// unshift\n\t\t\tconst oldFirst = this._first;\n\t\t\tthis._first = newNode;\n\t\t\tnewNode.next = oldFirst;\n\t\t\toldFirst.prev = newNode;\n\t\t}\n\t\tthis._size += 1;\n\n\t\tlet didRemove = false;\n\t\treturn () => {\n\t\t\tif (!didRemove) {\n\t\t\t\tdidRemove = true;\n\t\t\t\tthis._remove(newNode);\n\t\t\t}\n\t\t};\n\t}\n\n\tshift(): E | undefined {\n\t\tif (this._first === Node.Undefined) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst res = this._first.element;\n\t\t\tthis._remove(this._first);\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tpop(): E | undefined {\n\t\tif (this._last === Node.Undefined) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst res = this._last.element;\n\t\t\tthis._remove(this._last);\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tprivate _remove(node: Node<E>): void {\n\t\tif (node.prev !== Node.Undefined && node.next !== Node.Undefined) {\n\t\t\t// middle\n\t\t\tconst anchor = node.prev;\n\t\t\tanchor.next = node.next;\n\t\t\tnode.next.prev = anchor;\n\n\t\t} else if (node.prev === Node.Undefined && node.next === Node.Undefined) {\n\t\t\t// only node\n\t\t\tthis._first = Node.Undefined;\n\t\t\tthis._last = Node.Undefined;\n\n\t\t} else if (node.next === Node.Undefined) {\n\t\t\t// last\n\t\t\tthis._last = this._last!.prev!;\n\t\t\tthis._last.next = Node.Undefined;\n\n\t\t} else if (node.prev === Node.Undefined) {\n\t\t\t// first\n\t\t\tthis._first = this._first!.next!;\n\t\t\tthis._first.prev = Node.Undefined;\n\t\t}\n\n\t\t// done\n\t\tthis._size -= 1;\n\t}\n\n\t*[Symbol.iterator](): Iterator<E> {\n\t\tlet node = this._first;\n\t\twhile (node !== Node.Undefined) {\n\t\t\tyield node.element;\n\t\t\tnode = node.next;\n\t\t}\n\t}\n}\n","/**\n * marked - a markdown parser\n * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n// ESM-uncomment-begin\n// let __marked_exports = {};\n// (function() {\n// function define(deps, factory) {\n// factory(__marked_exports);\n// }\n// define.amd = true;\n// ESM-uncomment-end\n\n (function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(__m[314/*vs/base/common/marked/marked*/], __M([0/*exports*/]), factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.marked = {}));\n})(this, (function (exports) { 'use strict';\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n }\n\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n function getDefaults() {\n return {\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n }\n exports.defaults = getDefaults();\n function changeDefaults(newDefaults) {\n exports.defaults = newDefaults;\n }\n\n /**\n * Helpers\n */\n var escapeTest = /[&<>\"']/;\n var escapeReplace = /[&<>\"']/g;\n var escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\n var escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\n var escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n var getEscapeReplacement = function getEscapeReplacement(ch) {\n return escapeReplacements[ch];\n };\n\n function escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n }\n var unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n function unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, function (_, n) {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));\n }\n\n return '';\n });\n }\n var caret = /(^|[^\\[])\\^/g;\n function edit(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n var obj = {\n replace: function replace(name, val) {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: function getRegex() {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n }\n var nonWordAndColonTest = /[^\\w:]/g;\n var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n function cleanUrl(sanitize, base, href) {\n if (sanitize) {\n var prot;\n\n try {\n prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase();\n } catch (e) {\n return null;\n }\n\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n\n return href;\n }\n var baseUrls = {};\n var justDomain = /^[^:]+:\\/*[^/]*$/;\n var protocol = /^([^:]+:)[\\s\\S]*$/;\n var domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n function resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n\n base = baseUrls[' ' + base];\n var relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n }\n var noopTest = {\n exec: function noopTest() {}\n };\n function merge(obj) {\n var i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n }\n function splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n var row = tableRow.replace(/\\|/g, function (match, offset, str) {\n var escaped = false,\n curr = offset;\n\n while (--curr >= 0 && str[curr] === '\\\\') {\n escaped = !escaped;\n }\n\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n\n if (!cells[0].trim()) {\n cells.shift();\n }\n\n if (!cells[cells.length - 1].trim()) {\n cells.pop();\n }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) {\n cells.push('');\n }\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n\n return cells;\n } // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n // /c*$/ is vulnerable to REDOS.\n // invert: Remove suffix of non-c chars instead. Default falsey.\n\n function rtrim(str, c, invert) {\n var l = str.length;\n\n if (l === 0) {\n return '';\n } // Length of suffix matching the invert condition.\n\n\n var suffLen = 0; // Step left until we fail to match the invert condition.\n\n while (suffLen < l) {\n var currChar = str.charAt(l - suffLen - 1);\n\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n }\n function findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n\n var l = str.length;\n var level = 0,\n i = 0;\n\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n\n if (level < 0) {\n return i;\n }\n }\n }\n\n return -1;\n }\n function checkSanitizeDeprecation(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n } // copied from https://stackoverflow.com/a/5450113/806777\n\n function repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n\n var result = '';\n\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n\n count >>= 1;\n pattern += pattern;\n }\n\n return result + pattern;\n }\n\n function outputLink(cap, link, raw, lexer) {\n var href = link.href;\n var title = link.title ? escape(link.title) : null;\n var text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n var token = {\n type: 'link',\n raw: raw,\n href: href,\n title: title,\n text: text,\n tokens: lexer.inlineTokens(text, [])\n };\n lexer.state.inLink = false;\n return token;\n } else {\n return {\n type: 'image',\n raw: raw,\n href: href,\n title: title,\n text: escape(text)\n };\n }\n }\n\n function indentCodeCompensation(raw, text) {\n var matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n var indentToCode = matchIndentToCode[1];\n return text.split('\\n').map(function (node) {\n var matchIndentInNode = node.match(/^\\s+/);\n\n if (matchIndentInNode === null) {\n return node;\n }\n\n var indentInNode = matchIndentInNode[0];\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n }).join('\\n');\n }\n /**\n * Tokenizer\n */\n\n\n var Tokenizer = /*#__PURE__*/function () {\n function Tokenizer(options) {\n this.options = options || exports.defaults;\n }\n\n var _proto = Tokenizer.prototype;\n\n _proto.space = function space(src) {\n var cap = this.rules.block.newline.exec(src);\n\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n };\n\n _proto.code = function code(src) {\n var cap = this.rules.block.code.exec(src);\n\n if (cap) {\n var text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic ? rtrim(text, '\\n') : text\n };\n }\n };\n\n _proto.fences = function fences(src) {\n var cap = this.rules.block.fences.exec(src);\n\n if (cap) {\n var raw = cap[0];\n var text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw: raw,\n lang: cap[2] ? cap[2].trim() : cap[2],\n text: text\n };\n }\n };\n\n _proto.heading = function heading(src) {\n var cap = this.rules.block.heading.exec(src);\n\n if (cap) {\n var text = cap[2].trim(); // remove trailing #s\n\n if (/#$/.test(text)) {\n var trimmed = rtrim(text, '#');\n\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n var token = {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text: text,\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n };\n\n _proto.hr = function hr(src) {\n var cap = this.rules.block.hr.exec(src);\n\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n };\n\n _proto.blockquote = function blockquote(src) {\n var cap = this.rules.block.blockquote.exec(src);\n\n if (cap) {\n var text = cap[0].replace(/^ *> ?/gm, '');\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens: this.lexer.blockTokens(text, []),\n text: text\n };\n }\n };\n\n _proto.list = function list(src) {\n var cap = this.rules.block.list.exec(src);\n\n if (cap) {\n var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;\n var bull = cap[1].trim();\n var isordered = bull.length > 1;\n var list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? \"\\\\d{1,9}\\\\\" + bull.slice(-1) : \"\\\\\" + bull;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n } // Get next list item\n\n\n var itemRegex = new RegExp(\"^( {0,3}\" + bull + \")((?: [^\\\\n]*)?(?:\\\\n|$))\"); // Check if current bullet point can start a new List Item\n\n while (src) {\n endEarly = false;\n\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) {\n // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n line = cap[2].split('\\n', 1)[0];\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) {\n // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n var nextBulletRegex = new RegExp(\"^ {0,\" + Math.min(3, indent - 1) + \"}(?:[*+-]|\\\\d{1,9}[.)])\"); // Check if following lines should be included in List Item\n\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n line = rawLine; // Re-align to follow commonmark nesting rules\n\n if (this.options.pedantic) {\n line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n } // End list item if found start of new bullet\n\n\n if (nextBulletRegex.test(line)) {\n break;\n }\n\n if (line.search(/[^ ]/) >= indent || !line.trim()) {\n // Dedent if possible\n itemContents += '\\n' + line.slice(indent);\n } else if (!blankLine) {\n // Until blank line, item doesn't need indentation\n itemContents += '\\n' + line;\n } else {\n // Otherwise, improper indentation ends this item\n break;\n }\n\n if (!blankLine && !line.trim()) {\n // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n } // Check for task list items\n\n\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw: raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n list.raw += raw;\n } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n\n\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first\n\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n var spacers = list.items[i].tokens.filter(function (t) {\n return t.type === 'space';\n });\n var hasMultipleLineBreaks = spacers.every(function (t) {\n var chars = t.raw.split('');\n var lineBreaks = 0;\n\n for (var _iterator = _createForOfIteratorHelperLoose(chars), _step; !(_step = _iterator()).done;) {\n var _char = _step.value;\n\n if (_char === '\\n') {\n lineBreaks += 1;\n }\n\n if (lineBreaks > 1) {\n return true;\n }\n }\n\n return false;\n });\n\n if (!list.loose && spacers.length && hasMultipleLineBreaks) {\n // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item\n list.loose = true;\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n };\n\n _proto.html = function html(src) {\n var cap = this.rules.block.html.exec(src);\n\n if (cap) {\n var token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n\n if (this.options.sanitize) {\n token.type = 'paragraph';\n token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.tokens = [];\n this.lexer.inline(token.text, token.tokens);\n }\n\n return token;\n }\n };\n\n _proto.def = function def(src) {\n var cap = this.rules.block.def.exec(src);\n\n if (cap) {\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n var tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n return {\n type: 'def',\n tag: tag,\n raw: cap[0],\n href: cap[2],\n title: cap[3]\n };\n }\n };\n\n _proto.table = function table(src) {\n var cap = this.rules.block.table.exec(src);\n\n if (cap) {\n var item = {\n type: 'table',\n header: splitCells(cap[1]).map(function (c) {\n return {\n text: c\n };\n }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n var l = item.align.length;\n var i, j, k, row;\n\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) {\n return {\n text: c\n };\n });\n } // parse child tokens inside headers and cells\n // header child tokens\n\n\n l = item.header.length;\n\n for (j = 0; j < l; j++) {\n item.header[j].tokens = [];\n this.lexer.inlineTokens(item.header[j].text, item.header[j].tokens);\n } // cell child tokens\n\n\n l = item.rows.length;\n\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n\n for (k = 0; k < row.length; k++) {\n row[k].tokens = [];\n this.lexer.inlineTokens(row[k].text, row[k].tokens);\n }\n }\n\n return item;\n }\n }\n };\n\n _proto.lheading = function lheading(src) {\n var cap = this.rules.block.lheading.exec(src);\n\n if (cap) {\n var token = {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n };\n\n _proto.paragraph = function paragraph(src) {\n var cap = this.rules.block.paragraph.exec(src);\n\n if (cap) {\n var token = {\n type: 'paragraph',\n raw: cap[0],\n text: cap[1].charAt(cap[1].length - 1) === '\\n' ? cap[1].slice(0, -1) : cap[1],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n };\n\n _proto.text = function text(src) {\n var cap = this.rules.block.text.exec(src);\n\n if (cap) {\n var token = {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n };\n\n _proto.escape = function escape$1(src) {\n var cap = this.rules.inline.escape.exec(src);\n\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n };\n\n _proto.tag = function tag(src) {\n var cap = this.rules.inline.tag.exec(src);\n\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize ? 'text' : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]\n };\n }\n };\n\n _proto.link = function link(src) {\n var cap = this.rules.inline.link.exec(src);\n\n if (cap) {\n var trimmedUrl = cap[2].trim();\n\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!/>$/.test(trimmedUrl)) {\n return;\n } // ending angle bracket cannot be escaped\n\n\n var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n var lastParenIndex = findClosingBracket(cap[2], '()');\n\n if (lastParenIndex > -1) {\n var start = cap[0].indexOf('!') === 0 ? 5 : 4;\n var linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n\n var href = cap[2];\n var title = '';\n\n if (this.options.pedantic) {\n // split pedantic href and title\n var link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n\n if (/^</.test(href)) {\n if (this.options.pedantic && !/>$/.test(trimmedUrl)) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n };\n\n _proto.reflink = function reflink(src, links) {\n var cap;\n\n if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {\n var link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n\n if (!link || !link.href) {\n var text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text: text\n };\n }\n\n return outputLink(cap, link, cap[0], this.lexer);\n }\n };\n\n _proto.emStrong = function emStrong(src, maskedSrc, prevChar) {\n if (prevChar === void 0) {\n prevChar = '';\n }\n\n var match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return; // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n\n if (match[3] && prevChar.match(/(?:[0-9A-Za-z\\xAA\\xB2\\xB3\\xB5\\xB9\\xBA\\xBC-\\xBE\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u0660-\\u0669\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07C0-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0966-\\u096F\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09E6-\\u09F1\\u09F4-\\u09F9\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A6F\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AE6-\\u0AEF\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B66-\\u0B6F\\u0B71-\\u0B77\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0BE6-\\u0BF2\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D58-\\u0D61\\u0D66-\\u0D78\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DE6-\\u0DEF\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F20-\\u0F33\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F-\\u1049\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u1090-\\u1099\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1369-\\u137C\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B50-\\u1B59\\u1B83-\\u1BA0\\u1BAE-\\u1BE5\\u1C00-\\u1C23\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2070\\u2071\\u2074-\\u2079\\u207F-\\u2089\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2150-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2CFD\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u3192-\\u3195\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA830-\\uA835\\uA840-\\uA873\\uA882-\\uA8B3\\uA8D0-\\uA8D9\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA900-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF-\\uA9D9\\uA9E0-\\uA9E4\\uA9E6-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uA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\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDE70-\\uDEBE\\uDEC0-\\uDEC9\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF5B-\\uDF61\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE96\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD50-\\uDD52\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD834[\\uDEE0-\\uDEF3\\uDF60-\\uDF78]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4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])/)) return;\n var nextChar = match[1] || match[2] || '';\n\n if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) {\n var lLength = match[0].length - 1;\n var rDelim,\n rLength,\n delimTotal = lLength,\n midDelimTotal = 0;\n var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?)\n\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) {\n // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) {\n // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a***\n\n if (Math.min(lLength, rLength) % 2) {\n var _text = src.slice(1, lLength + match.index + rLength);\n\n return {\n type: 'em',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: _text,\n tokens: this.lexer.inlineTokens(_text, [])\n };\n } // Create 'strong' if smallest delimiter has even char count. **a***\n\n\n var text = src.slice(2, lLength + match.index + rLength - 1);\n return {\n type: 'strong',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text: text,\n tokens: this.lexer.inlineTokens(text, [])\n };\n }\n }\n };\n\n _proto.codespan = function codespan(src) {\n var cap = this.rules.inline.code.exec(src);\n\n if (cap) {\n var text = cap[2].replace(/\\n/g, ' ');\n var hasNonSpaceChars = /[^ ]/.test(text);\n var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text: text\n };\n }\n };\n\n _proto.br = function br(src) {\n var cap = this.rules.inline.br.exec(src);\n\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n };\n\n _proto.del = function del(src) {\n var cap = this.rules.inline.del.exec(src);\n\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2], [])\n };\n }\n };\n\n _proto.autolink = function autolink(src, mangle) {\n var cap = this.rules.inline.autolink.exec(src);\n\n if (cap) {\n var text, href;\n\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text: text,\n href: href,\n tokens: [{\n type: 'text',\n raw: text,\n text: text\n }]\n };\n }\n };\n\n _proto.url = function url(src, mangle) {\n var cap;\n\n if (cap = this.rules.inline.url.exec(src)) {\n var text, href;\n\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n var prevCapZero;\n\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n\n text = escape(cap[0]);\n\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text: text,\n href: href,\n tokens: [{\n type: 'text',\n raw: text,\n text: text\n }]\n };\n }\n };\n\n _proto.inlineText = function inlineText(src, smartypants) {\n var cap = this.rules.inline.text.exec(src);\n\n if (cap) {\n var text;\n\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n\n return {\n type: 'text',\n raw: cap[0],\n text: text\n };\n }\n };\n\n return Tokenizer;\n }();\n\n /**\n * Block-Level Grammar\n */\n\n var block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)( [^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?<?([^\\s>]+)>?(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n };\n block._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\n block._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\n block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex();\n block.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\n block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex();\n block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))').replace('def', '\\\\n+(?=' + block.def.source + ')').getRegex();\n block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';\n block._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\n block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex();\n block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex();\n /**\n * Normal Block Grammar\n */\n\n block.normal = merge({}, block);\n /**\n * GFM Block Grammar\n */\n\n block.gfm = merge({}, block.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n\n });\n block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n /**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\n block.pedantic = merge({}, block.normal, {\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)' + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b').getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest,\n // fences not supported\n paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()\n });\n /**\n * Inline-Level Grammar\n */\n\n var inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment' + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>',\n // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan delim inside strong (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^[^_*]*?\\_\\_[^_*]*?\\*[^_*]*?(?=\\_\\_)|[punct_](\\*+)(?=[\\s]|$)|[^punct*_\\s](\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|[^punct*_\\s](\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^[^_*]*?\\*\\*[^_*]*?\\_[^_*]*?(?=\\*\\*)|[punct*](\\_+)(?=[\\s]|$)|[^punct*_\\s](\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,\n punctuation: /^([\\spunctuation])/\n }; // list of punctuation marks from CommonMark spec\n // without * and _ to handle the different emphasis markers * and _\n\n inline._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\n inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); // sequences em should skip over [title](link), `code`, <html>\n\n inline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n inline.escapedEmSt = /\\\\\\*|\\\\_/g;\n inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();\n inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex();\n inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex();\n inline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\n inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\n inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex();\n inline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex();\n inline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\n inline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\n inline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex();\n inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex();\n inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex();\n inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex();\n /**\n * Normal Inline Grammar\n */\n\n inline.normal = merge({}, inline);\n /**\n * Pedantic Inline Grammar\n */\n\n inline.pedantic = merge({}, inline.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/).replace('label', inline._label).getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace('label', inline._label).getRegex()\n });\n /**\n * GFM Inline Grammar\n */\n\n inline.gfm = merge({}, inline.normal, {\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n });\n inline.gfm.url = edit(inline.gfm.url, 'i').replace('email', inline.gfm._extended_email).getRegex();\n /**\n * GFM + Line Breaks Inline Grammar\n */\n\n inline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text).replace('\\\\b_', '\\\\b_| {2,}\\\\n').replace(/\\{2,\\}/g, '*').getRegex()\n });\n\n /**\n * smartypants text replacement\n */\n\n function smartypants(text) {\n return text // em-dashes\n .replace(/---/g, \"\\u2014\") // en-dashes\n .replace(/--/g, \"\\u2013\") // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, \"$1\\u2018\") // closing singles & apostrophes\n .replace(/'/g, \"\\u2019\") // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, \"$1\\u201C\") // closing doubles\n .replace(/\"/g, \"\\u201D\") // ellipses\n .replace(/\\.{3}/g, \"\\u2026\");\n }\n /**\n * mangle email addresses\n */\n\n\n function mangle(text) {\n var out = '',\n i,\n ch;\n var l = text.length;\n\n for (i = 0; i < l; i++) {\n ch = text.charCodeAt(i);\n\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n\n out += '&#' + ch + ';';\n }\n\n return out;\n }\n /**\n * Block Lexer\n */\n\n\n var Lexer = /*#__PURE__*/function () {\n function Lexer(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || exports.defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n var rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n\n\n /**\n * Static Lex Method\n */\n Lexer.lex = function lex(src, options) {\n var lexer = new Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n ;\n\n Lexer.lexInline = function lexInline(src, options) {\n var lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n ;\n\n var _proto = Lexer.prototype;\n\n _proto.lex = function lex(src) {\n src = src.replace(/\\r\\n|\\r/g, '\\n').replace(/\\t/g, ' ');\n this.blockTokens(src, this.tokens);\n var next;\n\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n /**\n * Lexing\n */\n ;\n\n _proto.blockTokens = function blockTokens(src, tokens) {\n var _this = this;\n\n if (tokens === void 0) {\n tokens = [];\n }\n\n if (this.options.pedantic) {\n src = src.replace(/^ +$/gm, '');\n }\n\n var token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) {\n if (token = extTokenizer.call({\n lexer: _this\n }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n\n return false;\n })) {\n continue;\n } // newline\n\n\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n\n continue;\n } // code\n\n\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph.\n\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n\n continue;\n } // fences\n\n\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // heading\n\n\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // hr\n\n\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // blockquote\n\n\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // list\n\n\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // html\n\n\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // def\n\n\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n\n continue;\n } // table (gfm)\n\n\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // lheading\n\n\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n\n\n cutSrc = src;\n\n if (this.options.extensions && this.options.extensions.startBlock) {\n (function () {\n var startIndex = Infinity;\n var tempSrc = src.slice(1);\n var tempStart = void 0;\n\n _this.options.extensions.startBlock.forEach(function (getStartIndex) {\n tempStart = getStartIndex.call({\n lexer: this\n }, tempSrc);\n\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n })();\n }\n\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n\n lastParagraphClipped = cutSrc.length !== src.length;\n src = src.substring(token.raw.length);\n continue;\n } // text\n\n\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n\n continue;\n }\n\n if (src) {\n var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n };\n\n _proto.inline = function inline(src, tokens) {\n this.inlineQueue.push({\n src: src,\n tokens: tokens\n });\n }\n /**\n * Lexing/Compiling\n */\n ;\n\n _proto.inlineTokens = function inlineTokens(src, tokens) {\n var _this2 = this;\n\n if (tokens === void 0) {\n tokens = [];\n }\n\n var token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong\n\n var maskedSrc = src;\n var match;\n var keepPrevChar, prevChar; // Mask out reflinks\n\n if (this.tokens.links) {\n var links = Object.keys(this.tokens.links);\n\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n } // Mask out other blocks\n\n\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n } // Mask out escaped em & strong delimiters\n\n\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n\n keepPrevChar = false; // extensions\n\n if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) {\n if (token = extTokenizer.call({\n lexer: _this2\n }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n\n return false;\n })) {\n continue;\n } // escape\n\n\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // tag\n\n\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n\n continue;\n } // link\n\n\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // reflink, nolink\n\n\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n\n continue;\n } // em & strong\n\n\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // code\n\n\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // br\n\n\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // del (gfm)\n\n\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // autolink\n\n\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // url (gfm)\n\n\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n } // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n\n\n cutSrc = src;\n\n if (this.options.extensions && this.options.extensions.startInline) {\n (function () {\n var startIndex = Infinity;\n var tempSrc = src.slice(1);\n var tempStart = void 0;\n\n _this2.options.extensions.startInline.forEach(function (getStartIndex) {\n tempStart = getStartIndex.call({\n lexer: this\n }, tempSrc);\n\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n })();\n }\n\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n\n if (token.raw.slice(-1) !== '_') {\n // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n\n continue;\n }\n\n if (src) {\n var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n };\n\n _createClass(Lexer, null, [{\n key: \"rules\",\n get: function get() {\n return {\n block: block,\n inline: inline\n };\n }\n }]);\n\n return Lexer;\n }();\n\n /**\n * Renderer\n */\n\n var Renderer = /*#__PURE__*/function () {\n function Renderer(options) {\n this.options = options || exports.defaults;\n }\n\n var _proto = Renderer.prototype;\n\n _proto.code = function code(_code, infostring, escaped) {\n var lang = (infostring || '').match(/\\S*/)[0];\n\n if (this.options.highlight) {\n var out = this.options.highlight(_code, lang);\n\n if (out != null && out !== _code) {\n escaped = true;\n _code = out;\n }\n }\n\n _code = _code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '<pre><code>' + (escaped ? _code : escape(_code, true)) + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"' + this.options.langPrefix + escape(lang, true) + '\">' + (escaped ? _code : escape(_code, true)) + '</code></pre>\\n';\n };\n\n _proto.blockquote = function blockquote(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n };\n\n _proto.html = function html(_html) {\n return _html;\n };\n\n _proto.heading = function heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n return '<h' + level + ' id=\"' + this.options.headerPrefix + slugger.slug(raw) + '\">' + text + '</h' + level + '>\\n';\n } // ignore IDs\n\n\n return '<h' + level + '>' + text + '</h' + level + '>\\n';\n };\n\n _proto.hr = function hr() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n };\n\n _proto.list = function list(body, ordered, start) {\n var type = ordered ? 'ol' : 'ul',\n startatt = ordered && start !== 1 ? ' start=\"' + start + '\"' : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n };\n\n _proto.listitem = function listitem(text) {\n return '<li>' + text + '</li>\\n';\n };\n\n _proto.checkbox = function checkbox(checked) {\n return '<input ' + (checked ? 'checked=\"\" ' : '') + 'disabled=\"\" type=\"checkbox\"' + (this.options.xhtml ? ' /' : '') + '> ';\n };\n\n _proto.paragraph = function paragraph(text) {\n return '<p>' + text + '</p>\\n';\n };\n\n _proto.table = function table(header, body) {\n if (body) body = '<tbody>' + body + '</tbody>';\n return '<table>\\n' + '<thead>\\n' + header + '</thead>\\n' + body + '</table>\\n';\n };\n\n _proto.tablerow = function tablerow(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n };\n\n _proto.tablecell = function tablecell(content, flags) {\n var type = flags.header ? 'th' : 'td';\n var tag = flags.align ? '<' + type + ' align=\"' + flags.align + '\">' : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n } // span level renderer\n ;\n\n _proto.strong = function strong(text) {\n return '<strong>' + text + '</strong>';\n };\n\n _proto.em = function em(text) {\n return '<em>' + text + '</em>';\n };\n\n _proto.codespan = function codespan(text) {\n return '<code>' + text + '</code>';\n };\n\n _proto.br = function br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n };\n\n _proto.del = function del(text) {\n return '<del>' + text + '</del>';\n };\n\n _proto.link = function link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n\n if (href === null) {\n return text;\n }\n\n var out = '<a href=\"' + escape(href) + '\"';\n\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n\n out += '>' + text + '</a>';\n return out;\n };\n\n _proto.image = function image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n\n if (href === null) {\n return text;\n }\n\n var out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n\n out += this.options.xhtml ? '/>' : '>';\n return out;\n };\n\n _proto.text = function text(_text) {\n return _text;\n };\n\n return Renderer;\n }();\n\n /**\n * TextRenderer\n * returns only the textual part of the token\n */\n var TextRenderer = /*#__PURE__*/function () {\n function TextRenderer() {}\n\n var _proto = TextRenderer.prototype;\n\n // no need for block level renderers\n _proto.strong = function strong(text) {\n return text;\n };\n\n _proto.em = function em(text) {\n return text;\n };\n\n _proto.codespan = function codespan(text) {\n return text;\n };\n\n _proto.del = function del(text) {\n return text;\n };\n\n _proto.html = function html(text) {\n return text;\n };\n\n _proto.text = function text(_text) {\n return _text;\n };\n\n _proto.link = function link(href, title, text) {\n return '' + text;\n };\n\n _proto.image = function image(href, title, text) {\n return '' + text;\n };\n\n _proto.br = function br() {\n return '';\n };\n\n return TextRenderer;\n }();\n\n /**\n * Slugger generates header id\n */\n var Slugger = /*#__PURE__*/function () {\n function Slugger() {\n this.seen = {};\n }\n\n var _proto = Slugger.prototype;\n\n _proto.serialize = function serialize(value) {\n return value.toLowerCase().trim() // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '') // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '').replace(/\\s/g, '-');\n }\n /**\n * Finds the next safe (unique) slug to use\n */\n ;\n\n _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) {\n var slug = originalSlug;\n var occurenceAccumulator = 0;\n\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n\n return slug;\n }\n /**\n * Convert string to unique id\n * @param {object} options\n * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.\n */\n ;\n\n _proto.slug = function slug(value, options) {\n if (options === void 0) {\n options = {};\n }\n\n var slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n };\n\n return Slugger;\n }();\n\n /**\n * Parsing & Compiling\n */\n\n var Parser = /*#__PURE__*/function () {\n function Parser(options) {\n this.options = options || exports.defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n /**\n * Static Parse Method\n */\n\n\n Parser.parse = function parse(tokens, options) {\n var parser = new Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n ;\n\n Parser.parseInline = function parseInline(tokens, options) {\n var parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n ;\n\n var _proto = Parser.prototype;\n\n _proto.parse = function parse(tokens, top) {\n if (top === void 0) {\n top = true;\n }\n\n var out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n var l = tokens.length;\n\n for (i = 0; i < l; i++) {\n token = tokens[i]; // Run any renderer extensions\n\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({\n parser: this\n }, token);\n\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space':\n {\n continue;\n }\n\n case 'hr':\n {\n out += this.renderer.hr();\n continue;\n }\n\n case 'heading':\n {\n out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger);\n continue;\n }\n\n case 'code':\n {\n out += this.renderer.code(token.text, token.lang, token.escaped);\n continue;\n }\n\n case 'table':\n {\n header = ''; // header\n\n cell = '';\n l2 = token.header.length;\n\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), {\n header: true,\n align: token.align[j]\n });\n }\n\n header += this.renderer.tablerow(cell);\n body = '';\n l2 = token.rows.length;\n\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n cell = '';\n l3 = row.length;\n\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), {\n header: false,\n align: token.align[k]\n });\n }\n\n body += this.renderer.tablerow(cell);\n }\n\n out += this.renderer.table(header, body);\n continue;\n }\n\n case 'blockquote':\n {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n\n case 'list':\n {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n body = '';\n\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n itemBody = '';\n\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n\n case 'html':\n {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n\n case 'paragraph':\n {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n\n case 'text':\n {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default:\n {\n var errMsg = 'Token with \"' + token.type + '\" type was not found.';\n\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n ;\n\n _proto.parseInline = function parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n var out = '',\n i,\n token,\n ret;\n var l = tokens.length;\n\n for (i = 0; i < l; i++) {\n token = tokens[i]; // Run any renderer extensions\n\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({\n parser: this\n }, token);\n\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape':\n {\n out += renderer.text(token.text);\n break;\n }\n\n case 'html':\n {\n out += renderer.html(token.text);\n break;\n }\n\n case 'link':\n {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n\n case 'image':\n {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n\n case 'strong':\n {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n\n case 'em':\n {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n\n case 'codespan':\n {\n out += renderer.codespan(token.text);\n break;\n }\n\n case 'br':\n {\n out += renderer.br();\n break;\n }\n\n case 'del':\n {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n\n case 'text':\n {\n out += renderer.text(token.text);\n break;\n }\n\n default:\n {\n var errMsg = 'Token with \"' + token.type + '\" type was not found.';\n\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n };\n\n return Parser;\n }();\n\n /**\n * Marked\n */\n\n function marked(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n var highlight = opt.highlight;\n var tokens;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n var done = function done(err) {\n var out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n return err ? callback(err) : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n if (!tokens.length) return done();\n var pending = 0;\n marked.walkTokens(tokens, function (token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(function () {\n highlight(token.text, token.lang, function (err, code) {\n if (err) {\n return done(err);\n }\n\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n try {\n var _tokens = Lexer.lex(src, opt);\n\n if (opt.walkTokens) {\n marked.walkTokens(_tokens, opt.walkTokens);\n }\n\n return Parser.parse(_tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';\n }\n\n throw e;\n }\n }\n /**\n * Options\n */\n\n marked.options = marked.setOptions = function (opt) {\n merge(marked.defaults, opt);\n changeDefaults(marked.defaults);\n return marked;\n };\n\n marked.getDefaults = getDefaults;\n marked.defaults = exports.defaults;\n /**\n * Use Extension\n */\n\n marked.use = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var opts = merge.apply(void 0, [{}].concat(args));\n var extensions = marked.defaults.extensions || {\n renderers: {},\n childTokens: {}\n };\n var hasExtensions;\n args.forEach(function (pack) {\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n hasExtensions = true;\n pack.extensions.forEach(function (ext) {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n\n if (ext.renderer) {\n // Renderer extensions\n var prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;\n\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var ret = ext.renderer.apply(this, args);\n\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n\n if (ext.tokenizer) {\n // Tokenizer Extensions\n if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n\n if (ext.start) {\n // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n\n if (ext.childTokens) {\n // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n } // ==-- Parse \"overwrite\" extensions --== //\n\n\n if (pack.renderer) {\n (function () {\n var renderer = marked.defaults.renderer || new Renderer();\n\n var _loop = function _loop(prop) {\n var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false\n\n renderer[prop] = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var ret = pack.renderer[prop].apply(renderer, args);\n\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n\n return ret;\n };\n };\n\n for (var prop in pack.renderer) {\n _loop(prop);\n }\n\n opts.renderer = renderer;\n })();\n }\n\n if (pack.tokenizer) {\n (function () {\n var tokenizer = marked.defaults.tokenizer || new Tokenizer();\n\n var _loop2 = function _loop2(prop) {\n var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false\n\n tokenizer[prop] = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n var ret = pack.tokenizer[prop].apply(tokenizer, args);\n\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n\n return ret;\n };\n };\n\n for (var prop in pack.tokenizer) {\n _loop2(prop);\n }\n\n opts.tokenizer = tokenizer;\n })();\n } // ==-- Parse WalkTokens extensions --== //\n\n\n if (pack.walkTokens) {\n var _walkTokens = marked.defaults.walkTokens;\n\n opts.walkTokens = function (token) {\n pack.walkTokens.call(this, token);\n\n if (_walkTokens) {\n _walkTokens.call(this, token);\n }\n };\n }\n\n if (hasExtensions) {\n opts.extensions = extensions;\n }\n\n marked.setOptions(opts);\n });\n };\n /**\n * Run callback for every token\n */\n\n\n marked.walkTokens = function (tokens, callback) {\n var _loop3 = function _loop3() {\n var token = _step.value;\n callback.call(marked, token);\n\n switch (token.type) {\n case 'table':\n {\n for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) {\n var cell = _step2.value;\n marked.walkTokens(cell.tokens, callback);\n }\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) {\n var row = _step3.value;\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) {\n var _cell = _step4.value;\n marked.walkTokens(_cell.tokens, callback);\n }\n }\n\n break;\n }\n\n case 'list':\n {\n marked.walkTokens(token.items, callback);\n break;\n }\n\n default:\n {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {\n // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) {\n marked.walkTokens(token[childTokens], callback);\n });\n } else if (token.tokens) {\n marked.walkTokens(token.tokens, callback);\n }\n }\n }\n };\n\n for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) {\n _loop3();\n }\n };\n /**\n * Parse Inline\n */\n\n\n marked.parseInline = function (src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n var tokens = Lexer.lexInline(src, opt);\n\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n\n return Parser.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (opt.silent) {\n return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';\n }\n\n throw e;\n }\n };\n /**\n * Expose\n */\n\n\n marked.Parser = Parser;\n marked.parser = Parser.parse;\n marked.Renderer = Renderer;\n marked.TextRenderer = TextRenderer;\n marked.Lexer = Lexer;\n marked.lexer = Lexer.lex;\n marked.Tokenizer = Tokenizer;\n marked.Slugger = Slugger;\n marked.parse = marked;\n var options = marked.options;\n var setOptions = marked.setOptions;\n var use = marked.use;\n var walkTokens = marked.walkTokens;\n var parseInline = marked.parseInline;\n var parse = marked;\n var parser = Parser.parse;\n var lexer = Lexer.lex;\n\n exports.Lexer = Lexer;\n exports.Parser = Parser;\n exports.Renderer = Renderer;\n exports.Slugger = Slugger;\n exports.TextRenderer = TextRenderer;\n exports.Tokenizer = Tokenizer;\n exports.getDefaults = getDefaults;\n exports.lexer = lexer;\n exports.marked = marked;\n exports.options = options;\n exports.parse = parse;\n exports.parseInline = parseInline;\n exports.parser = parser;\n exports.setOptions = setOptions;\n exports.use = use;\n exports.walkTokens = walkTokens;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n}));\n\n// ESM-uncomment-begin\n// })();\n// export var marked = (__marked_exports || exports);\n// ESM-uncomment-end\n","\n\nexport namespace Mimes {\n\texport const text = 'text/plain';\n\texport const binary = 'application/octet-stream';\n\texport const unknown = 'application/unknown';\n\texport const markdown = 'text/markdown';\n\texport const latex = 'text/latex';\n\texport const uriList = 'text/uri-list';\n}\n","\nimport { Mimes } from 'vs/base/common/mime';\n\n// Common data transfers\nexport const DataTransfers = {\n\n\t/**\n\t * Application specific resource transfer type\n\t */\n\tRESOURCES: 'ResourceURLs',\n\n\t/**\n\t * Browser specific transfer type to download\n\t */\n\tDOWNLOAD_URL: 'DownloadURL',\n\n\t/**\n\t * Browser specific transfer type for files\n\t */\n\tFILES: 'Files',\n\n\t/**\n\t * Typically transfer type for copy/paste transfers.\n\t */\n\tTEXT: Mimes.text,\n\n\t/**\n\t * Application specific terminal transfer type.\n\t */\n\tTERMINALS: 'Terminals'\n};\n\nexport interface IDragAndDropData {\n\tupdate(dataTransfer: DataTransfer): void;\n\tgetData(): unknown;\n}\n\nexport class DragAndDropData<T> implements IDragAndDropData {\n\n\tconstructor(private data: T) { }\n\n\tupdate(): void {\n\t\t// noop\n\t}\n\n\tgetData(): T {\n\t\treturn this.data;\n\t}\n}\n\nexport interface IStaticDND {\n\tCurrentDragAndDropData: IDragAndDropData | undefined;\n}\n\nexport const StaticDND: IStaticDND = {\n\tCurrentDragAndDropData: undefined\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\nexport interface INavigator<T> {\n}\n\nexport class ArrayNavigator<T> implements INavigator<T> {\n\n\tconstructor(\n\t\tprivate readonly items: readonly T[],\n\t\tprotected start: number = 0,\n\t\tprotected end: number = items.length,\n\t\tprotected index = start - 1\n\t) { }\n\n\tcurrent(): T | null {\n\t\tif (this.index === this.start - 1 || this.index === this.end) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.items[this.index];\n\t}\n\n\tnext(): T | null {\n\t\tthis.index = Math.min(this.index + 1, this.end);\n\t\treturn this.current();\n\t}\n\n\tprevious(): T | null {\n\t\tthis.index = Math.max(this.index - 1, this.start - 1);\n\t\treturn this.current();\n\t}\n\n\tfirst(): T | null {\n\t\tthis.index = this.start;\n\t\treturn this.current();\n\t}\n\n\tlast(): T | null {\n\t\tthis.index = this.end - 1;\n\t\treturn this.current();\n\t}\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 { ArrayNavigator, INavigator } from 'vs/base/common/navigator';\n\nexport class HistoryNavigator<T> implements INavigator<T> {\n\n\tprivate _history!: Set<T>;\n\tprivate _limit: number;\n\tprivate _navigator!: ArrayNavigator<T>;\n\n\tconstructor(history: readonly T[] = [], limit: number = 10) {\n\t\tthis._initialize(history);\n\t\tthis._limit = limit;\n\t\tthis._onChange();\n\t}\n\n\tpublic getHistory(): T[] {\n\t\treturn this._elements;\n\t}\n\n\tpublic add(t: T) {\n\t\tthis._history.delete(t);\n\t\tthis._history.add(t);\n\t\tthis._onChange();\n\t}\n\n\tpublic next(): T | null {\n\t\tif (this._currentPosition() !== this._elements.length - 1) {\n\t\t\treturn this._navigator.next();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic previous(): T | null {\n\t\tif (this._currentPosition() !== 0) {\n\t\t\treturn this._navigator.previous();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic current(): T | null {\n\t\treturn this._navigator.current();\n\t}\n\n\tpublic first(): T | null {\n\t\treturn this._navigator.first();\n\t}\n\n\tpublic last(): T | null {\n\t\treturn this._navigator.last();\n\t}\n\n\tpublic has(t: T): boolean {\n\t\treturn this._history.has(t);\n\t}\n\n\tprivate _onChange() {\n\t\tthis._reduceToLimit();\n\t\tconst elements = this._elements;\n\t\tthis._navigator = new ArrayNavigator(elements, 0, elements.length, elements.length);\n\t}\n\n\tprivate _reduceToLimit() {\n\t\tconst data = this._elements;\n\t\tif (data.length > this._limit) {\n\t\t\tthis._initialize(data.slice(data.length - this._limit));\n\t\t}\n\t}\n\n\tprivate _currentPosition(): number {\n\t\tconst currentElement = this._navigator.current();\n\t\tif (!currentElement) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this._elements.indexOf(currentElement);\n\t}\n\n\tprivate _initialize(history: readonly T[]): void {\n\t\tthis._history = new Set();\n\t\tfor (const entry of history) {\n\t\t\tthis._history.add(entry);\n\t\t}\n\t}\n\n\tprivate get _elements(): T[] {\n\t\tconst elements: T[] = [];\n\t\tthis._history.forEach(e => elements.push(e));\n\t\treturn elements;\n\t}\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\nexport function clamp(value: number, min: number, max: number): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n\nexport class MovingAverage {\n\n\tprivate _n = 1;\n\tprivate _val = 0;\n\n\tupdate(value: number): number {\n\t\tthis._val = this._val + (value - this._val) / this._n;\n\t\tthis._n += 1;\n\t\treturn this._val;\n\t}\n\n\tget value(): number {\n\t\treturn this._val;\n\t}\n}\n\nexport class SlidingWindowAverage {\n\n\tprivate _n: number = 0;\n\tprivate _val = 0;\n\n\tprivate readonly _values: number[] = [];\n\tprivate _index: number = 0;\n\tprivate _sum = 0;\n\n\tconstructor(size: number) {\n\t\tthis._values = new Array(size);\n\t\tthis._values.fill(0, 0, size);\n\t}\n\n\tupdate(value: number): number {\n\t\tconst oldValue = this._values[this._index];\n\t\tthis._values[this._index] = value;\n\t\tthis._index = (this._index + 1) % this._values.length;\n\n\t\tthis._sum -= oldValue;\n\t\tthis._sum += value;\n\n\t\tif (this._n < this._values.length) {\n\t\t\tthis._n += 1;\n\t\t}\n\n\t\tthis._val = this._sum / this._n;\n\t\treturn this._val;\n\t}\n\n\tget value(): number {\n\t\treturn this._val;\n\t}\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\nconst LANGUAGE_DEFAULT = 'en';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: string | undefined = undefined;\nlet _userAgent: string | undefined = undefined;\n\ninterface NLSConfig {\n\tlocale: string;\n\tavailableLanguages: { [key: string]: string };\n\t_translationsConfigFile: string;\n}\n\nexport interface IProcessEnvironment {\n\t[key: string]: string | undefined;\n}\n\n/**\n * This interface is intentionally not identical to node.js\n * process because it also works in sandboxed environments\n * where the process object is implemented differently. We\n * define the properties here that we need for `platform`\n * to work and nothing else.\n */\nexport interface INodeProcess {\n\tplatform: string;\n\tarch: string;\n\tenv: IProcessEnvironment;\n\tversions?: {\n\t\telectron?: string;\n\t};\n\ttype?: string;\n\tcwd: () => string;\n}\n\ndeclare const process: INodeProcess;\ndeclare const global: unknown;\ndeclare const self: unknown;\n\nexport const globals: any = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});\n\nlet nodeProcess: INodeProcess | undefined = undefined;\nif (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {\n\t// Native environment (sandboxed)\n\tnodeProcess = globals.vscode.process;\n} else if (typeof process !== 'undefined') {\n\t// Native environment (non-sandboxed)\n\tnodeProcess = process;\n}\n\nconst isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';\nconst isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';\n\ninterface INavigator {\n\tuserAgent: string;\n\tlanguage: string;\n\tmaxTouchPoints?: number;\n}\ndeclare const navigator: INavigator;\n\n// Web environment\nif (typeof navigator === 'object' && !isElectronRenderer) {\n\t_userAgent = navigator.userAgent;\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n\t_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\n\t_isWeb = true;\n\t_locale = navigator.language;\n\t_language = _locale;\n}\n\n// Native environment\nelse if (typeof nodeProcess === 'object') {\n\t_isWindows = (nodeProcess.platform === 'win32');\n\t_isMacintosh = (nodeProcess.platform === 'darwin');\n\t_isLinux = (nodeProcess.platform === 'linux');\n\t_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n\t_isElectron = isElectronProcess;\n\t_isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'];\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);\n\t\t\tconst resolved = nlsConfig.availableLanguages['*'];\n\t\t\t_locale = nlsConfig.locale;\n\t\t\t// VSCode's default language is 'en'\n\t\t\t_language = resolved ? resolved : LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig._translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n}\n\n// Unknown environment\nelse {\n\tconsole.error('Unable to resolve platform.');\n}\n\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isMacintosh) {\n\t_platform = Platform.Mac;\n} else if (_isWindows) {\n\t_platform = Platform.Windows;\n} else if (_isLinux) {\n\t_platform = Platform.Linux;\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof globals.importScripts === 'function');\nexport const isIOS = _isIOS;\nexport const userAgent = _userAgent;\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese)\n */\nexport const language = _language;\n\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n\tif (typeof globals.postMessage === 'function' && !globals.importScripts) {\n\t\tinterface IQueueElement {\n\t\t\tid: number;\n\t\t\tcallback: () => void;\n\t\t}\n\t\tlet pending: IQueueElement[] = [];\n\t\tglobals.addEventListener('message', (e: MessageEvent) => {\n\t\t\tif (e.data && e.data.vscodeScheduleAsyncWork) {\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\n\t\t\t\t\tconst candidate = pending[i];\n\t\t\t\t\tif (candidate.id === e.data.vscodeScheduleAsyncWork) {\n\t\t\t\t\t\tpending.splice(i, 1);\n\t\t\t\t\t\tcandidate.callback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlet lastId = 0;\n\t\treturn (callback: () => void) => {\n\t\t\tconst myId = ++lastId;\n\t\t\tpending.push({\n\t\t\t\tid: myId,\n\t\t\t\tcallback: callback\n\t\t\t});\n\t\t\tglobals.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n\t\t};\n\t}\n\treturn (callback: () => void) => setTimeout(callback);\n})();\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian(): boolean {\n\tif (!_isLittleEndianComputed) {\n\t\t_isLittleEndianComputed = true;\n\t\tconst test = new Uint8Array(2);\n\t\ttest[0] = 1;\n\t\ttest[1] = 2;\n\t\tconst view = new Uint16Array(test.buffer);\n\t\t_isLittleEndian = (view[0] === (2 << 8) + 1);\n\t}\n\treturn _isLittleEndian;\n}\n\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\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 { globals, INodeProcess, isMacintosh, isWindows } from 'vs/base/common/platform';\n\nlet safeProcess: Omit<INodeProcess, 'arch'> & { arch: string | undefined };\ndeclare const process: INodeProcess;\n\n// Native sandbox environment\nif (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {\n\tconst sandboxProcess: INodeProcess = globals.vscode.process;\n\tsafeProcess = {\n\t\tget platform() { return sandboxProcess.platform; },\n\t\tget arch() { return sandboxProcess.arch; },\n\t\tget env() { return sandboxProcess.env; },\n\t\tcwd() { return sandboxProcess.cwd(); }\n\t};\n}\n\n// Native node.js environment\nelse if (typeof process !== 'undefined') {\n\tsafeProcess = {\n\t\tget platform() { return process.platform; },\n\t\tget arch() { return process.arch; },\n\t\tget env() { return process.env; },\n\t\tcwd() { return process.env['VSCODE_CWD'] || process.cwd(); }\n\t};\n}\n\n// Web environment\nelse {\n\tsafeProcess = {\n\n\t\t// Supported\n\t\tget platform() { return isWindows ? 'win32' : isMacintosh ? 'darwin' : 'linux'; },\n\t\tget arch() { return undefined; /* arch is undefined in web */ },\n\n\t\t// Unsupported\n\t\tget env() { return {}; },\n\t\tcwd() { return '/'; }\n\t};\n}\n\n/**\n * Provides safe access to the `cwd` property in node.js, sandboxed or web\n * environments.\n *\n * Note: in web, this property is hardcoded to be `/`.\n */\nexport const cwd = safeProcess.cwd;\n\n/**\n * Provides safe access to the `env` property in node.js, sandboxed or web\n * environments.\n *\n * Note: in web, this property is hardcoded to be `{}`.\n */\nexport const env = safeProcess.env;\n\n/**\n * Provides safe access to the `platform` property in node.js, sandboxed or web\n * environments.\n */\nexport const platform = safeProcess.platform;\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\n// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace\n// Copied from: https://github.com/nodejs/node/blob/v14.16.0/lib/path.js\n\n/**\n * Copyright Joyent, Inc. and other Node contributors.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to permit\n * persons to whom the Software is furnished to do so, subject to the\n * following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport * as process from 'vs/base/common/process';\n\nconst CHAR_UPPERCASE_A = 65;/* A */\nconst CHAR_LOWERCASE_A = 97; /* a */\nconst CHAR_UPPERCASE_Z = 90; /* Z */\nconst CHAR_LOWERCASE_Z = 122; /* z */\nconst CHAR_DOT = 46; /* . */\nconst CHAR_FORWARD_SLASH = 47; /* / */\nconst CHAR_BACKWARD_SLASH = 92; /* \\ */\nconst CHAR_COLON = 58; /* : */\nconst CHAR_QUESTION_MARK = 63; /* ? */\n\nclass ErrorInvalidArgType extends Error {\n\tcode: 'ERR_INVALID_ARG_TYPE';\n\tconstructor(name: string, expected: string, actual: unknown) {\n\t\t// determiner: 'must be' or 'must not be'\n\t\tlet determiner;\n\t\tif (typeof expected === 'string' && expected.indexOf('not ') === 0) {\n\t\t\tdeterminer = 'must not be';\n\t\t\texpected = expected.replace(/^not /, '');\n\t\t} else {\n\t\t\tdeterminer = 'must be';\n\t\t}\n\n\t\tconst type = name.indexOf('.') !== -1 ? 'property' : 'argument';\n\t\tlet msg = `The \"${name}\" ${type} ${determiner} of type ${expected}`;\n\n\t\tmsg += `. Received type ${typeof actual}`;\n\t\tsuper(msg);\n\n\t\tthis.code = 'ERR_INVALID_ARG_TYPE';\n\t}\n}\n\nfunction validateString(value: string, name: string) {\n\tif (typeof value !== 'string') {\n\t\tthrow new ErrorInvalidArgType(name, 'string', value);\n\t}\n}\n\nfunction isPathSeparator(code: number | undefined) {\n\treturn code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n}\n\nfunction isPosixPathSeparator(code: number | undefined) {\n\treturn code === CHAR_FORWARD_SLASH;\n}\n\nfunction isWindowsDeviceRoot(code: number) {\n\treturn (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||\n\t\t(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code?: number) => boolean) {\n\tlet res = '';\n\tlet lastSegmentLength = 0;\n\tlet lastSlash = -1;\n\tlet dots = 0;\n\tlet code = 0;\n\tfor (let i = 0; i <= path.length; ++i) {\n\t\tif (i < path.length) {\n\t\t\tcode = path.charCodeAt(i);\n\t\t}\n\t\telse if (isPathSeparator(code)) {\n\t\t\tbreak;\n\t\t}\n\t\telse {\n\t\t\tcode = CHAR_FORWARD_SLASH;\n\t\t}\n\n\t\tif (isPathSeparator(code)) {\n\t\t\tif (lastSlash === i - 1 || dots === 1) {\n\t\t\t\t// NOOP\n\t\t\t} else if (dots === 2) {\n\t\t\t\tif (res.length < 2 || lastSegmentLength !== 2 ||\n\t\t\t\t\tres.charCodeAt(res.length - 1) !== CHAR_DOT ||\n\t\t\t\t\tres.charCodeAt(res.length - 2) !== CHAR_DOT) {\n\t\t\t\t\tif (res.length > 2) {\n\t\t\t\t\t\tconst lastSlashIndex = res.lastIndexOf(separator);\n\t\t\t\t\t\tif (lastSlashIndex === -1) {\n\t\t\t\t\t\t\tres = '';\n\t\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tres = res.slice(0, lastSlashIndex);\n\t\t\t\t\t\t\tlastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastSlash = i;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (res.length !== 0) {\n\t\t\t\t\t\tres = '';\n\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\tlastSlash = i;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (allowAboveRoot) {\n\t\t\t\t\tres += res.length > 0 ? `${separator}..` : '..';\n\t\t\t\t\tlastSegmentLength = 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (res.length > 0) {\n\t\t\t\t\tres += `${separator}${path.slice(lastSlash + 1, i)}`;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tres = path.slice(lastSlash + 1, i);\n\t\t\t\t}\n\t\t\t\tlastSegmentLength = i - lastSlash - 1;\n\t\t\t}\n\t\t\tlastSlash = i;\n\t\t\tdots = 0;\n\t\t} else if (code === CHAR_DOT && dots !== -1) {\n\t\t\t++dots;\n\t\t} else {\n\t\t\tdots = -1;\n\t\t}\n\t}\n\treturn res;\n}\n\nfunction _format(sep: string, pathObject: ParsedPath) {\n\tif (pathObject === null || typeof pathObject !== 'object') {\n\t\tthrow new ErrorInvalidArgType('pathObject', 'Object', pathObject);\n\t}\n\tconst dir = pathObject.dir || pathObject.root;\n\tconst base = pathObject.base ||\n\t\t`${pathObject.name || ''}${pathObject.ext || ''}`;\n\tif (!dir) {\n\t\treturn base;\n\t}\n\treturn dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;\n}\n\nexport interface ParsedPath {\n\troot: string;\n\tdir: string;\n\tbase: string;\n\text: string;\n\tname: string;\n}\n\nexport interface IPath {\n\tnormalize(path: string): string;\n\tisAbsolute(path: string): boolean;\n\tjoin(...paths: string[]): string;\n\tresolve(...pathSegments: string[]): string;\n\trelative(from: string, to: string): string;\n\tdirname(path: string): string;\n\tbasename(path: string, ext?: string): string;\n\textname(path: string): string;\n\tformat(pathObject: ParsedPath): string;\n\tparse(path: string): ParsedPath;\n\ttoNamespacedPath(path: string): string;\n\tsep: '\\\\' | '/';\n\tdelimiter: string;\n\twin32: IPath | null;\n\tposix: IPath | null;\n}\n\nexport const win32: IPath = {\n\t// path.resolve([from ...], to)\n\tresolve(...pathSegments: string[]): string {\n\t\tlet resolvedDevice = '';\n\t\tlet resolvedTail = '';\n\t\tlet resolvedAbsolute = false;\n\n\t\tfor (let i = pathSegments.length - 1; i >= -1; i--) {\n\t\t\tlet path;\n\t\t\tif (i >= 0) {\n\t\t\t\tpath = pathSegments[i];\n\t\t\t\tvalidateString(path, 'path');\n\n\t\t\t\t// Skip empty entries\n\t\t\t\tif (path.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (resolvedDevice.length === 0) {\n\t\t\t\tpath = process.cwd();\n\t\t\t} else {\n\t\t\t\t// Windows has the concept of drive-specific current working\n\t\t\t\t// directories. If we've resolved a drive letter but not yet an\n\t\t\t\t// absolute path, get cwd for that drive, or the process cwd if\n\t\t\t\t// the drive cwd is not available. We're sure the device is not\n\t\t\t\t// a UNC path at this points, because UNC paths are always absolute.\n\t\t\t\tpath = process.env[`=${resolvedDevice}`] || process.cwd();\n\n\t\t\t\t// Verify that a cwd was found and that it actually points\n\t\t\t\t// to our drive. If not, default to the drive's root.\n\t\t\t\tif (path === undefined ||\n\t\t\t\t\t(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&\n\t\t\t\t\t\tpath.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {\n\t\t\t\t\tpath = `${resolvedDevice}\\\\`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst len = path.length;\n\t\t\tlet rootEnd = 0;\n\t\t\tlet device = '';\n\t\t\tlet isAbsolute = false;\n\t\t\tconst code = path.charCodeAt(0);\n\n\t\t\t// Try to match a root\n\t\t\tif (len === 1) {\n\t\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t\t// `path` contains just a path separator\n\t\t\t\t\trootEnd = 1;\n\t\t\t\t\tisAbsolute = true;\n\t\t\t\t}\n\t\t\t} else if (isPathSeparator(code)) {\n\t\t\t\t// Possible UNC root\n\n\t\t\t\t// If we started with a separator, we know we at least have an\n\t\t\t\t// absolute path of some kind (UNC or otherwise)\n\t\t\t\tisAbsolute = true;\n\n\t\t\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t\t\t// Matched double path separator at beginning\n\t\t\t\t\tlet j = 2;\n\t\t\t\t\tlet last = j;\n\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t\tconst firstPart = path.slice(last, j);\n\t\t\t\t\t\t// Matched!\n\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t// Match 1 or more path separators\n\t\t\t\t\t\twhile (j < len && isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t\t\t// Matched!\n\t\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j === len || j !== last) {\n\t\t\t\t\t\t\t\t// We matched a UNC root\n\t\t\t\t\t\t\t\tdevice = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n\t\t\t\t\t\t\t\trootEnd = j;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trootEnd = 1;\n\t\t\t\t}\n\t\t\t} else if (isWindowsDeviceRoot(code) &&\n\t\t\t\tpath.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t// Possible device root\n\t\t\t\tdevice = path.slice(0, 2);\n\t\t\t\trootEnd = 2;\n\t\t\t\tif (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t\t// Treat separator following drive name as an absolute path\n\t\t\t\t\t// indicator\n\t\t\t\t\tisAbsolute = true;\n\t\t\t\t\trootEnd = 3;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (device.length > 0) {\n\t\t\t\tif (resolvedDevice.length > 0) {\n\t\t\t\t\tif (device.toLowerCase() !== resolvedDevice.toLowerCase()) {\n\t\t\t\t\t\t// This path points to another device so it is not applicable\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresolvedDevice = device;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (resolvedAbsolute) {\n\t\t\t\tif (resolvedDevice.length > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresolvedTail = `${path.slice(rootEnd)}\\\\${resolvedTail}`;\n\t\t\t\tresolvedAbsolute = isAbsolute;\n\t\t\t\tif (isAbsolute && resolvedDevice.length > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At this point the path should be resolved to a full absolute path,\n\t\t// but handle relative paths to be safe (might happen when process.cwd()\n\t\t// fails)\n\n\t\t// Normalize the tail path\n\t\tresolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\\\',\n\t\t\tisPathSeparator);\n\n\t\treturn resolvedAbsolute ?\n\t\t\t`${resolvedDevice}\\\\${resolvedTail}` :\n\t\t\t`${resolvedDevice}${resolvedTail}` || '.';\n\t},\n\n\tnormalize(path: string): string {\n\t\tvalidateString(path, 'path');\n\t\tconst len = path.length;\n\t\tif (len === 0) {\n\t\t\treturn '.';\n\t\t}\n\t\tlet rootEnd = 0;\n\t\tlet device;\n\t\tlet isAbsolute = false;\n\t\tconst code = path.charCodeAt(0);\n\n\t\t// Try to match a root\n\t\tif (len === 1) {\n\t\t\t// `path` contains just a single char, exit early to avoid\n\t\t\t// unnecessary work\n\t\t\treturn isPosixPathSeparator(code) ? '\\\\' : path;\n\t\t}\n\t\tif (isPathSeparator(code)) {\n\t\t\t// Possible UNC root\n\n\t\t\t// If we started with a separator, we know we at least have an absolute\n\t\t\t// path of some kind (UNC or otherwise)\n\t\t\tisAbsolute = true;\n\n\t\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t\t// Matched double path separator at beginning\n\t\t\t\tlet j = 2;\n\t\t\t\tlet last = j;\n\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\tconst firstPart = path.slice(last, j);\n\t\t\t\t\t// Matched!\n\t\t\t\t\tlast = j;\n\t\t\t\t\t// Match 1 or more path separators\n\t\t\t\t\twhile (j < len && isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t\t// Matched!\n\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t// We matched a UNC root only\n\t\t\t\t\t\t\t// Return the normalized version of the UNC root since there\n\t\t\t\t\t\t\t// is nothing left to process\n\t\t\t\t\t\t\treturn `\\\\\\\\${firstPart}\\\\${path.slice(last)}\\\\`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j !== last) {\n\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\t\t\t\t\t\t\tdevice = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n\t\t\t\t\t\t\trootEnd = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trootEnd = 1;\n\t\t\t}\n\t\t} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t// Possible device root\n\t\t\tdevice = path.slice(0, 2);\n\t\t\trootEnd = 2;\n\t\t\tif (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t// Treat separator following drive name as an absolute path\n\t\t\t\t// indicator\n\t\t\t\tisAbsolute = true;\n\t\t\t\trootEnd = 3;\n\t\t\t}\n\t\t}\n\n\t\tlet tail = rootEnd < len ?\n\t\t\tnormalizeString(path.slice(rootEnd), !isAbsolute, '\\\\', isPathSeparator) :\n\t\t\t'';\n\t\tif (tail.length === 0 && !isAbsolute) {\n\t\t\ttail = '.';\n\t\t}\n\t\tif (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {\n\t\t\ttail += '\\\\';\n\t\t}\n\t\tif (device === undefined) {\n\t\t\treturn isAbsolute ? `\\\\${tail}` : tail;\n\t\t}\n\t\treturn isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`;\n\t},\n\n\tisAbsolute(path: string): boolean {\n\t\tvalidateString(path, 'path');\n\t\tconst len = path.length;\n\t\tif (len === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst code = path.charCodeAt(0);\n\t\treturn isPathSeparator(code) ||\n\t\t\t// Possible device root\n\t\t\t(len > 2 &&\n\t\t\t\tisWindowsDeviceRoot(code) &&\n\t\t\t\tpath.charCodeAt(1) === CHAR_COLON &&\n\t\t\t\tisPathSeparator(path.charCodeAt(2)));\n\t},\n\n\tjoin(...paths: string[]): string {\n\t\tif (paths.length === 0) {\n\t\t\treturn '.';\n\t\t}\n\n\t\tlet joined;\n\t\tlet firstPart: string | undefined;\n\t\tfor (let i = 0; i < paths.length; ++i) {\n\t\t\tconst arg = paths[i];\n\t\t\tvalidateString(arg, 'path');\n\t\t\tif (arg.length > 0) {\n\t\t\t\tif (joined === undefined) {\n\t\t\t\t\tjoined = firstPart = arg;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tjoined += `\\\\${arg}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (joined === undefined) {\n\t\t\treturn '.';\n\t\t}\n\n\t\t// Make sure that the joined path doesn't start with two slashes, because\n\t\t// normalize() will mistake it for a UNC path then.\n\t\t//\n\t\t// This step is skipped when it is very clear that the user actually\n\t\t// intended to point at a UNC path. This is assumed when the first\n\t\t// non-empty string arguments starts with exactly two slashes followed by\n\t\t// at least one more non-slash character.\n\t\t//\n\t\t// Note that for normalize() to treat a path as a UNC path it needs to\n\t\t// have at least 2 components, so we don't filter for that here.\n\t\t// This means that the user can use join to construct UNC paths from\n\t\t// a server name and a share name; for example:\n\t\t// path.join('//server', 'share') -> '\\\\\\\\server\\\\share\\\\')\n\t\tlet needsReplace = true;\n\t\tlet slashCount = 0;\n\t\tif (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) {\n\t\t\t++slashCount;\n\t\t\tconst firstLen = firstPart.length;\n\t\t\tif (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {\n\t\t\t\t++slashCount;\n\t\t\t\tif (firstLen > 2) {\n\t\t\t\t\tif (isPathSeparator(firstPart.charCodeAt(2))) {\n\t\t\t\t\t\t++slashCount;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We matched a UNC path in the first part\n\t\t\t\t\t\tneedsReplace = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (needsReplace) {\n\t\t\t// Find any more consecutive slashes we need to replace\n\t\t\twhile (slashCount < joined.length &&\n\t\t\t\tisPathSeparator(joined.charCodeAt(slashCount))) {\n\t\t\t\tslashCount++;\n\t\t\t}\n\n\t\t\t// Replace the slashes if needed\n\t\t\tif (slashCount >= 2) {\n\t\t\t\tjoined = `\\\\${joined.slice(slashCount)}`;\n\t\t\t}\n\t\t}\n\n\t\treturn win32.normalize(joined);\n\t},\n\n\n\t// It will solve the relative path from `from` to `to`, for instance:\n\t// from = 'C:\\\\orandea\\\\test\\\\aaa'\n\t// to = 'C:\\\\orandea\\\\impl\\\\bbb'\n\t// The output of the function should be: '..\\\\..\\\\impl\\\\bbb'\n\trelative(from: string, to: string): string {\n\t\tvalidateString(from, 'from');\n\t\tvalidateString(to, 'to');\n\n\t\tif (from === to) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fromOrig = win32.resolve(from);\n\t\tconst toOrig = win32.resolve(to);\n\n\t\tif (fromOrig === toOrig) {\n\t\t\treturn '';\n\t\t}\n\n\t\tfrom = fromOrig.toLowerCase();\n\t\tto = toOrig.toLowerCase();\n\n\t\tif (from === to) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Trim any leading backslashes\n\t\tlet fromStart = 0;\n\t\twhile (fromStart < from.length &&\n\t\t\tfrom.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\n\t\t\tfromStart++;\n\t\t}\n\t\t// Trim trailing backslashes (applicable to UNC paths only)\n\t\tlet fromEnd = from.length;\n\t\twhile (fromEnd - 1 > fromStart &&\n\t\t\tfrom.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\n\t\t\tfromEnd--;\n\t\t}\n\t\tconst fromLen = fromEnd - fromStart;\n\n\t\t// Trim any leading backslashes\n\t\tlet toStart = 0;\n\t\twhile (toStart < to.length &&\n\t\t\tto.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n\t\t\ttoStart++;\n\t\t}\n\t\t// Trim trailing backslashes (applicable to UNC paths only)\n\t\tlet toEnd = to.length;\n\t\twhile (toEnd - 1 > toStart &&\n\t\t\tto.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\n\t\t\ttoEnd--;\n\t\t}\n\t\tconst toLen = toEnd - toStart;\n\n\t\t// Compare paths to find the longest common path from root\n\t\tconst length = fromLen < toLen ? fromLen : toLen;\n\t\tlet lastCommonSep = -1;\n\t\tlet i = 0;\n\t\tfor (; i < length; i++) {\n\t\t\tconst fromCode = from.charCodeAt(fromStart + i);\n\t\t\tif (fromCode !== to.charCodeAt(toStart + i)) {\n\t\t\t\tbreak;\n\t\t\t} else if (fromCode === CHAR_BACKWARD_SLASH) {\n\t\t\t\tlastCommonSep = i;\n\t\t\t}\n\t\t}\n\n\t\t// We found a mismatch before the first common path separator was seen, so\n\t\t// return the original `to`.\n\t\tif (i !== length) {\n\t\t\tif (lastCommonSep === -1) {\n\t\t\t\treturn toOrig;\n\t\t\t}\n\t\t} else {\n\t\t\tif (toLen > length) {\n\t\t\t\tif (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\t// We get here if `from` is the exact base path for `to`.\n\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n\t\t\t\t\treturn toOrig.slice(toStart + i + 1);\n\t\t\t\t}\n\t\t\t\tif (i === 2) {\n\t\t\t\t\t// We get here if `from` is the device root.\n\t\t\t\t\t// For example: from='C:\\\\'; to='C:\\\\foo'\n\t\t\t\t\treturn toOrig.slice(toStart + i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fromLen > length) {\n\t\t\t\tif (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\t// We get here if `to` is the exact base path for `from`.\n\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n\t\t\t\t\tlastCommonSep = i;\n\t\t\t\t} else if (i === 2) {\n\t\t\t\t\t// We get here if `to` is the device root.\n\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n\t\t\t\t\tlastCommonSep = 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lastCommonSep === -1) {\n\t\t\t\tlastCommonSep = 0;\n\t\t\t}\n\t\t}\n\n\t\tlet out = '';\n\t\t// Generate the relative path based on the path difference between `to` and\n\t\t// `from`\n\t\tfor (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n\t\t\tif (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n\t\t\t\tout += out.length === 0 ? '..' : '\\\\..';\n\t\t\t}\n\t\t}\n\n\t\ttoStart += lastCommonSep;\n\n\t\t// Lastly, append the rest of the destination (`to`) path that comes after\n\t\t// the common path parts\n\t\tif (out.length > 0) {\n\t\t\treturn `${out}${toOrig.slice(toStart, toEnd)}`;\n\t\t}\n\n\t\tif (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n\t\t\t++toStart;\n\t\t}\n\n\t\treturn toOrig.slice(toStart, toEnd);\n\t},\n\n\ttoNamespacedPath(path: string): string {\n\t\t// Note: this will *probably* throw somewhere.\n\t\tif (typeof path !== 'string') {\n\t\t\treturn path;\n\t\t}\n\n\t\tif (path.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst resolvedPath = win32.resolve(path);\n\n\t\tif (resolvedPath.length <= 2) {\n\t\t\treturn path;\n\t\t}\n\n\t\tif (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n\t\t\t// Possible UNC root\n\t\t\tif (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n\t\t\t\tconst code = resolvedPath.charCodeAt(2);\n\t\t\t\tif (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n\t\t\t\t\t// Matched non-long UNC root, convert the path to a long UNC path\n\t\t\t\t\treturn `\\\\\\\\?\\\\UNC\\\\${resolvedPath.slice(2)}`;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\n\t\t\tresolvedPath.charCodeAt(1) === CHAR_COLON &&\n\t\t\tresolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\n\t\t\t// Matched device root, convert the path to a long UNC path\n\t\t\treturn `\\\\\\\\?\\\\${resolvedPath}`;\n\t\t}\n\n\t\treturn path;\n\t},\n\n\tdirname(path: string): string {\n\t\tvalidateString(path, 'path');\n\t\tconst len = path.length;\n\t\tif (len === 0) {\n\t\t\treturn '.';\n\t\t}\n\t\tlet rootEnd = -1;\n\t\tlet offset = 0;\n\t\tconst code = path.charCodeAt(0);\n\n\t\tif (len === 1) {\n\t\t\t// `path` contains just a path separator, exit early to avoid\n\t\t\t// unnecessary work or a dot.\n\t\t\treturn isPathSeparator(code) ? path : '.';\n\t\t}\n\n\t\t// Try to match a root\n\t\tif (isPathSeparator(code)) {\n\t\t\t// Possible UNC root\n\n\t\t\trootEnd = offset = 1;\n\n\t\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t\t// Matched double path separator at beginning\n\t\t\t\tlet j = 2;\n\t\t\t\tlet last = j;\n\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t// Matched!\n\t\t\t\t\tlast = j;\n\t\t\t\t\t// Match 1 or more path separators\n\t\t\t\t\twhile (j < len && isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t\t// Matched!\n\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t// We matched a UNC root only\n\t\t\t\t\t\t\treturn path;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j !== last) {\n\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\n\t\t\t\t\t\t\t// Offset by 1 to include the separator after the UNC root to\n\t\t\t\t\t\t\t// treat it as a \"normal root\" on top of a (UNC) root\n\t\t\t\t\t\t\trootEnd = offset = j + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Possible device root\n\t\t} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n\t\t\trootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;\n\t\t\toffset = rootEnd;\n\t\t}\n\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tfor (let i = len - 1; i >= offset; --i) {\n\t\t\tif (isPathSeparator(path.charCodeAt(i))) {\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tend = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We saw the first non-path separator\n\t\t\t\tmatchedSlash = false;\n\t\t\t}\n\t\t}\n\n\t\tif (end === -1) {\n\t\t\tif (rootEnd === -1) {\n\t\t\t\treturn '.';\n\t\t\t}\n\n\t\t\tend = rootEnd;\n\t\t}\n\t\treturn path.slice(0, end);\n\t},\n\n\tbasename(path: string, ext?: string): string {\n\t\tif (ext !== undefined) {\n\t\t\tvalidateString(ext, 'ext');\n\t\t}\n\t\tvalidateString(path, 'path');\n\t\tlet start = 0;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tlet i;\n\n\t\t// Check for a drive letter prefix so as not to mistake the following\n\t\t// path separator as an extra separator at the end of the path that can be\n\t\t// disregarded\n\t\tif (path.length >= 2 &&\n\t\t\tisWindowsDeviceRoot(path.charCodeAt(0)) &&\n\t\t\tpath.charCodeAt(1) === CHAR_COLON) {\n\t\t\tstart = 2;\n\t\t}\n\n\t\tif (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n\t\t\tif (ext === path) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tlet extIdx = ext.length - 1;\n\t\t\tlet firstNonSlashEnd = -1;\n\t\t\tfor (i = path.length - 1; i >= start; --i) {\n\t\t\t\tconst code = path.charCodeAt(i);\n\t\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\t\tstart = i + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (firstNonSlashEnd === -1) {\n\t\t\t\t\t\t// We saw the first non-path separator, remember this index in case\n\t\t\t\t\t\t// we need it if the extension ends up not matching\n\t\t\t\t\t\tmatchedSlash = false;\n\t\t\t\t\t\tfirstNonSlashEnd = i + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (extIdx >= 0) {\n\t\t\t\t\t\t// Try to match the explicit extension\n\t\t\t\t\t\tif (code === ext.charCodeAt(extIdx)) {\n\t\t\t\t\t\t\tif (--extIdx === -1) {\n\t\t\t\t\t\t\t\t// We matched the extension, so mark this as the end of our path\n\t\t\t\t\t\t\t\t// component\n\t\t\t\t\t\t\t\tend = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Extension does not match, so our result is the entire path\n\t\t\t\t\t\t\t// component\n\t\t\t\t\t\t\textIdx = -1;\n\t\t\t\t\t\t\tend = firstNonSlashEnd;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (start === end) {\n\t\t\t\tend = firstNonSlashEnd;\n\t\t\t} else if (end === -1) {\n\t\t\t\tend = path.length;\n\t\t\t}\n\t\t\treturn path.slice(start, end);\n\t\t}\n\t\tfor (i = path.length - 1; i >= start; --i) {\n\t\t\tif (isPathSeparator(path.charCodeAt(i))) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// path component\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end === -1) {\n\t\t\treturn '';\n\t\t}\n\t\treturn path.slice(start, end);\n\t},\n\n\textname(path: string): string {\n\t\tvalidateString(path, 'path');\n\t\tlet start = 0;\n\t\tlet startDot = -1;\n\t\tlet startPart = 0;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\t// Track the state of characters (if any) we see before our first dot and\n\t\t// after any path separator we find\n\t\tlet preDotState = 0;\n\n\t\t// Check for a drive letter prefix so as not to mistake the following\n\t\t// path separator as an extra separator at the end of the path that can be\n\t\t// disregarded\n\n\t\tif (path.length >= 2 &&\n\t\t\tpath.charCodeAt(1) === CHAR_COLON &&\n\t\t\tisWindowsDeviceRoot(path.charCodeAt(0))) {\n\t\t\tstart = startPart = 2;\n\t\t}\n\n\t\tfor (let i = path.length - 1; i >= start; --i) {\n\t\t\tconst code = path.charCodeAt(i);\n\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstartPart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// extension\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t\tif (code === CHAR_DOT) {\n\t\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\t\tif (startDot === -1) {\n\t\t\t\t\tstartDot = i;\n\t\t\t\t}\n\t\t\t\telse if (preDotState !== 1) {\n\t\t\t\t\tpreDotState = 1;\n\t\t\t\t}\n\t\t\t} else if (startDot !== -1) {\n\t\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t\t// have a good chance at having a non-empty extension\n\t\t\t\tpreDotState = -1;\n\t\t\t}\n\t\t}\n\n\t\tif (startDot === -1 ||\n\t\t\tend === -1 ||\n\t\t\t// We saw a non-dot character immediately before the dot\n\t\t\tpreDotState === 0 ||\n\t\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t\t(preDotState === 1 &&\n\t\t\t\tstartDot === end - 1 &&\n\t\t\t\tstartDot === startPart + 1)) {\n\t\t\treturn '';\n\t\t}\n\t\treturn path.slice(startDot, end);\n\t},\n\n\tformat: _format.bind(null, '\\\\'),\n\n\tparse(path) {\n\t\tvalidateString(path, 'path');\n\n\t\tconst ret = { root: '', dir: '', base: '', ext: '', name: '' };\n\t\tif (path.length === 0) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tconst len = path.length;\n\t\tlet rootEnd = 0;\n\t\tlet code = path.charCodeAt(0);\n\n\t\tif (len === 1) {\n\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t// `path` contains just a path separator, exit early to avoid\n\t\t\t\t// unnecessary work\n\t\t\t\tret.root = ret.dir = path;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tret.base = ret.name = path;\n\t\t\treturn ret;\n\t\t}\n\t\t// Try to match a root\n\t\tif (isPathSeparator(code)) {\n\t\t\t// Possible UNC root\n\n\t\t\trootEnd = 1;\n\t\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t\t// Matched double path separator at beginning\n\t\t\t\tlet j = 2;\n\t\t\t\tlet last = j;\n\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t// Matched!\n\t\t\t\t\tlast = j;\n\t\t\t\t\t// Match 1 or more path separators\n\t\t\t\t\twhile (j < len && isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tif (j < len && j !== last) {\n\t\t\t\t\t\t// Matched!\n\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\twhile (j < len && !isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t// We matched a UNC root only\n\t\t\t\t\t\t\trootEnd = j;\n\t\t\t\t\t\t} else if (j !== last) {\n\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\t\t\t\t\t\t\trootEnd = j + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t// Possible device root\n\t\t\tif (len <= 2) {\n\t\t\t\t// `path` contains just a drive root, exit early to avoid\n\t\t\t\t// unnecessary work\n\t\t\t\tret.root = ret.dir = path;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\trootEnd = 2;\n\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\tif (len === 3) {\n\t\t\t\t\t// `path` contains just a drive root, exit early to avoid\n\t\t\t\t\t// unnecessary work\n\t\t\t\t\tret.root = ret.dir = path;\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t\trootEnd = 3;\n\t\t\t}\n\t\t}\n\t\tif (rootEnd > 0) {\n\t\t\tret.root = path.slice(0, rootEnd);\n\t\t}\n\n\t\tlet startDot = -1;\n\t\tlet startPart = rootEnd;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tlet i = path.length - 1;\n\n\t\t// Track the state of characters (if any) we see before our first dot and\n\t\t// after any path separator we find\n\t\tlet preDotState = 0;\n\n\t\t// Get non-dir info\n\t\tfor (; i >= rootEnd; --i) {\n\t\t\tcode = path.charCodeAt(i);\n\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstartPart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// extension\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t\tif (code === CHAR_DOT) {\n\t\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\t\tif (startDot === -1) {\n\t\t\t\t\tstartDot = i;\n\t\t\t\t} else if (preDotState !== 1) {\n\t\t\t\t\tpreDotState = 1;\n\t\t\t\t}\n\t\t\t} else if (startDot !== -1) {\n\t\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t\t// have a good chance at having a non-empty extension\n\t\t\t\tpreDotState = -1;\n\t\t\t}\n\t\t}\n\n\t\tif (end !== -1) {\n\t\t\tif (startDot === -1 ||\n\t\t\t\t// We saw a non-dot character immediately before the dot\n\t\t\t\tpreDotState === 0 ||\n\t\t\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t\t\t(preDotState === 1 &&\n\t\t\t\t\tstartDot === end - 1 &&\n\t\t\t\t\tstartDot === startPart + 1)) {\n\t\t\t\tret.base = ret.name = path.slice(startPart, end);\n\t\t\t} else {\n\t\t\t\tret.name = path.slice(startPart, startDot);\n\t\t\t\tret.base = path.slice(startPart, end);\n\t\t\t\tret.ext = path.slice(startDot, end);\n\t\t\t}\n\t\t}\n\n\t\t// If the directory is the root, use the entire root as the `dir` including\n\t\t// the trailing slash if any (`C:\\abc` -> `C:\\`). Otherwise, strip out the\n\t\t// trailing slash (`C:\\abc\\def` -> `C:\\abc`).\n\t\tif (startPart > 0 && startPart !== rootEnd) {\n\t\t\tret.dir = path.slice(0, startPart - 1);\n\t\t} else {\n\t\t\tret.dir = ret.root;\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tsep: '\\\\',\n\tdelimiter: ';',\n\twin32: null,\n\tposix: null\n};\n\nexport const posix: IPath = {\n\t// path.resolve([from ...], to)\n\tresolve(...pathSegments: string[]): string {\n\t\tlet resolvedPath = '';\n\t\tlet resolvedAbsolute = false;\n\n\t\tfor (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t\t\tconst path = i >= 0 ? pathSegments[i] : process.cwd();\n\n\t\t\tvalidateString(path, 'path');\n\n\t\t\t// Skip empty entries\n\t\t\tif (path.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresolvedPath = `${path}/${resolvedPath}`;\n\t\t\tresolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n\t\t}\n\n\t\t// At this point the path should be resolved to a full absolute path, but\n\t\t// handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t\t// Normalize the path\n\t\tresolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/',\n\t\t\tisPosixPathSeparator);\n\n\t\tif (resolvedAbsolute) {\n\t\t\treturn `/${resolvedPath}`;\n\t\t}\n\t\treturn resolvedPath.length > 0 ? resolvedPath : '.';\n\t},\n\n\tnormalize(path: string): string {\n\t\tvalidateString(path, 'path');\n\n\t\tif (path.length === 0) {\n\t\t\treturn '.';\n\t\t}\n\n\t\tconst isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n\t\tconst trailingSeparator =\n\t\t\tpath.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;\n\n\t\t// Normalize the path\n\t\tpath = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator);\n\n\t\tif (path.length === 0) {\n\t\t\tif (isAbsolute) {\n\t\t\t\treturn '/';\n\t\t\t}\n\t\t\treturn trailingSeparator ? './' : '.';\n\t\t}\n\t\tif (trailingSeparator) {\n\t\t\tpath += '/';\n\t\t}\n\n\t\treturn isAbsolute ? `/${path}` : path;\n\t},\n\n\tisAbsolute(path: string): boolean {\n\t\tvalidateString(path, 'path');\n\t\treturn path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n\t},\n\n\tjoin(...paths: string[]): string {\n\t\tif (paths.length === 0) {\n\t\t\treturn '.';\n\t\t}\n\t\tlet joined;\n\t\tfor (let i = 0; i < paths.length; ++i) {\n\t\t\tconst arg = paths[i];\n\t\t\tvalidateString(arg, 'path');\n\t\t\tif (arg.length > 0) {\n\t\t\t\tif (joined === undefined) {\n\t\t\t\t\tjoined = arg;\n\t\t\t\t} else {\n\t\t\t\t\tjoined += `/${arg}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (joined === undefined) {\n\t\t\treturn '.';\n\t\t}\n\t\treturn posix.normalize(joined);\n\t},\n\n\trelative(from: string, to: string): string {\n\t\tvalidateString(from, 'from');\n\t\tvalidateString(to, 'to');\n\n\t\tif (from === to) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Trim leading forward slashes.\n\t\tfrom = posix.resolve(from);\n\t\tto = posix.resolve(to);\n\n\t\tif (from === to) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fromStart = 1;\n\t\tconst fromEnd = from.length;\n\t\tconst fromLen = fromEnd - fromStart;\n\t\tconst toStart = 1;\n\t\tconst toLen = to.length - toStart;\n\n\t\t// Compare paths to find the longest common path from root\n\t\tconst length = (fromLen < toLen ? fromLen : toLen);\n\t\tlet lastCommonSep = -1;\n\t\tlet i = 0;\n\t\tfor (; i < length; i++) {\n\t\t\tconst fromCode = from.charCodeAt(fromStart + i);\n\t\t\tif (fromCode !== to.charCodeAt(toStart + i)) {\n\t\t\t\tbreak;\n\t\t\t} else if (fromCode === CHAR_FORWARD_SLASH) {\n\t\t\t\tlastCommonSep = i;\n\t\t\t}\n\t\t}\n\t\tif (i === length) {\n\t\t\tif (toLen > length) {\n\t\t\t\tif (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\n\t\t\t\t\t// We get here if `from` is the exact base path for `to`.\n\t\t\t\t\t// For example: from='/foo/bar'; to='/foo/bar/baz'\n\t\t\t\t\treturn to.slice(toStart + i + 1);\n\t\t\t\t}\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// We get here if `from` is the root\n\t\t\t\t\t// For example: from='/'; to='/foo'\n\t\t\t\t\treturn to.slice(toStart + i);\n\t\t\t\t}\n\t\t\t} else if (fromLen > length) {\n\t\t\t\tif (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\n\t\t\t\t\t// We get here if `to` is the exact base path for `from`.\n\t\t\t\t\t// For example: from='/foo/bar/baz'; to='/foo/bar'\n\t\t\t\t\tlastCommonSep = i;\n\t\t\t\t} else if (i === 0) {\n\t\t\t\t\t// We get here if `to` is the root.\n\t\t\t\t\t// For example: from='/foo/bar'; to='/'\n\t\t\t\t\tlastCommonSep = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet out = '';\n\t\t// Generate the relative path based on the path difference between `to`\n\t\t// and `from`.\n\t\tfor (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n\t\t\tif (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n\t\t\t\tout += out.length === 0 ? '..' : '/..';\n\t\t\t}\n\t\t}\n\n\t\t// Lastly, append the rest of the destination (`to`) path that comes after\n\t\t// the common path parts.\n\t\treturn `${out}${to.slice(toStart + lastCommonSep)}`;\n\t},\n\n\ttoNamespacedPath(path: string): string {\n\t\t// Non-op on posix systems\n\t\treturn path;\n\t},\n\n\tdirname(path: string): string {\n\t\tvalidateString(path, 'path');\n\t\tif (path.length === 0) {\n\t\t\treturn '.';\n\t\t}\n\t\tconst hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tfor (let i = path.length - 1; i >= 1; --i) {\n\t\t\tif (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tend = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We saw the first non-path separator\n\t\t\t\tmatchedSlash = false;\n\t\t\t}\n\t\t}\n\n\t\tif (end === -1) {\n\t\t\treturn hasRoot ? '/' : '.';\n\t\t}\n\t\tif (hasRoot && end === 1) {\n\t\t\treturn '//';\n\t\t}\n\t\treturn path.slice(0, end);\n\t},\n\n\tbasename(path: string, ext?: string): string {\n\t\tif (ext !== undefined) {\n\t\t\tvalidateString(ext, 'ext');\n\t\t}\n\t\tvalidateString(path, 'path');\n\n\t\tlet start = 0;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tlet i;\n\n\t\tif (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n\t\t\tif (ext === path) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tlet extIdx = ext.length - 1;\n\t\t\tlet firstNonSlashEnd = -1;\n\t\t\tfor (i = path.length - 1; i >= 0; --i) {\n\t\t\t\tconst code = path.charCodeAt(i);\n\t\t\t\tif (code === CHAR_FORWARD_SLASH) {\n\t\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\t\tstart = i + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (firstNonSlashEnd === -1) {\n\t\t\t\t\t\t// We saw the first non-path separator, remember this index in case\n\t\t\t\t\t\t// we need it if the extension ends up not matching\n\t\t\t\t\t\tmatchedSlash = false;\n\t\t\t\t\t\tfirstNonSlashEnd = i + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (extIdx >= 0) {\n\t\t\t\t\t\t// Try to match the explicit extension\n\t\t\t\t\t\tif (code === ext.charCodeAt(extIdx)) {\n\t\t\t\t\t\t\tif (--extIdx === -1) {\n\t\t\t\t\t\t\t\t// We matched the extension, so mark this as the end of our path\n\t\t\t\t\t\t\t\t// component\n\t\t\t\t\t\t\t\tend = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Extension does not match, so our result is the entire path\n\t\t\t\t\t\t\t// component\n\t\t\t\t\t\t\textIdx = -1;\n\t\t\t\t\t\t\tend = firstNonSlashEnd;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (start === end) {\n\t\t\t\tend = firstNonSlashEnd;\n\t\t\t} else if (end === -1) {\n\t\t\t\tend = path.length;\n\t\t\t}\n\t\t\treturn path.slice(start, end);\n\t\t}\n\t\tfor (i = path.length - 1; i >= 0; --i) {\n\t\t\tif (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// path component\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end === -1) {\n\t\t\treturn '';\n\t\t}\n\t\treturn path.slice(start, end);\n\t},\n\n\textname(path: string): string {\n\t\tvalidateString(path, 'path');\n\t\tlet startDot = -1;\n\t\tlet startPart = 0;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\t// Track the state of characters (if any) we see before our first dot and\n\t\t// after any path separator we find\n\t\tlet preDotState = 0;\n\t\tfor (let i = path.length - 1; i >= 0; --i) {\n\t\t\tconst code = path.charCodeAt(i);\n\t\t\tif (code === CHAR_FORWARD_SLASH) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstartPart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// extension\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t\tif (code === CHAR_DOT) {\n\t\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\t\tif (startDot === -1) {\n\t\t\t\t\tstartDot = i;\n\t\t\t\t}\n\t\t\t\telse if (preDotState !== 1) {\n\t\t\t\t\tpreDotState = 1;\n\t\t\t\t}\n\t\t\t} else if (startDot !== -1) {\n\t\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t\t// have a good chance at having a non-empty extension\n\t\t\t\tpreDotState = -1;\n\t\t\t}\n\t\t}\n\n\t\tif (startDot === -1 ||\n\t\t\tend === -1 ||\n\t\t\t// We saw a non-dot character immediately before the dot\n\t\t\tpreDotState === 0 ||\n\t\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t\t(preDotState === 1 &&\n\t\t\t\tstartDot === end - 1 &&\n\t\t\t\tstartDot === startPart + 1)) {\n\t\t\treturn '';\n\t\t}\n\t\treturn path.slice(startDot, end);\n\t},\n\n\tformat: _format.bind(null, '/'),\n\n\tparse(path: string): ParsedPath {\n\t\tvalidateString(path, 'path');\n\n\t\tconst ret = { root: '', dir: '', base: '', ext: '', name: '' };\n\t\tif (path.length === 0) {\n\t\t\treturn ret;\n\t\t}\n\t\tconst isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n\t\tlet start;\n\t\tif (isAbsolute) {\n\t\t\tret.root = '/';\n\t\t\tstart = 1;\n\t\t} else {\n\t\t\tstart = 0;\n\t\t}\n\t\tlet startDot = -1;\n\t\tlet startPart = 0;\n\t\tlet end = -1;\n\t\tlet matchedSlash = true;\n\t\tlet i = path.length - 1;\n\n\t\t// Track the state of characters (if any) we see before our first dot and\n\t\t// after any path separator we find\n\t\tlet preDotState = 0;\n\n\t\t// Get non-dir info\n\t\tfor (; i >= start; --i) {\n\t\t\tconst code = path.charCodeAt(i);\n\t\t\tif (code === CHAR_FORWARD_SLASH) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstartPart = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// extension\n\t\t\t\tmatchedSlash = false;\n\t\t\t\tend = i + 1;\n\t\t\t}\n\t\t\tif (code === CHAR_DOT) {\n\t\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\t\tif (startDot === -1) {\n\t\t\t\t\tstartDot = i;\n\t\t\t\t} else if (preDotState !== 1) {\n\t\t\t\t\tpreDotState = 1;\n\t\t\t\t}\n\t\t\t} else if (startDot !== -1) {\n\t\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t\t// have a good chance at having a non-empty extension\n\t\t\t\tpreDotState = -1;\n\t\t\t}\n\t\t}\n\n\t\tif (end !== -1) {\n\t\t\tconst start = startPart === 0 && isAbsolute ? 1 : startPart;\n\t\t\tif (startDot === -1 ||\n\t\t\t\t// We saw a non-dot character immediately before the dot\n\t\t\t\tpreDotState === 0 ||\n\t\t\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t\t\t(preDotState === 1 &&\n\t\t\t\t\tstartDot === end - 1 &&\n\t\t\t\t\tstartDot === startPart + 1)) {\n\t\t\t\tret.base = ret.name = path.slice(start, end);\n\t\t\t} else {\n\t\t\t\tret.name = path.slice(start, startDot);\n\t\t\t\tret.base = path.slice(start, end);\n\t\t\t\tret.ext = path.slice(startDot, end);\n\t\t\t}\n\t\t}\n\n\t\tif (startPart > 0) {\n\t\t\tret.dir = path.slice(0, startPart - 1);\n\t\t} else if (isAbsolute) {\n\t\t\tret.dir = '/';\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tsep: '/',\n\tdelimiter: ':',\n\twin32: null,\n\tposix: null\n};\n\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\n\nexport const normalize = (process.platform === 'win32' ? win32.normalize : posix.normalize);\nexport const resolve = (process.platform === 'win32' ? win32.resolve : posix.resolve);\nexport const relative = (process.platform === 'win32' ? win32.relative : posix.relative);\nexport const dirname = (process.platform === 'win32' ? win32.dirname : posix.dirname);\nexport const basename = (process.platform === 'win32' ? win32.basename : posix.basename);\nexport const extname = (process.platform === 'win32' ? win32.extname : posix.extname);\nexport const sep = (process.platform === 'win32' ? win32.sep : posix.sep);\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\nexport interface IRange {\n\tstart: number;\n\tend: number;\n}\n\nexport namespace Range {\n\n\t/**\n\t * Returns the intersection between two ranges as a range itself.\n\t * Returns `{ start: 0, end: 0 }` if the intersection is empty.\n\t */\n\texport function intersect(one: IRange, other: IRange): IRange {\n\t\tif (one.start >= other.end || other.start >= one.end) {\n\t\t\treturn { start: 0, end: 0 };\n\t\t}\n\n\t\tconst start = Math.max(one.start, other.start);\n\t\tconst end = Math.min(one.end, other.end);\n\n\t\tif (end - start <= 0) {\n\t\t\treturn { start: 0, end: 0 };\n\t\t}\n\n\t\treturn { start, end };\n\t}\n\n\texport function isEmpty(range: IRange): boolean {\n\t\treturn range.end - range.start <= 0;\n\t}\n\n\texport function intersects(one: IRange, other: IRange): boolean {\n\t\treturn !isEmpty(intersect(one, other));\n\t}\n\n\texport function relativeComplement(one: IRange, other: IRange): IRange[] {\n\t\tconst result: IRange[] = [];\n\t\tconst first = { start: one.start, end: Math.min(other.start, one.end) };\n\t\tconst second = { start: Math.max(other.end, one.start), end: one.end };\n\n\t\tif (!isEmpty(first)) {\n\t\t\tresult.push(first);\n\t\t}\n\n\t\tif (!isEmpty(second)) {\n\t\t\tresult.push(second);\n\t\t}\n\n\t\treturn result;\n\t}\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 { IRange, Range } from 'vs/base/common/range';\n\nexport interface IItem {\n\tsize: number;\n}\n\nexport interface IRangedGroup {\n\trange: IRange;\n\tsize: number;\n}\n\n/**\n * Returns the intersection between a ranged group and a range.\n * Returns `[]` if the intersection is empty.\n */\nexport function groupIntersect(range: IRange, groups: IRangedGroup[]): IRangedGroup[] {\n\tconst result: IRangedGroup[] = [];\n\n\tfor (let r of groups) {\n\t\tif (range.start >= r.range.end) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (range.end < r.range.start) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst intersection = Range.intersect(range, r.range);\n\n\t\tif (Range.isEmpty(intersection)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult.push({\n\t\t\trange: intersection,\n\t\t\tsize: r.size\n\t\t});\n\t}\n\n\treturn result;\n}\n\n/**\n * Shifts a range by that `much`.\n */\nexport function shift({ start, end }: IRange, much: number): IRange {\n\treturn { start: start + much, end: end + much };\n}\n\n/**\n * Consolidates a collection of ranged groups.\n *\n * Consolidation is the process of merging consecutive ranged groups\n * that share the same `size`.\n */\nexport function consolidate(groups: IRangedGroup[]): IRangedGroup[] {\n\tconst result: IRangedGroup[] = [];\n\tlet previousGroup: IRangedGroup | null = null;\n\n\tfor (let group of groups) {\n\t\tconst start = group.range.start;\n\t\tconst end = group.range.end;\n\t\tconst size = group.size;\n\n\t\tif (previousGroup && size === previousGroup.size) {\n\t\t\tpreviousGroup.range.end = end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tpreviousGroup = { range: { start, end }, size };\n\t\tresult.push(previousGroup);\n\t}\n\n\treturn result;\n}\n\n/**\n * Concatenates several collections of ranged groups into a single\n * collection.\n */\nfunction concat(...groups: IRangedGroup[][]): IRangedGroup[] {\n\treturn consolidate(groups.reduce((r, g) => r.concat(g), []));\n}\n\nexport class RangeMap {\n\n\tprivate groups: IRangedGroup[] = [];\n\tprivate _size = 0;\n\n\tsplice(index: number, deleteCount: number, items: IItem[] = []): void {\n\t\tconst diff = items.length - deleteCount;\n\t\tconst before = groupIntersect({ start: 0, end: index }, this.groups);\n\t\tconst after = groupIntersect({ start: index + deleteCount, end: Number.POSITIVE_INFINITY }, this.groups)\n\t\t\t.map<IRangedGroup>(g => ({ range: shift(g.range, diff), size: g.size }));\n\n\t\tconst middle = items.map<IRangedGroup>((item, i) => ({\n\t\t\trange: { start: index + i, end: index + i + 1 },\n\t\t\tsize: item.size\n\t\t}));\n\n\t\tthis.groups = concat(before, middle, after);\n\t\tthis._size = this.groups.reduce((t, g) => t + (g.size * (g.range.end - g.range.start)), 0);\n\t}\n\n\t/**\n\t * Returns the number of items in the range map.\n\t */\n\tget count(): number {\n\t\tconst len = this.groups.length;\n\n\t\tif (!len) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.groups[len - 1].range.end;\n\t}\n\n\t/**\n\t * Returns the sum of the sizes of all items in the range map.\n\t */\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\t/**\n\t * Returns the index of the item at the given position.\n\t */\n\tindexAt(position: number): number {\n\t\tif (position < 0) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tlet index = 0;\n\t\tlet size = 0;\n\n\t\tfor (let group of this.groups) {\n\t\t\tconst count = group.range.end - group.range.start;\n\t\t\tconst newSize = size + (count * group.size);\n\n\t\t\tif (position < newSize) {\n\t\t\t\treturn index + Math.floor((position - size) / group.size);\n\t\t\t}\n\n\t\t\tindex += count;\n\t\t\tsize = newSize;\n\t\t}\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * Returns the index of the item right after the item at the\n\t * index of the given position.\n\t */\n\tindexAfter(position: number): number {\n\t\treturn Math.min(this.indexAt(position) + 1, this.count);\n\t}\n\n\t/**\n\t * Returns the start position of the item at the given index.\n\t */\n\tpositionAt(index: number): number {\n\t\tif (index < 0) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tlet position = 0;\n\t\tlet count = 0;\n\n\t\tfor (let group of this.groups) {\n\t\t\tconst groupCount = group.range.end - group.range.start;\n\t\t\tconst newCount = count + groupCount;\n\n\t\t\tif (index < newCount) {\n\t\t\t\treturn position + ((index - count) * group.size);\n\t\t\t}\n\n\t\t\tposition += groupCount * group.size;\n\t\t\tcount = newCount;\n\t\t}\n\n\t\treturn -1;\n\t}\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 { globals } from 'vs/base/common/platform';\n\nconst hasPerformanceNow = (globals.performance && typeof globals.performance.now === 'function');\n\nexport class StopWatch {\n\n\tprivate _highResolution: boolean;\n\tprivate _startTime: number;\n\tprivate _stopTime: number;\n\n\tpublic static create(highResolution: boolean = true): StopWatch {\n\t\treturn new StopWatch(highResolution);\n\t}\n\n\tconstructor(highResolution: boolean) {\n\t\tthis._highResolution = hasPerformanceNow && highResolution;\n\t\tthis._startTime = this._now();\n\t\tthis._stopTime = -1;\n\t}\n\n\tpublic stop(): void {\n\t\tthis._stopTime = this._now();\n\t}\n\n\tpublic elapsed(): number {\n\t\tif (this._stopTime !== -1) {\n\t\t\treturn this._stopTime - this._startTime;\n\t\t}\n\t\treturn this._now() - this._startTime;\n\t}\n\n\tprivate _now(): number {\n\t\treturn this._highResolution ? globals.performance.now() : Date.now();\n\t}\n}\n","\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { combinedDisposable, Disposable, DisposableStore, IDisposable, SafeDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { StopWatch } from 'vs/base/common/stopwatch';\n\n\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever an emitter with listeners is disposed. That is a sign of code smell.\n// -----------------------------------------------------------------------------------------------------------------------\nlet _enableDisposeWithListenerWarning = false;\n// _enableDisposeWithListenerWarning = Boolean(\"TRUE\"); // causes a linter warning so that it cannot be pushed\n\n\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever a snapshotted event is used repeatedly without cleanup.\n// See https://github.com/microsoft/vscode/issues/142851\n// -----------------------------------------------------------------------------------------------------------------------\nlet _enableSnapshotPotentialLeakWarning = false;\n// _enableSnapshotPotentialLeakWarning = Boolean(\"TRUE\"); // causes a linter warning so that it cannot be pushed\n\n/**\n * To an event a function with one or zero parameters\n * can be subscribed. The event is the subscriber function itself.\n */\nexport interface Event<T> {\n\t(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport namespace Event {\n\texport const None: Event<any> = () => Disposable.None;\n\n\n\tfunction _addLeakageTraceLogic(options: EmitterOptions) {\n\t\tif (_enableSnapshotPotentialLeakWarning) {\n\t\t\tconst { onListenerDidAdd: origListenerDidAdd } = options;\n\t\t\tconst stack = Stacktrace.create();\n\t\t\tlet count = 0;\n\t\t\toptions.onListenerDidAdd = () => {\n\t\t\t\tif (++count === 2) {\n\t\t\t\t\tconsole.warn('snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here');\n\t\t\t\t\tstack.print();\n\t\t\t\t}\n\t\t\t\torigListenerDidAdd?.();\n\t\t\t};\n\t\t}\n\t}\n\n\n\t/**\n\t * Given an event, returns another event which only fires once.\n\t */\n\texport function once<T>(event: Event<T>): Event<T> {\n\t\treturn (listener, thisArgs = null, disposables?) => {\n\t\t\t// we need this, in case the event fires during the listener call\n\t\t\tlet didFire = false;\n\t\t\tlet result: IDisposable;\n\t\t\tresult = event(e => {\n\t\t\t\tif (didFire) {\n\t\t\t\t\treturn;\n\t\t\t\t} else if (result) {\n\t\t\t\t\tresult.dispose();\n\t\t\t\t} else {\n\t\t\t\t\tdidFire = true;\n\t\t\t\t}\n\n\t\t\t\treturn listener.call(thisArgs, e);\n\t\t\t}, null, disposables);\n\n\t\t\tif (didFire) {\n\t\t\t\tresult.dispose();\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function map<I, O>(event: Event<I>, map: (i: I) => O, disposable?: DisposableStore): Event<O> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables), disposable);\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function forEach<I>(event: Event<I>, each: (i: I) => void, disposable?: DisposableStore): Event<I> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables), disposable);\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function filter<T, U>(event: Event<T | U>, filter: (e: T | U) => e is T, disposable?: DisposableStore): Event<T>;\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean, disposable?: DisposableStore): Event<T>;\n\texport function filter<T, R>(event: Event<T | R>, filter: (e: T | R) => e is R, disposable?: DisposableStore): Event<R>;\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean, disposable?: DisposableStore): Event<T> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables), disposable);\n\t}\n\n\t/**\n\t * Given an event, returns the same event but typed as `Event<void>`.\n\t */\n\texport function signal<T>(event: Event<T>): Event<void> {\n\t\treturn event as Event<any> as Event<void>;\n\t}\n\n\t/**\n\t * Given a collection of events, returns a single event which emits\n\t * whenever any of the provided events emit.\n\t */\n\texport function any<T>(...events: Event<T>[]): Event<T>;\n\texport function any(...events: Event<any>[]): Event<void>;\n\texport function any<T>(...events: Event<T>[]): Event<T> {\n\t\treturn (listener, thisArgs = null, disposables?) => combinedDisposable(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function reduce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, initial?: O, disposable?: DisposableStore): Event<O> {\n\t\tlet output: O | undefined = initial;\n\n\t\treturn map<I, O>(event, e => {\n\t\t\toutput = merge(output, e);\n\t\t\treturn output;\n\t\t}, disposable);\n\t}\n\n\tfunction snapshot<T>(event: Event<T>, disposable: DisposableStore | undefined): Event<T> {\n\t\tlet listener: IDisposable;\n\n\t\tconst options: EmitterOptions | undefined = {\n\t\t\tonFirstListenerAdd() {\n\t\t\t\tlistener = event(emitter.fire, emitter);\n\t\t\t},\n\t\t\tonLastListenerRemove() {\n\t\t\t\tlistener.dispose();\n\t\t\t}\n\t\t};\n\n\t\tif (!disposable) {\n\t\t\t_addLeakageTraceLogic(options);\n\t\t}\n\n\t\tconst emitter = new Emitter<T>(options);\n\n\t\tif (disposable) {\n\t\t\tdisposable.add(emitter);\n\t\t}\n\n\t\treturn emitter.event;\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<T>;\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O>;\n\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay: number = 100, leading = false, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O> {\n\n\t\tlet subscription: IDisposable;\n\t\tlet output: O | undefined = undefined;\n\t\tlet handle: any = undefined;\n\t\tlet numDebouncedCalls = 0;\n\n\t\tconst options: EmitterOptions | undefined = {\n\t\t\tleakWarningThreshold,\n\t\t\tonFirstListenerAdd() {\n\t\t\t\tsubscription = event(cur => {\n\t\t\t\t\tnumDebouncedCalls++;\n\t\t\t\t\toutput = merge(output, cur);\n\n\t\t\t\t\tif (leading && !handle) {\n\t\t\t\t\t\temitter.fire(output);\n\t\t\t\t\t\toutput = undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tclearTimeout(handle);\n\t\t\t\t\thandle = setTimeout(() => {\n\t\t\t\t\t\tconst _output = output;\n\t\t\t\t\t\toutput = undefined;\n\t\t\t\t\t\thandle = undefined;\n\t\t\t\t\t\tif (!leading || numDebouncedCalls > 1) {\n\t\t\t\t\t\t\temitter.fire(_output!);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnumDebouncedCalls = 0;\n\t\t\t\t\t}, delay);\n\t\t\t\t});\n\t\t\t},\n\t\t\tonLastListenerRemove() {\n\t\t\t\tsubscription.dispose();\n\t\t\t}\n\t\t};\n\n\t\tif (!disposable) {\n\t\t\t_addLeakageTraceLogic(options);\n\t\t}\n\n\t\tconst emitter = new Emitter<O>(options);\n\n\t\tif (disposable) {\n\t\t\tdisposable.add(emitter);\n\t\t}\n\n\t\treturn emitter.event;\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function latch<T>(event: Event<T>, equals: (a: T, b: T) => boolean = (a, b) => a === b, disposable?: DisposableStore): Event<T> {\n\t\tlet firstCall = true;\n\t\tlet cache: T;\n\n\t\treturn filter(event, value => {\n\t\t\tconst shouldEmit = firstCall || !equals(value, cache);\n\t\t\tfirstCall = false;\n\t\t\tcache = value;\n\t\t\treturn shouldEmit;\n\t\t}, disposable);\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function split<T, U>(event: Event<T | U>, isT: (e: T | U) => e is T, disposable?: DisposableStore): [Event<T>, Event<U>] {\n\t\treturn [\n\t\t\tEvent.filter(event, isT, disposable),\n\t\t\tEvent.filter(event, e => !isT(e), disposable) as Event<U>,\n\t\t];\n\t}\n\n\t/**\n\t * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n\t * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n\t * returned event causes this utility to leak a listener on the original event.\n\t */\n\texport function buffer<T>(event: Event<T>, flushAfterTimeout = false, _buffer: T[] = []): Event<T> {\n\t\tlet buffer: T[] | null = _buffer.slice();\n\n\t\tlet listener: IDisposable | null = event(e => {\n\t\t\tif (buffer) {\n\t\t\t\tbuffer.push(e);\n\t\t\t} else {\n\t\t\t\temitter.fire(e);\n\t\t\t}\n\t\t});\n\n\t\tconst flush = () => {\n\t\t\tif (buffer) {\n\t\t\t\tbuffer.forEach(e => emitter.fire(e));\n\t\t\t}\n\t\t\tbuffer = null;\n\t\t};\n\n\t\tconst emitter = new Emitter<T>({\n\t\t\tonFirstListenerAdd() {\n\t\t\t\tif (!listener) {\n\t\t\t\t\tlistener = event(e => emitter.fire(e));\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonFirstListenerDidAdd() {\n\t\t\t\tif (buffer) {\n\t\t\t\t\tif (flushAfterTimeout) {\n\t\t\t\t\t\tsetTimeout(flush);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tflush();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonLastListenerRemove() {\n\t\t\t\tif (listener) {\n\t\t\t\t\tlistener.dispose();\n\t\t\t\t}\n\t\t\t\tlistener = null;\n\t\t\t}\n\t\t});\n\n\t\treturn emitter.event;\n\t}\n\n\texport interface IChainableEvent<T> {\n\n\t\tevent: Event<T>;\n\t\tmap<O>(fn: (i: T) => O): IChainableEvent<O>;\n\t\tforEach(fn: (i: T) => void): IChainableEvent<T>;\n\t\tfilter(fn: (e: T) => boolean): IChainableEvent<T>;\n\t\tfilter<R>(fn: (e: T | R) => e is R): IChainableEvent<R>;\n\t\treduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R>;\n\t\tlatch(): IChainableEvent<T>;\n\t\tdebounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;\n\t\ton(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n\t\tonce(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;\n\t}\n\n\tclass ChainableEvent<T> implements IChainableEvent<T> {\n\n\t\tconstructor(readonly event: Event<T>) { }\n\n\t\tmap<O>(fn: (i: T) => O): IChainableEvent<O> {\n\t\t\treturn new ChainableEvent(map(this.event, fn));\n\t\t}\n\n\t\tforEach(fn: (i: T) => void): IChainableEvent<T> {\n\t\t\treturn new ChainableEvent(forEach(this.event, fn));\n\t\t}\n\n\t\tfilter(fn: (e: T) => boolean): IChainableEvent<T>;\n\t\tfilter<R>(fn: (e: T | R) => e is R): IChainableEvent<R>;\n\t\tfilter(fn: (e: T) => boolean): IChainableEvent<T> {\n\t\t\treturn new ChainableEvent(filter(this.event, fn));\n\t\t}\n\n\t\treduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R> {\n\t\t\treturn new ChainableEvent(reduce(this.event, merge, initial));\n\t\t}\n\n\t\tlatch(): IChainableEvent<T> {\n\t\t\treturn new ChainableEvent(latch(this.event));\n\t\t}\n\n\t\tdebounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;\n\t\tdebounce<R>(merge: (last: R | undefined, event: T) => R, delay: number = 100, leading = false, leakWarningThreshold?: number): IChainableEvent<R> {\n\t\t\treturn new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));\n\t\t}\n\n\t\ton(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[] | DisposableStore) {\n\t\t\treturn this.event(listener, thisArgs, disposables);\n\t\t}\n\n\t\tonce(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[]) {\n\t\t\treturn once(this.event)(listener, thisArgs, disposables);\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated DO NOT use, this leaks memory\n\t */\n\texport function chain<T>(event: Event<T>): IChainableEvent<T> {\n\t\treturn new ChainableEvent(event);\n\t}\n\n\texport interface NodeEventEmitter {\n\t\ton(event: string | symbol, listener: Function): unknown;\n\t\tremoveListener(event: string | symbol, listener: Function): unknown;\n\t}\n\n\texport function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event<T> {\n\t\tconst fn = (...args: any[]) => result.fire(map(...args));\n\t\tconst onFirstListenerAdd = () => emitter.on(eventName, fn);\n\t\tconst onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n\t\tconst result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });\n\n\t\treturn result.event;\n\t}\n\n\texport interface DOMEventEmitter {\n\t\taddEventListener(event: string | symbol, listener: Function): void;\n\t\tremoveEventListener(event: string | symbol, listener: Function): void;\n\t}\n\n\texport function fromDOMEventEmitter<T>(emitter: DOMEventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event<T> {\n\t\tconst fn = (...args: any[]) => result.fire(map(...args));\n\t\tconst onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\n\t\tconst onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\n\t\tconst result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });\n\n\t\treturn result.event;\n\t}\n\n\texport function toPromise<T>(event: Event<T>): Promise<T> {\n\t\treturn new Promise(resolve => once(event)(resolve));\n\t}\n\n\texport function runAndSubscribe<T>(event: Event<T>, handler: (e: T | undefined) => any): IDisposable {\n\t\thandler(undefined);\n\t\treturn event(e => handler(e));\n\t}\n\n\texport function runAndSubscribeWithStore<T>(event: Event<T>, handler: (e: T | undefined, disposableStore: DisposableStore) => any): IDisposable {\n\t\tlet store: DisposableStore | null = null;\n\n\t\tfunction run(e: T | undefined) {\n\t\t\tstore?.dispose();\n\t\t\tstore = new DisposableStore();\n\t\t\thandler(e, store);\n\t\t}\n\n\t\trun(undefined);\n\t\tconst disposable = event(e => run(e));\n\t\treturn toDisposable(() => {\n\t\t\tdisposable.dispose();\n\t\t\tstore?.dispose();\n\t\t});\n\t}\n}\n\nexport interface EmitterOptions {\n\tonFirstListenerAdd?: Function;\n\tonFirstListenerDidAdd?: Function;\n\tonListenerDidAdd?: Function;\n\tonLastListenerRemove?: Function;\n\tleakWarningThreshold?: number;\n\n\t/** ONLY enable this during development */\n\t_profName?: string;\n}\n\n\nclass EventProfiling {\n\n\tprivate static _idPool = 0;\n\n\tprivate _name: string;\n\tprivate _stopWatch?: StopWatch;\n\tprivate _listenerCount: number = 0;\n\tprivate _invocationCount = 0;\n\tprivate _elapsedOverall = 0;\n\n\tconstructor(name: string) {\n\t\tthis._name = `${name}_${EventProfiling._idPool++}`;\n\t}\n\n\tstart(listenerCount: number): void {\n\t\tthis._stopWatch = new StopWatch(true);\n\t\tthis._listenerCount = listenerCount;\n\t}\n\n\tstop(): void {\n\t\tif (this._stopWatch) {\n\t\t\tconst elapsed = this._stopWatch.elapsed();\n\t\t\tthis._elapsedOverall += elapsed;\n\t\t\tthis._invocationCount += 1;\n\n\t\t\tconsole.info(`did FIRE ${this._name}: elapsed_ms: ${elapsed.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`);\n\t\t\tthis._stopWatch = undefined;\n\t\t}\n\t}\n}\n\nlet _globalLeakWarningThreshold = -1;\n\nclass LeakageMonitor {\n\n\tprivate _stacks: Map<string, number> | undefined;\n\tprivate _warnCountdown: number = 0;\n\n\tconstructor(\n\t\treadonly customThreshold?: number,\n\t\treadonly name: string = Math.random().toString(18).slice(2, 5),\n\t) { }\n\n\tdispose(): void {\n\t\tif (this._stacks) {\n\t\t\tthis._stacks.clear();\n\t\t}\n\t}\n\n\tcheck(stack: Stacktrace, listenerCount: number): undefined | (() => void) {\n\n\t\tlet threshold = _globalLeakWarningThreshold;\n\t\tif (typeof this.customThreshold === 'number') {\n\t\t\tthreshold = this.customThreshold;\n\t\t}\n\n\t\tif (threshold <= 0 || listenerCount < threshold) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (!this._stacks) {\n\t\t\tthis._stacks = new Map();\n\t\t}\n\t\tconst count = (this._stacks.get(stack.value) || 0);\n\t\tthis._stacks.set(stack.value, count + 1);\n\t\tthis._warnCountdown -= 1;\n\n\t\tif (this._warnCountdown <= 0) {\n\t\t\t// only warn on first exceed and then every time the limit\n\t\t\t// is exceeded by 50% again\n\t\t\tthis._warnCountdown = threshold * 0.5;\n\n\t\t\t// find most frequent listener and print warning\n\t\t\tlet topStack: string | undefined;\n\t\t\tlet topCount: number = 0;\n\t\t\tfor (const [stack, count] of this._stacks) {\n\t\t\t\tif (!topStack || topCount < count) {\n\t\t\t\t\ttopStack = stack;\n\t\t\t\t\ttopCount = count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconsole.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\n\t\t\tconsole.warn(topStack!);\n\t\t}\n\n\t\treturn () => {\n\t\t\tconst count = (this._stacks!.get(stack.value) || 0);\n\t\t\tthis._stacks!.set(stack.value, count - 1);\n\t\t};\n\t}\n}\n\nclass Stacktrace {\n\n\tstatic create() {\n\t\treturn new Stacktrace(new Error().stack ?? '');\n\t}\n\n\tprivate constructor(readonly value: string) { }\n\n\tprint() {\n\t\tconsole.warn(this.value.split('\\n').slice(2).join('\\n'));\n\t}\n}\n\nclass Listener<T> {\n\n\treadonly subscription = new SafeDisposable();\n\n\tconstructor(\n\t\treadonly callback: (e: T) => void,\n\t\treadonly callbackThis: any | undefined,\n\t\treadonly stack: Stacktrace | undefined\n\t) { }\n\n\tinvoke(e: T) {\n\t\tthis.callback.call(this.callbackThis, e);\n\t}\n}\n\n/**\n * The Emitter can be used to expose an Event to the public\n * to fire it from the insides.\n * Sample:\n\tclass Document {\n\n\t\tprivate readonly _onDidChange = new Emitter<(value:string)=>any>();\n\n\t\tpublic onDidChange = this._onDidChange.event;\n\n\t\t// getter-style\n\t\t// get onDidChange(): Event<(value:string)=>any> {\n\t\t// \treturn this._onDidChange.event;\n\t\t// }\n\n\t\tprivate _doIt() {\n\t\t\t//...\n\t\t\tthis._onDidChange.fire(value);\n\t\t}\n\t}\n */\nexport class Emitter<T> {\n\n\tprivate readonly _options?: EmitterOptions;\n\tprivate readonly _leakageMon?: LeakageMonitor;\n\tprivate readonly _perfMon?: EventProfiling;\n\tprivate _disposed: boolean = false;\n\tprivate _event?: Event<T>;\n\tprivate _deliveryQueue?: LinkedList<[Listener<T>, T]>;\n\tprotected _listeners?: LinkedList<Listener<T>>;\n\n\tconstructor(options?: EmitterOptions) {\n\t\tthis._options = options;\n\t\tthis._leakageMon = _globalLeakWarningThreshold > 0 ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) : undefined;\n\t\tthis._perfMon = this._options?._profName ? new EventProfiling(this._options._profName) : undefined;\n\t}\n\n\tdispose() {\n\t\tif (!this._disposed) {\n\t\t\tthis._disposed = true;\n\n\t\t\t// It is bad to have listeners at the time of disposing an emitter, it is worst to have listeners keep the emitter\n\t\t\t// alive via the reference that's embedded in their disposables. Therefore we loop over all remaining listeners and\n\t\t\t// unset their subscriptions/disposables. Looping and blaming remaining listeners is done on next tick because the\n\t\t\t// the following programming pattern is very popular:\n\t\t\t//\n\t\t\t// const someModel = this._disposables.add(new ModelObject()); // (1) create and register model\n\t\t\t// this._disposables.add(someModel.onDidChange(() => { ... }); // (2) subscribe and register model-event listener\n\t\t\t// ...later...\n\t\t\t// this._disposables.dispose(); disposes (1) then (2): don't warn after (1) but after the \"overall dispose\" is done\n\n\t\t\tif (this._listeners) {\n\t\t\t\tif (_enableDisposeWithListenerWarning) {\n\t\t\t\t\tconst listeners = Array.from(this._listeners);\n\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\t\tif (listener.subscription.isset()) {\n\t\t\t\t\t\t\t\tlistener.subscription.unset();\n\t\t\t\t\t\t\t\tlistener.stack?.print();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._listeners.clear();\n\t\t\t}\n\t\t\tthis._deliveryQueue?.clear();\n\t\t\tthis._options?.onLastListenerRemove?.();\n\t\t\tthis._leakageMon?.dispose();\n\t\t}\n\t}\n\n\t/**\n\t * For the public to allow to subscribe\n\t * to events from this Emitter\n\t */\n\tget event(): Event<T> {\n\t\tif (!this._event) {\n\t\t\tthis._event = (callback: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n\t\t\t\tif (!this._listeners) {\n\t\t\t\t\tthis._listeners = new LinkedList();\n\t\t\t\t}\n\n\t\t\t\tconst firstListener = this._listeners.isEmpty();\n\n\t\t\t\tif (firstListener && this._options?.onFirstListenerAdd) {\n\t\t\t\t\tthis._options.onFirstListenerAdd(this);\n\t\t\t\t}\n\n\t\t\t\tlet removeMonitor: Function | undefined;\n\t\t\t\tlet stack: Stacktrace | undefined;\n\t\t\t\tif (this._leakageMon && this._listeners.size >= 30) {\n\t\t\t\t\t// check and record this emitter for potential leakage\n\t\t\t\t\tstack = Stacktrace.create();\n\t\t\t\t\tremoveMonitor = this._leakageMon.check(stack, this._listeners.size + 1);\n\t\t\t\t}\n\n\t\t\t\tif (_enableDisposeWithListenerWarning) {\n\t\t\t\t\tstack = stack ?? Stacktrace.create();\n\t\t\t\t}\n\n\t\t\t\tconst listener = new Listener(callback, thisArgs, stack);\n\t\t\t\tconst removeListener = this._listeners.push(listener);\n\n\t\t\t\tif (firstListener && this._options?.onFirstListenerDidAdd) {\n\t\t\t\t\tthis._options.onFirstListenerDidAdd(this);\n\t\t\t\t}\n\n\t\t\t\tif (this._options?.onListenerDidAdd) {\n\t\t\t\t\tthis._options.onListenerDidAdd(this, callback, thisArgs);\n\t\t\t\t}\n\n\t\t\t\tconst result = listener.subscription.set(() => {\n\t\t\t\t\tif (removeMonitor) {\n\t\t\t\t\t\tremoveMonitor();\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._disposed) {\n\t\t\t\t\t\tremoveListener();\n\t\t\t\t\t\tif (this._options && this._options.onLastListenerRemove) {\n\t\t\t\t\t\t\tconst hasListeners = (this._listeners && !this._listeners.isEmpty());\n\t\t\t\t\t\t\tif (!hasListeners) {\n\t\t\t\t\t\t\t\tthis._options.onLastListenerRemove(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (disposables instanceof DisposableStore) {\n\t\t\t\t\tdisposables.add(result);\n\t\t\t\t} else if (Array.isArray(disposables)) {\n\t\t\t\t\tdisposables.push(result);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t\treturn this._event;\n\t}\n\n\t/**\n\t * To be kept private to fire an event to\n\t * subscribers\n\t */\n\tfire(event: T): void {\n\t\tif (this._listeners) {\n\t\t\t// put all [listener,event]-pairs into delivery queue\n\t\t\t// then emit all event. an inner/nested event might be\n\t\t\t// the driver of this\n\n\t\t\tif (!this._deliveryQueue) {\n\t\t\t\tthis._deliveryQueue = new LinkedList();\n\t\t\t}\n\n\t\t\tfor (let listener of this._listeners) {\n\t\t\t\tthis._deliveryQueue.push([listener, event]);\n\t\t\t}\n\n\t\t\t// start/stop performance insight collection\n\t\t\tthis._perfMon?.start(this._deliveryQueue.size);\n\n\t\t\twhile (this._deliveryQueue.size > 0) {\n\t\t\t\tconst [listener, event] = this._deliveryQueue.shift()!;\n\t\t\t\ttry {\n\t\t\t\t\tlistener.invoke(event);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._perfMon?.stop();\n\t\t}\n\t}\n}\n\n\nexport class PauseableEmitter<T> extends Emitter<T> {\n\n\tprivate _isPaused = 0;\n\tprotected _eventQueue = new LinkedList<T>();\n\tprivate _mergeFn?: (input: T[]) => T;\n\n\tconstructor(options?: EmitterOptions & { merge?: (input: T[]) => T }) {\n\t\tsuper(options);\n\t\tthis._mergeFn = options?.merge;\n\t}\n\n\tpause(): void {\n\t\tthis._isPaused++;\n\t}\n\n\tresume(): void {\n\t\tif (this._isPaused !== 0 && --this._isPaused === 0) {\n\t\t\tif (this._mergeFn) {\n\t\t\t\t// use the merge function to create a single composite\n\t\t\t\t// event. make a copy in case firing pauses this emitter\n\t\t\t\tconst events = Array.from(this._eventQueue);\n\t\t\t\tthis._eventQueue.clear();\n\t\t\t\tsuper.fire(this._mergeFn(events));\n\n\t\t\t} else {\n\t\t\t\t// no merging, fire each event individually and test\n\t\t\t\t// that this emitter isn't paused halfway through\n\t\t\t\twhile (!this._isPaused && this._eventQueue.size !== 0) {\n\t\t\t\t\tsuper.fire(this._eventQueue.shift()!);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\toverride fire(event: T): void {\n\t\tif (this._listeners) {\n\t\t\tif (this._isPaused !== 0) {\n\t\t\t\tthis._eventQueue.push(event);\n\t\t\t} else {\n\t\t\t\tsuper.fire(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class DebounceEmitter<T> extends PauseableEmitter<T> {\n\n\tprivate readonly _delay: number;\n\tprivate _handle: any | undefined;\n\n\tconstructor(options: EmitterOptions & { merge: (input: T[]) => T; delay?: number }) {\n\t\tsuper(options);\n\t\tthis._delay = options.delay ?? 100;\n\t}\n\n\toverride fire(event: T): void {\n\t\tif (!this._handle) {\n\t\t\tthis.pause();\n\t\t\tthis._handle = setTimeout(() => {\n\t\t\t\tthis._handle = undefined;\n\t\t\t\tthis.resume();\n\t\t\t}, this._delay);\n\t\t}\n\t\tsuper.fire(event);\n\t}\n}\n\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nexport class EventBufferer {\n\n\tprivate buffers: Function[][] = [];\n\n\twrapEvent<T>(event: Event<T>): Event<T> {\n\t\treturn (listener, thisArgs?, disposables?) => {\n\t\t\treturn event(i => {\n\t\t\t\tconst buffer = this.buffers[this.buffers.length - 1];\n\n\t\t\t\tif (buffer) {\n\t\t\t\t\tbuffer.push(() => listener.call(thisArgs, i));\n\t\t\t\t} else {\n\t\t\t\t\tlistener.call(thisArgs, i);\n\t\t\t\t}\n\t\t\t}, undefined, disposables);\n\t\t};\n\t}\n\n\tbufferEvents<R = void>(fn: () => R): R {\n\t\tconst buffer: Array<() => R> = [];\n\t\tthis.buffers.push(buffer);\n\t\tconst r = fn();\n\t\tthis.buffers.pop();\n\t\tbuffer.forEach(flush => flush());\n\t\treturn r;\n\t}\n}\n\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nexport class Relay<T> implements IDisposable {\n\n\tprivate listening = false;\n\tprivate inputEvent: Event<T> = Event.None;\n\tprivate inputEventListener: IDisposable = Disposable.None;\n\n\tprivate readonly emitter = new Emitter<T>({\n\t\tonFirstListenerDidAdd: () => {\n\t\t\tthis.listening = true;\n\t\t\tthis.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n\t\t},\n\t\tonLastListenerRemove: () => {\n\t\t\tthis.listening = false;\n\t\t\tthis.inputEventListener.dispose();\n\t\t}\n\t});\n\n\treadonly event: Event<T> = this.emitter.event;\n\n\tset input(event: Event<T>) {\n\t\tthis.inputEvent = event;\n\n\t\tif (this.listening) {\n\t\t\tthis.inputEventListener.dispose();\n\t\t\tthis.inputEventListener = event(this.emitter.fire, this.emitter);\n\t\t}\n\t}\n\n\tdispose() {\n\t\tthis.inputEventListener.dispose();\n\t\tthis.emitter.dispose();\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nclass WindowManager {\n\n\tpublic static readonly INSTANCE = new WindowManager();\n\n\t// --- Zoom Factor\n\tprivate _zoomFactor: number = 1;\n\n\tpublic getZoomFactor(): number {\n\t\treturn this._zoomFactor;\n\t}\n}\n\n/**\n * See https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes\n */\nclass DevicePixelRatioMonitor extends Disposable {\n\n\tprivate readonly _onDidChange = this._register(new Emitter<void>());\n\tpublic readonly onDidChange = this._onDidChange.event;\n\n\tprivate readonly _listener: () => void;\n\tprivate _mediaQueryList: MediaQueryList | null;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._listener = () => this._handleChange(true);\n\t\tthis._mediaQueryList = null;\n\t\tthis._handleChange(false);\n\t}\n\n\tprivate _handleChange(fireEvent: boolean): void {\n\t\tif (this._mediaQueryList) {\n\t\t\tthis._mediaQueryList.removeEventListener('change', this._listener);\n\t\t}\n\n\t\tthis._mediaQueryList = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n\t\tthis._mediaQueryList.addEventListener('change', this._listener);\n\n\t\tif (fireEvent) {\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n\nclass PixelRatioImpl extends Disposable {\n\n\tprivate readonly _onDidChange = this._register(new Emitter<number>());\n\tpublic readonly onDidChange = this._onDidChange.event;\n\n\tprivate _value: number;\n\n\tpublic get value(): number {\n\t\treturn this._value;\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._value = this._getPixelRatio();\n\n\t\tconst dprMonitor = this._register(new DevicePixelRatioMonitor());\n\t\tthis._register(dprMonitor.onDidChange(() => {\n\t\t\tthis._value = this._getPixelRatio();\n\t\t\tthis._onDidChange.fire(this._value);\n\t\t}));\n\t}\n\n\tprivate _getPixelRatio(): number {\n\t\tconst ctx: any = document.createElement('canvas').getContext('2d');\n\t\tconst dpr = window.devicePixelRatio || 1;\n\t\tconst bsr = ctx.webkitBackingStorePixelRatio ||\n\t\t\tctx.mozBackingStorePixelRatio ||\n\t\t\tctx.msBackingStorePixelRatio ||\n\t\t\tctx.oBackingStorePixelRatio ||\n\t\t\tctx.backingStorePixelRatio || 1;\n\t\treturn dpr / bsr;\n\t}\n}\n\nclass PixelRatioFacade {\n\n\tprivate _pixelRatioMonitor: PixelRatioImpl | null = null;\n\tprivate _getOrCreatePixelRatioMonitor(): PixelRatioImpl {\n\t\tif (!this._pixelRatioMonitor) {\n\t\t\tthis._pixelRatioMonitor = new PixelRatioImpl();\n\t\t}\n\t\treturn this._pixelRatioMonitor;\n\t}\n\n\t/**\n\t * Get the current value.\n\t */\n\tpublic get value(): number {\n\t\treturn this._getOrCreatePixelRatioMonitor().value;\n\t}\n\n\t/**\n\t * Listen for changes.\n\t */\n\tpublic get onDidChange(): Event<number> {\n\t\treturn this._getOrCreatePixelRatioMonitor().onDidChange;\n\t}\n}\n\n/**\n * Returns the pixel ratio.\n *\n * This is useful for rendering <canvas> elements at native screen resolution or for being used as\n * a cache key when storing font measurements. Fonts might render differently depending on resolution\n * and any measurements need to be discarded for example when a window is moved from a monitor to another.\n */\nexport const PixelRatio = new PixelRatioFacade();\n\n/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */\nexport function getZoomFactor(): number {\n\treturn WindowManager.INSTANCE.getZoomFactor();\n}\n\nconst userAgent = navigator.userAgent;\n\nexport const isFirefox = (userAgent.indexOf('Firefox') >= 0);\nexport const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0);\nexport const isChrome = (userAgent.indexOf('Chrome') >= 0);\nexport const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0));\nexport const isWebkitWebView = (!isChrome && !isSafari && isWebKit);\nexport const isElectron = (userAgent.indexOf('Electron/') >= 0);\nexport const isAndroid = (userAgent.indexOf('Android') >= 0);\nexport const isStandalone = (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches);\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 * as browser from 'vs/base/browser/browser';\nimport * as platform from 'vs/base/common/platform';\n\nexport const enum KeyboardSupport {\n\tAlways,\n\tFullScreen,\n\tNone\n}\n\n/**\n * Browser feature we can support in current platform, browser and environment.\n */\nexport const BrowserFeatures = {\n\tclipboard: {\n\t\twriteText: (\n\t\t\tplatform.isNative\n\t\t\t|| (document.queryCommandSupported && document.queryCommandSupported('copy'))\n\t\t\t|| !!(navigator && navigator.clipboard && navigator.clipboard.writeText)\n\t\t),\n\t\treadText: (\n\t\t\tplatform.isNative\n\t\t\t|| !!(navigator && navigator.clipboard && navigator.clipboard.readText)\n\t\t)\n\t},\n\tkeyboard: (() => {\n\t\tif (platform.isNative || browser.isStandalone) {\n\t\t\treturn KeyboardSupport.Always;\n\t\t}\n\n\t\tif ((<any>navigator).keyboard || browser.isSafari) {\n\t\t\treturn KeyboardSupport.FullScreen;\n\t\t}\n\n\t\treturn KeyboardSupport.None;\n\t})(),\n\n\t// 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be\n\t// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast\n\ttouch: 'ontouchstart' in window || navigator.maxTouchPoints > 0,\n\tpointerEvents: window.PointerEvent && ('ontouchstart' in window || (window as Window).navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0)\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 { GestureEvent } from 'vs/base/browser/touch';\nimport { Emitter, Event as BaseEvent } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\n\nexport type EventHandler = HTMLElement | HTMLDocument | Window;\n\nexport interface DOMEventMap extends HTMLElementEventMap, DocumentEventMap, WindowEventMap {\n\t'-monaco-gesturetap': GestureEvent;\n\t'-monaco-gesturechange': GestureEvent;\n\t'-monaco-gesturestart': GestureEvent;\n\t'-monaco-gesturesend': GestureEvent;\n\t'-monaco-gesturecontextmenu': GestureEvent;\n}\n\nexport class DomEmitter<K extends keyof DOMEventMap> implements IDisposable {\n\n\tprivate emitter: Emitter<DOMEventMap[K]>;\n\n\tget event(): BaseEvent<DOMEventMap[K]> {\n\t\treturn this.emitter.event;\n\t}\n\n\tconstructor(element: Window & typeof globalThis, type: WindowEventMap, useCapture?: boolean);\n\tconstructor(element: Document, type: DocumentEventMap, useCapture?: boolean);\n\tconstructor(element: EventHandler, type: K, useCapture?: boolean);\n\tconstructor(element: EventHandler, type: K, useCapture?: boolean) {\n\t\tconst fn = (e: Event) => this.emitter.fire(e as DOMEventMap[K]);\n\t\tthis.emitter = new Emitter({\n\t\t\tonFirstListenerAdd: () => element.addEventListener(type, fn, useCapture),\n\t\t\tonLastListenerRemove: () => element.removeEventListener(type, fn, useCapture)\n\t\t});\n\t}\n\n\tdispose(): void {\n\t\tthis.emitter.dispose();\n\t}\n}\n\nexport interface CancellableEvent {\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport function stopEvent<T extends CancellableEvent>(event: T): T {\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn event;\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 * as browser from 'vs/base/browser/browser';\nimport { EVENT_KEY_CODE_MAP, KeyCode, KeyCodeUtils, KeyMod } from 'vs/base/common/keyCodes';\nimport { SimpleKeybinding } from 'vs/base/common/keybindings';\nimport * as platform from 'vs/base/common/platform';\n\n\n\nfunction extractKeyCode(e: KeyboardEvent): KeyCode {\n\tif (e.charCode) {\n\t\t// \"keypress\" events mostly\n\t\tlet char = String.fromCharCode(e.charCode).toUpperCase();\n\t\treturn KeyCodeUtils.fromString(char);\n\t}\n\n\tconst keyCode = e.keyCode;\n\n\t// browser quirks\n\tif (keyCode === 3) {\n\t\treturn KeyCode.PauseBreak;\n\t} else if (browser.isFirefox) {\n\t\tif (keyCode === 59) {\n\t\t\treturn KeyCode.Semicolon;\n\t\t} else if (keyCode === 107) {\n\t\t\treturn KeyCode.Equal;\n\t\t} else if (keyCode === 109) {\n\t\t\treturn KeyCode.Minus;\n\t\t} else if (platform.isMacintosh && keyCode === 224) {\n\t\t\treturn KeyCode.Meta;\n\t\t}\n\t} else if (browser.isWebKit) {\n\t\tif (keyCode === 91) {\n\t\t\treturn KeyCode.Meta;\n\t\t} else if (platform.isMacintosh && keyCode === 93) {\n\t\t\t// the two meta keys in the Mac have different key codes (91 and 93)\n\t\t\treturn KeyCode.Meta;\n\t\t} else if (!platform.isMacintosh && keyCode === 92) {\n\t\t\treturn KeyCode.Meta;\n\t\t}\n\t}\n\n\t// cross browser keycodes:\n\treturn EVENT_KEY_CODE_MAP[keyCode] || KeyCode.Unknown;\n}\n\nexport interface IKeyboardEvent {\n\n\treadonly _standardKeyboardEventBrand: true;\n\n\treadonly browserEvent: KeyboardEvent;\n\treadonly target: HTMLElement;\n\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly keyCode: KeyCode;\n\treadonly code: string;\n\n\t/**\n\t * @internal\n\t */\n\ttoKeybinding(): SimpleKeybinding;\n\tequals(keybinding: number): boolean;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nconst ctrlKeyMod = (platform.isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd);\nconst altKeyMod = KeyMod.Alt;\nconst shiftKeyMod = KeyMod.Shift;\nconst metaKeyMod = (platform.isMacintosh ? KeyMod.CtrlCmd : KeyMod.WinCtrl);\n\nexport class StandardKeyboardEvent implements IKeyboardEvent {\n\n\treadonly _standardKeyboardEventBrand = true;\n\n\tpublic readonly browserEvent: KeyboardEvent;\n\tpublic readonly target: HTMLElement;\n\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly keyCode: KeyCode;\n\tpublic readonly code: string;\n\n\tprivate _asKeybinding: number;\n\tprivate _asRuntimeKeybinding: SimpleKeybinding;\n\n\tconstructor(source: KeyboardEvent) {\n\t\tlet e = source;\n\n\t\tthis.browserEvent = e;\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\t\tthis.keyCode = extractKeyCode(e);\n\t\tthis.code = e.code;\n\n\t\t// console.info(e.type + \": keyCode: \" + e.keyCode + \", which: \" + e.which + \", charCode: \" + e.charCode + \", detail: \" + e.detail + \" ====> \" + this.keyCode + ' -- ' + KeyCode[this.keyCode]);\n\n\t\tthis.ctrlKey = this.ctrlKey || this.keyCode === KeyCode.Ctrl;\n\t\tthis.altKey = this.altKey || this.keyCode === KeyCode.Alt;\n\t\tthis.shiftKey = this.shiftKey || this.keyCode === KeyCode.Shift;\n\t\tthis.metaKey = this.metaKey || this.keyCode === KeyCode.Meta;\n\n\t\tthis._asKeybinding = this._computeKeybinding();\n\t\tthis._asRuntimeKeybinding = this._computeRuntimeKeybinding();\n\n\t\t// console.log(`code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`);\n\t}\n\n\tpublic preventDefault(): void {\n\t\tif (this.browserEvent && this.browserEvent.preventDefault) {\n\t\t\tthis.browserEvent.preventDefault();\n\t\t}\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tif (this.browserEvent && this.browserEvent.stopPropagation) {\n\t\t\tthis.browserEvent.stopPropagation();\n\t\t}\n\t}\n\n\tpublic toKeybinding(): SimpleKeybinding {\n\t\treturn this._asRuntimeKeybinding;\n\t}\n\n\tpublic equals(other: number): boolean {\n\t\treturn this._asKeybinding === other;\n\t}\n\n\tprivate _computeKeybinding(): number {\n\t\tlet key = KeyCode.Unknown;\n\t\tif (this.keyCode !== KeyCode.Ctrl && this.keyCode !== KeyCode.Shift && this.keyCode !== KeyCode.Alt && this.keyCode !== KeyCode.Meta) {\n\t\t\tkey = this.keyCode;\n\t\t}\n\n\t\tlet result = 0;\n\t\tif (this.ctrlKey) {\n\t\t\tresult |= ctrlKeyMod;\n\t\t}\n\t\tif (this.altKey) {\n\t\t\tresult |= altKeyMod;\n\t\t}\n\t\tif (this.shiftKey) {\n\t\t\tresult |= shiftKeyMod;\n\t\t}\n\t\tif (this.metaKey) {\n\t\t\tresult |= metaKeyMod;\n\t\t}\n\t\tresult |= key;\n\n\t\treturn result;\n\t}\n\n\tprivate _computeRuntimeKeybinding(): SimpleKeybinding {\n\t\tlet key = KeyCode.Unknown;\n\t\tif (this.keyCode !== KeyCode.Ctrl && this.keyCode !== KeyCode.Shift && this.keyCode !== KeyCode.Alt && this.keyCode !== KeyCode.Meta) {\n\t\t\tkey = this.keyCode;\n\t\t}\n\t\treturn new SimpleKeybinding(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, key);\n\t}\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 * as browser from 'vs/base/browser/browser';\nimport { IframeUtils } from 'vs/base/browser/iframe';\nimport * as platform from 'vs/base/common/platform';\n\nexport interface IMouseEvent {\n\treadonly browserEvent: MouseEvent;\n\treadonly leftButton: boolean;\n\treadonly middleButton: boolean;\n\treadonly rightButton: boolean;\n\treadonly buttons: number;\n\treadonly target: HTMLElement;\n\treadonly detail: number;\n\treadonly posx: number;\n\treadonly posy: number;\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly timestamp: number;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport class StandardMouseEvent implements IMouseEvent {\n\n\tpublic readonly browserEvent: MouseEvent;\n\n\tpublic readonly leftButton: boolean;\n\tpublic readonly middleButton: boolean;\n\tpublic readonly rightButton: boolean;\n\tpublic readonly buttons: number;\n\tpublic readonly target: HTMLElement;\n\tpublic detail: number;\n\tpublic readonly posx: number;\n\tpublic readonly posy: number;\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly timestamp: number;\n\n\tconstructor(e: MouseEvent) {\n\t\tthis.timestamp = Date.now();\n\t\tthis.browserEvent = e;\n\t\tthis.leftButton = e.button === 0;\n\t\tthis.middleButton = e.button === 1;\n\t\tthis.rightButton = e.button === 2;\n\t\tthis.buttons = e.buttons;\n\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.detail = e.detail || 1;\n\t\tif (e.type === 'dblclick') {\n\t\t\tthis.detail = 2;\n\t\t}\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\n\t\tif (typeof e.pageX === 'number') {\n\t\t\tthis.posx = e.pageX;\n\t\t\tthis.posy = e.pageY;\n\t\t} else {\n\t\t\t// Probably hit by MSGestureEvent\n\t\t\tthis.posx = e.clientX + document.body.scrollLeft + document.documentElement!.scrollLeft;\n\t\t\tthis.posy = e.clientY + document.body.scrollTop + document.documentElement!.scrollTop;\n\t\t}\n\n\t\t// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n\t\tlet iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(self, e.view);\n\t\tthis.posx -= iframeOffsets.left;\n\t\tthis.posy -= iframeOffsets.top;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent.stopPropagation();\n\t}\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: number;\n\treadonly wheelDeltaX: number;\n\treadonly wheelDeltaY: number;\n\n\treadonly deltaX: number;\n\treadonly deltaY: number;\n\treadonly deltaZ: number;\n\treadonly deltaMode: number;\n}\n\ninterface IWebKitMouseWheelEvent {\n\twheelDeltaY: number;\n\twheelDeltaX: number;\n}\n\ninterface IGeckoMouseWheelEvent {\n\tHORIZONTAL_AXIS: number;\n\tVERTICAL_AXIS: number;\n\taxis: number;\n\tdetail: number;\n}\n\nexport class StandardWheelEvent {\n\n\tpublic readonly browserEvent: IMouseWheelEvent | null;\n\tpublic readonly deltaY: number;\n\tpublic readonly deltaX: number;\n\tpublic readonly target: Node;\n\n\tconstructor(e: IMouseWheelEvent | null, deltaX: number = 0, deltaY: number = 0) {\n\n\t\tthis.browserEvent = e || null;\n\t\tthis.target = e ? (e.target || (<any>e).targetNode || e.srcElement) : null;\n\n\t\tthis.deltaY = deltaY;\n\t\tthis.deltaX = deltaX;\n\n\t\tif (e) {\n\t\t\t// Old (deprecated) wheel events\n\t\t\tlet e1 = <IWebKitMouseWheelEvent><any>e;\n\t\t\tlet e2 = <IGeckoMouseWheelEvent><any>e;\n\n\t\t\t// vertical delta scroll\n\t\t\tif (typeof e1.wheelDeltaY !== 'undefined') {\n\t\t\t\tthis.deltaY = e1.wheelDeltaY / 120;\n\t\t\t} else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n\t\t\t\tthis.deltaY = -e2.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = -e.deltaY / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// horizontal delta scroll\n\t\t\tif (typeof e1.wheelDeltaX !== 'undefined') {\n\t\t\t\tif (browser.isSafari && platform.isWindows) {\n\t\t\t\t\tthis.deltaX = - (e1.wheelDeltaX / 120);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n\t\t\t\tthis.deltaX = -e.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = -e.deltaX / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Assume a vertical scroll if nothing else worked\n\t\t\tif (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n\t\t\t\tthis.deltaY = e.wheelDelta / 120;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic preventDefault(): void {\n\t\tif (this.browserEvent) {\n\t\t\tthis.browserEvent.preventDefault();\n\t\t}\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tif (this.browserEvent) {\n\t\t\tthis.browserEvent.stopPropagation();\n\t\t}\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\n\nexport interface CancellationToken {\n\n\t/**\n\t * A flag signalling is cancellation has been requested.\n\t */\n\treadonly isCancellationRequested: boolean;\n\n\t/**\n\t * An event which fires when cancellation is requested. This event\n\t * only ever fires `once` as cancellation can only happen once. Listeners\n\t * that are registered after cancellation will be called (next event loop run),\n\t * but also only once.\n\t *\n\t * @event\n\t */\n\treadonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable;\n}\n\nconst shortcutEvent: Event<any> = Object.freeze(function (callback, context?): IDisposable {\n\tconst handle = setTimeout(callback.bind(context), 0);\n\treturn { dispose() { clearTimeout(handle); } };\n});\n\nexport namespace CancellationToken {\n\n\texport function isCancellationToken(thing: unknown): thing is CancellationToken {\n\t\tif (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\n\t\t\treturn true;\n\t\t}\n\t\tif (thing instanceof MutableToken) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!thing || typeof thing !== 'object') {\n\t\t\treturn false;\n\t\t}\n\t\treturn typeof (thing as CancellationToken).isCancellationRequested === 'boolean'\n\t\t\t&& typeof (thing as CancellationToken).onCancellationRequested === 'function';\n\t}\n\n\n\texport const None: CancellationToken = Object.freeze({\n\t\tisCancellationRequested: false,\n\t\tonCancellationRequested: Event.None\n\t});\n\n\texport const Cancelled: CancellationToken = Object.freeze({\n\t\tisCancellationRequested: true,\n\t\tonCancellationRequested: shortcutEvent\n\t});\n}\n\nclass MutableToken implements CancellationToken {\n\n\tprivate _isCancelled: boolean = false;\n\tprivate _emitter: Emitter<any> | null = null;\n\n\tpublic cancel() {\n\t\tif (!this._isCancelled) {\n\t\t\tthis._isCancelled = true;\n\t\t\tif (this._emitter) {\n\t\t\t\tthis._emitter.fire(undefined);\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tget isCancellationRequested(): boolean {\n\t\treturn this._isCancelled;\n\t}\n\n\tget onCancellationRequested(): Event<any> {\n\t\tif (this._isCancelled) {\n\t\t\treturn shortcutEvent;\n\t\t}\n\t\tif (!this._emitter) {\n\t\t\tthis._emitter = new Emitter<any>();\n\t\t}\n\t\treturn this._emitter.event;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._emitter) {\n\t\t\tthis._emitter.dispose();\n\t\t\tthis._emitter = null;\n\t\t}\n\t}\n}\n\nexport class CancellationTokenSource {\n\n\tprivate _token?: CancellationToken = undefined;\n\tprivate _parentListener?: IDisposable = undefined;\n\n\tconstructor(parent?: CancellationToken) {\n\t\tthis._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\n\t}\n\n\tget token(): CancellationToken {\n\t\tif (!this._token) {\n\t\t\t// be lazy and create the token only when\n\t\t\t// actually needed\n\t\t\tthis._token = new MutableToken();\n\t\t}\n\t\treturn this._token;\n\t}\n\n\tcancel(): void {\n\t\tif (!this._token) {\n\t\t\t// save an object by returning the default\n\t\t\t// cancelled token when cancellation happens\n\t\t\t// before someone asks for the token\n\t\t\tthis._token = CancellationToken.Cancelled;\n\n\t\t} else if (this._token instanceof MutableToken) {\n\t\t\t// actually cancel\n\t\t\tthis._token.cancel();\n\t\t}\n\t}\n\n\tdispose(cancel: boolean = false): void {\n\t\tif (cancel) {\n\t\t\tthis.cancel();\n\t\t}\n\t\tif (this._parentListener) {\n\t\t\tthis._parentListener.dispose();\n\t\t}\n\t\tif (!this._token) {\n\t\t\t// ensure to initialize with an empty token if we had none\n\t\t\tthis._token = CancellationToken.None;\n\n\t\t} else if (this._token instanceof MutableToken) {\n\t\t\t// actually dispose\n\t\t\tthis._token.dispose();\n\t\t}\n\t}\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 { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { CancellationError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { setTimeout0 } from 'vs/base/common/platform';\n\nexport function isThenable<T>(obj: unknown): obj is Promise<T> {\n\treturn !!obj && typeof (obj as unknown as Promise<T>).then === 'function';\n}\n\nexport interface CancelablePromise<T> extends Promise<T> {\n\tcancel(): void;\n}\n\nexport function createCancelablePromise<T>(callback: (token: CancellationToken) => Promise<T>): CancelablePromise<T> {\n\tconst source = new CancellationTokenSource();\n\n\tconst thenable = callback(source.token);\n\tconst promise = new Promise<T>((resolve, reject) => {\n\t\tconst subscription = source.token.onCancellationRequested(() => {\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t\treject(new CancellationError());\n\t\t});\n\t\tPromise.resolve(thenable).then(value => {\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t\tresolve(value);\n\t\t}, err => {\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t\treject(err);\n\t\t});\n\t});\n\n\treturn <CancelablePromise<T>>new class {\n\t\tcancel() {\n\t\t\tsource.cancel();\n\t\t}\n\t\tthen<TResult1 = T, TResult2 = never>(resolve?: ((value: T) => TResult1 | Promise<TResult1>) | undefined | null, reject?: ((reason: any) => TResult2 | Promise<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n\t\t\treturn promise.then(resolve, reject);\n\t\t}\n\t\tcatch<TResult = never>(reject?: ((reason: any) => TResult | Promise<TResult>) | undefined | null): Promise<T | TResult> {\n\t\t\treturn this.then(undefined, reject);\n\t\t}\n\t\tfinally(onfinally?: (() => void) | undefined | null): Promise<T> {\n\t\t\treturn promise.finally(onfinally);\n\t\t}\n\t};\n}\n\n/**\n * Returns a promise that resolves with `undefined` as soon as the passed token is cancelled.\n * @see {@link raceCancellationError}\n */\nexport function raceCancellation<T>(promise: Promise<T>, token: CancellationToken): Promise<T | undefined>;\n\n/**\n * Returns a promise that resolves with `defaultValue` as soon as the passed token is cancelled.\n * @see {@link raceCancellationError}\n */\nexport function raceCancellation<T>(promise: Promise<T>, token: CancellationToken, defaultValue: T): Promise<T>;\n\nexport function raceCancellation<T>(promise: Promise<T>, token: CancellationToken, defaultValue?: T): Promise<T | undefined> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst ref = token.onCancellationRequested(() => {\n\t\t\tref.dispose();\n\t\t\tresolve(defaultValue);\n\t\t});\n\t\tpromise.then(resolve, reject).finally(() => ref.dispose());\n\t});\n}\n\nexport interface ITask<T> {\n\t(): T;\n}\n\n/**\n * A helper to prevent accumulation of sequential async tasks.\n *\n * Imagine a mail man with the sole task of delivering letters. As soon as\n * a letter submitted for delivery, he drives to the destination, delivers it\n * and returns to his base. Imagine that during the trip, N more letters were submitted.\n * When the mail man returns, he picks those N letters and delivers them all in a\n * single trip. Even though N+1 submissions occurred, only 2 deliveries were made.\n *\n * The throttler implements this via the queue() method, by providing it a task\n * factory. Following the example:\n *\n * \t\tconst throttler = new Throttler();\n * \t\tconst letters = [];\n *\n * \t\tfunction deliver() {\n * \t\t\tconst lettersToDeliver = letters;\n * \t\t\tletters = [];\n * \t\t\treturn makeTheTrip(lettersToDeliver);\n * \t\t}\n *\n * \t\tfunction onLetterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tthrottler.queue(deliver);\n * \t\t}\n */\nexport class Throttler {\n\n\tprivate activePromise: Promise<any> | null;\n\tprivate queuedPromise: Promise<any> | null;\n\tprivate queuedPromiseFactory: ITask<Promise<any>> | null;\n\n\tconstructor() {\n\t\tthis.activePromise = null;\n\t\tthis.queuedPromise = null;\n\t\tthis.queuedPromiseFactory = null;\n\t}\n\n\tqueue<T>(promiseFactory: ITask<Promise<T>>): Promise<T> {\n\t\tif (this.activePromise) {\n\t\t\tthis.queuedPromiseFactory = promiseFactory;\n\n\t\t\tif (!this.queuedPromise) {\n\t\t\t\tconst onComplete = () => {\n\t\t\t\t\tthis.queuedPromise = null;\n\n\t\t\t\t\tconst result = this.queue(this.queuedPromiseFactory!);\n\t\t\t\t\tthis.queuedPromiseFactory = null;\n\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tthis.queuedPromise = new Promise(resolve => {\n\t\t\t\t\tthis.activePromise!.then(onComplete, onComplete).then(resolve);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tthis.queuedPromise!.then(resolve, reject);\n\t\t\t});\n\t\t}\n\n\t\tthis.activePromise = promiseFactory();\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.activePromise!.then((result: T) => {\n\t\t\t\tthis.activePromise = null;\n\t\t\t\tresolve(result);\n\t\t\t}, (err: unknown) => {\n\t\t\t\tthis.activePromise = null;\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}\n}\n\ninterface IScheduledLater extends IDisposable {\n\tisTriggered(): boolean;\n}\n\nconst timeoutDeferred = (timeout: number, fn: () => void): IScheduledLater => {\n\tlet scheduled = true;\n\tconst handle = setTimeout(() => {\n\t\tscheduled = false;\n\t\tfn();\n\t}, timeout);\n\treturn {\n\t\tisTriggered: () => scheduled,\n\t\tdispose: () => {\n\t\t\tclearTimeout(handle);\n\t\t\tscheduled = false;\n\t\t},\n\t};\n};\n\nconst microtaskDeferred = (fn: () => void): IScheduledLater => {\n\tlet scheduled = true;\n\tqueueMicrotask(() => {\n\t\tif (scheduled) {\n\t\t\tscheduled = false;\n\t\t\tfn();\n\t\t}\n\t});\n\n\treturn {\n\t\tisTriggered: () => scheduled,\n\t\tdispose: () => { scheduled = false; },\n\t};\n};\n\n/** Can be passed into the Delayed to defer using a microtask */\nexport const MicrotaskDelay = Symbol('MicrotaskDelay');\n\n/**\n * A helper to delay (debounce) execution of a task that is being requested often.\n *\n * Following the throttler, now imagine the mail man wants to optimize the number of\n * trips proactively. The trip itself can be long, so he decides not to make the trip\n * as soon as a letter is submitted. Instead he waits a while, in case more\n * letters are submitted. After said waiting period, if no letters were submitted, he\n * decides to make the trip. Imagine that N more letters were submitted after the first\n * one, all within a short period of time between each other. Even though N+1\n * submissions occurred, only 1 delivery was made.\n *\n * The delayer offers this behavior via the trigger() method, into which both the task\n * to be executed and the waiting period (delay) must be passed in as arguments. Following\n * the example:\n *\n * \t\tconst delayer = new Delayer(WAITING_PERIOD);\n * \t\tconst letters = [];\n *\n * \t\tfunction letterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tdelayer.trigger(() => { return makeTheTrip(); });\n * \t\t}\n */\nexport class Delayer<T> implements IDisposable {\n\n\tprivate deferred: IScheduledLater | null;\n\tprivate completionPromise: Promise<any> | null;\n\tprivate doResolve: ((value?: any | Promise<any>) => void) | null;\n\tprivate doReject: ((err: any) => void) | null;\n\tprivate task: ITask<T | Promise<T>> | null;\n\n\tconstructor(public defaultDelay: number | typeof MicrotaskDelay) {\n\t\tthis.deferred = null;\n\t\tthis.completionPromise = null;\n\t\tthis.doResolve = null;\n\t\tthis.doReject = null;\n\t\tthis.task = null;\n\t}\n\n\ttrigger(task: ITask<T | Promise<T>>, delay = this.defaultDelay): Promise<T> {\n\t\tthis.task = task;\n\t\tthis.cancelTimeout();\n\n\t\tif (!this.completionPromise) {\n\t\t\tthis.completionPromise = new Promise((resolve, reject) => {\n\t\t\t\tthis.doResolve = resolve;\n\t\t\t\tthis.doReject = reject;\n\t\t\t}).then(() => {\n\t\t\t\tthis.completionPromise = null;\n\t\t\t\tthis.doResolve = null;\n\t\t\t\tif (this.task) {\n\t\t\t\t\tconst task = this.task;\n\t\t\t\t\tthis.task = null;\n\t\t\t\t\treturn task();\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t});\n\t\t}\n\n\t\tconst fn = () => {\n\t\t\tthis.deferred = null;\n\t\t\tthis.doResolve?.(null);\n\t\t};\n\n\t\tthis.deferred = delay === MicrotaskDelay ? microtaskDeferred(fn) : timeoutDeferred(delay, fn);\n\n\t\treturn this.completionPromise;\n\t}\n\n\tisTriggered(): boolean {\n\t\treturn !!this.deferred?.isTriggered();\n\t}\n\n\tcancel(): void {\n\t\tthis.cancelTimeout();\n\n\t\tif (this.completionPromise) {\n\t\t\tif (this.doReject) {\n\t\t\t\tthis.doReject(new CancellationError());\n\t\t\t}\n\t\t\tthis.completionPromise = null;\n\t\t}\n\t}\n\n\tprivate cancelTimeout(): void {\n\t\tthis.deferred?.dispose();\n\t\tthis.deferred = null;\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t}\n}\n\n/**\n * A helper to delay execution of a task that is being requested often, while\n * preventing accumulation of consecutive executions, while the task runs.\n *\n * The mail man is clever and waits for a certain amount of time, before going\n * out to deliver letters. While the mail man is going out, more letters arrive\n * and can only be delivered once he is back. Once he is back the mail man will\n * do one more trip to deliver the letters that have accumulated while he was out.\n */\nexport class ThrottledDelayer<T> {\n\n\tprivate delayer: Delayer<Promise<T>>;\n\tprivate throttler: Throttler;\n\n\tconstructor(defaultDelay: number) {\n\t\tthis.delayer = new Delayer(defaultDelay);\n\t\tthis.throttler = new Throttler();\n\t}\n\n\ttrigger(promiseFactory: ITask<Promise<T>>, delay?: number): Promise<T> {\n\t\treturn this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay) as unknown as Promise<T>;\n\t}\n\n\tdispose(): void {\n\t\tthis.delayer.dispose();\n\t}\n}\n\nexport function timeout(millis: number): CancelablePromise<void>;\nexport function timeout(millis: number, token: CancellationToken): Promise<void>;\nexport function timeout(millis: number, token?: CancellationToken): CancelablePromise<void> | Promise<void> {\n\tif (!token) {\n\t\treturn createCancelablePromise(token => timeout(millis, token));\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst handle = setTimeout(() => {\n\t\t\tdisposable.dispose();\n\t\t\tresolve();\n\t\t}, millis);\n\t\tconst disposable = token.onCancellationRequested(() => {\n\t\t\tclearTimeout(handle);\n\t\t\tdisposable.dispose();\n\t\t\treject(new CancellationError());\n\t\t});\n\t});\n}\n\nexport function disposableTimeout(handler: () => void, timeout = 0): IDisposable {\n\tconst timer = setTimeout(handler, timeout);\n\treturn toDisposable(() => clearTimeout(timer));\n}\n\nexport function first<T>(promiseFactories: ITask<Promise<T>>[], shouldStop: (t: T) => boolean = t => !!t, defaultValue: T | null = null): Promise<T | null> {\n\tlet index = 0;\n\tconst len = promiseFactories.length;\n\n\tconst loop: () => Promise<T | null> = () => {\n\t\tif (index >= len) {\n\t\t\treturn Promise.resolve(defaultValue);\n\t\t}\n\n\t\tconst factory = promiseFactories[index++];\n\t\tconst promise = Promise.resolve(factory());\n\n\t\treturn promise.then(result => {\n\t\t\tif (shouldStop(result)) {\n\t\t\t\treturn Promise.resolve(result);\n\t\t\t}\n\n\t\t\treturn loop();\n\t\t});\n\t};\n\n\treturn loop();\n}\n\nexport class TimeoutTimer implements IDisposable {\n\tprivate _token: any;\n\n\tconstructor();\n\tconstructor(runner: () => void, timeout: number);\n\tconstructor(runner?: () => void, timeout?: number) {\n\t\tthis._token = -1;\n\n\t\tif (typeof runner === 'function' && typeof timeout === 'number') {\n\t\t\tthis.setIfNotSet(runner, timeout);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t}\n\n\tcancel(): void {\n\t\tif (this._token !== -1) {\n\t\t\tclearTimeout(this._token);\n\t\t\tthis._token = -1;\n\t\t}\n\t}\n\n\tcancelAndSet(runner: () => void, timeout: number): void {\n\t\tthis.cancel();\n\t\tthis._token = setTimeout(() => {\n\t\t\tthis._token = -1;\n\t\t\trunner();\n\t\t}, timeout);\n\t}\n\n\tsetIfNotSet(runner: () => void, timeout: number): void {\n\t\tif (this._token !== -1) {\n\t\t\t// timer is already set\n\t\t\treturn;\n\t\t}\n\t\tthis._token = setTimeout(() => {\n\t\t\tthis._token = -1;\n\t\t\trunner();\n\t\t}, timeout);\n\t}\n}\n\nexport class IntervalTimer implements IDisposable {\n\n\tprivate _token: any;\n\n\tconstructor() {\n\t\tthis._token = -1;\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t}\n\n\tcancel(): void {\n\t\tif (this._token !== -1) {\n\t\t\tclearInterval(this._token);\n\t\t\tthis._token = -1;\n\t\t}\n\t}\n\n\tcancelAndSet(runner: () => void, interval: number): void {\n\t\tthis.cancel();\n\t\tthis._token = setInterval(() => {\n\t\t\trunner();\n\t\t}, interval);\n\t}\n}\n\nexport class RunOnceScheduler {\n\n\tprotected runner: ((...args: unknown[]) => void) | null;\n\n\tprivate timeoutToken: any;\n\tprivate timeout: number;\n\tprivate timeoutHandler: () => void;\n\n\tconstructor(runner: (...args: any[]) => void, delay: number) {\n\t\tthis.timeoutToken = -1;\n\t\tthis.runner = runner;\n\t\tthis.timeout = delay;\n\t\tthis.timeoutHandler = this.onTimeout.bind(this);\n\t}\n\n\t/**\n\t * Dispose RunOnceScheduler\n\t */\n\tdispose(): void {\n\t\tthis.cancel();\n\t\tthis.runner = null;\n\t}\n\n\t/**\n\t * Cancel current scheduled runner (if any).\n\t */\n\tcancel(): void {\n\t\tif (this.isScheduled()) {\n\t\t\tclearTimeout(this.timeoutToken);\n\t\t\tthis.timeoutToken = -1;\n\t\t}\n\t}\n\n\t/**\n\t * Cancel previous runner (if any) & schedule a new runner.\n\t */\n\tschedule(delay = this.timeout): void {\n\t\tthis.cancel();\n\t\tthis.timeoutToken = setTimeout(this.timeoutHandler, delay);\n\t}\n\n\tget delay(): number {\n\t\treturn this.timeout;\n\t}\n\n\tset delay(value: number) {\n\t\tthis.timeout = value;\n\t}\n\n\t/**\n\t * Returns true if scheduled.\n\t */\n\tisScheduled(): boolean {\n\t\treturn this.timeoutToken !== -1;\n\t}\n\n\tprivate onTimeout() {\n\t\tthis.timeoutToken = -1;\n\t\tif (this.runner) {\n\t\t\tthis.doRun();\n\t\t}\n\t}\n\n\tprotected doRun(): void {\n\t\tif (this.runner) {\n\t\t\tthis.runner();\n\t\t}\n\t}\n}\n\n//#region -- run on idle tricks ------------\n\nexport interface IdleDeadline {\n\ttimeRemaining(): number;\n}\n\n/**\n * Execute the callback the next time the browser is idle\n */\nexport let runWhenIdle: (callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;\n\ndeclare function requestIdleCallback(callback: (args: IdleDeadline) => void, options?: { timeout: number }): number;\ndeclare function cancelIdleCallback(handle: number): void;\n\n(function () {\n\tif (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {\n\t\trunWhenIdle = (runner) => {\n\t\t\tsetTimeout0(() => {\n\t\t\t\tif (disposed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst end = Date.now() + 15; // one frame at 64fps\n\t\t\t\trunner(Object.freeze({\n\t\t\t\t\tdidTimeout: true,\n\t\t\t\t\ttimeRemaining() {\n\t\t\t\t\t\treturn Math.max(0, end - Date.now());\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t});\n\t\t\tlet disposed = false;\n\t\t\treturn {\n\t\t\t\tdispose() {\n\t\t\t\t\tif (disposed) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdisposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t} else {\n\t\trunWhenIdle = (runner, timeout?) => {\n\t\t\tconst handle: number = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);\n\t\t\tlet disposed = false;\n\t\t\treturn {\n\t\t\t\tdispose() {\n\t\t\t\t\tif (disposed) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdisposed = true;\n\t\t\t\t\tcancelIdleCallback(handle);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}\n})();\n\n/**\n * An implementation of the \"idle-until-urgent\"-strategy as introduced\n * here: https://philipwalton.com/articles/idle-until-urgent/\n */\nexport class IdleValue<T> {\n\n\tprivate readonly _executor: () => void;\n\tprivate readonly _handle: IDisposable;\n\n\tprivate _didRun: boolean = false;\n\tprivate _value?: T;\n\tprivate _error: unknown;\n\n\tconstructor(executor: () => T) {\n\t\tthis._executor = () => {\n\t\t\ttry {\n\t\t\t\tthis._value = executor();\n\t\t\t} catch (err) {\n\t\t\t\tthis._error = err;\n\t\t\t} finally {\n\t\t\t\tthis._didRun = true;\n\t\t\t}\n\t\t};\n\t\tthis._handle = runWhenIdle(() => this._executor());\n\t}\n\n\tdispose(): void {\n\t\tthis._handle.dispose();\n\t}\n\n\tget value(): T {\n\t\tif (!this._didRun) {\n\t\t\tthis._handle.dispose();\n\t\t\tthis._executor();\n\t\t}\n\t\tif (this._error) {\n\t\t\tthrow this._error;\n\t\t}\n\t\treturn this._value!;\n\t}\n\n\tget isInitialized(): boolean {\n\t\treturn this._didRun;\n\t}\n}\n\n//#endregion\n\n//#region\n\nexport type ValueCallback<T = unknown> = (value: T | Promise<T>) => void;\n\n/**\n * Creates a promise whose resolution or rejection can be controlled imperatively.\n */\nexport class DeferredPromise<T> {\n\n\tprivate completeCallback!: ValueCallback<T>;\n\tprivate errorCallback!: (err: unknown) => void;\n\tprivate rejected = false;\n\tprivate resolved = false;\n\n\tpublic get isRejected() {\n\t\treturn this.rejected;\n\t}\n\n\tpublic get isSettled() {\n\t\treturn this.rejected || this.resolved;\n\t}\n\n\tpublic p: Promise<T>;\n\n\tconstructor() {\n\t\tthis.p = new Promise<T>((c, e) => {\n\t\t\tthis.completeCallback = c;\n\t\t\tthis.errorCallback = e;\n\t\t});\n\t}\n\n\tpublic complete(value: T) {\n\t\treturn new Promise<void>(resolve => {\n\t\t\tthis.completeCallback(value);\n\t\t\tthis.resolved = true;\n\t\t\tresolve();\n\t\t});\n\t}\n\n\tpublic cancel() {\n\t\tnew Promise<void>(resolve => {\n\t\t\tthis.errorCallback(new CancellationError());\n\t\t\tthis.rejected = true;\n\t\t\tresolve();\n\t\t});\n\t}\n}\n\n//#endregion\n\n//#region Promises\n\nexport namespace Promises {\n\n\t/**\n\t * A drop-in replacement for `Promise.all` with the only difference\n\t * that the method awaits every promise to either fulfill or reject.\n\t *\n\t * Similar to `Promise.all`, only the first error will be returned\n\t * if any.\n\t */\n\texport async function settled<T>(promises: Promise<T>[]): Promise<T[]> {\n\t\tlet firstError: Error | undefined = undefined;\n\n\t\tconst result = await Promise.all(promises.map(promise => promise.then(value => value, error => {\n\t\t\tif (!firstError) {\n\t\t\t\tfirstError = error;\n\t\t\t}\n\n\t\t\treturn undefined; // do not rethrow so that other promises can settle\n\t\t})));\n\n\t\tif (typeof firstError !== 'undefined') {\n\t\t\tthrow firstError;\n\t\t}\n\n\t\treturn result as unknown as T[]; // cast is needed and protected by the `throw` above\n\t}\n\n\t/**\n\t * A helper to create a new `Promise<T>` with a body that is a promise\n\t * itself. By default, an error that raises from the async body will\n\t * end up as a unhandled rejection, so this utility properly awaits the\n\t * body and rejects the promise as a normal promise does without async\n\t * body.\n\t *\n\t * This method should only be used in rare cases where otherwise `async`\n\t * cannot be used (e.g. when callbacks are involved that require this).\n\t */\n\texport function withAsyncBody<T, E = Error>(bodyFn: (resolve: (value: T) => unknown, reject: (error: E) => unknown) => Promise<unknown>): Promise<T> {\n\t\t// eslint-disable-next-line no-async-promise-executor\n\t\treturn new Promise<T>(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tawait bodyFn(resolve, reject);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n}\n\n//#endregion\n\n//#region\n\nconst enum AsyncIterableSourceState {\n\tInitial,\n\tDoneOK,\n\tDoneError,\n}\n\n/**\n * An object that allows to emit async values asynchronously or bring the iterable to an error state using `reject()`.\n * This emitter is valid only for the duration of the executor (until the promise returned by the executor settles).\n */\nexport interface AsyncIterableEmitter<T> {\n\t/**\n\t * The value will be appended at the end.\n\t *\n\t * **NOTE** If `reject()` has already been called, this method has no effect.\n\t */\n\temitOne(value: T): void;\n\t/**\n\t * The values will be appended at the end.\n\t *\n\t * **NOTE** If `reject()` has already been called, this method has no effect.\n\t */\n\temitMany(values: T[]): void;\n\t/**\n\t * Writing an error will permanently invalidate this iterable.\n\t * The current users will receive an error thrown, as will all future users.\n\t *\n\t * **NOTE** If `reject()` have already been called, this method has no effect.\n\t */\n\treject(error: Error): void;\n}\n\n/**\n * An executor for the `AsyncIterableObject` that has access to an emitter.\n */\nexport interface AyncIterableExecutor<T> {\n\t/**\n\t * @param emitter An object that allows to emit async values valid only for the duration of the executor.\n\t */\n\t(emitter: AsyncIterableEmitter<T>): void | Promise<void>;\n}\n\n/**\n * A rich implementation for an `AsyncIterable<T>`.\n */\nexport class AsyncIterableObject<T> implements AsyncIterable<T> {\n\n\tpublic static fromArray<T>(items: T[]): AsyncIterableObject<T> {\n\t\treturn new AsyncIterableObject<T>((writer) => {\n\t\t\twriter.emitMany(items);\n\t\t});\n\t}\n\n\tpublic static fromPromise<T>(promise: Promise<T[]>): AsyncIterableObject<T> {\n\t\treturn new AsyncIterableObject<T>(async (emitter) => {\n\t\t\temitter.emitMany(await promise);\n\t\t});\n\t}\n\n\tpublic static fromPromises<T>(promises: Promise<T>[]): AsyncIterableObject<T> {\n\t\treturn new AsyncIterableObject<T>(async (emitter) => {\n\t\t\tawait Promise.all(promises.map(async (p) => emitter.emitOne(await p)));\n\t\t});\n\t}\n\n\tpublic static merge<T>(iterables: AsyncIterable<T>[]): AsyncIterableObject<T> {\n\t\treturn new AsyncIterableObject(async (emitter) => {\n\t\t\tawait Promise.all(iterables.map(async (iterable) => {\n\t\t\t\tfor await (const item of iterable) {\n\t\t\t\t\temitter.emitOne(item);\n\t\t\t\t}\n\t\t\t}));\n\t\t});\n\t}\n\n\tpublic static EMPTY = AsyncIterableObject.fromArray<any>([]);\n\n\tprivate _state: AsyncIterableSourceState;\n\tprivate _results: T[];\n\tprivate _error: Error | null;\n\tprivate readonly _onStateChanged: Emitter<void>;\n\n\tconstructor(executor: AyncIterableExecutor<T>) {\n\t\tthis._state = AsyncIterableSourceState.Initial;\n\t\tthis._results = [];\n\t\tthis._error = null;\n\t\tthis._onStateChanged = new Emitter<void>();\n\n\t\tqueueMicrotask(async () => {\n\t\t\tconst writer: AsyncIterableEmitter<T> = {\n\t\t\t\temitOne: (item) => this.emitOne(item),\n\t\t\t\temitMany: (items) => this.emitMany(items),\n\t\t\t\treject: (error) => this.reject(error)\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tawait Promise.resolve(executor(writer));\n\t\t\t\tthis.resolve();\n\t\t\t} catch (err) {\n\t\t\t\tthis.reject(err);\n\t\t\t} finally {\n\t\t\t\twriter.emitOne = undefined!;\n\t\t\t\twriter.emitMany = undefined!;\n\t\t\t\twriter.reject = undefined!;\n\t\t\t}\n\t\t});\n\t}\n\n\t[Symbol.asyncIterator](): AsyncIterator<T, undefined, undefined> {\n\t\tlet i = 0;\n\t\treturn {\n\t\t\tnext: async () => {\n\t\t\t\tdo {\n\t\t\t\t\tif (this._state === AsyncIterableSourceState.DoneError) {\n\t\t\t\t\t\tthrow this._error;\n\t\t\t\t\t}\n\t\t\t\t\tif (i < this._results.length) {\n\t\t\t\t\t\treturn { done: false, value: this._results[i++] };\n\t\t\t\t\t}\n\t\t\t\t\tif (this._state === AsyncIterableSourceState.DoneOK) {\n\t\t\t\t\t\treturn { done: true, value: undefined };\n\t\t\t\t\t}\n\t\t\t\t\tawait Event.toPromise(this._onStateChanged.event);\n\t\t\t\t} while (true);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic static map<T, R>(iterable: AsyncIterable<T>, mapFn: (item: T) => R): AsyncIterableObject<R> {\n\t\treturn new AsyncIterableObject<R>(async (emitter) => {\n\t\t\tfor await (const item of iterable) {\n\t\t\t\temitter.emitOne(mapFn(item));\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic map<R>(mapFn: (item: T) => R): AsyncIterableObject<R> {\n\t\treturn AsyncIterableObject.map(this, mapFn);\n\t}\n\n\tpublic static filter<T>(iterable: AsyncIterable<T>, filterFn: (item: T) => boolean): AsyncIterableObject<T> {\n\t\treturn new AsyncIterableObject<T>(async (emitter) => {\n\t\t\tfor await (const item of iterable) {\n\t\t\t\tif (filterFn(item)) {\n\t\t\t\t\temitter.emitOne(item);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic filter(filterFn: (item: T) => boolean): AsyncIterableObject<T> {\n\t\treturn AsyncIterableObject.filter(this, filterFn);\n\t}\n\n\tpublic static coalesce<T>(iterable: AsyncIterable<T | undefined | null>): AsyncIterableObject<T> {\n\t\treturn <AsyncIterableObject<T>>AsyncIterableObject.filter(iterable, item => !!item);\n\t}\n\n\tpublic coalesce(): AsyncIterableObject<NonNullable<T>> {\n\t\treturn AsyncIterableObject.coalesce(this) as AsyncIterableObject<NonNullable<T>>;\n\t}\n\n\tpublic static async toPromise<T>(iterable: AsyncIterable<T>): Promise<T[]> {\n\t\tconst result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult.push(item);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic toPromise(): Promise<T[]> {\n\t\treturn AsyncIterableObject.toPromise(this);\n\t}\n\n\t/**\n\t * The value will be appended at the end.\n\t *\n\t * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n\t */\n\tprivate emitOne(value: T): void {\n\t\tif (this._state !== AsyncIterableSourceState.Initial) {\n\t\t\treturn;\n\t\t}\n\t\t// it is important to add new values at the end,\n\t\t// as we may have iterators already running on the array\n\t\tthis._results.push(value);\n\t\tthis._onStateChanged.fire();\n\t}\n\n\t/**\n\t * The values will be appended at the end.\n\t *\n\t * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n\t */\n\tprivate emitMany(values: T[]): void {\n\t\tif (this._state !== AsyncIterableSourceState.Initial) {\n\t\t\treturn;\n\t\t}\n\t\t// it is important to add new values at the end,\n\t\t// as we may have iterators already running on the array\n\t\tthis._results = this._results.concat(values);\n\t\tthis._onStateChanged.fire();\n\t}\n\n\t/**\n\t * Calling `resolve()` will mark the result array as complete.\n\t *\n\t * **NOTE** `resolve()` must be called, otherwise all consumers of this iterable will hang indefinitely, similar to a non-resolved promise.\n\t * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n\t */\n\tprivate resolve(): void {\n\t\tif (this._state !== AsyncIterableSourceState.Initial) {\n\t\t\treturn;\n\t\t}\n\t\tthis._state = AsyncIterableSourceState.DoneOK;\n\t\tthis._onStateChanged.fire();\n\t}\n\n\t/**\n\t * Writing an error will permanently invalidate this iterable.\n\t * The current users will receive an error thrown, as will all future users.\n\t *\n\t * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n\t */\n\tprivate reject(error: Error) {\n\t\tif (this._state !== AsyncIterableSourceState.Initial) {\n\t\t\treturn;\n\t\t}\n\t\tthis._state = AsyncIterableSourceState.DoneError;\n\t\tthis._error = error;\n\t\tthis._onStateChanged.fire();\n\t}\n}\n\nexport class CancelableAsyncIterableObject<T> extends AsyncIterableObject<T> {\n\tconstructor(\n\t\tprivate readonly _source: CancellationTokenSource,\n\t\texecutor: AyncIterableExecutor<T>\n\t) {\n\t\tsuper(executor);\n\t}\n\n\tcancel(): void {\n\t\tthis._source.cancel();\n\t}\n}\n\nexport function createCancelableAsyncIterable<T>(callback: (token: CancellationToken) => AsyncIterable<T>): CancelableAsyncIterableObject<T> {\n\tconst source = new CancellationTokenSource();\n\tconst innerIterable = callback(source.token);\n\n\treturn new CancelableAsyncIterableObject<T>(source, async (emitter) => {\n\t\tconst subscription = source.token.onCancellationRequested(() => {\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t\temitter.reject(new CancellationError());\n\t\t});\n\t\ttry {\n\t\t\tfor await (const item of innerIterable) {\n\t\t\t\tif (source.token.isCancellationRequested) {\n\t\t\t\t\t// canceled in the meantime\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\temitter.emitOne(item);\n\t\t\t}\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t} catch (err) {\n\t\t\tsubscription.dispose();\n\t\t\tsource.dispose();\n\t\t\temitter.reject(err);\n\t\t}\n\t});\n}\n\n//#endregion\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 { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\n\nexport class ScrollbarVisibilityController extends Disposable {\n\tprivate _visibility: ScrollbarVisibility;\n\tprivate _visibleClassName: string;\n\tprivate _invisibleClassName: string;\n\tprivate _domNode: FastDomNode<HTMLElement> | null;\n\tprivate _rawShouldBeVisible: boolean;\n\tprivate _shouldBeVisible: boolean;\n\tprivate _isNeeded: boolean;\n\tprivate _isVisible: boolean;\n\tprivate _revealTimer: TimeoutTimer;\n\n\tconstructor(visibility: ScrollbarVisibility, visibleClassName: string, invisibleClassName: string) {\n\t\tsuper();\n\t\tthis._visibility = visibility;\n\t\tthis._visibleClassName = visibleClassName;\n\t\tthis._invisibleClassName = invisibleClassName;\n\t\tthis._domNode = null;\n\t\tthis._isVisible = false;\n\t\tthis._isNeeded = false;\n\t\tthis._rawShouldBeVisible = false;\n\t\tthis._shouldBeVisible = false;\n\t\tthis._revealTimer = this._register(new TimeoutTimer());\n\t}\n\n\tpublic setVisibility(visibility: ScrollbarVisibility): void {\n\t\tif (this._visibility !== visibility) {\n\t\t\tthis._visibility = visibility;\n\t\t\tthis._updateShouldBeVisible();\n\t\t}\n\t}\n\n\t// ----------------- Hide / Reveal\n\n\tpublic setShouldBeVisible(rawShouldBeVisible: boolean): void {\n\t\tthis._rawShouldBeVisible = rawShouldBeVisible;\n\t\tthis._updateShouldBeVisible();\n\t}\n\n\tprivate _applyVisibilitySetting(): boolean {\n\t\tif (this._visibility === ScrollbarVisibility.Hidden) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._visibility === ScrollbarVisibility.Visible) {\n\t\t\treturn true;\n\t\t}\n\t\treturn this._rawShouldBeVisible;\n\t}\n\n\tprivate _updateShouldBeVisible(): void {\n\t\tconst shouldBeVisible = this._applyVisibilitySetting();\n\n\t\tif (this._shouldBeVisible !== shouldBeVisible) {\n\t\t\tthis._shouldBeVisible = shouldBeVisible;\n\t\t\tthis.ensureVisibility();\n\t\t}\n\t}\n\n\tpublic setIsNeeded(isNeeded: boolean): void {\n\t\tif (this._isNeeded !== isNeeded) {\n\t\t\tthis._isNeeded = isNeeded;\n\t\t\tthis.ensureVisibility();\n\t\t}\n\t}\n\n\tpublic setDomNode(domNode: FastDomNode<HTMLElement>): void {\n\t\tthis._domNode = domNode;\n\t\tthis._domNode.setClassName(this._invisibleClassName);\n\n\t\t// Now that the flags & the dom node are in a consistent state, ensure the Hidden/Visible configuration\n\t\tthis.setShouldBeVisible(false);\n\t}\n\n\tpublic ensureVisibility(): void {\n\n\t\tif (!this._isNeeded) {\n\t\t\t// Nothing to be rendered\n\t\t\tthis._hide(false);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._shouldBeVisible) {\n\t\t\tthis._reveal();\n\t\t} else {\n\t\t\tthis._hide(true);\n\t\t}\n\t}\n\n\tprivate _reveal(): void {\n\t\tif (this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = true;\n\n\t\t// The CSS animation doesn't play otherwise\n\t\tthis._revealTimer.setIfNotSet(() => {\n\t\t\tif (this._domNode) {\n\t\t\t\tthis._domNode.setClassName(this._visibleClassName);\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tprivate _hide(withFadeAway: boolean): void {\n\t\tthis._revealTimer.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tif (this._domNode) {\n\t\t\tthis._domNode.setClassName(this._invisibleClassName + (withFadeAway ? ' fade' : ''));\n\t\t}\n\t}\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 { IdleValue } from 'vs/base/common/async';\n\n// When comparing large numbers of strings it's better for performance to create an\n// Intl.Collator object and use the function provided by its compare property\n// than it is to use String.prototype.localeCompare()\n\n// A collator with numeric sorting enabled, and no sensitivity to case, accents or diacritics.\nconst intlFileNameCollatorBaseNumeric: IdleValue<{ collator: Intl.Collator; collatorIsNumeric: boolean }> = new IdleValue(() => {\n\tconst collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });\n\treturn {\n\t\tcollator: collator,\n\t\tcollatorIsNumeric: collator.resolvedOptions().numeric\n\t};\n});\n\n// A collator with numeric sorting enabled.\nconst intlFileNameCollatorNumeric: IdleValue<{ collator: Intl.Collator }> = new IdleValue(() => {\n\tconst collator = new Intl.Collator(undefined, { numeric: true });\n\treturn {\n\t\tcollator: collator\n\t};\n});\n\n// A collator with numeric sorting enabled, and sensitivity to accents and diacritics but not case.\nconst intlFileNameCollatorNumericCaseInsensitive: IdleValue<{ collator: Intl.Collator }> = new IdleValue(() => {\n\tconst collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'accent' });\n\treturn {\n\t\tcollator: collator\n\t};\n});\n\n/** Compares filenames without distinguishing the name from the extension. Disambiguates by unicode comparison. */\nexport function compareFileNames(one: string | null, other: string | null, caseSensitive = false): number {\n\tconst a = one || '';\n\tconst b = other || '';\n\tconst result = intlFileNameCollatorBaseNumeric.value.collator.compare(a, b);\n\n\t// Using the numeric option will make compare(`foo1`, `foo01`) === 0. Disambiguate.\n\tif (intlFileNameCollatorBaseNumeric.value.collatorIsNumeric && result === 0 && a !== b) {\n\t\treturn a < b ? -1 : 1;\n\t}\n\n\treturn result;\n}\n\nexport function compareAnything(one: string, other: string, lookFor: string): number {\n\tconst elementAName = one.toLowerCase();\n\tconst elementBName = other.toLowerCase();\n\n\t// Sort prefix matches over non prefix matches\n\tconst prefixCompare = compareByPrefix(one, other, lookFor);\n\tif (prefixCompare) {\n\t\treturn prefixCompare;\n\t}\n\n\t// Sort suffix matches over non suffix matches\n\tconst elementASuffixMatch = elementAName.endsWith(lookFor);\n\tconst elementBSuffixMatch = elementBName.endsWith(lookFor);\n\tif (elementASuffixMatch !== elementBSuffixMatch) {\n\t\treturn elementASuffixMatch ? -1 : 1;\n\t}\n\n\t// Understand file names\n\tconst r = compareFileNames(elementAName, elementBName);\n\tif (r !== 0) {\n\t\treturn r;\n\t}\n\n\t// Compare by name\n\treturn elementAName.localeCompare(elementBName);\n}\n\nexport function compareByPrefix(one: string, other: string, lookFor: string): number {\n\tconst elementAName = one.toLowerCase();\n\tconst elementBName = other.toLowerCase();\n\n\t// Sort prefix matches over non prefix matches\n\tconst elementAPrefixMatch = elementAName.startsWith(lookFor);\n\tconst elementBPrefixMatch = elementBName.startsWith(lookFor);\n\tif (elementAPrefixMatch !== elementBPrefixMatch) {\n\t\treturn elementAPrefixMatch ? -1 : 1;\n\t}\n\n\t// Same prefix: Sort shorter matches to the top to have those on top that match more precisely\n\telse if (elementAPrefixMatch && elementBPrefixMatch) {\n\t\tif (elementAName.length < elementBName.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (elementAName.length > elementBName.length) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\n\nexport const enum ScrollbarVisibility {\n\tAuto = 1,\n\tHidden = 2,\n\tVisible = 3\n}\n\nexport interface ScrollEvent {\n\tinSmoothScrolling: boolean;\n\n\toldWidth: number;\n\toldScrollWidth: number;\n\toldScrollLeft: number;\n\n\twidth: number;\n\tscrollWidth: number;\n\tscrollLeft: number;\n\n\toldHeight: number;\n\toldScrollHeight: number;\n\toldScrollTop: number;\n\n\theight: number;\n\tscrollHeight: number;\n\tscrollTop: number;\n\n\twidthChanged: boolean;\n\tscrollWidthChanged: boolean;\n\tscrollLeftChanged: boolean;\n\n\theightChanged: boolean;\n\tscrollHeightChanged: boolean;\n\tscrollTopChanged: boolean;\n}\n\nexport class ScrollState implements IScrollDimensions, IScrollPosition {\n\t_scrollStateBrand: void = undefined;\n\n\tpublic readonly rawScrollLeft: number;\n\tpublic readonly rawScrollTop: number;\n\n\tpublic readonly width: number;\n\tpublic readonly scrollWidth: number;\n\tpublic readonly scrollLeft: number;\n\tpublic readonly height: number;\n\tpublic readonly scrollHeight: number;\n\tpublic readonly scrollTop: number;\n\n\tconstructor(\n\t\tprivate readonly _forceIntegerValues: boolean,\n\t\twidth: number,\n\t\tscrollWidth: number,\n\t\tscrollLeft: number,\n\t\theight: number,\n\t\tscrollHeight: number,\n\t\tscrollTop: number\n\t) {\n\t\tif (this._forceIntegerValues) {\n\t\t\twidth = width | 0;\n\t\t\tscrollWidth = scrollWidth | 0;\n\t\t\tscrollLeft = scrollLeft | 0;\n\t\t\theight = height | 0;\n\t\t\tscrollHeight = scrollHeight | 0;\n\t\t\tscrollTop = scrollTop | 0;\n\t\t}\n\n\t\tthis.rawScrollLeft = scrollLeft; // before validation\n\t\tthis.rawScrollTop = scrollTop; // before validation\n\n\t\tif (width < 0) {\n\t\t\twidth = 0;\n\t\t}\n\t\tif (scrollLeft + width > scrollWidth) {\n\t\t\tscrollLeft = scrollWidth - width;\n\t\t}\n\t\tif (scrollLeft < 0) {\n\t\t\tscrollLeft = 0;\n\t\t}\n\n\t\tif (height < 0) {\n\t\t\theight = 0;\n\t\t}\n\t\tif (scrollTop + height > scrollHeight) {\n\t\t\tscrollTop = scrollHeight - height;\n\t\t}\n\t\tif (scrollTop < 0) {\n\t\t\tscrollTop = 0;\n\t\t}\n\n\t\tthis.width = width;\n\t\tthis.scrollWidth = scrollWidth;\n\t\tthis.scrollLeft = scrollLeft;\n\t\tthis.height = height;\n\t\tthis.scrollHeight = scrollHeight;\n\t\tthis.scrollTop = scrollTop;\n\t}\n\n\tpublic equals(other: ScrollState): boolean {\n\t\treturn (\n\t\t\tthis.rawScrollLeft === other.rawScrollLeft\n\t\t\t&& this.rawScrollTop === other.rawScrollTop\n\t\t\t&& this.width === other.width\n\t\t\t&& this.scrollWidth === other.scrollWidth\n\t\t\t&& this.scrollLeft === other.scrollLeft\n\t\t\t&& this.height === other.height\n\t\t\t&& this.scrollHeight === other.scrollHeight\n\t\t\t&& this.scrollTop === other.scrollTop\n\t\t);\n\t}\n\n\tpublic withScrollDimensions(update: INewScrollDimensions, useRawScrollPositions: boolean): ScrollState {\n\t\treturn new ScrollState(\n\t\t\tthis._forceIntegerValues,\n\t\t\t(typeof update.width !== 'undefined' ? update.width : this.width),\n\t\t\t(typeof update.scrollWidth !== 'undefined' ? update.scrollWidth : this.scrollWidth),\n\t\t\tuseRawScrollPositions ? this.rawScrollLeft : this.scrollLeft,\n\t\t\t(typeof update.height !== 'undefined' ? update.height : this.height),\n\t\t\t(typeof update.scrollHeight !== 'undefined' ? update.scrollHeight : this.scrollHeight),\n\t\t\tuseRawScrollPositions ? this.rawScrollTop : this.scrollTop\n\t\t);\n\t}\n\n\tpublic withScrollPosition(update: INewScrollPosition): ScrollState {\n\t\treturn new ScrollState(\n\t\t\tthis._forceIntegerValues,\n\t\t\tthis.width,\n\t\t\tthis.scrollWidth,\n\t\t\t(typeof update.scrollLeft !== 'undefined' ? update.scrollLeft : this.rawScrollLeft),\n\t\t\tthis.height,\n\t\t\tthis.scrollHeight,\n\t\t\t(typeof update.scrollTop !== 'undefined' ? update.scrollTop : this.rawScrollTop)\n\t\t);\n\t}\n\n\tpublic createScrollEvent(previous: ScrollState, inSmoothScrolling: boolean): ScrollEvent {\n\t\tconst widthChanged = (this.width !== previous.width);\n\t\tconst scrollWidthChanged = (this.scrollWidth !== previous.scrollWidth);\n\t\tconst scrollLeftChanged = (this.scrollLeft !== previous.scrollLeft);\n\n\t\tconst heightChanged = (this.height !== previous.height);\n\t\tconst scrollHeightChanged = (this.scrollHeight !== previous.scrollHeight);\n\t\tconst scrollTopChanged = (this.scrollTop !== previous.scrollTop);\n\n\t\treturn {\n\t\t\tinSmoothScrolling: inSmoothScrolling,\n\t\t\toldWidth: previous.width,\n\t\t\toldScrollWidth: previous.scrollWidth,\n\t\t\toldScrollLeft: previous.scrollLeft,\n\n\t\t\twidth: this.width,\n\t\t\tscrollWidth: this.scrollWidth,\n\t\t\tscrollLeft: this.scrollLeft,\n\n\t\t\toldHeight: previous.height,\n\t\t\toldScrollHeight: previous.scrollHeight,\n\t\t\toldScrollTop: previous.scrollTop,\n\n\t\t\theight: this.height,\n\t\t\tscrollHeight: this.scrollHeight,\n\t\t\tscrollTop: this.scrollTop,\n\n\t\t\twidthChanged: widthChanged,\n\t\t\tscrollWidthChanged: scrollWidthChanged,\n\t\t\tscrollLeftChanged: scrollLeftChanged,\n\n\t\t\theightChanged: heightChanged,\n\t\t\tscrollHeightChanged: scrollHeightChanged,\n\t\t\tscrollTopChanged: scrollTopChanged,\n\t\t};\n\t}\n\n}\n\nexport interface IScrollDimensions {\n\treadonly width: number;\n\treadonly scrollWidth: number;\n\treadonly height: number;\n\treadonly scrollHeight: number;\n}\nexport interface INewScrollDimensions {\n\twidth?: number;\n\tscrollWidth?: number;\n\theight?: number;\n\tscrollHeight?: number;\n}\n\nexport interface IScrollPosition {\n\treadonly scrollLeft: number;\n\treadonly scrollTop: number;\n}\nexport interface ISmoothScrollPosition {\n\treadonly scrollLeft: number;\n\treadonly scrollTop: number;\n\n\treadonly width: number;\n\treadonly height: number;\n}\nexport interface INewScrollPosition {\n\tscrollLeft?: number;\n\tscrollTop?: number;\n}\n\nexport interface IScrollableOptions {\n\t/**\n\t * Define if the scroll values should always be integers.\n\t */\n\tforceIntegerValues: boolean;\n\t/**\n\t * Set the duration (ms) used for smooth scroll animations.\n\t */\n\tsmoothScrollDuration: number;\n\t/**\n\t * A function to schedule an update at the next frame (used for smooth scroll animations).\n\t */\n\tscheduleAtNextAnimationFrame: (callback: () => void) => IDisposable;\n}\n\nexport class Scrollable extends Disposable {\n\n\t_scrollableBrand: void = undefined;\n\n\tprivate _smoothScrollDuration: number;\n\tprivate readonly _scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable;\n\tprivate _state: ScrollState;\n\tprivate _smoothScrolling: SmoothScrollingOperation | null;\n\n\tprivate _onScroll = this._register(new Emitter<ScrollEvent>());\n\tpublic readonly onScroll: Event<ScrollEvent> = this._onScroll.event;\n\n\tconstructor(options: IScrollableOptions) {\n\t\tsuper();\n\n\t\tthis._smoothScrollDuration = options.smoothScrollDuration;\n\t\tthis._scheduleAtNextAnimationFrame = options.scheduleAtNextAnimationFrame;\n\t\tthis._state = new ScrollState(options.forceIntegerValues, 0, 0, 0, 0, 0, 0);\n\t\tthis._smoothScrolling = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._smoothScrolling) {\n\t\t\tthis._smoothScrolling.dispose();\n\t\t\tthis._smoothScrolling = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\tpublic setSmoothScrollDuration(smoothScrollDuration: number): void {\n\t\tthis._smoothScrollDuration = smoothScrollDuration;\n\t}\n\n\tpublic validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition {\n\t\treturn this._state.withScrollPosition(scrollPosition);\n\t}\n\n\tpublic getScrollDimensions(): IScrollDimensions {\n\t\treturn this._state;\n\t}\n\n\tpublic setScrollDimensions(dimensions: INewScrollDimensions, useRawScrollPositions: boolean): void {\n\t\tconst newState = this._state.withScrollDimensions(dimensions, useRawScrollPositions);\n\t\tthis._setState(newState, Boolean(this._smoothScrolling));\n\n\t\t// Validate outstanding animated scroll position target\n\t\tif (this._smoothScrolling) {\n\t\t\tthis._smoothScrolling.acceptScrollDimensions(this._state);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the final scroll position that the instance will have once the smooth scroll animation concludes.\n\t * If no scroll animation is occurring, it will return the current scroll position instead.\n\t */\n\tpublic getFutureScrollPosition(): IScrollPosition {\n\t\tif (this._smoothScrolling) {\n\t\t\treturn this._smoothScrolling.to;\n\t\t}\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Returns the current scroll position.\n\t * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation.\n\t */\n\tpublic getCurrentScrollPosition(): IScrollPosition {\n\t\treturn this._state;\n\t}\n\n\tpublic setScrollPositionNow(update: INewScrollPosition): void {\n\t\t// no smooth scrolling requested\n\t\tconst newState = this._state.withScrollPosition(update);\n\n\t\t// Terminate any outstanding smooth scrolling\n\t\tif (this._smoothScrolling) {\n\t\t\tthis._smoothScrolling.dispose();\n\t\t\tthis._smoothScrolling = null;\n\t\t}\n\n\t\tthis._setState(newState, false);\n\t}\n\n\tpublic setScrollPositionSmooth(update: INewScrollPosition, reuseAnimation?: boolean): void {\n\t\tif (this._smoothScrollDuration === 0) {\n\t\t\t// Smooth scrolling not supported.\n\t\t\treturn this.setScrollPositionNow(update);\n\t\t}\n\n\t\tif (this._smoothScrolling) {\n\t\t\t// Combine our pending scrollLeft/scrollTop with incoming scrollLeft/scrollTop\n\t\t\tupdate = {\n\t\t\t\tscrollLeft: (typeof update.scrollLeft === 'undefined' ? this._smoothScrolling.to.scrollLeft : update.scrollLeft),\n\t\t\t\tscrollTop: (typeof update.scrollTop === 'undefined' ? this._smoothScrolling.to.scrollTop : update.scrollTop)\n\t\t\t};\n\n\t\t\t// Validate `update`\n\t\t\tconst validTarget = this._state.withScrollPosition(update);\n\n\t\t\tif (this._smoothScrolling.to.scrollLeft === validTarget.scrollLeft && this._smoothScrolling.to.scrollTop === validTarget.scrollTop) {\n\t\t\t\t// No need to interrupt or extend the current animation since we're going to the same place\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet newSmoothScrolling: SmoothScrollingOperation;\n\t\t\tif (reuseAnimation) {\n\t\t\t\tnewSmoothScrolling = new SmoothScrollingOperation(this._smoothScrolling.from, validTarget, this._smoothScrolling.startTime, this._smoothScrolling.duration);\n\t\t\t} else {\n\t\t\t\tnewSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration);\n\t\t\t}\n\t\t\tthis._smoothScrolling.dispose();\n\t\t\tthis._smoothScrolling = newSmoothScrolling;\n\t\t} else {\n\t\t\t// Validate `update`\n\t\t\tconst validTarget = this._state.withScrollPosition(update);\n\n\t\t\tthis._smoothScrolling = SmoothScrollingOperation.start(this._state, validTarget, this._smoothScrollDuration);\n\t\t}\n\n\t\t// Begin smooth scrolling animation\n\t\tthis._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {\n\t\t\tif (!this._smoothScrolling) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._smoothScrolling.animationFrameDisposable = null;\n\t\t\tthis._performSmoothScrolling();\n\t\t});\n\t}\n\n\tprivate _performSmoothScrolling(): void {\n\t\tif (!this._smoothScrolling) {\n\t\t\treturn;\n\t\t}\n\t\tconst update = this._smoothScrolling.tick();\n\t\tconst newState = this._state.withScrollPosition(update);\n\n\t\tthis._setState(newState, true);\n\n\t\tif (!this._smoothScrolling) {\n\t\t\t// Looks like someone canceled the smooth scrolling\n\t\t\t// from the scroll event handler\n\t\t\treturn;\n\t\t}\n\n\t\tif (update.isDone) {\n\t\t\tthis._smoothScrolling.dispose();\n\t\t\tthis._smoothScrolling = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// Continue smooth scrolling animation\n\t\tthis._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {\n\t\t\tif (!this._smoothScrolling) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._smoothScrolling.animationFrameDisposable = null;\n\t\t\tthis._performSmoothScrolling();\n\t\t});\n\t}\n\n\tprivate _setState(newState: ScrollState, inSmoothScrolling: boolean): void {\n\t\tconst oldState = this._state;\n\t\tif (oldState.equals(newState)) {\n\t\t\t// no change\n\t\t\treturn;\n\t\t}\n\t\tthis._state = newState;\n\t\tthis._onScroll.fire(this._state.createScrollEvent(oldState, inSmoothScrolling));\n\t}\n}\n\nexport class SmoothScrollingUpdate {\n\n\tpublic readonly scrollLeft: number;\n\tpublic readonly scrollTop: number;\n\tpublic readonly isDone: boolean;\n\n\tconstructor(scrollLeft: number, scrollTop: number, isDone: boolean) {\n\t\tthis.scrollLeft = scrollLeft;\n\t\tthis.scrollTop = scrollTop;\n\t\tthis.isDone = isDone;\n\t}\n\n}\n\nexport interface IAnimation {\n\t(completion: number): number;\n}\n\nfunction createEaseOutCubic(from: number, to: number): IAnimation {\n\tconst delta = to - from;\n\treturn function (completion: number): number {\n\t\treturn from + delta * easeOutCubic(completion);\n\t};\n}\n\nfunction createComposed(a: IAnimation, b: IAnimation, cut: number): IAnimation {\n\treturn function (completion: number): number {\n\t\tif (completion < cut) {\n\t\t\treturn a(completion / cut);\n\t\t}\n\t\treturn b((completion - cut) / (1 - cut));\n\t};\n}\n\nexport class SmoothScrollingOperation {\n\n\tpublic readonly from: ISmoothScrollPosition;\n\tpublic to: ISmoothScrollPosition;\n\tpublic readonly duration: number;\n\tpublic readonly startTime: number;\n\tpublic animationFrameDisposable: IDisposable | null;\n\n\tprivate scrollLeft!: IAnimation;\n\tprivate scrollTop!: IAnimation;\n\n\tconstructor(from: ISmoothScrollPosition, to: ISmoothScrollPosition, startTime: number, duration: number) {\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.duration = duration;\n\t\tthis.startTime = startTime;\n\n\t\tthis.animationFrameDisposable = null;\n\n\t\tthis._initAnimations();\n\t}\n\n\tprivate _initAnimations(): void {\n\t\tthis.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width);\n\t\tthis.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);\n\t}\n\n\tprivate _initAnimation(from: number, to: number, viewportSize: number): IAnimation {\n\t\tconst delta = Math.abs(from - to);\n\t\tif (delta > 2.5 * viewportSize) {\n\t\t\tlet stop1: number, stop2: number;\n\t\t\tif (from < to) {\n\t\t\t\t// scroll to 75% of the viewportSize\n\t\t\t\tstop1 = from + 0.75 * viewportSize;\n\t\t\t\tstop2 = to - 0.75 * viewportSize;\n\t\t\t} else {\n\t\t\t\tstop1 = from - 0.75 * viewportSize;\n\t\t\t\tstop2 = to + 0.75 * viewportSize;\n\t\t\t}\n\t\t\treturn createComposed(createEaseOutCubic(from, stop1), createEaseOutCubic(stop2, to), 0.33);\n\t\t}\n\t\treturn createEaseOutCubic(from, to);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.animationFrameDisposable !== null) {\n\t\t\tthis.animationFrameDisposable.dispose();\n\t\t\tthis.animationFrameDisposable = null;\n\t\t}\n\t}\n\n\tpublic acceptScrollDimensions(state: ScrollState): void {\n\t\tthis.to = state.withScrollPosition(this.to);\n\t\tthis._initAnimations();\n\t}\n\n\tpublic tick(): SmoothScrollingUpdate {\n\t\treturn this._tick(Date.now());\n\t}\n\n\tprotected _tick(now: number): SmoothScrollingUpdate {\n\t\tconst completion = (now - this.startTime) / this.duration;\n\n\t\tif (completion < 1) {\n\t\t\tconst newScrollLeft = this.scrollLeft(completion);\n\t\t\tconst newScrollTop = this.scrollTop(completion);\n\t\t\treturn new SmoothScrollingUpdate(newScrollLeft, newScrollTop, false);\n\t\t}\n\n\t\treturn new SmoothScrollingUpdate(this.to.scrollLeft, this.to.scrollTop, true);\n\t}\n\n\tpublic combine(from: ISmoothScrollPosition, to: ISmoothScrollPosition, duration: number): SmoothScrollingOperation {\n\t\treturn SmoothScrollingOperation.start(from, to, duration);\n\t}\n\n\tpublic static start(from: ISmoothScrollPosition, to: ISmoothScrollPosition, duration: number): SmoothScrollingOperation {\n\t\t// +10 / -10 : pretend the animation already started for a quicker response to a scroll request\n\t\tduration = duration + 10;\n\t\tconst startTime = Date.now() - 10;\n\n\t\treturn new SmoothScrollingOperation(from, to, startTime, duration);\n\t}\n}\n\nfunction easeInCubic(t: number) {\n\treturn Math.pow(t, 3);\n}\n\nfunction easeOutCubic(t: number) {\n\treturn 1 - easeInCubic(1 - t);\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 { LRUCachedComputed } from 'vs/base/common/cache';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { Lazy } from 'vs/base/common/lazy';\nimport { Constants } from 'vs/base/common/uint';\n\nexport function isFalsyOrWhitespace(str: string | undefined): boolean {\n\tif (!str || typeof str !== 'string') {\n\t\treturn true;\n\t}\n\treturn str.trim().length === 0;\n}\n\nconst _formatRegexp = /{(\\d+)}/g;\n\n/**\n * Helper to produce a string with a variable number of arguments. Insert variable segments\n * into the string using the {n} notation where N is the index of the argument following the string.\n * @param value string to which formatting is applied\n * @param args replacements for {n}-entries\n */\nexport function format(value: string, ...args: any[]): string {\n\tif (args.length === 0) {\n\t\treturn value;\n\t}\n\treturn value.replace(_formatRegexp, function (match, group) {\n\t\tconst idx = parseInt(group, 10);\n\t\treturn isNaN(idx) || idx < 0 || idx >= args.length ?\n\t\t\tmatch :\n\t\t\targs[idx];\n\t});\n}\n\n/**\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\n * being used e.g. in HTMLElement.innerHTML.\n */\nexport function escape(html: string): string {\n\treturn html.replace(/[<>&]/g, function (match) {\n\t\tswitch (match) {\n\t\t\tcase '<': return '<';\n\t\t\tcase '>': return '>';\n\t\t\tcase '&': return '&';\n\t\t\tdefault: return match;\n\t\t}\n\t});\n}\n\n/**\n * Escapes regular expression characters in a given string\n */\nexport function escapeRegExpCharacters(value: string): string {\n\treturn value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, '\\\\$&');\n}\n\n/**\n * Removes all occurrences of needle from the beginning and end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim (default is a blank)\n */\nexport function trim(haystack: string, needle: string = ' '): string {\n\tconst trimmed = ltrim(haystack, needle);\n\treturn rtrim(trimmed, needle);\n}\n\n/**\n * Removes all occurrences of needle from the beginning of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function ltrim(haystack: string, needle: string): string {\n\tif (!haystack || !needle) {\n\t\treturn haystack;\n\t}\n\n\tconst needleLen = needle.length;\n\tif (needleLen === 0 || haystack.length === 0) {\n\t\treturn haystack;\n\t}\n\n\tlet offset = 0;\n\n\twhile (haystack.indexOf(needle, offset) === offset) {\n\t\toffset = offset + needleLen;\n\t}\n\treturn haystack.substring(offset);\n}\n\n/**\n * Removes all occurrences of needle from the end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function rtrim(haystack: string, needle: string): string {\n\tif (!haystack || !needle) {\n\t\treturn haystack;\n\t}\n\n\tconst needleLen = needle.length,\n\t\thaystackLen = haystack.length;\n\n\tif (needleLen === 0 || haystackLen === 0) {\n\t\treturn haystack;\n\t}\n\n\tlet offset = haystackLen,\n\t\tidx = -1;\n\n\twhile (true) {\n\t\tidx = haystack.lastIndexOf(needle, offset - 1);\n\t\tif (idx === -1 || idx + needleLen !== offset) {\n\t\t\tbreak;\n\t\t}\n\t\tif (idx === 0) {\n\t\t\treturn '';\n\t\t}\n\t\toffset = idx;\n\t}\n\n\treturn haystack.substring(0, offset);\n}\n\nexport function convertSimple2RegExpPattern(pattern: string): string {\n\treturn pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\n\nexport function stripWildcards(pattern: string): string {\n\treturn pattern.replace(/\\*/g, '');\n}\n\nexport interface RegExpOptions {\n\tmatchCase?: boolean;\n\twholeWord?: boolean;\n\tmultiline?: boolean;\n\tglobal?: boolean;\n\tunicode?: boolean;\n}\n\nexport function createRegExp(searchString: string, isRegex: boolean, options: RegExpOptions = {}): RegExp {\n\tif (!searchString) {\n\t\tthrow new Error('Cannot create regex from empty string');\n\t}\n\tif (!isRegex) {\n\t\tsearchString = escapeRegExpCharacters(searchString);\n\t}\n\tif (options.wholeWord) {\n\t\tif (!/\\B/.test(searchString.charAt(0))) {\n\t\t\tsearchString = '\\\\b' + searchString;\n\t\t}\n\t\tif (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\n\t\t\tsearchString = searchString + '\\\\b';\n\t\t}\n\t}\n\tlet modifiers = '';\n\tif (options.global) {\n\t\tmodifiers += 'g';\n\t}\n\tif (!options.matchCase) {\n\t\tmodifiers += 'i';\n\t}\n\tif (options.multiline) {\n\t\tmodifiers += 'm';\n\t}\n\tif (options.unicode) {\n\t\tmodifiers += 'u';\n\t}\n\n\treturn new RegExp(searchString, modifiers);\n}\n\nexport function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {\n\t// Exit early if it's one of these special cases which are meant to match\n\t// against an empty string\n\tif (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\n\t\treturn false;\n\t}\n\n\t// We check against an empty string. If the regular expression doesn't advance\n\t// (e.g. ends in an endless loop) it will match an empty string.\n\tconst match = regexp.exec('');\n\treturn !!(match && regexp.lastIndex === 0);\n}\n\nexport function regExpFlags(regexp: RegExp): string {\n\treturn (regexp.global ? 'g' : '')\n\t\t+ (regexp.ignoreCase ? 'i' : '')\n\t\t+ (regexp.multiline ? 'm' : '')\n\t\t+ ((regexp as any /* standalone editor compilation */).unicode ? 'u' : '');\n}\n\nexport function splitLines(str: string): string[] {\n\treturn str.split(/\\r\\n|\\r|\\n/);\n}\n\n/**\n * Returns first index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function firstNonWhitespaceIndex(str: string): number {\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tconst chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * Returns the leading whitespace of the string.\n * If the string contains only whitespaces, returns entire string\n */\nexport function getLeadingWhitespace(str: string, start: number = 0, end: number = str.length): string {\n\tfor (let i = start; i < end; i++) {\n\t\tconst chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn str.substring(start, i);\n\t\t}\n\t}\n\treturn str.substring(start, end);\n}\n\n/**\n * Returns last index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function lastNonWhitespaceIndex(str: string, startIndex: number = str.length - 1): number {\n\tfor (let i = startIndex; i >= 0; i--) {\n\t\tconst chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nexport function compare(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t} else if (a > b) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}\n\nexport function compareSubstring(a: string, b: string, aStart: number = 0, aEnd: number = a.length, bStart: number = 0, bEnd: number = b.length): number {\n\tfor (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n\t\tlet codeA = a.charCodeAt(aStart);\n\t\tlet codeB = b.charCodeAt(bStart);\n\t\tif (codeA < codeB) {\n\t\t\treturn -1;\n\t\t} else if (codeA > codeB) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\tconst aLen = aEnd - aStart;\n\tconst bLen = bEnd - bStart;\n\tif (aLen < bLen) {\n\t\treturn -1;\n\t} else if (aLen > bLen) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport function compareIgnoreCase(a: string, b: string): number {\n\treturn compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);\n}\n\nexport function compareSubstringIgnoreCase(a: string, b: string, aStart: number = 0, aEnd: number = a.length, bStart: number = 0, bEnd: number = b.length): number {\n\n\tfor (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n\n\t\tlet codeA = a.charCodeAt(aStart);\n\t\tlet codeB = b.charCodeAt(bStart);\n\n\t\tif (codeA === codeB) {\n\t\t\t// equal\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (codeA >= 128 || codeB >= 128) {\n\t\t\t// not ASCII letters -> fallback to lower-casing strings\n\t\t\treturn compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);\n\t\t}\n\n\t\t// mapper lower-case ascii letter onto upper-case varinats\n\t\t// [97-122] (lower ascii) --> [65-90] (upper ascii)\n\t\tif (isLowerAsciiLetter(codeA)) {\n\t\t\tcodeA -= 32;\n\t\t}\n\t\tif (isLowerAsciiLetter(codeB)) {\n\t\t\tcodeB -= 32;\n\t\t}\n\n\t\t// compare both code points\n\t\tconst diff = codeA - codeB;\n\t\tif (diff === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn diff;\n\t}\n\n\tconst aLen = aEnd - aStart;\n\tconst bLen = bEnd - bStart;\n\n\tif (aLen < bLen) {\n\t\treturn -1;\n\t} else if (aLen > bLen) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\nexport function isLowerAsciiLetter(code: number): boolean {\n\treturn code >= CharCode.a && code <= CharCode.z;\n}\n\nexport function isUpperAsciiLetter(code: number): boolean {\n\treturn code >= CharCode.A && code <= CharCode.Z;\n}\n\nexport function equalsIgnoreCase(a: string, b: string): boolean {\n\treturn a.length === b.length && compareSubstringIgnoreCase(a, b) === 0;\n}\n\nexport function startsWithIgnoreCase(str: string, candidate: string): boolean {\n\tconst candidateLength = candidate.length;\n\tif (candidate.length > str.length) {\n\t\treturn false;\n\t}\n\n\treturn compareSubstringIgnoreCase(str, candidate, 0, candidateLength) === 0;\n}\n\n/**\n * @returns the length of the common prefix of the two strings.\n */\nexport function commonPrefixLength(a: string, b: string): number {\n\n\tlet i: number,\n\t\tlen = Math.min(a.length, b.length);\n\n\tfor (i = 0; i < len; i++) {\n\t\tif (a.charCodeAt(i) !== b.charCodeAt(i)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn len;\n}\n\n/**\n * @returns the length of the common suffix of the two strings.\n */\nexport function commonSuffixLength(a: string, b: string): number {\n\n\tlet i: number,\n\t\tlen = Math.min(a.length, b.length);\n\n\tconst aLastIndex = a.length - 1;\n\tconst bLastIndex = b.length - 1;\n\n\tfor (i = 0; i < len; i++) {\n\t\tif (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn len;\n}\n\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isHighSurrogate(charCode: number): boolean {\n\treturn (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isLowSurrogate(charCode: number): boolean {\n\treturn (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function computeCodePoint(highSurrogate: number, lowSurrogate: number): number {\n\treturn ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;\n}\n\n/**\n * get the code point that begins at offset `offset`\n */\nexport function getNextCodePoint(str: string, len: number, offset: number): number {\n\tconst charCode = str.charCodeAt(offset);\n\tif (isHighSurrogate(charCode) && offset + 1 < len) {\n\t\tconst nextCharCode = str.charCodeAt(offset + 1);\n\t\tif (isLowSurrogate(nextCharCode)) {\n\t\t\treturn computeCodePoint(charCode, nextCharCode);\n\t\t}\n\t}\n\treturn charCode;\n}\n\n/**\n * get the code point that ends right before offset `offset`\n */\nfunction getPrevCodePoint(str: string, offset: number): number {\n\tconst charCode = str.charCodeAt(offset - 1);\n\tif (isLowSurrogate(charCode) && offset > 1) {\n\t\tconst prevCharCode = str.charCodeAt(offset - 2);\n\t\tif (isHighSurrogate(prevCharCode)) {\n\t\t\treturn computeCodePoint(prevCharCode, charCode);\n\t\t}\n\t}\n\treturn charCode;\n}\n\nexport class CodePointIterator {\n\n\tprivate readonly _str: string;\n\tprivate readonly _len: number;\n\tprivate _offset: number;\n\n\tpublic get offset(): number {\n\t\treturn this._offset;\n\t}\n\n\tconstructor(str: string, offset: number = 0) {\n\t\tthis._str = str;\n\t\tthis._len = str.length;\n\t\tthis._offset = offset;\n\t}\n\n\tpublic setOffset(offset: number): void {\n\t\tthis._offset = offset;\n\t}\n\n\tpublic prevCodePoint(): number {\n\t\tconst codePoint = getPrevCodePoint(this._str, this._offset);\n\t\tthis._offset -= (codePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\n\t\treturn codePoint;\n\t}\n\n\tpublic nextCodePoint(): number {\n\t\tconst codePoint = getNextCodePoint(this._str, this._len, this._offset);\n\t\tthis._offset += (codePoint >= Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN ? 2 : 1);\n\t\treturn codePoint;\n\t}\n\n\tpublic eol(): boolean {\n\t\treturn (this._offset >= this._len);\n\t}\n}\n\nexport class GraphemeIterator {\n\n\tprivate readonly _iterator: CodePointIterator;\n\n\tpublic get offset(): number {\n\t\treturn this._iterator.offset;\n\t}\n\n\tconstructor(str: string, offset: number = 0) {\n\t\tthis._iterator = new CodePointIterator(str, offset);\n\t}\n\n\tpublic nextGraphemeLength(): number {\n\t\tconst graphemeBreakTree = GraphemeBreakTree.getInstance();\n\t\tconst iterator = this._iterator;\n\t\tconst initialOffset = iterator.offset;\n\n\t\tlet graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());\n\t\twhile (!iterator.eol()) {\n\t\t\tconst offset = iterator.offset;\n\t\t\tconst nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());\n\t\t\tif (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\n\t\t\t\t// move iterator back\n\t\t\t\titerator.setOffset(offset);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tgraphemeBreakType = nextGraphemeBreakType;\n\t\t}\n\t\treturn (iterator.offset - initialOffset);\n\t}\n\n\tpublic prevGraphemeLength(): number {\n\t\tconst graphemeBreakTree = GraphemeBreakTree.getInstance();\n\t\tconst iterator = this._iterator;\n\t\tconst initialOffset = iterator.offset;\n\n\t\tlet graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());\n\t\twhile (iterator.offset > 0) {\n\t\t\tconst offset = iterator.offset;\n\t\t\tconst prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());\n\t\t\tif (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {\n\t\t\t\t// move iterator back\n\t\t\t\titerator.setOffset(offset);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tgraphemeBreakType = prevGraphemeBreakType;\n\t\t}\n\t\treturn (initialOffset - iterator.offset);\n\t}\n\n\tpublic eol(): boolean {\n\t\treturn this._iterator.eol();\n\t}\n}\n\nexport function nextCharLength(str: string, initialOffset: number): number {\n\tconst iterator = new GraphemeIterator(str, initialOffset);\n\treturn iterator.nextGraphemeLength();\n}\n\nexport function prevCharLength(str: string, initialOffset: number): number {\n\tconst iterator = new GraphemeIterator(str, initialOffset);\n\treturn iterator.prevGraphemeLength();\n}\n\nexport function getCharContainingOffset(str: string, offset: number): [number, number] {\n\tif (offset > 0 && isLowSurrogate(str.charCodeAt(offset))) {\n\t\toffset--;\n\t}\n\tconst endOffset = offset + nextCharLength(str, offset);\n\tconst startOffset = endOffset - prevCharLength(str, endOffset);\n\treturn [startOffset, endOffset];\n}\n\n/**\n * Generated using https://github.com/alexdima/unicode-utils/blob/main/rtl-test.js\n */\nconst CONTAINS_RTL = /(?:[\\u05BE\\u05C0\\u05C3\\u05C6\\u05D0-\\u05F4\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1-\\u07EA\\u07F4\\u07F5\\u07FA\\u07FE-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u088E\\u08A0-\\u08C9\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDC7\\uFDF0-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE35\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDD23\\uDE80-\\uDEA9\\uDEAD-\\uDF45\\uDF51-\\uDF81\\uDF86-\\uDFF6]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD4B-\\uDFFF]|\\uD83B[\\uDC00-\\uDEBB])/;\n\n/**\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\n */\nexport function containsRTL(str: string): boolean {\n\treturn CONTAINS_RTL.test(str);\n}\n\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\n/**\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\n */\nexport function isBasicASCII(str: string): boolean {\n\treturn IS_BASIC_ASCII.test(str);\n}\n\nexport const UNUSUAL_LINE_TERMINATORS = /[\\u2028\\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS)\n/**\n * Returns true if `str` contains unusual line terminators, like LS or PS\n */\nexport function containsUnusualLineTerminators(str: string): boolean {\n\treturn UNUSUAL_LINE_TERMINATORS.test(str);\n}\n\nexport function isFullWidthCharacter(charCode: number): boolean {\n\t// Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\n\t// http://jrgraphix.net/research/unicode_blocks.php\n\t// 2E80 - 2EFF CJK Radicals Supplement\n\t// 2F00 - 2FDF Kangxi Radicals\n\t// 2FF0 - 2FFF Ideographic Description Characters\n\t// 3000 - 303F CJK Symbols and Punctuation\n\t// 3040 - 309F Hiragana\n\t// 30A0 - 30FF Katakana\n\t// 3100 - 312F Bopomofo\n\t// 3130 - 318F Hangul Compatibility Jamo\n\t// 3190 - 319F Kanbun\n\t// 31A0 - 31BF Bopomofo Extended\n\t// 31F0 - 31FF Katakana Phonetic Extensions\n\t// 3200 - 32FF Enclosed CJK Letters and Months\n\t// 3300 - 33FF CJK Compatibility\n\t// 3400 - 4DBF CJK Unified Ideographs Extension A\n\t// 4DC0 - 4DFF Yijing Hexagram Symbols\n\t// 4E00 - 9FFF CJK Unified Ideographs\n\t// A000 - A48F Yi Syllables\n\t// A490 - A4CF Yi Radicals\n\t// AC00 - D7AF Hangul Syllables\n\t// [IGNORE] D800 - DB7F High Surrogates\n\t// [IGNORE] DB80 - DBFF High Private Use Surrogates\n\t// [IGNORE] DC00 - DFFF Low Surrogates\n\t// [IGNORE] E000 - F8FF Private Use Area\n\t// F900 - FAFF CJK Compatibility Ideographs\n\t// [IGNORE] FB00 - FB4F Alphabetic Presentation Forms\n\t// [IGNORE] FB50 - FDFF Arabic Presentation Forms-A\n\t// [IGNORE] FE00 - FE0F Variation Selectors\n\t// [IGNORE] FE20 - FE2F Combining Half Marks\n\t// [IGNORE] FE30 - FE4F CJK Compatibility Forms\n\t// [IGNORE] FE50 - FE6F Small Form Variants\n\t// [IGNORE] FE70 - FEFF Arabic Presentation Forms-B\n\t// FF00 - FFEF Halfwidth and Fullwidth Forms\n\t// [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\n\t// of which FF01 - FF5E fullwidth ASCII of 21 to 7E\n\t// [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul\n\t// [IGNORE] FFF0 - FFFF Specials\n\treturn (\n\t\t(charCode >= 0x2E80 && charCode <= 0xD7AF)\n\t\t|| (charCode >= 0xF900 && charCode <= 0xFAFF)\n\t\t|| (charCode >= 0xFF01 && charCode <= 0xFF5E)\n\t);\n}\n\n/**\n * A fast function (therefore imprecise) to check if code points are emojis.\n * Generated using https://github.com/alexdima/unicode-utils/blob/main/emoji-test.js\n */\nexport function isEmojiImprecise(x: number): boolean {\n\treturn (\n\t\t(x >= 0x1F1E6 && x <= 0x1F1FF) || (x === 8986) || (x === 8987) || (x === 9200)\n\t\t|| (x === 9203) || (x >= 9728 && x <= 10175) || (x === 11088) || (x === 11093)\n\t\t|| (x >= 127744 && x <= 128591) || (x >= 128640 && x <= 128764)\n\t\t|| (x >= 128992 && x <= 129008) || (x >= 129280 && x <= 129535)\n\t\t|| (x >= 129648 && x <= 129782)\n\t);\n}\n\n// -- UTF-8 BOM\n\nexport const UTF8_BOM_CHARACTER = String.fromCharCode(CharCode.UTF8_BOM);\n\nexport function startsWithUTF8BOM(str: string): boolean {\n\treturn !!(str && str.length > 0 && str.charCodeAt(0) === CharCode.UTF8_BOM);\n}\n\nexport function containsUppercaseCharacter(target: string, ignoreEscapedChars = false): boolean {\n\tif (!target) {\n\t\treturn false;\n\t}\n\n\tif (ignoreEscapedChars) {\n\t\ttarget = target.replace(/\\\\./g, '');\n\t}\n\n\treturn target.toLowerCase() !== target;\n}\n\n/**\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\n */\nexport function singleLetterHash(n: number): string {\n\tconst LETTERS_CNT = (CharCode.Z - CharCode.A + 1);\n\n\tn = n % (2 * LETTERS_CNT);\n\n\tif (n < LETTERS_CNT) {\n\t\treturn String.fromCharCode(CharCode.a + n);\n\t}\n\n\treturn String.fromCharCode(CharCode.A + n - LETTERS_CNT);\n}\n\nfunction breakBetweenGraphemeBreakType(breakTypeA: GraphemeBreakType, breakTypeB: GraphemeBreakType): boolean {\n\t// http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules\n\n\t// !!! Let's make the common case a bit faster\n\tif (breakTypeA === GraphemeBreakType.Other) {\n\t\t// see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table\n\t\treturn (breakTypeB !== GraphemeBreakType.Extend && breakTypeB !== GraphemeBreakType.SpacingMark);\n\t}\n\n\t// Do not break between a CR and LF. Otherwise, break before and after controls.\n\t// GB3 CR × LF\n\t// GB4 (Control | CR | LF) ÷\n\t// GB5 ÷ (Control | CR | LF)\n\tif (breakTypeA === GraphemeBreakType.CR) {\n\t\tif (breakTypeB === GraphemeBreakType.LF) {\n\t\t\treturn false; // GB3\n\t\t}\n\t}\n\tif (breakTypeA === GraphemeBreakType.Control || breakTypeA === GraphemeBreakType.CR || breakTypeA === GraphemeBreakType.LF) {\n\t\treturn true; // GB4\n\t}\n\tif (breakTypeB === GraphemeBreakType.Control || breakTypeB === GraphemeBreakType.CR || breakTypeB === GraphemeBreakType.LF) {\n\t\treturn true; // GB5\n\t}\n\n\t// Do not break Hangul syllable sequences.\n\t// GB6 L × (L | V | LV | LVT)\n\t// GB7 (LV | V) × (V | T)\n\t// GB8 (LVT | T) × T\n\tif (breakTypeA === GraphemeBreakType.L) {\n\t\tif (breakTypeB === GraphemeBreakType.L || breakTypeB === GraphemeBreakType.V || breakTypeB === GraphemeBreakType.LV || breakTypeB === GraphemeBreakType.LVT) {\n\t\t\treturn false; // GB6\n\t\t}\n\t}\n\tif (breakTypeA === GraphemeBreakType.LV || breakTypeA === GraphemeBreakType.V) {\n\t\tif (breakTypeB === GraphemeBreakType.V || breakTypeB === GraphemeBreakType.T) {\n\t\t\treturn false; // GB7\n\t\t}\n\t}\n\tif (breakTypeA === GraphemeBreakType.LVT || breakTypeA === GraphemeBreakType.T) {\n\t\tif (breakTypeB === GraphemeBreakType.T) {\n\t\t\treturn false; // GB8\n\t\t}\n\t}\n\n\t// Do not break before extending characters or ZWJ.\n\t// GB9 × (Extend | ZWJ)\n\tif (breakTypeB === GraphemeBreakType.Extend || breakTypeB === GraphemeBreakType.ZWJ) {\n\t\treturn false; // GB9\n\t}\n\n\t// The GB9a and GB9b rules only apply to extended grapheme clusters:\n\t// Do not break before SpacingMarks, or after Prepend characters.\n\t// GB9a × SpacingMark\n\t// GB9b Prepend ×\n\tif (breakTypeB === GraphemeBreakType.SpacingMark) {\n\t\treturn false; // GB9a\n\t}\n\tif (breakTypeA === GraphemeBreakType.Prepend) {\n\t\treturn false; // GB9b\n\t}\n\n\t// Do not break within emoji modifier sequences or emoji zwj sequences.\n\t// GB11 \\p{Extended_Pictographic} Extend* ZWJ × \\p{Extended_Pictographic}\n\tif (breakTypeA === GraphemeBreakType.ZWJ && breakTypeB === GraphemeBreakType.Extended_Pictographic) {\n\t\t// Note: we are not implementing the rule entirely here to avoid introducing states\n\t\treturn false; // GB11\n\t}\n\n\t// GB12 sot (RI RI)* RI × RI\n\t// GB13 [^RI] (RI RI)* RI × RI\n\tif (breakTypeA === GraphemeBreakType.Regional_Indicator && breakTypeB === GraphemeBreakType.Regional_Indicator) {\n\t\t// Note: we are not implementing the rule entirely here to avoid introducing states\n\t\treturn false; // GB12 & GB13\n\t}\n\n\t// GB999 Any ÷ Any\n\treturn true;\n}\n\nexport const enum GraphemeBreakType {\n\tOther = 0,\n\tPrepend = 1,\n\tCR = 2,\n\tLF = 3,\n\tControl = 4,\n\tExtend = 5,\n\tRegional_Indicator = 6,\n\tSpacingMark = 7,\n\tL = 8,\n\tV = 9,\n\tT = 10,\n\tLV = 11,\n\tLVT = 12,\n\tZWJ = 13,\n\tExtended_Pictographic = 14\n}\n\nclass GraphemeBreakTree {\n\n\tprivate static _INSTANCE: GraphemeBreakTree | null = null;\n\tpublic static getInstance(): GraphemeBreakTree {\n\t\tif (!GraphemeBreakTree._INSTANCE) {\n\t\t\tGraphemeBreakTree._INSTANCE = new GraphemeBreakTree();\n\t\t}\n\t\treturn GraphemeBreakTree._INSTANCE;\n\t}\n\n\tprivate readonly _data: number[];\n\n\tconstructor() {\n\t\tthis._data = getGraphemeBreakRawData();\n\t}\n\n\tpublic getGraphemeBreakType(codePoint: number): GraphemeBreakType {\n\t\t// !!! Let's make 7bit ASCII a bit faster: 0..31\n\t\tif (codePoint < 32) {\n\t\t\tif (codePoint === CharCode.LineFeed) {\n\t\t\t\treturn GraphemeBreakType.LF;\n\t\t\t}\n\t\t\tif (codePoint === CharCode.CarriageReturn) {\n\t\t\t\treturn GraphemeBreakType.CR;\n\t\t\t}\n\t\t\treturn GraphemeBreakType.Control;\n\t\t}\n\t\t// !!! Let's make 7bit ASCII a bit faster: 32..126\n\t\tif (codePoint < 127) {\n\t\t\treturn GraphemeBreakType.Other;\n\t\t}\n\n\t\tconst data = this._data;\n\t\tconst nodeCount = data.length / 3;\n\t\tlet nodeIndex = 1;\n\t\twhile (nodeIndex <= nodeCount) {\n\t\t\tif (codePoint < data[3 * nodeIndex]) {\n\t\t\t\t// go left\n\t\t\t\tnodeIndex = 2 * nodeIndex;\n\t\t\t} else if (codePoint > data[3 * nodeIndex + 1]) {\n\t\t\t\t// go right\n\t\t\t\tnodeIndex = 2 * nodeIndex + 1;\n\t\t\t} else {\n\t\t\t\t// hit\n\t\t\t\treturn data[3 * nodeIndex + 2];\n\t\t\t}\n\t\t}\n\n\t\treturn GraphemeBreakType.Other;\n\t}\n}\n\nfunction getGraphemeBreakRawData(): number[] {\n\t// generated using https://github.com/alexdima/unicode-utils/blob/main/grapheme-break.js\n\treturn JSON.parse('[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]');\n}\n\n//#endregion\n\n/**\n * Computes the offset after performing a left delete on the given string,\n * while considering unicode grapheme/emoji rules.\n*/\nexport function getLeftDeleteOffset(offset: number, str: string): number {\n\tif (offset === 0) {\n\t\treturn 0;\n\t}\n\n\t// Try to delete emoji part.\n\tconst emojiOffset = getOffsetBeforeLastEmojiComponent(offset, str);\n\tif (emojiOffset !== undefined) {\n\t\treturn emojiOffset;\n\t}\n\n\t// Otherwise, just skip a single code point.\n\tconst iterator = new CodePointIterator(str, offset);\n\titerator.prevCodePoint();\n\treturn iterator.offset;\n}\n\nfunction getOffsetBeforeLastEmojiComponent(initialOffset: number, str: string): number | undefined {\n\t// See https://www.unicode.org/reports/tr51/tr51-14.html#EBNF_and_Regex for the\n\t// structure of emojis.\n\tconst iterator = new CodePointIterator(str, initialOffset);\n\tlet codePoint = iterator.prevCodePoint();\n\n\t// Skip modifiers\n\twhile ((isEmojiModifier(codePoint) || codePoint === CodePoint.emojiVariantSelector || codePoint === CodePoint.enclosingKeyCap)) {\n\t\tif (iterator.offset === 0) {\n\t\t\t// Cannot skip modifier, no preceding emoji base.\n\t\t\treturn undefined;\n\t\t}\n\t\tcodePoint = iterator.prevCodePoint();\n\t}\n\n\t// Expect base emoji\n\tif (!isEmojiImprecise(codePoint)) {\n\t\t// Unexpected code point, not a valid emoji.\n\t\treturn undefined;\n\t}\n\n\tlet resultOffset = iterator.offset;\n\n\tif (resultOffset > 0) {\n\t\t// Skip optional ZWJ code points that combine multiple emojis.\n\t\t// In theory, we should check if that ZWJ actually combines multiple emojis\n\t\t// to prevent deleting ZWJs in situations we didn't account for.\n\t\tconst optionalZwjCodePoint = iterator.prevCodePoint();\n\t\tif (optionalZwjCodePoint === CodePoint.zwj) {\n\t\t\tresultOffset = iterator.offset;\n\t\t}\n\t}\n\n\treturn resultOffset;\n}\n\nfunction isEmojiModifier(codePoint: number): boolean {\n\treturn 0x1F3FB <= codePoint && codePoint <= 0x1F3FF;\n}\n\nconst enum CodePoint {\n\tzwj = 0x200D,\n\n\t/**\n\t * Variation Selector-16 (VS16)\n\t*/\n\temojiVariantSelector = 0xFE0F,\n\n\t/**\n\t * Combining Enclosing Keycap\n\t */\n\tenclosingKeyCap = 0x20E3,\n}\n\nexport const noBreakWhitespace = '\\xa0';\n\nexport class AmbiguousCharacters {\n\tprivate static readonly ambiguousCharacterData = new Lazy<\n\t\tRecord<\n\t\t\tstring | '_common' | '_default',\n\t\t\t/* code point -> ascii code point */ number[]\n\t\t>\n\t>(() => {\n\t\t// Generated using https://github.com/hediet/vscode-unicode-data\n\t\t// Stored as key1, value1, key2, value2, ...\n\t\treturn JSON.parse(\n\t\t\t'{\\\"_common\\\":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125],\\\"_default\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"cs\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"de\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"es\\\":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"fr\\\":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"it\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"ja\\\":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],\\\"ko\\\":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"pl\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"pt-BR\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"qps-ploc\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"ru\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"tr\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"zh-hans\\\":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],\\\"zh-hant\\\":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'\n\t\t);\n\t});\n\n\tprivate static readonly cache = new LRUCachedComputed<\n\t\tstring[],\n\t\tAmbiguousCharacters\n\t>((locales) => {\n\t\tfunction arrayToMap(arr: number[]): Map<number, number> {\n\t\t\tconst result = new Map<number, number>();\n\t\t\tfor (let i = 0; i < arr.length; i += 2) {\n\t\t\t\tresult.set(arr[i], arr[i + 1]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tfunction mergeMaps(\n\t\t\tmap1: Map<number, number>,\n\t\t\tmap2: Map<number, number>\n\t\t): Map<number, number> {\n\t\t\tconst result = new Map<number, number>(map1);\n\t\t\tfor (const [key, value] of map2) {\n\t\t\t\tresult.set(key, value);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tfunction intersectMaps(\n\t\t\tmap1: Map<number, number> | undefined,\n\t\t\tmap2: Map<number, number>\n\t\t) {\n\t\t\tif (!map1) {\n\t\t\t\treturn map2;\n\t\t\t}\n\t\t\tconst result = new Map<number, number>();\n\t\t\tfor (const [key, value] of map1) {\n\t\t\t\tif (map2.has(key)) {\n\t\t\t\t\tresult.set(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tconst data = this.ambiguousCharacterData.getValue();\n\n\t\tlet filteredLocales = locales.filter(\n\t\t\t(l) => !l.startsWith('_') && l in data\n\t\t);\n\t\tif (filteredLocales.length === 0) {\n\t\t\tfilteredLocales = ['_default'];\n\t\t}\n\n\t\tlet languageSpecificMap: Map<number, number> | undefined = undefined;\n\t\tfor (const locale of filteredLocales) {\n\t\t\tconst map = arrayToMap(data[locale]);\n\t\t\tlanguageSpecificMap = intersectMaps(languageSpecificMap, map);\n\t\t}\n\n\t\tconst commonMap = arrayToMap(data['_common']);\n\t\tconst map = mergeMaps(commonMap, languageSpecificMap!);\n\n\t\treturn new AmbiguousCharacters(map);\n\t});\n\n\tpublic static getInstance(locales: Set<string>): AmbiguousCharacters {\n\t\treturn AmbiguousCharacters.cache.get(Array.from(locales));\n\t}\n\n\tprivate static _locales = new Lazy<string[]>(() =>\n\t\tObject.keys(AmbiguousCharacters.ambiguousCharacterData.getValue()).filter(\n\t\t\t(k) => !k.startsWith('_')\n\t\t)\n\t);\n\tpublic static getLocales(): string[] {\n\t\treturn AmbiguousCharacters._locales.getValue();\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly confusableDictionary: Map<number, number>\n\t) { }\n\n\tpublic isAmbiguous(codePoint: number): boolean {\n\t\treturn this.confusableDictionary.has(codePoint);\n\t}\n\n\t/**\n\t * Returns the non basic ASCII code point that the given code point can be confused,\n\t * or undefined if such code point does note exist.\n\t */\n\tpublic getPrimaryConfusable(codePoint: number): number | undefined {\n\t\treturn this.confusableDictionary.get(codePoint);\n\t}\n\n\tpublic getConfusableCodePoints(): ReadonlySet<number> {\n\t\treturn new Set(this.confusableDictionary.keys());\n\t}\n}\n\nexport class InvisibleCharacters {\n\tprivate static getRawData(): number[] {\n\t\t// Generated using https://github.com/hediet/vscode-unicode-data\n\t\treturn JSON.parse('[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]');\n\t}\n\n\tprivate static _data: Set<number> | undefined = undefined;\n\n\tprivate static getData() {\n\t\tif (!this._data) {\n\t\t\tthis._data = new Set(InvisibleCharacters.getRawData());\n\t\t}\n\t\treturn this._data;\n\t}\n\n\tpublic static isInvisibleCharacter(codePoint: number): boolean {\n\t\treturn InvisibleCharacters.getData().has(codePoint);\n\t}\n\n\tpublic static get codePoints(): ReadonlySet<number> {\n\t\treturn InvisibleCharacters.getData();\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { normalize, posix, sep } from 'vs/base/common/path';\nimport { isWindows } from 'vs/base/common/platform';\nimport { startsWithIgnoreCase } from 'vs/base/common/strings';\n\nexport function isPathSeparator(code: number) {\n\treturn code === CharCode.Slash || code === CharCode.Backslash;\n}\n\n/**\n * Takes a Windows OS path and changes backward slashes to forward slashes.\n * This should only be done for OS paths from Windows (or user provided paths potentially from Windows).\n * Using it on a Linux or MaxOS path might change it.\n */\nexport function toSlashes(osPath: string) {\n\treturn osPath.replace(/[\\\\/]/g, posix.sep);\n}\n\n/**\n * Takes a Windows OS path (using backward or forward slashes) and turns it into a posix path:\n * - turns backward slashes into forward slashes\n * - makes it absolute if it starts with a drive letter\n * This should only be done for OS paths from Windows (or user provided paths potentially from Windows).\n * Using it on a Linux or MaxOS path might change it.\n */\nexport function toPosixPath(osPath: string) {\n\tif (osPath.indexOf('/') === -1) {\n\t\tosPath = toSlashes(osPath);\n\t}\n\tif (/^[a-zA-Z]:(\\/|$)/.test(osPath)) { // starts with a drive letter\n\t\tosPath = '/' + osPath;\n\t}\n\treturn osPath;\n}\n\n/**\n * Computes the _root_ this path, like `getRoot('c:\\files') === c:\\`,\n * `getRoot('files:///files/path') === files:///`,\n * or `getRoot('\\\\server\\shares\\path') === \\\\server\\shares\\`\n */\nexport function getRoot(path: string, sep: string = posix.sep): string {\n\tif (!path) {\n\t\treturn '';\n\t}\n\n\tconst len = path.length;\n\tconst firstLetter = path.charCodeAt(0);\n\tif (isPathSeparator(firstLetter)) {\n\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t// UNC candidate \\\\localhost\\shares\\ddd\n\t\t\t// ^^^^^^^^^^^^^^^^^^^\n\t\t\tif (!isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\tlet pos = 3;\n\t\t\t\tconst start = pos;\n\t\t\t\tfor (; pos < len; pos++) {\n\t\t\t\t\tif (isPathSeparator(path.charCodeAt(pos))) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (start !== pos && !isPathSeparator(path.charCodeAt(pos + 1))) {\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tfor (; pos < len; pos++) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(pos))) {\n\t\t\t\t\t\t\treturn path.slice(0, pos + 1) // consume this separator\n\t\t\t\t\t\t\t\t.replace(/[\\\\/]/g, sep);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// /user/far\n\t\t// ^\n\t\treturn sep;\n\n\t} else if (isWindowsDriveLetter(firstLetter)) {\n\t\t// check for windows drive letter c:\\ or c:\n\n\t\tif (path.charCodeAt(1) === CharCode.Colon) {\n\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t// C:\\fff\n\t\t\t\t// ^^^\n\t\t\t\treturn path.slice(0, 2) + sep;\n\t\t\t} else {\n\t\t\t\t// C:\n\t\t\t\t// ^^\n\t\t\t\treturn path.slice(0, 2);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check for URI\n\t// scheme://authority/path\n\t// ^^^^^^^^^^^^^^^^^^^\n\tlet pos = path.indexOf('://');\n\tif (pos !== -1) {\n\t\tpos += 3; // 3 -> \"://\".length\n\t\tfor (; pos < len; pos++) {\n\t\t\tif (isPathSeparator(path.charCodeAt(pos))) {\n\t\t\t\treturn path.slice(0, pos + 1); // consume this separator\n\t\t\t}\n\t\t}\n\t}\n\n\treturn '';\n}\n\n/**\n * @deprecated please use `IUriIdentityService.extUri.isEqualOrParent` instead. If\n * you are in a context without services, consider to pass down the `extUri` from the\n * outside, or use `extUriBiasedIgnorePathCase` if you know what you are doing.\n */\nexport function isEqualOrParent(base: string, parentCandidate: string, ignoreCase?: boolean, separator = sep): boolean {\n\tif (base === parentCandidate) {\n\t\treturn true;\n\t}\n\n\tif (!base || !parentCandidate) {\n\t\treturn false;\n\t}\n\n\tif (parentCandidate.length > base.length) {\n\t\treturn false;\n\t}\n\n\tif (ignoreCase) {\n\t\tconst beginsWith = startsWithIgnoreCase(base, parentCandidate);\n\t\tif (!beginsWith) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (parentCandidate.length === base.length) {\n\t\t\treturn true; // same path, different casing\n\t\t}\n\n\t\tlet sepOffset = parentCandidate.length;\n\t\tif (parentCandidate.charAt(parentCandidate.length - 1) === separator) {\n\t\t\tsepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character\n\t\t}\n\n\t\treturn base.charAt(sepOffset) === separator;\n\t}\n\n\tif (parentCandidate.charAt(parentCandidate.length - 1) !== separator) {\n\t\tparentCandidate += separator;\n\t}\n\n\treturn base.indexOf(parentCandidate) === 0;\n}\n\nexport function isWindowsDriveLetter(char0: number): boolean {\n\treturn char0 >= CharCode.A && char0 <= CharCode.Z || char0 >= CharCode.a && char0 <= CharCode.z;\n}\n\nexport function isRootOrDriveLetter(path: string): boolean {\n\tconst pathNormalized = normalize(path);\n\n\tif (isWindows) {\n\t\tif (path.length > 3) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn hasDriveLetter(pathNormalized) &&\n\t\t\t(path.length === 2 || pathNormalized.charCodeAt(2) === CharCode.Backslash);\n\t}\n\n\treturn pathNormalized === posix.sep;\n}\n\nexport function hasDriveLetter(path: string, continueAsWindows?: boolean): boolean {\n\tconst isWindowsPath: boolean = ((continueAsWindows !== undefined) ? continueAsWindows : isWindows);\n\tif (isWindowsPath) {\n\t\treturn isWindowsDriveLetter(path.charCodeAt(0)) && path.charCodeAt(1) === CharCode.Colon;\n\t}\n\n\treturn false;\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 * as strings from 'vs/base/common/strings';\n\n/**\n * Return a hash value for an object.\n */\nexport function hash(obj: any): number {\n\treturn doHash(obj, 0);\n}\n\nexport function doHash(obj: any, hashVal: number): number {\n\tswitch (typeof obj) {\n\t\tcase 'object':\n\t\t\tif (obj === null) {\n\t\t\t\treturn numberHash(349, hashVal);\n\t\t\t} else if (Array.isArray(obj)) {\n\t\t\t\treturn arrayHash(obj, hashVal);\n\t\t\t}\n\t\t\treturn objectHash(obj, hashVal);\n\t\tcase 'string':\n\t\t\treturn stringHash(obj, hashVal);\n\t\tcase 'boolean':\n\t\t\treturn booleanHash(obj, hashVal);\n\t\tcase 'number':\n\t\t\treturn numberHash(obj, hashVal);\n\t\tcase 'undefined':\n\t\t\treturn numberHash(937, hashVal);\n\t\tdefault:\n\t\t\treturn numberHash(617, hashVal);\n\t}\n}\n\nexport function numberHash(val: number, initialHashVal: number): number {\n\treturn (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32\n}\n\nfunction booleanHash(b: boolean, initialHashVal: number): number {\n\treturn numberHash(b ? 433 : 863, initialHashVal);\n}\n\nexport function stringHash(s: string, hashVal: number) {\n\thashVal = numberHash(149417, hashVal);\n\tfor (let i = 0, length = s.length; i < length; i++) {\n\t\thashVal = numberHash(s.charCodeAt(i), hashVal);\n\t}\n\treturn hashVal;\n}\n\nfunction arrayHash(arr: any[], initialHashVal: number): number {\n\tinitialHashVal = numberHash(104579, initialHashVal);\n\treturn arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal);\n}\n\nfunction objectHash(obj: any, initialHashVal: number): number {\n\tinitialHashVal = numberHash(181387, initialHashVal);\n\treturn Object.keys(obj).sort().reduce((hashVal, key) => {\n\t\thashVal = stringHash(key, hashVal);\n\t\treturn doHash(obj[key], hashVal);\n\t}, initialHashVal);\n}\n\nconst enum SHA1Constant {\n\tBLOCK_SIZE = 64, // 512 / 8\n\tUNICODE_REPLACEMENT = 0xFFFD,\n}\n\nfunction leftRotate(value: number, bits: number, totalBits: number = 32): number {\n\t// delta + bits = totalBits\n\tconst delta = totalBits - bits;\n\n\t// All ones, expect `delta` zeros aligned to the right\n\tconst mask = ~((1 << delta) - 1);\n\n\t// Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits)\n\treturn ((value << bits) | ((mask & value) >>> delta)) >>> 0;\n}\n\nfunction fill(dest: Uint8Array, index: number = 0, count: number = dest.byteLength, value: number = 0): void {\n\tfor (let i = 0; i < count; i++) {\n\t\tdest[index + i] = value;\n\t}\n}\n\nfunction leftPad(value: string, length: number, char: string = '0'): string {\n\twhile (value.length < length) {\n\t\tvalue = char + value;\n\t}\n\treturn value;\n}\n\nexport function toHexString(buffer: ArrayBuffer): string;\nexport function toHexString(value: number, bitsize?: number): string;\nexport function toHexString(bufferOrValue: ArrayBuffer | number, bitsize: number = 32): string {\n\tif (bufferOrValue instanceof ArrayBuffer) {\n\t\treturn Array.from(new Uint8Array(bufferOrValue)).map(b => b.toString(16).padStart(2, '0')).join('');\n\t}\n\n\treturn leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);\n}\n\n/**\n * A SHA1 implementation that works with strings and does not allocate.\n */\nexport class StringSHA1 {\n\tprivate static _bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320\n\n\tprivate _h0 = 0x67452301;\n\tprivate _h1 = 0xEFCDAB89;\n\tprivate _h2 = 0x98BADCFE;\n\tprivate _h3 = 0x10325476;\n\tprivate _h4 = 0xC3D2E1F0;\n\n\tprivate readonly _buff: Uint8Array;\n\tprivate readonly _buffDV: DataView;\n\tprivate _buffLen: number;\n\tprivate _totalLen: number;\n\tprivate _leftoverHighSurrogate: number;\n\tprivate _finished: boolean;\n\n\tconstructor() {\n\t\tthis._buff = new Uint8Array(SHA1Constant.BLOCK_SIZE + 3 /* to fit any utf-8 */);\n\t\tthis._buffDV = new DataView(this._buff.buffer);\n\t\tthis._buffLen = 0;\n\t\tthis._totalLen = 0;\n\t\tthis._leftoverHighSurrogate = 0;\n\t\tthis._finished = false;\n\t}\n\n\tpublic update(str: string): void {\n\t\tconst strLen = str.length;\n\t\tif (strLen === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buff = this._buff;\n\t\tlet buffLen = this._buffLen;\n\t\tlet leftoverHighSurrogate = this._leftoverHighSurrogate;\n\t\tlet charCode: number;\n\t\tlet offset: number;\n\n\t\tif (leftoverHighSurrogate !== 0) {\n\t\t\tcharCode = leftoverHighSurrogate;\n\t\t\toffset = -1;\n\t\t\tleftoverHighSurrogate = 0;\n\t\t} else {\n\t\t\tcharCode = str.charCodeAt(0);\n\t\t\toffset = 0;\n\t\t}\n\n\t\twhile (true) {\n\t\t\tlet codePoint = charCode;\n\t\t\tif (strings.isHighSurrogate(charCode)) {\n\t\t\t\tif (offset + 1 < strLen) {\n\t\t\t\t\tconst nextCharCode = str.charCodeAt(offset + 1);\n\t\t\t\t\tif (strings.isLowSurrogate(nextCharCode)) {\n\t\t\t\t\t\toffset++;\n\t\t\t\t\t\tcodePoint = strings.computeCodePoint(charCode, nextCharCode);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// illegal => unicode replacement character\n\t\t\t\t\t\tcodePoint = SHA1Constant.UNICODE_REPLACEMENT;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// last character is a surrogate pair\n\t\t\t\t\tleftoverHighSurrogate = charCode;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (strings.isLowSurrogate(charCode)) {\n\t\t\t\t// illegal => unicode replacement character\n\t\t\t\tcodePoint = SHA1Constant.UNICODE_REPLACEMENT;\n\t\t\t}\n\n\t\t\tbuffLen = this._push(buff, buffLen, codePoint);\n\t\t\toffset++;\n\t\t\tif (offset < strLen) {\n\t\t\t\tcharCode = str.charCodeAt(offset);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._buffLen = buffLen;\n\t\tthis._leftoverHighSurrogate = leftoverHighSurrogate;\n\t}\n\n\tprivate _push(buff: Uint8Array, buffLen: number, codePoint: number): number {\n\t\tif (codePoint < 0x0080) {\n\t\t\tbuff[buffLen++] = codePoint;\n\t\t} else if (codePoint < 0x0800) {\n\t\t\tbuff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n\t\t} else if (codePoint < 0x10000) {\n\t\t\tbuff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n\t\t} else {\n\t\t\tbuff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n\t\t\tbuff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n\t\t}\n\n\t\tif (buffLen >= SHA1Constant.BLOCK_SIZE) {\n\t\t\tthis._step();\n\t\t\tbuffLen -= SHA1Constant.BLOCK_SIZE;\n\t\t\tthis._totalLen += SHA1Constant.BLOCK_SIZE;\n\t\t\t// take last 3 in case of UTF8 overflow\n\t\t\tbuff[0] = buff[SHA1Constant.BLOCK_SIZE + 0];\n\t\t\tbuff[1] = buff[SHA1Constant.BLOCK_SIZE + 1];\n\t\t\tbuff[2] = buff[SHA1Constant.BLOCK_SIZE + 2];\n\t\t}\n\n\t\treturn buffLen;\n\t}\n\n\tpublic digest(): string {\n\t\tif (!this._finished) {\n\t\t\tthis._finished = true;\n\t\t\tif (this._leftoverHighSurrogate) {\n\t\t\t\t// illegal => unicode replacement character\n\t\t\t\tthis._leftoverHighSurrogate = 0;\n\t\t\t\tthis._buffLen = this._push(this._buff, this._buffLen, SHA1Constant.UNICODE_REPLACEMENT);\n\t\t\t}\n\t\t\tthis._totalLen += this._buffLen;\n\t\t\tthis._wrapUp();\n\t\t}\n\n\t\treturn toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);\n\t}\n\n\tprivate _wrapUp(): void {\n\t\tthis._buff[this._buffLen++] = 0x80;\n\t\tfill(this._buff, this._buffLen);\n\n\t\tif (this._buffLen > 56) {\n\t\t\tthis._step();\n\t\t\tfill(this._buff);\n\t\t}\n\n\t\t// this will fit because the mantissa can cover up to 52 bits\n\t\tconst ml = 8 * this._totalLen;\n\n\t\tthis._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);\n\t\tthis._buffDV.setUint32(60, ml % 4294967296, false);\n\n\t\tthis._step();\n\t}\n\n\tprivate _step(): void {\n\t\tconst bigBlock32 = StringSHA1._bigBlock32;\n\t\tconst data = this._buffDV;\n\n\t\tfor (let j = 0; j < 64 /* 16*4 */; j += 4) {\n\t\t\tbigBlock32.setUint32(j, data.getUint32(j, false), false);\n\t\t}\n\n\t\tfor (let j = 64; j < 320 /* 80*4 */; j += 4) {\n\t\t\tbigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false);\n\t\t}\n\n\t\tlet a = this._h0;\n\t\tlet b = this._h1;\n\t\tlet c = this._h2;\n\t\tlet d = this._h3;\n\t\tlet e = this._h4;\n\n\t\tlet f: number, k: number;\n\t\tlet temp: number;\n\n\t\tfor (let j = 0; j < 80; j++) {\n\t\t\tif (j < 20) {\n\t\t\t\tf = (b & c) | ((~b) & d);\n\t\t\t\tk = 0x5A827999;\n\t\t\t} else if (j < 40) {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 0x6ED9EBA1;\n\t\t\t} else if (j < 60) {\n\t\t\t\tf = (b & c) | (b & d) | (c & d);\n\t\t\t\tk = 0x8F1BBCDC;\n\t\t\t} else {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 0xCA62C1D6;\n\t\t\t}\n\n\t\t\ttemp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = leftRotate(b, 30);\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\n\t\tthis._h0 = (this._h0 + a) & 0xffffffff;\n\t\tthis._h1 = (this._h1 + b) & 0xffffffff;\n\t\tthis._h2 = (this._h2 + c) & 0xffffffff;\n\t\tthis._h3 = (this._h3 + d) & 0xffffffff;\n\t\tthis._h4 = (this._h4 + e) & 0xffffffff;\n\t}\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 { DiffChange } from 'vs/base/common/diff/diffChange';\nimport { stringHash } from 'vs/base/common/hash';\nimport { Constants } from 'vs/base/common/uint';\n\nexport class StringDiffSequence implements ISequence {\n\n\tconstructor(private source: string) { }\n\n\tgetElements(): Int32Array | number[] | string[] {\n\t\tconst source = this.source;\n\t\tconst characters = new Int32Array(source.length);\n\t\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\t\tcharacters[i] = source.charCodeAt(i);\n\t\t}\n\t\treturn characters;\n\t}\n}\n\nexport function stringDiff(original: string, modified: string, pretty: boolean): IDiffChange[] {\n\treturn new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;\n}\n\nexport interface ISequence {\n\tgetElements(): Int32Array | number[] | string[];\n\tgetStrictElement?(index: number): string;\n}\n\nexport interface IDiffChange {\n\t/**\n\t * The position of the first element in the original sequence which\n\t * this change affects.\n\t */\n\toriginalStart: number;\n\n\t/**\n\t * The number of elements from the original sequence which were\n\t * affected.\n\t */\n\toriginalLength: number;\n\n\t/**\n\t * The position of the first element in the modified sequence which\n\t * this change affects.\n\t */\n\tmodifiedStart: number;\n\n\t/**\n\t * The number of elements from the modified sequence which were\n\t * affected (added).\n\t */\n\tmodifiedLength: number;\n}\n\nexport interface IContinueProcessingPredicate {\n\t(furthestOriginalIndex: number, matchLengthOfLongest: number): boolean;\n}\n\nexport interface IDiffResult {\n\tquitEarly: boolean;\n\tchanges: IDiffChange[];\n}\n\n//\n// The code below has been ported from a C# implementation in VS\n//\n\nexport class Debug {\n\n\tpublic static Assert(condition: boolean, message: string): void {\n\t\tif (!condition) {\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}\n\nexport class MyArray {\n\t/**\n\t * Copies a range of elements from an Array starting at the specified source index and pastes\n\t * them to another Array starting at the specified destination index. The length and the indexes\n\t * are specified as 64-bit integers.\n\t * sourceArray:\n\t *\t\tThe Array that contains the data to copy.\n\t * sourceIndex:\n\t *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\n\t * destinationArray:\n\t *\t\tThe Array that receives the data.\n\t * destinationIndex:\n\t *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\n\t * length:\n\t *\t\tA 64-bit integer that represents the number of elements to copy.\n\t */\n\tpublic static Copy(sourceArray: any[], sourceIndex: number, destinationArray: any[], destinationIndex: number, length: number) {\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdestinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n\t\t}\n\t}\n\tpublic static Copy2(sourceArray: Int32Array, sourceIndex: number, destinationArray: Int32Array, destinationIndex: number, length: number) {\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdestinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n\t\t}\n\t}\n}\n\n//*****************************************************************************\n// LcsDiff.cs\n//\n// An implementation of the difference algorithm described in\n// \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n//\n// Copyright (C) 2008 Microsoft Corporation @minifier_do_not_preserve\n//*****************************************************************************\n\n// Our total memory usage for storing history is (worst-case):\n// 2 * [(MaxDifferencesHistory + 1) * (MaxDifferencesHistory + 1) - 1] * sizeof(int)\n// 2 * [1448*1448 - 1] * 4 = 16773624 = 16MB\nconst enum LocalConstants {\n\tMaxDifferencesHistory = 1447\n}\n\n/**\n * A utility class which helps to create the set of DiffChanges from\n * a difference operation. This class accepts original DiffElements and\n * modified DiffElements that are involved in a particular change. The\n * MarkNextChange() method can be called to mark the separation between\n * distinct changes. At the end, the Changes property can be called to retrieve\n * the constructed changes.\n */\nclass DiffChangeHelper {\n\n\tprivate m_changes: DiffChange[];\n\tprivate m_originalStart: number;\n\tprivate m_modifiedStart: number;\n\tprivate m_originalCount: number;\n\tprivate m_modifiedCount: number;\n\n\t/**\n\t * Constructs a new DiffChangeHelper for the given DiffSequences.\n\t */\n\tconstructor() {\n\t\tthis.m_changes = [];\n\t\tthis.m_originalStart = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tthis.m_modifiedStart = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tthis.m_originalCount = 0;\n\t\tthis.m_modifiedCount = 0;\n\t}\n\n\t/**\n\t * Marks the beginning of the next change in the set of differences.\n\t */\n\tpublic MarkNextChange(): void {\n\t\t// Only add to the list if there is something to add\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Add the new change to our list\n\t\t\tthis.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount,\n\t\t\t\tthis.m_modifiedStart, this.m_modifiedCount));\n\t\t}\n\n\t\t// Reset for the next change\n\t\tthis.m_originalCount = 0;\n\t\tthis.m_modifiedCount = 0;\n\t\tthis.m_originalStart = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tthis.m_modifiedStart = Constants.MAX_SAFE_SMALL_INTEGER;\n\t}\n\n\t/**\n\t * Adds the original element at the given position to the elements\n\t * affected by the current change. The modified index gives context\n\t * to the change position with respect to the original sequence.\n\t * @param originalIndex The index of the original element to add.\n\t * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\n\t */\n\tpublic AddOriginalElement(originalIndex: number, modifiedIndex: number) {\n\t\t// The 'true' start index is the smallest of the ones we've seen\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n\n\t\tthis.m_originalCount++;\n\t}\n\n\t/**\n\t * Adds the modified element at the given position to the elements\n\t * affected by the current change. The original index gives context\n\t * to the change position with respect to the modified sequence.\n\t * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\n\t * @param modifiedIndex The index of the modified element to add.\n\t */\n\tpublic AddModifiedElement(originalIndex: number, modifiedIndex: number): void {\n\t\t// The 'true' start index is the smallest of the ones we've seen\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n\n\t\tthis.m_modifiedCount++;\n\t}\n\n\t/**\n\t * Retrieves all of the changes marked by the class.\n\t */\n\tpublic getChanges(): DiffChange[] {\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Finish up on whatever is left\n\t\t\tthis.MarkNextChange();\n\t\t}\n\n\t\treturn this.m_changes;\n\t}\n\n\t/**\n\t * Retrieves all of the changes marked by the class in the reverse order\n\t */\n\tpublic getReverseChanges(): DiffChange[] {\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Finish up on whatever is left\n\t\t\tthis.MarkNextChange();\n\t\t}\n\n\t\tthis.m_changes.reverse();\n\t\treturn this.m_changes;\n\t}\n\n}\n\n/**\n * An implementation of the difference algorithm described in\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n */\nexport class LcsDiff {\n\n\tprivate readonly ContinueProcessingPredicate: IContinueProcessingPredicate | null;\n\n\tprivate readonly _originalSequence: ISequence;\n\tprivate readonly _modifiedSequence: ISequence;\n\tprivate readonly _hasStrings: boolean;\n\tprivate readonly _originalStringElements: string[];\n\tprivate readonly _originalElementsOrHash: Int32Array;\n\tprivate readonly _modifiedStringElements: string[];\n\tprivate readonly _modifiedElementsOrHash: Int32Array;\n\n\tprivate m_forwardHistory: Int32Array[];\n\tprivate m_reverseHistory: Int32Array[];\n\n\t/**\n\t * Constructs the DiffFinder\n\t */\n\tconstructor(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: IContinueProcessingPredicate | null = null) {\n\t\tthis.ContinueProcessingPredicate = continueProcessingPredicate;\n\n\t\tthis._originalSequence = originalSequence;\n\t\tthis._modifiedSequence = modifiedSequence;\n\n\t\tconst [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);\n\t\tconst [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);\n\n\t\tthis._hasStrings = (originalHasStrings && modifiedHasStrings);\n\t\tthis._originalStringElements = originalStringElements;\n\t\tthis._originalElementsOrHash = originalElementsOrHash;\n\t\tthis._modifiedStringElements = modifiedStringElements;\n\t\tthis._modifiedElementsOrHash = modifiedElementsOrHash;\n\n\t\tthis.m_forwardHistory = [];\n\t\tthis.m_reverseHistory = [];\n\t}\n\n\tprivate static _isStringArray(arr: Int32Array | number[] | string[]): arr is string[] {\n\t\treturn (arr.length > 0 && typeof arr[0] === 'string');\n\t}\n\n\tprivate static _getElements(sequence: ISequence): [string[], Int32Array, boolean] {\n\t\tconst elements = sequence.getElements();\n\n\t\tif (LcsDiff._isStringArray(elements)) {\n\t\t\tconst hashes = new Int32Array(elements.length);\n\t\t\tfor (let i = 0, len = elements.length; i < len; i++) {\n\t\t\t\thashes[i] = stringHash(elements[i], 0);\n\t\t\t}\n\t\t\treturn [elements, hashes, true];\n\t\t}\n\n\t\tif (elements instanceof Int32Array) {\n\t\t\treturn [[], elements, false];\n\t\t}\n\n\t\treturn [[], new Int32Array(elements), false];\n\t}\n\n\tprivate ElementsAreEqual(originalIndex: number, newIndex: number): boolean {\n\t\tif (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);\n\t}\n\n\tprivate ElementsAreStrictEqual(originalIndex: number, newIndex: number): boolean {\n\t\tif (!this.ElementsAreEqual(originalIndex, newIndex)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst originalElement = LcsDiff._getStrictElement(this._originalSequence, originalIndex);\n\t\tconst modifiedElement = LcsDiff._getStrictElement(this._modifiedSequence, newIndex);\n\t\treturn (originalElement === modifiedElement);\n\t}\n\n\tprivate static _getStrictElement(sequence: ISequence, index: number): string | null {\n\t\tif (typeof sequence.getStrictElement === 'function') {\n\t\t\treturn sequence.getStrictElement(index);\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate OriginalElementsAreEqual(index1: number, index2: number): boolean {\n\t\tif (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);\n\t}\n\n\tprivate ModifiedElementsAreEqual(index1: number, index2: number): boolean {\n\t\tif (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);\n\t}\n\n\tpublic ComputeDiff(pretty: boolean): IDiffResult {\n\t\treturn this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);\n\t}\n\n\t/**\n\t * Computes the differences between the original and modified input\n\t * sequences on the bounded range.\n\t * @returns An array of the differences between the two input sequences.\n\t */\n\tprivate _ComputeDiff(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, pretty: boolean): IDiffResult {\n\t\tconst quitEarlyArr = [false];\n\t\tlet changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\n\n\t\tif (pretty) {\n\t\t\t// We have to clean up the computed diff to be more intuitive\n\t\t\t// but it turns out this cannot be done correctly until the entire set\n\t\t\t// of diffs have been computed\n\t\t\tchanges = this.PrettifyChanges(changes);\n\t\t}\n\n\t\treturn {\n\t\t\tquitEarly: quitEarlyArr[0],\n\t\t\tchanges: changes\n\t\t};\n\t}\n\n\t/**\n\t * Private helper method which computes the differences on the bounded range\n\t * recursively.\n\t * @returns An array of the differences between the two input sequences.\n\t */\n\tprivate ComputeDiffRecursive(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, quitEarlyArr: boolean[]): DiffChange[] {\n\t\tquitEarlyArr[0] = false;\n\n\t\t// Find the start of the differences\n\t\twhile (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\n\t\t\toriginalStart++;\n\t\t\tmodifiedStart++;\n\t\t}\n\n\t\t// Find the end of the differences\n\t\twhile (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\n\t\t\toriginalEnd--;\n\t\t\tmodifiedEnd--;\n\t\t}\n\n\t\t// In the special case where we either have all insertions or all deletions or the sequences are identical\n\t\tif (originalStart > originalEnd || modifiedStart > modifiedEnd) {\n\t\t\tlet changes: DiffChange[];\n\n\t\t\tif (modifiedStart <= modifiedEnd) {\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n\n\t\t\t\t// All insertions\n\t\t\t\tchanges = [\n\t\t\t\t\tnew DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t\t\t];\n\t\t\t} else if (originalStart <= originalEnd) {\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n\n\t\t\t\t// All deletions\n\t\t\t\tchanges = [\n\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n\n\t\t\t\t// Identical sequences - No differences\n\t\t\t\tchanges = [];\n\t\t\t}\n\n\t\t\treturn changes;\n\t\t}\n\n\t\t// This problem can be solved using the Divide-And-Conquer technique.\n\t\tconst midOriginalArr = [0];\n\t\tconst midModifiedArr = [0];\n\t\tconst result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\n\n\t\tconst midOriginal = midOriginalArr[0];\n\t\tconst midModified = midModifiedArr[0];\n\n\t\tif (result !== null) {\n\t\t\t// Result is not-null when there was enough memory to compute the changes while\n\t\t\t// searching for the recursion point\n\t\t\treturn result;\n\t\t} else if (!quitEarlyArr[0]) {\n\t\t\t// We can break the problem down recursively by finding the changes in the\n\t\t\t// First Half: (originalStart, modifiedStart) to (midOriginal, midModified)\n\t\t\t// Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\n\t\t\t// NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\n\n\t\t\tconst leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\n\t\t\tlet rightChanges: DiffChange[] = [];\n\n\t\t\tif (!quitEarlyArr[0]) {\n\t\t\t\trightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\n\t\t\t} else {\n\t\t\t\t// We didn't have time to finish the first half, so we don't have time to compute this half.\n\t\t\t\t// Consider the entire rest of the sequence different.\n\t\t\t\trightChanges = [\n\t\t\t\t\tnew DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\n\t\t\t\t];\n\t\t\t}\n\n\t\t\treturn this.ConcatenateChanges(leftChanges, rightChanges);\n\t\t}\n\n\t\t// If we hit here, we quit early, and so can't return anything meaningful\n\t\treturn [\n\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t];\n\t}\n\n\tprivate WALKTRACE(diagonalForwardBase: number, diagonalForwardStart: number, diagonalForwardEnd: number, diagonalForwardOffset: number,\n\t\tdiagonalReverseBase: number, diagonalReverseStart: number, diagonalReverseEnd: number, diagonalReverseOffset: number,\n\t\tforwardPoints: Int32Array, reversePoints: Int32Array,\n\t\toriginalIndex: number, originalEnd: number, midOriginalArr: number[],\n\t\tmodifiedIndex: number, modifiedEnd: number, midModifiedArr: number[],\n\t\tdeltaIsEven: boolean, quitEarlyArr: boolean[]\n\t): DiffChange[] {\n\t\tlet forwardChanges: DiffChange[] | null = null;\n\t\tlet reverseChanges: DiffChange[] | null = null;\n\n\t\t// First, walk backward through the forward diagonals history\n\t\tlet changeHelper = new DiffChangeHelper();\n\t\tlet diagonalMin = diagonalForwardStart;\n\t\tlet diagonalMax = diagonalForwardEnd;\n\t\tlet diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\n\t\tlet lastOriginalIndex = Constants.MIN_SAFE_SMALL_INTEGER;\n\t\tlet historyIndex = this.m_forwardHistory.length - 1;\n\n\t\tdo {\n\t\t\t// Get the diagonal index from the relative diagonal number\n\t\t\tconst diagonal = diagonalRelative + diagonalForwardBase;\n\n\t\t\t// Figure out where we came from\n\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n\t\t\t\t// Vertical line (the element is an insert)\n\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\n\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t}\n\t\t\t\tlastOriginalIndex = originalIndex;\n\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\n\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\n\t\t\t} else {\n\t\t\t\t// Horizontal line (the element is a deletion)\n\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\n\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t}\n\t\t\t\tlastOriginalIndex = originalIndex - 1;\n\t\t\t\tchangeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\n\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\n\t\t\t}\n\n\t\t\tif (historyIndex >= 0) {\n\t\t\t\tforwardPoints = this.m_forwardHistory[historyIndex];\n\t\t\t\tdiagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\n\t\t\t\tdiagonalMin = 1;\n\t\t\t\tdiagonalMax = forwardPoints.length - 1;\n\t\t\t}\n\t\t} while (--historyIndex >= -1);\n\n\t\t// Ironically, we get the forward changes as the reverse of the\n\t\t// order we added them since we technically added them backwards\n\t\tforwardChanges = changeHelper.getReverseChanges();\n\n\t\tif (quitEarlyArr[0]) {\n\t\t\t// TODO: Calculate a partial from the reverse diagonals.\n\t\t\t// For now, just assume everything after the midOriginal/midModified point is a diff\n\n\t\t\tlet originalStartPoint = midOriginalArr[0] + 1;\n\t\t\tlet modifiedStartPoint = midModifiedArr[0] + 1;\n\n\t\t\tif (forwardChanges !== null && forwardChanges.length > 0) {\n\t\t\t\tconst lastForwardChange = forwardChanges[forwardChanges.length - 1];\n\t\t\t\toriginalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\n\t\t\t\tmodifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\n\t\t\t}\n\n\t\t\treverseChanges = [\n\t\t\t\tnew DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1,\n\t\t\t\t\tmodifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\n\t\t\t];\n\t\t} else {\n\t\t\t// Now walk backward through the reverse diagonals history\n\t\t\tchangeHelper = new DiffChangeHelper();\n\t\t\tdiagonalMin = diagonalReverseStart;\n\t\t\tdiagonalMax = diagonalReverseEnd;\n\t\t\tdiagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\n\t\t\tlastOriginalIndex = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\t\thistoryIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\n\n\t\t\tdo {\n\t\t\t\t// Get the diagonal index from the relative diagonal number\n\t\t\t\tconst diagonal = diagonalRelative + diagonalReverseBase;\n\n\t\t\t\t// Figure out where we came from\n\t\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n\t\t\t\t\t// Horizontal line (the element is a deletion))\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t\t}\n\t\t\t\t\tlastOriginalIndex = originalIndex + 1;\n\t\t\t\t\tchangeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\n\t\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\n\t\t\t\t} else {\n\t\t\t\t\t// Vertical line (the element is an insertion)\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t\t}\n\t\t\t\t\tlastOriginalIndex = originalIndex;\n\t\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\n\t\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\n\t\t\t\t}\n\n\t\t\t\tif (historyIndex >= 0) {\n\t\t\t\t\treversePoints = this.m_reverseHistory[historyIndex];\n\t\t\t\t\tdiagonalReverseBase = reversePoints[0]; //We stored this in the first spot\n\t\t\t\t\tdiagonalMin = 1;\n\t\t\t\t\tdiagonalMax = reversePoints.length - 1;\n\t\t\t\t}\n\t\t\t} while (--historyIndex >= -1);\n\n\t\t\t// There are cases where the reverse history will find diffs that\n\t\t\t// are correct, but not intuitive, so we need shift them.\n\t\t\treverseChanges = changeHelper.getChanges();\n\t\t}\n\n\t\treturn this.ConcatenateChanges(forwardChanges, reverseChanges);\n\t}\n\n\t/**\n\t * Given the range to compute the diff on, this method finds the point:\n\t * (midOriginal, midModified)\n\t * that exists in the middle of the LCS of the two sequences and\n\t * is the point at which the LCS problem may be broken down recursively.\n\t * This method will try to keep the LCS trace in memory. If the LCS recursion\n\t * point is calculated and the full trace is available in memory, then this method\n\t * will return the change list.\n\t * @param originalStart The start bound of the original sequence range\n\t * @param originalEnd The end bound of the original sequence range\n\t * @param modifiedStart The start bound of the modified sequence range\n\t * @param modifiedEnd The end bound of the modified sequence range\n\t * @param midOriginal The middle point of the original sequence range\n\t * @param midModified The middle point of the modified sequence range\n\t * @returns The diff changes, if available, otherwise null\n\t */\n\tprivate ComputeRecursionPoint(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, midOriginalArr: number[], midModifiedArr: number[], quitEarlyArr: boolean[]) {\n\t\tlet originalIndex = 0, modifiedIndex = 0;\n\t\tlet diagonalForwardStart = 0, diagonalForwardEnd = 0;\n\t\tlet diagonalReverseStart = 0, diagonalReverseEnd = 0;\n\n\t\t// To traverse the edit graph and produce the proper LCS, our actual\n\t\t// start position is just outside the given boundary\n\t\toriginalStart--;\n\t\tmodifiedStart--;\n\n\t\t// We set these up to make the compiler happy, but they will\n\t\t// be replaced before we return with the actual recursion point\n\t\tmidOriginalArr[0] = 0;\n\t\tmidModifiedArr[0] = 0;\n\n\t\t// Clear out the history\n\t\tthis.m_forwardHistory = [];\n\t\tthis.m_reverseHistory = [];\n\n\t\t// Each cell in the two arrays corresponds to a diagonal in the edit graph.\n\t\t// The integer value in the cell represents the originalIndex of the furthest\n\t\t// reaching point found so far that ends in that diagonal.\n\t\t// The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\n\t\tconst maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\n\t\tconst numDiagonals = maxDifferences + 1;\n\t\tconst forwardPoints = new Int32Array(numDiagonals);\n\t\tconst reversePoints = new Int32Array(numDiagonals);\n\t\t// diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\n\t\t// diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\n\t\tconst diagonalForwardBase = (modifiedEnd - modifiedStart);\n\t\tconst diagonalReverseBase = (originalEnd - originalStart);\n\t\t// diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n\t\t// diagonal number (relative to diagonalForwardBase)\n\t\t// diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n\t\t// diagonal number (relative to diagonalReverseBase)\n\t\tconst diagonalForwardOffset = (originalStart - modifiedStart);\n\t\tconst diagonalReverseOffset = (originalEnd - modifiedEnd);\n\n\t\t// delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\n\t\t// relative to the start diagonal with diagonal numbers relative to the end diagonal.\n\t\t// The Even/Oddn-ness of this delta is important for determining when we should check for overlap\n\t\tconst delta = diagonalReverseBase - diagonalForwardBase;\n\t\tconst deltaIsEven = (delta % 2 === 0);\n\n\t\t// Here we set up the start and end points as the furthest points found so far\n\t\t// in both the forward and reverse directions, respectively\n\t\tforwardPoints[diagonalForwardBase] = originalStart;\n\t\treversePoints[diagonalReverseBase] = originalEnd;\n\n\t\t// Remember if we quit early, and thus need to do a best-effort result instead of a real result.\n\t\tquitEarlyArr[0] = false;\n\n\n\n\t\t// A couple of points:\n\t\t// --With this method, we iterate on the number of differences between the two sequences.\n\t\t// The more differences there actually are, the longer this will take.\n\t\t// --Also, as the number of differences increases, we have to search on diagonals further\n\t\t// away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\n\t\t// --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\n\t\t// is even and odd diagonals only when numDifferences is odd.\n\t\tfor (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\n\t\t\tlet furthestOriginalIndex = 0;\n\t\t\tlet furthestModifiedIndex = 0;\n\n\t\t\t// Run the algorithm in the forward direction\n\t\t\tdiagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n\t\t\tdiagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n\t\t\tfor (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\n\t\t\t\t// is further away from the start point (originalStart, modifiedStart)\n\t\t\t\tif (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\n\t\t\t\t} else {\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\n\t\t\t\t}\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\n\n\t\t\t\t// Save the current originalIndex so we can test for false overlap in step 3\n\t\t\t\tconst tempOriginalIndex = originalIndex;\n\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n\t\t\t\t// so long as the elements are equal.\n\t\t\t\twhile (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\n\t\t\t\t\toriginalIndex++;\n\t\t\t\t\tmodifiedIndex++;\n\t\t\t\t}\n\t\t\t\tforwardPoints[diagonal] = originalIndex;\n\n\t\t\t\tif (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\n\t\t\t\t\tfurthestOriginalIndex = originalIndex;\n\t\t\t\t\tfurthestModifiedIndex = modifiedIndex;\n\t\t\t\t}\n\n\t\t\t\t// STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\n\t\t\t\t// and diagonal is in the range of reverse diagonals computed for numDifferences-1\n\t\t\t\t// (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\n\t\t\t\t// then check for overlap.\n\t\t\t\tif (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\n\t\t\t\t\tif (originalIndex >= reversePoints[diagonal]) {\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\n\n\t\t\t\t\t\tif (tempOriginalIndex <= reversePoints[diagonal] && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\n\t\t\t\t\t\t\t// Just return the recursion point\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we should be quitting early, before moving on to the next iteration.\n\t\t\tconst matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\n\n\t\t\tif (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {\n\t\t\t\t// We can't finish, so skip ahead to generating a result from what we have.\n\t\t\t\tquitEarlyArr[0] = true;\n\n\t\t\t\t// Use the furthest distance we got in the forward direction.\n\t\t\t\tmidOriginalArr[0] = furthestOriginalIndex;\n\t\t\t\tmidModifiedArr[0] = furthestModifiedIndex;\n\n\t\t\t\tif (matchLengthOfLongest > 0 && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\n\t\t\t\t\t// Enough of the history is in memory to walk it backwards\n\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// We didn't actually remember enough of the history.\n\n\t\t\t\t\t//Since we are quitting the diff early, we need to shift back the originalStart and modified start\n\t\t\t\t\t//back into the boundary limits since we decremented their value above beyond the boundary limit.\n\t\t\t\t\toriginalStart++;\n\t\t\t\t\tmodifiedStart++;\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1,\n\t\t\t\t\t\t\tmodifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Run the algorithm in the reverse direction\n\t\t\tdiagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n\t\t\tdiagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n\t\t\tfor (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\n\t\t\t\t// is further away from the start point (originalEnd, modifiedEnd)\n\t\t\t\tif (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\n\t\t\t\t} else {\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\n\t\t\t\t}\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\n\n\t\t\t\t// Save the current originalIndex so we can test for false overlap\n\t\t\t\tconst tempOriginalIndex = originalIndex;\n\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n\t\t\t\t// as long as the elements are equal.\n\t\t\t\twhile (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\n\t\t\t\t\toriginalIndex--;\n\t\t\t\t\tmodifiedIndex--;\n\t\t\t\t}\n\t\t\t\treversePoints[diagonal] = originalIndex;\n\n\t\t\t\t// STEP 4: If delta is even (overlap first happens on reverse when delta is even)\n\t\t\t\t// and diagonal is in the range of forward diagonals computed for numDifferences\n\t\t\t\t// then check for overlap.\n\t\t\t\tif (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\n\t\t\t\t\tif (originalIndex <= forwardPoints[diagonal]) {\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\n\n\t\t\t\t\t\tif (tempOriginalIndex >= forwardPoints[diagonal] && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\n\t\t\t\t\t\t\t// Just return the recursion point\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save current vectors to history before the next iteration\n\t\t\tif (numDifferences <= LocalConstants.MaxDifferencesHistory) {\n\t\t\t\t// We are allocating space for one extra int, which we fill with\n\t\t\t\t// the index of the diagonal base index\n\t\t\t\tlet temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);\n\t\t\t\ttemp[0] = diagonalForwardBase - diagonalForwardStart + 1;\n\t\t\t\tMyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\n\t\t\t\tthis.m_forwardHistory.push(temp);\n\n\t\t\t\ttemp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);\n\t\t\t\ttemp[0] = diagonalReverseBase - diagonalReverseStart + 1;\n\t\t\t\tMyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\n\t\t\t\tthis.m_reverseHistory.push(temp);\n\t\t\t}\n\n\t\t}\n\n\t\t// If we got here, then we have the full trace in history. We just have to convert it to a change list\n\t\t// NOTE: This part is a bit messy\n\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\tforwardPoints, reversePoints,\n\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\tdeltaIsEven, quitEarlyArr\n\t\t);\n\t}\n\n\t/**\n\t * Shifts the given changes to provide a more intuitive diff.\n\t * While the first element in a diff matches the first element after the diff,\n\t * we shift the diff down.\n\t *\n\t * @param changes The list of changes to shift\n\t * @returns The shifted changes\n\t */\n\tprivate PrettifyChanges(changes: DiffChange[]): DiffChange[] {\n\n\t\t// Shift all the changes down first\n\t\tfor (let i = 0; i < changes.length; i++) {\n\t\t\tconst change = changes[i];\n\t\t\tconst originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;\n\t\t\tconst modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;\n\t\t\tconst checkOriginal = change.originalLength > 0;\n\t\t\tconst checkModified = change.modifiedLength > 0;\n\n\t\t\twhile (\n\t\t\t\tchange.originalStart + change.originalLength < originalStop\n\t\t\t\t&& change.modifiedStart + change.modifiedLength < modifiedStop\n\t\t\t\t&& (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength))\n\t\t\t\t&& (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))\n\t\t\t) {\n\t\t\t\tconst startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart);\n\t\t\t\tconst endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength);\n\t\t\t\tif (endStrictEqual && !startStrictEqual) {\n\t\t\t\t\t// moving the change down would create an equal change, but the elements are not strict equal\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchange.originalStart++;\n\t\t\t\tchange.modifiedStart++;\n\t\t\t}\n\n\t\t\tlet mergedChangeArr: Array<DiffChange | null> = [null];\n\t\t\tif (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\n\t\t\t\tchanges[i] = mergedChangeArr[0]!;\n\t\t\t\tchanges.splice(i + 1, 1);\n\t\t\t\ti--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// Shift changes back up until we hit empty or whitespace-only lines\n\t\tfor (let i = changes.length - 1; i >= 0; i--) {\n\t\t\tconst change = changes[i];\n\n\t\t\tlet originalStop = 0;\n\t\t\tlet modifiedStop = 0;\n\t\t\tif (i > 0) {\n\t\t\t\tconst prevChange = changes[i - 1];\n\t\t\t\toriginalStop = prevChange.originalStart + prevChange.originalLength;\n\t\t\t\tmodifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\n\t\t\t}\n\n\t\t\tconst checkOriginal = change.originalLength > 0;\n\t\t\tconst checkModified = change.modifiedLength > 0;\n\n\t\t\tlet bestDelta = 0;\n\t\t\tlet bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\n\n\t\t\tfor (let delta = 1; ; delta++) {\n\t\t\t\tconst originalStart = change.originalStart - delta;\n\t\t\t\tconst modifiedStart = change.modifiedStart - delta;\n\n\t\t\t\tif (originalStart < originalStop || modifiedStart < modifiedStop) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst touchingPreviousChange = (originalStart === originalStop && modifiedStart === modifiedStop);\n\t\t\t\tconst score = (\n\t\t\t\t\t(touchingPreviousChange ? 5 : 0)\n\t\t\t\t\t+ this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength)\n\t\t\t\t);\n\n\t\t\t\tif (score > bestScore) {\n\t\t\t\t\tbestScore = score;\n\t\t\t\t\tbestDelta = delta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchange.originalStart -= bestDelta;\n\t\t\tchange.modifiedStart -= bestDelta;\n\n\t\t\tconst mergedChangeArr: Array<DiffChange | null> = [null];\n\t\t\tif (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) {\n\t\t\t\tchanges[i - 1] = mergedChangeArr[0]!;\n\t\t\t\tchanges.splice(i, 1);\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// There could be multiple longest common substrings.\n\t\t// Give preference to the ones containing longer lines\n\t\tif (this._hasStrings) {\n\t\t\tfor (let i = 1, len = changes.length; i < len; i++) {\n\t\t\t\tconst aChange = changes[i - 1];\n\t\t\t\tconst bChange = changes[i];\n\t\t\t\tconst matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;\n\t\t\t\tconst aOriginalStart = aChange.originalStart;\n\t\t\t\tconst bOriginalEnd = bChange.originalStart + bChange.originalLength;\n\t\t\t\tconst abOriginalLength = bOriginalEnd - aOriginalStart;\n\t\t\t\tconst aModifiedStart = aChange.modifiedStart;\n\t\t\t\tconst bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;\n\t\t\t\tconst abModifiedLength = bModifiedEnd - aModifiedStart;\n\t\t\t\t// Avoid wasting a lot of time with these searches\n\t\t\t\tif (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {\n\t\t\t\t\tconst t = this._findBetterContiguousSequence(\n\t\t\t\t\t\taOriginalStart, abOriginalLength,\n\t\t\t\t\t\taModifiedStart, abModifiedLength,\n\t\t\t\t\t\tmatchedLength\n\t\t\t\t\t);\n\t\t\t\t\tif (t) {\n\t\t\t\t\t\tconst [originalMatchStart, modifiedMatchStart] = t;\n\t\t\t\t\t\tif (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {\n\t\t\t\t\t\t\t// switch to another sequence that has a better score\n\t\t\t\t\t\t\taChange.originalLength = originalMatchStart - aChange.originalStart;\n\t\t\t\t\t\t\taChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;\n\t\t\t\t\t\t\tbChange.originalStart = originalMatchStart + matchedLength;\n\t\t\t\t\t\t\tbChange.modifiedStart = modifiedMatchStart + matchedLength;\n\t\t\t\t\t\t\tbChange.originalLength = bOriginalEnd - bChange.originalStart;\n\t\t\t\t\t\t\tbChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn changes;\n\t}\n\n\tprivate _findBetterContiguousSequence(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number, desiredLength: number): [number, number] | null {\n\t\tif (originalLength < desiredLength || modifiedLength < desiredLength) {\n\t\t\treturn null;\n\t\t}\n\t\tconst originalMax = originalStart + originalLength - desiredLength + 1;\n\t\tconst modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;\n\t\tlet bestScore = 0;\n\t\tlet bestOriginalStart = 0;\n\t\tlet bestModifiedStart = 0;\n\t\tfor (let i = originalStart; i < originalMax; i++) {\n\t\t\tfor (let j = modifiedStart; j < modifiedMax; j++) {\n\t\t\t\tconst score = this._contiguousSequenceScore(i, j, desiredLength);\n\t\t\t\tif (score > 0 && score > bestScore) {\n\t\t\t\t\tbestScore = score;\n\t\t\t\t\tbestOriginalStart = i;\n\t\t\t\t\tbestModifiedStart = j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (bestScore > 0) {\n\t\t\treturn [bestOriginalStart, bestModifiedStart];\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _contiguousSequenceScore(originalStart: number, modifiedStart: number, length: number): number {\n\t\tlet score = 0;\n\t\tfor (let l = 0; l < length; l++) {\n\t\t\tif (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tscore += this._originalStringElements[originalStart + l].length;\n\t\t}\n\t\treturn score;\n\t}\n\n\tprivate _OriginalIsBoundary(index: number): boolean {\n\t\tif (index <= 0 || index >= this._originalElementsOrHash.length - 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (this._hasStrings && /^\\s*$/.test(this._originalStringElements[index]));\n\t}\n\n\tprivate _OriginalRegionIsBoundary(originalStart: number, originalLength: number): boolean {\n\t\tif (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (originalLength > 0) {\n\t\t\tconst originalEnd = originalStart + originalLength;\n\t\t\tif (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _ModifiedIsBoundary(index: number): boolean {\n\t\tif (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (this._hasStrings && /^\\s*$/.test(this._modifiedStringElements[index]));\n\t}\n\n\tprivate _ModifiedRegionIsBoundary(modifiedStart: number, modifiedLength: number): boolean {\n\t\tif (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (modifiedLength > 0) {\n\t\t\tconst modifiedEnd = modifiedStart + modifiedLength;\n\t\t\tif (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _boundaryScore(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number): number {\n\t\tconst originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\n\t\tconst modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\n\t\treturn (originalScore + modifiedScore);\n\t}\n\n\t/**\n\t * Concatenates the two input DiffChange lists and returns the resulting\n\t * list.\n\t * @param The left changes\n\t * @param The right changes\n\t * @returns The concatenated list\n\t */\n\tprivate ConcatenateChanges(left: DiffChange[], right: DiffChange[]): DiffChange[] {\n\t\tlet mergedChangeArr: DiffChange[] = [];\n\n\t\tif (left.length === 0 || right.length === 0) {\n\t\t\treturn (right.length > 0) ? right : left;\n\t\t} else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\n\t\t\t// Since we break the problem down recursively, it is possible that we\n\t\t\t// might recurse in the middle of a change thereby splitting it into\n\t\t\t// two changes. Here in the combining stage, we detect and fuse those\n\t\t\t// changes back together\n\t\t\tconst result = new Array<DiffChange>(left.length + right.length - 1);\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length - 1);\n\t\t\tresult[left.length - 1] = mergedChangeArr[0];\n\t\t\tMyArray.Copy(right, 1, result, left.length, right.length - 1);\n\n\t\t\treturn result;\n\t\t} else {\n\t\t\tconst result = new Array<DiffChange>(left.length + right.length);\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length);\n\t\t\tMyArray.Copy(right, 0, result, left.length, right.length);\n\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if the two changes overlap and can be merged into a single\n\t * change\n\t * @param left The left change\n\t * @param right The right change\n\t * @param mergedChange The merged change if the two overlap, null otherwise\n\t * @returns True if the two changes overlap\n\t */\n\tprivate ChangesOverlap(left: DiffChange, right: DiffChange, mergedChangeArr: Array<DiffChange | null>): boolean {\n\t\tDebug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\n\t\tDebug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\n\n\t\tif (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n\t\t\tconst originalStart = left.originalStart;\n\t\t\tlet originalLength = left.originalLength;\n\t\t\tconst modifiedStart = left.modifiedStart;\n\t\t\tlet modifiedLength = left.modifiedLength;\n\n\t\t\tif (left.originalStart + left.originalLength >= right.originalStart) {\n\t\t\t\toriginalLength = right.originalStart + right.originalLength - left.originalStart;\n\t\t\t}\n\t\t\tif (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n\t\t\t\tmodifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\n\t\t\t}\n\n\t\t\tmergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tmergedChangeArr[0] = null;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Helper method used to clip a diagonal index to the range of valid\n\t * diagonals. This also decides whether or not the diagonal index,\n\t * if it exceeds the boundary, should be clipped to the boundary or clipped\n\t * one inside the boundary depending on the Even/Odd status of the boundary\n\t * and numDifferences.\n\t * @param diagonal The index of the diagonal to clip.\n\t * @param numDifferences The current number of differences being iterated upon.\n\t * @param diagonalBaseIndex The base reference diagonal.\n\t * @param numDiagonals The total number of diagonals.\n\t * @returns The clipped diagonal index.\n\t */\n\tprivate ClipDiagonalBound(diagonal: number, numDifferences: number, diagonalBaseIndex: number, numDiagonals: number): number {\n\t\tif (diagonal >= 0 && diagonal < numDiagonals) {\n\t\t\t// Nothing to clip, its in range\n\t\t\treturn diagonal;\n\t\t}\n\n\t\t// diagonalsBelow: The number of diagonals below the reference diagonal\n\t\t// diagonalsAbove: The number of diagonals above the reference diagonal\n\t\tconst diagonalsBelow = diagonalBaseIndex;\n\t\tconst diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\n\t\tconst diffEven = (numDifferences % 2 === 0);\n\n\t\tif (diagonal < 0) {\n\t\t\tconst lowerBoundEven = (diagonalsBelow % 2 === 0);\n\t\t\treturn (diffEven === lowerBoundEven) ? 0 : 1;\n\t\t} else {\n\t\t\tconst upperBoundEven = (diagonalsAbove % 2 === 0);\n\t\t\treturn (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\n\t\t}\n\t}\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 { IIdentityProvider } from 'vs/base/browser/ui/list/list';\nimport { ICollapseStateChangeEvent, ITreeElement, ITreeFilter, ITreeFilterDataResult, ITreeModel, ITreeModelSpliceEvent, ITreeNode, TreeError, TreeVisibility } from 'vs/base/browser/ui/tree/tree';\nimport { splice, tail2 } from 'vs/base/common/arrays';\nimport { Delayer, MicrotaskDelay } from 'vs/base/common/async';\nimport { LcsDiff } from 'vs/base/common/diff/diff';\nimport { Emitter, Event, EventBufferer } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { ISpliceable } from 'vs/base/common/sequence';\n\n// Exported for tests\nexport interface IIndexTreeNode<T, TFilterData = void> extends ITreeNode<T, TFilterData> {\n\treadonly parent: IIndexTreeNode<T, TFilterData> | undefined;\n\treadonly children: IIndexTreeNode<T, TFilterData>[];\n\tvisibleChildrenCount: number;\n\tvisibleChildIndex: number;\n\tcollapsible: boolean;\n\tcollapsed: boolean;\n\trenderNodeCount: number;\n\tvisibility: TreeVisibility;\n\tvisible: boolean;\n\tfilterData: TFilterData | undefined;\n\tlastDiffIds?: string[];\n}\n\nexport function isFilterResult<T>(obj: any): obj is ITreeFilterDataResult<T> {\n\treturn typeof obj === 'object' && 'visibility' in obj && 'data' in obj;\n}\n\nexport function getVisibleState(visibility: boolean | TreeVisibility): TreeVisibility {\n\tswitch (visibility) {\n\t\tcase true: return TreeVisibility.Visible;\n\t\tcase false: return TreeVisibility.Hidden;\n\t\tdefault: return visibility;\n\t}\n}\n\nexport interface IIndexTreeModelOptions<T, TFilterData> {\n\treadonly collapseByDefault?: boolean; // defaults to false\n\treadonly filter?: ITreeFilter<T, TFilterData>;\n\treadonly autoExpandSingleChildren?: boolean;\n}\n\nexport interface IIndexTreeModelSpliceOptions<T, TFilterData> {\n\t/**\n\t * If set, child updates will recurse the given number of levels even if\n\t * items in the splice operation are unchanged. `Infinity` is a valid value.\n\t */\n\treadonly diffDepth?: number;\n\n\t/**\n\t * Identity provider used to optimize splice() calls in the IndexTree. If\n\t * this is not present, optimized splicing is not enabled.\n\t *\n\t * Warning: if this is present, calls to `setChildren()` will not replace\n\t * or update nodes if their identity is the same, even if the elements are\n\t * different. For this, you should call `rerender()`.\n\t */\n\treadonly diffIdentityProvider?: IIdentityProvider<T>;\n\n\t/**\n\t * Callback for when a node is created.\n\t */\n\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void;\n\n\t/**\n\t * Callback for when a node is deleted.\n\t */\n\tonDidDeleteNode?: (node: ITreeNode<T, TFilterData>) => void;\n}\n\ninterface CollapsibleStateUpdate {\n\treadonly collapsible: boolean;\n}\n\ninterface CollapsedStateUpdate {\n\treadonly collapsed: boolean;\n\treadonly recursive: boolean;\n}\n\ntype CollapseStateUpdate = CollapsibleStateUpdate | CollapsedStateUpdate;\n\nfunction isCollapsibleStateUpdate(update: CollapseStateUpdate): update is CollapsibleStateUpdate {\n\treturn typeof (update as any).collapsible === 'boolean';\n}\n\nexport interface IList<T> extends ISpliceable<T> {\n\tupdateElementHeight(index: number, height: number | undefined): void;\n}\n\nexport class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = void> implements ITreeModel<T, TFilterData, number[]> {\n\n\treadonly rootRef = [];\n\n\tprivate root: IIndexTreeNode<T, TFilterData>;\n\tprivate eventBufferer = new EventBufferer();\n\n\tprivate readonly _onDidChangeCollapseState = new Emitter<ICollapseStateChangeEvent<T, TFilterData>>();\n\treadonly onDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>> = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event);\n\n\tprivate readonly _onDidChangeRenderNodeCount = new Emitter<ITreeNode<T, TFilterData>>();\n\treadonly onDidChangeRenderNodeCount: Event<ITreeNode<T, TFilterData>> = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event);\n\n\tprivate collapseByDefault: boolean;\n\tprivate filter?: ITreeFilter<T, TFilterData>;\n\tprivate autoExpandSingleChildren: boolean;\n\n\tprivate readonly _onDidSplice = new Emitter<ITreeModelSpliceEvent<T, TFilterData>>();\n\treadonly onDidSplice = this._onDidSplice.event;\n\n\tprivate readonly refilterDelayer = new Delayer(MicrotaskDelay);\n\n\tconstructor(\n\t\tprivate user: string,\n\t\tprivate list: IList<ITreeNode<T, TFilterData>>,\n\t\trootElement: T,\n\t\toptions: IIndexTreeModelOptions<T, TFilterData> = {}\n\t) {\n\t\tthis.collapseByDefault = typeof options.collapseByDefault === 'undefined' ? false : options.collapseByDefault;\n\t\tthis.filter = options.filter;\n\t\tthis.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren;\n\n\t\tthis.root = {\n\t\t\tparent: undefined,\n\t\t\telement: rootElement,\n\t\t\tchildren: [],\n\t\t\tdepth: 0,\n\t\t\tvisibleChildrenCount: 0,\n\t\t\tvisibleChildIndex: -1,\n\t\t\tcollapsible: false,\n\t\t\tcollapsed: false,\n\t\t\trenderNodeCount: 0,\n\t\t\tvisibility: TreeVisibility.Visible,\n\t\t\tvisible: true,\n\t\t\tfilterData: undefined\n\t\t};\n\t}\n\n\tsplice(\n\t\tlocation: number[],\n\t\tdeleteCount: number,\n\t\ttoInsert: Iterable<ITreeElement<T>> = Iterable.empty(),\n\t\toptions: IIndexTreeModelSpliceOptions<T, TFilterData> = {},\n\t): void {\n\t\tif (location.length === 0) {\n\t\t\tthrow new TreeError(this.user, 'Invalid tree location');\n\t\t}\n\n\t\tif (options.diffIdentityProvider) {\n\t\t\tthis.spliceSmart(options.diffIdentityProvider, location, deleteCount, toInsert, options);\n\t\t} else {\n\t\t\tthis.spliceSimple(location, deleteCount, toInsert, options);\n\t\t}\n\t}\n\n\tprivate spliceSmart(\n\t\tidentity: IIdentityProvider<T>,\n\t\tlocation: number[],\n\t\tdeleteCount: number,\n\t\ttoInsertIterable: Iterable<ITreeElement<T>> = Iterable.empty(),\n\t\toptions: IIndexTreeModelSpliceOptions<T, TFilterData>,\n\t\trecurseLevels = options.diffDepth ?? 0,\n\t) {\n\t\tconst { parentNode } = this.getParentNodeWithListIndex(location);\n\t\tif (!parentNode.lastDiffIds) {\n\t\t\treturn this.spliceSimple(location, deleteCount, toInsertIterable, options);\n\t\t}\n\n\t\tconst toInsert = [...toInsertIterable];\n\t\tconst index = location[location.length - 1];\n\t\tconst diff = new LcsDiff(\n\t\t\t{ getElements: () => parentNode.lastDiffIds! },\n\t\t\t{\n\t\t\t\tgetElements: () => [\n\t\t\t\t\t...parentNode.children.slice(0, index),\n\t\t\t\t\t...toInsert,\n\t\t\t\t\t...parentNode.children.slice(index + deleteCount),\n\t\t\t\t].map(e => identity.getId(e.element).toString())\n\t\t\t},\n\t\t).ComputeDiff(false);\n\n\t\t// if we were given a 'best effort' diff, use default behavior\n\t\tif (diff.quitEarly) {\n\t\t\tparentNode.lastDiffIds = undefined;\n\t\t\treturn this.spliceSimple(location, deleteCount, toInsert, options);\n\t\t}\n\n\t\tconst locationPrefix = location.slice(0, -1);\n\t\tconst recurseSplice = (fromOriginal: number, fromModified: number, count: number) => {\n\t\t\tif (recurseLevels > 0) {\n\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\tfromOriginal--;\n\t\t\t\t\tfromModified--;\n\t\t\t\t\tthis.spliceSmart(\n\t\t\t\t\t\tidentity,\n\t\t\t\t\t\t[...locationPrefix, fromOriginal, 0],\n\t\t\t\t\t\tNumber.MAX_SAFE_INTEGER,\n\t\t\t\t\t\ttoInsert[fromModified].children,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\trecurseLevels - 1,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet lastStartO = Math.min(parentNode.children.length, index + deleteCount);\n\t\tlet lastStartM = toInsert.length;\n\t\tfor (const change of diff.changes.sort((a, b) => b.originalStart - a.originalStart)) {\n\t\t\trecurseSplice(lastStartO, lastStartM, lastStartO - (change.originalStart + change.originalLength));\n\t\t\tlastStartO = change.originalStart;\n\t\t\tlastStartM = change.modifiedStart - index;\n\n\t\t\tthis.spliceSimple(\n\t\t\t\t[...locationPrefix, lastStartO],\n\t\t\t\tchange.originalLength,\n\t\t\t\tIterable.slice(toInsert, lastStartM, lastStartM + change.modifiedLength),\n\t\t\t\toptions,\n\t\t\t);\n\t\t}\n\n\t\t// at this point, startO === startM === count since any remaining prefix should match\n\t\trecurseSplice(lastStartO, lastStartM, lastStartO);\n\t}\n\n\tprivate spliceSimple(\n\t\tlocation: number[],\n\t\tdeleteCount: number,\n\t\ttoInsert: Iterable<ITreeElement<T>> = Iterable.empty(),\n\t\t{ onDidCreateNode, onDidDeleteNode, diffIdentityProvider }: IIndexTreeModelSpliceOptions<T, TFilterData>,\n\t) {\n\t\tconst { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location);\n\t\tconst treeListElementsToInsert: ITreeNode<T, TFilterData>[] = [];\n\t\tconst nodesToInsertIterator = Iterable.map(toInsert, el => this.createTreeNode(el, parentNode, parentNode.visible ? TreeVisibility.Visible : TreeVisibility.Hidden, revealed, treeListElementsToInsert, onDidCreateNode));\n\n\t\tconst lastIndex = location[location.length - 1];\n\t\tconst lastHadChildren = parentNode.children.length > 0;\n\n\t\t// figure out what's the visible child start index right before the\n\t\t// splice point\n\t\tlet visibleChildStartIndex = 0;\n\n\t\tfor (let i = lastIndex; i >= 0 && i < parentNode.children.length; i--) {\n\t\t\tconst child = parentNode.children[i];\n\n\t\t\tif (child.visible) {\n\t\t\t\tvisibleChildStartIndex = child.visibleChildIndex;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst nodesToInsert: IIndexTreeNode<T, TFilterData>[] = [];\n\t\tlet insertedVisibleChildrenCount = 0;\n\t\tlet renderNodeCount = 0;\n\n\t\tfor (const child of nodesToInsertIterator) {\n\t\t\tnodesToInsert.push(child);\n\t\t\trenderNodeCount += child.renderNodeCount;\n\n\t\t\tif (child.visible) {\n\t\t\t\tchild.visibleChildIndex = visibleChildStartIndex + insertedVisibleChildrenCount++;\n\t\t\t}\n\t\t}\n\n\t\tconst deletedNodes = splice(parentNode.children, lastIndex, deleteCount, nodesToInsert);\n\n\t\tif (!diffIdentityProvider) {\n\t\t\tparentNode.lastDiffIds = undefined;\n\t\t} else if (parentNode.lastDiffIds) {\n\t\t\tsplice(parentNode.lastDiffIds, lastIndex, deleteCount, nodesToInsert.map(n => diffIdentityProvider.getId(n.element).toString()));\n\t\t} else {\n\t\t\tparentNode.lastDiffIds = parentNode.children.map(n => diffIdentityProvider.getId(n.element).toString());\n\t\t}\n\n\t\t// figure out what is the count of deleted visible children\n\t\tlet deletedVisibleChildrenCount = 0;\n\n\t\tfor (const child of deletedNodes) {\n\t\t\tif (child.visible) {\n\t\t\t\tdeletedVisibleChildrenCount++;\n\t\t\t}\n\t\t}\n\n\t\t// and adjust for all visible children after the splice point\n\t\tif (deletedVisibleChildrenCount !== 0) {\n\t\t\tfor (let i = lastIndex + nodesToInsert.length; i < parentNode.children.length; i++) {\n\t\t\t\tconst child = parentNode.children[i];\n\n\t\t\t\tif (child.visible) {\n\t\t\t\t\tchild.visibleChildIndex -= deletedVisibleChildrenCount;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// update parent's visible children count\n\t\tparentNode.visibleChildrenCount += insertedVisibleChildrenCount - deletedVisibleChildrenCount;\n\n\t\tif (revealed && visible) {\n\t\t\tconst visibleDeleteCount = deletedNodes.reduce((r, node) => r + (node.visible ? node.renderNodeCount : 0), 0);\n\n\t\t\tthis._updateAncestorsRenderNodeCount(parentNode, renderNodeCount - visibleDeleteCount);\n\t\t\tthis.list.splice(listIndex, visibleDeleteCount, treeListElementsToInsert);\n\t\t}\n\n\t\tif (deletedNodes.length > 0 && onDidDeleteNode) {\n\t\t\tconst visit = (node: ITreeNode<T, TFilterData>) => {\n\t\t\t\tonDidDeleteNode(node);\n\t\t\t\tnode.children.forEach(visit);\n\t\t\t};\n\n\t\t\tdeletedNodes.forEach(visit);\n\t\t}\n\n\t\tthis._onDidSplice.fire({ insertedNodes: nodesToInsert, deletedNodes });\n\n\t\tconst currentlyHasChildren = parentNode.children.length > 0;\n\t\tif (lastHadChildren !== currentlyHasChildren) {\n\t\t\tthis.setCollapsible(location.slice(0, -1), currentlyHasChildren);\n\t\t}\n\n\t\tlet node: IIndexTreeNode<T, TFilterData> | undefined = parentNode;\n\n\t\twhile (node) {\n\t\t\tif (node.visibility === TreeVisibility.Recurse) {\n\t\t\t\t// delayed to avoid excessive refiltering, see #135941\n\t\t\t\tthis.refilterDelayer.trigger(() => this.refilter());\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnode = node.parent;\n\t\t}\n\t}\n\n\trerender(location: number[]): void {\n\t\tif (location.length === 0) {\n\t\t\tthrow new TreeError(this.user, 'Invalid tree location');\n\t\t}\n\n\t\tconst { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location);\n\n\t\tif (node.visible && revealed) {\n\t\t\tthis.list.splice(listIndex, 1, [node]);\n\t\t}\n\t}\n\n\thas(location: number[]): boolean {\n\t\treturn this.hasTreeNode(location);\n\t}\n\n\tgetListIndex(location: number[]): number {\n\t\tconst { listIndex, visible, revealed } = this.getTreeNodeWithListIndex(location);\n\t\treturn visible && revealed ? listIndex : -1;\n\t}\n\n\tgetListRenderCount(location: number[]): number {\n\t\treturn this.getTreeNode(location).renderNodeCount;\n\t}\n\n\tisCollapsible(location: number[]): boolean {\n\t\treturn this.getTreeNode(location).collapsible;\n\t}\n\n\tsetCollapsible(location: number[], collapsible?: boolean): boolean {\n\t\tconst node = this.getTreeNode(location);\n\n\t\tif (typeof collapsible === 'undefined') {\n\t\t\tcollapsible = !node.collapsible;\n\t\t}\n\n\t\tconst update: CollapsibleStateUpdate = { collapsible };\n\t\treturn this.eventBufferer.bufferEvents(() => this._setCollapseState(location, update));\n\t}\n\n\tisCollapsed(location: number[]): boolean {\n\t\treturn this.getTreeNode(location).collapsed;\n\t}\n\n\tsetCollapsed(location: number[], collapsed?: boolean, recursive?: boolean): boolean {\n\t\tconst node = this.getTreeNode(location);\n\n\t\tif (typeof collapsed === 'undefined') {\n\t\t\tcollapsed = !node.collapsed;\n\t\t}\n\n\t\tconst update: CollapsedStateUpdate = { collapsed, recursive: recursive || false };\n\t\treturn this.eventBufferer.bufferEvents(() => this._setCollapseState(location, update));\n\t}\n\n\tprivate _setCollapseState(location: number[], update: CollapseStateUpdate): boolean {\n\t\tconst { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location);\n\n\t\tconst result = this._setListNodeCollapseState(node, listIndex, revealed, update);\n\n\t\tif (node !== this.root && this.autoExpandSingleChildren && result && !isCollapsibleStateUpdate(update) && node.collapsible && !node.collapsed && !update.recursive) {\n\t\t\tlet onlyVisibleChildIndex = -1;\n\n\t\t\tfor (let i = 0; i < node.children.length; i++) {\n\t\t\t\tconst child = node.children[i];\n\n\t\t\t\tif (child.visible) {\n\t\t\t\t\tif (onlyVisibleChildIndex > -1) {\n\t\t\t\t\t\tonlyVisibleChildIndex = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonlyVisibleChildIndex = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onlyVisibleChildIndex > -1) {\n\t\t\t\tthis._setCollapseState([...location, onlyVisibleChildIndex], update);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _setListNodeCollapseState(node: IIndexTreeNode<T, TFilterData>, listIndex: number, revealed: boolean, update: CollapseStateUpdate): boolean {\n\t\tconst result = this._setNodeCollapseState(node, update, false);\n\n\t\tif (!revealed || !node.visible || !result) {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst previousRenderNodeCount = node.renderNodeCount;\n\t\tconst toInsert = this.updateNodeAfterCollapseChange(node);\n\t\tconst deleteCount = previousRenderNodeCount - (listIndex === -1 ? 0 : 1);\n\t\tthis.list.splice(listIndex + 1, deleteCount, toInsert.slice(1));\n\n\t\treturn result;\n\t}\n\n\tprivate _setNodeCollapseState(node: IIndexTreeNode<T, TFilterData>, update: CollapseStateUpdate, deep: boolean): boolean {\n\t\tlet result: boolean;\n\n\t\tif (node === this.root) {\n\t\t\tresult = false;\n\t\t} else {\n\t\t\tif (isCollapsibleStateUpdate(update)) {\n\t\t\t\tresult = node.collapsible !== update.collapsible;\n\t\t\t\tnode.collapsible = update.collapsible;\n\t\t\t} else if (!node.collapsible) {\n\t\t\t\tresult = false;\n\t\t\t} else {\n\t\t\t\tresult = node.collapsed !== update.collapsed;\n\t\t\t\tnode.collapsed = update.collapsed;\n\t\t\t}\n\n\t\t\tif (result) {\n\t\t\t\tthis._onDidChangeCollapseState.fire({ node, deep });\n\t\t\t}\n\t\t}\n\n\t\tif (!isCollapsibleStateUpdate(update) && update.recursive) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tresult = this._setNodeCollapseState(child, update, true) || result;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\texpandTo(location: number[]): void {\n\t\tthis.eventBufferer.bufferEvents(() => {\n\t\t\tlet node = this.getTreeNode(location);\n\n\t\t\twhile (node.parent) {\n\t\t\t\tnode = node.parent;\n\t\t\t\tlocation = location.slice(0, location.length - 1);\n\n\t\t\t\tif (node.collapsed) {\n\t\t\t\t\tthis._setCollapseState(location, { collapsed: false, recursive: false });\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\trefilter(): void {\n\t\tconst previousRenderNodeCount = this.root.renderNodeCount;\n\t\tconst toInsert = this.updateNodeAfterFilterChange(this.root);\n\t\tthis.list.splice(0, previousRenderNodeCount, toInsert);\n\t\tthis.refilterDelayer.cancel();\n\t}\n\n\tprivate createTreeNode(\n\t\ttreeElement: ITreeElement<T>,\n\t\tparent: IIndexTreeNode<T, TFilterData>,\n\t\tparentVisibility: TreeVisibility,\n\t\trevealed: boolean,\n\t\ttreeListElements: ITreeNode<T, TFilterData>[],\n\t\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void\n\t): IIndexTreeNode<T, TFilterData> {\n\t\tconst node: IIndexTreeNode<T, TFilterData> = {\n\t\t\tparent,\n\t\t\telement: treeElement.element,\n\t\t\tchildren: [],\n\t\t\tdepth: parent.depth + 1,\n\t\t\tvisibleChildrenCount: 0,\n\t\t\tvisibleChildIndex: -1,\n\t\t\tcollapsible: typeof treeElement.collapsible === 'boolean' ? treeElement.collapsible : (typeof treeElement.collapsed !== 'undefined'),\n\t\t\tcollapsed: typeof treeElement.collapsed === 'undefined' ? this.collapseByDefault : treeElement.collapsed,\n\t\t\trenderNodeCount: 1,\n\t\t\tvisibility: TreeVisibility.Visible,\n\t\t\tvisible: true,\n\t\t\tfilterData: undefined\n\t\t};\n\n\t\tconst visibility = this._filterNode(node, parentVisibility);\n\t\tnode.visibility = visibility;\n\n\t\tif (revealed) {\n\t\t\ttreeListElements.push(node);\n\t\t}\n\n\t\tconst childElements = treeElement.children || Iterable.empty();\n\t\tconst childRevealed = revealed && visibility !== TreeVisibility.Hidden && !node.collapsed;\n\t\tconst childNodes = Iterable.map(childElements, el => this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode));\n\n\t\tlet visibleChildrenCount = 0;\n\t\tlet renderNodeCount = 1;\n\n\t\tfor (const child of childNodes) {\n\t\t\tnode.children.push(child);\n\t\t\trenderNodeCount += child.renderNodeCount;\n\n\t\t\tif (child.visible) {\n\t\t\t\tchild.visibleChildIndex = visibleChildrenCount++;\n\t\t\t}\n\t\t}\n\n\t\tnode.collapsible = node.collapsible || node.children.length > 0;\n\t\tnode.visibleChildrenCount = visibleChildrenCount;\n\t\tnode.visible = visibility === TreeVisibility.Recurse ? visibleChildrenCount > 0 : (visibility === TreeVisibility.Visible);\n\n\t\tif (!node.visible) {\n\t\t\tnode.renderNodeCount = 0;\n\n\t\t\tif (revealed) {\n\t\t\t\ttreeListElements.pop();\n\t\t\t}\n\t\t} else if (!node.collapsed) {\n\t\t\tnode.renderNodeCount = renderNodeCount;\n\t\t}\n\n\t\tif (onDidCreateNode) {\n\t\t\tonDidCreateNode(node);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprivate updateNodeAfterCollapseChange(node: IIndexTreeNode<T, TFilterData>): ITreeNode<T, TFilterData>[] {\n\t\tconst previousRenderNodeCount = node.renderNodeCount;\n\t\tconst result: ITreeNode<T, TFilterData>[] = [];\n\n\t\tthis._updateNodeAfterCollapseChange(node, result);\n\t\tthis._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount);\n\n\t\treturn result;\n\t}\n\n\tprivate _updateNodeAfterCollapseChange(node: IIndexTreeNode<T, TFilterData>, result: ITreeNode<T, TFilterData>[]): number {\n\t\tif (node.visible === false) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tresult.push(node);\n\t\tnode.renderNodeCount = 1;\n\n\t\tif (!node.collapsed) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tnode.renderNodeCount += this._updateNodeAfterCollapseChange(child, result);\n\t\t\t}\n\t\t}\n\n\t\tthis._onDidChangeRenderNodeCount.fire(node);\n\t\treturn node.renderNodeCount;\n\t}\n\n\tprivate updateNodeAfterFilterChange(node: IIndexTreeNode<T, TFilterData>): ITreeNode<T, TFilterData>[] {\n\t\tconst previousRenderNodeCount = node.renderNodeCount;\n\t\tconst result: ITreeNode<T, TFilterData>[] = [];\n\n\t\tthis._updateNodeAfterFilterChange(node, node.visible ? TreeVisibility.Visible : TreeVisibility.Hidden, result);\n\t\tthis._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount);\n\n\t\treturn result;\n\t}\n\n\tprivate _updateNodeAfterFilterChange(node: IIndexTreeNode<T, TFilterData>, parentVisibility: TreeVisibility, result: ITreeNode<T, TFilterData>[], revealed = true): boolean {\n\t\tlet visibility: TreeVisibility;\n\n\t\tif (node !== this.root) {\n\t\t\tvisibility = this._filterNode(node, parentVisibility);\n\n\t\t\tif (visibility === TreeVisibility.Hidden) {\n\t\t\t\tnode.visible = false;\n\t\t\t\tnode.renderNodeCount = 0;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (revealed) {\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t}\n\n\t\tconst resultStartLength = result.length;\n\t\tnode.renderNodeCount = node === this.root ? 0 : 1;\n\n\t\tlet hasVisibleDescendants = false;\n\t\tif (!node.collapsed || visibility! !== TreeVisibility.Hidden) {\n\t\t\tlet visibleChildIndex = 0;\n\n\t\t\tfor (const child of node.children) {\n\t\t\t\thasVisibleDescendants = this._updateNodeAfterFilterChange(child, visibility!, result, revealed && !node.collapsed) || hasVisibleDescendants;\n\n\t\t\t\tif (child.visible) {\n\t\t\t\t\tchild.visibleChildIndex = visibleChildIndex++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.visibleChildrenCount = visibleChildIndex;\n\t\t} else {\n\t\t\tnode.visibleChildrenCount = 0;\n\t\t}\n\n\t\tif (node !== this.root) {\n\t\t\tnode.visible = visibility! === TreeVisibility.Recurse ? hasVisibleDescendants : (visibility! === TreeVisibility.Visible);\n\t\t\tnode.visibility = visibility!;\n\t\t}\n\n\t\tif (!node.visible) {\n\t\t\tnode.renderNodeCount = 0;\n\n\t\t\tif (revealed) {\n\t\t\t\tresult.pop();\n\t\t\t}\n\t\t} else if (!node.collapsed) {\n\t\t\tnode.renderNodeCount += result.length - resultStartLength;\n\t\t}\n\n\t\tthis._onDidChangeRenderNodeCount.fire(node);\n\t\treturn node.visible;\n\t}\n\n\tprivate _updateAncestorsRenderNodeCount(node: IIndexTreeNode<T, TFilterData> | undefined, diff: number): void {\n\t\tif (diff === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (node) {\n\t\t\tnode.renderNodeCount += diff;\n\t\t\tthis._onDidChangeRenderNodeCount.fire(node);\n\t\t\tnode = node.parent;\n\t\t}\n\t}\n\n\tprivate _filterNode(node: IIndexTreeNode<T, TFilterData>, parentVisibility: TreeVisibility): TreeVisibility {\n\t\tconst result = this.filter ? this.filter.filter(node.element, parentVisibility) : TreeVisibility.Visible;\n\n\t\tif (typeof result === 'boolean') {\n\t\t\tnode.filterData = undefined;\n\t\t\treturn result ? TreeVisibility.Visible : TreeVisibility.Hidden;\n\t\t} else if (isFilterResult<TFilterData>(result)) {\n\t\t\tnode.filterData = result.data;\n\t\t\treturn getVisibleState(result.visibility);\n\t\t} else {\n\t\t\tnode.filterData = undefined;\n\t\t\treturn getVisibleState(result);\n\t\t}\n\t}\n\n\t// cheap\n\tprivate hasTreeNode(location: number[], node: IIndexTreeNode<T, TFilterData> = this.root): boolean {\n\t\tif (!location || location.length === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst [index, ...rest] = location;\n\n\t\tif (index < 0 || index > node.children.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.hasTreeNode(rest, node.children[index]);\n\t}\n\n\t// cheap\n\tprivate getTreeNode(location: number[], node: IIndexTreeNode<T, TFilterData> = this.root): IIndexTreeNode<T, TFilterData> {\n\t\tif (!location || location.length === 0) {\n\t\t\treturn node;\n\t\t}\n\n\t\tconst [index, ...rest] = location;\n\n\t\tif (index < 0 || index > node.children.length) {\n\t\t\tthrow new TreeError(this.user, 'Invalid tree location');\n\t\t}\n\n\t\treturn this.getTreeNode(rest, node.children[index]);\n\t}\n\n\t// expensive\n\tprivate getTreeNodeWithListIndex(location: number[]): { node: IIndexTreeNode<T, TFilterData>; listIndex: number; revealed: boolean; visible: boolean } {\n\t\tif (location.length === 0) {\n\t\t\treturn { node: this.root, listIndex: -1, revealed: true, visible: false };\n\t\t}\n\n\t\tconst { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location);\n\t\tconst index = location[location.length - 1];\n\n\t\tif (index < 0 || index > parentNode.children.length) {\n\t\t\tthrow new TreeError(this.user, 'Invalid tree location');\n\t\t}\n\n\t\tconst node = parentNode.children[index];\n\n\t\treturn { node, listIndex, revealed, visible: visible && node.visible };\n\t}\n\n\tprivate getParentNodeWithListIndex(location: number[], node: IIndexTreeNode<T, TFilterData> = this.root, listIndex: number = 0, revealed = true, visible = true): { parentNode: IIndexTreeNode<T, TFilterData>; listIndex: number; revealed: boolean; visible: boolean } {\n\t\tconst [index, ...rest] = location;\n\n\t\tif (index < 0 || index > node.children.length) {\n\t\t\tthrow new TreeError(this.user, 'Invalid tree location');\n\t\t}\n\n\t\t// TODO@joao perf!\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tlistIndex += node.children[i].renderNodeCount;\n\t\t}\n\n\t\trevealed = revealed && !node.collapsed;\n\t\tvisible = visible && node.visible;\n\n\t\tif (rest.length === 0) {\n\t\t\treturn { parentNode: node, listIndex, revealed, visible };\n\t\t}\n\n\t\treturn this.getParentNodeWithListIndex(rest, node.children[index], listIndex + 1, revealed, visible);\n\t}\n\n\tgetNode(location: number[] = []): ITreeNode<T, TFilterData> {\n\t\treturn this.getTreeNode(location);\n\t}\n\n\t// TODO@joao perf!\n\tgetNodeLocation(node: ITreeNode<T, TFilterData>): number[] {\n\t\tconst location: number[] = [];\n\t\tlet indexTreeNode = node as IIndexTreeNode<T, TFilterData>; // typing woes\n\n\t\twhile (indexTreeNode.parent) {\n\t\t\tlocation.push(indexTreeNode.parent.children.indexOf(indexTreeNode));\n\t\t\tindexTreeNode = indexTreeNode.parent;\n\t\t}\n\n\t\treturn location.reverse();\n\t}\n\n\tgetParentNodeLocation(location: number[]): number[] | undefined {\n\t\tif (location.length === 0) {\n\t\t\treturn undefined;\n\t\t} else if (location.length === 1) {\n\t\t\treturn [];\n\t\t} else {\n\t\t\treturn tail2(location)[0];\n\t\t}\n\t}\n\n\tgetFirstElementChild(location: number[]): T | undefined {\n\t\tconst node = this.getTreeNode(location);\n\n\t\tif (node.children.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn node.children[0].element;\n\t}\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 { IIdentityProvider } from 'vs/base/browser/ui/list/list';\nimport { IIndexTreeModelOptions, IIndexTreeModelSpliceOptions, IList, IndexTreeModel } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { ICollapseStateChangeEvent, ITreeElement, ITreeModel, ITreeModelSpliceEvent, ITreeNode, ITreeSorter, TreeError } from 'vs/base/browser/ui/tree/tree';\nimport { Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\n\nexport interface IObjectTreeModel<T extends NonNullable<any>, TFilterData extends NonNullable<any> = void> extends ITreeModel<T | null, TFilterData, T | null> {\n\tsetChildren(element: T | null, children: Iterable<ITreeElement<T>> | undefined, options?: IObjectTreeModelSetChildrenOptions<T, TFilterData>): void;\n}\n\nexport interface IObjectTreeModelSetChildrenOptions<T, TFilterData> extends IIndexTreeModelSpliceOptions<T, TFilterData> {\n}\n\nexport interface IObjectTreeModelOptions<T, TFilterData> extends IIndexTreeModelOptions<T, TFilterData> {\n\treadonly sorter?: ITreeSorter<T>;\n\treadonly identityProvider?: IIdentityProvider<T>;\n}\n\nexport class ObjectTreeModel<T extends NonNullable<any>, TFilterData extends NonNullable<any> = void> implements IObjectTreeModel<T, TFilterData> {\n\n\treadonly rootRef = null;\n\n\tprivate model: IndexTreeModel<T | null, TFilterData>;\n\tprivate nodes = new Map<T | null, ITreeNode<T, TFilterData>>();\n\tprivate readonly nodesByIdentity = new Map<string, ITreeNode<T, TFilterData>>();\n\tprivate readonly identityProvider?: IIdentityProvider<T>;\n\tprivate sorter?: ITreeSorter<{ element: T }>;\n\n\treadonly onDidSplice: Event<ITreeModelSpliceEvent<T | null, TFilterData>>;\n\treadonly onDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>>;\n\treadonly onDidChangeRenderNodeCount: Event<ITreeNode<T, TFilterData>>;\n\n\tconstructor(\n\t\tprivate user: string,\n\t\tlist: IList<ITreeNode<T, TFilterData>>,\n\t\toptions: IObjectTreeModelOptions<T, TFilterData> = {}\n\t) {\n\t\tthis.model = new IndexTreeModel(user, list, null, options);\n\t\tthis.onDidSplice = this.model.onDidSplice;\n\t\tthis.onDidChangeCollapseState = this.model.onDidChangeCollapseState as Event<ICollapseStateChangeEvent<T, TFilterData>>;\n\t\tthis.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount as Event<ITreeNode<T, TFilterData>>;\n\n\t\tif (options.sorter) {\n\t\t\tthis.sorter = {\n\t\t\t\tcompare(a, b) {\n\t\t\t\t\treturn options.sorter!.compare(a.element, b.element);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis.identityProvider = options.identityProvider;\n\t}\n\n\tsetChildren(\n\t\telement: T | null,\n\t\tchildren: Iterable<ITreeElement<T>> = Iterable.empty(),\n\t\toptions: IObjectTreeModelSetChildrenOptions<T, TFilterData> = {},\n\t): void {\n\t\tconst location = this.getElementLocation(element);\n\t\tthis._setChildren(location, this.preserveCollapseState(children), options);\n\t}\n\n\tprivate _setChildren(\n\t\tlocation: number[],\n\t\tchildren: Iterable<ITreeElement<T>> = Iterable.empty(),\n\t\toptions: IObjectTreeModelSetChildrenOptions<T, TFilterData>,\n\t): void {\n\t\tconst insertedElements = new Set<T | null>();\n\t\tconst insertedElementIds = new Set<string>();\n\n\t\tconst onDidCreateNode = (node: ITreeNode<T | null, TFilterData>) => {\n\t\t\tif (node.element === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst tnode = node as ITreeNode<T, TFilterData>;\n\n\t\t\tinsertedElements.add(tnode.element);\n\t\t\tthis.nodes.set(tnode.element, tnode);\n\n\t\t\tif (this.identityProvider) {\n\t\t\t\tconst id = this.identityProvider.getId(tnode.element).toString();\n\t\t\t\tinsertedElementIds.add(id);\n\t\t\t\tthis.nodesByIdentity.set(id, tnode);\n\t\t\t}\n\n\t\t\toptions.onDidCreateNode?.(tnode);\n\t\t};\n\n\t\tconst onDidDeleteNode = (node: ITreeNode<T | null, TFilterData>) => {\n\t\t\tif (node.element === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst tnode = node as ITreeNode<T, TFilterData>;\n\n\t\t\tif (!insertedElements.has(tnode.element)) {\n\t\t\t\tthis.nodes.delete(tnode.element);\n\t\t\t}\n\n\t\t\tif (this.identityProvider) {\n\t\t\t\tconst id = this.identityProvider.getId(tnode.element).toString();\n\t\t\t\tif (!insertedElementIds.has(id)) {\n\t\t\t\t\tthis.nodesByIdentity.delete(id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toptions.onDidDeleteNode?.(tnode);\n\t\t};\n\n\t\tthis.model.splice(\n\t\t\t[...location, 0],\n\t\t\tNumber.MAX_VALUE,\n\t\t\tchildren,\n\t\t\t{ ...options, onDidCreateNode, onDidDeleteNode }\n\t\t);\n\t}\n\n\tprivate preserveCollapseState(elements: Iterable<ITreeElement<T>> = Iterable.empty()): Iterable<ITreeElement<T>> {\n\t\tif (this.sorter) {\n\t\t\telements = [...elements].sort(this.sorter.compare.bind(this.sorter));\n\t\t}\n\n\t\treturn Iterable.map(elements, treeElement => {\n\t\t\tlet node = this.nodes.get(treeElement.element);\n\n\t\t\tif (!node && this.identityProvider) {\n\t\t\t\tconst id = this.identityProvider.getId(treeElement.element).toString();\n\t\t\t\tnode = this.nodesByIdentity.get(id);\n\t\t\t}\n\n\t\t\tif (!node) {\n\t\t\t\treturn {\n\t\t\t\t\t...treeElement,\n\t\t\t\t\tchildren: this.preserveCollapseState(treeElement.children)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst collapsible = typeof treeElement.collapsible === 'boolean' ? treeElement.collapsible : node.collapsible;\n\t\t\tconst collapsed = typeof treeElement.collapsed !== 'undefined' ? treeElement.collapsed : node.collapsed;\n\n\t\t\treturn {\n\t\t\t\t...treeElement,\n\t\t\t\tcollapsible,\n\t\t\t\tcollapsed,\n\t\t\t\tchildren: this.preserveCollapseState(treeElement.children)\n\t\t\t};\n\t\t});\n\t}\n\n\trerender(element: T | null): void {\n\t\tconst location = this.getElementLocation(element);\n\t\tthis.model.rerender(location);\n\t}\n\n\tgetFirstElementChild(ref: T | null = null): T | null | undefined {\n\t\tconst location = this.getElementLocation(ref);\n\t\treturn this.model.getFirstElementChild(location);\n\t}\n\n\thas(element: T | null): boolean {\n\t\treturn this.nodes.has(element);\n\t}\n\n\tgetListIndex(element: T | null): number {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.getListIndex(location);\n\t}\n\n\tgetListRenderCount(element: T | null): number {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.getListRenderCount(location);\n\t}\n\n\tisCollapsible(element: T | null): boolean {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.isCollapsible(location);\n\t}\n\n\tsetCollapsible(element: T | null, collapsible?: boolean): boolean {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.setCollapsible(location, collapsible);\n\t}\n\n\tisCollapsed(element: T | null): boolean {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.isCollapsed(location);\n\t}\n\n\tsetCollapsed(element: T | null, collapsed?: boolean, recursive?: boolean): boolean {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.setCollapsed(location, collapsed, recursive);\n\t}\n\n\texpandTo(element: T | null): void {\n\t\tconst location = this.getElementLocation(element);\n\t\tthis.model.expandTo(location);\n\t}\n\n\trefilter(): void {\n\t\tthis.model.refilter();\n\t}\n\n\tgetNode(element: T | null = null): ITreeNode<T | null, TFilterData> {\n\t\tif (element === null) {\n\t\t\treturn this.model.getNode(this.model.rootRef);\n\t\t}\n\n\t\tconst node = this.nodes.get(element);\n\n\t\tif (!node) {\n\t\t\tthrow new TreeError(this.user, `Tree element not found: ${element}`);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tgetNodeLocation(node: ITreeNode<T, TFilterData>): T | null {\n\t\treturn node.element;\n\t}\n\n\tgetParentNodeLocation(element: T | null): T | null {\n\t\tif (element === null) {\n\t\t\tthrow new TreeError(this.user, `Invalid getParentNodeLocation call`);\n\t\t}\n\n\t\tconst node = this.nodes.get(element);\n\n\t\tif (!node) {\n\t\t\tthrow new TreeError(this.user, `Tree element not found: ${element}`);\n\t\t}\n\n\t\tconst location = this.model.getNodeLocation(node);\n\t\tconst parentLocation = this.model.getParentNodeLocation(location);\n\t\tconst parent = this.model.getNode(parentLocation);\n\n\t\treturn parent.element;\n\t}\n\n\tprivate getElementLocation(element: T | null): number[] {\n\t\tif (element === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst node = this.nodes.get(element);\n\n\t\tif (!node) {\n\t\t\tthrow new TreeError(this.user, `Tree element not found: ${element}`);\n\t\t}\n\n\t\treturn this.model.getNodeLocation(node);\n\t}\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 { IIdentityProvider } from 'vs/base/browser/ui/list/list';\nimport { IIndexTreeModelSpliceOptions, IList } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { IObjectTreeModel, IObjectTreeModelOptions, IObjectTreeModelSetChildrenOptions, ObjectTreeModel } from 'vs/base/browser/ui/tree/objectTreeModel';\nimport { ICollapseStateChangeEvent, ITreeElement, ITreeModel, ITreeModelSpliceEvent, ITreeNode, TreeError, TreeFilterResult, TreeVisibility, WeakMapper } from 'vs/base/browser/ui/tree/tree';\nimport { Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\n\n// Exported only for test reasons, do not use directly\nexport interface ICompressedTreeElement<T> extends ITreeElement<T> {\n\treadonly children?: Iterable<ICompressedTreeElement<T>>;\n\treadonly incompressible?: boolean;\n}\n\n// Exported only for test reasons, do not use directly\nexport interface ICompressedTreeNode<T> {\n\treadonly elements: T[];\n\treadonly incompressible: boolean;\n}\n\nfunction noCompress<T>(element: ICompressedTreeElement<T>): ITreeElement<ICompressedTreeNode<T>> {\n\tconst elements = [element.element];\n\tconst incompressible = element.incompressible || false;\n\n\treturn {\n\t\telement: { elements, incompressible },\n\t\tchildren: Iterable.map(Iterable.from(element.children), noCompress),\n\t\tcollapsible: element.collapsible,\n\t\tcollapsed: element.collapsed\n\t};\n}\n\n// Exported only for test reasons, do not use directly\nexport function compress<T>(element: ICompressedTreeElement<T>): ITreeElement<ICompressedTreeNode<T>> {\n\tconst elements = [element.element];\n\tconst incompressible = element.incompressible || false;\n\n\tlet childrenIterator: Iterable<ICompressedTreeElement<T>>;\n\tlet children: ICompressedTreeElement<T>[];\n\n\twhile (true) {\n\t\t[children, childrenIterator] = Iterable.consume(Iterable.from(element.children), 2);\n\n\t\tif (children.length !== 1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (children[0].incompressible) {\n\t\t\tbreak;\n\t\t}\n\n\t\telement = children[0];\n\t\telements.push(element.element);\n\t}\n\n\treturn {\n\t\telement: { elements, incompressible },\n\t\tchildren: Iterable.map(Iterable.concat(children, childrenIterator), compress),\n\t\tcollapsible: element.collapsible,\n\t\tcollapsed: element.collapsed\n\t};\n}\n\nfunction _decompress<T>(element: ITreeElement<ICompressedTreeNode<T>>, index = 0): ICompressedTreeElement<T> {\n\tlet children: Iterable<ICompressedTreeElement<T>>;\n\n\tif (index < element.element.elements.length - 1) {\n\t\tchildren = [_decompress(element, index + 1)];\n\t} else {\n\t\tchildren = Iterable.map(Iterable.from(element.children), el => _decompress(el, 0));\n\t}\n\n\tif (index === 0 && element.element.incompressible) {\n\t\treturn {\n\t\t\telement: element.element.elements[index],\n\t\t\tchildren,\n\t\t\tincompressible: true,\n\t\t\tcollapsible: element.collapsible,\n\t\t\tcollapsed: element.collapsed\n\t\t};\n\t}\n\n\treturn {\n\t\telement: element.element.elements[index],\n\t\tchildren,\n\t\tcollapsible: element.collapsible,\n\t\tcollapsed: element.collapsed\n\t};\n}\n\n// Exported only for test reasons, do not use directly\nexport function decompress<T>(element: ITreeElement<ICompressedTreeNode<T>>): ICompressedTreeElement<T> {\n\treturn _decompress(element, 0);\n}\n\nfunction splice<T>(treeElement: ICompressedTreeElement<T>, element: T, children: Iterable<ICompressedTreeElement<T>>): ICompressedTreeElement<T> {\n\tif (treeElement.element === element) {\n\t\treturn { ...treeElement, children };\n\t}\n\n\treturn { ...treeElement, children: Iterable.map(Iterable.from(treeElement.children), e => splice(e, element, children)) };\n}\n\ninterface ICompressedObjectTreeModelOptions<T, TFilterData> extends IObjectTreeModelOptions<ICompressedTreeNode<T>, TFilterData> {\n\treadonly compressionEnabled?: boolean;\n}\n\nconst wrapIdentityProvider = <T>(base: IIdentityProvider<T>): IIdentityProvider<ICompressedTreeNode<T>> => ({\n\tgetId(node) {\n\t\treturn node.elements.map(e => base.getId(e).toString()).join('\\0');\n\t}\n});\n\n// Exported only for test reasons, do not use directly\nexport class CompressedObjectTreeModel<T extends NonNullable<any>, TFilterData extends NonNullable<any> = void> implements ITreeModel<ICompressedTreeNode<T> | null, TFilterData, T | null> {\n\n\treadonly rootRef = null;\n\n\tget onDidSplice(): Event<ITreeModelSpliceEvent<ICompressedTreeNode<T> | null, TFilterData>> { return this.model.onDidSplice; }\n\tget onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<ICompressedTreeNode<T>, TFilterData>> { return this.model.onDidChangeCollapseState; }\n\tget onDidChangeRenderNodeCount(): Event<ITreeNode<ICompressedTreeNode<T>, TFilterData>> { return this.model.onDidChangeRenderNodeCount; }\n\n\tprivate model: ObjectTreeModel<ICompressedTreeNode<T>, TFilterData>;\n\tprivate nodes = new Map<T | null, ICompressedTreeNode<T>>();\n\tprivate enabled: boolean;\n\tprivate readonly identityProvider?: IIdentityProvider<ICompressedTreeNode<T>>;\n\n\tconstructor(\n\t\tprivate user: string,\n\t\tlist: IList<ITreeNode<ICompressedTreeNode<T>, TFilterData>>,\n\t\toptions: ICompressedObjectTreeModelOptions<T, TFilterData> = {}\n\t) {\n\t\tthis.model = new ObjectTreeModel(user, list, options);\n\t\tthis.enabled = typeof options.compressionEnabled === 'undefined' ? true : options.compressionEnabled;\n\t\tthis.identityProvider = options.identityProvider;\n\t}\n\n\tsetChildren(\n\t\telement: T | null,\n\t\tchildren: Iterable<ICompressedTreeElement<T>> = Iterable.empty(),\n\t\toptions: IObjectTreeModelSetChildrenOptions<T, TFilterData>,\n\t): void {\n\t\t// Diffs must be deem, since the compression can affect nested elements.\n\t\t// @see https://github.com/microsoft/vscode/pull/114237#issuecomment-759425034\n\n\t\tconst diffIdentityProvider = options.diffIdentityProvider && wrapIdentityProvider(options.diffIdentityProvider);\n\t\tif (element === null) {\n\t\t\tconst compressedChildren = Iterable.map(children, this.enabled ? compress : noCompress);\n\t\t\tthis._setChildren(null, compressedChildren, { diffIdentityProvider, diffDepth: Infinity });\n\t\t\treturn;\n\t\t}\n\n\t\tconst compressedNode = this.nodes.get(element);\n\n\t\tif (!compressedNode) {\n\t\t\tthrow new Error('Unknown compressed tree node');\n\t\t}\n\n\t\tconst node = this.model.getNode(compressedNode) as ITreeNode<ICompressedTreeNode<T>, TFilterData>;\n\t\tconst compressedParentNode = this.model.getParentNodeLocation(compressedNode);\n\t\tconst parent = this.model.getNode(compressedParentNode) as ITreeNode<ICompressedTreeNode<T>, TFilterData>;\n\n\t\tconst decompressedElement = decompress(node);\n\t\tconst splicedElement = splice(decompressedElement, element, children);\n\t\tconst recompressedElement = (this.enabled ? compress : noCompress)(splicedElement);\n\n\t\tconst parentChildren = parent.children\n\t\t\t.map(child => child === node ? recompressedElement : child);\n\n\t\tthis._setChildren(parent.element, parentChildren, {\n\t\t\tdiffIdentityProvider,\n\t\t\tdiffDepth: node.depth - parent.depth,\n\t\t});\n\t}\n\n\tsetCompressionEnabled(enabled: boolean): void {\n\t\tif (enabled === this.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.enabled = enabled;\n\n\t\tconst root = this.model.getNode();\n\t\tconst rootChildren = root.children as ITreeNode<ICompressedTreeNode<T>>[];\n\t\tconst decompressedRootChildren = Iterable.map(rootChildren, decompress);\n\t\tconst recompressedRootChildren = Iterable.map(decompressedRootChildren, enabled ? compress : noCompress);\n\n\t\t// it should be safe to always use deep diff mode here if an identity\n\t\t// provider is available, since we know the raw nodes are unchanged.\n\t\tthis._setChildren(null, recompressedRootChildren, {\n\t\t\tdiffIdentityProvider: this.identityProvider,\n\t\t\tdiffDepth: Infinity,\n\t\t});\n\t}\n\n\tprivate _setChildren(\n\t\tnode: ICompressedTreeNode<T> | null,\n\t\tchildren: Iterable<ITreeElement<ICompressedTreeNode<T>>>,\n\t\toptions: IIndexTreeModelSpliceOptions<ICompressedTreeNode<T>, TFilterData>,\n\t): void {\n\t\tconst insertedElements = new Set<T | null>();\n\t\tconst onDidCreateNode = (node: ITreeNode<ICompressedTreeNode<T>, TFilterData>) => {\n\t\t\tfor (const element of node.element.elements) {\n\t\t\t\tinsertedElements.add(element);\n\t\t\t\tthis.nodes.set(element, node.element);\n\t\t\t}\n\t\t};\n\n\t\tconst onDidDeleteNode = (node: ITreeNode<ICompressedTreeNode<T>, TFilterData>) => {\n\t\t\tfor (const element of node.element.elements) {\n\t\t\t\tif (!insertedElements.has(element)) {\n\t\t\t\t\tthis.nodes.delete(element);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.model.setChildren(node, children, { ...options, onDidCreateNode, onDidDeleteNode });\n\t}\n\n\thas(element: T | null): boolean {\n\t\treturn this.nodes.has(element);\n\t}\n\n\tgetListIndex(location: T | null): number {\n\t\tconst node = this.getCompressedNode(location);\n\t\treturn this.model.getListIndex(node);\n\t}\n\n\tgetListRenderCount(location: T | null): number {\n\t\tconst node = this.getCompressedNode(location);\n\t\treturn this.model.getListRenderCount(node);\n\t}\n\n\tgetNode(location?: T | null | undefined): ITreeNode<ICompressedTreeNode<T> | null, TFilterData> {\n\t\tif (typeof location === 'undefined') {\n\t\t\treturn this.model.getNode();\n\t\t}\n\n\t\tconst node = this.getCompressedNode(location);\n\t\treturn this.model.getNode(node);\n\t}\n\n\t// TODO: review this\n\tgetNodeLocation(node: ITreeNode<ICompressedTreeNode<T>, TFilterData>): T | null {\n\t\tconst compressedNode = this.model.getNodeLocation(node);\n\n\t\tif (compressedNode === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn compressedNode.elements[compressedNode.elements.length - 1];\n\t}\n\n\t// TODO: review this\n\tgetParentNodeLocation(location: T | null): T | null {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\tconst parentNode = this.model.getParentNodeLocation(compressedNode);\n\n\t\tif (parentNode === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn parentNode.elements[parentNode.elements.length - 1];\n\t}\n\n\tgetFirstElementChild(location: T | null): ICompressedTreeNode<T> | null | undefined {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\treturn this.model.getFirstElementChild(compressedNode);\n\t}\n\n\tisCollapsible(location: T | null): boolean {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\treturn this.model.isCollapsible(compressedNode);\n\t}\n\n\tsetCollapsible(location: T | null, collapsible?: boolean): boolean {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\treturn this.model.setCollapsible(compressedNode, collapsible);\n\t}\n\n\tisCollapsed(location: T | null): boolean {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\treturn this.model.isCollapsed(compressedNode);\n\t}\n\n\tsetCollapsed(location: T | null, collapsed?: boolean | undefined, recursive?: boolean | undefined): boolean {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\treturn this.model.setCollapsed(compressedNode, collapsed, recursive);\n\t}\n\n\texpandTo(location: T | null): void {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\tthis.model.expandTo(compressedNode);\n\t}\n\n\trerender(location: T | null): void {\n\t\tconst compressedNode = this.getCompressedNode(location);\n\t\tthis.model.rerender(compressedNode);\n\t}\n\n\trefilter(): void {\n\t\tthis.model.refilter();\n\t}\n\n\tgetCompressedNode(element: T | null): ICompressedTreeNode<T> | null {\n\t\tif (element === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst node = this.nodes.get(element);\n\n\t\tif (!node) {\n\t\t\tthrow new TreeError(this.user, `Tree element not found: ${element}`);\n\t\t}\n\n\t\treturn node;\n\t}\n}\n\n// Compressible Object Tree\n\nexport type ElementMapper<T> = (elements: T[]) => T;\nexport const DefaultElementMapper: ElementMapper<any> = elements => elements[elements.length - 1];\n\nexport type CompressedNodeUnwrapper<T> = (node: ICompressedTreeNode<T>) => T;\ntype CompressedNodeWeakMapper<T, TFilterData> = WeakMapper<ITreeNode<ICompressedTreeNode<T> | null, TFilterData>, ITreeNode<T | null, TFilterData>>;\n\nclass CompressedTreeNodeWrapper<T, TFilterData> implements ITreeNode<T | null, TFilterData> {\n\n\tget element(): T | null { return this.node.element === null ? null : this.unwrapper(this.node.element); }\n\tget children(): ITreeNode<T | null, TFilterData>[] { return this.node.children.map(node => new CompressedTreeNodeWrapper(this.unwrapper, node)); }\n\tget depth(): number { return this.node.depth; }\n\tget visibleChildrenCount(): number { return this.node.visibleChildrenCount; }\n\tget visibleChildIndex(): number { return this.node.visibleChildIndex; }\n\tget collapsible(): boolean { return this.node.collapsible; }\n\tget collapsed(): boolean { return this.node.collapsed; }\n\tget visible(): boolean { return this.node.visible; }\n\tget filterData(): TFilterData | undefined { return this.node.filterData; }\n\n\tconstructor(\n\t\tprivate unwrapper: CompressedNodeUnwrapper<T>,\n\t\tprivate node: ITreeNode<ICompressedTreeNode<T> | null, TFilterData>\n\t) { }\n}\n\nfunction mapList<T, TFilterData>(nodeMapper: CompressedNodeWeakMapper<T, TFilterData>, list: IList<ITreeNode<T, TFilterData>>): IList<ITreeNode<ICompressedTreeNode<T>, TFilterData>> {\n\treturn {\n\t\tsplice(start: number, deleteCount: number, toInsert: ITreeNode<ICompressedTreeNode<T>, TFilterData>[]): void {\n\t\t\tlist.splice(start, deleteCount, toInsert.map(node => nodeMapper.map(node)) as ITreeNode<T, TFilterData>[]);\n\t\t},\n\t\tupdateElementHeight(index: number, height: number): void {\n\t\t\tlist.updateElementHeight(index, height);\n\t\t}\n\t};\n}\n\nfunction mapOptions<T, TFilterData>(compressedNodeUnwrapper: CompressedNodeUnwrapper<T>, options: ICompressibleObjectTreeModelOptions<T, TFilterData>): ICompressedObjectTreeModelOptions<T, TFilterData> {\n\treturn {\n\t\t...options,\n\t\tidentityProvider: options.identityProvider && {\n\t\t\tgetId(node: ICompressedTreeNode<T>): { toString(): string } {\n\t\t\t\treturn options.identityProvider!.getId(compressedNodeUnwrapper(node));\n\t\t\t}\n\t\t},\n\t\tsorter: options.sorter && {\n\t\t\tcompare(node: ICompressedTreeNode<T>, otherNode: ICompressedTreeNode<T>): number {\n\t\t\t\treturn options.sorter!.compare(node.elements[0], otherNode.elements[0]);\n\t\t\t}\n\t\t},\n\t\tfilter: options.filter && {\n\t\t\tfilter(node: ICompressedTreeNode<T>, parentVisibility: TreeVisibility): TreeFilterResult<TFilterData> {\n\t\t\t\treturn options.filter!.filter(compressedNodeUnwrapper(node), parentVisibility);\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport interface ICompressibleObjectTreeModelOptions<T, TFilterData> extends IObjectTreeModelOptions<T, TFilterData> {\n\treadonly elementMapper?: ElementMapper<T>;\n}\n\nexport class CompressibleObjectTreeModel<T extends NonNullable<any>, TFilterData extends NonNullable<any> = void> implements IObjectTreeModel<T, TFilterData> {\n\n\treadonly rootRef = null;\n\n\tget onDidSplice(): Event<ITreeModelSpliceEvent<T | null, TFilterData>> {\n\t\treturn Event.map(this.model.onDidSplice, ({ insertedNodes, deletedNodes }) => ({\n\t\t\tinsertedNodes: insertedNodes.map(node => this.nodeMapper.map(node)),\n\t\t\tdeletedNodes: deletedNodes.map(node => this.nodeMapper.map(node)),\n\t\t}));\n\t}\n\n\tget onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<T | null, TFilterData>> {\n\t\treturn Event.map(this.model.onDidChangeCollapseState, ({ node, deep }) => ({\n\t\t\tnode: this.nodeMapper.map(node),\n\t\t\tdeep\n\t\t}));\n\t}\n\n\tget onDidChangeRenderNodeCount(): Event<ITreeNode<T | null, TFilterData>> {\n\t\treturn Event.map(this.model.onDidChangeRenderNodeCount, node => this.nodeMapper.map(node));\n\t}\n\n\tprivate elementMapper: ElementMapper<T>;\n\tprivate nodeMapper: CompressedNodeWeakMapper<T, TFilterData>;\n\tprivate model: CompressedObjectTreeModel<T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tlist: IList<ITreeNode<T, TFilterData>>,\n\t\toptions: ICompressibleObjectTreeModelOptions<T, TFilterData> = {}\n\t) {\n\t\tthis.elementMapper = options.elementMapper || DefaultElementMapper;\n\t\tconst compressedNodeUnwrapper: CompressedNodeUnwrapper<T> = node => this.elementMapper(node.elements);\n\t\tthis.nodeMapper = new WeakMapper(node => new CompressedTreeNodeWrapper(compressedNodeUnwrapper, node));\n\n\t\tthis.model = new CompressedObjectTreeModel(user, mapList(this.nodeMapper, list), mapOptions(compressedNodeUnwrapper, options));\n\t}\n\n\tsetChildren(\n\t\telement: T | null,\n\t\tchildren: Iterable<ICompressedTreeElement<T>> = Iterable.empty(),\n\t\toptions: IObjectTreeModelSetChildrenOptions<T, TFilterData> = {},\n\t): void {\n\t\tthis.model.setChildren(element, children, options);\n\t}\n\n\tsetCompressionEnabled(enabled: boolean): void {\n\t\tthis.model.setCompressionEnabled(enabled);\n\t}\n\n\thas(location: T | null): boolean {\n\t\treturn this.model.has(location);\n\t}\n\n\tgetListIndex(location: T | null): number {\n\t\treturn this.model.getListIndex(location);\n\t}\n\n\tgetListRenderCount(location: T | null): number {\n\t\treturn this.model.getListRenderCount(location);\n\t}\n\n\tgetNode(location?: T | null | undefined): ITreeNode<T | null, any> {\n\t\treturn this.nodeMapper.map(this.model.getNode(location));\n\t}\n\n\tgetNodeLocation(node: ITreeNode<T | null, any>): T | null {\n\t\treturn node.element;\n\t}\n\n\tgetParentNodeLocation(location: T | null): T | null {\n\t\treturn this.model.getParentNodeLocation(location);\n\t}\n\n\tgetFirstElementChild(location: T | null): T | null | undefined {\n\t\tconst result = this.model.getFirstElementChild(location);\n\n\t\tif (result === null || typeof result === 'undefined') {\n\t\t\treturn result;\n\t\t}\n\n\t\treturn this.elementMapper(result.elements);\n\t}\n\n\tisCollapsible(location: T | null): boolean {\n\t\treturn this.model.isCollapsible(location);\n\t}\n\n\tsetCollapsible(location: T | null, collapsed?: boolean): boolean {\n\t\treturn this.model.setCollapsible(location, collapsed);\n\t}\n\n\tisCollapsed(location: T | null): boolean {\n\t\treturn this.model.isCollapsed(location);\n\t}\n\n\tsetCollapsed(location: T | null, collapsed?: boolean | undefined, recursive?: boolean | undefined): boolean {\n\t\treturn this.model.setCollapsed(location, collapsed, recursive);\n\t}\n\n\texpandTo(location: T | null): void {\n\t\treturn this.model.expandTo(location);\n\t}\n\n\trerender(location: T | null): void {\n\t\treturn this.model.rerender(location);\n\t}\n\n\trefilter(): void {\n\t\treturn this.model.refilter();\n\t}\n\n\tgetCompressedTreeNode(location: T | null = null): ITreeNode<ICompressedTreeNode<T> | null, TFilterData> {\n\t\treturn this.model.getNode(location);\n\t}\n}\n","\nimport { CharCode } from 'vs/base/common/charCode';\nimport { compare, compareIgnoreCase, compareSubstring, compareSubstringIgnoreCase } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\n\nexport interface IKeyIterator<K> {\n\treset(key: K): this;\n\tnext(): this;\n\n\thasNext(): boolean;\n\tcmp(a: string): number;\n\tvalue(): string;\n}\n\nexport class StringIterator implements IKeyIterator<string> {\n\n\tprivate _value: string = '';\n\tprivate _pos: number = 0;\n\n\treset(key: string): this {\n\t\tthis._value = key;\n\t\tthis._pos = 0;\n\t\treturn this;\n\t}\n\n\tnext(): this {\n\t\tthis._pos += 1;\n\t\treturn this;\n\t}\n\n\thasNext(): boolean {\n\t\treturn this._pos < this._value.length - 1;\n\t}\n\n\tcmp(a: string): number {\n\t\tconst aCode = a.charCodeAt(0);\n\t\tconst thisCode = this._value.charCodeAt(this._pos);\n\t\treturn aCode - thisCode;\n\t}\n\n\tvalue(): string {\n\t\treturn this._value[this._pos];\n\t}\n}\n\nexport class ConfigKeysIterator implements IKeyIterator<string> {\n\n\tprivate _value!: string;\n\tprivate _from!: number;\n\tprivate _to!: number;\n\n\tconstructor(\n\t\tprivate readonly _caseSensitive: boolean = true\n\t) { }\n\n\treset(key: string): this {\n\t\tthis._value = key;\n\t\tthis._from = 0;\n\t\tthis._to = 0;\n\t\treturn this.next();\n\t}\n\n\thasNext(): boolean {\n\t\treturn this._to < this._value.length;\n\t}\n\n\tnext(): this {\n\t\t// this._data = key.split(/[\\\\/]/).filter(s => !!s);\n\t\tthis._from = this._to;\n\t\tlet justSeps = true;\n\t\tfor (; this._to < this._value.length; this._to++) {\n\t\t\tconst ch = this._value.charCodeAt(this._to);\n\t\t\tif (ch === CharCode.Period) {\n\t\t\t\tif (justSeps) {\n\t\t\t\t\tthis._from++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjustSeps = false;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tcmp(a: string): number {\n\t\treturn this._caseSensitive\n\t\t\t? compareSubstring(a, this._value, 0, a.length, this._from, this._to)\n\t\t\t: compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to);\n\t}\n\n\tvalue(): string {\n\t\treturn this._value.substring(this._from, this._to);\n\t}\n}\n\nexport class PathIterator implements IKeyIterator<string> {\n\n\tprivate _value!: string;\n\tprivate _valueLen!: number;\n\tprivate _from!: number;\n\tprivate _to!: number;\n\n\tconstructor(\n\t\tprivate readonly _splitOnBackslash: boolean = true,\n\t\tprivate readonly _caseSensitive: boolean = true\n\t) { }\n\n\treset(key: string): this {\n\t\tthis._from = 0;\n\t\tthis._to = 0;\n\t\tthis._value = key;\n\t\tthis._valueLen = key.length;\n\t\tfor (let pos = key.length - 1; pos >= 0; pos--, this._valueLen--) {\n\t\t\tconst ch = this._value.charCodeAt(pos);\n\t\t\tif (!(ch === CharCode.Slash || this._splitOnBackslash && ch === CharCode.Backslash)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn this.next();\n\t}\n\n\thasNext(): boolean {\n\t\treturn this._to < this._valueLen;\n\t}\n\n\tnext(): this {\n\t\t// this._data = key.split(/[\\\\/]/).filter(s => !!s);\n\t\tthis._from = this._to;\n\t\tlet justSeps = true;\n\t\tfor (; this._to < this._valueLen; this._to++) {\n\t\t\tconst ch = this._value.charCodeAt(this._to);\n\t\t\tif (ch === CharCode.Slash || this._splitOnBackslash && ch === CharCode.Backslash) {\n\t\t\t\tif (justSeps) {\n\t\t\t\t\tthis._from++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjustSeps = false;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tcmp(a: string): number {\n\t\treturn this._caseSensitive\n\t\t\t? compareSubstring(a, this._value, 0, a.length, this._from, this._to)\n\t\t\t: compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to);\n\t}\n\n\tvalue(): string {\n\t\treturn this._value.substring(this._from, this._to);\n\t}\n}\n\nconst enum UriIteratorState {\n\tScheme = 1, Authority = 2, Path = 3, Query = 4, Fragment = 5\n}\n\nexport class UriIterator implements IKeyIterator<URI> {\n\n\tprivate _pathIterator!: PathIterator;\n\tprivate _value!: URI;\n\tprivate _states: UriIteratorState[] = [];\n\tprivate _stateIdx: number = 0;\n\n\tconstructor(private readonly _ignorePathCasing: (uri: URI) => boolean) { }\n\n\treset(key: URI): this {\n\t\tthis._value = key;\n\t\tthis._states = [];\n\t\tif (this._value.scheme) {\n\t\t\tthis._states.push(UriIteratorState.Scheme);\n\t\t}\n\t\tif (this._value.authority) {\n\t\t\tthis._states.push(UriIteratorState.Authority);\n\t\t}\n\t\tif (this._value.path) {\n\t\t\tthis._pathIterator = new PathIterator(false, !this._ignorePathCasing(key));\n\t\t\tthis._pathIterator.reset(key.path);\n\t\t\tif (this._pathIterator.value()) {\n\t\t\t\tthis._states.push(UriIteratorState.Path);\n\t\t\t}\n\t\t}\n\t\tif (this._value.query) {\n\t\t\tthis._states.push(UriIteratorState.Query);\n\t\t}\n\t\tif (this._value.fragment) {\n\t\t\tthis._states.push(UriIteratorState.Fragment);\n\t\t}\n\t\tthis._stateIdx = 0;\n\t\treturn this;\n\t}\n\n\tnext(): this {\n\t\tif (this._states[this._stateIdx] === UriIteratorState.Path && this._pathIterator.hasNext()) {\n\t\t\tthis._pathIterator.next();\n\t\t} else {\n\t\t\tthis._stateIdx += 1;\n\t\t}\n\t\treturn this;\n\t}\n\n\thasNext(): boolean {\n\t\treturn (this._states[this._stateIdx] === UriIteratorState.Path && this._pathIterator.hasNext())\n\t\t\t|| this._stateIdx < this._states.length - 1;\n\t}\n\n\tcmp(a: string): number {\n\t\tif (this._states[this._stateIdx] === UriIteratorState.Scheme) {\n\t\t\treturn compareIgnoreCase(a, this._value.scheme);\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Authority) {\n\t\t\treturn compareIgnoreCase(a, this._value.authority);\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Path) {\n\t\t\treturn this._pathIterator.cmp(a);\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Query) {\n\t\t\treturn compare(a, this._value.query);\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Fragment) {\n\t\t\treturn compare(a, this._value.fragment);\n\t\t}\n\t\tthrow new Error();\n\t}\n\n\tvalue(): string {\n\t\tif (this._states[this._stateIdx] === UriIteratorState.Scheme) {\n\t\t\treturn this._value.scheme;\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Authority) {\n\t\t\treturn this._value.authority;\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Path) {\n\t\t\treturn this._pathIterator.value();\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Query) {\n\t\t\treturn this._value.query;\n\t\t} else if (this._states[this._stateIdx] === UriIteratorState.Fragment) {\n\t\t\treturn this._value.fragment;\n\t\t}\n\t\tthrow new Error();\n\t}\n}\n\nclass TernarySearchTreeNode<K, V> {\n\theight: number = 1;\n\tsegment!: string;\n\tvalue: V | undefined;\n\tkey: K | undefined;\n\tleft: TernarySearchTreeNode<K, V> | undefined;\n\tmid: TernarySearchTreeNode<K, V> | undefined;\n\tright: TernarySearchTreeNode<K, V> | undefined;\n\n\trotateLeft() {\n\t\tconst tmp = this.right!;\n\t\tthis.right = tmp.left;\n\t\ttmp.left = this;\n\t\tthis.updateHeight();\n\t\ttmp.updateHeight();\n\t\treturn tmp;\n\t}\n\n\trotateRight() {\n\t\tconst tmp = this.left!;\n\t\tthis.left = tmp.right;\n\t\ttmp.right = this;\n\t\tthis.updateHeight();\n\t\ttmp.updateHeight();\n\t\treturn tmp;\n\t}\n\n\tupdateHeight() {\n\t\tthis.height = 1 + Math.max(this.heightLeft, this.heightRight);\n\t}\n\n\tbalanceFactor() {\n\t\treturn this.heightRight - this.heightLeft;\n\t}\n\n\tget heightLeft() {\n\t\treturn this.left?.height ?? 0;\n\t}\n\n\tget heightRight() {\n\t\treturn this.right?.height ?? 0;\n\t}\n}\n\nconst enum Dir {\n\tLeft = -1,\n\tMid = 0,\n\tRight = 1,\n}\n\nexport class TernarySearchTree<K, V> {\n\n\tstatic forUris<E>(ignorePathCasing: (key: URI) => boolean = () => false): TernarySearchTree<URI, E> {\n\t\treturn new TernarySearchTree<URI, E>(new UriIterator(ignorePathCasing));\n\t}\n\n\tstatic forStrings<E>(): TernarySearchTree<string, E> {\n\t\treturn new TernarySearchTree<string, E>(new StringIterator());\n\t}\n\n\tstatic forConfigKeys<E>(): TernarySearchTree<string, E> {\n\t\treturn new TernarySearchTree<string, E>(new ConfigKeysIterator());\n\t}\n\n\tprivate _iter: IKeyIterator<K>;\n\tprivate _root: TernarySearchTreeNode<K, V> | undefined;\n\n\tconstructor(segments: IKeyIterator<K>) {\n\t\tthis._iter = segments;\n\t}\n\n\tclear(): void {\n\t\tthis._root = undefined;\n\t}\n\n\tset(key: K, element: V): V | undefined {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node: TernarySearchTreeNode<K, V>;\n\n\t\tif (!this._root) {\n\t\t\tthis._root = new TernarySearchTreeNode<K, V>();\n\t\t\tthis._root.segment = iter.value();\n\t\t}\n\t\tconst stack: [Dir, TernarySearchTreeNode<K, V>][] = [];\n\n\t\t// find insert_node\n\t\tnode = this._root;\n\t\twhile (true) {\n\t\t\tconst val = iter.cmp(node.segment);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tif (!node.left) {\n\t\t\t\t\tnode.left = new TernarySearchTreeNode<K, V>();\n\t\t\t\t\tnode.left.segment = iter.value();\n\t\t\t\t}\n\t\t\t\tstack.push([Dir.Left, node]);\n\t\t\t\tnode = node.left;\n\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tif (!node.right) {\n\t\t\t\t\tnode.right = new TernarySearchTreeNode<K, V>();\n\t\t\t\t\tnode.right.segment = iter.value();\n\t\t\t\t}\n\t\t\t\tstack.push([Dir.Right, node]);\n\t\t\t\tnode = node.right;\n\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tif (!node.mid) {\n\t\t\t\t\tnode.mid = new TernarySearchTreeNode<K, V>();\n\t\t\t\t\tnode.mid.segment = iter.value();\n\t\t\t\t}\n\t\t\t\tstack.push([Dir.Mid, node]);\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// set value\n\t\tconst oldElement = node.value;\n\t\tnode.value = element;\n\t\tnode.key = key;\n\n\t\t// balance\n\t\tfor (let i = stack.length - 1; i >= 0; i--) {\n\t\t\tconst node = stack[i][1];\n\n\t\t\tnode.updateHeight();\n\t\t\tconst bf = node.balanceFactor();\n\n\t\t\tif (bf < -1 || bf > 1) {\n\t\t\t\t// needs rotate\n\t\t\t\tconst d1 = stack[i][0];\n\t\t\t\tconst d2 = stack[i + 1][0];\n\n\t\t\t\tif (d1 === Dir.Right && d2 === Dir.Right) {\n\t\t\t\t\t//right, right -> rotate left\n\t\t\t\t\tstack[i][1] = node.rotateLeft();\n\n\t\t\t\t} else if (d1 === Dir.Left && d2 === Dir.Left) {\n\t\t\t\t\t// left, left -> rotate right\n\t\t\t\t\tstack[i][1] = node.rotateRight();\n\n\t\t\t\t} else if (d1 === Dir.Right && d2 === Dir.Left) {\n\t\t\t\t\t// right, left -> double rotate right, left\n\t\t\t\t\tnode.right = stack[i + 1][1] = stack[i + 1][1].rotateRight();\n\t\t\t\t\tstack[i][1] = node.rotateLeft();\n\n\t\t\t\t} else if (d1 === Dir.Left && d2 === Dir.Right) {\n\t\t\t\t\t// left, right -> double rotate left, right\n\t\t\t\t\tnode.left = stack[i + 1][1] = stack[i + 1][1].rotateLeft();\n\t\t\t\t\tstack[i][1] = node.rotateRight();\n\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error();\n\t\t\t\t}\n\n\t\t\t\t// patch path to parent\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tswitch (stack[i - 1][0]) {\n\t\t\t\t\t\tcase Dir.Left:\n\t\t\t\t\t\t\tstack[i - 1][1].left = stack[i][1];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Dir.Right:\n\t\t\t\t\t\t\tstack[i - 1][1].right = stack[i][1];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Dir.Mid:\n\t\t\t\t\t\t\tstack[i - 1][1].mid = stack[i][1];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._root = stack[0][1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn oldElement;\n\t}\n\n\tget(key: K): V | undefined {\n\t\treturn this._getNode(key)?.value;\n\t}\n\n\tprivate _getNode(key: K) {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\twhile (node) {\n\t\t\tconst val = iter.cmp(node.segment);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}\n\n\thas(key: K): boolean {\n\t\tconst node = this._getNode(key);\n\t\treturn !(node?.value === undefined && node?.mid === undefined);\n\t}\n\n\tdelete(key: K): void {\n\t\treturn this._delete(key, false);\n\t}\n\n\tdeleteSuperstr(key: K): void {\n\t\treturn this._delete(key, true);\n\t}\n\n\tprivate _delete(key: K, superStr: boolean): void {\n\t\tconst iter = this._iter.reset(key);\n\t\tconst stack: [Dir, TernarySearchTreeNode<K, V>][] = [];\n\t\tlet node = this._root;\n\n\t\t// find node\n\t\twhile (node) {\n\t\t\tconst val = iter.cmp(node.segment);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tstack.push([Dir.Left, node]);\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tstack.push([Dir.Right, node]);\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tstack.push([Dir.Mid, node]);\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\t// node not found\n\t\t\treturn;\n\t\t}\n\n\t\tif (superStr) {\n\t\t\t// removing children, reset height\n\t\t\tnode.left = undefined;\n\t\t\tnode.mid = undefined;\n\t\t\tnode.right = undefined;\n\t\t\tnode.height = 1;\n\t\t} else {\n\t\t\t// removing element\n\t\t\tnode.key = undefined;\n\t\t\tnode.value = undefined;\n\t\t}\n\n\t\t// BST node removal\n\t\tif (!node.mid && !node.value) {\n\t\t\tif (node.left && node.right) {\n\t\t\t\t// full node\n\t\t\t\tconst min = this._min(node.right);\n\t\t\t\tconst { key, value, segment } = min;\n\t\t\t\tthis._delete(min.key!, false);\n\t\t\t\tnode.key = key;\n\t\t\t\tnode.value = value;\n\t\t\t\tnode.segment = segment;\n\n\t\t\t} else {\n\t\t\t\t// empty or half empty\n\t\t\t\tconst newChild = node.left ?? node.right;\n\t\t\t\tif (stack.length > 0) {\n\t\t\t\t\tconst [dir, parent] = stack[stack.length - 1];\n\t\t\t\t\tswitch (dir) {\n\t\t\t\t\t\tcase Dir.Left: parent.left = newChild; break;\n\t\t\t\t\t\tcase Dir.Mid: parent.mid = newChild; break;\n\t\t\t\t\t\tcase Dir.Right: parent.right = newChild; break;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._root = newChild;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// AVL balance\n\t\tfor (let i = stack.length - 1; i >= 0; i--) {\n\t\t\tconst node = stack[i][1];\n\n\t\t\tnode.updateHeight();\n\t\t\tconst bf = node.balanceFactor();\n\t\t\tif (bf > 1) {\n\t\t\t\t// right heavy\n\t\t\t\tif (node.right!.balanceFactor() >= 0) {\n\t\t\t\t\t// right, right -> rotate left\n\t\t\t\t\tstack[i][1] = node.rotateLeft();\n\t\t\t\t} else {\n\t\t\t\t\t// right, left -> double rotate\n\t\t\t\t\tnode.right = node.right!.rotateRight();\n\t\t\t\t\tstack[i][1] = node.rotateLeft();\n\t\t\t\t}\n\n\t\t\t} else if (bf < -1) {\n\t\t\t\t// left heavy\n\t\t\t\tif (node.left!.balanceFactor() <= 0) {\n\t\t\t\t\t// left, left -> rotate right\n\t\t\t\t\tstack[i][1] = node.rotateRight();\n\t\t\t\t} else {\n\t\t\t\t\t// left, right -> double rotate\n\t\t\t\t\tnode.left = node.left!.rotateLeft();\n\t\t\t\t\tstack[i][1] = node.rotateRight();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// patch path to parent\n\t\t\tif (i > 0) {\n\t\t\t\tswitch (stack[i - 1][0]) {\n\t\t\t\t\tcase Dir.Left:\n\t\t\t\t\t\tstack[i - 1][1].left = stack[i][1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Dir.Right:\n\t\t\t\t\t\tstack[i - 1][1].right = stack[i][1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Dir.Mid:\n\t\t\t\t\t\tstack[i - 1][1].mid = stack[i][1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._root = stack[0][1];\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _min(node: TernarySearchTreeNode<K, V>): TernarySearchTreeNode<K, V> {\n\t\twhile (node.left) {\n\t\t\tnode = node.left;\n\t\t}\n\t\treturn node;\n\t}\n\n\tfindSubstr(key: K): V | undefined {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\tlet candidate: V | undefined = undefined;\n\t\twhile (node) {\n\t\t\tconst val = iter.cmp(node.segment);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tcandidate = node.value || candidate;\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn node && node.value || candidate;\n\t}\n\n\tfindSuperstr(key: K): IterableIterator<[K, V]> | undefined {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\twhile (node) {\n\t\t\tconst val = iter.cmp(node.segment);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\t// collect\n\t\t\t\tif (!node.mid) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else {\n\t\t\t\t\treturn this._entries(node.mid);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tforEach(callback: (value: V, index: K) => any): void {\n\t\tfor (const [key, value] of this) {\n\t\t\tcallback(value, key);\n\t\t}\n\t}\n\n\t*[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\tyield* this._entries(this._root);\n\t}\n\n\tprivate *_entries(node: TernarySearchTreeNode<K, V> | undefined): IterableIterator<[K, V]> {\n\t\t// DFS\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\t\tif (node.left) {\n\t\t\tyield* this._entries(node.left);\n\t\t}\n\t\tif (node.value) {\n\t\t\tyield [node.key!, node.value];\n\t\t}\n\t\tif (node.mid) {\n\t\t\tyield* this._entries(node.mid);\n\t\t}\n\t\tif (node.right) {\n\t\t\tyield* this._entries(node.right);\n\t\t}\n\t}\n}\n\ninterface ResourceMapKeyFn {\n\t(resource: URI): string;\n}\n\nclass ResourceMapEntry<T> {\n\tconstructor(readonly uri: URI, readonly value: T) { }\n}\n\nexport class ResourceMap<T> implements Map<URI, T> {\n\n\tprivate static readonly defaultToKey = (resource: URI) => resource.toString();\n\n\treadonly [Symbol.toStringTag] = 'ResourceMap';\n\n\tprivate readonly map: Map<string, ResourceMapEntry<T>>;\n\tprivate readonly toKey: ResourceMapKeyFn;\n\n\t/**\n\t *\n\t * @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util\n\t */\n\tconstructor(toKey?: ResourceMapKeyFn);\n\n\t/**\n\t *\n\t * @param other Another resource which this maps is created from\n\t * @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util\n\t */\n\tconstructor(other?: ResourceMap<T>, toKey?: ResourceMapKeyFn);\n\n\tconstructor(mapOrKeyFn?: ResourceMap<T> | ResourceMapKeyFn, toKey?: ResourceMapKeyFn) {\n\t\tif (mapOrKeyFn instanceof ResourceMap) {\n\t\t\tthis.map = new Map(mapOrKeyFn.map);\n\t\t\tthis.toKey = toKey ?? ResourceMap.defaultToKey;\n\t\t} else {\n\t\t\tthis.map = new Map();\n\t\t\tthis.toKey = mapOrKeyFn ?? ResourceMap.defaultToKey;\n\t\t}\n\t}\n\n\tset(resource: URI, value: T): this {\n\t\tthis.map.set(this.toKey(resource), new ResourceMapEntry(resource, value));\n\t\treturn this;\n\t}\n\n\tget(resource: URI): T | undefined {\n\t\treturn this.map.get(this.toKey(resource))?.value;\n\t}\n\n\thas(resource: URI): boolean {\n\t\treturn this.map.has(this.toKey(resource));\n\t}\n\n\tget size(): number {\n\t\treturn this.map.size;\n\t}\n\n\tclear(): void {\n\t\tthis.map.clear();\n\t}\n\n\tdelete(resource: URI): boolean {\n\t\treturn this.map.delete(this.toKey(resource));\n\t}\n\n\tforEach(clb: (value: T, key: URI, map: Map<URI, T>) => void, thisArg?: any): void {\n\t\tif (typeof thisArg !== 'undefined') {\n\t\t\tclb = clb.bind(thisArg);\n\t\t}\n\t\tfor (let [_, entry] of this.map) {\n\t\t\tclb(entry.value, entry.uri, <any>this);\n\t\t}\n\t}\n\n\t*values(): IterableIterator<T> {\n\t\tfor (let entry of this.map.values()) {\n\t\t\tyield entry.value;\n\t\t}\n\t}\n\n\t*keys(): IterableIterator<URI> {\n\t\tfor (let entry of this.map.values()) {\n\t\t\tyield entry.uri;\n\t\t}\n\t}\n\n\t*entries(): IterableIterator<[URI, T]> {\n\t\tfor (let entry of this.map.values()) {\n\t\t\tyield [entry.uri, entry.value];\n\t\t}\n\t}\n\n\t*[Symbol.iterator](): IterableIterator<[URI, T]> {\n\t\tfor (let [, entry] of this.map) {\n\t\t\tyield [entry.uri, entry.value];\n\t\t}\n\t}\n}\n\ninterface Item<K, V> {\n\tprevious: Item<K, V> | undefined;\n\tnext: Item<K, V> | undefined;\n\tkey: K;\n\tvalue: V;\n}\n\nexport const enum Touch {\n\tNone = 0,\n\tAsOld = 1,\n\tAsNew = 2\n}\n\nexport class LinkedMap<K, V> implements Map<K, V> {\n\n\treadonly [Symbol.toStringTag] = 'LinkedMap';\n\n\tprivate _map: Map<K, Item<K, V>>;\n\tprivate _head: Item<K, V> | undefined;\n\tprivate _tail: Item<K, V> | undefined;\n\tprivate _size: number;\n\n\tprivate _state: number;\n\n\tconstructor() {\n\t\tthis._map = new Map<K, Item<K, V>>();\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t\tthis._state = 0;\n\t}\n\n\tclear(): void {\n\t\tthis._map.clear();\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t\tthis._state++;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn !this._head && !this._tail;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tget first(): V | undefined {\n\t\treturn this._head?.value;\n\t}\n\n\tget last(): V | undefined {\n\t\treturn this._tail?.value;\n\t}\n\n\thas(key: K): boolean {\n\t\treturn this._map.has(key);\n\t}\n\n\tget(key: K, touch: Touch = Touch.None): V | undefined {\n\t\tconst item = this._map.get(key);\n\t\tif (!item) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (touch !== Touch.None) {\n\t\t\tthis.touch(item, touch);\n\t\t}\n\t\treturn item.value;\n\t}\n\n\tset(key: K, value: V, touch: Touch = Touch.None): this {\n\t\tlet item = this._map.get(key);\n\t\tif (item) {\n\t\t\titem.value = value;\n\t\t\tif (touch !== Touch.None) {\n\t\t\t\tthis.touch(item, touch);\n\t\t\t}\n\t\t} else {\n\t\t\titem = { key, value, next: undefined, previous: undefined };\n\t\t\tswitch (touch) {\n\t\t\t\tcase Touch.None:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Touch.AsOld:\n\t\t\t\t\tthis.addItemFirst(item);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Touch.AsNew:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._map.set(key, item);\n\t\t\tthis._size++;\n\t\t}\n\t\treturn this;\n\t}\n\n\tdelete(key: K): boolean {\n\t\treturn !!this.remove(key);\n\t}\n\n\tremove(key: K): V | undefined {\n\t\tconst item = this._map.get(key);\n\t\tif (!item) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._map.delete(key);\n\t\tthis.removeItem(item);\n\t\tthis._size--;\n\t\treturn item.value;\n\t}\n\n\tshift(): V | undefined {\n\t\tif (!this._head && !this._tail) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (!this._head || !this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t}\n\t\tconst item = this._head;\n\t\tthis._map.delete(item.key);\n\t\tthis.removeItem(item);\n\t\tthis._size--;\n\t\treturn item.value;\n\t}\n\n\tforEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void {\n\t\tconst state = this._state;\n\t\tlet current = this._head;\n\t\twhile (current) {\n\t\t\tif (thisArg) {\n\t\t\t\tcallbackfn.bind(thisArg)(current.value, current.key, this);\n\t\t\t} else {\n\t\t\t\tcallbackfn(current.value, current.key, this);\n\t\t\t}\n\t\t\tif (this._state !== state) {\n\t\t\t\tthrow new Error(`LinkedMap got modified during iteration.`);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\tkeys(): IterableIterator<K> {\n\t\tconst map = this;\n\t\tconst state = this._state;\n\t\tlet current = this._head;\n\t\tconst iterator: IterableIterator<K> = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn iterator;\n\t\t\t},\n\t\t\tnext(): IteratorResult<K> {\n\t\t\t\tif (map._state !== state) {\n\t\t\t\t\tthrow new Error(`LinkedMap got modified during iteration.`);\n\t\t\t\t}\n\t\t\t\tif (current) {\n\t\t\t\t\tconst result = { value: current.key, done: false };\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn { value: undefined, done: true };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn iterator;\n\t}\n\n\tvalues(): IterableIterator<V> {\n\t\tconst map = this;\n\t\tconst state = this._state;\n\t\tlet current = this._head;\n\t\tconst iterator: IterableIterator<V> = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn iterator;\n\t\t\t},\n\t\t\tnext(): IteratorResult<V> {\n\t\t\t\tif (map._state !== state) {\n\t\t\t\t\tthrow new Error(`LinkedMap got modified during iteration.`);\n\t\t\t\t}\n\t\t\t\tif (current) {\n\t\t\t\t\tconst result = { value: current.value, done: false };\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn { value: undefined, done: true };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn iterator;\n\t}\n\n\tentries(): IterableIterator<[K, V]> {\n\t\tconst map = this;\n\t\tconst state = this._state;\n\t\tlet current = this._head;\n\t\tconst iterator: IterableIterator<[K, V]> = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn iterator;\n\t\t\t},\n\t\t\tnext(): IteratorResult<[K, V]> {\n\t\t\t\tif (map._state !== state) {\n\t\t\t\t\tthrow new Error(`LinkedMap got modified during iteration.`);\n\t\t\t\t}\n\t\t\t\tif (current) {\n\t\t\t\t\tconst result: IteratorResult<[K, V]> = { value: [current.key, current.value], done: false };\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn { value: undefined, done: true };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\treturn this.entries();\n\t}\n\n\tprotected trimOld(newSize: number) {\n\t\tif (newSize >= this.size) {\n\t\t\treturn;\n\t\t}\n\t\tif (newSize === 0) {\n\t\t\tthis.clear();\n\t\t\treturn;\n\t\t}\n\t\tlet current = this._head;\n\t\tlet currentSize = this.size;\n\t\twhile (current && currentSize > newSize) {\n\t\t\tthis._map.delete(current.key);\n\t\t\tcurrent = current.next;\n\t\t\tcurrentSize--;\n\t\t}\n\t\tthis._head = current;\n\t\tthis._size = currentSize;\n\t\tif (current) {\n\t\t\tcurrent.previous = undefined;\n\t\t}\n\t\tthis._state++;\n\t}\n\n\tprivate addItemFirst(item: Item<K, V>): void {\n\t\t// First time Insert\n\t\tif (!this._head && !this._tail) {\n\t\t\tthis._tail = item;\n\t\t} else if (!this._head) {\n\t\t\tthrow new Error('Invalid list');\n\t\t} else {\n\t\t\titem.next = this._head;\n\t\t\tthis._head.previous = item;\n\t\t}\n\t\tthis._head = item;\n\t\tthis._state++;\n\t}\n\n\tprivate addItemLast(item: Item<K, V>): void {\n\t\t// First time Insert\n\t\tif (!this._head && !this._tail) {\n\t\t\tthis._head = item;\n\t\t} else if (!this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t} else {\n\t\t\titem.previous = this._tail;\n\t\t\tthis._tail.next = item;\n\t\t}\n\t\tthis._tail = item;\n\t\tthis._state++;\n\t}\n\n\tprivate removeItem(item: Item<K, V>): void {\n\t\tif (item === this._head && item === this._tail) {\n\t\t\tthis._head = undefined;\n\t\t\tthis._tail = undefined;\n\t\t}\n\t\telse if (item === this._head) {\n\t\t\t// This can only happen if size === 1 which is handled\n\t\t\t// by the case above.\n\t\t\tif (!item.next) {\n\t\t\t\tthrow new Error('Invalid list');\n\t\t\t}\n\t\t\titem.next.previous = undefined;\n\t\t\tthis._head = item.next;\n\t\t}\n\t\telse if (item === this._tail) {\n\t\t\t// This can only happen if size === 1 which is handled\n\t\t\t// by the case above.\n\t\t\tif (!item.previous) {\n\t\t\t\tthrow new Error('Invalid list');\n\t\t\t}\n\t\t\titem.previous.next = undefined;\n\t\t\tthis._tail = item.previous;\n\t\t}\n\t\telse {\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\t\t\tif (!next || !previous) {\n\t\t\t\tthrow new Error('Invalid list');\n\t\t\t}\n\t\t\tnext.previous = previous;\n\t\t\tprevious.next = next;\n\t\t}\n\t\titem.next = undefined;\n\t\titem.previous = undefined;\n\t\tthis._state++;\n\t}\n\n\tprivate touch(item: Item<K, V>, touch: Touch): void {\n\t\tif (!this._head || !this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t}\n\t\tif ((touch !== Touch.AsOld && touch !== Touch.AsNew)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (touch === Touch.AsOld) {\n\t\t\tif (item === this._head) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\n\t\t\t// Unlink the item\n\t\t\tif (item === this._tail) {\n\t\t\t\t// previous must be defined since item was not head but is tail\n\t\t\t\t// So there are more than on item in the map\n\t\t\t\tprevious!.next = undefined;\n\t\t\t\tthis._tail = previous;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Both next and previous are not undefined since item was neither head nor tail.\n\t\t\t\tnext!.previous = previous;\n\t\t\t\tprevious!.next = next;\n\t\t\t}\n\n\t\t\t// Insert the node at head\n\t\t\titem.previous = undefined;\n\t\t\titem.next = this._head;\n\t\t\tthis._head.previous = item;\n\t\t\tthis._head = item;\n\t\t\tthis._state++;\n\t\t} else if (touch === Touch.AsNew) {\n\t\t\tif (item === this._tail) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\n\t\t\t// Unlink the item.\n\t\t\tif (item === this._head) {\n\t\t\t\t// next must be defined since item was not tail but is head\n\t\t\t\t// So there are more than on item in the map\n\t\t\t\tnext!.previous = undefined;\n\t\t\t\tthis._head = next;\n\t\t\t} else {\n\t\t\t\t// Both next and previous are not undefined since item was neither head nor tail.\n\t\t\t\tnext!.previous = previous;\n\t\t\t\tprevious!.next = next;\n\t\t\t}\n\t\t\titem.next = undefined;\n\t\t\titem.previous = this._tail;\n\t\t\tthis._tail.next = item;\n\t\t\tthis._tail = item;\n\t\t\tthis._state++;\n\t\t}\n\t}\n\n\ttoJSON(): [K, V][] {\n\t\tconst data: [K, V][] = [];\n\n\t\tthis.forEach((value, key) => {\n\t\t\tdata.push([key, value]);\n\t\t});\n\n\t\treturn data;\n\t}\n\n\tfromJSON(data: [K, V][]): void {\n\t\tthis.clear();\n\n\t\tfor (const [key, value] of data) {\n\t\t\tthis.set(key, value);\n\t\t}\n\t}\n}\n\nexport class LRUCache<K, V> extends LinkedMap<K, V> {\n\n\tprivate _limit: number;\n\tprivate _ratio: number;\n\n\tconstructor(limit: number, ratio: number = 1) {\n\t\tsuper();\n\t\tthis._limit = limit;\n\t\tthis._ratio = Math.min(Math.max(0, ratio), 1);\n\t}\n\n\tget limit(): number {\n\t\treturn this._limit;\n\t}\n\n\tset limit(limit: number) {\n\t\tthis._limit = limit;\n\t\tthis.checkTrim();\n\t}\n\n\toverride get(key: K, touch: Touch = Touch.AsNew): V | undefined {\n\t\treturn super.get(key, touch);\n\t}\n\n\tpeek(key: K): V | undefined {\n\t\treturn super.get(key, Touch.None);\n\t}\n\n\toverride set(key: K, value: V): this {\n\t\tsuper.set(key, value, Touch.AsNew);\n\t\tthis.checkTrim();\n\t\treturn this;\n\t}\n\n\tprivate checkTrim() {\n\t\tif (this.size > this._limit) {\n\t\t\tthis.trimOld(Math.round(this._limit * this._ratio));\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { LRUCache } from 'vs/base/common/map';\nimport * as strings from 'vs/base/common/strings';\n\nexport interface IFilter {\n\t// Returns null if word doesn't match.\n\t(word: string, wordToMatchAgainst: string): IMatch[] | null;\n}\n\nexport interface IMatch {\n\tstart: number;\n\tend: number;\n}\n\n// Combined filters\n\n/**\n * @returns A filter which combines the provided set\n * of filters with an or. The *first* filters that\n * matches defined the return value of the returned\n * filter.\n */\nexport function or(...filter: IFilter[]): IFilter {\n\treturn function (word: string, wordToMatchAgainst: string): IMatch[] | null {\n\t\tfor (let i = 0, len = filter.length; i < len; i++) {\n\t\t\tconst match = filter[i](word, wordToMatchAgainst);\n\t\t\tif (match) {\n\t\t\t\treturn match;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n}\n\n// Prefix\n\nexport const matchesStrictPrefix: IFilter = _matchesPrefix.bind(undefined, false);\nexport const matchesPrefix: IFilter = _matchesPrefix.bind(undefined, true);\n\nfunction _matchesPrefix(ignoreCase: boolean, word: string, wordToMatchAgainst: string): IMatch[] | null {\n\tif (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) {\n\t\treturn null;\n\t}\n\n\tlet matches: boolean;\n\tif (ignoreCase) {\n\t\tmatches = strings.startsWithIgnoreCase(wordToMatchAgainst, word);\n\t} else {\n\t\tmatches = wordToMatchAgainst.indexOf(word) === 0;\n\t}\n\n\tif (!matches) {\n\t\treturn null;\n\t}\n\n\treturn word.length > 0 ? [{ start: 0, end: word.length }] : [];\n}\n\n// Contiguous Substring\n\nexport function matchesContiguousSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n\tconst index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase());\n\tif (index === -1) {\n\t\treturn null;\n\t}\n\n\treturn [{ start: index, end: index + word.length }];\n}\n\n// Substring\n\nexport function matchesSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n\treturn _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0);\n}\n\nfunction _matchesSubString(word: string, wordToMatchAgainst: string, i: number, j: number): IMatch[] | null {\n\tif (i === word.length) {\n\t\treturn [];\n\t} else if (j === wordToMatchAgainst.length) {\n\t\treturn null;\n\t} else {\n\t\tif (word[i] === wordToMatchAgainst[j]) {\n\t\t\tlet result: IMatch[] | null = null;\n\t\t\tif (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) {\n\t\t\t\treturn join({ start: j, end: j + 1 }, result);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\treturn _matchesSubString(word, wordToMatchAgainst, i, j + 1);\n\t}\n}\n\n// CamelCase\n\nfunction isLower(code: number): boolean {\n\treturn CharCode.a <= code && code <= CharCode.z;\n}\n\nexport function isUpper(code: number): boolean {\n\treturn CharCode.A <= code && code <= CharCode.Z;\n}\n\nfunction isNumber(code: number): boolean {\n\treturn CharCode.Digit0 <= code && code <= CharCode.Digit9;\n}\n\nfunction isWhitespace(code: number): boolean {\n\treturn (\n\t\tcode === CharCode.Space\n\t\t|| code === CharCode.Tab\n\t\t|| code === CharCode.LineFeed\n\t\t|| code === CharCode.CarriageReturn\n\t);\n}\n\nconst wordSeparators = new Set<number>();\n// These are chosen as natural word separators based on writen text.\n// It is a subset of the word separators used by the monaco editor.\n'()[]{}<>`\\'\"-/;:,.?!'\n\t.split('')\n\t.forEach(s => wordSeparators.add(s.charCodeAt(0)));\n\nfunction isWordSeparator(code: number): boolean {\n\treturn isWhitespace(code) || wordSeparators.has(code);\n}\n\nfunction charactersMatch(codeA: number, codeB: number): boolean {\n\treturn (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB));\n}\n\nfunction isAlphanumeric(code: number): boolean {\n\treturn isLower(code) || isUpper(code) || isNumber(code);\n}\n\nfunction join(head: IMatch, tail: IMatch[]): IMatch[] {\n\tif (tail.length === 0) {\n\t\ttail = [head];\n\t} else if (head.end === tail[0].start) {\n\t\ttail[0].start = head.start;\n\t} else {\n\t\ttail.unshift(head);\n\t}\n\treturn tail;\n}\n\nfunction nextAnchor(camelCaseWord: string, start: number): number {\n\tfor (let i = start; i < camelCaseWord.length; i++) {\n\t\tconst c = camelCaseWord.charCodeAt(i);\n\t\tif (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn camelCaseWord.length;\n}\n\nfunction _matchesCamelCase(word: string, camelCaseWord: string, i: number, j: number): IMatch[] | null {\n\tif (i === word.length) {\n\t\treturn [];\n\t} else if (j === camelCaseWord.length) {\n\t\treturn null;\n\t} else if (word[i] !== camelCaseWord[j].toLowerCase()) {\n\t\treturn null;\n\t} else {\n\t\tlet result: IMatch[] | null = null;\n\t\tlet nextUpperIndex = j + 1;\n\t\tresult = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1);\n\t\twhile (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) {\n\t\t\tresult = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex);\n\t\t\tnextUpperIndex++;\n\t\t}\n\t\treturn result === null ? null : join({ start: j, end: j + 1 }, result);\n\t}\n}\n\ninterface ICamelCaseAnalysis {\n\tupperPercent: number;\n\tlowerPercent: number;\n\talphaPercent: number;\n\tnumericPercent: number;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camelCaseWords.\nfunction analyzeCamelCaseWord(word: string): ICamelCaseAnalysis {\n\tlet upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0;\n\n\tfor (let i = 0; i < word.length; i++) {\n\t\tcode = word.charCodeAt(i);\n\n\t\tif (isUpper(code)) { upper++; }\n\t\tif (isLower(code)) { lower++; }\n\t\tif (isAlphanumeric(code)) { alpha++; }\n\t\tif (isNumber(code)) { numeric++; }\n\t}\n\n\tconst upperPercent = upper / word.length;\n\tconst lowerPercent = lower / word.length;\n\tconst alphaPercent = alpha / word.length;\n\tconst numericPercent = numeric / word.length;\n\n\treturn { upperPercent, lowerPercent, alphaPercent, numericPercent };\n}\n\nfunction isUpperCaseWord(analysis: ICamelCaseAnalysis): boolean {\n\tconst { upperPercent, lowerPercent } = analysis;\n\treturn lowerPercent === 0 && upperPercent > 0.6;\n}\n\nfunction isCamelCaseWord(analysis: ICamelCaseAnalysis): boolean {\n\tconst { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis;\n\treturn lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camel case patterns.\nfunction isCamelCasePattern(word: string): boolean {\n\tlet upper = 0, lower = 0, code = 0, whitespace = 0;\n\n\tfor (let i = 0; i < word.length; i++) {\n\t\tcode = word.charCodeAt(i);\n\n\t\tif (isUpper(code)) { upper++; }\n\t\tif (isLower(code)) { lower++; }\n\t\tif (isWhitespace(code)) { whitespace++; }\n\t}\n\n\tif ((upper === 0 || lower === 0) && whitespace === 0) {\n\t\treturn word.length <= 30;\n\t} else {\n\t\treturn upper <= 5;\n\t}\n}\n\nexport function matchesCamelCase(word: string, camelCaseWord: string): IMatch[] | null {\n\tif (!camelCaseWord) {\n\t\treturn null;\n\t}\n\n\tcamelCaseWord = camelCaseWord.trim();\n\n\tif (camelCaseWord.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (!isCamelCasePattern(word)) {\n\t\treturn null;\n\t}\n\n\tif (camelCaseWord.length > 60) {\n\t\treturn null;\n\t}\n\n\tconst analysis = analyzeCamelCaseWord(camelCaseWord);\n\n\tif (!isCamelCaseWord(analysis)) {\n\t\tif (!isUpperCaseWord(analysis)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tcamelCaseWord = camelCaseWord.toLowerCase();\n\t}\n\n\tlet result: IMatch[] | null = null;\n\tlet i = 0;\n\n\tword = word.toLowerCase();\n\twhile (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) {\n\t\ti = nextAnchor(camelCaseWord, i + 1);\n\t}\n\n\treturn result;\n}\n\n// Matches beginning of words supporting non-ASCII languages\n// If `contiguous` is true then matches word with beginnings of the words in the target. E.g. \"pul\" will match \"Git: Pull\"\n// Otherwise also matches sub string of the word with beginnings of the words in the target. E.g. \"gp\" or \"g p\" will match \"Git: Pull\"\n// Useful in cases where the target is words (e.g. command labels)\n\nexport function matchesWords(word: string, target: string, contiguous: boolean = false): IMatch[] | null {\n\tif (!target || target.length === 0) {\n\t\treturn null;\n\t}\n\n\tlet result: IMatch[] | null = null;\n\tlet i = 0;\n\n\tword = word.toLowerCase();\n\ttarget = target.toLowerCase();\n\twhile (i < target.length && (result = _matchesWords(word, target, 0, i, contiguous)) === null) {\n\t\ti = nextWord(target, i + 1);\n\t}\n\n\treturn result;\n}\n\nfunction _matchesWords(word: string, target: string, i: number, j: number, contiguous: boolean): IMatch[] | null {\n\tif (i === word.length) {\n\t\treturn [];\n\t} else if (j === target.length) {\n\t\treturn null;\n\t} else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {\n\t\treturn null;\n\t} else {\n\t\tlet result: IMatch[] | null = null;\n\t\tlet nextWordIndex = j + 1;\n\t\tresult = _matchesWords(word, target, i + 1, j + 1, contiguous);\n\t\tif (!contiguous) {\n\t\t\twhile (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {\n\t\t\t\tresult = _matchesWords(word, target, i + 1, nextWordIndex, contiguous);\n\t\t\t\tnextWordIndex++;\n\t\t\t}\n\t\t}\n\t\treturn result === null ? null : join({ start: j, end: j + 1 }, result);\n\t}\n}\n\nfunction nextWord(word: string, start: number): number {\n\tfor (let i = start; i < word.length; i++) {\n\t\tif (isWordSeparator(word.charCodeAt(i)) ||\n\t\t\t(i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn word.length;\n}\n\n// Fuzzy\n\nconst fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString);\nconst fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString);\nconst fuzzyRegExpCache = new LRUCache<string, RegExp>(10000); // bounded to 10000 elements\n\nexport function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSeparateSubstringMatching = false): IMatch[] | null {\n\tif (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') {\n\t\treturn null; // return early for invalid input\n\t}\n\n\t// Form RegExp for wildcard matches\n\tlet regexp = fuzzyRegExpCache.get(word);\n\tif (!regexp) {\n\t\tregexp = new RegExp(strings.convertSimple2RegExpPattern(word), 'i');\n\t\tfuzzyRegExpCache.set(word, regexp);\n\t}\n\n\t// RegExp Filter\n\tconst match = regexp.exec(wordToMatchAgainst);\n\tif (match) {\n\t\treturn [{ start: match.index, end: match.index + match[0].length }];\n\t}\n\n\t// Default Filter\n\treturn enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n}\n\nexport function anyScore(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number): FuzzyScore {\n\tconst max = Math.min(13, pattern.length);\n\tfor (; patternPos < max; patternPos++) {\n\t\tconst result = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, false);\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn [0, wordPos];\n}\n\n//#region --- fuzzyScore ---\n\nexport function createMatches(score: undefined | FuzzyScore): IMatch[] {\n\tif (typeof score === 'undefined') {\n\t\treturn [];\n\t}\n\tconst res: IMatch[] = [];\n\tconst wordPos = score[1];\n\tfor (let i = score.length - 1; i > 1; i--) {\n\t\tconst pos = score[i] + wordPos;\n\t\tconst last = res[res.length - 1];\n\t\tif (last && last.end === pos) {\n\t\t\tlast.end = pos + 1;\n\t\t} else {\n\t\t\tres.push({ start: pos, end: pos + 1 });\n\t\t}\n\t}\n\treturn res;\n}\n\nconst _maxLen = 128;\n\nfunction initTable() {\n\tconst table: number[][] = [];\n\tconst row: number[] = [];\n\tfor (let i = 0; i <= _maxLen; i++) {\n\t\trow[i] = 0;\n\t}\n\tfor (let i = 0; i <= _maxLen; i++) {\n\t\ttable.push(row.slice(0));\n\t}\n\treturn table;\n}\n\nfunction initArr(maxLen: number) {\n\tconst row: number[] = [];\n\tfor (let i = 0; i <= maxLen; i++) {\n\t\trow[i] = 0;\n\t}\n\treturn row;\n}\n\nconst _minWordMatchPos = initArr(2 * _maxLen); // min word position for a certain pattern position\nconst _maxWordMatchPos = initArr(2 * _maxLen); // max word position for a certain pattern position\nconst _diag = initTable(); // the length of a contiguous diagonal match\nconst _table = initTable();\nconst _arrows = <Arrow[][]>initTable();\nconst _debug = false;\n\nfunction printTable(table: number[][], pattern: string, patternLen: number, word: string, wordLen: number): string {\n\tfunction pad(s: string, n: number, pad = ' ') {\n\t\twhile (s.length < n) {\n\t\t\ts = pad + s;\n\t\t}\n\t\treturn s;\n\t}\n\tlet ret = ` | |${word.split('').map(c => pad(c, 3)).join('|')}\\n`;\n\n\tfor (let i = 0; i <= patternLen; i++) {\n\t\tif (i === 0) {\n\t\t\tret += ' |';\n\t\t} else {\n\t\t\tret += `${pattern[i - 1]}|`;\n\t\t}\n\t\tret += table[i].slice(0, wordLen + 1).map(n => pad(n.toString(), 3)).join('|') + '\\n';\n\t}\n\treturn ret;\n}\n\nfunction printTables(pattern: string, patternStart: number, word: string, wordStart: number): void {\n\tpattern = pattern.substr(patternStart);\n\tword = word.substr(wordStart);\n\tconsole.log(printTable(_table, pattern, pattern.length, word, word.length));\n\tconsole.log(printTable(_arrows, pattern, pattern.length, word, word.length));\n\tconsole.log(printTable(_diag, pattern, pattern.length, word, word.length));\n}\n\nfunction isSeparatorAtPos(value: string, index: number): boolean {\n\tif (index < 0 || index >= value.length) {\n\t\treturn false;\n\t}\n\tconst code = value.codePointAt(index);\n\tswitch (code) {\n\t\tcase CharCode.Underline:\n\t\tcase CharCode.Dash:\n\t\tcase CharCode.Period:\n\t\tcase CharCode.Space:\n\t\tcase CharCode.Slash:\n\t\tcase CharCode.Backslash:\n\t\tcase CharCode.SingleQuote:\n\t\tcase CharCode.DoubleQuote:\n\t\tcase CharCode.Colon:\n\t\tcase CharCode.DollarSign:\n\t\tcase CharCode.LessThan:\n\t\tcase CharCode.OpenParen:\n\t\tcase CharCode.OpenSquareBracket:\n\t\t\treturn true;\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tif (strings.isEmojiImprecise(code)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t}\n}\n\nfunction isWhitespaceAtPos(value: string, index: number): boolean {\n\tif (index < 0 || index >= value.length) {\n\t\treturn false;\n\t}\n\tconst code = value.charCodeAt(index);\n\tswitch (code) {\n\t\tcase CharCode.Space:\n\t\tcase CharCode.Tab:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction isUpperCaseAtPos(pos: number, word: string, wordLow: string): boolean {\n\treturn word[pos] !== wordLow[pos];\n}\n\nexport function isPatternInWord(patternLow: string, patternPos: number, patternLen: number, wordLow: string, wordPos: number, wordLen: number, fillMinWordPosArr = false): boolean {\n\twhile (patternPos < patternLen && wordPos < wordLen) {\n\t\tif (patternLow[patternPos] === wordLow[wordPos]) {\n\t\t\tif (fillMinWordPosArr) {\n\t\t\t\t// Remember the min word position for each pattern position\n\t\t\t\t_minWordMatchPos[patternPos] = wordPos;\n\t\t\t}\n\t\t\tpatternPos += 1;\n\t\t}\n\t\twordPos += 1;\n\t}\n\treturn patternPos === patternLen; // pattern must be exhausted\n}\n\nconst enum Arrow { Diag = 1, Left = 2, LeftLeft = 3 }\n\n/**\n * An array representing a fuzzy match.\n *\n * 0. the score\n * 1. the offset at which matching started\n * 2. `<match_pos_N>`\n * 3. `<match_pos_1>`\n * 4. `<match_pos_0>` etc\n */\nexport type FuzzyScore = [score: number, wordStart: number, ...matches: number[]];\n\nexport namespace FuzzyScore {\n\t/**\n\t * No matches and value `-100`\n\t */\n\texport const Default: FuzzyScore = ([-100, 0]);\n\n\texport function isDefault(score?: FuzzyScore): score is [-100, 0] {\n\t\treturn !score || (score.length === 2 && score[0] === -100 && score[1] === 0);\n\t}\n}\n\nexport interface FuzzyScorer {\n\t(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined;\n}\n\nexport function fuzzyScore(pattern: string, patternLow: string, patternStart: number, word: string, wordLow: string, wordStart: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n\n\tconst patternLen = pattern.length > _maxLen ? _maxLen : pattern.length;\n\tconst wordLen = word.length > _maxLen ? _maxLen : word.length;\n\n\tif (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) {\n\t\treturn undefined;\n\t}\n\n\t// Run a simple check if the characters of pattern occur\n\t// (in order) at all in word. If that isn't the case we\n\t// stop because no match will be possible\n\tif (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen, true)) {\n\t\treturn undefined;\n\t}\n\n\t// Find the max matching word position for each pattern position\n\t// NOTE: the min matching word position was filled in above, in the `isPatternInWord` call\n\t_fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow);\n\n\tlet row: number = 1;\n\tlet column: number = 1;\n\tlet patternPos = patternStart;\n\tlet wordPos = wordStart;\n\n\tconst hasStrongFirstMatch = [false];\n\n\t// There will be a match, fill in tables\n\tfor (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) {\n\n\t\t// Reduce search space to possible matching word positions and to possible access from next row\n\t\tconst minWordMatchPos = _minWordMatchPos[patternPos];\n\t\tconst maxWordMatchPos = _maxWordMatchPos[patternPos];\n\t\tconst nextMaxWordMatchPos = (patternPos + 1 < patternLen ? _maxWordMatchPos[patternPos + 1] : wordLen);\n\n\t\tfor (column = minWordMatchPos - wordStart + 1, wordPos = minWordMatchPos; wordPos < nextMaxWordMatchPos; column++, wordPos++) {\n\n\t\t\tlet score = Number.MIN_SAFE_INTEGER;\n\t\t\tlet canComeDiag = false;\n\n\t\t\tif (wordPos <= maxWordMatchPos) {\n\t\t\t\tscore = _doScore(\n\t\t\t\t\tpattern, patternLow, patternPos, patternStart,\n\t\t\t\t\tword, wordLow, wordPos, wordLen, wordStart,\n\t\t\t\t\t_diag[row - 1][column - 1] === 0,\n\t\t\t\t\thasStrongFirstMatch\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet diagScore = 0;\n\t\t\tif (score !== Number.MAX_SAFE_INTEGER) {\n\t\t\t\tcanComeDiag = true;\n\t\t\t\tdiagScore = score + _table[row - 1][column - 1];\n\t\t\t}\n\n\t\t\tconst canComeLeft = wordPos > minWordMatchPos;\n\t\t\tconst leftScore = canComeLeft ? _table[row][column - 1] + (_diag[row][column - 1] > 0 ? -5 : 0) : 0; // penalty for a gap start\n\n\t\t\tconst canComeLeftLeft = wordPos > minWordMatchPos + 1 && _diag[row][column - 1] > 0;\n\t\t\tconst leftLeftScore = canComeLeftLeft ? _table[row][column - 2] + (_diag[row][column - 2] > 0 ? -5 : 0) : 0; // penalty for a gap start\n\n\t\t\tif (canComeLeftLeft && (!canComeLeft || leftLeftScore >= leftScore) && (!canComeDiag || leftLeftScore >= diagScore)) {\n\t\t\t\t// always prefer choosing left left to jump over a diagonal because that means a match is earlier in the word\n\t\t\t\t_table[row][column] = leftLeftScore;\n\t\t\t\t_arrows[row][column] = Arrow.LeftLeft;\n\t\t\t\t_diag[row][column] = 0;\n\t\t\t} else if (canComeLeft && (!canComeDiag || leftScore >= diagScore)) {\n\t\t\t\t// always prefer choosing left since that means a match is earlier in the word\n\t\t\t\t_table[row][column] = leftScore;\n\t\t\t\t_arrows[row][column] = Arrow.Left;\n\t\t\t\t_diag[row][column] = 0;\n\t\t\t} else if (canComeDiag) {\n\t\t\t\t_table[row][column] = diagScore;\n\t\t\t\t_arrows[row][column] = Arrow.Diag;\n\t\t\t\t_diag[row][column] = _diag[row - 1][column - 1] + 1;\n\t\t\t} else {\n\t\t\t\tthrow new Error(`not possible`);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (_debug) {\n\t\tprintTables(pattern, patternStart, word, wordStart);\n\t}\n\n\tif (!hasStrongFirstMatch[0] && !firstMatchCanBeWeak) {\n\t\treturn undefined;\n\t}\n\n\trow--;\n\tcolumn--;\n\n\tconst result: FuzzyScore = [_table[row][column], wordStart];\n\n\tlet backwardsDiagLength = 0;\n\tlet maxMatchColumn = 0;\n\n\twhile (row >= 1) {\n\t\t// Find the column where we go diagonally up\n\t\tlet diagColumn = column;\n\t\tdo {\n\t\t\tconst arrow = _arrows[row][diagColumn];\n\t\t\tif (arrow === Arrow.LeftLeft) {\n\t\t\t\tdiagColumn = diagColumn - 2;\n\t\t\t} else if (arrow === Arrow.Left) {\n\t\t\t\tdiagColumn = diagColumn - 1;\n\t\t\t} else {\n\t\t\t\t// found the diagonal\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (diagColumn >= 1);\n\n\t\t// Overturn the \"forwards\" decision if keeping the \"backwards\" diagonal would give a better match\n\t\tif (\n\t\t\tbackwardsDiagLength > 1 // only if we would have a contiguous match of 3 characters\n\t\t\t&& patternLow[patternStart + row - 1] === wordLow[wordStart + column - 1] // only if we can do a contiguous match diagonally\n\t\t\t&& !isUpperCaseAtPos(diagColumn + wordStart - 1, word, wordLow) // only if the forwards chose diagonal is not an uppercase\n\t\t\t&& backwardsDiagLength + 1 > _diag[row][diagColumn] // only if our contiguous match would be longer than the \"forwards\" contiguous match\n\t\t) {\n\t\t\tdiagColumn = column;\n\t\t}\n\n\t\tif (diagColumn === column) {\n\t\t\t// this is a contiguous match\n\t\t\tbackwardsDiagLength++;\n\t\t} else {\n\t\t\tbackwardsDiagLength = 1;\n\t\t}\n\n\t\tif (!maxMatchColumn) {\n\t\t\t// remember the last matched column\n\t\t\tmaxMatchColumn = diagColumn;\n\t\t}\n\n\t\trow--;\n\t\tcolumn = diagColumn - 1;\n\t\tresult.push(column);\n\t}\n\n\tif (wordLen === patternLen) {\n\t\t// the word matches the pattern with all characters!\n\t\t// giving the score a total match boost (to come up ahead other words)\n\t\tresult[0] += 2;\n\t}\n\n\t// Add 1 penalty for each skipped character in the word\n\tconst skippedCharsCount = maxMatchColumn - patternLen;\n\tresult[0] -= skippedCharsCount;\n\n\treturn result;\n}\n\nfunction _fillInMaxWordMatchPos(patternLen: number, wordLen: number, patternStart: number, wordStart: number, patternLow: string, wordLow: string) {\n\tlet patternPos = patternLen - 1;\n\tlet wordPos = wordLen - 1;\n\twhile (patternPos >= patternStart && wordPos >= wordStart) {\n\t\tif (patternLow[patternPos] === wordLow[wordPos]) {\n\t\t\t_maxWordMatchPos[patternPos] = wordPos;\n\t\t\tpatternPos--;\n\t\t}\n\t\twordPos--;\n\t}\n}\n\nfunction _doScore(\n\tpattern: string, patternLow: string, patternPos: number, patternStart: number,\n\tword: string, wordLow: string, wordPos: number, wordLen: number, wordStart: number,\n\tnewMatchStart: boolean,\n\toutFirstMatchStrong: boolean[],\n): number {\n\tif (patternLow[patternPos] !== wordLow[wordPos]) {\n\t\treturn Number.MIN_SAFE_INTEGER;\n\t}\n\n\tlet score = 1;\n\tlet isGapLocation = false;\n\tif (wordPos === (patternPos - patternStart)) {\n\t\t// common prefix: `foobar <-> foobaz`\n\t\t// ^^^^^\n\t\tscore = pattern[patternPos] === word[wordPos] ? 7 : 5;\n\n\t} else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) {\n\t\t// hitting upper-case: `foo <-> forOthers`\n\t\t// ^^ ^\n\t\tscore = pattern[patternPos] === word[wordPos] ? 7 : 5;\n\t\tisGapLocation = true;\n\n\t} else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) {\n\t\t// hitting a separator: `. <-> foo.bar`\n\t\t// ^\n\t\tscore = 5;\n\n\t} else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) {\n\t\t// post separator: `foo <-> bar_foo`\n\t\t// ^^^\n\t\tscore = 5;\n\t\tisGapLocation = true;\n\t}\n\n\tif (score > 1 && patternPos === patternStart) {\n\t\toutFirstMatchStrong[0] = true;\n\t}\n\n\tif (!isGapLocation) {\n\t\tisGapLocation = isUpperCaseAtPos(wordPos, word, wordLow) || isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1);\n\t}\n\n\t//\n\tif (patternPos === patternStart) { // first character in pattern\n\t\tif (wordPos > wordStart) {\n\t\t\t// the first pattern character would match a word character that is not at the word start\n\t\t\t// so introduce a penalty to account for the gap preceding this match\n\t\t\tscore -= isGapLocation ? 3 : 5;\n\t\t}\n\t} else {\n\t\tif (newMatchStart) {\n\t\t\t// this would be the beginning of a new match (i.e. there would be a gap before this location)\n\t\t\tscore += isGapLocation ? 2 : 0;\n\t\t} else {\n\t\t\t// this is part of a contiguous match, so give it a slight bonus, but do so only if it would not be a preferred gap location\n\t\t\tscore += isGapLocation ? 0 : 1;\n\t\t}\n\t}\n\n\tif (wordPos + 1 === wordLen) {\n\t\t// we always penalize gaps, but this gives unfair advantages to a match that would match the last character in the word\n\t\t// so pretend there is a gap after the last character in the word to normalize things\n\t\tscore -= isGapLocation ? 3 : 5;\n\t}\n\n\treturn score;\n}\n\n//#endregion\n\n\n//#region --- graceful ---\n\nexport function fuzzyScoreGracefulAggressive(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n\treturn fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, firstMatchCanBeWeak);\n}\n\nfunction fuzzyScoreWithPermutations(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, aggressive: boolean, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n\tlet top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n\n\tif (top && !aggressive) {\n\t\t// when using the original pattern yield a result we`\n\t\t// return it unless we are aggressive and try to find\n\t\t// a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`.\n\t\treturn top;\n\t}\n\n\tif (pattern.length >= 3) {\n\t\t// When the pattern is long enough then try a few (max 7)\n\t\t// permutations of the pattern to find a better match. The\n\t\t// permutations only swap neighbouring characters, e.g\n\t\t// `cnoso` becomes `conso`, `cnsoo`, `cnoos`.\n\t\tconst tries = Math.min(7, pattern.length - 1);\n\t\tfor (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) {\n\t\t\tconst newPattern = nextTypoPermutation(pattern, movingPatternPos);\n\t\t\tif (newPattern) {\n\t\t\t\tconst candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n\t\t\t\tif (candidate) {\n\t\t\t\t\tcandidate[0] -= 3; // permutation penalty\n\t\t\t\t\tif (!top || candidate[0] > top[0]) {\n\t\t\t\t\t\ttop = candidate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn top;\n}\n\nfunction nextTypoPermutation(pattern: string, patternPos: number): string | undefined {\n\n\tif (patternPos + 1 >= pattern.length) {\n\t\treturn undefined;\n\t}\n\n\tconst swap1 = pattern[patternPos];\n\tconst swap2 = pattern[patternPos + 1];\n\n\tif (swap1 === swap2) {\n\t\treturn undefined;\n\t}\n\n\treturn pattern.slice(0, patternPos)\n\t\t+ swap2\n\t\t+ swap1\n\t\t+ pattern.slice(patternPos + 2);\n}\n\n//#endregion\n","\nimport { createMatches as createFuzzyMatches, fuzzyScore, IMatch } from 'vs/base/common/filters';\nimport { sep } from 'vs/base/common/path';\nimport { isWindows } from 'vs/base/common/platform';\nimport { stripWildcards } from 'vs/base/common/strings';\n\n// function printMatrix(query: string, target: string, matches: number[], scores: number[]): void {\n// \tconsole.log('\\t' + target.split('').join('\\t'));\n// \tfor (let queryIndex = 0; queryIndex < query.length; queryIndex++) {\n// \t\tlet line = query[queryIndex] + '\\t';\n// \t\tfor (let targetIndex = 0; targetIndex < target.length; targetIndex++) {\n// \t\t\tconst currentIndex = queryIndex * target.length + targetIndex;\n// \t\t\tline = line + 'M' + matches[currentIndex] + '/' + 'S' + scores[currentIndex] + '\\t';\n// \t\t}\n\n// \t\tconsole.log(line);\n// \t}\n// }\n\n//#endregion\n\n\n//#region Alternate fuzzy scorer implementation that is e.g. used for symbols\n\nexport type FuzzyScore2 = [number | undefined /* score */, IMatch[]];\n\nconst NO_SCORE2: FuzzyScore2 = [undefined, []];\n\nexport function scoreFuzzy2(target: string, query: IPreparedQuery | IPreparedQueryPiece, patternStart = 0, wordStart = 0): FuzzyScore2 {\n\n\t// Score: multiple inputs\n\tconst preparedQuery = query as IPreparedQuery;\n\tif (preparedQuery.values && preparedQuery.values.length > 1) {\n\t\treturn doScoreFuzzy2Multiple(target, preparedQuery.values, patternStart, wordStart);\n\t}\n\n\t// Score: single input\n\treturn doScoreFuzzy2Single(target, query, patternStart, wordStart);\n}\n\nfunction doScoreFuzzy2Multiple(target: string, query: IPreparedQueryPiece[], patternStart: number, wordStart: number): FuzzyScore2 {\n\tlet totalScore = 0;\n\tconst totalMatches: IMatch[] = [];\n\n\tfor (const queryPiece of query) {\n\t\tconst [score, matches] = doScoreFuzzy2Single(target, queryPiece, patternStart, wordStart);\n\t\tif (typeof score !== 'number') {\n\t\t\t// if a single query value does not match, return with\n\t\t\t// no score entirely, we require all queries to match\n\t\t\treturn NO_SCORE2;\n\t\t}\n\n\t\ttotalScore += score;\n\t\ttotalMatches.push(...matches);\n\t}\n\n\t// if we have a score, ensure that the positions are\n\t// sorted in ascending order and distinct\n\treturn [totalScore, normalizeMatches(totalMatches)];\n}\n\nfunction doScoreFuzzy2Single(target: string, query: IPreparedQueryPiece, patternStart: number, wordStart: number): FuzzyScore2 {\n\tconst score = fuzzyScore(query.original, query.originalLowercase, patternStart, target, target.toLowerCase(), wordStart, true);\n\tif (!score) {\n\t\treturn NO_SCORE2;\n\t}\n\n\treturn [score[0], createFuzzyMatches(score)];\n}\n\n//#endregion\n\n\n//#region Item (label, description, path) scorer\n\n/**\n * Scoring on structural items that have a label and optional description.\n */\nexport interface IItemScore {\n}\n\nconst NO_ITEM_SCORE: IItemScore = Object.freeze({ score: 0 });\n\nexport interface IItemAccessor<T> {\n}\n\nfunction normalizeMatches(matches: IMatch[]): IMatch[] {\n\n\t// sort matches by start to be able to normalize\n\tconst sortedMatches = matches.sort((matchA, matchB) => {\n\t\treturn matchA.start - matchB.start;\n\t});\n\n\t// merge matches that overlap\n\tconst normalizedMatches: IMatch[] = [];\n\tlet currentMatch: IMatch | undefined = undefined;\n\tfor (const match of sortedMatches) {\n\n\t\t// if we have no current match or the matches\n\t\t// do not overlap, we take it as is and remember\n\t\t// it for future merging\n\t\tif (!currentMatch || !matchOverlaps(currentMatch, match)) {\n\t\t\tcurrentMatch = match;\n\t\t\tnormalizedMatches.push(match);\n\t\t}\n\n\t\t// otherwise we merge the matches\n\t\telse {\n\t\t\tcurrentMatch.start = Math.min(currentMatch.start, match.start);\n\t\t\tcurrentMatch.end = Math.max(currentMatch.end, match.end);\n\t\t}\n\t}\n\n\treturn normalizedMatches;\n}\n\nfunction matchOverlaps(matchA: IMatch, matchB: IMatch): boolean {\n\tif (matchA.end < matchB.start) {\n\t\treturn false;\t// A ends before B starts\n\t}\n\n\tif (matchB.end < matchA.start) {\n\t\treturn false; // B ends before A starts\n\t}\n\n\treturn true;\n}\n\n//#endregion\n\n\n//#region Query Normalizer\n\nexport interface IPreparedQueryPiece {\n\n\t/**\n\t * The original query as provided as input.\n\t */\n\toriginal: string;\n\toriginalLowercase: string;\n\n\t/**\n\t * Original normalized to platform separators:\n\t * - Windows: \\\n\t * - Posix: /\n\t */\n\tpathNormalized: string;\n\n\t/**\n\t * In addition to the normalized path, will have\n\t * whitespace and wildcards removed.\n\t */\n\tnormalized: string;\n\tnormalizedLowercase: string;\n\n\t/**\n\t * The query is wrapped in quotes which means\n\t * this query must be a substring of the input.\n\t * In other words, no fuzzy matching is used.\n\t */\n\texpectContiguousMatch: boolean;\n}\n\nexport interface IPreparedQuery extends IPreparedQueryPiece {\n\n\t/**\n\t * Query split by spaces into pieces.\n\t */\n\tvalues: IPreparedQueryPiece[] | undefined;\n\n\t/**\n\t * Whether the query contains path separator(s) or not.\n\t */\n\tcontainsPathSeparator: boolean;\n}\n\n/*\n * If a query is wrapped in quotes, the user does not want to\n * use fuzzy search for this query.\n */\nfunction queryExpectsExactMatch(query: string) {\n\treturn query.startsWith('\"') && query.endsWith('\"');\n}\n\n/**\n * Helper function to prepare a search value for scoring by removing unwanted characters\n * and allowing to score on multiple pieces separated by whitespace character.\n */\nconst MULTIPLE_QUERY_VALUES_SEPARATOR = ' ';\nexport function prepareQuery(original: string): IPreparedQuery {\n\tif (typeof original !== 'string') {\n\t\toriginal = '';\n\t}\n\n\tconst originalLowercase = original.toLowerCase();\n\tconst { pathNormalized, normalized, normalizedLowercase } = normalizeQuery(original);\n\tconst containsPathSeparator = pathNormalized.indexOf(sep) >= 0;\n\tconst expectExactMatch = queryExpectsExactMatch(original);\n\n\tlet values: IPreparedQueryPiece[] | undefined = undefined;\n\n\tconst originalSplit = original.split(MULTIPLE_QUERY_VALUES_SEPARATOR);\n\tif (originalSplit.length > 1) {\n\t\tfor (const originalPiece of originalSplit) {\n\t\t\tconst expectExactMatchPiece = queryExpectsExactMatch(originalPiece);\n\t\t\tconst {\n\t\t\t\tpathNormalized: pathNormalizedPiece,\n\t\t\t\tnormalized: normalizedPiece,\n\t\t\t\tnormalizedLowercase: normalizedLowercasePiece\n\t\t\t} = normalizeQuery(originalPiece);\n\n\t\t\tif (normalizedPiece) {\n\t\t\t\tif (!values) {\n\t\t\t\t\tvalues = [];\n\t\t\t\t}\n\n\t\t\t\tvalues.push({\n\t\t\t\t\toriginal: originalPiece,\n\t\t\t\t\toriginalLowercase: originalPiece.toLowerCase(),\n\t\t\t\t\tpathNormalized: pathNormalizedPiece,\n\t\t\t\t\tnormalized: normalizedPiece,\n\t\t\t\t\tnormalizedLowercase: normalizedLowercasePiece,\n\t\t\t\t\texpectContiguousMatch: expectExactMatchPiece\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { original, originalLowercase, pathNormalized, normalized, normalizedLowercase, values, containsPathSeparator, expectContiguousMatch: expectExactMatch };\n}\n\nfunction normalizeQuery(original: string): { pathNormalized: string; normalized: string; normalizedLowercase: string } {\n\tlet pathNormalized: string;\n\tif (isWindows) {\n\t\tpathNormalized = original.replace(/\\//g, sep); // Help Windows users to search for paths when using slash\n\t} else {\n\t\tpathNormalized = original.replace(/\\\\/g, sep); // Help macOS/Linux users to search for paths when using backslash\n\t}\n\n\t// we remove quotes here because quotes are used for exact match search\n\tconst normalized = stripWildcards(pathNormalized).replace(/\\s|\"/g, '');\n\n\treturn {\n\t\tpathNormalized,\n\t\tnormalized,\n\t\tnormalizedLowercase: normalized.toLowerCase()\n\t};\n}\n\nexport function pieceToQuery(piece: IPreparedQueryPiece): IPreparedQuery;\nexport function pieceToQuery(pieces: IPreparedQueryPiece[]): IPreparedQuery;\nexport function pieceToQuery(arg1: IPreparedQueryPiece | IPreparedQueryPiece[]): IPreparedQuery {\n\tif (Array.isArray(arg1)) {\n\t\treturn prepareQuery(arg1.map(piece => piece.original).join(MULTIPLE_QUERY_VALUES_SEPARATOR));\n\t}\n\n\treturn prepareQuery(arg1.original);\n}\n\n//#endregion\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 { isThenable } from 'vs/base/common/async';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { isEqualOrParent } from 'vs/base/common/extpath';\nimport { LRUCache } from 'vs/base/common/map';\nimport { basename, extname, posix, sep } from 'vs/base/common/path';\nimport { isLinux } from 'vs/base/common/platform';\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\n\nexport interface IExpression {\n\t[pattern: string]: boolean | SiblingClause;\n}\n\nexport interface IRelativePattern {\n\n\t/**\n\t * A base file path to which this pattern will be matched against relatively.\n\t */\n\treadonly base: string;\n\n\t/**\n\t * A file glob pattern like `*.{ts,js}` that will be matched on file paths\n\t * relative to the base path.\n\t *\n\t * Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,\n\t * the file glob pattern will match on `index.js`.\n\t */\n\treadonly pattern: string;\n}\n\nexport interface SiblingClause {\n\twhen: string;\n}\n\nexport const GLOBSTAR = '**';\nexport const GLOB_SPLIT = '/';\n\nconst PATH_REGEX = '[/\\\\\\\\]';\t\t// any slash or backslash\nconst NO_PATH_REGEX = '[^/\\\\\\\\]';\t// any non-slash and non-backslash\nconst ALL_FORWARD_SLASHES = /\\//g;\n\nfunction starsToRegExp(starCount: number): string {\n\tswitch (starCount) {\n\t\tcase 0:\n\t\t\treturn '';\n\t\tcase 1:\n\t\t\treturn `${NO_PATH_REGEX}*?`; // 1 star matches any number of characters except path separator (/ and \\) - non greedy (?)\n\t\tdefault:\n\t\t\t// Matches: (Path Sep OR Path Val followed by Path Sep OR Path Sep followed by Path Val) 0-many times\n\t\t\t// Group is non capturing because we don't need to capture at all (?:...)\n\t\t\t// Overall we use non-greedy matching because it could be that we match too much\n\t\t\treturn `(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}|${PATH_REGEX}${NO_PATH_REGEX}+)*?`;\n\t}\n}\n\nexport function splitGlobAware(pattern: string, splitChar: string): string[] {\n\tif (!pattern) {\n\t\treturn [];\n\t}\n\n\tconst segments: string[] = [];\n\n\tlet inBraces = false;\n\tlet inBrackets = false;\n\n\tlet curVal = '';\n\tfor (const char of pattern) {\n\t\tswitch (char) {\n\t\t\tcase splitChar:\n\t\t\t\tif (!inBraces && !inBrackets) {\n\t\t\t\t\tsegments.push(curVal);\n\t\t\t\t\tcurVal = '';\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '{':\n\t\t\t\tinBraces = true;\n\t\t\t\tbreak;\n\t\t\tcase '}':\n\t\t\t\tinBraces = false;\n\t\t\t\tbreak;\n\t\t\tcase '[':\n\t\t\t\tinBrackets = true;\n\t\t\t\tbreak;\n\t\t\tcase ']':\n\t\t\t\tinBrackets = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tcurVal += char;\n\t}\n\n\t// Tail\n\tif (curVal) {\n\t\tsegments.push(curVal);\n\t}\n\n\treturn segments;\n}\n\nfunction parseRegExp(pattern: string): string {\n\tif (!pattern) {\n\t\treturn '';\n\t}\n\n\tlet regEx = '';\n\n\t// Split up into segments for each slash found\n\tconst segments = splitGlobAware(pattern, GLOB_SPLIT);\n\n\t// Special case where we only have globstars\n\tif (segments.every(s => s === GLOBSTAR)) {\n\t\tregEx = '.*';\n\t}\n\n\t// Build regex over segments\n\telse {\n\t\tlet previousSegmentWasGlobStar = false;\n\t\tsegments.forEach((segment, index) => {\n\n\t\t\t// Globstar is special\n\t\t\tif (segment === GLOBSTAR) {\n\n\t\t\t\t// if we have more than one globstar after another, just ignore it\n\t\t\t\tif (!previousSegmentWasGlobStar) {\n\t\t\t\t\tregEx += starsToRegExp(2);\n\t\t\t\t\tpreviousSegmentWasGlobStar = true;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// States\n\t\t\tlet inBraces = false;\n\t\t\tlet braceVal = '';\n\n\t\t\tlet inBrackets = false;\n\t\t\tlet bracketVal = '';\n\n\t\t\tfor (const char of segment) {\n\t\t\t\t// Support brace expansion\n\t\t\t\tif (char !== '}' && inBraces) {\n\t\t\t\t\tbraceVal += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Support brackets\n\t\t\t\tif (inBrackets && (char !== ']' || !bracketVal) /* ] is literally only allowed as first character in brackets to match it */) {\n\t\t\t\t\tlet res: string;\n\n\t\t\t\t\t// range operator\n\t\t\t\t\tif (char === '-') {\n\t\t\t\t\t\tres = char;\n\t\t\t\t\t}\n\n\t\t\t\t\t// negation operator (only valid on first index in bracket)\n\t\t\t\t\telse if ((char === '^' || char === '!') && !bracketVal) {\n\t\t\t\t\t\tres = '^';\n\t\t\t\t\t}\n\n\t\t\t\t\t// glob split matching is not allowed within character ranges\n\t\t\t\t\t// see http://man7.org/linux/man-pages/man7/glob.7.html\n\t\t\t\t\telse if (char === GLOB_SPLIT) {\n\t\t\t\t\t\tres = '';\n\t\t\t\t\t}\n\n\t\t\t\t\t// anything else gets escaped\n\t\t\t\t\telse {\n\t\t\t\t\t\tres = escapeRegExpCharacters(char);\n\t\t\t\t\t}\n\n\t\t\t\t\tbracketVal += res;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tswitch (char) {\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tinBraces = true;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase '[':\n\t\t\t\t\t\tinBrackets = true;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase '}': {\n\t\t\t\t\t\tconst choices = splitGlobAware(braceVal, ',');\n\n\t\t\t\t\t\t// Converts {foo,bar} => [foo|bar]\n\t\t\t\t\t\tconst braceRegExp = `(?:${choices.map(c => parseRegExp(c)).join('|')})`;\n\n\t\t\t\t\t\tregEx += braceRegExp;\n\n\t\t\t\t\t\tinBraces = false;\n\t\t\t\t\t\tbraceVal = '';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ']':\n\t\t\t\t\t\tregEx += ('[' + bracketVal + ']');\n\n\t\t\t\t\t\tinBrackets = false;\n\t\t\t\t\t\tbracketVal = '';\n\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tcase '?':\n\t\t\t\t\t\tregEx += NO_PATH_REGEX; // 1 ? matches any single character except path separator (/ and \\)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\tregEx += starsToRegExp(1);\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tregEx += escapeRegExpCharacters(char);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Tail: Add the slash we had split on if there is more to come and the remaining pattern is not a globstar\n\t\t\t// For example if pattern: some/**/*.js we want the \"/\" after some to be included in the RegEx to prevent\n\t\t\t// a folder called \"something\" to match as well.\n\t\t\t// However, if pattern: some/**, we tolerate that we also match on \"something\" because our globstar behaviour\n\t\t\t// is to match 0-N segments.\n\t\t\tif (index < segments.length - 1 && (segments[index + 1] !== GLOBSTAR || index + 2 < segments.length)) {\n\t\t\t\tregEx += PATH_REGEX;\n\t\t\t}\n\n\t\t\t// reset state\n\t\t\tpreviousSegmentWasGlobStar = false;\n\t\t});\n\t}\n\n\treturn regEx;\n}\n\n// regexes to check for trivial glob patterns that just check for String#endsWith\nconst T1 = /^\\*\\*\\/\\*\\.[\\w\\.-]+$/; \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t// **/*.something\nconst T2 = /^\\*\\*\\/([\\w\\.-]+)\\/?$/; \t\t\t\t\t\t\t \t\t\t\t\t\t\t// **/something\nconst T3 = /^{\\*\\*\\/\\*?[\\w\\.-]+\\/?(,\\*\\*\\/\\*?[\\w\\.-]+\\/?)*}$/; \t\t\t\t\t\t// {**/*.something,**/*.else} or {**/package.json,**/project.json}\nconst T3_2 = /^{\\*\\*\\/\\*?[\\w\\.-]+(\\/(\\*\\*)?)?(,\\*\\*\\/\\*?[\\w\\.-]+(\\/(\\*\\*)?)?)*}$/; \t// Like T3, with optional trailing /**\nconst T4 = /^\\*\\*((\\/[\\w\\.-]+)+)\\/?$/; \t\t\t\t\t\t \t\t\t\t\t\t\t\t// **/something/else\nconst T5 = /^([\\w\\.-]+(\\/[\\w\\.-]+)*)\\/?$/; \t\t\t\t\t\t \t\t\t\t\t\t\t// something/else\n\nexport type ParsedPattern = (path: string, basename?: string) => boolean;\n\n// The `ParsedExpression` returns a `Promise`\n// iff `hasSibling` returns a `Promise`.\nexport type ParsedExpression = (path: string, basename?: string, hasSibling?: (name: string) => boolean | Promise<boolean>) => string | null | Promise<string | null> /* the matching pattern */;\n\nexport interface IGlobOptions {\n\n\t/**\n\t * Simplify patterns for use as exclusion filters during\n\t * tree traversal to skip entire subtrees. Cannot be used\n\t * outside of a tree traversal.\n\t */\n\ttrimForExclusions?: boolean;\n}\n\ninterface ParsedStringPattern {\n\t(path: string, basename?: string): string | null | Promise<string | null> /* the matching pattern */;\n\tbasenames?: string[];\n\tpatterns?: string[];\n\tallBasenames?: string[];\n\tallPaths?: string[];\n}\ninterface ParsedExpressionPattern {\n\t(path: string, basename?: string, name?: string, hasSibling?: (name: string) => boolean | Promise<boolean>): string | null | Promise<string | null> /* the matching pattern */;\n\trequiresSiblings?: boolean;\n\tallPaths?: string[];\n}\n\nconst CACHE = new LRUCache<string, ParsedStringPattern>(10000); // bounded to 10000 elements\n\nconst FALSE = function () {\n\treturn false;\n};\n\nconst NULL = function (): string | null {\n\treturn null;\n};\n\nfunction parsePattern(arg1: string | IRelativePattern, options: IGlobOptions): ParsedStringPattern {\n\tif (!arg1) {\n\t\treturn NULL;\n\t}\n\n\t// Handle IRelativePattern\n\tlet pattern: string;\n\tif (typeof arg1 !== 'string') {\n\t\tpattern = arg1.pattern;\n\t} else {\n\t\tpattern = arg1;\n\t}\n\n\t// Whitespace trimming\n\tpattern = pattern.trim();\n\n\t// Check cache\n\tconst patternKey = `${pattern}_${!!options.trimForExclusions}`;\n\tlet parsedPattern = CACHE.get(patternKey);\n\tif (parsedPattern) {\n\t\treturn wrapRelativePattern(parsedPattern, arg1);\n\t}\n\n\t// Check for Trivials\n\tlet match: RegExpExecArray | null;\n\tif (T1.test(pattern)) { // common pattern: **/*.txt just need endsWith check\n\t\tconst base = pattern.substr(4); // '**/*'.length === 4\n\t\tparsedPattern = function (path, basename) {\n\t\t\treturn typeof path === 'string' && path.endsWith(base) ? pattern : null;\n\t\t};\n\t} else if (match = T2.exec(trimForExclusions(pattern, options))) { // common pattern: **/some.txt just need basename check\n\t\tparsedPattern = trivia2(match[1], pattern);\n\t} else if ((options.trimForExclusions ? T3_2 : T3).test(pattern)) { // repetition of common patterns (see above) {**/*.txt,**/*.png}\n\t\tparsedPattern = trivia3(pattern, options);\n\t} else if (match = T4.exec(trimForExclusions(pattern, options))) { // common pattern: **/something/else just need endsWith check\n\t\tparsedPattern = trivia4and5(match[1].substr(1), pattern, true);\n\t} else if (match = T5.exec(trimForExclusions(pattern, options))) { // common pattern: something/else just need equals check\n\t\tparsedPattern = trivia4and5(match[1], pattern, false);\n\t}\n\n\t// Otherwise convert to pattern\n\telse {\n\t\tparsedPattern = toRegExp(pattern);\n\t}\n\n\t// Cache\n\tCACHE.set(patternKey, parsedPattern);\n\n\treturn wrapRelativePattern(parsedPattern, arg1);\n}\n\nfunction wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string | IRelativePattern): ParsedStringPattern {\n\tif (typeof arg2 === 'string') {\n\t\treturn parsedPattern;\n\t}\n\n\treturn function (path, basename) {\n\t\tif (!isEqualOrParent(path, arg2.base, !isLinux)) {\n\t\t\t// skip glob matching if `base` is not a parent of `path`\n\t\t\treturn null;\n\t\t}\n\n\t\t// Given we have checked `base` being a parent of `path`,\n\t\t// we can now remove the `base` portion of the `path`\n\t\t// and only match on the remaining path components\n\t\treturn parsedPattern(path.substr(arg2.base.length + 1), basename);\n\t};\n}\n\nfunction trimForExclusions(pattern: string, options: IGlobOptions): string {\n\treturn options.trimForExclusions && pattern.endsWith('/**') ? pattern.substr(0, pattern.length - 2) : pattern; // dropping **, tailing / is dropped later\n}\n\n// common pattern: **/some.txt just need basename check\nfunction trivia2(base: string, originalPattern: string): ParsedStringPattern {\n\tconst slashBase = `/${base}`;\n\tconst backslashBase = `\\\\${base}`;\n\tconst parsedPattern: ParsedStringPattern = function (path, basename) {\n\t\tif (typeof path !== 'string') {\n\t\t\treturn null;\n\t\t}\n\t\tif (basename) {\n\t\t\treturn basename === base ? originalPattern : null;\n\t\t}\n\t\treturn path === base || path.endsWith(slashBase) || path.endsWith(backslashBase) ? originalPattern : null;\n\t};\n\tconst basenames = [base];\n\tparsedPattern.basenames = basenames;\n\tparsedPattern.patterns = [originalPattern];\n\tparsedPattern.allBasenames = basenames;\n\treturn parsedPattern;\n}\n\n// repetition of common patterns (see above) {**/*.txt,**/*.png}\nfunction trivia3(pattern: string, options: IGlobOptions): ParsedStringPattern {\n\tconst parsedPatterns = aggregateBasenameMatches(pattern.slice(1, -1).split(',')\n\t\t.map(pattern => parsePattern(pattern, options))\n\t\t.filter(pattern => pattern !== NULL), pattern);\n\tconst n = parsedPatterns.length;\n\tif (!n) {\n\t\treturn NULL;\n\t}\n\tif (n === 1) {\n\t\treturn <ParsedStringPattern>parsedPatterns[0];\n\t}\n\tconst parsedPattern: ParsedStringPattern = function (path: string, basename?: string) {\n\t\tfor (let i = 0, n = parsedPatterns.length; i < n; i++) {\n\t\t\tif ((<ParsedStringPattern>parsedPatterns[i])(path, basename)) {\n\t\t\t\treturn pattern;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\tconst withBasenames = parsedPatterns.find(pattern => !!(<ParsedStringPattern>pattern).allBasenames);\n\tif (withBasenames) {\n\t\tparsedPattern.allBasenames = (<ParsedStringPattern>withBasenames).allBasenames;\n\t}\n\tconst allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, <string[]>[]);\n\tif (allPaths.length) {\n\t\tparsedPattern.allPaths = allPaths;\n\t}\n\treturn parsedPattern;\n}\n\n// common patterns: **/something/else just need endsWith check, something/else just needs and equals check\nfunction trivia4and5(targetPath: string, pattern: string, matchPathEnds: boolean): ParsedStringPattern {\n\tconst usingPosixSep = sep === posix.sep;\n\tconst nativePath = usingPosixSep ? targetPath : targetPath.replace(ALL_FORWARD_SLASHES, sep);\n\tconst nativePathEnd = sep + nativePath;\n\tconst targetPathEnd = posix.sep + targetPath;\n\n\tconst parsedPattern: ParsedStringPattern = matchPathEnds ? function (testPath, basename) {\n\t\treturn typeof testPath === 'string' &&\n\t\t\t((testPath === nativePath || testPath.endsWith(nativePathEnd))\n\t\t\t\t|| !usingPosixSep && (testPath === targetPath || testPath.endsWith(targetPathEnd)))\n\t\t\t? pattern : null;\n\t} : function (testPath, basename) {\n\t\treturn typeof testPath === 'string' &&\n\t\t\t(testPath === nativePath\n\t\t\t\t|| (!usingPosixSep && testPath === targetPath))\n\t\t\t? pattern : null;\n\t};\n\tparsedPattern.allPaths = [(matchPathEnds ? '*/' : './') + targetPath];\n\treturn parsedPattern;\n}\n\nfunction toRegExp(pattern: string): ParsedStringPattern {\n\ttry {\n\t\tconst regExp = new RegExp(`^${parseRegExp(pattern)}$`);\n\t\treturn function (path: string) {\n\t\t\tregExp.lastIndex = 0; // reset RegExp to its initial state to reuse it!\n\t\t\treturn typeof path === 'string' && regExp.test(path) ? pattern : null;\n\t\t};\n\t} catch (error) {\n\t\treturn NULL;\n\t}\n}\n\n/**\n * Simplified glob matching. Supports a subset of glob patterns:\n * * `*` to match one or more characters in a path segment\n * * `?` to match on one character in a path segment\n * * `**` to match any number of path segments, including none\n * * `{}` to group conditions (e.g. *.{ts,js} matches all TypeScript and JavaScript files)\n * * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n * * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n */\nexport function match(pattern: string | IRelativePattern, path: string): boolean;\nexport function match(expression: IExpression, path: string, hasSibling?: (name: string) => boolean): string /* the matching pattern */;\nexport function match(arg1: string | IExpression | IRelativePattern, path: string, hasSibling?: (name: string) => boolean): boolean | string | null | Promise<string | null> {\n\tif (!arg1 || typeof path !== 'string') {\n\t\treturn false;\n\t}\n\n\treturn parse(<IExpression>arg1)(path, undefined, hasSibling);\n}\n\n/**\n * Simplified glob matching. Supports a subset of glob patterns:\n * * `*` to match one or more characters in a path segment\n * * `?` to match on one character in a path segment\n * * `**` to match any number of path segments, including none\n * * `{}` to group conditions (e.g. *.{ts,js} matches all TypeScript and JavaScript files)\n * * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n * * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n */\nexport function parse(pattern: string | IRelativePattern, options?: IGlobOptions): ParsedPattern;\nexport function parse(expression: IExpression, options?: IGlobOptions): ParsedExpression;\nexport function parse(arg1: string | IExpression | IRelativePattern, options: IGlobOptions = {}): ParsedPattern | ParsedExpression {\n\tif (!arg1) {\n\t\treturn FALSE;\n\t}\n\n\t// Glob with String\n\tif (typeof arg1 === 'string' || isRelativePattern(arg1)) {\n\t\tconst parsedPattern = parsePattern(arg1, options);\n\t\tif (parsedPattern === NULL) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tconst resultPattern: ParsedPattern & { allBasenames?: string[]; allPaths?: string[] } = function (path: string, basename?: string) {\n\t\t\treturn !!parsedPattern(path, basename);\n\t\t};\n\t\tif (parsedPattern.allBasenames) {\n\t\t\tresultPattern.allBasenames = parsedPattern.allBasenames;\n\t\t}\n\t\tif (parsedPattern.allPaths) {\n\t\t\tresultPattern.allPaths = parsedPattern.allPaths;\n\t\t}\n\t\treturn resultPattern;\n\t}\n\n\t// Glob with Expression\n\treturn parsedExpression(<IExpression>arg1, options);\n}\n\nexport function isRelativePattern(obj: unknown): obj is IRelativePattern {\n\tconst rp = obj as IRelativePattern | undefined | null;\n\tif (!rp) {\n\t\treturn false;\n\t}\n\n\treturn typeof rp.base === 'string' && typeof rp.pattern === 'string';\n}\n\nfunction parsedExpression(expression: IExpression, options: IGlobOptions): ParsedExpression {\n\tconst parsedPatterns = aggregateBasenameMatches(Object.getOwnPropertyNames(expression)\n\t\t.map(pattern => parseExpressionPattern(pattern, expression[pattern], options))\n\t\t.filter(pattern => pattern !== NULL));\n\n\tconst n = parsedPatterns.length;\n\tif (!n) {\n\t\treturn NULL;\n\t}\n\n\tif (!parsedPatterns.some(parsedPattern => !!(<ParsedExpressionPattern>parsedPattern).requiresSiblings)) {\n\t\tif (n === 1) {\n\t\t\treturn <ParsedStringPattern>parsedPatterns[0];\n\t\t}\n\n\t\tconst resultExpression: ParsedStringPattern = function (path: string, basename?: string) {\n\t\t\tfor (let i = 0, n = parsedPatterns.length; i < n; i++) {\n\t\t\t\t// Pattern matches path\n\t\t\t\tconst result = (<ParsedStringPattern>parsedPatterns[i])(path, basename);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tconst withBasenames = parsedPatterns.find(pattern => !!(<ParsedStringPattern>pattern).allBasenames);\n\t\tif (withBasenames) {\n\t\t\tresultExpression.allBasenames = (<ParsedStringPattern>withBasenames).allBasenames;\n\t\t}\n\n\t\tconst allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, <string[]>[]);\n\t\tif (allPaths.length) {\n\t\t\tresultExpression.allPaths = allPaths;\n\t\t}\n\n\t\treturn resultExpression;\n\t}\n\n\tconst resultExpression: ParsedStringPattern = function (path: string, base?: string, hasSibling?: (name: string) => boolean | Promise<boolean>) {\n\t\tlet name: string | undefined = undefined;\n\n\t\tfor (let i = 0, n = parsedPatterns.length; i < n; i++) {\n\t\t\t// Pattern matches path\n\t\t\tconst parsedPattern = (<ParsedExpressionPattern>parsedPatterns[i]);\n\t\t\tif (parsedPattern.requiresSiblings && hasSibling) {\n\t\t\t\tif (!base) {\n\t\t\t\t\tbase = basename(path);\n\t\t\t\t}\n\t\t\t\tif (!name) {\n\t\t\t\t\tname = base.substr(0, base.length - extname(path).length);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst result = parsedPattern(path, base, name, hasSibling);\n\t\t\tif (result) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tconst withBasenames = parsedPatterns.find(pattern => !!(<ParsedStringPattern>pattern).allBasenames);\n\tif (withBasenames) {\n\t\tresultExpression.allBasenames = (<ParsedStringPattern>withBasenames).allBasenames;\n\t}\n\n\tconst allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, <string[]>[]);\n\tif (allPaths.length) {\n\t\tresultExpression.allPaths = allPaths;\n\t}\n\n\treturn resultExpression;\n}\n\nfunction parseExpressionPattern(pattern: string, value: boolean | SiblingClause, options: IGlobOptions): (ParsedStringPattern | ParsedExpressionPattern) {\n\tif (value === false) {\n\t\treturn NULL; // pattern is disabled\n\t}\n\n\tconst parsedPattern = parsePattern(pattern, options);\n\tif (parsedPattern === NULL) {\n\t\treturn NULL;\n\t}\n\n\t// Expression Pattern is <boolean>\n\tif (typeof value === 'boolean') {\n\t\treturn parsedPattern;\n\t}\n\n\t// Expression Pattern is <SiblingClause>\n\tif (value) {\n\t\tconst when = (<SiblingClause>value).when;\n\t\tif (typeof when === 'string') {\n\t\t\tconst result: ParsedExpressionPattern = (path: string, basename?: string, name?: string, hasSibling?: (name: string) => boolean | Promise<boolean>) => {\n\t\t\t\tif (!hasSibling || !parsedPattern(path, basename)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst clausePattern = when.replace('$(basename)', name!);\n\t\t\t\tconst matched = hasSibling(clausePattern);\n\t\t\t\treturn isThenable(matched) ?\n\t\t\t\t\tmatched.then(m => m ? pattern : null) :\n\t\t\t\t\tmatched ? pattern : null;\n\t\t\t};\n\t\t\tresult.requiresSiblings = true;\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t// Expression is Anything\n\treturn parsedPattern;\n}\n\nfunction aggregateBasenameMatches(parsedPatterns: Array<ParsedStringPattern | ParsedExpressionPattern>, result?: string): Array<ParsedStringPattern | ParsedExpressionPattern> {\n\tconst basenamePatterns = parsedPatterns.filter(parsedPattern => !!(<ParsedStringPattern>parsedPattern).basenames);\n\tif (basenamePatterns.length < 2) {\n\t\treturn parsedPatterns;\n\t}\n\n\tconst basenames = basenamePatterns.reduce<string[]>((all, current) => {\n\t\tconst basenames = (<ParsedStringPattern>current).basenames;\n\t\treturn basenames ? all.concat(basenames) : all;\n\t}, <string[]>[]);\n\tlet patterns: string[];\n\tif (result) {\n\t\tpatterns = [];\n\t\tfor (let i = 0, n = basenames.length; i < n; i++) {\n\t\t\tpatterns.push(result);\n\t\t}\n\t} else {\n\t\tpatterns = basenamePatterns.reduce((all, current) => {\n\t\t\tconst patterns = (<ParsedStringPattern>current).patterns;\n\t\t\treturn patterns ? all.concat(patterns) : all;\n\t\t}, <string[]>[]);\n\t}\n\tconst aggregate: ParsedStringPattern = function (path, basename) {\n\t\tif (typeof path !== 'string') {\n\t\t\treturn null;\n\t\t}\n\t\tif (!basename) {\n\t\t\tlet i: number;\n\t\t\tfor (i = path.length; i > 0; i--) {\n\t\t\t\tconst ch = path.charCodeAt(i - 1);\n\t\t\t\tif (ch === CharCode.Slash || ch === CharCode.Backslash) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbasename = path.substr(i);\n\t\t}\n\t\tconst index = basenames.indexOf(basename);\n\t\treturn index !== -1 ? patterns[index] : null;\n\t};\n\taggregate.basenames = basenames;\n\taggregate.patterns = patterns;\n\taggregate.allBasenames = basenames;\n\n\tconst aggregatedPatterns = parsedPatterns.filter(parsedPattern => !(<ParsedStringPattern>parsedPattern).basenames);\n\taggregatedPatterns.push(aggregate);\n\n\treturn aggregatedPatterns;\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 { CSSIcon } from 'vs/base/common/codicons';\nimport { IMatch, matchesFuzzy } from 'vs/base/common/filters';\nimport { ltrim } from 'vs/base/common/strings';\n\nexport const iconStartMarker = '$(';\n\nconst iconsRegex = new RegExp(`\\\\$\\\\(${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?\\\\)`, 'g'); // no capturing groups\nconst iconNameCharacterRegexp = new RegExp(CSSIcon.iconNameCharacter);\n\nconst escapeIconsRegex = new RegExp(`(\\\\\\\\)?${iconsRegex.source}`, 'g');\nexport function escapeIcons(text: string): string {\n\treturn text.replace(escapeIconsRegex, (match, escaped) => escaped ? match : `\\\\${match}`);\n}\n\nconst markdownEscapedIconsRegex = new RegExp(`\\\\\\\\${iconsRegex.source}`, 'g');\nexport function markdownEscapeEscapedIcons(text: string): string {\n\t// Need to add an extra \\ for escaping in markdown\n\treturn text.replace(markdownEscapedIconsRegex, match => `\\\\${match}`);\n}\n\nconst stripIconsRegex = new RegExp(`(\\\\s)?(\\\\\\\\)?${iconsRegex.source}(\\\\s)?`, 'g');\nexport function stripIcons(text: string): string {\n\tif (text.indexOf(iconStartMarker) === -1) {\n\t\treturn text;\n\t}\n\n\treturn text.replace(stripIconsRegex, (match, preWhitespace, escaped, postWhitespace) => escaped ? match : preWhitespace || postWhitespace || '');\n}\n\n\nexport interface IParsedLabelWithIcons {\n\treadonly text: string;\n\treadonly iconOffsets?: readonly number[];\n}\n\nexport function parseLabelWithIcons(text: string): IParsedLabelWithIcons {\n\tconst firstIconIndex = text.indexOf(iconStartMarker);\n\tif (firstIconIndex === -1) {\n\t\treturn { text }; // return early if the word does not include an icon\n\t}\n\n\treturn doParseLabelWithIcons(text, firstIconIndex);\n}\n\nfunction doParseLabelWithIcons(text: string, firstIconIndex: number): IParsedLabelWithIcons {\n\tconst iconOffsets: number[] = [];\n\tlet textWithoutIcons: string = '';\n\n\tfunction appendChars(chars: string) {\n\t\tif (chars) {\n\t\t\ttextWithoutIcons += chars;\n\n\t\t\tfor (const _ of chars) {\n\t\t\t\ticonOffsets.push(iconsOffset); // make sure to fill in icon offsets\n\t\t\t}\n\t\t}\n\t}\n\n\tlet currentIconStart = -1;\n\tlet currentIconValue: string = '';\n\tlet iconsOffset = 0;\n\n\tlet char: string;\n\tlet nextChar: string;\n\n\tlet offset = firstIconIndex;\n\tconst length = text.length;\n\n\t// Append all characters until the first icon\n\tappendChars(text.substr(0, firstIconIndex));\n\n\t// example: $(file-symlink-file) my cool $(other-icon) entry\n\twhile (offset < length) {\n\t\tchar = text[offset];\n\t\tnextChar = text[offset + 1];\n\n\t\t// beginning of icon: some value $( <--\n\t\tif (char === iconStartMarker[0] && nextChar === iconStartMarker[1]) {\n\t\t\tcurrentIconStart = offset;\n\n\t\t\t// if we had a previous potential icon value without\n\t\t\t// the closing ')', it was actually not an icon and\n\t\t\t// so we have to add it to the actual value\n\t\t\tappendChars(currentIconValue);\n\n\t\t\tcurrentIconValue = iconStartMarker;\n\n\t\t\toffset++; // jump over '('\n\t\t}\n\n\t\t// end of icon: some value $(some-icon) <--\n\t\telse if (char === ')' && currentIconStart !== -1) {\n\t\t\tconst currentIconLength = offset - currentIconStart + 1; // +1 to include the closing ')'\n\t\t\ticonsOffset += currentIconLength;\n\t\t\tcurrentIconStart = -1;\n\t\t\tcurrentIconValue = '';\n\t\t}\n\n\t\t// within icon\n\t\telse if (currentIconStart !== -1) {\n\t\t\t// Make sure this is a real icon name\n\t\t\tif (iconNameCharacterRegexp.test(char)) {\n\t\t\t\tcurrentIconValue += char;\n\t\t\t} else {\n\t\t\t\t// This is not a real icon, treat it as text\n\t\t\t\tappendChars(currentIconValue);\n\n\t\t\t\tcurrentIconStart = -1;\n\t\t\t\tcurrentIconValue = '';\n\t\t\t}\n\t\t}\n\n\t\t// any value outside of icon\n\t\telse {\n\t\t\tappendChars(char);\n\t\t}\n\n\t\toffset++;\n\t}\n\n\t// if we had a previous potential icon value without\n\t// the closing ')', it was actually not an icon and\n\t// so we have to add it to the actual value\n\tappendChars(currentIconValue);\n\n\treturn { text: textWithoutIcons, iconOffsets };\n}\n\nexport function matchesFuzzyIconAware(query: string, target: IParsedLabelWithIcons, enableSeparateSubstringMatching = false): IMatch[] | null {\n\tconst { text, iconOffsets } = target;\n\n\t// Return early if there are no icon markers in the word to match against\n\tif (!iconOffsets || iconOffsets.length === 0) {\n\t\treturn matchesFuzzy(query, text, enableSeparateSubstringMatching);\n\t}\n\n\t// Trim the word to match against because it could have leading\n\t// whitespace now if the word started with an icon\n\tconst wordToMatchAgainstWithoutIconsTrimmed = ltrim(text, ' ');\n\tconst leadingWhitespaceOffset = text.length - wordToMatchAgainstWithoutIconsTrimmed.length;\n\n\t// match on value without icon\n\tconst matches = matchesFuzzy(query, wordToMatchAgainstWithoutIconsTrimmed, enableSeparateSubstringMatching);\n\n\t// Map matches back to offsets with icon and trimming\n\tif (matches) {\n\t\tfor (const match of matches) {\n\t\t\tconst iconOffset = iconOffsets[match.start + leadingWhitespaceOffset] /* icon offsets at index */ + leadingWhitespaceOffset /* overall leading whitespace offset */;\n\t\t\tmatch.start += iconOffset;\n\t\t\tmatch.end += iconOffset;\n\t\t}\n\t}\n\n\treturn matches;\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 { illegalArgument } from 'vs/base/common/errors';\nimport { escapeIcons } from 'vs/base/common/iconLabels';\nimport { URI, UriComponents } from 'vs/base/common/uri';\n\nexport interface IMarkdownString {\n\treadonly value: string;\n\treadonly isTrusted?: boolean;\n\treadonly supportThemeIcons?: boolean;\n\treadonly supportHtml?: boolean;\n\treadonly baseUri?: UriComponents;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport const enum MarkdownStringTextNewlineStyle {\n\tParagraph = 0,\n\tBreak = 1,\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tpublic value: string;\n\tpublic isTrusted?: boolean;\n\tpublic supportThemeIcons?: boolean;\n\tpublic supportHtml?: boolean;\n\tpublic baseUri?: URI;\n\n\tconstructor(\n\t\tvalue: string = '',\n\t\tisTrustedOrOptions: boolean | { isTrusted?: boolean; supportThemeIcons?: boolean; supportHtml?: boolean } = false,\n\t) {\n\t\tthis.value = value;\n\t\tif (typeof this.value !== 'string') {\n\t\t\tthrow illegalArgument('value');\n\t\t}\n\n\t\tif (typeof isTrustedOrOptions === 'boolean') {\n\t\t\tthis.isTrusted = isTrustedOrOptions;\n\t\t\tthis.supportThemeIcons = false;\n\t\t\tthis.supportHtml = false;\n\t\t}\n\t\telse {\n\t\t\tthis.isTrusted = isTrustedOrOptions.isTrusted ?? undefined;\n\t\t\tthis.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false;\n\t\t\tthis.supportHtml = isTrustedOrOptions.supportHtml ?? false;\n\t\t}\n\t}\n\n\tappendText(value: string, newlineStyle: MarkdownStringTextNewlineStyle = MarkdownStringTextNewlineStyle.Paragraph): MarkdownString {\n\t\tthis.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value)\n\t\t\t.replace(/([ \\t]+)/g, (_match, g1) => ' '.repeat(g1.length))\n\t\t\t.replace(/\\>/gm, '\\\\>')\n\t\t\t.replace(/\\n/g, newlineStyle === MarkdownStringTextNewlineStyle.Break ? '\\\\\\n' : '\\n\\n');\n\n\t\treturn this;\n\t}\n\n\tappendMarkdown(value: string): MarkdownString {\n\t\tthis.value += value;\n\t\treturn this;\n\t}\n\n\tappendCodeblock(langId: string, code: string): MarkdownString {\n\t\tthis.value += '\\n```';\n\t\tthis.value += langId;\n\t\tthis.value += '\\n';\n\t\tthis.value += code;\n\t\tthis.value += '\\n```\\n';\n\t\treturn this;\n\t}\n}\n\nexport function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[] | null | undefined): boolean {\n\tif (isMarkdownString(oneOrMany)) {\n\t\treturn !oneOrMany.value;\n\t} else if (Array.isArray(oneOrMany)) {\n\t\treturn oneOrMany.every(isEmptyMarkdownString);\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport function isMarkdownString(thing: any): thing is IMarkdownString {\n\tif (thing instanceof MarkdownString) {\n\t\treturn true;\n\t} else if (thing && typeof thing === 'object') {\n\t\treturn typeof (<IMarkdownString>thing).value === 'string'\n\t\t\t&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || (<IMarkdownString>thing).isTrusted === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportThemeIcons === 'boolean' || (<IMarkdownString>thing).supportThemeIcons === undefined);\n\t}\n\treturn false;\n}\n\nexport function escapeMarkdownSyntaxTokens(text: string): string {\n\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\treturn text.replace(/[\\\\`*_{}[\\]()#+\\-!]/g, '\\\\$&');\n}\n\nexport function removeMarkdownEscapes(text: string): string {\n\tif (!text) {\n\t\treturn text;\n\t}\n\treturn text.replace(/\\\\([\\\\`*_{}[\\]()#+\\-.!])/g, '$1');\n}\n\nexport function parseHrefAndDimensions(href: string): { href: string; dimensions: string[] } {\n\tconst dimensions: string[] = [];\n\tconst splitted = href.split('|').map(s => s.trim());\n\thref = splitted[0];\n\tconst parameters = splitted[1];\n\tif (parameters) {\n\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\tif (widthIsFinite) {\n\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t}\n\t\tif (heightIsFinite) {\n\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t}\n\t}\n\treturn { href, dimensions };\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 * as strings from './strings';\n\nexport function buildReplaceStringWithCasePreserved(matches: string[] | null, pattern: string): string {\n\tif (matches && (matches[0] !== '')) {\n\t\tconst containsHyphens = validateSpecificSpecialCharacter(matches, pattern, '-');\n\t\tconst containsUnderscores = validateSpecificSpecialCharacter(matches, pattern, '_');\n\t\tif (containsHyphens && !containsUnderscores) {\n\t\t\treturn buildReplaceStringForSpecificSpecialCharacter(matches, pattern, '-');\n\t\t} else if (!containsHyphens && containsUnderscores) {\n\t\t\treturn buildReplaceStringForSpecificSpecialCharacter(matches, pattern, '_');\n\t\t}\n\t\tif (matches[0].toUpperCase() === matches[0]) {\n\t\t\treturn pattern.toUpperCase();\n\t\t} else if (matches[0].toLowerCase() === matches[0]) {\n\t\t\treturn pattern.toLowerCase();\n\t\t} else if (strings.containsUppercaseCharacter(matches[0][0]) && pattern.length > 0) {\n\t\t\treturn pattern[0].toUpperCase() + pattern.substr(1);\n\t\t} else if (matches[0][0].toUpperCase() !== matches[0][0] && pattern.length > 0) {\n\t\t\treturn pattern[0].toLowerCase() + pattern.substr(1);\n\t\t} else {\n\t\t\t// we don't understand its pattern yet.\n\t\t\treturn pattern;\n\t\t}\n\t} else {\n\t\treturn pattern;\n\t}\n}\n\nfunction validateSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): boolean {\n\tconst doesContainSpecialCharacter = matches[0].indexOf(specialCharacter) !== -1 && pattern.indexOf(specialCharacter) !== -1;\n\treturn doesContainSpecialCharacter && matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length;\n}\n\nfunction buildReplaceStringForSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): string {\n\tconst splitPatternAtSpecialCharacter = pattern.split(specialCharacter);\n\tconst splitMatchAtSpecialCharacter = matches[0].split(specialCharacter);\n\tlet replaceString: string = '';\n\tsplitPatternAtSpecialCharacter.forEach((splitValue, index) => {\n\t\treplaceString += buildReplaceStringWithCasePreserved([splitMatchAtSpecialCharacter[index]], splitValue) + specialCharacter;\n\t});\n\n\treturn replaceString.slice(0, -1);\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 * as strings from 'vs/base/common/strings';\n\nenum Severity {\n\tIgnore = 0,\n\tInfo = 1,\n\tWarning = 2,\n\tError = 3\n}\n\nnamespace Severity {\n\n\tconst _error = 'error';\n\tconst _warning = 'warning';\n\tconst _warn = 'warn';\n\tconst _info = 'info';\n\tconst _ignore = 'ignore';\n\n\t/**\n\t * Parses 'error', 'warning', 'warn', 'info' in call casings\n\t * and falls back to ignore.\n\t */\n\texport function fromValue(value: string): Severity {\n\t\tif (!value) {\n\t\t\treturn Severity.Ignore;\n\t\t}\n\n\t\tif (strings.equalsIgnoreCase(_error, value)) {\n\t\t\treturn Severity.Error;\n\t\t}\n\n\t\tif (strings.equalsIgnoreCase(_warning, value) || strings.equalsIgnoreCase(_warn, value)) {\n\t\t\treturn Severity.Warning;\n\t\t}\n\n\t\tif (strings.equalsIgnoreCase(_info, value)) {\n\t\t\treturn Severity.Info;\n\t\t}\n\t\treturn Severity.Ignore;\n\t}\n\n\texport function toString(severity: Severity): string {\n\t\tswitch (severity) {\n\t\t\tcase Severity.Error: return _error;\n\t\t\tcase Severity.Warning: return _warning;\n\t\t\tcase Severity.Info: return _info;\n\t\t\tdefault: return _ignore;\n\t\t}\n\t}\n}\n\nexport default Severity;\n","\n\n/**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\nexport function isArray(array: any): array is any[] {\n\treturn Array.isArray(array);\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nexport function isString(str: unknown): str is string {\n\treturn (typeof str === 'string');\n}\n\n/**\n *\n * @returns whether the provided parameter is of type `object` but **not**\n *\t`null`, an `array`, a `regexp`, nor a `date`.\n */\nexport function isObject(obj: unknown): obj is Object {\n\t// The method can't do a type cast since there are type (like strings) which\n\t// are subclasses of any put not positvely matched by the function. Hence type\n\t// narrowing results in wrong results.\n\treturn typeof obj === 'object'\n\t\t&& obj !== null\n\t\t&& !Array.isArray(obj)\n\t\t&& !(obj instanceof RegExp)\n\t\t&& !(obj instanceof Date);\n}\n\n/**\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\n * @returns whether the provided parameter is a JavaScript Number or not.\n */\nexport function isNumber(obj: unknown): obj is number {\n\treturn (typeof obj === 'number' && !isNaN(obj));\n}\n\n/**\n * @returns whether the provided parameter is an Iterable, casting to the given generic\n */\nexport function isIterable<T>(obj: unknown): obj is Iterable<T> {\n\treturn !!obj && typeof (obj as any)[Symbol.iterator] === 'function';\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nexport function isBoolean(obj: unknown): obj is boolean {\n\treturn (obj === true || obj === false);\n}\n\n/**\n * @returns whether the provided parameter is undefined.\n */\nexport function isUndefined(obj: unknown): obj is undefined {\n\treturn (typeof obj === 'undefined');\n}\n\n/**\n * @returns whether the provided parameter is defined.\n */\nexport function isDefined<T>(arg: T | null | undefined): arg is T {\n\treturn !isUndefinedOrNull(arg);\n}\n\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nexport function isUndefinedOrNull(obj: unknown): obj is undefined | null {\n\treturn (isUndefined(obj) || obj === null);\n}\n\n\nexport function assertType(condition: unknown, type?: string): asserts condition {\n\tif (!condition) {\n\t\tthrow new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\n\t}\n}\n\n/**\n * Asserts that the argument passed in is neither undefined nor null.\n */\nexport function assertIsDefined<T>(arg: T | null | undefined): T {\n\tif (isUndefinedOrNull(arg)) {\n\t\tthrow new Error('Assertion Failed: argument is undefined or null');\n\t}\n\n\treturn arg;\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nexport function isFunction(obj: unknown): obj is Function {\n\treturn (typeof obj === 'function');\n}\n\nexport type TypeConstraint = string | Function;\n\nexport function validateConstraints(args: unknown[], constraints: Array<TypeConstraint | undefined>): void {\n\tconst len = Math.min(args.length, constraints.length);\n\tfor (let i = 0; i < len; i++) {\n\t\tvalidateConstraint(args[i], constraints[i]);\n\t}\n}\n\nexport function validateConstraint(arg: unknown, constraint: TypeConstraint | undefined): void {\n\n\tif (isString(constraint)) {\n\t\tif (typeof arg !== constraint) {\n\t\t\tthrow new Error(`argument does not match constraint: typeof ${constraint}`);\n\t\t}\n\t} else if (isFunction(constraint)) {\n\t\ttry {\n\t\t\tif (arg instanceof constraint) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t\tif (!isUndefinedOrNull(arg) && (arg as any).constructor === constraint) {\n\t\t\treturn;\n\t\t}\n\t\tif (constraint.length === 1 && constraint.call(undefined, arg) === true) {\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\n\t}\n}\n\nexport function getAllPropertyNames(obj: object): string[] {\n\tlet res: string[] = [];\n\tlet proto = Object.getPrototypeOf(obj);\n\twhile (Object.prototype !== proto) {\n\t\tres = res.concat(Object.getOwnPropertyNames(proto));\n\t\tproto = Object.getPrototypeOf(proto);\n\t}\n\treturn res;\n}\n\nexport function getAllMethodNames(obj: object): string[] {\n\tconst methods: string[] = [];\n\tfor (const prop of getAllPropertyNames(obj)) {\n\t\tif (typeof (obj as any)[prop] === 'function') {\n\t\t\tmethods.push(prop);\n\t\t}\n\t}\n\treturn methods;\n}\n\nexport function createProxyObject<T extends object>(methodNames: string[], invoke: (method: string, args: unknown[]) => unknown): T {\n\tconst createProxyMethod = (method: string): () => unknown => {\n\t\treturn function () {\n\t\t\tconst args = Array.prototype.slice.call(arguments, 0);\n\t\t\treturn invoke(method, args);\n\t\t};\n\t};\n\n\tlet result = {} as T;\n\tfor (const methodName of methodNames) {\n\t\t(<any>result)[methodName] = createProxyMethod(methodName);\n\t}\n\treturn result;\n}\n\n/**\n * Converts null to undefined, passes all other values through.\n */\nexport function withNullAsUndefined<T>(x: T | null): T | undefined {\n\treturn x === null ? undefined : x;\n}\n\nexport function assertNever(value: never, message = 'Unreachable'): never {\n\tthrow new Error(message);\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 { isArray, isObject, isUndefinedOrNull } from 'vs/base/common/types';\n\nexport function deepClone<T>(obj: T): T {\n\tif (!obj || typeof obj !== 'object') {\n\t\treturn obj;\n\t}\n\tif (obj instanceof RegExp) {\n\t\t// See https://github.com/microsoft/TypeScript/issues/10990\n\t\treturn obj as any;\n\t}\n\tconst result: any = Array.isArray(obj) ? [] : {};\n\tObject.keys(<any>obj).forEach((key: string) => {\n\t\tif ((<any>obj)[key] && typeof (<any>obj)[key] === 'object') {\n\t\t\tresult[key] = deepClone((<any>obj)[key]);\n\t\t} else {\n\t\t\tresult[key] = (<any>obj)[key];\n\t\t}\n\t});\n\treturn result;\n}\n\nexport function deepFreeze<T>(obj: T): T {\n\tif (!obj || typeof obj !== 'object') {\n\t\treturn obj;\n\t}\n\tconst stack: any[] = [obj];\n\twhile (stack.length > 0) {\n\t\tconst obj = stack.shift();\n\t\tObject.freeze(obj);\n\t\tfor (const key in obj) {\n\t\t\tif (_hasOwnProperty.call(obj, key)) {\n\t\t\t\tconst prop = obj[key];\n\t\t\t\tif (typeof prop === 'object' && !Object.isFrozen(prop)) {\n\t\t\t\t\tstack.push(prop);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn obj;\n}\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nexport function cloneAndChange(obj: any, changer: (orig: any) => any): any {\n\treturn _cloneAndChange(obj, changer, new Set());\n}\n\nfunction _cloneAndChange(obj: any, changer: (orig: any) => any, seen: Set<any>): any {\n\tif (isUndefinedOrNull(obj)) {\n\t\treturn obj;\n\t}\n\n\tconst changed = changer(obj);\n\tif (typeof changed !== 'undefined') {\n\t\treturn changed;\n\t}\n\n\tif (isArray(obj)) {\n\t\tconst r1: any[] = [];\n\t\tfor (const e of obj) {\n\t\t\tr1.push(_cloneAndChange(e, changer, seen));\n\t\t}\n\t\treturn r1;\n\t}\n\n\tif (isObject(obj)) {\n\t\tif (seen.has(obj)) {\n\t\t\tthrow new Error('Cannot clone recursive data-structure');\n\t\t}\n\t\tseen.add(obj);\n\t\tconst r2 = {};\n\t\tfor (let i2 in obj) {\n\t\t\tif (_hasOwnProperty.call(obj, i2)) {\n\t\t\t\t(r2 as any)[i2] = _cloneAndChange(obj[i2], changer, seen);\n\t\t\t}\n\t\t}\n\t\tseen.delete(obj);\n\t\treturn r2;\n\t}\n\n\treturn obj;\n}\n\n/**\n * Copies all properties of source into destination. The optional parameter \"overwrite\" allows to control\n * if existing properties on the destination should be overwritten or not. Defaults to true (overwrite).\n */\nexport function mixin(destination: any, source: any, overwrite: boolean = true): any {\n\tif (!isObject(destination)) {\n\t\treturn source;\n\t}\n\n\tif (isObject(source)) {\n\t\tObject.keys(source).forEach(key => {\n\t\t\tif (key in destination) {\n\t\t\t\tif (overwrite) {\n\t\t\t\t\tif (isObject(destination[key]) && isObject(source[key])) {\n\t\t\t\t\t\tmixin(destination[key], source[key], overwrite);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdestination[key] = source[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdestination[key] = source[key];\n\t\t\t}\n\t\t});\n\t}\n\treturn destination;\n}\n\nexport function equals(one: any, other: any): boolean {\n\tif (one === other) {\n\t\treturn true;\n\t}\n\tif (one === null || one === undefined || other === null || other === undefined) {\n\t\treturn false;\n\t}\n\tif (typeof one !== typeof other) {\n\t\treturn false;\n\t}\n\tif (typeof one !== 'object') {\n\t\treturn false;\n\t}\n\tif ((Array.isArray(one)) !== (Array.isArray(other))) {\n\t\treturn false;\n\t}\n\n\tlet i: number;\n\tlet key: string;\n\n\tif (Array.isArray(one)) {\n\t\tif (one.length !== other.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (i = 0; i < one.length; i++) {\n\t\t\tif (!equals(one[i], other[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst oneKeys: string[] = [];\n\n\t\tfor (key in one) {\n\t\t\toneKeys.push(key);\n\t\t}\n\t\toneKeys.sort();\n\t\tconst otherKeys: string[] = [];\n\t\tfor (key in other) {\n\t\t\totherKeys.push(key);\n\t\t}\n\t\totherKeys.sort();\n\t\tif (!equals(oneKeys, otherKeys)) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (i = 0; i < oneKeys.length; i++) {\n\t\t\tif (!equals(one[oneKeys[i]], other[oneKeys[i]])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function getOrDefault<T, R>(obj: T, fn: (obj: T) => R | undefined, defaultValue: R): R {\n\tconst result = fn(obj);\n\treturn typeof result === 'undefined' ? defaultValue : result;\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\nexport const enum Constants {\n\t/**\n\t * MAX SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMAX_SAFE_SMALL_INTEGER = 1 << 30,\n\n\t/**\n\t * MIN SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMIN_SAFE_SMALL_INTEGER = -(1 << 30),\n\n\t/**\n\t * Max unsigned integer that fits on 8 bits.\n\t */\n\tMAX_UINT_8 = 255, // 2^8 - 1\n\n\t/**\n\t * Max unsigned integer that fits on 16 bits.\n\t */\n\tMAX_UINT_16 = 65535, // 2^16 - 1\n\n\t/**\n\t * Max unsigned integer that fits on 32 bits.\n\t */\n\tMAX_UINT_32 = 4294967295, // 2^32 - 1\n\n\tUNICODE_SUPPLEMENTARY_PLANE_BEGIN = 0x010000\n}\n\nexport function toUint8(v: number): number {\n\tif (v < 0) {\n\t\treturn 0;\n\t}\n\tif (v > Constants.MAX_UINT_8) {\n\t\treturn Constants.MAX_UINT_8;\n\t}\n\treturn v | 0;\n}\n\nexport function toUint32(v: number): number {\n\tif (v < 0) {\n\t\treturn 0;\n\t}\n\tif (v > Constants.MAX_UINT_32) {\n\t\treturn Constants.MAX_UINT_32;\n\t}\n\treturn v | 0;\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 { CharCode } from 'vs/base/common/charCode';\nimport { MarshalledId } from 'vs/base/common/marshallingIds';\nimport * as paths from 'vs/base/common/path';\nimport { isWindows } from 'vs/base/common/platform';\n\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\n\nfunction _validateUri(ret: URI, _strict?: boolean): void {\n\n\t// scheme, must be set\n\tif (!ret.scheme && _strict) {\n\t\tthrow new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n\t}\n\n\t// scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n\t// ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n\tif (ret.scheme && !_schemePattern.test(ret.scheme)) {\n\t\tthrow new Error('[UriError]: Scheme contains illegal characters.');\n\t}\n\n\t// path, http://tools.ietf.org/html/rfc3986#section-3.3\n\t// If a URI contains an authority component, then the path component\n\t// must either be empty or begin with a slash (\"/\") character. If a URI\n\t// does not contain an authority component, then the path cannot begin\n\t// with two slash characters (\"//\").\n\tif (ret.path) {\n\t\tif (ret.authority) {\n\t\t\tif (!_singleSlashStart.test(ret.path)) {\n\t\t\t\tthrow new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n\t\t\t}\n\t\t} else {\n\t\t\tif (_doubleSlashStart.test(ret.path)) {\n\t\t\t\tthrow new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n\t\t\t}\n\t\t}\n\t}\n}\n\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme: string, _strict: boolean): string {\n\tif (!scheme && !_strict) {\n\t\treturn 'file';\n\t}\n\treturn scheme;\n}\n\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme: string, path: string): string {\n\n\t// the slash-character is our 'default base' as we don't\n\t// support constructing URIs relative to other URIs. This\n\t// also means that we alter and potentially break paths.\n\t// see https://tools.ietf.org/html/rfc3986#section-5.1.4\n\tswitch (scheme) {\n\t\tcase 'https':\n\t\tcase 'http':\n\t\tcase 'file':\n\t\t\tif (!path) {\n\t\t\t\tpath = _slash;\n\t\t\t} else if (path[0] !== _slash) {\n\t\t\t\tpath = _slash + path;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn path;\n}\n\nconst _empty = '';\nconst _slash = '/';\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n * ```\n */\nexport class URI implements UriComponents {\n\n\tstatic isUri(thing: any): thing is URI {\n\t\tif (thing instanceof URI) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!thing) {\n\t\t\treturn false;\n\t\t}\n\t\treturn typeof (<URI>thing).authority === 'string'\n\t\t\t&& typeof (<URI>thing).fragment === 'string'\n\t\t\t&& typeof (<URI>thing).path === 'string'\n\t\t\t&& typeof (<URI>thing).query === 'string'\n\t\t\t&& typeof (<URI>thing).scheme === 'string'\n\t\t\t&& typeof (<URI>thing).fsPath === 'string'\n\t\t\t&& typeof (<URI>thing).with === 'function'\n\t\t\t&& typeof (<URI>thing).toString === 'function';\n\t}\n\n\t/**\n\t * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.\n\t * The part before the first colon.\n\t */\n\treadonly scheme: string;\n\n\t/**\n\t * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.\n\t * The part between the first double slashes and the next slash.\n\t */\n\treadonly authority: string;\n\n\t/**\n\t * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.\n\t */\n\treadonly path: string;\n\n\t/**\n\t * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.\n\t */\n\treadonly query: string;\n\n\t/**\n\t * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.\n\t */\n\treadonly fragment: string;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(components: UriComponents);\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(schemeOrData: string | UriComponents, authority?: string, path?: string, query?: string, fragment?: string, _strict: boolean = false) {\n\n\t\tif (typeof schemeOrData === 'object') {\n\t\t\tthis.scheme = schemeOrData.scheme || _empty;\n\t\t\tthis.authority = schemeOrData.authority || _empty;\n\t\t\tthis.path = schemeOrData.path || _empty;\n\t\t\tthis.query = schemeOrData.query || _empty;\n\t\t\tthis.fragment = schemeOrData.fragment || _empty;\n\t\t\t// no validation because it's this URI\n\t\t\t// that creates uri components.\n\t\t\t// _validateUri(this);\n\t\t} else {\n\t\t\tthis.scheme = _schemeFix(schemeOrData, _strict);\n\t\t\tthis.authority = authority || _empty;\n\t\t\tthis.path = _referenceResolution(this.scheme, path || _empty);\n\t\t\tthis.query = query || _empty;\n\t\t\tthis.fragment = fragment || _empty;\n\n\t\t\t_validateUri(this, _strict);\n\t\t}\n\t}\n\n\t// ---- filesystem path -----------------------\n\n\t/**\n\t * Returns a string representing the corresponding file system path of this URI.\n\t * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n\t * platform specific path separator.\n\t *\n\t * * Will *not* validate the path for invalid characters and semantics.\n\t * * Will *not* look at the scheme of this URI.\n\t * * The result shall *not* be used for display purposes but for accessing a file on disk.\n\t *\n\t *\n\t * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n\t * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n\t *\n\t * ```ts\n\t\tconst u = URI.parse('file://server/c$/folder/file.txt')\n\t\tu.authority === 'server'\n\t\tu.path === '/shares/c$/file.txt'\n\t\tu.fsPath === '\\\\server\\c$\\folder\\file.txt'\n\t```\n\t *\n\t * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n\t * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n\t * with URIs that represent files on disk (`file` scheme).\n\t */\n\tget fsPath(): string {\n\t\t// if (this.scheme !== 'file') {\n\t\t// \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n\t\t// }\n\t\treturn uriToFsPath(this, false);\n\t}\n\n\t// ---- modify to new -------------------------\n\n\twith(change: { scheme?: string; authority?: string | null; path?: string | null; query?: string | null; fragment?: string | null }): URI {\n\n\t\tif (!change) {\n\t\t\treturn this;\n\t\t}\n\n\t\tlet { scheme, authority, path, query, fragment } = change;\n\t\tif (scheme === undefined) {\n\t\t\tscheme = this.scheme;\n\t\t} else if (scheme === null) {\n\t\t\tscheme = _empty;\n\t\t}\n\t\tif (authority === undefined) {\n\t\t\tauthority = this.authority;\n\t\t} else if (authority === null) {\n\t\t\tauthority = _empty;\n\t\t}\n\t\tif (path === undefined) {\n\t\t\tpath = this.path;\n\t\t} else if (path === null) {\n\t\t\tpath = _empty;\n\t\t}\n\t\tif (query === undefined) {\n\t\t\tquery = this.query;\n\t\t} else if (query === null) {\n\t\t\tquery = _empty;\n\t\t}\n\t\tif (fragment === undefined) {\n\t\t\tfragment = this.fragment;\n\t\t} else if (fragment === null) {\n\t\t\tfragment = _empty;\n\t\t}\n\n\t\tif (scheme === this.scheme\n\t\t\t&& authority === this.authority\n\t\t\t&& path === this.path\n\t\t\t&& query === this.query\n\t\t\t&& fragment === this.fragment) {\n\n\t\t\treturn this;\n\t\t}\n\n\t\treturn new Uri(scheme, authority, path, query, fragment);\n\t}\n\n\t// ---- parse & validate ------------------------\n\n\t/**\n\t * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,\n\t * `file:///usr/home`, or `scheme:with/path`.\n\t *\n\t * @param value A string which represents an URI (see `URI#toString`).\n\t */\n\tstatic parse(value: string, _strict: boolean = false): URI {\n\t\tconst match = _regexp.exec(value);\n\t\tif (!match) {\n\t\t\treturn new Uri(_empty, _empty, _empty, _empty, _empty);\n\t\t}\n\t\treturn new Uri(\n\t\t\tmatch[2] || _empty,\n\t\t\tpercentDecode(match[4] || _empty),\n\t\t\tpercentDecode(match[5] || _empty),\n\t\t\tpercentDecode(match[7] || _empty),\n\t\t\tpercentDecode(match[9] || _empty),\n\t\t\t_strict\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n\t * `/usr/home`, or `\\\\server\\share\\some\\path`.\n\t *\n\t * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n\t * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n\t * `URI.parse('file://' + path)` because the path might contain characters that are\n\t * interpreted (# and ?). See the following sample:\n\t * ```ts\n\tconst good = URI.file('/coding/c#/project1');\n\tgood.scheme === 'file';\n\tgood.path === '/coding/c#/project1';\n\tgood.fragment === '';\n\tconst bad = URI.parse('file://' + '/coding/c#/project1');\n\tbad.scheme === 'file';\n\tbad.path === '/coding/c'; // path is now broken\n\tbad.fragment === '/project1';\n\t```\n\t *\n\t * @param path A file system path (see `URI#fsPath`)\n\t */\n\tstatic file(path: string): URI {\n\n\t\tlet authority = _empty;\n\n\t\t// normalize to fwd-slashes on windows,\n\t\t// on other systems bwd-slashes are valid\n\t\t// filename character, eg /f\\oo/ba\\r.txt\n\t\tif (isWindows) {\n\t\t\tpath = path.replace(/\\\\/g, _slash);\n\t\t}\n\n\t\t// check for authority as used in UNC shares\n\t\t// or use the path as given\n\t\tif (path[0] === _slash && path[1] === _slash) {\n\t\t\tconst idx = path.indexOf(_slash, 2);\n\t\t\tif (idx === -1) {\n\t\t\t\tauthority = path.substring(2);\n\t\t\t\tpath = _slash;\n\t\t\t} else {\n\t\t\t\tauthority = path.substring(2, idx);\n\t\t\t\tpath = path.substring(idx) || _slash;\n\t\t\t}\n\t\t}\n\n\t\treturn new Uri('file', authority, path, _empty, _empty);\n\t}\n\n\tstatic from(components: { scheme: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {\n\t\tconst result = new Uri(\n\t\t\tcomponents.scheme,\n\t\t\tcomponents.authority,\n\t\t\tcomponents.path,\n\t\t\tcomponents.query,\n\t\t\tcomponents.fragment,\n\t\t);\n\t\t_validateUri(result, true);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Join a URI path with path fragments and normalizes the resulting path.\n\t *\n\t * @param uri The input URI.\n\t * @param pathFragment The path fragment to add to the URI path.\n\t * @returns The resulting URI.\n\t */\n\tstatic joinPath(uri: URI, ...pathFragment: string[]): URI {\n\t\tif (!uri.path) {\n\t\t\tthrow new Error(`[UriError]: cannot call joinPath on URI without path`);\n\t\t}\n\t\tlet newPath: string;\n\t\tif (isWindows && uri.scheme === 'file') {\n\t\t\tnewPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n\t\t} else {\n\t\t\tnewPath = paths.posix.join(uri.path, ...pathFragment);\n\t\t}\n\t\treturn uri.with({ path: newPath });\n\t}\n\n\t// ---- printing/externalize ---------------------------\n\n\t/**\n\t * Creates a string representation for this URI. It's guaranteed that calling\n\t * `URI.parse` with the result of this function creates an URI which is equal\n\t * to this URI.\n\t *\n\t * * The result shall *not* be used for display purposes but for externalization or transport.\n\t * * The result will be encoded using the percentage encoding and encoding happens mostly\n\t * ignore the scheme-specific encoding rules.\n\t *\n\t * @param skipEncoding Do not encode the result, default is `false`\n\t */\n\ttoString(skipEncoding: boolean = false): string {\n\t\treturn _asFormatted(this, skipEncoding);\n\t}\n\n\ttoJSON(): UriComponents {\n\t\treturn this;\n\t}\n\n\tstatic revive(data: UriComponents | URI): URI;\n\tstatic revive(data: UriComponents | URI | undefined): URI | undefined;\n\tstatic revive(data: UriComponents | URI | null): URI | null;\n\tstatic revive(data: UriComponents | URI | undefined | null): URI | undefined | null;\n\tstatic revive(data: UriComponents | URI | undefined | null): URI | undefined | null {\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t} else if (data instanceof URI) {\n\t\t\treturn data;\n\t\t} else {\n\t\t\tconst result = new Uri(data);\n\t\t\tresult._formatted = (<UriState>data).external;\n\t\t\tresult._fsPath = (<UriState>data)._sep === _pathSepMarker ? (<UriState>data).fsPath : null;\n\t\t\treturn result;\n\t\t}\n\t}\n}\n\nexport interface UriComponents {\n\tscheme: string;\n\tauthority: string;\n\tpath: string;\n\tquery: string;\n\tfragment: string;\n}\n\ninterface UriState extends UriComponents {\n\t$mid: MarshalledId.Uri;\n\texternal: string;\n\tfsPath: string;\n\t_sep: 1 | undefined;\n}\n\nconst _pathSepMarker = isWindows ? 1 : undefined;\n\n// This class exists so that URI is compatible with vscode.Uri (API).\nclass Uri extends URI {\n\n\t_formatted: string | null = null;\n\t_fsPath: string | null = null;\n\n\toverride get fsPath(): string {\n\t\tif (!this._fsPath) {\n\t\t\tthis._fsPath = uriToFsPath(this, false);\n\t\t}\n\t\treturn this._fsPath;\n\t}\n\n\toverride toString(skipEncoding: boolean = false): string {\n\t\tif (!skipEncoding) {\n\t\t\tif (!this._formatted) {\n\t\t\t\tthis._formatted = _asFormatted(this, false);\n\t\t\t}\n\t\t\treturn this._formatted;\n\t\t} else {\n\t\t\t// we don't cache that\n\t\t\treturn _asFormatted(this, true);\n\t\t}\n\t}\n\n\toverride toJSON(): UriComponents {\n\t\tconst res = <UriState>{\n\t\t\t$mid: MarshalledId.Uri\n\t\t};\n\t\t// cached state\n\t\tif (this._fsPath) {\n\t\t\tres.fsPath = this._fsPath;\n\t\t\tres._sep = _pathSepMarker;\n\t\t}\n\t\tif (this._formatted) {\n\t\t\tres.external = this._formatted;\n\t\t}\n\t\t// uri components\n\t\tif (this.path) {\n\t\t\tres.path = this.path;\n\t\t}\n\t\tif (this.scheme) {\n\t\t\tres.scheme = this.scheme;\n\t\t}\n\t\tif (this.authority) {\n\t\t\tres.authority = this.authority;\n\t\t}\n\t\tif (this.query) {\n\t\t\tres.query = this.query;\n\t\t}\n\t\tif (this.fragment) {\n\t\t\tres.fragment = this.fragment;\n\t\t}\n\t\treturn res;\n\t}\n}\n\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nconst encodeTable: { [ch: number]: string } = {\n\t[CharCode.Colon]: '%3A', // gen-delims\n\t[CharCode.Slash]: '%2F',\n\t[CharCode.QuestionMark]: '%3F',\n\t[CharCode.Hash]: '%23',\n\t[CharCode.OpenSquareBracket]: '%5B',\n\t[CharCode.CloseSquareBracket]: '%5D',\n\t[CharCode.AtSign]: '%40',\n\n\t[CharCode.ExclamationMark]: '%21', // sub-delims\n\t[CharCode.DollarSign]: '%24',\n\t[CharCode.Ampersand]: '%26',\n\t[CharCode.SingleQuote]: '%27',\n\t[CharCode.OpenParen]: '%28',\n\t[CharCode.CloseParen]: '%29',\n\t[CharCode.Asterisk]: '%2A',\n\t[CharCode.Plus]: '%2B',\n\t[CharCode.Comma]: '%2C',\n\t[CharCode.Semicolon]: '%3B',\n\t[CharCode.Equals]: '%3D',\n\n\t[CharCode.Space]: '%20',\n};\n\nfunction encodeURIComponentFast(uriComponent: string, allowSlash: boolean): string {\n\tlet res: string | undefined = undefined;\n\tlet nativeEncodePos = -1;\n\n\tfor (let pos = 0; pos < uriComponent.length; pos++) {\n\t\tconst code = uriComponent.charCodeAt(pos);\n\n\t\t// unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n\t\tif (\n\t\t\t(code >= CharCode.a && code <= CharCode.z)\n\t\t\t|| (code >= CharCode.A && code <= CharCode.Z)\n\t\t\t|| (code >= CharCode.Digit0 && code <= CharCode.Digit9)\n\t\t\t|| code === CharCode.Dash\n\t\t\t|| code === CharCode.Period\n\t\t\t|| code === CharCode.Underline\n\t\t\t|| code === CharCode.Tilde\n\t\t\t|| (allowSlash && code === CharCode.Slash)\n\t\t) {\n\t\t\t// check if we are delaying native encode\n\t\t\tif (nativeEncodePos !== -1) {\n\t\t\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n\t\t\t\tnativeEncodePos = -1;\n\t\t\t}\n\t\t\t// check if we write into a new string (by default we try to return the param)\n\t\t\tif (res !== undefined) {\n\t\t\t\tres += uriComponent.charAt(pos);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// encoding needed, we need to allocate a new string\n\t\t\tif (res === undefined) {\n\t\t\t\tres = uriComponent.substr(0, pos);\n\t\t\t}\n\n\t\t\t// check with default table first\n\t\t\tconst escaped = encodeTable[code];\n\t\t\tif (escaped !== undefined) {\n\n\t\t\t\t// check if we are delaying native encode\n\t\t\t\tif (nativeEncodePos !== -1) {\n\t\t\t\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n\t\t\t\t\tnativeEncodePos = -1;\n\t\t\t\t}\n\n\t\t\t\t// append escaped variant to result\n\t\t\t\tres += escaped;\n\n\t\t\t} else if (nativeEncodePos === -1) {\n\t\t\t\t// use native encode only when needed\n\t\t\t\tnativeEncodePos = pos;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (nativeEncodePos !== -1) {\n\t\tres += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n\t}\n\n\treturn res !== undefined ? res : uriComponent;\n}\n\nfunction encodeURIComponentMinimal(path: string): string {\n\tlet res: string | undefined = undefined;\n\tfor (let pos = 0; pos < path.length; pos++) {\n\t\tconst code = path.charCodeAt(pos);\n\t\tif (code === CharCode.Hash || code === CharCode.QuestionMark) {\n\t\t\tif (res === undefined) {\n\t\t\t\tres = path.substr(0, pos);\n\t\t\t}\n\t\t\tres += encodeTable[code];\n\t\t} else {\n\t\t\tif (res !== undefined) {\n\t\t\t\tres += path[pos];\n\t\t\t}\n\t\t}\n\t}\n\treturn res !== undefined ? res : path;\n}\n\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri: URI, keepDriveLetterCasing: boolean): string {\n\n\tlet value: string;\n\tif (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n\t\t// unc path: file://shares/c$/far/boo\n\t\tvalue = `//${uri.authority}${uri.path}`;\n\t} else if (\n\t\turi.path.charCodeAt(0) === CharCode.Slash\n\t\t&& (uri.path.charCodeAt(1) >= CharCode.A && uri.path.charCodeAt(1) <= CharCode.Z || uri.path.charCodeAt(1) >= CharCode.a && uri.path.charCodeAt(1) <= CharCode.z)\n\t\t&& uri.path.charCodeAt(2) === CharCode.Colon\n\t) {\n\t\tif (!keepDriveLetterCasing) {\n\t\t\t// windows drive letter: file:///c:/far/boo\n\t\t\tvalue = uri.path[1].toLowerCase() + uri.path.substr(2);\n\t\t} else {\n\t\t\tvalue = uri.path.substr(1);\n\t\t}\n\t} else {\n\t\t// other path\n\t\tvalue = uri.path;\n\t}\n\tif (isWindows) {\n\t\tvalue = value.replace(/\\//g, '\\\\');\n\t}\n\treturn value;\n}\n\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri: URI, skipEncoding: boolean): string {\n\n\tconst encoder = !skipEncoding\n\t\t? encodeURIComponentFast\n\t\t: encodeURIComponentMinimal;\n\n\tlet res = '';\n\tlet { scheme, authority, path, query, fragment } = uri;\n\tif (scheme) {\n\t\tres += scheme;\n\t\tres += ':';\n\t}\n\tif (authority || scheme === 'file') {\n\t\tres += _slash;\n\t\tres += _slash;\n\t}\n\tif (authority) {\n\t\tlet idx = authority.indexOf('@');\n\t\tif (idx !== -1) {\n\t\t\t// <user>@<auth>\n\t\t\tconst userinfo = authority.substr(0, idx);\n\t\t\tauthority = authority.substr(idx + 1);\n\t\t\tidx = userinfo.indexOf(':');\n\t\t\tif (idx === -1) {\n\t\t\t\tres += encoder(userinfo, false);\n\t\t\t} else {\n\t\t\t\t// <user>:<pass>@<auth>\n\t\t\t\tres += encoder(userinfo.substr(0, idx), false);\n\t\t\t\tres += ':';\n\t\t\t\tres += encoder(userinfo.substr(idx + 1), false);\n\t\t\t}\n\t\t\tres += '@';\n\t\t}\n\t\tauthority = authority.toLowerCase();\n\t\tidx = authority.indexOf(':');\n\t\tif (idx === -1) {\n\t\t\tres += encoder(authority, false);\n\t\t} else {\n\t\t\t// <auth>:<port>\n\t\t\tres += encoder(authority.substr(0, idx), false);\n\t\t\tres += authority.substr(idx);\n\t\t}\n\t}\n\tif (path) {\n\t\t// lower-case windows drive letters in /C:/fff or C:/fff\n\t\tif (path.length >= 3 && path.charCodeAt(0) === CharCode.Slash && path.charCodeAt(2) === CharCode.Colon) {\n\t\t\tconst code = path.charCodeAt(1);\n\t\t\tif (code >= CharCode.A && code <= CharCode.Z) {\n\t\t\t\tpath = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\n\t\t\t}\n\t\t} else if (path.length >= 2 && path.charCodeAt(1) === CharCode.Colon) {\n\t\t\tconst code = path.charCodeAt(0);\n\t\t\tif (code >= CharCode.A && code <= CharCode.Z) {\n\t\t\t\tpath = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\n\t\t\t}\n\t\t}\n\t\t// encode the rest of the path\n\t\tres += encoder(path, true);\n\t}\n\tif (query) {\n\t\tres += '?';\n\t\tres += encoder(query, false);\n\t}\n\tif (fragment) {\n\t\tres += '#';\n\t\tres += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\n\t}\n\treturn res;\n}\n\n// --- decode\n\nfunction decodeURIComponentGraceful(str: string): string {\n\ttry {\n\t\treturn decodeURIComponent(str);\n\t} catch {\n\t\tif (str.length > 3) {\n\t\t\treturn str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n\t\t} else {\n\t\t\treturn str;\n\t\t}\n\t}\n}\n\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\n\nfunction percentDecode(str: string): string {\n\tif (!str.match(_rEncodedAsHex)) {\n\t\treturn str;\n\t}\n\treturn str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\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 { VSBuffer } from 'vs/base/common/buffer';\nimport { URI, UriComponents } from 'vs/base/common/uri';\nimport { MarshalledId } from './marshallingIds';\n\nexport function parse(text: string): any {\n\tlet data = JSON.parse(text);\n\tdata = revive(data);\n\treturn data;\n}\n\nexport interface MarshalledObject {\n\t$mid: MarshalledId;\n}\n\n\ntype Deserialize<T> = T extends UriComponents ? URI\n\t: T extends VSBuffer ? VSBuffer\n\t: T extends object\n\t? Revived<T>\n\t: T;\n\nexport type Revived<T> = { [K in keyof T]: Deserialize<T[K]> };\n\nexport function revive<T = any>(obj: any, depth = 0): Revived<T> {\n\tif (!obj || depth > 200) {\n\t\treturn obj;\n\t}\n\n\tif (typeof obj === 'object') {\n\n\t\tswitch ((<MarshalledObject>obj).$mid) {\n\t\t\tcase MarshalledId.Uri: return <any>URI.revive(obj);\n\t\t\tcase MarshalledId.Regexp: return <any>new RegExp(obj.source, obj.flags);\n\t\t\tcase MarshalledId.Date: return <any>new Date(obj.source);\n\t\t}\n\n\t\tif (\n\t\t\tobj instanceof VSBuffer\n\t\t\t|| obj instanceof Uint8Array\n\t\t) {\n\t\t\treturn <any>obj;\n\t\t}\n\n\t\tif (Array.isArray(obj)) {\n\t\t\tfor (let i = 0; i < obj.length; ++i) {\n\t\t\t\tobj[i] = revive(obj[i], depth + 1);\n\t\t\t}\n\t\t} else {\n\t\t\t// walk object\n\t\t\tfor (const key in obj) {\n\t\t\t\tif (Object.hasOwnProperty.call(obj, key)) {\n\t\t\t\t\tobj[key] = revive(obj[key], depth + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn obj;\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 * as platform from 'vs/base/common/platform';\nimport { URI } from 'vs/base/common/uri';\n\nexport namespace Schemas {\n\n\t/**\n\t * A schema that is used for models that exist in memory\n\t * only and that have no correspondence on a server or such.\n\t */\n\texport const inMemory = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet = 'walkThroughSnippet';\n\n\texport const http = 'http';\n\n\texport const https = 'https';\n\n\texport const file = 'file';\n\n\texport const mailto = 'mailto';\n\n\texport const untitled = 'untitled';\n\n\texport const data = 'data';\n\n\texport const command = 'command';\n\n\texport const vscodeRemote = 'vscode-remote';\n\n\texport const vscodeRemoteResource = 'vscode-remote-resource';\n\n\texport const userData = 'vscode-userdata';\n\n\texport const vscodeCustomEditor = 'vscode-custom-editor';\n\n\texport const vscodeNotebook = 'vscode-notebook';\n\n\texport const vscodeNotebookCell = 'vscode-notebook-cell';\n\n\texport const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n\texport const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n\texport const vscodeInteractive = 'vscode-interactive';\n\texport const vscodeInteractiveInput = 'vscode-interactive-input';\n\n\texport const vscodeSettings = 'vscode-settings';\n\n\texport const vscodeWorkspaceTrust = 'vscode-workspace-trust';\n\n\texport const vscodeTerminal = 'vscode-terminal';\n\n\t/**\n\t * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n\t */\n\texport const webviewPanel = 'webview-panel';\n\n\t/**\n\t * Scheme used for loading the wrapper html and script in webviews.\n\t */\n\texport const vscodeWebview = 'vscode-webview';\n\n\t/**\n\t * Scheme used for extension pages\n\t */\n\texport const extension = 'extension';\n\n\t/**\n\t * Scheme used as a replacement of `file` scheme to load\n\t * files with our custom protocol handler (desktop only).\n\t */\n\texport const vscodeFileResource = 'vscode-file';\n\n\t/**\n\t * Scheme used for temporary resources\n\t */\n\texport const tmp = 'tmp';\n\n\t/**\n\t * Scheme used vs live share\n\t */\n\texport const vsls = 'vsls';\n}\nexport const connectionTokenQueryName = 'tkn';\n\nclass RemoteAuthoritiesImpl {\n\tprivate readonly _hosts: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate readonly _ports: { [authority: string]: number | undefined } = Object.create(null);\n\tprivate readonly _connectionTokens: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate _preferredWebSchema: 'http' | 'https' = 'http';\n\tprivate _delegate: ((uri: URI) => URI) | null = null;\n\n\tsetPreferredWebSchema(schema: 'http' | 'https') {\n\t\tthis._preferredWebSchema = schema;\n\t}\n\n\trewrite(uri: URI): URI {\n\t\tif (this._delegate) {\n\t\t\treturn this._delegate(uri);\n\t\t}\n\t\tconst authority = uri.authority;\n\t\tlet host = this._hosts[authority];\n\t\tif (host && host.indexOf(':') !== -1) {\n\t\t\thost = `[${host}]`;\n\t\t}\n\t\tconst port = this._ports[authority];\n\t\tconst connectionToken = this._connectionTokens[authority];\n\t\tlet query = `path=${encodeURIComponent(uri.path)}`;\n\t\tif (typeof connectionToken === 'string') {\n\t\t\tquery += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n\t\t}\n\t\treturn URI.from({\n\t\t\tscheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n\t\t\tauthority: `${host}:${port}`,\n\t\t\tpath: `/vscode-remote-resource`,\n\t\t\tquery\n\t\t});\n\t}\n}\n\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\n\nclass FileAccessImpl {\n\n\tprivate static readonly FALLBACK_AUTHORITY = 'vscode-app';\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\tasBrowserUri(uri: URI): URI;\n\tasBrowserUri(moduleId: string, moduleIdToUrl: { toUrl(moduleId: string): string }): URI;\n\tasBrowserUri(uriOrModule: URI | string, moduleIdToUrl?: { toUrl(moduleId: string): string }): URI {\n\t\tconst uri = this.toUri(uriOrModule, moduleIdToUrl);\n\n\t\t// Handle remote URIs via `RemoteAuthorities`\n\t\tif (uri.scheme === Schemas.vscodeRemote) {\n\t\t\treturn RemoteAuthorities.rewrite(uri);\n\t\t}\n\n\t\t// Convert to `vscode-file` resource..\n\t\tif (\n\t\t\t// ...only ever for `file` resources\n\t\t\turi.scheme === Schemas.file &&\n\t\t\t(\n\t\t\t\t// ...and we run in native environments\n\t\t\t\tplatform.isNative ||\n\t\t\t\t// ...or web worker extensions on desktop\n\t\t\t\t(platform.isWebWorker && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)\n\t\t\t)\n\t\t) {\n\t\t\treturn uri.with({\n\t\t\t\tscheme: Schemas.vscodeFileResource,\n\t\t\t\t// We need to provide an authority here so that it can serve\n\t\t\t\t// as origin for network and loading matters in chromium.\n\t\t\t\t// If the URI is not coming with an authority already, we\n\t\t\t\t// add our own\n\t\t\t\tauthority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n\t\t\t\tquery: null,\n\t\t\t\tfragment: null\n\t\t\t});\n\t\t}\n\n\t\treturn uri;\n\t}\n\n\tprivate toUri(uriOrModule: URI | string, moduleIdToUrl?: { toUrl(moduleId: string): string }): URI {\n\t\tif (URI.isUri(uriOrModule)) {\n\t\t\treturn uriOrModule;\n\t\t}\n\n\t\treturn URI.parse(moduleIdToUrl!.toUrl(uriOrModule));\n\t}\n}\n\nexport const FileAccess = new FileAccessImpl();\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 * as browser from 'vs/base/browser/browser';\nimport { BrowserFeatures } from 'vs/base/browser/canIUse';\nimport { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport * as event from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { FileAccess, RemoteAuthorities } from 'vs/base/common/network';\nimport * as platform from 'vs/base/common/platform';\nimport { URI } from 'vs/base/common/uri';\n\nexport function clearNode(node: HTMLElement): void {\n\twhile (node.firstChild) {\n\t\tnode.firstChild.remove();\n\t}\n}\n\n/**\n * @deprecated Use node.isConnected directly\n */\nexport function isInDOM(node: Node | null): boolean {\n\treturn node?.isConnected ?? false;\n}\n\nclass DomListener implements IDisposable {\n\n\tprivate _handler: (e: any) => void;\n\tprivate _node: EventTarget;\n\tprivate readonly _type: string;\n\tprivate readonly _options: boolean | AddEventListenerOptions;\n\n\tconstructor(node: EventTarget, type: string, handler: (e: any) => void, options?: boolean | AddEventListenerOptions) {\n\t\tthis._node = node;\n\t\tthis._type = type;\n\t\tthis._handler = handler;\n\t\tthis._options = (options || false);\n\t\tthis._node.addEventListener(this._type, this._handler, this._options);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (!this._handler) {\n\t\t\t// Already disposed\n\t\t\treturn;\n\t\t}\n\n\t\tthis._node.removeEventListener(this._type, this._handler, this._options);\n\n\t\t// Prevent leakers from holding on to the dom or handler func\n\t\tthis._node = null!;\n\t\tthis._handler = null!;\n\t}\n}\n\nexport function addDisposableListener<K extends keyof GlobalEventHandlersEventMap>(node: EventTarget, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): IDisposable;\nexport function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;\nexport function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, options: AddEventListenerOptions): IDisposable;\nexport function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCaptureOrOptions?: boolean | AddEventListenerOptions): IDisposable {\n\treturn new DomListener(node, type, handler, useCaptureOrOptions);\n}\n\nexport interface IAddStandardDisposableListenerSignature {\n\t(node: HTMLElement, type: 'click', handler: (event: IMouseEvent) => void, useCapture?: boolean): IDisposable;\n\t(node: HTMLElement, type: 'mousedown', handler: (event: IMouseEvent) => void, useCapture?: boolean): IDisposable;\n\t(node: HTMLElement, type: 'keydown', handler: (event: IKeyboardEvent) => void, useCapture?: boolean): IDisposable;\n\t(node: HTMLElement, type: 'keypress', handler: (event: IKeyboardEvent) => void, useCapture?: boolean): IDisposable;\n\t(node: HTMLElement, type: 'keyup', handler: (event: IKeyboardEvent) => void, useCapture?: boolean): IDisposable;\n\t(node: HTMLElement, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;\n}\nfunction _wrapAsStandardMouseEvent(handler: (e: IMouseEvent) => void): (e: MouseEvent) => void {\n\treturn function (e: MouseEvent) {\n\t\treturn handler(new StandardMouseEvent(e));\n\t};\n}\nfunction _wrapAsStandardKeyboardEvent(handler: (e: IKeyboardEvent) => void): (e: KeyboardEvent) => void {\n\treturn function (e: KeyboardEvent) {\n\t\treturn handler(new StandardKeyboardEvent(e));\n\t};\n}\nexport let addStandardDisposableListener: IAddStandardDisposableListenerSignature = function addStandardDisposableListener(node: HTMLElement, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\tlet wrapHandler = handler;\n\n\tif (type === 'click' || type === 'mousedown') {\n\t\twrapHandler = _wrapAsStandardMouseEvent(handler);\n\t} else if (type === 'keydown' || type === 'keypress' || type === 'keyup') {\n\t\twrapHandler = _wrapAsStandardKeyboardEvent(handler);\n\t}\n\n\treturn addDisposableListener(node, type, wrapHandler, useCapture);\n};\n\nexport let addStandardDisposableGenericMouseDownListener = function addStandardDisposableListener(node: HTMLElement, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\tlet wrapHandler = _wrapAsStandardMouseEvent(handler);\n\n\treturn addDisposableGenericMouseDownListener(node, wrapHandler, useCapture);\n};\n\nexport let addStandardDisposableGenericMouseUpListener = function addStandardDisposableListener(node: HTMLElement, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\tlet wrapHandler = _wrapAsStandardMouseEvent(handler);\n\n\treturn addDisposableGenericMouseUpListener(node, wrapHandler, useCapture);\n};\nexport function addDisposableGenericMouseDownListener(node: EventTarget, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\treturn addDisposableListener(node, platform.isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_DOWN : EventType.MOUSE_DOWN, handler, useCapture);\n}\n\nexport function addDisposableGenericMouseUpListener(node: EventTarget, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\treturn addDisposableListener(node, platform.isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture);\n}\nexport function addDisposableNonBubblingMouseOutListener(node: Element, handler: (event: MouseEvent) => void): IDisposable {\n\treturn addDisposableListener(node, 'mouseout', (e: MouseEvent) => {\n\t\t// Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements\n\t\tlet toElement: Node | null = <Node>(e.relatedTarget);\n\t\twhile (toElement && toElement !== node) {\n\t\t\ttoElement = toElement.parentNode;\n\t\t}\n\t\tif (toElement === node) {\n\t\t\treturn;\n\t\t}\n\n\t\thandler(e);\n\t});\n}\n\nexport function addDisposableNonBubblingPointerOutListener(node: Element, handler: (event: MouseEvent) => void): IDisposable {\n\treturn addDisposableListener(node, 'pointerout', (e: MouseEvent) => {\n\t\t// Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements\n\t\tlet toElement: Node | null = <Node>(e.relatedTarget);\n\t\twhile (toElement && toElement !== node) {\n\t\t\ttoElement = toElement.parentNode;\n\t\t}\n\t\tif (toElement === node) {\n\t\t\treturn;\n\t\t}\n\n\t\thandler(e);\n\t});\n}\n\nexport function createEventEmitter<K extends keyof HTMLElementEventMap>(target: HTMLElement, type: K, options?: boolean | AddEventListenerOptions): event.Emitter<HTMLElementEventMap[K]> {\n\tlet domListener: DomListener | null = null;\n\tconst handler = (e: HTMLElementEventMap[K]) => result.fire(e);\n\tconst onFirstListenerAdd = () => {\n\t\tif (!domListener) {\n\t\t\tdomListener = new DomListener(target, type, handler, options);\n\t\t}\n\t};\n\tconst onLastListenerRemove = () => {\n\t\tif (domListener) {\n\t\t\tdomListener.dispose();\n\t\t\tdomListener = null;\n\t\t}\n\t};\n\tconst result = new event.Emitter<HTMLElementEventMap[K]>({ onFirstListenerAdd, onLastListenerRemove });\n\treturn result;\n}\n\ninterface IRequestAnimationFrame {\n\t(callback: (time: number) => void): number;\n}\nlet _animationFrame: IRequestAnimationFrame | null = null;\nfunction doRequestAnimationFrame(callback: (time: number) => void): number {\n\tif (!_animationFrame) {\n\t\tconst emulatedRequestAnimationFrame = (callback: (time: number) => void): any => {\n\t\t\treturn setTimeout(() => callback(new Date().getTime()), 0);\n\t\t};\n\t\t_animationFrame = (\n\t\t\tself.requestAnimationFrame\n\t\t\t|| (<any>self).msRequestAnimationFrame\n\t\t\t|| (<any>self).webkitRequestAnimationFrame\n\t\t\t|| (<any>self).mozRequestAnimationFrame\n\t\t\t|| (<any>self).oRequestAnimationFrame\n\t\t\t|| emulatedRequestAnimationFrame\n\t\t);\n\t}\n\treturn _animationFrame.call(self, callback);\n}\n\n/**\n * Schedule a callback to be run at the next animation frame.\n * This allows multiple parties to register callbacks that should run at the next animation frame.\n * If currently in an animation frame, `runner` will be executed immediately.\n * @return token that can be used to cancel the scheduled runner (only if `runner` was not executed immediately).\n */\nexport let runAtThisOrScheduleAtNextAnimationFrame: (runner: () => void, priority?: number) => IDisposable;\n/**\n * Schedule a callback to be run at the next animation frame.\n * This allows multiple parties to register callbacks that should run at the next animation frame.\n * If currently in an animation frame, `runner` will be executed at the next animation frame.\n * @return token that can be used to cancel the scheduled runner.\n */\nexport let scheduleAtNextAnimationFrame: (runner: () => void, priority?: number) => IDisposable;\n\nclass AnimationFrameQueueItem implements IDisposable {\n\n\tprivate _runner: () => void;\n\tpublic priority: number;\n\tprivate _canceled: boolean;\n\n\tconstructor(runner: () => void, priority: number = 0) {\n\t\tthis._runner = runner;\n\t\tthis.priority = priority;\n\t\tthis._canceled = false;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._canceled = true;\n\t}\n\n\tpublic execute(): void {\n\t\tif (this._canceled) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._runner();\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\t// Sort by priority (largest to lowest)\n\tpublic static sort(a: AnimationFrameQueueItem, b: AnimationFrameQueueItem): number {\n\t\treturn b.priority - a.priority;\n\t}\n}\n\n(function () {\n\t/**\n\t * The runners scheduled at the next animation frame\n\t */\n\tlet NEXT_QUEUE: AnimationFrameQueueItem[] = [];\n\t/**\n\t * The runners scheduled at the current animation frame\n\t */\n\tlet CURRENT_QUEUE: AnimationFrameQueueItem[] | null = null;\n\t/**\n\t * A flag to keep track if the native requestAnimationFrame was already called\n\t */\n\tlet animFrameRequested = false;\n\t/**\n\t * A flag to indicate if currently handling a native requestAnimationFrame callback\n\t */\n\tlet inAnimationFrameRunner = false;\n\n\tlet animationFrameRunner = () => {\n\t\tanimFrameRequested = false;\n\n\t\tCURRENT_QUEUE = NEXT_QUEUE;\n\t\tNEXT_QUEUE = [];\n\n\t\tinAnimationFrameRunner = true;\n\t\twhile (CURRENT_QUEUE.length > 0) {\n\t\t\tCURRENT_QUEUE.sort(AnimationFrameQueueItem.sort);\n\t\t\tlet top = CURRENT_QUEUE.shift()!;\n\t\t\ttop.execute();\n\t\t}\n\t\tinAnimationFrameRunner = false;\n\t};\n\n\tscheduleAtNextAnimationFrame = (runner: () => void, priority: number = 0) => {\n\t\tlet item = new AnimationFrameQueueItem(runner, priority);\n\t\tNEXT_QUEUE.push(item);\n\n\t\tif (!animFrameRequested) {\n\t\t\tanimFrameRequested = true;\n\t\t\tdoRequestAnimationFrame(animationFrameRunner);\n\t\t}\n\n\t\treturn item;\n\t};\n\n\trunAtThisOrScheduleAtNextAnimationFrame = (runner: () => void, priority?: number) => {\n\t\tif (inAnimationFrameRunner) {\n\t\t\tlet item = new AnimationFrameQueueItem(runner, priority);\n\t\t\tCURRENT_QUEUE!.push(item);\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn scheduleAtNextAnimationFrame(runner, priority);\n\t\t}\n\t};\n})();\n\n/**\n * Add a throttled listener. `handler` is fired at most every 8.33333ms or with the next animation frame (if browser supports it).\n */\nexport interface IEventMerger<R, E> {\n\t(lastEvent: R | null, currentEvent: E): R;\n}\n\nconst MINIMUM_TIME_MS = 8;\nconst DEFAULT_EVENT_MERGER: IEventMerger<Event, Event> = function (lastEvent: Event | null, currentEvent: Event) {\n\treturn currentEvent;\n};\n\nclass TimeoutThrottledDomListener<R, E extends Event> extends Disposable {\n\n\tconstructor(node: any, type: string, handler: (event: R) => void, eventMerger: IEventMerger<R, E> = <any>DEFAULT_EVENT_MERGER, minimumTimeMs: number = MINIMUM_TIME_MS) {\n\t\tsuper();\n\n\t\tlet lastEvent: R | null = null;\n\t\tlet lastHandlerTime = 0;\n\t\tlet timeout = this._register(new TimeoutTimer());\n\n\t\tlet invokeHandler = () => {\n\t\t\tlastHandlerTime = (new Date()).getTime();\n\t\t\thandler(<R>lastEvent);\n\t\t\tlastEvent = null;\n\t\t};\n\n\t\tthis._register(addDisposableListener(node, type, (e) => {\n\n\t\t\tlastEvent = eventMerger(lastEvent, e);\n\t\t\tlet elapsedTime = (new Date()).getTime() - lastHandlerTime;\n\n\t\t\tif (elapsedTime >= minimumTimeMs) {\n\t\t\t\ttimeout.cancel();\n\t\t\t\tinvokeHandler();\n\t\t\t} else {\n\t\t\t\ttimeout.setIfNotSet(invokeHandler, minimumTimeMs - elapsedTime);\n\t\t\t}\n\t\t}));\n\t}\n}\n\nexport function addDisposableThrottledListener<R, E extends Event = Event>(node: any, type: string, handler: (event: R) => void, eventMerger?: IEventMerger<R, E>, minimumTimeMs?: number): IDisposable {\n\treturn new TimeoutThrottledDomListener<R, E>(node, type, handler, eventMerger, minimumTimeMs);\n}\n\nexport function getComputedStyle(el: HTMLElement): CSSStyleDeclaration {\n\treturn document.defaultView!.getComputedStyle(el, null);\n}\n\nexport function getClientArea(element: HTMLElement): Dimension {\n\n\t// Try with DOM clientWidth / clientHeight\n\tif (element !== document.body) {\n\t\treturn new Dimension(element.clientWidth, element.clientHeight);\n\t}\n\n\t// If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight\n\tif (platform.isIOS && window.visualViewport) {\n\t\treturn new Dimension(window.visualViewport.width, window.visualViewport.height);\n\t}\n\n\t// Try innerWidth / innerHeight\n\tif (window.innerWidth && window.innerHeight) {\n\t\treturn new Dimension(window.innerWidth, window.innerHeight);\n\t}\n\n\t// Try with document.body.clientWidth / document.body.clientHeight\n\tif (document.body && document.body.clientWidth && document.body.clientHeight) {\n\t\treturn new Dimension(document.body.clientWidth, document.body.clientHeight);\n\t}\n\n\t// Try with document.documentElement.clientWidth / document.documentElement.clientHeight\n\tif (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientHeight) {\n\t\treturn new Dimension(document.documentElement.clientWidth, document.documentElement.clientHeight);\n\t}\n\n\tthrow new Error('Unable to figure out browser width and height');\n}\n\nclass SizeUtils {\n\t// Adapted from WinJS\n\t// Converts a CSS positioning string for the specified element to pixels.\n\tprivate static convertToPixels(element: HTMLElement, value: string): number {\n\t\treturn parseFloat(value) || 0;\n\t}\n\n\tprivate static getDimension(element: HTMLElement, cssPropertyName: string, jsPropertyName: string): number {\n\t\tlet computedStyle: CSSStyleDeclaration = getComputedStyle(element);\n\t\tlet value = '0';\n\t\tif (computedStyle) {\n\t\t\tif (computedStyle.getPropertyValue) {\n\t\t\t\tvalue = computedStyle.getPropertyValue(cssPropertyName);\n\t\t\t} else {\n\t\t\t\t// IE8\n\t\t\t\tvalue = (<any>computedStyle).getAttribute(jsPropertyName);\n\t\t\t}\n\t\t}\n\t\treturn SizeUtils.convertToPixels(element, value);\n\t}\n\n\tstatic getBorderLeftWidth(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'border-left-width', 'borderLeftWidth');\n\t}\n\tstatic getBorderRightWidth(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'border-right-width', 'borderRightWidth');\n\t}\n\tstatic getBorderTopWidth(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'border-top-width', 'borderTopWidth');\n\t}\n\tstatic getBorderBottomWidth(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'border-bottom-width', 'borderBottomWidth');\n\t}\n\n\tstatic getPaddingLeft(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'padding-left', 'paddingLeft');\n\t}\n\tstatic getPaddingRight(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'padding-right', 'paddingRight');\n\t}\n\tstatic getPaddingTop(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'padding-top', 'paddingTop');\n\t}\n\tstatic getPaddingBottom(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'padding-bottom', 'paddingBottom');\n\t}\n\n\tstatic getMarginLeft(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'margin-left', 'marginLeft');\n\t}\n\tstatic getMarginTop(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'margin-top', 'marginTop');\n\t}\n\tstatic getMarginRight(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'margin-right', 'marginRight');\n\t}\n\tstatic getMarginBottom(element: HTMLElement): number {\n\t\treturn SizeUtils.getDimension(element, 'margin-bottom', 'marginBottom');\n\t}\n}\n\n// ----------------------------------------------------------------------------------------\n// Position & Dimension\n\nexport interface IDimension {\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport class Dimension implements IDimension {\n\n\tstatic readonly None = new Dimension(0, 0);\n\n\tconstructor(\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number,\n\t) { }\n\n\twith(width: number = this.width, height: number = this.height): Dimension {\n\t\tif (width !== this.width || height !== this.height) {\n\t\t\treturn new Dimension(width, height);\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\tstatic is(obj: unknown): obj is IDimension {\n\t\treturn typeof obj === 'object' && typeof (<IDimension>obj).height === 'number' && typeof (<IDimension>obj).width === 'number';\n\t}\n\n\tstatic lift(obj: IDimension): Dimension {\n\t\tif (obj instanceof Dimension) {\n\t\t\treturn obj;\n\t\t} else {\n\t\t\treturn new Dimension(obj.width, obj.height);\n\t\t}\n\t}\n\n\tstatic equals(a: Dimension | undefined, b: Dimension | undefined): boolean {\n\t\tif (a === b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!a || !b) {\n\t\t\treturn false;\n\t\t}\n\t\treturn a.width === b.width && a.height === b.height;\n\t}\n}\n\nexport function getTopLeftOffset(element: HTMLElement): { left: number; top: number } {\n\t// Adapted from WinJS.Utilities.getPosition\n\t// and added borders to the mix\n\n\tlet offsetParent = element.offsetParent;\n\tlet top = element.offsetTop;\n\tlet left = element.offsetLeft;\n\n\twhile (\n\t\t(element = <HTMLElement>element.parentNode) !== null\n\t\t&& element !== document.body\n\t\t&& element !== document.documentElement\n\t) {\n\t\ttop -= element.scrollTop;\n\t\tconst c = isShadowRoot(element) ? null : getComputedStyle(element);\n\t\tif (c) {\n\t\t\tleft -= c.direction !== 'rtl' ? element.scrollLeft : -element.scrollLeft;\n\t\t}\n\n\t\tif (element === offsetParent) {\n\t\t\tleft += SizeUtils.getBorderLeftWidth(element);\n\t\t\ttop += SizeUtils.getBorderTopWidth(element);\n\t\t\ttop += element.offsetTop;\n\t\t\tleft += element.offsetLeft;\n\t\t\toffsetParent = element.offsetParent;\n\t\t}\n\t}\n\n\treturn {\n\t\tleft: left,\n\t\ttop: top\n\t};\n}\n\nexport interface IDomNodePagePosition {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n}\n\nexport function size(element: HTMLElement, width: number | null, height: number | null): void {\n\tif (typeof width === 'number') {\n\t\telement.style.width = `${width}px`;\n\t}\n\n\tif (typeof height === 'number') {\n\t\telement.style.height = `${height}px`;\n\t}\n}\n\n/**\n * Returns the position of a dom node relative to the entire page.\n */\nexport function getDomNodePagePosition(domNode: HTMLElement): IDomNodePagePosition {\n\tlet bb = domNode.getBoundingClientRect();\n\treturn {\n\t\tleft: bb.left + StandardWindow.scrollX,\n\t\ttop: bb.top + StandardWindow.scrollY,\n\t\twidth: bb.width,\n\t\theight: bb.height\n\t};\n}\n\nexport interface IStandardWindow {\n\treadonly scrollX: number;\n\treadonly scrollY: number;\n}\n\nexport const StandardWindow: IStandardWindow = new class implements IStandardWindow {\n\tget scrollX(): number {\n\t\tif (typeof window.scrollX === 'number') {\n\t\t\t// modern browsers\n\t\t\treturn window.scrollX;\n\t\t} else {\n\t\t\treturn document.body.scrollLeft + document.documentElement!.scrollLeft;\n\t\t}\n\t}\n\n\tget scrollY(): number {\n\t\tif (typeof window.scrollY === 'number') {\n\t\t\t// modern browsers\n\t\t\treturn window.scrollY;\n\t\t} else {\n\t\t\treturn document.body.scrollTop + document.documentElement!.scrollTop;\n\t\t}\n\t}\n};\n\n// Adapted from WinJS\n// Gets the width of the element, including margins.\nexport function getTotalWidth(element: HTMLElement): number {\n\tlet margin = SizeUtils.getMarginLeft(element) + SizeUtils.getMarginRight(element);\n\treturn element.offsetWidth + margin;\n}\n\nexport function getContentWidth(element: HTMLElement): number {\n\tlet border = SizeUtils.getBorderLeftWidth(element) + SizeUtils.getBorderRightWidth(element);\n\tlet padding = SizeUtils.getPaddingLeft(element) + SizeUtils.getPaddingRight(element);\n\treturn element.offsetWidth - border - padding;\n}\n\n// Adapted from WinJS\n// Gets the height of the content of the specified element. The content height does not include borders or padding.\nexport function getContentHeight(element: HTMLElement): number {\n\tlet border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element);\n\tlet padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element);\n\treturn element.offsetHeight - border - padding;\n}\n\n// Adapted from WinJS\n// Gets the height of the element, including its margins.\nexport function getTotalHeight(element: HTMLElement): number {\n\tlet margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element);\n\treturn element.offsetHeight + margin;\n}\n\n// ----------------------------------------------------------------------------------------\n\nexport function isAncestor(testChild: Node | null, testAncestor: Node | null): boolean {\n\twhile (testChild) {\n\t\tif (testChild === testAncestor) {\n\t\t\treturn true;\n\t\t}\n\t\ttestChild = testChild.parentNode;\n\t}\n\n\treturn false;\n}\n\nexport function findParentWithClass(node: HTMLElement, clazz: string, stopAtClazzOrNode?: string | HTMLElement): HTMLElement | null {\n\twhile (node && node.nodeType === node.ELEMENT_NODE) {\n\t\tif (node.classList.contains(clazz)) {\n\t\t\treturn node;\n\t\t}\n\n\t\tif (stopAtClazzOrNode) {\n\t\t\tif (typeof stopAtClazzOrNode === 'string') {\n\t\t\t\tif (node.classList.contains(stopAtClazzOrNode)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (node === stopAtClazzOrNode) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tnode = <HTMLElement>node.parentNode;\n\t}\n\n\treturn null;\n}\n\nexport function hasParentWithClass(node: HTMLElement, clazz: string, stopAtClazzOrNode?: string | HTMLElement): boolean {\n\treturn !!findParentWithClass(node, clazz, stopAtClazzOrNode);\n}\n\nexport function isShadowRoot(node: Node): node is ShadowRoot {\n\treturn (\n\t\tnode && !!(<ShadowRoot>node).host && !!(<ShadowRoot>node).mode\n\t);\n}\n\nexport function isInShadowDOM(domNode: Node): boolean {\n\treturn !!getShadowRoot(domNode);\n}\n\nexport function getShadowRoot(domNode: Node): ShadowRoot | null {\n\twhile (domNode.parentNode) {\n\t\tif (domNode === document.body) {\n\t\t\t// reached the body\n\t\t\treturn null;\n\t\t}\n\t\tdomNode = domNode.parentNode;\n\t}\n\treturn isShadowRoot(domNode) ? domNode : null;\n}\n\nexport function getActiveElement(): Element | null {\n\tlet result = document.activeElement;\n\n\twhile (result?.shadowRoot) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\n\treturn result;\n}\n\nexport function createStyleSheet(container: HTMLElement = document.getElementsByTagName('head')[0]): HTMLStyleElement {\n\tlet style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.media = 'screen';\n\tcontainer.appendChild(style);\n\treturn style;\n}\n\nlet _sharedStyleSheet: HTMLStyleElement | null = null;\nfunction getSharedStyleSheet(): HTMLStyleElement {\n\tif (!_sharedStyleSheet) {\n\t\t_sharedStyleSheet = createStyleSheet();\n\t}\n\treturn _sharedStyleSheet;\n}\n\nfunction getDynamicStyleSheetRules(style: any) {\n\tif (style?.sheet?.rules) {\n\t\t// Chrome, IE\n\t\treturn style.sheet.rules;\n\t}\n\tif (style?.sheet?.cssRules) {\n\t\t// FF\n\t\treturn style.sheet.cssRules;\n\t}\n\treturn [];\n}\n\nexport function createCSSRule(selector: string, cssText: string, style: HTMLStyleElement = getSharedStyleSheet()): void {\n\tif (!style || !cssText) {\n\t\treturn;\n\t}\n\n\t(<CSSStyleSheet>style.sheet).insertRule(selector + '{' + cssText + '}', 0);\n}\n\nexport function removeCSSRulesContainingSelector(ruleName: string, style: HTMLStyleElement = getSharedStyleSheet()): void {\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tlet rules = getDynamicStyleSheetRules(style);\n\tlet toDelete: number[] = [];\n\tfor (let i = 0; i < rules.length; i++) {\n\t\tlet rule = rules[i];\n\t\tif (rule.selectorText.indexOf(ruleName) !== -1) {\n\t\t\ttoDelete.push(i);\n\t\t}\n\t}\n\n\tfor (let i = toDelete.length - 1; i >= 0; i--) {\n\t\t(<any>style.sheet).deleteRule(toDelete[i]);\n\t}\n}\n\nexport function isHTMLElement(o: any): o is HTMLElement {\n\tif (typeof HTMLElement === 'object') {\n\t\treturn o instanceof HTMLElement;\n\t}\n\treturn o && typeof o === 'object' && o.nodeType === 1 && typeof o.nodeName === 'string';\n}\n\nexport const EventType = {\n\t// Mouse\n\tCLICK: 'click',\n\tAUXCLICK: 'auxclick',\n\tDBLCLICK: 'dblclick',\n\tMOUSE_UP: 'mouseup',\n\tMOUSE_DOWN: 'mousedown',\n\tMOUSE_OVER: 'mouseover',\n\tMOUSE_MOVE: 'mousemove',\n\tMOUSE_OUT: 'mouseout',\n\tMOUSE_ENTER: 'mouseenter',\n\tMOUSE_LEAVE: 'mouseleave',\n\tMOUSE_WHEEL: 'wheel',\n\tPOINTER_UP: 'pointerup',\n\tPOINTER_DOWN: 'pointerdown',\n\tPOINTER_MOVE: 'pointermove',\n\tCONTEXT_MENU: 'contextmenu',\n\tWHEEL: 'wheel',\n\t// Keyboard\n\tKEY_DOWN: 'keydown',\n\tKEY_PRESS: 'keypress',\n\tKEY_UP: 'keyup',\n\t// HTML Document\n\tLOAD: 'load',\n\tBEFORE_UNLOAD: 'beforeunload',\n\tUNLOAD: 'unload',\n\tPAGE_SHOW: 'pageshow',\n\tPAGE_HIDE: 'pagehide',\n\tABORT: 'abort',\n\tERROR: 'error',\n\tRESIZE: 'resize',\n\tSCROLL: 'scroll',\n\tFULLSCREEN_CHANGE: 'fullscreenchange',\n\tWK_FULLSCREEN_CHANGE: 'webkitfullscreenchange',\n\t// Form\n\tSELECT: 'select',\n\tCHANGE: 'change',\n\tSUBMIT: 'submit',\n\tRESET: 'reset',\n\tFOCUS: 'focus',\n\tFOCUS_IN: 'focusin',\n\tFOCUS_OUT: 'focusout',\n\tBLUR: 'blur',\n\tINPUT: 'input',\n\t// Local Storage\n\tSTORAGE: 'storage',\n\t// Drag\n\tDRAG_START: 'dragstart',\n\tDRAG: 'drag',\n\tDRAG_ENTER: 'dragenter',\n\tDRAG_LEAVE: 'dragleave',\n\tDRAG_OVER: 'dragover',\n\tDROP: 'drop',\n\tDRAG_END: 'dragend',\n\t// Animation\n\tANIMATION_START: browser.isWebKit ? 'webkitAnimationStart' : 'animationstart',\n\tANIMATION_END: browser.isWebKit ? 'webkitAnimationEnd' : 'animationend',\n\tANIMATION_ITERATION: browser.isWebKit ? 'webkitAnimationIteration' : 'animationiteration'\n} as const;\n\nexport interface EventLike {\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport const EventHelper = {\n\tstop: function (e: EventLike, cancelBubble?: boolean) {\n\t\tif (e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t} else {\n\t\t\t// IE8\n\t\t\t(<any>e).returnValue = false;\n\t\t}\n\n\t\tif (cancelBubble) {\n\t\t\tif (e.stopPropagation) {\n\t\t\t\te.stopPropagation();\n\t\t\t} else {\n\t\t\t\t// IE8\n\t\t\t\t(<any>e).cancelBubble = true;\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport interface IFocusTracker extends Disposable {\n\tonDidFocus: event.Event<void>;\n\tonDidBlur: event.Event<void>;\n}\n\nexport function saveParentsScrollTop(node: Element): number[] {\n\tlet r: number[] = [];\n\tfor (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) {\n\t\tr[i] = node.scrollTop;\n\t\tnode = <Element>node.parentNode;\n\t}\n\treturn r;\n}\n\nexport function restoreParentsScrollTop(node: Element, state: number[]): void {\n\tfor (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) {\n\t\tif (node.scrollTop !== state[i]) {\n\t\t\tnode.scrollTop = state[i];\n\t\t}\n\t\tnode = <Element>node.parentNode;\n\t}\n}\n\nclass FocusTracker extends Disposable implements IFocusTracker {\n\n\tprivate readonly _onDidFocus = this._register(new event.Emitter<void>());\n\tpublic readonly onDidFocus: event.Event<void> = this._onDidFocus.event;\n\n\tprivate readonly _onDidBlur = this._register(new event.Emitter<void>());\n\tpublic readonly onDidBlur: event.Event<void> = this._onDidBlur.event;\n\n\tprivate _refreshStateHandler: () => void;\n\n\tprivate static hasFocusWithin(element: HTMLElement): boolean {\n\t\tconst shadowRoot = getShadowRoot(element);\n\t\tconst activeElement = (shadowRoot ? shadowRoot.activeElement : document.activeElement);\n\t\treturn isAncestor(activeElement, element);\n\t}\n\n\tconstructor(element: HTMLElement | Window) {\n\t\tsuper();\n\t\tlet hasFocus = FocusTracker.hasFocusWithin(<HTMLElement>element);\n\t\tlet loosingFocus = false;\n\n\t\tconst onFocus = () => {\n\t\t\tloosingFocus = false;\n\t\t\tif (!hasFocus) {\n\t\t\t\thasFocus = true;\n\t\t\t\tthis._onDidFocus.fire();\n\t\t\t}\n\t\t};\n\n\t\tconst onBlur = () => {\n\t\t\tif (hasFocus) {\n\t\t\t\tloosingFocus = true;\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\tif (loosingFocus) {\n\t\t\t\t\t\tloosingFocus = false;\n\t\t\t\t\t\thasFocus = false;\n\t\t\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t};\n\n\t\tthis._refreshStateHandler = () => {\n\t\t\tlet currentNodeHasFocus = FocusTracker.hasFocusWithin(<HTMLElement>element);\n\t\t\tif (currentNodeHasFocus !== hasFocus) {\n\t\t\t\tif (hasFocus) {\n\t\t\t\t\tonBlur();\n\t\t\t\t} else {\n\t\t\t\t\tonFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis._register(addDisposableListener(element, EventType.FOCUS, onFocus, true));\n\t\tthis._register(addDisposableListener(element, EventType.BLUR, onBlur, true));\n\t\tthis._register(addDisposableListener(element, EventType.FOCUS_IN, () => this._refreshStateHandler()));\n\t\tthis._register(addDisposableListener(element, EventType.FOCUS_OUT, () => this._refreshStateHandler()));\n\t}\n}\n\nexport function trackFocus(element: HTMLElement | Window): IFocusTracker {\n\treturn new FocusTracker(element);\n}\n\nexport function append<T extends Node>(parent: HTMLElement, child: T): T;\nexport function append<T extends Node>(parent: HTMLElement, ...children: (T | string)[]): void;\nexport function append<T extends Node>(parent: HTMLElement, ...children: (T | string)[]): T | void {\n\tparent.append(...children);\n\tif (children.length === 1 && typeof children[0] !== 'string') {\n\t\treturn <T>children[0];\n\t}\n}\n\nexport function prepend<T extends Node>(parent: HTMLElement, child: T): T {\n\tparent.insertBefore(child, parent.firstChild);\n\treturn child;\n}\n\n/**\n * Removes all children from `parent` and appends `children`\n */\nexport function reset(parent: HTMLElement, ...children: Array<Node | string>): void {\n\tparent.innerText = '';\n\tappend(parent, ...children);\n}\n\nconst SELECTOR_REGEX = /([\\w\\-]+)?(#([\\w\\-]+))?((\\.([\\w\\-]+))*)/;\n\nexport enum Namespace {\n\tHTML = 'http://www.w3.org/1999/xhtml',\n\tSVG = 'http://www.w3.org/2000/svg'\n}\n\nfunction _$<T extends Element>(namespace: Namespace, description: string, attrs?: { [key: string]: any }, ...children: Array<Node | string>): T {\n\tlet match = SELECTOR_REGEX.exec(description);\n\n\tif (!match) {\n\t\tthrow new Error('Bad use of emmet');\n\t}\n\n\tattrs = { ...(attrs || {}) };\n\n\tlet tagName = match[1] || 'div';\n\tlet result: T;\n\n\tif (namespace !== Namespace.HTML) {\n\t\tresult = document.createElementNS(namespace as string, tagName) as T;\n\t} else {\n\t\tresult = document.createElement(tagName) as unknown as T;\n\t}\n\n\tif (match[3]) {\n\t\tresult.id = match[3];\n\t}\n\tif (match[4]) {\n\t\tresult.className = match[4].replace(/\\./g, ' ').trim();\n\t}\n\n\tObject.keys(attrs).forEach(name => {\n\t\tconst value = attrs![name];\n\n\t\tif (typeof value === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (/^on\\w+$/.test(name)) {\n\t\t\t(<any>result)[name] = value;\n\t\t} else if (name === 'selected') {\n\t\t\tif (value) {\n\t\t\t\tresult.setAttribute(name, 'true');\n\t\t\t}\n\n\t\t} else {\n\t\t\tresult.setAttribute(name, value);\n\t\t}\n\t});\n\n\tresult.append(...children);\n\n\treturn result as T;\n}\n\nexport function $<T extends HTMLElement>(description: string, attrs?: { [key: string]: any }, ...children: Array<Node | string>): T {\n\treturn _$(Namespace.HTML, description, attrs, ...children);\n}\n\n$.SVG = function <T extends SVGElement>(description: string, attrs?: { [key: string]: any }, ...children: Array<Node | string>): T {\n\treturn _$(Namespace.SVG, description, attrs, ...children);\n};\n\nexport function show(...elements: HTMLElement[]): void {\n\tfor (let element of elements) {\n\t\telement.style.display = '';\n\t\telement.removeAttribute('aria-hidden');\n\t}\n}\n\nexport function hide(...elements: HTMLElement[]): void {\n\tfor (let element of elements) {\n\t\telement.style.display = 'none';\n\t\telement.setAttribute('aria-hidden', 'true');\n\t}\n}\n\nexport function getElementsByTagName(tag: string): HTMLElement[] {\n\treturn Array.prototype.slice.call(document.getElementsByTagName(tag), 0);\n}\n\n/**\n * Find a value usable for a dom node size such that the likelihood that it would be\n * displayed with constant screen pixels size is as high as possible.\n *\n * e.g. We would desire for the cursors to be 2px (CSS px) wide. Under a devicePixelRatio\n * of 1.25, the cursor will be 2.5 screen pixels wide. Depending on how the dom node aligns/\"snaps\"\n * with the screen pixels, it will sometimes be rendered with 2 screen pixels, and sometimes with 3 screen pixels.\n */\nexport function computeScreenAwareSize(cssPx: number): number {\n\tconst screenPx = window.devicePixelRatio * cssPx;\n\treturn Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio;\n}\n\n/**\n * Open safely a new window. This is the best way to do so, but you cannot tell\n * if the window was opened or if it was blocked by the browser's popup blocker.\n * If you want to tell if the browser blocked the new window, use {@link windowOpenWithSuccess}.\n *\n * See https://github.com/microsoft/monaco-editor/issues/601\n * To protect against malicious code in the linked site, particularly phishing attempts,\n * the window.opener should be set to null to prevent the linked site from having access\n * to change the location of the current page.\n * See https://mathiasbynens.github.io/rel-noopener/\n */\nexport function windowOpenNoOpener(url: string): void {\n\t// By using 'noopener' in the `windowFeatures` argument, the newly created window will\n\t// not be able to use `window.opener` to reach back to the current page.\n\t// See https://stackoverflow.com/a/46958731\n\t// See https://developer.mozilla.org/en-US/docs/Web/API/Window/open#noopener\n\t// However, this also doesn't allow us to realize if the browser blocked\n\t// the creation of the window.\n\twindow.open(url, '_blank', 'noopener');\n}\n\nexport function animate(fn: () => void): IDisposable {\n\tconst step = () => {\n\t\tfn();\n\t\tstepDisposable = scheduleAtNextAnimationFrame(step);\n\t};\n\n\tlet stepDisposable = scheduleAtNextAnimationFrame(step);\n\treturn toDisposable(() => stepDisposable.dispose());\n}\n\nRemoteAuthorities.setPreferredWebSchema(/^https:/.test(window.location.href) ? 'https' : 'http');\n\n/**\n * returns url('...')\n */\nexport function asCSSUrl(uri: URI): string {\n\tif (!uri) {\n\t\treturn `url('')`;\n\t}\n\treturn `url('${FileAccess.asBrowserUri(uri).toString(true).replace(/'/g, '%27')}')`;\n}\n\nexport function asCSSPropertyValue(value: string) {\n\treturn `'${value.replace(/'/g, '%27')}'`;\n}\n\ntype ModifierKey = 'alt' | 'ctrl' | 'shift' | 'meta';\n\nexport interface IModifierKeyStatus {\n\taltKey: boolean;\n\tshiftKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tlastKeyPressed?: ModifierKey;\n\tlastKeyReleased?: ModifierKey;\n\tevent?: KeyboardEvent;\n}\n\nexport class ModifierKeyEmitter extends event.Emitter<IModifierKeyStatus> {\n\n\tprivate readonly _subscriptions = new DisposableStore();\n\tprivate _keyStatus: IModifierKeyStatus;\n\tprivate static instance: ModifierKeyEmitter;\n\n\tprivate constructor() {\n\t\tsuper();\n\n\t\tthis._keyStatus = {\n\t\t\taltKey: false,\n\t\t\tshiftKey: false,\n\t\t\tctrlKey: false,\n\t\t\tmetaKey: false\n\t\t};\n\n\t\tthis._subscriptions.add(addDisposableListener(window, 'keydown', e => {\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\t// If Alt-key keydown event is repeated, ignore it #112347\n\t\t\t// Only known to be necessary for Alt-Key at the moment #115810\n\t\t\tif (event.keyCode === KeyCode.Alt && e.repeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (e.altKey && !this._keyStatus.altKey) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = 'alt';\n\t\t\t} else if (e.ctrlKey && !this._keyStatus.ctrlKey) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = 'ctrl';\n\t\t\t} else if (e.metaKey && !this._keyStatus.metaKey) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = 'meta';\n\t\t\t} else if (e.shiftKey && !this._keyStatus.shiftKey) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = 'shift';\n\t\t\t} else if (event.keyCode !== KeyCode.Alt) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = undefined;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._keyStatus.altKey = e.altKey;\n\t\t\tthis._keyStatus.ctrlKey = e.ctrlKey;\n\t\t\tthis._keyStatus.metaKey = e.metaKey;\n\t\t\tthis._keyStatus.shiftKey = e.shiftKey;\n\n\t\t\tif (this._keyStatus.lastKeyPressed) {\n\t\t\t\tthis._keyStatus.event = e;\n\t\t\t\tthis.fire(this._keyStatus);\n\t\t\t}\n\t\t}, true));\n\n\t\tthis._subscriptions.add(addDisposableListener(window, 'keyup', e => {\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!e.altKey && this._keyStatus.altKey) {\n\t\t\t\tthis._keyStatus.lastKeyReleased = 'alt';\n\t\t\t} else if (!e.ctrlKey && this._keyStatus.ctrlKey) {\n\t\t\t\tthis._keyStatus.lastKeyReleased = 'ctrl';\n\t\t\t} else if (!e.metaKey && this._keyStatus.metaKey) {\n\t\t\t\tthis._keyStatus.lastKeyReleased = 'meta';\n\t\t\t} else if (!e.shiftKey && this._keyStatus.shiftKey) {\n\t\t\t\tthis._keyStatus.lastKeyReleased = 'shift';\n\t\t\t} else {\n\t\t\t\tthis._keyStatus.lastKeyReleased = undefined;\n\t\t\t}\n\n\t\t\tif (this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = undefined;\n\t\t\t}\n\n\t\t\tthis._keyStatus.altKey = e.altKey;\n\t\t\tthis._keyStatus.ctrlKey = e.ctrlKey;\n\t\t\tthis._keyStatus.metaKey = e.metaKey;\n\t\t\tthis._keyStatus.shiftKey = e.shiftKey;\n\n\t\t\tif (this._keyStatus.lastKeyReleased) {\n\t\t\t\tthis._keyStatus.event = e;\n\t\t\t\tthis.fire(this._keyStatus);\n\t\t\t}\n\t\t}, true));\n\n\t\tthis._subscriptions.add(addDisposableListener(document.body, 'mousedown', () => {\n\t\t\tthis._keyStatus.lastKeyPressed = undefined;\n\t\t}, true));\n\n\t\tthis._subscriptions.add(addDisposableListener(document.body, 'mouseup', () => {\n\t\t\tthis._keyStatus.lastKeyPressed = undefined;\n\t\t}, true));\n\n\t\tthis._subscriptions.add(addDisposableListener(document.body, 'mousemove', e => {\n\t\t\tif (e.buttons) {\n\t\t\t\tthis._keyStatus.lastKeyPressed = undefined;\n\t\t\t}\n\t\t}, true));\n\n\t\tthis._subscriptions.add(addDisposableListener(window, 'blur', () => {\n\t\t\tthis.resetKeyStatus();\n\t\t}));\n\t}\n\n\tget keyStatus(): IModifierKeyStatus {\n\t\treturn this._keyStatus;\n\t}\n\n\t/**\n\t * Allows to explicitly reset the key status based on more knowledge (#109062)\n\t */\n\tresetKeyStatus(): void {\n\t\tthis.doResetKeyStatus();\n\t\tthis.fire(this._keyStatus);\n\t}\n\n\tprivate doResetKeyStatus(): void {\n\t\tthis._keyStatus = {\n\t\t\taltKey: false,\n\t\t\tshiftKey: false,\n\t\t\tctrlKey: false,\n\t\t\tmetaKey: false\n\t\t};\n\t}\n\n\tstatic getInstance() {\n\t\tif (!ModifierKeyEmitter.instance) {\n\t\t\tModifierKeyEmitter.instance = new ModifierKeyEmitter();\n\t\t}\n\n\t\treturn ModifierKeyEmitter.instance;\n\t}\n\n\toverride dispose() {\n\t\tsuper.dispose();\n\t\tthis._subscriptions.dispose();\n\t}\n}\n\nexport function addMatchMediaChangeListener(query: string, callback: () => void): void {\n\tconst mediaQueryList = window.matchMedia(query);\n\tmediaQueryList.addEventListener('change', callback);\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 * as DOM from 'vs/base/browser/dom';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\n\nexport interface IContentActionHandler {\n\tcallback: (content: string, event?: IMouseEvent) => void;\n\treadonly disposables: DisposableStore;\n}\n\nexport interface FormattedTextRenderOptions {\n\treadonly className?: string;\n\treadonly inline?: boolean;\n\treadonly actionHandler?: IContentActionHandler;\n\treadonly renderCodeSegments?: boolean;\n}\n\nexport function renderText(text: string, options: FormattedTextRenderOptions = {}): HTMLElement {\n\tconst element = createElement(options);\n\telement.textContent = text;\n\treturn element;\n}\n\nexport function renderFormattedText(formattedText: string, options: FormattedTextRenderOptions = {}): HTMLElement {\n\tconst element = createElement(options);\n\t_renderFormattedText(element, parseFormattedText(formattedText, !!options.renderCodeSegments), options.actionHandler, options.renderCodeSegments);\n\treturn element;\n}\n\nexport function createElement(options: FormattedTextRenderOptions): HTMLElement {\n\tconst tagName = options.inline ? 'span' : 'div';\n\tconst element = document.createElement(tagName);\n\tif (options.className) {\n\t\telement.className = options.className;\n\t}\n\treturn element;\n}\n\nclass StringStream {\n\tprivate source: string;\n\tprivate index: number;\n\n\tconstructor(source: string) {\n\t\tthis.source = source;\n\t\tthis.index = 0;\n\t}\n\n\tpublic eos(): boolean {\n\t\treturn this.index >= this.source.length;\n\t}\n\n\tpublic next(): string {\n\t\tconst next = this.peek();\n\t\tthis.advance();\n\t\treturn next;\n\t}\n\n\tpublic peek(): string {\n\t\treturn this.source[this.index];\n\t}\n\n\tpublic advance(): void {\n\t\tthis.index++;\n\t}\n}\n\nconst enum FormatType {\n\tInvalid,\n\tRoot,\n\tText,\n\tBold,\n\tItalics,\n\tAction,\n\tActionClose,\n\tCode,\n\tNewLine\n}\n\ninterface IFormatParseTree {\n\ttype: FormatType;\n\tcontent?: string;\n\tindex?: number;\n\tchildren?: IFormatParseTree[];\n}\n\nfunction _renderFormattedText(element: Node, treeNode: IFormatParseTree, actionHandler?: IContentActionHandler, renderCodeSegments?: boolean) {\n\tlet child: Node | undefined;\n\n\tif (treeNode.type === FormatType.Text) {\n\t\tchild = document.createTextNode(treeNode.content || '');\n\t} else if (treeNode.type === FormatType.Bold) {\n\t\tchild = document.createElement('b');\n\t} else if (treeNode.type === FormatType.Italics) {\n\t\tchild = document.createElement('i');\n\t} else if (treeNode.type === FormatType.Code && renderCodeSegments) {\n\t\tchild = document.createElement('code');\n\t} else if (treeNode.type === FormatType.Action && actionHandler) {\n\t\tconst a = document.createElement('a');\n\t\tactionHandler.disposables.add(DOM.addStandardDisposableListener(a, 'click', (event) => {\n\t\t\tactionHandler.callback(String(treeNode.index), event);\n\t\t}));\n\n\t\tchild = a;\n\t} else if (treeNode.type === FormatType.NewLine) {\n\t\tchild = document.createElement('br');\n\t} else if (treeNode.type === FormatType.Root) {\n\t\tchild = element;\n\t}\n\n\tif (child && element !== child) {\n\t\telement.appendChild(child);\n\t}\n\n\tif (child && Array.isArray(treeNode.children)) {\n\t\ttreeNode.children.forEach((nodeChild) => {\n\t\t\t_renderFormattedText(child!, nodeChild, actionHandler, renderCodeSegments);\n\t\t});\n\t}\n}\n\nfunction parseFormattedText(content: string, parseCodeSegments: boolean): IFormatParseTree {\n\n\tconst root: IFormatParseTree = {\n\t\ttype: FormatType.Root,\n\t\tchildren: []\n\t};\n\n\tlet actionViewItemIndex = 0;\n\tlet current = root;\n\tconst stack: IFormatParseTree[] = [];\n\tconst stream = new StringStream(content);\n\n\twhile (!stream.eos()) {\n\t\tlet next = stream.next();\n\n\t\tconst isEscapedFormatType = (next === '\\\\' && formatTagType(stream.peek(), parseCodeSegments) !== FormatType.Invalid);\n\t\tif (isEscapedFormatType) {\n\t\t\tnext = stream.next(); // unread the backslash if it escapes a format tag type\n\t\t}\n\n\t\tif (!isEscapedFormatType && isFormatTag(next, parseCodeSegments) && next === stream.peek()) {\n\t\t\tstream.advance();\n\n\t\t\tif (current.type === FormatType.Text) {\n\t\t\t\tcurrent = stack.pop()!;\n\t\t\t}\n\n\t\t\tconst type = formatTagType(next, parseCodeSegments);\n\t\t\tif (current.type === type || (current.type === FormatType.Action && type === FormatType.ActionClose)) {\n\t\t\t\tcurrent = stack.pop()!;\n\t\t\t} else {\n\t\t\t\tconst newCurrent: IFormatParseTree = {\n\t\t\t\t\ttype: type,\n\t\t\t\t\tchildren: []\n\t\t\t\t};\n\n\t\t\t\tif (type === FormatType.Action) {\n\t\t\t\t\tnewCurrent.index = actionViewItemIndex;\n\t\t\t\t\tactionViewItemIndex++;\n\t\t\t\t}\n\n\t\t\t\tcurrent.children!.push(newCurrent);\n\t\t\t\tstack.push(current);\n\t\t\t\tcurrent = newCurrent;\n\t\t\t}\n\t\t} else if (next === '\\n') {\n\t\t\tif (current.type === FormatType.Text) {\n\t\t\t\tcurrent = stack.pop()!;\n\t\t\t}\n\n\t\t\tcurrent.children!.push({\n\t\t\t\ttype: FormatType.NewLine\n\t\t\t});\n\n\t\t} else {\n\t\t\tif (current.type !== FormatType.Text) {\n\t\t\t\tconst textCurrent: IFormatParseTree = {\n\t\t\t\t\ttype: FormatType.Text,\n\t\t\t\t\tcontent: next\n\t\t\t\t};\n\t\t\t\tcurrent.children!.push(textCurrent);\n\t\t\t\tstack.push(current);\n\t\t\t\tcurrent = textCurrent;\n\n\t\t\t} else {\n\t\t\t\tcurrent.content += next;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (current.type === FormatType.Text) {\n\t\tcurrent = stack.pop()!;\n\t}\n\n\tif (stack.length) {\n\t\t// incorrectly formatted string literal\n\t}\n\n\treturn root;\n}\n\nfunction isFormatTag(char: string, supportCodeSegments: boolean): boolean {\n\treturn formatTagType(char, supportCodeSegments) !== FormatType.Invalid;\n}\n\nfunction formatTagType(char: string, supportCodeSegments: boolean): FormatType {\n\tswitch (char) {\n\t\tcase '*':\n\t\t\treturn FormatType.Bold;\n\t\tcase '_':\n\t\t\treturn FormatType.Italics;\n\t\tcase '[':\n\t\t\treturn FormatType.Action;\n\t\tcase ']':\n\t\t\treturn FormatType.ActionClose;\n\t\tcase '`':\n\t\t\treturn supportCodeSegments ? FormatType.Code : FormatType.Invalid;\n\t\tdefault:\n\t\t\treturn FormatType.Invalid;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IframeUtils } from 'vs/base/browser/iframe';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { isIOS } from 'vs/base/common/platform';\n\nexport interface IStandardMouseMoveEventData {\n\tleftButton: boolean;\n\tbuttons: number;\n\tposx: number;\n\tposy: number;\n}\n\nexport interface IEventMerger<R> {\n\t(lastEvent: R | null, currentEvent: MouseEvent): R;\n}\n\nexport interface IMouseMoveCallback<R> {\n\t(mouseMoveData: R): void;\n}\n\nexport interface IOnStopCallback {\n\t(browserEvent?: MouseEvent | KeyboardEvent): void;\n}\n\nexport function standardMouseMoveMerger(lastEvent: IStandardMouseMoveEventData | null, currentEvent: MouseEvent): IStandardMouseMoveEventData {\n\tlet ev = new StandardMouseEvent(currentEvent);\n\tev.preventDefault();\n\treturn {\n\t\tleftButton: ev.leftButton,\n\t\tbuttons: ev.buttons,\n\t\tposx: ev.posx,\n\t\tposy: ev.posy\n\t};\n}\n\nexport class GlobalMouseMoveMonitor<R extends { buttons: number }> implements IDisposable {\n\n\tprivate readonly _hooks = new DisposableStore();\n\tprivate _mouseMoveEventMerger: IEventMerger<R> | null = null;\n\tprivate _mouseMoveCallback: IMouseMoveCallback<R> | null = null;\n\tprivate _onStopCallback: IOnStopCallback | null = null;\n\n\tpublic dispose(): void {\n\t\tthis.stopMonitoring(false);\n\t\tthis._hooks.dispose();\n\t}\n\n\tpublic stopMonitoring(invokeStopCallback: boolean, browserEvent?: MouseEvent | KeyboardEvent): void {\n\t\tif (!this.isMonitoring()) {\n\t\t\t// Not monitoring\n\t\t\treturn;\n\t\t}\n\n\t\t// Unhook\n\t\tthis._hooks.clear();\n\t\tthis._mouseMoveEventMerger = null;\n\t\tthis._mouseMoveCallback = null;\n\t\tconst onStopCallback = this._onStopCallback;\n\t\tthis._onStopCallback = null;\n\n\t\tif (invokeStopCallback && onStopCallback) {\n\t\t\tonStopCallback(browserEvent);\n\t\t}\n\t}\n\n\tpublic isMonitoring(): boolean {\n\t\treturn !!this._mouseMoveEventMerger;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: HTMLElement,\n\t\tinitialButtons: number,\n\t\tmouseMoveEventMerger: IEventMerger<R>,\n\t\tmouseMoveCallback: IMouseMoveCallback<R>,\n\t\tonStopCallback: IOnStopCallback\n\t): void {\n\t\tif (this.isMonitoring()) {\n\t\t\t// I am already hooked\n\t\t\treturn;\n\t\t}\n\t\tthis._mouseMoveEventMerger = mouseMoveEventMerger;\n\t\tthis._mouseMoveCallback = mouseMoveCallback;\n\t\tthis._onStopCallback = onStopCallback;\n\n\t\tconst windowChain = IframeUtils.getSameOriginWindowChain();\n\t\tconst mouseMove = isIOS ? 'pointermove' : 'mousemove'; // Safari sends wrong event, workaround for #122653\n\t\tconst mouseUp = 'mouseup';\n\n\t\tconst listenTo: (Document | ShadowRoot)[] = windowChain.map(element => element.window.document);\n\t\tconst shadowRoot = dom.getShadowRoot(initialElement);\n\t\tif (shadowRoot) {\n\t\t\tlistenTo.unshift(shadowRoot);\n\t\t}\n\n\t\tfor (const element of listenTo) {\n\t\t\tthis._hooks.add(dom.addDisposableThrottledListener(element, mouseMove,\n\t\t\t\t(data: R) => {\n\t\t\t\t\tif (data.buttons !== initialButtons) {\n\t\t\t\t\t\t// Buttons state has changed in the meantime\n\t\t\t\t\t\tthis.stopMonitoring(true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._mouseMoveCallback!(data);\n\t\t\t\t},\n\t\t\t\t(lastEvent: R | null, currentEvent) => this._mouseMoveEventMerger!(lastEvent, currentEvent as MouseEvent)\n\t\t\t));\n\t\t\tthis._hooks.add(dom.addDisposableListener(element, mouseUp, (e: MouseEvent) => this.stopMonitoring(true)));\n\t\t}\n\n\t\tif (IframeUtils.hasDifferentOriginAncestor()) {\n\t\t\tlet lastSameOriginAncestor = windowChain[windowChain.length - 1];\n\t\t\t// We might miss a mouse up if it happens outside the iframe\n\t\t\t// This one is for Chrome\n\t\t\tthis._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent: MouseEvent) => {\n\t\t\t\tlet e = new StandardMouseEvent(browserEvent);\n\t\t\t\tif (e.target.tagName.toLowerCase() === 'html') {\n\t\t\t\t\tthis.stopMonitoring(true);\n\t\t\t\t}\n\t\t\t}));\n\t\t\t// This one is for FF\n\t\t\tthis._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent: MouseEvent) => {\n\t\t\t\tlet e = new StandardMouseEvent(browserEvent);\n\t\t\t\tif (e.target.tagName.toLowerCase() === 'html') {\n\t\t\t\t\tthis.stopMonitoring(true);\n\t\t\t\t}\n\t\t\t}));\n\t\t\t// This one is for IE\n\t\t\tthis._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent: MouseEvent) => {\n\t\t\t\tthis.stopMonitoring(true);\n\t\t\t}));\n\t\t}\n\t}\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 * as DomUtils from 'vs/base/browser/dom';\nimport * as arrays from 'vs/base/common/arrays';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\n\nexport namespace EventType {\n\texport const Tap = '-monaco-gesturetap';\n\texport const Change = '-monaco-gesturechange';\n\texport const Start = '-monaco-gesturestart';\n\texport const End = '-monaco-gesturesend';\n\texport const Contextmenu = '-monaco-gesturecontextmenu';\n}\n\ninterface TouchData {\n\tid: number;\n\tinitialTarget: EventTarget;\n\tinitialTimeStamp: number;\n\tinitialPageX: number;\n\tinitialPageY: number;\n\trollingTimestamps: number[];\n\trollingPageX: number[];\n\trollingPageY: number[];\n}\n\nexport interface GestureEvent extends MouseEvent {\n\tinitialTarget: EventTarget | undefined;\n\ttranslationX: number;\n\ttranslationY: number;\n\tpageX: number;\n\tpageY: number;\n\ttapCount: number;\n}\n\ninterface Touch {\n\tidentifier: number;\n\tpageX: number;\n\tpageY: number;\n\ttarget: Element;\n}\n\ninterface TouchList {\n\t[i: number]: Touch;\n\tlength: number;\n\titem(index: number): Touch;\n}\n\ninterface TouchEvent extends Event {\n\ttouches: TouchList;\n\ttargetTouches: TouchList;\n\tchangedTouches: TouchList;\n}\n\nexport class Gesture extends Disposable {\n\n\tprivate static readonly SCROLL_FRICTION = -0.005;\n\tprivate static INSTANCE: Gesture;\n\tprivate static readonly HOLD_DELAY = 700;\n\n\tprivate dispatched = false;\n\tprivate targets: HTMLElement[];\n\tprivate ignoreTargets: HTMLElement[];\n\tprivate handle: IDisposable | null;\n\n\tprivate activeTouches: { [id: number]: TouchData };\n\n\tprivate _lastSetTapCountTime: number;\n\n\tprivate static readonly CLEAR_TAP_COUNT_TIME = 400; // ms\n\n\n\tprivate constructor() {\n\t\tsuper();\n\n\t\tthis.activeTouches = {};\n\t\tthis.handle = null;\n\t\tthis.targets = [];\n\t\tthis.ignoreTargets = [];\n\t\tthis._lastSetTapCountTime = 0;\n\t\tthis._register(DomUtils.addDisposableListener(document, 'touchstart', (e: TouchEvent) => this.onTouchStart(e), { passive: false }));\n\t\tthis._register(DomUtils.addDisposableListener(document, 'touchend', (e: TouchEvent) => this.onTouchEnd(e)));\n\t\tthis._register(DomUtils.addDisposableListener(document, 'touchmove', (e: TouchEvent) => this.onTouchMove(e), { passive: false }));\n\t}\n\n\tpublic static addTarget(element: HTMLElement): IDisposable {\n\t\tif (!Gesture.isTouchDevice()) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tif (!Gesture.INSTANCE) {\n\t\t\tGesture.INSTANCE = new Gesture();\n\t\t}\n\n\t\tGesture.INSTANCE.targets.push(element);\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tGesture.INSTANCE.targets = Gesture.INSTANCE.targets.filter(t => t !== element);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic static ignoreTarget(element: HTMLElement): IDisposable {\n\t\tif (!Gesture.isTouchDevice()) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tif (!Gesture.INSTANCE) {\n\t\t\tGesture.INSTANCE = new Gesture();\n\t\t}\n\n\t\tGesture.INSTANCE.ignoreTargets.push(element);\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tGesture.INSTANCE.ignoreTargets = Gesture.INSTANCE.ignoreTargets.filter(t => t !== element);\n\t\t\t}\n\t\t};\n\t}\n\n\t@memoize\n\tstatic isTouchDevice(): boolean {\n\t\t// `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be\n\t\t// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast\n\t\treturn 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this.handle) {\n\t\t\tthis.handle.dispose();\n\t\t\tthis.handle = null;\n\t\t}\n\n\t\tsuper.dispose();\n\t}\n\n\tprivate onTouchStart(e: TouchEvent): void {\n\t\tlet timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n\n\t\tif (this.handle) {\n\t\t\tthis.handle.dispose();\n\t\t\tthis.handle = null;\n\t\t}\n\n\t\tfor (let i = 0, len = e.targetTouches.length; i < len; i++) {\n\t\t\tlet touch = e.targetTouches.item(i);\n\n\t\t\tthis.activeTouches[touch.identifier] = {\n\t\t\t\tid: touch.identifier,\n\t\t\t\tinitialTarget: touch.target,\n\t\t\t\tinitialTimeStamp: timestamp,\n\t\t\t\tinitialPageX: touch.pageX,\n\t\t\t\tinitialPageY: touch.pageY,\n\t\t\t\trollingTimestamps: [timestamp],\n\t\t\t\trollingPageX: [touch.pageX],\n\t\t\t\trollingPageY: [touch.pageY]\n\t\t\t};\n\n\t\t\tlet evt = this.newGestureEvent(EventType.Start, touch.target);\n\t\t\tevt.pageX = touch.pageX;\n\t\t\tevt.pageY = touch.pageY;\n\t\t\tthis.dispatchEvent(evt);\n\t\t}\n\n\t\tif (this.dispatched) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.dispatched = false;\n\t\t}\n\t}\n\n\tprivate onTouchEnd(e: TouchEvent): void {\n\t\tlet timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n\n\t\tlet activeTouchCount = Object.keys(this.activeTouches).length;\n\n\t\tfor (let i = 0, len = e.changedTouches.length; i < len; i++) {\n\n\t\t\tlet touch = e.changedTouches.item(i);\n\n\t\t\tif (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {\n\t\t\t\tconsole.warn('move of an UNKNOWN touch', touch);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet data = this.activeTouches[touch.identifier],\n\t\t\t\tholdTime = Date.now() - data.initialTimeStamp;\n\n\t\t\tif (holdTime < Gesture.HOLD_DELAY\n\t\t\t\t&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30\n\t\t\t\t&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {\n\n\t\t\t\tlet evt = this.newGestureEvent(EventType.Tap, data.initialTarget);\n\t\t\t\tevt.pageX = arrays.tail(data.rollingPageX);\n\t\t\t\tevt.pageY = arrays.tail(data.rollingPageY);\n\t\t\t\tthis.dispatchEvent(evt);\n\n\t\t\t} else if (holdTime >= Gesture.HOLD_DELAY\n\t\t\t\t&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30\n\t\t\t\t&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {\n\n\t\t\t\tlet evt = this.newGestureEvent(EventType.Contextmenu, data.initialTarget);\n\t\t\t\tevt.pageX = arrays.tail(data.rollingPageX);\n\t\t\t\tevt.pageY = arrays.tail(data.rollingPageY);\n\t\t\t\tthis.dispatchEvent(evt);\n\n\t\t\t} else if (activeTouchCount === 1) {\n\t\t\t\tlet finalX = arrays.tail(data.rollingPageX);\n\t\t\t\tlet finalY = arrays.tail(data.rollingPageY);\n\n\t\t\t\tlet deltaT = arrays.tail(data.rollingTimestamps) - data.rollingTimestamps[0];\n\t\t\t\tlet deltaX = finalX - data.rollingPageX[0];\n\t\t\t\tlet deltaY = finalY - data.rollingPageY[0];\n\n\t\t\t\t// We need to get all the dispatch targets on the start of the inertia event\n\t\t\t\tconst dispatchTo = this.targets.filter(t => data.initialTarget instanceof Node && t.contains(data.initialTarget));\n\t\t\t\tthis.inertia(dispatchTo, timestamp,\t\t// time now\n\t\t\t\t\tMath.abs(deltaX) / deltaT,\t// speed\n\t\t\t\t\tdeltaX > 0 ? 1 : -1,\t\t// x direction\n\t\t\t\t\tfinalX,\t\t\t\t\t\t// x now\n\t\t\t\t\tMath.abs(deltaY) / deltaT, // y speed\n\t\t\t\t\tdeltaY > 0 ? 1 : -1,\t\t// y direction\n\t\t\t\t\tfinalY\t\t\t\t\t\t// y now\n\t\t\t\t);\n\t\t\t}\n\n\n\t\t\tthis.dispatchEvent(this.newGestureEvent(EventType.End, data.initialTarget));\n\t\t\t// forget about this touch\n\t\t\tdelete this.activeTouches[touch.identifier];\n\t\t}\n\n\t\tif (this.dispatched) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.dispatched = false;\n\t\t}\n\t}\n\n\tprivate newGestureEvent(type: string, initialTarget?: EventTarget): GestureEvent {\n\t\tlet event = document.createEvent('CustomEvent') as unknown as GestureEvent;\n\t\tevent.initEvent(type, false, true);\n\t\tevent.initialTarget = initialTarget;\n\t\tevent.tapCount = 0;\n\t\treturn event;\n\t}\n\n\tprivate dispatchEvent(event: GestureEvent): void {\n\t\tif (event.type === EventType.Tap) {\n\t\t\tconst currentTime = (new Date()).getTime();\n\t\t\tlet setTapCount = 0;\n\t\t\tif (currentTime - this._lastSetTapCountTime > Gesture.CLEAR_TAP_COUNT_TIME) {\n\t\t\t\tsetTapCount = 1;\n\t\t\t} else {\n\t\t\t\tsetTapCount = 2;\n\t\t\t}\n\n\t\t\tthis._lastSetTapCountTime = currentTime;\n\t\t\tevent.tapCount = setTapCount;\n\t\t} else if (event.type === EventType.Change || event.type === EventType.Contextmenu) {\n\t\t\t// tap is canceled by scrolling or context menu\n\t\t\tthis._lastSetTapCountTime = 0;\n\t\t}\n\n\t\tfor (let i = 0; i < this.ignoreTargets.length; i++) {\n\t\t\tif (event.initialTarget instanceof Node && this.ignoreTargets[i].contains(event.initialTarget)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.targets.forEach(target => {\n\t\t\tif (event.initialTarget instanceof Node && target.contains(event.initialTarget)) {\n\t\t\t\ttarget.dispatchEvent(event);\n\t\t\t\tthis.dispatched = true;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate inertia(dispatchTo: EventTarget[], t1: number, vX: number, dirX: number, x: number, vY: number, dirY: number, y: number): void {\n\t\tthis.handle = DomUtils.scheduleAtNextAnimationFrame(() => {\n\t\t\tlet now = Date.now();\n\n\t\t\t// velocity: old speed + accel_over_time\n\t\t\tlet deltaT = now - t1,\n\t\t\t\tdelta_pos_x = 0, delta_pos_y = 0,\n\t\t\t\tstopped = true;\n\n\t\t\tvX += Gesture.SCROLL_FRICTION * deltaT;\n\t\t\tvY += Gesture.SCROLL_FRICTION * deltaT;\n\n\t\t\tif (vX > 0) {\n\t\t\t\tstopped = false;\n\t\t\t\tdelta_pos_x = dirX * vX * deltaT;\n\t\t\t}\n\n\t\t\tif (vY > 0) {\n\t\t\t\tstopped = false;\n\t\t\t\tdelta_pos_y = dirY * vY * deltaT;\n\t\t\t}\n\n\t\t\t// dispatch translation event\n\t\t\tlet evt = this.newGestureEvent(EventType.Change);\n\t\t\tevt.translationX = delta_pos_x;\n\t\t\tevt.translationY = delta_pos_y;\n\t\t\tdispatchTo.forEach(d => d.dispatchEvent(evt));\n\n\t\t\tif (!stopped) {\n\t\t\t\tthis.inertia(dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate onTouchMove(e: TouchEvent): void {\n\t\tlet timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n\n\t\tfor (let i = 0, len = e.changedTouches.length; i < len; i++) {\n\n\t\t\tlet touch = e.changedTouches.item(i);\n\n\t\t\tif (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {\n\t\t\t\tconsole.warn('end of an UNKNOWN touch', touch);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet data = this.activeTouches[touch.identifier];\n\n\t\t\tlet evt = this.newGestureEvent(EventType.Change, data.initialTarget);\n\t\t\tevt.translationX = touch.pageX - arrays.tail(data.rollingPageX);\n\t\t\tevt.translationY = touch.pageY - arrays.tail(data.rollingPageY);\n\t\t\tevt.pageX = touch.pageX;\n\t\t\tevt.pageY = touch.pageY;\n\t\t\tthis.dispatchEvent(evt);\n\n\t\t\t// only keep a few data points, to average the final speed\n\t\t\tif (data.rollingPageX.length > 3) {\n\t\t\t\tdata.rollingPageX.shift();\n\t\t\t\tdata.rollingPageY.shift();\n\t\t\t\tdata.rollingTimestamps.shift();\n\t\t\t}\n\n\t\t\tdata.rollingPageX.push(touch.pageX);\n\t\t\tdata.rollingPageY.push(touch.pageY);\n\t\t\tdata.rollingTimestamps.push(timestamp);\n\t\t}\n\n\t\tif (this.dispatched) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.dispatched = false;\n\t\t}\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { CSSIcon } from 'vs/base/common/codicons';\n\nconst labelWithIconsRegex = new RegExp(`(\\\\\\\\)?\\\\$\\\\((${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?)\\\\)`, 'g');\nexport function renderLabelWithIcons(text: string): Array<HTMLSpanElement | string> {\n\tconst elements = new Array<HTMLSpanElement | string>();\n\tlet match: RegExpMatchArray | null;\n\n\tlet textStart = 0, textStop = 0;\n\twhile ((match = labelWithIconsRegex.exec(text)) !== null) {\n\t\ttextStop = match.index || 0;\n\t\telements.push(text.substring(textStart, textStop));\n\t\ttextStart = (match.index || 0) + match[0].length;\n\n\t\tconst [, escaped, codicon] = match;\n\t\telements.push(escaped ? `$(${codicon})` : renderIcon({ id: codicon }));\n\t}\n\n\tif (textStart < text.length) {\n\t\telements.push(text.substring(textStart));\n\t}\n\treturn elements;\n}\n\nexport function renderIcon(icon: CSSIcon): HTMLSpanElement {\n\tconst node = dom.$(`span`);\n\tnode.classList.add(...CSSIcon.asClassNameArray(icon));\n\treturn node;\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 * as dom from 'vs/base/browser/dom';\nimport { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';\nimport * as objects from 'vs/base/common/objects';\n\n/**\n * A range to be highlighted.\n */\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n\textraClasses?: string[];\n}\n\nexport interface IOptions {\n\n\t/**\n\t * Whether\n\t */\n\treadonly supportIcons?: boolean;\n}\n\n/**\n * A widget which can render a label with substring highlights, often\n * originating from a filter function like the fuzzy matcher.\n */\nexport class HighlightedLabel {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate text: string = '';\n\tprivate title: string = '';\n\tprivate highlights: IHighlight[] = [];\n\tprivate supportIcons: boolean;\n\tprivate didEverRender: boolean = false;\n\n\t/**\n\t * Create a new {@link HighlightedLabel}.\n\t *\n\t * @param container The parent container to append to.\n\t */\n\tconstructor(container: HTMLElement, options?: IOptions) {\n\t\tthis.supportIcons = options?.supportIcons ?? false;\n\t\tthis.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));\n\t}\n\n\t/**\n\t * The label's DOM node.\n\t */\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\t/**\n\t * Set the label and highlights.\n\t *\n\t * @param text The label to display.\n\t * @param highlights The ranges to highlight.\n\t * @param title An optional title for the hover tooltip.\n\t * @param escapeNewLines Whether to escape new lines.\n\t * @returns\n\t */\n\tset(text: string | undefined, highlights: IHighlight[] = [], title: string = '', escapeNewLines?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\n\n\t\tif (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.text = text;\n\t\tthis.title = title;\n\t\tthis.highlights = highlights;\n\t\tthis.render();\n\t}\n\n\tprivate render(): void {\n\n\t\tconst children: HTMLSpanElement[] = [];\n\t\tlet pos = 0;\n\n\t\tfor (const highlight of this.highlights) {\n\t\t\tif (highlight.end === highlight.start) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (pos < highlight.start) {\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\tchildren.push(dom.$('span', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]));\n\t\t\t\tpos = highlight.end;\n\t\t\t}\n\n\t\t\tconst substring = this.text.substring(highlight.start, highlight.end);\n\t\t\tconst element = dom.$('span.highlight', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]);\n\n\t\t\tif (highlight.extraClasses) {\n\t\t\t\telement.classList.add(...highlight.extraClasses);\n\t\t\t}\n\n\t\t\tchildren.push(element);\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\tconst substring = this.text.substring(pos,);\n\t\t\tchildren.push(dom.$('span', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]));\n\t\t}\n\n\t\tdom.reset(this.domNode, ...children);\n\n\t\tif (this.title) {\n\t\t\tthis.domNode.title = this.title;\n\t\t} else {\n\t\t\tthis.domNode.removeAttribute('title');\n\t\t}\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: IHighlight[]): string {\n\t\tlet total = 0;\n\t\tlet extra = 0;\n\n\t\treturn text.replace(/\\r\\n|\\r|\\n/g, (match, offset) => {\n\t\t\textra = match === '\\r\\n' ? -1 : 0;\n\t\t\toffset += total;\n\n\t\t\tfor (const highlight of highlights) {\n\t\t\t\tif (highlight.end <= offset) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (highlight.start >= offset) {\n\t\t\t\t\thighlight.start += extra;\n\t\t\t\t}\n\t\t\t\tif (highlight.end >= offset) {\n\t\t\t\t\thighlight.end += extra;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttotal += extra;\n\t\t\treturn '\\u23CE';\n\t\t});\n\t}\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 { $ } from 'vs/base/browser/dom';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IListRenderer } from './list';\n\nexport interface IRow {\n\tdomNode: HTMLElement;\n\ttemplateId: string;\n\ttemplateData: any;\n}\n\nfunction removeFromParent(element: HTMLElement): void {\n\ttry {\n\t\tif (element.parentElement) {\n\t\t\telement.parentElement.removeChild(element);\n\t\t}\n\t} catch (e) {\n\t\t// this will throw if this happens due to a blur event, nasty business\n\t}\n}\n\nexport class RowCache<T> implements IDisposable {\n\n\tprivate cache = new Map<string, IRow[]>();\n\n\tconstructor(private renderers: Map<string, IListRenderer<T, any>>) { }\n\n\t/**\n\t * Returns a row either by creating a new one or reusing\n\t * a previously released row which shares the same templateId.\n\t */\n\talloc(templateId: string): IRow {\n\t\tlet result = this.getTemplateCache(templateId).pop();\n\n\t\tif (!result) {\n\t\t\tconst domNode = $('.monaco-list-row');\n\t\t\tconst renderer = this.getRenderer(templateId);\n\t\t\tconst templateData = renderer.renderTemplate(domNode);\n\t\t\tresult = { domNode, templateId, templateData };\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Releases the row for eventual reuse.\n\t */\n\trelease(row: IRow): void {\n\t\tif (!row) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.releaseRow(row);\n\t}\n\n\tprivate releaseRow(row: IRow): void {\n\t\tconst { domNode, templateId } = row;\n\t\tif (domNode) {\n\t\t\tdomNode.classList.remove('scrolling');\n\t\t\tremoveFromParent(domNode);\n\t\t}\n\n\t\tconst cache = this.getTemplateCache(templateId);\n\t\tcache.push(row);\n\t}\n\n\tprivate getTemplateCache(templateId: string): IRow[] {\n\t\tlet result = this.cache.get(templateId);\n\n\t\tif (!result) {\n\t\t\tresult = [];\n\t\t\tthis.cache.set(templateId, result);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tdispose(): void {\n\t\tthis.cache.forEach((cachedRows, templateId) => {\n\t\t\tfor (const cachedRow of cachedRows) {\n\t\t\t\tconst renderer = this.getRenderer(templateId);\n\t\t\t\trenderer.disposeTemplate(cachedRow.templateData);\n\t\t\t\tcachedRow.templateData = null;\n\t\t\t}\n\t\t});\n\n\t\tthis.cache.clear();\n\t}\n\n\tprivate getRenderer(templateId: string): IListRenderer<T, any> {\n\t\tconst renderer = this.renderers.get(templateId);\n\t\tif (!renderer) {\n\t\t\tthrow new Error(`No renderer found for ${templateId}`);\n\t\t}\n\t\treturn renderer;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Gesture } from 'vs/base/browser/touch';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nexport abstract class Widget extends Disposable {\n\n\tprotected onclick(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.CLICK, (e: MouseEvent) => listener(new StandardMouseEvent(e))));\n\t}\n\n\tprotected onmousedown(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => listener(new StandardMouseEvent(e))));\n\t}\n\n\tprotected onmouseover(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_OVER, (e: MouseEvent) => listener(new StandardMouseEvent(e))));\n\t}\n\n\tprotected onnonbubblingmouseout(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {\n\t\tthis._register(dom.addDisposableNonBubblingMouseOutListener(domNode, (e: MouseEvent) => listener(new StandardMouseEvent(e))));\n\t}\n\n\tprotected onkeydown(domNode: HTMLElement, listener: (e: IKeyboardEvent) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => listener(new StandardKeyboardEvent(e))));\n\t}\n\n\tprotected onkeyup(domNode: HTMLElement, listener: (e: IKeyboardEvent) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.KEY_UP, (e: KeyboardEvent) => listener(new StandardKeyboardEvent(e))));\n\t}\n\n\tprotected oninput(domNode: HTMLElement, listener: (e: Event) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.INPUT, listener));\n\t}\n\n\tprotected onblur(domNode: HTMLElement, listener: (e: Event) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.BLUR, listener));\n\t}\n\n\tprotected onfocus(domNode: HTMLElement, listener: (e: Event) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.FOCUS, listener));\n\t}\n\n\tprotected ignoreGesture(domNode: HTMLElement): void {\n\t\tGesture.ignoreTarget(domNode);\n\t}\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 { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { IntervalTimer, TimeoutTimer } from 'vs/base/common/async';\nimport { Codicon } from 'vs/base/common/codicons';\n\n/**\n * The arrow image size.\n */\nexport const ARROW_IMG_SIZE = 11;\n\nexport interface ScrollbarArrowOptions {\n\tonActivate: () => void;\n\tclassName: string;\n\ticon: Codicon;\n\n\tbgWidth: number;\n\tbgHeight: number;\n\n\ttop?: number;\n\tleft?: number;\n\tbottom?: number;\n\tright?: number;\n}\n\nexport class ScrollbarArrow extends Widget {\n\n\tprivate _onActivate: () => void;\n\tpublic bgDomNode: HTMLElement;\n\tpublic domNode: HTMLElement;\n\tprivate _mousedownRepeatTimer: IntervalTimer;\n\tprivate _mousedownScheduleRepeatTimer: TimeoutTimer;\n\tprivate _mouseMoveMonitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData>;\n\n\tconstructor(opts: ScrollbarArrowOptions) {\n\t\tsuper();\n\t\tthis._onActivate = opts.onActivate;\n\n\t\tthis.bgDomNode = document.createElement('div');\n\t\tthis.bgDomNode.className = 'arrow-background';\n\t\tthis.bgDomNode.style.position = 'absolute';\n\t\tthis.bgDomNode.style.width = opts.bgWidth + 'px';\n\t\tthis.bgDomNode.style.height = opts.bgHeight + 'px';\n\t\tif (typeof opts.top !== 'undefined') {\n\t\t\tthis.bgDomNode.style.top = '0px';\n\t\t}\n\t\tif (typeof opts.left !== 'undefined') {\n\t\t\tthis.bgDomNode.style.left = '0px';\n\t\t}\n\t\tif (typeof opts.bottom !== 'undefined') {\n\t\t\tthis.bgDomNode.style.bottom = '0px';\n\t\t}\n\t\tif (typeof opts.right !== 'undefined') {\n\t\t\tthis.bgDomNode.style.right = '0px';\n\t\t}\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = opts.className;\n\t\tthis.domNode.classList.add(...opts.icon.classNamesArray);\n\n\t\tthis.domNode.style.position = 'absolute';\n\t\tthis.domNode.style.width = ARROW_IMG_SIZE + 'px';\n\t\tthis.domNode.style.height = ARROW_IMG_SIZE + 'px';\n\t\tif (typeof opts.top !== 'undefined') {\n\t\t\tthis.domNode.style.top = opts.top + 'px';\n\t\t}\n\t\tif (typeof opts.left !== 'undefined') {\n\t\t\tthis.domNode.style.left = opts.left + 'px';\n\t\t}\n\t\tif (typeof opts.bottom !== 'undefined') {\n\t\t\tthis.domNode.style.bottom = opts.bottom + 'px';\n\t\t}\n\t\tif (typeof opts.right !== 'undefined') {\n\t\t\tthis.domNode.style.right = opts.right + 'px';\n\t\t}\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>());\n\t\tthis.onmousedown(this.bgDomNode, (e) => this._arrowMouseDown(e));\n\t\tthis.onmousedown(this.domNode, (e) => this._arrowMouseDown(e));\n\n\t\tthis._mousedownRepeatTimer = this._register(new IntervalTimer());\n\t\tthis._mousedownScheduleRepeatTimer = this._register(new TimeoutTimer());\n\t}\n\n\tprivate _arrowMouseDown(e: IMouseEvent): void {\n\t\tconst scheduleRepeater = () => {\n\t\t\tthis._mousedownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24);\n\t\t};\n\n\t\tthis._onActivate();\n\t\tthis._mousedownRepeatTimer.cancel();\n\t\tthis._mousedownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200);\n\n\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\te.target,\n\t\t\te.buttons,\n\t\t\tstandardMouseMoveMerger,\n\t\t\t(mouseMoveData: IStandardMouseMoveEventData) => {\n\t\t\t\t/* Intentional empty */\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis._mousedownRepeatTimer.cancel();\n\t\t\t\tthis._mousedownScheduleRepeatTimer.cancel();\n\t\t\t}\n\t\t);\n\n\t\te.preventDefault();\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { createFastDomNode, FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { IMouseEvent, StandardWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { ScrollbarArrow, ScrollbarArrowOptions } from 'vs/base/browser/ui/scrollbar/scrollbarArrow';\nimport { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState';\nimport { ScrollbarVisibilityController } from 'vs/base/browser/ui/scrollbar/scrollbarVisibilityController';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport * as platform from 'vs/base/common/platform';\nimport { INewScrollPosition, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable';\n\n/**\n * The orthogonal distance to the slider at which dragging \"resets\". This implements \"snapping\"\n */\nconst MOUSE_DRAG_RESET_DISTANCE = 140;\n\nexport interface ISimplifiedMouseEvent {\n\tposx: number;\n\tposy: number;\n}\n\nexport interface ScrollbarHost {\n\tonMouseWheel(mouseWheelEvent: StandardWheelEvent): void;\n\tonDragStart(): void;\n\tonDragEnd(): void;\n}\n\nexport interface AbstractScrollbarOptions {\n\tlazyRender: boolean;\n\thost: ScrollbarHost;\n\tscrollbarState: ScrollbarState;\n\tvisibility: ScrollbarVisibility;\n\textraScrollbarClassName: string;\n\tscrollable: Scrollable;\n\tscrollByPage: boolean;\n}\n\nexport abstract class AbstractScrollbar extends Widget {\n\n\tprotected _host: ScrollbarHost;\n\tprotected _scrollable: Scrollable;\n\tprotected _scrollByPage: boolean;\n\tprivate _lazyRender: boolean;\n\tprotected _scrollbarState: ScrollbarState;\n\tprotected _visibilityController: ScrollbarVisibilityController;\n\tprivate _mouseMoveMonitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData>;\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic slider!: FastDomNode<HTMLElement>;\n\n\tprotected _shouldRender: boolean;\n\n\tconstructor(opts: AbstractScrollbarOptions) {\n\t\tsuper();\n\t\tthis._lazyRender = opts.lazyRender;\n\t\tthis._host = opts.host;\n\t\tthis._scrollable = opts.scrollable;\n\t\tthis._scrollByPage = opts.scrollByPage;\n\t\tthis._scrollbarState = opts.scrollbarState;\n\t\tthis._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName));\n\t\tthis._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n\t\tthis._mouseMoveMonitor = this._register(new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>());\n\t\tthis._shouldRender = true;\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tthis.domNode.setAttribute('role', 'presentation');\n\t\tthis.domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._visibilityController.setDomNode(this.domNode);\n\t\tthis.domNode.setPosition('absolute');\n\n\t\tthis.onmousedown(this.domNode.domNode, (e) => this._domNodeMouseDown(e));\n\t}\n\n\t// ----------------- creation\n\n\t/**\n\t * Creates the dom node for an arrow & adds it to the container\n\t */\n\tprotected _createArrow(opts: ScrollbarArrowOptions): void {\n\t\tconst arrow = this._register(new ScrollbarArrow(opts));\n\t\tthis.domNode.domNode.appendChild(arrow.bgDomNode);\n\t\tthis.domNode.domNode.appendChild(arrow.domNode);\n\t}\n\n\t/**\n\t * Creates the slider dom node, adds it to the container & hooks up the events\n\t */\n\tprotected _createSlider(top: number, left: number, width: number | undefined, height: number | undefined): void {\n\t\tthis.slider = createFastDomNode(document.createElement('div'));\n\t\tthis.slider.setClassName('slider');\n\t\tthis.slider.setPosition('absolute');\n\t\tthis.slider.setTop(top);\n\t\tthis.slider.setLeft(left);\n\t\tif (typeof width === 'number') {\n\t\t\tthis.slider.setWidth(width);\n\t\t}\n\t\tif (typeof height === 'number') {\n\t\t\tthis.slider.setHeight(height);\n\t\t}\n\t\tthis.slider.setLayerHinting(true);\n\t\tthis.slider.setContain('strict');\n\n\t\tthis.domNode.domNode.appendChild(this.slider.domNode);\n\n\t\tthis.onmousedown(this.slider.domNode, (e) => {\n\t\t\tif (e.leftButton) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis._sliderMouseDown(e, () => { /*nothing to do*/ });\n\t\t\t}\n\t\t});\n\n\t\tthis.onclick(this.slider.domNode, e => {\n\t\t\tif (e.leftButton) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t});\n\t}\n\n\t// ----------------- Update state\n\n\tprotected _onElementSize(visibleSize: number): boolean {\n\t\tif (this._scrollbarState.setVisibleSize(visibleSize)) {\n\t\t\tthis._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n\t\t\tthis._shouldRender = true;\n\t\t\tif (!this._lazyRender) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\treturn this._shouldRender;\n\t}\n\n\tprotected _onElementScrollSize(elementScrollSize: number): boolean {\n\t\tif (this._scrollbarState.setScrollSize(elementScrollSize)) {\n\t\t\tthis._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n\t\t\tthis._shouldRender = true;\n\t\t\tif (!this._lazyRender) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\treturn this._shouldRender;\n\t}\n\n\tprotected _onElementScrollPosition(elementScrollPosition: number): boolean {\n\t\tif (this._scrollbarState.setScrollPosition(elementScrollPosition)) {\n\t\t\tthis._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n\t\t\tthis._shouldRender = true;\n\t\t\tif (!this._lazyRender) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\treturn this._shouldRender;\n\t}\n\n\t// ----------------- rendering\n\n\tpublic beginReveal(): void {\n\t\tthis._visibilityController.setShouldBeVisible(true);\n\t}\n\n\tpublic beginHide(): void {\n\t\tthis._visibilityController.setShouldBeVisible(false);\n\t}\n\n\tpublic render(): void {\n\t\tif (!this._shouldRender) {\n\t\t\treturn;\n\t\t}\n\t\tthis._shouldRender = false;\n\n\t\tthis._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize());\n\t\tthis._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition());\n\t}\n\t// ----------------- DOM events\n\n\tprivate _domNodeMouseDown(e: IMouseEvent): void {\n\t\tif (e.target !== this.domNode.domNode) {\n\t\t\treturn;\n\t\t}\n\t\tthis._onMouseDown(e);\n\t}\n\n\tpublic delegateMouseDown(e: IMouseEvent): void {\n\t\tconst domTop = this.domNode.domNode.getClientRects()[0].top;\n\t\tconst sliderStart = domTop + this._scrollbarState.getSliderPosition();\n\t\tconst sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize();\n\t\tconst mousePos = this._sliderMousePosition(e);\n\t\tif (sliderStart <= mousePos && mousePos <= sliderStop) {\n\t\t\t// Act as if it was a mouse down on the slider\n\t\t\tif (e.leftButton) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis._sliderMouseDown(e, () => { /*nothing to do*/ });\n\t\t\t}\n\t\t} else {\n\t\t\t// Act as if it was a mouse down on the scrollbar\n\t\t\tthis._onMouseDown(e);\n\t\t}\n\t}\n\n\tprivate _onMouseDown(e: IMouseEvent): void {\n\t\tlet offsetX: number;\n\t\tlet offsetY: number;\n\t\tif (e.target === this.domNode.domNode && typeof e.browserEvent.offsetX === 'number' && typeof e.browserEvent.offsetY === 'number') {\n\t\t\toffsetX = e.browserEvent.offsetX;\n\t\t\toffsetY = e.browserEvent.offsetY;\n\t\t} else {\n\t\t\tconst domNodePosition = dom.getDomNodePagePosition(this.domNode.domNode);\n\t\t\toffsetX = e.posx - domNodePosition.left;\n\t\t\toffsetY = e.posy - domNodePosition.top;\n\t\t}\n\n\t\tconst offset = this._mouseDownRelativePosition(offsetX, offsetY);\n\t\tthis._setDesiredScrollPositionNow(\n\t\t\tthis._scrollByPage\n\t\t\t\t? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(offset)\n\t\t\t\t: this._scrollbarState.getDesiredScrollPositionFromOffset(offset)\n\t\t);\n\n\t\tif (e.leftButton) {\n\t\t\te.preventDefault();\n\t\t\tthis._sliderMouseDown(e, () => { /*nothing to do*/ });\n\t\t}\n\t}\n\n\tprivate _sliderMouseDown(e: IMouseEvent, onDragFinished: () => void): void {\n\t\tconst initialMousePosition = this._sliderMousePosition(e);\n\t\tconst initialMouseOrthogonalPosition = this._sliderOrthogonalMousePosition(e);\n\t\tconst initialScrollbarState = this._scrollbarState.clone();\n\t\tthis.slider.toggleClassName('active', true);\n\n\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\te.target,\n\t\t\te.buttons,\n\t\t\tstandardMouseMoveMerger,\n\t\t\t(mouseMoveData: IStandardMouseMoveEventData) => {\n\t\t\t\tconst mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData);\n\t\t\t\tconst mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition);\n\n\t\t\t\tif (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) {\n\t\t\t\t\t// The mouse has wondered away from the scrollbar => reset dragging\n\t\t\t\t\tthis._setDesiredScrollPositionNow(initialScrollbarState.getScrollPosition());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst mousePosition = this._sliderMousePosition(mouseMoveData);\n\t\t\t\tconst mouseDelta = mousePosition - initialMousePosition;\n\t\t\t\tthis._setDesiredScrollPositionNow(initialScrollbarState.getDesiredScrollPositionFromDelta(mouseDelta));\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.slider.toggleClassName('active', false);\n\t\t\t\tthis._host.onDragEnd();\n\t\t\t\tonDragFinished();\n\t\t\t}\n\t\t);\n\n\t\tthis._host.onDragStart();\n\t}\n\n\tprivate _setDesiredScrollPositionNow(_desiredScrollPosition: number): void {\n\n\t\tconst desiredScrollPosition: INewScrollPosition = {};\n\t\tthis.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition);\n\n\t\tthis._scrollable.setScrollPositionNow(desiredScrollPosition);\n\t}\n\n\tpublic updateScrollbarSize(scrollbarSize: number): void {\n\t\tthis._updateScrollbarSize(scrollbarSize);\n\t\tthis._scrollbarState.setScrollbarSize(scrollbarSize);\n\t\tthis._shouldRender = true;\n\t\tif (!this._lazyRender) {\n\t\t\tthis.render();\n\t\t}\n\t}\n\n\tpublic isNeeded(): boolean {\n\t\treturn this._scrollbarState.isNeeded();\n\t}\n\n\t// ----------------- Overwrite these\n\n\tprotected abstract _renderDomNode(largeSize: number, smallSize: number): void;\n\tprotected abstract _updateSlider(sliderSize: number, sliderPosition: number): void;\n\n\tprotected abstract _mouseDownRelativePosition(offsetX: number, offsetY: number): number;\n\tprotected abstract _sliderMousePosition(e: ISimplifiedMouseEvent): number;\n\tprotected abstract _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number;\n\tprotected abstract _updateScrollbarSize(size: number): void;\n\n\tpublic abstract writeScrollPosition(target: INewScrollPosition, scrollPosition: number): void;\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 { StandardWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { AbstractScrollbar, ISimplifiedMouseEvent, ScrollbarHost } from 'vs/base/browser/ui/scrollbar/abstractScrollbar';\nimport { ScrollableElementResolvedOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions';\nimport { ARROW_IMG_SIZE } from 'vs/base/browser/ui/scrollbar/scrollbarArrow';\nimport { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { INewScrollPosition, Scrollable, ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\n\n\n\n\nexport class HorizontalScrollbar extends AbstractScrollbar {\n\n\tconstructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) {\n\t\tconst scrollDimensions = scrollable.getScrollDimensions();\n\t\tconst scrollPosition = scrollable.getCurrentScrollPosition();\n\t\tsuper({\n\t\t\tlazyRender: options.lazyRender,\n\t\t\thost: host,\n\t\t\tscrollbarState: new ScrollbarState(\n\t\t\t\t(options.horizontalHasArrows ? options.arrowSize : 0),\n\t\t\t\t(options.horizontal === ScrollbarVisibility.Hidden ? 0 : options.horizontalScrollbarSize),\n\t\t\t\t(options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize),\n\t\t\t\tscrollDimensions.width,\n\t\t\t\tscrollDimensions.scrollWidth,\n\t\t\t\tscrollPosition.scrollLeft\n\t\t\t),\n\t\t\tvisibility: options.horizontal,\n\t\t\textraScrollbarClassName: 'horizontal',\n\t\t\tscrollable: scrollable,\n\t\t\tscrollByPage: options.scrollByPage\n\t\t});\n\n\t\tif (options.horizontalHasArrows) {\n\t\t\tconst arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n\t\t\tconst scrollbarDelta = (options.horizontalScrollbarSize - ARROW_IMG_SIZE) / 2;\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'scra',\n\t\t\t\ticon: Codicon.scrollbarButtonLeft,\n\t\t\t\ttop: scrollbarDelta,\n\t\t\t\tleft: arrowDelta,\n\t\t\t\tbottom: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbgWidth: options.arrowSize,\n\t\t\t\tbgHeight: options.horizontalScrollbarSize,\n\t\t\t\tonActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 1, 0)),\n\t\t\t});\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'scra',\n\t\t\t\ticon: Codicon.scrollbarButtonRight,\n\t\t\t\ttop: scrollbarDelta,\n\t\t\t\tleft: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tright: arrowDelta,\n\t\t\t\tbgWidth: options.arrowSize,\n\t\t\t\tbgHeight: options.horizontalScrollbarSize,\n\t\t\t\tonActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, -1, 0)),\n\t\t\t});\n\t\t}\n\n\t\tthis._createSlider(Math.floor((options.horizontalScrollbarSize - options.horizontalSliderSize) / 2), 0, undefined, options.horizontalSliderSize);\n\t}\n\n\tprotected _updateSlider(sliderSize: number, sliderPosition: number): void {\n\t\tthis.slider.setWidth(sliderSize);\n\t\tthis.slider.setLeft(sliderPosition);\n\t}\n\n\tprotected _renderDomNode(largeSize: number, smallSize: number): void {\n\t\tthis.domNode.setWidth(largeSize);\n\t\tthis.domNode.setHeight(smallSize);\n\t\tthis.domNode.setLeft(0);\n\t\tthis.domNode.setBottom(0);\n\t}\n\n\tpublic onDidScroll(e: ScrollEvent): boolean {\n\t\tthis._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender;\n\t\tthis._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender;\n\t\tthis._shouldRender = this._onElementSize(e.width) || this._shouldRender;\n\t\treturn this._shouldRender;\n\t}\n\n\tprotected _mouseDownRelativePosition(offsetX: number, offsetY: number): number {\n\t\treturn offsetX;\n\t}\n\n\tprotected _sliderMousePosition(e: ISimplifiedMouseEvent): number {\n\t\treturn e.posx;\n\t}\n\n\tprotected _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number {\n\t\treturn e.posy;\n\t}\n\n\tprotected _updateScrollbarSize(size: number): void {\n\t\tthis.slider.setHeight(size);\n\t}\n\n\tpublic writeScrollPosition(target: INewScrollPosition, scrollPosition: number): void {\n\t\ttarget.scrollLeft = scrollPosition;\n\t}\n\n\tpublic updateOptions(options: ScrollableElementResolvedOptions): void {\n\t\tthis.updateScrollbarSize(options.horizontal === ScrollbarVisibility.Hidden ? 0 : options.horizontalScrollbarSize);\n\t\tthis._scrollbarState.setOppositeScrollbarSize(options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize);\n\t\tthis._visibilityController.setVisibility(options.horizontal);\n\t\tthis._scrollByPage = options.scrollByPage;\n\t}\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 { StandardWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { AbstractScrollbar, ISimplifiedMouseEvent, ScrollbarHost } from 'vs/base/browser/ui/scrollbar/abstractScrollbar';\nimport { ScrollableElementResolvedOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions';\nimport { ARROW_IMG_SIZE } from 'vs/base/browser/ui/scrollbar/scrollbarArrow';\nimport { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { INewScrollPosition, Scrollable, ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\n\n\n\nexport class VerticalScrollbar extends AbstractScrollbar {\n\n\tconstructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) {\n\t\tconst scrollDimensions = scrollable.getScrollDimensions();\n\t\tconst scrollPosition = scrollable.getCurrentScrollPosition();\n\t\tsuper({\n\t\t\tlazyRender: options.lazyRender,\n\t\t\thost: host,\n\t\t\tscrollbarState: new ScrollbarState(\n\t\t\t\t(options.verticalHasArrows ? options.arrowSize : 0),\n\t\t\t\t(options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize),\n\t\t\t\t// give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom\n\t\t\t\t0,\n\t\t\t\tscrollDimensions.height,\n\t\t\t\tscrollDimensions.scrollHeight,\n\t\t\t\tscrollPosition.scrollTop\n\t\t\t),\n\t\t\tvisibility: options.vertical,\n\t\t\textraScrollbarClassName: 'vertical',\n\t\t\tscrollable: scrollable,\n\t\t\tscrollByPage: options.scrollByPage\n\t\t});\n\n\t\tif (options.verticalHasArrows) {\n\t\t\tconst arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n\t\t\tconst scrollbarDelta = (options.verticalScrollbarSize - ARROW_IMG_SIZE) / 2;\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'scra',\n\t\t\t\ticon: Codicon.scrollbarButtonUp,\n\t\t\t\ttop: arrowDelta,\n\t\t\t\tleft: scrollbarDelta,\n\t\t\t\tbottom: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbgWidth: options.verticalScrollbarSize,\n\t\t\t\tbgHeight: options.arrowSize,\n\t\t\t\tonActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, 1)),\n\t\t\t});\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'scra',\n\t\t\t\ticon: Codicon.scrollbarButtonDown,\n\t\t\t\ttop: undefined,\n\t\t\t\tleft: scrollbarDelta,\n\t\t\t\tbottom: arrowDelta,\n\t\t\t\tright: undefined,\n\t\t\t\tbgWidth: options.verticalScrollbarSize,\n\t\t\t\tbgHeight: options.arrowSize,\n\t\t\t\tonActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, -1)),\n\t\t\t});\n\t\t}\n\n\t\tthis._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, undefined);\n\t}\n\n\tprotected _updateSlider(sliderSize: number, sliderPosition: number): void {\n\t\tthis.slider.setHeight(sliderSize);\n\t\tthis.slider.setTop(sliderPosition);\n\t}\n\n\tprotected _renderDomNode(largeSize: number, smallSize: number): void {\n\t\tthis.domNode.setWidth(smallSize);\n\t\tthis.domNode.setHeight(largeSize);\n\t\tthis.domNode.setRight(0);\n\t\tthis.domNode.setTop(0);\n\t}\n\n\tpublic onDidScroll(e: ScrollEvent): boolean {\n\t\tthis._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender;\n\t\tthis._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender;\n\t\tthis._shouldRender = this._onElementSize(e.height) || this._shouldRender;\n\t\treturn this._shouldRender;\n\t}\n\n\tprotected _mouseDownRelativePosition(offsetX: number, offsetY: number): number {\n\t\treturn offsetY;\n\t}\n\n\tprotected _sliderMousePosition(e: ISimplifiedMouseEvent): number {\n\t\treturn e.posy;\n\t}\n\n\tprotected _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number {\n\t\treturn e.posx;\n\t}\n\n\tprotected _updateScrollbarSize(size: number): void {\n\t\tthis.slider.setWidth(size);\n\t}\n\n\tpublic writeScrollPosition(target: INewScrollPosition, scrollPosition: number): void {\n\t\ttarget.scrollTop = scrollPosition;\n\t}\n\n\tpublic updateOptions(options: ScrollableElementResolvedOptions): void {\n\t\tthis.updateScrollbarSize(options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize);\n\t\t// give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom\n\t\tthis._scrollbarState.setOppositeScrollbarSize(0);\n\t\tthis._visibilityController.setVisibility(options.vertical);\n\t\tthis._scrollByPage = options.scrollByPage;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as extpath from 'vs/base/common/extpath';\nimport { Schemas } from 'vs/base/common/network';\nimport * as paths from 'vs/base/common/path';\nimport { isLinux, isWindows } from 'vs/base/common/platform';\nimport { compare as strCompare, equalsIgnoreCase } from 'vs/base/common/strings';\nimport { URI, uriToFsPath } from 'vs/base/common/uri';\n\nexport function originalFSPath(uri: URI): string {\n\treturn uriToFsPath(uri, true);\n}\n\n//#region IExtUri\n\nexport interface IExtUri {\n}\n\nexport class ExtUri implements IExtUri {\n\n\tconstructor(private _ignorePathCasing: (uri: URI) => boolean) { }\n\n\tcompare(uri1: URI, uri2: URI, ignoreFragment: boolean = false): number {\n\t\tif (uri1 === uri2) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn strCompare(this.getComparisonKey(uri1, ignoreFragment), this.getComparisonKey(uri2, ignoreFragment));\n\t}\n\n\tisEqual(uri1: URI | undefined, uri2: URI | undefined, ignoreFragment: boolean = false): boolean {\n\t\tif (uri1 === uri2) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!uri1 || !uri2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.getComparisonKey(uri1, ignoreFragment) === this.getComparisonKey(uri2, ignoreFragment);\n\t}\n\n\tgetComparisonKey(uri: URI, ignoreFragment: boolean = false): string {\n\t\treturn uri.with({\n\t\t\tpath: this._ignorePathCasing(uri) ? uri.path.toLowerCase() : undefined,\n\t\t\tfragment: ignoreFragment ? null : undefined\n\t\t}).toString();\n\t}\n\n\tisEqualOrParent(base: URI, parentCandidate: URI, ignoreFragment: boolean = false): boolean {\n\t\tif (base.scheme === parentCandidate.scheme) {\n\t\t\tif (base.scheme === Schemas.file) {\n\t\t\t\treturn extpath.isEqualOrParent(originalFSPath(base), originalFSPath(parentCandidate), this._ignorePathCasing(base)) && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);\n\t\t\t}\n\t\t\tif (isEqualAuthority(base.authority, parentCandidate.authority)) {\n\t\t\t\treturn extpath.isEqualOrParent(base.path, parentCandidate.path, this._ignorePathCasing(base), '/') && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t// --- path math\n\n\tjoinPath(resource: URI, ...pathFragment: string[]): URI {\n\t\treturn URI.joinPath(resource, ...pathFragment);\n\t}\n\n\tbasenameOrAuthority(resource: URI): string {\n\t\treturn basename(resource) || resource.authority;\n\t}\n\n\tbasename(resource: URI): string {\n\t\treturn paths.posix.basename(resource.path);\n\t}\n\n\textname(resource: URI): string {\n\t\treturn paths.posix.extname(resource.path);\n\t}\n\n\tdirname(resource: URI): URI {\n\t\tif (resource.path.length === 0) {\n\t\t\treturn resource;\n\t\t}\n\t\tlet dirname;\n\t\tif (resource.scheme === Schemas.file) {\n\t\t\tdirname = URI.file(paths.dirname(originalFSPath(resource))).path;\n\t\t} else {\n\t\t\tdirname = paths.posix.dirname(resource.path);\n\t\t\tif (resource.authority && dirname.length && dirname.charCodeAt(0) !== CharCode.Slash) {\n\t\t\t\tconsole.error(`dirname(\"${resource.toString})) resulted in a relative path`);\n\t\t\t\tdirname = '/'; // If a URI contains an authority component, then the path component must either be empty or begin with a CharCode.Slash (\"/\") character\n\t\t\t}\n\t\t}\n\t\treturn resource.with({\n\t\t\tpath: dirname\n\t\t});\n\t}\n\n\tnormalizePath(resource: URI): URI {\n\t\tif (!resource.path.length) {\n\t\t\treturn resource;\n\t\t}\n\t\tlet normalizedPath: string;\n\t\tif (resource.scheme === Schemas.file) {\n\t\t\tnormalizedPath = URI.file(paths.normalize(originalFSPath(resource))).path;\n\t\t} else {\n\t\t\tnormalizedPath = paths.posix.normalize(resource.path);\n\t\t}\n\t\treturn resource.with({\n\t\t\tpath: normalizedPath\n\t\t});\n\t}\n\n\trelativePath(from: URI, to: URI): string | undefined {\n\t\tif (from.scheme !== to.scheme || !isEqualAuthority(from.authority, to.authority)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (from.scheme === Schemas.file) {\n\t\t\tconst relativePath = paths.relative(originalFSPath(from), originalFSPath(to));\n\t\t\treturn isWindows ? extpath.toSlashes(relativePath) : relativePath;\n\t\t}\n\t\tlet fromPath = from.path || '/', toPath = to.path || '/';\n\t\tif (this._ignorePathCasing(from)) {\n\t\t\t// make casing of fromPath match toPath\n\t\t\tlet i = 0;\n\t\t\tfor (const len = Math.min(fromPath.length, toPath.length); i < len; i++) {\n\t\t\t\tif (fromPath.charCodeAt(i) !== toPath.charCodeAt(i)) {\n\t\t\t\t\tif (fromPath.charAt(i).toLowerCase() !== toPath.charAt(i).toLowerCase()) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfromPath = toPath.substr(0, i) + fromPath.substr(i);\n\t\t}\n\t\treturn paths.posix.relative(fromPath, toPath);\n\t}\n\n\tresolvePath(base: URI, path: string): URI {\n\t\tif (base.scheme === Schemas.file) {\n\t\t\tconst newURI = URI.file(paths.resolve(originalFSPath(base), path));\n\t\t\treturn base.with({\n\t\t\t\tauthority: newURI.authority,\n\t\t\t\tpath: newURI.path\n\t\t\t});\n\t\t}\n\t\tpath = extpath.toPosixPath(path); // we allow path to be a windows path\n\t\treturn base.with({\n\t\t\tpath: paths.posix.resolve(base.path, path)\n\t\t});\n\t}\n\n\t// --- misc\n\n\tisAbsolutePath(resource: URI): boolean {\n\t\treturn !!resource.path && resource.path[0] === '/';\n\t}\n\n\tisEqualAuthority(a1: string | undefined, a2: string | undefined) {\n\t\treturn a1 === a2 || (a1 !== undefined && a2 !== undefined && equalsIgnoreCase(a1, a2));\n\t}\n\n\thasTrailingPathSeparator(resource: URI, sep: string = paths.sep): boolean {\n\t\tif (resource.scheme === Schemas.file) {\n\t\t\tconst fsp = originalFSPath(resource);\n\t\t\treturn fsp.length > extpath.getRoot(fsp).length && fsp[fsp.length - 1] === sep;\n\t\t} else {\n\t\t\tconst p = resource.path;\n\t\t\treturn (p.length > 1 && p.charCodeAt(p.length - 1) === CharCode.Slash) && !(/^[a-zA-Z]:(\\/$|\\\\$)/.test(resource.fsPath)); // ignore the slash at offset 0\n\t\t}\n\t}\n\n\tremoveTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {\n\t\t// Make sure that the path isn't a drive letter. A trailing separator there is not removable.\n\t\tif (hasTrailingPathSeparator(resource, sep)) {\n\t\t\treturn resource.with({ path: resource.path.substr(0, resource.path.length - 1) });\n\t\t}\n\t\treturn resource;\n\t}\n\n\taddTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {\n\t\tlet isRootSep: boolean = false;\n\t\tif (resource.scheme === Schemas.file) {\n\t\t\tconst fsp = originalFSPath(resource);\n\t\t\tisRootSep = ((fsp !== undefined) && (fsp.length === extpath.getRoot(fsp).length) && (fsp[fsp.length - 1] === sep));\n\t\t} else {\n\t\t\tsep = '/';\n\t\t\tconst p = resource.path;\n\t\t\tisRootSep = p.length === 1 && p.charCodeAt(p.length - 1) === CharCode.Slash;\n\t\t}\n\t\tif (!isRootSep && !hasTrailingPathSeparator(resource, sep)) {\n\t\t\treturn resource.with({ path: resource.path + '/' });\n\t\t}\n\t\treturn resource;\n\t}\n}\n\n\n/**\n * Unbiased utility that takes uris \"as they are\". This means it can be interchanged with\n * uri#toString() usages. The following is true\n * ```\n * assertEqual(aUri.toString() === bUri.toString(), exturi.isEqual(aUri, bUri))\n * ```\n */\nexport const extUri = new ExtUri(() => false);\n\n/**\n * BIASED utility that _mostly_ ignored the case of urs paths. ONLY use this util if you\n * understand what you are doing.\n *\n * This utility is INCOMPATIBLE with `uri.toString()`-usages and both CANNOT be used interchanged.\n *\n * When dealing with uris from files or documents, `extUri` (the unbiased friend)is sufficient\n * because those uris come from a \"trustworthy source\". When creating unknown uris it's always\n * better to use `IUriIdentityService` which exposes an `IExtUri`-instance which knows when path\n * casing matters.\n */\nexport const extUriBiasedIgnorePathCase = new ExtUri(uri => {\n\t// A file scheme resource is in the same platform as code, so ignore case for non linux platforms\n\t// Resource can be from another platform. Lowering the case as an hack. Should come from File system provider\n\treturn uri.scheme === Schemas.file ? !isLinux : true;\n});\n\n\n/**\n * BIASED utility that always ignores the casing of uris paths. ONLY use this util if you\n * understand what you are doing.\n *\n * This utility is INCOMPATIBLE with `uri.toString()`-usages and both CANNOT be used interchanged.\n *\n * When dealing with uris from files or documents, `extUri` (the unbiased friend)is sufficient\n * because those uris come from a \"trustworthy source\". When creating unknown uris it's always\n * better to use `IUriIdentityService` which exposes an `IExtUri`-instance which knows when path\n * casing matters.\n */\nexport const extUriIgnorePathCase = new ExtUri(_ => true);\n\nexport const isEqual = extUri.isEqual.bind(extUri);\nexport const isEqualOrParent = extUri.isEqualOrParent.bind(extUri);\nexport const getComparisonKey = extUri.getComparisonKey.bind(extUri);\nexport const basenameOrAuthority = extUri.basenameOrAuthority.bind(extUri);\nexport const basename = extUri.basename.bind(extUri);\nexport const extname = extUri.extname.bind(extUri);\nexport const dirname = extUri.dirname.bind(extUri);\nexport const joinPath = extUri.joinPath.bind(extUri);\nexport const normalizePath = extUri.normalizePath.bind(extUri);\nexport const relativePath = extUri.relativePath.bind(extUri);\nexport const resolvePath = extUri.resolvePath.bind(extUri);\nexport const isAbsolutePath = extUri.isAbsolutePath.bind(extUri);\nexport const isEqualAuthority = extUri.isEqualAuthority.bind(extUri);\nexport const hasTrailingPathSeparator = extUri.hasTrailingPathSeparator.bind(extUri);\nexport const removeTrailingPathSeparator = extUri.removeTrailingPathSeparator.bind(extUri);\nexport const addTrailingPathSeparator = extUri.addTrailingPathSeparator.bind(extUri);\n\n/**\n * Data URI related helpers.\n */\nexport namespace DataUri {\n\n\texport const META_DATA_LABEL = 'label';\n\texport const META_DATA_DESCRIPTION = 'description';\n\texport const META_DATA_SIZE = 'size';\n\texport const META_DATA_MIME = 'mime';\n\n\texport function parseMetaData(dataUri: URI): Map<string, string> {\n\t\tconst metadata = new Map<string, string>();\n\n\t\t// Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5...\n\t\t// the metadata is: size:2313;label:SomeLabel;description:SomeDescription\n\t\tconst meta = dataUri.path.substring(dataUri.path.indexOf(';') + 1, dataUri.path.lastIndexOf(';'));\n\t\tmeta.split(';').forEach(property => {\n\t\t\tconst [key, value] = property.split(':');\n\t\t\tif (key && value) {\n\t\t\t\tmetadata.set(key, value);\n\t\t\t}\n\t\t});\n\n\t\t// Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5...\n\t\t// the mime is: image/png\n\t\tconst mime = dataUri.path.substring(0, dataUri.path.indexOf(';'));\n\t\tif (mime) {\n\t\t\tmetadata.set(META_DATA_MIME, mime);\n\t\t}\n\n\t\treturn metadata;\n\t}\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 * as DOM from 'vs/base/browser/dom';\nimport * as dompurify from 'vs/base/browser/dompurify/dompurify';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { createElement, FormattedTextRenderOptions } from 'vs/base/browser/formattedTextRenderer';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';\nimport { raceCancellation } from 'vs/base/common/async';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Event } from 'vs/base/common/event';\nimport { IMarkdownString, parseHrefAndDimensions, removeMarkdownEscapes } from 'vs/base/common/htmlContent';\nimport { markdownEscapeEscapedIcons } from 'vs/base/common/iconLabels';\nimport { defaultGenerator } from 'vs/base/common/idGenerator';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { marked } from 'vs/base/common/marked/marked';\nimport { parse } from 'vs/base/common/marshalling';\nimport { FileAccess, Schemas } from 'vs/base/common/network';\nimport { cloneAndChange } from 'vs/base/common/objects';\nimport { dirname, resolvePath } from 'vs/base/common/resources';\nimport { escape } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\n\nexport interface MarkedOptions extends marked.MarkedOptions {\n}\n\nexport interface MarkdownRenderOptions extends FormattedTextRenderOptions {\n\treadonly codeBlockRenderer?: (languageId: string, value: string) => Promise<HTMLElement>;\n\treadonly asyncRenderCallback?: () => void;\n}\n\n/**\n * Low-level way create a html element from a markdown string.\n *\n * **Note** that for most cases you should be using [`MarkdownRenderer`](./src/vs/editor/browser/core/markdownRenderer.ts)\n * which comes with support for pretty code block rendering and which uses the default way of handling links.\n */\nexport function renderMarkdown(markdown: IMarkdownString, options: MarkdownRenderOptions = {}, markedOptions: MarkedOptions = {}): { element: HTMLElement; dispose: () => void } {\n\tconst disposables = new DisposableStore();\n\tlet isDisposed = false;\n\n\tconst cts = disposables.add(new CancellationTokenSource());\n\n\tconst element = createElement(options);\n\n\tconst _uriMassage = function (part: string): string {\n\t\tlet data: any;\n\t\ttry {\n\t\t\tdata = parse(decodeURIComponent(part));\n\t\t} catch (e) {\n\t\t\t// ignore\n\t\t}\n\t\tif (!data) {\n\t\t\treturn part;\n\t\t}\n\t\tdata = cloneAndChange(data, value => {\n\t\t\tif (markdown.uris && markdown.uris[value]) {\n\t\t\t\treturn URI.revive(markdown.uris[value]);\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t\treturn encodeURIComponent(JSON.stringify(data));\n\t};\n\n\tconst _href = function (href: string, isDomUri: boolean): string {\n\t\tconst data = markdown.uris && markdown.uris[href];\n\t\tlet uri = URI.revive(data);\n\t\tif (isDomUri) {\n\t\t\tif (href.startsWith(Schemas.data + ':')) {\n\t\t\t\treturn href;\n\t\t\t}\n\t\t\tif (!uri) {\n\t\t\t\turi = URI.parse(href);\n\t\t\t}\n\t\t\t// this URI will end up as \"src\"-attribute of a dom node\n\t\t\t// and because of that special rewriting needs to be done\n\t\t\t// so that the URI uses a protocol that's understood by\n\t\t\t// browsers (like http or https)\n\t\t\treturn FileAccess.asBrowserUri(uri).toString(true);\n\t\t}\n\t\tif (!uri) {\n\t\t\treturn href;\n\t\t}\n\t\tif (URI.parse(href).toString() === uri.toString()) {\n\t\t\treturn href; // no transformation performed\n\t\t}\n\t\tif (uri.query) {\n\t\t\turi = uri.with({ query: _uriMassage(uri.query) });\n\t\t}\n\t\treturn uri.toString();\n\t};\n\n\t// signal to code-block render that the\n\t// element has been created\n\tlet signalInnerHTML: () => void;\n\tconst withInnerHTML = new Promise<void>(c => signalInnerHTML = c);\n\n\tconst renderer = new marked.Renderer();\n\n\trenderer.image = (href: string, title: string, text: string) => {\n\t\tlet dimensions: string[] = [];\n\t\tlet attributes: string[] = [];\n\t\tif (href) {\n\t\t\t({ href, dimensions } = parseHrefAndDimensions(href));\n\t\t\tattributes.push(`src=\"${href}\"`);\n\t\t}\n\t\tif (text) {\n\t\t\tattributes.push(`alt=\"${text}\"`);\n\t\t}\n\t\tif (title) {\n\t\t\tattributes.push(`title=\"${title}\"`);\n\t\t}\n\t\tif (dimensions.length) {\n\t\t\tattributes = attributes.concat(dimensions);\n\t\t}\n\t\treturn '<img ' + attributes.join(' ') + '>';\n\t};\n\trenderer.link = (href, title, text): string => {\n\t\tif (typeof href !== 'string') {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829\n\t\tif (href === text) { // raw link case\n\t\t\ttext = removeMarkdownEscapes(text);\n\t\t}\n\t\thref = _href(href, false);\n\t\tif (markdown.baseUri) {\n\t\t\thref = resolveWithBaseUri(URI.from(markdown.baseUri), href);\n\t\t}\n\t\ttitle = typeof title === 'string' ? removeMarkdownEscapes(title) : '';\n\t\thref = removeMarkdownEscapes(href);\n\t\tif (\n\t\t\t!href\n\t\t\t|| /^data:|javascript:/i.test(href)\n\t\t\t|| (/^command:/i.test(href) && !markdown.isTrusted)\n\t\t\t|| /^command:(\\/\\/\\/)?_workbench\\.downloadResource/i.test(href)\n\t\t) {\n\t\t\t// drop the link\n\t\t\treturn text;\n\n\t\t} else {\n\t\t\t// HTML Encode href\n\t\t\thref = href.replace(/&/g, '&')\n\t\t\t\t.replace(/</g, '<')\n\t\t\t\t.replace(/>/g, '>')\n\t\t\t\t.replace(/\"/g, '"')\n\t\t\t\t.replace(/'/g, ''');\n\t\t\treturn `<a data-href=\"${href}\" title=\"${title || href}\">${text}</a>`;\n\t\t}\n\t};\n\trenderer.paragraph = (text): string => {\n\t\treturn `<p>${text}</p>`;\n\t};\n\n\tif (options.codeBlockRenderer) {\n\t\trenderer.code = (code, lang) => {\n\t\t\tconst value = options.codeBlockRenderer!(lang ?? '', code);\n\t\t\t// when code-block rendering is async we return sync\n\t\t\t// but update the node with the real result later.\n\t\t\tconst id = defaultGenerator.nextId();\n\t\t\traceCancellation(Promise.all([value, withInnerHTML]), cts.token).then(values => {\n\t\t\t\tif (!isDisposed && values) {\n\t\t\t\t\tconst span = element.querySelector<HTMLDivElement>(`div[data-code=\"${id}\"]`);\n\t\t\t\t\tif (span) {\n\t\t\t\t\t\tDOM.reset(span, values[0]);\n\t\t\t\t\t}\n\t\t\t\t\toptions.asyncRenderCallback?.();\n\t\t\t\t}\n\t\t\t}).catch(() => {\n\t\t\t\t// ignore\n\t\t\t});\n\n\t\t\treturn `<div class=\"code\" data-code=\"${id}\">${escape(code)}</div>`;\n\t\t};\n\t}\n\n\tif (options.actionHandler) {\n\t\tconst onClick = options.actionHandler.disposables.add(new DomEmitter(element, 'click'));\n\t\tconst onAuxClick = options.actionHandler.disposables.add(new DomEmitter(element, 'auxclick'));\n\t\toptions.actionHandler.disposables.add(Event.any(onClick.event, onAuxClick.event)(e => {\n\t\t\tconst mouseEvent = new StandardMouseEvent(e);\n\t\t\tif (!mouseEvent.leftButton && !mouseEvent.middleButton) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet target: HTMLElement | null = mouseEvent.target;\n\t\t\tif (target.tagName !== 'A') {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t\tif (!target || target.tagName !== 'A') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tlet href = target.dataset['href'];\n\t\t\t\tif (href) {\n\t\t\t\t\tif (markdown.baseUri) {\n\t\t\t\t\t\thref = resolveWithBaseUri(URI.from(markdown.baseUri), href);\n\t\t\t\t\t}\n\t\t\t\t\toptions.actionHandler!.callback(href, mouseEvent);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t} finally {\n\t\t\t\tmouseEvent.preventDefault();\n\t\t\t}\n\t\t}));\n\t}\n\n\tif (!markdown.supportHtml) {\n\t\t// TODO: Can we deprecated this in favor of 'supportHtml'?\n\n\t\t// Use our own sanitizer so that we can let through only spans.\n\t\t// Otherwise, we'd be letting all html be rendered.\n\t\t// If we want to allow markdown permitted tags, then we can delete sanitizer and sanitize.\n\t\t// We always pass the output through dompurify after this so that we don't rely on\n\t\t// marked for sanitization.\n\t\tmarkedOptions.sanitizer = (html: string): string => {\n\t\t\tconst match = markdown.isTrusted ? html.match(/^(<span[^>]+>)|(<\\/\\s*span>)$/) : undefined;\n\t\t\treturn match ? html : '';\n\t\t};\n\t\tmarkedOptions.sanitize = true;\n\t\tmarkedOptions.silent = true;\n\t}\n\n\tmarkedOptions.renderer = renderer;\n\n\t// values that are too long will freeze the UI\n\tlet value = markdown.value ?? '';\n\tif (value.length > 100_000) {\n\t\tvalue = `${value.substr(0, 100_000)}…`;\n\t}\n\t// escape theme icons\n\tif (markdown.supportThemeIcons) {\n\t\tvalue = markdownEscapeEscapedIcons(value);\n\t}\n\n\tlet renderedMarkdown = marked.parse(value, markedOptions);\n\n\t// Rewrite theme icons\n\tif (markdown.supportThemeIcons) {\n\t\tconst elements = renderLabelWithIcons(renderedMarkdown);\n\t\trenderedMarkdown = elements.map(e => typeof e === 'string' ? e : e.outerHTML).join('');\n\t}\n\n\tconst htmlParser = new DOMParser();\n\tconst markdownHtmlDoc = htmlParser.parseFromString(sanitizeRenderedMarkdown(markdown, renderedMarkdown) as unknown as string, 'text/html');\n\n\tmarkdownHtmlDoc.body.querySelectorAll('img')\n\t\t.forEach(img => {\n\t\t\tconst src = img.getAttribute('src'); // Get the raw 'src' attribute value as text, not the resolved 'src'\n\t\t\tif (src) {\n\t\t\t\tlet href = src;\n\t\t\t\ttry {\n\t\t\t\t\tif (markdown.baseUri) { // absolute or relative local path, or file: uri\n\t\t\t\t\t\thref = resolveWithBaseUri(URI.from(markdown.baseUri), href);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) { }\n\n\t\t\t\timg.src = _href(href, true);\n\t\t\t}\n\t\t});\n\n\telement.innerHTML = sanitizeRenderedMarkdown(markdown, markdownHtmlDoc.body.innerHTML) as unknown as string;\n\n\t// signal that async code blocks can be now be inserted\n\tsignalInnerHTML!();\n\n\t// signal size changes for image tags\n\tif (options.asyncRenderCallback) {\n\t\tfor (const img of element.getElementsByTagName('img')) {\n\t\t\tconst listener = disposables.add(DOM.addDisposableListener(img, 'load', () => {\n\t\t\t\tlistener.dispose();\n\t\t\t\toptions.asyncRenderCallback!();\n\t\t\t}));\n\t\t}\n\t}\n\n\treturn {\n\t\telement,\n\t\tdispose: () => {\n\t\t\tisDisposed = true;\n\t\t\tcts.cancel();\n\t\t\tdisposables.dispose();\n\t\t}\n\t};\n}\n\nfunction resolveWithBaseUri(baseUri: URI, href: string): string {\n\tconst hasScheme = /^\\w[\\w\\d+.-]*:/.test(href);\n\tif (hasScheme) {\n\t\treturn href;\n\t}\n\n\tif (baseUri.path.endsWith('/')) {\n\t\treturn resolvePath(baseUri, href).toString();\n\t} else {\n\t\treturn resolvePath(dirname(baseUri), href).toString();\n\t}\n}\n\nfunction sanitizeRenderedMarkdown(\n\toptions: { isTrusted?: boolean },\n\trenderedMarkdown: string,\n): TrustedHTML {\n\tconst { config, allowedSchemes } = getSanitizerOptions(options);\n\tdompurify.addHook('uponSanitizeAttribute', (element, e) => {\n\t\tif (e.attrName === 'style' || e.attrName === 'class') {\n\t\t\tif (element.tagName === 'SPAN') {\n\t\t\t\tif (e.attrName === 'style') {\n\t\t\t\t\te.keepAttr = /^(color\\:#[0-9a-fA-F]+;)?(background-color\\:#[0-9a-fA-F]+;)?$/.test(e.attrValue);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (e.attrName === 'class') {\n\t\t\t\t\te.keepAttr = /^codicon codicon-[a-z\\-]+( codicon-modifier-[a-z\\-]+)?$/.test(e.attrValue);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\te.keepAttr = false;\n\t\t\treturn;\n\t\t}\n\t});\n\n\t// build an anchor to map URLs to\n\tconst anchor = document.createElement('a');\n\n\t// https://github.com/cure53/DOMPurify/blob/main/demos/hooks-scheme-allowlist.html\n\tdompurify.addHook('afterSanitizeAttributes', (node) => {\n\t\t// check all href/src attributes for validity\n\t\tfor (const attr of ['href', 'src']) {\n\t\t\tif (node.hasAttribute(attr)) {\n\t\t\t\tanchor.href = node.getAttribute(attr) as string;\n\t\t\t\tif (!allowedSchemes.includes(anchor.protocol.replace(/:$/, ''))) {\n\t\t\t\t\tnode.removeAttribute(attr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\ttry {\n\t\treturn dompurify.sanitize(renderedMarkdown, { ...config, RETURN_TRUSTED_TYPE: true });\n\t} finally {\n\t\tdompurify.removeHook('uponSanitizeAttribute');\n\t\tdompurify.removeHook('afterSanitizeAttributes');\n\t}\n}\n\nfunction getSanitizerOptions(options: { readonly isTrusted?: boolean }): { config: dompurify.Config; allowedSchemes: string[] } {\n\tconst allowedSchemes = [\n\t\tSchemas.http,\n\t\tSchemas.https,\n\t\tSchemas.mailto,\n\t\tSchemas.data,\n\t\tSchemas.file,\n\t\tSchemas.vscodeFileResource,\n\t\tSchemas.vscodeRemote,\n\t\tSchemas.vscodeRemoteResource,\n\t];\n\n\tif (options.isTrusted) {\n\t\tallowedSchemes.push(Schemas.command);\n\t}\n\n\treturn {\n\t\tconfig: {\n\t\t\t// allowedTags should included everything that markdown renders to.\n\t\t\t// Since we have our own sanitize function for marked, it's possible we missed some tag so let dompurify make sure.\n\t\t\t// HTML tags that can result from markdown are from reading https://spec.commonmark.org/0.29/\n\t\t\t// HTML table tags that can result from markdown are from https://github.github.com/gfm/#tables-extension-\n\t\t\tALLOWED_TAGS: ['ul', 'li', 'p', 'b', 'i', 'code', 'blockquote', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'em', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'div', 'del', 'a', 'strong', 'br', 'img', 'span'],\n\t\t\tALLOWED_ATTR: ['href', 'data-href', 'target', 'title', 'src', 'alt', 'class', 'style', 'data-code', 'width', 'height', 'align'],\n\t\t\tALLOW_UNKNOWN_PROTOCOLS: true,\n\t\t},\n\t\tallowedSchemes\n\t};\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 { hasDriveLetter, isRootOrDriveLetter } from 'vs/base/common/extpath';\nimport { Schemas } from 'vs/base/common/network';\nimport { isWindows } from 'vs/base/common/platform';\nimport { basename } from 'vs/base/common/resources';\nimport { URI } from 'vs/base/common/uri';\n\nexport interface IWorkspaceFolderProvider {\n}\n\nexport function getBaseLabel(resource: URI | string): string;\nexport function getBaseLabel(resource: URI | string | undefined): string | undefined;\nexport function getBaseLabel(resource: URI | string | undefined): string | undefined {\n\tif (!resource) {\n\t\treturn undefined;\n\t}\n\n\tif (typeof resource === 'string') {\n\t\tresource = URI.file(resource);\n\t}\n\n\tconst base = basename(resource) || (resource.scheme === Schemas.file ? resource.fsPath : resource.path) /* can be empty string if '/' is passed in */;\n\n\t// convert c: => C:\n\tif (isWindows && isRootOrDriveLetter(base)) {\n\t\treturn normalizeDriveLetter(base);\n\t}\n\n\treturn base;\n}\n\nexport function normalizeDriveLetter(path: string, continueAsWindows?: boolean): string {\n\tif (hasDriveLetter(path, continueAsWindows)) {\n\t\treturn path.charAt(0).toUpperCase() + path.slice(1);\n\t}\n\n\treturn path;\n}\n\nlet normalizedUserHomeCached: { original: string; normalized: string } = Object.create(null);\n","\n\n// prep-work\nconst _data = new Uint8Array(16);\nconst _hex: string[] = [];\nfor (let i = 0; i < 256; i++) {\n\t_hex.push(i.toString(16).padStart(2, '0'));\n}\n\n// todo@jrieken - with node@15 crypto#getRandomBytes is available everywhere, https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#browser_compatibility\nlet _fillRandomValues: (bucket: Uint8Array) => Uint8Array;\n\ndeclare const crypto: undefined | { getRandomValues(data: Uint8Array): Uint8Array };\n\nif (typeof crypto === 'object' && typeof crypto.getRandomValues === 'function') {\n\t// browser\n\t_fillRandomValues = crypto.getRandomValues.bind(crypto);\n\n} else {\n\t_fillRandomValues = function (bucket: Uint8Array): Uint8Array {\n\t\tfor (let i = 0; i < bucket.length; i++) {\n\t\t\tbucket[i] = Math.floor(Math.random() * 256);\n\t\t}\n\t\treturn bucket;\n\t};\n}\n\nexport function generateUuid(): string {\n\t// get data\n\t_fillRandomValues(_data);\n\n\t// set version bits\n\t_data[6] = (_data[6] & 0x0f) | 0x40;\n\t_data[8] = (_data[8] & 0x3f) | 0x80;\n\n\t// print as string\n\tlet i = 0;\n\tlet result = '';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\treturn result;\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 { transformErrorForSerialization } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { globals, isWeb } from 'vs/base/common/platform';\nimport * as types from 'vs/base/common/types';\nimport * as strings from 'vs/base/common/strings';\n\nconst INITIALIZE = '$initialize';\n\nexport interface IWorker extends IDisposable {\n\tgetId(): number;\n\tpostMessage(message: Message, transfer: ArrayBuffer[]): void;\n}\n\nexport interface IWorkerCallback {\n\t(message: Message): void;\n}\n\nexport interface IWorkerFactory {\n\tcreate(moduleId: string, callback: IWorkerCallback, onErrorCallback: (err: any) => void): IWorker;\n}\n\nlet webWorkerWarningLogged = false;\nexport function logOnceWebWorkerWarning(err: any): void {\n\tif (!isWeb) {\n\t\t// running tests\n\t\treturn;\n\t}\n\tif (!webWorkerWarningLogged) {\n\t\twebWorkerWarningLogged = true;\n\t\tconsole.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq');\n\t}\n\tconsole.warn(err.message);\n}\n\nconst enum MessageType {\n\tRequest,\n\tReply,\n\tSubscribeEvent,\n\tEvent,\n\tUnsubscribeEvent\n}\nclass RequestMessage {\n\tpublic readonly type = MessageType.Request;\n\tconstructor(\n\t\tpublic readonly vsWorker: number,\n\t\tpublic readonly req: string,\n\t\tpublic readonly method: string,\n\t\tpublic readonly args: any[]\n\t) { }\n}\nclass ReplyMessage {\n\tpublic readonly type = MessageType.Reply;\n\tconstructor(\n\t\tpublic readonly vsWorker: number,\n\t\tpublic readonly seq: string,\n\t\tpublic readonly res: any,\n\t\tpublic readonly err: any\n\t) { }\n}\nclass SubscribeEventMessage {\n\tpublic readonly type = MessageType.SubscribeEvent;\n\tconstructor(\n\t\tpublic readonly vsWorker: number,\n\t\tpublic readonly req: string,\n\t\tpublic readonly eventName: string,\n\t\tpublic readonly arg: any\n\t) { }\n}\nclass EventMessage {\n\tpublic readonly type = MessageType.Event;\n\tconstructor(\n\t\tpublic readonly vsWorker: number,\n\t\tpublic readonly req: string,\n\t\tpublic readonly event: any\n\t) { }\n}\nclass UnsubscribeEventMessage {\n\tpublic readonly type = MessageType.UnsubscribeEvent;\n\tconstructor(\n\t\tpublic readonly vsWorker: number,\n\t\tpublic readonly req: string\n\t) { }\n}\ntype Message = RequestMessage | ReplyMessage | SubscribeEventMessage | EventMessage | UnsubscribeEventMessage;\n\ninterface IMessageReply {\n\tresolve: (value?: any) => void;\n\treject: (error?: any) => void;\n}\n\ninterface IMessageHandler {\n\tsendMessage(msg: any, transfer?: ArrayBuffer[]): void;\n\thandleMessage(method: string, args: any[]): Promise<any>;\n\thandleEvent(eventName: string, arg: any): Event<any>;\n}\n\nclass SimpleWorkerProtocol {\n\n\tprivate _workerId: number;\n\tprivate _lastSentReq: number;\n\tprivate _pendingReplies: { [req: string]: IMessageReply };\n\tprivate _pendingEmitters: Map<string, Emitter<any>>;\n\tprivate _pendingEvents: Map<string, IDisposable>;\n\tprivate _handler: IMessageHandler;\n\n\tconstructor(handler: IMessageHandler) {\n\t\tthis._workerId = -1;\n\t\tthis._handler = handler;\n\t\tthis._lastSentReq = 0;\n\t\tthis._pendingReplies = Object.create(null);\n\t\tthis._pendingEmitters = new Map<string, Emitter<any>>();\n\t\tthis._pendingEvents = new Map<string, IDisposable>();\n\t}\n\n\tpublic setWorkerId(workerId: number): void {\n\t\tthis._workerId = workerId;\n\t}\n\n\tpublic sendMessage(method: string, args: any[]): Promise<any> {\n\t\tconst req = String(++this._lastSentReq);\n\t\treturn new Promise<any>((resolve, reject) => {\n\t\t\tthis._pendingReplies[req] = {\n\t\t\t\tresolve: resolve,\n\t\t\t\treject: reject\n\t\t\t};\n\t\t\tthis._send(new RequestMessage(this._workerId, req, method, args));\n\t\t});\n\t}\n\n\tpublic listen(eventName: string, arg: any): Event<any> {\n\t\tlet req: string | null = null;\n\t\tconst emitter = new Emitter<any>({\n\t\t\tonFirstListenerAdd: () => {\n\t\t\t\treq = String(++this._lastSentReq);\n\t\t\t\tthis._pendingEmitters.set(req, emitter);\n\t\t\t\tthis._send(new SubscribeEventMessage(this._workerId, req, eventName, arg));\n\t\t\t},\n\t\t\tonLastListenerRemove: () => {\n\t\t\t\tthis._pendingEmitters.delete(req!);\n\t\t\t\tthis._send(new UnsubscribeEventMessage(this._workerId, req!));\n\t\t\t\treq = null;\n\t\t\t}\n\t\t});\n\t\treturn emitter.event;\n\t}\n\n\tpublic handleMessage(message: Message): void {\n\t\tif (!message || !message.vsWorker) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._workerId !== -1 && message.vsWorker !== this._workerId) {\n\t\t\treturn;\n\t\t}\n\t\tthis._handleMessage(message);\n\t}\n\n\tprivate _handleMessage(msg: Message): void {\n\t\tswitch (msg.type) {\n\t\t\tcase MessageType.Reply:\n\t\t\t\treturn this._handleReplyMessage(msg);\n\t\t\tcase MessageType.Request:\n\t\t\t\treturn this._handleRequestMessage(msg);\n\t\t\tcase MessageType.SubscribeEvent:\n\t\t\t\treturn this._handleSubscribeEventMessage(msg);\n\t\t\tcase MessageType.Event:\n\t\t\t\treturn this._handleEventMessage(msg);\n\t\t\tcase MessageType.UnsubscribeEvent:\n\t\t\t\treturn this._handleUnsubscribeEventMessage(msg);\n\t\t}\n\t}\n\n\tprivate _handleReplyMessage(replyMessage: ReplyMessage): void {\n\t\tif (!this._pendingReplies[replyMessage.seq]) {\n\t\t\tconsole.warn('Got reply to unknown seq');\n\t\t\treturn;\n\t\t}\n\n\t\tlet reply = this._pendingReplies[replyMessage.seq];\n\t\tdelete this._pendingReplies[replyMessage.seq];\n\n\t\tif (replyMessage.err) {\n\t\t\tlet err = replyMessage.err;\n\t\t\tif (replyMessage.err.$isError) {\n\t\t\t\terr = new Error();\n\t\t\t\terr.name = replyMessage.err.name;\n\t\t\t\terr.message = replyMessage.err.message;\n\t\t\t\terr.stack = replyMessage.err.stack;\n\t\t\t}\n\t\t\treply.reject(err);\n\t\t\treturn;\n\t\t}\n\n\t\treply.resolve(replyMessage.res);\n\t}\n\n\tprivate _handleRequestMessage(requestMessage: RequestMessage): void {\n\t\tlet req = requestMessage.req;\n\t\tlet result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\n\t\tresult.then((r) => {\n\t\t\tthis._send(new ReplyMessage(this._workerId, req, r, undefined));\n\t\t}, (e) => {\n\t\t\tif (e.detail instanceof Error) {\n\t\t\t\t// Loading errors have a detail property that points to the actual error\n\t\t\t\te.detail = transformErrorForSerialization(e.detail);\n\t\t\t}\n\t\t\tthis._send(new ReplyMessage(this._workerId, req, undefined, transformErrorForSerialization(e)));\n\t\t});\n\t}\n\n\tprivate _handleSubscribeEventMessage(msg: SubscribeEventMessage): void {\n\t\tconst req = msg.req;\n\t\tconst disposable = this._handler.handleEvent(msg.eventName, msg.arg)((event) => {\n\t\t\tthis._send(new EventMessage(this._workerId, req, event));\n\t\t});\n\t\tthis._pendingEvents.set(req, disposable);\n\t}\n\n\tprivate _handleEventMessage(msg: EventMessage): void {\n\t\tif (!this._pendingEmitters.has(msg.req)) {\n\t\t\tconsole.warn('Got event for unknown req');\n\t\t\treturn;\n\t\t}\n\t\tthis._pendingEmitters.get(msg.req)!.fire(msg.event);\n\t}\n\n\tprivate _handleUnsubscribeEventMessage(msg: UnsubscribeEventMessage): void {\n\t\tif (!this._pendingEvents.has(msg.req)) {\n\t\t\tconsole.warn('Got unsubscribe for unknown req');\n\t\t\treturn;\n\t\t}\n\t\tthis._pendingEvents.get(msg.req)!.dispose();\n\t\tthis._pendingEvents.delete(msg.req);\n\t}\n\n\tprivate _send(msg: Message): void {\n\t\tlet transfer: ArrayBuffer[] = [];\n\t\tif (msg.type === MessageType.Request) {\n\t\t\tfor (let i = 0; i < msg.args.length; i++) {\n\t\t\t\tif (msg.args[i] instanceof ArrayBuffer) {\n\t\t\t\t\ttransfer.push(msg.args[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (msg.type === MessageType.Reply) {\n\t\t\tif (msg.res instanceof ArrayBuffer) {\n\t\t\t\ttransfer.push(msg.res);\n\t\t\t}\n\t\t}\n\t\tthis._handler.sendMessage(msg, transfer);\n\t}\n}\n\nexport interface IWorkerClient<W> {\n\tgetProxyObject(): Promise<W>;\n\tdispose(): void;\n}\n\n/**\n * Main thread side\n */\nexport class SimpleWorkerClient<W extends object, H extends object> extends Disposable implements IWorkerClient<W> {\n\n\tprivate readonly _worker: IWorker;\n\tprivate readonly _onModuleLoaded: Promise<string[]>;\n\tprivate readonly _protocol: SimpleWorkerProtocol;\n\tprivate readonly _lazyProxy: Promise<W>;\n\n\tconstructor(workerFactory: IWorkerFactory, moduleId: string, host: H) {\n\t\tsuper();\n\n\t\tlet lazyProxyReject: ((err: any) => void) | null = null;\n\n\t\tthis._worker = this._register(workerFactory.create(\n\t\t\t'vs/base/common/worker/simpleWorker',\n\t\t\t(msg: Message) => {\n\t\t\t\tthis._protocol.handleMessage(msg);\n\t\t\t},\n\t\t\t(err: any) => {\n\t\t\t\t// in Firefox, web workers fail lazily :(\n\t\t\t\t// we will reject the proxy\n\t\t\t\tif (lazyProxyReject) {\n\t\t\t\t\tlazyProxyReject(err);\n\t\t\t\t}\n\t\t\t}\n\t\t));\n\n\t\tthis._protocol = new SimpleWorkerProtocol({\n\t\t\tsendMessage: (msg: any, transfer: ArrayBuffer[]): void => {\n\t\t\t\tthis._worker.postMessage(msg, transfer);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => {\n\t\t\t\tif (typeof (host as any)[method] !== 'function') {\n\t\t\t\t\treturn Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\treturn Promise.resolve((host as any)[method].apply(host, args));\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn Promise.reject(e);\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleEvent: (eventName: string, arg: any): Event<any> => {\n\t\t\t\tif (propertyIsDynamicEvent(eventName)) {\n\t\t\t\t\tconst event = (host as any)[eventName].call(host, arg);\n\t\t\t\t\tif (typeof event !== 'function') {\n\t\t\t\t\t\tthrow new Error(`Missing dynamic event ${eventName} on main thread host.`);\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tif (propertyIsEvent(eventName)) {\n\t\t\t\t\tconst event = (host as any)[eventName];\n\t\t\t\t\tif (typeof event !== 'function') {\n\t\t\t\t\t\tthrow new Error(`Missing event ${eventName} on main thread host.`);\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Malformed event name ${eventName}`);\n\t\t\t}\n\t\t});\n\t\tthis._protocol.setWorkerId(this._worker.getId());\n\n\t\t// Gather loader configuration\n\t\tlet loaderConfiguration: any = null;\n\t\tif (typeof globals.require !== 'undefined' && typeof globals.require.getConfig === 'function') {\n\t\t\t// Get the configuration from the Monaco AMD Loader\n\t\t\tloaderConfiguration = globals.require.getConfig();\n\t\t} else if (typeof globals.requirejs !== 'undefined') {\n\t\t\t// Get the configuration from requirejs\n\t\t\tloaderConfiguration = globals.requirejs.s.contexts._.config;\n\t\t}\n\n\t\tconst hostMethods = types.getAllMethodNames(host);\n\n\t\t// Send initialize message\n\t\tthis._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n\t\t\tthis._worker.getId(),\n\t\t\tJSON.parse(JSON.stringify(loaderConfiguration)),\n\t\t\tmoduleId,\n\t\t\thostMethods,\n\t\t]);\n\n\t\t// Create proxy to loaded code\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\n\t\t\treturn this._request(method, args);\n\t\t};\n\t\tconst proxyListen = (eventName: string, arg: any): Event<any> => {\n\t\t\treturn this._protocol.listen(eventName, arg);\n\t\t};\n\n\t\tthis._lazyProxy = new Promise<W>((resolve, reject) => {\n\t\t\tlazyProxyReject = reject;\n\t\t\tthis._onModuleLoaded.then((availableMethods: string[]) => {\n\t\t\t\tresolve(createProxyObject<W>(availableMethods, proxyMethodRequest, proxyListen));\n\t\t\t}, (e) => {\n\t\t\t\treject(e);\n\t\t\t\tthis._onError('Worker failed to load ' + moduleId, e);\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic getProxyObject(): Promise<W> {\n\t\treturn this._lazyProxy;\n\t}\n\n\tprivate _request(method: string, args: any[]): Promise<any> {\n\t\treturn new Promise<any>((resolve, reject) => {\n\t\t\tthis._onModuleLoaded.then(() => {\n\t\t\t\tthis._protocol.sendMessage(method, args).then(resolve, reject);\n\t\t\t}, reject);\n\t\t});\n\t}\n\n\tprivate _onError(message: string, error?: any): void {\n\t\tconsole.error(message);\n\t\tconsole.info(error);\n\t}\n}\n\nfunction propertyIsEvent(name: string): boolean {\n\t// Assume a property is an event if it has a form of \"onSomething\"\n\treturn name[0] === 'o' && name[1] === 'n' && strings.isUpperAsciiLetter(name.charCodeAt(2));\n}\n\nfunction propertyIsDynamicEvent(name: string): boolean {\n\t// Assume a property is a dynamic event (a method that returns an event) if it has a form of \"onDynamicSomething\"\n\treturn /^onDynamic/.test(name) && strings.isUpperAsciiLetter(name.charCodeAt(9));\n}\n\nfunction createProxyObject<T extends object>(\n\tmethodNames: string[],\n\tinvoke: (method: string, args: unknown[]) => unknown,\n\tproxyListen: (eventName: string, arg: any) => Event<any>\n): T {\n\tconst createProxyMethod = (method: string): () => unknown => {\n\t\treturn function () {\n\t\t\tconst args = Array.prototype.slice.call(arguments, 0);\n\t\t\treturn invoke(method, args);\n\t\t};\n\t};\n\tconst createProxyDynamicEvent = (eventName: string): (arg: any) => Event<any> => {\n\t\treturn function (arg) {\n\t\t\treturn proxyListen(eventName, arg);\n\t\t};\n\t};\n\n\tlet result = {} as T;\n\tfor (const methodName of methodNames) {\n\t\tif (propertyIsDynamicEvent(methodName)) {\n\t\t\t(<any>result)[methodName] = createProxyDynamicEvent(methodName);\n\t\t\tcontinue;\n\t\t}\n\t\tif (propertyIsEvent(methodName)) {\n\t\t\t(<any>result)[methodName] = proxyListen(methodName, undefined);\n\t\t\tcontinue;\n\t\t}\n\t\t(<any>result)[methodName] = createProxyMethod(methodName);\n\t}\n\treturn result;\n}\n\nexport interface IRequestHandler {\n\t_requestHandlerBrand: any;\n\t[prop: string]: any;\n}\n\nexport interface IRequestHandlerFactory<H> {\n\t(host: H): IRequestHandler;\n}\n\n/**\n * Worker side\n */\nexport class SimpleWorkerServer<H extends object> {\n\n\tprivate _requestHandlerFactory: IRequestHandlerFactory<H> | null;\n\tprivate _requestHandler: IRequestHandler | null;\n\tprivate _protocol: SimpleWorkerProtocol;\n\n\tconstructor(postMessage: (msg: Message, transfer?: ArrayBuffer[]) => void, requestHandlerFactory: IRequestHandlerFactory<H> | null) {\n\t\tthis._requestHandlerFactory = requestHandlerFactory;\n\t\tthis._requestHandler = null;\n\t\tthis._protocol = new SimpleWorkerProtocol({\n\t\t\tsendMessage: (msg: any, transfer: ArrayBuffer[]): void => {\n\t\t\t\tpostMessage(msg, transfer);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => this._handleMessage(method, args),\n\t\t\thandleEvent: (eventName: string, arg: any): Event<any> => this._handleEvent(eventName, arg)\n\t\t});\n\t}\n\n\tpublic onmessage(msg: any): void {\n\t\tthis._protocol.handleMessage(msg);\n\t}\n\n\tprivate _handleMessage(method: string, args: any[]): Promise<any> {\n\t\tif (method === INITIALIZE) {\n\t\t\treturn this.initialize(<number>args[0], <any>args[1], <string>args[2], <string[]>args[3]);\n\t\t}\n\n\t\tif (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\n\t\t\treturn Promise.reject(new Error('Missing requestHandler or method: ' + method));\n\t\t}\n\n\t\ttry {\n\t\t\treturn Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\n\t\t} catch (e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n\n\tprivate _handleEvent(eventName: string, arg: any): Event<any> {\n\t\tif (!this._requestHandler) {\n\t\t\tthrow new Error(`Missing requestHandler`);\n\t\t}\n\t\tif (propertyIsDynamicEvent(eventName)) {\n\t\t\tconst event = (this._requestHandler as any)[eventName].call(this._requestHandler, arg);\n\t\t\tif (typeof event !== 'function') {\n\t\t\t\tthrow new Error(`Missing dynamic event ${eventName} on request handler.`);\n\t\t\t}\n\t\t\treturn event;\n\t\t}\n\t\tif (propertyIsEvent(eventName)) {\n\t\t\tconst event = (this._requestHandler as any)[eventName];\n\t\t\tif (typeof event !== 'function') {\n\t\t\t\tthrow new Error(`Missing event ${eventName} on request handler.`);\n\t\t\t}\n\t\t\treturn event;\n\t\t}\n\t\tthrow new Error(`Malformed event name ${eventName}`);\n\t}\n\n\tprivate initialize(workerId: number, loaderConfig: any, moduleId: string, hostMethods: string[]): Promise<string[]> {\n\t\tthis._protocol.setWorkerId(workerId);\n\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\n\t\t\treturn this._protocol.sendMessage(method, args);\n\t\t};\n\t\tconst proxyListen = (eventName: string, arg: any): Event<any> => {\n\t\t\treturn this._protocol.listen(eventName, arg);\n\t\t};\n\n\t\tconst hostProxy = createProxyObject<H>(hostMethods, proxyMethodRequest, proxyListen);\n\n\t\tif (this._requestHandlerFactory) {\n\t\t\t// static request handler\n\t\t\tthis._requestHandler = this._requestHandlerFactory(hostProxy);\n\t\t\treturn Promise.resolve(types.getAllMethodNames(this._requestHandler));\n\t\t}\n\n\t\tif (loaderConfig) {\n\t\t\t// Remove 'baseUrl', handling it is beyond scope for now\n\t\t\tif (typeof loaderConfig.baseUrl !== 'undefined') {\n\t\t\t\tdelete loaderConfig['baseUrl'];\n\t\t\t}\n\t\t\tif (typeof loaderConfig.paths !== 'undefined') {\n\t\t\t\tif (typeof loaderConfig.paths.vs !== 'undefined') {\n\t\t\t\t\tdelete loaderConfig.paths['vs'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof loaderConfig.trustedTypesPolicy !== undefined) {\n\t\t\t\t// don't use, it has been destroyed during serialize\n\t\t\t\tdelete loaderConfig['trustedTypesPolicy'];\n\t\t\t}\n\n\t\t\t// Since this is in a web worker, enable catching errors\n\t\t\tloaderConfig.catchError = true;\n\t\t\tglobals.require.config(loaderConfig);\n\t\t}\n\n\t\treturn new Promise<string[]>((resolve, reject) => {\n\t\t\t// Use the global require to be sure to get the global config\n\n\t\t\t// ESM-comment-begin\n\t\t\tconst req = (globals.require || require);\n\t\t\t// ESM-comment-end\n\t\t\t// ESM-uncomment-begin\n\t\t\t// const req = globals.require;\n\t\t\t// ESM-uncomment-end\n\n\t\t\treq([moduleId], (module: { create: IRequestHandlerFactory<H> }) => {\n\t\t\t\tthis._requestHandler = module.create(hostProxy);\n\n\t\t\t\tif (!this._requestHandler) {\n\t\t\t\t\treject(new Error(`No RequestHandler!`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(types.getAllMethodNames(this._requestHandler));\n\t\t\t}, reject);\n\t\t});\n\t}\n}\n\n/**\n * Called on the worker side\n */\nexport function create(postMessage: (msg: Message, transfer?: ArrayBuffer[]) => void): SimpleWorkerServer<any> {\n\treturn new SimpleWorkerServer(postMessage, null);\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 { globals } from 'vs/base/common/platform';\nimport { IWorker, IWorkerCallback, IWorkerFactory, logOnceWebWorkerWarning } from 'vs/base/common/worker/simpleWorker';\n\nconst ttPolicy = window.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });\n\nfunction getWorker(label: string): Worker | Promise<Worker> {\n\t// Option for hosts to overwrite the worker script (used in the standalone editor)\n\tif (globals.MonacoEnvironment) {\n\t\tif (typeof globals.MonacoEnvironment.getWorker === 'function') {\n\t\t\treturn globals.MonacoEnvironment.getWorker('workerMain.js', label);\n\t\t}\n\t\tif (typeof globals.MonacoEnvironment.getWorkerUrl === 'function') {\n\t\t\tconst workerUrl = <string>globals.MonacoEnvironment.getWorkerUrl('workerMain.js', label);\n\t\t\treturn new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label });\n\t\t}\n\t}\n\t// ESM-comment-begin\n\tif (typeof require === 'function') {\n\t\t// check if the JS lives on a different origin\n\t\tconst workerMain = require.toUrl('vs/base/worker/workerMain.js'); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321\n\t\tconst workerUrl = getWorkerBootstrapUrl(workerMain, label);\n\t\treturn new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label });\n\t}\n\t// ESM-comment-end\n\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);\n}\n\n// ESM-comment-begin\nexport function getWorkerBootstrapUrl(scriptPath: string, label: string): string {\n\tif (/^((http:)|(https:)|(file:))/.test(scriptPath) && scriptPath.substring(0, self.origin.length) !== self.origin) {\n\t\t// this is the cross-origin case\n\t\t// i.e. the webpage is running at a different origin than where the scripts are loaded from\n\t\tconst myPath = 'vs/base/worker/defaultWorkerFactory.js';\n\t\tconst workerBaseUrl = require.toUrl(myPath).slice(0, -myPath.length); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321\n\t\tconst js = `/*${label}*/self.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};const ttPolicy = self.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });importScripts(ttPolicy?.createScriptURL('${scriptPath}') ?? '${scriptPath}');/*${label}*/`;\n\t\tconst blob = new Blob([js], { type: 'application/javascript' });\n\t\treturn URL.createObjectURL(blob);\n\t}\n\treturn scriptPath + '#' + label;\n}\n// ESM-comment-end\n\nfunction isPromiseLike<T>(obj: any): obj is PromiseLike<T> {\n\tif (typeof obj.then === 'function') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * A worker that uses HTML5 web workers so that is has\n * its own global scope and its own thread.\n */\nclass WebWorker implements IWorker {\n\n\tprivate id: number;\n\tprivate worker: Promise<Worker> | null;\n\n\tconstructor(moduleId: string, id: number, label: string, onMessageCallback: IWorkerCallback, onErrorCallback: (err: any) => void) {\n\t\tthis.id = id;\n\t\tconst workerOrPromise = getWorker(label);\n\t\tif (isPromiseLike(workerOrPromise)) {\n\t\t\tthis.worker = workerOrPromise;\n\t\t} else {\n\t\t\tthis.worker = Promise.resolve(workerOrPromise);\n\t\t}\n\t\tthis.postMessage(moduleId, []);\n\t\tthis.worker.then((w) => {\n\t\t\tw.onmessage = function (ev) {\n\t\t\t\tonMessageCallback(ev.data);\n\t\t\t};\n\t\t\tw.onmessageerror = onErrorCallback;\n\t\t\tif (typeof w.addEventListener === 'function') {\n\t\t\t\tw.addEventListener('error', onErrorCallback);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getId(): number {\n\t\treturn this.id;\n\t}\n\n\tpublic postMessage(message: any, transfer: Transferable[]): void {\n\t\tif (this.worker) {\n\t\t\tthis.worker.then(w => w.postMessage(message, transfer));\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.worker) {\n\t\t\tthis.worker.then(w => w.terminate());\n\t\t}\n\t\tthis.worker = null;\n\t}\n}\n\nexport class DefaultWorkerFactory implements IWorkerFactory {\n\n\tprivate static LAST_WORKER_ID = 0;\n\n\tprivate _label: string | undefined;\n\tprivate _webWorkerFailedBeforeError: any;\n\n\tconstructor(label: string | undefined) {\n\t\tthis._label = label;\n\t\tthis._webWorkerFailedBeforeError = false;\n\t}\n\n\tpublic create(moduleId: string, onMessageCallback: IWorkerCallback, onErrorCallback: (err: any) => void): IWorker {\n\t\tlet workerId = (++DefaultWorkerFactory.LAST_WORKER_ID);\n\n\t\tif (this._webWorkerFailedBeforeError) {\n\t\t\tthrow this._webWorkerFailedBeforeError;\n\t\t}\n\n\t\treturn new WebWorker(moduleId, workerId, this._label || 'anonymous' + workerId, onMessageCallback, (err) => {\n\t\t\tlogOnceWebWorkerWarning(err);\n\t\t\tthis._webWorkerFailedBeforeError = err;\n\t\t\tonErrorCallback(err);\n\t\t});\n\t}\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 'vs/base/common/event';\nimport { IMatch } from 'vs/base/common/filters';\nimport { IItemAccessor } from 'vs/base/common/fuzzyScorer';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\n\nexport interface IQuickPickItemHighlights {\n\tlabel?: IMatch[];\n\tdescription?: IMatch[];\n\tdetail?: IMatch[];\n}\n\nexport interface IQuickPickItem {\n\ttype?: 'item';\n\tlabel: string;\n\tmeta?: string;\n\tariaLabel?: string;\n\tdescription?: string;\n\tdetail?: string;\n\t/**\n\t * Allows to show a keybinding next to the item to indicate\n\t * how the item can be triggered outside of the picker using\n\t * keyboard shortcut.\n\t */\n\tkeybinding?: ResolvedKeybinding;\n\ticonClasses?: string[];\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\thighlights?: IQuickPickItemHighlights;\n\tbuttons?: IQuickInputButton[];\n\tpicked?: boolean;\n\talwaysShow?: boolean;\n}\n\nexport interface IQuickPickSeparator {\n\ttype: 'separator';\n\tlabel?: string;\n}\n\nexport interface IKeyMods {\n\treadonly ctrlCmd: boolean;\n\treadonly alt: boolean;\n}\n\nexport const NO_KEY_MODS: IKeyMods = { ctrlCmd: false, alt: false };\n\nexport interface IQuickNavigateConfiguration {\n\tkeybindings: ResolvedKeybinding[];\n}\n\nexport interface IPickOptions<T extends IQuickPickItem> {\n\n\t/**\n\t * an optional string to show as the title of the quick input\n\t */\n\ttitle?: string;\n\n\t/**\n\t * an optional string to show as placeholder in the input box to guide the user what she picks on\n\t */\n\tplaceHolder?: string;\n\n\t/**\n\t * an optional flag to include the description when filtering the picks\n\t */\n\tmatchOnDescription?: boolean;\n\n\t/**\n\t * an optional flag to include the detail when filtering the picks\n\t */\n\tmatchOnDetail?: boolean;\n\n\t/**\n\t * an optional flag to filter the picks based on label. Defaults to true.\n\t */\n\tmatchOnLabel?: boolean;\n\n\t/**\n\t * an option flag to control whether focus is always automatically brought to a list item. Defaults to true.\n\t */\n\tautoFocusOnList?: boolean;\n\n\t/**\n\t * an optional flag to not close the picker on focus lost\n\t */\n\tignoreFocusLost?: boolean;\n\n\t/**\n\t * an optional flag to make this picker multi-select\n\t */\n\tcanPickMany?: boolean;\n\n\t/**\n\t * enables quick navigate in the picker to open an element without typing\n\t */\n\tquickNavigate?: IQuickNavigateConfiguration;\n\n\t/**\n\t * a context key to set when this picker is active\n\t */\n\tcontextKey?: string;\n\n\t/**\n\t * an optional property for the item to focus initially.\n\t */\n\tactiveItem?: Promise<T> | T;\n\n\tonKeyMods?: (keyMods: IKeyMods) => void;\n\tonDidFocus?: (entry: T) => void;\n\tonDidTriggerItemButton?: (context: IQuickPickItemButtonContext<T>) => void;\n}\n\nexport enum QuickInputHideReason {\n\n\t/**\n\t * Focus moved away from the quick input.\n\t */\n\tBlur = 1,\n\n\t/**\n\t * An explicit user gesture, e.g. pressing Escape key.\n\t */\n\tGesture,\n\n\t/**\n\t * Anything else.\n\t */\n\tOther\n}\n\nexport interface IQuickInputHideEvent {\n\treason: QuickInputHideReason;\n}\n\nexport interface IQuickInput extends IDisposable {\n\n\treadonly onDidHide: Event<IQuickInputHideEvent>;\n\n\ttitle: string | undefined;\n\n\tcontextKey: string | undefined;\n\n\tbusy: boolean;\n\n\tignoreFocusOut: boolean;\n\n\tshow(): void;\n\n\thide(): void;\n}\n\nexport interface IQuickPickWillAcceptEvent {\n\n\t/**\n\t * Allows to disable the default accept handling\n\t * of the picker. If `veto` is called, the picker\n\t * will not trigger the `onDidAccept` event.\n\t */\n\tveto(): void;\n}\n\nexport interface IQuickPickDidAcceptEvent {\n\n\t/**\n\t * Signals if the picker item is to be accepted\n\t * in the background while keeping the picker open.\n\t */\n\tinBackground: boolean;\n}\n\nexport enum ItemActivation {\n\tNONE,\n\tFIRST,\n\tSECOND,\n\tLAST\n}\n\nexport interface IQuickPick<T extends IQuickPickItem> extends IQuickInput {\n\n\tvalue: string;\n\n\t/**\n\t * A method that allows to massage the value used\n\t * for filtering, e.g, to remove certain parts.\n\t */\n\tfilterValue: (value: string) => string;\n\n\tariaLabel: string | undefined;\n\n\tplaceholder: string | undefined;\n\n\treadonly onDidChangeValue: Event<string>;\n\n\treadonly onWillAccept: Event<IQuickPickWillAcceptEvent>;\n\treadonly onDidAccept: Event<IQuickPickDidAcceptEvent>;\n\n\t/**\n\t * If enabled, will fire the `onDidAccept` event when\n\t * pressing the arrow-right key with the idea of accepting\n\t * the selected item without closing the picker.\n\t */\n\tcanAcceptInBackground: boolean;\n\n\treadonly onDidTriggerItemButton: Event<IQuickPickItemButtonEvent<T>>;\n\n\titems: ReadonlyArray<T | IQuickPickSeparator>;\n\n\tcanSelectMany: boolean;\n\n\tmatchOnDescription: boolean;\n\n\tmatchOnDetail: boolean;\n\n\tmatchOnLabel: boolean;\n\n\tsortByLabel: boolean;\n\n\tautoFocusOnList: boolean;\n\n\tkeepScrollPosition: boolean;\n\n\tquickNavigate: IQuickNavigateConfiguration | undefined;\n\n\tactiveItems: ReadonlyArray<T>;\n\n\treadonly onDidChangeActive: Event<T[]>;\n\n\t/**\n\t * Allows to control which entry should be activated by default.\n\t */\n\titemActivation: ItemActivation;\n\n\tselectedItems: ReadonlyArray<T>;\n\n\treadonly onDidChangeSelection: Event<T[]>;\n\n\treadonly keyMods: IKeyMods;\n\n\tvalueSelection: Readonly<[number, number]> | undefined;\n\n\t/**\n\t * Hides the input box from the picker UI. This is typically used\n\t * in combination with quick-navigation where no search UI should\n\t * be presented.\n\t */\n\thideInput: boolean;\n}\n\nexport interface IQuickInputButton {\n\t/** iconPath or iconClass required */\n\ticonPath?: { dark: URI; light?: URI };\n\t/** iconPath or iconClass required */\n\ticonClass?: string;\n\ttooltip?: string;\n\t/**\n\t * Whether to always show the button. By default buttons\n\t * are only visible when hovering over them with the mouse\n\t */\n\talwaysVisible?: boolean;\n}\n\nexport interface IQuickPickItemButtonEvent<T extends IQuickPickItem> {\n\tbutton: IQuickInputButton;\n\titem: T;\n}\n\nexport interface IQuickPickItemButtonContext<T extends IQuickPickItem> extends IQuickPickItemButtonEvent<T> {\n\tremoveItem(): void;\n}\n\nexport type QuickPickInput<T = IQuickPickItem> = T | IQuickPickSeparator;\n\n\n//#region Fuzzy Scorer Support\n\nexport type IQuickPickItemWithResource = IQuickPickItem & { resource?: URI };\n\nexport class QuickPickItemScorerAccessor implements IItemAccessor<IQuickPickItemWithResource> {\n\n\tconstructor(private options?: { skipDescription?: boolean; skipPath?: boolean }) { }\n}\n\nexport const quickPickItemScorerAccessor = new QuickPickItemScorerAccessor();\n\n//#endregion\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 { ThrottledDelayer } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { isUndefinedOrNull } from 'vs/base/common/types';\n\nexport interface IStorageOptions {\n}\n\nexport interface IUpdateRequest {\n\treadonly insert?: Map<string, string>;\n\treadonly delete?: Set<string>;\n}\n\nexport interface IStorageItemsChangeEvent {\n\treadonly changed?: Map<string, string>;\n\treadonly deleted?: Set<string>;\n}\n\nexport interface IStorageDatabase {\n\n\treadonly onDidChangeItemsExternal: Event<IStorageItemsChangeEvent>;\n\tupdateItems(request: IUpdateRequest): Promise<void>;\n}\n\nexport interface IStorage extends IDisposable {\n\n\tget(key: string, fallbackValue: string): string;\n\tget(key: string, fallbackValue?: string): string | undefined;\n\n\tgetBoolean(key: string, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, fallbackValue?: boolean): boolean | undefined;\n\n\tgetNumber(key: string, fallbackValue: number): number;\n\tgetNumber(key: string, fallbackValue?: number): number | undefined;\n\n\tset(key: string, value: string | boolean | number | undefined | null): Promise<void>;\n\tdelete(key: string): Promise<void>;\n}\n\nenum StorageState {\n\tNone,\n\tInitialized,\n\tClosed\n}\n\nexport class Storage extends Disposable implements IStorage {\n\n\tprivate static readonly DEFAULT_FLUSH_DELAY = 100;\n\n\tprivate readonly _onDidChangeStorage = this._register(new Emitter<string>());\n\treadonly onDidChangeStorage = this._onDidChangeStorage.event;\n\n\tprivate state = StorageState.None;\n\n\tprivate cache = new Map<string, string>();\n\n\tprivate readonly flushDelayer = new ThrottledDelayer<void>(Storage.DEFAULT_FLUSH_DELAY);\n\n\tprivate pendingDeletes = new Set<string>();\n\tprivate pendingInserts = new Map<string, string>();\n\n\tprivate readonly whenFlushedCallbacks: Function[] = [];\n\n\tconstructor(\n\t\tprotected readonly database: IStorageDatabase,\n\t\tprivate readonly options: IStorageOptions = Object.create(null)\n\t) {\n\t\tsuper();\n\n\t\tthis.registerListeners();\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.database.onDidChangeItemsExternal(e => this.onDidChangeItemsExternal(e)));\n\t}\n\n\tprivate onDidChangeItemsExternal(e: IStorageItemsChangeEvent): void {\n\t\t// items that change external require us to update our\n\t\t// caches with the values. we just accept the value and\n\t\t// emit an event if there is a change.\n\t\te.changed?.forEach((value, key) => this.accept(key, value));\n\t\te.deleted?.forEach(key => this.accept(key, undefined));\n\t}\n\n\tprivate accept(key: string, value: string | undefined): void {\n\t\tif (this.state === StorageState.Closed) {\n\t\t\treturn; // Return early if we are already closed\n\t\t}\n\n\t\tlet changed = false;\n\n\t\t// Item got removed, check for deletion\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\tchanged = this.cache.delete(key);\n\t\t}\n\n\t\t// Item got updated, check for change\n\t\telse {\n\t\t\tconst currentValue = this.cache.get(key);\n\t\t\tif (currentValue !== value) {\n\t\t\t\tthis.cache.set(key, value);\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\n\t\t// Signal to outside listeners\n\t\tif (changed) {\n\t\t\tthis._onDidChangeStorage.fire(key);\n\t\t}\n\t}\n\n\tget(key: string, fallbackValue: string): string;\n\tget(key: string, fallbackValue?: string): string | undefined;\n\tget(key: string, fallbackValue?: string): string | undefined {\n\t\tconst value = this.cache.get(key);\n\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\treturn fallbackValue;\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tgetBoolean(key: string, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, fallbackValue?: boolean): boolean | undefined;\n\tgetBoolean(key: string, fallbackValue?: boolean): boolean | undefined {\n\t\tconst value = this.get(key);\n\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\treturn fallbackValue;\n\t\t}\n\n\t\treturn value === 'true';\n\t}\n\n\tgetNumber(key: string, fallbackValue: number): number;\n\tgetNumber(key: string, fallbackValue?: number): number | undefined;\n\tgetNumber(key: string, fallbackValue?: number): number | undefined {\n\t\tconst value = this.get(key);\n\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\treturn fallbackValue;\n\t\t}\n\n\t\treturn parseInt(value, 10);\n\t}\n\n\tasync set(key: string, value: string | boolean | number | null | undefined): Promise<void> {\n\t\tif (this.state === StorageState.Closed) {\n\t\t\treturn; // Return early if we are already closed\n\t\t}\n\n\t\t// We remove the key for undefined/null values\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\treturn this.delete(key);\n\t\t}\n\n\t\t// Otherwise, convert to String and store\n\t\tconst valueStr = String(value);\n\n\t\t// Return early if value already set\n\t\tconst currentValue = this.cache.get(key);\n\t\tif (currentValue === valueStr) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update in cache and pending\n\t\tthis.cache.set(key, valueStr);\n\t\tthis.pendingInserts.set(key, valueStr);\n\t\tthis.pendingDeletes.delete(key);\n\n\t\t// Event\n\t\tthis._onDidChangeStorage.fire(key);\n\n\t\t// Accumulate work by scheduling after timeout\n\t\treturn this.doFlush();\n\t}\n\n\tasync delete(key: string): Promise<void> {\n\t\tif (this.state === StorageState.Closed) {\n\t\t\treturn; // Return early if we are already closed\n\t\t}\n\n\t\t// Remove from cache and add to pending\n\t\tconst wasDeleted = this.cache.delete(key);\n\t\tif (!wasDeleted) {\n\t\t\treturn; // Return early if value already deleted\n\t\t}\n\n\t\tif (!this.pendingDeletes.has(key)) {\n\t\t\tthis.pendingDeletes.add(key);\n\t\t}\n\n\t\tthis.pendingInserts.delete(key);\n\n\t\t// Event\n\t\tthis._onDidChangeStorage.fire(key);\n\n\t\t// Accumulate work by scheduling after timeout\n\t\treturn this.doFlush();\n\t}\n\n\tprivate get hasPending() {\n\t\treturn this.pendingInserts.size > 0 || this.pendingDeletes.size > 0;\n\t}\n\n\tprivate async flushPending(): Promise<void> {\n\t\tif (!this.hasPending) {\n\t\t\treturn; // return early if nothing to do\n\t\t}\n\n\t\t// Get pending data\n\t\tconst updateRequest: IUpdateRequest = { insert: this.pendingInserts, delete: this.pendingDeletes };\n\n\t\t// Reset pending data for next run\n\t\tthis.pendingDeletes = new Set<string>();\n\t\tthis.pendingInserts = new Map<string, string>();\n\n\t\t// Update in storage and release any\n\t\t// waiters we have once done\n\t\treturn this.database.updateItems(updateRequest).finally(() => {\n\t\t\tif (!this.hasPending) {\n\t\t\t\twhile (this.whenFlushedCallbacks.length) {\n\t\t\t\t\tthis.whenFlushedCallbacks.pop()?.();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate async doFlush(delay?: number): Promise<void> {\n\t\treturn this.flushDelayer.trigger(() => this.flushPending(), delay);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.flushDelayer.dispose();\n\n\t\tsuper.dispose();\n\t}\n}\n\nexport class InMemoryStorageDatabase implements IStorageDatabase {\n\n\treadonly onDidChangeItemsExternal = Event.None;\n\n\tprivate readonly items = new Map<string, string>();\n\n\tasync updateItems(request: IUpdateRequest): Promise<void> {\n\t\tif (request.insert) {\n\t\t\trequest.insert.forEach((value, key) => this.items.set(key, value));\n\t\t}\n\n\t\tif (request.delete) {\n\t\t\trequest.delete.forEach(key => this.items.delete(key));\n\t\t}\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport 'vs/css!./aria';\n\n// Use a max length since we are inserting the whole msg in the DOM and that can cause browsers to freeze for long messages #94233\nconst MAX_MESSAGE_LENGTH = 20000;\nlet ariaContainer: HTMLElement;\nlet alertContainer: HTMLElement;\nlet alertContainer2: HTMLElement;\nlet statusContainer: HTMLElement;\nlet statusContainer2: HTMLElement;\nexport function setARIAContainer(parent: HTMLElement) {\n\tariaContainer = document.createElement('div');\n\tariaContainer.className = 'monaco-aria-container';\n\n\tconst createAlertContainer = () => {\n\t\tconst element = document.createElement('div');\n\t\telement.className = 'monaco-alert';\n\t\telement.setAttribute('role', 'alert');\n\t\telement.setAttribute('aria-atomic', 'true');\n\t\tariaContainer.appendChild(element);\n\t\treturn element;\n\t};\n\talertContainer = createAlertContainer();\n\talertContainer2 = createAlertContainer();\n\n\tconst createStatusContainer = () => {\n\t\tconst element = document.createElement('div');\n\t\telement.className = 'monaco-status';\n\t\telement.setAttribute('role', 'complementary');\n\t\telement.setAttribute('aria-live', 'polite');\n\t\telement.setAttribute('aria-atomic', 'true');\n\t\tariaContainer.appendChild(element);\n\t\treturn element;\n\t};\n\tstatusContainer = createStatusContainer();\n\tstatusContainer2 = createStatusContainer();\n\n\tparent.appendChild(ariaContainer);\n}\n/**\n * Given the provided message, will make sure that it is read as alert to screen readers.\n */\nexport function alert(msg: string): void {\n\tif (!ariaContainer) {\n\t\treturn;\n\t}\n\n\t// Use alternate containers such that duplicated messages get read out by screen readers #99466\n\tif (alertContainer.textContent !== msg) {\n\t\tdom.clearNode(alertContainer2);\n\t\tinsertMessage(alertContainer, msg);\n\t} else {\n\t\tdom.clearNode(alertContainer);\n\t\tinsertMessage(alertContainer2, msg);\n\t}\n}\n\n/**\n * Given the provided message, will make sure that it is read as status to screen readers.\n */\nexport function status(msg: string): void {\n\tif (!ariaContainer) {\n\t\treturn;\n\t}\n\n\tif (isMacintosh) {\n\t\talert(msg); // VoiceOver does not seem to support status role\n\t} else {\n\t\tif (statusContainer.textContent !== msg) {\n\t\t\tdom.clearNode(statusContainer2);\n\t\t\tinsertMessage(statusContainer, msg);\n\t\t} else {\n\t\t\tdom.clearNode(statusContainer);\n\t\t\tinsertMessage(statusContainer2, msg);\n\t\t}\n\t}\n}\n\nfunction insertMessage(target: HTMLElement, msg: string): void {\n\tdom.clearNode(target);\n\tif (msg.length > MAX_MESSAGE_LENGTH) {\n\t\tmsg = msg.substr(0, MAX_MESSAGE_LENGTH);\n\t}\n\ttarget.textContent = msg;\n\n\t// See https://www.paciellogroup.com/blog/2012/06/html5-accessibility-chops-aria-rolealert-browser-support/\n\ttarget.style.visibility = 'hidden';\n\ttarget.style.visibility = 'visible';\n}\n","\nimport { addDisposableListener, EventHelper, EventType, IFocusTracker, reset, trackFocus } from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch';\nimport { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event as BaseEvent } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { mixin } from 'vs/base/common/objects';\nimport 'vs/css!./button';\n\nexport interface IButtonOptions extends IButtonStyles {\n\treadonly title?: boolean | string;\n\treadonly supportIcons?: boolean;\n\treadonly secondary?: boolean;\n}\n\nexport interface IButtonStyles {\n\tbuttonBackground?: Color;\n\tbuttonHoverBackground?: Color;\n\tbuttonForeground?: Color;\n\tbuttonSecondaryBackground?: Color;\n\tbuttonSecondaryHoverBackground?: Color;\n\tbuttonSecondaryForeground?: Color;\n\tbuttonBorder?: Color;\n}\n\nconst defaultOptions: IButtonStyles = {\n\tbuttonBackground: Color.fromHex('#0E639C'),\n\tbuttonHoverBackground: Color.fromHex('#006BB3'),\n\tbuttonForeground: Color.white\n};\n\nexport interface IButton extends IDisposable {\n}\n\nexport class Button extends Disposable implements IButton {\n\n\tprotected _element: HTMLElement;\n\tprotected options: IButtonOptions;\n\n\tprivate buttonBackground: Color | undefined;\n\tprivate buttonHoverBackground: Color | undefined;\n\tprivate buttonForeground: Color | undefined;\n\tprivate buttonSecondaryBackground: Color | undefined;\n\tprivate buttonSecondaryHoverBackground: Color | undefined;\n\tprivate buttonSecondaryForeground: Color | undefined;\n\tprivate buttonBorder: Color | undefined;\n\n\tprivate _onDidClick = this._register(new Emitter<Event>());\n\tget onDidClick(): BaseEvent<Event> { return this._onDidClick.event; }\n\n\tprivate focusTracker: IFocusTracker;\n\n\tconstructor(container: HTMLElement, options?: IButtonOptions) {\n\t\tsuper();\n\n\t\tthis.options = options || Object.create(null);\n\t\tmixin(this.options, defaultOptions, false);\n\n\t\tthis.buttonForeground = this.options.buttonForeground;\n\t\tthis.buttonBackground = this.options.buttonBackground;\n\t\tthis.buttonHoverBackground = this.options.buttonHoverBackground;\n\n\t\tthis.buttonSecondaryForeground = this.options.buttonSecondaryForeground;\n\t\tthis.buttonSecondaryBackground = this.options.buttonSecondaryBackground;\n\t\tthis.buttonSecondaryHoverBackground = this.options.buttonSecondaryHoverBackground;\n\n\t\tthis.buttonBorder = this.options.buttonBorder;\n\n\t\tthis._element = document.createElement('a');\n\t\tthis._element.classList.add('monaco-button');\n\t\tthis._element.tabIndex = 0;\n\t\tthis._element.setAttribute('role', 'button');\n\n\t\tcontainer.appendChild(this._element);\n\n\t\tthis._register(Gesture.addTarget(this._element));\n\n\t\t[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {\n\t\t\tthis._register(addDisposableListener(this._element, eventType, e => {\n\t\t\t\tif (!this.enabled) {\n\t\t\t\t\tEventHelper.stop(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t}));\n\t\t});\n\n\t\tthis._register(addDisposableListener(this._element, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = false;\n\t\t\tif (this.enabled && (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t\teventHandled = true;\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis._element.blur();\n\t\t\t\teventHandled = true;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tEventHelper.stop(event, true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this._element.classList.contains('disabled')) {\n\t\t\t\tthis.setHoverBackground();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OUT, e => {\n\t\t\tthis.applyStyles(); // restore standard styles\n\t\t}));\n\n\t\t// Also set hover background when button is focused for feedback\n\t\tthis.focusTracker = this._register(trackFocus(this._element));\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.setHoverBackground()));\n\t\tthis._register(this.focusTracker.onDidBlur(() => this.applyStyles())); // restore standard styles\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate setHoverBackground(): void {\n\t\tlet hoverBackground;\n\t\tif (this.options.secondary) {\n\t\t\thoverBackground = this.buttonSecondaryHoverBackground ? this.buttonSecondaryHoverBackground.toString() : null;\n\t\t} else {\n\t\t\thoverBackground = this.buttonHoverBackground ? this.buttonHoverBackground.toString() : null;\n\t\t}\n\t\tif (hoverBackground) {\n\t\t\tthis._element.style.backgroundColor = hoverBackground;\n\t\t}\n\t}\n\n\tstyle(styles: IButtonStyles): void {\n\t\tthis.buttonForeground = styles.buttonForeground;\n\t\tthis.buttonBackground = styles.buttonBackground;\n\t\tthis.buttonHoverBackground = styles.buttonHoverBackground;\n\t\tthis.buttonSecondaryForeground = styles.buttonSecondaryForeground;\n\t\tthis.buttonSecondaryBackground = styles.buttonSecondaryBackground;\n\t\tthis.buttonSecondaryHoverBackground = styles.buttonSecondaryHoverBackground;\n\t\tthis.buttonBorder = styles.buttonBorder;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate applyStyles(): void {\n\t\tif (this._element) {\n\t\t\tlet background, foreground;\n\t\t\tif (this.options.secondary) {\n\t\t\t\tforeground = this.buttonSecondaryForeground ? this.buttonSecondaryForeground.toString() : '';\n\t\t\t\tbackground = this.buttonSecondaryBackground ? this.buttonSecondaryBackground.toString() : '';\n\t\t\t} else {\n\t\t\t\tforeground = this.buttonForeground ? this.buttonForeground.toString() : '';\n\t\t\t\tbackground = this.buttonBackground ? this.buttonBackground.toString() : '';\n\t\t\t}\n\n\t\t\tconst border = this.buttonBorder ? this.buttonBorder.toString() : '';\n\n\t\t\tthis._element.style.color = foreground;\n\t\t\tthis._element.style.backgroundColor = background;\n\n\t\t\tthis._element.style.borderWidth = border ? '1px' : '';\n\t\t\tthis._element.style.borderStyle = border ? 'solid' : '';\n\t\t\tthis._element.style.borderColor = border;\n\t\t}\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset label(value: string) {\n\t\tthis._element.classList.add('monaco-text-button');\n\t\tif (this.options.supportIcons) {\n\t\t\treset(this._element, ...renderLabelWithIcons(value));\n\t\t} else {\n\t\t\tthis._element.textContent = value;\n\t\t}\n\t\tif (typeof this.options.title === 'string') {\n\t\t\tthis._element.title = this.options.title;\n\t\t} else if (this.options.title) {\n\t\t\tthis._element.title = value;\n\t\t}\n\t}\n\n\tset enabled(value: boolean) {\n\t\tif (value) {\n\t\t\tthis._element.classList.remove('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(false));\n\t\t\tthis._element.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._element.classList.add('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(true));\n\t\t}\n\t}\n\n\tget enabled() {\n\t\treturn !this._element.classList.contains('disabled');\n\t}\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { CSSIcon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport 'vs/css!./checkbox';\n\nexport interface ICheckboxOpts extends ICheckboxStyles {\n\treadonly actionClassName?: string;\n\treadonly icon?: CSSIcon;\n\treadonly title: string;\n\treadonly isChecked: boolean;\n\treadonly notFocusable?: boolean;\n}\n\nexport interface ICheckboxStyles {\n\tinputActiveOptionBorder?: Color;\n\tinputActiveOptionForeground?: Color;\n\tinputActiveOptionBackground?: Color;\n}\n\nconst defaultOpts = {\n\tinputActiveOptionBorder: Color.fromHex('#007ACC00'),\n\tinputActiveOptionForeground: Color.fromHex('#FFFFFF'),\n\tinputActiveOptionBackground: Color.fromHex('#0E639C50')\n};\n\nexport class Checkbox extends Widget {\n\n\tprivate readonly _onChange = this._register(new Emitter<boolean>());\n\treadonly onChange: Event<boolean /* via keyboard */> = this._onChange.event;\n\n\tprivate readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\treadonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;\n\n\tprivate readonly _opts: ICheckboxOpts;\n\treadonly domNode: HTMLElement;\n\n\tprivate _checked: boolean;\n\n\tconstructor(opts: ICheckboxOpts) {\n\t\tsuper();\n\n\t\tthis._opts = { ...defaultOpts, ...opts };\n\t\tthis._checked = this._opts.isChecked;\n\n\t\tconst classes = ['monaco-custom-checkbox'];\n\t\tif (this._opts.icon) {\n\t\t\tclasses.push(...CSSIcon.asClassNameArray(this._opts.icon));\n\t\t}\n\t\tif (this._opts.actionClassName) {\n\t\t\tclasses.push(...this._opts.actionClassName.split(' '));\n\t\t}\n\t\tif (this._checked) {\n\t\t\tclasses.push('checked');\n\t\t}\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.title = this._opts.title;\n\t\tthis.domNode.classList.add(...classes);\n\t\tif (!this._opts.notFocusable) {\n\t\t\tthis.domNode.tabIndex = 0;\n\t\t}\n\t\tthis.domNode.setAttribute('role', 'checkbox');\n\t\tthis.domNode.setAttribute('aria-checked', String(this._checked));\n\t\tthis.domNode.setAttribute('aria-label', this._opts.title);\n\n\t\tthis.applyStyles();\n\n\t\tthis.onclick(this.domNode, (ev) => {\n\t\t\tif (this.enabled) {\n\t\t\t\tthis.checked = !this._checked;\n\t\t\t\tthis._onChange.fire(false);\n\t\t\t\tev.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tthis.ignoreGesture(this.domNode);\n\n\t\tthis.onkeydown(this.domNode, (keyboardEvent) => {\n\t\t\tif (keyboardEvent.keyCode === KeyCode.Space || keyboardEvent.keyCode === KeyCode.Enter) {\n\t\t\t\tthis.checked = !this._checked;\n\t\t\t\tthis._onChange.fire(true);\n\t\t\t\tkeyboardEvent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onKeyDown.fire(keyboardEvent);\n\t\t});\n\t}\n\n\tget enabled(): boolean {\n\t\treturn this.domNode.getAttribute('aria-disabled') !== 'true';\n\t}\n\n\tfocus(): void {\n\t\tthis.domNode.focus();\n\t}\n\n\tget checked(): boolean {\n\t\treturn this._checked;\n\t}\n\n\tset checked(newIsChecked: boolean) {\n\t\tthis._checked = newIsChecked;\n\n\t\tthis.domNode.setAttribute('aria-checked', String(this._checked));\n\t\tthis.domNode.classList.toggle('checked', this._checked);\n\n\t\tthis.applyStyles();\n\t}\n\n\twidth(): number {\n\t\treturn 2 /*margin left*/ + 2 /*border*/ + 2 /*padding*/ + 16 /* icon width */;\n\t}\n\n\tstyle(styles: ICheckboxStyles): void {\n\t\tif (styles.inputActiveOptionBorder) {\n\t\t\tthis._opts.inputActiveOptionBorder = styles.inputActiveOptionBorder;\n\t\t}\n\t\tif (styles.inputActiveOptionForeground) {\n\t\t\tthis._opts.inputActiveOptionForeground = styles.inputActiveOptionForeground;\n\t\t}\n\t\tif (styles.inputActiveOptionBackground) {\n\t\t\tthis._opts.inputActiveOptionBackground = styles.inputActiveOptionBackground;\n\t\t}\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tif (this.domNode) {\n\t\t\tthis.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder ? this._opts.inputActiveOptionBorder.toString() : '';\n\t\t\tthis.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground ? this._opts.inputActiveOptionForeground.toString() : 'inherit';\n\t\t\tthis.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground ? this._opts.inputActiveOptionBackground.toString() : '';\n\t\t}\n\t}\n\n\tenable(): void {\n\t\tthis.domNode.setAttribute('aria-disabled', String(false));\n\t}\n\n\tdisable(): void {\n\t\tthis.domNode.setAttribute('aria-disabled', String(true));\n\t}\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 { Codicon } from 'vs/base/common/codicons';\nimport 'vs/css!./codicon/codicon';\nimport 'vs/css!./codicon/codicon-modifiers';\n\n\nexport function formatRule(c: Codicon) {\n\tlet def = c.definition;\n\twhile (def instanceof Codicon) {\n\t\tdef = def.definition;\n\t}\n\treturn `.codicon-${c.id}:before { content: '${def.fontCharacter}'; }`;\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 { BrowserFeatures } from 'vs/base/browser/canIUse';\nimport * as DOM from 'vs/base/browser/dom';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { Range } from 'vs/base/common/range';\nimport 'vs/css!./contextview';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport const enum AnchorAlignment {\n\tLEFT, RIGHT\n}\n\nexport const enum AnchorPosition {\n\tBELOW, ABOVE\n}\n\nexport const enum AnchorAxisAlignment {\n\tVERTICAL, HORIZONTAL\n}\n\nexport interface IDelegate {\n\tgetAnchor(): HTMLElement | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport interface IPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport interface ISize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface IView extends IPosition, ISize { }\n\nexport const enum LayoutAnchorPosition {\n\tBefore,\n\tAfter\n}\n\nexport enum LayoutAnchorMode {\n\tAVOID,\n\tALIGN\n}\n\nexport interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\n\tmode?: LayoutAnchorMode; // default: AVOID\n\tposition: LayoutAnchorPosition;\n}\n\n/**\n * Lays out a one dimensional view next to an anchor in a viewport.\n *\n * @returns The view offset within the viewport.\n */\nexport function layout(viewportSize: number, viewSize: number, anchor: ILayoutAnchor): number {\n\tconst layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size;\n\tconst layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // ok case, lay it out before the anchor\n\t\t}\n\n\t\treturn Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor\n\t} else {\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // ok case, lay it out after the anchor\n\t\t}\n\n\t\treturn 0; // sad case, lay it over the anchor\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition: boolean;\n\tprivate useShadowDOM: boolean;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement | null, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tthis.useFixedPosition = false;\n\t\tthis.useShadowDOM = false;\n\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot.removeChild(this.view);\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t} else {\n\t\t\t\tthis.container.removeChild(this.view);\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tthis.view.style.zIndex = '2500';\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tif (this.delegate.focus) {\n\t\t\tthis.delegate.focus();\n\t\t}\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.layout) {\n\t\t\tthis.delegate!.layout!();\n\t\t}\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tlet anchor = this.delegate!.getAnchor();\n\n\t\t// Compute around\n\t\tlet around: IView;\n\n\t\t// Get the element's position and size (to anchor the view)\n\t\tif (DOM.isHTMLElement(anchor)) {\n\t\t\tlet elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t\taround = {\n\t\t\t\ttop: elementPosition.top,\n\t\t\t\tleft: elementPosition.left,\n\t\t\t\twidth: elementPosition.width,\n\t\t\t\theight: elementPosition.height\n\t\t\t};\n\t\t} else {\n\t\t\taround = {\n\t\t\t\ttop: anchor.y,\n\t\t\t\tleft: anchor.x,\n\t\t\t\twidth: anchor.width || 1,\n\t\t\t\theight: anchor.height || 2\n\t\t\t};\n\t\t}\n\n\t\tconst viewSizeWidth = DOM.getTotalWidth(this.view);\n\t\tconst viewSizeHeight = DOM.getTotalHeight(this.view);\n\n\t\tconst anchorPosition = this.delegate!.anchorPosition || AnchorPosition.BELOW;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment || AnchorAlignment.LEFT;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment || AnchorAxisAlignment.VERTICAL;\n\n\t\tlet top: number;\n\t\tlet left: number;\n\n\t\tif (anchorAxisAlignment === AnchorAxisAlignment.VERTICAL) {\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - window.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\ttop = layout(window.innerHeight, viewSizeHeight, verticalAnchor) + window.pageYOffset;\n\n\t\t\t// if view intersects vertically with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\t\thorizontalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\tleft = layout(window.innerWidth, viewSizeWidth, horizontalAnchor);\n\t\t} else {\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\tleft = layout(window.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\t\t// if view intersects horizontally with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) {\n\t\t\t\tverticalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\ttop = layout(window.innerHeight, viewSizeHeight, verticalAnchor) + window.pageYOffset;\n\t\t}\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\t\tthis.view.style.top = `${top - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).top : containerPosition.top)}px`;\n\t\tthis.view.style.left = `${left - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).left : containerPosition.left)}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown): void {\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (delegate?.onHide) {\n\t\t\tdelegate.onHide(data);\n\t\t}\n\n\t\tthis.toDisposeOnClean.dispose();\n\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate onDOMEvent(e: Event, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\n\t}\n}\n\nlet SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: \"codicon\";\n\t\tfont-display: block;\n\t\tsrc: url(\"./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6\") format(\"truetype\");\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Nanum Gothic\", \"Apple SD Gothic Neo\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\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 { $, append } from 'vs/base/browser/dom';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\nimport { format } from 'vs/base/common/strings';\nimport { IThemable } from 'vs/base/common/styler';\nimport 'vs/css!./countBadge';\n\nexport interface ICountBadgeOptions extends ICountBadgetyles {\n\tcount?: number;\n\tcountFormat?: string;\n\ttitleFormat?: string;\n}\n\nexport interface ICountBadgetyles {\n\tbadgeBackground?: Color;\n\tbadgeForeground?: Color;\n\tbadgeBorder?: Color;\n}\n\nconst defaultOpts = {\n\tbadgeBackground: Color.fromHex('#4D4D4D'),\n\tbadgeForeground: Color.fromHex('#FFFFFF')\n};\n\nexport class CountBadge implements IThemable {\n\n\tprivate element: HTMLElement;\n\tprivate count: number = 0;\n\tprivate countFormat: string;\n\tprivate titleFormat: string;\n\n\tprivate badgeBackground: Color | undefined;\n\tprivate badgeForeground: Color | undefined;\n\tprivate badgeBorder: Color | undefined;\n\n\tprivate options: ICountBadgeOptions;\n\n\tconstructor(container: HTMLElement, options?: ICountBadgeOptions) {\n\t\tthis.options = options || Object.create(null);\n\t\tmixin(this.options, defaultOpts, false);\n\n\t\tthis.badgeBackground = this.options.badgeBackground;\n\t\tthis.badgeForeground = this.options.badgeForeground;\n\t\tthis.badgeBorder = this.options.badgeBorder;\n\n\t\tthis.element = append(container, $('.monaco-count-badge'));\n\t\tthis.countFormat = this.options.countFormat || '{0}';\n\t\tthis.titleFormat = this.options.titleFormat || '';\n\t\tthis.setCount(this.options.count || 0);\n\t}\n\n\tsetCount(count: number) {\n\t\tthis.count = count;\n\t\tthis.render();\n\t}\n\n\tsetTitleFormat(titleFormat: string) {\n\t\tthis.titleFormat = titleFormat;\n\t\tthis.render();\n\t}\n\n\tprivate render() {\n\t\tthis.element.textContent = format(this.countFormat, this.count);\n\t\tthis.element.title = format(this.titleFormat, this.count);\n\n\t\tthis.applyStyles();\n\t}\n\n\tstyle(styles: ICountBadgetyles): void {\n\t\tthis.badgeBackground = styles.badgeBackground;\n\t\tthis.badgeForeground = styles.badgeForeground;\n\t\tthis.badgeBorder = styles.badgeBorder;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate applyStyles(): void {\n\t\tif (this.element) {\n\t\t\tconst background = this.badgeBackground ? this.badgeBackground.toString() : '';\n\t\t\tconst foreground = this.badgeForeground ? this.badgeForeground.toString() : '';\n\t\t\tconst border = this.badgeBorder ? this.badgeBorder.toString() : '';\n\n\t\t\tthis.element.style.backgroundColor = background;\n\t\t\tthis.element.style.color = foreground;\n\n\t\t\tthis.element.style.borderWidth = border ? '1px' : '';\n\t\t\tthis.element.style.borderStyle = border ? 'solid' : '';\n\t\t\tthis.element.style.borderColor = border;\n\t\t}\n\t}\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 'vs/css!./mouseCursor';\n\nexport const MOUSE_CURSOR_TEXT_CSS_CLASS_NAME = `monaco-mouse-cursor-text`;\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 { show } from 'vs/base/browser/dom';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Color } from 'vs/base/common/color';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { mixin } from 'vs/base/common/objects';\nimport 'vs/css!./progressbar';\n\nconst CSS_DONE = 'done';\nconst CSS_ACTIVE = 'active';\nconst CSS_INFINITE = 'infinite';\nconst CSS_INFINITE_LONG_RUNNING = 'infinite-long-running';\nconst CSS_DISCRETE = 'discrete';\n\nexport interface IProgressBarOptions extends IProgressBarStyles {\n}\n\nexport interface IProgressBarStyles {\n\tprogressBarBackground?: Color;\n}\n\nconst defaultOpts = {\n\tprogressBarBackground: Color.fromHex('#0E70C0')\n};\n\n/**\n * A progress bar with support for infinite or discrete progress.\n */\nexport class ProgressBar extends Disposable {\n\n\t/**\n\t * After a certain time of showing the progress bar, switch\n\t * to long-running mode and throttle animations to reduce\n\t * the pressure on the GPU process.\n\t *\n\t * https://github.com/microsoft/vscode/issues/97900\n\t * https://github.com/microsoft/vscode/issues/138396\n\t */\n\tprivate static readonly LONG_RUNNING_INFINITE_THRESHOLD = 10000;\n\n\tprivate options: IProgressBarOptions;\n\tprivate workedVal: number;\n\tprivate element!: HTMLElement;\n\tprivate bit!: HTMLElement;\n\tprivate totalWork: number | undefined;\n\tprivate progressBarBackground: Color | undefined;\n\tprivate showDelayedScheduler: RunOnceScheduler;\n\tprivate longRunningScheduler: RunOnceScheduler;\n\n\tconstructor(container: HTMLElement, options?: IProgressBarOptions) {\n\t\tsuper();\n\n\t\tthis.options = options || Object.create(null);\n\t\tmixin(this.options, defaultOpts, false);\n\n\t\tthis.workedVal = 0;\n\n\t\tthis.progressBarBackground = this.options.progressBarBackground;\n\n\t\tthis.showDelayedScheduler = this._register(new RunOnceScheduler(() => show(this.element), 0));\n\t\tthis.longRunningScheduler = this._register(new RunOnceScheduler(() => this.infiniteLongRunning(), ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD));\n\n\t\tthis.create(container);\n\t}\n\n\tprivate create(container: HTMLElement): void {\n\t\tthis.element = document.createElement('div');\n\t\tthis.element.classList.add('monaco-progress-container');\n\t\tthis.element.setAttribute('role', 'progressbar');\n\t\tthis.element.setAttribute('aria-valuemin', '0');\n\t\tcontainer.appendChild(this.element);\n\n\t\tthis.bit = document.createElement('div');\n\t\tthis.bit.classList.add('progress-bit');\n\t\tthis.element.appendChild(this.bit);\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate off(): void {\n\t\tthis.bit.style.width = 'inherit';\n\t\tthis.bit.style.opacity = '1';\n\t\tthis.element.classList.remove(CSS_ACTIVE, CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DISCRETE);\n\n\t\tthis.workedVal = 0;\n\t\tthis.totalWork = undefined;\n\n\t\tthis.longRunningScheduler.cancel();\n\t}\n\n\t/**\n\t * Stops the progressbar from showing any progress instantly without fading out.\n\t */\n\tstop(): ProgressBar {\n\t\treturn this.doDone(false);\n\t}\n\n\tprivate doDone(delayed: boolean): ProgressBar {\n\t\tthis.element.classList.add(CSS_DONE);\n\n\t\t// discrete: let it grow to 100% width and hide afterwards\n\t\tif (!this.element.classList.contains(CSS_INFINITE)) {\n\t\t\tthis.bit.style.width = 'inherit';\n\n\t\t\tif (delayed) {\n\t\t\t\tsetTimeout(() => this.off(), 200);\n\t\t\t} else {\n\t\t\t\tthis.off();\n\t\t\t}\n\t\t}\n\n\t\t// infinite: let it fade out and hide afterwards\n\t\telse {\n\t\t\tthis.bit.style.opacity = '0';\n\t\t\tif (delayed) {\n\t\t\t\tsetTimeout(() => this.off(), 200);\n\t\t\t} else {\n\t\t\t\tthis.off();\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Use this mode to indicate progress that has no total number of work units.\n\t */\n\tinfinite(): ProgressBar {\n\t\tthis.bit.style.width = '2%';\n\t\tthis.bit.style.opacity = '1';\n\n\t\tthis.element.classList.remove(CSS_DISCRETE, CSS_DONE, CSS_INFINITE_LONG_RUNNING);\n\t\tthis.element.classList.add(CSS_ACTIVE, CSS_INFINITE);\n\n\t\tthis.longRunningScheduler.schedule();\n\n\t\treturn this;\n\t}\n\n\tprivate infiniteLongRunning(): void {\n\t\tthis.element.classList.add(CSS_INFINITE_LONG_RUNNING);\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.element;\n\t}\n\n\tstyle(styles: IProgressBarStyles): void {\n\t\tthis.progressBarBackground = styles.progressBarBackground;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tif (this.bit) {\n\t\t\tconst background = this.progressBarBackground ? this.progressBarBackground.toString() : '';\n\n\t\t\tthis.bit.style.backgroundColor = background;\n\t\t}\n\t}\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 { $, append, createStyleSheet, EventHelper, EventLike, getElementsByTagName } from 'vs/base/browser/dom';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { EventType, Gesture, GestureEvent } from 'vs/base/browser/touch';\nimport { Delayer } from 'vs/base/common/async';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport 'vs/css!./sash';\n\n/**\n * Allow the sashes to be visible at runtime.\n * @remark Use for development purposes only.\n */\nlet DEBUG = false;\n// DEBUG = Boolean(\"true\"); // done \"weirdly\" so that a lint warning prevents you from pushing this\n\n/**\n * A vertical sash layout provider provides position and height for a sash.\n */\nexport interface IVerticalSashLayoutProvider {\n\tgetVerticalSashLeft(sash: Sash): number;\n\tgetVerticalSashTop?(sash: Sash): number;\n\tgetVerticalSashHeight?(sash: Sash): number;\n}\n\n/**\n * A vertical sash layout provider provides position and width for a sash.\n */\nexport interface IHorizontalSashLayoutProvider {\n\tgetHorizontalSashTop(sash: Sash): number;\n\tgetHorizontalSashLeft?(sash: Sash): number;\n\tgetHorizontalSashWidth?(sash: Sash): number;\n}\n\ntype ISashLayoutProvider = IVerticalSashLayoutProvider | IHorizontalSashLayoutProvider;\n\nexport interface ISashEvent {\n\treadonly startX: number;\n\treadonly currentX: number;\n\treadonly startY: number;\n\treadonly currentY: number;\n\treadonly altKey: boolean;\n}\n\nexport enum OrthogonalEdge {\n\tNorth = 'north',\n\tSouth = 'south',\n\tEast = 'east',\n\tWest = 'west'\n}\n\nexport interface ISashOptions {\n\n\t/**\n\t * Whether a sash is horizontal or vertical.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The width or height of a vertical or horizontal sash, respectively.\n\t */\n\treadonly size?: number;\n\n\t/**\n\t * A reference to another sash, perpendicular to this one, which\n\t * aligns at the start of this one. A corner sash will be created\n\t * automatically at that location.\n\t *\n\t * The start of a horizontal sash is its left-most position.\n\t * The start of a vertical sash is its top-most position.\n\t */\n\treadonly orthogonalStartSash?: Sash;\n\n\t/**\n\t * A reference to another sash, perpendicular to this one, which\n\t * aligns at the end of this one. A corner sash will be created\n\t * automatically at that location.\n\t *\n\t * The end of a horizontal sash is its right-most position.\n\t * The end of a vertical sash is its bottom-most position.\n\t */\n\treadonly orthogonalEndSash?: Sash;\n\n\t/**\n\t * Provides a hint as to what mouse cursor to use whenever the user\n\t * hovers over a corner sash provided by this and an orthogonal sash.\n\t */\n\treadonly orthogonalEdge?: OrthogonalEdge;\n}\n\nexport interface IVerticalSashOptions extends ISashOptions {\n\treadonly orientation: Orientation.VERTICAL;\n}\n\nexport interface IHorizontalSashOptions extends ISashOptions {\n\treadonly orientation: Orientation.HORIZONTAL;\n}\n\nexport const enum Orientation {\n\tVERTICAL,\n\tHORIZONTAL\n}\n\nexport const enum SashState {\n\n\t/**\n\t * Disable any UI interaction.\n\t */\n\tDisabled,\n\n\t/**\n\t * Allow dragging down or to the right, depending on the sash orientation.\n\t *\n\t * Some OSs allow customizing the mouse cursor differently whenever\n\t * some resizable component can't be any smaller, but can be larger.\n\t */\n\tAtMinimum,\n\n\t/**\n\t * Allow dragging up or to the left, depending on the sash orientation.\n\t *\n\t * Some OSs allow customizing the mouse cursor differently whenever\n\t * some resizable component can't be any larger, but can be smaller.\n\t */\n\tAtMaximum,\n\n\t/**\n\t * Enable dragging.\n\t */\n\tEnabled\n}\n\nlet globalSize = 4;\nconst onDidChangeGlobalSize = new Emitter<number>();\n\nlet globalHoverDelay = 300;\nconst onDidChangeHoverDelay = new Emitter<number>();\n\ninterface PointerEvent extends EventLike {\n\treadonly pageX: number;\n\treadonly pageY: number;\n\treadonly altKey: boolean;\n\treadonly target: EventTarget | null;\n}\n\ninterface IPointerEventFactory {\n\treadonly onPointerMove: Event<PointerEvent>;\n\treadonly onPointerUp: Event<PointerEvent>;\n\tdispose(): void;\n}\n\nclass MouseEventFactory implements IPointerEventFactory {\n\n\tprivate disposables = new DisposableStore();\n\n\t@memoize\n\tget onPointerMove(): Event<PointerEvent> {\n\t\treturn this.disposables.add(new DomEmitter(window, 'mousemove')).event;\n\t}\n\n\t@memoize\n\tget onPointerUp(): Event<PointerEvent> {\n\t\treturn this.disposables.add(new DomEmitter(window, 'mouseup')).event;\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables.dispose();\n\t}\n}\n\nclass GestureEventFactory implements IPointerEventFactory {\n\n\tprivate disposables = new DisposableStore();\n\n\t@memoize\n\tget onPointerMove(): Event<PointerEvent> {\n\t\treturn this.disposables.add(new DomEmitter(this.el, EventType.Change)).event;\n\t}\n\n\t@memoize\n\tget onPointerUp(): Event<PointerEvent> {\n\t\treturn this.disposables.add(new DomEmitter(this.el, EventType.End)).event;\n\t}\n\n\tconstructor(private el: HTMLElement) { }\n\n\tdispose(): void {\n\t\tthis.disposables.dispose();\n\t}\n}\n\nclass OrthogonalPointerEventFactory implements IPointerEventFactory {\n\n\t@memoize\n\tget onPointerMove(): Event<PointerEvent> {\n\t\treturn this.factory.onPointerMove;\n\t}\n\n\t@memoize\n\tget onPointerUp(): Event<PointerEvent> {\n\t\treturn this.factory.onPointerUp;\n\t}\n\n\tconstructor(private factory: IPointerEventFactory) { }\n\n\tdispose(): void {\n\t\t// noop\n\t}\n}\n\nconst PointerEventsDisabledCssClass = 'pointer-events-disabled';\n\n/**\n * The {@link Sash} is the UI component which allows the user to resize other\n * components. It's usually an invisible horizontal or vertical line which, when\n * hovered, becomes highlighted and can be dragged along the perpendicular dimension\n * to its direction.\n *\n * Features:\n * - Touch event handling\n * - Corner sash support\n * - Hover with different mouse cursor support\n * - Configurable hover size\n * - Linked sash support, for 2x2 corner sashes\n */\nexport class Sash extends Disposable {\n\n\tprivate el: HTMLElement;\n\tprivate layoutProvider: ISashLayoutProvider;\n\tprivate orientation: Orientation;\n\tprivate size: number;\n\tprivate hoverDelay = globalHoverDelay;\n\tprivate hoverDelayer = this._register(new Delayer(this.hoverDelay));\n\n\tprivate _state: SashState = SashState.Enabled;\n\tprivate readonly onDidEnablementChange = this._register(new Emitter<SashState>());\n\tprivate readonly _onDidStart = this._register(new Emitter<ISashEvent>());\n\tprivate readonly _onDidChange = this._register(new Emitter<ISashEvent>());\n\tprivate readonly _onDidReset = this._register(new Emitter<void>());\n\tprivate readonly _onDidEnd = this._register(new Emitter<void>());\n\tprivate readonly orthogonalStartSashDisposables = this._register(new DisposableStore());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate readonly orthogonalStartDragHandleDisposables = this._register(new DisposableStore());\n\tprivate _orthogonalStartDragHandle: HTMLElement | undefined;\n\tprivate readonly orthogonalEndSashDisposables = this._register(new DisposableStore());\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate readonly orthogonalEndDragHandleDisposables = this._register(new DisposableStore());\n\tprivate _orthogonalEndDragHandle: HTMLElement | undefined;\n\n\tget state(): SashState { return this._state; }\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\n\t/**\n\t * The state of a sash defines whether it can be interacted with by the user\n\t * as well as what mouse cursor to use, when hovered.\n\t */\n\tset state(state: SashState) {\n\t\tif (this._state === state) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.el.classList.toggle('disabled', state === SashState.Disabled);\n\t\tthis.el.classList.toggle('minimum', state === SashState.AtMinimum);\n\t\tthis.el.classList.toggle('maximum', state === SashState.AtMaximum);\n\n\t\tthis._state = state;\n\t\tthis.onDidEnablementChange.fire(state);\n\t}\n\n\t/**\n\t * An event which fires whenever the user starts dragging this sash.\n\t */\n\treadonly onDidStart: Event<ISashEvent> = this._onDidStart.event;\n\n\t/**\n\t * An event which fires whenever the user moves the mouse while\n\t * dragging this sash.\n\t */\n\treadonly onDidChange: Event<ISashEvent> = this._onDidChange.event;\n\n\t/**\n\t * An event which fires whenever the user double clicks this sash.\n\t */\n\treadonly onDidReset: Event<void> = this._onDidReset.event;\n\n\t/**\n\t * An event which fires whenever the user stops dragging this sash.\n\t */\n\treadonly onDidEnd: Event<void> = this._onDidEnd.event;\n\n\t/**\n\t * A linked sash will be forwarded the same user interactions and events\n\t * so it moves exactly the same way as this sash.\n\t *\n\t * Useful in 2x2 grids. Not meant for widespread usage.\n\t */\n\tlinkedSash: Sash | undefined = undefined;\n\n\t/**\n\t * A reference to another sash, perpendicular to this one, which\n\t * aligns at the start of this one. A corner sash will be created\n\t * automatically at that location.\n\t *\n\t * The start of a horizontal sash is its left-most position.\n\t * The start of a vertical sash is its top-most position.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tthis.orthogonalStartDragHandleDisposables.clear();\n\t\tthis.orthogonalStartSashDisposables.clear();\n\n\t\tif (sash) {\n\t\t\tconst onChange = (state: SashState) => {\n\t\t\t\tthis.orthogonalStartDragHandleDisposables.clear();\n\n\t\t\t\tif (state !== SashState.Disabled) {\n\t\t\t\t\tthis._orthogonalStartDragHandle = append(this.el, $('.orthogonal-drag-handle.start'));\n\t\t\t\t\tthis.orthogonalStartDragHandleDisposables.add(toDisposable(() => this._orthogonalStartDragHandle!.remove()));\n\t\t\t\t\tthis.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseenter')).event\n\t\t\t\t\t\t(() => Sash.onMouseEnter(sash), undefined, this.orthogonalStartDragHandleDisposables);\n\t\t\t\t\tthis.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseleave')).event\n\t\t\t\t\t\t(() => Sash.onMouseLeave(sash), undefined, this.orthogonalStartDragHandleDisposables);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.orthogonalStartSashDisposables.add(sash.onDidEnablementChange.event(onChange, this));\n\t\t\tonChange(sash.state);\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to another sash, perpendicular to this one, which\n\t * aligns at the end of this one. A corner sash will be created\n\t * automatically at that location.\n\t *\n\t * The end of a horizontal sash is its right-most position.\n\t * The end of a vertical sash is its bottom-most position.\n\t */\n\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tthis.orthogonalEndDragHandleDisposables.clear();\n\t\tthis.orthogonalEndSashDisposables.clear();\n\n\t\tif (sash) {\n\t\t\tconst onChange = (state: SashState) => {\n\t\t\t\tthis.orthogonalEndDragHandleDisposables.clear();\n\n\t\t\t\tif (state !== SashState.Disabled) {\n\t\t\t\t\tthis._orthogonalEndDragHandle = append(this.el, $('.orthogonal-drag-handle.end'));\n\t\t\t\t\tthis.orthogonalEndDragHandleDisposables.add(toDisposable(() => this._orthogonalEndDragHandle!.remove()));\n\t\t\t\t\tthis.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseenter')).event\n\t\t\t\t\t\t(() => Sash.onMouseEnter(sash), undefined, this.orthogonalEndDragHandleDisposables);\n\t\t\t\t\tthis.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseleave')).event\n\t\t\t\t\t\t(() => Sash.onMouseLeave(sash), undefined, this.orthogonalEndDragHandleDisposables);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.orthogonalEndSashDisposables.add(sash.onDidEnablementChange.event(onChange, this));\n\t\t\tonChange(sash.state);\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Create a new vertical sash.\n\t *\n\t * @param container A DOM node to append the sash to.\n\t * @param verticalLayoutProvider A vertical layout provider.\n\t * @param options The options.\n\t */\n\tconstructor(container: HTMLElement, verticalLayoutProvider: IVerticalSashLayoutProvider, options: IVerticalSashOptions);\n\n\t/**\n\t * Create a new horizontal sash.\n\t *\n\t * @param container A DOM node to append the sash to.\n\t * @param horizontalLayoutProvider A horizontal layout provider.\n\t * @param options The options.\n\t */\n\tconstructor(container: HTMLElement, horizontalLayoutProvider: IHorizontalSashLayoutProvider, options: IHorizontalSashOptions);\n\tconstructor(container: HTMLElement, layoutProvider: ISashLayoutProvider, options: ISashOptions) {\n\t\tsuper();\n\n\t\tthis.el = append(container, $('.monaco-sash'));\n\n\t\tif (options.orthogonalEdge) {\n\t\t\tthis.el.classList.add(`orthogonal-edge-${options.orthogonalEdge}`);\n\t\t}\n\n\t\tif (isMacintosh) {\n\t\t\tthis.el.classList.add('mac');\n\t\t}\n\n\t\tconst onMouseDown = this._register(new DomEmitter(this.el, 'mousedown')).event;\n\t\tthis._register(onMouseDown(e => this.onPointerStart(e, new MouseEventFactory()), this));\n\t\tconst onMouseDoubleClick = this._register(new DomEmitter(this.el, 'dblclick')).event;\n\t\tthis._register(onMouseDoubleClick(this.onPointerDoublePress, this));\n\t\tconst onMouseEnter = this._register(new DomEmitter(this.el, 'mouseenter')).event;\n\t\tthis._register(onMouseEnter(() => Sash.onMouseEnter(this)));\n\t\tconst onMouseLeave = this._register(new DomEmitter(this.el, 'mouseleave')).event;\n\t\tthis._register(onMouseLeave(() => Sash.onMouseLeave(this)));\n\n\t\tthis._register(Gesture.addTarget(this.el));\n\n\t\tconst onTouchStart = Event.map(this._register(new DomEmitter(this.el, EventType.Start)).event, e => ({ ...e, target: e.initialTarget ?? null }));\n\t\tthis._register(onTouchStart(e => this.onPointerStart(e, new GestureEventFactory(this.el)), this));\n\t\tconst onTap = this._register(new DomEmitter(this.el, EventType.Tap)).event;\n\t\tconst onDoubleTap = Event.map(\n\t\t\tEvent.filter(\n\t\t\t\tEvent.debounce<GestureEvent, { event: GestureEvent; count: number }>(onTap, (res, event) => ({ event, count: (res?.count ?? 0) + 1 }), 250),\n\t\t\t\t({ count }) => count === 2\n\t\t\t),\n\t\t\t({ event }) => ({ ...event, target: event.initialTarget ?? null })\n\t\t);\n\t\tthis._register(onDoubleTap(this.onPointerDoublePress, this));\n\n\t\tif (typeof options.size === 'number') {\n\t\t\tthis.size = options.size;\n\n\t\t\tif (options.orientation === Orientation.VERTICAL) {\n\t\t\t\tthis.el.style.width = `${this.size}px`;\n\t\t\t} else {\n\t\t\t\tthis.el.style.height = `${this.size}px`;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.size = globalSize;\n\t\t\tthis._register(onDidChangeGlobalSize.event(size => {\n\t\t\t\tthis.size = size;\n\t\t\t\tthis.layout();\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(onDidChangeHoverDelay.event(delay => this.hoverDelay = delay));\n\n\t\tthis.layoutProvider = layoutProvider;\n\n\t\tthis.orthogonalStartSash = options.orthogonalStartSash;\n\t\tthis.orthogonalEndSash = options.orthogonalEndSash;\n\n\t\tthis.orientation = options.orientation || Orientation.VERTICAL;\n\n\t\tif (this.orientation === Orientation.HORIZONTAL) {\n\t\t\tthis.el.classList.add('horizontal');\n\t\t\tthis.el.classList.remove('vertical');\n\t\t} else {\n\t\t\tthis.el.classList.remove('horizontal');\n\t\t\tthis.el.classList.add('vertical');\n\t\t}\n\n\t\tthis.el.classList.toggle('debug', DEBUG);\n\n\t\tthis.layout();\n\t}\n\n\tprivate onPointerStart(event: PointerEvent, pointerEventFactory: IPointerEventFactory): void {\n\t\tEventHelper.stop(event);\n\n\t\tlet isMultisashResize = false;\n\n\t\tif (!(event as any).__orthogonalSashEvent) {\n\t\t\tconst orthogonalSash = this.getOrthogonalSash(event);\n\n\t\t\tif (orthogonalSash) {\n\t\t\t\tisMultisashResize = true;\n\t\t\t\t(event as any).__orthogonalSashEvent = true;\n\t\t\t\torthogonalSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory));\n\t\t\t}\n\t\t}\n\n\t\tif (this.linkedSash && !(event as any).__linkedSashEvent) {\n\t\t\t(event as any).__linkedSashEvent = true;\n\t\t\tthis.linkedSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory));\n\t\t}\n\n\t\tif (!this.state) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst iframes = getElementsByTagName('iframe');\n\t\tfor (const iframe of iframes) {\n\t\t\tiframe.classList.add(PointerEventsDisabledCssClass); // disable mouse events on iframes as long as we drag the sash\n\t\t}\n\n\t\tconst startX = event.pageX;\n\t\tconst startY = event.pageY;\n\t\tconst altKey = event.altKey;\n\t\tconst startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey };\n\n\t\tthis.el.classList.add('active');\n\t\tthis._onDidStart.fire(startEvent);\n\n\t\t// fix https://github.com/microsoft/vscode/issues/21675\n\t\tconst style = createStyleSheet(this.el);\n\t\tconst updateStyle = () => {\n\t\t\tlet cursor = '';\n\n\t\t\tif (isMultisashResize) {\n\t\t\t\tcursor = 'all-scroll';\n\t\t\t} else if (this.orientation === Orientation.HORIZONTAL) {\n\t\t\t\tif (this.state === SashState.AtMinimum) {\n\t\t\t\t\tcursor = 's-resize';\n\t\t\t\t} else if (this.state === SashState.AtMaximum) {\n\t\t\t\t\tcursor = 'n-resize';\n\t\t\t\t} else {\n\t\t\t\t\tcursor = isMacintosh ? 'row-resize' : 'ns-resize';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.state === SashState.AtMinimum) {\n\t\t\t\t\tcursor = 'e-resize';\n\t\t\t\t} else if (this.state === SashState.AtMaximum) {\n\t\t\t\t\tcursor = 'w-resize';\n\t\t\t\t} else {\n\t\t\t\t\tcursor = isMacintosh ? 'col-resize' : 'ew-resize';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstyle.textContent = `* { cursor: ${cursor} !important; }`;\n\t\t};\n\n\t\tconst disposables = new DisposableStore();\n\n\t\tupdateStyle();\n\n\t\tif (!isMultisashResize) {\n\t\t\tthis.onDidEnablementChange.event(updateStyle, null, disposables);\n\t\t}\n\n\t\tconst onPointerMove = (e: PointerEvent) => {\n\t\t\tEventHelper.stop(e, false);\n\t\t\tconst event: ISashEvent = { startX, currentX: e.pageX, startY, currentY: e.pageY, altKey };\n\n\t\t\tthis._onDidChange.fire(event);\n\t\t};\n\n\t\tconst onPointerUp = (e: PointerEvent) => {\n\t\t\tEventHelper.stop(e, false);\n\n\t\t\tthis.el.removeChild(style);\n\n\t\t\tthis.el.classList.remove('active');\n\t\t\tthis._onDidEnd.fire();\n\n\t\t\tdisposables.dispose();\n\n\t\t\tfor (const iframe of iframes) {\n\t\t\t\tiframe.classList.remove(PointerEventsDisabledCssClass);\n\t\t\t}\n\t\t};\n\n\t\tpointerEventFactory.onPointerMove(onPointerMove, null, disposables);\n\t\tpointerEventFactory.onPointerUp(onPointerUp, null, disposables);\n\t\tdisposables.add(pointerEventFactory);\n\t}\n\n\tprivate onPointerDoublePress(e: MouseEvent): void {\n\t\tconst orthogonalSash = this.getOrthogonalSash(e);\n\n\t\tif (orthogonalSash) {\n\t\t\torthogonalSash._onDidReset.fire();\n\t\t}\n\n\t\tif (this.linkedSash) {\n\t\t\tthis.linkedSash._onDidReset.fire();\n\t\t}\n\n\t\tthis._onDidReset.fire();\n\t}\n\n\tprivate static onMouseEnter(sash: Sash, fromLinkedSash: boolean = false): void {\n\t\tif (sash.el.classList.contains('active')) {\n\t\t\tsash.hoverDelayer.cancel();\n\t\t\tsash.el.classList.add('hover');\n\t\t} else {\n\t\t\tsash.hoverDelayer.trigger(() => sash.el.classList.add('hover'), sash.hoverDelay).then(undefined, () => { });\n\t\t}\n\n\t\tif (!fromLinkedSash && sash.linkedSash) {\n\t\t\tSash.onMouseEnter(sash.linkedSash, true);\n\t\t}\n\t}\n\n\tprivate static onMouseLeave(sash: Sash, fromLinkedSash: boolean = false): void {\n\t\tsash.hoverDelayer.cancel();\n\t\tsash.el.classList.remove('hover');\n\n\t\tif (!fromLinkedSash && sash.linkedSash) {\n\t\t\tSash.onMouseLeave(sash.linkedSash, true);\n\t\t}\n\t}\n\n\t/**\n\t * Forcefully stop any user interactions with this sash.\n\t * Useful when hiding a parent component, while the user is still\n\t * interacting with the sash.\n\t */\n\tclearSashHoverState(): void {\n\t\tSash.onMouseLeave(this);\n\t}\n\n\t/**\n\t * Layout the sash. The sash will size and position itself\n\t * based on its provided {@link ISashLayoutProvider layout provider}.\n\t */\n\tlayout(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tconst verticalProvider = (<IVerticalSashLayoutProvider>this.layoutProvider);\n\t\t\tthis.el.style.left = verticalProvider.getVerticalSashLeft(this) - (this.size / 2) + 'px';\n\n\t\t\tif (verticalProvider.getVerticalSashTop) {\n\t\t\t\tthis.el.style.top = verticalProvider.getVerticalSashTop(this) + 'px';\n\t\t\t}\n\n\t\t\tif (verticalProvider.getVerticalSashHeight) {\n\t\t\t\tthis.el.style.height = verticalProvider.getVerticalSashHeight(this) + 'px';\n\t\t\t}\n\t\t} else {\n\t\t\tconst horizontalProvider = (<IHorizontalSashLayoutProvider>this.layoutProvider);\n\t\t\tthis.el.style.top = horizontalProvider.getHorizontalSashTop(this) - (this.size / 2) + 'px';\n\n\t\t\tif (horizontalProvider.getHorizontalSashLeft) {\n\t\t\t\tthis.el.style.left = horizontalProvider.getHorizontalSashLeft(this) + 'px';\n\t\t\t}\n\n\t\t\tif (horizontalProvider.getHorizontalSashWidth) {\n\t\t\t\tthis.el.style.width = horizontalProvider.getHorizontalSashWidth(this) + 'px';\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getOrthogonalSash(e: PointerEvent): Sash | undefined {\n\t\tif (!e.target || !(e.target instanceof HTMLElement)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (e.target.classList.contains('orthogonal-drag-handle')) {\n\t\t\treturn e.target.classList.contains('start') ? this.orthogonalStartSash : this.orthogonalEndSash;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.el.remove();\n\t}\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 { getZoomFactor } from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { createFastDomNode, FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IMouseEvent, IMouseWheelEvent, StandardWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { ScrollbarHost } from 'vs/base/browser/ui/scrollbar/abstractScrollbar';\nimport { HorizontalScrollbar } from 'vs/base/browser/ui/scrollbar/horizontalScrollbar';\nimport { ScrollableElementChangeOptions, ScrollableElementCreationOptions, ScrollableElementResolvedOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions';\nimport { VerticalScrollbar } from 'vs/base/browser/ui/scrollbar/verticalScrollbar';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { INewScrollDimensions, INewScrollPosition, IScrollDimensions, IScrollPosition, Scrollable, ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\nimport 'vs/css!./media/scrollbars';\n\nconst HIDE_TIMEOUT = 500;\nconst SCROLL_WHEEL_SENSITIVITY = 50;\nconst SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED = true;\n\nexport interface IOverviewRulerLayoutInfo {\n\tparent: HTMLElement;\n\tinsertBefore: HTMLElement;\n}\n\nclass MouseWheelClassifierItem {\n\tpublic timestamp: number;\n\tpublic deltaX: number;\n\tpublic deltaY: number;\n\tpublic score: number;\n\n\tconstructor(timestamp: number, deltaX: number, deltaY: number) {\n\t\tthis.timestamp = timestamp;\n\t\tthis.deltaX = deltaX;\n\t\tthis.deltaY = deltaY;\n\t\tthis.score = 0;\n\t}\n}\n\nexport class MouseWheelClassifier {\n\n\tpublic static readonly INSTANCE = new MouseWheelClassifier();\n\n\tprivate readonly _capacity: number;\n\tprivate _memory: MouseWheelClassifierItem[];\n\tprivate _front: number;\n\tprivate _rear: number;\n\n\tconstructor() {\n\t\tthis._capacity = 5;\n\t\tthis._memory = [];\n\t\tthis._front = -1;\n\t\tthis._rear = -1;\n\t}\n\n\tpublic isPhysicalMouseWheel(): boolean {\n\t\tif (this._front === -1 && this._rear === -1) {\n\t\t\t// no elements\n\t\t\treturn false;\n\t\t}\n\n\t\t// 0.5 * last + 0.25 * 2nd last + 0.125 * 3rd last + ...\n\t\tlet remainingInfluence = 1;\n\t\tlet score = 0;\n\t\tlet iteration = 1;\n\n\t\tlet index = this._rear;\n\t\tdo {\n\t\t\tconst influence = (index === this._front ? remainingInfluence : Math.pow(2, -iteration));\n\t\t\tremainingInfluence -= influence;\n\t\t\tscore += this._memory[index].score * influence;\n\n\t\t\tif (index === this._front) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = (this._capacity + index - 1) % this._capacity;\n\t\t\titeration++;\n\t\t} while (true);\n\n\t\treturn (score <= 0.5);\n\t}\n\n\tpublic accept(timestamp: number, deltaX: number, deltaY: number): void {\n\t\tconst item = new MouseWheelClassifierItem(timestamp, deltaX, deltaY);\n\t\titem.score = this._computeScore(item);\n\n\t\tif (this._front === -1 && this._rear === -1) {\n\t\t\tthis._memory[0] = item;\n\t\t\tthis._front = 0;\n\t\t\tthis._rear = 0;\n\t\t} else {\n\t\t\tthis._rear = (this._rear + 1) % this._capacity;\n\t\t\tif (this._rear === this._front) {\n\t\t\t\t// Drop oldest\n\t\t\t\tthis._front = (this._front + 1) % this._capacity;\n\t\t\t}\n\t\t\tthis._memory[this._rear] = item;\n\t\t}\n\t}\n\n\t/**\n\t * A score between 0 and 1 for `item`.\n\t * - a score towards 0 indicates that the source appears to be a physical mouse wheel\n\t * - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc.\n\t */\n\tprivate _computeScore(item: MouseWheelClassifierItem): number {\n\n\t\tif (Math.abs(item.deltaX) > 0 && Math.abs(item.deltaY) > 0) {\n\t\t\t// both axes exercised => definitely not a physical mouse wheel\n\t\t\treturn 1;\n\t\t}\n\n\t\tlet score: number = 0.5;\n\t\tconst prev = (this._front === -1 && this._rear === -1 ? null : this._memory[this._rear]);\n\t\tif (prev) {\n\t\t\t// const deltaT = item.timestamp - prev.timestamp;\n\t\t\t// if (deltaT < 1000 / 30) {\n\t\t\t// \t// sooner than X times per second => indicator that this is not a physical mouse wheel\n\t\t\t// \tscore += 0.25;\n\t\t\t// }\n\n\t\t\t// if (item.deltaX === prev.deltaX && item.deltaY === prev.deltaY) {\n\t\t\t// \t// equal amplitude => indicator that this is a physical mouse wheel\n\t\t\t// \tscore -= 0.25;\n\t\t\t// }\n\t\t}\n\n\t\tif (!this._isAlmostInt(item.deltaX) || !this._isAlmostInt(item.deltaY)) {\n\t\t\t// non-integer deltas => indicator that this is not a physical mouse wheel\n\t\t\tscore += 0.25;\n\t\t}\n\n\t\treturn Math.min(Math.max(score, 0), 1);\n\t}\n\n\tprivate _isAlmostInt(value: number): boolean {\n\t\tconst delta = Math.abs(Math.round(value) - value);\n\t\treturn (delta < 0.01);\n\t}\n}\n\nexport abstract class AbstractScrollableElement extends Widget {\n\n\tprivate readonly _options: ScrollableElementResolvedOptions;\n\tprotected readonly _scrollable: Scrollable;\n\tprivate readonly _verticalScrollbar: VerticalScrollbar;\n\tprivate readonly _horizontalScrollbar: HorizontalScrollbar;\n\tprivate readonly _domNode: HTMLElement;\n\n\tprivate readonly _leftShadowDomNode: FastDomNode<HTMLElement> | null;\n\tprivate readonly _topShadowDomNode: FastDomNode<HTMLElement> | null;\n\tprivate readonly _topLeftShadowDomNode: FastDomNode<HTMLElement> | null;\n\n\tprivate readonly _listenOnDomNode: HTMLElement;\n\n\tprivate _mouseWheelToDispose: IDisposable[];\n\n\tprivate _isDragging: boolean;\n\tprivate _mouseIsOver: boolean;\n\n\tprivate readonly _hideTimeout: TimeoutTimer;\n\tprivate _shouldRender: boolean;\n\n\tprivate _revealOnScroll: boolean;\n\n\tprivate readonly _onScroll = this._register(new Emitter<ScrollEvent>());\n\tpublic readonly onScroll: Event<ScrollEvent> = this._onScroll.event;\n\n\tprivate readonly _onWillScroll = this._register(new Emitter<ScrollEvent>());\n\n\tpublic get options(): Readonly<ScrollableElementResolvedOptions> {\n\t\treturn this._options;\n\t}\n\n\tprotected constructor(element: HTMLElement, options: ScrollableElementCreationOptions, scrollable: Scrollable) {\n\t\tsuper();\n\t\telement.style.overflow = 'hidden';\n\t\tthis._options = resolveOptions(options);\n\t\tthis._scrollable = scrollable;\n\n\t\tthis._register(this._scrollable.onScroll((e) => {\n\t\t\tthis._onWillScroll.fire(e);\n\t\t\tthis._onDidScroll(e);\n\t\t\tthis._onScroll.fire(e);\n\t\t}));\n\n\t\tconst scrollbarHost: ScrollbarHost = {\n\t\t\tonMouseWheel: (mouseWheelEvent: StandardWheelEvent) => this._onMouseWheel(mouseWheelEvent),\n\t\t\tonDragStart: () => this._onDragStart(),\n\t\t\tonDragEnd: () => this._onDragEnd(),\n\t\t};\n\t\tthis._verticalScrollbar = this._register(new VerticalScrollbar(this._scrollable, this._options, scrollbarHost));\n\t\tthis._horizontalScrollbar = this._register(new HorizontalScrollbar(this._scrollable, this._options, scrollbarHost));\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'monaco-scrollable-element ' + this._options.className;\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.style.position = 'relative';\n\t\tthis._domNode.style.overflow = 'hidden';\n\t\tthis._domNode.appendChild(element);\n\t\tthis._domNode.appendChild(this._horizontalScrollbar.domNode.domNode);\n\t\tthis._domNode.appendChild(this._verticalScrollbar.domNode.domNode);\n\n\t\tif (this._options.useShadows) {\n\t\t\tthis._leftShadowDomNode = createFastDomNode(document.createElement('div'));\n\t\t\tthis._leftShadowDomNode.setClassName('shadow');\n\t\t\tthis._domNode.appendChild(this._leftShadowDomNode.domNode);\n\n\t\t\tthis._topShadowDomNode = createFastDomNode(document.createElement('div'));\n\t\t\tthis._topShadowDomNode.setClassName('shadow');\n\t\t\tthis._domNode.appendChild(this._topShadowDomNode.domNode);\n\n\t\t\tthis._topLeftShadowDomNode = createFastDomNode(document.createElement('div'));\n\t\t\tthis._topLeftShadowDomNode.setClassName('shadow');\n\t\t\tthis._domNode.appendChild(this._topLeftShadowDomNode.domNode);\n\t\t} else {\n\t\t\tthis._leftShadowDomNode = null;\n\t\t\tthis._topShadowDomNode = null;\n\t\t\tthis._topLeftShadowDomNode = null;\n\t\t}\n\n\t\tthis._listenOnDomNode = this._options.listenOnDomNode || this._domNode;\n\n\t\tthis._mouseWheelToDispose = [];\n\t\tthis._setListeningToMouseWheel(this._options.handleMouseWheel);\n\n\t\tthis.onmouseover(this._listenOnDomNode, (e) => this._onMouseOver(e));\n\t\tthis.onnonbubblingmouseout(this._listenOnDomNode, (e) => this._onMouseOut(e));\n\n\t\tthis._hideTimeout = this._register(new TimeoutTimer());\n\t\tthis._isDragging = false;\n\t\tthis._mouseIsOver = false;\n\n\t\tthis._shouldRender = true;\n\n\t\tthis._revealOnScroll = true;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._mouseWheelToDispose = dispose(this._mouseWheelToDispose);\n\t\tsuper.dispose();\n\t}\n\n\t/**\n\t * Get the generated 'scrollable' dom node\n\t */\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getOverviewRulerLayoutInfo(): IOverviewRulerLayoutInfo {\n\t\treturn {\n\t\t\tparent: this._domNode,\n\t\t\tinsertBefore: this._verticalScrollbar.domNode.domNode,\n\t\t};\n\t}\n\n\t/**\n\t * Delegate a mouse down event to the vertical scrollbar.\n\t * This is to help with clicking somewhere else and having the scrollbar react.\n\t */\n\tpublic delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void {\n\t\tthis._verticalScrollbar.delegateMouseDown(browserEvent);\n\t}\n\n\tpublic getScrollDimensions(): IScrollDimensions {\n\t\treturn this._scrollable.getScrollDimensions();\n\t}\n\n\tpublic setScrollDimensions(dimensions: INewScrollDimensions): void {\n\t\tthis._scrollable.setScrollDimensions(dimensions, false);\n\t}\n\n\t/**\n\t * Update the class name of the scrollable element.\n\t */\n\tpublic updateClassName(newClassName: string): void {\n\t\tthis._options.className = newClassName;\n\t\t// Defaults are different on Macs\n\t\tif (platform.isMacintosh) {\n\t\t\tthis._options.className += ' mac';\n\t\t}\n\t\tthis._domNode.className = 'monaco-scrollable-element ' + this._options.className;\n\t}\n\n\t/**\n\t * Update configuration options for the scrollbar.\n\t */\n\tpublic updateOptions(newOptions: ScrollableElementChangeOptions): void {\n\t\tif (typeof newOptions.handleMouseWheel !== 'undefined') {\n\t\t\tthis._options.handleMouseWheel = newOptions.handleMouseWheel;\n\t\t\tthis._setListeningToMouseWheel(this._options.handleMouseWheel);\n\t\t}\n\t\tif (typeof newOptions.mouseWheelScrollSensitivity !== 'undefined') {\n\t\t\tthis._options.mouseWheelScrollSensitivity = newOptions.mouseWheelScrollSensitivity;\n\t\t}\n\t\tif (typeof newOptions.fastScrollSensitivity !== 'undefined') {\n\t\t\tthis._options.fastScrollSensitivity = newOptions.fastScrollSensitivity;\n\t\t}\n\t\tif (typeof newOptions.scrollPredominantAxis !== 'undefined') {\n\t\t\tthis._options.scrollPredominantAxis = newOptions.scrollPredominantAxis;\n\t\t}\n\t\tif (typeof newOptions.horizontal !== 'undefined') {\n\t\t\tthis._options.horizontal = newOptions.horizontal;\n\t\t}\n\t\tif (typeof newOptions.vertical !== 'undefined') {\n\t\t\tthis._options.vertical = newOptions.vertical;\n\t\t}\n\t\tif (typeof newOptions.horizontalScrollbarSize !== 'undefined') {\n\t\t\tthis._options.horizontalScrollbarSize = newOptions.horizontalScrollbarSize;\n\t\t}\n\t\tif (typeof newOptions.verticalScrollbarSize !== 'undefined') {\n\t\t\tthis._options.verticalScrollbarSize = newOptions.verticalScrollbarSize;\n\t\t}\n\t\tif (typeof newOptions.scrollByPage !== 'undefined') {\n\t\t\tthis._options.scrollByPage = newOptions.scrollByPage;\n\t\t}\n\t\tthis._horizontalScrollbar.updateOptions(this._options);\n\t\tthis._verticalScrollbar.updateOptions(this._options);\n\n\t\tif (!this._options.lazyRender) {\n\t\t\tthis._render();\n\t\t}\n\t}\n\n\t// -------------------- mouse wheel scrolling --------------------\n\n\tprivate _setListeningToMouseWheel(shouldListen: boolean): void {\n\t\tconst isListening = (this._mouseWheelToDispose.length > 0);\n\n\t\tif (isListening === shouldListen) {\n\t\t\t// No change\n\t\t\treturn;\n\t\t}\n\n\t\t// Stop listening (if necessary)\n\t\tthis._mouseWheelToDispose = dispose(this._mouseWheelToDispose);\n\n\t\t// Start listening (if necessary)\n\t\tif (shouldListen) {\n\t\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\t\tthis._onMouseWheel(new StandardWheelEvent(browserEvent));\n\t\t\t};\n\n\t\t\tthis._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { passive: false }));\n\t\t}\n\t}\n\n\tprivate _onMouseWheel(e: StandardWheelEvent): void {\n\n\t\tconst classifier = MouseWheelClassifier.INSTANCE;\n\t\tif (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED) {\n\t\t\tconst osZoomFactor = window.devicePixelRatio / getZoomFactor();\n\t\t\tif (platform.isWindows || platform.isLinux) {\n\t\t\t\t// On Windows and Linux, the incoming delta events are multiplied with the OS zoom factor.\n\t\t\t\t// The OS zoom factor can be reverse engineered by using the device pixel ratio and the configured zoom factor into account.\n\t\t\t\tclassifier.accept(Date.now(), e.deltaX / osZoomFactor, e.deltaY / osZoomFactor);\n\t\t\t} else {\n\t\t\t\tclassifier.accept(Date.now(), e.deltaX, e.deltaY);\n\t\t\t}\n\t\t}\n\n\t\t// console.log(`${Date.now()}, ${e.deltaY}, ${e.deltaX}`);\n\n\t\tlet didScroll = false;\n\n\t\tif (e.deltaY || e.deltaX) {\n\t\t\tlet deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity;\n\t\t\tlet deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity;\n\n\t\t\tif (this._options.scrollPredominantAxis) {\n\t\t\t\tif (Math.abs(deltaY) >= Math.abs(deltaX)) {\n\t\t\t\t\tdeltaX = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdeltaY = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._options.flipAxes) {\n\t\t\t\t[deltaY, deltaX] = [deltaX, deltaY];\n\t\t\t}\n\n\t\t\t// Convert vertical scrolling to horizontal if shift is held, this\n\t\t\t// is handled at a higher level on Mac\n\t\t\tconst shiftConvert = !platform.isMacintosh && e.browserEvent && e.browserEvent.shiftKey;\n\t\t\tif ((this._options.scrollYToX || shiftConvert) && !deltaX) {\n\t\t\t\tdeltaX = deltaY;\n\t\t\t\tdeltaY = 0;\n\t\t\t}\n\n\t\t\tif (e.browserEvent && e.browserEvent.altKey) {\n\t\t\t\t// fastScrolling\n\t\t\t\tdeltaX = deltaX * this._options.fastScrollSensitivity;\n\t\t\t\tdeltaY = deltaY * this._options.fastScrollSensitivity;\n\t\t\t}\n\n\t\t\tconst futureScrollPosition = this._scrollable.getFutureScrollPosition();\n\n\t\t\tlet desiredScrollPosition: INewScrollPosition = {};\n\t\t\tif (deltaY) {\n\t\t\t\tconst deltaScrollTop = SCROLL_WHEEL_SENSITIVITY * deltaY;\n\t\t\t\t// Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll\n\t\t\t\tconst desiredScrollTop = futureScrollPosition.scrollTop - (deltaScrollTop < 0 ? Math.floor(deltaScrollTop) : Math.ceil(deltaScrollTop));\n\t\t\t\tthis._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop);\n\t\t\t}\n\t\t\tif (deltaX) {\n\t\t\t\tconst deltaScrollLeft = SCROLL_WHEEL_SENSITIVITY * deltaX;\n\t\t\t\t// Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll\n\t\t\t\tconst desiredScrollLeft = futureScrollPosition.scrollLeft - (deltaScrollLeft < 0 ? Math.floor(deltaScrollLeft) : Math.ceil(deltaScrollLeft));\n\t\t\t\tthis._horizontalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollLeft);\n\t\t\t}\n\n\t\t\t// Check that we are scrolling towards a location which is valid\n\t\t\tdesiredScrollPosition = this._scrollable.validateScrollPosition(desiredScrollPosition);\n\n\t\t\tif (futureScrollPosition.scrollLeft !== desiredScrollPosition.scrollLeft || futureScrollPosition.scrollTop !== desiredScrollPosition.scrollTop) {\n\n\t\t\t\tconst canPerformSmoothScroll = (\n\t\t\t\t\tSCROLL_WHEEL_SMOOTH_SCROLL_ENABLED\n\t\t\t\t\t&& this._options.mouseWheelSmoothScroll\n\t\t\t\t\t&& classifier.isPhysicalMouseWheel()\n\t\t\t\t);\n\n\t\t\t\tif (canPerformSmoothScroll) {\n\t\t\t\t\tthis._scrollable.setScrollPositionSmooth(desiredScrollPosition);\n\t\t\t\t} else {\n\t\t\t\t\tthis._scrollable.setScrollPositionNow(desiredScrollPosition);\n\t\t\t\t}\n\n\t\t\t\tdidScroll = true;\n\t\t\t}\n\t\t}\n\n\t\tlet consumeMouseWheel = didScroll;\n\t\tif (!consumeMouseWheel && this._options.alwaysConsumeMouseWheel) {\n\t\t\tconsumeMouseWheel = true;\n\t\t}\n\t\tif (!consumeMouseWheel && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded())) {\n\t\t\tconsumeMouseWheel = true;\n\t\t}\n\n\t\tif (consumeMouseWheel) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\tprivate _onDidScroll(e: ScrollEvent): void {\n\t\tthis._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender;\n\t\tthis._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender;\n\n\t\tif (this._options.useShadows) {\n\t\t\tthis._shouldRender = true;\n\t\t}\n\n\t\tif (this._revealOnScroll) {\n\t\t\tthis._reveal();\n\t\t}\n\n\t\tif (!this._options.lazyRender) {\n\t\t\tthis._render();\n\t\t}\n\t}\n\n\t/**\n\t * Render / mutate the DOM now.\n\t * Should be used together with the ctor option `lazyRender`.\n\t */\n\tpublic renderNow(): void {\n\t\tif (!this._options.lazyRender) {\n\t\t\tthrow new Error('Please use `lazyRender` together with `renderNow`!');\n\t\t}\n\n\t\tthis._render();\n\t}\n\n\tprivate _render(): void {\n\t\tif (!this._shouldRender) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._shouldRender = false;\n\n\t\tthis._horizontalScrollbar.render();\n\t\tthis._verticalScrollbar.render();\n\n\t\tif (this._options.useShadows) {\n\t\t\tconst scrollState = this._scrollable.getCurrentScrollPosition();\n\t\t\tconst enableTop = scrollState.scrollTop > 0;\n\t\t\tconst enableLeft = scrollState.scrollLeft > 0;\n\n\t\t\tconst leftClassName = (enableLeft ? ' left' : '');\n\t\t\tconst topClassName = (enableTop ? ' top' : '');\n\t\t\tconst topLeftClassName = (enableLeft || enableTop ? ' top-left-corner' : '');\n\t\t\tthis._leftShadowDomNode!.setClassName(`shadow${leftClassName}`);\n\t\t\tthis._topShadowDomNode!.setClassName(`shadow${topClassName}`);\n\t\t\tthis._topLeftShadowDomNode!.setClassName(`shadow${topLeftClassName}${topClassName}${leftClassName}`);\n\t\t}\n\t}\n\n\t// -------------------- fade in / fade out --------------------\n\n\tprivate _onDragStart(): void {\n\t\tthis._isDragging = true;\n\t\tthis._reveal();\n\t}\n\n\tprivate _onDragEnd(): void {\n\t\tthis._isDragging = false;\n\t\tthis._hide();\n\t}\n\n\tprivate _onMouseOut(e: IMouseEvent): void {\n\t\tthis._mouseIsOver = false;\n\t\tthis._hide();\n\t}\n\n\tprivate _onMouseOver(e: IMouseEvent): void {\n\t\tthis._mouseIsOver = true;\n\t\tthis._reveal();\n\t}\n\n\tprivate _reveal(): void {\n\t\tthis._verticalScrollbar.beginReveal();\n\t\tthis._horizontalScrollbar.beginReveal();\n\t\tthis._scheduleHide();\n\t}\n\n\tprivate _hide(): void {\n\t\tif (!this._mouseIsOver && !this._isDragging) {\n\t\t\tthis._verticalScrollbar.beginHide();\n\t\t\tthis._horizontalScrollbar.beginHide();\n\t\t}\n\t}\n\n\tprivate _scheduleHide(): void {\n\t\tif (!this._mouseIsOver && !this._isDragging) {\n\t\t\tthis._hideTimeout.cancelAndSet(() => this._hide(), HIDE_TIMEOUT);\n\t\t}\n\t}\n}\n\nexport class ScrollableElement extends AbstractScrollableElement {\n\n\tconstructor(element: HTMLElement, options: ScrollableElementCreationOptions) {\n\t\toptions = options || {};\n\t\toptions.mouseWheelSmoothScroll = false;\n\t\tconst scrollable = new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 0,\n\t\t\tscheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(callback)\n\t\t});\n\t\tsuper(element, options, scrollable);\n\t\tthis._register(scrollable);\n\t}\n\n\tpublic setScrollPosition(update: INewScrollPosition): void {\n\t\tthis._scrollable.setScrollPositionNow(update);\n\t}\n}\n\nexport class SmoothScrollableElement extends AbstractScrollableElement {\n\n\tconstructor(element: HTMLElement, options: ScrollableElementCreationOptions, scrollable: Scrollable) {\n\t\tsuper(element, options, scrollable);\n\t}\n\n\tpublic setScrollPosition(update: INewScrollPosition & { reuseAnimation?: boolean }): void {\n\t\tif (update.reuseAnimation) {\n\t\t\tthis._scrollable.setScrollPositionSmooth(update, update.reuseAnimation);\n\t\t} else {\n\t\t\tthis._scrollable.setScrollPositionNow(update);\n\t\t}\n\t}\n\n\tpublic getScrollPosition(): IScrollPosition {\n\t\treturn this._scrollable.getCurrentScrollPosition();\n\t}\n\n}\n\nexport class DomScrollableElement extends AbstractScrollableElement {\n\n\tprivate _element: HTMLElement;\n\n\tconstructor(element: HTMLElement, options: ScrollableElementCreationOptions) {\n\t\toptions = options || {};\n\t\toptions.mouseWheelSmoothScroll = false;\n\t\tconst scrollable = new Scrollable({\n\t\t\tforceIntegerValues: false, // See https://github.com/microsoft/vscode/issues/139877\n\t\t\tsmoothScrollDuration: 0,\n\t\t\tscheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(callback)\n\t\t});\n\t\tsuper(element, options, scrollable);\n\t\tthis._register(scrollable);\n\t\tthis._element = element;\n\t\tthis.onScroll((e) => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis._element.scrollTop = e.scrollTop;\n\t\t\t}\n\t\t\tif (e.scrollLeftChanged) {\n\t\t\t\tthis._element.scrollLeft = e.scrollLeft;\n\t\t\t}\n\t\t});\n\t\tthis.scanDomNode();\n\t}\n\n\tpublic setScrollPosition(update: INewScrollPosition): void {\n\t\tthis._scrollable.setScrollPositionNow(update);\n\t}\n\n\tpublic getScrollPosition(): IScrollPosition {\n\t\treturn this._scrollable.getCurrentScrollPosition();\n\t}\n\n\tpublic scanDomNode(): void {\n\t\t// width, scrollLeft, scrollWidth, height, scrollTop, scrollHeight\n\t\tthis.setScrollDimensions({\n\t\t\twidth: this._element.clientWidth,\n\t\t\tscrollWidth: this._element.scrollWidth,\n\t\t\theight: this._element.clientHeight,\n\t\t\tscrollHeight: this._element.scrollHeight\n\t\t});\n\t\tthis.setScrollPosition({\n\t\t\tscrollLeft: this._element.scrollLeft,\n\t\t\tscrollTop: this._element.scrollTop,\n\t\t});\n\t}\n}\n\nfunction resolveOptions(opts: ScrollableElementCreationOptions): ScrollableElementResolvedOptions {\n\tconst result: ScrollableElementResolvedOptions = {\n\t\tlazyRender: (typeof opts.lazyRender !== 'undefined' ? opts.lazyRender : false),\n\t\tclassName: (typeof opts.className !== 'undefined' ? opts.className : ''),\n\t\tuseShadows: (typeof opts.useShadows !== 'undefined' ? opts.useShadows : true),\n\t\thandleMouseWheel: (typeof opts.handleMouseWheel !== 'undefined' ? opts.handleMouseWheel : true),\n\t\tflipAxes: (typeof opts.flipAxes !== 'undefined' ? opts.flipAxes : false),\n\t\tconsumeMouseWheelIfScrollbarIsNeeded: (typeof opts.consumeMouseWheelIfScrollbarIsNeeded !== 'undefined' ? opts.consumeMouseWheelIfScrollbarIsNeeded : false),\n\t\talwaysConsumeMouseWheel: (typeof opts.alwaysConsumeMouseWheel !== 'undefined' ? opts.alwaysConsumeMouseWheel : false),\n\t\tscrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false),\n\t\tmouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1),\n\t\tfastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5),\n\t\tscrollPredominantAxis: (typeof opts.scrollPredominantAxis !== 'undefined' ? opts.scrollPredominantAxis : true),\n\t\tmouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true),\n\t\tarrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11),\n\n\t\tlistenOnDomNode: (typeof opts.listenOnDomNode !== 'undefined' ? opts.listenOnDomNode : null),\n\n\t\thorizontal: (typeof opts.horizontal !== 'undefined' ? opts.horizontal : ScrollbarVisibility.Auto),\n\t\thorizontalScrollbarSize: (typeof opts.horizontalScrollbarSize !== 'undefined' ? opts.horizontalScrollbarSize : 10),\n\t\thorizontalSliderSize: (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : 0),\n\t\thorizontalHasArrows: (typeof opts.horizontalHasArrows !== 'undefined' ? opts.horizontalHasArrows : false),\n\n\t\tvertical: (typeof opts.vertical !== 'undefined' ? opts.vertical : ScrollbarVisibility.Auto),\n\t\tverticalScrollbarSize: (typeof opts.verticalScrollbarSize !== 'undefined' ? opts.verticalScrollbarSize : 10),\n\t\tverticalHasArrows: (typeof opts.verticalHasArrows !== 'undefined' ? opts.verticalHasArrows : false),\n\t\tverticalSliderSize: (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : 0),\n\n\t\tscrollByPage: (typeof opts.scrollByPage !== 'undefined' ? opts.scrollByPage : false)\n\t};\n\n\tresult.horizontalSliderSize = (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : result.horizontalScrollbarSize);\n\tresult.verticalSliderSize = (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : result.verticalScrollbarSize);\n\n\t// Defaults are different on Macs\n\tif (platform.isMacintosh) {\n\t\tresult.className += ' mac';\n\t}\n\n\treturn result;\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 * as dom from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./hover';\n\nconst $ = dom.$;\n\nexport const enum HoverPosition {\n\tLEFT, RIGHT, BELOW, ABOVE\n}\n\nexport class HoverWidget extends Disposable {\n\n\tpublic readonly containerDomNode: HTMLElement;\n\tpublic readonly contentsDomNode: HTMLElement;\n\tpublic readonly scrollbar: DomScrollableElement;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.containerDomNode = document.createElement('div');\n\t\tthis.containerDomNode.className = 'monaco-hover';\n\t\tthis.containerDomNode.tabIndex = 0;\n\t\tthis.containerDomNode.setAttribute('role', 'tooltip');\n\n\t\tthis.contentsDomNode = document.createElement('div');\n\t\tthis.contentsDomNode.className = 'monaco-hover-content';\n\n\t\tthis.scrollbar = this._register(new DomScrollableElement(this.contentsDomNode, {\n\t\t\tconsumeMouseWheelIfScrollbarIsNeeded: true\n\t\t}));\n\t\tthis.containerDomNode.appendChild(this.scrollbar.getDomNode());\n\t}\n\n\tpublic onContentsChanged(): void {\n\t\tthis.scrollbar.scanDomNode();\n\t}\n}\n\nexport class HoverAction extends Disposable {\n\tpublic static render(parent: HTMLElement, actionOptions: { label: string; iconClass?: string; run: (target: HTMLElement) => void; commandId: string }, keybindingLabel: string | null) {\n\t\treturn new HoverAction(parent, actionOptions, keybindingLabel);\n\t}\n\n\tprivate readonly actionContainer: HTMLElement;\n\tprivate readonly action: HTMLElement;\n\n\tprivate constructor(parent: HTMLElement, actionOptions: { label: string; iconClass?: string; run: (target: HTMLElement) => void; commandId: string }, keybindingLabel: string | null) {\n\t\tsuper();\n\n\t\tthis.actionContainer = dom.append(parent, $('div.action-container'));\n\t\tthis.actionContainer.setAttribute('tabindex', '0');\n\n\t\tthis.action = dom.append(this.actionContainer, $('a.action'));\n\t\tthis.action.setAttribute('role', 'button');\n\t\tif (actionOptions.iconClass) {\n\t\t\tdom.append(this.action, $(`span.icon.${actionOptions.iconClass}`));\n\t\t}\n\t\tconst label = dom.append(this.action, $('span'));\n\t\tlabel.textContent = keybindingLabel ? `${actionOptions.label} (${keybindingLabel})` : actionOptions.label;\n\n\t\tthis._register(dom.addDisposableListener(this.actionContainer, dom.EventType.CLICK, e => {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\tactionOptions.run(this.actionContainer);\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(this.actionContainer, dom.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter)) {\n\t\t\t\te.stopPropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\tactionOptions.run(this.actionContainer);\n\t\t\t}\n\t\t}));\n\n\t\tthis.setEnabled(true);\n\t}\n\n\tpublic setEnabled(enabled: boolean): void {\n\t\tif (enabled) {\n\t\t\tthis.actionContainer.classList.remove('disabled');\n\t\t\tthis.actionContainer.removeAttribute('aria-disabled');\n\t\t} else {\n\t\t\tthis.actionContainer.classList.add('disabled');\n\t\t\tthis.actionContainer.setAttribute('aria-disabled', 'true');\n\t\t}\n\t}\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 { isFirefox } from 'vs/base/browser/browser';\nimport { DataTransfers, IDragAndDropData, StaticDND } from 'vs/base/browser/dnd';\nimport { $, addDisposableListener, animate, getContentHeight, getContentWidth, getTopLeftOffset, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { EventType as TouchEventType, Gesture, GestureEvent } from 'vs/base/browser/touch';\nimport { SmoothScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { distinct, equals } from 'vs/base/common/arrays';\nimport { Delayer, disposableTimeout } from 'vs/base/common/async';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { getOrDefault } from 'vs/base/common/objects';\nimport { IRange, Range } from 'vs/base/common/range';\nimport { INewScrollDimensions, Scrollable, ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { IListDragAndDrop, IListDragEvent, IListGestureEvent, IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate, ListDragOverEffect } from 'vs/base/browser/ui/list/list';\nimport { RangeMap, shift } from 'vs/base/browser/ui/list/rangeMap';\nimport { IRow, RowCache } from 'vs/base/browser/ui/list/rowCache';\nimport { IObservableValue } from 'vs/base/common/observableValue';\n\ninterface IItem<T> {\n\treadonly id: string;\n\treadonly element: T;\n\treadonly templateId: string;\n\trow: IRow | null;\n\tsize: number;\n\twidth: number | undefined;\n\thasDynamicHeight: boolean;\n\tlastDynamicHeightWidth: number | undefined;\n\turi: string | undefined;\n\tdropTarget: boolean;\n\tdragStartDisposable: IDisposable;\n\tcheckedDisposable: IDisposable;\n}\n\nexport interface IListViewDragAndDrop<T> extends IListDragAndDrop<T> {\n\tgetDragElements(element: T): T[];\n}\n\nexport interface IListViewAccessibilityProvider<T> {\n\tgetSetSize?(element: T, index: number, listLength: number): number;\n\tgetPosInSet?(element: T, index: number): number;\n\tgetRole?(element: T): string | undefined;\n\tisChecked?(element: T): boolean | IObservableValue<boolean> | undefined;\n}\n\nexport interface IListViewOptionsUpdate {\n\treadonly additionalScrollHeight?: number;\n\treadonly smoothScrolling?: boolean;\n\treadonly horizontalScrolling?: boolean;\n\treadonly mouseWheelScrollSensitivity?: number;\n\treadonly fastScrollSensitivity?: number;\n}\n\nexport interface IListViewOptions<T> extends IListViewOptionsUpdate {\n\treadonly dnd?: IListViewDragAndDrop<T>;\n\treadonly useShadows?: boolean;\n\treadonly verticalScrollMode?: ScrollbarVisibility;\n\treadonly setRowLineHeight?: boolean;\n\treadonly setRowHeight?: boolean;\n\treadonly supportDynamicHeights?: boolean;\n\treadonly mouseSupport?: boolean;\n\treadonly accessibilityProvider?: IListViewAccessibilityProvider<T>;\n\treadonly transformOptimization?: boolean;\n\treadonly alwaysConsumeMouseWheel?: boolean;\n}\n\nconst DefaultOptions = {\n\tuseShadows: true,\n\tverticalScrollMode: ScrollbarVisibility.Auto,\n\tsetRowLineHeight: true,\n\tsetRowHeight: true,\n\tsupportDynamicHeights: false,\n\tdnd: {\n\t\tgetDragElements<T>(e: T) { return [e]; },\n\t\tgetDragURI() { return null; },\n\t\tonDragStart(): void { },\n\t\tonDragOver() { return false; },\n\t\tdrop() { }\n\t},\n\thorizontalScrolling: false,\n\ttransformOptimization: true,\n\talwaysConsumeMouseWheel: true,\n};\n\nexport class ElementsDragAndDropData<T, TContext = void> implements IDragAndDropData {\n\n\treadonly elements: T[];\n\n\tconstructor(elements: T[]) {\n\t\tthis.elements = elements;\n\t}\n\n\tupdate(): void { }\n\n\tgetData(): T[] {\n\t\treturn this.elements;\n\t}\n}\n\nexport class ExternalElementsDragAndDropData<T> implements IDragAndDropData {\n\n\treadonly elements: T[];\n\n\tconstructor(elements: T[]) {\n\t\tthis.elements = elements;\n\t}\n\n\tupdate(): void { }\n\n\tgetData(): T[] {\n\t\treturn this.elements;\n\t}\n}\n\nexport class NativeDragAndDropData implements IDragAndDropData {\n\n\treadonly types: any[];\n\treadonly files: any[];\n\n\tconstructor() {\n\t\tthis.types = [];\n\t\tthis.files = [];\n\t}\n\n\tupdate(dataTransfer: DataTransfer): void {\n\t\tif (dataTransfer.types) {\n\t\t\tthis.types.splice(0, this.types.length, ...dataTransfer.types);\n\t\t}\n\n\t\tif (dataTransfer.files) {\n\t\t\tthis.files.splice(0, this.files.length);\n\n\t\t\tfor (let i = 0; i < dataTransfer.files.length; i++) {\n\t\t\t\tconst file = dataTransfer.files.item(i);\n\n\t\t\t\tif (file && (file.size || file.type)) {\n\t\t\t\t\tthis.files.push(file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgetData(): any {\n\t\treturn {\n\t\t\ttypes: this.types,\n\t\t\tfiles: this.files\n\t\t};\n\t}\n}\n\nfunction equalsDragFeedback(f1: number[] | undefined, f2: number[] | undefined): boolean {\n\tif (Array.isArray(f1) && Array.isArray(f2)) {\n\t\treturn equals(f1, f2!);\n\t}\n\n\treturn f1 === f2;\n}\n\nclass ListViewAccessibilityProvider<T> implements Required<IListViewAccessibilityProvider<T>> {\n\n\treadonly getSetSize: (element: any, index: number, listLength: number) => number;\n\treadonly getPosInSet: (element: any, index: number) => number;\n\treadonly getRole: (element: T) => string | undefined;\n\treadonly isChecked: (element: T) => boolean | IObservableValue<boolean> | undefined;\n\n\tconstructor(accessibilityProvider?: IListViewAccessibilityProvider<T>) {\n\t\tif (accessibilityProvider?.getSetSize) {\n\t\t\tthis.getSetSize = accessibilityProvider.getSetSize.bind(accessibilityProvider);\n\t\t} else {\n\t\t\tthis.getSetSize = (e, i, l) => l;\n\t\t}\n\n\t\tif (accessibilityProvider?.getPosInSet) {\n\t\t\tthis.getPosInSet = accessibilityProvider.getPosInSet.bind(accessibilityProvider);\n\t\t} else {\n\t\t\tthis.getPosInSet = (e, i) => i + 1;\n\t\t}\n\n\t\tif (accessibilityProvider?.getRole) {\n\t\t\tthis.getRole = accessibilityProvider.getRole.bind(accessibilityProvider);\n\t\t} else {\n\t\t\tthis.getRole = _ => 'listitem';\n\t\t}\n\n\t\tif (accessibilityProvider?.isChecked) {\n\t\t\tthis.isChecked = accessibilityProvider.isChecked.bind(accessibilityProvider);\n\t\t} else {\n\t\t\tthis.isChecked = _ => undefined;\n\t\t}\n\t}\n}\n\n/**\n * The {@link ListView} is a virtual scrolling engine.\n *\n * Given that it only renders elements within its viewport, it can hold large\n * collections of elements and stay very performant. The performance bottleneck\n * usually lies within the user's rendering code for each element.\n *\n * @remarks It is a low-level widget, not meant to be used directly. Refer to the\n * List widget instead.\n */\nexport class ListView<T> implements ISpliceable<T>, IDisposable {\n\n\tprivate static InstanceCount = 0;\n\treadonly domId = `list_id_${++ListView.InstanceCount}`;\n\n\treadonly domNode: HTMLElement;\n\n\tprivate items: IItem<T>[];\n\tprivate itemId: number;\n\tprivate rangeMap: RangeMap;\n\tprivate cache: RowCache<T>;\n\tprivate renderers = new Map<string, IListRenderer<any /* TODO@joao */, any>>();\n\tprivate lastRenderTop: number;\n\tprivate lastRenderHeight: number;\n\tprivate renderWidth = 0;\n\tprivate rowsContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate _scrollHeight: number = 0;\n\tprivate scrollableElementUpdateDisposable: IDisposable | null = null;\n\tprivate scrollableElementWidthDelayer = new Delayer<void>(50);\n\tprivate splicing = false;\n\tprivate dragOverAnimationDisposable: IDisposable | undefined;\n\tprivate dragOverAnimationStopDisposable: IDisposable = Disposable.None;\n\tprivate dragOverMouseY: number = 0;\n\tprivate setRowLineHeight: boolean;\n\tprivate setRowHeight: boolean;\n\tprivate supportDynamicHeights: boolean;\n\tprivate additionalScrollHeight: number;\n\tprivate accessibilityProvider: ListViewAccessibilityProvider<T>;\n\tprivate scrollWidth: number | undefined;\n\n\tprivate dnd: IListViewDragAndDrop<T>;\n\tprivate canDrop: boolean = false;\n\tprivate currentDragData: IDragAndDropData | undefined;\n\tprivate currentDragFeedback: number[] | undefined;\n\tprivate currentDragFeedbackDisposable: IDisposable = Disposable.None;\n\tprivate onDragLeaveTimeout: IDisposable = Disposable.None;\n\n\tprivate readonly disposables: DisposableStore = new DisposableStore();\n\n\tprivate readonly _onDidChangeContentHeight = new Emitter<number>();\n\tget contentHeight(): number { return this.rangeMap.size; }\n\n\tprivate _horizontalScrolling: boolean = false;\n\tprivate get horizontalScrolling(): boolean { return this._horizontalScrolling; }\n\tprivate set horizontalScrolling(value: boolean) {\n\t\tif (value === this._horizontalScrolling) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value && this.supportDynamicHeights) {\n\t\t\tthrow new Error('Horizontal scrolling and dynamic heights not supported simultaneously');\n\t\t}\n\n\t\tthis._horizontalScrolling = value;\n\t\tthis.domNode.classList.toggle('horizontal-scrolling', this._horizontalScrolling);\n\n\t\tif (this._horizontalScrolling) {\n\t\t\tfor (const item of this.items) {\n\t\t\t\tthis.measureItemWidth(item);\n\t\t\t}\n\n\t\t\tthis.updateScrollWidth();\n\t\t\tthis.scrollableElement.setScrollDimensions({ width: getContentWidth(this.domNode) });\n\t\t\tthis.rowsContainer.style.width = `${Math.max(this.scrollWidth || 0, this.renderWidth)}px`;\n\t\t} else {\n\t\t\tthis.scrollableElementWidthDelayer.cancel();\n\t\t\tthis.scrollableElement.setScrollDimensions({ width: this.renderWidth, scrollWidth: this.renderWidth });\n\t\t\tthis.rowsContainer.style.width = '';\n\t\t}\n\t}\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate virtualDelegate: IListVirtualDelegate<T>,\n\t\trenderers: IListRenderer<any /* TODO@joao */, any>[],\n\t\toptions: IListViewOptions<T> = DefaultOptions as IListViewOptions<T>\n\t) {\n\t\tif (options.horizontalScrolling && options.supportDynamicHeights) {\n\t\t\tthrow new Error('Horizontal scrolling and dynamic heights not supported simultaneously');\n\t\t}\n\n\t\tthis.items = [];\n\t\tthis.itemId = 0;\n\t\tthis.rangeMap = new RangeMap();\n\n\t\tfor (const renderer of renderers) {\n\t\t\tthis.renderers.set(renderer.templateId, renderer);\n\t\t}\n\n\t\tthis.cache = this.disposables.add(new RowCache(this.renderers));\n\n\t\tthis.lastRenderTop = 0;\n\t\tthis.lastRenderHeight = 0;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-list';\n\n\t\tthis.domNode.classList.add(this.domId);\n\t\tthis.domNode.tabIndex = 0;\n\n\t\tthis.domNode.classList.toggle('mouse-support', typeof options.mouseSupport === 'boolean' ? options.mouseSupport : true);\n\n\t\tthis._horizontalScrolling = getOrDefault(options, o => o.horizontalScrolling, DefaultOptions.horizontalScrolling);\n\t\tthis.domNode.classList.toggle('horizontal-scrolling', this._horizontalScrolling);\n\n\t\tthis.additionalScrollHeight = typeof options.additionalScrollHeight === 'undefined' ? 0 : options.additionalScrollHeight;\n\n\t\tthis.accessibilityProvider = new ListViewAccessibilityProvider(options.accessibilityProvider);\n\n\t\tthis.rowsContainer = document.createElement('div');\n\t\tthis.rowsContainer.className = 'monaco-list-rows';\n\n\t\tconst transformOptimization = getOrDefault(options, o => o.transformOptimization, DefaultOptions.transformOptimization);\n\t\tif (transformOptimization) {\n\t\t\tthis.rowsContainer.style.transform = 'translate3d(0px, 0px, 0px)';\n\t\t}\n\n\t\tthis.disposables.add(Gesture.addTarget(this.rowsContainer));\n\n\t\tthis.scrollable = new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: getOrDefault(options, o => o.smoothScrolling, false) ? 125 : 0,\n\t\t\tscheduleAtNextAnimationFrame: cb => scheduleAtNextAnimationFrame(cb)\n\t\t});\n\t\tthis.scrollableElement = this.disposables.add(new SmoothScrollableElement(this.rowsContainer, {\n\t\t\talwaysConsumeMouseWheel: getOrDefault(options, o => o.alwaysConsumeMouseWheel, DefaultOptions.alwaysConsumeMouseWheel),\n\t\t\thorizontal: ScrollbarVisibility.Auto,\n\t\t\tvertical: getOrDefault(options, o => o.verticalScrollMode, DefaultOptions.verticalScrollMode),\n\t\t\tuseShadows: getOrDefault(options, o => o.useShadows, DefaultOptions.useShadows),\n\t\t\tmouseWheelScrollSensitivity: options.mouseWheelScrollSensitivity,\n\t\t\tfastScrollSensitivity: options.fastScrollSensitivity\n\t\t}, this.scrollable));\n\n\t\tthis.domNode.appendChild(this.scrollableElement.getDomNode());\n\t\tcontainer.appendChild(this.domNode);\n\n\t\tthis.scrollableElement.onScroll(this.onScroll, this, this.disposables);\n\t\tthis.disposables.add(addDisposableListener(this.rowsContainer, TouchEventType.Change, e => this.onTouchChange(e as GestureEvent)));\n\n\t\t// Prevent the monaco-scrollable-element from scrolling\n\t\t// https://github.com/microsoft/vscode/issues/44181\n\t\tthis.disposables.add(addDisposableListener(this.scrollableElement.getDomNode(), 'scroll', e => (e.target as HTMLElement).scrollTop = 0));\n\n\t\tthis.disposables.add(addDisposableListener(this.domNode, 'dragover', e => this.onDragOver(this.toDragEvent(e))));\n\t\tthis.disposables.add(addDisposableListener(this.domNode, 'drop', e => this.onDrop(this.toDragEvent(e))));\n\t\tthis.disposables.add(addDisposableListener(this.domNode, 'dragleave', e => this.onDragLeave(this.toDragEvent(e))));\n\t\tthis.disposables.add(addDisposableListener(this.domNode, 'dragend', e => this.onDragEnd(e)));\n\n\t\tthis.setRowLineHeight = getOrDefault(options, o => o.setRowLineHeight, DefaultOptions.setRowLineHeight);\n\t\tthis.setRowHeight = getOrDefault(options, o => o.setRowHeight, DefaultOptions.setRowHeight);\n\t\tthis.supportDynamicHeights = getOrDefault(options, o => o.supportDynamicHeights, DefaultOptions.supportDynamicHeights);\n\t\tthis.dnd = getOrDefault<IListViewOptions<T>, IListViewDragAndDrop<T>>(options, o => o.dnd, DefaultOptions.dnd);\n\n\t\tthis.layout();\n\t}\n\n\tupdateOptions(options: IListViewOptionsUpdate) {\n\t\tif (options.additionalScrollHeight !== undefined) {\n\t\t\tthis.additionalScrollHeight = options.additionalScrollHeight;\n\t\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight });\n\t\t}\n\n\t\tif (options.smoothScrolling !== undefined) {\n\t\t\tthis.scrollable.setSmoothScrollDuration(options.smoothScrolling ? 125 : 0);\n\t\t}\n\n\t\tif (options.horizontalScrolling !== undefined) {\n\t\t\tthis.horizontalScrolling = options.horizontalScrolling;\n\t\t}\n\n\t\tif (options.mouseWheelScrollSensitivity !== undefined) {\n\t\t\tthis.scrollableElement.updateOptions({ mouseWheelScrollSensitivity: options.mouseWheelScrollSensitivity });\n\t\t}\n\n\t\tif (options.fastScrollSensitivity !== undefined) {\n\t\t\tthis.scrollableElement.updateOptions({ fastScrollSensitivity: options.fastScrollSensitivity });\n\t\t}\n\t}\n\n\tsplice(start: number, deleteCount: number, elements: T[] = []): T[] {\n\t\tif (this.splicing) {\n\t\t\tthrow new Error('Can\\'t run recursive splices.');\n\t\t}\n\n\t\tthis.splicing = true;\n\n\t\ttry {\n\t\t\treturn this._splice(start, deleteCount, elements);\n\t\t} finally {\n\t\t\tthis.splicing = false;\n\t\t\tthis._onDidChangeContentHeight.fire(this.contentHeight);\n\t\t}\n\t}\n\n\tprivate _splice(start: number, deleteCount: number, elements: T[] = []): T[] {\n\t\tconst previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);\n\t\tconst deleteRange = { start, end: start + deleteCount };\n\t\tconst removeRange = Range.intersect(previousRenderRange, deleteRange);\n\n\t\t// try to reuse rows, avoid removing them from DOM\n\t\tconst rowsToDispose = new Map<string, IRow[]>();\n\t\tfor (let i = removeRange.end - 1; i >= removeRange.start; i--) {\n\t\t\tconst item = this.items[i];\n\t\t\titem.dragStartDisposable.dispose();\n\n\t\t\tif (item.row) {\n\t\t\t\tlet rows = rowsToDispose.get(item.templateId);\n\n\t\t\t\tif (!rows) {\n\t\t\t\t\trows = [];\n\t\t\t\t\trowsToDispose.set(item.templateId, rows);\n\t\t\t\t}\n\n\t\t\t\tconst renderer = this.renderers.get(item.templateId);\n\n\t\t\t\tif (renderer && renderer.disposeElement) {\n\t\t\t\t\trenderer.disposeElement(item.element, i, item.row.templateData, item.size);\n\t\t\t\t}\n\n\t\t\t\trows.push(item.row);\n\t\t\t}\n\n\t\t\titem.row = null;\n\t\t}\n\n\t\tconst previousRestRange: IRange = { start: start + deleteCount, end: this.items.length };\n\t\tconst previousRenderedRestRange = Range.intersect(previousRestRange, previousRenderRange);\n\t\tconst previousUnrenderedRestRanges = Range.relativeComplement(previousRestRange, previousRenderRange);\n\n\t\tconst inserted = elements.map<IItem<T>>(element => ({\n\t\t\tid: String(this.itemId++),\n\t\t\telement,\n\t\t\ttemplateId: this.virtualDelegate.getTemplateId(element),\n\t\t\tsize: this.virtualDelegate.getHeight(element),\n\t\t\twidth: undefined,\n\t\t\thasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(element),\n\t\t\tlastDynamicHeightWidth: undefined,\n\t\t\trow: null,\n\t\t\turi: undefined,\n\t\t\tdropTarget: false,\n\t\t\tdragStartDisposable: Disposable.None,\n\t\t\tcheckedDisposable: Disposable.None\n\t\t}));\n\n\t\tlet deleted: IItem<T>[];\n\n\t\t// TODO@joao: improve this optimization to catch even more cases\n\t\tif (start === 0 && deleteCount >= this.items.length) {\n\t\t\tthis.rangeMap = new RangeMap();\n\t\t\tthis.rangeMap.splice(0, 0, inserted);\n\t\t\tdeleted = this.items;\n\t\t\tthis.items = inserted;\n\t\t} else {\n\t\t\tthis.rangeMap.splice(start, deleteCount, inserted);\n\t\t\tdeleted = this.items.splice(start, deleteCount, ...inserted);\n\t\t}\n\n\t\tconst delta = elements.length - deleteCount;\n\t\tconst renderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);\n\t\tconst renderedRestRange = shift(previousRenderedRestRange, delta);\n\t\tconst updateRange = Range.intersect(renderRange, renderedRestRange);\n\n\t\tfor (let i = updateRange.start; i < updateRange.end; i++) {\n\t\t\tthis.updateItemInDOM(this.items[i], i);\n\t\t}\n\n\t\tconst removeRanges = Range.relativeComplement(renderedRestRange, renderRange);\n\n\t\tfor (const range of removeRanges) {\n\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\tthis.removeItemFromDOM(i);\n\t\t\t}\n\t\t}\n\n\t\tconst unrenderedRestRanges = previousUnrenderedRestRanges.map(r => shift(r, delta));\n\t\tconst elementsRange = { start, end: start + elements.length };\n\t\tconst insertRanges = [elementsRange, ...unrenderedRestRanges].map(r => Range.intersect(renderRange, r));\n\t\tconst beforeElement = this.getNextToLastElement(insertRanges);\n\n\t\tfor (const range of insertRanges) {\n\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\tconst item = this.items[i];\n\t\t\t\tconst rows = rowsToDispose.get(item.templateId);\n\t\t\t\tconst row = rows?.pop();\n\t\t\t\tthis.insertItemInDOM(i, beforeElement, row);\n\t\t\t}\n\t\t}\n\n\t\tfor (const rows of rowsToDispose.values()) {\n\t\t\tfor (const row of rows) {\n\t\t\t\tthis.cache.release(row);\n\t\t\t}\n\t\t}\n\n\t\tthis.eventuallyUpdateScrollDimensions();\n\n\t\tif (this.supportDynamicHeights) {\n\t\t\tthis._rerender(this.scrollTop, this.renderHeight);\n\t\t}\n\n\t\treturn deleted.map(i => i.element);\n\t}\n\n\tprivate eventuallyUpdateScrollDimensions(): void {\n\t\tthis._scrollHeight = this.contentHeight;\n\t\tthis.rowsContainer.style.height = `${this._scrollHeight}px`;\n\n\t\tif (!this.scrollableElementUpdateDisposable) {\n\t\t\tthis.scrollableElementUpdateDisposable = scheduleAtNextAnimationFrame(() => {\n\t\t\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight });\n\t\t\t\tthis.updateScrollWidth();\n\t\t\t\tthis.scrollableElementUpdateDisposable = null;\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate eventuallyUpdateScrollWidth(): void {\n\t\tif (!this.horizontalScrolling) {\n\t\t\tthis.scrollableElementWidthDelayer.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth());\n\t}\n\n\tprivate updateScrollWidth(): void {\n\t\tif (!this.horizontalScrolling) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollWidth = 0;\n\n\t\tfor (const item of this.items) {\n\t\t\tif (typeof item.width !== 'undefined') {\n\t\t\t\tscrollWidth = Math.max(scrollWidth, item.width);\n\t\t\t}\n\t\t}\n\n\t\tthis.scrollWidth = scrollWidth;\n\t\tthis.scrollableElement.setScrollDimensions({ scrollWidth: scrollWidth === 0 ? 0 : (scrollWidth + 10) });\n\t}\n\n\trerender(): void {\n\t\tif (!this.supportDynamicHeights) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const item of this.items) {\n\t\t\titem.lastDynamicHeightWidth = undefined;\n\t\t}\n\n\t\tthis._rerender(this.lastRenderTop, this.lastRenderHeight);\n\t}\n\n\tget length(): number {\n\t\treturn this.items.length;\n\t}\n\n\tget renderHeight(): number {\n\t\tconst scrollDimensions = this.scrollableElement.getScrollDimensions();\n\t\treturn scrollDimensions.height;\n\t}\n\n\telement(index: number): T {\n\t\treturn this.items[index].element;\n\t}\n\n\tdomElement(index: number): HTMLElement | null {\n\t\tconst row = this.items[index].row;\n\t\treturn row && row.domNode;\n\t}\n\n\telementHeight(index: number): number {\n\t\treturn this.items[index].size;\n\t}\n\n\telementTop(index: number): number {\n\t\treturn this.rangeMap.positionAt(index);\n\t}\n\n\tindexAt(position: number): number {\n\t\treturn this.rangeMap.indexAt(position);\n\t}\n\n\tindexAfter(position: number): number {\n\t\treturn this.rangeMap.indexAfter(position);\n\t}\n\n\tlayout(height?: number, width?: number): void {\n\t\tlet scrollDimensions: INewScrollDimensions = {\n\t\t\theight: typeof height === 'number' ? height : getContentHeight(this.domNode)\n\t\t};\n\n\t\tif (this.scrollableElementUpdateDisposable) {\n\t\t\tthis.scrollableElementUpdateDisposable.dispose();\n\t\t\tthis.scrollableElementUpdateDisposable = null;\n\t\t\tscrollDimensions.scrollHeight = this.scrollHeight;\n\t\t}\n\n\t\tthis.scrollableElement.setScrollDimensions(scrollDimensions);\n\n\t\tif (typeof width !== 'undefined') {\n\t\t\tthis.renderWidth = width;\n\n\t\t\tif (this.supportDynamicHeights) {\n\t\t\t\tthis._rerender(this.scrollTop, this.renderHeight);\n\t\t\t}\n\t\t}\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: typeof width === 'number' ? width : getContentWidth(this.domNode)\n\t\t\t});\n\t\t}\n\t}\n\n\t// Render\n\n\tprivate render(previousRenderRange: IRange, renderTop: number, renderHeight: number, renderLeft: number | undefined, scrollWidth: number | undefined, updateItemsInDOM: boolean = false): void {\n\t\tconst renderRange = this.getRenderRange(renderTop, renderHeight);\n\n\t\tconst rangesToInsert = Range.relativeComplement(renderRange, previousRenderRange);\n\t\tconst rangesToRemove = Range.relativeComplement(previousRenderRange, renderRange);\n\t\tconst beforeElement = this.getNextToLastElement(rangesToInsert);\n\n\t\tif (updateItemsInDOM) {\n\t\t\tconst rangesToUpdate = Range.intersect(previousRenderRange, renderRange);\n\n\t\t\tfor (let i = rangesToUpdate.start; i < rangesToUpdate.end; i++) {\n\t\t\t\tthis.updateItemInDOM(this.items[i], i);\n\t\t\t}\n\t\t}\n\n\t\tfor (const range of rangesToInsert) {\n\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\tthis.insertItemInDOM(i, beforeElement);\n\t\t\t}\n\t\t}\n\n\t\tfor (const range of rangesToRemove) {\n\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\tthis.removeItemFromDOM(i);\n\t\t\t}\n\t\t}\n\n\t\tif (renderLeft !== undefined) {\n\t\t\tthis.rowsContainer.style.left = `-${renderLeft}px`;\n\t\t}\n\n\t\tthis.rowsContainer.style.top = `-${renderTop}px`;\n\n\t\tif (this.horizontalScrolling && scrollWidth !== undefined) {\n\t\t\tthis.rowsContainer.style.width = `${Math.max(scrollWidth, this.renderWidth)}px`;\n\t\t}\n\n\t\tthis.lastRenderTop = renderTop;\n\t\tthis.lastRenderHeight = renderHeight;\n\t}\n\n\t// DOM operations\n\n\tprivate insertItemInDOM(index: number, beforeElement: HTMLElement | null, row?: IRow): void {\n\t\tconst item = this.items[index];\n\n\t\tif (!item.row) {\n\t\t\titem.row = row ?? this.cache.alloc(item.templateId);\n\t\t}\n\n\t\tconst role = this.accessibilityProvider.getRole(item.element) || 'listitem';\n\t\titem.row.domNode.setAttribute('role', role);\n\n\t\tconst checked = this.accessibilityProvider.isChecked(item.element);\n\n\t\tif (typeof checked === 'boolean') {\n\t\t\titem.row!.domNode.setAttribute('aria-checked', String(!!checked));\n\t\t} else if (checked) {\n\t\t\tconst update = (checked: boolean) => item.row!.domNode.setAttribute('aria-checked', String(!!checked));\n\t\t\tupdate(checked.value);\n\t\t\titem.checkedDisposable = checked.onDidChange(update);\n\t\t}\n\n\t\tif (!item.row.domNode.parentElement) {\n\t\t\tif (beforeElement) {\n\t\t\t\tthis.rowsContainer.insertBefore(item.row.domNode, beforeElement);\n\t\t\t} else {\n\t\t\t\tthis.rowsContainer.appendChild(item.row.domNode);\n\t\t\t}\n\t\t}\n\n\t\tthis.updateItemInDOM(item, index);\n\n\t\tconst renderer = this.renderers.get(item.templateId);\n\n\t\tif (!renderer) {\n\t\t\tthrow new Error(`No renderer found for template id ${item.templateId}`);\n\t\t}\n\n\t\tif (renderer) {\n\t\t\trenderer.renderElement(item.element, index, item.row.templateData, item.size);\n\t\t}\n\n\t\tconst uri = this.dnd.getDragURI(item.element);\n\t\titem.dragStartDisposable.dispose();\n\t\titem.row.domNode.draggable = !!uri;\n\n\t\tif (uri) {\n\t\t\titem.dragStartDisposable = addDisposableListener(item.row.domNode, 'dragstart', event => this.onDragStart(item.element, uri, event));\n\t\t}\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.measureItemWidth(item);\n\t\t\tthis.eventuallyUpdateScrollWidth();\n\t\t}\n\t}\n\n\tprivate measureItemWidth(item: IItem<T>): void {\n\t\tif (!item.row || !item.row.domNode) {\n\t\t\treturn;\n\t\t}\n\n\t\titem.row.domNode.style.width = isFirefox ? '-moz-fit-content' : 'fit-content';\n\t\titem.width = getContentWidth(item.row.domNode);\n\t\tconst style = window.getComputedStyle(item.row.domNode);\n\n\t\tif (style.paddingLeft) {\n\t\t\titem.width += parseFloat(style.paddingLeft);\n\t\t}\n\n\t\tif (style.paddingRight) {\n\t\t\titem.width += parseFloat(style.paddingRight);\n\t\t}\n\n\t\titem.row.domNode.style.width = '';\n\t}\n\n\tprivate updateItemInDOM(item: IItem<T>, index: number): void {\n\t\titem.row!.domNode.style.top = `${this.elementTop(index)}px`;\n\n\t\tif (this.setRowHeight) {\n\t\t\titem.row!.domNode.style.height = `${item.size}px`;\n\t\t}\n\n\t\tif (this.setRowLineHeight) {\n\t\t\titem.row!.domNode.style.lineHeight = `${item.size}px`;\n\t\t}\n\n\t\titem.row!.domNode.setAttribute('data-index', `${index}`);\n\t\titem.row!.domNode.setAttribute('data-last-element', index === this.length - 1 ? 'true' : 'false');\n\t\titem.row!.domNode.setAttribute('data-parity', index % 2 === 0 ? 'even' : 'odd');\n\t\titem.row!.domNode.setAttribute('aria-setsize', String(this.accessibilityProvider.getSetSize(item.element, index, this.length)));\n\t\titem.row!.domNode.setAttribute('aria-posinset', String(this.accessibilityProvider.getPosInSet(item.element, index)));\n\t\titem.row!.domNode.setAttribute('id', this.getElementDomId(index));\n\n\t\titem.row!.domNode.classList.toggle('drop-target', item.dropTarget);\n\t}\n\n\tprivate removeItemFromDOM(index: number): void {\n\t\tconst item = this.items[index];\n\t\titem.dragStartDisposable.dispose();\n\t\titem.checkedDisposable.dispose();\n\n\t\tif (item.row) {\n\t\t\tconst renderer = this.renderers.get(item.templateId);\n\n\t\t\tif (renderer && renderer.disposeElement) {\n\t\t\t\trenderer.disposeElement(item.element, index, item.row.templateData, item.size);\n\t\t\t}\n\n\t\t\tthis.cache.release(item.row);\n\t\t\titem.row = null;\n\t\t}\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.eventuallyUpdateScrollWidth();\n\t\t}\n\t}\n\n\tgetScrollTop(): number {\n\t\tconst scrollPosition = this.scrollableElement.getScrollPosition();\n\t\treturn scrollPosition.scrollTop;\n\t}\n\n\tsetScrollTop(scrollTop: number, reuseAnimation?: boolean): void {\n\t\tif (this.scrollableElementUpdateDisposable) {\n\t\t\tthis.scrollableElementUpdateDisposable.dispose();\n\t\t\tthis.scrollableElementUpdateDisposable = null;\n\t\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight });\n\t\t}\n\n\t\tthis.scrollableElement.setScrollPosition({ scrollTop, reuseAnimation });\n\t}\n\n\n\tget scrollTop(): number {\n\t\treturn this.getScrollTop();\n\t}\n\n\tset scrollTop(scrollTop: number) {\n\t\tthis.setScrollTop(scrollTop);\n\t}\n\n\tget scrollHeight(): number {\n\t\treturn this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.additionalScrollHeight;\n\t}\n\n\t// Events\n\n\t@memoize get onMouseClick(): Event<IListMouseEvent<T>> { return Event.map(this.disposables.add(new DomEmitter(this.domNode, 'click')).event, e => this.toMouseEvent(e)); }\n\t@memoize get onMouseDblClick(): Event<IListMouseEvent<T>> { return Event.map(this.disposables.add(new DomEmitter(this.domNode, 'dblclick')).event, e => this.toMouseEvent(e)); }\n\t@memoize get onMouseMiddleClick(): Event<IListMouseEvent<T>> { return Event.filter(Event.map(this.disposables.add(new DomEmitter(this.domNode, 'auxclick')).event, e => this.toMouseEvent(e as MouseEvent)), e => e.browserEvent.button === 1); }\n\t@memoize get onMouseDown(): Event<IListMouseEvent<T>> { return Event.map(this.disposables.add(new DomEmitter(this.domNode, 'mousedown')).event, e => this.toMouseEvent(e)); }\n\t@memoize get onContextMenu(): Event<IListMouseEvent<T> | IListGestureEvent<T>> { return Event.any(Event.map(this.disposables.add(new DomEmitter(this.domNode, 'contextmenu')).event, e => this.toMouseEvent(e)), Event.map(this.disposables.add(new DomEmitter(this.domNode, TouchEventType.Contextmenu)).event as Event<GestureEvent>, e => this.toGestureEvent(e))); }\n\t@memoize get onTouchStart(): Event<IListTouchEvent<T>> { return Event.map(this.disposables.add(new DomEmitter(this.domNode, 'touchstart')).event, e => this.toTouchEvent(e)); }\n\t@memoize get onTap(): Event<IListGestureEvent<T>> { return Event.map(this.disposables.add(new DomEmitter(this.rowsContainer, TouchEventType.Tap)).event, e => this.toGestureEvent(e as GestureEvent)); }\n\n\tprivate toMouseEvent(browserEvent: MouseEvent): IListMouseEvent<T> {\n\t\tconst index = this.getItemIndexFromEventTarget(browserEvent.target || null);\n\t\tconst item = typeof index === 'undefined' ? undefined : this.items[index];\n\t\tconst element = item && item.element;\n\t\treturn { browserEvent, index, element };\n\t}\n\n\tprivate toTouchEvent(browserEvent: TouchEvent): IListTouchEvent<T> {\n\t\tconst index = this.getItemIndexFromEventTarget(browserEvent.target || null);\n\t\tconst item = typeof index === 'undefined' ? undefined : this.items[index];\n\t\tconst element = item && item.element;\n\t\treturn { browserEvent, index, element };\n\t}\n\n\tprivate toGestureEvent(browserEvent: GestureEvent): IListGestureEvent<T> {\n\t\tconst index = this.getItemIndexFromEventTarget(browserEvent.initialTarget || null);\n\t\tconst item = typeof index === 'undefined' ? undefined : this.items[index];\n\t\tconst element = item && item.element;\n\t\treturn { browserEvent, index, element };\n\t}\n\n\tprivate toDragEvent(browserEvent: DragEvent): IListDragEvent<T> {\n\t\tconst index = this.getItemIndexFromEventTarget(browserEvent.target || null);\n\t\tconst item = typeof index === 'undefined' ? undefined : this.items[index];\n\t\tconst element = item && item.element;\n\t\treturn { browserEvent, index, element };\n\t}\n\n\tprivate onScroll(e: ScrollEvent): void {\n\t\ttry {\n\t\t\tconst previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);\n\t\t\tthis.render(previousRenderRange, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth);\n\n\t\t\tif (this.supportDynamicHeights) {\n\t\t\t\tthis._rerender(e.scrollTop, e.height, e.inSmoothScrolling);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error('Got bad scroll event:', e);\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate onTouchChange(event: GestureEvent): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tthis.scrollTop -= event.translationY;\n\t}\n\n\t// DND\n\n\tprivate onDragStart(element: T, uri: string, event: DragEvent): void {\n\t\tif (!event.dataTransfer) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elements = this.dnd.getDragElements(element);\n\n\t\tevent.dataTransfer.effectAllowed = 'copyMove';\n\t\tevent.dataTransfer.setData(DataTransfers.TEXT, uri);\n\n\t\tif (event.dataTransfer.setDragImage) {\n\t\t\tlet label: string | undefined;\n\n\t\t\tif (this.dnd.getDragLabel) {\n\t\t\t\tlabel = this.dnd.getDragLabel(elements, event);\n\t\t\t}\n\n\t\t\tif (typeof label === 'undefined') {\n\t\t\t\tlabel = String(elements.length);\n\t\t\t}\n\n\t\t\tconst dragImage = $('.monaco-drag-image');\n\t\t\tdragImage.textContent = label;\n\t\t\tdocument.body.appendChild(dragImage);\n\t\t\tevent.dataTransfer.setDragImage(dragImage, -10, -10);\n\t\t\tsetTimeout(() => document.body.removeChild(dragImage), 0);\n\t\t}\n\n\t\tthis.currentDragData = new ElementsDragAndDropData(elements);\n\t\tStaticDND.CurrentDragAndDropData = new ExternalElementsDragAndDropData(elements);\n\n\t\tif (this.dnd.onDragStart) {\n\t\t\tthis.dnd.onDragStart(this.currentDragData, event);\n\t\t}\n\t}\n\n\tprivate onDragOver(event: IListDragEvent<T>): boolean {\n\t\tevent.browserEvent.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)\n\n\t\tthis.onDragLeaveTimeout.dispose();\n\n\t\tif (StaticDND.CurrentDragAndDropData && StaticDND.CurrentDragAndDropData.getData() === 'vscode-ui') {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.setupDragAndDropScrollTopAnimation(event.browserEvent);\n\n\t\tif (!event.browserEvent.dataTransfer) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Drag over from outside\n\t\tif (!this.currentDragData) {\n\t\t\tif (StaticDND.CurrentDragAndDropData) {\n\t\t\t\t// Drag over from another list\n\t\t\t\tthis.currentDragData = StaticDND.CurrentDragAndDropData;\n\n\t\t\t} else {\n\t\t\t\t// Drag over from the desktop\n\t\t\t\tif (!event.browserEvent.dataTransfer.types) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.currentDragData = new NativeDragAndDropData();\n\t\t\t}\n\t\t}\n\n\t\tconst result = this.dnd.onDragOver(this.currentDragData, event.element, event.index, event.browserEvent);\n\t\tthis.canDrop = typeof result === 'boolean' ? result : result.accept;\n\n\t\tif (!this.canDrop) {\n\t\t\tthis.currentDragFeedback = undefined;\n\t\t\tthis.currentDragFeedbackDisposable.dispose();\n\t\t\treturn false;\n\t\t}\n\n\t\tevent.browserEvent.dataTransfer.dropEffect = (typeof result !== 'boolean' && result.effect === ListDragOverEffect.Copy) ? 'copy' : 'move';\n\n\t\tlet feedback: number[];\n\n\t\tif (typeof result !== 'boolean' && result.feedback) {\n\t\t\tfeedback = result.feedback;\n\t\t} else {\n\t\t\tif (typeof event.index === 'undefined') {\n\t\t\t\tfeedback = [-1];\n\t\t\t} else {\n\t\t\t\tfeedback = [event.index];\n\t\t\t}\n\t\t}\n\n\t\t// sanitize feedback list\n\t\tfeedback = distinct(feedback).filter(i => i >= -1 && i < this.length).sort((a, b) => a - b);\n\t\tfeedback = feedback[0] === -1 ? [-1] : feedback;\n\n\t\tif (equalsDragFeedback(this.currentDragFeedback, feedback)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.currentDragFeedback = feedback;\n\t\tthis.currentDragFeedbackDisposable.dispose();\n\n\t\tif (feedback[0] === -1) { // entire list feedback\n\t\t\tthis.domNode.classList.add('drop-target');\n\t\t\tthis.rowsContainer.classList.add('drop-target');\n\t\t\tthis.currentDragFeedbackDisposable = toDisposable(() => {\n\t\t\t\tthis.domNode.classList.remove('drop-target');\n\t\t\t\tthis.rowsContainer.classList.remove('drop-target');\n\t\t\t});\n\t\t} else {\n\t\t\tfor (const index of feedback) {\n\t\t\t\tconst item = this.items[index]!;\n\t\t\t\titem.dropTarget = true;\n\n\t\t\t\tif (item.row) {\n\t\t\t\t\titem.row.domNode.classList.add('drop-target');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.currentDragFeedbackDisposable = toDisposable(() => {\n\t\t\t\tfor (const index of feedback) {\n\t\t\t\t\tconst item = this.items[index]!;\n\t\t\t\t\titem.dropTarget = false;\n\n\t\t\t\t\tif (item.row) {\n\t\t\t\t\t\titem.row.domNode.classList.remove('drop-target');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate onDragLeave(event: IListDragEvent<T>): void {\n\t\tthis.onDragLeaveTimeout.dispose();\n\t\tthis.onDragLeaveTimeout = disposableTimeout(() => this.clearDragOverFeedback(), 100);\n\t\tif (this.currentDragData) {\n\t\t\tthis.dnd.onDragLeave?.(this.currentDragData, event.element, event.index, event.browserEvent);\n\t\t}\n\t}\n\n\tprivate onDrop(event: IListDragEvent<T>): void {\n\t\tif (!this.canDrop) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst dragData = this.currentDragData;\n\t\tthis.teardownDragAndDropScrollTopAnimation();\n\t\tthis.clearDragOverFeedback();\n\t\tthis.currentDragData = undefined;\n\t\tStaticDND.CurrentDragAndDropData = undefined;\n\n\t\tif (!dragData || !event.browserEvent.dataTransfer) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.browserEvent.preventDefault();\n\t\tdragData.update(event.browserEvent.dataTransfer);\n\t\tthis.dnd.drop(dragData, event.element, event.index, event.browserEvent);\n\t}\n\n\tprivate onDragEnd(event: DragEvent): void {\n\t\tthis.canDrop = false;\n\t\tthis.teardownDragAndDropScrollTopAnimation();\n\t\tthis.clearDragOverFeedback();\n\t\tthis.currentDragData = undefined;\n\t\tStaticDND.CurrentDragAndDropData = undefined;\n\n\t\tif (this.dnd.onDragEnd) {\n\t\t\tthis.dnd.onDragEnd(event);\n\t\t}\n\t}\n\n\tprivate clearDragOverFeedback(): void {\n\t\tthis.currentDragFeedback = undefined;\n\t\tthis.currentDragFeedbackDisposable.dispose();\n\t\tthis.currentDragFeedbackDisposable = Disposable.None;\n\t}\n\n\t// DND scroll top animation\n\n\tprivate setupDragAndDropScrollTopAnimation(event: DragEvent): void {\n\t\tif (!this.dragOverAnimationDisposable) {\n\t\t\tconst viewTop = getTopLeftOffset(this.domNode).top;\n\t\t\tthis.dragOverAnimationDisposable = animate(this.animateDragAndDropScrollTop.bind(this, viewTop));\n\t\t}\n\n\t\tthis.dragOverAnimationStopDisposable.dispose();\n\t\tthis.dragOverAnimationStopDisposable = disposableTimeout(() => {\n\t\t\tif (this.dragOverAnimationDisposable) {\n\t\t\t\tthis.dragOverAnimationDisposable.dispose();\n\t\t\t\tthis.dragOverAnimationDisposable = undefined;\n\t\t\t}\n\t\t}, 1000);\n\n\t\tthis.dragOverMouseY = event.pageY;\n\t}\n\n\tprivate animateDragAndDropScrollTop(viewTop: number): void {\n\t\tif (this.dragOverMouseY === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst diff = this.dragOverMouseY - viewTop;\n\t\tconst upperLimit = this.renderHeight - 35;\n\n\t\tif (diff < 35) {\n\t\t\tthis.scrollTop += Math.max(-14, Math.floor(0.3 * (diff - 35)));\n\t\t} else if (diff > upperLimit) {\n\t\t\tthis.scrollTop += Math.min(14, Math.floor(0.3 * (diff - upperLimit)));\n\t\t}\n\t}\n\n\tprivate teardownDragAndDropScrollTopAnimation(): void {\n\t\tthis.dragOverAnimationStopDisposable.dispose();\n\n\t\tif (this.dragOverAnimationDisposable) {\n\t\t\tthis.dragOverAnimationDisposable.dispose();\n\t\t\tthis.dragOverAnimationDisposable = undefined;\n\t\t}\n\t}\n\n\t// Util\n\n\tprivate getItemIndexFromEventTarget(target: EventTarget | null): number | undefined {\n\t\tconst scrollableElement = this.scrollableElement.getDomNode();\n\t\tlet element: HTMLElement | null = target as (HTMLElement | null);\n\n\t\twhile (element instanceof HTMLElement && element !== this.rowsContainer && scrollableElement.contains(element)) {\n\t\t\tconst rawIndex = element.getAttribute('data-index');\n\n\t\t\tif (rawIndex) {\n\t\t\t\tconst index = Number(rawIndex);\n\n\t\t\t\tif (!isNaN(index)) {\n\t\t\t\t\treturn index;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telement = element.parentElement;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate getRenderRange(renderTop: number, renderHeight: number): IRange {\n\t\treturn {\n\t\t\tstart: this.rangeMap.indexAt(renderTop),\n\t\t\tend: this.rangeMap.indexAfter(renderTop + renderHeight - 1)\n\t\t};\n\t}\n\n\t/**\n\t * Given a stable rendered state, checks every rendered element whether it needs\n\t * to be probed for dynamic height. Adjusts scroll height and top if necessary.\n\t */\n\tprivate _rerender(renderTop: number, renderHeight: number, inSmoothScrolling?: boolean): void {\n\t\tconst previousRenderRange = this.getRenderRange(renderTop, renderHeight);\n\n\t\t// Let's remember the second element's position, this helps in scrolling up\n\t\t// and preserving a linear upwards scroll movement\n\t\tlet anchorElementIndex: number | undefined;\n\t\tlet anchorElementTopDelta: number | undefined;\n\n\t\tif (renderTop === this.elementTop(previousRenderRange.start)) {\n\t\t\tanchorElementIndex = previousRenderRange.start;\n\t\t\tanchorElementTopDelta = 0;\n\t\t} else if (previousRenderRange.end - previousRenderRange.start > 1) {\n\t\t\tanchorElementIndex = previousRenderRange.start + 1;\n\t\t\tanchorElementTopDelta = this.elementTop(anchorElementIndex) - renderTop;\n\t\t}\n\n\t\tlet heightDiff = 0;\n\n\t\twhile (true) {\n\t\t\tconst renderRange = this.getRenderRange(renderTop, renderHeight);\n\n\t\t\tlet didChange = false;\n\n\t\t\tfor (let i = renderRange.start; i < renderRange.end; i++) {\n\t\t\t\tconst diff = this.probeDynamicHeight(i);\n\n\t\t\t\tif (diff !== 0) {\n\t\t\t\t\tthis.rangeMap.splice(i, 1, [this.items[i]]);\n\t\t\t\t}\n\n\t\t\t\theightDiff += diff;\n\t\t\t\tdidChange = didChange || diff !== 0;\n\t\t\t}\n\n\t\t\tif (!didChange) {\n\t\t\t\tif (heightDiff !== 0) {\n\t\t\t\t\tthis.eventuallyUpdateScrollDimensions();\n\t\t\t\t}\n\n\t\t\t\tconst unrenderRanges = Range.relativeComplement(previousRenderRange, renderRange);\n\n\t\t\t\tfor (const range of unrenderRanges) {\n\t\t\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\t\t\tif (this.items[i].row) {\n\t\t\t\t\t\t\tthis.removeItemFromDOM(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst renderRanges = Range.relativeComplement(renderRange, previousRenderRange);\n\n\t\t\t\tfor (const range of renderRanges) {\n\t\t\t\t\tfor (let i = range.start; i < range.end; i++) {\n\t\t\t\t\t\tconst afterIndex = i + 1;\n\t\t\t\t\t\tconst beforeRow = afterIndex < this.items.length ? this.items[afterIndex].row : null;\n\t\t\t\t\t\tconst beforeElement = beforeRow ? beforeRow.domNode : null;\n\t\t\t\t\t\tthis.insertItemInDOM(i, beforeElement);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let i = renderRange.start; i < renderRange.end; i++) {\n\t\t\t\t\tif (this.items[i].row) {\n\t\t\t\t\t\tthis.updateItemInDOM(this.items[i], i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (typeof anchorElementIndex === 'number') {\n\t\t\t\t\t// To compute a destination scroll top, we need to take into account the current smooth scrolling\n\t\t\t\t\t// animation, and then reuse it with a new target (to avoid prolonging the scroll)\n\t\t\t\t\t// See https://github.com/microsoft/vscode/issues/104144\n\t\t\t\t\t// See https://github.com/microsoft/vscode/pull/104284\n\t\t\t\t\t// See https://github.com/microsoft/vscode/issues/107704\n\t\t\t\t\tconst deltaScrollTop = this.scrollable.getFutureScrollPosition().scrollTop - renderTop;\n\t\t\t\t\tconst newScrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta! + deltaScrollTop;\n\t\t\t\t\tthis.setScrollTop(newScrollTop, inSmoothScrolling);\n\t\t\t\t}\n\n\t\t\t\tthis._onDidChangeContentHeight.fire(this.contentHeight);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate probeDynamicHeight(index: number): number {\n\t\tconst item = this.items[index];\n\n\t\tif (!!this.virtualDelegate.getDynamicHeight) {\n\t\t\tconst newSize = this.virtualDelegate.getDynamicHeight(item.element);\n\t\t\tif (newSize !== null) {\n\t\t\t\tconst size = item.size;\n\t\t\t\titem.size = newSize;\n\t\t\t\titem.lastDynamicHeightWidth = this.renderWidth;\n\t\t\t\treturn newSize - size;\n\t\t\t}\n\t\t}\n\n\t\tif (!item.hasDynamicHeight || item.lastDynamicHeightWidth === this.renderWidth) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!!this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(item.element)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst size = item.size;\n\n\t\tif (!this.setRowHeight && item.row) {\n\t\t\tlet newSize = item.row.domNode.offsetHeight;\n\t\t\titem.size = newSize;\n\t\t\titem.lastDynamicHeightWidth = this.renderWidth;\n\t\t\treturn newSize - size;\n\t\t}\n\n\t\tconst row = this.cache.alloc(item.templateId);\n\n\t\trow.domNode.style.height = '';\n\t\tthis.rowsContainer.appendChild(row.domNode);\n\n\t\tconst renderer = this.renderers.get(item.templateId);\n\t\tif (renderer) {\n\t\t\trenderer.renderElement(item.element, index, row.templateData, undefined);\n\n\t\t\tif (renderer.disposeElement) {\n\t\t\t\trenderer.disposeElement(item.element, index, row.templateData, undefined);\n\t\t\t}\n\t\t}\n\n\t\titem.size = row.domNode.offsetHeight;\n\n\t\tif (this.virtualDelegate.setDynamicHeight) {\n\t\t\tthis.virtualDelegate.setDynamicHeight(item.element, item.size);\n\t\t}\n\n\t\titem.lastDynamicHeightWidth = this.renderWidth;\n\t\tthis.rowsContainer.removeChild(row.domNode);\n\t\tthis.cache.release(row);\n\n\t\treturn item.size - size;\n\t}\n\n\tprivate getNextToLastElement(ranges: IRange[]): HTMLElement | null {\n\t\tconst lastRange = ranges[ranges.length - 1];\n\n\t\tif (!lastRange) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst nextToLastItem = this.items[lastRange.end];\n\n\t\tif (!nextToLastItem) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!nextToLastItem.row) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn nextToLastItem.row.domNode;\n\t}\n\n\tgetElementDomId(index: number): string {\n\t\treturn `${this.domId}_${index}`;\n\t}\n\n\t// Dispose\n\n\tdispose() {\n\t\tif (this.items) {\n\t\t\tfor (const item of this.items) {\n\t\t\t\tif (item.row) {\n\t\t\t\t\tconst renderer = this.renderers.get(item.row.templateId);\n\t\t\t\t\tif (renderer) {\n\t\t\t\t\t\tif (renderer.disposeElement) {\n\t\t\t\t\t\t\trenderer.disposeElement(item.element, -1, item.row.templateData, undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trenderer.disposeTemplate(item.row.templateData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.items = [];\n\t\t}\n\n\t\tif (this.domNode && this.domNode.parentNode) {\n\t\t\tthis.domNode.parentNode.removeChild(this.domNode);\n\t\t}\n\n\t\tdispose(this.disposables);\n\t}\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 { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { createStyleSheet } from 'vs/base/browser/dom';\nimport { DomEmitter, stopEvent } from 'vs/base/browser/event';\nimport { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Gesture } from 'vs/base/browser/touch';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { CombinedSpliceable } from 'vs/base/browser/ui/list/splice';\nimport { binarySearch, firstOrDefault, range } from 'vs/base/common/arrays';\nimport { timeout } from 'vs/base/common/async';\nimport { Color } from 'vs/base/common/color';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Emitter, Event, EventBufferer } from 'vs/base/common/event';\nimport { matchesPrefix } from 'vs/base/common/filters';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { clamp } from 'vs/base/common/numbers';\nimport { mixin } from 'vs/base/common/objects';\nimport * as platform from 'vs/base/common/platform';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { IThemable } from 'vs/base/common/styler';\nimport { isNumber } from 'vs/base/common/types';\nimport 'vs/css!./list';\nimport { IIdentityProvider, IKeyboardNavigationDelegate, IKeyboardNavigationLabelProvider, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IListEvent, IListGestureEvent, IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate, ListError } from './list';\nimport { IListViewAccessibilityProvider, IListViewDragAndDrop, IListViewOptions, IListViewOptionsUpdate, ListView } from './listView';\n\ninterface ITraitChangeEvent {\n\tindexes: number[];\n\tbrowserEvent?: UIEvent;\n}\n\ntype ITraitTemplateData = HTMLElement;\n\ninterface IRenderedContainer {\n\ttemplateData: ITraitTemplateData;\n\tindex: number;\n}\n\nclass TraitRenderer<T> implements IListRenderer<T, ITraitTemplateData>\n{\n\tprivate renderedElements: IRenderedContainer[] = [];\n\n\tconstructor(private trait: Trait<T>) { }\n\n\tget templateId(): string {\n\t\treturn `template:${this.trait.name}`;\n\t}\n\n\trenderTemplate(container: HTMLElement): ITraitTemplateData {\n\t\treturn container;\n\t}\n\n\trenderElement(element: T, index: number, templateData: ITraitTemplateData): void {\n\t\tconst renderedElementIndex = this.renderedElements.findIndex(el => el.templateData === templateData);\n\n\t\tif (renderedElementIndex >= 0) {\n\t\t\tconst rendered = this.renderedElements[renderedElementIndex];\n\t\t\tthis.trait.unrender(templateData);\n\t\t\trendered.index = index;\n\t\t} else {\n\t\t\tconst rendered = { index, templateData };\n\t\t\tthis.renderedElements.push(rendered);\n\t\t}\n\n\t\tthis.trait.renderIndex(index, templateData);\n\t}\n\n\tsplice(start: number, deleteCount: number, insertCount: number): void {\n\t\tconst rendered: IRenderedContainer[] = [];\n\n\t\tfor (const renderedElement of this.renderedElements) {\n\n\t\t\tif (renderedElement.index < start) {\n\t\t\t\trendered.push(renderedElement);\n\t\t\t} else if (renderedElement.index >= start + deleteCount) {\n\t\t\t\trendered.push({\n\t\t\t\t\tindex: renderedElement.index + insertCount - deleteCount,\n\t\t\t\t\ttemplateData: renderedElement.templateData\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthis.renderedElements = rendered;\n\t}\n\n\trenderIndexes(indexes: number[]): void {\n\t\tfor (const { index, templateData } of this.renderedElements) {\n\t\t\tif (indexes.indexOf(index) > -1) {\n\t\t\t\tthis.trait.renderIndex(index, templateData);\n\t\t\t}\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: ITraitTemplateData): void {\n\t\tconst index = this.renderedElements.findIndex(el => el.templateData === templateData);\n\n\t\tif (index < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderedElements.splice(index, 1);\n\t}\n}\n\nclass Trait<T> implements ISpliceable<boolean>, IDisposable {\n\n\tprivate length = 0;\n\tprivate indexes: number[] = [];\n\tprivate sortedIndexes: number[] = [];\n\n\tprivate readonly _onChange = new Emitter<ITraitChangeEvent>();\n\treadonly onChange: Event<ITraitChangeEvent> = this._onChange.event;\n\n\tget name(): string { return this._trait; }\n\n\t@memoize\n\tget renderer(): TraitRenderer<T> {\n\t\treturn new TraitRenderer<T>(this);\n\t}\n\n\tconstructor(private _trait: string) { }\n\n\tsplice(start: number, deleteCount: number, elements: boolean[]): void {\n\t\tdeleteCount = Math.max(0, Math.min(deleteCount, this.length - start));\n\n\t\tconst diff = elements.length - deleteCount;\n\t\tconst end = start + deleteCount;\n\t\tconst sortedIndexes = [\n\t\t\t...this.sortedIndexes.filter(i => i < start),\n\t\t\t...elements.map((hasTrait, i) => hasTrait ? i + start : -1).filter(i => i !== -1),\n\t\t\t...this.sortedIndexes.filter(i => i >= end).map(i => i + diff)\n\t\t];\n\n\t\tconst length = this.length + diff;\n\n\t\tif (this.sortedIndexes.length > 0 && sortedIndexes.length === 0 && length > 0) {\n\t\t\tconst first = this.sortedIndexes.find(index => index >= start) ?? length - 1;\n\t\t\tsortedIndexes.push(Math.min(first, length - 1));\n\t\t}\n\n\t\tthis.renderer.splice(start, deleteCount, elements.length);\n\t\tthis._set(sortedIndexes, sortedIndexes);\n\t\tthis.length = length;\n\t}\n\n\trenderIndex(index: number, container: HTMLElement): void {\n\t\tcontainer.classList.toggle(this._trait, this.contains(index));\n\t}\n\n\tunrender(container: HTMLElement): void {\n\t\tcontainer.classList.remove(this._trait);\n\t}\n\n\t/**\n\t * Sets the indexes which should have this trait.\n\t *\n\t * @param indexes Indexes which should have this trait.\n\t * @return The old indexes which had this trait.\n\t */\n\tset(indexes: number[], browserEvent?: UIEvent): number[] {\n\t\treturn this._set(indexes, [...indexes].sort(numericSort), browserEvent);\n\t}\n\n\tprivate _set(indexes: number[], sortedIndexes: number[], browserEvent?: UIEvent): number[] {\n\t\tconst result = this.indexes;\n\t\tconst sortedResult = this.sortedIndexes;\n\n\t\tthis.indexes = indexes;\n\t\tthis.sortedIndexes = sortedIndexes;\n\n\t\tconst toRender = disjunction(sortedResult, indexes);\n\t\tthis.renderer.renderIndexes(toRender);\n\n\t\tthis._onChange.fire({ indexes, browserEvent });\n\t\treturn result;\n\t}\n\n\tget(): number[] {\n\t\treturn this.indexes;\n\t}\n\n\tcontains(index: number): boolean {\n\t\treturn binarySearch(this.sortedIndexes, index, numericSort) >= 0;\n\t}\n\n\tdispose() {\n\t\tdispose(this._onChange);\n\t}\n}\n\nclass SelectionTrait<T> extends Trait<T> {\n\n\tconstructor(private setAriaSelected: boolean) {\n\t\tsuper('selected');\n\t}\n\n\toverride renderIndex(index: number, container: HTMLElement): void {\n\t\tsuper.renderIndex(index, container);\n\n\t\tif (this.setAriaSelected) {\n\t\t\tif (this.contains(index)) {\n\t\t\t\tcontainer.setAttribute('aria-selected', 'true');\n\t\t\t} else {\n\t\t\t\tcontainer.setAttribute('aria-selected', 'false');\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * The TraitSpliceable is used as a util class to be able\n * to preserve traits across splice calls, given an identity\n * provider.\n */\nclass TraitSpliceable<T> implements ISpliceable<T> {\n\n\tconstructor(\n\t\tprivate trait: Trait<T>,\n\t\tprivate view: ListView<T>,\n\t\tprivate identityProvider?: IIdentityProvider<T>\n\t) { }\n\n\tsplice(start: number, deleteCount: number, elements: T[]): void {\n\t\tif (!this.identityProvider) {\n\t\t\treturn this.trait.splice(start, deleteCount, elements.map(() => false));\n\t\t}\n\n\t\tconst pastElementsWithTrait = this.trait.get().map(i => this.identityProvider!.getId(this.view.element(i)).toString());\n\t\tconst elementsWithTrait = elements.map(e => pastElementsWithTrait.indexOf(this.identityProvider!.getId(e).toString()) > -1);\n\n\t\tthis.trait.splice(start, deleteCount, elementsWithTrait);\n\t}\n}\n\nexport function isInputElement(e: HTMLElement): boolean {\n\treturn e.tagName === 'INPUT' || e.tagName === 'TEXTAREA';\n}\n\nexport function isMonacoEditor(e: HTMLElement): boolean {\n\tif (e.classList.contains('monaco-editor')) {\n\t\treturn true;\n\t}\n\n\tif (e.classList.contains('monaco-list')) {\n\t\treturn false;\n\t}\n\n\tif (!e.parentElement) {\n\t\treturn false;\n\t}\n\n\treturn isMonacoEditor(e.parentElement);\n}\n\nclass KeyboardController<T> implements IDisposable {\n\n\tprivate readonly disposables = new DisposableStore();\n\tprivate readonly multipleSelectionDisposables = new DisposableStore();\n\n\t@memoize\n\tprivate get onKeyDown(): Event.IChainableEvent<StandardKeyboardEvent> {\n\t\treturn Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, 'keydown')).event)\n\t\t\t.filter(e => !isInputElement(e.target as HTMLElement))\n\t\t\t.map(e => new StandardKeyboardEvent(e));\n\t}\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>,\n\t\toptions: IListOptions<T>\n\t) {\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(this.onEnter, this, this.disposables);\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.disposables);\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.disposables);\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this, this.disposables);\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this, this.disposables);\n\t\tthis.onKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(this.onEscape, this, this.disposables);\n\n\t\tif (options.multipleSelectionSupport !== false) {\n\t\t\tthis.onKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KeyA).on(this.onCtrlA, this, this.multipleSelectionDisposables);\n\t\t}\n\t}\n\n\tupdateOptions(optionsUpdate: IListOptionsUpdate): void {\n\t\tif (optionsUpdate.multipleSelectionSupport !== undefined) {\n\t\t\tthis.multipleSelectionDisposables.clear();\n\n\t\t\tif (optionsUpdate.multipleSelectionSupport) {\n\t\t\t\tthis.onKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KeyA).on(this.onCtrlA, this, this.multipleSelectionDisposables);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onEnter(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.setSelection(this.list.getFocus(), e.browserEvent);\n\t}\n\n\tprivate onUpArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.focusPrevious(1, false, e.browserEvent);\n\t\tconst el = this.list.getFocus()[0];\n\t\tthis.list.setAnchor(el);\n\t\tthis.list.reveal(el);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tprivate onDownArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.focusNext(1, false, e.browserEvent);\n\t\tconst el = this.list.getFocus()[0];\n\t\tthis.list.setAnchor(el);\n\t\tthis.list.reveal(el);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tprivate onPageUpArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.focusPreviousPage(e.browserEvent);\n\t\tconst el = this.list.getFocus()[0];\n\t\tthis.list.setAnchor(el);\n\t\tthis.list.reveal(el);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tprivate onPageDownArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.focusNextPage(e.browserEvent);\n\t\tconst el = this.list.getFocus()[0];\n\t\tthis.list.setAnchor(el);\n\t\tthis.list.reveal(el);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tprivate onCtrlA(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.setSelection(range(this.list.length), e.browserEvent);\n\t\tthis.list.setAnchor(undefined);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tprivate onEscape(e: StandardKeyboardEvent): void {\n\t\tif (this.list.getSelection().length) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.list.setSelection([], e.browserEvent);\n\t\t\tthis.list.setAnchor(undefined);\n\t\t\tthis.view.domNode.focus();\n\t\t}\n\t}\n\n\tdispose() {\n\t\tthis.disposables.dispose();\n\t\tthis.multipleSelectionDisposables.dispose();\n\t}\n}\n\nenum TypeLabelControllerState {\n\tIdle,\n\tTyping\n}\n\nexport const DefaultKeyboardNavigationDelegate = new class implements IKeyboardNavigationDelegate {\n\tmightProducePrintableCharacter(event: IKeyboardEvent): boolean {\n\t\tif (event.ctrlKey || event.metaKey || event.altKey) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (event.keyCode >= KeyCode.KeyA && event.keyCode <= KeyCode.KeyZ)\n\t\t\t|| (event.keyCode >= KeyCode.Digit0 && event.keyCode <= KeyCode.Digit9)\n\t\t\t|| (event.keyCode >= KeyCode.Numpad0 && event.keyCode <= KeyCode.Numpad9)\n\t\t\t|| (event.keyCode >= KeyCode.Semicolon && event.keyCode <= KeyCode.Quote);\n\t}\n};\n\nclass TypeLabelController<T> implements IDisposable {\n\n\tprivate enabled = false;\n\tprivate state: TypeLabelControllerState = TypeLabelControllerState.Idle;\n\n\tprivate automaticKeyboardNavigation = true;\n\tprivate triggered = false;\n\tprivate previouslyFocused = -1;\n\n\tprivate readonly enabledDisposables = new DisposableStore();\n\tprivate readonly disposables = new DisposableStore();\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>,\n\t\tprivate keyboardNavigationLabelProvider: IKeyboardNavigationLabelProvider<T>,\n\t\tprivate delegate: IKeyboardNavigationDelegate\n\t) {\n\t\tthis.updateOptions(list.options);\n\t}\n\n\tupdateOptions(options: IListOptions<T>): void {\n\t\tconst enableKeyboardNavigation = typeof options.enableKeyboardNavigation === 'undefined' ? true : !!options.enableKeyboardNavigation;\n\n\t\tif (enableKeyboardNavigation) {\n\t\t\tthis.enable();\n\t\t} else {\n\t\t\tthis.disable();\n\t\t}\n\n\t\tif (typeof options.automaticKeyboardNavigation !== 'undefined') {\n\t\t\tthis.automaticKeyboardNavigation = options.automaticKeyboardNavigation;\n\t\t}\n\t}\n\n\tprivate enable(): void {\n\t\tif (this.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onChar = Event.chain(this.enabledDisposables.add(new DomEmitter(this.view.domNode, 'keydown')).event)\n\t\t\t.filter(e => !isInputElement(e.target as HTMLElement))\n\t\t\t.filter(() => this.automaticKeyboardNavigation || this.triggered)\n\t\t\t.map(event => new StandardKeyboardEvent(event))\n\t\t\t.filter(e => this.delegate.mightProducePrintableCharacter(e))\n\t\t\t.forEach(e => e.preventDefault())\n\t\t\t.map(event => event.browserEvent.key)\n\t\t\t.event;\n\n\t\tconst onClear = Event.debounce<string, null>(onChar, () => null, 800);\n\t\tconst onInput = Event.reduce<string | null, string | null>(Event.any(onChar, onClear), (r, i) => i === null ? null : ((r || '') + i));\n\n\t\tonInput(this.onInput, this, this.enabledDisposables);\n\t\tonClear(this.onClear, this, this.enabledDisposables);\n\n\t\tthis.enabled = true;\n\t\tthis.triggered = false;\n\t}\n\n\tprivate disable(): void {\n\t\tif (!this.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.enabledDisposables.clear();\n\t\tthis.enabled = false;\n\t\tthis.triggered = false;\n\t}\n\n\tprivate onClear(): void {\n\t\tconst focus = this.list.getFocus();\n\t\tif (focus.length > 0 && focus[0] === this.previouslyFocused) {\n\t\t\t// List: re-announce element on typing end since typed keys will interrupt aria label of focused element\n\t\t\t// Do not announce if there was a focus change at the end to prevent duplication https://github.com/microsoft/vscode/issues/95961\n\t\t\tconst ariaLabel = this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(focus[0]));\n\t\t\tif (ariaLabel) {\n\t\t\t\talert(ariaLabel);\n\t\t\t}\n\t\t}\n\t\tthis.previouslyFocused = -1;\n\t}\n\n\tprivate onInput(word: string | null): void {\n\t\tif (!word) {\n\t\t\tthis.state = TypeLabelControllerState.Idle;\n\t\t\tthis.triggered = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst focus = this.list.getFocus();\n\t\tconst start = focus.length > 0 ? focus[0] : 0;\n\t\tconst delta = this.state === TypeLabelControllerState.Idle ? 1 : 0;\n\t\tthis.state = TypeLabelControllerState.Typing;\n\n\t\tfor (let i = 0; i < this.list.length; i++) {\n\t\t\tconst index = (start + i + delta) % this.list.length;\n\t\t\tconst label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(index));\n\t\t\tconst labelStr = label && label.toString();\n\n\t\t\tif (typeof labelStr === 'undefined' || matchesPrefix(word, labelStr)) {\n\t\t\t\tthis.previouslyFocused = start;\n\t\t\t\tthis.list.setFocus([index]);\n\t\t\t\tthis.list.reveal(index);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose() {\n\t\tthis.disable();\n\t\tthis.enabledDisposables.dispose();\n\t\tthis.disposables.dispose();\n\t}\n}\n\nclass DOMFocusController<T> implements IDisposable {\n\n\tprivate readonly disposables = new DisposableStore();\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>\n\t) {\n\t\tconst onKeyDown = Event.chain(this.disposables.add(new DomEmitter(view.domNode, 'keydown')).event)\n\t\t\t.filter(e => !isInputElement(e.target as HTMLElement))\n\t\t\t.map(e => new StandardKeyboardEvent(e));\n\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.Tab && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey)\n\t\t\t.on(this.onTab, this, this.disposables);\n\t}\n\n\tprivate onTab(e: StandardKeyboardEvent): void {\n\t\tif (e.target !== this.view.domNode) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focus = this.list.getFocus();\n\n\t\tif (focus.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusedDomElement = this.view.domElement(focus[0]);\n\n\t\tif (!focusedDomElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabIndexElement = focusedDomElement.querySelector('[tabIndex]');\n\n\t\tif (!tabIndexElement || !(tabIndexElement instanceof HTMLElement) || tabIndexElement.tabIndex === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst style = window.getComputedStyle(tabIndexElement);\n\t\tif (style.visibility === 'hidden' || style.display === 'none') {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\ttabIndexElement.focus();\n\t}\n\n\tdispose() {\n\t\tthis.disposables.dispose();\n\t}\n}\n\nexport function isSelectionSingleChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\treturn platform.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;\n}\n\nexport function isSelectionRangeChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\treturn event.browserEvent.shiftKey;\n}\n\nfunction isMouseRightClick(event: UIEvent): boolean {\n\treturn event instanceof MouseEvent && event.button === 2;\n}\n\nconst DefaultMultipleSelectionController = {\n\tisSelectionSingleChangeEvent,\n\tisSelectionRangeChangeEvent\n};\n\nexport class MouseController<T> implements IDisposable {\n\n\tprivate multipleSelectionController: IMultipleSelectionController<T> | undefined;\n\tprivate mouseSupport: boolean;\n\tprivate readonly disposables = new DisposableStore();\n\n\tprivate _onPointer = new Emitter<IListMouseEvent<T>>();\n\treadonly onPointer: Event<IListMouseEvent<T>> = this._onPointer.event;\n\n\tconstructor(protected list: List<T>) {\n\t\tif (list.options.multipleSelectionSupport !== false) {\n\t\t\tthis.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController;\n\t\t}\n\n\t\tthis.mouseSupport = typeof list.options.mouseSupport === 'undefined' || !!list.options.mouseSupport;\n\n\t\tif (this.mouseSupport) {\n\t\t\tlist.onMouseDown(this.onMouseDown, this, this.disposables);\n\t\t\tlist.onContextMenu(this.onContextMenu, this, this.disposables);\n\t\t\tlist.onMouseDblClick(this.onDoubleClick, this, this.disposables);\n\t\t\tlist.onTouchStart(this.onMouseDown, this, this.disposables);\n\t\t\tthis.disposables.add(Gesture.addTarget(list.getHTMLElement()));\n\t\t}\n\n\t\tEvent.any(list.onMouseClick, list.onMouseMiddleClick, list.onTap)(this.onViewPointer, this, this.disposables);\n\t}\n\n\tupdateOptions(optionsUpdate: IListOptionsUpdate): void {\n\t\tif (optionsUpdate.multipleSelectionSupport !== undefined) {\n\t\t\tthis.multipleSelectionController = undefined;\n\n\t\t\tif (optionsUpdate.multipleSelectionSupport) {\n\t\t\t\tthis.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected isSelectionSingleChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\t\tif (!this.multipleSelectionController) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.multipleSelectionController.isSelectionSingleChangeEvent(event);\n\t}\n\n\tprotected isSelectionRangeChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\t\tif (!this.multipleSelectionController) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.multipleSelectionController.isSelectionRangeChangeEvent(event);\n\t}\n\n\tprivate isSelectionChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\t\treturn this.isSelectionSingleChangeEvent(event) || this.isSelectionRangeChangeEvent(event);\n\t}\n\n\tprivate onMouseDown(e: IListMouseEvent<T> | IListTouchEvent<T>): void {\n\t\tif (isMonacoEditor(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (document.activeElement !== e.browserEvent.target) {\n\t\t\tthis.list.domFocus();\n\t\t}\n\t}\n\n\tprivate onContextMenu(e: IListContextMenuEvent<T>): void {\n\t\tif (isMonacoEditor(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focus = typeof e.index === 'undefined' ? [] : [e.index];\n\t\tthis.list.setFocus(focus, e.browserEvent);\n\t}\n\n\tprotected onViewPointer(e: IListMouseEvent<T>): void {\n\t\tif (!this.mouseSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isInputElement(e.browserEvent.target as HTMLElement) || isMonacoEditor(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focus = e.index;\n\n\t\tif (typeof focus === 'undefined') {\n\t\t\tthis.list.setFocus([], e.browserEvent);\n\t\t\tthis.list.setSelection([], e.browserEvent);\n\t\t\tthis.list.setAnchor(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isSelectionRangeChangeEvent(e)) {\n\t\t\treturn this.changeSelection(e);\n\t\t}\n\n\t\tif (this.isSelectionChangeEvent(e)) {\n\t\t\treturn this.changeSelection(e);\n\t\t}\n\n\t\tthis.list.setFocus([focus], e.browserEvent);\n\t\tthis.list.setAnchor(focus);\n\n\t\tif (!isMouseRightClick(e.browserEvent)) {\n\t\t\tthis.list.setSelection([focus], e.browserEvent);\n\t\t}\n\n\t\tthis._onPointer.fire(e);\n\t}\n\n\tprotected onDoubleClick(e: IListMouseEvent<T>): void {\n\t\tif (isInputElement(e.browserEvent.target as HTMLElement) || isMonacoEditor(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isSelectionChangeEvent(e)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focus = this.list.getFocus();\n\t\tthis.list.setSelection(focus, e.browserEvent);\n\t}\n\n\tprivate changeSelection(e: IListMouseEvent<T> | IListTouchEvent<T>): void {\n\t\tconst focus = e.index!;\n\t\tlet anchor = this.list.getAnchor();\n\n\t\tif (this.isSelectionRangeChangeEvent(e)) {\n\t\t\tif (typeof anchor === 'undefined') {\n\t\t\t\tconst currentFocus = this.list.getFocus()[0];\n\t\t\t\tanchor = currentFocus ?? focus;\n\t\t\t\tthis.list.setAnchor(anchor);\n\t\t\t}\n\n\t\t\tconst min = Math.min(anchor, focus);\n\t\t\tconst max = Math.max(anchor, focus);\n\t\t\tconst rangeSelection = range(min, max + 1);\n\t\t\tconst selection = this.list.getSelection();\n\t\t\tconst contiguousRange = getContiguousRangeContaining(disjunction(selection, [anchor]), anchor);\n\n\t\t\tif (contiguousRange.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newSelection = disjunction(rangeSelection, relativeComplement(selection, contiguousRange));\n\t\t\tthis.list.setSelection(newSelection, e.browserEvent);\n\t\t\tthis.list.setFocus([focus], e.browserEvent);\n\n\t\t} else if (this.isSelectionSingleChangeEvent(e)) {\n\t\t\tconst selection = this.list.getSelection();\n\t\t\tconst newSelection = selection.filter(i => i !== focus);\n\n\t\t\tthis.list.setFocus([focus]);\n\t\t\tthis.list.setAnchor(focus);\n\n\t\t\tif (selection.length === newSelection.length) {\n\t\t\t\tthis.list.setSelection([...newSelection, focus], e.browserEvent);\n\t\t\t} else {\n\t\t\t\tthis.list.setSelection(newSelection, e.browserEvent);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose() {\n\t\tthis.disposables.dispose();\n\t}\n}\n\nexport interface IMultipleSelectionController<T> {\n\tisSelectionSingleChangeEvent(event: IListMouseEvent<T> | IListTouchEvent<T>): boolean;\n\tisSelectionRangeChangeEvent(event: IListMouseEvent<T> | IListTouchEvent<T>): boolean;\n}\n\nexport interface IStyleController {\n\tstyle(styles: IListStyles): void;\n}\n\nexport interface IListAccessibilityProvider<T> extends IListViewAccessibilityProvider<T> {\n\tgetAriaLabel(element: T): string | null;\n\tgetWidgetAriaLabel(): string;\n\tgetWidgetRole?(): string;\n\tgetAriaLevel?(element: T): number | undefined;\n\tonDidChangeActiveDescendant?: Event<void>;\n\tgetActiveDescendantId?(element: T): string | undefined;\n}\n\nexport class DefaultStyleController implements IStyleController {\n\n\tconstructor(private styleElement: HTMLStyleElement, private selectorSuffix: string) { }\n\n\tstyle(styles: IListStyles): void {\n\t\tconst suffix = this.selectorSuffix && `.${this.selectorSuffix}`;\n\t\tconst content: string[] = [];\n\n\t\tif (styles.listBackground) {\n\t\t\tif (styles.listBackground.isOpaque()) {\n\t\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-rows { background: ${styles.listBackground}; }`);\n\t\t\t} else if (!platform.isMacintosh) { // subpixel AA doesn't exist in macOS\n\t\t\t\tconsole.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`);\n\t\t\t}\n\t\t}\n\n\t\tif (styles.listFocusBackground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`); // overwrite :hover style in this case!\n\t\t}\n\n\t\tif (styles.listFocusForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`);\n\t\t}\n\n\t\tif (styles.listActiveSelectionBackground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`); // overwrite :hover style in this case!\n\t\t}\n\n\t\tif (styles.listActiveSelectionForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`);\n\t\t}\n\n\t\tif (styles.listActiveSelectionIconForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:focus .monaco-list-row.selected .codicon { color: ${styles.listActiveSelectionIconForeground}; }`);\n\t\t}\n\n\t\tif (styles.listFocusAndSelectionBackground) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${suffix}:focus .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listFocusAndSelectionForeground) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listInactiveFocusForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused { color: ${styles.listInactiveFocusForeground}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { color: ${styles.listInactiveFocusForeground}; }`); // overwrite :hover style in this case!\n\t\t}\n\n\t\tif (styles.listInactiveSelectionIconForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused .codicon { color: ${styles.listInactiveSelectionIconForeground}; }`);\n\t\t}\n\n\t\tif (styles.listInactiveFocusBackground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`); // overwrite :hover style in this case!\n\t\t}\n\n\t\tif (styles.listInactiveSelectionBackground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); // overwrite :hover style in this case!\n\t\t}\n\n\t\tif (styles.listInactiveSelectionForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`);\n\t\t}\n\n\t\tif (styles.listHoverBackground) {\n\t\t\tcontent.push(`.monaco-list${suffix}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`);\n\t\t}\n\n\t\tif (styles.listHoverForeground) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`);\n\t\t}\n\n\t\tif (styles.listSelectionOutline) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`);\n\t\t}\n\n\t\tif (styles.listFocusOutline) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${suffix}:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${suffix}.last-focused .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listInactiveFocusOutline) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`);\n\t\t}\n\n\t\tif (styles.listHoverOutline) {\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`);\n\t\t}\n\n\t\tif (styles.listDropBackground) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-list${suffix}.drop-target,\n\t\t\t\t.monaco-list${suffix} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${suffix} .monaco-list-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listFilterWidgetBackground) {\n\t\t\tcontent.push(`.monaco-list-type-filter { background-color: ${styles.listFilterWidgetBackground} }`);\n\t\t}\n\n\t\tif (styles.listFilterWidgetOutline) {\n\t\t\tcontent.push(`.monaco-list-type-filter { border: 1px solid ${styles.listFilterWidgetOutline}; }`);\n\t\t}\n\n\t\tif (styles.listFilterWidgetNoMatchesOutline) {\n\t\t\tcontent.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${styles.listFilterWidgetNoMatchesOutline}; }`);\n\t\t}\n\n\t\tif (styles.listMatchesShadow) {\n\t\t\tcontent.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${styles.listMatchesShadow}; }`);\n\t\t}\n\n\t\tif (styles.tableColumnsBorder) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${styles.tableColumnsBorder};\n\t\t\t}`);\n\t\t}\n\n\t\tif (styles.tableOddRowsBackgroundColor) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${styles.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`);\n\t\t}\n\n\t\tthis.styleElement.textContent = content.join('\\n');\n\t}\n}\n\nexport interface IListOptionsUpdate extends IListViewOptionsUpdate {\n\treadonly enableKeyboardNavigation?: boolean;\n\treadonly automaticKeyboardNavigation?: boolean;\n\treadonly multipleSelectionSupport?: boolean;\n}\n\nexport interface IListOptions<T> extends IListOptionsUpdate {\n\treadonly identityProvider?: IIdentityProvider<T>;\n\treadonly dnd?: IListDragAndDrop<T>;\n\treadonly keyboardNavigationLabelProvider?: IKeyboardNavigationLabelProvider<T>;\n\treadonly keyboardNavigationDelegate?: IKeyboardNavigationDelegate;\n\treadonly keyboardSupport?: boolean;\n\treadonly multipleSelectionController?: IMultipleSelectionController<T>;\n\treadonly styleController?: (suffix: string) => IStyleController;\n\treadonly accessibilityProvider?: IListAccessibilityProvider<T>;\n\n\t// list view options\n\treadonly useShadows?: boolean;\n\treadonly setRowLineHeight?: boolean;\n\treadonly mouseSupport?: boolean;\n\treadonly horizontalScrolling?: boolean;\n\treadonly smoothScrolling?: boolean;\n\treadonly alwaysConsumeMouseWheel?: boolean;\n}\n\nexport interface IListStyles {\n\tlistBackground?: Color;\n\tlistFocusBackground?: Color;\n\tlistFocusForeground?: Color;\n\tlistActiveSelectionBackground?: Color;\n\tlistActiveSelectionForeground?: Color;\n\tlistActiveSelectionIconForeground?: Color;\n\tlistFocusAndSelectionBackground?: Color;\n\tlistFocusAndSelectionForeground?: Color;\n\tlistInactiveSelectionBackground?: Color;\n\tlistInactiveSelectionIconForeground?: Color;\n\tlistInactiveSelectionForeground?: Color;\n\tlistInactiveFocusForeground?: Color;\n\tlistInactiveFocusBackground?: Color;\n\tlistHoverBackground?: Color;\n\tlistHoverForeground?: Color;\n\tlistDropBackground?: Color;\n\tlistFocusOutline?: Color;\n\tlistInactiveFocusOutline?: Color;\n\tlistSelectionOutline?: Color;\n\tlistHoverOutline?: Color;\n\tlistFilterWidgetBackground?: Color;\n\tlistFilterWidgetOutline?: Color;\n\tlistFilterWidgetNoMatchesOutline?: Color;\n\tlistMatchesShadow?: Color;\n\ttreeIndentGuidesStroke?: Color;\n\ttableColumnsBorder?: Color;\n\ttableOddRowsBackgroundColor?: Color;\n}\n\nconst defaultStyles: IListStyles = {\n\tlistFocusBackground: Color.fromHex('#7FB0D0'),\n\tlistActiveSelectionBackground: Color.fromHex('#0E639C'),\n\tlistActiveSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistActiveSelectionIconForeground: Color.fromHex('#FFFFFF'),\n\tlistFocusAndSelectionBackground: Color.fromHex('#094771'),\n\tlistFocusAndSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistInactiveSelectionBackground: Color.fromHex('#3F3F46'),\n\tlistInactiveSelectionIconForeground: Color.fromHex('#FFFFFF'),\n\tlistHoverBackground: Color.fromHex('#2A2D2E'),\n\tlistDropBackground: Color.fromHex('#383B3D'),\n\ttreeIndentGuidesStroke: Color.fromHex('#a9a9a9'),\n\ttableColumnsBorder: Color.fromHex('#cccccc').transparent(0.2),\n\ttableOddRowsBackgroundColor: Color.fromHex('#cccccc').transparent(0.04)\n};\n\nconst DefaultOptions: IListOptions<any> = {\n\tkeyboardSupport: true,\n\tmouseSupport: true,\n\tmultipleSelectionSupport: true,\n\tdnd: {\n\t\tgetDragURI() { return null; },\n\t\tonDragStart(): void { },\n\t\tonDragOver() { return false; },\n\t\tdrop() { }\n\t}\n};\n\n// TODO@Joao: move these utils into a SortedArray class\n\nfunction getContiguousRangeContaining(range: number[], value: number): number[] {\n\tconst index = range.indexOf(value);\n\n\tif (index === -1) {\n\t\treturn [];\n\t}\n\n\tconst result: number[] = [];\n\tlet i = index - 1;\n\twhile (i >= 0 && range[i] === value - (index - i)) {\n\t\tresult.push(range[i--]);\n\t}\n\n\tresult.reverse();\n\ti = index;\n\twhile (i < range.length && range[i] === value + (i - index)) {\n\t\tresult.push(range[i++]);\n\t}\n\n\treturn result;\n}\n\n/**\n * Given two sorted collections of numbers, returns the intersection\n * between them (OR).\n */\nfunction disjunction(one: number[], other: number[]): number[] {\n\tconst result: number[] = [];\n\tlet i = 0, j = 0;\n\n\twhile (i < one.length || j < other.length) {\n\t\tif (i >= one.length) {\n\t\t\tresult.push(other[j++]);\n\t\t} else if (j >= other.length) {\n\t\t\tresult.push(one[i++]);\n\t\t} else if (one[i] === other[j]) {\n\t\t\tresult.push(one[i]);\n\t\t\ti++;\n\t\t\tj++;\n\t\t\tcontinue;\n\t\t} else if (one[i] < other[j]) {\n\t\t\tresult.push(one[i++]);\n\t\t} else {\n\t\t\tresult.push(other[j++]);\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Given two sorted collections of numbers, returns the relative\n * complement between them (XOR).\n */\nfunction relativeComplement(one: number[], other: number[]): number[] {\n\tconst result: number[] = [];\n\tlet i = 0, j = 0;\n\n\twhile (i < one.length || j < other.length) {\n\t\tif (i >= one.length) {\n\t\t\tresult.push(other[j++]);\n\t\t} else if (j >= other.length) {\n\t\t\tresult.push(one[i++]);\n\t\t} else if (one[i] === other[j]) {\n\t\t\ti++;\n\t\t\tj++;\n\t\t\tcontinue;\n\t\t} else if (one[i] < other[j]) {\n\t\t\tresult.push(one[i++]);\n\t\t} else {\n\t\t\tj++;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst numericSort = (a: number, b: number) => a - b;\n\nclass PipelineRenderer<T> implements IListRenderer<T, any> {\n\n\tconstructor(\n\t\tprivate _templateId: string,\n\t\tprivate renderers: IListRenderer<any /* TODO@joao */, any>[]\n\t) { }\n\n\tget templateId(): string {\n\t\treturn this._templateId;\n\t}\n\n\trenderTemplate(container: HTMLElement): any[] {\n\t\treturn this.renderers.map(r => r.renderTemplate(container));\n\t}\n\n\trenderElement(element: T, index: number, templateData: any[], height: number | undefined): void {\n\t\tlet i = 0;\n\n\t\tfor (const renderer of this.renderers) {\n\t\t\trenderer.renderElement(element, index, templateData[i++], height);\n\t\t}\n\t}\n\n\tdisposeElement(element: T, index: number, templateData: any[], height: number | undefined): void {\n\t\tlet i = 0;\n\n\t\tfor (const renderer of this.renderers) {\n\t\t\tif (renderer.disposeElement) {\n\t\t\t\trenderer.disposeElement(element, index, templateData[i], height);\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: any[]): void {\n\t\tlet i = 0;\n\n\t\tfor (const renderer of this.renderers) {\n\t\t\trenderer.disposeTemplate(templateData[i++]);\n\t\t}\n\t}\n}\n\nclass AccessibiltyRenderer<T> implements IListRenderer<T, HTMLElement> {\n\n\ttemplateId: string = 'a18n';\n\n\tconstructor(private accessibilityProvider: IListAccessibilityProvider<T>) { }\n\n\trenderTemplate(container: HTMLElement): HTMLElement {\n\t\treturn container;\n\t}\n\n\trenderElement(element: T, index: number, container: HTMLElement): void {\n\t\tconst ariaLabel = this.accessibilityProvider.getAriaLabel(element);\n\n\t\tif (ariaLabel) {\n\t\t\tcontainer.setAttribute('aria-label', ariaLabel);\n\t\t} else {\n\t\t\tcontainer.removeAttribute('aria-label');\n\t\t}\n\n\t\tconst ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element);\n\n\t\tif (typeof ariaLevel === 'number') {\n\t\t\tcontainer.setAttribute('aria-level', `${ariaLevel}`);\n\t\t} else {\n\t\t\tcontainer.removeAttribute('aria-level');\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: any): void {\n\t\t// noop\n\t}\n}\n\nclass ListViewDragAndDrop<T> implements IListViewDragAndDrop<T> {\n\n\tconstructor(private list: List<T>, private dnd: IListDragAndDrop<T>) { }\n\n\tgetDragElements(element: T): T[] {\n\t\tconst selection = this.list.getSelectedElements();\n\t\tconst elements = selection.indexOf(element) > -1 ? selection : [element];\n\t\treturn elements;\n\t}\n\n\tgetDragURI(element: T): string | null {\n\t\treturn this.dnd.getDragURI(element);\n\t}\n\n\tgetDragLabel?(elements: T[], originalEvent: DragEvent): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(elements, originalEvent);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tonDragStart(data: IDragAndDropData, originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragStart) {\n\t\t\tthis.dnd.onDragStart(data, originalEvent);\n\t\t}\n\t}\n\n\tonDragOver(data: IDragAndDropData, targetElement: T, targetIndex: number, originalEvent: DragEvent): boolean | IListDragOverReaction {\n\t\treturn this.dnd.onDragOver(data, targetElement, targetIndex, originalEvent);\n\t}\n\n\tonDragLeave(data: IDragAndDropData, targetElement: T, targetIndex: number, originalEvent: DragEvent): void {\n\t\tthis.dnd.onDragLeave?.(data, targetElement, targetIndex, originalEvent);\n\t}\n\n\tonDragEnd(originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragEnd) {\n\t\t\tthis.dnd.onDragEnd(originalEvent);\n\t\t}\n\t}\n\n\tdrop(data: IDragAndDropData, targetElement: T, targetIndex: number, originalEvent: DragEvent): void {\n\t\tthis.dnd.drop(data, targetElement, targetIndex, originalEvent);\n\t}\n}\n\n/**\n * The {@link List} is a virtual scrolling widget, built on top of the {@link ListView}\n * widget.\n *\n * Features:\n * - Customizable keyboard and mouse support\n * - Element traits: focus, selection, achor\n * - Accessibility support\n * - Touch support\n * - Performant template-based rendering\n * - Horizontal scrolling\n * - Variable element height support\n * - Dynamic element height support\n * - Drag-and-drop support\n */\nexport class List<T> implements ISpliceable<T>, IThemable, IDisposable {\n\n\tprivate focus = new Trait<T>('focused');\n\tprivate selection: Trait<T>;\n\tprivate anchor = new Trait<T>('anchor');\n\tprivate eventBufferer = new EventBufferer();\n\tprotected view: ListView<T>;\n\tprivate spliceable: ISpliceable<T>;\n\tprivate styleController: IStyleController;\n\tprivate typeLabelController?: TypeLabelController<T>;\n\tprivate accessibilityProvider?: IListAccessibilityProvider<T>;\n\tprivate keyboardController: KeyboardController<T> | undefined;\n\tprivate mouseController: MouseController<T>;\n\tprivate _ariaLabel: string = '';\n\n\tprotected readonly disposables = new DisposableStore();\n\n\t@memoize get onDidChangeFocus(): Event<IListEvent<T>> {\n\t\treturn Event.map(this.eventBufferer.wrapEvent(this.focus.onChange), e => this.toListEvent(e));\n\t}\n\n\t@memoize get onDidChangeSelection(): Event<IListEvent<T>> {\n\t\treturn Event.map(this.eventBufferer.wrapEvent(this.selection.onChange), e => this.toListEvent(e));\n\t}\n\n\tget domId(): string { return this.view.domId; }\n\tget onMouseClick(): Event<IListMouseEvent<T>> { return this.view.onMouseClick; }\n\tget onMouseDblClick(): Event<IListMouseEvent<T>> { return this.view.onMouseDblClick; }\n\tget onMouseMiddleClick(): Event<IListMouseEvent<T>> { return this.view.onMouseMiddleClick; }\n\tget onPointer(): Event<IListMouseEvent<T>> { return this.mouseController.onPointer; }\n\tget onMouseDown(): Event<IListMouseEvent<T>> { return this.view.onMouseDown; }\n\tget onTouchStart(): Event<IListTouchEvent<T>> { return this.view.onTouchStart; }\n\tget onTap(): Event<IListGestureEvent<T>> { return this.view.onTap; }\n\n\t/**\n\t * Possible context menu trigger events:\n\t * - ContextMenu key\n\t * - Shift F10\n\t * - Ctrl Option Shift M (macOS with VoiceOver)\n\t * - Mouse right click\n\t */\n\t@memoize get onContextMenu(): Event<IListContextMenuEvent<T>> {\n\t\tlet didJustPressContextMenuKey = false;\n\n\t\tconst fromKeyDown = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, 'keydown')).event)\n\t\t\t.map(e => new StandardKeyboardEvent(e))\n\t\t\t.filter(e => didJustPressContextMenuKey = e.keyCode === KeyCode.ContextMenu || (e.shiftKey && e.keyCode === KeyCode.F10))\n\t\t\t.map(stopEvent)\n\t\t\t.filter(() => false)\n\t\t\t.event as Event<any>;\n\n\t\tconst fromKeyUp = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, 'keyup')).event)\n\t\t\t.forEach(() => didJustPressContextMenuKey = false)\n\t\t\t.map(e => new StandardKeyboardEvent(e))\n\t\t\t.filter(e => e.keyCode === KeyCode.ContextMenu || (e.shiftKey && e.keyCode === KeyCode.F10))\n\t\t\t.map(stopEvent)\n\t\t\t.map(({ browserEvent }) => {\n\t\t\t\tconst focus = this.getFocus();\n\t\t\t\tconst index = focus.length ? focus[0] : undefined;\n\t\t\t\tconst element = typeof index !== 'undefined' ? this.view.element(index) : undefined;\n\t\t\t\tconst anchor = typeof index !== 'undefined' ? this.view.domElement(index) as HTMLElement : this.view.domNode;\n\t\t\t\treturn { index, element, anchor, browserEvent };\n\t\t\t})\n\t\t\t.event;\n\n\t\tconst fromMouse = Event.chain(this.view.onContextMenu)\n\t\t\t.filter(_ => !didJustPressContextMenuKey)\n\t\t\t.map(({ element, index, browserEvent }) => ({ element, index, anchor: { x: browserEvent.pageX + 1, y: browserEvent.pageY }, browserEvent }))\n\t\t\t.event;\n\n\t\treturn Event.any<IListContextMenuEvent<T>>(fromKeyDown, fromKeyUp, fromMouse);\n\t}\n\n\t@memoize get onKeyDown(): Event<KeyboardEvent> { return this.disposables.add(new DomEmitter(this.view.domNode, 'keydown')).event; }\n\n\t@memoize get onDidFocus(): Event<void> { return Event.signal(this.disposables.add(new DomEmitter(this.view.domNode, 'focus', true)).event); }\n\n\tprivate readonly _onDidDispose = new Emitter<void>();\n\treadonly onDidDispose: Event<void> = this._onDidDispose.event;\n\n\tconstructor(\n\t\tprivate user: string,\n\t\tcontainer: HTMLElement,\n\t\tvirtualDelegate: IListVirtualDelegate<T>,\n\t\trenderers: IListRenderer<any /* TODO@joao */, any>[],\n\t\tprivate _options: IListOptions<T> = DefaultOptions\n\t) {\n\t\tconst role = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? this._options.accessibilityProvider?.getWidgetRole() : 'list';\n\t\tthis.selection = new SelectionTrait(role !== 'listbox');\n\n\t\tmixin(_options, defaultStyles, false);\n\n\t\tconst baseRenderers: IListRenderer<T, ITraitTemplateData>[] = [this.focus.renderer, this.selection.renderer];\n\n\t\tthis.accessibilityProvider = _options.accessibilityProvider;\n\n\t\tif (this.accessibilityProvider) {\n\t\t\tbaseRenderers.push(new AccessibiltyRenderer<T>(this.accessibilityProvider));\n\n\t\t\tif (this.accessibilityProvider.onDidChangeActiveDescendant) {\n\t\t\t\tthis.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant, this, this.disposables);\n\t\t\t}\n\t\t}\n\n\t\trenderers = renderers.map(r => new PipelineRenderer(r.templateId, [...baseRenderers, r]));\n\n\t\tconst viewOptions: IListViewOptions<T> = {\n\t\t\t..._options,\n\t\t\tdnd: _options.dnd && new ListViewDragAndDrop(this, _options.dnd)\n\t\t};\n\n\t\tthis.view = new ListView(container, virtualDelegate, renderers, viewOptions);\n\t\tthis.view.domNode.setAttribute('role', role);\n\n\t\tif (_options.styleController) {\n\t\t\tthis.styleController = _options.styleController(this.view.domId);\n\t\t} else {\n\t\t\tconst styleElement = createStyleSheet(this.view.domNode);\n\t\t\tthis.styleController = new DefaultStyleController(styleElement, this.view.domId);\n\t\t}\n\n\t\tthis.spliceable = new CombinedSpliceable([\n\t\t\tnew TraitSpliceable(this.focus, this.view, _options.identityProvider),\n\t\t\tnew TraitSpliceable(this.selection, this.view, _options.identityProvider),\n\t\t\tnew TraitSpliceable(this.anchor, this.view, _options.identityProvider),\n\t\t\tthis.view\n\t\t]);\n\n\t\tthis.disposables.add(this.focus);\n\t\tthis.disposables.add(this.selection);\n\t\tthis.disposables.add(this.anchor);\n\t\tthis.disposables.add(this.view);\n\t\tthis.disposables.add(this._onDidDispose);\n\n\t\tthis.disposables.add(new DOMFocusController(this, this.view));\n\n\t\tif (typeof _options.keyboardSupport !== 'boolean' || _options.keyboardSupport) {\n\t\t\tthis.keyboardController = new KeyboardController(this, this.view, _options);\n\t\t\tthis.disposables.add(this.keyboardController);\n\t\t}\n\n\t\tif (_options.keyboardNavigationLabelProvider) {\n\t\t\tconst delegate = _options.keyboardNavigationDelegate || DefaultKeyboardNavigationDelegate;\n\t\t\tthis.typeLabelController = new TypeLabelController(this, this.view, _options.keyboardNavigationLabelProvider, delegate);\n\t\t\tthis.disposables.add(this.typeLabelController);\n\t\t}\n\n\t\tthis.mouseController = this.createMouseController(_options);\n\t\tthis.disposables.add(this.mouseController);\n\n\t\tthis.onDidChangeFocus(this._onFocusChange, this, this.disposables);\n\t\tthis.onDidChangeSelection(this._onSelectionChange, this, this.disposables);\n\n\t\tif (this.accessibilityProvider) {\n\t\t\tthis.ariaLabel = this.accessibilityProvider.getWidgetAriaLabel();\n\t\t}\n\n\t\tif (this._options.multipleSelectionSupport !== false) {\n\t\t\tthis.view.domNode.setAttribute('aria-multiselectable', 'true');\n\t\t}\n\t}\n\n\tprotected createMouseController(options: IListOptions<T>): MouseController<T> {\n\t\treturn new MouseController(this);\n\t}\n\n\tupdateOptions(optionsUpdate: IListOptionsUpdate = {}): void {\n\t\tthis._options = { ...this._options, ...optionsUpdate };\n\n\t\tif (this.typeLabelController) {\n\t\t\tthis.typeLabelController.updateOptions(this._options);\n\t\t}\n\n\t\tif (this._options.multipleSelectionController !== undefined) {\n\t\t\tif (this._options.multipleSelectionSupport) {\n\t\t\t\tthis.view.domNode.setAttribute('aria-multiselectable', 'true');\n\t\t\t} else {\n\t\t\t\tthis.view.domNode.removeAttribute('aria-multiselectable');\n\t\t\t}\n\t\t}\n\n\t\tthis.mouseController.updateOptions(optionsUpdate);\n\t\tthis.keyboardController?.updateOptions(optionsUpdate);\n\t\tthis.view.updateOptions(optionsUpdate);\n\t}\n\n\tget options(): IListOptions<T> {\n\t\treturn this._options;\n\t}\n\n\tsplice(start: number, deleteCount: number, elements: T[] = []): void {\n\t\tif (start < 0 || start > this.view.length) {\n\t\t\tthrow new ListError(this.user, `Invalid start index: ${start}`);\n\t\t}\n\n\t\tif (deleteCount < 0) {\n\t\t\tthrow new ListError(this.user, `Invalid delete count: ${deleteCount}`);\n\t\t}\n\n\t\tif (deleteCount === 0 && elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements));\n\t}\n\n\trerender(): void {\n\t\tthis.view.rerender();\n\t}\n\n\telement(index: number): T {\n\t\treturn this.view.element(index);\n\t}\n\n\tget length(): number {\n\t\treturn this.view.length;\n\t}\n\n\tget contentHeight(): number {\n\t\treturn this.view.contentHeight;\n\t}\n\n\tget scrollTop(): number {\n\t\treturn this.view.getScrollTop();\n\t}\n\n\tset scrollTop(scrollTop: number) {\n\t\tthis.view.setScrollTop(scrollTop);\n\t}\n\n\tget ariaLabel(): string {\n\t\treturn this._ariaLabel;\n\t}\n\n\tset ariaLabel(value: string) {\n\t\tthis._ariaLabel = value;\n\t\tthis.view.domNode.setAttribute('aria-label', value);\n\t}\n\n\tdomFocus(): void {\n\t\tthis.view.domNode.focus({ preventScroll: true });\n\t}\n\n\tlayout(height?: number, width?: number): void {\n\t\tthis.view.layout(height, width);\n\t}\n\n\tsetSelection(indexes: number[], browserEvent?: UIEvent): void {\n\t\tfor (const index of indexes) {\n\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\tthrow new ListError(this.user, `Invalid index ${index}`);\n\t\t\t}\n\t\t}\n\n\t\tthis.selection.set(indexes, browserEvent);\n\t}\n\n\tgetSelection(): number[] {\n\t\treturn this.selection.get();\n\t}\n\n\tgetSelectedElements(): T[] {\n\t\treturn this.getSelection().map(i => this.view.element(i));\n\t}\n\n\tsetAnchor(index: number | undefined): void {\n\t\tif (typeof index === 'undefined') {\n\t\t\tthis.anchor.set([]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (index < 0 || index >= this.length) {\n\t\t\tthrow new ListError(this.user, `Invalid index ${index}`);\n\t\t}\n\n\t\tthis.anchor.set([index]);\n\t}\n\n\tgetAnchor(): number | undefined {\n\t\treturn firstOrDefault(this.anchor.get(), undefined);\n\t}\n\n\tgetAnchorElement(): T | undefined {\n\t\tconst anchor = this.getAnchor();\n\t\treturn typeof anchor === 'undefined' ? undefined : this.element(anchor);\n\t}\n\n\tsetFocus(indexes: number[], browserEvent?: UIEvent): void {\n\t\tfor (const index of indexes) {\n\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\tthrow new ListError(this.user, `Invalid index ${index}`);\n\t\t\t}\n\t\t}\n\n\t\tthis.focus.set(indexes, browserEvent);\n\t}\n\n\tfocusNext(n = 1, loop = false, browserEvent?: UIEvent, filter?: (element: T) => boolean): void {\n\t\tif (this.length === 0) { return; }\n\n\t\tconst focus = this.focus.get();\n\t\tconst index = this.findNextIndex(focus.length > 0 ? focus[0] + n : 0, loop, filter);\n\n\t\tif (index > -1) {\n\t\t\tthis.setFocus([index], browserEvent);\n\t\t}\n\t}\n\n\tfocusPrevious(n = 1, loop = false, browserEvent?: UIEvent, filter?: (element: T) => boolean): void {\n\t\tif (this.length === 0) { return; }\n\n\t\tconst focus = this.focus.get();\n\t\tconst index = this.findPreviousIndex(focus.length > 0 ? focus[0] - n : 0, loop, filter);\n\n\t\tif (index > -1) {\n\t\t\tthis.setFocus([index], browserEvent);\n\t\t}\n\t}\n\n\tasync focusNextPage(browserEvent?: UIEvent, filter?: (element: T) => boolean): Promise<void> {\n\t\tlet lastPageIndex = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight);\n\t\tlastPageIndex = lastPageIndex === 0 ? 0 : lastPageIndex - 1;\n\t\tconst lastPageElement = this.view.element(lastPageIndex);\n\t\tconst currentlyFocusedElement = this.getFocusedElements()[0];\n\n\t\tif (currentlyFocusedElement !== lastPageElement) {\n\t\t\tconst lastGoodPageIndex = this.findPreviousIndex(lastPageIndex, false, filter);\n\n\t\t\tif (lastGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(lastGoodPageIndex)) {\n\t\t\t\tthis.setFocus([lastGoodPageIndex], browserEvent);\n\t\t\t} else {\n\t\t\t\tthis.setFocus([lastPageIndex], browserEvent);\n\t\t\t}\n\t\t} else {\n\t\t\tconst previousScrollTop = this.view.getScrollTop();\n\t\t\tthis.view.setScrollTop(previousScrollTop + this.view.renderHeight - this.view.elementHeight(lastPageIndex));\n\n\t\t\tif (this.view.getScrollTop() !== previousScrollTop) {\n\t\t\t\tthis.setFocus([]);\n\n\t\t\t\t// Let the scroll event listener run\n\t\t\t\tawait timeout(0);\n\t\t\t\tawait this.focusNextPage(browserEvent, filter);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync focusPreviousPage(browserEvent?: UIEvent, filter?: (element: T) => boolean): Promise<void> {\n\t\tlet firstPageIndex: number;\n\t\tconst scrollTop = this.view.getScrollTop();\n\n\t\tif (scrollTop === 0) {\n\t\t\tfirstPageIndex = this.view.indexAt(scrollTop);\n\t\t} else {\n\t\t\tfirstPageIndex = this.view.indexAfter(scrollTop - 1);\n\t\t}\n\n\t\tconst firstPageElement = this.view.element(firstPageIndex);\n\t\tconst currentlyFocusedElement = this.getFocusedElements()[0];\n\n\t\tif (currentlyFocusedElement !== firstPageElement) {\n\t\t\tconst firstGoodPageIndex = this.findNextIndex(firstPageIndex, false, filter);\n\n\t\t\tif (firstGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(firstGoodPageIndex)) {\n\t\t\t\tthis.setFocus([firstGoodPageIndex], browserEvent);\n\t\t\t} else {\n\t\t\t\tthis.setFocus([firstPageIndex], browserEvent);\n\t\t\t}\n\t\t} else {\n\t\t\tconst previousScrollTop = scrollTop;\n\t\t\tthis.view.setScrollTop(scrollTop - this.view.renderHeight);\n\n\t\t\tif (this.view.getScrollTop() !== previousScrollTop) {\n\t\t\t\tthis.setFocus([]);\n\n\t\t\t\t// Let the scroll event listener run\n\t\t\t\tawait timeout(0);\n\t\t\t\tawait this.focusPreviousPage(browserEvent, filter);\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusLast(browserEvent?: UIEvent, filter?: (element: T) => boolean): void {\n\t\tif (this.length === 0) { return; }\n\n\t\tconst index = this.findPreviousIndex(this.length - 1, false, filter);\n\n\t\tif (index > -1) {\n\t\t\tthis.setFocus([index], browserEvent);\n\t\t}\n\t}\n\n\tfocusFirst(browserEvent?: UIEvent, filter?: (element: T) => boolean): void {\n\t\tthis.focusNth(0, browserEvent, filter);\n\t}\n\n\tfocusNth(n: number, browserEvent?: UIEvent, filter?: (element: T) => boolean): void {\n\t\tif (this.length === 0) { return; }\n\n\t\tconst index = this.findNextIndex(n, false, filter);\n\n\t\tif (index > -1) {\n\t\t\tthis.setFocus([index], browserEvent);\n\t\t}\n\t}\n\n\tprivate findNextIndex(index: number, loop = false, filter?: (element: T) => boolean): number {\n\t\tfor (let i = 0; i < this.length; i++) {\n\t\t\tif (index >= this.length && !loop) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tindex = index % this.length;\n\n\t\t\tif (!filter || filter(this.element(index))) {\n\t\t\t\treturn index;\n\t\t\t}\n\n\t\t\tindex++;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\tprivate findPreviousIndex(index: number, loop = false, filter?: (element: T) => boolean): number {\n\t\tfor (let i = 0; i < this.length; i++) {\n\t\t\tif (index < 0 && !loop) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tindex = (this.length + (index % this.length)) % this.length;\n\n\t\t\tif (!filter || filter(this.element(index))) {\n\t\t\t\treturn index;\n\t\t\t}\n\n\t\t\tindex--;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\tgetFocus(): number[] {\n\t\treturn this.focus.get();\n\t}\n\n\tgetFocusedElements(): T[] {\n\t\treturn this.getFocus().map(i => this.view.element(i));\n\t}\n\n\treveal(index: number, relativeTop?: number): void {\n\t\tif (index < 0 || index >= this.length) {\n\t\t\tthrow new ListError(this.user, `Invalid index ${index}`);\n\t\t}\n\n\t\tconst scrollTop = this.view.getScrollTop();\n\t\tconst elementTop = this.view.elementTop(index);\n\t\tconst elementHeight = this.view.elementHeight(index);\n\n\t\tif (isNumber(relativeTop)) {\n\t\t\t// y = mx + b\n\t\t\tconst m = elementHeight - this.view.renderHeight;\n\t\t\tthis.view.setScrollTop(m * clamp(relativeTop, 0, 1) + elementTop);\n\t\t} else {\n\t\t\tconst viewItemBottom = elementTop + elementHeight;\n\t\t\tconst scrollBottom = scrollTop + this.view.renderHeight;\n\n\t\t\tif (elementTop < scrollTop && viewItemBottom >= scrollBottom) {\n\t\t\t\t// The element is already overflowing the viewport, no-op\n\t\t\t} else if (elementTop < scrollTop || (viewItemBottom >= scrollBottom && elementHeight >= this.view.renderHeight)) {\n\t\t\t\tthis.view.setScrollTop(elementTop);\n\t\t\t} else if (viewItemBottom >= scrollBottom) {\n\t\t\t\tthis.view.setScrollTop(viewItemBottom - this.view.renderHeight);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the relative position of an element rendered in the list.\n\t * Returns `null` if the element isn't *entirely* in the visible viewport.\n\t */\n\tgetRelativeTop(index: number): number | null {\n\t\tif (index < 0 || index >= this.length) {\n\t\t\tthrow new ListError(this.user, `Invalid index ${index}`);\n\t\t}\n\n\t\tconst scrollTop = this.view.getScrollTop();\n\t\tconst elementTop = this.view.elementTop(index);\n\t\tconst elementHeight = this.view.elementHeight(index);\n\n\t\tif (elementTop < scrollTop || elementTop + elementHeight > scrollTop + this.view.renderHeight) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// y = mx + b\n\t\tconst m = elementHeight - this.view.renderHeight;\n\t\treturn Math.abs((scrollTop - elementTop) / m);\n\t}\n\n\tgetHTMLElement(): HTMLElement {\n\t\treturn this.view.domNode;\n\t}\n\n\tstyle(styles: IListStyles): void {\n\t\tthis.styleController.style(styles);\n\t}\n\n\tprivate toListEvent({ indexes, browserEvent }: ITraitChangeEvent) {\n\t\treturn { indexes, elements: indexes.map(i => this.view.element(i)), browserEvent };\n\t}\n\n\tprivate _onFocusChange(): void {\n\t\tconst focus = this.focus.get();\n\t\tthis.view.domNode.classList.toggle('element-focused', focus.length > 0);\n\t\tthis.onDidChangeActiveDescendant();\n\t}\n\n\tprivate onDidChangeActiveDescendant(): void {\n\t\tconst focus = this.focus.get();\n\n\t\tif (focus.length > 0) {\n\t\t\tlet id: string | undefined;\n\n\t\t\tif (this.accessibilityProvider?.getActiveDescendantId) {\n\t\t\t\tid = this.accessibilityProvider.getActiveDescendantId(this.view.element(focus[0]));\n\t\t\t}\n\n\t\t\tthis.view.domNode.setAttribute('aria-activedescendant', id || this.view.getElementDomId(focus[0]));\n\t\t} else {\n\t\t\tthis.view.domNode.removeAttribute('aria-activedescendant');\n\t\t}\n\t}\n\n\tprivate _onSelectionChange(): void {\n\t\tconst selection = this.selection.get();\n\n\t\tthis.view.domNode.classList.toggle('selection-none', selection.length === 0);\n\t\tthis.view.domNode.classList.toggle('selection-single', selection.length === 1);\n\t\tthis.view.domNode.classList.toggle('selection-multiple', selection.length > 1);\n\t}\n\n\tdispose(): void {\n\t\tthis._onDidDispose.fire();\n\t\tthis.disposables.dispose();\n\n\t\tthis._onDidDispose.dispose();\n\t}\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 { range } from 'vs/base/common/arrays';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { IPagedModel } from 'vs/base/common/paging';\nimport { IThemable } from 'vs/base/common/styler';\nimport 'vs/css!./list';\nimport { IListEvent, IListMouseEvent, IListRenderer, IListVirtualDelegate } from './list';\nimport { IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IListStyles, List } from './listWidget';\n\nexport interface IPagedRenderer<TElement, TTemplateData> extends IListRenderer<TElement, TTemplateData> {\n\trenderPlaceholder(index: number, templateData: TTemplateData): void;\n}\n\nexport interface ITemplateData<T> {\n\tdata?: T;\n\tdisposable?: IDisposable;\n}\n\nclass PagedRenderer<TElement, TTemplateData> implements IListRenderer<number, ITemplateData<TTemplateData>> {\n\n\tget templateId(): string { return this.renderer.templateId; }\n\n\tconstructor(\n\t\tprivate renderer: IPagedRenderer<TElement, TTemplateData>,\n\t\tprivate modelProvider: () => IPagedModel<TElement>\n\t) { }\n\n\trenderTemplate(container: HTMLElement): ITemplateData<TTemplateData> {\n\t\tconst data = this.renderer.renderTemplate(container);\n\t\treturn { data, disposable: Disposable.None };\n\t}\n\n\trenderElement(index: number, _: number, data: ITemplateData<TTemplateData>, height: number | undefined): void {\n\t\tif (data.disposable) {\n\t\t\tdata.disposable.dispose();\n\t\t}\n\n\t\tif (!data.data) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.modelProvider();\n\n\t\tif (model.isResolved(index)) {\n\t\t\treturn this.renderer.renderElement(model.get(index), index, data.data, height);\n\t\t}\n\n\t\tconst cts = new CancellationTokenSource();\n\t\tconst promise = model.resolve(index, cts.token);\n\t\tdata.disposable = { dispose: () => cts.cancel() };\n\n\t\tthis.renderer.renderPlaceholder(index, data.data);\n\t\tpromise.then(entry => this.renderer.renderElement(entry, index, data.data!, height));\n\t}\n\n\tdisposeTemplate(data: ITemplateData<TTemplateData>): void {\n\t\tif (data.disposable) {\n\t\t\tdata.disposable.dispose();\n\t\t\tdata.disposable = undefined;\n\t\t}\n\t\tif (data.data) {\n\t\t\tthis.renderer.disposeTemplate(data.data);\n\t\t\tdata.data = undefined;\n\t\t}\n\t}\n}\n\nclass PagedAccessibilityProvider<T> implements IListAccessibilityProvider<number> {\n\n\tconstructor(\n\t\tprivate modelProvider: () => IPagedModel<T>,\n\t\tprivate accessibilityProvider: IListAccessibilityProvider<T>\n\t) { }\n\n\tgetWidgetAriaLabel(): string {\n\t\treturn this.accessibilityProvider.getWidgetAriaLabel();\n\t}\n\n\tgetAriaLabel(index: number): string | null {\n\t\tconst model = this.modelProvider();\n\n\t\tif (!model.isResolved(index)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.accessibilityProvider.getAriaLabel(model.get(index));\n\t}\n}\n\nexport interface IPagedListOptions<T> {\n\treadonly keyboardSupport?: boolean;\n\treadonly accessibilityProvider?: IListAccessibilityProvider<T>;\n\treadonly horizontalScrolling?: boolean;\n}\n\nfunction fromPagedListOptions<T>(modelProvider: () => IPagedModel<T>, options: IPagedListOptions<T>): IListOptions<number> {\n\treturn {\n\t\t...options,\n\t\taccessibilityProvider: options.accessibilityProvider && new PagedAccessibilityProvider(modelProvider, options.accessibilityProvider)\n\t};\n}\n\nexport class PagedList<T> implements IThemable, IDisposable {\n\n\tprivate list: List<number>;\n\tprivate _model!: IPagedModel<T>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tvirtualDelegate: IListVirtualDelegate<number>,\n\t\trenderers: IPagedRenderer<T, any>[],\n\t\toptions: IPagedListOptions<T> = {}\n\t) {\n\t\tconst modelProvider = () => this.model;\n\t\tconst pagedRenderers = renderers.map(r => new PagedRenderer<T, ITemplateData<T>>(r, modelProvider));\n\t\tthis.list = new List(user, container, virtualDelegate, pagedRenderers, fromPagedListOptions(modelProvider, options));\n\t}\n\n\tupdateOptions(options: IListOptionsUpdate) {\n\t\tthis.list.updateOptions(options);\n\t}\n\n\tgetHTMLElement(): HTMLElement {\n\t\treturn this.list.getHTMLElement();\n\t}\n\n\tget onDidFocus(): Event<void> {\n\t\treturn this.list.onDidFocus;\n\t}\n\n\tget onDidDispose(): Event<void> {\n\t\treturn this.list.onDidDispose;\n\t}\n\n\tget onMouseDblClick(): Event<IListMouseEvent<T>> {\n\t\treturn Event.map(this.list.onMouseDblClick, ({ element, index, browserEvent }) => ({ element: element === undefined ? undefined : this._model.get(element), index, browserEvent }));\n\t}\n\n\tget onPointer(): Event<IListMouseEvent<T>> {\n\t\treturn Event.map(this.list.onPointer, ({ element, index, browserEvent }) => ({ element: element === undefined ? undefined : this._model.get(element), index, browserEvent }));\n\t}\n\n\tget onDidChangeSelection(): Event<IListEvent<T>> {\n\t\treturn Event.map(this.list.onDidChangeSelection, ({ elements, indexes, browserEvent }) => ({ elements: elements.map(e => this._model.get(e)), indexes, browserEvent }));\n\t}\n\n\tget model(): IPagedModel<T> {\n\t\treturn this._model;\n\t}\n\n\tset model(model: IPagedModel<T>) {\n\t\tthis._model = model;\n\t\tthis.list.splice(0, this.list.length, range(model.length));\n\t}\n\n\tgetFocus(): number[] {\n\t\treturn this.list.getFocus();\n\t}\n\n\tgetSelection(): number[] {\n\t\treturn this.list.getSelection();\n\t}\n\n\tgetSelectedElements(): T[] {\n\t\treturn this.getSelection().map(i => this.model.get(i));\n\t}\n\n\tstyle(styles: IListStyles): void {\n\t\tthis.list.style(styles);\n\t}\n\n\tdispose(): void {\n\t\tthis.list.dispose();\n\t}\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 { $, addDisposableListener, append, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';\nimport { ISashEvent as IBaseSashEvent, Orientation, Sash, SashState } from 'vs/base/browser/ui/sash/sash';\nimport { SmoothScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { pushToEnd, pushToStart, range } from 'vs/base/common/arrays';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { clamp } from 'vs/base/common/numbers';\nimport { Scrollable, ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\nimport * as types from 'vs/base/common/types';\nimport 'vs/css!./splitview';\nexport { Orientation } from 'vs/base/browser/ui/sash/sash';\n\nexport interface ISplitViewStyles {\n\treadonly separatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\n/**\n * The interface to implement for views within a {@link SplitView}.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n */\nexport interface IView<TLayoutContext = undefined> {\n\n\t/**\n\t * The DOM element for this view.\n\t */\n\treadonly element: HTMLElement;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `0`.\n\t */\n\treadonly minimumSize: number;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `Number.POSITIVE_INFINITY`.\n\t */\n\treadonly maximumSize: number;\n\n\t/**\n\t * The priority of the view when the {@link SplitView.resize layout} algorithm\n\t * runs. Views with higher priority will be resized first.\n\t *\n\t * @remarks Only used when `proportionalLayout` is false.\n\t */\n\treadonly priority?: LayoutPriority;\n\n\t/**\n\t * Whether the view will snap whenever the user reaches its minimum size or\n\t * attempts to grow it beyond the minimum size.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly snap?: boolean;\n\n\t/**\n\t * View instances are supposed to fire the {@link IView.onDidChange} event whenever\n\t * any of the constraint properties have changed:\n\t *\n\t * - {@link IView.minimumSize}\n\t * - {@link IView.maximumSize}\n\t * - {@link IView.priority}\n\t * - {@link IView.snap}\n\t *\n\t * The SplitView will relayout whenever that happens. The event can optionally emit\n\t * the view's preferred size for that relayout.\n\t */\n\treadonly onDidChange: Event<number | undefined>;\n\n\t/**\n\t * This will be called by the {@link SplitView} during layout. A view meant to\n\t * pass along the layout information down to its descendants.\n\t *\n\t * @param size The size of this view, in pixels.\n\t * @param offset The offset of this view, relative to the start of the {@link SplitView}.\n\t * @param context The optional {@link IView layout context} passed to {@link SplitView.layout}.\n\t */\n\tlayout(size: number, offset: number, context: TLayoutContext | undefined): void;\n\n\t/**\n\t * This will be called by the {@link SplitView} whenever this view is made\n\t * visible or hidden.\n\t *\n\t * @param visible Whether the view becomes visible.\n\t */\n\tsetVisible?(visible: boolean): void;\n}\n\n/**\n * A descriptor for a {@link SplitView} instance.\n */\nexport interface ISplitViewDescriptor<TLayoutContext = undefined> {\n\n\t/**\n\t * The layout size of the {@link SplitView}.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Descriptors for each {@link IView view}.\n\t */\n\treadonly views: {\n\n\t\t/**\n\t\t * Whether the {@link IView view} is visible.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly visible?: boolean;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly size: number;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly view: IView<TLayoutContext>;\n\t}[];\n}\n\nexport interface ISplitViewOptions<TLayoutContext = undefined> {\n\n\t/**\n\t * Which axis the views align on.\n\t *\n\t * @defaultValue `Orientation.VERTICAL`\n\t */\n\treadonly orientation?: Orientation;\n\n\t/**\n\t * Styles overriding the {@link defaultStyles default ones}.\n\t */\n\treadonly styles?: ISplitViewStyles;\n\n\t/**\n\t * Make Alt-drag the default drag operation.\n\t */\n\treadonly inverseAltBehavior?: boolean;\n\n\t/**\n\t * Resize each view proportionally when resizing the SplitView.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * An initial description of this {@link SplitView} instance, allowing\n\t * to initialze all views within the ctor.\n\t */\n\treadonly descriptor?: ISplitViewDescriptor<TLayoutContext>;\n\n\t/**\n\t * The scrollbar visibility setting for whenever the views within\n\t * the {@link SplitView} overflow.\n\t */\n\treadonly scrollbarVisibility?: ScrollbarVisibility;\n\n\t/**\n\t * Override the orthogonal size of sashes.\n\t */\n\treadonly getSashOrthogonalSize?: () => number;\n}\n\ninterface ISashEvent {\n\treadonly sash: Sash;\n\treadonly start: number;\n\treadonly current: number;\n\treadonly alt: boolean;\n}\n\ntype ViewItemSize = number | { cachedVisibleSize: number };\n\nabstract class ViewItem<TLayoutContext> {\n\n\tprivate _size: number;\n\tset size(size: number) {\n\t\tthis._size = size;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tprivate _cachedVisibleSize: number | undefined = undefined;\n\n\tget visible(): boolean {\n\t\treturn typeof this._cachedVisibleSize === 'undefined';\n\t}\n\n\tsetVisible(visible: boolean, size?: number): void {\n\t\tif (visible === this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (visible) {\n\t\t\tthis.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t} else {\n\t\t\tthis._cachedVisibleSize = typeof size === 'number' ? size : this.size;\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tthis.container.classList.toggle('visible', visible);\n\n\t\tif (this.view.setVisible) {\n\t\t\tthis.view.setVisible(visible);\n\t\t}\n\t}\n\n\tget minimumSize(): number { return this.visible ? this.view.minimumSize : 0; }\n\tget viewMinimumSize(): number { return this.view.minimumSize; }\n\n\tget maximumSize(): number { return this.visible ? this.view.maximumSize : 0; }\n\tget viewMaximumSize(): number { return this.view.maximumSize; }\n\n\tget priority(): LayoutPriority | undefined { return this.view.priority; }\n\tget snap(): boolean { return !!this.view.snap; }\n\n\tset enabled(enabled: boolean) {\n\t\tthis.container.style.pointerEvents = enabled ? '' : 'none';\n\t}\n\n\tconstructor(\n\t\tprotected container: HTMLElement,\n\t\tprivate view: IView<TLayoutContext>,\n\t\tsize: ViewItemSize,\n\t\tprivate disposable: IDisposable\n\t) {\n\t\tif (typeof size === 'number') {\n\t\t\tthis._size = size;\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t\tcontainer.classList.add('visible');\n\t\t} else {\n\t\t\tthis._size = 0;\n\t\t\tthis._cachedVisibleSize = size.cachedVisibleSize;\n\t\t}\n\t}\n\n\tlayout(offset: number, layoutContext: TLayoutContext | undefined): void {\n\t\tthis.layoutContainer(offset);\n\t\tthis.view.layout(this.size, offset, layoutContext);\n\t}\n\n\tabstract layoutContainer(offset: number): void;\n\n\tdispose(): IView<TLayoutContext> {\n\t\tthis.disposable.dispose();\n\t\treturn this.view;\n\t}\n}\n\nclass VerticalViewItem<TLayoutContext> extends ViewItem<TLayoutContext> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.top = `${offset}px`;\n\t\tthis.container.style.height = `${this.size}px`;\n\t}\n}\n\nclass HorizontalViewItem<TLayoutContext> extends ViewItem<TLayoutContext> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.left = `${offset}px`;\n\t\tthis.container.style.width = `${this.size}px`;\n\t}\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\n}\n\ninterface ISashDragSnapState {\n\treadonly index: number;\n\treadonly limitDelta: number;\n\treadonly size: number;\n}\n\ninterface ISashDragState {\n\tindex: number;\n\tstart: number;\n\tcurrent: number;\n\tsizes: number[];\n\tminDelta: number;\n\tmaxDelta: number;\n\talt: boolean;\n\tsnapBefore: ISashDragSnapState | undefined;\n\tsnapAfter: ISashDragSnapState | undefined;\n\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\n/**\n * When adding or removing views, distribute the delta space among\n * all other views.\n */\nexport type DistributeSizing = { type: 'distribute' };\n\n/**\n * When adding or removing views, split the delta space with another\n * specific view, indexed by the provided `index`.\n */\nexport type SplitSizing = { type: 'split'; index: number };\n\n/**\n * When adding or removing views, assume the view is invisible.\n */\nexport type InvisibleSizing = { type: 'invisible'; cachedVisibleSize: number };\n\n/**\n * When adding or removing views, the sizing provides fine grained\n * control over how other views get resized.\n */\nexport type Sizing = DistributeSizing | SplitSizing | InvisibleSizing;\n\nexport namespace Sizing {\n\n\t/**\n\t * When adding or removing views, distribute the delta space among\n\t * all other views.\n\t */\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\n\t/**\n\t * When adding or removing views, split the delta space with another\n\t * specific view, indexed by the provided `index`.\n\t */\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n\n\t/**\n\t * When adding or removing views, assume the view is invisible.\n\t */\n\texport function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; }\n}\n\n/**\n * The {@link SplitView} is the UI component which implements a one dimensional\n * flex-like layout algorithm for a collection of {@link IView} instances, which\n * are essentially HTMLElement instances with the following size constraints:\n *\n * - {@link IView.minimumSize}\n * - {@link IView.maximumSize}\n * - {@link IView.priority}\n * - {@link IView.snap}\n *\n * In case the SplitView doesn't have enough size to fit all views, it will overflow\n * its content with a scrollbar.\n *\n * In between each pair of views there will be a {@link Sash} allowing the user\n * to resize the views, making sure the constraints are respected.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n *\n * Features:\n * - Flex-like layout algorithm\n * - Snap support\n * - Orthogonal sash support, for corner sashes\n * - View hide/show support\n * - View swap/move support\n * - Alt key modifier behavior, macOS style\n */\nexport class SplitView<TLayoutContext = undefined> extends Disposable {\n\n\t/**\n\t * This {@link SplitView}'s orientation.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The DOM element representing this {@link SplitView}.\n\t */\n\treadonly el: HTMLElement;\n\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate size = 0;\n\tprivate layoutContext: TLayoutContext | undefined;\n\tprivate contentSize = 0;\n\tprivate proportions: undefined | number[] = undefined;\n\tprivate viewItems: ViewItem<TLayoutContext>[] = [];\n\tprivate sashItems: ISashItem[] = [];\n\tprivate sashDragState: ISashDragState | undefined;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\tprivate readonly getSashOrthogonalSize: { (): number } | undefined;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate _startSnappingEnabled = true;\n\tprivate _endSnappingEnabled = true;\n\n\t/**\n\t * Fires whenever the user resizes a {@link Sash sash}.\n\t */\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\t/**\n\t * Fires whenever the user double clicks a {@link Sash sash}.\n\t */\n\treadonly onDidSashReset = this._onDidSashReset.event;\n\n\t/**\n\t * Fires whenever the split view is scrolled.\n\t */\n\treadonly onDidScroll: Event<ScrollEvent>;\n\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tget startSnappingEnabled(): boolean { return this._startSnappingEnabled; }\n\tget endSnappingEnabled(): boolean { return this._endSnappingEnabled; }\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the left- or top-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalStartSash = sash;\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the right- or bottom-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalEndSash = sash;\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Enable/disable snapping at the beginning of this {@link SplitView}.\n\t */\n\tset startSnappingEnabled(startSnappingEnabled: boolean) {\n\t\tif (this._startSnappingEnabled === startSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startSnappingEnabled = startSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Enable/disable snapping at the end of this {@link SplitView}.\n\t */\n\tset endSnappingEnabled(endSnappingEnabled: boolean) {\n\t\tif (this._endSnappingEnabled === endSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._endSnappingEnabled = endSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Create a new {@link SplitView} instance.\n\t */\n\tconstructor(container: HTMLElement, options: ISplitViewOptions<TLayoutContext> = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = options.orientation ?? Orientation.VERTICAL;\n\t\tthis.inverseAltBehavior = options.inverseAltBehavior ?? false;\n\t\tthis.proportionalLayout = options.proportionalLayout ?? true;\n\t\tthis.getSashOrthogonalSize = options.getSashOrthogonalSize;\n\n\t\tthis.el = document.createElement('div');\n\t\tthis.el.classList.add('monaco-split-view2');\n\t\tthis.el.classList.add(this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = append(this.el, $('.sash-container'));\n\t\tthis.viewContainer = $('.split-view-container');\n\n\t\tthis.scrollable = new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 125,\n\t\t\tscheduleAtNextAnimationFrame\n\t\t});\n\t\tthis.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {\n\t\t\tvertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,\n\t\t\thorizontal: this.orientation === Orientation.HORIZONTAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden\n\t\t}, this.scrollable));\n\n\t\tthis.onDidScroll = this.scrollableElement.onScroll;\n\t\tthis._register(this.onDidScroll(e => {\n\t\t\tthis.viewContainer.scrollTop = e.scrollTop;\n\t\t\tthis.viewContainer.scrollLeft = e.scrollLeft;\n\t\t}));\n\n\t\tappend(this.el, this.scrollableElement.getDomNode());\n\n\t\tthis.style(options.styles || defaultStyles);\n\n\t\t// We have an existing set of view, add them now\n\t\tif (options.descriptor) {\n\t\t\tthis.size = options.descriptor.size;\n\t\t\toptions.descriptor.views.forEach((viewDescriptor, index) => {\n\t\t\t\tconst sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } as InvisibleSizing;\n\n\t\t\t\tconst view = viewDescriptor.view;\n\t\t\t\tthis.doAddView(view, sizing, index, true);\n\t\t\t});\n\n\t\t\t// Initialize content size and proportions for first layout\n\t\t\tthis.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tthis.el.classList.remove('separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tthis.el.classList.add('separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\t/**\n\t * Add a {@link IView view} to this {@link SplitView}.\n\t *\n\t * @param view The view to add.\n\t * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.\n\t * @param index The index to insert the view on.\n\t * @param skipLayout Whether layout should be skipped.\n\t */\n\taddView(view: IView<TLayoutContext>, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tthis.doAddView(view, size, index, skipLayout);\n\t}\n\n\t/**\n\t * Layout the {@link SplitView}.\n\t *\n\t * @param size The entire size of the {@link SplitView}.\n\t * @param layoutContext An optional layout context to pass along to {@link IView views}.\n\t */\n\tlayout(size: number, layoutContext?: TLayoutContext): void {\n\t\tconst previousSize = Math.max(this.size, this.contentSize);\n\t\tthis.size = size;\n\t\tthis.layoutContext = layoutContext;\n\n\t\tif (!this.proportions) {\n\t\t\tconst indexes = range(this.viewItems.length);\n\t\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\t} else {\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\titem.size = clamp(Math.round(this.proportions[i] * size), item.minimumSize, item.maximumSize);\n\t\t\t}\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate saveProportions(): void {\n\t\tif (this.proportionalLayout && this.contentSize > 0) {\n\t\t\tthis.proportions = this.viewItems.map(i => i.size / this.contentSize);\n\t\t}\n\t}\n\n\tprivate onSashStart({ sash, start, alt }: ISashEvent): void {\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = false;\n\t\t}\n\n\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\n\t\t// This way, we can press Alt while we resize a sash, macOS style!\n\t\tconst disposable = combinedDisposable(\n\t\t\taddDisposableListener(document.body, 'keydown', e => resetSashDragState(this.sashDragState!.current, e.altKey)),\n\t\t\taddDisposableListener(document.body, 'keyup', () => resetSashDragState(this.sashDragState!.current, false))\n\t\t);\n\n\t\tconst resetSashDragState = (start: number, alt: boolean) => {\n\t\t\tconst sizes = this.viewItems.map(i => i.size);\n\t\t\tlet minDelta = Number.NEGATIVE_INFINITY;\n\t\t\tlet maxDelta = Number.POSITIVE_INFINITY;\n\n\t\t\tif (this.inverseAltBehavior) {\n\t\t\t\talt = !alt;\n\t\t\t}\n\n\t\t\tif (alt) {\n\t\t\t\t// When we're using the last sash with Alt, we're resizing\n\t\t\t\t// the view to the left/up, instead of right/down as usual\n\t\t\t\t// Thus, we must do the inverse of the usual\n\t\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\n\t\t\t\tif (isLastSash) {\n\t\t\t\t\tconst viewItem = this.viewItems[index];\n\t\t\t\t\tminDelta = (viewItem.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.maximumSize - viewItem.size) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tconst viewItem = this.viewItems[index + 1];\n\t\t\t\t\tminDelta = (viewItem.size - viewItem.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet snapBefore: ISashDragSnapState | undefined;\n\t\t\tlet snapAfter: ISashDragSnapState | undefined;\n\n\t\t\tif (!alt) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\t\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0);\n\t\t\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown);\n\t\t\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapBeforeIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapBefore = {\n\t\t\t\t\t\tindex: snapBeforeIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapAfterIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapAfter = {\n\t\t\t\t\t\tindex: snapAfterIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable };\n\t\t};\n\n\t\tresetSashDragState(start, alt);\n\t}\n\n\tprivate onSashChange({ current }: ISashEvent): void {\n\t\tconst { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState!;\n\t\tthis.sashDragState!.current = current;\n\n\t\tconst delta = current - start;\n\t\tconst newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter);\n\n\t\tif (alt) {\n\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\t\t\tconst newSizes = this.viewItems.map(i => i.size);\n\t\t\tconst viewItemIndex = isLastSash ? index : index + 1;\n\t\t\tconst viewItem = this.viewItems[viewItemIndex];\n\t\t\tconst newMinDelta = viewItem.size - viewItem.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.minimumSize;\n\t\t\tconst resizeIndex = isLastSash ? index - 1 : index + 1;\n\n\t\t\tthis.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate onSashEnd(index: number): void {\n\t\tthis._onDidSashChange.fire(index);\n\t\tthis.sashDragState!.disposable.dispose();\n\t\tthis.saveProportions();\n\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = true;\n\t\t}\n\t}\n\n\tprivate onViewChange(item: ViewItem<TLayoutContext>, size: number | undefined): void {\n\t\tconst index = this.viewItems.indexOf(item);\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsize = typeof size === 'number' ? size : item.size;\n\t\tsize = clamp(size, item.minimumSize, item.maximumSize);\n\n\t\tif (this.inverseAltBehavior && index > 0) {\n\t\t\t// In this case, we want the view to grow or shrink both sides equally\n\t\t\t// so we just resize the \"left\" side by half and let `resize` do the clamping magic\n\t\t\tthis.resize(index - 1, Math.floor((item.size - size) / 2));\n\t\t\tthis.distributeEmptySpace();\n\t\t\tthis.layoutViews();\n\t\t} else {\n\t\t\titem.size = size;\n\t\t\tthis.relayout([index], undefined);\n\t\t}\n\t}\n\n\t/**\n\t * Resize a {@link IView view} within the {@link SplitView}.\n\t *\n\t * @param index The {@link IView view} index.\n\t * @param size The {@link IView view} size.\n\t */\n\tresizeView(index: number, size: number): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tconst item = this.viewItems[index];\n\t\tsize = Math.round(size);\n\t\tsize = clamp(size, item.minimumSize, Math.min(item.maximumSize, this.size));\n\n\t\titem.size = size;\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.state = State.Idle;\n\t}\n\n\t/**\n\t * Distribute the entire {@link SplitView} size among all {@link IView views}.\n\t */\n\tdistributeViewSizes(): void {\n\t\tconst flexibleViewItems: ViewItem<TLayoutContext>[] = [];\n\t\tlet flexibleSize = 0;\n\n\t\tfor (const item of this.viewItems) {\n\t\t\tif (item.maximumSize - item.minimumSize > 0) {\n\t\t\t\tflexibleViewItems.push(item);\n\t\t\t\tflexibleSize += item.size;\n\t\t\t}\n\t\t}\n\n\t\tconst size = Math.floor(flexibleSize / flexibleViewItems.length);\n\n\t\tfor (const item of flexibleViewItems) {\n\t\t\titem.size = clamp(size, item.minimumSize, item.maximumSize);\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t}\n\n\t/**\n\t * Returns the size of a {@link IView view}.\n\t */\n\tgetViewSize(index: number): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this.viewItems[index].size;\n\t}\n\n\tprivate doAddView(view: IView<TLayoutContext>, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\t// Add view\n\t\tconst container = $('.split-view-view');\n\n\t\tif (index === this.viewItems.length) {\n\t\t\tthis.viewContainer.appendChild(container);\n\t\t} else {\n\t\t\tthis.viewContainer.insertBefore(container, this.viewContainer.children.item(index));\n\t\t}\n\n\t\tconst onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size));\n\t\tconst containerDisposable = toDisposable(() => this.viewContainer.removeChild(container));\n\t\tconst disposable = combinedDisposable(onChangeDisposable, containerDisposable);\n\n\t\tlet viewSize: ViewItemSize;\n\n\t\tif (typeof size === 'number') {\n\t\t\tviewSize = size;\n\t\t} else if (size.type === 'split') {\n\t\t\tviewSize = this.getViewSize(size.index) / 2;\n\t\t} else if (size.type === 'invisible') {\n\t\t\tviewSize = { cachedVisibleSize: size.cachedVisibleSize };\n\t\t} else {\n\t\t\tviewSize = view.minimumSize;\n\t\t}\n\n\t\tconst item = this.orientation === Orientation.VERTICAL\n\t\t\t? new VerticalViewItem(container, view, viewSize, disposable)\n\t\t\t: new HorizontalViewItem(container, view, viewSize, disposable);\n\n\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t// Add sash\n\t\tif (this.viewItems.length > 1) {\n\t\t\tlet opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash };\n\n\t\t\tconst sash = this.orientation === Orientation.VERTICAL\n\t\t\t\t? new Sash(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.HORIZONTAL })\n\t\t\t\t: new Sash(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.VERTICAL });\n\n\t\t\tconst sashEventMapper = this.orientation === Orientation.VERTICAL\n\t\t\t\t? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })\n\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });\n\n\t\t\tconst onStart = Event.map(sash.onDidStart, sashEventMapper);\n\t\t\tconst onStartDisposable = onStart(this.onSashStart, this);\n\t\t\tconst onChange = Event.map(sash.onDidChange, sashEventMapper);\n\t\t\tconst onChangeDisposable = onChange(this.onSashChange, this);\n\t\t\tconst onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash));\n\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\n\t\t\tconst onDidResetDisposable = sash.onDidReset(() => {\n\t\t\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidSashReset.fire(index);\n\t\t\t});\n\n\t\t\tconst disposable = combinedDisposable(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash);\n\t\t\tconst sashItem: ISashItem = { sash, disposable };\n\n\t\t\tthis.sashItems.splice(index - 1, 0, sashItem);\n\t\t}\n\n\t\tcontainer.appendChild(view.element);\n\n\t\tlet highPriorityIndexes: number[] | undefined;\n\n\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\thighPriorityIndexes = [size.index];\n\t\t}\n\n\t\tif (!skipLayout) {\n\t\t\tthis.relayout([index], highPriorityIndexes);\n\t\t}\n\n\t\tthis.state = State.Idle;\n\n\t\tif (!skipLayout && typeof size !== 'number' && size.type === 'distribute') {\n\t\t\tthis.distributeViewSizes();\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[]): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\tthis.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t\tthis.saveProportions();\n\t}\n\n\tprivate resize(\n\t\tindex: number,\n\t\tdelta: number,\n\t\tsizes = this.viewItems.map(i => i.size),\n\t\tlowPriorityIndexes?: number[],\n\t\thighPriorityIndexes?: number[],\n\t\toverloadMinDelta: number = Number.NEGATIVE_INFINITY,\n\t\toverloadMaxDelta: number = Number.POSITIVE_INFINITY,\n\t\tsnapBefore?: ISashDragSnapState,\n\t\tsnapAfter?: ISashDragSnapState\n\t): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst upIndexes = range(index, -1);\n\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\n\t\tif (highPriorityIndexes) {\n\t\t\tfor (const index of highPriorityIndexes) {\n\t\t\t\tpushToStart(upIndexes, index);\n\t\t\t\tpushToStart(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tif (lowPriorityIndexes) {\n\t\t\tfor (const index of lowPriorityIndexes) {\n\t\t\t\tpushToEnd(upIndexes, index);\n\t\t\t\tpushToEnd(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tconst upItems = upIndexes.map(i => this.viewItems[i]);\n\t\tconst upSizes = upIndexes.map(i => sizes[i]);\n\n\t\tconst downItems = downIndexes.map(i => this.viewItems[i]);\n\t\tconst downSizes = downIndexes.map(i => sizes[i]);\n\n\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\n\n\t\tlet snapped = false;\n\n\t\tif (snapBefore) {\n\t\t\tconst snapView = this.viewItems[snapBefore.index];\n\t\t\tconst visible = delta >= snapBefore.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapBefore.size);\n\t\t}\n\n\t\tif (!snapped && snapAfter) {\n\t\t\tconst snapView = this.viewItems[snapAfter.index];\n\t\t\tconst visible = delta < snapAfter.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapAfter.size);\n\t\t}\n\n\t\tif (snapped) {\n\t\t\treturn this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);\n\t\t}\n\n\t\tdelta = clamp(delta, minDelta, maxDelta);\n\n\t\tfor (let i = 0, deltaUp = delta; i < upItems.length; i++) {\n\t\t\tconst item = upItems[i];\n\t\t\tconst size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - upSizes[i];\n\n\t\t\tdeltaUp -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\tfor (let i = 0, deltaDown = delta; i < downItems.length; i++) {\n\t\t\tconst item = downItems[i];\n\t\t\tconst size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - downSizes[i];\n\n\t\t\tdeltaDown += viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\tprivate distributeEmptySpace(lowPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tconst indexes = range(this.viewItems.length - 1, -1);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tfor (const index of highPriorityIndexes) {\n\t\t\tpushToStart(indexes, index);\n\t\t}\n\n\t\tfor (const index of lowPriorityIndexes) {\n\t\t\tpushToEnd(indexes, index);\n\t\t}\n\n\t\tif (typeof lowPriorityIndex === 'number') {\n\t\t\tpushToEnd(indexes, lowPriorityIndex);\n\t\t}\n\n\t\tfor (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {\n\t\t\tconst item = this.viewItems[indexes[i]];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - item.size;\n\n\t\t\temptyDelta -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\t}\n\n\tprivate layoutViews(): void {\n\t\t// Save new content size\n\t\tthis.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\t// Layout views\n\t\tlet offset = 0;\n\n\t\tfor (const viewItem of this.viewItems) {\n\t\t\tviewItem.layout(offset, this.layoutContext);\n\t\t\toffset += viewItem.size;\n\t\t}\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\t\tthis.updateSashEnablement();\n\t\tthis.updateScrollableElement();\n\t}\n\n\tprivate updateScrollableElement(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\theight: this.size,\n\t\t\t\tscrollHeight: this.contentSize\n\t\t\t});\n\t\t} else {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: this.size,\n\t\t\t\tscrollWidth: this.contentSize\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateSashEnablement(): void {\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous);\n\n\t\tconst reverseViews = [...this.viewItems].reverse();\n\t\tprevious = false;\n\t\tconst collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tlet position = 0;\n\t\tfor (let index = 0; index < this.sashItems.length; index++) {\n\t\t\tconst { sash } = this.sashItems[index];\n\t\t\tconst viewItem = this.viewItems[index];\n\t\t\tposition += viewItem.size;\n\n\t\t\tconst min = !(collapsesDown[index] && expandsUp[index + 1]);\n\t\t\tconst max = !(expandsDown[index] && collapsesUp[index + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tconst snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible;\n\t\t\t\tconst snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible;\n\n\t\t\t\tif (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t\t} else if (snappedAfter && collapsesDown[index] && (position < this.contentSize || this.endSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t\t} else {\n\t\t\t\t\tsash.state = SashState.Disabled;\n\t\t\t\t}\n\t\t\t} else if (min && !max) {\n\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t} else {\n\t\t\t\tsash.state = SashState.Enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSashPosition(sash: Sash): number {\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.sashItems.length; i++) {\n\t\t\tposition += this.viewItems[i].size;\n\n\t\t\tif (this.sashItems[i].sash === sash) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate findFirstSnapIndex(indexes: number[]): number | undefined {\n\t\t// visible views first\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (!viewItem.visible) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\t// then, hidden views\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!viewItem.visible && viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis.sashItems.forEach(i => i.disposable.dispose());\n\t\tthis.sashItems = [];\n\t}\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 { $, append, clearNode, createStyleSheet } from 'vs/base/browser/dom';\nimport { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { IListOptions, IListOptionsUpdate, IListStyles, List } from 'vs/base/browser/ui/list/listWidget';\nimport { ISplitViewDescriptor, IView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';\nimport { ITableColumn, ITableEvent, ITableMouseEvent, ITableRenderer, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { IThemable } from 'vs/base/common/styler';\nimport 'vs/css!./table';\n\n// TODO@joao\ntype TCell = any;\n\ninterface RowTemplateData {\n\treadonly container: HTMLElement;\n\treadonly cellContainers: HTMLElement[];\n\treadonly cellTemplateData: unknown[];\n}\n\nclass TableListRenderer<TRow> implements IListRenderer<TRow, RowTemplateData> {\n\n\tstatic TemplateId = 'row';\n\treadonly templateId = TableListRenderer.TemplateId;\n\tprivate renderers: ITableRenderer<TCell, unknown>[];\n\tprivate renderedTemplates = new Set<RowTemplateData>();\n\n\tconstructor(\n\t\tprivate columns: ITableColumn<TRow, TCell>[],\n\t\trenderers: ITableRenderer<TCell, unknown>[],\n\t\tprivate getColumnSize: (index: number) => number\n\t) {\n\t\tconst rendererMap = new Map(renderers.map(r => [r.templateId, r]));\n\t\tthis.renderers = [];\n\n\t\tfor (const column of columns) {\n\t\t\tconst renderer = rendererMap.get(column.templateId);\n\n\t\t\tif (!renderer) {\n\t\t\t\tthrow new Error(`Table cell renderer for template id ${column.templateId} not found.`);\n\t\t\t}\n\n\t\t\tthis.renderers.push(renderer);\n\t\t}\n\t}\n\n\trenderTemplate(container: HTMLElement) {\n\t\tconst rowContainer = append(container, $('.monaco-table-tr'));\n\t\tconst cellContainers: HTMLElement[] = [];\n\t\tconst cellTemplateData: unknown[] = [];\n\n\t\tfor (let i = 0; i < this.columns.length; i++) {\n\t\t\tconst renderer = this.renderers[i];\n\t\t\tconst cellContainer = append(rowContainer, $('.monaco-table-td', { 'data-col-index': i }));\n\n\t\t\tcellContainer.style.width = `${this.getColumnSize(i)}px`;\n\t\t\tcellContainers.push(cellContainer);\n\t\t\tcellTemplateData.push(renderer.renderTemplate(cellContainer));\n\t\t}\n\n\t\tconst result = { container, cellContainers, cellTemplateData };\n\t\tthis.renderedTemplates.add(result);\n\n\t\treturn result;\n\t}\n\n\trenderElement(element: TRow, index: number, templateData: RowTemplateData, height: number | undefined): void {\n\t\tfor (let i = 0; i < this.columns.length; i++) {\n\t\t\tconst column = this.columns[i];\n\t\t\tconst cell = column.project(element);\n\t\t\tconst renderer = this.renderers[i];\n\t\t\trenderer.renderElement(cell, index, templateData.cellTemplateData[i], height);\n\t\t}\n\t}\n\n\tdisposeElement(element: TRow, index: number, templateData: RowTemplateData, height: number | undefined): void {\n\t\tfor (let i = 0; i < this.columns.length; i++) {\n\t\t\tconst renderer = this.renderers[i];\n\n\t\t\tif (renderer.disposeElement) {\n\t\t\t\tconst column = this.columns[i];\n\t\t\t\tconst cell = column.project(element);\n\n\t\t\t\trenderer.disposeElement(cell, index, templateData.cellTemplateData[i], height);\n\t\t\t}\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: RowTemplateData): void {\n\t\tfor (let i = 0; i < this.columns.length; i++) {\n\t\t\tconst renderer = this.renderers[i];\n\t\t\trenderer.disposeTemplate(templateData.cellTemplateData[i]);\n\t\t}\n\n\t\tclearNode(templateData.container);\n\t\tthis.renderedTemplates.delete(templateData);\n\t}\n\n\tlayoutColumn(index: number, size: number): void {\n\t\tfor (const { cellContainers } of this.renderedTemplates) {\n\t\t\tcellContainers[index].style.width = `${size}px`;\n\t\t}\n\t}\n}\n\nfunction asListVirtualDelegate<TRow>(delegate: ITableVirtualDelegate<TRow>): IListVirtualDelegate<TRow> {\n\treturn {\n\t\tgetHeight(row) { return delegate.getHeight(row); },\n\t\tgetTemplateId() { return TableListRenderer.TemplateId; },\n\t};\n}\n\nclass ColumnHeader<TRow, TCell> implements IView {\n\n\treadonly element: HTMLElement;\n\n\tget minimumSize() { return this.column.minimumWidth ?? 120; }\n\tget maximumSize() { return this.column.maximumWidth ?? Number.POSITIVE_INFINITY; }\n\tget onDidChange() { return this.column.onDidChangeWidthConstraints ?? Event.None; }\n\n\tprivate _onDidLayout = new Emitter<[number, number]>();\n\treadonly onDidLayout = this._onDidLayout.event;\n\n\tconstructor(readonly column: ITableColumn<TRow, TCell>, private index: number) {\n\t\tthis.element = $('.monaco-table-th', { 'data-col-index': index, title: column.tooltip }, column.label);\n\t}\n\n\tlayout(size: number): void {\n\t\tthis._onDidLayout.fire([this.index, size]);\n\t}\n}\n\nexport interface ITableOptions<TRow> extends IListOptions<TRow> { }\nexport interface ITableOptionsUpdate extends IListOptionsUpdate { }\nexport interface ITableStyles extends IListStyles { }\n\nexport class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {\n\n\tprivate static InstanceCount = 0;\n\treadonly domId = `table_id_${++Table.InstanceCount}`;\n\n\treadonly domNode: HTMLElement;\n\tprivate splitview: SplitView;\n\tprivate list: List<TRow>;\n\tprivate styleElement: HTMLStyleElement;\n\tprotected readonly disposables = new DisposableStore();\n\n\tprivate cachedWidth: number = 0;\n\tprivate cachedHeight: number = 0;\n\n\tget onDidChangeFocus(): Event<ITableEvent<TRow>> { return this.list.onDidChangeFocus; }\n\tget onDidChangeSelection(): Event<ITableEvent<TRow>> { return this.list.onDidChangeSelection; }\n\tget onMouseDblClick(): Event<ITableMouseEvent<TRow>> { return this.list.onMouseDblClick; }\n\tget onPointer(): Event<ITableMouseEvent<TRow>> { return this.list.onPointer; }\n\n\tget onDidFocus(): Event<void> { return this.list.onDidFocus; }\n\tget onDidDispose(): Event<void> { return this.list.onDidDispose; }\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tprivate virtualDelegate: ITableVirtualDelegate<TRow>,\n\t\tcolumns: ITableColumn<TRow, TCell>[],\n\t\trenderers: ITableRenderer<TCell, unknown>[],\n\t\t_options?: ITableOptions<TRow>\n\t) {\n\t\tthis.domNode = append(container, $(`.monaco-table.${this.domId}`));\n\n\t\tconst headers = columns.map((c, i) => new ColumnHeader(c, i));\n\t\tconst descriptor: ISplitViewDescriptor = {\n\t\t\tsize: headers.reduce((a, b) => a + b.column.weight, 0),\n\t\t\tviews: headers.map(view => ({ size: view.column.weight, view }))\n\t\t};\n\n\t\tthis.splitview = this.disposables.add(new SplitView(this.domNode, {\n\t\t\torientation: Orientation.HORIZONTAL,\n\t\t\tscrollbarVisibility: ScrollbarVisibility.Hidden,\n\t\t\tgetSashOrthogonalSize: () => this.cachedHeight,\n\t\t\tdescriptor\n\t\t}));\n\n\t\tthis.splitview.el.style.height = `${virtualDelegate.headerRowHeight}px`;\n\t\tthis.splitview.el.style.lineHeight = `${virtualDelegate.headerRowHeight}px`;\n\n\t\tconst renderer = new TableListRenderer(columns, renderers, i => this.splitview.getViewSize(i));\n\t\tthis.list = this.disposables.add(new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options));\n\n\t\tEvent.any(...headers.map(h => h.onDidLayout))\n\t\t\t(([index, size]) => renderer.layoutColumn(index, size), null, this.disposables);\n\n\t\tthis.splitview.onDidSashReset(index => {\n\t\t\tconst totalWeight = columns.reduce((r, c) => r + c.weight, 0);\n\t\t\tconst size = columns[index].weight / totalWeight * this.cachedWidth;\n\t\t\tthis.splitview.resizeView(index, size);\n\t\t}, null, this.disposables);\n\n\t\tthis.styleElement = createStyleSheet(this.domNode);\n\t\tthis.style({});\n\t}\n\n\tupdateOptions(options: ITableOptionsUpdate): void {\n\t\tthis.list.updateOptions(options);\n\t}\n\n\tsplice(start: number, deleteCount: number, elements: TRow[] = []): void {\n\t\tthis.list.splice(start, deleteCount, elements);\n\t}\n\n\tgetHTMLElement(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tstyle(styles: ITableStyles): void {\n\t\tconst content: string[] = [];\n\n\t\tcontent.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight + 1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`);\n\n\t\tthis.styleElement.textContent = content.join('\\n');\n\t\tthis.list.style(styles);\n\t}\n\n\tgetSelectedElements(): TRow[] {\n\t\treturn this.list.getSelectedElements();\n\t}\n\n\tgetSelection(): number[] {\n\t\treturn this.list.getSelection();\n\t}\n\n\tgetFocus(): number[] {\n\t\treturn this.list.getFocus();\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables.dispose();\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IdGenerator } from 'vs/base/common/idGenerator';\nimport { URI } from 'vs/base/common/uri';\nimport 'vs/css!./media/quickInput';\n\nconst iconPathToClass: Record<string, string> = {};\nconst iconClassGenerator = new IdGenerator('quick-input-button-icon-');\n\nexport function getIconClass(iconPath: { dark: URI; light?: URI } | undefined): string | undefined {\n\tif (!iconPath) {\n\t\treturn undefined;\n\t}\n\tlet iconClass: string;\n\n\tconst key = iconPath.dark.toString();\n\tif (iconPathToClass[key]) {\n\t\ticonClass = iconPathToClass[key];\n\t} else {\n\t\ticonClass = iconClassGenerator.nextId();\n\t\tdom.createCSSRule(`.${iconClass}`, `background-image: ${dom.asCSSUrl(iconPath.light || iconPath.dark)}`);\n\t\tdom.createCSSRule(`.vs-dark .${iconClass}, .hc-black .${iconClass}`, `background-image: ${dom.asCSSUrl(iconPath.dark)}`);\n\t\ticonPathToClass[key] = iconClass;\n\t}\n\n\treturn iconClass;\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 { Disposable } from 'vs/base/common/lifecycle';\nimport { IDimension } from 'vs/editor/common/core/dimension';\nimport { Emitter, Event } from 'vs/base/common/event';\n\nexport class ElementSizeObserver extends Disposable {\n\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate readonly _referenceDomElement: HTMLElement | null;\n\tprivate _width: number;\n\tprivate _height: number;\n\tprivate _resizeObserver: ResizeObserver | null;\n\n\tconstructor(referenceDomElement: HTMLElement | null, dimension: IDimension | undefined) {\n\t\tsuper();\n\t\tthis._referenceDomElement = referenceDomElement;\n\t\tthis._width = -1;\n\t\tthis._height = -1;\n\t\tthis._resizeObserver = null;\n\t\tthis.measureReferenceDomElement(false, dimension);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.stopObserving();\n\t\tsuper.dispose();\n\t}\n\n\tpublic getWidth(): number {\n\t\treturn this._width;\n\t}\n\n\tpublic getHeight(): number {\n\t\treturn this._height;\n\t}\n\n\tpublic startObserving(): void {\n\t\tif (!this._resizeObserver && this._referenceDomElement) {\n\t\t\tthis._resizeObserver = new ResizeObserver((entries) => {\n\t\t\t\tif (entries && entries[0] && entries[0].contentRect) {\n\t\t\t\t\tthis.observe({ width: entries[0].contentRect.width, height: entries[0].contentRect.height });\n\t\t\t\t} else {\n\t\t\t\t\tthis.observe();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._referenceDomElement);\n\t\t}\n\t}\n\n\tpublic stopObserving(): void {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t\tthis._resizeObserver = null;\n\t\t}\n\t}\n\n\tpublic observe(dimension?: IDimension): void {\n\t\tthis.measureReferenceDomElement(true, dimension);\n\t}\n\n\tprivate measureReferenceDomElement(emitEvent: boolean, dimension?: IDimension): void {\n\t\tlet observedWidth = 0;\n\t\tlet observedHeight = 0;\n\t\tif (dimension) {\n\t\t\tobservedWidth = dimension.width;\n\t\t\tobservedHeight = dimension.height;\n\t\t} else if (this._referenceDomElement) {\n\t\t\tobservedWidth = this._referenceDomElement.clientWidth;\n\t\t\tobservedHeight = this._referenceDomElement.clientHeight;\n\t\t}\n\t\tobservedWidth = Math.max(5, observedWidth);\n\t\tobservedHeight = Math.max(5, observedHeight);\n\t\tif (this._width !== observedWidth || this._height !== observedHeight) {\n\t\t\tthis._width = observedWidth;\n\t\t\tthis._height = observedHeight;\n\t\t\tif (emitEvent) {\n\t\t\t\tthis._onDidChange.fire();\n\t\t\t}\n\t\t}\n\t}\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 { forEach } from 'vs/base/common/collections';\nimport { IEditorOptions } from 'vs/editor/common/config/editorOptions';\n\n/**\n * Compatibility with old options\n */\nexport function migrateOptions(options: IEditorOptions): void {\n\tconst wordWrap = options.wordWrap;\n\tif (<any>wordWrap === true) {\n\t\toptions.wordWrap = 'on';\n\t} else if (<any>wordWrap === false) {\n\t\toptions.wordWrap = 'off';\n\t}\n\n\tconst lineNumbers = options.lineNumbers;\n\tif (<any>lineNumbers === true) {\n\t\toptions.lineNumbers = 'on';\n\t} else if (<any>lineNumbers === false) {\n\t\toptions.lineNumbers = 'off';\n\t}\n\n\tconst autoClosingBrackets = options.autoClosingBrackets;\n\tif (<any>autoClosingBrackets === false) {\n\t\toptions.autoClosingBrackets = 'never';\n\t\toptions.autoClosingQuotes = 'never';\n\t\toptions.autoSurround = 'never';\n\t}\n\n\tconst cursorBlinking = options.cursorBlinking;\n\tif (<any>cursorBlinking === 'visible') {\n\t\toptions.cursorBlinking = 'solid';\n\t}\n\n\tconst renderWhitespace = options.renderWhitespace;\n\tif (<any>renderWhitespace === true) {\n\t\toptions.renderWhitespace = 'boundary';\n\t} else if (<any>renderWhitespace === false) {\n\t\toptions.renderWhitespace = 'none';\n\t}\n\n\tconst renderLineHighlight = options.renderLineHighlight;\n\tif (<any>renderLineHighlight === true) {\n\t\toptions.renderLineHighlight = 'line';\n\t} else if (<any>renderLineHighlight === false) {\n\t\toptions.renderLineHighlight = 'none';\n\t}\n\n\tconst acceptSuggestionOnEnter = options.acceptSuggestionOnEnter;\n\tif (<any>acceptSuggestionOnEnter === true) {\n\t\toptions.acceptSuggestionOnEnter = 'on';\n\t} else if (<any>acceptSuggestionOnEnter === false) {\n\t\toptions.acceptSuggestionOnEnter = 'off';\n\t}\n\n\tconst tabCompletion = options.tabCompletion;\n\tif (<any>tabCompletion === false) {\n\t\toptions.tabCompletion = 'off';\n\t} else if (<any>tabCompletion === true) {\n\t\toptions.tabCompletion = 'onlySnippets';\n\t}\n\n\tconst suggest = options.suggest;\n\tif (suggest && typeof (<any>suggest).filteredTypes === 'object' && (<any>suggest).filteredTypes) {\n\t\tconst mapping: Record<string, string> = {};\n\t\tmapping['method'] = 'showMethods';\n\t\tmapping['function'] = 'showFunctions';\n\t\tmapping['constructor'] = 'showConstructors';\n\t\tmapping['deprecated'] = 'showDeprecated';\n\t\tmapping['field'] = 'showFields';\n\t\tmapping['variable'] = 'showVariables';\n\t\tmapping['class'] = 'showClasses';\n\t\tmapping['struct'] = 'showStructs';\n\t\tmapping['interface'] = 'showInterfaces';\n\t\tmapping['module'] = 'showModules';\n\t\tmapping['property'] = 'showProperties';\n\t\tmapping['event'] = 'showEvents';\n\t\tmapping['operator'] = 'showOperators';\n\t\tmapping['unit'] = 'showUnits';\n\t\tmapping['value'] = 'showValues';\n\t\tmapping['constant'] = 'showConstants';\n\t\tmapping['enum'] = 'showEnums';\n\t\tmapping['enumMember'] = 'showEnumMembers';\n\t\tmapping['keyword'] = 'showKeywords';\n\t\tmapping['text'] = 'showWords';\n\t\tmapping['color'] = 'showColors';\n\t\tmapping['file'] = 'showFiles';\n\t\tmapping['reference'] = 'showReferences';\n\t\tmapping['folder'] = 'showFolders';\n\t\tmapping['typeParameter'] = 'showTypeParameters';\n\t\tmapping['snippet'] = 'showSnippets';\n\t\tforEach(mapping, entry => {\n\t\t\tconst value = (<any>suggest).filteredTypes[entry.key];\n\t\t\tif (value === false) {\n\t\t\t\t(<any>suggest)[entry.value] = value;\n\t\t\t}\n\t\t});\n\t\t// delete (<any>suggest).filteredTypes;\n\t}\n\n\tconst hover = options.hover;\n\tif (<any>hover === true) {\n\t\toptions.hover = {\n\t\t\tenabled: true\n\t\t};\n\t} else if (<any>hover === false) {\n\t\toptions.hover = {\n\t\t\tenabled: false\n\t\t};\n\t}\n\n\tconst parameterHints = options.parameterHints;\n\tif (<any>parameterHints === true) {\n\t\toptions.parameterHints = {\n\t\t\tenabled: true\n\t\t};\n\t} else if (<any>parameterHints === false) {\n\t\toptions.parameterHints = {\n\t\t\tenabled: false\n\t\t};\n\t}\n\n\tconst autoIndent = options.autoIndent;\n\tif (<any>autoIndent === true) {\n\t\toptions.autoIndent = 'full';\n\t} else if (<any>autoIndent === false) {\n\t\toptions.autoIndent = 'advanced';\n\t}\n\n\tconst matchBrackets = options.matchBrackets;\n\tif (<any>matchBrackets === true) {\n\t\toptions.matchBrackets = 'always';\n\t} else if (<any>matchBrackets === false) {\n\t\toptions.matchBrackets = 'never';\n\t}\n\n\tconst { renderIndentGuides, highlightActiveIndentGuide } = options as any as {\n\t\trenderIndentGuides: boolean;\n\t\thighlightActiveIndentGuide: boolean;\n\t};\n\tif (!options.guides) {\n\t\toptions.guides = {};\n\t}\n\n\tif (renderIndentGuides !== undefined) {\n\t\toptions.guides.indentation = !!renderIndentGuides;\n\t}\n\tif (highlightActiveIndentGuide !== undefined) {\n\t\toptions.guides.highlightActiveIndentation = !!highlightActiveIndentGuide;\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\n\nclass TabFocusImpl {\n\tprivate _tabFocus: boolean = false;\n\n\tprivate readonly _onDidChangeTabFocus = new Emitter<boolean>();\n\tpublic readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;\n\n\tpublic getTabFocusMode(): boolean {\n\t\treturn this._tabFocus;\n\t}\n\n\tpublic setTabFocusMode(tabFocusMode: boolean): void {\n\t\tif (this._tabFocus === tabFocusMode) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tabFocus = tabFocusMode;\n\t\tthis._onDidChangeTabFocus.fire(this._tabFocus);\n\t}\n}\n\n/**\n * Control what pressing Tab does.\n * If it is false, pressing Tab or Shift-Tab will be handled by the editor.\n * If it is true, pressing Tab or Shift-Tab will move the browser focus.\n * Defaults to false.\n */\nexport const TabFocus = new TabFocusImpl();\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\n\nexport class StableEditorScrollState {\n\n\tpublic static capture(editor: ICodeEditor): StableEditorScrollState {\n\t\tlet visiblePosition: Position | null = null;\n\t\tlet visiblePositionScrollDelta = 0;\n\t\tif (editor.getScrollTop() !== 0) {\n\t\t\tconst visibleRanges = editor.getVisibleRanges();\n\t\t\tif (visibleRanges.length > 0) {\n\t\t\t\tvisiblePosition = visibleRanges[0].getStartPosition();\n\t\t\t\tconst visiblePositionScrollTop = editor.getTopForPosition(visiblePosition.lineNumber, visiblePosition.column);\n\t\t\t\tvisiblePositionScrollDelta = editor.getScrollTop() - visiblePositionScrollTop;\n\t\t\t}\n\t\t}\n\t\treturn new StableEditorScrollState(visiblePosition, visiblePositionScrollDelta, editor.getPosition());\n\t}\n\n\tconstructor(\n\t\tprivate readonly _visiblePosition: Position | null,\n\t\tprivate readonly _visiblePositionScrollDelta: number,\n\t\tprivate readonly _cursorPosition: Position | null\n\t) {\n\t}\n\n\tpublic restore(editor: ICodeEditor): void {\n\t\tif (this._visiblePosition) {\n\t\t\tconst visiblePositionScrollTop = editor.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column);\n\t\t\teditor.setScrollTop(visiblePositionScrollTop + this._visiblePositionScrollDelta);\n\t\t}\n\t}\n\n\tpublic restoreRelativeVerticalPositionOfCursor(editor: ICodeEditor): void {\n\t\tconst currentCursorPosition = editor.getPosition();\n\n\t\tif (!this._cursorPosition || !currentCursorPosition) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst offset = editor.getTopForLineNumber(currentCursorPosition.lineNumber) - editor.getTopForLineNumber(this._cursorPosition.lineNumber);\n\t\teditor.setScrollTop(editor.getScrollTop() + offset);\n\t}\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 { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { IViewLayout, ViewModelDecoration } from 'vs/editor/common/viewModel';\n\nexport interface IViewLines {\n\tlinesVisibleRangesForRange(range: Range, includeNewLines: boolean): LineVisibleRanges[] | null;\n\tvisibleRangeForPosition(position: Position): HorizontalPosition | null;\n}\n\nexport abstract class RestrictedRenderingContext {\n\t_restrictedRenderingContextBrand: void = undefined;\n\n\tpublic readonly viewportData: ViewportData;\n\n\tpublic readonly scrollWidth: number;\n\tpublic readonly scrollHeight: number;\n\n\tpublic readonly visibleRange: Range;\n\tpublic readonly bigNumbersDelta: number;\n\n\tpublic readonly scrollTop: number;\n\tpublic readonly scrollLeft: number;\n\n\tpublic readonly viewportWidth: number;\n\tpublic readonly viewportHeight: number;\n\n\tprivate readonly _viewLayout: IViewLayout;\n\n\tconstructor(viewLayout: IViewLayout, viewportData: ViewportData) {\n\t\tthis._viewLayout = viewLayout;\n\t\tthis.viewportData = viewportData;\n\n\t\tthis.scrollWidth = this._viewLayout.getScrollWidth();\n\t\tthis.scrollHeight = this._viewLayout.getScrollHeight();\n\n\t\tthis.visibleRange = this.viewportData.visibleRange;\n\t\tthis.bigNumbersDelta = this.viewportData.bigNumbersDelta;\n\n\t\tconst vInfo = this._viewLayout.getCurrentViewport();\n\t\tthis.scrollTop = vInfo.top;\n\t\tthis.scrollLeft = vInfo.left;\n\t\tthis.viewportWidth = vInfo.width;\n\t\tthis.viewportHeight = vInfo.height;\n\t}\n\n\tpublic getScrolledTopFromAbsoluteTop(absoluteTop: number): number {\n\t\treturn absoluteTop - this.scrollTop;\n\t}\n\n\tpublic getVerticalOffsetForLineNumber(lineNumber: number): number {\n\t\treturn this._viewLayout.getVerticalOffsetForLineNumber(lineNumber);\n\t}\n\n\tpublic getDecorationsInViewport(): ViewModelDecoration[] {\n\t\treturn this.viewportData.getDecorationsInViewport();\n\t}\n\n}\n\nexport class RenderingContext extends RestrictedRenderingContext {\n\t_renderingContextBrand: void = undefined;\n\n\tprivate readonly _viewLines: IViewLines;\n\n\tconstructor(viewLayout: IViewLayout, viewportData: ViewportData, viewLines: IViewLines) {\n\t\tsuper(viewLayout, viewportData);\n\t\tthis._viewLines = viewLines;\n\t}\n\n\tpublic linesVisibleRangesForRange(range: Range, includeNewLines: boolean): LineVisibleRanges[] | null {\n\t\treturn this._viewLines.linesVisibleRangesForRange(range, includeNewLines);\n\t}\n\n\tpublic visibleRangeForPosition(position: Position): HorizontalPosition | null {\n\t\treturn this._viewLines.visibleRangeForPosition(position);\n\t}\n}\n\nexport class LineVisibleRanges {\n\tconstructor(\n\t\tpublic readonly outsideRenderedLine: boolean,\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly ranges: HorizontalRange[]\n\t) { }\n}\n\nexport class HorizontalRange {\n\t_horizontalRangeBrand: void = undefined;\n\n\tpublic left: number;\n\tpublic width: number;\n\n\tpublic static from(ranges: FloatHorizontalRange[]): HorizontalRange[] {\n\t\tconst result = new Array(ranges.length);\n\t\tfor (let i = 0, len = ranges.length; i < len; i++) {\n\t\t\tconst range = ranges[i];\n\t\t\tresult[i] = new HorizontalRange(range.left, range.width);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconstructor(left: number, width: number) {\n\t\tthis.left = Math.round(left);\n\t\tthis.width = Math.round(width);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.left},${this.width}]`;\n\t}\n}\n\nexport class FloatHorizontalRange {\n\t_floatHorizontalRangeBrand: void = undefined;\n\n\tpublic left: number;\n\tpublic width: number;\n\n\tconstructor(left: number, width: number) {\n\t\tthis.left = left;\n\t\tthis.width = width;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.left},${this.width}]`;\n\t}\n\n\tpublic static compare(a: FloatHorizontalRange, b: FloatHorizontalRange): number {\n\t\treturn a.left - b.left;\n\t}\n}\n\nexport class HorizontalPosition {\n\tpublic outsideRenderedLine: boolean;\n\t/**\n\t * Math.round(this.originalLeft)\n\t */\n\tpublic left: number;\n\tpublic originalLeft: number;\n\n\tconstructor(outsideRenderedLine: boolean, left: number) {\n\t\tthis.outsideRenderedLine = outsideRenderedLine;\n\t\tthis.originalLeft = left;\n\t\tthis.left = Math.round(this.originalLeft);\n\t}\n}\n\nexport class VisibleRanges {\n\tconstructor(\n\t\tpublic readonly outsideRenderedLine: boolean,\n\t\tpublic readonly ranges: FloatHorizontalRange[]\n\t) {\n\t}\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent } from 'vs/editor/browser/editorBrowser';\nimport { ICoordinatesConverter } from 'vs/editor/common/viewModel';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\n\nexport interface EventCallback<T> {\n\t(event: T): void;\n}\n\nexport class ViewUserInputEvents {\n\n\tpublic onKeyDown: EventCallback<IKeyboardEvent> | null = null;\n\tpublic onKeyUp: EventCallback<IKeyboardEvent> | null = null;\n\tpublic onContextMenu: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseMove: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseLeave: EventCallback<IPartialEditorMouseEvent> | null = null;\n\tpublic onMouseDown: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseUp: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseDrag: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseDrop: EventCallback<IPartialEditorMouseEvent> | null = null;\n\tpublic onMouseDropCanceled: EventCallback<void> | null = null;\n\tpublic onMouseWheel: EventCallback<IMouseWheelEvent> | null = null;\n\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tconstructor(coordinatesConverter: ICoordinatesConverter) {\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t}\n\n\tpublic emitKeyDown(e: IKeyboardEvent): void {\n\t\tif (this.onKeyDown) {\n\t\t\tthis.onKeyDown(e);\n\t\t}\n\t}\n\n\tpublic emitKeyUp(e: IKeyboardEvent): void {\n\t\tif (this.onKeyUp) {\n\t\t\tthis.onKeyUp(e);\n\t\t}\n\t}\n\n\tpublic emitContextMenu(e: IEditorMouseEvent): void {\n\t\tif (this.onContextMenu) {\n\t\t\tthis.onContextMenu(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseMove(e: IEditorMouseEvent): void {\n\t\tif (this.onMouseMove) {\n\t\t\tthis.onMouseMove(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseLeave(e: IPartialEditorMouseEvent): void {\n\t\tif (this.onMouseLeave) {\n\t\t\tthis.onMouseLeave(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseDown(e: IEditorMouseEvent): void {\n\t\tif (this.onMouseDown) {\n\t\t\tthis.onMouseDown(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseUp(e: IEditorMouseEvent): void {\n\t\tif (this.onMouseUp) {\n\t\t\tthis.onMouseUp(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseDrag(e: IEditorMouseEvent): void {\n\t\tif (this.onMouseDrag) {\n\t\t\tthis.onMouseDrag(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseDrop(e: IPartialEditorMouseEvent): void {\n\t\tif (this.onMouseDrop) {\n\t\t\tthis.onMouseDrop(this._convertViewToModelMouseEvent(e));\n\t\t}\n\t}\n\n\tpublic emitMouseDropCanceled(): void {\n\t\tif (this.onMouseDropCanceled) {\n\t\t\tthis.onMouseDropCanceled();\n\t\t}\n\t}\n\n\tpublic emitMouseWheel(e: IMouseWheelEvent): void {\n\t\tif (this.onMouseWheel) {\n\t\t\tthis.onMouseWheel(e);\n\t\t}\n\t}\n\n\tprivate _convertViewToModelMouseEvent(e: IEditorMouseEvent): IEditorMouseEvent;\n\tprivate _convertViewToModelMouseEvent(e: IPartialEditorMouseEvent): IPartialEditorMouseEvent;\n\tprivate _convertViewToModelMouseEvent(e: IEditorMouseEvent | IPartialEditorMouseEvent): IEditorMouseEvent | IPartialEditorMouseEvent {\n\t\tif (e.target) {\n\t\t\treturn {\n\t\t\t\tevent: e.event,\n\t\t\t\ttarget: this._convertViewToModelMouseTarget(e.target)\n\t\t\t};\n\t\t}\n\t\treturn e;\n\t}\n\n\tprivate _convertViewToModelMouseTarget(target: IMouseTarget): IMouseTarget {\n\t\treturn ViewUserInputEvents.convertViewToModelMouseTarget(target, this._coordinatesConverter);\n\t}\n\n\tpublic static convertViewToModelMouseTarget(target: IMouseTarget, coordinatesConverter: ICoordinatesConverter): IMouseTarget {\n\t\tconst result = { ...target };\n\t\tif (result.position) {\n\t\t\tresult.position = coordinatesConverter.convertViewPositionToModelPosition(result.position);\n\t\t}\n\t\tif (result.range) {\n\t\t\tresult.range = coordinatesConverter.convertViewRangeToModelRange(result.range);\n\t\t}\n\t\treturn result;\n\t}\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 { Constants } from 'vs/base/common/uint';\nimport { FloatHorizontalRange } from 'vs/editor/browser/view/renderingContext';\n\nexport class RangeUtil {\n\n\t/**\n\t * Reusing the same range here\n\t * because IE is buggy and constantly freezes when using a large number\n\t * of ranges and calling .detach on them\n\t */\n\tprivate static _handyReadyRange: Range;\n\n\tprivate static _createRange(): Range {\n\t\tif (!this._handyReadyRange) {\n\t\t\tthis._handyReadyRange = document.createRange();\n\t\t}\n\t\treturn this._handyReadyRange;\n\t}\n\n\tprivate static _detachRange(range: Range, endNode: HTMLElement): void {\n\t\t// Move range out of the span node, IE doesn't like having many ranges in\n\t\t// the same spot and will act badly for lines containing dashes ('-')\n\t\trange.selectNodeContents(endNode);\n\t}\n\n\tprivate static _readClientRects(startElement: Node, startOffset: number, endElement: Node, endOffset: number, endNode: HTMLElement): DOMRectList | null {\n\t\tconst range = this._createRange();\n\t\ttry {\n\t\t\trange.setStart(startElement, startOffset);\n\t\t\trange.setEnd(endElement, endOffset);\n\n\t\t\treturn range.getClientRects();\n\t\t} catch (e) {\n\t\t\t// This is life ...\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tthis._detachRange(range, endNode);\n\t\t}\n\t}\n\n\tprivate static _mergeAdjacentRanges(ranges: FloatHorizontalRange[]): FloatHorizontalRange[] {\n\t\tif (ranges.length === 1) {\n\t\t\t// There is nothing to merge\n\t\t\treturn ranges;\n\t\t}\n\n\t\tranges.sort(FloatHorizontalRange.compare);\n\n\t\tconst result: FloatHorizontalRange[] = [];\n\t\tlet resultLen = 0;\n\t\tlet prev = ranges[0];\n\n\t\tfor (let i = 1, len = ranges.length; i < len; i++) {\n\t\t\tconst range = ranges[i];\n\t\t\tif (prev.left + prev.width + 0.9 /* account for browser's rounding errors*/ >= range.left) {\n\t\t\t\tprev.width = Math.max(prev.width, range.left + range.width - prev.left);\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = prev;\n\t\t\t\tprev = range;\n\t\t\t}\n\t\t}\n\n\t\tresult[resultLen++] = prev;\n\n\t\treturn result;\n\t}\n\n\tprivate static _createHorizontalRangesFromClientRects(clientRects: DOMRectList | null, clientRectDeltaLeft: number, clientRectScale: number): FloatHorizontalRange[] | null {\n\t\tif (!clientRects || clientRects.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// We go through FloatHorizontalRange because it has been observed in bi-di text\n\t\t// that the clientRects are not coming in sorted from the browser\n\n\t\tconst result: FloatHorizontalRange[] = [];\n\t\tfor (let i = 0, len = clientRects.length; i < len; i++) {\n\t\t\tconst clientRect = clientRects[i];\n\t\t\tresult[i] = new FloatHorizontalRange(Math.max(0, (clientRect.left - clientRectDeltaLeft) / clientRectScale), clientRect.width / clientRectScale);\n\t\t}\n\n\t\treturn this._mergeAdjacentRanges(result);\n\t}\n\n\tpublic static readHorizontalRanges(domNode: HTMLElement, startChildIndex: number, startOffset: number, endChildIndex: number, endOffset: number, clientRectDeltaLeft: number, clientRectScale: number, endNode: HTMLElement): FloatHorizontalRange[] | null {\n\t\t// Panic check\n\t\tconst min = 0;\n\t\tconst max = domNode.children.length - 1;\n\t\tif (min > max) {\n\t\t\treturn null;\n\t\t}\n\t\tstartChildIndex = Math.min(max, Math.max(min, startChildIndex));\n\t\tendChildIndex = Math.min(max, Math.max(min, endChildIndex));\n\n\t\tif (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0 && !domNode.children[startChildIndex].firstChild) {\n\t\t\t// We must find the position at the beginning of a <span>\n\t\t\t// To cover cases of empty <span>s, avoid using a range and use the <span>'s bounding box\n\t\t\tconst clientRects = domNode.children[startChildIndex].getClientRects();\n\t\t\treturn this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft, clientRectScale);\n\t\t}\n\n\t\t// If crossing over to a span only to select offset 0, then use the previous span's maximum offset\n\t\t// Chrome is buggy and doesn't handle 0 offsets well sometimes.\n\t\tif (startChildIndex !== endChildIndex) {\n\t\t\tif (endChildIndex > 0 && endOffset === 0) {\n\t\t\t\tendChildIndex--;\n\t\t\t\tendOffset = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\t\t}\n\t\t}\n\n\t\tlet startElement = domNode.children[startChildIndex].firstChild;\n\t\tlet endElement = domNode.children[endChildIndex].firstChild;\n\n\t\tif (!startElement || !endElement) {\n\t\t\t// When having an empty <span> (without any text content), try to move to the previous <span>\n\t\t\tif (!startElement && startOffset === 0 && startChildIndex > 0) {\n\t\t\t\tstartElement = domNode.children[startChildIndex - 1].firstChild;\n\t\t\t\tstartOffset = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\t\t}\n\t\t\tif (!endElement && endOffset === 0 && endChildIndex > 0) {\n\t\t\t\tendElement = domNode.children[endChildIndex - 1].firstChild;\n\t\t\t\tendOffset = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\t\t}\n\t\t}\n\n\t\tif (!startElement || !endElement) {\n\t\t\treturn null;\n\t\t}\n\n\t\tstartOffset = Math.min(startElement.textContent!.length, Math.max(0, startOffset));\n\t\tendOffset = Math.min(endElement.textContent!.length, Math.max(0, endOffset));\n\n\t\tconst clientRects = this._readClientRects(startElement, startOffset, endElement, endOffset, endNode);\n\t\treturn this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft, clientRectScale);\n\t}\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\nexport const enum Constants {\n\tSTART_CH_CODE = 32, // Space\n\tEND_CH_CODE = 126, // Tilde (~)\n\tUNKNOWN_CODE = 65533, // UTF placeholder code\n\tCHAR_COUNT = END_CH_CODE - START_CH_CODE + 2,\n\n\tSAMPLED_CHAR_HEIGHT = 16,\n\tSAMPLED_CHAR_WIDTH = 10,\n\n\tBASE_CHAR_HEIGHT = 2,\n\tBASE_CHAR_WIDTH = 1,\n\n\tRGBA_CHANNELS_CNT = 4,\n\tRGBA_SAMPLED_ROW_WIDTH = RGBA_CHANNELS_CNT * CHAR_COUNT * SAMPLED_CHAR_WIDTH\n}\n\nexport const allCharCodes: ReadonlyArray<number> = (() => {\n\tconst v: number[] = [];\n\tfor (let i = Constants.START_CH_CODE; i <= Constants.END_CH_CODE; i++) {\n\t\tv.push(i);\n\t}\n\n\tv.push(Constants.UNKNOWN_CODE);\n\treturn v;\n})();\n\nexport const getCharIndex = (chCode: number, fontScale: number) => {\n\tchCode -= Constants.START_CH_CODE;\n\tif (chCode < 0 || chCode > Constants.CHAR_COUNT) {\n\t\tif (fontScale <= 2) {\n\t\t\t// for smaller scales, we can get away with using any ASCII character...\n\t\t\treturn (chCode + Constants.CHAR_COUNT) % Constants.CHAR_COUNT;\n\t\t}\n\t\treturn Constants.CHAR_COUNT - 1; // unknown symbol\n\t}\n\n\treturn chCode;\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 { RGBA8 } from 'vs/editor/common/core/rgba';\nimport { Constants, getCharIndex } from './minimapCharSheet';\nimport { toUint8 } from 'vs/base/common/uint';\n\nexport class MinimapCharRenderer {\n\t_minimapCharRendererBrand: void = undefined;\n\n\tprivate readonly charDataNormal: Uint8ClampedArray;\n\tprivate readonly charDataLight: Uint8ClampedArray;\n\n\tconstructor(charData: Uint8ClampedArray, public readonly scale: number) {\n\t\tthis.charDataNormal = MinimapCharRenderer.soften(charData, 12 / 15);\n\t\tthis.charDataLight = MinimapCharRenderer.soften(charData, 50 / 60);\n\t}\n\n\tprivate static soften(input: Uint8ClampedArray, ratio: number): Uint8ClampedArray {\n\t\tconst result = new Uint8ClampedArray(input.length);\n\t\tfor (let i = 0, len = input.length; i < len; i++) {\n\t\t\tresult[i] = toUint8(input[i] * ratio);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic renderChar(\n\t\ttarget: ImageData,\n\t\tdx: number,\n\t\tdy: number,\n\t\tchCode: number,\n\t\tcolor: RGBA8,\n\t\tforegroundAlpha: number,\n\t\tbackgroundColor: RGBA8,\n\t\tbackgroundAlpha: number,\n\t\tfontScale: number,\n\t\tuseLighterFont: boolean,\n\t\tforce1pxHeight: boolean\n\t): void {\n\t\tconst charWidth = Constants.BASE_CHAR_WIDTH * this.scale;\n\t\tconst charHeight = Constants.BASE_CHAR_HEIGHT * this.scale;\n\t\tconst renderHeight = (force1pxHeight ? 1 : charHeight);\n\t\tif (dx + charWidth > target.width || dy + renderHeight > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\n\t\tconst charData = useLighterFont ? this.charDataLight : this.charDataNormal;\n\t\tconst charIndex = getCharIndex(chCode, fontScale);\n\n\t\tconst destWidth = target.width * Constants.RGBA_CHANNELS_CNT;\n\n\t\tconst backgroundR = backgroundColor.r;\n\t\tconst backgroundG = backgroundColor.g;\n\t\tconst backgroundB = backgroundColor.b;\n\n\t\tconst deltaR = color.r - backgroundR;\n\t\tconst deltaG = color.g - backgroundG;\n\t\tconst deltaB = color.b - backgroundB;\n\n\t\tconst destAlpha = Math.max(foregroundAlpha, backgroundAlpha);\n\n\t\tconst dest = target.data;\n\t\tlet sourceOffset = charIndex * charWidth * charHeight;\n\n\t\tlet row = dy * destWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\tfor (let y = 0; y < renderHeight; y++) {\n\t\t\tlet column = row;\n\t\t\tfor (let x = 0; x < charWidth; x++) {\n\t\t\t\tconst c = (charData[sourceOffset++] / 255) * (foregroundAlpha / 255);\n\t\t\t\tdest[column++] = backgroundR + deltaR * c;\n\t\t\t\tdest[column++] = backgroundG + deltaG * c;\n\t\t\t\tdest[column++] = backgroundB + deltaB * c;\n\t\t\t\tdest[column++] = destAlpha;\n\t\t\t}\n\n\t\t\trow += destWidth;\n\t\t}\n\t}\n\n\tpublic blockRenderChar(\n\t\ttarget: ImageData,\n\t\tdx: number,\n\t\tdy: number,\n\t\tcolor: RGBA8,\n\t\tforegroundAlpha: number,\n\t\tbackgroundColor: RGBA8,\n\t\tbackgroundAlpha: number,\n\t\tforce1pxHeight: boolean\n\t): void {\n\t\tconst charWidth = Constants.BASE_CHAR_WIDTH * this.scale;\n\t\tconst charHeight = Constants.BASE_CHAR_HEIGHT * this.scale;\n\t\tconst renderHeight = (force1pxHeight ? 1 : charHeight);\n\t\tif (dx + charWidth > target.width || dy + renderHeight > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\n\t\tconst destWidth = target.width * Constants.RGBA_CHANNELS_CNT;\n\n\t\tconst c = 0.5 * (foregroundAlpha / 255);\n\n\t\tconst backgroundR = backgroundColor.r;\n\t\tconst backgroundG = backgroundColor.g;\n\t\tconst backgroundB = backgroundColor.b;\n\n\t\tconst deltaR = color.r - backgroundR;\n\t\tconst deltaG = color.g - backgroundG;\n\t\tconst deltaB = color.b - backgroundB;\n\n\t\tconst colorR = backgroundR + deltaR * c;\n\t\tconst colorG = backgroundG + deltaG * c;\n\t\tconst colorB = backgroundB + deltaB * c;\n\n\t\tconst destAlpha = Math.max(foregroundAlpha, backgroundAlpha);\n\n\t\tconst dest = target.data;\n\n\t\tlet row = dy * destWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\tfor (let y = 0; y < renderHeight; y++) {\n\t\t\tlet column = row;\n\t\t\tfor (let x = 0; x < charWidth; x++) {\n\t\t\t\tdest[column++] = colorR;\n\t\t\t\tdest[column++] = colorG;\n\t\t\t\tdest[column++] = colorB;\n\t\t\t\tdest[column++] = destAlpha;\n\t\t\t}\n\n\t\t\trow += destWidth;\n\t\t}\n\t}\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 { once } from 'vs/base/common/functional';\n\nconst charTable: { [hex: string]: number } = {\n\t'0': 0,\n\t'1': 1,\n\t'2': 2,\n\t'3': 3,\n\t'4': 4,\n\t'5': 5,\n\t'6': 6,\n\t'7': 7,\n\t'8': 8,\n\t'9': 9,\n\tA: 10,\n\tB: 11,\n\tC: 12,\n\tD: 13,\n\tE: 14,\n\tF: 15\n};\n\nconst decodeData = (str: string) => {\n\tconst output = new Uint8ClampedArray(str.length / 2);\n\tfor (let i = 0; i < str.length; i += 2) {\n\t\toutput[i >> 1] = (charTable[str[i]] << 4) | (charTable[str[i + 1]] & 0xF);\n\t}\n\n\treturn output;\n};\n\n/*\nconst encodeData = (data: Uint8ClampedArray, length: string) => {\n\tconst chars = '0123456789ABCDEF';\n\tlet output = '';\n\tfor (let i = 0; i < data.length; i++) {\n\t\toutput += chars[data[i] >> 4] + chars[data[i] & 0xf];\n\t}\n\treturn output;\n};\n*/\n\n/**\n * Map of minimap scales to prebaked sample data at those scales. We don't\n * sample much larger data, because then font family becomes visible, which\n * is use-configurable.\n */\nexport const prebakedMiniMaps: { [scale: number]: () => Uint8ClampedArray } = {\n\t1: once(() =>\n\t\tdecodeData(\n\t\t\t'0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792'\n\t\t)\n\t),\n\t2: once(() =>\n\t\tdecodeData(\n\t\t\t'000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126'\n\t\t)\n\t)\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 { MinimapCharRenderer } from 'vs/editor/browser/viewParts/minimap/minimapCharRenderer';\nimport { allCharCodes } from 'vs/editor/browser/viewParts/minimap/minimapCharSheet';\nimport { prebakedMiniMaps } from 'vs/editor/browser/viewParts/minimap/minimapPreBaked';\nimport { Constants } from './minimapCharSheet';\nimport { toUint8 } from 'vs/base/common/uint';\n\n/**\n * Creates character renderers. It takes a 'scale' that determines how large\n * characters should be drawn. Using this, it draws data into a canvas and\n * then downsamples the characters as necessary for the current display.\n * This makes rendering more efficient, rather than drawing a full (tiny)\n * font, or downsampling in real-time.\n */\nexport class MinimapCharRendererFactory {\n\tprivate static lastCreated?: MinimapCharRenderer;\n\tprivate static lastFontFamily?: string;\n\n\t/**\n\t * Creates a new character renderer factory with the given scale.\n\t */\n\tpublic static create(scale: number, fontFamily: string) {\n\t\t// renderers are immutable. By default we'll 'create' a new minimap\n\t\t// character renderer whenever we switch editors, no need to do extra work.\n\t\tif (this.lastCreated && scale === this.lastCreated.scale && fontFamily === this.lastFontFamily) {\n\t\t\treturn this.lastCreated;\n\t\t}\n\n\t\tlet factory: MinimapCharRenderer;\n\t\tif (prebakedMiniMaps[scale]) {\n\t\t\tfactory = new MinimapCharRenderer(prebakedMiniMaps[scale](), scale);\n\t\t} else {\n\t\t\tfactory = MinimapCharRendererFactory.createFromSampleData(\n\t\t\t\tMinimapCharRendererFactory.createSampleData(fontFamily).data,\n\t\t\t\tscale\n\t\t\t);\n\t\t}\n\n\t\tthis.lastFontFamily = fontFamily;\n\t\tthis.lastCreated = factory;\n\t\treturn factory;\n\t}\n\n\t/**\n\t * Creates the font sample data, writing to a canvas.\n\t */\n\tpublic static createSampleData(fontFamily: string): ImageData {\n\t\tconst canvas = document.createElement('canvas');\n\t\tconst ctx = canvas.getContext('2d')!;\n\n\t\tcanvas.style.height = `${Constants.SAMPLED_CHAR_HEIGHT}px`;\n\t\tcanvas.height = Constants.SAMPLED_CHAR_HEIGHT;\n\t\tcanvas.width = Constants.CHAR_COUNT * Constants.SAMPLED_CHAR_WIDTH;\n\t\tcanvas.style.width = Constants.CHAR_COUNT * Constants.SAMPLED_CHAR_WIDTH + 'px';\n\n\t\tctx.fillStyle = '#ffffff';\n\t\tctx.font = `bold ${Constants.SAMPLED_CHAR_HEIGHT}px ${fontFamily}`;\n\t\tctx.textBaseline = 'middle';\n\n\t\tlet x = 0;\n\t\tfor (const code of allCharCodes) {\n\t\t\tctx.fillText(String.fromCharCode(code), x, Constants.SAMPLED_CHAR_HEIGHT / 2);\n\t\t\tx += Constants.SAMPLED_CHAR_WIDTH;\n\t\t}\n\n\t\treturn ctx.getImageData(0, 0, Constants.CHAR_COUNT * Constants.SAMPLED_CHAR_WIDTH, Constants.SAMPLED_CHAR_HEIGHT);\n\t}\n\n\t/**\n\t * Creates a character renderer from the canvas sample data.\n\t */\n\tpublic static createFromSampleData(source: Uint8ClampedArray, scale: number): MinimapCharRenderer {\n\t\tconst expectedLength =\n\t\t\tConstants.SAMPLED_CHAR_HEIGHT * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * Constants.CHAR_COUNT;\n\t\tif (source.length !== expectedLength) {\n\t\t\tthrow new Error('Unexpected source in MinimapCharRenderer');\n\t\t}\n\n\t\tconst charData = MinimapCharRendererFactory._downsample(source, scale);\n\t\treturn new MinimapCharRenderer(charData, scale);\n\t}\n\n\tprivate static _downsampleChar(\n\t\tsource: Uint8ClampedArray,\n\t\tsourceOffset: number,\n\t\tdest: Uint8ClampedArray,\n\t\tdestOffset: number,\n\t\tscale: number\n\t): number {\n\t\tconst width = Constants.BASE_CHAR_WIDTH * scale;\n\t\tconst height = Constants.BASE_CHAR_HEIGHT * scale;\n\n\t\tlet targetIndex = destOffset;\n\t\tlet brightest = 0;\n\n\t\t// This is essentially an ad-hoc rescaling algorithm. Standard approaches\n\t\t// like bicubic interpolation are awesome for scaling between image sizes,\n\t\t// but don't work so well when scaling to very small pixel values, we end\n\t\t// up with blurry, indistinct forms.\n\t\t//\n\t\t// The approach taken here is simply mapping each source pixel to the target\n\t\t// pixels, and taking the weighted values for all pixels in each, and then\n\t\t// averaging them out. Finally we apply an intensity boost in _downsample,\n\t\t// since when scaling to the smallest pixel sizes there's more black space\n\t\t// which causes characters to be much less distinct.\n\t\tfor (let y = 0; y < height; y++) {\n\t\t\t// 1. For this destination pixel, get the source pixels we're sampling\n\t\t\t// from (x1, y1) to the next pixel (x2, y2)\n\t\t\tconst sourceY1 = (y / height) * Constants.SAMPLED_CHAR_HEIGHT;\n\t\t\tconst sourceY2 = ((y + 1) / height) * Constants.SAMPLED_CHAR_HEIGHT;\n\n\t\t\tfor (let x = 0; x < width; x++) {\n\t\t\t\tconst sourceX1 = (x / width) * Constants.SAMPLED_CHAR_WIDTH;\n\t\t\t\tconst sourceX2 = ((x + 1) / width) * Constants.SAMPLED_CHAR_WIDTH;\n\n\t\t\t\t// 2. Sample all of them, summing them up and weighting them. Similar\n\t\t\t\t// to bilinear interpolation.\n\t\t\t\tlet value = 0;\n\t\t\t\tlet samples = 0;\n\t\t\t\tfor (let sy = sourceY1; sy < sourceY2; sy++) {\n\t\t\t\t\tconst sourceRow = sourceOffset + Math.floor(sy) * Constants.RGBA_SAMPLED_ROW_WIDTH;\n\t\t\t\t\tconst yBalance = 1 - (sy - Math.floor(sy));\n\t\t\t\t\tfor (let sx = sourceX1; sx < sourceX2; sx++) {\n\t\t\t\t\t\tconst xBalance = 1 - (sx - Math.floor(sx));\n\t\t\t\t\t\tconst sourceIndex = sourceRow + Math.floor(sx) * Constants.RGBA_CHANNELS_CNT;\n\n\t\t\t\t\t\tconst weight = xBalance * yBalance;\n\t\t\t\t\t\tsamples += weight;\n\t\t\t\t\t\tvalue += ((source[sourceIndex] * source[sourceIndex + 3]) / 255) * weight;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst final = value / samples;\n\t\t\t\tbrightest = Math.max(brightest, final);\n\t\t\t\tdest[targetIndex++] = toUint8(final);\n\t\t\t}\n\t\t}\n\n\t\treturn brightest;\n\t}\n\n\tprivate static _downsample(data: Uint8ClampedArray, scale: number): Uint8ClampedArray {\n\t\tconst pixelsPerCharacter = Constants.BASE_CHAR_HEIGHT * scale * Constants.BASE_CHAR_WIDTH * scale;\n\t\tconst resultLen = pixelsPerCharacter * Constants.CHAR_COUNT;\n\t\tconst result = new Uint8ClampedArray(resultLen);\n\n\t\tlet resultOffset = 0;\n\t\tlet sourceOffset = 0;\n\t\tlet brightest = 0;\n\t\tfor (let charIndex = 0; charIndex < Constants.CHAR_COUNT; charIndex++) {\n\t\t\tbrightest = Math.max(brightest, this._downsampleChar(data, sourceOffset, result, resultOffset, scale));\n\t\t\tresultOffset += pixelsPerCharacter;\n\t\t\tsourceOffset += Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT;\n\t\t}\n\n\t\tif (brightest > 0) {\n\t\t\tconst adjust = 255 / brightest;\n\t\t\tfor (let i = 0; i < resultLen; i++) {\n\t\t\t\tresult[i] *= adjust;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\n\nexport interface IEditorZoom {\n\tonDidChangeZoomLevel: Event<number>;\n\tgetZoomLevel(): number;\n\tsetZoomLevel(zoomLevel: number): void;\n}\n\nexport const EditorZoom: IEditorZoom = new class implements IEditorZoom {\n\n\tprivate _zoomLevel: number = 0;\n\n\tprivate readonly _onDidChangeZoomLevel = new Emitter<number>();\n\tpublic readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;\n\n\tpublic getZoomLevel(): number {\n\t\treturn this._zoomLevel;\n\t}\n\n\tpublic setZoomLevel(zoomLevel: number): void {\n\t\tzoomLevel = Math.min(Math.max(-5, zoomLevel), 20);\n\t\tif (this._zoomLevel === zoomLevel) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._zoomLevel = zoomLevel;\n\t\tthis._onDidChangeZoomLevel.fire(this._zoomLevel);\n\t}\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 * as platform from 'vs/base/common/platform';\nimport { EditorOption, FindComputedEditorOptionValueById } from 'vs/editor/common/config/editorOptions';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\n\n/**\n * Determined from empirical observations.\n * @internal\n */\nconst GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n\n/**\n * @internal\n */\nconst MINIMUM_LINE_HEIGHT = 8;\n\n/**\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void = undefined;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static createFromValidatedSettings(options: IValidatedEditorOptions, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tconst fontFamily = options.get(EditorOption.fontFamily);\n\t\tconst fontWeight = options.get(EditorOption.fontWeight);\n\t\tconst fontSize = options.get(EditorOption.fontSize);\n\t\tconst fontFeatureSettings = options.get(EditorOption.fontLigatures);\n\t\tconst lineHeight = options.get(EditorOption.lineHeight);\n\t\tconst letterSpacing = options.get(EditorOption.letterSpacing);\n\t\treturn BareFontInfo._create(fontFamily, fontWeight, fontSize, fontFeatureSettings, lineHeight, letterSpacing, pixelRatio, ignoreEditorZoom);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\t// Values too small to be line heights in pixels are in ems.\n\t\t\tlineHeight = lineHeight * fontSize;\n\t\t}\n\n\t\t// Enforce integer, minimum constraints\n\t\tlineHeight = Math.round(lineHeight);\n\t\tif (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tconst editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n\t\tfontSize *= editorZoomLevelMultiplier;\n\t\tlineHeight *= editorZoomLevelMultiplier;\n\n\t\treturn new BareFontInfo({\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tfontFeatureSettings: fontFeatureSettings,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly pixelRatio: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly fontFeatureSettings: string;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.pixelRatio = opts.pixelRatio;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\n\t\tthis.fontFeatureSettings = opts.fontFeatureSettings;\n\t\tthis.lineHeight = opts.lineHeight | 0;\n\t\tthis.letterSpacing = opts.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getId(): string {\n\t\treturn `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.lineHeight}-${this.letterSpacing}`;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(fallbackFontFamily: string | null): string {\n\t\tconst fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n\t\tif (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n\t\t\treturn `${fontFamily}, ${fallbackFontFamily}`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n\n\tprivate static _wrapInQuotes(fontFamily: string): string {\n\t\tif (/[,\"']/.test(fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${fontFamily}\"`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n}\n\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 1;\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void = undefined;\n\n\treadonly version: number = SERIALIZED_FONT_INFO_VERSION;\n\treadonly isTrusted: boolean;\n\treadonly isMonospace: boolean;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly typicalFullwidthCharacterWidth: number;\n\treadonly canUseHalfwidthRightwardsArrow: boolean;\n\treadonly spaceWidth: number;\n\treadonly middotWidth: number;\n\treadonly wsmiddotWidth: number;\n\treadonly maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t\tisMonospace: boolean;\n\t\ttypicalHalfwidthCharacterWidth: number;\n\t\ttypicalFullwidthCharacterWidth: number;\n\t\tcanUseHalfwidthRightwardsArrow: boolean;\n\t\tspaceWidth: number;\n\t\tmiddotWidth: number;\n\t\twsmiddotWidth: number;\n\t\tmaxDigitWidth: number;\n\t}, isTrusted: boolean) {\n\t\tsuper(opts);\n\t\tthis.isTrusted = isTrusted;\n\t\tthis.isMonospace = opts.isMonospace;\n\t\tthis.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n\t\tthis.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n\t\tthis.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n\t\tthis.spaceWidth = opts.spaceWidth;\n\t\tthis.middotWidth = opts.middotWidth;\n\t\tthis.wsmiddotWidth = opts.wsmiddotWidth;\n\t\tthis.maxDigitWidth = opts.maxDigitWidth;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: FontInfo): boolean {\n\t\treturn (\n\t\t\tthis.fontFamily === other.fontFamily\n\t\t\t&& this.fontWeight === other.fontWeight\n\t\t\t&& this.fontSize === other.fontSize\n\t\t\t&& this.fontFeatureSettings === other.fontFeatureSettings\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.letterSpacing === other.letterSpacing\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.maxDigitWidth === other.maxDigitWidth\n\t\t);\n\t}\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 { toUint8 } from 'vs/base/common/uint';\n\n/**\n * A fast character classifier that uses a compact array for ASCII values.\n */\nexport class CharacterClassifier<T extends number> {\n\t/**\n\t * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code).\n\t */\n\tprotected _asciiMap: Uint8Array;\n\n\t/**\n\t * The entire map (sparse array).\n\t */\n\tprotected _map: Map<number, number>;\n\n\tprotected _defaultValue: number;\n\n\tconstructor(_defaultValue: T) {\n\t\tconst defaultValue = toUint8(_defaultValue);\n\n\t\tthis._defaultValue = defaultValue;\n\t\tthis._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\n\t\tthis._map = new Map<number, number>();\n\t}\n\n\tprivate static _createAsciiMap(defaultValue: number): Uint8Array {\n\t\tconst asciiMap: Uint8Array = new Uint8Array(256);\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tasciiMap[i] = defaultValue;\n\t\t}\n\t\treturn asciiMap;\n\t}\n\n\tpublic set(charCode: number, _value: T): void {\n\t\tconst value = toUint8(_value);\n\n\t\tif (charCode >= 0 && charCode < 256) {\n\t\t\tthis._asciiMap[charCode] = value;\n\t\t} else {\n\t\t\tthis._map.set(charCode, value);\n\t\t}\n\t}\n\n\tpublic get(charCode: number): T {\n\t\tif (charCode >= 0 && charCode < 256) {\n\t\t\treturn <T>this._asciiMap[charCode];\n\t\t} else {\n\t\t\treturn <T>(this._map.get(charCode) || this._defaultValue);\n\t\t}\n\t}\n}\n\nconst enum Boolean {\n\tFalse = 0,\n\tTrue = 1\n}\n\nexport class CharacterSet {\n\n\tprivate readonly _actual: CharacterClassifier<Boolean>;\n\n\tconstructor() {\n\t\tthis._actual = new CharacterClassifier<Boolean>(Boolean.False);\n\t}\n\n\tpublic add(charCode: number): void {\n\t\tthis._actual.set(charCode, Boolean.True);\n\t}\n\n\tpublic has(charCode: number): boolean {\n\t\treturn (this._actual.get(charCode) === Boolean.True);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\n\n/**\n * A column in a position is the gap between two adjacent characters. The methods here\n * work with a concept called \"visible column\". A visible column is a very rough approximation\n * of the horizontal screen position of a column. For example, using a tab size of 4:\n * ```txt\n * |<TAB>|<TAB>|T|ext\n * | | | \\---- column = 4, visible column = 9\n * | | \\------ column = 3, visible column = 8\n * | \\------------ column = 2, visible column = 4\n * \\------------------ column = 1, visible column = 0\n * ```\n *\n * **NOTE**: Visual columns do not work well for RTL text or variable-width fonts or characters.\n *\n * **NOTE**: These methods work and make sense both on the model and on the view model.\n */\nexport class CursorColumns {\n\n\tprivate static _nextVisibleColumn(codePoint: number, visibleColumn: number, tabSize: number): number {\n\t\tif (codePoint === CharCode.Tab) {\n\t\t\treturn CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n\t\t}\n\t\tif (strings.isFullWidthCharacter(codePoint) || strings.isEmojiImprecise(codePoint)) {\n\t\t\treturn visibleColumn + 2;\n\t\t}\n\t\treturn visibleColumn + 1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static visibleColumnFromColumn(lineContent: string, column: number, tabSize: number): number {\n\t\tconst textLen = Math.min(column - 1, lineContent.length);\n\t\tconst text = lineContent.substring(0, textLen);\n\t\tconst iterator = new strings.GraphemeIterator(text);\n\n\t\tlet result = 0;\n\t\twhile (!iterator.eol()) {\n\t\t\tconst codePoint = strings.getNextCodePoint(text, textLen, iterator.offset);\n\t\t\titerator.nextGraphemeLength();\n\n\t\t\tresult = this._nextVisibleColumn(codePoint, result, tabSize);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns a column from a visible column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static columnFromVisibleColumn(lineContent: string, visibleColumn: number, tabSize: number): number {\n\t\tif (visibleColumn <= 0) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst lineContentLength = lineContent.length;\n\t\tconst iterator = new strings.GraphemeIterator(lineContent);\n\n\t\tlet beforeVisibleColumn = 0;\n\t\tlet beforeColumn = 1;\n\t\twhile (!iterator.eol()) {\n\t\t\tconst codePoint = strings.getNextCodePoint(lineContent, lineContentLength, iterator.offset);\n\t\t\titerator.nextGraphemeLength();\n\n\t\t\tconst afterVisibleColumn = this._nextVisibleColumn(codePoint, beforeVisibleColumn, tabSize);\n\t\t\tconst afterColumn = iterator.offset + 1;\n\n\t\t\tif (afterVisibleColumn >= visibleColumn) {\n\t\t\t\tconst beforeDelta = visibleColumn - beforeVisibleColumn;\n\t\t\t\tconst afterDelta = afterVisibleColumn - visibleColumn;\n\t\t\t\tif (afterDelta < beforeDelta) {\n\t\t\t\t\treturn afterColumn;\n\t\t\t\t} else {\n\t\t\t\t\treturn beforeColumn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbeforeVisibleColumn = afterVisibleColumn;\n\t\t\tbeforeColumn = afterColumn;\n\t\t}\n\n\t\t// walked the entire string\n\t\treturn lineContentLength + 1;\n\t}\n\n\t/**\n\t * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns)\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static nextRenderTabStop(visibleColumn: number, tabSize: number): number {\n\t\treturn visibleColumn + tabSize - visibleColumn % tabSize;\n\t}\n\n\t/**\n\t * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns)\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static nextIndentTabStop(visibleColumn: number, indentSize: number): number {\n\t\treturn visibleColumn + indentSize - visibleColumn % indentSize;\n\t}\n\n\t/**\n\t * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static prevRenderTabStop(column: number, tabSize: number): number {\n\t\treturn Math.max(0, column - 1 - (column - 1) % tabSize);\n\t}\n\n\t/**\n\t * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n\t * @see {@link CursorColumns}\n\t */\n\tpublic static prevIndentTabStop(column: number, indentSize: number): number {\n\t\treturn Math.max(0, column - 1 - (column - 1) % indentSize);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\n\nexport const enum StringEOL {\n\tUnknown = 0,\n\tInvalid = 3,\n\tLF = 1,\n\tCRLF = 2\n}\n\nexport function countEOL(text: string): [number, number, number, StringEOL] {\n\tlet eolCount = 0;\n\tlet firstLineLength = 0;\n\tlet lastLineStart = 0;\n\tlet eol: StringEOL = StringEOL.Unknown;\n\tfor (let i = 0, len = text.length; i < len; i++) {\n\t\tconst chr = text.charCodeAt(i);\n\n\t\tif (chr === CharCode.CarriageReturn) {\n\t\t\tif (eolCount === 0) {\n\t\t\t\tfirstLineLength = i;\n\t\t\t}\n\t\t\teolCount++;\n\t\t\tif (i + 1 < len && text.charCodeAt(i + 1) === CharCode.LineFeed) {\n\t\t\t\t// \\r\\n... case\n\t\t\t\teol |= StringEOL.CRLF;\n\t\t\t\ti++; // skip \\n\n\t\t\t} else {\n\t\t\t\t// \\r... case\n\t\t\t\teol |= StringEOL.Invalid;\n\t\t\t}\n\t\t\tlastLineStart = i + 1;\n\t\t} else if (chr === CharCode.LineFeed) {\n\t\t\t// \\n... case\n\t\t\teol |= StringEOL.LF;\n\t\t\tif (eolCount === 0) {\n\t\t\t\tfirstLineLength = i;\n\t\t\t}\n\t\t\teolCount++;\n\t\t\tlastLineStart = i + 1;\n\t\t}\n\t}\n\tif (eolCount === 0) {\n\t\tfirstLineLength = text.length;\n\t}\n\treturn [eolCount, firstLineLength, text.length - lastLineStart, eol];\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 * as strings from 'vs/base/common/strings';\n\nfunction _normalizeIndentationFromWhitespace(str: string, indentSize: number, insertSpaces: boolean): string {\n\tlet spacesCnt = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str.charAt(i) === '\\t') {\n\t\t\tspacesCnt += indentSize;\n\t\t} else {\n\t\t\tspacesCnt++;\n\t\t}\n\t}\n\n\tlet result = '';\n\tif (!insertSpaces) {\n\t\tconst tabsCnt = Math.floor(spacesCnt / indentSize);\n\t\tspacesCnt = spacesCnt % indentSize;\n\t\tfor (let i = 0; i < tabsCnt; i++) {\n\t\t\tresult += '\\t';\n\t\t}\n\t}\n\n\tfor (let i = 0; i < spacesCnt; i++) {\n\t\tresult += ' ';\n\t}\n\n\treturn result;\n}\n\nexport function normalizeIndentation(str: string, indentSize: number, insertSpaces: boolean): string {\n\tlet firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(str);\n\tif (firstNonWhitespaceIndex === -1) {\n\t\tfirstNonWhitespaceIndex = str.length;\n\t}\n\treturn _normalizeIndentationFromWhitespace(str.substring(0, firstNonWhitespaceIndex), indentSize, insertSpaces) + str.substring(firstNonWhitespaceIndex);\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\n/**\n * A position in the editor. This interface is suitable for serialization.\n */\nexport interface IPosition {\n\t/**\n\t * line number (starts at 1)\n\t */\n\treadonly lineNumber: number;\n\t/**\n\t * column (the first character in a line is between column 1 and column 2)\n\t */\n\treadonly column: number;\n}\n\n/**\n * A position in the editor.\n */\nexport class Position {\n\t/**\n\t * line number (starts at 1)\n\t */\n\tpublic readonly lineNumber: number;\n\t/**\n\t * column (the first character in a line is between column 1 and column 2)\n\t */\n\tpublic readonly column: number;\n\n\tconstructor(lineNumber: number, column: number) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.column = column;\n\t}\n\n\t/**\n\t * Create a new position from this position.\n\t *\n\t * @param newLineNumber new line number\n\t * @param newColumn new column\n\t */\n\twith(newLineNumber: number = this.lineNumber, newColumn: number = this.column): Position {\n\t\tif (newLineNumber === this.lineNumber && newColumn === this.column) {\n\t\t\treturn this;\n\t\t} else {\n\t\t\treturn new Position(newLineNumber, newColumn);\n\t\t}\n\t}\n\n\t/**\n\t * Derive a new position from this position.\n\t *\n\t * @param deltaLineNumber line number delta\n\t * @param deltaColumn column delta\n\t */\n\tdelta(deltaLineNumber: number = 0, deltaColumn: number = 0): Position {\n\t\treturn this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);\n\t}\n\n\t/**\n\t * Test if this position equals other position\n\t */\n\tpublic equals(other: IPosition): boolean {\n\t\treturn Position.equals(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` equals position `b`\n\t */\n\tpublic static equals(a: IPosition | null, b: IPosition | null): boolean {\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\t!!a &&\n\t\t\t!!b &&\n\t\t\ta.lineNumber === b.lineNumber &&\n\t\t\ta.column === b.column\n\t\t);\n\t}\n\n\t/**\n\t * Test if this position is before other position.\n\t * If the two positions are equal, the result will be false.\n\t */\n\tpublic isBefore(other: IPosition): boolean {\n\t\treturn Position.isBefore(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` is before position `b`.\n\t * If the two positions are equal, the result will be false.\n\t */\n\tpublic static isBefore(a: IPosition, b: IPosition): boolean {\n\t\tif (a.lineNumber < b.lineNumber) {\n\t\t\treturn true;\n\t\t}\n\t\tif (b.lineNumber < a.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\treturn a.column < b.column;\n\t}\n\n\t/**\n\t * Test if this position is before other position.\n\t * If the two positions are equal, the result will be true.\n\t */\n\tpublic isBeforeOrEqual(other: IPosition): boolean {\n\t\treturn Position.isBeforeOrEqual(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` is before position `b`.\n\t * If the two positions are equal, the result will be true.\n\t */\n\tpublic static isBeforeOrEqual(a: IPosition, b: IPosition): boolean {\n\t\tif (a.lineNumber < b.lineNumber) {\n\t\t\treturn true;\n\t\t}\n\t\tif (b.lineNumber < a.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\treturn a.column <= b.column;\n\t}\n\n\t/**\n\t * A function that compares positions, useful for sorting\n\t */\n\tpublic static compare(a: IPosition, b: IPosition): number {\n\t\tconst aLineNumber = a.lineNumber | 0;\n\t\tconst bLineNumber = b.lineNumber | 0;\n\n\t\tif (aLineNumber === bLineNumber) {\n\t\t\tconst aColumn = a.column | 0;\n\t\t\tconst bColumn = b.column | 0;\n\t\t\treturn aColumn - bColumn;\n\t\t}\n\n\t\treturn aLineNumber - bLineNumber;\n\t}\n\n\t/**\n\t * Clone this position.\n\t */\n\tpublic clone(): Position {\n\t\treturn new Position(this.lineNumber, this.column);\n\t}\n\n\t/**\n\t * Convert to a human-readable representation.\n\t */\n\tpublic toString(): string {\n\t\treturn '(' + this.lineNumber + ',' + this.column + ')';\n\t}\n\n\t// ---\n\n\t/**\n\t * Create a `Position` from an `IPosition`.\n\t */\n\tpublic static lift(pos: IPosition): Position {\n\t\treturn new Position(pos.lineNumber, pos.column);\n\t}\n\n\t/**\n\t * Test if `obj` is an `IPosition`.\n\t */\n\tpublic static isIPosition(obj: any): obj is IPosition {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.lineNumber === 'number')\n\t\t\t&& (typeof obj.column === 'number')\n\t\t);\n\t}\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 { IPosition, Position } from 'vs/editor/common/core/position';\n\n/**\n * A range in the editor. This interface is suitable for serialization.\n */\nexport interface IRange {\n\t/**\n\t * Line number on which the range starts (starts at 1).\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\n\t */\n\treadonly startColumn: number;\n\t/**\n\t * Line number on which the range ends.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * Column on which the range ends in line `endLineNumber`.\n\t */\n\treadonly endColumn: number;\n}\n\n/**\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\n */\nexport class Range {\n\n\t/**\n\t * Line number on which the range starts (starts at 1).\n\t */\n\tpublic readonly startLineNumber: number;\n\t/**\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\n\t */\n\tpublic readonly startColumn: number;\n\t/**\n\t * Line number on which the range ends.\n\t */\n\tpublic readonly endLineNumber: number;\n\t/**\n\t * Column on which the range ends in line `endLineNumber`.\n\t */\n\tpublic readonly endColumn: number;\n\n\tconstructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) {\n\t\tif ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\n\t\t\tthis.startLineNumber = endLineNumber;\n\t\t\tthis.startColumn = endColumn;\n\t\t\tthis.endLineNumber = startLineNumber;\n\t\t\tthis.endColumn = startColumn;\n\t\t} else {\n\t\t\tthis.startLineNumber = startLineNumber;\n\t\t\tthis.startColumn = startColumn;\n\t\t\tthis.endLineNumber = endLineNumber;\n\t\t\tthis.endColumn = endColumn;\n\t\t}\n\t}\n\n\t/**\n\t * Test if this range is empty.\n\t */\n\tpublic isEmpty(): boolean {\n\t\treturn Range.isEmpty(this);\n\t}\n\n\t/**\n\t * Test if `range` is empty.\n\t */\n\tpublic static isEmpty(range: IRange): boolean {\n\t\treturn (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\n\t}\n\n\t/**\n\t * Test if position is in this range. If the position is at the edges, will return true.\n\t */\n\tpublic containsPosition(position: IPosition): boolean {\n\t\treturn Range.containsPosition(this, position);\n\t}\n\n\t/**\n\t * Test if `position` is in `range`. If the position is at the edges, will return true.\n\t */\n\tpublic static containsPosition(range: IRange, position: IPosition): boolean {\n\t\tif (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if `position` is in `range`. If the position is at the edges, will return false.\n\t * @internal\n\t */\n\tpublic static strictContainsPosition(range: IRange, position: IPosition): boolean {\n\t\tif (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if range is in this range. If the range is equal to this range, will return true.\n\t */\n\tpublic containsRange(range: IRange): boolean {\n\t\treturn Range.containsRange(this, range);\n\t}\n\n\t/**\n\t * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\n\t */\n\tpublic static containsRange(range: IRange, otherRange: IRange): boolean {\n\t\tif (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.\n\t */\n\tpublic strictContainsRange(range: IRange): boolean {\n\t\treturn Range.strictContainsRange(this, range);\n\t}\n\n\t/**\n\t * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.\n\t */\n\tpublic static strictContainsRange(range: IRange, otherRange: IRange): boolean {\n\t\tif (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * A reunion of the two ranges.\n\t * The smallest position will be used as the start point, and the largest one as the end point.\n\t */\n\tpublic plusRange(range: IRange): Range {\n\t\treturn Range.plusRange(this, range);\n\t}\n\n\t/**\n\t * A reunion of the two ranges.\n\t * The smallest position will be used as the start point, and the largest one as the end point.\n\t */\n\tpublic static plusRange(a: IRange, b: IRange): Range {\n\t\tlet startLineNumber: number;\n\t\tlet startColumn: number;\n\t\tlet endLineNumber: number;\n\t\tlet endColumn: number;\n\n\t\tif (b.startLineNumber < a.startLineNumber) {\n\t\t\tstartLineNumber = b.startLineNumber;\n\t\t\tstartColumn = b.startColumn;\n\t\t} else if (b.startLineNumber === a.startLineNumber) {\n\t\t\tstartLineNumber = b.startLineNumber;\n\t\t\tstartColumn = Math.min(b.startColumn, a.startColumn);\n\t\t} else {\n\t\t\tstartLineNumber = a.startLineNumber;\n\t\t\tstartColumn = a.startColumn;\n\t\t}\n\n\t\tif (b.endLineNumber > a.endLineNumber) {\n\t\t\tendLineNumber = b.endLineNumber;\n\t\t\tendColumn = b.endColumn;\n\t\t} else if (b.endLineNumber === a.endLineNumber) {\n\t\t\tendLineNumber = b.endLineNumber;\n\t\t\tendColumn = Math.max(b.endColumn, a.endColumn);\n\t\t} else {\n\t\t\tendLineNumber = a.endLineNumber;\n\t\t\tendColumn = a.endColumn;\n\t\t}\n\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t}\n\n\t/**\n\t * A intersection of the two ranges.\n\t */\n\tpublic intersectRanges(range: IRange): Range | null {\n\t\treturn Range.intersectRanges(this, range);\n\t}\n\n\t/**\n\t * A intersection of the two ranges.\n\t */\n\tpublic static intersectRanges(a: IRange, b: IRange): Range | null {\n\t\tlet resultStartLineNumber = a.startLineNumber;\n\t\tlet resultStartColumn = a.startColumn;\n\t\tlet resultEndLineNumber = a.endLineNumber;\n\t\tlet resultEndColumn = a.endColumn;\n\t\tlet otherStartLineNumber = b.startLineNumber;\n\t\tlet otherStartColumn = b.startColumn;\n\t\tlet otherEndLineNumber = b.endLineNumber;\n\t\tlet otherEndColumn = b.endColumn;\n\n\t\tif (resultStartLineNumber < otherStartLineNumber) {\n\t\t\tresultStartLineNumber = otherStartLineNumber;\n\t\t\tresultStartColumn = otherStartColumn;\n\t\t} else if (resultStartLineNumber === otherStartLineNumber) {\n\t\t\tresultStartColumn = Math.max(resultStartColumn, otherStartColumn);\n\t\t}\n\n\t\tif (resultEndLineNumber > otherEndLineNumber) {\n\t\t\tresultEndLineNumber = otherEndLineNumber;\n\t\t\tresultEndColumn = otherEndColumn;\n\t\t} else if (resultEndLineNumber === otherEndLineNumber) {\n\t\t\tresultEndColumn = Math.min(resultEndColumn, otherEndColumn);\n\t\t}\n\n\t\t// Check if selection is now empty\n\t\tif (resultStartLineNumber > resultEndLineNumber) {\n\t\t\treturn null;\n\t\t}\n\t\tif (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\n\t}\n\n\t/**\n\t * Test if this range equals other.\n\t */\n\tpublic equalsRange(other: IRange | null): boolean {\n\t\treturn Range.equalsRange(this, other);\n\t}\n\n\t/**\n\t * Test if range `a` equals `b`.\n\t */\n\tpublic static equalsRange(a: IRange | null, b: IRange | null): boolean {\n\t\treturn (\n\t\t\t!!a &&\n\t\t\t!!b &&\n\t\t\ta.startLineNumber === b.startLineNumber &&\n\t\t\ta.startColumn === b.startColumn &&\n\t\t\ta.endLineNumber === b.endLineNumber &&\n\t\t\ta.endColumn === b.endColumn\n\t\t);\n\t}\n\n\t/**\n\t * Return the end position (which will be after or equal to the start position)\n\t */\n\tpublic getEndPosition(): Position {\n\t\treturn Range.getEndPosition(this);\n\t}\n\n\t/**\n\t * Return the end position (which will be after or equal to the start position)\n\t */\n\tpublic static getEndPosition(range: IRange): Position {\n\t\treturn new Position(range.endLineNumber, range.endColumn);\n\t}\n\n\t/**\n\t * Return the start position (which will be before or equal to the end position)\n\t */\n\tpublic getStartPosition(): Position {\n\t\treturn Range.getStartPosition(this);\n\t}\n\n\t/**\n\t * Return the start position (which will be before or equal to the end position)\n\t */\n\tpublic static getStartPosition(range: IRange): Position {\n\t\treturn new Position(range.startLineNumber, range.startColumn);\n\t}\n\n\t/**\n\t * Transform to a user presentable string representation.\n\t */\n\tpublic toString(): string {\n\t\treturn '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\n\t}\n\n\t/**\n\t * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\n\t */\n\tpublic setEndPosition(endLineNumber: number, endColumn: number): Range {\n\t\treturn new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n\t}\n\n\t/**\n\t * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\n\t */\n\tpublic setStartPosition(startLineNumber: number, startColumn: number): Range {\n\t\treturn new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n\t}\n\n\t/**\n\t * Create a new empty range using this range's start position.\n\t */\n\tpublic collapseToStart(): Range {\n\t\treturn Range.collapseToStart(this);\n\t}\n\n\t/**\n\t * Create a new empty range using this range's start position.\n\t */\n\tpublic static collapseToStart(range: IRange): Range {\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\n\t}\n\n\t// ---\n\n\tpublic static fromPositions(start: IPosition, end: IPosition = start): Range {\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\t/**\n\t * Create a `Range` from an `IRange`.\n\t */\n\tpublic static lift(range: undefined | null): null;\n\tpublic static lift(range: IRange): Range;\n\tpublic static lift(range: IRange | undefined | null): Range | null;\n\tpublic static lift(range: IRange | undefined | null): Range | null {\n\t\tif (!range) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t}\n\n\t/**\n\t * Test if `obj` is an `IRange`.\n\t */\n\tpublic static isIRange(obj: any): obj is IRange {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.startLineNumber === 'number')\n\t\t\t&& (typeof obj.startColumn === 'number')\n\t\t\t&& (typeof obj.endLineNumber === 'number')\n\t\t\t&& (typeof obj.endColumn === 'number')\n\t\t);\n\t}\n\n\t/**\n\t * Test if the two ranges are touching in any way.\n\t */\n\tpublic static areIntersectingOrTouching(a: IRange, b: IRange): boolean {\n\t\t// Check if `a` is before `b`\n\t\tif (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if `b` is before `a`\n\t\tif (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// These ranges must intersect\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if the two ranges are intersecting. If the ranges are touching it returns true.\n\t */\n\tpublic static areIntersecting(a: IRange, b: IRange): boolean {\n\t\t// Check if `a` is before `b`\n\t\tif (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if `b` is before `a`\n\t\tif (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// These ranges must intersect\n\t\treturn true;\n\t}\n\n\t/**\n\t * A function that compares ranges, useful for sorting ranges\n\t * It will first compare ranges on the startPosition and then on the endPosition\n\t */\n\tpublic static compareRangesUsingStarts(a: IRange | null | undefined, b: IRange | null | undefined): number {\n\t\tif (a && b) {\n\t\t\tconst aStartLineNumber = a.startLineNumber | 0;\n\t\t\tconst bStartLineNumber = b.startLineNumber | 0;\n\n\t\t\tif (aStartLineNumber === bStartLineNumber) {\n\t\t\t\tconst aStartColumn = a.startColumn | 0;\n\t\t\t\tconst bStartColumn = b.startColumn | 0;\n\n\t\t\t\tif (aStartColumn === bStartColumn) {\n\t\t\t\t\tconst aEndLineNumber = a.endLineNumber | 0;\n\t\t\t\t\tconst bEndLineNumber = b.endLineNumber | 0;\n\n\t\t\t\t\tif (aEndLineNumber === bEndLineNumber) {\n\t\t\t\t\t\tconst aEndColumn = a.endColumn | 0;\n\t\t\t\t\t\tconst bEndColumn = b.endColumn | 0;\n\t\t\t\t\t\treturn aEndColumn - bEndColumn;\n\t\t\t\t\t}\n\t\t\t\t\treturn aEndLineNumber - bEndLineNumber;\n\t\t\t\t}\n\t\t\t\treturn aStartColumn - bStartColumn;\n\t\t\t}\n\t\t\treturn aStartLineNumber - bStartLineNumber;\n\t\t}\n\t\tconst aExists = (a ? 1 : 0);\n\t\tconst bExists = (b ? 1 : 0);\n\t\treturn aExists - bExists;\n\t}\n\n\t/**\n\t * A function that compares ranges, useful for sorting ranges\n\t * It will first compare ranges on the endPosition and then on the startPosition\n\t */\n\tpublic static compareRangesUsingEnds(a: IRange, b: IRange): number {\n\t\tif (a.endLineNumber === b.endLineNumber) {\n\t\t\tif (a.endColumn === b.endColumn) {\n\t\t\t\tif (a.startLineNumber === b.startLineNumber) {\n\t\t\t\t\treturn a.startColumn - b.startColumn;\n\t\t\t\t}\n\t\t\t\treturn a.startLineNumber - b.startLineNumber;\n\t\t\t}\n\t\t\treturn a.endColumn - b.endColumn;\n\t\t}\n\t\treturn a.endLineNumber - b.endLineNumber;\n\t}\n\n\t/**\n\t * Test if the range spans multiple lines.\n\t */\n\tpublic static spansMultipleLines(range: IRange): boolean {\n\t\treturn range.endLineNumber > range.startLineNumber;\n\t}\n\n\tpublic toJSON(): IRange {\n\t\treturn this;\n\t}\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 * as strings from 'vs/base/common/strings';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EndOfLinePreference } from 'vs/editor/common/model';\n\nexport const _debugComposition = false;\n\nexport interface ITextAreaWrapper {\n\tgetValue(): string;\n\tsetValue(reason: string, value: string): void;\n\n\tgetSelectionStart(): number;\n\tgetSelectionEnd(): number;\n\tsetSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void;\n}\n\nexport interface ISimpleModel {\n\tgetLineCount(): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n}\n\nexport interface ITypeData {\n\ttext: string;\n\treplacePrevCharCnt: number;\n\treplaceNextCharCnt: number;\n\tpositionDelta: number;\n}\n\nexport class TextAreaState {\n\n\tpublic static readonly EMPTY = new TextAreaState('', 0, 0, null, null);\n\n\tpublic readonly value: string;\n\tpublic readonly selectionStart: number;\n\tpublic readonly selectionEnd: number;\n\tpublic readonly selectionStartPosition: Position | null;\n\tpublic readonly selectionEndPosition: Position | null;\n\n\tconstructor(value: string, selectionStart: number, selectionEnd: number, selectionStartPosition: Position | null, selectionEndPosition: Position | null) {\n\t\tthis.value = value;\n\t\tthis.selectionStart = selectionStart;\n\t\tthis.selectionEnd = selectionEnd;\n\t\tthis.selectionStartPosition = selectionStartPosition;\n\t\tthis.selectionEndPosition = selectionEndPosition;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;\n\t}\n\n\tpublic static readFromTextArea(textArea: ITextAreaWrapper): TextAreaState {\n\t\treturn new TextAreaState(textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), null, null);\n\t}\n\n\tpublic collapseSelection(): TextAreaState {\n\t\treturn new TextAreaState(this.value, this.value.length, this.value.length, null, null);\n\t}\n\n\tpublic writeToTextArea(reason: string, textArea: ITextAreaWrapper, select: boolean): void {\n\t\tif (_debugComposition) {\n\t\t\tconsole.log(`writeToTextArea ${reason}: ${this.toString()}`);\n\t\t}\n\t\ttextArea.setValue(reason, this.value);\n\t\tif (select) {\n\t\t\ttextArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd);\n\t\t}\n\t}\n\n\tpublic deduceEditorPosition(offset: number): [Position | null, number, number] {\n\t\tif (offset <= this.selectionStart) {\n\t\t\tconst str = this.value.substring(offset, this.selectionStart);\n\t\t\treturn this._finishDeduceEditorPosition(this.selectionStartPosition, str, -1);\n\t\t}\n\t\tif (offset >= this.selectionEnd) {\n\t\t\tconst str = this.value.substring(this.selectionEnd, offset);\n\t\t\treturn this._finishDeduceEditorPosition(this.selectionEndPosition, str, 1);\n\t\t}\n\t\tconst str1 = this.value.substring(this.selectionStart, offset);\n\t\tif (str1.indexOf(String.fromCharCode(8230)) === -1) {\n\t\t\treturn this._finishDeduceEditorPosition(this.selectionStartPosition, str1, 1);\n\t\t}\n\t\tconst str2 = this.value.substring(offset, this.selectionEnd);\n\t\treturn this._finishDeduceEditorPosition(this.selectionEndPosition, str2, -1);\n\t}\n\n\tprivate _finishDeduceEditorPosition(anchor: Position | null, deltaText: string, signum: number): [Position | null, number, number] {\n\t\tlet lineFeedCnt = 0;\n\t\tlet lastLineFeedIndex = -1;\n\t\twhile ((lastLineFeedIndex = deltaText.indexOf('\\n', lastLineFeedIndex + 1)) !== -1) {\n\t\t\tlineFeedCnt++;\n\t\t}\n\t\treturn [anchor, signum * deltaText.length, lineFeedCnt];\n\t}\n\n\tpublic static deduceInput(previousState: TextAreaState, currentState: TextAreaState, couldBeEmojiInput: boolean): ITypeData {\n\t\tif (!previousState) {\n\t\t\t// This is the EMPTY state\n\t\t\treturn {\n\t\t\t\ttext: '',\n\t\t\t\treplacePrevCharCnt: 0,\n\t\t\t\treplaceNextCharCnt: 0,\n\t\t\t\tpositionDelta: 0\n\t\t\t};\n\t\t}\n\n\t\tif (_debugComposition) {\n\t\t\tconsole.log('------------------------deduceInput');\n\t\t\tconsole.log(`PREVIOUS STATE: ${previousState.toString()}`);\n\t\t\tconsole.log(`CURRENT STATE: ${currentState.toString()}`);\n\t\t}\n\n\t\tconst prefixLength = Math.min(\n\t\t\tstrings.commonPrefixLength(previousState.value, currentState.value),\n\t\t\tpreviousState.selectionStart,\n\t\t\tcurrentState.selectionStart\n\t\t);\n\t\tconst suffixLength = Math.min(\n\t\t\tstrings.commonSuffixLength(previousState.value, currentState.value),\n\t\t\tpreviousState.value.length - previousState.selectionEnd,\n\t\t\tcurrentState.value.length - currentState.selectionEnd\n\t\t);\n\t\tconst previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength);\n\t\tconst currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);\n\t\tconst previousSelectionStart = previousState.selectionStart - prefixLength;\n\t\tconst previousSelectionEnd = previousState.selectionEnd - prefixLength;\n\t\tconst currentSelectionStart = currentState.selectionStart - prefixLength;\n\t\tconst currentSelectionEnd = currentState.selectionEnd - prefixLength;\n\n\t\tif (_debugComposition) {\n\t\t\tconsole.log(`AFTER DIFFING PREVIOUS STATE: <${previousValue}>, selectionStart: ${previousSelectionStart}, selectionEnd: ${previousSelectionEnd}`);\n\t\t\tconsole.log(`AFTER DIFFING CURRENT STATE: <${currentValue}>, selectionStart: ${currentSelectionStart}, selectionEnd: ${currentSelectionEnd}`);\n\t\t}\n\n\t\tif (currentSelectionStart === currentSelectionEnd) {\n\t\t\t// no current selection\n\t\t\tconst replacePreviousCharacters = (previousState.selectionStart - prefixLength);\n\t\t\tif (_debugComposition) {\n\t\t\t\tconsole.log(`REMOVE PREVIOUS: ${replacePreviousCharacters} chars`);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttext: currentValue,\n\t\t\t\treplacePrevCharCnt: replacePreviousCharacters,\n\t\t\t\treplaceNextCharCnt: 0,\n\t\t\t\tpositionDelta: 0\n\t\t\t};\n\t\t}\n\n\t\t// there is a current selection => composition case\n\t\tconst replacePreviousCharacters = previousSelectionEnd - previousSelectionStart;\n\t\treturn {\n\t\t\ttext: currentValue,\n\t\t\treplacePrevCharCnt: replacePreviousCharacters,\n\t\t\treplaceNextCharCnt: 0,\n\t\t\tpositionDelta: 0\n\t\t};\n\t}\n\n\tpublic static deduceAndroidCompositionInput(previousState: TextAreaState, currentState: TextAreaState): ITypeData {\n\t\tif (!previousState) {\n\t\t\t// This is the EMPTY state\n\t\t\treturn {\n\t\t\t\ttext: '',\n\t\t\t\treplacePrevCharCnt: 0,\n\t\t\t\treplaceNextCharCnt: 0,\n\t\t\t\tpositionDelta: 0\n\t\t\t};\n\t\t}\n\n\t\tif (_debugComposition) {\n\t\t\tconsole.log('------------------------deduceAndroidCompositionInput');\n\t\t\tconsole.log(`PREVIOUS STATE: ${previousState.toString()}`);\n\t\t\tconsole.log(`CURRENT STATE: ${currentState.toString()}`);\n\t\t}\n\n\t\tif (previousState.value === currentState.value) {\n\t\t\treturn {\n\t\t\t\ttext: '',\n\t\t\t\treplacePrevCharCnt: 0,\n\t\t\t\treplaceNextCharCnt: 0,\n\t\t\t\tpositionDelta: currentState.selectionEnd - previousState.selectionEnd\n\t\t\t};\n\t\t}\n\n\t\tconst prefixLength = Math.min(strings.commonPrefixLength(previousState.value, currentState.value), previousState.selectionEnd);\n\t\tconst suffixLength = Math.min(strings.commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd);\n\t\tconst previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength);\n\t\tconst currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);\n\t\tconst previousSelectionStart = previousState.selectionStart - prefixLength;\n\t\tconst previousSelectionEnd = previousState.selectionEnd - prefixLength;\n\t\tconst currentSelectionStart = currentState.selectionStart - prefixLength;\n\t\tconst currentSelectionEnd = currentState.selectionEnd - prefixLength;\n\n\t\tif (_debugComposition) {\n\t\t\tconsole.log(`AFTER DIFFING PREVIOUS STATE: <${previousValue}>, selectionStart: ${previousSelectionStart}, selectionEnd: ${previousSelectionEnd}`);\n\t\t\tconsole.log(`AFTER DIFFING CURRENT STATE: <${currentValue}>, selectionStart: ${currentSelectionStart}, selectionEnd: ${currentSelectionEnd}`);\n\t\t}\n\n\t\treturn {\n\t\t\ttext: currentValue,\n\t\t\treplacePrevCharCnt: previousSelectionEnd,\n\t\t\treplaceNextCharCnt: previousValue.length - previousSelectionEnd,\n\t\t\tpositionDelta: currentSelectionEnd - currentValue.length\n\t\t};\n\t}\n}\n\nexport class PagedScreenReaderStrategy {\n\tprivate static _getPageOfLine(lineNumber: number, linesPerPage: number): number {\n\t\treturn Math.floor((lineNumber - 1) / linesPerPage);\n\t}\n\n\tprivate static _getRangeForPage(page: number, linesPerPage: number): Range {\n\t\tconst offset = page * linesPerPage;\n\t\tconst startLineNumber = offset + 1;\n\t\tconst endLineNumber = offset + linesPerPage;\n\t\treturn new Range(startLineNumber, 1, endLineNumber + 1, 1);\n\t}\n\n\tpublic static fromEditorSelection(previousState: TextAreaState, model: ISimpleModel, selection: Range, linesPerPage: number, trimLongText: boolean): TextAreaState {\n\n\t\tconst selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage);\n\t\tconst selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage);\n\n\t\tconst selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage);\n\t\tconst selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage);\n\n\t\tconst pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn))!;\n\t\tlet pretext = model.getValueInRange(pretextRange, EndOfLinePreference.LF);\n\n\t\tconst lastLine = model.getLineCount();\n\t\tconst lastLineMaxColumn = model.getLineMaxColumn(lastLine);\n\t\tconst posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn))!;\n\t\tlet posttext = model.getValueInRange(posttextRange, EndOfLinePreference.LF);\n\n\n\t\tlet text: string;\n\t\tif (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) {\n\t\t\t// take full selection\n\t\t\ttext = model.getValueInRange(selection, EndOfLinePreference.LF);\n\t\t} else {\n\t\t\tconst selectionRange1 = selectionStartPageRange.intersectRanges(selection)!;\n\t\t\tconst selectionRange2 = selectionEndPageRange.intersectRanges(selection)!;\n\t\t\ttext = (\n\t\t\t\tmodel.getValueInRange(selectionRange1, EndOfLinePreference.LF)\n\t\t\t\t+ String.fromCharCode(8230)\n\t\t\t\t+ model.getValueInRange(selectionRange2, EndOfLinePreference.LF)\n\t\t\t);\n\t\t}\n\n\t\t// Chromium handles very poorly text even of a few thousand chars\n\t\t// Cut text to avoid stalling the entire UI\n\t\tif (trimLongText) {\n\t\t\tconst LIMIT_CHARS = 500;\n\t\t\tif (pretext.length > LIMIT_CHARS) {\n\t\t\t\tpretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length);\n\t\t\t}\n\t\t\tif (posttext.length > LIMIT_CHARS) {\n\t\t\t\tposttext = posttext.substring(0, LIMIT_CHARS);\n\t\t\t}\n\t\t\tif (text.length > 2 * LIMIT_CHARS) {\n\t\t\t\ttext = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length);\n\t\t\t}\n\t\t}\n\n\t\treturn new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length, new Position(selection.startLineNumber, selection.startColumn), new Position(selection.endLineNumber, selection.endColumn));\n\t}\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 * as assert from 'vs/base/common/assert';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as objects from 'vs/base/common/objects';\nimport { IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ILineChange } from 'vs/editor/common/diff/diffComputer';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\n\n\ninterface IDiffRange {\n\trhs: boolean;\n\trange: Range;\n}\n\nexport interface Options {\n\tfollowsCaret?: boolean;\n\tignoreCharChanges?: boolean;\n\talwaysRevealFirst?: boolean;\n}\n\nconst defaultOptions: Options = {\n\tfollowsCaret: true,\n\tignoreCharChanges: true,\n\talwaysRevealFirst: true\n};\n\nexport interface IDiffNavigator {\n\tcanNavigate(): boolean;\n\tnext(): void;\n\tprevious(): void;\n\tdispose(): void;\n}\n\n/**\n * Create a new diff navigator for the provided diff editor.\n */\nexport class DiffNavigator extends Disposable implements IDiffNavigator {\n\n\tprivate readonly _editor: IDiffEditor;\n\tprivate readonly _options: Options;\n\tprivate readonly _onDidUpdate = this._register(new Emitter<this>());\n\n\tprivate disposed: boolean;\n\tprivate revealFirst: boolean;\n\tprivate nextIdx: number;\n\tprivate ranges: IDiffRange[];\n\tprivate ignoreSelectionChange: boolean;\n\n\tconstructor(editor: IDiffEditor, options: Options = {}) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._options = objects.mixin(options, defaultOptions, false);\n\n\t\tthis.disposed = false;\n\n\t\tthis.nextIdx = -1;\n\t\tthis.ranges = [];\n\t\tthis.ignoreSelectionChange = false;\n\t\tthis.revealFirst = Boolean(this._options.alwaysRevealFirst);\n\n\t\t// hook up to diff editor for diff, disposal, and caret move\n\t\tthis._register(this._editor.onDidDispose(() => this.dispose()));\n\t\tthis._register(this._editor.onDidUpdateDiff(() => this._onDiffUpdated()));\n\n\t\tif (this._options.followsCaret) {\n\t\t\tthis._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\t\tif (this.ignoreSelectionChange) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.nextIdx = -1;\n\t\t\t}));\n\t\t}\n\t\tif (this._options.alwaysRevealFirst) {\n\t\t\tthis._register(this._editor.getModifiedEditor().onDidChangeModel((e) => {\n\t\t\t\tthis.revealFirst = true;\n\t\t\t}));\n\t\t}\n\n\t\t// init things\n\t\tthis._init();\n\t}\n\n\tprivate _init(): void {\n\t\tconst changes = this._editor.getLineChanges();\n\t\tif (!changes) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate _onDiffUpdated(): void {\n\t\tthis._init();\n\n\t\tthis._compute(this._editor.getLineChanges());\n\t\tif (this.revealFirst) {\n\t\t\t// Only reveal first on first non-null changes\n\t\t\tif (this._editor.getLineChanges() !== null) {\n\t\t\t\tthis.revealFirst = false;\n\t\t\t\tthis.nextIdx = -1;\n\t\t\t\tthis.next(ScrollType.Immediate);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _compute(lineChanges: ILineChange[] | null): void {\n\n\t\t// new ranges\n\t\tthis.ranges = [];\n\n\t\tif (lineChanges) {\n\t\t\t// create ranges from changes\n\t\t\tlineChanges.forEach((lineChange) => {\n\n\t\t\t\tif (!this._options.ignoreCharChanges && lineChange.charChanges) {\n\n\t\t\t\t\tlineChange.charChanges.forEach((charChange) => {\n\t\t\t\t\t\tthis.ranges.push({\n\t\t\t\t\t\t\trhs: true,\n\t\t\t\t\t\t\trange: new Range(\n\t\t\t\t\t\t\t\tcharChange.modifiedStartLineNumber,\n\t\t\t\t\t\t\t\tcharChange.modifiedStartColumn,\n\t\t\t\t\t\t\t\tcharChange.modifiedEndLineNumber,\n\t\t\t\t\t\t\t\tcharChange.modifiedEndColumn)\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t} else {\n\t\t\t\t\tif (lineChange.modifiedEndLineNumber === 0) {\n\t\t\t\t\t\t// a deletion\n\t\t\t\t\t\tthis.ranges.push({\n\t\t\t\t\t\t\trhs: true,\n\t\t\t\t\t\t\trange: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedStartLineNumber + 1, 1)\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// an insertion or modification\n\t\t\t\t\t\tthis.ranges.push({\n\t\t\t\t\t\t\trhs: true,\n\t\t\t\t\t\t\trange: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber + 1, 1)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// sort\n\t\tthis.ranges.sort((left, right) => Range.compareRangesUsingStarts(left.range, right.range));\n\t\tthis._onDidUpdate.fire(this);\n\t}\n\n\tprivate _initIdx(fwd: boolean): void {\n\t\tlet found = false;\n\t\tconst position = this._editor.getPosition();\n\t\tif (!position) {\n\t\t\tthis.nextIdx = 0;\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0, len = this.ranges.length; i < len && !found; i++) {\n\t\t\tconst range = this.ranges[i].range;\n\t\t\tif (position.isBeforeOrEqual(range.getStartPosition())) {\n\t\t\t\tthis.nextIdx = i + (fwd ? 0 : -1);\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t}\n\t\tif (!found) {\n\t\t\t// after the last change\n\t\t\tthis.nextIdx = fwd ? 0 : this.ranges.length - 1;\n\t\t}\n\t\tif (this.nextIdx < 0) {\n\t\t\tthis.nextIdx = this.ranges.length - 1;\n\t\t}\n\t}\n\n\tprivate _move(fwd: boolean, scrollType: ScrollType): void {\n\t\tassert.ok(!this.disposed, 'Illegal State - diff navigator has been disposed');\n\n\t\tif (!this.canNavigate()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.nextIdx === -1) {\n\t\t\tthis._initIdx(fwd);\n\n\t\t} else if (fwd) {\n\t\t\tthis.nextIdx += 1;\n\t\t\tif (this.nextIdx >= this.ranges.length) {\n\t\t\t\tthis.nextIdx = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.nextIdx -= 1;\n\t\t\tif (this.nextIdx < 0) {\n\t\t\t\tthis.nextIdx = this.ranges.length - 1;\n\t\t\t}\n\t\t}\n\n\t\tconst info = this.ranges[this.nextIdx];\n\t\tthis.ignoreSelectionChange = true;\n\t\ttry {\n\t\t\tconst pos = info.range.getStartPosition();\n\t\t\tthis._editor.setPosition(pos);\n\t\t\tthis._editor.revealRangeInCenter(info.range, scrollType);\n\t\t} finally {\n\t\t\tthis.ignoreSelectionChange = false;\n\t\t}\n\t}\n\n\tcanNavigate(): boolean {\n\t\treturn this.ranges && this.ranges.length > 0;\n\t}\n\n\tnext(scrollType: ScrollType = ScrollType.Smooth): void {\n\t\tthis._move(true, scrollType);\n\t}\n\n\tprevious(scrollType: ScrollType = ScrollType.Smooth): void {\n\t\tthis._move(false, scrollType);\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.ranges = [];\n\t\tthis.disposed = true;\n\t}\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 { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\n\n/**\n * A single edit operation, that acts as a simple replace.\n * i.e. Replace text at `range` with `text` in model.\n */\nexport interface ISingleEditOperation {\n\t/**\n\t * The range to replace. This can be empty to emulate a simple insert.\n\t */\n\trange: IRange;\n\t/**\n\t * The text to replace with. This can be null to emulate a simple delete.\n\t */\n\ttext: string | null;\n\t/**\n\t * This indicates that this operation has \"insert\" semantics.\n\t * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.\n\t */\n\tforceMoveMarkers?: boolean;\n}\n\nexport class EditOperation {\n\n\tpublic static insert(position: Position, text: string): ISingleEditOperation {\n\t\treturn {\n\t\t\trange: new Range(position.lineNumber, position.column, position.lineNumber, position.column),\n\t\t\ttext: text,\n\t\t\tforceMoveMarkers: true\n\t\t};\n\t}\n\n\tpublic static delete(range: Range): ISingleEditOperation {\n\t\treturn {\n\t\t\trange: range,\n\t\t\ttext: null\n\t\t};\n\t}\n\n\tpublic static replace(range: Range, text: string | null): ISingleEditOperation {\n\t\treturn {\n\t\t\trange: range,\n\t\t\ttext: text\n\t\t};\n\t}\n\n\tpublic static replaceMove(range: Range, text: string | null): ISingleEditOperation {\n\t\treturn {\n\t\t\trange: range,\n\t\t\ttext: text,\n\t\t\tforceMoveMarkers: true\n\t\t};\n\t}\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 * as strings from 'vs/base/common/strings';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class TrimTrailingWhitespaceCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate _selectionId: string | null;\n\tprivate readonly _cursors: Position[];\n\n\tconstructor(selection: Selection, cursors: Position[]) {\n\t\tthis._selection = selection;\n\t\tthis._cursors = cursors;\n\t\tthis._selectionId = null;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tconst ops = trimTrailingWhitespace(model, this._cursors);\n\t\tfor (let i = 0, len = ops.length; i < len; i++) {\n\t\t\tconst op = ops[i];\n\n\t\t\tbuilder.addEditOperation(op.range, op.text);\n\t\t}\n\n\t\tthis._selectionId = builder.trackSelection(this._selection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this._selectionId!);\n\t}\n}\n\n/**\n * Generate commands for trimming trailing whitespace on a model and ignore lines on which cursors are sitting.\n */\nexport function trimTrailingWhitespace(model: ITextModel, cursors: Position[]): ISingleEditOperation[] {\n\t// Sort cursors ascending\n\tcursors.sort((a, b) => {\n\t\tif (a.lineNumber === b.lineNumber) {\n\t\t\treturn a.column - b.column;\n\t\t}\n\t\treturn a.lineNumber - b.lineNumber;\n\t});\n\n\t// Reduce multiple cursors on the same line and only keep the last one on the line\n\tfor (let i = cursors.length - 2; i >= 0; i--) {\n\t\tif (cursors[i].lineNumber === cursors[i + 1].lineNumber) {\n\t\t\t// Remove cursor at `i`\n\t\t\tcursors.splice(i, 1);\n\t\t}\n\t}\n\n\tconst r: ISingleEditOperation[] = [];\n\tlet rLen = 0;\n\tlet cursorIndex = 0;\n\tconst cursorLen = cursors.length;\n\n\tfor (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) {\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tconst maxLineColumn = lineContent.length + 1;\n\t\tlet minEditColumn = 0;\n\n\t\tif (cursorIndex < cursorLen && cursors[cursorIndex].lineNumber === lineNumber) {\n\t\t\tminEditColumn = cursors[cursorIndex].column;\n\t\t\tcursorIndex++;\n\t\t\tif (minEditColumn === maxLineColumn) {\n\t\t\t\t// The cursor is at the end of the line => no edits for sure on this line\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (lineContent.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst lastNonWhitespaceIndex = strings.lastNonWhitespaceIndex(lineContent);\n\n\t\tlet fromColumn = 0;\n\t\tif (lastNonWhitespaceIndex === -1) {\n\t\t\t// Entire line is whitespace\n\t\t\tfromColumn = 1;\n\t\t} else if (lastNonWhitespaceIndex !== lineContent.length - 1) {\n\t\t\t// There is trailing whitespace\n\t\t\tfromColumn = lastNonWhitespaceIndex + 2;\n\t\t} else {\n\t\t\t// There is no trailing whitespace\n\t\t\tcontinue;\n\t\t}\n\n\t\tfromColumn = Math.max(minEditColumn, fromColumn);\n\t\tr[rLen++] = EditOperation.delete(new Range(\n\t\t\tlineNumber, fromColumn,\n\t\t\tlineNumber, maxLineColumn\n\t\t));\n\t}\n\n\treturn r;\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\n/**\n * A very VM friendly rgba datastructure.\n * Please don't touch unless you take a look at the IR.\n */\nexport class RGBA8 {\n\t_rgba8Brand: void = undefined;\n\n\tstatic readonly Empty = new RGBA8(0, 0, 0, 0);\n\n\t/**\n\t * Red: integer in [0-255]\n\t */\n\tpublic readonly r: number;\n\t/**\n\t * Green: integer in [0-255]\n\t */\n\tpublic readonly g: number;\n\t/**\n\t * Blue: integer in [0-255]\n\t */\n\tpublic readonly b: number;\n\t/**\n\t * Alpha: integer in [0-255]\n\t */\n\tpublic readonly a: number;\n\n\tconstructor(r: number, g: number, b: number, a: number) {\n\t\tthis.r = RGBA8._clamp(r);\n\t\tthis.g = RGBA8._clamp(g);\n\t\tthis.b = RGBA8._clamp(b);\n\t\tthis.a = RGBA8._clamp(a);\n\t}\n\n\tpublic equals(other: RGBA8): boolean {\n\t\treturn (\n\t\t\tthis.r === other.r\n\t\t\t&& this.g === other.g\n\t\t\t&& this.b === other.b\n\t\t\t&& this.a === other.a\n\t\t);\n\t}\n\n\tpublic static _clamp(c: number): number {\n\t\tif (c < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (c > 255) {\n\t\t\treturn 255;\n\t\t}\n\t\treturn c | 0;\n\t}\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 { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\n\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport interface ISelection {\n\t/**\n\t * The line number on which the selection has started.\n\t */\n\treadonly selectionStartLineNumber: number;\n\t/**\n\t * The column on `selectionStartLineNumber` where the selection has started.\n\t */\n\treadonly selectionStartColumn: number;\n\t/**\n\t * The line number on which the selection has ended.\n\t */\n\treadonly positionLineNumber: number;\n\t/**\n\t * The column on `positionLineNumber` where the selection has ended.\n\t */\n\treadonly positionColumn: number;\n}\n\n/**\n * The direction of a selection.\n */\nexport const enum SelectionDirection {\n\t/**\n\t * The selection starts above where it ends.\n\t */\n\tLTR,\n\t/**\n\t * The selection starts below where it ends.\n\t */\n\tRTL\n}\n\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport class Selection extends Range {\n\t/**\n\t * The line number on which the selection has started.\n\t */\n\tpublic readonly selectionStartLineNumber: number;\n\t/**\n\t * The column on `selectionStartLineNumber` where the selection has started.\n\t */\n\tpublic readonly selectionStartColumn: number;\n\t/**\n\t * The line number on which the selection has ended.\n\t */\n\tpublic readonly positionLineNumber: number;\n\t/**\n\t * The column on `positionLineNumber` where the selection has ended.\n\t */\n\tpublic readonly positionColumn: number;\n\n\tconstructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number) {\n\t\tsuper(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\n\t\tthis.selectionStartLineNumber = selectionStartLineNumber;\n\t\tthis.selectionStartColumn = selectionStartColumn;\n\t\tthis.positionLineNumber = positionLineNumber;\n\t\tthis.positionColumn = positionColumn;\n\t}\n\n\t/**\n\t * Transform to a human-readable representation.\n\t */\n\tpublic override toString(): string {\n\t\treturn '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\n\t}\n\n\t/**\n\t * Test if equals other selection.\n\t */\n\tpublic equalsSelection(other: ISelection): boolean {\n\t\treturn (\n\t\t\tSelection.selectionsEqual(this, other)\n\t\t);\n\t}\n\n\t/**\n\t * Test if the two selections are equal.\n\t */\n\tpublic static selectionsEqual(a: ISelection, b: ISelection): boolean {\n\t\treturn (\n\t\t\ta.selectionStartLineNumber === b.selectionStartLineNumber &&\n\t\t\ta.selectionStartColumn === b.selectionStartColumn &&\n\t\t\ta.positionLineNumber === b.positionLineNumber &&\n\t\t\ta.positionColumn === b.positionColumn\n\t\t);\n\t}\n\n\t/**\n\t * Get directions (LTR or RTL).\n\t */\n\tpublic getDirection(): SelectionDirection {\n\t\tif (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\n\t\t\treturn SelectionDirection.LTR;\n\t\t}\n\t\treturn SelectionDirection.RTL;\n\t}\n\n\t/**\n\t * Create a new selection with a different `positionLineNumber` and `positionColumn`.\n\t */\n\tpublic override setEndPosition(endLineNumber: number, endColumn: number): Selection {\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\n\t\t\treturn new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n\t\t}\n\t\treturn new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\n\t}\n\n\t/**\n\t * Get the position at `positionLineNumber` and `positionColumn`.\n\t */\n\tpublic getPosition(): Position {\n\t\treturn new Position(this.positionLineNumber, this.positionColumn);\n\t}\n\n\t/**\n\t * Get the position at the start of the selection.\n\t*/\n\tpublic getSelectionStart(): Position {\n\t\treturn new Position(this.selectionStartLineNumber, this.selectionStartColumn);\n\t}\n\n\t/**\n\t * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\n\t */\n\tpublic override setStartPosition(startLineNumber: number, startColumn: number): Selection {\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\n\t\t\treturn new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n\t\t}\n\t\treturn new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\n\t}\n\n\t// ----\n\n\t/**\n\t * Create a `Selection` from one or two positions\n\t */\n\tpublic static override fromPositions(start: IPosition, end: IPosition = start): Selection {\n\t\treturn new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\t/**\n\t * Creates a `Selection` from a range, given a direction.\n\t */\n\tpublic static fromRange(range: Range, direction: SelectionDirection): Selection {\n\t\tif (direction === SelectionDirection.LTR) {\n\t\t\treturn new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t\t} else {\n\t\t\treturn new Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);\n\t\t}\n\t}\n\n\t/**\n\t * Create a `Selection` from an `ISelection`.\n\t */\n\tpublic static liftSelection(sel: ISelection): Selection {\n\t\treturn new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\n\t}\n\n\t/**\n\t * `a` equals `b`.\n\t */\n\tpublic static selectionsArrEqual(a: ISelection[], b: ISelection[]): boolean {\n\t\tif (a && !b || !a && b) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (a.length !== b.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0, len = a.length; i < len; i++) {\n\t\t\tif (!this.selectionsEqual(a[i], b[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if `obj` is an `ISelection`.\n\t */\n\tpublic static isISelection(obj: any): obj is ISelection {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.selectionStartLineNumber === 'number')\n\t\t\t&& (typeof obj.selectionStartColumn === 'number')\n\t\t\t&& (typeof obj.positionLineNumber === 'number')\n\t\t\t&& (typeof obj.positionColumn === 'number')\n\t\t);\n\t}\n\n\t/**\n\t * Create with a direction.\n\t */\n\tpublic static createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection): Selection {\n\n\t\tif (direction === SelectionDirection.LTR) {\n\t\t\treturn new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\n\t\t}\n\n\t\treturn new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\n\t}\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 * as browser from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { Mimes } from 'vs/base/common/mime';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { ITextAreaWrapper, ITypeData, TextAreaState, _debugComposition } from 'vs/editor/browser/controller/textAreaState';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\n\nexport namespace TextAreaSyntethicEvents {\n\texport const Tap = '-monaco-textarea-synthetic-tap';\n}\n\nexport interface ICompositionData {\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false\n};\n\nexport interface IPasteData {\n\ttext: string;\n\tmetadata: ClipboardStoredMetadata | null;\n}\n\nexport interface ClipboardDataToCopy {\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null | undefined;\n\ttext: string;\n\thtml: string | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ClipboardStoredMetadata {\n\tversion: 1;\n\tisFromEmptySelection: boolean | undefined;\n\tmulticursorText: string[] | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ITextAreaInputHost {\n\tgetDataToCopy(): ClipboardDataToCopy;\n\tgetScreenReaderContent(currentState: TextAreaState): TextAreaState;\n\tdeduceModelPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n}\n\ninterface InMemoryClipboardMetadata {\n\tlastCopiedValue: string;\n\tdata: ClipboardStoredMetadata;\n}\n\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n\tpublic static readonly INSTANCE = new InMemoryClipboardMetadataManager();\n\n\tprivate _lastState: InMemoryClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(lastCopiedValue: string, data: ClipboardStoredMetadata): void {\n\t\tthis._lastState = { lastCopiedValue, data };\n\t}\n\n\tpublic get(pastedText: string): ClipboardStoredMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState.data;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport interface ICompositionStartEvent {\n\tdata: string;\n}\n\nexport interface ICompleteTextAreaWrapper extends ITextAreaWrapper {\n\treadonly onKeyDown: Event<KeyboardEvent>;\n\treadonly onKeyUp: Event<KeyboardEvent>;\n\treadonly onCompositionStart: Event<CompositionEvent>;\n\treadonly onCompositionUpdate: Event<CompositionEvent>;\n\treadonly onCompositionEnd: Event<CompositionEvent>;\n\treadonly onInput: Event<InputEvent>;\n\treadonly onCut: Event<ClipboardEvent>;\n\treadonly onCopy: Event<ClipboardEvent>;\n\treadonly onPaste: Event<ClipboardEvent>;\n\treadonly onFocus: Event<FocusEvent>;\n\treadonly onBlur: Event<FocusEvent>;\n\treadonly onSyntheticTap: Event<void>;\n\n\tsetIgnoreSelectionChangeTime(reason: string): void;\n\tgetIgnoreSelectionChangeTime(): number;\n\tresetSelectionChangeTime(): void;\n\n\thasFocus(): boolean;\n}\n\nexport interface IBrowser {\n\tisAndroid: boolean;\n\tisFirefox: boolean;\n\tisChrome: boolean;\n\tisSafari: boolean;\n}\n\nclass CompositionContext {\n\n\tprivate _lastTypeTextLength: number;\n\n\tconstructor() {\n\t\tthis._lastTypeTextLength = 0;\n\t}\n\n\tpublic handleCompositionUpdate(text: string | null | undefined): ITypeData {\n\t\ttext = text || '';\n\t\tconst typeInput: ITypeData = {\n\t\t\ttext: text,\n\t\t\treplacePrevCharCnt: this._lastTypeTextLength,\n\t\t\treplaceNextCharCnt: 0,\n\t\t\tpositionDelta: 0\n\t\t};\n\t\tthis._lastTypeTextLength = text.length;\n\t\treturn typeInput;\n\t}\n}\n\n/**\n * Writes screen reader content to the textarea and is able to analyze its input events to generate:\n * - onCut\n * - onPaste\n * - onType\n *\n * Composition events are generated for presentation purposes (composition input is reflected in onType).\n */\nexport class TextAreaInput extends Disposable {\n\n\tprivate _onFocus = this._register(new Emitter<void>());\n\tpublic readonly onFocus: Event<void> = this._onFocus.event;\n\n\tprivate _onBlur = this._register(new Emitter<void>());\n\tpublic readonly onBlur: Event<void> = this._onBlur.event;\n\n\tprivate _onKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;\n\n\tprivate _onKeyUp = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;\n\n\tprivate _onCut = this._register(new Emitter<void>());\n\tpublic readonly onCut: Event<void> = this._onCut.event;\n\n\tprivate _onPaste = this._register(new Emitter<IPasteData>());\n\tpublic readonly onPaste: Event<IPasteData> = this._onPaste.event;\n\n\tprivate _onType = this._register(new Emitter<ITypeData>());\n\tpublic readonly onType: Event<ITypeData> = this._onType.event;\n\n\tprivate _onCompositionStart = this._register(new Emitter<ICompositionStartEvent>());\n\tpublic readonly onCompositionStart: Event<ICompositionStartEvent> = this._onCompositionStart.event;\n\n\tprivate _onCompositionUpdate = this._register(new Emitter<ICompositionData>());\n\tpublic readonly onCompositionUpdate: Event<ICompositionData> = this._onCompositionUpdate.event;\n\n\tprivate _onCompositionEnd = this._register(new Emitter<void>());\n\tpublic readonly onCompositionEnd: Event<void> = this._onCompositionEnd.event;\n\n\tprivate _onSelectionChangeRequest = this._register(new Emitter<Selection>());\n\tpublic readonly onSelectionChangeRequest: Event<Selection> = this._onSelectionChangeRequest.event;\n\n\t// ---\n\n\tprivate readonly _asyncTriggerCut: RunOnceScheduler;\n\tprivate readonly _asyncFocusGainWriteScreenReaderContent: RunOnceScheduler;\n\n\tprivate _textAreaState: TextAreaState;\n\tprivate _selectionChangeListener: IDisposable | null;\n\n\tprivate _hasFocus: boolean;\n\tprivate _currentComposition: CompositionContext | null;\n\n\tconstructor(\n\t\tprivate readonly _host: ITextAreaInputHost,\n\t\tprivate readonly _textArea: ICompleteTextAreaWrapper,\n\t\tprivate readonly _OS: OperatingSystem,\n\t\tprivate readonly _browser: IBrowser\n\t) {\n\t\tsuper();\n\t\tthis._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0));\n\t\tthis._asyncFocusGainWriteScreenReaderContent = this._register(new RunOnceScheduler(() => this.writeScreenReaderContent('asyncFocusGain'), 0));\n\n\t\tthis._textAreaState = TextAreaState.EMPTY;\n\t\tthis._selectionChangeListener = null;\n\t\tthis.writeScreenReaderContent('ctor');\n\n\t\tthis._hasFocus = false;\n\t\tthis._currentComposition = null;\n\n\t\tlet lastKeyDown: IKeyboardEvent | null = null;\n\n\t\tthis._register(this._textArea.onKeyDown((_e) => {\n\t\t\tconst e = new StandardKeyboardEvent(_e);\n\t\t\tif (e.keyCode === KeyCode.KEY_IN_COMPOSITION\n\t\t\t\t|| (this._currentComposition && e.keyCode === KeyCode.Backspace)) {\n\t\t\t\t// Stop propagation for keyDown events if the IME is processing key input\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\t// Prevent default always for `Esc`, otherwise it will generate a keypress\n\t\t\t\t// See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\tlastKeyDown = e;\n\t\t\tthis._onKeyDown.fire(e);\n\t\t}));\n\n\t\tthis._register(this._textArea.onKeyUp((_e) => {\n\t\t\tconst e = new StandardKeyboardEvent(_e);\n\t\t\tthis._onKeyUp.fire(e);\n\t\t}));\n\n\t\tthis._register(this._textArea.onCompositionStart((e) => {\n\t\t\tif (_debugComposition) {\n\t\t\t\tconsole.log(`[compositionstart]`, e);\n\t\t\t}\n\n\t\t\tconst currentComposition = new CompositionContext();\n\t\t\tif (this._currentComposition) {\n\t\t\t\t// simply reset the composition context\n\t\t\t\tthis._currentComposition = currentComposition;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentComposition = currentComposition;\n\n\t\t\tif (\n\t\t\t\tthis._OS === OperatingSystem.Macintosh\n\t\t\t\t&& lastKeyDown\n\t\t\t\t&& lastKeyDown.equals(KeyCode.KEY_IN_COMPOSITION)\n\t\t\t\t&& this._textAreaState.selectionStart === this._textAreaState.selectionEnd\n\t\t\t\t&& this._textAreaState.selectionStart > 0\n\t\t\t\t&& this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e.data\n\t\t\t\t&& (lastKeyDown.code === 'ArrowRight' || lastKeyDown.code === 'ArrowLeft')\n\t\t\t) {\n\t\t\t\t// Handling long press case on Chromium/Safari macOS + arrow key => pretend the character was selected\n\t\t\t\tif (_debugComposition) {\n\t\t\t\t\tconsole.log(`[compositionstart] Handling long press case on macOS + arrow key`, e);\n\t\t\t\t}\n\t\t\t\t// Pretend the previous character was composed (in order to get it removed by subsequent compositionupdate events)\n\t\t\t\tcurrentComposition.handleCompositionUpdate('x');\n\t\t\t\tthis._onCompositionStart.fire({ data: e.data });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this._browser.isAndroid) {\n\t\t\t\t// when tapping on the editor, Android enters composition mode to edit the current word\n\t\t\t\t// so we cannot clear the textarea on Android and we must pretend the current word was selected\n\t\t\t\tthis._onCompositionStart.fire({ data: e.data });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onCompositionStart.fire({ data: e.data });\n\t\t}));\n\n\t\tthis._register(this._textArea.onCompositionUpdate((e) => {\n\t\t\tif (_debugComposition) {\n\t\t\t\tconsole.log(`[compositionupdate]`, e);\n\t\t\t}\n\t\t\tconst currentComposition = this._currentComposition;\n\t\t\tif (!currentComposition) {\n\t\t\t\t// should not be possible to receive a 'compositionupdate' without a 'compositionstart'\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._browser.isAndroid) {\n\t\t\t\t// On Android, the data sent with the composition update event is unusable.\n\t\t\t\t// For example, if the cursor is in the middle of a word like Mic|osoft\n\t\t\t\t// and Microsoft is chosen from the keyboard's suggestions, the e.data will contain \"Microsoft\".\n\t\t\t\t// This is not really usable because it doesn't tell us where the edit began and where it ended.\n\t\t\t\tconst newState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\t\tconst typeInput = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);\n\t\t\t\tthis._textAreaState = newState;\n\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t\tthis._onCompositionUpdate.fire(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst typeInput = currentComposition.handleCompositionUpdate(e.data);\n\t\t\tthis._textAreaState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\tthis._onType.fire(typeInput);\n\t\t\tthis._onCompositionUpdate.fire(e);\n\t\t}));\n\n\t\tthis._register(this._textArea.onCompositionEnd((e) => {\n\t\t\tif (_debugComposition) {\n\t\t\t\tconsole.log(`[compositionend]`, e);\n\t\t\t}\n\t\t\tconst currentComposition = this._currentComposition;\n\t\t\tif (!currentComposition) {\n\t\t\t\t// https://github.com/microsoft/monaco-editor/issues/1663\n\t\t\t\t// On iOS 13.2, Chinese system IME randomly trigger an additional compositionend event with empty data\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentComposition = null;\n\n\t\t\tif (this._browser.isAndroid) {\n\t\t\t\t// On Android, the data sent with the composition update event is unusable.\n\t\t\t\t// For example, if the cursor is in the middle of a word like Mic|osoft\n\t\t\t\t// and Microsoft is chosen from the keyboard's suggestions, the e.data will contain \"Microsoft\".\n\t\t\t\t// This is not really usable because it doesn't tell us where the edit began and where it ended.\n\t\t\t\tconst newState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\t\tconst typeInput = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);\n\t\t\t\tthis._textAreaState = newState;\n\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t\tthis._onCompositionEnd.fire();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst typeInput = currentComposition.handleCompositionUpdate(e.data);\n\t\t\tthis._textAreaState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\tthis._onType.fire(typeInput);\n\t\t\tthis._onCompositionEnd.fire();\n\t\t}));\n\n\t\tthis._register(this._textArea.onInput((e) => {\n\t\t\tif (_debugComposition) {\n\t\t\t\tconsole.log(`[input]`, e);\n\t\t\t}\n\n\t\t\t// Pretend here we touched the text area, as the `input` event will most likely\n\t\t\t// result in a `selectionchange` event which we want to ignore\n\t\t\tthis._textArea.setIgnoreSelectionChangeTime('received input event');\n\n\t\t\tif (this._currentComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\tconst typeInput = TextAreaState.deduceInput(this._textAreaState, newState, /*couldBeEmojiInput*/this._OS === OperatingSystem.Macintosh);\n\n\t\t\tif (typeInput.replacePrevCharCnt === 0 && typeInput.text.length === 1 && strings.isHighSurrogate(typeInput.text.charCodeAt(0))) {\n\t\t\t\t// Ignore invalid input but keep it around for next time\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._textAreaState = newState;\n\t\t\tif (\n\t\t\t\ttypeInput.text !== ''\n\t\t\t\t|| typeInput.replacePrevCharCnt !== 0\n\t\t\t\t|| typeInput.replaceNextCharCnt !== 0\n\t\t\t\t|| typeInput.positionDelta !== 0\n\t\t\t) {\n\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t}\n\t\t}));\n\n\t\t// --- Clipboard operations\n\n\t\tthis._register(this._textArea.onCut((e) => {\n\t\t\t// Pretend here we touched the text area, as the `cut` event will most likely\n\t\t\t// result in a `selectionchange` event which we want to ignore\n\t\t\tthis._textArea.setIgnoreSelectionChangeTime('received cut event');\n\n\t\t\tthis._ensureClipboardGetsEditorSelection(e);\n\t\t\tthis._asyncTriggerCut.schedule();\n\t\t}));\n\n\t\tthis._register(this._textArea.onCopy((e) => {\n\t\t\tthis._ensureClipboardGetsEditorSelection(e);\n\t\t}));\n\n\t\tthis._register(this._textArea.onPaste((e) => {\n\t\t\t// Pretend here we touched the text area, as the `paste` event will most likely\n\t\t\t// result in a `selectionchange` event which we want to ignore\n\t\t\tthis._textArea.setIgnoreSelectionChangeTime('received paste event');\n\n\t\t\te.preventDefault();\n\n\t\t\tif (!e.clipboardData) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\t\tif (!text) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// try the in-memory store\n\t\t\tmetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\n\t\t\tthis._onPaste.fire({\n\t\t\t\ttext: text,\n\t\t\t\tmetadata: metadata\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(this._textArea.onFocus(() => {\n\t\t\tconst hadFocus = this._hasFocus;\n\n\t\t\tthis._setHasFocus(true);\n\n\t\t\tif (this._browser.isSafari && !hadFocus && this._hasFocus) {\n\t\t\t\t// When \"tabbing into\" the textarea, immediately after dispatching the 'focus' event,\n\t\t\t\t// Safari will always move the selection at offset 0 in the textarea\n\t\t\t\tthis._asyncFocusGainWriteScreenReaderContent.schedule();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._textArea.onBlur(() => {\n\t\t\tif (this._currentComposition) {\n\t\t\t\t// See https://github.com/microsoft/vscode/issues/112621\n\t\t\t\t// where compositionend is not triggered when the editor\n\t\t\t\t// is taken off-dom during a composition\n\n\t\t\t\t// Clear the flag to be able to write to the textarea\n\t\t\t\tthis._currentComposition = null;\n\n\t\t\t\t// Clear the textarea to avoid an unwanted cursor type\n\t\t\t\tthis.writeScreenReaderContent('blurWithoutCompositionEnd');\n\n\t\t\t\t// Fire artificial composition end\n\t\t\t\tthis._onCompositionEnd.fire();\n\t\t\t}\n\t\t\tthis._setHasFocus(false);\n\t\t}));\n\t\tthis._register(this._textArea.onSyntheticTap(() => {\n\t\t\tif (this._browser.isAndroid && this._currentComposition) {\n\t\t\t\t// on Android, tapping does not cancel the current composition, so the\n\t\t\t\t// textarea is stuck showing the old composition\n\n\t\t\t\t// Clear the flag to be able to write to the textarea\n\t\t\t\tthis._currentComposition = null;\n\n\t\t\t\t// Clear the textarea to avoid an unwanted cursor type\n\t\t\t\tthis.writeScreenReaderContent('tapWithoutCompositionEnd');\n\n\t\t\t\t// Fire artificial composition end\n\t\t\t\tthis._onCompositionEnd.fire();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _installSelectionChangeListener(): IDisposable {\n\t\t// See https://github.com/microsoft/vscode/issues/27216 and https://github.com/microsoft/vscode/issues/98256\n\t\t// When using a Braille display, it is possible for users to reposition the\n\t\t// system caret. This is reflected in Chrome as a `selectionchange` event.\n\t\t//\n\t\t// The `selectionchange` event appears to be emitted under numerous other circumstances,\n\t\t// so it is quite a challenge to distinguish a `selectionchange` coming in from a user\n\t\t// using a Braille display from all the other cases.\n\t\t//\n\t\t// The problems with the `selectionchange` event are:\n\t\t// * the event is emitted when the textarea is focused programmatically -- textarea.focus()\n\t\t// * the event is emitted when the selection is changed in the textarea programmatically -- textarea.setSelectionRange(...)\n\t\t// * the event is emitted when the value of the textarea is changed programmatically -- textarea.value = '...'\n\t\t// * the event is emitted when tabbing into the textarea\n\t\t// * the event is emitted asynchronously (sometimes with a delay as high as a few tens of ms)\n\t\t// * the event sometimes comes in bursts for a single logical textarea operation\n\n\t\t// `selectionchange` events often come multiple times for a single logical change\n\t\t// so throttle multiple `selectionchange` events that burst in a short period of time.\n\t\tlet previousSelectionChangeEventTime = 0;\n\t\treturn dom.addDisposableListener(document, 'selectionchange', (e) => {\n\t\t\tif (!this._hasFocus) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._currentComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._browser.isChrome) {\n\t\t\t\t// Support only for Chrome until testing happens on other browsers\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst now = Date.now();\n\n\t\t\tconst delta1 = now - previousSelectionChangeEventTime;\n\t\t\tpreviousSelectionChangeEventTime = now;\n\t\t\tif (delta1 < 5) {\n\t\t\t\t// received another `selectionchange` event within 5ms of the previous `selectionchange` event\n\t\t\t\t// => ignore it\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst delta2 = now - this._textArea.getIgnoreSelectionChangeTime();\n\t\t\tthis._textArea.resetSelectionChangeTime();\n\t\t\tif (delta2 < 100) {\n\t\t\t\t// received a `selectionchange` event within 100ms since we touched the textarea\n\t\t\t\t// => ignore it, since we caused it\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._textAreaState.selectionStartPosition || !this._textAreaState.selectionEndPosition) {\n\t\t\t\t// Cannot correlate a position in the textarea with a position in the editor...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newValue = this._textArea.getValue();\n\t\t\tif (this._textAreaState.value !== newValue) {\n\t\t\t\t// Cannot correlate a position in the textarea with a position in the editor...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newSelectionStart = this._textArea.getSelectionStart();\n\t\t\tconst newSelectionEnd = this._textArea.getSelectionEnd();\n\t\t\tif (this._textAreaState.selectionStart === newSelectionStart && this._textAreaState.selectionEnd === newSelectionEnd) {\n\t\t\t\t// Nothing to do...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst _newSelectionStartPosition = this._textAreaState.deduceEditorPosition(newSelectionStart);\n\t\t\tconst newSelectionStartPosition = this._host.deduceModelPosition(_newSelectionStartPosition[0]!, _newSelectionStartPosition[1], _newSelectionStartPosition[2]);\n\n\t\t\tconst _newSelectionEndPosition = this._textAreaState.deduceEditorPosition(newSelectionEnd);\n\t\t\tconst newSelectionEndPosition = this._host.deduceModelPosition(_newSelectionEndPosition[0]!, _newSelectionEndPosition[1], _newSelectionEndPosition[2]);\n\n\t\t\tconst newSelection = new Selection(\n\t\t\t\tnewSelectionStartPosition.lineNumber, newSelectionStartPosition.column,\n\t\t\t\tnewSelectionEndPosition.lineNumber, newSelectionEndPosition.column\n\t\t\t);\n\n\t\t\tthis._onSelectionChangeRequest.fire(newSelection);\n\t\t});\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tif (this._selectionChangeListener) {\n\t\t\tthis._selectionChangeListener.dispose();\n\t\t\tthis._selectionChangeListener = null;\n\t\t}\n\t}\n\n\tpublic focusTextArea(): void {\n\t\t// Setting this._hasFocus and writing the screen reader content\n\t\t// will result in a focus() and setSelectionRange() in the textarea\n\t\tthis._setHasFocus(true);\n\n\t\t// If the editor is off DOM, focus cannot be really set, so let's double check that we have managed to set the focus\n\t\tthis.refreshFocusState();\n\t}\n\n\tpublic isFocused(): boolean {\n\t\treturn this._hasFocus;\n\t}\n\n\tpublic refreshFocusState(): void {\n\t\tthis._setHasFocus(this._textArea.hasFocus());\n\t}\n\n\tprivate _setHasFocus(newHasFocus: boolean): void {\n\t\tif (this._hasFocus === newHasFocus) {\n\t\t\t// no change\n\t\t\treturn;\n\t\t}\n\t\tthis._hasFocus = newHasFocus;\n\n\t\tif (this._selectionChangeListener) {\n\t\t\tthis._selectionChangeListener.dispose();\n\t\t\tthis._selectionChangeListener = null;\n\t\t}\n\t\tif (this._hasFocus) {\n\t\t\tthis._selectionChangeListener = this._installSelectionChangeListener();\n\t\t}\n\n\t\tif (this._hasFocus) {\n\t\t\tthis.writeScreenReaderContent('focusgain');\n\t\t}\n\n\t\tif (this._hasFocus) {\n\t\t\tthis._onFocus.fire();\n\t\t} else {\n\t\t\tthis._onBlur.fire();\n\t\t}\n\t}\n\n\tprivate _setAndWriteTextAreaState(reason: string, textAreaState: TextAreaState): void {\n\t\tif (!this._hasFocus) {\n\t\t\ttextAreaState = textAreaState.collapseSelection();\n\t\t}\n\n\t\ttextAreaState.writeToTextArea(reason, this._textArea, this._hasFocus);\n\t\tthis._textAreaState = textAreaState;\n\t}\n\n\tpublic writeScreenReaderContent(reason: string): void {\n\t\tif (this._currentComposition) {\n\t\t\t// Do not write to the text area when doing composition\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent(this._textAreaState));\n\t}\n\n\tprivate _ensureClipboardGetsEditorSelection(e: ClipboardEvent): void {\n\t\tconst dataToCopy = this._host.getDataToCopy();\n\t\tconst storedMetadata: ClipboardStoredMetadata = {\n\t\t\tversion: 1,\n\t\t\tisFromEmptySelection: dataToCopy.isFromEmptySelection,\n\t\t\tmulticursorText: dataToCopy.multicursorText,\n\t\t\tmode: dataToCopy.mode\n\t\t};\n\t\tInMemoryClipboardMetadataManager.INSTANCE.set(\n\t\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t\t(this._browser.isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text),\n\t\t\tstoredMetadata\n\t\t);\n\n\t\te.preventDefault();\n\t\tif (e.clipboardData) {\n\t\t\tClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n\t\t}\n\t}\n}\n\nclass ClipboardEventUtils {\n\n\tpublic static getTextData(clipboardData: DataTransfer): [string, ClipboardStoredMetadata | null] {\n\t\tconst text = clipboardData.getData(Mimes.text);\n\t\tlet metadata: ClipboardStoredMetadata | null = null;\n\t\tconst rawmetadata = clipboardData.getData('vscode-editor-data');\n\t\tif (typeof rawmetadata === 'string') {\n\t\t\ttry {\n\t\t\t\tmetadata = <ClipboardStoredMetadata>JSON.parse(rawmetadata);\n\t\t\t\tif (metadata.version !== 1) {\n\t\t\t\t\tmetadata = null;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// no problem!\n\t\t\t}\n\t\t}\n\n\t\treturn [text, metadata];\n\t}\n\n\tpublic static setTextData(clipboardData: DataTransfer, text: string, html: string | null | undefined, metadata: ClipboardStoredMetadata): void {\n\t\tclipboardData.setData(Mimes.text, text);\n\t\tif (typeof html === 'string') {\n\t\t\tclipboardData.setData('text/html', html);\n\t\t}\n\t\tclipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\n\t}\n}\n\nexport class TextAreaWrapper extends Disposable implements ICompleteTextAreaWrapper {\n\n\tpublic readonly onKeyDown = this._register(dom.createEventEmitter(this._actual, 'keydown')).event;\n\tpublic readonly onKeyUp = this._register(dom.createEventEmitter(this._actual, 'keyup')).event;\n\tpublic readonly onCompositionStart = this._register(dom.createEventEmitter(this._actual, 'compositionstart')).event;\n\tpublic readonly onCompositionUpdate = this._register(dom.createEventEmitter(this._actual, 'compositionupdate')).event;\n\tpublic readonly onCompositionEnd = this._register(dom.createEventEmitter(this._actual, 'compositionend')).event;\n\tpublic readonly onInput = <Event<InputEvent>>this._register(dom.createEventEmitter(this._actual, 'input')).event;\n\tpublic readonly onCut = this._register(dom.createEventEmitter(this._actual, 'cut')).event;\n\tpublic readonly onCopy = this._register(dom.createEventEmitter(this._actual, 'copy')).event;\n\tpublic readonly onPaste = this._register(dom.createEventEmitter(this._actual, 'paste')).event;\n\tpublic readonly onFocus = this._register(dom.createEventEmitter(this._actual, 'focus')).event;\n\tpublic readonly onBlur = this._register(dom.createEventEmitter(this._actual, 'blur')).event;\n\n\tprivate _onSyntheticTap = this._register(new Emitter<void>());\n\tpublic readonly onSyntheticTap: Event<void> = this._onSyntheticTap.event;\n\n\tprivate _ignoreSelectionChangeTime: number;\n\n\tconstructor(\n\t\tprivate readonly _actual: HTMLTextAreaElement\n\t) {\n\t\tsuper();\n\t\tthis._ignoreSelectionChangeTime = 0;\n\n\t\tthis._register(dom.addDisposableListener(this._actual, TextAreaSyntethicEvents.Tap, () => this._onSyntheticTap.fire()));\n\t}\n\n\tpublic hasFocus(): boolean {\n\t\tconst shadowRoot = dom.getShadowRoot(this._actual);\n\t\tif (shadowRoot) {\n\t\t\treturn shadowRoot.activeElement === this._actual;\n\t\t} else if (dom.isInDOM(this._actual)) {\n\t\t\treturn document.activeElement === this._actual;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic setIgnoreSelectionChangeTime(reason: string): void {\n\t\tthis._ignoreSelectionChangeTime = Date.now();\n\t}\n\n\tpublic getIgnoreSelectionChangeTime(): number {\n\t\treturn this._ignoreSelectionChangeTime;\n\t}\n\n\tpublic resetSelectionChangeTime(): void {\n\t\tthis._ignoreSelectionChangeTime = 0;\n\t}\n\n\tpublic getValue(): string {\n\t\t// console.log('current value: ' + this._textArea.value);\n\t\treturn this._actual.value;\n\t}\n\n\tpublic setValue(reason: string, value: string): void {\n\t\tconst textArea = this._actual;\n\t\tif (textArea.value === value) {\n\t\t\t// No change\n\t\t\treturn;\n\t\t}\n\t\t// console.log('reason: ' + reason + ', current value: ' + textArea.value + ' => new value: ' + value);\n\t\tthis.setIgnoreSelectionChangeTime('setValue');\n\t\ttextArea.value = value;\n\t}\n\n\tpublic getSelectionStart(): number {\n\t\treturn this._actual.selectionDirection === 'backward' ? this._actual.selectionEnd : this._actual.selectionStart;\n\t}\n\n\tpublic getSelectionEnd(): number {\n\t\treturn this._actual.selectionDirection === 'backward' ? this._actual.selectionStart : this._actual.selectionEnd;\n\t}\n\n\tpublic setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void {\n\t\tconst textArea = this._actual;\n\n\t\tlet activeElement: Element | null = null;\n\t\tconst shadowRoot = dom.getShadowRoot(textArea);\n\t\tif (shadowRoot) {\n\t\t\tactiveElement = shadowRoot.activeElement;\n\t\t} else {\n\t\t\tactiveElement = document.activeElement;\n\t\t}\n\n\t\tconst currentIsFocused = (activeElement === textArea);\n\t\tconst currentSelectionStart = textArea.selectionStart;\n\t\tconst currentSelectionEnd = textArea.selectionEnd;\n\n\t\tif (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) {\n\t\t\t// No change\n\t\t\t// Firefox iframe bug https://github.com/microsoft/monaco-editor/issues/643#issuecomment-367871377\n\t\t\tif (browser.isFirefox && window.parent !== window) {\n\t\t\t\ttextArea.focus();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// console.log('reason: ' + reason + ', setSelectionRange: ' + selectionStart + ' -> ' + selectionEnd);\n\n\t\tif (currentIsFocused) {\n\t\t\t// No need to focus, only need to change the selection range\n\t\t\tthis.setIgnoreSelectionChangeTime('setSelectionRange');\n\t\t\ttextArea.setSelectionRange(selectionStart, selectionEnd);\n\t\t\tif (browser.isFirefox && window.parent !== window) {\n\t\t\t\ttextArea.focus();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// If the focus is outside the textarea, browsers will try really hard to reveal the textarea.\n\t\t// Here, we try to undo the browser's desperate reveal.\n\t\ttry {\n\t\t\tconst scrollState = dom.saveParentsScrollTop(textArea);\n\t\t\tthis.setIgnoreSelectionChangeTime('setSelectionRange');\n\t\t\ttextArea.focus();\n\t\t\ttextArea.setSelectionRange(selectionStart, selectionEnd);\n\t\t\tdom.restoreParentsScrollTop(textArea, scrollState);\n\t\t} catch (e) {\n\t\t\t// Sometimes IE throws when setting selection (e.g. textarea is off-DOM)\n\t\t}\n\t}\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class ReplaceCommand implements ICommand {\n\n\tprivate readonly _range: Range;\n\tprivate readonly _text: string;\n\tpublic readonly insertsAutoWhitespace: boolean;\n\n\tconstructor(range: Range, text: string, insertsAutoWhitespace: boolean = false) {\n\t\tthis._range = range;\n\t\tthis._text = text;\n\t\tthis.insertsAutoWhitespace = insertsAutoWhitespace;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._range, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst srcRange = inverseEditOperations[0].range;\n\t\treturn Selection.fromPositions(srcRange.getEndPosition());\n\t}\n}\n\nexport class ReplaceCommandThatSelectsText implements ICommand {\n\n\tprivate readonly _range: Range;\n\tprivate readonly _text: string;\n\n\tconstructor(range: Range, text: string) {\n\t\tthis._range = range;\n\t\tthis._text = text;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._range, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst srcRange = inverseEditOperations[0].range;\n\t\treturn Selection.fromRange(srcRange, SelectionDirection.LTR);\n\t}\n}\n\nexport class ReplaceCommandWithoutChangingPosition implements ICommand {\n\n\tprivate readonly _range: Range;\n\tprivate readonly _text: string;\n\tpublic readonly insertsAutoWhitespace: boolean;\n\n\tconstructor(range: Range, text: string, insertsAutoWhitespace: boolean = false) {\n\t\tthis._range = range;\n\t\tthis._text = text;\n\t\tthis.insertsAutoWhitespace = insertsAutoWhitespace;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._range, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst srcRange = inverseEditOperations[0].range;\n\t\treturn Selection.fromPositions(srcRange.getStartPosition());\n\t}\n}\n\nexport class ReplaceCommandWithOffsetCursorState implements ICommand {\n\n\tprivate readonly _range: Range;\n\tprivate readonly _text: string;\n\tprivate readonly _columnDeltaOffset: number;\n\tprivate readonly _lineNumberDeltaOffset: number;\n\tpublic readonly insertsAutoWhitespace: boolean;\n\n\tconstructor(range: Range, text: string, lineNumberDeltaOffset: number, columnDeltaOffset: number, insertsAutoWhitespace: boolean = false) {\n\t\tthis._range = range;\n\t\tthis._text = text;\n\t\tthis._columnDeltaOffset = columnDeltaOffset;\n\t\tthis._lineNumberDeltaOffset = lineNumberDeltaOffset;\n\t\tthis.insertsAutoWhitespace = insertsAutoWhitespace;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._range, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst srcRange = inverseEditOperations[0].range;\n\t\treturn Selection.fromPositions(srcRange.getEndPosition().delta(this._lineNumberDeltaOffset, this._columnDeltaOffset));\n\t}\n}\n\nexport class ReplaceCommandThatPreservesSelection implements ICommand {\n\n\tprivate readonly _range: Range;\n\tprivate readonly _text: string;\n\tprivate readonly _initialSelection: Selection;\n\tprivate readonly _forceMoveMarkers: boolean;\n\tprivate _selectionId: string | null;\n\n\tconstructor(editRange: Range, text: string, initialSelection: Selection, forceMoveMarkers: boolean = false) {\n\t\tthis._range = editRange;\n\t\tthis._text = text;\n\t\tthis._initialSelection = initialSelection;\n\t\tthis._forceMoveMarkers = forceMoveMarkers;\n\t\tthis._selectionId = null;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers);\n\t\tthis._selectionId = builder.trackSelection(this._initialSelection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this._selectionId!);\n\t}\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class SurroundSelectionCommand implements ICommand {\n\tprivate readonly _range: Selection;\n\tprivate readonly _charBeforeSelection: string;\n\tprivate readonly _charAfterSelection: string;\n\n\tconstructor(range: Selection, charBeforeSelection: string, charAfterSelection: string) {\n\t\tthis._range = range;\n\t\tthis._charBeforeSelection = charBeforeSelection;\n\t\tthis._charAfterSelection = charAfterSelection;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(new Range(\n\t\t\tthis._range.startLineNumber,\n\t\t\tthis._range.startColumn,\n\t\t\tthis._range.startLineNumber,\n\t\t\tthis._range.startColumn\n\t\t), this._charBeforeSelection);\n\n\t\tbuilder.addTrackedEditOperation(new Range(\n\t\t\tthis._range.endLineNumber,\n\t\t\tthis._range.endColumn,\n\t\t\tthis._range.endLineNumber,\n\t\t\tthis._range.endColumn\n\t\t), this._charAfterSelection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst firstOperationRange = inverseEditOperations[0].range;\n\t\tconst secondOperationRange = inverseEditOperations[1].range;\n\n\t\treturn new Selection(\n\t\t\tfirstOperationRange.endLineNumber,\n\t\t\tfirstOperationRange.endColumn,\n\t\t\tsecondOperationRange.endLineNumber,\n\t\t\tsecondOperationRange.endColumn - this._charAfterSelection.length\n\t\t);\n\t}\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 * as strings from 'vs/base/common/strings';\nimport * as platform from 'vs/base/common/platform';\nimport * as buffer from 'vs/base/common/buffer';\n\ndeclare const TextDecoder: {\n\tprototype: TextDecoder;\n\tnew(label?: string): TextDecoder;\n};\ninterface TextDecoder {\n\tdecode(view: Uint16Array): string;\n}\n\nexport interface IStringBuilder {\n\tbuild(): string;\n\treset(): void;\n\twrite1(charCode: number): void;\n\tappendASCII(charCode: number): void;\n\tappendASCIIString(str: string): void;\n}\n\nlet _utf16LE_TextDecoder: TextDecoder | null;\nfunction getUTF16LE_TextDecoder(): TextDecoder {\n\tif (!_utf16LE_TextDecoder) {\n\t\t_utf16LE_TextDecoder = new TextDecoder('UTF-16LE');\n\t}\n\treturn _utf16LE_TextDecoder;\n}\n\nlet _utf16BE_TextDecoder: TextDecoder | null;\nfunction getUTF16BE_TextDecoder(): TextDecoder {\n\tif (!_utf16BE_TextDecoder) {\n\t\t_utf16BE_TextDecoder = new TextDecoder('UTF-16BE');\n\t}\n\treturn _utf16BE_TextDecoder;\n}\n\nlet _platformTextDecoder: TextDecoder | null;\nexport function getPlatformTextDecoder(): TextDecoder {\n\tif (!_platformTextDecoder) {\n\t\t_platformTextDecoder = platform.isLittleEndian() ? getUTF16LE_TextDecoder() : getUTF16BE_TextDecoder();\n\t}\n\treturn _platformTextDecoder;\n}\n\nexport const hasTextDecoder = (typeof TextDecoder !== 'undefined');\nexport let createStringBuilder: (capacity: number) => IStringBuilder;\nexport let decodeUTF16LE: (source: Uint8Array, offset: number, len: number) => string;\n\nif (hasTextDecoder) {\n\tcreateStringBuilder = (capacity) => new StringBuilder(capacity);\n\tdecodeUTF16LE = standardDecodeUTF16LE;\n} else {\n\tcreateStringBuilder = (capacity) => new CompatStringBuilder();\n\tdecodeUTF16LE = compatDecodeUTF16LE;\n}\n\nfunction standardDecodeUTF16LE(source: Uint8Array, offset: number, len: number): string {\n\tconst view = new Uint16Array(source.buffer, offset, len);\n\tif (len > 0 && (view[0] === 0xFEFF || view[0] === 0xFFFE)) {\n\t\t// UTF16 sometimes starts with a BOM https://de.wikipedia.org/wiki/Byte_Order_Mark\n\t\t// It looks like TextDecoder.decode will eat up a leading BOM (0xFEFF or 0xFFFE)\n\t\t// We don't want that behavior because we know the string is UTF16LE and the BOM should be maintained\n\t\t// So we use the manual decoder\n\t\treturn compatDecodeUTF16LE(source, offset, len);\n\t}\n\treturn getUTF16LE_TextDecoder().decode(view);\n}\n\nfunction compatDecodeUTF16LE(source: Uint8Array, offset: number, len: number): string {\n\tconst result: string[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0; i < len; i++) {\n\t\tconst charCode = buffer.readUInt16LE(source, offset); offset += 2;\n\t\tresult[resultLen++] = String.fromCharCode(charCode);\n\t}\n\treturn result.join('');\n}\n\nclass StringBuilder implements IStringBuilder {\n\n\tprivate readonly _capacity: number;\n\tprivate readonly _buffer: Uint16Array;\n\n\tprivate _completedStrings: string[] | null;\n\tprivate _bufferLength: number;\n\n\tconstructor(capacity: number) {\n\t\tthis._capacity = capacity | 0;\n\t\tthis._buffer = new Uint16Array(this._capacity);\n\n\t\tthis._completedStrings = null;\n\t\tthis._bufferLength = 0;\n\t}\n\n\tpublic reset(): void {\n\t\tthis._completedStrings = null;\n\t\tthis._bufferLength = 0;\n\t}\n\n\tpublic build(): string {\n\t\tif (this._completedStrings !== null) {\n\t\t\tthis._flushBuffer();\n\t\t\treturn this._completedStrings.join('');\n\t\t}\n\t\treturn this._buildBuffer();\n\t}\n\n\tprivate _buildBuffer(): string {\n\t\tif (this._bufferLength === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst view = new Uint16Array(this._buffer.buffer, 0, this._bufferLength);\n\t\treturn getPlatformTextDecoder().decode(view);\n\t}\n\n\tprivate _flushBuffer(): void {\n\t\tconst bufferString = this._buildBuffer();\n\t\tthis._bufferLength = 0;\n\n\t\tif (this._completedStrings === null) {\n\t\t\tthis._completedStrings = [bufferString];\n\t\t} else {\n\t\t\tthis._completedStrings[this._completedStrings.length] = bufferString;\n\t\t}\n\t}\n\n\tpublic write1(charCode: number): void {\n\t\tconst remainingSpace = this._capacity - this._bufferLength;\n\n\t\tif (remainingSpace <= 1) {\n\t\t\tif (remainingSpace === 0 || strings.isHighSurrogate(charCode)) {\n\t\t\t\tthis._flushBuffer();\n\t\t\t}\n\t\t}\n\n\t\tthis._buffer[this._bufferLength++] = charCode;\n\t}\n\n\tpublic appendASCII(charCode: number): void {\n\t\tif (this._bufferLength === this._capacity) {\n\t\t\t// buffer is full\n\t\t\tthis._flushBuffer();\n\t\t}\n\t\tthis._buffer[this._bufferLength++] = charCode;\n\t}\n\n\tpublic appendASCIIString(str: string): void {\n\t\tconst strLen = str.length;\n\n\t\tif (this._bufferLength + strLen >= this._capacity) {\n\t\t\t// This string does not fit in the remaining buffer space\n\n\t\t\tthis._flushBuffer();\n\t\t\tthis._completedStrings![this._completedStrings!.length] = str;\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0; i < strLen; i++) {\n\t\t\tthis._buffer[this._bufferLength++] = str.charCodeAt(i);\n\t\t}\n\t}\n}\n\nclass CompatStringBuilder implements IStringBuilder {\n\n\tprivate _pieces: string[];\n\tprivate _piecesLen: number;\n\n\tconstructor() {\n\t\tthis._pieces = [];\n\t\tthis._piecesLen = 0;\n\t}\n\n\tpublic reset(): void {\n\t\tthis._pieces = [];\n\t\tthis._piecesLen = 0;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._pieces.join('');\n\t}\n\n\tpublic write1(charCode: number): void {\n\t\tthis._pieces[this._piecesLen++] = String.fromCharCode(charCode);\n\t}\n\n\tpublic appendASCII(charCode: number): void {\n\t\tthis._pieces[this._piecesLen++] = String.fromCharCode(charCode);\n\t}\n\n\tpublic appendASCIIString(str: string): void {\n\t\tthis._pieces[this._piecesLen++] = str;\n\t}\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IStringBuilder, createStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n/**\n * Represents a visible line\n */\nexport interface IVisibleLine extends ILine {\n\tgetDomNode(): HTMLElement | null;\n\tsetDomNode(domNode: HTMLElement): void;\n\n\t/**\n\t * Return null if the HTML should not be touched.\n\t * Return the new HTML otherwise.\n\t */\n\trenderLine(lineNumber: number, deltaTop: number, viewportData: ViewportData, sb: IStringBuilder): boolean;\n\n\t/**\n\t * Layout the line.\n\t */\n\tlayoutLine(lineNumber: number, deltaTop: number): void;\n}\n\nexport interface ILine {\n\tonContentChanged(): void;\n\tonTokensChanged(): void;\n}\n\nexport class RenderedLinesCollection<T extends ILine> {\n\tprivate readonly _createLine: () => T;\n\tprivate _lines!: T[];\n\tprivate _rendLineNumberStart!: number;\n\n\tconstructor(createLine: () => T) {\n\t\tthis._createLine = createLine;\n\t\tthis._set(1, []);\n\t}\n\n\tpublic flush(): void {\n\t\tthis._set(1, []);\n\t}\n\n\t_set(rendLineNumberStart: number, lines: T[]): void {\n\t\tthis._lines = lines;\n\t\tthis._rendLineNumberStart = rendLineNumberStart;\n\t}\n\n\t_get(): { rendLineNumberStart: number; lines: T[] } {\n\t\treturn {\n\t\t\trendLineNumberStart: this._rendLineNumberStart,\n\t\t\tlines: this._lines\n\t\t};\n\t}\n\n\t/**\n\t * @returns Inclusive line number that is inside this collection\n\t */\n\tpublic getStartLineNumber(): number {\n\t\treturn this._rendLineNumberStart;\n\t}\n\n\t/**\n\t * @returns Inclusive line number that is inside this collection\n\t */\n\tpublic getEndLineNumber(): number {\n\t\treturn this._rendLineNumberStart + this._lines.length - 1;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._lines.length;\n\t}\n\n\tpublic getLine(lineNumber: number): T {\n\t\tconst lineIndex = lineNumber - this._rendLineNumberStart;\n\t\tif (lineIndex < 0 || lineIndex >= this._lines.length) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\t\treturn this._lines[lineIndex];\n\t}\n\n\t/**\n\t * @returns Lines that were removed from this collection\n\t */\n\tpublic onLinesDeleted(deleteFromLineNumber: number, deleteToLineNumber: number): T[] | null {\n\t\tif (this.getCount() === 0) {\n\t\t\t// no lines\n\t\t\treturn null;\n\t\t}\n\n\t\tconst startLineNumber = this.getStartLineNumber();\n\t\tconst endLineNumber = this.getEndLineNumber();\n\n\t\tif (deleteToLineNumber < startLineNumber) {\n\t\t\t// deleting above the viewport\n\t\t\tconst deleteCnt = deleteToLineNumber - deleteFromLineNumber + 1;\n\t\t\tthis._rendLineNumberStart -= deleteCnt;\n\t\t\treturn null;\n\t\t}\n\n\t\tif (deleteFromLineNumber > endLineNumber) {\n\t\t\t// deleted below the viewport\n\t\t\treturn null;\n\t\t}\n\n\t\t// Record what needs to be deleted\n\t\tlet deleteStartIndex = 0;\n\t\tlet deleteCount = 0;\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - this._rendLineNumberStart;\n\n\t\t\tif (deleteFromLineNumber <= lineNumber && lineNumber <= deleteToLineNumber) {\n\t\t\t\t// this is a line to be deleted\n\t\t\t\tif (deleteCount === 0) {\n\t\t\t\t\t// this is the first line to be deleted\n\t\t\t\t\tdeleteStartIndex = lineIndex;\n\t\t\t\t\tdeleteCount = 1;\n\t\t\t\t} else {\n\t\t\t\t\tdeleteCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adjust this._rendLineNumberStart for lines deleted above\n\t\tif (deleteFromLineNumber < startLineNumber) {\n\t\t\t// Something was deleted above\n\t\t\tlet deleteAboveCount = 0;\n\n\t\t\tif (deleteToLineNumber < startLineNumber) {\n\t\t\t\t// the entire deleted lines are above\n\t\t\t\tdeleteAboveCount = deleteToLineNumber - deleteFromLineNumber + 1;\n\t\t\t} else {\n\t\t\t\tdeleteAboveCount = startLineNumber - deleteFromLineNumber;\n\t\t\t}\n\n\t\t\tthis._rendLineNumberStart -= deleteAboveCount;\n\t\t}\n\n\t\tconst deleted = this._lines.splice(deleteStartIndex, deleteCount);\n\t\treturn deleted;\n\t}\n\n\tpublic onLinesChanged(changeFromLineNumber: number, changeToLineNumber: number): boolean {\n\t\tif (this.getCount() === 0) {\n\t\t\t// no lines\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startLineNumber = this.getStartLineNumber();\n\t\tconst endLineNumber = this.getEndLineNumber();\n\n\t\tlet someoneNotified = false;\n\n\t\tfor (let changedLineNumber = changeFromLineNumber; changedLineNumber <= changeToLineNumber; changedLineNumber++) {\n\t\t\tif (changedLineNumber >= startLineNumber && changedLineNumber <= endLineNumber) {\n\t\t\t\t// Notify the line\n\t\t\t\tthis._lines[changedLineNumber - this._rendLineNumberStart].onContentChanged();\n\t\t\t\tsomeoneNotified = true;\n\t\t\t}\n\t\t}\n\n\t\treturn someoneNotified;\n\t}\n\n\tpublic onLinesInserted(insertFromLineNumber: number, insertToLineNumber: number): T[] | null {\n\t\tif (this.getCount() === 0) {\n\t\t\t// no lines\n\t\t\treturn null;\n\t\t}\n\n\t\tconst insertCnt = insertToLineNumber - insertFromLineNumber + 1;\n\t\tconst startLineNumber = this.getStartLineNumber();\n\t\tconst endLineNumber = this.getEndLineNumber();\n\n\t\tif (insertFromLineNumber <= startLineNumber) {\n\t\t\t// inserting above the viewport\n\t\t\tthis._rendLineNumberStart += insertCnt;\n\t\t\treturn null;\n\t\t}\n\n\t\tif (insertFromLineNumber > endLineNumber) {\n\t\t\t// inserting below the viewport\n\t\t\treturn null;\n\t\t}\n\n\t\tif (insertCnt + insertFromLineNumber > endLineNumber) {\n\t\t\t// insert inside the viewport in such a way that all remaining lines are pushed outside\n\t\t\tconst deleted = this._lines.splice(insertFromLineNumber - this._rendLineNumberStart, endLineNumber - insertFromLineNumber + 1);\n\t\t\treturn deleted;\n\t\t}\n\n\t\t// insert inside the viewport, push out some lines, but not all remaining lines\n\t\tconst newLines: T[] = [];\n\t\tfor (let i = 0; i < insertCnt; i++) {\n\t\t\tnewLines[i] = this._createLine();\n\t\t}\n\t\tconst insertIndex = insertFromLineNumber - this._rendLineNumberStart;\n\t\tconst beforeLines = this._lines.slice(0, insertIndex);\n\t\tconst afterLines = this._lines.slice(insertIndex, this._lines.length - insertCnt);\n\t\tconst deletedLines = this._lines.slice(this._lines.length - insertCnt, this._lines.length);\n\n\t\tthis._lines = beforeLines.concat(newLines).concat(afterLines);\n\n\t\treturn deletedLines;\n\t}\n\n\tpublic onTokensChanged(ranges: { fromLineNumber: number; toLineNumber: number }[]): boolean {\n\t\tif (this.getCount() === 0) {\n\t\t\t// no lines\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startLineNumber = this.getStartLineNumber();\n\t\tconst endLineNumber = this.getEndLineNumber();\n\n\t\tlet notifiedSomeone = false;\n\t\tfor (let i = 0, len = ranges.length; i < len; i++) {\n\t\t\tconst rng = ranges[i];\n\n\t\t\tif (rng.toLineNumber < startLineNumber || rng.fromLineNumber > endLineNumber) {\n\t\t\t\t// range outside viewport\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst from = Math.max(startLineNumber, rng.fromLineNumber);\n\t\t\tconst to = Math.min(endLineNumber, rng.toLineNumber);\n\n\t\t\tfor (let lineNumber = from; lineNumber <= to; lineNumber++) {\n\t\t\t\tconst lineIndex = lineNumber - this._rendLineNumberStart;\n\t\t\t\tthis._lines[lineIndex].onTokensChanged();\n\t\t\t\tnotifiedSomeone = true;\n\t\t\t}\n\t\t}\n\n\t\treturn notifiedSomeone;\n\t}\n}\n\nexport interface IVisibleLinesHost<T extends IVisibleLine> {\n\tcreateVisibleLine(): T;\n}\n\nexport class VisibleLinesCollection<T extends IVisibleLine> {\n\n\tprivate readonly _host: IVisibleLinesHost<T>;\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _linesCollection: RenderedLinesCollection<T>;\n\n\tconstructor(host: IVisibleLinesHost<T>) {\n\t\tthis._host = host;\n\t\tthis.domNode = this._createDomNode();\n\t\tthis._linesCollection = new RenderedLinesCollection<T>(() => this._host.createVisibleLine());\n\t}\n\n\tprivate _createDomNode(): FastDomNode<HTMLElement> {\n\t\tconst domNode = createFastDomNode(document.createElement('div'));\n\t\tdomNode.setClassName('view-layer');\n\t\tdomNode.setPosition('absolute');\n\t\tdomNode.domNode.setAttribute('role', 'presentation');\n\t\tdomNode.domNode.setAttribute('aria-hidden', 'true');\n\t\treturn domNode;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tthis._linesCollection.flush();\n\t\t// No need to clear the dom node because a full .innerHTML will occur in ViewLayerRenderer._render\n\t\treturn true;\n\t}\n\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._linesCollection.onLinesChanged(e.fromLineNumber, e.toLineNumber);\n\t}\n\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tconst deleted = this._linesCollection.onLinesDeleted(e.fromLineNumber, e.toLineNumber);\n\t\tif (deleted) {\n\t\t\t// Remove from DOM\n\t\t\tfor (let i = 0, len = deleted.length; i < len; i++) {\n\t\t\t\tconst lineDomNode = deleted[i].getDomNode();\n\t\t\t\tif (lineDomNode) {\n\t\t\t\t\tthis.domNode.domNode.removeChild(lineDomNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tconst deleted = this._linesCollection.onLinesInserted(e.fromLineNumber, e.toLineNumber);\n\t\tif (deleted) {\n\t\t\t// Remove from DOM\n\t\t\tfor (let i = 0, len = deleted.length; i < len; i++) {\n\t\t\t\tconst lineDomNode = deleted[i].getDomNode();\n\t\t\t\tif (lineDomNode) {\n\t\t\t\t\tthis.domNode.domNode.removeChild(lineDomNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\n\tpublic onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._linesCollection.onTokensChanged(e.ranges);\n\t}\n\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tpublic getStartLineNumber(): number {\n\t\treturn this._linesCollection.getStartLineNumber();\n\t}\n\n\tpublic getEndLineNumber(): number {\n\t\treturn this._linesCollection.getEndLineNumber();\n\t}\n\n\tpublic getVisibleLine(lineNumber: number): T {\n\t\treturn this._linesCollection.getLine(lineNumber);\n\t}\n\n\tpublic renderLines(viewportData: ViewportData): void {\n\n\t\tconst inp = this._linesCollection._get();\n\n\t\tconst renderer = new ViewLayerRenderer<T>(this.domNode.domNode, this._host, viewportData);\n\n\t\tconst ctx: IRendererContext<T> = {\n\t\t\trendLineNumberStart: inp.rendLineNumberStart,\n\t\t\tlines: inp.lines,\n\t\t\tlinesLength: inp.lines.length\n\t\t};\n\n\t\t// Decide if this render will do a single update (single large .innerHTML) or many updates (inserting/removing dom nodes)\n\t\tconst resCtx = renderer.render(ctx, viewportData.startLineNumber, viewportData.endLineNumber, viewportData.relativeVerticalOffset);\n\n\t\tthis._linesCollection._set(resCtx.rendLineNumberStart, resCtx.lines);\n\t}\n}\n\ninterface IRendererContext<T extends IVisibleLine> {\n\trendLineNumberStart: number;\n\tlines: T[];\n\tlinesLength: number;\n}\n\nclass ViewLayerRenderer<T extends IVisibleLine> {\n\n\tprivate static _ttPolicy = window.trustedTypes?.createPolicy('editorViewLayer', { createHTML: value => value });\n\n\treadonly domNode: HTMLElement;\n\treadonly host: IVisibleLinesHost<T>;\n\treadonly viewportData: ViewportData;\n\n\tconstructor(domNode: HTMLElement, host: IVisibleLinesHost<T>, viewportData: ViewportData) {\n\t\tthis.domNode = domNode;\n\t\tthis.host = host;\n\t\tthis.viewportData = viewportData;\n\t}\n\n\tpublic render(inContext: IRendererContext<T>, startLineNumber: number, stopLineNumber: number, deltaTop: number[]): IRendererContext<T> {\n\n\t\tconst ctx: IRendererContext<T> = {\n\t\t\trendLineNumberStart: inContext.rendLineNumberStart,\n\t\t\tlines: inContext.lines.slice(0),\n\t\t\tlinesLength: inContext.linesLength\n\t\t};\n\n\t\tif ((ctx.rendLineNumberStart + ctx.linesLength - 1 < startLineNumber) || (stopLineNumber < ctx.rendLineNumberStart)) {\n\t\t\t// There is no overlap whatsoever\n\t\t\tctx.rendLineNumberStart = startLineNumber;\n\t\t\tctx.linesLength = stopLineNumber - startLineNumber + 1;\n\t\t\tctx.lines = [];\n\t\t\tfor (let x = startLineNumber; x <= stopLineNumber; x++) {\n\t\t\t\tctx.lines[x - startLineNumber] = this.host.createVisibleLine();\n\t\t\t}\n\t\t\tthis._finishRendering(ctx, true, deltaTop);\n\t\t\treturn ctx;\n\t\t}\n\n\t\t// Update lines which will remain untouched\n\t\tthis._renderUntouchedLines(\n\t\t\tctx,\n\t\t\tMath.max(startLineNumber - ctx.rendLineNumberStart, 0),\n\t\t\tMath.min(stopLineNumber - ctx.rendLineNumberStart, ctx.linesLength - 1),\n\t\t\tdeltaTop,\n\t\t\tstartLineNumber\n\t\t);\n\n\t\tif (ctx.rendLineNumberStart > startLineNumber) {\n\t\t\t// Insert lines before\n\t\t\tconst fromLineNumber = startLineNumber;\n\t\t\tconst toLineNumber = Math.min(stopLineNumber, ctx.rendLineNumberStart - 1);\n\t\t\tif (fromLineNumber <= toLineNumber) {\n\t\t\t\tthis._insertLinesBefore(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber);\n\t\t\t\tctx.linesLength += toLineNumber - fromLineNumber + 1;\n\t\t\t}\n\t\t} else if (ctx.rendLineNumberStart < startLineNumber) {\n\t\t\t// Remove lines before\n\t\t\tconst removeCnt = Math.min(ctx.linesLength, startLineNumber - ctx.rendLineNumberStart);\n\t\t\tif (removeCnt > 0) {\n\t\t\t\tthis._removeLinesBefore(ctx, removeCnt);\n\t\t\t\tctx.linesLength -= removeCnt;\n\t\t\t}\n\t\t}\n\n\t\tctx.rendLineNumberStart = startLineNumber;\n\n\t\tif (ctx.rendLineNumberStart + ctx.linesLength - 1 < stopLineNumber) {\n\t\t\t// Insert lines after\n\t\t\tconst fromLineNumber = ctx.rendLineNumberStart + ctx.linesLength;\n\t\t\tconst toLineNumber = stopLineNumber;\n\n\t\t\tif (fromLineNumber <= toLineNumber) {\n\t\t\t\tthis._insertLinesAfter(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber);\n\t\t\t\tctx.linesLength += toLineNumber - fromLineNumber + 1;\n\t\t\t}\n\n\t\t} else if (ctx.rendLineNumberStart + ctx.linesLength - 1 > stopLineNumber) {\n\t\t\t// Remove lines after\n\t\t\tconst fromLineNumber = Math.max(0, stopLineNumber - ctx.rendLineNumberStart + 1);\n\t\t\tconst toLineNumber = ctx.linesLength - 1;\n\t\t\tconst removeCnt = toLineNumber - fromLineNumber + 1;\n\n\t\t\tif (removeCnt > 0) {\n\t\t\t\tthis._removeLinesAfter(ctx, removeCnt);\n\t\t\t\tctx.linesLength -= removeCnt;\n\t\t\t}\n\t\t}\n\n\t\tthis._finishRendering(ctx, false, deltaTop);\n\n\t\treturn ctx;\n\t}\n\n\tprivate _renderUntouchedLines(ctx: IRendererContext<T>, startIndex: number, endIndex: number, deltaTop: number[], deltaLN: number): void {\n\t\tconst rendLineNumberStart = ctx.rendLineNumberStart;\n\t\tconst lines = ctx.lines;\n\n\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\tconst lineNumber = rendLineNumberStart + i;\n\t\t\tlines[i].layoutLine(lineNumber, deltaTop[lineNumber - deltaLN]);\n\t\t}\n\t}\n\n\tprivate _insertLinesBefore(ctx: IRendererContext<T>, fromLineNumber: number, toLineNumber: number, deltaTop: number[], deltaLN: number): void {\n\t\tconst newLines: T[] = [];\n\t\tlet newLinesLen = 0;\n\t\tfor (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {\n\t\t\tnewLines[newLinesLen++] = this.host.createVisibleLine();\n\t\t}\n\t\tctx.lines = newLines.concat(ctx.lines);\n\t}\n\n\tprivate _removeLinesBefore(ctx: IRendererContext<T>, removeCount: number): void {\n\t\tfor (let i = 0; i < removeCount; i++) {\n\t\t\tconst lineDomNode = ctx.lines[i].getDomNode();\n\t\t\tif (lineDomNode) {\n\t\t\t\tthis.domNode.removeChild(lineDomNode);\n\t\t\t}\n\t\t}\n\t\tctx.lines.splice(0, removeCount);\n\t}\n\n\tprivate _insertLinesAfter(ctx: IRendererContext<T>, fromLineNumber: number, toLineNumber: number, deltaTop: number[], deltaLN: number): void {\n\t\tconst newLines: T[] = [];\n\t\tlet newLinesLen = 0;\n\t\tfor (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {\n\t\t\tnewLines[newLinesLen++] = this.host.createVisibleLine();\n\t\t}\n\t\tctx.lines = ctx.lines.concat(newLines);\n\t}\n\n\tprivate _removeLinesAfter(ctx: IRendererContext<T>, removeCount: number): void {\n\t\tconst removeIndex = ctx.linesLength - removeCount;\n\n\t\tfor (let i = 0; i < removeCount; i++) {\n\t\t\tconst lineDomNode = ctx.lines[removeIndex + i].getDomNode();\n\t\t\tif (lineDomNode) {\n\t\t\t\tthis.domNode.removeChild(lineDomNode);\n\t\t\t}\n\t\t}\n\t\tctx.lines.splice(removeIndex, removeCount);\n\t}\n\n\tprivate _finishRenderingNewLines(ctx: IRendererContext<T>, domNodeIsEmpty: boolean, newLinesHTML: string | TrustedHTML, wasNew: boolean[]): void {\n\t\tif (ViewLayerRenderer._ttPolicy) {\n\t\t\tnewLinesHTML = ViewLayerRenderer._ttPolicy.createHTML(newLinesHTML as string);\n\t\t}\n\t\tconst lastChild = <HTMLElement>this.domNode.lastChild;\n\t\tif (domNodeIsEmpty || !lastChild) {\n\t\t\tthis.domNode.innerHTML = newLinesHTML as string; // explains the ugly casts -> https://github.com/microsoft/vscode/issues/106396#issuecomment-692625393;\n\t\t} else {\n\t\t\tlastChild.insertAdjacentHTML('afterend', newLinesHTML as string);\n\t\t}\n\n\t\tlet currChild = <HTMLElement>this.domNode.lastChild;\n\t\tfor (let i = ctx.linesLength - 1; i >= 0; i--) {\n\t\t\tconst line = ctx.lines[i];\n\t\t\tif (wasNew[i]) {\n\t\t\t\tline.setDomNode(currChild);\n\t\t\t\tcurrChild = <HTMLElement>currChild.previousSibling;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _finishRenderingInvalidLines(ctx: IRendererContext<T>, invalidLinesHTML: string | TrustedHTML, wasInvalid: boolean[]): void {\n\t\tconst hugeDomNode = document.createElement('div');\n\n\t\tif (ViewLayerRenderer._ttPolicy) {\n\t\t\tinvalidLinesHTML = ViewLayerRenderer._ttPolicy.createHTML(invalidLinesHTML as string);\n\t\t}\n\t\thugeDomNode.innerHTML = invalidLinesHTML as string;\n\n\t\tfor (let i = 0; i < ctx.linesLength; i++) {\n\t\t\tconst line = ctx.lines[i];\n\t\t\tif (wasInvalid[i]) {\n\t\t\t\tconst source = <HTMLElement>hugeDomNode.firstChild;\n\t\t\t\tconst lineDomNode = line.getDomNode()!;\n\t\t\t\tlineDomNode.parentNode!.replaceChild(source, lineDomNode);\n\t\t\t\tline.setDomNode(source);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static readonly _sb = createStringBuilder(100000);\n\n\tprivate _finishRendering(ctx: IRendererContext<T>, domNodeIsEmpty: boolean, deltaTop: number[]): void {\n\n\t\tconst sb = ViewLayerRenderer._sb;\n\t\tconst linesLength = ctx.linesLength;\n\t\tconst lines = ctx.lines;\n\t\tconst rendLineNumberStart = ctx.rendLineNumberStart;\n\n\t\tconst wasNew: boolean[] = [];\n\t\t{\n\t\t\tsb.reset();\n\t\t\tlet hadNewLine = false;\n\n\t\t\tfor (let i = 0; i < linesLength; i++) {\n\t\t\t\tconst line = lines[i];\n\t\t\t\twasNew[i] = false;\n\n\t\t\t\tconst lineDomNode = line.getDomNode();\n\t\t\t\tif (lineDomNode) {\n\t\t\t\t\t// line is not new\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData, sb);\n\t\t\t\tif (!renderResult) {\n\t\t\t\t\t// line does not need rendering\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twasNew[i] = true;\n\t\t\t\thadNewLine = true;\n\t\t\t}\n\n\t\t\tif (hadNewLine) {\n\t\t\t\tthis._finishRenderingNewLines(ctx, domNodeIsEmpty, sb.build(), wasNew);\n\t\t\t}\n\t\t}\n\n\t\t{\n\t\t\tsb.reset();\n\n\t\t\tlet hadInvalidLine = false;\n\t\t\tconst wasInvalid: boolean[] = [];\n\n\t\t\tfor (let i = 0; i < linesLength; i++) {\n\t\t\t\tconst line = lines[i];\n\t\t\t\twasInvalid[i] = false;\n\n\t\t\t\tif (wasNew[i]) {\n\t\t\t\t\t// line was new\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData, sb);\n\t\t\t\tif (!renderResult) {\n\t\t\t\t\t// line does not need rendering\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twasInvalid[i] = true;\n\t\t\t\thadInvalidLine = true;\n\t\t\t}\n\n\t\t\tif (hadInvalidLine) {\n\t\t\t\tthis._finishRenderingInvalidLines(ctx, sb.build(), wasInvalid);\n\t\t\t}\n\t\t}\n\t}\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 * as buffer from 'vs/base/common/buffer';\nimport { decodeUTF16LE } from 'vs/editor/common/core/stringBuilder';\n\nfunction escapeNewLine(str: string): string {\n\treturn (\n\t\tstr\n\t\t\t.replace(/\\n/g, '\\\\n')\n\t\t\t.replace(/\\r/g, '\\\\r')\n\t);\n}\n\nexport class TextChange {\n\n\tpublic get oldLength(): number {\n\t\treturn this.oldText.length;\n\t}\n\n\tpublic get oldEnd(): number {\n\t\treturn this.oldPosition + this.oldText.length;\n\t}\n\n\tpublic get newLength(): number {\n\t\treturn this.newText.length;\n\t}\n\n\tpublic get newEnd(): number {\n\t\treturn this.newPosition + this.newText.length;\n\t}\n\n\tconstructor(\n\t\tpublic readonly oldPosition: number,\n\t\tpublic readonly oldText: string,\n\t\tpublic readonly newPosition: number,\n\t\tpublic readonly newText: string\n\t) { }\n\n\tpublic toString(): string {\n\t\tif (this.oldText.length === 0) {\n\t\t\treturn `(insert@${this.oldPosition} \"${escapeNewLine(this.newText)}\")`;\n\t\t}\n\t\tif (this.newText.length === 0) {\n\t\t\treturn `(delete@${this.oldPosition} \"${escapeNewLine(this.oldText)}\")`;\n\t\t}\n\t\treturn `(replace@${this.oldPosition} \"${escapeNewLine(this.oldText)}\" with \"${escapeNewLine(this.newText)}\")`;\n\t}\n\n\tprivate static _writeStringSize(str: string): number {\n\t\treturn (\n\t\t\t4 + 2 * str.length\n\t\t);\n\t}\n\n\tprivate static _writeString(b: Uint8Array, str: string, offset: number): number {\n\t\tconst len = str.length;\n\t\tbuffer.writeUInt32BE(b, len, offset); offset += 4;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tbuffer.writeUInt16LE(b, str.charCodeAt(i), offset); offset += 2;\n\t\t}\n\t\treturn offset;\n\t}\n\n\tprivate static _readString(b: Uint8Array, offset: number): string {\n\t\tconst len = buffer.readUInt32BE(b, offset); offset += 4;\n\t\treturn decodeUTF16LE(b, offset, len);\n\t}\n\n\tpublic writeSize(): number {\n\t\treturn (\n\t\t\t+ 4 // oldPosition\n\t\t\t+ 4 // newPosition\n\t\t\t+ TextChange._writeStringSize(this.oldText)\n\t\t\t+ TextChange._writeStringSize(this.newText)\n\t\t);\n\t}\n\n\tpublic write(b: Uint8Array, offset: number): number {\n\t\tbuffer.writeUInt32BE(b, this.oldPosition, offset); offset += 4;\n\t\tbuffer.writeUInt32BE(b, this.newPosition, offset); offset += 4;\n\t\toffset = TextChange._writeString(b, this.oldText, offset);\n\t\toffset = TextChange._writeString(b, this.newText, offset);\n\t\treturn offset;\n\t}\n\n\tpublic static read(b: Uint8Array, offset: number, dest: TextChange[]): number {\n\t\tconst oldPosition = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tconst newPosition = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tconst oldText = TextChange._readString(b, offset); offset += TextChange._writeStringSize(oldText);\n\t\tconst newText = TextChange._readString(b, offset); offset += TextChange._writeStringSize(newText);\n\t\tdest.push(new TextChange(oldPosition, oldText, newPosition, newText));\n\t\treturn offset;\n\t}\n}\n\nexport function compressConsecutiveTextChanges(prevEdits: TextChange[] | null, currEdits: TextChange[]): TextChange[] {\n\tif (prevEdits === null || prevEdits.length === 0) {\n\t\treturn currEdits;\n\t}\n\tconst compressor = new TextChangeCompressor(prevEdits, currEdits);\n\treturn compressor.compress();\n}\n\nclass TextChangeCompressor {\n\n\tprivate _prevEdits: TextChange[];\n\tprivate _currEdits: TextChange[];\n\n\tprivate _result: TextChange[];\n\tprivate _resultLen: number;\n\n\tprivate _prevLen: number;\n\tprivate _prevDeltaOffset: number;\n\n\tprivate _currLen: number;\n\tprivate _currDeltaOffset: number;\n\n\tconstructor(prevEdits: TextChange[], currEdits: TextChange[]) {\n\t\tthis._prevEdits = prevEdits;\n\t\tthis._currEdits = currEdits;\n\n\t\tthis._result = [];\n\t\tthis._resultLen = 0;\n\n\t\tthis._prevLen = this._prevEdits.length;\n\t\tthis._prevDeltaOffset = 0;\n\n\t\tthis._currLen = this._currEdits.length;\n\t\tthis._currDeltaOffset = 0;\n\t}\n\n\tpublic compress(): TextChange[] {\n\t\tlet prevIndex = 0;\n\t\tlet currIndex = 0;\n\n\t\tlet prevEdit = this._getPrev(prevIndex);\n\t\tlet currEdit = this._getCurr(currIndex);\n\n\t\twhile (prevIndex < this._prevLen || currIndex < this._currLen) {\n\n\t\t\tif (prevEdit === null) {\n\t\t\t\tthis._acceptCurr(currEdit!);\n\t\t\t\tcurrEdit = this._getCurr(++currIndex);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currEdit === null) {\n\t\t\t\tthis._acceptPrev(prevEdit);\n\t\t\t\tprevEdit = this._getPrev(++prevIndex);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currEdit.oldEnd <= prevEdit.newPosition) {\n\t\t\t\tthis._acceptCurr(currEdit);\n\t\t\t\tcurrEdit = this._getCurr(++currIndex);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (prevEdit.newEnd <= currEdit.oldPosition) {\n\t\t\t\tthis._acceptPrev(prevEdit);\n\t\t\t\tprevEdit = this._getPrev(++prevIndex);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currEdit.oldPosition < prevEdit.newPosition) {\n\t\t\t\tconst [e1, e2] = TextChangeCompressor._splitCurr(currEdit, prevEdit.newPosition - currEdit.oldPosition);\n\t\t\t\tthis._acceptCurr(e1);\n\t\t\t\tcurrEdit = e2;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (prevEdit.newPosition < currEdit.oldPosition) {\n\t\t\t\tconst [e1, e2] = TextChangeCompressor._splitPrev(prevEdit, currEdit.oldPosition - prevEdit.newPosition);\n\t\t\t\tthis._acceptPrev(e1);\n\t\t\t\tprevEdit = e2;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point, currEdit.oldPosition === prevEdit.newPosition\n\n\t\t\tlet mergePrev: TextChange;\n\t\t\tlet mergeCurr: TextChange;\n\n\t\t\tif (currEdit.oldEnd === prevEdit.newEnd) {\n\t\t\t\tmergePrev = prevEdit;\n\t\t\t\tmergeCurr = currEdit;\n\t\t\t\tprevEdit = this._getPrev(++prevIndex);\n\t\t\t\tcurrEdit = this._getCurr(++currIndex);\n\t\t\t} else if (currEdit.oldEnd < prevEdit.newEnd) {\n\t\t\t\tconst [e1, e2] = TextChangeCompressor._splitPrev(prevEdit, currEdit.oldLength);\n\t\t\t\tmergePrev = e1;\n\t\t\t\tmergeCurr = currEdit;\n\t\t\t\tprevEdit = e2;\n\t\t\t\tcurrEdit = this._getCurr(++currIndex);\n\t\t\t} else {\n\t\t\t\tconst [e1, e2] = TextChangeCompressor._splitCurr(currEdit, prevEdit.newLength);\n\t\t\t\tmergePrev = prevEdit;\n\t\t\t\tmergeCurr = e1;\n\t\t\t\tprevEdit = this._getPrev(++prevIndex);\n\t\t\t\tcurrEdit = e2;\n\t\t\t}\n\n\t\t\tthis._result[this._resultLen++] = new TextChange(\n\t\t\t\tmergePrev.oldPosition,\n\t\t\t\tmergePrev.oldText,\n\t\t\t\tmergeCurr.newPosition,\n\t\t\t\tmergeCurr.newText\n\t\t\t);\n\t\t\tthis._prevDeltaOffset += mergePrev.newLength - mergePrev.oldLength;\n\t\t\tthis._currDeltaOffset += mergeCurr.newLength - mergeCurr.oldLength;\n\t\t}\n\n\t\tconst merged = TextChangeCompressor._merge(this._result);\n\t\tconst cleaned = TextChangeCompressor._removeNoOps(merged);\n\t\treturn cleaned;\n\t}\n\n\tprivate _acceptCurr(currEdit: TextChange): void {\n\t\tthis._result[this._resultLen++] = TextChangeCompressor._rebaseCurr(this._prevDeltaOffset, currEdit);\n\t\tthis._currDeltaOffset += currEdit.newLength - currEdit.oldLength;\n\t}\n\n\tprivate _getCurr(currIndex: number): TextChange | null {\n\t\treturn (currIndex < this._currLen ? this._currEdits[currIndex] : null);\n\t}\n\n\tprivate _acceptPrev(prevEdit: TextChange): void {\n\t\tthis._result[this._resultLen++] = TextChangeCompressor._rebasePrev(this._currDeltaOffset, prevEdit);\n\t\tthis._prevDeltaOffset += prevEdit.newLength - prevEdit.oldLength;\n\t}\n\n\tprivate _getPrev(prevIndex: number): TextChange | null {\n\t\treturn (prevIndex < this._prevLen ? this._prevEdits[prevIndex] : null);\n\t}\n\n\tprivate static _rebaseCurr(prevDeltaOffset: number, currEdit: TextChange): TextChange {\n\t\treturn new TextChange(\n\t\t\tcurrEdit.oldPosition - prevDeltaOffset,\n\t\t\tcurrEdit.oldText,\n\t\t\tcurrEdit.newPosition,\n\t\t\tcurrEdit.newText\n\t\t);\n\t}\n\n\tprivate static _rebasePrev(currDeltaOffset: number, prevEdit: TextChange): TextChange {\n\t\treturn new TextChange(\n\t\t\tprevEdit.oldPosition,\n\t\t\tprevEdit.oldText,\n\t\t\tprevEdit.newPosition + currDeltaOffset,\n\t\t\tprevEdit.newText\n\t\t);\n\t}\n\n\tprivate static _splitPrev(edit: TextChange, offset: number): [TextChange, TextChange] {\n\t\tconst preText = edit.newText.substr(0, offset);\n\t\tconst postText = edit.newText.substr(offset);\n\n\t\treturn [\n\t\t\tnew TextChange(\n\t\t\t\tedit.oldPosition,\n\t\t\t\tedit.oldText,\n\t\t\t\tedit.newPosition,\n\t\t\t\tpreText\n\t\t\t),\n\t\t\tnew TextChange(\n\t\t\t\tedit.oldEnd,\n\t\t\t\t'',\n\t\t\t\tedit.newPosition + offset,\n\t\t\t\tpostText\n\t\t\t)\n\t\t];\n\t}\n\n\tprivate static _splitCurr(edit: TextChange, offset: number): [TextChange, TextChange] {\n\t\tconst preText = edit.oldText.substr(0, offset);\n\t\tconst postText = edit.oldText.substr(offset);\n\n\t\treturn [\n\t\t\tnew TextChange(\n\t\t\t\tedit.oldPosition,\n\t\t\t\tpreText,\n\t\t\t\tedit.newPosition,\n\t\t\t\tedit.newText\n\t\t\t),\n\t\t\tnew TextChange(\n\t\t\t\tedit.oldPosition + offset,\n\t\t\t\tpostText,\n\t\t\t\tedit.newEnd,\n\t\t\t\t''\n\t\t\t)\n\t\t];\n\t}\n\n\tprivate static _merge(edits: TextChange[]): TextChange[] {\n\t\tif (edits.length === 0) {\n\t\t\treturn edits;\n\t\t}\n\n\t\tconst result: TextChange[] = [];\n\t\tlet resultLen = 0;\n\n\t\tlet prev = edits[0];\n\t\tfor (let i = 1; i < edits.length; i++) {\n\t\t\tconst curr = edits[i];\n\n\t\t\tif (prev.oldEnd === curr.oldPosition) {\n\t\t\t\t// Merge into `prev`\n\t\t\t\tprev = new TextChange(\n\t\t\t\t\tprev.oldPosition,\n\t\t\t\t\tprev.oldText + curr.oldText,\n\t\t\t\t\tprev.newPosition,\n\t\t\t\t\tprev.newText + curr.newText\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = prev;\n\t\t\t\tprev = curr;\n\t\t\t}\n\t\t}\n\t\tresult[resultLen++] = prev;\n\n\t\treturn result;\n\t}\n\n\tprivate static _removeNoOps(edits: TextChange[]): TextChange[] {\n\t\tif (edits.length === 0) {\n\t\t\treturn edits;\n\t\t}\n\n\t\tconst result: TextChange[] = [];\n\t\tlet resultLen = 0;\n\n\t\tfor (let i = 0; i < edits.length; i++) {\n\t\t\tconst edit = edits[i];\n\n\t\t\tif (edit.oldText === edit.newText) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult[resultLen++] = edit;\n\t\t}\n\n\t\treturn result;\n\t}\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\nexport const EDITOR_MODEL_DEFAULTS = {\n\ttabSize: 4,\n\tindentSize: 4,\n\tinsertSpaces: true,\n\tdetectIndentation: true,\n\ttrimAutoWhitespace: true,\n\tlargeFileOptimizations: true,\n\tbracketPairColorizationOptions: { enabled: false }\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 { CharCode } from 'vs/base/common/charCode';\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\n\nexport const enum WordCharacterClass {\n\tRegular = 0,\n\tWhitespace = 1,\n\tWordSeparator = 2\n}\n\nexport class WordCharacterClassifier extends CharacterClassifier<WordCharacterClass> {\n\n\tconstructor(wordSeparators: string) {\n\t\tsuper(WordCharacterClass.Regular);\n\n\t\tfor (let i = 0, len = wordSeparators.length; i < len; i++) {\n\t\t\tthis.set(wordSeparators.charCodeAt(i), WordCharacterClass.WordSeparator);\n\t\t}\n\n\t\tthis.set(CharCode.Space, WordCharacterClass.Whitespace);\n\t\tthis.set(CharCode.Tab, WordCharacterClass.Whitespace);\n\t}\n\n}\n\nfunction once<R>(computeFn: (input: string) => R): (input: string) => R {\n\tconst cache: { [key: string]: R } = {}; // TODO@Alex unbounded cache\n\treturn (input: string): R => {\n\t\tif (!cache.hasOwnProperty(input)) {\n\t\t\tcache[input] = computeFn(input);\n\t\t}\n\t\treturn cache[input];\n\t};\n}\n\nexport const getMapForWordSeparators = once<WordCharacterClassifier>(\n\t(input) => new WordCharacterClassifier(input)\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\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\n\n/**\n * Word inside a model.\n */\nexport interface IWordAtPosition {\n\t/**\n\t * The word.\n\t */\n\treadonly word: string;\n\t/**\n\t * The column where the word starts.\n\t */\n\treadonly startColumn: number;\n\t/**\n\t * The column where the word ends.\n\t */\n\treadonly endColumn: number;\n}\n\n/**\n * Create a word definition regular expression based on default word separators.\n * Optionally provide allowed separators that should be included in words.\n *\n * The default would look like this:\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\n */\nfunction createWordRegExp(allowInWords: string = ''): RegExp {\n\tlet source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\n\tfor (const sep of USUAL_WORD_SEPARATORS) {\n\t\tif (allowInWords.indexOf(sep) >= 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tsource += '\\\\' + sep;\n\t}\n\tsource += '\\\\s]+)';\n\treturn new RegExp(source, 'g');\n}\n\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\nexport const DEFAULT_WORD_REGEXP = createWordRegExp();\n\nexport function ensureValidWordDefinition(wordDefinition?: RegExp | null): RegExp {\n\tlet result: RegExp = DEFAULT_WORD_REGEXP;\n\n\tif (wordDefinition && (wordDefinition instanceof RegExp)) {\n\t\tif (!wordDefinition.global) {\n\t\t\tlet flags = 'g';\n\t\t\tif (wordDefinition.ignoreCase) {\n\t\t\t\tflags += 'i';\n\t\t\t}\n\t\t\tif (wordDefinition.multiline) {\n\t\t\t\tflags += 'm';\n\t\t\t}\n\t\t\tif ((wordDefinition as any).unicode) {\n\t\t\t\tflags += 'u';\n\t\t\t}\n\t\t\tresult = new RegExp(wordDefinition.source, flags);\n\t\t} else {\n\t\t\tresult = wordDefinition;\n\t\t}\n\t}\n\n\tresult.lastIndex = 0;\n\n\treturn result;\n}\n\nconst _defaultConfig = {\n\tmaxLen: 1000,\n\twindowSize: 15,\n\ttimeBudget: 150\n};\n\nexport function getWordAtText(column: number, wordDefinition: RegExp, text: string, textOffset: number, config = _defaultConfig): IWordAtPosition | null {\n\n\tif (text.length > config.maxLen) {\n\t\t// don't throw strings that long at the regexp\n\t\t// but use a sub-string in which a word must occur\n\t\tlet start = column - config.maxLen / 2;\n\t\tif (start < 0) {\n\t\t\tstart = 0;\n\t\t} else {\n\t\t\ttextOffset += start;\n\t\t}\n\t\ttext = text.substring(start, column + config.maxLen / 2);\n\t\treturn getWordAtText(column, wordDefinition, text, textOffset, config);\n\t}\n\n\tconst t1 = Date.now();\n\tconst pos = column - 1 - textOffset;\n\n\tlet prevRegexIndex = -1;\n\tlet match: RegExpMatchArray | null = null;\n\n\tfor (let i = 1; ; i++) {\n\t\t// check time budget\n\t\tif (Date.now() - t1 >= config.timeBudget) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// reset the index at which the regexp should start matching, also know where it\n\t\t// should stop so that subsequent search don't repeat previous searches\n\t\tconst regexIndex = pos - config.windowSize * i;\n\t\twordDefinition.lastIndex = Math.max(0, regexIndex);\n\t\tconst thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);\n\n\t\tif (!thisMatch && match) {\n\t\t\t// stop: we have something\n\t\t\tbreak;\n\t\t}\n\n\t\tmatch = thisMatch;\n\n\t\t// stop: searched at start\n\t\tif (regexIndex <= 0) {\n\t\t\tbreak;\n\t\t}\n\t\tprevRegexIndex = regexIndex;\n\t}\n\n\tif (match) {\n\t\tconst result = {\n\t\t\tword: match[0],\n\t\t\tstartColumn: textOffset + 1 + match.index!,\n\t\t\tendColumn: textOffset + 1 + match.index! + match[0].length\n\t\t};\n\t\twordDefinition.lastIndex = 0;\n\t\treturn result;\n\t}\n\n\treturn null;\n}\n\nfunction _findRegexMatchEnclosingPosition(wordDefinition: RegExp, text: string, pos: number, stopPos: number): RegExpMatchArray | null {\n\tlet match: RegExpMatchArray | null;\n\twhile (match = wordDefinition.exec(text)) {\n\t\tconst matchIndex = match.index || 0;\n\t\tif (matchIndex <= pos && wordDefinition.lastIndex >= pos) {\n\t\t\treturn match;\n\t\t} else if (stopPos > 0 && matchIndex > stopPos) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn null;\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 { CharCode } from 'vs/base/common/charCode';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\n\nexport const enum Direction {\n\tLeft,\n\tRight,\n\tNearest,\n}\n\nexport class AtomicTabMoveOperations {\n\t/**\n\t * Get the visible column at the position. If we get to a non-whitespace character first\n\t * or past the end of string then return -1.\n\t *\n\t * **Note** `position` and the return value are 0-based.\n\t */\n\tpublic static whitespaceVisibleColumn(lineContent: string, position: number, tabSize: number): [number, number, number] {\n\t\tconst lineLength = lineContent.length;\n\t\tlet visibleColumn = 0;\n\t\tlet prevTabStopPosition = -1;\n\t\tlet prevTabStopVisibleColumn = -1;\n\t\tfor (let i = 0; i < lineLength; i++) {\n\t\t\tif (i === position) {\n\t\t\t\treturn [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];\n\t\t\t}\n\t\t\tif (visibleColumn % tabSize === 0) {\n\t\t\t\tprevTabStopPosition = i;\n\t\t\t\tprevTabStopVisibleColumn = visibleColumn;\n\t\t\t}\n\t\t\tconst chCode = lineContent.charCodeAt(i);\n\t\t\tswitch (chCode) {\n\t\t\t\tcase CharCode.Space:\n\t\t\t\t\tvisibleColumn += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharCode.Tab:\n\t\t\t\t\t// Skip to the next multiple of tabSize.\n\t\t\t\t\tvisibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn [-1, -1, -1];\n\t\t\t}\n\t\t}\n\t\tif (position === lineLength) {\n\t\t\treturn [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];\n\t\t}\n\t\treturn [-1, -1, -1];\n\t}\n\n\t/**\n\t * Return the position that should result from a move left, right or to the\n\t * nearest tab, if atomic tabs are enabled. Left and right are used for the\n\t * arrow key movements, nearest is used for mouse selection. It returns\n\t * -1 if atomic tabs are not relevant and you should fall back to normal\n\t * behaviour.\n\t *\n\t * **Note**: `position` and the return value are 0-based.\n\t */\n\tpublic static atomicPosition(lineContent: string, position: number, tabSize: number, direction: Direction): number {\n\t\tconst lineLength = lineContent.length;\n\n\t\t// Get the 0-based visible column corresponding to the position, or return\n\t\t// -1 if it is not in the initial whitespace.\n\t\tconst [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn] = AtomicTabMoveOperations.whitespaceVisibleColumn(lineContent, position, tabSize);\n\n\t\tif (visibleColumn === -1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t// Is the output left or right of the current position. The case for nearest\n\t\t// where it is the same as the current position is handled in the switch.\n\t\tlet left: boolean;\n\t\tswitch (direction) {\n\t\t\tcase Direction.Left:\n\t\t\t\tleft = true;\n\t\t\t\tbreak;\n\t\t\tcase Direction.Right:\n\t\t\t\tleft = false;\n\t\t\t\tbreak;\n\t\t\tcase Direction.Nearest:\n\t\t\t\t// The code below assumes the output position is either left or right\n\t\t\t\t// of the input position. If it is the same, return immediately.\n\t\t\t\tif (visibleColumn % tabSize === 0) {\n\t\t\t\t\treturn position;\n\t\t\t\t}\n\t\t\t\t// Go to the nearest indentation.\n\t\t\t\tleft = visibleColumn % tabSize <= (tabSize / 2);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// If going left, we can just use the info about the last tab stop position and\n\t\t// last tab stop visible column that we computed in the first walk over the whitespace.\n\t\tif (left) {\n\t\t\tif (prevTabStopPosition === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t// If the direction is left, we need to keep scanning right to ensure\n\t\t\t// that targetVisibleColumn + tabSize is before non-whitespace.\n\t\t\t// This is so that when we press left at the end of a partial\n\t\t\t// indentation it only goes one character. For example ' foo' with\n\t\t\t// tabSize 4, should jump from position 6 to position 5, not 4.\n\t\t\tlet currentVisibleColumn = prevTabStopVisibleColumn;\n\t\t\tfor (let i = prevTabStopPosition; i < lineLength; ++i) {\n\t\t\t\tif (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {\n\t\t\t\t\t// It is a full indentation.\n\t\t\t\t\treturn prevTabStopPosition;\n\t\t\t\t}\n\n\t\t\t\tconst chCode = lineContent.charCodeAt(i);\n\t\t\t\tswitch (chCode) {\n\t\t\t\t\tcase CharCode.Space:\n\t\t\t\t\t\tcurrentVisibleColumn += 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CharCode.Tab:\n\t\t\t\t\t\tcurrentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {\n\t\t\t\treturn prevTabStopPosition;\n\t\t\t}\n\t\t\t// It must have been a partial indentation.\n\t\t\treturn -1;\n\t\t}\n\n\t\t// We are going right.\n\t\tconst targetVisibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n\n\t\t// We can just continue from where whitespaceVisibleColumn got to.\n\t\tlet currentVisibleColumn = visibleColumn;\n\t\tfor (let i = position; i < lineLength; i++) {\n\t\t\tif (currentVisibleColumn === targetVisibleColumn) {\n\t\t\t\treturn i;\n\t\t\t}\n\n\t\t\tconst chCode = lineContent.charCodeAt(i);\n\t\t\tswitch (chCode) {\n\t\t\t\tcase CharCode.Space:\n\t\t\t\t\tcurrentVisibleColumn += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharCode.Tab:\n\t\t\t\t\tcurrentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\t// This condition handles when the target column is at the end of the line.\n\t\tif (currentVisibleColumn === targetVisibleColumn) {\n\t\t\treturn lineLength;\n\t\t}\n\t\treturn -1;\n\t}\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 { ITextModel } from 'vs/editor/common/model';\nimport { ICoordinatesConverter } from 'vs/editor/common/viewModel';\nimport { CursorConfiguration, ICursorSimpleModel } from 'vs/editor/common/cursorCommon';\n\nexport class CursorContext {\n\t_cursorContextBrand: void = undefined;\n\n\tpublic readonly model: ITextModel;\n\tpublic readonly viewModel: ICursorSimpleModel;\n\tpublic readonly coordinatesConverter: ICoordinatesConverter;\n\tpublic readonly cursorConfig: CursorConfiguration;\n\n\tconstructor(model: ITextModel, viewModel: ICursorSimpleModel, coordinatesConverter: ICoordinatesConverter, cursorConfig: CursorConfiguration) {\n\t\tthis.model = model;\n\t\tthis.viewModel = viewModel;\n\t\tthis.coordinatesConverter = coordinatesConverter;\n\t\tthis.cursorConfig = cursorConfig;\n\t}\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 { IDiffChange, ISequence, LcsDiff, IDiffResult } from 'vs/base/common/diff/diff';\nimport * as strings from 'vs/base/common/strings';\n\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\n\nexport interface IDiffComputationResult {\n\tquitEarly: boolean;\n\tidentical: boolean;\n\tchanges: ILineChange[];\n}\n\n/**\n * A change\n */\nexport interface IChange {\n\treadonly originalStartLineNumber: number;\n\treadonly originalEndLineNumber: number;\n\treadonly modifiedStartLineNumber: number;\n\treadonly modifiedEndLineNumber: number;\n}\n\n/**\n * A character level change.\n */\nexport interface ICharChange extends IChange {\n\treadonly originalStartColumn: number;\n\treadonly originalEndColumn: number;\n\treadonly modifiedStartColumn: number;\n\treadonly modifiedEndColumn: number;\n}\n\n/**\n * A line change\n */\nexport interface ILineChange extends IChange {\n\treadonly charChanges: ICharChange[] | undefined;\n}\n\nexport interface IDiffComputerResult {\n\tquitEarly: boolean;\n\tchanges: ILineChange[];\n}\n\nfunction computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffResult {\n\tconst diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\n\treturn diffAlgo.ComputeDiff(pretty);\n}\n\nclass LineSequence implements ISequence {\n\n\tpublic readonly lines: string[];\n\tprivate readonly _startColumns: number[];\n\tprivate readonly _endColumns: number[];\n\n\tconstructor(lines: string[]) {\n\t\tconst startColumns: number[] = [];\n\t\tconst endColumns: number[] = [];\n\t\tfor (let i = 0, length = lines.length; i < length; i++) {\n\t\t\tstartColumns[i] = getFirstNonBlankColumn(lines[i], 1);\n\t\t\tendColumns[i] = getLastNonBlankColumn(lines[i], 1);\n\t\t}\n\t\tthis.lines = lines;\n\t\tthis._startColumns = startColumns;\n\t\tthis._endColumns = endColumns;\n\t}\n\n\tpublic getElements(): Int32Array | number[] | string[] {\n\t\tconst elements: string[] = [];\n\t\tfor (let i = 0, len = this.lines.length; i < len; i++) {\n\t\t\telements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\n\t\t}\n\t\treturn elements;\n\t}\n\n\tpublic getStrictElement(index: number): string {\n\t\treturn this.lines[index];\n\t}\n\n\tpublic getStartLineNumber(i: number): number {\n\t\treturn i + 1;\n\t}\n\n\tpublic getEndLineNumber(i: number): number {\n\t\treturn i + 1;\n\t}\n\n\tpublic createCharSequence(shouldIgnoreTrimWhitespace: boolean, startIndex: number, endIndex: number): CharSequence {\n\t\tconst charCodes: number[] = [];\n\t\tconst lineNumbers: number[] = [];\n\t\tconst columns: number[] = [];\n\t\tlet len = 0;\n\t\tfor (let index = startIndex; index <= endIndex; index++) {\n\t\t\tconst lineContent = this.lines[index];\n\t\t\tconst startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);\n\t\t\tconst endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);\n\t\t\tfor (let col = startColumn; col < endColumn; col++) {\n\t\t\t\tcharCodes[len] = lineContent.charCodeAt(col - 1);\n\t\t\t\tlineNumbers[len] = index + 1;\n\t\t\t\tcolumns[len] = col;\n\t\t\t\tlen++;\n\t\t\t}\n\t\t}\n\t\treturn new CharSequence(charCodes, lineNumbers, columns);\n\t}\n}\n\nclass CharSequence implements ISequence {\n\n\tprivate readonly _charCodes: number[];\n\tprivate readonly _lineNumbers: number[];\n\tprivate readonly _columns: number[];\n\n\tconstructor(charCodes: number[], lineNumbers: number[], columns: number[]) {\n\t\tthis._charCodes = charCodes;\n\t\tthis._lineNumbers = lineNumbers;\n\t\tthis._columns = columns;\n\t}\n\n\tpublic getElements(): Int32Array | number[] | string[] {\n\t\treturn this._charCodes;\n\t}\n\n\tpublic getStartLineNumber(i: number): number {\n\t\treturn this._lineNumbers[i];\n\t}\n\n\tpublic getStartColumn(i: number): number {\n\t\treturn this._columns[i];\n\t}\n\n\tpublic getEndLineNumber(i: number): number {\n\t\treturn this._lineNumbers[i];\n\t}\n\n\tpublic getEndColumn(i: number): number {\n\t\treturn this._columns[i] + 1;\n\t}\n}\n\nclass CharChange implements ICharChange {\n\n\tpublic originalStartLineNumber: number;\n\tpublic originalStartColumn: number;\n\tpublic originalEndLineNumber: number;\n\tpublic originalEndColumn: number;\n\n\tpublic modifiedStartLineNumber: number;\n\tpublic modifiedStartColumn: number;\n\tpublic modifiedEndLineNumber: number;\n\tpublic modifiedEndColumn: number;\n\n\tconstructor(\n\t\toriginalStartLineNumber: number,\n\t\toriginalStartColumn: number,\n\t\toriginalEndLineNumber: number,\n\t\toriginalEndColumn: number,\n\t\tmodifiedStartLineNumber: number,\n\t\tmodifiedStartColumn: number,\n\t\tmodifiedEndLineNumber: number,\n\t\tmodifiedEndColumn: number\n\t) {\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\n\t\tthis.originalStartColumn = originalStartColumn;\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\n\t\tthis.originalEndColumn = originalEndColumn;\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\n\t\tthis.modifiedStartColumn = modifiedStartColumn;\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\n\t\tthis.modifiedEndColumn = modifiedEndColumn;\n\t}\n\n\tpublic static createFromDiffChange(diffChange: IDiffChange, originalCharSequence: CharSequence, modifiedCharSequence: CharSequence): CharChange {\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalStartColumn: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet originalEndColumn: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedStartColumn: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet modifiedEndColumn: number;\n\n\t\tif (diffChange.originalLength === 0) {\n\t\t\toriginalStartLineNumber = 0;\n\t\t\toriginalStartColumn = 0;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\toriginalEndColumn = 0;\n\t\t} else {\n\t\t\toriginalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\n\t\t\toriginalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\n\t\t\toriginalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t\toriginalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t}\n\n\t\tif (diffChange.modifiedLength === 0) {\n\t\t\tmodifiedStartLineNumber = 0;\n\t\t\tmodifiedStartColumn = 0;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tmodifiedEndColumn = 0;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\n\t\t\tmodifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\n\t\t\tmodifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t\tmodifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t}\n\n\t\treturn new CharChange(\n\t\t\toriginalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn,\n\t\t\tmodifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn,\n\t\t);\n\t}\n}\n\nfunction postProcessCharChanges(rawChanges: IDiffChange[]): IDiffChange[] {\n\tif (rawChanges.length <= 1) {\n\t\treturn rawChanges;\n\t}\n\n\tconst result = [rawChanges[0]];\n\tlet prevChange = result[0];\n\n\tfor (let i = 1, len = rawChanges.length; i < len; i++) {\n\t\tconst currChange = rawChanges[i];\n\n\t\tconst originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\n\t\tconst modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\n\t\t// Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\n\t\tconst matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\n\n\t\tif (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\n\t\t\t// Merge the current change into the previous one\n\t\t\tprevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\n\t\t\tprevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\n\t\t} else {\n\t\t\t// Add the current change\n\t\t\tresult.push(currChange);\n\t\t\tprevChange = currChange;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nclass LineChange implements ILineChange {\n\tpublic originalStartLineNumber: number;\n\tpublic originalEndLineNumber: number;\n\tpublic modifiedStartLineNumber: number;\n\tpublic modifiedEndLineNumber: number;\n\tpublic charChanges: CharChange[] | undefined;\n\n\tconstructor(\n\t\toriginalStartLineNumber: number,\n\t\toriginalEndLineNumber: number,\n\t\tmodifiedStartLineNumber: number,\n\t\tmodifiedEndLineNumber: number,\n\t\tcharChanges: CharChange[] | undefined\n\t) {\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\n\t\tthis.charChanges = charChanges;\n\t}\n\n\tpublic static createFromDiffResult(shouldIgnoreTrimWhitespace: boolean, diffChange: IDiffChange, originalLineSequence: LineSequence, modifiedLineSequence: LineSequence, continueCharDiff: () => boolean, shouldComputeCharChanges: boolean, shouldPostProcessCharChanges: boolean): LineChange {\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet charChanges: CharChange[] | undefined = undefined;\n\n\t\tif (diffChange.originalLength === 0) {\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t} else {\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\n\t\t\toriginalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t}\n\n\t\tif (diffChange.modifiedLength === 0) {\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\n\t\t\tmodifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t}\n\n\t\tif (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {\n\t\t\t// Compute character changes for diff chunks of at most 20 lines...\n\t\t\tconst originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\n\t\t\tconst modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\n\t\t\tlet rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;\n\n\t\t\tif (shouldPostProcessCharChanges) {\n\t\t\t\trawChanges = postProcessCharChanges(rawChanges);\n\t\t\t}\n\n\t\t\tcharChanges = [];\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\n\t\t\t\tcharChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\n\t\t\t}\n\t\t}\n\n\t\treturn new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\n\t}\n}\n\nexport interface IDiffComputerOpts {\n\tshouldComputeCharChanges: boolean;\n\tshouldPostProcessCharChanges: boolean;\n\tshouldIgnoreTrimWhitespace: boolean;\n\tshouldMakePrettyDiff: boolean;\n\tmaxComputationTime: number;\n}\n\nexport class DiffComputer {\n\n\tprivate readonly shouldComputeCharChanges: boolean;\n\tprivate readonly shouldPostProcessCharChanges: boolean;\n\tprivate readonly shouldIgnoreTrimWhitespace: boolean;\n\tprivate readonly shouldMakePrettyDiff: boolean;\n\tprivate readonly originalLines: string[];\n\tprivate readonly modifiedLines: string[];\n\tprivate readonly original: LineSequence;\n\tprivate readonly modified: LineSequence;\n\tprivate readonly continueLineDiff: () => boolean;\n\tprivate readonly continueCharDiff: () => boolean;\n\n\tconstructor(originalLines: string[], modifiedLines: string[], opts: IDiffComputerOpts) {\n\t\tthis.shouldComputeCharChanges = opts.shouldComputeCharChanges;\n\t\tthis.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\n\t\tthis.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\n\t\tthis.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\n\t\tthis.originalLines = originalLines;\n\t\tthis.modifiedLines = modifiedLines;\n\t\tthis.original = new LineSequence(originalLines);\n\t\tthis.modified = new LineSequence(modifiedLines);\n\n\t\tthis.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);\n\t\tthis.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...\n\t}\n\n\tpublic computeDiff(): IDiffComputerResult {\n\n\t\tif (this.original.lines.length === 1 && this.original.lines[0].length === 0) {\n\t\t\t// empty original => fast path\n\t\t\tif (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\n\t\t\t\treturn {\n\t\t\t\t\tquitEarly: false,\n\t\t\t\t\tchanges: []\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tquitEarly: false,\n\t\t\t\tchanges: [{\n\t\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\t\toriginalEndLineNumber: 1,\n\t\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\t\tmodifiedEndLineNumber: this.modified.lines.length,\n\t\t\t\t\tcharChanges: [{\n\t\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t};\n\t\t}\n\n\t\tif (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\n\t\t\t// empty modified => fast path\n\t\t\treturn {\n\t\t\t\tquitEarly: false,\n\t\t\t\tchanges: [{\n\t\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\t\toriginalEndLineNumber: this.original.lines.length,\n\t\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\t\tmodifiedEndLineNumber: 1,\n\t\t\t\t\tcharChanges: [{\n\t\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t};\n\t\t}\n\n\t\tconst diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);\n\t\tconst rawChanges = diffResult.changes;\n\t\tconst quitEarly = diffResult.quitEarly;\n\n\t\t// The diff is always computed with ignoring trim whitespace\n\t\t// This ensures we get the prettiest diff\n\n\t\tif (this.shouldIgnoreTrimWhitespace) {\n\t\t\tconst lineChanges: LineChange[] = [];\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\n\t\t\t\tlineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tquitEarly: quitEarly,\n\t\t\t\tchanges: lineChanges\n\t\t\t};\n\t\t}\n\n\t\t// Need to post-process and introduce changes where the trim whitespace is different\n\t\t// Note that we are looping starting at -1 to also cover the lines before the first change\n\t\tconst result: LineChange[] = [];\n\n\t\tlet originalLineIndex = 0;\n\t\tlet modifiedLineIndex = 0;\n\t\tfor (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\n\t\t\tconst nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\n\t\t\tconst originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\n\t\t\tconst modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\n\n\t\t\twhile (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\n\t\t\t\tconst originalLine = this.originalLines[originalLineIndex];\n\t\t\t\tconst modifiedLine = this.modifiedLines[modifiedLineIndex];\n\n\t\t\t\tif (originalLine !== modifiedLine) {\n\t\t\t\t\t// These lines differ only in trim whitespace\n\n\t\t\t\t\t// Check the leading whitespace\n\t\t\t\t\t{\n\t\t\t\t\t\tlet originalStartColumn = getFirstNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);\n\t\t\t\t\t\twhile (originalStartColumn > 1 && modifiedStartColumn > 1) {\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalStartColumn - 2);\n\t\t\t\t\t\t\tconst modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toriginalStartColumn--;\n\t\t\t\t\t\t\tmodifiedStartColumn--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (originalStartColumn > 1 || modifiedStartColumn > 1) {\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, 1, originalStartColumn,\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, 1, modifiedStartColumn\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the trailing whitespace\n\t\t\t\t\t{\n\t\t\t\t\t\tlet originalEndColumn = getLastNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);\n\t\t\t\t\t\tconst originalMaxColumn = originalLine.length + 1;\n\t\t\t\t\t\tconst modifiedMaxColumn = modifiedLine.length + 1;\n\t\t\t\t\t\twhile (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalEndColumn - 1);\n\t\t\t\t\t\t\tconst modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toriginalEndColumn++;\n\t\t\t\t\t\t\tmodifiedEndColumn++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, originalEndColumn, originalMaxColumn,\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalLineIndex++;\n\t\t\t\tmodifiedLineIndex++;\n\t\t\t}\n\n\t\t\tif (nextChange) {\n\t\t\t\t// Emit the actual change\n\t\t\t\tresult.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n\n\t\t\t\toriginalLineIndex += nextChange.originalLength;\n\t\t\t\tmodifiedLineIndex += nextChange.modifiedLength;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tquitEarly: quitEarly,\n\t\t\tchanges: result\n\t\t};\n\t}\n\n\tprivate _pushTrimWhitespaceCharChange(\n\t\tresult: LineChange[],\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\n\t): void {\n\t\tif (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\n\t\t\t// Merged into previous\n\t\t\treturn;\n\t\t}\n\n\t\tlet charChanges: CharChange[] | undefined = undefined;\n\t\tif (this.shouldComputeCharChanges) {\n\t\t\tcharChanges = [new CharChange(\n\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\n\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\n\t\t\t)];\n\t\t}\n\t\tresult.push(new LineChange(\n\t\t\toriginalLineNumber, originalLineNumber,\n\t\t\tmodifiedLineNumber, modifiedLineNumber,\n\t\t\tcharChanges\n\t\t));\n\t}\n\n\tprivate _mergeTrimWhitespaceCharChange(\n\t\tresult: LineChange[],\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\n\t): boolean {\n\t\tconst len = result.length;\n\t\tif (len === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst prevChange = result[len - 1];\n\n\t\tif (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\n\t\t\t// Don't merge with inserts/deletes\n\t\t\treturn false;\n\t\t}\n\n\t\tif (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\n\t\t\tprevChange.originalEndLineNumber = originalLineNumber;\n\t\t\tprevChange.modifiedEndLineNumber = modifiedLineNumber;\n\t\t\tif (this.shouldComputeCharChanges && prevChange.charChanges) {\n\t\t\t\tprevChange.charChanges.push(new CharChange(\n\t\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\n\t\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\n\t\t\t\t));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nfunction getFirstNonBlankColumn(txt: string, defaultValue: number): number {\n\tconst r = strings.firstNonWhitespaceIndex(txt);\n\tif (r === -1) {\n\t\treturn defaultValue;\n\t}\n\treturn r + 1;\n}\n\nfunction getLastNonBlankColumn(txt: string, defaultValue: number): number {\n\tconst r = strings.lastNonWhitespaceIndex(txt);\n\tif (r === -1) {\n\t\treturn defaultValue;\n\t}\n\treturn r + 2;\n}\n\nfunction createContinueProcessingPredicate(maximumRuntime: number): () => boolean {\n\tif (maximumRuntime === 0) {\n\t\treturn () => true;\n\t}\n\n\tconst startTime = Date.now();\n\treturn () => {\n\t\treturn Date.now() - startTime < maximumRuntime;\n\t};\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 { IEditorAction } from 'vs/editor/common/editorCommon';\nimport { IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';\n\nexport class InternalEditorAction implements IEditorAction {\n\n\tpublic readonly id: string;\n\tpublic readonly label: string;\n\tpublic readonly alias: string;\n\n\tprivate readonly _precondition: ContextKeyExpression | undefined;\n\tprivate readonly _run: () => Promise<void>;\n\tprivate readonly _contextKeyService: IContextKeyService;\n\n\tconstructor(\n\t\tid: string,\n\t\tlabel: string,\n\t\talias: string,\n\t\tprecondition: ContextKeyExpression | undefined,\n\t\trun: () => Promise<void>,\n\t\tcontextKeyService: IContextKeyService\n\t) {\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.alias = alias;\n\t\tthis._precondition = precondition;\n\t\tthis._run = run;\n\t\tthis._contextKeyService = contextKeyService;\n\t}\n\n\tpublic isSupported(): boolean {\n\t\treturn this._contextKeyService.contextMatchesRules(this._precondition);\n\t}\n\n\tpublic run(): Promise<void> {\n\t\tif (!this.isSupported()) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\treturn this._run();\n\t}\n}\n","\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\nimport { IModelDecorationsChangeAccessor, ITextModel, IValidEditOperation } from 'vs/editor/common/model';\nimport { IDimension } from 'vs/editor/common/core/dimension';\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\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\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\tisSupported(): boolean;\n\trun(): Promise<void>;\n}\n\nexport type IEditorModel = ITextModel | IDiffEditorModel;\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]: any };\n}\n/**\n * (Serializable) View state for the diff editor.\n */\nexport interface IDiffEditorViewState {\n\toriginal: ICodeEditorViewState | null;\n\tmodified: ICodeEditorViewState | null;\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\tlayout(dimension?: IDimension): 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): 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: any): 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 * 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(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any;\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/**\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?(): any;\n\t/**\n\t * Restore view state.\n\t */\n\trestoreViewState?(state: any): 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/**\n * @internal\n */\nexport interface PastePayload {\n\ttext: string;\n\tpasteOnNewLine: boolean;\n\tmulticursorText: string[] | null;\n\tmode: string | null;\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 'vs/base/common/event';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { OverviewRulerPosition, ConfigurationChangedEvent, EditorLayoutInfo, IComputedEditorOptions, EditorOption, FindComputedEditorOptionValueById, IEditorOptions, IDiffEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IIdentifiedSingleEditOperation, IModelDecoration, IModelDeltaDecoration, ITextModel, ICursorStateComputer, PositionAffinity } from 'vs/editor/common/model';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { OverviewRulerZone } from 'vs/editor/common/viewModel/overviewZoneManager';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IViewModel } from 'vs/editor/common/viewModel';\nimport { InjectedText } from 'vs/editor/common/modelLineProjectionData';\nimport { ILineChange } from 'vs/editor/common/diff/diffComputer';\nimport { IDimension } from 'vs/editor/common/core/dimension';\n\n/**\n * A view zone is a full horizontal rectangle that 'pushes' text down.\n * The editor reserves space for view zones when rendering.\n */\nexport interface IViewZone {\n\t/**\n\t * The line number after which this zone should appear.\n\t * Use 0 to place a view zone before the first line number.\n\t */\n\tafterLineNumber: number;\n\t/**\n\t * The column after which this zone should appear.\n\t * If not set, the maxLineColumn of `afterLineNumber` will be used.\n\t * This is relevant for wrapped lines.\n\t */\n\tafterColumn?: number;\n\n\t/**\n\t * If the `afterColumn` has multiple view columns, the affinity specifies which one to use. Defaults to `none`.\n\t*/\n\tafterColumnAffinity?: PositionAffinity;\n\t/**\n\t * Suppress mouse down events.\n\t * If set, the editor will attach a mouse down listener to the view zone and .preventDefault on it.\n\t * Defaults to false\n\t */\n\tsuppressMouseDown?: boolean;\n\t/**\n\t * The height in lines of the view zone.\n\t * If specified, `heightInPx` will be used instead of this.\n\t * If neither `heightInPx` nor `heightInLines` is specified, a default of `heightInLines` = 1 will be chosen.\n\t */\n\theightInLines?: number;\n\t/**\n\t * The height in px of the view zone.\n\t * If this is set, the editor will give preference to it rather than `heightInLines` above.\n\t * If neither `heightInPx` nor `heightInLines` is specified, a default of `heightInLines` = 1 will be chosen.\n\t */\n\theightInPx?: number;\n\t/**\n\t * The minimum width in px of the view zone.\n\t * If this is set, the editor will ensure that the scroll width is >= than this value.\n\t */\n\tminWidthInPx?: number;\n\t/**\n\t * The dom node of the view zone\n\t */\n\tdomNode: HTMLElement;\n\t/**\n\t * An optional dom node for the view zone that will be placed in the margin area.\n\t */\n\tmarginDomNode?: HTMLElement | null;\n\t/**\n\t * Callback which gives the relative top of the view zone as it appears (taking scrolling into account).\n\t */\n\tonDomNodeTop?: (top: number) => void;\n\t/**\n\t * Callback which gives the height in pixels of the view zone.\n\t */\n\tonComputedHeight?: (height: number) => void;\n}\n/**\n * An accessor that allows for zones to be added or removed.\n */\nexport interface IViewZoneChangeAccessor {\n\t/**\n\t * Create a new view zone.\n\t * @param zone Zone to create\n\t * @return A unique identifier to the view zone.\n\t */\n\taddZone(zone: IViewZone): string;\n\t/**\n\t * Remove a zone\n\t * @param id A unique identifier to the view zone, as returned by the `addZone` call.\n\t */\n\tremoveZone(id: string): void;\n\t/**\n\t * Change a zone's position.\n\t * The editor will rescan the `afterLineNumber` and `afterColumn` properties of a view zone.\n\t */\n\tlayoutZone(id: string): void;\n}\n\n/**\n * A positioning preference for rendering content widgets.\n */\nexport const enum ContentWidgetPositionPreference {\n\t/**\n\t * Place the content widget exactly at a position\n\t */\n\tEXACT,\n\t/**\n\t * Place the content widget above a position\n\t */\n\tABOVE,\n\t/**\n\t * Place the content widget below a position\n\t */\n\tBELOW\n}\n/**\n * A position for rendering content widgets.\n */\nexport interface IContentWidgetPosition {\n\t/**\n\t * Desired position for the content widget.\n\t * `preference` will also affect the placement.\n\t */\n\tposition: IPosition | null;\n\t/**\n\t * Optionally, a range can be provided to further\n\t * define the position of the content widget.\n\t */\n\trange?: IRange | null;\n\t/**\n\t * Placement preference for position, in order of preference.\n\t */\n\tpreference: ContentWidgetPositionPreference[];\n}\n/**\n * A content widget renders inline with the text and can be easily placed 'near' an editor position.\n */\nexport interface IContentWidget {\n\t/**\n\t * Render this content widget in a location where it could overflow the editor's view dom node.\n\t */\n\tallowEditorOverflow?: boolean;\n\t/**\n\t * Call preventDefault() on mousedown events that target the content widget.\n\t */\n\tsuppressMouseDown?: boolean;\n\t/**\n\t * Get a unique identifier of the content widget.\n\t */\n\tgetId(): string;\n\t/**\n\t * Get the dom node of the content widget.\n\t */\n\tgetDomNode(): HTMLElement;\n\t/**\n\t * Get the placement of the content widget.\n\t * If null is returned, the content widget will be placed off screen.\n\t */\n\tgetPosition(): IContentWidgetPosition | null;\n\t/**\n\t * Optional function that is invoked before rendering\n\t * the content widget. If a dimension is returned the editor will\n\t * attempt to use it.\n\t */\n\tbeforeRender?(): IDimension | null;\n\t/**\n\t * Optional function that is invoked after rendering the content\n\t * widget. Is being invoked with the selected position preference\n\t * or `null` if not rendered.\n\t */\n\tafterRender?(position: ContentWidgetPositionPreference | null): void;\n}\n\n/**\n * A positioning preference for rendering overlay widgets.\n */\nexport const enum OverlayWidgetPositionPreference {\n\t/**\n\t * Position the overlay widget in the top right corner\n\t */\n\tTOP_RIGHT_CORNER,\n\n\t/**\n\t * Position the overlay widget in the bottom right corner\n\t */\n\tBOTTOM_RIGHT_CORNER,\n\n\t/**\n\t * Position the overlay widget in the top center\n\t */\n\tTOP_CENTER\n}\n/**\n * A position for rendering overlay widgets.\n */\nexport interface IOverlayWidgetPosition {\n\t/**\n\t * The position preference for the overlay widget.\n\t */\n\tpreference: OverlayWidgetPositionPreference | null;\n}\n/**\n * An overlay widgets renders on top of the text.\n */\nexport interface IOverlayWidget {\n\t/**\n\t * Get a unique identifier of the overlay widget.\n\t */\n\tgetId(): string;\n\t/**\n\t * Get the dom node of the overlay widget.\n\t */\n\tgetDomNode(): HTMLElement;\n\t/**\n\t * Get the placement of the overlay widget.\n\t * If null is returned, the overlay widget is responsible to place itself.\n\t */\n\tgetPosition(): IOverlayWidgetPosition | null;\n}\n\n/**\n * Type of hit element with the mouse in the editor.\n */\nexport const enum MouseTargetType {\n\t/**\n\t * Mouse is on top of an unknown element.\n\t */\n\tUNKNOWN,\n\t/**\n\t * Mouse is on top of the textarea used for input.\n\t */\n\tTEXTAREA,\n\t/**\n\t * Mouse is on top of the glyph margin\n\t */\n\tGUTTER_GLYPH_MARGIN,\n\t/**\n\t * Mouse is on top of the line numbers\n\t */\n\tGUTTER_LINE_NUMBERS,\n\t/**\n\t * Mouse is on top of the line decorations\n\t */\n\tGUTTER_LINE_DECORATIONS,\n\t/**\n\t * Mouse is on top of the whitespace left in the gutter by a view zone.\n\t */\n\tGUTTER_VIEW_ZONE,\n\t/**\n\t * Mouse is on top of text in the content.\n\t */\n\tCONTENT_TEXT,\n\t/**\n\t * Mouse is on top of empty space in the content (e.g. after line text or below last line)\n\t */\n\tCONTENT_EMPTY,\n\t/**\n\t * Mouse is on top of a view zone in the content.\n\t */\n\tCONTENT_VIEW_ZONE,\n\t/**\n\t * Mouse is on top of a content widget.\n\t */\n\tCONTENT_WIDGET,\n\t/**\n\t * Mouse is on top of the decorations overview ruler.\n\t */\n\tOVERVIEW_RULER,\n\t/**\n\t * Mouse is on top of a scrollbar.\n\t */\n\tSCROLLBAR,\n\t/**\n\t * Mouse is on top of an overlay widget.\n\t */\n\tOVERLAY_WIDGET,\n\t/**\n\t * Mouse is outside of the editor.\n\t */\n\tOUTSIDE_EDITOR,\n}\nexport interface IBaseMouseTarget {\n\t/**\n\t * The target element\n\t */\n\treadonly element: Element | null;\n\t/**\n\t * The 'approximate' editor position\n\t */\n\treadonly position: Position | null;\n\t/**\n\t * Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).\n\t */\n\treadonly mouseColumn: number;\n\t/**\n\t * The 'approximate' editor range\n\t */\n\treadonly range: Range | null;\n}\nexport interface IMouseTargetUnknown extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.UNKNOWN;\n}\nexport interface IMouseTargetTextarea extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.TEXTAREA;\n\treadonly position: null;\n\treadonly range: null;\n}\nexport interface IMouseTargetMarginData {\n\treadonly isAfterLines: boolean;\n\treadonly glyphMarginLeft: number;\n\treadonly glyphMarginWidth: number;\n\treadonly lineNumbersWidth: number;\n\treadonly offsetX: number;\n}\nexport interface IMouseTargetMargin extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.GUTTER_GLYPH_MARGIN | MouseTargetType.GUTTER_LINE_NUMBERS | MouseTargetType.GUTTER_LINE_DECORATIONS;\n\treadonly position: Position;\n\treadonly range: Range;\n\treadonly detail: IMouseTargetMarginData;\n}\nexport interface IMouseTargetViewZoneData {\n\treadonly viewZoneId: string;\n\treadonly positionBefore: Position | null;\n\treadonly positionAfter: Position | null;\n\treadonly position: Position;\n\treadonly afterLineNumber: number;\n}\nexport interface IMouseTargetViewZone extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.GUTTER_VIEW_ZONE | MouseTargetType.CONTENT_VIEW_ZONE;\n\treadonly position: Position;\n\treadonly range: Range;\n\treadonly detail: IMouseTargetViewZoneData;\n}\nexport interface IMouseTargetContentTextData {\n\treadonly mightBeForeignElement: boolean;\n\t/**\n\t * @internal\n\t */\n\treadonly injectedText: InjectedText | null;\n}\nexport interface IMouseTargetContentText extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.CONTENT_TEXT;\n\treadonly position: Position;\n\treadonly range: Range;\n\treadonly detail: IMouseTargetContentTextData;\n}\nexport interface IMouseTargetContentEmptyData {\n\treadonly isAfterLines: boolean;\n\treadonly horizontalDistanceToText?: number;\n}\nexport interface IMouseTargetContentEmpty extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.CONTENT_EMPTY;\n\treadonly position: Position;\n\treadonly range: Range;\n\treadonly detail: IMouseTargetContentEmptyData;\n}\nexport interface IMouseTargetContentWidget extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.CONTENT_WIDGET;\n\treadonly position: null;\n\treadonly range: null;\n\treadonly detail: string;\n}\nexport interface IMouseTargetOverlayWidget extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.OVERLAY_WIDGET;\n\treadonly position: null;\n\treadonly range: null;\n\treadonly detail: string;\n}\nexport interface IMouseTargetScrollbar extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.SCROLLBAR;\n\treadonly position: Position;\n\treadonly range: Range;\n}\nexport interface IMouseTargetOverviewRuler extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.OVERVIEW_RULER;\n}\nexport interface IMouseTargetOutsideEditor extends IBaseMouseTarget {\n\treadonly type: MouseTargetType.OUTSIDE_EDITOR;\n}\n/**\n * Target hit with the mouse in the editor.\n */\nexport type IMouseTarget = (\n\tIMouseTargetUnknown\n\t| IMouseTargetTextarea\n\t| IMouseTargetMargin\n\t| IMouseTargetViewZone\n\t| IMouseTargetContentText\n\t| IMouseTargetContentEmpty\n\t| IMouseTargetContentWidget\n\t| IMouseTargetOverlayWidget\n\t| IMouseTargetScrollbar\n\t| IMouseTargetOverviewRuler\n\t| IMouseTargetOutsideEditor\n);\n/**\n * A mouse event originating from the editor.\n */\nexport interface IEditorMouseEvent {\n\treadonly event: IMouseEvent;\n\treadonly target: IMouseTarget;\n}\nexport interface IPartialEditorMouseEvent {\n\treadonly event: IMouseEvent;\n\treadonly target: IMouseTarget | null;\n}\n\n/**\n * A paste event originating from the editor.\n */\nexport interface IPasteEvent {\n\treadonly range: Range;\n\treadonly languageId: string | null;\n}\n\n/**\n * An overview ruler\n * @internal\n */\nexport interface IOverviewRuler {\n\tgetDomNode(): HTMLElement;\n\tdispose(): void;\n\tsetZones(zones: OverviewRulerZone[]): void;\n\tsetLayout(position: OverviewRulerPosition): void;\n}\n\n/**\n * Editor aria options.\n * @internal\n */\nexport interface IEditorAriaOptions {\n\tactiveDescendant: string | undefined;\n\trole?: string;\n}\n\nexport interface IDiffEditorConstructionOptions extends IDiffEditorOptions {\n\t/**\n\t * The initial editor dimension (to avoid measuring the container).\n\t */\n\tdimension?: IDimension;\n\n\t/**\n\t * Place overflow widgets inside an external DOM node.\n\t * Defaults to an internal DOM node.\n\t */\n\toverflowWidgetsDomNode?: HTMLElement;\n\n\t/**\n\t * Aria label for original editor.\n\t */\n\toriginalAriaLabel?: string;\n\n\t/**\n\t * Aria label for modified editor.\n\t */\n\tmodifiedAriaLabel?: string;\n\n\t/**\n\t * Is the diff editor inside another editor\n\t * Defaults to false\n\t */\n\tisInEmbeddedEditor?: boolean;\n}\n\n/**\n * A rich code editor.\n */\nexport interface ICodeEditor extends editorCommon.IEditor {\n\t/**\n\t * This editor is used as an alternative to an <input> box, i.e. as a simple widget.\n\t * @internal\n\t */\n\treadonly isSimpleWidget: boolean;\n\t/**\n\t * An event emitted when the content of the current model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeModelContent: Event<IModelContentChangedEvent>;\n\t/**\n\t * An event emitted when the language of the current model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeModelLanguage: Event<IModelLanguageChangedEvent>;\n\t/**\n\t * An event emitted when the language configuration of the current model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeModelLanguageConfiguration: Event<IModelLanguageConfigurationChangedEvent>;\n\t/**\n\t * An event emitted when the options of the current model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeModelOptions: Event<IModelOptionsChangedEvent>;\n\t/**\n\t * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)\n\t * @event\n\t */\n\treadonly onDidChangeConfiguration: Event<ConfigurationChangedEvent>;\n\t/**\n\t * An event emitted when the cursor position has changed.\n\t * @event\n\t */\n\treadonly onDidChangeCursorPosition: Event<ICursorPositionChangedEvent>;\n\t/**\n\t * An event emitted when the cursor selection has changed.\n\t * @event\n\t */\n\treadonly onDidChangeCursorSelection: Event<ICursorSelectionChangedEvent>;\n\t/**\n\t * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).\n\t * @event\n\t */\n\treadonly onDidChangeModel: Event<editorCommon.IModelChangedEvent>;\n\t/**\n\t * An event emitted when the decorations of the current model have changed.\n\t * @event\n\t */\n\treadonly onDidChangeModelDecorations: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).\n\t * @event\n\t */\n\treadonly onDidFocusEditorText: Event<void>;\n\t/**\n\t * An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).\n\t * @event\n\t */\n\treadonly onDidBlurEditorText: Event<void>;\n\t/**\n\t * An event emitted when the text inside this editor or an editor widget gained focus.\n\t * @event\n\t */\n\treadonly onDidFocusEditorWidget: Event<void>;\n\t/**\n\t * An event emitted when the text inside this editor or an editor widget lost focus.\n\t * @event\n\t */\n\treadonly onDidBlurEditorWidget: Event<void>;\n\t/**\n\t * An event emitted before interpreting typed characters (on the keyboard).\n\t * @event\n\t * @internal\n\t */\n\treadonly onWillType: Event<string>;\n\t/**\n\t * An event emitted after interpreting typed characters (on the keyboard).\n\t * @event\n\t * @internal\n\t */\n\treadonly onDidType: Event<string>;\n\t/**\n\t * An event emitted after composition has started.\n\t */\n\treadonly onDidCompositionStart: Event<void>;\n\t/**\n\t * An event emitted after composition has ended.\n\t */\n\treadonly onDidCompositionEnd: Event<void>;\n\t/**\n\t * An event emitted when editing failed because the editor is read-only.\n\t * @event\n\t */\n\treadonly onDidAttemptReadOnlyEdit: Event<void>;\n\t/**\n\t * An event emitted when users paste text in the editor.\n\t * @event\n\t */\n\treadonly onDidPaste: Event<IPasteEvent>;\n\t/**\n\t * An event emitted on a \"mouseup\".\n\t * @event\n\t */\n\treadonly onMouseUp: Event<IEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousedown\".\n\t * @event\n\t */\n\treadonly onMouseDown: Event<IEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousedrag\".\n\t * @internal\n\t * @event\n\t */\n\treadonly onMouseDrag: Event<IEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousedrop\".\n\t * @internal\n\t * @event\n\t */\n\treadonly onMouseDrop: Event<IPartialEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousedropcanceled\".\n\t * @internal\n\t * @event\n\t */\n\treadonly onMouseDropCanceled: Event<void>;\n\t/**\n\t * An event emitted on a \"contextmenu\".\n\t * @event\n\t */\n\treadonly onContextMenu: Event<IEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousemove\".\n\t * @event\n\t */\n\treadonly onMouseMove: Event<IEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mouseleave\".\n\t * @event\n\t */\n\treadonly onMouseLeave: Event<IPartialEditorMouseEvent>;\n\t/**\n\t * An event emitted on a \"mousewheel\"\n\t * @event\n\t * @internal\n\t */\n\treadonly onMouseWheel: Event<IMouseWheelEvent>;\n\t/**\n\t * An event emitted on a \"keyup\".\n\t * @event\n\t */\n\treadonly onKeyUp: Event<IKeyboardEvent>;\n\t/**\n\t * An event emitted on a \"keydown\".\n\t * @event\n\t */\n\treadonly onKeyDown: Event<IKeyboardEvent>;\n\t/**\n\t * An event emitted when the layout of the editor has changed.\n\t * @event\n\t */\n\treadonly onDidLayoutChange: Event<EditorLayoutInfo>;\n\t/**\n\t * An event emitted when the content width or content height in the editor has changed.\n\t * @event\n\t */\n\treadonly onDidContentSizeChange: Event<editorCommon.IContentSizeChangedEvent>;\n\t/**\n\t * An event emitted when the scroll in the editor has changed.\n\t * @event\n\t */\n\treadonly onDidScrollChange: Event<editorCommon.IScrollEvent>;\n\n\t/**\n\t * An event emitted when hidden areas change in the editor (e.g. due to folding).\n\t * @event\n\t */\n\treadonly onDidChangeHiddenAreas: Event<void>;\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): editorCommon.ICodeEditorViewState | 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: editorCommon.ICodeEditorViewState): void;\n\n\t/**\n\t * Returns true if the text inside this editor or an editor widget has focus.\n\t */\n\thasWidgetFocus(): boolean;\n\n\t/**\n\t * Get a contribution of this editor.\n\t * @id Unique identifier of the contribution.\n\t * @return The contribution or null if contribution not found.\n\t */\n\tgetContribution<T extends editorCommon.IEditorContribution>(id: string): T | null;\n\n\t/**\n\t * Execute `fn` with the editor's services.\n\t * @internal\n\t */\n\tinvokeWithinContext<T>(fn: (accessor: ServicesAccessor) => T): T;\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): ITextModel | 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: ITextModel | null): void;\n\n\t/**\n\t * Gets all the editor computed options.\n\t */\n\tgetOptions(): IComputedEditorOptions;\n\n\t/**\n\t * Gets a specific editor option.\n\t */\n\tgetOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n\n\t/**\n\t * Returns the editor's configuration (without any validation or defaults).\n\t */\n\tgetRawOptions(): IEditorOptions;\n\n\t/**\n\t * @internal\n\t */\n\tgetOverflowWidgetsDomNode(): HTMLElement | undefined;\n\n\t/**\n\t * @internal\n\t */\n\tgetConfiguredWordAtPosition(position: Position): IWordAtPosition | null;\n\n\t/**\n\t * Get value of the current model attached to this editor.\n\t * @see {@link ITextModel.getValue}\n\t */\n\tgetValue(options?: { preserveBOM: boolean; lineEnding: string }): string;\n\n\t/**\n\t * Set the value of the current model attached to this editor.\n\t * @see {@link ITextModel.setValue}\n\t */\n\tsetValue(newValue: string): void;\n\n\t/**\n\t * Get the width of the editor's content.\n\t * This is information that is \"erased\" when computing `scrollWidth = Math.max(contentWidth, width)`\n\t */\n\tgetContentWidth(): number;\n\t/**\n\t * Get the scrollWidth of the editor's viewport.\n\t */\n\tgetScrollWidth(): number;\n\t/**\n\t * Get the scrollLeft of the editor's viewport.\n\t */\n\tgetScrollLeft(): number;\n\n\t/**\n\t * Get the height of the editor's content.\n\t * This is information that is \"erased\" when computing `scrollHeight = Math.max(contentHeight, height)`\n\t */\n\tgetContentHeight(): number;\n\t/**\n\t * Get the scrollHeight of the editor's viewport.\n\t */\n\tgetScrollHeight(): number;\n\t/**\n\t * Get the scrollTop of the editor's viewport.\n\t */\n\tgetScrollTop(): number;\n\n\t/**\n\t * Change the scrollLeft of the editor's viewport.\n\t */\n\tsetScrollLeft(newScrollLeft: number, scrollType?: editorCommon.ScrollType): void;\n\t/**\n\t * Change the scrollTop of the editor's viewport.\n\t */\n\tsetScrollTop(newScrollTop: number, scrollType?: editorCommon.ScrollType): void;\n\t/**\n\t * Change the scroll position of the editor's viewport.\n\t */\n\tsetScrollPosition(position: editorCommon.INewScrollPosition, scrollType?: editorCommon.ScrollType): void;\n\n\t/**\n\t * Get an action that is a contribution to this editor.\n\t * @id Unique identifier of the contribution.\n\t * @return The action or null if action not found.\n\t */\n\tgetAction(id: string): editorCommon.IEditorAction;\n\n\t/**\n\t * Execute a command on the editor.\n\t * The edits will land on the undo-redo stack, but no \"undo stop\" will be pushed.\n\t * @param source The source of the call.\n\t * @param command The command to execute\n\t */\n\texecuteCommand(source: string | null | undefined, command: editorCommon.ICommand): void;\n\n\t/**\n\t * Create an \"undo stop\" in the undo-redo stack.\n\t */\n\tpushUndoStop(): boolean;\n\n\t/**\n\t * Remove the \"undo stop\" in the undo-redo stack.\n\t */\n\tpopUndoStop(): boolean;\n\n\t/**\n\t * Execute edits on the editor.\n\t * The edits will land on the undo-redo stack, but no \"undo stop\" will be pushed.\n\t * @param source The source of the call.\n\t * @param edits The edits to execute.\n\t * @param endCursorState Cursor state after the edits were applied.\n\t */\n\texecuteEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean;\n\n\t/**\n\t * Execute multiple (concomitant) commands on the editor.\n\t * @param source The source of the call.\n\t * @param command The commands to execute\n\t */\n\texecuteCommands(source: string | null | undefined, commands: (editorCommon.ICommand | null)[]): void;\n\n\t/**\n\t * @internal\n\t */\n\t_getViewModel(): IViewModel | null;\n\n\t/**\n\t * Get all the decorations on a line (filtering out decorations from other editors).\n\t */\n\tgetLineDecorations(lineNumber: number): IModelDecoration[] | null;\n\n\t/**\n\t * Get all the decorations for a range (filtering out decorations from other editors).\n\t */\n\tgetDecorationsInRange(range: Range): IModelDecoration[] | null;\n\n\t/**\n\t * All decorations added through this call will get the ownerId of this editor.\n\t * @see {@link ITextModel.deltaDecorations}\n\t */\n\tdeltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];\n\n\t/**\n\t * @internal\n\t */\n\tremoveDecorations(decorationTypeKey: string): void;\n\n\t/**\n\t * Get the layout info for the editor.\n\t */\n\tgetLayoutInfo(): EditorLayoutInfo;\n\n\t/**\n\t * Returns the ranges that are currently visible.\n\t * Does not account for horizontal scrolling.\n\t */\n\tgetVisibleRanges(): Range[];\n\n\t/**\n\t * @internal\n\t */\n\tgetVisibleRangesPlusViewportAboveBelow(): Range[];\n\n\t/**\n\t * Get the vertical position (top offset) for the line w.r.t. to the first line.\n\t */\n\tgetTopForLineNumber(lineNumber: number): number;\n\n\t/**\n\t * Get the vertical position (top offset) for the position w.r.t. to the first line.\n\t */\n\tgetTopForPosition(lineNumber: number, column: number): number;\n\n\t/**\n\t * Set the model ranges that will be hidden in the view.\n\t * @internal\n\t */\n\tsetHiddenAreas(ranges: IRange[]): void;\n\n\t/**\n\t * Sets the editor aria options, primarily the active descendent.\n\t * @internal\n\t */\n\tsetAriaOptions(options: IEditorAriaOptions): void;\n\n\t/**\n\t * Returns the editor's container dom node\n\t */\n\tgetContainerDomNode(): HTMLElement;\n\n\t/**\n\t * Returns the editor's dom node\n\t */\n\tgetDomNode(): HTMLElement | null;\n\n\t/**\n\t * Add a content widget. Widgets must have unique ids, otherwise they will be overwritten.\n\t */\n\taddContentWidget(widget: IContentWidget): void;\n\t/**\n\t * Layout/Reposition a content widget. This is a ping to the editor to call widget.getPosition()\n\t * and update appropriately.\n\t */\n\tlayoutContentWidget(widget: IContentWidget): void;\n\t/**\n\t * Remove a content widget.\n\t */\n\tremoveContentWidget(widget: IContentWidget): void;\n\n\t/**\n\t * Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten.\n\t */\n\taddOverlayWidget(widget: IOverlayWidget): void;\n\t/**\n\t * Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition()\n\t * and update appropriately.\n\t */\n\tlayoutOverlayWidget(widget: IOverlayWidget): void;\n\t/**\n\t * Remove an overlay widget.\n\t */\n\tremoveOverlayWidget(widget: IOverlayWidget): void;\n\n\t/**\n\t * Change the view zones. View zones are lost when a new model is attached to the editor.\n\t */\n\tchangeViewZones(callback: (accessor: IViewZoneChangeAccessor) => void): void;\n\n\t/**\n\t * Get the horizontal position (left offset) for the column w.r.t to the beginning of the line.\n\t * This method works only if the line `lineNumber` is currently rendered (in the editor's viewport).\n\t * Use this method with caution.\n\t */\n\tgetOffsetForColumn(lineNumber: number, column: number): number;\n\n\t/**\n\t * Force an editor render now.\n\t */\n\trender(forceRedraw?: boolean): void;\n\n\t/**\n\t * Get the hit test target at coordinates `clientX` and `clientY`.\n\t * The coordinates are relative to the top-left of the viewport.\n\t *\n\t * @returns Hit test target or null if the coordinates fall outside the editor or the editor has no model.\n\t */\n\tgetTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null;\n\n\t/**\n\t * Get the visible position for `position`.\n\t * The result position takes scrolling into account and is relative to the top left corner of the editor.\n\t * Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor.\n\t * Explanation 2: the results of this method will not change if the container of the editor gets repositioned.\n\t * Warning: the results of this method are inaccurate for positions that are outside the current editor viewport.\n\t */\n\tgetScrolledVisiblePosition(position: IPosition): { top: number; left: number; height: number } | null;\n\n\t/**\n\t * Apply the same font settings as the editor to `target`.\n\t */\n\tapplyFontInfo(target: HTMLElement): void;\n\n\t/**\n\t * Check if the current instance has a model attached.\n\t * @internal\n\t */\n\thasModel(): this is IActiveCodeEditor;\n\n\tsetBanner(bannerDomNode: HTMLElement | null, height: number): void;\n}\n\n/**\n * @internal\n */\nexport interface IActiveCodeEditor extends ICodeEditor {\n\t/**\n\t * Returns the primary position of the cursor.\n\t */\n\tgetPosition(): Position;\n\n\t/**\n\t * Returns the primary selection of the editor.\n\t */\n\tgetSelection(): Selection;\n\n\t/**\n\t * Returns all the selections of the editor.\n\t */\n\tgetSelections(): Selection[];\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): ITextModel;\n\n\t/**\n\t * @internal\n\t */\n\t_getViewModel(): IViewModel;\n\n\t/**\n\t * Get all the decorations on a line (filtering out decorations from other editors).\n\t */\n\tgetLineDecorations(lineNumber: number): IModelDecoration[];\n\n\t/**\n\t * Returns the editor's dom node\n\t */\n\tgetDomNode(): HTMLElement;\n\n\t/**\n\t * Get the visible position for `position`.\n\t * The result position takes scrolling into account and is relative to the top left corner of the editor.\n\t * Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor.\n\t * Explanation 2: the results of this method will not change if the container of the editor gets repositioned.\n\t * Warning: the results of this method are inaccurate for positions that are outside the current editor viewport.\n\t */\n\tgetScrolledVisiblePosition(position: IPosition): { top: number; left: number; height: number };\n}\n\n/**\n * Information about a line in the diff editor\n */\nexport interface IDiffLineInformation {\n\treadonly equivalentLineNumber: number;\n}\n\n/**\n * @internal\n */\nexport const enum DiffEditorState {\n\tIdle,\n\tComputingDiff,\n\tDiffComputed\n}\n\n/**\n * A rich diff editor.\n */\nexport interface IDiffEditor extends editorCommon.IEditor {\n\n\t/**\n\t * @see {@link ICodeEditor.getContainerDomNode}\n\t */\n\tgetContainerDomNode(): HTMLElement;\n\n\t/**\n\t * An event emitted when the diff information computed by this diff editor has been updated.\n\t * @event\n\t */\n\treadonly onDidUpdateDiff: Event<void>;\n\n\t/**\n\t * Saves current view state of the editor in a serializable object.\n\t */\n\tsaveViewState(): editorCommon.IDiffEditorViewState | 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: editorCommon.IDiffEditorViewState): void;\n\n\t/**\n\t * Type the getModel() of IEditor.\n\t */\n\tgetModel(): editorCommon.IDiffEditorModel | 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: editorCommon.IDiffEditorModel | null): void;\n\n\t/**\n\t * Get the `original` editor.\n\t */\n\tgetOriginalEditor(): ICodeEditor;\n\n\t/**\n\t * Get the `modified` editor.\n\t */\n\tgetModifiedEditor(): ICodeEditor;\n\n\t/**\n\t * Get the computed diff information.\n\t */\n\tgetLineChanges(): ILineChange[] | null;\n\n\t/**\n\t * Get information based on computed diff about a line number from the original model.\n\t * If the diff computation is not finished or the model is missing, will return null.\n\t */\n\tgetDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation | null;\n\n\t/**\n\t * Get information based on computed diff about a line number from the modified model.\n\t * If the diff computation is not finished or the model is missing, will return null.\n\t */\n\tgetDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null;\n\n\t/**\n\t * Update the editor's options after the editor has been created.\n\t */\n\tupdateOptions(newOptions: IDiffEditorOptions): void;\n}\n\n/**\n *@internal\n */\nexport function isCodeEditor(thing: unknown): thing is ICodeEditor {\n\tif (thing && typeof (<ICodeEditor>thing).getEditorType === 'function') {\n\t\treturn (<ICodeEditor>thing).getEditorType() === editorCommon.EditorType.ICodeEditor;\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n *@internal\n */\nexport function isDiffEditor(thing: unknown): thing is IDiffEditor {\n\tif (thing && typeof (<IDiffEditor>thing).getEditorType === 'function') {\n\t\treturn (<IDiffEditor>thing).getEditorType() === editorCommon.EditorType.IDiffEditor;\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n *@internal\n */\nexport function getCodeEditor(thing: unknown): ICodeEditor | null {\n\tif (isCodeEditor(thing)) {\n\t\treturn thing;\n\t}\n\n\tif (isDiffEditor(thing)) {\n\t\treturn thing.getModifiedEditor();\n\t}\n\n\treturn null;\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 { IColorTheme } from 'vs/platform/theme/common/themeService';\nimport { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';\nimport { Color } from 'vs/base/common/color';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\n\nexport class EditorTheme {\n\n\tprivate _theme: IColorTheme;\n\n\tpublic get type(): ColorScheme {\n\t\treturn this._theme.type;\n\t}\n\n\tpublic get value(): IColorTheme {\n\t\treturn this._theme;\n\t}\n\n\tconstructor(theme: IColorTheme) {\n\t\tthis._theme = theme;\n\t}\n\n\tpublic update(theme: IColorTheme): void {\n\t\tthis._theme = theme;\n\t}\n\n\tpublic getColor(color: ColorIdentifier): Color | undefined {\n\t\treturn this._theme.getColor(color);\n\t}\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 { IRelativePattern, match as matchGlobPattern } from 'vs/base/common/glob';\nimport { URI } from 'vs/base/common/uri';\nimport { normalize } from 'vs/base/common/path';\n\nexport interface LanguageFilter {\n\treadonly language?: string;\n\treadonly scheme?: string;\n\treadonly pattern?: string | IRelativePattern;\n\treadonly notebookType?: string;\n\t/**\n\t * This provider is implemented in the UI thread.\n\t */\n\treadonly hasAccessToAllModels?: boolean;\n\treadonly exclusive?: boolean;\n}\n\nexport type LanguageSelector = string | LanguageFilter | ReadonlyArray<string | LanguageFilter>;\n\nexport function score(selector: LanguageSelector | undefined, candidateUri: URI, candidateLanguage: string, candidateIsSynchronized: boolean, candidateNotebookType: string | undefined): number {\n\n\tif (Array.isArray(selector)) {\n\t\t// array -> take max individual value\n\t\tlet ret = 0;\n\t\tfor (const filter of selector) {\n\t\t\tconst value = score(filter, candidateUri, candidateLanguage, candidateIsSynchronized, candidateNotebookType);\n\t\t\tif (value === 10) {\n\t\t\t\treturn value; // already at the highest\n\t\t\t}\n\t\t\tif (value > ret) {\n\t\t\t\tret = value;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\n\t} else if (typeof selector === 'string') {\n\n\t\tif (!candidateIsSynchronized) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// short-hand notion, desugars to\n\t\t// 'fooLang' -> { language: 'fooLang'}\n\t\t// '*' -> { language: '*' }\n\t\tif (selector === '*') {\n\t\t\treturn 5;\n\t\t} else if (selector === candidateLanguage) {\n\t\t\treturn 10;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t} else if (selector) {\n\t\t// filter -> select accordingly, use defaults for scheme\n\t\tconst { language, pattern, scheme, hasAccessToAllModels, notebookType } = selector as LanguageFilter; // TODO: microsoft/TypeScript#42768\n\n\t\tif (!candidateIsSynchronized && !hasAccessToAllModels) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet ret = 0;\n\n\t\tif (scheme) {\n\t\t\tif (scheme === candidateUri.scheme) {\n\t\t\t\tret = 10;\n\t\t\t} else if (scheme === '*') {\n\t\t\t\tret = 5;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tif (language) {\n\t\t\tif (language === candidateLanguage) {\n\t\t\t\tret = 10;\n\t\t\t} else if (language === '*') {\n\t\t\t\tret = Math.max(ret, 5);\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tif (notebookType) {\n\t\t\tif (notebookType === candidateNotebookType) {\n\t\t\t\tret = 10;\n\t\t\t} else if (notebookType === '*') {\n\t\t\t\tret = Math.max(ret, 5);\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tif (pattern) {\n\t\t\tlet normalizedPattern: string | IRelativePattern;\n\t\t\tif (typeof pattern === 'string') {\n\t\t\t\tnormalizedPattern = pattern;\n\t\t\t} else {\n\t\t\t\t// Since this pattern has a `base` property, we need\n\t\t\t\t// to normalize this path first before passing it on\n\t\t\t\t// because we will compare it against `Uri.fsPath`\n\t\t\t\t// which uses platform specific separators.\n\t\t\t\t// Refs: https://github.com/microsoft/vscode/issues/99938\n\t\t\t\tnormalizedPattern = { ...pattern, base: normalize(pattern.base) };\n\t\t\t}\n\n\t\t\tif (normalizedPattern === candidateUri.fsPath || matchGlobPattern(normalizedPattern, candidateUri.fsPath)) {\n\t\t\t\tret = 10;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\n\t} else {\n\t\treturn 0;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { StandardTokenType } from 'vs/editor/common/languages';\nimport { ScopedLineTokens } from 'vs/editor/common/languages/supports';\n\n/**\n * Describes how comments for a language work.\n */\nexport interface CommentRule {\n\t/**\n\t * The line comment token, like `// this is a comment`\n\t */\n\tlineComment?: string | null;\n\t/**\n\t * The block comment character pair, like `/* block comment */`\n\t */\n\tblockComment?: CharacterPair | null;\n}\n\n/**\n * The language configuration interface defines the contract between extensions and\n * various editor features, like automatic bracket insertion, automatic indentation etc.\n */\nexport interface LanguageConfiguration {\n\t/**\n\t * The language's comment settings.\n\t */\n\tcomments?: CommentRule;\n\t/**\n\t * The language's brackets.\n\t * This configuration implicitly affects pressing Enter around these brackets.\n\t */\n\tbrackets?: CharacterPair[];\n\t/**\n\t * The language's word definition.\n\t * If the language supports Unicode identifiers (e.g. JavaScript), it is preferable\n\t * to provide a word definition that uses exclusion of known separators.\n\t * e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):\n\t * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\n\t */\n\twordPattern?: RegExp;\n\t/**\n\t * The language's indentation settings.\n\t */\n\tindentationRules?: IndentationRule;\n\t/**\n\t * The language's rules to be evaluated when pressing Enter.\n\t */\n\tonEnterRules?: OnEnterRule[];\n\t/**\n\t * The language's auto closing pairs. The 'close' character is automatically inserted with the\n\t * 'open' character is typed. If not set, the configured brackets will be used.\n\t */\n\tautoClosingPairs?: IAutoClosingPairConditional[];\n\t/**\n\t * The language's surrounding pairs. When the 'open' character is typed on a selection, the\n\t * selected string is surrounded by the open and close characters. If not set, the autoclosing pairs\n\t * settings will be used.\n\t */\n\tsurroundingPairs?: IAutoClosingPair[];\n\t/**\n\t * Defines a list of bracket pairs that are colorized depending on their nesting level.\n\t * If not set, the configured brackets will be used.\n\t*/\n\tcolorizedBracketPairs?: CharacterPair[];\n\t/**\n\t * Defines what characters must be after the cursor for bracket or quote autoclosing to occur when using the \\'languageDefined\\' autoclosing setting.\n\t *\n\t * This is typically the set of characters which can not start an expression, such as whitespace, closing brackets, non-unary operators, etc.\n\t */\n\tautoCloseBefore?: string;\n\n\t/**\n\t * The language's folding rules.\n\t */\n\tfolding?: FoldingRules;\n\n\t/**\n\t * **Deprecated** Do not use.\n\t *\n\t * @deprecated Will be replaced by a better API soon.\n\t */\n\t__electricCharacterSupport?: {\n\t\tdocComment?: IDocComment;\n\t};\n}\n\n/**\n * @internal\n */\ntype OrUndefined<T> = { [P in keyof T]: T[P] | undefined };\n\n/**\n * @internal\n */\nexport type ExplicitLanguageConfiguration = OrUndefined<Required<LanguageConfiguration>>;\n\n/**\n * Describes indentation rules for a language.\n */\nexport interface IndentationRule {\n\t/**\n\t * If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).\n\t */\n\tdecreaseIndentPattern: RegExp;\n\t/**\n\t * If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).\n\t */\n\tincreaseIndentPattern: RegExp;\n\t/**\n\t * If a line matches this pattern, then **only the next line** after it should be indented once.\n\t */\n\tindentNextLinePattern?: RegExp | null;\n\t/**\n\t * If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.\n\t */\n\tunIndentedLinePattern?: RegExp | null;\n\n}\n\n/**\n * Describes language specific folding markers such as '#region' and '#endregion'.\n * The start and end regexes will be tested against the contents of all lines and must be designed efficiently:\n * - the regex should start with '^'\n * - regexp flags (i, g) are ignored\n */\nexport interface FoldingMarkers {\n\tstart: RegExp;\n\tend: RegExp;\n}\n\n/**\n * Describes folding rules for a language.\n */\nexport interface FoldingRules {\n\t/**\n\t * Used by the indentation based strategy to decide whether empty lines belong to the previous or the next block.\n\t * A language adheres to the off-side rule if blocks in that language are expressed by their indentation.\n\t * See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.\n\t * If not set, `false` is used and empty lines belong to the previous block.\n\t */\n\toffSide?: boolean;\n\n\t/**\n\t * Region markers used by the language.\n\t */\n\tmarkers?: FoldingMarkers;\n}\n\n/**\n * Describes a rule to be evaluated when pressing Enter.\n */\nexport interface OnEnterRule {\n\t/**\n\t * This rule will only execute if the text before the cursor matches this regular expression.\n\t */\n\tbeforeText: RegExp;\n\t/**\n\t * This rule will only execute if the text after the cursor matches this regular expression.\n\t */\n\tafterText?: RegExp;\n\t/**\n\t * This rule will only execute if the text above the this line matches this regular expression.\n\t */\n\tpreviousLineText?: RegExp;\n\t/**\n\t * The action to execute.\n\t */\n\taction: EnterAction;\n}\n\n/**\n * Definition of documentation comments (e.g. Javadoc/JSdoc)\n */\nexport interface IDocComment {\n\t/**\n\t * The string that starts a doc comment (e.g. '/**')\n\t */\n\topen: string;\n\t/**\n\t * The string that appears on the last line and closes the doc comment (e.g. ' * /').\n\t */\n\tclose?: string;\n}\n\n/**\n * A tuple of two characters, like a pair of\n * opening and closing brackets.\n */\nexport type CharacterPair = [string, string];\n\nexport interface IAutoClosingPair {\n\topen: string;\n\tclose: string;\n}\n\nexport interface IAutoClosingPairConditional extends IAutoClosingPair {\n\tnotIn?: string[];\n}\n\n/**\n * Describes what to do with the indentation when pressing Enter.\n */\nexport enum IndentAction {\n\t/**\n\t * Insert new line and copy the previous line's indentation.\n\t */\n\tNone = 0,\n\t/**\n\t * Insert new line and indent once (relative to the previous line's indentation).\n\t */\n\tIndent = 1,\n\t/**\n\t * Insert two new lines:\n\t * - the first one indented which will hold the cursor\n\t * - the second one at the same indentation level\n\t */\n\tIndentOutdent = 2,\n\t/**\n\t * Insert new line and outdent once (relative to the previous line's indentation).\n\t */\n\tOutdent = 3\n}\n\n/**\n * Describes what to do when pressing Enter.\n */\nexport interface EnterAction {\n\t/**\n\t * Describe what to do with the indentation.\n\t */\n\tindentAction: IndentAction;\n\t/**\n\t * Describes text to be appended after the new line and after the indentation.\n\t */\n\tappendText?: string;\n\t/**\n\t * Describes the number of characters to remove from the new line's indentation.\n\t */\n\tremoveText?: number;\n}\n\n/**\n * @internal\n */\nexport interface CompleteEnterAction {\n\t/**\n\t * Describe what to do with the indentation.\n\t */\n\tindentAction: IndentAction;\n\t/**\n\t * Describes text to be appended after the new line and after the indentation.\n\t */\n\tappendText: string;\n\t/**\n\t * Describes the number of characters to remove from the new line's indentation.\n\t */\n\tremoveText: number;\n\t/**\n\t * The line's indentation minus removeText\n\t */\n\tindentation: string;\n}\n\n/**\n * @internal\n */\nexport class StandardAutoClosingPairConditional {\n\n\treadonly open: string;\n\treadonly close: string;\n\tprivate readonly _inString: boolean;\n\tprivate readonly _inComment: boolean;\n\tprivate readonly _inRegEx: boolean;\n\tprivate _neutralCharacter: string | null = null;\n\tprivate _neutralCharacterSearched: boolean = false;\n\n\tconstructor(source: IAutoClosingPairConditional) {\n\t\tthis.open = source.open;\n\t\tthis.close = source.close;\n\n\t\t// initially allowed in all tokens\n\t\tthis._inString = true;\n\t\tthis._inComment = true;\n\t\tthis._inRegEx = true;\n\n\t\tif (Array.isArray(source.notIn)) {\n\t\t\tfor (let i = 0, len = source.notIn.length; i < len; i++) {\n\t\t\t\tconst notIn: string = source.notIn[i];\n\t\t\t\tswitch (notIn) {\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\tthis._inString = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'comment':\n\t\t\t\t\t\tthis._inComment = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'regex':\n\t\t\t\t\t\tthis._inRegEx = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isOK(standardToken: StandardTokenType): boolean {\n\t\tswitch (standardToken) {\n\t\t\tcase StandardTokenType.Other:\n\t\t\t\treturn true;\n\t\t\tcase StandardTokenType.Comment:\n\t\t\t\treturn this._inComment;\n\t\t\tcase StandardTokenType.String:\n\t\t\t\treturn this._inString;\n\t\t\tcase StandardTokenType.RegEx:\n\t\t\t\treturn this._inRegEx;\n\t\t}\n\t}\n\n\tpublic shouldAutoClose(context: ScopedLineTokens, column: number): boolean {\n\t\t// Always complete on empty line\n\t\tif (context.getTokenCount() === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst tokenIndex = context.findTokenIndexAtOffset(column - 2);\n\t\tconst standardTokenType = context.getStandardTokenType(tokenIndex);\n\t\treturn this.isOK(standardTokenType);\n\t}\n\n\tprivate _findNeutralCharacterInRange(fromCharCode: number, toCharCode: number): string | null {\n\t\tfor (let charCode = fromCharCode; charCode <= toCharCode; charCode++) {\n\t\t\tconst character = String.fromCharCode(charCode);\n\t\t\tif (!this.open.includes(character) && !this.close.includes(character)) {\n\t\t\t\treturn character;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Find a character in the range [0-9a-zA-Z] that does not appear in the open or close\n\t */\n\tpublic findNeutralCharacter(): string | null {\n\t\tif (!this._neutralCharacterSearched) {\n\t\t\tthis._neutralCharacterSearched = true;\n\t\t\tif (!this._neutralCharacter) {\n\t\t\t\tthis._neutralCharacter = this._findNeutralCharacterInRange(CharCode.Digit0, CharCode.Digit9);\n\t\t\t}\n\t\t\tif (!this._neutralCharacter) {\n\t\t\t\tthis._neutralCharacter = this._findNeutralCharacterInRange(CharCode.a, CharCode.z);\n\t\t\t}\n\t\t\tif (!this._neutralCharacter) {\n\t\t\t\tthis._neutralCharacter = this._findNeutralCharacterInRange(CharCode.A, CharCode.Z);\n\t\t\t}\n\t\t}\n\t\treturn this._neutralCharacter;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AutoClosingPairs {\n\t// it is useful to be able to get pairs using either end of open and close\n\n\t/** Key is first character of open */\n\tpublic readonly autoClosingPairsOpenByStart: Map<string, StandardAutoClosingPairConditional[]>;\n\t/** Key is last character of open */\n\tpublic readonly autoClosingPairsOpenByEnd: Map<string, StandardAutoClosingPairConditional[]>;\n\t/** Key is first character of close */\n\tpublic readonly autoClosingPairsCloseByStart: Map<string, StandardAutoClosingPairConditional[]>;\n\t/** Key is last character of close */\n\tpublic readonly autoClosingPairsCloseByEnd: Map<string, StandardAutoClosingPairConditional[]>;\n\t/** Key is close. Only has pairs that are a single character */\n\tpublic readonly autoClosingPairsCloseSingleChar: Map<string, StandardAutoClosingPairConditional[]>;\n\n\tconstructor(autoClosingPairs: StandardAutoClosingPairConditional[]) {\n\t\tthis.autoClosingPairsOpenByStart = new Map<string, StandardAutoClosingPairConditional[]>();\n\t\tthis.autoClosingPairsOpenByEnd = new Map<string, StandardAutoClosingPairConditional[]>();\n\t\tthis.autoClosingPairsCloseByStart = new Map<string, StandardAutoClosingPairConditional[]>();\n\t\tthis.autoClosingPairsCloseByEnd = new Map<string, StandardAutoClosingPairConditional[]>();\n\t\tthis.autoClosingPairsCloseSingleChar = new Map<string, StandardAutoClosingPairConditional[]>();\n\t\tfor (const pair of autoClosingPairs) {\n\t\t\tappendEntry(this.autoClosingPairsOpenByStart, pair.open.charAt(0), pair);\n\t\t\tappendEntry(this.autoClosingPairsOpenByEnd, pair.open.charAt(pair.open.length - 1), pair);\n\t\t\tappendEntry(this.autoClosingPairsCloseByStart, pair.close.charAt(0), pair);\n\t\t\tappendEntry(this.autoClosingPairsCloseByEnd, pair.close.charAt(pair.close.length - 1), pair);\n\t\t\tif (pair.close.length === 1 && pair.open.length === 1) {\n\t\t\t\tappendEntry(this.autoClosingPairsCloseSingleChar, pair.close, pair);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction appendEntry<K, V>(target: Map<K, V[]>, key: K, value: V): void {\n\tif (target.has(key)) {\n\t\ttarget.get(key)!.push(value);\n\t} else {\n\t\ttarget.set(key, [value]);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\nimport { ILink } from 'vs/editor/common/languages';\n\nexport interface ILinkComputerTarget {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n}\n\nexport const enum State {\n\tInvalid = 0,\n\tStart = 1,\n\tH = 2,\n\tHT = 3,\n\tHTT = 4,\n\tHTTP = 5,\n\tF = 6,\n\tFI = 7,\n\tFIL = 8,\n\tBeforeColon = 9,\n\tAfterColon = 10,\n\tAlmostThere = 11,\n\tEnd = 12,\n\tAccept = 13,\n\tLastKnownState = 14 // marker, custom states may follow\n}\n\nexport type Edge = [State, number, State];\n\nexport class Uint8Matrix {\n\n\tprivate readonly _data: Uint8Array;\n\tpublic readonly rows: number;\n\tpublic readonly cols: number;\n\n\tconstructor(rows: number, cols: number, defaultValue: number) {\n\t\tconst data = new Uint8Array(rows * cols);\n\t\tfor (let i = 0, len = rows * cols; i < len; i++) {\n\t\t\tdata[i] = defaultValue;\n\t\t}\n\n\t\tthis._data = data;\n\t\tthis.rows = rows;\n\t\tthis.cols = cols;\n\t}\n\n\tpublic get(row: number, col: number): number {\n\t\treturn this._data[row * this.cols + col];\n\t}\n\n\tpublic set(row: number, col: number, value: number): void {\n\t\tthis._data[row * this.cols + col] = value;\n\t}\n}\n\nexport class StateMachine {\n\n\tprivate readonly _states: Uint8Matrix;\n\tprivate readonly _maxCharCode: number;\n\n\tconstructor(edges: Edge[]) {\n\t\tlet maxCharCode = 0;\n\t\tlet maxState = State.Invalid;\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\n\t\t\tconst [from, chCode, to] = edges[i];\n\t\t\tif (chCode > maxCharCode) {\n\t\t\t\tmaxCharCode = chCode;\n\t\t\t}\n\t\t\tif (from > maxState) {\n\t\t\t\tmaxState = from;\n\t\t\t}\n\t\t\tif (to > maxState) {\n\t\t\t\tmaxState = to;\n\t\t\t}\n\t\t}\n\n\t\tmaxCharCode++;\n\t\tmaxState++;\n\n\t\tconst states = new Uint8Matrix(maxState, maxCharCode, State.Invalid);\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\n\t\t\tconst [from, chCode, to] = edges[i];\n\t\t\tstates.set(from, chCode, to);\n\t\t}\n\n\t\tthis._states = states;\n\t\tthis._maxCharCode = maxCharCode;\n\t}\n\n\tpublic nextState(currentState: State, chCode: number): State {\n\t\tif (chCode < 0 || chCode >= this._maxCharCode) {\n\t\t\treturn State.Invalid;\n\t\t}\n\t\treturn this._states.get(currentState, chCode);\n\t}\n}\n\n// State machine for http:// or https:// or file://\nlet _stateMachine: StateMachine | null = null;\nfunction getStateMachine(): StateMachine {\n\tif (_stateMachine === null) {\n\t\t_stateMachine = new StateMachine([\n\t\t\t[State.Start, CharCode.h, State.H],\n\t\t\t[State.Start, CharCode.H, State.H],\n\t\t\t[State.Start, CharCode.f, State.F],\n\t\t\t[State.Start, CharCode.F, State.F],\n\n\t\t\t[State.H, CharCode.t, State.HT],\n\t\t\t[State.H, CharCode.T, State.HT],\n\n\t\t\t[State.HT, CharCode.t, State.HTT],\n\t\t\t[State.HT, CharCode.T, State.HTT],\n\n\t\t\t[State.HTT, CharCode.p, State.HTTP],\n\t\t\t[State.HTT, CharCode.P, State.HTTP],\n\n\t\t\t[State.HTTP, CharCode.s, State.BeforeColon],\n\t\t\t[State.HTTP, CharCode.S, State.BeforeColon],\n\t\t\t[State.HTTP, CharCode.Colon, State.AfterColon],\n\n\t\t\t[State.F, CharCode.i, State.FI],\n\t\t\t[State.F, CharCode.I, State.FI],\n\n\t\t\t[State.FI, CharCode.l, State.FIL],\n\t\t\t[State.FI, CharCode.L, State.FIL],\n\n\t\t\t[State.FIL, CharCode.e, State.BeforeColon],\n\t\t\t[State.FIL, CharCode.E, State.BeforeColon],\n\n\t\t\t[State.BeforeColon, CharCode.Colon, State.AfterColon],\n\n\t\t\t[State.AfterColon, CharCode.Slash, State.AlmostThere],\n\n\t\t\t[State.AlmostThere, CharCode.Slash, State.End],\n\t\t]);\n\t}\n\treturn _stateMachine;\n}\n\n\nconst enum CharacterClass {\n\tNone = 0,\n\tForceTermination = 1,\n\tCannotEndIn = 2\n}\n\nlet _classifier: CharacterClassifier<CharacterClass> | null = null;\nfunction getClassifier(): CharacterClassifier<CharacterClass> {\n\tif (_classifier === null) {\n\t\t_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None);\n\n\t\t// allow-any-unicode-next-line\n\t\tconst FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"ã€ã€‚。、,.:;‘〈「『〔([{「」ï½ï¼½ï¼‰ã€•ã€ã€ã€‰â€™ï½€ï½žâ€¦';\n\t\tfor (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\n\t\t\t_classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination);\n\t\t}\n\n\t\tconst CANNOT_END_WITH_CHARACTERS = '.,;';\n\t\tfor (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\n\t\t\t_classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), CharacterClass.CannotEndIn);\n\t\t}\n\t}\n\treturn _classifier;\n}\n\nexport class LinkComputer {\n\n\tprivate static _createLink(classifier: CharacterClassifier<CharacterClass>, line: string, lineNumber: number, linkBeginIndex: number, linkEndIndex: number): ILink {\n\t\t// Do not allow to end link in certain characters...\n\t\tlet lastIncludedCharIndex = linkEndIndex - 1;\n\t\tdo {\n\t\t\tconst chCode = line.charCodeAt(lastIncludedCharIndex);\n\t\t\tconst chClass = classifier.get(chCode);\n\t\t\tif (chClass !== CharacterClass.CannotEndIn) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIncludedCharIndex--;\n\t\t} while (lastIncludedCharIndex > linkBeginIndex);\n\n\t\t// Handle links enclosed in parens, square brackets and curlys.\n\t\tif (linkBeginIndex > 0) {\n\t\t\tconst charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\n\t\t\tconst lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\n\n\t\t\tif (\n\t\t\t\t(charCodeBeforeLink === CharCode.OpenParen && lastCharCodeInLink === CharCode.CloseParen)\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenSquareBracket && lastCharCodeInLink === CharCode.CloseSquareBracket)\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenCurlyBrace && lastCharCodeInLink === CharCode.CloseCurlyBrace)\n\t\t\t) {\n\t\t\t\t// Do not end in ) if ( is before the link start\n\t\t\t\t// Do not end in ] if [ is before the link start\n\t\t\t\t// Do not end in } if { is before the link start\n\t\t\t\tlastIncludedCharIndex--;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trange: {\n\t\t\t\tstartLineNumber: lineNumber,\n\t\t\t\tstartColumn: linkBeginIndex + 1,\n\t\t\t\tendLineNumber: lineNumber,\n\t\t\t\tendColumn: lastIncludedCharIndex + 2\n\t\t\t},\n\t\t\turl: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\n\t\t};\n\t}\n\n\tpublic static computeLinks(model: ILinkComputerTarget, stateMachine: StateMachine = getStateMachine()): ILink[] {\n\t\tconst classifier = getClassifier();\n\n\t\tconst result: ILink[] = [];\n\t\tfor (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\n\t\t\tconst line = model.getLineContent(i);\n\t\t\tconst len = line.length;\n\n\t\t\tlet j = 0;\n\t\t\tlet linkBeginIndex = 0;\n\t\t\tlet linkBeginChCode = 0;\n\t\t\tlet state = State.Start;\n\t\t\tlet hasOpenParens = false;\n\t\t\tlet hasOpenSquareBracket = false;\n\t\t\tlet inSquareBrackets = false;\n\t\t\tlet hasOpenCurlyBracket = false;\n\n\t\t\twhile (j < len) {\n\n\t\t\t\tlet resetStateMachine = false;\n\t\t\t\tconst chCode = line.charCodeAt(j);\n\n\t\t\t\tif (state === State.Accept) {\n\t\t\t\t\tlet chClass: CharacterClass;\n\t\t\t\t\tswitch (chCode) {\n\t\t\t\t\t\tcase CharCode.OpenParen:\n\t\t\t\t\t\t\thasOpenParens = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseParen:\n\t\t\t\t\t\t\tchClass = (hasOpenParens ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.OpenSquareBracket:\n\t\t\t\t\t\t\tinSquareBrackets = true;\n\t\t\t\t\t\t\thasOpenSquareBracket = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseSquareBracket:\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t\tchClass = (hasOpenSquareBracket ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.OpenCurlyBrace:\n\t\t\t\t\t\t\thasOpenCurlyBracket = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseCurlyBrace:\n\t\t\t\t\t\t\tchClass = (hasOpenCurlyBracket ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t/* The following three rules make it that ' or \" or ` are allowed inside links if the link began with a different one */\n\t\t\t\t\t\tcase CharCode.SingleQuote:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.DoubleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.DoubleQuote:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.BackTick:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.DoubleQuote) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.Asterisk:\n\t\t\t\t\t\t\t// `*` terminates a link if the link began with `*`\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.Asterisk) ? CharacterClass.ForceTermination : CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.Pipe:\n\t\t\t\t\t\t\t// `|` terminates a link if the link began with `|`\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.Pipe) ? CharacterClass.ForceTermination : CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.Space:\n\t\t\t\t\t\t\t// ` ` allow space in between [ and ]\n\t\t\t\t\t\t\tchClass = (inSquareBrackets ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tchClass = classifier.get(chCode);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if character terminates link\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\n\t\t\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (state === State.End) {\n\n\t\t\t\t\tlet chClass: CharacterClass;\n\t\t\t\t\tif (chCode === CharCode.OpenSquareBracket) {\n\t\t\t\t\t\t// Allow for the authority part to contain ipv6 addresses which contain [ and ]\n\t\t\t\t\t\thasOpenSquareBracket = true;\n\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchClass = classifier.get(chCode);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if character terminates link\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = State.Accept;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstate = stateMachine.nextState(state, chCode);\n\t\t\t\t\tif (state === State.Invalid) {\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (resetStateMachine) {\n\t\t\t\t\tstate = State.Start;\n\t\t\t\t\thasOpenParens = false;\n\t\t\t\t\thasOpenSquareBracket = false;\n\t\t\t\t\thasOpenCurlyBracket = false;\n\n\t\t\t\t\t// Record where the link started\n\t\t\t\t\tlinkBeginIndex = j + 1;\n\t\t\t\t\tlinkBeginChCode = chCode;\n\t\t\t\t}\n\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\tif (state === State.Accept) {\n\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Returns an array of all links contains in the provided\n * document. *Note* that this operation is computational\n * expensive and should not run in the UI thread.\n */\nexport function computeLinks(model: ILinkComputerTarget | null): ILink[] {\n\tif (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn LinkComputer.computeLinks(model);\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 { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { StandardTokenType } from 'vs/editor/common/languages';\n\nexport function createScopedLineTokens(context: LineTokens, offset: number): ScopedLineTokens {\n\tconst tokenCount = context.getCount();\n\tconst tokenIndex = context.findTokenIndexAtOffset(offset);\n\tconst desiredLanguageId = context.getLanguageId(tokenIndex);\n\n\tlet lastTokenIndex = tokenIndex;\n\twhile (lastTokenIndex + 1 < tokenCount && context.getLanguageId(lastTokenIndex + 1) === desiredLanguageId) {\n\t\tlastTokenIndex++;\n\t}\n\n\tlet firstTokenIndex = tokenIndex;\n\twhile (firstTokenIndex > 0 && context.getLanguageId(firstTokenIndex - 1) === desiredLanguageId) {\n\t\tfirstTokenIndex--;\n\t}\n\n\treturn new ScopedLineTokens(\n\t\tcontext,\n\t\tdesiredLanguageId,\n\t\tfirstTokenIndex,\n\t\tlastTokenIndex + 1,\n\t\tcontext.getStartOffset(firstTokenIndex),\n\t\tcontext.getEndOffset(lastTokenIndex)\n\t);\n}\n\nexport class ScopedLineTokens {\n\t_scopedLineTokensBrand: void = undefined;\n\n\tpublic readonly languageId: string;\n\tprivate readonly _actual: LineTokens;\n\tprivate readonly _firstTokenIndex: number;\n\tprivate readonly _lastTokenIndex: number;\n\tpublic readonly firstCharOffset: number;\n\tprivate readonly _lastCharOffset: number;\n\n\tconstructor(\n\t\tactual: LineTokens,\n\t\tlanguageId: string,\n\t\tfirstTokenIndex: number,\n\t\tlastTokenIndex: number,\n\t\tfirstCharOffset: number,\n\t\tlastCharOffset: number\n\t) {\n\t\tthis._actual = actual;\n\t\tthis.languageId = languageId;\n\t\tthis._firstTokenIndex = firstTokenIndex;\n\t\tthis._lastTokenIndex = lastTokenIndex;\n\t\tthis.firstCharOffset = firstCharOffset;\n\t\tthis._lastCharOffset = lastCharOffset;\n\t}\n\n\tpublic getLineContent(): string {\n\t\tconst actualLineContent = this._actual.getLineContent();\n\t\treturn actualLineContent.substring(this.firstCharOffset, this._lastCharOffset);\n\t}\n\n\tpublic getActualLineContentBefore(offset: number): string {\n\t\tconst actualLineContent = this._actual.getLineContent();\n\t\treturn actualLineContent.substring(0, this.firstCharOffset + offset);\n\t}\n\n\tpublic getTokenCount(): number {\n\t\treturn this._lastTokenIndex - this._firstTokenIndex;\n\t}\n\n\tpublic findTokenIndexAtOffset(offset: number): number {\n\t\treturn this._actual.findTokenIndexAtOffset(offset + this.firstCharOffset) - this._firstTokenIndex;\n\t}\n\n\tpublic getStandardTokenType(tokenIndex: number): StandardTokenType {\n\t\treturn this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex);\n\t}\n}\n\nconst enum IgnoreBracketsInTokens {\n\tvalue = StandardTokenType.Comment | StandardTokenType.String | StandardTokenType.RegEx\n}\n\nexport function ignoreBracketsInToken(standardTokenType: StandardTokenType): boolean {\n\treturn (standardTokenType & IgnoreBracketsInTokens.value) !== 0;\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 { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { PositionAffinity, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { AutoClosingPairs } from 'vs/editor/common/languages/languageConfiguration';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { createScopedLineTokens } from 'vs/editor/common/languages/supports';\nimport { IElectricAction } from 'vs/editor/common/languages/supports/electricCharacter';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { normalizeIndentation } from 'vs/editor/common/core/indentation';\n\nexport interface IColumnSelectData {\n\tisReal: boolean;\n\tfromViewLineNumber: number;\n\tfromViewVisualColumn: number;\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\n/**\n * This is an operation type that will be recorded for undo/redo purposes.\n * The goal is to introduce an undo stop when the controller switches between different operation types.\n */\nexport const enum EditOperationType {\n\tOther = 0,\n\tDeletingLeft = 2,\n\tDeletingRight = 3,\n\tTypingOther = 4,\n\tTypingFirstSpace = 5,\n\tTypingConsecutiveSpace = 6,\n}\n\nexport interface CharacterMap {\n\t[char: string]: string;\n}\n\nconst autoCloseAlways = () => true;\nconst autoCloseNever = () => false;\nconst autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\\t');\n\nexport class CursorConfiguration {\n\t_cursorMoveConfigurationBrand: void = undefined;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: boolean;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly pageSize: number;\n\tpublic readonly lineHeight: number;\n\tpublic readonly useTabStops: boolean;\n\tpublic readonly wordSeparators: string;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly multiCursorMergeOverlapping: boolean;\n\tpublic readonly multiCursorPaste: 'spread' | 'full';\n\tpublic readonly autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingDelete: EditorAutoClosingEditStrategy;\n\tpublic readonly autoClosingOvertype: EditorAutoClosingEditStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: EditorAutoIndentStrategy;\n\tpublic readonly autoClosingPairs: AutoClosingPairs;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean; bracket: (ch: string) => boolean };\n\n\tprivate readonly _languageId: string;\n\tprivate _electricChars: { [key: string]: boolean } | null;\n\n\tpublic static shouldRecreate(e: ConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.hasChanged(EditorOption.layoutInfo)\n\t\t\t|| e.hasChanged(EditorOption.wordSeparators)\n\t\t\t|| e.hasChanged(EditorOption.emptySelectionClipboard)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorMergeOverlapping)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorPaste)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingBrackets)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingQuotes)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingDelete)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingOvertype)\n\t\t\t|| e.hasChanged(EditorOption.autoSurround)\n\t\t\t|| e.hasChanged(EditorOption.useTabStops)\n\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t\t|| e.hasChanged(EditorOption.readOnly)\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageId: string,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IEditorConfiguration,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._languageId = languageId;\n\n\t\tconst options = configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis.readOnly = options.get(EditorOption.readOnly);\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);\n\t\tthis.useTabStops = options.get(EditorOption.useTabStops);\n\t\tthis.wordSeparators = options.get(EditorOption.wordSeparators);\n\t\tthis.emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis.copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.multiCursorMergeOverlapping = options.get(EditorOption.multiCursorMergeOverlapping);\n\t\tthis.multiCursorPaste = options.get(EditorOption.multiCursorPaste);\n\t\tthis.autoClosingBrackets = options.get(EditorOption.autoClosingBrackets);\n\t\tthis.autoClosingQuotes = options.get(EditorOption.autoClosingQuotes);\n\t\tthis.autoClosingDelete = options.get(EditorOption.autoClosingDelete);\n\t\tthis.autoClosingOvertype = options.get(EditorOption.autoClosingOvertype);\n\t\tthis.autoSurround = options.get(EditorOption.autoSurround);\n\t\tthis.autoIndent = options.get(EditorOption.autoIndent);\n\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: this._getShouldAutoClose(languageId, this.autoClosingQuotes),\n\t\t\tbracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets)\n\t\t};\n\n\t\tthis.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs();\n\n\t\tconst surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs();\n\t\tif (surroundingPairs) {\n\t\t\tfor (const pair of surroundingPairs) {\n\t\t\t\tthis.surroundingPairs[pair.open] = pair.close;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get electricChars() {\n\t\tif (!this._electricChars) {\n\t\t\tthis._electricChars = {};\n\t\t\tconst electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();\n\t\t\tif (electricChars) {\n\t\t\t\tfor (const char of electricChars) {\n\t\t\t\t\tthis._electricChars[char] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._electricChars;\n\t}\n\n\t/**\n\t * Should return opening bracket type to match indentation with\n\t */\n\tpublic onElectricCharacter(character: string, context: LineTokens, column: number): IElectricAction | null {\n\t\tconst scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tconst electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter;\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\treturn normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate _getShouldAutoClose(languageId: string, autoCloseConfig: EditorAutoClosingStrategy): (ch: string) => boolean {\n\t\tswitch (autoCloseConfig) {\n\t\t\tcase 'beforeWhitespace':\n\t\t\t\treturn autoCloseBeforeWhitespace;\n\t\t\tcase 'languageDefined':\n\t\t\t\treturn this._getLanguageDefinedShouldAutoClose(languageId);\n\t\t\tcase 'always':\n\t\t\t\treturn autoCloseAlways;\n\t\t\tcase 'never':\n\t\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate _getLanguageDefinedShouldAutoClose(languageId: string): (ch: string) => boolean {\n\t\tconst autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet();\n\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic visibleColumnFromColumn(model: ICursorSimpleModel, position: Position): number {\n\t\treturn CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize);\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic columnFromVisibleColumn(model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tconst result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize);\n\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (result > maxColumn) {\n\t\t\treturn maxColumn;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Represents a simple model (either the model or the view model).\n */\nexport interface ICursorSimpleModel {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t */\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void = undefined;\n\n\tpublic static fromModelState(modelState: SingleCursorState): PartialModelCursorState {\n\t\treturn new PartialModelCursorState(modelState);\n\t}\n\n\tpublic static fromViewState(viewState: SingleCursorState): PartialViewCursorState {\n\t\treturn new PartialViewCursorState(viewState);\n\t}\n\n\tpublic static fromModelSelection(modelSelection: ISelection): PartialModelCursorState {\n\t\tconst selection = Selection.liftSelection(modelSelection);\n\t\tconst modelState = new SingleCursorState(\n\t\t\tRange.fromPositions(selection.getSelectionStart()),\n\t\t\t0,\n\t\t\tselection.getPosition(), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {\n\t\tconst states: PartialModelCursorState[] = [];\n\t\tfor (let i = 0, len = modelSelections.length; i < len; i++) {\n\t\t\tstates[i] = this.fromModelSelection(modelSelections[i]);\n\t\t}\n\t\treturn states;\n\t}\n\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(modelState: SingleCursorState, viewState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\treturn (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState));\n\t}\n}\n\nexport class PartialModelCursorState {\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: null;\n\n\tconstructor(modelState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = null;\n\t}\n}\n\nexport class PartialViewCursorState {\n\treadonly modelState: null;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(viewState: SingleCursorState) {\n\t\tthis.modelState = null;\n\t\tthis.viewState = viewState;\n\t}\n}\n\n/**\n * Represents the cursor state on either the model or on the view model.\n */\nexport class SingleCursorState {\n\t_singleCursorStateBrand: void = undefined;\n\n\t// --- selection can start as a range (think double click and drag)\n\tpublic readonly selectionStart: Range;\n\tpublic readonly selectionStartLeftoverVisibleColumns: number;\n\tpublic readonly position: Position;\n\tpublic readonly leftoverVisibleColumns: number;\n\tpublic readonly selection: Selection;\n\n\tconstructor(\n\t\tselectionStart: Range,\n\t\tselectionStartLeftoverVisibleColumns: number,\n\t\tposition: Position,\n\t\tleftoverVisibleColumns: number,\n\t) {\n\t\tthis.selectionStart = selectionStart;\n\t\tthis.selectionStartLeftoverVisibleColumns = selectionStartLeftoverVisibleColumns;\n\t\tthis.position = position;\n\t\tthis.leftoverVisibleColumns = leftoverVisibleColumns;\n\t\tthis.selection = SingleCursorState._computeSelection(this.selectionStart, this.position);\n\t}\n\n\tpublic equals(other: SingleCursorState) {\n\t\treturn (\n\t\t\tthis.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns\n\t\t\t&& this.leftoverVisibleColumns === other.leftoverVisibleColumns\n\t\t\t&& this.position.equals(other.position)\n\t\t\t&& this.selectionStart.equalsRange(other.selectionStart)\n\t\t);\n\t}\n\n\tpublic hasSelection(): boolean {\n\t\treturn (!this.selection.isEmpty() || !this.selectionStart.isEmpty());\n\t}\n\n\tpublic move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new SingleCursorState(\n\t\t\t\tthis.selectionStart,\n\t\t\t\tthis.selectionStartLeftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tleftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static _computeSelection(selectionStart: Range, position: Position): Selection {\n\t\tif (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\treturn Selection.fromPositions(selectionStart.getStartPosition(), position);\n\t\t} else {\n\t\t\treturn Selection.fromPositions(selectionStart.getEndPosition(), position);\n\t\t}\n\t}\n}\n\nexport class EditOperationResult {\n\t_editOperationResultBrand: void = undefined;\n\n\treadonly type: EditOperationType;\n\treadonly commands: Array<ICommand | null>;\n\treadonly shouldPushStackElementBefore: boolean;\n\treadonly shouldPushStackElementAfter: boolean;\n\n\tconstructor(\n\t\ttype: EditOperationType,\n\t\tcommands: Array<ICommand | null>,\n\t\topts: {\n\t\t\tshouldPushStackElementBefore: boolean;\n\t\t\tshouldPushStackElementAfter: boolean;\n\t\t}\n\t) {\n\t\tthis.type = type;\n\t\tthis.commands = commands;\n\t\tthis.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;\n\t\tthis.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;\n\t}\n}\n\nexport function isQuote(ch: string): boolean {\n\treturn (ch === '\\'' || ch === '\"' || ch === '`');\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 { CursorConfiguration, ICursorSimpleModel, SingleCursorState, IColumnSelectData } from 'vs/editor/common/cursorCommon';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\n\nexport class ColumnSelection {\n\n\tpublic static columnSelect(config: CursorConfiguration, model: ICursorSimpleModel, fromLineNumber: number, fromVisibleColumn: number, toLineNumber: number, toVisibleColumn: number): IColumnSelectResult {\n\t\tconst lineCount = Math.abs(toLineNumber - fromLineNumber) + 1;\n\t\tconst reversed = (fromLineNumber > toLineNumber);\n\t\tconst isRTL = (fromVisibleColumn > toVisibleColumn);\n\t\tconst isLTR = (fromVisibleColumn < toVisibleColumn);\n\n\t\tconst result: SingleCursorState[] = [];\n\n\t\t// console.log(`fromVisibleColumn: ${fromVisibleColumn}, toVisibleColumn: ${toVisibleColumn}`);\n\n\t\tfor (let i = 0; i < lineCount; i++) {\n\t\t\tconst lineNumber = fromLineNumber + (reversed ? -i : i);\n\n\t\t\tconst startColumn = config.columnFromVisibleColumn(model, lineNumber, fromVisibleColumn);\n\t\t\tconst endColumn = config.columnFromVisibleColumn(model, lineNumber, toVisibleColumn);\n\t\t\tconst visibleStartColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, startColumn));\n\t\t\tconst visibleEndColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, endColumn));\n\n\t\t\t// console.log(`lineNumber: ${lineNumber}: visibleStartColumn: ${visibleStartColumn}, visibleEndColumn: ${visibleEndColumn}`);\n\n\t\t\tif (isLTR) {\n\t\t\t\tif (visibleStartColumn > toVisibleColumn) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (visibleEndColumn < fromVisibleColumn) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tif (visibleEndColumn > fromVisibleColumn) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (visibleStartColumn < toVisibleColumn) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.push(new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, startColumn, lineNumber, startColumn), 0,\n\t\t\t\tnew Position(lineNumber, endColumn), 0\n\t\t\t));\n\t\t}\n\n\t\tif (result.length === 0) {\n\t\t\t// We are after all the lines, so add cursor at the end of each line\n\t\t\tfor (let i = 0; i < lineCount; i++) {\n\t\t\t\tconst lineNumber = fromLineNumber + (reversed ? -i : i);\n\t\t\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\n\t\t\t\tresult.push(new SingleCursorState(\n\t\t\t\t\tnew Range(lineNumber, maxColumn, lineNumber, maxColumn), 0,\n\t\t\t\t\tnew Position(lineNumber, maxColumn), 0\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tviewStates: result,\n\t\t\treversed: reversed,\n\t\t\tfromLineNumber: fromLineNumber,\n\t\t\tfromVisualColumn: fromVisibleColumn,\n\t\t\ttoLineNumber: toLineNumber,\n\t\t\ttoVisualColumn: toVisibleColumn\n\t\t};\n\t}\n\n\tpublic static columnSelectLeft(config: CursorConfiguration, model: ICursorSimpleModel, prevColumnSelectData: IColumnSelectData): IColumnSelectResult {\n\t\tlet toViewVisualColumn = prevColumnSelectData.toViewVisualColumn;\n\t\tif (toViewVisualColumn > 0) {\n\t\t\ttoViewVisualColumn--;\n\t\t}\n\n\t\treturn ColumnSelection.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectRight(config: CursorConfiguration, model: ICursorSimpleModel, prevColumnSelectData: IColumnSelectData): IColumnSelectResult {\n\t\tlet maxVisualViewColumn = 0;\n\t\tconst minViewLineNumber = Math.min(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber);\n\t\tconst maxViewLineNumber = Math.max(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber);\n\t\tfor (let lineNumber = minViewLineNumber; lineNumber <= maxViewLineNumber; lineNumber++) {\n\t\t\tconst lineMaxViewColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tconst lineMaxVisualViewColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, lineMaxViewColumn));\n\t\t\tmaxVisualViewColumn = Math.max(maxVisualViewColumn, lineMaxVisualViewColumn);\n\t\t}\n\n\t\tlet toViewVisualColumn = prevColumnSelectData.toViewVisualColumn;\n\t\tif (toViewVisualColumn < maxVisualViewColumn) {\n\t\t\ttoViewVisualColumn++;\n\t\t}\n\n\t\treturn this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectUp(config: CursorConfiguration, model: ICursorSimpleModel, prevColumnSelectData: IColumnSelectData, isPaged: boolean): IColumnSelectResult {\n\t\tconst linesCount = isPaged ? config.pageSize : 1;\n\t\tconst toViewLineNumber = Math.max(1, prevColumnSelectData.toViewLineNumber - linesCount);\n\t\treturn this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectDown(config: CursorConfiguration, model: ICursorSimpleModel, prevColumnSelectData: IColumnSelectData, isPaged: boolean): IColumnSelectResult {\n\t\tconst linesCount = isPaged ? config.pageSize : 1;\n\t\tconst toViewLineNumber = Math.min(model.getLineCount(), prevColumnSelectData.toViewLineNumber + linesCount);\n\t\treturn this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\n\t}\n}\n\nexport interface IColumnSelectResult {\n\tviewStates: SingleCursorState[];\n\treversed: boolean;\n\tfromLineNumber: number;\n\tfromVisualColumn: number;\n\ttoLineNumber: number;\n\ttoVisualColumn: 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 { CursorConfiguration, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/base/common/uint';\nimport { AtomicTabMoveOperations, Direction } from 'vs/editor/common/cursor/cursorAtomicMoveOperations';\nimport { PositionAffinity } from 'vs/editor/common/model';\n\nexport class CursorPosition {\n\t_cursorPositionBrand: void = undefined;\n\n\tpublic readonly lineNumber: number;\n\tpublic readonly column: number;\n\tpublic readonly leftoverVisibleColumns: number;\n\n\tconstructor(lineNumber: number, column: number, leftoverVisibleColumns: number) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.column = column;\n\t\tthis.leftoverVisibleColumns = leftoverVisibleColumns;\n\t}\n}\n\nexport class MoveOperations {\n\tpublic static leftPosition(model: ICursorSimpleModel, position: Position): Position {\n\t\tif (position.column > model.getLineMinColumn(position.lineNumber)) {\n\t\t\treturn position.delta(undefined, -strings.prevCharLength(model.getLineContent(position.lineNumber), position.column - 1));\n\t\t} else if (position.lineNumber > 1) {\n\t\t\tconst newLineNumber = position.lineNumber - 1;\n\t\t\treturn new Position(newLineNumber, model.getLineMaxColumn(newLineNumber));\n\t\t} else {\n\t\t\treturn position;\n\t\t}\n\t}\n\n\tprivate static leftPositionAtomicSoftTabs(model: ICursorSimpleModel, position: Position, tabSize: number): Position {\n\t\tif (position.column <= model.getLineIndentColumn(position.lineNumber)) {\n\t\t\tconst minColumn = model.getLineMinColumn(position.lineNumber);\n\t\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\t\tconst newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, position.column - 1, tabSize, Direction.Left);\n\t\t\tif (newPosition !== -1 && newPosition + 1 >= minColumn) {\n\t\t\t\treturn new Position(position.lineNumber, newPosition + 1);\n\t\t\t}\n\t\t}\n\t\treturn this.leftPosition(model, position);\n\t}\n\n\tprivate static left(config: CursorConfiguration, model: ICursorSimpleModel, position: Position): CursorPosition {\n\t\tconst pos = config.stickyTabStops\n\t\t\t? MoveOperations.leftPositionAtomicSoftTabs(model, position, config.tabSize)\n\t\t\t: MoveOperations.leftPosition(model, position);\n\t\treturn new CursorPosition(pos.lineNumber, pos.column, 0);\n\t}\n\n\t/**\n\t * @param noOfColumns Must be either `1`\n\t * or `Math.round(viewModel.getLineContent(viewLineNumber).length / 2)` (for half lines).\n\t*/\n\tpublic static moveLeft(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, noOfColumns: number): SingleCursorState {\n\t\tlet lineNumber: number,\n\t\t\tcolumn: number;\n\n\t\tif (cursor.hasSelection() && !inSelectionMode) {\n\t\t\t// If the user has a selection and does not want to extend it,\n\t\t\t// put the cursor at the beginning of the selection.\n\t\t\tlineNumber = cursor.selection.startLineNumber;\n\t\t\tcolumn = cursor.selection.startColumn;\n\t\t} else {\n\t\t\t// This has no effect if noOfColumns === 1.\n\t\t\t// It is ok to do so in the half-line scenario.\n\t\t\tconst pos = cursor.position.delta(undefined, -(noOfColumns - 1));\n\t\t\t// We clip the position before normalization, as normalization is not defined\n\t\t\t// for possibly negative columns.\n\t\t\tconst normalizedPos = model.normalizePosition(MoveOperations.clipPositionColumn(pos, model), PositionAffinity.Left);\n\t\t\tconst p = MoveOperations.left(config, model, normalizedPos);\n\n\t\t\tlineNumber = p.lineNumber;\n\t\t\tcolumn = p.column;\n\t\t}\n\n\t\treturn cursor.move(inSelectionMode, lineNumber, column, 0);\n\t}\n\n\t/**\n\t * Adjusts the column so that it is within min/max of the line.\n\t*/\n\tprivate static clipPositionColumn(position: Position, model: ICursorSimpleModel): Position {\n\t\treturn new Position(\n\t\t\tposition.lineNumber,\n\t\t\tMoveOperations.clipRange(position.column, model.getLineMinColumn(position.lineNumber),\n\t\t\t\tmodel.getLineMaxColumn(position.lineNumber))\n\t\t);\n\t}\n\n\tprivate static clipRange(value: number, min: number, max: number): number {\n\t\tif (value < min) {\n\t\t\treturn min;\n\t\t}\n\t\tif (value > max) {\n\t\t\treturn max;\n\t\t}\n\t\treturn value;\n\t}\n\n\tpublic static rightPosition(model: ICursorSimpleModel, lineNumber: number, column: number): Position {\n\t\tif (column < model.getLineMaxColumn(lineNumber)) {\n\t\t\tcolumn = column + strings.nextCharLength(model.getLineContent(lineNumber), column - 1);\n\t\t} else if (lineNumber < model.getLineCount()) {\n\t\t\tlineNumber = lineNumber + 1;\n\t\t\tcolumn = model.getLineMinColumn(lineNumber);\n\t\t}\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tpublic static rightPositionAtomicSoftTabs(model: ICursorSimpleModel, lineNumber: number, column: number, tabSize: number, indentSize: number): Position {\n\t\tif (column < model.getLineIndentColumn(lineNumber)) {\n\t\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\t\tconst newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, column - 1, tabSize, Direction.Right);\n\t\t\tif (newPosition !== -1) {\n\t\t\t\treturn new Position(lineNumber, newPosition + 1);\n\t\t\t}\n\t\t}\n\t\treturn this.rightPosition(model, lineNumber, column);\n\t}\n\n\tpublic static right(config: CursorConfiguration, model: ICursorSimpleModel, position: Position): CursorPosition {\n\t\tconst pos = config.stickyTabStops\n\t\t\t? MoveOperations.rightPositionAtomicSoftTabs(model, position.lineNumber, position.column, config.tabSize, config.indentSize)\n\t\t\t: MoveOperations.rightPosition(model, position.lineNumber, position.column);\n\t\treturn new CursorPosition(pos.lineNumber, pos.column, 0);\n\t}\n\n\tpublic static moveRight(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, noOfColumns: number): SingleCursorState {\n\t\tlet lineNumber: number,\n\t\t\tcolumn: number;\n\n\t\tif (cursor.hasSelection() && !inSelectionMode) {\n\t\t\t// If we are in selection mode, move right without selection cancels selection and puts cursor at the end of the selection\n\t\t\tlineNumber = cursor.selection.endLineNumber;\n\t\t\tcolumn = cursor.selection.endColumn;\n\t\t} else {\n\t\t\tconst pos = cursor.position.delta(undefined, noOfColumns - 1);\n\t\t\tconst normalizedPos = model.normalizePosition(MoveOperations.clipPositionColumn(pos, model), PositionAffinity.Right);\n\t\t\tconst r = MoveOperations.right(config, model, normalizedPos);\n\t\t\tlineNumber = r.lineNumber;\n\t\t\tcolumn = r.column;\n\t\t}\n\n\t\treturn cursor.move(inSelectionMode, lineNumber, column, 0);\n\t}\n\n\tpublic static vertical(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number, leftoverVisibleColumns: number, newLineNumber: number, allowMoveOnEdgeLine: boolean, normalizationAffinity?: PositionAffinity): CursorPosition {\n\t\tconst currentVisibleColumn = CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns;\n\t\tconst lineCount = model.getLineCount();\n\t\tconst wasOnFirstPosition = (lineNumber === 1 && column === 1);\n\t\tconst wasOnLastPosition = (lineNumber === lineCount && column === model.getLineMaxColumn(lineNumber));\n\t\tconst wasAtEdgePosition = (newLineNumber < lineNumber ? wasOnFirstPosition : wasOnLastPosition);\n\n\t\tlineNumber = newLineNumber;\n\t\tif (lineNumber < 1) {\n\t\t\tlineNumber = 1;\n\t\t\tif (allowMoveOnEdgeLine) {\n\t\t\t\tcolumn = model.getLineMinColumn(lineNumber);\n\t\t\t} else {\n\t\t\t\tcolumn = Math.min(model.getLineMaxColumn(lineNumber), column);\n\t\t\t}\n\t\t} else if (lineNumber > lineCount) {\n\t\t\tlineNumber = lineCount;\n\t\t\tif (allowMoveOnEdgeLine) {\n\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t} else {\n\t\t\t\tcolumn = Math.min(model.getLineMaxColumn(lineNumber), column);\n\t\t\t}\n\t\t} else {\n\t\t\tcolumn = config.columnFromVisibleColumn(model, lineNumber, currentVisibleColumn);\n\t\t}\n\n\t\tif (wasAtEdgePosition) {\n\t\t\tleftoverVisibleColumns = 0;\n\t\t} else {\n\t\t\tleftoverVisibleColumns = currentVisibleColumn - CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize);\n\t\t}\n\n\t\tif (normalizationAffinity !== undefined) {\n\t\t\tconst position = new Position(lineNumber, column);\n\t\t\tconst newPosition = model.normalizePosition(position, normalizationAffinity);\n\t\t\tleftoverVisibleColumns = leftoverVisibleColumns + (column - newPosition.column);\n\t\t\tlineNumber = newPosition.lineNumber;\n\t\t\tcolumn = newPosition.column;\n\t\t}\n\t\treturn new CursorPosition(lineNumber, column, leftoverVisibleColumns);\n\t}\n\n\tpublic static down(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number, leftoverVisibleColumns: number, count: number, allowMoveOnLastLine: boolean): CursorPosition {\n\t\treturn this.vertical(config, model, lineNumber, column, leftoverVisibleColumns, lineNumber + count, allowMoveOnLastLine, PositionAffinity.Right);\n\t}\n\n\tpublic static moveDown(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, linesCount: number): SingleCursorState {\n\t\tlet lineNumber: number,\n\t\t\tcolumn: number;\n\n\t\tif (cursor.hasSelection() && !inSelectionMode) {\n\t\t\t// If we are in selection mode, move down acts relative to the end of selection\n\t\t\tlineNumber = cursor.selection.endLineNumber;\n\t\t\tcolumn = cursor.selection.endColumn;\n\t\t} else {\n\t\t\tlineNumber = cursor.position.lineNumber;\n\t\t\tcolumn = cursor.position.column;\n\t\t}\n\n\t\tconst r = MoveOperations.down(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true);\n\n\t\treturn cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns);\n\t}\n\n\tpublic static translateDown(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState {\n\t\tconst selection = cursor.selection;\n\n\t\tconst selectionStart = MoveOperations.down(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false);\n\t\tconst position = MoveOperations.down(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false);\n\n\t\treturn new SingleCursorState(\n\t\t\tnew Range(selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column),\n\t\t\tselectionStart.leftoverVisibleColumns,\n\t\t\tnew Position(position.lineNumber, position.column),\n\t\t\tposition.leftoverVisibleColumns\n\t\t);\n\t}\n\n\tpublic static up(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number, leftoverVisibleColumns: number, count: number, allowMoveOnFirstLine: boolean): CursorPosition {\n\t\treturn this.vertical(config, model, lineNumber, column, leftoverVisibleColumns, lineNumber - count, allowMoveOnFirstLine, PositionAffinity.Left);\n\t}\n\n\tpublic static moveUp(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, linesCount: number): SingleCursorState {\n\t\tlet lineNumber: number,\n\t\t\tcolumn: number;\n\n\t\tif (cursor.hasSelection() && !inSelectionMode) {\n\t\t\t// If we are in selection mode, move up acts relative to the beginning of selection\n\t\t\tlineNumber = cursor.selection.startLineNumber;\n\t\t\tcolumn = cursor.selection.startColumn;\n\t\t} else {\n\t\t\tlineNumber = cursor.position.lineNumber;\n\t\t\tcolumn = cursor.position.column;\n\t\t}\n\n\t\tconst r = MoveOperations.up(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true);\n\n\t\treturn cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns);\n\t}\n\n\tpublic static translateUp(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState {\n\n\t\tconst selection = cursor.selection;\n\n\t\tconst selectionStart = MoveOperations.up(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false);\n\t\tconst position = MoveOperations.up(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false);\n\n\t\treturn new SingleCursorState(\n\t\t\tnew Range(selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column),\n\t\t\tselectionStart.leftoverVisibleColumns,\n\t\t\tnew Position(position.lineNumber, position.column),\n\t\t\tposition.leftoverVisibleColumns\n\t\t);\n\t}\n\n\tprivate static _isBlankLine(model: ICursorSimpleModel, lineNumber: number): boolean {\n\t\tif (model.getLineFirstNonWhitespaceColumn(lineNumber) === 0) {\n\t\t\t// empty or contains only whitespace\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic static moveToPrevBlankLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\tlet lineNumber = cursor.position.lineNumber;\n\n\t\t// If our current line is blank, move to the previous non-blank line\n\t\twhile (lineNumber > 1 && this._isBlankLine(model, lineNumber)) {\n\t\t\tlineNumber--;\n\t\t}\n\n\t\t// Find the previous blank line\n\t\twhile (lineNumber > 1 && !this._isBlankLine(model, lineNumber)) {\n\t\t\tlineNumber--;\n\t\t}\n\n\t\treturn cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0);\n\t}\n\n\tpublic static moveToNextBlankLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\tconst lineCount = model.getLineCount();\n\t\tlet lineNumber = cursor.position.lineNumber;\n\n\t\t// If our current line is blank, move to the next non-blank line\n\t\twhile (lineNumber < lineCount && this._isBlankLine(model, lineNumber)) {\n\t\t\tlineNumber++;\n\t\t}\n\n\t\t// Find the next blank line\n\t\twhile (lineNumber < lineCount && !this._isBlankLine(model, lineNumber)) {\n\t\t\tlineNumber++;\n\t\t}\n\n\t\treturn cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0);\n\t}\n\n\tpublic static moveToBeginningOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\tconst lineNumber = cursor.position.lineNumber;\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tconst firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn;\n\n\t\tlet column: number;\n\n\t\tconst relevantColumnNumber = cursor.position.column;\n\t\tif (relevantColumnNumber === firstNonBlankColumn) {\n\t\t\tcolumn = minColumn;\n\t\t} else {\n\t\t\tcolumn = firstNonBlankColumn;\n\t\t}\n\n\t\treturn cursor.move(inSelectionMode, lineNumber, column, 0);\n\t}\n\n\tpublic static moveToEndOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, sticky: boolean): SingleCursorState {\n\t\tconst lineNumber = cursor.position.lineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\treturn cursor.move(inSelectionMode, lineNumber, maxColumn, sticky ? Constants.MAX_SAFE_SMALL_INTEGER - maxColumn : 0);\n\t}\n\n\tpublic static moveToBeginningOfBuffer(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\treturn cursor.move(inSelectionMode, 1, 1, 0);\n\t}\n\n\tpublic static moveToEndOfBuffer(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\tconst lastLineNumber = model.getLineCount();\n\t\tconst lastColumn = model.getLineMaxColumn(lastLineNumber);\n\n\t\treturn cursor.move(inSelectionMode, lastLineNumber, lastColumn, 0);\n\t}\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 * as strings from 'vs/base/common/strings';\nimport { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';\nimport { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from 'vs/editor/common/config/editorOptions';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/cursorCommon';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration';\nimport { Position } from 'vs/editor/common/core/position';\n\nexport class DeleteOperations {\n\n\tpublic static deleteRight(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, Array<ICommand | null>] {\n\t\tconst commands: Array<ICommand | null> = [];\n\t\tlet shouldPushStackElementBefore = (prevEditOperationType !== EditOperationType.DeletingRight);\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tlet deleteSelection: Range = selection;\n\n\t\t\tif (deleteSelection.isEmpty()) {\n\t\t\t\tconst position = selection.getPosition();\n\t\t\t\tconst rightOfPosition = MoveOperations.right(config, model, position);\n\t\t\t\tdeleteSelection = new Range(\n\t\t\t\t\trightOfPosition.lineNumber,\n\t\t\t\t\trightOfPosition.column,\n\t\t\t\t\tposition.lineNumber,\n\t\t\t\t\tposition.column\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (deleteSelection.isEmpty()) {\n\t\t\t\t// Probably at end of file => ignore\n\t\t\t\tcommands[i] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (deleteSelection.startLineNumber !== deleteSelection.endLineNumber) {\n\t\t\t\tshouldPushStackElementBefore = true;\n\t\t\t}\n\n\t\t\tcommands[i] = new ReplaceCommand(deleteSelection, '');\n\t\t}\n\t\treturn [shouldPushStackElementBefore, commands];\n\t}\n\n\tpublic static isAutoClosingPairDelete(\n\t\tautoClosingDelete: EditorAutoClosingEditStrategy,\n\t\tautoClosingBrackets: EditorAutoClosingStrategy,\n\t\tautoClosingQuotes: EditorAutoClosingStrategy,\n\t\tautoClosingPairsOpen: Map<string, StandardAutoClosingPairConditional[]>,\n\t\tmodel: ICursorSimpleModel,\n\t\tselections: Selection[],\n\t\tautoClosedCharacters: Range[]\n\t): boolean {\n\t\tif (autoClosingBrackets === 'never' && autoClosingQuotes === 'never') {\n\t\t\treturn false;\n\t\t}\n\t\tif (autoClosingDelete === 'never') {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tconst position = selection.getPosition();\n\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst lineText = model.getLineContent(position.lineNumber);\n\t\t\tif (position.column < 2 || position.column >= lineText.length + 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst character = lineText.charAt(position.column - 2);\n\n\t\t\tconst autoClosingPairCandidates = autoClosingPairsOpen.get(character);\n\t\t\tif (!autoClosingPairCandidates) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (isQuote(character)) {\n\t\t\t\tif (autoClosingQuotes === 'never') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (autoClosingBrackets === 'never') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst afterCharacter = lineText.charAt(position.column - 1);\n\n\t\t\tlet foundAutoClosingPair = false;\n\t\t\tfor (const autoClosingPairCandidate of autoClosingPairCandidates) {\n\t\t\t\tif (autoClosingPairCandidate.open === character && autoClosingPairCandidate.close === afterCharacter) {\n\t\t\t\t\tfoundAutoClosingPair = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!foundAutoClosingPair) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Must delete the pair only if it was automatically inserted by the editor\n\t\t\tif (autoClosingDelete === 'auto') {\n\t\t\t\tlet found = false;\n\t\t\t\tfor (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) {\n\t\t\t\t\tconst autoClosedCharacter = autoClosedCharacters[j];\n\t\t\t\t\tif (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate static _runAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, ICommand[]] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst position = selections[i].getPosition();\n\t\t\tconst deleteSelection = new Range(\n\t\t\t\tposition.lineNumber,\n\t\t\t\tposition.column - 1,\n\t\t\t\tposition.lineNumber,\n\t\t\t\tposition.column + 1\n\t\t\t);\n\t\t\tcommands[i] = new ReplaceCommand(deleteSelection, '');\n\t\t}\n\t\treturn [true, commands];\n\t}\n\n\tpublic static deleteLeft(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], autoClosedCharacters: Range[]): [boolean, Array<ICommand | null>] {\n\t\tif (this.isAutoClosingPairDelete(config.autoClosingDelete, config.autoClosingBrackets, config.autoClosingQuotes, config.autoClosingPairs.autoClosingPairsOpenByEnd, model, selections, autoClosedCharacters)) {\n\t\t\treturn this._runAutoClosingPairDelete(config, model, selections);\n\t\t}\n\n\t\tconst commands: Array<ICommand | null> = [];\n\t\tlet shouldPushStackElementBefore = (prevEditOperationType !== EditOperationType.DeletingLeft);\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst deleteRange = DeleteOperations.getDeleteRange(selections[i], model, config);\n\n\t\t\t// Ignore empty delete ranges, as they have no effect\n\t\t\t// They happen if the cursor is at the beginning of the file.\n\t\t\tif (deleteRange.isEmpty()) {\n\t\t\t\tcommands[i] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (deleteRange.startLineNumber !== deleteRange.endLineNumber) {\n\t\t\t\tshouldPushStackElementBefore = true;\n\t\t\t}\n\n\t\t\tcommands[i] = new ReplaceCommand(deleteRange, '');\n\t\t}\n\t\treturn [shouldPushStackElementBefore, commands];\n\n\t}\n\n\tprivate static getDeleteRange(selection: Selection, model: ICursorSimpleModel, config: CursorConfiguration,): Range {\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tconst position = selection.getPosition();\n\n\t\t// Unintend when using tab stops and cursor is within indentation\n\t\tif (config.useTabStops && position.column > 1) {\n\t\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\n\t\t\tconst firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\t\t\tconst lastIndentationColumn = (\n\t\t\t\tfirstNonWhitespaceIndex === -1\n\t\t\t\t\t? /* entire string is whitespace */ lineContent.length + 1\n\t\t\t\t\t: firstNonWhitespaceIndex + 1\n\t\t\t);\n\n\t\t\tif (position.column <= lastIndentationColumn) {\n\t\t\t\tconst fromVisibleColumn = config.visibleColumnFromColumn(model, position);\n\t\t\t\tconst toVisibleColumn = CursorColumns.prevIndentTabStop(fromVisibleColumn, config.indentSize);\n\t\t\t\tconst toColumn = config.columnFromVisibleColumn(model, position.lineNumber, toVisibleColumn);\n\t\t\t\treturn new Range(position.lineNumber, toColumn, position.lineNumber, position.column);\n\t\t\t}\n\t\t}\n\n\t\treturn Range.fromPositions(DeleteOperations.getPositionAfterDeleteLeft(position, model), position);\n\t}\n\n\tprivate static getPositionAfterDeleteLeft(position: Position, model: ICursorSimpleModel): Position {\n\t\tif (position.column > 1) {\n\t\t\t// Convert 1-based columns to 0-based offsets and back.\n\t\t\tconst idx = strings.getLeftDeleteOffset(position.column - 1, model.getLineContent(position.lineNumber));\n\t\t\treturn position.with(undefined, idx + 1);\n\t\t} else if (position.lineNumber > 1) {\n\t\t\tconst newLine = position.lineNumber - 1;\n\t\t\treturn new Position(newLine, model.getLineMaxColumn(newLine));\n\t\t} else {\n\t\t\treturn position;\n\t\t}\n\t}\n\n\tpublic static cut(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): EditOperationResult {\n\t\tconst commands: Array<ICommand | null> = [];\n\t\tlet lastCutRange: Range | null = null;\n\t\tselections.sort((a, b) => Position.compare(a.getStartPosition(), b.getEndPosition()));\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tif (config.emptySelectionClipboard) {\n\t\t\t\t\t// This is a full line cut\n\n\t\t\t\t\tconst position = selection.getPosition();\n\n\t\t\t\t\tlet startLineNumber: number,\n\t\t\t\t\t\tstartColumn: number,\n\t\t\t\t\t\tendLineNumber: number,\n\t\t\t\t\t\tendColumn: number;\n\n\t\t\t\t\tif (position.lineNumber < model.getLineCount()) {\n\t\t\t\t\t\t// Cutting a line in the middle of the model\n\t\t\t\t\t\tstartLineNumber = position.lineNumber;\n\t\t\t\t\t\tstartColumn = 1;\n\t\t\t\t\t\tendLineNumber = position.lineNumber + 1;\n\t\t\t\t\t\tendColumn = 1;\n\t\t\t\t\t} else if (position.lineNumber > 1 && lastCutRange?.endLineNumber !== position.lineNumber) {\n\t\t\t\t\t\t// Cutting the last line & there are more than 1 lines in the model & a previous cut operation does not touch the current cut operation\n\t\t\t\t\t\tstartLineNumber = position.lineNumber - 1;\n\t\t\t\t\t\tstartColumn = model.getLineMaxColumn(position.lineNumber - 1);\n\t\t\t\t\t\tendLineNumber = position.lineNumber;\n\t\t\t\t\t\tendColumn = model.getLineMaxColumn(position.lineNumber);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Cutting the single line that the model contains\n\t\t\t\t\t\tstartLineNumber = position.lineNumber;\n\t\t\t\t\t\tstartColumn = 1;\n\t\t\t\t\t\tendLineNumber = position.lineNumber;\n\t\t\t\t\t\tendColumn = model.getLineMaxColumn(position.lineNumber);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst deleteSelection = new Range(\n\t\t\t\t\t\tstartLineNumber,\n\t\t\t\t\t\tstartColumn,\n\t\t\t\t\t\tendLineNumber,\n\t\t\t\t\t\tendColumn\n\t\t\t\t\t);\n\t\t\t\t\tlastCutRange = deleteSelection;\n\n\t\t\t\t\tif (!deleteSelection.isEmpty()) {\n\t\t\t\t\t\tcommands[i] = new ReplaceCommand(deleteSelection, '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommands[i] = null;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Cannot cut empty selection\n\t\t\t\t\tcommands[i] = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcommands[i] = new ReplaceCommand(selection, '');\n\t\t\t}\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: true\n\t\t});\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from 'vs/editor/common/config/editorOptions';\nimport { CursorConfiguration, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/cursorCommon';\nimport { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations';\nimport { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { AutoClosingPairs } from 'vs/editor/common/languages/languageConfiguration';\n\ninterface IFindWordResult {\n\t/**\n\t * The index where the word starts.\n\t */\n\tstart: number;\n\t/**\n\t * The index where the word ends.\n\t */\n\tend: number;\n\t/**\n\t * The word type.\n\t */\n\twordType: WordType;\n\t/**\n\t * The reason the word ended.\n\t */\n\tnextCharClass: WordCharacterClass;\n}\n\nconst enum WordType {\n\tNone = 0,\n\tRegular = 1,\n\tSeparator = 2\n}\n\nexport const enum WordNavigationType {\n\tWordStart = 0,\n\tWordStartFast = 1,\n\tWordEnd = 2,\n\tWordAccessibility = 3 // Respect chrome definition of a word\n}\n\nexport interface DeleteWordContext {\n\twordSeparators: WordCharacterClassifier;\n\tmodel: ITextModel;\n\tselection: Selection;\n\twhitespaceHeuristics: boolean;\n\tautoClosingDelete: EditorAutoClosingEditStrategy;\n\tautoClosingBrackets: EditorAutoClosingStrategy;\n\tautoClosingQuotes: EditorAutoClosingStrategy;\n\tautoClosingPairs: AutoClosingPairs;\n\tautoClosedCharacters: Range[];\n}\n\nexport class WordOperations {\n\n\tprivate static _createWord(lineContent: string, wordType: WordType, nextCharClass: WordCharacterClass, start: number, end: number): IFindWordResult {\n\t\t// console.log('WORD ==> ' + start + ' => ' + end + ':::: <<<' + lineContent.substring(start, end) + '>>>');\n\t\treturn { start: start, end: end, wordType: wordType, nextCharClass: nextCharClass };\n\t}\n\n\tprivate static _findPreviousWordOnLine(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position): IFindWordResult | null {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\treturn this._doFindPreviousWordOnLine(lineContent, wordSeparators, position);\n\t}\n\n\tprivate static _doFindPreviousWordOnLine(lineContent: string, wordSeparators: WordCharacterClassifier, position: Position): IFindWordResult | null {\n\t\tlet wordType = WordType.None;\n\t\tfor (let chIndex = position.column - 2; chIndex >= 0; chIndex--) {\n\t\t\tconst chCode = lineContent.charCodeAt(chIndex);\n\t\t\tconst chClass = wordSeparators.get(chCode);\n\n\t\t\tif (chClass === WordCharacterClass.Regular) {\n\t\t\t\tif (wordType === WordType.Separator) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1));\n\t\t\t\t}\n\t\t\t\twordType = WordType.Regular;\n\t\t\t} else if (chClass === WordCharacterClass.WordSeparator) {\n\t\t\t\tif (wordType === WordType.Regular) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1));\n\t\t\t\t}\n\t\t\t\twordType = WordType.Separator;\n\t\t\t} else if (chClass === WordCharacterClass.Whitespace) {\n\t\t\t\tif (wordType !== WordType.None) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (wordType !== WordType.None) {\n\t\t\treturn this._createWord(lineContent, wordType, WordCharacterClass.Whitespace, 0, this._findEndOfWord(lineContent, wordSeparators, wordType, 0));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _findEndOfWord(lineContent: string, wordSeparators: WordCharacterClassifier, wordType: WordType, startIndex: number): number {\n\t\tconst len = lineContent.length;\n\t\tfor (let chIndex = startIndex; chIndex < len; chIndex++) {\n\t\t\tconst chCode = lineContent.charCodeAt(chIndex);\n\t\t\tconst chClass = wordSeparators.get(chCode);\n\n\t\t\tif (chClass === WordCharacterClass.Whitespace) {\n\t\t\t\treturn chIndex;\n\t\t\t}\n\t\t\tif (wordType === WordType.Regular && chClass === WordCharacterClass.WordSeparator) {\n\t\t\t\treturn chIndex;\n\t\t\t}\n\t\t\tif (wordType === WordType.Separator && chClass === WordCharacterClass.Regular) {\n\t\t\t\treturn chIndex;\n\t\t\t}\n\t\t}\n\t\treturn len;\n\t}\n\n\tprivate static _findNextWordOnLine(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position): IFindWordResult | null {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\treturn this._doFindNextWordOnLine(lineContent, wordSeparators, position);\n\t}\n\n\tprivate static _doFindNextWordOnLine(lineContent: string, wordSeparators: WordCharacterClassifier, position: Position): IFindWordResult | null {\n\t\tlet wordType = WordType.None;\n\t\tconst len = lineContent.length;\n\n\t\tfor (let chIndex = position.column - 1; chIndex < len; chIndex++) {\n\t\t\tconst chCode = lineContent.charCodeAt(chIndex);\n\t\t\tconst chClass = wordSeparators.get(chCode);\n\n\t\t\tif (chClass === WordCharacterClass.Regular) {\n\t\t\t\tif (wordType === WordType.Separator) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex);\n\t\t\t\t}\n\t\t\t\twordType = WordType.Regular;\n\t\t\t} else if (chClass === WordCharacterClass.WordSeparator) {\n\t\t\t\tif (wordType === WordType.Regular) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex);\n\t\t\t\t}\n\t\t\t\twordType = WordType.Separator;\n\t\t\t} else if (chClass === WordCharacterClass.Whitespace) {\n\t\t\t\tif (wordType !== WordType.None) {\n\t\t\t\t\treturn this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (wordType !== WordType.None) {\n\t\t\treturn this._createWord(lineContent, wordType, WordCharacterClass.Whitespace, this._findStartOfWord(lineContent, wordSeparators, wordType, len - 1), len);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _findStartOfWord(lineContent: string, wordSeparators: WordCharacterClassifier, wordType: WordType, startIndex: number): number {\n\t\tfor (let chIndex = startIndex; chIndex >= 0; chIndex--) {\n\t\t\tconst chCode = lineContent.charCodeAt(chIndex);\n\t\t\tconst chClass = wordSeparators.get(chCode);\n\n\t\t\tif (chClass === WordCharacterClass.Whitespace) {\n\t\t\t\treturn chIndex + 1;\n\t\t\t}\n\t\t\tif (wordType === WordType.Regular && chClass === WordCharacterClass.WordSeparator) {\n\t\t\t\treturn chIndex + 1;\n\t\t\t}\n\t\t\tif (wordType === WordType.Separator && chClass === WordCharacterClass.Regular) {\n\t\t\t\treturn chIndex + 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic static moveWordLeft(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\tlet lineNumber = position.lineNumber;\n\t\tlet column = position.column;\n\n\t\tif (column === 1) {\n\t\t\tif (lineNumber > 1) {\n\t\t\t\tlineNumber = lineNumber - 1;\n\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t}\n\t\t}\n\n\t\tlet prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, column));\n\n\t\tif (wordNavigationType === WordNavigationType.WordStart) {\n\t\t\treturn new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1);\n\t\t}\n\n\t\tif (wordNavigationType === WordNavigationType.WordStartFast) {\n\t\t\tif (\n\t\t\t\tprevWordOnLine\n\t\t\t\t&& prevWordOnLine.wordType === WordType.Separator\n\t\t\t\t&& prevWordOnLine.end - prevWordOnLine.start === 1\n\t\t\t\t&& prevWordOnLine.nextCharClass === WordCharacterClass.Regular\n\t\t\t) {\n\t\t\t\t// Skip over a word made up of one single separator and followed by a regular character\n\t\t\t\tprevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1));\n\t\t\t}\n\n\t\t\treturn new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1);\n\t\t}\n\n\t\tif (wordNavigationType === WordNavigationType.WordAccessibility) {\n\t\t\twhile (\n\t\t\t\tprevWordOnLine\n\t\t\t\t&& prevWordOnLine.wordType === WordType.Separator\n\t\t\t) {\n\t\t\t\t// Skip over words made up of only separators\n\t\t\t\tprevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1));\n\t\t\t}\n\n\t\t\treturn new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1);\n\t\t}\n\n\t\t// We are stopping at the ending of words\n\n\t\tif (prevWordOnLine && column <= prevWordOnLine.end + 1) {\n\t\t\tprevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1));\n\t\t}\n\n\t\treturn new Position(lineNumber, prevWordOnLine ? prevWordOnLine.end + 1 : 1);\n\t}\n\n\tpublic static _moveWordPartLeft(model: ICursorSimpleModel, position: Position): Position {\n\t\tconst lineNumber = position.lineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\n\t\tif (position.column === 1) {\n\t\t\treturn (lineNumber > 1 ? new Position(lineNumber - 1, model.getLineMaxColumn(lineNumber - 1)) : position);\n\t\t}\n\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tfor (let column = position.column - 1; column > 1; column--) {\n\t\t\tconst left = lineContent.charCodeAt(column - 2);\n\t\t\tconst right = lineContent.charCodeAt(column - 1);\n\n\t\t\tif (left === CharCode.Underline && right !== CharCode.Underline) {\n\t\t\t\t// snake_case_variables\n\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t}\n\n\t\t\tif (strings.isLowerAsciiLetter(left) && strings.isUpperAsciiLetter(right)) {\n\t\t\t\t// camelCaseVariables\n\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t}\n\n\t\t\tif (strings.isUpperAsciiLetter(left) && strings.isUpperAsciiLetter(right)) {\n\t\t\t\t// thisIsACamelCaseWithOneLetterWords\n\t\t\t\tif (column + 1 < maxColumn) {\n\t\t\t\t\tconst rightRight = lineContent.charCodeAt(column);\n\t\t\t\t\tif (strings.isLowerAsciiLetter(rightRight)) {\n\t\t\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Position(lineNumber, 1);\n\t}\n\n\tpublic static moveWordRight(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\tlet lineNumber = position.lineNumber;\n\t\tlet column = position.column;\n\n\t\tlet movedDown = false;\n\t\tif (column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber < model.getLineCount()) {\n\t\t\t\tmovedDown = true;\n\t\t\t\tlineNumber = lineNumber + 1;\n\t\t\t\tcolumn = 1;\n\t\t\t}\n\t\t}\n\n\t\tlet nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, column));\n\n\t\tif (wordNavigationType === WordNavigationType.WordEnd) {\n\t\t\tif (nextWordOnLine && nextWordOnLine.wordType === WordType.Separator) {\n\t\t\t\tif (nextWordOnLine.end - nextWordOnLine.start === 1 && nextWordOnLine.nextCharClass === WordCharacterClass.Regular) {\n\t\t\t\t\t// Skip over a word made up of one single separator and followed by a regular character\n\t\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nextWordOnLine) {\n\t\t\t\tcolumn = nextWordOnLine.end + 1;\n\t\t\t} else {\n\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t}\n\t\t} else if (wordNavigationType === WordNavigationType.WordAccessibility) {\n\t\t\tif (movedDown) {\n\t\t\t\t// If we move to the next line, pretend that the cursor is right before the first character.\n\t\t\t\t// This is needed when the first word starts right at the first character - and in order not to miss it,\n\t\t\t\t// we need to start before.\n\t\t\t\tcolumn = 0;\n\t\t\t}\n\n\t\t\twhile (\n\t\t\t\tnextWordOnLine\n\t\t\t\t&& (nextWordOnLine.wordType === WordType.Separator\n\t\t\t\t\t|| nextWordOnLine.start + 1 <= column\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// Skip over a word made up of one single separator\n\t\t\t\t// Also skip over word if it begins before current cursor position to ascertain we're moving forward at least 1 character.\n\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1));\n\t\t\t}\n\n\t\t\tif (nextWordOnLine) {\n\t\t\t\tcolumn = nextWordOnLine.start + 1;\n\t\t\t} else {\n\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t}\n\t\t} else {\n\t\t\tif (nextWordOnLine && !movedDown && column >= nextWordOnLine.start + 1) {\n\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1));\n\t\t\t}\n\t\t\tif (nextWordOnLine) {\n\t\t\t\tcolumn = nextWordOnLine.start + 1;\n\t\t\t} else {\n\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t}\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tpublic static _moveWordPartRight(model: ICursorSimpleModel, position: Position): Position {\n\t\tconst lineNumber = position.lineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\n\t\tif (position.column === maxColumn) {\n\t\t\treturn (lineNumber < model.getLineCount() ? new Position(lineNumber + 1, 1) : position);\n\t\t}\n\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tfor (let column = position.column + 1; column < maxColumn; column++) {\n\t\t\tconst left = lineContent.charCodeAt(column - 2);\n\t\t\tconst right = lineContent.charCodeAt(column - 1);\n\n\t\t\tif (left !== CharCode.Underline && right === CharCode.Underline) {\n\t\t\t\t// snake_case_variables\n\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t}\n\n\t\t\tif (strings.isLowerAsciiLetter(left) && strings.isUpperAsciiLetter(right)) {\n\t\t\t\t// camelCaseVariables\n\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t}\n\n\t\t\tif (strings.isUpperAsciiLetter(left) && strings.isUpperAsciiLetter(right)) {\n\t\t\t\t// thisIsACamelCaseWithOneLetterWords\n\t\t\t\tif (column + 1 < maxColumn) {\n\t\t\t\t\tconst rightRight = lineContent.charCodeAt(column);\n\t\t\t\t\tif (strings.isLowerAsciiLetter(rightRight)) {\n\t\t\t\t\t\treturn new Position(lineNumber, column);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Position(lineNumber, maxColumn);\n\t}\n\n\tprotected static _deleteWordLeftWhitespace(model: ICursorSimpleModel, position: Position): Range | null {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\tconst startIndex = position.column - 2;\n\t\tconst lastNonWhitespace = strings.lastNonWhitespaceIndex(lineContent, startIndex);\n\t\tif (lastNonWhitespace + 1 < startIndex) {\n\t\t\treturn new Range(position.lineNumber, lastNonWhitespace + 2, position.lineNumber, position.column);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static deleteWordLeft(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range | null {\n\t\tconst wordSeparators = ctx.wordSeparators;\n\t\tconst model = ctx.model;\n\t\tconst selection = ctx.selection;\n\t\tconst whitespaceHeuristics = ctx.whitespaceHeuristics;\n\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tif (DeleteOperations.isAutoClosingPairDelete(ctx.autoClosingDelete, ctx.autoClosingBrackets, ctx.autoClosingQuotes, ctx.autoClosingPairs.autoClosingPairsOpenByEnd, ctx.model, [ctx.selection], ctx.autoClosedCharacters)) {\n\t\t\tconst position = ctx.selection.getPosition();\n\t\t\treturn new Range(position.lineNumber, position.column - 1, position.lineNumber, position.column + 1);\n\t\t}\n\n\t\tconst position = new Position(selection.positionLineNumber, selection.positionColumn);\n\n\t\tlet lineNumber = position.lineNumber;\n\t\tlet column = position.column;\n\n\t\tif (lineNumber === 1 && column === 1) {\n\t\t\t// Ignore deleting at beginning of file\n\t\t\treturn null;\n\t\t}\n\n\t\tif (whitespaceHeuristics) {\n\t\t\tconst r = this._deleteWordLeftWhitespace(model, position);\n\t\t\tif (r) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\tlet prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, position);\n\n\t\tif (wordNavigationType === WordNavigationType.WordStart) {\n\t\t\tif (prevWordOnLine) {\n\t\t\t\tcolumn = prevWordOnLine.start + 1;\n\t\t\t} else {\n\t\t\t\tif (column > 1) {\n\t\t\t\t\tcolumn = 1;\n\t\t\t\t} else {\n\t\t\t\t\tlineNumber--;\n\t\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (prevWordOnLine && column <= prevWordOnLine.end + 1) {\n\t\t\t\tprevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1));\n\t\t\t}\n\t\t\tif (prevWordOnLine) {\n\t\t\t\tcolumn = prevWordOnLine.end + 1;\n\t\t\t} else {\n\t\t\t\tif (column > 1) {\n\t\t\t\t\tcolumn = 1;\n\t\t\t\t} else {\n\t\t\t\t\tlineNumber--;\n\t\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(lineNumber, column, position.lineNumber, position.column);\n\t}\n\n\tpublic static deleteInsideWord(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection): Range {\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tconst position = new Position(selection.positionLineNumber, selection.positionColumn);\n\n\t\tconst r = this._deleteInsideWordWhitespace(model, position);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\n\t\treturn this._deleteInsideWordDetermineDeleteRange(wordSeparators, model, position);\n\t}\n\n\tprivate static _charAtIsWhitespace(str: string, index: number): boolean {\n\t\tconst charCode = str.charCodeAt(index);\n\t\treturn (charCode === CharCode.Space || charCode === CharCode.Tab);\n\t}\n\n\tprivate static _deleteInsideWordWhitespace(model: ICursorSimpleModel, position: Position): Range | null {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\tconst lineContentLength = lineContent.length;\n\n\t\tif (lineContentLength === 0) {\n\t\t\t// empty line\n\t\t\treturn null;\n\t\t}\n\n\t\tlet leftIndex = Math.max(position.column - 2, 0);\n\t\tif (!this._charAtIsWhitespace(lineContent, leftIndex)) {\n\t\t\t// touches a non-whitespace character to the left\n\t\t\treturn null;\n\t\t}\n\n\t\tlet rightIndex = Math.min(position.column - 1, lineContentLength - 1);\n\t\tif (!this._charAtIsWhitespace(lineContent, rightIndex)) {\n\t\t\t// touches a non-whitespace character to the right\n\t\t\treturn null;\n\t\t}\n\n\t\t// walk over whitespace to the left\n\t\twhile (leftIndex > 0 && this._charAtIsWhitespace(lineContent, leftIndex - 1)) {\n\t\t\tleftIndex--;\n\t\t}\n\n\t\t// walk over whitespace to the right\n\t\twhile (rightIndex + 1 < lineContentLength && this._charAtIsWhitespace(lineContent, rightIndex + 1)) {\n\t\t\trightIndex++;\n\t\t}\n\n\t\treturn new Range(position.lineNumber, leftIndex + 1, position.lineNumber, rightIndex + 2);\n\t}\n\n\tprivate static _deleteInsideWordDetermineDeleteRange(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position): Range {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\tconst lineLength = lineContent.length;\n\t\tif (lineLength === 0) {\n\t\t\t// empty line\n\t\t\tif (position.lineNumber > 1) {\n\t\t\t\treturn new Range(position.lineNumber - 1, model.getLineMaxColumn(position.lineNumber - 1), position.lineNumber, 1);\n\t\t\t} else {\n\t\t\t\tif (position.lineNumber < model.getLineCount()) {\n\t\t\t\t\treturn new Range(position.lineNumber, 1, position.lineNumber + 1, 1);\n\t\t\t\t} else {\n\t\t\t\t\t// empty model\n\t\t\t\t\treturn new Range(position.lineNumber, 1, position.lineNumber, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst touchesWord = (word: IFindWordResult) => {\n\t\t\treturn (word.start + 1 <= position.column && position.column <= word.end + 1);\n\t\t};\n\t\tconst createRangeWithPosition = (startColumn: number, endColumn: number) => {\n\t\t\tstartColumn = Math.min(startColumn, position.column);\n\t\t\tendColumn = Math.max(endColumn, position.column);\n\t\t\treturn new Range(position.lineNumber, startColumn, position.lineNumber, endColumn);\n\t\t};\n\t\tconst deleteWordAndAdjacentWhitespace = (word: IFindWordResult) => {\n\t\t\tlet startColumn = word.start + 1;\n\t\t\tlet endColumn = word.end + 1;\n\t\t\tlet expandedToTheRight = false;\n\t\t\twhile (endColumn - 1 < lineLength && this._charAtIsWhitespace(lineContent, endColumn - 1)) {\n\t\t\t\texpandedToTheRight = true;\n\t\t\t\tendColumn++;\n\t\t\t}\n\t\t\tif (!expandedToTheRight) {\n\t\t\t\twhile (startColumn > 1 && this._charAtIsWhitespace(lineContent, startColumn - 2)) {\n\t\t\t\t\tstartColumn--;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn createRangeWithPosition(startColumn, endColumn);\n\t\t};\n\n\t\tconst prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, position);\n\t\tif (prevWordOnLine && touchesWord(prevWordOnLine)) {\n\t\t\treturn deleteWordAndAdjacentWhitespace(prevWordOnLine);\n\t\t}\n\t\tconst nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, position);\n\t\tif (nextWordOnLine && touchesWord(nextWordOnLine)) {\n\t\t\treturn deleteWordAndAdjacentWhitespace(nextWordOnLine);\n\t\t}\n\t\tif (prevWordOnLine && nextWordOnLine) {\n\t\t\treturn createRangeWithPosition(prevWordOnLine.end + 1, nextWordOnLine.start + 1);\n\t\t}\n\t\tif (prevWordOnLine) {\n\t\t\treturn createRangeWithPosition(prevWordOnLine.start + 1, prevWordOnLine.end + 1);\n\t\t}\n\t\tif (nextWordOnLine) {\n\t\t\treturn createRangeWithPosition(nextWordOnLine.start + 1, nextWordOnLine.end + 1);\n\t\t}\n\n\t\treturn createRangeWithPosition(1, lineLength + 1);\n\t}\n\n\tpublic static _deleteWordPartLeft(model: ICursorSimpleModel, selection: Selection): Range {\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tconst pos = selection.getPosition();\n\t\tconst toPosition = WordOperations._moveWordPartLeft(model, pos);\n\t\treturn new Range(pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column);\n\t}\n\n\tprivate static _findFirstNonWhitespaceChar(str: string, startIndex: number): number {\n\t\tconst len = str.length;\n\t\tfor (let chIndex = startIndex; chIndex < len; chIndex++) {\n\t\t\tconst ch = str.charAt(chIndex);\n\t\t\tif (ch !== ' ' && ch !== '\\t') {\n\t\t\t\treturn chIndex;\n\t\t\t}\n\t\t}\n\t\treturn len;\n\t}\n\n\tprotected static _deleteWordRightWhitespace(model: ICursorSimpleModel, position: Position): Range | null {\n\t\tconst lineContent = model.getLineContent(position.lineNumber);\n\t\tconst startIndex = position.column - 1;\n\t\tconst firstNonWhitespace = this._findFirstNonWhitespaceChar(lineContent, startIndex);\n\t\tif (startIndex + 1 < firstNonWhitespace) {\n\t\t\t// bingo\n\t\t\treturn new Range(position.lineNumber, position.column, position.lineNumber, firstNonWhitespace + 1);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static deleteWordRight(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range | null {\n\t\tconst wordSeparators = ctx.wordSeparators;\n\t\tconst model = ctx.model;\n\t\tconst selection = ctx.selection;\n\t\tconst whitespaceHeuristics = ctx.whitespaceHeuristics;\n\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tconst position = new Position(selection.positionLineNumber, selection.positionColumn);\n\n\t\tlet lineNumber = position.lineNumber;\n\t\tlet column = position.column;\n\n\t\tconst lineCount = model.getLineCount();\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (lineNumber === lineCount && column === maxColumn) {\n\t\t\t// Ignore deleting at end of file\n\t\t\treturn null;\n\t\t}\n\n\t\tif (whitespaceHeuristics) {\n\t\t\tconst r = this._deleteWordRightWhitespace(model, position);\n\t\t\tif (r) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\tlet nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, position);\n\n\t\tif (wordNavigationType === WordNavigationType.WordEnd) {\n\t\t\tif (nextWordOnLine) {\n\t\t\t\tcolumn = nextWordOnLine.end + 1;\n\t\t\t} else {\n\t\t\t\tif (column < maxColumn || lineNumber === lineCount) {\n\t\t\t\t\tcolumn = maxColumn;\n\t\t\t\t} else {\n\t\t\t\t\tlineNumber++;\n\t\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, 1));\n\t\t\t\t\tif (nextWordOnLine) {\n\t\t\t\t\t\tcolumn = nextWordOnLine.start + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (nextWordOnLine && column >= nextWordOnLine.start + 1) {\n\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1));\n\t\t\t}\n\t\t\tif (nextWordOnLine) {\n\t\t\t\tcolumn = nextWordOnLine.start + 1;\n\t\t\t} else {\n\t\t\t\tif (column < maxColumn || lineNumber === lineCount) {\n\t\t\t\t\tcolumn = maxColumn;\n\t\t\t\t} else {\n\t\t\t\t\tlineNumber++;\n\t\t\t\t\tnextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, 1));\n\t\t\t\t\tif (nextWordOnLine) {\n\t\t\t\t\t\tcolumn = nextWordOnLine.start + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(lineNumber, column, position.lineNumber, position.column);\n\t}\n\n\tpublic static _deleteWordPartRight(model: ICursorSimpleModel, selection: Selection): Range {\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tconst pos = selection.getPosition();\n\t\tconst toPosition = WordOperations._moveWordPartRight(model, pos);\n\t\treturn new Range(pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column);\n\t}\n\n\tprivate static _createWordAtPosition(model: ITextModel, lineNumber: number, word: IFindWordResult): IWordAtPosition {\n\t\tconst range = new Range(lineNumber, word.start + 1, lineNumber, word.end + 1);\n\t\treturn {\n\t\t\tword: model.getValueInRange(range),\n\t\t\tstartColumn: range.startColumn,\n\t\t\tendColumn: range.endColumn\n\t\t};\n\t}\n\n\tpublic static getWordAtPosition(model: ITextModel, _wordSeparators: string, position: Position): IWordAtPosition | null {\n\t\tconst wordSeparators = getMapForWordSeparators(_wordSeparators);\n\t\tconst prevWord = WordOperations._findPreviousWordOnLine(wordSeparators, model, position);\n\t\tif (prevWord && prevWord.wordType === WordType.Regular && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) {\n\t\t\treturn WordOperations._createWordAtPosition(model, position.lineNumber, prevWord);\n\t\t}\n\t\tconst nextWord = WordOperations._findNextWordOnLine(wordSeparators, model, position);\n\t\tif (nextWord && nextWord.wordType === WordType.Regular && nextWord.start <= position.column - 1 && position.column - 1 <= nextWord.end) {\n\t\t\treturn WordOperations._createWordAtPosition(model, position.lineNumber, nextWord);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static word(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, position: Position): SingleCursorState {\n\t\tconst wordSeparators = getMapForWordSeparators(config.wordSeparators);\n\t\tconst prevWord = WordOperations._findPreviousWordOnLine(wordSeparators, model, position);\n\t\tconst nextWord = WordOperations._findNextWordOnLine(wordSeparators, model, position);\n\n\t\tif (!inSelectionMode) {\n\t\t\t// Entering word selection for the first time\n\t\t\tlet startColumn: number;\n\t\t\tlet endColumn: number;\n\n\t\t\tif (prevWord && prevWord.wordType === WordType.Regular && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) {\n\t\t\t\t// isTouchingPrevWord\n\t\t\t\tstartColumn = prevWord.start + 1;\n\t\t\t\tendColumn = prevWord.end + 1;\n\t\t\t} else if (nextWord && nextWord.wordType === WordType.Regular && nextWord.start <= position.column - 1 && position.column - 1 <= nextWord.end) {\n\t\t\t\t// isTouchingNextWord\n\t\t\t\tstartColumn = nextWord.start + 1;\n\t\t\t\tendColumn = nextWord.end + 1;\n\t\t\t} else {\n\t\t\t\tif (prevWord) {\n\t\t\t\t\tstartColumn = prevWord.end + 1;\n\t\t\t\t} else {\n\t\t\t\t\tstartColumn = 1;\n\t\t\t\t}\n\t\t\t\tif (nextWord) {\n\t\t\t\t\tendColumn = nextWord.start + 1;\n\t\t\t\t} else {\n\t\t\t\t\tendColumn = model.getLineMaxColumn(position.lineNumber);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(position.lineNumber, startColumn, position.lineNumber, endColumn), 0,\n\t\t\t\tnew Position(position.lineNumber, endColumn), 0\n\t\t\t);\n\t\t}\n\n\t\tlet startColumn: number;\n\t\tlet endColumn: number;\n\n\t\tif (prevWord && prevWord.wordType === WordType.Regular && prevWord.start < position.column - 1 && position.column - 1 < prevWord.end) {\n\t\t\t// isInsidePrevWord\n\t\t\tstartColumn = prevWord.start + 1;\n\t\t\tendColumn = prevWord.end + 1;\n\t\t} else if (nextWord && nextWord.wordType === WordType.Regular && nextWord.start < position.column - 1 && position.column - 1 < nextWord.end) {\n\t\t\t// isInsideNextWord\n\t\t\tstartColumn = nextWord.start + 1;\n\t\t\tendColumn = nextWord.end + 1;\n\t\t} else {\n\t\t\tstartColumn = position.column;\n\t\t\tendColumn = position.column;\n\t\t}\n\n\t\tconst lineNumber = position.lineNumber;\n\t\tlet column: number;\n\t\tif (cursor.selectionStart.containsPosition(position)) {\n\t\t\tcolumn = cursor.selectionStart.endColumn;\n\t\t} else if (position.isBeforeOrEqual(cursor.selectionStart.getStartPosition())) {\n\t\t\tcolumn = startColumn;\n\t\t\tconst possiblePosition = new Position(lineNumber, column);\n\t\t\tif (cursor.selectionStart.containsPosition(possiblePosition)) {\n\t\t\t\tcolumn = cursor.selectionStart.endColumn;\n\t\t\t}\n\t\t} else {\n\t\t\tcolumn = endColumn;\n\t\t\tconst possiblePosition = new Position(lineNumber, column);\n\t\t\tif (cursor.selectionStart.containsPosition(possiblePosition)) {\n\t\t\t\tcolumn = cursor.selectionStart.startColumn;\n\t\t\t}\n\t\t}\n\n\t\treturn cursor.move(true, lineNumber, column, 0);\n\t}\n}\n\nexport class WordPartOperations extends WordOperations {\n\tpublic static deleteWordPartLeft(ctx: DeleteWordContext): Range {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.deleteWordLeft(ctx, WordNavigationType.WordStart),\n\t\t\tWordOperations.deleteWordLeft(ctx, WordNavigationType.WordEnd),\n\t\t\tWordOperations._deleteWordPartLeft(ctx.model, ctx.selection)\n\t\t]);\n\t\tcandidates.sort(Range.compareRangesUsingEnds);\n\t\treturn candidates[2];\n\t}\n\n\tpublic static deleteWordPartRight(ctx: DeleteWordContext): Range {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.deleteWordRight(ctx, WordNavigationType.WordStart),\n\t\t\tWordOperations.deleteWordRight(ctx, WordNavigationType.WordEnd),\n\t\t\tWordOperations._deleteWordPartRight(ctx.model, ctx.selection)\n\t\t]);\n\t\tcandidates.sort(Range.compareRangesUsingStarts);\n\t\treturn candidates[0];\n\t}\n\n\tpublic static moveWordPartLeft(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position): Position {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.moveWordLeft(wordSeparators, model, position, WordNavigationType.WordStart),\n\t\t\tWordOperations.moveWordLeft(wordSeparators, model, position, WordNavigationType.WordEnd),\n\t\t\tWordOperations._moveWordPartLeft(model, position)\n\t\t]);\n\t\tcandidates.sort(Position.compare);\n\t\treturn candidates[2];\n\t}\n\n\tpublic static moveWordPartRight(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position): Position {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.moveWordRight(wordSeparators, model, position, WordNavigationType.WordStart),\n\t\t\tWordOperations.moveWordRight(wordSeparators, model, position, WordNavigationType.WordEnd),\n\t\t\tWordOperations._moveWordPartRight(model, position)\n\t\t]);\n\t\tcandidates.sort(Position.compare);\n\t\treturn candidates[0];\n\t}\n}\n\nfunction enforceDefined<T>(arr: Array<T | undefined | null>): T[] {\n\treturn <T[]>arr.filter(el => Boolean(el));\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 * as types from 'vs/base/common/types';\nimport { CursorState, ICursorSimpleModel, PartialCursorState, SingleCursorState } from 'vs/editor/common/cursorCommon';\nimport { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations';\nimport { WordOperations } from 'vs/editor/common/cursor/cursorWordOperations';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';\nimport { IViewModel } from 'vs/editor/common/viewModel';\n\nexport class CursorMoveCommands {\n\n\tpublic static addCursorDown(viewModel: IViewModel, cursors: CursorState[], useLogicalLine: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tlet resultLen = 0;\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[resultLen++] = new CursorState(cursor.modelState, cursor.viewState);\n\t\t\tif (useLogicalLine) {\n\t\t\t\tresult[resultLen++] = CursorState.fromModelState(MoveOperations.translateDown(viewModel.cursorConfig, viewModel.model, cursor.modelState));\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = CursorState.fromViewState(MoveOperations.translateDown(viewModel.cursorConfig, viewModel, cursor.viewState));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static addCursorUp(viewModel: IViewModel, cursors: CursorState[], useLogicalLine: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tlet resultLen = 0;\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[resultLen++] = new CursorState(cursor.modelState, cursor.viewState);\n\t\t\tif (useLogicalLine) {\n\t\t\t\tresult[resultLen++] = CursorState.fromModelState(MoveOperations.translateUp(viewModel.cursorConfig, viewModel.model, cursor.modelState));\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = CursorState.fromViewState(MoveOperations.translateUp(viewModel.cursorConfig, viewModel, cursor.viewState));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static moveToBeginningOfLine(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tlet result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = this._moveToLineStart(viewModel, cursor, inSelectionMode);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _moveToLineStart(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\tconst currentViewStateColumn = cursor.viewState.position.column;\n\t\tconst currentModelStateColumn = cursor.modelState.position.column;\n\t\tconst isFirstLineOfWrappedLine = currentViewStateColumn === currentModelStateColumn;\n\n\t\tconst currentViewStatelineNumber = cursor.viewState.position.lineNumber;\n\t\tconst firstNonBlankColumn = viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber);\n\t\tconst isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn;\n\n\t\tif (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) {\n\t\t\treturn this._moveToLineStartByView(viewModel, cursor, inSelectionMode);\n\t\t} else {\n\t\t\treturn this._moveToLineStartByModel(viewModel, cursor, inSelectionMode);\n\t\t}\n\t}\n\n\tprivate static _moveToLineStartByView(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromViewState(\n\t\t\tMoveOperations.moveToBeginningOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode)\n\t\t);\n\t}\n\n\tprivate static _moveToLineStartByModel(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromModelState(\n\t\t\tMoveOperations.moveToBeginningOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)\n\t\t);\n\t}\n\n\tpublic static moveToEndOfLine(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, sticky: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = this._moveToLineEnd(viewModel, cursor, inSelectionMode, sticky);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _moveToLineEnd(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, sticky: boolean): PartialCursorState {\n\t\tconst viewStatePosition = cursor.viewState.position;\n\t\tconst viewModelMaxColumn = viewModel.getLineMaxColumn(viewStatePosition.lineNumber);\n\t\tconst isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn;\n\n\t\tconst modelStatePosition = cursor.modelState.position;\n\t\tconst modelMaxColumn = viewModel.model.getLineMaxColumn(modelStatePosition.lineNumber);\n\t\tconst isEndLineOfWrappedLine = viewModelMaxColumn - viewStatePosition.column === modelMaxColumn - modelStatePosition.column;\n\n\t\tif (isEndOfViewLine || isEndLineOfWrappedLine) {\n\t\t\treturn this._moveToLineEndByModel(viewModel, cursor, inSelectionMode, sticky);\n\t\t} else {\n\t\t\treturn this._moveToLineEndByView(viewModel, cursor, inSelectionMode, sticky);\n\t\t}\n\t}\n\n\tprivate static _moveToLineEndByView(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, sticky: boolean): PartialCursorState {\n\t\treturn CursorState.fromViewState(\n\t\t\tMoveOperations.moveToEndOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, sticky)\n\t\t);\n\t}\n\n\tprivate static _moveToLineEndByModel(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, sticky: boolean): PartialCursorState {\n\t\treturn CursorState.fromModelState(\n\t\t\tMoveOperations.moveToEndOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, sticky)\n\t\t);\n\t}\n\n\tpublic static expandLineSelection(viewModel: IViewModel, cursors: CursorState[]): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\n\t\t\tconst startLineNumber = cursor.modelState.selection.startLineNumber;\n\t\t\tconst lineCount = viewModel.model.getLineCount();\n\n\t\t\tlet endLineNumber = cursor.modelState.selection.endLineNumber;\n\t\t\tlet endColumn: number;\n\t\t\tif (endLineNumber === lineCount) {\n\t\t\t\tendColumn = viewModel.model.getLineMaxColumn(lineCount);\n\t\t\t} else {\n\t\t\t\tendLineNumber++;\n\t\t\t\tendColumn = 1;\n\t\t\t}\n\n\t\t\tresult[i] = CursorState.fromModelState(new SingleCursorState(\n\t\t\t\tnew Range(startLineNumber, 1, startLineNumber, 1), 0,\n\t\t\t\tnew Position(endLineNumber, endColumn), 0\n\t\t\t));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static moveToBeginningOfBuffer(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromModelState(MoveOperations.moveToBeginningOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static moveToEndOfBuffer(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromModelState(MoveOperations.moveToEndOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static selectAll(viewModel: IViewModel, cursor: CursorState): PartialCursorState {\n\t\tconst lineCount = viewModel.model.getLineCount();\n\t\tconst maxColumn = viewModel.model.getLineMaxColumn(lineCount);\n\n\t\treturn CursorState.fromModelState(new SingleCursorState(\n\t\t\tnew Range(1, 1, 1, 1), 0,\n\t\t\tnew Position(lineCount, maxColumn), 0\n\t\t));\n\t}\n\n\tpublic static line(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, _position: IPosition, _viewPosition: IPosition): PartialCursorState {\n\t\tconst position = viewModel.model.validatePosition(_position);\n\t\tconst viewPosition = (\n\t\t\t_viewPosition\n\t\t\t\t? viewModel.coordinatesConverter.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position)\n\t\t\t\t: viewModel.coordinatesConverter.convertModelPositionToViewPosition(position)\n\t\t);\n\n\t\tif (!inSelectionMode || !cursor.modelState.hasSelection()) {\n\t\t\t// Entering line selection for the first time\n\t\t\tconst lineCount = viewModel.model.getLineCount();\n\n\t\t\tlet selectToLineNumber = position.lineNumber + 1;\n\t\t\tlet selectToColumn = 1;\n\t\t\tif (selectToLineNumber > lineCount) {\n\t\t\t\tselectToLineNumber = lineCount;\n\t\t\t\tselectToColumn = viewModel.model.getLineMaxColumn(selectToLineNumber);\n\t\t\t}\n\n\t\t\treturn CursorState.fromModelState(new SingleCursorState(\n\t\t\t\tnew Range(position.lineNumber, 1, selectToLineNumber, selectToColumn), 0,\n\t\t\t\tnew Position(selectToLineNumber, selectToColumn), 0\n\t\t\t));\n\t\t}\n\n\t\t// Continuing line selection\n\t\tconst enteringLineNumber = cursor.modelState.selectionStart.getStartPosition().lineNumber;\n\n\t\tif (position.lineNumber < enteringLineNumber) {\n\n\t\t\treturn CursorState.fromViewState(cursor.viewState.move(\n\t\t\t\tcursor.modelState.hasSelection(), viewPosition.lineNumber, 1, 0\n\t\t\t));\n\n\t\t} else if (position.lineNumber > enteringLineNumber) {\n\n\t\t\tconst lineCount = viewModel.getLineCount();\n\n\t\t\tlet selectToViewLineNumber = viewPosition.lineNumber + 1;\n\t\t\tlet selectToViewColumn = 1;\n\t\t\tif (selectToViewLineNumber > lineCount) {\n\t\t\t\tselectToViewLineNumber = lineCount;\n\t\t\t\tselectToViewColumn = viewModel.getLineMaxColumn(selectToViewLineNumber);\n\t\t\t}\n\n\t\t\treturn CursorState.fromViewState(cursor.viewState.move(\n\t\t\t\tcursor.modelState.hasSelection(), selectToViewLineNumber, selectToViewColumn, 0\n\t\t\t));\n\n\t\t} else {\n\n\t\t\tconst endPositionOfSelectionStart = cursor.modelState.selectionStart.getEndPosition();\n\t\t\treturn CursorState.fromModelState(cursor.modelState.move(\n\t\t\t\tcursor.modelState.hasSelection(), endPositionOfSelectionStart.lineNumber, endPositionOfSelectionStart.column, 0\n\t\t\t));\n\n\t\t}\n\t}\n\n\tpublic static word(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, _position: IPosition): PartialCursorState {\n\t\tconst position = viewModel.model.validatePosition(_position);\n\t\treturn CursorState.fromModelState(WordOperations.word(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, position));\n\t}\n\n\tpublic static cancelSelection(viewModel: IViewModel, cursor: CursorState): PartialCursorState {\n\t\tif (!cursor.modelState.hasSelection()) {\n\t\t\treturn new CursorState(cursor.modelState, cursor.viewState);\n\t\t}\n\n\t\tconst lineNumber = cursor.viewState.position.lineNumber;\n\t\tconst column = cursor.viewState.position.column;\n\n\t\treturn CursorState.fromViewState(new SingleCursorState(\n\t\t\tnew Range(lineNumber, column, lineNumber, column), 0,\n\t\t\tnew Position(lineNumber, column), 0\n\t\t));\n\t}\n\n\tpublic static moveTo(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, _position: IPosition, _viewPosition: IPosition): PartialCursorState {\n\t\tconst position = viewModel.model.validatePosition(_position);\n\t\tconst viewPosition = (\n\t\t\t_viewPosition\n\t\t\t\t? viewModel.coordinatesConverter.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position)\n\t\t\t\t: viewModel.coordinatesConverter.convertModelPositionToViewPosition(position)\n\t\t);\n\t\treturn CursorState.fromViewState(cursor.viewState.move(inSelectionMode, viewPosition.lineNumber, viewPosition.column, 0));\n\t}\n\n\tpublic static simpleMove(viewModel: IViewModel, cursors: CursorState[], direction: CursorMove.SimpleMoveDirection, inSelectionMode: boolean, value: number, unit: CursorMove.Unit): PartialCursorState[] | null {\n\t\tswitch (direction) {\n\t\t\tcase CursorMove.Direction.Left: {\n\t\t\t\tif (unit === CursorMove.Unit.HalfLine) {\n\t\t\t\t\t// Move left by half the current line length\n\t\t\t\t\treturn this._moveHalfLineLeft(viewModel, cursors, inSelectionMode);\n\t\t\t\t} else {\n\t\t\t\t\t// Move left by `moveParams.value` columns\n\t\t\t\t\treturn this._moveLeft(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Right: {\n\t\t\t\tif (unit === CursorMove.Unit.HalfLine) {\n\t\t\t\t\t// Move right by half the current line length\n\t\t\t\t\treturn this._moveHalfLineRight(viewModel, cursors, inSelectionMode);\n\t\t\t\t} else {\n\t\t\t\t\t// Move right by `moveParams.value` columns\n\t\t\t\t\treturn this._moveRight(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Up: {\n\t\t\t\tif (unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\t// Move up by view lines\n\t\t\t\t\treturn this._moveUpByViewLines(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t} else {\n\t\t\t\t\t// Move up by model lines\n\t\t\t\t\treturn this._moveUpByModelLines(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Down: {\n\t\t\t\tif (unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\t// Move down by view lines\n\t\t\t\t\treturn this._moveDownByViewLines(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t} else {\n\t\t\t\t\t// Move down by model lines\n\t\t\t\t\treturn this._moveDownByModelLines(viewModel, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.PrevBlankLine: {\n\t\t\t\tif (unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\treturn cursors.map(cursor => CursorState.fromViewState(MoveOperations.moveToPrevBlankLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode)));\n\t\t\t\t} else {\n\t\t\t\t\treturn cursors.map(cursor => CursorState.fromModelState(MoveOperations.moveToPrevBlankLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.NextBlankLine: {\n\t\t\t\tif (unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\treturn cursors.map(cursor => CursorState.fromViewState(MoveOperations.moveToNextBlankLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode)));\n\t\t\t\t} else {\n\t\t\t\t\treturn cursors.map(cursor => CursorState.fromModelState(MoveOperations.moveToNextBlankLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.WrappedLineStart: {\n\t\t\t\t// Move to the beginning of the current view line\n\t\t\t\treturn this._moveToViewMinColumn(viewModel, cursors, inSelectionMode);\n\t\t\t}\n\t\t\tcase CursorMove.Direction.WrappedLineFirstNonWhitespaceCharacter: {\n\t\t\t\t// Move to the first non-whitespace column of the current view line\n\t\t\t\treturn this._moveToViewFirstNonWhitespaceColumn(viewModel, cursors, inSelectionMode);\n\t\t\t}\n\t\t\tcase CursorMove.Direction.WrappedLineColumnCenter: {\n\t\t\t\t// Move to the \"center\" of the current view line\n\t\t\t\treturn this._moveToViewCenterColumn(viewModel, cursors, inSelectionMode);\n\t\t\t}\n\t\t\tcase CursorMove.Direction.WrappedLineEnd: {\n\t\t\t\t// Move to the end of the current view line\n\t\t\t\treturn this._moveToViewMaxColumn(viewModel, cursors, inSelectionMode);\n\t\t\t}\n\t\t\tcase CursorMove.Direction.WrappedLineLastNonWhitespaceCharacter: {\n\t\t\t\t// Move to the last non-whitespace column of the current view line\n\t\t\t\treturn this._moveToViewLastNonWhitespaceColumn(viewModel, cursors, inSelectionMode);\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic static viewportMove(viewModel: IViewModel, cursors: CursorState[], direction: CursorMove.ViewportDirection, inSelectionMode: boolean, value: number): PartialCursorState[] | null {\n\t\tconst visibleViewRange = viewModel.getCompletelyVisibleViewRange();\n\t\tconst visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange);\n\t\tswitch (direction) {\n\t\t\tcase CursorMove.Direction.ViewPortTop: {\n\t\t\t\t// Move to the nth line start in the viewport (from the top)\n\t\t\t\tconst modelLineNumber = this._firstLineNumberInRange(viewModel.model, visibleModelRange, value);\n\t\t\t\tconst modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)];\n\t\t\t}\n\t\t\tcase CursorMove.Direction.ViewPortBottom: {\n\t\t\t\t// Move to the nth line start in the viewport (from the bottom)\n\t\t\t\tconst modelLineNumber = this._lastLineNumberInRange(viewModel.model, visibleModelRange, value);\n\t\t\t\tconst modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)];\n\t\t\t}\n\t\t\tcase CursorMove.Direction.ViewPortCenter: {\n\t\t\t\t// Move to the line start in the viewport center\n\t\t\t\tconst modelLineNumber = Math.round((visibleModelRange.startLineNumber + visibleModelRange.endLineNumber) / 2);\n\t\t\t\tconst modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)];\n\t\t\t}\n\t\t\tcase CursorMove.Direction.ViewPortIfOutside: {\n\t\t\t\t// Move to a position inside the viewport\n\t\t\t\tconst result: PartialCursorState[] = [];\n\t\t\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\t\t\tconst cursor = cursors[i];\n\t\t\t\t\tresult[i] = this.findPositionInViewportIfOutside(viewModel, cursor, visibleViewRange, inSelectionMode);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic static findPositionInViewportIfOutside(viewModel: IViewModel, cursor: CursorState, visibleViewRange: Range, inSelectionMode: boolean): PartialCursorState {\n\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\n\t\tif (visibleViewRange.startLineNumber <= viewLineNumber && viewLineNumber <= visibleViewRange.endLineNumber - 1) {\n\t\t\t// Nothing to do, cursor is in viewport\n\t\t\treturn new CursorState(cursor.modelState, cursor.viewState);\n\n\t\t} else {\n\t\t\tlet newViewLineNumber: number;\n\t\t\tif (viewLineNumber > visibleViewRange.endLineNumber - 1) {\n\t\t\t\tnewViewLineNumber = visibleViewRange.endLineNumber - 1;\n\t\t\t} else if (viewLineNumber < visibleViewRange.startLineNumber) {\n\t\t\t\tnewViewLineNumber = visibleViewRange.startLineNumber;\n\t\t\t} else {\n\t\t\t\tnewViewLineNumber = viewLineNumber;\n\t\t\t}\n\t\t\tconst position = MoveOperations.vertical(viewModel.cursorConfig, viewModel, viewLineNumber, cursor.viewState.position.column, cursor.viewState.leftoverVisibleColumns, newViewLineNumber, false);\n\t\t\treturn CursorState.fromViewState(cursor.viewState.move(inSelectionMode, position.lineNumber, position.column, position.leftoverVisibleColumns));\n\t\t}\n\t}\n\n\t/**\n\t * Find the nth line start included in the range (from the start).\n\t */\n\tprivate static _firstLineNumberInRange(model: ICursorSimpleModel, range: Range, count: number): number {\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tif (range.startColumn !== model.getLineMinColumn(startLineNumber)) {\n\t\t\t// Move on to the second line if the first line start is not included in the range\n\t\t\tstartLineNumber++;\n\t\t}\n\n\t\treturn Math.min(range.endLineNumber, startLineNumber + count - 1);\n\t}\n\n\t/**\n\t * Find the nth line start included in the range (from the end).\n\t */\n\tprivate static _lastLineNumberInRange(model: ICursorSimpleModel, range: Range, count: number): number {\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tif (range.startColumn !== model.getLineMinColumn(startLineNumber)) {\n\t\t\t// Move on to the second line if the first line start is not included in the range\n\t\t\tstartLineNumber++;\n\t\t}\n\n\t\treturn Math.max(startLineNumber, range.endLineNumber - count + 1);\n\t}\n\n\tprivate static _moveLeft(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, noOfColumns: number): PartialCursorState[] {\n\t\treturn cursors.map(cursor =>\n\t\t\tCursorState.fromViewState(\n\t\t\t\tMoveOperations.moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns)\n\t\t\t)\n\t\t);\n\t}\n\n\tprivate static _moveHalfLineLeft(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst halfLine = Math.round(viewModel.getLineContent(viewLineNumber).length / 2);\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveRight(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, noOfColumns: number): PartialCursorState[] {\n\t\treturn cursors.map(cursor =>\n\t\t\tCursorState.fromViewState(\n\t\t\t\tMoveOperations.moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns)\n\t\t\t)\n\t\t);\n\t}\n\n\tprivate static _moveHalfLineRight(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst halfLine = Math.round(viewModel.getLineContent(viewLineNumber).length / 2);\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveDownByViewLines(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveDown(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveDownByModelLines(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromModelState(MoveOperations.moveDown(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveUpByViewLines(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveUp(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveUpByModelLines(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tresult[i] = CursorState.fromModelState(MoveOperations.moveUp(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewPosition(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, toViewLineNumber: number, toViewColumn: number): PartialCursorState {\n\t\treturn CursorState.fromViewState(cursor.viewState.move(inSelectionMode, toViewLineNumber, toViewColumn, 0));\n\t}\n\n\tprivate static _moveToModelPosition(viewModel: IViewModel, cursor: CursorState, inSelectionMode: boolean, toModelLineNumber: number, toModelColumn: number): PartialCursorState {\n\t\treturn CursorState.fromModelState(cursor.modelState.move(inSelectionMode, toModelLineNumber, toModelColumn, 0));\n\t}\n\n\tprivate static _moveToViewMinColumn(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = viewModel.getLineMinColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewFirstNonWhitespaceColumn(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewCenterColumn(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = Math.round((viewModel.getLineMaxColumn(viewLineNumber) + viewModel.getLineMinColumn(viewLineNumber)) / 2);\n\t\t\tresult[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewMaxColumn(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = viewModel.getLineMaxColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewLastNonWhitespaceColumn(viewModel: IViewModel, cursors: CursorState[], inSelectionMode: boolean): PartialCursorState[] {\n\t\tconst result: PartialCursorState[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tconst cursor = cursors[i];\n\t\t\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = viewModel.getLineLastNonWhitespaceColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nexport namespace CursorMove {\n\n\tconst isCursorMoveArgs = function (arg: any): boolean {\n\t\tif (!types.isObject(arg)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst cursorMoveArg: RawArguments = arg;\n\n\t\tif (!types.isString(cursorMoveArg.to)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(cursorMoveArg.select) && !types.isBoolean(cursorMoveArg.select)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(cursorMoveArg.by) && !types.isString(cursorMoveArg.by)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(cursorMoveArg.value) && !types.isNumber(cursorMoveArg.value)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\texport const description = <ICommandHandlerDescription>{\n\t\tdescription: 'Move cursor to a logical position in the view',\n\t\targs: [\n\t\t\t{\n\t\t\t\tname: 'Cursor move argument object',\n\t\t\t\tdescription: `Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t`,\n\t\t\t\tconstraint: isCursorMoveArgs,\n\t\t\t\tschema: {\n\t\t\t\t\t'type': 'object',\n\t\t\t\t\t'required': ['to'],\n\t\t\t\t\t'properties': {\n\t\t\t\t\t\t'to': {\n\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t'enum': ['left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter', 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter', 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'by': {\n\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t'enum': ['line', 'wrappedLine', 'character', 'halfLine']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'value': {\n\t\t\t\t\t\t\t'type': 'number',\n\t\t\t\t\t\t\t'default': 1\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'select': {\n\t\t\t\t\t\t\t'type': 'boolean',\n\t\t\t\t\t\t\t'default': false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\n\t/**\n\t * Positions in the view for cursor move command.\n\t */\n\texport const RawDirection = {\n\t\tLeft: 'left',\n\t\tRight: 'right',\n\t\tUp: 'up',\n\t\tDown: 'down',\n\n\t\tPrevBlankLine: 'prevBlankLine',\n\t\tNextBlankLine: 'nextBlankLine',\n\n\t\tWrappedLineStart: 'wrappedLineStart',\n\t\tWrappedLineFirstNonWhitespaceCharacter: 'wrappedLineFirstNonWhitespaceCharacter',\n\t\tWrappedLineColumnCenter: 'wrappedLineColumnCenter',\n\t\tWrappedLineEnd: 'wrappedLineEnd',\n\t\tWrappedLineLastNonWhitespaceCharacter: 'wrappedLineLastNonWhitespaceCharacter',\n\n\t\tViewPortTop: 'viewPortTop',\n\t\tViewPortCenter: 'viewPortCenter',\n\t\tViewPortBottom: 'viewPortBottom',\n\n\t\tViewPortIfOutside: 'viewPortIfOutside'\n\t};\n\n\t/**\n\t * Units for Cursor move 'by' argument\n\t */\n\texport const RawUnit = {\n\t\tLine: 'line',\n\t\tWrappedLine: 'wrappedLine',\n\t\tCharacter: 'character',\n\t\tHalfLine: 'halfLine'\n\t};\n\n\t/**\n\t * Arguments for Cursor move command\n\t */\n\texport interface RawArguments {\n\t\tto: string;\n\t\tselect?: boolean;\n\t\tby?: string;\n\t\tvalue?: number;\n\t}\n\n\texport function parse(args: RawArguments): ParsedArguments | null {\n\t\tif (!args.to) {\n\t\t\t// illegal arguments\n\t\t\treturn null;\n\t\t}\n\n\t\tlet direction: Direction;\n\t\tswitch (args.to) {\n\t\t\tcase RawDirection.Left:\n\t\t\t\tdirection = Direction.Left;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.Right:\n\t\t\t\tdirection = Direction.Right;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.Up:\n\t\t\t\tdirection = Direction.Up;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.Down:\n\t\t\t\tdirection = Direction.Down;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.PrevBlankLine:\n\t\t\t\tdirection = Direction.PrevBlankLine;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.NextBlankLine:\n\t\t\t\tdirection = Direction.NextBlankLine;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.WrappedLineStart:\n\t\t\t\tdirection = Direction.WrappedLineStart;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.WrappedLineFirstNonWhitespaceCharacter:\n\t\t\t\tdirection = Direction.WrappedLineFirstNonWhitespaceCharacter;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.WrappedLineColumnCenter:\n\t\t\t\tdirection = Direction.WrappedLineColumnCenter;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.WrappedLineEnd:\n\t\t\t\tdirection = Direction.WrappedLineEnd;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.WrappedLineLastNonWhitespaceCharacter:\n\t\t\t\tdirection = Direction.WrappedLineLastNonWhitespaceCharacter;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.ViewPortTop:\n\t\t\t\tdirection = Direction.ViewPortTop;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.ViewPortBottom:\n\t\t\t\tdirection = Direction.ViewPortBottom;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.ViewPortCenter:\n\t\t\t\tdirection = Direction.ViewPortCenter;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.ViewPortIfOutside:\n\t\t\t\tdirection = Direction.ViewPortIfOutside;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// illegal arguments\n\t\t\t\treturn null;\n\t\t}\n\n\t\tlet unit = Unit.None;\n\t\tswitch (args.by) {\n\t\t\tcase RawUnit.Line:\n\t\t\t\tunit = Unit.Line;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.WrappedLine:\n\t\t\t\tunit = Unit.WrappedLine;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.Character:\n\t\t\t\tunit = Unit.Character;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.HalfLine:\n\t\t\t\tunit = Unit.HalfLine;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\tdirection: direction,\n\t\t\tunit: unit,\n\t\t\tselect: (!!args.select),\n\t\t\tvalue: (args.value || 1)\n\t\t};\n\t}\n\n\texport interface ParsedArguments {\n\t\tdirection: Direction;\n\t\tunit: Unit;\n\t\tselect: boolean;\n\t\tvalue: number;\n\t}\n\n\texport interface SimpleMoveArguments {\n\t\tdirection: SimpleMoveDirection;\n\t\tunit: Unit;\n\t\tselect: boolean;\n\t\tvalue: number;\n\t}\n\n\texport const enum Direction {\n\t\tLeft,\n\t\tRight,\n\t\tUp,\n\t\tDown,\n\t\tPrevBlankLine,\n\t\tNextBlankLine,\n\n\t\tWrappedLineStart,\n\t\tWrappedLineFirstNonWhitespaceCharacter,\n\t\tWrappedLineColumnCenter,\n\t\tWrappedLineEnd,\n\t\tWrappedLineLastNonWhitespaceCharacter,\n\n\t\tViewPortTop,\n\t\tViewPortCenter,\n\t\tViewPortBottom,\n\n\t\tViewPortIfOutside,\n\t}\n\n\texport type SimpleMoveDirection = (\n\t\tDirection.Left\n\t\t| Direction.Right\n\t\t| Direction.Up\n\t\t| Direction.Down\n\t\t| Direction.PrevBlankLine\n\t\t| Direction.NextBlankLine\n\t\t| Direction.WrappedLineStart\n\t\t| Direction.WrappedLineFirstNonWhitespaceCharacter\n\t\t| Direction.WrappedLineColumnCenter\n\t\t| Direction.WrappedLineEnd\n\t\t| Direction.WrappedLineLastNonWhitespaceCharacter\n\t);\n\n\texport type ViewportDirection = (\n\t\tDirection.ViewPortTop\n\t\t| Direction.ViewPortCenter\n\t\t| Direction.ViewPortBottom\n\t\t| Direction.ViewPortIfOutside\n\t);\n\n\texport const enum Unit {\n\t\tNone,\n\t\tLine,\n\t\tWrappedLine,\n\t\tCharacter,\n\t\tHalfLine,\n\t}\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 { CursorState, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorContext } from 'vs/editor/common/cursor/cursorContext';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { PositionAffinity, TrackedRangeStickiness } from 'vs/editor/common/model';\n\n/**\n * Represents a single cursor.\n*/\nexport class Cursor {\n\n\tpublic modelState!: SingleCursorState;\n\tpublic viewState!: SingleCursorState;\n\n\tprivate _selTrackedRange: string | null;\n\tprivate _trackSelection: boolean;\n\n\tconstructor(context: CursorContext) {\n\t\tthis._selTrackedRange = null;\n\t\tthis._trackSelection = true;\n\n\t\tthis._setState(\n\t\t\tcontext,\n\t\t\tnew SingleCursorState(new Range(1, 1, 1, 1), 0, new Position(1, 1), 0),\n\t\t\tnew SingleCursorState(new Range(1, 1, 1, 1), 0, new Position(1, 1), 0)\n\t\t);\n\t}\n\n\tpublic dispose(context: CursorContext): void {\n\t\tthis._removeTrackedRange(context);\n\t}\n\n\tpublic startTrackingSelection(context: CursorContext): void {\n\t\tthis._trackSelection = true;\n\t\tthis._updateTrackedRange(context);\n\t}\n\n\tpublic stopTrackingSelection(context: CursorContext): void {\n\t\tthis._trackSelection = false;\n\t\tthis._removeTrackedRange(context);\n\t}\n\n\tprivate _updateTrackedRange(context: CursorContext): void {\n\t\tif (!this._trackSelection) {\n\t\t\t// don't track the selection\n\t\t\treturn;\n\t\t}\n\t\tthis._selTrackedRange = context.model._setTrackedRange(this._selTrackedRange, this.modelState.selection, TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges);\n\t}\n\n\tprivate _removeTrackedRange(context: CursorContext): void {\n\t\tthis._selTrackedRange = context.model._setTrackedRange(this._selTrackedRange, null, TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges);\n\t}\n\n\tpublic asCursorState(): CursorState {\n\t\treturn new CursorState(this.modelState, this.viewState);\n\t}\n\n\tpublic readSelectionFromMarkers(context: CursorContext): Selection {\n\t\tconst range = context.model._getTrackedRange(this._selTrackedRange!)!;\n\t\treturn Selection.fromRange(range, this.modelState.selection.getDirection());\n\t}\n\n\tpublic ensureValidState(context: CursorContext): void {\n\t\tthis._setState(context, this.modelState, this.viewState);\n\t}\n\n\tpublic setState(context: CursorContext, modelState: SingleCursorState | null, viewState: SingleCursorState | null): void {\n\t\tthis._setState(context, modelState, viewState);\n\t}\n\n\tprivate static _validatePositionWithCache(viewModel: ICursorSimpleModel, position: Position, cacheInput: Position, cacheOutput: Position): Position {\n\t\tif (position.equals(cacheInput)) {\n\t\t\treturn cacheOutput;\n\t\t}\n\t\treturn viewModel.normalizePosition(position, PositionAffinity.None);\n\t}\n\n\tprivate static _validateViewState(viewModel: ICursorSimpleModel, viewState: SingleCursorState): SingleCursorState {\n\t\tconst position = viewState.position;\n\t\tconst sStartPosition = viewState.selectionStart.getStartPosition();\n\t\tconst sEndPosition = viewState.selectionStart.getEndPosition();\n\n\t\tconst validPosition = viewModel.normalizePosition(position, PositionAffinity.None);\n\t\tconst validSStartPosition = this._validatePositionWithCache(viewModel, sStartPosition, position, validPosition);\n\t\tconst validSEndPosition = this._validatePositionWithCache(viewModel, sEndPosition, sStartPosition, validSStartPosition);\n\n\t\tif (position.equals(validPosition) && sStartPosition.equals(validSStartPosition) && sEndPosition.equals(validSEndPosition)) {\n\t\t\t// fast path: the state is valid\n\t\t\treturn viewState;\n\t\t}\n\n\t\treturn new SingleCursorState(\n\t\t\tRange.fromPositions(validSStartPosition, validSEndPosition),\n\t\t\tviewState.selectionStartLeftoverVisibleColumns + sStartPosition.column - validSStartPosition.column,\n\t\t\tvalidPosition,\n\t\t\tviewState.leftoverVisibleColumns + position.column - validPosition.column,\n\t\t);\n\t}\n\n\tprivate _setState(context: CursorContext, modelState: SingleCursorState | null, viewState: SingleCursorState | null): void {\n\t\tif (viewState) {\n\t\t\tviewState = Cursor._validateViewState(context.viewModel, viewState);\n\t\t}\n\n\t\tif (!modelState) {\n\t\t\tif (!viewState) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// We only have the view state => compute the model state\n\t\t\tconst selectionStart = context.model.validateRange(\n\t\t\t\tcontext.coordinatesConverter.convertViewRangeToModelRange(viewState.selectionStart)\n\t\t\t);\n\n\t\t\tconst position = context.model.validatePosition(\n\t\t\t\tcontext.coordinatesConverter.convertViewPositionToModelPosition(viewState.position)\n\t\t\t);\n\n\t\t\tmodelState = new SingleCursorState(selectionStart, viewState.selectionStartLeftoverVisibleColumns, position, viewState.leftoverVisibleColumns);\n\t\t} else {\n\t\t\t// Validate new model state\n\t\t\tconst selectionStart = context.model.validateRange(modelState.selectionStart);\n\t\t\tconst selectionStartLeftoverVisibleColumns = modelState.selectionStart.equalsRange(selectionStart) ? modelState.selectionStartLeftoverVisibleColumns : 0;\n\n\t\t\tconst position = context.model.validatePosition(\n\t\t\t\tmodelState.position\n\t\t\t);\n\t\t\tconst leftoverVisibleColumns = modelState.position.equals(position) ? modelState.leftoverVisibleColumns : 0;\n\n\t\t\tmodelState = new SingleCursorState(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns);\n\t\t}\n\n\t\tif (!viewState) {\n\t\t\t// We only have the model state => compute the view state\n\t\t\tconst viewSelectionStart1 = context.coordinatesConverter.convertModelPositionToViewPosition(new Position(modelState.selectionStart.startLineNumber, modelState.selectionStart.startColumn));\n\t\t\tconst viewSelectionStart2 = context.coordinatesConverter.convertModelPositionToViewPosition(new Position(modelState.selectionStart.endLineNumber, modelState.selectionStart.endColumn));\n\t\t\tconst viewSelectionStart = new Range(viewSelectionStart1.lineNumber, viewSelectionStart1.column, viewSelectionStart2.lineNumber, viewSelectionStart2.column);\n\t\t\tconst viewPosition = context.coordinatesConverter.convertModelPositionToViewPosition(modelState.position);\n\t\t\tviewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns);\n\t\t} else {\n\t\t\t// Validate new view state\n\t\t\tconst viewSelectionStart = context.coordinatesConverter.validateViewRange(viewState.selectionStart, modelState.selectionStart);\n\t\t\tconst viewPosition = context.coordinatesConverter.validateViewPosition(viewState.position, modelState.position);\n\t\t\tviewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns);\n\t\t}\n\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\n\t\tthis._updateTrackedRange(context);\n\t}\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 { compareBy, findLastMaxBy, findMinBy } from 'vs/base/common/arrays';\nimport { CursorState, PartialCursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorContext } from 'vs/editor/common/cursor/cursorContext';\nimport { Cursor } from 'vs/editor/common/cursor/oneCursor';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\n\nexport class CursorCollection {\n\n\tprivate context: CursorContext;\n\n\t/**\n\t * `cursors[0]` is the primary cursor, thus `cursors.length >= 1` is always true.\n\t * `cursors.slice(1)` are secondary cursors.\n\t*/\n\tprivate cursors: Cursor[];\n\n\t// An index which identifies the last cursor that was added / moved (think Ctrl+drag)\n\t// This index refers to `cursors.slice(1)`, i.e. after removing the primary cursor.\n\tprivate lastAddedCursorIndex: number;\n\n\tconstructor(context: CursorContext) {\n\t\tthis.context = context;\n\t\tthis.cursors = [new Cursor(context)];\n\t\tthis.lastAddedCursorIndex = 0;\n\t}\n\n\tpublic dispose(): void {\n\t\tfor (const cursor of this.cursors) {\n\t\t\tcursor.dispose(this.context);\n\t\t}\n\t}\n\n\tpublic startTrackingSelections(): void {\n\t\tfor (const cursor of this.cursors) {\n\t\t\tcursor.startTrackingSelection(this.context);\n\t\t}\n\t}\n\n\tpublic stopTrackingSelections(): void {\n\t\tfor (const cursor of this.cursors) {\n\t\t\tcursor.stopTrackingSelection(this.context);\n\t\t}\n\t}\n\n\tpublic updateContext(context: CursorContext): void {\n\t\tthis.context = context;\n\t}\n\n\tpublic ensureValidState(): void {\n\t\tfor (const cursor of this.cursors) {\n\t\t\tcursor.ensureValidState(this.context);\n\t\t}\n\t}\n\n\tpublic readSelectionFromMarkers(): Selection[] {\n\t\treturn this.cursors.map(c => c.readSelectionFromMarkers(this.context));\n\t}\n\n\tpublic getAll(): CursorState[] {\n\t\treturn this.cursors.map(c => c.asCursorState());\n\t}\n\n\tpublic getViewPositions(): Position[] {\n\t\treturn this.cursors.map(c => c.viewState.position);\n\t}\n\n\tpublic getTopMostViewPosition(): Position {\n\t\treturn findMinBy(\n\t\t\tthis.cursors,\n\t\t\tcompareBy(c => c.viewState.position, Position.compare)\n\t\t)!.viewState.position;\n\t}\n\n\tpublic getBottomMostViewPosition(): Position {\n\t\treturn findLastMaxBy(\n\t\t\tthis.cursors,\n\t\t\tcompareBy(c => c.viewState.position, Position.compare)\n\t\t)!.viewState.position;\n\t}\n\n\tpublic getSelections(): Selection[] {\n\t\treturn this.cursors.map(c => c.modelState.selection);\n\t}\n\n\tpublic getViewSelections(): Selection[] {\n\t\treturn this.cursors.map(c => c.viewState.selection);\n\t}\n\n\tpublic setSelections(selections: ISelection[]): void {\n\t\tthis.setStates(CursorState.fromModelSelections(selections));\n\t}\n\n\tpublic getPrimaryCursor(): CursorState {\n\t\treturn this.cursors[0].asCursorState();\n\t}\n\n\tpublic setStates(states: PartialCursorState[] | null): void {\n\t\tif (states === null) {\n\t\t\treturn;\n\t\t}\n\t\tthis.cursors[0].setState(this.context, states[0].modelState, states[0].viewState);\n\t\tthis._setSecondaryStates(states.slice(1));\n\t}\n\n\t/**\n\t * Creates or disposes secondary cursors as necessary to match the number of `secondarySelections`.\n\t */\n\tprivate _setSecondaryStates(secondaryStates: PartialCursorState[]): void {\n\t\tconst secondaryCursorsLength = this.cursors.length - 1;\n\t\tconst secondaryStatesLength = secondaryStates.length;\n\n\t\tif (secondaryCursorsLength < secondaryStatesLength) {\n\t\t\tconst createCnt = secondaryStatesLength - secondaryCursorsLength;\n\t\t\tfor (let i = 0; i < createCnt; i++) {\n\t\t\t\tthis._addSecondaryCursor();\n\t\t\t}\n\t\t} else if (secondaryCursorsLength > secondaryStatesLength) {\n\t\t\tconst removeCnt = secondaryCursorsLength - secondaryStatesLength;\n\t\t\tfor (let i = 0; i < removeCnt; i++) {\n\t\t\t\tthis._removeSecondaryCursor(this.cursors.length - 2);\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < secondaryStatesLength; i++) {\n\t\t\tthis.cursors[i + 1].setState(this.context, secondaryStates[i].modelState, secondaryStates[i].viewState);\n\t\t}\n\t}\n\n\tpublic killSecondaryCursors(): void {\n\t\tthis._setSecondaryStates([]);\n\t}\n\n\tprivate _addSecondaryCursor(): void {\n\t\tthis.cursors.push(new Cursor(this.context));\n\t\tthis.lastAddedCursorIndex = this.cursors.length - 1;\n\t}\n\n\tpublic getLastAddedCursorIndex(): number {\n\t\tif (this.cursors.length === 1 || this.lastAddedCursorIndex === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.lastAddedCursorIndex;\n\t}\n\n\tprivate _removeSecondaryCursor(removeIndex: number): void {\n\t\tif (this.lastAddedCursorIndex >= removeIndex + 1) {\n\t\t\tthis.lastAddedCursorIndex--;\n\t\t}\n\t\tthis.cursors[removeIndex + 1].dispose(this.context);\n\t\tthis.cursors.splice(removeIndex + 1, 1);\n\t}\n\n\tpublic normalize(): void {\n\t\tif (this.cursors.length === 1) {\n\t\t\treturn;\n\t\t}\n\t\tconst cursors = this.cursors.slice(0);\n\n\t\tinterface SortedCursor {\n\t\t\tindex: number;\n\t\t\tselection: Selection;\n\t\t}\n\t\tconst sortedCursors: SortedCursor[] = [];\n\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\tsortedCursors.push({\n\t\t\t\tindex: i,\n\t\t\t\tselection: cursors[i].modelState.selection,\n\t\t\t});\n\t\t}\n\n\t\tsortedCursors.sort(compareBy(s => s.selection, Range.compareRangesUsingStarts));\n\n\t\tfor (let sortedCursorIndex = 0; sortedCursorIndex < sortedCursors.length - 1; sortedCursorIndex++) {\n\t\t\tconst current = sortedCursors[sortedCursorIndex];\n\t\t\tconst next = sortedCursors[sortedCursorIndex + 1];\n\n\t\t\tconst currentSelection = current.selection;\n\t\t\tconst nextSelection = next.selection;\n\n\t\t\tif (!this.context.cursorConfig.multiCursorMergeOverlapping) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet shouldMergeCursors: boolean;\n\t\t\tif (nextSelection.isEmpty() || currentSelection.isEmpty()) {\n\t\t\t\t// Merge touching cursors if one of them is collapsed\n\t\t\t\tshouldMergeCursors = nextSelection.getStartPosition().isBeforeOrEqual(currentSelection.getEndPosition());\n\t\t\t} else {\n\t\t\t\t// Merge only overlapping cursors (i.e. allow touching ranges)\n\t\t\t\tshouldMergeCursors = nextSelection.getStartPosition().isBefore(currentSelection.getEndPosition());\n\t\t\t}\n\n\t\t\tif (shouldMergeCursors) {\n\t\t\t\tconst winnerSortedCursorIndex = current.index < next.index ? sortedCursorIndex : sortedCursorIndex + 1;\n\t\t\t\tconst looserSortedCursorIndex = current.index < next.index ? sortedCursorIndex + 1 : sortedCursorIndex;\n\n\t\t\t\tconst looserIndex = sortedCursors[looserSortedCursorIndex].index;\n\t\t\t\tconst winnerIndex = sortedCursors[winnerSortedCursorIndex].index;\n\n\t\t\t\tconst looserSelection = sortedCursors[looserSortedCursorIndex].selection;\n\t\t\t\tconst winnerSelection = sortedCursors[winnerSortedCursorIndex].selection;\n\n\t\t\t\tif (!looserSelection.equalsSelection(winnerSelection)) {\n\t\t\t\t\tconst resultingRange = looserSelection.plusRange(winnerSelection);\n\t\t\t\t\tconst looserSelectionIsLTR = (looserSelection.selectionStartLineNumber === looserSelection.startLineNumber && looserSelection.selectionStartColumn === looserSelection.startColumn);\n\t\t\t\t\tconst winnerSelectionIsLTR = (winnerSelection.selectionStartLineNumber === winnerSelection.startLineNumber && winnerSelection.selectionStartColumn === winnerSelection.startColumn);\n\n\t\t\t\t\t// Give more importance to the last added cursor (think Ctrl-dragging + hitting another cursor)\n\t\t\t\t\tlet resultingSelectionIsLTR: boolean;\n\t\t\t\t\tif (looserIndex === this.lastAddedCursorIndex) {\n\t\t\t\t\t\tresultingSelectionIsLTR = looserSelectionIsLTR;\n\t\t\t\t\t\tthis.lastAddedCursorIndex = winnerIndex;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Winner takes it all\n\t\t\t\t\t\tresultingSelectionIsLTR = winnerSelectionIsLTR;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet resultingSelection: Selection;\n\t\t\t\t\tif (resultingSelectionIsLTR) {\n\t\t\t\t\t\tresultingSelection = new Selection(resultingRange.startLineNumber, resultingRange.startColumn, resultingRange.endLineNumber, resultingRange.endColumn);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresultingSelection = new Selection(resultingRange.endLineNumber, resultingRange.endColumn, resultingRange.startLineNumber, resultingRange.startColumn);\n\t\t\t\t\t}\n\n\t\t\t\t\tsortedCursors[winnerSortedCursorIndex].selection = resultingSelection;\n\t\t\t\t\tconst resultingState = CursorState.fromModelSelection(resultingSelection);\n\t\t\t\t\tcursors[winnerIndex].setState(this.context, resultingState.modelState, resultingState.viewState);\n\t\t\t\t}\n\n\t\t\t\tfor (const sortedCursor of sortedCursors) {\n\t\t\t\t\tif (sortedCursor.index > looserIndex) {\n\t\t\t\t\t\tsortedCursor.index--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcursors.splice(looserIndex, 1);\n\t\t\t\tsortedCursors.splice(looserSortedCursorIndex, 1);\n\t\t\t\tthis._removeSecondaryCursor(looserIndex - 1);\n\n\t\t\t\tsortedCursorIndex--;\n\t\t\t}\n\t\t}\n\t}\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 { IAutoClosingPair, StandardAutoClosingPairConditional, LanguageConfiguration, CharacterPair } from 'vs/editor/common/languages/languageConfiguration';\n\nexport class CharacterPairSupport {\n\n\tstatic readonly DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED = ';:.,=}])> \\n\\t';\n\n\tprivate readonly _autoClosingPairs: StandardAutoClosingPairConditional[];\n\tprivate readonly _surroundingPairs: IAutoClosingPair[];\n\tprivate readonly _autoCloseBefore: string;\n\tprivate readonly _colorizedBracketPairs: CharacterPair[];\n\n\tconstructor(config: LanguageConfiguration) {\n\t\tif (config.autoClosingPairs) {\n\t\t\tthis._autoClosingPairs = config.autoClosingPairs.map(el => new StandardAutoClosingPairConditional(el));\n\t\t} else if (config.brackets) {\n\t\t\tthis._autoClosingPairs = config.brackets.map(b => new StandardAutoClosingPairConditional({ open: b[0], close: b[1] }));\n\t\t} else {\n\t\t\tthis._autoClosingPairs = [];\n\t\t}\n\n\t\tif (config.colorizedBracketPairs) {\n\t\t\tthis._colorizedBracketPairs = filterValidBrackets(config.colorizedBracketPairs.map(b => [b[0], b[1]]));\n\t\t} else if (config.brackets) {\n\t\t\tthis._colorizedBracketPairs = filterValidBrackets(config.brackets\n\t\t\t\t.map((b) => [b[0], b[1]] as [string, string])\n\t\t\t\t// Many languages set < ... > as bracket pair, even though they also use it as comparison operator.\n\t\t\t\t// This leads to problems when colorizing this bracket, so we exclude it by default.\n\t\t\t\t// Languages can still override this by configuring `colorizedBracketPairs`\n\t\t\t\t// https://github.com/microsoft/vscode/issues/132476\n\t\t\t\t.filter((p) => !(p[0] === '<' && p[1] === '>')));\n\t\t} else {\n\t\t\tthis._colorizedBracketPairs = [];\n\t\t}\n\n\t\tif (config.__electricCharacterSupport && config.__electricCharacterSupport.docComment) {\n\t\t\tconst docComment = config.__electricCharacterSupport.docComment;\n\t\t\t// IDocComment is legacy, only partially supported\n\t\t\tthis._autoClosingPairs.push(new StandardAutoClosingPairConditional({ open: docComment.open, close: docComment.close || '' }));\n\t\t}\n\n\t\tthis._autoCloseBefore = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED;\n\n\t\tthis._surroundingPairs = config.surroundingPairs || this._autoClosingPairs;\n\t}\n\n\tpublic getAutoClosingPairs(): StandardAutoClosingPairConditional[] {\n\t\treturn this._autoClosingPairs;\n\t}\n\n\tpublic getAutoCloseBeforeSet(): string {\n\t\treturn this._autoCloseBefore;\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this._surroundingPairs;\n\t}\n\n\tpublic getColorizedBrackets(): readonly CharacterPair[] {\n\t\treturn this._colorizedBracketPairs;\n\t}\n}\n\nfunction filterValidBrackets(bracketPairs: [string, string][]): [string, string][] {\n\treturn bracketPairs.filter(([open, close]) => open !== '' && close !== '');\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 { IndentationRule } from 'vs/editor/common/languages/languageConfiguration';\n\nexport const enum IndentConsts {\n\tINCREASE_MASK = 0b00000001,\n\tDECREASE_MASK = 0b00000010,\n\tINDENT_NEXTLINE_MASK = 0b00000100,\n\tUNINDENT_MASK = 0b00001000,\n}\n\nfunction resetGlobalRegex(reg: RegExp) {\n\tif (reg.global) {\n\t\treg.lastIndex = 0;\n\t}\n\n\treturn true;\n}\n\nexport class IndentRulesSupport {\n\n\tprivate readonly _indentationRules: IndentationRule;\n\n\tconstructor(indentationRules: IndentationRule) {\n\t\tthis._indentationRules = indentationRules;\n\t}\n\n\tpublic shouldIncrease(text: string): boolean {\n\t\tif (this._indentationRules) {\n\t\t\tif (this._indentationRules.increaseIndentPattern && resetGlobalRegex(this._indentationRules.increaseIndentPattern) && this._indentationRules.increaseIndentPattern.test(text)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) {\n\t\t\t// \treturn true;\n\t\t\t// }\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic shouldDecrease(text: string): boolean {\n\t\tif (this._indentationRules && this._indentationRules.decreaseIndentPattern && resetGlobalRegex(this._indentationRules.decreaseIndentPattern) && this._indentationRules.decreaseIndentPattern.test(text)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic shouldIndentNextLine(text: string): boolean {\n\t\tif (this._indentationRules && this._indentationRules.indentNextLinePattern && resetGlobalRegex(this._indentationRules.indentNextLinePattern) && this._indentationRules.indentNextLinePattern.test(text)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic shouldIgnore(text: string): boolean {\n\t\t// the text matches `unIndentedLinePattern`\n\t\tif (this._indentationRules && this._indentationRules.unIndentedLinePattern && resetGlobalRegex(this._indentationRules.unIndentedLinePattern) && this._indentationRules.unIndentedLinePattern.test(text)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic getIndentMetadata(text: string): number {\n\t\tlet ret = 0;\n\t\tif (this.shouldIncrease(text)) {\n\t\t\tret += IndentConsts.INCREASE_MASK;\n\t\t}\n\t\tif (this.shouldDecrease(text)) {\n\t\t\tret += IndentConsts.DECREASE_MASK;\n\t\t}\n\t\tif (this.shouldIndentNextLine(text)) {\n\t\t\tret += IndentConsts.INDENT_NEXTLINE_MASK;\n\t\t}\n\t\tif (this.shouldIgnore(text)) {\n\t\t\tret += IndentConsts.UNINDENT_MASK;\n\t\t}\n\t\treturn ret;\n\t}\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 { IRange } from 'vs/editor/common/core/range';\nimport { IInplaceReplaceSupportResult } from 'vs/editor/common/languages';\n\nexport class BasicInplaceReplace {\n\n\tpublic static readonly INSTANCE = new BasicInplaceReplace();\n\n\tpublic navigateValueSet(range1: IRange, text1: string, range2: IRange, text2: string | null, up: boolean): IInplaceReplaceSupportResult | null {\n\n\t\tif (range1 && text1) {\n\t\t\tconst result = this.doNavigateValueSet(text1, up);\n\t\t\tif (result) {\n\t\t\t\treturn {\n\t\t\t\t\trange: range1,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif (range2 && text2) {\n\t\t\tconst result = this.doNavigateValueSet(text2, up);\n\t\t\tif (result) {\n\t\t\t\treturn {\n\t\t\t\t\trange: range2,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate doNavigateValueSet(text: string, up: boolean): string | null {\n\t\tconst numberResult = this.numberReplace(text, up);\n\t\tif (numberResult !== null) {\n\t\t\treturn numberResult;\n\t\t}\n\t\treturn this.textReplace(text, up);\n\t}\n\n\tprivate numberReplace(value: string, up: boolean): string | null {\n\t\tconst precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\n\t\tlet n1 = Number(value);\n\t\tlet n2 = parseFloat(value);\n\n\t\tif (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\n\n\t\t\tif (n1 === 0 && !up) {\n\t\t\t\treturn null; // don't do negative\n\t\t\t\t//\t\t\t} else if(n1 === 9 && up) {\n\t\t\t\t//\t\t\t\treturn null; // don't insert 10 into a number\n\t\t\t} else {\n\t\t\t\tn1 = Math.floor(n1 * precision);\n\t\t\t\tn1 += up ? precision : -precision;\n\t\t\t\treturn String(n1 / precision);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate readonly _defaultValueSet: string[][] = [\n\t\t['true', 'false'],\n\t\t['True', 'False'],\n\t\t['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\n\t\t['public', 'protected', 'private'],\n\t];\n\n\tprivate textReplace(value: string, up: boolean): string | null {\n\t\treturn this.valueSetsReplace(this._defaultValueSet, value, up);\n\t}\n\n\tprivate valueSetsReplace(valueSets: string[][], value: string, up: boolean): string | null {\n\t\tlet result: string | null = null;\n\t\tfor (let i = 0, len = valueSets.length; result === null && i < len; i++) {\n\t\t\tresult = this.valueSetReplace(valueSets[i], value, up);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate valueSetReplace(valueSet: string[], value: string, up: boolean): string | null {\n\t\tlet idx = valueSet.indexOf(value);\n\t\tif (idx >= 0) {\n\t\t\tidx += up ? +1 : -1;\n\t\t\tif (idx < 0) {\n\t\t\t\tidx = valueSet.length - 1;\n\t\t\t} else {\n\t\t\t\tidx %= valueSet.length;\n\t\t\t}\n\t\t\treturn valueSet[idx];\n\t\t}\n\t\treturn null;\n\t}\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport * as strings from 'vs/base/common/strings';\nimport { CharacterPair, EnterAction, IndentAction, OnEnterRule } from 'vs/editor/common/languages/languageConfiguration';\nimport { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\n\nexport interface IOnEnterSupportOptions {\n\tbrackets?: CharacterPair[];\n\tonEnterRules?: OnEnterRule[];\n}\n\ninterface IProcessedBracketPair {\n\topen: string;\n\tclose: string;\n\topenRegExp: RegExp;\n\tcloseRegExp: RegExp;\n}\n\nexport class OnEnterSupport {\n\n\tprivate readonly _brackets: IProcessedBracketPair[];\n\tprivate readonly _regExpRules: OnEnterRule[];\n\n\tconstructor(opts: IOnEnterSupportOptions) {\n\t\topts = opts || {};\n\t\topts.brackets = opts.brackets || [\n\t\t\t['(', ')'],\n\t\t\t['{', '}'],\n\t\t\t['[', ']']\n\t\t];\n\n\t\tthis._brackets = [];\n\t\topts.brackets.forEach((bracket) => {\n\t\t\tconst openRegExp = OnEnterSupport._createOpenBracketRegExp(bracket[0]);\n\t\t\tconst closeRegExp = OnEnterSupport._createCloseBracketRegExp(bracket[1]);\n\t\t\tif (openRegExp && closeRegExp) {\n\t\t\t\tthis._brackets.push({\n\t\t\t\t\topen: bracket[0],\n\t\t\t\t\topenRegExp: openRegExp,\n\t\t\t\t\tclose: bracket[1],\n\t\t\t\t\tcloseRegExp: closeRegExp,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis._regExpRules = opts.onEnterRules || [];\n\t}\n\n\tpublic onEnter(autoIndent: EditorAutoIndentStrategy, previousLineText: string, beforeEnterText: string, afterEnterText: string): EnterAction | null {\n\t\t// (1): `regExpRules`\n\t\tif (autoIndent >= EditorAutoIndentStrategy.Advanced) {\n\t\t\tfor (let i = 0, len = this._regExpRules.length; i < len; i++) {\n\t\t\t\tconst rule = this._regExpRules[i];\n\t\t\t\tconst regResult = [{\n\t\t\t\t\treg: rule.beforeText,\n\t\t\t\t\ttext: beforeEnterText\n\t\t\t\t}, {\n\t\t\t\t\treg: rule.afterText,\n\t\t\t\t\ttext: afterEnterText\n\t\t\t\t}, {\n\t\t\t\t\treg: rule.previousLineText,\n\t\t\t\t\ttext: previousLineText\n\t\t\t\t}].every((obj): boolean => {\n\t\t\t\t\tif (!obj.reg) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tobj.reg.lastIndex = 0; // To disable the effect of the \"g\" flag.\n\t\t\t\t\treturn obj.reg.test(obj.text);\n\t\t\t\t});\n\n\t\t\t\tif (regResult) {\n\t\t\t\t\treturn rule.action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// (2): Special indent-outdent\n\t\tif (autoIndent >= EditorAutoIndentStrategy.Brackets) {\n\t\t\tif (beforeEnterText.length > 0 && afterEnterText.length > 0) {\n\t\t\t\tfor (let i = 0, len = this._brackets.length; i < len; i++) {\n\t\t\t\t\tconst bracket = this._brackets[i];\n\t\t\t\t\tif (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) {\n\t\t\t\t\t\treturn { indentAction: IndentAction.IndentOutdent };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// (4): Open bracket based logic\n\t\tif (autoIndent >= EditorAutoIndentStrategy.Brackets) {\n\t\t\tif (beforeEnterText.length > 0) {\n\t\t\t\tfor (let i = 0, len = this._brackets.length; i < len; i++) {\n\t\t\t\t\tconst bracket = this._brackets[i];\n\t\t\t\t\tif (bracket.openRegExp.test(beforeEnterText)) {\n\t\t\t\t\t\treturn { indentAction: IndentAction.Indent };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _createOpenBracketRegExp(bracket: string): RegExp | null {\n\t\tlet str = strings.escapeRegExpCharacters(bracket);\n\t\tif (!/\\B/.test(str.charAt(0))) {\n\t\t\tstr = '\\\\b' + str;\n\t\t}\n\t\tstr += '\\\\s*$';\n\t\treturn OnEnterSupport._safeRegExp(str);\n\t}\n\n\tprivate static _createCloseBracketRegExp(bracket: string): RegExp | null {\n\t\tlet str = strings.escapeRegExpCharacters(bracket);\n\t\tif (!/\\B/.test(str.charAt(str.length - 1))) {\n\t\t\tstr = str + '\\\\b';\n\t\t}\n\t\tstr = '^\\\\s*' + str;\n\t\treturn OnEnterSupport._safeRegExp(str);\n\t}\n\n\tprivate static _safeRegExp(def: string): RegExp | null {\n\t\ttry {\n\t\t\treturn new RegExp(def);\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t\treturn null;\n\t\t}\n\t}\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 * as strings from 'vs/base/common/strings';\nimport * as stringBuilder from 'vs/editor/common/core/stringBuilder';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CharacterPair } from 'vs/editor/common/languages/languageConfiguration';\n\ninterface InternalBracket {\n\topen: string[];\n\tclose: string[];\n}\n\n/**\n * Represents a grouping of colliding bracket pairs.\n *\n * Most of the times this contains a single bracket pair,\n * but sometimes this contains multiple bracket pairs in cases\n * where the same string appears as a closing bracket for multiple\n * bracket pairs, or the same string appears an opening bracket for\n * multiple bracket pairs.\n *\n * e.g. of a group containing a single pair:\n * open: ['{'], close: ['}']\n *\n * e.g. of a group containing multiple pairs:\n * open: ['if', 'for'], close: ['end', 'end']\n */\nexport class RichEditBracket {\n\t_richEditBracketBrand: void = undefined;\n\n\treadonly languageId: string;\n\t/**\n\t * A 0-based consecutive unique identifier for this bracket pair.\n\t * If a language has 5 bracket pairs, out of which 2 are grouped together,\n\t * it is expected that the `index` goes from 0 to 4.\n\t */\n\treadonly index: number;\n\t/**\n\t * The open sequence for each bracket pair contained in this group.\n\t *\n\t * The open sequence at a specific index corresponds to the\n\t * closing sequence at the same index.\n\t *\n\t * [ open[i], closed[i] ] represent a bracket pair.\n\t */\n\treadonly open: string[];\n\t/**\n\t * The close sequence for each bracket pair contained in this group.\n\t *\n\t * The close sequence at a specific index corresponds to the\n\t * opening sequence at the same index.\n\t *\n\t * [ open[i], closed[i] ] represent a bracket pair.\n\t */\n\treadonly close: string[];\n\t/**\n\t * A regular expression that is useful to search for this bracket pair group in a string.\n\t *\n\t * This regular expression is built in a way that it is aware of the other bracket\n\t * pairs defined for the language, so it might match brackets from other groups.\n\t *\n\t * See the fine details in `getRegexForBracketPair`.\n\t */\n\treadonly forwardRegex: RegExp;\n\t/**\n\t * A regular expression that is useful to search for this bracket pair group in a string backwards.\n\t *\n\t * This regular expression is built in a way that it is aware of the other bracket\n\t * pairs defined for the language, so it might match brackets from other groups.\n\t *\n\t * See the fine defails in `getReversedRegexForBracketPair`.\n\t */\n\treadonly reversedRegex: RegExp;\n\tprivate readonly _openSet: Set<string>;\n\tprivate readonly _closeSet: Set<string>;\n\n\tconstructor(languageId: string, index: number, open: string[], close: string[], forwardRegex: RegExp, reversedRegex: RegExp) {\n\t\tthis.languageId = languageId;\n\t\tthis.index = index;\n\t\tthis.open = open;\n\t\tthis.close = close;\n\t\tthis.forwardRegex = forwardRegex;\n\t\tthis.reversedRegex = reversedRegex;\n\t\tthis._openSet = RichEditBracket._toSet(this.open);\n\t\tthis._closeSet = RichEditBracket._toSet(this.close);\n\t}\n\n\t/**\n\t * Check if the provided `text` is an open bracket in this group.\n\t */\n\tpublic isOpen(text: string) {\n\t\treturn this._openSet.has(text);\n\t}\n\n\t/**\n\t * Check if the provided `text` is a close bracket in this group.\n\t */\n\tpublic isClose(text: string) {\n\t\treturn this._closeSet.has(text);\n\t}\n\n\tprivate static _toSet(arr: string[]): Set<string> {\n\t\tconst result = new Set<string>();\n\t\tfor (const element of arr) {\n\t\t\tresult.add(element);\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/**\n * Groups together brackets that have equal open or close sequences.\n *\n * For example, if the following brackets are defined:\n * ['IF','END']\n * ['for','end']\n * ['{','}']\n *\n * Then the grouped brackets would be:\n * { open: ['if', 'for'], close: ['end', 'end'] }\n * { open: ['{'], close: ['}'] }\n *\n */\nfunction groupFuzzyBrackets(brackets: readonly CharacterPair[]): InternalBracket[] {\n\tconst N = brackets.length;\n\n\tbrackets = brackets.map(b => [b[0].toLowerCase(), b[1].toLowerCase()]);\n\n\tconst group: number[] = [];\n\tfor (let i = 0; i < N; i++) {\n\t\tgroup[i] = i;\n\t}\n\n\tconst areOverlapping = (a: CharacterPair, b: CharacterPair) => {\n\t\tconst [aOpen, aClose] = a;\n\t\tconst [bOpen, bClose] = b;\n\t\treturn (aOpen === bOpen || aOpen === bClose || aClose === bOpen || aClose === bClose);\n\t};\n\n\tconst mergeGroups = (g1: number, g2: number) => {\n\t\tconst newG = Math.min(g1, g2);\n\t\tconst oldG = Math.max(g1, g2);\n\t\tfor (let i = 0; i < N; i++) {\n\t\t\tif (group[i] === oldG) {\n\t\t\t\tgroup[i] = newG;\n\t\t\t}\n\t\t}\n\t};\n\n\t// group together brackets that have the same open or the same close sequence\n\tfor (let i = 0; i < N; i++) {\n\t\tconst a = brackets[i];\n\t\tfor (let j = i + 1; j < N; j++) {\n\t\t\tconst b = brackets[j];\n\t\t\tif (areOverlapping(a, b)) {\n\t\t\t\tmergeGroups(group[i], group[j]);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst result: InternalBracket[] = [];\n\tfor (let g = 0; g < N; g++) {\n\t\tconst currentOpen: string[] = [];\n\t\tconst currentClose: string[] = [];\n\t\tfor (let i = 0; i < N; i++) {\n\t\t\tif (group[i] === g) {\n\t\t\t\tconst [open, close] = brackets[i];\n\t\t\t\tcurrentOpen.push(open);\n\t\t\t\tcurrentClose.push(close);\n\t\t\t}\n\t\t}\n\t\tif (currentOpen.length > 0) {\n\t\t\tresult.push({\n\t\t\t\topen: currentOpen,\n\t\t\t\tclose: currentClose\n\t\t\t});\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class RichEditBrackets {\n\t_richEditBracketsBrand: void = undefined;\n\n\t/**\n\t * All groups of brackets defined for this language.\n\t */\n\tpublic readonly brackets: RichEditBracket[];\n\t/**\n\t * A regular expression that is useful to search for all bracket pairs in a string.\n\t *\n\t * See the fine details in `getRegexForBrackets`.\n\t */\n\tpublic readonly forwardRegex: RegExp;\n\t/**\n\t * A regular expression that is useful to search for all bracket pairs in a string backwards.\n\t *\n\t * See the fine details in `getReversedRegexForBrackets`.\n\t */\n\tpublic readonly reversedRegex: RegExp;\n\t/**\n\t * The length (i.e. str.length) for the longest bracket pair.\n\t */\n\tpublic readonly maxBracketLength: number;\n\t/**\n\t * A map useful for decoding a regex match and finding which bracket group was matched.\n\t */\n\tpublic readonly textIsBracket: { [text: string]: RichEditBracket };\n\t/**\n\t * A set useful for decoding if a regex match is the open bracket of a bracket pair.\n\t */\n\tpublic readonly textIsOpenBracket: { [text: string]: boolean };\n\n\tconstructor(languageId: string, _brackets: readonly CharacterPair[]) {\n\t\tconst brackets = groupFuzzyBrackets(_brackets);\n\n\t\tthis.brackets = brackets.map((b, index) => {\n\t\t\treturn new RichEditBracket(\n\t\t\t\tlanguageId,\n\t\t\t\tindex,\n\t\t\t\tb.open,\n\t\t\t\tb.close,\n\t\t\t\tgetRegexForBracketPair(b.open, b.close, brackets, index),\n\t\t\t\tgetReversedRegexForBracketPair(b.open, b.close, brackets, index)\n\t\t\t);\n\t\t});\n\n\t\tthis.forwardRegex = getRegexForBrackets(this.brackets);\n\t\tthis.reversedRegex = getReversedRegexForBrackets(this.brackets);\n\n\t\tthis.textIsBracket = {};\n\t\tthis.textIsOpenBracket = {};\n\n\t\tthis.maxBracketLength = 0;\n\t\tfor (const bracket of this.brackets) {\n\t\t\tfor (const open of bracket.open) {\n\t\t\t\tthis.textIsBracket[open] = bracket;\n\t\t\t\tthis.textIsOpenBracket[open] = true;\n\t\t\t\tthis.maxBracketLength = Math.max(this.maxBracketLength, open.length);\n\t\t\t}\n\t\t\tfor (const close of bracket.close) {\n\t\t\t\tthis.textIsBracket[close] = bracket;\n\t\t\t\tthis.textIsOpenBracket[close] = false;\n\t\t\t\tthis.maxBracketLength = Math.max(this.maxBracketLength, close.length);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction collectSuperstrings(str: string, brackets: InternalBracket[], currentIndex: number, dest: string[]): void {\n\tfor (let i = 0, len = brackets.length; i < len; i++) {\n\t\tif (i === currentIndex) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst bracket = brackets[i];\n\t\tfor (const open of bracket.open) {\n\t\t\tif (open.indexOf(str) >= 0) {\n\t\t\t\tdest.push(open);\n\t\t\t}\n\t\t}\n\t\tfor (const close of bracket.close) {\n\t\t\tif (close.indexOf(str) >= 0) {\n\t\t\t\tdest.push(close);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction lengthcmp(a: string, b: string) {\n\treturn a.length - b.length;\n}\n\nfunction unique(arr: string[]): string[] {\n\tif (arr.length <= 1) {\n\t\treturn arr;\n\t}\n\tconst result: string[] = [];\n\tconst seen = new Set<string>();\n\tfor (const element of arr) {\n\t\tif (seen.has(element)) {\n\t\t\tcontinue;\n\t\t}\n\t\tresult.push(element);\n\t\tseen.add(element);\n\t}\n\treturn result;\n}\n\n/**\n * Create a regular expression that can be used to search forward in a piece of text\n * for a group of bracket pairs. But this regex must be built in a way in which\n * it is aware of the other bracket pairs defined for the language.\n *\n * For example, if a language contains the following bracket pairs:\n * ['begin', 'end']\n * ['if', 'end if']\n * The two bracket pairs do not collide because no open or close brackets are equal.\n * So the function getRegexForBracketPair is called twice, once with\n * the ['begin'], ['end'] group consisting of one bracket pair, and once with\n * the ['if'], ['end if'] group consiting of the other bracket pair.\n *\n * But there could be a situation where an occurrence of 'end if' is mistaken\n * for an occurrence of 'end'.\n *\n * Therefore, for the bracket pair ['begin', 'end'], the regex will also\n * target 'end if'. The regex will be something like:\n * /(\\bend if\\b)|(\\bend\\b)|(\\bif\\b)/\n *\n * The regex also searches for \"superstrings\" (other brackets that might be mistaken with the current bracket).\n *\n */\nfunction getRegexForBracketPair(open: string[], close: string[], brackets: InternalBracket[], currentIndex: number): RegExp {\n\t// search in all brackets for other brackets that are a superstring of these brackets\n\tlet pieces: string[] = [];\n\tpieces = pieces.concat(open);\n\tpieces = pieces.concat(close);\n\tfor (let i = 0, len = pieces.length; i < len; i++) {\n\t\tcollectSuperstrings(pieces[i], brackets, currentIndex, pieces);\n\t}\n\tpieces = unique(pieces);\n\tpieces.sort(lengthcmp);\n\tpieces.reverse();\n\treturn createBracketOrRegExp(pieces);\n}\n\n/**\n * Matching a regular expression in JS can only be done \"forwards\". So JS offers natively only\n * methods to find the first match of a regex in a string. But sometimes, it is useful to\n * find the last match of a regex in a string. For such a situation, a nice solution is to\n * simply reverse the string and then search for a reversed regex.\n *\n * This function also has the fine details of `getRegexForBracketPair`. For the same example\n * given above, the regex produced here would look like:\n * /(\\bfi dne\\b)|(\\bdne\\b)|(\\bfi\\b)/\n */\nfunction getReversedRegexForBracketPair(open: string[], close: string[], brackets: InternalBracket[], currentIndex: number): RegExp {\n\t// search in all brackets for other brackets that are a superstring of these brackets\n\tlet pieces: string[] = [];\n\tpieces = pieces.concat(open);\n\tpieces = pieces.concat(close);\n\tfor (let i = 0, len = pieces.length; i < len; i++) {\n\t\tcollectSuperstrings(pieces[i], brackets, currentIndex, pieces);\n\t}\n\tpieces = unique(pieces);\n\tpieces.sort(lengthcmp);\n\tpieces.reverse();\n\treturn createBracketOrRegExp(pieces.map(toReversedString));\n}\n\n/**\n * Creates a regular expression that targets all bracket pairs.\n *\n * e.g. for the bracket pairs:\n * ['{','}']\n * ['begin,'end']\n * ['for','end']\n * the regex would look like:\n * /(\\{)|(\\})|(\\bbegin\\b)|(\\bend\\b)|(\\bfor\\b)/\n */\nfunction getRegexForBrackets(brackets: RichEditBracket[]): RegExp {\n\tlet pieces: string[] = [];\n\tfor (const bracket of brackets) {\n\t\tfor (const open of bracket.open) {\n\t\t\tpieces.push(open);\n\t\t}\n\t\tfor (const close of bracket.close) {\n\t\t\tpieces.push(close);\n\t\t}\n\t}\n\tpieces = unique(pieces);\n\treturn createBracketOrRegExp(pieces);\n}\n\n/**\n * Matching a regular expression in JS can only be done \"forwards\". So JS offers natively only\n * methods to find the first match of a regex in a string. But sometimes, it is useful to\n * find the last match of a regex in a string. For such a situation, a nice solution is to\n * simply reverse the string and then search for a reversed regex.\n *\n * e.g. for the bracket pairs:\n * ['{','}']\n * ['begin,'end']\n * ['for','end']\n * the regex would look like:\n * /(\\{)|(\\})|(\\bnigeb\\b)|(\\bdne\\b)|(\\brof\\b)/\n */\nfunction getReversedRegexForBrackets(brackets: RichEditBracket[]): RegExp {\n\tlet pieces: string[] = [];\n\tfor (const bracket of brackets) {\n\t\tfor (const open of bracket.open) {\n\t\t\tpieces.push(open);\n\t\t}\n\t\tfor (const close of bracket.close) {\n\t\t\tpieces.push(close);\n\t\t}\n\t}\n\tpieces = unique(pieces);\n\treturn createBracketOrRegExp(pieces.map(toReversedString));\n}\n\nfunction prepareBracketForRegExp(str: string): string {\n\t// This bracket pair uses letters like e.g. \"begin\" - \"end\"\n\tconst insertWordBoundaries = (/^[\\w ]+$/.test(str));\n\tstr = strings.escapeRegExpCharacters(str);\n\treturn (insertWordBoundaries ? `\\\\b${str}\\\\b` : str);\n}\n\nfunction createBracketOrRegExp(pieces: string[]): RegExp {\n\tconst regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`;\n\treturn strings.createRegExp(regexStr, true);\n}\n\nconst toReversedString = (function () {\n\n\tfunction reverse(str: string): string {\n\t\tif (stringBuilder.hasTextDecoder) {\n\t\t\t// create a Uint16Array and then use a TextDecoder to create a string\n\t\t\tconst arr = new Uint16Array(str.length);\n\t\t\tlet offset = 0;\n\t\t\tfor (let i = str.length - 1; i >= 0; i--) {\n\t\t\t\tarr[offset++] = str.charCodeAt(i);\n\t\t\t}\n\t\t\treturn stringBuilder.getPlatformTextDecoder().decode(arr);\n\t\t} else {\n\t\t\tconst result: string[] = [];\n\t\t\tlet resultLen = 0;\n\t\t\tfor (let i = str.length - 1; i >= 0; i--) {\n\t\t\t\tresult[resultLen++] = str.charAt(i);\n\t\t\t}\n\t\t\treturn result.join('');\n\t\t}\n\t}\n\n\tlet lastInput: string | null = null;\n\tlet lastOutput: string | null = null;\n\treturn function toReversedString(str: string): string {\n\t\tif (lastInput !== str) {\n\t\t\tlastInput = str;\n\t\t\tlastOutput = reverse(lastInput);\n\t\t}\n\t\treturn lastOutput!;\n\t};\n})();\n\nexport class BracketsUtils {\n\n\tprivate static _findPrevBracketInText(reversedBracketRegex: RegExp, lineNumber: number, reversedText: string, offset: number): Range | null {\n\t\tconst m = reversedText.match(reversedBracketRegex);\n\n\t\tif (!m) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst matchOffset = reversedText.length - (m.index || 0);\n\t\tconst matchLength = m[0].length;\n\t\tconst absoluteMatchOffset = offset + matchOffset;\n\n\t\treturn new Range(lineNumber, absoluteMatchOffset - matchLength + 1, lineNumber, absoluteMatchOffset + 1);\n\t}\n\n\tpublic static findPrevBracketInRange(reversedBracketRegex: RegExp, lineNumber: number, lineText: string, startOffset: number, endOffset: number): Range | null {\n\t\t// Because JS does not support backwards regex search, we search forwards in a reversed string with a reversed regex ;)\n\t\tconst reversedLineText = toReversedString(lineText);\n\t\tconst reversedSubstr = reversedLineText.substring(lineText.length - endOffset, lineText.length - startOffset);\n\t\treturn this._findPrevBracketInText(reversedBracketRegex, lineNumber, reversedSubstr, startOffset);\n\t}\n\n\tpublic static findNextBracketInText(bracketRegex: RegExp, lineNumber: number, text: string, offset: number): Range | null {\n\t\tconst m = text.match(bracketRegex);\n\n\t\tif (!m) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst matchOffset = m.index || 0;\n\t\tconst matchLength = m[0].length;\n\t\tif (matchLength === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst absoluteMatchOffset = offset + matchOffset;\n\n\t\treturn new Range(lineNumber, absoluteMatchOffset + 1, lineNumber, absoluteMatchOffset + 1 + matchLength);\n\t}\n\n\tpublic static findNextBracketInRange(bracketRegex: RegExp, lineNumber: number, lineText: string, startOffset: number, endOffset: number): Range | null {\n\t\tconst substr = lineText.substring(startOffset, endOffset);\n\t\treturn this.findNextBracketInText(bracketRegex, lineNumber, substr, startOffset);\n\t}\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 { distinct } from 'vs/base/common/arrays';\nimport { ScopedLineTokens, ignoreBracketsInToken } from 'vs/editor/common/languages/supports';\nimport { BracketsUtils, RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets';\n\n/**\n * Interface used to support electric characters\n * @internal\n */\nexport interface IElectricAction {\n\t// The line will be indented at the same level of the line\n\t// which contains the matching given bracket type.\n\tmatchOpenBracket: string;\n}\n\nexport class BracketElectricCharacterSupport {\n\n\tprivate readonly _richEditBrackets: RichEditBrackets | null;\n\n\tconstructor(richEditBrackets: RichEditBrackets | null) {\n\t\tthis._richEditBrackets = richEditBrackets;\n\t}\n\n\tpublic getElectricCharacters(): string[] {\n\t\tconst result: string[] = [];\n\n\t\tif (this._richEditBrackets) {\n\t\t\tfor (const bracket of this._richEditBrackets.brackets) {\n\t\t\t\tfor (const close of bracket.close) {\n\t\t\t\t\tconst lastChar = close.charAt(close.length - 1);\n\t\t\t\t\tresult.push(lastChar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn distinct(result);\n\t}\n\n\tpublic onElectricCharacter(character: string, context: ScopedLineTokens, column: number): IElectricAction | null {\n\t\tif (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst tokenIndex = context.findTokenIndexAtOffset(column - 1);\n\t\tif (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst reversedBracketRegex = this._richEditBrackets.reversedRegex;\n\t\tconst text = context.getLineContent().substring(0, column - 1) + character;\n\n\t\tconst r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length);\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst bracketText = text.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();\n\n\t\tconst isOpen = this._richEditBrackets.textIsOpenBracket[bracketText];\n\t\tif (isOpen) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1);\n\t\tif (!/^\\s*$/.test(textBeforeBracket)) {\n\t\t\t// There is other text on the line before the bracket\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tmatchOpenBracket: bracketText\n\t\t};\n\t}\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 { Color } from 'vs/base/common/color';\nimport { ColorId, FontStyle, LanguageId, MetadataConsts, StandardTokenType } from 'vs/editor/common/languages';\n\nexport interface ITokenThemeRule {\n\ttoken: string;\n\tforeground?: string;\n\tbackground?: string;\n\tfontStyle?: string;\n}\n\nexport class ParsedTokenThemeRule {\n\t_parsedThemeRuleBrand: void = undefined;\n\n\treadonly token: string;\n\treadonly index: number;\n\n\t/**\n\t * -1 if not set. An or mask of `FontStyle` otherwise.\n\t */\n\treadonly fontStyle: FontStyle;\n\treadonly foreground: string | null;\n\treadonly background: string | null;\n\n\tconstructor(\n\t\ttoken: string,\n\t\tindex: number,\n\t\tfontStyle: number,\n\t\tforeground: string | null,\n\t\tbackground: string | null,\n\t) {\n\t\tthis.token = token;\n\t\tthis.index = index;\n\t\tthis.fontStyle = fontStyle;\n\t\tthis.foreground = foreground;\n\t\tthis.background = background;\n\t}\n}\n\n/**\n * Parse a raw theme into rules.\n */\nexport function parseTokenTheme(source: ITokenThemeRule[]): ParsedTokenThemeRule[] {\n\tif (!source || !Array.isArray(source)) {\n\t\treturn [];\n\t}\n\tconst result: ParsedTokenThemeRule[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tconst entry = source[i];\n\n\t\tlet fontStyle: number = FontStyle.NotSet;\n\t\tif (typeof entry.fontStyle === 'string') {\n\t\t\tfontStyle = FontStyle.None;\n\n\t\t\tconst segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\tswitch (segment) {\n\t\t\t\t\tcase 'italic':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Italic;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bold':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Bold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'underline':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Underline;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strikethrough':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Strikethrough;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet foreground: string | null = null;\n\t\tif (typeof entry.foreground === 'string') {\n\t\t\tforeground = entry.foreground;\n\t\t}\n\n\t\tlet background: string | null = null;\n\t\tif (typeof entry.background === 'string') {\n\t\t\tbackground = entry.background;\n\t\t}\n\n\t\tresult[resultLen++] = new ParsedTokenThemeRule(\n\t\t\tentry.token || '',\n\t\t\ti,\n\t\t\tfontStyle,\n\t\t\tforeground,\n\t\t\tbackground\n\t\t);\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedTokenThemeRules(parsedThemeRules: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\n\t// Sort rules lexicographically, and then by index if necessary\n\tparsedThemeRules.sort((a, b) => {\n\t\tconst r = strcmp(a.token, b.token);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\t\treturn a.index - b.index;\n\t});\n\n\t// Determine defaults\n\tlet defaultFontStyle = FontStyle.None;\n\tlet defaultForeground = '000000';\n\tlet defaultBackground = 'ffffff';\n\twhile (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') {\n\t\tconst incomingDefaults = parsedThemeRules.shift()!;\n\t\tif (incomingDefaults.fontStyle !== FontStyle.NotSet) {\n\t\t\tdefaultFontStyle = incomingDefaults.fontStyle;\n\t\t}\n\t\tif (incomingDefaults.foreground !== null) {\n\t\t\tdefaultForeground = incomingDefaults.foreground;\n\t\t}\n\t\tif (incomingDefaults.background !== null) {\n\t\t\tdefaultBackground = incomingDefaults.background;\n\t\t}\n\t}\n\tconst colorMap = new ColorMap();\n\n\t// start with token colors from custom token themes\n\tfor (let color of customTokenColors) {\n\t\tcolorMap.getId(color);\n\t}\n\n\n\tconst foregroundColorId = colorMap.getId(defaultForeground);\n\tconst backgroundColorId = colorMap.getId(defaultBackground);\n\n\tconst defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tconst root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tconst rule = parsedThemeRules[i];\n\t\troot.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n\t}\n\n\treturn new TokenTheme(colorMap, root);\n}\n\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\nexport class ColorMap {\n\n\tprivate _lastColorId: number;\n\tprivate readonly _id2color: Color[];\n\tprivate readonly _color2id: Map<string, ColorId>;\n\n\tconstructor() {\n\t\tthis._lastColorId = 0;\n\t\tthis._id2color = [];\n\t\tthis._color2id = new Map<string, ColorId>();\n\t}\n\n\tpublic getId(color: string | null): ColorId {\n\t\tif (color === null) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst match = color.match(colorRegExp);\n\t\tif (!match) {\n\t\t\tthrow new Error('Illegal value for token color: ' + color);\n\t\t}\n\t\tcolor = match[1].toUpperCase();\n\t\tlet value = this._color2id.get(color);\n\t\tif (value) {\n\t\t\treturn value;\n\t\t}\n\t\tvalue = ++this._lastColorId;\n\t\tthis._color2id.set(color, value);\n\t\tthis._id2color[value] = Color.fromHex('#' + color);\n\t\treturn value;\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._id2color.slice(0);\n\t}\n\n}\n\nexport class TokenTheme {\n\n\tpublic static createFromRawTokenTheme(source: ITokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors);\n\t}\n\n\tpublic static createFromParsedTokenTheme(source: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn resolveParsedTokenThemeRules(source, customTokenColors);\n\t}\n\n\tprivate readonly _colorMap: ColorMap;\n\tprivate readonly _root: ThemeTrieElement;\n\tprivate readonly _cache: Map<string, number>;\n\n\tconstructor(colorMap: ColorMap, root: ThemeTrieElement) {\n\t\tthis._colorMap = colorMap;\n\t\tthis._root = root;\n\t\tthis._cache = new Map<string, number>();\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._colorMap.getColorMap();\n\t}\n\n\tpublic _match(token: string): ThemeTrieElementRule {\n\t\treturn this._root.match(token);\n\t}\n\n\tpublic match(languageId: LanguageId, token: string): number {\n\t\t// The cache contains the metadata without the language bits set.\n\t\tlet result = this._cache.get(token);\n\t\tif (typeof result === 'undefined') {\n\t\t\tconst rule = this._match(token);\n\t\t\tconst standardToken = toStandardTokenType(token);\n\t\t\tresult = (\n\t\t\t\trule.metadata\n\t\t\t\t| (standardToken << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t\t) >>> 0;\n\t\t\tthis._cache.set(token, result);\n\t\t}\n\n\t\treturn (\n\t\t\tresult\n\t\t\t| (languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nconst STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|regexp)\\b/;\nexport function toStandardTokenType(tokenType: string): StandardTokenType {\n\tconst m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP);\n\tif (!m) {\n\t\treturn StandardTokenType.Other;\n\t}\n\tswitch (m[1]) {\n\t\tcase 'comment':\n\t\t\treturn StandardTokenType.Comment;\n\t\tcase 'string':\n\t\t\treturn StandardTokenType.String;\n\t\tcase 'regex':\n\t\t\treturn StandardTokenType.RegEx;\n\t\tcase 'regexp':\n\t\t\treturn StandardTokenType.RegEx;\n\t}\n\tthrow new Error('Unexpected match for standard token type!');\n}\n\nexport function strcmp(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport class ThemeTrieElementRule {\n\t_themeTrieElementRuleBrand: void = undefined;\n\n\tprivate _fontStyle: FontStyle;\n\tprivate _foreground: ColorId;\n\tprivate _background: ColorId;\n\tpublic metadata: number;\n\n\tconstructor(fontStyle: FontStyle, foreground: ColorId, background: ColorId) {\n\t\tthis._fontStyle = fontStyle;\n\t\tthis._foreground = foreground;\n\t\tthis._background = background;\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n\n\tpublic clone(): ThemeTrieElementRule {\n\t\treturn new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background);\n\t}\n\n\tpublic acceptOverwrite(fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (fontStyle !== FontStyle.NotSet) {\n\t\t\tthis._fontStyle = fontStyle;\n\t\t}\n\t\tif (foreground !== ColorId.None) {\n\t\t\tthis._foreground = foreground;\n\t\t}\n\t\tif (background !== ColorId.None) {\n\t\t\tthis._background = background;\n\t\t}\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nexport class ThemeTrieElement {\n\t_themeTrieElementBrand: void = undefined;\n\n\tprivate readonly _mainRule: ThemeTrieElementRule;\n\tprivate readonly _children: Map<string, ThemeTrieElement>;\n\n\tconstructor(mainRule: ThemeTrieElementRule) {\n\t\tthis._mainRule = mainRule;\n\t\tthis._children = new Map<string, ThemeTrieElement>();\n\t}\n\n\tpublic match(token: string): ThemeTrieElementRule {\n\t\tif (token === '') {\n\t\t\treturn this._mainRule;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tconst child = this._children.get(head);\n\t\tif (typeof child !== 'undefined') {\n\t\t\treturn child.match(tail);\n\t\t}\n\n\t\treturn this._mainRule;\n\t}\n\n\tpublic insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (token === '') {\n\t\t\t// Merge into the main rule\n\t\t\tthis._mainRule.acceptOverwrite(fontStyle, foreground, background);\n\t\t\treturn;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tlet child = this._children.get(head);\n\t\tif (typeof child === 'undefined') {\n\t\t\tchild = new ThemeTrieElement(this._mainRule.clone());\n\t\t\tthis._children.set(head, child);\n\t\t}\n\n\t\tchild.insert(tail, fontStyle, foreground, background);\n\t}\n}\n\nexport function generateTokensCSSForColorMap(colorMap: readonly Color[]): string {\n\tconst rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tconst color = colorMap[i];\n\t\trules[i] = `.mtk${i} { color: ${color}; }`;\n\t}\n\trules.push('.mtki { font-style: italic; }');\n\trules.push('.mtkb { font-weight: bold; }');\n\trules.push('.mtku { text-decoration: underline; text-underline-position: under; }');\n\trules.push('.mtks { text-decoration: line-through; }');\n\trules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');\n\treturn rules.join('\\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 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IModelContentChange, IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent, ModelInjectedTextChangedEvent, ModelRawContentChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { FormattingOptions, StandardTokenType } from 'vs/editor/common/languages';\nimport { ThemeColor } from 'vs/platform/theme/common/themeService';\nimport { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens';\nimport { TextChange } from 'vs/editor/common/core/textChange';\nimport { equals } from 'vs/base/common/objects';\nimport { IBracketPairsTextModelPart } from 'vs/editor/common/textModelBracketPairs';\nimport { IGuidesTextModelPart } from 'vs/editor/common/textModelGuides';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\n\n/**\n * Vertical Lane in the overview ruler of the editor.\n */\nexport enum OverviewRulerLane {\n\tLeft = 1,\n\tCenter = 2,\n\tRight = 4,\n\tFull = 7\n}\n\n/**\n * Position in the minimap to render the decoration.\n */\nexport enum MinimapPosition {\n\tInline = 1,\n\tGutter = 2\n}\n\nexport interface IDecorationOptions {\n\t/**\n\t * CSS color to render.\n\t * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry\n\t */\n\tcolor: string | ThemeColor | undefined;\n\t/**\n\t * CSS color to render.\n\t * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry\n\t */\n\tdarkColor?: string | ThemeColor;\n}\n\n/**\n * Options for rendering a model decoration in the overview ruler.\n */\nexport interface IModelDecorationOverviewRulerOptions extends IDecorationOptions {\n\t/**\n\t * The position in the overview ruler.\n\t */\n\tposition: OverviewRulerLane;\n}\n\n/**\n * Options for rendering a model decoration in the overview ruler.\n */\nexport interface IModelDecorationMinimapOptions extends IDecorationOptions {\n\t/**\n\t * The position in the overview ruler.\n\t */\n\tposition: MinimapPosition;\n}\n\n/**\n * Options for a model decoration.\n */\nexport interface IModelDecorationOptions {\n\t/**\n\t * A debug description that can be used for inspecting model decorations.\n\t * @internal\n\t */\n\tdescription: string;\n\t/**\n\t * Customize the growing behavior of the decoration when typing at the edges of the decoration.\n\t * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges\n\t */\n\tstickiness?: TrackedRangeStickiness;\n\t/**\n\t * CSS class name describing the decoration.\n\t */\n\tclassName?: string | null;\n\t/**\n\t * Message to be rendered when hovering over the glyph margin decoration.\n\t */\n\tglyphMarginHoverMessage?: IMarkdownString | IMarkdownString[] | null;\n\t/**\n\t * Array of MarkdownString to render as the decoration message.\n\t */\n\thoverMessage?: IMarkdownString | IMarkdownString[] | null;\n\t/**\n\t * Should the decoration expand to encompass a whole line.\n\t */\n\tisWholeLine?: boolean;\n\t/**\n\t * Always render the decoration (even when the range it encompasses is collapsed).\n\t * @internal\n\t */\n\tshowIfCollapsed?: boolean;\n\t/**\n\t * Collapse the decoration if its entire range is being replaced via an edit.\n\t * @internal\n\t */\n\tcollapseOnReplaceEdit?: boolean;\n\t/**\n\t * Specifies the stack order of a decoration.\n\t * A decoration with greater stack order is always in front of a decoration with\n\t * a lower stack order when the decorations are on the same line.\n\t */\n\tzIndex?: number;\n\t/**\n\t * If set, render this decoration in the overview ruler.\n\t */\n\toverviewRuler?: IModelDecorationOverviewRulerOptions | null;\n\t/**\n\t * If set, render this decoration in the minimap.\n\t */\n\tminimap?: IModelDecorationMinimapOptions | null;\n\t/**\n\t * If set, the decoration will be rendered in the glyph margin with this CSS class name.\n\t */\n\tglyphMarginClassName?: string | null;\n\t/**\n\t * If set, the decoration will be rendered in the lines decorations with this CSS class name.\n\t */\n\tlinesDecorationsClassName?: string | null;\n\t/**\n\t * If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.\n\t */\n\tfirstLineDecorationClassName?: string | null;\n\t/**\n\t * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.\n\t */\n\tmarginClassName?: string | null;\n\t/**\n\t * If set, the decoration will be rendered inline with the text with this CSS class name.\n\t * Please use this only for CSS rules that must impact the text. For example, use `className`\n\t * to have a background color decoration.\n\t */\n\tinlineClassName?: string | null;\n\t/**\n\t * If there is an `inlineClassName` which affects letter spacing.\n\t */\n\tinlineClassNameAffectsLetterSpacing?: boolean;\n\t/**\n\t * If set, the decoration will be rendered before the text with this CSS class name.\n\t */\n\tbeforeContentClassName?: string | null;\n\t/**\n\t * If set, the decoration will be rendered after the text with this CSS class name.\n\t */\n\tafterContentClassName?: string | null;\n\t/**\n\t * If set, text will be injected in the view after the range.\n\t */\n\tafter?: InjectedTextOptions | null;\n\n\t/**\n\t * If set, text will be injected in the view before the range.\n\t */\n\tbefore?: InjectedTextOptions | null;\n\n\t/**\n\t * If set, this decoration will not be rendered for comment tokens.\n\t * @internal\n\t*/\n\thideInCommentTokens?: boolean | null;\n\n\t/**\n\t * If set, this decoration will not be rendered for string tokens.\n\t * @internal\n\t*/\n\thideInStringTokens?: boolean | null;\n}\n\n/**\n * Configures text that is injected into the view without changing the underlying document.\n*/\nexport interface InjectedTextOptions {\n\t/**\n\t * Sets the text to inject. Must be a single line.\n\t */\n\treadonly content: string;\n\n\t/**\n\t * If set, the decoration will be rendered inline with the text with this CSS class name.\n\t */\n\treadonly inlineClassName?: string | null;\n\n\t/**\n\t * If there is an `inlineClassName` which affects letter spacing.\n\t */\n\treadonly inlineClassNameAffectsLetterSpacing?: boolean;\n\n\t/**\n\t * This field allows to attach data to this injected text.\n\t * The data can be read when injected texts at a given position are queried.\n\t */\n\treadonly attachedData?: unknown;\n\n\t/**\n\t * Configures cursor stops around injected text.\n\t * Defaults to {@link InjectedTextCursorStops.Both}.\n\t*/\n\treadonly cursorStops?: InjectedTextCursorStops | null;\n}\n\nexport enum InjectedTextCursorStops {\n\tBoth,\n\tRight,\n\tLeft,\n\tNone\n}\n\n/**\n * New model decorations.\n */\nexport interface IModelDeltaDecoration {\n\t/**\n\t * Range that this decoration covers.\n\t */\n\trange: IRange;\n\t/**\n\t * Options associated with this decoration.\n\t */\n\toptions: IModelDecorationOptions;\n}\n\n/**\n * A decoration in the model.\n */\nexport interface IModelDecoration {\n\t/**\n\t * Identifier for a decoration.\n\t */\n\treadonly id: string;\n\t/**\n\t * Identifier for a decoration's owner.\n\t */\n\treadonly ownerId: number;\n\t/**\n\t * Range that this decoration covers.\n\t */\n\treadonly range: Range;\n\t/**\n\t * Options associated with this decoration.\n\t */\n\treadonly options: IModelDecorationOptions;\n}\n\n/**\n * An accessor that can add, change or remove model decorations.\n * @internal\n */\nexport interface IModelDecorationsChangeAccessor {\n\t/**\n\t * Add a new decoration.\n\t * @param range Range that this decoration covers.\n\t * @param options Options associated with this decoration.\n\t * @return An unique identifier associated with this decoration.\n\t */\n\taddDecoration(range: IRange, options: IModelDecorationOptions): string;\n\t/**\n\t * Change the range that an existing decoration covers.\n\t * @param id The unique identifier associated with the decoration.\n\t * @param newRange The new range that this decoration covers.\n\t */\n\tchangeDecoration(id: string, newRange: IRange): void;\n\t/**\n\t * Change the options associated with an existing decoration.\n\t * @param id The unique identifier associated with the decoration.\n\t * @param newOptions The new options associated with this decoration.\n\t */\n\tchangeDecorationOptions(id: string, newOptions: IModelDecorationOptions): void;\n\t/**\n\t * Remove an existing decoration.\n\t * @param id The unique identifier associated with the decoration.\n\t */\n\tremoveDecoration(id: string): void;\n\t/**\n\t * Perform a minimum amount of operations, in order to transform the decorations\n\t * identified by `oldDecorations` to the decorations described by `newDecorations`\n\t * and returns the new identifiers associated with the resulting decorations.\n\t *\n\t * @param oldDecorations Array containing previous decorations identifiers.\n\t * @param newDecorations Array describing what decorations should result after the call.\n\t * @return An array containing the new decorations identifiers.\n\t */\n\tdeltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];\n}\n\n/**\n * End of line character preference.\n */\nexport const enum EndOfLinePreference {\n\t/**\n\t * Use the end of line character identified in the text buffer.\n\t */\n\tTextDefined = 0,\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 1,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 2\n}\n\n/**\n * The default end of line to use when instantiating models.\n */\nexport const enum DefaultEndOfLine {\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 1,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 2\n}\n\n/**\n * End of line character preference.\n */\nexport const enum EndOfLineSequence {\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 0,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 1\n}\n\n/**\n * An identifier for a single edit operation.\n * @internal\n */\nexport interface ISingleEditOperationIdentifier {\n\t/**\n\t * Identifier major\n\t */\n\tmajor: number;\n\t/**\n\t * Identifier minor\n\t */\n\tminor: number;\n}\n\n/**\n * A single edit operation, that has an identifier.\n */\nexport interface IIdentifiedSingleEditOperation extends ISingleEditOperation {\n\t/**\n\t * An identifier associated with this single edit operation.\n\t * @internal\n\t */\n\tidentifier?: ISingleEditOperationIdentifier | null;\n\t/**\n\t * This indicates that this operation is inserting automatic whitespace\n\t * that can be removed on next model edit operation if `config.trimAutoWhitespace` is true.\n\t * @internal\n\t */\n\tisAutoWhitespaceEdit?: boolean;\n\t/**\n\t * This indicates that this operation is in a set of operations that are tracked and should not be \"simplified\".\n\t * @internal\n\t */\n\t_isTracked?: boolean;\n}\n\nexport interface IValidEditOperation {\n\t/**\n\t * An identifier associated with this single edit operation.\n\t * @internal\n\t */\n\tidentifier: ISingleEditOperationIdentifier | null;\n\t/**\n\t * The range to replace. This can be empty to emulate a simple insert.\n\t */\n\trange: Range;\n\t/**\n\t * The text to replace with. This can be empty to emulate a simple delete.\n\t */\n\ttext: string;\n\t/**\n\t * @internal\n\t */\n\ttextChange: TextChange;\n}\n\n/**\n * A callback that can compute the cursor state after applying a series of edit operations.\n */\nexport interface ICursorStateComputer {\n\t/**\n\t * A callback that can compute the resulting cursors state after some edit operations have been executed.\n\t */\n\t(inverseEditOperations: IValidEditOperation[]): Selection[] | null;\n}\n\nexport class TextModelResolvedOptions {\n\t_textModelResolvedOptionsBrand: void = undefined;\n\n\treadonly tabSize: number;\n\treadonly indentSize: number;\n\treadonly insertSpaces: boolean;\n\treadonly defaultEOL: DefaultEndOfLine;\n\treadonly trimAutoWhitespace: boolean;\n\treadonly bracketPairColorizationOptions: BracketPairColorizationOptions;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(src: {\n\t\ttabSize: number;\n\t\tindentSize: number;\n\t\tinsertSpaces: boolean;\n\t\tdefaultEOL: DefaultEndOfLine;\n\t\ttrimAutoWhitespace: boolean;\n\t\tbracketPairColorizationOptions: BracketPairColorizationOptions;\n\t}) {\n\t\tthis.tabSize = Math.max(1, src.tabSize | 0);\n\t\tthis.indentSize = src.tabSize | 0;\n\t\tthis.insertSpaces = Boolean(src.insertSpaces);\n\t\tthis.defaultEOL = src.defaultEOL | 0;\n\t\tthis.trimAutoWhitespace = Boolean(src.trimAutoWhitespace);\n\t\tthis.bracketPairColorizationOptions = src.bracketPairColorizationOptions;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: TextModelResolvedOptions): boolean {\n\t\treturn (\n\t\t\tthis.tabSize === other.tabSize\n\t\t\t&& this.indentSize === other.indentSize\n\t\t\t&& this.insertSpaces === other.insertSpaces\n\t\t\t&& this.defaultEOL === other.defaultEOL\n\t\t\t&& this.trimAutoWhitespace === other.trimAutoWhitespace\n\t\t\t&& equals(this.bracketPairColorizationOptions, other.bracketPairColorizationOptions)\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic createChangeEvent(newOpts: TextModelResolvedOptions): IModelOptionsChangedEvent {\n\t\treturn {\n\t\t\ttabSize: this.tabSize !== newOpts.tabSize,\n\t\t\tindentSize: this.indentSize !== newOpts.indentSize,\n\t\t\tinsertSpaces: this.insertSpaces !== newOpts.insertSpaces,\n\t\t\ttrimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace,\n\t\t};\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ITextModelCreationOptions {\n\ttabSize: number;\n\tindentSize: number;\n\tinsertSpaces: boolean;\n\tdetectIndentation: boolean;\n\ttrimAutoWhitespace: boolean;\n\tdefaultEOL: DefaultEndOfLine;\n\tisForSimpleWidget: boolean;\n\tlargeFileOptimizations: boolean;\n\tbracketPairColorizationOptions: BracketPairColorizationOptions;\n}\n\nexport interface BracketPairColorizationOptions {\n\tenabled: boolean;\n}\n\nexport interface ITextModelUpdateOptions {\n\ttabSize?: number;\n\tindentSize?: number;\n\tinsertSpaces?: boolean;\n\ttrimAutoWhitespace?: boolean;\n\tbracketColorizationOptions?: BracketPairColorizationOptions;\n}\n\nexport class FindMatch {\n\t_findMatchBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly matches: string[] | null;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(range: Range, matches: string[] | null) {\n\t\tthis.range = range;\n\t\tthis.matches = matches;\n\t}\n}\n\n/**\n * Describes the behavior of decorations when typing/editing near their edges.\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\n */\nexport const enum TrackedRangeStickiness {\n\tAlwaysGrowsWhenTypingAtEdges = 0,\n\tNeverGrowsWhenTypingAtEdges = 1,\n\tGrowsOnlyWhenTypingBefore = 2,\n\tGrowsOnlyWhenTypingAfter = 3,\n}\n\n/**\n * Text snapshot that works like an iterator.\n * Will try to return chunks of roughly ~64KB size.\n * Will return null when finished.\n *\n * @internal\n */\nexport interface ITextSnapshot {\n\tread(): string | null;\n}\n\n/**\n * A model.\n */\nexport interface ITextModel {\n\n\t/**\n\t * Gets the resource associated with this editor model.\n\t */\n\treadonly uri: URI;\n\n\t/**\n\t * A unique identifier associated with this model.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * This model is constructed for a simple widget code editor.\n\t * @internal\n\t */\n\treadonly isForSimpleWidget: boolean;\n\n\t/**\n\t * If true, the text model might contain RTL.\n\t * If false, the text model **contains only** contain LTR.\n\t * @internal\n\t */\n\tmightContainRTL(): boolean;\n\n\t/**\n\t * If true, the text model might contain LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).\n\t * If false, the text model definitely does not contain these.\n\t * @internal\n\t */\n\tmightContainUnusualLineTerminators(): boolean;\n\n\t/**\n\t * @internal\n\t */\n\tremoveUnusualLineTerminators(selections?: Selection[]): void;\n\n\t/**\n\t * If true, the text model might contain non basic ASCII.\n\t * If false, the text model **contains only** basic ASCII.\n\t * @internal\n\t */\n\tmightContainNonBasicASCII(): boolean;\n\n\t/**\n\t * Get the resolved options for this model.\n\t */\n\tgetOptions(): TextModelResolvedOptions;\n\n\t/**\n\t * Get the formatting options for this model.\n\t * @internal\n\t */\n\tgetFormattingOptions(): FormattingOptions;\n\n\t/**\n\t * Get the current version id of the model.\n\t * Anytime a change happens to the model (even undo/redo),\n\t * the version id is incremented.\n\t */\n\tgetVersionId(): number;\n\n\t/**\n\t * Get the alternative version id of the model.\n\t * This alternative version id is not always incremented,\n\t * it will return the same values in the case of undo-redo.\n\t */\n\tgetAlternativeVersionId(): number;\n\n\t/**\n\t * Replace the entire text buffer value contained in this model.\n\t */\n\tsetValue(newValue: string): void;\n\n\t/**\n\t * Get the text stored in this model.\n\t * @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.\n\t * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed.\n\t * @return The text.\n\t */\n\tgetValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;\n\n\t/**\n\t * Get the text stored in this model.\n\t * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed.\n\t * @return The text snapshot (it is safe to consume it asynchronously).\n\t * @internal\n\t */\n\tcreateSnapshot(preserveBOM?: boolean): ITextSnapshot;\n\n\t/**\n\t * Get the length of the text stored in this model.\n\t */\n\tgetValueLength(eol?: EndOfLinePreference, preserveBOM?: boolean): number;\n\n\t/**\n\t * Get the text in a certain range.\n\t * @param range The range describing what text to get.\n\t * @param eol The end of line character preference. This will only be used for multiline ranges. Defaults to `EndOfLinePreference.TextDefined`.\n\t * @return The text.\n\t */\n\tgetValueInRange(range: IRange, eol?: EndOfLinePreference): string;\n\n\t/**\n\t * Get the length of text in a certain range.\n\t * @param range The range describing what text length to get.\n\t * @return The text length.\n\t */\n\tgetValueLengthInRange(range: IRange): number;\n\n\t/**\n\t * Get the character count of text in a certain range.\n\t * @param range The range describing what text length to get.\n\t */\n\tgetCharacterCountInRange(range: IRange): number;\n\n\t/**\n\t * Splits characters in two buckets. First bucket (A) is of characters that\n\t * sit in lines with length < `LONG_LINE_BOUNDARY`. Second bucket (B) is of\n\t * characters that sit in lines with length >= `LONG_LINE_BOUNDARY`.\n\t * If count(B) > count(A) return true. Returns false otherwise.\n\t * @internal\n\t */\n\tisDominatedByLongLines(): boolean;\n\n\t/**\n\t * Get the number of lines in the model.\n\t */\n\tgetLineCount(): number;\n\n\t/**\n\t * Get the text for a certain line.\n\t */\n\tgetLineContent(lineNumber: number): string;\n\n\t/**\n\t * Get the text length for a certain line.\n\t */\n\tgetLineLength(lineNumber: number): number;\n\n\t/**\n\t * Get the text for all lines.\n\t */\n\tgetLinesContent(): string[];\n\n\t/**\n\t * Get the end of line sequence predominantly used in the text buffer.\n\t * @return EOL char sequence (e.g.: '\\n' or '\\r\\n').\n\t */\n\tgetEOL(): string;\n\n\t/**\n\t * Get the end of line sequence predominantly used in the text buffer.\n\t */\n\tgetEndOfLineSequence(): EndOfLineSequence;\n\n\t/**\n\t * Get the minimum legal column for line at `lineNumber`\n\t */\n\tgetLineMinColumn(lineNumber: number): number;\n\n\t/**\n\t * Get the maximum legal column for line at `lineNumber`\n\t */\n\tgetLineMaxColumn(lineNumber: number): number;\n\n\t/**\n\t * Returns the column before the first non whitespace character for line at `lineNumber`.\n\t * Returns 0 if line is empty or contains only whitespace.\n\t */\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\n\t/**\n\t * Returns the column after the last non whitespace character for line at `lineNumber`.\n\t * Returns 0 if line is empty or contains only whitespace.\n\t */\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\n\t/**\n\t * Create a valid position.\n\t */\n\tvalidatePosition(position: IPosition): Position;\n\n\t/**\n\t * Advances the given position by the given offset (negative offsets are also accepted)\n\t * and returns it as a new valid position.\n\t *\n\t * If the offset and position are such that their combination goes beyond the beginning or\n\t * end of the model, throws an exception.\n\t *\n\t * If the offset is such that the new position would be in the middle of a multi-byte\n\t * line terminator, throws an exception.\n\t */\n\tmodifyPosition(position: IPosition, offset: number): Position;\n\n\t/**\n\t * Create a valid range.\n\t */\n\tvalidateRange(range: IRange): Range;\n\n\t/**\n\t * Converts the position to a zero-based offset.\n\t *\n\t * The position will be [adjusted](#TextDocument.validatePosition).\n\t *\n\t * @param position A position.\n\t * @return A valid zero-based offset.\n\t */\n\tgetOffsetAt(position: IPosition): number;\n\n\t/**\n\t * Converts a zero-based offset to a position.\n\t *\n\t * @param offset A zero-based offset.\n\t * @return A valid [position](#Position).\n\t */\n\tgetPositionAt(offset: number): Position;\n\n\t/**\n\t * Get a range covering the entire model.\n\t */\n\tgetFullModelRange(): Range;\n\n\t/**\n\t * Returns if the model was disposed or not.\n\t */\n\tisDisposed(): boolean;\n\n\t/**\n\t * @internal\n\t */\n\ttokenizeViewport(startLineNumber: number, endLineNumber: number): void;\n\n\t/**\n\t * This model is so large that it would not be a good idea to sync it over\n\t * to web workers or other places.\n\t * @internal\n\t */\n\tisTooLargeForSyncing(): boolean;\n\n\t/**\n\t * The file is so large, that even tokenization is disabled.\n\t * @internal\n\t */\n\tisTooLargeForTokenization(): boolean;\n\n\t/**\n\t * Search the model.\n\t * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.\n\t * @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model.\n\t * @param isRegex Used to indicate that `searchString` is a regular expression.\n\t * @param matchCase Force the matching to match lower/upper case exactly.\n\t * @param wordSeparators Force the matching to match entire words only. Pass null otherwise.\n\t * @param captureMatches The result will contain the captured groups.\n\t * @param limitResultCount Limit the number of results\n\t * @return The ranges where the matches are. It is empty if not matches have been found.\n\t */\n\tfindMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];\n\t/**\n\t * Search the model.\n\t * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.\n\t * @param searchScope Limit the searching to only search inside these ranges.\n\t * @param isRegex Used to indicate that `searchString` is a regular expression.\n\t * @param matchCase Force the matching to match lower/upper case exactly.\n\t * @param wordSeparators Force the matching to match entire words only. Pass null otherwise.\n\t * @param captureMatches The result will contain the captured groups.\n\t * @param limitResultCount Limit the number of results\n\t * @return The ranges where the matches are. It is empty if no matches have been found.\n\t */\n\tfindMatches(searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];\n\t/**\n\t * Search the model for the next match. Loops to the beginning of the model if needed.\n\t * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.\n\t * @param searchStart Start the searching at the specified position.\n\t * @param isRegex Used to indicate that `searchString` is a regular expression.\n\t * @param matchCase Force the matching to match lower/upper case exactly.\n\t * @param wordSeparators Force the matching to match entire words only. Pass null otherwise.\n\t * @param captureMatches The result will contain the captured groups.\n\t * @return The range where the next match is. It is null if no next match has been found.\n\t */\n\tfindNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch | null;\n\t/**\n\t * Search the model for the previous match. Loops to the end of the model if needed.\n\t * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.\n\t * @param searchStart Start the searching at the specified position.\n\t * @param isRegex Used to indicate that `searchString` is a regular expression.\n\t * @param matchCase Force the matching to match lower/upper case exactly.\n\t * @param wordSeparators Force the matching to match entire words only. Pass null otherwise.\n\t * @param captureMatches The result will contain the captured groups.\n\t * @return The range where the previous match is. It is null if no previous match has been found.\n\t */\n\tfindPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch | null;\n\n\t/**\n\t * @internal\n\t */\n\tsetSemanticTokens(tokens: SparseMultilineTokens[] | null, isComplete: boolean): void;\n\n\t/**\n\t * @internal\n\t */\n\tsetPartialSemanticTokens(range: Range, tokens: SparseMultilineTokens[] | null): void;\n\n\t/**\n\t * @internal\n\t */\n\thasCompleteSemanticTokens(): boolean;\n\n\t/**\n\t * @internal\n\t */\n\thasSomeSemanticTokens(): boolean;\n\n\t/**\n\t * Flush all tokenization state.\n\t * @internal\n\t */\n\tresetTokenization(): void;\n\n\t/**\n\t * Force tokenization information for `lineNumber` to be accurate.\n\t * @internal\n\t */\n\tforceTokenization(lineNumber: number): void;\n\n\t/**\n\t * If it is cheap, force tokenization information for `lineNumber` to be accurate.\n\t * This is based on a heuristic.\n\t * @internal\n\t */\n\ttokenizeIfCheap(lineNumber: number): void;\n\n\t/**\n\t * Check if calling `forceTokenization` for this `lineNumber` will be cheap (time-wise).\n\t * This is based on a heuristic.\n\t * @internal\n\t */\n\tisCheapToTokenize(lineNumber: number): boolean;\n\n\t/**\n\t * Get the tokens for the line `lineNumber`.\n\t * The tokens might be inaccurate. Use `forceTokenization` to ensure accurate tokens.\n\t * @internal\n\t */\n\tgetLineTokens(lineNumber: number): LineTokens;\n\n\t/**\n\t * Get the language associated with this model.\n\t */\n\tgetLanguageId(): string;\n\n\t/**\n\t * Returns the real (inner-most) language mode at a given position.\n\t * The result might be inaccurate. Use `forceTokenization` to ensure accurate tokens.\n\t * @internal\n\t */\n\tgetLanguageIdAtPosition(lineNumber: number, column: number): string;\n\n\t/**\n\t * Returns the standard token type for a character if the character were to be inserted at\n\t * the given position. If the result cannot be accurate, it returns null.\n\t * @internal\n\t */\n\tgetTokenTypeIfInsertingCharacter(lineNumber: number, column: number, character: string): StandardTokenType;\n\n\t/**\n\t * @internal\n\t*/\n\ttokenizeLineWithEdit(position: IPosition, length: number, newText: string): LineTokens | null;\n\n\t/**\n\t * Get the word under or besides `position`.\n\t * @param position The position to look for a word.\n\t * @return The word under or besides `position`. Might be null.\n\t */\n\tgetWordAtPosition(position: IPosition): IWordAtPosition | null;\n\n\t/**\n\t * Get the word under or besides `position` trimmed to `position`.column\n\t * @param position The position to look for a word.\n\t * @return The word under or besides `position`. Will never be null.\n\t */\n\tgetWordUntilPosition(position: IPosition): IWordAtPosition;\n\n\t/**\n\t * Change the decorations. The callback will be called with a change accessor\n\t * that becomes invalid as soon as the callback finishes executing.\n\t * This allows for all events to be queued up until the change\n\t * is completed. Returns whatever the callback returns.\n\t * @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model.\n\t * @internal\n\t */\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T, ownerId?: number): T | null;\n\n\t/**\n\t * Perform a minimum amount of operations, in order to transform the decorations\n\t * identified by `oldDecorations` to the decorations described by `newDecorations`\n\t * and returns the new identifiers associated with the resulting decorations.\n\t *\n\t * @param oldDecorations Array containing previous decorations identifiers.\n\t * @param newDecorations Array describing what decorations should result after the call.\n\t * @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model.\n\t * @return An array containing the new decorations identifiers.\n\t */\n\tdeltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[], ownerId?: number): string[];\n\n\t/**\n\t * Remove all decorations that have been added with this specific ownerId.\n\t * @param ownerId The owner id to search for.\n\t * @internal\n\t */\n\tremoveAllDecorationsWithOwnerId(ownerId: number): void;\n\n\t/**\n\t * Get the options associated with a decoration.\n\t * @param id The decoration id.\n\t * @return The decoration options or null if the decoration was not found.\n\t */\n\tgetDecorationOptions(id: string): IModelDecorationOptions | null;\n\n\t/**\n\t * Get the range associated with a decoration.\n\t * @param id The decoration id.\n\t * @return The decoration range or null if the decoration was not found.\n\t */\n\tgetDecorationRange(id: string): Range | null;\n\n\t/**\n\t * Gets all the decorations for the line `lineNumber` as an array.\n\t * @param lineNumber The line number\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).\n\t * @return An array with the decorations\n\t */\n\tgetLineDecorations(lineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];\n\n\t/**\n\t * Gets all the decorations for the lines between `startLineNumber` and `endLineNumber` as an array.\n\t * @param startLineNumber The start line number\n\t * @param endLineNumber The end line number\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).\n\t * @return An array with the decorations\n\t */\n\tgetLinesDecorations(startLineNumber: number, endLineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];\n\n\t/**\n\t * Gets all the decorations in a range as an array. Only `startLineNumber` and `endLineNumber` from `range` are used for filtering.\n\t * So for now it returns all the decorations on the same line as `range`.\n\t * @param range The range to search in\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).\n\t * @return An array with the decorations\n\t */\n\tgetDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];\n\n\t/**\n\t * Gets all the decorations as an array.\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).\n\t */\n\tgetAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];\n\n\t/**\n\t * Gets all the decorations that should be rendered in the overview ruler as an array.\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).\n\t */\n\tgetOverviewRulerDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];\n\n\t/**\n\t * Gets all the decorations that contain injected text.\n\t * @param ownerId If set, it will ignore decorations belonging to other owners.\n\t */\n\tgetInjectedTextDecorations(ownerId?: number): IModelDecoration[];\n\n\t/**\n\t * @internal\n\t */\n\t_getTrackedRange(id: string): Range | null;\n\n\t/**\n\t * @internal\n\t */\n\t_setTrackedRange(id: string | null, newRange: null, newStickiness: TrackedRangeStickiness): null;\n\t/**\n\t * @internal\n\t */\n\t_setTrackedRange(id: string | null, newRange: Range, newStickiness: TrackedRangeStickiness): string;\n\n\t/**\n\t * Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).\n\t */\n\tnormalizeIndentation(str: string): string;\n\n\t/**\n\t * Change the options of this model.\n\t */\n\tupdateOptions(newOpts: ITextModelUpdateOptions): void;\n\n\t/**\n\t * Detect the indentation options for this model from its content.\n\t */\n\tdetectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void;\n\n\t/**\n\t * Close the current undo-redo element.\n\t * This offers a way to create an undo/redo stop point.\n\t */\n\tpushStackElement(): void;\n\n\t/**\n\t * Open the current undo-redo element.\n\t * This offers a way to remove the current undo/redo stop point.\n\t */\n\tpopStackElement(): void;\n\n\t/**\n\t * Push edit operations, basically editing the model. This is the preferred way\n\t * of editing the model. The edit operations will land on the undo stack.\n\t * @param beforeCursorState The cursor state before the edit operations. This cursor state will be returned when `undo` or `redo` are invoked.\n\t * @param editOperations The edit operations.\n\t * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed.\n\t * @return The cursor state returned by the `cursorStateComputer`.\n\t */\n\tpushEditOperations(beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null;\n\n\t/**\n\t * Change the end of line sequence. This is the preferred way of\n\t * changing the eol sequence. This will land on the undo stack.\n\t */\n\tpushEOL(eol: EndOfLineSequence): void;\n\n\t/**\n\t * Edit the model without adding the edits to the undo stack.\n\t * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way.\n\t * @param operations The edit operations.\n\t * @return If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state.\n\t */\n\tapplyEdits(operations: IIdentifiedSingleEditOperation[]): void;\n\tapplyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false): void;\n\tapplyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true): IValidEditOperation[];\n\n\t/**\n\t * Change the end of line sequence without recording in the undo stack.\n\t * This can have dire consequences on the undo stack! See @pushEOL for the preferred way.\n\t */\n\tsetEOL(eol: EndOfLineSequence): void;\n\n\t/**\n\t * @internal\n\t */\n\t_applyUndo(changes: TextChange[], eol: EndOfLineSequence, resultingAlternativeVersionId: number, resultingSelection: Selection[] | null): void;\n\n\t/**\n\t * @internal\n\t */\n\t_applyRedo(changes: TextChange[], eol: EndOfLineSequence, resultingAlternativeVersionId: number, resultingSelection: Selection[] | null): void;\n\n\t/**\n\t * Undo edit operations until the previous undo/redo point.\n\t * The inverse edit operations will be pushed on the redo stack.\n\t * @internal\n\t */\n\tundo(): void | Promise<void>;\n\n\t/**\n\t * Is there anything in the undo stack?\n\t * @internal\n\t */\n\tcanUndo(): boolean;\n\n\t/**\n\t * Redo edit operations until the next undo/redo point.\n\t * The inverse edit operations will be pushed on the undo stack.\n\t * @internal\n\t */\n\tredo(): void | Promise<void>;\n\n\t/**\n\t * Is there anything in the redo stack?\n\t * @internal\n\t */\n\tcanRedo(): boolean;\n\n\t/**\n\t * @deprecated Please use `onDidChangeContent` instead.\n\t * An event emitted when the contents of the model have changed.\n\t * @internal\n\t * @event\n\t */\n\treadonly onDidChangeContentOrInjectedText: Event<ModelRawContentChangedEvent | ModelInjectedTextChangedEvent>;\n\t/**\n\t * An event emitted when the contents of the model have changed.\n\t * @event\n\t */\n\tonDidChangeContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when decorations of the model have changed.\n\t * @event\n\t */\n\treadonly onDidChangeDecorations: Event<IModelDecorationsChangedEvent>;\n\t/**\n\t * An event emitted when the model options have changed.\n\t * @event\n\t */\n\treadonly onDidChangeOptions: Event<IModelOptionsChangedEvent>;\n\t/**\n\t * An event emitted when the language associated with the model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeLanguage: Event<IModelLanguageChangedEvent>;\n\t/**\n\t * An event emitted when the language configuration associated with the model has changed.\n\t * @event\n\t */\n\treadonly onDidChangeLanguageConfiguration: Event<IModelLanguageConfigurationChangedEvent>;\n\t/**\n\t * An event emitted when the tokens associated with the model have changed.\n\t * @event\n\t * @internal\n\t */\n\treadonly onDidChangeTokens: Event<IModelTokensChangedEvent>;\n\t/**\n\t * An event emitted when the model has been attached to the first editor or detached from the last editor.\n\t * @event\n\t */\n\treadonly onDidChangeAttached: Event<void>;\n\t/**\n\t * An event emitted right before disposing the model.\n\t * @event\n\t */\n\treadonly onWillDispose: Event<void>;\n\n\t/**\n\t * Destroy this model.\n\t */\n\tdispose(): void;\n\n\t/**\n\t * @internal\n\t */\n\tonBeforeAttached(): void;\n\n\t/**\n\t * @internal\n\t */\n\tonBeforeDetached(): void;\n\n\t/**\n\t * Returns if this model is attached to an editor or not.\n\t */\n\tisAttachedToEditor(): boolean;\n\n\t/**\n\t * Returns the count of editors this model is attached to.\n\t * @internal\n\t */\n\tgetAttachedEditorCount(): number;\n\n\t/**\n\t * Among all positions that are projected to the same position in the underlying text model as\n\t * the given position, select a unique position as indicated by the affinity.\n\t *\n\t * PositionAffinity.Left:\n\t * The normalized position must be equal or left to the requested position.\n\t *\n\t * PositionAffinity.Right:\n\t * The normalized position must be equal or right to the requested position.\n\t *\n\t * @internal\n\t */\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t*/\n\tgetLineIndentColumn(lineNumber: number): number;\n\n\t/**\n\t * Returns an object that can be used to query brackets.\n\t * @internal\n\t*/\n\treadonly bracketPairs: IBracketPairsTextModelPart;\n\n\t/**\n\t * Returns an object that can be used to query indent guides.\n\t * @internal\n\t*/\n\treadonly guides: IGuidesTextModelPart;\n}\n\nexport const enum PositionAffinity {\n\t/**\n\t * Prefers the left most position.\n\t*/\n\tLeft = 0,\n\n\t/**\n\t * Prefers the right most position.\n\t*/\n\tRight = 1,\n\n\t/**\n\t * No preference.\n\t*/\n\tNone = 2,\n}\n\n/**\n * @internal\n */\nexport interface ITextBufferBuilder {\n}\n\n/**\n * @internal\n */\nexport interface ITextBufferFactory {\n\tcreate(defaultEOL: DefaultEndOfLine): { textBuffer: ITextBuffer; disposable: IDisposable };\n}\n\n/**\n * @internal\n */\nexport class ValidAnnotatedEditOperation implements IIdentifiedSingleEditOperation {\n\tconstructor(\n\t\tpublic readonly identifier: ISingleEditOperationIdentifier | null,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly text: string | null,\n\t\tpublic readonly forceMoveMarkers: boolean,\n\t\tpublic readonly isAutoWhitespaceEdit: boolean,\n\t\tpublic readonly _isTracked: boolean,\n\t) { }\n}\n\n/**\n * @internal\n */\nexport interface IReadonlyTextBuffer {\n\tmightContainRTL(): boolean;\n\tmightContainUnusualLineTerminators(): boolean;\n\tresetMightContainUnusualLineTerminators(): void;\n\tmightContainNonBasicASCII(): boolean;\n\tgetBOM(): string;\n\tgetEOL(): string;\n\n\tgetOffsetAt(lineNumber: number, column: number): number;\n\tgetPositionAt(offset: number): Position;\n\tgetRangeAt(offset: number, length: number): Range;\n\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\tcreateSnapshot(preserveBOM: boolean): ITextSnapshot;\n\tgetValueLengthInRange(range: Range, eol: EndOfLinePreference): number;\n\tgetCharacterCountInRange(range: Range, eol: EndOfLinePreference): number;\n\tgetLength(): number;\n\tgetLineCount(): number;\n\tgetLinesContent(): string[];\n\tgetLineContent(lineNumber: number): string;\n\tgetLineCharCode(lineNumber: number, index: number): number;\n\tgetLineLength(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tfindMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[];\n}\n\n/**\n * @internal\n */\nexport class SearchData {\n\n\t/**\n\t * The regex to search for. Always defined.\n\t */\n\tpublic readonly regex: RegExp;\n\t/**\n\t * The word separator classifier.\n\t */\n\tpublic readonly wordSeparators: WordCharacterClassifier | null;\n\t/**\n\t * The simple string to search for (if possible).\n\t */\n\tpublic readonly simpleSearch: string | null;\n\n\tconstructor(regex: RegExp, wordSeparators: WordCharacterClassifier | null, simpleSearch: string | null) {\n\t\tthis.regex = regex;\n\t\tthis.wordSeparators = wordSeparators;\n\t\tthis.simpleSearch = simpleSearch;\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ITextBuffer extends IReadonlyTextBuffer {\n\tsetEOL(newEOL: '\\r\\n' | '\\n'): void;\n\tapplyEdits(rawOperations: ValidAnnotatedEditOperation[], recordTrimAutoWhitespace: boolean, computeUndoEdits: boolean): ApplyEditsResult;\n}\n\n/**\n * @internal\n */\nexport class ApplyEditsResult {\n\n\tconstructor(\n\t\tpublic readonly reverseEdits: IValidEditOperation[] | null,\n\t\tpublic readonly changes: IInternalModelContentChange[],\n\t\tpublic readonly trimAutoWhitespaceLineNumbers: number[] | null\n\t) { }\n\n}\n\n/**\n * @internal\n */\nexport interface IInternalModelContentChange extends IModelContentChange {\n\trange: Range;\n\tforceMoveMarkers: boolean;\n}\n\n/**\n * @internal\n */\nexport function shouldSynchronizeModel(model: ITextModel): boolean {\n\treturn (\n\t\t!model.isTooLargeForSyncing() && !model.isForSimpleWidget\n\t);\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 { Emitter } from 'vs/base/common/event';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ITextModel, shouldSynchronizeModel } from 'vs/editor/common/model';\nimport { LanguageFilter, LanguageSelector, score } from 'vs/editor/common/languageSelector';\nimport { URI } from 'vs/base/common/uri';\n\ninterface Entry<T> {\n\tselector: LanguageSelector;\n\tprovider: T;\n\t_score: number;\n\t_time: number;\n}\n\nfunction isExclusive(selector: LanguageSelector): boolean {\n\tif (typeof selector === 'string') {\n\t\treturn false;\n\t} else if (Array.isArray(selector)) {\n\t\treturn selector.every(isExclusive);\n\t} else {\n\t\treturn !!(selector as LanguageFilter).exclusive; // TODO: microsoft/TypeScript#42768\n\t}\n}\n\nexport interface NotebooTypeResolver {\n\t(uri: URI): string | undefined;\n}\n\nexport class LanguageFeatureRegistry<T> {\n\n\tprivate _clock: number = 0;\n\tprivate readonly _entries: Entry<T>[] = [];\n\n\tprivate readonly _onDidChange = new Emitter<number>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tconstructor(private readonly _notebookTypeResolver?: NotebooTypeResolver) { }\n\n\tregister(selector: LanguageSelector, provider: T): IDisposable {\n\n\t\tlet entry: Entry<T> | undefined = {\n\t\t\tselector,\n\t\t\tprovider,\n\t\t\t_score: -1,\n\t\t\t_time: this._clock++\n\t\t};\n\n\t\tthis._entries.push(entry);\n\t\tthis._lastCandidate = undefined;\n\t\tthis._onDidChange.fire(this._entries.length);\n\n\t\treturn toDisposable(() => {\n\t\t\tif (entry) {\n\t\t\t\tconst idx = this._entries.indexOf(entry);\n\t\t\t\tif (idx >= 0) {\n\t\t\t\t\tthis._entries.splice(idx, 1);\n\t\t\t\t\tthis._lastCandidate = undefined;\n\t\t\t\t\tthis._onDidChange.fire(this._entries.length);\n\t\t\t\t\tentry = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\thas(model: ITextModel): boolean {\n\t\treturn this.all(model).length > 0;\n\t}\n\n\tall(model: ITextModel): T[] {\n\t\tif (!model) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthis._updateScores(model);\n\t\tconst result: T[] = [];\n\n\t\t// from registry\n\t\tfor (let entry of this._entries) {\n\t\t\tif (entry._score > 0) {\n\t\t\t\tresult.push(entry.provider);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tordered(model: ITextModel): T[] {\n\t\tconst result: T[] = [];\n\t\tthis._orderedForEach(model, entry => result.push(entry.provider));\n\t\treturn result;\n\t}\n\n\torderedGroups(model: ITextModel): T[][] {\n\t\tconst result: T[][] = [];\n\t\tlet lastBucket: T[];\n\t\tlet lastBucketScore: number;\n\n\t\tthis._orderedForEach(model, entry => {\n\t\t\tif (lastBucket && lastBucketScore === entry._score) {\n\t\t\t\tlastBucket.push(entry.provider);\n\t\t\t} else {\n\t\t\t\tlastBucketScore = entry._score;\n\t\t\t\tlastBucket = [entry.provider];\n\t\t\t\tresult.push(lastBucket);\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tprivate _orderedForEach(model: ITextModel, callback: (provider: Entry<T>) => any): void {\n\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._updateScores(model);\n\n\t\tfor (const entry of this._entries) {\n\t\t\tif (entry._score > 0) {\n\t\t\t\tcallback(entry);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _lastCandidate: { uri: string; language: string; notebookType?: string } | undefined;\n\n\tprivate _updateScores(model: ITextModel): void {\n\n\t\tconst notebookType = this._notebookTypeResolver?.(model.uri);\n\n\t\tconst candidate = {\n\t\t\turi: model.uri.toString(),\n\t\t\tlanguage: model.getLanguageId(),\n\t\t\tnotebookType\n\t\t};\n\n\t\tif (this._lastCandidate\n\t\t\t&& this._lastCandidate.language === candidate.language\n\t\t\t&& this._lastCandidate.uri === candidate.uri\n\t\t\t&& this._lastCandidate.notebookType === candidate.notebookType\n\t\t) {\n\n\t\t\t// nothing has changed\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastCandidate = candidate;\n\n\t\tfor (let entry of this._entries) {\n\t\t\tentry._score = score(entry.selector, model.uri, model.getLanguageId(), shouldSynchronizeModel(model), notebookType);\n\n\t\t\tif (isExclusive(entry.selector) && entry._score > 0) {\n\t\t\t\t// support for one exclusive selector that overwrites\n\t\t\t\t// any other selector\n\t\t\t\tfor (let entry of this._entries) {\n\t\t\t\t\tentry._score = 0;\n\t\t\t\t}\n\t\t\t\tentry._score = 1000;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// needs sorting\n\t\tthis._entries.sort(LanguageFeatureRegistry._compareByScoreAndTime);\n\t}\n\n\tprivate static _compareByScoreAndTime(a: Entry<any>, b: Entry<any>): number {\n\t\tif (a._score < b._score) {\n\t\t\treturn 1;\n\t\t} else if (a._score > b._score) {\n\t\t\treturn -1;\n\t\t} else if (a._time < b._time) {\n\t\t\treturn 1;\n\t\t} else if (a._time > b._time) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\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 { splitLines } from 'vs/base/common/strings';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\n\n/**\n * Represents a non-negative length in terms of line and column count.\n * Prefer using {@link Length} for performance reasons.\n*/\nexport class LengthObj {\n\tpublic static zero = new LengthObj(0, 0);\n\n\tconstructor(\n\t\tpublic readonly lineCount: number,\n\t\tpublic readonly columnCount: number\n\t) { }\n\n\ttoString() {\n\t\treturn `${this.lineCount},${this.columnCount}`;\n\t}\n}\n\n/**\n * The end must be greater than or equal to the start.\n*/\nexport function lengthDiff(startLineCount: number, startColumnCount: number, endLineCount: number, endColumnCount: number): Length {\n\treturn (startLineCount !== endLineCount)\n\t\t? toLength(endLineCount - startLineCount, endColumnCount)\n\t\t: toLength(0, endColumnCount - startColumnCount);\n}\n\n/**\n * Represents a non-negative length in terms of line and column count.\n * Does not allocate.\n*/\nexport type Length = { _brand: 'Length' };\n\nexport const lengthZero = 0 as any as Length;\n\nexport function lengthIsZero(length: Length): boolean {\n\treturn length as any as number === 0;\n}\n\n/*\n * We have 52 bits available in a JS number.\n * We use the upper 26 bits to store the line and the lower 26 bits to store the column.\n *\n * Set boolean to `true` when debugging, so that debugging is easier.\n */\nconst factor = /* is debug: */ false ? 100000 : 2 ** 26;\n\nexport function toLength(lineCount: number, columnCount: number): Length {\n\t// llllllllllllllllllllllllllcccccccccccccccccccccccccc (52 bits)\n\t// line count (26 bits) column count (26 bits)\n\n\t// If there is no overflow (all values/sums below 2^26 = 67108864),\n\t// we have `toLength(lns1, cols1) + toLength(lns2, cols2) = toLength(lns1 + lns2, cols1 + cols2)`.\n\n\treturn (lineCount * factor + columnCount) as any as Length;\n}\n\nexport function lengthToObj(length: Length): LengthObj {\n\tconst l = length as any as number;\n\tconst lineCount = Math.floor(l / factor);\n\tconst columnCount = l - lineCount * factor;\n\treturn new LengthObj(lineCount, columnCount);\n}\n\nexport function lengthGetLineCount(length: Length): number {\n\treturn Math.floor(length as any as number / factor);\n}\n\n/**\n * Returns the amount of columns of the given length, assuming that it does not span any line.\n*/\nexport function lengthGetColumnCountIfZeroLineCount(length: Length): number {\n\treturn length as any as number;\n}\n\n\n// [10 lines, 5 cols] + [ 0 lines, 3 cols] = [10 lines, 8 cols]\n// [10 lines, 5 cols] + [20 lines, 3 cols] = [30 lines, 3 cols]\nexport function lengthAdd(length1: Length, length2: Length): Length;\nexport function lengthAdd(l1: any, l2: any): Length {\n\treturn ((l2 < factor)\n\t\t? (l1 + l2) // l2 is the amount of columns (zero line count). Keep the column count from l1.\n\t\t: (l1 - (l1 % factor) + l2)); // l1 - (l1 % factor) equals toLength(l1.lineCount, 0)\n}\n\n/**\n * Returns a non negative length `result` such that `lengthAdd(length1, result) = length2`, or zero if such length does not exist.\n */\nexport function lengthDiffNonNegative(length1: Length, length2: Length): Length {\n\tconst l1 = length1 as any as number;\n\tconst l2 = length2 as any as number;\n\n\tconst diff = l2 - l1;\n\tif (diff <= 0) {\n\t\t// line-count of length1 is higher than line-count of length2\n\t\t// or they are equal and column-count of length1 is higher than column-count of length2\n\t\treturn lengthZero;\n\t}\n\n\tconst lineCount1 = Math.floor(l1 / factor);\n\tconst lineCount2 = Math.floor(l2 / factor);\n\n\tconst colCount2 = l2 - lineCount2 * factor;\n\n\tif (lineCount1 === lineCount2) {\n\t\tconst colCount1 = l1 - lineCount1 * factor;\n\t\treturn toLength(0, colCount2 - colCount1);\n\t} else {\n\t\treturn toLength(lineCount2 - lineCount1, colCount2);\n\t}\n}\n\nexport function lengthLessThan(length1: Length, length2: Length): boolean {\n\t// First, compare line counts, then column counts.\n\treturn (length1 as any as number) < (length2 as any as number);\n}\n\nexport function lengthLessThanEqual(length1: Length, length2: Length): boolean {\n\treturn (length1 as any as number) <= (length2 as any as number);\n}\n\nexport function lengthGreaterThanEqual(length1: Length, length2: Length): boolean {\n\treturn (length1 as any as number) >= (length2 as any as number);\n}\n\nexport function positionToLength(position: Position): Length {\n\treturn toLength(position.lineNumber - 1, position.column - 1);\n}\n\nexport function lengthsToRange(lengthStart: Length, lengthEnd: Length): Range {\n\tconst l = lengthStart as any as number;\n\tconst lineCount = Math.floor(l / factor);\n\tconst colCount = l - lineCount * factor;\n\n\tconst l2 = lengthEnd as any as number;\n\tconst lineCount2 = Math.floor(l2 / factor);\n\tconst colCount2 = l2 - lineCount2 * factor;\n\n\treturn new Range(lineCount + 1, colCount + 1, lineCount2 + 1, colCount2 + 1);\n}\n\nexport function lengthOfString(str: string): Length {\n\tconst lines = splitLines(str);\n\treturn toLength(lines.length - 1, lines[lines.length - 1].length);\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 { Length, lengthAdd, lengthDiffNonNegative, lengthLessThanEqual, LengthObj, lengthToObj, toLength } from './length';\n\nexport class TextEditInfo {\n\tconstructor(\n\t\tpublic readonly startOffset: Length,\n\t\tpublic readonly endOffset: Length,\n\t\tpublic readonly newLength: Length\n\t) {\n\t}\n}\n\nexport class BeforeEditPositionMapper {\n\tprivate nextEditIdx = 0;\n\tprivate deltaOldToNewLineCount = 0;\n\tprivate deltaOldToNewColumnCount = 0;\n\tprivate deltaLineIdxInOld = -1;\n\tprivate readonly edits: readonly TextEditInfoCache[];\n\n\t/**\n\t * @param edits Must be sorted by offset in ascending order.\n\t*/\n\tconstructor(\n\t\tedits: readonly TextEditInfo[],\n\t\tprivate readonly documentLength: Length,\n\t) {\n\t\tthis.edits = edits.map(edit => TextEditInfoCache.from(edit));\n\t}\n\n\t/**\n\t * @param offset Must be equal to or greater than the last offset this method has been called with.\n\t*/\n\tgetOffsetBeforeChange(offset: Length): Length {\n\t\tthis.adjustNextEdit(offset);\n\t\treturn this.translateCurToOld(offset);\n\t}\n\n\t/**\n\t * @param offset Must be equal to or greater than the last offset this method has been called with.\n\t*/\n\tgetDistanceToNextChange(offset: Length): Length {\n\t\tthis.adjustNextEdit(offset);\n\n\t\tconst nextEdit = this.edits[this.nextEditIdx];\n\t\tconst nextChangeOffset = nextEdit ? this.translateOldToCur(nextEdit.offsetObj) : this.documentLength;\n\n\t\treturn lengthDiffNonNegative(offset, nextChangeOffset);\n\t}\n\n\tprivate translateOldToCur(oldOffsetObj: LengthObj): Length {\n\t\tif (oldOffsetObj.lineCount === this.deltaLineIdxInOld) {\n\t\t\treturn toLength(oldOffsetObj.lineCount + this.deltaOldToNewLineCount, oldOffsetObj.columnCount + this.deltaOldToNewColumnCount);\n\t\t} else {\n\t\t\treturn toLength(oldOffsetObj.lineCount + this.deltaOldToNewLineCount, oldOffsetObj.columnCount);\n\t\t}\n\t}\n\n\tprivate translateCurToOld(newOffset: Length): Length {\n\t\tconst offsetObj = lengthToObj(newOffset);\n\t\tif (offsetObj.lineCount - this.deltaOldToNewLineCount === this.deltaLineIdxInOld) {\n\t\t\treturn toLength(offsetObj.lineCount - this.deltaOldToNewLineCount, offsetObj.columnCount - this.deltaOldToNewColumnCount);\n\t\t} else {\n\t\t\treturn toLength(offsetObj.lineCount - this.deltaOldToNewLineCount, offsetObj.columnCount);\n\t\t}\n\t}\n\n\tprivate adjustNextEdit(offset: Length) {\n\t\twhile (this.nextEditIdx < this.edits.length) {\n\t\t\tconst nextEdit = this.edits[this.nextEditIdx];\n\n\t\t\t// After applying the edit, what is its end offset (considering all previous edits)?\n\t\t\tconst nextEditEndOffsetInCur = this.translateOldToCur(nextEdit.endOffsetAfterObj);\n\n\t\t\tif (lengthLessThanEqual(nextEditEndOffsetInCur, offset)) {\n\t\t\t\t// We are after the edit, skip it\n\t\t\t\tthis.nextEditIdx++;\n\n\t\t\t\tconst nextEditEndOffsetInCurObj = lengthToObj(nextEditEndOffsetInCur);\n\n\t\t\t\t// Before applying the edit, what is its end offset (considering all previous edits)?\n\t\t\t\tconst nextEditEndOffsetBeforeInCurObj = lengthToObj(this.translateOldToCur(nextEdit.endOffsetBeforeObj));\n\n\t\t\t\tconst lineDelta = nextEditEndOffsetInCurObj.lineCount - nextEditEndOffsetBeforeInCurObj.lineCount;\n\t\t\t\tthis.deltaOldToNewLineCount += lineDelta;\n\n\t\t\t\tconst previousColumnDelta = this.deltaLineIdxInOld === nextEdit.endOffsetBeforeObj.lineCount ? this.deltaOldToNewColumnCount : 0;\n\t\t\t\tconst columnDelta = nextEditEndOffsetInCurObj.columnCount - nextEditEndOffsetBeforeInCurObj.columnCount;\n\t\t\t\tthis.deltaOldToNewColumnCount = previousColumnDelta + columnDelta;\n\t\t\t\tthis.deltaLineIdxInOld = nextEdit.endOffsetBeforeObj.lineCount;\n\t\t\t} else {\n\t\t\t\t// We are in or before the edit.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass TextEditInfoCache {\n\tstatic from(edit: TextEditInfo): TextEditInfoCache {\n\t\treturn new TextEditInfoCache(edit.startOffset, edit.endOffset, edit.newLength);\n\t}\n\n\tpublic readonly endOffsetBeforeObj: LengthObj;\n\tpublic readonly endOffsetAfterObj: LengthObj;\n\tpublic readonly offsetObj: LengthObj;\n\n\tconstructor(\n\t\tstartOffset: Length,\n\t\tendOffset: Length,\n\t\ttextLength: Length,\n\t) {\n\t\tthis.endOffsetBeforeObj = lengthToObj(endOffset);\n\t\tthis.endOffsetAfterObj = lengthToObj(lengthAdd(startOffset, textLength));\n\t\tthis.offsetObj = lengthToObj(startOffset);\n\t}\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 { AstNode } from './ast';\nimport { lengthAdd, lengthZero, Length, lengthLessThan } from './length';\n\n/**\n * Allows to efficiently find a longest child at a given offset in a fixed node.\n * The requested offsets must increase monotonously.\n*/\nexport class NodeReader {\n\tprivate readonly nextNodes: AstNode[];\n\tprivate readonly offsets: Length[];\n\tprivate readonly idxs: number[];\n\tprivate lastOffset: Length = lengthZero;\n\n\tconstructor(node: AstNode) {\n\t\tthis.nextNodes = [node];\n\t\tthis.offsets = [lengthZero];\n\t\tthis.idxs = [];\n\t}\n\n\t/**\n\t * Returns the longest node at `offset` that satisfies the predicate.\n\t * @param offset must be greater than or equal to the last offset this method has been called with!\n\t*/\n\treadLongestNodeAt(offset: Length, predicate: (node: AstNode) => boolean): AstNode | undefined {\n\t\tif (lengthLessThan(offset, this.lastOffset)) {\n\t\t\tthrow new Error('Invalid offset');\n\t\t}\n\t\tthis.lastOffset = offset;\n\n\t\t// Find the longest node of all those that are closest to the current offset.\n\t\twhile (true) {\n\t\t\tconst curNode = lastOrUndefined(this.nextNodes);\n\n\t\t\tif (!curNode) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst curNodeOffset = lastOrUndefined(this.offsets)!;\n\n\t\t\tif (lengthLessThan(offset, curNodeOffset)) {\n\t\t\t\t// The next best node is not here yet.\n\t\t\t\t// The reader must advance before a cached node is hit.\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (lengthLessThan(curNodeOffset, offset)) {\n\t\t\t\t// The reader is ahead of the current node.\n\t\t\t\tif (lengthAdd(curNodeOffset, curNode.length) <= offset) {\n\t\t\t\t\t// The reader is after the end of the current node.\n\t\t\t\t\tthis.nextNodeAfterCurrent();\n\t\t\t\t} else {\n\t\t\t\t\t// The reader is somewhere in the current node.\n\t\t\t\t\tconst nextChildIdx = getNextChildIdx(curNode);\n\t\t\t\t\tif (nextChildIdx !== -1) {\n\t\t\t\t\t\t// Go to the first child and repeat.\n\t\t\t\t\t\tthis.nextNodes.push(curNode.getChild(nextChildIdx)!);\n\t\t\t\t\t\tthis.offsets.push(curNodeOffset);\n\t\t\t\t\t\tthis.idxs.push(nextChildIdx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We don't have children\n\t\t\t\t\t\tthis.nextNodeAfterCurrent();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// readerOffsetBeforeChange === curNodeOffset\n\t\t\t\tif (predicate(curNode)) {\n\t\t\t\t\tthis.nextNodeAfterCurrent();\n\t\t\t\t\treturn curNode;\n\t\t\t\t} else {\n\t\t\t\t\tconst nextChildIdx = getNextChildIdx(curNode);\n\t\t\t\t\t// look for shorter node\n\t\t\t\t\tif (nextChildIdx === -1) {\n\t\t\t\t\t\t// There is no shorter node.\n\t\t\t\t\t\tthis.nextNodeAfterCurrent();\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Descend into first child & repeat.\n\t\t\t\t\t\tthis.nextNodes.push(curNode.getChild(nextChildIdx)!);\n\t\t\t\t\t\tthis.offsets.push(curNodeOffset);\n\t\t\t\t\t\tthis.idxs.push(nextChildIdx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Navigates to the longest node that continues after the current node.\n\tprivate nextNodeAfterCurrent(): void {\n\t\twhile (true) {\n\t\t\tconst currentOffset = lastOrUndefined(this.offsets);\n\t\t\tconst currentNode = lastOrUndefined(this.nextNodes);\n\t\t\tthis.nextNodes.pop();\n\t\t\tthis.offsets.pop();\n\n\t\t\tif (this.idxs.length === 0) {\n\t\t\t\t// We just popped the root node, there is no next node.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Parent is not undefined, because idxs is not empty\n\t\t\tconst parent = lastOrUndefined(this.nextNodes)!;\n\t\t\tconst nextChildIdx = getNextChildIdx(parent, this.idxs[this.idxs.length - 1]);\n\n\t\t\tif (nextChildIdx !== -1) {\n\t\t\t\tthis.nextNodes.push(parent.getChild(nextChildIdx)!);\n\t\t\t\tthis.offsets.push(lengthAdd(currentOffset!, currentNode!.length));\n\t\t\t\tthis.idxs[this.idxs.length - 1] = nextChildIdx;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tthis.idxs.pop();\n\t\t\t}\n\t\t\t// We fully consumed the parent.\n\t\t\t// Current node is now parent, so call nextNodeAfterCurrent again\n\t\t}\n\t}\n}\n\nfunction getNextChildIdx(node: AstNode, curIdx: number = -1): number | -1 {\n\twhile (true) {\n\t\tcurIdx++;\n\t\tif (curIdx >= node.childrenLength) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (node.getChild(curIdx)) {\n\t\t\treturn curIdx;\n\t\t}\n\t}\n}\n\nfunction lastOrUndefined<T>(arr: readonly T[]): T | undefined {\n\treturn arr.length > 0 ? arr[arr.length - 1] : undefined;\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\nconst emptyArr = new Array<number>();\n\n/**\n * Represents an immutable set that works best for a small number of elements (less than 32).\n * It uses bits to encode element membership efficiently.\n*/\nexport class SmallImmutableSet<T> {\n\tprivate static cache = new Array<SmallImmutableSet<any>>(129);\n\n\tprivate static create<T>(items: number, additionalItems: readonly number[]): SmallImmutableSet<T> {\n\t\tif (items <= 128 && additionalItems.length === 0) {\n\t\t\t// We create a cache of 128=2^7 elements to cover all sets with up to 7 (dense) elements.\n\t\t\tlet cached = SmallImmutableSet.cache[items];\n\t\t\tif (!cached) {\n\t\t\t\tcached = new SmallImmutableSet(items, additionalItems);\n\t\t\t\tSmallImmutableSet.cache[items] = cached;\n\t\t\t}\n\t\t\treturn cached;\n\t\t}\n\n\t\treturn new SmallImmutableSet(items, additionalItems);\n\t}\n\n\tprivate static empty = SmallImmutableSet.create<any>(0, emptyArr);\n\tpublic static getEmpty<T>(): SmallImmutableSet<T> {\n\t\treturn this.empty;\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly items: number,\n\t\tprivate readonly additionalItems: readonly number[]\n\t) {\n\t}\n\n\tpublic add(value: T, keyProvider: IDenseKeyProvider<T>): SmallImmutableSet<T> {\n\t\tconst key = keyProvider.getKey(value);\n\t\tlet idx = key >> 5; // divided by 32\n\t\tif (idx === 0) {\n\t\t\t// fast path\n\t\t\tconst newItem = (1 << key) | this.items;\n\t\t\tif (newItem === this.items) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn SmallImmutableSet.create(newItem, this.additionalItems);\n\t\t}\n\t\tidx--;\n\n\t\tconst newItems = this.additionalItems.slice(0);\n\t\twhile (newItems.length < idx) {\n\t\t\tnewItems.push(0);\n\t\t}\n\t\tnewItems[idx] |= 1 << (key & 31);\n\n\t\treturn SmallImmutableSet.create(this.items, newItems);\n\t}\n\n\tpublic merge(other: SmallImmutableSet<T>): SmallImmutableSet<T> {\n\t\tconst merged = this.items | other.items;\n\n\t\tif (this.additionalItems === emptyArr && other.additionalItems === emptyArr) {\n\t\t\t// fast path\n\t\t\tif (merged === this.items) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (merged === other.items) {\n\t\t\t\treturn other;\n\t\t\t}\n\t\t\treturn SmallImmutableSet.create(merged, emptyArr);\n\t\t}\n\n\t\t// This can be optimized, but it's not a common case\n\t\tconst newItems = new Array<number>();\n\t\tfor (let i = 0; i < Math.max(this.additionalItems.length, other.additionalItems.length); i++) {\n\t\t\tconst item1 = this.additionalItems[i] || 0;\n\t\t\tconst item2 = other.additionalItems[i] || 0;\n\t\t\tnewItems.push(item1 | item2);\n\t\t}\n\n\t\treturn SmallImmutableSet.create(merged, newItems);\n\t}\n\n\tpublic intersects(other: SmallImmutableSet<T>): boolean {\n\t\tif ((this.items & other.items) !== 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (let i = 0; i < Math.min(this.additionalItems.length, other.additionalItems.length); i++) {\n\t\t\tif ((this.additionalItems[i] & other.additionalItems[i]) !== 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nexport interface IDenseKeyProvider<T> {\n\tgetKey(value: T): number;\n}\n\nexport const identityKeyProvider: IDenseKeyProvider<number> = {\n\tgetKey(value: number) {\n\t\treturn value;\n\t}\n};\n\n/**\n * Assigns values a unique incrementing key.\n*/\nexport class DenseKeyProvider<T> {\n\tprivate readonly items = new Map<T, number>();\n\n\tgetKey(value: T): number {\n\t\tlet existing = this.items.get(value);\n\t\tif (existing === undefined) {\n\t\t\texisting = this.items.size;\n\t\t\tthis.items.set(value, existing);\n\t\t}\n\t\treturn existing;\n\t}\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 { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Length, lengthAdd, lengthGetLineCount, lengthToObj, lengthZero } from './length';\nimport { SmallImmutableSet } from './smallImmutableSet';\nimport { OpeningBracketId } from './tokenizer';\n\nexport const enum AstNodeKind {\n\tText = 0,\n\tBracket = 1,\n\tPair = 2,\n\tUnexpectedClosingBracket = 3,\n\tList = 4,\n}\n\nexport type AstNode = PairAstNode | ListAstNode | BracketAstNode | InvalidBracketAstNode | TextAstNode;\n\n/**\n * The base implementation for all AST nodes.\n*/\nabstract class BaseAstNode {\n\tpublic abstract readonly kind: AstNodeKind;\n\n\tpublic abstract readonly childrenLength: number;\n\n\t/**\n\t * Might return null even if {@link idx} is smaller than {@link BaseAstNode.childrenLength}.\n\t*/\n\tpublic abstract getChild(idx: number): AstNode | null;\n\n\t/**\n\t * Try to avoid using this property, as implementations might need to allocate the resulting array.\n\t*/\n\tpublic abstract readonly children: readonly AstNode[];\n\n\t/**\n\t * Represents the set of all (potentially) missing opening bracket ids in this node.\n\t * E.g. in `{ ] ) }` that set is {`[`, `(` }.\n\t*/\n\tpublic abstract readonly missingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>;\n\n\t/**\n\t * In case of a list, determines the height of the (2,3) tree.\n\t*/\n\tpublic abstract readonly listHeight: number;\n\n\tprotected _length: Length;\n\n\t/**\n\t * The length of the entire node, which should equal the sum of lengths of all children.\n\t*/\n\tpublic get length(): Length {\n\t\treturn this._length;\n\t}\n\n\tpublic constructor(length: Length) {\n\t\tthis._length = length;\n\t}\n\n\t/**\n\t * @param openBracketIds The set of all opening brackets that have not yet been closed.\n\t */\n\tpublic abstract canBeReused(\n\t\topenBracketIds: SmallImmutableSet<OpeningBracketId>\n\t): boolean;\n\n\t/**\n\t * Creates a deep clone.\n\t */\n\tpublic abstract deepClone(): AstNode;\n\n\tpublic abstract computeMinIndentation(offset: Length, textModel: ITextModel): number;\n}\n\n/**\n * Represents a bracket pair including its child (e.g. `{ ... }`).\n * Might be unclosed.\n * Immutable, if all children are immutable.\n*/\nexport class PairAstNode extends BaseAstNode {\n\tpublic static create(\n\t\topeningBracket: BracketAstNode,\n\t\tchild: AstNode | null,\n\t\tclosingBracket: BracketAstNode | null\n\t) {\n\t\tlet length = openingBracket.length;\n\t\tif (child) {\n\t\t\tlength = lengthAdd(length, child.length);\n\t\t}\n\t\tif (closingBracket) {\n\t\t\tlength = lengthAdd(length, closingBracket.length);\n\t\t}\n\t\treturn new PairAstNode(length, openingBracket, child, closingBracket, child ? child.missingOpeningBracketIds : SmallImmutableSet.getEmpty());\n\t}\n\n\tpublic get kind(): AstNodeKind.Pair {\n\t\treturn AstNodeKind.Pair;\n\t}\n\tpublic get listHeight() {\n\t\treturn 0;\n\t}\n\tpublic get childrenLength(): number {\n\t\treturn 3;\n\t}\n\tpublic getChild(idx: number): AstNode | null {\n\t\tswitch (idx) {\n\t\t\tcase 0: return this.openingBracket;\n\t\t\tcase 1: return this.child;\n\t\t\tcase 2: return this.closingBracket;\n\t\t}\n\t\tthrow new Error('Invalid child index');\n\t}\n\n\t/**\n\t * Avoid using this property, it allocates an array!\n\t*/\n\tpublic get children() {\n\t\tconst result = new Array<AstNode>();\n\t\tresult.push(this.openingBracket);\n\t\tif (this.child) {\n\t\t\tresult.push(this.child);\n\t\t}\n\t\tif (this.closingBracket) {\n\t\t\tresult.push(this.closingBracket);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate constructor(\n\t\tlength: Length,\n\t\tpublic readonly openingBracket: BracketAstNode,\n\t\tpublic readonly child: AstNode | null,\n\t\tpublic readonly closingBracket: BracketAstNode | null,\n\t\tpublic readonly missingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>\n\t) {\n\t\tsuper(length);\n\t}\n\n\tpublic canBeReused(openBracketIds: SmallImmutableSet<OpeningBracketId>) {\n\t\tif (this.closingBracket === null) {\n\t\t\t// Unclosed pair ast nodes only\n\t\t\t// end at the end of the document\n\t\t\t// or when a parent node is closed.\n\n\t\t\t// This could be improved:\n\t\t\t// Only return false if some next token is neither \"undefined\" nor a bracket that closes a parent.\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (openBracketIds.intersects(this.missingOpeningBracketIds)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic deepClone(): PairAstNode {\n\t\treturn new PairAstNode(\n\t\t\tthis.length,\n\t\t\tthis.openingBracket.deepClone(),\n\t\t\tthis.child && this.child.deepClone(),\n\t\t\tthis.closingBracket && this.closingBracket.deepClone(),\n\t\t\tthis.missingOpeningBracketIds\n\t\t);\n\t}\n\n\tpublic computeMinIndentation(offset: Length, textModel: ITextModel): number {\n\t\treturn this.child ? this.child.computeMinIndentation(lengthAdd(offset, this.openingBracket.length), textModel) : Number.MAX_SAFE_INTEGER;\n\t}\n}\n\nexport abstract class ListAstNode extends BaseAstNode {\n\t/**\n\t * This method uses more memory-efficient list nodes that can only store 2 or 3 children.\n\t*/\n\tpublic static create23(item1: AstNode, item2: AstNode, item3: AstNode | null, immutable: boolean = false): ListAstNode {\n\t\tlet length = item1.length;\n\t\tlet missingBracketIds = item1.missingOpeningBracketIds;\n\n\t\tif (item1.listHeight !== item2.listHeight) {\n\t\t\tthrow new Error('Invalid list heights');\n\t\t}\n\n\t\tlength = lengthAdd(length, item2.length);\n\t\tmissingBracketIds = missingBracketIds.merge(item2.missingOpeningBracketIds);\n\n\t\tif (item3) {\n\t\t\tif (item1.listHeight !== item3.listHeight) {\n\t\t\t\tthrow new Error('Invalid list heights');\n\t\t\t}\n\t\t\tlength = lengthAdd(length, item3.length);\n\t\t\tmissingBracketIds = missingBracketIds.merge(item3.missingOpeningBracketIds);\n\t\t}\n\t\treturn immutable\n\t\t\t? new Immutable23ListAstNode(length, item1.listHeight + 1, item1, item2, item3, missingBracketIds)\n\t\t\t: new TwoThreeListAstNode(length, item1.listHeight + 1, item1, item2, item3, missingBracketIds);\n\t}\n\n\tpublic static getEmpty() {\n\t\treturn new ImmutableArrayListAstNode(lengthZero, 0, [], SmallImmutableSet.getEmpty());\n\t}\n\n\tpublic get kind(): AstNodeKind.List {\n\t\treturn AstNodeKind.List;\n\t}\n\n\tpublic get missingOpeningBracketIds(): SmallImmutableSet<OpeningBracketId> {\n\t\treturn this._missingOpeningBracketIds;\n\t}\n\n\tprivate cachedMinIndentation: number = -1;\n\n\t/**\n\t * Use ListAstNode.create.\n\t*/\n\tconstructor(\n\t\tlength: Length,\n\t\tpublic readonly listHeight: number,\n\t\tprivate _missingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>\n\t) {\n\t\tsuper(length);\n\t}\n\n\tprotected throwIfImmutable(): void {\n\t\t// NOOP\n\t}\n\n\tprotected abstract setChild(idx: number, child: AstNode): void;\n\n\tpublic makeLastElementMutable(): AstNode | undefined {\n\t\tthis.throwIfImmutable();\n\t\tconst childCount = this.childrenLength;\n\t\tif (childCount === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst lastChild = this.getChild(childCount - 1)!;\n\t\tconst mutable = lastChild.kind === AstNodeKind.List ? lastChild.toMutable() : lastChild;\n\t\tif (lastChild !== mutable) {\n\t\t\tthis.setChild(childCount - 1, mutable);\n\t\t}\n\t\treturn mutable;\n\t}\n\n\tpublic makeFirstElementMutable(): AstNode | undefined {\n\t\tthis.throwIfImmutable();\n\t\tconst childCount = this.childrenLength;\n\t\tif (childCount === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstChild = this.getChild(0)!;\n\t\tconst mutable = firstChild.kind === AstNodeKind.List ? firstChild.toMutable() : firstChild;\n\t\tif (firstChild !== mutable) {\n\t\t\tthis.setChild(0, mutable);\n\t\t}\n\t\treturn mutable;\n\t}\n\n\tpublic canBeReused(openBracketIds: SmallImmutableSet<OpeningBracketId>): boolean {\n\t\tif (openBracketIds.intersects(this.missingOpeningBracketIds)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet lastChild: ListAstNode = this;\n\t\tlet lastLength: number;\n\t\twhile (lastChild.kind === AstNodeKind.List && (lastLength = lastChild.childrenLength) > 0) {\n\t\t\tlastChild = lastChild.getChild(lastLength! - 1) as ListAstNode;\n\t\t}\n\n\t\treturn lastChild.canBeReused(openBracketIds);\n\t}\n\n\tpublic handleChildrenChanged(): void {\n\t\tthis.throwIfImmutable();\n\n\t\tconst count = this.childrenLength;\n\n\t\tlet length = this.getChild(0)!.length;\n\t\tlet unopenedBrackets = this.getChild(0)!.missingOpeningBracketIds;\n\n\t\tfor (let i = 1; i < count; i++) {\n\t\t\tconst child = this.getChild(i)!;\n\t\t\tlength = lengthAdd(length, child.length);\n\t\t\tunopenedBrackets = unopenedBrackets.merge(child.missingOpeningBracketIds);\n\t\t}\n\n\t\tthis._length = length;\n\t\tthis._missingOpeningBracketIds = unopenedBrackets;\n\t\tthis.cachedMinIndentation = -1;\n\t}\n\n\tpublic computeMinIndentation(offset: Length, textModel: ITextModel): number {\n\t\tif (this.cachedMinIndentation !== -1) {\n\t\t\treturn this.cachedMinIndentation;\n\t\t}\n\n\t\tlet minIndentation = Number.MAX_SAFE_INTEGER;\n\t\tlet childOffset = offset;\n\t\tfor (let i = 0; i < this.childrenLength; i++) {\n\t\t\tconst child = this.getChild(i);\n\t\t\tif (child) {\n\t\t\t\tminIndentation = Math.min(minIndentation, child.computeMinIndentation(childOffset, textModel));\n\t\t\t\tchildOffset = lengthAdd(childOffset, child.length);\n\t\t\t}\n\t\t}\n\n\t\tthis.cachedMinIndentation = minIndentation;\n\t\treturn minIndentation;\n\t}\n\n\t/**\n\t * Creates a shallow clone that is mutable, or itself if it is already mutable.\n\t */\n\tpublic abstract toMutable(): ListAstNode;\n\n\tpublic abstract appendChildOfSameHeight(node: AstNode): void;\n\tpublic abstract unappendChild(): AstNode | undefined;\n\tpublic abstract prependChildOfSameHeight(node: AstNode): void;\n\tpublic abstract unprependChild(): AstNode | undefined;\n}\n\nclass TwoThreeListAstNode extends ListAstNode {\n\tpublic get childrenLength(): number {\n\t\treturn this._item3 !== null ? 3 : 2;\n\t}\n\tpublic getChild(idx: number): AstNode | null {\n\t\tswitch (idx) {\n\t\t\tcase 0: return this._item1;\n\t\t\tcase 1: return this._item2;\n\t\t\tcase 2: return this._item3;\n\t\t}\n\t\tthrow new Error('Invalid child index');\n\t}\n\tpublic setChild(idx: number, node: AstNode): void {\n\t\tswitch (idx) {\n\t\t\tcase 0: this._item1 = node; return;\n\t\t\tcase 1: this._item2 = node; return;\n\t\t\tcase 2: this._item3 = node; return;\n\t\t}\n\t\tthrow new Error('Invalid child index');\n\t}\n\n\tpublic get children(): readonly AstNode[] {\n\t\treturn this._item3 ? [this._item1, this._item2, this._item3] : [this._item1, this._item2];\n\t}\n\n\tpublic get item1(): AstNode {\n\t\treturn this._item1;\n\t}\n\tpublic get item2(): AstNode {\n\t\treturn this._item2;\n\t}\n\tpublic get item3(): AstNode | null {\n\t\treturn this._item3;\n\t}\n\n\tpublic constructor(\n\t\tlength: Length,\n\t\tlistHeight: number,\n\t\tprivate _item1: AstNode,\n\t\tprivate _item2: AstNode,\n\t\tprivate _item3: AstNode | null,\n\t\tmissingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>\n\t) {\n\t\tsuper(length, listHeight, missingOpeningBracketIds);\n\t}\n\n\tpublic deepClone(): ListAstNode {\n\t\treturn new TwoThreeListAstNode(\n\t\t\tthis.length,\n\t\t\tthis.listHeight,\n\t\t\tthis._item1.deepClone(),\n\t\t\tthis._item2.deepClone(),\n\t\t\tthis._item3 ? this._item3.deepClone() : null,\n\t\t\tthis.missingOpeningBracketIds\n\t\t);\n\t}\n\n\tpublic appendChildOfSameHeight(node: AstNode): void {\n\t\tif (this._item3) {\n\t\t\tthrow new Error('Cannot append to a full (2,3) tree node');\n\t\t}\n\t\tthis.throwIfImmutable();\n\t\tthis._item3 = node;\n\t\tthis.handleChildrenChanged();\n\t}\n\n\tpublic unappendChild(): AstNode | undefined {\n\t\tif (!this._item3) {\n\t\t\tthrow new Error('Cannot remove from a non-full (2,3) tree node');\n\t\t}\n\t\tthis.throwIfImmutable();\n\t\tconst result = this._item3;\n\t\tthis._item3 = null;\n\t\tthis.handleChildrenChanged();\n\t\treturn result;\n\t}\n\n\tpublic prependChildOfSameHeight(node: AstNode): void {\n\t\tif (this._item3) {\n\t\t\tthrow new Error('Cannot prepend to a full (2,3) tree node');\n\t\t}\n\t\tthis.throwIfImmutable();\n\t\tthis._item3 = this._item2;\n\t\tthis._item2 = this._item1;\n\t\tthis._item1 = node;\n\t\tthis.handleChildrenChanged();\n\t}\n\n\tpublic unprependChild(): AstNode | undefined {\n\t\tif (!this._item3) {\n\t\t\tthrow new Error('Cannot remove from a non-full (2,3) tree node');\n\t\t}\n\t\tthis.throwIfImmutable();\n\t\tconst result = this._item1;\n\t\tthis._item1 = this._item2;\n\t\tthis._item2 = this._item3;\n\t\tthis._item3 = null;\n\n\t\tthis.handleChildrenChanged();\n\t\treturn result;\n\t}\n\n\toverride toMutable(): ListAstNode {\n\t\treturn this;\n\t}\n}\n\n/**\n * Immutable, if all children are immutable.\n*/\nclass Immutable23ListAstNode extends TwoThreeListAstNode {\n\toverride toMutable(): ListAstNode {\n\t\treturn new TwoThreeListAstNode(this.length, this.listHeight, this.item1, this.item2, this.item3, this.missingOpeningBracketIds);\n\t}\n\n\tprotected override throwIfImmutable(): void {\n\t\tthrow new Error('this instance is immutable');\n\t}\n}\n\n/**\n * For debugging.\n*/\nclass ArrayListAstNode extends ListAstNode {\n\tget childrenLength(): number {\n\t\treturn this._children.length;\n\t}\n\tgetChild(idx: number): AstNode | null {\n\t\treturn this._children[idx];\n\t}\n\tsetChild(idx: number, child: AstNode): void {\n\t\tthis._children[idx] = child;\n\t}\n\tget children(): readonly AstNode[] {\n\t\treturn this._children;\n\t}\n\n\tconstructor(\n\t\tlength: Length,\n\t\tlistHeight: number,\n\t\tprivate readonly _children: AstNode[],\n\t\tmissingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>\n\t) {\n\t\tsuper(length, listHeight, missingOpeningBracketIds);\n\t}\n\n\tdeepClone(): ListAstNode {\n\t\tconst children = new Array<AstNode>(this._children.length);\n\t\tfor (let i = 0; i < this._children.length; i++) {\n\t\t\tchildren[i] = this._children[i].deepClone();\n\t\t}\n\t\treturn new ArrayListAstNode(this.length, this.listHeight, children, this.missingOpeningBracketIds);\n\t}\n\n\tpublic appendChildOfSameHeight(node: AstNode): void {\n\t\tthis.throwIfImmutable();\n\t\tthis._children.push(node);\n\t\tthis.handleChildrenChanged();\n\t}\n\n\tpublic unappendChild(): AstNode | undefined {\n\t\tthis.throwIfImmutable();\n\t\tconst item = this._children.pop();\n\t\tthis.handleChildrenChanged();\n\t\treturn item;\n\t}\n\n\tpublic prependChildOfSameHeight(node: AstNode): void {\n\t\tthis.throwIfImmutable();\n\t\tthis._children.unshift(node);\n\t\tthis.handleChildrenChanged();\n\t}\n\n\tpublic unprependChild(): AstNode | undefined {\n\t\tthis.throwIfImmutable();\n\t\tconst item = this._children.shift();\n\t\tthis.handleChildrenChanged();\n\t\treturn item;\n\t}\n\n\tpublic override toMutable(): ListAstNode {\n\t\treturn this;\n\t}\n}\n\n/**\n * Immutable, if all children are immutable.\n*/\nclass ImmutableArrayListAstNode extends ArrayListAstNode {\n\toverride toMutable(): ListAstNode {\n\t\treturn new ArrayListAstNode(this.length, this.listHeight, [...this.children], this.missingOpeningBracketIds);\n\t}\n\n\tprotected override throwIfImmutable(): void {\n\t\tthrow new Error('this instance is immutable');\n\t}\n}\n\nconst emptyArray: readonly AstNode[] = [];\n\nabstract class ImmutableLeafAstNode extends BaseAstNode {\n\tpublic get listHeight() {\n\t\treturn 0;\n\t}\n\tpublic get childrenLength(): number {\n\t\treturn 0;\n\t}\n\tpublic getChild(idx: number): AstNode | null {\n\t\treturn null;\n\t}\n\tpublic get children(): readonly AstNode[] {\n\t\treturn emptyArray;\n\t}\n\tpublic deepClone(): this & AstNode {\n\t\treturn this as this & AstNode;\n\t}\n}\n\nexport class TextAstNode extends ImmutableLeafAstNode {\n\tpublic get kind(): AstNodeKind.Text {\n\t\treturn AstNodeKind.Text;\n\t}\n\tpublic get missingOpeningBracketIds(): SmallImmutableSet<OpeningBracketId> {\n\t\treturn SmallImmutableSet.getEmpty();\n\t}\n\n\tpublic canBeReused(_openedBracketIds: SmallImmutableSet<OpeningBracketId>) {\n\t\treturn true;\n\t}\n\n\tpublic computeMinIndentation(offset: Length, textModel: ITextModel): number {\n\t\tconst start = lengthToObj(offset);\n\t\t// Text ast nodes don't have partial indentation (ensured by the tokenizer).\n\t\t// Thus, if this text node does not start at column 0, the first line cannot have any indentation at all.\n\t\tconst startLineNumber = (start.columnCount === 0 ? start.lineCount : start.lineCount + 1) + 1;\n\t\tconst endLineNumber = lengthGetLineCount(lengthAdd(offset, this.length)) + 1;\n\n\t\tlet result = Number.MAX_SAFE_INTEGER;\n\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst firstNonWsColumn = textModel.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\t\tconst lineContent = textModel.getLineContent(lineNumber);\n\t\t\tif (firstNonWsColumn === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst visibleColumn = CursorColumns.visibleColumnFromColumn(lineContent, firstNonWsColumn, textModel.getOptions().tabSize)!;\n\t\t\tresult = Math.min(result, visibleColumn);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\nexport class BracketAstNode extends ImmutableLeafAstNode {\n\tpublic static create(\n\t\tlength: Length,\n\t\tlanguageId: string,\n\t\tbracketIds: SmallImmutableSet<OpeningBracketId>\n\t): BracketAstNode {\n\t\tconst node = new BracketAstNode(length, languageId, bracketIds);\n\t\treturn node;\n\t}\n\n\tpublic get kind(): AstNodeKind.Bracket {\n\t\treturn AstNodeKind.Bracket;\n\t}\n\n\tpublic get missingOpeningBracketIds(): SmallImmutableSet<OpeningBracketId> {\n\t\treturn SmallImmutableSet.getEmpty();\n\t}\n\n\tprivate constructor(\n\t\tlength: Length,\n\t\tpublic readonly languageId: string,\n\t\t/**\n\t\t * In case of a opening bracket, this is the id of the opening bracket.\n\t\t * In case of a closing bracket, this contains the ids of all opening brackets it can close.\n\t\t*/\n\t\tpublic readonly bracketIds: SmallImmutableSet<OpeningBracketId>\n\t) {\n\t\tsuper(length);\n\t}\n\n\tpublic canBeReused(_openedBracketIds: SmallImmutableSet<OpeningBracketId>) {\n\t\t// These nodes could be reused,\n\t\t// but not in a general way.\n\t\t// Their parent may be reused.\n\t\treturn false;\n\t}\n\n\tpublic computeMinIndentation(offset: Length, textModel: ITextModel): number {\n\t\treturn Number.MAX_SAFE_INTEGER;\n\t}\n}\n\nexport class InvalidBracketAstNode extends ImmutableLeafAstNode {\n\tpublic get kind(): AstNodeKind.UnexpectedClosingBracket {\n\t\treturn AstNodeKind.UnexpectedClosingBracket;\n\t}\n\n\tpublic readonly missingOpeningBracketIds: SmallImmutableSet<OpeningBracketId>;\n\n\tpublic constructor(closingBrackets: SmallImmutableSet<OpeningBracketId>, length: Length) {\n\t\tsuper(length);\n\t\tthis.missingOpeningBracketIds = closingBrackets;\n\t}\n\n\tpublic canBeReused(openedBracketIds: SmallImmutableSet<OpeningBracketId>) {\n\t\treturn !openedBracketIds.intersects(this.missingOpeningBracketIds);\n\t}\n\n\tpublic computeMinIndentation(offset: Length, textModel: ITextModel): number {\n\t\treturn Number.MAX_SAFE_INTEGER;\n\t}\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 { AstNode, AstNodeKind, ListAstNode } from './ast';\n\n/**\n * Concatenates a list of (2,3) AstNode's into a single (2,3) AstNode.\n * This mutates the items of the input array!\n * If all items have the same height, this method has runtime O(items.length).\n * Otherwise, it has runtime O(items.length * max(log(items.length), items.max(i => i.height))).\n*/\nexport function concat23Trees(items: AstNode[]): AstNode | null {\n\tif (items.length === 0) {\n\t\treturn null;\n\t}\n\tif (items.length === 1) {\n\t\treturn items[0];\n\t}\n\n\tlet i = 0;\n\t/**\n\t * Reads nodes of same height and concatenates them to a single node.\n\t*/\n\tfunction readNode(): AstNode | null {\n\t\tif (i >= items.length) {\n\t\t\treturn null;\n\t\t}\n\t\tconst start = i;\n\t\tconst height = items[start].listHeight;\n\n\t\ti++;\n\t\twhile (i < items.length && items[i].listHeight === height) {\n\t\t\ti++;\n\t\t}\n\n\t\tif (i - start >= 2) {\n\t\t\treturn concat23TreesOfSameHeight(start === 0 && i === items.length ? items : items.slice(start, i), false);\n\t\t} else {\n\t\t\treturn items[start];\n\t\t}\n\t}\n\n\t// The items might not have the same height.\n\t// We merge all items by using a binary concat operator.\n\tlet first = readNode()!; // There must be a first item\n\tlet second = readNode();\n\tif (!second) {\n\t\treturn first;\n\t}\n\n\tfor (let item = readNode(); item; item = readNode()) {\n\t\t// Prefer concatenating smaller trees, as the runtime of concat depends on the tree height.\n\t\tif (heightDiff(first, second) <= heightDiff(second, item)) {\n\t\t\tfirst = concat(first, second);\n\t\t\tsecond = item;\n\t\t} else {\n\t\t\tsecond = concat(second, item);\n\t\t}\n\t}\n\n\tconst result = concat(first, second);\n\treturn result;\n}\n\nexport function concat23TreesOfSameHeight(items: AstNode[], createImmutableLists: boolean = false): AstNode | null {\n\tif (items.length === 0) {\n\t\treturn null;\n\t}\n\tif (items.length === 1) {\n\t\treturn items[0];\n\t}\n\n\tlet length = items.length;\n\t// All trees have same height, just create parent nodes.\n\twhile (length > 3) {\n\t\tconst newLength = length >> 1;\n\t\tfor (let i = 0; i < newLength; i++) {\n\t\t\tconst j = i << 1;\n\t\t\titems[i] = ListAstNode.create23(items[j], items[j + 1], j + 3 === length ? items[j + 2] : null, createImmutableLists);\n\t\t}\n\t\tlength = newLength;\n\t}\n\treturn ListAstNode.create23(items[0], items[1], length >= 3 ? items[2] : null, createImmutableLists);\n}\n\nfunction heightDiff(node1: AstNode, node2: AstNode): number {\n\treturn Math.abs(node1.listHeight - node2.listHeight);\n}\n\nfunction concat(node1: AstNode, node2: AstNode): AstNode {\n\tif (node1.listHeight === node2.listHeight) {\n\t\treturn ListAstNode.create23(node1, node2, null, false);\n\t}\n\telse if (node1.listHeight > node2.listHeight) {\n\t\t// node1 is the tree we want to insert into\n\t\treturn append(node1 as ListAstNode, node2);\n\t} else {\n\t\treturn prepend(node2 as ListAstNode, node1);\n\t}\n}\n\n/**\n * Appends the given node to the end of this (2,3) tree.\n * Returns the new root.\n*/\nfunction append(list: ListAstNode, nodeToAppend: AstNode): AstNode {\n\tlist = list.toMutable() as ListAstNode;\n\tlet curNode: AstNode = list;\n\tconst parents = new Array<ListAstNode>();\n\tlet nodeToAppendOfCorrectHeight: AstNode | undefined;\n\twhile (true) {\n\t\t// assert nodeToInsert.listHeight <= curNode.listHeight\n\t\tif (nodeToAppend.listHeight === curNode.listHeight) {\n\t\t\tnodeToAppendOfCorrectHeight = nodeToAppend;\n\t\t\tbreak;\n\t\t}\n\t\t// assert 0 <= nodeToInsert.listHeight < curNode.listHeight\n\t\tif (curNode.kind !== AstNodeKind.List) {\n\t\t\tthrow new Error('unexpected');\n\t\t}\n\t\tparents.push(curNode);\n\t\t// assert 2 <= curNode.childrenLength <= 3\n\t\tcurNode = curNode.makeLastElementMutable()!;\n\t}\n\t// assert nodeToAppendOfCorrectHeight!.listHeight === curNode.listHeight\n\tfor (let i = parents.length - 1; i >= 0; i--) {\n\t\tconst parent = parents[i];\n\t\tif (nodeToAppendOfCorrectHeight) {\n\t\t\t// Can we take the element?\n\t\t\tif (parent.childrenLength >= 3) {\n\t\t\t\t// assert parent.childrenLength === 3 && parent.listHeight === nodeToAppendOfCorrectHeight.listHeight + 1\n\n\t\t\t\t// we need to split to maintain (2,3)-tree property.\n\t\t\t\t// Send the third element + the new element to the parent.\n\t\t\t\tnodeToAppendOfCorrectHeight = ListAstNode.create23(parent.unappendChild()!, nodeToAppendOfCorrectHeight, null, false);\n\t\t\t} else {\n\t\t\t\tparent.appendChildOfSameHeight(nodeToAppendOfCorrectHeight);\n\t\t\t\tnodeToAppendOfCorrectHeight = undefined;\n\t\t\t}\n\t\t} else {\n\t\t\tparent.handleChildrenChanged();\n\t\t}\n\t}\n\tif (nodeToAppendOfCorrectHeight) {\n\t\treturn ListAstNode.create23(list, nodeToAppendOfCorrectHeight, null, false);\n\t} else {\n\t\treturn list;\n\t}\n}\n\n/**\n * Prepends the given node to the end of this (2,3) tree.\n * Returns the new root.\n*/\nfunction prepend(list: ListAstNode, nodeToAppend: AstNode): AstNode {\n\tlist = list.toMutable() as ListAstNode;\n\tlet curNode: AstNode = list;\n\tconst parents = new Array<ListAstNode>();\n\t// assert nodeToInsert.listHeight <= curNode.listHeight\n\twhile (nodeToAppend.listHeight !== curNode.listHeight) {\n\t\t// assert 0 <= nodeToInsert.listHeight < curNode.listHeight\n\t\tif (curNode.kind !== AstNodeKind.List) {\n\t\t\tthrow new Error('unexpected');\n\t\t}\n\t\tparents.push(curNode);\n\t\t// assert 2 <= curNode.childrenFast.length <= 3\n\t\tcurNode = curNode.makeFirstElementMutable()!;\n\t}\n\tlet nodeToPrependOfCorrectHeight: AstNode | undefined = nodeToAppend;\n\t// assert nodeToAppendOfCorrectHeight!.listHeight === curNode.listHeight\n\tfor (let i = parents.length - 1; i >= 0; i--) {\n\t\tconst parent = parents[i];\n\t\tif (nodeToPrependOfCorrectHeight) {\n\t\t\t// Can we take the element?\n\t\t\tif (parent.childrenLength >= 3) {\n\t\t\t\t// assert parent.childrenLength === 3 && parent.listHeight === nodeToAppendOfCorrectHeight.listHeight + 1\n\n\t\t\t\t// we need to split to maintain (2,3)-tree property.\n\t\t\t\t// Send the third element + the new element to the parent.\n\t\t\t\tnodeToPrependOfCorrectHeight = ListAstNode.create23(nodeToPrependOfCorrectHeight, parent.unprependChild()!, null, false);\n\t\t\t} else {\n\t\t\t\tparent.prependChildOfSameHeight(nodeToPrependOfCorrectHeight);\n\t\t\t\tnodeToPrependOfCorrectHeight = undefined;\n\t\t\t}\n\t\t} else {\n\t\t\tparent.handleChildrenChanged();\n\t\t}\n\t}\n\tif (nodeToPrependOfCorrectHeight) {\n\t\treturn ListAstNode.create23(nodeToPrependOfCorrectHeight, list, null, false);\n\t} else {\n\t\treturn list;\n\t}\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 { AstNode, AstNodeKind, BracketAstNode, InvalidBracketAstNode, ListAstNode, PairAstNode, TextAstNode } from './ast';\nimport { BeforeEditPositionMapper, TextEditInfo } from './beforeEditPositionMapper';\nimport { SmallImmutableSet } from './smallImmutableSet';\nimport { lengthIsZero, lengthLessThan } from './length';\nimport { concat23Trees, concat23TreesOfSameHeight } from './concat23Trees';\nimport { NodeReader } from './nodeReader';\nimport { OpeningBracketId, Tokenizer, TokenKind } from './tokenizer';\n\n/**\n * Non incrementally built ASTs are immutable.\n*/\nexport function parseDocument(tokenizer: Tokenizer, edits: TextEditInfo[], oldNode: AstNode | undefined, createImmutableLists: boolean): AstNode {\n\tconst parser = new Parser(tokenizer, edits, oldNode, createImmutableLists);\n\treturn parser.parseDocument();\n}\n\n/**\n * Non incrementally built ASTs are immutable.\n*/\nclass Parser {\n\tprivate readonly oldNodeReader?: NodeReader;\n\tprivate readonly positionMapper: BeforeEditPositionMapper;\n\tprivate _itemsConstructed: number = 0;\n\tprivate _itemsFromCache: number = 0;\n\n\tconstructor(\n\t\tprivate readonly tokenizer: Tokenizer,\n\t\tedits: TextEditInfo[],\n\t\toldNode: AstNode | undefined,\n\t\tprivate readonly createImmutableLists: boolean,\n\t) {\n\t\tif (oldNode && createImmutableLists) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\n\t\tthis.oldNodeReader = oldNode ? new NodeReader(oldNode) : undefined;\n\t\tthis.positionMapper = new BeforeEditPositionMapper(edits, tokenizer.length);\n\t}\n\n\tparseDocument(): AstNode {\n\t\tthis._itemsConstructed = 0;\n\t\tthis._itemsFromCache = 0;\n\n\t\tlet result = this.parseList(SmallImmutableSet.getEmpty());\n\t\tif (!result) {\n\t\t\tresult = ListAstNode.getEmpty();\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate parseList(\n\t\topenedBracketIds: SmallImmutableSet<OpeningBracketId>,\n\t): AstNode | null {\n\t\tconst items = new Array<AstNode>();\n\n\t\twhile (true) {\n\t\t\tconst token = this.tokenizer.peek();\n\t\t\tif (\n\t\t\t\t!token ||\n\t\t\t\t(token.kind === TokenKind.ClosingBracket &&\n\t\t\t\t\ttoken.bracketIds.intersects(openedBracketIds))\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst child = this.parseChild(openedBracketIds);\n\t\t\tif (child.kind === AstNodeKind.List && child.childrenLength === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titems.push(child);\n\t\t}\n\n\t\t// When there is no oldNodeReader, all items are created from scratch and must have the same height.\n\t\tconst result = this.oldNodeReader ? concat23Trees(items) : concat23TreesOfSameHeight(items, this.createImmutableLists);\n\t\treturn result;\n\t}\n\n\tprivate parseChild(\n\t\topenedBracketIds: SmallImmutableSet<number>,\n\t): AstNode {\n\t\tif (this.oldNodeReader) {\n\t\t\tconst maxCacheableLength = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);\n\t\t\tif (!lengthIsZero(maxCacheableLength)) {\n\t\t\t\tconst cachedNode = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), curNode => {\n\t\t\t\t\tif (!lengthLessThan(curNode.length, maxCacheableLength)) {\n\t\t\t\t\t\t// Either the node contains edited text or touches edited text.\n\t\t\t\t\t\t// In the latter case, brackets might have been extended (`end` -> `ending`), so even touching nodes cannot be reused.\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tconst canBeReused = curNode.canBeReused(openedBracketIds);\n\t\t\t\t\treturn canBeReused;\n\t\t\t\t});\n\n\t\t\t\tif (cachedNode) {\n\t\t\t\t\tthis._itemsFromCache++;\n\t\t\t\t\tthis.tokenizer.skip(cachedNode.length);\n\t\t\t\t\treturn cachedNode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._itemsConstructed++;\n\n\t\tconst token = this.tokenizer.read()!;\n\n\t\tswitch (token.kind) {\n\t\t\tcase TokenKind.ClosingBracket:\n\t\t\t\treturn new InvalidBracketAstNode(token.bracketIds, token.length);\n\n\t\t\tcase TokenKind.Text:\n\t\t\t\treturn token.astNode as TextAstNode;\n\n\t\t\tcase TokenKind.OpeningBracket: {\n\t\t\t\tconst set = openedBracketIds.merge(token.bracketIds);\n\t\t\t\tconst child = this.parseList(set);\n\n\t\t\t\tconst nextToken = this.tokenizer.peek();\n\t\t\t\tif (\n\t\t\t\t\tnextToken &&\n\t\t\t\t\tnextToken.kind === TokenKind.ClosingBracket &&\n\t\t\t\t\t(nextToken.bracketId === token.bracketId || nextToken.bracketIds.intersects(token.bracketIds))\n\t\t\t\t) {\n\t\t\t\t\tthis.tokenizer.read();\n\t\t\t\t\treturn PairAstNode.create(\n\t\t\t\t\t\ttoken.astNode as BracketAstNode,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tnextToken.astNode as BracketAstNode\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn PairAstNode.create(\n\t\t\t\t\t\ttoken.astNode as BracketAstNode,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tnull\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error('unexpected');\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { ITextBuffer } from 'vs/editor/common/model';\n\nclass SpacesDiffResult {\n\tpublic spacesDiff: number = 0;\n\tpublic looksLikeAlignment: boolean = false;\n}\n\n/**\n * Compute the diff in spaces between two line's indentation.\n */\nfunction spacesDiff(a: string, aLength: number, b: string, bLength: number, result: SpacesDiffResult): void {\n\n\tresult.spacesDiff = 0;\n\tresult.looksLikeAlignment = false;\n\n\t// This can go both ways (e.g.):\n\t// - a: \"\\t\"\n\t// - b: \"\\t \"\n\t// => This should count 1 tab and 4 spaces\n\n\tlet i: number;\n\n\tfor (i = 0; i < aLength && i < bLength; i++) {\n\t\tconst aCharCode = a.charCodeAt(i);\n\t\tconst bCharCode = b.charCodeAt(i);\n\n\t\tif (aCharCode !== bCharCode) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet aSpacesCnt = 0, aTabsCount = 0;\n\tfor (let j = i; j < aLength; j++) {\n\t\tconst aCharCode = a.charCodeAt(j);\n\t\tif (aCharCode === CharCode.Space) {\n\t\t\taSpacesCnt++;\n\t\t} else {\n\t\t\taTabsCount++;\n\t\t}\n\t}\n\n\tlet bSpacesCnt = 0, bTabsCount = 0;\n\tfor (let j = i; j < bLength; j++) {\n\t\tconst bCharCode = b.charCodeAt(j);\n\t\tif (bCharCode === CharCode.Space) {\n\t\t\tbSpacesCnt++;\n\t\t} else {\n\t\t\tbTabsCount++;\n\t\t}\n\t}\n\n\tif (aSpacesCnt > 0 && aTabsCount > 0) {\n\t\treturn;\n\t}\n\tif (bSpacesCnt > 0 && bTabsCount > 0) {\n\t\treturn;\n\t}\n\n\tconst tabsDiff = Math.abs(aTabsCount - bTabsCount);\n\tconst spacesDiff = Math.abs(aSpacesCnt - bSpacesCnt);\n\n\tif (tabsDiff === 0) {\n\t\t// check if the indentation difference might be caused by alignment reasons\n\t\t// sometime folks like to align their code, but this should not be used as a hint\n\t\tresult.spacesDiff = spacesDiff;\n\n\t\tif (spacesDiff > 0 && 0 <= bSpacesCnt - 1 && bSpacesCnt - 1 < a.length && bSpacesCnt < b.length) {\n\t\t\tif (b.charCodeAt(bSpacesCnt) !== CharCode.Space && a.charCodeAt(bSpacesCnt - 1) === CharCode.Space) {\n\t\t\t\tif (a.charCodeAt(a.length - 1) === CharCode.Comma) {\n\t\t\t\t\t// This looks like an alignment desire: e.g.\n\t\t\t\t\t// const a = b + c,\n\t\t\t\t\t// d = b - c;\n\t\t\t\t\tresult.looksLikeAlignment = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tif (spacesDiff % tabsDiff === 0) {\n\t\tresult.spacesDiff = spacesDiff / tabsDiff;\n\t\treturn;\n\t}\n}\n\n/**\n * Result for a guessIndentation\n */\nexport interface IGuessedIndentation {\n\t/**\n\t * If indentation is based on spaces (`insertSpaces` = true), then what is the number of spaces that make an indent?\n\t */\n\ttabSize: number;\n\t/**\n\t * Is indentation based on spaces?\n\t */\n\tinsertSpaces: boolean;\n}\n\nexport function guessIndentation(source: ITextBuffer, defaultTabSize: number, defaultInsertSpaces: boolean): IGuessedIndentation {\n\t// Look at most at the first 10k lines\n\tconst linesCount = Math.min(source.getLineCount(), 10000);\n\n\tlet linesIndentedWithTabsCount = 0;\t\t\t\t// number of lines that contain at least one tab in indentation\n\tlet linesIndentedWithSpacesCount = 0;\t\t\t// number of lines that contain only spaces in indentation\n\n\tlet previousLineText = '';\t\t\t\t\t\t// content of latest line that contained non-whitespace chars\n\tlet previousLineIndentation = 0;\t\t\t\t// index at which latest line contained the first non-whitespace char\n\n\tconst ALLOWED_TAB_SIZE_GUESSES = [2, 4, 6, 8, 3, 5, 7];\t// prefer even guesses for `tabSize`, limit to [2, 8].\n\tconst MAX_ALLOWED_TAB_SIZE_GUESS = 8;\t\t\t// max(ALLOWED_TAB_SIZE_GUESSES) = 8\n\n\tconst spacesDiffCount = [0, 0, 0, 0, 0, 0, 0, 0, 0];\t\t// `tabSize` scores\n\tconst tmp = new SpacesDiffResult();\n\n\tfor (let lineNumber = 1; lineNumber <= linesCount; lineNumber++) {\n\t\tconst currentLineLength = source.getLineLength(lineNumber);\n\t\tconst currentLineText = source.getLineContent(lineNumber);\n\n\t\t// if the text buffer is chunk based, so long lines are cons-string, v8 will flattern the string when we check charCode.\n\t\t// checking charCode on chunks directly is cheaper.\n\t\tconst useCurrentLineText = (currentLineLength <= 65536);\n\n\t\tlet currentLineHasContent = false;\t\t\t// does `currentLineText` contain non-whitespace chars\n\t\tlet currentLineIndentation = 0;\t\t\t\t// index at which `currentLineText` contains the first non-whitespace char\n\t\tlet currentLineSpacesCount = 0;\t\t\t\t// count of spaces found in `currentLineText` indentation\n\t\tlet currentLineTabsCount = 0;\t\t\t\t// count of tabs found in `currentLineText` indentation\n\t\tfor (let j = 0, lenJ = currentLineLength; j < lenJ; j++) {\n\t\t\tconst charCode = (useCurrentLineText ? currentLineText.charCodeAt(j) : source.getLineCharCode(lineNumber, j));\n\n\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\tcurrentLineTabsCount++;\n\t\t\t} else if (charCode === CharCode.Space) {\n\t\t\t\tcurrentLineSpacesCount++;\n\t\t\t} else {\n\t\t\t\t// Hit non whitespace character on this line\n\t\t\t\tcurrentLineHasContent = true;\n\t\t\t\tcurrentLineIndentation = j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Ignore empty or only whitespace lines\n\t\tif (!currentLineHasContent) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (currentLineTabsCount > 0) {\n\t\t\tlinesIndentedWithTabsCount++;\n\t\t} else if (currentLineSpacesCount > 1) {\n\t\t\tlinesIndentedWithSpacesCount++;\n\t\t}\n\n\t\tspacesDiff(previousLineText, previousLineIndentation, currentLineText, currentLineIndentation, tmp);\n\n\t\tif (tmp.looksLikeAlignment) {\n\t\t\t// if defaultInsertSpaces === true && the spaces count == tabSize, we may want to count it as valid indentation\n\t\t\t//\n\t\t\t// - item1\n\t\t\t// - item2\n\t\t\t//\n\t\t\t// otherwise skip this line entirely\n\t\t\t//\n\t\t\t// const a = 1,\n\t\t\t// b = 2;\n\n\t\t\tif (!(defaultInsertSpaces && defaultTabSize === tmp.spacesDiff)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst currentSpacesDiff = tmp.spacesDiff;\n\t\tif (currentSpacesDiff <= MAX_ALLOWED_TAB_SIZE_GUESS) {\n\t\t\tspacesDiffCount[currentSpacesDiff]++;\n\t\t}\n\n\t\tpreviousLineText = currentLineText;\n\t\tpreviousLineIndentation = currentLineIndentation;\n\t}\n\n\tlet insertSpaces = defaultInsertSpaces;\n\tif (linesIndentedWithTabsCount !== linesIndentedWithSpacesCount) {\n\t\tinsertSpaces = (linesIndentedWithTabsCount < linesIndentedWithSpacesCount);\n\t}\n\n\tlet tabSize = defaultTabSize;\n\n\t// Guess tabSize only if inserting spaces...\n\tif (insertSpaces) {\n\t\tlet tabSizeScore = (insertSpaces ? 0 : 0.1 * linesCount);\n\n\t\t// console.log(\"score threshold: \" + tabSizeScore);\n\n\t\tALLOWED_TAB_SIZE_GUESSES.forEach((possibleTabSize) => {\n\t\t\tconst possibleTabSizeScore = spacesDiffCount[possibleTabSize];\n\t\t\tif (possibleTabSizeScore > tabSizeScore) {\n\t\t\t\ttabSizeScore = possibleTabSizeScore;\n\t\t\t\ttabSize = possibleTabSize;\n\t\t\t}\n\t\t});\n\n\t\t// Let a tabSize of 2 win even if it is not the maximum\n\t\t// (only in case 4 was guessed)\n\t\tif (tabSize === 4 && spacesDiffCount[4] > 0 && spacesDiffCount[2] > 0 && spacesDiffCount[2] >= spacesDiffCount[4] / 2) {\n\t\t\ttabSize = 2;\n\t\t}\n\t}\n\n\n\t// console.log('--------------------------');\n\t// console.log('linesIndentedWithTabsCount: ' + linesIndentedWithTabsCount + ', linesIndentedWithSpacesCount: ' + linesIndentedWithSpacesCount);\n\t// console.log('spacesDiffCount: ' + spacesDiffCount);\n\t// console.log('tabSize: ' + tabSize + ', tabSizeScore: ' + tabSizeScore);\n\n\treturn {\n\t\tinsertSpaces: insertSpaces,\n\t\ttabSize: tabSize\n\t};\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 { Range } from 'vs/editor/common/core/range';\nimport { TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\n\n//\n// The red-black tree is based on the \"Introduction to Algorithms\" by Cormen, Leiserson and Rivest.\n//\n\nexport const enum ClassName {\n\tEditorHintDecoration = 'squiggly-hint',\n\tEditorInfoDecoration = 'squiggly-info',\n\tEditorWarningDecoration = 'squiggly-warning',\n\tEditorErrorDecoration = 'squiggly-error',\n\tEditorUnnecessaryDecoration = 'squiggly-unnecessary',\n\tEditorUnnecessaryInlineDecoration = 'squiggly-inline-unnecessary',\n\tEditorDeprecatedInlineDecoration = 'squiggly-inline-deprecated'\n}\n\nexport const enum NodeColor {\n\tBlack = 0,\n\tRed = 1,\n}\n\nconst enum Constants {\n\tColorMask = 0b00000001,\n\tColorMaskInverse = 0b11111110,\n\tColorOffset = 0,\n\n\tIsVisitedMask = 0b00000010,\n\tIsVisitedMaskInverse = 0b11111101,\n\tIsVisitedOffset = 1,\n\n\tIsForValidationMask = 0b00000100,\n\tIsForValidationMaskInverse = 0b11111011,\n\tIsForValidationOffset = 2,\n\n\tStickinessMask = 0b00011000,\n\tStickinessMaskInverse = 0b11100111,\n\tStickinessOffset = 3,\n\n\tCollapseOnReplaceEditMask = 0b00100000,\n\tCollapseOnReplaceEditMaskInverse = 0b11011111,\n\tCollapseOnReplaceEditOffset = 5,\n\n\t/**\n\t * Due to how deletion works (in order to avoid always walking the right subtree of the deleted node),\n\t * the deltas for nodes can grow and shrink dramatically. It has been observed, in practice, that unless\n\t * the deltas are corrected, integer overflow will occur.\n\t *\n\t * The integer overflow occurs when 53 bits are used in the numbers, but we will try to avoid it as\n\t * a node's delta gets below a negative 30 bits number.\n\t *\n\t * MIN SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMIN_SAFE_DELTA = -(1 << 30),\n\t/**\n\t * MAX SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMAX_SAFE_DELTA = 1 << 30,\n}\n\nexport function getNodeColor(node: IntervalNode): NodeColor {\n\treturn ((node.metadata & Constants.ColorMask) >>> Constants.ColorOffset);\n}\nfunction setNodeColor(node: IntervalNode, color: NodeColor): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.ColorMaskInverse) | (color << Constants.ColorOffset)\n\t);\n}\nfunction getNodeIsVisited(node: IntervalNode): boolean {\n\treturn ((node.metadata & Constants.IsVisitedMask) >>> Constants.IsVisitedOffset) === 1;\n}\nfunction setNodeIsVisited(node: IntervalNode, value: boolean): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.IsVisitedMaskInverse) | ((value ? 1 : 0) << Constants.IsVisitedOffset)\n\t);\n}\nfunction getNodeIsForValidation(node: IntervalNode): boolean {\n\treturn ((node.metadata & Constants.IsForValidationMask) >>> Constants.IsForValidationOffset) === 1;\n}\nfunction setNodeIsForValidation(node: IntervalNode, value: boolean): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.IsForValidationMaskInverse) | ((value ? 1 : 0) << Constants.IsForValidationOffset)\n\t);\n}\nfunction getNodeStickiness(node: IntervalNode): TrackedRangeStickiness {\n\treturn ((node.metadata & Constants.StickinessMask) >>> Constants.StickinessOffset);\n}\nfunction _setNodeStickiness(node: IntervalNode, stickiness: TrackedRangeStickiness): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.StickinessMaskInverse) | (stickiness << Constants.StickinessOffset)\n\t);\n}\nfunction getCollapseOnReplaceEdit(node: IntervalNode): boolean {\n\treturn ((node.metadata & Constants.CollapseOnReplaceEditMask) >>> Constants.CollapseOnReplaceEditOffset) === 1;\n}\nfunction setCollapseOnReplaceEdit(node: IntervalNode, value: boolean): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.CollapseOnReplaceEditMaskInverse) | ((value ? 1 : 0) << Constants.CollapseOnReplaceEditOffset)\n\t);\n}\n\nexport class IntervalNode {\n\n\t/**\n\t * contains binary encoded information for color, visited, isForValidation and stickiness.\n\t */\n\tpublic metadata: number;\n\n\tpublic parent: IntervalNode;\n\tpublic left: IntervalNode;\n\tpublic right: IntervalNode;\n\n\tpublic start: number;\n\tpublic end: number;\n\tpublic delta: number;\n\tpublic maxEnd: number;\n\n\tpublic id: string;\n\tpublic ownerId: number;\n\tpublic options: ModelDecorationOptions;\n\n\tpublic cachedVersionId: number;\n\tpublic cachedAbsoluteStart: number;\n\tpublic cachedAbsoluteEnd: number;\n\tpublic range: Range | null;\n\n\tconstructor(id: string, start: number, end: number) {\n\t\tthis.metadata = 0;\n\n\t\tthis.parent = this;\n\t\tthis.left = this;\n\t\tthis.right = this;\n\t\tsetNodeColor(this, NodeColor.Red);\n\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\t// FORCE_OVERFLOWING_TEST: this.delta = start;\n\t\tthis.delta = 0;\n\t\tthis.maxEnd = end;\n\n\t\tthis.id = id;\n\t\tthis.ownerId = 0;\n\t\tthis.options = null!;\n\t\tsetNodeIsForValidation(this, false);\n\t\t_setNodeStickiness(this, TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges);\n\t\tsetCollapseOnReplaceEdit(this, false);\n\n\t\tthis.cachedVersionId = 0;\n\t\tthis.cachedAbsoluteStart = start;\n\t\tthis.cachedAbsoluteEnd = end;\n\t\tthis.range = null;\n\n\t\tsetNodeIsVisited(this, false);\n\t}\n\n\tpublic reset(versionId: number, start: number, end: number, range: Range): void {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.maxEnd = end;\n\t\tthis.cachedVersionId = versionId;\n\t\tthis.cachedAbsoluteStart = start;\n\t\tthis.cachedAbsoluteEnd = end;\n\t\tthis.range = range;\n\t}\n\n\tpublic setOptions(options: ModelDecorationOptions) {\n\t\tthis.options = options;\n\t\tconst className = this.options.className;\n\t\tsetNodeIsForValidation(this, (\n\t\t\tclassName === ClassName.EditorErrorDecoration\n\t\t\t|| className === ClassName.EditorWarningDecoration\n\t\t\t|| className === ClassName.EditorInfoDecoration\n\t\t));\n\t\t_setNodeStickiness(this, <number>this.options.stickiness);\n\t\tsetCollapseOnReplaceEdit(this, this.options.collapseOnReplaceEdit);\n\t}\n\n\tpublic setCachedOffsets(absoluteStart: number, absoluteEnd: number, cachedVersionId: number): void {\n\t\tif (this.cachedVersionId !== cachedVersionId) {\n\t\t\tthis.range = null;\n\t\t}\n\t\tthis.cachedVersionId = cachedVersionId;\n\t\tthis.cachedAbsoluteStart = absoluteStart;\n\t\tthis.cachedAbsoluteEnd = absoluteEnd;\n\t}\n\n\tpublic detach(): void {\n\t\tthis.parent = null!;\n\t\tthis.left = null!;\n\t\tthis.right = null!;\n\t}\n}\n\nexport const SENTINEL: IntervalNode = new IntervalNode(null!, 0, 0);\nSENTINEL.parent = SENTINEL;\nSENTINEL.left = SENTINEL;\nSENTINEL.right = SENTINEL;\nsetNodeColor(SENTINEL, NodeColor.Black);\n\nexport class IntervalTree {\n\n\tpublic root: IntervalNode;\n\tpublic requestNormalizeDelta: boolean;\n\n\tconstructor() {\n\t\tthis.root = SENTINEL;\n\t\tthis.requestNormalizeDelta = false;\n\t}\n\n\tpublic intervalSearch(start: number, end: number, filterOwnerId: number, filterOutValidation: boolean, cachedVersionId: number): IntervalNode[] {\n\t\tif (this.root === SENTINEL) {\n\t\t\treturn [];\n\t\t}\n\t\treturn intervalSearch(this, start, end, filterOwnerId, filterOutValidation, cachedVersionId);\n\t}\n\n\tpublic search(filterOwnerId: number, filterOutValidation: boolean, cachedVersionId: number): IntervalNode[] {\n\t\tif (this.root === SENTINEL) {\n\t\t\treturn [];\n\t\t}\n\t\treturn search(this, filterOwnerId, filterOutValidation, cachedVersionId);\n\t}\n\n\t/**\n\t * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes!\n\t */\n\tpublic collectNodesFromOwner(ownerId: number): IntervalNode[] {\n\t\treturn collectNodesFromOwner(this, ownerId);\n\t}\n\n\t/**\n\t * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes!\n\t */\n\tpublic collectNodesPostOrder(): IntervalNode[] {\n\t\treturn collectNodesPostOrder(this);\n\t}\n\n\tpublic insert(node: IntervalNode): void {\n\t\trbTreeInsert(this, node);\n\t\tthis._normalizeDeltaIfNecessary();\n\t}\n\n\tpublic delete(node: IntervalNode): void {\n\t\trbTreeDelete(this, node);\n\t\tthis._normalizeDeltaIfNecessary();\n\t}\n\n\tpublic resolveNode(node: IntervalNode, cachedVersionId: number): void {\n\t\tconst initialNode = node;\n\t\tlet delta = 0;\n\t\twhile (node !== this.root) {\n\t\t\tif (node === node.parent.right) {\n\t\t\t\tdelta += node.parent.delta;\n\t\t\t}\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\tconst nodeStart = initialNode.start + delta;\n\t\tconst nodeEnd = initialNode.end + delta;\n\t\tinitialNode.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId);\n\t}\n\n\tpublic acceptReplace(offset: number, length: number, textLength: number, forceMoveMarkers: boolean): void {\n\t\t// Our strategy is to remove all directly impacted nodes, and then add them back to the tree.\n\n\t\t// (1) collect all nodes that are intersecting this edit as nodes of interest\n\t\tconst nodesOfInterest = searchForEditing(this, offset, offset + length);\n\n\t\t// (2) remove all nodes that are intersecting this edit\n\t\tfor (let i = 0, len = nodesOfInterest.length; i < len; i++) {\n\t\t\tconst node = nodesOfInterest[i];\n\t\t\trbTreeDelete(this, node);\n\t\t}\n\t\tthis._normalizeDeltaIfNecessary();\n\n\t\t// (3) edit all tree nodes except the nodes of interest\n\t\tnoOverlapReplace(this, offset, offset + length, textLength);\n\t\tthis._normalizeDeltaIfNecessary();\n\n\t\t// (4) edit the nodes of interest and insert them back in the tree\n\t\tfor (let i = 0, len = nodesOfInterest.length; i < len; i++) {\n\t\t\tconst node = nodesOfInterest[i];\n\t\t\tnode.start = node.cachedAbsoluteStart;\n\t\t\tnode.end = node.cachedAbsoluteEnd;\n\t\t\tnodeAcceptEdit(node, offset, (offset + length), textLength, forceMoveMarkers);\n\t\t\tnode.maxEnd = node.end;\n\t\t\trbTreeInsert(this, node);\n\t\t}\n\t\tthis._normalizeDeltaIfNecessary();\n\t}\n\n\tprivate _normalizeDeltaIfNecessary(): void {\n\t\tif (!this.requestNormalizeDelta) {\n\t\t\treturn;\n\t\t}\n\t\tthis.requestNormalizeDelta = false;\n\t\tnormalizeDelta(this);\n\t}\n}\n\n//#region Delta Normalization\nfunction normalizeDelta(T: IntervalTree): void {\n\tlet node = T.root;\n\tlet delta = 0;\n\twhile (node !== SENTINEL) {\n\n\t\tif (node.left !== SENTINEL && !getNodeIsVisited(node.left)) {\n\t\t\t// go left\n\t\t\tnode = node.left;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tdelta += node.delta;\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// handle current node\n\t\tnode.start = delta + node.start;\n\t\tnode.end = delta + node.end;\n\t\tnode.delta = 0;\n\t\trecomputeMaxEnd(node);\n\n\t\tsetNodeIsVisited(node, true);\n\n\t\t// going up from this node\n\t\tsetNodeIsVisited(node.left, false);\n\t\tsetNodeIsVisited(node.right, false);\n\t\tif (node === node.parent.right) {\n\t\t\tdelta -= node.parent.delta;\n\t\t}\n\t\tnode = node.parent;\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n}\n//#endregion\n\n//#region Editing\n\nconst enum MarkerMoveSemantics {\n\tMarkerDefined = 0,\n\tForceMove = 1,\n\tForceStay = 2\n}\n\nfunction adjustMarkerBeforeColumn(markerOffset: number, markerStickToPreviousCharacter: boolean, checkOffset: number, moveSemantics: MarkerMoveSemantics): boolean {\n\tif (markerOffset < checkOffset) {\n\t\treturn true;\n\t}\n\tif (markerOffset > checkOffset) {\n\t\treturn false;\n\t}\n\tif (moveSemantics === MarkerMoveSemantics.ForceMove) {\n\t\treturn false;\n\t}\n\tif (moveSemantics === MarkerMoveSemantics.ForceStay) {\n\t\treturn true;\n\t}\n\treturn markerStickToPreviousCharacter;\n}\n\n/**\n * This is a lot more complicated than strictly necessary to maintain the same behaviour\n * as when decorations were implemented using two markers.\n */\nexport function nodeAcceptEdit(node: IntervalNode, start: number, end: number, textLength: number, forceMoveMarkers: boolean): void {\n\tconst nodeStickiness = getNodeStickiness(node);\n\tconst startStickToPreviousCharacter = (\n\t\tnodeStickiness === TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges\n\t\t|| nodeStickiness === TrackedRangeStickiness.GrowsOnlyWhenTypingBefore\n\t);\n\tconst endStickToPreviousCharacter = (\n\t\tnodeStickiness === TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t\t|| nodeStickiness === TrackedRangeStickiness.GrowsOnlyWhenTypingBefore\n\t);\n\n\tconst deletingCnt = (end - start);\n\tconst insertingCnt = textLength;\n\tconst commonLength = Math.min(deletingCnt, insertingCnt);\n\n\tconst nodeStart = node.start;\n\tlet startDone = false;\n\n\tconst nodeEnd = node.end;\n\tlet endDone = false;\n\n\tif (start <= nodeStart && nodeEnd <= end && getCollapseOnReplaceEdit(node)) {\n\t\t// This edit encompasses the entire decoration range\n\t\t// and the decoration has asked to become collapsed\n\t\tnode.start = start;\n\t\tstartDone = true;\n\t\tnode.end = start;\n\t\tendDone = true;\n\t}\n\n\t{\n\t\tconst moveSemantics = forceMoveMarkers ? MarkerMoveSemantics.ForceMove : (deletingCnt > 0 ? MarkerMoveSemantics.ForceStay : MarkerMoveSemantics.MarkerDefined);\n\t\tif (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start, moveSemantics)) {\n\t\t\tstartDone = true;\n\t\t}\n\t\tif (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start, moveSemantics)) {\n\t\t\tendDone = true;\n\t\t}\n\t}\n\n\tif (commonLength > 0 && !forceMoveMarkers) {\n\t\tconst moveSemantics = (deletingCnt > insertingCnt ? MarkerMoveSemantics.ForceStay : MarkerMoveSemantics.MarkerDefined);\n\t\tif (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start + commonLength, moveSemantics)) {\n\t\t\tstartDone = true;\n\t\t}\n\t\tif (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start + commonLength, moveSemantics)) {\n\t\t\tendDone = true;\n\t\t}\n\t}\n\n\t{\n\t\tconst moveSemantics = forceMoveMarkers ? MarkerMoveSemantics.ForceMove : MarkerMoveSemantics.MarkerDefined;\n\t\tif (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, end, moveSemantics)) {\n\t\t\tnode.start = start + insertingCnt;\n\t\t\tstartDone = true;\n\t\t}\n\t\tif (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, end, moveSemantics)) {\n\t\t\tnode.end = start + insertingCnt;\n\t\t\tendDone = true;\n\t\t}\n\t}\n\n\t// Finish\n\tconst deltaColumn = (insertingCnt - deletingCnt);\n\tif (!startDone) {\n\t\tnode.start = Math.max(0, nodeStart + deltaColumn);\n\t}\n\tif (!endDone) {\n\t\tnode.end = Math.max(0, nodeEnd + deltaColumn);\n\t}\n\n\tif (node.start > node.end) {\n\t\tnode.end = node.start;\n\t}\n}\n\nfunction searchForEditing(T: IntervalTree, start: number, end: number): IntervalNode[] {\n\t// https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree\n\t// Now, it is known that two intervals A and B overlap only when both\n\t// A.low <= B.high and A.high >= B.low. When searching the trees for\n\t// nodes overlapping with a given interval, you can immediately skip:\n\t// a) all nodes to the right of nodes whose low value is past the end of the given interval.\n\t// b) all nodes that have their maximum 'high' value below the start of the given interval.\n\tlet node = T.root;\n\tlet delta = 0;\n\tlet nodeMaxEnd = 0;\n\tlet nodeStart = 0;\n\tlet nodeEnd = 0;\n\tconst result: IntervalNode[] = [];\n\tlet resultLen = 0;\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tif (node === node.parent.right) {\n\t\t\t\tdelta -= node.parent.delta;\n\t\t\t}\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!getNodeIsVisited(node.left)) {\n\t\t\t// first time seeing this node\n\t\t\tnodeMaxEnd = delta + node.maxEnd;\n\t\t\tif (nodeMaxEnd < start) {\n\t\t\t\t// cover case b) from above\n\t\t\t\t// there is no need to search this node or its children\n\t\t\t\tsetNodeIsVisited(node, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (node.left !== SENTINEL) {\n\t\t\t\t// go left\n\t\t\t\tnode = node.left;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// handle current node\n\t\tnodeStart = delta + node.start;\n\t\tif (nodeStart > end) {\n\t\t\t// cover case a) from above\n\t\t\t// there is no need to search this node or its right subtree\n\t\t\tsetNodeIsVisited(node, true);\n\t\t\tcontinue;\n\t\t}\n\n\t\tnodeEnd = delta + node.end;\n\t\tif (nodeEnd >= start) {\n\t\t\tnode.setCachedOffsets(nodeStart, nodeEnd, 0);\n\t\t\tresult[resultLen++] = node;\n\t\t}\n\t\tsetNodeIsVisited(node, true);\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tdelta += node.delta;\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n\n\treturn result;\n}\n\nfunction noOverlapReplace(T: IntervalTree, start: number, end: number, textLength: number): void {\n\t// https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree\n\t// Now, it is known that two intervals A and B overlap only when both\n\t// A.low <= B.high and A.high >= B.low. When searching the trees for\n\t// nodes overlapping with a given interval, you can immediately skip:\n\t// a) all nodes to the right of nodes whose low value is past the end of the given interval.\n\t// b) all nodes that have their maximum 'high' value below the start of the given interval.\n\tlet node = T.root;\n\tlet delta = 0;\n\tlet nodeMaxEnd = 0;\n\tlet nodeStart = 0;\n\tconst editDelta = (textLength - (end - start));\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tif (node === node.parent.right) {\n\t\t\t\tdelta -= node.parent.delta;\n\t\t\t}\n\t\t\trecomputeMaxEnd(node);\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!getNodeIsVisited(node.left)) {\n\t\t\t// first time seeing this node\n\t\t\tnodeMaxEnd = delta + node.maxEnd;\n\t\t\tif (nodeMaxEnd < start) {\n\t\t\t\t// cover case b) from above\n\t\t\t\t// there is no need to search this node or its children\n\t\t\t\tsetNodeIsVisited(node, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (node.left !== SENTINEL) {\n\t\t\t\t// go left\n\t\t\t\tnode = node.left;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// handle current node\n\t\tnodeStart = delta + node.start;\n\t\tif (nodeStart > end) {\n\t\t\tnode.start += editDelta;\n\t\t\tnode.end += editDelta;\n\t\t\tnode.delta += editDelta;\n\t\t\tif (node.delta < Constants.MIN_SAFE_DELTA || node.delta > Constants.MAX_SAFE_DELTA) {\n\t\t\t\tT.requestNormalizeDelta = true;\n\t\t\t}\n\t\t\t// cover case a) from above\n\t\t\t// there is no need to search this node or its right subtree\n\t\t\tsetNodeIsVisited(node, true);\n\t\t\tcontinue;\n\t\t}\n\n\t\tsetNodeIsVisited(node, true);\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tdelta += node.delta;\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n}\n\n//#endregion\n\n//#region Searching\n\nfunction collectNodesFromOwner(T: IntervalTree, ownerId: number): IntervalNode[] {\n\tlet node = T.root;\n\tconst result: IntervalNode[] = [];\n\tlet resultLen = 0;\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.left !== SENTINEL && !getNodeIsVisited(node.left)) {\n\t\t\t// go left\n\t\t\tnode = node.left;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// handle current node\n\t\tif (node.ownerId === ownerId) {\n\t\t\tresult[resultLen++] = node;\n\t\t}\n\n\t\tsetNodeIsVisited(node, true);\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n\n\treturn result;\n}\n\nfunction collectNodesPostOrder(T: IntervalTree): IntervalNode[] {\n\tlet node = T.root;\n\tconst result: IntervalNode[] = [];\n\tlet resultLen = 0;\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.left !== SENTINEL && !getNodeIsVisited(node.left)) {\n\t\t\t// go left\n\t\t\tnode = node.left;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// handle current node\n\t\tresult[resultLen++] = node;\n\t\tsetNodeIsVisited(node, true);\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n\n\treturn result;\n}\n\nfunction search(T: IntervalTree, filterOwnerId: number, filterOutValidation: boolean, cachedVersionId: number): IntervalNode[] {\n\tlet node = T.root;\n\tlet delta = 0;\n\tlet nodeStart = 0;\n\tlet nodeEnd = 0;\n\tconst result: IntervalNode[] = [];\n\tlet resultLen = 0;\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tif (node === node.parent.right) {\n\t\t\t\tdelta -= node.parent.delta;\n\t\t\t}\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.left !== SENTINEL && !getNodeIsVisited(node.left)) {\n\t\t\t// go left\n\t\t\tnode = node.left;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// handle current node\n\t\tnodeStart = delta + node.start;\n\t\tnodeEnd = delta + node.end;\n\n\t\tnode.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId);\n\n\t\tlet include = true;\n\t\tif (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) {\n\t\t\tinclude = false;\n\t\t}\n\t\tif (filterOutValidation && getNodeIsForValidation(node)) {\n\t\t\tinclude = false;\n\t\t}\n\t\tif (include) {\n\t\t\tresult[resultLen++] = node;\n\t\t}\n\n\t\tsetNodeIsVisited(node, true);\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tdelta += node.delta;\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n\n\treturn result;\n}\n\nfunction intervalSearch(T: IntervalTree, intervalStart: number, intervalEnd: number, filterOwnerId: number, filterOutValidation: boolean, cachedVersionId: number): IntervalNode[] {\n\t// https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree\n\t// Now, it is known that two intervals A and B overlap only when both\n\t// A.low <= B.high and A.high >= B.low. When searching the trees for\n\t// nodes overlapping with a given interval, you can immediately skip:\n\t// a) all nodes to the right of nodes whose low value is past the end of the given interval.\n\t// b) all nodes that have their maximum 'high' value below the start of the given interval.\n\n\tlet node = T.root;\n\tlet delta = 0;\n\tlet nodeMaxEnd = 0;\n\tlet nodeStart = 0;\n\tlet nodeEnd = 0;\n\tconst result: IntervalNode[] = [];\n\tlet resultLen = 0;\n\twhile (node !== SENTINEL) {\n\t\tif (getNodeIsVisited(node)) {\n\t\t\t// going up from this node\n\t\t\tsetNodeIsVisited(node.left, false);\n\t\t\tsetNodeIsVisited(node.right, false);\n\t\t\tif (node === node.parent.right) {\n\t\t\t\tdelta -= node.parent.delta;\n\t\t\t}\n\t\t\tnode = node.parent;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!getNodeIsVisited(node.left)) {\n\t\t\t// first time seeing this node\n\t\t\tnodeMaxEnd = delta + node.maxEnd;\n\t\t\tif (nodeMaxEnd < intervalStart) {\n\t\t\t\t// cover case b) from above\n\t\t\t\t// there is no need to search this node or its children\n\t\t\t\tsetNodeIsVisited(node, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (node.left !== SENTINEL) {\n\t\t\t\t// go left\n\t\t\t\tnode = node.left;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// handle current node\n\t\tnodeStart = delta + node.start;\n\t\tif (nodeStart > intervalEnd) {\n\t\t\t// cover case a) from above\n\t\t\t// there is no need to search this node or its right subtree\n\t\t\tsetNodeIsVisited(node, true);\n\t\t\tcontinue;\n\t\t}\n\n\t\tnodeEnd = delta + node.end;\n\n\t\tif (nodeEnd >= intervalStart) {\n\t\t\t// There is overlap\n\t\t\tnode.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId);\n\n\t\t\tlet include = true;\n\t\t\tif (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) {\n\t\t\t\tinclude = false;\n\t\t\t}\n\t\t\tif (filterOutValidation && getNodeIsForValidation(node)) {\n\t\t\t\tinclude = false;\n\t\t\t}\n\n\t\t\tif (include) {\n\t\t\t\tresult[resultLen++] = node;\n\t\t\t}\n\t\t}\n\n\t\tsetNodeIsVisited(node, true);\n\n\t\tif (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {\n\t\t\t// go right\n\t\t\tdelta += node.delta;\n\t\t\tnode = node.right;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\tsetNodeIsVisited(T.root, false);\n\n\treturn result;\n}\n\n//#endregion\n\n//#region Insertion\nfunction rbTreeInsert(T: IntervalTree, newNode: IntervalNode): IntervalNode {\n\tif (T.root === SENTINEL) {\n\t\tnewNode.parent = SENTINEL;\n\t\tnewNode.left = SENTINEL;\n\t\tnewNode.right = SENTINEL;\n\t\tsetNodeColor(newNode, NodeColor.Black);\n\t\tT.root = newNode;\n\t\treturn T.root;\n\t}\n\n\ttreeInsert(T, newNode);\n\n\trecomputeMaxEndWalkToRoot(newNode.parent);\n\n\t// repair tree\n\tlet x = newNode;\n\twhile (x !== T.root && getNodeColor(x.parent) === NodeColor.Red) {\n\t\tif (x.parent === x.parent.parent.left) {\n\t\t\tconst y = x.parent.parent.right;\n\n\t\t\tif (getNodeColor(y) === NodeColor.Red) {\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(y, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent.parent, NodeColor.Red);\n\t\t\t\tx = x.parent.parent;\n\t\t\t} else {\n\t\t\t\tif (x === x.parent.right) {\n\t\t\t\t\tx = x.parent;\n\t\t\t\t\tleftRotate(T, x);\n\t\t\t\t}\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent.parent, NodeColor.Red);\n\t\t\t\trightRotate(T, x.parent.parent);\n\t\t\t}\n\t\t} else {\n\t\t\tconst y = x.parent.parent.left;\n\n\t\t\tif (getNodeColor(y) === NodeColor.Red) {\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(y, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent.parent, NodeColor.Red);\n\t\t\t\tx = x.parent.parent;\n\t\t\t} else {\n\t\t\t\tif (x === x.parent.left) {\n\t\t\t\t\tx = x.parent;\n\t\t\t\t\trightRotate(T, x);\n\t\t\t\t}\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent.parent, NodeColor.Red);\n\t\t\t\tleftRotate(T, x.parent.parent);\n\t\t\t}\n\t\t}\n\t}\n\n\tsetNodeColor(T.root, NodeColor.Black);\n\n\treturn newNode;\n}\n\nfunction treeInsert(T: IntervalTree, z: IntervalNode): void {\n\tlet delta: number = 0;\n\tlet x = T.root;\n\tconst zAbsoluteStart = z.start;\n\tconst zAbsoluteEnd = z.end;\n\twhile (true) {\n\t\tconst cmp = intervalCompare(zAbsoluteStart, zAbsoluteEnd, x.start + delta, x.end + delta);\n\t\tif (cmp < 0) {\n\t\t\t// this node should be inserted to the left\n\t\t\t// => it is not affected by the node's delta\n\t\t\tif (x.left === SENTINEL) {\n\t\t\t\tz.start -= delta;\n\t\t\t\tz.end -= delta;\n\t\t\t\tz.maxEnd -= delta;\n\t\t\t\tx.left = z;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tx = x.left;\n\t\t\t}\n\t\t} else {\n\t\t\t// this node should be inserted to the right\n\t\t\t// => it is not affected by the node's delta\n\t\t\tif (x.right === SENTINEL) {\n\t\t\t\tz.start -= (delta + x.delta);\n\t\t\t\tz.end -= (delta + x.delta);\n\t\t\t\tz.maxEnd -= (delta + x.delta);\n\t\t\t\tx.right = z;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tdelta += x.delta;\n\t\t\t\tx = x.right;\n\t\t\t}\n\t\t}\n\t}\n\n\tz.parent = x;\n\tz.left = SENTINEL;\n\tz.right = SENTINEL;\n\tsetNodeColor(z, NodeColor.Red);\n}\n//#endregion\n\n//#region Deletion\nfunction rbTreeDelete(T: IntervalTree, z: IntervalNode): void {\n\n\tlet x: IntervalNode;\n\tlet y: IntervalNode;\n\n\t// RB-DELETE except we don't swap z and y in case c)\n\t// i.e. we always delete what's pointed at by z.\n\n\tif (z.left === SENTINEL) {\n\t\tx = z.right;\n\t\ty = z;\n\n\t\t// x's delta is no longer influenced by z's delta\n\t\tx.delta += z.delta;\n\t\tif (x.delta < Constants.MIN_SAFE_DELTA || x.delta > Constants.MAX_SAFE_DELTA) {\n\t\t\tT.requestNormalizeDelta = true;\n\t\t}\n\t\tx.start += z.delta;\n\t\tx.end += z.delta;\n\n\t} else if (z.right === SENTINEL) {\n\t\tx = z.left;\n\t\ty = z;\n\n\t} else {\n\t\ty = leftest(z.right);\n\t\tx = y.right;\n\n\t\t// y's delta is no longer influenced by z's delta,\n\t\t// but we don't want to walk the entire right-hand-side subtree of x.\n\t\t// we therefore maintain z's delta in y, and adjust only x\n\t\tx.start += y.delta;\n\t\tx.end += y.delta;\n\t\tx.delta += y.delta;\n\t\tif (x.delta < Constants.MIN_SAFE_DELTA || x.delta > Constants.MAX_SAFE_DELTA) {\n\t\t\tT.requestNormalizeDelta = true;\n\t\t}\n\n\t\ty.start += z.delta;\n\t\ty.end += z.delta;\n\t\ty.delta = z.delta;\n\t\tif (y.delta < Constants.MIN_SAFE_DELTA || y.delta > Constants.MAX_SAFE_DELTA) {\n\t\t\tT.requestNormalizeDelta = true;\n\t\t}\n\t}\n\n\tif (y === T.root) {\n\t\tT.root = x;\n\t\tsetNodeColor(x, NodeColor.Black);\n\n\t\tz.detach();\n\t\tresetSentinel();\n\t\trecomputeMaxEnd(x);\n\t\tT.root.parent = SENTINEL;\n\t\treturn;\n\t}\n\n\tconst yWasRed = (getNodeColor(y) === NodeColor.Red);\n\n\tif (y === y.parent.left) {\n\t\ty.parent.left = x;\n\t} else {\n\t\ty.parent.right = x;\n\t}\n\n\tif (y === z) {\n\t\tx.parent = y.parent;\n\t} else {\n\n\t\tif (y.parent === z) {\n\t\t\tx.parent = y;\n\t\t} else {\n\t\t\tx.parent = y.parent;\n\t\t}\n\n\t\ty.left = z.left;\n\t\ty.right = z.right;\n\t\ty.parent = z.parent;\n\t\tsetNodeColor(y, getNodeColor(z));\n\n\t\tif (z === T.root) {\n\t\t\tT.root = y;\n\t\t} else {\n\t\t\tif (z === z.parent.left) {\n\t\t\t\tz.parent.left = y;\n\t\t\t} else {\n\t\t\t\tz.parent.right = y;\n\t\t\t}\n\t\t}\n\n\t\tif (y.left !== SENTINEL) {\n\t\t\ty.left.parent = y;\n\t\t}\n\t\tif (y.right !== SENTINEL) {\n\t\t\ty.right.parent = y;\n\t\t}\n\t}\n\n\tz.detach();\n\n\tif (yWasRed) {\n\t\trecomputeMaxEndWalkToRoot(x.parent);\n\t\tif (y !== z) {\n\t\t\trecomputeMaxEndWalkToRoot(y);\n\t\t\trecomputeMaxEndWalkToRoot(y.parent);\n\t\t}\n\t\tresetSentinel();\n\t\treturn;\n\t}\n\n\trecomputeMaxEndWalkToRoot(x);\n\trecomputeMaxEndWalkToRoot(x.parent);\n\tif (y !== z) {\n\t\trecomputeMaxEndWalkToRoot(y);\n\t\trecomputeMaxEndWalkToRoot(y.parent);\n\t}\n\n\t// RB-DELETE-FIXUP\n\tlet w: IntervalNode;\n\twhile (x !== T.root && getNodeColor(x) === NodeColor.Black) {\n\n\t\tif (x === x.parent.left) {\n\t\t\tw = x.parent.right;\n\n\t\t\tif (getNodeColor(w) === NodeColor.Red) {\n\t\t\t\tsetNodeColor(w, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Red);\n\t\t\t\tleftRotate(T, x.parent);\n\t\t\t\tw = x.parent.right;\n\t\t\t}\n\n\t\t\tif (getNodeColor(w.left) === NodeColor.Black && getNodeColor(w.right) === NodeColor.Black) {\n\t\t\t\tsetNodeColor(w, NodeColor.Red);\n\t\t\t\tx = x.parent;\n\t\t\t} else {\n\t\t\t\tif (getNodeColor(w.right) === NodeColor.Black) {\n\t\t\t\t\tsetNodeColor(w.left, NodeColor.Black);\n\t\t\t\t\tsetNodeColor(w, NodeColor.Red);\n\t\t\t\t\trightRotate(T, w);\n\t\t\t\t\tw = x.parent.right;\n\t\t\t\t}\n\n\t\t\t\tsetNodeColor(w, getNodeColor(x.parent));\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(w.right, NodeColor.Black);\n\t\t\t\tleftRotate(T, x.parent);\n\t\t\t\tx = T.root;\n\t\t\t}\n\n\t\t} else {\n\t\t\tw = x.parent.left;\n\n\t\t\tif (getNodeColor(w) === NodeColor.Red) {\n\t\t\t\tsetNodeColor(w, NodeColor.Black);\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Red);\n\t\t\t\trightRotate(T, x.parent);\n\t\t\t\tw = x.parent.left;\n\t\t\t}\n\n\t\t\tif (getNodeColor(w.left) === NodeColor.Black && getNodeColor(w.right) === NodeColor.Black) {\n\t\t\t\tsetNodeColor(w, NodeColor.Red);\n\t\t\t\tx = x.parent;\n\n\t\t\t} else {\n\t\t\t\tif (getNodeColor(w.left) === NodeColor.Black) {\n\t\t\t\t\tsetNodeColor(w.right, NodeColor.Black);\n\t\t\t\t\tsetNodeColor(w, NodeColor.Red);\n\t\t\t\t\tleftRotate(T, w);\n\t\t\t\t\tw = x.parent.left;\n\t\t\t\t}\n\n\t\t\t\tsetNodeColor(w, getNodeColor(x.parent));\n\t\t\t\tsetNodeColor(x.parent, NodeColor.Black);\n\t\t\t\tsetNodeColor(w.left, NodeColor.Black);\n\t\t\t\trightRotate(T, x.parent);\n\t\t\t\tx = T.root;\n\t\t\t}\n\t\t}\n\t}\n\n\tsetNodeColor(x, NodeColor.Black);\n\tresetSentinel();\n}\n\nfunction leftest(node: IntervalNode): IntervalNode {\n\twhile (node.left !== SENTINEL) {\n\t\tnode = node.left;\n\t}\n\treturn node;\n}\n\nfunction resetSentinel(): void {\n\tSENTINEL.parent = SENTINEL;\n\tSENTINEL.delta = 0; // optional\n\tSENTINEL.start = 0; // optional\n\tSENTINEL.end = 0; // optional\n}\n//#endregion\n\n//#region Rotations\nfunction leftRotate(T: IntervalTree, x: IntervalNode): void {\n\tconst y = x.right;\t\t\t\t// set y.\n\n\ty.delta += x.delta;\t\t\t\t// y's delta is no longer influenced by x's delta\n\tif (y.delta < Constants.MIN_SAFE_DELTA || y.delta > Constants.MAX_SAFE_DELTA) {\n\t\tT.requestNormalizeDelta = true;\n\t}\n\ty.start += x.delta;\n\ty.end += x.delta;\n\n\tx.right = y.left;\t\t\t\t// turn y's left subtree into x's right subtree.\n\tif (y.left !== SENTINEL) {\n\t\ty.left.parent = x;\n\t}\n\ty.parent = x.parent;\t\t\t// link x's parent to y.\n\tif (x.parent === SENTINEL) {\n\t\tT.root = y;\n\t} else if (x === x.parent.left) {\n\t\tx.parent.left = y;\n\t} else {\n\t\tx.parent.right = y;\n\t}\n\n\ty.left = x;\t\t\t\t\t\t// put x on y's left.\n\tx.parent = y;\n\n\trecomputeMaxEnd(x);\n\trecomputeMaxEnd(y);\n}\n\nfunction rightRotate(T: IntervalTree, y: IntervalNode): void {\n\tconst x = y.left;\n\n\ty.delta -= x.delta;\n\tif (y.delta < Constants.MIN_SAFE_DELTA || y.delta > Constants.MAX_SAFE_DELTA) {\n\t\tT.requestNormalizeDelta = true;\n\t}\n\ty.start -= x.delta;\n\ty.end -= x.delta;\n\n\ty.left = x.right;\n\tif (x.right !== SENTINEL) {\n\t\tx.right.parent = y;\n\t}\n\tx.parent = y.parent;\n\tif (y.parent === SENTINEL) {\n\t\tT.root = x;\n\t} else if (y === y.parent.right) {\n\t\ty.parent.right = x;\n\t} else {\n\t\ty.parent.left = x;\n\t}\n\n\tx.right = y;\n\ty.parent = x;\n\n\trecomputeMaxEnd(y);\n\trecomputeMaxEnd(x);\n}\n//#endregion\n\n//#region max end computation\n\nfunction computeMaxEnd(node: IntervalNode): number {\n\tlet maxEnd = node.end;\n\tif (node.left !== SENTINEL) {\n\t\tconst leftMaxEnd = node.left.maxEnd;\n\t\tif (leftMaxEnd > maxEnd) {\n\t\t\tmaxEnd = leftMaxEnd;\n\t\t}\n\t}\n\tif (node.right !== SENTINEL) {\n\t\tconst rightMaxEnd = node.right.maxEnd + node.delta;\n\t\tif (rightMaxEnd > maxEnd) {\n\t\t\tmaxEnd = rightMaxEnd;\n\t\t}\n\t}\n\treturn maxEnd;\n}\n\nexport function recomputeMaxEnd(node: IntervalNode): void {\n\tnode.maxEnd = computeMaxEnd(node);\n}\n\nfunction recomputeMaxEndWalkToRoot(node: IntervalNode): void {\n\twhile (node !== SENTINEL) {\n\n\t\tconst maxEnd = computeMaxEnd(node);\n\n\t\tif (node.maxEnd === maxEnd) {\n\t\t\t// no need to go further\n\t\t\treturn;\n\t\t}\n\n\t\tnode.maxEnd = maxEnd;\n\t\tnode = node.parent;\n\t}\n}\n\n//#endregion\n\n//#region utils\nexport function intervalCompare(aStart: number, aEnd: number, bStart: number, bEnd: number): number {\n\tif (aStart === bStart) {\n\t\treturn aEnd - bEnd;\n\t}\n\treturn aStart - bStart;\n}\n//#endregion\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 { Piece, PieceTreeBase } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase';\n\nexport class TreeNode {\n\tparent: TreeNode;\n\tleft: TreeNode;\n\tright: TreeNode;\n\tcolor: NodeColor;\n\n\t// Piece\n\tpiece: Piece;\n\tsize_left: number; // size of the left subtree (not inorder)\n\tlf_left: number; // line feeds cnt in the left subtree (not in order)\n\n\tconstructor(piece: Piece, color: NodeColor) {\n\t\tthis.piece = piece;\n\t\tthis.color = color;\n\t\tthis.size_left = 0;\n\t\tthis.lf_left = 0;\n\t\tthis.parent = this;\n\t\tthis.left = this;\n\t\tthis.right = this;\n\t}\n\n\tpublic next(): TreeNode {\n\t\tif (this.right !== SENTINEL) {\n\t\t\treturn leftest(this.right);\n\t\t}\n\n\t\tlet node: TreeNode = this;\n\n\t\twhile (node.parent !== SENTINEL) {\n\t\t\tif (node.parent.left === node) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\tif (node.parent === SENTINEL) {\n\t\t\treturn SENTINEL;\n\t\t} else {\n\t\t\treturn node.parent;\n\t\t}\n\t}\n\n\tpublic prev(): TreeNode {\n\t\tif (this.left !== SENTINEL) {\n\t\t\treturn righttest(this.left);\n\t\t}\n\n\t\tlet node: TreeNode = this;\n\n\t\twhile (node.parent !== SENTINEL) {\n\t\t\tif (node.parent.right === node) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\tif (node.parent === SENTINEL) {\n\t\t\treturn SENTINEL;\n\t\t} else {\n\t\t\treturn node.parent;\n\t\t}\n\t}\n\n\tpublic detach(): void {\n\t\tthis.parent = null!;\n\t\tthis.left = null!;\n\t\tthis.right = null!;\n\t}\n}\n\nexport const enum NodeColor {\n\tBlack = 0,\n\tRed = 1,\n}\n\nexport const SENTINEL: TreeNode = new TreeNode(null!, NodeColor.Black);\nSENTINEL.parent = SENTINEL;\nSENTINEL.left = SENTINEL;\nSENTINEL.right = SENTINEL;\nSENTINEL.color = NodeColor.Black;\n\nexport function leftest(node: TreeNode): TreeNode {\n\twhile (node.left !== SENTINEL) {\n\t\tnode = node.left;\n\t}\n\treturn node;\n}\n\nexport function righttest(node: TreeNode): TreeNode {\n\twhile (node.right !== SENTINEL) {\n\t\tnode = node.right;\n\t}\n\treturn node;\n}\n\nexport function calculateSize(node: TreeNode): number {\n\tif (node === SENTINEL) {\n\t\treturn 0;\n\t}\n\n\treturn node.size_left + node.piece.length + calculateSize(node.right);\n}\n\nexport function calculateLF(node: TreeNode): number {\n\tif (node === SENTINEL) {\n\t\treturn 0;\n\t}\n\n\treturn node.lf_left + node.piece.lineFeedCnt + calculateLF(node.right);\n}\n\nexport function resetSentinel(): void {\n\tSENTINEL.parent = SENTINEL;\n}\n\nexport function leftRotate(tree: PieceTreeBase, x: TreeNode) {\n\tconst y = x.right;\n\n\t// fix size_left\n\ty.size_left += x.size_left + (x.piece ? x.piece.length : 0);\n\ty.lf_left += x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0);\n\tx.right = y.left;\n\n\tif (y.left !== SENTINEL) {\n\t\ty.left.parent = x;\n\t}\n\ty.parent = x.parent;\n\tif (x.parent === SENTINEL) {\n\t\ttree.root = y;\n\t} else if (x.parent.left === x) {\n\t\tx.parent.left = y;\n\t} else {\n\t\tx.parent.right = y;\n\t}\n\ty.left = x;\n\tx.parent = y;\n}\n\nexport function rightRotate(tree: PieceTreeBase, y: TreeNode) {\n\tconst x = y.left;\n\ty.left = x.right;\n\tif (x.right !== SENTINEL) {\n\t\tx.right.parent = y;\n\t}\n\tx.parent = y.parent;\n\n\t// fix size_left\n\ty.size_left -= x.size_left + (x.piece ? x.piece.length : 0);\n\ty.lf_left -= x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0);\n\n\tif (y.parent === SENTINEL) {\n\t\ttree.root = x;\n\t} else if (y === y.parent.right) {\n\t\ty.parent.right = x;\n\t} else {\n\t\ty.parent.left = x;\n\t}\n\n\tx.right = y;\n\ty.parent = x;\n}\n\nexport function rbDelete(tree: PieceTreeBase, z: TreeNode) {\n\tlet x: TreeNode;\n\tlet y: TreeNode;\n\n\tif (z.left === SENTINEL) {\n\t\ty = z;\n\t\tx = y.right;\n\t} else if (z.right === SENTINEL) {\n\t\ty = z;\n\t\tx = y.left;\n\t} else {\n\t\ty = leftest(z.right);\n\t\tx = y.right;\n\t}\n\n\tif (y === tree.root) {\n\t\ttree.root = x;\n\n\t\t// if x is null, we are removing the only node\n\t\tx.color = NodeColor.Black;\n\t\tz.detach();\n\t\tresetSentinel();\n\t\ttree.root.parent = SENTINEL;\n\n\t\treturn;\n\t}\n\n\tconst yWasRed = (y.color === NodeColor.Red);\n\n\tif (y === y.parent.left) {\n\t\ty.parent.left = x;\n\t} else {\n\t\ty.parent.right = x;\n\t}\n\n\tif (y === z) {\n\t\tx.parent = y.parent;\n\t\trecomputeTreeMetadata(tree, x);\n\t} else {\n\t\tif (y.parent === z) {\n\t\t\tx.parent = y;\n\t\t} else {\n\t\t\tx.parent = y.parent;\n\t\t}\n\n\t\t// as we make changes to x's hierarchy, update size_left of subtree first\n\t\trecomputeTreeMetadata(tree, x);\n\n\t\ty.left = z.left;\n\t\ty.right = z.right;\n\t\ty.parent = z.parent;\n\t\ty.color = z.color;\n\n\t\tif (z === tree.root) {\n\t\t\ttree.root = y;\n\t\t} else {\n\t\t\tif (z === z.parent.left) {\n\t\t\t\tz.parent.left = y;\n\t\t\t} else {\n\t\t\t\tz.parent.right = y;\n\t\t\t}\n\t\t}\n\n\t\tif (y.left !== SENTINEL) {\n\t\t\ty.left.parent = y;\n\t\t}\n\t\tif (y.right !== SENTINEL) {\n\t\t\ty.right.parent = y;\n\t\t}\n\t\t// update metadata\n\t\t// we replace z with y, so in this sub tree, the length change is z.item.length\n\t\ty.size_left = z.size_left;\n\t\ty.lf_left = z.lf_left;\n\t\trecomputeTreeMetadata(tree, y);\n\t}\n\n\tz.detach();\n\n\tif (x.parent.left === x) {\n\t\tconst newSizeLeft = calculateSize(x);\n\t\tconst newLFLeft = calculateLF(x);\n\t\tif (newSizeLeft !== x.parent.size_left || newLFLeft !== x.parent.lf_left) {\n\t\t\tconst delta = newSizeLeft - x.parent.size_left;\n\t\t\tconst lf_delta = newLFLeft - x.parent.lf_left;\n\t\t\tx.parent.size_left = newSizeLeft;\n\t\t\tx.parent.lf_left = newLFLeft;\n\t\t\tupdateTreeMetadata(tree, x.parent, delta, lf_delta);\n\t\t}\n\t}\n\n\trecomputeTreeMetadata(tree, x.parent);\n\n\tif (yWasRed) {\n\t\tresetSentinel();\n\t\treturn;\n\t}\n\n\t// RB-DELETE-FIXUP\n\tlet w: TreeNode;\n\twhile (x !== tree.root && x.color === NodeColor.Black) {\n\t\tif (x === x.parent.left) {\n\t\t\tw = x.parent.right;\n\n\t\t\tif (w.color === NodeColor.Red) {\n\t\t\t\tw.color = NodeColor.Black;\n\t\t\t\tx.parent.color = NodeColor.Red;\n\t\t\t\tleftRotate(tree, x.parent);\n\t\t\t\tw = x.parent.right;\n\t\t\t}\n\n\t\t\tif (w.left.color === NodeColor.Black && w.right.color === NodeColor.Black) {\n\t\t\t\tw.color = NodeColor.Red;\n\t\t\t\tx = x.parent;\n\t\t\t} else {\n\t\t\t\tif (w.right.color === NodeColor.Black) {\n\t\t\t\t\tw.left.color = NodeColor.Black;\n\t\t\t\t\tw.color = NodeColor.Red;\n\t\t\t\t\trightRotate(tree, w);\n\t\t\t\t\tw = x.parent.right;\n\t\t\t\t}\n\n\t\t\t\tw.color = x.parent.color;\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\tw.right.color = NodeColor.Black;\n\t\t\t\tleftRotate(tree, x.parent);\n\t\t\t\tx = tree.root;\n\t\t\t}\n\t\t} else {\n\t\t\tw = x.parent.left;\n\n\t\t\tif (w.color === NodeColor.Red) {\n\t\t\t\tw.color = NodeColor.Black;\n\t\t\t\tx.parent.color = NodeColor.Red;\n\t\t\t\trightRotate(tree, x.parent);\n\t\t\t\tw = x.parent.left;\n\t\t\t}\n\n\t\t\tif (w.left.color === NodeColor.Black && w.right.color === NodeColor.Black) {\n\t\t\t\tw.color = NodeColor.Red;\n\t\t\t\tx = x.parent;\n\n\t\t\t} else {\n\t\t\t\tif (w.left.color === NodeColor.Black) {\n\t\t\t\t\tw.right.color = NodeColor.Black;\n\t\t\t\t\tw.color = NodeColor.Red;\n\t\t\t\t\tleftRotate(tree, w);\n\t\t\t\t\tw = x.parent.left;\n\t\t\t\t}\n\n\t\t\t\tw.color = x.parent.color;\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\tw.left.color = NodeColor.Black;\n\t\t\t\trightRotate(tree, x.parent);\n\t\t\t\tx = tree.root;\n\t\t\t}\n\t\t}\n\t}\n\tx.color = NodeColor.Black;\n\tresetSentinel();\n}\n\nexport function fixInsert(tree: PieceTreeBase, x: TreeNode) {\n\trecomputeTreeMetadata(tree, x);\n\n\twhile (x !== tree.root && x.parent.color === NodeColor.Red) {\n\t\tif (x.parent === x.parent.parent.left) {\n\t\t\tconst y = x.parent.parent.right;\n\n\t\t\tif (y.color === NodeColor.Red) {\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\ty.color = NodeColor.Black;\n\t\t\t\tx.parent.parent.color = NodeColor.Red;\n\t\t\t\tx = x.parent.parent;\n\t\t\t} else {\n\t\t\t\tif (x === x.parent.right) {\n\t\t\t\t\tx = x.parent;\n\t\t\t\t\tleftRotate(tree, x);\n\t\t\t\t}\n\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\tx.parent.parent.color = NodeColor.Red;\n\t\t\t\trightRotate(tree, x.parent.parent);\n\t\t\t}\n\t\t} else {\n\t\t\tconst y = x.parent.parent.left;\n\n\t\t\tif (y.color === NodeColor.Red) {\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\ty.color = NodeColor.Black;\n\t\t\t\tx.parent.parent.color = NodeColor.Red;\n\t\t\t\tx = x.parent.parent;\n\t\t\t} else {\n\t\t\t\tif (x === x.parent.left) {\n\t\t\t\t\tx = x.parent;\n\t\t\t\t\trightRotate(tree, x);\n\t\t\t\t}\n\t\t\t\tx.parent.color = NodeColor.Black;\n\t\t\t\tx.parent.parent.color = NodeColor.Red;\n\t\t\t\tleftRotate(tree, x.parent.parent);\n\t\t\t}\n\t\t}\n\t}\n\n\ttree.root.color = NodeColor.Black;\n}\n\nexport function updateTreeMetadata(tree: PieceTreeBase, x: TreeNode, delta: number, lineFeedCntDelta: number): void {\n\t// node length change or line feed count change\n\twhile (x !== tree.root && x !== SENTINEL) {\n\t\tif (x.parent.left === x) {\n\t\t\tx.parent.size_left += delta;\n\t\t\tx.parent.lf_left += lineFeedCntDelta;\n\t\t}\n\n\t\tx = x.parent;\n\t}\n}\n\nexport function recomputeTreeMetadata(tree: PieceTreeBase, x: TreeNode) {\n\tlet delta = 0;\n\tlet lf_delta = 0;\n\tif (x === tree.root) {\n\t\treturn;\n\t}\n\n\t// go upwards till the node whose left subtree is changed.\n\twhile (x !== tree.root && x === x.parent.right) {\n\t\tx = x.parent;\n\t}\n\n\tif (x === tree.root) {\n\t\t// well, it means we add a node to the end (inorder)\n\t\treturn;\n\t}\n\n\t// x is the node whose right subtree is changed.\n\tx = x.parent;\n\n\tdelta = calculateSize(x.left) - x.size_left;\n\tlf_delta = calculateLF(x.left) - x.lf_left;\n\tx.size_left += delta;\n\tx.lf_left += lf_delta;\n\n\n\t// go upwards till root. O(logN)\n\twhile (x !== tree.root && (delta !== 0 || lf_delta !== 0)) {\n\t\tif (x.parent.left === x) {\n\t\t\tx.parent.size_left += delta;\n\t\t\tx.parent.lf_left += lf_delta;\n\t\t}\n\n\t\tx = x.parent;\n\t}\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 { arrayInsert } from 'vs/base/common/arrays';\nimport { toUint32 } from 'vs/base/common/uint';\n\nexport class PrefixSumComputer {\n\n\t/**\n\t * values[i] is the value at index i\n\t */\n\tprivate values: Uint32Array;\n\n\t/**\n\t * prefixSum[i] = SUM(heights[j]), 0 <= j <= i\n\t */\n\tprivate prefixSum: Uint32Array;\n\n\t/**\n\t * prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted\n\t */\n\tprivate readonly prefixSumValidIndex: Int32Array;\n\n\tconstructor(values: Uint32Array) {\n\t\tthis.values = values;\n\t\tthis.prefixSum = new Uint32Array(values.length);\n\t\tthis.prefixSumValidIndex = new Int32Array(1);\n\t\tthis.prefixSumValidIndex[0] = -1;\n\t}\n\n\tpublic insertValues(insertIndex: number, insertValues: Uint32Array): boolean {\n\t\tinsertIndex = toUint32(insertIndex);\n\t\tconst oldValues = this.values;\n\t\tconst oldPrefixSum = this.prefixSum;\n\t\tconst insertValuesLen = insertValues.length;\n\n\t\tif (insertValuesLen === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.values = new Uint32Array(oldValues.length + insertValuesLen);\n\t\tthis.values.set(oldValues.subarray(0, insertIndex), 0);\n\t\tthis.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\n\t\tthis.values.set(insertValues, insertIndex);\n\n\t\tif (insertIndex - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = insertIndex - 1;\n\t\t}\n\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic setValue(index: number, value: number): boolean {\n\t\tindex = toUint32(index);\n\t\tvalue = toUint32(value);\n\n\t\tif (this.values[index] === value) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.values[index] = value;\n\t\tif (index - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = index - 1;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic removeValues(startIndex: number, count: number): boolean {\n\t\tstartIndex = toUint32(startIndex);\n\t\tcount = toUint32(count);\n\n\t\tconst oldValues = this.values;\n\t\tconst oldPrefixSum = this.prefixSum;\n\n\t\tif (startIndex >= oldValues.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst maxCount = oldValues.length - startIndex;\n\t\tif (count >= maxCount) {\n\t\t\tcount = maxCount;\n\t\t}\n\n\t\tif (count === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.values = new Uint32Array(oldValues.length - count);\n\t\tthis.values.set(oldValues.subarray(0, startIndex), 0);\n\t\tthis.values.set(oldValues.subarray(startIndex + count), startIndex);\n\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\n\t\tif (startIndex - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = startIndex - 1;\n\t\t}\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic getTotalSum(): number {\n\t\tif (this.values.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._getPrefixSum(this.values.length - 1);\n\t}\n\n\t/**\n\t * Returns the sum of the first `index + 1` many items.\n\t * @returns `SUM(0 <= j <= index, values[j])`.\n\t */\n\tpublic getPrefixSum(index: number): number {\n\t\tif (index < 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tindex = toUint32(index);\n\t\treturn this._getPrefixSum(index);\n\t}\n\n\tprivate _getPrefixSum(index: number): number {\n\t\tif (index <= this.prefixSumValidIndex[0]) {\n\t\t\treturn this.prefixSum[index];\n\t\t}\n\n\t\tlet startIndex = this.prefixSumValidIndex[0] + 1;\n\t\tif (startIndex === 0) {\n\t\t\tthis.prefixSum[0] = this.values[0];\n\t\t\tstartIndex++;\n\t\t}\n\n\t\tif (index >= this.values.length) {\n\t\t\tindex = this.values.length - 1;\n\t\t}\n\n\t\tfor (let i = startIndex; i <= index; i++) {\n\t\t\tthis.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\n\t\t}\n\t\tthis.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\n\t\treturn this.prefixSum[index];\n\t}\n\n\tpublic getIndexOf(sum: number): PrefixSumIndexOfResult {\n\t\tsum = Math.floor(sum);\n\n\t\t// Compute all sums (to get a fully valid prefixSum)\n\t\tthis.getTotalSum();\n\n\t\tlet low = 0;\n\t\tlet high = this.values.length - 1;\n\t\tlet mid = 0;\n\t\tlet midStop = 0;\n\t\tlet midStart = 0;\n\n\t\twhile (low <= high) {\n\t\t\tmid = low + ((high - low) / 2) | 0;\n\n\t\t\tmidStop = this.prefixSum[mid];\n\t\t\tmidStart = midStop - this.values[mid];\n\n\t\t\tif (sum < midStart) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else if (sum >= midStop) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new PrefixSumIndexOfResult(mid, sum - midStart);\n\t}\n}\n\n/**\n * {@link getIndexOf} has an amortized runtime complexity of O(1).\n *\n * ({@link PrefixSumComputer.getIndexOf} is just O(log n))\n*/\nexport class ConstantTimePrefixSumComputer {\n\tprivate _values: number[];\n\tprivate _isValid: boolean;\n\tprivate _validEndIndex: number;\n\n\t/**\n\t * _prefixSum[i] = SUM(values[j]), 0 <= j <= i\n\t */\n\tprivate _prefixSum: number[];\n\n\t/**\n\t * _indexBySum[sum] = idx => _prefixSum[idx - 1] <= sum < _prefixSum[idx]\n\t*/\n\tprivate _indexBySum: number[];\n\n\tconstructor(values: number[]) {\n\t\tthis._values = values;\n\t\tthis._isValid = false;\n\t\tthis._validEndIndex = -1;\n\t\tthis._prefixSum = [];\n\t\tthis._indexBySum = [];\n\t}\n\n\t/**\n\t * @returns SUM(0 <= j < values.length, values[j])\n\t */\n\tpublic getTotalSum(): number {\n\t\tthis._ensureValid();\n\t\treturn this._indexBySum.length;\n\t}\n\n\t/**\n\t * Returns the sum of the first `count` many items.\n\t * @returns `SUM(0 <= j < count, values[j])`.\n\t */\n\tpublic getPrefixSum(count: number): number {\n\t\tthis._ensureValid();\n\t\tif (count === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._prefixSum[count - 1];\n\t}\n\n\t/**\n\t * @returns `result`, such that `getPrefixSum(result.index) + result.remainder = sum`\n\t */\n\tpublic getIndexOf(sum: number): PrefixSumIndexOfResult {\n\t\tthis._ensureValid();\n\t\tconst idx = this._indexBySum[sum];\n\t\tconst viewLinesAbove = idx > 0 ? this._prefixSum[idx - 1] : 0;\n\t\treturn new PrefixSumIndexOfResult(idx, sum - viewLinesAbove);\n\t}\n\n\tpublic removeValues(start: number, deleteCount: number): void {\n\t\tthis._values.splice(start, deleteCount);\n\t\tthis._invalidate(start);\n\t}\n\n\tpublic insertValues(insertIndex: number, insertArr: number[]): void {\n\t\tthis._values = arrayInsert(this._values, insertIndex, insertArr);\n\t\tthis._invalidate(insertIndex);\n\t}\n\n\tprivate _invalidate(index: number): void {\n\t\tthis._isValid = false;\n\t\tthis._validEndIndex = Math.min(this._validEndIndex, index - 1);\n\t}\n\n\tprivate _ensureValid(): void {\n\t\tif (this._isValid) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = this._validEndIndex + 1, len = this._values.length; i < len; i++) {\n\t\t\tconst value = this._values[i];\n\t\t\tconst sumAbove = i > 0 ? this._prefixSum[i - 1] : 0;\n\n\t\t\tthis._prefixSum[i] = sumAbove + value;\n\t\t\tfor (let j = 0; j < value; j++) {\n\t\t\t\tthis._indexBySum[sumAbove + j] = i;\n\t\t\t}\n\t\t}\n\n\t\t// trim things\n\t\tthis._prefixSum.length = this._values.length;\n\t\tthis._indexBySum.length = this._prefixSum[this._prefixSum.length - 1];\n\n\t\t// mark as valid\n\t\tthis._isValid = true;\n\t\tthis._validEndIndex = this._values.length - 1;\n\t}\n\n\tpublic setValue(index: number, value: number): void {\n\t\tif (this._values[index] === value) {\n\t\t\t// no change\n\t\t\treturn;\n\t\t}\n\t\tthis._values[index] = value;\n\t\tthis._invalidate(index);\n\t}\n}\n\n\nexport class PrefixSumIndexOfResult {\n\t_prefixSumIndexOfResultBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly index: number,\n\t\tpublic readonly remainder: number\n\t) {\n\t\tthis.index = index;\n\t\tthis.remainder = remainder;\n\t}\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 { splitLines } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IModelContentChange } from 'vs/editor/common/textModelEvents';\nimport { PrefixSumComputer } from 'vs/editor/common/model/prefixSumComputer';\n\nexport interface IModelChangedEvent {\n\t/**\n\t * The actual changes.\n\t */\n\treadonly changes: IModelContentChange[];\n\t/**\n\t * The (new) end-of-line character.\n\t */\n\treadonly eol: string;\n\t/**\n\t * The new version id the model has transitioned to.\n\t */\n\treadonly versionId: number;\n}\n\nexport interface IMirrorTextModel {\n\treadonly version: number;\n}\n\nexport class MirrorTextModel implements IMirrorTextModel {\n\n\tprotected _uri: URI;\n\tprotected _lines: string[];\n\tprotected _eol: string;\n\tprotected _versionId: number;\n\tprotected _lineStarts: PrefixSumComputer | null;\n\tprivate _cachedTextValue: string | null;\n\n\tconstructor(uri: URI, lines: string[], eol: string, versionId: number) {\n\t\tthis._uri = uri;\n\t\tthis._lines = lines;\n\t\tthis._eol = eol;\n\t\tthis._versionId = versionId;\n\t\tthis._lineStarts = null;\n\t\tthis._cachedTextValue = null;\n\t}\n\n\tdispose(): void {\n\t\tthis._lines.length = 0;\n\t}\n\n\tget version(): number {\n\t\treturn this._versionId;\n\t}\n\n\tgetText(): string {\n\t\tif (this._cachedTextValue === null) {\n\t\t\tthis._cachedTextValue = this._lines.join(this._eol);\n\t\t}\n\t\treturn this._cachedTextValue;\n\t}\n\n\tonEvents(e: IModelChangedEvent): void {\n\t\tif (e.eol && e.eol !== this._eol) {\n\t\t\tthis._eol = e.eol;\n\t\t\tthis._lineStarts = null;\n\t\t}\n\n\t\t// Update my lines\n\t\tconst changes = e.changes;\n\t\tfor (const change of changes) {\n\t\t\tthis._acceptDeleteRange(change.range);\n\t\t\tthis._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);\n\t\t}\n\n\t\tthis._versionId = e.versionId;\n\t\tthis._cachedTextValue = null;\n\t}\n\n\tprotected _ensureLineStarts(): void {\n\t\tif (!this._lineStarts) {\n\t\t\tconst eolLength = this._eol.length;\n\t\t\tconst linesLength = this._lines.length;\n\t\t\tconst lineStartValues = new Uint32Array(linesLength);\n\t\t\tfor (let i = 0; i < linesLength; i++) {\n\t\t\t\tlineStartValues[i] = this._lines[i].length + eolLength;\n\t\t\t}\n\t\t\tthis._lineStarts = new PrefixSumComputer(lineStartValues);\n\t\t}\n\t}\n\n\t/**\n\t * All changes to a line's text go through this method\n\t */\n\tprivate _setLineText(lineIndex: number, newValue: string): void {\n\t\tthis._lines[lineIndex] = newValue;\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\n\t\t}\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\tif (range.startColumn === range.endColumn) {\n\t\t\t\t// Nothing to delete\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Delete text on the affected line\n\t\t\tthis._setLineText(range.startLineNumber - 1,\n\t\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n\t\t\t\t+ this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Take remaining text on last line and append it to remaining text on first line\n\t\tthis._setLineText(range.startLineNumber - 1,\n\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n\t\t\t+ this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)\n\t\t);\n\n\t\t// Delete middle lines\n\t\tthis._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, insertText: string): void {\n\t\tif (insertText.length === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\t\tconst insertLines = splitLines(insertText);\n\t\tif (insertLines.length === 1) {\n\t\t\t// Inserting text on one line\n\t\t\tthis._setLineText(position.lineNumber - 1,\n\t\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\n\t\t\t\t+ insertLines[0]\n\t\t\t\t+ this._lines[position.lineNumber - 1].substring(position.column - 1)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Append overflowing text from first line to the end of text to insert\n\t\tinsertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\n\n\t\t// Delete overflowing text from first line and insert text on first line\n\t\tthis._setLineText(position.lineNumber - 1,\n\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\n\t\t\t+ insertLines[0]\n\t\t);\n\n\t\t// Insert new lines & store lengths\n\t\tconst newLengths = new Uint32Array(insertLines.length - 1);\n\t\tfor (let i = 1; i < insertLines.length; i++) {\n\t\t\tthis._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\n\t\t\tnewLengths[i - 1] = insertLines[i].length + this._eol.length;\n\t\t}\n\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.insertValues(position.lineNumber, newLengths);\n\t\t}\n\t}\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 { IDisposable } from 'vs/base/common/lifecycle';\n\nexport class TextModelPart implements IDisposable {\n\tprivate _isDisposed = false;\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t}\n\tprotected assertNotDisposed(): void {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error('TextModelPart is disposed!');\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EndOfLinePreference, FindMatch, SearchData } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\n\nconst LIMIT_FIND_COUNT = 999;\n\nexport class SearchParams {\n\tpublic readonly searchString: string;\n\tpublic readonly isRegex: boolean;\n\tpublic readonly matchCase: boolean;\n\tpublic readonly wordSeparators: string | null;\n\n\tconstructor(searchString: string, isRegex: boolean, matchCase: boolean, wordSeparators: string | null) {\n\t\tthis.searchString = searchString;\n\t\tthis.isRegex = isRegex;\n\t\tthis.matchCase = matchCase;\n\t\tthis.wordSeparators = wordSeparators;\n\t}\n\n\tpublic parseSearchRequest(): SearchData | null {\n\t\tif (this.searchString === '') {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Try to create a RegExp out of the params\n\t\tlet multiline: boolean;\n\t\tif (this.isRegex) {\n\t\t\tmultiline = isMultilineRegexSource(this.searchString);\n\t\t} else {\n\t\t\tmultiline = (this.searchString.indexOf('\\n') >= 0);\n\t\t}\n\n\t\tlet regex: RegExp | null = null;\n\t\ttry {\n\t\t\tregex = strings.createRegExp(this.searchString, this.isRegex, {\n\t\t\t\tmatchCase: this.matchCase,\n\t\t\t\twholeWord: false,\n\t\t\t\tmultiline: multiline,\n\t\t\t\tglobal: true,\n\t\t\t\tunicode: true\n\t\t\t});\n\t\t} catch (err) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!regex) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet canUseSimpleSearch = (!this.isRegex && !multiline);\n\t\tif (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) {\n\t\t\t// casing might make a difference\n\t\t\tcanUseSimpleSearch = this.matchCase;\n\t\t}\n\n\t\treturn new SearchData(regex, this.wordSeparators ? getMapForWordSeparators(this.wordSeparators) : null, canUseSimpleSearch ? this.searchString : null);\n\t}\n}\n\nexport function isMultilineRegexSource(searchString: string): boolean {\n\tif (!searchString || searchString.length === 0) {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0, len = searchString.length; i < len; i++) {\n\t\tconst chCode = searchString.charCodeAt(i);\n\n\t\tif (chCode === CharCode.Backslash) {\n\n\t\t\t// move to next char\n\t\t\ti++;\n\n\t\t\tif (i >= len) {\n\t\t\t\t// string ends with a \\\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nextChCode = searchString.charCodeAt(i);\n\t\t\tif (nextChCode === CharCode.n || nextChCode === CharCode.r || nextChCode === CharCode.W) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function createFindMatch(range: Range, rawMatches: RegExpExecArray, captureMatches: boolean): FindMatch {\n\tif (!captureMatches) {\n\t\treturn new FindMatch(range, null);\n\t}\n\tconst matches: string[] = [];\n\tfor (let i = 0, len = rawMatches.length; i < len; i++) {\n\t\tmatches[i] = rawMatches[i];\n\t}\n\treturn new FindMatch(range, matches);\n}\n\nclass LineFeedCounter {\n\n\tprivate readonly _lineFeedsOffsets: number[];\n\n\tconstructor(text: string) {\n\t\tconst lineFeedsOffsets: number[] = [];\n\t\tlet lineFeedsOffsetsLen = 0;\n\t\tfor (let i = 0, textLen = text.length; i < textLen; i++) {\n\t\t\tif (text.charCodeAt(i) === CharCode.LineFeed) {\n\t\t\t\tlineFeedsOffsets[lineFeedsOffsetsLen++] = i;\n\t\t\t}\n\t\t}\n\t\tthis._lineFeedsOffsets = lineFeedsOffsets;\n\t}\n\n\tpublic findLineFeedCountBeforeOffset(offset: number): number {\n\t\tconst lineFeedsOffsets = this._lineFeedsOffsets;\n\t\tlet min = 0;\n\t\tlet max = lineFeedsOffsets.length - 1;\n\n\t\tif (max === -1) {\n\t\t\t// no line feeds\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (offset <= lineFeedsOffsets[0]) {\n\t\t\t// before first line feed\n\t\t\treturn 0;\n\t\t}\n\n\t\twhile (min < max) {\n\t\t\tconst mid = min + ((max - min) / 2 >> 0);\n\n\t\t\tif (lineFeedsOffsets[mid] >= offset) {\n\t\t\t\tmax = mid - 1;\n\t\t\t} else {\n\t\t\t\tif (lineFeedsOffsets[mid + 1] >= offset) {\n\t\t\t\t\t// bingo!\n\t\t\t\t\tmin = mid;\n\t\t\t\t\tmax = mid;\n\t\t\t\t} else {\n\t\t\t\t\tmin = mid + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn min + 1;\n\t}\n}\n\nexport class TextModelSearch {\n\n\tpublic static findMatches(model: TextModel, searchParams: SearchParams, searchRange: Range, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (searchData.regex.multiline) {\n\t\t\treturn this._doFindMatchesMultiline(model, searchRange, new Searcher(searchData.wordSeparators, searchData.regex), captureMatches, limitResultCount);\n\t\t}\n\t\treturn this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount);\n\t}\n\n\t/**\n\t * Multiline search always executes on the lines concatenated with \\n.\n\t * We must therefore compensate for the count of \\n in case the model is CRLF\n\t */\n\tprivate static _getMultilineMatchRange(model: TextModel, deltaOffset: number, text: string, lfCounter: LineFeedCounter | null, matchIndex: number, match0: string): Range {\n\t\tlet startOffset: number;\n\t\tlet lineFeedCountBeforeMatch = 0;\n\t\tif (lfCounter) {\n\t\t\tlineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex);\n\t\t\tstartOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch /* add as many \\r as there were \\n */;\n\t\t} else {\n\t\t\tstartOffset = deltaOffset + matchIndex;\n\t\t}\n\n\t\tlet endOffset: number;\n\t\tif (lfCounter) {\n\t\t\tconst lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length);\n\t\t\tconst lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch;\n\t\t\tendOffset = startOffset + match0.length + lineFeedCountInMatch /* add as many \\r as there were \\n */;\n\t\t} else {\n\t\t\tendOffset = startOffset + match0.length;\n\t\t}\n\n\t\tconst startPosition = model.getPositionAt(startOffset);\n\t\tconst endPosition = model.getPositionAt(endOffset);\n\t\treturn new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);\n\t}\n\n\tprivate static _doFindMatchesMultiline(model: TextModel, searchRange: Range, searcher: Searcher, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst deltaOffset = model.getOffsetAt(searchRange.getStartPosition());\n\t\t// We always execute multiline search over the lines joined with \\n\n\t\t// This makes it that \\n will match the EOL for both CRLF and LF models\n\t\t// We compensate for offset errors in `_getMultilineMatchRange`\n\t\tconst text = model.getValueInRange(searchRange, EndOfLinePreference.LF);\n\t\tconst lfCounter = (model.getEOL() === '\\r\\n' ? new LineFeedCounter(text) : null);\n\n\t\tconst result: FindMatch[] = [];\n\t\tlet counter = 0;\n\n\t\tlet m: RegExpExecArray | null;\n\t\tsearcher.reset(0);\n\t\twhile ((m = searcher.next(text))) {\n\t\t\tresult[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches);\n\t\t\tif (counter >= limitResultCount) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _doFindMatchesLineByLine(model: TextModel, searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst result: FindMatch[] = [];\n\t\tlet resultLen = 0;\n\n\t\t// Early case for a search range that starts & stops on the same line number\n\t\tif (searchRange.startLineNumber === searchRange.endLineNumber) {\n\t\t\tconst text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1, searchRange.endColumn - 1);\n\t\t\tresultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount);\n\t\t\treturn result;\n\t\t}\n\n\t\t// Collect results from first line\n\t\tconst text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1);\n\t\tresultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount);\n\n\t\t// Collect results from middle lines\n\t\tfor (let lineNumber = searchRange.startLineNumber + 1; lineNumber < searchRange.endLineNumber && resultLen < limitResultCount; lineNumber++) {\n\t\t\tresultLen = this._findMatchesInLine(searchData, model.getLineContent(lineNumber), lineNumber, 0, resultLen, result, captureMatches, limitResultCount);\n\t\t}\n\n\t\t// Collect results from last line\n\t\tif (resultLen < limitResultCount) {\n\t\t\tconst text = model.getLineContent(searchRange.endLineNumber).substring(0, searchRange.endColumn - 1);\n\t\t\tresultLen = this._findMatchesInLine(searchData, text, searchRange.endLineNumber, 0, resultLen, result, captureMatches, limitResultCount);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _findMatchesInLine(searchData: SearchData, text: string, lineNumber: number, deltaOffset: number, resultLen: number, result: FindMatch[], captureMatches: boolean, limitResultCount: number): number {\n\t\tconst wordSeparators = searchData.wordSeparators;\n\t\tif (!captureMatches && searchData.simpleSearch) {\n\t\t\tconst searchString = searchData.simpleSearch;\n\t\t\tconst searchStringLen = searchString.length;\n\t\t\tconst textLength = text.length;\n\n\t\t\tlet lastMatchIndex = -searchStringLen;\n\t\t\twhile ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) {\n\t\t\t\tif (!wordSeparators || isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) {\n\t\t\t\t\tresult[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null);\n\t\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\t\treturn resultLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn resultLen;\n\t\t}\n\n\t\tconst searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n\t\tlet m: RegExpExecArray | null;\n\t\t// Reset regex to search from the beginning\n\t\tsearcher.reset(0);\n\t\tdo {\n\t\t\tm = searcher.next(text);\n\t\t\tif (m) {\n\t\t\t\tresult[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches);\n\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (m);\n\t\treturn resultLen;\n\t}\n\n\tpublic static findNextMatch(model: TextModel, searchParams: SearchParams, searchStart: Position, captureMatches: boolean): FindMatch | null {\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n\n\t\tif (searchData.regex.multiline) {\n\t\t\treturn this._doFindNextMatchMultiline(model, searchStart, searcher, captureMatches);\n\t\t}\n\t\treturn this._doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches);\n\t}\n\n\tprivate static _doFindNextMatchMultiline(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch | null {\n\t\tconst searchTextStart = new Position(searchStart.lineNumber, 1);\n\t\tconst deltaOffset = model.getOffsetAt(searchTextStart);\n\t\tconst lineCount = model.getLineCount();\n\t\t// We always execute multiline search over the lines joined with \\n\n\t\t// This makes it that \\n will match the EOL for both CRLF and LF models\n\t\t// We compensate for offset errors in `_getMultilineMatchRange`\n\t\tconst text = model.getValueInRange(new Range(searchTextStart.lineNumber, searchTextStart.column, lineCount, model.getLineMaxColumn(lineCount)), EndOfLinePreference.LF);\n\t\tconst lfCounter = (model.getEOL() === '\\r\\n' ? new LineFeedCounter(text) : null);\n\t\tsearcher.reset(searchStart.column - 1);\n\t\tlet m = searcher.next(text);\n\t\tif (m) {\n\t\t\treturn createFindMatch(\n\t\t\t\tthis._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]),\n\t\t\t\tm,\n\t\t\t\tcaptureMatches\n\t\t\t);\n\t\t}\n\n\t\tif (searchStart.lineNumber !== 1 || searchStart.column !== 1) {\n\t\t\t// Try again from the top\n\t\t\treturn this._doFindNextMatchMultiline(model, new Position(1, 1), searcher, captureMatches);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _doFindNextMatchLineByLine(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch | null {\n\t\tconst lineCount = model.getLineCount();\n\t\tconst startLineNumber = searchStart.lineNumber;\n\n\t\t// Look in first line\n\t\tconst text = model.getLineContent(startLineNumber);\n\t\tconst r = this._findFirstMatchInLine(searcher, text, startLineNumber, searchStart.column, captureMatches);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\n\t\tfor (let i = 1; i <= lineCount; i++) {\n\t\t\tconst lineIndex = (startLineNumber + i - 1) % lineCount;\n\t\t\tconst text = model.getLineContent(lineIndex + 1);\n\t\t\tconst r = this._findFirstMatchInLine(searcher, text, lineIndex + 1, 1, captureMatches);\n\t\t\tif (r) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _findFirstMatchInLine(searcher: Searcher, text: string, lineNumber: number, fromColumn: number, captureMatches: boolean): FindMatch | null {\n\t\t// Set regex to search from column\n\t\tsearcher.reset(fromColumn - 1);\n\t\tconst m: RegExpExecArray | null = searcher.next(text);\n\t\tif (m) {\n\t\t\treturn createFindMatch(\n\t\t\t\tnew Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length),\n\t\t\t\tm,\n\t\t\t\tcaptureMatches\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic static findPreviousMatch(model: TextModel, searchParams: SearchParams, searchStart: Position, captureMatches: boolean): FindMatch | null {\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n\n\t\tif (searchData.regex.multiline) {\n\t\t\treturn this._doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches);\n\t\t}\n\t\treturn this._doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches);\n\t}\n\n\tprivate static _doFindPreviousMatchMultiline(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch | null {\n\t\tconst matches = this._doFindMatchesMultiline(model, new Range(1, 1, searchStart.lineNumber, searchStart.column), searcher, captureMatches, 10 * LIMIT_FIND_COUNT);\n\t\tif (matches.length > 0) {\n\t\t\treturn matches[matches.length - 1];\n\t\t}\n\n\t\tconst lineCount = model.getLineCount();\n\t\tif (searchStart.lineNumber !== lineCount || searchStart.column !== model.getLineMaxColumn(lineCount)) {\n\t\t\t// Try again with all content\n\t\t\treturn this._doFindPreviousMatchMultiline(model, new Position(lineCount, model.getLineMaxColumn(lineCount)), searcher, captureMatches);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _doFindPreviousMatchLineByLine(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch | null {\n\t\tconst lineCount = model.getLineCount();\n\t\tconst startLineNumber = searchStart.lineNumber;\n\n\t\t// Look in first line\n\t\tconst text = model.getLineContent(startLineNumber).substring(0, searchStart.column - 1);\n\t\tconst r = this._findLastMatchInLine(searcher, text, startLineNumber, captureMatches);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\n\t\tfor (let i = 1; i <= lineCount; i++) {\n\t\t\tconst lineIndex = (lineCount + startLineNumber - i - 1) % lineCount;\n\t\t\tconst text = model.getLineContent(lineIndex + 1);\n\t\t\tconst r = this._findLastMatchInLine(searcher, text, lineIndex + 1, captureMatches);\n\t\t\tif (r) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _findLastMatchInLine(searcher: Searcher, text: string, lineNumber: number, captureMatches: boolean): FindMatch | null {\n\t\tlet bestResult: FindMatch | null = null;\n\t\tlet m: RegExpExecArray | null;\n\t\tsearcher.reset(0);\n\t\twhile ((m = searcher.next(text))) {\n\t\t\tbestResult = createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches);\n\t\t}\n\t\treturn bestResult;\n\t}\n}\n\nfunction leftIsWordBounday(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean {\n\tif (matchStartIndex === 0) {\n\t\t// Match starts at start of string\n\t\treturn true;\n\t}\n\n\tconst charBefore = text.charCodeAt(matchStartIndex - 1);\n\tif (wordSeparators.get(charBefore) !== WordCharacterClass.Regular) {\n\t\t// The character before the match is a word separator\n\t\treturn true;\n\t}\n\n\tif (charBefore === CharCode.CarriageReturn || charBefore === CharCode.LineFeed) {\n\t\t// The character before the match is line break or carriage return.\n\t\treturn true;\n\t}\n\n\tif (matchLength > 0) {\n\t\tconst firstCharInMatch = text.charCodeAt(matchStartIndex);\n\t\tif (wordSeparators.get(firstCharInMatch) !== WordCharacterClass.Regular) {\n\t\t\t// The first character inside the match is a word separator\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction rightIsWordBounday(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean {\n\tif (matchStartIndex + matchLength === textLength) {\n\t\t// Match ends at end of string\n\t\treturn true;\n\t}\n\n\tconst charAfter = text.charCodeAt(matchStartIndex + matchLength);\n\tif (wordSeparators.get(charAfter) !== WordCharacterClass.Regular) {\n\t\t// The character after the match is a word separator\n\t\treturn true;\n\t}\n\n\tif (charAfter === CharCode.CarriageReturn || charAfter === CharCode.LineFeed) {\n\t\t// The character after the match is line break or carriage return.\n\t\treturn true;\n\t}\n\n\tif (matchLength > 0) {\n\t\tconst lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);\n\t\tif (wordSeparators.get(lastCharInMatch) !== WordCharacterClass.Regular) {\n\t\t\t// The last character in the match is a word separator\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean {\n\treturn (\n\t\tleftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)\n\t\t&& rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)\n\t);\n}\n\nexport class Searcher {\n\tpublic readonly _wordSeparators: WordCharacterClassifier | null;\n\tprivate readonly _searchRegex: RegExp;\n\tprivate _prevMatchStartIndex: number;\n\tprivate _prevMatchLength: number;\n\n\tconstructor(wordSeparators: WordCharacterClassifier | null, searchRegex: RegExp,) {\n\t\tthis._wordSeparators = wordSeparators;\n\t\tthis._searchRegex = searchRegex;\n\t\tthis._prevMatchStartIndex = -1;\n\t\tthis._prevMatchLength = 0;\n\t}\n\n\tpublic reset(lastIndex: number): void {\n\t\tthis._searchRegex.lastIndex = lastIndex;\n\t\tthis._prevMatchStartIndex = -1;\n\t\tthis._prevMatchLength = 0;\n\t}\n\n\tpublic next(text: string): RegExpExecArray | null {\n\t\tconst textLength = text.length;\n\n\t\tlet m: RegExpExecArray | null;\n\t\tdo {\n\t\t\tif (this._prevMatchStartIndex + this._prevMatchLength === textLength) {\n\t\t\t\t// Reached the end of the line\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tm = this._searchRegex.exec(text);\n\t\t\tif (!m) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst matchStartIndex = m.index;\n\t\t\tconst matchLength = m[0].length;\n\t\t\tif (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) {\n\t\t\t\tif (matchLength === 0) {\n\t\t\t\t\t// the search result is an empty string and won't advance `regex.lastIndex`, so `regex.exec` will stuck here\n\t\t\t\t\t// we attempt to recover from that by advancing by two if surrogate pair found and by one otherwise\n\t\t\t\t\tif (strings.getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 0xFFFF) {\n\t\t\t\t\t\tthis._searchRegex.lastIndex += 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._searchRegex.lastIndex += 1;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Exit early if the regex matches the same range twice\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthis._prevMatchStartIndex = matchStartIndex;\n\t\t\tthis._prevMatchLength = matchLength;\n\n\t\t\tif (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) {\n\t\t\t\treturn m;\n\t\t\t}\n\n\t\t} while (m);\n\n\t\treturn null;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { FindMatch, ITextSnapshot, SearchData } from 'vs/editor/common/model';\nimport { NodeColor, SENTINEL, TreeNode, fixInsert, leftest, rbDelete, righttest, updateTreeMetadata } from 'vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase';\nimport { Searcher, createFindMatch, isValidMatch } from 'vs/editor/common/model/textModelSearch';\n\n// const lfRegex = new RegExp(/\\r\\n|\\r|\\n/g);\nexport const AverageBufferSize = 65535;\n\nexport function createUintArray(arr: number[]): Uint32Array | Uint16Array {\n\tlet r;\n\tif (arr[arr.length - 1] < 65536) {\n\t\tr = new Uint16Array(arr.length);\n\t} else {\n\t\tr = new Uint32Array(arr.length);\n\t}\n\tr.set(arr, 0);\n\treturn r;\n}\n\nexport class LineStarts {\n\tconstructor(\n\t\tpublic readonly lineStarts: Uint32Array | Uint16Array | number[],\n\t\tpublic readonly cr: number,\n\t\tpublic readonly lf: number,\n\t\tpublic readonly crlf: number,\n\t\tpublic readonly isBasicASCII: boolean\n\t) { }\n}\n\nexport function createLineStartsFast(str: string, readonly: boolean = true): Uint32Array | Uint16Array | number[] {\n\tconst r: number[] = [0];\n\tlet rLength = 1;\n\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tconst chr = str.charCodeAt(i);\n\n\t\tif (chr === CharCode.CarriageReturn) {\n\t\t\tif (i + 1 < len && str.charCodeAt(i + 1) === CharCode.LineFeed) {\n\t\t\t\t// \\r\\n... case\n\t\t\t\tr[rLength++] = i + 2;\n\t\t\t\ti++; // skip \\n\n\t\t\t} else {\n\t\t\t\t// \\r... case\n\t\t\t\tr[rLength++] = i + 1;\n\t\t\t}\n\t\t} else if (chr === CharCode.LineFeed) {\n\t\t\tr[rLength++] = i + 1;\n\t\t}\n\t}\n\tif (readonly) {\n\t\treturn createUintArray(r);\n\t} else {\n\t\treturn r;\n\t}\n}\n\nexport function createLineStarts(r: number[], str: string): LineStarts {\n\tr.length = 0;\n\tr[0] = 0;\n\tlet rLength = 1;\n\tlet cr = 0, lf = 0, crlf = 0;\n\tlet isBasicASCII = true;\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tconst chr = str.charCodeAt(i);\n\n\t\tif (chr === CharCode.CarriageReturn) {\n\t\t\tif (i + 1 < len && str.charCodeAt(i + 1) === CharCode.LineFeed) {\n\t\t\t\t// \\r\\n... case\n\t\t\t\tcrlf++;\n\t\t\t\tr[rLength++] = i + 2;\n\t\t\t\ti++; // skip \\n\n\t\t\t} else {\n\t\t\t\tcr++;\n\t\t\t\t// \\r... case\n\t\t\t\tr[rLength++] = i + 1;\n\t\t\t}\n\t\t} else if (chr === CharCode.LineFeed) {\n\t\t\tlf++;\n\t\t\tr[rLength++] = i + 1;\n\t\t} else {\n\t\t\tif (isBasicASCII) {\n\t\t\t\tif (chr !== CharCode.Tab && (chr < 32 || chr > 126)) {\n\t\t\t\t\tisBasicASCII = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst result = new LineStarts(createUintArray(r), cr, lf, crlf, isBasicASCII);\n\tr.length = 0;\n\n\treturn result;\n}\n\nexport interface NodePosition {\n\t/**\n\t * Piece Index\n\t */\n\tnode: TreeNode;\n\t/**\n\t * remainer in current piece.\n\t*/\n\tremainder: number;\n\t/**\n\t * node start offset in document.\n\t */\n\tnodeStartOffset: number;\n}\n\nexport interface BufferCursor {\n\t/**\n\t * Line number in current buffer\n\t */\n\tline: number;\n\t/**\n\t * Column number in current buffer\n\t */\n\tcolumn: number;\n}\n\nexport class Piece {\n\treadonly bufferIndex: number;\n\treadonly start: BufferCursor;\n\treadonly end: BufferCursor;\n\treadonly length: number;\n\treadonly lineFeedCnt: number;\n\n\tconstructor(bufferIndex: number, start: BufferCursor, end: BufferCursor, lineFeedCnt: number, length: number) {\n\t\tthis.bufferIndex = bufferIndex;\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.lineFeedCnt = lineFeedCnt;\n\t\tthis.length = length;\n\t}\n}\n\nexport class StringBuffer {\n\tbuffer: string;\n\tlineStarts: Uint32Array | Uint16Array | number[];\n\n\tconstructor(buffer: string, lineStarts: Uint32Array | Uint16Array | number[]) {\n\t\tthis.buffer = buffer;\n\t\tthis.lineStarts = lineStarts;\n\t}\n}\n\n/**\n * Readonly snapshot for piece tree.\n * In a real multiple thread environment, to make snapshot reading always work correctly, we need to\n * 1. Make TreeNode.piece immutable, then reading and writing can run in parallel.\n * 2. TreeNode/Buffers normalization should not happen during snapshot reading.\n */\nclass PieceTreeSnapshot implements ITextSnapshot {\n\tprivate readonly _pieces: Piece[];\n\tprivate _index: number;\n\tprivate readonly _tree: PieceTreeBase;\n\tprivate readonly _BOM: string;\n\n\tconstructor(tree: PieceTreeBase, BOM: string) {\n\t\tthis._pieces = [];\n\t\tthis._tree = tree;\n\t\tthis._BOM = BOM;\n\t\tthis._index = 0;\n\t\tif (tree.root !== SENTINEL) {\n\t\t\ttree.iterate(tree.root, node => {\n\t\t\t\tif (node !== SENTINEL) {\n\t\t\t\t\tthis._pieces.push(node.piece);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t}\n\n\tread(): string | null {\n\t\tif (this._pieces.length === 0) {\n\t\t\tif (this._index === 0) {\n\t\t\t\tthis._index++;\n\t\t\t\treturn this._BOM;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (this._index > this._pieces.length - 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._index === 0) {\n\t\t\treturn this._BOM + this._tree.getPieceContent(this._pieces[this._index++]);\n\t\t}\n\t\treturn this._tree.getPieceContent(this._pieces[this._index++]);\n\t}\n}\n\ninterface CacheEntry {\n\tnode: TreeNode;\n\tnodeStartOffset: number;\n\tnodeStartLineNumber?: number;\n}\n\nclass PieceTreeSearchCache {\n\tprivate readonly _limit: number;\n\tprivate _cache: CacheEntry[];\n\n\tconstructor(limit: number) {\n\t\tthis._limit = limit;\n\t\tthis._cache = [];\n\t}\n\n\tpublic get(offset: number): CacheEntry | null {\n\t\tfor (let i = this._cache.length - 1; i >= 0; i--) {\n\t\t\tconst nodePos = this._cache[i];\n\t\t\tif (nodePos.nodeStartOffset <= offset && nodePos.nodeStartOffset + nodePos.node.piece.length >= offset) {\n\t\t\t\treturn nodePos;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic get2(lineNumber: number): { node: TreeNode; nodeStartOffset: number; nodeStartLineNumber: number } | null {\n\t\tfor (let i = this._cache.length - 1; i >= 0; i--) {\n\t\t\tconst nodePos = this._cache[i];\n\t\t\tif (nodePos.nodeStartLineNumber && nodePos.nodeStartLineNumber < lineNumber && nodePos.nodeStartLineNumber + nodePos.node.piece.lineFeedCnt >= lineNumber) {\n\t\t\t\treturn <{ node: TreeNode; nodeStartOffset: number; nodeStartLineNumber: number }>nodePos;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic set(nodePosition: CacheEntry) {\n\t\tif (this._cache.length >= this._limit) {\n\t\t\tthis._cache.shift();\n\t\t}\n\t\tthis._cache.push(nodePosition);\n\t}\n\n\tpublic validate(offset: number) {\n\t\tlet hasInvalidVal = false;\n\t\tconst tmp: Array<CacheEntry | null> = this._cache;\n\t\tfor (let i = 0; i < tmp.length; i++) {\n\t\t\tconst nodePos = tmp[i]!;\n\t\t\tif (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) {\n\t\t\t\ttmp[i] = null;\n\t\t\t\thasInvalidVal = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (hasInvalidVal) {\n\t\t\tconst newArr: CacheEntry[] = [];\n\t\t\tfor (const entry of tmp) {\n\t\t\t\tif (entry !== null) {\n\t\t\t\t\tnewArr.push(entry);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._cache = newArr;\n\t\t}\n\t}\n}\n\nexport class PieceTreeBase {\n\troot!: TreeNode;\n\tprotected _buffers!: StringBuffer[]; // 0 is change buffer, others are readonly original buffer.\n\tprotected _lineCnt!: number;\n\tprotected _length!: number;\n\tprotected _EOL!: '\\r\\n' | '\\n';\n\tprotected _EOLLength!: number;\n\tprotected _EOLNormalized!: boolean;\n\tprivate _lastChangeBufferPos!: BufferCursor;\n\tprivate _searchCache!: PieceTreeSearchCache;\n\tprivate _lastVisitedLine!: { lineNumber: number; value: string };\n\n\tconstructor(chunks: StringBuffer[], eol: '\\r\\n' | '\\n', eolNormalized: boolean) {\n\t\tthis.create(chunks, eol, eolNormalized);\n\t}\n\n\tcreate(chunks: StringBuffer[], eol: '\\r\\n' | '\\n', eolNormalized: boolean) {\n\t\tthis._buffers = [\n\t\t\tnew StringBuffer('', [0])\n\t\t];\n\t\tthis._lastChangeBufferPos = { line: 0, column: 0 };\n\t\tthis.root = SENTINEL;\n\t\tthis._lineCnt = 1;\n\t\tthis._length = 0;\n\t\tthis._EOL = eol;\n\t\tthis._EOLLength = eol.length;\n\t\tthis._EOLNormalized = eolNormalized;\n\n\t\tlet lastNode: TreeNode | null = null;\n\t\tfor (let i = 0, len = chunks.length; i < len; i++) {\n\t\t\tif (chunks[i].buffer.length > 0) {\n\t\t\t\tif (!chunks[i].lineStarts) {\n\t\t\t\t\tchunks[i].lineStarts = createLineStartsFast(chunks[i].buffer);\n\t\t\t\t}\n\n\t\t\t\tconst piece = new Piece(\n\t\t\t\t\ti + 1,\n\t\t\t\t\t{ line: 0, column: 0 },\n\t\t\t\t\t{ line: chunks[i].lineStarts.length - 1, column: chunks[i].buffer.length - chunks[i].lineStarts[chunks[i].lineStarts.length - 1] },\n\t\t\t\t\tchunks[i].lineStarts.length - 1,\n\t\t\t\t\tchunks[i].buffer.length\n\t\t\t\t);\n\t\t\t\tthis._buffers.push(chunks[i]);\n\t\t\t\tlastNode = this.rbInsertRight(lastNode, piece);\n\t\t\t}\n\t\t}\n\n\t\tthis._searchCache = new PieceTreeSearchCache(1);\n\t\tthis._lastVisitedLine = { lineNumber: 0, value: '' };\n\t\tthis.computeBufferMetadata();\n\t}\n\n\tnormalizeEOL(eol: '\\r\\n' | '\\n') {\n\t\tconst averageBufferSize = AverageBufferSize;\n\t\tconst min = averageBufferSize - Math.floor(averageBufferSize / 3);\n\t\tconst max = min * 2;\n\n\t\tlet tempChunk = '';\n\t\tlet tempChunkLen = 0;\n\t\tconst chunks: StringBuffer[] = [];\n\n\t\tthis.iterate(this.root, node => {\n\t\t\tconst str = this.getNodeContent(node);\n\t\t\tconst len = str.length;\n\t\t\tif (tempChunkLen <= min || tempChunkLen + len < max) {\n\t\t\t\ttempChunk += str;\n\t\t\t\ttempChunkLen += len;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// flush anyways\n\t\t\tconst text = tempChunk.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t\tchunks.push(new StringBuffer(text, createLineStartsFast(text)));\n\t\t\ttempChunk = str;\n\t\t\ttempChunkLen = len;\n\t\t\treturn true;\n\t\t});\n\n\t\tif (tempChunkLen > 0) {\n\t\t\tconst text = tempChunk.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t\tchunks.push(new StringBuffer(text, createLineStartsFast(text)));\n\t\t}\n\n\t\tthis.create(chunks, eol, true);\n\t}\n\n\t// #region Buffer API\n\tpublic getEOL(): '\\r\\n' | '\\n' {\n\t\treturn this._EOL;\n\t}\n\n\tpublic setEOL(newEOL: '\\r\\n' | '\\n'): void {\n\t\tthis._EOL = newEOL;\n\t\tthis._EOLLength = this._EOL.length;\n\t\tthis.normalizeEOL(newEOL);\n\t}\n\n\tpublic createSnapshot(BOM: string): ITextSnapshot {\n\t\treturn new PieceTreeSnapshot(this, BOM);\n\t}\n\n\tpublic getOffsetAt(lineNumber: number, column: number): number {\n\t\tlet leftLen = 0; // inorder\n\n\t\tlet x = this.root;\n\n\t\twhile (x !== SENTINEL) {\n\t\t\tif (x.left !== SENTINEL && x.lf_left + 1 >= lineNumber) {\n\t\t\t\tx = x.left;\n\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt + 1 >= lineNumber) {\n\t\t\t\tleftLen += x.size_left;\n\t\t\t\t// lineNumber >= 2\n\t\t\t\tconst accumualtedValInCurrentIndex = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\treturn leftLen += accumualtedValInCurrentIndex + column - 1;\n\t\t\t} else {\n\t\t\t\tlineNumber -= x.lf_left + x.piece.lineFeedCnt;\n\t\t\t\tleftLen += x.size_left + x.piece.length;\n\t\t\t\tx = x.right;\n\t\t\t}\n\t\t}\n\n\t\treturn leftLen;\n\t}\n\n\tpublic getPositionAt(offset: number): Position {\n\t\toffset = Math.floor(offset);\n\t\toffset = Math.max(0, offset);\n\n\t\tlet x = this.root;\n\t\tlet lfCnt = 0;\n\t\tconst originalOffset = offset;\n\n\t\twhile (x !== SENTINEL) {\n\t\t\tif (x.size_left !== 0 && x.size_left >= offset) {\n\t\t\t\tx = x.left;\n\t\t\t} else if (x.size_left + x.piece.length >= offset) {\n\t\t\t\tconst out = this.getIndexOf(x, offset - x.size_left);\n\n\t\t\t\tlfCnt += x.lf_left + out.index;\n\n\t\t\t\tif (out.index === 0) {\n\t\t\t\t\tconst lineStartOffset = this.getOffsetAt(lfCnt + 1, 1);\n\t\t\t\t\tconst column = originalOffset - lineStartOffset;\n\t\t\t\t\treturn new Position(lfCnt + 1, column + 1);\n\t\t\t\t}\n\n\t\t\t\treturn new Position(lfCnt + 1, out.remainder + 1);\n\t\t\t} else {\n\t\t\t\toffset -= x.size_left + x.piece.length;\n\t\t\t\tlfCnt += x.lf_left + x.piece.lineFeedCnt;\n\n\t\t\t\tif (x.right === SENTINEL) {\n\t\t\t\t\t// last node\n\t\t\t\t\tconst lineStartOffset = this.getOffsetAt(lfCnt + 1, 1);\n\t\t\t\t\tconst column = originalOffset - offset - lineStartOffset;\n\t\t\t\t\treturn new Position(lfCnt + 1, column + 1);\n\t\t\t\t} else {\n\t\t\t\t\tx = x.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Position(1, 1);\n\t}\n\n\tpublic getValueInRange(range: Range, eol?: string): string {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst startPosition = this.nodeAt2(range.startLineNumber, range.startColumn);\n\t\tconst endPosition = this.nodeAt2(range.endLineNumber, range.endColumn);\n\n\t\tconst value = this.getValueInRange2(startPosition, endPosition);\n\t\tif (eol) {\n\t\t\tif (eol !== this._EOL || !this._EOLNormalized) {\n\t\t\t\treturn value.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t\t}\n\n\t\t\tif (eol === this.getEOL() && this._EOLNormalized) {\n\t\t\t\tif (eol === '\\r\\n') {\n\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\treturn value.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t}\n\t\treturn value;\n\t}\n\n\tpublic getValueInRange2(startPosition: NodePosition, endPosition: NodePosition): string {\n\t\tif (startPosition.node === endPosition.node) {\n\t\t\tconst node = startPosition.node;\n\t\t\tconst buffer = this._buffers[node.piece.bufferIndex].buffer;\n\t\t\tconst startOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start);\n\t\t\treturn buffer.substring(startOffset + startPosition.remainder, startOffset + endPosition.remainder);\n\t\t}\n\n\t\tlet x = startPosition.node;\n\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\t\tlet ret = buffer.substring(startOffset + startPosition.remainder, startOffset + x.piece.length);\n\n\t\tx = x.next();\n\t\twhile (x !== SENTINEL) {\n\t\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\n\t\t\tif (x === endPosition.node) {\n\t\t\t\tret += buffer.substring(startOffset, startOffset + endPosition.remainder);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tret += buffer.substr(startOffset, x.piece.length);\n\t\t\t}\n\n\t\t\tx = x.next();\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tpublic getLinesContent(): string[] {\n\t\tconst lines: string[] = [];\n\t\tlet linesLength = 0;\n\t\tlet currentLine = '';\n\t\tlet danglingCR = false;\n\n\t\tthis.iterate(this.root, node => {\n\t\t\tif (node === SENTINEL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst piece = node.piece;\n\t\t\tlet pieceLength = piece.length;\n\t\t\tif (pieceLength === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst buffer = this._buffers[piece.bufferIndex].buffer;\n\t\t\tconst lineStarts = this._buffers[piece.bufferIndex].lineStarts;\n\n\t\t\tconst pieceStartLine = piece.start.line;\n\t\t\tconst pieceEndLine = piece.end.line;\n\t\t\tlet pieceStartOffset = lineStarts[pieceStartLine] + piece.start.column;\n\n\t\t\tif (danglingCR) {\n\t\t\t\tif (buffer.charCodeAt(pieceStartOffset) === CharCode.LineFeed) {\n\t\t\t\t\t// pretend the \\n was in the previous piece..\n\t\t\t\t\tpieceStartOffset++;\n\t\t\t\t\tpieceLength--;\n\t\t\t\t}\n\t\t\t\tlines[linesLength++] = currentLine;\n\t\t\t\tcurrentLine = '';\n\t\t\t\tdanglingCR = false;\n\t\t\t\tif (pieceLength === 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (pieceStartLine === pieceEndLine) {\n\t\t\t\t// this piece has no new lines\n\t\t\t\tif (!this._EOLNormalized && buffer.charCodeAt(pieceStartOffset + pieceLength - 1) === CharCode.CarriageReturn) {\n\t\t\t\t\tdanglingCR = true;\n\t\t\t\t\tcurrentLine += buffer.substr(pieceStartOffset, pieceLength - 1);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentLine += buffer.substr(pieceStartOffset, pieceLength);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// add the text before the first line start in this piece\n\t\t\tcurrentLine += (\n\t\t\t\tthis._EOLNormalized\n\t\t\t\t\t? buffer.substring(pieceStartOffset, Math.max(pieceStartOffset, lineStarts[pieceStartLine + 1] - this._EOLLength))\n\t\t\t\t\t: buffer.substring(pieceStartOffset, lineStarts[pieceStartLine + 1]).replace(/(\\r\\n|\\r|\\n)$/, '')\n\t\t\t);\n\t\t\tlines[linesLength++] = currentLine;\n\n\t\t\tfor (let line = pieceStartLine + 1; line < pieceEndLine; line++) {\n\t\t\t\tcurrentLine = (\n\t\t\t\t\tthis._EOLNormalized\n\t\t\t\t\t\t? buffer.substring(lineStarts[line], lineStarts[line + 1] - this._EOLLength)\n\t\t\t\t\t\t: buffer.substring(lineStarts[line], lineStarts[line + 1]).replace(/(\\r\\n|\\r|\\n)$/, '')\n\t\t\t\t);\n\t\t\t\tlines[linesLength++] = currentLine;\n\t\t\t}\n\n\t\t\tif (!this._EOLNormalized && buffer.charCodeAt(lineStarts[pieceEndLine] + piece.end.column - 1) === CharCode.CarriageReturn) {\n\t\t\t\tdanglingCR = true;\n\t\t\t\tif (piece.end.column === 0) {\n\t\t\t\t\t// The last line ended with a \\r, let's undo the push, it will be pushed by next iteration\n\t\t\t\t\tlinesLength--;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column - 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\n\t\tif (danglingCR) {\n\t\t\tlines[linesLength++] = currentLine;\n\t\t\tcurrentLine = '';\n\t\t}\n\n\t\tlines[linesLength++] = currentLine;\n\t\treturn lines;\n\t}\n\n\tpublic getLength(): number {\n\t\treturn this._length;\n\t}\n\n\tpublic getLineCount(): number {\n\t\treturn this._lineCnt;\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\tif (this._lastVisitedLine.lineNumber === lineNumber) {\n\t\t\treturn this._lastVisitedLine.value;\n\t\t}\n\n\t\tthis._lastVisitedLine.lineNumber = lineNumber;\n\n\t\tif (lineNumber === this._lineCnt) {\n\t\t\tthis._lastVisitedLine.value = this.getLineRawContent(lineNumber);\n\t\t} else if (this._EOLNormalized) {\n\t\t\tthis._lastVisitedLine.value = this.getLineRawContent(lineNumber, this._EOLLength);\n\t\t} else {\n\t\t\tthis._lastVisitedLine.value = this.getLineRawContent(lineNumber).replace(/(\\r\\n|\\r|\\n)$/, '');\n\t\t}\n\n\t\treturn this._lastVisitedLine.value;\n\t}\n\n\tprivate _getCharCode(nodePos: NodePosition): number {\n\t\tif (nodePos.remainder === nodePos.node.piece.length) {\n\t\t\t// the char we want to fetch is at the head of next node.\n\t\t\tconst matchingNode = nodePos.node.next();\n\t\t\tif (!matchingNode) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tconst buffer = this._buffers[matchingNode.piece.bufferIndex];\n\t\t\tconst startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start);\n\t\t\treturn buffer.buffer.charCodeAt(startOffset);\n\t\t} else {\n\t\t\tconst buffer = this._buffers[nodePos.node.piece.bufferIndex];\n\t\t\tconst startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start);\n\t\t\tconst targetOffset = startOffset + nodePos.remainder;\n\n\t\t\treturn buffer.buffer.charCodeAt(targetOffset);\n\t\t}\n\t}\n\n\tpublic getLineCharCode(lineNumber: number, index: number): number {\n\t\tconst nodePos = this.nodeAt2(lineNumber, index + 1);\n\t\treturn this._getCharCode(nodePos);\n\t}\n\n\tpublic getLineLength(lineNumber: number): number {\n\t\tif (lineNumber === this.getLineCount()) {\n\t\t\tconst startOffset = this.getOffsetAt(lineNumber, 1);\n\t\t\treturn this.getLength() - startOffset;\n\t\t}\n\t\treturn this.getOffsetAt(lineNumber + 1, 1) - this.getOffsetAt(lineNumber, 1) - this._EOLLength;\n\t}\n\n\tpublic findMatchesInNode(node: TreeNode, searcher: Searcher, startLineNumber: number, startColumn: number, startCursor: BufferCursor, endCursor: BufferCursor, searchData: SearchData, captureMatches: boolean, limitResultCount: number, resultLen: number, result: FindMatch[]) {\n\t\tconst buffer = this._buffers[node.piece.bufferIndex];\n\t\tconst startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start);\n\t\tconst start = this.offsetInBuffer(node.piece.bufferIndex, startCursor);\n\t\tconst end = this.offsetInBuffer(node.piece.bufferIndex, endCursor);\n\n\t\tlet m: RegExpExecArray | null;\n\t\t// Reset regex to search from the beginning\n\t\tconst ret: BufferCursor = { line: 0, column: 0 };\n\t\tlet searchText: string;\n\t\tlet offsetInBuffer: (offset: number) => number;\n\n\t\tif (searcher._wordSeparators) {\n\t\t\tsearchText = buffer.buffer.substring(start, end);\n\t\t\toffsetInBuffer = (offset: number) => offset + start;\n\t\t\tsearcher.reset(0);\n\t\t} else {\n\t\t\tsearchText = buffer.buffer;\n\t\t\toffsetInBuffer = (offset: number) => offset;\n\t\t\tsearcher.reset(start);\n\t\t}\n\n\t\tdo {\n\t\t\tm = searcher.next(searchText);\n\n\t\t\tif (m) {\n\t\t\t\tif (offsetInBuffer(m.index) >= end) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t\tthis.positionInBuffer(node, offsetInBuffer(m.index) - startOffsetInBuffer, ret);\n\t\t\t\tconst lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret);\n\t\t\t\tconst retStartColumn = ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1;\n\t\t\t\tconst retEndColumn = retStartColumn + m[0].length;\n\t\t\t\tresult[resultLen++] = createFindMatch(new Range(startLineNumber + lineFeedCnt, retStartColumn, startLineNumber + lineFeedCnt, retEndColumn), m, captureMatches);\n\n\t\t\t\tif (offsetInBuffer(m.index) + m[0].length >= end) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} while (m);\n\n\t\treturn resultLen;\n\t}\n\n\tpublic findMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst result: FindMatch[] = [];\n\t\tlet resultLen = 0;\n\t\tconst searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n\n\t\tlet startPosition = this.nodeAt2(searchRange.startLineNumber, searchRange.startColumn);\n\t\tif (startPosition === null) {\n\t\t\treturn [];\n\t\t}\n\t\tconst endPosition = this.nodeAt2(searchRange.endLineNumber, searchRange.endColumn);\n\t\tif (endPosition === null) {\n\t\t\treturn [];\n\t\t}\n\t\tlet start = this.positionInBuffer(startPosition.node, startPosition.remainder);\n\t\tconst end = this.positionInBuffer(endPosition.node, endPosition.remainder);\n\n\t\tif (startPosition.node === endPosition.node) {\n\t\t\tthis.findMatchesInNode(startPosition.node, searcher, searchRange.startLineNumber, searchRange.startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result);\n\t\t\treturn result;\n\t\t}\n\n\t\tlet startLineNumber = searchRange.startLineNumber;\n\n\t\tlet currentNode = startPosition.node;\n\t\twhile (currentNode !== endPosition.node) {\n\t\t\tconst lineBreakCnt = this.getLineFeedCnt(currentNode.piece.bufferIndex, start, currentNode.piece.end);\n\n\t\t\tif (lineBreakCnt >= 1) {\n\t\t\t\t// last line break position\n\t\t\t\tconst lineStarts = this._buffers[currentNode.piece.bufferIndex].lineStarts;\n\t\t\t\tconst startOffsetInBuffer = this.offsetInBuffer(currentNode.piece.bufferIndex, currentNode.piece.start);\n\t\t\t\tconst nextLineStartOffset = lineStarts[start.line + lineBreakCnt];\n\t\t\t\tconst startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1;\n\t\t\t\tresultLen = this.findMatchesInNode(currentNode, searcher, startLineNumber, startColumn, start, this.positionInBuffer(currentNode, nextLineStartOffset - startOffsetInBuffer), searchData, captureMatches, limitResultCount, resultLen, result);\n\n\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tstartLineNumber += lineBreakCnt;\n\t\t\t}\n\n\t\t\tconst startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0;\n\t\t\t// search for the remaining content\n\t\t\tif (startLineNumber === searchRange.endLineNumber) {\n\t\t\t\tconst text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1);\n\t\t\t\tresultLen = this._findMatchesInLine(searchData, searcher, text, searchRange.endLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tresultLen = this._findMatchesInLine(searchData, searcher, this.getLineContent(startLineNumber).substr(startColumn), startLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount);\n\n\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tstartLineNumber++;\n\t\t\tstartPosition = this.nodeAt2(startLineNumber, 1);\n\t\t\tcurrentNode = startPosition.node;\n\t\t\tstart = this.positionInBuffer(startPosition.node, startPosition.remainder);\n\t\t}\n\n\t\tif (startLineNumber === searchRange.endLineNumber) {\n\t\t\tconst startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0;\n\t\t\tconst text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1);\n\t\t\tresultLen = this._findMatchesInLine(searchData, searcher, text, searchRange.endLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount);\n\t\t\treturn result;\n\t\t}\n\n\t\tconst startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1;\n\t\tresultLen = this.findMatchesInNode(endPosition.node, searcher, startLineNumber, startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result);\n\t\treturn result;\n\t}\n\n\tprivate _findMatchesInLine(searchData: SearchData, searcher: Searcher, text: string, lineNumber: number, deltaOffset: number, resultLen: number, result: FindMatch[], captureMatches: boolean, limitResultCount: number): number {\n\t\tconst wordSeparators = searchData.wordSeparators;\n\t\tif (!captureMatches && searchData.simpleSearch) {\n\t\t\tconst searchString = searchData.simpleSearch;\n\t\t\tconst searchStringLen = searchString.length;\n\t\t\tconst textLength = text.length;\n\n\t\t\tlet lastMatchIndex = -searchStringLen;\n\t\t\twhile ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) {\n\t\t\t\tif (!wordSeparators || isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) {\n\t\t\t\t\tresult[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null);\n\t\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\t\treturn resultLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn resultLen;\n\t\t}\n\n\t\tlet m: RegExpExecArray | null;\n\t\t// Reset regex to search from the beginning\n\t\tsearcher.reset(0);\n\t\tdo {\n\t\t\tm = searcher.next(text);\n\t\t\tif (m) {\n\t\t\t\tresult[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches);\n\t\t\t\tif (resultLen >= limitResultCount) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (m);\n\t\treturn resultLen;\n\t}\n\n\t// #endregion\n\n\t// #region Piece Table\n\tpublic insert(offset: number, value: string, eolNormalized: boolean = false): void {\n\t\tthis._EOLNormalized = this._EOLNormalized && eolNormalized;\n\t\tthis._lastVisitedLine.lineNumber = 0;\n\t\tthis._lastVisitedLine.value = '';\n\n\t\tif (this.root !== SENTINEL) {\n\t\t\tconst { node, remainder, nodeStartOffset } = this.nodeAt(offset);\n\t\t\tconst piece = node.piece;\n\t\t\tconst bufferIndex = piece.bufferIndex;\n\t\t\tconst insertPosInBuffer = this.positionInBuffer(node, remainder);\n\t\t\tif (node.piece.bufferIndex === 0 &&\n\t\t\t\tpiece.end.line === this._lastChangeBufferPos.line &&\n\t\t\t\tpiece.end.column === this._lastChangeBufferPos.column &&\n\t\t\t\t(nodeStartOffset + piece.length === offset) &&\n\t\t\t\tvalue.length < AverageBufferSize\n\t\t\t) {\n\t\t\t\t// changed buffer\n\t\t\t\tthis.appendToNode(node, value);\n\t\t\t\tthis.computeBufferMetadata();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (nodeStartOffset === offset) {\n\t\t\t\tthis.insertContentToNodeLeft(value, node);\n\t\t\t\tthis._searchCache.validate(offset);\n\t\t\t} else if (nodeStartOffset + node.piece.length > offset) {\n\t\t\t\t// we are inserting into the middle of a node.\n\t\t\t\tconst nodesToDel: TreeNode[] = [];\n\t\t\t\tlet newRightPiece = new Piece(\n\t\t\t\t\tpiece.bufferIndex,\n\t\t\t\t\tinsertPosInBuffer,\n\t\t\t\t\tpiece.end,\n\t\t\t\t\tthis.getLineFeedCnt(piece.bufferIndex, insertPosInBuffer, piece.end),\n\t\t\t\t\tthis.offsetInBuffer(bufferIndex, piece.end) - this.offsetInBuffer(bufferIndex, insertPosInBuffer)\n\t\t\t\t);\n\n\t\t\t\tif (this.shouldCheckCRLF() && this.endWithCR(value)) {\n\t\t\t\t\tconst headOfRight = this.nodeCharCodeAt(node, remainder);\n\n\t\t\t\t\tif (headOfRight === 10 /** \\n */) {\n\t\t\t\t\t\tconst newStart: BufferCursor = { line: newRightPiece.start.line + 1, column: 0 };\n\t\t\t\t\t\tnewRightPiece = new Piece(\n\t\t\t\t\t\t\tnewRightPiece.bufferIndex,\n\t\t\t\t\t\t\tnewStart,\n\t\t\t\t\t\t\tnewRightPiece.end,\n\t\t\t\t\t\t\tthis.getLineFeedCnt(newRightPiece.bufferIndex, newStart, newRightPiece.end),\n\t\t\t\t\t\t\tnewRightPiece.length - 1\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tvalue += '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// reuse node for content before insertion point.\n\t\t\t\tif (this.shouldCheckCRLF() && this.startWithLF(value)) {\n\t\t\t\t\tconst tailOfLeft = this.nodeCharCodeAt(node, remainder - 1);\n\t\t\t\t\tif (tailOfLeft === 13 /** \\r */) {\n\t\t\t\t\t\tconst previousPos = this.positionInBuffer(node, remainder - 1);\n\t\t\t\t\t\tthis.deleteNodeTail(node, previousPos);\n\t\t\t\t\t\tvalue = '\\r' + value;\n\n\t\t\t\t\t\tif (node.piece.length === 0) {\n\t\t\t\t\t\t\tnodesToDel.push(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deleteNodeTail(node, insertPosInBuffer);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deleteNodeTail(node, insertPosInBuffer);\n\t\t\t\t}\n\n\t\t\t\tconst newPieces = this.createNewPieces(value);\n\t\t\t\tif (newRightPiece.length > 0) {\n\t\t\t\t\tthis.rbInsertRight(node, newRightPiece);\n\t\t\t\t}\n\n\t\t\t\tlet tmpNode = node;\n\t\t\t\tfor (let k = 0; k < newPieces.length; k++) {\n\t\t\t\t\ttmpNode = this.rbInsertRight(tmpNode, newPieces[k]);\n\t\t\t\t}\n\t\t\t\tthis.deleteNodes(nodesToDel);\n\t\t\t} else {\n\t\t\t\tthis.insertContentToNodeRight(value, node);\n\t\t\t}\n\t\t} else {\n\t\t\t// insert new node\n\t\t\tconst pieces = this.createNewPieces(value);\n\t\t\tlet node = this.rbInsertLeft(null, pieces[0]);\n\n\t\t\tfor (let k = 1; k < pieces.length; k++) {\n\t\t\t\tnode = this.rbInsertRight(node, pieces[k]);\n\t\t\t}\n\t\t}\n\n\t\t// todo, this is too brutal. Total line feed count should be updated the same way as lf_left.\n\t\tthis.computeBufferMetadata();\n\t}\n\n\tpublic delete(offset: number, cnt: number): void {\n\t\tthis._lastVisitedLine.lineNumber = 0;\n\t\tthis._lastVisitedLine.value = '';\n\n\t\tif (cnt <= 0 || this.root === SENTINEL) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startPosition = this.nodeAt(offset);\n\t\tconst endPosition = this.nodeAt(offset + cnt);\n\t\tconst startNode = startPosition.node;\n\t\tconst endNode = endPosition.node;\n\n\t\tif (startNode === endNode) {\n\t\t\tconst startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder);\n\t\t\tconst endSplitPosInBuffer = this.positionInBuffer(startNode, endPosition.remainder);\n\n\t\t\tif (startPosition.nodeStartOffset === offset) {\n\t\t\t\tif (cnt === startNode.piece.length) { // delete node\n\t\t\t\t\tconst next = startNode.next();\n\t\t\t\t\trbDelete(this, startNode);\n\t\t\t\t\tthis.validateCRLFWithPrevNode(next);\n\t\t\t\t\tthis.computeBufferMetadata();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.deleteNodeHead(startNode, endSplitPosInBuffer);\n\t\t\t\tthis._searchCache.validate(offset);\n\t\t\t\tthis.validateCRLFWithPrevNode(startNode);\n\t\t\t\tthis.computeBufferMetadata();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (startPosition.nodeStartOffset + startNode.piece.length === offset + cnt) {\n\t\t\t\tthis.deleteNodeTail(startNode, startSplitPosInBuffer);\n\t\t\t\tthis.validateCRLFWithNextNode(startNode);\n\t\t\t\tthis.computeBufferMetadata();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// delete content in the middle, this node will be splitted to nodes\n\t\t\tthis.shrinkNode(startNode, startSplitPosInBuffer, endSplitPosInBuffer);\n\t\t\tthis.computeBufferMetadata();\n\t\t\treturn;\n\t\t}\n\n\t\tconst nodesToDel: TreeNode[] = [];\n\n\t\tconst startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder);\n\t\tthis.deleteNodeTail(startNode, startSplitPosInBuffer);\n\t\tthis._searchCache.validate(offset);\n\t\tif (startNode.piece.length === 0) {\n\t\t\tnodesToDel.push(startNode);\n\t\t}\n\n\t\t// update last touched node\n\t\tconst endSplitPosInBuffer = this.positionInBuffer(endNode, endPosition.remainder);\n\t\tthis.deleteNodeHead(endNode, endSplitPosInBuffer);\n\t\tif (endNode.piece.length === 0) {\n\t\t\tnodesToDel.push(endNode);\n\t\t}\n\n\t\t// delete nodes in between\n\t\tconst secondNode = startNode.next();\n\t\tfor (let node = secondNode; node !== SENTINEL && node !== endNode; node = node.next()) {\n\t\t\tnodesToDel.push(node);\n\t\t}\n\n\t\tconst prev = startNode.piece.length === 0 ? startNode.prev() : startNode;\n\t\tthis.deleteNodes(nodesToDel);\n\t\tthis.validateCRLFWithNextNode(prev);\n\t\tthis.computeBufferMetadata();\n\t}\n\n\tprivate insertContentToNodeLeft(value: string, node: TreeNode) {\n\t\t// we are inserting content to the beginning of node\n\t\tconst nodesToDel: TreeNode[] = [];\n\t\tif (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) {\n\t\t\t// move `\\n` to new node.\n\n\t\t\tconst piece = node.piece;\n\t\t\tconst newStart: BufferCursor = { line: piece.start.line + 1, column: 0 };\n\t\t\tconst nPiece = new Piece(\n\t\t\t\tpiece.bufferIndex,\n\t\t\t\tnewStart,\n\t\t\t\tpiece.end,\n\t\t\t\tthis.getLineFeedCnt(piece.bufferIndex, newStart, piece.end),\n\t\t\t\tpiece.length - 1\n\t\t\t);\n\n\t\t\tnode.piece = nPiece;\n\n\t\t\tvalue += '\\n';\n\t\t\tupdateTreeMetadata(this, node, -1, -1);\n\n\t\t\tif (node.piece.length === 0) {\n\t\t\t\tnodesToDel.push(node);\n\t\t\t}\n\t\t}\n\n\t\tconst newPieces = this.createNewPieces(value);\n\t\tlet newNode = this.rbInsertLeft(node, newPieces[newPieces.length - 1]);\n\t\tfor (let k = newPieces.length - 2; k >= 0; k--) {\n\t\t\tnewNode = this.rbInsertLeft(newNode, newPieces[k]);\n\t\t}\n\t\tthis.validateCRLFWithPrevNode(newNode);\n\t\tthis.deleteNodes(nodesToDel);\n\t}\n\n\tprivate insertContentToNodeRight(value: string, node: TreeNode) {\n\t\t// we are inserting to the right of this node.\n\t\tif (this.adjustCarriageReturnFromNext(value, node)) {\n\t\t\t// move \\n to the new node.\n\t\t\tvalue += '\\n';\n\t\t}\n\n\t\tconst newPieces = this.createNewPieces(value);\n\t\tconst newNode = this.rbInsertRight(node, newPieces[0]);\n\t\tlet tmpNode = newNode;\n\n\t\tfor (let k = 1; k < newPieces.length; k++) {\n\t\t\ttmpNode = this.rbInsertRight(tmpNode, newPieces[k]);\n\t\t}\n\n\t\tthis.validateCRLFWithPrevNode(newNode);\n\t}\n\n\tprivate positionInBuffer(node: TreeNode, remainder: number): BufferCursor;\n\tprivate positionInBuffer(node: TreeNode, remainder: number, ret: BufferCursor): null;\n\tprivate positionInBuffer(node: TreeNode, remainder: number, ret?: BufferCursor): BufferCursor | null {\n\t\tconst piece = node.piece;\n\t\tconst bufferIndex = node.piece.bufferIndex;\n\t\tconst lineStarts = this._buffers[bufferIndex].lineStarts;\n\n\t\tconst startOffset = lineStarts[piece.start.line] + piece.start.column;\n\n\t\tconst offset = startOffset + remainder;\n\n\t\t// binary search offset between startOffset and endOffset\n\t\tlet low = piece.start.line;\n\t\tlet high = piece.end.line;\n\n\t\tlet mid: number = 0;\n\t\tlet midStop: number = 0;\n\t\tlet midStart: number = 0;\n\n\t\twhile (low <= high) {\n\t\t\tmid = low + ((high - low) / 2) | 0;\n\t\t\tmidStart = lineStarts[mid];\n\n\t\t\tif (mid === high) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tmidStop = lineStarts[mid + 1];\n\n\t\t\tif (offset < midStart) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else if (offset >= midStop) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (ret) {\n\t\t\tret.line = mid;\n\t\t\tret.column = offset - midStart;\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tline: mid,\n\t\t\tcolumn: offset - midStart\n\t\t};\n\t}\n\n\tprivate getLineFeedCnt(bufferIndex: number, start: BufferCursor, end: BufferCursor): number {\n\t\t// we don't need to worry about start: abc\\r|\\n, or abc|\\r, or abc|\\n, or abc|\\r\\n doesn't change the fact that, there is one line break after start.\n\t\t// now let's take care of end: abc\\r|\\n, if end is in between \\r and \\n, we need to add line feed count by 1\n\t\tif (end.column === 0) {\n\t\t\treturn end.line - start.line;\n\t\t}\n\n\t\tconst lineStarts = this._buffers[bufferIndex].lineStarts;\n\t\tif (end.line === lineStarts.length - 1) { // it means, there is no \\n after end, otherwise, there will be one more lineStart.\n\t\t\treturn end.line - start.line;\n\t\t}\n\n\t\tconst nextLineStartOffset = lineStarts[end.line + 1];\n\t\tconst endOffset = lineStarts[end.line] + end.column;\n\t\tif (nextLineStartOffset > endOffset + 1) { // there are more than 1 character after end, which means it can't be \\n\n\t\t\treturn end.line - start.line;\n\t\t}\n\t\t// endOffset + 1 === nextLineStartOffset\n\t\t// character at endOffset is \\n, so we check the character before first\n\t\t// if character at endOffset is \\r, end.column is 0 and we can't get here.\n\t\tconst previousCharOffset = endOffset - 1; // end.column > 0 so it's okay.\n\t\tconst buffer = this._buffers[bufferIndex].buffer;\n\n\t\tif (buffer.charCodeAt(previousCharOffset) === 13) {\n\t\t\treturn end.line - start.line + 1;\n\t\t} else {\n\t\t\treturn end.line - start.line;\n\t\t}\n\t}\n\n\tprivate offsetInBuffer(bufferIndex: number, cursor: BufferCursor): number {\n\t\tconst lineStarts = this._buffers[bufferIndex].lineStarts;\n\t\treturn lineStarts[cursor.line] + cursor.column;\n\t}\n\n\tprivate deleteNodes(nodes: TreeNode[]): void {\n\t\tfor (let i = 0; i < nodes.length; i++) {\n\t\t\trbDelete(this, nodes[i]);\n\t\t}\n\t}\n\n\tprivate createNewPieces(text: string): Piece[] {\n\t\tif (text.length > AverageBufferSize) {\n\t\t\t// the content is large, operations like substring, charCode becomes slow\n\t\t\t// so here we split it into smaller chunks, just like what we did for CR/LF normalization\n\t\t\tconst newPieces: Piece[] = [];\n\t\t\twhile (text.length > AverageBufferSize) {\n\t\t\t\tconst lastChar = text.charCodeAt(AverageBufferSize - 1);\n\t\t\t\tlet splitText;\n\t\t\t\tif (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {\n\t\t\t\t\t// last character is \\r or a high surrogate => keep it back\n\t\t\t\t\tsplitText = text.substring(0, AverageBufferSize - 1);\n\t\t\t\t\ttext = text.substring(AverageBufferSize - 1);\n\t\t\t\t} else {\n\t\t\t\t\tsplitText = text.substring(0, AverageBufferSize);\n\t\t\t\t\ttext = text.substring(AverageBufferSize);\n\t\t\t\t}\n\n\t\t\t\tconst lineStarts = createLineStartsFast(splitText);\n\t\t\t\tnewPieces.push(new Piece(\n\t\t\t\t\tthis._buffers.length, /* buffer index */\n\t\t\t\t\t{ line: 0, column: 0 },\n\t\t\t\t\t{ line: lineStarts.length - 1, column: splitText.length - lineStarts[lineStarts.length - 1] },\n\t\t\t\t\tlineStarts.length - 1,\n\t\t\t\t\tsplitText.length\n\t\t\t\t));\n\t\t\t\tthis._buffers.push(new StringBuffer(splitText, lineStarts));\n\t\t\t}\n\n\t\t\tconst lineStarts = createLineStartsFast(text);\n\t\t\tnewPieces.push(new Piece(\n\t\t\t\tthis._buffers.length, /* buffer index */\n\t\t\t\t{ line: 0, column: 0 },\n\t\t\t\t{ line: lineStarts.length - 1, column: text.length - lineStarts[lineStarts.length - 1] },\n\t\t\t\tlineStarts.length - 1,\n\t\t\t\ttext.length\n\t\t\t));\n\t\t\tthis._buffers.push(new StringBuffer(text, lineStarts));\n\n\t\t\treturn newPieces;\n\t\t}\n\n\t\tlet startOffset = this._buffers[0].buffer.length;\n\t\tconst lineStarts = createLineStartsFast(text, false);\n\n\t\tlet start = this._lastChangeBufferPos;\n\t\tif (this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === startOffset\n\t\t\t&& startOffset !== 0\n\t\t\t&& this.startWithLF(text)\n\t\t\t&& this.endWithCR(this._buffers[0].buffer) // todo, we can check this._lastChangeBufferPos's column as it's the last one\n\t\t) {\n\t\t\tthis._lastChangeBufferPos = { line: this._lastChangeBufferPos.line, column: this._lastChangeBufferPos.column + 1 };\n\t\t\tstart = this._lastChangeBufferPos;\n\n\t\t\tfor (let i = 0; i < lineStarts.length; i++) {\n\t\t\t\tlineStarts[i] += startOffset + 1;\n\t\t\t}\n\n\t\t\tthis._buffers[0].lineStarts = (<number[]>this._buffers[0].lineStarts).concat(<number[]>lineStarts.slice(1));\n\t\t\tthis._buffers[0].buffer += '_' + text;\n\t\t\tstartOffset += 1;\n\t\t} else {\n\t\t\tif (startOffset !== 0) {\n\t\t\t\tfor (let i = 0; i < lineStarts.length; i++) {\n\t\t\t\t\tlineStarts[i] += startOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._buffers[0].lineStarts = (<number[]>this._buffers[0].lineStarts).concat(<number[]>lineStarts.slice(1));\n\t\t\tthis._buffers[0].buffer += text;\n\t\t}\n\n\t\tconst endOffset = this._buffers[0].buffer.length;\n\t\tconst endIndex = this._buffers[0].lineStarts.length - 1;\n\t\tconst endColumn = endOffset - this._buffers[0].lineStarts[endIndex];\n\t\tconst endPos = { line: endIndex, column: endColumn };\n\t\tconst newPiece = new Piece(\n\t\t\t0, /** todo@peng */\n\t\t\tstart,\n\t\t\tendPos,\n\t\t\tthis.getLineFeedCnt(0, start, endPos),\n\t\t\tendOffset - startOffset\n\t\t);\n\t\tthis._lastChangeBufferPos = endPos;\n\t\treturn [newPiece];\n\t}\n\n\tpublic getLineRawContent(lineNumber: number, endOffset: number = 0): string {\n\t\tlet x = this.root;\n\n\t\tlet ret = '';\n\t\tconst cache = this._searchCache.get2(lineNumber);\n\t\tif (cache) {\n\t\t\tx = cache.node;\n\t\t\tconst prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1);\n\t\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\t\t\tif (cache.nodeStartLineNumber + x.piece.lineFeedCnt === lineNumber) {\n\t\t\t\tret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length);\n\t\t\t} else {\n\t\t\t\tconst accumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber);\n\t\t\t\treturn buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset);\n\t\t\t}\n\t\t} else {\n\t\t\tlet nodeStartOffset = 0;\n\t\t\tconst originalLineNumber = lineNumber;\n\t\t\twhile (x !== SENTINEL) {\n\t\t\t\tif (x.left !== SENTINEL && x.lf_left >= lineNumber - 1) {\n\t\t\t\t\tx = x.left;\n\t\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) {\n\t\t\t\t\tconst prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\t\tconst accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1);\n\t\t\t\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\t\t\t\t\tnodeStartOffset += x.size_left;\n\t\t\t\t\tthis._searchCache.set({\n\t\t\t\t\t\tnode: x,\n\t\t\t\t\t\tnodeStartOffset,\n\t\t\t\t\t\tnodeStartLineNumber: originalLineNumber - (lineNumber - 1 - x.lf_left)\n\t\t\t\t\t});\n\n\t\t\t\t\treturn buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset);\n\t\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) {\n\t\t\t\t\tconst prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\n\t\t\t\t\tret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tlineNumber -= x.lf_left + x.piece.lineFeedCnt;\n\t\t\t\t\tnodeStartOffset += x.size_left + x.piece.length;\n\t\t\t\t\tx = x.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// search in order, to find the node contains end column\n\t\tx = x.next();\n\t\twhile (x !== SENTINEL) {\n\t\t\tconst buffer = this._buffers[x.piece.bufferIndex].buffer;\n\n\t\t\tif (x.piece.lineFeedCnt > 0) {\n\t\t\t\tconst accumulatedValue = this.getAccumulatedValue(x, 0);\n\t\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\n\t\t\t\tret += buffer.substring(startOffset, startOffset + accumulatedValue - endOffset);\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\tconst startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\t\t\t\tret += buffer.substr(startOffset, x.piece.length);\n\t\t\t}\n\n\t\t\tx = x.next();\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tprivate computeBufferMetadata() {\n\t\tlet x = this.root;\n\n\t\tlet lfCnt = 1;\n\t\tlet len = 0;\n\n\t\twhile (x !== SENTINEL) {\n\t\t\tlfCnt += x.lf_left + x.piece.lineFeedCnt;\n\t\t\tlen += x.size_left + x.piece.length;\n\t\t\tx = x.right;\n\t\t}\n\n\t\tthis._lineCnt = lfCnt;\n\t\tthis._length = len;\n\t\tthis._searchCache.validate(this._length);\n\t}\n\n\t// #region node operations\n\tprivate getIndexOf(node: TreeNode, accumulatedValue: number): { index: number; remainder: number } {\n\t\tconst piece = node.piece;\n\t\tconst pos = this.positionInBuffer(node, accumulatedValue);\n\t\tconst lineCnt = pos.line - piece.start.line;\n\n\t\tif (this.offsetInBuffer(piece.bufferIndex, piece.end) - this.offsetInBuffer(piece.bufferIndex, piece.start) === accumulatedValue) {\n\t\t\t// we are checking the end of this node, so a CRLF check is necessary.\n\t\t\tconst realLineCnt = this.getLineFeedCnt(node.piece.bufferIndex, piece.start, pos);\n\t\t\tif (realLineCnt !== lineCnt) {\n\t\t\t\t// aha yes, CRLF\n\t\t\t\treturn { index: realLineCnt, remainder: 0 };\n\t\t\t}\n\t\t}\n\n\t\treturn { index: lineCnt, remainder: pos.column };\n\t}\n\n\tprivate getAccumulatedValue(node: TreeNode, index: number) {\n\t\tif (index < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst piece = node.piece;\n\t\tconst lineStarts = this._buffers[piece.bufferIndex].lineStarts;\n\t\tconst expectedLineStartIndex = piece.start.line + index + 1;\n\t\tif (expectedLineStartIndex > piece.end.line) {\n\t\t\treturn lineStarts[piece.end.line] + piece.end.column - lineStarts[piece.start.line] - piece.start.column;\n\t\t} else {\n\t\t\treturn lineStarts[expectedLineStartIndex] - lineStarts[piece.start.line] - piece.start.column;\n\t\t}\n\t}\n\n\tprivate deleteNodeTail(node: TreeNode, pos: BufferCursor) {\n\t\tconst piece = node.piece;\n\t\tconst originalLFCnt = piece.lineFeedCnt;\n\t\tconst originalEndOffset = this.offsetInBuffer(piece.bufferIndex, piece.end);\n\n\t\tconst newEnd = pos;\n\t\tconst newEndOffset = this.offsetInBuffer(piece.bufferIndex, newEnd);\n\t\tconst newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd);\n\n\t\tconst lf_delta = newLineFeedCnt - originalLFCnt;\n\t\tconst size_delta = newEndOffset - originalEndOffset;\n\t\tconst newLength = piece.length + size_delta;\n\n\t\tnode.piece = new Piece(\n\t\t\tpiece.bufferIndex,\n\t\t\tpiece.start,\n\t\t\tnewEnd,\n\t\t\tnewLineFeedCnt,\n\t\t\tnewLength\n\t\t);\n\n\t\tupdateTreeMetadata(this, node, size_delta, lf_delta);\n\t}\n\n\tprivate deleteNodeHead(node: TreeNode, pos: BufferCursor) {\n\t\tconst piece = node.piece;\n\t\tconst originalLFCnt = piece.lineFeedCnt;\n\t\tconst originalStartOffset = this.offsetInBuffer(piece.bufferIndex, piece.start);\n\n\t\tconst newStart = pos;\n\t\tconst newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end);\n\t\tconst newStartOffset = this.offsetInBuffer(piece.bufferIndex, newStart);\n\t\tconst lf_delta = newLineFeedCnt - originalLFCnt;\n\t\tconst size_delta = originalStartOffset - newStartOffset;\n\t\tconst newLength = piece.length + size_delta;\n\t\tnode.piece = new Piece(\n\t\t\tpiece.bufferIndex,\n\t\t\tnewStart,\n\t\t\tpiece.end,\n\t\t\tnewLineFeedCnt,\n\t\t\tnewLength\n\t\t);\n\n\t\tupdateTreeMetadata(this, node, size_delta, lf_delta);\n\t}\n\n\tprivate shrinkNode(node: TreeNode, start: BufferCursor, end: BufferCursor) {\n\t\tconst piece = node.piece;\n\t\tconst originalStartPos = piece.start;\n\t\tconst originalEndPos = piece.end;\n\n\t\t// old piece, originalStartPos, start\n\t\tconst oldLength = piece.length;\n\t\tconst oldLFCnt = piece.lineFeedCnt;\n\t\tconst newEnd = start;\n\t\tconst newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd);\n\t\tconst newLength = this.offsetInBuffer(piece.bufferIndex, start) - this.offsetInBuffer(piece.bufferIndex, originalStartPos);\n\n\t\tnode.piece = new Piece(\n\t\t\tpiece.bufferIndex,\n\t\t\tpiece.start,\n\t\t\tnewEnd,\n\t\t\tnewLineFeedCnt,\n\t\t\tnewLength\n\t\t);\n\n\t\tupdateTreeMetadata(this, node, newLength - oldLength, newLineFeedCnt - oldLFCnt);\n\n\t\t// new right piece, end, originalEndPos\n\t\tconst newPiece = new Piece(\n\t\t\tpiece.bufferIndex,\n\t\t\tend,\n\t\t\toriginalEndPos,\n\t\t\tthis.getLineFeedCnt(piece.bufferIndex, end, originalEndPos),\n\t\t\tthis.offsetInBuffer(piece.bufferIndex, originalEndPos) - this.offsetInBuffer(piece.bufferIndex, end)\n\t\t);\n\n\t\tconst newNode = this.rbInsertRight(node, newPiece);\n\t\tthis.validateCRLFWithPrevNode(newNode);\n\t}\n\n\tprivate appendToNode(node: TreeNode, value: string): void {\n\t\tif (this.adjustCarriageReturnFromNext(value, node)) {\n\t\t\tvalue += '\\n';\n\t\t}\n\n\t\tconst hitCRLF = this.shouldCheckCRLF() && this.startWithLF(value) && this.endWithCR(node);\n\t\tconst startOffset = this._buffers[0].buffer.length;\n\t\tthis._buffers[0].buffer += value;\n\t\tconst lineStarts = createLineStartsFast(value, false);\n\t\tfor (let i = 0; i < lineStarts.length; i++) {\n\t\t\tlineStarts[i] += startOffset;\n\t\t}\n\t\tif (hitCRLF) {\n\t\t\tconst prevStartOffset = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2];\n\t\t\t(<number[]>this._buffers[0].lineStarts).pop();\n\t\t\t// _lastChangeBufferPos is already wrong\n\t\t\tthis._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: startOffset - prevStartOffset };\n\t\t}\n\n\t\tthis._buffers[0].lineStarts = (<number[]>this._buffers[0].lineStarts).concat(<number[]>lineStarts.slice(1));\n\t\tconst endIndex = this._buffers[0].lineStarts.length - 1;\n\t\tconst endColumn = this._buffers[0].buffer.length - this._buffers[0].lineStarts[endIndex];\n\t\tconst newEnd = { line: endIndex, column: endColumn };\n\t\tconst newLength = node.piece.length + value.length;\n\t\tconst oldLineFeedCnt = node.piece.lineFeedCnt;\n\t\tconst newLineFeedCnt = this.getLineFeedCnt(0, node.piece.start, newEnd);\n\t\tconst lf_delta = newLineFeedCnt - oldLineFeedCnt;\n\n\t\tnode.piece = new Piece(\n\t\t\tnode.piece.bufferIndex,\n\t\t\tnode.piece.start,\n\t\t\tnewEnd,\n\t\t\tnewLineFeedCnt,\n\t\t\tnewLength\n\t\t);\n\n\t\tthis._lastChangeBufferPos = newEnd;\n\t\tupdateTreeMetadata(this, node, value.length, lf_delta);\n\t}\n\n\tprivate nodeAt(offset: number): NodePosition {\n\t\tlet x = this.root;\n\t\tconst cache = this._searchCache.get(offset);\n\t\tif (cache) {\n\t\t\treturn {\n\t\t\t\tnode: cache.node,\n\t\t\t\tnodeStartOffset: cache.nodeStartOffset,\n\t\t\t\tremainder: offset - cache.nodeStartOffset\n\t\t\t};\n\t\t}\n\n\t\tlet nodeStartOffset = 0;\n\n\t\twhile (x !== SENTINEL) {\n\t\t\tif (x.size_left > offset) {\n\t\t\t\tx = x.left;\n\t\t\t} else if (x.size_left + x.piece.length >= offset) {\n\t\t\t\tnodeStartOffset += x.size_left;\n\t\t\t\tconst ret = {\n\t\t\t\t\tnode: x,\n\t\t\t\t\tremainder: offset - x.size_left,\n\t\t\t\t\tnodeStartOffset\n\t\t\t\t};\n\t\t\t\tthis._searchCache.set(ret);\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\toffset -= x.size_left + x.piece.length;\n\t\t\t\tnodeStartOffset += x.size_left + x.piece.length;\n\t\t\t\tx = x.right;\n\t\t\t}\n\t\t}\n\n\t\treturn null!;\n\t}\n\n\tprivate nodeAt2(lineNumber: number, column: number): NodePosition {\n\t\tlet x = this.root;\n\t\tlet nodeStartOffset = 0;\n\n\t\twhile (x !== SENTINEL) {\n\t\t\tif (x.left !== SENTINEL && x.lf_left >= lineNumber - 1) {\n\t\t\t\tx = x.left;\n\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) {\n\t\t\t\tconst prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\tconst accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1);\n\t\t\t\tnodeStartOffset += x.size_left;\n\n\t\t\t\treturn {\n\t\t\t\t\tnode: x,\n\t\t\t\t\tremainder: Math.min(prevAccumualtedValue + column - 1, accumulatedValue),\n\t\t\t\t\tnodeStartOffset\n\t\t\t\t};\n\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) {\n\t\t\t\tconst prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\tif (prevAccumualtedValue + column - 1 <= x.piece.length) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tnode: x,\n\t\t\t\t\t\tremainder: prevAccumualtedValue + column - 1,\n\t\t\t\t\t\tnodeStartOffset\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tcolumn -= x.piece.length - prevAccumualtedValue;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlineNumber -= x.lf_left + x.piece.lineFeedCnt;\n\t\t\t\tnodeStartOffset += x.size_left + x.piece.length;\n\t\t\t\tx = x.right;\n\t\t\t}\n\t\t}\n\n\t\t// search in order, to find the node contains position.column\n\t\tx = x.next();\n\t\twhile (x !== SENTINEL) {\n\n\t\t\tif (x.piece.lineFeedCnt > 0) {\n\t\t\t\tconst accumulatedValue = this.getAccumulatedValue(x, 0);\n\t\t\t\tconst nodeStartOffset = this.offsetOfNode(x);\n\t\t\t\treturn {\n\t\t\t\t\tnode: x,\n\t\t\t\t\tremainder: Math.min(column - 1, accumulatedValue),\n\t\t\t\t\tnodeStartOffset\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tif (x.piece.length >= column - 1) {\n\t\t\t\t\tconst nodeStartOffset = this.offsetOfNode(x);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tnode: x,\n\t\t\t\t\t\tremainder: column - 1,\n\t\t\t\t\t\tnodeStartOffset\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tcolumn -= x.piece.length;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tx = x.next();\n\t\t}\n\n\t\treturn null!;\n\t}\n\n\tprivate nodeCharCodeAt(node: TreeNode, offset: number): number {\n\t\tif (node.piece.lineFeedCnt < 1) {\n\t\t\treturn -1;\n\t\t}\n\t\tconst buffer = this._buffers[node.piece.bufferIndex];\n\t\tconst newOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start) + offset;\n\t\treturn buffer.buffer.charCodeAt(newOffset);\n\t}\n\n\tprivate offsetOfNode(node: TreeNode): number {\n\t\tif (!node) {\n\t\t\treturn 0;\n\t\t}\n\t\tlet pos = node.size_left;\n\t\twhile (node !== this.root) {\n\t\t\tif (node.parent.right === node) {\n\t\t\t\tpos += node.parent.size_left + node.parent.piece.length;\n\t\t\t}\n\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\treturn pos;\n\t}\n\n\t// #endregion\n\n\t// #region CRLF\n\tprivate shouldCheckCRLF() {\n\t\treturn !(this._EOLNormalized && this._EOL === '\\n');\n\t}\n\n\tprivate startWithLF(val: string | TreeNode): boolean {\n\t\tif (typeof val === 'string') {\n\t\t\treturn val.charCodeAt(0) === 10;\n\t\t}\n\n\t\tif (val === SENTINEL || val.piece.lineFeedCnt === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst piece = val.piece;\n\t\tconst lineStarts = this._buffers[piece.bufferIndex].lineStarts;\n\t\tconst line = piece.start.line;\n\t\tconst startOffset = lineStarts[line] + piece.start.column;\n\t\tif (line === lineStarts.length - 1) {\n\t\t\t// last line, so there is no line feed at the end of this line\n\t\t\treturn false;\n\t\t}\n\t\tconst nextLineOffset = lineStarts[line + 1];\n\t\tif (nextLineOffset > startOffset + 1) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this._buffers[piece.bufferIndex].buffer.charCodeAt(startOffset) === 10;\n\t}\n\n\tprivate endWithCR(val: string | TreeNode): boolean {\n\t\tif (typeof val === 'string') {\n\t\t\treturn val.charCodeAt(val.length - 1) === 13;\n\t\t}\n\n\t\tif (val === SENTINEL || val.piece.lineFeedCnt === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.nodeCharCodeAt(val, val.piece.length - 1) === 13;\n\t}\n\n\tprivate validateCRLFWithPrevNode(nextNode: TreeNode) {\n\t\tif (this.shouldCheckCRLF() && this.startWithLF(nextNode)) {\n\t\t\tconst node = nextNode.prev();\n\t\t\tif (this.endWithCR(node)) {\n\t\t\t\tthis.fixCRLF(node, nextNode);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate validateCRLFWithNextNode(node: TreeNode) {\n\t\tif (this.shouldCheckCRLF() && this.endWithCR(node)) {\n\t\t\tconst nextNode = node.next();\n\t\t\tif (this.startWithLF(nextNode)) {\n\t\t\t\tthis.fixCRLF(node, nextNode);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate fixCRLF(prev: TreeNode, next: TreeNode) {\n\t\tconst nodesToDel: TreeNode[] = [];\n\t\t// update node\n\t\tconst lineStarts = this._buffers[prev.piece.bufferIndex].lineStarts;\n\t\tlet newEnd: BufferCursor;\n\t\tif (prev.piece.end.column === 0) {\n\t\t\t// it means, last line ends with \\r, not \\r\\n\n\t\t\tnewEnd = { line: prev.piece.end.line - 1, column: lineStarts[prev.piece.end.line] - lineStarts[prev.piece.end.line - 1] - 1 };\n\t\t} else {\n\t\t\t// \\r\\n\n\t\t\tnewEnd = { line: prev.piece.end.line, column: prev.piece.end.column - 1 };\n\t\t}\n\n\t\tconst prevNewLength = prev.piece.length - 1;\n\t\tconst prevNewLFCnt = prev.piece.lineFeedCnt - 1;\n\t\tprev.piece = new Piece(\n\t\t\tprev.piece.bufferIndex,\n\t\t\tprev.piece.start,\n\t\t\tnewEnd,\n\t\t\tprevNewLFCnt,\n\t\t\tprevNewLength\n\t\t);\n\n\t\tupdateTreeMetadata(this, prev, - 1, -1);\n\t\tif (prev.piece.length === 0) {\n\t\t\tnodesToDel.push(prev);\n\t\t}\n\n\t\t// update nextNode\n\t\tconst newStart: BufferCursor = { line: next.piece.start.line + 1, column: 0 };\n\t\tconst newLength = next.piece.length - 1;\n\t\tconst newLineFeedCnt = this.getLineFeedCnt(next.piece.bufferIndex, newStart, next.piece.end);\n\t\tnext.piece = new Piece(\n\t\t\tnext.piece.bufferIndex,\n\t\t\tnewStart,\n\t\t\tnext.piece.end,\n\t\t\tnewLineFeedCnt,\n\t\t\tnewLength\n\t\t);\n\n\t\tupdateTreeMetadata(this, next, - 1, -1);\n\t\tif (next.piece.length === 0) {\n\t\t\tnodesToDel.push(next);\n\t\t}\n\n\t\t// create new piece which contains \\r\\n\n\t\tconst pieces = this.createNewPieces('\\r\\n');\n\t\tthis.rbInsertRight(prev, pieces[0]);\n\t\t// delete empty nodes\n\n\t\tfor (let i = 0; i < nodesToDel.length; i++) {\n\t\t\trbDelete(this, nodesToDel[i]);\n\t\t}\n\t}\n\n\tprivate adjustCarriageReturnFromNext(value: string, node: TreeNode): boolean {\n\t\tif (this.shouldCheckCRLF() && this.endWithCR(value)) {\n\t\t\tconst nextNode = node.next();\n\t\t\tif (this.startWithLF(nextNode)) {\n\t\t\t\t// move `\\n` forward\n\t\t\t\tvalue += '\\n';\n\n\t\t\t\tif (nextNode.piece.length === 1) {\n\t\t\t\t\trbDelete(this, nextNode);\n\t\t\t\t} else {\n\n\t\t\t\t\tconst piece = nextNode.piece;\n\t\t\t\t\tconst newStart: BufferCursor = { line: piece.start.line + 1, column: 0 };\n\t\t\t\t\tconst newLength = piece.length - 1;\n\t\t\t\t\tconst newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end);\n\t\t\t\t\tnextNode.piece = new Piece(\n\t\t\t\t\t\tpiece.bufferIndex,\n\t\t\t\t\t\tnewStart,\n\t\t\t\t\t\tpiece.end,\n\t\t\t\t\t\tnewLineFeedCnt,\n\t\t\t\t\t\tnewLength\n\t\t\t\t\t);\n\n\t\t\t\t\tupdateTreeMetadata(this, nextNode, -1, -1);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// #endregion\n\n\t// #endregion\n\n\t// #region Tree operations\n\titerate(node: TreeNode, callback: (node: TreeNode) => boolean): boolean {\n\t\tif (node === SENTINEL) {\n\t\t\treturn callback(SENTINEL);\n\t\t}\n\n\t\tconst leftRet = this.iterate(node.left, callback);\n\t\tif (!leftRet) {\n\t\t\treturn leftRet;\n\t\t}\n\n\t\treturn callback(node) && this.iterate(node.right, callback);\n\t}\n\n\tprivate getNodeContent(node: TreeNode) {\n\t\tif (node === SENTINEL) {\n\t\t\treturn '';\n\t\t}\n\t\tconst buffer = this._buffers[node.piece.bufferIndex];\n\t\tlet currentContent;\n\t\tconst piece = node.piece;\n\t\tconst startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start);\n\t\tconst endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end);\n\t\tcurrentContent = buffer.buffer.substring(startOffset, endOffset);\n\t\treturn currentContent;\n\t}\n\n\tgetPieceContent(piece: Piece) {\n\t\tconst buffer = this._buffers[piece.bufferIndex];\n\t\tconst startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start);\n\t\tconst endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end);\n\t\tconst currentContent = buffer.buffer.substring(startOffset, endOffset);\n\t\treturn currentContent;\n\t}\n\n\t/**\n\t * node node\n\t * / \\ / \\\n\t * a b <---- a b\n\t * /\n\t * z\n\t */\n\tprivate rbInsertRight(node: TreeNode | null, p: Piece): TreeNode {\n\t\tconst z = new TreeNode(p, NodeColor.Red);\n\t\tz.left = SENTINEL;\n\t\tz.right = SENTINEL;\n\t\tz.parent = SENTINEL;\n\t\tz.size_left = 0;\n\t\tz.lf_left = 0;\n\n\t\tconst x = this.root;\n\t\tif (x === SENTINEL) {\n\t\t\tthis.root = z;\n\t\t\tz.color = NodeColor.Black;\n\t\t} else if (node!.right === SENTINEL) {\n\t\t\tnode!.right = z;\n\t\t\tz.parent = node!;\n\t\t} else {\n\t\t\tconst nextNode = leftest(node!.right);\n\t\t\tnextNode.left = z;\n\t\t\tz.parent = nextNode;\n\t\t}\n\n\t\tfixInsert(this, z);\n\t\treturn z;\n\t}\n\n\t/**\n\t * node node\n\t * / \\ / \\\n\t * a b ----> a b\n\t * \\\n\t * z\n\t */\n\tprivate rbInsertLeft(node: TreeNode | null, p: Piece): TreeNode {\n\t\tconst z = new TreeNode(p, NodeColor.Red);\n\t\tz.left = SENTINEL;\n\t\tz.right = SENTINEL;\n\t\tz.parent = SENTINEL;\n\t\tz.size_left = 0;\n\t\tz.lf_left = 0;\n\n\t\tif (this.root === SENTINEL) {\n\t\t\tthis.root = z;\n\t\t\tz.color = NodeColor.Black;\n\t\t} else if (node!.left === SENTINEL) {\n\t\t\tnode!.left = z;\n\t\t\tz.parent = node!;\n\t\t} else {\n\t\t\tconst prevNode = righttest(node!.left); // a\n\t\t\tprevNode.right = z;\n\t\t\tz.parent = prevNode;\n\t\t}\n\n\t\tfixInsert(this, z);\n\t\treturn z;\n\t}\n\t// #endregion\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 { Emitter } from 'vs/base/common/event';\nimport * as strings from 'vs/base/common/strings';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ApplyEditsResult, EndOfLinePreference, FindMatch, IInternalModelContentChange, ISingleEditOperationIdentifier, ITextBuffer, ITextSnapshot, ValidAnnotatedEditOperation, IValidEditOperation, SearchData } from 'vs/editor/common/model';\nimport { PieceTreeBase, StringBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase';\nimport { countEOL, StringEOL } from 'vs/editor/common/core/eolCounter';\nimport { TextChange } from 'vs/editor/common/core/textChange';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nexport interface IValidatedEditOperation {\n\tsortIndex: number;\n\tidentifier: ISingleEditOperationIdentifier | null;\n\trange: Range;\n\trangeOffset: number;\n\trangeLength: number;\n\ttext: string;\n\teolCount: number;\n\tfirstLineLength: number;\n\tlastLineLength: number;\n\tforceMoveMarkers: boolean;\n\tisAutoWhitespaceEdit: boolean;\n}\n\nexport interface IReverseSingleEditOperation extends IValidEditOperation {\n\tsortIndex: number;\n}\n\nexport class PieceTreeTextBuffer extends Disposable implements ITextBuffer {\n\tprivate _pieceTree: PieceTreeBase;\n\tprivate readonly _BOM: string;\n\tprivate _mightContainRTL: boolean;\n\tprivate _mightContainUnusualLineTerminators: boolean;\n\tprivate _mightContainNonBasicASCII: boolean;\n\n\tprivate readonly _onDidChangeContent: Emitter<void> = this._register(new Emitter<void>());\n\n\tconstructor(chunks: StringBuffer[], BOM: string, eol: '\\r\\n' | '\\n', containsRTL: boolean, containsUnusualLineTerminators: boolean, isBasicASCII: boolean, eolNormalized: boolean) {\n\t\tsuper();\n\t\tthis._BOM = BOM;\n\t\tthis._mightContainNonBasicASCII = !isBasicASCII;\n\t\tthis._mightContainRTL = containsRTL;\n\t\tthis._mightContainUnusualLineTerminators = containsUnusualLineTerminators;\n\t\tthis._pieceTree = new PieceTreeBase(chunks, eol, eolNormalized);\n\t}\n\tpublic mightContainRTL(): boolean {\n\t\treturn this._mightContainRTL;\n\t}\n\tpublic mightContainUnusualLineTerminators(): boolean {\n\t\treturn this._mightContainUnusualLineTerminators;\n\t}\n\tpublic resetMightContainUnusualLineTerminators(): void {\n\t\tthis._mightContainUnusualLineTerminators = false;\n\t}\n\tpublic mightContainNonBasicASCII(): boolean {\n\t\treturn this._mightContainNonBasicASCII;\n\t}\n\tpublic getBOM(): string {\n\t\treturn this._BOM;\n\t}\n\tpublic getEOL(): '\\r\\n' | '\\n' {\n\t\treturn this._pieceTree.getEOL();\n\t}\n\n\tpublic createSnapshot(preserveBOM: boolean): ITextSnapshot {\n\t\treturn this._pieceTree.createSnapshot(preserveBOM ? this._BOM : '');\n\t}\n\n\tpublic getOffsetAt(lineNumber: number, column: number): number {\n\t\treturn this._pieceTree.getOffsetAt(lineNumber, column);\n\t}\n\n\tpublic getPositionAt(offset: number): Position {\n\t\treturn this._pieceTree.getPositionAt(offset);\n\t}\n\n\tpublic getRangeAt(start: number, length: number): Range {\n\t\tconst end = start + length;\n\t\tconst startPosition = this.getPositionAt(start);\n\t\tconst endPosition = this.getPositionAt(end);\n\t\treturn new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);\n\t}\n\n\tpublic getValueInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): string {\n\t\tif (range.isEmpty()) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst lineEnding = this._getEndOfLine(eol);\n\t\treturn this._pieceTree.getValueInRange(range, lineEnding);\n\t}\n\n\tpublic getValueLengthInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): number {\n\t\tif (range.isEmpty()) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\treturn (range.endColumn - range.startColumn);\n\t\t}\n\n\t\tconst startOffset = this.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\tconst endOffset = this.getOffsetAt(range.endLineNumber, range.endColumn);\n\t\treturn endOffset - startOffset;\n\t}\n\n\tpublic getCharacterCountInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): number {\n\t\tif (this._mightContainNonBasicASCII) {\n\t\t\t// we must count by iterating\n\n\t\t\tlet result = 0;\n\n\t\t\tconst fromLineNumber = range.startLineNumber;\n\t\t\tconst toLineNumber = range.endLineNumber;\n\t\t\tfor (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {\n\t\t\t\tconst lineContent = this.getLineContent(lineNumber);\n\t\t\t\tconst fromOffset = (lineNumber === fromLineNumber ? range.startColumn - 1 : 0);\n\t\t\t\tconst toOffset = (lineNumber === toLineNumber ? range.endColumn - 1 : lineContent.length);\n\n\t\t\t\tfor (let offset = fromOffset; offset < toOffset; offset++) {\n\t\t\t\t\tif (strings.isHighSurrogate(lineContent.charCodeAt(offset))) {\n\t\t\t\t\t\tresult = result + 1;\n\t\t\t\t\t\toffset = offset + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = result + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult += this._getEndOfLine(eol).length * (toLineNumber - fromLineNumber);\n\n\t\t\treturn result;\n\t\t}\n\n\t\treturn this.getValueLengthInRange(range, eol);\n\t}\n\n\tpublic getLength(): number {\n\t\treturn this._pieceTree.getLength();\n\t}\n\n\tpublic getLineCount(): number {\n\t\treturn this._pieceTree.getLineCount();\n\t}\n\n\tpublic getLinesContent(): string[] {\n\t\treturn this._pieceTree.getLinesContent();\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\treturn this._pieceTree.getLineContent(lineNumber);\n\t}\n\n\tpublic getLineCharCode(lineNumber: number, index: number): number {\n\t\treturn this._pieceTree.getLineCharCode(lineNumber, index);\n\t}\n\n\tpublic getLineLength(lineNumber: number): number {\n\t\treturn this._pieceTree.getLineLength(lineNumber);\n\t}\n\n\tpublic getLineFirstNonWhitespaceColumn(lineNumber: number): number {\n\t\tconst result = strings.firstNonWhitespaceIndex(this.getLineContent(lineNumber));\n\t\tif (result === -1) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn result + 1;\n\t}\n\n\tpublic getLineLastNonWhitespaceColumn(lineNumber: number): number {\n\t\tconst result = strings.lastNonWhitespaceIndex(this.getLineContent(lineNumber));\n\t\tif (result === -1) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn result + 2;\n\t}\n\n\tprivate _getEndOfLine(eol: EndOfLinePreference): string {\n\t\tswitch (eol) {\n\t\t\tcase EndOfLinePreference.LF:\n\t\t\t\treturn '\\n';\n\t\t\tcase EndOfLinePreference.CRLF:\n\t\t\t\treturn '\\r\\n';\n\t\t\tcase EndOfLinePreference.TextDefined:\n\t\t\t\treturn this.getEOL();\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unknown EOL preference');\n\t\t}\n\t}\n\n\tpublic setEOL(newEOL: '\\r\\n' | '\\n'): void {\n\t\tthis._pieceTree.setEOL(newEOL);\n\t}\n\n\tpublic applyEdits(rawOperations: ValidAnnotatedEditOperation[], recordTrimAutoWhitespace: boolean, computeUndoEdits: boolean): ApplyEditsResult {\n\t\tlet mightContainRTL = this._mightContainRTL;\n\t\tlet mightContainUnusualLineTerminators = this._mightContainUnusualLineTerminators;\n\t\tlet mightContainNonBasicASCII = this._mightContainNonBasicASCII;\n\t\tlet canReduceOperations = true;\n\n\t\tlet operations: IValidatedEditOperation[] = [];\n\t\tfor (let i = 0; i < rawOperations.length; i++) {\n\t\t\tconst op = rawOperations[i];\n\t\t\tif (canReduceOperations && op._isTracked) {\n\t\t\t\tcanReduceOperations = false;\n\t\t\t}\n\t\t\tconst validatedRange = op.range;\n\t\t\tif (op.text) {\n\t\t\t\tlet textMightContainNonBasicASCII = true;\n\t\t\t\tif (!mightContainNonBasicASCII) {\n\t\t\t\t\ttextMightContainNonBasicASCII = !strings.isBasicASCII(op.text);\n\t\t\t\t\tmightContainNonBasicASCII = textMightContainNonBasicASCII;\n\t\t\t\t}\n\t\t\t\tif (!mightContainRTL && textMightContainNonBasicASCII) {\n\t\t\t\t\t// check if the new inserted text contains RTL\n\t\t\t\t\tmightContainRTL = strings.containsRTL(op.text);\n\t\t\t\t}\n\t\t\t\tif (!mightContainUnusualLineTerminators && textMightContainNonBasicASCII) {\n\t\t\t\t\t// check if the new inserted text contains unusual line terminators\n\t\t\t\t\tmightContainUnusualLineTerminators = strings.containsUnusualLineTerminators(op.text);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet validText = '';\n\t\t\tlet eolCount = 0;\n\t\t\tlet firstLineLength = 0;\n\t\t\tlet lastLineLength = 0;\n\t\t\tif (op.text) {\n\t\t\t\tlet strEOL: StringEOL;\n\t\t\t\t[eolCount, firstLineLength, lastLineLength, strEOL] = countEOL(op.text);\n\n\t\t\t\tconst bufferEOL = this.getEOL();\n\t\t\t\tconst expectedStrEOL = (bufferEOL === '\\r\\n' ? StringEOL.CRLF : StringEOL.LF);\n\t\t\t\tif (strEOL === StringEOL.Unknown || strEOL === expectedStrEOL) {\n\t\t\t\t\tvalidText = op.text;\n\t\t\t\t} else {\n\t\t\t\t\tvalidText = op.text.replace(/\\r\\n|\\r|\\n/g, bufferEOL);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toperations[i] = {\n\t\t\t\tsortIndex: i,\n\t\t\t\tidentifier: op.identifier || null,\n\t\t\t\trange: validatedRange,\n\t\t\t\trangeOffset: this.getOffsetAt(validatedRange.startLineNumber, validatedRange.startColumn),\n\t\t\t\trangeLength: this.getValueLengthInRange(validatedRange),\n\t\t\t\ttext: validText,\n\t\t\t\teolCount: eolCount,\n\t\t\t\tfirstLineLength: firstLineLength,\n\t\t\t\tlastLineLength: lastLineLength,\n\t\t\t\tforceMoveMarkers: Boolean(op.forceMoveMarkers),\n\t\t\t\tisAutoWhitespaceEdit: op.isAutoWhitespaceEdit || false\n\t\t\t};\n\t\t}\n\n\t\t// Sort operations ascending\n\t\toperations.sort(PieceTreeTextBuffer._sortOpsAscending);\n\n\t\tlet hasTouchingRanges = false;\n\t\tfor (let i = 0, count = operations.length - 1; i < count; i++) {\n\t\t\tconst rangeEnd = operations[i].range.getEndPosition();\n\t\t\tconst nextRangeStart = operations[i + 1].range.getStartPosition();\n\n\t\t\tif (nextRangeStart.isBeforeOrEqual(rangeEnd)) {\n\t\t\t\tif (nextRangeStart.isBefore(rangeEnd)) {\n\t\t\t\t\t// overlapping ranges\n\t\t\t\t\tthrow new Error('Overlapping ranges are not allowed!');\n\t\t\t\t}\n\t\t\t\thasTouchingRanges = true;\n\t\t\t}\n\t\t}\n\n\t\tif (canReduceOperations) {\n\t\t\toperations = this._reduceOperations(operations);\n\t\t}\n\n\t\t// Delta encode operations\n\t\tconst reverseRanges = (computeUndoEdits || recordTrimAutoWhitespace ? PieceTreeTextBuffer._getInverseEditRanges(operations) : []);\n\t\tconst newTrimAutoWhitespaceCandidates: { lineNumber: number; oldContent: string }[] = [];\n\t\tif (recordTrimAutoWhitespace) {\n\t\t\tfor (let i = 0; i < operations.length; i++) {\n\t\t\t\tconst op = operations[i];\n\t\t\t\tconst reverseRange = reverseRanges[i];\n\n\t\t\t\tif (op.isAutoWhitespaceEdit && op.range.isEmpty()) {\n\t\t\t\t\t// Record already the future line numbers that might be auto whitespace removal candidates on next edit\n\t\t\t\t\tfor (let lineNumber = reverseRange.startLineNumber; lineNumber <= reverseRange.endLineNumber; lineNumber++) {\n\t\t\t\t\t\tlet currentLineContent = '';\n\t\t\t\t\t\tif (lineNumber === reverseRange.startLineNumber) {\n\t\t\t\t\t\t\tcurrentLineContent = this.getLineContent(op.range.startLineNumber);\n\t\t\t\t\t\t\tif (strings.firstNonWhitespaceIndex(currentLineContent) !== -1) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewTrimAutoWhitespaceCandidates.push({ lineNumber: lineNumber, oldContent: currentLineContent });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet reverseOperations: IReverseSingleEditOperation[] | null = null;\n\t\tif (computeUndoEdits) {\n\n\t\t\tlet reverseRangeDeltaOffset = 0;\n\t\t\treverseOperations = [];\n\t\t\tfor (let i = 0; i < operations.length; i++) {\n\t\t\t\tconst op = operations[i];\n\t\t\t\tconst reverseRange = reverseRanges[i];\n\t\t\t\tconst bufferText = this.getValueInRange(op.range);\n\t\t\t\tconst reverseRangeOffset = op.rangeOffset + reverseRangeDeltaOffset;\n\t\t\t\treverseRangeDeltaOffset += (op.text.length - bufferText.length);\n\n\t\t\t\treverseOperations[i] = {\n\t\t\t\t\tsortIndex: op.sortIndex,\n\t\t\t\t\tidentifier: op.identifier,\n\t\t\t\t\trange: reverseRange,\n\t\t\t\t\ttext: bufferText,\n\t\t\t\t\ttextChange: new TextChange(op.rangeOffset, bufferText, reverseRangeOffset, op.text)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Can only sort reverse operations when the order is not significant\n\t\t\tif (!hasTouchingRanges) {\n\t\t\t\treverseOperations.sort((a, b) => a.sortIndex - b.sortIndex);\n\t\t\t}\n\t\t}\n\n\n\t\tthis._mightContainRTL = mightContainRTL;\n\t\tthis._mightContainUnusualLineTerminators = mightContainUnusualLineTerminators;\n\t\tthis._mightContainNonBasicASCII = mightContainNonBasicASCII;\n\n\t\tconst contentChanges = this._doApplyEdits(operations);\n\n\t\tlet trimAutoWhitespaceLineNumbers: number[] | null = null;\n\t\tif (recordTrimAutoWhitespace && newTrimAutoWhitespaceCandidates.length > 0) {\n\t\t\t// sort line numbers auto whitespace removal candidates for next edit descending\n\t\t\tnewTrimAutoWhitespaceCandidates.sort((a, b) => b.lineNumber - a.lineNumber);\n\n\t\t\ttrimAutoWhitespaceLineNumbers = [];\n\t\t\tfor (let i = 0, len = newTrimAutoWhitespaceCandidates.length; i < len; i++) {\n\t\t\t\tconst lineNumber = newTrimAutoWhitespaceCandidates[i].lineNumber;\n\t\t\t\tif (i > 0 && newTrimAutoWhitespaceCandidates[i - 1].lineNumber === lineNumber) {\n\t\t\t\t\t// Do not have the same line number twice\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst prevContent = newTrimAutoWhitespaceCandidates[i].oldContent;\n\t\t\t\tconst lineContent = this.getLineContent(lineNumber);\n\n\t\t\t\tif (lineContent.length === 0 || lineContent === prevContent || strings.firstNonWhitespaceIndex(lineContent) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttrimAutoWhitespaceLineNumbers.push(lineNumber);\n\t\t\t}\n\t\t}\n\n\t\tthis._onDidChangeContent.fire();\n\n\t\treturn new ApplyEditsResult(\n\t\t\treverseOperations,\n\t\t\tcontentChanges,\n\t\t\ttrimAutoWhitespaceLineNumbers\n\t\t);\n\t}\n\n\t/**\n\t * Transform operations such that they represent the same logic edit,\n\t * but that they also do not cause OOM crashes.\n\t */\n\tprivate _reduceOperations(operations: IValidatedEditOperation[]): IValidatedEditOperation[] {\n\t\tif (operations.length < 1000) {\n\t\t\t// We know from empirical testing that a thousand edits work fine regardless of their shape.\n\t\t\treturn operations;\n\t\t}\n\n\t\t// At one point, due to how events are emitted and how each operation is handled,\n\t\t// some operations can trigger a high amount of temporary string allocations,\n\t\t// that will immediately get edited again.\n\t\t// e.g. a formatter inserting ridiculous ammounts of \\n on a model with a single line\n\t\t// Therefore, the strategy is to collapse all the operations into a huge single edit operation\n\t\treturn [this._toSingleEditOperation(operations)];\n\t}\n\n\t_toSingleEditOperation(operations: IValidatedEditOperation[]): IValidatedEditOperation {\n\t\tlet forceMoveMarkers = false;\n\t\tconst firstEditRange = operations[0].range;\n\t\tconst lastEditRange = operations[operations.length - 1].range;\n\t\tconst entireEditRange = new Range(firstEditRange.startLineNumber, firstEditRange.startColumn, lastEditRange.endLineNumber, lastEditRange.endColumn);\n\t\tlet lastEndLineNumber = firstEditRange.startLineNumber;\n\t\tlet lastEndColumn = firstEditRange.startColumn;\n\t\tconst result: string[] = [];\n\n\t\tfor (let i = 0, len = operations.length; i < len; i++) {\n\t\t\tconst operation = operations[i];\n\t\t\tconst range = operation.range;\n\n\t\t\tforceMoveMarkers = forceMoveMarkers || operation.forceMoveMarkers;\n\n\t\t\t// (1) -- Push old text\n\t\t\tresult.push(this.getValueInRange(new Range(lastEndLineNumber, lastEndColumn, range.startLineNumber, range.startColumn)));\n\n\t\t\t// (2) -- Push new text\n\t\t\tif (operation.text.length > 0) {\n\t\t\t\tresult.push(operation.text);\n\t\t\t}\n\n\t\t\tlastEndLineNumber = range.endLineNumber;\n\t\t\tlastEndColumn = range.endColumn;\n\t\t}\n\n\t\tconst text = result.join('');\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\n\t\treturn {\n\t\t\tsortIndex: 0,\n\t\t\tidentifier: operations[0].identifier,\n\t\t\trange: entireEditRange,\n\t\t\trangeOffset: this.getOffsetAt(entireEditRange.startLineNumber, entireEditRange.startColumn),\n\t\t\trangeLength: this.getValueLengthInRange(entireEditRange, EndOfLinePreference.TextDefined),\n\t\t\ttext: text,\n\t\t\teolCount: eolCount,\n\t\t\tfirstLineLength: firstLineLength,\n\t\t\tlastLineLength: lastLineLength,\n\t\t\tforceMoveMarkers: forceMoveMarkers,\n\t\t\tisAutoWhitespaceEdit: false\n\t\t};\n\t}\n\n\tprivate _doApplyEdits(operations: IValidatedEditOperation[]): IInternalModelContentChange[] {\n\t\toperations.sort(PieceTreeTextBuffer._sortOpsDescending);\n\n\t\tconst contentChanges: IInternalModelContentChange[] = [];\n\n\t\t// operations are from bottom to top\n\t\tfor (let i = 0; i < operations.length; i++) {\n\t\t\tconst op = operations[i];\n\n\t\t\tconst startLineNumber = op.range.startLineNumber;\n\t\t\tconst startColumn = op.range.startColumn;\n\t\t\tconst endLineNumber = op.range.endLineNumber;\n\t\t\tconst endColumn = op.range.endColumn;\n\n\t\t\tif (startLineNumber === endLineNumber && startColumn === endColumn && op.text.length === 0) {\n\t\t\t\t// no-op\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (op.text) {\n\t\t\t\t// replacement\n\t\t\t\tthis._pieceTree.delete(op.rangeOffset, op.rangeLength);\n\t\t\t\tthis._pieceTree.insert(op.rangeOffset, op.text, true);\n\n\t\t\t} else {\n\t\t\t\t// deletion\n\t\t\t\tthis._pieceTree.delete(op.rangeOffset, op.rangeLength);\n\t\t\t}\n\n\t\t\tconst contentChangeRange = new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t\t\tcontentChanges.push({\n\t\t\t\trange: contentChangeRange,\n\t\t\t\trangeLength: op.rangeLength,\n\t\t\t\ttext: op.text,\n\t\t\t\trangeOffset: op.rangeOffset,\n\t\t\t\tforceMoveMarkers: op.forceMoveMarkers\n\t\t\t});\n\t\t}\n\t\treturn contentChanges;\n\t}\n\n\tfindMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\treturn this._pieceTree.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount);\n\t}\n\n\t/**\n\t * Assumes `operations` are validated and sorted ascending\n\t */\n\tpublic static _getInverseEditRanges(operations: IValidatedEditOperation[]): Range[] {\n\t\tconst result: Range[] = [];\n\n\t\tlet prevOpEndLineNumber: number = 0;\n\t\tlet prevOpEndColumn: number = 0;\n\t\tlet prevOp: IValidatedEditOperation | null = null;\n\t\tfor (let i = 0, len = operations.length; i < len; i++) {\n\t\t\tconst op = operations[i];\n\n\t\t\tlet startLineNumber: number;\n\t\t\tlet startColumn: number;\n\n\t\t\tif (prevOp) {\n\t\t\t\tif (prevOp.range.endLineNumber === op.range.startLineNumber) {\n\t\t\t\t\tstartLineNumber = prevOpEndLineNumber;\n\t\t\t\t\tstartColumn = prevOpEndColumn + (op.range.startColumn - prevOp.range.endColumn);\n\t\t\t\t} else {\n\t\t\t\t\tstartLineNumber = prevOpEndLineNumber + (op.range.startLineNumber - prevOp.range.endLineNumber);\n\t\t\t\t\tstartColumn = op.range.startColumn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstartLineNumber = op.range.startLineNumber;\n\t\t\t\tstartColumn = op.range.startColumn;\n\t\t\t}\n\n\t\t\tlet resultRange: Range;\n\n\t\t\tif (op.text.length > 0) {\n\t\t\t\t// the operation inserts something\n\t\t\t\tconst lineCount = op.eolCount + 1;\n\n\t\t\t\tif (lineCount === 1) {\n\t\t\t\t\t// single line insert\n\t\t\t\t\tresultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn + op.firstLineLength);\n\t\t\t\t} else {\n\t\t\t\t\t// multi line insert\n\t\t\t\t\tresultRange = new Range(startLineNumber, startColumn, startLineNumber + lineCount - 1, op.lastLineLength + 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// There is nothing to insert\n\t\t\t\tresultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn);\n\t\t\t}\n\n\t\t\tprevOpEndLineNumber = resultRange.endLineNumber;\n\t\t\tprevOpEndColumn = resultRange.endColumn;\n\n\t\t\tresult.push(resultRange);\n\t\t\tprevOp = op;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _sortOpsAscending(a: IValidatedEditOperation, b: IValidatedEditOperation): number {\n\t\tconst r = Range.compareRangesUsingEnds(a.range, b.range);\n\t\tif (r === 0) {\n\t\t\treturn a.sortIndex - b.sortIndex;\n\t\t}\n\t\treturn r;\n\t}\n\n\tprivate static _sortOpsDescending(a: IValidatedEditOperation, b: IValidatedEditOperation): number {\n\t\tconst r = Range.compareRangesUsingEnds(a.range, b.range);\n\t\tif (r === 0) {\n\t\t\treturn b.sortIndex - a.sortIndex;\n\t\t}\n\t\treturn -r;\n\t}\n\t// #endregion\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 { CharCode } from 'vs/base/common/charCode';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { DefaultEndOfLine, ITextBuffer, ITextBufferBuilder, ITextBufferFactory } from 'vs/editor/common/model';\nimport { StringBuffer, createLineStarts, createLineStartsFast } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase';\nimport { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer';\n\nexport class PieceTreeTextBufferFactory implements ITextBufferFactory {\n\n\tconstructor(\n\t\tprivate readonly _chunks: StringBuffer[],\n\t\tprivate readonly _bom: string,\n\t\tprivate readonly _cr: number,\n\t\tprivate readonly _lf: number,\n\t\tprivate readonly _crlf: number,\n\t\tprivate readonly _containsRTL: boolean,\n\t\tprivate readonly _containsUnusualLineTerminators: boolean,\n\t\tprivate readonly _isBasicASCII: boolean,\n\t\tprivate readonly _normalizeEOL: boolean\n\t) { }\n\n\tprivate _getEOL(defaultEOL: DefaultEndOfLine): '\\r\\n' | '\\n' {\n\t\tconst totalEOLCount = this._cr + this._lf + this._crlf;\n\t\tconst totalCRCount = this._cr + this._crlf;\n\t\tif (totalEOLCount === 0) {\n\t\t\t// This is an empty file or a file with precisely one line\n\t\t\treturn (defaultEOL === DefaultEndOfLine.LF ? '\\n' : '\\r\\n');\n\t\t}\n\t\tif (totalCRCount > totalEOLCount / 2) {\n\t\t\t// More than half of the file contains \\r\\n ending lines\n\t\t\treturn '\\r\\n';\n\t\t}\n\t\t// At least one line more ends in \\n\n\t\treturn '\\n';\n\t}\n\n\tpublic create(defaultEOL: DefaultEndOfLine): { textBuffer: ITextBuffer; disposable: IDisposable } {\n\t\tconst eol = this._getEOL(defaultEOL);\n\t\tconst chunks = this._chunks;\n\n\t\tif (this._normalizeEOL &&\n\t\t\t((eol === '\\r\\n' && (this._cr > 0 || this._lf > 0))\n\t\t\t\t|| (eol === '\\n' && (this._cr > 0 || this._crlf > 0)))\n\t\t) {\n\t\t\t// Normalize pieces\n\t\t\tfor (let i = 0, len = chunks.length; i < len; i++) {\n\t\t\t\tconst str = chunks[i].buffer.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t\t\tconst newLineStart = createLineStartsFast(str);\n\t\t\t\tchunks[i] = new StringBuffer(str, newLineStart);\n\t\t\t}\n\t\t}\n\n\t\tconst textBuffer = new PieceTreeTextBuffer(chunks, this._bom, eol, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL);\n\t\treturn { textBuffer: textBuffer, disposable: textBuffer };\n\t}\n}\n\nexport class PieceTreeTextBufferBuilder implements ITextBufferBuilder {\n\tprivate readonly chunks: StringBuffer[];\n\tprivate BOM: string;\n\n\tprivate _hasPreviousChar: boolean;\n\tprivate _previousChar: number;\n\tprivate readonly _tmpLineStarts: number[];\n\n\tprivate cr: number;\n\tprivate lf: number;\n\tprivate crlf: number;\n\tprivate containsRTL: boolean;\n\tprivate containsUnusualLineTerminators: boolean;\n\tprivate isBasicASCII: boolean;\n\n\tconstructor() {\n\t\tthis.chunks = [];\n\t\tthis.BOM = '';\n\n\t\tthis._hasPreviousChar = false;\n\t\tthis._previousChar = 0;\n\t\tthis._tmpLineStarts = [];\n\n\t\tthis.cr = 0;\n\t\tthis.lf = 0;\n\t\tthis.crlf = 0;\n\t\tthis.containsRTL = false;\n\t\tthis.containsUnusualLineTerminators = false;\n\t\tthis.isBasicASCII = true;\n\t}\n\n\tpublic acceptChunk(chunk: string): void {\n\t\tif (chunk.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.chunks.length === 0) {\n\t\t\tif (strings.startsWithUTF8BOM(chunk)) {\n\t\t\t\tthis.BOM = strings.UTF8_BOM_CHARACTER;\n\t\t\t\tchunk = chunk.substr(1);\n\t\t\t}\n\t\t}\n\n\t\tconst lastChar = chunk.charCodeAt(chunk.length - 1);\n\t\tif (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {\n\t\t\t// last character is \\r or a high surrogate => keep it back\n\t\t\tthis._acceptChunk1(chunk.substr(0, chunk.length - 1), false);\n\t\t\tthis._hasPreviousChar = true;\n\t\t\tthis._previousChar = lastChar;\n\t\t} else {\n\t\t\tthis._acceptChunk1(chunk, false);\n\t\t\tthis._hasPreviousChar = false;\n\t\t\tthis._previousChar = lastChar;\n\t\t}\n\t}\n\n\tprivate _acceptChunk1(chunk: string, allowEmptyStrings: boolean): void {\n\t\tif (!allowEmptyStrings && chunk.length === 0) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._hasPreviousChar) {\n\t\t\tthis._acceptChunk2(String.fromCharCode(this._previousChar) + chunk);\n\t\t} else {\n\t\t\tthis._acceptChunk2(chunk);\n\t\t}\n\t}\n\n\tprivate _acceptChunk2(chunk: string): void {\n\t\tconst lineStarts = createLineStarts(this._tmpLineStarts, chunk);\n\n\t\tthis.chunks.push(new StringBuffer(chunk, lineStarts.lineStarts));\n\t\tthis.cr += lineStarts.cr;\n\t\tthis.lf += lineStarts.lf;\n\t\tthis.crlf += lineStarts.crlf;\n\n\t\tif (this.isBasicASCII) {\n\t\t\tthis.isBasicASCII = lineStarts.isBasicASCII;\n\t\t}\n\t\tif (!this.isBasicASCII && !this.containsRTL) {\n\t\t\t// No need to check if it is basic ASCII\n\t\t\tthis.containsRTL = strings.containsRTL(chunk);\n\t\t}\n\t\tif (!this.isBasicASCII && !this.containsUnusualLineTerminators) {\n\t\t\t// No need to check if it is basic ASCII\n\t\t\tthis.containsUnusualLineTerminators = strings.containsUnusualLineTerminators(chunk);\n\t\t}\n\t}\n\n\tpublic finish(normalizeEOL: boolean = true): PieceTreeTextBufferFactory {\n\t\tthis._finish();\n\t\treturn new PieceTreeTextBufferFactory(\n\t\t\tthis.chunks,\n\t\t\tthis.BOM,\n\t\t\tthis.cr,\n\t\t\tthis.lf,\n\t\t\tthis.crlf,\n\t\t\tthis.containsRTL,\n\t\t\tthis.containsUnusualLineTerminators,\n\t\t\tthis.isBasicASCII,\n\t\t\tnormalizeEOL\n\t\t);\n\t}\n\n\tprivate _finish(): void {\n\t\tif (this.chunks.length === 0) {\n\t\t\tthis._acceptChunk1('', true);\n\t\t}\n\n\t\tif (this._hasPreviousChar) {\n\t\t\tthis._hasPreviousChar = false;\n\t\t\t// recreate last chunk\n\t\t\tconst lastChunk = this.chunks[this.chunks.length - 1];\n\t\t\tlastChunk.buffer += String.fromCharCode(this._previousChar);\n\t\t\tconst newLineStarts = createLineStartsFast(lastChunk.buffer);\n\t\t\tlastChunk.lineStarts = newLineStarts;\n\t\t\tif (this._previousChar === CharCode.CarriageReturn) {\n\t\t\t\tthis.cr++;\n\t\t\t}\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\n\n/**\n * Returns:\n * - -1 => the line consists of whitespace\n * - otherwise => the indent level is returned value\n */\nexport function computeIndentLevel(line: string, tabSize: number): number {\n\tlet indent = 0;\n\tlet i = 0;\n\tconst len = line.length;\n\n\twhile (i < len) {\n\t\tconst chCode = line.charCodeAt(i);\n\t\tif (chCode === CharCode.Space) {\n\t\t\tindent++;\n\t\t} else if (chCode === CharCode.Tab) {\n\t\t\tindent = indent - indent % tabSize + tabSize;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t\ti++;\n\t}\n\n\tif (i === len) {\n\t\treturn -1; // line only consists of whitespace\n\t}\n\n\treturn indent;\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 { assertNever } from 'vs/base/common/types';\nimport { WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { Position } from 'vs/editor/common/core/position';\nimport { InjectedTextCursorStops, InjectedTextOptions, PositionAffinity } from 'vs/editor/common/model';\nimport { LineInjectedText } from 'vs/editor/common/textModelEvents';\n\n/**\n * *input*:\n * ```\n * xxxxxxxxxxxxxxxxxxxxxxxxxxx\n * ```\n *\n * -> Applying injections `[i...i]`, *inputWithInjections*:\n * ```\n * xxxxxx[iiiiiiiiii]xxxxxxxxxxxxxxxxx[ii]xxxx\n * ```\n *\n * -> breaking at offsets `|` in `xxxxxx[iiiiiii|iii]xxxxxxxxxxx|xxxxxx[ii]xxxx|`:\n * ```\n * xxxxxx[iiiiiii\n * iii]xxxxxxxxxxx\n * xxxxxx[ii]xxxx\n * ```\n *\n * -> applying wrappedTextIndentLength, *output*:\n * ```\n * xxxxxx[iiiiiii\n * iii]xxxxxxxxxxx\n * xxxxxx[ii]xxxx\n * ```\n */\nexport class ModelLineProjectionData {\n\tconstructor(\n\t\tpublic injectionOffsets: number[] | null,\n\t\t/**\n\t\t * `injectionOptions.length` must equal `injectionOffsets.length`\n\t\t */\n\t\tpublic injectionOptions: InjectedTextOptions[] | null,\n\t\t/**\n\t\t * Refers to offsets after applying injections to the source.\n\t\t * The last break offset indicates the length of the source after applying injections.\n\t\t */\n\t\tpublic breakOffsets: number[],\n\t\t/**\n\t\t * Refers to offsets after applying injections\n\t\t */\n\t\tpublic breakOffsetsVisibleColumn: number[],\n\t\tpublic wrappedTextIndentLength: number\n\t) {\n\t}\n\n\tpublic getOutputLineCount(): number {\n\t\treturn this.breakOffsets.length;\n\t}\n\n\tpublic getMinOutputOffset(outputLineIndex: number): number {\n\t\tif (outputLineIndex > 0) {\n\t\t\treturn this.wrappedTextIndentLength;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic getLineLength(outputLineIndex: number): number {\n\t\t// These offsets refer to model text with injected text.\n\t\tconst startOffset = outputLineIndex > 0 ? this.breakOffsets[outputLineIndex - 1] : 0;\n\t\tconst endOffset = this.breakOffsets[outputLineIndex];\n\n\t\tlet lineLength = endOffset - startOffset;\n\t\tif (outputLineIndex > 0) {\n\t\t\tlineLength += this.wrappedTextIndentLength;\n\t\t}\n\t\treturn lineLength;\n\t}\n\n\tpublic getMaxOutputOffset(outputLineIndex: number): number {\n\t\treturn this.getLineLength(outputLineIndex);\n\t}\n\n\tpublic translateToInputOffset(outputLineIndex: number, outputOffset: number): number {\n\t\tif (outputLineIndex > 0) {\n\t\t\toutputOffset = Math.max(0, outputOffset - this.wrappedTextIndentLength);\n\t\t}\n\n\t\tconst offsetInInputWithInjection = outputLineIndex === 0 ? outputOffset : this.breakOffsets[outputLineIndex - 1] + outputOffset;\n\t\tlet offsetInInput = offsetInInputWithInjection;\n\n\t\tif (this.injectionOffsets !== null) {\n\t\t\tfor (let i = 0; i < this.injectionOffsets.length; i++) {\n\t\t\t\tif (offsetInInput > this.injectionOffsets[i]) {\n\t\t\t\t\tif (offsetInInput < this.injectionOffsets[i] + this.injectionOptions![i].content.length) {\n\t\t\t\t\t\t// `inputOffset` is within injected text\n\t\t\t\t\t\toffsetInInput = this.injectionOffsets[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\toffsetInInput -= this.injectionOptions![i].content.length;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn offsetInInput;\n\t}\n\n\tpublic translateToOutputPosition(inputOffset: number, affinity: PositionAffinity = PositionAffinity.None): OutputPosition {\n\t\tlet inputOffsetInInputWithInjection = inputOffset;\n\t\tif (this.injectionOffsets !== null) {\n\t\t\tfor (let i = 0; i < this.injectionOffsets.length; i++) {\n\t\t\t\tif (inputOffset < this.injectionOffsets[i]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (affinity !== PositionAffinity.Right && inputOffset === this.injectionOffsets[i]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tinputOffsetInInputWithInjection += this.injectionOptions![i].content.length;\n\t\t\t}\n\t\t}\n\n\t\treturn this.offsetInInputWithInjectionsToOutputPosition(inputOffsetInInputWithInjection, affinity);\n\t}\n\n\tprivate offsetInInputWithInjectionsToOutputPosition(offsetInInputWithInjections: number, affinity: PositionAffinity = PositionAffinity.None): OutputPosition {\n\t\tlet low = 0;\n\t\tlet high = this.breakOffsets.length - 1;\n\t\tlet mid = 0;\n\t\tlet midStart = 0;\n\n\t\twhile (low <= high) {\n\t\t\tmid = low + ((high - low) / 2) | 0;\n\n\t\t\tconst midStop = this.breakOffsets[mid];\n\t\t\tmidStart = mid > 0 ? this.breakOffsets[mid - 1] : 0;\n\n\t\t\tif (affinity === PositionAffinity.Left) {\n\t\t\t\tif (offsetInInputWithInjections <= midStart) {\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\t} else if (offsetInInputWithInjections > midStop) {\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (offsetInInputWithInjections < midStart) {\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\t} else if (offsetInInputWithInjections >= midStop) {\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet outputOffset = offsetInInputWithInjections - midStart;\n\t\tif (mid > 0) {\n\t\t\toutputOffset += this.wrappedTextIndentLength;\n\t\t}\n\n\t\treturn new OutputPosition(mid, outputOffset);\n\t}\n\n\tpublic normalizeOutputPosition(outputLineIndex: number, outputOffset: number, affinity: PositionAffinity): OutputPosition {\n\t\tif (this.injectionOffsets !== null) {\n\t\t\tconst offsetInInputWithInjections = this.outputPositionToOffsetInInputWithInjections(outputLineIndex, outputOffset);\n\t\t\tconst normalizedOffsetInUnwrappedLine = this.normalizeOffsetInInputWithInjectionsAroundInjections(offsetInInputWithInjections, affinity);\n\t\t\tif (normalizedOffsetInUnwrappedLine !== offsetInInputWithInjections) {\n\t\t\t\t// injected text caused a change\n\t\t\t\treturn this.offsetInInputWithInjectionsToOutputPosition(normalizedOffsetInUnwrappedLine, affinity);\n\t\t\t}\n\t\t}\n\n\t\tif (affinity === PositionAffinity.Left) {\n\t\t\tif (outputLineIndex > 0 && outputOffset === this.getMinOutputOffset(outputLineIndex)) {\n\t\t\t\treturn new OutputPosition(outputLineIndex - 1, this.getMaxOutputOffset(outputLineIndex - 1));\n\t\t\t}\n\t\t}\n\t\telse if (affinity === PositionAffinity.Right) {\n\t\t\tconst maxOutputLineIndex = this.getOutputLineCount() - 1;\n\t\t\tif (outputLineIndex < maxOutputLineIndex && outputOffset === this.getMaxOutputOffset(outputLineIndex)) {\n\t\t\t\treturn new OutputPosition(outputLineIndex + 1, this.getMinOutputOffset(outputLineIndex + 1));\n\t\t\t}\n\t\t}\n\n\t\treturn new OutputPosition(outputLineIndex, outputOffset);\n\t}\n\n\tprivate outputPositionToOffsetInInputWithInjections(outputLineIndex: number, outputOffset: number): number {\n\t\tif (outputLineIndex > 0) {\n\t\t\toutputOffset = Math.max(0, outputOffset - this.wrappedTextIndentLength);\n\t\t}\n\t\tconst result = (outputLineIndex > 0 ? this.breakOffsets[outputLineIndex - 1] : 0) + outputOffset;\n\t\treturn result;\n\t}\n\n\tprivate normalizeOffsetInInputWithInjectionsAroundInjections(offsetInInputWithInjections: number, affinity: PositionAffinity): number {\n\t\tconst injectedText = this.getInjectedTextAtOffset(offsetInInputWithInjections);\n\t\tif (!injectedText) {\n\t\t\treturn offsetInInputWithInjections;\n\t\t}\n\n\t\tif (affinity === PositionAffinity.None) {\n\t\t\tif (offsetInInputWithInjections === injectedText.offsetInInputWithInjections + injectedText.length\n\t\t\t\t&& hasRightCursorStop(this.injectionOptions![injectedText.injectedTextIndex].cursorStops)) {\n\t\t\t\treturn injectedText.offsetInInputWithInjections + injectedText.length;\n\t\t\t} else {\n\t\t\t\tlet result = injectedText.offsetInInputWithInjections;\n\t\t\t\tif (hasLeftCursorStop(this.injectionOptions![injectedText.injectedTextIndex].cursorStops)) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tlet index = injectedText.injectedTextIndex - 1;\n\t\t\t\twhile (index >= 0 && this.injectionOffsets![index] === this.injectionOffsets![injectedText.injectedTextIndex]) {\n\t\t\t\t\tif (hasRightCursorStop(this.injectionOptions![index].cursorStops)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tresult -= this.injectionOptions![index].content.length;\n\t\t\t\t\tif (hasLeftCursorStop(this.injectionOptions![index].cursorStops)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else if (affinity === PositionAffinity.Right) {\n\t\t\tlet result = injectedText.offsetInInputWithInjections + injectedText.length;\n\t\t\tlet index = injectedText.injectedTextIndex;\n\t\t\t// traverse all injected text that touch each other\n\t\t\twhile (index + 1 < this.injectionOffsets!.length && this.injectionOffsets![index + 1] === this.injectionOffsets![index]) {\n\t\t\t\tresult += this.injectionOptions![index + 1].content.length;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if (affinity === PositionAffinity.Left) {\n\t\t\t// affinity is left\n\t\t\tlet result = injectedText.offsetInInputWithInjections;\n\t\t\tlet index = injectedText.injectedTextIndex;\n\t\t\t// traverse all injected text that touch each other\n\t\t\twhile (index - 1 >= 0 && this.injectionOffsets![index - 1] === this.injectionOffsets![index]) {\n\t\t\t\tresult -= this.injectionOptions![index - 1].content.length;\n\t\t\t\tindex--;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tassertNever(affinity);\n\t}\n\n\tpublic getInjectedText(outputLineIndex: number, outputOffset: number): InjectedText | null {\n\t\tconst offset = this.outputPositionToOffsetInInputWithInjections(outputLineIndex, outputOffset);\n\t\tconst injectedText = this.getInjectedTextAtOffset(offset);\n\t\tif (!injectedText) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\toptions: this.injectionOptions![injectedText.injectedTextIndex]\n\t\t};\n\t}\n\n\tprivate getInjectedTextAtOffset(offsetInInputWithInjections: number): { injectedTextIndex: number; offsetInInputWithInjections: number; length: number } | undefined {\n\t\tconst injectionOffsets = this.injectionOffsets;\n\t\tconst injectionOptions = this.injectionOptions;\n\n\t\tif (injectionOffsets !== null) {\n\t\t\tlet totalInjectedTextLengthBefore = 0;\n\t\t\tfor (let i = 0; i < injectionOffsets.length; i++) {\n\t\t\t\tconst length = injectionOptions![i].content.length;\n\t\t\t\tconst injectedTextStartOffsetInInputWithInjections = injectionOffsets[i] + totalInjectedTextLengthBefore;\n\t\t\t\tconst injectedTextEndOffsetInInputWithInjections = injectionOffsets[i] + totalInjectedTextLengthBefore + length;\n\n\t\t\t\tif (injectedTextStartOffsetInInputWithInjections > offsetInInputWithInjections) {\n\t\t\t\t\t// Injected text starts later.\n\t\t\t\t\tbreak; // All later injected texts have an even larger offset.\n\t\t\t\t}\n\n\t\t\t\tif (offsetInInputWithInjections <= injectedTextEndOffsetInInputWithInjections) {\n\t\t\t\t\t// Injected text ends after or with the given position (but also starts with or before it).\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinjectedTextIndex: i,\n\t\t\t\t\t\toffsetInInputWithInjections: injectedTextStartOffsetInInputWithInjections,\n\t\t\t\t\t\tlength\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\ttotalInjectedTextLengthBefore += length;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nfunction hasRightCursorStop(cursorStop: InjectedTextCursorStops | null | undefined): boolean {\n\tif (cursorStop === null || cursorStop === undefined) { return true; }\n\treturn cursorStop === InjectedTextCursorStops.Right || cursorStop === InjectedTextCursorStops.Both;\n}\nfunction hasLeftCursorStop(cursorStop: InjectedTextCursorStops | null | undefined): boolean {\n\tif (cursorStop === null || cursorStop === undefined) { return true; }\n\treturn cursorStop === InjectedTextCursorStops.Left || cursorStop === InjectedTextCursorStops.Both;\n}\n\nexport class InjectedText {\n\tconstructor(public readonly options: InjectedTextOptions) { }\n}\n\nexport class OutputPosition {\n\toutputLineIndex: number;\n\toutputOffset: number;\n\n\tconstructor(outputLineIndex: number, outputOffset: number) {\n\t\tthis.outputLineIndex = outputLineIndex;\n\t\tthis.outputOffset = outputOffset;\n\t}\n\n\ttoString(): string {\n\t\treturn `${this.outputLineIndex}:${this.outputOffset}`;\n\t}\n\n\ttoPosition(baseLineNumber: number): Position {\n\t\treturn new Position(baseLineNumber + this.outputLineIndex, this.outputOffset + 1);\n\t}\n}\n\nexport interface ILineBreaksComputerFactory {\n\tcreateLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer;\n}\n\nexport interface ILineBreaksComputer {\n\t/**\n\t * Pass in `previousLineBreakData` if the only difference is in breaking columns!!!\n\t */\n\taddRequest(lineText: string, injectedText: LineInjectedText[] | null, previousLineBreakData: ModelLineProjectionData | null): void;\n\tfinalize(): (ModelLineProjectionData | null)[];\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 { ParsedPattern, parse } from 'vs/base/common/glob';\nimport { Mimes } from 'vs/base/common/mime';\nimport { Schemas } from 'vs/base/common/network';\nimport { basename, posix } from 'vs/base/common/path';\nimport { DataUri } from 'vs/base/common/resources';\nimport { startsWithUTF8BOM } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\n\nexport interface ILanguageAssociation {\n\treadonly id: string;\n\treadonly mime: string;\n\treadonly filename?: string;\n\treadonly extension?: string;\n\treadonly filepattern?: string;\n\treadonly firstline?: RegExp;\n}\n\ninterface ILanguageAssociationItem extends ILanguageAssociation {\n\treadonly userConfigured: boolean;\n\treadonly filenameLowercase?: string;\n\treadonly extensionLowercase?: string;\n\treadonly filepatternLowercase?: ParsedPattern;\n\treadonly filepatternOnPath?: boolean;\n}\n\nlet registeredAssociations: ILanguageAssociationItem[] = [];\nlet nonUserRegisteredAssociations: ILanguageAssociationItem[] = [];\nlet userRegisteredAssociations: ILanguageAssociationItem[] = [];\n\n/**\n * Associate a language to the registry (platform).\n * * **NOTE**: This association will lose over associations registered using `registerConfiguredLanguageAssociation`.\n * * **NOTE**: Use `clearPlatformLanguageAssociations` to remove all associations registered using this function.\n */\nexport function registerPlatformLanguageAssociation(association: ILanguageAssociation, warnOnOverwrite = false): void {\n\t_registerLanguageAssociation(association, false, warnOnOverwrite);\n}\n\nfunction _registerLanguageAssociation(association: ILanguageAssociation, userConfigured: boolean, warnOnOverwrite: boolean): void {\n\n\t// Register\n\tconst associationItem = toLanguageAssociationItem(association, userConfigured);\n\tregisteredAssociations.push(associationItem);\n\tif (!associationItem.userConfigured) {\n\t\tnonUserRegisteredAssociations.push(associationItem);\n\t} else {\n\t\tuserRegisteredAssociations.push(associationItem);\n\t}\n\n\t// Check for conflicts unless this is a user configured association\n\tif (warnOnOverwrite && !associationItem.userConfigured) {\n\t\tregisteredAssociations.forEach(a => {\n\t\t\tif (a.mime === associationItem.mime || a.userConfigured) {\n\t\t\t\treturn; // same mime or userConfigured is ok\n\t\t\t}\n\n\t\t\tif (associationItem.extension && a.extension === associationItem.extension) {\n\t\t\t\tconsole.warn(`Overwriting extension <<${associationItem.extension}>> to now point to mime <<${associationItem.mime}>>`);\n\t\t\t}\n\n\t\t\tif (associationItem.filename && a.filename === associationItem.filename) {\n\t\t\t\tconsole.warn(`Overwriting filename <<${associationItem.filename}>> to now point to mime <<${associationItem.mime}>>`);\n\t\t\t}\n\n\t\t\tif (associationItem.filepattern && a.filepattern === associationItem.filepattern) {\n\t\t\t\tconsole.warn(`Overwriting filepattern <<${associationItem.filepattern}>> to now point to mime <<${associationItem.mime}>>`);\n\t\t\t}\n\n\t\t\tif (associationItem.firstline && a.firstline === associationItem.firstline) {\n\t\t\t\tconsole.warn(`Overwriting firstline <<${associationItem.firstline}>> to now point to mime <<${associationItem.mime}>>`);\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction toLanguageAssociationItem(association: ILanguageAssociation, userConfigured: boolean): ILanguageAssociationItem {\n\treturn {\n\t\tid: association.id,\n\t\tmime: association.mime,\n\t\tfilename: association.filename,\n\t\textension: association.extension,\n\t\tfilepattern: association.filepattern,\n\t\tfirstline: association.firstline,\n\t\tuserConfigured: userConfigured,\n\t\tfilenameLowercase: association.filename ? association.filename.toLowerCase() : undefined,\n\t\textensionLowercase: association.extension ? association.extension.toLowerCase() : undefined,\n\t\tfilepatternLowercase: association.filepattern ? parse(association.filepattern.toLowerCase()) : undefined,\n\t\tfilepatternOnPath: association.filepattern ? association.filepattern.indexOf(posix.sep) >= 0 : false\n\t};\n}\n\n/**\n * Clear language associations from the registry (platform).\n */\nexport function clearPlatformLanguageAssociations(): void {\n\tregisteredAssociations = registeredAssociations.filter(a => a.userConfigured);\n\tnonUserRegisteredAssociations = [];\n}\n\n/**\n * Given a file, return the best matching mime types for it\n * based on the registered language associations.\n */\nexport function getMimeTypes(resource: URI | null, firstLine?: string): string[] {\n\tlet path: string | undefined;\n\tif (resource) {\n\t\tswitch (resource.scheme) {\n\t\t\tcase Schemas.file:\n\t\t\t\tpath = resource.fsPath;\n\t\t\t\tbreak;\n\t\t\tcase Schemas.data: {\n\t\t\t\tconst metadata = DataUri.parseMetaData(resource);\n\t\t\t\tpath = metadata.get(DataUri.META_DATA_LABEL);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpath = resource.path;\n\t\t}\n\t}\n\n\tif (!path) {\n\t\treturn [Mimes.unknown];\n\t}\n\n\tpath = path.toLowerCase();\n\n\tconst filename = basename(path);\n\n\t// 1.) User configured mappings have highest priority\n\tconst configuredLanguage = getMimeByPath(path, filename, userRegisteredAssociations);\n\tif (configuredLanguage) {\n\t\treturn [configuredLanguage, Mimes.text];\n\t}\n\n\t// 2.) Registered mappings have middle priority\n\tconst registeredLanguage = getMimeByPath(path, filename, nonUserRegisteredAssociations);\n\tif (registeredLanguage) {\n\t\treturn [registeredLanguage, Mimes.text];\n\t}\n\n\t// 3.) Firstline has lowest priority\n\tif (firstLine) {\n\t\tconst firstlineLanguage = getMimeByFirstline(firstLine);\n\t\tif (firstlineLanguage) {\n\t\t\treturn [firstlineLanguage, Mimes.text];\n\t\t}\n\t}\n\n\treturn [Mimes.unknown];\n}\n\nfunction getMimeByPath(path: string, filename: string, associations: ILanguageAssociationItem[]): string | undefined {\n\tlet filenameMatch: ILanguageAssociationItem | undefined = undefined;\n\tlet patternMatch: ILanguageAssociationItem | undefined = undefined;\n\tlet extensionMatch: ILanguageAssociationItem | undefined = undefined;\n\n\t// We want to prioritize associations based on the order they are registered so that the last registered\n\t// association wins over all other. This is for https://github.com/microsoft/vscode/issues/20074\n\tfor (let i = associations.length - 1; i >= 0; i--) {\n\t\tconst association = associations[i];\n\n\t\t// First exact name match\n\t\tif (filename === association.filenameLowercase) {\n\t\t\tfilenameMatch = association;\n\t\t\tbreak; // take it!\n\t\t}\n\n\t\t// Longest pattern match\n\t\tif (association.filepattern) {\n\t\t\tif (!patternMatch || association.filepattern.length > patternMatch.filepattern!.length) {\n\t\t\t\tconst target = association.filepatternOnPath ? path : filename; // match on full path if pattern contains path separator\n\t\t\t\tif (association.filepatternLowercase?.(target)) {\n\t\t\t\t\tpatternMatch = association;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Longest extension match\n\t\tif (association.extension) {\n\t\t\tif (!extensionMatch || association.extension.length > extensionMatch.extension!.length) {\n\t\t\t\tif (filename.endsWith(association.extensionLowercase!)) {\n\t\t\t\t\textensionMatch = association;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 1.) Exact name match has second highest priority\n\tif (filenameMatch) {\n\t\treturn filenameMatch.mime;\n\t}\n\n\t// 2.) Match on pattern\n\tif (patternMatch) {\n\t\treturn patternMatch.mime;\n\t}\n\n\t// 3.) Match on extension comes next\n\tif (extensionMatch) {\n\t\treturn extensionMatch.mime;\n\t}\n\n\treturn undefined;\n}\n\nfunction getMimeByFirstline(firstLine: string): string | undefined {\n\tif (startsWithUTF8BOM(firstLine)) {\n\t\tfirstLine = firstLine.substr(1);\n\t}\n\n\tif (firstLine.length > 0) {\n\n\t\t// We want to prioritize associations based on the order they are registered so that the last registered\n\t\t// association wins over all other. This is for https://github.com/microsoft/vscode/issues/20074\n\t\tfor (let i = registeredAssociations.length - 1; i >= 0; i--) {\n\t\t\tconst association = registeredAssociations[i];\n\t\t\tif (!association.firstline) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst matches = firstLine.match(association.firstline);\n\t\t\tif (matches && matches.length > 0) {\n\t\t\t\treturn association.mime;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\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 { VSBuffer } from 'vs/base/common/buffer';\nimport * as platform from 'vs/base/common/platform';\n\nexport interface IFullSemanticTokensDto {\n\tid: number;\n\ttype: 'full';\n\tdata: Uint32Array;\n}\n\nexport interface IDeltaSemanticTokensDto {\n\tid: number;\n\ttype: 'delta';\n\tdeltas: { start: number; deleteCount: number; data?: Uint32Array }[];\n}\n\nexport type ISemanticTokensDto = IFullSemanticTokensDto | IDeltaSemanticTokensDto;\n\nconst enum EncodedSemanticTokensType {\n\tFull = 1,\n\tDelta = 2\n}\n\nfunction reverseEndianness(arr: Uint8Array): void {\n\tfor (let i = 0, len = arr.length; i < len; i += 4) {\n\t\t// flip bytes 0<->3 and 1<->2\n\t\tconst b0 = arr[i + 0];\n\t\tconst b1 = arr[i + 1];\n\t\tconst b2 = arr[i + 2];\n\t\tconst b3 = arr[i + 3];\n\t\tarr[i + 0] = b3;\n\t\tarr[i + 1] = b2;\n\t\tarr[i + 2] = b1;\n\t\tarr[i + 3] = b0;\n\t}\n}\n\nfunction toLittleEndianBuffer(arr: Uint32Array): VSBuffer {\n\tconst uint8Arr = new Uint8Array(arr.buffer, arr.byteOffset, arr.length * 4);\n\tif (!platform.isLittleEndian()) {\n\t\t// the byte order must be changed\n\t\treverseEndianness(uint8Arr);\n\t}\n\treturn VSBuffer.wrap(uint8Arr);\n}\n\nexport function encodeSemanticTokensDto(semanticTokens: ISemanticTokensDto): VSBuffer {\n\tconst dest = new Uint32Array(encodeSemanticTokensDtoSize(semanticTokens));\n\tlet offset = 0;\n\tdest[offset++] = semanticTokens.id;\n\tif (semanticTokens.type === 'full') {\n\t\tdest[offset++] = EncodedSemanticTokensType.Full;\n\t\tdest[offset++] = semanticTokens.data.length;\n\t\tdest.set(semanticTokens.data, offset); offset += semanticTokens.data.length;\n\t} else {\n\t\tdest[offset++] = EncodedSemanticTokensType.Delta;\n\t\tdest[offset++] = semanticTokens.deltas.length;\n\t\tfor (const delta of semanticTokens.deltas) {\n\t\t\tdest[offset++] = delta.start;\n\t\t\tdest[offset++] = delta.deleteCount;\n\t\t\tif (delta.data) {\n\t\t\t\tdest[offset++] = delta.data.length;\n\t\t\t\tdest.set(delta.data, offset); offset += delta.data.length;\n\t\t\t} else {\n\t\t\t\tdest[offset++] = 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn toLittleEndianBuffer(dest);\n}\n\nfunction encodeSemanticTokensDtoSize(semanticTokens: ISemanticTokensDto): number {\n\tlet result = 0;\n\tresult += (\n\t\t+ 1 // id\n\t\t+ 1 // type\n\t);\n\tif (semanticTokens.type === 'full') {\n\t\tresult += (\n\t\t\t+ 1 // data length\n\t\t\t+ semanticTokens.data.length\n\t\t);\n\t} else {\n\t\tresult += (\n\t\t\t+ 1 // delta count\n\t\t);\n\t\tresult += (\n\t\t\t+ 1 // start\n\t\t\t+ 1 // deleteCount\n\t\t\t+ 1 // data length\n\t\t) * semanticTokens.deltas.length;\n\t\tfor (const delta of semanticTokens.deltas) {\n\t\t\tif (delta.data) {\n\t\t\t\tresult += delta.data.length;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\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 { IRange, Range } from 'vs/editor/common/core/range';\nimport { Searcher } from 'vs/editor/common/model/textModelSearch';\nimport * as strings from 'vs/base/common/strings';\nimport { IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker';\nimport { assertNever } from 'vs/base/common/types';\nimport { DEFAULT_WORD_REGEXP, getWordAtText } from 'vs/editor/common/core/wordHelper';\n\nexport class UnicodeTextModelHighlighter {\n\tpublic static computeUnicodeHighlights(model: IUnicodeCharacterSearcherTarget, options: UnicodeHighlighterOptions, range?: IRange): IUnicodeHighlightsResult {\n\t\tconst startLine = range ? range.startLineNumber : 1;\n\t\tconst endLine = range ? range.endLineNumber : model.getLineCount();\n\n\t\tconst codePointHighlighter = new CodePointHighlighter(options);\n\n\t\tconst candidates = codePointHighlighter.getCandidateCodePoints();\n\t\tlet regex: RegExp;\n\t\tif (candidates === 'allNonBasicAscii') {\n\t\t\tregex = new RegExp('[^\\\\t\\\\n\\\\r\\\\x20-\\\\x7E]', 'g');\n\t\t} else {\n\t\t\tregex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, 'g');\n\t\t}\n\n\t\tconst searcher = new Searcher(null, regex);\n\t\tconst ranges: Range[] = [];\n\t\tlet hasMore = false;\n\t\tlet m: RegExpExecArray | null;\n\n\t\tlet ambiguousCharacterCount = 0;\n\t\tlet invisibleCharacterCount = 0;\n\t\tlet nonBasicAsciiCharacterCount = 0;\n\n\t\tforLoop:\n\t\tfor (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\t\tconst lineLength = lineContent.length;\n\n\t\t\t// Reset regex to search from the beginning\n\t\t\tsearcher.reset(0);\n\t\t\tdo {\n\t\t\t\tm = searcher.next(lineContent);\n\t\t\t\tif (m) {\n\t\t\t\t\tlet startIndex = m.index;\n\t\t\t\t\tlet endIndex = m.index + m[0].length;\n\n\t\t\t\t\t// Extend range to entire code point\n\t\t\t\t\tif (startIndex > 0) {\n\t\t\t\t\t\tconst charCodeBefore = lineContent.charCodeAt(startIndex - 1);\n\t\t\t\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\t\t\t\tstartIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (endIndex + 1 < lineLength) {\n\t\t\t\t\t\tconst charCodeBefore = lineContent.charCodeAt(endIndex - 1);\n\t\t\t\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\t\t\t\tendIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst str = lineContent.substring(startIndex, endIndex);\n\t\t\t\t\tconst word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);\n\t\t\t\t\tconst highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);\n\n\t\t\t\t\tif (highlightReason !== SimpleHighlightReason.None) {\n\t\t\t\t\t\tif (highlightReason === SimpleHighlightReason.Ambiguous) {\n\t\t\t\t\t\t\tambiguousCharacterCount++;\n\t\t\t\t\t\t} else if (highlightReason === SimpleHighlightReason.Invisible) {\n\t\t\t\t\t\t\tinvisibleCharacterCount++;\n\t\t\t\t\t\t} else if (highlightReason === SimpleHighlightReason.NonBasicASCII) {\n\t\t\t\t\t\t\tnonBasicAsciiCharacterCount++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassertNever(highlightReason);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst MAX_RESULT_LENGTH = 1000;\n\t\t\t\t\t\tif (ranges.length >= MAX_RESULT_LENGTH) {\n\t\t\t\t\t\t\thasMore = true;\n\t\t\t\t\t\t\tbreak forLoop;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (m);\n\t\t}\n\t\treturn {\n\t\t\tranges,\n\t\t\thasMore,\n\t\t\tambiguousCharacterCount,\n\t\t\tinvisibleCharacterCount,\n\t\t\tnonBasicAsciiCharacterCount\n\t\t};\n\t}\n\n\tpublic static computeUnicodeHighlightReason(char: string, options: UnicodeHighlighterOptions): UnicodeHighlighterReason | null {\n\t\tconst codePointHighlighter = new CodePointHighlighter(options);\n\n\t\tconst reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);\n\t\tswitch (reason) {\n\t\t\tcase SimpleHighlightReason.None:\n\t\t\t\treturn null;\n\t\t\tcase SimpleHighlightReason.Invisible:\n\t\t\t\treturn { kind: UnicodeHighlighterReasonKind.Invisible };\n\n\t\t\tcase SimpleHighlightReason.Ambiguous: {\n\t\t\t\tconst codePoint = char.codePointAt(0)!;\n\t\t\t\tconst primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint)!;\n\t\t\t\tconst notAmbiguousInLocales =\n\t\t\t\t\tstrings.AmbiguousCharacters.getLocales().filter(\n\t\t\t\t\t\t(l) =>\n\t\t\t\t\t\t\t!strings.AmbiguousCharacters.getInstance(\n\t\t\t\t\t\t\t\tnew Set([...options.allowedLocales, l])\n\t\t\t\t\t\t\t).isAmbiguous(codePoint)\n\t\t\t\t\t);\n\t\t\t\treturn { kind: UnicodeHighlighterReasonKind.Ambiguous, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales };\n\t\t\t}\n\t\t\tcase SimpleHighlightReason.NonBasicASCII:\n\t\t\t\treturn { kind: UnicodeHighlighterReasonKind.NonBasicAscii };\n\t\t}\n\t}\n}\n\nfunction buildRegExpCharClassExpr(codePoints: number[], flags?: string): string {\n\tconst src = `[${strings.escapeRegExpCharacters(\n\t\tcodePoints.map((i) => String.fromCodePoint(i)).join('')\n\t)}]`;\n\treturn src;\n}\n\nexport const enum UnicodeHighlighterReasonKind {\n\tAmbiguous, Invisible, NonBasicAscii\n}\n\nexport type UnicodeHighlighterReason = {\n\tkind: UnicodeHighlighterReasonKind.Ambiguous;\n\tconfusableWith: string;\n\tnotAmbiguousInLocales: string[];\n} | {\n\tkind: UnicodeHighlighterReasonKind.Invisible;\n} | {\n\tkind: UnicodeHighlighterReasonKind.NonBasicAscii;\n};\n\nclass CodePointHighlighter {\n\tprivate readonly allowedCodePoints: Set<number>;\n\tpublic readonly ambiguousCharacters: strings.AmbiguousCharacters;\n\tconstructor(private readonly options: UnicodeHighlighterOptions) {\n\t\tthis.allowedCodePoints = new Set(options.allowedCodePoints);\n\t\tthis.ambiguousCharacters = strings.AmbiguousCharacters.getInstance(new Set(options.allowedLocales));\n\t}\n\n\tpublic getCandidateCodePoints(): Set<number> | 'allNonBasicAscii' {\n\t\tif (this.options.nonBasicASCII) {\n\t\t\treturn 'allNonBasicAscii';\n\t\t}\n\n\t\tconst set = new Set<number>();\n\n\t\tif (this.options.invisibleCharacters) {\n\t\t\tfor (const cp of strings.InvisibleCharacters.codePoints) {\n\t\t\t\tif (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {\n\t\t\t\t\tset.add(cp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.ambiguousCharacters) {\n\t\t\tfor (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {\n\t\t\t\tset.add(cp);\n\t\t\t}\n\t\t}\n\n\t\tfor (const cp of this.allowedCodePoints) {\n\t\t\tset.delete(cp);\n\t\t}\n\n\t\treturn set;\n\t}\n\n\tpublic shouldHighlightNonBasicASCII(character: string, wordContext: string | null): SimpleHighlightReason {\n\t\tconst codePoint = character.codePointAt(0)!;\n\n\t\tif (this.allowedCodePoints.has(codePoint)) {\n\t\t\treturn SimpleHighlightReason.None;\n\t\t}\n\n\t\tif (this.options.nonBasicASCII) {\n\t\t\treturn SimpleHighlightReason.NonBasicASCII;\n\t\t}\n\n\t\tlet hasBasicASCIICharacters = false;\n\t\tlet hasNonConfusableNonBasicAsciiCharacter = false;\n\t\tif (wordContext) {\n\t\t\tfor (let char of wordContext) {\n\t\t\t\tconst codePoint = char.codePointAt(0)!;\n\t\t\t\tconst isBasicASCII = strings.isBasicASCII(char);\n\t\t\t\thasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII;\n\n\t\t\t\tif (\n\t\t\t\t\t!isBasicASCII &&\n\t\t\t\t\t!this.ambiguousCharacters.isAmbiguous(codePoint) &&\n\t\t\t\t\t!strings.InvisibleCharacters.isInvisibleCharacter(codePoint)\n\t\t\t\t) {\n\t\t\t\t\thasNonConfusableNonBasicAsciiCharacter = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t/* Don't allow mixing weird looking characters with ASCII */ !hasBasicASCIICharacters &&\n\t\t\t/* Is there an obviously weird looking character? */ hasNonConfusableNonBasicAsciiCharacter\n\t\t) {\n\t\t\treturn SimpleHighlightReason.None;\n\t\t}\n\n\t\tif (this.options.invisibleCharacters) {\n\t\t\t// TODO check for emojis\n\t\t\tif (!isAllowedInvisibleCharacter(character) && strings.InvisibleCharacters.isInvisibleCharacter(codePoint)) {\n\t\t\t\treturn SimpleHighlightReason.Invisible;\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.ambiguousCharacters) {\n\t\t\tif (this.ambiguousCharacters.isAmbiguous(codePoint)) {\n\t\t\t\treturn SimpleHighlightReason.Ambiguous;\n\t\t\t}\n\t\t}\n\n\t\treturn SimpleHighlightReason.None;\n\t}\n}\n\nfunction isAllowedInvisibleCharacter(character: string): boolean {\n\treturn character === ' ' || character === '\\n' || character === '\\t';\n}\n\nconst enum SimpleHighlightReason {\n\tNone,\n\tNonBasicASCII,\n\tInvisible,\n\tAmbiguous\n}\n\nexport interface IUnicodeCharacterSearcherTarget {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n}\n\nexport interface UnicodeHighlighterOptions {\n\tnonBasicASCII: boolean;\n\tambiguousCharacters: boolean;\n\tinvisibleCharacters: boolean;\n\tincludeComments: boolean;\n\tincludeStrings: boolean;\n\tallowedCodePoints: number[];\n\tallowedLocales: string[];\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\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\n\n\nexport enum AccessibilitySupport {\n\t/**\n\t * This should be the browser case where it is not known if a screen reader is attached or no.\n\t */\n\tUnknown = 0,\n\tDisabled = 1,\n\tEnabled = 2\n}\n\nexport enum CompletionItemInsertTextRule {\n\t/**\n\t * Adjust whitespace/indentation of multiline insert texts to\n\t * match the current line indentation.\n\t */\n\tKeepWhitespace = 1,\n\t/**\n\t * `insertText` is a snippet.\n\t */\n\tInsertAsSnippet = 4\n}\n\nexport enum CompletionItemKind {\n\tMethod = 0,\n\tFunction = 1,\n\tConstructor = 2,\n\tField = 3,\n\tVariable = 4,\n\tClass = 5,\n\tStruct = 6,\n\tInterface = 7,\n\tModule = 8,\n\tProperty = 9,\n\tEvent = 10,\n\tOperator = 11,\n\tUnit = 12,\n\tValue = 13,\n\tConstant = 14,\n\tEnum = 15,\n\tEnumMember = 16,\n\tKeyword = 17,\n\tText = 18,\n\tColor = 19,\n\tFile = 20,\n\tReference = 21,\n\tCustomcolor = 22,\n\tFolder = 23,\n\tTypeParameter = 24,\n\tUser = 25,\n\tIssue = 26,\n\tSnippet = 27\n}\n\nexport enum CompletionItemTag {\n\tDeprecated = 1\n}\n\n/**\n * How a suggest provider was triggered.\n */\nexport enum CompletionTriggerKind {\n\tInvoke = 0,\n\tTriggerCharacter = 1,\n\tTriggerForIncompleteCompletions = 2\n}\n\n/**\n * A positioning preference for rendering content widgets.\n */\nexport enum ContentWidgetPositionPreference {\n\t/**\n\t * Place the content widget exactly at a position\n\t */\n\tEXACT = 0,\n\t/**\n\t * Place the content widget above a position\n\t */\n\tABOVE = 1,\n\t/**\n\t * Place the content widget below a position\n\t */\n\tBELOW = 2\n}\n\n/**\n * Describes the reason the cursor has changed its position.\n */\nexport enum CursorChangeReason {\n\t/**\n\t * Unknown or not set.\n\t */\n\tNotSet = 0,\n\t/**\n\t * A `model.setValue()` was called.\n\t */\n\tContentFlush = 1,\n\t/**\n\t * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.\n\t */\n\tRecoverFromMarkers = 2,\n\t/**\n\t * There was an explicit user gesture.\n\t */\n\tExplicit = 3,\n\t/**\n\t * There was a Paste.\n\t */\n\tPaste = 4,\n\t/**\n\t * There was an Undo.\n\t */\n\tUndo = 5,\n\t/**\n\t * There was a Redo.\n\t */\n\tRedo = 6\n}\n\n/**\n * The default end of line to use when instantiating models.\n */\nexport enum DefaultEndOfLine {\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 1,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 2\n}\n\n/**\n * A document highlight kind.\n */\nexport enum DocumentHighlightKind {\n\t/**\n\t * A textual occurrence.\n\t */\n\tText = 0,\n\t/**\n\t * Read-access of a symbol, like reading a variable.\n\t */\n\tRead = 1,\n\t/**\n\t * Write-access of a symbol, like writing to a variable.\n\t */\n\tWrite = 2\n}\n\n/**\n * Configuration options for auto indentation in the editor\n */\nexport enum EditorAutoIndentStrategy {\n\tNone = 0,\n\tKeep = 1,\n\tBrackets = 2,\n\tAdvanced = 3,\n\tFull = 4\n}\n\nexport enum EditorOption {\n\tacceptSuggestionOnCommitCharacter = 0,\n\tacceptSuggestionOnEnter = 1,\n\taccessibilitySupport = 2,\n\taccessibilityPageSize = 3,\n\tariaLabel = 4,\n\tautoClosingBrackets = 5,\n\tautoClosingDelete = 6,\n\tautoClosingOvertype = 7,\n\tautoClosingQuotes = 8,\n\tautoIndent = 9,\n\tautomaticLayout = 10,\n\tautoSurround = 11,\n\tbracketPairColorization = 12,\n\tguides = 13,\n\tcodeLens = 14,\n\tcodeLensFontFamily = 15,\n\tcodeLensFontSize = 16,\n\tcolorDecorators = 17,\n\tcolumnSelection = 18,\n\tcomments = 19,\n\tcontextmenu = 20,\n\tcopyWithSyntaxHighlighting = 21,\n\tcursorBlinking = 22,\n\tcursorSmoothCaretAnimation = 23,\n\tcursorStyle = 24,\n\tcursorSurroundingLines = 25,\n\tcursorSurroundingLinesStyle = 26,\n\tcursorWidth = 27,\n\tdisableLayerHinting = 28,\n\tdisableMonospaceOptimizations = 29,\n\tdomReadOnly = 30,\n\tdragAndDrop = 31,\n\temptySelectionClipboard = 32,\n\textraEditorClassName = 33,\n\tfastScrollSensitivity = 34,\n\tfind = 35,\n\tfixedOverflowWidgets = 36,\n\tfolding = 37,\n\tfoldingStrategy = 38,\n\tfoldingHighlight = 39,\n\tfoldingImportsByDefault = 40,\n\tfoldingMaximumRegions = 41,\n\tunfoldOnClickAfterEndOfLine = 42,\n\tfontFamily = 43,\n\tfontInfo = 44,\n\tfontLigatures = 45,\n\tfontSize = 46,\n\tfontWeight = 47,\n\tformatOnPaste = 48,\n\tformatOnType = 49,\n\tglyphMargin = 50,\n\tgotoLocation = 51,\n\thideCursorInOverviewRuler = 52,\n\thover = 53,\n\tinDiffEditor = 54,\n\tinlineSuggest = 55,\n\tletterSpacing = 56,\n\tlightbulb = 57,\n\tlineDecorationsWidth = 58,\n\tlineHeight = 59,\n\tlineNumbers = 60,\n\tlineNumbersMinChars = 61,\n\tlinkedEditing = 62,\n\tlinks = 63,\n\tmatchBrackets = 64,\n\tminimap = 65,\n\tmouseStyle = 66,\n\tmouseWheelScrollSensitivity = 67,\n\tmouseWheelZoom = 68,\n\tmultiCursorMergeOverlapping = 69,\n\tmultiCursorModifier = 70,\n\tmultiCursorPaste = 71,\n\toccurrencesHighlight = 72,\n\toverviewRulerBorder = 73,\n\toverviewRulerLanes = 74,\n\tpadding = 75,\n\tparameterHints = 76,\n\tpeekWidgetDefaultFocus = 77,\n\tdefinitionLinkOpensInPeek = 78,\n\tquickSuggestions = 79,\n\tquickSuggestionsDelay = 80,\n\treadOnly = 81,\n\trenameOnType = 82,\n\trenderControlCharacters = 83,\n\trenderFinalNewline = 84,\n\trenderLineHighlight = 85,\n\trenderLineHighlightOnlyWhenFocus = 86,\n\trenderValidationDecorations = 87,\n\trenderWhitespace = 88,\n\trevealHorizontalRightPadding = 89,\n\troundedSelection = 90,\n\trulers = 91,\n\tscrollbar = 92,\n\tscrollBeyondLastColumn = 93,\n\tscrollBeyondLastLine = 94,\n\tscrollPredominantAxis = 95,\n\tselectionClipboard = 96,\n\tselectionHighlight = 97,\n\tselectOnLineNumbers = 98,\n\tshowFoldingControls = 99,\n\tshowUnused = 100,\n\tsnippetSuggestions = 101,\n\tsmartSelect = 102,\n\tsmoothScrolling = 103,\n\tstickyTabStops = 104,\n\tstopRenderingLineAfter = 105,\n\tsuggest = 106,\n\tsuggestFontSize = 107,\n\tsuggestLineHeight = 108,\n\tsuggestOnTriggerCharacters = 109,\n\tsuggestSelection = 110,\n\ttabCompletion = 111,\n\ttabIndex = 112,\n\tunicodeHighlighting = 113,\n\tunusualLineTerminators = 114,\n\tuseShadowDOM = 115,\n\tuseTabStops = 116,\n\twordSeparators = 117,\n\twordWrap = 118,\n\twordWrapBreakAfterCharacters = 119,\n\twordWrapBreakBeforeCharacters = 120,\n\twordWrapColumn = 121,\n\twordWrapOverride1 = 122,\n\twordWrapOverride2 = 123,\n\twrappingIndent = 124,\n\twrappingStrategy = 125,\n\tshowDeprecated = 126,\n\tinlayHints = 127,\n\teditorClassName = 128,\n\tpixelRatio = 129,\n\ttabFocusMode = 130,\n\tlayoutInfo = 131,\n\twrappingInfo = 132\n}\n\n/**\n * End of line character preference.\n */\nexport enum EndOfLinePreference {\n\t/**\n\t * Use the end of line character identified in the text buffer.\n\t */\n\tTextDefined = 0,\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 1,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 2\n}\n\n/**\n * End of line character preference.\n */\nexport enum EndOfLineSequence {\n\t/**\n\t * Use line feed (\\n) as the end of line character.\n\t */\n\tLF = 0,\n\t/**\n\t * Use carriage return and line feed (\\r\\n) as the end of line character.\n\t */\n\tCRLF = 1\n}\n\n/**\n * Describes what to do with the indentation when pressing Enter.\n */\nexport enum IndentAction {\n\t/**\n\t * Insert new line and copy the previous line's indentation.\n\t */\n\tNone = 0,\n\t/**\n\t * Insert new line and indent once (relative to the previous line's indentation).\n\t */\n\tIndent = 1,\n\t/**\n\t * Insert two new lines:\n\t * - the first one indented which will hold the cursor\n\t * - the second one at the same indentation level\n\t */\n\tIndentOutdent = 2,\n\t/**\n\t * Insert new line and outdent once (relative to the previous line's indentation).\n\t */\n\tOutdent = 3\n}\n\nexport enum InjectedTextCursorStops {\n\tBoth = 0,\n\tRight = 1,\n\tLeft = 2,\n\tNone = 3\n}\n\nexport enum InlayHintKind {\n\tType = 1,\n\tParameter = 2\n}\n\n/**\n * How an {@link InlineCompletionsProvider inline completion provider} was triggered.\n */\nexport enum InlineCompletionTriggerKind {\n\t/**\n\t * Completion was triggered automatically while editing.\n\t * It is sufficient to return a single completion item in this case.\n\t */\n\tAutomatic = 0,\n\t/**\n\t * Completion was triggered explicitly by a user gesture.\n\t * Return multiple completion items to enable cycling through them.\n\t */\n\tExplicit = 1\n}\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport enum KeyCode {\n\tDependsOnKbLayout = -1,\n\t/**\n\t * Placed first to cover the 0 value of the enum.\n\t */\n\tUnknown = 0,\n\tBackspace = 1,\n\tTab = 2,\n\tEnter = 3,\n\tShift = 4,\n\tCtrl = 5,\n\tAlt = 6,\n\tPauseBreak = 7,\n\tCapsLock = 8,\n\tEscape = 9,\n\tSpace = 10,\n\tPageUp = 11,\n\tPageDown = 12,\n\tEnd = 13,\n\tHome = 14,\n\tLeftArrow = 15,\n\tUpArrow = 16,\n\tRightArrow = 17,\n\tDownArrow = 18,\n\tInsert = 19,\n\tDelete = 20,\n\tDigit0 = 21,\n\tDigit1 = 22,\n\tDigit2 = 23,\n\tDigit3 = 24,\n\tDigit4 = 25,\n\tDigit5 = 26,\n\tDigit6 = 27,\n\tDigit7 = 28,\n\tDigit8 = 29,\n\tDigit9 = 30,\n\tKeyA = 31,\n\tKeyB = 32,\n\tKeyC = 33,\n\tKeyD = 34,\n\tKeyE = 35,\n\tKeyF = 36,\n\tKeyG = 37,\n\tKeyH = 38,\n\tKeyI = 39,\n\tKeyJ = 40,\n\tKeyK = 41,\n\tKeyL = 42,\n\tKeyM = 43,\n\tKeyN = 44,\n\tKeyO = 45,\n\tKeyP = 46,\n\tKeyQ = 47,\n\tKeyR = 48,\n\tKeyS = 49,\n\tKeyT = 50,\n\tKeyU = 51,\n\tKeyV = 52,\n\tKeyW = 53,\n\tKeyX = 54,\n\tKeyY = 55,\n\tKeyZ = 56,\n\tMeta = 57,\n\tContextMenu = 58,\n\tF1 = 59,\n\tF2 = 60,\n\tF3 = 61,\n\tF4 = 62,\n\tF5 = 63,\n\tF6 = 64,\n\tF7 = 65,\n\tF8 = 66,\n\tF9 = 67,\n\tF10 = 68,\n\tF11 = 69,\n\tF12 = 70,\n\tF13 = 71,\n\tF14 = 72,\n\tF15 = 73,\n\tF16 = 74,\n\tF17 = 75,\n\tF18 = 76,\n\tF19 = 77,\n\tNumLock = 78,\n\tScrollLock = 79,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ';:' key\n\t */\n\tSemicolon = 80,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tEqual = 81,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tComma = 82,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tMinus = 83,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tPeriod = 84,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '/?' key\n\t */\n\tSlash = 85,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '`~' key\n\t */\n\tBackquote = 86,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '[{' key\n\t */\n\tBracketLeft = 87,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '\\|' key\n\t */\n\tBackslash = 88,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ']}' key\n\t */\n\tBracketRight = 89,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ''\"' key\n\t */\n\tQuote = 90,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t */\n\tOEM_8 = 91,\n\t/**\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n\t */\n\tIntlBackslash = 92,\n\tNumpad0 = 93,\n\tNumpad1 = 94,\n\tNumpad2 = 95,\n\tNumpad3 = 96,\n\tNumpad4 = 97,\n\tNumpad5 = 98,\n\tNumpad6 = 99,\n\tNumpad7 = 100,\n\tNumpad8 = 101,\n\tNumpad9 = 102,\n\tNumpadMultiply = 103,\n\tNumpadAdd = 104,\n\tNUMPAD_SEPARATOR = 105,\n\tNumpadSubtract = 106,\n\tNumpadDecimal = 107,\n\tNumpadDivide = 108,\n\t/**\n\t * Cover all key codes when IME is processing input.\n\t */\n\tKEY_IN_COMPOSITION = 109,\n\tABNT_C1 = 110,\n\tABNT_C2 = 111,\n\tAudioVolumeMute = 112,\n\tAudioVolumeUp = 113,\n\tAudioVolumeDown = 114,\n\tBrowserSearch = 115,\n\tBrowserHome = 116,\n\tBrowserBack = 117,\n\tBrowserForward = 118,\n\tMediaTrackNext = 119,\n\tMediaTrackPrevious = 120,\n\tMediaStop = 121,\n\tMediaPlayPause = 122,\n\tLaunchMediaPlayer = 123,\n\tLaunchMail = 124,\n\tLaunchApp2 = 125,\n\t/**\n\t * VK_CLEAR, 0x0C, CLEAR key\n\t */\n\tClear = 126,\n\t/**\n\t * Placed last to cover the length of the enum.\n\t * Please do not depend on this value!\n\t */\n\tMAX_VALUE = 127\n}\n\nexport enum MarkerSeverity {\n\tHint = 1,\n\tInfo = 2,\n\tWarning = 4,\n\tError = 8\n}\n\nexport enum MarkerTag {\n\tUnnecessary = 1,\n\tDeprecated = 2\n}\n\n/**\n * Position in the minimap to render the decoration.\n */\nexport enum MinimapPosition {\n\tInline = 1,\n\tGutter = 2\n}\n\n/**\n * Type of hit element with the mouse in the editor.\n */\nexport enum MouseTargetType {\n\t/**\n\t * Mouse is on top of an unknown element.\n\t */\n\tUNKNOWN = 0,\n\t/**\n\t * Mouse is on top of the textarea used for input.\n\t */\n\tTEXTAREA = 1,\n\t/**\n\t * Mouse is on top of the glyph margin\n\t */\n\tGUTTER_GLYPH_MARGIN = 2,\n\t/**\n\t * Mouse is on top of the line numbers\n\t */\n\tGUTTER_LINE_NUMBERS = 3,\n\t/**\n\t * Mouse is on top of the line decorations\n\t */\n\tGUTTER_LINE_DECORATIONS = 4,\n\t/**\n\t * Mouse is on top of the whitespace left in the gutter by a view zone.\n\t */\n\tGUTTER_VIEW_ZONE = 5,\n\t/**\n\t * Mouse is on top of text in the content.\n\t */\n\tCONTENT_TEXT = 6,\n\t/**\n\t * Mouse is on top of empty space in the content (e.g. after line text or below last line)\n\t */\n\tCONTENT_EMPTY = 7,\n\t/**\n\t * Mouse is on top of a view zone in the content.\n\t */\n\tCONTENT_VIEW_ZONE = 8,\n\t/**\n\t * Mouse is on top of a content widget.\n\t */\n\tCONTENT_WIDGET = 9,\n\t/**\n\t * Mouse is on top of the decorations overview ruler.\n\t */\n\tOVERVIEW_RULER = 10,\n\t/**\n\t * Mouse is on top of a scrollbar.\n\t */\n\tSCROLLBAR = 11,\n\t/**\n\t * Mouse is on top of an overlay widget.\n\t */\n\tOVERLAY_WIDGET = 12,\n\t/**\n\t * Mouse is outside of the editor.\n\t */\n\tOUTSIDE_EDITOR = 13\n}\n\n/**\n * A positioning preference for rendering overlay widgets.\n */\nexport enum OverlayWidgetPositionPreference {\n\t/**\n\t * Position the overlay widget in the top right corner\n\t */\n\tTOP_RIGHT_CORNER = 0,\n\t/**\n\t * Position the overlay widget in the bottom right corner\n\t */\n\tBOTTOM_RIGHT_CORNER = 1,\n\t/**\n\t * Position the overlay widget in the top center\n\t */\n\tTOP_CENTER = 2\n}\n\n/**\n * Vertical Lane in the overview ruler of the editor.\n */\nexport enum OverviewRulerLane {\n\tLeft = 1,\n\tCenter = 2,\n\tRight = 4,\n\tFull = 7\n}\n\nexport enum PositionAffinity {\n\t/**\n\t * Prefers the left most position.\n\t*/\n\tLeft = 0,\n\t/**\n\t * Prefers the right most position.\n\t*/\n\tRight = 1,\n\t/**\n\t * No preference.\n\t*/\n\tNone = 2\n}\n\nexport enum RenderLineNumbersType {\n\tOff = 0,\n\tOn = 1,\n\tRelative = 2,\n\tInterval = 3,\n\tCustom = 4\n}\n\nexport enum RenderMinimap {\n\tNone = 0,\n\tText = 1,\n\tBlocks = 2\n}\n\nexport enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1\n}\n\nexport enum ScrollbarVisibility {\n\tAuto = 1,\n\tHidden = 2,\n\tVisible = 3\n}\n\n/**\n * The direction of a selection.\n */\nexport enum SelectionDirection {\n\t/**\n\t * The selection starts above where it ends.\n\t */\n\tLTR = 0,\n\t/**\n\t * The selection starts below where it ends.\n\t */\n\tRTL = 1\n}\n\nexport enum SignatureHelpTriggerKind {\n\tInvoke = 1,\n\tTriggerCharacter = 2,\n\tContentChange = 3\n}\n\n/**\n * A symbol kind.\n */\nexport enum SymbolKind {\n\tFile = 0,\n\tModule = 1,\n\tNamespace = 2,\n\tPackage = 3,\n\tClass = 4,\n\tMethod = 5,\n\tProperty = 6,\n\tField = 7,\n\tConstructor = 8,\n\tEnum = 9,\n\tInterface = 10,\n\tFunction = 11,\n\tVariable = 12,\n\tConstant = 13,\n\tString = 14,\n\tNumber = 15,\n\tBoolean = 16,\n\tArray = 17,\n\tObject = 18,\n\tKey = 19,\n\tNull = 20,\n\tEnumMember = 21,\n\tStruct = 22,\n\tEvent = 23,\n\tOperator = 24,\n\tTypeParameter = 25\n}\n\nexport enum SymbolTag {\n\tDeprecated = 1\n}\n\n/**\n * The kind of animation in which the editor's cursor should be rendered.\n */\nexport enum TextEditorCursorBlinkingStyle {\n\t/**\n\t * Hidden\n\t */\n\tHidden = 0,\n\t/**\n\t * Blinking\n\t */\n\tBlink = 1,\n\t/**\n\t * Blinking with smooth fading\n\t */\n\tSmooth = 2,\n\t/**\n\t * Blinking with prolonged filled state and smooth fading\n\t */\n\tPhase = 3,\n\t/**\n\t * Expand collapse animation on the y axis\n\t */\n\tExpand = 4,\n\t/**\n\t * No-Blinking\n\t */\n\tSolid = 5\n}\n\n/**\n * The style in which the editor's cursor should be rendered.\n */\nexport enum TextEditorCursorStyle {\n\t/**\n\t * As a vertical line (sitting between two characters).\n\t */\n\tLine = 1,\n\t/**\n\t * As a block (sitting on top of a character).\n\t */\n\tBlock = 2,\n\t/**\n\t * As a horizontal line (sitting under a character).\n\t */\n\tUnderline = 3,\n\t/**\n\t * As a thin vertical line (sitting between two characters).\n\t */\n\tLineThin = 4,\n\t/**\n\t * As an outlined block (sitting on top of a character).\n\t */\n\tBlockOutline = 5,\n\t/**\n\t * As a thin horizontal line (sitting under a character).\n\t */\n\tUnderlineThin = 6\n}\n\n/**\n * Describes the behavior of decorations when typing/editing near their edges.\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\n */\nexport enum TrackedRangeStickiness {\n\tAlwaysGrowsWhenTypingAtEdges = 0,\n\tNeverGrowsWhenTypingAtEdges = 1,\n\tGrowsOnlyWhenTypingBefore = 2,\n\tGrowsOnlyWhenTypingAfter = 3\n}\n\n/**\n * Describes how to indent wrapped lines.\n */\nexport enum WrappingIndent {\n\t/**\n\t * No indentation => wrapped lines begin at column 1.\n\t */\n\tNone = 0,\n\t/**\n\t * Same => wrapped lines get the same indentation as the parent.\n\t */\n\tSame = 1,\n\t/**\n\t * Indent => wrapped lines get +1 indentation toward the parent.\n\t */\n\tIndent = 2,\n\t/**\n\t * DeepIndent => wrapped lines get +2 indentation toward the parent.\n\t */\n\tDeepIndent = 3\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 'vs/base/common/event';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\n\nexport interface IBracketPairsTextModelPart {\n\t/**\n\t * Is fired when bracket pairs change, either due to a text or a settings change.\n\t*/\n\tonDidChange: Event<void>;\n\n\t/**\n\t * Gets all bracket pairs that intersect the given position.\n\t * The result is sorted by the start position.\n\t */\n\tgetBracketPairsInRange(range: IRange): BracketPairInfo[];\n\n\t/**\n\t * Gets all bracket pairs that intersect the given position.\n\t * The result is sorted by the start position.\n\t */\n\tgetBracketPairsInRangeWithMinIndentation(range: IRange): BracketPairWithMinIndentationInfo[];\n\n\tgetBracketsInRange(range: IRange): BracketInfo[];\n\n\t/**\n\t * Find the matching bracket of `request` up, counting brackets.\n\t * @param request The bracket we're searching for\n\t * @param position The position at which to start the search.\n\t * @return The range of the matching bracket, or null if the bracket match was not found.\n\t */\n\tfindMatchingBracketUp(bracket: string, position: IPosition, maxDuration?: number): Range | null;\n\n\t/**\n\t * Find the first bracket in the model before `position`.\n\t * @param position The position at which to start the search.\n\t * @return The info for the first bracket before `position`, or null if there are no more brackets before `positions`.\n\t */\n\tfindPrevBracket(position: IPosition): IFoundBracket | null;\n\n\t/**\n\t * Find the first bracket in the model after `position`.\n\t * @param position The position at which to start the search.\n\t * @return The info for the first bracket after `position`, or null if there are no more brackets after `positions`.\n\t */\n\tfindNextBracket(position: IPosition): IFoundBracket | null;\n\n\t/**\n\t * Find the enclosing brackets that contain `position`.\n\t * @param position The position at which to start the search.\n\t */\n\tfindEnclosingBrackets(position: IPosition, maxDuration?: number): [Range, Range] | null;\n\n\t/**\n\t * Given a `position`, if the position is on top or near a bracket,\n\t * find the matching bracket of that bracket and return the ranges of both brackets.\n\t * @param position The position at which to look for a bracket.\n\t */\n\tmatchBracket(position: IPosition, maxDuration?: number): [Range, Range] | null;\n}\n\nexport interface IFoundBracket {\n\trange: Range;\n\topen: string[];\n\tclose: string[];\n\tisOpen: boolean;\n}\n\nexport class BracketInfo {\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\t/** 0-based level */\n\t\tpublic readonly nestingLevel: number,\n\t\tpublic readonly isInvalid: boolean,\n\t) { }\n}\n\nexport class BracketPairInfo {\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly openingBracketRange: Range,\n\t\tpublic readonly closingBracketRange: Range | undefined,\n\t\t/**\n\t\t * 0-based\n\t\t*/\n\t\tpublic readonly nestingLevel: number,\n\t) { }\n}\n\nexport class BracketPairWithMinIndentationInfo extends BracketPairInfo {\n\tconstructor(\n\t\trange: Range,\n\t\topeningBracketRange: Range,\n\t\tclosingBracketRange: Range | undefined,\n\t\t/**\n\t\t * 0-based\n\t\t*/\n\t\tnestingLevel: number,\n\t\t/**\n\t\t * -1 if not requested, otherwise the size of the minimum indentation in the bracket pair in terms of visible columns.\n\t\t*/\n\t\tpublic readonly minVisibleColumnIndentation: number,\n\t) {\n\t\tsuper(range, openingBracketRange, closingBracketRange, nestingLevel);\n\t}\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 { IRange } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IModelDecoration, InjectedTextOptions } from 'vs/editor/common/model';\n\n/**\n * An event describing that the current language associated with a model has changed.\n */\nexport interface IModelLanguageChangedEvent {\n\t/**\n\t * Previous language\n\t */\n\treadonly oldLanguage: string;\n\t/**\n\t * New language\n\t */\n\treadonly newLanguage: string;\n}\n\n/**\n * An event describing that the language configuration associated with a model has changed.\n */\nexport interface IModelLanguageConfigurationChangedEvent {\n}\n\nexport interface IModelContentChange {\n\t/**\n\t * The range that got replaced.\n\t */\n\treadonly range: IRange;\n\t/**\n\t * The offset of the range that got replaced.\n\t */\n\treadonly rangeOffset: number;\n\t/**\n\t * The length of the range that got replaced.\n\t */\n\treadonly rangeLength: number;\n\t/**\n\t * The new text for the range.\n\t */\n\treadonly text: string;\n}\n\n/**\n * An event describing a change in the text of a model.\n */\nexport interface IModelContentChangedEvent {\n\treadonly changes: IModelContentChange[];\n\t/**\n\t * The (new) end-of-line character.\n\t */\n\treadonly eol: string;\n\t/**\n\t * The new version id the model has transitioned to.\n\t */\n\treadonly versionId: number;\n\t/**\n\t * Flag that indicates that this event was generated while undoing.\n\t */\n\treadonly isUndoing: boolean;\n\t/**\n\t * Flag that indicates that this event was generated while redoing.\n\t */\n\treadonly isRedoing: boolean;\n\t/**\n\t * Flag that indicates that all decorations were lost with this edit.\n\t * The model has been reset to a new value.\n\t */\n\treadonly isFlush: boolean;\n}\n\n/**\n * An event describing that model decorations have changed.\n */\nexport interface IModelDecorationsChangedEvent {\n\treadonly affectsMinimap: boolean;\n\treadonly affectsOverviewRuler: boolean;\n}\n\n/**\n * An event describing that some ranges of lines have been tokenized (their tokens have changed).\n * @internal\n */\nexport interface IModelTokensChangedEvent {\n\treadonly tokenizationSupportChanged: boolean;\n\treadonly semanticTokensApplied: boolean;\n\treadonly ranges: {\n\t\t/**\n\t\t * The start of the range (inclusive)\n\t\t */\n\t\treadonly fromLineNumber: number;\n\t\t/**\n\t\t * The end of the range (inclusive)\n\t\t */\n\t\treadonly toLineNumber: number;\n\t}[];\n}\n\nexport interface IModelOptionsChangedEvent {\n\treadonly tabSize: boolean;\n\treadonly indentSize: boolean;\n\treadonly insertSpaces: boolean;\n\treadonly trimAutoWhitespace: boolean;\n}\n\n/**\n * @internal\n */\nexport const enum RawContentChangedType {\n\tFlush = 1,\n\tLineChanged = 2,\n\tLinesDeleted = 3,\n\tLinesInserted = 4,\n\tEOLChanged = 5\n}\n\n/**\n * An event describing that a model has been reset to a new value.\n * @internal\n */\nexport class ModelRawFlush {\n\tpublic readonly changeType = RawContentChangedType.Flush;\n}\n\n/**\n * Represents text injected on a line\n * @internal\n */\nexport class LineInjectedText {\n\tpublic static applyInjectedText(lineText: string, injectedTexts: LineInjectedText[] | null): string {\n\t\tif (!injectedTexts || injectedTexts.length === 0) {\n\t\t\treturn lineText;\n\t\t}\n\t\tlet result = '';\n\t\tlet lastOriginalOffset = 0;\n\t\tfor (const injectedText of injectedTexts) {\n\t\t\tresult += lineText.substring(lastOriginalOffset, injectedText.column - 1);\n\t\t\tlastOriginalOffset = injectedText.column - 1;\n\t\t\tresult += injectedText.options.content;\n\t\t}\n\t\tresult += lineText.substring(lastOriginalOffset);\n\t\treturn result;\n\t}\n\n\tpublic static fromDecorations(decorations: IModelDecoration[]): LineInjectedText[] {\n\t\tconst result: LineInjectedText[] = [];\n\t\tfor (const decoration of decorations) {\n\t\t\tif (decoration.options.before && decoration.options.before.content.length > 0) {\n\t\t\t\tresult.push(new LineInjectedText(\n\t\t\t\t\tdecoration.ownerId,\n\t\t\t\t\tdecoration.range.startLineNumber,\n\t\t\t\t\tdecoration.range.startColumn,\n\t\t\t\t\tdecoration.options.before,\n\t\t\t\t\t0,\n\t\t\t\t));\n\t\t\t}\n\t\t\tif (decoration.options.after && decoration.options.after.content.length > 0) {\n\t\t\t\tresult.push(new LineInjectedText(\n\t\t\t\t\tdecoration.ownerId,\n\t\t\t\t\tdecoration.range.endLineNumber,\n\t\t\t\t\tdecoration.range.endColumn,\n\t\t\t\t\tdecoration.options.after,\n\t\t\t\t\t1,\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tresult.sort((a, b) => {\n\t\t\tif (a.lineNumber === b.lineNumber) {\n\t\t\t\tif (a.column === b.column) {\n\t\t\t\t\treturn a.order - b.order;\n\t\t\t\t}\n\t\t\t\treturn a.column - b.column;\n\t\t\t}\n\t\t\treturn a.lineNumber - b.lineNumber;\n\t\t});\n\t\treturn result;\n\t}\n\n\tconstructor(\n\t\tpublic readonly ownerId: number,\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly column: number,\n\t\tpublic readonly options: InjectedTextOptions,\n\t\tpublic readonly order: number\n\t) { }\n}\n\n/**\n * An event describing that a line has changed in a model.\n * @internal\n */\nexport class ModelRawLineChanged {\n\tpublic readonly changeType = RawContentChangedType.LineChanged;\n\t/**\n\t * The line that has changed.\n\t */\n\tpublic readonly lineNumber: number;\n\t/**\n\t * The new value of the line.\n\t */\n\tpublic readonly detail: string;\n\t/**\n\t * The injected text on the line.\n\t */\n\tpublic readonly injectedText: LineInjectedText[] | null;\n\n\tconstructor(lineNumber: number, detail: string, injectedText: LineInjectedText[] | null) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.detail = detail;\n\t\tthis.injectedText = injectedText;\n\t}\n}\n\n/**\n * An event describing that line(s) have been deleted in a model.\n * @internal\n */\nexport class ModelRawLinesDeleted {\n\tpublic readonly changeType = RawContentChangedType.LinesDeleted;\n\t/**\n\t * At what line the deletion began (inclusive).\n\t */\n\tpublic readonly fromLineNumber: number;\n\t/**\n\t * At what line the deletion stopped (inclusive).\n\t */\n\tpublic readonly toLineNumber: number;\n\n\tconstructor(fromLineNumber: number, toLineNumber: number) {\n\t\tthis.fromLineNumber = fromLineNumber;\n\t\tthis.toLineNumber = toLineNumber;\n\t}\n}\n\n/**\n * An event describing that line(s) have been inserted in a model.\n * @internal\n */\nexport class ModelRawLinesInserted {\n\tpublic readonly changeType = RawContentChangedType.LinesInserted;\n\t/**\n\t * Before what line did the insertion begin\n\t */\n\tpublic readonly fromLineNumber: number;\n\t/**\n\t * `toLineNumber` - `fromLineNumber` + 1 denotes the number of lines that were inserted\n\t */\n\tpublic readonly toLineNumber: number;\n\t/**\n\t * The text that was inserted\n\t */\n\tpublic readonly detail: string[];\n\t/**\n\t * The injected texts for every inserted line.\n\t */\n\tpublic readonly injectedTexts: (LineInjectedText[] | null)[];\n\n\tconstructor(fromLineNumber: number, toLineNumber: number, detail: string[], injectedTexts: (LineInjectedText[] | null)[]) {\n\t\tthis.injectedTexts = injectedTexts;\n\t\tthis.fromLineNumber = fromLineNumber;\n\t\tthis.toLineNumber = toLineNumber;\n\t\tthis.detail = detail;\n\t}\n}\n\n/**\n * An event describing that a model has had its EOL changed.\n * @internal\n */\nexport class ModelRawEOLChanged {\n\tpublic readonly changeType = RawContentChangedType.EOLChanged;\n}\n\n/**\n * @internal\n */\nexport type ModelRawChange = ModelRawFlush | ModelRawLineChanged | ModelRawLinesDeleted | ModelRawLinesInserted | ModelRawEOLChanged;\n\n/**\n * An event describing a change in the text of a model.\n * @internal\n */\nexport class ModelRawContentChangedEvent {\n\n\tpublic readonly changes: ModelRawChange[];\n\t/**\n\t * The new version id the model has transitioned to.\n\t */\n\tpublic readonly versionId: number;\n\t/**\n\t * Flag that indicates that this event was generated while undoing.\n\t */\n\tpublic readonly isUndoing: boolean;\n\t/**\n\t * Flag that indicates that this event was generated while redoing.\n\t */\n\tpublic readonly isRedoing: boolean;\n\n\tpublic resultingSelection: Selection[] | null;\n\n\tconstructor(changes: ModelRawChange[], versionId: number, isUndoing: boolean, isRedoing: boolean) {\n\t\tthis.changes = changes;\n\t\tthis.versionId = versionId;\n\t\tthis.isUndoing = isUndoing;\n\t\tthis.isRedoing = isRedoing;\n\t\tthis.resultingSelection = null;\n\t}\n\n\tpublic containsEvent(type: RawContentChangedType): boolean {\n\t\tfor (let i = 0, len = this.changes.length; i < len; i++) {\n\t\t\tconst change = this.changes[i];\n\t\t\tif (change.changeType === type) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic static merge(a: ModelRawContentChangedEvent, b: ModelRawContentChangedEvent): ModelRawContentChangedEvent {\n\t\tconst changes = ([] as ModelRawChange[]).concat(a.changes).concat(b.changes);\n\t\tconst versionId = b.versionId;\n\t\tconst isUndoing = (a.isUndoing || b.isUndoing);\n\t\tconst isRedoing = (a.isRedoing || b.isRedoing);\n\t\treturn new ModelRawContentChangedEvent(changes, versionId, isUndoing, isRedoing);\n\t}\n}\n\n/**\n * An event describing a change in injected text.\n * @internal\n */\nexport class ModelInjectedTextChangedEvent {\n\n\tpublic readonly changes: ModelRawLineChanged[];\n\n\tconstructor(changes: ModelRawLineChanged[]) {\n\t\tthis.changes = changes;\n\t}\n}\n\n/**\n * @internal\n */\nexport class InternalModelContentChangeEvent {\n\tconstructor(\n\t\tpublic readonly rawContentChangedEvent: ModelRawContentChangedEvent,\n\t\tpublic readonly contentChangedEvent: IModelContentChangedEvent,\n\t) { }\n\n\tpublic merge(other: InternalModelContentChangeEvent): InternalModelContentChangeEvent {\n\t\tconst rawContentChangedEvent = ModelRawContentChangedEvent.merge(this.rawContentChangedEvent, other.rawContentChangedEvent);\n\t\tconst contentChangedEvent = InternalModelContentChangeEvent._mergeChangeEvents(this.contentChangedEvent, other.contentChangedEvent);\n\t\treturn new InternalModelContentChangeEvent(rawContentChangedEvent, contentChangedEvent);\n\t}\n\n\tprivate static _mergeChangeEvents(a: IModelContentChangedEvent, b: IModelContentChangedEvent): IModelContentChangedEvent {\n\t\tconst changes = ([] as IModelContentChange[]).concat(a.changes).concat(b.changes);\n\t\tconst eol = b.eol;\n\t\tconst versionId = b.versionId;\n\t\tconst isUndoing = (a.isUndoing || b.isUndoing);\n\t\tconst isRedoing = (a.isRedoing || b.isRedoing);\n\t\tconst isFlush = (a.isFlush || b.isFlush);\n\t\treturn {\n\t\t\tchanges: changes,\n\t\t\teol: eol,\n\t\t\tversionId: versionId,\n\t\t\tisUndoing: isUndoing,\n\t\t\tisRedoing: isRedoing,\n\t\t\tisFlush: isFlush\n\t\t};\n\t}\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 { IPosition } from 'vs/editor/common/core/position';\n\nexport interface IGuidesTextModelPart {\n\t/**\n\t * @internal\n\t */\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\n\t/**\n\t * @internal\n\t */\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\n\t/**\n\t * @internal\n\t */\n\tgetLinesBracketGuides(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n}\n\nexport interface IActiveIndentGuideInfo {\n\tstartLineNumber: number;\n\tendLineNumber: number;\n\tindent: number;\n}\n\nexport enum HorizontalGuidesState {\n\tDisabled,\n\tEnabledForActive,\n\tEnabled\n}\n\nexport interface BracketGuideOptions {\n\tincludeInactive: boolean;\n\thorizontalGuides: HorizontalGuidesState;\n\thighlightActive: boolean;\n}\n\nexport class IndentGuide {\n\tconstructor(\n\t\tpublic readonly visibleColumn: number,\n\t\tpublic readonly className: string,\n\t\t/**\n\t\t * If set, this indent guide is a horizontal guide (no vertical part).\n\t\t * It starts at visibleColumn and continues until endColumn.\n\t\t*/\n\t\tpublic readonly horizontalLine: IndentGuideHorizontalLine | null,\n\t) { }\n}\n\nexport class IndentGuideHorizontalLine {\n\tconstructor(\n\t\tpublic readonly top: boolean,\n\t\tpublic readonly endColumn: number,\n\t) { }\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 { ArrayQueue, findLast } from 'vs/base/common/arrays';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { BracketPairInfo } from 'vs/editor/common/textModelBracketPairs';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { TextModelPart } from 'vs/editor/common/model/textModelPart';\nimport { computeIndentLevel } from 'vs/editor/common/model/utils';\nimport { ILanguageConfigurationService, ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { BracketGuideOptions, HorizontalGuidesState, IActiveIndentGuideInfo, IGuidesTextModelPart, IndentGuide, IndentGuideHorizontalLine } from 'vs/editor/common/textModelGuides';\n\nexport class GuidesTextModelPart extends TextModelPart implements IGuidesTextModelPart {\n\tconstructor(\n\t\tprivate readonly textModel: TextModel,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tsuper();\n\t}\n\n\tprivate getLanguageConfiguration(\n\t\tlanguageId: string\n\t): ResolvedLanguageConfiguration {\n\t\treturn this.languageConfigurationService.getLanguageConfiguration(\n\t\t\tlanguageId\n\t\t);\n\t}\n\n\tprivate _computeIndentLevel(lineIndex: number): number {\n\t\treturn computeIndentLevel(\n\t\t\tthis.textModel.getLineContent(lineIndex + 1),\n\t\t\tthis.textModel.getOptions().tabSize\n\t\t);\n\t}\n\n\tpublic getActiveIndentGuide(\n\t\tlineNumber: number,\n\t\tminLineNumber: number,\n\t\tmaxLineNumber: number\n\t): IActiveIndentGuideInfo {\n\t\tthis.assertNotDisposed();\n\t\tconst lineCount = this.textModel.getLineCount();\n\n\t\tif (lineNumber < 1 || lineNumber > lineCount) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\n\t\tconst foldingRules = this.getLanguageConfiguration(\n\t\t\tthis.textModel.getLanguageId()\n\t\t).foldingRules;\n\t\tconst offSide = Boolean(foldingRules && foldingRules.offSide);\n\n\t\tlet up_aboveContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet up_aboveContentLineIndent = -1;\n\t\tlet up_belowContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet up_belowContentLineIndent = -1;\n\t\tconst up_resolveIndents = (lineNumber: number) => {\n\t\t\tif (\n\t\t\t\tup_aboveContentLineIndex !== -1 &&\n\t\t\t\t(up_aboveContentLineIndex === -2 ||\n\t\t\t\t\tup_aboveContentLineIndex > lineNumber - 1)\n\t\t\t) {\n\t\t\t\tup_aboveContentLineIndex = -1;\n\t\t\t\tup_aboveContentLineIndent = -1;\n\n\t\t\t\t// must find previous line with content\n\t\t\t\tfor (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\tup_aboveContentLineIndex = lineIndex;\n\t\t\t\t\t\tup_aboveContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (up_belowContentLineIndex === -2) {\n\t\t\t\tup_belowContentLineIndex = -1;\n\t\t\t\tup_belowContentLineIndent = -1;\n\n\t\t\t\t// must find next line with content\n\t\t\t\tfor (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\tup_belowContentLineIndex = lineIndex;\n\t\t\t\t\t\tup_belowContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet down_aboveContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet down_aboveContentLineIndent = -1;\n\t\tlet down_belowContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet down_belowContentLineIndent = -1;\n\t\tconst down_resolveIndents = (lineNumber: number) => {\n\t\t\tif (down_aboveContentLineIndex === -2) {\n\t\t\t\tdown_aboveContentLineIndex = -1;\n\t\t\t\tdown_aboveContentLineIndent = -1;\n\n\t\t\t\t// must find previous line with content\n\t\t\t\tfor (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\tdown_aboveContentLineIndex = lineIndex;\n\t\t\t\t\t\tdown_aboveContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tdown_belowContentLineIndex !== -1 &&\n\t\t\t\t(down_belowContentLineIndex === -2 ||\n\t\t\t\t\tdown_belowContentLineIndex < lineNumber - 1)\n\t\t\t) {\n\t\t\t\tdown_belowContentLineIndex = -1;\n\t\t\t\tdown_belowContentLineIndent = -1;\n\n\t\t\t\t// must find next line with content\n\t\t\t\tfor (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\tdown_belowContentLineIndex = lineIndex;\n\t\t\t\t\t\tdown_belowContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet startLineNumber = 0;\n\t\tlet goUp = true;\n\t\tlet endLineNumber = 0;\n\t\tlet goDown = true;\n\t\tlet indent = 0;\n\n\t\tlet initialIndent = 0;\n\n\t\tfor (let distance = 0; goUp || goDown; distance++) {\n\t\t\tconst upLineNumber = lineNumber - distance;\n\t\t\tconst downLineNumber = lineNumber + distance;\n\n\t\t\tif (distance > 1 && (upLineNumber < 1 || upLineNumber < minLineNumber)) {\n\t\t\t\tgoUp = false;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tdistance > 1 &&\n\t\t\t\t(downLineNumber > lineCount || downLineNumber > maxLineNumber)\n\t\t\t) {\n\t\t\t\tgoDown = false;\n\t\t\t}\n\t\t\tif (distance > 50000) {\n\t\t\t\t// stop processing\n\t\t\t\tgoUp = false;\n\t\t\t\tgoDown = false;\n\t\t\t}\n\n\t\t\tlet upLineIndentLevel: number = -1;\n\t\t\tif (goUp && upLineNumber >= 1) {\n\t\t\t\t// compute indent level going up\n\t\t\t\tconst currentIndent = this._computeIndentLevel(upLineNumber - 1);\n\t\t\t\tif (currentIndent >= 0) {\n\t\t\t\t\t// This line has content (besides whitespace)\n\t\t\t\t\t// Use the line's indent\n\t\t\t\t\tup_belowContentLineIndex = upLineNumber - 1;\n\t\t\t\t\tup_belowContentLineIndent = currentIndent;\n\t\t\t\t\tupLineIndentLevel = Math.ceil(\n\t\t\t\t\t\tcurrentIndent / this.textModel.getOptions().indentSize\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tup_resolveIndents(upLineNumber);\n\t\t\t\t\tupLineIndentLevel = this._getIndentLevelForWhitespaceLine(\n\t\t\t\t\t\toffSide,\n\t\t\t\t\t\tup_aboveContentLineIndent,\n\t\t\t\t\t\tup_belowContentLineIndent\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet downLineIndentLevel = -1;\n\t\t\tif (goDown && downLineNumber <= lineCount) {\n\t\t\t\t// compute indent level going down\n\t\t\t\tconst currentIndent = this._computeIndentLevel(downLineNumber - 1);\n\t\t\t\tif (currentIndent >= 0) {\n\t\t\t\t\t// This line has content (besides whitespace)\n\t\t\t\t\t// Use the line's indent\n\t\t\t\t\tdown_aboveContentLineIndex = downLineNumber - 1;\n\t\t\t\t\tdown_aboveContentLineIndent = currentIndent;\n\t\t\t\t\tdownLineIndentLevel = Math.ceil(\n\t\t\t\t\t\tcurrentIndent / this.textModel.getOptions().indentSize\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdown_resolveIndents(downLineNumber);\n\t\t\t\t\tdownLineIndentLevel = this._getIndentLevelForWhitespaceLine(\n\t\t\t\t\t\toffSide,\n\t\t\t\t\t\tdown_aboveContentLineIndent,\n\t\t\t\t\t\tdown_belowContentLineIndent\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (distance === 0) {\n\t\t\t\tinitialIndent = upLineIndentLevel;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (distance === 1) {\n\t\t\t\tif (\n\t\t\t\t\tdownLineNumber <= lineCount &&\n\t\t\t\t\tdownLineIndentLevel >= 0 &&\n\t\t\t\t\tinitialIndent + 1 === downLineIndentLevel\n\t\t\t\t) {\n\t\t\t\t\t// This is the beginning of a scope, we have special handling here, since we want the\n\t\t\t\t\t// child scope indent to be active, not the parent scope\n\t\t\t\t\tgoUp = false;\n\t\t\t\t\tstartLineNumber = downLineNumber;\n\t\t\t\t\tendLineNumber = downLineNumber;\n\t\t\t\t\tindent = downLineIndentLevel;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tupLineNumber >= 1 &&\n\t\t\t\t\tupLineIndentLevel >= 0 &&\n\t\t\t\t\tupLineIndentLevel - 1 === initialIndent\n\t\t\t\t) {\n\t\t\t\t\t// This is the end of a scope, just like above\n\t\t\t\t\tgoDown = false;\n\t\t\t\t\tstartLineNumber = upLineNumber;\n\t\t\t\t\tendLineNumber = upLineNumber;\n\t\t\t\t\tindent = upLineIndentLevel;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tstartLineNumber = lineNumber;\n\t\t\t\tendLineNumber = lineNumber;\n\t\t\t\tindent = initialIndent;\n\t\t\t\tif (indent === 0) {\n\t\t\t\t\t// No need to continue\n\t\t\t\t\treturn { startLineNumber, endLineNumber, indent };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (goUp) {\n\t\t\t\tif (upLineIndentLevel >= indent) {\n\t\t\t\t\tstartLineNumber = upLineNumber;\n\t\t\t\t} else {\n\t\t\t\t\tgoUp = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (goDown) {\n\t\t\t\tif (downLineIndentLevel >= indent) {\n\t\t\t\t\tendLineNumber = downLineNumber;\n\t\t\t\t} else {\n\t\t\t\t\tgoDown = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { startLineNumber, endLineNumber, indent };\n\t}\n\n\tpublic getLinesBracketGuides(\n\t\tstartLineNumber: number,\n\t\tendLineNumber: number,\n\t\tactivePosition: IPosition | null,\n\t\toptions: BracketGuideOptions\n\t): IndentGuide[][] {\n\t\tconst result: IndentGuide[][] = [];\n\t\tconst bracketPairs =\n\t\t\tthis.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(\n\t\t\t\tnew Range(\n\t\t\t\t\tstartLineNumber,\n\t\t\t\t\t1,\n\t\t\t\t\tendLineNumber,\n\t\t\t\t\tthis.textModel.getLineMaxColumn(endLineNumber)\n\t\t\t\t)\n\t\t\t);\n\n\t\tlet activeBracketPairRange: Range | undefined = undefined;\n\t\tif (activePosition && bracketPairs.length > 0) {\n\t\t\tconst bracketsContainingActivePosition =\n\t\t\t\tstartLineNumber <= activePosition.lineNumber &&\n\t\t\t\t\tactivePosition.lineNumber <= endLineNumber\n\t\t\t\t\t? // Does active position intersect with the view port? -> Intersect bracket pairs with activePosition\n\t\t\t\t\tbracketPairs.filter((bp) =>\n\t\t\t\t\t\tRange.strictContainsPosition(bp.range, activePosition)\n\t\t\t\t\t)\n\t\t\t\t\t: this.textModel.bracketPairs.getBracketPairsInRange(\n\t\t\t\t\t\tRange.fromPositions(activePosition)\n\t\t\t\t\t);\n\n\t\t\tactiveBracketPairRange = findLast(\n\t\t\t\tbracketsContainingActivePosition,\n\t\t\t\t/* Exclude single line bracket pairs for cases such as\n\t\t\t\t * ```\n\t\t\t\t * function test() {\n\t\t\t\t * \t\tif (true) { | }\n\t\t\t\t * }\n\t\t\t\t * ```\n\t\t\t\t */\n\t\t\t\t(i) => i.range.startLineNumber !== i.range.endLineNumber\n\t\t\t)?.range;\n\t\t}\n\n\t\tconst queue = new ArrayQueue(bracketPairs);\n\t\t/** Indexed by nesting level */\n\t\tconst activeGuides = new Array<{\n\t\t\tnestingLevel: number;\n\t\t\tguideVisibleColumn: number;\n\t\t\tstart: Position;\n\t\t\tvisibleStartColumn: number;\n\t\t\tend: Position;\n\t\t\tvisibleEndColumn: number;\n\t\t\tbracketPair: BracketPairInfo;\n\t\t\trenderHorizontalEndLineAtTheBottom: boolean;\n\t\t} | null>();\n\t\tconst nextGuides = new Array<IndentGuide>();\n\t\tconst colorProvider = new BracketPairGuidesClassNames();\n\n\t\tfor (\n\t\t\tlet lineNumber = startLineNumber;\n\t\t\tlineNumber <= endLineNumber;\n\t\t\tlineNumber++\n\t\t) {\n\t\t\tlet guides = new Array<IndentGuide>();\n\t\t\tif (nextGuides.length > 0) {\n\t\t\t\tguides = guides.concat(nextGuides);\n\t\t\t\tnextGuides.length = 0;\n\t\t\t}\n\t\t\tresult.push(guides);\n\n\t\t\t// Update activeGuides\n\t\t\tfor (const pair of queue.takeWhile(\n\t\t\t\t(b) => b.openingBracketRange.startLineNumber <= lineNumber\n\t\t\t) || []) {\n\t\t\t\tif (pair.range.startLineNumber === pair.range.endLineNumber) {\n\t\t\t\t\t// ignore single line brackets\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst guideVisibleColumn = Math.min(\n\t\t\t\t\tthis.getVisibleColumnFromPosition(\n\t\t\t\t\t\tpair.openingBracketRange.getStartPosition()\n\t\t\t\t\t),\n\t\t\t\t\tthis.getVisibleColumnFromPosition(\n\t\t\t\t\t\tpair.closingBracketRange?.getStartPosition() ??\n\t\t\t\t\t\tpair.range.getEndPosition()\n\t\t\t\t\t),\n\t\t\t\t\tpair.minVisibleColumnIndentation + 1\n\t\t\t\t);\n\t\t\t\tlet renderHorizontalEndLineAtTheBottom = false;\n\t\t\t\tif (pair.closingBracketRange) {\n\t\t\t\t\tconst firstNonWsIndex = strings.firstNonWhitespaceIndex(\n\t\t\t\t\t\tthis.textModel.getLineContent(\n\t\t\t\t\t\t\tpair.closingBracketRange.startLineNumber\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tif (firstNonWsIndex < pair.closingBracketRange.startColumn - 1) {\n\t\t\t\t\t\trenderHorizontalEndLineAtTheBottom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst start = pair.openingBracketRange.getStartPosition();\n\t\t\t\tconst end =\n\t\t\t\t\tpair.closingBracketRange?.getStartPosition() ??\n\t\t\t\t\tpair.range.getEndPosition();\n\n\t\t\t\tif (pair.closingBracketRange === undefined) {\n\t\t\t\t\t// Don't show guides for bracket pairs that are not balanced.\n\t\t\t\t\t// See #135125.\n\t\t\t\t\tactiveGuides[pair.nestingLevel] = null;\n\t\t\t\t} else {\n\t\t\t\t\tactiveGuides[pair.nestingLevel] = {\n\t\t\t\t\t\tnestingLevel: pair.nestingLevel,\n\t\t\t\t\t\tguideVisibleColumn,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\tvisibleStartColumn: this.getVisibleColumnFromPosition(start),\n\t\t\t\t\t\tend,\n\t\t\t\t\t\tvisibleEndColumn: this.getVisibleColumnFromPosition(end),\n\t\t\t\t\t\tbracketPair: pair,\n\t\t\t\t\t\trenderHorizontalEndLineAtTheBottom,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const line of activeGuides) {\n\t\t\t\tif (!line) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst isActive =\n\t\t\t\t\tactiveBracketPairRange &&\n\t\t\t\t\tline.bracketPair.range.equalsRange(activeBracketPairRange);\n\n\t\t\t\tconst className =\n\t\t\t\t\tcolorProvider.getInlineClassNameOfLevel(line.nestingLevel) +\n\t\t\t\t\t(options.highlightActive && isActive\n\t\t\t\t\t\t? ' ' + colorProvider.activeClassName\n\t\t\t\t\t\t: '');\n\n\t\t\t\tif (\n\t\t\t\t\t(isActive &&\n\t\t\t\t\t\toptions.horizontalGuides !==\n\t\t\t\t\t\tHorizontalGuidesState.Disabled) ||\n\t\t\t\t\t(options.includeInactive &&\n\t\t\t\t\t\toptions.horizontalGuides === HorizontalGuidesState.Enabled)\n\t\t\t\t) {\n\t\t\t\t\tif (line.start.lineNumber === lineNumber) {\n\t\t\t\t\t\tif (line.guideVisibleColumn < line.visibleStartColumn) {\n\t\t\t\t\t\t\tguides.push(\n\t\t\t\t\t\t\t\tnew IndentGuide(\n\t\t\t\t\t\t\t\t\tline.guideVisibleColumn,\n\t\t\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t\t\tnew IndentGuideHorizontalLine(false, line.start.column)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (line.end.lineNumber === lineNumber + 1) {\n\t\t\t\t\t\t// The next line might have horizontal guides.\n\t\t\t\t\t\t// However, the next line might also have a new bracket pair with the same indentation,\n\t\t\t\t\t\t// so the current bracket pair might get replaced. That's why we push the guide to nextGuides one line ahead.\n\t\t\t\t\t\tif (line.guideVisibleColumn < line.visibleEndColumn) {\n\t\t\t\t\t\t\tnextGuides.push(\n\t\t\t\t\t\t\t\tnew IndentGuide(\n\t\t\t\t\t\t\t\t\tline.guideVisibleColumn,\n\t\t\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t\t\tnew IndentGuideHorizontalLine(\n\t\t\t\t\t\t\t\t\t\t!line.renderHorizontalEndLineAtTheBottom,\n\t\t\t\t\t\t\t\t\t\tline.end.column\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet lastVisibleColumnCount = Number.MAX_SAFE_INTEGER;\n\t\t\t// Going backwards, so the last guide potentially replaces others\n\t\t\tfor (let i = activeGuides.length - 1; i >= 0; i--) {\n\t\t\t\tconst line = activeGuides[i];\n\t\t\t\tif (!line) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst isActive =\n\t\t\t\t\toptions.highlightActive &&\n\t\t\t\t\tactiveBracketPairRange &&\n\t\t\t\t\tline.bracketPair.range.equalsRange(activeBracketPairRange);\n\n\t\t\t\tconst className =\n\t\t\t\t\tcolorProvider.getInlineClassNameOfLevel(line.nestingLevel) +\n\t\t\t\t\t(isActive ? ' ' + colorProvider.activeClassName : '');\n\n\t\t\t\tif (isActive || options.includeInactive) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tline.renderHorizontalEndLineAtTheBottom &&\n\t\t\t\t\t\tline.end.lineNumber === lineNumber + 1\n\t\t\t\t\t) {\n\t\t\t\t\t\tnextGuides.push(\n\t\t\t\t\t\t\tnew IndentGuide(line.guideVisibleColumn, className, null)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tline.end.lineNumber <= lineNumber ||\n\t\t\t\t\tline.start.lineNumber >= lineNumber\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (line.guideVisibleColumn >= lastVisibleColumnCount && !isActive) {\n\t\t\t\t\t// Don't render a guide on top of an existing guide, unless it is active.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlastVisibleColumnCount = line.guideVisibleColumn;\n\n\t\t\t\tif (isActive || options.includeInactive) {\n\t\t\t\t\tguides.push(\n\t\t\t\t\t\tnew IndentGuide(line.guideVisibleColumn, className, null)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tguides.sort((a, b) => a.visibleColumn - b.visibleColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate getVisibleColumnFromPosition(position: Position): number {\n\t\treturn (\n\t\t\tCursorColumns.visibleColumnFromColumn(\n\t\t\t\tthis.textModel.getLineContent(position.lineNumber),\n\t\t\t\tposition.column,\n\t\t\t\tthis.textModel.getOptions().tabSize\n\t\t\t) + 1\n\t\t);\n\t}\n\n\tpublic getLinesIndentGuides(\n\t\tstartLineNumber: number,\n\t\tendLineNumber: number\n\t): number[] {\n\t\tthis.assertNotDisposed();\n\t\tconst lineCount = this.textModel.getLineCount();\n\n\t\tif (startLineNumber < 1 || startLineNumber > lineCount) {\n\t\t\tthrow new Error('Illegal value for startLineNumber');\n\t\t}\n\t\tif (endLineNumber < 1 || endLineNumber > lineCount) {\n\t\t\tthrow new Error('Illegal value for endLineNumber');\n\t\t}\n\n\t\tconst options = this.textModel.getOptions();\n\t\tconst foldingRules = this.getLanguageConfiguration(\n\t\t\tthis.textModel.getLanguageId()\n\t\t).foldingRules;\n\t\tconst offSide = Boolean(foldingRules && foldingRules.offSide);\n\n\t\tconst result: number[] = new Array<number>(\n\t\t\tendLineNumber - startLineNumber + 1\n\t\t);\n\n\t\tlet aboveContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet aboveContentLineIndent = -1;\n\n\t\tlet belowContentLineIndex =\n\t\t\t-2; /* -2 is a marker for not having computed it */\n\t\tlet belowContentLineIndent = -1;\n\n\t\tfor (\n\t\t\tlet lineNumber = startLineNumber;\n\t\t\tlineNumber <= endLineNumber;\n\t\t\tlineNumber++\n\t\t) {\n\t\t\tconst resultIndex = lineNumber - startLineNumber;\n\n\t\t\tconst currentIndent = this._computeIndentLevel(lineNumber - 1);\n\t\t\tif (currentIndent >= 0) {\n\t\t\t\t// This line has content (besides whitespace)\n\t\t\t\t// Use the line's indent\n\t\t\t\taboveContentLineIndex = lineNumber - 1;\n\t\t\t\taboveContentLineIndent = currentIndent;\n\t\t\t\tresult[resultIndex] = Math.ceil(currentIndent / options.indentSize);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (aboveContentLineIndex === -2) {\n\t\t\t\taboveContentLineIndex = -1;\n\t\t\t\taboveContentLineIndent = -1;\n\n\t\t\t\t// must find previous line with content\n\t\t\t\tfor (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\taboveContentLineIndex = lineIndex;\n\t\t\t\t\t\taboveContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tbelowContentLineIndex !== -1 &&\n\t\t\t\t(belowContentLineIndex === -2 || belowContentLineIndex < lineNumber - 1)\n\t\t\t) {\n\t\t\t\tbelowContentLineIndex = -1;\n\t\t\t\tbelowContentLineIndent = -1;\n\n\t\t\t\t// must find next line with content\n\t\t\t\tfor (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) {\n\t\t\t\t\tconst indent = this._computeIndentLevel(lineIndex);\n\t\t\t\t\tif (indent >= 0) {\n\t\t\t\t\t\tbelowContentLineIndex = lineIndex;\n\t\t\t\t\t\tbelowContentLineIndent = indent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult[resultIndex] = this._getIndentLevelForWhitespaceLine(\n\t\t\t\toffSide,\n\t\t\t\taboveContentLineIndent,\n\t\t\t\tbelowContentLineIndent\n\t\t\t);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _getIndentLevelForWhitespaceLine(\n\t\toffSide: boolean,\n\t\taboveContentLineIndent: number,\n\t\tbelowContentLineIndent: number\n\t): number {\n\t\tconst options = this.textModel.getOptions();\n\n\t\tif (aboveContentLineIndent === -1 || belowContentLineIndent === -1) {\n\t\t\t// At the top or bottom of the file\n\t\t\treturn 0;\n\t\t} else if (aboveContentLineIndent < belowContentLineIndent) {\n\t\t\t// we are inside the region above\n\t\t\treturn 1 + Math.floor(aboveContentLineIndent / options.indentSize);\n\t\t} else if (aboveContentLineIndent === belowContentLineIndent) {\n\t\t\t// we are in between two regions\n\t\t\treturn Math.ceil(belowContentLineIndent / options.indentSize);\n\t\t} else {\n\t\t\tif (offSide) {\n\t\t\t\t// same level as region below\n\t\t\t\treturn Math.ceil(belowContentLineIndent / options.indentSize);\n\t\t\t} else {\n\t\t\t\t// we are inside the region that ends below\n\t\t\t\treturn 1 + Math.floor(belowContentLineIndent / options.indentSize);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class BracketPairGuidesClassNames {\n\tpublic readonly activeClassName = 'indent-active';\n\n\tgetInlineClassNameOfLevel(level: number): string {\n\t\t// To support a dynamic amount of colors up to 6 colors,\n\t\t// we use a number that is a lcm of all numbers from 1 to 6.\n\t\treturn `bracket-indent-guide lvl-${level % 30}`;\n\t}\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 { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ColorId, ITokenizationRegistry, ITokenizationSupport, ITokenizationSupportChangedEvent, ITokenizationSupportFactory } from 'vs/editor/common/languages';\n\nexport class TokenizationRegistry implements ITokenizationRegistry {\n\n\tprivate readonly _map = new Map<string, ITokenizationSupport>();\n\tprivate readonly _factories = new Map<string, TokenizationSupportFactoryData>();\n\n\tprivate readonly _onDidChange = new Emitter<ITokenizationSupportChangedEvent>();\n\tpublic readonly onDidChange: Event<ITokenizationSupportChangedEvent> = this._onDidChange.event;\n\n\tprivate _colorMap: Color[] | null;\n\n\tconstructor() {\n\t\tthis._colorMap = null;\n\t}\n\n\tpublic fire(languages: string[]): void {\n\t\tthis._onDidChange.fire({\n\t\t\tchangedLanguages: languages,\n\t\t\tchangedColorMap: false\n\t\t});\n\t}\n\n\tpublic register(language: string, support: ITokenizationSupport) {\n\t\tthis._map.set(language, support);\n\t\tthis.fire([language]);\n\t\treturn toDisposable(() => {\n\t\t\tif (this._map.get(language) !== support) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._map.delete(language);\n\t\t\tthis.fire([language]);\n\t\t});\n\t}\n\n\tpublic registerFactory(languageId: string, factory: ITokenizationSupportFactory): IDisposable {\n\t\tthis._factories.get(languageId)?.dispose();\n\t\tconst myData = new TokenizationSupportFactoryData(this, languageId, factory);\n\t\tthis._factories.set(languageId, myData);\n\t\treturn toDisposable(() => {\n\t\t\tconst v = this._factories.get(languageId);\n\t\t\tif (!v || v !== myData) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._factories.delete(languageId);\n\t\t\tv.dispose();\n\t\t});\n\t}\n\n\tpublic async getOrCreate(languageId: string): Promise<ITokenizationSupport | null> {\n\t\t// check first if the support is already set\n\t\tconst tokenizationSupport = this.get(languageId);\n\t\tif (tokenizationSupport) {\n\t\t\treturn tokenizationSupport;\n\t\t}\n\n\t\tconst factory = this._factories.get(languageId);\n\t\tif (!factory || factory.isResolved) {\n\t\t\t// no factory or factory.resolve already finished\n\t\t\treturn null;\n\t\t}\n\n\t\tawait factory.resolve();\n\n\t\treturn this.get(languageId);\n\t}\n\n\tpublic get(language: string): ITokenizationSupport | null {\n\t\treturn (this._map.get(language) || null);\n\t}\n\n\tpublic isResolved(languageId: string): boolean {\n\t\tconst tokenizationSupport = this.get(languageId);\n\t\tif (tokenizationSupport) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst factory = this._factories.get(languageId);\n\t\tif (!factory || factory.isResolved) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic setColorMap(colorMap: Color[]): void {\n\t\tthis._colorMap = colorMap;\n\t\tthis._onDidChange.fire({\n\t\t\tchangedLanguages: Array.from(this._map.keys()),\n\t\t\tchangedColorMap: true\n\t\t});\n\t}\n\n\tpublic getColorMap(): Color[] | null {\n\t\treturn this._colorMap;\n\t}\n\n\tpublic getDefaultBackground(): Color | null {\n\t\tif (this._colorMap && this._colorMap.length > ColorId.DefaultBackground) {\n\t\t\treturn this._colorMap[ColorId.DefaultBackground];\n\t\t}\n\t\treturn null;\n\t}\n}\n\nclass TokenizationSupportFactoryData extends Disposable {\n\n\tprivate _isDisposed: boolean = false;\n\tprivate _resolvePromise: Promise<void> | null = null;\n\tprivate _isResolved: boolean = false;\n\n\tpublic get isResolved(): boolean {\n\t\treturn this._isResolved;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _registry: TokenizationRegistry,\n\t\tprivate readonly _languageId: string,\n\t\tprivate readonly _factory: ITokenizationSupportFactory,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tsuper.dispose();\n\t}\n\n\tpublic async resolve(): Promise<void> {\n\t\tif (!this._resolvePromise) {\n\t\t\tthis._resolvePromise = this._create();\n\t\t}\n\t\treturn this._resolvePromise;\n\t}\n\n\tprivate async _create(): Promise<void> {\n\t\tconst value = await Promise.resolve(this._factory.createTokenizationSupport());\n\t\tthis._isResolved = true;\n\t\tif (value && !this._isDisposed) {\n\t\t\tthis._register(this._registry.register(this._languageId, value));\n\t\t}\n\t}\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Color } from 'vs/base/common/color';\nimport { Event } from 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport * as model from 'vs/editor/common/model';\nimport { TokenizationRegistry as TokenizationRegistryImpl } from 'vs/editor/common/tokenizationRegistry';\nimport { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';\nimport { IMarkerData } from 'vs/platform/markers/common/markers';\nimport { Codicon, CSSIcon } from 'vs/base/common/codicons';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\n\n/**\n * Open ended enum at runtime\n * @internal\n */\nexport const enum LanguageId {\n\tNull = 0,\n\tPlainText = 1\n}\n\n/**\n * A font style. Values are 2^x such that a bit mask can be used.\n * @internal\n */\nexport const enum FontStyle {\n\tNotSet = -1,\n\tNone = 0,\n\tItalic = 1,\n\tBold = 2,\n\tUnderline = 4,\n\tStrikethrough = 8,\n}\n\n/**\n * Open ended enum at runtime\n * @internal\n */\nexport const enum ColorId {\n\tNone = 0,\n\tDefaultForeground = 1,\n\tDefaultBackground = 2\n}\n\n/**\n * A standard token type.\n * @internal\n */\nexport const enum StandardTokenType {\n\tOther = 0,\n\tComment = 1,\n\tString = 2,\n\tRegEx = 3\n}\n\n/**\n * Helpers to manage the \"collapsed\" metadata of an entire StackElement stack.\n * The following assumptions have been made:\n * - languageId < 256 => needs 8 bits\n * - unique color count < 512 => needs 9 bits\n *\n * The binary format is:\n * - -------------------------------------------\n * 3322 2222 2222 1111 1111 1100 0000 0000\n * 1098 7654 3210 9876 5432 1098 7654 3210\n * - -------------------------------------------\n * xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx\n * bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL\n * - -------------------------------------------\n * - L = LanguageId (8 bits)\n * - T = StandardTokenType (2 bits)\n * - F = FontStyle (4 bits)\n * - f = foreground color (9 bits)\n * - b = background color (9 bits)\n *\n * @internal\n */\nexport const enum MetadataConsts {\n\tLANGUAGEID_MASK = 0b00000000000000000000000011111111,\n\tTOKEN_TYPE_MASK = 0b00000000000000000000001100000000,\n\tFONT_STYLE_MASK = 0b00000000000000000011110000000000,\n\tFOREGROUND_MASK = 0b00000000011111111100000000000000,\n\tBACKGROUND_MASK = 0b11111111100000000000000000000000,\n\n\tITALIC_MASK = 0b00000000000000000000010000000000,\n\tBOLD_MASK = 0b00000000000000000000100000000000,\n\tUNDERLINE_MASK = 0b00000000000000000001000000000000,\n\tSTRIKETHROUGH_MASK = 0b00000000000000000010000000000000,\n\n\t// Semantic tokens cannot set the language id, so we can\n\t// use the first 8 bits for control purposes\n\tSEMANTIC_USE_ITALIC = 0b00000000000000000000000000000001,\n\tSEMANTIC_USE_BOLD = 0b00000000000000000000000000000010,\n\tSEMANTIC_USE_UNDERLINE = 0b00000000000000000000000000000100,\n\tSEMANTIC_USE_STRIKETHROUGH = 0b00000000000000000000000000001000,\n\tSEMANTIC_USE_FOREGROUND = 0b00000000000000000000000000010000,\n\tSEMANTIC_USE_BACKGROUND = 0b00000000000000000000000000100000,\n\n\tLANGUAGEID_OFFSET = 0,\n\tTOKEN_TYPE_OFFSET = 8,\n\tFONT_STYLE_OFFSET = 10,\n\tFOREGROUND_OFFSET = 14,\n\tBACKGROUND_OFFSET = 23\n}\n\n/**\n * @internal\n */\nexport class TokenMetadata {\n\n\tpublic static getLanguageId(metadata: number): LanguageId {\n\t\treturn (metadata & MetadataConsts.LANGUAGEID_MASK) >>> MetadataConsts.LANGUAGEID_OFFSET;\n\t}\n\n\tpublic static getTokenType(metadata: number): StandardTokenType {\n\t\treturn (metadata & MetadataConsts.TOKEN_TYPE_MASK) >>> MetadataConsts.TOKEN_TYPE_OFFSET;\n\t}\n\n\tpublic static getFontStyle(metadata: number): FontStyle {\n\t\treturn (metadata & MetadataConsts.FONT_STYLE_MASK) >>> MetadataConsts.FONT_STYLE_OFFSET;\n\t}\n\n\tpublic static getForeground(metadata: number): ColorId {\n\t\treturn (metadata & MetadataConsts.FOREGROUND_MASK) >>> MetadataConsts.FOREGROUND_OFFSET;\n\t}\n\n\tpublic static getBackground(metadata: number): ColorId {\n\t\treturn (metadata & MetadataConsts.BACKGROUND_MASK) >>> MetadataConsts.BACKGROUND_OFFSET;\n\t}\n\n\tpublic static getClassNameFromMetadata(metadata: number): string {\n\t\tconst foreground = this.getForeground(metadata);\n\t\tlet className = 'mtk' + foreground;\n\n\t\tconst fontStyle = this.getFontStyle(metadata);\n\t\tif (fontStyle & FontStyle.Italic) {\n\t\t\tclassName += ' mtki';\n\t\t}\n\t\tif (fontStyle & FontStyle.Bold) {\n\t\t\tclassName += ' mtkb';\n\t\t}\n\t\tif (fontStyle & FontStyle.Underline) {\n\t\t\tclassName += ' mtku';\n\t\t}\n\t\tif (fontStyle & FontStyle.Strikethrough) {\n\t\t\tclassName += ' mtks';\n\t\t}\n\n\t\treturn className;\n\t}\n\n\tpublic static getInlineStyleFromMetadata(metadata: number, colorMap: string[]): string {\n\t\tconst foreground = this.getForeground(metadata);\n\t\tconst fontStyle = this.getFontStyle(metadata);\n\n\t\tlet result = `color: ${colorMap[foreground]};`;\n\t\tif (fontStyle & FontStyle.Italic) {\n\t\t\tresult += 'font-style: italic;';\n\t\t}\n\t\tif (fontStyle & FontStyle.Bold) {\n\t\t\tresult += 'font-weight: bold;';\n\t\t}\n\t\tlet textDecoration = '';\n\t\tif (fontStyle & FontStyle.Underline) {\n\t\t\ttextDecoration += ' underline';\n\t\t}\n\t\tif (fontStyle & FontStyle.Strikethrough) {\n\t\t\ttextDecoration += ' line-through';\n\t\t}\n\t\tif (textDecoration) {\n\t\t\tresult += `text-decoration:${textDecoration};`;\n\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static getPresentationFromMetadata(metadata: number): ITokenPresentation {\n\t\tconst foreground = this.getForeground(metadata);\n\t\tconst fontStyle = this.getFontStyle(metadata);\n\n\t\treturn {\n\t\t\tforeground: foreground,\n\t\t\titalic: Boolean(fontStyle & FontStyle.Italic),\n\t\t\tbold: Boolean(fontStyle & FontStyle.Bold),\n\t\t\tunderline: Boolean(fontStyle & FontStyle.Underline),\n\t\t\tstrikethrough: Boolean(fontStyle & FontStyle.Strikethrough),\n\t\t};\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ITokenPresentation {\n\tforeground: ColorId;\n\titalic: boolean;\n\tbold: boolean;\n\tunderline: boolean;\n\tstrikethrough: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ILanguageIdCodec {\n\tencodeLanguageId(languageId: string): LanguageId;\n\tdecodeLanguageId(languageId: LanguageId): string;\n}\n\nexport class Token {\n\t_tokenBrand: void = undefined;\n\n\tpublic readonly offset: number;\n\tpublic readonly type: string;\n\tpublic readonly language: string;\n\n\tconstructor(offset: number, type: string, language: string) {\n\t\tthis.offset = offset;\n\t\tthis.type = type;\n\t\tthis.language = language;\n\t}\n\n\tpublic toString(): string {\n\t\treturn '(' + this.offset + ', ' + this.type + ')';\n\t}\n}\n\n/**\n * @internal\n */\nexport class TokenizationResult {\n\t_tokenizationResultBrand: void = undefined;\n\n\tpublic readonly tokens: Token[];\n\tpublic readonly endState: IState;\n\n\tconstructor(tokens: Token[], endState: IState) {\n\t\tthis.tokens = tokens;\n\t\tthis.endState = endState;\n\t}\n}\n\n/**\n * @internal\n */\nexport class EncodedTokenizationResult {\n\t_encodedTokenizationResultBrand: void = undefined;\n\n\t/**\n\t * The tokens in binary format. Each token occupies two array indices. For token i:\n\t * - at offset 2*i => startIndex\n\t * - at offset 2*i + 1 => metadata\n\t *\n\t */\n\tpublic readonly tokens: Uint32Array;\n\tpublic readonly endState: IState;\n\n\tconstructor(tokens: Uint32Array, endState: IState) {\n\t\tthis.tokens = tokens;\n\t\tthis.endState = endState;\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationSupport {\n\n\tgetInitialState(): IState;\n\n\ttokenize(line: string, hasEOL: boolean, state: IState): TokenizationResult;\n\n\ttokenizeEncoded(line: string, hasEOL: boolean, state: IState): EncodedTokenizationResult;\n}\n\n/**\n * The state of the tokenizer between two lines.\n * It is useful to store flags such as in multiline comment, etc.\n * The model will clone the previous line's state and pass it in to tokenize the next line.\n */\nexport interface IState {\n\tclone(): IState;\n\tequals(other: IState): boolean;\n}\n\n/**\n * A provider result represents the values a provider, like the {@link HoverProvider},\n * may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves\n * to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a\n * thenable.\n */\nexport type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;\n\n/**\n * A hover represents additional information for a symbol or word. Hovers are\n * rendered in a tooltip-like widget.\n */\nexport interface Hover {\n\t/**\n\t * The contents of this hover.\n\t */\n\tcontents: IMarkdownString[];\n\n\t/**\n\t * The range to which this hover applies. When missing, the\n\t * editor will use the range at the current position or the\n\t * current position itself.\n\t */\n\trange?: IRange;\n}\n\n/**\n * The hover provider interface defines the contract between extensions and\n * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.\n */\nexport interface HoverProvider {\n\t/**\n\t * Provide a hover for the given position and document. Multiple hovers at the same\n\t * position will be merged by the editor. A hover can have a range which defaults\n\t * to the word range at the position when omitted.\n\t */\n\tprovideHover(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<Hover>;\n}\n\nexport const enum CompletionItemKind {\n\tMethod,\n\tFunction,\n\tConstructor,\n\tField,\n\tVariable,\n\tClass,\n\tStruct,\n\tInterface,\n\tModule,\n\tProperty,\n\tEvent,\n\tOperator,\n\tUnit,\n\tValue,\n\tConstant,\n\tEnum,\n\tEnumMember,\n\tKeyword,\n\tText,\n\tColor,\n\tFile,\n\tReference,\n\tCustomcolor,\n\tFolder,\n\tTypeParameter,\n\tUser,\n\tIssue,\n\tSnippet, // <- highest value (used for compare!)\n}\n\n/**\n * @internal\n */\nexport namespace CompletionItemKinds {\n\n\tconst byKind = new Map<CompletionItemKind, CSSIcon>();\n\tbyKind.set(CompletionItemKind.Method, Codicon.symbolMethod);\n\tbyKind.set(CompletionItemKind.Function, Codicon.symbolFunction);\n\tbyKind.set(CompletionItemKind.Constructor, Codicon.symbolConstructor);\n\tbyKind.set(CompletionItemKind.Field, Codicon.symbolField);\n\tbyKind.set(CompletionItemKind.Variable, Codicon.symbolVariable);\n\tbyKind.set(CompletionItemKind.Class, Codicon.symbolClass);\n\tbyKind.set(CompletionItemKind.Struct, Codicon.symbolStruct);\n\tbyKind.set(CompletionItemKind.Interface, Codicon.symbolInterface);\n\tbyKind.set(CompletionItemKind.Module, Codicon.symbolModule);\n\tbyKind.set(CompletionItemKind.Property, Codicon.symbolProperty);\n\tbyKind.set(CompletionItemKind.Event, Codicon.symbolEvent);\n\tbyKind.set(CompletionItemKind.Operator, Codicon.symbolOperator);\n\tbyKind.set(CompletionItemKind.Unit, Codicon.symbolUnit);\n\tbyKind.set(CompletionItemKind.Value, Codicon.symbolValue);\n\tbyKind.set(CompletionItemKind.Enum, Codicon.symbolEnum);\n\tbyKind.set(CompletionItemKind.Constant, Codicon.symbolConstant);\n\tbyKind.set(CompletionItemKind.Enum, Codicon.symbolEnum);\n\tbyKind.set(CompletionItemKind.EnumMember, Codicon.symbolEnumMember);\n\tbyKind.set(CompletionItemKind.Keyword, Codicon.symbolKeyword);\n\tbyKind.set(CompletionItemKind.Snippet, Codicon.symbolSnippet);\n\tbyKind.set(CompletionItemKind.Text, Codicon.symbolText);\n\tbyKind.set(CompletionItemKind.Color, Codicon.symbolColor);\n\tbyKind.set(CompletionItemKind.File, Codicon.symbolFile);\n\tbyKind.set(CompletionItemKind.Reference, Codicon.symbolReference);\n\tbyKind.set(CompletionItemKind.Customcolor, Codicon.symbolCustomColor);\n\tbyKind.set(CompletionItemKind.Folder, Codicon.symbolFolder);\n\tbyKind.set(CompletionItemKind.TypeParameter, Codicon.symbolTypeParameter);\n\tbyKind.set(CompletionItemKind.User, Codicon.account);\n\tbyKind.set(CompletionItemKind.Issue, Codicon.issues);\n\n\t/**\n\t * @internal\n\t */\n\texport function toIcon(kind: CompletionItemKind): CSSIcon {\n\t\tlet codicon = byKind.get(kind);\n\t\tif (!codicon) {\n\t\t\tconsole.info('No codicon found for CompletionItemKind ' + kind);\n\t\t\tcodicon = Codicon.symbolProperty;\n\t\t}\n\t\treturn codicon;\n\t}\n\n\tconst data = new Map<string, CompletionItemKind>();\n\tdata.set('method', CompletionItemKind.Method);\n\tdata.set('function', CompletionItemKind.Function);\n\tdata.set('constructor', <any>CompletionItemKind.Constructor);\n\tdata.set('field', CompletionItemKind.Field);\n\tdata.set('variable', CompletionItemKind.Variable);\n\tdata.set('class', CompletionItemKind.Class);\n\tdata.set('struct', CompletionItemKind.Struct);\n\tdata.set('interface', CompletionItemKind.Interface);\n\tdata.set('module', CompletionItemKind.Module);\n\tdata.set('property', CompletionItemKind.Property);\n\tdata.set('event', CompletionItemKind.Event);\n\tdata.set('operator', CompletionItemKind.Operator);\n\tdata.set('unit', CompletionItemKind.Unit);\n\tdata.set('value', CompletionItemKind.Value);\n\tdata.set('constant', CompletionItemKind.Constant);\n\tdata.set('enum', CompletionItemKind.Enum);\n\tdata.set('enum-member', CompletionItemKind.EnumMember);\n\tdata.set('enumMember', CompletionItemKind.EnumMember);\n\tdata.set('keyword', CompletionItemKind.Keyword);\n\tdata.set('snippet', CompletionItemKind.Snippet);\n\tdata.set('text', CompletionItemKind.Text);\n\tdata.set('color', CompletionItemKind.Color);\n\tdata.set('file', CompletionItemKind.File);\n\tdata.set('reference', CompletionItemKind.Reference);\n\tdata.set('customcolor', CompletionItemKind.Customcolor);\n\tdata.set('folder', CompletionItemKind.Folder);\n\tdata.set('type-parameter', CompletionItemKind.TypeParameter);\n\tdata.set('typeParameter', CompletionItemKind.TypeParameter);\n\tdata.set('account', CompletionItemKind.User);\n\tdata.set('issue', CompletionItemKind.Issue);\n\n\t/**\n\t * @internal\n\t */\n\texport function fromString(value: string): CompletionItemKind;\n\t/**\n\t * @internal\n\t */\n\texport function fromString(value: string, strict: true): CompletionItemKind | undefined;\n\t/**\n\t * @internal\n\t */\n\texport function fromString(value: string, strict?: boolean): CompletionItemKind | undefined {\n\t\tlet res = data.get(value);\n\t\tif (typeof res === 'undefined' && !strict) {\n\t\t\tres = CompletionItemKind.Property;\n\t\t}\n\t\treturn res;\n\t}\n}\n\nexport interface CompletionItemLabel {\n\tlabel: string;\n\tdetail?: string;\n\tdescription?: string;\n}\n\nexport const enum CompletionItemTag {\n\tDeprecated = 1\n}\n\nexport const enum CompletionItemInsertTextRule {\n\t/**\n\t * Adjust whitespace/indentation of multiline insert texts to\n\t * match the current line indentation.\n\t */\n\tKeepWhitespace = 0b001,\n\n\t/**\n\t * `insertText` is a snippet.\n\t */\n\tInsertAsSnippet = 0b100,\n}\n\nexport interface CompletionItemRanges {\n\tinsert: IRange;\n\treplace: IRange;\n}\n\n/**\n * A completion item represents a text snippet that is\n * proposed to complete text that is being typed.\n */\nexport interface CompletionItem {\n\t/**\n\t * The label of this completion item. By default\n\t * this is also the text that is inserted when selecting\n\t * this completion.\n\t */\n\tlabel: string | CompletionItemLabel;\n\t/**\n\t * The kind of this completion item. Based on the kind\n\t * an icon is chosen by the editor.\n\t */\n\tkind: CompletionItemKind;\n\t/**\n\t * A modifier to the `kind` which affect how the item\n\t * is rendered, e.g. Deprecated is rendered with a strikeout\n\t */\n\ttags?: ReadonlyArray<CompletionItemTag>;\n\t/**\n\t * A human-readable string with additional information\n\t * about this item, like type or symbol information.\n\t */\n\tdetail?: string;\n\t/**\n\t * A human-readable string that represents a doc-comment.\n\t */\n\tdocumentation?: string | IMarkdownString;\n\t/**\n\t * A string that should be used when comparing this item\n\t * with other items. When `falsy` the {@link CompletionItem.label label}\n\t * is used.\n\t */\n\tsortText?: string;\n\t/**\n\t * A string that should be used when filtering a set of\n\t * completion items. When `falsy` the {@link CompletionItem.label label}\n\t * is used.\n\t */\n\tfilterText?: string;\n\t/**\n\t * Select this item when showing. *Note* that only one completion item can be selected and\n\t * that the editor decides which item that is. The rule is that the *first* item of those\n\t * that match best is selected.\n\t */\n\tpreselect?: boolean;\n\t/**\n\t * A string or snippet that should be inserted in a document when selecting\n\t * this completion.\n\t */\n\tinsertText: string;\n\t/**\n\t * Additional rules (as bitmask) that should be applied when inserting\n\t * this completion.\n\t */\n\tinsertTextRules?: CompletionItemInsertTextRule;\n\t/**\n\t * A range of text that should be replaced by this completion item.\n\t *\n\t * Defaults to a range from the start of the {@link TextDocument.getWordRangeAtPosition current word} to the\n\t * current position.\n\t *\n\t * *Note:* The range must be a {@link Range.isSingleLine single line} and it must\n\t * {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.\n\t */\n\trange: IRange | CompletionItemRanges;\n\t/**\n\t * An optional set of characters that when pressed while this completion is active will accept it first and\n\t * then type that character. *Note* that all commit characters should have `length=1` and that superfluous\n\t * characters will be ignored.\n\t */\n\tcommitCharacters?: string[];\n\t/**\n\t * An optional array of additional text edits that are applied when\n\t * selecting this completion. Edits must not overlap with the main edit\n\t * nor with themselves.\n\t */\n\tadditionalTextEdits?: ISingleEditOperation[];\n\t/**\n\t * A command that should be run upon acceptance of this item.\n\t */\n\tcommand?: Command;\n}\n\nexport interface CompletionList {\n\tsuggestions: CompletionItem[];\n\tincomplete?: boolean;\n\tdispose?(): void;\n\n\t/**\n\t * @internal\n\t */\n\tduration?: number;\n}\n\n/**\n * How a suggest provider was triggered.\n */\nexport const enum CompletionTriggerKind {\n\tInvoke = 0,\n\tTriggerCharacter = 1,\n\tTriggerForIncompleteCompletions = 2\n}\n/**\n * Contains additional information about the context in which\n * {@link CompletionItemProvider.provideCompletionItems completion provider} is triggered.\n */\nexport interface CompletionContext {\n\t/**\n\t * How the completion was triggered.\n\t */\n\ttriggerKind: CompletionTriggerKind;\n\t/**\n\t * Character that triggered the completion item provider.\n\t *\n\t * `undefined` if provider was not triggered by a character.\n\t */\n\ttriggerCharacter?: string;\n}\n/**\n * The completion item provider interface defines the contract between extensions and\n * the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).\n *\n * When computing *complete* completion items is expensive, providers can optionally implement\n * the `resolveCompletionItem`-function. In that case it is enough to return completion\n * items with a {@link CompletionItem.label label} from the\n * {@link CompletionItemProvider.provideCompletionItems provideCompletionItems}-function. Subsequently,\n * when a completion item is shown in the UI and gains focus this provider is asked to resolve\n * the item, like adding {@link CompletionItem.documentation doc-comment} or {@link CompletionItem.detail details}.\n */\nexport interface CompletionItemProvider {\n\n\t/**\n\t * @internal\n\t */\n\t_debugDisplayName?: string;\n\n\ttriggerCharacters?: string[];\n\t/**\n\t * Provide completion items for the given position and document.\n\t */\n\tprovideCompletionItems(model: model.ITextModel, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionList>;\n\n\t/**\n\t * Given a completion item fill in more data, like {@link CompletionItem.documentation doc-comment}\n\t * or {@link CompletionItem.detail details}.\n\t *\n\t * The editor will only resolve a completion item once.\n\t */\n\tresolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;\n}\n\n/**\n * How an {@link InlineCompletionsProvider inline completion provider} was triggered.\n */\nexport enum InlineCompletionTriggerKind {\n\t/**\n\t * Completion was triggered automatically while editing.\n\t * It is sufficient to return a single completion item in this case.\n\t */\n\tAutomatic = 0,\n\n\t/**\n\t * Completion was triggered explicitly by a user gesture.\n\t * Return multiple completion items to enable cycling through them.\n\t */\n\tExplicit = 1,\n}\n\nexport interface InlineCompletionContext {\n\t/**\n\t * How the completion was triggered.\n\t */\n\treadonly triggerKind: InlineCompletionTriggerKind;\n\n\treadonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;\n}\n\nexport interface SelectedSuggestionInfo {\n\trange: IRange;\n\ttext: string;\n\tisSnippetText: boolean;\n\tcompletionKind: CompletionItemKind;\n}\n\nexport interface InlineCompletion {\n\t/**\n\t * The text to insert.\n\t * If the text contains a line break, the range must end at the end of a line.\n\t * If existing text should be replaced, the existing text must be a prefix of the text to insert.\n\t*/\n\treadonly text: string;\n\n\t/**\n\t * The range to replace.\n\t * Must begin and end on the same line.\n\t*/\n\treadonly range?: IRange;\n\n\treadonly command?: Command;\n\n\t/**\n\t * If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.\n\t * Defaults to `false`.\n\t*/\n\treadonly completeBracketPairs?: boolean;\n}\n\nexport interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {\n\treadonly items: readonly TItem[];\n}\n\nexport interface InlineCompletionsProvider<T extends InlineCompletions = InlineCompletions> {\n\tprovideInlineCompletions(model: model.ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<T>;\n\n\t/**\n\t * Will be called when an item is shown.\n\t*/\n\thandleItemDidShow?(completions: T, item: T['items'][number]): void;\n\n\t/**\n\t * Will be called when a completions list is no longer in use and can be garbage-collected.\n\t*/\n\tfreeInlineCompletions(completions: T): void;\n}\n\nexport interface CodeAction {\n\ttitle: string;\n\tcommand?: Command;\n\tedit?: WorkspaceEdit;\n\tdiagnostics?: IMarkerData[];\n\tkind?: string;\n\tisPreferred?: boolean;\n\tdisabled?: string;\n}\n\n/**\n * @internal\n */\nexport const enum CodeActionTriggerType {\n\tInvoke = 1,\n\tAuto = 2,\n}\n\n/**\n * @internal\n */\nexport interface CodeActionContext {\n\tonly?: string;\n\ttrigger: CodeActionTriggerType;\n}\n\nexport interface CodeActionList extends IDisposable {\n\treadonly actions: ReadonlyArray<CodeAction>;\n}\n\n/**\n * The code action interface defines the contract between extensions and\n * the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.\n * @internal\n */\nexport interface CodeActionProvider {\n\n\t/**\n\t * Provide commands for the given document and range.\n\t */\n\tprovideCodeActions(model: model.ITextModel, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;\n\n\t/**\n\t * Given a code action fill in the edit. Will only invoked when missing.\n\t */\n\tresolveCodeAction?(codeAction: CodeAction, token: CancellationToken): ProviderResult<CodeAction>;\n\n\t/**\n\t * Optional list of CodeActionKinds that this provider returns.\n\t */\n\treadonly providedCodeActionKinds?: ReadonlyArray<string>;\n\n\treadonly documentation?: ReadonlyArray<{ readonly kind: string; readonly command: Command }>;\n\n\t/**\n\t * @internal\n\t */\n\t_getAdditionalMenuItems?(context: CodeActionContext, actions: readonly CodeAction[]): Command[];\n}\n\n/**\n * Represents a parameter of a callable-signature. A parameter can\n * have a label and a doc-comment.\n */\nexport interface ParameterInformation {\n\t/**\n\t * The label of this signature. Will be shown in\n\t * the UI.\n\t */\n\tlabel: string | [number, number];\n\t/**\n\t * The human-readable doc-comment of this signature. Will be shown\n\t * in the UI but can be omitted.\n\t */\n\tdocumentation?: string | IMarkdownString;\n}\n/**\n * Represents the signature of something callable. A signature\n * can have a label, like a function-name, a doc-comment, and\n * a set of parameters.\n */\nexport interface SignatureInformation {\n\t/**\n\t * The label of this signature. Will be shown in\n\t * the UI.\n\t */\n\tlabel: string;\n\t/**\n\t * The human-readable doc-comment of this signature. Will be shown\n\t * in the UI but can be omitted.\n\t */\n\tdocumentation?: string | IMarkdownString;\n\t/**\n\t * The parameters of this signature.\n\t */\n\tparameters: ParameterInformation[];\n\t/**\n\t * Index of the active parameter.\n\t *\n\t * If provided, this is used in place of `SignatureHelp.activeSignature`.\n\t */\n\tactiveParameter?: number;\n}\n/**\n * Signature help represents the signature of something\n * callable. There can be multiple signatures but only one\n * active and only one active parameter.\n */\nexport interface SignatureHelp {\n\t/**\n\t * One or more signatures.\n\t */\n\tsignatures: SignatureInformation[];\n\t/**\n\t * The active signature.\n\t */\n\tactiveSignature: number;\n\t/**\n\t * The active parameter of the active signature.\n\t */\n\tactiveParameter: number;\n}\n\nexport interface SignatureHelpResult extends IDisposable {\n\tvalue: SignatureHelp;\n}\n\nexport enum SignatureHelpTriggerKind {\n\tInvoke = 1,\n\tTriggerCharacter = 2,\n\tContentChange = 3,\n}\n\nexport interface SignatureHelpContext {\n\treadonly triggerKind: SignatureHelpTriggerKind;\n\treadonly triggerCharacter?: string;\n\treadonly isRetrigger: boolean;\n\treadonly activeSignatureHelp?: SignatureHelp;\n}\n\n/**\n * The signature help provider interface defines the contract between extensions and\n * the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.\n */\nexport interface SignatureHelpProvider {\n\n\treadonly signatureHelpTriggerCharacters?: ReadonlyArray<string>;\n\treadonly signatureHelpRetriggerCharacters?: ReadonlyArray<string>;\n\n\t/**\n\t * Provide help for the signature at the given position and document.\n\t */\n\tprovideSignatureHelp(model: model.ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelpResult>;\n}\n\n/**\n * A document highlight kind.\n */\nexport enum DocumentHighlightKind {\n\t/**\n\t * A textual occurrence.\n\t */\n\tText,\n\t/**\n\t * Read-access of a symbol, like reading a variable.\n\t */\n\tRead,\n\t/**\n\t * Write-access of a symbol, like writing to a variable.\n\t */\n\tWrite\n}\n/**\n * A document highlight is a range inside a text document which deserves\n * special attention. Usually a document highlight is visualized by changing\n * the background color of its range.\n */\nexport interface DocumentHighlight {\n\t/**\n\t * The range this highlight applies to.\n\t */\n\trange: IRange;\n\t/**\n\t * The highlight kind, default is {@link DocumentHighlightKind.Text text}.\n\t */\n\tkind?: DocumentHighlightKind;\n}\n/**\n * The document highlight provider interface defines the contract between extensions and\n * the word-highlight-feature.\n */\nexport interface DocumentHighlightProvider {\n\t/**\n\t * Provide a set of document highlights, like all occurrences of a variable or\n\t * all exit-points of a function.\n\t */\n\tprovideDocumentHighlights(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;\n}\n\n/**\n * The linked editing range provider interface defines the contract between extensions and\n * the linked editing feature.\n */\nexport interface LinkedEditingRangeProvider {\n\n\t/**\n\t * Provide a list of ranges that can be edited together.\n\t */\n\tprovideLinkedEditingRanges(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;\n}\n\n/**\n * Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.\n */\nexport interface LinkedEditingRanges {\n\t/**\n\t * A list of ranges that can be edited together. The ranges must have\n\t * identical length and text content. The ranges cannot overlap\n\t */\n\tranges: IRange[];\n\n\t/**\n\t * An optional word pattern that describes valid contents for the given ranges.\n\t * If no pattern is provided, the language configuration's word pattern will be used.\n\t */\n\twordPattern?: RegExp;\n}\n\n/**\n * Value-object that contains additional information when\n * requesting references.\n */\nexport interface ReferenceContext {\n\t/**\n\t * Include the declaration of the current symbol.\n\t */\n\tincludeDeclaration: boolean;\n}\n/**\n * The reference provider interface defines the contract between extensions and\n * the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.\n */\nexport interface ReferenceProvider {\n\t/**\n\t * Provide a set of project-wide references for the given position and document.\n\t */\n\tprovideReferences(model: model.ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;\n}\n\n/**\n * Represents a location inside a resource, such as a line\n * inside a text file.\n */\nexport interface Location {\n\t/**\n\t * The resource identifier of this location.\n\t */\n\turi: URI;\n\t/**\n\t * The document range of this locations.\n\t */\n\trange: IRange;\n}\n\nexport interface LocationLink {\n\t/**\n\t * A range to select where this link originates from.\n\t */\n\toriginSelectionRange?: IRange;\n\n\t/**\n\t * The target uri this link points to.\n\t */\n\turi: URI;\n\n\t/**\n\t * The full range this link points to.\n\t */\n\trange: IRange;\n\n\t/**\n\t * A range to select this link points to. Must be contained\n\t * in `LocationLink.range`.\n\t */\n\ttargetSelectionRange?: IRange;\n}\n\n/**\n * @internal\n */\nexport function isLocationLink(thing: any): thing is LocationLink {\n\treturn thing\n\t\t&& URI.isUri((thing as LocationLink).uri)\n\t\t&& Range.isIRange((thing as LocationLink).range)\n\t\t&& (Range.isIRange((thing as LocationLink).originSelectionRange) || Range.isIRange((thing as LocationLink).targetSelectionRange));\n}\n\nexport type Definition = Location | Location[] | LocationLink[];\n\n/**\n * The definition provider interface defines the contract between extensions and\n * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)\n * and peek definition features.\n */\nexport interface DefinitionProvider {\n\t/**\n\t * Provide the definition of the symbol at the given position and document.\n\t */\n\tprovideDefinition(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;\n}\n\n/**\n * The definition provider interface defines the contract between extensions and\n * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)\n * and peek definition features.\n */\nexport interface DeclarationProvider {\n\t/**\n\t * Provide the declaration of the symbol at the given position and document.\n\t */\n\tprovideDeclaration(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;\n}\n\n/**\n * The implementation provider interface defines the contract between extensions and\n * the go to implementation feature.\n */\nexport interface ImplementationProvider {\n\t/**\n\t * Provide the implementation of the symbol at the given position and document.\n\t */\n\tprovideImplementation(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;\n}\n\n/**\n * The type definition provider interface defines the contract between extensions and\n * the go to type definition feature.\n */\nexport interface TypeDefinitionProvider {\n\t/**\n\t * Provide the type definition of the symbol at the given position and document.\n\t */\n\tprovideTypeDefinition(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;\n}\n\n/**\n * A symbol kind.\n */\nexport const enum SymbolKind {\n\tFile = 0,\n\tModule = 1,\n\tNamespace = 2,\n\tPackage = 3,\n\tClass = 4,\n\tMethod = 5,\n\tProperty = 6,\n\tField = 7,\n\tConstructor = 8,\n\tEnum = 9,\n\tInterface = 10,\n\tFunction = 11,\n\tVariable = 12,\n\tConstant = 13,\n\tString = 14,\n\tNumber = 15,\n\tBoolean = 16,\n\tArray = 17,\n\tObject = 18,\n\tKey = 19,\n\tNull = 20,\n\tEnumMember = 21,\n\tStruct = 22,\n\tEvent = 23,\n\tOperator = 24,\n\tTypeParameter = 25\n}\n\nexport const enum SymbolTag {\n\tDeprecated = 1,\n}\n\n/**\n * @internal\n */\nexport namespace SymbolKinds {\n\n\tconst byKind = new Map<SymbolKind, CSSIcon>();\n\tbyKind.set(SymbolKind.File, Codicon.symbolFile);\n\tbyKind.set(SymbolKind.Module, Codicon.symbolModule);\n\tbyKind.set(SymbolKind.Namespace, Codicon.symbolNamespace);\n\tbyKind.set(SymbolKind.Package, Codicon.symbolPackage);\n\tbyKind.set(SymbolKind.Class, Codicon.symbolClass);\n\tbyKind.set(SymbolKind.Method, Codicon.symbolMethod);\n\tbyKind.set(SymbolKind.Property, Codicon.symbolProperty);\n\tbyKind.set(SymbolKind.Field, Codicon.symbolField);\n\tbyKind.set(SymbolKind.Constructor, Codicon.symbolConstructor);\n\tbyKind.set(SymbolKind.Enum, Codicon.symbolEnum);\n\tbyKind.set(SymbolKind.Interface, Codicon.symbolInterface);\n\tbyKind.set(SymbolKind.Function, Codicon.symbolFunction);\n\tbyKind.set(SymbolKind.Variable, Codicon.symbolVariable);\n\tbyKind.set(SymbolKind.Constant, Codicon.symbolConstant);\n\tbyKind.set(SymbolKind.String, Codicon.symbolString);\n\tbyKind.set(SymbolKind.Number, Codicon.symbolNumber);\n\tbyKind.set(SymbolKind.Boolean, Codicon.symbolBoolean);\n\tbyKind.set(SymbolKind.Array, Codicon.symbolArray);\n\tbyKind.set(SymbolKind.Object, Codicon.symbolObject);\n\tbyKind.set(SymbolKind.Key, Codicon.symbolKey);\n\tbyKind.set(SymbolKind.Null, Codicon.symbolNull);\n\tbyKind.set(SymbolKind.EnumMember, Codicon.symbolEnumMember);\n\tbyKind.set(SymbolKind.Struct, Codicon.symbolStruct);\n\tbyKind.set(SymbolKind.Event, Codicon.symbolEvent);\n\tbyKind.set(SymbolKind.Operator, Codicon.symbolOperator);\n\tbyKind.set(SymbolKind.TypeParameter, Codicon.symbolTypeParameter);\n\t/**\n\t * @internal\n\t */\n\texport function toIcon(kind: SymbolKind): CSSIcon {\n\t\tlet icon = byKind.get(kind);\n\t\tif (!icon) {\n\t\t\tconsole.info('No codicon found for SymbolKind ' + kind);\n\t\t\ticon = Codicon.symbolProperty;\n\t\t}\n\t\treturn icon;\n\t}\n}\n\nexport interface DocumentSymbol {\n\tname: string;\n\tdetail: string;\n\tkind: SymbolKind;\n\ttags: ReadonlyArray<SymbolTag>;\n\tcontainerName?: string;\n\trange: IRange;\n\tselectionRange: IRange;\n\tchildren?: DocumentSymbol[];\n}\n\n/**\n * The document symbol provider interface defines the contract between extensions and\n * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.\n */\nexport interface DocumentSymbolProvider {\n\n\tdisplayName?: string;\n\n\t/**\n\t * Provide symbol information for the given document.\n\t */\n\tprovideDocumentSymbols(model: model.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;\n}\n\nexport type TextEdit = { range: IRange; text: string; eol?: model.EndOfLineSequence };\n\n/**\n * Interface used to format a model\n */\nexport interface FormattingOptions {\n\t/**\n\t * Size of a tab in spaces.\n\t */\n\ttabSize: number;\n\t/**\n\t * Prefer spaces over tabs.\n\t */\n\tinsertSpaces: boolean;\n}\n/**\n * The document formatting provider interface defines the contract between extensions and\n * the formatting-feature.\n */\nexport interface DocumentFormattingEditProvider {\n\n\t/**\n\t * @internal\n\t */\n\treadonly extensionId?: ExtensionIdentifier;\n\n\treadonly displayName?: string;\n\n\t/**\n\t * Provide formatting edits for a whole document.\n\t */\n\tprovideDocumentFormattingEdits(model: model.ITextModel, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;\n}\n/**\n * The document formatting provider interface defines the contract between extensions and\n * the formatting-feature.\n */\nexport interface DocumentRangeFormattingEditProvider {\n\t/**\n\t * @internal\n\t */\n\treadonly extensionId?: ExtensionIdentifier;\n\n\treadonly displayName?: string;\n\n\t/**\n\t * Provide formatting edits for a range in a document.\n\t *\n\t * The given range is a hint and providers can decide to format a smaller\n\t * or larger range. Often this is done by adjusting the start and end\n\t * of the range to full syntax nodes.\n\t */\n\tprovideDocumentRangeFormattingEdits(model: model.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;\n}\n/**\n * The document formatting provider interface defines the contract between extensions and\n * the formatting-feature.\n */\nexport interface OnTypeFormattingEditProvider {\n\n\tautoFormatTriggerCharacters: string[];\n\n\t/**\n\t * Provide formatting edits after a character has been typed.\n\t *\n\t * The given position and character should hint to the provider\n\t * what range the position to expand to, like find the matching `{`\n\t * when `}` has been entered.\n\t */\n\tprovideOnTypeFormattingEdits(model: model.ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;\n}\n\n/**\n * @internal\n */\nexport interface IInplaceReplaceSupportResult {\n\tvalue: string;\n\trange: IRange;\n}\n\n/**\n * A link inside the editor.\n */\nexport interface ILink {\n\trange: IRange;\n\turl?: URI | string;\n\ttooltip?: string;\n}\n\nexport interface ILinksList {\n\tlinks: ILink[];\n\tdispose?(): void;\n}\n/**\n * A provider of links.\n */\nexport interface LinkProvider {\n\tprovideLinks(model: model.ITextModel, token: CancellationToken): ProviderResult<ILinksList>;\n\tresolveLink?: (link: ILink, token: CancellationToken) => ProviderResult<ILink>;\n}\n\n/**\n * A color in RGBA format.\n */\nexport interface IColor {\n\n\t/**\n\t * The red component in the range [0-1].\n\t */\n\treadonly red: number;\n\n\t/**\n\t * The green component in the range [0-1].\n\t */\n\treadonly green: number;\n\n\t/**\n\t * The blue component in the range [0-1].\n\t */\n\treadonly blue: number;\n\n\t/**\n\t * The alpha component in the range [0-1].\n\t */\n\treadonly alpha: number;\n}\n\n/**\n * String representations for a color\n */\nexport interface IColorPresentation {\n\t/**\n\t * The label of this color presentation. It will be shown on the color\n\t * picker header. By default this is also the text that is inserted when selecting\n\t * this color presentation.\n\t */\n\tlabel: string;\n\t/**\n\t * An {@link TextEdit edit} which is applied to a document when selecting\n\t * this presentation for the color.\n\t */\n\ttextEdit?: TextEdit;\n\t/**\n\t * An optional array of additional {@link TextEdit text edits} that are applied when\n\t * selecting this color presentation.\n\t */\n\tadditionalTextEdits?: TextEdit[];\n}\n\n/**\n * A color range is a range in a text model which represents a color.\n */\nexport interface IColorInformation {\n\n\t/**\n\t * The range within the model.\n\t */\n\trange: IRange;\n\n\t/**\n\t * The color represented in this range.\n\t */\n\tcolor: IColor;\n}\n\n/**\n * A provider of colors for editor models.\n */\nexport interface DocumentColorProvider {\n\t/**\n\t * Provides the color ranges for a specific model.\n\t */\n\tprovideDocumentColors(model: model.ITextModel, token: CancellationToken): ProviderResult<IColorInformation[]>;\n\t/**\n\t * Provide the string representations for a color.\n\t */\n\tprovideColorPresentations(model: model.ITextModel, colorInfo: IColorInformation, token: CancellationToken): ProviderResult<IColorPresentation[]>;\n}\n\nexport interface SelectionRange {\n\trange: IRange;\n}\n\nexport interface SelectionRangeProvider {\n\t/**\n\t * Provide ranges that should be selected from the given position.\n\t */\n\tprovideSelectionRanges(model: model.ITextModel, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[][]>;\n}\n\nexport interface FoldingContext {\n}\n/**\n * A provider of folding ranges for editor models.\n */\nexport interface FoldingRangeProvider {\n\n\t/**\n\t * An optional event to signal that the folding ranges from this provider have changed.\n\t */\n\tonDidChange?: Event<this>;\n\n\t/**\n\t * Provides the folding ranges for a specific model.\n\t */\n\tprovideFoldingRanges(model: model.ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;\n}\n\nexport interface FoldingRange {\n\n\t/**\n\t * The one-based start line of the range to fold. The folded area starts after the line's last character.\n\t */\n\tstart: number;\n\n\t/**\n\t * The one-based end line of the range to fold. The folded area ends with the line's last character.\n\t */\n\tend: number;\n\n\t/**\n\t * Describes the {@link FoldingRangeKind Kind} of the folding range such as {@link FoldingRangeKind.Comment Comment} or\n\t * {@link FoldingRangeKind.Region Region}. The kind is used to categorize folding ranges and used by commands\n\t * like 'Fold all comments'. See\n\t * {@link FoldingRangeKind} for an enumeration of standardized kinds.\n\t */\n\tkind?: FoldingRangeKind;\n}\nexport class FoldingRangeKind {\n\t/**\n\t * Kind for folding range representing a comment. The value of the kind is 'comment'.\n\t */\n\tstatic readonly Comment = new FoldingRangeKind('comment');\n\t/**\n\t * Kind for folding range representing a import. The value of the kind is 'imports'.\n\t */\n\tstatic readonly Imports = new FoldingRangeKind('imports');\n\t/**\n\t * Kind for folding range representing regions (for example marked by `#region`, `#endregion`).\n\t * The value of the kind is 'region'.\n\t */\n\tstatic readonly Region = new FoldingRangeKind('region');\n\n\t/**\n\t * Creates a new {@link FoldingRangeKind}.\n\t *\n\t * @param value of the kind.\n\t */\n\tpublic constructor(public value: string) {\n\t}\n}\n\n\nexport interface WorkspaceEditMetadata {\n\tneedsConfirmation: boolean;\n\tlabel: string;\n\tdescription?: string;\n}\n\nexport interface WorkspaceFileEditOptions {\n\toverwrite?: boolean;\n\tignoreIfNotExists?: boolean;\n\tignoreIfExists?: boolean;\n\trecursive?: boolean;\n\tcopy?: boolean;\n\tfolder?: boolean;\n\tskipTrashBin?: boolean;\n\tmaxSize?: number;\n}\n\nexport interface WorkspaceFileEdit {\n\toldUri?: URI;\n\tnewUri?: URI;\n\toptions?: WorkspaceFileEditOptions;\n\tmetadata?: WorkspaceEditMetadata;\n}\n\nexport interface WorkspaceTextEdit {\n\tresource: URI;\n\tedit: TextEdit;\n\tmodelVersionId?: number;\n\tmetadata?: WorkspaceEditMetadata;\n}\n\nexport interface WorkspaceEdit {\n\tedits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;\n}\n\nexport interface Rejection {\n\trejectReason?: string;\n}\nexport interface RenameLocation {\n\trange: IRange;\n\ttext: string;\n}\n\nexport interface RenameProvider {\n\tprovideRenameEdits(model: model.ITextModel, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit & Rejection>;\n\tresolveRenameLocation?(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<RenameLocation & Rejection>;\n}\n\nexport interface Command {\n\tid: string;\n\ttitle: string;\n\ttooltip?: string;\n\targuments?: any[];\n}\n\n/**\n * @internal\n */\nexport namespace Command {\n\n\t/**\n\t * @internal\n\t */\n\texport function is(obj: any): obj is Command {\n\t\tif (!obj || typeof obj !== 'object') {\n\t\t\treturn false;\n\t\t}\n\t\treturn typeof (<Command>obj).id === 'string' &&\n\t\t\ttypeof (<Command>obj).title === 'string';\n\t}\n}\n\nexport interface CodeLens {\n\trange: IRange;\n\tid?: string;\n\tcommand?: Command;\n}\n\nexport interface CodeLensList {\n\tlenses: CodeLens[];\n\tdispose(): void;\n}\n\nexport interface CodeLensProvider {\n\tonDidChange?: Event<this>;\n\tprovideCodeLenses(model: model.ITextModel, token: CancellationToken): ProviderResult<CodeLensList>;\n\tresolveCodeLens?(model: model.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;\n}\n\n\nexport enum InlayHintKind {\n\tType = 1,\n\tParameter = 2,\n}\n\nexport interface InlayHintLabelPart {\n\tlabel: string;\n\ttooltip?: string | IMarkdownString;\n\t// collapsible?: boolean;\n\tcommand?: Command;\n\tlocation?: Location;\n}\n\nexport interface InlayHint {\n\tlabel: string | InlayHintLabelPart[];\n\ttooltip?: string | IMarkdownString;\n\tcommand?: Command;\n\tposition: IPosition;\n\tkind?: InlayHintKind;\n\tpaddingLeft?: boolean;\n\tpaddingRight?: boolean;\n}\n\nexport interface InlayHintList {\n\thints: InlayHint[];\n\tdispose(): void;\n}\n\nexport interface InlayHintsProvider {\n\tdisplayName?: string;\n\tonDidChangeInlayHints?: Event<void>;\n\tprovideInlayHints(model: model.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;\n\tresolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;\n}\n\nexport interface SemanticTokensLegend {\n\treadonly tokenTypes: string[];\n\treadonly tokenModifiers: string[];\n}\n\nexport interface SemanticTokens {\n\treadonly resultId?: string;\n\treadonly data: Uint32Array;\n}\n\nexport interface SemanticTokensEdit {\n\treadonly start: number;\n\treadonly deleteCount: number;\n\treadonly data?: Uint32Array;\n}\n\nexport interface SemanticTokensEdits {\n\treadonly resultId?: string;\n\treadonly edits: SemanticTokensEdit[];\n}\n\nexport interface DocumentSemanticTokensProvider {\n\tonDidChange?: Event<void>;\n\tgetLegend(): SemanticTokensLegend;\n\tprovideDocumentSemanticTokens(model: model.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;\n\treleaseDocumentSemanticTokens(resultId: string | undefined): void;\n}\n\nexport interface DocumentRangeSemanticTokensProvider {\n\tgetLegend(): SemanticTokensLegend;\n\tprovideDocumentRangeSemanticTokens(model: model.ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationSupportChangedEvent {\n\tchangedLanguages: string[];\n\tchangedColorMap: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationSupportFactory {\n\tcreateTokenizationSupport(): ProviderResult<ITokenizationSupport>;\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationRegistry {\n\n\t/**\n\t * An event triggered when:\n\t * - a tokenization support is registered, unregistered or changed.\n\t * - the color map is changed.\n\t */\n\tonDidChange: Event<ITokenizationSupportChangedEvent>;\n\n\t/**\n\t * Fire a change event for a language.\n\t * This is useful for languages that embed other languages.\n\t */\n\tfire(languageIds: string[]): void;\n\n\t/**\n\t * Register a tokenization support.\n\t */\n\tregister(languageId: string, support: ITokenizationSupport): IDisposable;\n\n\t/**\n\t * Register a tokenization support factory.\n\t */\n\tregisterFactory(languageId: string, factory: ITokenizationSupportFactory): IDisposable;\n\n\t/**\n\t * Get or create the tokenization support for a language.\n\t * Returns `null` if not found.\n\t */\n\tgetOrCreate(languageId: string): Promise<ITokenizationSupport | null>;\n\n\t/**\n\t * Get the tokenization support for a language.\n\t * Returns `null` if not found.\n\t */\n\tget(languageId: string): ITokenizationSupport | null;\n\n\t/**\n\t * Returns false if a factory is still pending.\n\t */\n\tisResolved(languageId: string): boolean;\n\n\t/**\n\t * Set the new color map that all tokens will use in their ColorId binary encoded bits for foreground and background.\n\t */\n\tsetColorMap(colorMap: Color[]): void;\n\n\tgetColorMap(): Color[] | null;\n\n\tgetDefaultBackground(): Color | null;\n}\n\n/**\n * @internal\n */\nexport const TokenizationRegistry: ITokenizationRegistry = new TokenizationRegistryImpl();\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 { Token, TokenizationResult, EncodedTokenizationResult, ColorId, FontStyle, IState, LanguageId, MetadataConsts, StandardTokenType } from 'vs/editor/common/languages';\n\nexport const NullState: IState = new class implements IState {\n\tpublic clone(): IState {\n\t\treturn this;\n\t}\n\tpublic equals(other: IState): boolean {\n\t\treturn (this === other);\n\t}\n};\n\nexport function nullTokenize(languageId: string, state: IState): TokenizationResult {\n\treturn new TokenizationResult([new Token(0, '', languageId)], state);\n}\n\nexport function nullTokenizeEncoded(languageId: LanguageId, state: IState | null): EncodedTokenizationResult {\n\tconst tokens = new Uint32Array(2);\n\ttokens[0] = 0;\n\ttokens[1] = (\n\t\t(languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t| (StandardTokenType.Other << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t| (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\n\n\treturn new EncodedTokenizationResult(tokens, state === null ? NullState : state);\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 { NotSupportedError } from 'vs/base/common/errors';\nimport { StandardTokenType, TokenMetadata } from 'vs/editor/common/languages';\nimport { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { BracketAstNode, TextAstNode } from './ast';\nimport { BracketTokens, LanguageAgnosticBracketTokens } from './brackets';\nimport { Length, lengthAdd, lengthDiff, lengthGetColumnCountIfZeroLineCount, lengthToObj, lengthZero, toLength } from './length';\nimport { SmallImmutableSet } from './smallImmutableSet';\n\nexport interface Tokenizer {\n\treadonly offset: Length;\n\treadonly length: Length;\n\n\tread(): Token | null;\n\tpeek(): Token | null;\n\tskip(length: Length): void;\n}\n\nexport const enum TokenKind {\n\tText = 0,\n\tOpeningBracket = 1,\n\tClosingBracket = 2,\n}\n\nexport type OpeningBracketId = number;\n\nexport class Token {\n\tconstructor(\n\t\treadonly length: Length,\n\t\treadonly kind: TokenKind,\n\t\t/**\n\t\t * If this token is an opening bracket, this is the id of the opening bracket.\n\t\t * If this token is a closing bracket, this is the id of the first opening bracket that is closed by this bracket.\n\t\t * Otherwise, it is -1.\n\t\t */\n\t\treadonly bracketId: OpeningBracketId,\n\t\t/**\n\t\t * If this token is an opening bracket, this just contains `bracketId`.\n\t\t * If this token is a closing bracket, this lists all opening bracket ids, that it closes.\n\t\t * Otherwise, it is empty.\n\t\t */\n\t\treadonly bracketIds: SmallImmutableSet<OpeningBracketId>,\n\t\treadonly astNode: BracketAstNode | TextAstNode | undefined,\n\t) { }\n}\n\nexport interface ITokenizerSource {\n\tgetLineCount(): number;\n\tgetLineLength(lineNumber: number): number;\n\tgetLineTokens(lineNumber: number): IViewLineTokens;\n}\n\nexport class TextBufferTokenizer implements Tokenizer {\n\tprivate readonly textBufferLineCount: number;\n\tprivate readonly textBufferLastLineLength: number;\n\n\tprivate readonly reader = new NonPeekableTextBufferTokenizer(this.textModel, this.bracketTokens);\n\n\tconstructor(\n\t\tprivate readonly textModel: ITokenizerSource,\n\t\tprivate readonly bracketTokens: LanguageAgnosticBracketTokens\n\t) {\n\t\tthis.textBufferLineCount = textModel.getLineCount();\n\t\tthis.textBufferLastLineLength = textModel.getLineLength(this.textBufferLineCount);\n\t}\n\n\tprivate _offset: Length = lengthZero;\n\n\tget offset() {\n\t\treturn this._offset;\n\t}\n\n\tget length() {\n\t\treturn toLength(this.textBufferLineCount, this.textBufferLastLineLength);\n\t}\n\n\tskip(length: Length): void {\n\t\tthis.didPeek = false;\n\t\tthis._offset = lengthAdd(this._offset, length);\n\t\tconst obj = lengthToObj(this._offset);\n\t\tthis.reader.setPosition(obj.lineCount, obj.columnCount);\n\t}\n\n\tprivate didPeek = false;\n\tprivate peeked: Token | null = null;\n\n\tread(): Token | null {\n\t\tlet token: Token | null;\n\t\tif (this.peeked) {\n\t\t\tthis.didPeek = false;\n\t\t\ttoken = this.peeked;\n\t\t} else {\n\t\t\ttoken = this.reader.read();\n\t\t}\n\t\tif (token) {\n\t\t\tthis._offset = lengthAdd(this._offset, token.length);\n\t\t}\n\t\treturn token;\n\t}\n\n\tpeek(): Token | null {\n\t\tif (!this.didPeek) {\n\t\t\tthis.peeked = this.reader.read();\n\t\t\tthis.didPeek = true;\n\t\t}\n\t\treturn this.peeked;\n\t}\n}\n\n/**\n * Does not support peek.\n*/\nclass NonPeekableTextBufferTokenizer {\n\tprivate readonly textBufferLineCount: number;\n\tprivate readonly textBufferLastLineLength: number;\n\n\tconstructor(private readonly textModel: ITokenizerSource, private readonly bracketTokens: LanguageAgnosticBracketTokens) {\n\t\tthis.textBufferLineCount = textModel.getLineCount();\n\t\tthis.textBufferLastLineLength = textModel.getLineLength(this.textBufferLineCount);\n\t}\n\n\tprivate lineIdx = 0;\n\tprivate line: string | null = null;\n\tprivate lineCharOffset = 0;\n\tprivate lineTokens: IViewLineTokens | null = null;\n\tprivate lineTokenOffset = 0;\n\n\tpublic setPosition(lineIdx: number, column: number): void {\n\t\t// We must not jump into a token!\n\t\tif (lineIdx === this.lineIdx) {\n\t\t\tthis.lineCharOffset = column;\n\t\t\tthis.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens!.findTokenIndexAtOffset(this.lineCharOffset);\n\t\t} else {\n\t\t\tthis.lineIdx = lineIdx;\n\t\t\tthis.lineCharOffset = column;\n\t\t\tthis.line = null;\n\t\t}\n\t\tthis.peekedToken = null;\n\t}\n\n\t/** Must be a zero line token. The end of the document cannot be peeked. */\n\tprivate peekedToken: Token | null = null;\n\n\tpublic read(): Token | null {\n\t\tif (this.peekedToken) {\n\t\t\tconst token = this.peekedToken;\n\t\t\tthis.peekedToken = null;\n\t\t\tthis.lineCharOffset += lengthGetColumnCountIfZeroLineCount(token.length);\n\t\t\treturn token;\n\t\t}\n\n\t\tif (this.lineIdx > this.textBufferLineCount - 1 || (this.lineIdx === this.textBufferLineCount - 1 && this.lineCharOffset >= this.textBufferLastLineLength)) {\n\t\t\t// We are after the end\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.line === null) {\n\t\t\tthis.lineTokens = this.textModel.getLineTokens(this.lineIdx + 1);\n\t\t\tthis.line = this.lineTokens.getLineContent();\n\t\t\tthis.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens!.findTokenIndexAtOffset(this.lineCharOffset);\n\t\t}\n\n\t\tconst startLineIdx = this.lineIdx;\n\t\tconst startLineCharOffset = this.lineCharOffset;\n\n\t\t// limits the length of text tokens.\n\t\t// If text tokens get too long, incremental updates will be slow\n\t\tlet lengthHeuristic = 0;\n\t\twhile (true) {\n\t\t\tconst lineTokens = this.lineTokens!;\n\t\t\tconst tokenCount = lineTokens.getCount();\n\n\t\t\tlet peekedBracketToken: Token | null = null;\n\n\t\t\tif (this.lineTokenOffset < tokenCount) {\n\t\t\t\tconst tokenMetadata = lineTokens.getMetadata(this.lineTokenOffset);\n\t\t\t\twhile (this.lineTokenOffset + 1 < tokenCount && tokenMetadata === lineTokens.getMetadata(this.lineTokenOffset + 1)) {\n\t\t\t\t\t// Skip tokens that are identical.\n\t\t\t\t\t// Sometimes, (bracket) identifiers are split up into multiple tokens.\n\t\t\t\t\tthis.lineTokenOffset++;\n\t\t\t\t}\n\n\t\t\t\tconst isOther = TokenMetadata.getTokenType(tokenMetadata) === StandardTokenType.Other;\n\n\t\t\t\tconst endOffset = lineTokens.getEndOffset(this.lineTokenOffset);\n\t\t\t\t// Is there a bracket token next? Only consume text.\n\t\t\t\tif (isOther && endOffset !== this.lineCharOffset) {\n\t\t\t\t\tconst languageId = lineTokens.getLanguageId(this.lineTokenOffset);\n\t\t\t\t\tconst text = this.line.substring(this.lineCharOffset, endOffset);\n\n\t\t\t\t\tconst brackets = this.bracketTokens.getSingleLanguageBracketTokens(languageId);\n\t\t\t\t\tconst regexp = brackets.regExpGlobal;\n\t\t\t\t\tif (regexp) {\n\t\t\t\t\t\tregexp.lastIndex = 0;\n\t\t\t\t\t\tconst match = regexp.exec(text);\n\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\tpeekedBracketToken = brackets.getToken(match[0])!;\n\t\t\t\t\t\t\tif (peekedBracketToken) {\n\t\t\t\t\t\t\t\t// Consume leading text of the token\n\t\t\t\t\t\t\t\tthis.lineCharOffset += match.index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlengthHeuristic += endOffset - this.lineCharOffset;\n\n\t\t\t\tif (peekedBracketToken) {\n\t\t\t\t\t// Don't skip the entire token, as a single token could contain multiple brackets.\n\n\t\t\t\t\tif (startLineIdx !== this.lineIdx || startLineCharOffset !== this.lineCharOffset) {\n\t\t\t\t\t\t// There is text before the bracket\n\t\t\t\t\t\tthis.peekedToken = peekedBracketToken;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Consume the peeked token\n\t\t\t\t\t\tthis.lineCharOffset += lengthGetColumnCountIfZeroLineCount(peekedBracketToken.length);\n\t\t\t\t\t\treturn peekedBracketToken;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Skip the entire token, as the token contains no brackets at all.\n\t\t\t\t\tthis.lineTokenOffset++;\n\t\t\t\t\tthis.lineCharOffset = endOffset;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.lineIdx === this.textBufferLineCount - 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.lineIdx++;\n\t\t\t\tthis.lineTokens = this.textModel.getLineTokens(this.lineIdx + 1);\n\t\t\t\tthis.lineTokenOffset = 0;\n\t\t\t\tthis.line = this.lineTokens.getLineContent();\n\t\t\t\tthis.lineCharOffset = 0;\n\n\t\t\t\tlengthHeuristic += 33; // max 1000/33 = 30 lines\n\t\t\t\t// This limits the amount of work to recompute min-indentation\n\n\t\t\t\tif (lengthHeuristic > 1000) {\n\t\t\t\t\t// only break (automatically) at the end of line.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lengthHeuristic > 1500) {\n\t\t\t\t// Eventually break regardless of the line length so that\n\t\t\t\t// very long lines do not cause bad performance.\n\t\t\t\t// This effective limits max indentation to 500, as\n\t\t\t\t// indentation is not computed across multiple text nodes.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If a token contains some proper indentation, it also contains \\n{INDENTATION+}(?!{INDENTATION}),\n\t\t// unless the line is too long.\n\t\t// Thus, the min indentation of the document is the minimum min indentation of every text node.\n\t\tconst length = lengthDiff(startLineIdx, startLineCharOffset, this.lineIdx, this.lineCharOffset);\n\t\treturn new Token(length, TokenKind.Text, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length));\n\t}\n}\n\nexport class FastTokenizer implements Tokenizer {\n\tprivate _offset: Length = lengthZero;\n\tprivate readonly tokens: readonly Token[];\n\tprivate idx = 0;\n\n\tconstructor(private readonly text: string, brackets: BracketTokens) {\n\t\tconst regExpStr = brackets.getRegExpStr();\n\t\tconst regexp = regExpStr ? new RegExp(brackets.getRegExpStr() + '|\\n', 'g') : null;\n\n\t\tconst tokens: Token[] = [];\n\n\t\tlet match: RegExpExecArray | null;\n\t\tlet curLineCount = 0;\n\t\tlet lastLineBreakOffset = 0;\n\n\t\tlet lastTokenEndOffset = 0;\n\t\tlet lastTokenEndLine = 0;\n\n\t\tconst smallTextTokens0Line = new Array<Token>();\n\t\tfor (let i = 0; i < 60; i++) {\n\t\t\tsmallTextTokens0Line.push(\n\t\t\t\tnew Token(\n\t\t\t\t\ttoLength(0, i), TokenKind.Text, -1, SmallImmutableSet.getEmpty(),\n\t\t\t\t\tnew TextAstNode(toLength(0, i))\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst smallTextTokens1Line = new Array<Token>();\n\t\tfor (let i = 0; i < 60; i++) {\n\t\t\tsmallTextTokens1Line.push(\n\t\t\t\tnew Token(\n\t\t\t\t\ttoLength(1, i), TokenKind.Text, -1, SmallImmutableSet.getEmpty(),\n\t\t\t\t\tnew TextAstNode(toLength(1, i))\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif (regexp) {\n\t\t\tregexp.lastIndex = 0;\n\t\t\t// If a token contains indentation, it also contains \\n{INDENTATION+}(?!{INDENTATION})\n\t\t\twhile ((match = regexp.exec(text)) !== null) {\n\t\t\t\tconst curOffset = match.index;\n\t\t\t\tconst value = match[0];\n\t\t\t\tif (value === '\\n') {\n\t\t\t\t\tcurLineCount++;\n\t\t\t\t\tlastLineBreakOffset = curOffset + 1;\n\t\t\t\t} else {\n\t\t\t\t\tif (lastTokenEndOffset !== curOffset) {\n\t\t\t\t\t\tlet token: Token;\n\t\t\t\t\t\tif (lastTokenEndLine === curLineCount) {\n\t\t\t\t\t\t\tconst colCount = curOffset - lastTokenEndOffset;\n\t\t\t\t\t\t\tif (colCount < smallTextTokens0Line.length) {\n\t\t\t\t\t\t\t\ttoken = smallTextTokens0Line[colCount];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst length = toLength(0, colCount);\n\t\t\t\t\t\t\t\ttoken = new Token(length, TokenKind.Text, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst lineCount = curLineCount - lastTokenEndLine;\n\t\t\t\t\t\t\tconst colCount = curOffset - lastLineBreakOffset;\n\t\t\t\t\t\t\tif (lineCount === 1 && colCount < smallTextTokens1Line.length) {\n\t\t\t\t\t\t\t\ttoken = smallTextTokens1Line[colCount];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst length = toLength(lineCount, colCount);\n\t\t\t\t\t\t\t\ttoken = new Token(length, TokenKind.Text, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttokens.push(token);\n\t\t\t\t\t}\n\n\t\t\t\t\t// value is matched by regexp, so the token must exist\n\t\t\t\t\ttokens.push(brackets.getToken(value)!);\n\n\t\t\t\t\tlastTokenEndOffset = curOffset + value.length;\n\t\t\t\t\tlastTokenEndLine = curLineCount;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst offset = text.length;\n\n\t\tif (lastTokenEndOffset !== offset) {\n\t\t\tconst length = (lastTokenEndLine === curLineCount)\n\t\t\t\t? toLength(0, offset - lastTokenEndOffset)\n\t\t\t\t: toLength(curLineCount - lastTokenEndLine, offset - lastLineBreakOffset);\n\t\t\ttokens.push(new Token(length, TokenKind.Text, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length)));\n\t\t}\n\n\t\tthis.length = toLength(curLineCount, offset - lastLineBreakOffset);\n\t\tthis.tokens = tokens;\n\t}\n\n\tget offset(): Length {\n\t\treturn this._offset;\n\t}\n\n\treadonly length: Length;\n\n\tread(): Token | null {\n\t\treturn this.tokens[this.idx++] || null;\n\t}\n\n\tpeek(): Token | null {\n\t\treturn this.tokens[this.idx] || null;\n\t}\n\n\tskip(length: Length): void {\n\t\tthrow new NotSupportedError();\n\t}\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 *--------------------------------------------------------------------------------------------*/\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\nimport { ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { BracketAstNode } from './ast';\nimport { toLength } from './length';\nimport { DenseKeyProvider, identityKeyProvider, SmallImmutableSet } from './smallImmutableSet';\nimport { OpeningBracketId, Token, TokenKind } from './tokenizer';\n\nexport class BracketTokens {\n\tstatic createFromLanguage(configuration: ResolvedLanguageConfiguration, denseKeyProvider: DenseKeyProvider<string>): BracketTokens {\n\t\tfunction getId(languageId: string, openingText: string): OpeningBracketId {\n\t\t\treturn denseKeyProvider.getKey(`${languageId}:::${openingText}`);\n\t\t}\n\n\t\tconst brackets = configuration.characterPair.getColorizedBrackets();\n\n\t\tconst closingBrackets = new Map</* closingText */ string, { openingBrackets: SmallImmutableSet<OpeningBracketId>; first: OpeningBracketId }>();\n\t\tconst openingBrackets = new Set</* openingText */ string>();\n\n\t\tfor (const [openingText, closingText] of brackets) {\n\t\t\topeningBrackets.add(openingText);\n\n\t\t\tlet info = closingBrackets.get(closingText);\n\t\t\tconst openingTextId = getId(configuration.languageId, openingText);\n\t\t\tif (!info) {\n\t\t\t\tinfo = { openingBrackets: SmallImmutableSet.getEmpty(), first: openingTextId };\n\t\t\t\tclosingBrackets.set(closingText, info);\n\t\t\t}\n\t\t\tinfo.openingBrackets = info.openingBrackets.add(openingTextId, identityKeyProvider);\n\t\t}\n\n\t\tconst map = new Map<string, Token>();\n\n\t\tfor (const [closingText, info] of closingBrackets) {\n\t\t\tconst length = toLength(0, closingText.length);\n\t\t\tmap.set(closingText, new Token(\n\t\t\t\tlength,\n\t\t\t\tTokenKind.ClosingBracket,\n\t\t\t\tinfo.first,\n\t\t\t\tinfo.openingBrackets,\n\t\t\t\tBracketAstNode.create(length, configuration.languageId, info.openingBrackets)\n\t\t\t));\n\t\t}\n\n\t\tfor (const openingText of openingBrackets) {\n\t\t\tconst length = toLength(0, openingText.length);\n\t\t\tconst openingTextId = getId(configuration.languageId, openingText);\n\t\t\tconst bracketIds = SmallImmutableSet.getEmpty().add(openingTextId, identityKeyProvider);\n\t\t\tmap.set(openingText, new Token(\n\t\t\t\tlength,\n\t\t\t\tTokenKind.OpeningBracket,\n\t\t\t\topeningTextId,\n\t\t\t\tbracketIds,\n\t\t\t\tBracketAstNode.create(length, configuration.languageId, bracketIds)\n\t\t\t));\n\t\t}\n\n\t\treturn new BracketTokens(map);\n\t}\n\n\tprivate hasRegExp = false;\n\tprivate _regExpGlobal: RegExp | null = null;\n\n\tconstructor(\n\t\tprivate readonly map: Map<string, Token>\n\t) { }\n\n\tgetRegExpStr(): string | null {\n\t\tif (this.isEmpty) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tconst keys = [...this.map.keys()];\n\t\t\tkeys.sort();\n\t\t\tkeys.reverse();\n\t\t\treturn keys.map(k => prepareBracketForRegExp(k)).join('|');\n\t\t}\n\t}\n\n\t/**\n\t * Returns null if there is no such regexp (because there are no brackets).\n\t*/\n\tget regExpGlobal(): RegExp | null {\n\t\tif (!this.hasRegExp) {\n\t\t\tconst regExpStr = this.getRegExpStr();\n\t\t\tthis._regExpGlobal = regExpStr ? new RegExp(regExpStr, 'g') : null;\n\t\t\tthis.hasRegExp = true;\n\t\t}\n\t\treturn this._regExpGlobal;\n\t}\n\n\tgetToken(value: string): Token | undefined {\n\t\treturn this.map.get(value);\n\t}\n\n\tfindClosingTokenText(openingBracketIds: SmallImmutableSet<OpeningBracketId>): string | undefined {\n\t\tfor (const [closingText, info] of this.map) {\n\t\t\tif (info.bracketIds.intersects(openingBracketIds)) {\n\t\t\t\treturn closingText;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tget isEmpty(): boolean {\n\t\treturn this.map.size === 0;\n\t}\n}\n\nfunction prepareBracketForRegExp(str: string): string {\n\tconst escaped = escapeRegExpCharacters(str);\n\t// This bracket pair uses letters like e.g. \"begin\" - \"end\" (see https://github.com/microsoft/vscode/issues/132162)\n\tconst needsWordBoundaries = (/^[\\w ]+$/.test(str));\n\treturn (needsWordBoundaries ? `\\\\b${escaped}\\\\b` : escaped);\n}\n\nexport class LanguageAgnosticBracketTokens {\n\tprivate readonly languageIdToBracketTokens = new Map<string, BracketTokens>();\n\n\tconstructor(\n\t\tprivate readonly denseKeyProvider: DenseKeyProvider<string>,\n\t\tprivate readonly getLanguageConfiguration: (languageId: string) => ResolvedLanguageConfiguration,\n\t) {\n\t}\n\n\tpublic didLanguageChange(languageId: string): boolean {\n\t\tconst existing = this.languageIdToBracketTokens.get(languageId);\n\t\tif (!existing) {\n\t\t\treturn false;\n\t\t}\n\t\tconst newRegExpStr = BracketTokens.createFromLanguage(this.getLanguageConfiguration(languageId), this.denseKeyProvider).getRegExpStr();\n\t\treturn existing.getRegExpStr() !== newRegExpStr;\n\t}\n\n\tgetSingleLanguageBracketTokens(languageId: string): BracketTokens {\n\t\tlet singleLanguageBracketTokens = this.languageIdToBracketTokens.get(languageId);\n\t\tif (!singleLanguageBracketTokens) {\n\t\t\tsingleLanguageBracketTokens = BracketTokens.createFromLanguage(this.getLanguageConfiguration(languageId), this.denseKeyProvider);\n\t\t\tthis.languageIdToBracketTokens.set(languageId, singleLanguageBracketTokens);\n\t\t}\n\t\treturn singleLanguageBracketTokens;\n\t}\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 { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { BracketInfo, BracketPairWithMinIndentationInfo } from 'vs/editor/common/textModelBracketPairs';\nimport { BackgroundTokenizationState, TextModel } from 'vs/editor/common/model/textModel';\nimport { IModelContentChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { AstNode, AstNodeKind } from './ast';\nimport { TextEditInfo } from './beforeEditPositionMapper';\nimport { LanguageAgnosticBracketTokens } from './brackets';\nimport { Length, lengthAdd, lengthGreaterThanEqual, lengthLessThanEqual, lengthOfString, lengthsToRange, lengthZero, positionToLength, toLength } from './length';\nimport { parseDocument } from './parser';\nimport { DenseKeyProvider } from './smallImmutableSet';\nimport { FastTokenizer, TextBufferTokenizer } from './tokenizer';\n\nexport class BracketPairsTree extends Disposable {\n\tprivate readonly didChangeEmitter = new Emitter<void>();\n\n\t/*\n\t\tThere are two trees:\n\t\t* The initial tree that has no token information and is used for performant initial bracket colorization.\n\t\t* The tree that used token information to detect bracket pairs.\n\n\t\tTo prevent flickering, we only switch from the initial tree to tree with token information\n\t\twhen tokenization completes.\n\t\tSince the text can be edited while background tokenization is in progress, we need to update both trees.\n\t*/\n\tprivate initialAstWithoutTokens: AstNode | undefined;\n\tprivate astWithTokens: AstNode | undefined;\n\n\tprivate readonly denseKeyProvider = new DenseKeyProvider<string>();\n\tprivate readonly brackets = new LanguageAgnosticBracketTokens(this.denseKeyProvider, this.getLanguageConfiguration);\n\n\tpublic didLanguageChange(languageId: string): boolean {\n\t\treturn this.brackets.didLanguageChange(languageId);\n\t}\n\n\tpublic readonly onDidChange = this.didChangeEmitter.event;\n\n\tpublic constructor(\n\t\tprivate readonly textModel: TextModel,\n\t\tprivate readonly getLanguageConfiguration: (languageId: string) => ResolvedLanguageConfiguration\n\t) {\n\t\tsuper();\n\n\t\tif (textModel.backgroundTokenizationState === BackgroundTokenizationState.Uninitialized) {\n\t\t\t// There are no token information yet\n\t\t\tconst brackets = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId());\n\t\t\tconst tokenizer = new FastTokenizer(this.textModel.getValue(), brackets);\n\t\t\tthis.initialAstWithoutTokens = parseDocument(tokenizer, [], undefined, true);\n\t\t\tthis.astWithTokens = this.initialAstWithoutTokens;\n\t\t} else if (textModel.backgroundTokenizationState === BackgroundTokenizationState.Completed) {\n\t\t\t// Skip the initial ast, as there is no flickering.\n\t\t\t// Directly create the tree with token information.\n\t\t\tthis.initialAstWithoutTokens = undefined;\n\t\t\tthis.astWithTokens = this.parseDocumentFromTextBuffer([], undefined, false);\n\t\t} else if (textModel.backgroundTokenizationState === BackgroundTokenizationState.InProgress) {\n\t\t\tthis.initialAstWithoutTokens = this.parseDocumentFromTextBuffer([], undefined, true);\n\t\t\tthis.astWithTokens = this.initialAstWithoutTokens;\n\t\t}\n\t}\n\n\t//#region TextModel events\n\n\tpublic handleDidChangeBackgroundTokenizationState(): void {\n\t\tif (this.textModel.backgroundTokenizationState === BackgroundTokenizationState.Completed) {\n\t\t\tconst wasUndefined = this.initialAstWithoutTokens === undefined;\n\t\t\t// Clear the initial tree as we can use the tree with token information now.\n\t\t\tthis.initialAstWithoutTokens = undefined;\n\t\t\tif (!wasUndefined) {\n\t\t\t\tthis.didChangeEmitter.fire();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleDidChangeTokens({ ranges }: IModelTokensChangedEvent): void {\n\t\tconst edits = ranges.map(r =>\n\t\t\tnew TextEditInfo(\n\t\t\t\ttoLength(r.fromLineNumber - 1, 0),\n\t\t\t\ttoLength(r.toLineNumber, 0),\n\t\t\t\ttoLength(r.toLineNumber - r.fromLineNumber + 1, 0)\n\t\t\t)\n\t\t);\n\t\tthis.astWithTokens = this.parseDocumentFromTextBuffer(edits, this.astWithTokens, false);\n\t\tif (!this.initialAstWithoutTokens) {\n\t\t\tthis.didChangeEmitter.fire();\n\t\t}\n\t}\n\n\tpublic handleContentChanged(change: IModelContentChangedEvent) {\n\t\tconst edits = change.changes.map(c => {\n\t\t\tconst range = Range.lift(c.range);\n\t\t\treturn new TextEditInfo(\n\t\t\t\tpositionToLength(range.getStartPosition()),\n\t\t\t\tpositionToLength(range.getEndPosition()),\n\t\t\t\tlengthOfString(c.text)\n\t\t\t);\n\t\t}).reverse();\n\n\t\tthis.astWithTokens = this.parseDocumentFromTextBuffer(edits, this.astWithTokens, false);\n\t\tif (this.initialAstWithoutTokens) {\n\t\t\tthis.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(edits, this.initialAstWithoutTokens, false);\n\t\t}\n\t}\n\n\t//#endregion\n\n\t/**\n\t * @pure (only if isPure = true)\n\t*/\n\tprivate parseDocumentFromTextBuffer(edits: TextEditInfo[], previousAst: AstNode | undefined, immutable: boolean): AstNode {\n\t\t// Is much faster if `isPure = false`.\n\t\tconst isPure = false;\n\t\tconst previousAstClone = isPure ? previousAst?.deepClone() : previousAst;\n\t\tconst tokenizer = new TextBufferTokenizer(this.textModel, this.brackets);\n\t\tconst result = parseDocument(tokenizer, edits, previousAstClone, immutable);\n\t\treturn result;\n\t}\n\n\tpublic getBracketsInRange(range: Range): BracketInfo[] {\n\t\tconst startOffset = toLength(range.startLineNumber - 1, range.startColumn - 1);\n\t\tconst endOffset = toLength(range.endLineNumber - 1, range.endColumn - 1);\n\t\tconst result = new Array<BracketInfo>();\n\t\tconst node = this.initialAstWithoutTokens || this.astWithTokens!;\n\t\tcollectBrackets(node, lengthZero, node.length, startOffset, endOffset, result);\n\t\treturn result;\n\t}\n\n\tpublic getBracketPairsInRange(range: Range, includeMinIndentation: boolean): BracketPairWithMinIndentationInfo[] {\n\t\tconst result = new Array<BracketPairWithMinIndentationInfo>();\n\n\t\tconst startLength = positionToLength(range.getStartPosition());\n\t\tconst endLength = positionToLength(range.getEndPosition());\n\n\t\tconst node = this.initialAstWithoutTokens || this.astWithTokens!;\n\t\tconst context = new CollectBracketPairsContext(result, includeMinIndentation, this.textModel);\n\t\tcollectBracketPairs(node, lengthZero, node.length, startLength, endLength, context);\n\n\t\treturn result;\n\t}\n}\n\nfunction collectBrackets(node: AstNode, nodeOffsetStart: Length, nodeOffsetEnd: Length, startOffset: Length, endOffset: Length, result: BracketInfo[], level: number = 0): void {\n\tif (node.kind === AstNodeKind.List) {\n\t\tfor (const child of node.children) {\n\t\t\tnodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length);\n\t\t\tif (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) {\n\t\t\t\tcollectBrackets(child, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, result, level);\n\t\t\t}\n\t\t\tnodeOffsetStart = nodeOffsetEnd;\n\t\t}\n\t} else if (node.kind === AstNodeKind.Pair) {\n\t\t// Don't use node.children here to improve performance\n\t\tlevel++;\n\n\t\t{\n\t\t\tconst child = node.openingBracket;\n\t\t\tnodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length);\n\t\t\tif (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) {\n\t\t\t\tconst range = lengthsToRange(nodeOffsetStart, nodeOffsetEnd);\n\t\t\t\tresult.push(new BracketInfo(range, level - 1, !node.closingBracket));\n\t\t\t}\n\t\t\tnodeOffsetStart = nodeOffsetEnd;\n\t\t}\n\n\t\tif (node.child) {\n\t\t\tconst child = node.child;\n\t\t\tnodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length);\n\t\t\tif (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) {\n\t\t\t\tcollectBrackets(child, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, result, level);\n\t\t\t}\n\t\t\tnodeOffsetStart = nodeOffsetEnd;\n\t\t}\n\t\tif (node.closingBracket) {\n\t\t\tconst child = node.closingBracket;\n\t\t\tnodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length);\n\t\t\tif (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) {\n\t\t\t\tconst range = lengthsToRange(nodeOffsetStart, nodeOffsetEnd);\n\t\t\t\tresult.push(new BracketInfo(range, level - 1, false));\n\t\t\t}\n\t\t\tnodeOffsetStart = nodeOffsetEnd;\n\t\t}\n\t} else if (node.kind === AstNodeKind.UnexpectedClosingBracket) {\n\t\tconst range = lengthsToRange(nodeOffsetStart, nodeOffsetEnd);\n\t\tresult.push(new BracketInfo(range, level - 1, true));\n\t} else if (node.kind === AstNodeKind.Bracket) {\n\t\tconst range = lengthsToRange(nodeOffsetStart, nodeOffsetEnd);\n\t\tresult.push(new BracketInfo(range, level - 1, false));\n\t}\n}\n\nclass CollectBracketPairsContext {\n\tconstructor(\n\t\tpublic readonly result: BracketPairWithMinIndentationInfo[],\n\t\tpublic readonly includeMinIndentation: boolean,\n\t\tpublic readonly textModel: ITextModel,\n\t) {\n\t}\n}\n\nfunction collectBracketPairs(node: AstNode, nodeOffset: Length, nodeOffsetEnd: Length, startOffset: Length, endOffset: Length, context: CollectBracketPairsContext, level: number = 0) {\n\tif (node.kind === AstNodeKind.Pair) {\n\t\tconst openingBracketEnd = lengthAdd(nodeOffset, node.openingBracket.length);\n\t\tlet minIndentation = -1;\n\t\tif (context.includeMinIndentation) {\n\t\t\tminIndentation = node.computeMinIndentation(nodeOffset, context.textModel);\n\t\t}\n\n\t\tcontext.result.push(new BracketPairWithMinIndentationInfo(\n\t\t\tlengthsToRange(nodeOffset, nodeOffsetEnd),\n\t\t\tlengthsToRange(nodeOffset, openingBracketEnd),\n\t\t\tnode.closingBracket\n\t\t\t\t? lengthsToRange(lengthAdd(openingBracketEnd, node.child?.length || lengthZero), nodeOffsetEnd)\n\t\t\t\t: undefined,\n\t\t\tlevel,\n\t\t\tminIndentation\n\t\t));\n\t\tlevel++;\n\t}\n\n\tlet curOffset = nodeOffset;\n\tfor (const child of node.children) {\n\t\tconst childOffset = curOffset;\n\t\tcurOffset = lengthAdd(curOffset, child.length);\n\n\t\tif (lengthLessThanEqual(childOffset, endOffset) && lengthLessThanEqual(startOffset, curOffset)) {\n\t\t\tcollectBracketPairs(child, childOffset, curOffset, startOffset, endOffset, context, level);\n\t\t}\n\t}\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 { Emitter } from 'vs/base/common/event';\nimport { Disposable, DisposableStore, IDisposable, IReference, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { BracketPairsTree } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree';\nimport { BracketInfo, BracketPairInfo, BracketPairWithMinIndentationInfo, IBracketPairsTextModelPart, IFoundBracket } from 'vs/editor/common/textModelBracketPairs';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { IModelContentChangedEvent, IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { ignoreBracketsInToken } from 'vs/editor/common/languages/supports';\nimport { RichEditBrackets, BracketsUtils, RichEditBracket } from 'vs/editor/common/languages/supports/richEditBrackets';\n\nexport class BracketPairsTextModelPart extends Disposable implements IBracketPairsTextModelPart {\n\tprivate readonly bracketPairsTree = this._register(new MutableDisposable<IReference<BracketPairsTree>>());\n\n\tprivate readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate get isDocumentSupported() {\n\t\tconst maxSupportedDocumentLength = /* max lines */ 50_000 * /* average column count */ 100;\n\t\treturn this.textModel.getValueLength() <= maxSupportedDocumentLength;\n\t}\n\n\tprivate bracketsRequested = false;\n\n\tpublic constructor(\n\t\tprivate readonly textModel: TextModel,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(\n\t\t\tthis.languageConfigurationService.onDidChange(e => {\n\t\t\t\tif (!e.languageId || this.bracketPairsTree.value?.object.didLanguageChange(e.languageId)) {\n\t\t\t\t\tthis.bracketPairsTree.clear();\n\t\t\t\t\tthis.updateBracketPairsTree();\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t}\n\n\t//#region TextModel events\n\n\tpublic handleDidChangeOptions(e: IModelOptionsChangedEvent): void {\n\t\tthis.bracketPairsTree.clear();\n\t\tthis.updateBracketPairsTree();\n\t}\n\n\tpublic handleDidChangeLanguage(e: IModelLanguageChangedEvent): void {\n\t\tthis.bracketPairsTree.clear();\n\t\tthis.updateBracketPairsTree();\n\t}\n\n\tpublic handleDidChangeContent(change: IModelContentChangedEvent) {\n\t\tthis.bracketPairsTree.value?.object.handleContentChanged(change);\n\t}\n\n\tpublic handleDidChangeBackgroundTokenizationState(): void {\n\t\tthis.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState();\n\t}\n\n\tpublic handleDidChangeTokens(e: IModelTokensChangedEvent): void {\n\t\tthis.bracketPairsTree.value?.object.handleDidChangeTokens(e);\n\t}\n\n\t//#endregion\n\n\tprivate updateBracketPairsTree() {\n\t\tif (this.bracketsRequested && this.isDocumentSupported) {\n\t\t\tif (!this.bracketPairsTree.value) {\n\t\t\t\tconst store = new DisposableStore();\n\n\t\t\t\tthis.bracketPairsTree.value = createDisposableRef(\n\t\t\t\t\tstore.add(\n\t\t\t\t\t\tnew BracketPairsTree(this.textModel, (languageId) => {\n\t\t\t\t\t\t\treturn this.languageConfigurationService.getLanguageConfiguration(languageId);\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\tstore\n\t\t\t\t);\n\t\t\t\tstore.add(this.bracketPairsTree.value.object.onDidChange(e => this.onDidChangeEmitter.fire(e)));\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.bracketPairsTree.value) {\n\t\t\t\tthis.bracketPairsTree.clear();\n\t\t\t\t// Important: Don't call fire if there was no change!\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns all bracket pairs that intersect the given range.\n\t * The result is sorted by the start position.\n\t*/\n\tpublic getBracketPairsInRange(range: Range): BracketPairInfo[] {\n\t\tthis.bracketsRequested = true;\n\t\tthis.updateBracketPairsTree();\n\t\treturn this.bracketPairsTree.value?.object.getBracketPairsInRange(range, false) || [];\n\t}\n\n\tpublic getBracketPairsInRangeWithMinIndentation(range: Range): BracketPairWithMinIndentationInfo[] {\n\t\tthis.bracketsRequested = true;\n\t\tthis.updateBracketPairsTree();\n\t\treturn this.bracketPairsTree.value?.object.getBracketPairsInRange(range, true) || [];\n\t}\n\n\tpublic getBracketsInRange(range: Range): BracketInfo[] {\n\t\tthis.bracketsRequested = true;\n\t\tthis.updateBracketPairsTree();\n\t\treturn this.bracketPairsTree.value?.object.getBracketsInRange(range) || [];\n\t}\n\n\tpublic findMatchingBracketUp(_bracket: string, _position: IPosition, maxDuration?: number): Range | null {\n\t\tconst bracket = _bracket.toLowerCase();\n\t\tconst position = this.textModel.validatePosition(_position);\n\n\t\tconst languageId = this.textModel.getLanguageIdAtPosition(position.lineNumber, position.column);\n\t\tconst bracketsSupport = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\n\t\tif (!bracketsSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst data = bracketsSupport.textIsBracket[bracket];\n\n\t\tif (!data) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn stripBracketSearchCanceled(this._findMatchingBracketUp(data, position, createTimeBasedContinueBracketSearchPredicate(maxDuration)));\n\t}\n\n\tpublic matchBracket(position: IPosition, maxDuration?: number): [Range, Range] | null {\n\t\tconst continueSearchPredicate = createTimeBasedContinueBracketSearchPredicate(maxDuration);\n\t\treturn this._matchBracket(this.textModel.validatePosition(position), continueSearchPredicate);\n\t}\n\n\tprivate _establishBracketSearchOffsets(position: Position, lineTokens: LineTokens, modeBrackets: RichEditBrackets, tokenIndex: number) {\n\t\tconst tokenCount = lineTokens.getCount();\n\t\tconst currentLanguageId = lineTokens.getLanguageId(tokenIndex);\n\n\t\t// limit search to not go before `maxBracketLength`\n\t\tlet searchStartOffset = Math.max(0, position.column - 1 - modeBrackets.maxBracketLength);\n\t\tfor (let i = tokenIndex - 1; i >= 0; i--) {\n\t\t\tconst tokenEndOffset = lineTokens.getEndOffset(i);\n\t\t\tif (tokenEndOffset <= searchStartOffset) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (ignoreBracketsInToken(lineTokens.getStandardTokenType(i)) || lineTokens.getLanguageId(i) !== currentLanguageId) {\n\t\t\t\tsearchStartOffset = tokenEndOffset;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// limit search to not go after `maxBracketLength`\n\t\tlet searchEndOffset = Math.min(lineTokens.getLineContent().length, position.column - 1 + modeBrackets.maxBracketLength);\n\t\tfor (let i = tokenIndex + 1; i < tokenCount; i++) {\n\t\t\tconst tokenStartOffset = lineTokens.getStartOffset(i);\n\t\t\tif (tokenStartOffset >= searchEndOffset) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (ignoreBracketsInToken(lineTokens.getStandardTokenType(i)) || lineTokens.getLanguageId(i) !== currentLanguageId) {\n\t\t\t\tsearchEndOffset = tokenStartOffset;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn { searchStartOffset, searchEndOffset };\n\t}\n\n\tprivate _matchBracket(position: Position, continueSearchPredicate: ContinueBracketSearchPredicate): [Range, Range] | null {\n\t\tconst lineNumber = position.lineNumber;\n\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\tconst tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\tif (tokenIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst currentModeBrackets = this.languageConfigurationService.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex)).brackets;\n\n\t\t// check that the token is not to be ignored\n\t\tif (currentModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex))) {\n\n\t\t\tlet { searchStartOffset, searchEndOffset } = this._establishBracketSearchOffsets(position, lineTokens, currentModeBrackets, tokenIndex);\n\n\t\t\t// it might be the case that [currentTokenStart -> currentTokenEnd] contains multiple brackets\n\t\t\t// `bestResult` will contain the most right-side result\n\t\t\tlet bestResult: [Range, Range] | null = null;\n\t\t\twhile (true) {\n\t\t\t\tconst foundBracket = BracketsUtils.findNextBracketInRange(currentModeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (!foundBracket) {\n\t\t\t\t\t// there are no more brackets in this text\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// check that we didn't hit a bracket too far away from position\n\t\t\t\tif (foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) {\n\t\t\t\t\tconst foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase();\n\t\t\t\t\tconst r = this._matchFoundBracket(foundBracket, currentModeBrackets.textIsBracket[foundBracketText], currentModeBrackets.textIsOpenBracket[foundBracketText], continueSearchPredicate);\n\t\t\t\t\tif (r) {\n\t\t\t\t\t\tif (r instanceof BracketSearchCanceled) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbestResult = r;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStartOffset = foundBracket.endColumn - 1;\n\t\t\t}\n\n\t\t\tif (bestResult) {\n\t\t\t\treturn bestResult;\n\t\t\t}\n\t\t}\n\n\t\t// If position is in between two tokens, try also looking in the previous token\n\t\tif (tokenIndex > 0 && lineTokens.getStartOffset(tokenIndex) === position.column - 1) {\n\t\t\tconst prevTokenIndex = tokenIndex - 1;\n\t\t\tconst prevModeBrackets = this.languageConfigurationService.getLanguageConfiguration(lineTokens.getLanguageId(prevTokenIndex)).brackets;\n\n\t\t\t// check that previous token is not to be ignored\n\t\t\tif (prevModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(prevTokenIndex))) {\n\n\t\t\t\tconst { searchStartOffset, searchEndOffset } = this._establishBracketSearchOffsets(position, lineTokens, prevModeBrackets, prevTokenIndex);\n\n\t\t\t\tconst foundBracket = BracketsUtils.findPrevBracketInRange(prevModeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\n\t\t\t\t// check that we didn't hit a bracket too far away from position\n\t\t\t\tif (foundBracket && foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) {\n\t\t\t\t\tconst foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase();\n\t\t\t\t\tconst r = this._matchFoundBracket(foundBracket, prevModeBrackets.textIsBracket[foundBracketText], prevModeBrackets.textIsOpenBracket[foundBracketText], continueSearchPredicate);\n\t\t\t\t\tif (r) {\n\t\t\t\t\t\tif (r instanceof BracketSearchCanceled) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _matchFoundBracket(foundBracket: Range, data: RichEditBracket, isOpen: boolean, continueSearchPredicate: ContinueBracketSearchPredicate): [Range, Range] | null | BracketSearchCanceled {\n\t\tif (!data) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst matched = (\n\t\t\tisOpen\n\t\t\t\t? this._findMatchingBracketDown(data, foundBracket.getEndPosition(), continueSearchPredicate)\n\t\t\t\t: this._findMatchingBracketUp(data, foundBracket.getStartPosition(), continueSearchPredicate)\n\t\t);\n\n\t\tif (!matched) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (matched instanceof BracketSearchCanceled) {\n\t\t\treturn matched;\n\t\t}\n\n\t\treturn [foundBracket, matched];\n\t}\n\n\tprivate _findMatchingBracketUp(bracket: RichEditBracket, position: Position, continueSearchPredicate: ContinueBracketSearchPredicate): Range | null | BracketSearchCanceled {\n\t\t// console.log('_findMatchingBracketUp: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position));\n\n\t\tconst languageId = bracket.languageId;\n\t\tconst reversedBracketRegex = bracket.reversedRegex;\n\t\tlet count = -1;\n\n\t\tlet totalCallCount = 0;\n\t\tconst searchPrevMatchingBracketInRange = (lineNumber: number, lineText: string, searchStartOffset: number, searchEndOffset: number): Range | null | BracketSearchCanceled => {\n\t\t\twhile (true) {\n\t\t\t\tif (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) {\n\t\t\t\t\treturn BracketSearchCanceled.INSTANCE;\n\t\t\t\t}\n\t\t\t\tconst r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (!r) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();\n\t\t\t\tif (bracket.isOpen(hitText)) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else if (bracket.isClose(hitText)) {\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn r;\n\t\t\t\t}\n\n\t\t\t\tsearchEndOffset = r.startColumn - 1;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tfor (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) {\n\t\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = tokenCount - 1;\n\t\t\tlet searchStartOffset = lineText.length;\n\t\t\tlet searchEndOffset = lineText.length;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStartOffset = position.column - 1;\n\t\t\t\tsearchEndOffset = position.column - 1;\n\t\t\t}\n\n\t\t\tlet prevSearchInToken = true;\n\t\t\tfor (; tokenIndex >= 0; tokenIndex--) {\n\t\t\t\tconst searchInToken = (lineTokens.getLanguageId(tokenIndex) === languageId && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)));\n\n\t\t\t\tif (searchInToken) {\n\t\t\t\t\t// this token should be searched\n\t\t\t\t\tif (prevSearchInToken) {\n\t\t\t\t\t\t// the previous token should be searched, simply extend searchStartOffset\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token should not be searched\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// this token should not be searched\n\t\t\t\t\tif (prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprevSearchInToken = searchInToken;\n\t\t\t}\n\n\t\t\tif (prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\tconst r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (r) {\n\t\t\t\t\treturn r;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMatchingBracketDown(bracket: RichEditBracket, position: Position, continueSearchPredicate: ContinueBracketSearchPredicate): Range | null | BracketSearchCanceled {\n\t\t// console.log('_findMatchingBracketDown: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position));\n\n\t\tconst languageId = bracket.languageId;\n\t\tconst bracketRegex = bracket.forwardRegex;\n\t\tlet count = 1;\n\n\t\tlet totalCallCount = 0;\n\t\tconst searchNextMatchingBracketInRange = (lineNumber: number, lineText: string, searchStartOffset: number, searchEndOffset: number): Range | null | BracketSearchCanceled => {\n\t\t\twhile (true) {\n\t\t\t\tif (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) {\n\t\t\t\t\treturn BracketSearchCanceled.INSTANCE;\n\t\t\t\t}\n\t\t\t\tconst r = BracketsUtils.findNextBracketInRange(bracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (!r) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();\n\t\t\t\tif (bracket.isOpen(hitText)) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else if (bracket.isClose(hitText)) {\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn r;\n\t\t\t\t}\n\n\t\t\t\tsearchStartOffset = r.endColumn - 1;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tconst lineCount = this.textModel.getLineCount();\n\t\tfor (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = 0;\n\t\t\tlet searchStartOffset = 0;\n\t\t\tlet searchEndOffset = 0;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStartOffset = position.column - 1;\n\t\t\t\tsearchEndOffset = position.column - 1;\n\t\t\t}\n\n\t\t\tlet prevSearchInToken = true;\n\t\t\tfor (; tokenIndex < tokenCount; tokenIndex++) {\n\t\t\t\tconst searchInToken = (lineTokens.getLanguageId(tokenIndex) === languageId && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)));\n\n\t\t\t\tif (searchInToken) {\n\t\t\t\t\t// this token should be searched\n\t\t\t\t\tif (prevSearchInToken) {\n\t\t\t\t\t\t// the previous token should be searched, simply extend searchEndOffset\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token should not be searched\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// this token should not be searched\n\t\t\t\t\tif (prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprevSearchInToken = searchInToken;\n\t\t\t}\n\n\t\t\tif (prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\tconst r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (r) {\n\t\t\t\t\treturn r;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic findPrevBracket(_position: IPosition): IFoundBracket | null {\n\t\tconst position = this.textModel.validatePosition(_position);\n\n\t\tlet languageId: string | null = null;\n\t\tlet modeBrackets: RichEditBrackets | null = null;\n\t\tfor (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) {\n\t\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = tokenCount - 1;\n\t\t\tlet searchStartOffset = lineText.length;\n\t\t\tlet searchEndOffset = lineText.length;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStartOffset = position.column - 1;\n\t\t\t\tsearchEndOffset = position.column - 1;\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet prevSearchInToken = true;\n\t\t\tfor (; tokenIndex >= 0; tokenIndex--) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\t// language id change!\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevSearchInToken = false;\n\t\t\t\t\t}\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t}\n\n\t\t\t\tconst searchInToken = (!!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)));\n\n\t\t\t\tif (searchInToken) {\n\t\t\t\t\t// this token should be searched\n\t\t\t\t\tif (prevSearchInToken) {\n\t\t\t\t\t\t// the previous token should be searched, simply extend searchStartOffset\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token should not be searched\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// this token should not be searched\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprevSearchInToken = searchInToken;\n\t\t\t}\n\n\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\tconst r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (r) {\n\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic findNextBracket(_position: IPosition): IFoundBracket | null {\n\t\tconst position = this.textModel.validatePosition(_position);\n\t\tconst lineCount = this.textModel.getLineCount();\n\n\t\tlet languageId: string | null = null;\n\t\tlet modeBrackets: RichEditBrackets | null = null;\n\t\tfor (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = 0;\n\t\t\tlet searchStartOffset = 0;\n\t\t\tlet searchEndOffset = 0;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStartOffset = position.column - 1;\n\t\t\t\tsearchEndOffset = position.column - 1;\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet prevSearchInToken = true;\n\t\t\tfor (; tokenIndex < tokenCount; tokenIndex++) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\t// language id change!\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevSearchInToken = false;\n\t\t\t\t\t}\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t}\n\n\t\t\t\tconst searchInToken = (!!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)));\n\t\t\t\tif (searchInToken) {\n\t\t\t\t\t// this token should be searched\n\t\t\t\t\tif (prevSearchInToken) {\n\t\t\t\t\t\t// the previous token should be searched, simply extend searchEndOffset\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token should not be searched\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// this token should not be searched\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprevSearchInToken = searchInToken;\n\t\t\t}\n\n\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\tconst r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (r) {\n\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic findEnclosingBrackets(_position: IPosition, maxDuration?: number): [Range, Range] | null {\n\t\tconst continueSearchPredicate = createTimeBasedContinueBracketSearchPredicate(maxDuration);\n\t\tconst position = this.textModel.validatePosition(_position);\n\t\tconst lineCount = this.textModel.getLineCount();\n\t\tconst savedCounts = new Map<string, number[]>();\n\n\t\tlet counts: number[] = [];\n\t\tconst resetCounts = (languageId: string, modeBrackets: RichEditBrackets | null) => {\n\t\t\tif (!savedCounts.has(languageId)) {\n\t\t\t\tconst tmp = [];\n\t\t\t\tfor (let i = 0, len = modeBrackets ? modeBrackets.brackets.length : 0; i < len; i++) {\n\t\t\t\t\ttmp[i] = 0;\n\t\t\t\t}\n\t\t\t\tsavedCounts.set(languageId, tmp);\n\t\t\t}\n\t\t\tcounts = savedCounts.get(languageId)!;\n\t\t};\n\n\t\tlet totalCallCount = 0;\n\t\tconst searchInRange = (modeBrackets: RichEditBrackets, lineNumber: number, lineText: string, searchStartOffset: number, searchEndOffset: number): [Range, Range] | null | BracketSearchCanceled => {\n\t\t\twhile (true) {\n\t\t\t\tif (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) {\n\t\t\t\t\treturn BracketSearchCanceled.INSTANCE;\n\t\t\t\t}\n\t\t\t\tconst r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (!r) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();\n\t\t\t\tconst bracket = modeBrackets.textIsBracket[hitText];\n\t\t\t\tif (bracket) {\n\t\t\t\t\tif (bracket.isOpen(hitText)) {\n\t\t\t\t\t\tcounts[bracket.index]++;\n\t\t\t\t\t} else if (bracket.isClose(hitText)) {\n\t\t\t\t\t\tcounts[bracket.index]--;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (counts[bracket.index] === -1) {\n\t\t\t\t\t\treturn this._matchFoundBracket(r, bracket, false, continueSearchPredicate);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStartOffset = r.endColumn - 1;\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\tlet languageId: string | null = null;\n\t\tlet modeBrackets: RichEditBrackets | null = null;\n\t\tfor (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineTokens = this.textModel.getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this.textModel.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = 0;\n\t\t\tlet searchStartOffset = 0;\n\t\t\tlet searchEndOffset = 0;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStartOffset = position.column - 1;\n\t\t\t\tsearchEndOffset = position.column - 1;\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t\tresetCounts(languageId, modeBrackets);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet prevSearchInToken = true;\n\t\t\tfor (; tokenIndex < tokenCount; tokenIndex++) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\t// language id change!\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn stripBracketSearchCanceled(r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevSearchInToken = false;\n\t\t\t\t\t}\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets;\n\t\t\t\t\tresetCounts(languageId, modeBrackets);\n\t\t\t\t}\n\n\t\t\t\tconst searchInToken = (!!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)));\n\t\t\t\tif (searchInToken) {\n\t\t\t\t\t// this token should be searched\n\t\t\t\t\tif (prevSearchInToken) {\n\t\t\t\t\t\t// the previous token should be searched, simply extend searchEndOffset\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token should not be searched\n\t\t\t\t\t\tsearchStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\t\t\tsearchEndOffset = lineTokens.getEndOffset(tokenIndex);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// this token should not be searched\n\t\t\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\t\t\tconst r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\treturn stripBracketSearchCanceled(r);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprevSearchInToken = searchInToken;\n\t\t\t}\n\n\t\t\tif (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) {\n\t\t\t\tconst r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset);\n\t\t\t\tif (r) {\n\t\t\t\t\treturn stripBracketSearchCanceled(r);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _toFoundBracket(modeBrackets: RichEditBrackets, r: Range): IFoundBracket | null {\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet text = this.textModel.getValueInRange(r);\n\t\ttext = text.toLowerCase();\n\n\t\tconst data = modeBrackets.textIsBracket[text];\n\t\tif (!data) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\trange: r,\n\t\t\topen: data.open,\n\t\t\tclose: data.close,\n\t\t\tisOpen: modeBrackets.textIsOpenBracket[text]\n\t\t};\n\t}\n}\n\nfunction createDisposableRef<T>(object: T, disposable?: IDisposable): IReference<T> {\n\treturn {\n\t\tobject,\n\t\tdispose: () => disposable?.dispose(),\n\t};\n}\n\ntype ContinueBracketSearchPredicate = (() => boolean);\n\nfunction createTimeBasedContinueBracketSearchPredicate(maxDuration: number | undefined): ContinueBracketSearchPredicate {\n\tif (typeof maxDuration === 'undefined') {\n\t\treturn () => true;\n\t} else {\n\t\tconst startTime = Date.now();\n\t\treturn () => {\n\t\t\treturn (Date.now() - startTime <= maxDuration);\n\t\t};\n\t}\n}\n\nclass BracketSearchCanceled {\n\tpublic static INSTANCE = new BracketSearchCanceled();\n\t_searchCanceledBrand = undefined;\n\tprivate constructor() { }\n}\n\nfunction stripBracketSearchCanceled<T>(result: T | null | BracketSearchCanceled): T | null {\n\tif (result instanceof BracketSearchCanceled) {\n\t\treturn null;\n\t}\n\treturn result;\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 { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { AstNode, AstNodeKind } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast';\nimport { LanguageAgnosticBracketTokens } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets';\nimport { Length, lengthAdd, lengthGetColumnCountIfZeroLineCount, lengthZero } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length';\nimport { parseDocument } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser';\nimport { DenseKeyProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet';\nimport { ITokenizerSource, TextBufferTokenizer } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer';\nimport { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens';\n\nexport function fixBracketsInLine(tokens: IViewLineTokens, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst denseKeyProvider = new DenseKeyProvider<string>();\n\tconst bracketTokens = new LanguageAgnosticBracketTokens(denseKeyProvider, (languageId) =>\n\t\tlanguageConfigurationService.getLanguageConfiguration(languageId)\n\t);\n\tconst tokenizer = new TextBufferTokenizer(\n\t\tnew StaticTokenizerSource([tokens]),\n\t\tbracketTokens\n\t);\n\tconst node = parseDocument(tokenizer, [], undefined, true);\n\n\tlet str = '';\n\tconst line = tokens.getLineContent();\n\n\tfunction processNode(node: AstNode, offset: Length) {\n\t\tif (node.kind === AstNodeKind.Pair) {\n\t\t\tprocessNode(node.openingBracket, offset);\n\t\t\toffset = lengthAdd(offset, node.openingBracket.length);\n\n\t\t\tif (node.child) {\n\t\t\t\tprocessNode(node.child, offset);\n\t\t\t\toffset = lengthAdd(offset, node.child.length);\n\t\t\t}\n\t\t\tif (node.closingBracket) {\n\t\t\t\tprocessNode(node.closingBracket, offset);\n\t\t\t\toffset = lengthAdd(offset, node.closingBracket.length);\n\t\t\t} else {\n\t\t\t\tconst singleLangBracketTokens = bracketTokens.getSingleLanguageBracketTokens(node.openingBracket.languageId);\n\n\t\t\t\tconst closingTokenText = singleLangBracketTokens.findClosingTokenText(node.openingBracket.bracketIds);\n\t\t\t\tstr += closingTokenText;\n\t\t\t}\n\t\t} else if (node.kind === AstNodeKind.UnexpectedClosingBracket) {\n\t\t\t// remove the bracket\n\t\t} else if (node.kind === AstNodeKind.Text || node.kind === AstNodeKind.Bracket) {\n\t\t\tstr += line.substring(\n\t\t\t\tlengthGetColumnCountIfZeroLineCount(offset),\n\t\t\t\tlengthGetColumnCountIfZeroLineCount(lengthAdd(offset, node.length))\n\t\t\t);\n\t\t} else if (node.kind === AstNodeKind.List) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tprocessNode(child, offset);\n\t\t\t\toffset = lengthAdd(offset, child.length);\n\t\t\t}\n\t\t}\n\t}\n\n\tprocessNode(node, lengthZero);\n\n\treturn str;\n}\n\nclass StaticTokenizerSource implements ITokenizerSource {\n\tconstructor(private readonly lines: IViewLineTokens[]) { }\n\tgetLineCount(): number {\n\t\treturn this.lines.length;\n\t}\n\tgetLineLength(lineNumber: number): number {\n\t\treturn this.lines[lineNumber - 1].getLineContent().length;\n\t}\n\tgetLineTokens(lineNumber: number): IViewLineTokens {\n\t\treturn this.lines[lineNumber - 1];\n\t}\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 { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Emitter } from 'vs/base/common/event';\nimport { KeyChord, KeyMod as ConstKeyMod } from 'vs/base/common/keyCodes';\nimport { URI } from 'vs/base/common/uri';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Token } from 'vs/editor/common/languages';\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\n\nexport class KeyMod {\n\tpublic static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;\n\tpublic static readonly Shift: number = ConstKeyMod.Shift;\n\tpublic static readonly Alt: number = ConstKeyMod.Alt;\n\tpublic static readonly WinCtrl: number = ConstKeyMod.WinCtrl;\n\n\tpublic static chord(firstPart: number, secondPart: number): number {\n\t\treturn KeyChord(firstPart, secondPart);\n\t}\n}\n\nexport function createMonacoBaseAPI(): typeof monaco {\n\treturn {\n\t\teditor: undefined!, // undefined override expected here\n\t\tlanguages: undefined!, // undefined override expected here\n\t\tCancellationTokenSource: CancellationTokenSource,\n\t\tEmitter: Emitter,\n\t\tKeyCode: standaloneEnums.KeyCode,\n\t\tKeyMod: KeyMod,\n\t\tPosition: Position,\n\t\tRange: Range,\n\t\tSelection: <any>Selection,\n\t\tSelectionDirection: standaloneEnums.SelectionDirection,\n\t\tMarkerSeverity: standaloneEnums.MarkerSeverity,\n\t\tMarkerTag: standaloneEnums.MarkerTag,\n\t\tUri: <any>URI,\n\t\tToken: Token\n\t};\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 { stringDiff } from 'vs/base/common/diff/diff';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { globals } from 'vs/base/common/platform';\nimport { URI } from 'vs/base/common/uri';\nimport { IRequestHandler } from 'vs/base/common/worker/simpleWorker';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { DiffComputer, IDiffComputationResult } from 'vs/editor/common/diff/diffComputer';\nimport { EndOfLineSequence } from 'vs/editor/common/model';\nimport { IMirrorTextModel, IModelChangedEvent, MirrorTextModel as BaseMirrorModel } from 'vs/editor/common/model/mirrorTextModel';\nimport { ensureValidWordDefinition, getWordAtText, IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { IInplaceReplaceSupportResult, ILink, TextEdit } from 'vs/editor/common/languages';\nimport { ILinkComputerTarget, computeLinks } from 'vs/editor/common/languages/linkComputer';\nimport { BasicInplaceReplace } from 'vs/editor/common/languages/supports/inplaceReplaceSupport';\nimport { IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker';\nimport { createMonacoBaseAPI } from 'vs/editor/common/services/editorBaseApi';\nimport * as types from 'vs/base/common/types';\nimport { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { UnicodeTextModelHighlighter, UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter';\n\nexport interface IMirrorModel extends IMirrorTextModel {\n\treadonly uri: URI;\n\treadonly version: number;\n\tgetValue(): string;\n}\n\nexport interface IWorkerContext<H = undefined> {\n\t/**\n\t * A proxy to the main thread host object.\n\t */\n\thost: H;\n\t/**\n\t * Get all available mirror models in this worker.\n\t */\n\tgetMirrorModels(): IMirrorModel[];\n}\n\n/**\n * @internal\n */\nexport interface IRawModelData {\n\turl: string;\n\tversionId: number;\n\tlines: string[];\n\tEOL: string;\n}\n\n/**\n * @internal\n */\nexport interface ICommonModel extends ILinkComputerTarget, IMirrorModel {\n\teol: string;\n\n\tgetLinesContent(): string[];\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[];\n\twords(wordDefinition: RegExp): Iterable<string>;\n\tgetValueInRange(range: IRange): string;\n\tgetWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null;\n\toffsetAt(position: IPosition): number;\n\tpositionAt(offset: number): IPosition;\n}\n\n/**\n * Range of a word inside a model.\n * @internal\n */\nexport interface IWordRange {\n\t/**\n\t * The index where the word starts.\n\t */\n\treadonly start: number;\n\t/**\n\t * The index where the word ends.\n\t */\n\treadonly end: number;\n}\n\n/**\n * @internal\n */\nexport class MirrorModel extends BaseMirrorModel implements ICommonModel {\n\n\tpublic get uri(): URI {\n\t\treturn this._uri;\n\t}\n\n\tpublic get eol(): string {\n\t\treturn this._eol;\n\t}\n\n\tpublic getValue(): string {\n\t\treturn this.getText();\n\t}\n\n\tpublic getLinesContent(): string[] {\n\t\treturn this._lines.slice(0);\n\t}\n\n\tpublic getLineCount(): number {\n\t\treturn this._lines.length;\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\treturn this._lines[lineNumber - 1];\n\t}\n\n\tpublic getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null {\n\n\t\tconst wordAtText = getWordAtText(\n\t\t\tposition.column,\n\t\t\tensureValidWordDefinition(wordDefinition),\n\t\t\tthis._lines[position.lineNumber - 1],\n\t\t\t0\n\t\t);\n\n\t\tif (wordAtText) {\n\t\t\treturn new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\n\tpublic words(wordDefinition: RegExp): Iterable<string> {\n\n\t\tconst lines = this._lines;\n\t\tconst wordenize = this._wordenize.bind(this);\n\n\t\tlet lineNumber = 0;\n\t\tlet lineText = '';\n\t\tlet wordRangesIdx = 0;\n\t\tlet wordRanges: IWordRange[] = [];\n\n\t\treturn {\n\t\t\t*[Symbol.iterator]() {\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (wordRangesIdx < wordRanges.length) {\n\t\t\t\t\t\tconst value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\n\t\t\t\t\t\twordRangesIdx += 1;\n\t\t\t\t\t\tyield value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (lineNumber < lines.length) {\n\t\t\t\t\t\t\tlineText = lines[lineNumber];\n\t\t\t\t\t\t\twordRanges = wordenize(lineText, wordDefinition);\n\t\t\t\t\t\t\twordRangesIdx = 0;\n\t\t\t\t\t\t\tlineNumber += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[] {\n\t\tconst content = this._lines[lineNumber - 1];\n\t\tconst ranges = this._wordenize(content, wordDefinition);\n\t\tconst words: IWordAtPosition[] = [];\n\t\tfor (const range of ranges) {\n\t\t\twords.push({\n\t\t\t\tword: content.substring(range.start, range.end),\n\t\t\t\tstartColumn: range.start + 1,\n\t\t\t\tendColumn: range.end + 1\n\t\t\t});\n\t\t}\n\t\treturn words;\n\t}\n\n\tprivate _wordenize(content: string, wordDefinition: RegExp): IWordRange[] {\n\t\tconst result: IWordRange[] = [];\n\t\tlet match: RegExpExecArray | null;\n\n\t\twordDefinition.lastIndex = 0; // reset lastIndex just to be sure\n\n\t\twhile (match = wordDefinition.exec(content)) {\n\t\t\tif (match[0].length === 0) {\n\t\t\t\t// it did match the empty string\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tresult.push({ start: match.index, end: match.index + match[0].length });\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getValueInRange(range: IRange): string {\n\t\trange = this._validateRange(range);\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\treturn this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\n\t\t}\n\n\t\tconst lineEnding = this._eol;\n\t\tconst startLineIndex = range.startLineNumber - 1;\n\t\tconst endLineIndex = range.endLineNumber - 1;\n\t\tconst resultLines: string[] = [];\n\n\t\tresultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\n\t\tfor (let i = startLineIndex + 1; i < endLineIndex; i++) {\n\t\t\tresultLines.push(this._lines[i]);\n\t\t}\n\t\tresultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\n\n\t\treturn resultLines.join(lineEnding);\n\t}\n\n\tpublic offsetAt(position: IPosition): number {\n\t\tposition = this._validatePosition(position);\n\t\tthis._ensureLineStarts();\n\t\treturn this._lineStarts!.getPrefixSum(position.lineNumber - 2) + (position.column - 1);\n\t}\n\n\tpublic positionAt(offset: number): IPosition {\n\t\toffset = Math.floor(offset);\n\t\toffset = Math.max(0, offset);\n\n\t\tthis._ensureLineStarts();\n\t\tconst out = this._lineStarts!.getIndexOf(offset);\n\t\tconst lineLength = this._lines[out.index].length;\n\n\t\t// Ensure we return a valid position\n\t\treturn {\n\t\t\tlineNumber: 1 + out.index,\n\t\t\tcolumn: 1 + Math.min(out.remainder, lineLength)\n\t\t};\n\t}\n\n\tprivate _validateRange(range: IRange): IRange {\n\n\t\tconst start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\n\t\tconst end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\n\n\t\tif (start.lineNumber !== range.startLineNumber\n\t\t\t|| start.column !== range.startColumn\n\t\t\t|| end.lineNumber !== range.endLineNumber\n\t\t\t|| end.column !== range.endColumn) {\n\n\t\t\treturn {\n\t\t\t\tstartLineNumber: start.lineNumber,\n\t\t\t\tstartColumn: start.column,\n\t\t\t\tendLineNumber: end.lineNumber,\n\t\t\t\tendColumn: end.column\n\t\t\t};\n\t\t}\n\n\t\treturn range;\n\t}\n\n\tprivate _validatePosition(position: IPosition): IPosition {\n\t\tif (!Position.isIPosition(position)) {\n\t\t\tthrow new Error('bad position');\n\t\t}\n\t\tlet { lineNumber, column } = position;\n\t\tlet hasChanged = false;\n\n\t\tif (lineNumber < 1) {\n\t\t\tlineNumber = 1;\n\t\t\tcolumn = 1;\n\t\t\thasChanged = true;\n\n\t\t} else if (lineNumber > this._lines.length) {\n\t\t\tlineNumber = this._lines.length;\n\t\t\tcolumn = this._lines[lineNumber - 1].length + 1;\n\t\t\thasChanged = true;\n\n\t\t} else {\n\t\t\tconst maxCharacter = this._lines[lineNumber - 1].length + 1;\n\t\t\tif (column < 1) {\n\t\t\t\tcolumn = 1;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\t\t\telse if (column > maxCharacter) {\n\t\t\t\tcolumn = maxCharacter;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasChanged) {\n\t\t\treturn position;\n\t\t} else {\n\t\t\treturn { lineNumber, column };\n\t\t}\n\t}\n}\n\n/**\n * @internal\n */\nexport interface IForeignModuleFactory {\n\t(ctx: IWorkerContext, createData: any): any;\n}\n\ndeclare const require: any;\n\n/**\n * @internal\n */\nexport class EditorSimpleWorker implements IRequestHandler, IDisposable {\n\t_requestHandlerBrand: any;\n\n\tprotected readonly _host: IEditorWorkerHost;\n\tprivate _models: { [uri: string]: MirrorModel };\n\tprivate readonly _foreignModuleFactory: IForeignModuleFactory | null;\n\tprivate _foreignModule: any;\n\n\tconstructor(host: IEditorWorkerHost, foreignModuleFactory: IForeignModuleFactory | null) {\n\t\tthis._host = host;\n\t\tthis._models = Object.create(null);\n\t\tthis._foreignModuleFactory = foreignModuleFactory;\n\t\tthis._foreignModule = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._models = Object.create(null);\n\t}\n\n\tprotected _getModel(uri: string): ICommonModel {\n\t\treturn this._models[uri];\n\t}\n\n\tprivate _getModels(): ICommonModel[] {\n\t\tconst all: MirrorModel[] = [];\n\t\tObject.keys(this._models).forEach((key) => all.push(this._models[key]));\n\t\treturn all;\n\t}\n\n\tpublic acceptNewModel(data: IRawModelData): void {\n\t\tthis._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);\n\t}\n\n\tpublic acceptModelChanged(strURL: string, e: IModelChangedEvent): void {\n\t\tif (!this._models[strURL]) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._models[strURL];\n\t\tmodel.onEvents(e);\n\t}\n\n\tpublic acceptRemovedModel(strURL: string): void {\n\t\tif (!this._models[strURL]) {\n\t\t\treturn;\n\t\t}\n\t\tdelete this._models[strURL];\n\t}\n\n\tpublic async computeUnicodeHighlights(url: string, options: UnicodeHighlighterOptions, range?: IRange): Promise<IUnicodeHighlightsResult> {\n\t\tconst model = this._getModel(url);\n\t\tif (!model) {\n\t\t\treturn { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };\n\t\t}\n\t\treturn UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range);\n\t}\n\n\t// ---- BEGIN diff --------------------------------------------------------------------------\n\n\tpublic async computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {\n\t\tconst original = this._getModel(originalUrl);\n\t\tconst modified = this._getModel(modifiedUrl);\n\t\tif (!original || !modified) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst originalLines = original.getLinesContent();\n\t\tconst modifiedLines = modified.getLinesContent();\n\t\tconst diffComputer = new DiffComputer(originalLines, modifiedLines, {\n\t\t\tshouldComputeCharChanges: true,\n\t\t\tshouldPostProcessCharChanges: true,\n\t\t\tshouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\n\t\t\tshouldMakePrettyDiff: true,\n\t\t\tmaxComputationTime: maxComputationTime\n\t\t});\n\n\t\tconst diffResult = diffComputer.computeDiff();\n\t\tconst identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified));\n\t\treturn {\n\t\t\tquitEarly: diffResult.quitEarly,\n\t\t\tidentical: identical,\n\t\t\tchanges: diffResult.changes\n\t\t};\n\t}\n\n\tprivate _modelsAreIdentical(original: ICommonModel, modified: ICommonModel): boolean {\n\t\tconst originalLineCount = original.getLineCount();\n\t\tconst modifiedLineCount = modified.getLineCount();\n\t\tif (originalLineCount !== modifiedLineCount) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let line = 1; line <= originalLineCount; line++) {\n\t\t\tconst originalLine = original.getLineContent(line);\n\t\t\tconst modifiedLine = modified.getLineContent(line);\n\t\t\tif (originalLine !== modifiedLine) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t// ---- END diff --------------------------------------------------------------------------\n\n\n\t// ---- BEGIN minimal edits ---------------------------------------------------------------\n\n\tprivate static readonly _diffLimit = 100000;\n\n\tpublic async computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): Promise<TextEdit[]> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn edits;\n\t\t}\n\n\t\tconst result: TextEdit[] = [];\n\t\tlet lastEol: EndOfLineSequence | undefined = undefined;\n\n\t\tedits = edits.slice(0).sort((a, b) => {\n\t\t\tif (a.range && b.range) {\n\t\t\t\treturn Range.compareRangesUsingStarts(a.range, b.range);\n\t\t\t}\n\t\t\t// eol only changes should go to the end\n\t\t\tconst aRng = a.range ? 0 : 1;\n\t\t\tconst bRng = b.range ? 0 : 1;\n\t\t\treturn aRng - bRng;\n\t\t});\n\n\t\tfor (let { range, text, eol } of edits) {\n\n\t\t\tif (typeof eol === 'number') {\n\t\t\t\tlastEol = eol;\n\t\t\t}\n\n\t\t\tif (Range.isEmpty(range) && !text) {\n\t\t\t\t// empty change\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst original = model.getValueInRange(range);\n\t\t\ttext = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\n\n\t\t\tif (original === text) {\n\t\t\t\t// noop\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make sure diff won't take too long\n\t\t\tif (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {\n\t\t\t\tresult.push({ range, text });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// compute diff between original and edit.text\n\t\t\tconst changes = stringDiff(original, text, false);\n\t\t\tconst editOffset = model.offsetAt(Range.lift(range).getStartPosition());\n\n\t\t\tfor (const change of changes) {\n\t\t\t\tconst start = model.positionAt(editOffset + change.originalStart);\n\t\t\t\tconst end = model.positionAt(editOffset + change.originalStart + change.originalLength);\n\t\t\t\tconst newEdit: TextEdit = {\n\t\t\t\t\ttext: text.substr(change.modifiedStart, change.modifiedLength),\n\t\t\t\t\trange: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\n\t\t\t\t};\n\n\t\t\t\tif (model.getValueInRange(newEdit.range) !== newEdit.text) {\n\t\t\t\t\tresult.push(newEdit);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof lastEol === 'number') {\n\t\t\tresult.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// ---- END minimal edits ---------------------------------------------------------------\n\n\tpublic async computeLinks(modelUrl: string): Promise<ILink[] | null> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn computeLinks(model);\n\t}\n\n\t// ---- BEGIN suggest --------------------------------------------------------------------------\n\n\tprivate static readonly _suggestionsLimit = 10000;\n\n\tpublic async textualSuggest(modelUrls: string[], leadingWord: string | undefined, wordDef: string, wordDefFlags: string): Promise<{ words: string[]; duration: number } | null> {\n\n\t\tconst sw = new StopWatch(true);\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\t\tconst seen = new Set<string>();\n\n\t\touter: for (let url of modelUrls) {\n\t\t\tconst model = this._getModel(url);\n\t\t\tif (!model) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let word of model.words(wordDefRegExp)) {\n\t\t\t\tif (word === leadingWord || !isNaN(Number(word))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tseen.add(word);\n\t\t\t\tif (seen.size > EditorSimpleWorker._suggestionsLimit) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { words: Array.from(seen), duration: sw.elapsed() };\n\t}\n\n\n\t// ---- END suggest --------------------------------------------------------------------------\n\n\t//#region -- word ranges --\n\n\tpublic async computeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[] }> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Object.create(null);\n\t\t}\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\t\tconst result: { [word: string]: IRange[] } = Object.create(null);\n\t\tfor (let line = range.startLineNumber; line < range.endLineNumber; line++) {\n\t\t\tconst words = model.getLineWords(line, wordDefRegExp);\n\t\t\tfor (const word of words) {\n\t\t\t\tif (!isNaN(Number(word.word))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet array = result[word.word];\n\t\t\t\tif (!array) {\n\t\t\t\t\tarray = [];\n\t\t\t\t\tresult[word.word] = array;\n\t\t\t\t}\n\t\t\t\tarray.push({\n\t\t\t\t\tstartLineNumber: line,\n\t\t\t\t\tstartColumn: word.startColumn,\n\t\t\t\t\tendLineNumber: line,\n\t\t\t\t\tendColumn: word.endColumn\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t//#endregion\n\n\tpublic async navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise<IInplaceReplaceSupportResult | null> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\n\t\tif (range.startColumn === range.endColumn) {\n\t\t\trange = {\n\t\t\t\tstartLineNumber: range.startLineNumber,\n\t\t\t\tstartColumn: range.startColumn,\n\t\t\t\tendLineNumber: range.endLineNumber,\n\t\t\t\tendColumn: range.endColumn + 1\n\t\t\t};\n\t\t}\n\n\t\tconst selectionText = model.getValueInRange(range);\n\n\t\tconst wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\n\t\tif (!wordRange) {\n\t\t\treturn null;\n\t\t}\n\t\tconst word = model.getValueInRange(wordRange);\n\t\tconst result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\n\t\treturn result;\n\t}\n\n\t// ---- BEGIN foreign module support --------------------------------------------------------------------------\n\n\tpublic loadForeignModule(moduleId: string, createData: any, foreignHostMethods: string[]): Promise<string[]> {\n\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\n\t\t\treturn this._host.fhr(method, args);\n\t\t};\n\n\t\tconst foreignHost = types.createProxyObject(foreignHostMethods, proxyMethodRequest);\n\n\t\tconst ctx: IWorkerContext<any> = {\n\t\t\thost: foreignHost,\n\t\t\tgetMirrorModels: (): IMirrorModel[] => {\n\t\t\t\treturn this._getModels();\n\t\t\t}\n\t\t};\n\n\t\tif (this._foreignModuleFactory) {\n\t\t\tthis._foreignModule = this._foreignModuleFactory(ctx, createData);\n\t\t\t// static foreing module\n\t\t\treturn Promise.resolve(types.getAllMethodNames(this._foreignModule));\n\t\t}\n\t\t// ESM-comment-begin\n\t\treturn new Promise<any>((resolve, reject) => {\n\t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\n\t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\n\n\t\t\t\tresolve(types.getAllMethodNames(this._foreignModule));\n\n\t\t\t}, reject);\n\t\t});\n\t\t// ESM-comment-end\n\n\t\t// ESM-uncomment-begin\n\t\t// return Promise.reject(new Error(`Unexpected usage`));\n\t\t// ESM-uncomment-end\n\t}\n\n\t// foreign method request\n\tpublic fmr(method: string, args: any[]): Promise<any> {\n\t\tif (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\n\t\t\treturn Promise.reject(new Error('Missing requestHandler or method: ' + method));\n\t\t}\n\n\t\ttry {\n\t\t\treturn Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));\n\t\t} catch (e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n\n\t// ---- END foreign module support --------------------------------------------------------------------------\n}\n\n/**\n * Called on the worker side\n * @internal\n */\nexport function create(host: IEditorWorkerHost): IRequestHandler {\n\treturn new EditorSimpleWorker(host, null);\n}\n\n// This is only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\nif (typeof importScripts === 'function') {\n\t// Running in a web worker\n\tglobals.monaco = createMonacoBaseAPI();\n}\n","\n\n/**\n * Represents contiguous tokens over a contiguous range of lines.\n */\nexport class ContiguousMultilineTokens {\n\n\t/**\n\t * The start line number for this block of tokens.\n\t */\n\tprivate _startLineNumber: number;\n\n\t/**\n\t * The tokens are stored in a binary format. There is an element for each line,\n\t * so `tokens[index]` contains all tokens on line `startLineNumber + index`.\n\t *\n\t * On a specific line, each token occupies two array indices. For token i:\n\t * - at offset 2*i => endOffset\n\t * - at offset 2*i + 1 => metadata\n\t *\n\t */\n\tprivate _tokens: (Uint32Array | ArrayBuffer | null)[];\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._startLineNumber + this._tokens.length - 1;\n\t}\n\n\tconstructor(startLineNumber: number, tokens: Uint32Array[]) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t}\n\n\t/**\n\t * @see {@link _tokens}\n\t */\n\tpublic getLineTokens(lineNumber: number): Uint32Array | ArrayBuffer | null {\n\t\treturn this._tokens[lineNumber - this._startLineNumber];\n\t}\n\n\tpublic appendLineTokens(lineTokens: Uint32Array): void {\n\t\tthis._tokens.push(lineTokens);\n\t}\n}\n","\nimport { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens';\n\nexport class ContiguousMultilineTokensBuilder {\n\n\tprivate readonly _tokens: ContiguousMultilineTokens[];\n\n\tconstructor() {\n\t\tthis._tokens = [];\n\t}\n\n\tpublic add(lineNumber: number, lineTokens: Uint32Array): void {\n\t\tif (this._tokens.length > 0) {\n\t\t\tconst last = this._tokens[this._tokens.length - 1];\n\t\t\tif (last.endLineNumber + 1 === lineNumber) {\n\t\t\t\t// append\n\t\t\t\tlast.appendLineTokens(lineTokens);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis._tokens.push(new ContiguousMultilineTokens(lineNumber, [lineTokens]));\n\t}\n\n\tpublic finalize(): ContiguousMultilineTokens[] {\n\t\treturn this._tokens;\n\t}\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 { ColorId, FontStyle, ILanguageIdCodec, ITokenPresentation, MetadataConsts, StandardTokenType, TokenMetadata } from 'vs/editor/common/languages';\n\nexport interface IViewLineTokens {\n\tequals(other: IViewLineTokens): boolean;\n\tgetCount(): number;\n\tgetForeground(tokenIndex: number): ColorId;\n\tgetEndOffset(tokenIndex: number): number;\n\tgetClassName(tokenIndex: number): string;\n\tgetInlineStyle(tokenIndex: number, colorMap: string[]): string;\n\tgetPresentation(tokenIndex: number): ITokenPresentation;\n\tfindTokenIndexAtOffset(offset: number): number;\n\tgetLineContent(): string;\n\tgetMetadata(tokenIndex: number): number;\n\tgetLanguageId(tokenIndex: number): string;\n}\n\nexport class LineTokens implements IViewLineTokens {\n\t_lineTokensBrand: void = undefined;\n\n\tprivate readonly _tokens: Uint32Array;\n\tprivate readonly _tokensCount: number;\n\tprivate readonly _text: string;\n\tprivate readonly _languageIdCodec: ILanguageIdCodec;\n\n\tpublic static defaultTokenMetadata = (\n\t\t(FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\n\n\tpublic static createEmpty(lineContent: string, decoder: ILanguageIdCodec): LineTokens {\n\t\tconst defaultMetadata = LineTokens.defaultTokenMetadata;\n\n\t\tconst tokens = new Uint32Array(2);\n\t\ttokens[0] = lineContent.length;\n\t\ttokens[1] = defaultMetadata;\n\n\t\treturn new LineTokens(tokens, lineContent, decoder);\n\t}\n\n\tconstructor(tokens: Uint32Array, text: string, decoder: ILanguageIdCodec) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokensCount = (this._tokens.length >>> 1);\n\t\tthis._text = text;\n\t\tthis._languageIdCodec = decoder;\n\t}\n\n\tpublic equals(other: IViewLineTokens): boolean {\n\t\tif (other instanceof LineTokens) {\n\t\t\treturn this.slicedEquals(other, 0, this._tokensCount);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic slicedEquals(other: LineTokens, sliceFromTokenIndex: number, sliceTokenCount: number): boolean {\n\t\tif (this._text !== other._text) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._tokensCount !== other._tokensCount) {\n\t\t\treturn false;\n\t\t}\n\t\tconst from = (sliceFromTokenIndex << 1);\n\t\tconst to = from + (sliceTokenCount << 1);\n\t\tfor (let i = from; i < to; i++) {\n\t\t\tif (this._tokens[i] !== other._tokens[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic getLineContent(): string {\n\t\treturn this._text;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokensCount;\n\t}\n\n\tpublic getStartOffset(tokenIndex: number): number {\n\t\tif (tokenIndex > 0) {\n\t\t\treturn this._tokens[(tokenIndex - 1) << 1];\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn metadata;\n\t}\n\n\tpublic getLanguageId(tokenIndex: number): string {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\tconst languageId = TokenMetadata.getLanguageId(metadata);\n\t\treturn this._languageIdCodec.decodeLanguageId(languageId);\n\t}\n\n\tpublic getStandardTokenType(tokenIndex: number): StandardTokenType {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getTokenType(metadata);\n\t}\n\n\tpublic getForeground(tokenIndex: number): ColorId {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getForeground(metadata);\n\t}\n\n\tpublic getClassName(tokenIndex: number): string {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getClassNameFromMetadata(metadata);\n\t}\n\n\tpublic getInlineStyle(tokenIndex: number, colorMap: string[]): string {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getInlineStyleFromMetadata(metadata, colorMap);\n\t}\n\n\tpublic getPresentation(tokenIndex: number): ITokenPresentation {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getPresentationFromMetadata(metadata);\n\t}\n\n\tpublic getEndOffset(tokenIndex: number): number {\n\t\treturn this._tokens[tokenIndex << 1];\n\t}\n\n\t/**\n\t * Find the token containing offset `offset`.\n\t * @param offset The search offset\n\t * @return The index of the token containing the offset.\n\t */\n\tpublic findTokenIndexAtOffset(offset: number): number {\n\t\treturn LineTokens.findIndexInTokensArray(this._tokens, offset);\n\t}\n\n\tpublic inflate(): IViewLineTokens {\n\t\treturn this;\n\t}\n\n\tpublic sliceAndInflate(startOffset: number, endOffset: number, deltaOffset: number): IViewLineTokens {\n\t\treturn new SliceLineTokens(this, startOffset, endOffset, deltaOffset);\n\t}\n\n\tpublic static convertToEndOffset(tokens: Uint32Array, lineTextLength: number): void {\n\t\tconst tokenCount = (tokens.length >>> 1);\n\t\tconst lastTokenIndex = tokenCount - 1;\n\t\tfor (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) {\n\t\t\ttokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1];\n\t\t}\n\t\ttokens[lastTokenIndex << 1] = lineTextLength;\n\t}\n\n\tpublic static findIndexInTokensArray(tokens: Uint32Array, desiredIndex: number): number {\n\t\tif (tokens.length <= 2) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet low = 0;\n\t\tlet high = (tokens.length >>> 1) - 1;\n\n\t\twhile (low < high) {\n\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst endOffset = tokens[(mid << 1)];\n\n\t\t\tif (endOffset === desiredIndex) {\n\t\t\t\treturn mid + 1;\n\t\t\t} else if (endOffset < desiredIndex) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (endOffset > desiredIndex) {\n\t\t\t\thigh = mid;\n\t\t\t}\n\t\t}\n\n\t\treturn low;\n\t}\n\n\t/**\n\t * @pure\n\t * @param insertTokens Must be sorted by offset.\n\t*/\n\tpublic withInserted(insertTokens: { offset: number; text: string; tokenMetadata: number }[]): LineTokens {\n\t\tif (insertTokens.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\tlet nextOriginalTokenIdx = 0;\n\t\tlet nextInsertTokenIdx = 0;\n\t\tlet text = '';\n\t\tconst newTokens = new Array<number>();\n\n\t\tlet originalEndOffset = 0;\n\t\twhile (true) {\n\t\t\tconst nextOriginalTokenEndOffset = nextOriginalTokenIdx < this._tokensCount ? this._tokens[nextOriginalTokenIdx << 1] : -1;\n\t\t\tconst nextInsertToken = nextInsertTokenIdx < insertTokens.length ? insertTokens[nextInsertTokenIdx] : null;\n\n\t\t\tif (nextOriginalTokenEndOffset !== -1 && (nextInsertToken === null || nextOriginalTokenEndOffset <= nextInsertToken.offset)) {\n\t\t\t\t// original token ends before next insert token\n\t\t\t\ttext += this._text.substring(originalEndOffset, nextOriginalTokenEndOffset);\n\t\t\t\tconst metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1];\n\t\t\t\tnewTokens.push(text.length, metadata);\n\t\t\t\tnextOriginalTokenIdx++;\n\t\t\t\toriginalEndOffset = nextOriginalTokenEndOffset;\n\n\t\t\t} else if (nextInsertToken) {\n\t\t\t\tif (nextInsertToken.offset > originalEndOffset) {\n\t\t\t\t\t// insert token is in the middle of the next token.\n\t\t\t\t\ttext += this._text.substring(originalEndOffset, nextInsertToken.offset);\n\t\t\t\t\tconst metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1];\n\t\t\t\t\tnewTokens.push(text.length, metadata);\n\t\t\t\t\toriginalEndOffset = nextInsertToken.offset;\n\t\t\t\t}\n\n\t\t\t\ttext += nextInsertToken.text;\n\t\t\t\tnewTokens.push(text.length, nextInsertToken.tokenMetadata);\n\t\t\t\tnextInsertTokenIdx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new LineTokens(new Uint32Array(newTokens), text, this._languageIdCodec);\n\t}\n}\n\nclass SliceLineTokens implements IViewLineTokens {\n\n\tprivate readonly _source: LineTokens;\n\tprivate readonly _startOffset: number;\n\tprivate readonly _endOffset: number;\n\tprivate readonly _deltaOffset: number;\n\n\tprivate readonly _firstTokenIndex: number;\n\tprivate readonly _tokensCount: number;\n\n\tconstructor(source: LineTokens, startOffset: number, endOffset: number, deltaOffset: number) {\n\t\tthis._source = source;\n\t\tthis._startOffset = startOffset;\n\t\tthis._endOffset = endOffset;\n\t\tthis._deltaOffset = deltaOffset;\n\t\tthis._firstTokenIndex = source.findTokenIndexAtOffset(startOffset);\n\n\t\tthis._tokensCount = 0;\n\t\tfor (let i = this._firstTokenIndex, len = source.getCount(); i < len; i++) {\n\t\t\tconst tokenStartOffset = source.getStartOffset(i);\n\t\t\tif (tokenStartOffset >= endOffset) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._tokensCount++;\n\t\t}\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._source.getMetadata(this._firstTokenIndex + tokenIndex);\n\t}\n\n\tpublic getLanguageId(tokenIndex: number): string {\n\t\treturn this._source.getLanguageId(this._firstTokenIndex + tokenIndex);\n\t}\n\n\tpublic getLineContent(): string {\n\t\treturn this._source.getLineContent().substring(this._startOffset, this._endOffset);\n\t}\n\n\tpublic equals(other: IViewLineTokens): boolean {\n\t\tif (other instanceof SliceLineTokens) {\n\t\t\treturn (\n\t\t\t\tthis._startOffset === other._startOffset\n\t\t\t\t&& this._endOffset === other._endOffset\n\t\t\t\t&& this._deltaOffset === other._deltaOffset\n\t\t\t\t&& this._source.slicedEquals(other._source, this._firstTokenIndex, this._tokensCount)\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokensCount;\n\t}\n\n\tpublic getForeground(tokenIndex: number): ColorId {\n\t\treturn this._source.getForeground(this._firstTokenIndex + tokenIndex);\n\t}\n\n\tpublic getEndOffset(tokenIndex: number): number {\n\t\tconst tokenEndOffset = this._source.getEndOffset(this._firstTokenIndex + tokenIndex);\n\t\treturn Math.min(this._endOffset, tokenEndOffset) - this._startOffset + this._deltaOffset;\n\t}\n\n\tpublic getClassName(tokenIndex: number): string {\n\t\treturn this._source.getClassName(this._firstTokenIndex + tokenIndex);\n\t}\n\n\tpublic getInlineStyle(tokenIndex: number, colorMap: string[]): string {\n\t\treturn this._source.getInlineStyle(this._firstTokenIndex + tokenIndex, colorMap);\n\t}\n\n\tpublic getPresentation(tokenIndex: number): ITokenPresentation {\n\t\treturn this._source.getPresentation(this._firstTokenIndex + tokenIndex);\n\t}\n\n\tpublic findTokenIndexAtOffset(offset: number): number {\n\t\treturn this._source.findTokenIndexAtOffset(offset + this._startOffset - this._deltaOffset) - this._firstTokenIndex;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { ILanguageIdCodec, IState, ITokenizationSupport, LanguageId, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { NullState, nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\n\nexport type IReducedTokenizationSupport = Omit<ITokenizationSupport, 'tokenize'>;\n\nconst fallback: IReducedTokenizationSupport = {\n\tgetInitialState: () => NullState,\n\ttokenizeEncoded: (buffer: string, hasEOL: boolean, state: IState) => nullTokenizeEncoded(LanguageId.Null, state)\n};\n\nexport async function tokenizeToString(languageService: ILanguageService, text: string, languageId: string | null): Promise<string> {\n\tif (!languageId) {\n\t\treturn _tokenizeToString(text, languageService.languageIdCodec, fallback);\n\t}\n\tconst tokenizationSupport = await TokenizationRegistry.getOrCreate(languageId);\n\treturn _tokenizeToString(text, languageService.languageIdCodec, tokenizationSupport || fallback);\n}\n\nexport function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens, colorMap: string[], startOffset: number, endOffset: number, tabSize: number, useNbsp: boolean): string {\n\tlet result = `<div>`;\n\tlet charIndex = startOffset;\n\tlet tabsCharDelta = 0;\n\n\tlet prevIsSpace = true;\n\n\tfor (let tokenIndex = 0, tokenCount = viewLineTokens.getCount(); tokenIndex < tokenCount; tokenIndex++) {\n\t\tconst tokenEndIndex = viewLineTokens.getEndOffset(tokenIndex);\n\n\t\tif (tokenEndIndex <= startOffset) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet partContent = '';\n\n\t\tfor (; charIndex < tokenEndIndex && charIndex < endOffset; charIndex++) {\n\t\t\tconst charCode = text.charCodeAt(charIndex);\n\n\t\t\tswitch (charCode) {\n\t\t\t\tcase CharCode.Tab: {\n\t\t\t\t\tlet insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\n\t\t\t\t\ttabsCharDelta += insertSpacesCount - 1;\n\t\t\t\t\twhile (insertSpacesCount > 0) {\n\t\t\t\t\t\tif (useNbsp && prevIsSpace) {\n\t\t\t\t\t\t\tpartContent += ' ';\n\t\t\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpartContent += ' ';\n\t\t\t\t\t\t\tprevIsSpace = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertSpacesCount--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CharCode.LessThan:\n\t\t\t\t\tpartContent += '<';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.GreaterThan:\n\t\t\t\t\tpartContent += '>';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.Ampersand:\n\t\t\t\t\tpartContent += '&';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.Null:\n\t\t\t\t\tpartContent += '�';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.UTF8_BOM:\n\t\t\t\tcase CharCode.LINE_SEPARATOR:\n\t\t\t\tcase CharCode.PARAGRAPH_SEPARATOR:\n\t\t\t\tcase CharCode.NEXT_LINE:\n\t\t\t\t\tpartContent += '\\ufffd';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.CarriageReturn:\n\t\t\t\t\t// zero width space, because carriage return would introduce a line break\n\t\t\t\t\tpartContent += '​';\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.Space:\n\t\t\t\t\tif (useNbsp && prevIsSpace) {\n\t\t\t\t\t\tpartContent += ' ';\n\t\t\t\t\t\tprevIsSpace = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpartContent += ' ';\n\t\t\t\t\t\tprevIsSpace = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tpartContent += String.fromCharCode(charCode);\n\t\t\t\t\tprevIsSpace = false;\n\t\t\t}\n\t\t}\n\n\t\tresult += `<span style=\"${viewLineTokens.getInlineStyle(tokenIndex, colorMap)}\">${partContent}</span>`;\n\n\t\tif (tokenEndIndex > endOffset || charIndex >= endOffset) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tresult += `</div>`;\n\treturn result;\n}\n\nexport function _tokenizeToString(text: string, languageIdCodec: ILanguageIdCodec, tokenizationSupport: IReducedTokenizationSupport): string {\n\tlet result = `<div class=\"monaco-tokenized-source\">`;\n\tconst lines = strings.splitLines(text);\n\tlet currentState = tokenizationSupport.getInitialState();\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst line = lines[i];\n\n\t\tif (i > 0) {\n\t\t\tresult += `<br/>`;\n\t\t}\n\n\t\tconst tokenizationResult = tokenizationSupport.tokenizeEncoded(line, true, currentState);\n\t\tLineTokens.convertToEndOffset(tokenizationResult.tokens, line.length);\n\t\tconst lineTokens = new LineTokens(tokenizationResult.tokens, line, languageIdCodec);\n\t\tconst viewLineTokens = lineTokens.inflate();\n\n\t\tlet startOffset = 0;\n\t\tfor (let j = 0, lenJ = viewLineTokens.getCount(); j < lenJ; j++) {\n\t\t\tconst type = viewLineTokens.getClassName(j);\n\t\t\tconst endIndex = viewLineTokens.getEndOffset(j);\n\t\t\tresult += `<span class=\"${type}\">${strings.escape(line.substring(startOffset, endIndex))}</span>`;\n\t\t\tstartOffset = endIndex;\n\t\t}\n\n\t\tcurrentState = tokenizationResult.endState;\n\t}\n\n\tresult += `</div>`;\n\treturn result;\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 * as arrays from 'vs/base/common/arrays';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { EncodedTokenizationResult, ILanguageIdCodec, IState, ITokenizationSupport, StandardTokenType, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { countEOL } from 'vs/editor/common/core/eolCounter';\nimport { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder';\nimport { runWhenIdle, IdleDeadline } from 'vs/base/common/async';\nimport { setTimeout0 } from 'vs/base/common/platform';\nimport { IModelContentChangedEvent, IModelLanguageChangedEvent } from 'vs/editor/common/textModelEvents';\n\nconst enum Constants {\n\tCHEAP_TOKENIZATION_LENGTH_LIMIT = 2048\n}\n\n/**\n * An array that avoids being sparse by always\n * filling up unused indices with a default value.\n */\nclass ContiguousGrowingArray<T> {\n\n\tprivate _store: T[] = [];\n\n\tconstructor(\n\t\tprivate readonly _default: T\n\t) { }\n\n\tpublic get(index: number): T {\n\t\tif (index < this._store.length) {\n\t\t\treturn this._store[index];\n\t\t}\n\t\treturn this._default;\n\t}\n\n\tpublic set(index: number, value: T): void {\n\t\twhile (index >= this._store.length) {\n\t\t\tthis._store[this._store.length] = this._default;\n\t\t}\n\t\tthis._store[index] = value;\n\t}\n\n\tpublic delete(deleteIndex: number, deleteCount: number): void {\n\t\tif (deleteCount === 0 || deleteIndex >= this._store.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._store.splice(deleteIndex, deleteCount);\n\t}\n\n\tpublic insert(insertIndex: number, insertCount: number): void {\n\t\tif (insertCount === 0 || insertIndex >= this._store.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst arr: T[] = [];\n\t\tfor (let i = 0; i < insertCount; i++) {\n\t\t\tarr[i] = this._default;\n\t\t}\n\t\tthis._store = arrays.arrayInsert(this._store, insertIndex, arr);\n\t}\n}\n\n/**\n * Stores the states at the start of each line and keeps track of which lines\n * must be retokenized. Also uses state equality to quickly validate lines\n * that don't need to be retokenized.\n *\n * For example, when typing on a line, the line gets marked as needing to be tokenized.\n * Once the line is tokenized, the end state is checked for equality against the begin\n * state of the next line. If the states are equal, tokenization doesn't need to run\n * again over the rest of the file. If the states are not equal, the next line gets marked\n * as needing to be tokenized.\n */\nexport class TokenizationStateStore {\n\n\t/**\n\t * `lineBeginState[i]` contains the begin state used to tokenize line number `i + 1`.\n\t */\n\tprivate readonly _lineBeginState = new ContiguousGrowingArray<IState | null>(null);\n\t/**\n\t * `lineNeedsTokenization[i]` describes if line number `i + 1` needs to be tokenized.\n\t */\n\tprivate readonly _lineNeedsTokenization = new ContiguousGrowingArray<boolean>(true);\n\t/**\n\t * `invalidLineStartIndex` indicates that line number `invalidLineStartIndex + 1`\n\t * is the first one that needs to be retokenized.\n\t */\n\tprivate _firstLineNeedsTokenization: number;\n\n\tpublic get invalidLineStartIndex() {\n\t\treturn this._firstLineNeedsTokenization;\n\t}\n\n\tconstructor(\n\t\tpublic readonly tokenizationSupport: ITokenizationSupport,\n\t\tpublic readonly initialState: IState\n\t) {\n\t\tthis._firstLineNeedsTokenization = 0;\n\t\tthis._lineBeginState.set(0, this.initialState);\n\t}\n\n\tpublic markMustBeTokenized(lineIndex: number): void {\n\t\tthis._lineNeedsTokenization.set(lineIndex, true);\n\t\tthis._firstLineNeedsTokenization = Math.min(this._firstLineNeedsTokenization, lineIndex);\n\t}\n\n\tpublic getBeginState(lineIndex: number): IState | null {\n\t\treturn this._lineBeginState.get(lineIndex);\n\t}\n\n\tpublic setEndState(linesLength: number, lineIndex: number, endState: IState): void {\n\t\tthis._lineNeedsTokenization.set(lineIndex, false);\n\t\tthis._firstLineNeedsTokenization = lineIndex + 1;\n\n\t\t// Check if this was the last line\n\t\tif (lineIndex === linesLength - 1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if the end state has changed\n\t\tconst previousEndState = this._lineBeginState.get(lineIndex + 1);\n\t\tif (previousEndState === null || !endState.equals(previousEndState)) {\n\t\t\tthis._lineBeginState.set(lineIndex + 1, endState);\n\t\t\tthis.markMustBeTokenized(lineIndex + 1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Perhaps we can skip tokenizing some lines...\n\t\tlet i = lineIndex + 1;\n\t\twhile (i < linesLength) {\n\t\t\tif (this._lineNeedsTokenization.get(i)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tthis._firstLineNeedsTokenization = i;\n\t}\n\n\t//#region Editing\n\n\tpublic applyEdits(range: IRange, eolCount: number): void {\n\t\tthis.markMustBeTokenized(range.startLineNumber - 1);\n\n\t\tthis._lineBeginState.delete(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t\tthis._lineNeedsTokenization.delete(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\n\t\tthis._lineBeginState.insert(range.startLineNumber, eolCount);\n\t\tthis._lineNeedsTokenization.insert(range.startLineNumber, eolCount);\n\t}\n\n\t//#endregion\n}\n\nexport class TextModelTokenization extends Disposable {\n\n\tprivate _tokenizationStateStore: TokenizationStateStore | null;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(\n\t\tprivate readonly _textModel: TextModel,\n\t\tprivate readonly _languageIdCodec: ILanguageIdCodec\n\t) {\n\t\tsuper();\n\t\tthis._isDisposed = false;\n\t\tthis._tokenizationStateStore = null;\n\n\t\tthis._register(TokenizationRegistry.onDidChange((e) => {\n\t\t\tconst languageId = this._textModel.getLanguageId();\n\t\t\tif (e.changedLanguages.indexOf(languageId) === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._resetTokenizationState();\n\t\t\tthis._textModel.clearTokens();\n\t\t}));\n\n\t\tthis._resetTokenizationState();\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tsuper.dispose();\n\t}\n\n\t//#region TextModel events\n\n\tpublic handleDidChangeContent(e: IModelContentChangedEvent): void {\n\t\tif (e.isFlush) {\n\t\t\tthis._resetTokenizationState();\n\t\t\treturn;\n\t\t}\n\t\tif (this._tokenizationStateStore) {\n\t\t\tfor (let i = 0, len = e.changes.length; i < len; i++) {\n\t\t\t\tconst change = e.changes[i];\n\t\t\t\tconst [eolCount] = countEOL(change.text);\n\t\t\t\tthis._tokenizationStateStore.applyEdits(change.range, eolCount);\n\t\t\t}\n\t\t}\n\n\t\tthis._beginBackgroundTokenization();\n\t}\n\n\tpublic handleDidChangeAttached(): void {\n\t\tthis._beginBackgroundTokenization();\n\t}\n\n\tpublic handleDidChangeLanguage(e: IModelLanguageChangedEvent): void {\n\t\tthis._resetTokenizationState();\n\t\tthis._textModel.clearTokens();\n\t}\n\n\t//#endregion\n\n\tprivate _resetTokenizationState(): void {\n\t\tconst [tokenizationSupport, initialState] = initializeTokenization(this._textModel);\n\t\tif (tokenizationSupport && initialState) {\n\t\t\tthis._tokenizationStateStore = new TokenizationStateStore(tokenizationSupport, initialState);\n\t\t} else {\n\t\t\tthis._tokenizationStateStore = null;\n\t\t}\n\t\tthis._beginBackgroundTokenization();\n\t}\n\n\tprivate _isScheduled = false;\n\tprivate _beginBackgroundTokenization(): void {\n\t\tif (this._isScheduled || !this._textModel.isAttachedToEditor() || !this._hasLinesToTokenize()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._isScheduled = true;\n\t\trunWhenIdle((deadline) => {\n\t\t\tthis._isScheduled = false;\n\n\t\t\tthis._backgroundTokenizeWithDeadline(deadline);\n\t\t});\n\t}\n\n\t/**\n\t * Tokenize until the deadline occurs, but try to yield every 1-2ms.\n\t */\n\tprivate _backgroundTokenizeWithDeadline(deadline: IdleDeadline): void {\n\t\t// Read the time remaining from the `deadline` immediately because it is unclear\n\t\t// if the `deadline` object will be valid after execution leaves this function.\n\t\tconst endTime = Date.now() + deadline.timeRemaining();\n\n\t\tconst execute = () => {\n\t\t\tif (this._isDisposed || !this._textModel.isAttachedToEditor() || !this._hasLinesToTokenize()) {\n\t\t\t\t// disposed in the meantime or detached or finished\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._backgroundTokenizeForAtLeast1ms();\n\n\t\t\tif (Date.now() < endTime) {\n\t\t\t\t// There is still time before reaching the deadline, so yield to the browser and then\n\t\t\t\t// continue execution\n\t\t\t\tsetTimeout0(execute);\n\t\t\t} else {\n\t\t\t\t// The deadline has been reached, so schedule a new idle callback if necessary\n\t\t\t\tthis._beginBackgroundTokenization();\n\t\t\t}\n\t\t};\n\t\texecute();\n\t}\n\n\t/**\n\t * Tokenize for at least 1ms.\n\t */\n\tprivate _backgroundTokenizeForAtLeast1ms(): void {\n\t\tconst lineCount = this._textModel.getLineCount();\n\t\tconst builder = new ContiguousMultilineTokensBuilder();\n\t\tconst sw = StopWatch.create(false);\n\n\t\tdo {\n\t\t\tif (sw.elapsed() > 1) {\n\t\t\t\t// the comparison is intentionally > 1 and not >= 1 to ensure that\n\t\t\t\t// a full millisecond has elapsed, given how microseconds are rounded\n\t\t\t\t// to milliseconds\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst tokenizedLineNumber = this._tokenizeOneInvalidLine(builder);\n\n\t\t\tif (tokenizedLineNumber >= lineCount) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (this._hasLinesToTokenize());\n\n\t\tthis._textModel.setTokens(builder.finalize(), !this._hasLinesToTokenize());\n\t}\n\n\tpublic tokenizeViewport(startLineNumber: number, endLineNumber: number): void {\n\t\tconst builder = new ContiguousMultilineTokensBuilder();\n\t\tthis._tokenizeViewport(builder, startLineNumber, endLineNumber);\n\t\tthis._textModel.setTokens(builder.finalize(), !this._hasLinesToTokenize());\n\t}\n\n\tpublic reset(): void {\n\t\tthis._resetTokenizationState();\n\t\tthis._textModel.clearTokens();\n\t}\n\n\tpublic forceTokenization(lineNumber: number): void {\n\t\tconst builder = new ContiguousMultilineTokensBuilder();\n\t\tthis._updateTokensUntilLine(builder, lineNumber);\n\t\tthis._textModel.setTokens(builder.finalize(), !this._hasLinesToTokenize());\n\t}\n\n\tpublic getTokenTypeIfInsertingCharacter(position: Position, character: string): StandardTokenType {\n\t\tif (!this._tokenizationStateStore) {\n\t\t\treturn StandardTokenType.Other;\n\t\t}\n\n\t\tthis.forceTokenization(position.lineNumber);\n\t\tconst lineStartState = this._tokenizationStateStore.getBeginState(position.lineNumber - 1);\n\t\tif (!lineStartState) {\n\t\t\treturn StandardTokenType.Other;\n\t\t}\n\n\t\tconst languageId = this._textModel.getLanguageId();\n\t\tconst lineContent = this._textModel.getLineContent(position.lineNumber);\n\n\t\t// Create the text as if `character` was inserted\n\t\tconst text = (\n\t\t\tlineContent.substring(0, position.column - 1)\n\t\t\t+ character\n\t\t\t+ lineContent.substring(position.column - 1)\n\t\t);\n\n\t\tconst r = safeTokenize(this._languageIdCodec, languageId, this._tokenizationStateStore.tokenizationSupport, text, true, lineStartState);\n\t\tconst lineTokens = new LineTokens(r.tokens, text, this._languageIdCodec);\n\t\tif (lineTokens.getCount() === 0) {\n\t\t\treturn StandardTokenType.Other;\n\t\t}\n\n\t\tconst tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\treturn lineTokens.getStandardTokenType(tokenIndex);\n\t}\n\n\tpublic tokenizeLineWithEdit(position: Position, length: number, newText: string): LineTokens | null {\n\t\tconst lineNumber = position.lineNumber;\n\t\tconst column = position.column;\n\n\t\tif (!this._tokenizationStateStore) {\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.forceTokenization(lineNumber);\n\t\tconst lineStartState = this._tokenizationStateStore.getBeginState(lineNumber - 1);\n\t\tif (!lineStartState) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst curLineContent = this._textModel.getLineContent(lineNumber);\n\t\tconst newLineContent = curLineContent.substring(0, column - 1)\n\t\t\t+ newText + curLineContent.substring(column - 1 + length);\n\n\t\tconst languageId = this._textModel.getLanguageIdAtPosition(lineNumber, 0);\n\t\tconst result = safeTokenize(\n\t\t\tthis._languageIdCodec,\n\t\t\tlanguageId,\n\t\t\tthis._tokenizationStateStore.tokenizationSupport,\n\t\t\tnewLineContent,\n\t\t\ttrue,\n\t\t\tlineStartState\n\t\t);\n\n\t\tconst lineTokens = new LineTokens(result.tokens, newLineContent, this._languageIdCodec);\n\t\treturn lineTokens;\n\t}\n\n\tpublic isCheapToTokenize(lineNumber: number): boolean {\n\t\tif (!this._tokenizationStateStore) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst firstInvalidLineNumber = this._tokenizationStateStore.invalidLineStartIndex + 1;\n\t\tif (lineNumber > firstInvalidLineNumber) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (lineNumber < firstInvalidLineNumber) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this._textModel.getLineLength(lineNumber) < Constants.CHEAP_TOKENIZATION_LENGTH_LIMIT) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate _hasLinesToTokenize(): boolean {\n\t\tif (!this._tokenizationStateStore) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (this._tokenizationStateStore.invalidLineStartIndex < this._textModel.getLineCount());\n\t}\n\n\tprivate _tokenizeOneInvalidLine(builder: ContiguousMultilineTokensBuilder): number {\n\t\tif (!this._tokenizationStateStore || !this._hasLinesToTokenize()) {\n\t\t\treturn this._textModel.getLineCount() + 1;\n\t\t}\n\t\tconst lineNumber = this._tokenizationStateStore.invalidLineStartIndex + 1;\n\t\tthis._updateTokensUntilLine(builder, lineNumber);\n\t\treturn lineNumber;\n\t}\n\n\tprivate _updateTokensUntilLine(builder: ContiguousMultilineTokensBuilder, lineNumber: number): void {\n\t\tif (!this._tokenizationStateStore) {\n\t\t\treturn;\n\t\t}\n\t\tconst languageId = this._textModel.getLanguageId();\n\t\tconst linesLength = this._textModel.getLineCount();\n\t\tconst endLineIndex = lineNumber - 1;\n\n\t\t// Validate all states up to and including endLineIndex\n\t\tfor (let lineIndex = this._tokenizationStateStore.invalidLineStartIndex; lineIndex <= endLineIndex; lineIndex++) {\n\t\t\tconst text = this._textModel.getLineContent(lineIndex + 1);\n\t\t\tconst lineStartState = this._tokenizationStateStore.getBeginState(lineIndex);\n\n\t\t\tconst r = safeTokenize(this._languageIdCodec, languageId, this._tokenizationStateStore.tokenizationSupport, text, true, lineStartState!);\n\t\t\tbuilder.add(lineIndex + 1, r.tokens);\n\t\t\tthis._tokenizationStateStore.setEndState(linesLength, lineIndex, r.endState);\n\t\t\tlineIndex = this._tokenizationStateStore.invalidLineStartIndex - 1; // -1 because the outer loop increments it\n\t\t}\n\t}\n\n\tprivate _tokenizeViewport(builder: ContiguousMultilineTokensBuilder, startLineNumber: number, endLineNumber: number): void {\n\t\tif (!this._tokenizationStateStore) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (endLineNumber <= this._tokenizationStateStore.invalidLineStartIndex) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (startLineNumber <= this._tokenizationStateStore.invalidLineStartIndex) {\n\t\t\t// tokenization has reached the viewport start...\n\t\t\tthis._updateTokensUntilLine(builder, endLineNumber);\n\t\t\treturn;\n\t\t}\n\n\t\tlet nonWhitespaceColumn = this._textModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tconst fakeLines: string[] = [];\n\t\tlet initialState: IState | null = null;\n\t\tfor (let i = startLineNumber - 1; nonWhitespaceColumn > 1 && i >= 1; i--) {\n\t\t\tconst newNonWhitespaceIndex = this._textModel.getLineFirstNonWhitespaceColumn(i);\n\n\t\t\tif (newNonWhitespaceIndex === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (newNonWhitespaceIndex < nonWhitespaceColumn) {\n\t\t\t\tinitialState = this._tokenizationStateStore.getBeginState(i - 1);\n\t\t\t\tif (initialState) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfakeLines.push(this._textModel.getLineContent(i));\n\t\t\t\tnonWhitespaceColumn = newNonWhitespaceIndex;\n\t\t\t}\n\t\t}\n\n\t\tif (!initialState) {\n\t\t\tinitialState = this._tokenizationStateStore.initialState;\n\t\t}\n\n\t\tconst languageId = this._textModel.getLanguageId();\n\t\tlet state = initialState;\n\t\tfor (let i = fakeLines.length - 1; i >= 0; i--) {\n\t\t\tconst r = safeTokenize(this._languageIdCodec, languageId, this._tokenizationStateStore.tokenizationSupport, fakeLines[i], false, state);\n\t\t\tstate = r.endState;\n\t\t}\n\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst text = this._textModel.getLineContent(lineNumber);\n\t\t\tconst r = safeTokenize(this._languageIdCodec, languageId, this._tokenizationStateStore.tokenizationSupport, text, true, state);\n\t\t\tbuilder.add(lineNumber, r.tokens);\n\t\t\tthis._tokenizationStateStore.markMustBeTokenized(lineNumber - 1);\n\t\t\tstate = r.endState;\n\t\t}\n\t}\n}\n\nfunction initializeTokenization(textModel: TextModel): [ITokenizationSupport, IState] | [null, null] {\n\tif (textModel.isTooLargeForTokenization()) {\n\t\treturn [null, null];\n\t}\n\tconst tokenizationSupport = TokenizationRegistry.get(textModel.getLanguageId());\n\tif (!tokenizationSupport) {\n\t\treturn [null, null];\n\t}\n\tlet initialState: IState;\n\ttry {\n\t\tinitialState = tokenizationSupport.getInitialState();\n\t} catch (e) {\n\t\tonUnexpectedError(e);\n\t\treturn [null, null];\n\t}\n\treturn [tokenizationSupport, initialState];\n}\n\nfunction safeTokenize(languageIdCodec: ILanguageIdCodec, languageId: string, tokenizationSupport: ITokenizationSupport | null, text: string, hasEOL: boolean, state: IState): EncodedTokenizationResult {\n\tlet r: EncodedTokenizationResult | null = null;\n\n\tif (tokenizationSupport) {\n\t\ttry {\n\t\t\tr = tokenizationSupport.tokenizeEncoded(text, hasEOL, state.clone());\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tif (!r) {\n\t\tr = nullTokenizeEncoded(languageIdCodec.encodeLanguageId(languageId), state);\n\t}\n\n\tLineTokens.convertToEndOffset(r.tokens, text.length);\n\treturn r;\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 { LineTokens } from 'vs/editor/common/tokens/lineTokens';\n\nexport const EMPTY_LINE_TOKENS = (new Uint32Array(0)).buffer;\n\nexport class ContiguousTokensEditing {\n\n\tpublic static deleteBeginning(lineTokens: Uint32Array | ArrayBuffer | null, toChIndex: number): Uint32Array | ArrayBuffer | null {\n\t\tif (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn lineTokens;\n\t\t}\n\t\treturn ContiguousTokensEditing.delete(lineTokens, 0, toChIndex);\n\t}\n\n\tpublic static deleteEnding(lineTokens: Uint32Array | ArrayBuffer | null, fromChIndex: number): Uint32Array | ArrayBuffer | null {\n\t\tif (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn lineTokens;\n\t\t}\n\n\t\tconst tokens = toUint32Array(lineTokens);\n\t\tconst lineTextLength = tokens[tokens.length - 2];\n\t\treturn ContiguousTokensEditing.delete(lineTokens, fromChIndex, lineTextLength);\n\t}\n\n\tpublic static delete(lineTokens: Uint32Array | ArrayBuffer | null, fromChIndex: number, toChIndex: number): Uint32Array | ArrayBuffer | null {\n\t\tif (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS || fromChIndex === toChIndex) {\n\t\t\treturn lineTokens;\n\t\t}\n\n\t\tconst tokens = toUint32Array(lineTokens);\n\t\tconst tokensCount = (tokens.length >>> 1);\n\n\t\t// special case: deleting everything\n\t\tif (fromChIndex === 0 && tokens[tokens.length - 2] === toChIndex) {\n\t\t\treturn EMPTY_LINE_TOKENS;\n\t\t}\n\n\t\tconst fromTokenIndex = LineTokens.findIndexInTokensArray(tokens, fromChIndex);\n\t\tconst fromTokenStartOffset = (fromTokenIndex > 0 ? tokens[(fromTokenIndex - 1) << 1] : 0);\n\t\tconst fromTokenEndOffset = tokens[fromTokenIndex << 1];\n\n\t\tif (toChIndex < fromTokenEndOffset) {\n\t\t\t// the delete range is inside a single token\n\t\t\tconst delta = (toChIndex - fromChIndex);\n\t\t\tfor (let i = fromTokenIndex; i < tokensCount; i++) {\n\t\t\t\ttokens[i << 1] -= delta;\n\t\t\t}\n\t\t\treturn lineTokens;\n\t\t}\n\n\t\tlet dest: number;\n\t\tlet lastEnd: number;\n\t\tif (fromTokenStartOffset !== fromChIndex) {\n\t\t\ttokens[fromTokenIndex << 1] = fromChIndex;\n\t\t\tdest = ((fromTokenIndex + 1) << 1);\n\t\t\tlastEnd = fromChIndex;\n\t\t} else {\n\t\t\tdest = (fromTokenIndex << 1);\n\t\t\tlastEnd = fromTokenStartOffset;\n\t\t}\n\n\t\tconst delta = (toChIndex - fromChIndex);\n\t\tfor (let tokenIndex = fromTokenIndex + 1; tokenIndex < tokensCount; tokenIndex++) {\n\t\t\tconst tokenEndOffset = tokens[tokenIndex << 1] - delta;\n\t\t\tif (tokenEndOffset > lastEnd) {\n\t\t\t\ttokens[dest++] = tokenEndOffset;\n\t\t\t\ttokens[dest++] = tokens[(tokenIndex << 1) + 1];\n\t\t\t\tlastEnd = tokenEndOffset;\n\t\t\t}\n\t\t}\n\n\t\tif (dest === tokens.length) {\n\t\t\t// nothing to trim\n\t\t\treturn lineTokens;\n\t\t}\n\n\t\tconst tmp = new Uint32Array(dest);\n\t\ttmp.set(tokens.subarray(0, dest), 0);\n\t\treturn tmp.buffer;\n\t}\n\n\tpublic static append(lineTokens: Uint32Array | ArrayBuffer | null, _otherTokens: Uint32Array | ArrayBuffer | null): Uint32Array | ArrayBuffer | null {\n\t\tif (_otherTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn lineTokens;\n\t\t}\n\t\tif (lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn _otherTokens;\n\t\t}\n\t\tif (lineTokens === null) {\n\t\t\treturn lineTokens;\n\t\t}\n\t\tif (_otherTokens === null) {\n\t\t\t// cannot determine combined line length...\n\t\t\treturn null;\n\t\t}\n\t\tconst myTokens = toUint32Array(lineTokens);\n\t\tconst otherTokens = toUint32Array(_otherTokens);\n\t\tconst otherTokensCount = (otherTokens.length >>> 1);\n\n\t\tconst result = new Uint32Array(myTokens.length + otherTokens.length);\n\t\tresult.set(myTokens, 0);\n\t\tlet dest = myTokens.length;\n\t\tconst delta = myTokens[myTokens.length - 2];\n\t\tfor (let i = 0; i < otherTokensCount; i++) {\n\t\t\tresult[dest++] = otherTokens[(i << 1)] + delta;\n\t\t\tresult[dest++] = otherTokens[(i << 1) + 1];\n\t\t}\n\t\treturn result.buffer;\n\t}\n\n\tpublic static insert(lineTokens: Uint32Array | ArrayBuffer | null, chIndex: number, textLength: number): Uint32Array | ArrayBuffer | null {\n\t\tif (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\t// nothing to do\n\t\t\treturn lineTokens;\n\t\t}\n\n\t\tconst tokens = toUint32Array(lineTokens);\n\t\tconst tokensCount = (tokens.length >>> 1);\n\n\t\tlet fromTokenIndex = LineTokens.findIndexInTokensArray(tokens, chIndex);\n\t\tif (fromTokenIndex > 0) {\n\t\t\tconst fromTokenStartOffset = tokens[(fromTokenIndex - 1) << 1];\n\t\t\tif (fromTokenStartOffset === chIndex) {\n\t\t\t\tfromTokenIndex--;\n\t\t\t}\n\t\t}\n\t\tfor (let tokenIndex = fromTokenIndex; tokenIndex < tokensCount; tokenIndex++) {\n\t\t\ttokens[tokenIndex << 1] += textLength;\n\t\t}\n\t\treturn lineTokens;\n\t}\n}\n\nexport function toUint32Array(arr: Uint32Array | ArrayBuffer): Uint32Array {\n\tif (arr instanceof Uint32Array) {\n\t\treturn arr;\n\t} else {\n\t\treturn new Uint32Array(arr);\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ContiguousTokensEditing, EMPTY_LINE_TOKENS, toUint32Array } from 'vs/editor/common/tokens/contiguousTokensEditing';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { ColorId, FontStyle, ILanguageIdCodec, LanguageId, MetadataConsts, StandardTokenType, TokenMetadata } from 'vs/editor/common/languages';\n\n/**\n * Represents contiguous tokens in a text model.\n */\nexport class ContiguousTokensStore {\n\tprivate _lineTokens: (Uint32Array | ArrayBuffer | null)[];\n\tprivate _len: number;\n\tprivate readonly _languageIdCodec: ILanguageIdCodec;\n\n\tconstructor(languageIdCodec: ILanguageIdCodec) {\n\t\tthis._lineTokens = [];\n\t\tthis._len = 0;\n\t\tthis._languageIdCodec = languageIdCodec;\n\t}\n\n\tpublic flush(): void {\n\t\tthis._lineTokens = [];\n\t\tthis._len = 0;\n\t}\n\n\tpublic getTokens(topLevelLanguageId: string, lineIndex: number, lineText: string): LineTokens {\n\t\tlet rawLineTokens: Uint32Array | ArrayBuffer | null = null;\n\t\tif (lineIndex < this._len) {\n\t\t\trawLineTokens = this._lineTokens[lineIndex];\n\t\t}\n\n\t\tif (rawLineTokens !== null && rawLineTokens !== EMPTY_LINE_TOKENS) {\n\t\t\treturn new LineTokens(toUint32Array(rawLineTokens), lineText, this._languageIdCodec);\n\t\t}\n\n\t\tconst lineTokens = new Uint32Array(2);\n\t\tlineTokens[0] = lineText.length;\n\t\tlineTokens[1] = getDefaultMetadata(this._languageIdCodec.encodeLanguageId(topLevelLanguageId));\n\t\treturn new LineTokens(lineTokens, lineText, this._languageIdCodec);\n\t}\n\n\tprivate static _massageTokens(topLevelLanguageId: LanguageId, lineTextLength: number, _tokens: Uint32Array | ArrayBuffer | null): Uint32Array | ArrayBuffer {\n\n\t\tconst tokens = _tokens ? toUint32Array(_tokens) : null;\n\n\t\tif (lineTextLength === 0) {\n\t\t\tlet hasDifferentLanguageId = false;\n\t\t\tif (tokens && tokens.length > 1) {\n\t\t\t\thasDifferentLanguageId = (TokenMetadata.getLanguageId(tokens[1]) !== topLevelLanguageId);\n\t\t\t}\n\n\t\t\tif (!hasDifferentLanguageId) {\n\t\t\t\treturn EMPTY_LINE_TOKENS;\n\t\t\t}\n\t\t}\n\n\t\tif (!tokens || tokens.length === 0) {\n\t\t\tconst tokens = new Uint32Array(2);\n\t\t\ttokens[0] = lineTextLength;\n\t\t\ttokens[1] = getDefaultMetadata(topLevelLanguageId);\n\t\t\treturn tokens.buffer;\n\t\t}\n\n\t\t// Ensure the last token covers the end of the text\n\t\ttokens[tokens.length - 2] = lineTextLength;\n\n\t\tif (tokens.byteOffset === 0 && tokens.byteLength === tokens.buffer.byteLength) {\n\t\t\t// Store directly the ArrayBuffer pointer to save an object\n\t\t\treturn tokens.buffer;\n\t\t}\n\t\treturn tokens;\n\t}\n\n\tprivate _ensureLine(lineIndex: number): void {\n\t\twhile (lineIndex >= this._len) {\n\t\t\tthis._lineTokens[this._len] = null;\n\t\t\tthis._len++;\n\t\t}\n\t}\n\n\tprivate _deleteLines(start: number, deleteCount: number): void {\n\t\tif (deleteCount === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (start + deleteCount > this._len) {\n\t\t\tdeleteCount = this._len - start;\n\t\t}\n\t\tthis._lineTokens.splice(start, deleteCount);\n\t\tthis._len -= deleteCount;\n\t}\n\n\tprivate _insertLines(insertIndex: number, insertCount: number): void {\n\t\tif (insertCount === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst lineTokens: (Uint32Array | ArrayBuffer | null)[] = [];\n\t\tfor (let i = 0; i < insertCount; i++) {\n\t\t\tlineTokens[i] = null;\n\t\t}\n\t\tthis._lineTokens = arrays.arrayInsert(this._lineTokens, insertIndex, lineTokens);\n\t\tthis._len += insertCount;\n\t}\n\n\tpublic setTokens(topLevelLanguageId: string, lineIndex: number, lineTextLength: number, _tokens: Uint32Array | ArrayBuffer | null, checkEquality: boolean): boolean {\n\t\tconst tokens = ContiguousTokensStore._massageTokens(this._languageIdCodec.encodeLanguageId(topLevelLanguageId), lineTextLength, _tokens);\n\t\tthis._ensureLine(lineIndex);\n\t\tconst oldTokens = this._lineTokens[lineIndex];\n\t\tthis._lineTokens[lineIndex] = tokens;\n\n\t\tif (checkEquality) {\n\t\t\treturn !ContiguousTokensStore._equals(oldTokens, tokens);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate static _equals(_a: Uint32Array | ArrayBuffer | null, _b: Uint32Array | ArrayBuffer | null) {\n\t\tif (!_a || !_b) {\n\t\t\treturn !_a && !_b;\n\t\t}\n\n\t\tconst a = toUint32Array(_a);\n\t\tconst b = toUint32Array(_b);\n\n\t\tif (a.length !== b.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0, len = a.length; i < len; i++) {\n\t\t\tif (a[i] !== b[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t//#region Editing\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength);\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\n\t\tconst firstLineIndex = range.startLineNumber - 1;\n\t\tif (firstLineIndex >= this._len) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\tif (range.startColumn === range.endColumn) {\n\t\t\t\t// Nothing to delete\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lineTokens[firstLineIndex] = ContiguousTokensEditing.delete(this._lineTokens[firstLineIndex], range.startColumn - 1, range.endColumn - 1);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lineTokens[firstLineIndex] = ContiguousTokensEditing.deleteEnding(this._lineTokens[firstLineIndex], range.startColumn - 1);\n\n\t\tconst lastLineIndex = range.endLineNumber - 1;\n\t\tlet lastLineTokens: Uint32Array | ArrayBuffer | null = null;\n\t\tif (lastLineIndex < this._len) {\n\t\t\tlastLineTokens = ContiguousTokensEditing.deleteBeginning(this._lineTokens[lastLineIndex], range.endColumn - 1);\n\t\t}\n\n\t\t// Take remaining text on last line and append it to remaining text on first line\n\t\tthis._lineTokens[firstLineIndex] = ContiguousTokensEditing.append(this._lineTokens[firstLineIndex], lastLineTokens);\n\n\t\t// Delete middle lines\n\t\tthis._deleteLines(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - 1;\n\t\tif (lineIndex >= this._len) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (eolCount === 0) {\n\t\t\t// Inserting text on one line\n\t\t\tthis._lineTokens[lineIndex] = ContiguousTokensEditing.insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lineTokens[lineIndex] = ContiguousTokensEditing.deleteEnding(this._lineTokens[lineIndex], position.column - 1);\n\t\tthis._lineTokens[lineIndex] = ContiguousTokensEditing.insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength);\n\n\t\tthis._insertLines(position.lineNumber, eolCount);\n\t}\n\n\t//#endregion\n}\n\nfunction getDefaultMetadata(topLevelLanguageId: LanguageId): number {\n\treturn (\n\t\t(topLevelLanguageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t| (StandardTokenType.Other << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t| (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\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 { CharCode } from 'vs/base/common/charCode';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { countEOL } from 'vs/editor/common/core/eolCounter';\n\n/**\n * Represents sparse tokens over a contiguous range of lines.\n */\nexport class SparseMultilineTokens {\n\n\tpublic static create(startLineNumber: number, tokens: Uint32Array): SparseMultilineTokens {\n\t\treturn new SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens));\n\t}\n\n\tprivate _startLineNumber: number;\n\tprivate _endLineNumber: number;\n\tprivate readonly _tokens: SparseMultilineTokensStorage;\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._endLineNumber;\n\t}\n\n\tprivate constructor(startLineNumber: number, tokens: SparseMultilineTokensStorage) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic toString(): string {\n\t\treturn this._tokens.toString(this._startLineNumber);\n\t}\n\n\tprivate _updateEndLineNumber(): void {\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this._tokens.isEmpty();\n\t}\n\n\tpublic getLineTokens(lineNumber: number): SparseLineTokens | null {\n\t\tif (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) {\n\t\t\treturn this._tokens.getLineTokens(lineNumber - this._startLineNumber);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst deltaRange = this._tokens.getRange();\n\t\tif (!deltaRange) {\n\t\t\treturn deltaRange;\n\t\t}\n\t\treturn new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn);\n\t}\n\n\tpublic removeTokens(range: Range): void {\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tthis._startLineNumber += this._tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tpublic split(range: Range): [SparseMultilineTokens, SparseMultilineTokens] {\n\t\t// split tokens to two:\n\t\t// a) all the tokens before `range`\n\t\t// b) all the tokens after `range`\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tconst [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\treturn [new SparseMultilineTokens(this._startLineNumber, a), new SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)];\n\t}\n\n\tpublic applyEdit(range: IRange, text: string): void {\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\t\tthis.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : CharCode.Null);\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\t// Nothing to delete\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst lastLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tif (lastLineIndex < 0) {\n\t\t\t// this deletion occurs entirely before this block, so we only need to adjust line numbers\n\t\t\tconst deletedLinesCount = lastLineIndex - firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedLinesCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (firstLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion occurs entirely after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion completely encompasses this block\n\t\t\tthis._startLineNumber = 0;\n\t\t\tthis._tokens.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0) {\n\t\t\tconst deletedBefore = -firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedBefore;\n\n\t\t\tthis._tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1);\n\t\t} else {\n\t\t\tthis._tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - this._startLineNumber;\n\n\t\tif (lineIndex < 0) {\n\t\t\t// this insertion occurs before this block, so we only need to adjust line numbers\n\t\t\tthis._startLineNumber += eolCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (lineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this insertion occurs after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t}\n}\n\nclass SparseMultilineTokensStorage {\n\t/**\n\t * The encoding of tokens is:\n\t * 4*i deltaLine (from `startLineNumber`)\n\t * 4*i+1 startCharacter (from the line start)\n\t * 4*i+2 endCharacter (from the line start)\n\t * 4*i+3 metadata\n\t */\n\tprivate readonly _tokens: Uint32Array;\n\tprivate _tokenCount: number;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokenCount = tokens.length / 4;\n\t}\n\n\tpublic toString(startLineNumber: number): string {\n\t\tconst pieces: string[] = [];\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tpieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);\n\t\t}\n\t\treturn `[${pieces.join(',')}]`;\n\t}\n\n\tpublic getMaxDeltaLine(): number {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._getDeltaLine(tokenCount - 1);\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst startChar = this._getStartCharacter(0);\n\t\tconst maxDeltaLine = this._getDeltaLine(tokenCount - 1);\n\t\tconst endChar = this._getEndCharacter(tokenCount - 1);\n\t\treturn new Range(0, startChar + 1, maxDeltaLine, endChar + 1);\n\t}\n\n\tprivate _getTokenCount(): number {\n\t\treturn this._tokenCount;\n\t}\n\n\tprivate _getDeltaLine(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex];\n\t}\n\n\tprivate _getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tprivate _getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._getTokenCount() === 0);\n\t}\n\n\tpublic getLineTokens(deltaLine: number): SparseLineTokens | null {\n\t\tlet low = 0;\n\t\tlet high = this._getTokenCount() - 1;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst midDeltaLine = this._getDeltaLine(mid);\n\n\t\t\tif (midDeltaLine < deltaLine) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (midDeltaLine > deltaLine) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\tlet min = mid;\n\t\t\t\twhile (min > low && this._getDeltaLine(min - 1) === deltaLine) {\n\t\t\t\t\tmin--;\n\t\t\t\t}\n\t\t\t\tlet max = mid;\n\t\t\t\twhile (max < high && this._getDeltaLine(max + 1) === deltaLine) {\n\t\t\t\t\tmax++;\n\t\t\t\t}\n\t\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4));\n\t\t\t}\n\t\t}\n\n\t\tif (this._getDeltaLine(low) === deltaLine) {\n\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._tokenCount = 0;\n\t}\n\n\tpublic removeTokens(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): number {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tlet firstDeltaLine = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (\n\t\t\t\t(tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))\n\t\t\t\t&& (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))\n\t\t\t) {\n\t\t\t\thasDeletedTokens = true;\n\t\t\t} else {\n\t\t\t\tif (newTokenCount === 0) {\n\t\t\t\t\tfirstDeltaLine = tokenDeltaLine;\n\t\t\t\t}\n\t\t\t\tif (hasDeletedTokens) {\n\t\t\t\t\t// must move the token to the left\n\t\t\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\t\t\ttokens[destOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\t\t}\n\t\t\t\tnewTokenCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\n\t\treturn firstDeltaLine;\n\t}\n\n\tpublic split(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): [SparseMultilineTokensStorage, SparseMultilineTokensStorage, number] {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst aTokens: number[] = [];\n\t\tconst bTokens: number[] = [];\n\t\tlet destTokens: number[] = aTokens;\n\t\tlet destOffset = 0;\n\t\tlet destFirstDeltaLine: number = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) {\n\t\t\t\tif ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) {\n\t\t\t\t\t// this token is touching the range\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// this token is after the range\n\t\t\t\t\tif (destTokens !== bTokens) {\n\t\t\t\t\t\t// this token is the first token after the range\n\t\t\t\t\t\tdestTokens = bTokens;\n\t\t\t\t\t\tdestOffset = 0;\n\t\t\t\t\t\tdestFirstDeltaLine = tokenDeltaLine;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine;\n\t\t\tdestTokens[destOffset++] = tokenStartCharacter;\n\t\t\tdestTokens[destOffset++] = tokenEndCharacter;\n\t\t\tdestTokens[destOffset++] = tokenMetadata;\n\t\t}\n\n\t\treturn [new SparseMultilineTokensStorage(new Uint32Array(aTokens)), new SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine];\n\t}\n\n\tpublic acceptDeleteRange(horizontalShiftForFirstLineTokens: number, startDeltaLine: number, startCharacter: number, endDeltaLine: number, endCharacter: number): void {\n\t\t// This is a bit complex, here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token starts before the deletion range\n\t\t// 1a. The token is completely before the deletion range\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t// ---------------\n\t\t// xxxxxxxx\n\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t// ---------------\n\t\t// xxxxx\n\t\t//\n\t\t// 2. The token starts at the same position with the deletion range\n\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxx\n\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxx\n\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t// -------------\n\t\t// xxxxxxx\n\t\t//\n\t\t// 3. The token starts inside the deletion range\n\t\t// 3a. The token is inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t// ------------\n\t\t// xxxxxxxxxxx\n\t\t//\n\t\t// 4. The token starts after the deletion range\n\t\t// -----------\n\t\t// xxxxxxxx\n\t\t//\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst deletedLineCount = (endDeltaLine - startDeltaLine);\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[srcOffset];\n\t\t\tlet tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tlet tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) {\n\t\t\t\t// 1a. The token is completely before the deletion range\n\t\t\t\t// => nothing to do\n\t\t\t\tnewTokenCount++;\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {\n\t\t\t\t// 1b, 1c, 1d\n\t\t\t\t// => the token survives, but it needs to shrink\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t\t\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t\t\t\t// => the token shrinks its ending to the deletion start\n\t\t\t\t\ttokenEndCharacter = startCharacter;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {\n\t\t\t\t// 2a, 2b, 2c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t\t\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {\n\t\t\t\t// 3a, 3b, 3c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t\t\t\t// => the token moves left and shrinks\n\t\t\t\t\tif (tokenDeltaLine === startDeltaLine) {\n\t\t\t\t\t\t// the deletion started on the same line as the token\n\t\t\t\t\t\t// => the token moves left and shrinks\n\t\t\t\t\t\ttokenStartCharacter = startCharacter;\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the deletion started on a line above the token\n\t\t\t\t\t\t// => the token moves to the beginning of the line\n\t\t\t\t\t\ttokenStartCharacter = 0;\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// 3a. The token is inside the deletion range\n\t\t\t\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine > endDeltaLine) {\n\t\t\t\t// 4. (partial) The token starts after the deletion range, on a line below...\n\t\t\t\tif (deletedLineCount === 0 && !hasDeletedTokens) {\n\t\t\t\t\t// early stop, there is no need to walk all the tokens and do nothing...\n\t\t\t\t\tnewTokenCount = tokenCount;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t} else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {\n\t\t\t\t// 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs\n\t\t\t\tif (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) {\n\t\t\t\t\ttokenStartCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t\ttokenEndCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t\ttokenStartCharacter -= (endCharacter - startCharacter);\n\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Not possible!`);\n\t\t\t}\n\n\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\ttokens[destOffset] = tokenDeltaLine;\n\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\tnewTokenCount++;\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\t}\n\n\tpublic acceptInsertText(deltaLine: number, character: number, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\t// Here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token is completely before the insertion point\n\t\t// ----------- |\n\t\t// 2. The token ends precisely at the insertion point\n\t\t// -----------|\n\t\t// 3. The token contains the insertion point\n\t\t// -----|------\n\t\t// 4. The token starts precisely at the insertion point\n\t\t// |-----------\n\t\t// 5. The token is completely after the insertion point\n\t\t// | -----------\n\t\t//\n\t\tconst isInsertingPreciselyOneWordCharacter = (\n\t\t\teolCount === 0\n\t\t\t&& firstLineLength === 1\n\t\t\t&& (\n\t\t\t\t(firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)\n\t\t\t\t|| (firstCharCode >= CharCode.A && firstCharCode <= CharCode.Z)\n\t\t\t\t|| (firstCharCode >= CharCode.a && firstCharCode <= CharCode.z)\n\t\t\t)\n\t\t);\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst offset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[offset];\n\t\t\tlet tokenStartCharacter = tokens[offset + 1];\n\t\t\tlet tokenEndCharacter = tokens[offset + 2];\n\n\t\t\tif (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) {\n\t\t\t\t// 1. The token is completely before the insertion point\n\t\t\t\t// => nothing to do\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) {\n\t\t\t\t// 2. The token ends precisely at the insertion point\n\t\t\t\t// => expand the end character only if inserting precisely one character that is a word character\n\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\ttokenEndCharacter += 1;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {\n\t\t\t\t// 3. The token contains the insertion point\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t// => just expand the end character\n\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t} else {\n\t\t\t\t\t// => cut off the token\n\t\t\t\t\ttokenEndCharacter = character;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 4. or 5.\n\t\t\t\tif (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {\n\t\t\t\t\t// 4. The token starts precisely at the insertion point\n\t\t\t\t\t// => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character\n\t\t\t\t\t// => otherwise behave as in case 5.\n\t\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// => the token must move and keep its size constant\n\t\t\t\tif (tokenDeltaLine === deltaLine) {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t\t// this token is on the line where the insertion is taking place\n\t\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t\ttokenStartCharacter += firstLineLength;\n\t\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst tokenLength = tokenEndCharacter - tokenStartCharacter;\n\t\t\t\t\t\ttokenStartCharacter = lastLineLength + (tokenStartCharacter - character);\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + tokenLength;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttokens[offset] = tokenDeltaLine;\n\t\t\ttokens[offset + 1] = tokenStartCharacter;\n\t\t\ttokens[offset + 2] = tokenEndCharacter;\n\t\t}\n\t}\n}\n\nexport class SparseLineTokens {\n\n\tprivate readonly _tokens: Uint32Array;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokens.length / 4;\n\t}\n\n\tpublic getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tpublic getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 3];\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens';\nimport { ILanguageIdCodec, MetadataConsts } from 'vs/editor/common/languages';\n\n/**\n * Represents sparse tokens in a text model.\n */\nexport class SparseTokensStore {\n\n\tprivate _pieces: SparseMultilineTokens[];\n\tprivate _isComplete: boolean;\n\tprivate readonly _languageIdCodec: ILanguageIdCodec;\n\n\tconstructor(languageIdCodec: ILanguageIdCodec) {\n\t\tthis._pieces = [];\n\t\tthis._isComplete = false;\n\t\tthis._languageIdCodec = languageIdCodec;\n\t}\n\n\tpublic flush(): void {\n\t\tthis._pieces = [];\n\t\tthis._isComplete = false;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._pieces.length === 0);\n\t}\n\n\tpublic set(pieces: SparseMultilineTokens[] | null, isComplete: boolean): void {\n\t\tthis._pieces = pieces || [];\n\t\tthis._isComplete = isComplete;\n\t}\n\n\tpublic setPartial(_range: Range, pieces: SparseMultilineTokens[]): Range {\n\t\t// console.log(`setPartial ${_range} ${pieces.map(p => p.toString()).join(', ')}`);\n\n\t\tlet range = _range;\n\t\tif (pieces.length > 0) {\n\t\t\tconst _firstRange = pieces[0].getRange();\n\t\t\tconst _lastRange = pieces[pieces.length - 1].getRange();\n\t\t\tif (!_firstRange || !_lastRange) {\n\t\t\t\treturn _range;\n\t\t\t}\n\t\t\trange = _range.plusRange(_firstRange).plusRange(_lastRange);\n\t\t}\n\n\t\tlet insertPosition: { index: number } | null = null;\n\t\tfor (let i = 0, len = this._pieces.length; i < len; i++) {\n\t\t\tconst piece = this._pieces[i];\n\t\t\tif (piece.endLineNumber < range.startLineNumber) {\n\t\t\t\t// this piece is before the range\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (piece.startLineNumber > range.endLineNumber) {\n\t\t\t\t// this piece is after the range, so mark the spot before this piece\n\t\t\t\t// as a good insertion position and stop looping\n\t\t\t\tinsertPosition = insertPosition || { index: i };\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// this piece might intersect with the range\n\t\t\tpiece.removeTokens(range);\n\n\t\t\tif (piece.isEmpty()) {\n\t\t\t\t// remove the piece if it became empty\n\t\t\t\tthis._pieces.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tlen--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (piece.endLineNumber < range.startLineNumber) {\n\t\t\t\t// after removal, this piece is before the range\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (piece.startLineNumber > range.endLineNumber) {\n\t\t\t\t// after removal, this piece is after the range\n\t\t\t\tinsertPosition = insertPosition || { index: i };\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// after removal, this piece contains the range\n\t\t\tconst [a, b] = piece.split(range);\n\t\t\tif (a.isEmpty()) {\n\t\t\t\t// this piece is actually after the range\n\t\t\t\tinsertPosition = insertPosition || { index: i };\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (b.isEmpty()) {\n\t\t\t\t// this piece is actually before the range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._pieces.splice(i, 1, a, b);\n\t\t\ti++;\n\t\t\tlen++;\n\n\t\t\tinsertPosition = insertPosition || { index: i };\n\t\t}\n\n\t\tinsertPosition = insertPosition || { index: this._pieces.length };\n\n\t\tif (pieces.length > 0) {\n\t\t\tthis._pieces = arrays.arrayInsert(this._pieces, insertPosition.index, pieces);\n\t\t}\n\n\t\t// console.log(`I HAVE ${this._pieces.length} pieces`);\n\t\t// console.log(`${this._pieces.map(p => p.toString()).join('\\n')}`);\n\n\t\treturn range;\n\t}\n\n\tpublic isComplete(): boolean {\n\t\treturn this._isComplete;\n\t}\n\n\tpublic addSparseTokens(lineNumber: number, aTokens: LineTokens): LineTokens {\n\t\tconst pieces = this._pieces;\n\n\t\tif (pieces.length === 0) {\n\t\t\treturn aTokens;\n\t\t}\n\n\t\tconst pieceIndex = SparseTokensStore._findFirstPieceWithLine(pieces, lineNumber);\n\t\tconst bTokens = pieces[pieceIndex].getLineTokens(lineNumber);\n\n\t\tif (!bTokens) {\n\t\t\treturn aTokens;\n\t\t}\n\n\t\tconst aLen = aTokens.getCount();\n\t\tconst bLen = bTokens.getCount();\n\n\t\tlet aIndex = 0;\n\t\tconst result: number[] = [];\n\t\tlet resultLen = 0;\n\t\tlet lastEndOffset = 0;\n\n\t\tconst emitToken = (endOffset: number, metadata: number) => {\n\t\t\tif (endOffset === lastEndOffset) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlastEndOffset = endOffset;\n\t\t\tresult[resultLen++] = endOffset;\n\t\t\tresult[resultLen++] = metadata;\n\t\t};\n\n\t\tfor (let bIndex = 0; bIndex < bLen; bIndex++) {\n\t\t\tconst bStartCharacter = bTokens.getStartCharacter(bIndex);\n\t\t\tconst bEndCharacter = bTokens.getEndCharacter(bIndex);\n\t\t\tconst bMetadata = bTokens.getMetadata(bIndex);\n\n\t\t\tconst bMask = (\n\t\t\t\t((bMetadata & MetadataConsts.SEMANTIC_USE_ITALIC) ? MetadataConsts.ITALIC_MASK : 0)\n\t\t\t\t| ((bMetadata & MetadataConsts.SEMANTIC_USE_BOLD) ? MetadataConsts.BOLD_MASK : 0)\n\t\t\t\t| ((bMetadata & MetadataConsts.SEMANTIC_USE_UNDERLINE) ? MetadataConsts.UNDERLINE_MASK : 0)\n\t\t\t\t| ((bMetadata & MetadataConsts.SEMANTIC_USE_STRIKETHROUGH) ? MetadataConsts.STRIKETHROUGH_MASK : 0)\n\t\t\t\t| ((bMetadata & MetadataConsts.SEMANTIC_USE_FOREGROUND) ? MetadataConsts.FOREGROUND_MASK : 0)\n\t\t\t\t| ((bMetadata & MetadataConsts.SEMANTIC_USE_BACKGROUND) ? MetadataConsts.BACKGROUND_MASK : 0)\n\t\t\t) >>> 0;\n\t\t\tconst aMask = (~bMask) >>> 0;\n\n\t\t\t// push any token from `a` that is before `b`\n\t\t\twhile (aIndex < aLen && aTokens.getEndOffset(aIndex) <= bStartCharacter) {\n\t\t\t\temitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex));\n\t\t\t\taIndex++;\n\t\t\t}\n\n\t\t\t// push the token from `a` if it intersects the token from `b`\n\t\t\tif (aIndex < aLen && aTokens.getStartOffset(aIndex) < bStartCharacter) {\n\t\t\t\temitToken(bStartCharacter, aTokens.getMetadata(aIndex));\n\t\t\t}\n\n\t\t\t// skip any tokens from `a` that are contained inside `b`\n\t\t\twhile (aIndex < aLen && aTokens.getEndOffset(aIndex) < bEndCharacter) {\n\t\t\t\temitToken(aTokens.getEndOffset(aIndex), (aTokens.getMetadata(aIndex) & aMask) | (bMetadata & bMask));\n\t\t\t\taIndex++;\n\t\t\t}\n\n\t\t\tif (aIndex < aLen) {\n\t\t\t\temitToken(bEndCharacter, (aTokens.getMetadata(aIndex) & aMask) | (bMetadata & bMask));\n\t\t\t\tif (aTokens.getEndOffset(aIndex) === bEndCharacter) {\n\t\t\t\t\t// `a` ends exactly at the same spot as `b`!\n\t\t\t\t\taIndex++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst aMergeIndex = Math.min(Math.max(0, aIndex - 1), aLen - 1);\n\n\t\t\t\t// push the token from `b`\n\t\t\t\temitToken(bEndCharacter, (aTokens.getMetadata(aMergeIndex) & aMask) | (bMetadata & bMask));\n\t\t\t}\n\t\t}\n\n\t\t// push the remaining tokens from `a`\n\t\twhile (aIndex < aLen) {\n\t\t\temitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex));\n\t\t\taIndex++;\n\t\t}\n\n\t\treturn new LineTokens(new Uint32Array(result), aTokens.getLineContent(), this._languageIdCodec);\n\t}\n\n\tprivate static _findFirstPieceWithLine(pieces: SparseMultilineTokens[], lineNumber: number): number {\n\t\tlet low = 0;\n\t\tlet high = pieces.length - 1;\n\n\t\twhile (low < high) {\n\t\t\tlet mid = low + Math.floor((high - low) / 2);\n\n\t\t\tif (pieces[mid].endLineNumber < lineNumber) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (pieces[mid].startLineNumber > lineNumber) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\twhile (mid > low && pieces[mid - 1].startLineNumber <= lineNumber && lineNumber <= pieces[mid - 1].endLineNumber) {\n\t\t\t\t\tmid--;\n\t\t\t\t}\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t}\n\n\t\treturn low;\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tfor (const piece of this._pieces) {\n\t\t\tpiece.acceptEdit(range, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\t}\n\t}\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 { Disposable } from 'vs/base/common/lifecycle';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\n\nexport class ViewEventHandler extends Disposable {\n\n\tprivate _shouldRender: boolean;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._shouldRender = true;\n\t}\n\n\tpublic shouldRender(): boolean {\n\t\treturn this._shouldRender;\n\t}\n\n\tpublic forceShouldRender(): void {\n\t\tthis._shouldRender = true;\n\t}\n\n\tprotected setShouldRender(): void {\n\t\tthis._shouldRender = true;\n\t}\n\n\tpublic onDidRender(): void {\n\t\tthis._shouldRender = false;\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onCompositionStart(e: viewEvents.ViewCompositionStartEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onCompositionEnd(e: viewEvents.ViewCompositionEndEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onLanguageConfigurationChanged(e: viewEvents.ViewLanguageConfigurationEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onTokensColorsChanged(e: viewEvents.ViewTokensColorsChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn false;\n\t}\n\n\t// --- end event handlers\n\n\tpublic handleEvents(events: viewEvents.ViewEvent[]): void {\n\n\t\tlet shouldRender = false;\n\n\t\tfor (let i = 0, len = events.length; i < len; i++) {\n\t\t\tconst e = events[i];\n\n\t\t\tswitch (e.type) {\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewCompositionStart:\n\t\t\t\t\tif (this.onCompositionStart(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewCompositionEnd:\n\t\t\t\t\tif (this.onCompositionEnd(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewConfigurationChanged:\n\t\t\t\t\tif (this.onConfigurationChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewCursorStateChanged:\n\t\t\t\t\tif (this.onCursorStateChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewDecorationsChanged:\n\t\t\t\t\tif (this.onDecorationsChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewFlushed:\n\t\t\t\t\tif (this.onFlushed(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewFocusChanged:\n\t\t\t\t\tif (this.onFocusChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewLanguageConfigurationChanged:\n\t\t\t\t\tif (this.onLanguageConfigurationChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewLineMappingChanged:\n\t\t\t\t\tif (this.onLineMappingChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewLinesChanged:\n\t\t\t\t\tif (this.onLinesChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewLinesDeleted:\n\t\t\t\t\tif (this.onLinesDeleted(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewLinesInserted:\n\t\t\t\t\tif (this.onLinesInserted(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewRevealRangeRequest:\n\t\t\t\t\tif (this.onRevealRangeRequest(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewScrollChanged:\n\t\t\t\t\tif (this.onScrollChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewTokensChanged:\n\t\t\t\t\tif (this.onTokensChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewThemeChanged:\n\t\t\t\t\tif (this.onThemeChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewTokensColorsChanged:\n\t\t\t\t\tif (this.onTokensColorsChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase viewEvents.ViewEventType.ViewZonesChanged:\n\t\t\t\t\tif (this.onZonesChanged(e)) {\n\t\t\t\t\t\tshouldRender = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.info('View received unknown event: ');\n\t\t\t\t\tconsole.info(e);\n\t\t\t}\n\t\t}\n\n\t\tif (shouldRender) {\n\t\t\tthis._shouldRender = true;\n\t\t}\n\t}\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 { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\n\nexport abstract class DynamicViewOverlay extends ViewEventHandler {\n\n\tpublic abstract prepareRender(ctx: RenderingContext): void;\n\n\tpublic abstract render(startLineNumber: number, lineNumber: number): string;\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 { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\n\nexport abstract class ViewPart extends ViewEventHandler {\n\n\t_context: ViewContext;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic abstract prepareRender(ctx: RenderingContext): void;\n\tpublic abstract render(ctx: RestrictedRenderingContext): void;\n}\n\nexport const enum PartFingerprint {\n\tNone,\n\tContentWidgets,\n\tOverflowingContentWidgets,\n\tOverflowGuard,\n\tOverlayWidgets,\n\tScrollableElement,\n\tTextArea,\n\tViewLines,\n\tMinimap\n}\n\nexport class PartFingerprints {\n\n\tpublic static write(target: Element | FastDomNode<HTMLElement>, partId: PartFingerprint) {\n\t\ttarget.setAttribute('data-mprt', String(partId));\n\t}\n\n\tpublic static read(target: Element): PartFingerprint {\n\t\tconst r = target.getAttribute('data-mprt');\n\t\tif (r === null) {\n\t\t\treturn PartFingerprint.None;\n\t\t}\n\t\treturn parseInt(r, 10);\n\t}\n\n\tpublic static collect(child: Element | null, stopAt: Element): Uint8Array {\n\t\tconst result: PartFingerprint[] = [];\n\t\tlet resultLen = 0;\n\n\t\twhile (child && child !== document.body) {\n\t\t\tif (child === stopAt) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (child.nodeType === child.ELEMENT_NODE) {\n\t\t\t\tresult[resultLen++] = this.read(child);\n\t\t\t}\n\t\t\tchild = child.parentElement;\n\t\t}\n\n\t\tconst r = new Uint8Array(resultLen);\n\t\tfor (let i = 0; i < resultLen; i++) {\n\t\t\tr[i] = result[resultLen - i - 1];\n\t\t}\n\t\treturn r;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ContentWidgetPositionPreference, IContentWidget } from 'vs/editor/browser/editorBrowser';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Constants } from 'vs/base/common/uint';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IDimension } from 'vs/editor/common/core/dimension';\n\n\nclass Coordinate {\n\t_coordinateBrand: void = undefined;\n\n\tpublic readonly top: number;\n\tpublic readonly left: number;\n\n\tconstructor(top: number, left: number) {\n\t\tthis.top = top;\n\t\tthis.left = left;\n\t}\n}\n\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onLineMappingChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(range, preference);\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.parentNode!.removeChild(domNode);\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\taboveLeft: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\tbelowLeft: number;\n}\n\ninterface IRenderData {\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\tprivate _lineHeight: number;\n\n\tprivate _range: IRange | null;\n\tprivate _viewRange: Range | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = this._actual.allowEditorOverflow || false;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\n\t\tthis._range = null;\n\t\tthis._viewRange = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): void {\n\t\tthis._setPosition(this._range);\n\t}\n\n\tprivate _setPosition(range: IRange | null): void {\n\t\tthis._range = range;\n\t\tthis._viewRange = null;\n\n\t\tif (this._range) {\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelRange = this._context.viewModel.model.validateRange(this._range);\n\t\t\tif (this._context.viewModel.coordinatesConverter.modelPositionIsVisible(validModelRange.getStartPosition()) || this._context.viewModel.coordinatesConverter.modelPositionIsVisible(validModelRange.getEndPosition())) {\n\t\t\t\tthis._viewRange = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(validModelRange);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? window.innerWidth || document.documentElement!.offsetWidth || document.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void {\n\t\tthis._setPosition(range);\n\t\tthis._preference = preference;\n\t\tif (this._viewRange && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = topLeft.top;\n\t\tconst heightAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = bottomLeft.top + this._lineHeight;\n\t\tconst heightUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightUnderLine >= height);\n\n\t\t// And its left\n\t\tlet actualAboveLeft = topLeft.left;\n\t\tlet actualBelowLeft = bottomLeft.left;\n\t\tif (actualAboveLeft + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tactualAboveLeft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (actualBelowLeft + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tactualBelowLeft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (actualAboveLeft < ctx.scrollLeft) {\n\t\t\tactualAboveLeft = ctx.scrollLeft;\n\t\t}\n\t\tif (actualBelowLeft < ctx.scrollLeft) {\n\t\t\tactualBelowLeft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn {\n\t\t\tfitsAbove: fitsAbove,\n\t\t\taboveTop: aboveTop,\n\t\t\taboveLeft: actualAboveLeft,\n\n\t\t\tfitsBelow: fitsBelow,\n\t\t\tbelowTop: belowTop,\n\t\t\tbelowLeft: actualBelowLeft,\n\t\t};\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(0, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width);\n\n\t\tlet absoluteLeft = domNodePosition.left + left - dom.StandardWindow.scrollX;\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = topLeft.top - height;\n\t\tconst belowTop = bottomLeft.top + this._lineHeight;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - dom.StandardWindow.scrollY;\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - dom.StandardWindow.scrollY;\n\n\t\tconst windowSize = dom.getClientArea(document.body);\n\t\tconst [aboveLeft, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, topLeft.left - ctx.scrollLeft + this._contentLeft, width);\n\t\tconst [belowLeft, absoluteBelowLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, bottomLeft.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\taboveLeft: absoluteAboveLeft,\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tbelowLeft: absoluteBelowLeft\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tfitsAbove,\n\t\t\taboveTop: aboveTop,\n\t\t\taboveLeft,\n\t\t\tfitsBelow,\n\t\t\tbelowTop,\n\t\t\tbelowLeft\n\t\t};\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute `this._topLeft`\n\t */\n\tprivate _getTopAndBottomLeft(ctx: RenderingContext): [Coordinate, Coordinate] | [null, null] {\n\t\tif (!this._viewRange) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\tconst visibleRangesForRange = ctx.linesVisibleRangesForRange(this._viewRange, false);\n\t\tif (!visibleRangesForRange || visibleRangesForRange.length === 0) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\tlet firstLine = visibleRangesForRange[0];\n\t\tlet lastLine = visibleRangesForRange[0];\n\t\tfor (const visibleRangesForLine of visibleRangesForRange) {\n\t\t\tif (visibleRangesForLine.lineNumber < firstLine.lineNumber) {\n\t\t\t\tfirstLine = visibleRangesForLine;\n\t\t\t}\n\t\t\tif (visibleRangesForLine.lineNumber > lastLine.lineNumber) {\n\t\t\t\tlastLine = visibleRangesForLine;\n\t\t\t}\n\t\t}\n\n\t\tlet firstLineMinLeft = Constants.MAX_SAFE_SMALL_INTEGER;//firstLine.Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tfor (const visibleRange of firstLine.ranges) {\n\t\t\tif (visibleRange.left < firstLineMinLeft) {\n\t\t\t\tfirstLineMinLeft = visibleRange.left;\n\t\t\t}\n\t\t}\n\n\t\tlet lastLineMinLeft = Constants.MAX_SAFE_SMALL_INTEGER;//lastLine.Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tfor (const visibleRange of lastLine.ranges) {\n\t\t\tif (visibleRange.left < lastLineMinLeft) {\n\t\t\t\tlastLineMinLeft = visibleRange.left;\n\t\t\t}\n\t\t}\n\n\t\tconst topForPosition = ctx.getVerticalOffsetForLineNumber(firstLine.lineNumber) - ctx.scrollTop;\n\t\tconst topLeft = new Coordinate(topForPosition, firstLineMinLeft);\n\n\t\tconst topForBottomLine = ctx.getVerticalOffsetForLineNumber(lastLine.lineNumber) - ctx.scrollTop;\n\t\tconst bottomLeft = new Coordinate(topForBottomLine, lastLineMinLeft);\n\n\t\treturn [topLeft, bottomLeft];\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst [topLeft, bottomLeft] = this._getTopAndBottomLeft(ctx);\n\t\tif (!topLeft || !bottomLeft) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tthis._cachedDomNodeOffsetWidth = domNode.offsetWidth;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = domNode.offsetHeight;\n\t\t\t}\n\t\t}\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(topLeft, bottomLeft, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(topLeft, bottomLeft, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn { coordinate: new Coordinate(placement.aboveTop, placement.aboveLeft), position: ContentWidgetPositionPreference.ABOVE };\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn { coordinate: new Coordinate(placement.belowTop, placement.belowLeft), position: ContentWidgetPositionPreference.BELOW };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn { coordinate: this._prepareRenderWidgetAtExactPositionOverflowing(topLeft), position: ContentWidgetPositionPreference.EXACT };\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn { coordinate: topLeft, position: ContentWidgetPositionPreference.EXACT };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._viewRange || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._viewRange.endLineNumber < viewportData.startLineNumber || this._viewRange.startLineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData) {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position);\n\t\t}\n\t}\n}\n\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\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 'vs/css!./decorations';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { Range } from 'vs/editor/common/core/range';\nimport { HorizontalRange, RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewModelDecoration } from 'vs/editor/common/viewModel';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nexport class DecorationsOverlay extends DynamicViewOverlay {\n\n\tprivate readonly _context: ViewContext;\n\tprivate _lineHeight: number;\n\tprivate _typicalHalfwidthCharacterWidth: number;\n\tprivate _renderResult: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\tthis._renderResult = null;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged || e.scrollWidthChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst _decorations = ctx.getDecorationsInViewport();\n\n\t\t// Keep only decorations with `className`\n\t\tlet decorations: ViewModelDecoration[] = [];\n\t\tlet decorationsLen = 0;\n\t\tfor (let i = 0, len = _decorations.length; i < len; i++) {\n\t\t\tconst d = _decorations[i];\n\t\t\tif (d.options.className) {\n\t\t\t\tdecorations[decorationsLen++] = d;\n\t\t\t}\n\t\t}\n\n\t\t// Sort decorations for consistent render output\n\t\tdecorations = decorations.sort((a, b) => {\n\t\t\tif (a.options.zIndex! < b.options.zIndex!) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.options.zIndex! > b.options.zIndex!) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tconst aClassName = a.options.className!;\n\t\t\tconst bClassName = b.options.className!;\n\n\t\t\tif (aClassName < bClassName) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (aClassName > bClassName) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn Range.compareRangesUsingStarts(a.range, b.range);\n\t\t});\n\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\toutput[lineIndex] = '';\n\t\t}\n\n\t\t// Render first whole line decorations and then regular decorations\n\t\tthis._renderWholeLineDecorations(ctx, decorations, output);\n\t\tthis._renderNormalDecorations(ctx, decorations, output);\n\t\tthis._renderResult = output;\n\t}\n\n\tprivate _renderWholeLineDecorations(ctx: RenderingContext, decorations: ViewModelDecoration[], output: string[]): void {\n\t\tconst lineHeight = String(this._lineHeight);\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\n\t\tfor (let i = 0, lenI = decorations.length; i < lenI; i++) {\n\t\t\tconst d = decorations[i];\n\n\t\t\tif (!d.options.isWholeLine) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst decorationOutput = (\n\t\t\t\t'<div class=\"cdr '\n\t\t\t\t+ d.options.className\n\t\t\t\t+ '\" style=\"left:0;width:100%;height:'\n\t\t\t\t+ lineHeight\n\t\t\t\t+ 'px;\"></div>'\n\t\t\t);\n\n\t\t\tconst startLineNumber = Math.max(d.range.startLineNumber, visibleStartLineNumber);\n\t\t\tconst endLineNumber = Math.min(d.range.endLineNumber, visibleEndLineNumber);\n\t\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\t\tconst lineIndex = j - visibleStartLineNumber;\n\t\t\t\toutput[lineIndex] += decorationOutput;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _renderNormalDecorations(ctx: RenderingContext, decorations: ViewModelDecoration[], output: string[]): void {\n\t\tconst lineHeight = String(this._lineHeight);\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\n\t\tlet prevClassName: string | null = null;\n\t\tlet prevShowIfCollapsed: boolean = false;\n\t\tlet prevRange: Range | null = null;\n\n\t\tfor (let i = 0, lenI = decorations.length; i < lenI; i++) {\n\t\t\tconst d = decorations[i];\n\n\t\t\tif (d.options.isWholeLine) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst className = d.options.className!;\n\t\t\tconst showIfCollapsed = Boolean(d.options.showIfCollapsed);\n\n\t\t\tlet range = d.range;\n\t\t\tif (showIfCollapsed && range.endColumn === 1 && range.endLineNumber !== range.startLineNumber) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber - 1, this._context.viewModel.getLineMaxColumn(range.endLineNumber - 1));\n\t\t\t}\n\n\t\t\tif (prevClassName === className && prevShowIfCollapsed === showIfCollapsed && Range.areIntersectingOrTouching(prevRange!, range)) {\n\t\t\t\t// merge into previous decoration\n\t\t\t\tprevRange = Range.plusRange(prevRange!, range);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// flush previous decoration\n\t\t\tif (prevClassName !== null) {\n\t\t\t\tthis._renderNormalDecoration(ctx, prevRange!, prevClassName, prevShowIfCollapsed, lineHeight, visibleStartLineNumber, output);\n\t\t\t}\n\n\t\t\tprevClassName = className;\n\t\t\tprevShowIfCollapsed = showIfCollapsed;\n\t\t\tprevRange = range;\n\t\t}\n\n\t\tif (prevClassName !== null) {\n\t\t\tthis._renderNormalDecoration(ctx, prevRange!, prevClassName, prevShowIfCollapsed, lineHeight, visibleStartLineNumber, output);\n\t\t}\n\t}\n\n\tprivate _renderNormalDecoration(ctx: RenderingContext, range: Range, className: string, showIfCollapsed: boolean, lineHeight: string, visibleStartLineNumber: number, output: string[]): void {\n\t\tconst linesVisibleRanges = ctx.linesVisibleRangesForRange(range, /*TODO@Alex*/className === 'findMatch');\n\t\tif (!linesVisibleRanges) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let j = 0, lenJ = linesVisibleRanges.length; j < lenJ; j++) {\n\t\t\tconst lineVisibleRanges = linesVisibleRanges[j];\n\t\t\tif (lineVisibleRanges.outsideRenderedLine) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber;\n\n\t\t\tif (showIfCollapsed && lineVisibleRanges.ranges.length === 1) {\n\t\t\t\tconst singleVisibleRange = lineVisibleRanges.ranges[0];\n\t\t\t\tif (singleVisibleRange.width < this._typicalHalfwidthCharacterWidth) {\n\t\t\t\t\t// collapsed/very small range case => make the decoration visible by expanding its width\n\t\t\t\t\t// expand its size on both sides (both to the left and to the right, keeping it centered)\n\t\t\t\t\tconst center = Math.round(singleVisibleRange.left + singleVisibleRange.width / 2);\n\t\t\t\t\tconst left = Math.max(0, Math.round(center - this._typicalHalfwidthCharacterWidth / 2));\n\t\t\t\t\tlineVisibleRanges.ranges[0] = new HorizontalRange(left, this._typicalHalfwidthCharacterWidth);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let k = 0, lenK = lineVisibleRanges.ranges.length; k < lenK; k++) {\n\t\t\t\tconst visibleRange = lineVisibleRanges.ranges[k];\n\t\t\t\tconst decorationOutput = (\n\t\t\t\t\t'<div class=\"cdr '\n\t\t\t\t\t+ className\n\t\t\t\t\t+ '\" style=\"left:'\n\t\t\t\t\t+ String(visibleRange.left)\n\t\t\t\t\t+ 'px;width:'\n\t\t\t\t\t+ String(visibleRange.width)\n\t\t\t\t\t+ 'px;height:'\n\t\t\t\t\t+ lineHeight\n\t\t\t\t\t+ 'px;\"></div>'\n\t\t\t\t);\n\t\t\t\toutput[lineIndex] += decorationOutput;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex < 0 || lineIndex >= this._renderResult.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineIndex];\n\t}\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 'vs/css!./glyphMargin';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n\nexport class DecorationToRender {\n\t_decorationToRenderBrand: void = undefined;\n\n\tpublic startLineNumber: number;\n\tpublic endLineNumber: number;\n\tpublic className: string;\n\n\tconstructor(startLineNumber: number, endLineNumber: number, className: string) {\n\t\tthis.startLineNumber = +startLineNumber;\n\t\tthis.endLineNumber = +endLineNumber;\n\t\tthis.className = String(className);\n\t}\n}\n\nexport abstract class DedupOverlay extends DynamicViewOverlay {\n\n\tprotected _render(visibleStartLineNumber: number, visibleEndLineNumber: number, decorations: DecorationToRender[]): string[][] {\n\n\t\tconst output: string[][] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\toutput[lineIndex] = [];\n\t\t}\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn output;\n\t\t}\n\n\t\tdecorations.sort((a, b) => {\n\t\t\tif (a.className === b.className) {\n\t\t\t\tif (a.startLineNumber === b.startLineNumber) {\n\t\t\t\t\treturn a.endLineNumber - b.endLineNumber;\n\t\t\t\t}\n\t\t\t\treturn a.startLineNumber - b.startLineNumber;\n\t\t\t}\n\t\t\treturn (a.className < b.className ? -1 : 1);\n\t\t});\n\n\t\tlet prevClassName: string | null = null;\n\t\tlet prevEndLineIndex = 0;\n\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\tconst d = decorations[i];\n\t\t\tconst className = d.className;\n\t\t\tlet startLineIndex = Math.max(d.startLineNumber, visibleStartLineNumber) - visibleStartLineNumber;\n\t\t\tconst endLineIndex = Math.min(d.endLineNumber, visibleEndLineNumber) - visibleStartLineNumber;\n\n\t\t\tif (prevClassName === className) {\n\t\t\t\tstartLineIndex = Math.max(prevEndLineIndex + 1, startLineIndex);\n\t\t\t\tprevEndLineIndex = Math.max(prevEndLineIndex, endLineIndex);\n\t\t\t} else {\n\t\t\t\tprevClassName = className;\n\t\t\t\tprevEndLineIndex = endLineIndex;\n\t\t\t}\n\n\t\t\tfor (let i = startLineIndex; i <= prevEndLineIndex; i++) {\n\t\t\t\toutput[i].push(prevClassName);\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n}\n\nexport class GlyphMarginOverlay extends DedupOverlay {\n\n\tprivate readonly _context: ViewContext;\n\tprivate _lineHeight: number;\n\tprivate _glyphMargin: boolean;\n\tprivate _glyphMarginLeft: number;\n\tprivate _glyphMarginWidth: number;\n\tprivate _renderResult: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._glyphMargin = options.get(EditorOption.glyphMargin);\n\t\tthis._glyphMarginLeft = layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = layoutInfo.glyphMarginWidth;\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._glyphMargin = options.get(EditorOption.glyphMargin);\n\t\tthis._glyphMarginLeft = layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = layoutInfo.glyphMarginWidth;\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tprotected _getDecorations(ctx: RenderingContext): DecorationToRender[] {\n\t\tconst decorations = ctx.getDecorationsInViewport();\n\t\tconst r: DecorationToRender[] = [];\n\t\tlet rLen = 0;\n\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\tconst d = decorations[i];\n\t\t\tconst glyphMarginClassName = d.options.glyphMarginClassName;\n\t\t\tif (glyphMarginClassName) {\n\t\t\t\tr[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, glyphMarginClassName);\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (!this._glyphMargin) {\n\t\t\tthis._renderResult = null;\n\t\t\treturn;\n\t\t}\n\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx));\n\n\t\tconst lineHeight = this._lineHeight.toString();\n\t\tconst left = this._glyphMarginLeft.toString();\n\t\tconst width = this._glyphMarginWidth.toString();\n\t\tconst common = '\" style=\"left:' + left + 'px;width:' + width + 'px' + ';height:' + lineHeight + 'px;\"></div>';\n\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\tconst classNames = toRender[lineIndex];\n\n\t\t\tif (classNames.length === 0) {\n\t\t\t\toutput[lineIndex] = '';\n\t\t\t} else {\n\t\t\t\toutput[lineIndex] = (\n\t\t\t\t\t'<div class=\"cgmr codicon '\n\t\t\t\t\t+ classNames.join(' ')\n\t\t\t\t\t+ common\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis._renderResult = output;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex < 0 || lineIndex >= this._renderResult.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineIndex];\n\t}\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 'vs/css!./linesDecorations';\nimport { DecorationToRender, DedupOverlay } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n\nexport class LinesDecorationsOverlay extends DedupOverlay {\n\n\tprivate readonly _context: ViewContext;\n\n\tprivate _decorationsLeft: number;\n\tprivate _decorationsWidth: number;\n\tprivate _renderResult: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._decorationsLeft = layoutInfo.decorationsLeft;\n\t\tthis._decorationsWidth = layoutInfo.decorationsWidth;\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._decorationsLeft = layoutInfo.decorationsLeft;\n\t\tthis._decorationsWidth = layoutInfo.decorationsWidth;\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tprotected _getDecorations(ctx: RenderingContext): DecorationToRender[] {\n\t\tconst decorations = ctx.getDecorationsInViewport();\n\t\tconst r: DecorationToRender[] = [];\n\t\tlet rLen = 0;\n\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\tconst d = decorations[i];\n\t\t\tconst linesDecorationsClassName = d.options.linesDecorationsClassName;\n\t\t\tif (linesDecorationsClassName) {\n\t\t\t\tr[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, linesDecorationsClassName);\n\t\t\t}\n\t\t\tconst firstLineDecorationClassName = d.options.firstLineDecorationClassName;\n\t\t\tif (firstLineDecorationClassName) {\n\t\t\t\tr[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.startLineNumber, firstLineDecorationClassName);\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx));\n\n\t\tconst left = this._decorationsLeft.toString();\n\t\tconst width = this._decorationsWidth.toString();\n\t\tconst common = '\" style=\"left:' + left + 'px;width:' + width + 'px;\"></div>';\n\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\tconst classNames = toRender[lineIndex];\n\t\t\tlet lineOutput = '';\n\t\t\tfor (let i = 0, len = classNames.length; i < len; i++) {\n\t\t\t\tlineOutput += '<div class=\"cldr ' + classNames[i] + common;\n\t\t\t}\n\t\t\toutput[lineIndex] = lineOutput;\n\t\t}\n\n\t\tthis._renderResult = output;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineNumber - startLineNumber];\n\t}\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n\nexport class Margin extends ViewPart {\n\n\tpublic static readonly CLASS_NAME = 'glyph-margin';\n\tpublic static readonly OUTER_CLASS_NAME = 'margin';\n\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\tprivate _canUseLayerHinting: boolean;\n\tprivate _contentLeft: number;\n\tprivate _glyphMarginLeft: number;\n\tprivate _glyphMarginWidth: number;\n\tprivate _glyphMarginBackgroundDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._canUseLayerHinting = !options.get(EditorOption.disableLayerHinting);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._glyphMarginLeft = layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = layoutInfo.glyphMarginWidth;\n\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tthis._domNode.setClassName(Margin.OUTER_CLASS_NAME);\n\t\tthis._domNode.setPosition('absolute');\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._glyphMarginBackgroundDomNode = createFastDomNode(document.createElement('div'));\n\t\tthis._glyphMarginBackgroundDomNode.setClassName(Margin.CLASS_NAME);\n\n\t\tthis._domNode.appendChild(this._glyphMarginBackgroundDomNode);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._canUseLayerHinting = !options.get(EditorOption.disableLayerHinting);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._glyphMarginLeft = layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = layoutInfo.glyphMarginWidth;\n\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn super.onScrollChanged(e) || e.scrollTopChanged;\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tthis._domNode.setLayerHinting(this._canUseLayerHinting);\n\t\tthis._domNode.setContain('strict');\n\t\tconst adjustedScrollTop = ctx.scrollTop - ctx.bigNumbersDelta;\n\t\tthis._domNode.setTop(-adjustedScrollTop);\n\n\t\tconst height = Math.min(ctx.scrollHeight, 1000000);\n\t\tthis._domNode.setHeight(height);\n\t\tthis._domNode.setWidth(this._contentLeft);\n\n\t\tthis._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft);\n\t\tthis._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth);\n\t\tthis._glyphMarginBackgroundDomNode.setHeight(height);\n\t}\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 'vs/css!./marginDecorations';\nimport { DecorationToRender, DedupOverlay } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\n\nexport class MarginViewLineDecorationsOverlay extends DedupOverlay {\n\tprivate readonly _context: ViewContext;\n\tprivate _renderResult: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tprotected _getDecorations(ctx: RenderingContext): DecorationToRender[] {\n\t\tconst decorations = ctx.getDecorationsInViewport();\n\t\tconst r: DecorationToRender[] = [];\n\t\tlet rLen = 0;\n\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\tconst d = decorations[i];\n\t\t\tconst marginClassName = d.options.marginClassName;\n\t\t\tif (marginClassName) {\n\t\t\t\tr[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, marginClassName);\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx));\n\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\tconst classNames = toRender[lineIndex];\n\t\t\tlet lineOutput = '';\n\t\t\tfor (let i = 0, len = classNames.length; i < len; i++) {\n\t\t\t\tlineOutput += '<div class=\"cmdr ' + classNames[i] + '\" style=\"\"></div>';\n\t\t\t}\n\t\t\toutput[lineIndex] = lineOutput;\n\t\t}\n\n\t\tthis._renderResult = output;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineNumber - startLineNumber];\n\t}\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 'vs/css!./overlayWidgets';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IOverlayWidget, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n\ninterface IWidgetData {\n\twidget: IOverlayWidget;\n\tpreference: OverlayWidgetPositionPreference | null;\n\tdomNode: FastDomNode<HTMLElement>;\n}\n\ninterface IWidgetMap {\n\t[key: string]: IWidgetData;\n}\n\nexport class ViewOverlayWidgets extends ViewPart {\n\n\tprivate _widgets: IWidgetMap;\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\n\tprivate _verticalScrollbarWidth: number;\n\tprivate _minimapWidth: number;\n\tprivate _horizontalScrollbarHeight: number;\n\tprivate _editorHeight: number;\n\tprivate _editorWidth: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._widgets = {};\n\t\tthis._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth;\n\t\tthis._minimapWidth = layoutInfo.minimap.minimapWidth;\n\t\tthis._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;\n\t\tthis._editorHeight = layoutInfo.height;\n\t\tthis._editorWidth = layoutInfo.width;\n\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this._domNode, PartFingerprint.OverlayWidgets);\n\t\tthis._domNode.setClassName('overlayWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth;\n\t\tthis._minimapWidth = layoutInfo.minimap.minimapWidth;\n\t\tthis._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;\n\t\tthis._editorHeight = layoutInfo.height;\n\t\tthis._editorWidth = layoutInfo.width;\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tpublic addWidget(widget: IOverlayWidget): void {\n\t\tconst domNode = createFastDomNode(widget.getDomNode());\n\n\t\tthis._widgets[widget.getId()] = {\n\t\t\twidget: widget,\n\t\t\tpreference: null,\n\t\t\tdomNode: domNode\n\t\t};\n\n\t\t// This is sync because a widget wants to be in the dom\n\t\tdomNode.setPosition('absolute');\n\t\tdomNode.setAttribute('widgetId', widget.getId());\n\t\tthis._domNode.appendChild(domNode);\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IOverlayWidget, preference: OverlayWidgetPositionPreference | null): boolean {\n\t\tconst widgetData = this._widgets[widget.getId()];\n\t\tif (widgetData.preference === preference) {\n\t\t\treturn false;\n\t\t}\n\n\t\twidgetData.preference = preference;\n\t\tthis.setShouldRender();\n\n\t\treturn true;\n\t}\n\n\tpublic removeWidget(widget: IOverlayWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst widgetData = this._widgets[widgetId];\n\t\t\tconst domNode = widgetData.domNode.domNode;\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tdomNode.parentNode!.removeChild(domNode);\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tprivate _renderWidget(widgetData: IWidgetData): void {\n\t\tconst domNode = widgetData.domNode;\n\n\t\tif (widgetData.preference === null) {\n\t\t\tdomNode.unsetTop();\n\t\t\treturn;\n\t\t}\n\n\t\tif (widgetData.preference === OverlayWidgetPositionPreference.TOP_RIGHT_CORNER) {\n\t\t\tdomNode.setTop(0);\n\t\t\tdomNode.setRight((2 * this._verticalScrollbarWidth) + this._minimapWidth);\n\t\t} else if (widgetData.preference === OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER) {\n\t\t\tconst widgetHeight = domNode.domNode.clientHeight;\n\t\t\tdomNode.setTop((this._editorHeight - widgetHeight - 2 * this._horizontalScrollbarHeight));\n\t\t\tdomNode.setRight((2 * this._verticalScrollbarWidth) + this._minimapWidth);\n\t\t} else if (widgetData.preference === OverlayWidgetPositionPreference.TOP_CENTER) {\n\t\t\tdomNode.setTop(0);\n\t\t\tdomNode.domNode.style.right = '50%';\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tthis._domNode.setWidth(this._editorWidth);\n\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst widgetId = keys[i];\n\t\t\tthis._renderWidget(this._widgets[widgetId]);\n\t\t}\n\t}\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { Position } from 'vs/editor/common/core/position';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { IEditorWhitespace, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from 'vs/editor/common/viewModel';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nexport interface IMyViewZone {\n\twhitespaceId: string;\n\tdelegate: IViewZone;\n\tisInHiddenArea: boolean;\n\tisVisible: boolean;\n\tdomNode: FastDomNode<HTMLElement>;\n\tmarginDomNode: FastDomNode<HTMLElement> | null;\n}\n\ninterface IComputedViewZoneProps {\n\tisInHiddenArea: boolean;\n\tafterViewLineNumber: number;\n\theightInPx: number;\n\tminWidthInPx: number;\n}\n\nconst invalidFunc = () => { throw new Error(`Invalid change accessor`); };\n\nexport class ViewZones extends ViewPart {\n\n\tprivate _zones: { [id: string]: IMyViewZone };\n\tprivate _lineHeight: number;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\n\tpublic marginDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tthis.domNode.setClassName('view-zones');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setAttribute('role', 'presentation');\n\t\tthis.domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis.marginDomNode = createFastDomNode(document.createElement('div'));\n\t\tthis.marginDomNode.setClassName('margin-view-zones');\n\t\tthis.marginDomNode.setPosition('absolute');\n\t\tthis.marginDomNode.setAttribute('role', 'presentation');\n\t\tthis.marginDomNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._zones = {};\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._zones = {};\n\t}\n\n\t// ---- begin view event handlers\n\n\tprivate _recomputeWhitespacesProps(): boolean {\n\t\tconst whitespaces = this._context.viewLayout.getWhitespaces();\n\t\tconst oldWhitespaces = new Map<string, IEditorWhitespace>();\n\t\tfor (const whitespace of whitespaces) {\n\t\t\toldWhitespaces.set(whitespace.id, whitespace);\n\t\t}\n\t\tlet hadAChange = false;\n\t\tthis._context.viewModel.changeWhitespace((whitespaceAccessor: IWhitespaceChangeAccessor) => {\n\t\t\tconst keys = Object.keys(this._zones);\n\t\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\t\tconst id = keys[i];\n\t\t\t\tconst zone = this._zones[id];\n\t\t\t\tconst props = this._computeWhitespaceProps(zone.delegate);\n\t\t\t\tzone.isInHiddenArea = props.isInHiddenArea;\n\t\t\t\tconst oldWhitespace = oldWhitespaces.get(id);\n\t\t\t\tif (oldWhitespace && (oldWhitespace.afterLineNumber !== props.afterViewLineNumber || oldWhitespace.height !== props.heightInPx)) {\n\t\t\t\t\twhitespaceAccessor.changeOneWhitespace(id, props.afterViewLineNumber, props.heightInPx);\n\t\t\t\t\tthis._safeCallOnComputedHeight(zone.delegate, props.heightInPx);\n\t\t\t\t\thadAChange = true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn hadAChange;\n\t}\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tif (e.hasChanged(EditorOption.lineHeight)) {\n\t\t\tthis._recomputeWhitespacesProps();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\treturn this._recomputeWhitespacesProps();\n\t}\n\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged || e.scrollWidthChanged;\n\t}\n\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _getZoneOrdinal(zone: IViewZone): number {\n\n\t\tif (typeof zone.afterColumn !== 'undefined') {\n\t\t\treturn zone.afterColumn;\n\t\t}\n\n\t\treturn 10000;\n\t}\n\n\tprivate _computeWhitespaceProps(zone: IViewZone): IComputedViewZoneProps {\n\t\tif (zone.afterLineNumber === 0) {\n\t\t\treturn {\n\t\t\t\tisInHiddenArea: false,\n\t\t\t\tafterViewLineNumber: 0,\n\t\t\t\theightInPx: this._heightInPixels(zone),\n\t\t\t\tminWidthInPx: this._minWidthInPixels(zone)\n\t\t\t};\n\t\t}\n\n\t\tlet zoneAfterModelPosition: Position;\n\t\tif (typeof zone.afterColumn !== 'undefined') {\n\t\t\tzoneAfterModelPosition = this._context.viewModel.model.validatePosition({\n\t\t\t\tlineNumber: zone.afterLineNumber,\n\t\t\t\tcolumn: zone.afterColumn\n\t\t\t});\n\t\t} else {\n\t\t\tconst validAfterLineNumber = this._context.viewModel.model.validatePosition({\n\t\t\t\tlineNumber: zone.afterLineNumber,\n\t\t\t\tcolumn: 1\n\t\t\t}).lineNumber;\n\n\t\t\tzoneAfterModelPosition = new Position(\n\t\t\t\tvalidAfterLineNumber,\n\t\t\t\tthis._context.viewModel.model.getLineMaxColumn(validAfterLineNumber)\n\t\t\t);\n\t\t}\n\n\t\tlet zoneBeforeModelPosition: Position;\n\t\tif (zoneAfterModelPosition.column === this._context.viewModel.model.getLineMaxColumn(zoneAfterModelPosition.lineNumber)) {\n\t\t\tzoneBeforeModelPosition = this._context.viewModel.model.validatePosition({\n\t\t\t\tlineNumber: zoneAfterModelPosition.lineNumber + 1,\n\t\t\t\tcolumn: 1\n\t\t\t});\n\t\t} else {\n\t\t\tzoneBeforeModelPosition = this._context.viewModel.model.validatePosition({\n\t\t\t\tlineNumber: zoneAfterModelPosition.lineNumber,\n\t\t\t\tcolumn: zoneAfterModelPosition.column + 1\n\t\t\t});\n\t\t}\n\n\t\tconst viewPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(zoneAfterModelPosition, zone.afterColumnAffinity);\n\t\tconst isVisible = this._context.viewModel.coordinatesConverter.modelPositionIsVisible(zoneBeforeModelPosition);\n\t\treturn {\n\t\t\tisInHiddenArea: !isVisible,\n\t\t\tafterViewLineNumber: viewPosition.lineNumber,\n\t\t\theightInPx: (isVisible ? this._heightInPixels(zone) : 0),\n\t\t\tminWidthInPx: this._minWidthInPixels(zone)\n\t\t};\n\t}\n\n\tpublic changeViewZones(callback: (changeAccessor: IViewZoneChangeAccessor) => any): boolean {\n\t\tlet zonesHaveChanged = false;\n\n\t\tthis._context.viewModel.changeWhitespace((whitespaceAccessor: IWhitespaceChangeAccessor) => {\n\n\t\t\tconst changeAccessor: IViewZoneChangeAccessor = {\n\t\t\t\taddZone: (zone: IViewZone): string => {\n\t\t\t\t\tzonesHaveChanged = true;\n\t\t\t\t\treturn this._addZone(whitespaceAccessor, zone);\n\t\t\t\t},\n\t\t\t\tremoveZone: (id: string): void => {\n\t\t\t\t\tif (!id) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tzonesHaveChanged = this._removeZone(whitespaceAccessor, id) || zonesHaveChanged;\n\t\t\t\t},\n\t\t\t\tlayoutZone: (id: string): void => {\n\t\t\t\t\tif (!id) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tzonesHaveChanged = this._layoutZone(whitespaceAccessor, id) || zonesHaveChanged;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsafeInvoke1Arg(callback, changeAccessor);\n\n\t\t\t// Invalidate changeAccessor\n\t\t\tchangeAccessor.addZone = invalidFunc;\n\t\t\tchangeAccessor.removeZone = invalidFunc;\n\t\t\tchangeAccessor.layoutZone = invalidFunc;\n\t\t});\n\n\t\treturn zonesHaveChanged;\n\t}\n\n\tprivate _addZone(whitespaceAccessor: IWhitespaceChangeAccessor, zone: IViewZone): string {\n\t\tconst props = this._computeWhitespaceProps(zone);\n\t\tconst whitespaceId = whitespaceAccessor.insertWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx, props.minWidthInPx);\n\n\t\tconst myZone: IMyViewZone = {\n\t\t\twhitespaceId: whitespaceId,\n\t\t\tdelegate: zone,\n\t\t\tisInHiddenArea: props.isInHiddenArea,\n\t\t\tisVisible: false,\n\t\t\tdomNode: createFastDomNode(zone.domNode),\n\t\t\tmarginDomNode: zone.marginDomNode ? createFastDomNode(zone.marginDomNode) : null\n\t\t};\n\n\t\tthis._safeCallOnComputedHeight(myZone.delegate, props.heightInPx);\n\n\t\tmyZone.domNode.setPosition('absolute');\n\t\tmyZone.domNode.domNode.style.width = '100%';\n\t\tmyZone.domNode.setDisplay('none');\n\t\tmyZone.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId);\n\t\tthis.domNode.appendChild(myZone.domNode);\n\n\t\tif (myZone.marginDomNode) {\n\t\t\tmyZone.marginDomNode.setPosition('absolute');\n\t\t\tmyZone.marginDomNode.domNode.style.width = '100%';\n\t\t\tmyZone.marginDomNode.setDisplay('none');\n\t\t\tmyZone.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId);\n\t\t\tthis.marginDomNode.appendChild(myZone.marginDomNode);\n\t\t}\n\n\t\tthis._zones[myZone.whitespaceId] = myZone;\n\n\n\t\tthis.setShouldRender();\n\n\t\treturn myZone.whitespaceId;\n\t}\n\n\tprivate _removeZone(whitespaceAccessor: IWhitespaceChangeAccessor, id: string): boolean {\n\t\tif (this._zones.hasOwnProperty(id)) {\n\t\t\tconst zone = this._zones[id];\n\t\t\tdelete this._zones[id];\n\t\t\twhitespaceAccessor.removeWhitespace(zone.whitespaceId);\n\n\t\t\tzone.domNode.removeAttribute('monaco-visible-view-zone');\n\t\t\tzone.domNode.removeAttribute('monaco-view-zone');\n\t\t\tzone.domNode.domNode.parentNode!.removeChild(zone.domNode.domNode);\n\n\t\t\tif (zone.marginDomNode) {\n\t\t\t\tzone.marginDomNode.removeAttribute('monaco-visible-view-zone');\n\t\t\t\tzone.marginDomNode.removeAttribute('monaco-view-zone');\n\t\t\t\tzone.marginDomNode.domNode.parentNode!.removeChild(zone.marginDomNode.domNode);\n\t\t\t}\n\n\t\t\tthis.setShouldRender();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _layoutZone(whitespaceAccessor: IWhitespaceChangeAccessor, id: string): boolean {\n\t\tif (this._zones.hasOwnProperty(id)) {\n\t\t\tconst zone = this._zones[id];\n\t\t\tconst props = this._computeWhitespaceProps(zone.delegate);\n\t\t\tzone.isInHiddenArea = props.isInHiddenArea;\n\t\t\t// const newOrdinal = this._getZoneOrdinal(zone.delegate);\n\t\t\twhitespaceAccessor.changeOneWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx);\n\t\t\t// TODO@Alex: change `newOrdinal` too\n\n\t\t\tthis._safeCallOnComputedHeight(zone.delegate, props.heightInPx);\n\t\t\tthis.setShouldRender();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic shouldSuppressMouseDownOnViewZone(id: string): boolean {\n\t\tif (this._zones.hasOwnProperty(id)) {\n\t\t\tconst zone = this._zones[id];\n\t\t\treturn Boolean(zone.delegate.suppressMouseDown);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _heightInPixels(zone: IViewZone): number {\n\t\tif (typeof zone.heightInPx === 'number') {\n\t\t\treturn zone.heightInPx;\n\t\t}\n\t\tif (typeof zone.heightInLines === 'number') {\n\t\t\treturn this._lineHeight * zone.heightInLines;\n\t\t}\n\t\treturn this._lineHeight;\n\t}\n\n\tprivate _minWidthInPixels(zone: IViewZone): number {\n\t\tif (typeof zone.minWidthInPx === 'number') {\n\t\t\treturn zone.minWidthInPx;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate _safeCallOnComputedHeight(zone: IViewZone, height: number): void {\n\t\tif (typeof zone.onComputedHeight === 'function') {\n\t\t\ttry {\n\t\t\t\tzone.onComputedHeight(height);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _safeCallOnDomNodeTop(zone: IViewZone, top: number): void {\n\t\tif (typeof zone.onDomNodeTop === 'function') {\n\t\t\ttry {\n\t\t\t\tzone.onDomNodeTop(top);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst visibleWhitespaces = ctx.viewportData.whitespaceViewportData;\n\t\tconst visibleZones: { [id: string]: IViewWhitespaceViewportData } = {};\n\n\t\tlet hasVisibleZone = false;\n\t\tfor (const visibleWhitespace of visibleWhitespaces) {\n\t\t\tif (this._zones[visibleWhitespace.id].isInHiddenArea) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvisibleZones[visibleWhitespace.id] = visibleWhitespace;\n\t\t\thasVisibleZone = true;\n\t\t}\n\n\t\tconst keys = Object.keys(this._zones);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst id = keys[i];\n\t\t\tconst zone = this._zones[id];\n\n\t\t\tlet newTop = 0;\n\t\t\tlet newHeight = 0;\n\t\t\tlet newDisplay = 'none';\n\t\t\tif (visibleZones.hasOwnProperty(id)) {\n\t\t\t\tnewTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta;\n\t\t\t\tnewHeight = visibleZones[id].height;\n\t\t\t\tnewDisplay = 'block';\n\t\t\t\t// zone is visible\n\t\t\t\tif (!zone.isVisible) {\n\t\t\t\t\tzone.domNode.setAttribute('monaco-visible-view-zone', 'true');\n\t\t\t\t\tzone.isVisible = true;\n\t\t\t\t}\n\t\t\t\tthis._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));\n\t\t\t} else {\n\t\t\t\tif (zone.isVisible) {\n\t\t\t\t\tzone.domNode.removeAttribute('monaco-visible-view-zone');\n\t\t\t\t\tzone.isVisible = false;\n\t\t\t\t}\n\t\t\t\tthis._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));\n\t\t\t}\n\t\t\tzone.domNode.setTop(newTop);\n\t\t\tzone.domNode.setHeight(newHeight);\n\t\t\tzone.domNode.setDisplay(newDisplay);\n\n\t\t\tif (zone.marginDomNode) {\n\t\t\t\tzone.marginDomNode.setTop(newTop);\n\t\t\t\tzone.marginDomNode.setHeight(newHeight);\n\t\t\t\tzone.marginDomNode.setDisplay(newDisplay);\n\t\t\t}\n\t\t}\n\n\t\tif (hasVisibleZone) {\n\t\t\tthis.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth));\n\t\t\tthis.marginDomNode.setWidth(this._contentLeft);\n\t\t}\n\t}\n}\n\nfunction safeInvoke1Arg(func: Function, arg1: any): any {\n\ttry {\n\t\treturn func(arg1);\n\t} catch (e) {\n\t\tonUnexpectedError(e);\n\t}\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 { ScrollEvent } from 'vs/base/common/scrollable';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IModelDecorationsChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { IColorTheme } from 'vs/platform/theme/common/themeService';\n\nexport const enum ViewEventType {\n\tViewCompositionStart,\n\tViewCompositionEnd,\n\tViewConfigurationChanged,\n\tViewCursorStateChanged,\n\tViewDecorationsChanged,\n\tViewFlushed,\n\tViewFocusChanged,\n\tViewLanguageConfigurationChanged,\n\tViewLineMappingChanged,\n\tViewLinesChanged,\n\tViewLinesDeleted,\n\tViewLinesInserted,\n\tViewRevealRangeRequest,\n\tViewScrollChanged,\n\tViewThemeChanged,\n\tViewTokensChanged,\n\tViewTokensColorsChanged,\n\tViewZonesChanged,\n}\n\nexport class ViewCompositionStartEvent {\n\tpublic readonly type = ViewEventType.ViewCompositionStart;\n\tconstructor() { }\n}\n\nexport class ViewCompositionEndEvent {\n\tpublic readonly type = ViewEventType.ViewCompositionEnd;\n\tconstructor() { }\n}\n\nexport class ViewConfigurationChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewConfigurationChanged;\n\n\tpublic readonly _source: ConfigurationChangedEvent;\n\n\tconstructor(source: ConfigurationChangedEvent) {\n\t\tthis._source = source;\n\t}\n\n\tpublic hasChanged(id: EditorOption): boolean {\n\t\treturn this._source.hasChanged(id);\n\t}\n}\n\nexport class ViewCursorStateChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewCursorStateChanged;\n\n\tpublic readonly selections: Selection[];\n\tpublic readonly modelSelections: Selection[];\n\n\tconstructor(selections: Selection[], modelSelections: Selection[]) {\n\t\tthis.selections = selections;\n\t\tthis.modelSelections = modelSelections;\n\t}\n}\n\nexport class ViewDecorationsChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewDecorationsChanged;\n\n\treadonly affectsMinimap: boolean;\n\treadonly affectsOverviewRuler: boolean;\n\n\tconstructor(source: IModelDecorationsChangedEvent | null) {\n\t\tif (source) {\n\t\t\tthis.affectsMinimap = source.affectsMinimap;\n\t\t\tthis.affectsOverviewRuler = source.affectsOverviewRuler;\n\t\t} else {\n\t\t\tthis.affectsMinimap = true;\n\t\t\tthis.affectsOverviewRuler = true;\n\t\t}\n\t}\n}\n\nexport class ViewFlushedEvent {\n\n\tpublic readonly type = ViewEventType.ViewFlushed;\n\n\tconstructor() {\n\t\t// Nothing to do\n\t}\n}\n\nexport class ViewFocusChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewFocusChanged;\n\n\tpublic readonly isFocused: boolean;\n\n\tconstructor(isFocused: boolean) {\n\t\tthis.isFocused = isFocused;\n\t}\n}\n\nexport class ViewLanguageConfigurationEvent {\n\n\tpublic readonly type = ViewEventType.ViewLanguageConfigurationChanged;\n}\n\nexport class ViewLineMappingChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewLineMappingChanged;\n\n\tconstructor() {\n\t\t// Nothing to do\n\t}\n}\n\nexport class ViewLinesChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewLinesChanged;\n\n\t/**\n\t * The first line that has changed.\n\t */\n\tpublic readonly fromLineNumber: number;\n\t/**\n\t * The last line that has changed.\n\t */\n\tpublic readonly toLineNumber: number;\n\n\tconstructor(fromLineNumber: number, toLineNumber: number) {\n\t\tthis.fromLineNumber = fromLineNumber;\n\t\tthis.toLineNumber = toLineNumber;\n\t}\n}\n\nexport class ViewLinesDeletedEvent {\n\n\tpublic readonly type = ViewEventType.ViewLinesDeleted;\n\n\t/**\n\t * At what line the deletion began (inclusive).\n\t */\n\tpublic readonly fromLineNumber: number;\n\t/**\n\t * At what line the deletion stopped (inclusive).\n\t */\n\tpublic readonly toLineNumber: number;\n\n\tconstructor(fromLineNumber: number, toLineNumber: number) {\n\t\tthis.fromLineNumber = fromLineNumber;\n\t\tthis.toLineNumber = toLineNumber;\n\t}\n}\n\nexport class ViewLinesInsertedEvent {\n\n\tpublic readonly type = ViewEventType.ViewLinesInserted;\n\n\t/**\n\t * Before what line did the insertion begin\n\t */\n\tpublic readonly fromLineNumber: number;\n\t/**\n\t * `toLineNumber` - `fromLineNumber` + 1 denotes the number of lines that were inserted\n\t */\n\tpublic readonly toLineNumber: number;\n\n\tconstructor(fromLineNumber: number, toLineNumber: number) {\n\t\tthis.fromLineNumber = fromLineNumber;\n\t\tthis.toLineNumber = toLineNumber;\n\t}\n}\n\nexport const enum VerticalRevealType {\n\tSimple = 0,\n\tCenter = 1,\n\tCenterIfOutsideViewport = 2,\n\tTop = 3,\n\tBottom = 4,\n\tNearTop = 5,\n\tNearTopIfOutsideViewport = 6,\n}\n\nexport class ViewRevealRangeRequestEvent {\n\n\tpublic readonly type = ViewEventType.ViewRevealRangeRequest;\n\n\n\tconstructor(\n\t\t/**\n\t\t * Source of the call that caused the event.\n\t\t */\n\t\tpublic readonly source: string | null | undefined,\n\t\t/**\n\t\t * Reduce the revealing to a minimum (e.g. avoid scrolling if the bounding box is visible and near the viewport edge).\n\t\t */\n\t\tpublic readonly minimalReveal: boolean,\n\t\t/**\n\t\t * Range to be reavealed.\n\t\t */\n\t\tpublic readonly range: Range | null,\n\t\t/**\n\t\t * Selections to be revealed.\n\t\t */\n\t\tpublic readonly selections: Selection[] | null,\n\t\t/**\n\t\t * The vertical reveal strategy.\n\t\t */\n\t\tpublic readonly verticalType: VerticalRevealType,\n\t\t/**\n\t\t * If true: there should be a horizontal & vertical revealing.\n\t\t * If false: there should be just a vertical revealing.\n\t\t */\n\t\tpublic readonly revealHorizontal: boolean,\n\t\t/**\n\t\t * The scroll type.\n\t\t */\n\t\tpublic readonly scrollType: ScrollType\n\t) { }\n}\n\nexport class ViewScrollChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewScrollChanged;\n\n\tpublic readonly scrollWidth: number;\n\tpublic readonly scrollLeft: number;\n\tpublic readonly scrollHeight: number;\n\tpublic readonly scrollTop: number;\n\n\tpublic readonly scrollWidthChanged: boolean;\n\tpublic readonly scrollLeftChanged: boolean;\n\tpublic readonly scrollHeightChanged: boolean;\n\tpublic readonly scrollTopChanged: boolean;\n\n\tconstructor(source: ScrollEvent) {\n\t\tthis.scrollWidth = source.scrollWidth;\n\t\tthis.scrollLeft = source.scrollLeft;\n\t\tthis.scrollHeight = source.scrollHeight;\n\t\tthis.scrollTop = source.scrollTop;\n\n\t\tthis.scrollWidthChanged = source.scrollWidthChanged;\n\t\tthis.scrollLeftChanged = source.scrollLeftChanged;\n\t\tthis.scrollHeightChanged = source.scrollHeightChanged;\n\t\tthis.scrollTopChanged = source.scrollTopChanged;\n\t}\n}\n\nexport class ViewThemeChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewThemeChanged;\n\n\tconstructor(\n\t\tpublic readonly theme: IColorTheme\n\t) { }\n}\n\nexport class ViewTokensChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewTokensChanged;\n\n\tpublic readonly ranges: {\n\t\t/**\n\t\t * Start line number of range\n\t\t */\n\t\treadonly fromLineNumber: number;\n\t\t/**\n\t\t * End line number of range\n\t\t */\n\t\treadonly toLineNumber: number;\n\t}[];\n\n\tconstructor(ranges: { fromLineNumber: number; toLineNumber: number }[]) {\n\t\tthis.ranges = ranges;\n\t}\n}\n\nexport class ViewTokensColorsChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewTokensColorsChanged;\n\n\tconstructor() {\n\t\t// Nothing to do\n\t}\n}\n\nexport class ViewZonesChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewZonesChanged;\n\n\tconstructor() {\n\t\t// Nothing to do\n\t}\n}\n\nexport type ViewEvent = (\n\tViewCompositionStartEvent\n\t| ViewCompositionEndEvent\n\t| ViewConfigurationChangedEvent\n\t| ViewCursorStateChangedEvent\n\t| ViewDecorationsChangedEvent\n\t| ViewFlushedEvent\n\t| ViewFocusChangedEvent\n\t| ViewLanguageConfigurationEvent\n\t| ViewLineMappingChangedEvent\n\t| ViewLinesChangedEvent\n\t| ViewLinesDeletedEvent\n\t| ViewLinesInsertedEvent\n\t| ViewRevealRangeRequestEvent\n\t| ViewScrollChangedEvent\n\t| ViewThemeChangedEvent\n\t| ViewTokensChangedEvent\n\t| ViewTokensColorsChangedEvent\n\t| ViewZonesChangedEvent\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 * as strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/base/common/uint';\nimport { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel';\nimport { LinePartMetadata } from 'vs/editor/common/viewLayout/viewLineRenderer';\n\nexport class LineDecoration {\n\t_lineDecorationBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly startColumn: number,\n\t\tpublic readonly endColumn: number,\n\t\tpublic readonly className: string,\n\t\tpublic readonly type: InlineDecorationType\n\t) {\n\t}\n\n\tprivate static _equals(a: LineDecoration, b: LineDecoration): boolean {\n\t\treturn (\n\t\t\ta.startColumn === b.startColumn\n\t\t\t&& a.endColumn === b.endColumn\n\t\t\t&& a.className === b.className\n\t\t\t&& a.type === b.type\n\t\t);\n\t}\n\n\tpublic static equalsArr(a: LineDecoration[], b: LineDecoration[]): boolean {\n\t\tconst aLen = a.length;\n\t\tconst bLen = b.length;\n\t\tif (aLen !== bLen) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < aLen; i++) {\n\t\t\tif (!LineDecoration._equals(a[i], b[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static extractWrapped(arr: LineDecoration[], startOffset: number, endOffset: number): LineDecoration[] {\n\t\tif (arr.length === 0) {\n\t\t\treturn arr;\n\t\t}\n\t\tconst startColumn = startOffset + 1;\n\t\tconst endColumn = endOffset + 1;\n\t\tconst lineLength = endOffset - startOffset;\n\t\tconst r = [];\n\t\tlet rLength = 0;\n\t\tfor (const dec of arr) {\n\t\t\tif (dec.endColumn <= startColumn || dec.startColumn >= endColumn) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr[rLength++] = new LineDecoration(Math.max(1, dec.startColumn - startColumn + 1), Math.min(lineLength + 1, dec.endColumn - startColumn + 1), dec.className, dec.type);\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic static filter(lineDecorations: InlineDecoration[], lineNumber: number, minLineColumn: number, maxLineColumn: number): LineDecoration[] {\n\t\tif (lineDecorations.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst result: LineDecoration[] = [];\n\t\tlet resultLen = 0;\n\n\t\tfor (let i = 0, len = lineDecorations.length; i < len; i++) {\n\t\t\tconst d = lineDecorations[i];\n\t\t\tconst range = d.range;\n\n\t\t\tif (range.endLineNumber < lineNumber || range.startLineNumber > lineNumber) {\n\t\t\t\t// Ignore decorations that sit outside this line\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (range.isEmpty() && (d.type === InlineDecorationType.Regular || d.type === InlineDecorationType.RegularAffectingLetterSpacing)) {\n\t\t\t\t// Ignore empty range decorations\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst startColumn = (range.startLineNumber === lineNumber ? range.startColumn : minLineColumn);\n\t\t\tconst endColumn = (range.endLineNumber === lineNumber ? range.endColumn : maxLineColumn);\n\n\t\t\tresult[resultLen++] = new LineDecoration(startColumn, endColumn, d.inlineClassName, d.type);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _typeCompare(a: InlineDecorationType, b: InlineDecorationType): number {\n\t\tconst ORDER = [2, 0, 1, 3];\n\t\treturn ORDER[a] - ORDER[b];\n\t}\n\n\tpublic static compare(a: LineDecoration, b: LineDecoration): number {\n\t\tif (a.startColumn !== b.startColumn) {\n\t\t\treturn a.startColumn - b.startColumn;\n\t\t}\n\n\t\tif (a.endColumn !== b.endColumn) {\n\t\t\treturn a.endColumn - b.endColumn;\n\t\t}\n\n\t\tconst typeCmp = LineDecoration._typeCompare(a.type, b.type);\n\t\tif (typeCmp !== 0) {\n\t\t\treturn typeCmp;\n\t\t}\n\n\t\tif (a.className !== b.className) {\n\t\t\treturn a.className < b.className ? -1 : 1;\n\t\t}\n\n\t\treturn 0;\n\t}\n}\n\nexport class DecorationSegment {\n\tstartOffset: number;\n\tendOffset: number;\n\tclassName: string;\n\tmetadata: number;\n\n\tconstructor(startOffset: number, endOffset: number, className: string, metadata: number) {\n\t\tthis.startOffset = startOffset;\n\t\tthis.endOffset = endOffset;\n\t\tthis.className = className;\n\t\tthis.metadata = metadata;\n\t}\n}\n\nclass Stack {\n\tpublic count: number;\n\tprivate readonly stopOffsets: number[];\n\tprivate readonly classNames: string[];\n\tprivate readonly metadata: number[];\n\n\tconstructor() {\n\t\tthis.stopOffsets = [];\n\t\tthis.classNames = [];\n\t\tthis.metadata = [];\n\t\tthis.count = 0;\n\t}\n\n\tprivate static _metadata(metadata: number[]): number {\n\t\tlet result = 0;\n\t\tfor (let i = 0, len = metadata.length; i < len; i++) {\n\t\t\tresult |= metadata[i];\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic consumeLowerThan(maxStopOffset: number, nextStartOffset: number, result: DecorationSegment[]): number {\n\n\t\twhile (this.count > 0 && this.stopOffsets[0] < maxStopOffset) {\n\t\t\tlet i = 0;\n\n\t\t\t// Take all equal stopping offsets\n\t\t\twhile (i + 1 < this.count && this.stopOffsets[i] === this.stopOffsets[i + 1]) {\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t// Basically we are consuming the first i + 1 elements of the stack\n\t\t\tresult.push(new DecorationSegment(nextStartOffset, this.stopOffsets[i], this.classNames.join(' '), Stack._metadata(this.metadata)));\n\t\t\tnextStartOffset = this.stopOffsets[i] + 1;\n\n\t\t\t// Consume them\n\t\t\tthis.stopOffsets.splice(0, i + 1);\n\t\t\tthis.classNames.splice(0, i + 1);\n\t\t\tthis.metadata.splice(0, i + 1);\n\t\t\tthis.count -= (i + 1);\n\t\t}\n\n\t\tif (this.count > 0 && nextStartOffset < maxStopOffset) {\n\t\t\tresult.push(new DecorationSegment(nextStartOffset, maxStopOffset - 1, this.classNames.join(' '), Stack._metadata(this.metadata)));\n\t\t\tnextStartOffset = maxStopOffset;\n\t\t}\n\n\t\treturn nextStartOffset;\n\t}\n\n\tpublic insert(stopOffset: number, className: string, metadata: number): void {\n\t\tif (this.count === 0 || this.stopOffsets[this.count - 1] <= stopOffset) {\n\t\t\t// Insert at the end\n\t\t\tthis.stopOffsets.push(stopOffset);\n\t\t\tthis.classNames.push(className);\n\t\t\tthis.metadata.push(metadata);\n\t\t} else {\n\t\t\t// Find the insertion position for `stopOffset`\n\t\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\t\tif (this.stopOffsets[i] >= stopOffset) {\n\t\t\t\t\tthis.stopOffsets.splice(i, 0, stopOffset);\n\t\t\t\t\tthis.classNames.splice(i, 0, className);\n\t\t\t\t\tthis.metadata.splice(i, 0, metadata);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.count++;\n\t\treturn;\n\t}\n}\n\nexport class LineDecorationsNormalizer {\n\t/**\n\t * Normalize line decorations. Overlapping decorations will generate multiple segments\n\t */\n\tpublic static normalize(lineContent: string, lineDecorations: LineDecoration[]): DecorationSegment[] {\n\t\tif (lineDecorations.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst result: DecorationSegment[] = [];\n\n\t\tconst stack = new Stack();\n\t\tlet nextStartOffset = 0;\n\n\t\tfor (let i = 0, len = lineDecorations.length; i < len; i++) {\n\t\t\tconst d = lineDecorations[i];\n\t\t\tlet startColumn = d.startColumn;\n\t\t\tlet endColumn = d.endColumn;\n\t\t\tconst className = d.className;\n\t\t\tconst metadata = (\n\t\t\t\td.type === InlineDecorationType.Before\n\t\t\t\t\t? LinePartMetadata.PSEUDO_BEFORE\n\t\t\t\t\t: d.type === InlineDecorationType.After\n\t\t\t\t\t\t? LinePartMetadata.PSEUDO_AFTER\n\t\t\t\t\t\t: 0\n\t\t\t);\n\n\t\t\t// If the position would end up in the middle of a high-low surrogate pair, we move it to before the pair\n\t\t\tif (startColumn > 1) {\n\t\t\t\tconst charCodeBefore = lineContent.charCodeAt(startColumn - 2);\n\t\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\t\tstartColumn--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (endColumn > 1) {\n\t\t\t\tconst charCodeBefore = lineContent.charCodeAt(endColumn - 2);\n\t\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\t\tendColumn--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst currentStartOffset = startColumn - 1;\n\t\t\tconst currentEndOffset = endColumn - 2;\n\n\t\t\tnextStartOffset = stack.consumeLowerThan(currentStartOffset, nextStartOffset, result);\n\n\t\t\tif (stack.count === 0) {\n\t\t\t\tnextStartOffset = currentStartOffset;\n\t\t\t}\n\t\t\tstack.insert(currentEndOffset, className, metadata);\n\t\t}\n\n\t\tstack.consumeLowerThan(Constants.MAX_SAFE_SMALL_INTEGER, nextStartOffset, result);\n\n\t\treturn result;\n\t}\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 { IEditorWhitespace, IPartialViewLinesViewportData, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from 'vs/editor/common/viewModel';\nimport * as strings from 'vs/base/common/strings';\n\ninterface IPendingChange { id: string; newAfterLineNumber: number; newHeight: number }\ninterface IPendingRemove { id: string }\n\nclass PendingChanges {\n\tprivate _hasPending: boolean;\n\tprivate _inserts: EditorWhitespace[];\n\tprivate _changes: IPendingChange[];\n\tprivate _removes: IPendingRemove[];\n\n\tconstructor() {\n\t\tthis._hasPending = false;\n\t\tthis._inserts = [];\n\t\tthis._changes = [];\n\t\tthis._removes = [];\n\t}\n\n\tpublic insert(x: EditorWhitespace): void {\n\t\tthis._hasPending = true;\n\t\tthis._inserts.push(x);\n\t}\n\n\tpublic change(x: IPendingChange): void {\n\t\tthis._hasPending = true;\n\t\tthis._changes.push(x);\n\t}\n\n\tpublic remove(x: IPendingRemove): void {\n\t\tthis._hasPending = true;\n\t\tthis._removes.push(x);\n\t}\n\n\tpublic mustCommit(): boolean {\n\t\treturn this._hasPending;\n\t}\n\n\tpublic commit(linesLayout: LinesLayout): void {\n\t\tif (!this._hasPending) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst inserts = this._inserts;\n\t\tconst changes = this._changes;\n\t\tconst removes = this._removes;\n\n\t\tthis._hasPending = false;\n\t\tthis._inserts = [];\n\t\tthis._changes = [];\n\t\tthis._removes = [];\n\n\t\tlinesLayout._commitPendingChanges(inserts, changes, removes);\n\t}\n}\n\nexport class EditorWhitespace implements IEditorWhitespace {\n\tpublic id: string;\n\tpublic afterLineNumber: number;\n\tpublic ordinal: number;\n\tpublic height: number;\n\tpublic minWidth: number;\n\tpublic prefixSum: number;\n\n\tconstructor(id: string, afterLineNumber: number, ordinal: number, height: number, minWidth: number) {\n\t\tthis.id = id;\n\t\tthis.afterLineNumber = afterLineNumber;\n\t\tthis.ordinal = ordinal;\n\t\tthis.height = height;\n\t\tthis.minWidth = minWidth;\n\t\tthis.prefixSum = 0;\n\t}\n}\n\n/**\n * Layouting of objects that take vertical space (by having a height) and push down other objects.\n *\n * These objects are basically either text (lines) or spaces between those lines (whitespaces).\n * This provides commodity operations for working with lines that contain whitespace that pushes lines lower (vertically).\n */\nexport class LinesLayout {\n\n\tprivate static INSTANCE_COUNT = 0;\n\n\tprivate readonly _instanceId: string;\n\tprivate readonly _pendingChanges: PendingChanges;\n\tprivate _lastWhitespaceId: number;\n\tprivate _arr: EditorWhitespace[];\n\tprivate _prefixSumValidIndex: number;\n\tprivate _minWidth: number;\n\tprivate _lineCount: number;\n\tprivate _lineHeight: number;\n\tprivate _paddingTop: number;\n\tprivate _paddingBottom: number;\n\n\tconstructor(lineCount: number, lineHeight: number, paddingTop: number, paddingBottom: number) {\n\t\tthis._instanceId = strings.singleLetterHash(++LinesLayout.INSTANCE_COUNT);\n\t\tthis._pendingChanges = new PendingChanges();\n\t\tthis._lastWhitespaceId = 0;\n\t\tthis._arr = [];\n\t\tthis._prefixSumValidIndex = -1;\n\t\tthis._minWidth = -1; /* marker for not being computed */\n\t\tthis._lineCount = lineCount;\n\t\tthis._lineHeight = lineHeight;\n\t\tthis._paddingTop = paddingTop;\n\t\tthis._paddingBottom = paddingBottom;\n\t}\n\n\t/**\n\t * Find the insertion index for a new value inside a sorted array of values.\n\t * If the value is already present in the sorted array, the insertion index will be after the already existing value.\n\t */\n\tpublic static findInsertionIndex(arr: EditorWhitespace[], afterLineNumber: number, ordinal: number): number {\n\t\tlet low = 0;\n\t\tlet high = arr.length;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = ((low + high) >>> 1);\n\n\t\t\tif (afterLineNumber === arr[mid].afterLineNumber) {\n\t\t\t\tif (ordinal < arr[mid].ordinal) {\n\t\t\t\t\thigh = mid;\n\t\t\t\t} else {\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t}\n\t\t\t} else if (afterLineNumber < arr[mid].afterLineNumber) {\n\t\t\t\thigh = mid;\n\t\t\t} else {\n\t\t\t\tlow = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn low;\n\t}\n\n\t/**\n\t * Change the height of a line in pixels.\n\t */\n\tpublic setLineHeight(lineHeight: number): void {\n\t\tthis._checkPendingChanges();\n\t\tthis._lineHeight = lineHeight;\n\t}\n\n\t/**\n\t * Changes the padding used to calculate vertical offsets.\n\t */\n\tpublic setPadding(paddingTop: number, paddingBottom: number): void {\n\t\tthis._paddingTop = paddingTop;\n\t\tthis._paddingBottom = paddingBottom;\n\t}\n\n\t/**\n\t * Set the number of lines.\n\t *\n\t * @param lineCount New number of lines.\n\t */\n\tpublic onFlushed(lineCount: number): void {\n\t\tthis._checkPendingChanges();\n\t\tthis._lineCount = lineCount;\n\t}\n\n\tpublic changeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): boolean {\n\t\tlet hadAChange = false;\n\t\ttry {\n\t\t\tconst accessor: IWhitespaceChangeAccessor = {\n\t\t\t\tinsertWhitespace: (afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string => {\n\t\t\t\t\thadAChange = true;\n\t\t\t\t\tafterLineNumber = afterLineNumber | 0;\n\t\t\t\t\tordinal = ordinal | 0;\n\t\t\t\t\theightInPx = heightInPx | 0;\n\t\t\t\t\tminWidth = minWidth | 0;\n\t\t\t\t\tconst id = this._instanceId + (++this._lastWhitespaceId);\n\t\t\t\t\tthis._pendingChanges.insert(new EditorWhitespace(id, afterLineNumber, ordinal, heightInPx, minWidth));\n\t\t\t\t\treturn id;\n\t\t\t\t},\n\t\t\t\tchangeOneWhitespace: (id: string, newAfterLineNumber: number, newHeight: number): void => {\n\t\t\t\t\thadAChange = true;\n\t\t\t\t\tnewAfterLineNumber = newAfterLineNumber | 0;\n\t\t\t\t\tnewHeight = newHeight | 0;\n\t\t\t\t\tthis._pendingChanges.change({ id, newAfterLineNumber, newHeight });\n\t\t\t\t},\n\t\t\t\tremoveWhitespace: (id: string): void => {\n\t\t\t\t\thadAChange = true;\n\t\t\t\t\tthis._pendingChanges.remove({ id });\n\t\t\t\t}\n\t\t\t};\n\t\t\tcallback(accessor);\n\t\t} finally {\n\t\t\tthis._pendingChanges.commit(this);\n\t\t}\n\t\treturn hadAChange;\n\t}\n\n\tpublic _commitPendingChanges(inserts: EditorWhitespace[], changes: IPendingChange[], removes: IPendingRemove[]): void {\n\t\tif (inserts.length > 0 || removes.length > 0) {\n\t\t\tthis._minWidth = -1; /* marker for not being computed */\n\t\t}\n\n\t\tif (inserts.length + changes.length + removes.length <= 1) {\n\t\t\t// when only one thing happened, handle it \"delicately\"\n\t\t\tfor (const insert of inserts) {\n\t\t\t\tthis._insertWhitespace(insert);\n\t\t\t}\n\t\t\tfor (const change of changes) {\n\t\t\t\tthis._changeOneWhitespace(change.id, change.newAfterLineNumber, change.newHeight);\n\t\t\t}\n\t\t\tfor (const remove of removes) {\n\t\t\t\tconst index = this._findWhitespaceIndex(remove.id);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._removeWhitespace(index);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// simply rebuild the entire datastructure\n\n\t\tconst toRemove = new Set<string>();\n\t\tfor (const remove of removes) {\n\t\t\ttoRemove.add(remove.id);\n\t\t}\n\n\t\tconst toChange = new Map<string, IPendingChange>();\n\t\tfor (const change of changes) {\n\t\t\ttoChange.set(change.id, change);\n\t\t}\n\n\t\tconst applyRemoveAndChange = (whitespaces: EditorWhitespace[]): EditorWhitespace[] => {\n\t\t\tconst result: EditorWhitespace[] = [];\n\t\t\tfor (const whitespace of whitespaces) {\n\t\t\t\tif (toRemove.has(whitespace.id)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (toChange.has(whitespace.id)) {\n\t\t\t\t\tconst change = toChange.get(whitespace.id)!;\n\t\t\t\t\twhitespace.afterLineNumber = change.newAfterLineNumber;\n\t\t\t\t\twhitespace.height = change.newHeight;\n\t\t\t\t}\n\t\t\t\tresult.push(whitespace);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst result = applyRemoveAndChange(this._arr).concat(applyRemoveAndChange(inserts));\n\t\tresult.sort((a, b) => {\n\t\t\tif (a.afterLineNumber === b.afterLineNumber) {\n\t\t\t\treturn a.ordinal - b.ordinal;\n\t\t\t}\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t});\n\n\t\tthis._arr = result;\n\t\tthis._prefixSumValidIndex = -1;\n\t}\n\n\tprivate _checkPendingChanges(): void {\n\t\tif (this._pendingChanges.mustCommit()) {\n\t\t\tthis._pendingChanges.commit(this);\n\t\t}\n\t}\n\n\tprivate _insertWhitespace(whitespace: EditorWhitespace): void {\n\t\tconst insertIndex = LinesLayout.findInsertionIndex(this._arr, whitespace.afterLineNumber, whitespace.ordinal);\n\t\tthis._arr.splice(insertIndex, 0, whitespace);\n\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, insertIndex - 1);\n\t}\n\n\tprivate _findWhitespaceIndex(id: string): number {\n\t\tconst arr = this._arr;\n\t\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\t\tif (arr[i].id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tprivate _changeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void {\n\t\tconst index = this._findWhitespaceIndex(id);\n\t\tif (index === -1) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._arr[index].height !== newHeight) {\n\t\t\tthis._arr[index].height = newHeight;\n\t\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, index - 1);\n\t\t}\n\t\tif (this._arr[index].afterLineNumber !== newAfterLineNumber) {\n\t\t\t// `afterLineNumber` changed for this whitespace\n\n\t\t\t// Record old whitespace\n\t\t\tconst whitespace = this._arr[index];\n\n\t\t\t// Since changing `afterLineNumber` can trigger a reordering, we're gonna remove this whitespace\n\t\t\tthis._removeWhitespace(index);\n\n\t\t\twhitespace.afterLineNumber = newAfterLineNumber;\n\n\t\t\t// And add it again\n\t\t\tthis._insertWhitespace(whitespace);\n\t\t}\n\t}\n\n\tprivate _removeWhitespace(removeIndex: number): void {\n\t\tthis._arr.splice(removeIndex, 1);\n\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, removeIndex - 1);\n\t}\n\n\t/**\n\t * Notify the layouter that lines have been deleted (a continuous zone of lines).\n\t *\n\t * @param fromLineNumber The line number at which the deletion started, inclusive\n\t * @param toLineNumber The line number at which the deletion ended, inclusive\n\t */\n\tpublic onLinesDeleted(fromLineNumber: number, toLineNumber: number): void {\n\t\tthis._checkPendingChanges();\n\t\tfromLineNumber = fromLineNumber | 0;\n\t\ttoLineNumber = toLineNumber | 0;\n\n\t\tthis._lineCount -= (toLineNumber - fromLineNumber + 1);\n\t\tfor (let i = 0, len = this._arr.length; i < len; i++) {\n\t\t\tconst afterLineNumber = this._arr[i].afterLineNumber;\n\n\t\t\tif (fromLineNumber <= afterLineNumber && afterLineNumber <= toLineNumber) {\n\t\t\t\t// The line this whitespace was after has been deleted\n\t\t\t\t// => move whitespace to before first deleted line\n\t\t\t\tthis._arr[i].afterLineNumber = fromLineNumber - 1;\n\t\t\t} else if (afterLineNumber > toLineNumber) {\n\t\t\t\t// The line this whitespace was after has been moved up\n\t\t\t\t// => move whitespace up\n\t\t\t\tthis._arr[i].afterLineNumber -= (toLineNumber - fromLineNumber + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Notify the layouter that lines have been inserted (a continuous zone of lines).\n\t *\n\t * @param fromLineNumber The line number at which the insertion started, inclusive\n\t * @param toLineNumber The line number at which the insertion ended, inclusive.\n\t */\n\tpublic onLinesInserted(fromLineNumber: number, toLineNumber: number): void {\n\t\tthis._checkPendingChanges();\n\t\tfromLineNumber = fromLineNumber | 0;\n\t\ttoLineNumber = toLineNumber | 0;\n\n\t\tthis._lineCount += (toLineNumber - fromLineNumber + 1);\n\t\tfor (let i = 0, len = this._arr.length; i < len; i++) {\n\t\t\tconst afterLineNumber = this._arr[i].afterLineNumber;\n\n\t\t\tif (fromLineNumber <= afterLineNumber) {\n\t\t\t\tthis._arr[i].afterLineNumber += (toLineNumber - fromLineNumber + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the sum of all the whitespaces.\n\t */\n\tpublic getWhitespacesTotalHeight(): number {\n\t\tthis._checkPendingChanges();\n\t\tif (this._arr.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.getWhitespacesAccumulatedHeight(this._arr.length - 1);\n\t}\n\n\t/**\n\t * Return the sum of the heights of the whitespaces at [0..index].\n\t * This includes the whitespace at `index`.\n\t *\n\t * @param index The index of the whitespace.\n\t * @return The sum of the heights of all whitespaces before the one at `index`, including the one at `index`.\n\t */\n\tpublic getWhitespacesAccumulatedHeight(index: number): number {\n\t\tthis._checkPendingChanges();\n\t\tindex = index | 0;\n\n\t\tlet startIndex = Math.max(0, this._prefixSumValidIndex + 1);\n\t\tif (startIndex === 0) {\n\t\t\tthis._arr[0].prefixSum = this._arr[0].height;\n\t\t\tstartIndex++;\n\t\t}\n\n\t\tfor (let i = startIndex; i <= index; i++) {\n\t\t\tthis._arr[i].prefixSum = this._arr[i - 1].prefixSum + this._arr[i].height;\n\t\t}\n\t\tthis._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, index);\n\t\treturn this._arr[index].prefixSum;\n\t}\n\n\t/**\n\t * Get the sum of heights for all objects.\n\t *\n\t * @return The sum of heights for all objects.\n\t */\n\tpublic getLinesTotalHeight(): number {\n\t\tthis._checkPendingChanges();\n\t\tconst linesHeight = this._lineHeight * this._lineCount;\n\t\tconst whitespacesHeight = this.getWhitespacesTotalHeight();\n\n\t\treturn linesHeight + whitespacesHeight + this._paddingTop + this._paddingBottom;\n\t}\n\n\t/**\n\t * Returns the accumulated height of whitespaces before the given line number.\n\t *\n\t * @param lineNumber The line number\n\t */\n\tpublic getWhitespaceAccumulatedHeightBeforeLineNumber(lineNumber: number): number {\n\t\tthis._checkPendingChanges();\n\t\tlineNumber = lineNumber | 0;\n\n\t\tconst lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber);\n\n\t\tif (lastWhitespaceBeforeLineNumber === -1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.getWhitespacesAccumulatedHeight(lastWhitespaceBeforeLineNumber);\n\t}\n\n\tprivate _findLastWhitespaceBeforeLineNumber(lineNumber: number): number {\n\t\tlineNumber = lineNumber | 0;\n\n\t\t// Find the whitespace before line number\n\t\tconst arr = this._arr;\n\t\tlet low = 0;\n\t\tlet high = arr.length - 1;\n\n\t\twhile (low <= high) {\n\t\t\tconst delta = (high - low) | 0;\n\t\t\tconst halfDelta = (delta / 2) | 0;\n\t\t\tconst mid = (low + halfDelta) | 0;\n\n\t\t\tif (arr[mid].afterLineNumber < lineNumber) {\n\t\t\t\tif (mid + 1 >= arr.length || arr[mid + 1].afterLineNumber >= lineNumber) {\n\t\t\t\t\treturn mid;\n\t\t\t\t} else {\n\t\t\t\t\tlow = (mid + 1) | 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thigh = (mid - 1) | 0;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\tprivate _findFirstWhitespaceAfterLineNumber(lineNumber: number): number {\n\t\tlineNumber = lineNumber | 0;\n\n\t\tconst lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber);\n\t\tconst firstWhitespaceAfterLineNumber = lastWhitespaceBeforeLineNumber + 1;\n\n\t\tif (firstWhitespaceAfterLineNumber < this._arr.length) {\n\t\t\treturn firstWhitespaceAfterLineNumber;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Find the index of the first whitespace which has `afterLineNumber` >= `lineNumber`.\n\t * @return The index of the first whitespace with `afterLineNumber` >= `lineNumber` or -1 if no whitespace is found.\n\t */\n\tpublic getFirstWhitespaceIndexAfterLineNumber(lineNumber: number): number {\n\t\tthis._checkPendingChanges();\n\t\tlineNumber = lineNumber | 0;\n\n\t\treturn this._findFirstWhitespaceAfterLineNumber(lineNumber);\n\t}\n\n\t/**\n\t * Get the vertical offset (the sum of heights for all objects above) a certain line number.\n\t *\n\t * @param lineNumber The line number\n\t * @return The sum of heights for all objects above `lineNumber`.\n\t */\n\tpublic getVerticalOffsetForLineNumber(lineNumber: number): number {\n\t\tthis._checkPendingChanges();\n\t\tlineNumber = lineNumber | 0;\n\n\t\tlet previousLinesHeight: number;\n\t\tif (lineNumber > 1) {\n\t\t\tpreviousLinesHeight = this._lineHeight * (lineNumber - 1);\n\t\t} else {\n\t\t\tpreviousLinesHeight = 0;\n\t\t}\n\n\t\tconst previousWhitespacesHeight = this.getWhitespaceAccumulatedHeightBeforeLineNumber(lineNumber);\n\n\t\treturn previousLinesHeight + previousWhitespacesHeight + this._paddingTop;\n\t}\n\n\t/**\n\t * The maximum min width for all whitespaces.\n\t */\n\tpublic getWhitespaceMinWidth(): number {\n\t\tthis._checkPendingChanges();\n\t\tif (this._minWidth === -1) {\n\t\t\tlet minWidth = 0;\n\t\t\tfor (let i = 0, len = this._arr.length; i < len; i++) {\n\t\t\t\tminWidth = Math.max(minWidth, this._arr[i].minWidth);\n\t\t\t}\n\t\t\tthis._minWidth = minWidth;\n\t\t}\n\t\treturn this._minWidth;\n\t}\n\n\t/**\n\t * Check if `verticalOffset` is below all lines.\n\t */\n\tpublic isAfterLines(verticalOffset: number): boolean {\n\t\tthis._checkPendingChanges();\n\t\tconst totalHeight = this.getLinesTotalHeight();\n\t\treturn verticalOffset > totalHeight;\n\t}\n\n\tpublic isInTopPadding(verticalOffset: number): boolean {\n\t\tif (this._paddingTop === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._checkPendingChanges();\n\t\treturn (verticalOffset < this._paddingTop);\n\t}\n\n\tpublic isInBottomPadding(verticalOffset: number): boolean {\n\t\tif (this._paddingBottom === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._checkPendingChanges();\n\t\tconst totalHeight = this.getLinesTotalHeight();\n\t\treturn (verticalOffset >= totalHeight - this._paddingBottom);\n\t}\n\n\t/**\n\t * Find the first line number that is at or after vertical offset `verticalOffset`.\n\t * i.e. if getVerticalOffsetForLine(line) is x and getVerticalOffsetForLine(line + 1) is y, then\n\t * getLineNumberAtOrAfterVerticalOffset(i) = line, x <= i < y.\n\t *\n\t * @param verticalOffset The vertical offset to search at.\n\t * @return The line number at or after vertical offset `verticalOffset`.\n\t */\n\tpublic getLineNumberAtOrAfterVerticalOffset(verticalOffset: number): number {\n\t\tthis._checkPendingChanges();\n\t\tverticalOffset = verticalOffset | 0;\n\n\t\tif (verticalOffset < 0) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst linesCount = this._lineCount | 0;\n\t\tconst lineHeight = this._lineHeight;\n\t\tlet minLineNumber = 1;\n\t\tlet maxLineNumber = linesCount;\n\n\t\twhile (minLineNumber < maxLineNumber) {\n\t\t\tconst midLineNumber = ((minLineNumber + maxLineNumber) / 2) | 0;\n\n\t\t\tconst midLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(midLineNumber) | 0;\n\n\t\t\tif (verticalOffset >= midLineNumberVerticalOffset + lineHeight) {\n\t\t\t\t// vertical offset is after mid line number\n\t\t\t\tminLineNumber = midLineNumber + 1;\n\t\t\t} else if (verticalOffset >= midLineNumberVerticalOffset) {\n\t\t\t\t// Hit\n\t\t\t\treturn midLineNumber;\n\t\t\t} else {\n\t\t\t\t// vertical offset is before mid line number, but mid line number could still be what we're searching for\n\t\t\t\tmaxLineNumber = midLineNumber;\n\t\t\t}\n\t\t}\n\n\t\tif (minLineNumber > linesCount) {\n\t\t\treturn linesCount;\n\t\t}\n\n\t\treturn minLineNumber;\n\t}\n\n\t/**\n\t * Get all the lines and their relative vertical offsets that are positioned between `verticalOffset1` and `verticalOffset2`.\n\t *\n\t * @param verticalOffset1 The beginning of the viewport.\n\t * @param verticalOffset2 The end of the viewport.\n\t * @return A structure describing the lines positioned between `verticalOffset1` and `verticalOffset2`.\n\t */\n\tpublic getLinesViewportData(verticalOffset1: number, verticalOffset2: number): IPartialViewLinesViewportData {\n\t\tthis._checkPendingChanges();\n\t\tverticalOffset1 = verticalOffset1 | 0;\n\t\tverticalOffset2 = verticalOffset2 | 0;\n\t\tconst lineHeight = this._lineHeight;\n\n\t\t// Find first line number\n\t\t// We don't live in a perfect world, so the line number might start before or after verticalOffset1\n\t\tconst startLineNumber = this.getLineNumberAtOrAfterVerticalOffset(verticalOffset1) | 0;\n\t\tconst startLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(startLineNumber) | 0;\n\n\t\tlet endLineNumber = this._lineCount | 0;\n\n\t\t// Also keep track of what whitespace we've got\n\t\tlet whitespaceIndex = this.getFirstWhitespaceIndexAfterLineNumber(startLineNumber) | 0;\n\t\tconst whitespaceCount = this.getWhitespacesCount() | 0;\n\t\tlet currentWhitespaceHeight: number;\n\t\tlet currentWhitespaceAfterLineNumber: number;\n\n\t\tif (whitespaceIndex === -1) {\n\t\t\twhitespaceIndex = whitespaceCount;\n\t\t\tcurrentWhitespaceAfterLineNumber = endLineNumber + 1;\n\t\t\tcurrentWhitespaceHeight = 0;\n\t\t} else {\n\t\t\tcurrentWhitespaceAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t\tcurrentWhitespaceHeight = this.getHeightForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t}\n\n\t\tlet currentVerticalOffset = startLineNumberVerticalOffset;\n\t\tlet currentLineRelativeOffset = currentVerticalOffset;\n\n\t\t// IE (all versions) cannot handle units above about 1,533,908 px, so every 500k pixels bring numbers down\n\t\tconst STEP_SIZE = 500000;\n\t\tlet bigNumbersDelta = 0;\n\t\tif (startLineNumberVerticalOffset >= STEP_SIZE) {\n\t\t\t// Compute a delta that guarantees that lines are positioned at `lineHeight` increments\n\t\t\tbigNumbersDelta = Math.floor(startLineNumberVerticalOffset / STEP_SIZE) * STEP_SIZE;\n\t\t\tbigNumbersDelta = Math.floor(bigNumbersDelta / lineHeight) * lineHeight;\n\n\t\t\tcurrentLineRelativeOffset -= bigNumbersDelta;\n\t\t}\n\n\t\tconst linesOffsets: number[] = [];\n\n\t\tconst verticalCenter = verticalOffset1 + (verticalOffset2 - verticalOffset1) / 2;\n\t\tlet centeredLineNumber = -1;\n\n\t\t// Figure out how far the lines go\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\n\t\t\tif (centeredLineNumber === -1) {\n\t\t\t\tconst currentLineTop = currentVerticalOffset;\n\t\t\t\tconst currentLineBottom = currentVerticalOffset + lineHeight;\n\t\t\t\tif ((currentLineTop <= verticalCenter && verticalCenter < currentLineBottom) || currentLineTop > verticalCenter) {\n\t\t\t\t\tcenteredLineNumber = lineNumber;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Count current line height in the vertical offsets\n\t\t\tcurrentVerticalOffset += lineHeight;\n\t\t\tlinesOffsets[lineNumber - startLineNumber] = currentLineRelativeOffset;\n\n\t\t\t// Next line starts immediately after this one\n\t\t\tcurrentLineRelativeOffset += lineHeight;\n\t\t\twhile (currentWhitespaceAfterLineNumber === lineNumber) {\n\t\t\t\t// Push down next line with the height of the current whitespace\n\t\t\t\tcurrentLineRelativeOffset += currentWhitespaceHeight;\n\n\t\t\t\t// Count current whitespace in the vertical offsets\n\t\t\t\tcurrentVerticalOffset += currentWhitespaceHeight;\n\t\t\t\twhitespaceIndex++;\n\n\t\t\t\tif (whitespaceIndex >= whitespaceCount) {\n\t\t\t\t\tcurrentWhitespaceAfterLineNumber = endLineNumber + 1;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentWhitespaceAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t\t\t\tcurrentWhitespaceHeight = this.getHeightForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentVerticalOffset >= verticalOffset2) {\n\t\t\t\t// We have covered the entire viewport area, time to stop\n\t\t\t\tendLineNumber = lineNumber;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (centeredLineNumber === -1) {\n\t\t\tcenteredLineNumber = endLineNumber;\n\t\t}\n\n\t\tconst endLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(endLineNumber) | 0;\n\n\t\tlet completelyVisibleStartLineNumber = startLineNumber;\n\t\tlet completelyVisibleEndLineNumber = endLineNumber;\n\n\t\tif (completelyVisibleStartLineNumber < completelyVisibleEndLineNumber) {\n\t\t\tif (startLineNumberVerticalOffset < verticalOffset1) {\n\t\t\t\tcompletelyVisibleStartLineNumber++;\n\t\t\t}\n\t\t}\n\t\tif (completelyVisibleStartLineNumber < completelyVisibleEndLineNumber) {\n\t\t\tif (endLineNumberVerticalOffset + lineHeight > verticalOffset2) {\n\t\t\t\tcompletelyVisibleEndLineNumber--;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tbigNumbersDelta: bigNumbersDelta,\n\t\t\tstartLineNumber: startLineNumber,\n\t\t\tendLineNumber: endLineNumber,\n\t\t\trelativeVerticalOffset: linesOffsets,\n\t\t\tcenteredLineNumber: centeredLineNumber,\n\t\t\tcompletelyVisibleStartLineNumber: completelyVisibleStartLineNumber,\n\t\t\tcompletelyVisibleEndLineNumber: completelyVisibleEndLineNumber\n\t\t};\n\t}\n\n\tpublic getVerticalOffsetForWhitespaceIndex(whitespaceIndex: number): number {\n\t\tthis._checkPendingChanges();\n\t\twhitespaceIndex = whitespaceIndex | 0;\n\n\t\tconst afterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex);\n\n\t\tlet previousLinesHeight: number;\n\t\tif (afterLineNumber >= 1) {\n\t\t\tpreviousLinesHeight = this._lineHeight * afterLineNumber;\n\t\t} else {\n\t\t\tpreviousLinesHeight = 0;\n\t\t}\n\n\t\tlet previousWhitespacesHeight: number;\n\t\tif (whitespaceIndex > 0) {\n\t\t\tpreviousWhitespacesHeight = this.getWhitespacesAccumulatedHeight(whitespaceIndex - 1);\n\t\t} else {\n\t\t\tpreviousWhitespacesHeight = 0;\n\t\t}\n\t\treturn previousLinesHeight + previousWhitespacesHeight + this._paddingTop;\n\t}\n\n\tpublic getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset: number): number {\n\t\tthis._checkPendingChanges();\n\t\tverticalOffset = verticalOffset | 0;\n\n\t\tlet minWhitespaceIndex = 0;\n\t\tlet maxWhitespaceIndex = this.getWhitespacesCount() - 1;\n\n\t\tif (maxWhitespaceIndex < 0) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t// Special case: nothing to be found\n\t\tconst maxWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(maxWhitespaceIndex);\n\t\tconst maxWhitespaceHeight = this.getHeightForWhitespaceIndex(maxWhitespaceIndex);\n\t\tif (verticalOffset >= maxWhitespaceVerticalOffset + maxWhitespaceHeight) {\n\t\t\treturn -1;\n\t\t}\n\n\t\twhile (minWhitespaceIndex < maxWhitespaceIndex) {\n\t\t\tconst midWhitespaceIndex = Math.floor((minWhitespaceIndex + maxWhitespaceIndex) / 2);\n\n\t\t\tconst midWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(midWhitespaceIndex);\n\t\t\tconst midWhitespaceHeight = this.getHeightForWhitespaceIndex(midWhitespaceIndex);\n\n\t\t\tif (verticalOffset >= midWhitespaceVerticalOffset + midWhitespaceHeight) {\n\t\t\t\t// vertical offset is after whitespace\n\t\t\t\tminWhitespaceIndex = midWhitespaceIndex + 1;\n\t\t\t} else if (verticalOffset >= midWhitespaceVerticalOffset) {\n\t\t\t\t// Hit\n\t\t\t\treturn midWhitespaceIndex;\n\t\t\t} else {\n\t\t\t\t// vertical offset is before whitespace, but midWhitespaceIndex might still be what we're searching for\n\t\t\t\tmaxWhitespaceIndex = midWhitespaceIndex;\n\t\t\t}\n\t\t}\n\t\treturn minWhitespaceIndex;\n\t}\n\n\t/**\n\t * Get exactly the whitespace that is layouted at `verticalOffset`.\n\t *\n\t * @param verticalOffset The vertical offset.\n\t * @return Precisely the whitespace that is layouted at `verticaloffset` or null.\n\t */\n\tpublic getWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null {\n\t\tthis._checkPendingChanges();\n\t\tverticalOffset = verticalOffset | 0;\n\n\t\tconst candidateIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset);\n\n\t\tif (candidateIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (candidateIndex >= this.getWhitespacesCount()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst candidateTop = this.getVerticalOffsetForWhitespaceIndex(candidateIndex);\n\n\t\tif (candidateTop > verticalOffset) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst candidateHeight = this.getHeightForWhitespaceIndex(candidateIndex);\n\t\tconst candidateId = this.getIdForWhitespaceIndex(candidateIndex);\n\t\tconst candidateAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(candidateIndex);\n\n\t\treturn {\n\t\t\tid: candidateId,\n\t\t\tafterLineNumber: candidateAfterLineNumber,\n\t\t\tverticalOffset: candidateTop,\n\t\t\theight: candidateHeight\n\t\t};\n\t}\n\n\t/**\n\t * Get a list of whitespaces that are positioned between `verticalOffset1` and `verticalOffset2`.\n\t *\n\t * @param verticalOffset1 The beginning of the viewport.\n\t * @param verticalOffset2 The end of the viewport.\n\t * @return An array with all the whitespaces in the viewport. If no whitespace is in viewport, the array is empty.\n\t */\n\tpublic getWhitespaceViewportData(verticalOffset1: number, verticalOffset2: number): IViewWhitespaceViewportData[] {\n\t\tthis._checkPendingChanges();\n\t\tverticalOffset1 = verticalOffset1 | 0;\n\t\tverticalOffset2 = verticalOffset2 | 0;\n\n\t\tconst startIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset1);\n\t\tconst endIndex = this.getWhitespacesCount() - 1;\n\n\t\tif (startIndex < 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst result: IViewWhitespaceViewportData[] = [];\n\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\tconst top = this.getVerticalOffsetForWhitespaceIndex(i);\n\t\t\tconst height = this.getHeightForWhitespaceIndex(i);\n\t\t\tif (top >= verticalOffset2) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\tid: this.getIdForWhitespaceIndex(i),\n\t\t\t\tafterLineNumber: this.getAfterLineNumberForWhitespaceIndex(i),\n\t\t\t\tverticalOffset: top,\n\t\t\t\theight: height\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get all whitespaces.\n\t */\n\tpublic getWhitespaces(): IEditorWhitespace[] {\n\t\tthis._checkPendingChanges();\n\t\treturn this._arr.slice(0);\n\t}\n\n\t/**\n\t * The number of whitespaces.\n\t */\n\tpublic getWhitespacesCount(): number {\n\t\tthis._checkPendingChanges();\n\t\treturn this._arr.length;\n\t}\n\n\t/**\n\t * Get the `id` for whitespace at index `index`.\n\t *\n\t * @param index The index of the whitespace.\n\t * @return `id` of whitespace at `index`.\n\t */\n\tpublic getIdForWhitespaceIndex(index: number): string {\n\t\tthis._checkPendingChanges();\n\t\tindex = index | 0;\n\n\t\treturn this._arr[index].id;\n\t}\n\n\t/**\n\t * Get the `afterLineNumber` for whitespace at index `index`.\n\t *\n\t * @param index The index of the whitespace.\n\t * @return `afterLineNumber` of whitespace at `index`.\n\t */\n\tpublic getAfterLineNumberForWhitespaceIndex(index: number): number {\n\t\tthis._checkPendingChanges();\n\t\tindex = index | 0;\n\n\t\treturn this._arr[index].afterLineNumber;\n\t}\n\n\t/**\n\t * Get the `height` for whitespace at index `index`.\n\t *\n\t * @param index The index of the whitespace.\n\t * @return `height` of whitespace at `index`.\n\t */\n\tpublic getHeightForWhitespaceIndex(index: number): number {\n\t\tthis._checkPendingChanges();\n\t\tindex = index | 0;\n\n\t\treturn this._arr[index].height;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { IStringBuilder, createStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport { LineDecoration, LineDecorationsNormalizer } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { InlineDecorationType } from 'vs/editor/common/viewModel';\n\nexport const enum RenderWhitespace {\n\tNone = 0,\n\tBoundary = 1,\n\tSelection = 2,\n\tTrailing = 3,\n\tAll = 4\n}\n\nexport const enum LinePartMetadata {\n\tIS_WHITESPACE = 1,\n\tPSEUDO_BEFORE = 2,\n\tPSEUDO_AFTER = 4,\n\n\tIS_WHITESPACE_MASK = 0b001,\n\tPSEUDO_BEFORE_MASK = 0b010,\n\tPSEUDO_AFTER_MASK = 0b100,\n}\n\nclass LinePart {\n\t_linePartBrand: void = undefined;\n\n\t/**\n\t * last char index of this token (not inclusive).\n\t */\n\tpublic readonly endIndex: number;\n\tpublic readonly type: string;\n\tpublic readonly metadata: number;\n\n\tconstructor(endIndex: number, type: string, metadata: number) {\n\t\tthis.endIndex = endIndex;\n\t\tthis.type = type;\n\t\tthis.metadata = metadata;\n\t}\n\n\tpublic isWhitespace(): boolean {\n\t\treturn (this.metadata & LinePartMetadata.IS_WHITESPACE_MASK ? true : false);\n\t}\n\n\tpublic isPseudoAfter(): boolean {\n\t\treturn (this.metadata & LinePartMetadata.PSEUDO_AFTER_MASK ? true : false);\n\t}\n}\n\nexport class LineRange {\n\t/**\n\t * Zero-based offset on which the range starts, inclusive.\n\t */\n\tpublic readonly startOffset: number;\n\n\t/**\n\t * Zero-based offset on which the range ends, inclusive.\n\t */\n\tpublic readonly endOffset: number;\n\n\tconstructor(startIndex: number, endIndex: number) {\n\t\tthis.startOffset = startIndex;\n\t\tthis.endOffset = endIndex;\n\t}\n\n\tpublic equals(otherLineRange: LineRange) {\n\t\treturn this.startOffset === otherLineRange.startOffset\n\t\t\t&& this.endOffset === otherLineRange.endOffset;\n\t}\n}\n\nexport class RenderLineInput {\n\n\tpublic readonly useMonospaceOptimizations: boolean;\n\tpublic readonly canUseHalfwidthRightwardsArrow: boolean;\n\tpublic readonly lineContent: string;\n\tpublic readonly continuesWithWrappedLine: boolean;\n\tpublic readonly isBasicASCII: boolean;\n\tpublic readonly containsRTL: boolean;\n\tpublic readonly fauxIndentLength: number;\n\tpublic readonly lineTokens: IViewLineTokens;\n\tpublic readonly lineDecorations: LineDecoration[];\n\tpublic readonly tabSize: number;\n\tpublic readonly startVisibleColumn: number;\n\tpublic readonly spaceWidth: number;\n\tpublic readonly renderSpaceWidth: number;\n\tpublic readonly renderSpaceCharCode: number;\n\tpublic readonly stopRenderingLineAfter: number;\n\tpublic readonly renderWhitespace: RenderWhitespace;\n\tpublic readonly renderControlCharacters: boolean;\n\tpublic readonly fontLigatures: boolean;\n\n\t/**\n\t * Defined only when renderWhitespace is 'selection'. Selections are non-overlapping,\n\t * and ordered by position within the line.\n\t */\n\tpublic readonly selectionsOnLine: LineRange[] | null;\n\n\tconstructor(\n\t\tuseMonospaceOptimizations: boolean,\n\t\tcanUseHalfwidthRightwardsArrow: boolean,\n\t\tlineContent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tisBasicASCII: boolean,\n\t\tcontainsRTL: boolean,\n\t\tfauxIndentLength: number,\n\t\tlineTokens: IViewLineTokens,\n\t\tlineDecorations: LineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t\tspaceWidth: number,\n\t\tmiddotWidth: number,\n\t\twsmiddotWidth: number,\n\t\tstopRenderingLineAfter: number,\n\t\trenderWhitespace: 'none' | 'boundary' | 'selection' | 'trailing' | 'all',\n\t\trenderControlCharacters: boolean,\n\t\tfontLigatures: boolean,\n\t\tselectionsOnLine: LineRange[] | null\n\t) {\n\t\tthis.useMonospaceOptimizations = useMonospaceOptimizations;\n\t\tthis.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow;\n\t\tthis.lineContent = lineContent;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.isBasicASCII = isBasicASCII;\n\t\tthis.containsRTL = containsRTL;\n\t\tthis.fauxIndentLength = fauxIndentLength;\n\t\tthis.lineTokens = lineTokens;\n\t\tthis.lineDecorations = lineDecorations.sort(LineDecoration.compare);\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.spaceWidth = spaceWidth;\n\t\tthis.stopRenderingLineAfter = stopRenderingLineAfter;\n\t\tthis.renderWhitespace = (\n\t\t\trenderWhitespace === 'all'\n\t\t\t\t? RenderWhitespace.All\n\t\t\t\t: renderWhitespace === 'boundary'\n\t\t\t\t\t? RenderWhitespace.Boundary\n\t\t\t\t\t: renderWhitespace === 'selection'\n\t\t\t\t\t\t? RenderWhitespace.Selection\n\t\t\t\t\t\t: renderWhitespace === 'trailing'\n\t\t\t\t\t\t\t? RenderWhitespace.Trailing\n\t\t\t\t\t\t\t: RenderWhitespace.None\n\t\t);\n\t\tthis.renderControlCharacters = renderControlCharacters;\n\t\tthis.fontLigatures = fontLigatures;\n\t\tthis.selectionsOnLine = selectionsOnLine && selectionsOnLine.sort((a, b) => a.startOffset < b.startOffset ? -1 : 1);\n\n\t\tconst wsmiddotDiff = Math.abs(wsmiddotWidth - spaceWidth);\n\t\tconst middotDiff = Math.abs(middotWidth - spaceWidth);\n\t\tif (wsmiddotDiff < middotDiff) {\n\t\t\tthis.renderSpaceWidth = wsmiddotWidth;\n\t\t\tthis.renderSpaceCharCode = 0x2E31; // U+2E31 - WORD SEPARATOR MIDDLE DOT\n\t\t} else {\n\t\t\tthis.renderSpaceWidth = middotWidth;\n\t\t\tthis.renderSpaceCharCode = 0xB7; // U+00B7 - MIDDLE DOT\n\t\t}\n\t}\n\n\tprivate sameSelection(otherSelections: LineRange[] | null): boolean {\n\t\tif (this.selectionsOnLine === null) {\n\t\t\treturn otherSelections === null;\n\t\t}\n\n\t\tif (otherSelections === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (otherSelections.length !== this.selectionsOnLine.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0; i < this.selectionsOnLine.length; i++) {\n\t\t\tif (!this.selectionsOnLine[i].equals(otherSelections[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic equals(other: RenderLineInput): boolean {\n\t\treturn (\n\t\t\tthis.useMonospaceOptimizations === other.useMonospaceOptimizations\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.lineContent === other.lineContent\n\t\t\t&& this.continuesWithWrappedLine === other.continuesWithWrappedLine\n\t\t\t&& this.isBasicASCII === other.isBasicASCII\n\t\t\t&& this.containsRTL === other.containsRTL\n\t\t\t&& this.fauxIndentLength === other.fauxIndentLength\n\t\t\t&& this.tabSize === other.tabSize\n\t\t\t&& this.startVisibleColumn === other.startVisibleColumn\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.renderSpaceWidth === other.renderSpaceWidth\n\t\t\t&& this.renderSpaceCharCode === other.renderSpaceCharCode\n\t\t\t&& this.stopRenderingLineAfter === other.stopRenderingLineAfter\n\t\t\t&& this.renderWhitespace === other.renderWhitespace\n\t\t\t&& this.renderControlCharacters === other.renderControlCharacters\n\t\t\t&& this.fontLigatures === other.fontLigatures\n\t\t\t&& LineDecoration.equalsArr(this.lineDecorations, other.lineDecorations)\n\t\t\t&& this.lineTokens.equals(other.lineTokens)\n\t\t\t&& this.sameSelection(other.selectionsOnLine)\n\t\t);\n\t}\n}\n\nexport const enum CharacterMappingConstants {\n\tPART_INDEX_MASK = 0b11111111111111110000000000000000,\n\tCHAR_INDEX_MASK = 0b00000000000000001111111111111111,\n\n\tCHAR_INDEX_OFFSET = 0,\n\tPART_INDEX_OFFSET = 16\n}\n\nexport class DomPosition {\n\tconstructor(\n\t\tpublic readonly partIndex: number,\n\t\tpublic readonly charIndex: number\n\t) { }\n}\n\n/**\n * Provides a both direction mapping between a line's character and its rendered position.\n */\nexport class CharacterMapping {\n\n\tprivate static getPartIndex(partData: number): number {\n\t\treturn (partData & CharacterMappingConstants.PART_INDEX_MASK) >>> CharacterMappingConstants.PART_INDEX_OFFSET;\n\t}\n\n\tprivate static getCharIndex(partData: number): number {\n\t\treturn (partData & CharacterMappingConstants.CHAR_INDEX_MASK) >>> CharacterMappingConstants.CHAR_INDEX_OFFSET;\n\t}\n\n\tpublic readonly length: number;\n\tprivate readonly _data: Uint32Array;\n\tprivate readonly _absoluteOffsets: Uint32Array;\n\n\tconstructor(length: number, partCount: number) {\n\t\tthis.length = length;\n\t\tthis._data = new Uint32Array(this.length);\n\t\tthis._absoluteOffsets = new Uint32Array(this.length);\n\t}\n\n\tpublic setColumnInfo(column: number, partIndex: number, charIndex: number, partAbsoluteOffset: number): void {\n\t\tconst partData = (\n\t\t\t(partIndex << CharacterMappingConstants.PART_INDEX_OFFSET)\n\t\t\t| (charIndex << CharacterMappingConstants.CHAR_INDEX_OFFSET)\n\t\t) >>> 0;\n\t\tthis._data[column - 1] = partData;\n\t\tthis._absoluteOffsets[column - 1] = partAbsoluteOffset + charIndex;\n\t}\n\n\tpublic getAbsoluteOffset(column: number): number {\n\t\tif (this._absoluteOffsets.length === 0) {\n\t\t\t// No characters on this line\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._absoluteOffsets[column - 1];\n\t}\n\n\tprivate charOffsetToPartData(charOffset: number): number {\n\t\tif (this.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (charOffset < 0) {\n\t\t\treturn this._data[0];\n\t\t}\n\t\tif (charOffset >= this.length) {\n\t\t\treturn this._data[this.length - 1];\n\t\t}\n\t\treturn this._data[charOffset];\n\t}\n\n\tpublic getDomPosition(column: number): DomPosition {\n\t\tconst partData = this.charOffsetToPartData(column - 1);\n\t\tconst partIndex = CharacterMapping.getPartIndex(partData);\n\t\tconst charIndex = CharacterMapping.getCharIndex(partData);\n\t\treturn new DomPosition(partIndex, charIndex);\n\t}\n\n\tpublic getColumn(domPosition: DomPosition, partLength: number): number {\n\t\tconst charOffset = this.partDataToCharOffset(domPosition.partIndex, partLength, domPosition.charIndex);\n\t\treturn charOffset + 1;\n\t}\n\n\tprivate partDataToCharOffset(partIndex: number, partLength: number, charIndex: number): number {\n\t\tif (this.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst searchEntry = (\n\t\t\t(partIndex << CharacterMappingConstants.PART_INDEX_OFFSET)\n\t\t\t| (charIndex << CharacterMappingConstants.CHAR_INDEX_OFFSET)\n\t\t) >>> 0;\n\n\t\tlet min = 0;\n\t\tlet max = this.length - 1;\n\t\twhile (min + 1 < max) {\n\t\t\tconst mid = ((min + max) >>> 1);\n\t\t\tconst midEntry = this._data[mid];\n\t\t\tif (midEntry === searchEntry) {\n\t\t\t\treturn mid;\n\t\t\t} else if (midEntry > searchEntry) {\n\t\t\t\tmax = mid;\n\t\t\t} else {\n\t\t\t\tmin = mid;\n\t\t\t}\n\t\t}\n\n\t\tif (min === max) {\n\t\t\treturn min;\n\t\t}\n\n\t\tconst minEntry = this._data[min];\n\t\tconst maxEntry = this._data[max];\n\n\t\tif (minEntry === searchEntry) {\n\t\t\treturn min;\n\t\t}\n\t\tif (maxEntry === searchEntry) {\n\t\t\treturn max;\n\t\t}\n\n\t\tconst minPartIndex = CharacterMapping.getPartIndex(minEntry);\n\t\tconst minCharIndex = CharacterMapping.getCharIndex(minEntry);\n\n\t\tconst maxPartIndex = CharacterMapping.getPartIndex(maxEntry);\n\t\tlet maxCharIndex: number;\n\n\t\tif (minPartIndex !== maxPartIndex) {\n\t\t\t// sitting between parts\n\t\t\tmaxCharIndex = partLength;\n\t\t} else {\n\t\t\tmaxCharIndex = CharacterMapping.getCharIndex(maxEntry);\n\t\t}\n\n\t\tconst minEntryDistance = charIndex - minCharIndex;\n\t\tconst maxEntryDistance = maxCharIndex - charIndex;\n\n\t\tif (minEntryDistance <= maxEntryDistance) {\n\t\t\treturn min;\n\t\t}\n\t\treturn max;\n\t}\n}\n\nexport const enum ForeignElementType {\n\tNone = 0,\n\tBefore = 1,\n\tAfter = 2\n}\n\nexport class RenderLineOutput {\n\t_renderLineOutputBrand: void = undefined;\n\n\treadonly characterMapping: CharacterMapping;\n\treadonly containsRTL: boolean;\n\treadonly containsForeignElements: ForeignElementType;\n\n\tconstructor(characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType) {\n\t\tthis.characterMapping = characterMapping;\n\t\tthis.containsRTL = containsRTL;\n\t\tthis.containsForeignElements = containsForeignElements;\n\t}\n}\n\nexport function renderViewLine(input: RenderLineInput, sb: IStringBuilder): RenderLineOutput {\n\tif (input.lineContent.length === 0) {\n\n\t\tif (input.lineDecorations.length > 0) {\n\t\t\t// This line is empty, but it contains inline decorations\n\t\t\tsb.appendASCIIString(`<span>`);\n\n\t\t\tlet beforeCount = 0;\n\t\t\tlet afterCount = 0;\n\t\t\tlet containsForeignElements = ForeignElementType.None;\n\t\t\tfor (const lineDecoration of input.lineDecorations) {\n\t\t\t\tif (lineDecoration.type === InlineDecorationType.Before || lineDecoration.type === InlineDecorationType.After) {\n\t\t\t\t\tsb.appendASCIIString(`<span class=\"`);\n\t\t\t\t\tsb.appendASCIIString(lineDecoration.className);\n\t\t\t\t\tsb.appendASCIIString(`\"></span>`);\n\n\t\t\t\t\tif (lineDecoration.type === InlineDecorationType.Before) {\n\t\t\t\t\t\tcontainsForeignElements |= ForeignElementType.Before;\n\t\t\t\t\t\tbeforeCount++;\n\t\t\t\t\t}\n\t\t\t\t\tif (lineDecoration.type === InlineDecorationType.After) {\n\t\t\t\t\t\tcontainsForeignElements |= ForeignElementType.After;\n\t\t\t\t\t\tafterCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsb.appendASCIIString(`</span>`);\n\n\t\t\tconst characterMapping = new CharacterMapping(1, beforeCount + afterCount);\n\t\t\tcharacterMapping.setColumnInfo(1, beforeCount, 0, 0);\n\n\t\t\treturn new RenderLineOutput(\n\t\t\t\tcharacterMapping,\n\t\t\t\tfalse,\n\t\t\t\tcontainsForeignElements\n\t\t\t);\n\t\t}\n\n\t\t// completely empty line\n\t\tsb.appendASCIIString('<span><span></span></span>');\n\t\treturn new RenderLineOutput(\n\t\t\tnew CharacterMapping(0, 0),\n\t\t\tfalse,\n\t\t\tForeignElementType.None\n\t\t);\n\t}\n\n\treturn _renderLine(resolveRenderLineInput(input), sb);\n}\n\nexport class RenderLineOutput2 {\n\tconstructor(\n\t\tpublic readonly characterMapping: CharacterMapping,\n\t\tpublic readonly html: string,\n\t\tpublic readonly containsRTL: boolean,\n\t\tpublic readonly containsForeignElements: ForeignElementType\n\t) {\n\t}\n}\n\nexport function renderViewLine2(input: RenderLineInput): RenderLineOutput2 {\n\tconst sb = createStringBuilder(10000);\n\tconst out = renderViewLine(input, sb);\n\treturn new RenderLineOutput2(out.characterMapping, sb.build(), out.containsRTL, out.containsForeignElements);\n}\n\nclass ResolvedRenderLineInput {\n\tconstructor(\n\t\tpublic readonly fontIsMonospace: boolean,\n\t\tpublic readonly canUseHalfwidthRightwardsArrow: boolean,\n\t\tpublic readonly lineContent: string,\n\t\tpublic readonly len: number,\n\t\tpublic readonly isOverflowing: boolean,\n\t\tpublic readonly parts: LinePart[],\n\t\tpublic readonly containsForeignElements: ForeignElementType,\n\t\tpublic readonly fauxIndentLength: number,\n\t\tpublic readonly tabSize: number,\n\t\tpublic readonly startVisibleColumn: number,\n\t\tpublic readonly containsRTL: boolean,\n\t\tpublic readonly spaceWidth: number,\n\t\tpublic readonly renderSpaceCharCode: number,\n\t\tpublic readonly renderWhitespace: RenderWhitespace,\n\t\tpublic readonly renderControlCharacters: boolean,\n\t) {\n\t\t//\n\t}\n}\n\nfunction resolveRenderLineInput(input: RenderLineInput): ResolvedRenderLineInput {\n\tconst lineContent = input.lineContent;\n\n\tlet isOverflowing: boolean;\n\tlet len: number;\n\n\tif (input.stopRenderingLineAfter !== -1 && input.stopRenderingLineAfter < lineContent.length) {\n\t\tisOverflowing = true;\n\t\tlen = input.stopRenderingLineAfter;\n\t} else {\n\t\tisOverflowing = false;\n\t\tlen = lineContent.length;\n\t}\n\n\tlet tokens = transformAndRemoveOverflowing(input.lineTokens, input.fauxIndentLength, len);\n\tif (input.renderControlCharacters && !input.isBasicASCII) {\n\t\t// Calling `extractControlCharacters` before adding (possibly empty) line parts\n\t\t// for inline decorations. `extractControlCharacters` removes empty line parts.\n\t\ttokens = extractControlCharacters(lineContent, tokens);\n\t}\n\tif (input.renderWhitespace === RenderWhitespace.All ||\n\t\tinput.renderWhitespace === RenderWhitespace.Boundary ||\n\t\t(input.renderWhitespace === RenderWhitespace.Selection && !!input.selectionsOnLine) ||\n\t\tinput.renderWhitespace === RenderWhitespace.Trailing) {\n\n\t\ttokens = _applyRenderWhitespace(input, lineContent, len, tokens);\n\t}\n\tlet containsForeignElements = ForeignElementType.None;\n\tif (input.lineDecorations.length > 0) {\n\t\tfor (let i = 0, len = input.lineDecorations.length; i < len; i++) {\n\t\t\tconst lineDecoration = input.lineDecorations[i];\n\t\t\tif (lineDecoration.type === InlineDecorationType.RegularAffectingLetterSpacing) {\n\t\t\t\t// Pretend there are foreign elements... although not 100% accurate.\n\t\t\t\tcontainsForeignElements |= ForeignElementType.Before;\n\t\t\t} else if (lineDecoration.type === InlineDecorationType.Before) {\n\t\t\t\tcontainsForeignElements |= ForeignElementType.Before;\n\t\t\t} else if (lineDecoration.type === InlineDecorationType.After) {\n\t\t\t\tcontainsForeignElements |= ForeignElementType.After;\n\t\t\t}\n\t\t}\n\t\ttokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations);\n\t}\n\tif (!input.containsRTL) {\n\t\t// We can never split RTL text, as it ruins the rendering\n\t\ttokens = splitLargeTokens(lineContent, tokens, !input.isBasicASCII || input.fontLigatures);\n\t}\n\n\treturn new ResolvedRenderLineInput(\n\t\tinput.useMonospaceOptimizations,\n\t\tinput.canUseHalfwidthRightwardsArrow,\n\t\tlineContent,\n\t\tlen,\n\t\tisOverflowing,\n\t\ttokens,\n\t\tcontainsForeignElements,\n\t\tinput.fauxIndentLength,\n\t\tinput.tabSize,\n\t\tinput.startVisibleColumn,\n\t\tinput.containsRTL,\n\t\tinput.spaceWidth,\n\t\tinput.renderSpaceCharCode,\n\t\tinput.renderWhitespace,\n\t\tinput.renderControlCharacters\n\t);\n}\n\n/**\n * In the rendering phase, characters are always looped until token.endIndex.\n * Ensure that all tokens end before `len` and the last one ends precisely at `len`.\n */\nfunction transformAndRemoveOverflowing(tokens: IViewLineTokens, fauxIndentLength: number, len: number): LinePart[] {\n\tconst result: LinePart[] = [];\n\tlet resultLen = 0;\n\n\t// The faux indent part of the line should have no token type\n\tif (fauxIndentLength > 0) {\n\t\tresult[resultLen++] = new LinePart(fauxIndentLength, '', 0);\n\t}\n\n\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\tconst endIndex = tokens.getEndOffset(tokenIndex);\n\t\tif (endIndex <= fauxIndentLength) {\n\t\t\t// The faux indent part of the line should have no token type\n\t\t\tcontinue;\n\t\t}\n\t\tconst type = tokens.getClassName(tokenIndex);\n\t\tif (endIndex >= len) {\n\t\t\tresult[resultLen++] = new LinePart(len, type, 0);\n\t\t\tbreak;\n\t\t}\n\t\tresult[resultLen++] = new LinePart(endIndex, type, 0);\n\t}\n\n\treturn result;\n}\n\n/**\n * written as a const enum to get value inlining.\n */\nconst enum Constants {\n\tLongToken = 50\n}\n\n/**\n * See https://github.com/microsoft/vscode/issues/6885.\n * It appears that having very large spans causes very slow reading of character positions.\n * So here we try to avoid that.\n */\nfunction splitLargeTokens(lineContent: string, tokens: LinePart[], onlyAtSpaces: boolean): LinePart[] {\n\tlet lastTokenEndIndex = 0;\n\tconst result: LinePart[] = [];\n\tlet resultLen = 0;\n\n\tif (onlyAtSpaces) {\n\t\t// Split only at spaces => we need to walk each character\n\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\tconst token = tokens[i];\n\t\t\tconst tokenEndIndex = token.endIndex;\n\t\t\tif (lastTokenEndIndex + Constants.LongToken < tokenEndIndex) {\n\t\t\t\tconst tokenType = token.type;\n\t\t\t\tconst tokenMetadata = token.metadata;\n\n\t\t\t\tlet lastSpaceOffset = -1;\n\t\t\t\tlet currTokenStart = lastTokenEndIndex;\n\t\t\t\tfor (let j = lastTokenEndIndex; j < tokenEndIndex; j++) {\n\t\t\t\t\tif (lineContent.charCodeAt(j) === CharCode.Space) {\n\t\t\t\t\t\tlastSpaceOffset = j;\n\t\t\t\t\t}\n\t\t\t\t\tif (lastSpaceOffset !== -1 && j - currTokenStart >= Constants.LongToken) {\n\t\t\t\t\t\t// Split at `lastSpaceOffset` + 1\n\t\t\t\t\t\tresult[resultLen++] = new LinePart(lastSpaceOffset + 1, tokenType, tokenMetadata);\n\t\t\t\t\t\tcurrTokenStart = lastSpaceOffset + 1;\n\t\t\t\t\t\tlastSpaceOffset = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (currTokenStart !== tokenEndIndex) {\n\t\t\t\t\tresult[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = token;\n\t\t\t}\n\n\t\t\tlastTokenEndIndex = tokenEndIndex;\n\t\t}\n\t} else {\n\t\t// Split anywhere => we don't need to walk each character\n\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\tconst token = tokens[i];\n\t\t\tconst tokenEndIndex = token.endIndex;\n\t\t\tconst diff = (tokenEndIndex - lastTokenEndIndex);\n\t\t\tif (diff > Constants.LongToken) {\n\t\t\t\tconst tokenType = token.type;\n\t\t\t\tconst tokenMetadata = token.metadata;\n\t\t\t\tconst piecesCount = Math.ceil(diff / Constants.LongToken);\n\t\t\t\tfor (let j = 1; j < piecesCount; j++) {\n\t\t\t\t\tconst pieceEndIndex = lastTokenEndIndex + (j * Constants.LongToken);\n\t\t\t\t\tresult[resultLen++] = new LinePart(pieceEndIndex, tokenType, tokenMetadata);\n\t\t\t\t}\n\t\t\t\tresult[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata);\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = token;\n\t\t\t}\n\t\t\tlastTokenEndIndex = tokenEndIndex;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction isControlCharacter(charCode: number): boolean {\n\tif (charCode < 32) {\n\t\treturn (charCode !== CharCode.Tab);\n\t}\n\tif (charCode === 127) {\n\t\t// DEL\n\t\treturn true;\n\t}\n\n\tif (\n\t\t(charCode >= 0x202A && charCode <= 0x202E)\n\t\t|| (charCode >= 0x2066 && charCode <= 0x2069)\n\t\t|| (charCode >= 0x200E && charCode <= 0x200F)\n\t\t|| charCode === 0x061C\n\t) {\n\t\t// Unicode Directional Formatting Characters\n\t\t// LRE\tU+202A\tLEFT-TO-RIGHT EMBEDDING\n\t\t// RLE\tU+202B\tRIGHT-TO-LEFT EMBEDDING\n\t\t// PDF\tU+202C\tPOP DIRECTIONAL FORMATTING\n\t\t// LRO\tU+202D\tLEFT-TO-RIGHT OVERRIDE\n\t\t// RLO\tU+202E\tRIGHT-TO-LEFT OVERRIDE\n\t\t// LRI\tU+2066\tLEFT-TO-RIGHT ISOLATE\n\t\t// RLI\tU+2067\tRIGHT-TO-LEFT ISOLATE\n\t\t// FSI\tU+2068\tFIRST STRONG ISOLATE\n\t\t// PDI\tU+2069\tPOP DIRECTIONAL ISOLATE\n\t\t// LRM\tU+200E\tLEFT-TO-RIGHT MARK\n\t\t// RLM\tU+200F\tRIGHT-TO-LEFT MARK\n\t\t// ALM\tU+061C\tARABIC LETTER MARK\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction extractControlCharacters(lineContent: string, tokens: LinePart[]): LinePart[] {\n\tconst result: LinePart[] = [];\n\tlet lastLinePart: LinePart = new LinePart(0, '', 0);\n\tlet charOffset = 0;\n\tfor (const token of tokens) {\n\t\tconst tokenEndIndex = token.endIndex;\n\t\tfor (; charOffset < tokenEndIndex; charOffset++) {\n\t\t\tconst charCode = lineContent.charCodeAt(charOffset);\n\t\t\tif (isControlCharacter(charCode)) {\n\t\t\t\tif (charOffset > lastLinePart.endIndex) {\n\t\t\t\t\t// emit previous part if it has text\n\t\t\t\t\tlastLinePart = new LinePart(charOffset, token.type, token.metadata);\n\t\t\t\t\tresult.push(lastLinePart);\n\t\t\t\t}\n\t\t\t\tlastLinePart = new LinePart(charOffset + 1, 'mtkcontrol', token.metadata);\n\t\t\t\tresult.push(lastLinePart);\n\t\t\t}\n\t\t}\n\t\tif (charOffset > lastLinePart.endIndex) {\n\t\t\t// emit previous part if it has text\n\t\t\tlastLinePart = new LinePart(tokenEndIndex, token.type, token.metadata);\n\t\t\tresult.push(lastLinePart);\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Whitespace is rendered by \"replacing\" tokens with a special-purpose `mtkw` type that is later recognized in the rendering phase.\n * Moreover, a token is created for every visual indent because on some fonts the glyphs used for rendering whitespace (→ or ·) do not have the same width as .\n * The rendering phase will generate `style=\"width:...\"` for these tokens.\n */\nfunction _applyRenderWhitespace(input: RenderLineInput, lineContent: string, len: number, tokens: LinePart[]): LinePart[] {\n\n\tconst continuesWithWrappedLine = input.continuesWithWrappedLine;\n\tconst fauxIndentLength = input.fauxIndentLength;\n\tconst tabSize = input.tabSize;\n\tconst startVisibleColumn = input.startVisibleColumn;\n\tconst useMonospaceOptimizations = input.useMonospaceOptimizations;\n\tconst selections = input.selectionsOnLine;\n\tconst onlyBoundary = (input.renderWhitespace === RenderWhitespace.Boundary);\n\tconst onlyTrailing = (input.renderWhitespace === RenderWhitespace.Trailing);\n\tconst generateLinePartForEachWhitespace = (input.renderSpaceWidth !== input.spaceWidth);\n\n\tconst result: LinePart[] = [];\n\tlet resultLen = 0;\n\tlet tokenIndex = 0;\n\tlet tokenType = tokens[tokenIndex].type;\n\tlet tokenEndIndex = tokens[tokenIndex].endIndex;\n\tconst tokensLength = tokens.length;\n\n\tlet lineIsEmptyOrWhitespace = false;\n\tlet firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\tlet lastNonWhitespaceIndex: number;\n\tif (firstNonWhitespaceIndex === -1) {\n\t\tlineIsEmptyOrWhitespace = true;\n\t\tfirstNonWhitespaceIndex = len;\n\t\tlastNonWhitespaceIndex = len;\n\t} else {\n\t\tlastNonWhitespaceIndex = strings.lastNonWhitespaceIndex(lineContent);\n\t}\n\n\tlet wasInWhitespace = false;\n\tlet currentSelectionIndex = 0;\n\tlet currentSelection = selections && selections[currentSelectionIndex];\n\tlet tmpIndent = startVisibleColumn % tabSize;\n\tfor (let charIndex = fauxIndentLength; charIndex < len; charIndex++) {\n\t\tconst chCode = lineContent.charCodeAt(charIndex);\n\n\t\tif (currentSelection && charIndex >= currentSelection.endOffset) {\n\t\t\tcurrentSelectionIndex++;\n\t\t\tcurrentSelection = selections && selections[currentSelectionIndex];\n\t\t}\n\n\t\tlet isInWhitespace: boolean;\n\t\tif (charIndex < firstNonWhitespaceIndex || charIndex > lastNonWhitespaceIndex) {\n\t\t\t// in leading or trailing whitespace\n\t\t\tisInWhitespace = true;\n\t\t} else if (chCode === CharCode.Tab) {\n\t\t\t// a tab character is rendered both in all and boundary cases\n\t\t\tisInWhitespace = true;\n\t\t} else if (chCode === CharCode.Space) {\n\t\t\t// hit a space character\n\t\t\tif (onlyBoundary) {\n\t\t\t\t// rendering only boundary whitespace\n\t\t\t\tif (wasInWhitespace) {\n\t\t\t\t\tisInWhitespace = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst nextChCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : CharCode.Null);\n\t\t\t\t\tisInWhitespace = (nextChCode === CharCode.Space || nextChCode === CharCode.Tab);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisInWhitespace = true;\n\t\t\t}\n\t\t} else {\n\t\t\tisInWhitespace = false;\n\t\t}\n\n\t\t// If rendering whitespace on selection, check that the charIndex falls within a selection\n\t\tif (isInWhitespace && selections) {\n\t\t\tisInWhitespace = !!currentSelection && currentSelection.startOffset <= charIndex && currentSelection.endOffset > charIndex;\n\t\t}\n\n\t\t// If rendering only trailing whitespace, check that the charIndex points to trailing whitespace.\n\t\tif (isInWhitespace && onlyTrailing) {\n\t\t\tisInWhitespace = lineIsEmptyOrWhitespace || charIndex > lastNonWhitespaceIndex;\n\t\t}\n\n\t\tif (wasInWhitespace) {\n\t\t\t// was in whitespace token\n\t\t\tif (!isInWhitespace || (!useMonospaceOptimizations && tmpIndent >= tabSize)) {\n\t\t\t\t// leaving whitespace token or entering a new indent\n\t\t\t\tif (generateLinePartForEachWhitespace) {\n\t\t\t\t\tconst lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength);\n\t\t\t\t\tfor (let i = lastEndIndex + 1; i <= charIndex; i++) {\n\t\t\t\t\t\tresult[resultLen++] = new LinePart(i, 'mtkw', LinePartMetadata.IS_WHITESPACE);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult[resultLen++] = new LinePart(charIndex, 'mtkw', LinePartMetadata.IS_WHITESPACE);\n\t\t\t\t}\n\t\t\t\ttmpIndent = tmpIndent % tabSize;\n\t\t\t}\n\t\t} else {\n\t\t\t// was in regular token\n\t\t\tif (charIndex === tokenEndIndex || (isInWhitespace && charIndex > fauxIndentLength)) {\n\t\t\t\tresult[resultLen++] = new LinePart(charIndex, tokenType, 0);\n\t\t\t\ttmpIndent = tmpIndent % tabSize;\n\t\t\t}\n\t\t}\n\n\t\tif (chCode === CharCode.Tab) {\n\t\t\ttmpIndent = tabSize;\n\t\t} else if (strings.isFullWidthCharacter(chCode)) {\n\t\t\ttmpIndent += 2;\n\t\t} else {\n\t\t\ttmpIndent++;\n\t\t}\n\n\t\twasInWhitespace = isInWhitespace;\n\n\t\twhile (charIndex === tokenEndIndex) {\n\t\t\ttokenIndex++;\n\t\t\tif (tokenIndex < tokensLength) {\n\t\t\t\ttokenType = tokens[tokenIndex].type;\n\t\t\t\ttokenEndIndex = tokens[tokenIndex].endIndex;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tlet generateWhitespace = false;\n\tif (wasInWhitespace) {\n\t\t// was in whitespace token\n\t\tif (continuesWithWrappedLine && onlyBoundary) {\n\t\t\tconst lastCharCode = (len > 0 ? lineContent.charCodeAt(len - 1) : CharCode.Null);\n\t\t\tconst prevCharCode = (len > 1 ? lineContent.charCodeAt(len - 2) : CharCode.Null);\n\t\t\tconst isSingleTrailingSpace = (lastCharCode === CharCode.Space && (prevCharCode !== CharCode.Space && prevCharCode !== CharCode.Tab));\n\t\t\tif (!isSingleTrailingSpace) {\n\t\t\t\tgenerateWhitespace = true;\n\t\t\t}\n\t\t} else {\n\t\t\tgenerateWhitespace = true;\n\t\t}\n\t}\n\n\tif (generateWhitespace) {\n\t\tif (generateLinePartForEachWhitespace) {\n\t\t\tconst lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength);\n\t\t\tfor (let i = lastEndIndex + 1; i <= len; i++) {\n\t\t\t\tresult[resultLen++] = new LinePart(i, 'mtkw', LinePartMetadata.IS_WHITESPACE);\n\t\t\t}\n\t\t} else {\n\t\t\tresult[resultLen++] = new LinePart(len, 'mtkw', LinePartMetadata.IS_WHITESPACE);\n\t\t}\n\t} else {\n\t\tresult[resultLen++] = new LinePart(len, tokenType, 0);\n\t}\n\n\treturn result;\n}\n\n/**\n * Inline decorations are \"merged\" on top of tokens.\n * Special care must be taken when multiple inline decorations are at play and they overlap.\n */\nfunction _applyInlineDecorations(lineContent: string, len: number, tokens: LinePart[], _lineDecorations: LineDecoration[]): LinePart[] {\n\t_lineDecorations.sort(LineDecoration.compare);\n\tconst lineDecorations = LineDecorationsNormalizer.normalize(lineContent, _lineDecorations);\n\tconst lineDecorationsLen = lineDecorations.length;\n\n\tlet lineDecorationIndex = 0;\n\tconst result: LinePart[] = [];\n\tlet resultLen = 0;\n\tlet lastResultEndIndex = 0;\n\tfor (let tokenIndex = 0, len = tokens.length; tokenIndex < len; tokenIndex++) {\n\t\tconst token = tokens[tokenIndex];\n\t\tconst tokenEndIndex = token.endIndex;\n\t\tconst tokenType = token.type;\n\t\tconst tokenMetadata = token.metadata;\n\n\t\twhile (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) {\n\t\t\tconst lineDecoration = lineDecorations[lineDecorationIndex];\n\n\t\t\tif (lineDecoration.startOffset > lastResultEndIndex) {\n\t\t\t\tlastResultEndIndex = lineDecoration.startOffset;\n\t\t\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata);\n\t\t\t}\n\n\t\t\tif (lineDecoration.endOffset + 1 <= tokenEndIndex) {\n\t\t\t\t// This line decoration ends before this token ends\n\t\t\t\tlastResultEndIndex = lineDecoration.endOffset + 1;\n\t\t\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata);\n\t\t\t\tlineDecorationIndex++;\n\t\t\t} else {\n\t\t\t\t// This line decoration continues on to the next token\n\t\t\t\tlastResultEndIndex = tokenEndIndex;\n\t\t\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (tokenEndIndex > lastResultEndIndex) {\n\t\t\tlastResultEndIndex = tokenEndIndex;\n\t\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata);\n\t\t}\n\t}\n\n\tconst lastTokenEndIndex = tokens[tokens.length - 1].endIndex;\n\tif (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n\t\twhile (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n\t\t\tconst lineDecoration = lineDecorations[lineDecorationIndex];\n\t\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, lineDecoration.className, lineDecoration.metadata);\n\t\t\tlineDecorationIndex++;\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * This function is on purpose not split up into multiple functions to allow runtime type inference (i.e. performance reasons).\n * Notice how all the needed data is fully resolved and passed in (i.e. no other calls).\n */\nfunction _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): RenderLineOutput {\n\tconst fontIsMonospace = input.fontIsMonospace;\n\tconst canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\n\tconst containsForeignElements = input.containsForeignElements;\n\tconst lineContent = input.lineContent;\n\tconst len = input.len;\n\tconst isOverflowing = input.isOverflowing;\n\tconst parts = input.parts;\n\tconst fauxIndentLength = input.fauxIndentLength;\n\tconst tabSize = input.tabSize;\n\tconst startVisibleColumn = input.startVisibleColumn;\n\tconst containsRTL = input.containsRTL;\n\tconst spaceWidth = input.spaceWidth;\n\tconst renderSpaceCharCode = input.renderSpaceCharCode;\n\tconst renderWhitespace = input.renderWhitespace;\n\tconst renderControlCharacters = input.renderControlCharacters;\n\n\tconst characterMapping = new CharacterMapping(len + 1, parts.length);\n\tlet lastCharacterMappingDefined = false;\n\n\tlet charIndex = 0;\n\tlet visibleColumn = startVisibleColumn;\n\tlet charOffsetInPart = 0;\n\n\tlet partDisplacement = 0;\n\tlet prevPartContentCnt = 0;\n\tlet partAbsoluteOffset = 0;\n\n\tif (containsRTL) {\n\t\tsb.appendASCIIString('<span dir=\"ltr\">');\n\t} else {\n\t\tsb.appendASCIIString('<span>');\n\t}\n\n\tfor (let partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\n\t\tpartAbsoluteOffset += prevPartContentCnt;\n\n\t\tconst part = parts[partIndex];\n\t\tconst partEndIndex = part.endIndex;\n\t\tconst partType = part.type;\n\t\tconst partRendersWhitespace = (renderWhitespace !== RenderWhitespace.None && part.isWhitespace());\n\t\tconst partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === 'mtkw'/*only whitespace*/ || !containsForeignElements);\n\t\tconst partIsEmptyAndHasPseudoAfter = (charIndex === partEndIndex && part.isPseudoAfter());\n\t\tcharOffsetInPart = 0;\n\n\t\tsb.appendASCIIString('<span class=\"');\n\t\tsb.appendASCIIString(partRendersWhitespaceWithWidth ? 'mtkz' : partType);\n\t\tsb.appendASCII(CharCode.DoubleQuote);\n\n\t\tif (partRendersWhitespace) {\n\n\t\t\tlet partContentCnt = 0;\n\t\t\t{\n\t\t\t\tlet _charIndex = charIndex;\n\t\t\t\tlet _visibleColumn = visibleColumn;\n\n\t\t\t\tfor (; _charIndex < partEndIndex; _charIndex++) {\n\t\t\t\t\tconst charCode = lineContent.charCodeAt(_charIndex);\n\t\t\t\t\tconst charWidth = (charCode === CharCode.Tab ? (tabSize - (_visibleColumn % tabSize)) : 1) | 0;\n\t\t\t\t\tpartContentCnt += charWidth;\n\t\t\t\t\tif (_charIndex >= fauxIndentLength) {\n\t\t\t\t\t\t_visibleColumn += charWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (partRendersWhitespaceWithWidth) {\n\t\t\t\tsb.appendASCIIString(' style=\"width:');\n\t\t\t\tsb.appendASCIIString(String(spaceWidth * partContentCnt));\n\t\t\t\tsb.appendASCIIString('px\"');\n\t\t\t}\n\t\t\tsb.appendASCII(CharCode.GreaterThan);\n\n\t\t\tfor (; charIndex < partEndIndex; charIndex++) {\n\t\t\t\tcharacterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, partAbsoluteOffset);\n\t\t\t\tpartDisplacement = 0;\n\t\t\t\tconst charCode = lineContent.charCodeAt(charIndex);\n\t\t\t\tlet charWidth: number;\n\n\t\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\t\tcharWidth = (tabSize - (visibleColumn % tabSize)) | 0;\n\n\t\t\t\t\tif (!canUseHalfwidthRightwardsArrow || charWidth > 1) {\n\t\t\t\t\t\tsb.write1(0x2192); // RIGHTWARDS ARROW\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\n\t\t\t\t\t}\n\t\t\t\t\tfor (let space = 2; space <= charWidth; space++) {\n\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t}\n\n\t\t\t\t} else { // must be CharCode.Space\n\t\t\t\t\tcharWidth = 1;\n\n\t\t\t\t\tsb.write1(renderSpaceCharCode); // · or word separator middle dot\n\t\t\t\t}\n\n\t\t\t\tcharOffsetInPart += charWidth;\n\t\t\t\tif (charIndex >= fauxIndentLength) {\n\t\t\t\t\tvisibleColumn += charWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprevPartContentCnt = partContentCnt;\n\n\t\t} else {\n\n\t\t\tlet partContentCnt = 0;\n\n\t\t\tsb.appendASCII(CharCode.GreaterThan);\n\n\t\t\tfor (; charIndex < partEndIndex; charIndex++) {\n\t\t\t\tcharacterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, partAbsoluteOffset);\n\t\t\t\tpartDisplacement = 0;\n\t\t\t\tconst charCode = lineContent.charCodeAt(charIndex);\n\n\t\t\t\tlet producedCharacters = 1;\n\t\t\t\tlet charWidth = 1;\n\n\t\t\t\tswitch (charCode) {\n\t\t\t\t\tcase CharCode.Tab:\n\t\t\t\t\t\tproducedCharacters = (tabSize - (visibleColumn % tabSize));\n\t\t\t\t\t\tcharWidth = producedCharacters;\n\t\t\t\t\t\tfor (let space = 1; space <= producedCharacters; space++) {\n\t\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.Space:\n\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.LessThan:\n\t\t\t\t\t\tsb.appendASCIIString('<');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.GreaterThan:\n\t\t\t\t\t\tsb.appendASCIIString('>');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.Ampersand:\n\t\t\t\t\t\tsb.appendASCIIString('&');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.Null:\n\t\t\t\t\t\tif (renderControlCharacters) {\n\t\t\t\t\t\t\t// See https://unicode-table.com/en/blocks/control-pictures/\n\t\t\t\t\t\t\tsb.write1(9216);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsb.appendASCIIString('�');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.UTF8_BOM:\n\t\t\t\t\tcase CharCode.LINE_SEPARATOR:\n\t\t\t\t\tcase CharCode.PARAGRAPH_SEPARATOR:\n\t\t\t\t\tcase CharCode.NEXT_LINE:\n\t\t\t\t\t\tsb.write1(0xFFFD);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (strings.isFullWidthCharacter(charCode)) {\n\t\t\t\t\t\t\tcharWidth++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// See https://unicode-table.com/en/blocks/control-pictures/\n\t\t\t\t\t\tif (renderControlCharacters && charCode < 32) {\n\t\t\t\t\t\t\tsb.write1(9216 + charCode);\n\t\t\t\t\t\t} else if (renderControlCharacters && charCode === 127) {\n\t\t\t\t\t\t\t// DEL\n\t\t\t\t\t\t\tsb.write1(9249);\n\t\t\t\t\t\t} else if (renderControlCharacters && isControlCharacter(charCode)) {\n\t\t\t\t\t\t\tsb.appendASCIIString('[U+');\n\t\t\t\t\t\t\tsb.appendASCIIString(to4CharHex(charCode));\n\t\t\t\t\t\t\tsb.appendASCIIString(']');\n\t\t\t\t\t\t\tproducedCharacters = 8;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsb.write1(charCode);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcharOffsetInPart += producedCharacters;\n\t\t\t\tpartContentCnt += producedCharacters;\n\t\t\t\tif (charIndex >= fauxIndentLength) {\n\t\t\t\t\tvisibleColumn += charWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprevPartContentCnt = partContentCnt;\n\t\t}\n\n\t\tif (partIsEmptyAndHasPseudoAfter) {\n\t\t\tpartDisplacement++;\n\t\t} else {\n\t\t\tpartDisplacement = 0;\n\t\t}\n\n\t\tif (charIndex >= len && !lastCharacterMappingDefined && part.isPseudoAfter()) {\n\t\t\tlastCharacterMappingDefined = true;\n\t\t\tcharacterMapping.setColumnInfo(charIndex + 1, partIndex, charOffsetInPart, partAbsoluteOffset);\n\t\t}\n\n\t\tsb.appendASCIIString('</span>');\n\n\t}\n\n\tif (!lastCharacterMappingDefined) {\n\t\t// When getting client rects for the last character, we will position the\n\t\t// text range at the end of the span, insteaf of at the beginning of next span\n\t\tcharacterMapping.setColumnInfo(len + 1, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\n\t}\n\n\tif (isOverflowing) {\n\t\tsb.appendASCIIString('<span>…</span>');\n\t}\n\n\tsb.appendASCIIString('</span>');\n\n\treturn new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\n}\n\nfunction to4CharHex(n: number): string {\n\treturn n.toString(16).toUpperCase().padStart(4, '0');\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IPartialViewLinesViewportData, IViewModel, IViewWhitespaceViewportData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel';\n\n/**\n * Contains all data needed to render at a specific viewport.\n */\nexport class ViewportData {\n\n\tpublic readonly selections: Selection[];\n\n\t/**\n\t * The line number at which to start rendering (inclusive).\n\t */\n\tpublic readonly startLineNumber: number;\n\n\t/**\n\t * The line number at which to end rendering (inclusive).\n\t */\n\tpublic readonly endLineNumber: number;\n\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\tpublic readonly relativeVerticalOffset: number[];\n\n\t/**\n\t * The viewport as a range (startLineNumber,1) -> (endLineNumber,maxColumn(endLineNumber)).\n\t */\n\tpublic readonly visibleRange: Range;\n\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\tpublic readonly bigNumbersDelta: number;\n\n\t/**\n\t * Positioning information about gaps whitespace.\n\t */\n\tpublic readonly whitespaceViewportData: IViewWhitespaceViewportData[];\n\n\tprivate readonly _model: IViewModel;\n\n\tconstructor(\n\t\tselections: Selection[],\n\t\tpartialData: IPartialViewLinesViewportData,\n\t\twhitespaceViewportData: IViewWhitespaceViewportData[],\n\t\tmodel: IViewModel\n\t) {\n\t\tthis.selections = selections;\n\t\tthis.startLineNumber = partialData.startLineNumber | 0;\n\t\tthis.endLineNumber = partialData.endLineNumber | 0;\n\t\tthis.relativeVerticalOffset = partialData.relativeVerticalOffset;\n\t\tthis.bigNumbersDelta = partialData.bigNumbersDelta | 0;\n\t\tthis.whitespaceViewportData = whitespaceViewportData;\n\n\t\tthis._model = model;\n\n\t\tthis.visibleRange = new Range(\n\t\t\tpartialData.startLineNumber,\n\t\t\tthis._model.getLineMinColumn(partialData.startLineNumber),\n\t\t\tpartialData.endLineNumber,\n\t\t\tthis._model.getLineMaxColumn(partialData.endLineNumber)\n\t\t);\n\t}\n\n\tpublic getViewLineRenderingData(lineNumber: number): ViewLineRenderingData {\n\t\treturn this._model.getViewLineRenderingData(this.visibleRange, lineNumber);\n\t}\n\n\tpublic getDecorationsInViewport(): ViewModelDecoration[] {\n\t\treturn this._model.getDecorationsInViewport(this.visibleRange);\n\t}\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 { IScrollPosition, Scrollable } from 'vs/base/common/scrollable';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { INewScrollPosition, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EndOfLinePreference, IModelDecorationOptions, ITextModel, PositionAffinity } from 'vs/editor/common/model';\nimport { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from 'vs/editor/common/textModelGuides';\nimport { EditorTheme } from 'vs/editor/common/editorTheme';\nimport { VerticalRevealType } from 'vs/editor/common/viewEvents';\nimport { ILineBreaksComputer, InjectedText } from 'vs/editor/common/modelLineProjectionData';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\n\nexport interface IViewModel extends ICursorSimpleModel {\n\n\treadonly model: ITextModel;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\n\n\treadonly cursorConfig: CursorConfiguration;\n\n\taddViewEventHandler(eventHandler: ViewEventHandler): void;\n\tremoveViewEventHandler(eventHandler: ViewEventHandler): void;\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tsetViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void;\n\ttokenizeViewport(): void;\n\tsetHasFocus(hasFocus: boolean): void;\n\tonCompositionStart(): void;\n\tonCompositionEnd(): void;\n\n\tgetDecorationsInViewport(visibleRange: Range): ViewModelDecoration[];\n\tgetViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData;\n\tgetViewLineData(lineNumber: number): ViewLineData;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData;\n\tgetCompletelyVisibleViewRange(): Range;\n\tgetCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range;\n\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\tgetBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[];\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[];\n\tgetRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\n\t//#region cursor\n\tgetPrimaryCursorState(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetCursorStates(): CursorState[];\n\tsetCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean;\n\tgetCursorColumnSelectData(): IColumnSelectData;\n\tgetCursorAutoClosedCharacters(): Range[];\n\tsetCursorColumnSelectData(columnSelectData: IColumnSelectData): void;\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\n\trevealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealTopMostCursor(source: string | null | undefined): void;\n\trevealBottomMostCursor(source: string | null | undefined): void;\n\trevealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\t//#endregion\n\n\t//#region viewLayout\n\tchangeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void;\n\t//#endregion\n}\n\nexport interface IViewLayout {\n\n\tgetScrollable(): Scrollable;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tsetScrollPosition(position: INewScrollPosition, type: ScrollType): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\n\tsetMaxLineWidth(maxLineWidth: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\tgetWhitespaces(): IEditorWhitespace[];\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tisInTopPadding(verticalOffset: number): boolean;\n\tisInBottomPadding(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n}\n\nexport interface IEditorWhitespace {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly height: number;\n}\n\n/**\n * An accessor that allows for whtiespace to be added, removed or changed in bulk.\n */\nexport interface IWhitespaceChangeAccessor {\n\tinsertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string;\n\tchangeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void;\n\tremoveWhitespace(id: string): void;\n}\n\nexport interface IPartialViewLinesViewportData {\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\treadonly bigNumbersDelta: number;\n\t/**\n\t * The first (partially) visible line number.\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * The last (partially) visible line number.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\treadonly relativeVerticalOffset: number[];\n\t/**\n\t * The centered line in the viewport.\n\t */\n\treadonly centeredLineNumber: number;\n\t/**\n\t * The first completely visible line number.\n\t */\n\treadonly completelyVisibleStartLineNumber: number;\n\t/**\n\t * The last completely visible line number.\n\t */\n\treadonly completelyVisibleEndLineNumber: number;\n}\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void = undefined;\n\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n\n\tconstructor(top: number, left: number, width: number, height: number) {\n\t\tthis.top = top | 0;\n\t\tthis.left = left | 0;\n\t\tthis.width = width | 0;\n\t\tthis.height = height | 0;\n\t}\n}\n\nexport interface ICoordinatesConverter {\n\t// View -> Model conversion and related methods\n\tconvertViewPositionToModelPosition(viewPosition: Position): Position;\n\tconvertViewRangeToModelRange(viewRange: Range): Range;\n\tvalidateViewPosition(viewPosition: Position, expectedModelPosition: Position): Position;\n\tvalidateViewRange(viewRange: Range, expectedModelRange: Range): Range;\n\n\t// Model -> View conversion and related methods\n\tconvertModelPositionToViewPosition(modelPosition: Position, affinity?: PositionAffinity): Position;\n\t/**\n\t * @param affinity Only has an effect if the range is empty.\n\t*/\n\tconvertModelRangeToViewRange(modelRange: Range, affinity?: PositionAffinity): Range;\n\tmodelPositionIsVisible(modelPosition: Position): boolean;\n\tgetModelLineViewLineCount(modelLineNumber: number): number;\n\tgetViewLineNumberOfModelPosition(modelLineNumber: number, modelColumn: number): number;\n}\n\nexport class MinimapLinesRenderingData {\n\tpublic readonly tabSize: number;\n\tpublic readonly data: Array<ViewLineData | null>;\n\n\tconstructor(\n\t\ttabSize: number,\n\t\tdata: Array<ViewLineData | null>\n\t) {\n\t\tthis.tabSize = tabSize;\n\t\tthis.data = data;\n\t}\n}\n\nexport class ViewLineData {\n\t_viewLineDataBrand: void = undefined;\n\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent).\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\t/**\n\t * Additional inline decorations for this line.\n\t*/\n\tpublic readonly inlineDecorations: readonly SingleLineInlineDecoration[] | null;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tstartVisibleColumn: number,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: readonly SingleLineInlineDecoration[] | null\n\t) {\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t}\n}\n\nexport class ViewLineRenderingData {\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * Describes if `content` contains RTL characters.\n\t */\n\tpublic readonly containsRTL: boolean;\n\t/**\n\t * Describes if `content` contains non basic ASCII chars.\n\t */\n\tpublic readonly isBasicASCII: boolean;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\t/**\n\t * Inline decorations at this view line.\n\t */\n\tpublic readonly inlineDecorations: InlineDecoration[];\n\t/**\n\t * The tab size for this view model.\n\t */\n\tpublic readonly tabSize: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent)\n\t */\n\tpublic readonly startVisibleColumn: number;\n\n\tconstructor(\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tmightContainRTL: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: InlineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t) {\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\n\t\tthis.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n\t\tthis.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t}\n\n\tpublic static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean {\n\t\tif (mightContainNonBasicASCII) {\n\t\t\treturn strings.isBasicASCII(lineContent);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static containsRTL(lineContent: string, isBasicASCII: boolean, mightContainRTL: boolean): boolean {\n\t\tif (!isBasicASCII && mightContainRTL) {\n\t\t\treturn strings.containsRTL(lineContent);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport const enum InlineDecorationType {\n\tRegular = 0,\n\tBefore = 1,\n\tAfter = 2,\n\tRegularAffectingLetterSpacing = 3\n}\n\nexport class InlineDecoration {\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly inlineClassName: string,\n\t\tpublic readonly type: InlineDecorationType\n\t) {\n\t}\n}\n\nexport class SingleLineInlineDecoration {\n\tconstructor(\n\t\tpublic readonly startOffset: number,\n\t\tpublic readonly endOffset: number,\n\t\tpublic readonly inlineClassName: string,\n\t\tpublic readonly inlineClassNameAffectsLetterSpacing: boolean\n\t) {\n\t}\n\n\ttoInlineDecoration(lineNumber: number): InlineDecoration {\n\t\treturn new InlineDecoration(\n\t\t\tnew Range(lineNumber, this.startOffset + 1, lineNumber, this.endOffset + 1),\n\t\t\tthis.inlineClassName,\n\t\t\tthis.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular\n\t\t);\n\t}\n}\n\nexport class ViewModelDecoration {\n\t_viewModelDecorationBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly options: IModelDecorationOptions;\n\n\tconstructor(range: Range, options: IModelDecorationOptions) {\n\t\tthis.range = range;\n\t\tthis.options = options;\n\t}\n}\n\nexport class OverviewRulerDecorationsGroup {\n\n\tconstructor(\n\t\tpublic readonly color: string,\n\t\tpublic readonly zIndex: number,\n\t\t/**\n\t\t * Decorations are encoded in a number array using the following scheme:\n\t\t * - 3*i = lane\n\t\t * - 3*i+1 = startLineNumber\n\t\t * - 3*i+2 = endLineNumber\n\t\t */\n\t\tpublic readonly data: number[]\n\t) { }\n\n\tpublic static cmp(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): number {\n\t\tif (a.zIndex === b.zIndex) {\n\t\t\tif (a.color < b.color) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.color > b.color) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn a.zIndex - b.zIndex;\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, markAsSingleton } from 'vs/base/common/lifecycle';\nimport { RGBA8 } from 'vs/editor/common/core/rgba';\nimport { ColorId, TokenizationRegistry } from 'vs/editor/common/languages';\n\nexport class MinimapTokensColorTracker extends Disposable {\n\tprivate static _INSTANCE: MinimapTokensColorTracker | null = null;\n\tpublic static getInstance(): MinimapTokensColorTracker {\n\t\tif (!this._INSTANCE) {\n\t\t\tthis._INSTANCE = markAsSingleton(new MinimapTokensColorTracker());\n\t\t}\n\t\treturn this._INSTANCE;\n\t}\n\n\tprivate _colors!: RGBA8[];\n\tprivate _backgroundIsLight!: boolean;\n\n\tprivate readonly _onDidChange = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate constructor() {\n\t\tsuper();\n\t\tthis._updateColorMap();\n\t\tthis._register(TokenizationRegistry.onDidChange(e => {\n\t\t\tif (e.changedColorMap) {\n\t\t\t\tthis._updateColorMap();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _updateColorMap(): void {\n\t\tconst colorMap = TokenizationRegistry.getColorMap();\n\t\tif (!colorMap) {\n\t\t\tthis._colors = [RGBA8.Empty];\n\t\t\tthis._backgroundIsLight = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._colors = [RGBA8.Empty];\n\t\tfor (let colorId = 1; colorId < colorMap.length; colorId++) {\n\t\t\tconst source = colorMap[colorId].rgba;\n\t\t\t// Use a VM friendly data-type\n\t\t\tthis._colors[colorId] = new RGBA8(source.r, source.g, source.b, Math.round(source.a * 255));\n\t\t}\n\t\tconst backgroundLuminosity = colorMap[ColorId.DefaultBackground].getRelativeLuminance();\n\t\tthis._backgroundIsLight = backgroundLuminosity >= 0.5;\n\t\tthis._onDidChange.fire(undefined);\n\t}\n\n\tpublic getColor(colorId: ColorId): RGBA8 {\n\t\tif (colorId < 1 || colorId >= this._colors.length) {\n\t\t\t// background color (basically invisible)\n\t\t\tcolorId = ColorId.DefaultBackground;\n\t\t}\n\t\treturn this._colors[colorId];\n\t}\n\n\tpublic backgroundIsLight(): boolean {\n\t\treturn this._backgroundIsLight;\n\t}\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 { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { EndOfLinePreference, ITextModel, PositionAffinity } from 'vs/editor/common/model';\nimport { LineInjectedText } from 'vs/editor/common/textModelEvents';\nimport { InjectedText, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData';\nimport { SingleLineInlineDecoration, ViewLineData } from 'vs/editor/common/viewModel';\n\nexport interface IModelLineProjection {\n\tisVisible(): boolean;\n\n\t/**\n\t * This invalidates the current instance (potentially reuses and returns it again).\n\t*/\n\tsetVisible(isVisible: boolean): IModelLineProjection;\n\n\tgetProjectionData(): ModelLineProjectionData | null;\n\tgetViewLineCount(): number;\n\tgetViewLineContent(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): string;\n\tgetViewLineLength(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number;\n\tgetViewLineMinColumn(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number;\n\tgetViewLineMaxColumn(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number;\n\tgetViewLineData(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): ViewLineData;\n\tgetViewLinesData(model: ISimpleModel, modelLineNumber: number, outputLineIdx: number, lineCount: number, globalStartIndex: number, needed: boolean[], result: Array<ViewLineData | null>): void;\n\n\tgetModelColumnOfViewPosition(outputLineIndex: number, outputColumn: number): number;\n\tgetViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number, affinity?: PositionAffinity): Position;\n\tgetViewLineNumberOfModelPosition(deltaLineNumber: number, inputColumn: number): number;\n\tnormalizePosition(outputLineIndex: number, outputPosition: Position, affinity: PositionAffinity): Position;\n\n\tgetInjectedTextAt(outputLineIndex: number, column: number): InjectedText | null;\n}\n\nexport interface ISimpleModel {\n\tgetLineTokens(lineNumber: number): LineTokens;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetValueInRange(range: IRange, eol?: EndOfLinePreference): string;\n}\n\nexport function createModelLineProjection(lineBreakData: ModelLineProjectionData | null, isVisible: boolean): IModelLineProjection {\n\tif (lineBreakData === null) {\n\t\t// No mapping needed\n\t\tif (isVisible) {\n\t\t\treturn IdentityModelLineProjection.INSTANCE;\n\t\t}\n\t\treturn HiddenModelLineProjection.INSTANCE;\n\t} else {\n\t\treturn new ModelLineProjection(lineBreakData, isVisible);\n\t}\n}\n\n/**\n * This projection is used to\n * * wrap model lines\n * * inject text\n */\nclass ModelLineProjection implements IModelLineProjection {\n\tprivate readonly _projectionData: ModelLineProjectionData;\n\tprivate _isVisible: boolean;\n\n\tconstructor(lineBreakData: ModelLineProjectionData, isVisible: boolean) {\n\t\tthis._projectionData = lineBreakData;\n\t\tthis._isVisible = isVisible;\n\t}\n\n\tpublic isVisible(): boolean {\n\t\treturn this._isVisible;\n\t}\n\n\tpublic setVisible(isVisible: boolean): IModelLineProjection {\n\t\tthis._isVisible = isVisible;\n\t\treturn this;\n\t}\n\n\tpublic getProjectionData(): ModelLineProjectionData | null {\n\t\treturn this._projectionData;\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\tif (!this._isVisible) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._projectionData.getOutputLineCount();\n\t}\n\n\tpublic getViewLineContent(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): string {\n\t\tthis._assertVisible();\n\n\t\tconst startOffsetInInputWithInjections = outputLineIndex > 0 ? this._projectionData.breakOffsets[outputLineIndex - 1] : 0;\n\t\tconst endOffsetInInputWithInjections = this._projectionData.breakOffsets[outputLineIndex];\n\n\t\tlet r: string;\n\t\tif (this._projectionData.injectionOffsets !== null) {\n\t\t\tconst injectedTexts = this._projectionData.injectionOffsets.map(\n\t\t\t\t(offset, idx) => new LineInjectedText(\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\toffset + 1,\n\t\t\t\t\tthis._projectionData.injectionOptions![idx],\n\t\t\t\t\t0\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst lineWithInjections = LineInjectedText.applyInjectedText(\n\t\t\t\tmodel.getLineContent(modelLineNumber),\n\t\t\t\tinjectedTexts\n\t\t\t);\n\t\t\tr = lineWithInjections.substring(startOffsetInInputWithInjections, endOffsetInInputWithInjections);\n\t\t} else {\n\t\t\tr = model.getValueInRange({\n\t\t\t\tstartLineNumber: modelLineNumber,\n\t\t\t\tstartColumn: startOffsetInInputWithInjections + 1,\n\t\t\t\tendLineNumber: modelLineNumber,\n\t\t\t\tendColumn: endOffsetInInputWithInjections + 1\n\t\t\t});\n\t\t}\n\n\t\tif (outputLineIndex > 0) {\n\t\t\tr = spaces(this._projectionData.wrappedTextIndentLength) + r;\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tpublic getViewLineLength(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number {\n\t\tthis._assertVisible();\n\t\treturn this._projectionData.getLineLength(outputLineIndex);\n\t}\n\n\tpublic getViewLineMinColumn(_model: ITextModel, _modelLineNumber: number, outputLineIndex: number): number {\n\t\tthis._assertVisible();\n\t\treturn this._projectionData.getMinOutputOffset(outputLineIndex) + 1;\n\t}\n\n\tpublic getViewLineMaxColumn(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number {\n\t\tthis._assertVisible();\n\t\treturn this._projectionData.getMaxOutputOffset(outputLineIndex) + 1;\n\t}\n\n\t/**\n\t * Try using {@link getViewLinesData} instead.\n\t*/\n\tpublic getViewLineData(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): ViewLineData {\n\t\tconst arr = new Array<ViewLineData>();\n\t\tthis.getViewLinesData(model, modelLineNumber, outputLineIndex, 1, 0, [true], arr);\n\t\treturn arr[0];\n\t}\n\n\tpublic getViewLinesData(model: ISimpleModel, modelLineNumber: number, outputLineIdx: number, lineCount: number, globalStartIndex: number, needed: boolean[], result: Array<ViewLineData | null>): void {\n\t\tthis._assertVisible();\n\n\t\tconst lineBreakData = this._projectionData;\n\n\t\tconst injectionOffsets = lineBreakData.injectionOffsets;\n\t\tconst injectionOptions = lineBreakData.injectionOptions;\n\n\t\tlet inlineDecorationsPerOutputLine: SingleLineInlineDecoration[][] | null = null;\n\n\t\tif (injectionOffsets) {\n\t\t\tinlineDecorationsPerOutputLine = [];\n\t\t\tlet totalInjectedTextLengthBefore = 0;\n\t\t\tlet currentInjectedOffset = 0;\n\n\t\t\tfor (let outputLineIndex = 0; outputLineIndex < lineBreakData.getOutputLineCount(); outputLineIndex++) {\n\t\t\t\tconst inlineDecorations = new Array<SingleLineInlineDecoration>();\n\t\t\t\tinlineDecorationsPerOutputLine[outputLineIndex] = inlineDecorations;\n\n\t\t\t\tconst lineStartOffsetInInputWithInjections = outputLineIndex > 0 ? lineBreakData.breakOffsets[outputLineIndex - 1] : 0;\n\t\t\t\tconst lineEndOffsetInInputWithInjections = lineBreakData.breakOffsets[outputLineIndex];\n\n\t\t\t\twhile (currentInjectedOffset < injectionOffsets.length) {\n\t\t\t\t\tconst length = injectionOptions![currentInjectedOffset].content.length;\n\t\t\t\t\tconst injectedTextStartOffsetInInputWithInjections = injectionOffsets[currentInjectedOffset] + totalInjectedTextLengthBefore;\n\t\t\t\t\tconst injectedTextEndOffsetInInputWithInjections = injectedTextStartOffsetInInputWithInjections + length;\n\n\t\t\t\t\tif (injectedTextStartOffsetInInputWithInjections > lineEndOffsetInInputWithInjections) {\n\t\t\t\t\t\t// Injected text only starts in later wrapped lines.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lineStartOffsetInInputWithInjections < injectedTextEndOffsetInInputWithInjections) {\n\t\t\t\t\t\t// Injected text ends after or in this line (but also starts in or before this line).\n\t\t\t\t\t\tconst options = injectionOptions![currentInjectedOffset];\n\t\t\t\t\t\tif (options.inlineClassName) {\n\t\t\t\t\t\t\tconst offset = (outputLineIndex > 0 ? lineBreakData.wrappedTextIndentLength : 0);\n\t\t\t\t\t\t\tconst start = offset + Math.max(injectedTextStartOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, 0);\n\t\t\t\t\t\t\tconst end = offset + Math.min(injectedTextEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections);\n\t\t\t\t\t\t\tif (start !== end) {\n\t\t\t\t\t\t\t\tinlineDecorations.push(new SingleLineInlineDecoration(start, end, options.inlineClassName, options.inlineClassNameAffectsLetterSpacing!));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (injectedTextEndOffsetInInputWithInjections <= lineEndOffsetInInputWithInjections) {\n\t\t\t\t\t\ttotalInjectedTextLengthBefore += length;\n\t\t\t\t\t\tcurrentInjectedOffset++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// injected text breaks into next line, process it again\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet lineWithInjections: LineTokens;\n\t\tif (injectionOffsets) {\n\t\t\tlineWithInjections = model.getLineTokens(modelLineNumber).withInserted(injectionOffsets.map((offset, idx) => ({\n\t\t\t\toffset,\n\t\t\t\ttext: injectionOptions![idx].content,\n\t\t\t\ttokenMetadata: LineTokens.defaultTokenMetadata\n\t\t\t})));\n\t\t} else {\n\t\t\tlineWithInjections = model.getLineTokens(modelLineNumber);\n\t\t}\n\n\t\tfor (let outputLineIndex = outputLineIdx; outputLineIndex < outputLineIdx + lineCount; outputLineIndex++) {\n\t\t\tconst globalIndex = globalStartIndex + outputLineIndex - outputLineIdx;\n\t\t\tif (!needed[globalIndex]) {\n\t\t\t\tresult[globalIndex] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult[globalIndex] = this._getViewLineData(lineWithInjections, inlineDecorationsPerOutputLine ? inlineDecorationsPerOutputLine[outputLineIndex] : null, outputLineIndex);\n\t\t}\n\t}\n\n\tprivate _getViewLineData(lineWithInjections: LineTokens, inlineDecorations: null | SingleLineInlineDecoration[], outputLineIndex: number): ViewLineData {\n\t\tthis._assertVisible();\n\t\tconst lineBreakData = this._projectionData;\n\t\tconst deltaStartIndex = (outputLineIndex > 0 ? lineBreakData.wrappedTextIndentLength : 0);\n\n\t\tconst lineStartOffsetInInputWithInjections = outputLineIndex > 0 ? lineBreakData.breakOffsets[outputLineIndex - 1] : 0;\n\t\tconst lineEndOffsetInInputWithInjections = lineBreakData.breakOffsets[outputLineIndex];\n\t\tconst tokens = lineWithInjections.sliceAndInflate(lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections, deltaStartIndex);\n\n\t\tlet lineContent = tokens.getLineContent();\n\t\tif (outputLineIndex > 0) {\n\t\t\tlineContent = spaces(lineBreakData.wrappedTextIndentLength) + lineContent;\n\t\t}\n\n\t\tconst minColumn = this._projectionData.getMinOutputOffset(outputLineIndex) + 1;\n\t\tconst maxColumn = lineContent.length + 1;\n\t\tconst continuesWithWrappedLine = (outputLineIndex + 1 < this.getViewLineCount());\n\t\tconst startVisibleColumn = (outputLineIndex === 0 ? 0 : lineBreakData.breakOffsetsVisibleColumn[outputLineIndex - 1]);\n\n\t\treturn new ViewLineData(\n\t\t\tlineContent,\n\t\t\tcontinuesWithWrappedLine,\n\t\t\tminColumn,\n\t\t\tmaxColumn,\n\t\t\tstartVisibleColumn,\n\t\t\ttokens,\n\t\t\tinlineDecorations\n\t\t);\n\t}\n\n\tpublic getModelColumnOfViewPosition(outputLineIndex: number, outputColumn: number): number {\n\t\tthis._assertVisible();\n\t\treturn this._projectionData.translateToInputOffset(outputLineIndex, outputColumn - 1) + 1;\n\t}\n\n\tpublic getViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number, affinity: PositionAffinity = PositionAffinity.None): Position {\n\t\tthis._assertVisible();\n\t\tconst r = this._projectionData.translateToOutputPosition(inputColumn - 1, affinity);\n\t\treturn r.toPosition(deltaLineNumber);\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(deltaLineNumber: number, inputColumn: number): number {\n\t\tthis._assertVisible();\n\t\tconst r = this._projectionData.translateToOutputPosition(inputColumn - 1);\n\t\treturn deltaLineNumber + r.outputLineIndex;\n\t}\n\n\tpublic normalizePosition(outputLineIndex: number, outputPosition: Position, affinity: PositionAffinity): Position {\n\t\tconst baseViewLineNumber = outputPosition.lineNumber - outputLineIndex;\n\t\tconst normalizedOutputPosition = this._projectionData.normalizeOutputPosition(outputLineIndex, outputPosition.column - 1, affinity);\n\t\tconst result = normalizedOutputPosition.toPosition(baseViewLineNumber);\n\t\treturn result;\n\t}\n\n\tpublic getInjectedTextAt(outputLineIndex: number, outputColumn: number): InjectedText | null {\n\t\treturn this._projectionData.getInjectedText(outputLineIndex, outputColumn - 1);\n\t}\n\n\tprivate _assertVisible() {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t}\n}\n\n/**\n * This projection does not change the model line.\n*/\nclass IdentityModelLineProjection implements IModelLineProjection {\n\tpublic static readonly INSTANCE = new IdentityModelLineProjection();\n\n\tprivate constructor() { }\n\n\tpublic isVisible(): boolean {\n\t\treturn true;\n\t}\n\n\tpublic setVisible(isVisible: boolean): IModelLineProjection {\n\t\tif (isVisible) {\n\t\t\treturn this;\n\t\t}\n\t\treturn HiddenModelLineProjection.INSTANCE;\n\t}\n\n\tpublic getProjectionData(): ModelLineProjectionData | null {\n\t\treturn null;\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\treturn 1;\n\t}\n\n\tpublic getViewLineContent(model: ISimpleModel, modelLineNumber: number, _outputLineIndex: number): string {\n\t\treturn model.getLineContent(modelLineNumber);\n\t}\n\n\tpublic getViewLineLength(model: ISimpleModel, modelLineNumber: number, _outputLineIndex: number): number {\n\t\treturn model.getLineLength(modelLineNumber);\n\t}\n\n\tpublic getViewLineMinColumn(model: ISimpleModel, modelLineNumber: number, _outputLineIndex: number): number {\n\t\treturn model.getLineMinColumn(modelLineNumber);\n\t}\n\n\tpublic getViewLineMaxColumn(model: ISimpleModel, modelLineNumber: number, _outputLineIndex: number): number {\n\t\treturn model.getLineMaxColumn(modelLineNumber);\n\t}\n\n\tpublic getViewLineData(model: ISimpleModel, modelLineNumber: number, _outputLineIndex: number): ViewLineData {\n\t\tconst lineTokens = model.getLineTokens(modelLineNumber);\n\t\tconst lineContent = lineTokens.getLineContent();\n\t\treturn new ViewLineData(\n\t\t\tlineContent,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\tlineContent.length + 1,\n\t\t\t0,\n\t\t\tlineTokens.inflate(),\n\t\t\tnull\n\t\t);\n\t}\n\n\tpublic getViewLinesData(model: ISimpleModel, modelLineNumber: number, _fromOuputLineIndex: number, _toOutputLineIndex: number, globalStartIndex: number, needed: boolean[], result: Array<ViewLineData | null>): void {\n\t\tif (!needed[globalStartIndex]) {\n\t\t\tresult[globalStartIndex] = null;\n\t\t\treturn;\n\t\t}\n\t\tresult[globalStartIndex] = this.getViewLineData(model, modelLineNumber, 0);\n\t}\n\n\tpublic getModelColumnOfViewPosition(_outputLineIndex: number, outputColumn: number): number {\n\t\treturn outputColumn;\n\t}\n\n\tpublic getViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number): Position {\n\t\treturn new Position(deltaLineNumber, inputColumn);\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(deltaLineNumber: number, _inputColumn: number): number {\n\t\treturn deltaLineNumber;\n\t}\n\n\tpublic normalizePosition(outputLineIndex: number, outputPosition: Position, affinity: PositionAffinity): Position {\n\t\treturn outputPosition;\n\t}\n\n\tpublic getInjectedTextAt(_outputLineIndex: number, _outputColumn: number): InjectedText | null {\n\t\treturn null;\n\t}\n}\n\n/**\n * This projection hides the model line.\n */\nclass HiddenModelLineProjection implements IModelLineProjection {\n\tpublic static readonly INSTANCE = new HiddenModelLineProjection();\n\n\tprivate constructor() { }\n\n\tpublic isVisible(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic setVisible(isVisible: boolean): IModelLineProjection {\n\t\tif (!isVisible) {\n\t\t\treturn this;\n\t\t}\n\t\treturn IdentityModelLineProjection.INSTANCE;\n\t}\n\n\tpublic getProjectionData(): ModelLineProjectionData | null {\n\t\treturn null;\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\treturn 0;\n\t}\n\n\tpublic getViewLineContent(_model: ISimpleModel, _modelLineNumber: number, _outputLineIndex: number): string {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLineLength(_model: ISimpleModel, _modelLineNumber: number, _outputLineIndex: number): number {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLineMinColumn(_model: ISimpleModel, _modelLineNumber: number, _outputLineIndex: number): number {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLineMaxColumn(_model: ISimpleModel, _modelLineNumber: number, _outputLineIndex: number): number {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLineData(_model: ISimpleModel, _modelLineNumber: number, _outputLineIndex: number): ViewLineData {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLinesData(_model: ISimpleModel, _modelLineNumber: number, _fromOuputLineIndex: number, _toOutputLineIndex: number, _globalStartIndex: number, _needed: boolean[], _result: ViewLineData[]): void {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getModelColumnOfViewPosition(_outputLineIndex: number, _outputColumn: number): number {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewPositionOfModelPosition(_deltaLineNumber: number, _inputColumn: number): Position {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(_deltaLineNumber: number, _inputColumn: number): number {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic normalizePosition(outputLineIndex: number, outputPosition: Position, affinity: PositionAffinity): Position {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic getInjectedTextAt(_outputLineIndex: number, _outputColumn: number): InjectedText | null {\n\t\tthrow new Error('Not supported');\n\t}\n}\n\nlet _spaces: string[] = [''];\nfunction spaces(count: number): string {\n\tif (count >= _spaces.length) {\n\t\tfor (let i = 1; i <= count; i++) {\n\t\t\t_spaces[i] = _makeSpaces(i);\n\t\t}\n\t}\n\treturn _spaces[count];\n}\n\nfunction _makeSpaces(count: number): string {\n\treturn new Array(count + 1).join(' ');\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { WrappingIndent, IComputedEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { LineInjectedText } from 'vs/editor/common/textModelEvents';\nimport { InjectedTextOptions } from 'vs/editor/common/model';\nimport { ILineBreaksComputerFactory, ILineBreaksComputer, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData';\n\nexport class MonospaceLineBreaksComputerFactory implements ILineBreaksComputerFactory {\n\tpublic static create(options: IComputedEditorOptions): MonospaceLineBreaksComputerFactory {\n\t\treturn new MonospaceLineBreaksComputerFactory(\n\t\t\toptions.get(EditorOption.wordWrapBreakBeforeCharacters),\n\t\t\toptions.get(EditorOption.wordWrapBreakAfterCharacters)\n\t\t);\n\t}\n\n\tprivate readonly classifier: WrappingCharacterClassifier;\n\n\tconstructor(breakBeforeChars: string, breakAfterChars: string) {\n\t\tthis.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars);\n\t}\n\n\tpublic createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer {\n\t\tconst requests: string[] = [];\n\t\tconst injectedTexts: (LineInjectedText[] | null)[] = [];\n\t\tconst previousBreakingData: (ModelLineProjectionData | null)[] = [];\n\t\treturn {\n\t\t\taddRequest: (lineText: string, injectedText: LineInjectedText[] | null, previousLineBreakData: ModelLineProjectionData | null) => {\n\t\t\t\trequests.push(lineText);\n\t\t\t\tinjectedTexts.push(injectedText);\n\t\t\t\tpreviousBreakingData.push(previousLineBreakData);\n\t\t\t},\n\t\t\tfinalize: () => {\n\t\t\t\tconst columnsForFullWidthChar = fontInfo.typicalFullwidthCharacterWidth / fontInfo.typicalHalfwidthCharacterWidth;\n\t\t\t\tconst result: (ModelLineProjectionData | null)[] = [];\n\t\t\t\tfor (let i = 0, len = requests.length; i < len; i++) {\n\t\t\t\t\tconst injectedText = injectedTexts[i];\n\t\t\t\t\tconst previousLineBreakData = previousBreakingData[i];\n\t\t\t\t\tif (previousLineBreakData && !previousLineBreakData.injectionOptions && !injectedText) {\n\t\t\t\t\t\tresult[i] = createLineBreaksFromPreviousLineBreaks(this.classifier, previousLineBreakData, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[i] = createLineBreaks(this.classifier, requests[i], injectedText, tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tarrPool1.length = 0;\n\t\t\t\tarrPool2.length = 0;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t}\n}\n\nconst enum CharacterClass {\n\tNONE = 0,\n\tBREAK_BEFORE = 1,\n\tBREAK_AFTER = 2,\n\tBREAK_IDEOGRAPHIC = 3 // for Han and Kana.\n}\n\nclass WrappingCharacterClassifier extends CharacterClassifier<CharacterClass> {\n\n\tconstructor(BREAK_BEFORE: string, BREAK_AFTER: string) {\n\t\tsuper(CharacterClass.NONE);\n\n\t\tfor (let i = 0; i < BREAK_BEFORE.length; i++) {\n\t\t\tthis.set(BREAK_BEFORE.charCodeAt(i), CharacterClass.BREAK_BEFORE);\n\t\t}\n\n\t\tfor (let i = 0; i < BREAK_AFTER.length; i++) {\n\t\t\tthis.set(BREAK_AFTER.charCodeAt(i), CharacterClass.BREAK_AFTER);\n\t\t}\n\t}\n\n\tpublic override get(charCode: number): CharacterClass {\n\t\tif (charCode >= 0 && charCode < 256) {\n\t\t\treturn <CharacterClass>this._asciiMap[charCode];\n\t\t} else {\n\t\t\t// Initialize CharacterClass.BREAK_IDEOGRAPHIC for these Unicode ranges:\n\t\t\t// 1. CJK Unified Ideographs (0x4E00 -- 0x9FFF)\n\t\t\t// 2. CJK Unified Ideographs Extension A (0x3400 -- 0x4DBF)\n\t\t\t// 3. Hiragana and Katakana (0x3040 -- 0x30FF)\n\t\t\tif (\n\t\t\t\t(charCode >= 0x3040 && charCode <= 0x30FF)\n\t\t\t\t|| (charCode >= 0x3400 && charCode <= 0x4DBF)\n\t\t\t\t|| (charCode >= 0x4E00 && charCode <= 0x9FFF)\n\t\t\t) {\n\t\t\t\treturn CharacterClass.BREAK_IDEOGRAPHIC;\n\t\t\t}\n\n\t\t\treturn <CharacterClass>(this._map.get(charCode) || this._defaultValue);\n\t\t}\n\t}\n}\n\nlet arrPool1: number[] = [];\nlet arrPool2: number[] = [];\n\nfunction createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterClassifier, previousBreakingData: ModelLineProjectionData, lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ModelLineProjectionData | null {\n\tif (firstLineBreakColumn === -1) {\n\t\treturn null;\n\t}\n\n\tconst len = lineText.length;\n\tif (len <= 1) {\n\t\treturn null;\n\t}\n\n\tconst prevBreakingOffsets = previousBreakingData.breakOffsets;\n\tconst prevBreakingOffsetsVisibleColumn = previousBreakingData.breakOffsetsVisibleColumn;\n\n\tconst wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent);\n\tconst wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength;\n\n\tconst breakingOffsets: number[] = arrPool1;\n\tconst breakingOffsetsVisibleColumn: number[] = arrPool2;\n\tlet breakingOffsetsCount = 0;\n\tlet lastBreakingOffset = 0;\n\tlet lastBreakingOffsetVisibleColumn = 0;\n\n\tlet breakingColumn = firstLineBreakColumn;\n\tconst prevLen = prevBreakingOffsets.length;\n\tlet prevIndex = 0;\n\n\tif (prevIndex >= 0) {\n\t\tlet bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn);\n\t\twhile (prevIndex + 1 < prevLen) {\n\t\t\tconst distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn);\n\t\t\tif (distance >= bestDistance) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbestDistance = distance;\n\t\t\tprevIndex++;\n\t\t}\n\t}\n\n\twhile (prevIndex < prevLen) {\n\t\t// Allow for prevIndex to be -1 (for the case where we hit a tab when walking backwards from the first break)\n\t\tlet prevBreakOffset = prevIndex < 0 ? 0 : prevBreakingOffsets[prevIndex];\n\t\tlet prevBreakOffsetVisibleColumn = prevIndex < 0 ? 0 : prevBreakingOffsetsVisibleColumn[prevIndex];\n\t\tif (lastBreakingOffset > prevBreakOffset) {\n\t\t\tprevBreakOffset = lastBreakingOffset;\n\t\t\tprevBreakOffsetVisibleColumn = lastBreakingOffsetVisibleColumn;\n\t\t}\n\n\t\tlet breakOffset = 0;\n\t\tlet breakOffsetVisibleColumn = 0;\n\n\t\tlet forcedBreakOffset = 0;\n\t\tlet forcedBreakOffsetVisibleColumn = 0;\n\n\t\t// initially, we search as much as possible to the right (if it fits)\n\t\tif (prevBreakOffsetVisibleColumn <= breakingColumn) {\n\t\t\tlet visibleColumn = prevBreakOffsetVisibleColumn;\n\t\t\tlet prevCharCode = prevBreakOffset === 0 ? CharCode.Null : lineText.charCodeAt(prevBreakOffset - 1);\n\t\t\tlet prevCharCodeClass = prevBreakOffset === 0 ? CharacterClass.NONE : classifier.get(prevCharCode);\n\t\t\tlet entireLineFits = true;\n\t\t\tfor (let i = prevBreakOffset; i < len; i++) {\n\t\t\t\tconst charStartOffset = i;\n\t\t\t\tconst charCode = lineText.charCodeAt(i);\n\t\t\t\tlet charCodeClass: number;\n\t\t\t\tlet charWidth: number;\n\n\t\t\t\tif (strings.isHighSurrogate(charCode)) {\n\t\t\t\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\t\t\t\ti++;\n\t\t\t\t\tcharCodeClass = CharacterClass.NONE;\n\t\t\t\t\tcharWidth = 2;\n\t\t\t\t} else {\n\t\t\t\t\tcharCodeClass = classifier.get(charCode);\n\t\t\t\t\tcharWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar);\n\t\t\t\t}\n\n\t\t\t\tif (charStartOffset > lastBreakingOffset && canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {\n\t\t\t\t\tbreakOffset = charStartOffset;\n\t\t\t\t\tbreakOffsetVisibleColumn = visibleColumn;\n\t\t\t\t}\n\n\t\t\t\tvisibleColumn += charWidth;\n\n\t\t\t\t// check if adding character at `i` will go over the breaking column\n\t\t\t\tif (visibleColumn > breakingColumn) {\n\t\t\t\t\t// We need to break at least before character at `i`:\n\t\t\t\t\tif (charStartOffset > lastBreakingOffset) {\n\t\t\t\t\t\tforcedBreakOffset = charStartOffset;\n\t\t\t\t\t\tforcedBreakOffsetVisibleColumn = visibleColumn - charWidth;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// we need to advance at least by one character\n\t\t\t\t\t\tforcedBreakOffset = i + 1;\n\t\t\t\t\t\tforcedBreakOffsetVisibleColumn = visibleColumn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) {\n\t\t\t\t\t\t// Cannot break at `breakOffset` => reset it if it was set\n\t\t\t\t\t\tbreakOffset = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tentireLineFits = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevCharCode = charCode;\n\t\t\t\tprevCharCodeClass = charCodeClass;\n\t\t\t}\n\n\t\t\tif (entireLineFits) {\n\t\t\t\t// there is no more need to break => stop the outer loop!\n\t\t\t\tif (breakingOffsetsCount > 0) {\n\t\t\t\t\t// Add last segment, no need to assign to `lastBreakingOffset` and `lastBreakingOffsetVisibleColumn`\n\t\t\t\t\tbreakingOffsets[breakingOffsetsCount] = prevBreakingOffsets[prevBreakingOffsets.length - 1];\n\t\t\t\t\tbreakingOffsetsVisibleColumn[breakingOffsetsCount] = prevBreakingOffsetsVisibleColumn[prevBreakingOffsets.length - 1];\n\t\t\t\t\tbreakingOffsetsCount++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (breakOffset === 0) {\n\t\t\t// must search left\n\t\t\tlet visibleColumn = prevBreakOffsetVisibleColumn;\n\t\t\tlet charCode = lineText.charCodeAt(prevBreakOffset);\n\t\t\tlet charCodeClass = classifier.get(charCode);\n\t\t\tlet hitATabCharacter = false;\n\t\t\tfor (let i = prevBreakOffset - 1; i >= lastBreakingOffset; i--) {\n\t\t\t\tconst charStartOffset = i + 1;\n\t\t\t\tconst prevCharCode = lineText.charCodeAt(i);\n\n\t\t\t\tif (prevCharCode === CharCode.Tab) {\n\t\t\t\t\t// cannot determine the width of a tab when going backwards, so we must go forwards\n\t\t\t\t\thitATabCharacter = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlet prevCharCodeClass: number;\n\t\t\t\tlet prevCharWidth: number;\n\n\t\t\t\tif (strings.isLowSurrogate(prevCharCode)) {\n\t\t\t\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\t\t\t\ti--;\n\t\t\t\t\tprevCharCodeClass = CharacterClass.NONE;\n\t\t\t\t\tprevCharWidth = 2;\n\t\t\t\t} else {\n\t\t\t\t\tprevCharCodeClass = classifier.get(prevCharCode);\n\t\t\t\t\tprevCharWidth = (strings.isFullWidthCharacter(prevCharCode) ? columnsForFullWidthChar : 1);\n\t\t\t\t}\n\n\t\t\t\tif (visibleColumn <= breakingColumn) {\n\t\t\t\t\tif (forcedBreakOffset === 0) {\n\t\t\t\t\t\tforcedBreakOffset = charStartOffset;\n\t\t\t\t\t\tforcedBreakOffsetVisibleColumn = visibleColumn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (visibleColumn <= breakingColumn - wrappedLineBreakColumn) {\n\t\t\t\t\t\t// went too far!\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {\n\t\t\t\t\t\tbreakOffset = charStartOffset;\n\t\t\t\t\t\tbreakOffsetVisibleColumn = visibleColumn;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvisibleColumn -= prevCharWidth;\n\t\t\t\tcharCode = prevCharCode;\n\t\t\t\tcharCodeClass = prevCharCodeClass;\n\t\t\t}\n\n\t\t\tif (breakOffset !== 0) {\n\t\t\t\tconst remainingWidthOfNextLine = wrappedLineBreakColumn - (forcedBreakOffsetVisibleColumn - breakOffsetVisibleColumn);\n\t\t\t\tif (remainingWidthOfNextLine <= tabSize) {\n\t\t\t\t\tconst charCodeAtForcedBreakOffset = lineText.charCodeAt(forcedBreakOffset);\n\t\t\t\t\tlet charWidth: number;\n\t\t\t\t\tif (strings.isHighSurrogate(charCodeAtForcedBreakOffset)) {\n\t\t\t\t\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\t\t\t\t\tcharWidth = 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcharWidth = computeCharWidth(charCodeAtForcedBreakOffset, forcedBreakOffsetVisibleColumn, tabSize, columnsForFullWidthChar);\n\t\t\t\t\t}\n\t\t\t\t\tif (remainingWidthOfNextLine - charWidth < 0) {\n\t\t\t\t\t\t// it is not worth it to break at breakOffset, it just introduces an extra needless line!\n\t\t\t\t\t\tbreakOffset = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hitATabCharacter) {\n\t\t\t\t// cannot determine the width of a tab when going backwards, so we must go forwards from the previous break\n\t\t\t\tprevIndex--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (breakOffset === 0) {\n\t\t\t// Could not find a good breaking point\n\t\t\tbreakOffset = forcedBreakOffset;\n\t\t\tbreakOffsetVisibleColumn = forcedBreakOffsetVisibleColumn;\n\t\t}\n\n\t\tif (breakOffset <= lastBreakingOffset) {\n\t\t\t// Make sure that we are advancing (at least one character)\n\t\t\tconst charCode = lineText.charCodeAt(lastBreakingOffset);\n\t\t\tif (strings.isHighSurrogate(charCode)) {\n\t\t\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\t\t\tbreakOffset = lastBreakingOffset + 2;\n\t\t\t\tbreakOffsetVisibleColumn = lastBreakingOffsetVisibleColumn + 2;\n\t\t\t} else {\n\t\t\t\tbreakOffset = lastBreakingOffset + 1;\n\t\t\t\tbreakOffsetVisibleColumn = lastBreakingOffsetVisibleColumn + computeCharWidth(charCode, lastBreakingOffsetVisibleColumn, tabSize, columnsForFullWidthChar);\n\t\t\t}\n\t\t}\n\n\t\tlastBreakingOffset = breakOffset;\n\t\tbreakingOffsets[breakingOffsetsCount] = breakOffset;\n\t\tlastBreakingOffsetVisibleColumn = breakOffsetVisibleColumn;\n\t\tbreakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn;\n\t\tbreakingOffsetsCount++;\n\t\tbreakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn;\n\n\t\twhile (prevIndex < 0 || (prevIndex < prevLen && prevBreakingOffsetsVisibleColumn[prevIndex] < breakOffsetVisibleColumn)) {\n\t\t\tprevIndex++;\n\t\t}\n\n\t\tlet bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn);\n\t\twhile (prevIndex + 1 < prevLen) {\n\t\t\tconst distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn);\n\t\t\tif (distance >= bestDistance) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbestDistance = distance;\n\t\t\tprevIndex++;\n\t\t}\n\t}\n\n\tif (breakingOffsetsCount === 0) {\n\t\treturn null;\n\t}\n\n\t// Doing here some object reuse which ends up helping a huge deal with GC pauses!\n\tbreakingOffsets.length = breakingOffsetsCount;\n\tbreakingOffsetsVisibleColumn.length = breakingOffsetsCount;\n\tarrPool1 = previousBreakingData.breakOffsets;\n\tarrPool2 = previousBreakingData.breakOffsetsVisibleColumn;\n\tpreviousBreakingData.breakOffsets = breakingOffsets;\n\tpreviousBreakingData.breakOffsetsVisibleColumn = breakingOffsetsVisibleColumn;\n\tpreviousBreakingData.wrappedTextIndentLength = wrappedTextIndentLength;\n\treturn previousBreakingData;\n}\n\nfunction createLineBreaks(classifier: WrappingCharacterClassifier, _lineText: string, injectedTexts: LineInjectedText[] | null, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ModelLineProjectionData | null {\n\tconst lineText = LineInjectedText.applyInjectedText(_lineText, injectedTexts);\n\n\tlet injectionOptions: InjectedTextOptions[] | null;\n\tlet injectionOffsets: number[] | null;\n\tif (injectedTexts && injectedTexts.length > 0) {\n\t\tinjectionOptions = injectedTexts.map(t => t.options);\n\t\tinjectionOffsets = injectedTexts.map(text => text.column - 1);\n\t} else {\n\t\tinjectionOptions = null;\n\t\tinjectionOffsets = null;\n\t}\n\n\tif (firstLineBreakColumn === -1) {\n\t\tif (!injectionOptions) {\n\t\t\treturn null;\n\t\t}\n\t\t// creating a `LineBreakData` with an invalid `breakOffsetsVisibleColumn` is OK\n\t\t// because `breakOffsetsVisibleColumn` will never be used because it contains injected text\n\t\treturn new ModelLineProjectionData(injectionOffsets, injectionOptions, [lineText.length], [], 0);\n\t}\n\n\tconst len = lineText.length;\n\tif (len <= 1) {\n\t\tif (!injectionOptions) {\n\t\t\treturn null;\n\t\t}\n\t\t// creating a `LineBreakData` with an invalid `breakOffsetsVisibleColumn` is OK\n\t\t// because `breakOffsetsVisibleColumn` will never be used because it contains injected text\n\t\treturn new ModelLineProjectionData(injectionOffsets, injectionOptions, [lineText.length], [], 0);\n\t}\n\n\tconst wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent);\n\tconst wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength;\n\n\tconst breakingOffsets: number[] = [];\n\tconst breakingOffsetsVisibleColumn: number[] = [];\n\tlet breakingOffsetsCount: number = 0;\n\tlet breakOffset = 0;\n\tlet breakOffsetVisibleColumn = 0;\n\n\tlet breakingColumn = firstLineBreakColumn;\n\tlet prevCharCode = lineText.charCodeAt(0);\n\tlet prevCharCodeClass = classifier.get(prevCharCode);\n\tlet visibleColumn = computeCharWidth(prevCharCode, 0, tabSize, columnsForFullWidthChar);\n\n\tlet startOffset = 1;\n\tif (strings.isHighSurrogate(prevCharCode)) {\n\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\tvisibleColumn += 1;\n\t\tprevCharCode = lineText.charCodeAt(1);\n\t\tprevCharCodeClass = classifier.get(prevCharCode);\n\t\tstartOffset++;\n\t}\n\n\tfor (let i = startOffset; i < len; i++) {\n\t\tconst charStartOffset = i;\n\t\tconst charCode = lineText.charCodeAt(i);\n\t\tlet charCodeClass: number;\n\t\tlet charWidth: number;\n\n\t\tif (strings.isHighSurrogate(charCode)) {\n\t\t\t// A surrogate pair must always be considered as a single unit, so it is never to be broken\n\t\t\ti++;\n\t\t\tcharCodeClass = CharacterClass.NONE;\n\t\t\tcharWidth = 2;\n\t\t} else {\n\t\t\tcharCodeClass = classifier.get(charCode);\n\t\t\tcharWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar);\n\t\t}\n\n\t\tif (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {\n\t\t\tbreakOffset = charStartOffset;\n\t\t\tbreakOffsetVisibleColumn = visibleColumn;\n\t\t}\n\n\t\tvisibleColumn += charWidth;\n\n\t\t// check if adding character at `i` will go over the breaking column\n\t\tif (visibleColumn > breakingColumn) {\n\t\t\t// We need to break at least before character at `i`:\n\n\t\t\tif (breakOffset === 0 || visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) {\n\t\t\t\t// Cannot break at `breakOffset`, must break at `i`\n\t\t\t\tbreakOffset = charStartOffset;\n\t\t\t\tbreakOffsetVisibleColumn = visibleColumn - charWidth;\n\t\t\t}\n\n\t\t\tbreakingOffsets[breakingOffsetsCount] = breakOffset;\n\t\t\tbreakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn;\n\t\t\tbreakingOffsetsCount++;\n\t\t\tbreakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn;\n\t\t\tbreakOffset = 0;\n\t\t}\n\n\t\tprevCharCode = charCode;\n\t\tprevCharCodeClass = charCodeClass;\n\t}\n\n\tif (breakingOffsetsCount === 0 && (!injectedTexts || injectedTexts.length === 0)) {\n\t\treturn null;\n\t}\n\n\t// Add last segment\n\tbreakingOffsets[breakingOffsetsCount] = len;\n\tbreakingOffsetsVisibleColumn[breakingOffsetsCount] = visibleColumn;\n\n\treturn new ModelLineProjectionData(injectionOffsets, injectionOptions, breakingOffsets, breakingOffsetsVisibleColumn, wrappedTextIndentLength);\n}\n\nfunction computeCharWidth(charCode: number, visibleColumn: number, tabSize: number, columnsForFullWidthChar: number): number {\n\tif (charCode === CharCode.Tab) {\n\t\treturn (tabSize - (visibleColumn % tabSize));\n\t}\n\tif (strings.isFullWidthCharacter(charCode)) {\n\t\treturn columnsForFullWidthChar;\n\t}\n\tif (charCode < 32) {\n\t\t// when using `editor.renderControlCharacters`, the substitutions are often wide\n\t\treturn columnsForFullWidthChar;\n\t}\n\treturn 1;\n}\n\nfunction tabCharacterWidth(visibleColumn: number, tabSize: number): number {\n\treturn (tabSize - (visibleColumn % tabSize));\n}\n\n/**\n * Kinsoku Shori : Don't break after a leading character, like an open bracket\n * Kinsoku Shori : Don't break before a trailing character, like a period\n */\nfunction canBreak(prevCharCode: number, prevCharCodeClass: CharacterClass, charCode: number, charCodeClass: CharacterClass): boolean {\n\treturn (\n\t\tcharCode !== CharCode.Space\n\t\t&& (\n\t\t\t(prevCharCodeClass === CharacterClass.BREAK_AFTER)\n\t\t\t|| (prevCharCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && charCodeClass !== CharacterClass.BREAK_AFTER)\n\t\t\t|| (charCodeClass === CharacterClass.BREAK_BEFORE)\n\t\t\t|| (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && prevCharCodeClass !== CharacterClass.BREAK_BEFORE)\n\t\t)\n\t);\n}\n\nfunction computeWrappedTextIndentLength(lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): number {\n\tlet wrappedTextIndentLength = 0;\n\tif (wrappingIndent !== WrappingIndent.None) {\n\t\tconst firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineText);\n\t\tif (firstNonWhitespaceIndex !== -1) {\n\t\t\t// Track existing indent\n\n\t\t\tfor (let i = 0; i < firstNonWhitespaceIndex; i++) {\n\t\t\t\tconst charWidth = (lineText.charCodeAt(i) === CharCode.Tab ? tabCharacterWidth(wrappedTextIndentLength, tabSize) : 1);\n\t\t\t\twrappedTextIndentLength += charWidth;\n\t\t\t}\n\n\t\t\t// Increase indent of continuation lines, if desired\n\t\t\tconst numberOfAdditionalTabs = (wrappingIndent === WrappingIndent.DeepIndent ? 2 : wrappingIndent === WrappingIndent.Indent ? 1 : 0);\n\t\t\tfor (let i = 0; i < numberOfAdditionalTabs; i++) {\n\t\t\t\tconst charWidth = tabCharacterWidth(wrappedTextIndentLength, tabSize);\n\t\t\t\twrappedTextIndentLength += charWidth;\n\t\t\t}\n\n\t\t\t// Force sticking to beginning of line if no character would fit except for the indentation\n\t\t\tif (wrappedTextIndentLength + columnsForFullWidthChar > firstLineBreakColumn) {\n\t\t\t\twrappedTextIndentLength = 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn wrappedTextIndentLength;\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\nconst enum Constants {\n\tMINIMUM_HEIGHT = 4\n}\n\nexport class ColorZone {\n\t_colorZoneBrand: void = undefined;\n\n\tpublic readonly from: number;\n\tpublic readonly to: number;\n\tpublic readonly colorId: number;\n\n\tconstructor(from: number, to: number, colorId: number) {\n\t\tthis.from = from | 0;\n\t\tthis.to = to | 0;\n\t\tthis.colorId = colorId | 0;\n\t}\n\n\tpublic static compare(a: ColorZone, b: ColorZone): number {\n\t\tif (a.colorId === b.colorId) {\n\t\t\tif (a.from === b.from) {\n\t\t\t\treturn a.to - b.to;\n\t\t\t}\n\t\t\treturn a.from - b.from;\n\t\t}\n\t\treturn a.colorId - b.colorId;\n\t}\n}\n\n/**\n * A zone in the overview ruler\n */\nexport class OverviewRulerZone {\n\t_overviewRulerZoneBrand: void = undefined;\n\n\tpublic readonly startLineNumber: number;\n\tpublic readonly endLineNumber: number;\n\t/**\n\t * If set to 0, the height in lines will be determined based on `endLineNumber`.\n\t */\n\tpublic readonly heightInLines: number;\n\tpublic readonly color: string;\n\n\tprivate _colorZone: ColorZone | null;\n\n\tconstructor(\n\t\tstartLineNumber: number,\n\t\tendLineNumber: number,\n\t\theightInLines: number,\n\t\tcolor: string\n\t) {\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumber = endLineNumber;\n\t\tthis.heightInLines = heightInLines;\n\t\tthis.color = color;\n\t\tthis._colorZone = null;\n\t}\n\n\tpublic static compare(a: OverviewRulerZone, b: OverviewRulerZone): number {\n\t\tif (a.color === b.color) {\n\t\t\tif (a.startLineNumber === b.startLineNumber) {\n\t\t\t\tif (a.heightInLines === b.heightInLines) {\n\t\t\t\t\treturn a.endLineNumber - b.endLineNumber;\n\t\t\t\t}\n\t\t\t\treturn a.heightInLines - b.heightInLines;\n\t\t\t}\n\t\t\treturn a.startLineNumber - b.startLineNumber;\n\t\t}\n\t\treturn a.color < b.color ? -1 : 1;\n\t}\n\n\tpublic setColorZone(colorZone: ColorZone): void {\n\t\tthis._colorZone = colorZone;\n\t}\n\n\tpublic getColorZones(): ColorZone | null {\n\t\treturn this._colorZone;\n\t}\n}\n\nexport class OverviewZoneManager {\n\n\tprivate readonly _getVerticalOffsetForLine: (lineNumber: number) => number;\n\tprivate _zones: OverviewRulerZone[];\n\tprivate _colorZonesInvalid: boolean;\n\tprivate _lineHeight: number;\n\tprivate _domWidth: number;\n\tprivate _domHeight: number;\n\tprivate _outerHeight: number;\n\tprivate _pixelRatio: number;\n\n\tprivate _lastAssignedId: number;\n\tprivate readonly _color2Id: { [color: string]: number };\n\tprivate readonly _id2Color: string[];\n\n\tconstructor(getVerticalOffsetForLine: (lineNumber: number) => number) {\n\t\tthis._getVerticalOffsetForLine = getVerticalOffsetForLine;\n\t\tthis._zones = [];\n\t\tthis._colorZonesInvalid = false;\n\t\tthis._lineHeight = 0;\n\t\tthis._domWidth = 0;\n\t\tthis._domHeight = 0;\n\t\tthis._outerHeight = 0;\n\t\tthis._pixelRatio = 1;\n\n\t\tthis._lastAssignedId = 0;\n\t\tthis._color2Id = Object.create(null);\n\t\tthis._id2Color = [];\n\t}\n\n\tpublic getId2Color(): string[] {\n\t\treturn this._id2Color;\n\t}\n\n\tpublic setZones(newZones: OverviewRulerZone[]): void {\n\t\tthis._zones = newZones;\n\t\tthis._zones.sort(OverviewRulerZone.compare);\n\t}\n\n\tpublic setLineHeight(lineHeight: number): boolean {\n\t\tif (this._lineHeight === lineHeight) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._lineHeight = lineHeight;\n\t\tthis._colorZonesInvalid = true;\n\t\treturn true;\n\t}\n\n\tpublic setPixelRatio(pixelRatio: number): void {\n\t\tthis._pixelRatio = pixelRatio;\n\t\tthis._colorZonesInvalid = true;\n\t}\n\n\tpublic getDOMWidth(): number {\n\t\treturn this._domWidth;\n\t}\n\n\tpublic getCanvasWidth(): number {\n\t\treturn this._domWidth * this._pixelRatio;\n\t}\n\n\tpublic setDOMWidth(width: number): boolean {\n\t\tif (this._domWidth === width) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._domWidth = width;\n\t\tthis._colorZonesInvalid = true;\n\t\treturn true;\n\t}\n\n\tpublic getDOMHeight(): number {\n\t\treturn this._domHeight;\n\t}\n\n\tpublic getCanvasHeight(): number {\n\t\treturn this._domHeight * this._pixelRatio;\n\t}\n\n\tpublic setDOMHeight(height: number): boolean {\n\t\tif (this._domHeight === height) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._domHeight = height;\n\t\tthis._colorZonesInvalid = true;\n\t\treturn true;\n\t}\n\n\tpublic getOuterHeight(): number {\n\t\treturn this._outerHeight;\n\t}\n\n\tpublic setOuterHeight(outerHeight: number): boolean {\n\t\tif (this._outerHeight === outerHeight) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._outerHeight = outerHeight;\n\t\tthis._colorZonesInvalid = true;\n\t\treturn true;\n\t}\n\n\tpublic resolveColorZones(): ColorZone[] {\n\t\tconst colorZonesInvalid = this._colorZonesInvalid;\n\t\tconst lineHeight = Math.floor(this._lineHeight);\n\t\tconst totalHeight = Math.floor(this.getCanvasHeight());\n\t\tconst outerHeight = Math.floor(this._outerHeight);\n\t\tconst heightRatio = totalHeight / outerHeight;\n\t\tconst halfMinimumHeight = Math.floor(Constants.MINIMUM_HEIGHT * this._pixelRatio / 2);\n\n\t\tconst allColorZones: ColorZone[] = [];\n\t\tfor (let i = 0, len = this._zones.length; i < len; i++) {\n\t\t\tconst zone = this._zones[i];\n\n\t\t\tif (!colorZonesInvalid) {\n\t\t\t\tconst colorZone = zone.getColorZones();\n\t\t\t\tif (colorZone) {\n\t\t\t\t\tallColorZones.push(colorZone);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst offset1 = this._getVerticalOffsetForLine(zone.startLineNumber);\n\t\t\tconst offset2 = (\n\t\t\t\tzone.heightInLines === 0\n\t\t\t\t\t? this._getVerticalOffsetForLine(zone.endLineNumber) + lineHeight\n\t\t\t\t\t: offset1 + zone.heightInLines * lineHeight\n\t\t\t);\n\n\t\t\tconst y1 = Math.floor(heightRatio * offset1);\n\t\t\tconst y2 = Math.floor(heightRatio * offset2);\n\n\t\t\tlet ycenter = Math.floor((y1 + y2) / 2);\n\t\t\tlet halfHeight = (y2 - ycenter);\n\n\t\t\tif (halfHeight < halfMinimumHeight) {\n\t\t\t\thalfHeight = halfMinimumHeight;\n\t\t\t}\n\n\t\t\tif (ycenter - halfHeight < 0) {\n\t\t\t\tycenter = halfHeight;\n\t\t\t}\n\t\t\tif (ycenter + halfHeight > totalHeight) {\n\t\t\t\tycenter = totalHeight - halfHeight;\n\t\t\t}\n\n\t\t\tconst color = zone.color;\n\t\t\tlet colorId = this._color2Id[color];\n\t\t\tif (!colorId) {\n\t\t\t\tcolorId = (++this._lastAssignedId);\n\t\t\t\tthis._color2Id[color] = colorId;\n\t\t\t\tthis._id2Color[colorId] = color;\n\t\t\t}\n\t\t\tconst colorZone = new ColorZone(ycenter - halfHeight, ycenter + halfHeight, colorId);\n\n\t\t\tzone.setColorZone(colorZone);\n\t\t\tallColorZones.push(colorZone);\n\t\t}\n\n\t\tthis._colorZonesInvalid = false;\n\n\t\tallColorZones.sort(ColorZone.compare);\n\t\treturn allColorZones;\n\t}\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IOverviewRuler } from 'vs/editor/browser/editorBrowser';\nimport { OverviewRulerPosition, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ColorZone, OverviewRulerZone, OverviewZoneManager } from 'vs/editor/common/viewModel/overviewZoneManager';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\n\nexport class OverviewRuler extends ViewEventHandler implements IOverviewRuler {\n\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _domNode: FastDomNode<HTMLCanvasElement>;\n\tprivate readonly _zoneManager: OverviewZoneManager;\n\n\tconstructor(context: ViewContext, cssClassName: string) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tconst options = this._context.configuration.options;\n\n\t\tthis._domNode = createFastDomNode(document.createElement('canvas'));\n\t\tthis._domNode.setClassName(cssClassName);\n\t\tthis._domNode.setPosition('absolute');\n\t\tthis._domNode.setLayerHinting(true);\n\t\tthis._domNode.setContain('strict');\n\n\t\tthis._zoneManager = new OverviewZoneManager((lineNumber: number) => this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber));\n\t\tthis._zoneManager.setDOMWidth(0);\n\t\tthis._zoneManager.setDOMHeight(0);\n\t\tthis._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight());\n\t\tthis._zoneManager.setLineHeight(options.get(EditorOption.lineHeight));\n\n\t\tthis._zoneManager.setPixelRatio(options.get(EditorOption.pixelRatio));\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (e.hasChanged(EditorOption.lineHeight)) {\n\t\t\tthis._zoneManager.setLineHeight(options.get(EditorOption.lineHeight));\n\t\t\tthis._render();\n\t\t}\n\n\t\tif (e.hasChanged(EditorOption.pixelRatio)) {\n\t\t\tthis._zoneManager.setPixelRatio(options.get(EditorOption.pixelRatio));\n\t\t\tthis._domNode.setWidth(this._zoneManager.getDOMWidth());\n\t\t\tthis._domNode.setHeight(this._zoneManager.getDOMHeight());\n\t\t\tthis._domNode.domNode.width = this._zoneManager.getCanvasWidth();\n\t\t\tthis._domNode.domNode.height = this._zoneManager.getCanvasHeight();\n\t\t\tthis._render();\n\t\t}\n\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tthis._render();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tif (e.scrollHeightChanged) {\n\t\t\tthis._zoneManager.setOuterHeight(e.scrollHeight);\n\t\t\tthis._render();\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\tthis._render();\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode.domNode;\n\t}\n\n\tpublic setLayout(position: OverviewRulerPosition): void {\n\t\tthis._domNode.setTop(position.top);\n\t\tthis._domNode.setRight(position.right);\n\n\t\tlet hasChanged = false;\n\t\thasChanged = this._zoneManager.setDOMWidth(position.width) || hasChanged;\n\t\thasChanged = this._zoneManager.setDOMHeight(position.height) || hasChanged;\n\n\t\tif (hasChanged) {\n\t\t\tthis._domNode.setWidth(this._zoneManager.getDOMWidth());\n\t\t\tthis._domNode.setHeight(this._zoneManager.getDOMHeight());\n\t\t\tthis._domNode.domNode.width = this._zoneManager.getCanvasWidth();\n\t\t\tthis._domNode.domNode.height = this._zoneManager.getCanvasHeight();\n\n\t\t\tthis._render();\n\t\t}\n\t}\n\n\tpublic setZones(zones: OverviewRulerZone[]): void {\n\t\tthis._zoneManager.setZones(zones);\n\t\tthis._render();\n\t}\n\n\tprivate _render(): boolean {\n\t\tif (this._zoneManager.getOuterHeight() === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst width = this._zoneManager.getCanvasWidth();\n\t\tconst height = this._zoneManager.getCanvasHeight();\n\n\t\tconst colorZones = this._zoneManager.resolveColorZones();\n\t\tconst id2Color = this._zoneManager.getId2Color();\n\n\t\tconst ctx = this._domNode.domNode.getContext('2d')!;\n\t\tctx.clearRect(0, 0, width, height);\n\t\tif (colorZones.length > 0) {\n\t\t\tthis._renderOneLane(ctx, colorZones, id2Color, width);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _renderOneLane(ctx: CanvasRenderingContext2D, colorZones: ColorZone[], id2Color: string[], width: number): void {\n\n\t\tlet currentColorId = 0;\n\t\tlet currentFrom = 0;\n\t\tlet currentTo = 0;\n\n\t\tfor (const zone of colorZones) {\n\n\t\t\tconst zoneColorId = zone.colorId;\n\t\t\tconst zoneFrom = zone.from;\n\t\t\tconst zoneTo = zone.to;\n\n\t\t\tif (zoneColorId !== currentColorId) {\n\t\t\t\tctx.fillRect(0, currentFrom, width, currentTo - currentFrom);\n\n\t\t\t\tcurrentColorId = zoneColorId;\n\t\t\t\tctx.fillStyle = id2Color[currentColorId];\n\t\t\t\tcurrentFrom = zoneFrom;\n\t\t\t\tcurrentTo = zoneTo;\n\t\t\t} else {\n\t\t\t\tif (currentTo >= zoneFrom) {\n\t\t\t\t\tcurrentTo = Math.max(currentTo, zoneTo);\n\t\t\t\t} else {\n\t\t\t\t\tctx.fillRect(0, currentFrom, width, currentTo - currentFrom);\n\t\t\t\t\tcurrentFrom = zoneFrom;\n\t\t\t\t\tcurrentTo = zoneTo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tctx.fillRect(0, currentFrom, width, currentTo - currentFrom);\n\n\t}\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 { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\nimport { IViewLayout, IViewModel } from 'vs/editor/common/viewModel';\nimport { IColorTheme } from 'vs/platform/theme/common/themeService';\nimport { EditorTheme } from 'vs/editor/common/editorTheme';\n\nexport class ViewContext {\n\n\tpublic readonly configuration: IEditorConfiguration;\n\tpublic readonly viewModel: IViewModel;\n\tpublic readonly viewLayout: IViewLayout;\n\tpublic readonly theme: EditorTheme;\n\n\tconstructor(\n\t\tconfiguration: IEditorConfiguration,\n\t\ttheme: IColorTheme,\n\t\tmodel: IViewModel\n\t) {\n\t\tthis.configuration = configuration;\n\t\tthis.theme = new EditorTheme(theme);\n\t\tthis.viewModel = model;\n\t\tthis.viewLayout = model.viewLayout;\n\t}\n\n\tpublic addEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis.viewModel.addViewEventHandler(eventHandler);\n\t}\n\n\tpublic removeEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis.viewModel.removeViewEventHandler(eventHandler);\n\t}\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 { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\nimport { ViewEvent } from 'vs/editor/common/viewEvents';\nimport { IContentSizeChangedEvent } from 'vs/editor/common/editorCommon';\nimport { Emitter } from 'vs/base/common/event';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\n\nexport class ViewModelEventDispatcher extends Disposable {\n\n\tprivate readonly _onEvent = this._register(new Emitter<OutgoingViewModelEvent>());\n\tpublic readonly onEvent = this._onEvent.event;\n\n\tprivate readonly _eventHandlers: ViewEventHandler[];\n\tprivate _viewEventQueue: ViewEvent[] | null;\n\tprivate _isConsumingViewEventQueue: boolean;\n\tprivate _collector: ViewModelEventsCollector | null;\n\tprivate _collectorCnt: number;\n\tprivate _outgoingEvents: OutgoingViewModelEvent[];\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._eventHandlers = [];\n\t\tthis._viewEventQueue = null;\n\t\tthis._isConsumingViewEventQueue = false;\n\t\tthis._collector = null;\n\t\tthis._collectorCnt = 0;\n\t\tthis._outgoingEvents = [];\n\t}\n\n\tpublic emitOutgoingEvent(e: OutgoingViewModelEvent): void {\n\t\tthis._addOutgoingEvent(e);\n\t\tthis._emitOutgoingEvents();\n\t}\n\n\tprivate _addOutgoingEvent(e: OutgoingViewModelEvent): void {\n\t\tfor (let i = 0, len = this._outgoingEvents.length; i < len; i++) {\n\t\t\tif (this._outgoingEvents[i].kind === e.kind) {\n\t\t\t\tthis._outgoingEvents[i] = this._outgoingEvents[i].merge(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// not merged\n\t\tthis._outgoingEvents.push(e);\n\t}\n\n\tprivate _emitOutgoingEvents(): void {\n\t\twhile (this._outgoingEvents.length > 0) {\n\t\t\tif (this._collector || this._isConsumingViewEventQueue) {\n\t\t\t\t// right now collecting or emitting view events, so let's postpone emitting\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst event = this._outgoingEvents.shift()!;\n\t\t\tif (event.isNoOp()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._onEvent.fire(event);\n\t\t}\n\t}\n\n\tpublic addViewEventHandler(eventHandler: ViewEventHandler): void {\n\t\tfor (let i = 0, len = this._eventHandlers.length; i < len; i++) {\n\t\t\tif (this._eventHandlers[i] === eventHandler) {\n\t\t\t\tconsole.warn('Detected duplicate listener in ViewEventDispatcher', eventHandler);\n\t\t\t}\n\t\t}\n\t\tthis._eventHandlers.push(eventHandler);\n\t}\n\n\tpublic removeViewEventHandler(eventHandler: ViewEventHandler): void {\n\t\tfor (let i = 0; i < this._eventHandlers.length; i++) {\n\t\t\tif (this._eventHandlers[i] === eventHandler) {\n\t\t\t\tthis._eventHandlers.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic beginEmitViewEvents(): ViewModelEventsCollector {\n\t\tthis._collectorCnt++;\n\t\tif (this._collectorCnt === 1) {\n\t\t\tthis._collector = new ViewModelEventsCollector();\n\t\t}\n\t\treturn this._collector!;\n\t}\n\n\tpublic endEmitViewEvents(): void {\n\t\tthis._collectorCnt--;\n\t\tif (this._collectorCnt === 0) {\n\t\t\tconst outgoingEvents = this._collector!.outgoingEvents;\n\t\t\tconst viewEvents = this._collector!.viewEvents;\n\t\t\tthis._collector = null;\n\n\t\t\tfor (const outgoingEvent of outgoingEvents) {\n\t\t\t\tthis._addOutgoingEvent(outgoingEvent);\n\t\t\t}\n\n\t\t\tif (viewEvents.length > 0) {\n\t\t\t\tthis._emitMany(viewEvents);\n\t\t\t}\n\t\t}\n\t\tthis._emitOutgoingEvents();\n\t}\n\n\tpublic emitSingleViewEvent(event: ViewEvent): void {\n\t\ttry {\n\t\t\tconst eventsCollector = this.beginEmitViewEvents();\n\t\t\teventsCollector.emitViewEvent(event);\n\t\t} finally {\n\t\t\tthis.endEmitViewEvents();\n\t\t}\n\t}\n\n\tprivate _emitMany(events: ViewEvent[]): void {\n\t\tif (this._viewEventQueue) {\n\t\t\tthis._viewEventQueue = this._viewEventQueue.concat(events);\n\t\t} else {\n\t\t\tthis._viewEventQueue = events;\n\t\t}\n\n\t\tif (!this._isConsumingViewEventQueue) {\n\t\t\tthis._consumeViewEventQueue();\n\t\t}\n\t}\n\n\tprivate _consumeViewEventQueue(): void {\n\t\ttry {\n\t\t\tthis._isConsumingViewEventQueue = true;\n\t\t\tthis._doConsumeQueue();\n\t\t} finally {\n\t\t\tthis._isConsumingViewEventQueue = false;\n\t\t}\n\t}\n\n\tprivate _doConsumeQueue(): void {\n\t\twhile (this._viewEventQueue) {\n\t\t\t// Empty event queue, as events might come in while sending these off\n\t\t\tconst events = this._viewEventQueue;\n\t\t\tthis._viewEventQueue = null;\n\n\t\t\t// Use a clone of the event handlers list, as they might remove themselves\n\t\t\tconst eventHandlers = this._eventHandlers.slice(0);\n\t\t\tfor (const eventHandler of eventHandlers) {\n\t\t\t\teventHandler.handleEvents(events);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class ViewModelEventsCollector {\n\n\tpublic readonly viewEvents: ViewEvent[];\n\tpublic readonly outgoingEvents: OutgoingViewModelEvent[];\n\n\tconstructor() {\n\t\tthis.viewEvents = [];\n\t\tthis.outgoingEvents = [];\n\t}\n\n\tpublic emitViewEvent(event: ViewEvent) {\n\t\tthis.viewEvents.push(event);\n\t}\n\n\tpublic emitOutgoingEvent(e: OutgoingViewModelEvent): void {\n\t\tthis.outgoingEvents.push(e);\n\t}\n}\n\nexport type OutgoingViewModelEvent = (\n\tContentSizeChangedEvent\n\t| FocusChangedEvent\n\t| ScrollChangedEvent\n\t| ViewZonesChangedEvent\n\t| HiddenAreasChangedEvent\n\t| ReadOnlyEditAttemptEvent\n\t| CursorStateChangedEvent\n);\n\nexport const enum OutgoingViewModelEventKind {\n\tContentSizeChanged,\n\tFocusChanged,\n\tScrollChanged,\n\tViewZonesChanged,\n\tHiddenAreasChanged,\n\tReadOnlyEditAttempt,\n\tCursorStateChanged,\n}\n\nexport class ContentSizeChangedEvent implements IContentSizeChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.ContentSizeChanged;\n\n\tprivate readonly _oldContentWidth: number;\n\tprivate readonly _oldContentHeight: number;\n\n\treadonly contentWidth: number;\n\treadonly contentHeight: number;\n\treadonly contentWidthChanged: boolean;\n\treadonly contentHeightChanged: boolean;\n\n\tconstructor(oldContentWidth: number, oldContentHeight: number, contentWidth: number, contentHeight: number) {\n\t\tthis._oldContentWidth = oldContentWidth;\n\t\tthis._oldContentHeight = oldContentHeight;\n\t\tthis.contentWidth = contentWidth;\n\t\tthis.contentHeight = contentHeight;\n\t\tthis.contentWidthChanged = (this._oldContentWidth !== this.contentWidth);\n\t\tthis.contentHeightChanged = (this._oldContentHeight !== this.contentHeight);\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn (!this.contentWidthChanged && !this.contentHeightChanged);\n\t}\n\n\n\tpublic merge(other: OutgoingViewModelEvent): ContentSizeChangedEvent {\n\t\tif (other.kind !== OutgoingViewModelEventKind.ContentSizeChanged) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new ContentSizeChangedEvent(this._oldContentWidth, this._oldContentHeight, other.contentWidth, other.contentHeight);\n\t}\n}\n\nexport class FocusChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.FocusChanged;\n\n\treadonly oldHasFocus: boolean;\n\treadonly hasFocus: boolean;\n\n\tconstructor(oldHasFocus: boolean, hasFocus: boolean) {\n\t\tthis.oldHasFocus = oldHasFocus;\n\t\tthis.hasFocus = hasFocus;\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn (this.oldHasFocus === this.hasFocus);\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): FocusChangedEvent {\n\t\tif (other.kind !== OutgoingViewModelEventKind.FocusChanged) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new FocusChangedEvent(this.oldHasFocus, other.hasFocus);\n\t}\n}\n\nexport class ScrollChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.ScrollChanged;\n\n\tprivate readonly _oldScrollWidth: number;\n\tprivate readonly _oldScrollLeft: number;\n\tprivate readonly _oldScrollHeight: number;\n\tprivate readonly _oldScrollTop: number;\n\n\tpublic readonly scrollWidth: number;\n\tpublic readonly scrollLeft: number;\n\tpublic readonly scrollHeight: number;\n\tpublic readonly scrollTop: number;\n\n\tpublic readonly scrollWidthChanged: boolean;\n\tpublic readonly scrollLeftChanged: boolean;\n\tpublic readonly scrollHeightChanged: boolean;\n\tpublic readonly scrollTopChanged: boolean;\n\n\tconstructor(\n\t\toldScrollWidth: number, oldScrollLeft: number, oldScrollHeight: number, oldScrollTop: number,\n\t\tscrollWidth: number, scrollLeft: number, scrollHeight: number, scrollTop: number,\n\t) {\n\t\tthis._oldScrollWidth = oldScrollWidth;\n\t\tthis._oldScrollLeft = oldScrollLeft;\n\t\tthis._oldScrollHeight = oldScrollHeight;\n\t\tthis._oldScrollTop = oldScrollTop;\n\n\t\tthis.scrollWidth = scrollWidth;\n\t\tthis.scrollLeft = scrollLeft;\n\t\tthis.scrollHeight = scrollHeight;\n\t\tthis.scrollTop = scrollTop;\n\n\t\tthis.scrollWidthChanged = (this._oldScrollWidth !== this.scrollWidth);\n\t\tthis.scrollLeftChanged = (this._oldScrollLeft !== this.scrollLeft);\n\t\tthis.scrollHeightChanged = (this._oldScrollHeight !== this.scrollHeight);\n\t\tthis.scrollTopChanged = (this._oldScrollTop !== this.scrollTop);\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn (!this.scrollWidthChanged && !this.scrollLeftChanged && !this.scrollHeightChanged && !this.scrollTopChanged);\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): ScrollChangedEvent {\n\t\tif (other.kind !== OutgoingViewModelEventKind.ScrollChanged) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new ScrollChangedEvent(\n\t\t\tthis._oldScrollWidth, this._oldScrollLeft, this._oldScrollHeight, this._oldScrollTop,\n\t\t\tother.scrollWidth, other.scrollLeft, other.scrollHeight, other.scrollTop\n\t\t);\n\t}\n}\n\nexport class ViewZonesChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.ViewZonesChanged;\n\n\tconstructor() {\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): ViewZonesChangedEvent {\n\t\treturn this;\n\t}\n}\n\nexport class HiddenAreasChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.HiddenAreasChanged;\n\n\tconstructor() {\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): HiddenAreasChangedEvent {\n\t\treturn this;\n\t}\n}\n\nexport class CursorStateChangedEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.CursorStateChanged;\n\n\tpublic readonly oldSelections: Selection[] | null;\n\tpublic readonly selections: Selection[];\n\tpublic readonly oldModelVersionId: number;\n\tpublic readonly modelVersionId: number;\n\tpublic readonly source: string;\n\tpublic readonly reason: CursorChangeReason;\n\tpublic readonly reachedMaxCursorCount: boolean;\n\n\tconstructor(oldSelections: Selection[] | null, selections: Selection[], oldModelVersionId: number, modelVersionId: number, source: string, reason: CursorChangeReason, reachedMaxCursorCount: boolean) {\n\t\tthis.oldSelections = oldSelections;\n\t\tthis.selections = selections;\n\t\tthis.oldModelVersionId = oldModelVersionId;\n\t\tthis.modelVersionId = modelVersionId;\n\t\tthis.source = source;\n\t\tthis.reason = reason;\n\t\tthis.reachedMaxCursorCount = reachedMaxCursorCount;\n\t}\n\n\tprivate static _selectionsAreEqual(a: Selection[] | null, b: Selection[] | null): boolean {\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!a || !b) {\n\t\t\treturn false;\n\t\t}\n\t\tconst aLen = a.length;\n\t\tconst bLen = b.length;\n\t\tif (aLen !== bLen) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < aLen; i++) {\n\t\t\tif (!a[i].equalsSelection(b[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn (\n\t\t\tCursorStateChangedEvent._selectionsAreEqual(this.oldSelections, this.selections)\n\t\t\t&& this.oldModelVersionId === this.modelVersionId\n\t\t);\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): CursorStateChangedEvent {\n\t\tif (other.kind !== OutgoingViewModelEventKind.CursorStateChanged) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new CursorStateChangedEvent(\n\t\t\tthis.oldSelections, other.selections, this.oldModelVersionId, other.modelVersionId, other.source, other.reason, this.reachedMaxCursorCount || other.reachedMaxCursorCount\n\t\t);\n\t}\n}\n\nexport class ReadOnlyEditAttemptEvent {\n\n\tpublic readonly kind = OutgoingViewModelEventKind.ReadOnlyEditAttempt;\n\n\tconstructor() {\n\t}\n\n\tpublic isNoOp(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic merge(other: OutgoingViewModelEvent): ReadOnlyEditAttemptEvent {\n\t\treturn this;\n\t}\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, Emitter } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility, INewScrollPosition } from 'vs/base/common/scrollable';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { LinesLayout } from 'vs/editor/common/viewLayout/linesLayout';\nimport { IEditorWhitespace, IPartialViewLinesViewportData, IViewLayout, IViewWhitespaceViewportData, IWhitespaceChangeAccessor, Viewport } from 'vs/editor/common/viewModel';\nimport { ContentSizeChangedEvent } from 'vs/editor/common/viewModelEventDispatcher';\n\nconst SMOOTH_SCROLLING_TIME = 125;\n\nclass EditorScrollDimensions {\n\n\tpublic readonly width: number;\n\tpublic readonly contentWidth: number;\n\tpublic readonly scrollWidth: number;\n\n\tpublic readonly height: number;\n\tpublic readonly contentHeight: number;\n\tpublic readonly scrollHeight: number;\n\n\tconstructor(\n\t\twidth: number,\n\t\tcontentWidth: number,\n\t\theight: number,\n\t\tcontentHeight: number,\n\t) {\n\t\twidth = width | 0;\n\t\tcontentWidth = contentWidth | 0;\n\t\theight = height | 0;\n\t\tcontentHeight = contentHeight | 0;\n\n\t\tif (width < 0) {\n\t\t\twidth = 0;\n\t\t}\n\t\tif (contentWidth < 0) {\n\t\t\tcontentWidth = 0;\n\t\t}\n\n\t\tif (height < 0) {\n\t\t\theight = 0;\n\t\t}\n\t\tif (contentHeight < 0) {\n\t\t\tcontentHeight = 0;\n\t\t}\n\n\t\tthis.width = width;\n\t\tthis.contentWidth = contentWidth;\n\t\tthis.scrollWidth = Math.max(width, contentWidth);\n\n\t\tthis.height = height;\n\t\tthis.contentHeight = contentHeight;\n\t\tthis.scrollHeight = Math.max(height, contentHeight);\n\t}\n\n\tpublic equals(other: EditorScrollDimensions): boolean {\n\t\treturn (\n\t\t\tthis.width === other.width\n\t\t\t&& this.contentWidth === other.contentWidth\n\t\t\t&& this.height === other.height\n\t\t\t&& this.contentHeight === other.contentHeight\n\t\t);\n\t}\n}\n\nclass EditorScrollable extends Disposable {\n\n\tprivate readonly _scrollable: Scrollable;\n\tprivate _dimensions: EditorScrollDimensions;\n\n\tpublic readonly onDidScroll: Event<ScrollEvent>;\n\n\tprivate readonly _onDidContentSizeChange = this._register(new Emitter<ContentSizeChangedEvent>());\n\tpublic readonly onDidContentSizeChange: Event<ContentSizeChangedEvent> = this._onDidContentSizeChange.event;\n\n\tconstructor(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {\n\t\tsuper();\n\t\tthis._dimensions = new EditorScrollDimensions(0, 0, 0, 0);\n\t\tthis._scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration,\n\t\t\tscheduleAtNextAnimationFrame\n\t\t}));\n\t\tthis.onDidScroll = this._scrollable.onScroll;\n\t}\n\n\tpublic getScrollable(): Scrollable {\n\t\treturn this._scrollable;\n\t}\n\n\tpublic setSmoothScrollDuration(smoothScrollDuration: number): void {\n\t\tthis._scrollable.setSmoothScrollDuration(smoothScrollDuration);\n\t}\n\n\tpublic validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition {\n\t\treturn this._scrollable.validateScrollPosition(scrollPosition);\n\t}\n\n\tpublic getScrollDimensions(): EditorScrollDimensions {\n\t\treturn this._dimensions;\n\t}\n\n\tpublic setScrollDimensions(dimensions: EditorScrollDimensions): void {\n\t\tif (this._dimensions.equals(dimensions)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldDimensions = this._dimensions;\n\t\tthis._dimensions = dimensions;\n\n\t\tthis._scrollable.setScrollDimensions({\n\t\t\twidth: dimensions.width,\n\t\t\tscrollWidth: dimensions.scrollWidth,\n\t\t\theight: dimensions.height,\n\t\t\tscrollHeight: dimensions.scrollHeight\n\t\t}, true);\n\n\t\tconst contentWidthChanged = (oldDimensions.contentWidth !== dimensions.contentWidth);\n\t\tconst contentHeightChanged = (oldDimensions.contentHeight !== dimensions.contentHeight);\n\t\tif (contentWidthChanged || contentHeightChanged) {\n\t\t\tthis._onDidContentSizeChange.fire(new ContentSizeChangedEvent(\n\t\t\t\toldDimensions.contentWidth, oldDimensions.contentHeight,\n\t\t\t\tdimensions.contentWidth, dimensions.contentHeight\n\t\t\t));\n\t\t}\n\t}\n\n\tpublic getFutureScrollPosition(): IScrollPosition {\n\t\treturn this._scrollable.getFutureScrollPosition();\n\t}\n\n\tpublic getCurrentScrollPosition(): IScrollPosition {\n\t\treturn this._scrollable.getCurrentScrollPosition();\n\t}\n\n\tpublic setScrollPositionNow(update: INewScrollPosition): void {\n\t\tthis._scrollable.setScrollPositionNow(update);\n\t}\n\n\tpublic setScrollPositionSmooth(update: INewScrollPosition): void {\n\t\tthis._scrollable.setScrollPositionSmooth(update);\n\t}\n}\n\nexport class ViewLayout extends Disposable implements IViewLayout {\n\n\tprivate readonly _configuration: IEditorConfiguration;\n\tprivate readonly _linesLayout: LinesLayout;\n\n\tprivate readonly _scrollable: EditorScrollable;\n\tpublic readonly onDidScroll: Event<ScrollEvent>;\n\tpublic readonly onDidContentSizeChange: Event<ContentSizeChangedEvent>;\n\n\tconstructor(configuration: IEditorConfiguration, lineCount: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {\n\t\tsuper();\n\n\t\tthis._configuration = configuration;\n\t\tconst options = this._configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst padding = options.get(EditorOption.padding);\n\n\t\tthis._linesLayout = new LinesLayout(lineCount, options.get(EditorOption.lineHeight), padding.top, padding.bottom);\n\n\t\tthis._scrollable = this._register(new EditorScrollable(0, scheduleAtNextAnimationFrame));\n\t\tthis._configureSmoothScrollDuration();\n\n\t\tthis._scrollable.setScrollDimensions(new EditorScrollDimensions(\n\t\t\tlayoutInfo.contentWidth,\n\t\t\t0,\n\t\t\tlayoutInfo.height,\n\t\t\t0\n\t\t));\n\t\tthis.onDidScroll = this._scrollable.onDidScroll;\n\t\tthis.onDidContentSizeChange = this._scrollable.onDidContentSizeChange;\n\n\t\tthis._updateHeight();\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic getScrollable(): Scrollable {\n\t\treturn this._scrollable.getScrollable();\n\t}\n\n\tpublic onHeightMaybeChanged(): void {\n\t\tthis._updateHeight();\n\t}\n\n\tprivate _configureSmoothScrollDuration(): void {\n\t\tthis._scrollable.setSmoothScrollDuration(this._configuration.options.get(EditorOption.smoothScrolling) ? SMOOTH_SCROLLING_TIME : 0);\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onConfigurationChanged(e: ConfigurationChangedEvent): void {\n\t\tconst options = this._configuration.options;\n\t\tif (e.hasChanged(EditorOption.lineHeight)) {\n\t\t\tthis._linesLayout.setLineHeight(options.get(EditorOption.lineHeight));\n\t\t}\n\t\tif (e.hasChanged(EditorOption.padding)) {\n\t\t\tconst padding = options.get(EditorOption.padding);\n\t\t\tthis._linesLayout.setPadding(padding.top, padding.bottom);\n\t\t}\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tconst width = layoutInfo.contentWidth;\n\t\t\tconst height = layoutInfo.height;\n\t\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\t\tconst contentWidth = scrollDimensions.contentWidth;\n\t\t\tthis._scrollable.setScrollDimensions(new EditorScrollDimensions(\n\t\t\t\twidth,\n\t\t\t\tscrollDimensions.contentWidth,\n\t\t\t\theight,\n\t\t\t\tthis._getContentHeight(width, height, contentWidth)\n\t\t\t));\n\t\t} else {\n\t\t\tthis._updateHeight();\n\t\t}\n\t\tif (e.hasChanged(EditorOption.smoothScrolling)) {\n\t\t\tthis._configureSmoothScrollDuration();\n\t\t}\n\t}\n\tpublic onFlushed(lineCount: number): void {\n\t\tthis._linesLayout.onFlushed(lineCount);\n\t}\n\tpublic onLinesDeleted(fromLineNumber: number, toLineNumber: number): void {\n\t\tthis._linesLayout.onLinesDeleted(fromLineNumber, toLineNumber);\n\t}\n\tpublic onLinesInserted(fromLineNumber: number, toLineNumber: number): void {\n\t\tthis._linesLayout.onLinesInserted(fromLineNumber, toLineNumber);\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _getHorizontalScrollbarHeight(width: number, scrollWidth: number): number {\n\t\tconst options = this._configuration.options;\n\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\tif (scrollbar.horizontal === ScrollbarVisibility.Hidden) {\n\t\t\t// horizontal scrollbar not visible\n\t\t\treturn 0;\n\t\t}\n\t\tif (width >= scrollWidth) {\n\t\t\t// horizontal scrollbar not visible\n\t\t\treturn 0;\n\t\t}\n\t\treturn scrollbar.horizontalScrollbarSize;\n\t}\n\n\tprivate _getContentHeight(width: number, height: number, contentWidth: number): number {\n\t\tconst options = this._configuration.options;\n\n\t\tlet result = this._linesLayout.getLinesTotalHeight();\n\t\tif (options.get(EditorOption.scrollBeyondLastLine)) {\n\t\t\tresult += Math.max(0, height - options.get(EditorOption.lineHeight) - options.get(EditorOption.padding).bottom);\n\t\t} else {\n\t\t\tresult += this._getHorizontalScrollbarHeight(width, contentWidth);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _updateHeight(): void {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\tconst width = scrollDimensions.width;\n\t\tconst height = scrollDimensions.height;\n\t\tconst contentWidth = scrollDimensions.contentWidth;\n\t\tthis._scrollable.setScrollDimensions(new EditorScrollDimensions(\n\t\t\twidth,\n\t\t\tscrollDimensions.contentWidth,\n\t\t\theight,\n\t\t\tthis._getContentHeight(width, height, contentWidth)\n\t\t));\n\t}\n\n\t// ---- Layouting logic\n\n\tpublic getCurrentViewport(): Viewport {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\tconst currentScrollPosition = this._scrollable.getCurrentScrollPosition();\n\t\treturn new Viewport(\n\t\t\tcurrentScrollPosition.scrollTop,\n\t\t\tcurrentScrollPosition.scrollLeft,\n\t\t\tscrollDimensions.width,\n\t\t\tscrollDimensions.height\n\t\t);\n\t}\n\n\tpublic getFutureViewport(): Viewport {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\tconst currentScrollPosition = this._scrollable.getFutureScrollPosition();\n\t\treturn new Viewport(\n\t\t\tcurrentScrollPosition.scrollTop,\n\t\t\tcurrentScrollPosition.scrollLeft,\n\t\t\tscrollDimensions.width,\n\t\t\tscrollDimensions.height\n\t\t);\n\t}\n\n\tprivate _computeContentWidth(maxLineWidth: number): number {\n\t\tconst options = this._configuration.options;\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tif (wrappingInfo.isViewportWrapping) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tconst minimap = options.get(EditorOption.minimap);\n\t\t\tif (maxLineWidth > layoutInfo.contentWidth + fontInfo.typicalHalfwidthCharacterWidth) {\n\t\t\t\t// This is a case where viewport wrapping is on, but the line extends above the viewport\n\t\t\t\tif (minimap.enabled && minimap.side === 'right') {\n\t\t\t\t\t// We need to accomodate the scrollbar width\n\t\t\t\t\treturn maxLineWidth + layoutInfo.verticalScrollbarWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn maxLineWidth;\n\t\t} else {\n\t\t\tconst extraHorizontalSpace = options.get(EditorOption.scrollBeyondLastColumn) * fontInfo.typicalHalfwidthCharacterWidth;\n\t\t\tconst whitespaceMinWidth = this._linesLayout.getWhitespaceMinWidth();\n\t\t\treturn Math.max(maxLineWidth + extraHorizontalSpace, whitespaceMinWidth);\n\t\t}\n\t}\n\n\tpublic setMaxLineWidth(maxLineWidth: number): void {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\t// const newScrollWidth = ;\n\t\tthis._scrollable.setScrollDimensions(new EditorScrollDimensions(\n\t\t\tscrollDimensions.width,\n\t\t\tthis._computeContentWidth(maxLineWidth),\n\t\t\tscrollDimensions.height,\n\t\t\tscrollDimensions.contentHeight\n\t\t));\n\n\t\t// The height might depend on the fact that there is a horizontal scrollbar or not\n\t\tthis._updateHeight();\n\t}\n\n\t// ---- view state\n\n\tpublic saveState(): { scrollTop: number; scrollTopWithoutViewZones: number; scrollLeft: number } {\n\t\tconst currentScrollPosition = this._scrollable.getFutureScrollPosition();\n\t\tconst scrollTop = currentScrollPosition.scrollTop;\n\t\tconst firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop);\n\t\tconst whitespaceAboveFirstLine = this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(firstLineNumberInViewport);\n\t\treturn {\n\t\t\tscrollTop: scrollTop,\n\t\t\tscrollTopWithoutViewZones: scrollTop - whitespaceAboveFirstLine,\n\t\t\tscrollLeft: currentScrollPosition.scrollLeft\n\t\t};\n\t}\n\n\t// ----\n\tpublic changeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): boolean {\n\t\tconst hadAChange = this._linesLayout.changeWhitespace(callback);\n\t\tif (hadAChange) {\n\t\t\tthis.onHeightMaybeChanged();\n\t\t}\n\t\treturn hadAChange;\n\t}\n\tpublic getVerticalOffsetForLineNumber(lineNumber: number): number {\n\t\treturn this._linesLayout.getVerticalOffsetForLineNumber(lineNumber);\n\t}\n\tpublic isAfterLines(verticalOffset: number): boolean {\n\t\treturn this._linesLayout.isAfterLines(verticalOffset);\n\t}\n\tpublic isInTopPadding(verticalOffset: number): boolean {\n\t\treturn this._linesLayout.isInTopPadding(verticalOffset);\n\t}\n\tisInBottomPadding(verticalOffset: number): boolean {\n\t\treturn this._linesLayout.isInBottomPadding(verticalOffset);\n\t}\n\n\tpublic getLineNumberAtVerticalOffset(verticalOffset: number): number {\n\t\treturn this._linesLayout.getLineNumberAtOrAfterVerticalOffset(verticalOffset);\n\t}\n\n\tpublic getWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null {\n\t\treturn this._linesLayout.getWhitespaceAtVerticalOffset(verticalOffset);\n\t}\n\tpublic getLinesViewportData(): IPartialViewLinesViewportData {\n\t\tconst visibleBox = this.getCurrentViewport();\n\t\treturn this._linesLayout.getLinesViewportData(visibleBox.top, visibleBox.top + visibleBox.height);\n\t}\n\tpublic getLinesViewportDataAtScrollTop(scrollTop: number): IPartialViewLinesViewportData {\n\t\t// do some minimal validations on scrollTop\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\tif (scrollTop + scrollDimensions.height > scrollDimensions.scrollHeight) {\n\t\t\tscrollTop = scrollDimensions.scrollHeight - scrollDimensions.height;\n\t\t}\n\t\tif (scrollTop < 0) {\n\t\t\tscrollTop = 0;\n\t\t}\n\t\treturn this._linesLayout.getLinesViewportData(scrollTop, scrollTop + scrollDimensions.height);\n\t}\n\tpublic getWhitespaceViewportData(): IViewWhitespaceViewportData[] {\n\t\tconst visibleBox = this.getCurrentViewport();\n\t\treturn this._linesLayout.getWhitespaceViewportData(visibleBox.top, visibleBox.top + visibleBox.height);\n\t}\n\tpublic getWhitespaces(): IEditorWhitespace[] {\n\t\treturn this._linesLayout.getWhitespaces();\n\t}\n\n\t// ----\n\n\tpublic getContentWidth(): number {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\treturn scrollDimensions.contentWidth;\n\t}\n\tpublic getScrollWidth(): number {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\treturn scrollDimensions.scrollWidth;\n\t}\n\tpublic getContentHeight(): number {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\treturn scrollDimensions.contentHeight;\n\t}\n\tpublic getScrollHeight(): number {\n\t\tconst scrollDimensions = this._scrollable.getScrollDimensions();\n\t\treturn scrollDimensions.scrollHeight;\n\t}\n\n\tpublic getCurrentScrollLeft(): number {\n\t\tconst currentScrollPosition = this._scrollable.getCurrentScrollPosition();\n\t\treturn currentScrollPosition.scrollLeft;\n\t}\n\tpublic getCurrentScrollTop(): number {\n\t\tconst currentScrollPosition = this._scrollable.getCurrentScrollPosition();\n\t\treturn currentScrollPosition.scrollTop;\n\t}\n\n\tpublic validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition {\n\t\treturn this._scrollable.validateScrollPosition(scrollPosition);\n\t}\n\n\tpublic setScrollPosition(position: INewScrollPosition, type: ScrollType): void {\n\t\tif (type === ScrollType.Immediate) {\n\t\t\tthis._scrollable.setScrollPositionNow(position);\n\t\t} else {\n\t\t\tthis._scrollable.setScrollPositionSmooth(position);\n\t\t}\n\t}\n\n\tpublic deltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void {\n\t\tconst currentScrollPosition = this._scrollable.getCurrentScrollPosition();\n\t\tthis._scrollable.setScrollPositionNow({\n\t\t\tscrollLeft: currentScrollPosition.scrollLeft + deltaScrollLeft,\n\t\t\tscrollTop: currentScrollPosition.scrollTop + deltaScrollTop\n\t\t});\n\t}\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class MoveCaretCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _isMovingLeft: boolean;\n\n\tconstructor(selection: Selection, isMovingLeft: boolean) {\n\t\tthis._selection = selection;\n\t\tthis._isMovingLeft = isMovingLeft;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tif (this._selection.startLineNumber !== this._selection.endLineNumber || this._selection.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tconst lineNumber = this._selection.startLineNumber;\n\t\tconst startColumn = this._selection.startColumn;\n\t\tconst endColumn = this._selection.endColumn;\n\t\tif (this._isMovingLeft && startColumn === 1) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._isMovingLeft && endColumn === model.getLineMaxColumn(lineNumber)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isMovingLeft) {\n\t\t\tconst rangeBefore = new Range(lineNumber, startColumn - 1, lineNumber, startColumn);\n\t\t\tconst charBefore = model.getValueInRange(rangeBefore);\n\t\t\tbuilder.addEditOperation(rangeBefore, null);\n\t\t\tbuilder.addEditOperation(new Range(lineNumber, endColumn, lineNumber, endColumn), charBefore);\n\t\t} else {\n\t\t\tconst rangeAfter = new Range(lineNumber, endColumn, lineNumber, endColumn + 1);\n\t\t\tconst charAfter = model.getValueInRange(rangeAfter);\n\t\t\tbuilder.addEditOperation(rangeAfter, null);\n\t\t\tbuilder.addEditOperation(new Range(lineNumber, startColumn, lineNumber, startColumn), charAfter);\n\t\t}\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tif (this._isMovingLeft) {\n\t\t\treturn new Selection(this._selection.startLineNumber, this._selection.startColumn - 1, this._selection.endLineNumber, this._selection.endColumn - 1);\n\t\t} else {\n\t\t\treturn new Selection(this._selection.startLineNumber, this._selection.startColumn + 1, this._selection.endLineNumber, this._selection.endColumn + 1);\n\t\t}\n\t}\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 { Position } from 'vs/editor/common/core/position';\nimport { CodeAction, CodeActionTriggerType } from 'vs/editor/common/languages';\n\nexport class CodeActionKind {\n\tprivate static readonly sep = '.';\n\n\tpublic static readonly None = new CodeActionKind('@@none@@'); // Special code action that contains nothing\n\tpublic static readonly Empty = new CodeActionKind('');\n\tpublic static readonly QuickFix = new CodeActionKind('quickfix');\n\tpublic static readonly Refactor = new CodeActionKind('refactor');\n\tpublic static readonly Source = new CodeActionKind('source');\n\tpublic static readonly SourceOrganizeImports = CodeActionKind.Source.append('organizeImports');\n\tpublic static readonly SourceFixAll = CodeActionKind.Source.append('fixAll');\n\n\tconstructor(\n\t\tpublic readonly value: string\n\t) { }\n\n\tpublic equals(other: CodeActionKind): boolean {\n\t\treturn this.value === other.value;\n\t}\n\n\tpublic contains(other: CodeActionKind): boolean {\n\t\treturn this.equals(other) || this.value === '' || other.value.startsWith(this.value + CodeActionKind.sep);\n\t}\n\n\tpublic intersects(other: CodeActionKind): boolean {\n\t\treturn this.contains(other) || other.contains(this);\n\t}\n\n\tpublic append(part: string): CodeActionKind {\n\t\treturn new CodeActionKind(this.value + CodeActionKind.sep + part);\n\t}\n}\n\nexport const enum CodeActionAutoApply {\n\tIfSingle = 'ifSingle',\n\tFirst = 'first',\n\tNever = 'never',\n}\n\nexport interface CodeActionFilter {\n\treadonly include?: CodeActionKind;\n\treadonly excludes?: readonly CodeActionKind[];\n\treadonly includeSourceActions?: boolean;\n\treadonly onlyIncludePreferredActions?: boolean;\n}\n\nexport function mayIncludeActionsOfKind(filter: CodeActionFilter, providedKind: CodeActionKind): boolean {\n\t// A provided kind may be a subset or superset of our filtered kind.\n\tif (filter.include && !filter.include.intersects(providedKind)) {\n\t\treturn false;\n\t}\n\n\tif (filter.excludes) {\n\t\tif (filter.excludes.some(exclude => excludesAction(providedKind, exclude, filter.include))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Don't return source actions unless they are explicitly requested\n\tif (!filter.includeSourceActions && CodeActionKind.Source.contains(providedKind)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport function filtersAction(filter: CodeActionFilter, action: CodeAction): boolean {\n\tconst actionKind = action.kind ? new CodeActionKind(action.kind) : undefined;\n\n\t// Filter out actions by kind\n\tif (filter.include) {\n\t\tif (!actionKind || !filter.include.contains(actionKind)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (filter.excludes) {\n\t\tif (actionKind && filter.excludes.some(exclude => excludesAction(actionKind, exclude, filter.include))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Don't return source actions unless they are explicitly requested\n\tif (!filter.includeSourceActions) {\n\t\tif (actionKind && CodeActionKind.Source.contains(actionKind)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (filter.onlyIncludePreferredActions) {\n\t\tif (!action.isPreferred) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction excludesAction(providedKind: CodeActionKind, exclude: CodeActionKind, include: CodeActionKind | undefined): boolean {\n\tif (!exclude.contains(providedKind)) {\n\t\treturn false;\n\t}\n\tif (include && exclude.contains(include)) {\n\t\t// The include is more specific, don't filter out\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nexport interface CodeActionTrigger {\n\treadonly type: CodeActionTriggerType;\n\treadonly filter?: CodeActionFilter;\n\treadonly autoApply?: CodeActionAutoApply;\n\treadonly context?: {\n\t\treadonly notAvailableMessage: string;\n\t\treadonly position: Position;\n\t};\n}\n\nexport class CodeActionCommandArgs {\n\tpublic static fromUser(arg: any, defaults: { kind: CodeActionKind; apply: CodeActionAutoApply }): CodeActionCommandArgs {\n\t\tif (!arg || typeof arg !== 'object') {\n\t\t\treturn new CodeActionCommandArgs(defaults.kind, defaults.apply, false);\n\t\t}\n\t\treturn new CodeActionCommandArgs(\n\t\t\tCodeActionCommandArgs.getKindFromUser(arg, defaults.kind),\n\t\t\tCodeActionCommandArgs.getApplyFromUser(arg, defaults.apply),\n\t\t\tCodeActionCommandArgs.getPreferredUser(arg));\n\t}\n\n\tprivate static getApplyFromUser(arg: any, defaultAutoApply: CodeActionAutoApply) {\n\t\tswitch (typeof arg.apply === 'string' ? arg.apply.toLowerCase() : '') {\n\t\t\tcase 'first': return CodeActionAutoApply.First;\n\t\t\tcase 'never': return CodeActionAutoApply.Never;\n\t\t\tcase 'ifsingle': return CodeActionAutoApply.IfSingle;\n\t\t\tdefault: return defaultAutoApply;\n\t\t}\n\t}\n\n\tprivate static getKindFromUser(arg: any, defaultKind: CodeActionKind) {\n\t\treturn typeof arg.kind === 'string'\n\t\t\t? new CodeActionKind(arg.kind)\n\t\t\t: defaultKind;\n\t}\n\n\tprivate static getPreferredUser(arg: any): boolean {\n\t\treturn typeof arg.preferred === 'boolean'\n\t\t\t? arg.preferred\n\t\t\t: false;\n\t}\n\n\tprivate constructor(\n\t\tpublic readonly kind: CodeActionKind,\n\t\tpublic readonly apply: CodeActionAutoApply,\n\t\tpublic readonly preferred: boolean,\n\t) { }\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 { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IColorPresentation } from 'vs/editor/common/languages';\n\nexport class ColorPickerModel {\n\n\treadonly originalColor: Color;\n\tprivate _color: Color;\n\n\tget color(): Color {\n\t\treturn this._color;\n\t}\n\n\tset color(color: Color) {\n\t\tif (this._color.equals(color)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._color = color;\n\t\tthis._onDidChangeColor.fire(color);\n\t}\n\n\tget presentation(): IColorPresentation { return this.colorPresentations[this.presentationIndex]; }\n\n\tprivate _colorPresentations: IColorPresentation[];\n\n\tget colorPresentations(): IColorPresentation[] {\n\t\treturn this._colorPresentations;\n\t}\n\n\tset colorPresentations(colorPresentations: IColorPresentation[]) {\n\t\tthis._colorPresentations = colorPresentations;\n\t\tif (this.presentationIndex > colorPresentations.length - 1) {\n\t\t\tthis.presentationIndex = 0;\n\t\t}\n\t\tthis._onDidChangePresentation.fire(this.presentation);\n\t}\n\n\tprivate readonly _onColorFlushed = new Emitter<Color>();\n\treadonly onColorFlushed: Event<Color> = this._onColorFlushed.event;\n\n\tprivate readonly _onDidChangeColor = new Emitter<Color>();\n\treadonly onDidChangeColor: Event<Color> = this._onDidChangeColor.event;\n\n\tprivate readonly _onDidChangePresentation = new Emitter<IColorPresentation>();\n\treadonly onDidChangePresentation: Event<IColorPresentation> = this._onDidChangePresentation.event;\n\n\tconstructor(color: Color, availableColorPresentations: IColorPresentation[], private presentationIndex: number) {\n\t\tthis.originalColor = color;\n\t\tthis._color = color;\n\t\tthis._colorPresentations = availableColorPresentations;\n\t}\n\n\tselectNextColorPresentation(): void {\n\t\tthis.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length;\n\t\tthis.flushColor();\n\t\tthis._onDidChangePresentation.fire(this.presentation);\n\t}\n\n\tguessColorPresentation(color: Color, originalText: string): void {\n\t\tfor (let i = 0; i < this.colorPresentations.length; i++) {\n\t\t\tif (originalText.toLowerCase() === this.colorPresentations[i].label) {\n\t\t\t\tthis.presentationIndex = i;\n\t\t\t\tthis._onDidChangePresentation.fire(this.presentation);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tflushColor(): void {\n\t\tthis._onColorFlushed.fire(this._color);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\n\nexport class BlockCommentCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _insertSpace: boolean;\n\tprivate _usedEndToken: string | null;\n\n\tconstructor(\n\t\tselection: Selection,\n\t\tinsertSpace: boolean,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._selection = selection;\n\t\tthis._insertSpace = insertSpace;\n\t\tthis._usedEndToken = null;\n\t}\n\n\tpublic static _haystackHasNeedleAtOffset(haystack: string, needle: string, offset: number): boolean {\n\t\tif (offset < 0) {\n\t\t\treturn false;\n\t\t}\n\t\tconst needleLength = needle.length;\n\t\tconst haystackLength = haystack.length;\n\t\tif (offset + needleLength > haystackLength) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0; i < needleLength; i++) {\n\t\t\tconst codeA = haystack.charCodeAt(offset + i);\n\t\t\tconst codeB = needle.charCodeAt(i);\n\n\t\t\tif (codeA === codeB) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (codeA >= CharCode.A && codeA <= CharCode.Z && codeA + 32 === codeB) {\n\t\t\t\t// codeA is upper-case variant of codeB\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (codeB >= CharCode.A && codeB <= CharCode.Z && codeB + 32 === codeA) {\n\t\t\t\t// codeB is upper-case variant of codeA\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate _createOperationsForBlockComment(selection: Range, startToken: string, endToken: string, insertSpace: boolean, model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tconst startLineNumber = selection.startLineNumber;\n\t\tconst startColumn = selection.startColumn;\n\t\tconst endLineNumber = selection.endLineNumber;\n\t\tconst endColumn = selection.endColumn;\n\n\t\tconst startLineText = model.getLineContent(startLineNumber);\n\t\tconst endLineText = model.getLineContent(endLineNumber);\n\n\t\tlet startTokenIndex = startLineText.lastIndexOf(startToken, startColumn - 1 + startToken.length);\n\t\tlet endTokenIndex = endLineText.indexOf(endToken, endColumn - 1 - endToken.length);\n\n\t\tif (startTokenIndex !== -1 && endTokenIndex !== -1) {\n\n\t\t\tif (startLineNumber === endLineNumber) {\n\t\t\t\tconst lineBetweenTokens = startLineText.substring(startTokenIndex + startToken.length, endTokenIndex);\n\n\t\t\t\tif (lineBetweenTokens.indexOf(endToken) >= 0) {\n\t\t\t\t\t// force to add a block comment\n\t\t\t\t\tstartTokenIndex = -1;\n\t\t\t\t\tendTokenIndex = -1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst startLineAfterStartToken = startLineText.substring(startTokenIndex + startToken.length);\n\t\t\t\tconst endLineBeforeEndToken = endLineText.substring(0, endTokenIndex);\n\n\t\t\t\tif (startLineAfterStartToken.indexOf(endToken) >= 0 || endLineBeforeEndToken.indexOf(endToken) >= 0) {\n\t\t\t\t\t// force to add a block comment\n\t\t\t\t\tstartTokenIndex = -1;\n\t\t\t\t\tendTokenIndex = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet ops: ISingleEditOperation[];\n\n\t\tif (startTokenIndex !== -1 && endTokenIndex !== -1) {\n\t\t\t// Consider spaces as part of the comment tokens\n\t\t\tif (insertSpace && startTokenIndex + startToken.length < startLineText.length && startLineText.charCodeAt(startTokenIndex + startToken.length) === CharCode.Space) {\n\t\t\t\t// Pretend the start token contains a trailing space\n\t\t\t\tstartToken = startToken + ' ';\n\t\t\t}\n\n\t\t\tif (insertSpace && endTokenIndex > 0 && endLineText.charCodeAt(endTokenIndex - 1) === CharCode.Space) {\n\t\t\t\t// Pretend the end token contains a leading space\n\t\t\t\tendToken = ' ' + endToken;\n\t\t\t\tendTokenIndex -= 1;\n\t\t\t}\n\t\t\tops = BlockCommentCommand._createRemoveBlockCommentOperations(\n\t\t\t\tnew Range(startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken\n\t\t\t);\n\t\t} else {\n\t\t\tops = BlockCommentCommand._createAddBlockCommentOperations(selection, startToken, endToken, this._insertSpace);\n\t\t\tthis._usedEndToken = ops.length === 1 ? endToken : null;\n\t\t}\n\n\t\tfor (const op of ops) {\n\t\t\tbuilder.addTrackedEditOperation(op.range, op.text);\n\t\t}\n\t}\n\n\tpublic static _createRemoveBlockCommentOperations(r: Range, startToken: string, endToken: string): ISingleEditOperation[] {\n\t\tlet res: ISingleEditOperation[] = [];\n\n\t\tif (!Range.isEmpty(r)) {\n\t\t\t// Remove block comment start\n\t\t\tres.push(EditOperation.delete(new Range(\n\t\t\t\tr.startLineNumber, r.startColumn - startToken.length,\n\t\t\t\tr.startLineNumber, r.startColumn\n\t\t\t)));\n\n\t\t\t// Remove block comment end\n\t\t\tres.push(EditOperation.delete(new Range(\n\t\t\t\tr.endLineNumber, r.endColumn,\n\t\t\t\tr.endLineNumber, r.endColumn + endToken.length\n\t\t\t)));\n\t\t} else {\n\t\t\t// Remove both continuously\n\t\t\tres.push(EditOperation.delete(new Range(\n\t\t\t\tr.startLineNumber, r.startColumn - startToken.length,\n\t\t\t\tr.endLineNumber, r.endColumn + endToken.length\n\t\t\t)));\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tpublic static _createAddBlockCommentOperations(r: Range, startToken: string, endToken: string, insertSpace: boolean): ISingleEditOperation[] {\n\t\tlet res: ISingleEditOperation[] = [];\n\n\t\tif (!Range.isEmpty(r)) {\n\t\t\t// Insert block comment start\n\t\t\tres.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken + (insertSpace ? ' ' : '')));\n\n\t\t\t// Insert block comment end\n\t\t\tres.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), (insertSpace ? ' ' : '') + endToken));\n\t\t} else {\n\t\t\t// Insert both continuously\n\t\t\tres.push(EditOperation.replace(new Range(\n\t\t\t\tr.startLineNumber, r.startColumn,\n\t\t\t\tr.endLineNumber, r.endColumn\n\t\t\t), startToken + ' ' + endToken));\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tconst startLineNumber = this._selection.startLineNumber;\n\t\tconst startColumn = this._selection.startColumn;\n\n\t\tmodel.tokenizeIfCheap(startLineNumber);\n\t\tconst languageId = model.getLanguageIdAtPosition(startLineNumber, startColumn);\n\t\tconst config = this.languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tif (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) {\n\t\t\t// Mode does not support block comments\n\t\t\treturn;\n\t\t}\n\n\t\tthis._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, this._insertSpace, model, builder);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tif (inverseEditOperations.length === 2) {\n\t\t\tconst startTokenEditOperation = inverseEditOperations[0];\n\t\t\tconst endTokenEditOperation = inverseEditOperations[1];\n\n\t\t\treturn new Selection(\n\t\t\t\tstartTokenEditOperation.range.endLineNumber,\n\t\t\t\tstartTokenEditOperation.range.endColumn,\n\t\t\t\tendTokenEditOperation.range.startLineNumber,\n\t\t\t\tendTokenEditOperation.range.startColumn\n\t\t\t);\n\t\t} else {\n\t\t\tconst srcRange = inverseEditOperations[0].range;\n\t\t\tconst deltaColumn = this._usedEndToken ? -this._usedEndToken.length - 1 : 0; // minus 1 space before endToken\n\t\t\treturn new Selection(\n\t\t\t\tsrcRange.endLineNumber,\n\t\t\t\tsrcRange.endColumn + deltaColumn,\n\t\t\t\tsrcRange.endLineNumber,\n\t\t\t\tsrcRange.endColumn + deltaColumn\n\t\t\t);\n\t\t}\n\t}\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 { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\n\nexport class DragAndDropCommand implements ICommand {\n\n\tprivate readonly selection: Selection;\n\tprivate readonly targetPosition: Position;\n\tprivate targetSelection: Selection | null;\n\tprivate readonly copy: boolean;\n\n\tconstructor(selection: Selection, targetPosition: Position, copy: boolean) {\n\t\tthis.selection = selection;\n\t\tthis.targetPosition = targetPosition;\n\t\tthis.copy = copy;\n\t\tthis.targetSelection = null;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tlet text = model.getValueInRange(this.selection);\n\t\tif (!this.copy) {\n\t\t\tbuilder.addEditOperation(this.selection, null);\n\t\t}\n\t\tbuilder.addEditOperation(new Range(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), text);\n\n\t\tif (this.selection.containsPosition(this.targetPosition) && !(\n\t\t\tthis.copy && (\n\t\t\t\tthis.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)\n\t\t\t) // we allow users to paste content beside the selection\n\t\t)) {\n\t\t\tthis.targetSelection = this.selection;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.copy) {\n\t\t\tthis.targetSelection = new Selection(\n\t\t\t\tthis.targetPosition.lineNumber,\n\t\t\t\tthis.targetPosition.column,\n\t\t\t\tthis.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber,\n\t\t\t\tthis.selection.startLineNumber === this.selection.endLineNumber ?\n\t\t\t\t\tthis.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n\t\t\t\t\tthis.selection.endColumn\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.targetPosition.lineNumber > this.selection.endLineNumber) {\n\t\t\t// Drag the selection downwards\n\t\t\tthis.targetSelection = new Selection(\n\t\t\t\tthis.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber,\n\t\t\t\tthis.targetPosition.column,\n\t\t\t\tthis.targetPosition.lineNumber,\n\t\t\t\tthis.selection.startLineNumber === this.selection.endLineNumber ?\n\t\t\t\t\tthis.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n\t\t\t\t\tthis.selection.endColumn\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.targetPosition.lineNumber < this.selection.endLineNumber) {\n\t\t\t// Drag the selection upwards\n\t\t\tthis.targetSelection = new Selection(\n\t\t\t\tthis.targetPosition.lineNumber,\n\t\t\t\tthis.targetPosition.column,\n\t\t\t\tthis.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber,\n\t\t\t\tthis.selection.startLineNumber === this.selection.endLineNumber ?\n\t\t\t\t\tthis.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n\t\t\t\t\tthis.selection.endColumn\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// The target position is at the same line as the selection's end position.\n\t\tif (this.selection.endColumn <= this.targetPosition.column) {\n\t\t\t// The target position is after the selection's end position\n\t\t\tthis.targetSelection = new Selection(\n\t\t\t\tthis.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber,\n\t\t\t\tthis.selection.startLineNumber === this.selection.endLineNumber ?\n\t\t\t\t\tthis.targetPosition.column - this.selection.endColumn + this.selection.startColumn :\n\t\t\t\t\tthis.targetPosition.column - this.selection.endColumn + this.selection.startColumn,\n\t\t\t\tthis.targetPosition.lineNumber,\n\t\t\t\tthis.selection.startLineNumber === this.selection.endLineNumber ?\n\t\t\t\t\tthis.targetPosition.column :\n\t\t\t\t\tthis.selection.endColumn\n\t\t\t);\n\t\t} else {\n\t\t\t// The target position is before the selection's end position. Since the selection doesn't contain the target position, the selection is one-line and target position is before this selection.\n\t\t\tthis.targetSelection = new Selection(\n\t\t\t\tthis.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber,\n\t\t\t\tthis.targetPosition.column,\n\t\t\t\tthis.targetPosition.lineNumber,\n\t\t\t\tthis.targetPosition.column + this.selection.endColumn - this.selection.startColumn\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn this.targetSelection!;\n\t}\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\ninterface IEditOperation {\n\trange: Range;\n\ttext: string;\n}\n\nexport class ReplaceAllCommand implements ICommand {\n\n\tprivate readonly _editorSelection: Selection;\n\tprivate _trackedEditorSelectionId: string | null;\n\tprivate readonly _ranges: Range[];\n\tprivate readonly _replaceStrings: string[];\n\n\tconstructor(editorSelection: Selection, ranges: Range[], replaceStrings: string[]) {\n\t\tthis._editorSelection = editorSelection;\n\t\tthis._ranges = ranges;\n\t\tthis._replaceStrings = replaceStrings;\n\t\tthis._trackedEditorSelectionId = null;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tif (this._ranges.length > 0) {\n\t\t\t// Collect all edit operations\n\t\t\tlet ops: IEditOperation[] = [];\n\t\t\tfor (let i = 0; i < this._ranges.length; i++) {\n\t\t\t\tops.push({\n\t\t\t\t\trange: this._ranges[i],\n\t\t\t\t\ttext: this._replaceStrings[i]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Sort them in ascending order by range starts\n\t\t\tops.sort((o1, o2) => {\n\t\t\t\treturn Range.compareRangesUsingStarts(o1.range, o2.range);\n\t\t\t});\n\n\t\t\t// Merge operations that touch each other\n\t\t\tlet resultOps: IEditOperation[] = [];\n\t\t\tlet previousOp = ops[0];\n\t\t\tfor (let i = 1; i < ops.length; i++) {\n\t\t\t\tif (previousOp.range.endLineNumber === ops[i].range.startLineNumber && previousOp.range.endColumn === ops[i].range.startColumn) {\n\t\t\t\t\t// These operations are one after another and can be merged\n\t\t\t\t\tpreviousOp.range = previousOp.range.plusRange(ops[i].range);\n\t\t\t\t\tpreviousOp.text = previousOp.text + ops[i].text;\n\t\t\t\t} else {\n\t\t\t\t\tresultOps.push(previousOp);\n\t\t\t\t\tpreviousOp = ops[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tresultOps.push(previousOp);\n\n\t\t\tfor (const op of resultOps) {\n\t\t\t\tbuilder.addEditOperation(op.range, op.text);\n\t\t\t}\n\t\t}\n\n\t\tthis._trackedEditorSelectionId = builder.trackSelection(this._editorSelection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this._trackedEditorSelectionId!);\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { buildReplaceStringWithCasePreserved } from 'vs/base/common/search';\n\nconst enum ReplacePatternKind {\n\tStaticValue = 0,\n\tDynamicPieces = 1\n}\n\n/**\n * Assigned when the replace pattern is entirely static.\n */\nclass StaticValueReplacePattern {\n\tpublic readonly kind = ReplacePatternKind.StaticValue;\n\tconstructor(public readonly staticValue: string) { }\n}\n\n/**\n * Assigned when the replace pattern has replacement patterns.\n */\nclass DynamicPiecesReplacePattern {\n\tpublic readonly kind = ReplacePatternKind.DynamicPieces;\n\tconstructor(public readonly pieces: ReplacePiece[]) { }\n}\n\nexport class ReplacePattern {\n\n\tpublic static fromStaticValue(value: string): ReplacePattern {\n\t\treturn new ReplacePattern([ReplacePiece.staticValue(value)]);\n\t}\n\n\tprivate readonly _state: StaticValueReplacePattern | DynamicPiecesReplacePattern;\n\n\tpublic get hasReplacementPatterns(): boolean {\n\t\treturn (this._state.kind === ReplacePatternKind.DynamicPieces);\n\t}\n\n\tconstructor(pieces: ReplacePiece[] | null) {\n\t\tif (!pieces || pieces.length === 0) {\n\t\t\tthis._state = new StaticValueReplacePattern('');\n\t\t} else if (pieces.length === 1 && pieces[0].staticValue !== null) {\n\t\t\tthis._state = new StaticValueReplacePattern(pieces[0].staticValue);\n\t\t} else {\n\t\t\tthis._state = new DynamicPiecesReplacePattern(pieces);\n\t\t}\n\t}\n\n\tpublic buildReplaceString(matches: string[] | null, preserveCase?: boolean): string {\n\t\tif (this._state.kind === ReplacePatternKind.StaticValue) {\n\t\t\tif (preserveCase) {\n\t\t\t\treturn buildReplaceStringWithCasePreserved(matches, this._state.staticValue);\n\t\t\t} else {\n\t\t\t\treturn this._state.staticValue;\n\t\t\t}\n\t\t}\n\n\t\tlet result = '';\n\t\tfor (let i = 0, len = this._state.pieces.length; i < len; i++) {\n\t\t\tlet piece = this._state.pieces[i];\n\t\t\tif (piece.staticValue !== null) {\n\t\t\t\t// static value ReplacePiece\n\t\t\t\tresult += piece.staticValue;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// match index ReplacePiece\n\t\t\tlet match: string = ReplacePattern._substitute(piece.matchIndex, matches);\n\t\t\tif (piece.caseOps !== null && piece.caseOps.length > 0) {\n\t\t\t\tlet repl: string[] = [];\n\t\t\t\tlet lenOps: number = piece.caseOps.length;\n\t\t\t\tlet opIdx: number = 0;\n\t\t\t\tfor (let idx: number = 0, len: number = match.length; idx < len; idx++) {\n\t\t\t\t\tif (opIdx >= lenOps) {\n\t\t\t\t\t\trepl.push(match.slice(idx));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (piece.caseOps[opIdx]) {\n\t\t\t\t\t\tcase 'U':\n\t\t\t\t\t\t\trepl.push(match[idx].toUpperCase());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'u':\n\t\t\t\t\t\t\trepl.push(match[idx].toUpperCase());\n\t\t\t\t\t\t\topIdx++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'L':\n\t\t\t\t\t\t\trepl.push(match[idx].toLowerCase());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'l':\n\t\t\t\t\t\t\trepl.push(match[idx].toLowerCase());\n\t\t\t\t\t\t\topIdx++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\trepl.push(match[idx]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmatch = repl.join('');\n\t\t\t}\n\t\t\tresult += match;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _substitute(matchIndex: number, matches: string[] | null): string {\n\t\tif (matches === null) {\n\t\t\treturn '';\n\t\t}\n\t\tif (matchIndex === 0) {\n\t\t\treturn matches[0];\n\t\t}\n\n\t\tlet remainder = '';\n\t\twhile (matchIndex > 0) {\n\t\t\tif (matchIndex < matches.length) {\n\t\t\t\t// A match can be undefined\n\t\t\t\tlet match = (matches[matchIndex] || '');\n\t\t\t\treturn match + remainder;\n\t\t\t}\n\t\t\tremainder = String(matchIndex % 10) + remainder;\n\t\t\tmatchIndex = Math.floor(matchIndex / 10);\n\t\t}\n\t\treturn '$' + remainder;\n\t}\n}\n\n/**\n * A replace piece can either be a static string or an index to a specific match.\n */\nexport class ReplacePiece {\n\n\tpublic static staticValue(value: string): ReplacePiece {\n\t\treturn new ReplacePiece(value, -1, null);\n\t}\n\n\tpublic static caseOps(index: number, caseOps: string[]): ReplacePiece {\n\t\treturn new ReplacePiece(null, index, caseOps);\n\t}\n\n\tpublic readonly staticValue: string | null;\n\tpublic readonly matchIndex: number;\n\tpublic readonly caseOps: string[] | null;\n\n\tprivate constructor(staticValue: string | null, matchIndex: number, caseOps: string[] | null) {\n\t\tthis.staticValue = staticValue;\n\t\tthis.matchIndex = matchIndex;\n\t\tif (!caseOps || caseOps.length === 0) {\n\t\t\tthis.caseOps = null;\n\t\t} else {\n\t\t\tthis.caseOps = caseOps.slice(0);\n\t\t}\n\t}\n}\n\nclass ReplacePieceBuilder {\n\n\tprivate readonly _source: string;\n\tprivate _lastCharIndex: number;\n\tprivate readonly _result: ReplacePiece[];\n\tprivate _resultLen: number;\n\tprivate _currentStaticPiece: string;\n\n\tconstructor(source: string) {\n\t\tthis._source = source;\n\t\tthis._lastCharIndex = 0;\n\t\tthis._result = [];\n\t\tthis._resultLen = 0;\n\t\tthis._currentStaticPiece = '';\n\t}\n\n\tpublic emitUnchanged(toCharIndex: number): void {\n\t\tthis._emitStatic(this._source.substring(this._lastCharIndex, toCharIndex));\n\t\tthis._lastCharIndex = toCharIndex;\n\t}\n\n\tpublic emitStatic(value: string, toCharIndex: number): void {\n\t\tthis._emitStatic(value);\n\t\tthis._lastCharIndex = toCharIndex;\n\t}\n\n\tprivate _emitStatic(value: string): void {\n\t\tif (value.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentStaticPiece += value;\n\t}\n\n\tpublic emitMatchIndex(index: number, toCharIndex: number, caseOps: string[]): void {\n\t\tif (this._currentStaticPiece.length !== 0) {\n\t\t\tthis._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece);\n\t\t\tthis._currentStaticPiece = '';\n\t\t}\n\t\tthis._result[this._resultLen++] = ReplacePiece.caseOps(index, caseOps);\n\t\tthis._lastCharIndex = toCharIndex;\n\t}\n\n\n\tpublic finalize(): ReplacePattern {\n\t\tthis.emitUnchanged(this._source.length);\n\t\tif (this._currentStaticPiece.length !== 0) {\n\t\t\tthis._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece);\n\t\t\tthis._currentStaticPiece = '';\n\t\t}\n\t\treturn new ReplacePattern(this._result);\n\t}\n}\n\n/**\n * \\n\t\t\t=> inserts a LF\n * \\t\t\t\t=> inserts a TAB\n * \\\\\t\t\t=> inserts a \"\\\".\n * \\u\t\t\t=> upper-cases one character in a match.\n * \\U\t\t\t=> upper-cases ALL remaining characters in a match.\n * \\l\t\t\t=> lower-cases one character in a match.\n * \\L\t\t\t=> lower-cases ALL remaining characters in a match.\n * $$\t\t\t=> inserts a \"$\".\n * $& and $0\t=> inserts the matched substring.\n * $n\t\t\t=> Where n is a non-negative integer lesser than 100, inserts the nth parenthesized submatch string\n * everything else stays untouched\n *\n * Also see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter\n */\nexport function parseReplaceString(replaceString: string): ReplacePattern {\n\tif (!replaceString || replaceString.length === 0) {\n\t\treturn new ReplacePattern(null);\n\t}\n\n\tlet caseOps: string[] = [];\n\tlet result = new ReplacePieceBuilder(replaceString);\n\n\tfor (let i = 0, len = replaceString.length; i < len; i++) {\n\t\tlet chCode = replaceString.charCodeAt(i);\n\n\t\tif (chCode === CharCode.Backslash) {\n\n\t\t\t// move to next char\n\t\t\ti++;\n\n\t\t\tif (i >= len) {\n\t\t\t\t// string ends with a \\\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet nextChCode = replaceString.charCodeAt(i);\n\t\t\t// let replaceWithCharacter: string | null = null;\n\n\t\t\tswitch (nextChCode) {\n\t\t\t\tcase CharCode.Backslash:\n\t\t\t\t\t// \\\\ => inserts a \"\\\"\n\t\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\t\tresult.emitStatic('\\\\', i + 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharCode.n:\n\t\t\t\t\t// \\n => inserts a LF\n\t\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\t\tresult.emitStatic('\\n', i + 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharCode.t:\n\t\t\t\t\t// \\t => inserts a TAB\n\t\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\t\tresult.emitStatic('\\t', i + 1);\n\t\t\t\t\tbreak;\n\t\t\t\t// Case modification of string replacements, patterned after Boost, but only applied\n\t\t\t\t// to the replacement text, not subsequent content.\n\t\t\t\tcase CharCode.u:\n\t\t\t\t// \\u => upper-cases one character.\n\t\t\t\tcase CharCode.U:\n\t\t\t\t// \\U => upper-cases ALL following characters.\n\t\t\t\tcase CharCode.l:\n\t\t\t\t// \\l => lower-cases one character.\n\t\t\t\tcase CharCode.L:\n\t\t\t\t\t// \\L => lower-cases ALL following characters.\n\t\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\t\tresult.emitStatic('', i + 1);\n\t\t\t\t\tcaseOps.push(String.fromCharCode(nextChCode));\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (chCode === CharCode.DollarSign) {\n\n\t\t\t// move to next char\n\t\t\ti++;\n\n\t\t\tif (i >= len) {\n\t\t\t\t// string ends with a $\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet nextChCode = replaceString.charCodeAt(i);\n\n\t\t\tif (nextChCode === CharCode.DollarSign) {\n\t\t\t\t// $$ => inserts a \"$\"\n\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\tresult.emitStatic('$', i + 1);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nextChCode === CharCode.Digit0 || nextChCode === CharCode.Ampersand) {\n\t\t\t\t// $& and $0 => inserts the matched substring.\n\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\tresult.emitMatchIndex(0, i + 1, caseOps);\n\t\t\t\tcaseOps.length = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (CharCode.Digit1 <= nextChCode && nextChCode <= CharCode.Digit9) {\n\t\t\t\t// $n\n\n\t\t\t\tlet matchIndex = nextChCode - CharCode.Digit0;\n\n\t\t\t\t// peek next char to probe for $nn\n\t\t\t\tif (i + 1 < len) {\n\t\t\t\t\tlet nextNextChCode = replaceString.charCodeAt(i + 1);\n\t\t\t\t\tif (CharCode.Digit0 <= nextNextChCode && nextNextChCode <= CharCode.Digit9) {\n\t\t\t\t\t\t// $nn\n\n\t\t\t\t\t\t// move to next char\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tmatchIndex = matchIndex * 10 + (nextNextChCode - CharCode.Digit0);\n\n\t\t\t\t\t\tresult.emitUnchanged(i - 2);\n\t\t\t\t\t\tresult.emitMatchIndex(matchIndex, i + 1, caseOps);\n\t\t\t\t\t\tcaseOps.length = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tresult.emitUnchanged(i - 1);\n\t\t\t\tresult.emitMatchIndex(matchIndex, i + 1, caseOps);\n\t\t\t\tcaseOps.length = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result.finalize();\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\nexport interface ILineRange {\n\tstartLineNumber: number;\n\tendLineNumber: number;\n}\n\nexport const MAX_FOLDING_REGIONS = 0xFFFF;\nexport const MAX_LINE_NUMBER = 0xFFFFFF;\n\nconst MASK_INDENT = 0xFF000000;\n\nexport class FoldingRegions {\n\tprivate readonly _startIndexes: Uint32Array;\n\tprivate readonly _endIndexes: Uint32Array;\n\tprivate readonly _collapseStates: Uint32Array;\n\tprivate _parentsComputed: boolean;\n\tprivate readonly _types: Array<string | undefined> | undefined;\n\n\tconstructor(startIndexes: Uint32Array, endIndexes: Uint32Array, types?: Array<string | undefined>) {\n\t\tif (startIndexes.length !== endIndexes.length || startIndexes.length > MAX_FOLDING_REGIONS) {\n\t\t\tthrow new Error('invalid startIndexes or endIndexes size');\n\t\t}\n\t\tthis._startIndexes = startIndexes;\n\t\tthis._endIndexes = endIndexes;\n\t\tthis._collapseStates = new Uint32Array(Math.ceil(startIndexes.length / 32));\n\t\tthis._types = types;\n\t\tthis._parentsComputed = false;\n\t}\n\n\tprivate ensureParentIndices() {\n\t\tif (!this._parentsComputed) {\n\t\t\tthis._parentsComputed = true;\n\t\t\tlet parentIndexes: number[] = [];\n\t\t\tlet isInsideLast = (startLineNumber: number, endLineNumber: number) => {\n\t\t\t\tlet index = parentIndexes[parentIndexes.length - 1];\n\t\t\t\treturn this.getStartLineNumber(index) <= startLineNumber && this.getEndLineNumber(index) >= endLineNumber;\n\t\t\t};\n\t\t\tfor (let i = 0, len = this._startIndexes.length; i < len; i++) {\n\t\t\t\tlet startLineNumber = this._startIndexes[i];\n\t\t\t\tlet endLineNumber = this._endIndexes[i];\n\t\t\t\tif (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) {\n\t\t\t\t\tthrow new Error('startLineNumber or endLineNumber must not exceed ' + MAX_LINE_NUMBER);\n\t\t\t\t}\n\t\t\t\twhile (parentIndexes.length > 0 && !isInsideLast(startLineNumber, endLineNumber)) {\n\t\t\t\t\tparentIndexes.pop();\n\t\t\t\t}\n\t\t\t\tlet parentIndex = parentIndexes.length > 0 ? parentIndexes[parentIndexes.length - 1] : -1;\n\t\t\t\tparentIndexes.push(i);\n\t\t\t\tthis._startIndexes[i] = startLineNumber + ((parentIndex & 0xFF) << 24);\n\t\t\t\tthis._endIndexes[i] = endLineNumber + ((parentIndex & 0xFF00) << 16);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get length(): number {\n\t\treturn this._startIndexes.length;\n\t}\n\n\tpublic getStartLineNumber(index: number): number {\n\t\treturn this._startIndexes[index] & MAX_LINE_NUMBER;\n\t}\n\n\tpublic getEndLineNumber(index: number): number {\n\t\treturn this._endIndexes[index] & MAX_LINE_NUMBER;\n\t}\n\n\tpublic getType(index: number): string | undefined {\n\t\treturn this._types ? this._types[index] : undefined;\n\t}\n\n\tpublic hasTypes() {\n\t\treturn !!this._types;\n\t}\n\n\tpublic isCollapsed(index: number): boolean {\n\t\tlet arrayIndex = (index / 32) | 0;\n\t\tlet bit = index % 32;\n\t\treturn (this._collapseStates[arrayIndex] & (1 << bit)) !== 0;\n\t}\n\n\tpublic setCollapsed(index: number, newState: boolean) {\n\t\tlet arrayIndex = (index / 32) | 0;\n\t\tlet bit = index % 32;\n\t\tlet value = this._collapseStates[arrayIndex];\n\t\tif (newState) {\n\t\t\tthis._collapseStates[arrayIndex] = value | (1 << bit);\n\t\t} else {\n\t\t\tthis._collapseStates[arrayIndex] = value & ~(1 << bit);\n\t\t}\n\t}\n\n\tpublic setCollapsedAllOfType(type: string, newState: boolean) {\n\t\tlet hasChanged = false;\n\t\tif (this._types) {\n\t\t\tfor (let i = 0; i < this._types.length; i++) {\n\t\t\t\tif (this._types[i] === type) {\n\t\t\t\t\tthis.setCollapsed(i, newState);\n\t\t\t\t\thasChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn hasChanged;\n\t}\n\n\tpublic toRegion(index: number): FoldingRegion {\n\t\treturn new FoldingRegion(this, index);\n\t}\n\n\tpublic getParentIndex(index: number) {\n\t\tthis.ensureParentIndices();\n\t\tlet parent = ((this._startIndexes[index] & MASK_INDENT) >>> 24) + ((this._endIndexes[index] & MASK_INDENT) >>> 16);\n\t\tif (parent === MAX_FOLDING_REGIONS) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn parent;\n\t}\n\n\tpublic contains(index: number, line: number) {\n\t\treturn this.getStartLineNumber(index) <= line && this.getEndLineNumber(index) >= line;\n\t}\n\n\tprivate findIndex(line: number) {\n\t\tlet low = 0, high = this._startIndexes.length;\n\t\tif (high === 0) {\n\t\t\treturn -1; // no children\n\t\t}\n\t\twhile (low < high) {\n\t\t\tlet mid = Math.floor((low + high) / 2);\n\t\t\tif (line < this.getStartLineNumber(mid)) {\n\t\t\t\thigh = mid;\n\t\t\t} else {\n\t\t\t\tlow = mid + 1;\n\t\t\t}\n\t\t}\n\t\treturn low - 1;\n\t}\n\n\tpublic findRange(line: number): number {\n\t\tlet index = this.findIndex(line);\n\t\tif (index >= 0) {\n\t\t\tlet endLineNumber = this.getEndLineNumber(index);\n\t\t\tif (endLineNumber >= line) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tindex = this.getParentIndex(index);\n\t\t\twhile (index !== -1) {\n\t\t\t\tif (this.contains(index, line)) {\n\t\t\t\t\treturn index;\n\t\t\t\t}\n\t\t\t\tindex = this.getParentIndex(index);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tpublic toString() {\n\t\tlet res: string[] = [];\n\t\tfor (let i = 0; i < this.length; i++) {\n\t\t\tres[i] = `[${this.isCollapsed(i) ? '+' : '-'}] ${this.getStartLineNumber(i)}/${this.getEndLineNumber(i)}`;\n\t\t}\n\t\treturn res.join(', ');\n\t}\n}\n\nexport class FoldingRegion {\n\n\tconstructor(private readonly ranges: FoldingRegions, private index: number) {\n\t}\n\n\tpublic get startLineNumber() {\n\t\treturn this.ranges.getStartLineNumber(this.index);\n\t}\n\n\tpublic get endLineNumber() {\n\t\treturn this.ranges.getEndLineNumber(this.index);\n\t}\n\n\tpublic get regionIndex() {\n\t\treturn this.index;\n\t}\n\n\tpublic get parentIndex() {\n\t\treturn this.ranges.getParentIndex(this.index);\n\t}\n\n\tpublic get isCollapsed() {\n\t\treturn this.ranges.isCollapsed(this.index);\n\t}\n\n\tcontainedBy(range: ILineRange): boolean {\n\t\treturn range.startLineNumber <= this.startLineNumber && range.endLineNumber >= this.endLineNumber;\n\t}\n\tcontainsLine(lineNumber: number) {\n\t\treturn this.startLineNumber <= lineNumber && lineNumber <= this.endLineNumber;\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';\nimport { FoldingRegion, FoldingRegions, ILineRange } from './foldingRanges';\n\nexport interface IDecorationProvider {\n\tgetDecorationOption(isCollapsed: boolean, isHidden: boolean): IModelDecorationOptions;\n\tdeltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T | null;\n}\n\nexport interface FoldingModelChangeEvent {\n\tmodel: FoldingModel;\n\tcollapseStateChanged?: FoldingRegion[];\n}\n\nexport type CollapseMemento = ILineRange[];\n\nexport class FoldingModel {\n\tprivate readonly _textModel: ITextModel;\n\tprivate readonly _decorationProvider: IDecorationProvider;\n\n\tprivate _regions: FoldingRegions;\n\tprivate _editorDecorationIds: string[];\n\tprivate _isInitialized: boolean;\n\n\tprivate readonly _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();\n\tpublic readonly onDidChange: Event<FoldingModelChangeEvent> = this._updateEventEmitter.event;\n\n\tpublic get regions(): FoldingRegions { return this._regions; }\n\tpublic get textModel() { return this._textModel; }\n\tpublic get isInitialized() { return this._isInitialized; }\n\n\tconstructor(textModel: ITextModel, decorationProvider: IDecorationProvider) {\n\t\tthis._textModel = textModel;\n\t\tthis._decorationProvider = decorationProvider;\n\t\tthis._regions = new FoldingRegions(new Uint32Array(0), new Uint32Array(0));\n\t\tthis._editorDecorationIds = [];\n\t\tthis._isInitialized = false;\n\t}\n\n\tpublic toggleCollapseState(toggledRegions: FoldingRegion[]) {\n\t\tif (!toggledRegions.length) {\n\t\t\treturn;\n\t\t}\n\t\ttoggledRegions = toggledRegions.sort((r1, r2) => r1.regionIndex - r2.regionIndex);\n\n\t\tconst processed: { [key: string]: boolean | undefined } = {};\n\t\tthis._decorationProvider.changeDecorations(accessor => {\n\t\t\tlet k = 0; // index from [0 ... this.regions.length]\n\t\t\tlet dirtyRegionEndLine = -1; // end of the range where decorations need to be updated\n\t\t\tlet lastHiddenLine = -1; // the end of the last hidden lines\n\t\t\tconst updateDecorationsUntil = (index: number) => {\n\t\t\t\twhile (k < index) {\n\t\t\t\t\tconst endLineNumber = this._regions.getEndLineNumber(k);\n\t\t\t\t\tconst isCollapsed = this._regions.isCollapsed(k);\n\t\t\t\t\tif (endLineNumber <= dirtyRegionEndLine) {\n\t\t\t\t\t\taccessor.changeDecorationOptions(this._editorDecorationIds[k], this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine));\n\t\t\t\t\t}\n\t\t\t\t\tif (isCollapsed && endLineNumber > lastHiddenLine) {\n\t\t\t\t\t\tlastHiddenLine = endLineNumber;\n\t\t\t\t\t}\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t};\n\t\t\tfor (let region of toggledRegions) {\n\t\t\t\tlet index = region.regionIndex;\n\t\t\t\tlet editorDecorationId = this._editorDecorationIds[index];\n\t\t\t\tif (editorDecorationId && !processed[editorDecorationId]) {\n\t\t\t\t\tprocessed[editorDecorationId] = true;\n\n\t\t\t\t\tupdateDecorationsUntil(index); // update all decorations up to current index using the old dirtyRegionEndLine\n\n\t\t\t\t\tlet newCollapseState = !this._regions.isCollapsed(index);\n\t\t\t\t\tthis._regions.setCollapsed(index, newCollapseState);\n\n\t\t\t\t\tdirtyRegionEndLine = Math.max(dirtyRegionEndLine, this._regions.getEndLineNumber(index));\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdateDecorationsUntil(this._regions.length);\n\t\t});\n\t\tthis._updateEventEmitter.fire({ model: this, collapseStateChanged: toggledRegions });\n\t}\n\n\tpublic update(newRegions: FoldingRegions, blockedLineNumers: number[] = []): void {\n\t\tlet newEditorDecorations: IModelDeltaDecoration[] = [];\n\n\t\tlet isBlocked = (startLineNumber: number, endLineNumber: number) => {\n\t\t\tfor (let blockedLineNumber of blockedLineNumers) {\n\t\t\t\tif (startLineNumber < blockedLineNumber && blockedLineNumber <= endLineNumber) { // first line is visible\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tlet lastHiddenLine = -1;\n\n\t\tlet initRange = (index: number, isCollapsed: boolean) => {\n\t\t\tconst startLineNumber = newRegions.getStartLineNumber(index);\n\t\t\tconst endLineNumber = newRegions.getEndLineNumber(index);\n\t\t\tif (!isCollapsed) {\n\t\t\t\tisCollapsed = newRegions.isCollapsed(index);\n\t\t\t}\n\t\t\tif (isCollapsed && isBlocked(startLineNumber, endLineNumber)) {\n\t\t\t\tisCollapsed = false;\n\t\t\t}\n\t\t\tnewRegions.setCollapsed(index, isCollapsed);\n\n\t\t\tconst maxColumn = this._textModel.getLineMaxColumn(startLineNumber);\n\t\t\tconst decorationRange = {\n\t\t\t\tstartLineNumber: startLineNumber,\n\t\t\t\tstartColumn: Math.max(maxColumn - 1, 1), // make it length == 1 to detect deletions\n\t\t\t\tendLineNumber: startLineNumber,\n\t\t\t\tendColumn: maxColumn\n\t\t\t};\n\t\t\tnewEditorDecorations.push({ range: decorationRange, options: this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine) });\n\t\t\tif (isCollapsed && endLineNumber > lastHiddenLine) {\n\t\t\t\tlastHiddenLine = endLineNumber;\n\t\t\t}\n\t\t};\n\t\tlet i = 0;\n\t\tlet nextCollapsed = () => {\n\t\t\twhile (i < this._regions.length) {\n\t\t\t\tlet isCollapsed = this._regions.isCollapsed(i);\n\t\t\t\ti++;\n\t\t\t\tif (isCollapsed) {\n\t\t\t\t\treturn i - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t};\n\n\t\tlet k = 0;\n\t\tlet collapsedIndex = nextCollapsed();\n\t\twhile (collapsedIndex !== -1 && k < newRegions.length) {\n\t\t\t// get the latest range\n\t\t\tlet decRange = this._textModel.getDecorationRange(this._editorDecorationIds[collapsedIndex]);\n\t\t\tif (decRange) {\n\t\t\t\tlet collapsedStartLineNumber = decRange.startLineNumber;\n\t\t\t\tif (decRange.startColumn === Math.max(decRange.endColumn - 1, 1) && this._textModel.getLineMaxColumn(collapsedStartLineNumber) === decRange.endColumn) { // test that the decoration is still covering the full line else it got deleted\n\t\t\t\t\twhile (k < newRegions.length) {\n\t\t\t\t\t\tlet startLineNumber = newRegions.getStartLineNumber(k);\n\t\t\t\t\t\tif (collapsedStartLineNumber >= startLineNumber) {\n\t\t\t\t\t\t\tinitRange(k, collapsedStartLineNumber === startLineNumber);\n\t\t\t\t\t\t\tk++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcollapsedIndex = nextCollapsed();\n\t\t}\n\t\twhile (k < newRegions.length) {\n\t\t\tinitRange(k, false);\n\t\t\tk++;\n\t\t}\n\n\t\tthis._editorDecorationIds = this._decorationProvider.deltaDecorations(this._editorDecorationIds, newEditorDecorations);\n\t\tthis._regions = newRegions;\n\t\tthis._isInitialized = true;\n\t\tthis._updateEventEmitter.fire({ model: this });\n\t}\n\n\t/**\n\t * Collapse state memento, for persistence only\n\t */\n\tpublic getMemento(): CollapseMemento | undefined {\n\t\tlet collapsedRanges: ILineRange[] = [];\n\t\tfor (let i = 0; i < this._regions.length; i++) {\n\t\t\tif (this._regions.isCollapsed(i)) {\n\t\t\t\tlet range = this._textModel.getDecorationRange(this._editorDecorationIds[i]);\n\t\t\t\tif (range) {\n\t\t\t\t\tlet startLineNumber = range.startLineNumber;\n\t\t\t\t\tlet endLineNumber = range.endLineNumber + this._regions.getEndLineNumber(i) - this._regions.getStartLineNumber(i);\n\t\t\t\t\tcollapsedRanges.push({ startLineNumber, endLineNumber });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (collapsedRanges.length > 0) {\n\t\t\treturn collapsedRanges;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Apply persisted state, for persistence only\n\t */\n\tpublic applyMemento(state: CollapseMemento) {\n\t\tif (!Array.isArray(state)) {\n\t\t\treturn;\n\t\t}\n\t\tlet toToogle: FoldingRegion[] = [];\n\t\tfor (let range of state) {\n\t\t\tlet region = this.getRegionAtLine(range.startLineNumber);\n\t\t\tif (region && !region.isCollapsed) {\n\t\t\t\ttoToogle.push(region);\n\t\t\t}\n\t\t}\n\t\tthis.toggleCollapseState(toToogle);\n\t}\n\n\tpublic dispose() {\n\t\tthis._decorationProvider.deltaDecorations(this._editorDecorationIds, []);\n\t}\n\n\tgetAllRegionsAtLine(lineNumber: number, filter?: (r: FoldingRegion, level: number) => boolean): FoldingRegion[] {\n\t\tlet result: FoldingRegion[] = [];\n\t\tif (this._regions) {\n\t\t\tlet index = this._regions.findRange(lineNumber);\n\t\t\tlet level = 1;\n\t\t\twhile (index >= 0) {\n\t\t\t\tlet current = this._regions.toRegion(index);\n\t\t\t\tif (!filter || filter(current, level)) {\n\t\t\t\t\tresult.push(current);\n\t\t\t\t}\n\t\t\t\tlevel++;\n\t\t\t\tindex = current.parentIndex;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetRegionAtLine(lineNumber: number): FoldingRegion | null {\n\t\tif (this._regions) {\n\t\t\tlet index = this._regions.findRange(lineNumber);\n\t\t\tif (index >= 0) {\n\t\t\t\treturn this._regions.toRegion(index);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRegionsInside(region: FoldingRegion | null, filter?: RegionFilter | RegionFilterWithLevel): FoldingRegion[] {\n\t\tlet result: FoldingRegion[] = [];\n\t\tlet index = region ? region.regionIndex + 1 : 0;\n\t\tlet endLineNumber = region ? region.endLineNumber : Number.MAX_VALUE;\n\n\t\tif (filter && filter.length === 2) {\n\t\t\tconst levelStack: FoldingRegion[] = [];\n\t\t\tfor (let i = index, len = this._regions.length; i < len; i++) {\n\t\t\t\tlet current = this._regions.toRegion(i);\n\t\t\t\tif (this._regions.getStartLineNumber(i) < endLineNumber) {\n\t\t\t\t\twhile (levelStack.length > 0 && !current.containedBy(levelStack[levelStack.length - 1])) {\n\t\t\t\t\t\tlevelStack.pop();\n\t\t\t\t\t}\n\t\t\t\t\tlevelStack.push(current);\n\t\t\t\t\tif (filter(current, levelStack.length)) {\n\t\t\t\t\t\tresult.push(current);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = index, len = this._regions.length; i < len; i++) {\n\t\t\t\tlet current = this._regions.toRegion(i);\n\t\t\t\tif (this._regions.getStartLineNumber(i) < endLineNumber) {\n\t\t\t\t\tif (!filter || (filter as RegionFilter)(current)) {\n\t\t\t\t\t\tresult.push(current);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n}\n\ntype RegionFilter = (r: FoldingRegion) => boolean;\ntype RegionFilterWithLevel = (r: FoldingRegion, level: number) => boolean;\n\n\n/**\n * Collapse or expand the regions at the given locations\n * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels.\n * @param lineNumbers the location of the regions to collapse or expand, or if not set, all regions in the model.\n */\nexport function toggleCollapseState(foldingModel: FoldingModel, levels: number, lineNumbers: number[]) {\n\tlet toToggle: FoldingRegion[] = [];\n\tfor (let lineNumber of lineNumbers) {\n\t\tlet region = foldingModel.getRegionAtLine(lineNumber);\n\t\tif (region) {\n\t\t\tconst doCollapse = !region.isCollapsed;\n\t\t\ttoToggle.push(region);\n\t\t\tif (levels > 1) {\n\t\t\t\tlet regionsInside = foldingModel.getRegionsInside(region, (r, level: number) => r.isCollapsed !== doCollapse && level < levels);\n\t\t\t\ttoToggle.push(...regionsInside);\n\t\t\t}\n\t\t}\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n\n/**\n * Collapse or expand the regions at the given locations including all children.\n * @param doCollapse Whether to collapse or expand\n * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels.\n * @param lineNumbers the location of the regions to collapse or expand, or if not set, all regions in the model.\n */\nexport function setCollapseStateLevelsDown(foldingModel: FoldingModel, doCollapse: boolean, levels = Number.MAX_VALUE, lineNumbers?: number[]): void {\n\tlet toToggle: FoldingRegion[] = [];\n\tif (lineNumbers && lineNumbers.length > 0) {\n\t\tfor (let lineNumber of lineNumbers) {\n\t\t\tlet region = foldingModel.getRegionAtLine(lineNumber);\n\t\t\tif (region) {\n\t\t\t\tif (region.isCollapsed !== doCollapse) {\n\t\t\t\t\ttoToggle.push(region);\n\t\t\t\t}\n\t\t\t\tif (levels > 1) {\n\t\t\t\t\tlet regionsInside = foldingModel.getRegionsInside(region, (r, level: number) => r.isCollapsed !== doCollapse && level < levels);\n\t\t\t\t\ttoToggle.push(...regionsInside);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet regionsInside = foldingModel.getRegionsInside(null, (r, level: number) => r.isCollapsed !== doCollapse && level < levels);\n\t\ttoToggle.push(...regionsInside);\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Collapse or expand the regions at the given locations including all parents.\n * @param doCollapse Whether to collapse or expand\n * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels.\n * @param lineNumbers the location of the regions to collapse or expand.\n */\nexport function setCollapseStateLevelsUp(foldingModel: FoldingModel, doCollapse: boolean, levels: number, lineNumbers: number[]): void {\n\tlet toToggle: FoldingRegion[] = [];\n\tfor (let lineNumber of lineNumbers) {\n\t\tlet regions = foldingModel.getAllRegionsAtLine(lineNumber, (region, level) => region.isCollapsed !== doCollapse && level <= levels);\n\t\ttoToggle.push(...regions);\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Collapse or expand a region at the given locations. If the inner most region is already collapsed/expanded, uses the first parent instead.\n * @param doCollapse Whether to collapse or expand\n * @param lineNumbers the location of the regions to collapse or expand.\n */\nexport function setCollapseStateUp(foldingModel: FoldingModel, doCollapse: boolean, lineNumbers: number[]): void {\n\tlet toToggle: FoldingRegion[] = [];\n\tfor (let lineNumber of lineNumbers) {\n\t\tlet regions = foldingModel.getAllRegionsAtLine(lineNumber, (region,) => region.isCollapsed !== doCollapse);\n\t\tif (regions.length > 0) {\n\t\t\ttoToggle.push(regions[0]);\n\t\t}\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Folds or unfolds all regions that have a given level, except if they contain one of the blocked lines.\n * @param foldLevel level. Level == 1 is the top level\n * @param doCollapse Whether to collapse or expand\n*/\nexport function setCollapseStateAtLevel(foldingModel: FoldingModel, foldLevel: number, doCollapse: boolean, blockedLineNumbers: number[]): void {\n\tlet filter = (region: FoldingRegion, level: number) => level === foldLevel && region.isCollapsed !== doCollapse && !blockedLineNumbers.some(line => region.containsLine(line));\n\tlet toToggle = foldingModel.getRegionsInside(null, filter);\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Folds or unfolds all regions, except if they contain or are contained by a region of one of the blocked lines.\n * @param doCollapse Whether to collapse or expand\n * @param blockedLineNumbers the location of regions to not collapse or expand\n */\nexport function setCollapseStateForRest(foldingModel: FoldingModel, doCollapse: boolean, blockedLineNumbers: number[]): void {\n\tlet filteredRegions: FoldingRegion[] = [];\n\tfor (let lineNumber of blockedLineNumbers) {\n\t\tconst regions = foldingModel.getAllRegionsAtLine(lineNumber, undefined);\n\t\tif (regions.length > 0) {\n\t\t\tfilteredRegions.push(regions[0]);\n\t\t}\n\t}\n\tlet filter = (region: FoldingRegion) => filteredRegions.every((filteredRegion) => !filteredRegion.containedBy(region) && !region.containedBy(filteredRegion)) && region.isCollapsed !== doCollapse;\n\tlet toToggle = foldingModel.getRegionsInside(null, filter);\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Folds all regions for which the lines start with a given regex\n * @param foldingModel the folding model\n */\nexport function setCollapseStateForMatchingLines(foldingModel: FoldingModel, regExp: RegExp, doCollapse: boolean): void {\n\tlet editorModel = foldingModel.textModel;\n\tlet regions = foldingModel.regions;\n\tlet toToggle: FoldingRegion[] = [];\n\tfor (let i = regions.length - 1; i >= 0; i--) {\n\t\tif (doCollapse !== regions.isCollapsed(i)) {\n\t\t\tlet startLineNumber = regions.getStartLineNumber(i);\n\t\t\tif (regExp.test(editorModel.getLineContent(startLineNumber))) {\n\t\t\t\ttoToggle.push(regions.toRegion(i));\n\t\t\t}\n\t\t}\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Folds all regions of the given type\n * @param foldingModel the folding model\n */\nexport function setCollapseStateForType(foldingModel: FoldingModel, type: string, doCollapse: boolean): void {\n\tlet regions = foldingModel.regions;\n\tlet toToggle: FoldingRegion[] = [];\n\tfor (let i = regions.length - 1; i >= 0; i--) {\n\t\tif (doCollapse !== regions.isCollapsed(i) && type === regions.getType(i)) {\n\t\t\ttoToggle.push(regions.toRegion(i));\n\t\t}\n\t}\n\tfoldingModel.toggleCollapseState(toToggle);\n}\n\n/**\n * Get line to go to for parent fold of current line\n * @param lineNumber the current line number\n * @param foldingModel the folding model\n *\n * @return Parent fold start line\n */\nexport function getParentFoldLine(lineNumber: number, foldingModel: FoldingModel): number | null {\n\tlet startLineNumber: number | null = null;\n\tlet foldingRegion = foldingModel.getRegionAtLine(lineNumber);\n\tif (foldingRegion !== null) {\n\t\tstartLineNumber = foldingRegion.startLineNumber;\n\t\t// If current line is not the start of the current fold, go to top line of current fold. If not, go to parent fold\n\t\tif (lineNumber === startLineNumber) {\n\t\t\tlet parentFoldingIdx = foldingRegion.parentIndex;\n\t\t\tif (parentFoldingIdx !== -1) {\n\t\t\t\tstartLineNumber = foldingModel.regions.getStartLineNumber(parentFoldingIdx);\n\t\t\t} else {\n\t\t\t\tstartLineNumber = null;\n\t\t\t}\n\t\t}\n\t}\n\treturn startLineNumber;\n}\n\n/**\n * Get line to go to for previous fold at the same level of current line\n * @param lineNumber the current line number\n * @param foldingModel the folding model\n *\n * @return Previous fold start line\n */\nexport function getPreviousFoldLine(lineNumber: number, foldingModel: FoldingModel): number | null {\n\tlet foldingRegion = foldingModel.getRegionAtLine(lineNumber);\n\t// If on the folding range start line, go to previous sibling.\n\tif (foldingRegion !== null && foldingRegion.startLineNumber === lineNumber) {\n\t\t// If current line is not the start of the current fold, go to top line of current fold. If not, go to previous fold.\n\t\tif (lineNumber !== foldingRegion.startLineNumber) {\n\t\t\treturn foldingRegion.startLineNumber;\n\t\t} else {\n\t\t\t// Find min line number to stay within parent.\n\t\t\tlet expectedParentIndex = foldingRegion.parentIndex;\n\t\t\tlet minLineNumber = 0;\n\t\t\tif (expectedParentIndex !== -1) {\n\t\t\t\tminLineNumber = foldingModel.regions.getStartLineNumber(foldingRegion.parentIndex);\n\t\t\t}\n\n\t\t\t// Find fold at same level.\n\t\t\twhile (foldingRegion !== null) {\n\t\t\t\tif (foldingRegion.regionIndex > 0) {\n\t\t\t\t\tfoldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex - 1);\n\n\t\t\t\t\t// Keep at same level.\n\t\t\t\t\tif (foldingRegion.startLineNumber <= minLineNumber) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} else if (foldingRegion.parentIndex === expectedParentIndex) {\n\t\t\t\t\t\treturn foldingRegion.startLineNumber;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Go to last fold that's before the current line.\n\t\tif (foldingModel.regions.length > 0) {\n\t\t\tfoldingRegion = foldingModel.regions.toRegion(foldingModel.regions.length - 1);\n\t\t\twhile (foldingRegion !== null) {\n\t\t\t\t// Found fold before current line.\n\t\t\t\tif (foldingRegion.startLineNumber < lineNumber) {\n\t\t\t\t\treturn foldingRegion.startLineNumber;\n\t\t\t\t}\n\t\t\t\tif (foldingRegion.regionIndex > 0) {\n\t\t\t\t\tfoldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex - 1);\n\t\t\t\t} else {\n\t\t\t\t\tfoldingRegion = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Get line to go to next fold at the same level of current line\n * @param lineNumber the current line number\n * @param foldingModel the folding model\n *\n * @return Next fold start line\n */\nexport function getNextFoldLine(lineNumber: number, foldingModel: FoldingModel): number | null {\n\tlet foldingRegion = foldingModel.getRegionAtLine(lineNumber);\n\t// If on the folding range start line, go to next sibling.\n\tif (foldingRegion !== null && foldingRegion.startLineNumber === lineNumber) {\n\t\t// Find max line number to stay within parent.\n\t\tlet expectedParentIndex = foldingRegion.parentIndex;\n\t\tlet maxLineNumber = 0;\n\t\tif (expectedParentIndex !== -1) {\n\t\t\tmaxLineNumber = foldingModel.regions.getEndLineNumber(foldingRegion.parentIndex);\n\t\t} else if (foldingModel.regions.length === 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tmaxLineNumber = foldingModel.regions.getEndLineNumber(foldingModel.regions.length - 1);\n\t\t}\n\n\t\t// Find fold at same level.\n\t\twhile (foldingRegion !== null) {\n\t\t\tif (foldingRegion.regionIndex < foldingModel.regions.length) {\n\t\t\t\tfoldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex + 1);\n\n\t\t\t\t// Keep at same level.\n\t\t\t\tif (foldingRegion.startLineNumber >= maxLineNumber) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else if (foldingRegion.parentIndex === expectedParentIndex) {\n\t\t\t\t\treturn foldingRegion.startLineNumber;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Go to first fold that's after the current line.\n\t\tif (foldingModel.regions.length > 0) {\n\t\t\tfoldingRegion = foldingModel.regions.toRegion(0);\n\t\t\twhile (foldingRegion !== null) {\n\t\t\t\t// Found fold after current line.\n\t\t\t\tif (foldingRegion.startLineNumber > lineNumber) {\n\t\t\t\t\treturn foldingRegion.startLineNumber;\n\t\t\t\t}\n\t\t\t\tif (foldingRegion.regionIndex < foldingModel.regions.length) {\n\t\t\t\t\tfoldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex + 1);\n\t\t\t\t} else {\n\t\t\t\t\tfoldingRegion = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\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 { findFirstInSorted } from 'vs/base/common/arrays';\n\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { countEOL } from 'vs/editor/common/core/eolCounter';\nimport { CollapseMemento, FoldingModel } from 'vs/editor/contrib/folding/browser/foldingModel';\n\nexport class HiddenRangeModel {\n\n\tprivate readonly _foldingModel: FoldingModel;\n\tprivate _hiddenRanges: IRange[];\n\tprivate _foldingModelListener: IDisposable | null;\n\tprivate readonly _updateEventEmitter = new Emitter<IRange[]>();\n\tprivate _hasLineChanges: boolean = false;\n\n\tpublic get onDidChange(): Event<IRange[]> { return this._updateEventEmitter.event; }\n\tpublic get hiddenRanges() { return this._hiddenRanges; }\n\n\tpublic constructor(model: FoldingModel) {\n\t\tthis._foldingModel = model;\n\t\tthis._foldingModelListener = model.onDidChange(_ => this.updateHiddenRanges());\n\t\tthis._hiddenRanges = [];\n\t\tif (model.regions.length) {\n\t\t\tthis.updateHiddenRanges();\n\t\t}\n\t}\n\n\tpublic notifyChangeModelContent(e: IModelContentChangedEvent) {\n\t\tif (this._hiddenRanges.length && !this._hasLineChanges) {\n\t\t\tthis._hasLineChanges = e.changes.some(change => {\n\t\t\t\treturn change.range.endLineNumber !== change.range.startLineNumber || countEOL(change.text)[0] !== 0;\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateHiddenRanges(): void {\n\t\tlet updateHiddenAreas = false;\n\t\tlet newHiddenAreas: IRange[] = [];\n\t\tlet i = 0; // index into hidden\n\t\tlet k = 0;\n\n\t\tlet lastCollapsedStart = Number.MAX_VALUE;\n\t\tlet lastCollapsedEnd = -1;\n\n\t\tlet ranges = this._foldingModel.regions;\n\t\tfor (; i < ranges.length; i++) {\n\t\t\tif (!ranges.isCollapsed(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet startLineNumber = ranges.getStartLineNumber(i) + 1; // the first line is not hidden\n\t\t\tlet endLineNumber = ranges.getEndLineNumber(i);\n\t\t\tif (lastCollapsedStart <= startLineNumber && endLineNumber <= lastCollapsedEnd) {\n\t\t\t\t// ignore ranges contained in collapsed regions\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!updateHiddenAreas && k < this._hiddenRanges.length && this._hiddenRanges[k].startLineNumber === startLineNumber && this._hiddenRanges[k].endLineNumber === endLineNumber) {\n\t\t\t\t// reuse the old ranges\n\t\t\t\tnewHiddenAreas.push(this._hiddenRanges[k]);\n\t\t\t\tk++;\n\t\t\t} else {\n\t\t\t\tupdateHiddenAreas = true;\n\t\t\t\tnewHiddenAreas.push(new Range(startLineNumber, 1, endLineNumber, 1));\n\t\t\t}\n\t\t\tlastCollapsedStart = startLineNumber;\n\t\t\tlastCollapsedEnd = endLineNumber;\n\t\t}\n\t\tif (this._hasLineChanges || updateHiddenAreas || k < this._hiddenRanges.length) {\n\t\t\tthis.applyHiddenRanges(newHiddenAreas);\n\t\t}\n\t}\n\n\tpublic applyMemento(state: CollapseMemento): boolean {\n\t\tif (!Array.isArray(state) || state.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tlet hiddenRanges: IRange[] = [];\n\t\tfor (let r of state) {\n\t\t\tif (!r.startLineNumber || !r.endLineNumber) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thiddenRanges.push(new Range(r.startLineNumber + 1, 1, r.endLineNumber, 1));\n\t\t}\n\t\tthis.applyHiddenRanges(hiddenRanges);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Collapse state memento, for persistence only, only used if folding model is not yet initialized\n\t */\n\tpublic getMemento(): CollapseMemento {\n\t\treturn this._hiddenRanges.map(r => ({ startLineNumber: r.startLineNumber - 1, endLineNumber: r.endLineNumber }));\n\t}\n\n\tprivate applyHiddenRanges(newHiddenAreas: IRange[]) {\n\t\tthis._hiddenRanges = newHiddenAreas;\n\t\tthis._hasLineChanges = false;\n\t\tthis._updateEventEmitter.fire(newHiddenAreas);\n\t}\n\n\tpublic hasRanges() {\n\t\treturn this._hiddenRanges.length > 0;\n\t}\n\n\tpublic isHidden(line: number): boolean {\n\t\treturn findRange(this._hiddenRanges, line) !== null;\n\t}\n\n\tpublic adjustSelections(selections: Selection[]): boolean {\n\t\tlet hasChanges = false;\n\t\tlet editorModel = this._foldingModel.textModel;\n\t\tlet lastRange: IRange | null = null;\n\n\t\tlet adjustLine = (line: number) => {\n\t\t\tif (!lastRange || !isInside(line, lastRange)) {\n\t\t\t\tlastRange = findRange(this._hiddenRanges, line);\n\t\t\t}\n\t\t\tif (lastRange) {\n\t\t\t\treturn lastRange.startLineNumber - 1;\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tlet selection = selections[i];\n\t\t\tlet adjustedStartLine = adjustLine(selection.startLineNumber);\n\t\t\tif (adjustedStartLine) {\n\t\t\t\tselection = selection.setStartPosition(adjustedStartLine, editorModel.getLineMaxColumn(adjustedStartLine));\n\t\t\t\thasChanges = true;\n\t\t\t}\n\t\t\tlet adjustedEndLine = adjustLine(selection.endLineNumber);\n\t\t\tif (adjustedEndLine) {\n\t\t\t\tselection = selection.setEndPosition(adjustedEndLine, editorModel.getLineMaxColumn(adjustedEndLine));\n\t\t\t\thasChanges = true;\n\t\t\t}\n\t\t\tselections[i] = selection;\n\t\t}\n\t\treturn hasChanges;\n\t}\n\n\n\tpublic dispose() {\n\t\tif (this.hiddenRanges.length > 0) {\n\t\t\tthis._hiddenRanges = [];\n\t\t\tthis._updateEventEmitter.fire(this._hiddenRanges);\n\t\t}\n\t\tif (this._foldingModelListener) {\n\t\t\tthis._foldingModelListener.dispose();\n\t\t\tthis._foldingModelListener = null;\n\t\t}\n\t}\n}\n\nfunction isInside(line: number, range: IRange) {\n\treturn line >= range.startLineNumber && line <= range.endLineNumber;\n}\nfunction findRange(ranges: IRange[], line: number): IRange | null {\n\tlet i = findFirstInSorted(ranges, r => line < r.startLineNumber) - 1;\n\tif (i >= 0 && ranges[i].endLineNumber >= line) {\n\t\treturn ranges[i];\n\t}\n\treturn null;\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { computeIndentLevel } from 'vs/editor/common/model/utils';\nimport { FoldingMarkers } from 'vs/editor/common/languages/languageConfiguration';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { FoldingRegions, MAX_LINE_NUMBER } from 'vs/editor/contrib/folding/browser/foldingRanges';\nimport { RangeProvider } from './folding';\n\nconst MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT = 5000;\n\nexport const ID_INDENT_PROVIDER = 'indent';\n\nexport class IndentRangeProvider implements RangeProvider {\n\treadonly id = ID_INDENT_PROVIDER;\n\n\tconstructor(\n\t\tprivate readonly editorModel: ITextModel,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService,\n\t\tprivate readonly maxFoldingRegions: number\n\t) { }\n\n\tdispose() { }\n\n\tcompute(cancelationToken: CancellationToken, notifyTooManyRegions: (maxRegions: number) => void): Promise<FoldingRegions> {\n\t\tlet foldingRules = this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules;\n\t\tlet offSide = foldingRules && !!foldingRules.offSide;\n\t\tlet markers = foldingRules && foldingRules.markers;\n\t\treturn Promise.resolve(computeRanges(this.editorModel, offSide, markers, this.maxFoldingRegions, notifyTooManyRegions));\n\t}\n}\n\n// public only for testing\nexport class RangesCollector {\n\tprivate readonly _startIndexes: number[];\n\tprivate readonly _endIndexes: number[];\n\tprivate readonly _indentOccurrences: number[];\n\tprivate _length: number;\n\tprivate readonly _foldingRangesLimit: number;\n\n\tconstructor(foldingRangesLimit: number, private readonly _notifyTooManyRegions?: (maxRegions: number) => void) {\n\t\tthis._startIndexes = [];\n\t\tthis._endIndexes = [];\n\t\tthis._indentOccurrences = [];\n\t\tthis._length = 0;\n\t\tthis._foldingRangesLimit = foldingRangesLimit;\n\t}\n\n\tpublic insertFirst(startLineNumber: number, endLineNumber: number, indent: number) {\n\t\tif (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) {\n\t\t\treturn;\n\t\t}\n\t\tlet index = this._length;\n\t\tthis._startIndexes[index] = startLineNumber;\n\t\tthis._endIndexes[index] = endLineNumber;\n\t\tthis._length++;\n\t\tif (indent < 1000) {\n\t\t\tthis._indentOccurrences[indent] = (this._indentOccurrences[indent] || 0) + 1;\n\t\t}\n\t}\n\n\tpublic toIndentRanges(model: ITextModel) {\n\t\tif (this._length <= this._foldingRangesLimit) {\n\t\t\t// reverse and create arrays of the exact length\n\t\t\tlet startIndexes = new Uint32Array(this._length);\n\t\t\tlet endIndexes = new Uint32Array(this._length);\n\t\t\tfor (let i = this._length - 1, k = 0; i >= 0; i--, k++) {\n\t\t\t\tstartIndexes[k] = this._startIndexes[i];\n\t\t\t\tendIndexes[k] = this._endIndexes[i];\n\t\t\t}\n\t\t\treturn new FoldingRegions(startIndexes, endIndexes);\n\t\t} else {\n\t\t\tif (this._notifyTooManyRegions) {\n\t\t\t\tthis._notifyTooManyRegions(this._foldingRangesLimit);\n\t\t\t}\n\t\t\tlet entries = 0;\n\t\t\tlet maxIndent = this._indentOccurrences.length;\n\t\t\tfor (let i = 0; i < this._indentOccurrences.length; i++) {\n\t\t\t\tlet n = this._indentOccurrences[i];\n\t\t\t\tif (n) {\n\t\t\t\t\tif (n + entries > this._foldingRangesLimit) {\n\t\t\t\t\t\tmaxIndent = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tentries += n;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst tabSize = model.getOptions().tabSize;\n\t\t\t// reverse and create arrays of the exact length\n\t\t\tlet startIndexes = new Uint32Array(this._foldingRangesLimit);\n\t\t\tlet endIndexes = new Uint32Array(this._foldingRangesLimit);\n\t\t\tfor (let i = this._length - 1, k = 0; i >= 0; i--) {\n\t\t\t\tlet startIndex = this._startIndexes[i];\n\t\t\t\tlet lineContent = model.getLineContent(startIndex);\n\t\t\t\tlet indent = computeIndentLevel(lineContent, tabSize);\n\t\t\t\tif (indent < maxIndent || (indent === maxIndent && entries++ < this._foldingRangesLimit)) {\n\t\t\t\t\tstartIndexes[k] = startIndex;\n\t\t\t\t\tendIndexes[k] = this._endIndexes[i];\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new FoldingRegions(startIndexes, endIndexes);\n\t\t}\n\n\t}\n}\n\n\ninterface PreviousRegion {\n\tindent: number; // indent or -2 if a marker\n\tendAbove: number; // end line number for the region above\n\tline: number; // start line of the region. Only used for marker regions.\n}\n\nexport function computeRanges(model: ITextModel, offSide: boolean, markers?: FoldingMarkers, foldingRangesLimit?: number, notifyTooManyRegions?: (maxRegions: number) => void): FoldingRegions {\n\tconst tabSize = model.getOptions().tabSize;\n\tfoldingRangesLimit = foldingRangesLimit ?? MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT;\n\tlet result = new RangesCollector(foldingRangesLimit, notifyTooManyRegions);\n\n\tlet pattern: RegExp | undefined = undefined;\n\tif (markers) {\n\t\tpattern = new RegExp(`(${markers.start.source})|(?:${markers.end.source})`);\n\t}\n\n\tlet previousRegions: PreviousRegion[] = [];\n\tlet line = model.getLineCount() + 1;\n\tpreviousRegions.push({ indent: -1, endAbove: line, line }); // sentinel, to make sure there's at least one entry\n\n\tfor (let line = model.getLineCount(); line > 0; line--) {\n\t\tlet lineContent = model.getLineContent(line);\n\t\tlet indent = computeIndentLevel(lineContent, tabSize);\n\t\tlet previous = previousRegions[previousRegions.length - 1];\n\t\tif (indent === -1) {\n\t\t\tif (offSide) {\n\t\t\t\t// for offSide languages, empty lines are associated to the previous block\n\t\t\t\t// note: the next block is already written to the results, so this only\n\t\t\t\t// impacts the end position of the block before\n\t\t\t\tprevious.endAbove = line;\n\t\t\t}\n\t\t\tcontinue; // only whitespace\n\t\t}\n\t\tlet m;\n\t\tif (pattern && (m = lineContent.match(pattern))) {\n\t\t\t// folding pattern match\n\t\t\tif (m[1]) { // start pattern match\n\t\t\t\t// discard all regions until the folding pattern\n\t\t\t\tlet i = previousRegions.length - 1;\n\t\t\t\twhile (i > 0 && previousRegions[i].indent !== -2) {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tpreviousRegions.length = i + 1;\n\t\t\t\t\tprevious = previousRegions[i];\n\n\t\t\t\t\t// new folding range from pattern, includes the end line\n\t\t\t\t\tresult.insertFirst(line, previous.line, indent);\n\t\t\t\t\tprevious.line = line;\n\t\t\t\t\tprevious.indent = indent;\n\t\t\t\t\tprevious.endAbove = line;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// no end marker found, treat line as a regular line\n\t\t\t\t}\n\t\t\t} else { // end pattern match\n\t\t\t\tpreviousRegions.push({ indent: -2, endAbove: line, line });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (previous.indent > indent) {\n\t\t\t// discard all regions with larger indent\n\t\t\tdo {\n\t\t\t\tpreviousRegions.pop();\n\t\t\t\tprevious = previousRegions[previousRegions.length - 1];\n\t\t\t} while (previous.indent > indent);\n\n\t\t\t// new folding range\n\t\t\tlet endLineNumber = previous.endAbove - 1;\n\t\t\tif (endLineNumber - line >= 1) { // needs at east size 1\n\t\t\t\tresult.insertFirst(line, endLineNumber, indent);\n\t\t\t}\n\t\t}\n\t\tif (previous.indent === indent) {\n\t\t\tprevious.endAbove = line;\n\t\t} else { // previous.indent < indent\n\t\t\t// new region with a bigger indent\n\t\t\tpreviousRegions.push({ indent, endAbove: line, line });\n\t\t}\n\t}\n\treturn result.toIndentRanges(model);\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { FoldingContext, FoldingRange, FoldingRangeProvider } from 'vs/editor/common/languages';\nimport { RangeProvider } from './folding';\nimport { FoldingRegions, MAX_LINE_NUMBER } from './foldingRanges';\n\nexport interface IFoldingRangeData extends FoldingRange {\n\trank: number;\n}\n\nconst foldingContext: FoldingContext = {\n};\n\nexport const ID_SYNTAX_PROVIDER = 'syntax';\n\nexport class SyntaxRangeProvider implements RangeProvider {\n\n\treadonly id = ID_SYNTAX_PROVIDER;\n\n\treadonly disposables: DisposableStore | undefined;\n\n\tconstructor(private readonly editorModel: ITextModel, private providers: FoldingRangeProvider[], handleFoldingRangesChange: () => void, private limit: number) {\n\t\tfor (const provider of providers) {\n\t\t\tif (typeof provider.onDidChange === 'function') {\n\t\t\t\tif (!this.disposables) {\n\t\t\t\t\tthis.disposables = new DisposableStore();\n\t\t\t\t}\n\t\t\t\tthis.disposables.add(provider.onDidChange(handleFoldingRangesChange));\n\t\t\t}\n\t\t}\n\t}\n\n\tcompute(cancellationToken: CancellationToken, notifyTooManyRegions?: (maxRegions: number) => void): Promise<FoldingRegions | null> {\n\t\treturn collectSyntaxRanges(this.providers, this.editorModel, cancellationToken).then(ranges => {\n\t\t\tif (ranges) {\n\t\t\t\tlet res = sanitizeRanges(ranges, this.limit, notifyTooManyRegions);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn null;\n\t\t});\n\t}\n\n\tdispose() {\n\t\tthis.disposables?.dispose();\n\t}\n}\n\nfunction collectSyntaxRanges(providers: FoldingRangeProvider[], model: ITextModel, cancellationToken: CancellationToken): Promise<IFoldingRangeData[] | null> {\n\tlet rangeData: IFoldingRangeData[] | null = null;\n\tlet promises = providers.map((provider, i) => {\n\t\treturn Promise.resolve(provider.provideFoldingRanges(model, foldingContext, cancellationToken)).then(ranges => {\n\t\t\tif (cancellationToken.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (Array.isArray(ranges)) {\n\t\t\t\tif (!Array.isArray(rangeData)) {\n\t\t\t\t\trangeData = [];\n\t\t\t\t}\n\t\t\t\tlet nLines = model.getLineCount();\n\t\t\t\tfor (let r of ranges) {\n\t\t\t\t\tif (r.start > 0 && r.end > r.start && r.end <= nLines) {\n\t\t\t\t\t\trangeData.push({ start: r.start, end: r.end, rank: i, kind: r.kind });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, onUnexpectedExternalError);\n\t});\n\treturn Promise.all(promises).then(_ => {\n\t\treturn rangeData;\n\t});\n}\n\nexport class RangesCollector {\n\tprivate readonly _startIndexes: number[];\n\tprivate readonly _endIndexes: number[];\n\tprivate readonly _nestingLevels: number[];\n\tprivate readonly _nestingLevelCounts: number[];\n\tprivate readonly _types: Array<string | undefined>;\n\tprivate _length: number;\n\tprivate readonly _foldingRangesLimit: number;\n\n\tconstructor(foldingRangesLimit: number, private readonly _notifyTooManyRegions?: (maxRegions: number) => void) {\n\t\tthis._startIndexes = [];\n\t\tthis._endIndexes = [];\n\t\tthis._nestingLevels = [];\n\t\tthis._nestingLevelCounts = [];\n\t\tthis._types = [];\n\t\tthis._length = 0;\n\t\tthis._foldingRangesLimit = foldingRangesLimit;\n\t}\n\n\tpublic add(startLineNumber: number, endLineNumber: number, type: string | undefined, nestingLevel: number) {\n\t\tif (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) {\n\t\t\treturn;\n\t\t}\n\t\tlet index = this._length;\n\t\tthis._startIndexes[index] = startLineNumber;\n\t\tthis._endIndexes[index] = endLineNumber;\n\t\tthis._nestingLevels[index] = nestingLevel;\n\t\tthis._types[index] = type;\n\t\tthis._length++;\n\t\tif (nestingLevel < 30) {\n\t\t\tthis._nestingLevelCounts[nestingLevel] = (this._nestingLevelCounts[nestingLevel] || 0) + 1;\n\t\t}\n\t}\n\n\tpublic toIndentRanges() {\n\t\tif (this._length <= this._foldingRangesLimit) {\n\t\t\tlet startIndexes = new Uint32Array(this._length);\n\t\t\tlet endIndexes = new Uint32Array(this._length);\n\t\t\tfor (let i = 0; i < this._length; i++) {\n\t\t\t\tstartIndexes[i] = this._startIndexes[i];\n\t\t\t\tendIndexes[i] = this._endIndexes[i];\n\t\t\t}\n\t\t\treturn new FoldingRegions(startIndexes, endIndexes, this._types);\n\t\t} else {\n\t\t\tif (this._notifyTooManyRegions) {\n\t\t\t\tthis._notifyTooManyRegions(this._foldingRangesLimit);\n\t\t\t}\n\t\t\tlet entries = 0;\n\t\t\tlet maxLevel = this._nestingLevelCounts.length;\n\t\t\tfor (let i = 0; i < this._nestingLevelCounts.length; i++) {\n\t\t\t\tlet n = this._nestingLevelCounts[i];\n\t\t\t\tif (n) {\n\t\t\t\t\tif (n + entries > this._foldingRangesLimit) {\n\t\t\t\t\t\tmaxLevel = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tentries += n;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet startIndexes = new Uint32Array(this._foldingRangesLimit);\n\t\t\tlet endIndexes = new Uint32Array(this._foldingRangesLimit);\n\t\t\tlet types: Array<string | undefined> = [];\n\t\t\tfor (let i = 0, k = 0; i < this._length; i++) {\n\t\t\t\tlet level = this._nestingLevels[i];\n\t\t\t\tif (level < maxLevel || (level === maxLevel && entries++ < this._foldingRangesLimit)) {\n\t\t\t\t\tstartIndexes[k] = this._startIndexes[i];\n\t\t\t\t\tendIndexes[k] = this._endIndexes[i];\n\t\t\t\t\ttypes[k] = this._types[i];\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new FoldingRegions(startIndexes, endIndexes, types);\n\t\t}\n\n\t}\n\n}\n\nexport function sanitizeRanges(rangeData: IFoldingRangeData[], limit: number, notifyTooManyRegions?: (maxRegions: number) => void): FoldingRegions {\n\tlet sorted = rangeData.sort((d1, d2) => {\n\t\tlet diff = d1.start - d2.start;\n\t\tif (diff === 0) {\n\t\t\tdiff = d1.rank - d2.rank;\n\t\t}\n\t\treturn diff;\n\t});\n\tlet collector = new RangesCollector(limit, notifyTooManyRegions);\n\n\tlet top: IFoldingRangeData | undefined = undefined;\n\tlet previous: IFoldingRangeData[] = [];\n\tfor (let entry of sorted) {\n\t\tif (!top) {\n\t\t\ttop = entry;\n\t\t\tcollector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length);\n\t\t} else {\n\t\t\tif (entry.start > top.start) {\n\t\t\t\tif (entry.end <= top.end) {\n\t\t\t\t\tprevious.push(top);\n\t\t\t\t\ttop = entry;\n\t\t\t\t\tcollector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length);\n\t\t\t\t} else {\n\t\t\t\t\tif (entry.start > top.end) {\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\ttop = previous.pop();\n\t\t\t\t\t\t} while (top && entry.start > top.end);\n\t\t\t\t\t\tif (top) {\n\t\t\t\t\t\t\tprevious.push(top);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttop = entry;\n\t\t\t\t\t}\n\t\t\t\t\tcollector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn collector.toIndentRanges();\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { FoldingRegions, ILineRange } from 'vs/editor/contrib/folding/browser/foldingRanges';\nimport { IFoldingRangeData, sanitizeRanges } from 'vs/editor/contrib/folding/browser/syntaxRangeProvider';\nimport { RangeProvider } from './folding';\n\nexport const ID_INIT_PROVIDER = 'init';\n\nexport class InitializingRangeProvider implements RangeProvider {\n\treadonly id = ID_INIT_PROVIDER;\n\n\tprivate decorationIds: string[] | undefined;\n\tprivate timeout: any;\n\n\tconstructor(private readonly editorModel: ITextModel, initialRanges: ILineRange[], onTimeout: () => void, timeoutTime: number) {\n\t\tif (initialRanges.length) {\n\t\t\tlet toDecorationRange = (range: ILineRange): IModelDeltaDecoration => {\n\t\t\t\treturn {\n\t\t\t\t\trange: {\n\t\t\t\t\t\tstartLineNumber: range.startLineNumber,\n\t\t\t\t\t\tstartColumn: 0,\n\t\t\t\t\t\tendLineNumber: range.endLineNumber,\n\t\t\t\t\t\tendColumn: editorModel.getLineLength(range.endLineNumber)\n\t\t\t\t\t},\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'folding-initializing-range-provider',\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t\tthis.decorationIds = editorModel.deltaDecorations([], initialRanges.map(toDecorationRange));\n\t\t\tthis.timeout = setTimeout(onTimeout, timeoutTime);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this.decorationIds) {\n\t\t\tthis.editorModel.deltaDecorations(this.decorationIds, []);\n\t\t\tthis.decorationIds = undefined;\n\t\t}\n\t\tif (typeof this.timeout === 'number') {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = undefined;\n\t\t}\n\t}\n\n\tcompute(cancelationToken: CancellationToken): Promise<FoldingRegions> {\n\t\tlet foldingRangeData: IFoldingRangeData[] = [];\n\t\tif (this.decorationIds) {\n\t\t\tfor (let id of this.decorationIds) {\n\t\t\t\tlet range = this.editorModel.getDecorationRange(id);\n\t\t\t\tif (range) {\n\t\t\t\t\tfoldingRangeData.push({ start: range.startLineNumber, end: range.endLineNumber, rank: 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Promise.resolve(sanitizeRanges(foldingRangeData, Number.MAX_VALUE));\n\t}\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EndOfLineSequence } from 'vs/editor/common/model';\nimport { TextEdit } from 'vs/editor/common/languages';\n\nexport class FormattingEdit {\n\n\tprivate static _handleEolEdits(editor: ICodeEditor, edits: TextEdit[]): ISingleEditOperation[] {\n\t\tlet newEol: EndOfLineSequence | undefined = undefined;\n\t\tlet singleEdits: ISingleEditOperation[] = [];\n\n\t\tfor (let edit of edits) {\n\t\t\tif (typeof edit.eol === 'number') {\n\t\t\t\tnewEol = edit.eol;\n\t\t\t}\n\t\t\tif (edit.range && typeof edit.text === 'string') {\n\t\t\t\tsingleEdits.push(edit);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof newEol === 'number') {\n\t\t\tif (editor.hasModel()) {\n\t\t\t\teditor.getModel().pushEOL(newEol);\n\t\t\t}\n\t\t}\n\n\t\treturn singleEdits;\n\t}\n\n\tprivate static _isFullModelReplaceEdit(editor: ICodeEditor, edit: ISingleEditOperation): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst editRange = model.validateRange(edit.range);\n\t\tconst fullModelRange = model.getFullModelRange();\n\t\treturn fullModelRange.equalsRange(editRange);\n\t}\n\n\tstatic execute(editor: ICodeEditor, _edits: TextEdit[], addUndoStops: boolean) {\n\t\tif (addUndoStops) {\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t\tconst edits = FormattingEdit._handleEolEdits(editor, _edits);\n\t\tif (edits.length === 1 && FormattingEdit._isFullModelReplaceEdit(editor, edits[0])) {\n\t\t\t// We use replace semantics and hope that markers stay put...\n\t\t\teditor.executeEdits('formatEditsCommand', edits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text)));\n\t\t} else {\n\t\t\teditor.executeEdits('formatEditsCommand', edits.map(edit => EditOperation.replaceMove(Range.lift(edit.range), edit.text)));\n\t\t}\n\t\tif (addUndoStops) {\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t}\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { ICodeEditor, IEditorMouseEvent, IMouseTarget } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\n\nfunction hasModifier(e: { ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean }, modifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey'): boolean {\n\treturn !!e[modifier];\n}\n\n/**\n * An event that encapsulates the various trigger modifiers logic needed for go to definition.\n */\nexport class ClickLinkMouseEvent {\n\n\tpublic readonly target: IMouseTarget;\n\tpublic readonly hasTriggerModifier: boolean;\n\tpublic readonly hasSideBySideModifier: boolean;\n\tpublic readonly isNoneOrSingleMouseDown: boolean;\n\n\tconstructor(source: IEditorMouseEvent, opts: ClickLinkOptions) {\n\t\tthis.target = source.target;\n\t\tthis.hasTriggerModifier = hasModifier(source.event, opts.triggerModifier);\n\t\tthis.hasSideBySideModifier = hasModifier(source.event, opts.triggerSideBySideModifier);\n\t\tthis.isNoneOrSingleMouseDown = (source.event.detail <= 1);\n\t}\n}\n\n/**\n * An event that encapsulates the various trigger modifiers logic needed for go to definition.\n */\nexport class ClickLinkKeyboardEvent {\n\n\tpublic readonly keyCodeIsTriggerKey: boolean;\n\tpublic readonly keyCodeIsSideBySideKey: boolean;\n\tpublic readonly hasTriggerModifier: boolean;\n\n\tconstructor(source: IKeyboardEvent, opts: ClickLinkOptions) {\n\t\tthis.keyCodeIsTriggerKey = (source.keyCode === opts.triggerKey);\n\t\tthis.keyCodeIsSideBySideKey = (source.keyCode === opts.triggerSideBySideKey);\n\t\tthis.hasTriggerModifier = hasModifier(source, opts.triggerModifier);\n\t}\n}\nexport type TriggerModifier = 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey';\n\nexport class ClickLinkOptions {\n\n\tpublic readonly triggerKey: KeyCode;\n\tpublic readonly triggerModifier: TriggerModifier;\n\tpublic readonly triggerSideBySideKey: KeyCode;\n\tpublic readonly triggerSideBySideModifier: TriggerModifier;\n\n\tconstructor(\n\t\ttriggerKey: KeyCode,\n\t\ttriggerModifier: TriggerModifier,\n\t\ttriggerSideBySideKey: KeyCode,\n\t\ttriggerSideBySideModifier: TriggerModifier\n\t) {\n\t\tthis.triggerKey = triggerKey;\n\t\tthis.triggerModifier = triggerModifier;\n\t\tthis.triggerSideBySideKey = triggerSideBySideKey;\n\t\tthis.triggerSideBySideModifier = triggerSideBySideModifier;\n\t}\n\n\tpublic equals(other: ClickLinkOptions): boolean {\n\t\treturn (\n\t\t\tthis.triggerKey === other.triggerKey\n\t\t\t&& this.triggerModifier === other.triggerModifier\n\t\t\t&& this.triggerSideBySideKey === other.triggerSideBySideKey\n\t\t\t&& this.triggerSideBySideModifier === other.triggerSideBySideModifier\n\t\t);\n\t}\n}\n\nfunction createOptions(multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'): ClickLinkOptions {\n\tif (multiCursorModifier === 'altKey') {\n\t\tif (platform.isMacintosh) {\n\t\t\treturn new ClickLinkOptions(KeyCode.Meta, 'metaKey', KeyCode.Alt, 'altKey');\n\t\t}\n\t\treturn new ClickLinkOptions(KeyCode.Ctrl, 'ctrlKey', KeyCode.Alt, 'altKey');\n\t}\n\n\tif (platform.isMacintosh) {\n\t\treturn new ClickLinkOptions(KeyCode.Alt, 'altKey', KeyCode.Meta, 'metaKey');\n\t}\n\treturn new ClickLinkOptions(KeyCode.Alt, 'altKey', KeyCode.Ctrl, 'ctrlKey');\n}\n\nexport class ClickLinkGesture extends Disposable {\n\n\tprivate readonly _onMouseMoveOrRelevantKeyDown: Emitter<[ClickLinkMouseEvent, ClickLinkKeyboardEvent | null]> = this._register(new Emitter<[ClickLinkMouseEvent, ClickLinkKeyboardEvent | null]>());\n\tpublic readonly onMouseMoveOrRelevantKeyDown: Event<[ClickLinkMouseEvent, ClickLinkKeyboardEvent | null]> = this._onMouseMoveOrRelevantKeyDown.event;\n\n\tprivate readonly _onExecute: Emitter<ClickLinkMouseEvent> = this._register(new Emitter<ClickLinkMouseEvent>());\n\tpublic readonly onExecute: Event<ClickLinkMouseEvent> = this._onExecute.event;\n\n\tprivate readonly _onCancel: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onCancel: Event<void> = this._onCancel.event;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _opts: ClickLinkOptions;\n\n\tprivate _lastMouseMoveEvent: ClickLinkMouseEvent | null;\n\tprivate _hasTriggerKeyOnMouseDown: boolean;\n\tprivate _lineNumberOnMouseDown: number;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._opts = createOptions(this._editor.getOption(EditorOption.multiCursorModifier));\n\n\t\tthis._lastMouseMoveEvent = null;\n\t\tthis._hasTriggerKeyOnMouseDown = false;\n\t\tthis._lineNumberOnMouseDown = 0;\n\n\t\tthis._register(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.multiCursorModifier)) {\n\t\t\t\tconst newOpts = createOptions(this._editor.getOption(EditorOption.multiCursorModifier));\n\t\t\t\tif (this._opts.equals(newOpts)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._opts = newOpts;\n\t\t\t\tthis._lastMouseMoveEvent = null;\n\t\t\t\tthis._hasTriggerKeyOnMouseDown = false;\n\t\t\t\tthis._lineNumberOnMouseDown = 0;\n\t\t\t\tthis._onCancel.fire();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(new ClickLinkMouseEvent(e, this._opts))));\n\t\tthis._register(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(new ClickLinkMouseEvent(e, this._opts))));\n\t\tthis._register(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(new ClickLinkMouseEvent(e, this._opts))));\n\t\tthis._register(this._editor.onKeyDown((e: IKeyboardEvent) => this._onEditorKeyDown(new ClickLinkKeyboardEvent(e, this._opts))));\n\t\tthis._register(this._editor.onKeyUp((e: IKeyboardEvent) => this._onEditorKeyUp(new ClickLinkKeyboardEvent(e, this._opts))));\n\t\tthis._register(this._editor.onMouseDrag(() => this._resetHandler()));\n\n\t\tthis._register(this._editor.onDidChangeCursorSelection((e) => this._onDidChangeCursorSelection(e)));\n\t\tthis._register(this._editor.onDidChangeModel((e) => this._resetHandler()));\n\t\tthis._register(this._editor.onDidChangeModelContent(() => this._resetHandler()));\n\t\tthis._register(this._editor.onDidScrollChange((e) => {\n\t\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\t\tthis._resetHandler();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onDidChangeCursorSelection(e: ICursorSelectionChangedEvent): void {\n\t\tif (e.selection && e.selection.startColumn !== e.selection.endColumn) {\n\t\t\tthis._resetHandler(); // immediately stop this feature if the user starts to select (https://github.com/microsoft/vscode/issues/7827)\n\t\t}\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent): void {\n\t\tthis._lastMouseMoveEvent = mouseEvent;\n\n\t\tthis._onMouseMoveOrRelevantKeyDown.fire([mouseEvent, null]);\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: ClickLinkMouseEvent): void {\n\t\t// We need to record if we had the trigger key on mouse down because someone might select something in the editor\n\t\t// holding the mouse down and then while mouse is down start to press Ctrl/Cmd to start a copy operation and then\n\t\t// release the mouse button without wanting to do the navigation.\n\t\t// With this flag we prevent goto definition if the mouse was down before the trigger key was pressed.\n\t\tthis._hasTriggerKeyOnMouseDown = mouseEvent.hasTriggerModifier;\n\t\tthis._lineNumberOnMouseDown = mouseEvent.target.position ? mouseEvent.target.position.lineNumber : 0;\n\t}\n\n\tprivate _onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void {\n\t\tconst currentLineNumber = mouseEvent.target.position ? mouseEvent.target.position.lineNumber : 0;\n\t\tif (this._hasTriggerKeyOnMouseDown && this._lineNumberOnMouseDown && this._lineNumberOnMouseDown === currentLineNumber) {\n\t\t\tthis._onExecute.fire(mouseEvent);\n\t\t}\n\t}\n\n\tprivate _onEditorKeyDown(e: ClickLinkKeyboardEvent): void {\n\t\tif (\n\t\t\tthis._lastMouseMoveEvent\n\t\t\t&& (\n\t\t\t\te.keyCodeIsTriggerKey // User just pressed Ctrl/Cmd (normal goto definition)\n\t\t\t\t|| (e.keyCodeIsSideBySideKey && e.hasTriggerModifier) // User pressed Ctrl/Cmd+Alt (goto definition to the side)\n\t\t\t)\n\t\t) {\n\t\t\tthis._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e]);\n\t\t} else if (e.hasTriggerModifier) {\n\t\t\tthis._onCancel.fire(); // remove decorations if user holds another key with ctrl/cmd to prevent accident goto declaration\n\t\t}\n\t}\n\n\tprivate _onEditorKeyUp(e: ClickLinkKeyboardEvent): void {\n\t\tif (e.keyCodeIsTriggerKey) {\n\t\t\tthis._onCancel.fire();\n\t\t}\n\t}\n\n\tprivate _resetHandler(): void {\n\t\tthis._lastMouseMoveEvent = null;\n\t\tthis._hasTriggerKeyOnMouseDown = false;\n\t\tthis._onCancel.fire();\n\t}\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 { AsyncIterableObject, CancelableAsyncIterableObject, createCancelableAsyncIterable, RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nexport interface IHoverComputer<T> {\n\t/**\n\t * This is called after half the hover time\n\t */\n\tcomputeAsync?: (token: CancellationToken) => AsyncIterableObject<T>;\n\t/**\n\t * This is called after all the hover time\n\t */\n\tcomputeSync?: () => T[];\n}\n\nconst enum HoverOperationState {\n\tIdle,\n\tFirstWait,\n\tSecondWait,\n\tWaitingForAsync = 3,\n\tWaitingForAsyncShowingLoading = 4,\n}\n\nexport const enum HoverStartMode {\n\tDelayed = 0,\n\tImmediate = 1\n}\n\nexport class HoverResult<T> {\n\tconstructor(\n\t\tpublic readonly value: T[],\n\t\tpublic readonly isComplete: boolean,\n\t\tpublic readonly hasLoadingMessage: boolean,\n\t) { }\n}\n\n/**\n * Computing the hover is very fine tuned.\n *\n * Suppose the hover delay is 300ms (the default). Then, when resting the mouse at an anchor:\n * - at 150ms, the async computation is triggered (i.e. semantic hover)\n * - if async results already come in, they are not rendered yet.\n * - at 300ms, the sync computation is triggered (i.e. decorations, markers)\n * - if there are sync or async results, they are rendered.\n * - at 900ms, if the async computation hasn't finished, a \"Loading...\" result is added.\n */\nexport class HoverOperation<T> extends Disposable {\n\n\tprivate readonly _onResult = this._register(new Emitter<HoverResult<T>>());\n\tpublic readonly onResult = this._onResult.event;\n\n\tprivate readonly _firstWaitScheduler = this._register(new RunOnceScheduler(() => this._triggerAsyncComputation(), 0));\n\tprivate readonly _secondWaitScheduler = this._register(new RunOnceScheduler(() => this._triggerSyncComputation(), 0));\n\tprivate readonly _loadingMessageScheduler = this._register(new RunOnceScheduler(() => this._triggerLoadingMessage(), 0));\n\n\tprivate _state = HoverOperationState.Idle;\n\tprivate _asyncIterable: CancelableAsyncIterableObject<T> | null = null;\n\tprivate _asyncIterableDone: boolean = false;\n\tprivate _result: T[] = [];\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _computer: IHoverComputer<T>\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._asyncIterable) {\n\t\t\tthis._asyncIterable.cancel();\n\t\t\tthis._asyncIterable = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\tprivate get _hoverTime(): number {\n\t\treturn this._editor.getOption(EditorOption.hover).delay;\n\t}\n\n\tprivate get _firstWaitTime(): number {\n\t\treturn this._hoverTime / 2;\n\t}\n\n\tprivate get _secondWaitTime(): number {\n\t\treturn this._hoverTime - this._firstWaitTime;\n\t}\n\n\tprivate get _loadingMessageTime(): number {\n\t\treturn 3 * this._hoverTime;\n\t}\n\n\tprivate _setState(state: HoverOperationState, fireResult: boolean = true): void {\n\t\tthis._state = state;\n\t\tif (fireResult) {\n\t\t\tthis._fireResult();\n\t\t}\n\t}\n\n\tprivate _triggerAsyncComputation(): void {\n\t\tthis._setState(HoverOperationState.SecondWait);\n\t\tthis._secondWaitScheduler.schedule(this._secondWaitTime);\n\n\t\tif (this._computer.computeAsync) {\n\t\t\tthis._asyncIterableDone = false;\n\t\t\tthis._asyncIterable = createCancelableAsyncIterable(token => this._computer.computeAsync!(token));\n\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tfor await (const item of this._asyncIterable!) {\n\t\t\t\t\t\tif (item) {\n\t\t\t\t\t\t\tthis._result.push(item);\n\t\t\t\t\t\t\tthis._fireResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._asyncIterableDone = true;\n\n\t\t\t\t\tif (this._state === HoverOperationState.WaitingForAsync || this._state === HoverOperationState.WaitingForAsyncShowingLoading) {\n\t\t\t\t\t\tthis._setState(HoverOperationState.Idle);\n\t\t\t\t\t}\n\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\n\t\t\t})();\n\n\t\t} else {\n\t\t\tthis._asyncIterableDone = true;\n\t\t}\n\t}\n\n\tprivate _triggerSyncComputation(): void {\n\t\tif (this._computer.computeSync) {\n\t\t\tthis._result = this._result.concat(this._computer.computeSync());\n\t\t}\n\t\tthis._setState(this._asyncIterableDone ? HoverOperationState.Idle : HoverOperationState.WaitingForAsync);\n\t}\n\n\tprivate _triggerLoadingMessage(): void {\n\t\tif (this._state === HoverOperationState.WaitingForAsync) {\n\t\t\tthis._setState(HoverOperationState.WaitingForAsyncShowingLoading);\n\t\t}\n\t}\n\n\tprivate _fireResult(): void {\n\t\tif (this._state === HoverOperationState.FirstWait || this._state === HoverOperationState.SecondWait) {\n\t\t\t// Do not send out results before the hover time\n\t\t\treturn;\n\t\t}\n\t\tconst isComplete = (this._state === HoverOperationState.Idle);\n\t\tconst hasLoadingMessage = (this._state === HoverOperationState.WaitingForAsyncShowingLoading);\n\t\tthis._onResult.fire(new HoverResult(this._result.slice(0), isComplete, hasLoadingMessage));\n\t}\n\n\tpublic start(mode: HoverStartMode): void {\n\t\tif (mode === HoverStartMode.Delayed) {\n\t\t\tif (this._state === HoverOperationState.Idle) {\n\t\t\t\tthis._setState(HoverOperationState.FirstWait);\n\t\t\t\tthis._firstWaitScheduler.schedule(this._firstWaitTime);\n\t\t\t\tthis._loadingMessageScheduler.schedule(this._loadingMessageTime);\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (this._state) {\n\t\t\t\tcase HoverOperationState.Idle:\n\t\t\t\t\tthis._triggerAsyncComputation();\n\t\t\t\t\tthis._secondWaitScheduler.cancel();\n\t\t\t\t\tthis._triggerSyncComputation();\n\t\t\t\t\tbreak;\n\t\t\t\tcase HoverOperationState.SecondWait:\n\t\t\t\t\tthis._secondWaitScheduler.cancel();\n\t\t\t\t\tthis._triggerSyncComputation();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic cancel(): void {\n\t\tthis._firstWaitScheduler.cancel();\n\t\tthis._secondWaitScheduler.cancel();\n\t\tthis._loadingMessageScheduler.cancel();\n\t\tif (this._asyncIterable) {\n\t\t\tthis._asyncIterable.cancel();\n\t\t\tthis._asyncIterable = null;\n\t\t}\n\t\tthis._result = [];\n\t\tthis._setState(HoverOperationState.Idle, false);\n\t}\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 { AsyncIterableObject } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration } from 'vs/editor/common/model';\nimport { BrandedService, IConstructorSignature } from 'vs/platform/instantiation/common/instantiation';\n\nexport interface IHoverPart {\n\t/**\n\t * The creator of this hover part.\n\t */\n\treadonly owner: IEditorHoverParticipant;\n\t/**\n\t * The range where this hover part applies.\n\t */\n\treadonly range: Range;\n\t/**\n\t * Force the hover to always be rendered at this specific range,\n\t * even in the case of multiple hover parts.\n\t */\n\treadonly forceShowAtRange?: boolean;\n\t/**\n\t * Is this hover part still valid for this new anchor?\n\t */\n\tisValidForHoverAnchor(anchor: HoverAnchor): boolean;\n}\n\nexport const enum HoverAnchorType {\n\tRange = 1,\n\tForeignElement = 2\n}\n\nexport class HoverRangeAnchor {\n\tpublic readonly type = HoverAnchorType.Range;\n\tconstructor(\n\t\tpublic readonly priority: number,\n\t\tpublic readonly range: Range\n\t) {\n\t}\n\tpublic equals(other: HoverAnchor) {\n\t\treturn (other.type === HoverAnchorType.Range && this.range.equalsRange(other.range));\n\t}\n\tpublic canAdoptVisibleHover(lastAnchor: HoverAnchor, showAtPosition: Position): boolean {\n\t\treturn (lastAnchor.type === HoverAnchorType.Range && showAtPosition.lineNumber === this.range.startLineNumber);\n\t}\n}\n\nexport class HoverForeignElementAnchor {\n\tpublic readonly type = HoverAnchorType.ForeignElement;\n\tconstructor(\n\t\tpublic readonly priority: number,\n\t\tpublic readonly owner: IEditorHoverParticipant,\n\t\tpublic readonly range: Range\n\t) {\n\t}\n\tpublic equals(other: HoverAnchor) {\n\t\treturn (other.type === HoverAnchorType.ForeignElement && this.owner === other.owner);\n\t}\n\tpublic canAdoptVisibleHover(lastAnchor: HoverAnchor, showAtPosition: Position): boolean {\n\t\treturn (lastAnchor.type === HoverAnchorType.ForeignElement && this.owner === lastAnchor.owner);\n\t}\n}\n\nexport type HoverAnchor = HoverRangeAnchor | HoverForeignElementAnchor;\n\nexport interface IEditorHoverStatusBar {\n\taddAction(actionOptions: { label: string; iconClass?: string; run: (target: HTMLElement) => void; commandId: string }): IEditorHoverAction;\n\tappend(element: HTMLElement): HTMLElement;\n}\n\nexport interface IEditorHoverAction {\n\tsetEnabled(enabled: boolean): void;\n}\n\nexport interface IEditorHoverColorPickerWidget {\n\tlayout(): void;\n}\n\nexport interface IEditorHoverRenderContext {\n\t/**\n\t * The fragment where dom elements should be attached.\n\t */\n\treadonly fragment: DocumentFragment;\n\t/**\n\t * The status bar for actions for this hover.\n\t */\n\treadonly statusBar: IEditorHoverStatusBar;\n\t/**\n\t * Set if the hover will render a color picker widget.\n\t */\n\tsetColorPicker(widget: IEditorHoverColorPickerWidget): void;\n\t/**\n\t * The contents rendered inside the fragment have been changed, which means that the hover should relayout.\n\t */\n\tonContentsChanged(): void;\n\t/**\n\t * Hide the hover.\n\t */\n\thide(): void;\n}\n\nexport interface IEditorHoverParticipant<T extends IHoverPart = IHoverPart> {\n\treadonly hoverOrdinal: number;\n\tsuggestHoverAnchor?(mouseEvent: IEditorMouseEvent): HoverAnchor | null;\n\tcomputeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): T[];\n\tcomputeAsync?(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject<T>;\n\tcreateLoadingMessage?(anchor: HoverAnchor): T | null;\n\trenderHoverParts(context: IEditorHoverRenderContext, hoverParts: T[]): IDisposable;\n}\n\nexport type IEditorHoverParticipantCtor = IConstructorSignature<IEditorHoverParticipant, [ICodeEditor]>;\n\nexport const HoverParticipantRegistry = (new class HoverParticipantRegistry {\n\n\t_participants: IEditorHoverParticipantCtor[] = [];\n\n\tpublic register<Services extends BrandedService[]>(ctor: { new(editor: ICodeEditor, ...services: Services): IEditorHoverParticipant }): void {\n\t\tthis._participants.push(ctor as IEditorHoverParticipantCtor);\n\t}\n\n\tpublic getAll(): IEditorHoverParticipantCtor[] {\n\t\treturn this._participants;\n\t}\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class InPlaceReplaceCommand implements ICommand {\n\n\tprivate readonly _editRange: Range;\n\tprivate readonly _originalSelection: Selection;\n\tprivate readonly _text: string;\n\n\tconstructor(editRange: Range, originalSelection: Selection, text: string) {\n\t\tthis._editRange = editRange;\n\t\tthis._originalSelection = originalSelection;\n\t\tthis._text = text;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._editRange, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst srcRange = inverseEditOperations[0].range;\n\n\t\tif (!this._originalSelection.isEmpty()) {\n\t\t\t// Preserve selection and extends to typed text\n\t\t\treturn new Selection(\n\t\t\t\tsrcRange.endLineNumber,\n\t\t\t\tsrcRange.endColumn - this._text.length,\n\t\t\t\tsrcRange.endLineNumber,\n\t\t\t\tsrcRange.endColumn\n\t\t\t);\n\t\t}\n\n\t\treturn new Selection(\n\t\t\tsrcRange.endLineNumber,\n\t\t\tMath.min(this._originalSelection.positionColumn, srcRange.endColumn),\n\t\t\tsrcRange.endLineNumber,\n\t\t\tMath.min(this._originalSelection.positionColumn, srcRange.endColumn)\n\t\t);\n\t}\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\nexport function getSpaceCnt(str: string, tabSize: number) {\n\tlet spacesCnt = 0;\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str.charAt(i) === '\\t') {\n\t\t\tspacesCnt += tabSize;\n\t\t} else {\n\t\t\tspacesCnt++;\n\t\t}\n\t}\n\n\treturn spacesCnt;\n}\n\nexport function generateIndent(spacesCnt: number, tabSize: number, insertSpaces: boolean) {\n\tspacesCnt = spacesCnt < 0 ? 0 : spacesCnt;\n\n\tlet result = '';\n\tif (!insertSpaces) {\n\t\tlet tabsCnt = Math.floor(spacesCnt / tabSize);\n\t\tspacesCnt = spacesCnt % tabSize;\n\t\tfor (let i = 0; i < tabsCnt; i++) {\n\t\t\tresult += '\\t';\n\t\t}\n\t}\n\n\tfor (let i = 0; i < spacesCnt; i++) {\n\t\tresult += ' ';\n\t}\n\n\treturn result;\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { CancellationError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { InlayHint, InlayHintList, InlayHintsProvider, Command } from 'vs/editor/common/languages';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Schemas } from 'vs/base/common/network';\nimport { URI } from 'vs/base/common/uri';\n\nexport class InlayHintAnchor {\n\tconstructor(readonly range: Range, readonly direction: 'before' | 'after') { }\n}\n\nexport class InlayHintItem {\n\n\tprivate _isResolved: boolean = false;\n\tprivate _currentResolve?: Promise<void>;\n\n\tconstructor(readonly hint: InlayHint, readonly anchor: InlayHintAnchor, readonly provider: InlayHintsProvider) { }\n\n\twith(delta: { anchor: InlayHintAnchor }): InlayHintItem {\n\t\tconst result = new InlayHintItem(this.hint, delta.anchor, this.provider);\n\t\tresult._isResolved = this._isResolved;\n\t\tresult._currentResolve = this._currentResolve;\n\t\treturn result;\n\t}\n\n\tasync resolve(token: CancellationToken): Promise<void> {\n\t\tif (typeof this.provider.resolveInlayHint !== 'function') {\n\t\t\treturn;\n\t\t}\n\t\tif (this._currentResolve) {\n\t\t\t// wait for an active resolve operation and try again\n\t\t\t// when that's done.\n\t\t\tawait this._currentResolve;\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.resolve(token);\n\t\t}\n\t\tif (!this._isResolved) {\n\t\t\tthis._currentResolve = this._doResolve(token)\n\t\t\t\t.finally(() => this._currentResolve = undefined);\n\t\t}\n\t\tawait this._currentResolve;\n\t}\n\n\tprivate async _doResolve(token: CancellationToken) {\n\t\ttry {\n\t\t\tconst newHint = await Promise.resolve(this.provider.resolveInlayHint!(this.hint, token));\n\t\t\tthis.hint.tooltip = newHint?.tooltip ?? this.hint.tooltip;\n\t\t\tthis.hint.label = newHint?.label ?? this.hint.label;\n\t\t\tthis._isResolved = true;\n\t\t} catch (err) {\n\t\t\tonUnexpectedExternalError(err);\n\t\t\tthis._isResolved = false;\n\t\t}\n\t}\n}\n\nexport class InlayHintsFragments {\n\n\tstatic async create(registry: LanguageFeatureRegistry<InlayHintsProvider>, model: ITextModel, ranges: Range[], token: CancellationToken): Promise<InlayHintsFragments> {\n\n\t\tconst data: [InlayHintList, InlayHintsProvider][] = [];\n\n\t\tconst promises = registry.ordered(model).reverse().map(provider => ranges.map(async range => {\n\t\t\ttry {\n\t\t\t\tconst result = await provider.provideInlayHints(model, range, token);\n\t\t\t\tif (result?.hints.length) {\n\t\t\t\t\tdata.push([result, provider]);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedExternalError(err);\n\t\t\t}\n\t\t}));\n\n\t\tawait Promise.all(promises.flat());\n\n\t\tif (token.isCancellationRequested || model.isDisposed()) {\n\t\t\tthrow new CancellationError();\n\t\t}\n\n\t\treturn new InlayHintsFragments(ranges, data, model);\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\treadonly items: readonly InlayHintItem[];\n\treadonly ranges: readonly Range[];\n\treadonly provider: Set<InlayHintsProvider>;\n\n\tprivate constructor(ranges: Range[], data: [InlayHintList, InlayHintsProvider][], model: ITextModel) {\n\t\tthis.ranges = ranges;\n\t\tthis.provider = new Set();\n\t\tconst items: InlayHintItem[] = [];\n\t\tfor (const [list, provider] of data) {\n\t\t\tthis._disposables.add(list);\n\t\t\tthis.provider.add(provider);\n\n\t\t\tfor (const hint of list.hints) {\n\t\t\t\t// compute the range to which the item should be attached to\n\t\t\t\tlet position = model.validatePosition(hint.position);\n\t\t\t\tlet direction: 'before' | 'after' = 'before';\n\n\t\t\t\tconst wordRange = InlayHintsFragments._getRangeAtPosition(model, position);\n\t\t\t\tlet range: Range;\n\n\t\t\t\tif (wordRange.getStartPosition().isBefore(position)) {\n\t\t\t\t\trange = Range.fromPositions(wordRange.getStartPosition(), position);\n\t\t\t\t\tdirection = 'after';\n\t\t\t\t} else {\n\t\t\t\t\trange = Range.fromPositions(position, wordRange.getEndPosition());\n\t\t\t\t\tdirection = 'before';\n\t\t\t\t}\n\n\t\t\t\titems.push(new InlayHintItem(hint, new InlayHintAnchor(range, direction), provider));\n\t\t\t}\n\t\t}\n\t\tthis.items = items.sort((a, b) => Position.compare(a.hint.position, b.hint.position));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate static _getRangeAtPosition(model: ITextModel, position: IPosition): Range {\n\t\tconst line = position.lineNumber;\n\t\tconst word = model.getWordAtPosition(position);\n\t\tif (word) {\n\t\t\t// always prefer the word range\n\t\t\treturn new Range(line, word.startColumn, line, word.endColumn);\n\t\t}\n\n\t\tmodel.tokenizeIfCheap(line);\n\t\tconst tokens = model.getLineTokens(line);\n\t\tconst offset = position.column - 1;\n\t\tconst idx = tokens.findTokenIndexAtOffset(offset);\n\n\t\tlet start = tokens.getStartOffset(idx);\n\t\tlet end = tokens.getEndOffset(idx);\n\n\t\tif (end - start === 1) {\n\t\t\t// single character token, when at its end try leading/trailing token instead\n\t\t\tif (start === offset && idx > 1) {\n\t\t\t\t// leading token\n\t\t\t\tstart = tokens.getStartOffset(idx - 1);\n\t\t\t\tend = tokens.getEndOffset(idx - 1);\n\t\t\t} else if (end === offset && idx < tokens.getCount() - 1) {\n\t\t\t\t// trailing token\n\t\t\t\tstart = tokens.getStartOffset(idx + 1);\n\t\t\t\tend = tokens.getEndOffset(idx + 1);\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(line, start + 1, line, end + 1);\n\t}\n}\n\nexport function asCommandLink(command: Command): string {\n\treturn URI.from({\n\t\tscheme: Schemas.command,\n\t\tpath: command.id,\n\t\tquery: command.arguments && encodeURIComponent(JSON.stringify(command.arguments))\n\t}).toString();\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\nexport const inlineSuggestCommitId = 'editor.action.inlineSuggest.commit';\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 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\n\nexport class GhostText {\n\n\tconstructor(\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly parts: GhostTextPart[],\n\t\tpublic readonly additionalReservedLineCount: number = 0\n\t) {\n\t}\n\n\trenderForScreenReader(lineText: string): string {\n\t\tif (this.parts.length === 0) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lastPart = this.parts[this.parts.length - 1];\n\n\t\tconst cappedLineText = lineText.substr(0, lastPart.column - 1);\n\t\tconst text = applyEdits(cappedLineText,\n\t\t\tthis.parts.map(p => ({\n\t\t\t\trange: { startLineNumber: 1, endLineNumber: 1, startColumn: p.column, endColumn: p.column },\n\t\t\t\ttext: p.lines.join('\\n')\n\t\t\t}))\n\t\t);\n\n\t\treturn text.substring(this.parts[0].column - 1);\n\t}\n}\n\nclass PositionOffsetTransformer {\n\tprivate readonly lineStartOffsetByLineIdx: number[];\n\n\tconstructor(text: string) {\n\t\tthis.lineStartOffsetByLineIdx = [];\n\t\tthis.lineStartOffsetByLineIdx.push(0);\n\t\tfor (let i = 0; i < text.length; i++) {\n\t\t\tif (text.charAt(i) === '\\n') {\n\t\t\t\tthis.lineStartOffsetByLineIdx.push(i + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetOffset(position: Position): number {\n\t\treturn this.lineStartOffsetByLineIdx[position.lineNumber - 1] + position.column - 1;\n\t}\n}\n\nfunction applyEdits(text: string, edits: { range: IRange; text: string }[]): string {\n\tconst transformer = new PositionOffsetTransformer(text);\n\tconst offsetEdits = edits.map(e => {\n\t\tconst range = Range.lift(e.range);\n\t\treturn ({\n\t\t\tstartOffset: transformer.getOffset(range.getStartPosition()),\n\t\t\tendOffset: transformer.getOffset(range.getEndPosition()),\n\t\t\ttext: e.text\n\t\t});\n\t});\n\n\toffsetEdits.sort((a, b) => b.startOffset - a.startOffset);\n\n\tfor (const edit of offsetEdits) {\n\t\ttext = text.substring(0, edit.startOffset) + edit.text + text.substring(edit.endOffset);\n\t}\n\n\treturn text;\n}\n\nexport class GhostTextPart {\n\tconstructor(\n\t\treadonly column: number,\n\t\treadonly lines: readonly string[],\n\t\t/**\n\t\t * Indicates if this part is a preview of an inline suggestion when a suggestion is previewed.\n\t\t*/\n\t\treadonly preview: boolean,\n\t) {\n\t}\n}\n\n\nexport interface GhostTextWidgetModel {\n\treadonly onDidChange: Event<void>;\n\treadonly ghostText: GhostText | undefined;\n\n\tsetExpanded(expanded: boolean): void;\n\n\treadonly minReservedLineCount: number;\n}\n\nexport abstract class BaseGhostTextWidgetModel extends Disposable implements GhostTextWidgetModel {\n\tpublic abstract readonly ghostText: GhostText | undefined;\n\n\tprivate _expanded: boolean | undefined = undefined;\n\n\tprotected readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tpublic abstract readonly minReservedLineCount: number;\n\n\tconstructor(protected readonly editor: IActiveCodeEditor) {\n\t\tsuper();\n\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.suggest) && this._expanded === undefined) {\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic setExpanded(expanded: boolean): void {\n\t\tthis._expanded = true;\n\t\tthis.onDidChangeEmitter.fire();\n\t}\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 { IDiffChange, LcsDiff } from 'vs/base/common/diff/diff';\nimport * as strings from 'vs/base/common/strings';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { InlineCompletion } from 'vs/editor/common/languages';\nimport { GhostText, GhostTextPart } from 'vs/editor/contrib/inlineCompletions/browser/ghostText';\n\n/**\n * A normalized inline completion is an inline completion with a defined range.\n*/\nexport interface NormalizedInlineCompletion extends InlineCompletion {\n\trange: Range;\n}\n\nexport function normalizedInlineCompletionsEquals(a: NormalizedInlineCompletion | undefined, b: NormalizedInlineCompletion | undefined): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (!a || !b) {\n\t\treturn false;\n\t}\n\treturn a.range.equalsRange(b.range) && a.text === b.text && a.command === b.command;\n}\n\n/**\n * @param previewSuffixLength Sets where to split `inlineCompletion.text`.\n * \tIf the text is `hello` and the suffix length is 2, the non-preview part is `hel` and the preview-part is `lo`.\n*/\nexport function inlineCompletionToGhostText(\n\tinlineCompletion: NormalizedInlineCompletion,\n\ttextModel: ITextModel,\n\tmode: 'prefix' | 'subword' | 'subwordSmart',\n\tcursorPosition?: Position,\n\tpreviewSuffixLength = 0\n): GhostText | undefined {\n\tif (inlineCompletion.range.startLineNumber !== inlineCompletion.range.endLineNumber) {\n\t\t// Only single line replacements are supported.\n\t\treturn undefined;\n\t}\n\n\tconst sourceLine = textModel.getLineContent(inlineCompletion.range.startLineNumber);\n\tconst sourceIndentationLength = strings.getLeadingWhitespace(sourceLine).length;\n\n\tconst suggestionTouchesIndentation = inlineCompletion.range.startColumn - 1 <= sourceIndentationLength;\n\tif (suggestionTouchesIndentation) {\n\t\t// source: ··········[······abc]\n\t\t// ^^^^^^^^^ inlineCompletion.range\n\t\t// ^^^^^^^^^^ ^^^^^^ sourceIndentationLength\n\t\t// ^^^^^^ replacedIndentation.length\n\t\t// ^^^ rangeThatDoesNotReplaceIndentation\n\n\t\t// inlineCompletion.text: '··foo'\n\t\t// ^^ suggestionAddedIndentationLength\n\n\t\tconst suggestionAddedIndentationLength = strings.getLeadingWhitespace(inlineCompletion.text).length;\n\n\t\tconst replacedIndentation = sourceLine.substring(inlineCompletion.range.startColumn - 1, sourceIndentationLength);\n\t\tconst rangeThatDoesNotReplaceIndentation = Range.fromPositions(\n\t\t\tinlineCompletion.range.getStartPosition().delta(0, replacedIndentation.length),\n\t\t\tinlineCompletion.range.getEndPosition()\n\t\t);\n\n\t\tconst suggestionWithoutIndentationChange =\n\t\t\tinlineCompletion.text.startsWith(replacedIndentation)\n\t\t\t\t// Adds more indentation without changing existing indentation: We can add ghost text for this\n\t\t\t\t? inlineCompletion.text.substring(replacedIndentation.length)\n\t\t\t\t// Changes or removes existing indentation. Only add ghost text for the non-indentation part.\n\t\t\t\t: inlineCompletion.text.substring(suggestionAddedIndentationLength);\n\n\t\tinlineCompletion = {\n\t\t\trange: rangeThatDoesNotReplaceIndentation,\n\t\t\ttext: suggestionWithoutIndentationChange,\n\t\t\tcommand: inlineCompletion.command\n\t\t};\n\t}\n\n\t// This is a single line string\n\tconst valueToBeReplaced = textModel.getValueInRange(inlineCompletion.range);\n\n\tconst changes = cachingDiff(valueToBeReplaced, inlineCompletion.text);\n\n\tif (!changes) {\n\t\t// No ghost text in case the diff would be too slow to compute\n\t\treturn undefined;\n\t}\n\n\tconst lineNumber = inlineCompletion.range.startLineNumber;\n\n\tconst parts = new Array<GhostTextPart>();\n\n\tif (mode === 'prefix') {\n\t\tconst filteredChanges = changes.filter(c => c.originalLength === 0);\n\t\tif (filteredChanges.length > 1 || filteredChanges.length === 1 && filteredChanges[0].originalStart !== valueToBeReplaced.length) {\n\t\t\t// Prefixes only have a single change.\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tconst previewStartInCompletionText = inlineCompletion.text.length - previewSuffixLength;\n\n\tfor (const c of changes) {\n\t\tconst insertColumn = inlineCompletion.range.startColumn + c.originalStart + c.originalLength;\n\n\t\tif (mode === 'subwordSmart' && cursorPosition && cursorPosition.lineNumber === inlineCompletion.range.startLineNumber && insertColumn < cursorPosition.column) {\n\t\t\t// No ghost text before cursor\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (c.originalLength > 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (c.modifiedLength === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst modifiedEnd = c.modifiedStart + c.modifiedLength;\n\t\tconst nonPreviewTextEnd = Math.max(c.modifiedStart, Math.min(modifiedEnd, previewStartInCompletionText));\n\t\tconst nonPreviewText = inlineCompletion.text.substring(c.modifiedStart, nonPreviewTextEnd);\n\t\tconst italicText = inlineCompletion.text.substring(nonPreviewTextEnd, Math.max(c.modifiedStart, modifiedEnd));\n\n\t\tif (nonPreviewText.length > 0) {\n\t\t\tconst lines = strings.splitLines(nonPreviewText);\n\t\t\tparts.push(new GhostTextPart(insertColumn, lines, false));\n\t\t}\n\t\tif (italicText.length > 0) {\n\t\t\tconst lines = strings.splitLines(italicText);\n\t\t\tparts.push(new GhostTextPart(insertColumn, lines, true));\n\t\t}\n\t}\n\n\treturn new GhostText(lineNumber, parts, 0);\n}\n\nlet lastRequest: { originalValue: string; newValue: string; changes: readonly IDiffChange[] | undefined } | undefined = undefined;\nfunction cachingDiff(originalValue: string, newValue: string): readonly IDiffChange[] | undefined {\n\tif (lastRequest?.originalValue === originalValue && lastRequest?.newValue === newValue) {\n\t\treturn lastRequest?.changes;\n\t} else {\n\t\tconst changes = smartDiff(originalValue, newValue);\n\t\tlastRequest = {\n\t\t\toriginalValue,\n\t\t\tnewValue,\n\t\t\tchanges\n\t\t};\n\t\treturn changes;\n\t}\n}\n\n/**\n * When matching `if ()` with `if (f() = 1) { g(); }`,\n * align it like this: `if ( )`\n * Not like this:\t\t\t `if ( )`\n * Also not like this:\t\t `if ( )`.\n *\n * The parenthesis are preprocessed to ensure that they match correctly.\n */\nfunction smartDiff(originalValue: string, newValue: string): (readonly IDiffChange[]) | undefined {\n\tif (originalValue.length > 5000 || newValue.length > 5000) {\n\t\t// We don't want to work on strings that are too big\n\t\treturn undefined;\n\t}\n\n\tfunction getMaxCharCode(val: string): number {\n\t\tlet maxCharCode = 0;\n\t\tfor (let i = 0, len = val.length; i < len; i++) {\n\t\t\tconst charCode = val.charCodeAt(i);\n\t\t\tif (charCode > maxCharCode) {\n\t\t\t\tmaxCharCode = charCode;\n\t\t\t}\n\t\t}\n\t\treturn maxCharCode;\n\t}\n\n\tconst maxCharCode = Math.max(getMaxCharCode(originalValue), getMaxCharCode(newValue));\n\tfunction getUniqueCharCode(id: number): number {\n\t\tif (id < 0) {\n\t\t\tthrow new Error('unexpected');\n\t\t}\n\t\treturn maxCharCode + id + 1;\n\t}\n\n\tfunction getElements(source: string): Int32Array {\n\t\tlet level = 0;\n\t\tlet group = 0;\n\t\tconst characters = new Int32Array(source.length);\n\t\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\t\tconst id = group * 100 + level;\n\n\t\t\t// TODO support more brackets\n\t\t\tif (source[i] === '(') {\n\t\t\t\tcharacters[i] = getUniqueCharCode(2 * id);\n\t\t\t\tlevel++;\n\t\t\t} else if (source[i] === ')') {\n\t\t\t\tcharacters[i] = getUniqueCharCode(2 * id + 1);\n\t\t\t\tif (level === 1) {\n\t\t\t\t\tgroup++;\n\t\t\t\t}\n\t\t\t\tlevel = Math.max(level - 1, 0);\n\t\t\t} else {\n\t\t\t\tcharacters[i] = source.charCodeAt(i);\n\t\t\t}\n\t\t}\n\t\treturn characters;\n\t}\n\n\tconst elements1 = getElements(originalValue);\n\tconst elements2 = getElements(newValue);\n\n\treturn new LcsDiff({ getElements: () => elements1 }, { getElements: () => elements2 }).ComputeDiff(false).changes;\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 { IDisposable, IReference } from 'vs/base/common/lifecycle';\n\nexport function createDisposableRef<T>(object: T, disposable?: IDisposable): IReference<T> {\n\treturn {\n\t\tobject,\n\t\tdispose: () => disposable?.dispose(),\n\t};\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 { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class CopyLinesCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _isCopyingDown: boolean;\n\tprivate readonly _noop: boolean;\n\n\tprivate _selectionDirection: SelectionDirection;\n\tprivate _selectionId: string | null;\n\tprivate _startLineNumberDelta: number;\n\tprivate _endLineNumberDelta: number;\n\n\tconstructor(selection: Selection, isCopyingDown: boolean, noop?: boolean) {\n\t\tthis._selection = selection;\n\t\tthis._isCopyingDown = isCopyingDown;\n\t\tthis._noop = noop || false;\n\t\tthis._selectionDirection = SelectionDirection.LTR;\n\t\tthis._selectionId = null;\n\t\tthis._startLineNumberDelta = 0;\n\t\tthis._endLineNumberDelta = 0;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tlet s = this._selection;\n\n\t\tthis._startLineNumberDelta = 0;\n\t\tthis._endLineNumberDelta = 0;\n\t\tif (s.startLineNumber < s.endLineNumber && s.endColumn === 1) {\n\t\t\tthis._endLineNumberDelta = 1;\n\t\t\ts = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1));\n\t\t}\n\n\t\tlet sourceLines: string[] = [];\n\t\tfor (let i = s.startLineNumber; i <= s.endLineNumber; i++) {\n\t\t\tsourceLines.push(model.getLineContent(i));\n\t\t}\n\t\tconst sourceText = sourceLines.join('\\n');\n\n\t\tif (sourceText === '') {\n\t\t\t// Duplicating empty line\n\t\t\tif (this._isCopyingDown) {\n\t\t\t\tthis._startLineNumberDelta++;\n\t\t\t\tthis._endLineNumberDelta++;\n\t\t\t}\n\t\t}\n\n\t\tif (this._noop) {\n\t\t\tbuilder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber + 1, 1), s.endLineNumber === model.getLineCount() ? '' : '\\n');\n\t\t} else {\n\t\t\tif (!this._isCopyingDown) {\n\t\t\t\tbuilder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\\n' + sourceText);\n\t\t\t} else {\n\t\t\t\tbuilder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), sourceText + '\\n');\n\t\t\t}\n\t\t}\n\n\t\tthis._selectionId = builder.trackSelection(s);\n\t\tthis._selectionDirection = this._selection.getDirection();\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tlet result = helper.getTrackedSelection(this._selectionId!);\n\n\t\tif (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) {\n\t\t\tlet startLineNumber = result.startLineNumber;\n\t\t\tlet startColumn = result.startColumn;\n\t\t\tlet endLineNumber = result.endLineNumber;\n\t\t\tlet endColumn = result.endColumn;\n\n\t\t\tif (this._startLineNumberDelta !== 0) {\n\t\t\t\tstartLineNumber = startLineNumber + this._startLineNumberDelta;\n\t\t\t\tstartColumn = 1;\n\t\t\t}\n\n\t\t\tif (this._endLineNumberDelta !== 0) {\n\t\t\t\tendLineNumber = endLineNumber + this._endLineNumberDelta;\n\t\t\t\tendColumn = 1;\n\t\t\t}\n\n\t\t\tresult = Selection.createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, this._selectionDirection);\n\t\t}\n\n\t\treturn result;\n\t}\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 { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class SortLinesCommand implements ICommand {\n\n\tprivate static _COLLATOR: Intl.Collator | null = null;\n\tpublic static getCollator(): Intl.Collator {\n\t\tif (!SortLinesCommand._COLLATOR) {\n\t\t\tSortLinesCommand._COLLATOR = new Intl.Collator();\n\t\t}\n\t\treturn SortLinesCommand._COLLATOR;\n\t}\n\n\tprivate readonly selection: Selection;\n\tprivate readonly descending: boolean;\n\tprivate selectionId: string | null;\n\n\tconstructor(selection: Selection, descending: boolean) {\n\t\tthis.selection = selection;\n\t\tthis.descending = descending;\n\t\tthis.selectionId = null;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tlet op = sortLines(model, this.selection, this.descending);\n\t\tif (op) {\n\t\t\tbuilder.addEditOperation(op.range, op.text);\n\t\t}\n\n\t\tthis.selectionId = builder.trackSelection(this.selection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this.selectionId!);\n\t}\n\n\tpublic static canRun(model: ITextModel | null, selection: Selection, descending: boolean): boolean {\n\t\tif (model === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet data = getSortData(model, selection, descending);\n\n\t\tif (!data) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0, len = data.before.length; i < len; i++) {\n\t\t\tif (data.before[i] !== data.after[i]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nfunction getSortData(model: ITextModel, selection: Selection, descending: boolean) {\n\tlet startLineNumber = selection.startLineNumber;\n\tlet endLineNumber = selection.endLineNumber;\n\n\tif (selection.endColumn === 1) {\n\t\tendLineNumber--;\n\t}\n\n\t// Nothing to sort if user didn't select anything.\n\tif (startLineNumber >= endLineNumber) {\n\t\treturn null;\n\t}\n\n\tlet linesToSort: string[] = [];\n\n\t// Get the contents of the selection to be sorted.\n\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\tlinesToSort.push(model.getLineContent(lineNumber));\n\t}\n\n\tlet sorted = linesToSort.slice(0);\n\tsorted.sort(SortLinesCommand.getCollator().compare);\n\n\t// If descending, reverse the order.\n\tif (descending === true) {\n\t\tsorted = sorted.reverse();\n\t}\n\n\treturn {\n\t\tstartLineNumber: startLineNumber,\n\t\tendLineNumber: endLineNumber,\n\t\tbefore: linesToSort,\n\t\tafter: sorted\n\t};\n}\n\n/**\n * Generate commands for sorting lines on a model.\n */\nfunction sortLines(model: ITextModel, selection: Selection, descending: boolean): ISingleEditOperation | null {\n\tlet data = getSortData(model, selection, descending);\n\n\tif (!data) {\n\t\treturn null;\n\t}\n\n\treturn EditOperation.replace(\n\t\tnew Range(data.startLineNumber, 1, data.endLineNumber, model.getLineMaxColumn(data.endLineNumber)),\n\t\tdata.after.join('\\n')\n\t);\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 { LinkedList } from 'vs/base/common/linkedList';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { SelectionRange, SelectionRangeProvider } from 'vs/editor/common/languages';\n\nexport class BracketSelectionRangeProvider implements SelectionRangeProvider {\n\n\tasync provideSelectionRanges(model: ITextModel, positions: Position[]): Promise<SelectionRange[][]> {\n\t\tconst result: SelectionRange[][] = [];\n\n\t\tfor (const position of positions) {\n\t\t\tconst bucket: SelectionRange[] = [];\n\t\t\tresult.push(bucket);\n\n\t\t\tconst ranges = new Map<string, LinkedList<Range>>();\n\t\t\tawait new Promise<void>(resolve => BracketSelectionRangeProvider._bracketsRightYield(resolve, 0, model, position, ranges));\n\t\t\tawait new Promise<void>(resolve => BracketSelectionRangeProvider._bracketsLeftYield(resolve, 0, model, position, ranges, bucket));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic static _maxDuration = 30;\n\tprivate static readonly _maxRounds = 2;\n\n\tprivate static _bracketsRightYield(resolve: () => void, round: number, model: ITextModel, pos: Position, ranges: Map<string, LinkedList<Range>>): void {\n\t\tconst counts = new Map<string, number>();\n\t\tconst t1 = Date.now();\n\t\twhile (true) {\n\t\t\tif (round >= BracketSelectionRangeProvider._maxRounds) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!pos) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet bracket = model.bracketPairs.findNextBracket(pos);\n\t\t\tif (!bracket) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet d = Date.now() - t1;\n\t\t\tif (d > BracketSelectionRangeProvider._maxDuration) {\n\t\t\t\tsetTimeout(() => BracketSelectionRangeProvider._bracketsRightYield(resolve, round + 1, model, pos, ranges));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst key = bracket.close[0];\n\t\t\tif (bracket.isOpen) {\n\t\t\t\t// wait for closing\n\t\t\t\tlet val = counts.has(key) ? counts.get(key)! : 0;\n\t\t\t\tcounts.set(key, val + 1);\n\t\t\t} else {\n\t\t\t\t// process closing\n\t\t\t\tlet val = counts.has(key) ? counts.get(key)! : 0;\n\t\t\t\tval -= 1;\n\t\t\t\tcounts.set(key, Math.max(0, val));\n\t\t\t\tif (val < 0) {\n\t\t\t\t\tlet list = ranges.get(key);\n\t\t\t\t\tif (!list) {\n\t\t\t\t\t\tlist = new LinkedList();\n\t\t\t\t\t\tranges.set(key, list);\n\t\t\t\t\t}\n\t\t\t\t\tlist.push(bracket.range);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpos = bracket.range.getEndPosition();\n\t\t}\n\t}\n\n\tprivate static _bracketsLeftYield(resolve: () => void, round: number, model: ITextModel, pos: Position, ranges: Map<string, LinkedList<Range>>, bucket: SelectionRange[]): void {\n\t\tconst counts = new Map<string, number>();\n\t\tconst t1 = Date.now();\n\t\twhile (true) {\n\t\t\tif (round >= BracketSelectionRangeProvider._maxRounds && ranges.size === 0) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!pos) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet bracket = model.bracketPairs.findPrevBracket(pos);\n\t\t\tif (!bracket) {\n\t\t\t\tresolve();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet d = Date.now() - t1;\n\t\t\tif (d > BracketSelectionRangeProvider._maxDuration) {\n\t\t\t\tsetTimeout(() => BracketSelectionRangeProvider._bracketsLeftYield(resolve, round + 1, model, pos, ranges, bucket));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst key = bracket.close[0];\n\t\t\tif (!bracket.isOpen) {\n\t\t\t\t// wait for opening\n\t\t\t\tlet val = counts.has(key) ? counts.get(key)! : 0;\n\t\t\t\tcounts.set(key, val + 1);\n\t\t\t} else {\n\t\t\t\t// opening\n\t\t\t\tlet val = counts.has(key) ? counts.get(key)! : 0;\n\t\t\t\tval -= 1;\n\t\t\t\tcounts.set(key, Math.max(0, val));\n\t\t\t\tif (val < 0) {\n\t\t\t\t\tlet list = ranges.get(key);\n\t\t\t\t\tif (list) {\n\t\t\t\t\t\tlet closing = list.shift();\n\t\t\t\t\t\tif (list.size === 0) {\n\t\t\t\t\t\t\tranges.delete(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst innerBracket = Range.fromPositions(bracket.range.getEndPosition(), closing!.getStartPosition());\n\t\t\t\t\t\tconst outerBracket = Range.fromPositions(bracket.range.getStartPosition(), closing!.getEndPosition());\n\t\t\t\t\t\tbucket.push({ range: innerBracket });\n\t\t\t\t\t\tbucket.push({ range: outerBracket });\n\t\t\t\t\t\tBracketSelectionRangeProvider._addBracketLeading(model, outerBracket, bucket);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpos = bracket.range.getStartPosition();\n\t\t}\n\t}\n\n\tprivate static _addBracketLeading(model: ITextModel, bracket: Range, bucket: SelectionRange[]): void {\n\t\tif (bracket.startLineNumber === bracket.endLineNumber) {\n\t\t\treturn;\n\t\t}\n\t\t// xxxxxxxx {\n\t\t//\n\t\t// }\n\t\tconst startLine = bracket.startLineNumber;\n\t\tconst column = model.getLineFirstNonWhitespaceColumn(startLine);\n\t\tif (column !== 0 && column !== bracket.startColumn) {\n\t\t\tbucket.push({ range: Range.fromPositions(new Position(startLine, column), bracket.getEndPosition()) });\n\t\t\tbucket.push({ range: Range.fromPositions(new Position(startLine, 1), bracket.getEndPosition()) });\n\t\t}\n\n\t\t// xxxxxxxx\n\t\t// {\n\t\t//\n\t\t// }\n\t\tconst aboveLine = startLine - 1;\n\t\tif (aboveLine > 0) {\n\t\t\tconst column = model.getLineFirstNonWhitespaceColumn(aboveLine);\n\t\t\tif (column === bracket.startColumn && column !== model.getLineLastNonWhitespaceColumn(aboveLine)) {\n\t\t\t\tbucket.push({ range: Range.fromPositions(new Position(aboveLine, column), bracket.getEndPosition()) });\n\t\t\t\tbucket.push({ range: Range.fromPositions(new Position(aboveLine, 1), bracket.getEndPosition()) });\n\t\t\t}\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { isLowerAsciiLetter, isUpperAsciiLetter } from 'vs/base/common/strings';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { SelectionRange, SelectionRangeProvider } from 'vs/editor/common/languages';\n\nexport class WordSelectionRangeProvider implements SelectionRangeProvider {\n\n\tprovideSelectionRanges(model: ITextModel, positions: Position[]): SelectionRange[][] {\n\t\tconst result: SelectionRange[][] = [];\n\t\tfor (const position of positions) {\n\t\t\tconst bucket: SelectionRange[] = [];\n\t\t\tresult.push(bucket);\n\t\t\tthis._addInWordRanges(bucket, model, position);\n\t\t\tthis._addWordRanges(bucket, model, position);\n\t\t\tthis._addWhitespaceLine(bucket, model, position);\n\t\t\tbucket.push({ range: model.getFullModelRange() });\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _addInWordRanges(bucket: SelectionRange[], model: ITextModel, pos: Position): void {\n\t\tconst obj = model.getWordAtPosition(pos);\n\t\tif (!obj) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet { word, startColumn } = obj;\n\t\tlet offset = pos.column - startColumn;\n\t\tlet start = offset;\n\t\tlet end = offset;\n\t\tlet lastCh: number = 0;\n\n\t\t// LEFT anchor (start)\n\t\tfor (; start >= 0; start--) {\n\t\t\tlet ch = word.charCodeAt(start);\n\t\t\tif ((start !== offset) && (ch === CharCode.Underline || ch === CharCode.Dash)) {\n\t\t\t\t// foo-bar OR foo_bar\n\t\t\t\tbreak;\n\t\t\t} else if (isLowerAsciiLetter(ch) && isUpperAsciiLetter(lastCh)) {\n\t\t\t\t// fooBar\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastCh = ch;\n\t\t}\n\t\tstart += 1;\n\n\t\t// RIGHT anchor (end)\n\t\tfor (; end < word.length; end++) {\n\t\t\tlet ch = word.charCodeAt(end);\n\t\t\tif (isUpperAsciiLetter(ch) && isLowerAsciiLetter(lastCh)) {\n\t\t\t\t// fooBar\n\t\t\t\tbreak;\n\t\t\t} else if (ch === CharCode.Underline || ch === CharCode.Dash) {\n\t\t\t\t// foo-bar OR foo_bar\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastCh = ch;\n\t\t}\n\n\t\tif (start < end) {\n\t\t\tbucket.push({ range: new Range(pos.lineNumber, startColumn + start, pos.lineNumber, startColumn + end) });\n\t\t}\n\t}\n\n\tprivate _addWordRanges(bucket: SelectionRange[], model: ITextModel, pos: Position): void {\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (word) {\n\t\t\tbucket.push({ range: new Range(pos.lineNumber, word.startColumn, pos.lineNumber, word.endColumn) });\n\t\t}\n\t}\n\n\tprivate _addWhitespaceLine(bucket: SelectionRange[], model: ITextModel, pos: Position): void {\n\t\tif (model.getLineLength(pos.lineNumber) > 0\n\t\t\t&& model.getLineFirstNonWhitespaceColumn(pos.lineNumber) === 0\n\t\t\t&& model.getLineLastNonWhitespaceColumn(pos.lineNumber) === 0\n\t\t) {\n\t\t\tbucket.push({ range: new Range(pos.lineNumber, 1, pos.lineNumber, model.getLineMaxColumn(pos.lineNumber)) });\n\t\t}\n\t}\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 { CharCode } from 'vs/base/common/charCode';\n\nexport const enum TokenType {\n\tDollar,\n\tColon,\n\tComma,\n\tCurlyOpen,\n\tCurlyClose,\n\tBackslash,\n\tForwardslash,\n\tPipe,\n\tInt,\n\tVariableName,\n\tFormat,\n\tPlus,\n\tDash,\n\tQuestionMark,\n\tEOF\n}\n\nexport interface Token {\n\ttype: TokenType;\n\tpos: number;\n\tlen: number;\n}\n\n\nexport class Scanner {\n\n\tprivate static _table: { [ch: number]: TokenType } = {\n\t\t[CharCode.DollarSign]: TokenType.Dollar,\n\t\t[CharCode.Colon]: TokenType.Colon,\n\t\t[CharCode.Comma]: TokenType.Comma,\n\t\t[CharCode.OpenCurlyBrace]: TokenType.CurlyOpen,\n\t\t[CharCode.CloseCurlyBrace]: TokenType.CurlyClose,\n\t\t[CharCode.Backslash]: TokenType.Backslash,\n\t\t[CharCode.Slash]: TokenType.Forwardslash,\n\t\t[CharCode.Pipe]: TokenType.Pipe,\n\t\t[CharCode.Plus]: TokenType.Plus,\n\t\t[CharCode.Dash]: TokenType.Dash,\n\t\t[CharCode.QuestionMark]: TokenType.QuestionMark,\n\t};\n\n\tstatic isDigitCharacter(ch: number): boolean {\n\t\treturn ch >= CharCode.Digit0 && ch <= CharCode.Digit9;\n\t}\n\n\tstatic isVariableCharacter(ch: number): boolean {\n\t\treturn ch === CharCode.Underline\n\t\t\t|| (ch >= CharCode.a && ch <= CharCode.z)\n\t\t\t|| (ch >= CharCode.A && ch <= CharCode.Z);\n\t}\n\n\tvalue: string = '';\n\tpos: number = 0;\n\n\ttext(value: string) {\n\t\tthis.value = value;\n\t\tthis.pos = 0;\n\t}\n\n\ttokenText(token: Token): string {\n\t\treturn this.value.substr(token.pos, token.len);\n\t}\n\n\tnext(): Token {\n\n\t\tif (this.pos >= this.value.length) {\n\t\t\treturn { type: TokenType.EOF, pos: this.pos, len: 0 };\n\t\t}\n\n\t\tlet pos = this.pos;\n\t\tlet len = 0;\n\t\tlet ch = this.value.charCodeAt(pos);\n\t\tlet type: TokenType;\n\n\t\t// static types\n\t\ttype = Scanner._table[ch];\n\t\tif (typeof type === 'number') {\n\t\t\tthis.pos += 1;\n\t\t\treturn { type, pos, len: 1 };\n\t\t}\n\n\t\t// number\n\t\tif (Scanner.isDigitCharacter(ch)) {\n\t\t\ttype = TokenType.Int;\n\t\t\tdo {\n\t\t\t\tlen += 1;\n\t\t\t\tch = this.value.charCodeAt(pos + len);\n\t\t\t} while (Scanner.isDigitCharacter(ch));\n\n\t\t\tthis.pos += len;\n\t\t\treturn { type, pos, len };\n\t\t}\n\n\t\t// variable name\n\t\tif (Scanner.isVariableCharacter(ch)) {\n\t\t\ttype = TokenType.VariableName;\n\t\t\tdo {\n\t\t\t\tch = this.value.charCodeAt(pos + (++len));\n\t\t\t} while (Scanner.isVariableCharacter(ch) || Scanner.isDigitCharacter(ch));\n\n\t\t\tthis.pos += len;\n\t\t\treturn { type, pos, len };\n\t\t}\n\n\n\t\t// format\n\t\ttype = TokenType.Format;\n\t\tdo {\n\t\t\tlen += 1;\n\t\t\tch = this.value.charCodeAt(pos + len);\n\t\t} while (\n\t\t\t!isNaN(ch)\n\t\t\t&& typeof Scanner._table[ch] === 'undefined' // not static token\n\t\t\t&& !Scanner.isDigitCharacter(ch) // not number\n\t\t\t&& !Scanner.isVariableCharacter(ch) // not variable\n\t\t);\n\n\t\tthis.pos += len;\n\t\treturn { type, pos, len };\n\t}\n}\n\nexport abstract class Marker {\n\n\treadonly _markerBrand: any;\n\n\tpublic parent!: Marker;\n\tprotected _children: Marker[] = [];\n\n\tappendChild(child: Marker): this {\n\t\tif (child instanceof Text && this._children[this._children.length - 1] instanceof Text) {\n\t\t\t// this and previous child are text -> merge them\n\t\t\t(<Text>this._children[this._children.length - 1]).value += child.value;\n\t\t} else {\n\t\t\t// normal adoption of child\n\t\t\tchild.parent = this;\n\t\t\tthis._children.push(child);\n\t\t}\n\t\treturn this;\n\t}\n\n\treplace(child: Marker, others: Marker[]): void {\n\t\tconst { parent } = child;\n\t\tconst idx = parent.children.indexOf(child);\n\t\tconst newChildren = parent.children.slice(0);\n\t\tnewChildren.splice(idx, 1, ...others);\n\t\tparent._children = newChildren;\n\n\t\t(function _fixParent(children: Marker[], parent: Marker) {\n\t\t\tfor (const child of children) {\n\t\t\t\tchild.parent = parent;\n\t\t\t\t_fixParent(child.children, child);\n\t\t\t}\n\t\t})(others, parent);\n\t}\n\n\tget children(): Marker[] {\n\t\treturn this._children;\n\t}\n\n\tget snippet(): TextmateSnippet | undefined {\n\t\tlet candidate: Marker = this;\n\t\twhile (true) {\n\t\t\tif (!candidate) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif (candidate instanceof TextmateSnippet) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t\tcandidate = candidate.parent;\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn this.children.reduce((prev, cur) => prev + cur.toString(), '');\n\t}\n\n\tlen(): number {\n\t\treturn 0;\n\t}\n\n\tabstract clone(): Marker;\n}\n\nexport class Text extends Marker {\n\n\tconstructor(public value: string) {\n\t\tsuper();\n\t}\n\toverride toString() {\n\t\treturn this.value;\n\t}\n\toverride len(): number {\n\t\treturn this.value.length;\n\t}\n\tclone(): Text {\n\t\treturn new Text(this.value);\n\t}\n}\n\nexport abstract class TransformableMarker extends Marker {\n\tpublic transform?: Transform;\n}\n\nexport class Placeholder extends TransformableMarker {\n\tstatic compareByIndex(a: Placeholder, b: Placeholder): number {\n\t\tif (a.index === b.index) {\n\t\t\treturn 0;\n\t\t} else if (a.isFinalTabstop) {\n\t\t\treturn 1;\n\t\t} else if (b.isFinalTabstop) {\n\t\t\treturn -1;\n\t\t} else if (a.index < b.index) {\n\t\t\treturn -1;\n\t\t} else if (a.index > b.index) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tconstructor(public index: number) {\n\t\tsuper();\n\t}\n\n\tget isFinalTabstop() {\n\t\treturn this.index === 0;\n\t}\n\n\tget choice(): Choice | undefined {\n\t\treturn this._children.length === 1 && this._children[0] instanceof Choice\n\t\t\t? this._children[0] as Choice\n\t\t\t: undefined;\n\t}\n\n\tclone(): Placeholder {\n\t\tlet ret = new Placeholder(this.index);\n\t\tif (this.transform) {\n\t\t\tret.transform = this.transform.clone();\n\t\t}\n\t\tret._children = this.children.map(child => child.clone());\n\t\treturn ret;\n\t}\n}\n\nexport class Choice extends Marker {\n\n\treadonly options: Text[] = [];\n\n\toverride appendChild(marker: Marker): this {\n\t\tif (marker instanceof Text) {\n\t\t\tmarker.parent = this;\n\t\t\tthis.options.push(marker);\n\t\t}\n\t\treturn this;\n\t}\n\n\toverride toString() {\n\t\treturn this.options[0].value;\n\t}\n\n\toverride len(): number {\n\t\treturn this.options[0].len();\n\t}\n\n\tclone(): Choice {\n\t\tlet ret = new Choice();\n\t\tthis.options.forEach(ret.appendChild, ret);\n\t\treturn ret;\n\t}\n}\n\nexport class Transform extends Marker {\n\n\tregexp: RegExp = new RegExp('');\n\n\tresolve(value: string): string {\n\t\tconst _this = this;\n\t\tlet didMatch = false;\n\t\tlet ret = value.replace(this.regexp, function () {\n\t\t\tdidMatch = true;\n\t\t\treturn _this._replace(Array.prototype.slice.call(arguments, 0, -2));\n\t\t});\n\t\t// when the regex didn't match and when the transform has\n\t\t// else branches, then run those\n\t\tif (!didMatch && this._children.some(child => child instanceof FormatString && Boolean(child.elseValue))) {\n\t\t\tret = this._replace([]);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate _replace(groups: string[]): string {\n\t\tlet ret = '';\n\t\tfor (const marker of this._children) {\n\t\t\tif (marker instanceof FormatString) {\n\t\t\t\tlet value = groups[marker.index] || '';\n\t\t\t\tvalue = marker.resolve(value);\n\t\t\t\tret += value;\n\t\t\t} else {\n\t\t\t\tret += marker.toString();\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\toverride toString(): string {\n\t\treturn '';\n\t}\n\n\tclone(): Transform {\n\t\tlet ret = new Transform();\n\t\tret.regexp = new RegExp(this.regexp.source, '' + (this.regexp.ignoreCase ? 'i' : '') + (this.regexp.global ? 'g' : ''));\n\t\tret._children = this.children.map(child => child.clone());\n\t\treturn ret;\n\t}\n\n}\n\nexport class FormatString extends Marker {\n\n\tconstructor(\n\t\treadonly index: number,\n\t\treadonly shorthandName?: string,\n\t\treadonly ifValue?: string,\n\t\treadonly elseValue?: string,\n\t) {\n\t\tsuper();\n\t}\n\n\tresolve(value?: string): string {\n\t\tif (this.shorthandName === 'upcase') {\n\t\t\treturn !value ? '' : value.toLocaleUpperCase();\n\t\t} else if (this.shorthandName === 'downcase') {\n\t\t\treturn !value ? '' : value.toLocaleLowerCase();\n\t\t} else if (this.shorthandName === 'capitalize') {\n\t\t\treturn !value ? '' : (value[0].toLocaleUpperCase() + value.substr(1));\n\t\t} else if (this.shorthandName === 'pascalcase') {\n\t\t\treturn !value ? '' : this._toPascalCase(value);\n\t\t} else if (this.shorthandName === 'camelcase') {\n\t\t\treturn !value ? '' : this._toCamelCase(value);\n\t\t} else if (Boolean(value) && typeof this.ifValue === 'string') {\n\t\t\treturn this.ifValue;\n\t\t} else if (!Boolean(value) && typeof this.elseValue === 'string') {\n\t\t\treturn this.elseValue;\n\t\t} else {\n\t\t\treturn value || '';\n\t\t}\n\t}\n\n\tprivate _toPascalCase(value: string): string {\n\t\tconst match = value.match(/[a-z0-9]+/gi);\n\t\tif (!match) {\n\t\t\treturn value;\n\t\t}\n\t\treturn match.map(word => {\n\t\t\treturn word.charAt(0).toUpperCase()\n\t\t\t\t+ word.substr(1).toLowerCase();\n\t\t})\n\t\t\t.join('');\n\t}\n\n\tprivate _toCamelCase(value: string): string {\n\t\tconst match = value.match(/[a-z0-9]+/gi);\n\t\tif (!match) {\n\t\t\treturn value;\n\t\t}\n\t\treturn match.map((word, index) => {\n\t\t\tif (index === 0) {\n\t\t\t\treturn word.toLowerCase();\n\t\t\t} else {\n\t\t\t\treturn word.charAt(0).toUpperCase()\n\t\t\t\t\t+ word.substr(1).toLowerCase();\n\t\t\t}\n\t\t})\n\t\t\t.join('');\n\t}\n\n\tclone(): FormatString {\n\t\tlet ret = new FormatString(this.index, this.shorthandName, this.ifValue, this.elseValue);\n\t\treturn ret;\n\t}\n}\n\nexport class Variable extends TransformableMarker {\n\n\tconstructor(public name: string) {\n\t\tsuper();\n\t}\n\n\tresolve(resolver: VariableResolver): boolean {\n\t\tlet value = resolver.resolve(this);\n\t\tif (this.transform) {\n\t\t\tvalue = this.transform.resolve(value || '');\n\t\t}\n\t\tif (value !== undefined) {\n\t\t\tthis._children = [new Text(value)];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tclone(): Variable {\n\t\tconst ret = new Variable(this.name);\n\t\tif (this.transform) {\n\t\t\tret.transform = this.transform.clone();\n\t\t}\n\t\tret._children = this.children.map(child => child.clone());\n\t\treturn ret;\n\t}\n}\n\nexport interface VariableResolver {\n\tresolve(variable: Variable): string | undefined;\n}\n\nfunction walk(marker: Marker[], visitor: (marker: Marker) => boolean): void {\n\tconst stack = [...marker];\n\twhile (stack.length > 0) {\n\t\tconst marker = stack.shift()!;\n\t\tconst recurse = visitor(marker);\n\t\tif (!recurse) {\n\t\t\tbreak;\n\t\t}\n\t\tstack.unshift(...marker.children);\n\t}\n}\n\nexport class TextmateSnippet extends Marker {\n\n\tprivate _placeholders?: { all: Placeholder[]; last?: Placeholder };\n\n\tget placeholderInfo() {\n\t\tif (!this._placeholders) {\n\t\t\t// fill in placeholders\n\t\t\tlet all: Placeholder[] = [];\n\t\t\tlet last: Placeholder | undefined;\n\t\t\tthis.walk(function (candidate) {\n\t\t\t\tif (candidate instanceof Placeholder) {\n\t\t\t\t\tall.push(candidate);\n\t\t\t\t\tlast = !last || last.index < candidate.index ? candidate : last;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tthis._placeholders = { all, last };\n\t\t}\n\t\treturn this._placeholders;\n\t}\n\n\tget placeholders(): Placeholder[] {\n\t\tconst { all } = this.placeholderInfo;\n\t\treturn all;\n\t}\n\n\toffset(marker: Marker): number {\n\t\tlet pos = 0;\n\t\tlet found = false;\n\t\tthis.walk(candidate => {\n\t\t\tif (candidate === marker) {\n\t\t\t\tfound = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpos += candidate.len();\n\t\t\treturn true;\n\t\t});\n\n\t\tif (!found) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn pos;\n\t}\n\n\tfullLen(marker: Marker): number {\n\t\tlet ret = 0;\n\t\twalk([marker], marker => {\n\t\t\tret += marker.len();\n\t\t\treturn true;\n\t\t});\n\t\treturn ret;\n\t}\n\n\tenclosingPlaceholders(placeholder: Placeholder): Placeholder[] {\n\t\tlet ret: Placeholder[] = [];\n\t\tlet { parent } = placeholder;\n\t\twhile (parent) {\n\t\t\tif (parent instanceof Placeholder) {\n\t\t\t\tret.push(parent);\n\t\t\t}\n\t\t\tparent = parent.parent;\n\t\t}\n\t\treturn ret;\n\t}\n\n\tresolveVariables(resolver: VariableResolver): this {\n\t\tthis.walk(candidate => {\n\t\t\tif (candidate instanceof Variable) {\n\t\t\t\tif (candidate.resolve(resolver)) {\n\t\t\t\t\tthis._placeholders = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\treturn this;\n\t}\n\n\toverride appendChild(child: Marker) {\n\t\tthis._placeholders = undefined;\n\t\treturn super.appendChild(child);\n\t}\n\n\toverride replace(child: Marker, others: Marker[]): void {\n\t\tthis._placeholders = undefined;\n\t\treturn super.replace(child, others);\n\t}\n\n\tclone(): TextmateSnippet {\n\t\tlet ret = new TextmateSnippet();\n\t\tthis._children = this.children.map(child => child.clone());\n\t\treturn ret;\n\t}\n\n\twalk(visitor: (marker: Marker) => boolean): void {\n\t\twalk(this.children, visitor);\n\t}\n}\n\nexport class SnippetParser {\n\n\tstatic escape(value: string): string {\n\t\treturn value.replace(/\\$|}|\\\\/g, '\\\\$&');\n\t}\n\n\tstatic guessNeedsClipboard(template: string): boolean {\n\t\treturn /\\${?CLIPBOARD/.test(template);\n\t}\n\n\tprivate _scanner: Scanner = new Scanner();\n\tprivate _token: Token = { type: TokenType.EOF, pos: 0, len: 0 };\n\n\tparse(value: string, insertFinalTabstop?: boolean, enforceFinalTabstop?: boolean): TextmateSnippet {\n\n\t\tthis._scanner.text(value);\n\t\tthis._token = this._scanner.next();\n\n\t\tconst snippet = new TextmateSnippet();\n\t\twhile (this._parse(snippet)) {\n\t\t\t// nothing\n\t\t}\n\n\t\t// fill in values for placeholders. the first placeholder of an index\n\t\t// that has a value defines the value for all placeholders with that index\n\t\tconst placeholderDefaultValues = new Map<number, Marker[] | undefined>();\n\t\tconst incompletePlaceholders: Placeholder[] = [];\n\t\tlet placeholderCount = 0;\n\t\tsnippet.walk(marker => {\n\t\t\tif (marker instanceof Placeholder) {\n\t\t\t\tplaceholderCount += 1;\n\t\t\t\tif (marker.isFinalTabstop) {\n\t\t\t\t\tplaceholderDefaultValues.set(0, undefined);\n\t\t\t\t} else if (!placeholderDefaultValues.has(marker.index) && marker.children.length > 0) {\n\t\t\t\t\tplaceholderDefaultValues.set(marker.index, marker.children);\n\t\t\t\t} else {\n\t\t\t\t\tincompletePlaceholders.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tfor (const placeholder of incompletePlaceholders) {\n\t\t\tconst defaultValues = placeholderDefaultValues.get(placeholder.index);\n\t\t\tif (defaultValues) {\n\t\t\t\tconst clone = new Placeholder(placeholder.index);\n\t\t\t\tclone.transform = placeholder.transform;\n\t\t\t\tfor (const child of defaultValues) {\n\t\t\t\t\tclone.appendChild(child.clone());\n\t\t\t\t}\n\t\t\t\tsnippet.replace(placeholder, [clone]);\n\t\t\t}\n\t\t}\n\n\t\tif (!enforceFinalTabstop) {\n\t\t\tenforceFinalTabstop = placeholderCount > 0 && insertFinalTabstop;\n\t\t}\n\n\t\tif (!placeholderDefaultValues.has(0) && enforceFinalTabstop) {\n\t\t\t// the snippet uses placeholders but has no\n\t\t\t// final tabstop defined -> insert at the end\n\t\t\tsnippet.appendChild(new Placeholder(0));\n\t\t}\n\n\t\treturn snippet;\n\t}\n\n\tprivate _accept(type?: TokenType): boolean;\n\tprivate _accept(type: TokenType | undefined, value: true): string;\n\tprivate _accept(type: TokenType, value?: boolean): boolean | string {\n\t\tif (type === undefined || this._token.type === type) {\n\t\t\tlet ret = !value ? true : this._scanner.tokenText(this._token);\n\t\t\tthis._token = this._scanner.next();\n\t\t\treturn ret;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _backTo(token: Token): false {\n\t\tthis._scanner.pos = token.pos + token.len;\n\t\tthis._token = token;\n\t\treturn false;\n\t}\n\n\tprivate _until(type: TokenType): false | string {\n\t\tconst start = this._token;\n\t\twhile (this._token.type !== type) {\n\t\t\tif (this._token.type === TokenType.EOF) {\n\t\t\t\treturn false;\n\t\t\t} else if (this._token.type === TokenType.Backslash) {\n\t\t\t\tconst nextToken = this._scanner.next();\n\t\t\t\tif (nextToken.type !== TokenType.Dollar\n\t\t\t\t\t&& nextToken.type !== TokenType.CurlyClose\n\t\t\t\t\t&& nextToken.type !== TokenType.Backslash) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._token = this._scanner.next();\n\t\t}\n\t\tconst value = this._scanner.value.substring(start.pos, this._token.pos).replace(/\\\\(\\$|}|\\\\)/g, '$1');\n\t\tthis._token = this._scanner.next();\n\t\treturn value;\n\t}\n\n\tprivate _parse(marker: Marker): boolean {\n\t\treturn this._parseEscaped(marker)\n\t\t\t|| this._parseTabstopOrVariableName(marker)\n\t\t\t|| this._parseComplexPlaceholder(marker)\n\t\t\t|| this._parseComplexVariable(marker)\n\t\t\t|| this._parseAnything(marker);\n\t}\n\n\t// \\$, \\\\, \\} -> just text\n\tprivate _parseEscaped(marker: Marker): boolean {\n\t\tlet value: string;\n\t\tif (value = this._accept(TokenType.Backslash, true)) {\n\t\t\t// saw a backslash, append escaped token or that backslash\n\t\t\tvalue = this._accept(TokenType.Dollar, true)\n\t\t\t\t|| this._accept(TokenType.CurlyClose, true)\n\t\t\t\t|| this._accept(TokenType.Backslash, true)\n\t\t\t\t|| value;\n\n\t\t\tmarker.appendChild(new Text(value));\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// $foo -> variable, $1 -> tabstop\n\tprivate _parseTabstopOrVariableName(parent: Marker): boolean {\n\t\tlet value: string;\n\t\tconst token = this._token;\n\t\tconst match = this._accept(TokenType.Dollar)\n\t\t\t&& (value = this._accept(TokenType.VariableName, true) || this._accept(TokenType.Int, true));\n\n\t\tif (!match) {\n\t\t\treturn this._backTo(token);\n\t\t}\n\n\t\tparent.appendChild(/^\\d+$/.test(value!)\n\t\t\t? new Placeholder(Number(value!))\n\t\t\t: new Variable(value!)\n\t\t);\n\t\treturn true;\n\t}\n\n\t// ${1:<children>}, ${1} -> placeholder\n\tprivate _parseComplexPlaceholder(parent: Marker): boolean {\n\t\tlet index: string;\n\t\tconst token = this._token;\n\t\tconst match = this._accept(TokenType.Dollar)\n\t\t\t&& this._accept(TokenType.CurlyOpen)\n\t\t\t&& (index = this._accept(TokenType.Int, true));\n\n\t\tif (!match) {\n\t\t\treturn this._backTo(token);\n\t\t}\n\n\t\tconst placeholder = new Placeholder(Number(index!));\n\n\t\tif (this._accept(TokenType.Colon)) {\n\t\t\t// ${1:<children>}\n\t\t\twhile (true) {\n\n\t\t\t\t// ...} -> done\n\t\t\t\tif (this._accept(TokenType.CurlyClose)) {\n\t\t\t\t\tparent.appendChild(placeholder);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (this._parse(placeholder)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// fallback\n\t\t\t\tparent.appendChild(new Text('${' + index! + ':'));\n\t\t\t\tplaceholder.children.forEach(parent.appendChild, parent);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (placeholder.index > 0 && this._accept(TokenType.Pipe)) {\n\t\t\t// ${1|one,two,three|}\n\t\t\tconst choice = new Choice();\n\n\t\t\twhile (true) {\n\t\t\t\tif (this._parseChoiceElement(choice)) {\n\n\t\t\t\t\tif (this._accept(TokenType.Comma)) {\n\t\t\t\t\t\t// opt, -> more\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this._accept(TokenType.Pipe)) {\n\t\t\t\t\t\tplaceholder.appendChild(choice);\n\t\t\t\t\t\tif (this._accept(TokenType.CurlyClose)) {\n\t\t\t\t\t\t\t// ..|} -> done\n\t\t\t\t\t\t\tparent.appendChild(placeholder);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._backTo(token);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} else if (this._accept(TokenType.Forwardslash)) {\n\t\t\t// ${1/<regex>/<format>/<options>}\n\t\t\tif (this._parseTransform(placeholder)) {\n\t\t\t\tparent.appendChild(placeholder);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tthis._backTo(token);\n\t\t\treturn false;\n\n\t\t} else if (this._accept(TokenType.CurlyClose)) {\n\t\t\t// ${1}\n\t\t\tparent.appendChild(placeholder);\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\t// ${1 <- missing curly or colon\n\t\t\treturn this._backTo(token);\n\t\t}\n\t}\n\n\tprivate _parseChoiceElement(parent: Choice): boolean {\n\t\tconst token = this._token;\n\t\tconst values: string[] = [];\n\n\t\twhile (true) {\n\t\t\tif (this._token.type === TokenType.Comma || this._token.type === TokenType.Pipe) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet value: string;\n\t\t\tif (value = this._accept(TokenType.Backslash, true)) {\n\t\t\t\t// \\, \\|, or \\\\\n\t\t\t\tvalue = this._accept(TokenType.Comma, true)\n\t\t\t\t\t|| this._accept(TokenType.Pipe, true)\n\t\t\t\t\t|| this._accept(TokenType.Backslash, true)\n\t\t\t\t\t|| value;\n\t\t\t} else {\n\t\t\t\tvalue = this._accept(undefined, true);\n\t\t\t}\n\t\t\tif (!value) {\n\t\t\t\t// EOF\n\t\t\t\tthis._backTo(token);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvalues.push(value);\n\t\t}\n\n\t\tif (values.length === 0) {\n\t\t\tthis._backTo(token);\n\t\t\treturn false;\n\t\t}\n\n\t\tparent.appendChild(new Text(values.join('')));\n\t\treturn true;\n\t}\n\n\t// ${foo:<children>}, ${foo} -> variable\n\tprivate _parseComplexVariable(parent: Marker): boolean {\n\t\tlet name: string;\n\t\tconst token = this._token;\n\t\tconst match = this._accept(TokenType.Dollar)\n\t\t\t&& this._accept(TokenType.CurlyOpen)\n\t\t\t&& (name = this._accept(TokenType.VariableName, true));\n\n\t\tif (!match) {\n\t\t\treturn this._backTo(token);\n\t\t}\n\n\t\tconst variable = new Variable(name!);\n\n\t\tif (this._accept(TokenType.Colon)) {\n\t\t\t// ${foo:<children>}\n\t\t\twhile (true) {\n\n\t\t\t\t// ...} -> done\n\t\t\t\tif (this._accept(TokenType.CurlyClose)) {\n\t\t\t\t\tparent.appendChild(variable);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (this._parse(variable)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// fallback\n\t\t\t\tparent.appendChild(new Text('${' + name! + ':'));\n\t\t\t\tvariable.children.forEach(parent.appendChild, parent);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t} else if (this._accept(TokenType.Forwardslash)) {\n\t\t\t// ${foo/<regex>/<format>/<options>}\n\t\t\tif (this._parseTransform(variable)) {\n\t\t\t\tparent.appendChild(variable);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tthis._backTo(token);\n\t\t\treturn false;\n\n\t\t} else if (this._accept(TokenType.CurlyClose)) {\n\t\t\t// ${foo}\n\t\t\tparent.appendChild(variable);\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\t// ${foo <- missing curly or colon\n\t\t\treturn this._backTo(token);\n\t\t}\n\t}\n\n\tprivate _parseTransform(parent: TransformableMarker): boolean {\n\t\t// ...<regex>/<format>/<options>}\n\n\t\tlet transform = new Transform();\n\t\tlet regexValue = '';\n\t\tlet regexOptions = '';\n\n\t\t// (1) /regex\n\t\twhile (true) {\n\t\t\tif (this._accept(TokenType.Forwardslash)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet escaped: string;\n\t\t\tif (escaped = this._accept(TokenType.Backslash, true)) {\n\t\t\t\tescaped = this._accept(TokenType.Forwardslash, true) || escaped;\n\t\t\t\tregexValue += escaped;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (this._token.type !== TokenType.EOF) {\n\t\t\t\tregexValue += this._accept(undefined, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t// (2) /format\n\t\twhile (true) {\n\t\t\tif (this._accept(TokenType.Forwardslash)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet escaped: string;\n\t\t\tif (escaped = this._accept(TokenType.Backslash, true)) {\n\t\t\t\tescaped = this._accept(TokenType.Backslash, true) || this._accept(TokenType.Forwardslash, true) || escaped;\n\t\t\t\ttransform.appendChild(new Text(escaped));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (this._parseFormatString(transform) || this._parseAnything(transform)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t// (3) /option\n\t\twhile (true) {\n\t\t\tif (this._accept(TokenType.CurlyClose)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (this._token.type !== TokenType.EOF) {\n\t\t\t\tregexOptions += this._accept(undefined, true);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\ttransform.regexp = new RegExp(regexValue, regexOptions);\n\t\t} catch (e) {\n\t\t\t// invalid regexp\n\t\t\treturn false;\n\t\t}\n\n\t\tparent.transform = transform;\n\t\treturn true;\n\t}\n\n\tprivate _parseFormatString(parent: Transform): boolean {\n\n\t\tconst token = this._token;\n\t\tif (!this._accept(TokenType.Dollar)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet complex = false;\n\t\tif (this._accept(TokenType.CurlyOpen)) {\n\t\t\tcomplex = true;\n\t\t}\n\n\t\tlet index = this._accept(TokenType.Int, true);\n\n\t\tif (!index) {\n\t\t\tthis._backTo(token);\n\t\t\treturn false;\n\n\t\t} else if (!complex) {\n\t\t\t// $1\n\t\t\tparent.appendChild(new FormatString(Number(index)));\n\t\t\treturn true;\n\n\t\t} else if (this._accept(TokenType.CurlyClose)) {\n\t\t\t// ${1}\n\t\t\tparent.appendChild(new FormatString(Number(index)));\n\t\t\treturn true;\n\n\t\t} else if (!this._accept(TokenType.Colon)) {\n\t\t\tthis._backTo(token);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this._accept(TokenType.Forwardslash)) {\n\t\t\t// ${1:/upcase}\n\t\t\tlet shorthand = this._accept(TokenType.VariableName, true);\n\t\t\tif (!shorthand || !this._accept(TokenType.CurlyClose)) {\n\t\t\t\tthis._backTo(token);\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tparent.appendChild(new FormatString(Number(index), shorthand));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t} else if (this._accept(TokenType.Plus)) {\n\t\t\t// ${1:+<if>}\n\t\t\tlet ifValue = this._until(TokenType.CurlyClose);\n\t\t\tif (ifValue) {\n\t\t\t\tparent.appendChild(new FormatString(Number(index), undefined, ifValue, undefined));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t} else if (this._accept(TokenType.Dash)) {\n\t\t\t// ${2:-<else>}\n\t\t\tlet elseValue = this._until(TokenType.CurlyClose);\n\t\t\tif (elseValue) {\n\t\t\t\tparent.appendChild(new FormatString(Number(index), undefined, undefined, elseValue));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t} else if (this._accept(TokenType.QuestionMark)) {\n\t\t\t// ${2:?<if>:<else>}\n\t\t\tlet ifValue = this._until(TokenType.Colon);\n\t\t\tif (ifValue) {\n\t\t\t\tlet elseValue = this._until(TokenType.CurlyClose);\n\t\t\t\tif (elseValue) {\n\t\t\t\t\tparent.appendChild(new FormatString(Number(index), undefined, ifValue, elseValue));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// ${1:<else>}\n\t\t\tlet elseValue = this._until(TokenType.CurlyClose);\n\t\t\tif (elseValue) {\n\t\t\t\tparent.appendChild(new FormatString(Number(index), undefined, undefined, elseValue));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tthis._backTo(token);\n\t\treturn false;\n\t}\n\n\tprivate _parseAnything(marker: Marker): boolean {\n\t\tif (this._token.type !== TokenType.EOF) {\n\t\t\tmarker.appendChild(new Text(this._scanner.tokenText(this._token)));\n\t\t\tthis._accept(undefined);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\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 { quickSelect } from 'vs/base/common/arrays';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { anyScore, fuzzyScore, FuzzyScore, fuzzyScoreGracefulAggressive, FuzzyScorer } from 'vs/base/common/filters';\nimport { compareIgnoreCase } from 'vs/base/common/strings';\nimport { InternalSuggestOptions } from 'vs/editor/common/config/editorOptions';\nimport { CompletionItemKind, CompletionItemProvider } from 'vs/editor/common/languages';\nimport { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance';\nimport { CompletionItem } from './suggest';\n\ntype StrictCompletionItem = Required<CompletionItem>;\n\nexport interface ICompletionStats {\n\tpLabelLen: number;\n}\n\nexport class LineContext {\n\tconstructor(\n\t\treadonly leadingLineContent: string,\n\t\treadonly characterCountDelta: number,\n\t) { }\n}\n\nconst enum Refilter {\n\tNothing = 0,\n\tAll = 1,\n\tIncr = 2\n}\n\n/**\n * Sorted, filtered completion view model\n * */\nexport class CompletionModel {\n\n\tprivate readonly _items: CompletionItem[];\n\tprivate readonly _column: number;\n\tprivate readonly _wordDistance: WordDistance;\n\tprivate readonly _options: InternalSuggestOptions;\n\tprivate readonly _snippetCompareFn = CompletionModel._compareCompletionItems;\n\n\tprivate _lineContext: LineContext;\n\tprivate _refilterKind: Refilter;\n\tprivate _filteredItems?: StrictCompletionItem[];\n\tprivate _providerInfo?: Map<CompletionItemProvider, boolean>;\n\tprivate _stats?: ICompletionStats;\n\n\tconstructor(\n\t\titems: CompletionItem[],\n\t\tcolumn: number,\n\t\tlineContext: LineContext,\n\t\twordDistance: WordDistance,\n\t\toptions: InternalSuggestOptions,\n\t\tsnippetSuggestions: 'top' | 'bottom' | 'inline' | 'none',\n\t\treadonly clipboardText: string | undefined\n\t) {\n\t\tthis._items = items;\n\t\tthis._column = column;\n\t\tthis._wordDistance = wordDistance;\n\t\tthis._options = options;\n\t\tthis._refilterKind = Refilter.All;\n\t\tthis._lineContext = lineContext;\n\n\t\tif (snippetSuggestions === 'top') {\n\t\t\tthis._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsUp;\n\t\t} else if (snippetSuggestions === 'bottom') {\n\t\t\tthis._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsDown;\n\t\t}\n\t}\n\n\tget lineContext(): LineContext {\n\t\treturn this._lineContext;\n\t}\n\n\tset lineContext(value: LineContext) {\n\t\tif (this._lineContext.leadingLineContent !== value.leadingLineContent\n\t\t\t|| this._lineContext.characterCountDelta !== value.characterCountDelta\n\t\t) {\n\t\t\tthis._refilterKind = this._lineContext.characterCountDelta < value.characterCountDelta && this._filteredItems ? Refilter.Incr : Refilter.All;\n\t\t\tthis._lineContext = value;\n\t\t}\n\t}\n\n\tget items(): CompletionItem[] {\n\t\tthis._ensureCachedState();\n\t\treturn this._filteredItems!;\n\t}\n\n\tget allProvider(): IterableIterator<CompletionItemProvider> {\n\t\tthis._ensureCachedState();\n\t\treturn this._providerInfo!.keys();\n\t}\n\n\tget incomplete(): Set<CompletionItemProvider> {\n\t\tthis._ensureCachedState();\n\t\tconst result = new Set<CompletionItemProvider>();\n\t\tfor (let [provider, incomplete] of this._providerInfo!) {\n\t\t\tif (incomplete) {\n\t\t\t\tresult.add(provider);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tadopt(except: Set<CompletionItemProvider>): CompletionItem[] {\n\t\tlet res: CompletionItem[] = [];\n\t\tfor (let i = 0; i < this._items.length;) {\n\t\t\tif (!except.has(this._items[i].provider)) {\n\t\t\t\tres.push(this._items[i]);\n\n\t\t\t\t// unordered removed\n\t\t\t\tthis._items[i] = this._items[this._items.length - 1];\n\t\t\t\tthis._items.pop();\n\t\t\t} else {\n\t\t\t\t// continue with next item\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tthis._refilterKind = Refilter.All;\n\t\treturn res;\n\t}\n\n\tget stats(): ICompletionStats {\n\t\tthis._ensureCachedState();\n\t\treturn this._stats!;\n\t}\n\n\tprivate _ensureCachedState(): void {\n\t\tif (this._refilterKind !== Refilter.Nothing) {\n\t\t\tthis._createCachedState();\n\t\t}\n\t}\n\n\tprivate _createCachedState(): void {\n\n\t\tthis._providerInfo = new Map();\n\n\t\tconst labelLengths: number[] = [];\n\n\t\tconst { leadingLineContent, characterCountDelta } = this._lineContext;\n\t\tlet word = '';\n\t\tlet wordLow = '';\n\n\t\t// incrementally filter less\n\t\tconst source = this._refilterKind === Refilter.All ? this._items : this._filteredItems!;\n\t\tconst target: StrictCompletionItem[] = [];\n\n\t\t// picks a score function based on the number of\n\t\t// items that we have to score/filter and based on the\n\t\t// user-configuration\n\t\tconst scoreFn: FuzzyScorer = (!this._options.filterGraceful || source.length > 2000) ? fuzzyScore : fuzzyScoreGracefulAggressive;\n\n\t\tfor (let i = 0; i < source.length; i++) {\n\n\t\t\tconst item = source[i];\n\n\t\t\tif (item.isInvalid) {\n\t\t\t\tcontinue; // SKIP invalid items\n\t\t\t}\n\n\t\t\t// collect all support, know if their result is incomplete\n\t\t\tthis._providerInfo.set(item.provider, Boolean(item.container.incomplete));\n\n\t\t\t// 'word' is that remainder of the current line that we\n\t\t\t// filter and score against. In theory each suggestion uses a\n\t\t\t// different word, but in practice not - that's why we cache\n\t\t\tconst overwriteBefore = item.position.column - item.editStart.column;\n\t\t\tconst wordLen = overwriteBefore + characterCountDelta - (item.position.column - this._column);\n\t\t\tif (word.length !== wordLen) {\n\t\t\t\tword = wordLen === 0 ? '' : leadingLineContent.slice(-wordLen);\n\t\t\t\twordLow = word.toLowerCase();\n\t\t\t}\n\n\t\t\t// remember the word against which this item was\n\t\t\t// scored\n\t\t\titem.word = word;\n\n\t\t\tif (wordLen === 0) {\n\t\t\t\t// when there is nothing to score against, don't\n\t\t\t\t// event try to do. Use a const rank and rely on\n\t\t\t\t// the fallback-sort using the initial sort order.\n\t\t\t\t// use a score of `-100` because that is out of the\n\t\t\t\t// bound of values `fuzzyScore` will return\n\t\t\t\titem.score = FuzzyScore.Default;\n\n\t\t\t} else {\n\t\t\t\t// skip word characters that are whitespace until\n\t\t\t\t// we have hit the replace range (overwriteBefore)\n\t\t\t\tlet wordPos = 0;\n\t\t\t\twhile (wordPos < overwriteBefore) {\n\t\t\t\t\tconst ch = word.charCodeAt(wordPos);\n\t\t\t\t\tif (ch === CharCode.Space || ch === CharCode.Tab) {\n\t\t\t\t\t\twordPos += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (wordPos >= wordLen) {\n\t\t\t\t\t// the wordPos at which scoring starts is the whole word\n\t\t\t\t\t// and therefore the same rules as not having a word apply\n\t\t\t\t\titem.score = FuzzyScore.Default;\n\n\t\t\t\t} else if (typeof item.completion.filterText === 'string') {\n\t\t\t\t\t// when there is a `filterText` it must match the `word`.\n\t\t\t\t\t// if it matches we check with the label to compute highlights\n\t\t\t\t\t// and if that doesn't yield a result we have no highlights,\n\t\t\t\t\t// despite having the match\n\t\t\t\t\tlet match = scoreFn(word, wordLow, wordPos, item.completion.filterText, item.filterTextLow!, 0, false);\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tcontinue; // NO match\n\t\t\t\t\t}\n\t\t\t\t\tif (compareIgnoreCase(item.completion.filterText, item.textLabel) === 0) {\n\t\t\t\t\t\t// filterText and label are actually the same -> use good highlights\n\t\t\t\t\t\titem.score = match;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// re-run the scorer on the label in the hope of a result BUT use the rank\n\t\t\t\t\t\t// of the filterText-match\n\t\t\t\t\t\titem.score = anyScore(word, wordLow, wordPos, item.textLabel, item.labelLow, 0);\n\t\t\t\t\t\titem.score[0] = match[0]; // use score from filterText\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// by default match `word` against the `label`\n\t\t\t\t\tlet match = scoreFn(word, wordLow, wordPos, item.textLabel, item.labelLow, 0, false);\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tcontinue; // NO match\n\t\t\t\t\t}\n\t\t\t\t\titem.score = match;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titem.idx = i;\n\t\t\titem.distance = this._wordDistance.distance(item.position, item.completion);\n\t\t\ttarget.push(item as StrictCompletionItem);\n\n\t\t\t// update stats\n\t\t\tlabelLengths.push(item.textLabel.length);\n\t\t}\n\n\t\tthis._filteredItems = target.sort(this._snippetCompareFn);\n\t\tthis._refilterKind = Refilter.Nothing;\n\t\tthis._stats = {\n\t\t\tpLabelLen: labelLengths.length ?\n\t\t\t\tquickSelect(labelLengths.length - .85, labelLengths, (a, b) => a - b)\n\t\t\t\t: 0\n\t\t};\n\t}\n\n\tprivate static _compareCompletionItems(a: StrictCompletionItem, b: StrictCompletionItem): number {\n\t\tif (a.score[0] > b.score[0]) {\n\t\t\treturn -1;\n\t\t} else if (a.score[0] < b.score[0]) {\n\t\t\treturn 1;\n\t\t} else if (a.distance < b.distance) {\n\t\t\treturn -1;\n\t\t} else if (a.distance > b.distance) {\n\t\t\treturn 1;\n\t\t} else if (a.idx < b.idx) {\n\t\t\treturn -1;\n\t\t} else if (a.idx > b.idx) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tprivate static _compareCompletionItemsSnippetsDown(a: StrictCompletionItem, b: StrictCompletionItem): number {\n\t\tif (a.completion.kind !== b.completion.kind) {\n\t\t\tif (a.completion.kind === CompletionItemKind.Snippet) {\n\t\t\t\treturn 1;\n\t\t\t} else if (b.completion.kind === CompletionItemKind.Snippet) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\treturn CompletionModel._compareCompletionItems(a, b);\n\t}\n\n\tprivate static _compareCompletionItemsSnippetsUp(a: StrictCompletionItem, b: StrictCompletionItem): number {\n\t\tif (a.completion.kind !== b.completion.kind) {\n\t\t\tif (a.completion.kind === CompletionItemKind.Snippet) {\n\t\t\t\treturn -1;\n\t\t\t} else if (b.completion.kind === CompletionItemKind.Snippet) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn CompletionModel._compareCompletionItems(a, b);\n\t}\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 { Dimension } from 'vs/base/browser/dom';\nimport { Orientation, OrthogonalEdge, Sash, SashState } from 'vs/base/browser/ui/sash/sash';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\n\n\nexport interface IResizeEvent {\n\tdimension: Dimension;\n\tdone: boolean;\n\tnorth?: boolean;\n\teast?: boolean;\n\tsouth?: boolean;\n\twest?: boolean;\n}\n\nexport class ResizableHTMLElement {\n\n\treadonly domNode: HTMLElement;\n\n\tprivate readonly _onDidWillResize = new Emitter<void>();\n\treadonly onDidWillResize: Event<void> = this._onDidWillResize.event;\n\n\tprivate readonly _onDidResize = new Emitter<IResizeEvent>();\n\treadonly onDidResize: Event<IResizeEvent> = this._onDidResize.event;\n\n\tprivate readonly _northSash: Sash;\n\tprivate readonly _eastSash: Sash;\n\tprivate readonly _southSash: Sash;\n\tprivate readonly _westSash: Sash;\n\tprivate readonly _sashListener = new DisposableStore();\n\n\tprivate _size = new Dimension(0, 0);\n\tprivate _minSize = new Dimension(0, 0);\n\tprivate _maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n\tprivate _preferredSize?: Dimension;\n\n\tconstructor() {\n\t\tthis.domNode = document.createElement('div');\n\t\tthis._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: Orientation.VERTICAL });\n\t\tthis._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: Orientation.VERTICAL });\n\t\tthis._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.North });\n\t\tthis._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.South });\n\n\t\tthis._northSash.orthogonalStartSash = this._westSash;\n\t\tthis._northSash.orthogonalEndSash = this._eastSash;\n\t\tthis._southSash.orthogonalStartSash = this._westSash;\n\t\tthis._southSash.orthogonalEndSash = this._eastSash;\n\n\t\tlet currentSize: Dimension | undefined;\n\t\tlet deltaY = 0;\n\t\tlet deltaX = 0;\n\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {\n\t\t\tif (currentSize === undefined) {\n\t\t\t\tthis._onDidWillResize.fire();\n\t\t\t\tcurrentSize = this._size;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {\n\t\t\tif (currentSize !== undefined) {\n\t\t\t\tcurrentSize = undefined;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(this._eastSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = e.currentX - e.startX;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, east: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._westSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = -(e.currentX - e.startX);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, west: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._northSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = -(e.currentY - e.startY);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, north: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._southSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = e.currentY - e.startY;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, south: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._size.height, this._preferredSize.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._preferredSize.height, this._size.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._northSash.dispose();\n\t\tthis._southSash.dispose();\n\t\tthis._eastSash.dispose();\n\t\tthis._westSash.dispose();\n\t\tthis._sashListener.dispose();\n\t\tthis._onDidResize.dispose();\n\t\tthis._onDidWillResize.dispose();\n\t\tthis.domNode.remove();\n\t}\n\n\tenableSashes(north: boolean, east: boolean, south: boolean, west: boolean): void {\n\t\tthis._northSash.state = north ? SashState.Enabled : SashState.Disabled;\n\t\tthis._eastSash.state = east ? SashState.Enabled : SashState.Disabled;\n\t\tthis._southSash.state = south ? SashState.Enabled : SashState.Disabled;\n\t\tthis._westSash.state = west ? SashState.Enabled : SashState.Disabled;\n\t}\n\n\tlayout(height: number = this.size.height, width: number = this.size.width): void {\n\n\t\tconst { height: minHeight, width: minWidth } = this._minSize;\n\t\tconst { height: maxHeight, width: maxWidth } = this._maxSize;\n\n\t\theight = Math.max(minHeight, Math.min(maxHeight, height));\n\t\twidth = Math.max(minWidth, Math.min(maxWidth, width));\n\n\t\tconst newSize = new Dimension(width, height);\n\t\tif (!Dimension.equals(newSize, this._size)) {\n\t\t\tthis.domNode.style.height = height + 'px';\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis._size = newSize;\n\t\t\tthis._northSash.layout();\n\t\t\tthis._eastSash.layout();\n\t\t\tthis._southSash.layout();\n\t\t\tthis._westSash.layout();\n\t\t}\n\t}\n\n\tclearSashHoverState(): void {\n\t\tthis._eastSash.clearSashHoverState();\n\t\tthis._westSash.clearSashHoverState();\n\t\tthis._northSash.clearSashHoverState();\n\t\tthis._southSash.clearSashHoverState();\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tset maxSize(value: Dimension) {\n\t\tthis._maxSize = value;\n\t}\n\n\tget maxSize() {\n\t\treturn this._maxSize;\n\t}\n\n\tset minSize(value: Dimension) {\n\t\tthis._minSize = value;\n\t}\n\n\tget minSize() {\n\t\treturn this._minSize;\n\t}\n\n\tset preferredSize(value: Dimension | undefined) {\n\t\tthis._preferredSize = value;\n\t}\n\n\tget preferredSize() {\n\t\treturn this._preferredSize;\n\t}\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 { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport { ISelectedSuggestion, SuggestWidget } from './suggestWidget';\n\nexport class CommitCharacterController {\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate _active?: {\n\t\treadonly acceptCharacters: CharacterSet;\n\t\treadonly item: ISelectedSuggestion;\n\t};\n\n\tconstructor(editor: ICodeEditor, widget: SuggestWidget, accept: (selected: ISelectedSuggestion) => any) {\n\n\t\tthis._disposables.add(widget.onDidShow(() => this._onItem(widget.getFocusedItem())));\n\t\tthis._disposables.add(widget.onDidFocus(this._onItem, this));\n\t\tthis._disposables.add(widget.onDidHide(this.reset, this));\n\n\t\tthis._disposables.add(editor.onWillType(text => {\n\t\t\tif (this._active && !widget.isFrozen()) {\n\t\t\t\tconst ch = text.charCodeAt(text.length - 1);\n\t\t\t\tif (this._active.acceptCharacters.has(ch) && editor.getOption(EditorOption.acceptSuggestionOnCommitCharacter)) {\n\t\t\t\t\taccept(this._active.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onItem(selected: ISelectedSuggestion | undefined): void {\n\t\tif (!selected || !isNonEmptyArray(selected.item.completion.commitCharacters)) {\n\t\t\t// no item or no commit characters\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._active && this._active.item.item === selected.item) {\n\t\t\t// still the same item\n\t\t\treturn;\n\t\t}\n\n\t\t// keep item and its commit characters\n\t\tconst acceptCharacters = new CharacterSet();\n\t\tfor (const ch of selected.item.completion.commitCharacters) {\n\t\t\tif (ch.length > 0) {\n\t\t\t\tacceptCharacters.add(ch.charCodeAt(0));\n\t\t\t}\n\t\t}\n\t\tthis._active = { acceptCharacters, item: selected };\n\t}\n\n\treset(): void {\n\t\tthis._active = undefined;\n\t}\n\n\tdispose() {\n\t\tthis._disposables.dispose();\n\t}\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 { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { SuggestModel } from 'vs/editor/contrib/suggest/browser/suggestModel';\n\nexport class OvertypingCapturer implements IDisposable {\n\n\tprivate static readonly _maxSelectionLength = 51200;\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate _lastOvertyped: { value: string; multiline: boolean }[] = [];\n\tprivate _empty: boolean = true;\n\n\tconstructor(editor: ICodeEditor, suggestModel: SuggestModel) {\n\n\t\tthis._disposables.add(editor.onWillType(() => {\n\t\t\tif (!this._empty) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selections = editor.getSelections();\n\t\t\tconst selectionsLength = selections.length;\n\n\t\t\t// Check if it will overtype any selections\n\t\t\tlet willOvertype = false;\n\t\t\tfor (let i = 0; i < selectionsLength; i++) {\n\t\t\t\tif (!selections[i].isEmpty()) {\n\t\t\t\t\twillOvertype = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!willOvertype) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastOvertyped = [];\n\t\t\tconst model = editor.getModel();\n\t\t\tfor (let i = 0; i < selectionsLength; i++) {\n\t\t\t\tconst selection = selections[i];\n\t\t\t\t// Check for overtyping capturer restrictions\n\t\t\t\tif (model.getValueLengthInRange(selection) > OvertypingCapturer._maxSelectionLength) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._lastOvertyped[i] = { value: model.getValueInRange(selection), multiline: selection.startLineNumber !== selection.endLineNumber };\n\t\t\t}\n\t\t\tthis._empty = false;\n\t\t}));\n\n\t\tthis._disposables.add(suggestModel.onDidCancel(e => {\n\t\t\tif (!this._empty && !e.retrigger) {\n\t\t\t\tthis._empty = true;\n\t\t\t}\n\t\t}));\n\t}\n\n\tgetLastOvertypedInfo(idx: number): { value: string; multiline: boolean } | undefined {\n\t\tif (!this._empty && idx >= 0 && idx < this._lastOvertyped.length) {\n\t\t\treturn this._lastOvertyped[idx];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tdispose() {\n\t\tthis._disposables.dispose();\n\t}\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 { binarySearch, isFalsyOrEmpty } from 'vs/base/common/arrays';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CompletionItem, CompletionItemKind } from 'vs/editor/common/languages';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/bracketSelections';\n\nexport abstract class WordDistance {\n\n\tstatic readonly None = new class extends WordDistance {\n\t\tdistance() { return 0; }\n\t};\n\n\tstatic async create(service: IEditorWorkerService, editor: ICodeEditor): Promise<WordDistance> {\n\n\t\tif (!editor.getOption(EditorOption.suggest).localityBonus) {\n\t\t\treturn WordDistance.None;\n\t\t}\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn WordDistance.None;\n\t\t}\n\n\t\tconst model = editor.getModel();\n\t\tconst position = editor.getPosition();\n\n\t\tif (!service.canComputeWordRanges(model.uri)) {\n\t\t\treturn WordDistance.None;\n\t\t}\n\n\t\tconst [ranges] = await new BracketSelectionRangeProvider().provideSelectionRanges(model, [position]);\n\t\tif (ranges.length === 0) {\n\t\t\treturn WordDistance.None;\n\t\t}\n\n\t\tconst wordRanges = await service.computeWordRanges(model.uri, ranges[0].range);\n\t\tif (!wordRanges) {\n\t\t\treturn WordDistance.None;\n\t\t}\n\n\t\t// remove current word\n\t\tconst wordUntilPos = model.getWordUntilPosition(position);\n\t\tdelete wordRanges[wordUntilPos.word];\n\n\t\treturn new class extends WordDistance {\n\t\t\tdistance(anchor: IPosition, item: CompletionItem) {\n\t\t\t\tif (!position.equals(editor.getPosition())) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (item.kind === CompletionItemKind.Keyword) {\n\t\t\t\t\treturn 2 << 20;\n\t\t\t\t}\n\t\t\t\tlet word = typeof item.label === 'string' ? item.label : item.label.label;\n\t\t\t\tlet wordLines = wordRanges[word];\n\t\t\t\tif (isFalsyOrEmpty(wordLines)) {\n\t\t\t\t\treturn 2 << 20;\n\t\t\t\t}\n\t\t\t\tlet idx = binarySearch(wordLines, Range.fromPositions(anchor), Range.compareRangesUsingStarts);\n\t\t\t\tlet bestWordRange = idx >= 0 ? wordLines[idx] : wordLines[Math.max(0, ~idx - 1)];\n\t\t\t\tlet blockDistance = ranges.length;\n\t\t\t\tfor (const range of ranges) {\n\t\t\t\t\tif (!Range.containsRange(range.range, bestWordRange)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tblockDistance -= 1;\n\t\t\t\t}\n\t\t\t\treturn blockDistance;\n\t\t\t}\n\t\t};\n\t}\n\n\tabstract distance(anchor: IPosition, suggestion: CompletionItem): 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\n/*\n * This module exports common types and functionality shared between\n * the Monarch compiler that compiles JSON to ILexer, and the Monarch\n * Tokenizer (that highlights at runtime)\n */\n\n/*\n * Type definitions to be used internally to Monarch.\n * Inside monarch we use fully typed definitions and compiled versions of the more abstract JSON descriptions.\n */\n\nexport const enum MonarchBracket {\n\tNone = 0,\n\tOpen = 1,\n\tClose = -1\n}\n\nexport interface ILexerMin {\n\tlanguageId: string;\n\tincludeLF: boolean;\n\tnoThrow: boolean;\n\tignoreCase: boolean;\n\tunicode: boolean;\n\tusesEmbedded: boolean;\n\tdefaultToken: string;\n\tstateNames: { [stateName: string]: any };\n\t[attr: string]: any;\n}\n\nexport interface ILexer extends ILexerMin {\n\tmaxStack: number;\n\tstart: string | null;\n\tignoreCase: boolean;\n\tunicode: boolean;\n\ttokenPostfix: string;\n\n\ttokenizer: { [stateName: string]: IRule[] };\n\tbrackets: IBracket[];\n}\n\nexport interface IBracket {\n\ttoken: string;\n\topen: string;\n\tclose: string;\n}\n\nexport type FuzzyAction = IAction | string;\n\nexport function isFuzzyActionArr(what: FuzzyAction | FuzzyAction[]): what is FuzzyAction[] {\n\treturn (Array.isArray(what));\n}\n\nexport function isFuzzyAction(what: FuzzyAction | FuzzyAction[]): what is FuzzyAction {\n\treturn !isFuzzyActionArr(what);\n}\n\nexport function isString(what: FuzzyAction): what is string {\n\treturn (typeof what === 'string');\n}\n\nexport function isIAction(what: FuzzyAction): what is IAction {\n\treturn !isString(what);\n}\n\nexport interface IRule {\n\tregex: RegExp;\n\taction: FuzzyAction;\n\tmatchOnlyAtLineStart: boolean;\n\tname: string;\n}\n\nexport interface IAction {\n\t// an action is either a group of actions\n\tgroup?: FuzzyAction[];\n\n\t// or a function that returns a fresh action\n\ttest?: (id: string, matches: string[], state: string, eos: boolean) => FuzzyAction;\n\n\t// or it is a declarative action with a token value and various other attributes\n\ttoken?: string;\n\ttokenSubst?: boolean;\n\tnext?: string;\n\tnextEmbedded?: string;\n\tbracket?: MonarchBracket;\n\tlog?: string;\n\tswitchTo?: string;\n\tgoBack?: number;\n\ttransform?: (states: string[]) => string[];\n}\n\nexport interface IBranch {\n\tname: string;\n\tvalue: FuzzyAction;\n\ttest?: (id: string, matches: string[], state: string, eos: boolean) => boolean;\n}\n\n// Small helper functions\n\n/**\n * Is a string null, undefined, or empty?\n */\nexport function empty(s: string): boolean {\n\treturn (s ? false : true);\n}\n\n/**\n * Puts a string to lower case if 'ignoreCase' is set.\n */\nexport function fixCase(lexer: ILexerMin, str: string): string {\n\treturn (lexer.ignoreCase && str ? str.toLowerCase() : str);\n}\n\n/**\n * Ensures there are no bad characters in a CSS token class.\n */\nexport function sanitize(s: string) {\n\treturn s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}\n\n// Logging\n\n/**\n * Logs a message.\n */\nexport function log(lexer: ILexerMin, msg: string) {\n\tconsole.log(`${lexer.languageId}: ${msg}`);\n}\n\n// Throwing errors\n\nexport function createError(lexer: ILexerMin, msg: string): Error {\n\treturn new Error(`${lexer.languageId}: ${msg}`);\n}\n\n// Helper functions for rule finding and substitution\n\n/**\n * substituteMatches is used on lexer strings and can substitutes predefined patterns:\n * \t\t$$ => $\n * \t\t$# => id\n * \t\t$n => matched entry n\n * \t\t@attr => contents of lexer[attr]\n *\n * See documentation for more info\n */\nexport function substituteMatches(lexer: ILexerMin, str: string, id: string, matches: string[], state: string): string {\n\tconst re = /\\$((\\$)|(#)|(\\d\\d?)|[sS](\\d\\d?)|@(\\w+))/g;\n\tlet stateMatches: string[] | null = null;\n\treturn str.replace(re, function (full, sub?, dollar?, hash?, n?, s?, attr?, ofs?, total?) {\n\t\tif (!empty(dollar)) {\n\t\t\treturn '$'; // $$\n\t\t}\n\t\tif (!empty(hash)) {\n\t\t\treturn fixCase(lexer, id); // default $#\n\t\t}\n\t\tif (!empty(n) && n < matches.length) {\n\t\t\treturn fixCase(lexer, matches[n]); // $n\n\t\t}\n\t\tif (!empty(attr) && lexer && typeof (lexer[attr]) === 'string') {\n\t\t\treturn lexer[attr]; //@attribute\n\t\t}\n\t\tif (stateMatches === null) { // split state on demand\n\t\t\tstateMatches = state.split('.');\n\t\t\tstateMatches.unshift(state);\n\t\t}\n\t\tif (!empty(s) && s < stateMatches.length) {\n\t\t\treturn fixCase(lexer, stateMatches[s]); //$Sn\n\t\t}\n\t\treturn '';\n\t});\n}\n\n/**\n * Find the tokenizer rules for a specific state (i.e. next action)\n */\nexport function findRules(lexer: ILexer, inState: string): IRule[] | null {\n\tlet state: string | null = inState;\n\twhile (state && state.length > 0) {\n\t\tconst rules = lexer.tokenizer[state];\n\t\tif (rules) {\n\t\t\treturn rules;\n\t\t}\n\n\t\tconst idx = state.lastIndexOf('.');\n\t\tif (idx < 0) {\n\t\t\tstate = null; // no further parent\n\t\t} else {\n\t\t\tstate = state.substr(0, idx);\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Is a certain state defined? In contrast to 'findRules' this works on a ILexerMin.\n * This is used during compilation where we may know the defined states\n * but not yet whether the corresponding rules are correct.\n */\nexport function stateExists(lexer: ILexerMin, inState: string): boolean {\n\tlet state: string | null = inState;\n\twhile (state && state.length > 0) {\n\t\tconst exist = lexer.stateNames[state];\n\t\tif (exist) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst idx = state.lastIndexOf('.');\n\t\tif (idx < 0) {\n\t\t\tstate = null; // no further parent\n\t\t} else {\n\t\t\tstate = state.substr(0, idx);\n\t\t}\n\t}\n\treturn false;\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\n/*\n * This module only exports 'compile' which compiles a JSON language definition\n * into a typed and checked ILexer definition.\n */\n\nimport * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon';\nimport { IMonarchLanguage, IMonarchLanguageBracket } from 'vs/editor/standalone/common/monarch/monarchTypes';\n\n/*\n * Type helpers\n *\n * Note: this is just for sanity checks on the JSON description which is\n * helpful for the programmer. No checks are done anymore once the lexer is\n * already 'compiled and checked'.\n *\n */\n\nfunction isArrayOf(elemType: (x: any) => boolean, obj: any): boolean {\n\tif (!obj) {\n\t\treturn false;\n\t}\n\tif (!(Array.isArray(obj))) {\n\t\treturn false;\n\t}\n\tfor (const el of obj) {\n\t\tif (!(elemType(el))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction bool(prop: any, defValue: boolean): boolean {\n\tif (typeof prop === 'boolean') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\nfunction string(prop: any, defValue: string): string {\n\tif (typeof (prop) === 'string') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\n\nfunction arrayToHash(array: string[]): { [name: string]: true } {\n\tconst result: any = {};\n\tfor (const e of array) {\n\t\tresult[e] = true;\n\t}\n\treturn result;\n}\n\n\nfunction createKeywordMatcher(arr: string[], caseInsensitive: boolean = false): (str: string) => boolean {\n\tif (caseInsensitive) {\n\t\tarr = arr.map(function (x) { return x.toLowerCase(); });\n\t}\n\tconst hash = arrayToHash(arr);\n\tif (caseInsensitive) {\n\t\treturn function (word) {\n\t\t\treturn hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase());\n\t\t};\n\t} else {\n\t\treturn function (word) {\n\t\t\treturn hash[word] !== undefined && hash.hasOwnProperty(word);\n\t\t};\n\t}\n}\n\n\n// Lexer helpers\n\n/**\n * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n * @\\w+ replacement can be avoided by escaping `@` signs with another `@` sign.\n * @example /@attr/ will be replaced with the value of lexer[attr]\n * @example /@@text/ will not be replaced and will become /@text/.\n */\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string): RegExp {\n\t// @@ must be interpreted as a literal @, so we replace all occurences of @@ with a placeholder character\n\tstr = str.replace(/@@/g, `\\x01`);\n\n\tlet n = 0;\n\tlet hadExpansion: boolean;\n\tdo {\n\t\thadExpansion = false;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\n\t\t\thadExpansion = true;\n\t\t\tlet sub = '';\n\t\t\tif (typeof (lexer[attr]) === 'string') {\n\t\t\t\tsub = lexer[attr];\n\t\t\t} else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n\t\t\t\tsub = lexer[attr].source;\n\t\t\t} else {\n\t\t\t\tif (lexer[attr] === undefined) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (monarchCommon.empty(sub) ? '' : '(?:' + sub + ')');\n\t\t});\n\t\tn++;\n\t} while (hadExpansion && n < 5);\n\n\t// handle escaped @@\n\tstr = str.replace(/\\x01/g, '@');\n\n\tconst flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : '');\n\treturn new RegExp(str, flags);\n}\n\n/**\n * Compiles guard functions for case matches.\n * This compiles 'cases' attributes into efficient match functions.\n *\n */\nfunction selectScrutinee(id: string, matches: string[], state: string, num: number): string | null {\n\tif (num < 0) {\n\t\treturn id;\n\t}\n\tif (num < matches.length) {\n\t\treturn matches[num];\n\t}\n\tif (num >= 100) {\n\t\tnum = num - 100;\n\t\tconst parts = state.split('.');\n\t\tparts.unshift(state);\n\t\tif (num < parts.length) {\n\t\t\treturn parts[num];\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch {\n\t// get the scrutinee and pattern\n\tlet scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn\n\tlet oppat = tkey;\n\tlet matches = tkey.match(/^\\$(([sS]?)(\\d\\d?)|#)(.*)$/);\n\tif (matches) {\n\t\tif (matches[3]) { // if digits\n\t\t\tscrut = parseInt(matches[3]);\n\t\t\tif (matches[2]) {\n\t\t\t\tscrut = scrut + 100; // if [sS] present\n\t\t\t}\n\t\t}\n\t\toppat = matches[4];\n\t}\n\t// get operator\n\tlet op = '~';\n\tlet pat = oppat;\n\tif (!oppat || oppat.length === 0) {\n\t\top = '!=';\n\t\tpat = '';\n\t}\n\telse if (/^\\w*$/.test(pat)) { // just a word\n\t\top = '==';\n\t}\n\telse {\n\t\tmatches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/);\n\t\tif (matches) {\n\t\t\top = matches[1];\n\t\t\tpat = matches[2];\n\t\t}\n\t}\n\n\t// set the tester function\n\tlet tester: (s: string, id: string, matches: string[], state: string, eos: boolean) => boolean;\n\n\t// special case a regexp that matches just words\n\tif ((op === '~' || op === '!~') && /^(\\w|\\|)*$/.test(pat)) {\n\t\tconst inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '@' || op === '!@') {\n\t\tconst words = lexer[pat];\n\t\tif (!words) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' is not defined, in rule: ' + ruleName);\n\t\t}\n\t\tif (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' must be an array of strings, in rule: ' + ruleName);\n\t\t}\n\t\tconst inWords = createKeywordMatcher(words, lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '~' || op === '!~') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\t// precompile regular expression\n\t\t\tconst re = compileRegExp(lexer, '^' + pat + '$');\n\t\t\ttester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); };\n\t\t}\n\t\telse {\n\t\t\ttester = function (s, id, matches, state) {\n\t\t\t\tconst re = compileRegExp(lexer, '^' + monarchCommon.substituteMatches(lexer, pat, id, matches, state) + '$');\n\t\t\t\treturn re.test(s);\n\t\t\t};\n\t\t}\n\t}\n\telse { // if (op==='==' || op==='!=') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s) { return (op === '==' ? s === patx : s !== patx); };\n\t\t}\n\t\telse {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tconst patexp = monarchCommon.substituteMatches(lexer, patx, id, matches, state);\n\t\t\t\treturn (op === '==' ? s === patexp : s !== patexp);\n\t\t\t};\n\t\t}\n\t}\n\n\t// return the branch object\n\tif (scrut === -1) {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\treturn tester(id, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\tconst scrutinee = selectScrutinee(id, matches, state, scrut);\n\t\t\t\treturn tester(!scrutinee ? '' : scrutinee, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Compiles an action: i.e. optimize regular expressions and case matches\n * and do many sanity checks.\n *\n * This is called only during compilation but if the lexer definition\n * contains user functions as actions (which is usually not allowed), then this\n * may be called during lexing. It is important therefore to compile common cases efficiently\n */\nfunction compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction {\n\tif (!action) {\n\t\treturn { token: '' };\n\t}\n\telse if (typeof (action) === 'string') {\n\t\treturn action; // { token: action };\n\t}\n\telse if (action.token || action.token === '') {\n\t\tif (typeof (action.token) !== 'string') {\n\t\t\tthrow monarchCommon.createError(lexer, 'a \\'token\\' attribute must be of type string, in rule: ' + ruleName);\n\t\t}\n\t\telse {\n\t\t\t// only copy specific typed fields (only happens once during compile Lexer)\n\t\t\tconst newAction: monarchCommon.IAction = { token: action.token };\n\t\t\tif (action.token.indexOf('$') >= 0) {\n\t\t\t\tnewAction.tokenSubst = true;\n\t\t\t}\n\t\t\tif (typeof (action.bracket) === 'string') {\n\t\t\t\tif (action.bracket === '@open') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Open;\n\t\t\t\t} else if (action.bracket === '@close') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Close;\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a \\'bracket\\' attribute must be either \\'@open\\' or \\'@close\\', in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.next) {\n\t\t\t\tif (typeof (action.next) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state must be a string value in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet next: string = action.next;\n\t\t\t\t\tif (!/^(@pop|@push|@popall)$/.test(next)) {\n\t\t\t\t\t\tif (next[0] === '@') {\n\t\t\t\t\t\t\tnext = next.substr(1); // peel off starting @ sign\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists\n\t\t\t\t\t\t\tif (!monarchCommon.stateExists(lexer, monarchCommon.substituteMatches(lexer, next, '', [], ''))) {\n\t\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state \\'' + action.next + '\\' is not defined in rule: ' + ruleName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewAction.next = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof (action.goBack) === 'number') {\n\t\t\t\tnewAction.goBack = action.goBack;\n\t\t\t}\n\t\t\tif (typeof (action.switchTo) === 'string') {\n\t\t\t\tnewAction.switchTo = action.switchTo;\n\t\t\t}\n\t\t\tif (typeof (action.log) === 'string') {\n\t\t\t\tnewAction.log = action.log;\n\t\t\t}\n\t\t\tif (typeof (action.nextEmbedded) === 'string') {\n\t\t\t\tnewAction.nextEmbedded = action.nextEmbedded;\n\t\t\t\tlexer.usesEmbedded = true;\n\t\t\t}\n\t\t\treturn newAction;\n\t\t}\n\t}\n\telse if (Array.isArray(action)) {\n\t\tconst results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let i = 0, len = action.length; i < len; i++) {\n\t\t\tresults[i] = compileAction(lexer, ruleName, action[i]);\n\t\t}\n\t\treturn { group: results };\n\t}\n\telse if (action.cases) {\n\t\t// build an array of test cases\n\t\tconst cases: monarchCommon.IBranch[] = [];\n\n\t\t// for each case, push a test function and result value\n\t\tfor (let tkey in action.cases) {\n\t\t\tif (action.cases.hasOwnProperty(tkey)) {\n\t\t\t\tconst val = compileAction(lexer, ruleName, action.cases[tkey]);\n\n\t\t\t\t// what kind of case\n\t\t\t\tif (tkey === '@default' || tkey === '@' || tkey === '') {\n\t\t\t\t\tcases.push({ test: undefined, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse if (tkey === '@eos') {\n\t\t\t\t\tcases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a matching function\n\t\tconst def = lexer.defaultToken;\n\t\treturn {\n\t\t\ttest: function (id, matches, state, eos) {\n\t\t\t\tfor (const _case of cases) {\n\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn def;\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\tthrow monarchCommon.createError(lexer, 'an action must be a string, an object with a \\'token\\' or \\'cases\\' attribute, or an array of actions; in rule: ' + ruleName);\n\t}\n}\n\n/**\n * Helper class for creating matching rules\n */\nclass Rule implements monarchCommon.IRule {\n\tpublic regex: RegExp = new RegExp('');\n\tpublic action: monarchCommon.FuzzyAction = { token: '' };\n\tpublic matchOnlyAtLineStart: boolean = false;\n\tpublic name: string = '';\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\tpublic setRegex(lexer: monarchCommon.ILexerMin, re: string | RegExp): void {\n\t\tlet sregex: string;\n\t\tif (typeof (re) === 'string') {\n\t\t\tsregex = re;\n\t\t}\n\t\telse if (re instanceof RegExp) {\n\t\t\tsregex = (<RegExp>re).source;\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'rules must start with a match string or regular expression: ' + this.name);\n\t\t}\n\n\t\tthis.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^');\n\t\tthis.name = this.name + ': ' + sregex;\n\t\tthis.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')');\n\t}\n\n\tpublic setAction(lexer: monarchCommon.ILexerMin, act: monarchCommon.IAction) {\n\t\tthis.action = compileAction(lexer, this.name, act);\n\t}\n}\n\n/**\n * Compiles a json description function into json where all regular expressions,\n * case matches etc, are compiled and all include rules are expanded.\n * We also compile the bracket definitions, supply defaults, and do many sanity checks.\n * If the 'jsonStrict' parameter is 'false', we allow at certain locations\n * regular expression objects and functions that get called during lexing.\n * (Currently we have no samples that need this so perhaps we should always have\n * jsonStrict to true).\n */\nexport function compile(languageId: string, json: IMonarchLanguage): monarchCommon.ILexer {\n\tif (!json || typeof (json) !== 'object') {\n\t\tthrow new Error('Monarch: expecting a language definition object');\n\t}\n\n\t// Create our lexer\n\tconst lexer: monarchCommon.ILexer = <monarchCommon.ILexer>{};\n\tlexer.languageId = languageId;\n\tlexer.includeLF = bool(json.includeLF, false);\n\tlexer.noThrow = false; // raise exceptions during compilation\n\tlexer.maxStack = 100;\n\n\t// Set standard fields: be defensive about types\n\tlexer.start = (typeof json.start === 'string' ? json.start : null);\n\tlexer.ignoreCase = bool(json.ignoreCase, false);\n\tlexer.unicode = bool(json.unicode, false);\n\n\tlexer.tokenPostfix = string(json.tokenPostfix, '.' + lexer.languageId);\n\tlexer.defaultToken = string(json.defaultToken, 'source');\n\n\tlexer.usesEmbedded = false; // becomes true if we find a nextEmbedded action\n\n\t// For calling compileAction later on\n\tconst lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.includeLF = lexer.includeLF;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\n\tlexerMin.unicode = lexer.unicode;\n\tlexerMin.noThrow = lexer.noThrow;\n\tlexerMin.usesEmbedded = lexer.usesEmbedded;\n\tlexerMin.stateNames = json.tokenizer;\n\tlexerMin.defaultToken = lexer.defaultToken;\n\n\n\t// Compile an array of rules into newrules where RegExp objects are created.\n\tfunction addRules(state: string, newrules: monarchCommon.IRule[], rules: any[]) {\n\t\tfor (const rule of rules) {\n\n\t\t\tlet include = rule.include;\n\t\t\tif (include) {\n\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t}\n\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t}\n\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t}\n\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst newrule = new Rule(state);\n\n\t\t\t\t// Set up new rule attributes\n\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!rule.regex) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t}\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t}\n\n\t\t\t\tnewrules.push(newrule);\n\t\t\t}\n\t\t}\n\t}\n\n\t// compile the tokenizer rules\n\tif (!json.tokenizer || typeof (json.tokenizer) !== 'object') {\n\t\tthrow monarchCommon.createError(lexer, 'a language definition must define the \\'tokenizer\\' attribute as an object');\n\t}\n\n\tlexer.tokenizer = <any>[];\n\tfor (let key in json.tokenizer) {\n\t\tif (json.tokenizer.hasOwnProperty(key)) {\n\t\t\tif (!lexer.start) {\n\t\t\t\tlexer.start = key;\n\t\t\t}\n\n\t\t\tconst rules = json.tokenizer[key];\n\t\t\tlexer.tokenizer[key] = new Array();\n\t\t\taddRules('tokenizer.' + key, lexer.tokenizer[key], rules);\n\t\t}\n\t}\n\tlexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction\n\n\t// Set simple brackets\n\tif (json.brackets) {\n\t\tif (!(Array.isArray(<any>json.brackets))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the \\'brackets\\' attribute must be defined as an array');\n\t\t}\n\t}\n\telse {\n\t\tjson.brackets = [\n\t\t\t{ open: '{', close: '}', token: 'delimiter.curly' },\n\t\t\t{ open: '[', close: ']', token: 'delimiter.square' },\n\t\t\t{ open: '(', close: ')', token: 'delimiter.parenthesis' },\n\t\t\t{ open: '<', close: '>', token: 'delimiter.angle' }];\n\t}\n\tconst brackets: IMonarchLanguageBracket[] = [];\n\tfor (let el of json.brackets) {\n\t\tlet desc: any = el;\n\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t}\n\t\tif (desc.open === desc.close) {\n\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t}\n\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\tbrackets.push({\n\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t}\n\t}\n\tlexer.brackets = brackets;\n\n\t// Disable throw so the syntax highlighter goes, no matter what\n\tlexer.noThrow = true;\n\treturn lexer;\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\n/**\n * Create a syntax highighter with a fully declarative JSON style lexer description\n * using regular expressions.\n */\n\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as languages from 'vs/editor/common/languages';\nimport { NullState } from 'vs/editor/common/languages/nullTokenize';\nimport { TokenTheme } from 'vs/editor/common/languages/supports/tokenization';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\n\nconst CACHE_STACK_DEPTH = 5;\n\n/**\n * Reuse the same stack elements up to a certain depth.\n */\nclass MonarchStackElementFactory {\n\n\tprivate static readonly _INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH);\n\tpublic static create(parent: MonarchStackElement | null, state: string): MonarchStackElement {\n\t\treturn this._INSTANCE.create(parent, state);\n\t}\n\n\tprivate readonly _maxCacheDepth: number;\n\tprivate readonly _entries: { [stackElementId: string]: MonarchStackElement };\n\n\tconstructor(maxCacheDepth: number) {\n\t\tthis._maxCacheDepth = maxCacheDepth;\n\t\tthis._entries = Object.create(null);\n\t}\n\n\tpublic create(parent: MonarchStackElement | null, state: string): MonarchStackElement {\n\t\tif (parent !== null && parent.depth >= this._maxCacheDepth) {\n\t\t\t// no caching above a certain depth\n\t\t\treturn new MonarchStackElement(parent, state);\n\t\t}\n\t\tlet stackElementId = MonarchStackElement.getStackElementId(parent);\n\t\tif (stackElementId.length > 0) {\n\t\t\tstackElementId += '|';\n\t\t}\n\t\tstackElementId += state;\n\n\t\tlet result = this._entries[stackElementId];\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t\tresult = new MonarchStackElement(parent, state);\n\t\tthis._entries[stackElementId] = result;\n\t\treturn result;\n\t}\n}\n\nclass MonarchStackElement {\n\n\tpublic readonly parent: MonarchStackElement | null;\n\tpublic readonly state: string;\n\tpublic readonly depth: number;\n\n\tconstructor(parent: MonarchStackElement | null, state: string) {\n\t\tthis.parent = parent;\n\t\tthis.state = state;\n\t\tthis.depth = (this.parent ? this.parent.depth : 0) + 1;\n\t}\n\n\tpublic static getStackElementId(element: MonarchStackElement | null): string {\n\t\tlet result = '';\n\t\twhile (element !== null) {\n\t\t\tif (result.length > 0) {\n\t\t\t\tresult += '|';\n\t\t\t}\n\t\t\tresult += element.state;\n\t\t\telement = element.parent;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _equals(a: MonarchStackElement | null, b: MonarchStackElement | null): boolean {\n\t\twhile (a !== null && b !== null) {\n\t\t\tif (a === b) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a.state !== b.state) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ta = a.parent;\n\t\t\tb = b.parent;\n\t\t}\n\t\tif (a === null && b === null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic equals(other: MonarchStackElement): boolean {\n\t\treturn MonarchStackElement._equals(this, other);\n\t}\n\n\tpublic push(state: string): MonarchStackElement {\n\t\treturn MonarchStackElementFactory.create(this, state);\n\t}\n\n\tpublic pop(): MonarchStackElement | null {\n\t\treturn this.parent;\n\t}\n\n\tpublic popall(): MonarchStackElement {\n\t\tlet result: MonarchStackElement = this;\n\t\twhile (result.parent) {\n\t\t\tresult = result.parent;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic switchTo(state: string): MonarchStackElement {\n\t\treturn MonarchStackElementFactory.create(this.parent, state);\n\t}\n}\n\nclass EmbeddedLanguageData {\n\tpublic readonly languageId: string;\n\tpublic readonly state: languages.IState;\n\n\tconstructor(languageId: string, state: languages.IState) {\n\t\tthis.languageId = languageId;\n\t\tthis.state = state;\n\t}\n\n\tpublic equals(other: EmbeddedLanguageData): boolean {\n\t\treturn (\n\t\t\tthis.languageId === other.languageId\n\t\t\t&& this.state.equals(other.state)\n\t\t);\n\t}\n\n\tpublic clone(): EmbeddedLanguageData {\n\t\tconst stateClone = this.state.clone();\n\t\t// save an object\n\t\tif (stateClone === this.state) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new EmbeddedLanguageData(this.languageId, this.state);\n\t}\n}\n\n/**\n * Reuse the same line states up to a certain depth.\n */\nclass MonarchLineStateFactory {\n\n\tprivate static readonly _INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH);\n\tpublic static create(stack: MonarchStackElement, embeddedLanguageData: EmbeddedLanguageData | null): MonarchLineState {\n\t\treturn this._INSTANCE.create(stack, embeddedLanguageData);\n\t}\n\n\tprivate readonly _maxCacheDepth: number;\n\tprivate readonly _entries: { [stackElementId: string]: MonarchLineState };\n\n\tconstructor(maxCacheDepth: number) {\n\t\tthis._maxCacheDepth = maxCacheDepth;\n\t\tthis._entries = Object.create(null);\n\t}\n\n\tpublic create(stack: MonarchStackElement, embeddedLanguageData: EmbeddedLanguageData | null): MonarchLineState {\n\t\tif (embeddedLanguageData !== null) {\n\t\t\t// no caching when embedding\n\t\t\treturn new MonarchLineState(stack, embeddedLanguageData);\n\t\t}\n\t\tif (stack !== null && stack.depth >= this._maxCacheDepth) {\n\t\t\t// no caching above a certain depth\n\t\t\treturn new MonarchLineState(stack, embeddedLanguageData);\n\t\t}\n\t\tconst stackElementId = MonarchStackElement.getStackElementId(stack);\n\n\t\tlet result = this._entries[stackElementId];\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t\tresult = new MonarchLineState(stack, null);\n\t\tthis._entries[stackElementId] = result;\n\t\treturn result;\n\t}\n}\n\nclass MonarchLineState implements languages.IState {\n\n\tpublic readonly stack: MonarchStackElement;\n\tpublic readonly embeddedLanguageData: EmbeddedLanguageData | null;\n\n\tconstructor(\n\t\tstack: MonarchStackElement,\n\t\tembeddedLanguageData: EmbeddedLanguageData | null\n\t) {\n\t\tthis.stack = stack;\n\t\tthis.embeddedLanguageData = embeddedLanguageData;\n\t}\n\n\tpublic clone(): languages.IState {\n\t\tconst embeddedlanguageDataClone = this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null;\n\t\t// save an object\n\t\tif (embeddedlanguageDataClone === this.embeddedLanguageData) {\n\t\t\treturn this;\n\t\t}\n\t\treturn MonarchLineStateFactory.create(this.stack, this.embeddedLanguageData);\n\t}\n\n\tpublic equals(other: languages.IState): boolean {\n\t\tif (!(other instanceof MonarchLineState)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this.stack.equals(other.stack)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.embeddedLanguageData === null && other.embeddedLanguageData === null) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.embeddedLanguageData === null || other.embeddedLanguageData === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.embeddedLanguageData.equals(other.embeddedLanguageData);\n\t}\n}\n\ninterface IMonarchTokensCollector {\n\tenterLanguage(languageId: string): void;\n\temit(startOffset: number, type: string): void;\n\tnestedLanguageTokenize(embeddedLanguageLine: string, hasEOL: boolean, embeddedLanguageData: EmbeddedLanguageData, offsetDelta: number): languages.IState;\n}\n\nclass MonarchClassicTokensCollector implements IMonarchTokensCollector {\n\n\tprivate _tokens: languages.Token[];\n\tprivate _languageId: string | null;\n\tprivate _lastTokenType: string | null;\n\tprivate _lastTokenLanguage: string | null;\n\n\tconstructor() {\n\t\tthis._tokens = [];\n\t\tthis._languageId = null;\n\t\tthis._lastTokenType = null;\n\t\tthis._lastTokenLanguage = null;\n\t}\n\n\tpublic enterLanguage(languageId: string): void {\n\t\tthis._languageId = languageId;\n\t}\n\n\tpublic emit(startOffset: number, type: string): void {\n\t\tif (this._lastTokenType === type && this._lastTokenLanguage === this._languageId) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lastTokenType = type;\n\t\tthis._lastTokenLanguage = this._languageId;\n\t\tthis._tokens.push(new languages.Token(startOffset, type, this._languageId!));\n\t}\n\n\tpublic nestedLanguageTokenize(embeddedLanguageLine: string, hasEOL: boolean, embeddedLanguageData: EmbeddedLanguageData, offsetDelta: number): languages.IState {\n\t\tconst nestedLanguageId = embeddedLanguageData.languageId;\n\t\tconst embeddedModeState = embeddedLanguageData.state;\n\n\t\tconst nestedLanguageTokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n\t\tif (!nestedLanguageTokenizationSupport) {\n\t\t\tthis.enterLanguage(nestedLanguageId);\n\t\t\tthis.emit(offsetDelta, '');\n\t\t\treturn embeddedModeState;\n\t\t}\n\n\t\tconst nestedResult = nestedLanguageTokenizationSupport.tokenize(embeddedLanguageLine, hasEOL, embeddedModeState);\n\t\tif (offsetDelta !== 0) {\n\t\t\tfor (const token of nestedResult.tokens) {\n\t\t\t\tthis._tokens.push(new languages.Token(token.offset + offsetDelta, token.type, token.language));\n\t\t\t}\n\t\t} else {\n\t\t\tthis._tokens = this._tokens.concat(nestedResult.tokens);\n\t\t}\n\t\tthis._lastTokenType = null;\n\t\tthis._lastTokenLanguage = null;\n\t\tthis._languageId = null;\n\t\treturn nestedResult.endState;\n\t}\n\n\tpublic finalize(endState: MonarchLineState): languages.TokenizationResult {\n\t\treturn new languages.TokenizationResult(this._tokens, endState);\n\t}\n}\n\nclass MonarchModernTokensCollector implements IMonarchTokensCollector {\n\n\tprivate readonly _languageService: ILanguageService;\n\tprivate readonly _theme: TokenTheme;\n\tprivate _prependTokens: Uint32Array | null;\n\tprivate _tokens: number[];\n\tprivate _currentLanguageId: languages.LanguageId;\n\tprivate _lastTokenMetadata: number;\n\n\tconstructor(languageService: ILanguageService, theme: TokenTheme) {\n\t\tthis._languageService = languageService;\n\t\tthis._theme = theme;\n\t\tthis._prependTokens = null;\n\t\tthis._tokens = [];\n\t\tthis._currentLanguageId = languages.LanguageId.Null;\n\t\tthis._lastTokenMetadata = 0;\n\t}\n\n\tpublic enterLanguage(languageId: string): void {\n\t\tthis._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId);\n\t}\n\n\tpublic emit(startOffset: number, type: string): void {\n\t\tconst metadata = this._theme.match(this._currentLanguageId, type);\n\t\tif (this._lastTokenMetadata === metadata) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lastTokenMetadata = metadata;\n\t\tthis._tokens.push(startOffset);\n\t\tthis._tokens.push(metadata);\n\t}\n\n\tprivate static _merge(a: Uint32Array | null, b: number[], c: Uint32Array | null): Uint32Array {\n\t\tconst aLen = (a !== null ? a.length : 0);\n\t\tconst bLen = b.length;\n\t\tconst cLen = (c !== null ? c.length : 0);\n\n\t\tif (aLen === 0 && bLen === 0 && cLen === 0) {\n\t\t\treturn new Uint32Array(0);\n\t\t}\n\t\tif (aLen === 0 && bLen === 0) {\n\t\t\treturn c!;\n\t\t}\n\t\tif (bLen === 0 && cLen === 0) {\n\t\t\treturn a!;\n\t\t}\n\n\t\tconst result = new Uint32Array(aLen + bLen + cLen);\n\t\tif (a !== null) {\n\t\t\tresult.set(a);\n\t\t}\n\t\tfor (let i = 0; i < bLen; i++) {\n\t\t\tresult[aLen + i] = b[i];\n\t\t}\n\t\tif (c !== null) {\n\t\t\tresult.set(c, aLen + bLen);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic nestedLanguageTokenize(embeddedLanguageLine: string, hasEOL: boolean, embeddedLanguageData: EmbeddedLanguageData, offsetDelta: number): languages.IState {\n\t\tconst nestedLanguageId = embeddedLanguageData.languageId;\n\t\tconst embeddedModeState = embeddedLanguageData.state;\n\n\t\tconst nestedLanguageTokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n\t\tif (!nestedLanguageTokenizationSupport) {\n\t\t\tthis.enterLanguage(nestedLanguageId);\n\t\t\tthis.emit(offsetDelta, '');\n\t\t\treturn embeddedModeState;\n\t\t}\n\n\t\tconst nestedResult = nestedLanguageTokenizationSupport.tokenizeEncoded(embeddedLanguageLine, hasEOL, embeddedModeState);\n\t\tif (offsetDelta !== 0) {\n\t\t\tfor (let i = 0, len = nestedResult.tokens.length; i < len; i += 2) {\n\t\t\t\tnestedResult.tokens[i] += offsetDelta;\n\t\t\t}\n\t\t}\n\n\t\tthis._prependTokens = MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, nestedResult.tokens);\n\t\tthis._tokens = [];\n\t\tthis._currentLanguageId = 0;\n\t\tthis._lastTokenMetadata = 0;\n\t\treturn nestedResult.endState;\n\t}\n\n\tpublic finalize(endState: MonarchLineState): languages.EncodedTokenizationResult {\n\t\treturn new languages.EncodedTokenizationResult(\n\t\t\tMonarchModernTokensCollector._merge(this._prependTokens, this._tokens, null),\n\t\t\tendState\n\t\t);\n\t}\n}\n\nexport type ILoadStatus = { loaded: true } | { loaded: false; promise: Promise<void> };\n\nexport class MonarchTokenizer implements languages.ITokenizationSupport {\n\n\tprivate readonly _languageService: ILanguageService;\n\tprivate readonly _standaloneThemeService: IStandaloneThemeService;\n\tprivate readonly _languageId: string;\n\tprivate readonly _lexer: monarchCommon.ILexer;\n\tprivate readonly _embeddedLanguages: { [languageId: string]: boolean };\n\tpublic embeddedLoaded: Promise<void>;\n\tprivate readonly _tokenizationRegistryListener: IDisposable;\n\n\tconstructor(languageService: ILanguageService, standaloneThemeService: IStandaloneThemeService, languageId: string, lexer: monarchCommon.ILexer) {\n\t\tthis._languageService = languageService;\n\t\tthis._standaloneThemeService = standaloneThemeService;\n\t\tthis._languageId = languageId;\n\t\tthis._lexer = lexer;\n\t\tthis._embeddedLanguages = Object.create(null);\n\t\tthis.embeddedLoaded = Promise.resolve(undefined);\n\n\t\t// Set up listening for embedded modes\n\t\tlet emitting = false;\n\t\tthis._tokenizationRegistryListener = languages.TokenizationRegistry.onDidChange((e) => {\n\t\t\tif (emitting) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet isOneOfMyEmbeddedModes = false;\n\t\t\tfor (let i = 0, len = e.changedLanguages.length; i < len; i++) {\n\t\t\t\tconst language = e.changedLanguages[i];\n\t\t\t\tif (this._embeddedLanguages[language]) {\n\t\t\t\t\tisOneOfMyEmbeddedModes = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isOneOfMyEmbeddedModes) {\n\t\t\t\temitting = true;\n\t\t\t\tlanguages.TokenizationRegistry.fire([this._languageId]);\n\t\t\t\temitting = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._tokenizationRegistryListener.dispose();\n\t}\n\n\tpublic getLoadStatus(): ILoadStatus {\n\t\tconst promises: Thenable<any>[] = [];\n\t\tfor (let nestedLanguageId in this._embeddedLanguages) {\n\t\t\tconst tokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n\t\t\tif (tokenizationSupport) {\n\t\t\t\t// The nested language is already loaded\n\t\t\t\tif (tokenizationSupport instanceof MonarchTokenizer) {\n\t\t\t\t\tconst nestedModeStatus = tokenizationSupport.getLoadStatus();\n\t\t\t\t\tif (nestedModeStatus.loaded === false) {\n\t\t\t\t\t\tpromises.push(nestedModeStatus.promise);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!languages.TokenizationRegistry.isResolved(nestedLanguageId)) {\n\t\t\t\t// The nested language is in the process of being loaded\n\t\t\t\tpromises.push(languages.TokenizationRegistry.getOrCreate(nestedLanguageId));\n\t\t\t}\n\t\t}\n\n\t\tif (promises.length === 0) {\n\t\t\treturn {\n\t\t\t\tloaded: true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tloaded: false,\n\t\t\tpromise: Promise.all(promises).then(_ => undefined)\n\t\t};\n\t}\n\n\tpublic getInitialState(): languages.IState {\n\t\tconst rootState = MonarchStackElementFactory.create(null, this._lexer.start!);\n\t\treturn MonarchLineStateFactory.create(rootState, null);\n\t}\n\n\tpublic tokenize(line: string, hasEOL: boolean, lineState: languages.IState): languages.TokenizationResult {\n\t\tconst tokensCollector = new MonarchClassicTokensCollector();\n\t\tconst endLineState = this._tokenize(line, hasEOL, <MonarchLineState>lineState, tokensCollector);\n\t\treturn tokensCollector.finalize(endLineState);\n\t}\n\n\tpublic tokenizeEncoded(line: string, hasEOL: boolean, lineState: languages.IState): languages.EncodedTokenizationResult {\n\t\tconst tokensCollector = new MonarchModernTokensCollector(this._languageService, this._standaloneThemeService.getColorTheme().tokenTheme);\n\t\tconst endLineState = this._tokenize(line, hasEOL, <MonarchLineState>lineState, tokensCollector);\n\t\treturn tokensCollector.finalize(endLineState);\n\t}\n\n\tprivate _tokenize(line: string, hasEOL: boolean, lineState: MonarchLineState, collector: IMonarchTokensCollector): MonarchLineState {\n\t\tif (lineState.embeddedLanguageData) {\n\t\t\treturn this._nestedTokenize(line, hasEOL, lineState, 0, collector);\n\t\t} else {\n\t\t\treturn this._myTokenize(line, hasEOL, lineState, 0, collector);\n\t\t}\n\t}\n\n\tprivate _findLeavingNestedLanguageOffset(line: string, state: MonarchLineState): number {\n\t\tlet rules: monarchCommon.IRule[] | null = this._lexer.tokenizer[state.stack.state];\n\t\tif (!rules) {\n\t\t\trules = monarchCommon.findRules(this._lexer, state.stack.state); // do parent matching\n\t\t\tif (!rules) {\n\t\t\t\tthrow monarchCommon.createError(this._lexer, 'tokenizer state is not defined: ' + state.stack.state);\n\t\t\t}\n\t\t}\n\n\t\tlet popOffset = -1;\n\t\tlet hasEmbeddedPopRule = false;\n\n\t\tfor (const rule of rules) {\n\t\t\tif (!monarchCommon.isIAction(rule.action) || rule.action.nextEmbedded !== '@pop') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thasEmbeddedPopRule = true;\n\n\t\t\tlet regex = rule.regex;\n\t\t\tconst regexSource = rule.regex.source;\n\t\t\tif (regexSource.substr(0, 4) === '^(?:' && regexSource.substr(regexSource.length - 1, 1) === ')') {\n\t\t\t\tconst flags = (regex.ignoreCase ? 'i' : '') + (regex.unicode ? 'u' : '');\n\t\t\t\tregex = new RegExp(regexSource.substr(4, regexSource.length - 5), flags);\n\t\t\t}\n\n\t\t\tconst result = line.search(regex);\n\t\t\tif (result === -1 || (result !== 0 && rule.matchOnlyAtLineStart)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (popOffset === -1 || result < popOffset) {\n\t\t\t\tpopOffset = result;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasEmbeddedPopRule) {\n\t\t\tthrow monarchCommon.createError(this._lexer, 'no rule containing nextEmbedded: \"@pop\" in tokenizer embedded state: ' + state.stack.state);\n\t\t}\n\n\t\treturn popOffset;\n\t}\n\n\tprivate _nestedTokenize(line: string, hasEOL: boolean, lineState: MonarchLineState, offsetDelta: number, tokensCollector: IMonarchTokensCollector): MonarchLineState {\n\n\t\tconst popOffset = this._findLeavingNestedLanguageOffset(line, lineState);\n\n\t\tif (popOffset === -1) {\n\t\t\t// tokenization will not leave nested language\n\t\t\tconst nestedEndState = tokensCollector.nestedLanguageTokenize(line, hasEOL, lineState.embeddedLanguageData!, offsetDelta);\n\t\t\treturn MonarchLineStateFactory.create(lineState.stack, new EmbeddedLanguageData(lineState.embeddedLanguageData!.languageId, nestedEndState));\n\t\t}\n\n\t\tconst nestedLanguageLine = line.substring(0, popOffset);\n\t\tif (nestedLanguageLine.length > 0) {\n\t\t\t// tokenize with the nested language\n\t\t\ttokensCollector.nestedLanguageTokenize(nestedLanguageLine, false, lineState.embeddedLanguageData!, offsetDelta);\n\t\t}\n\n\t\tconst restOfTheLine = line.substring(popOffset);\n\t\treturn this._myTokenize(restOfTheLine, hasEOL, lineState, offsetDelta + popOffset, tokensCollector);\n\t}\n\n\tprivate _safeRuleName(rule: monarchCommon.IRule | null): string {\n\t\tif (rule) {\n\t\t\treturn rule.name;\n\t\t}\n\t\treturn '(unknown)';\n\t}\n\n\tprivate _myTokenize(lineWithoutLF: string, hasEOL: boolean, lineState: MonarchLineState, offsetDelta: number, tokensCollector: IMonarchTokensCollector): MonarchLineState {\n\t\ttokensCollector.enterLanguage(this._languageId);\n\n\t\tconst lineWithoutLFLength = lineWithoutLF.length;\n\t\tconst line = (hasEOL && this._lexer.includeLF ? lineWithoutLF + '\\n' : lineWithoutLF);\n\t\tconst lineLength = line.length;\n\n\t\tlet embeddedLanguageData = lineState.embeddedLanguageData;\n\t\tlet stack = lineState.stack;\n\t\tlet pos = 0;\n\n\t\t// regular expression group matching\n\t\t// these never need cloning or equality since they are only used within a line match\n\t\tinterface GroupMatching {\n\t\t\tmatches: string[];\n\t\t\trule: monarchCommon.IRule | null;\n\t\t\tgroups: { action: monarchCommon.FuzzyAction; matched: string }[];\n\t\t}\n\t\tlet groupMatching: GroupMatching | null = null;\n\n\t\t// See https://github.com/microsoft/monaco-editor/issues/1235\n\t\t// Evaluate rules at least once for an empty line\n\t\tlet forceEvaluation = true;\n\n\t\twhile (forceEvaluation || pos < lineLength) {\n\n\t\t\tconst pos0 = pos;\n\t\t\tconst stackLen0 = stack.depth;\n\t\t\tconst groupLen0 = groupMatching ? groupMatching.groups.length : 0;\n\t\t\tconst state = stack.state;\n\n\t\t\tlet matches: string[] | null = null;\n\t\t\tlet matched: string | null = null;\n\t\t\tlet action: monarchCommon.FuzzyAction | monarchCommon.FuzzyAction[] | null = null;\n\t\t\tlet rule: monarchCommon.IRule | null = null;\n\n\t\t\tlet enteringEmbeddedLanguage: string | null = null;\n\n\t\t\t// check if we need to process group matches first\n\t\t\tif (groupMatching) {\n\t\t\t\tmatches = groupMatching.matches;\n\t\t\t\tconst groupEntry = groupMatching.groups.shift()!;\n\t\t\t\tmatched = groupEntry.matched;\n\t\t\t\taction = groupEntry.action;\n\t\t\t\trule = groupMatching.rule;\n\n\t\t\t\t// cleanup if necessary\n\t\t\t\tif (groupMatching.groups.length === 0) {\n\t\t\t\t\tgroupMatching = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// otherwise we match on the token stream\n\n\t\t\t\tif (!forceEvaluation && pos >= lineLength) {\n\t\t\t\t\t// nothing to do\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tforceEvaluation = false;\n\n\t\t\t\t// get the rules for this state\n\t\t\t\tlet rules: monarchCommon.IRule[] | null = this._lexer.tokenizer[state];\n\t\t\t\tif (!rules) {\n\t\t\t\t\trules = monarchCommon.findRules(this._lexer, state); // do parent matching\n\t\t\t\t\tif (!rules) {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'tokenizer state is not defined: ' + state);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// try each rule until we match\n\t\t\t\tlet restOfLine = line.substr(pos);\n\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\tif (pos === 0 || !rule.matchOnlyAtLineStart) {\n\t\t\t\t\t\tmatches = restOfLine.match(rule.regex);\n\t\t\t\t\t\tif (matches) {\n\t\t\t\t\t\t\tmatched = matches[0];\n\t\t\t\t\t\t\taction = rule.action;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We matched 'rule' with 'matches' and 'action'\n\t\t\tif (!matches) {\n\t\t\t\tmatches = [''];\n\t\t\t\tmatched = '';\n\t\t\t}\n\n\t\t\tif (!action) {\n\t\t\t\t// bad: we didn't match anything, and there is no action to take\n\t\t\t\t// we need to advance the stream or we get progress trouble\n\t\t\t\tif (pos < lineLength) {\n\t\t\t\t\tmatches = [line.charAt(pos)];\n\t\t\t\t\tmatched = matches[0];\n\t\t\t\t}\n\t\t\t\taction = this._lexer.defaultToken;\n\t\t\t}\n\n\t\t\tif (matched === null) {\n\t\t\t\t// should never happen, needed for strict null checking\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// advance stream\n\t\t\tpos += matched.length;\n\n\t\t\t// maybe call action function (used for 'cases')\n\t\t\twhile (monarchCommon.isFuzzyAction(action) && monarchCommon.isIAction(action) && action.test) {\n\t\t\t\taction = action.test(matched, matches, state, pos === lineLength);\n\t\t\t}\n\n\t\t\tlet result: monarchCommon.FuzzyAction | monarchCommon.FuzzyAction[] | null = null;\n\t\t\t// set the result: either a string or an array of actions\n\t\t\tif (typeof action === 'string' || Array.isArray(action)) {\n\t\t\t\tresult = action;\n\t\t\t} else if (action.group) {\n\t\t\t\tresult = action.group;\n\t\t\t} else if (action.token !== null && action.token !== undefined) {\n\n\t\t\t\t// do $n replacements?\n\t\t\t\tif (action.tokenSubst) {\n\t\t\t\t\tresult = monarchCommon.substituteMatches(this._lexer, action.token, matched, matches, state);\n\t\t\t\t} else {\n\t\t\t\t\tresult = action.token;\n\t\t\t\t}\n\n\t\t\t\t// enter embedded language?\n\t\t\t\tif (action.nextEmbedded) {\n\t\t\t\t\tif (action.nextEmbedded === '@pop') {\n\t\t\t\t\t\tif (!embeddedLanguageData) {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'cannot pop embedded language if not inside one');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tembeddedLanguageData = null;\n\t\t\t\t\t} else if (embeddedLanguageData) {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'cannot enter embedded language from within an embedded language');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tenteringEmbeddedLanguage = monarchCommon.substituteMatches(this._lexer, action.nextEmbedded, matched, matches, state);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// state transformations\n\t\t\t\tif (action.goBack) { // back up the stream..\n\t\t\t\t\tpos = Math.max(0, pos - action.goBack);\n\t\t\t\t}\n\n\t\t\t\tif (action.switchTo && typeof action.switchTo === 'string') {\n\t\t\t\t\tlet nextState = monarchCommon.substituteMatches(this._lexer, action.switchTo, matched, matches, state); // switch state without a push...\n\t\t\t\t\tif (nextState[0] === '@') {\n\t\t\t\t\t\tnextState = nextState.substr(1); // peel off starting '@'\n\t\t\t\t\t}\n\t\t\t\t\tif (!monarchCommon.findRules(this._lexer, nextState)) {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'trying to switch to a state \\'' + nextState + '\\' that is undefined in rule: ' + this._safeRuleName(rule));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstack = stack.switchTo(nextState);\n\t\t\t\t\t}\n\t\t\t\t} else if (action.transform && typeof action.transform === 'function') {\n\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'action.transform not supported');\n\t\t\t\t} else if (action.next) {\n\t\t\t\t\tif (action.next === '@push') {\n\t\t\t\t\t\tif (stack.depth >= this._lexer.maxStack) {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'maximum tokenizer stack size reached: [' +\n\t\t\t\t\t\t\t\tstack.state + ',' + stack.parent!.state + ',...]');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstack = stack.push(state);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (action.next === '@pop') {\n\t\t\t\t\t\tif (stack.depth <= 1) {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'trying to pop an empty stack in rule: ' + this._safeRuleName(rule));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstack = stack.pop()!;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (action.next === '@popall') {\n\t\t\t\t\t\tstack = stack.popall();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet nextState = monarchCommon.substituteMatches(this._lexer, action.next, matched, matches, state);\n\t\t\t\t\t\tif (nextState[0] === '@') {\n\t\t\t\t\t\t\tnextState = nextState.substr(1); // peel off starting '@'\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!monarchCommon.findRules(this._lexer, nextState)) {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'trying to set a next state \\'' + nextState + '\\' that is undefined in rule: ' + this._safeRuleName(rule));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstack = stack.push(nextState);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (action.log && typeof (action.log) === 'string') {\n\t\t\t\t\tmonarchCommon.log(this._lexer, this._lexer.languageId + ': ' + monarchCommon.substituteMatches(this._lexer, action.log, matched, matches, state));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check result\n\t\t\tif (result === null) {\n\t\t\t\tthrow monarchCommon.createError(this._lexer, 'lexer rule has no well-defined action in rule: ' + this._safeRuleName(rule));\n\t\t\t}\n\n\t\t\tconst computeNewStateForEmbeddedLanguage = (enteringEmbeddedLanguage: string) => {\n\t\t\t\t// support language names, mime types, and language ids\n\t\t\t\tconst languageId = (\n\t\t\t\t\tthis._languageService.getLanguageIdByLanguageName(enteringEmbeddedLanguage)\n\t\t\t\t\t|| this._languageService.getLanguageIdByMimeType(enteringEmbeddedLanguage)\n\t\t\t\t\t|| enteringEmbeddedLanguage\n\t\t\t\t);\n\n\t\t\t\tconst embeddedLanguageData = this._getNestedEmbeddedLanguageData(languageId);\n\n\t\t\t\tif (pos < lineLength) {\n\t\t\t\t\t// there is content from the embedded language on this line\n\t\t\t\t\tconst restOfLine = lineWithoutLF.substr(pos);\n\t\t\t\t\treturn this._nestedTokenize(restOfLine, hasEOL, MonarchLineStateFactory.create(stack, embeddedLanguageData), offsetDelta + pos, tokensCollector);\n\t\t\t\t} else {\n\t\t\t\t\treturn MonarchLineStateFactory.create(stack, embeddedLanguageData);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// is the result a group match?\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tif (groupMatching && groupMatching.groups.length > 0) {\n\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'groups cannot be nested: ' + this._safeRuleName(rule));\n\t\t\t\t}\n\t\t\t\tif (matches.length !== result.length + 1) {\n\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'matched number of groups does not match the number of actions in rule: ' + this._safeRuleName(rule));\n\t\t\t\t}\n\t\t\t\tlet totalLen = 0;\n\t\t\t\tfor (let i = 1; i < matches.length; i++) {\n\t\t\t\t\ttotalLen += matches[i].length;\n\t\t\t\t}\n\t\t\t\tif (totalLen !== matched.length) {\n\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'with groups, all characters should be matched in consecutive groups in rule: ' + this._safeRuleName(rule));\n\t\t\t\t}\n\n\t\t\t\tgroupMatching = {\n\t\t\t\t\trule: rule,\n\t\t\t\t\tmatches: matches,\n\t\t\t\t\tgroups: []\n\t\t\t\t};\n\t\t\t\tfor (let i = 0; i < result.length; i++) {\n\t\t\t\t\tgroupMatching.groups[i] = {\n\t\t\t\t\t\taction: result[i],\n\t\t\t\t\t\tmatched: matches[i + 1]\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tpos -= matched.length;\n\t\t\t\t// call recursively to initiate first result match\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t// regular result\n\n\t\t\t\t// check for '@rematch'\n\t\t\t\tif (result === '@rematch') {\n\t\t\t\t\tpos -= matched.length;\n\t\t\t\t\tmatched = ''; // better set the next state too..\n\t\t\t\t\tmatches = null;\n\t\t\t\t\tresult = '';\n\n\t\t\t\t\t// Even though `@rematch` was specified, if `nextEmbedded` also specified,\n\t\t\t\t\t// a state transition should occur.\n\t\t\t\t\tif (enteringEmbeddedLanguage !== null) {\n\t\t\t\t\t\treturn computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// check progress\n\t\t\t\tif (matched.length === 0) {\n\t\t\t\t\tif (lineLength === 0 || stackLen0 !== stack.depth || state !== stack.state || (!groupMatching ? 0 : groupMatching.groups.length) !== groupLen0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'no progress in tokenizer in rule: ' + this._safeRuleName(rule));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the result (and check for brace matching)\n\t\t\t\t// todo: for efficiency we could pre-sanitize tokenPostfix and substitutions\n\t\t\t\tlet tokenType: string | null = null;\n\t\t\t\tif (monarchCommon.isString(result) && result.indexOf('@brackets') === 0) {\n\t\t\t\t\tconst rest = result.substr('@brackets'.length);\n\t\t\t\t\tconst bracket = findBracket(this._lexer, matched);\n\t\t\t\t\tif (!bracket) {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, '@brackets token returned but no bracket defined as: ' + matched);\n\t\t\t\t\t}\n\t\t\t\t\ttokenType = monarchCommon.sanitize(bracket.token + rest);\n\t\t\t\t} else {\n\t\t\t\t\tconst token = (result === '' ? '' : result + this._lexer.tokenPostfix);\n\t\t\t\t\ttokenType = monarchCommon.sanitize(token);\n\t\t\t\t}\n\n\t\t\t\tif (pos0 < lineWithoutLFLength) {\n\t\t\t\t\ttokensCollector.emit(pos0 + offsetDelta, tokenType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (enteringEmbeddedLanguage !== null) {\n\t\t\t\treturn computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage);\n\t\t\t}\n\t\t}\n\n\t\treturn MonarchLineStateFactory.create(stack, embeddedLanguageData);\n\t}\n\n\tprivate _getNestedEmbeddedLanguageData(languageId: string): EmbeddedLanguageData {\n\t\tif (!this._languageService.isRegisteredLanguageId(languageId)) {\n\t\t\treturn new EmbeddedLanguageData(languageId, NullState);\n\t\t}\n\n\t\tif (languageId !== this._languageId) {\n\t\t\t// Fire language loading event\n\t\t\tlanguages.TokenizationRegistry.getOrCreate(languageId);\n\t\t\tthis._embeddedLanguages[languageId] = true;\n\t\t}\n\n\t\tconst tokenizationSupport = languages.TokenizationRegistry.get(languageId);\n\t\tif (tokenizationSupport) {\n\t\t\treturn new EmbeddedLanguageData(languageId, tokenizationSupport.getInitialState());\n\t\t}\n\n\t\treturn new EmbeddedLanguageData(languageId, NullState);\n\t}\n}\n\n/**\n * Searches for a bracket in the 'brackets' attribute that matches the input.\n */\nfunction findBracket(lexer: monarchCommon.ILexer, matched: string) {\n\tif (!matched) {\n\t\treturn null;\n\t}\n\tmatched = monarchCommon.fixCase(lexer, matched);\n\n\tconst brackets = lexer.brackets;\n\tfor (const bracket of brackets) {\n\t\tif (bracket.open === matched) {\n\t\t\treturn { token: bracket.token, bracketType: monarchCommon.MonarchBracket.Open };\n\t\t}\n\t\telse if (bracket.close === matched) {\n\t\t\treturn { token: bracket.token, bracketType: monarchCommon.MonarchBracket.Close };\n\t\t}\n\t}\n\treturn null;\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 * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ColorId, FontStyle, ILanguageIdCodec, ITokenizationSupport, MetadataConsts, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewLineRenderingData } from 'vs/editor/common/viewModel';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer';\n\nconst ttPolicy = window.trustedTypes?.createPolicy('standaloneColorizer', { createHTML: value => value });\n\nexport interface IColorizerOptions {\n\ttabSize?: number;\n}\n\nexport interface IColorizerElementOptions extends IColorizerOptions {\n\ttheme?: string;\n\tmimeType?: string;\n}\n\nexport class Colorizer {\n\n\tpublic static colorizeElement(themeService: IStandaloneThemeService, languageService: ILanguageService, domNode: HTMLElement, options: IColorizerElementOptions): Promise<void> {\n\t\toptions = options || {};\n\t\tconst theme = options.theme || 'vs';\n\t\tconst mimeType = options.mimeType || domNode.getAttribute('lang') || domNode.getAttribute('data-lang');\n\t\tif (!mimeType) {\n\t\t\tconsole.error('Mode not detected');\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tconst languageId = languageService.getLanguageIdByMimeType(mimeType) || mimeType;\n\n\t\tthemeService.setTheme(theme);\n\n\t\tconst text = domNode.firstChild ? domNode.firstChild.nodeValue : '';\n\t\tdomNode.className += ' ' + theme;\n\t\tconst render = (str: string) => {\n\t\t\tconst trustedhtml = ttPolicy?.createHTML(str) ?? str;\n\t\t\tdomNode.innerHTML = trustedhtml as string;\n\t\t};\n\t\treturn this.colorize(languageService, text || '', languageId, options).then(render, (err) => console.error(err));\n\t}\n\n\tpublic static async colorize(languageService: ILanguageService, text: string, languageId: string, options: IColorizerOptions | null | undefined): Promise<string> {\n\t\tconst languageIdCodec = languageService.languageIdCodec;\n\t\tlet tabSize = 4;\n\t\tif (options && typeof options.tabSize === 'number') {\n\t\t\ttabSize = options.tabSize;\n\t\t}\n\n\t\tif (strings.startsWithUTF8BOM(text)) {\n\t\t\ttext = text.substr(1);\n\t\t}\n\t\tconst lines = strings.splitLines(text);\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\treturn _fakeColorize(lines, tabSize, languageIdCodec);\n\t\t}\n\n\t\tconst tokenizationSupport = await TokenizationRegistry.getOrCreate(languageId);\n\t\tif (tokenizationSupport) {\n\t\t\treturn _colorize(lines, tabSize, tokenizationSupport, languageIdCodec);\n\t\t}\n\n\t\treturn _fakeColorize(lines, tabSize, languageIdCodec);\n\t}\n\n\tpublic static colorizeLine(line: string, mightContainNonBasicASCII: boolean, mightContainRTL: boolean, tokens: IViewLineTokens, tabSize: number = 4): string {\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(line, mightContainNonBasicASCII);\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, mightContainRTL);\n\t\tconst renderResult = renderViewLine(new RenderLineInput(\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\ttokens,\n\t\t\t[],\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnull\n\t\t));\n\t\treturn renderResult.html;\n\t}\n\n\tpublic static colorizeModelLine(model: ITextModel, lineNumber: number, tabSize: number = 4): string {\n\t\tconst content = model.getLineContent(lineNumber);\n\t\tmodel.forceTokenization(lineNumber);\n\t\tconst tokens = model.getLineTokens(lineNumber);\n\t\tconst inflatedTokens = tokens.inflate();\n\t\treturn this.colorizeLine(content, model.mightContainNonBasicASCII(), model.mightContainRTL(), inflatedTokens, tabSize);\n\t}\n}\n\nfunction _colorize(lines: string[], tabSize: number, tokenizationSupport: ITokenizationSupport, languageIdCodec: ILanguageIdCodec): Promise<string> {\n\treturn new Promise<string>((c, e) => {\n\t\tconst execute = () => {\n\t\t\tconst result = _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec);\n\t\t\tif (tokenizationSupport instanceof MonarchTokenizer) {\n\t\t\t\tconst status = tokenizationSupport.getLoadStatus();\n\t\t\t\tif (status.loaded === false) {\n\t\t\t\t\tstatus.promise.then(execute, e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tc(result);\n\t\t};\n\t\texecute();\n\t});\n}\n\nfunction _fakeColorize(lines: string[], tabSize: number, languageIdCodec: ILanguageIdCodec): string {\n\tlet html: string[] = [];\n\n\tconst defaultMetadata = (\n\t\t(FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\n\n\tconst tokens = new Uint32Array(2);\n\ttokens[0] = 0;\n\ttokens[1] = defaultMetadata;\n\n\tfor (let i = 0, length = lines.length; i < length; i++) {\n\t\tconst line = lines[i];\n\n\t\ttokens[0] = line.length;\n\t\tconst lineTokens = new LineTokens(tokens, line, languageIdCodec);\n\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */true);\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */true);\n\t\tconst renderResult = renderViewLine(new RenderLineInput(\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\t[],\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnull\n\t\t));\n\n\t\thtml = html.concat(renderResult.html);\n\t\thtml.push('<br/>');\n\t}\n\n\treturn html.join('');\n}\n\nfunction _actualColorize(lines: string[], tabSize: number, tokenizationSupport: ITokenizationSupport, languageIdCodec: ILanguageIdCodec): string {\n\tlet html: string[] = [];\n\tlet state = tokenizationSupport.getInitialState();\n\n\tfor (let i = 0, length = lines.length; i < length; i++) {\n\t\tconst line = lines[i];\n\t\tconst tokenizeResult = tokenizationSupport.tokenizeEncoded(line, true, state);\n\t\tLineTokens.convertToEndOffset(tokenizeResult.tokens, line.length);\n\t\tconst lineTokens = new LineTokens(tokenizeResult.tokens, line, languageIdCodec);\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */true);\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */true);\n\t\tconst renderResult = renderViewLine(new RenderLineInput(\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens.inflate(),\n\t\t\t[],\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnull\n\t\t));\n\n\t\thtml = html.concat(renderResult.html);\n\t\thtml.push('<br/>');\n\n\t\tstate = tokenizeResult.endState;\n\t}\n\n\treturn html.join('');\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 { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport * as nls from 'vs/nls';\n\nexport interface IFindInputCheckboxOpts {\n\treadonly appendTitle: string;\n\treadonly isChecked: boolean;\n\treadonly inputActiveOptionBorder?: Color;\n\treadonly inputActiveOptionForeground?: Color;\n\treadonly inputActiveOptionBackground?: Color;\n}\n\nconst NLS_CASE_SENSITIVE_CHECKBOX_LABEL = nls.localize('caseDescription', \"Match Case\");\nconst NLS_WHOLE_WORD_CHECKBOX_LABEL = nls.localize('wordsDescription', \"Match Whole Word\");\nconst NLS_REGEX_CHECKBOX_LABEL = nls.localize('regexDescription', \"Use Regular Expression\");\n\nexport class CaseSensitiveCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\ticon: Codicon.caseSensitive,\n\t\t\ttitle: NLS_CASE_SENSITIVE_CHECKBOX_LABEL + opts.appendTitle,\n\t\t\tisChecked: opts.isChecked,\n\t\t\tinputActiveOptionBorder: opts.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: opts.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: opts.inputActiveOptionBackground\n\t\t});\n\t}\n}\n\nexport class WholeWordsCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\ticon: Codicon.wholeWord,\n\t\t\ttitle: NLS_WHOLE_WORD_CHECKBOX_LABEL + opts.appendTitle,\n\t\t\tisChecked: opts.isChecked,\n\t\t\tinputActiveOptionBorder: opts.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: opts.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: opts.inputActiveOptionBackground\n\t\t});\n\t}\n}\n\nexport class RegexCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\ticon: Codicon.regex,\n\t\t\ttitle: NLS_REGEX_CHECKBOX_LABEL + opts.appendTitle,\n\t\t\tisChecked: opts.isChecked,\n\t\t\tinputActiveOptionBorder: opts.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: opts.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: opts.inputActiveOptionBackground\n\t\t});\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';\nimport { IHoverDelegate, IHoverDelegateOptions, IHoverDelegateTarget, IHoverWidget } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { IMarkdownString, isMarkdownString } from 'vs/base/common/htmlContent';\nimport { stripIcons } from 'vs/base/common/iconLabels';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { isFunction, isString } from 'vs/base/common/types';\nimport { localize } from 'vs/nls';\n\nexport interface ITooltipMarkdownString {\n\tmarkdown: IMarkdownString | string | undefined | ((token: CancellationToken) => Promise<IMarkdownString | string | undefined>);\n\tmarkdownNotSupportedFallback: string | undefined;\n}\n\nexport function setupNativeHover(htmlElement: HTMLElement, tooltip: string | ITooltipMarkdownString | undefined): void {\n\tif (isString(tooltip)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\thtmlElement.title = stripIcons(tooltip);\n\t} else if (tooltip?.markdownNotSupportedFallback) {\n\t\thtmlElement.title = tooltip.markdownNotSupportedFallback;\n\t} else {\n\t\thtmlElement.removeAttribute('title');\n\t}\n}\n\nexport type IHoverContent = string | ITooltipMarkdownString | HTMLElement | undefined;\ntype IResolvedHoverContent = IMarkdownString | string | HTMLElement | undefined;\n\n\nexport interface ICustomHover extends IDisposable {\n\n\t/**\n\t * Allows to programmatically open the hover.\n\t */\n\tshow(focus?: boolean): void;\n\n\t/**\n\t * Allows to programmatically hide the hover.\n\t */\n\thide(): void;\n\n\t/**\n\t * Updates the contents of the hover.\n\t */\n\tupdate(tooltip: IHoverContent): void;\n}\n\n\nclass UpdatableHoverWidget implements IDisposable {\n\n\tprivate _hoverWidget: IHoverWidget | undefined;\n\tprivate _cancellationTokenSource: CancellationTokenSource | undefined;\n\n\tconstructor(private hoverDelegate: IHoverDelegate, private target: IHoverDelegateTarget | HTMLElement, private fadeInAnimation: boolean) {\n\t}\n\n\tasync update(content: IHoverContent, focus?: boolean): Promise<void> {\n\t\tif (this._cancellationTokenSource) {\n\t\t\t// there's an computation ongoing, cancel it\n\t\t\tthis._cancellationTokenSource.dispose(true);\n\t\t\tthis._cancellationTokenSource = undefined;\n\t\t}\n\t\tif (this.isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet resolvedContent;\n\t\tif (content === undefined || isString(content) || content instanceof HTMLElement) {\n\t\t\tresolvedContent = content;\n\t\t} else if (!isFunction(content.markdown)) {\n\t\t\tresolvedContent = content.markdown ?? content.markdownNotSupportedFallback;\n\t\t} else {\n\t\t\t// compute the content, potentially long-running\n\n\t\t\t// show 'Loading' if no hover is up yet\n\t\t\tif (!this._hoverWidget) {\n\t\t\t\tthis.show(localize('iconLabel.loading', \"Loading...\"), focus);\n\t\t\t}\n\n\t\t\t// compute the content\n\t\t\tthis._cancellationTokenSource = new CancellationTokenSource();\n\t\t\tconst token = this._cancellationTokenSource.token;\n\t\t\tresolvedContent = await content.markdown(token);\n\t\t\tif (resolvedContent === undefined) {\n\t\t\t\tresolvedContent = content.markdownNotSupportedFallback;\n\t\t\t}\n\n\t\t\tif (this.isDisposed || token.isCancellationRequested) {\n\t\t\t\t// either the widget has been closed in the meantime\n\t\t\t\t// or there has been a new call to `update`\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.show(resolvedContent, focus);\n\t}\n\n\tprivate show(content: IResolvedHoverContent, focus?: boolean): void {\n\t\tconst oldHoverWidget = this._hoverWidget;\n\n\t\tif (this.hasContent(content)) {\n\t\t\tconst hoverOptions: IHoverDelegateOptions = {\n\t\t\t\tcontent,\n\t\t\t\ttarget: this.target,\n\t\t\t\tshowPointer: this.hoverDelegate.placement === 'element',\n\t\t\t\thoverPosition: HoverPosition.BELOW,\n\t\t\t\tskipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget // do not fade in if the hover is already showing\n\t\t\t};\n\n\t\t\tthis._hoverWidget = this.hoverDelegate.showHover(hoverOptions, focus);\n\t\t}\n\t\toldHoverWidget?.dispose();\n\t}\n\n\tprivate hasContent(content: IResolvedHoverContent): content is NonNullable<IResolvedHoverContent> {\n\t\tif (!content) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isMarkdownString(content)) {\n\t\t\treturn !!content.value;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tget isDisposed() {\n\t\treturn this._hoverWidget?.isDisposed;\n\t}\n\n\tdispose(): void {\n\t\tthis._hoverWidget?.dispose();\n\t\tthis._cancellationTokenSource?.dispose(true);\n\t\tthis._cancellationTokenSource = undefined;\n\t}\n}\n\nexport function setupCustomHover(hoverDelegate: IHoverDelegate, htmlElement: HTMLElement, content: IHoverContent): ICustomHover {\n\tlet hoverPreparation: IDisposable | undefined;\n\n\tlet hoverWidget: UpdatableHoverWidget | undefined;\n\n\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\tif (disposeWidget) {\n\t\t\thoverWidget?.dispose();\n\t\t\thoverWidget = undefined;\n\t\t}\n\t\tif (disposePreparation) {\n\t\t\thoverPreparation?.dispose();\n\t\t\thoverPreparation = undefined;\n\t\t}\n\t\thoverDelegate.onDidHideHover?.();\n\t};\n\n\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget) => {\n\t\treturn new TimeoutTimer(async () => {\n\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\thoverWidget = new UpdatableHoverWidget(hoverDelegate, target || htmlElement, delay > 0);\n\t\t\t\tawait hoverWidget.update(content, focus);\n\t\t\t}\n\t\t}, delay);\n\t};\n\n\tconst onMouseOver = () => {\n\t\tif (hoverPreparation) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose: DisposableStore = new DisposableStore();\n\n\t\tconst onMouseLeave = (e: MouseEvent) => hideHover(false, (<any>e).fromElement === htmlElement);\n\t\ttoDispose.add(dom.addDisposableListener(htmlElement, dom.EventType.MOUSE_LEAVE, onMouseLeave, true));\n\n\t\tconst onMouseDown = () => hideHover(true, true);\n\t\ttoDispose.add(dom.addDisposableListener(htmlElement, dom.EventType.MOUSE_DOWN, onMouseDown, true));\n\n\t\tconst target: IHoverDelegateTarget = {\n\t\t\ttargetElements: [htmlElement],\n\t\t\tdispose: () => { }\n\t\t};\n\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t// track the mouse position\n\t\t\tconst onMouseMove = (e: MouseEvent) => target.x = e.x + 10;\n\t\t\ttoDispose.add(dom.addDisposableListener(htmlElement, dom.EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t}\n\t\ttoDispose.add(triggerShowHover(hoverDelegate.delay, false, target));\n\n\t\thoverPreparation = toDispose;\n\t};\n\tconst mouseOverDomEmitter = dom.addDisposableListener(htmlElement, dom.EventType.MOUSE_OVER, onMouseOver, true);\n\tconst hover: ICustomHover = {\n\t\tshow: focus => {\n\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\ttriggerShowHover(0, focus); // show hover immediately\n\t\t},\n\t\thide: () => {\n\t\t\thideHover(true, true);\n\t\t},\n\t\tupdate: async newContent => {\n\t\t\tcontent = newContent;\n\t\t\tawait hoverWidget?.update(content);\n\t\t},\n\t\tdispose: () => {\n\t\t\tmouseOverDomEmitter.dispose();\n\t\t\thideHover(true, true);\n\t\t}\n\t};\n\treturn hover;\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 * as dom from 'vs/base/browser/dom';\nimport { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';\nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';\nimport { ITooltipMarkdownString, setupCustomHover, setupNativeHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';\nimport { IMatch } from 'vs/base/common/filters';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { equals } from 'vs/base/common/objects';\nimport { Range } from 'vs/base/common/range';\nimport 'vs/css!./iconlabel';\n\nexport interface IIconLabelCreationOptions {\n\tsupportHighlights?: boolean;\n\tsupportDescriptionHighlights?: boolean;\n\tsupportIcons?: boolean;\n\thoverDelegate?: IHoverDelegate;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | ITooltipMarkdownString;\n\tdescriptionTitle?: string;\n\textraClasses?: string[];\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: IMatch[];\n\treadonly separator?: string;\n\treadonly domId?: string;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _className: string | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset className(className: string) {\n\t\tif (this.disposed || className === this._className) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._className = className;\n\t\tthis._element.className = className;\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly domNode: FastLabelNode;\n\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate readonly descriptionContainer: FastLabelNode;\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate readonly descriptionNodeFactory: () => FastLabelNode | HighlightedLabel;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate | undefined;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tconst nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\t\tthis.descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = new LabelWithHighlights(nameContainer, !!options.supportIcons);\n\t\t} else {\n\t\t\tthis.nameNode = new Label(nameContainer);\n\t\t}\n\n\t\tif (options?.supportDescriptionHighlights) {\n\t\t\tthis.descriptionNodeFactory = () => new HighlightedLabel(dom.append(this.descriptionContainer.element, dom.$('span.label-description')), { supportIcons: !!options.supportIcons });\n\t\t} else {\n\t\t\tthis.descriptionNodeFactory = () => this._register(new FastLabelNode(dom.append(this.descriptionContainer.element, dom.$('span.label-description'))));\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate;\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst classes = ['monaco-icon-label'];\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tclasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tclasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tclasses.push('strikethrough');\n\t\t\t}\n\t\t}\n\n\t\tthis.domNode.className = classes.join(' ');\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tif (!this.descriptionNode) {\n\t\t\t\tthis.descriptionNode = this.descriptionNodeFactory(); // description node is created lazily on demand\n\t\t\t}\n\n\t\t\tif (this.descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tthis.descriptionNode.set(description || '', options ? options.descriptionMatches : undefined);\n\t\t\t\tthis.setupHover(this.descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode.textContent = description || '';\n\t\t\t\tthis.setupHover(this.descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tthis.descriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | ITooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.hoverDelegate) {\n\t\t\tsetupNativeHover(htmlElement, tooltip);\n\t\t} else {\n\t\t\tconst hoverDisposable = setupCustomHover(this.hoverDelegate, htmlElement, tooltip);\n\t\t\tif (hoverDisposable) {\n\t\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.innerText = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.innerText = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.innerText = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId })), { supportIcons: this.supportIcons });\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines);\n\t\t} else {\n\t\t\tthis.container.innerText = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = new HighlightedLabel(dom.append(this.container, name), { supportIcons: this.supportIcons });\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 { DragAndDropData, IDragAndDropData, StaticDND } from 'vs/base/browser/dnd';\nimport { $, addDisposableListener, append, clearNode, createStyleSheet, getDomNodePagePosition, hasParentWithClass } from 'vs/base/browser/dom';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IIdentityProvider, IKeyboardNavigationDelegate, IKeyboardNavigationLabelProvider, IListDragAndDrop, IListDragOverReaction, IListMouseEvent, IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';\nimport { DefaultKeyboardNavigationDelegate, IListOptions, IListStyles, isInputElement, isMonacoEditor, List, MouseController } from 'vs/base/browser/ui/list/listWidget';\nimport { getVisibleState, isFilterResult } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { ICollapseStateChangeEvent, ITreeDragAndDrop, ITreeEvent, ITreeFilter, ITreeModel, ITreeModelSpliceEvent, ITreeMouseEvent, ITreeNode, ITreeRenderer, TreeDragOverBubble, TreeFilterResult, TreeMouseEventTarget, TreeVisibility } from 'vs/base/browser/ui/tree/tree';\nimport { distinct, equals, range } from 'vs/base/common/arrays';\nimport { disposableTimeout } from 'vs/base/common/async';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { SetMap } from 'vs/base/common/collections';\nimport { Emitter, Event, EventBufferer, Relay } from 'vs/base/common/event';\nimport { fuzzyScore, FuzzyScore } from 'vs/base/common/filters';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { clamp } from 'vs/base/common/numbers';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport 'vs/css!./media/tree';\nimport { localize } from 'vs/nls';\n\nclass TreeElementsDragAndDropData<T, TFilterData, TContext> extends ElementsDragAndDropData<T, TContext> {\n\n\tconstructor(private data: ElementsDragAndDropData<ITreeNode<T, TFilterData>, TContext>) {\n\t\tsuper(data.elements.map(node => node.element));\n\t}\n}\n\nfunction asTreeDragAndDropData<T, TFilterData>(data: IDragAndDropData): IDragAndDropData {\n\tif (data instanceof ElementsDragAndDropData) {\n\t\treturn new TreeElementsDragAndDropData(data);\n\t}\n\n\treturn data;\n}\n\nclass TreeNodeListDragAndDrop<T, TFilterData, TRef> implements IListDragAndDrop<ITreeNode<T, TFilterData>> {\n\n\tprivate autoExpandNode: ITreeNode<T, TFilterData> | undefined;\n\tprivate autoExpandDisposable: IDisposable = Disposable.None;\n\n\tconstructor(private modelProvider: () => ITreeModel<T, TFilterData, TRef>, private dnd: ITreeDragAndDrop<T>) { }\n\n\tgetDragURI(node: ITreeNode<T, TFilterData>): string | null {\n\t\treturn this.dnd.getDragURI(node.element);\n\t}\n\n\tgetDragLabel(nodes: ITreeNode<T, TFilterData>[], originalEvent: DragEvent): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(nodes.map(node => node.element), originalEvent);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tonDragStart(data: IDragAndDropData, originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragStart) {\n\t\t\tthis.dnd.onDragStart(asTreeDragAndDropData(data), originalEvent);\n\t\t}\n\t}\n\n\tonDragOver(data: IDragAndDropData, targetNode: ITreeNode<T, TFilterData> | undefined, targetIndex: number | undefined, originalEvent: DragEvent, raw = true): boolean | IListDragOverReaction {\n\t\tconst result = this.dnd.onDragOver(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent);\n\t\tconst didChangeAutoExpandNode = this.autoExpandNode !== targetNode;\n\n\t\tif (didChangeAutoExpandNode) {\n\t\t\tthis.autoExpandDisposable.dispose();\n\t\t\tthis.autoExpandNode = targetNode;\n\t\t}\n\n\t\tif (typeof targetNode === 'undefined') {\n\t\t\treturn result;\n\t\t}\n\n\t\tif (didChangeAutoExpandNode && typeof result !== 'boolean' && result.autoExpand) {\n\t\t\tthis.autoExpandDisposable = disposableTimeout(() => {\n\t\t\t\tconst model = this.modelProvider();\n\t\t\t\tconst ref = model.getNodeLocation(targetNode);\n\n\t\t\t\tif (model.isCollapsed(ref)) {\n\t\t\t\t\tmodel.setCollapsed(ref, false);\n\t\t\t\t}\n\n\t\t\t\tthis.autoExpandNode = undefined;\n\t\t\t}, 500);\n\t\t}\n\n\t\tif (typeof result === 'boolean' || !result.accept || typeof result.bubble === 'undefined' || result.feedback) {\n\t\t\tif (!raw) {\n\t\t\t\tconst accept = typeof result === 'boolean' ? result : result.accept;\n\t\t\t\tconst effect = typeof result === 'boolean' ? undefined : result.effect;\n\t\t\t\treturn { accept, effect, feedback: [targetIndex!] };\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tif (result.bubble === TreeDragOverBubble.Up) {\n\t\t\tconst model = this.modelProvider();\n\t\t\tconst ref = model.getNodeLocation(targetNode);\n\t\t\tconst parentRef = model.getParentNodeLocation(ref);\n\t\t\tconst parentNode = model.getNode(parentRef);\n\t\t\tconst parentIndex = parentRef && model.getListIndex(parentRef);\n\n\t\t\treturn this.onDragOver(data, parentNode, parentIndex, originalEvent, false);\n\t\t}\n\n\t\tconst model = this.modelProvider();\n\t\tconst ref = model.getNodeLocation(targetNode);\n\t\tconst start = model.getListIndex(ref);\n\t\tconst length = model.getListRenderCount(ref);\n\n\t\treturn { ...result, feedback: range(start, start + length) };\n\t}\n\n\tdrop(data: IDragAndDropData, targetNode: ITreeNode<T, TFilterData> | undefined, targetIndex: number | undefined, originalEvent: DragEvent): void {\n\t\tthis.autoExpandDisposable.dispose();\n\t\tthis.autoExpandNode = undefined;\n\n\t\tthis.dnd.drop(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent);\n\t}\n\n\tonDragEnd(originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragEnd) {\n\t\t\tthis.dnd.onDragEnd(originalEvent);\n\t\t}\n\t}\n}\n\nfunction asListOptions<T, TFilterData, TRef>(modelProvider: () => ITreeModel<T, TFilterData, TRef>, options?: IAbstractTreeOptions<T, TFilterData>): IListOptions<ITreeNode<T, TFilterData>> | undefined {\n\treturn options && {\n\t\t...options,\n\t\tidentityProvider: options.identityProvider && {\n\t\t\tgetId(el) {\n\t\t\t\treturn options.identityProvider!.getId(el.element);\n\t\t\t}\n\t\t},\n\t\tdnd: options.dnd && new TreeNodeListDragAndDrop(modelProvider, options.dnd),\n\t\tmultipleSelectionController: options.multipleSelectionController && {\n\t\t\tisSelectionSingleChangeEvent(e) {\n\t\t\t\treturn options.multipleSelectionController!.isSelectionSingleChangeEvent({ ...e, element: e.element } as any);\n\t\t\t},\n\t\t\tisSelectionRangeChangeEvent(e) {\n\t\t\t\treturn options.multipleSelectionController!.isSelectionRangeChangeEvent({ ...e, element: e.element } as any);\n\t\t\t}\n\t\t},\n\t\taccessibilityProvider: options.accessibilityProvider && {\n\t\t\t...options.accessibilityProvider,\n\t\t\tgetSetSize(node) {\n\t\t\t\tconst model = modelProvider();\n\t\t\t\tconst ref = model.getNodeLocation(node);\n\t\t\t\tconst parentRef = model.getParentNodeLocation(ref);\n\t\t\t\tconst parentNode = model.getNode(parentRef);\n\n\t\t\t\treturn parentNode.visibleChildrenCount;\n\t\t\t},\n\t\t\tgetPosInSet(node) {\n\t\t\t\treturn node.visibleChildIndex + 1;\n\t\t\t},\n\t\t\tisChecked: options.accessibilityProvider && options.accessibilityProvider.isChecked ? (node) => {\n\t\t\t\treturn options.accessibilityProvider!.isChecked!(node.element);\n\t\t\t} : undefined,\n\t\t\tgetRole: options.accessibilityProvider && options.accessibilityProvider.getRole ? (node) => {\n\t\t\t\treturn options.accessibilityProvider!.getRole!(node.element);\n\t\t\t} : () => 'treeitem',\n\t\t\tgetAriaLabel(e) {\n\t\t\t\treturn options.accessibilityProvider!.getAriaLabel(e.element);\n\t\t\t},\n\t\t\tgetWidgetAriaLabel() {\n\t\t\t\treturn options.accessibilityProvider!.getWidgetAriaLabel();\n\t\t\t},\n\t\t\tgetWidgetRole: options.accessibilityProvider && options.accessibilityProvider.getWidgetRole ? () => options.accessibilityProvider!.getWidgetRole!() : () => 'tree',\n\t\t\tgetAriaLevel: options.accessibilityProvider && options.accessibilityProvider.getAriaLevel ? (node) => options.accessibilityProvider!.getAriaLevel!(node.element) : (node) => {\n\t\t\t\treturn node.depth;\n\t\t\t},\n\t\t\tgetActiveDescendantId: options.accessibilityProvider.getActiveDescendantId && (node => {\n\t\t\t\treturn options.accessibilityProvider!.getActiveDescendantId!(node.element);\n\t\t\t})\n\t\t},\n\t\tkeyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && {\n\t\t\t...options.keyboardNavigationLabelProvider,\n\t\t\tgetKeyboardNavigationLabel(node) {\n\t\t\t\treturn options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(node.element);\n\t\t\t}\n\t\t},\n\t\tenableKeyboardNavigation: options.simpleKeyboardNavigation\n\t};\n}\n\nexport class ComposedTreeDelegate<T, N extends { element: T }> implements IListVirtualDelegate<N> {\n\n\tconstructor(private delegate: IListVirtualDelegate<T>) { }\n\n\tgetHeight(element: N): number {\n\t\treturn this.delegate.getHeight(element.element);\n\t}\n\n\tgetTemplateId(element: N): string {\n\t\treturn this.delegate.getTemplateId(element.element);\n\t}\n\n\thasDynamicHeight(element: N): boolean {\n\t\treturn !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(element.element);\n\t}\n\n\tsetDynamicHeight(element: N, height: number): void {\n\t\tif (this.delegate.setDynamicHeight) {\n\t\t\tthis.delegate.setDynamicHeight(element.element, height);\n\t\t}\n\t}\n}\n\ninterface ITreeListTemplateData<T> {\n\treadonly container: HTMLElement;\n\treadonly indent: HTMLElement;\n\treadonly twistie: HTMLElement;\n\tindentGuidesDisposable: IDisposable;\n\treadonly templateData: T;\n}\n\nexport enum RenderIndentGuides {\n\tNone = 'none',\n\tOnHover = 'onHover',\n\tAlways = 'always'\n}\n\ninterface ITreeRendererOptions {\n\treadonly indent?: number;\n\treadonly renderIndentGuides?: RenderIndentGuides;\n\t// TODO@joao replace this with collapsible: boolean | 'ondemand'\n\treadonly hideTwistiesOfChildlessElements?: boolean;\n}\n\ninterface IRenderData<TTemplateData> {\n\ttemplateData: ITreeListTemplateData<TTemplateData>;\n\theight: number;\n}\n\ninterface Collection<T> {\n\treadonly elements: T[];\n\treadonly onDidChange: Event<T[]>;\n}\n\nclass EventCollection<T> implements Collection<T> {\n\n\treadonly onDidChange: Event<T[]>;\n\n\tget elements(): T[] {\n\t\treturn this._elements;\n\t}\n\n\tconstructor(onDidChange: Event<T[]>, private _elements: T[] = []) {\n\t\tthis.onDidChange = Event.forEach(onDidChange, elements => this._elements = elements);\n\t}\n}\n\nclass TreeRenderer<T, TFilterData, TRef, TTemplateData> implements IListRenderer<ITreeNode<T, TFilterData>, ITreeListTemplateData<TTemplateData>> {\n\n\tprivate static readonly DefaultIndent = 8;\n\n\treadonly templateId: string;\n\tprivate renderedElements = new Map<T, ITreeNode<T, TFilterData>>();\n\tprivate renderedNodes = new Map<ITreeNode<T, TFilterData>, IRenderData<TTemplateData>>();\n\tprivate indent: number = TreeRenderer.DefaultIndent;\n\tprivate hideTwistiesOfChildlessElements: boolean = false;\n\n\tprivate shouldRenderIndentGuides: boolean = false;\n\tprivate renderedIndentGuides = new SetMap<ITreeNode<T, TFilterData>, HTMLDivElement>();\n\tprivate activeIndentNodes = new Set<ITreeNode<T, TFilterData>>();\n\tprivate indentGuidesDisposable: IDisposable = Disposable.None;\n\n\tprivate readonly disposables = new DisposableStore();\n\n\tconstructor(\n\t\tprivate renderer: ITreeRenderer<T, TFilterData, TTemplateData>,\n\t\tprivate modelProvider: () => ITreeModel<T, TFilterData, TRef>,\n\t\tonDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>>,\n\t\tprivate activeNodes: Collection<ITreeNode<T, TFilterData>>,\n\t\toptions: ITreeRendererOptions = {}\n\t) {\n\t\tthis.templateId = renderer.templateId;\n\t\tthis.updateOptions(options);\n\n\t\tEvent.map(onDidChangeCollapseState, e => e.node)(this.onDidChangeNodeTwistieState, this, this.disposables);\n\n\t\tif (renderer.onDidChangeTwistieState) {\n\t\t\trenderer.onDidChangeTwistieState(this.onDidChangeTwistieState, this, this.disposables);\n\t\t}\n\t}\n\n\tupdateOptions(options: ITreeRendererOptions = {}): void {\n\t\tif (typeof options.indent !== 'undefined') {\n\t\t\tthis.indent = clamp(options.indent, 0, 40);\n\t\t}\n\n\t\tif (typeof options.renderIndentGuides !== 'undefined') {\n\t\t\tconst shouldRenderIndentGuides = options.renderIndentGuides !== RenderIndentGuides.None;\n\n\t\t\tif (shouldRenderIndentGuides !== this.shouldRenderIndentGuides) {\n\t\t\t\tthis.shouldRenderIndentGuides = shouldRenderIndentGuides;\n\t\t\t\tthis.indentGuidesDisposable.dispose();\n\n\t\t\t\tif (shouldRenderIndentGuides) {\n\t\t\t\t\tconst disposables = new DisposableStore();\n\t\t\t\t\tthis.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, disposables);\n\t\t\t\t\tthis.indentGuidesDisposable = disposables;\n\n\t\t\t\t\tthis._onDidChangeActiveNodes(this.activeNodes.elements);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof options.hideTwistiesOfChildlessElements !== 'undefined') {\n\t\t\tthis.hideTwistiesOfChildlessElements = options.hideTwistiesOfChildlessElements;\n\t\t}\n\t}\n\n\trenderTemplate(container: HTMLElement): ITreeListTemplateData<TTemplateData> {\n\t\tconst el = append(container, $('.monaco-tl-row'));\n\t\tconst indent = append(el, $('.monaco-tl-indent'));\n\t\tconst twistie = append(el, $('.monaco-tl-twistie'));\n\t\tconst contents = append(el, $('.monaco-tl-contents'));\n\t\tconst templateData = this.renderer.renderTemplate(contents);\n\n\t\treturn { container, indent, twistie, indentGuidesDisposable: Disposable.None, templateData };\n\t}\n\n\trenderElement(node: ITreeNode<T, TFilterData>, index: number, templateData: ITreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tif (typeof height === 'number') {\n\t\t\tthis.renderedNodes.set(node, { templateData, height });\n\t\t\tthis.renderedElements.set(node.element, node);\n\t\t}\n\n\t\tconst indent = TreeRenderer.DefaultIndent + (node.depth - 1) * this.indent;\n\t\ttemplateData.twistie.style.paddingLeft = `${indent}px`;\n\t\ttemplateData.indent.style.width = `${indent + this.indent - 16}px`;\n\n\t\tthis.renderTwistie(node, templateData);\n\n\t\tif (typeof height === 'number') {\n\t\t\tthis.renderIndentGuides(node, templateData);\n\t\t}\n\n\t\tthis.renderer.renderElement(node, index, templateData.templateData, height);\n\t}\n\n\tdisposeElement(node: ITreeNode<T, TFilterData>, index: number, templateData: ITreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\ttemplateData.indentGuidesDisposable.dispose();\n\n\t\tif (this.renderer.disposeElement) {\n\t\t\tthis.renderer.disposeElement(node, index, templateData.templateData, height);\n\t\t}\n\n\t\tif (typeof height === 'number') {\n\t\t\tthis.renderedNodes.delete(node);\n\t\t\tthis.renderedElements.delete(node.element);\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: ITreeListTemplateData<TTemplateData>): void {\n\t\tthis.renderer.disposeTemplate(templateData.templateData);\n\t}\n\n\tprivate onDidChangeTwistieState(element: T): void {\n\t\tconst node = this.renderedElements.get(element);\n\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onDidChangeNodeTwistieState(node);\n\t}\n\n\tprivate onDidChangeNodeTwistieState(node: ITreeNode<T, TFilterData>): void {\n\t\tconst data = this.renderedNodes.get(node);\n\n\t\tif (!data) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderTwistie(node, data.templateData);\n\t\tthis._onDidChangeActiveNodes(this.activeNodes.elements);\n\t\tthis.renderIndentGuides(node, data.templateData);\n\t}\n\n\tprivate renderTwistie(node: ITreeNode<T, TFilterData>, templateData: ITreeListTemplateData<TTemplateData>) {\n\t\ttemplateData.twistie.classList.remove(...Codicon.treeItemExpanded.classNamesArray);\n\n\t\tlet twistieRendered = false;\n\n\t\tif (this.renderer.renderTwistie) {\n\t\t\ttwistieRendered = this.renderer.renderTwistie(node.element, templateData.twistie);\n\t\t}\n\n\t\tif (node.collapsible && (!this.hideTwistiesOfChildlessElements || node.visibleChildrenCount > 0)) {\n\t\t\tif (!twistieRendered) {\n\t\t\t\ttemplateData.twistie.classList.add(...Codicon.treeItemExpanded.classNamesArray);\n\t\t\t}\n\n\t\t\ttemplateData.twistie.classList.add('collapsible');\n\t\t\ttemplateData.twistie.classList.toggle('collapsed', node.collapsed);\n\t\t} else {\n\t\t\ttemplateData.twistie.classList.remove('collapsible', 'collapsed');\n\t\t}\n\n\t\tif (node.collapsible) {\n\t\t\ttemplateData.container.setAttribute('aria-expanded', String(!node.collapsed));\n\t\t} else {\n\t\t\ttemplateData.container.removeAttribute('aria-expanded');\n\t\t}\n\t}\n\n\tprivate renderIndentGuides(target: ITreeNode<T, TFilterData>, templateData: ITreeListTemplateData<TTemplateData>): void {\n\t\tclearNode(templateData.indent);\n\t\ttemplateData.indentGuidesDisposable.dispose();\n\n\t\tif (!this.shouldRenderIndentGuides) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst model = this.modelProvider();\n\n\t\tlet node = target;\n\n\t\twhile (true) {\n\t\t\tconst ref = model.getNodeLocation(node);\n\t\t\tconst parentRef = model.getParentNodeLocation(ref);\n\n\t\t\tif (!parentRef) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst parent = model.getNode(parentRef);\n\t\t\tconst guide = $<HTMLDivElement>('.indent-guide', { style: `width: ${this.indent}px` });\n\n\t\t\tif (this.activeIndentNodes.has(parent)) {\n\t\t\t\tguide.classList.add('active');\n\t\t\t}\n\n\t\t\tif (templateData.indent.childElementCount === 0) {\n\t\t\t\ttemplateData.indent.appendChild(guide);\n\t\t\t} else {\n\t\t\t\ttemplateData.indent.insertBefore(guide, templateData.indent.firstElementChild);\n\t\t\t}\n\n\t\t\tthis.renderedIndentGuides.add(parent, guide);\n\t\t\tdisposableStore.add(toDisposable(() => this.renderedIndentGuides.delete(parent, guide)));\n\n\t\t\tnode = parent;\n\t\t}\n\n\t\ttemplateData.indentGuidesDisposable = disposableStore;\n\t}\n\n\tprivate _onDidChangeActiveNodes(nodes: ITreeNode<T, TFilterData>[]): void {\n\t\tif (!this.shouldRenderIndentGuides) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst set = new Set<ITreeNode<T, TFilterData>>();\n\t\tconst model = this.modelProvider();\n\n\t\tnodes.forEach(node => {\n\t\t\tconst ref = model.getNodeLocation(node);\n\t\t\ttry {\n\t\t\t\tconst parentRef = model.getParentNodeLocation(ref);\n\n\t\t\t\tif (node.collapsible && node.children.length > 0 && !node.collapsed) {\n\t\t\t\t\tset.add(node);\n\t\t\t\t} else if (parentRef) {\n\t\t\t\t\tset.add(model.getNode(parentRef));\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// noop\n\t\t\t}\n\t\t});\n\n\t\tthis.activeIndentNodes.forEach(node => {\n\t\t\tif (!set.has(node)) {\n\t\t\t\tthis.renderedIndentGuides.forEach(node, line => line.classList.remove('active'));\n\t\t\t}\n\t\t});\n\n\t\tset.forEach(node => {\n\t\t\tif (!this.activeIndentNodes.has(node)) {\n\t\t\t\tthis.renderedIndentGuides.forEach(node, line => line.classList.add('active'));\n\t\t\t}\n\t\t});\n\n\t\tthis.activeIndentNodes = set;\n\t}\n\n\tdispose(): void {\n\t\tthis.renderedNodes.clear();\n\t\tthis.renderedElements.clear();\n\t\tthis.indentGuidesDisposable.dispose();\n\t\tdispose(this.disposables);\n\t}\n}\n\nexport type LabelFuzzyScore = { label: string; score: FuzzyScore };\n\nclass TypeFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDisposable {\n\tprivate _totalCount = 0;\n\tget totalCount(): number { return this._totalCount; }\n\tprivate _matchCount = 0;\n\tget matchCount(): number { return this._matchCount; }\n\n\tprivate _pattern: string = '';\n\tprivate _lowercasePattern: string = '';\n\tprivate readonly disposables = new DisposableStore();\n\n\tset pattern(pattern: string) {\n\t\tthis._pattern = pattern;\n\t\tthis._lowercasePattern = pattern.toLowerCase();\n\t}\n\n\tconstructor(\n\t\tprivate tree: AbstractTree<T, any, any>,\n\t\tprivate keyboardNavigationLabelProvider: IKeyboardNavigationLabelProvider<T>,\n\t\tprivate _filter?: ITreeFilter<T, FuzzyScore>\n\t) {\n\t\ttree.onWillRefilter(this.reset, this, this.disposables);\n\t}\n\n\tfilter(element: T, parentVisibility: TreeVisibility): TreeFilterResult<FuzzyScore | LabelFuzzyScore> {\n\t\tif (this._filter) {\n\t\t\tconst result = this._filter.filter(element, parentVisibility);\n\n\t\t\tif (this.tree.options.simpleKeyboardNavigation) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tlet visibility: TreeVisibility;\n\n\t\t\tif (typeof result === 'boolean') {\n\t\t\t\tvisibility = result ? TreeVisibility.Visible : TreeVisibility.Hidden;\n\t\t\t} else if (isFilterResult(result)) {\n\t\t\t\tvisibility = getVisibleState(result.visibility);\n\t\t\t} else {\n\t\t\t\tvisibility = result;\n\t\t\t}\n\n\t\t\tif (visibility === TreeVisibility.Hidden) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tthis._totalCount++;\n\n\t\tif (this.tree.options.simpleKeyboardNavigation || !this._pattern) {\n\t\t\tthis._matchCount++;\n\t\t\treturn { data: FuzzyScore.Default, visibility: true };\n\t\t}\n\n\t\tconst label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element);\n\t\tconst labels = Array.isArray(label) ? label : [label];\n\n\t\tfor (const l of labels) {\n\t\t\tconst labelStr = l && l.toString();\n\t\t\tif (typeof labelStr === 'undefined') {\n\t\t\t\treturn { data: FuzzyScore.Default, visibility: true };\n\t\t\t}\n\n\t\t\tconst score = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true);\n\t\t\tif (score) {\n\t\t\t\tthis._matchCount++;\n\t\t\t\treturn labels.length === 1 ?\n\t\t\t\t\t{ data: score, visibility: true } :\n\t\t\t\t\t{ data: { label: labelStr, score: score }, visibility: true };\n\t\t\t}\n\t\t}\n\n\t\tif (this.tree.options.filterOnType) {\n\t\t\treturn TreeVisibility.Recurse;\n\t\t} else {\n\t\t\treturn { data: FuzzyScore.Default, visibility: true };\n\t\t}\n\t}\n\n\tprivate reset(): void {\n\t\tthis._totalCount = 0;\n\t\tthis._matchCount = 0;\n\t}\n\n\tdispose(): void {\n\t\tdispose(this.disposables);\n\t}\n}\n\nclass TypeFilterController<T, TFilterData> implements IDisposable {\n\n\tprivate _enabled = false;\n\tget enabled(): boolean { return this._enabled; }\n\n\tprivate _pattern = '';\n\tget pattern(): string { return this._pattern; }\n\n\tprivate _filterOnType: boolean;\n\tget filterOnType(): boolean { return this._filterOnType; }\n\n\tprivate _empty: boolean = false;\n\n\tprivate readonly _onDidChangeEmptyState = new Emitter<boolean>();\n\n\tprivate positionClassName = 'ne';\n\tprivate domNode: HTMLElement;\n\tprivate messageDomNode: HTMLElement;\n\tprivate labelDomNode: HTMLElement;\n\tprivate filterOnTypeDomNode: HTMLInputElement;\n\tprivate clearDomNode: HTMLElement;\n\tprivate keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter;\n\n\tprivate automaticKeyboardNavigation = true;\n\tprivate triggered = false;\n\n\tprivate readonly _onDidChangePattern = new Emitter<string>();\n\n\tprivate readonly enabledDisposables = new DisposableStore();\n\tprivate readonly disposables = new DisposableStore();\n\n\tconstructor(\n\t\tprivate tree: AbstractTree<T, TFilterData, any>,\n\t\tmodel: ITreeModel<T, TFilterData, any>,\n\t\tprivate view: List<ITreeNode<T, TFilterData>>,\n\t\tprivate filter: TypeFilter<T>,\n\t\tprivate keyboardNavigationDelegate: IKeyboardNavigationDelegate\n\t) {\n\t\tthis.domNode = $(`.monaco-list-type-filter.${this.positionClassName}`);\n\t\tthis.domNode.draggable = true;\n\t\tthis.disposables.add(addDisposableListener(this.domNode, 'dragstart', () => this.onDragStart()));\n\n\t\tthis.messageDomNode = append(view.getHTMLElement(), $(`.monaco-list-type-filter-message`));\n\n\t\tthis.labelDomNode = append(this.domNode, $('span.label'));\n\t\tconst controls = append(this.domNode, $('.controls'));\n\n\t\tthis._filterOnType = !!tree.options.filterOnType;\n\t\tthis.filterOnTypeDomNode = append(controls, $<HTMLInputElement>('input.filter'));\n\t\tthis.filterOnTypeDomNode.type = 'checkbox';\n\t\tthis.filterOnTypeDomNode.checked = this._filterOnType;\n\t\tthis.filterOnTypeDomNode.tabIndex = -1;\n\t\tthis.updateFilterOnTypeTitleAndIcon();\n\t\tthis.disposables.add(addDisposableListener(this.filterOnTypeDomNode, 'input', () => this.onDidChangeFilterOnType()));\n\n\t\tthis.clearDomNode = append(controls, $<HTMLInputElement>('button.clear' + Codicon.treeFilterClear.cssSelector));\n\t\tthis.clearDomNode.tabIndex = -1;\n\t\tthis.clearDomNode.title = localize('clear', \"Clear\");\n\n\t\tthis.keyboardNavigationEventFilter = tree.options.keyboardNavigationEventFilter;\n\n\t\tmodel.onDidSplice(this.onDidSpliceModel, this, this.disposables);\n\t\tthis.updateOptions(tree.options);\n\t}\n\n\tupdateOptions(options: IAbstractTreeOptions<T, TFilterData>): void {\n\t\tif (options.simpleKeyboardNavigation) {\n\t\t\tthis.disable();\n\t\t} else {\n\t\t\tthis.enable();\n\t\t}\n\n\t\tif (typeof options.filterOnType !== 'undefined') {\n\t\t\tthis._filterOnType = !!options.filterOnType;\n\t\t\tthis.filterOnTypeDomNode.checked = this._filterOnType;\n\t\t\tthis.updateFilterOnTypeTitleAndIcon();\n\t\t}\n\n\t\tif (typeof options.automaticKeyboardNavigation !== 'undefined') {\n\t\t\tthis.automaticKeyboardNavigation = options.automaticKeyboardNavigation;\n\t\t}\n\n\t\tthis.tree.refilter();\n\t\tthis.render();\n\n\t\tif (!this.automaticKeyboardNavigation) {\n\t\t\tthis.onEventOrInput('');\n\t\t}\n\t}\n\n\tprivate enable(): void {\n\t\tif (this._enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onRawKeyDown = this.enabledDisposables.add(new DomEmitter(this.view.getHTMLElement(), 'keydown'));\n\t\tconst onKeyDown = Event.chain(onRawKeyDown.event)\n\t\t\t.filter(e => !isInputElement(e.target as HTMLElement) || e.target === this.filterOnTypeDomNode)\n\t\t\t.filter(e => e.key !== 'Dead' && !/^Media/.test(e.key))\n\t\t\t.map(e => new StandardKeyboardEvent(e))\n\t\t\t.filter(this.keyboardNavigationEventFilter || (() => true))\n\t\t\t.filter(() => this.automaticKeyboardNavigation || this.triggered)\n\t\t\t.filter(e => (this.keyboardNavigationDelegate.mightProducePrintableCharacter(e) && !(e.keyCode === KeyCode.DownArrow || e.keyCode === KeyCode.UpArrow || e.keyCode === KeyCode.LeftArrow || e.keyCode === KeyCode.RightArrow)) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? (e.altKey && !e.metaKey) : e.ctrlKey) && !e.shiftKey)))\n\t\t\t.forEach(e => { e.stopPropagation(); e.preventDefault(); })\n\t\t\t.event;\n\n\t\tconst onClearClick = this.enabledDisposables.add(new DomEmitter(this.clearDomNode, 'click'));\n\n\t\tEvent.chain(Event.any<MouseEvent | StandardKeyboardEvent>(onKeyDown, onClearClick.event))\n\t\t\t.event(this.onEventOrInput, this, this.enabledDisposables);\n\n\t\tthis.filter.pattern = '';\n\t\tthis.tree.refilter();\n\t\tthis.render();\n\t\tthis._enabled = true;\n\t\tthis.triggered = false;\n\t}\n\n\tprivate disable(): void {\n\t\tif (!this._enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.remove();\n\t\tthis.enabledDisposables.clear();\n\t\tthis.tree.refilter();\n\t\tthis.render();\n\t\tthis._enabled = false;\n\t\tthis.triggered = false;\n\t}\n\n\tprivate onEventOrInput(e: MouseEvent | StandardKeyboardEvent | string): void {\n\t\tif (typeof e === 'string') {\n\t\t\tthis.onInput(e);\n\t\t} else if (e instanceof MouseEvent || e.keyCode === KeyCode.Escape || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey))) {\n\t\t\tthis.onInput('');\n\t\t} else if (e.keyCode === KeyCode.Backspace) {\n\t\t\tthis.onInput(this.pattern.length === 0 ? '' : this.pattern.substr(0, this.pattern.length - 1));\n\t\t} else {\n\t\t\tthis.onInput(this.pattern + e.browserEvent.key);\n\t\t}\n\t}\n\n\tprivate onInput(pattern: string): void {\n\t\tconst container = this.view.getHTMLElement();\n\n\t\tif (pattern && !this.domNode.parentElement) {\n\t\t\tcontainer.append(this.domNode);\n\t\t} else if (!pattern && this.domNode.parentElement) {\n\t\t\tthis.domNode.remove();\n\t\t\tthis.tree.domFocus();\n\t\t}\n\n\t\tthis._pattern = pattern;\n\t\tthis._onDidChangePattern.fire(pattern);\n\n\t\tthis.filter.pattern = pattern;\n\t\tthis.tree.refilter();\n\n\t\tif (pattern) {\n\t\t\tthis.tree.focusNext(0, true, undefined, node => !FuzzyScore.isDefault(node.filterData as any as FuzzyScore));\n\t\t}\n\n\t\tconst focus = this.tree.getFocus();\n\n\t\tif (focus.length > 0) {\n\t\t\tconst element = focus[0];\n\n\t\t\tif (this.tree.getRelativeTop(element) === null) {\n\t\t\t\tthis.tree.reveal(element, 0.5);\n\t\t\t}\n\t\t}\n\n\t\tthis.render();\n\n\t\tif (!pattern) {\n\t\t\tthis.triggered = false;\n\t\t}\n\t}\n\n\tprivate onDragStart(): void {\n\t\tconst container = this.view.getHTMLElement();\n\t\tconst { left } = getDomNodePagePosition(container);\n\t\tconst containerWidth = container.clientWidth;\n\t\tconst midContainerWidth = containerWidth / 2;\n\t\tconst width = this.domNode.clientWidth;\n\t\tconst disposables = new DisposableStore();\n\t\tlet positionClassName = this.positionClassName;\n\n\t\tconst updatePosition = () => {\n\t\t\tswitch (positionClassName) {\n\t\t\t\tcase 'nw':\n\t\t\t\t\tthis.domNode.style.top = `4px`;\n\t\t\t\t\tthis.domNode.style.left = `4px`;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ne':\n\t\t\t\t\tthis.domNode.style.top = `4px`;\n\t\t\t\t\tthis.domNode.style.left = `${containerWidth - width - 6}px`;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tconst onDragOver = (event: DragEvent) => {\n\t\t\tevent.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)\n\n\t\t\tconst x = event.clientX - left;\n\t\t\tif (event.dataTransfer) {\n\t\t\t\tevent.dataTransfer.dropEffect = 'none';\n\t\t\t}\n\n\t\t\tif (x < midContainerWidth) {\n\t\t\t\tpositionClassName = 'nw';\n\t\t\t} else {\n\t\t\t\tpositionClassName = 'ne';\n\t\t\t}\n\n\t\t\tupdatePosition();\n\t\t};\n\n\t\tconst onDragEnd = () => {\n\t\t\tthis.positionClassName = positionClassName;\n\t\t\tthis.domNode.className = `monaco-list-type-filter ${this.positionClassName}`;\n\t\t\tthis.domNode.style.top = '';\n\t\t\tthis.domNode.style.left = '';\n\n\t\t\tdispose(disposables);\n\t\t};\n\n\t\tupdatePosition();\n\t\tthis.domNode.classList.remove(positionClassName);\n\n\t\tthis.domNode.classList.add('dragging');\n\t\tdisposables.add(toDisposable(() => this.domNode.classList.remove('dragging')));\n\n\t\tdisposables.add(addDisposableListener(document, 'dragover', e => onDragOver(e)));\n\t\tdisposables.add(addDisposableListener(this.domNode, 'dragend', () => onDragEnd()));\n\n\t\tStaticDND.CurrentDragAndDropData = new DragAndDropData('vscode-ui');\n\t\tdisposables.add(toDisposable(() => StaticDND.CurrentDragAndDropData = undefined));\n\t}\n\n\tprivate onDidSpliceModel(): void {\n\t\tif (!this._enabled || this.pattern.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.tree.refilter();\n\t\tthis.render();\n\t}\n\n\tprivate onDidChangeFilterOnType(): void {\n\t\tthis.tree.updateOptions({ filterOnType: this.filterOnTypeDomNode.checked });\n\t\tthis.tree.refilter();\n\t\tthis.tree.domFocus();\n\t\tthis.render();\n\t\tthis.updateFilterOnTypeTitleAndIcon();\n\t}\n\n\tprivate updateFilterOnTypeTitleAndIcon(): void {\n\t\tif (this.filterOnType) {\n\t\t\tthis.filterOnTypeDomNode.classList.remove(...Codicon.treeFilterOnTypeOff.classNamesArray);\n\t\t\tthis.filterOnTypeDomNode.classList.add(...Codicon.treeFilterOnTypeOn.classNamesArray);\n\t\t\tthis.filterOnTypeDomNode.title = localize('disable filter on type', \"Disable Filter on Type\");\n\t\t} else {\n\t\t\tthis.filterOnTypeDomNode.classList.remove(...Codicon.treeFilterOnTypeOn.classNamesArray);\n\t\t\tthis.filterOnTypeDomNode.classList.add(...Codicon.treeFilterOnTypeOff.classNamesArray);\n\t\t\tthis.filterOnTypeDomNode.title = localize('enable filter on type', \"Enable Filter on Type\");\n\t\t}\n\t}\n\n\tprivate render(): void {\n\t\tconst noMatches = this.filter.totalCount > 0 && this.filter.matchCount === 0;\n\n\t\tif (this.pattern && this.tree.options.filterOnType && noMatches) {\n\t\t\tthis.messageDomNode.textContent = localize('empty', \"No elements found\");\n\t\t\tthis._empty = true;\n\t\t} else {\n\t\t\tthis.messageDomNode.innerText = '';\n\t\t\tthis._empty = false;\n\t\t}\n\n\t\tthis.domNode.classList.toggle('no-matches', noMatches);\n\t\tthis.domNode.title = localize('found', \"Matched {0} out of {1} elements\", this.filter.matchCount, this.filter.totalCount);\n\t\tthis.labelDomNode.textContent = this.pattern.length > 16 ? '…' + this.pattern.substr(this.pattern.length - 16) : this.pattern;\n\n\t\tthis._onDidChangeEmptyState.fire(this._empty);\n\t}\n\n\tshouldAllowFocus(node: ITreeNode<T, TFilterData>): boolean {\n\t\tif (!this.enabled || !this.pattern || this.filterOnType) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.filter.totalCount > 0 && this.filter.matchCount <= 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn !FuzzyScore.isDefault(node.filterData as any as FuzzyScore);\n\t}\n\n\tdispose() {\n\t\tif (this._enabled) {\n\t\t\tthis.domNode.remove();\n\t\t\tthis.enabledDisposables.dispose();\n\t\t\tthis._enabled = false;\n\t\t\tthis.triggered = false;\n\t\t}\n\n\t\tthis._onDidChangePattern.dispose();\n\t\tdispose(this.disposables);\n\t}\n}\n\nfunction asTreeMouseEvent<T>(event: IListMouseEvent<ITreeNode<T, any>>): ITreeMouseEvent<T> {\n\tlet target: TreeMouseEventTarget = TreeMouseEventTarget.Unknown;\n\n\tif (hasParentWithClass(event.browserEvent.target as HTMLElement, 'monaco-tl-twistie', 'monaco-tl-row')) {\n\t\ttarget = TreeMouseEventTarget.Twistie;\n\t} else if (hasParentWithClass(event.browserEvent.target as HTMLElement, 'monaco-tl-contents', 'monaco-tl-row')) {\n\t\ttarget = TreeMouseEventTarget.Element;\n\t}\n\n\treturn {\n\t\tbrowserEvent: event.browserEvent,\n\t\telement: event.element ? event.element.element : null,\n\t\ttarget\n\t};\n}\n\nexport interface IKeyboardNavigationEventFilter {\n\t(e: StandardKeyboardEvent): boolean;\n}\n\nexport interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions {\n\treadonly multipleSelectionSupport?: boolean;\n\treadonly automaticKeyboardNavigation?: boolean;\n\treadonly simpleKeyboardNavigation?: boolean;\n\treadonly filterOnType?: boolean;\n\treadonly smoothScrolling?: boolean;\n\treadonly horizontalScrolling?: boolean;\n\treadonly mouseWheelScrollSensitivity?: number;\n\treadonly fastScrollSensitivity?: number;\n\treadonly expandOnDoubleClick?: boolean;\n\treadonly expandOnlyOnTwistieClick?: boolean | ((e: any) => boolean); // e is T\n}\n\nexport interface IAbstractTreeOptions<T, TFilterData = void> extends IAbstractTreeOptionsUpdate, IListOptions<T> {\n\treadonly collapseByDefault?: boolean; // defaults to false\n\treadonly filter?: ITreeFilter<T, TFilterData>;\n\treadonly dnd?: ITreeDragAndDrop<T>;\n\treadonly keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter;\n\treadonly additionalScrollHeight?: number;\n}\n\nfunction dfs<T, TFilterData>(node: ITreeNode<T, TFilterData>, fn: (node: ITreeNode<T, TFilterData>) => void): void {\n\tfn(node);\n\tnode.children.forEach(child => dfs(child, fn));\n}\n\n/**\n * The trait concept needs to exist at the tree level, because collapsed\n * tree nodes will not be known by the list.\n */\nclass Trait<T> {\n\n\tprivate nodes: ITreeNode<T, any>[] = [];\n\tprivate elements: T[] | undefined;\n\n\tprivate readonly _onDidChange = new Emitter<ITreeEvent<T>>();\n\treadonly onDidChange = this._onDidChange.event;\n\n\tprivate _nodeSet: Set<ITreeNode<T, any>> | undefined;\n\tprivate get nodeSet(): Set<ITreeNode<T, any>> {\n\t\tif (!this._nodeSet) {\n\t\t\tthis._nodeSet = this.createNodeSet();\n\t\t}\n\n\t\treturn this._nodeSet;\n\t}\n\n\tconstructor(\n\t\tprivate getFirstViewElementWithTrait: () => ITreeNode<T, any> | undefined,\n\t\tprivate identityProvider?: IIdentityProvider<T>\n\t) { }\n\n\tset(nodes: ITreeNode<T, any>[], browserEvent?: UIEvent): void {\n\t\tif (!(browserEvent as any)?.__forceEvent && equals(this.nodes, nodes)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._set(nodes, false, browserEvent);\n\t}\n\n\tprivate _set(nodes: ITreeNode<T, any>[], silent: boolean, browserEvent?: UIEvent): void {\n\t\tthis.nodes = [...nodes];\n\t\tthis.elements = undefined;\n\t\tthis._nodeSet = undefined;\n\n\t\tif (!silent) {\n\t\t\tconst that = this;\n\t\t\tthis._onDidChange.fire({ get elements() { return that.get(); }, browserEvent });\n\t\t}\n\t}\n\n\tget(): T[] {\n\t\tif (!this.elements) {\n\t\t\tthis.elements = this.nodes.map(node => node.element);\n\t\t}\n\n\t\treturn [...this.elements];\n\t}\n\n\tgetNodes(): readonly ITreeNode<T, any>[] {\n\t\treturn this.nodes;\n\t}\n\n\thas(node: ITreeNode<T, any>): boolean {\n\t\treturn this.nodeSet.has(node);\n\t}\n\n\tonDidModelSplice({ insertedNodes, deletedNodes }: ITreeModelSpliceEvent<T, any>): void {\n\t\tif (!this.identityProvider) {\n\t\t\tconst set = this.createNodeSet();\n\t\t\tconst visit = (node: ITreeNode<T, any>) => set.delete(node);\n\t\t\tdeletedNodes.forEach(node => dfs(node, visit));\n\t\t\tthis.set([...set.values()]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst deletedNodesIdSet = new Set<string>();\n\t\tconst deletedNodesVisitor = (node: ITreeNode<T, any>) => deletedNodesIdSet.add(this.identityProvider!.getId(node.element).toString());\n\t\tdeletedNodes.forEach(node => dfs(node, deletedNodesVisitor));\n\n\t\tconst insertedNodesMap = new Map<string, ITreeNode<T, any>>();\n\t\tconst insertedNodesVisitor = (node: ITreeNode<T, any>) => insertedNodesMap.set(this.identityProvider!.getId(node.element).toString(), node);\n\t\tinsertedNodes.forEach(node => dfs(node, insertedNodesVisitor));\n\n\t\tconst nodes: ITreeNode<T, any>[] = [];\n\n\t\tfor (const node of this.nodes) {\n\t\t\tconst id = this.identityProvider.getId(node.element).toString();\n\t\t\tconst wasDeleted = deletedNodesIdSet.has(id);\n\n\t\t\tif (!wasDeleted) {\n\t\t\t\tnodes.push(node);\n\t\t\t} else {\n\t\t\t\tconst insertedNode = insertedNodesMap.get(id);\n\n\t\t\t\tif (insertedNode) {\n\t\t\t\t\tnodes.push(insertedNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.nodes.length > 0 && nodes.length === 0) {\n\t\t\tconst node = this.getFirstViewElementWithTrait();\n\n\t\t\tif (node) {\n\t\t\t\tnodes.push(node);\n\t\t\t}\n\t\t}\n\n\t\tthis._set(nodes, true);\n\t}\n\n\tprivate createNodeSet(): Set<ITreeNode<T, any>> {\n\t\tconst set = new Set<ITreeNode<T, any>>();\n\n\t\tfor (const node of this.nodes) {\n\t\t\tset.add(node);\n\t\t}\n\n\t\treturn set;\n\t}\n}\n\nclass TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<ITreeNode<T, TFilterData>> {\n\n\tconstructor(list: TreeNodeList<T, TFilterData, TRef>, private tree: AbstractTree<T, TFilterData, TRef>) {\n\t\tsuper(list);\n\t}\n\n\tprotected override onViewPointer(e: IListMouseEvent<ITreeNode<T, TFilterData>>): void {\n\t\tif (isInputElement(e.browserEvent.target as HTMLElement) || isMonacoEditor(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = e.element;\n\n\t\tif (!node) {\n\t\t\treturn super.onViewPointer(e);\n\t\t}\n\n\t\tif (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e)) {\n\t\t\treturn super.onViewPointer(e);\n\t\t}\n\n\t\tconst target = e.browserEvent.target as HTMLElement;\n\t\tconst onTwistie = target.classList.contains('monaco-tl-twistie')\n\t\t\t|| (target.classList.contains('monaco-icon-label') && target.classList.contains('folder-icon') && e.browserEvent.offsetX < 16);\n\n\t\tlet expandOnlyOnTwistieClick = false;\n\n\t\tif (typeof this.tree.expandOnlyOnTwistieClick === 'function') {\n\t\t\texpandOnlyOnTwistieClick = this.tree.expandOnlyOnTwistieClick(node.element);\n\t\t} else {\n\t\t\texpandOnlyOnTwistieClick = !!this.tree.expandOnlyOnTwistieClick;\n\t\t}\n\n\t\tif (expandOnlyOnTwistieClick && !onTwistie && e.browserEvent.detail !== 2) {\n\t\t\treturn super.onViewPointer(e);\n\t\t}\n\n\t\tif (!this.tree.expandOnDoubleClick && e.browserEvent.detail === 2) {\n\t\t\treturn super.onViewPointer(e);\n\t\t}\n\n\t\tif (node.collapsible) {\n\t\t\tconst model = ((this.tree as any).model as ITreeModel<T, TFilterData, TRef>); // internal\n\t\t\tconst location = model.getNodeLocation(node);\n\t\t\tconst recursive = e.browserEvent.altKey;\n\t\t\tthis.tree.setFocus([location]);\n\t\t\tmodel.setCollapsed(location, undefined, recursive);\n\n\t\t\tif (expandOnlyOnTwistieClick && onTwistie) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tsuper.onViewPointer(e);\n\t}\n\n\tprotected override onDoubleClick(e: IListMouseEvent<ITreeNode<T, TFilterData>>): void {\n\t\tconst onTwistie = (e.browserEvent.target as HTMLElement).classList.contains('monaco-tl-twistie');\n\n\t\tif (onTwistie || !this.tree.expandOnDoubleClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.onDoubleClick(e);\n\t}\n}\n\ninterface ITreeNodeListOptions<T, TFilterData, TRef> extends IListOptions<ITreeNode<T, TFilterData>> {\n\treadonly tree: AbstractTree<T, TFilterData, TRef>;\n}\n\n/**\n * We use this List subclass to restore selection and focus as nodes\n * get rendered in the list, possibly due to a node expand() call.\n */\nclass TreeNodeList<T, TFilterData, TRef> extends List<ITreeNode<T, TFilterData>> {\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tvirtualDelegate: IListVirtualDelegate<ITreeNode<T, TFilterData>>,\n\t\trenderers: IListRenderer<any /* TODO@joao */, any>[],\n\t\tprivate focusTrait: Trait<T>,\n\t\tprivate selectionTrait: Trait<T>,\n\t\tprivate anchorTrait: Trait<T>,\n\t\toptions: ITreeNodeListOptions<T, TFilterData, TRef>\n\t) {\n\t\tsuper(user, container, virtualDelegate, renderers, options);\n\t}\n\n\tprotected override createMouseController(options: ITreeNodeListOptions<T, TFilterData, TRef>): MouseController<ITreeNode<T, TFilterData>> {\n\t\treturn new TreeNodeListMouseController(this, options.tree);\n\t}\n\n\toverride splice(start: number, deleteCount: number, elements: ITreeNode<T, TFilterData>[] = []): void {\n\t\tsuper.splice(start, deleteCount, elements);\n\n\t\tif (elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst additionalFocus: number[] = [];\n\t\tconst additionalSelection: number[] = [];\n\t\tlet anchor: number | undefined;\n\n\t\telements.forEach((node, index) => {\n\t\t\tif (this.focusTrait.has(node)) {\n\t\t\t\tadditionalFocus.push(start + index);\n\t\t\t}\n\n\t\t\tif (this.selectionTrait.has(node)) {\n\t\t\t\tadditionalSelection.push(start + index);\n\t\t\t}\n\n\t\t\tif (this.anchorTrait.has(node)) {\n\t\t\t\tanchor = start + index;\n\t\t\t}\n\t\t});\n\n\t\tif (additionalFocus.length > 0) {\n\t\t\tsuper.setFocus(distinct([...super.getFocus(), ...additionalFocus]));\n\t\t}\n\n\t\tif (additionalSelection.length > 0) {\n\t\t\tsuper.setSelection(distinct([...super.getSelection(), ...additionalSelection]));\n\t\t}\n\n\t\tif (typeof anchor === 'number') {\n\t\t\tsuper.setAnchor(anchor);\n\t\t}\n\t}\n\n\toverride setFocus(indexes: number[], browserEvent?: UIEvent, fromAPI = false): void {\n\t\tsuper.setFocus(indexes, browserEvent);\n\n\t\tif (!fromAPI) {\n\t\t\tthis.focusTrait.set(indexes.map(i => this.element(i)), browserEvent);\n\t\t}\n\t}\n\n\toverride setSelection(indexes: number[], browserEvent?: UIEvent, fromAPI = false): void {\n\t\tsuper.setSelection(indexes, browserEvent);\n\n\t\tif (!fromAPI) {\n\t\t\tthis.selectionTrait.set(indexes.map(i => this.element(i)), browserEvent);\n\t\t}\n\t}\n\n\toverride setAnchor(index: number | undefined, fromAPI = false): void {\n\t\tsuper.setAnchor(index);\n\n\t\tif (!fromAPI) {\n\t\t\tif (typeof index === 'undefined') {\n\t\t\t\tthis.anchorTrait.set([]);\n\t\t\t} else {\n\t\t\t\tthis.anchorTrait.set([this.element(index)]);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable {\n\n\tprotected view: TreeNodeList<T, TFilterData, TRef>;\n\tprivate renderers: TreeRenderer<T, TFilterData, TRef, any>[];\n\tprotected model: ITreeModel<T, TFilterData, TRef>;\n\tprivate focus: Trait<T>;\n\tprivate selection: Trait<T>;\n\tprivate anchor: Trait<T>;\n\tprivate eventBufferer = new EventBufferer();\n\tprivate typeFilterController?: TypeFilterController<T, TFilterData>;\n\tprivate focusNavigationFilter: ((node: ITreeNode<T, TFilterData>) => boolean) | undefined;\n\tprivate styleElement: HTMLStyleElement;\n\tprotected readonly disposables = new DisposableStore();\n\n\tget onDidChangeFocus(): Event<ITreeEvent<T>> { return this.eventBufferer.wrapEvent(this.focus.onDidChange); }\n\tget onDidChangeSelection(): Event<ITreeEvent<T>> { return this.eventBufferer.wrapEvent(this.selection.onDidChange); }\n\tget onMouseDblClick(): Event<ITreeMouseEvent<T>> { return Event.map(this.view.onMouseDblClick, asTreeMouseEvent); }\n\tget onPointer(): Event<ITreeMouseEvent<T>> { return Event.map(this.view.onPointer, asTreeMouseEvent); }\n\n\tget onDidFocus(): Event<void> { return this.view.onDidFocus; }\n\n\tget onDidChangeModel(): Event<void> { return Event.signal(this.model.onDidSplice); }\n\tget onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<T, TFilterData>> { return this.model.onDidChangeCollapseState; }\n\n\tprivate readonly _onWillRefilter = new Emitter<void>();\n\treadonly onWillRefilter: Event<void> = this._onWillRefilter.event;\n\n\tget expandOnDoubleClick(): boolean { return typeof this._options.expandOnDoubleClick === 'undefined' ? true : this._options.expandOnDoubleClick; }\n\tget expandOnlyOnTwistieClick(): boolean | ((e: T) => boolean) { return typeof this._options.expandOnlyOnTwistieClick === 'undefined' ? true : this._options.expandOnlyOnTwistieClick; }\n\n\tprivate readonly _onDidUpdateOptions = new Emitter<IAbstractTreeOptions<T, TFilterData>>();\n\n\tget onDidDispose(): Event<void> { return this.view.onDidDispose; }\n\n\tconstructor(\n\t\tprivate readonly _user: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\tprivate _options: IAbstractTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tconst treeDelegate = new ComposedTreeDelegate<T, ITreeNode<T, TFilterData>>(delegate);\n\n\t\tconst onDidChangeCollapseStateRelay = new Relay<ICollapseStateChangeEvent<T, TFilterData>>();\n\t\tconst onDidChangeActiveNodes = new Relay<ITreeNode<T, TFilterData>[]>();\n\t\tconst activeNodes = new EventCollection(onDidChangeActiveNodes.event);\n\t\tthis.renderers = renderers.map(r => new TreeRenderer<T, TFilterData, TRef, any>(r, () => this.model, onDidChangeCollapseStateRelay.event, activeNodes, _options));\n\t\tfor (let r of this.renderers) {\n\t\t\tthis.disposables.add(r);\n\t\t}\n\n\t\tlet filter: TypeFilter<T> | undefined;\n\n\t\tif (_options.keyboardNavigationLabelProvider) {\n\t\t\tfilter = new TypeFilter(this, _options.keyboardNavigationLabelProvider, _options.filter as any as ITreeFilter<T, FuzzyScore>);\n\t\t\t_options = { ..._options, filter: filter as ITreeFilter<T, TFilterData> }; // TODO need typescript help here\n\t\t\tthis.disposables.add(filter);\n\t\t}\n\n\t\tthis.focus = new Trait(() => this.view.getFocusedElements()[0], _options.identityProvider);\n\t\tthis.selection = new Trait(() => this.view.getSelectedElements()[0], _options.identityProvider);\n\t\tthis.anchor = new Trait(() => this.view.getAnchorElement(), _options.identityProvider);\n\t\tthis.view = new TreeNodeList(_user, container, treeDelegate, this.renderers, this.focus, this.selection, this.anchor, { ...asListOptions(() => this.model, _options), tree: this });\n\n\t\tthis.model = this.createModel(_user, this.view, _options);\n\t\tonDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState;\n\n\t\tconst onDidModelSplice = Event.forEach(this.model.onDidSplice, e => {\n\t\t\tthis.eventBufferer.bufferEvents(() => {\n\t\t\t\tthis.focus.onDidModelSplice(e);\n\t\t\t\tthis.selection.onDidModelSplice(e);\n\t\t\t});\n\t\t});\n\n\t\t// Make sure the `forEach` always runs\n\t\tonDidModelSplice(() => null, null, this.disposables);\n\n\t\t// Active nodes can change when the model changes or when focus or selection change.\n\t\t// We debounce it with 0 delay since these events may fire in the same stack and we only\n\t\t// want to run this once. It also doesn't matter if it runs on the next tick since it's only\n\t\t// a nice to have UI feature.\n\t\tonDidChangeActiveNodes.input = Event.chain(Event.any<any>(onDidModelSplice, this.focus.onDidChange, this.selection.onDidChange))\n\t\t\t.debounce(() => null, 0)\n\t\t\t.map(() => {\n\t\t\t\tconst set = new Set<ITreeNode<T, TFilterData>>();\n\n\t\t\t\tfor (const node of this.focus.getNodes()) {\n\t\t\t\t\tset.add(node);\n\t\t\t\t}\n\n\t\t\t\tfor (const node of this.selection.getNodes()) {\n\t\t\t\t\tset.add(node);\n\t\t\t\t}\n\n\t\t\t\treturn [...set.values()];\n\t\t\t}).event;\n\n\t\tif (_options.keyboardSupport !== false) {\n\t\t\tconst onKeyDown = Event.chain(this.view.onKeyDown)\n\t\t\t\t.filter(e => !isInputElement(e.target as HTMLElement))\n\t\t\t\t.map(e => new StandardKeyboardEvent(e));\n\n\t\t\tonKeyDown.filter(e => e.keyCode === KeyCode.LeftArrow).on(this.onLeftArrow, this, this.disposables);\n\t\t\tonKeyDown.filter(e => e.keyCode === KeyCode.RightArrow).on(this.onRightArrow, this, this.disposables);\n\t\t\tonKeyDown.filter(e => e.keyCode === KeyCode.Space).on(this.onSpace, this, this.disposables);\n\t\t}\n\n\t\tif (_options.keyboardNavigationLabelProvider) {\n\t\t\tconst delegate = _options.keyboardNavigationDelegate || DefaultKeyboardNavigationDelegate;\n\t\t\tthis.typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, delegate);\n\t\t\tthis.focusNavigationFilter = node => this.typeFilterController!.shouldAllowFocus(node);\n\t\t\tthis.disposables.add(this.typeFilterController!);\n\t\t}\n\n\t\tthis.styleElement = createStyleSheet(this.view.getHTMLElement());\n\t\tthis.getHTMLElement().classList.toggle('always', this._options.renderIndentGuides === RenderIndentGuides.Always);\n\t}\n\n\tupdateOptions(optionsUpdate: IAbstractTreeOptionsUpdate = {}): void {\n\t\tthis._options = { ...this._options, ...optionsUpdate };\n\n\t\tfor (const renderer of this.renderers) {\n\t\t\trenderer.updateOptions(optionsUpdate);\n\t\t}\n\n\t\tthis.view.updateOptions({\n\t\t\t...this._options,\n\t\t\tenableKeyboardNavigation: this._options.simpleKeyboardNavigation,\n\t\t});\n\n\t\tif (this.typeFilterController) {\n\t\t\tthis.typeFilterController.updateOptions(this._options);\n\t\t}\n\n\t\tthis._onDidUpdateOptions.fire(this._options);\n\n\t\tthis.getHTMLElement().classList.toggle('always', this._options.renderIndentGuides === RenderIndentGuides.Always);\n\t}\n\n\tget options(): IAbstractTreeOptions<T, TFilterData> {\n\t\treturn this._options;\n\t}\n\n\t// Widget\n\n\tgetHTMLElement(): HTMLElement {\n\t\treturn this.view.getHTMLElement();\n\t}\n\n\tget scrollTop(): number {\n\t\treturn this.view.scrollTop;\n\t}\n\n\tset scrollTop(scrollTop: number) {\n\t\tthis.view.scrollTop = scrollTop;\n\t}\n\n\tdomFocus(): void {\n\t\tthis.view.domFocus();\n\t}\n\n\tlayout(height?: number, width?: number): void {\n\t\tthis.view.layout(height, width);\n\t}\n\n\tstyle(styles: IListStyles): void {\n\t\tconst suffix = `.${this.view.domId}`;\n\t\tconst content: string[] = [];\n\n\t\tif (styles.treeIndentGuidesStroke) {\n\t\t\tcontent.push(`.monaco-list${suffix}:hover .monaco-tl-indent > .indent-guide, .monaco-list${suffix}.always .monaco-tl-indent > .indent-guide { border-color: ${styles.treeIndentGuidesStroke.transparent(0.4)}; }`);\n\t\t\tcontent.push(`.monaco-list${suffix} .monaco-tl-indent > .indent-guide.active { border-color: ${styles.treeIndentGuidesStroke}; }`);\n\t\t}\n\n\t\tthis.styleElement.textContent = content.join('\\n');\n\t\tthis.view.style(styles);\n\t}\n\n\t// Tree navigation\n\n\tgetParentElement(location: TRef): T {\n\t\tconst parentRef = this.model.getParentNodeLocation(location);\n\t\tconst parentNode = this.model.getNode(parentRef);\n\t\treturn parentNode.element;\n\t}\n\n\tgetFirstElementChild(location: TRef): T | undefined {\n\t\treturn this.model.getFirstElementChild(location);\n\t}\n\n\t// Tree\n\n\tgetNode(location?: TRef): ITreeNode<T, TFilterData> {\n\t\treturn this.model.getNode(location);\n\t}\n\n\tcollapse(location: TRef, recursive: boolean = false): boolean {\n\t\treturn this.model.setCollapsed(location, true, recursive);\n\t}\n\n\texpand(location: TRef, recursive: boolean = false): boolean {\n\t\treturn this.model.setCollapsed(location, false, recursive);\n\t}\n\n\tisCollapsible(location: TRef): boolean {\n\t\treturn this.model.isCollapsible(location);\n\t}\n\n\tsetCollapsible(location: TRef, collapsible?: boolean): boolean {\n\t\treturn this.model.setCollapsible(location, collapsible);\n\t}\n\n\tisCollapsed(location: TRef): boolean {\n\t\treturn this.model.isCollapsed(location);\n\t}\n\n\trefilter(): void {\n\t\tthis._onWillRefilter.fire(undefined);\n\t\tthis.model.refilter();\n\t}\n\n\tsetSelection(elements: TRef[], browserEvent?: UIEvent): void {\n\t\tconst nodes = elements.map(e => this.model.getNode(e));\n\t\tthis.selection.set(nodes, browserEvent);\n\n\t\tconst indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1);\n\t\tthis.view.setSelection(indexes, browserEvent, true);\n\t}\n\n\tgetSelection(): T[] {\n\t\treturn this.selection.get();\n\t}\n\n\tsetFocus(elements: TRef[], browserEvent?: UIEvent): void {\n\t\tconst nodes = elements.map(e => this.model.getNode(e));\n\t\tthis.focus.set(nodes, browserEvent);\n\n\t\tconst indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1);\n\t\tthis.view.setFocus(indexes, browserEvent, true);\n\t}\n\n\tfocusNext(n = 1, loop = false, browserEvent?: UIEvent, filter = this.focusNavigationFilter): void {\n\t\tthis.view.focusNext(n, loop, browserEvent, filter);\n\t}\n\n\tgetFocus(): T[] {\n\t\treturn this.focus.get();\n\t}\n\n\treveal(location: TRef, relativeTop?: number): void {\n\t\tthis.model.expandTo(location);\n\n\t\tconst index = this.model.getListIndex(location);\n\n\t\tif (index === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.view.reveal(index, relativeTop);\n\t}\n\n\t/**\n\t * Returns the relative position of an element rendered in the list.\n\t * Returns `null` if the element isn't *entirely* in the visible viewport.\n\t */\n\tgetRelativeTop(location: TRef): number | null {\n\t\tconst index = this.model.getListIndex(location);\n\n\t\tif (index === -1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.view.getRelativeTop(index);\n\t}\n\n\t// List\n\n\tprivate onLeftArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst nodes = this.view.getFocusedElements();\n\n\t\tif (nodes.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = nodes[0];\n\t\tconst location = this.model.getNodeLocation(node);\n\t\tconst didChange = this.model.setCollapsed(location, true);\n\n\t\tif (!didChange) {\n\t\t\tconst parentLocation = this.model.getParentNodeLocation(location);\n\n\t\t\tif (!parentLocation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst parentListIndex = this.model.getListIndex(parentLocation);\n\n\t\t\tthis.view.reveal(parentListIndex);\n\t\t\tthis.view.setFocus([parentListIndex]);\n\t\t}\n\t}\n\n\tprivate onRightArrow(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst nodes = this.view.getFocusedElements();\n\n\t\tif (nodes.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = nodes[0];\n\t\tconst location = this.model.getNodeLocation(node);\n\t\tconst didChange = this.model.setCollapsed(location, false);\n\n\t\tif (!didChange) {\n\t\t\tif (!node.children.some(child => child.visible)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [focusedIndex] = this.view.getFocus();\n\t\t\tconst firstChildIndex = focusedIndex + 1;\n\n\t\t\tthis.view.reveal(firstChildIndex);\n\t\t\tthis.view.setFocus([firstChildIndex]);\n\t\t}\n\t}\n\n\tprivate onSpace(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst nodes = this.view.getFocusedElements();\n\n\t\tif (nodes.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = nodes[0];\n\t\tconst location = this.model.getNodeLocation(node);\n\t\tconst recursive = e.browserEvent.altKey;\n\n\t\tthis.model.setCollapsed(location, undefined, recursive);\n\t}\n\n\tprotected abstract createModel(user: string, view: ISpliceable<ITreeNode<T, TFilterData>>, options: IAbstractTreeOptions<T, TFilterData>): ITreeModel<T, TFilterData, TRef>;\n\n\tdispose(): void {\n\t\tdispose(this.disposables);\n\t\tthis.view.dispose();\n\t}\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 { IIdentityProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { AbstractTree, IAbstractTreeOptions } from 'vs/base/browser/ui/tree/abstractTree';\nimport { IList } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { ObjectTreeModel } from 'vs/base/browser/ui/tree/objectTreeModel';\nimport { IDataSource, ITreeModel, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree';\n\nexport interface IDataTreeOptions<T, TFilterData = void> extends IAbstractTreeOptions<T, TFilterData> {\n}\n\nexport class DataTree<TInput, T, TFilterData = void> extends AbstractTree<T | null, TFilterData, T | null> {\n\n\tprotected override model!: ObjectTreeModel<T, TFilterData>;\n\n\tprivate identityProvider: IIdentityProvider<T> | undefined;\n\n\tconstructor(\n\t\tprivate user: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\tprivate dataSource: IDataSource<TInput, T>,\n\t\toptions: IDataTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tsuper(user, container, delegate, renderers, options as IDataTreeOptions<T | null, TFilterData>);\n\t\tthis.identityProvider = options.identityProvider;\n\t}\n\n\tprotected createModel(user: string, view: IList<ITreeNode<T, TFilterData>>, options: IDataTreeOptions<T, TFilterData>): ITreeModel<T | null, TFilterData, T | null> {\n\t\treturn new ObjectTreeModel(user, view, options);\n\t}\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 { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { AbstractTree, IAbstractTreeOptions, IAbstractTreeOptionsUpdate } from 'vs/base/browser/ui/tree/abstractTree';\nimport { CompressibleObjectTreeModel, ICompressedTreeElement, ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';\nimport { IList } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { IObjectTreeModel, ObjectTreeModel } from 'vs/base/browser/ui/tree/objectTreeModel';\nimport { ICollapseStateChangeEvent, ITreeElement, ITreeModel, ITreeNode, ITreeRenderer, ITreeSorter } from 'vs/base/browser/ui/tree/tree';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\n\nexport interface IObjectTreeOptions<T, TFilterData = void> extends IAbstractTreeOptions<T, TFilterData> {\n\treadonly sorter?: ITreeSorter<T>;\n}\n\nexport interface IObjectTreeSetChildrenOptions<T> {\n\n\t/**\n\t * Identity provider used to optimize splice() calls in the IndexTree. If\n\t * this is not present, optimized splicing is not enabled.\n\t *\n\t * Warning: if this is present, calls to `setChildren()` will not replace\n\t * or update nodes if their identity is the same, even if the elements are\n\t * different. For this, you should call `rerender()`.\n\t */\n\treadonly diffIdentityProvider?: IIdentityProvider<T>;\n}\n\nexport class ObjectTree<T extends NonNullable<any>, TFilterData = void> extends AbstractTree<T | null, TFilterData, T | null> {\n\n\tprotected override model!: IObjectTreeModel<T, TFilterData>;\n\n\toverride get onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<T | null, TFilterData>> { return this.model.onDidChangeCollapseState; }\n\n\tconstructor(\n\t\tprotected readonly user: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\toptions: IObjectTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tsuper(user, container, delegate, renderers, options as IObjectTreeOptions<T | null, TFilterData>);\n\t}\n\n\tsetChildren(element: T | null, children: Iterable<ITreeElement<T>> = Iterable.empty(), options?: IObjectTreeSetChildrenOptions<T>): void {\n\t\tthis.model.setChildren(element, children, options);\n\t}\n\n\trerender(element?: T): void {\n\t\tif (element === undefined) {\n\t\t\tthis.view.rerender();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.model.rerender(element);\n\t}\n\n\thasElement(element: T): boolean {\n\t\treturn this.model.has(element);\n\t}\n\n\tprotected createModel(user: string, view: IList<ITreeNode<T, TFilterData>>, options: IObjectTreeOptions<T, TFilterData>): ITreeModel<T | null, TFilterData, T | null> {\n\t\treturn new ObjectTreeModel(user, view, options);\n\t}\n}\n\ninterface ICompressedTreeNodeProvider<T, TFilterData> {\n\tgetCompressedTreeNode(location: T | null): ITreeNode<ICompressedTreeNode<T> | null, TFilterData>;\n}\n\nexport interface ICompressibleTreeRenderer<T, TFilterData = void, TTemplateData = void> extends ITreeRenderer<T, TFilterData, TTemplateData> {\n\trenderCompressedElements(node: ITreeNode<ICompressedTreeNode<T>, TFilterData>, index: number, templateData: TTemplateData, height: number | undefined): void;\n\tdisposeCompressedElements?(node: ITreeNode<ICompressedTreeNode<T>, TFilterData>, index: number, templateData: TTemplateData, height: number | undefined): void;\n}\n\ninterface CompressibleTemplateData<T, TFilterData, TTemplateData> {\n\tcompressedTreeNode: ITreeNode<ICompressedTreeNode<T>, TFilterData> | undefined;\n\treadonly data: TTemplateData;\n}\n\nclass CompressibleRenderer<T extends NonNullable<any>, TFilterData, TTemplateData> implements ITreeRenderer<T, TFilterData, CompressibleTemplateData<T, TFilterData, TTemplateData>> {\n\n\treadonly templateId: string;\n\treadonly onDidChangeTwistieState: Event<T> | undefined;\n\n\t@memoize\n\tprivate get compressedTreeNodeProvider(): ICompressedTreeNodeProvider<T, TFilterData> {\n\t\treturn this._compressedTreeNodeProvider();\n\t}\n\n\tconstructor(private _compressedTreeNodeProvider: () => ICompressedTreeNodeProvider<T, TFilterData>, private renderer: ICompressibleTreeRenderer<T, TFilterData, TTemplateData>) {\n\t\tthis.templateId = renderer.templateId;\n\n\t\tif (renderer.onDidChangeTwistieState) {\n\t\t\tthis.onDidChangeTwistieState = renderer.onDidChangeTwistieState;\n\t\t}\n\t}\n\n\trenderTemplate(container: HTMLElement): CompressibleTemplateData<T, TFilterData, TTemplateData> {\n\t\tconst data = this.renderer.renderTemplate(container);\n\t\treturn { compressedTreeNode: undefined, data };\n\t}\n\n\trenderElement(node: ITreeNode<T, TFilterData>, index: number, templateData: CompressibleTemplateData<T, TFilterData, TTemplateData>, height: number | undefined): void {\n\t\tconst compressedTreeNode = this.compressedTreeNodeProvider.getCompressedTreeNode(node.element) as ITreeNode<ICompressedTreeNode<T>, TFilterData>;\n\n\t\tif (compressedTreeNode.element.elements.length === 1) {\n\t\t\ttemplateData.compressedTreeNode = undefined;\n\t\t\tthis.renderer.renderElement(node, index, templateData.data, height);\n\t\t} else {\n\t\t\ttemplateData.compressedTreeNode = compressedTreeNode;\n\t\t\tthis.renderer.renderCompressedElements(compressedTreeNode, index, templateData.data, height);\n\t\t}\n\t}\n\n\tdisposeElement(node: ITreeNode<T, TFilterData>, index: number, templateData: CompressibleTemplateData<T, TFilterData, TTemplateData>, height: number | undefined): void {\n\t\tif (templateData.compressedTreeNode) {\n\t\t\tif (this.renderer.disposeCompressedElements) {\n\t\t\t\tthis.renderer.disposeCompressedElements(templateData.compressedTreeNode, index, templateData.data, height);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.renderer.disposeElement) {\n\t\t\t\tthis.renderer.disposeElement(node, index, templateData.data, height);\n\t\t\t}\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: CompressibleTemplateData<T, TFilterData, TTemplateData>): void {\n\t\tthis.renderer.disposeTemplate(templateData.data);\n\t}\n\n\trenderTwistie?(element: T, twistieElement: HTMLElement): boolean {\n\t\tif (this.renderer.renderTwistie) {\n\t\t\treturn this.renderer.renderTwistie(element, twistieElement);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport interface ICompressibleKeyboardNavigationLabelProvider<T> extends IKeyboardNavigationLabelProvider<T> {\n\tgetCompressedNodeKeyboardNavigationLabel(elements: T[]): { toString(): string | undefined } | undefined;\n}\n\nexport interface ICompressibleObjectTreeOptions<T, TFilterData = void> extends IObjectTreeOptions<T, TFilterData> {\n\treadonly keyboardNavigationLabelProvider?: ICompressibleKeyboardNavigationLabelProvider<T>;\n}\n\nfunction asObjectTreeOptions<T, TFilterData>(compressedTreeNodeProvider: () => ICompressedTreeNodeProvider<T, TFilterData>, options?: ICompressibleObjectTreeOptions<T, TFilterData>): IObjectTreeOptions<T, TFilterData> | undefined {\n\treturn options && {\n\t\t...options,\n\t\tkeyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && {\n\t\t\tgetKeyboardNavigationLabel(e: T) {\n\t\t\t\tlet compressedTreeNode: ITreeNode<ICompressedTreeNode<T>, TFilterData>;\n\n\t\t\t\ttry {\n\t\t\t\t\tcompressedTreeNode = compressedTreeNodeProvider().getCompressedTreeNode(e) as ITreeNode<ICompressedTreeNode<T>, TFilterData>;\n\t\t\t\t} catch {\n\t\t\t\t\treturn options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(e);\n\t\t\t\t}\n\n\t\t\t\tif (compressedTreeNode.element.elements.length === 1) {\n\t\t\t\t\treturn options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(e);\n\t\t\t\t} else {\n\t\t\t\t\treturn options.keyboardNavigationLabelProvider!.getCompressedNodeKeyboardNavigationLabel(compressedTreeNode.element.elements);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport interface ICompressibleObjectTreeOptionsUpdate extends IAbstractTreeOptionsUpdate {\n\treadonly compressionEnabled?: boolean;\n}\n\nexport class CompressibleObjectTree<T extends NonNullable<any>, TFilterData = void> extends ObjectTree<T, TFilterData> implements ICompressedTreeNodeProvider<T, TFilterData> {\n\n\tprotected override model!: CompressibleObjectTreeModel<T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ICompressibleTreeRenderer<T, TFilterData, any>[],\n\t\toptions: ICompressibleObjectTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tconst compressedTreeNodeProvider = () => this;\n\t\tconst compressibleRenderers = renderers.map(r => new CompressibleRenderer<T, TFilterData, any>(compressedTreeNodeProvider, r));\n\t\tsuper(user, container, delegate, compressibleRenderers, asObjectTreeOptions<T, TFilterData>(compressedTreeNodeProvider, options));\n\t}\n\n\toverride setChildren(element: T | null, children: Iterable<ICompressedTreeElement<T>> = Iterable.empty(), options?: IObjectTreeSetChildrenOptions<T>): void {\n\t\tthis.model.setChildren(element, children, options);\n\t}\n\n\tprotected override createModel(user: string, view: IList<ITreeNode<T, TFilterData>>, options: ICompressibleObjectTreeOptions<T, TFilterData>): ITreeModel<T | null, TFilterData, T | null> {\n\t\treturn new CompressibleObjectTreeModel(user, view, options);\n\t}\n\n\toverride updateOptions(optionsUpdate: ICompressibleObjectTreeOptionsUpdate = {}): void {\n\t\tsuper.updateOptions(optionsUpdate);\n\n\t\tif (typeof optionsUpdate.compressionEnabled !== 'undefined') {\n\t\t\tthis.model.setCompressionEnabled(optionsUpdate.compressionEnabled);\n\t\t}\n\t}\n\n\tgetCompressedTreeNode(element: T | null = null): ITreeNode<ICompressedTreeNode<T> | null, TFilterData> {\n\t\treturn this.model.getCompressedTreeNode(element);\n\t}\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 { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { IIdentityProvider, IListDragAndDrop, IListDragOverReaction, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';\nimport { IListStyles } from 'vs/base/browser/ui/list/listWidget';\nimport { ComposedTreeDelegate, IAbstractTreeOptions, IAbstractTreeOptionsUpdate } from 'vs/base/browser/ui/tree/abstractTree';\nimport { ICompressedTreeElement, ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';\nimport { getVisibleState, isFilterResult } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { CompressibleObjectTree, ICompressibleKeyboardNavigationLabelProvider, ICompressibleObjectTreeOptions, ICompressibleTreeRenderer, IObjectTreeOptions, IObjectTreeSetChildrenOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree';\nimport { IAsyncDataSource, ICollapseStateChangeEvent, ITreeDragAndDrop, ITreeElement, ITreeEvent, ITreeFilter, ITreeMouseEvent, ITreeNode, ITreeRenderer, ITreeSorter, TreeError, TreeFilterResult, TreeVisibility, WeakMapper } from 'vs/base/browser/ui/tree/tree';\nimport { CancelablePromise, createCancelablePromise, Promises, timeout } from 'vs/base/common/async';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { isCancellationError, onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { IThemable } from 'vs/base/common/styler';\nimport { isIterable } from 'vs/base/common/types';\n\ninterface IAsyncDataTreeNode<TInput, T> {\n\telement: TInput | T;\n\treadonly parent: IAsyncDataTreeNode<TInput, T> | null;\n\treadonly children: IAsyncDataTreeNode<TInput, T>[];\n\treadonly id?: string | null;\n\trefreshPromise: Promise<void> | undefined;\n\thasChildren: boolean;\n\tstale: boolean;\n\tslow: boolean;\n\tcollapsedByDefault: boolean | undefined;\n}\n\ninterface IAsyncDataTreeNodeRequiredProps<TInput, T> extends Partial<IAsyncDataTreeNode<TInput, T>> {\n\treadonly element: TInput | T;\n\treadonly parent: IAsyncDataTreeNode<TInput, T> | null;\n\treadonly hasChildren: boolean;\n}\n\nfunction createAsyncDataTreeNode<TInput, T>(props: IAsyncDataTreeNodeRequiredProps<TInput, T>): IAsyncDataTreeNode<TInput, T> {\n\treturn {\n\t\t...props,\n\t\tchildren: [],\n\t\trefreshPromise: undefined,\n\t\tstale: true,\n\t\tslow: false,\n\t\tcollapsedByDefault: undefined\n\t};\n}\n\nfunction isAncestor<TInput, T>(ancestor: IAsyncDataTreeNode<TInput, T>, descendant: IAsyncDataTreeNode<TInput, T>): boolean {\n\tif (!descendant.parent) {\n\t\treturn false;\n\t} else if (descendant.parent === ancestor) {\n\t\treturn true;\n\t} else {\n\t\treturn isAncestor(ancestor, descendant.parent);\n\t}\n}\n\nfunction intersects<TInput, T>(node: IAsyncDataTreeNode<TInput, T>, other: IAsyncDataTreeNode<TInput, T>): boolean {\n\treturn node === other || isAncestor(node, other) || isAncestor(other, node);\n}\n\ninterface IDataTreeListTemplateData<T> {\n\ttemplateData: T;\n}\n\ntype AsyncDataTreeNodeMapper<TInput, T, TFilterData> = WeakMapper<ITreeNode<IAsyncDataTreeNode<TInput, T> | null, TFilterData>, ITreeNode<TInput | T, TFilterData>>;\n\nclass AsyncDataTreeNodeWrapper<TInput, T, TFilterData> implements ITreeNode<TInput | T, TFilterData> {\n\n\tget element(): T { return this.node.element!.element as T; }\n\tget children(): ITreeNode<T, TFilterData>[] { return this.node.children.map(node => new AsyncDataTreeNodeWrapper(node)); }\n\tget depth(): number { return this.node.depth; }\n\tget visibleChildrenCount(): number { return this.node.visibleChildrenCount; }\n\tget visibleChildIndex(): number { return this.node.visibleChildIndex; }\n\tget collapsible(): boolean { return this.node.collapsible; }\n\tget collapsed(): boolean { return this.node.collapsed; }\n\tget visible(): boolean { return this.node.visible; }\n\tget filterData(): TFilterData | undefined { return this.node.filterData; }\n\n\tconstructor(private node: ITreeNode<IAsyncDataTreeNode<TInput, T> | null, TFilterData>) { }\n}\n\nclass AsyncDataTreeRenderer<TInput, T, TFilterData, TTemplateData> implements ITreeRenderer<IAsyncDataTreeNode<TInput, T>, TFilterData, IDataTreeListTemplateData<TTemplateData>> {\n\n\treadonly templateId: string;\n\tprivate renderedNodes = new Map<IAsyncDataTreeNode<TInput, T>, IDataTreeListTemplateData<TTemplateData>>();\n\n\tconstructor(\n\t\tprotected renderer: ITreeRenderer<T, TFilterData, TTemplateData>,\n\t\tprotected nodeMapper: AsyncDataTreeNodeMapper<TInput, T, TFilterData>,\n\t\treadonly onDidChangeTwistieState: Event<IAsyncDataTreeNode<TInput, T>>\n\t) {\n\t\tthis.templateId = renderer.templateId;\n\t}\n\n\trenderTemplate(container: HTMLElement): IDataTreeListTemplateData<TTemplateData> {\n\t\tconst templateData = this.renderer.renderTemplate(container);\n\t\treturn { templateData };\n\t}\n\n\trenderElement(node: ITreeNode<IAsyncDataTreeNode<TInput, T>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tthis.renderer.renderElement(this.nodeMapper.map(node) as ITreeNode<T, TFilterData>, index, templateData.templateData, height);\n\t}\n\n\trenderTwistie(element: IAsyncDataTreeNode<TInput, T>, twistieElement: HTMLElement): boolean {\n\t\tif (element.slow) {\n\t\t\ttwistieElement.classList.add(...Codicon.treeItemLoading.classNamesArray);\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttwistieElement.classList.remove(...Codicon.treeItemLoading.classNamesArray);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tdisposeElement(node: ITreeNode<IAsyncDataTreeNode<TInput, T>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tif (this.renderer.disposeElement) {\n\t\t\tthis.renderer.disposeElement(this.nodeMapper.map(node) as ITreeNode<T, TFilterData>, index, templateData.templateData, height);\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: IDataTreeListTemplateData<TTemplateData>): void {\n\t\tthis.renderer.disposeTemplate(templateData.templateData);\n\t}\n\n\tdispose(): void {\n\t\tthis.renderedNodes.clear();\n\t}\n}\n\nfunction asTreeEvent<TInput, T>(e: ITreeEvent<IAsyncDataTreeNode<TInput, T> | null>): ITreeEvent<T> {\n\treturn {\n\t\tbrowserEvent: e.browserEvent,\n\t\telements: e.elements.map(e => e!.element as T)\n\t};\n}\n\nfunction asTreeMouseEvent<TInput, T>(e: ITreeMouseEvent<IAsyncDataTreeNode<TInput, T> | null>): ITreeMouseEvent<T> {\n\treturn {\n\t\tbrowserEvent: e.browserEvent,\n\t\telement: e.element && e.element.element as T,\n\t\ttarget: e.target\n\t};\n}\n\nclass AsyncDataTreeElementsDragAndDropData<TInput, T, TContext> extends ElementsDragAndDropData<T, TContext> {\n\n\tconstructor(private data: ElementsDragAndDropData<IAsyncDataTreeNode<TInput, T>, TContext>) {\n\t\tsuper(data.elements.map(node => node.element as T));\n\t}\n}\n\nfunction asAsyncDataTreeDragAndDropData<TInput, T>(data: IDragAndDropData): IDragAndDropData {\n\tif (data instanceof ElementsDragAndDropData) {\n\t\treturn new AsyncDataTreeElementsDragAndDropData(data);\n\t}\n\n\treturn data;\n}\n\nclass AsyncDataTreeNodeListDragAndDrop<TInput, T> implements IListDragAndDrop<IAsyncDataTreeNode<TInput, T>> {\n\n\tconstructor(private dnd: ITreeDragAndDrop<T>) { }\n\n\tgetDragURI(node: IAsyncDataTreeNode<TInput, T>): string | null {\n\t\treturn this.dnd.getDragURI(node.element as T);\n\t}\n\n\tgetDragLabel(nodes: IAsyncDataTreeNode<TInput, T>[], originalEvent: DragEvent): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(nodes.map(node => node.element as T), originalEvent);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tonDragStart(data: IDragAndDropData, originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragStart) {\n\t\t\tthis.dnd.onDragStart(asAsyncDataTreeDragAndDropData(data), originalEvent);\n\t\t}\n\t}\n\n\tonDragOver(data: IDragAndDropData, targetNode: IAsyncDataTreeNode<TInput, T> | undefined, targetIndex: number | undefined, originalEvent: DragEvent, raw = true): boolean | IListDragOverReaction {\n\t\treturn this.dnd.onDragOver(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element as T, targetIndex, originalEvent);\n\t}\n\n\tdrop(data: IDragAndDropData, targetNode: IAsyncDataTreeNode<TInput, T> | undefined, targetIndex: number | undefined, originalEvent: DragEvent): void {\n\t\tthis.dnd.drop(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element as T, targetIndex, originalEvent);\n\t}\n\n\tonDragEnd(originalEvent: DragEvent): void {\n\t\tif (this.dnd.onDragEnd) {\n\t\t\tthis.dnd.onDragEnd(originalEvent);\n\t\t}\n\t}\n}\n\nfunction asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOptions<T, TFilterData>): IObjectTreeOptions<IAsyncDataTreeNode<TInput, T>, TFilterData> | undefined {\n\treturn options && {\n\t\t...options,\n\t\tcollapseByDefault: true,\n\t\tidentityProvider: options.identityProvider && {\n\t\t\tgetId(el) {\n\t\t\t\treturn options.identityProvider!.getId(el.element as T);\n\t\t\t}\n\t\t},\n\t\tdnd: options.dnd && new AsyncDataTreeNodeListDragAndDrop(options.dnd),\n\t\tmultipleSelectionController: options.multipleSelectionController && {\n\t\t\tisSelectionSingleChangeEvent(e) {\n\t\t\t\treturn options.multipleSelectionController!.isSelectionSingleChangeEvent({ ...e, element: e.element } as any);\n\t\t\t},\n\t\t\tisSelectionRangeChangeEvent(e) {\n\t\t\t\treturn options.multipleSelectionController!.isSelectionRangeChangeEvent({ ...e, element: e.element } as any);\n\t\t\t}\n\t\t},\n\t\taccessibilityProvider: options.accessibilityProvider && {\n\t\t\t...options.accessibilityProvider,\n\t\t\tgetPosInSet: undefined,\n\t\t\tgetSetSize: undefined,\n\t\t\tgetRole: options.accessibilityProvider!.getRole ? (el) => {\n\t\t\t\treturn options.accessibilityProvider!.getRole!(el.element as T);\n\t\t\t} : () => 'treeitem',\n\t\t\tisChecked: options.accessibilityProvider!.isChecked ? (e) => {\n\t\t\t\treturn !!(options.accessibilityProvider?.isChecked!(e.element as T));\n\t\t\t} : undefined,\n\t\t\tgetAriaLabel(e) {\n\t\t\t\treturn options.accessibilityProvider!.getAriaLabel(e.element as T);\n\t\t\t},\n\t\t\tgetWidgetAriaLabel() {\n\t\t\t\treturn options.accessibilityProvider!.getWidgetAriaLabel();\n\t\t\t},\n\t\t\tgetWidgetRole: options.accessibilityProvider!.getWidgetRole ? () => options.accessibilityProvider!.getWidgetRole!() : () => 'tree',\n\t\t\tgetAriaLevel: options.accessibilityProvider!.getAriaLevel && (node => {\n\t\t\t\treturn options.accessibilityProvider!.getAriaLevel!(node.element as T);\n\t\t\t}),\n\t\t\tgetActiveDescendantId: options.accessibilityProvider.getActiveDescendantId && (node => {\n\t\t\t\treturn options.accessibilityProvider!.getActiveDescendantId!(node.element as T);\n\t\t\t})\n\t\t},\n\t\tfilter: options.filter && {\n\t\t\tfilter(e, parentVisibility) {\n\t\t\t\treturn options.filter!.filter(e.element as T, parentVisibility);\n\t\t\t}\n\t\t},\n\t\tkeyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && {\n\t\t\t...options.keyboardNavigationLabelProvider,\n\t\t\tgetKeyboardNavigationLabel(e) {\n\t\t\t\treturn options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(e.element as T);\n\t\t\t}\n\t\t},\n\t\tsorter: undefined,\n\t\texpandOnlyOnTwistieClick: typeof options.expandOnlyOnTwistieClick === 'undefined' ? undefined : (\n\t\t\ttypeof options.expandOnlyOnTwistieClick !== 'function' ? options.expandOnlyOnTwistieClick : (\n\t\t\t\te => (options.expandOnlyOnTwistieClick as ((e: T) => boolean))(e.element as T)\n\t\t\t)\n\t\t),\n\t\tadditionalScrollHeight: options.additionalScrollHeight\n\t};\n}\n\nexport interface IAsyncDataTreeOptionsUpdate extends IAbstractTreeOptionsUpdate { }\nexport interface IAsyncDataTreeUpdateChildrenOptions<T> extends IObjectTreeSetChildrenOptions<T> { }\n\nexport interface IAsyncDataTreeOptions<T, TFilterData = void> extends IAsyncDataTreeOptionsUpdate, Pick<IAbstractTreeOptions<T, TFilterData>, Exclude<keyof IAbstractTreeOptions<T, TFilterData>, 'collapseByDefault'>> {\n\treadonly collapseByDefault?: { (e: T): boolean };\n\treadonly identityProvider?: IIdentityProvider<T>;\n\treadonly sorter?: ITreeSorter<T>;\n\treadonly autoExpandSingleChildren?: boolean;\n}\n\nexport interface IAsyncDataTreeViewState {\n\treadonly focus?: string[];\n\treadonly selection?: string[];\n\treadonly expanded?: string[];\n\treadonly scrollTop?: number;\n}\n\ninterface IAsyncDataTreeViewStateContext<TInput, T> {\n\treadonly viewState: IAsyncDataTreeViewState;\n\treadonly selection: IAsyncDataTreeNode<TInput, T>[];\n\treadonly focus: IAsyncDataTreeNode<TInput, T>[];\n}\n\nfunction dfs<TInput, T>(node: IAsyncDataTreeNode<TInput, T>, fn: (node: IAsyncDataTreeNode<TInput, T>) => void): void {\n\tfn(node);\n\tnode.children.forEach(child => dfs(child, fn));\n}\n\nexport class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable, IThemable {\n\n\tprotected readonly tree: ObjectTree<IAsyncDataTreeNode<TInput, T>, TFilterData>;\n\tprotected readonly root: IAsyncDataTreeNode<TInput, T>;\n\tprivate readonly nodes = new Map<null | T, IAsyncDataTreeNode<TInput, T>>();\n\tprivate readonly sorter?: ITreeSorter<T>;\n\tprivate readonly collapseByDefault?: { (e: T): boolean };\n\n\tprivate readonly subTreeRefreshPromises = new Map<IAsyncDataTreeNode<TInput, T>, Promise<void>>();\n\tprivate readonly refreshPromises = new Map<IAsyncDataTreeNode<TInput, T>, CancelablePromise<Iterable<T>>>();\n\n\tprotected readonly identityProvider?: IIdentityProvider<T>;\n\tprivate readonly autoExpandSingleChildren: boolean;\n\n\tprivate readonly _onDidRender = new Emitter<void>();\n\tprotected readonly _onDidChangeNodeSlowState = new Emitter<IAsyncDataTreeNode<TInput, T>>();\n\n\tprotected readonly nodeMapper: AsyncDataTreeNodeMapper<TInput, T, TFilterData> = new WeakMapper(node => new AsyncDataTreeNodeWrapper(node));\n\n\tprotected readonly disposables = new DisposableStore();\n\n\tget onDidChangeFocus(): Event<ITreeEvent<T>> { return Event.map(this.tree.onDidChangeFocus, asTreeEvent); }\n\tget onDidChangeSelection(): Event<ITreeEvent<T>> { return Event.map(this.tree.onDidChangeSelection, asTreeEvent); }\n\tget onMouseDblClick(): Event<ITreeMouseEvent<T>> { return Event.map(this.tree.onMouseDblClick, asTreeMouseEvent); }\n\tget onPointer(): Event<ITreeMouseEvent<T>> { return Event.map(this.tree.onPointer, asTreeMouseEvent); }\n\tget onDidFocus(): Event<void> { return this.tree.onDidFocus; }\n\n\tget onDidChangeModel(): Event<void> { return this.tree.onDidChangeModel; }\n\tget onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<IAsyncDataTreeNode<TInput, T> | null, TFilterData>> { return this.tree.onDidChangeCollapseState; }\n\n\tget onDidDispose(): Event<void> { return this.tree.onDidDispose; }\n\n\tconstructor(\n\t\tprotected user: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\tprivate dataSource: IAsyncDataSource<TInput, T>,\n\t\toptions: IAsyncDataTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tthis.identityProvider = options.identityProvider;\n\t\tthis.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren;\n\t\tthis.sorter = options.sorter;\n\t\tthis.collapseByDefault = options.collapseByDefault;\n\n\t\tthis.tree = this.createTree(user, container, delegate, renderers, options);\n\n\t\tthis.root = createAsyncDataTreeNode({\n\t\t\telement: undefined!,\n\t\t\tparent: null,\n\t\t\thasChildren: true\n\t\t});\n\n\t\tif (this.identityProvider) {\n\t\t\tthis.root = {\n\t\t\t\t...this.root,\n\t\t\t\tid: null\n\t\t\t};\n\t\t}\n\n\t\tthis.nodes.set(null, this.root);\n\n\t\tthis.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables);\n\t}\n\n\tprotected createTree(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\toptions: IAsyncDataTreeOptions<T, TFilterData>\n\t): ObjectTree<IAsyncDataTreeNode<TInput, T>, TFilterData> {\n\t\tconst objectTreeDelegate = new ComposedTreeDelegate<TInput | T, IAsyncDataTreeNode<TInput, T>>(delegate);\n\t\tconst objectTreeRenderers = renderers.map(r => new AsyncDataTreeRenderer(r, this.nodeMapper, this._onDidChangeNodeSlowState.event));\n\t\tconst objectTreeOptions = asObjectTreeOptions<TInput, T, TFilterData>(options) || {};\n\n\t\treturn new ObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions);\n\t}\n\n\tupdateOptions(options: IAsyncDataTreeOptionsUpdate = {}): void {\n\t\tthis.tree.updateOptions(options);\n\t}\n\n\t// Widget\n\n\tgetHTMLElement(): HTMLElement {\n\t\treturn this.tree.getHTMLElement();\n\t}\n\n\tget scrollTop(): number {\n\t\treturn this.tree.scrollTop;\n\t}\n\n\tset scrollTop(scrollTop: number) {\n\t\tthis.tree.scrollTop = scrollTop;\n\t}\n\n\tdomFocus(): void {\n\t\tthis.tree.domFocus();\n\t}\n\n\tlayout(height?: number, width?: number): void {\n\t\tthis.tree.layout(height, width);\n\t}\n\n\tstyle(styles: IListStyles): void {\n\t\tthis.tree.style(styles);\n\t}\n\n\t// Model\n\n\tgetInput(): TInput | undefined {\n\t\treturn this.root.element as TInput;\n\t}\n\n\tasync setInput(input: TInput, viewState?: IAsyncDataTreeViewState): Promise<void> {\n\t\tthis.refreshPromises.forEach(promise => promise.cancel());\n\t\tthis.refreshPromises.clear();\n\n\t\tthis.root.element = input!;\n\n\t\tconst viewStateContext = viewState && { viewState, focus: [], selection: [] } as IAsyncDataTreeViewStateContext<TInput, T>;\n\n\t\tawait this._updateChildren(input, true, false, viewStateContext);\n\n\t\tif (viewStateContext) {\n\t\t\tthis.tree.setFocus(viewStateContext.focus);\n\t\t\tthis.tree.setSelection(viewStateContext.selection);\n\t\t}\n\n\t\tif (viewState && typeof viewState.scrollTop === 'number') {\n\t\t\tthis.scrollTop = viewState.scrollTop;\n\t\t}\n\t}\n\n\tprivate async _updateChildren(element: TInput | T = this.root.element, recursive = true, rerender = false, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>, options?: IAsyncDataTreeUpdateChildrenOptions<T>): Promise<void> {\n\t\tif (typeof this.root.element === 'undefined') {\n\t\t\tthrow new TreeError(this.user, 'Tree input not set');\n\t\t}\n\n\t\tif (this.root.refreshPromise) {\n\t\t\tawait this.root.refreshPromise;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\tconst node = this.getDataNode(element);\n\t\tawait this.refreshAndRenderNode(node, recursive, viewStateContext, options);\n\n\t\tif (rerender) {\n\t\t\ttry {\n\t\t\t\tthis.tree.rerender(node);\n\t\t\t} catch {\n\t\t\t\t// missing nodes are fine, this could've resulted from\n\t\t\t\t// parallel refresh calls, removing `node` altogether\n\t\t\t}\n\t\t}\n\t}\n\n\t// View\n\n\trerender(element?: T): void {\n\t\tif (element === undefined || element === this.root.element) {\n\t\t\tthis.tree.rerender();\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = this.getDataNode(element);\n\t\tthis.tree.rerender(node);\n\t}\n\n\t// Tree\n\n\tgetNode(element: TInput | T = this.root.element): ITreeNode<TInput | T, TFilterData> {\n\t\tconst dataNode = this.getDataNode(element);\n\t\tconst node = this.tree.getNode(dataNode === this.root ? null : dataNode);\n\t\treturn this.nodeMapper.map(node);\n\t}\n\n\tcollapse(element: T, recursive: boolean = false): boolean {\n\t\tconst node = this.getDataNode(element);\n\t\treturn this.tree.collapse(node === this.root ? null : node, recursive);\n\t}\n\n\tasync expand(element: T, recursive: boolean = false): Promise<boolean> {\n\t\tif (typeof this.root.element === 'undefined') {\n\t\t\tthrow new TreeError(this.user, 'Tree input not set');\n\t\t}\n\n\t\tif (this.root.refreshPromise) {\n\t\t\tawait this.root.refreshPromise;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\tconst node = this.getDataNode(element);\n\n\t\tif (this.tree.hasElement(node) && !this.tree.isCollapsible(node)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (node.refreshPromise) {\n\t\t\tawait this.root.refreshPromise;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\tif (node !== this.root && !node.refreshPromise && !this.tree.isCollapsed(node)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst result = this.tree.expand(node === this.root ? null : node, recursive);\n\n\t\tif (node.refreshPromise) {\n\t\t\tawait this.root.refreshPromise;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetSelection(elements: T[], browserEvent?: UIEvent): void {\n\t\tconst nodes = elements.map(e => this.getDataNode(e));\n\t\tthis.tree.setSelection(nodes, browserEvent);\n\t}\n\n\tgetSelection(): T[] {\n\t\tconst nodes = this.tree.getSelection();\n\t\treturn nodes.map(n => n!.element as T);\n\t}\n\n\tsetFocus(elements: T[], browserEvent?: UIEvent): void {\n\t\tconst nodes = elements.map(e => this.getDataNode(e));\n\t\tthis.tree.setFocus(nodes, browserEvent);\n\t}\n\n\tgetFocus(): T[] {\n\t\tconst nodes = this.tree.getFocus();\n\t\treturn nodes.map(n => n!.element as T);\n\t}\n\n\treveal(element: T, relativeTop?: number): void {\n\t\tthis.tree.reveal(this.getDataNode(element), relativeTop);\n\t}\n\n\t// Tree navigation\n\n\tgetParentElement(element: T): TInput | T {\n\t\tconst node = this.tree.getParentElement(this.getDataNode(element));\n\t\treturn (node && node.element)!;\n\t}\n\n\tgetFirstElementChild(element: TInput | T = this.root.element): TInput | T | undefined {\n\t\tconst dataNode = this.getDataNode(element);\n\t\tconst node = this.tree.getFirstElementChild(dataNode === this.root ? null : dataNode);\n\t\treturn (node && node.element)!;\n\t}\n\n\t// Implementation\n\n\tprivate getDataNode(element: TInput | T): IAsyncDataTreeNode<TInput, T> {\n\t\tconst node: IAsyncDataTreeNode<TInput, T> | undefined = this.nodes.get((element === this.root.element ? null : element) as T);\n\n\t\tif (!node) {\n\t\t\tthrow new TreeError(this.user, `Data tree node not found: ${element}`);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprivate async refreshAndRenderNode(node: IAsyncDataTreeNode<TInput, T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>, options?: IAsyncDataTreeUpdateChildrenOptions<T>): Promise<void> {\n\t\tawait this.refreshNode(node, recursive, viewStateContext);\n\t\tthis.render(node, viewStateContext, options);\n\t}\n\n\tprivate async refreshNode(node: IAsyncDataTreeNode<TInput, T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<void> {\n\t\tlet result: Promise<void> | undefined;\n\n\t\tthis.subTreeRefreshPromises.forEach((refreshPromise, refreshNode) => {\n\t\t\tif (!result && intersects(refreshNode, node)) {\n\t\t\t\tresult = refreshPromise.then(() => this.refreshNode(node, recursive, viewStateContext));\n\t\t\t}\n\t\t});\n\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\n\t\treturn this.doRefreshSubTree(node, recursive, viewStateContext);\n\t}\n\n\tprivate async doRefreshSubTree(node: IAsyncDataTreeNode<TInput, T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<void> {\n\t\tlet done: () => void;\n\t\tnode.refreshPromise = new Promise(c => done = c);\n\t\tthis.subTreeRefreshPromises.set(node, node.refreshPromise);\n\n\t\tnode.refreshPromise.finally(() => {\n\t\t\tnode.refreshPromise = undefined;\n\t\t\tthis.subTreeRefreshPromises.delete(node);\n\t\t});\n\n\t\ttry {\n\t\t\tconst childrenToRefresh = await this.doRefreshNode(node, recursive, viewStateContext);\n\t\t\tnode.stale = false;\n\n\t\t\tawait Promises.settled(childrenToRefresh.map(child => this.doRefreshSubTree(child, recursive, viewStateContext)));\n\t\t} finally {\n\t\t\tdone!();\n\t\t}\n\t}\n\n\tprivate async doRefreshNode(node: IAsyncDataTreeNode<TInput, T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<IAsyncDataTreeNode<TInput, T>[]> {\n\t\tnode.hasChildren = !!this.dataSource.hasChildren(node.element!);\n\n\t\tlet childrenPromise: Promise<Iterable<T>>;\n\n\t\tif (!node.hasChildren) {\n\t\t\tchildrenPromise = Promise.resolve(Iterable.empty());\n\t\t} else {\n\t\t\tconst children = this.doGetChildren(node);\n\t\t\tif (isIterable(children)) {\n\t\t\t\tchildrenPromise = Promise.resolve(children);\n\t\t\t} else {\n\t\t\t\tconst slowTimeout = timeout(800);\n\n\t\t\t\tslowTimeout.then(() => {\n\t\t\t\t\tnode.slow = true;\n\t\t\t\t\tthis._onDidChangeNodeSlowState.fire(node);\n\t\t\t\t}, _ => null);\n\n\t\t\t\tchildrenPromise = children.finally(() => slowTimeout.cancel());\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst children = await childrenPromise;\n\t\t\treturn this.setChildren(node, children, recursive, viewStateContext);\n\t\t} catch (err) {\n\t\t\tif (node !== this.root && this.tree.hasElement(node)) {\n\t\t\t\tthis.tree.collapse(node);\n\t\t\t}\n\n\t\t\tif (isCancellationError(err)) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tif (node.slow) {\n\t\t\t\tnode.slow = false;\n\t\t\t\tthis._onDidChangeNodeSlowState.fire(node);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doGetChildren(node: IAsyncDataTreeNode<TInput, T>): Promise<Iterable<T>> | Iterable<T> {\n\t\tlet result = this.refreshPromises.get(node);\n\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t\tconst children = this.dataSource.getChildren(node.element!);\n\t\tif (isIterable(children)) {\n\t\t\treturn this.processChildren(children);\n\t\t} else {\n\t\t\tresult = createCancelablePromise(async () => this.processChildren(await children));\n\t\t\tthis.refreshPromises.set(node, result);\n\t\t\treturn result.finally(() => { this.refreshPromises.delete(node); });\n\t\t}\n\t}\n\n\tprivate _onDidChangeCollapseState({ node, deep }: ICollapseStateChangeEvent<IAsyncDataTreeNode<TInput, T> | null, any>): void {\n\t\tif (node.element === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!node.collapsed && node.element.stale) {\n\t\t\tif (deep) {\n\t\t\t\tthis.collapse(node.element.element as T);\n\t\t\t} else {\n\t\t\t\tthis.refreshAndRenderNode(node.element, false)\n\t\t\t\t\t.catch(onUnexpectedError);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setChildren(node: IAsyncDataTreeNode<TInput, T>, childrenElementsIterable: Iterable<T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): IAsyncDataTreeNode<TInput, T>[] {\n\t\tconst childrenElements = [...childrenElementsIterable];\n\n\t\t// perf: if the node was and still is a leaf, avoid all this hassle\n\t\tif (node.children.length === 0 && childrenElements.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst nodesToForget = new Map<T, IAsyncDataTreeNode<TInput, T>>();\n\t\tconst childrenTreeNodesById = new Map<string, { node: IAsyncDataTreeNode<TInput, T>; collapsed: boolean }>();\n\n\t\tfor (const child of node.children) {\n\t\t\tnodesToForget.set(child.element as T, child);\n\n\t\t\tif (this.identityProvider) {\n\t\t\t\tconst collapsed = this.tree.isCollapsed(child);\n\t\t\t\tchildrenTreeNodesById.set(child.id!, { node: child, collapsed });\n\t\t\t}\n\t\t}\n\n\t\tconst childrenToRefresh: IAsyncDataTreeNode<TInput, T>[] = [];\n\n\t\tconst children = childrenElements.map<IAsyncDataTreeNode<TInput, T>>(element => {\n\t\t\tconst hasChildren = !!this.dataSource.hasChildren(element);\n\n\t\t\tif (!this.identityProvider) {\n\t\t\t\tconst asyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, hasChildren });\n\n\t\t\t\tif (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) {\n\t\t\t\t\tasyncDataTreeNode.collapsedByDefault = false;\n\t\t\t\t\tchildrenToRefresh.push(asyncDataTreeNode);\n\t\t\t\t}\n\n\t\t\t\treturn asyncDataTreeNode;\n\t\t\t}\n\n\t\t\tconst id = this.identityProvider.getId(element).toString();\n\t\t\tconst result = childrenTreeNodesById.get(id);\n\n\t\t\tif (result) {\n\t\t\t\tconst asyncDataTreeNode = result.node;\n\n\t\t\t\tnodesToForget.delete(asyncDataTreeNode.element as T);\n\t\t\t\tthis.nodes.delete(asyncDataTreeNode.element as T);\n\t\t\t\tthis.nodes.set(element, asyncDataTreeNode);\n\n\t\t\t\tasyncDataTreeNode.element = element;\n\t\t\t\tasyncDataTreeNode.hasChildren = hasChildren;\n\n\t\t\t\tif (recursive) {\n\t\t\t\t\tif (result.collapsed) {\n\t\t\t\t\t\tasyncDataTreeNode.children.forEach(node => dfs(node, node => this.nodes.delete(node.element as T)));\n\t\t\t\t\t\tasyncDataTreeNode.children.splice(0, asyncDataTreeNode.children.length);\n\t\t\t\t\t\tasyncDataTreeNode.stale = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchildrenToRefresh.push(asyncDataTreeNode);\n\t\t\t\t\t}\n\t\t\t\t} else if (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) {\n\t\t\t\t\tasyncDataTreeNode.collapsedByDefault = false;\n\t\t\t\t\tchildrenToRefresh.push(asyncDataTreeNode);\n\t\t\t\t}\n\n\t\t\t\treturn asyncDataTreeNode;\n\t\t\t}\n\n\t\t\tconst childAsyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, id, hasChildren });\n\n\t\t\tif (viewStateContext && viewStateContext.viewState.focus && viewStateContext.viewState.focus.indexOf(id) > -1) {\n\t\t\t\tviewStateContext.focus.push(childAsyncDataTreeNode);\n\t\t\t}\n\n\t\t\tif (viewStateContext && viewStateContext.viewState.selection && viewStateContext.viewState.selection.indexOf(id) > -1) {\n\t\t\t\tviewStateContext.selection.push(childAsyncDataTreeNode);\n\t\t\t}\n\n\t\t\tif (viewStateContext && viewStateContext.viewState.expanded && viewStateContext.viewState.expanded.indexOf(id) > -1) {\n\t\t\t\tchildrenToRefresh.push(childAsyncDataTreeNode);\n\t\t\t} else if (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) {\n\t\t\t\tchildAsyncDataTreeNode.collapsedByDefault = false;\n\t\t\t\tchildrenToRefresh.push(childAsyncDataTreeNode);\n\t\t\t}\n\n\t\t\treturn childAsyncDataTreeNode;\n\t\t});\n\n\t\tfor (const node of nodesToForget.values()) {\n\t\t\tdfs(node, node => this.nodes.delete(node.element as T));\n\t\t}\n\n\t\tfor (const child of children) {\n\t\t\tthis.nodes.set(child.element as T, child);\n\t\t}\n\n\t\tnode.children.splice(0, node.children.length, ...children);\n\n\t\t// TODO@joao this doesn't take filter into account\n\t\tif (node !== this.root && this.autoExpandSingleChildren && children.length === 1 && childrenToRefresh.length === 0) {\n\t\t\tchildren[0].collapsedByDefault = false;\n\t\t\tchildrenToRefresh.push(children[0]);\n\t\t}\n\n\t\treturn childrenToRefresh;\n\t}\n\n\tprotected render(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>, options?: IAsyncDataTreeUpdateChildrenOptions<T>): void {\n\t\tconst children = node.children.map(node => this.asTreeElement(node, viewStateContext));\n\t\tconst objectTreeOptions: IObjectTreeSetChildrenOptions<IAsyncDataTreeNode<TInput, T>> | undefined = options && {\n\t\t\t...options,\n\t\t\tdiffIdentityProvider: options!.diffIdentityProvider && {\n\t\t\t\tgetId(node: IAsyncDataTreeNode<TInput, T>): { toString(): string } {\n\t\t\t\t\treturn options!.diffIdentityProvider!.getId(node.element as T);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.tree.setChildren(node === this.root ? null : node, children, objectTreeOptions);\n\n\t\tif (node !== this.root) {\n\t\t\tthis.tree.setCollapsible(node, node.hasChildren);\n\t\t}\n\n\t\tthis._onDidRender.fire();\n\t}\n\n\tprotected asTreeElement(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): ITreeElement<IAsyncDataTreeNode<TInput, T>> {\n\t\tif (node.stale) {\n\t\t\treturn {\n\t\t\t\telement: node,\n\t\t\t\tcollapsible: node.hasChildren,\n\t\t\t\tcollapsed: true\n\t\t\t};\n\t\t}\n\n\t\tlet collapsed: boolean | undefined;\n\n\t\tif (viewStateContext && viewStateContext.viewState.expanded && node.id && viewStateContext.viewState.expanded.indexOf(node.id) > -1) {\n\t\t\tcollapsed = false;\n\t\t} else {\n\t\t\tcollapsed = node.collapsedByDefault;\n\t\t}\n\n\t\tnode.collapsedByDefault = undefined;\n\n\t\treturn {\n\t\t\telement: node,\n\t\t\tchildren: node.hasChildren ? Iterable.map(node.children, child => this.asTreeElement(child, viewStateContext)) : [],\n\t\t\tcollapsible: node.hasChildren,\n\t\t\tcollapsed\n\t\t};\n\t}\n\n\tprotected processChildren(children: Iterable<T>): Iterable<T> {\n\t\tif (this.sorter) {\n\t\t\tchildren = [...children].sort(this.sorter.compare.bind(this.sorter));\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables.dispose();\n\t}\n}\n\ntype CompressibleAsyncDataTreeNodeMapper<TInput, T, TFilterData> = WeakMapper<ITreeNode<ICompressedTreeNode<IAsyncDataTreeNode<TInput, T>>, TFilterData>, ITreeNode<ICompressedTreeNode<TInput | T>, TFilterData>>;\n\nclass CompressibleAsyncDataTreeNodeWrapper<TInput, T, TFilterData> implements ITreeNode<ICompressedTreeNode<TInput | T>, TFilterData> {\n\n\tget element(): ICompressedTreeNode<TInput | T> {\n\t\treturn {\n\t\t\telements: this.node.element.elements.map(e => e.element),\n\t\t\tincompressible: this.node.element.incompressible\n\t\t};\n\t}\n\n\tget children(): ITreeNode<ICompressedTreeNode<TInput | T>, TFilterData>[] { return this.node.children.map(node => new CompressibleAsyncDataTreeNodeWrapper(node)); }\n\tget depth(): number { return this.node.depth; }\n\tget visibleChildrenCount(): number { return this.node.visibleChildrenCount; }\n\tget visibleChildIndex(): number { return this.node.visibleChildIndex; }\n\tget collapsible(): boolean { return this.node.collapsible; }\n\tget collapsed(): boolean { return this.node.collapsed; }\n\tget visible(): boolean { return this.node.visible; }\n\tget filterData(): TFilterData | undefined { return this.node.filterData; }\n\n\tconstructor(private node: ITreeNode<ICompressedTreeNode<IAsyncDataTreeNode<TInput, T>>, TFilterData>) { }\n}\n\nclass CompressibleAsyncDataTreeRenderer<TInput, T, TFilterData, TTemplateData> implements ICompressibleTreeRenderer<IAsyncDataTreeNode<TInput, T>, TFilterData, IDataTreeListTemplateData<TTemplateData>> {\n\n\treadonly templateId: string;\n\tprivate renderedNodes = new Map<IAsyncDataTreeNode<TInput, T>, IDataTreeListTemplateData<TTemplateData>>();\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprotected renderer: ICompressibleTreeRenderer<T, TFilterData, TTemplateData>,\n\t\tprotected nodeMapper: AsyncDataTreeNodeMapper<TInput, T, TFilterData>,\n\t\tprivate compressibleNodeMapperProvider: () => CompressibleAsyncDataTreeNodeMapper<TInput, T, TFilterData>,\n\t\treadonly onDidChangeTwistieState: Event<IAsyncDataTreeNode<TInput, T>>\n\t) {\n\t\tthis.templateId = renderer.templateId;\n\t}\n\n\trenderTemplate(container: HTMLElement): IDataTreeListTemplateData<TTemplateData> {\n\t\tconst templateData = this.renderer.renderTemplate(container);\n\t\treturn { templateData };\n\t}\n\n\trenderElement(node: ITreeNode<IAsyncDataTreeNode<TInput, T>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tthis.renderer.renderElement(this.nodeMapper.map(node) as ITreeNode<T, TFilterData>, index, templateData.templateData, height);\n\t}\n\n\trenderCompressedElements(node: ITreeNode<ICompressedTreeNode<IAsyncDataTreeNode<TInput, T>>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tthis.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(node) as ITreeNode<ICompressedTreeNode<T>, TFilterData>, index, templateData.templateData, height);\n\t}\n\n\trenderTwistie(element: IAsyncDataTreeNode<TInput, T>, twistieElement: HTMLElement): boolean {\n\t\tif (element.slow) {\n\t\t\ttwistieElement.classList.add(...Codicon.treeItemLoading.classNamesArray);\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttwistieElement.classList.remove(...Codicon.treeItemLoading.classNamesArray);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tdisposeElement(node: ITreeNode<IAsyncDataTreeNode<TInput, T>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tif (this.renderer.disposeElement) {\n\t\t\tthis.renderer.disposeElement(this.nodeMapper.map(node) as ITreeNode<T, TFilterData>, index, templateData.templateData, height);\n\t\t}\n\t}\n\n\tdisposeCompressedElements(node: ITreeNode<ICompressedTreeNode<IAsyncDataTreeNode<TInput, T>>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, height: number | undefined): void {\n\t\tif (this.renderer.disposeCompressedElements) {\n\t\t\tthis.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(node) as ITreeNode<ICompressedTreeNode<T>, TFilterData>, index, templateData.templateData, height);\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: IDataTreeListTemplateData<TTemplateData>): void {\n\t\tthis.renderer.disposeTemplate(templateData.templateData);\n\t}\n\n\tdispose(): void {\n\t\tthis.renderedNodes.clear();\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n}\n\nexport interface ITreeCompressionDelegate<T> {\n\tisIncompressible(element: T): boolean;\n}\n\nfunction asCompressibleObjectTreeOptions<TInput, T, TFilterData>(options?: ICompressibleAsyncDataTreeOptions<T, TFilterData>): ICompressibleObjectTreeOptions<IAsyncDataTreeNode<TInput, T>, TFilterData> | undefined {\n\tconst objectTreeOptions = options && asObjectTreeOptions(options);\n\n\treturn objectTreeOptions && {\n\t\t...objectTreeOptions,\n\t\tkeyboardNavigationLabelProvider: objectTreeOptions.keyboardNavigationLabelProvider && {\n\t\t\t...objectTreeOptions.keyboardNavigationLabelProvider,\n\t\t\tgetCompressedNodeKeyboardNavigationLabel(els) {\n\t\t\t\treturn options!.keyboardNavigationLabelProvider!.getCompressedNodeKeyboardNavigationLabel(els.map(e => e.element as T));\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport interface ICompressibleAsyncDataTreeOptions<T, TFilterData = void> extends IAsyncDataTreeOptions<T, TFilterData> {\n\treadonly keyboardNavigationLabelProvider?: ICompressibleKeyboardNavigationLabelProvider<T>;\n}\n\nexport interface ICompressibleAsyncDataTreeOptionsUpdate extends IAsyncDataTreeOptionsUpdate {\n}\n\nexport class CompressibleAsyncDataTree<TInput, T, TFilterData = void> extends AsyncDataTree<TInput, T, TFilterData> {\n\n\tprotected override readonly tree!: CompressibleObjectTree<IAsyncDataTreeNode<TInput, T>, TFilterData>;\n\tprotected readonly compressibleNodeMapper: CompressibleAsyncDataTreeNodeMapper<TInput, T, TFilterData> = new WeakMapper(node => new CompressibleAsyncDataTreeNodeWrapper(node));\n\tprivate filter?: ITreeFilter<T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tvirtualDelegate: IListVirtualDelegate<T>,\n\t\tprivate compressionDelegate: ITreeCompressionDelegate<T>,\n\t\trenderers: ICompressibleTreeRenderer<T, TFilterData, any>[],\n\t\tdataSource: IAsyncDataSource<TInput, T>,\n\t\toptions: ICompressibleAsyncDataTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tsuper(user, container, virtualDelegate, renderers, dataSource, options);\n\t\tthis.filter = options.filter;\n\t}\n\n\tprotected override createTree(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ICompressibleTreeRenderer<T, TFilterData, any>[],\n\t\toptions: ICompressibleAsyncDataTreeOptions<T, TFilterData>\n\t): ObjectTree<IAsyncDataTreeNode<TInput, T>, TFilterData> {\n\t\tconst objectTreeDelegate = new ComposedTreeDelegate<TInput | T, IAsyncDataTreeNode<TInput, T>>(delegate);\n\t\tconst objectTreeRenderers = renderers.map(r => new CompressibleAsyncDataTreeRenderer(r, this.nodeMapper, () => this.compressibleNodeMapper, this._onDidChangeNodeSlowState.event));\n\t\tconst objectTreeOptions = asCompressibleObjectTreeOptions<TInput, T, TFilterData>(options) || {};\n\n\t\treturn new CompressibleObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions);\n\t}\n\n\tprotected override asTreeElement(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): ICompressedTreeElement<IAsyncDataTreeNode<TInput, T>> {\n\t\treturn {\n\t\t\tincompressible: this.compressionDelegate.isIncompressible(node.element as T),\n\t\t\t...super.asTreeElement(node, viewStateContext)\n\t\t};\n\t}\n\n\toverride updateOptions(options: ICompressibleAsyncDataTreeOptionsUpdate = {}): void {\n\t\tthis.tree.updateOptions(options);\n\t}\n\n\tprotected override render(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): void {\n\t\tif (!this.identityProvider) {\n\t\t\treturn super.render(node, viewStateContext);\n\t\t}\n\n\t\t// Preserve traits across compressions. Hacky but does the trick.\n\t\t// This is hard to fix properly since it requires rewriting the traits\n\t\t// across trees and lists. Let's just keep it this way for now.\n\t\tconst getId = (element: T) => this.identityProvider!.getId(element).toString();\n\t\tconst getUncompressedIds = (nodes: IAsyncDataTreeNode<TInput, T>[]): Set<string> => {\n\t\t\tconst result = new Set<string>();\n\n\t\t\tfor (const node of nodes) {\n\t\t\t\tconst compressedNode = this.tree.getCompressedTreeNode(node === this.root ? null : node);\n\n\t\t\t\tif (!compressedNode.element) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (const node of compressedNode.element.elements) {\n\t\t\t\t\tresult.add(getId(node.element as T));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\n\t\tconst oldSelection = getUncompressedIds(this.tree.getSelection() as IAsyncDataTreeNode<TInput, T>[]);\n\t\tconst oldFocus = getUncompressedIds(this.tree.getFocus() as IAsyncDataTreeNode<TInput, T>[]);\n\n\t\tsuper.render(node, viewStateContext);\n\n\t\tconst selection = this.getSelection();\n\t\tlet didChangeSelection = false;\n\n\t\tconst focus = this.getFocus();\n\t\tlet didChangeFocus = false;\n\n\t\tconst visit = (node: ITreeNode<ICompressedTreeNode<IAsyncDataTreeNode<TInput, T>> | null, TFilterData>) => {\n\t\t\tconst compressedNode = node.element;\n\n\t\t\tif (compressedNode) {\n\t\t\t\tfor (let i = 0; i < compressedNode.elements.length; i++) {\n\t\t\t\t\tconst id = getId(compressedNode.elements[i].element as T);\n\t\t\t\t\tconst element = compressedNode.elements[compressedNode.elements.length - 1].element as T;\n\n\t\t\t\t\t// github.com/microsoft/vscode/issues/85938\n\t\t\t\t\tif (oldSelection.has(id) && selection.indexOf(element) === -1) {\n\t\t\t\t\t\tselection.push(element);\n\t\t\t\t\t\tdidChangeSelection = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oldFocus.has(id) && focus.indexOf(element) === -1) {\n\t\t\t\t\t\tfocus.push(element);\n\t\t\t\t\t\tdidChangeFocus = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.children.forEach(visit);\n\t\t};\n\n\t\tvisit(this.tree.getCompressedTreeNode(node === this.root ? null : node));\n\n\t\tif (didChangeSelection) {\n\t\t\tthis.setSelection(selection);\n\t\t}\n\n\t\tif (didChangeFocus) {\n\t\t\tthis.setFocus(focus);\n\t\t}\n\t}\n\n\t// For compressed async data trees, `TreeVisibility.Recurse` doesn't currently work\n\t// and we have to filter everything beforehand\n\t// Related to #85193 and #85835\n\tprotected override processChildren(children: Iterable<T>): Iterable<T> {\n\t\tif (this.filter) {\n\t\t\tchildren = Iterable.filter(children, e => {\n\t\t\t\tconst result = this.filter!.filter(e, TreeVisibility.Visible);\n\t\t\t\tconst visibility = getVisibility(result);\n\n\t\t\t\tif (visibility === TreeVisibility.Recurse) {\n\t\t\t\t\tthrow new Error('Recursive tree visibility not supported in async data compressed trees');\n\t\t\t\t}\n\n\t\t\t\treturn visibility === TreeVisibility.Visible;\n\t\t\t});\n\t\t}\n\n\t\treturn super.processChildren(children);\n\t}\n}\n\nfunction getVisibility<TFilterData>(filterResult: TreeFilterResult<TFilterData>): TreeVisibility {\n\tif (typeof filterResult === 'boolean') {\n\t\treturn filterResult ? TreeVisibility.Visible : TreeVisibility.Hidden;\n\t} else if (isFilterResult(filterResult)) {\n\t\treturn getVisibleState(filterResult.visibility);\n\t} else {\n\t\treturn getVisibleState(filterResult);\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport * as nls from 'vs/nls';\n\nexport interface ITelemetryData {\n\t[key: string]: unknown;\n}\n\nexport type WorkbenchActionExecutedClassification = {\n\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\tfrom: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n};\n\nexport type WorkbenchActionExecutedEvent = {\n\tid: string;\n\tfrom: string;\n};\n\nexport interface IAction extends IDisposable {\n\treadonly id: string;\n\tlabel: string;\n\ttooltip: string;\n\tclass: string | undefined;\n\tenabled: boolean;\n\tchecked?: boolean;\n\trun(event?: unknown): unknown;\n}\n\nexport interface IActionRunner extends IDisposable {\n\treadonly onDidRun: Event<IRunEvent>;\n\treadonly onBeforeRun: Event<IRunEvent>;\n\n\trun(action: IAction, context?: unknown): unknown;\n}\n\nexport interface IActionChangeEvent {\n\treadonly label?: string;\n\treadonly tooltip?: string;\n\treadonly class?: string;\n\treadonly enabled?: boolean;\n\treadonly checked?: boolean;\n}\n\nexport class Action extends Disposable implements IAction {\n\n\tprotected _onDidChange = this._register(new Emitter<IActionChangeEvent>());\n\treadonly onDidChange = this._onDidChange.event;\n\n\tprotected readonly _id: string;\n\tprotected _label: string;\n\tprotected _tooltip: string | undefined;\n\tprotected _cssClass: string | undefined;\n\tprotected _enabled: boolean = true;\n\tprotected _checked?: boolean;\n\tprotected readonly _actionCallback?: (event?: unknown) => unknown;\n\n\tconstructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: unknown) => unknown) {\n\t\tsuper();\n\t\tthis._id = id;\n\t\tthis._label = label;\n\t\tthis._cssClass = cssClass;\n\t\tthis._enabled = enabled;\n\t\tthis._actionCallback = actionCallback;\n\t}\n\n\tget id(): string {\n\t\treturn this._id;\n\t}\n\n\tget label(): string {\n\t\treturn this._label;\n\t}\n\n\tset label(value: string) {\n\t\tthis._setLabel(value);\n\t}\n\n\tprivate _setLabel(value: string): void {\n\t\tif (this._label !== value) {\n\t\t\tthis._label = value;\n\t\t\tthis._onDidChange.fire({ label: value });\n\t\t}\n\t}\n\n\tget tooltip(): string {\n\t\treturn this._tooltip || '';\n\t}\n\n\tset tooltip(value: string) {\n\t\tthis._setTooltip(value);\n\t}\n\n\tprotected _setTooltip(value: string): void {\n\t\tif (this._tooltip !== value) {\n\t\t\tthis._tooltip = value;\n\t\t\tthis._onDidChange.fire({ tooltip: value });\n\t\t}\n\t}\n\n\tget class(): string | undefined {\n\t\treturn this._cssClass;\n\t}\n\n\tset class(value: string | undefined) {\n\t\tthis._setClass(value);\n\t}\n\n\tprotected _setClass(value: string | undefined): void {\n\t\tif (this._cssClass !== value) {\n\t\t\tthis._cssClass = value;\n\t\t\tthis._onDidChange.fire({ class: value });\n\t\t}\n\t}\n\n\tget enabled(): boolean {\n\t\treturn this._enabled;\n\t}\n\n\tset enabled(value: boolean) {\n\t\tthis._setEnabled(value);\n\t}\n\n\tprotected _setEnabled(value: boolean): void {\n\t\tif (this._enabled !== value) {\n\t\t\tthis._enabled = value;\n\t\t\tthis._onDidChange.fire({ enabled: value });\n\t\t}\n\t}\n\n\tget checked(): boolean | undefined {\n\t\treturn this._checked;\n\t}\n\n\tset checked(value: boolean | undefined) {\n\t\tthis._setChecked(value);\n\t}\n\n\tprotected _setChecked(value: boolean | undefined): void {\n\t\tif (this._checked !== value) {\n\t\t\tthis._checked = value;\n\t\t\tthis._onDidChange.fire({ checked: value });\n\t\t}\n\t}\n\n\tasync run(event?: unknown, data?: ITelemetryData): Promise<void> {\n\t\tif (this._actionCallback) {\n\t\t\tawait this._actionCallback(event);\n\t\t}\n\t}\n}\n\nexport interface IRunEvent {\n\treadonly action: IAction;\n\treadonly error?: Error;\n}\n\nexport class ActionRunner extends Disposable implements IActionRunner {\n\n\tprivate _onBeforeRun = this._register(new Emitter<IRunEvent>());\n\treadonly onBeforeRun = this._onBeforeRun.event;\n\n\tprivate _onDidRun = this._register(new Emitter<IRunEvent>());\n\treadonly onDidRun = this._onDidRun.event;\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tif (!action.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onBeforeRun.fire({ action });\n\n\t\tlet error: Error | undefined = undefined;\n\t\ttry {\n\t\t\tawait this.runAction(action, context);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\n\t\tthis._onDidRun.fire({ action, error });\n\t}\n\n\tprotected async runAction(action: IAction, context?: unknown): Promise<void> {\n\t\tawait action.run(context);\n\t}\n}\n\nexport class Separator extends Action {\n\n\tstatic readonly ID = 'vs.actions.separator';\n\n\tconstructor(label?: string) {\n\t\tsuper(Separator.ID, label, label ? 'separator text' : 'separator');\n\n\t\tthis.checked = false;\n\t\tthis.enabled = false;\n\t}\n}\n\nexport class SubmenuAction implements IAction {\n\n\treadonly id: string;\n\treadonly label: string;\n\treadonly class: string | undefined;\n\treadonly tooltip: string = '';\n\treadonly enabled: boolean = true;\n\treadonly checked: undefined = undefined;\n\n\tprivate readonly _actions: readonly IAction[];\n\tget actions(): readonly IAction[] { return this._actions; }\n\n\tconstructor(id: string, label: string, actions: readonly IAction[], cssClass?: string) {\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.class = cssClass;\n\t\tthis._actions = actions;\n\t}\n\n\tdispose(): void {\n\t\t// there is NOTHING to dispose and the SubmenuAction should\n\t\t// never have anything to dispose as it is a convenience type\n\t\t// to bridge into the rendering world.\n\t}\n\n\tasync run(): Promise<void> { }\n}\n\nexport class EmptySubmenuAction extends Action {\n\n\tstatic readonly ID = 'vs.actions.empty';\n\n\tconstructor() {\n\t\tsuper(EmptySubmenuAction.ID, nls.localize('submenu.empty', '(empty)'), undefined, false);\n\t}\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 { isFirefox } from 'vs/base/browser/browser';\nimport { DataTransfers } from 'vs/base/browser/dnd';\nimport { $, addDisposableListener, append, EventHelper, EventLike, EventType } from 'vs/base/browser/dom';\nimport { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch';\nimport { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { Action, ActionRunner, IAction, IActionChangeEvent, IActionRunner, Separator } from 'vs/base/common/actions';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as types from 'vs/base/common/types';\nimport 'vs/css!./actionbar';\nimport * as nls from 'vs/nls';\n\nexport interface IBaseActionViewItemOptions {\n\tdraggable?: boolean;\n\tisMenu?: boolean;\n\tuseEventAsContext?: boolean;\n}\n\nexport class BaseActionViewItem extends Disposable implements IActionViewItem {\n\n\telement: HTMLElement | undefined;\n\n\t_context: unknown;\n\t_action: IAction;\n\n\tprivate _actionRunner: IActionRunner | undefined;\n\n\tconstructor(context: unknown, action: IAction, protected options: IBaseActionViewItemOptions = {}) {\n\t\tsuper();\n\n\t\tthis._context = context || this;\n\t\tthis._action = action;\n\n\t\tif (action instanceof Action) {\n\t\t\tthis._register(action.onDidChange(event => {\n\t\t\t\tif (!this.element) {\n\t\t\t\t\t// we have not been rendered yet, so there\n\t\t\t\t\t// is no point in updating the UI\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.handleActionChangeEvent(event);\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate handleActionChangeEvent(event: IActionChangeEvent): void {\n\t\tif (event.enabled !== undefined) {\n\t\t\tthis.updateEnabled();\n\t\t}\n\n\t\tif (event.checked !== undefined) {\n\t\t\tthis.updateChecked();\n\t\t}\n\n\t\tif (event.class !== undefined) {\n\t\t\tthis.updateClass();\n\t\t}\n\n\t\tif (event.label !== undefined) {\n\t\t\tthis.updateLabel();\n\t\t\tthis.updateTooltip();\n\t\t}\n\n\t\tif (event.tooltip !== undefined) {\n\t\t\tthis.updateTooltip();\n\t\t}\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\tif (!this._actionRunner) {\n\t\t\tthis._actionRunner = this._register(new ActionRunner());\n\t\t}\n\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\t}\n\n\tgetAction(): IAction {\n\t\treturn this._action;\n\t}\n\n\tisEnabled(): boolean {\n\t\treturn this._action.enabled;\n\t}\n\n\tsetActionContext(newContext: unknown): void {\n\t\tthis._context = newContext;\n\t}\n\n\trender(container: HTMLElement): void {\n\t\tconst element = this.element = container;\n\t\tthis._register(Gesture.addTarget(container));\n\n\t\tconst enableDragging = this.options && this.options.draggable;\n\t\tif (enableDragging) {\n\t\t\tcontainer.draggable = true;\n\n\t\t\tif (isFirefox) {\n\t\t\t\t// Firefox: requires to set a text data transfer to get going\n\t\t\t\tthis._register(addDisposableListener(container, EventType.DRAG_START, e => e.dataTransfer?.setData(DataTransfers.TEXT, this._action.label)));\n\t\t\t}\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, TouchEventType.Tap, e => this.onClick(e, true))); // Preserve focus on tap #125470\n\n\t\tthis._register(addDisposableListener(element, EventType.MOUSE_DOWN, e => {\n\t\t\tif (!enableDragging) {\n\t\t\t\tEventHelper.stop(e, true); // do not run when dragging is on because that would disable it\n\t\t\t}\n\n\t\t\tif (this._action.enabled && e.button === 0) {\n\t\t\t\telement.classList.add('active');\n\t\t\t}\n\t\t}));\n\n\t\tif (platform.isMacintosh) {\n\t\t\t// macOS: allow to trigger the button when holding Ctrl+key and pressing the\n\t\t\t// main mouse button. This is for scenarios where e.g. some interaction forces\n\t\t\t// the Ctrl+key to be pressed and hold but the user still wants to interact\n\t\t\t// with the actions (for example quick access in quick navigation mode).\n\t\t\tthis._register(addDisposableListener(element, EventType.CONTEXT_MENU, e => {\n\t\t\t\tif (e.button === 0 && e.ctrlKey === true) {\n\t\t\t\t\tthis.onClick(e);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, EventType.CLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\n\t\t\t// menus do not use the click event\n\t\t\tif (!(this.options && this.options.isMenu)) {\n\t\t\t\tthis.onClick(e);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(element, EventType.DBLCLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\t\t}));\n\n\t\t[EventType.MOUSE_UP, EventType.MOUSE_OUT].forEach(event => {\n\t\t\tthis._register(addDisposableListener(element, event, e => {\n\t\t\t\tEventHelper.stop(e);\n\t\t\t\telement.classList.remove('active');\n\t\t\t}));\n\t\t});\n\t}\n\n\tonClick(event: EventLike, preserveFocus = false): void {\n\t\tEventHelper.stop(event, true);\n\n\t\tconst context = types.isUndefinedOrNull(this._context) ? this.options?.useEventAsContext ? event : { preserveFocus } : this._context;\n\t\tthis.actionRunner.run(this._action, context);\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\tfocus(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = 0;\n\t\t\tthis.element.focus();\n\t\t\tthis.element.classList.add('focused');\n\t\t}\n\t}\n\n\tblur(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.blur();\n\t\t\tthis.element.tabIndex = -1;\n\t\t\tthis.element.classList.remove('focused');\n\t\t}\n\t}\n\n\tsetFocusable(focusable: boolean): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\tget trapsArrowNavigation(): boolean {\n\t\treturn false;\n\t}\n\n\tprotected updateEnabled(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateLabel(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateTooltip(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateClass(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateChecked(): void {\n\t\t// implement in subclass\n\t}\n\n\toverride dispose(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.remove();\n\t\t\tthis.element = undefined;\n\t\t}\n\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IActionViewItemOptions extends IBaseActionViewItemOptions {\n\ticon?: boolean;\n\tlabel?: boolean;\n\tkeybinding?: string | null;\n}\n\nexport class ActionViewItem extends BaseActionViewItem {\n\n\tprotected label: HTMLElement | undefined;\n\tprotected override options: IActionViewItemOptions;\n\n\tprivate cssClass?: string;\n\n\tconstructor(context: unknown, action: IAction, options: IActionViewItemOptions = {}) {\n\t\tsuper(context, action, options);\n\n\t\tthis.options = options;\n\t\tthis.options.icon = options.icon !== undefined ? options.icon : false;\n\t\tthis.options.label = options.label !== undefined ? options.label : true;\n\t\tthis.cssClass = '';\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\n\t\tif (this.element) {\n\t\t\tthis.label = append(this.element, $('a.action-label'));\n\t\t}\n\n\t\tif (this.label) {\n\t\t\tif (this._action.id === Separator.ID) {\n\t\t\t\tthis.label.setAttribute('role', 'presentation'); // A separator is a presentation item\n\t\t\t} else {\n\t\t\t\tif (this.options.isMenu) {\n\t\t\t\t\tthis.label.setAttribute('role', 'menuitem');\n\t\t\t\t} else {\n\t\t\t\t\tthis.label.setAttribute('role', 'button');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.label && this.options.keybinding && this.element) {\n\t\t\tappend(this.element, $('span.keybinding')).textContent = this.options.keybinding;\n\t\t}\n\n\t\tthis.updateClass();\n\t\tthis.updateLabel();\n\t\tthis.updateTooltip();\n\t\tthis.updateEnabled();\n\t\tthis.updateChecked();\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\toverride focus(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = 0;\n\t\t\tthis.label.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = -1;\n\t\t}\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\toverride updateLabel(): void {\n\t\tif (this.options.label && this.label) {\n\t\t\tthis.label.textContent = this.getAction().label;\n\t\t}\n\t}\n\n\toverride updateTooltip(): void {\n\t\tlet title: string | null = null;\n\n\t\tif (this.getAction().tooltip) {\n\t\t\ttitle = this.getAction().tooltip;\n\n\t\t} else if (!this.options.label && this.getAction().label && this.options.icon) {\n\t\t\ttitle = this.getAction().label;\n\n\t\t\tif (this.options.keybinding) {\n\t\t\t\ttitle = nls.localize({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, \"{0} ({1})\", title, this.options.keybinding);\n\t\t\t}\n\t\t}\n\n\t\tif (title && this.label) {\n\t\t\tthis.label.title = title;\n\t\t}\n\t}\n\n\toverride updateClass(): void {\n\t\tif (this.cssClass && this.label) {\n\t\t\tthis.label.classList.remove(...this.cssClass.split(' '));\n\t\t}\n\n\t\tif (this.options.icon) {\n\t\t\tthis.cssClass = this.getAction().class;\n\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.classList.add('codicon');\n\t\t\t\tif (this.cssClass) {\n\t\t\t\t\tthis.label.classList.add(...this.cssClass.split(' '));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.updateEnabled();\n\t\t} else {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.classList.remove('codicon');\n\t\t\t}\n\t\t}\n\t}\n\n\toverride updateEnabled(): void {\n\t\tif (this.getAction().enabled) {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.removeAttribute('aria-disabled');\n\t\t\t\tthis.label.classList.remove('disabled');\n\t\t\t}\n\n\t\t\tif (this.element) {\n\t\t\t\tthis.element.classList.remove('disabled');\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.setAttribute('aria-disabled', 'true');\n\t\t\t\tthis.label.classList.add('disabled');\n\t\t\t}\n\n\t\t\tif (this.element) {\n\t\t\t\tthis.element.classList.add('disabled');\n\t\t\t}\n\t\t}\n\t}\n\n\toverride updateChecked(): void {\n\t\tif (this.label) {\n\t\t\tif (this.getAction().checked) {\n\t\t\t\tthis.label.classList.add('checked');\n\t\t\t} else {\n\t\t\t\tthis.label.classList.remove('checked');\n\t\t\t}\n\t\t}\n\t}\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 * as DOM from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { ActionRunner, IAction, IActionRunner, IRunEvent } from 'vs/base/common/actions';\nimport { Emitter } from 'vs/base/common/event';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport * as types from 'vs/base/common/types';\nimport 'vs/css!./actionbar';\n\nexport interface IActionViewItem extends IDisposable {\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: unknown): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void; // TODO@isidorn what is this?\n\tblur(): void;\n}\n\nexport interface IActionViewItemProvider {\n\t(action: IAction): IActionViewItem | undefined;\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tVERTICAL,\n}\n\nexport interface ActionTrigger {\n\tkeys?: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionBarOptions {\n\treadonly orientation?: ActionsOrientation;\n\treadonly context?: unknown;\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly ariaLabel?: string;\n\treadonly animated?: boolean;\n\treadonly triggerKeys?: ActionTrigger;\n\treadonly allowContextMenu?: boolean;\n\treadonly preventLoopNavigation?: boolean;\n\treadonly focusOnlyEnabledItems?: boolean;\n}\n\nexport interface IActionOptions extends IActionViewItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\tprivate readonly options: IActionBarOptions;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate _context: unknown;\n\tprivate readonly _orientation: ActionsOrientation;\n\tprivate readonly _triggerKeys: {\n\t\tkeys: KeyCode[];\n\t\tkeyDown: boolean;\n\t};\n\tprivate _actionIds: string[];\n\n\t// View Items\n\tviewItems: IActionViewItem[];\n\tprivate previouslyFocusedItem?: number;\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Trigger Key Tracking\n\tprivate triggerKeyDown: boolean = false;\n\n\tprivate focusable: boolean = true;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected actionsList: HTMLElement;\n\n\tprivate _onDidBlur = this._register(new Emitter<void>());\n\treadonly onDidBlur = this._onDidBlur.event;\n\n\tprivate _onDidCancel = this._register(new Emitter<void>({ onFirstListenerAdd: () => this.cancelHasListener = true }));\n\treadonly onDidCancel = this._onDidCancel.event;\n\tprivate cancelHasListener = false;\n\n\tprivate _onDidRun = this._register(new Emitter<IRunEvent>());\n\treadonly onDidRun = this._onDidRun.event;\n\n\tprivate _onBeforeRun = this._register(new Emitter<IRunEvent>());\n\treadonly onBeforeRun = this._onBeforeRun.event;\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = {}) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context ?? null;\n\t\tthis._orientation = this.options.orientation ?? ActionsOrientation.HORIZONTAL;\n\t\tthis._triggerKeys = {\n\t\t\tkeyDown: this.options.triggerKeys?.keyDown ?? false,\n\t\t\tkeys: this.options.triggerKeys?.keys ?? [KeyCode.Enter, KeyCode.Space]\n\t\t};\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis._actionRunner = this.options.actionRunner;\n\t\t} else {\n\t\t\tthis._actionRunner = new ActionRunner();\n\t\t\tthis._register(this._actionRunner);\n\t\t}\n\n\t\tthis._register(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._register(this._actionRunner.onBeforeRun(e => this._onBeforeRun.fire(e)));\n\n\t\tthis._actionIds = [];\n\t\tthis.viewItems = [];\n\t\tthis.focusedItem = undefined;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-action-bar';\n\n\t\tif (options.animated !== false) {\n\t\t\tthis.domNode.classList.add('animated');\n\t\t}\n\n\t\tlet previousKeys: KeyCode[];\n\t\tlet nextKeys: KeyCode[];\n\n\t\tswitch (this._orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKeys = [KeyCode.LeftArrow];\n\t\t\t\tnextKeys = [KeyCode.RightArrow];\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKeys = [KeyCode.UpArrow];\n\t\t\t\tnextKeys = [KeyCode.DownArrow];\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = true;\n\t\t\tconst focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined;\n\n\t\t\tif (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) {\n\t\t\t\teventHandled = this.focusPrevious();\n\t\t\t} else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape) && this.cancelHasListener) {\n\t\t\t\tthis._onDidCancel.fire();\n\t\t\t} else if (event.equals(KeyCode.Home)) {\n\t\t\t\teventHandled = this.focusFirst();\n\t\t\t} else if (event.equals(KeyCode.End)) {\n\t\t\t\teventHandled = this.focusLast();\n\t\t\t} else if (event.equals(KeyCode.Tab) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (this.isTriggerKeyEvent(event)) {\n\t\t\t\t// Staying out of the else branch even if not triggered\n\t\t\t\tif (this._triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerKeyDown = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventHandled = false;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Run action on Enter/Space\n\t\t\tif (this.isTriggerKeyEvent(event)) {\n\t\t\t\tif (!this._triggerKeys.keyDown && this.triggerKeyDown) {\n\t\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t// Recompute focused item\n\t\t\telse if (event.equals(KeyCode.Tab) || event.equals(KeyMod.Shift | KeyCode.Tab)) {\n\t\t\t\tthis.updateFocusedItem();\n\t\t\t}\n\t\t}));\n\n\t\tthis.focusTracker = this._register(DOM.trackFocus(this.domNode));\n\t\tthis._register(this.focusTracker.onDidBlur(() => {\n\t\t\tif (DOM.getActiveElement() === this.domNode || !DOM.isAncestor(DOM.getActiveElement(), this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem()));\n\n\t\tthis.actionsList = document.createElement('ul');\n\t\tthis.actionsList.className = 'actions-container';\n\t\tthis.actionsList.setAttribute('role', 'toolbar');\n\n\t\tif (this.options.ariaLabel) {\n\t\t\tthis.actionsList.setAttribute('aria-label', this.options.ariaLabel);\n\t\t}\n\n\t\tthis.domNode.appendChild(this.actionsList);\n\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tprivate refreshRole(): void {\n\t\tif (this.length() >= 2) {\n\t\t\tthis.actionsList.setAttribute('role', 'toolbar');\n\t\t} else {\n\t\t\tthis.actionsList.setAttribute('role', 'presentation');\n\t\t}\n\t}\n\n\t// Some action bars should not be focusable at times\n\t// When an action bar is not focusable make sure to make all the elements inside it not focusable\n\t// When an action bar is focusable again, make sure the first item can be focused\n\tsetFocusable(focusable: boolean): void {\n\t\tthis.focusable = focusable;\n\t\tif (this.focusable) {\n\t\t\tconst firstEnabled = this.viewItems.find(vi => vi instanceof BaseActionViewItem && vi.isEnabled());\n\t\t\tif (firstEnabled instanceof BaseActionViewItem) {\n\t\t\t\tfirstEnabled.setFocusable(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.viewItems.forEach(vi => {\n\t\t\t\tif (vi instanceof BaseActionViewItem) {\n\t\t\t\t\tvi.setFocusable(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tthis._triggerKeys.keys.forEach(keyCode => {\n\t\t\tret = ret || event.equals(keyCode);\n\t\t});\n\n\t\treturn ret;\n\t}\n\n\tprivate updateFocusedItem(): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tconst elem = this.actionsList.children[i];\n\t\t\tif (DOM.isAncestor(DOM.getActiveElement(), elem)) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tget context(): unknown {\n\t\treturn this._context;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis._context = context;\n\t\tthis.viewItems.forEach(i => i.setActionContext(context));\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tif (actionRunner) {\n\t\t\tthis._actionRunner = actionRunner;\n\t\t\tthis.viewItems.forEach(item => item.actionRunner = actionRunner);\n\t\t}\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tpush(arg: IAction | ReadonlyArray<IAction>, options: IActionOptions = {}): void {\n\t\tconst actions: ReadonlyArray<IAction> = Array.isArray(arg) ? arg : [arg];\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionViewItemElement = document.createElement('li');\n\t\t\tactionViewItemElement.className = 'action-item';\n\t\t\tactionViewItemElement.setAttribute('role', 'presentation');\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tif (!this.options.allowContextMenu) {\n\t\t\t\tthis._register(DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tlet item: IActionViewItem | undefined;\n\n\t\t\tif (this.options.actionViewItemProvider) {\n\t\t\t\titem = this.options.actionViewItemProvider(action);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionViewItem(this.context, action, options);\n\t\t\t}\n\n\t\t\titem.actionRunner = this._actionRunner;\n\t\t\titem.setActionContext(this.context);\n\t\t\titem.render(actionViewItemElement);\n\n\t\t\tif (this.focusable && item instanceof BaseActionViewItem && this.viewItems.length === 0) {\n\t\t\t\t// We need to allow for the first enabled item to be focused on using tab navigation #106441\n\t\t\t\titem.setFocusable(true);\n\t\t\t}\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionViewItemElement);\n\t\t\t\tthis.viewItems.push(item);\n\t\t\t\tthis._actionIds.push(action.id);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.viewItems.splice(index, 0, item);\n\t\t\t\tthis._actionIds.splice(index, 0, action.id);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\t\tif (typeof this.focusedItem === 'number') {\n\t\t\t// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128\n\t\t\tthis.focus(this.focusedItem);\n\t\t}\n\t\tthis.refreshRole();\n\t}\n\n\tclear(): void {\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\t\tthis._actionIds = [];\n\t\tDOM.clearNode(this.actionsList);\n\t\tthis.refreshRole();\n\t}\n\n\tlength(): number {\n\t\treturn this.viewItems.length;\n\t}\n\n\tfocus(index?: number): void;\n\tfocus(selectFirst?: boolean): void;\n\tfocus(arg?: number | boolean): void {\n\t\tlet selectFirst: boolean = false;\n\t\tlet index: number | undefined = undefined;\n\t\tif (arg === undefined) {\n\t\t\tselectFirst = true;\n\t\t} else if (typeof arg === 'number') {\n\t\t\tindex = arg;\n\t\t} else if (typeof arg === 'boolean') {\n\t\t\tselectFirst = arg;\n\t\t}\n\n\t\tif (selectFirst && typeof this.focusedItem === 'undefined') {\n\t\t\tconst firstEnabled = this.viewItems.findIndex(item => item.isEnabled());\n\t\t\t// Focus the first enabled item\n\t\t\tthis.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t} else {\n\t\t\tif (index !== undefined) {\n\t\t\t\tthis.focusedItem = index;\n\t\t\t}\n\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t}\n\t}\n\n\tprivate focusFirst(): boolean {\n\t\tthis.focusedItem = this.length() - 1;\n\t\treturn this.focusNext(true);\n\t}\n\n\tprivate focusLast(): boolean {\n\t\tthis.focusedItem = 0;\n\t\treturn this.focusPrevious(true);\n\t}\n\n\tprotected focusNext(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\t\tdo {\n\n\t\t\tif (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) {\n\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.viewItems.length;\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && this.options.focusOnlyEnabledItems && !item.isEnabled());\n\n\t\tthis.updateFocus();\n\t\treturn true;\n\t}\n\n\tprotected focusPrevious(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tif (!forceLoop && this.options.preventLoopNavigation) {\n\t\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t}\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && this.options.focusOnlyEnabledItems && !item.isEnabled());\n\n\n\t\tthis.updateFocus(true);\n\t\treturn true;\n\t}\n\n\tprotected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t}\n\n\t\tif (this.previouslyFocusedItem !== undefined && this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\tthis.viewItems[this.previouslyFocusedItem]?.blur();\n\t\t}\n\n\t\tconst actionViewItem = this.focusedItem !== undefined && this.viewItems[this.focusedItem];\n\t\tif (actionViewItem) {\n\t\t\tlet focusItem = true;\n\n\t\t\tif (!types.isFunction(actionViewItem.focus)) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (this.options.focusOnlyEnabledItems && types.isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (!focusItem) {\n\t\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\t\tactionViewItem.focus(fromRight);\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doTrigger(event: StandardKeyboardEvent): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\treturn; //nothing to focus\n\t\t}\n\n\t\t// trigger action\n\t\tconst actionViewItem = this.viewItems[this.focusedItem];\n\t\tif (actionViewItem instanceof BaseActionViewItem) {\n\t\t\tconst context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;\n\t\t\tthis.run(actionViewItem._action, context);\n\t\t}\n\t}\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tawait this._actionRunner.run(action, context);\n\t}\n\n\toverride dispose(): void {\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis._actionIds = [];\n\n\t\tthis.getContainer().remove();\n\n\t\tsuper.dispose();\n\t}\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 { IContextMenuProvider } from 'vs/base/browser/contextmenu';\nimport { $, addDisposableListener, append, EventHelper, EventType } from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { EventType as GestureEventType, Gesture } from 'vs/base/browser/touch';\nimport { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';\nimport { IMenuOptions } from 'vs/base/browser/ui/menu/menu';\nimport { ActionRunner, IAction } from 'vs/base/common/actions';\nimport { Emitter } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./dropdown';\n\nexport interface ILabelRenderer {\n\t(container: HTMLElement): IDisposable | null;\n}\n\nexport interface IBaseDropdownOptions {\n\tlabel?: string;\n\tlabelRenderer?: ILabelRenderer;\n}\n\nexport class BaseDropdown extends ActionRunner {\n\tprivate _element: HTMLElement;\n\tprivate boxContainer?: HTMLElement;\n\tprivate _label?: HTMLElement;\n\tprivate contents?: HTMLElement;\n\n\tprivate visible: boolean | undefined;\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\treadonly onDidChangeVisibility = this._onDidChangeVisibility.event;\n\n\tconstructor(container: HTMLElement, options: IBaseDropdownOptions) {\n\t\tsuper();\n\n\t\tthis._element = append(container, $('.monaco-dropdown'));\n\n\t\tthis._label = append(this._element, $('.dropdown-label'));\n\n\t\tlet labelRenderer = options.labelRenderer;\n\t\tif (!labelRenderer) {\n\t\t\tlabelRenderer = (container: HTMLElement): IDisposable | null => {\n\t\t\t\tcontainer.textContent = options.label || '';\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\tfor (const event of [EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this.element, event, e => EventHelper.stop(e, true))); // prevent default click behaviour to trigger\n\t\t}\n\n\t\tfor (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this._label, event, e => {\n\t\t\t\tif (e instanceof MouseEvent && e.detail > 1) {\n\t\t\t\t\treturn; // prevent multiple clicks to open multiple context menus (https://github.com/microsoft/vscode/issues/41363)\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this._label, EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {\n\t\t\t\tEventHelper.stop(e, true); // https://github.com/microsoft/vscode/issues/57997\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst cleanupFn = labelRenderer(this._label);\n\t\tif (cleanupFn) {\n\t\t\tthis._register(cleanupFn);\n\t\t}\n\n\t\tthis._register(Gesture.addTarget(this._label));\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tshow(): void {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\t\t\tthis._onDidChangeVisibility.fire(true);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis._onDidChangeVisibility.fire(false);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.hide();\n\n\t\tif (this.boxContainer) {\n\t\t\tthis.boxContainer.remove();\n\t\t\tthis.boxContainer = undefined;\n\t\t}\n\n\t\tif (this.contents) {\n\t\t\tthis.contents.remove();\n\t\t\tthis.contents = undefined;\n\t\t}\n\n\t\tif (this._label) {\n\t\t\tthis._label.remove();\n\t\t\tthis._label = undefined;\n\t\t}\n\t}\n}\n\nexport interface IActionProvider {\n\tgetActions(): readonly IAction[];\n}\n\nexport interface IDropdownMenuOptions extends IBaseDropdownOptions {\n\tcontextMenuProvider: IContextMenuProvider;\n\treadonly actions?: IAction[];\n\treadonly actionProvider?: IActionProvider;\n\tmenuClassName?: string;\n\tmenuAsChild?: boolean; // scope down for #99448\n}\n\nexport class DropdownMenu extends BaseDropdown {\n\tprivate _contextMenuProvider: IContextMenuProvider;\n\tprivate _menuOptions: IMenuOptions | undefined;\n\tprivate _actions: readonly IAction[] = [];\n\tprivate actionProvider?: IActionProvider;\n\tprivate menuClassName: string;\n\tprivate menuAsChild?: boolean;\n\n\tconstructor(container: HTMLElement, options: IDropdownMenuOptions) {\n\t\tsuper(container, options);\n\n\t\tthis._contextMenuProvider = options.contextMenuProvider;\n\t\tthis.actions = options.actions || [];\n\t\tthis.actionProvider = options.actionProvider;\n\t\tthis.menuClassName = options.menuClassName || '';\n\t\tthis.menuAsChild = !!options.menuAsChild;\n\t}\n\n\tset menuOptions(options: IMenuOptions | undefined) {\n\t\tthis._menuOptions = options;\n\t}\n\n\tget menuOptions(): IMenuOptions | undefined {\n\t\treturn this._menuOptions;\n\t}\n\n\tprivate get actions(): readonly IAction[] {\n\t\tif (this.actionProvider) {\n\t\t\treturn this.actionProvider.getActions();\n\t\t}\n\n\t\treturn this._actions;\n\t}\n\n\tprivate set actions(actions: readonly IAction[]) {\n\t\tthis._actions = actions;\n\t}\n\n\toverride show(): void {\n\t\tsuper.show();\n\n\t\tthis.element.classList.add('active');\n\n\t\tthis._contextMenuProvider.showContextMenu({\n\t\t\tgetAnchor: () => this.element,\n\t\t\tgetActions: () => this.actions,\n\t\t\tgetActionsContext: () => this.menuOptions ? this.menuOptions.context : null,\n\t\t\tgetActionViewItem: action => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action) : undefined,\n\t\t\tgetKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,\n\t\t\tgetMenuClassName: () => this.menuClassName,\n\t\t\tonHide: () => this.onHide(),\n\t\t\tactionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,\n\t\t\tanchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : AnchorAlignment.LEFT,\n\t\t\tdomForShadowRoot: this.menuAsChild ? this.element : undefined\n\t\t});\n\t}\n\n\toverride hide(): void {\n\t\tsuper.hide();\n\t}\n\n\tprivate onHide(): void {\n\t\tthis.hide();\n\t\tthis.element.classList.remove('active');\n\t}\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 { IContextMenuProvider } from 'vs/base/browser/contextmenu';\nimport { $, append } from 'vs/base/browser/dom';\nimport { IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { BaseActionViewItem, IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';\nimport { DropdownMenu, IActionProvider, IDropdownMenuOptions, ILabelRenderer } from 'vs/base/browser/ui/dropdown/dropdown';\nimport { IAction, IActionRunner } from 'vs/base/common/actions';\nimport { Emitter } from 'vs/base/common/event';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./dropdown';\n\nexport interface IKeybindingProvider {\n\t(action: IAction): ResolvedKeybinding | undefined;\n}\n\nexport interface IAnchorAlignmentProvider {\n\t(): AnchorAlignment;\n}\n\nexport interface IDropdownMenuActionViewItemOptions extends IBaseActionViewItemOptions {\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly keybindingProvider?: IKeybindingProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly classNames?: string[] | string;\n\treadonly anchorAlignmentProvider?: IAnchorAlignmentProvider;\n\treadonly menuAsChild?: boolean;\n}\n\nexport class DropdownMenuActionViewItem extends BaseActionViewItem {\n\tprivate menuActionsOrProvider: readonly IAction[] | IActionProvider;\n\tprivate dropdownMenu: DropdownMenu | undefined;\n\tprivate contextMenuProvider: IContextMenuProvider;\n\tprivate actionItem: HTMLElement | null = null;\n\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\n\tprotected override readonly options: IDropdownMenuActionViewItemOptions;\n\n\tconstructor(\n\t\taction: IAction,\n\t\tmenuActionsOrProvider: readonly IAction[] | IActionProvider,\n\t\tcontextMenuProvider: IContextMenuProvider,\n\t\toptions: IDropdownMenuActionViewItemOptions = Object.create(null)\n\t) {\n\t\tsuper(null, action, options);\n\n\t\tthis.menuActionsOrProvider = menuActionsOrProvider;\n\t\tthis.contextMenuProvider = contextMenuProvider;\n\t\tthis.options = options;\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis.actionRunner = this.options.actionRunner;\n\t\t}\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tthis.actionItem = container;\n\n\t\tconst labelRenderer: ILabelRenderer = (el: HTMLElement): IDisposable | null => {\n\t\t\tthis.element = append(el, $('a.action-label'));\n\n\t\t\tlet classNames: string[] = [];\n\n\t\t\tif (typeof this.options.classNames === 'string') {\n\t\t\t\tclassNames = this.options.classNames.split(/\\s+/g).filter(s => !!s);\n\t\t\t} else if (this.options.classNames) {\n\t\t\t\tclassNames = this.options.classNames;\n\t\t\t}\n\n\t\t\t// todo@aeschli: remove codicon, should come through `this.options.classNames`\n\t\t\tif (!classNames.find(c => c === 'icon')) {\n\t\t\t\tclassNames.push('codicon');\n\t\t\t}\n\n\t\t\tthis.element.classList.add(...classNames);\n\n\t\t\tthis.element.setAttribute('role', 'button');\n\t\t\tthis.element.setAttribute('aria-haspopup', 'true');\n\t\t\tthis.element.setAttribute('aria-expanded', 'false');\n\t\t\tthis.element.title = this._action.label || '';\n\n\t\t\treturn null;\n\t\t};\n\n\t\tconst isActionsArray = Array.isArray(this.menuActionsOrProvider);\n\t\tconst options: IDropdownMenuOptions = {\n\t\t\tcontextMenuProvider: this.contextMenuProvider,\n\t\t\tlabelRenderer: labelRenderer,\n\t\t\tmenuAsChild: this.options.menuAsChild,\n\t\t\tactions: isActionsArray ? this.menuActionsOrProvider as IAction[] : undefined,\n\t\t\tactionProvider: isActionsArray ? undefined : this.menuActionsOrProvider as IActionProvider\n\t\t};\n\n\t\tthis.dropdownMenu = this._register(new DropdownMenu(container, options));\n\t\tthis._register(this.dropdownMenu.onDidChangeVisibility(visible => {\n\t\t\tthis.element?.setAttribute('aria-expanded', `${visible}`);\n\t\t\tthis._onDidChangeVisibility.fire(visible);\n\t\t}));\n\n\t\tthis.dropdownMenu.menuOptions = {\n\t\t\tactionViewItemProvider: this.options.actionViewItemProvider,\n\t\t\tactionRunner: this.actionRunner,\n\t\t\tgetKeyBinding: this.options.keybindingProvider,\n\t\t\tcontext: this._context\n\t\t};\n\n\t\tif (this.options.anchorAlignmentProvider) {\n\t\t\tconst that = this;\n\n\t\t\tthis.dropdownMenu.menuOptions = {\n\t\t\t\t...this.dropdownMenu.menuOptions,\n\t\t\t\tget anchorAlignment(): AnchorAlignment {\n\t\t\t\t\treturn that.options.anchorAlignmentProvider!();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis.updateEnabled();\n\t}\n\n\toverride setActionContext(newContext: unknown): void {\n\t\tsuper.setActionContext(newContext);\n\n\t\tif (this.dropdownMenu) {\n\t\t\tif (this.dropdownMenu.menuOptions) {\n\t\t\t\tthis.dropdownMenu.menuOptions.context = newContext;\n\t\t\t} else {\n\t\t\t\tthis.dropdownMenu.menuOptions = { context: newContext };\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override updateEnabled(): void {\n\t\tconst disabled = !this.getAction().enabled;\n\t\tthis.actionItem?.classList.toggle('disabled', disabled);\n\t\tthis.element?.classList.toggle('disabled', disabled);\n\t}\n}\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 * as dom from 'vs/base/browser/dom';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { renderFormattedText, renderText } from 'vs/base/browser/formattedTextRenderer';\nimport { IHistoryNavigationWidget } from 'vs/base/browser/history';\nimport { MarkdownRenderOptions } from 'vs/base/browser/markdownRenderer';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport * as aria from 'vs/base/browser/ui/aria/aria';\nimport { AnchorAlignment, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { IAction } from 'vs/base/common/actions';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { HistoryNavigator } from 'vs/base/common/history';\nimport { mixin } from 'vs/base/common/objects';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport 'vs/css!./inputBox';\nimport * as nls from 'vs/nls';\n\n\nconst $ = dom.$;\n\nexport interface IInputOptions extends IInputBoxStyles {\n\treadonly placeholder?: string;\n\treadonly showPlaceholderOnFocus?: boolean;\n\treadonly tooltip?: string;\n\treadonly ariaLabel?: string;\n\treadonly type?: string;\n\treadonly validationOptions?: IInputValidationOptions;\n\treadonly flexibleHeight?: boolean;\n\treadonly flexibleWidth?: boolean;\n\treadonly flexibleMaxHeight?: number;\n\treadonly actions?: ReadonlyArray<IAction>;\n}\n\nexport interface IInputBoxStyles {\n\treadonly inputBackground?: Color;\n\treadonly inputForeground?: Color;\n\treadonly inputBorder?: Color;\n\treadonly inputValidationInfoBorder?: Color;\n\treadonly inputValidationInfoBackground?: Color;\n\treadonly inputValidationInfoForeground?: Color;\n\treadonly inputValidationWarningBorder?: Color;\n\treadonly inputValidationWarningBackground?: Color;\n\treadonly inputValidationWarningForeground?: Color;\n\treadonly inputValidationErrorBorder?: Color;\n\treadonly inputValidationErrorBackground?: Color;\n\treadonly inputValidationErrorForeground?: Color;\n}\n\nexport interface IInputValidator {\n\t(value: string): IMessage | null;\n}\n\nexport interface IMessage {\n\treadonly content: string;\n\treadonly formatContent?: boolean; // defaults to false\n\treadonly type?: MessageType;\n}\n\nexport interface IInputValidationOptions {\n\tvalidation?: IInputValidator;\n}\n\nexport const enum MessageType {\n\tINFO = 1,\n\tWARNING = 2,\n\tERROR = 3\n}\n\nexport interface IRange {\n\tstart: number;\n\tend: number;\n}\n\nconst defaultOpts = {\n\tinputBackground: Color.fromHex('#3C3C3C'),\n\tinputForeground: Color.fromHex('#CCCCCC'),\n\tinputValidationInfoBorder: Color.fromHex('#55AAFF'),\n\tinputValidationInfoBackground: Color.fromHex('#063B49'),\n\tinputValidationWarningBorder: Color.fromHex('#B89500'),\n\tinputValidationWarningBackground: Color.fromHex('#352A05'),\n\tinputValidationErrorBorder: Color.fromHex('#BE1100'),\n\tinputValidationErrorBackground: Color.fromHex('#5A1D1D')\n};\n\nexport class InputBox extends Widget {\n\tprivate contextViewProvider?: IContextViewProvider;\n\telement: HTMLElement;\n\tprotected input: HTMLInputElement;\n\tprivate actionbar?: ActionBar;\n\tprivate options: IInputOptions;\n\tprivate message: IMessage | null;\n\tprotected placeholder: string;\n\tprivate tooltip: string;\n\tprivate ariaLabel: string;\n\tprivate validation?: IInputValidator;\n\tprivate state: 'idle' | 'open' | 'closed' = 'idle';\n\n\tprivate mirror: HTMLElement | undefined;\n\tprivate cachedHeight: number | undefined;\n\tprivate cachedContentHeight: number | undefined;\n\tprivate maxHeight: number = Number.POSITIVE_INFINITY;\n\tprivate scrollableElement: ScrollableElement | undefined;\n\n\tprivate inputBackground?: Color;\n\tprivate inputForeground?: Color;\n\tprivate inputBorder?: Color;\n\n\tprivate inputValidationInfoBorder?: Color;\n\tprivate inputValidationInfoBackground?: Color;\n\tprivate inputValidationInfoForeground?: Color;\n\tprivate inputValidationWarningBorder?: Color;\n\tprivate inputValidationWarningBackground?: Color;\n\tprivate inputValidationWarningForeground?: Color;\n\tprivate inputValidationErrorBorder?: Color;\n\tprivate inputValidationErrorBackground?: Color;\n\tprivate inputValidationErrorForeground?: Color;\n\n\tprivate _onDidChange = this._register(new Emitter<string>());\n\tpublic readonly onDidChange: Event<string> = this._onDidChange.event;\n\n\tprivate _onDidHeightChange = this._register(new Emitter<number>());\n\tpublic readonly onDidHeightChange: Event<number> = this._onDidHeightChange.event;\n\n\tconstructor(container: HTMLElement, contextViewProvider: IContextViewProvider | undefined, options?: IInputOptions) {\n\t\tsuper();\n\n\t\tthis.contextViewProvider = contextViewProvider;\n\t\tthis.options = options || Object.create(null);\n\t\tmixin(this.options, defaultOpts, false);\n\t\tthis.message = null;\n\t\tthis.placeholder = this.options.placeholder || '';\n\t\tthis.tooltip = this.options.tooltip ?? (this.placeholder || '');\n\t\tthis.ariaLabel = this.options.ariaLabel || '';\n\n\t\tthis.inputBackground = this.options.inputBackground;\n\t\tthis.inputForeground = this.options.inputForeground;\n\t\tthis.inputBorder = this.options.inputBorder;\n\n\t\tthis.inputValidationInfoBorder = this.options.inputValidationInfoBorder;\n\t\tthis.inputValidationInfoBackground = this.options.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = this.options.inputValidationInfoForeground;\n\t\tthis.inputValidationWarningBorder = this.options.inputValidationWarningBorder;\n\t\tthis.inputValidationWarningBackground = this.options.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = this.options.inputValidationWarningForeground;\n\t\tthis.inputValidationErrorBorder = this.options.inputValidationErrorBorder;\n\t\tthis.inputValidationErrorBackground = this.options.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = this.options.inputValidationErrorForeground;\n\n\t\tif (this.options.validationOptions) {\n\t\t\tthis.validation = this.options.validationOptions.validation;\n\t\t}\n\n\t\tthis.element = dom.append(container, $('.monaco-inputbox.idle'));\n\n\t\tlet tagName = this.options.flexibleHeight ? 'textarea' : 'input';\n\n\t\tlet wrapper = dom.append(this.element, $('.ibwrapper'));\n\t\tthis.input = dom.append(wrapper, $(tagName + '.input.empty'));\n\t\tthis.input.setAttribute('autocorrect', 'off');\n\t\tthis.input.setAttribute('autocapitalize', 'off');\n\t\tthis.input.setAttribute('spellcheck', 'false');\n\n\t\tthis.onfocus(this.input, () => this.element.classList.add('synthetic-focus'));\n\t\tthis.onblur(this.input, () => this.element.classList.remove('synthetic-focus'));\n\n\t\tif (this.options.flexibleHeight) {\n\t\t\tthis.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.mirror = dom.append(wrapper, $('div.mirror'));\n\t\t\tthis.mirror.innerText = '\\u00a0';\n\n\t\t\tthis.scrollableElement = new ScrollableElement(this.element, { vertical: ScrollbarVisibility.Auto });\n\n\t\t\tif (this.options.flexibleWidth) {\n\t\t\t\tthis.input.setAttribute('wrap', 'off');\n\t\t\t\tthis.mirror.style.whiteSpace = 'pre';\n\t\t\t\tthis.mirror.style.wordWrap = 'initial';\n\t\t\t}\n\n\t\t\tdom.append(container, this.scrollableElement.getDomNode());\n\t\t\tthis._register(this.scrollableElement);\n\n\t\t\t// from ScrollableElement to DOM\n\t\t\tthis._register(this.scrollableElement.onScroll(e => this.input.scrollTop = e.scrollTop));\n\n\t\t\tconst onSelectionChange = this._register(new DomEmitter(document, 'selectionchange'));\n\t\t\tconst onAnchoredSelectionChange = Event.filter(onSelectionChange.event, () => {\n\t\t\t\tconst selection = document.getSelection();\n\t\t\t\treturn selection?.anchorNode === wrapper;\n\t\t\t});\n\n\t\t\t// from DOM to ScrollableElement\n\t\t\tthis._register(onAnchoredSelectionChange(this.updateScrollDimensions, this));\n\t\t\tthis._register(this.onDidHeightChange(this.updateScrollDimensions, this));\n\t\t} else {\n\t\t\tthis.input.type = this.options.type || 'text';\n\t\t\tthis.input.setAttribute('wrap', 'off');\n\t\t}\n\n\t\tif (this.ariaLabel) {\n\t\t\tthis.input.setAttribute('aria-label', this.ariaLabel);\n\t\t}\n\n\t\tif (this.placeholder && !this.options.showPlaceholderOnFocus) {\n\t\t\tthis.setPlaceHolder(this.placeholder);\n\t\t}\n\n\t\tif (this.tooltip) {\n\t\t\tthis.setTooltip(this.tooltip);\n\t\t}\n\n\t\tthis.oninput(this.input, () => this.onValueChange());\n\t\tthis.onblur(this.input, () => this.onBlur());\n\t\tthis.onfocus(this.input, () => this.onFocus());\n\n\t\tthis.ignoreGesture(this.input);\n\n\t\tsetTimeout(() => this.updateMirror(), 0);\n\n\t\t// Support actions\n\t\tif (this.options.actions) {\n\t\t\tthis.actionbar = this._register(new ActionBar(this.element));\n\t\t\tthis.actionbar.push(this.options.actions, { icon: true, label: false });\n\t\t}\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate onBlur(): void {\n\t\tthis._hideMessage();\n\t\tif (this.options.showPlaceholderOnFocus) {\n\t\t\tthis.input.setAttribute('placeholder', '');\n\t\t}\n\t}\n\n\tprivate onFocus(): void {\n\t\tthis._showMessage();\n\t\tif (this.options.showPlaceholderOnFocus) {\n\t\t\tthis.input.setAttribute('placeholder', this.placeholder || '');\n\t\t}\n\t}\n\n\tpublic setPlaceHolder(placeHolder: string): void {\n\t\tthis.placeholder = placeHolder;\n\t\tthis.input.setAttribute('placeholder', placeHolder);\n\t}\n\n\tpublic setTooltip(tooltip: string): void {\n\t\tthis.tooltip = tooltip;\n\t\tthis.input.title = tooltip;\n\t}\n\n\tpublic setAriaLabel(label: string): void {\n\t\tthis.ariaLabel = label;\n\n\t\tif (label) {\n\t\t\tthis.input.setAttribute('aria-label', this.ariaLabel);\n\t\t} else {\n\t\t\tthis.input.removeAttribute('aria-label');\n\t\t}\n\t}\n\n\tpublic getAriaLabel(): string {\n\t\treturn this.ariaLabel;\n\t}\n\n\tpublic get inputElement(): HTMLInputElement {\n\t\treturn this.input;\n\t}\n\n\tpublic get value(): string {\n\t\treturn this.input.value;\n\t}\n\n\tpublic set value(newValue: string) {\n\t\tif (this.input.value !== newValue) {\n\t\t\tthis.input.value = newValue;\n\t\t\tthis.onValueChange();\n\t\t}\n\t}\n\n\tpublic get height(): number {\n\t\treturn typeof this.cachedHeight === 'number' ? this.cachedHeight : dom.getTotalHeight(this.element);\n\t}\n\n\tpublic focus(): void {\n\t\tthis.input.focus();\n\t}\n\n\tpublic blur(): void {\n\t\tthis.input.blur();\n\t}\n\n\tpublic hasFocus(): boolean {\n\t\treturn document.activeElement === this.input;\n\t}\n\n\tpublic select(range: IRange | null = null): void {\n\t\tthis.input.select();\n\n\t\tif (range) {\n\t\t\tthis.input.setSelectionRange(range.start, range.end);\n\t\t\tif (range.end === this.input.value.length) {\n\t\t\t\tthis.input.scrollLeft = this.input.scrollWidth;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isSelectionAtEnd(): boolean {\n\t\treturn this.input.selectionEnd === this.input.value.length && this.input.selectionStart === this.input.selectionEnd;\n\t}\n\n\tpublic enable(): void {\n\t\tthis.input.removeAttribute('disabled');\n\t}\n\n\tpublic disable(): void {\n\t\tthis.blur();\n\t\tthis.input.disabled = true;\n\t\tthis._hideMessage();\n\t}\n\n\tpublic get width(): number {\n\t\treturn dom.getTotalWidth(this.input);\n\t}\n\n\tpublic set width(width: number) {\n\t\tif (this.options.flexibleHeight && this.options.flexibleWidth) {\n\t\t\t// textarea with horizontal scrolling\n\t\t\tlet horizontalPadding = 0;\n\t\t\tif (this.mirror) {\n\t\t\t\tconst paddingLeft = parseFloat(this.mirror.style.paddingLeft || '') || 0;\n\t\t\t\tconst paddingRight = parseFloat(this.mirror.style.paddingRight || '') || 0;\n\t\t\t\thorizontalPadding = paddingLeft + paddingRight;\n\t\t\t}\n\t\t\tthis.input.style.width = (width - horizontalPadding) + 'px';\n\t\t} else {\n\t\t\tthis.input.style.width = width + 'px';\n\t\t}\n\n\t\tif (this.mirror) {\n\t\t\tthis.mirror.style.width = width + 'px';\n\t\t}\n\t}\n\n\tpublic set paddingRight(paddingRight: number) {\n\t\t// Set width to avoid hint text overlapping buttons\n\t\tthis.input.style.width = `calc(100% - ${paddingRight}px)`;\n\n\t\tif (this.mirror) {\n\t\t\tthis.mirror.style.paddingRight = paddingRight + 'px';\n\t\t}\n\t}\n\n\tprivate updateScrollDimensions(): void {\n\t\tif (typeof this.cachedContentHeight !== 'number' || typeof this.cachedHeight !== 'number' || !this.scrollableElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollHeight = this.cachedContentHeight;\n\t\tconst height = this.cachedHeight;\n\t\tconst scrollTop = this.input.scrollTop;\n\n\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight, height });\n\t\tthis.scrollableElement.setScrollPosition({ scrollTop });\n\t}\n\n\tpublic showMessage(message: IMessage, force?: boolean): void {\n\t\tthis.message = message;\n\n\t\tthis.element.classList.remove('idle');\n\t\tthis.element.classList.remove('info');\n\t\tthis.element.classList.remove('warning');\n\t\tthis.element.classList.remove('error');\n\t\tthis.element.classList.add(this.classForType(message.type));\n\n\t\tconst styles = this.stylesForType(this.message.type);\n\t\tthis.element.style.border = styles.border ? `1px solid ${styles.border}` : '';\n\n\t\tif (this.hasFocus() || force) {\n\t\t\tthis._showMessage();\n\t\t}\n\t}\n\n\tpublic hideMessage(): void {\n\t\tthis.message = null;\n\n\t\tthis.element.classList.remove('info');\n\t\tthis.element.classList.remove('warning');\n\t\tthis.element.classList.remove('error');\n\t\tthis.element.classList.add('idle');\n\n\t\tthis._hideMessage();\n\t\tthis.applyStyles();\n\t}\n\n\tpublic validate(): MessageType | undefined {\n\t\tlet errorMsg: IMessage | null = null;\n\n\t\tif (this.validation) {\n\t\t\terrorMsg = this.validation(this.value);\n\n\t\t\tif (errorMsg) {\n\t\t\t\tthis.inputElement.setAttribute('aria-invalid', 'true');\n\t\t\t\tthis.showMessage(errorMsg);\n\t\t\t}\n\t\t\telse if (this.inputElement.hasAttribute('aria-invalid')) {\n\t\t\t\tthis.inputElement.removeAttribute('aria-invalid');\n\t\t\t\tthis.hideMessage();\n\t\t\t}\n\t\t}\n\n\t\treturn errorMsg?.type;\n\t}\n\n\tpublic stylesForType(type: MessageType | undefined): { border: Color | undefined; background: Color | undefined; foreground: Color | undefined } {\n\t\tswitch (type) {\n\t\t\tcase MessageType.INFO: return { border: this.inputValidationInfoBorder, background: this.inputValidationInfoBackground, foreground: this.inputValidationInfoForeground };\n\t\t\tcase MessageType.WARNING: return { border: this.inputValidationWarningBorder, background: this.inputValidationWarningBackground, foreground: this.inputValidationWarningForeground };\n\t\t\tdefault: return { border: this.inputValidationErrorBorder, background: this.inputValidationErrorBackground, foreground: this.inputValidationErrorForeground };\n\t\t}\n\t}\n\n\tprivate classForType(type: MessageType | undefined): string {\n\t\tswitch (type) {\n\t\t\tcase MessageType.INFO: return 'info';\n\t\t\tcase MessageType.WARNING: return 'warning';\n\t\t\tdefault: return 'error';\n\t\t}\n\t}\n\n\tprivate _showMessage(): void {\n\t\tif (!this.contextViewProvider || !this.message) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet div: HTMLElement;\n\t\tlet layout = () => div.style.width = dom.getTotalWidth(this.element) + 'px';\n\n\t\tthis.contextViewProvider.showContextView({\n\t\t\tgetAnchor: () => this.element,\n\t\t\tanchorAlignment: AnchorAlignment.RIGHT,\n\t\t\trender: (container: HTMLElement) => {\n\t\t\t\tif (!this.message) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tdiv = dom.append(container, $('.monaco-inputbox-container'));\n\t\t\t\tlayout();\n\n\t\t\t\tconst renderOptions: MarkdownRenderOptions = {\n\t\t\t\t\tinline: true,\n\t\t\t\t\tclassName: 'monaco-inputbox-message'\n\t\t\t\t};\n\n\t\t\t\tconst spanElement = (this.message.formatContent\n\t\t\t\t\t? renderFormattedText(this.message.content, renderOptions)\n\t\t\t\t\t: renderText(this.message.content, renderOptions));\n\t\t\t\tspanElement.classList.add(this.classForType(this.message.type));\n\n\t\t\t\tconst styles = this.stylesForType(this.message.type);\n\t\t\t\tspanElement.style.backgroundColor = styles.background ? styles.background.toString() : '';\n\t\t\t\tspanElement.style.color = styles.foreground ? styles.foreground.toString() : '';\n\t\t\t\tspanElement.style.border = styles.border ? `1px solid ${styles.border}` : '';\n\n\t\t\t\tdom.append(div, spanElement);\n\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\tonHide: () => {\n\t\t\t\tthis.state = 'closed';\n\t\t\t},\n\t\t\tlayout: layout\n\t\t});\n\n\t\t// ARIA Support\n\t\tlet alertText: string;\n\t\tif (this.message.type === MessageType.ERROR) {\n\t\t\talertText = nls.localize('alertErrorMessage', \"Error: {0}\", this.message.content);\n\t\t} else if (this.message.type === MessageType.WARNING) {\n\t\t\talertText = nls.localize('alertWarningMessage', \"Warning: {0}\", this.message.content);\n\t\t} else {\n\t\t\talertText = nls.localize('alertInfoMessage', \"Info: {0}\", this.message.content);\n\t\t}\n\n\t\taria.alert(alertText);\n\n\t\tthis.state = 'open';\n\t}\n\n\tprivate _hideMessage(): void {\n\t\tif (!this.contextViewProvider) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.state === 'open') {\n\t\t\tthis.contextViewProvider.hideContextView();\n\t\t}\n\n\t\tthis.state = 'idle';\n\t}\n\n\tprivate onValueChange(): void {\n\t\tthis._onDidChange.fire(this.value);\n\n\t\tthis.validate();\n\t\tthis.updateMirror();\n\t\tthis.input.classList.toggle('empty', !this.value);\n\n\t\tif (this.state === 'open' && this.contextViewProvider) {\n\t\t\tthis.contextViewProvider.layout();\n\t\t}\n\t}\n\n\tprivate updateMirror(): void {\n\t\tif (!this.mirror) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = this.value;\n\t\tconst lastCharCode = value.charCodeAt(value.length - 1);\n\t\tconst suffix = lastCharCode === 10 ? ' ' : '';\n\t\tconst mirrorTextContent = (value + suffix)\n\t\t\t.replace(/\\u000c/g, ''); // Don't measure with the form feed character, which messes up sizing\n\n\t\tif (mirrorTextContent) {\n\t\t\tthis.mirror.textContent = value + suffix;\n\t\t} else {\n\t\t\tthis.mirror.innerText = '\\u00a0';\n\t\t}\n\n\t\tthis.layout();\n\t}\n\n\tpublic style(styles: IInputBoxStyles): void {\n\t\tthis.inputBackground = styles.inputBackground;\n\t\tthis.inputForeground = styles.inputForeground;\n\t\tthis.inputBorder = styles.inputBorder;\n\n\t\tthis.inputValidationInfoBackground = styles.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = styles.inputValidationInfoForeground;\n\t\tthis.inputValidationInfoBorder = styles.inputValidationInfoBorder;\n\t\tthis.inputValidationWarningBackground = styles.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = styles.inputValidationWarningForeground;\n\t\tthis.inputValidationWarningBorder = styles.inputValidationWarningBorder;\n\t\tthis.inputValidationErrorBackground = styles.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = styles.inputValidationErrorForeground;\n\t\tthis.inputValidationErrorBorder = styles.inputValidationErrorBorder;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tconst background = this.inputBackground ? this.inputBackground.toString() : '';\n\t\tconst foreground = this.inputForeground ? this.inputForeground.toString() : '';\n\t\tconst border = this.inputBorder ? this.inputBorder.toString() : '';\n\n\t\tthis.element.style.backgroundColor = background;\n\t\tthis.element.style.color = foreground;\n\t\tthis.input.style.backgroundColor = 'inherit';\n\t\tthis.input.style.color = foreground;\n\n\t\tthis.element.style.borderWidth = border ? '1px' : '';\n\t\tthis.element.style.borderStyle = border ? 'solid' : '';\n\t\tthis.element.style.borderColor = border;\n\t}\n\n\tpublic layout(): void {\n\t\tif (!this.mirror) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousHeight = this.cachedContentHeight;\n\t\tthis.cachedContentHeight = dom.getTotalHeight(this.mirror);\n\n\t\tif (previousHeight !== this.cachedContentHeight) {\n\t\t\tthis.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight);\n\t\t\tthis.input.style.height = this.cachedHeight + 'px';\n\t\t\tthis._onDidHeightChange.fire(this.cachedContentHeight);\n\t\t}\n\t}\n\n\tpublic insertAtCursor(text: string): void {\n\t\tconst inputElement = this.inputElement;\n\t\tconst start = inputElement.selectionStart;\n\t\tconst end = inputElement.selectionEnd;\n\t\tconst content = inputElement.value;\n\n\t\tif (start !== null && end !== null) {\n\t\t\tthis.value = content.substr(0, start) + text + content.substr(end);\n\t\t\tinputElement.setSelectionRange(start + 1, start + 1);\n\t\t\tthis.layout();\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hideMessage();\n\n\t\tthis.message = null;\n\n\t\tif (this.actionbar) {\n\t\t\tthis.actionbar.dispose();\n\t\t}\n\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IHistoryInputOptions extends IInputOptions {\n\thistory: string[];\n\treadonly showHistoryHint?: () => boolean;\n}\n\nexport class HistoryInputBox extends InputBox implements IHistoryNavigationWidget {\n\n\tprivate readonly history: HistoryNavigator<string>;\n\tprivate observer: MutationObserver | undefined;\n\n\tconstructor(container: HTMLElement, contextViewProvider: IContextViewProvider | undefined, options: IHistoryInputOptions) {\n\t\tconst NLS_PLACEHOLDER_HISTORY_HINT = nls.localize({ key: 'history.inputbox.hint', comment: ['Text will be prefixed with \\u21C5 plus a single space, then used as a hint where input field keeps history'] }, \"for history\");\n\t\tconst NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX = ` or \\u21C5 ${NLS_PLACEHOLDER_HISTORY_HINT}`;\n\t\tconst NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS = ` (\\u21C5 ${NLS_PLACEHOLDER_HISTORY_HINT})`;\n\t\tsuper(container, contextViewProvider, options);\n\t\tthis.history = new HistoryNavigator<string>(options.history, 100);\n\n\t\t// Function to append the history suffix to the placeholder if necessary\n\t\tconst addSuffix = () => {\n\t\t\tif (options.showHistoryHint && options.showHistoryHint() && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX) && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS) && this.history.getHistory().length) {\n\t\t\t\tconst suffix = this.placeholder.endsWith(')') ? NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX : NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS;\n\t\t\t\tconst suffixedPlaceholder = this.placeholder + suffix;\n\t\t\t\tif (options.showPlaceholderOnFocus && document.activeElement !== this.input) {\n\t\t\t\t\tthis.placeholder = suffixedPlaceholder;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.setPlaceHolder(suffixedPlaceholder);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Spot the change to the textarea class attribute which occurs when it changes between non-empty and empty,\n\t\t// and add the history suffix to the placeholder if not yet present\n\t\tthis.observer = new MutationObserver((mutationList: MutationRecord[], observer: MutationObserver) => {\n\t\t\tmutationList.forEach((mutation: MutationRecord) => {\n\t\t\t\tif (!mutation.target.textContent) {\n\t\t\t\t\taddSuffix();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis.observer.observe(this.input, { attributeFilter: ['class'] });\n\n\t\tthis.onfocus(this.input, () => addSuffix());\n\t\tthis.onblur(this.input, () => {\n\t\t\tconst resetPlaceholder = (historyHint: string) => {\n\t\t\t\tif (!this.placeholder.endsWith(historyHint)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconst revertedPlaceholder = this.placeholder.slice(0, this.placeholder.length - historyHint.length);\n\t\t\t\t\tif (options.showPlaceholderOnFocus) {\n\t\t\t\t\t\tthis.placeholder = revertedPlaceholder;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.setPlaceHolder(revertedPlaceholder);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (!resetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS)) {\n\t\t\t\tresetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX);\n\t\t\t}\n\t\t});\n\t}\n\n\toverride dispose() {\n\t\tsuper.dispose();\n\t\tif (this.observer) {\n\t\t\tthis.observer.disconnect();\n\t\t\tthis.observer = undefined;\n\t\t}\n\t}\n\n\tpublic addToHistory(): void {\n\t\tif (this.value && this.value !== this.getCurrentValue()) {\n\t\t\tthis.history.add(this.value);\n\t\t}\n\t}\n\n\tpublic showNextValue(): void {\n\t\tif (!this.history.has(this.value)) {\n\t\t\tthis.addToHistory();\n\t\t}\n\n\t\tlet next = this.getNextValue();\n\t\tif (next) {\n\t\t\tnext = next === this.value ? this.getNextValue() : next;\n\t\t}\n\n\t\tif (next) {\n\t\t\tthis.value = next;\n\t\t\taria.status(this.value);\n\t\t}\n\t}\n\n\tpublic showPreviousValue(): void {\n\t\tif (!this.history.has(this.value)) {\n\t\t\tthis.addToHistory();\n\t\t}\n\n\t\tlet previous = this.getPreviousValue();\n\t\tif (previous) {\n\t\t\tprevious = previous === this.value ? this.getPreviousValue() : previous;\n\t\t}\n\n\t\tif (previous) {\n\t\t\tthis.value = previous;\n\t\t\taria.status(this.value);\n\t\t}\n\t}\n\n\tprivate getCurrentValue(): string | null {\n\t\tlet currentValue = this.history.current();\n\t\tif (!currentValue) {\n\t\t\tcurrentValue = this.history.last();\n\t\t\tthis.history.next();\n\t\t}\n\t\treturn currentValue;\n\t}\n\n\tprivate getPreviousValue(): string | null {\n\t\treturn this.history.previous() || this.history.first();\n\t}\n\n\tprivate getNextValue(): string | null {\n\t\treturn this.history.next() || this.history.last();\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { ICheckboxStyles } from 'vs/base/browser/ui/checkbox/checkbox';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { CaseSensitiveCheckbox, RegexCheckbox, WholeWordsCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes';\nimport { HistoryInputBox, IInputBoxStyles, IInputValidator } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport 'vs/css!./findInput';\nimport * as nls from 'vs/nls';\n\n\nexport interface IFindInputOptions extends IFindInputStyles {\n\treadonly placeholder?: string;\n\treadonly width?: number;\n\treadonly validation?: IInputValidator;\n\treadonly label: string;\n\treadonly flexibleHeight?: boolean;\n\treadonly flexibleWidth?: boolean;\n\treadonly flexibleMaxHeight?: number;\n\n\treadonly appendCaseSensitiveLabel?: string;\n\treadonly appendWholeWordsLabel?: string;\n\treadonly appendRegexLabel?: string;\n\treadonly history?: string[];\n\treadonly showHistoryHint?: () => boolean;\n}\n\nexport interface IFindInputStyles extends IInputBoxStyles {\n\tinputActiveOptionBorder?: Color;\n\tinputActiveOptionForeground?: Color;\n\tinputActiveOptionBackground?: Color;\n}\n\nconst NLS_DEFAULT_LABEL = nls.localize('defaultLabel', \"input\");\n\nexport class FindInput extends Widget {\n\n\tprivate contextViewProvider: IContextViewProvider;\n\tprivate placeholder: string;\n\tprivate validation?: IInputValidator;\n\tprivate label: string;\n\tprivate fixFocusOnOptionClickEnabled = true;\n\tprivate imeSessionInProgress = false;\n\n\tprotected inputActiveOptionBorder?: Color;\n\tprotected inputActiveOptionForeground?: Color;\n\tprotected inputActiveOptionBackground?: Color;\n\tprotected inputBackground?: Color;\n\tprotected inputForeground?: Color;\n\tprotected inputBorder?: Color;\n\n\tprotected inputValidationInfoBorder?: Color;\n\tprotected inputValidationInfoBackground?: Color;\n\tprotected inputValidationInfoForeground?: Color;\n\tprotected inputValidationWarningBorder?: Color;\n\tprotected inputValidationWarningBackground?: Color;\n\tprotected inputValidationWarningForeground?: Color;\n\tprotected inputValidationErrorBorder?: Color;\n\tprotected inputValidationErrorBackground?: Color;\n\tprotected inputValidationErrorForeground?: Color;\n\n\tprotected controls: HTMLDivElement;\n\tprotected regex: RegexCheckbox;\n\tprotected wholeWords: WholeWordsCheckbox;\n\tprotected caseSensitive: CaseSensitiveCheckbox;\n\tpublic domNode: HTMLElement;\n\tpublic inputBox: HistoryInputBox;\n\n\tprivate readonly _onDidOptionChange = this._register(new Emitter<boolean>());\n\tpublic readonly onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event;\n\n\tprivate readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;\n\n\tprivate readonly _onMouseDown = this._register(new Emitter<IMouseEvent>());\n\tpublic readonly onMouseDown: Event<IMouseEvent> = this._onMouseDown.event;\n\n\tprivate readonly _onInput = this._register(new Emitter<void>());\n\n\tprivate readonly _onKeyUp = this._register(new Emitter<IKeyboardEvent>());\n\n\tprivate _onCaseSensitiveKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onCaseSensitiveKeyDown: Event<IKeyboardEvent> = this._onCaseSensitiveKeyDown.event;\n\n\tprivate _onRegexKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onRegexKeyDown: Event<IKeyboardEvent> = this._onRegexKeyDown.event;\n\n\tconstructor(parent: HTMLElement | null, contextViewProvider: IContextViewProvider, private readonly _showOptionButtons: boolean, options: IFindInputOptions) {\n\t\tsuper();\n\t\tthis.contextViewProvider = contextViewProvider;\n\t\tthis.placeholder = options.placeholder || '';\n\t\tthis.validation = options.validation;\n\t\tthis.label = options.label || NLS_DEFAULT_LABEL;\n\n\t\tthis.inputActiveOptionBorder = options.inputActiveOptionBorder;\n\t\tthis.inputActiveOptionForeground = options.inputActiveOptionForeground;\n\t\tthis.inputActiveOptionBackground = options.inputActiveOptionBackground;\n\t\tthis.inputBackground = options.inputBackground;\n\t\tthis.inputForeground = options.inputForeground;\n\t\tthis.inputBorder = options.inputBorder;\n\n\t\tthis.inputValidationInfoBorder = options.inputValidationInfoBorder;\n\t\tthis.inputValidationInfoBackground = options.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = options.inputValidationInfoForeground;\n\t\tthis.inputValidationWarningBorder = options.inputValidationWarningBorder;\n\t\tthis.inputValidationWarningBackground = options.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = options.inputValidationWarningForeground;\n\t\tthis.inputValidationErrorBorder = options.inputValidationErrorBorder;\n\t\tthis.inputValidationErrorBackground = options.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = options.inputValidationErrorForeground;\n\n\t\tconst appendCaseSensitiveLabel = options.appendCaseSensitiveLabel || '';\n\t\tconst appendWholeWordsLabel = options.appendWholeWordsLabel || '';\n\t\tconst appendRegexLabel = options.appendRegexLabel || '';\n\t\tconst history = options.history || [];\n\t\tconst flexibleHeight = !!options.flexibleHeight;\n\t\tconst flexibleWidth = !!options.flexibleWidth;\n\t\tconst flexibleMaxHeight = options.flexibleMaxHeight;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.classList.add('monaco-findInput');\n\n\t\tthis.inputBox = this._register(new HistoryInputBox(this.domNode, this.contextViewProvider, {\n\t\t\tplaceholder: this.placeholder || '',\n\t\t\tariaLabel: this.label || '',\n\t\t\tvalidationOptions: {\n\t\t\t\tvalidation: this.validation\n\t\t\t},\n\t\t\tinputBackground: this.inputBackground,\n\t\t\tinputForeground: this.inputForeground,\n\t\t\tinputBorder: this.inputBorder,\n\t\t\tinputValidationInfoBackground: this.inputValidationInfoBackground,\n\t\t\tinputValidationInfoForeground: this.inputValidationInfoForeground,\n\t\t\tinputValidationInfoBorder: this.inputValidationInfoBorder,\n\t\t\tinputValidationWarningBackground: this.inputValidationWarningBackground,\n\t\t\tinputValidationWarningForeground: this.inputValidationWarningForeground,\n\t\t\tinputValidationWarningBorder: this.inputValidationWarningBorder,\n\t\t\tinputValidationErrorBackground: this.inputValidationErrorBackground,\n\t\t\tinputValidationErrorForeground: this.inputValidationErrorForeground,\n\t\t\tinputValidationErrorBorder: this.inputValidationErrorBorder,\n\t\t\thistory,\n\t\t\tshowHistoryHint: options.showHistoryHint,\n\t\t\tflexibleHeight,\n\t\t\tflexibleWidth,\n\t\t\tflexibleMaxHeight\n\t\t}));\n\n\t\tthis.regex = this._register(new RegexCheckbox({\n\t\t\tappendTitle: appendRegexLabel,\n\t\t\tisChecked: false,\n\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground\n\t\t}));\n\t\tthis._register(this.regex.onChange(viaKeyboard => {\n\t\t\tthis._onDidOptionChange.fire(viaKeyboard);\n\t\t\tif (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {\n\t\t\t\tthis.inputBox.focus();\n\t\t\t}\n\t\t\tthis.validate();\n\t\t}));\n\t\tthis._register(this.regex.onKeyDown(e => {\n\t\t\tthis._onRegexKeyDown.fire(e);\n\t\t}));\n\n\t\tthis.wholeWords = this._register(new WholeWordsCheckbox({\n\t\t\tappendTitle: appendWholeWordsLabel,\n\t\t\tisChecked: false,\n\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground\n\t\t}));\n\t\tthis._register(this.wholeWords.onChange(viaKeyboard => {\n\t\t\tthis._onDidOptionChange.fire(viaKeyboard);\n\t\t\tif (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {\n\t\t\t\tthis.inputBox.focus();\n\t\t\t}\n\t\t\tthis.validate();\n\t\t}));\n\n\t\tthis.caseSensitive = this._register(new CaseSensitiveCheckbox({\n\t\t\tappendTitle: appendCaseSensitiveLabel,\n\t\t\tisChecked: false,\n\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground\n\t\t}));\n\t\tthis._register(this.caseSensitive.onChange(viaKeyboard => {\n\t\t\tthis._onDidOptionChange.fire(viaKeyboard);\n\t\t\tif (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {\n\t\t\t\tthis.inputBox.focus();\n\t\t\t}\n\t\t\tthis.validate();\n\t\t}));\n\t\tthis._register(this.caseSensitive.onKeyDown(e => {\n\t\t\tthis._onCaseSensitiveKeyDown.fire(e);\n\t\t}));\n\n\t\tif (this._showOptionButtons) {\n\t\t\tthis.inputBox.paddingRight = this.caseSensitive.width() + this.wholeWords.width() + this.regex.width();\n\t\t}\n\n\t\t// Arrow-Key support to navigate between options\n\t\tlet indexes = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];\n\t\tthis.onkeydown(this.domNode, (event: IKeyboardEvent) => {\n\t\t\tif (event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Escape)) {\n\t\t\t\tlet index = indexes.indexOf(<HTMLElement>document.activeElement);\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tlet newIndex: number = -1;\n\t\t\t\t\tif (event.equals(KeyCode.RightArrow)) {\n\t\t\t\t\t\tnewIndex = (index + 1) % indexes.length;\n\t\t\t\t\t} else if (event.equals(KeyCode.LeftArrow)) {\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tnewIndex = indexes.length - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewIndex = index - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (event.equals(KeyCode.Escape)) {\n\t\t\t\t\t\tindexes[index].blur();\n\t\t\t\t\t\tthis.inputBox.focus();\n\t\t\t\t\t} else if (newIndex >= 0) {\n\t\t\t\t\t\tindexes[newIndex].focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\n\t\tthis.controls = document.createElement('div');\n\t\tthis.controls.className = 'controls';\n\t\tthis.controls.style.display = this._showOptionButtons ? 'block' : 'none';\n\t\tthis.controls.appendChild(this.caseSensitive.domNode);\n\t\tthis.controls.appendChild(this.wholeWords.domNode);\n\t\tthis.controls.appendChild(this.regex.domNode);\n\n\t\tthis.domNode.appendChild(this.controls);\n\n\t\tif (parent) {\n\t\t\tparent.appendChild(this.domNode);\n\t\t}\n\n\t\tthis._register(dom.addDisposableListener(this.inputBox.inputElement, 'compositionstart', (e: CompositionEvent) => {\n\t\t\tthis.imeSessionInProgress = true;\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(this.inputBox.inputElement, 'compositionend', (e: CompositionEvent) => {\n\t\t\tthis.imeSessionInProgress = false;\n\t\t\tthis._onInput.fire();\n\t\t}));\n\n\t\tthis.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e));\n\t\tthis.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e));\n\t\tthis.oninput(this.inputBox.inputElement, (e) => this._onInput.fire());\n\t\tthis.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e));\n\t}\n\n\tpublic enable(): void {\n\t\tthis.domNode.classList.remove('disabled');\n\t\tthis.inputBox.enable();\n\t\tthis.regex.enable();\n\t\tthis.wholeWords.enable();\n\t\tthis.caseSensitive.enable();\n\t}\n\n\tpublic disable(): void {\n\t\tthis.domNode.classList.add('disabled');\n\t\tthis.inputBox.disable();\n\t\tthis.regex.disable();\n\t\tthis.wholeWords.disable();\n\t\tthis.caseSensitive.disable();\n\t}\n\n\tpublic setFocusInputOnOptionClick(value: boolean): void {\n\t\tthis.fixFocusOnOptionClickEnabled = value;\n\t}\n\n\tpublic setEnabled(enabled: boolean): void {\n\t\tif (enabled) {\n\t\t\tthis.enable();\n\t\t} else {\n\t\t\tthis.disable();\n\t\t}\n\t}\n\n\tpublic getValue(): string {\n\t\treturn this.inputBox.value;\n\t}\n\n\tpublic setValue(value: string): void {\n\t\tif (this.inputBox.value !== value) {\n\t\t\tthis.inputBox.value = value;\n\t\t}\n\t}\n\n\tpublic style(styles: IFindInputStyles): void {\n\t\tthis.inputActiveOptionBorder = styles.inputActiveOptionBorder;\n\t\tthis.inputActiveOptionForeground = styles.inputActiveOptionForeground;\n\t\tthis.inputActiveOptionBackground = styles.inputActiveOptionBackground;\n\t\tthis.inputBackground = styles.inputBackground;\n\t\tthis.inputForeground = styles.inputForeground;\n\t\tthis.inputBorder = styles.inputBorder;\n\n\t\tthis.inputValidationInfoBackground = styles.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = styles.inputValidationInfoForeground;\n\t\tthis.inputValidationInfoBorder = styles.inputValidationInfoBorder;\n\t\tthis.inputValidationWarningBackground = styles.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = styles.inputValidationWarningForeground;\n\t\tthis.inputValidationWarningBorder = styles.inputValidationWarningBorder;\n\t\tthis.inputValidationErrorBackground = styles.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = styles.inputValidationErrorForeground;\n\t\tthis.inputValidationErrorBorder = styles.inputValidationErrorBorder;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tif (this.domNode) {\n\t\t\tconst checkBoxStyles: ICheckboxStyles = {\n\t\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground,\n\t\t\t};\n\t\t\tthis.regex.style(checkBoxStyles);\n\t\t\tthis.wholeWords.style(checkBoxStyles);\n\t\t\tthis.caseSensitive.style(checkBoxStyles);\n\n\t\t\tconst inputBoxStyles: IInputBoxStyles = {\n\t\t\t\tinputBackground: this.inputBackground,\n\t\t\t\tinputForeground: this.inputForeground,\n\t\t\t\tinputBorder: this.inputBorder,\n\t\t\t\tinputValidationInfoBackground: this.inputValidationInfoBackground,\n\t\t\t\tinputValidationInfoForeground: this.inputValidationInfoForeground,\n\t\t\t\tinputValidationInfoBorder: this.inputValidationInfoBorder,\n\t\t\t\tinputValidationWarningBackground: this.inputValidationWarningBackground,\n\t\t\t\tinputValidationWarningForeground: this.inputValidationWarningForeground,\n\t\t\t\tinputValidationWarningBorder: this.inputValidationWarningBorder,\n\t\t\t\tinputValidationErrorBackground: this.inputValidationErrorBackground,\n\t\t\t\tinputValidationErrorForeground: this.inputValidationErrorForeground,\n\t\t\t\tinputValidationErrorBorder: this.inputValidationErrorBorder\n\t\t\t};\n\t\t\tthis.inputBox.style(inputBoxStyles);\n\t\t}\n\t}\n\n\tpublic select(): void {\n\t\tthis.inputBox.select();\n\t}\n\n\tpublic focus(): void {\n\t\tthis.inputBox.focus();\n\t}\n\n\tpublic getCaseSensitive(): boolean {\n\t\treturn this.caseSensitive.checked;\n\t}\n\n\tpublic setCaseSensitive(value: boolean): void {\n\t\tthis.caseSensitive.checked = value;\n\t}\n\n\tpublic getWholeWords(): boolean {\n\t\treturn this.wholeWords.checked;\n\t}\n\n\tpublic setWholeWords(value: boolean): void {\n\t\tthis.wholeWords.checked = value;\n\t}\n\n\tpublic getRegex(): boolean {\n\t\treturn this.regex.checked;\n\t}\n\n\tpublic setRegex(value: boolean): void {\n\t\tthis.regex.checked = value;\n\t\tthis.validate();\n\t}\n\n\tpublic focusOnCaseSensitive(): void {\n\t\tthis.caseSensitive.focus();\n\t}\n\n\tprivate _lastHighlightFindOptions: number = 0;\n\tpublic highlightFindOptions(): void {\n\t\tthis.domNode.classList.remove('highlight-' + (this._lastHighlightFindOptions));\n\t\tthis._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions;\n\t\tthis.domNode.classList.add('highlight-' + (this._lastHighlightFindOptions));\n\t}\n\n\tpublic validate(): void {\n\t\tthis.inputBox.validate();\n\t}\n\n\tpublic clearMessage(): void {\n\t\tthis.inputBox.hideMessage();\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Checkbox, ICheckboxStyles } from 'vs/base/browser/ui/checkbox/checkbox';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { IFindInputCheckboxOpts } from 'vs/base/browser/ui/findinput/findInputCheckboxes';\nimport { HistoryInputBox, IInputBoxStyles, IInputValidator } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport 'vs/css!./findInput';\nimport * as nls from 'vs/nls';\n\n\nexport interface IReplaceInputOptions extends IReplaceInputStyles {\n\treadonly placeholder?: string;\n\treadonly validation?: IInputValidator;\n\treadonly label: string;\n\treadonly flexibleHeight?: boolean;\n\treadonly flexibleWidth?: boolean;\n\treadonly flexibleMaxHeight?: number;\n\n\treadonly appendPreserveCaseLabel?: string;\n\treadonly history?: string[];\n\treadonly showHistoryHint?: () => boolean;\n}\n\nexport interface IReplaceInputStyles extends IInputBoxStyles {\n\tinputActiveOptionBorder?: Color;\n\tinputActiveOptionForeground?: Color;\n\tinputActiveOptionBackground?: Color;\n}\n\nconst NLS_DEFAULT_LABEL = nls.localize('defaultLabel', \"input\");\nconst NLS_PRESERVE_CASE_LABEL = nls.localize('label.preserveCaseCheckbox', \"Preserve Case\");\n\nexport class PreserveCaseCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\t// TODO: does this need its own icon?\n\t\t\ticon: Codicon.preserveCase,\n\t\t\ttitle: NLS_PRESERVE_CASE_LABEL + opts.appendTitle,\n\t\t\tisChecked: opts.isChecked,\n\t\t\tinputActiveOptionBorder: opts.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: opts.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: opts.inputActiveOptionBackground\n\t\t});\n\t}\n}\n\nexport class ReplaceInput extends Widget {\n\n\tprivate contextViewProvider: IContextViewProvider | undefined;\n\tprivate placeholder: string;\n\tprivate validation?: IInputValidator;\n\tprivate label: string;\n\tprivate fixFocusOnOptionClickEnabled = true;\n\n\tprivate inputActiveOptionBorder?: Color;\n\tprivate inputActiveOptionForeground?: Color;\n\tprivate inputActiveOptionBackground?: Color;\n\tprivate inputBackground?: Color;\n\tprivate inputForeground?: Color;\n\tprivate inputBorder?: Color;\n\n\tprivate inputValidationInfoBorder?: Color;\n\tprivate inputValidationInfoBackground?: Color;\n\tprivate inputValidationInfoForeground?: Color;\n\tprivate inputValidationWarningBorder?: Color;\n\tprivate inputValidationWarningBackground?: Color;\n\tprivate inputValidationWarningForeground?: Color;\n\tprivate inputValidationErrorBorder?: Color;\n\tprivate inputValidationErrorBackground?: Color;\n\tprivate inputValidationErrorForeground?: Color;\n\n\tprivate preserveCase: PreserveCaseCheckbox;\n\tprivate cachedOptionsWidth: number = 0;\n\tpublic domNode: HTMLElement;\n\tpublic inputBox: HistoryInputBox;\n\n\tprivate readonly _onDidOptionChange = this._register(new Emitter<boolean>());\n\tpublic readonly onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event;\n\n\tprivate readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;\n\n\tprivate readonly _onMouseDown = this._register(new Emitter<IMouseEvent>());\n\n\tprivate readonly _onInput = this._register(new Emitter<void>());\n\n\tprivate readonly _onKeyUp = this._register(new Emitter<IKeyboardEvent>());\n\n\tprivate _onPreserveCaseKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onPreserveCaseKeyDown: Event<IKeyboardEvent> = this._onPreserveCaseKeyDown.event;\n\n\tconstructor(parent: HTMLElement | null, contextViewProvider: IContextViewProvider | undefined, private readonly _showOptionButtons: boolean, options: IReplaceInputOptions) {\n\t\tsuper();\n\t\tthis.contextViewProvider = contextViewProvider;\n\t\tthis.placeholder = options.placeholder || '';\n\t\tthis.validation = options.validation;\n\t\tthis.label = options.label || NLS_DEFAULT_LABEL;\n\n\t\tthis.inputActiveOptionBorder = options.inputActiveOptionBorder;\n\t\tthis.inputActiveOptionForeground = options.inputActiveOptionForeground;\n\t\tthis.inputActiveOptionBackground = options.inputActiveOptionBackground;\n\t\tthis.inputBackground = options.inputBackground;\n\t\tthis.inputForeground = options.inputForeground;\n\t\tthis.inputBorder = options.inputBorder;\n\n\t\tthis.inputValidationInfoBorder = options.inputValidationInfoBorder;\n\t\tthis.inputValidationInfoBackground = options.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = options.inputValidationInfoForeground;\n\t\tthis.inputValidationWarningBorder = options.inputValidationWarningBorder;\n\t\tthis.inputValidationWarningBackground = options.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = options.inputValidationWarningForeground;\n\t\tthis.inputValidationErrorBorder = options.inputValidationErrorBorder;\n\t\tthis.inputValidationErrorBackground = options.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = options.inputValidationErrorForeground;\n\n\t\tconst appendPreserveCaseLabel = options.appendPreserveCaseLabel || '';\n\t\tconst history = options.history || [];\n\t\tconst flexibleHeight = !!options.flexibleHeight;\n\t\tconst flexibleWidth = !!options.flexibleWidth;\n\t\tconst flexibleMaxHeight = options.flexibleMaxHeight;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.classList.add('monaco-findInput');\n\n\t\tthis.inputBox = this._register(new HistoryInputBox(this.domNode, this.contextViewProvider, {\n\t\t\tariaLabel: this.label || '',\n\t\t\tplaceholder: this.placeholder || '',\n\t\t\tvalidationOptions: {\n\t\t\t\tvalidation: this.validation\n\t\t\t},\n\t\t\tinputBackground: this.inputBackground,\n\t\t\tinputForeground: this.inputForeground,\n\t\t\tinputBorder: this.inputBorder,\n\t\t\tinputValidationInfoBackground: this.inputValidationInfoBackground,\n\t\t\tinputValidationInfoForeground: this.inputValidationInfoForeground,\n\t\t\tinputValidationInfoBorder: this.inputValidationInfoBorder,\n\t\t\tinputValidationWarningBackground: this.inputValidationWarningBackground,\n\t\t\tinputValidationWarningForeground: this.inputValidationWarningForeground,\n\t\t\tinputValidationWarningBorder: this.inputValidationWarningBorder,\n\t\t\tinputValidationErrorBackground: this.inputValidationErrorBackground,\n\t\t\tinputValidationErrorForeground: this.inputValidationErrorForeground,\n\t\t\tinputValidationErrorBorder: this.inputValidationErrorBorder,\n\t\t\thistory,\n\t\t\tshowHistoryHint: options.showHistoryHint,\n\t\t\tflexibleHeight,\n\t\t\tflexibleWidth,\n\t\t\tflexibleMaxHeight\n\t\t}));\n\n\t\tthis.preserveCase = this._register(new PreserveCaseCheckbox({\n\t\t\tappendTitle: appendPreserveCaseLabel,\n\t\t\tisChecked: false,\n\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground,\n\t\t}));\n\t\tthis._register(this.preserveCase.onChange(viaKeyboard => {\n\t\t\tthis._onDidOptionChange.fire(viaKeyboard);\n\t\t\tif (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {\n\t\t\t\tthis.inputBox.focus();\n\t\t\t}\n\t\t\tthis.validate();\n\t\t}));\n\t\tthis._register(this.preserveCase.onKeyDown(e => {\n\t\t\tthis._onPreserveCaseKeyDown.fire(e);\n\t\t}));\n\n\t\tif (this._showOptionButtons) {\n\t\t\tthis.cachedOptionsWidth = this.preserveCase.width();\n\t\t} else {\n\t\t\tthis.cachedOptionsWidth = 0;\n\t\t}\n\n\t\t// Arrow-Key support to navigate between options\n\t\tlet indexes = [this.preserveCase.domNode];\n\t\tthis.onkeydown(this.domNode, (event: IKeyboardEvent) => {\n\t\t\tif (event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Escape)) {\n\t\t\t\tlet index = indexes.indexOf(<HTMLElement>document.activeElement);\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tlet newIndex: number = -1;\n\t\t\t\t\tif (event.equals(KeyCode.RightArrow)) {\n\t\t\t\t\t\tnewIndex = (index + 1) % indexes.length;\n\t\t\t\t\t} else if (event.equals(KeyCode.LeftArrow)) {\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tnewIndex = indexes.length - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewIndex = index - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (event.equals(KeyCode.Escape)) {\n\t\t\t\t\t\tindexes[index].blur();\n\t\t\t\t\t\tthis.inputBox.focus();\n\t\t\t\t\t} else if (newIndex >= 0) {\n\t\t\t\t\t\tindexes[newIndex].focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\n\t\tlet controls = document.createElement('div');\n\t\tcontrols.className = 'controls';\n\t\tcontrols.style.display = this._showOptionButtons ? 'block' : 'none';\n\t\tcontrols.appendChild(this.preserveCase.domNode);\n\n\t\tthis.domNode.appendChild(controls);\n\n\t\tif (parent) {\n\t\t\tparent.appendChild(this.domNode);\n\t\t}\n\n\t\tthis.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e));\n\t\tthis.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e));\n\t\tthis.oninput(this.inputBox.inputElement, (e) => this._onInput.fire());\n\t\tthis.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e));\n\t}\n\n\tpublic enable(): void {\n\t\tthis.domNode.classList.remove('disabled');\n\t\tthis.inputBox.enable();\n\t\tthis.preserveCase.enable();\n\t}\n\n\tpublic disable(): void {\n\t\tthis.domNode.classList.add('disabled');\n\t\tthis.inputBox.disable();\n\t\tthis.preserveCase.disable();\n\t}\n\n\tpublic setEnabled(enabled: boolean): void {\n\t\tif (enabled) {\n\t\t\tthis.enable();\n\t\t} else {\n\t\t\tthis.disable();\n\t\t}\n\t}\n\n\tpublic style(styles: IReplaceInputStyles): void {\n\t\tthis.inputActiveOptionBorder = styles.inputActiveOptionBorder;\n\t\tthis.inputActiveOptionForeground = styles.inputActiveOptionForeground;\n\t\tthis.inputActiveOptionBackground = styles.inputActiveOptionBackground;\n\t\tthis.inputBackground = styles.inputBackground;\n\t\tthis.inputForeground = styles.inputForeground;\n\t\tthis.inputBorder = styles.inputBorder;\n\n\t\tthis.inputValidationInfoBackground = styles.inputValidationInfoBackground;\n\t\tthis.inputValidationInfoForeground = styles.inputValidationInfoForeground;\n\t\tthis.inputValidationInfoBorder = styles.inputValidationInfoBorder;\n\t\tthis.inputValidationWarningBackground = styles.inputValidationWarningBackground;\n\t\tthis.inputValidationWarningForeground = styles.inputValidationWarningForeground;\n\t\tthis.inputValidationWarningBorder = styles.inputValidationWarningBorder;\n\t\tthis.inputValidationErrorBackground = styles.inputValidationErrorBackground;\n\t\tthis.inputValidationErrorForeground = styles.inputValidationErrorForeground;\n\t\tthis.inputValidationErrorBorder = styles.inputValidationErrorBorder;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tif (this.domNode) {\n\t\t\tconst checkBoxStyles: ICheckboxStyles = {\n\t\t\t\tinputActiveOptionBorder: this.inputActiveOptionBorder,\n\t\t\t\tinputActiveOptionForeground: this.inputActiveOptionForeground,\n\t\t\t\tinputActiveOptionBackground: this.inputActiveOptionBackground,\n\t\t\t};\n\t\t\tthis.preserveCase.style(checkBoxStyles);\n\n\t\t\tconst inputBoxStyles: IInputBoxStyles = {\n\t\t\t\tinputBackground: this.inputBackground,\n\t\t\t\tinputForeground: this.inputForeground,\n\t\t\t\tinputBorder: this.inputBorder,\n\t\t\t\tinputValidationInfoBackground: this.inputValidationInfoBackground,\n\t\t\t\tinputValidationInfoForeground: this.inputValidationInfoForeground,\n\t\t\t\tinputValidationInfoBorder: this.inputValidationInfoBorder,\n\t\t\t\tinputValidationWarningBackground: this.inputValidationWarningBackground,\n\t\t\t\tinputValidationWarningForeground: this.inputValidationWarningForeground,\n\t\t\t\tinputValidationWarningBorder: this.inputValidationWarningBorder,\n\t\t\t\tinputValidationErrorBackground: this.inputValidationErrorBackground,\n\t\t\t\tinputValidationErrorForeground: this.inputValidationErrorForeground,\n\t\t\t\tinputValidationErrorBorder: this.inputValidationErrorBorder\n\t\t\t};\n\t\t\tthis.inputBox.style(inputBoxStyles);\n\t\t}\n\t}\n\n\tpublic select(): void {\n\t\tthis.inputBox.select();\n\t}\n\n\tpublic focus(): void {\n\t\tthis.inputBox.focus();\n\t}\n\n\tpublic getPreserveCase(): boolean {\n\t\treturn this.preserveCase.checked;\n\t}\n\n\tpublic setPreserveCase(value: boolean): void {\n\t\tthis.preserveCase.checked = value;\n\t}\n\n\tpublic focusOnPreserve(): void {\n\t\tthis.preserveCase.focus();\n\t}\n\n\tpublic validate(): void {\n\t\tif (this.inputBox) {\n\t\t\tthis.inputBox.validate();\n\t\t}\n\t}\n\n\tpublic set width(newWidth: number) {\n\t\tthis.inputBox.paddingRight = this.cachedOptionsWidth;\n\t\tthis.inputBox.width = newWidth;\n\t\tthis.domNode.style.width = newWidth + 'px';\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\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 { isFirefox } from 'vs/base/browser/browser';\nimport { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch';\nimport { $, addDisposableListener, append, clearNode, createStyleSheet, Dimension, EventHelper, EventLike, EventType, getActiveElement, IDomNodePagePosition, isAncestor, isInShadowDOM } from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { ActionBar, ActionsOrientation, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { formatRule } from 'vs/base/browser/ui/codicons/codiconStyles';\nimport { AnchorAlignment, layout, LayoutAnchorPosition } from 'vs/base/browser/ui/contextview/contextview';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { EmptySubmenuAction, IAction, IActionRunner, Separator, SubmenuAction } from 'vs/base/common/actions';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Event } from 'vs/base/common/event';\nimport { stripIcons } from 'vs/base/common/iconLabels';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { isLinux, isMacintosh } from 'vs/base/common/platform';\nimport { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\nimport * as strings from 'vs/base/common/strings';\n\nexport const MENU_MNEMONIC_REGEX = /\\(&([^\\s&])\\)|(^|[^&])&([^\\s&])/;\nexport const MENU_ESCAPED_MNEMONIC_REGEX = /(&)?(&)([^\\s&])/g;\n\n\n\nexport enum Direction {\n\tRight,\n\tLeft\n}\n\nexport interface IMenuOptions {\n\tcontext?: unknown;\n\tactionViewItemProvider?: IActionViewItemProvider;\n\tactionRunner?: IActionRunner;\n\tgetKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;\n\tariaLabel?: string;\n\tenableMnemonics?: boolean;\n\tanchorAlignment?: AnchorAlignment;\n\texpandDirection?: Direction;\n\tuseEventAsContext?: boolean;\n\tsubmenuIds?: Set<string>;\n}\n\nexport interface IMenuStyles {\n\tshadowColor?: Color;\n\tborderColor?: Color;\n\tforegroundColor?: Color;\n\tbackgroundColor?: Color;\n\tselectionForegroundColor?: Color;\n\tselectionBackgroundColor?: Color;\n\tselectionBorderColor?: Color;\n\tseparatorColor?: Color;\n\tscrollbarShadow?: Color;\n\tscrollbarSliderBackground?: Color;\n\tscrollbarSliderHoverBackground?: Color;\n\tscrollbarSliderActiveBackground?: Color;\n}\n\ninterface ISubMenuData {\n\tparent: Menu;\n\tsubmenu?: Menu;\n}\n\nexport class Menu extends ActionBar {\n\tprivate mnemonics: Map<string, Array<BaseMenuActionViewItem>>;\n\tprivate readonly menuDisposables: DisposableStore;\n\tprivate scrollableElement: DomScrollableElement;\n\tprivate menuElement: HTMLElement;\n\tstatic globalStyleSheet: HTMLStyleElement;\n\tprotected styleSheet: HTMLStyleElement | undefined;\n\n\tconstructor(container: HTMLElement, actions: ReadonlyArray<IAction>, options: IMenuOptions = {}) {\n\t\tcontainer.classList.add('monaco-menu-container');\n\t\tcontainer.setAttribute('role', 'presentation');\n\t\tconst menuElement = document.createElement('div');\n\t\tmenuElement.classList.add('monaco-menu');\n\t\tmenuElement.setAttribute('role', 'presentation');\n\n\t\tsuper(menuElement, {\n\t\t\torientation: ActionsOrientation.VERTICAL,\n\t\t\tactionViewItemProvider: action => this.doGetActionViewItem(action, options, parentData),\n\t\t\tcontext: options.context,\n\t\t\tactionRunner: options.actionRunner,\n\t\t\tariaLabel: options.ariaLabel,\n\t\t\tfocusOnlyEnabledItems: true,\n\t\t\ttriggerKeys: { keys: [KeyCode.Enter, ...(isMacintosh || isLinux ? [KeyCode.Space] : [])], keyDown: true }\n\t\t});\n\n\t\tthis.menuElement = menuElement;\n\n\t\tthis.actionsList.setAttribute('role', 'menu');\n\n\t\tthis.actionsList.tabIndex = 0;\n\n\t\tthis.menuDisposables = this._register(new DisposableStore());\n\n\t\tthis.initializeOrUpdateStyleSheet(container, {});\n\n\t\tthis._register(Gesture.addTarget(menuElement));\n\n\t\taddDisposableListener(menuElement, EventType.KEY_DOWN, (e) => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Stop tab navigation of menus\n\t\t\tif (event.equals(KeyCode.Tab)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tif (options.enableMnemonics) {\n\t\t\tthis.menuDisposables.add(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => {\n\t\t\t\tconst key = e.key.toLocaleLowerCase();\n\t\t\t\tif (this.mnemonics.has(key)) {\n\t\t\t\t\tEventHelper.stop(e, true);\n\t\t\t\t\tconst actions = this.mnemonics.get(key)!;\n\n\t\t\t\t\tif (actions.length === 1) {\n\t\t\t\t\t\tif (actions[0] instanceof SubmenuMenuActionViewItem && actions[0].container) {\n\t\t\t\t\t\t\tthis.focusItemByElement(actions[0].container);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tactions[0].onClick(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (actions.length > 1) {\n\t\t\t\t\t\tconst action = actions.shift();\n\t\t\t\t\t\tif (action && action.container) {\n\t\t\t\t\t\t\tthis.focusItemByElement(action.container);\n\t\t\t\t\t\t\tactions.push(action);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.mnemonics.set(key, actions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tif (isLinux) {\n\t\t\tthis._register(addDisposableListener(menuElement, EventType.KEY_DOWN, e => {\n\t\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t\tif (event.equals(KeyCode.Home) || event.equals(KeyCode.PageUp)) {\n\t\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t\t\tthis.focusNext();\n\t\t\t\t\tEventHelper.stop(e, true);\n\t\t\t\t} else if (event.equals(KeyCode.End) || event.equals(KeyCode.PageDown)) {\n\t\t\t\t\tthis.focusedItem = 0;\n\t\t\t\t\tthis.focusPrevious();\n\t\t\t\t\tEventHelper.stop(e, true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this.domNode, EventType.MOUSE_OUT, e => {\n\t\t\tlet relatedTarget = e.relatedTarget as HTMLElement;\n\t\t\tif (!isAncestor(relatedTarget, this.domNode)) {\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.updateFocus();\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this.actionsList, EventType.MOUSE_OVER, e => {\n\t\t\tlet target = e.target as HTMLElement;\n\t\t\tif (!target || !isAncestor(target, this.actionsList) || target === this.actionsList) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (target.parentElement !== this.actionsList && target.parentElement !== null) {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t}\n\n\t\t\tif (target.classList.contains('action-item')) {\n\t\t\t\tconst lastFocusedItem = this.focusedItem;\n\t\t\t\tthis.setFocusedItem(target);\n\n\t\t\t\tif (lastFocusedItem !== this.focusedItem) {\n\t\t\t\t\tthis.updateFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Support touch on actions list to focus items (needed for submenus)\n\t\tthis._register(Gesture.addTarget(this.actionsList));\n\t\tthis._register(addDisposableListener(this.actionsList, TouchEventType.Tap, e => {\n\t\t\tlet target = e.initialTarget as HTMLElement;\n\t\t\tif (!target || !isAncestor(target, this.actionsList) || target === this.actionsList) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (target.parentElement !== this.actionsList && target.parentElement !== null) {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t}\n\n\t\t\tif (target.classList.contains('action-item')) {\n\t\t\t\tconst lastFocusedItem = this.focusedItem;\n\t\t\t\tthis.setFocusedItem(target);\n\n\t\t\t\tif (lastFocusedItem !== this.focusedItem) {\n\t\t\t\t\tthis.updateFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\n\t\tlet parentData: ISubMenuData = {\n\t\t\tparent: this\n\t\t};\n\n\t\tthis.mnemonics = new Map<string, Array<BaseMenuActionViewItem>>();\n\n\t\t// Scroll Logic\n\t\tthis.scrollableElement = this._register(new DomScrollableElement(menuElement, {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t\thorizontal: ScrollbarVisibility.Hidden,\n\t\t\tvertical: ScrollbarVisibility.Visible,\n\t\t\tverticalScrollbarSize: 7,\n\t\t\thandleMouseWheel: true,\n\t\t\tuseShadows: true\n\t\t}));\n\n\t\tconst scrollElement = this.scrollableElement.getDomNode();\n\t\tscrollElement.style.position = '';\n\n\t\t// Support scroll on menu drag\n\t\tthis._register(addDisposableListener(menuElement, TouchEventType.Change, e => {\n\t\t\tEventHelper.stop(e, true);\n\n\t\t\tconst scrollTop = this.scrollableElement.getScrollPosition().scrollTop;\n\t\t\tthis.scrollableElement.setScrollPosition({ scrollTop: scrollTop - e.translationY });\n\t\t}));\n\n\t\tthis._register(addDisposableListener(scrollElement, EventType.MOUSE_UP, e => {\n\t\t\t// Absorb clicks in menu dead space https://github.com/microsoft/vscode/issues/63575\n\t\t\t// We do this on the scroll element so the scroll bar doesn't dismiss the menu either\n\t\t\te.preventDefault();\n\t\t}));\n\n\t\tmenuElement.style.maxHeight = `${Math.max(10, window.innerHeight - container.getBoundingClientRect().top - 35)}px`;\n\n\t\tactions = actions.filter(a => {\n\t\t\tif (options.submenuIds?.has(a.id)) {\n\t\t\t\tconsole.warn(`Found submenu cycle: ${a.id}`);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\n\t\tthis.push(actions, { icon: true, label: true, isMenu: true });\n\n\t\tcontainer.appendChild(this.scrollableElement.getDomNode());\n\t\tthis.scrollableElement.scanDomNode();\n\n\t\tthis.viewItems.filter(item => !(item instanceof MenuSeparatorActionViewItem)).forEach((item, index, array) => {\n\t\t\t(item as BaseMenuActionViewItem).updatePositionInSet(index + 1, array.length);\n\t\t});\n\t}\n\n\tprivate initializeOrUpdateStyleSheet(container: HTMLElement, style: IMenuStyles): void {\n\t\tif (!this.styleSheet) {\n\t\t\tif (isInShadowDOM(container)) {\n\t\t\t\tthis.styleSheet = createStyleSheet(container);\n\t\t\t} else {\n\t\t\t\tif (!Menu.globalStyleSheet) {\n\t\t\t\t\tMenu.globalStyleSheet = createStyleSheet();\n\t\t\t\t}\n\t\t\t\tthis.styleSheet = Menu.globalStyleSheet;\n\t\t\t}\n\t\t}\n\t\tthis.styleSheet.textContent = getMenuWidgetCSS(style, isInShadowDOM(container));\n\t}\n\n\tstyle(style: IMenuStyles): void {\n\t\tconst container = this.getContainer();\n\n\t\tthis.initializeOrUpdateStyleSheet(container, style);\n\n\t\tconst fgColor = style.foregroundColor ? `${style.foregroundColor}` : '';\n\t\tconst bgColor = style.backgroundColor ? `${style.backgroundColor}` : '';\n\t\tconst border = style.borderColor ? `1px solid ${style.borderColor}` : '';\n\t\tconst shadow = style.shadowColor ? `0 2px 4px ${style.shadowColor}` : '';\n\n\t\tcontainer.style.border = border;\n\t\tthis.domNode.style.color = fgColor;\n\t\tthis.domNode.style.backgroundColor = bgColor;\n\t\tcontainer.style.boxShadow = shadow;\n\n\t\tif (this.viewItems) {\n\t\t\tthis.viewItems.forEach(item => {\n\t\t\t\tif (item instanceof BaseMenuActionViewItem || item instanceof MenuSeparatorActionViewItem) {\n\t\t\t\t\titem.style(style);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\toverride getContainer(): HTMLElement {\n\t\treturn this.scrollableElement.getDomNode();\n\t}\n\n\tget onScroll(): Event<ScrollEvent> {\n\t\treturn this.scrollableElement.onScroll;\n\t}\n\n\tprivate focusItemByElement(element: HTMLElement) {\n\t\tconst lastFocusedItem = this.focusedItem;\n\t\tthis.setFocusedItem(element);\n\n\t\tif (lastFocusedItem !== this.focusedItem) {\n\t\t\tthis.updateFocus();\n\t\t}\n\t}\n\n\tprivate setFocusedItem(element: HTMLElement): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tlet elem = this.actionsList.children[i];\n\t\t\tif (element === elem) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override updateFocus(fromRight?: boolean): void {\n\t\tsuper.updateFocus(fromRight, true, true);\n\n\t\tif (typeof this.focusedItem !== 'undefined') {\n\t\t\t// Workaround for #80047 caused by an issue in chromium\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=414283\n\t\t\t// When that's fixed, just call this.scrollableElement.scanDomNode()\n\t\t\tthis.scrollableElement.setScrollPosition({\n\t\t\t\tscrollTop: Math.round(this.menuElement.scrollTop)\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate doGetActionViewItem(action: IAction, options: IMenuOptions, parentData: ISubMenuData): BaseActionViewItem {\n\t\tif (action instanceof Separator) {\n\t\t\treturn new MenuSeparatorActionViewItem(options.context, action, { icon: true });\n\t\t} else if (action instanceof SubmenuAction) {\n\t\t\tconst menuActionViewItem = new SubmenuMenuActionViewItem(action, action.actions, parentData, { ...options, submenuIds: new Set([...(options.submenuIds || []), action.id]) });\n\n\t\t\tif (options.enableMnemonics) {\n\t\t\t\tconst mnemonic = menuActionViewItem.getMnemonic();\n\t\t\t\tif (mnemonic && menuActionViewItem.isEnabled()) {\n\t\t\t\t\tlet actionViewItems: BaseMenuActionViewItem[] = [];\n\t\t\t\t\tif (this.mnemonics.has(mnemonic)) {\n\t\t\t\t\t\tactionViewItems = this.mnemonics.get(mnemonic)!;\n\t\t\t\t\t}\n\n\t\t\t\t\tactionViewItems.push(menuActionViewItem);\n\n\t\t\t\t\tthis.mnemonics.set(mnemonic, actionViewItems);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn menuActionViewItem;\n\t\t} else {\n\t\t\tconst menuItemOptions: IMenuItemOptions = { enableMnemonics: options.enableMnemonics, useEventAsContext: options.useEventAsContext };\n\t\t\tif (options.getKeyBinding) {\n\t\t\t\tconst keybinding = options.getKeyBinding(action);\n\t\t\t\tif (keybinding) {\n\t\t\t\t\tconst keybindingLabel = keybinding.getLabel();\n\n\t\t\t\t\tif (keybindingLabel) {\n\t\t\t\t\t\tmenuItemOptions.keybinding = keybindingLabel;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst menuActionViewItem = new BaseMenuActionViewItem(options.context, action, menuItemOptions);\n\n\t\t\tif (options.enableMnemonics) {\n\t\t\t\tconst mnemonic = menuActionViewItem.getMnemonic();\n\t\t\t\tif (mnemonic && menuActionViewItem.isEnabled()) {\n\t\t\t\t\tlet actionViewItems: BaseMenuActionViewItem[] = [];\n\t\t\t\t\tif (this.mnemonics.has(mnemonic)) {\n\t\t\t\t\t\tactionViewItems = this.mnemonics.get(mnemonic)!;\n\t\t\t\t\t}\n\n\t\t\t\t\tactionViewItems.push(menuActionViewItem);\n\n\t\t\t\t\tthis.mnemonics.set(mnemonic, actionViewItems);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn menuActionViewItem;\n\t\t}\n\t}\n}\n\ninterface IMenuItemOptions extends IActionViewItemOptions {\n\tenableMnemonics?: boolean;\n}\n\nclass BaseMenuActionViewItem extends BaseActionViewItem {\n\n\tpublic container: HTMLElement | undefined;\n\n\tprotected override options: IMenuItemOptions;\n\tprotected item: HTMLElement | undefined;\n\n\tprivate runOnceToEnableMouseUp: RunOnceScheduler;\n\tprivate label: HTMLElement | undefined;\n\tprivate check: HTMLElement | undefined;\n\tprivate mnemonic: string | undefined;\n\tprivate cssClass: string;\n\tprotected menuStyle: IMenuStyles | undefined;\n\n\tconstructor(ctx: unknown, action: IAction, options: IMenuItemOptions = {}) {\n\t\toptions.isMenu = true;\n\t\tsuper(action, action, options);\n\n\t\tthis.options = options;\n\t\tthis.options.icon = options.icon !== undefined ? options.icon : false;\n\t\tthis.options.label = options.label !== undefined ? options.label : true;\n\t\tthis.cssClass = '';\n\n\t\t// Set mnemonic\n\t\tif (this.options.label && options.enableMnemonics) {\n\t\t\tlet label = this.getAction().label;\n\t\t\tif (label) {\n\t\t\t\tlet matches = MENU_MNEMONIC_REGEX.exec(label);\n\t\t\t\tif (matches) {\n\t\t\t\t\tthis.mnemonic = (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add mouse up listener later to avoid accidental clicks\n\t\tthis.runOnceToEnableMouseUp = new RunOnceScheduler(() => {\n\t\t\tif (!this.element) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._register(addDisposableListener(this.element, EventType.MOUSE_UP, e => {\n\t\t\t\t// removed default prevention as it conflicts\n\t\t\t\t// with BaseActionViewItem #101537\n\t\t\t\t// add back if issues arise and link new issue\n\t\t\t\tEventHelper.stop(e, true);\n\n\t\t\t\t// See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard\n\t\t\t\t// > Writing to the clipboard\n\t\t\t\t// > You can use the \"cut\" and \"copy\" commands without any special\n\t\t\t\t// permission if you are using them in a short-lived event handler\n\t\t\t\t// for a user action (for example, a click handler).\n\n\t\t\t\t// => to get the Copy and Paste context menu actions working on Firefox,\n\t\t\t\t// there should be no timeout here\n\t\t\t\tif (isFirefox) {\n\t\t\t\t\tconst mouseEvent = new StandardMouseEvent(e);\n\n\t\t\t\t\t// Allowing right click to trigger the event causes the issue described below,\n\t\t\t\t\t// but since the solution below does not work in FF, we must disable right click\n\t\t\t\t\tif (mouseEvent.rightButton) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.onClick(e);\n\t\t\t\t}\n\n\t\t\t\t// In all other cases, set timeout to allow context menu cancellation to trigger\n\t\t\t\t// otherwise the action will destroy the menu and a second context menu\n\t\t\t\t// will still trigger for right click.\n\t\t\t\telse {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.onClick(e);\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis._register(addDisposableListener(this.element, EventType.CONTEXT_MENU, e => {\n\t\t\t\tEventHelper.stop(e, true);\n\t\t\t}));\n\t\t}, 100);\n\n\t\tthis._register(this.runOnceToEnableMouseUp);\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.container = container;\n\n\t\tthis.item = append(this.element, $('a.action-menu-item'));\n\t\tif (this._action.id === Separator.ID) {\n\t\t\t// A separator is a presentation item\n\t\t\tthis.item.setAttribute('role', 'presentation');\n\t\t} else {\n\t\t\tthis.item.setAttribute('role', 'menuitem');\n\t\t\tif (this.mnemonic) {\n\t\t\t\tthis.item.setAttribute('aria-keyshortcuts', `${this.mnemonic}`);\n\t\t\t}\n\t\t}\n\n\t\tthis.check = append(this.item, $('span.menu-item-check' + Codicon.menuSelection.cssSelector));\n\t\tthis.check.setAttribute('role', 'none');\n\n\t\tthis.label = append(this.item, $('span.action-label'));\n\n\t\tif (this.options.label && this.options.keybinding) {\n\t\t\tappend(this.item, $('span.keybinding')).textContent = this.options.keybinding;\n\t\t}\n\n\t\t// Adds mouse up listener to actually run the action\n\t\tthis.runOnceToEnableMouseUp.schedule();\n\n\t\tthis.updateClass();\n\t\tthis.updateLabel();\n\t\tthis.updateTooltip();\n\t\tthis.updateEnabled();\n\t\tthis.updateChecked();\n\t}\n\n\toverride blur(): void {\n\t\tsuper.blur();\n\t\tthis.applyStyle();\n\t}\n\n\toverride focus(): void {\n\t\tsuper.focus();\n\n\t\tif (this.item) {\n\t\t\tthis.item.focus();\n\t\t}\n\n\t\tthis.applyStyle();\n\t}\n\n\tupdatePositionInSet(pos: number, setSize: number): void {\n\t\tif (this.item) {\n\t\t\tthis.item.setAttribute('aria-posinset', `${pos}`);\n\t\t\tthis.item.setAttribute('aria-setsize', `${setSize}`);\n\t\t}\n\t}\n\n\toverride updateLabel(): void {\n\t\tif (!this.label) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.options.label) {\n\t\t\tclearNode(this.label);\n\n\t\t\tlet label = stripIcons(this.getAction().label);\n\t\t\tif (label) {\n\t\t\t\tconst cleanLabel = cleanMnemonic(label);\n\t\t\t\tif (!this.options.enableMnemonics) {\n\t\t\t\t\tlabel = cleanLabel;\n\t\t\t\t}\n\n\t\t\t\tthis.label.setAttribute('aria-label', cleanLabel.replace(/&&/g, '&'));\n\n\t\t\t\tconst matches = MENU_MNEMONIC_REGEX.exec(label);\n\n\t\t\t\tif (matches) {\n\t\t\t\t\tlabel = strings.escape(label);\n\n\t\t\t\t\t// This is global, reset it\n\t\t\t\t\tMENU_ESCAPED_MNEMONIC_REGEX.lastIndex = 0;\n\t\t\t\t\tlet escMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label);\n\n\t\t\t\t\t// We can't use negative lookbehind so if we match our negative and skip\n\t\t\t\t\twhile (escMatch && escMatch[1]) {\n\t\t\t\t\t\tescMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst replaceDoubleEscapes = (str: string) => str.replace(/&&/g, '&');\n\n\t\t\t\t\tif (escMatch) {\n\t\t\t\t\t\tthis.label.append(\n\t\t\t\t\t\t\tstrings.ltrim(replaceDoubleEscapes(label.substr(0, escMatch.index)), ' '),\n\t\t\t\t\t\t\t$('u', { 'aria-hidden': 'true' },\n\t\t\t\t\t\t\t\tescMatch[3]),\n\t\t\t\t\t\t\tstrings.rtrim(replaceDoubleEscapes(label.substr(escMatch.index + escMatch[0].length)), ' '));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.label.innerText = replaceDoubleEscapes(label).trim();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.item) {\n\t\t\t\t\t\tthis.item.setAttribute('aria-keyshortcuts', (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.label.innerText = label.replace(/&&/g, '&').trim();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\toverride updateTooltip(): void {\n\t\t// menus should function like native menus and they do not have tooltips\n\t}\n\n\toverride updateClass(): void {\n\t\tif (this.cssClass && this.item) {\n\t\t\tthis.item.classList.remove(...this.cssClass.split(' '));\n\t\t}\n\t\tif (this.options.icon && this.label) {\n\t\t\tthis.cssClass = this.getAction().class || '';\n\t\t\tthis.label.classList.add('icon');\n\t\t\tif (this.cssClass) {\n\t\t\t\tthis.label.classList.add(...this.cssClass.split(' '));\n\t\t\t}\n\t\t\tthis.updateEnabled();\n\t\t} else if (this.label) {\n\t\t\tthis.label.classList.remove('icon');\n\t\t}\n\t}\n\n\toverride updateEnabled(): void {\n\t\tif (this.getAction().enabled) {\n\t\t\tif (this.element) {\n\t\t\t\tthis.element.classList.remove('disabled');\n\t\t\t\tthis.element.removeAttribute('aria-disabled');\n\t\t\t}\n\n\t\t\tif (this.item) {\n\t\t\t\tthis.item.classList.remove('disabled');\n\t\t\t\tthis.item.removeAttribute('aria-disabled');\n\t\t\t\tthis.item.tabIndex = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.element) {\n\t\t\t\tthis.element.classList.add('disabled');\n\t\t\t\tthis.element.setAttribute('aria-disabled', 'true');\n\t\t\t}\n\n\t\t\tif (this.item) {\n\t\t\t\tthis.item.classList.add('disabled');\n\t\t\t\tthis.item.setAttribute('aria-disabled', 'true');\n\t\t\t}\n\t\t}\n\t}\n\n\toverride updateChecked(): void {\n\t\tif (!this.item) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = this.getAction().checked;\n\t\tthis.item.classList.toggle('checked', !!checked);\n\t\tif (checked !== undefined) {\n\t\t\tthis.item.setAttribute('role', 'menuitemcheckbox');\n\t\t\tthis.item.setAttribute('aria-checked', checked ? 'true' : 'false');\n\t\t} else {\n\t\t\tthis.item.setAttribute('role', 'menuitem');\n\t\t\tthis.item.setAttribute('aria-checked', '');\n\t\t}\n\t}\n\n\tgetMnemonic(): string | undefined {\n\t\treturn this.mnemonic;\n\t}\n\n\tprotected applyStyle(): void {\n\t\tif (!this.menuStyle) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelected = this.element && this.element.classList.contains('focused');\n\t\tconst fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;\n\t\tconst bgColor = isSelected && this.menuStyle.selectionBackgroundColor ? this.menuStyle.selectionBackgroundColor : undefined;\n\t\tconst border = isSelected && this.menuStyle.selectionBorderColor ? `thin solid ${this.menuStyle.selectionBorderColor}` : '';\n\n\t\tif (this.item) {\n\t\t\tthis.item.style.color = fgColor ? fgColor.toString() : '';\n\t\t\tthis.item.style.backgroundColor = bgColor ? bgColor.toString() : '';\n\t\t}\n\n\t\tif (this.check) {\n\t\t\tthis.check.style.color = fgColor ? fgColor.toString() : '';\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.container.style.border = border;\n\t\t}\n\t}\n\n\tstyle(style: IMenuStyles): void {\n\t\tthis.menuStyle = style;\n\t\tthis.applyStyle();\n\t}\n}\n\nclass SubmenuMenuActionViewItem extends BaseMenuActionViewItem {\n\tprivate mysubmenu: Menu | null = null;\n\tprivate submenuContainer: HTMLElement | undefined;\n\tprivate submenuIndicator: HTMLElement | undefined;\n\tprivate readonly submenuDisposables = this._register(new DisposableStore());\n\tprivate mouseOver: boolean = false;\n\tprivate showScheduler: RunOnceScheduler;\n\tprivate hideScheduler: RunOnceScheduler;\n\tprivate expandDirection: Direction;\n\n\tconstructor(\n\t\taction: IAction,\n\t\tprivate submenuActions: ReadonlyArray<IAction>,\n\t\tprivate parentData: ISubMenuData,\n\t\tprivate submenuOptions?: IMenuOptions\n\t) {\n\t\tsuper(action, action, submenuOptions);\n\n\t\tthis.expandDirection = submenuOptions && submenuOptions.expandDirection !== undefined ? submenuOptions.expandDirection : Direction.Right;\n\n\t\tthis.showScheduler = new RunOnceScheduler(() => {\n\t\t\tif (this.mouseOver) {\n\t\t\t\tthis.cleanupExistingSubmenu(false);\n\t\t\t\tthis.createSubmenu(false);\n\t\t\t}\n\t\t}, 250);\n\n\t\tthis.hideScheduler = new RunOnceScheduler(() => {\n\t\t\tif (this.element && (!isAncestor(getActiveElement(), this.element) && this.parentData.submenu === this.mysubmenu)) {\n\t\t\t\tthis.parentData.parent.focus(false);\n\t\t\t\tthis.cleanupExistingSubmenu(true);\n\t\t\t}\n\t\t}, 750);\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.item) {\n\t\t\tthis.item.classList.add('monaco-submenu-item');\n\t\t\tthis.item.tabIndex = 0;\n\t\t\tthis.item.setAttribute('aria-haspopup', 'true');\n\t\t\tthis.updateAriaExpanded('false');\n\t\t\tthis.submenuIndicator = append(this.item, $('span.submenu-indicator' + Codicon.menuSubmenu.cssSelector));\n\t\t\tthis.submenuIndicator.setAttribute('aria-hidden', 'true');\n\t\t}\n\n\t\tthis._register(addDisposableListener(this.element, EventType.KEY_UP, e => {\n\t\t\tlet event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Enter)) {\n\t\t\t\tEventHelper.stop(e, true);\n\n\t\t\t\tthis.createSubmenu(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this.element, EventType.KEY_DOWN, e => {\n\t\t\tlet event = new StandardKeyboardEvent(e);\n\n\t\t\tif (getActiveElement() === this.item) {\n\t\t\t\tif (event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Enter)) {\n\t\t\t\t\tEventHelper.stop(e, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this.element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this.mouseOver) {\n\t\t\t\tthis.mouseOver = true;\n\n\t\t\t\tthis.showScheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this.element, EventType.MOUSE_LEAVE, e => {\n\t\t\tthis.mouseOver = false;\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this.element, EventType.FOCUS_OUT, e => {\n\t\t\tif (this.element && !isAncestor(getActiveElement(), this.element)) {\n\t\t\t\tthis.hideScheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.parentData.parent.onScroll(() => {\n\t\t\tthis.parentData.parent.focus(false);\n\t\t\tthis.cleanupExistingSubmenu(false);\n\t\t}));\n\t}\n\n\toverride updateEnabled(): void {\n\t\t// override on submenu entry\n\t\t// native menus do not observe enablement on sumbenus\n\t\t// we mimic that behavior\n\t}\n\n\toverride onClick(e: EventLike): void {\n\t\t// stop clicking from trying to run an action\n\t\tEventHelper.stop(e, true);\n\n\t\tthis.cleanupExistingSubmenu(false);\n\t\tthis.createSubmenu(true);\n\t}\n\n\tprivate cleanupExistingSubmenu(force: boolean): void {\n\t\tif (this.parentData.submenu && (force || (this.parentData.submenu !== this.mysubmenu))) {\n\n\t\t\t// disposal may throw if the submenu has already been removed\n\t\t\ttry {\n\t\t\t\tthis.parentData.submenu.dispose();\n\t\t\t} catch { }\n\n\t\t\tthis.parentData.submenu = undefined;\n\t\t\tthis.updateAriaExpanded('false');\n\t\t\tif (this.submenuContainer) {\n\t\t\t\tthis.submenuDisposables.clear();\n\t\t\t\tthis.submenuContainer = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate calculateSubmenuMenuLayout(windowDimensions: Dimension, submenu: Dimension, entry: IDomNodePagePosition, expandDirection: Direction): { top: number; left: number } {\n\t\tconst ret = { top: 0, left: 0 };\n\n\t\t// Start with horizontal\n\t\tret.left = layout(windowDimensions.width, submenu.width, { position: expandDirection === Direction.Right ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, offset: entry.left, size: entry.width });\n\n\t\t// We don't have enough room to layout the menu fully, so we are overlapping the menu\n\t\tif (ret.left >= entry.left && ret.left < entry.left + entry.width) {\n\t\t\tif (entry.left + 10 + submenu.width <= windowDimensions.width) {\n\t\t\t\tret.left = entry.left + 10;\n\t\t\t}\n\n\t\t\tentry.top += 10;\n\t\t\tentry.height = 0;\n\t\t}\n\n\t\t// Now that we have a horizontal position, try layout vertically\n\t\tret.top = layout(windowDimensions.height, submenu.height, { position: LayoutAnchorPosition.Before, offset: entry.top, size: 0 });\n\n\t\t// We didn't have enough room below, but we did above, so we shift down to align the menu\n\t\tif (ret.top + submenu.height === entry.top && ret.top + entry.height + submenu.height <= windowDimensions.height) {\n\t\t\tret.top += entry.height;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tprivate createSubmenu(selectFirstItem = true): void {\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.parentData.submenu) {\n\t\t\tthis.updateAriaExpanded('true');\n\t\t\tthis.submenuContainer = append(this.element, $('div.monaco-submenu'));\n\t\t\tthis.submenuContainer.classList.add('menubar-menu-items-holder', 'context-view');\n\n\t\t\t// Set the top value of the menu container before construction\n\t\t\t// This allows the menu constructor to calculate the proper max height\n\t\t\tconst computedStyles = getComputedStyle(this.parentData.parent.domNode);\n\t\t\tconst paddingTop = parseFloat(computedStyles.paddingTop || '0') || 0;\n\t\t\t// this.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset - paddingTop}px`;\n\t\t\tthis.submenuContainer.style.zIndex = '1';\n\t\t\tthis.submenuContainer.style.position = 'fixed';\n\t\t\tthis.submenuContainer.style.top = '0';\n\t\t\tthis.submenuContainer.style.left = '0';\n\n\t\t\tthis.parentData.submenu = new Menu(this.submenuContainer, this.submenuActions.length ? this.submenuActions : [new EmptySubmenuAction()], this.submenuOptions);\n\t\t\tif (this.menuStyle) {\n\t\t\t\tthis.parentData.submenu.style(this.menuStyle);\n\t\t\t}\n\n\t\t\t// layout submenu\n\t\t\tconst entryBox = this.element.getBoundingClientRect();\n\t\t\tconst entryBoxUpdated = {\n\t\t\t\ttop: entryBox.top - paddingTop,\n\t\t\t\tleft: entryBox.left,\n\t\t\t\theight: entryBox.height + 2 * paddingTop,\n\t\t\t\twidth: entryBox.width\n\t\t\t};\n\n\t\t\tconst viewBox = this.submenuContainer.getBoundingClientRect();\n\n\t\t\tconst { top, left } = this.calculateSubmenuMenuLayout(new Dimension(window.innerWidth, window.innerHeight), Dimension.lift(viewBox), entryBoxUpdated, this.expandDirection);\n\t\t\t// subtract offsets caused by transform parent\n\t\t\tthis.submenuContainer.style.left = `${left - viewBox.left}px`;\n\t\t\tthis.submenuContainer.style.top = `${top - viewBox.top}px`;\n\n\t\t\tthis.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_UP, e => {\n\t\t\t\tlet event = new StandardKeyboardEvent(e);\n\t\t\t\tif (event.equals(KeyCode.LeftArrow)) {\n\t\t\t\t\tEventHelper.stop(e, true);\n\n\t\t\t\t\tthis.parentData.parent.focus();\n\n\t\t\t\t\tthis.cleanupExistingSubmenu(true);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_DOWN, e => {\n\t\t\t\tlet event = new StandardKeyboardEvent(e);\n\t\t\t\tif (event.equals(KeyCode.LeftArrow)) {\n\t\t\t\t\tEventHelper.stop(e, true);\n\t\t\t\t}\n\t\t\t}));\n\n\n\t\t\tthis.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => {\n\t\t\t\tthis.parentData.parent.focus();\n\n\t\t\t\tthis.cleanupExistingSubmenu(true);\n\t\t\t}));\n\n\t\t\tthis.parentData.submenu.focus(selectFirstItem);\n\n\t\t\tthis.mysubmenu = this.parentData.submenu;\n\t\t} else {\n\t\t\tthis.parentData.submenu.focus(false);\n\t\t}\n\t}\n\n\tprivate updateAriaExpanded(value: string): void {\n\t\tif (this.item) {\n\t\t\tthis.item?.setAttribute('aria-expanded', value);\n\t\t}\n\t}\n\n\tprotected override applyStyle(): void {\n\t\tsuper.applyStyle();\n\n\t\tif (!this.menuStyle) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelected = this.element && this.element.classList.contains('focused');\n\t\tconst fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;\n\n\t\tif (this.submenuIndicator) {\n\t\t\tthis.submenuIndicator.style.color = fgColor ? `${fgColor}` : '';\n\t\t}\n\n\t\tif (this.parentData.submenu) {\n\t\t\tthis.parentData.submenu.style(this.menuStyle);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis.hideScheduler.dispose();\n\n\t\tif (this.mysubmenu) {\n\t\t\tthis.mysubmenu.dispose();\n\t\t\tthis.mysubmenu = null;\n\t\t}\n\n\t\tif (this.submenuContainer) {\n\t\t\tthis.submenuContainer = undefined;\n\t\t}\n\t}\n}\n\nclass MenuSeparatorActionViewItem extends ActionViewItem {\n\tstyle(style: IMenuStyles): void {\n\t\tif (this.label) {\n\t\t\tthis.label.style.borderBottomColor = style.separatorColor ? `${style.separatorColor}` : '';\n\t\t}\n\t}\n}\n\nexport function cleanMnemonic(label: string): string {\n\tconst regex = MENU_MNEMONIC_REGEX;\n\n\tconst matches = regex.exec(label);\n\tif (!matches) {\n\t\treturn label;\n\t}\n\n\tconst mnemonicInText = !matches[1];\n\n\treturn label.replace(regex, mnemonicInText ? '$2$3' : '').trim();\n}\n\nfunction getMenuWidgetCSS(style: IMenuStyles, isForShadowDom: boolean): string {\n\tlet result = /* css */`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${formatRule(Codicon.menuSelection)}\n${formatRule(Codicon.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;\n\n\tif (isForShadowDom) {\n\t\t// Only define scrollbar styles when used inside shadow dom,\n\t\t// otherwise leave their styling to the global workbench styling.\n\t\tresult += `\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t`;\n\n\t\t// Scrollbars\n\t\tconst scrollbarShadowColor = style.scrollbarShadow;\n\t\tif (scrollbarShadowColor) {\n\t\t\tresult += `\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\tconst scrollbarSliderBackgroundColor = style.scrollbarSliderBackground;\n\t\tif (scrollbarSliderBackgroundColor) {\n\t\t\tresult += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${scrollbarSliderBackgroundColor};\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\tconst scrollbarSliderHoverBackgroundColor = style.scrollbarSliderHoverBackground;\n\t\tif (scrollbarSliderHoverBackgroundColor) {\n\t\t\tresult += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${scrollbarSliderHoverBackgroundColor};\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\tconst scrollbarSliderActiveBackgroundColor = style.scrollbarSliderActiveBackground;\n\t\tif (scrollbarSliderActiveBackgroundColor) {\n\t\t\tresult += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${scrollbarSliderActiveBackgroundColor};\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\t}\n\n\treturn result;\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 * as dom from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { IInputBoxStyles, InputBox, IRange, MessageType } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport Severity from 'vs/base/common/severity';\nimport 'vs/css!./media/quickInput';\n\nconst $ = dom.$;\n\nexport class QuickInputBox extends Disposable {\n\n\tprivate container: HTMLElement;\n\tprivate inputBox: InputBox;\n\n\tconstructor(\n\t\tprivate parent: HTMLElement\n\t) {\n\t\tsuper();\n\t\tthis.container = dom.append(this.parent, $('.quick-input-box'));\n\t\tthis.inputBox = this._register(new InputBox(this.container, undefined));\n\t}\n\n\tonKeyDown = (handler: (event: StandardKeyboardEvent) => void): IDisposable => {\n\t\treturn dom.addDisposableListener(this.inputBox.inputElement, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\thandler(new StandardKeyboardEvent(e));\n\t\t});\n\t};\n\n\tonMouseDown = (handler: (event: StandardMouseEvent) => void): IDisposable => {\n\t\treturn dom.addDisposableListener(this.inputBox.inputElement, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\thandler(new StandardMouseEvent(e));\n\t\t});\n\t};\n\n\tonDidChange = (handler: (event: string) => void): IDisposable => {\n\t\treturn this.inputBox.onDidChange(handler);\n\t};\n\n\tget value() {\n\t\treturn this.inputBox.value;\n\t}\n\n\tset value(value: string) {\n\t\tthis.inputBox.value = value;\n\t}\n\n\tselect(range: IRange | null = null): void {\n\t\tthis.inputBox.select(range);\n\t}\n\n\tisSelectionAtEnd(): boolean {\n\t\treturn this.inputBox.isSelectionAtEnd();\n\t}\n\n\tget placeholder() {\n\t\treturn this.inputBox.inputElement.getAttribute('placeholder') || '';\n\t}\n\n\tset placeholder(placeholder: string) {\n\t\tthis.inputBox.setPlaceHolder(placeholder);\n\t}\n\n\tget ariaLabel() {\n\t\treturn this.inputBox.getAriaLabel();\n\t}\n\n\tset ariaLabel(ariaLabel: string) {\n\t\tthis.inputBox.setAriaLabel(ariaLabel);\n\t}\n\n\tget password() {\n\t\treturn this.inputBox.inputElement.type === 'password';\n\t}\n\n\tset password(password: boolean) {\n\t\tthis.inputBox.inputElement.type = password ? 'password' : 'text';\n\t}\n\n\tsetAttribute(name: string, value: string): void {\n\t\tthis.inputBox.inputElement.setAttribute(name, value);\n\t}\n\n\tremoveAttribute(name: string): void {\n\t\tthis.inputBox.inputElement.removeAttribute(name);\n\t}\n\n\tshowDecoration(decoration: Severity): void {\n\t\tif (decoration === Severity.Ignore) {\n\t\t\tthis.inputBox.hideMessage();\n\t\t} else {\n\t\t\tthis.inputBox.showMessage({ type: decoration === Severity.Info ? MessageType.INFO : decoration === Severity.Warning ? MessageType.WARNING : MessageType.ERROR, content: '' });\n\t\t}\n\t}\n\n\tstylesForType(decoration: Severity) {\n\t\treturn this.inputBox.stylesForType(decoration === Severity.Info ? MessageType.INFO : decoration === Severity.Warning ? MessageType.WARNING : MessageType.ERROR);\n\t}\n\n\tsetFocus(): void {\n\t\tthis.inputBox.focus();\n\t}\n\n\tlayout(): void {\n\t\tthis.inputBox.layout();\n\t}\n\n\tstyle(styles: IInputBoxStyles): void {\n\t\tthis.inputBox.style(styles);\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport * as types from 'vs/base/common/types';\nimport * as nls from 'vs/nls';\n\nfunction exceptionToErrorMessage(exception: any, verbose: boolean): string {\n\tif (verbose && (exception.stack || exception.stacktrace)) {\n\t\treturn nls.localize('stackTrace.format', \"{0}: {1}\", detectSystemErrorMessage(exception), stackToString(exception.stack) || stackToString(exception.stacktrace));\n\t}\n\n\treturn detectSystemErrorMessage(exception);\n}\n\nfunction stackToString(stack: string[] | string | undefined): string | undefined {\n\tif (Array.isArray(stack)) {\n\t\treturn stack.join('\\n');\n\t}\n\n\treturn stack;\n}\n\nfunction detectSystemErrorMessage(exception: any): string {\n\n\t// See https://nodejs.org/api/errors.html#errors_class_system_error\n\tif (typeof exception.code === 'string' && typeof exception.errno === 'number' && typeof exception.syscall === 'string') {\n\t\treturn nls.localize('nodeExceptionMessage', \"A system error occurred ({0})\", exception.message);\n\t}\n\n\treturn exception.message || nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\n}\n\n/**\n * Tries to generate a human readable error message out of the error. If the verbose parameter\n * is set to true, the error message will include stacktrace details if provided.\n *\n * @returns A string containing the error message.\n */\nexport function toErrorMessage(error: any = null, verbose: boolean = false): string {\n\tif (!error) {\n\t\treturn nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\n\t}\n\n\tif (Array.isArray(error)) {\n\t\tconst errors: any[] = arrays.coalesce(error);\n\t\tconst msg = toErrorMessage(errors[0], verbose);\n\n\t\tif (errors.length > 1) {\n\t\t\treturn nls.localize('error.moreErrors', \"{0} ({1} errors in total)\", msg, errors.length);\n\t\t}\n\n\t\treturn msg;\n\t}\n\n\tif (types.isString(error)) {\n\t\treturn error;\n\t}\n\n\tif (error.detail) {\n\t\tconst detail = error.detail;\n\n\t\tif (detail.error) {\n\t\t\treturn exceptionToErrorMessage(detail.error, verbose);\n\t\t}\n\n\t\tif (detail.exception) {\n\t\t\treturn exceptionToErrorMessage(detail.exception, verbose);\n\t\t}\n\t}\n\n\tif (error.stack) {\n\t\treturn exceptionToErrorMessage(error, verbose);\n\t}\n\n\tif (error.message) {\n\t\treturn error.message;\n\t}\n\n\treturn nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\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 { Modifiers } from 'vs/base/common/keybindings';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport * as nls from 'vs/nls';\n\nexport interface ModifierLabels {\n\treadonly ctrlKey: string;\n\treadonly shiftKey: string;\n\treadonly altKey: string;\n\treadonly metaKey: string;\n\treadonly separator: string;\n}\n\nexport interface KeyLabelProvider<T extends Modifiers> {\n\t(keybinding: T): string | null;\n}\n\nexport class ModifierLabelProvider {\n\n\tpublic readonly modifierLabels: ModifierLabels[];\n\n\tconstructor(mac: ModifierLabels, windows: ModifierLabels, linux: ModifierLabels = windows) {\n\t\tthis.modifierLabels = [null!]; // index 0 will never me accessed.\n\t\tthis.modifierLabels[OperatingSystem.Macintosh] = mac;\n\t\tthis.modifierLabels[OperatingSystem.Windows] = windows;\n\t\tthis.modifierLabels[OperatingSystem.Linux] = linux;\n\t}\n\n\tpublic toLabel<T extends Modifiers>(OS: OperatingSystem, parts: T[], keyLabelProvider: KeyLabelProvider<T>): string | null {\n\t\tif (parts.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst result: string[] = [];\n\t\tfor (let i = 0, len = parts.length; i < len; i++) {\n\t\t\tconst part = parts[i];\n\t\t\tconst keyLabel = keyLabelProvider(part);\n\t\t\tif (keyLabel === null) {\n\t\t\t\t// this keybinding cannot be expressed...\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tresult[i] = _simpleAsString(part, keyLabel, this.modifierLabels[OS]);\n\t\t}\n\t\treturn result.join(' ');\n\t}\n}\n\n/**\n * A label provider that prints modifiers in a suitable format for displaying in the UI.\n */\nexport const UILabelProvider = new ModifierLabelProvider(\n\t{\n\t\tctrlKey: '\\u2303',\n\t\tshiftKey: '⇧',\n\t\taltKey: '⌥',\n\t\tmetaKey: '⌘',\n\t\tseparator: '',\n\t},\n\t{\n\t\tctrlKey: nls.localize({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, \"Ctrl\"),\n\t\tshiftKey: nls.localize({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, \"Shift\"),\n\t\taltKey: nls.localize({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, \"Alt\"),\n\t\tmetaKey: nls.localize({ key: 'windowsKey', comment: ['This is the short form for the Windows key on the keyboard'] }, \"Windows\"),\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: nls.localize({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, \"Ctrl\"),\n\t\tshiftKey: nls.localize({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, \"Shift\"),\n\t\taltKey: nls.localize({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, \"Alt\"),\n\t\tmetaKey: nls.localize({ key: 'superKey', comment: ['This is the short form for the Super key on the keyboard'] }, \"Super\"),\n\t\tseparator: '+',\n\t}\n);\n\n/**\n * A label provider that prints modifiers in a suitable format for ARIA.\n */\nexport const AriaLabelProvider = new ModifierLabelProvider(\n\t{\n\t\tctrlKey: nls.localize({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, \"Control\"),\n\t\tshiftKey: nls.localize({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, \"Shift\"),\n\t\taltKey: nls.localize({ key: 'optKey.long', comment: ['This is the long form for the Alt/Option key on the keyboard'] }, \"Option\"),\n\t\tmetaKey: nls.localize({ key: 'cmdKey.long', comment: ['This is the long form for the Command key on the keyboard'] }, \"Command\"),\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: nls.localize({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, \"Control\"),\n\t\tshiftKey: nls.localize({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, \"Shift\"),\n\t\taltKey: nls.localize({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, \"Alt\"),\n\t\tmetaKey: nls.localize({ key: 'windowsKey.long', comment: ['This is the long form for the Windows key on the keyboard'] }, \"Windows\"),\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: nls.localize({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, \"Control\"),\n\t\tshiftKey: nls.localize({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, \"Shift\"),\n\t\taltKey: nls.localize({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, \"Alt\"),\n\t\tmetaKey: nls.localize({ key: 'superKey.long', comment: ['This is the long form for the Super key on the keyboard'] }, \"Super\"),\n\t\tseparator: '+',\n\t}\n);\n\n/**\n * A label provider that prints modifiers in a suitable format for Electron Accelerators.\n * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n */\nexport const ElectronAcceleratorLabelProvider = new ModifierLabelProvider(\n\t{\n\t\tctrlKey: 'Ctrl',\n\t\tshiftKey: 'Shift',\n\t\taltKey: 'Alt',\n\t\tmetaKey: 'Cmd',\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: 'Ctrl',\n\t\tshiftKey: 'Shift',\n\t\taltKey: 'Alt',\n\t\tmetaKey: 'Super',\n\t\tseparator: '+',\n\t}\n);\n\n/**\n * A label provider that prints modifiers in a suitable format for user settings.\n */\nexport const UserSettingsLabelProvider = new ModifierLabelProvider(\n\t{\n\t\tctrlKey: 'ctrl',\n\t\tshiftKey: 'shift',\n\t\taltKey: 'alt',\n\t\tmetaKey: 'cmd',\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: 'ctrl',\n\t\tshiftKey: 'shift',\n\t\taltKey: 'alt',\n\t\tmetaKey: 'win',\n\t\tseparator: '+',\n\t},\n\t{\n\t\tctrlKey: 'ctrl',\n\t\tshiftKey: 'shift',\n\t\taltKey: 'alt',\n\t\tmetaKey: 'meta',\n\t\tseparator: '+',\n\t}\n);\n\nfunction _simpleAsString(modifiers: Modifiers, key: string, labels: ModifierLabels): string {\n\tif (key === null) {\n\t\treturn '';\n\t}\n\n\tconst result: string[] = [];\n\n\t// translate modifier keys: Ctrl-Shift-Alt-Meta\n\tif (modifiers.ctrlKey) {\n\t\tresult.push(labels.ctrlKey);\n\t}\n\n\tif (modifiers.shiftKey) {\n\t\tresult.push(labels.shiftKey);\n\t}\n\n\tif (modifiers.altKey) {\n\t\tresult.push(labels.altKey);\n\t}\n\n\tif (modifiers.metaKey) {\n\t\tresult.push(labels.metaKey);\n\t}\n\n\t// the actual key\n\tif (key !== '') {\n\t\tresult.push(key);\n\t}\n\n\treturn result.join(labels.separator);\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 * as dom from 'vs/base/browser/dom';\nimport { Color } from 'vs/base/common/color';\nimport { UILabelProvider } from 'vs/base/common/keybindingLabels';\nimport { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keybindings';\nimport { equals } from 'vs/base/common/objects';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport { IThemable } from 'vs/base/common/styler';\nimport 'vs/css!./keybindingLabel';\nimport { localize } from 'vs/nls';\n\nconst $ = dom.$;\n\nexport interface PartMatches {\n\tctrlKey?: boolean;\n\tshiftKey?: boolean;\n\taltKey?: boolean;\n\tmetaKey?: boolean;\n\tkeyCode?: boolean;\n}\n\nexport interface Matches {\n\tfirstPart: PartMatches;\n\tchordPart: PartMatches;\n}\n\nexport interface KeybindingLabelOptions extends IKeybindingLabelStyles {\n\trenderUnboundKeybindings?: boolean;\n}\n\nexport interface IKeybindingLabelStyles {\n\tkeybindingLabelBackground?: Color;\n\tkeybindingLabelForeground?: Color;\n\tkeybindingLabelBorder?: Color;\n\tkeybindingLabelBottomBorder?: Color;\n\tkeybindingLabelShadow?: Color;\n}\n\nexport class KeybindingLabel implements IThemable {\n\n\tprivate domNode: HTMLElement;\n\tprivate options: KeybindingLabelOptions;\n\n\tprivate readonly keyElements = new Set<HTMLSpanElement>();\n\n\tprivate keybinding: ResolvedKeybinding | undefined;\n\tprivate matches: Matches | undefined;\n\tprivate didEverRender: boolean;\n\n\tprivate labelBackground: Color | undefined;\n\tprivate labelForeground: Color | undefined;\n\tprivate labelBorder: Color | undefined;\n\tprivate labelBottomBorder: Color | undefined;\n\tprivate labelShadow: Color | undefined;\n\n\tconstructor(container: HTMLElement, private os: OperatingSystem, options?: KeybindingLabelOptions) {\n\t\tthis.options = options || Object.create(null);\n\n\t\tthis.labelBackground = this.options.keybindingLabelBackground;\n\t\tthis.labelForeground = this.options.keybindingLabelForeground;\n\t\tthis.labelBorder = this.options.keybindingLabelBorder;\n\t\tthis.labelBottomBorder = this.options.keybindingLabelBottomBorder;\n\t\tthis.labelShadow = this.options.keybindingLabelShadow;\n\n\t\tthis.domNode = dom.append(container, $('.monaco-keybinding'));\n\t\tthis.didEverRender = false;\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tset(keybinding: ResolvedKeybinding | undefined, matches?: Matches) {\n\t\tif (this.didEverRender && this.keybinding === keybinding && KeybindingLabel.areSame(this.matches, matches)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keybinding = keybinding;\n\t\tthis.matches = matches;\n\t\tthis.render();\n\t}\n\n\tprivate render() {\n\t\tthis.clear();\n\n\t\tif (this.keybinding) {\n\t\t\tlet [firstPart, chordPart] = this.keybinding.getParts();\n\t\t\tif (firstPart) {\n\t\t\t\tthis.renderPart(this.domNode, firstPart, this.matches ? this.matches.firstPart : null);\n\t\t\t}\n\t\t\tif (chordPart) {\n\t\t\t\tdom.append(this.domNode, $('span.monaco-keybinding-key-chord-separator', undefined, ' '));\n\t\t\t\tthis.renderPart(this.domNode, chordPart, this.matches ? this.matches.chordPart : null);\n\t\t\t}\n\t\t\tthis.domNode.title = this.keybinding.getAriaLabel() || '';\n\t\t} else if (this.options && this.options.renderUnboundKeybindings) {\n\t\t\tthis.renderUnbound(this.domNode);\n\t\t}\n\n\t\tthis.applyStyles();\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tprivate clear(): void {\n\t\tdom.clearNode(this.domNode);\n\t\tthis.keyElements.clear();\n\t}\n\n\tprivate renderPart(parent: HTMLElement, part: ResolvedKeybindingPart, match: PartMatches | null) {\n\t\tconst modifierLabels = UILabelProvider.modifierLabels[this.os];\n\t\tif (part.ctrlKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.ctrlKey, Boolean(match?.ctrlKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.shiftKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.shiftKey, Boolean(match?.shiftKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.altKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.altKey, Boolean(match?.altKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.metaKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.metaKey, Boolean(match?.metaKey), modifierLabels.separator);\n\t\t}\n\t\tconst keyLabel = part.keyLabel;\n\t\tif (keyLabel) {\n\t\t\tthis.renderKey(parent, keyLabel, Boolean(match?.keyCode), '');\n\t\t}\n\t}\n\n\tprivate renderKey(parent: HTMLElement, label: string, highlight: boolean, separator: string): void {\n\t\tdom.append(parent, this.createKeyElement(label, highlight ? '.highlight' : ''));\n\t\tif (separator) {\n\t\t\tdom.append(parent, $('span.monaco-keybinding-key-separator', undefined, separator));\n\t\t}\n\t}\n\n\tprivate renderUnbound(parent: HTMLElement): void {\n\t\tdom.append(parent, this.createKeyElement(localize('unbound', \"Unbound\")));\n\t}\n\n\tprivate createKeyElement(label: string, extraClass = ''): HTMLElement {\n\t\tconst keyElement = $('span.monaco-keybinding-key' + extraClass, undefined, label);\n\t\tthis.keyElements.add(keyElement);\n\n\t\treturn keyElement;\n\t}\n\n\tstyle(styles: IKeybindingLabelStyles): void {\n\t\tthis.labelBackground = styles.keybindingLabelBackground;\n\t\tthis.labelForeground = styles.keybindingLabelForeground;\n\t\tthis.labelBorder = styles.keybindingLabelBorder;\n\t\tthis.labelBottomBorder = styles.keybindingLabelBottomBorder;\n\t\tthis.labelShadow = styles.keybindingLabelShadow;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprivate applyStyles() {\n\t\tif (this.element) {\n\t\t\tfor (const keyElement of this.keyElements) {\n\t\t\t\tif (this.labelBackground) {\n\t\t\t\t\tkeyElement.style.backgroundColor = this.labelBackground?.toString();\n\t\t\t\t}\n\t\t\t\tif (this.labelBorder) {\n\t\t\t\t\tkeyElement.style.borderColor = this.labelBorder.toString();\n\t\t\t\t}\n\t\t\t\tif (this.labelBottomBorder) {\n\t\t\t\t\tkeyElement.style.borderBottomColor = this.labelBottomBorder.toString();\n\t\t\t\t}\n\t\t\t\tif (this.labelShadow) {\n\t\t\t\t\tkeyElement.style.boxShadow = `inset 0 -1px 0 ${this.labelShadow}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.labelForeground) {\n\t\t\t\tthis.element.style.color = this.labelForeground.toString();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static areSame(a: Matches | undefined, b: Matches | undefined): boolean {\n\t\tif (a === b || (!a && !b)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn !!a && !!b && equals(a.firstPart, b.firstPart) && equals(a.chordPart, b.chordPart);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel';\nimport { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { IListAccessibilityProvider, IListOptions, IListStyles, List } from 'vs/base/browser/ui/list/listWidget';\nimport { Action } from 'vs/base/common/actions';\nimport { range } from 'vs/base/common/arrays';\nimport { getCodiconAriaLabel } from 'vs/base/common/codicons';\nimport { compareAnything } from 'vs/base/common/comparers';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IMatch } from 'vs/base/common/filters';\nimport { matchesFuzzyIconAware, parseLabelWithIcons } from 'vs/base/common/iconLabels';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { IQuickInputOptions } from 'vs/base/parts/quickinput/browser/quickInput';\nimport { getIconClass } from 'vs/base/parts/quickinput/browser/quickInputUtils';\nimport { IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator } from 'vs/base/parts/quickinput/common/quickInput';\nimport 'vs/css!./media/quickInput';\nimport { localize } from 'vs/nls';\n\nconst $ = dom.$;\n\ninterface IListElement {\n\treadonly hasCheckbox: boolean;\n\treadonly index: number;\n\treadonly item: IQuickPickItem;\n\treadonly saneLabel: string;\n\treadonly saneMeta?: string;\n\treadonly saneAriaLabel: string;\n\treadonly saneDescription?: string;\n\treadonly saneDetail?: string;\n\treadonly labelHighlights?: IMatch[];\n\treadonly descriptionHighlights?: IMatch[];\n\treadonly detailHighlights?: IMatch[];\n\treadonly checked: boolean;\n\treadonly separator?: IQuickPickSeparator;\n\treadonly fireButtonTriggered: (event: IQuickPickItemButtonEvent<IQuickPickItem>) => void;\n}\n\nclass ListElement implements IListElement, IDisposable {\n\thasCheckbox!: boolean;\n\tindex!: number;\n\titem!: IQuickPickItem;\n\tsaneLabel!: string;\n\tsaneMeta!: string;\n\tsaneAriaLabel!: string;\n\tsaneDescription?: string;\n\tsaneDetail?: string;\n\thidden = false;\n\tprivate readonly _onChecked = new Emitter<boolean>();\n\tonChecked = this._onChecked.event;\n\t_checked?: boolean;\n\tget checked() {\n\t\treturn !!this._checked;\n\t}\n\tset checked(value: boolean) {\n\t\tif (value !== this._checked) {\n\t\t\tthis._checked = value;\n\t\t\tthis._onChecked.fire(value);\n\t\t}\n\t}\n\tseparator?: IQuickPickSeparator;\n\tlabelHighlights?: IMatch[];\n\tdescriptionHighlights?: IMatch[];\n\tdetailHighlights?: IMatch[];\n\tfireButtonTriggered!: (event: IQuickPickItemButtonEvent<IQuickPickItem>) => void;\n\n\tconstructor(init: IListElement) {\n\t\tObject.assign(this, init);\n\t}\n\n\tdispose() {\n\t\tthis._onChecked.dispose();\n\t}\n}\n\ninterface IListElementTemplateData {\n\tentry: HTMLDivElement;\n\tcheckbox: HTMLInputElement;\n\tlabel: IconLabel;\n\tkeybinding: KeybindingLabel;\n\tdetail: IconLabel;\n\tseparator: HTMLDivElement;\n\tactionBar: ActionBar;\n\telement: ListElement;\n\ttoDisposeElement: IDisposable[];\n\ttoDisposeTemplate: IDisposable[];\n}\n\nclass ListElementRenderer implements IListRenderer<ListElement, IListElementTemplateData> {\n\n\tstatic readonly ID = 'listelement';\n\n\tget templateId() {\n\t\treturn ListElementRenderer.ID;\n\t}\n\n\trenderTemplate(container: HTMLElement): IListElementTemplateData {\n\t\tconst data: IListElementTemplateData = Object.create(null);\n\t\tdata.toDisposeElement = [];\n\t\tdata.toDisposeTemplate = [];\n\n\t\tdata.entry = dom.append(container, $('.quick-input-list-entry'));\n\n\t\t// Checkbox\n\t\tconst label = dom.append(data.entry, $('label.quick-input-list-label'));\n\t\tdata.toDisposeTemplate.push(dom.addStandardDisposableListener(label, dom.EventType.CLICK, e => {\n\t\t\tif (!data.checkbox.offsetParent) { // If checkbox not visible:\n\t\t\t\te.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740\n\t\t\t}\n\t\t}));\n\t\tdata.checkbox = <HTMLInputElement>dom.append(label, $('input.quick-input-list-checkbox'));\n\t\tdata.checkbox.type = 'checkbox';\n\t\tdata.toDisposeTemplate.push(dom.addStandardDisposableListener(data.checkbox, dom.EventType.CHANGE, e => {\n\t\t\tdata.element.checked = data.checkbox.checked;\n\t\t}));\n\n\t\t// Rows\n\t\tconst rows = dom.append(label, $('.quick-input-list-rows'));\n\t\tconst row1 = dom.append(rows, $('.quick-input-list-row'));\n\t\tconst row2 = dom.append(rows, $('.quick-input-list-row'));\n\n\t\t// Label\n\t\tdata.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true });\n\n\t\t// Keybinding\n\t\tconst keybindingContainer = dom.append(row1, $('.quick-input-list-entry-keybinding'));\n\t\tdata.keybinding = new KeybindingLabel(keybindingContainer, platform.OS);\n\n\t\t// Detail\n\t\tconst detailContainer = dom.append(row2, $('.quick-input-list-label-meta'));\n\t\tdata.detail = new IconLabel(detailContainer, { supportHighlights: true, supportIcons: true });\n\n\t\t// Separator\n\t\tdata.separator = dom.append(data.entry, $('.quick-input-list-separator'));\n\n\t\t// Actions\n\t\tdata.actionBar = new ActionBar(data.entry);\n\t\tdata.actionBar.domNode.classList.add('quick-input-list-entry-action-bar');\n\t\tdata.toDisposeTemplate.push(data.actionBar);\n\n\t\treturn data;\n\t}\n\n\trenderElement(element: ListElement, index: number, data: IListElementTemplateData): void {\n\t\tdata.toDisposeElement = dispose(data.toDisposeElement);\n\t\tdata.element = element;\n\t\tdata.checkbox.checked = element.checked;\n\t\tdata.toDisposeElement.push(element.onChecked(checked => data.checkbox.checked = checked));\n\n\t\tconst { labelHighlights, descriptionHighlights, detailHighlights } = element;\n\n\t\t// Label\n\t\tconst options: IIconLabelValueOptions = Object.create(null);\n\t\toptions.matches = labelHighlights || [];\n\t\toptions.descriptionTitle = element.saneDescription;\n\t\toptions.descriptionMatches = descriptionHighlights || [];\n\t\toptions.extraClasses = element.item.iconClasses;\n\t\toptions.italic = element.item.italic;\n\t\toptions.strikethrough = element.item.strikethrough;\n\t\tdata.label.setLabel(element.saneLabel, element.saneDescription, options);\n\n\t\t// Keybinding\n\t\tdata.keybinding.set(element.item.keybinding);\n\n\t\t// Meta\n\t\tif (element.saneDetail) {\n\t\t\tdata.detail.setLabel(element.saneDetail, undefined, {\n\t\t\t\tmatches: detailHighlights,\n\t\t\t\ttitle: element.saneDetail\n\t\t\t});\n\t\t}\n\n\t\t// Separator\n\t\tif (element.separator && element.separator.label) {\n\t\t\tdata.separator.textContent = element.separator.label;\n\t\t\tdata.separator.style.display = '';\n\t\t} else {\n\t\t\tdata.separator.style.display = 'none';\n\t\t}\n\t\tdata.entry.classList.toggle('quick-input-list-separator-border', !!element.separator);\n\n\t\t// Actions\n\t\tdata.actionBar.clear();\n\t\tconst buttons = element.item.buttons;\n\t\tif (buttons && buttons.length) {\n\t\t\tdata.actionBar.push(buttons.map((button, index) => {\n\t\t\t\tlet cssClasses = button.iconClass || (button.iconPath ? getIconClass(button.iconPath) : undefined);\n\t\t\t\tif (button.alwaysVisible) {\n\t\t\t\t\tcssClasses = cssClasses ? `${cssClasses} always-visible` : 'always-visible';\n\t\t\t\t}\n\t\t\t\tconst action = new Action(`id-${index}`, '', cssClasses, true, async () => {\n\t\t\t\t\telement.fireButtonTriggered({\n\t\t\t\t\t\tbutton,\n\t\t\t\t\t\titem: element.item\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\taction.tooltip = button.tooltip || '';\n\t\t\t\treturn action;\n\t\t\t}), { icon: true, label: false });\n\t\t\tdata.entry.classList.add('has-actions');\n\t\t} else {\n\t\t\tdata.entry.classList.remove('has-actions');\n\t\t}\n\t}\n\n\tdisposeElement(element: ListElement, index: number, data: IListElementTemplateData): void {\n\t\tdata.toDisposeElement = dispose(data.toDisposeElement);\n\t}\n\n\tdisposeTemplate(data: IListElementTemplateData): void {\n\t\tdata.toDisposeElement = dispose(data.toDisposeElement);\n\t\tdata.toDisposeTemplate = dispose(data.toDisposeTemplate);\n\t}\n}\n\nclass ListElementDelegate implements IListVirtualDelegate<ListElement> {\n\n\tgetHeight(element: ListElement): number {\n\t\treturn element.saneDetail ? 44 : 22;\n\t}\n\n\tgetTemplateId(element: ListElement): string {\n\t\treturn ListElementRenderer.ID;\n\t}\n}\n\nexport enum QuickInputListFocus {\n\tFirst = 1,\n\tSecond,\n\tLast,\n\tNext,\n\tPrevious,\n\tNextPage,\n\tPreviousPage\n}\n\nexport class QuickInputList {\n\n\treadonly id: string;\n\tprivate container: HTMLElement;\n\tprivate list: List<ListElement>;\n\tprivate inputElements: Array<IQuickPickItem | IQuickPickSeparator> = [];\n\tprivate elements: ListElement[] = [];\n\tprivate elementsToIndexes = new Map<IQuickPickItem, number>();\n\tmatchOnDescription = false;\n\tmatchOnDetail = false;\n\tmatchOnLabel = true;\n\tmatchOnMeta = true;\n\tsortByLabel = true;\n\tprivate readonly _onChangedAllVisibleChecked = new Emitter<boolean>();\n\tonChangedAllVisibleChecked: Event<boolean> = this._onChangedAllVisibleChecked.event;\n\tprivate readonly _onChangedCheckedCount = new Emitter<number>();\n\tonChangedCheckedCount: Event<number> = this._onChangedCheckedCount.event;\n\tprivate readonly _onChangedVisibleCount = new Emitter<number>();\n\tonChangedVisibleCount: Event<number> = this._onChangedVisibleCount.event;\n\tprivate readonly _onChangedCheckedElements = new Emitter<IQuickPickItem[]>();\n\tonChangedCheckedElements: Event<IQuickPickItem[]> = this._onChangedCheckedElements.event;\n\tprivate readonly _onButtonTriggered = new Emitter<IQuickPickItemButtonEvent<IQuickPickItem>>();\n\tonButtonTriggered = this._onButtonTriggered.event;\n\tprivate readonly _onKeyDown = new Emitter<StandardKeyboardEvent>();\n\tonKeyDown: Event<StandardKeyboardEvent> = this._onKeyDown.event;\n\tprivate readonly _onLeave = new Emitter<void>();\n\tonLeave: Event<void> = this._onLeave.event;\n\tprivate _fireCheckedEvents = true;\n\tprivate elementDisposables: IDisposable[] = [];\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprivate parent: HTMLElement,\n\t\tid: string,\n\t\toptions: IQuickInputOptions,\n\t) {\n\t\tthis.id = id;\n\t\tthis.container = dom.append(this.parent, $('.quick-input-list'));\n\t\tconst delegate = new ListElementDelegate();\n\t\tconst accessibilityProvider = new QuickInputAccessibilityProvider();\n\t\tthis.list = options.createList('QuickInput', this.container, delegate, [new ListElementRenderer()], {\n\t\t\tidentityProvider: { getId: element => element.saneLabel },\n\t\t\tsetRowLineHeight: false,\n\t\t\tmultipleSelectionSupport: false,\n\t\t\thorizontalScrolling: false,\n\t\t\taccessibilityProvider\n\t\t} as IListOptions<ListElement>);\n\t\tthis.list.getHTMLElement().id = id;\n\t\tthis.disposables.push(this.list);\n\t\tthis.disposables.push(this.list.onKeyDown(e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase KeyCode.Space:\n\t\t\t\t\tthis.toggleCheckbox();\n\t\t\t\t\tbreak;\n\t\t\t\tcase KeyCode.KeyA:\n\t\t\t\t\tif (platform.isMacintosh ? e.metaKey : e.ctrlKey) {\n\t\t\t\t\t\tthis.list.setFocus(range(this.list.length));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase KeyCode.UpArrow: {\n\t\t\t\t\tconst focus1 = this.list.getFocus();\n\t\t\t\t\tif (focus1.length === 1 && focus1[0] === 0) {\n\t\t\t\t\t\tthis._onLeave.fire();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase KeyCode.DownArrow: {\n\t\t\t\t\tconst focus2 = this.list.getFocus();\n\t\t\t\t\tif (focus2.length === 1 && focus2[0] === this.list.length - 1) {\n\t\t\t\t\t\tthis._onLeave.fire();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onKeyDown.fire(event);\n\t\t}));\n\t\tthis.disposables.push(this.list.onMouseDown(e => {\n\t\t\tif (e.browserEvent.button !== 2) {\n\t\t\t\t// Works around / fixes #64350.\n\t\t\t\te.browserEvent.preventDefault();\n\t\t\t}\n\t\t}));\n\t\tthis.disposables.push(dom.addDisposableListener(this.container, dom.EventType.CLICK, e => {\n\t\t\tif (e.x || e.y) { // Avoid 'click' triggered by 'space' on checkbox.\n\t\t\t\tthis._onLeave.fire();\n\t\t\t}\n\t\t}));\n\t\tthis.disposables.push(this.list.onMouseMiddleClick(e => {\n\t\t\tthis._onLeave.fire();\n\t\t}));\n\t\tthis.disposables.push(this.list.onContextMenu(e => {\n\t\t\tif (typeof e.index === 'number') {\n\t\t\t\te.browserEvent.preventDefault();\n\n\t\t\t\t// we want to treat a context menu event as\n\t\t\t\t// a gesture to open the item at the index\n\t\t\t\t// since we do not have any context menu\n\t\t\t\t// this enables for example macOS to Ctrl-\n\t\t\t\t// click on an item to open it.\n\t\t\t\tthis.list.setSelection([e.index]);\n\t\t\t}\n\t\t}));\n\t\tthis.disposables.push(\n\t\t\tthis._onChangedAllVisibleChecked,\n\t\t\tthis._onChangedCheckedCount,\n\t\t\tthis._onChangedVisibleCount,\n\t\t\tthis._onChangedCheckedElements,\n\t\t\tthis._onButtonTriggered,\n\t\t\tthis._onLeave,\n\t\t\tthis._onKeyDown\n\t\t);\n\t}\n\n\t@memoize\n\tget onDidChangeFocus() {\n\t\treturn Event.map(this.list.onDidChangeFocus, e => e.elements.map(e => e.item));\n\t}\n\n\t@memoize\n\tget onDidChangeSelection() {\n\t\treturn Event.map(this.list.onDidChangeSelection, e => ({ items: e.elements.map(e => e.item), event: e.browserEvent }));\n\t}\n\n\tget scrollTop() {\n\t\treturn this.list.scrollTop;\n\t}\n\n\tset scrollTop(scrollTop: number) {\n\t\tthis.list.scrollTop = scrollTop;\n\t}\n\n\tgetAllVisibleChecked() {\n\t\treturn this.allVisibleChecked(this.elements, false);\n\t}\n\n\tprivate allVisibleChecked(elements: ListElement[], whenNoneVisible = true) {\n\t\tfor (let i = 0, n = elements.length; i < n; i++) {\n\t\t\tconst element = elements[i];\n\t\t\tif (!element.hidden) {\n\t\t\t\tif (!element.checked) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\twhenNoneVisible = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn whenNoneVisible;\n\t}\n\n\tgetCheckedCount() {\n\t\tlet count = 0;\n\t\tconst elements = this.elements;\n\t\tfor (let i = 0, n = elements.length; i < n; i++) {\n\t\t\tif (elements[i].checked) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}\n\n\tgetVisibleCount() {\n\t\tlet count = 0;\n\t\tconst elements = this.elements;\n\t\tfor (let i = 0, n = elements.length; i < n; i++) {\n\t\t\tif (!elements[i].hidden) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}\n\n\tsetAllVisibleChecked(checked: boolean) {\n\t\ttry {\n\t\t\tthis._fireCheckedEvents = false;\n\t\t\tthis.elements.forEach(element => {\n\t\t\t\tif (!element.hidden) {\n\t\t\t\t\telement.checked = checked;\n\t\t\t\t}\n\t\t\t});\n\t\t} finally {\n\t\t\tthis._fireCheckedEvents = true;\n\t\t\tthis.fireCheckedEvents();\n\t\t}\n\t}\n\n\tsetElements(inputElements: Array<IQuickPickItem | IQuickPickSeparator>): void {\n\t\tthis.elementDisposables = dispose(this.elementDisposables);\n\t\tconst fireButtonTriggered = (event: IQuickPickItemButtonEvent<IQuickPickItem>) => this.fireButtonTriggered(event);\n\t\tthis.inputElements = inputElements;\n\t\tthis.elements = inputElements.reduce((result, item, index) => {\n\t\t\tif (item.type !== 'separator') {\n\t\t\t\tconst previous = index && inputElements[index - 1];\n\t\t\t\tconst saneLabel = item.label && item.label.replace(/\\r?\\n/g, ' ');\n\t\t\t\tconst saneMeta = item.meta && item.meta.replace(/\\r?\\n/g, ' ');\n\t\t\t\tconst saneDescription = item.description && item.description.replace(/\\r?\\n/g, ' ');\n\t\t\t\tconst saneDetail = item.detail && item.detail.replace(/\\r?\\n/g, ' ');\n\t\t\t\tconst saneAriaLabel = item.ariaLabel || [saneLabel, saneDescription, saneDetail]\n\t\t\t\t\t.map(s => getCodiconAriaLabel(s))\n\t\t\t\t\t.filter(s => !!s)\n\t\t\t\t\t.join(', ');\n\n\t\t\t\tconst hasCheckbox = this.parent.classList.contains('show-checkboxes');\n\t\t\t\tresult.push(new ListElement({\n\t\t\t\t\thasCheckbox,\n\t\t\t\t\tindex,\n\t\t\t\t\titem,\n\t\t\t\t\tsaneLabel,\n\t\t\t\t\tsaneMeta,\n\t\t\t\t\tsaneAriaLabel,\n\t\t\t\t\tsaneDescription,\n\t\t\t\t\tsaneDetail,\n\t\t\t\t\tlabelHighlights: item.highlights?.label,\n\t\t\t\t\tdescriptionHighlights: item.highlights?.description,\n\t\t\t\t\tdetailHighlights: item.highlights?.detail,\n\t\t\t\t\tchecked: false,\n\t\t\t\t\tseparator: previous && previous.type === 'separator' ? previous : undefined,\n\t\t\t\t\tfireButtonTriggered\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn result;\n\t\t}, [] as ListElement[]);\n\t\tthis.elementDisposables.push(...this.elements);\n\t\tthis.elementDisposables.push(...this.elements.map(element => element.onChecked(() => this.fireCheckedEvents())));\n\n\t\tthis.elementsToIndexes = this.elements.reduce((map, element, index) => {\n\t\t\tmap.set(element.item, index);\n\t\t\treturn map;\n\t\t}, new Map<IQuickPickItem, number>());\n\t\tthis.list.splice(0, this.list.length); // Clear focus and selection first, sending the events when the list is empty.\n\t\tthis.list.splice(0, this.list.length, this.elements);\n\t\tthis._onChangedVisibleCount.fire(this.elements.length);\n\t}\n\n\tgetFocusedElements() {\n\t\treturn this.list.getFocusedElements()\n\t\t\t.map(e => e.item);\n\t}\n\n\tsetFocusedElements(items: IQuickPickItem[]) {\n\t\tthis.list.setFocus(items\n\t\t\t.filter(item => this.elementsToIndexes.has(item))\n\t\t\t.map(item => this.elementsToIndexes.get(item)!));\n\t\tif (items.length > 0) {\n\t\t\tconst focused = this.list.getFocus()[0];\n\t\t\tif (typeof focused === 'number') {\n\t\t\t\tthis.list.reveal(focused);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetActiveDescendant() {\n\t\treturn this.list.getHTMLElement().getAttribute('aria-activedescendant');\n\t}\n\n\tsetSelectedElements(items: IQuickPickItem[]) {\n\t\tthis.list.setSelection(items\n\t\t\t.filter(item => this.elementsToIndexes.has(item))\n\t\t\t.map(item => this.elementsToIndexes.get(item)!));\n\t}\n\n\tgetCheckedElements() {\n\t\treturn this.elements.filter(e => e.checked)\n\t\t\t.map(e => e.item);\n\t}\n\n\tsetCheckedElements(items: IQuickPickItem[]) {\n\t\ttry {\n\t\t\tthis._fireCheckedEvents = false;\n\t\t\tconst checked = new Set();\n\t\t\tfor (const item of items) {\n\t\t\t\tchecked.add(item);\n\t\t\t}\n\t\t\tfor (const element of this.elements) {\n\t\t\t\telement.checked = checked.has(element.item);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._fireCheckedEvents = true;\n\t\t\tthis.fireCheckedEvents();\n\t\t}\n\t}\n\n\tset enabled(value: boolean) {\n\t\tthis.list.getHTMLElement().style.pointerEvents = value ? '' : 'none';\n\t}\n\n\tfocus(what: QuickInputListFocus): void {\n\t\tif (!this.list.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (what === QuickInputListFocus.Next && this.list.getFocus()[0] === this.list.length - 1) {\n\t\t\twhat = QuickInputListFocus.First;\n\t\t}\n\n\t\tif (what === QuickInputListFocus.Previous && this.list.getFocus()[0] === 0) {\n\t\t\twhat = QuickInputListFocus.Last;\n\t\t}\n\n\t\tif (what === QuickInputListFocus.Second && this.list.length < 2) {\n\t\t\twhat = QuickInputListFocus.First;\n\t\t}\n\n\t\tswitch (what) {\n\t\t\tcase QuickInputListFocus.First:\n\t\t\t\tthis.list.focusFirst();\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.Second:\n\t\t\t\tthis.list.focusNth(1);\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.Last:\n\t\t\t\tthis.list.focusLast();\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.Next:\n\t\t\t\tthis.list.focusNext();\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.Previous:\n\t\t\t\tthis.list.focusPrevious();\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.NextPage:\n\t\t\t\tthis.list.focusNextPage();\n\t\t\t\tbreak;\n\t\t\tcase QuickInputListFocus.PreviousPage:\n\t\t\t\tthis.list.focusPreviousPage();\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst focused = this.list.getFocus()[0];\n\t\tif (typeof focused === 'number') {\n\t\t\tthis.list.reveal(focused);\n\t\t}\n\t}\n\n\tclearFocus() {\n\t\tthis.list.setFocus([]);\n\t}\n\n\tdomFocus() {\n\t\tthis.list.domFocus();\n\t}\n\n\tlayout(maxHeight?: number): void {\n\t\tthis.list.getHTMLElement().style.maxHeight = maxHeight ? `calc(${Math.floor(maxHeight / 44) * 44}px)` : '';\n\t\tthis.list.layout();\n\t}\n\n\tfilter(query: string): boolean {\n\t\tif (!(this.sortByLabel || this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) {\n\t\t\tthis.list.layout();\n\t\t\treturn false;\n\t\t}\n\t\tquery = query.trim();\n\n\t\t// Reset filtering\n\t\tif (!query || !(this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) {\n\t\t\tthis.elements.forEach(element => {\n\t\t\t\telement.labelHighlights = undefined;\n\t\t\t\telement.descriptionHighlights = undefined;\n\t\t\t\telement.detailHighlights = undefined;\n\t\t\t\telement.hidden = false;\n\t\t\t\tconst previous = element.index && this.inputElements[element.index - 1];\n\t\t\t\telement.separator = previous && previous.type === 'separator' ? previous : undefined;\n\t\t\t});\n\t\t}\n\n\t\t// Filter by value (since we support icons in labels, use $(..) aware fuzzy matching)\n\t\telse {\n\t\t\tlet currentSeparator: IQuickPickSeparator | undefined;\n\t\t\tthis.elements.forEach(element => {\n\t\t\t\tconst labelHighlights = this.matchOnLabel ? withNullAsUndefined(matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneLabel))) : undefined;\n\t\t\t\tconst descriptionHighlights = this.matchOnDescription ? withNullAsUndefined(matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneDescription || ''))) : undefined;\n\t\t\t\tconst detailHighlights = this.matchOnDetail ? withNullAsUndefined(matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneDetail || ''))) : undefined;\n\t\t\t\tconst metaHighlights = this.matchOnMeta ? withNullAsUndefined(matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneMeta || ''))) : undefined;\n\n\t\t\t\tif (labelHighlights || descriptionHighlights || detailHighlights || metaHighlights) {\n\t\t\t\t\telement.labelHighlights = labelHighlights;\n\t\t\t\t\telement.descriptionHighlights = descriptionHighlights;\n\t\t\t\t\telement.detailHighlights = detailHighlights;\n\t\t\t\t\telement.hidden = false;\n\t\t\t\t} else {\n\t\t\t\t\telement.labelHighlights = undefined;\n\t\t\t\t\telement.descriptionHighlights = undefined;\n\t\t\t\t\telement.detailHighlights = undefined;\n\t\t\t\t\telement.hidden = !element.item.alwaysShow;\n\t\t\t\t}\n\t\t\t\telement.separator = undefined;\n\n\t\t\t\t// we can show the separator unless the list gets sorted by match\n\t\t\t\tif (!this.sortByLabel) {\n\t\t\t\t\tconst previous = element.index && this.inputElements[element.index - 1];\n\t\t\t\t\tcurrentSeparator = previous && previous.type === 'separator' ? previous : currentSeparator;\n\t\t\t\t\tif (currentSeparator && !element.hidden) {\n\t\t\t\t\t\telement.separator = currentSeparator;\n\t\t\t\t\t\tcurrentSeparator = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst shownElements = this.elements.filter(element => !element.hidden);\n\n\t\t// Sort by value\n\t\tif (this.sortByLabel && query) {\n\t\t\tconst normalizedSearchValue = query.toLowerCase();\n\t\t\tshownElements.sort((a, b) => {\n\t\t\t\treturn compareEntries(a, b, normalizedSearchValue);\n\t\t\t});\n\t\t}\n\n\t\tthis.elementsToIndexes = shownElements.reduce((map, element, index) => {\n\t\t\tmap.set(element.item, index);\n\t\t\treturn map;\n\t\t}, new Map<IQuickPickItem, number>());\n\t\tthis.list.splice(0, this.list.length, shownElements);\n\t\tthis.list.setFocus([]);\n\t\tthis.list.layout();\n\n\t\tthis._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked());\n\t\tthis._onChangedVisibleCount.fire(shownElements.length);\n\n\t\treturn true;\n\t}\n\n\ttoggleCheckbox() {\n\t\ttry {\n\t\t\tthis._fireCheckedEvents = false;\n\t\t\tconst elements = this.list.getFocusedElements();\n\t\t\tconst allChecked = this.allVisibleChecked(elements);\n\t\t\tfor (const element of elements) {\n\t\t\t\telement.checked = !allChecked;\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._fireCheckedEvents = true;\n\t\t\tthis.fireCheckedEvents();\n\t\t}\n\t}\n\n\tdisplay(display: boolean) {\n\t\tthis.container.style.display = display ? '' : 'none';\n\t}\n\n\tisDisplayed() {\n\t\treturn this.container.style.display !== 'none';\n\t}\n\n\tdispose() {\n\t\tthis.elementDisposables = dispose(this.elementDisposables);\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n\n\tprivate fireCheckedEvents() {\n\t\tif (this._fireCheckedEvents) {\n\t\t\tthis._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked());\n\t\t\tthis._onChangedCheckedCount.fire(this.getCheckedCount());\n\t\t\tthis._onChangedCheckedElements.fire(this.getCheckedElements());\n\t\t}\n\t}\n\n\tprivate fireButtonTriggered(event: IQuickPickItemButtonEvent<IQuickPickItem>) {\n\t\tthis._onButtonTriggered.fire(event);\n\t}\n\n\tstyle(styles: IListStyles) {\n\t\tthis.list.style(styles);\n\t}\n}\n\nfunction compareEntries(elementA: ListElement, elementB: ListElement, lookFor: string): number {\n\n\tconst labelHighlightsA = elementA.labelHighlights || [];\n\tconst labelHighlightsB = elementB.labelHighlights || [];\n\tif (labelHighlightsA.length && !labelHighlightsB.length) {\n\t\treturn -1;\n\t}\n\n\tif (!labelHighlightsA.length && labelHighlightsB.length) {\n\t\treturn 1;\n\t}\n\n\tif (labelHighlightsA.length === 0 && labelHighlightsB.length === 0) {\n\t\treturn 0;\n\t}\n\n\treturn compareAnything(elementA.saneLabel, elementB.saneLabel, lookFor);\n}\n\nclass QuickInputAccessibilityProvider implements IListAccessibilityProvider<ListElement> {\n\n\tgetWidgetAriaLabel(): string {\n\t\treturn localize('quickInput', \"Quick Input\");\n\t}\n\n\tgetAriaLabel(element: ListElement): string | null {\n\t\treturn element.saneAriaLabel;\n\t}\n\n\tgetWidgetRole() {\n\t\treturn 'listbox';\n\t}\n\n\tgetRole(element: ListElement) {\n\t\treturn element.hasCheckbox ? 'checkbox' : 'option';\n\t}\n\n\tisChecked(element: ListElement) {\n\t\tif (!element.hasCheckbox) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: element.checked,\n\t\t\tonDidChange: element.onChecked\n\t\t};\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { Button, IButtonStyles } from 'vs/base/browser/ui/button/button';\nimport { CountBadge, ICountBadgetyles } from 'vs/base/browser/ui/countBadge/countBadge';\nimport { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';\nimport { IInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { IKeybindingLabelStyles } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel';\nimport { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { IListOptions, IListStyles, List } from 'vs/base/browser/ui/list/listWidget';\nimport { IProgressBarStyles, ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';\nimport { Action } from 'vs/base/common/actions';\nimport { equals } from 'vs/base/common/arrays';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle';\nimport { isIOS } from 'vs/base/common/platform';\nimport Severity from 'vs/base/common/severity';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { getIconClass } from 'vs/base/parts/quickinput/browser/quickInputUtils';\nimport { IKeyMods, IPickOptions, IQuickInput, IQuickInputButton, IQuickInputHideEvent, IQuickNavigateConfiguration, IQuickPick, IQuickPickDidAcceptEvent, IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickWillAcceptEvent, ItemActivation, NO_KEY_MODS, QuickInputHideReason, QuickPickInput } from 'vs/base/parts/quickinput/common/quickInput';\nimport 'vs/css!./media/quickInput';\nimport { localize } from 'vs/nls';\nimport { QuickInputBox } from './quickInputBox';\nimport { QuickInputList, QuickInputListFocus } from './quickInputList';\n\nexport interface IQuickInputOptions {\n\tidPrefix: string;\n\tcontainer: HTMLElement;\n\tignoreFocusOut(): boolean;\n\tisScreenReaderOptimized(): boolean;\n\tbackKeybindingLabel(): string | undefined;\n\tsetContextKey(id?: string): void;\n\treturnFocus(): void;\n\tcreateList<T>(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: IListRenderer<T, any>[],\n\t\toptions: IListOptions<T>,\n\t): List<T>;\n\tstyles: IQuickInputStyles;\n}\n\nexport interface IQuickInputStyles {\n\twidget: IQuickInputWidgetStyles;\n\tinputBox: IInputBoxStyles;\n\tcountBadge: ICountBadgetyles;\n\tbutton: IButtonStyles;\n\tprogressBar: IProgressBarStyles;\n\tkeybindingLabel: IKeybindingLabelStyles;\n\tlist: IListStyles & { pickerGroupBorder?: Color; pickerGroupForeground?: Color };\n}\n\nexport interface IQuickInputWidgetStyles {\n\tquickInputBackground?: Color;\n\tquickInputForeground?: Color;\n\tquickInputTitleBackground?: Color;\n\tcontrastBorder?: Color;\n\twidgetShadow?: Color;\n}\n\nconst $ = dom.$;\n\ntype Writeable<T> = { -readonly [P in keyof T]: T[P] };\n\nconst backButton = {\n\ticonClass: Codicon.quickInputBack.classNames,\n\ttooltip: localize('quickInput.back', \"Back\"),\n\thandle: -1 // TODO\n};\n\ninterface QuickInputUI {\n\tcontainer: HTMLElement;\n\tstyleSheet: HTMLStyleElement;\n\tleftActionBar: ActionBar;\n\ttitleBar: HTMLElement;\n\ttitle: HTMLElement;\n\tdescription1: HTMLElement;\n\tdescription2: HTMLElement;\n\trightActionBar: ActionBar;\n\tcheckAll: HTMLInputElement;\n\tfilterContainer: HTMLElement;\n\tinputBox: QuickInputBox;\n\tvisibleCountContainer: HTMLElement;\n\tvisibleCount: CountBadge;\n\tcountContainer: HTMLElement;\n\tcount: CountBadge;\n\tokContainer: HTMLElement;\n\tok: Button;\n\tmessage: HTMLElement;\n\tcustomButtonContainer: HTMLElement;\n\tcustomButton: Button;\n\tprogressBar: ProgressBar;\n\tlist: QuickInputList;\n\tonDidAccept: Event<void>;\n\tonDidCustom: Event<void>;\n\tonDidTriggerButton: Event<IQuickInputButton>;\n\tignoreFocusOut: boolean;\n\tkeyMods: Writeable<IKeyMods>;\n\tisScreenReaderOptimized(): boolean;\n\tshow(controller: QuickInput): void;\n\tsetVisibilities(visibilities: Visibilities): void;\n\tsetComboboxAccessibility(enabled: boolean): void;\n\tsetEnabled(enabled: boolean): void;\n\tsetContextKey(contextKey?: string): void;\n\thide(): void;\n}\n\ntype Visibilities = {\n\ttitle?: boolean;\n\tdescription?: boolean;\n\tcheckAll?: boolean;\n\tinputBox?: boolean;\n\tcheckBox?: boolean;\n\tvisibleCount?: boolean;\n\tcount?: boolean;\n\tmessage?: boolean;\n\tlist?: boolean;\n\tok?: boolean;\n\tcustomButton?: boolean;\n\tprogressBar?: boolean;\n};\n\nclass QuickInput extends Disposable implements IQuickInput {\n\tprotected static readonly noPromptMessage = localize('inputModeEntry', \"Press 'Enter' to confirm your input or 'Escape' to cancel\");\n\n\tprivate _title: string | undefined;\n\tprivate _description: string | undefined;\n\tprivate _steps: number | undefined;\n\tprivate _totalSteps: number | undefined;\n\tprotected visible = false;\n\tprivate _enabled = true;\n\tprivate _contextKey: string | undefined;\n\tprivate _busy = false;\n\tprivate _ignoreFocusOut = false;\n\tprivate _buttons: IQuickInputButton[] = [];\n\tprotected noValidationMessage = QuickInput.noPromptMessage;\n\tprivate _validationMessage: string | undefined;\n\tprivate _lastValidationMessage: string | undefined;\n\tprivate _severity: Severity = Severity.Ignore;\n\tprivate _lastSeverity: Severity | undefined;\n\tprivate buttonsUpdated = false;\n\tprivate readonly onDidTriggerButtonEmitter = this._register(new Emitter<IQuickInputButton>());\n\tprivate readonly onDidHideEmitter = this._register(new Emitter<IQuickInputHideEvent>());\n\tprivate readonly onDisposeEmitter = this._register(new Emitter<void>());\n\n\tprotected readonly visibleDisposables = this._register(new DisposableStore());\n\n\tprivate busyDelay: TimeoutTimer | undefined;\n\n\tconstructor(\n\t\tprotected ui: QuickInputUI\n\t) {\n\t\tsuper();\n\t}\n\n\tget title() {\n\t\treturn this._title;\n\t}\n\n\tset title(title: string | undefined) {\n\t\tthis._title = title;\n\t\tthis.update();\n\t}\n\n\tget description() {\n\t\treturn this._description;\n\t}\n\n\tset description(description: string | undefined) {\n\t\tthis._description = description;\n\t\tthis.update();\n\t}\n\n\tget step() {\n\t\treturn this._steps;\n\t}\n\n\tset step(step: number | undefined) {\n\t\tthis._steps = step;\n\t\tthis.update();\n\t}\n\n\tget totalSteps() {\n\t\treturn this._totalSteps;\n\t}\n\n\tset totalSteps(totalSteps: number | undefined) {\n\t\tthis._totalSteps = totalSteps;\n\t\tthis.update();\n\t}\n\n\tget enabled() {\n\t\treturn this._enabled;\n\t}\n\n\tset enabled(enabled: boolean) {\n\t\tthis._enabled = enabled;\n\t\tthis.update();\n\t}\n\n\tget contextKey() {\n\t\treturn this._contextKey;\n\t}\n\n\tset contextKey(contextKey: string | undefined) {\n\t\tthis._contextKey = contextKey;\n\t\tthis.update();\n\t}\n\n\tget busy() {\n\t\treturn this._busy;\n\t}\n\n\tset busy(busy: boolean) {\n\t\tthis._busy = busy;\n\t\tthis.update();\n\t}\n\n\tget ignoreFocusOut() {\n\t\treturn this._ignoreFocusOut;\n\t}\n\n\tset ignoreFocusOut(ignoreFocusOut: boolean) {\n\t\tconst shouldUpdate = this._ignoreFocusOut !== ignoreFocusOut && !isIOS;\n\t\tthis._ignoreFocusOut = ignoreFocusOut && !isIOS;\n\t\tif (shouldUpdate) {\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tget buttons() {\n\t\treturn this._buttons;\n\t}\n\n\tset buttons(buttons: IQuickInputButton[]) {\n\t\tthis._buttons = buttons;\n\t\tthis.buttonsUpdated = true;\n\t\tthis.update();\n\t}\n\n\tget validationMessage() {\n\t\treturn this._validationMessage;\n\t}\n\n\tset validationMessage(validationMessage: string | undefined) {\n\t\tthis._validationMessage = validationMessage;\n\t\tthis.update();\n\t}\n\n\tget severity() {\n\t\treturn this._severity;\n\t}\n\n\tset severity(severity: Severity) {\n\t\tthis._severity = severity;\n\t\tthis.update();\n\t}\n\n\tshow(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.visibleDisposables.add(\n\t\t\tthis.ui.onDidTriggerButton(button => {\n\t\t\t\tif (this.buttons.indexOf(button) !== -1) {\n\t\t\t\t\tthis.onDidTriggerButtonEmitter.fire(button);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\tthis.ui.show(this);\n\n\t\t// update properties in the controller that get reset in the ui.show() call\n\t\tthis.visible = true;\n\t\t// This ensures the message/prompt gets rendered\n\t\tthis._lastValidationMessage = undefined;\n\t\t// This ensures the input box has the right severity applied\n\t\tthis._lastSeverity = undefined;\n\t\tif (this.buttons.length) {\n\t\t\t// if there are buttons, the ui.show() clears them out of the UI so we should\n\t\t\t// rerender them.\n\t\t\tthis.buttonsUpdated = true;\n\t\t}\n\n\t\tthis.update();\n\t}\n\n\thide(): void {\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.ui.hide();\n\t}\n\n\tdidHide(reason = QuickInputHideReason.Other): void {\n\t\tthis.visible = false;\n\t\tthis.visibleDisposables.clear();\n\t\tthis.onDidHideEmitter.fire({ reason });\n\t}\n\n\treadonly onDidHide = this.onDidHideEmitter.event;\n\n\tprotected update() {\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\t\tconst title = this.getTitle();\n\t\tif (title && this.ui.title.textContent !== title) {\n\t\t\tthis.ui.title.textContent = title;\n\t\t} else if (!title && this.ui.title.innerHTML !== ' ') {\n\t\t\tthis.ui.title.innerText = '\\u00a0';\n\t\t}\n\t\tconst description = this.getDescription();\n\t\tif (this.ui.description1.textContent !== description) {\n\t\t\tthis.ui.description1.textContent = description;\n\t\t}\n\t\tif (this.ui.description2.textContent !== description) {\n\t\t\tthis.ui.description2.textContent = description;\n\t\t}\n\t\tif (this.busy && !this.busyDelay) {\n\t\t\tthis.busyDelay = new TimeoutTimer();\n\t\t\tthis.busyDelay.setIfNotSet(() => {\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.ui.progressBar.infinite();\n\t\t\t\t}\n\t\t\t}, 800);\n\t\t}\n\t\tif (!this.busy && this.busyDelay) {\n\t\t\tthis.ui.progressBar.stop();\n\t\t\tthis.busyDelay.cancel();\n\t\t\tthis.busyDelay = undefined;\n\t\t}\n\t\tif (this.buttonsUpdated) {\n\t\t\tthis.buttonsUpdated = false;\n\t\t\tthis.ui.leftActionBar.clear();\n\t\t\tconst leftButtons = this.buttons.filter(button => button === backButton);\n\t\t\tthis.ui.leftActionBar.push(leftButtons.map((button, index) => {\n\t\t\t\tconst action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath), true, async () => {\n\t\t\t\t\tthis.onDidTriggerButtonEmitter.fire(button);\n\t\t\t\t});\n\t\t\t\taction.tooltip = button.tooltip || '';\n\t\t\t\treturn action;\n\t\t\t}), { icon: true, label: false });\n\t\t\tthis.ui.rightActionBar.clear();\n\t\t\tconst rightButtons = this.buttons.filter(button => button !== backButton);\n\t\t\tthis.ui.rightActionBar.push(rightButtons.map((button, index) => {\n\t\t\t\tconst action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath), true, async () => {\n\t\t\t\t\tthis.onDidTriggerButtonEmitter.fire(button);\n\t\t\t\t});\n\t\t\t\taction.tooltip = button.tooltip || '';\n\t\t\t\treturn action;\n\t\t\t}), { icon: true, label: false });\n\t\t}\n\t\tthis.ui.ignoreFocusOut = this.ignoreFocusOut;\n\t\tthis.ui.setEnabled(this.enabled);\n\t\tthis.ui.setContextKey(this.contextKey);\n\n\t\tconst validationMessage = this.validationMessage || this.noValidationMessage;\n\t\tif (this._lastValidationMessage !== validationMessage) {\n\t\t\tthis._lastValidationMessage = validationMessage;\n\t\t\tdom.reset(this.ui.message, ...renderLabelWithIcons(validationMessage));\n\t\t}\n\t\tif (this._lastSeverity !== this.severity) {\n\t\t\tthis._lastSeverity = this.severity;\n\t\t\tthis.showMessageDecoration(this.severity);\n\t\t}\n\t}\n\n\tprivate getTitle() {\n\t\tif (this.title && this.step) {\n\t\t\treturn `${this.title} (${this.getSteps()})`;\n\t\t}\n\t\tif (this.title) {\n\t\t\treturn this.title;\n\t\t}\n\t\tif (this.step) {\n\t\t\treturn this.getSteps();\n\t\t}\n\t\treturn '';\n\t}\n\n\tprivate getDescription() {\n\t\treturn this.description || '';\n\t}\n\n\tprivate getSteps() {\n\t\tif (this.step && this.totalSteps) {\n\t\t\treturn localize('quickInput.steps', \"{0}/{1}\", this.step, this.totalSteps);\n\t\t}\n\t\tif (this.step) {\n\t\t\treturn String(this.step);\n\t\t}\n\t\treturn '';\n\t}\n\n\tprotected showMessageDecoration(severity: Severity) {\n\t\tthis.ui.inputBox.showDecoration(severity);\n\t\tif (severity !== Severity.Ignore) {\n\t\t\tconst styles = this.ui.inputBox.stylesForType(severity);\n\t\t\tthis.ui.message.style.color = styles.foreground ? `${styles.foreground}` : '';\n\t\t\tthis.ui.message.style.backgroundColor = styles.background ? `${styles.background}` : '';\n\t\t\tthis.ui.message.style.border = styles.border ? `1px solid ${styles.border}` : '';\n\t\t\tthis.ui.message.style.marginBottom = '-2px';\n\t\t} else {\n\t\t\tthis.ui.message.style.color = '';\n\t\t\tthis.ui.message.style.backgroundColor = '';\n\t\t\tthis.ui.message.style.border = '';\n\t\t\tthis.ui.message.style.marginBottom = '';\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\t\tthis.onDisposeEmitter.fire();\n\n\t\tsuper.dispose();\n\t}\n}\n\nclass QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPick<T> {\n\n\tprivate static readonly DEFAULT_ARIA_LABEL = localize('quickInputBox.ariaLabel', \"Type to narrow down results.\");\n\n\tprivate _value = '';\n\tprivate _ariaLabel: string | undefined;\n\tprivate _placeholder: string | undefined;\n\tprivate readonly onDidChangeValueEmitter = this._register(new Emitter<string>());\n\tprivate readonly onWillAcceptEmitter = this._register(new Emitter<IQuickPickWillAcceptEvent>());\n\tprivate readonly onDidAcceptEmitter = this._register(new Emitter<IQuickPickDidAcceptEvent>());\n\tprivate readonly onDidCustomEmitter = this._register(new Emitter<void>());\n\tprivate _items: Array<T | IQuickPickSeparator> = [];\n\tprivate itemsUpdated = false;\n\tprivate _canSelectMany = false;\n\tprivate _canAcceptInBackground = false;\n\tprivate _matchOnDescription = false;\n\tprivate _matchOnDetail = false;\n\tprivate _matchOnLabel = true;\n\tprivate _sortByLabel = true;\n\tprivate _autoFocusOnList = true;\n\tprivate _keepScrollPosition = false;\n\tprivate _itemActivation = this.ui.isScreenReaderOptimized() ? ItemActivation.NONE /* https://github.com/microsoft/vscode/issues/57501 */ : ItemActivation.FIRST;\n\tprivate _activeItems: T[] = [];\n\tprivate activeItemsUpdated = false;\n\tprivate activeItemsToConfirm: T[] | null = [];\n\tprivate readonly onDidChangeActiveEmitter = this._register(new Emitter<T[]>());\n\tprivate _selectedItems: T[] = [];\n\tprivate selectedItemsUpdated = false;\n\tprivate selectedItemsToConfirm: T[] | null = [];\n\tprivate readonly onDidChangeSelectionEmitter = this._register(new Emitter<T[]>());\n\tprivate readonly onDidTriggerItemButtonEmitter = this._register(new Emitter<IQuickPickItemButtonEvent<T>>());\n\tprivate _valueSelection: Readonly<[number, number]> | undefined;\n\tprivate valueSelectionUpdated = true;\n\tprivate _ok: boolean | 'default' = 'default';\n\tprivate _customButton = false;\n\tprivate _customButtonLabel: string | undefined;\n\tprivate _customButtonHover: string | undefined;\n\tprivate _quickNavigate: IQuickNavigateConfiguration | undefined;\n\tprivate _hideInput: boolean | undefined;\n\tprivate _hideCheckAll: boolean | undefined;\n\n\tget quickNavigate() {\n\t\treturn this._quickNavigate;\n\t}\n\n\tset quickNavigate(quickNavigate: IQuickNavigateConfiguration | undefined) {\n\t\tthis._quickNavigate = quickNavigate;\n\t\tthis.update();\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(value: string) {\n\t\tthis.doSetValue(value);\n\t}\n\n\tprivate doSetValue(value: string, skipUpdate?: boolean): void {\n\t\tif (this._value !== value) {\n\t\t\tthis._value = value;\n\t\t\tif (!skipUpdate) {\n\t\t\t\tthis.update();\n\t\t\t}\n\t\t\tif (this.visible) {\n\t\t\t\tconst didFilter = this.ui.list.filter(this.filterValue(this._value));\n\t\t\t\tif (didFilter) {\n\t\t\t\t\tthis.trySelectFirst();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onDidChangeValueEmitter.fire(this._value);\n\t\t}\n\t}\n\n\tfilterValue = (value: string) => value;\n\n\tset ariaLabel(ariaLabel: string | undefined) {\n\t\tthis._ariaLabel = ariaLabel;\n\t\tthis.update();\n\t}\n\n\tget ariaLabel() {\n\t\treturn this._ariaLabel;\n\t}\n\n\tget placeholder() {\n\t\treturn this._placeholder;\n\t}\n\n\tset placeholder(placeholder: string | undefined) {\n\t\tthis._placeholder = placeholder;\n\t\tthis.update();\n\t}\n\n\tonDidChangeValue = this.onDidChangeValueEmitter.event;\n\n\tonWillAccept = this.onWillAcceptEmitter.event;\n\tonDidAccept = this.onDidAcceptEmitter.event;\n\n\tget items() {\n\t\treturn this._items;\n\t}\n\n\tprivate get scrollTop() {\n\t\treturn this.ui.list.scrollTop;\n\t}\n\n\tprivate set scrollTop(scrollTop: number) {\n\t\tthis.ui.list.scrollTop = scrollTop;\n\t}\n\n\tset items(items: Array<T | IQuickPickSeparator>) {\n\t\tthis._items = items;\n\t\tthis.itemsUpdated = true;\n\t\tthis.update();\n\t}\n\n\tget canSelectMany() {\n\t\treturn this._canSelectMany;\n\t}\n\n\tset canSelectMany(canSelectMany: boolean) {\n\t\tthis._canSelectMany = canSelectMany;\n\t\tthis.update();\n\t}\n\n\tget canAcceptInBackground() {\n\t\treturn this._canAcceptInBackground;\n\t}\n\n\tset canAcceptInBackground(canAcceptInBackground: boolean) {\n\t\tthis._canAcceptInBackground = canAcceptInBackground;\n\t}\n\n\tget matchOnDescription() {\n\t\treturn this._matchOnDescription;\n\t}\n\n\tset matchOnDescription(matchOnDescription: boolean) {\n\t\tthis._matchOnDescription = matchOnDescription;\n\t\tthis.update();\n\t}\n\n\tget matchOnDetail() {\n\t\treturn this._matchOnDetail;\n\t}\n\n\tset matchOnDetail(matchOnDetail: boolean) {\n\t\tthis._matchOnDetail = matchOnDetail;\n\t\tthis.update();\n\t}\n\n\tget matchOnLabel() {\n\t\treturn this._matchOnLabel;\n\t}\n\n\tset matchOnLabel(matchOnLabel: boolean) {\n\t\tthis._matchOnLabel = matchOnLabel;\n\t\tthis.update();\n\t}\n\n\tget sortByLabel() {\n\t\treturn this._sortByLabel;\n\t}\n\n\tset sortByLabel(sortByLabel: boolean) {\n\t\tthis._sortByLabel = sortByLabel;\n\t\tthis.update();\n\t}\n\n\tget autoFocusOnList() {\n\t\treturn this._autoFocusOnList;\n\t}\n\n\tset autoFocusOnList(autoFocusOnList: boolean) {\n\t\tthis._autoFocusOnList = autoFocusOnList;\n\t\tthis.update();\n\t}\n\n\tget keepScrollPosition() {\n\t\treturn this._keepScrollPosition;\n\t}\n\n\tset keepScrollPosition(keepScrollPosition: boolean) {\n\t\tthis._keepScrollPosition = keepScrollPosition;\n\t}\n\n\tget itemActivation() {\n\t\treturn this._itemActivation;\n\t}\n\n\tset itemActivation(itemActivation: ItemActivation) {\n\t\tthis._itemActivation = itemActivation;\n\t}\n\n\tget activeItems() {\n\t\treturn this._activeItems;\n\t}\n\n\tset activeItems(activeItems: T[]) {\n\t\tthis._activeItems = activeItems;\n\t\tthis.activeItemsUpdated = true;\n\t\tthis.update();\n\t}\n\n\tonDidChangeActive = this.onDidChangeActiveEmitter.event;\n\n\tget selectedItems() {\n\t\treturn this._selectedItems;\n\t}\n\n\tset selectedItems(selectedItems: T[]) {\n\t\tthis._selectedItems = selectedItems;\n\t\tthis.selectedItemsUpdated = true;\n\t\tthis.update();\n\t}\n\n\tget keyMods() {\n\t\tif (this._quickNavigate) {\n\t\t\t// Disable keyMods when quick navigate is enabled\n\t\t\t// because in this model the interaction is purely\n\t\t\t// keyboard driven and Ctrl/Alt are typically\n\t\t\t// pressed and hold during this interaction.\n\t\t\treturn NO_KEY_MODS;\n\t\t}\n\t\treturn this.ui.keyMods;\n\t}\n\n\tset valueSelection(valueSelection: Readonly<[number, number]>) {\n\t\tthis._valueSelection = valueSelection;\n\t\tthis.valueSelectionUpdated = true;\n\t\tthis.update();\n\t}\n\n\tget customButton() {\n\t\treturn this._customButton;\n\t}\n\n\tset customButton(showCustomButton: boolean) {\n\t\tthis._customButton = showCustomButton;\n\t\tthis.update();\n\t}\n\n\tget customLabel() {\n\t\treturn this._customButtonLabel;\n\t}\n\n\tset customLabel(label: string | undefined) {\n\t\tthis._customButtonLabel = label;\n\t\tthis.update();\n\t}\n\n\tget customHover() {\n\t\treturn this._customButtonHover;\n\t}\n\n\tset customHover(hover: string | undefined) {\n\t\tthis._customButtonHover = hover;\n\t\tthis.update();\n\t}\n\n\tget ok() {\n\t\treturn this._ok;\n\t}\n\n\tset ok(showOkButton: boolean | 'default') {\n\t\tthis._ok = showOkButton;\n\t\tthis.update();\n\t}\n\n\tget hideInput() {\n\t\treturn !!this._hideInput;\n\t}\n\n\tset hideInput(hideInput: boolean) {\n\t\tthis._hideInput = hideInput;\n\t\tthis.update();\n\t}\n\n\tonDidChangeSelection = this.onDidChangeSelectionEmitter.event;\n\n\tonDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event;\n\n\tprivate trySelectFirst() {\n\t\tif (this.autoFocusOnList) {\n\t\t\tif (!this.canSelectMany) {\n\t\t\t\tthis.ui.list.focus(QuickInputListFocus.First);\n\t\t\t}\n\t\t}\n\t}\n\n\toverride show() {\n\t\tif (!this.visible) {\n\t\t\tthis.visibleDisposables.add(\n\t\t\t\tthis.ui.inputBox.onDidChange(value => {\n\t\t\t\t\tthis.doSetValue(value, true /* skip update since this originates from the UI */);\n\t\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.inputBox.onMouseDown(event => {\n\t\t\t\tif (!this.autoFocusOnList) {\n\t\t\t\t\tthis.ui.list.clearFocus();\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add((this._hideInput ? this.ui.list : this.ui.inputBox).onKeyDown((event: KeyboardEvent | StandardKeyboardEvent) => {\n\t\t\t\tswitch (event.keyCode) {\n\t\t\t\t\tcase KeyCode.DownArrow:\n\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Next);\n\t\t\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\t\t\tthis.ui.list.domFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.UpArrow:\n\t\t\t\t\t\tif (this.ui.list.getFocusedElements().length) {\n\t\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Previous);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Last);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\t\t\tthis.ui.list.domFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.PageDown:\n\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.NextPage);\n\t\t\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\t\t\tthis.ui.list.domFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.PageUp:\n\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.PreviousPage);\n\t\t\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\t\t\tthis.ui.list.domFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.RightArrow:\n\t\t\t\t\t\tif (!this._canAcceptInBackground) {\n\t\t\t\t\t\t\treturn; // needs to be enabled\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!this.ui.inputBox.isSelectionAtEnd()) {\n\t\t\t\t\t\t\treturn; // ensure input box selection at end\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.activeItems[0]) {\n\t\t\t\t\t\t\tthis._selectedItems = [this.activeItems[0]];\n\t\t\t\t\t\t\tthis.onDidChangeSelectionEmitter.fire(this.selectedItems);\n\t\t\t\t\t\t\tthis.handleAccept(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.Home:\n\t\t\t\t\t\tif ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) {\n\t\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.First);\n\t\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyCode.End:\n\t\t\t\t\t\tif ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) {\n\t\t\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Last);\n\t\t\t\t\t\t\tdom.EventHelper.stop(event, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.onDidAccept(() => {\n\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\t// if there are no checked elements, it means that an onDidChangeSelection never fired to overwrite\n\t\t\t\t\t// `_selectedItems`. In that case, we should emit one with an empty array to ensure that\n\t\t\t\t\t// `.selectedItems` is up to date.\n\t\t\t\t\tif (!this.ui.list.getCheckedElements().length) {\n\t\t\t\t\t\tthis._selectedItems = [];\n\t\t\t\t\t\tthis.onDidChangeSelectionEmitter.fire(this.selectedItems);\n\t\t\t\t\t}\n\t\t\t\t} else if (this.activeItems[0]) {\n\t\t\t\t\t// For single-select, we set `selectedItems` to the item that was accepted.\n\t\t\t\t\tthis._selectedItems = [this.activeItems[0]];\n\t\t\t\t\tthis.onDidChangeSelectionEmitter.fire(this.selectedItems);\n\t\t\t\t}\n\t\t\t\tthis.handleAccept(false);\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.onDidCustom(() => {\n\t\t\t\tthis.onDidCustomEmitter.fire();\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.list.onDidChangeFocus(focusedItems => {\n\t\t\t\tif (this.activeItemsUpdated) {\n\t\t\t\t\treturn; // Expect another event.\n\t\t\t\t}\n\t\t\t\tif (this.activeItemsToConfirm !== this._activeItems && equals(focusedItems, this._activeItems, (a, b) => a === b)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._activeItems = focusedItems as T[];\n\t\t\t\tthis.onDidChangeActiveEmitter.fire(focusedItems as T[]);\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.list.onDidChangeSelection(({ items: selectedItems, event }) => {\n\t\t\t\tif (this.canSelectMany) {\n\t\t\t\t\tif (selectedItems.length) {\n\t\t\t\t\t\tthis.ui.list.setSelectedElements([]);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.selectedItemsToConfirm !== this._selectedItems && equals(selectedItems, this._selectedItems, (a, b) => a === b)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedItems = selectedItems as T[];\n\t\t\t\tthis.onDidChangeSelectionEmitter.fire(selectedItems as T[]);\n\t\t\t\tif (selectedItems.length) {\n\t\t\t\t\tthis.handleAccept(event instanceof MouseEvent && event.button === 1 /* mouse middle click */);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.list.onChangedCheckedElements(checkedItems => {\n\t\t\t\tif (!this.canSelectMany) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.selectedItemsToConfirm !== this._selectedItems && equals(checkedItems, this._selectedItems, (a, b) => a === b)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedItems = checkedItems as T[];\n\t\t\t\tthis.onDidChangeSelectionEmitter.fire(checkedItems as T[]);\n\t\t\t}));\n\t\t\tthis.visibleDisposables.add(this.ui.list.onButtonTriggered(event => this.onDidTriggerItemButtonEmitter.fire(event as IQuickPickItemButtonEvent<T>)));\n\t\t\tthis.visibleDisposables.add(this.registerQuickNavigation());\n\t\t\tthis.valueSelectionUpdated = true;\n\t\t}\n\t\tsuper.show(); // TODO: Why have show() bubble up while update() trickles down? (Could move setComboboxAccessibility() here.)\n\t}\n\n\tprivate handleAccept(inBackground: boolean): void {\n\n\t\t// Figure out veto via `onWillAccept` event\n\t\tlet veto = false;\n\t\tthis.onWillAcceptEmitter.fire({ veto: () => veto = true });\n\n\t\t// Continue with `onDidAccept` if no veto\n\t\tif (!veto) {\n\t\t\tthis.onDidAcceptEmitter.fire({ inBackground });\n\t\t}\n\t}\n\n\tprivate registerQuickNavigation() {\n\t\treturn dom.addDisposableListener(this.ui.container, dom.EventType.KEY_UP, e => {\n\t\t\tif (this.canSelectMany || !this._quickNavigate) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\t\t\tconst keyCode = keyboardEvent.keyCode;\n\n\t\t\t// Select element when keys are pressed that signal it\n\t\t\tconst quickNavKeys = this._quickNavigate.keybindings;\n\t\t\tconst wasTriggerKeyPressed = quickNavKeys.some(k => {\n\t\t\t\tconst [firstPart, chordPart] = k.getParts();\n\t\t\t\tif (chordPart) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (firstPart.shiftKey && keyCode === KeyCode.Shift) {\n\t\t\t\t\tif (keyboardEvent.ctrlKey || keyboardEvent.altKey || keyboardEvent.metaKey) {\n\t\t\t\t\t\treturn false; // this is an optimistic check for the shift key being used to navigate back in quick input\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (firstPart.altKey && keyCode === KeyCode.Alt) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (firstPart.ctrlKey && keyCode === KeyCode.Ctrl) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (firstPart.metaKey && keyCode === KeyCode.Meta) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\tif (wasTriggerKeyPressed) {\n\t\t\t\tif (this.activeItems[0]) {\n\t\t\t\t\tthis._selectedItems = [this.activeItems[0]];\n\t\t\t\t\tthis.onDidChangeSelectionEmitter.fire(this.selectedItems);\n\t\t\t\t\tthis.handleAccept(false);\n\t\t\t\t}\n\t\t\t\t// Unset quick navigate after press. It is only valid once\n\t\t\t\t// and should not result in any behaviour change afterwards\n\t\t\t\t// if the picker remains open because there was no active item\n\t\t\t\tthis._quickNavigate = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected override update() {\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\t\t// store the scrollTop before it is reset\n\t\tconst scrollTopBefore = this.keepScrollPosition ? this.scrollTop : 0;\n\t\tconst hideInput = !!this._hideInput && this._items.length > 0;\n\t\tthis.ui.container.classList.toggle('hidden-input', hideInput && !this.description);\n\t\tconst visibilities: Visibilities = {\n\t\t\ttitle: !!this.title || !!this.step || !!this.buttons.length,\n\t\t\tdescription: !!this.description,\n\t\t\tcheckAll: this.canSelectMany && !this._hideCheckAll,\n\t\t\tcheckBox: this.canSelectMany,\n\t\t\tinputBox: !hideInput,\n\t\t\tprogressBar: !hideInput,\n\t\t\tvisibleCount: true,\n\t\t\tcount: this.canSelectMany,\n\t\t\tok: this.ok === 'default' ? this.canSelectMany : this.ok,\n\t\t\tlist: true,\n\t\t\tmessage: !!this.validationMessage,\n\t\t\tcustomButton: this.customButton\n\t\t};\n\t\tthis.ui.setVisibilities(visibilities);\n\t\tsuper.update();\n\t\tif (this.ui.inputBox.value !== this.value) {\n\t\t\tthis.ui.inputBox.value = this.value;\n\t\t}\n\t\tif (this.valueSelectionUpdated) {\n\t\t\tthis.valueSelectionUpdated = false;\n\t\t\tthis.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] });\n\t\t}\n\t\tif (this.ui.inputBox.placeholder !== (this.placeholder || '')) {\n\t\t\tthis.ui.inputBox.placeholder = (this.placeholder || '');\n\t\t}\n\t\tconst ariaLabel = this.ariaLabel || this.placeholder || QuickPick.DEFAULT_ARIA_LABEL;\n\t\tif (this.ui.inputBox.ariaLabel !== ariaLabel) {\n\t\t\tthis.ui.inputBox.ariaLabel = ariaLabel;\n\t\t}\n\t\tthis.ui.list.matchOnDescription = this.matchOnDescription;\n\t\tthis.ui.list.matchOnDetail = this.matchOnDetail;\n\t\tthis.ui.list.matchOnLabel = this.matchOnLabel;\n\t\tthis.ui.list.sortByLabel = this.sortByLabel;\n\t\tif (this.itemsUpdated) {\n\t\t\tthis.itemsUpdated = false;\n\t\t\tthis.ui.list.setElements(this.items);\n\t\t\tthis.ui.list.filter(this.filterValue(this.ui.inputBox.value));\n\t\t\tthis.ui.checkAll.checked = this.ui.list.getAllVisibleChecked();\n\t\t\tthis.ui.visibleCount.setCount(this.ui.list.getVisibleCount());\n\t\t\tthis.ui.count.setCount(this.ui.list.getCheckedCount());\n\t\t\tswitch (this._itemActivation) {\n\t\t\t\tcase ItemActivation.NONE:\n\t\t\t\t\tthis._itemActivation = ItemActivation.FIRST; // only valid once, then unset\n\t\t\t\t\tbreak;\n\t\t\t\tcase ItemActivation.SECOND:\n\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Second);\n\t\t\t\t\tthis._itemActivation = ItemActivation.FIRST; // only valid once, then unset\n\t\t\t\t\tbreak;\n\t\t\t\tcase ItemActivation.LAST:\n\t\t\t\t\tthis.ui.list.focus(QuickInputListFocus.Last);\n\t\t\t\t\tthis._itemActivation = ItemActivation.FIRST; // only valid once, then unset\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.trySelectFirst();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (this.ui.container.classList.contains('show-checkboxes') !== !!this.canSelectMany) {\n\t\t\tif (this.canSelectMany) {\n\t\t\t\tthis.ui.list.clearFocus();\n\t\t\t} else {\n\t\t\t\tthis.trySelectFirst();\n\t\t\t}\n\t\t}\n\t\tif (this.activeItemsUpdated) {\n\t\t\tthis.activeItemsUpdated = false;\n\t\t\tthis.activeItemsToConfirm = this._activeItems;\n\t\t\tthis.ui.list.setFocusedElements(this.activeItems);\n\t\t\tif (this.activeItemsToConfirm === this._activeItems) {\n\t\t\t\tthis.activeItemsToConfirm = null;\n\t\t\t}\n\t\t}\n\t\tif (this.selectedItemsUpdated) {\n\t\t\tthis.selectedItemsUpdated = false;\n\t\t\tthis.selectedItemsToConfirm = this._selectedItems;\n\t\t\tif (this.canSelectMany) {\n\t\t\t\tthis.ui.list.setCheckedElements(this.selectedItems);\n\t\t\t} else {\n\t\t\t\tthis.ui.list.setSelectedElements(this.selectedItems);\n\t\t\t}\n\t\t\tif (this.selectedItemsToConfirm === this._selectedItems) {\n\t\t\t\tthis.selectedItemsToConfirm = null;\n\t\t\t}\n\t\t}\n\t\tthis.ui.customButton.label = this.customLabel || '';\n\t\tthis.ui.customButton.element.title = this.customHover || '';\n\t\tthis.ui.setComboboxAccessibility(true);\n\t\tif (!visibilities.inputBox) {\n\t\t\t// we need to move focus into the tree to detect keybindings\n\t\t\t// properly when the input box is not visible (quick nav)\n\t\t\tthis.ui.list.domFocus();\n\n\t\t\t// Focus the first element in the list if multiselect is enabled\n\t\t\tif (this.canSelectMany) {\n\t\t\t\tthis.ui.list.focus(QuickInputListFocus.First);\n\t\t\t}\n\t\t}\n\n\t\t// Set the scroll position to what it was before updating the items\n\t\tif (this.keepScrollPosition) {\n\t\t\tthis.scrollTop = scrollTopBefore;\n\t\t}\n\t}\n}\n\nexport class QuickInputController extends Disposable {\n\tprivate static readonly MAX_WIDTH = 600; // Max total width of quick input widget\n\n\tprivate idPrefix: string;\n\tprivate ui: QuickInputUI | undefined;\n\tprivate dimension?: dom.IDimension;\n\tprivate titleBarOffset?: number;\n\tprivate comboboxAccessibility = false;\n\tprivate enabled = true;\n\tprivate readonly onDidAcceptEmitter = this._register(new Emitter<void>());\n\tprivate readonly onDidCustomEmitter = this._register(new Emitter<void>());\n\tprivate readonly onDidTriggerButtonEmitter = this._register(new Emitter<IQuickInputButton>());\n\tprivate keyMods: Writeable<IKeyMods> = { ctrlCmd: false, alt: false };\n\n\tprivate controller: QuickInput | null = null;\n\n\tprivate parentElement: HTMLElement;\n\tprivate styles: IQuickInputStyles;\n\n\tprivate onShowEmitter = this._register(new Emitter<void>());\n\treadonly onShow = this.onShowEmitter.event;\n\n\tprivate onHideEmitter = this._register(new Emitter<void>());\n\treadonly onHide = this.onHideEmitter.event;\n\n\tprivate previousFocusElement?: HTMLElement;\n\n\tconstructor(private options: IQuickInputOptions) {\n\t\tsuper();\n\t\tthis.idPrefix = options.idPrefix;\n\t\tthis.parentElement = options.container;\n\t\tthis.styles = options.styles;\n\t\tthis.registerKeyModsListeners();\n\t}\n\n\tprivate registerKeyModsListeners() {\n\t\tconst listener = (e: KeyboardEvent | MouseEvent) => {\n\t\t\tthis.keyMods.ctrlCmd = e.ctrlKey || e.metaKey;\n\t\t\tthis.keyMods.alt = e.altKey;\n\t\t};\n\t\tthis._register(dom.addDisposableListener(window, dom.EventType.KEY_DOWN, listener, true));\n\t\tthis._register(dom.addDisposableListener(window, dom.EventType.KEY_UP, listener, true));\n\t\tthis._register(dom.addDisposableListener(window, dom.EventType.MOUSE_DOWN, listener, true));\n\t}\n\n\tprivate getUI() {\n\t\tif (this.ui) {\n\t\t\treturn this.ui;\n\t\t}\n\n\t\tconst container = dom.append(this.parentElement, $('.quick-input-widget.show-file-icons'));\n\t\tcontainer.tabIndex = -1;\n\t\tcontainer.style.display = 'none';\n\n\t\tconst styleSheet = dom.createStyleSheet(container);\n\n\t\tconst titleBar = dom.append(container, $('.quick-input-titlebar'));\n\n\t\tconst leftActionBar = this._register(new ActionBar(titleBar));\n\t\tleftActionBar.domNode.classList.add('quick-input-left-action-bar');\n\n\t\tconst title = dom.append(titleBar, $('.quick-input-title'));\n\n\t\tconst rightActionBar = this._register(new ActionBar(titleBar));\n\t\trightActionBar.domNode.classList.add('quick-input-right-action-bar');\n\n\t\tconst description1 = dom.append(container, $('.quick-input-description'));\n\t\tconst headerContainer = dom.append(container, $('.quick-input-header'));\n\n\t\tconst checkAll = <HTMLInputElement>dom.append(headerContainer, $('input.quick-input-check-all'));\n\t\tcheckAll.type = 'checkbox';\n\t\tthis._register(dom.addStandardDisposableListener(checkAll, dom.EventType.CHANGE, e => {\n\t\t\tconst checked = checkAll.checked;\n\t\t\tlist.setAllVisibleChecked(checked);\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(checkAll, dom.EventType.CLICK, e => {\n\t\t\tif (e.x || e.y) { // Avoid 'click' triggered by 'space'...\n\t\t\t\tinputBox.setFocus();\n\t\t\t}\n\t\t}));\n\n\t\tconst description2 = dom.append(headerContainer, $('.quick-input-description'));\n\t\tconst extraContainer = dom.append(headerContainer, $('.quick-input-and-message'));\n\t\tconst filterContainer = dom.append(extraContainer, $('.quick-input-filter'));\n\n\t\tconst inputBox = this._register(new QuickInputBox(filterContainer));\n\t\tinputBox.setAttribute('aria-describedby', `${this.idPrefix}message`);\n\n\t\tconst visibleCountContainer = dom.append(filterContainer, $('.quick-input-visible-count'));\n\t\tvisibleCountContainer.setAttribute('aria-live', 'polite');\n\t\tvisibleCountContainer.setAttribute('aria-atomic', 'true');\n\t\tconst visibleCount = new CountBadge(visibleCountContainer, { countFormat: localize({ key: 'quickInput.visibleCount', comment: ['This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers.'] }, \"{0} Results\") });\n\n\t\tconst countContainer = dom.append(filterContainer, $('.quick-input-count'));\n\t\tcountContainer.setAttribute('aria-live', 'polite');\n\t\tconst count = new CountBadge(countContainer, { countFormat: localize({ key: 'quickInput.countSelected', comment: ['This tells the user how many items are selected in a list of items to select from. The items can be anything.'] }, \"{0} Selected\") });\n\n\t\tconst okContainer = dom.append(headerContainer, $('.quick-input-action'));\n\t\tconst ok = new Button(okContainer);\n\t\tok.label = localize('ok', \"OK\");\n\t\tthis._register(ok.onDidClick(e => {\n\t\t\tthis.onDidAcceptEmitter.fire();\n\t\t}));\n\n\t\tconst customButtonContainer = dom.append(headerContainer, $('.quick-input-action'));\n\t\tconst customButton = new Button(customButtonContainer);\n\t\tcustomButton.label = localize('custom', \"Custom\");\n\t\tthis._register(customButton.onDidClick(e => {\n\t\t\tthis.onDidCustomEmitter.fire();\n\t\t}));\n\n\t\tconst message = dom.append(extraContainer, $(`#${this.idPrefix}message.quick-input-message`));\n\n\t\tconst list = this._register(new QuickInputList(container, this.idPrefix + 'list', this.options));\n\t\tthis._register(list.onChangedAllVisibleChecked(checked => {\n\t\t\tcheckAll.checked = checked;\n\t\t}));\n\t\tthis._register(list.onChangedVisibleCount(c => {\n\t\t\tvisibleCount.setCount(c);\n\t\t}));\n\t\tthis._register(list.onChangedCheckedCount(c => {\n\t\t\tcount.setCount(c);\n\t\t}));\n\t\tthis._register(list.onLeave(() => {\n\t\t\t// Defer to avoid the input field reacting to the triggering key.\n\t\t\tsetTimeout(() => {\n\t\t\t\tinputBox.setFocus();\n\t\t\t\tif (this.controller instanceof QuickPick && this.controller.canSelectMany) {\n\t\t\t\t\tlist.clearFocus();\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}));\n\t\tthis._register(list.onDidChangeFocus(() => {\n\t\t\tif (this.comboboxAccessibility) {\n\t\t\t\tthis.getUI().inputBox.setAttribute('aria-activedescendant', this.getUI().list.getActiveDescendant() || '');\n\t\t\t}\n\t\t}));\n\n\t\tconst progressBar = new ProgressBar(container);\n\t\tprogressBar.getContainer().classList.add('quick-input-progress');\n\n\t\tconst focusTracker = dom.trackFocus(container);\n\t\tthis._register(focusTracker);\n\t\tthis._register(dom.addDisposableListener(container, dom.EventType.FOCUS, e => {\n\t\t\tthis.previousFocusElement = e.relatedTarget instanceof HTMLElement ? e.relatedTarget : undefined;\n\t\t}, true));\n\t\tthis._register(focusTracker.onDidBlur(() => {\n\t\t\tif (!this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut()) {\n\t\t\t\tthis.hide(QuickInputHideReason.Blur);\n\t\t\t}\n\t\t\tthis.previousFocusElement = undefined;\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(container, dom.EventType.FOCUS, (e: FocusEvent) => {\n\t\t\tinputBox.setFocus();\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(container, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase KeyCode.Enter:\n\t\t\t\t\tdom.EventHelper.stop(e, true);\n\t\t\t\t\tthis.onDidAcceptEmitter.fire();\n\t\t\t\t\tbreak;\n\t\t\t\tcase KeyCode.Escape:\n\t\t\t\t\tdom.EventHelper.stop(e, true);\n\t\t\t\t\tthis.hide(QuickInputHideReason.Gesture);\n\t\t\t\t\tbreak;\n\t\t\t\tcase KeyCode.Tab:\n\t\t\t\t\tif (!event.altKey && !event.ctrlKey && !event.metaKey) {\n\t\t\t\t\t\tconst selectors = ['.action-label.codicon'];\n\t\t\t\t\t\tif (container.classList.contains('show-checkboxes')) {\n\t\t\t\t\t\t\tselectors.push('input');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectors.push('input[type=text]');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.getUI().list.isDisplayed()) {\n\t\t\t\t\t\t\tselectors.push('.monaco-list');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst stops = container.querySelectorAll<HTMLElement>(selectors.join(', '));\n\t\t\t\t\t\tif (event.shiftKey && event.target === stops[0]) {\n\t\t\t\t\t\t\tdom.EventHelper.stop(e, true);\n\t\t\t\t\t\t\tstops[stops.length - 1].focus();\n\t\t\t\t\t\t} else if (!event.shiftKey && event.target === stops[stops.length - 1]) {\n\t\t\t\t\t\t\tdom.EventHelper.stop(e, true);\n\t\t\t\t\t\t\tstops[0].focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}));\n\n\t\tthis.ui = {\n\t\t\tcontainer,\n\t\t\tstyleSheet,\n\t\t\tleftActionBar,\n\t\t\ttitleBar,\n\t\t\ttitle,\n\t\t\tdescription1,\n\t\t\tdescription2,\n\t\t\trightActionBar,\n\t\t\tcheckAll,\n\t\t\tfilterContainer,\n\t\t\tinputBox,\n\t\t\tvisibleCountContainer,\n\t\t\tvisibleCount,\n\t\t\tcountContainer,\n\t\t\tcount,\n\t\t\tokContainer,\n\t\t\tok,\n\t\t\tmessage,\n\t\t\tcustomButtonContainer,\n\t\t\tcustomButton,\n\t\t\tlist,\n\t\t\tprogressBar,\n\t\t\tonDidAccept: this.onDidAcceptEmitter.event,\n\t\t\tonDidCustom: this.onDidCustomEmitter.event,\n\t\t\tonDidTriggerButton: this.onDidTriggerButtonEmitter.event,\n\t\t\tignoreFocusOut: false,\n\t\t\tkeyMods: this.keyMods,\n\t\t\tisScreenReaderOptimized: () => this.options.isScreenReaderOptimized(),\n\t\t\tshow: controller => this.show(controller),\n\t\t\thide: () => this.hide(),\n\t\t\tsetVisibilities: visibilities => this.setVisibilities(visibilities),\n\t\t\tsetComboboxAccessibility: enabled => this.setComboboxAccessibility(enabled),\n\t\t\tsetEnabled: enabled => this.setEnabled(enabled),\n\t\t\tsetContextKey: contextKey => this.options.setContextKey(contextKey),\n\t\t};\n\t\tthis.updateStyles();\n\t\treturn this.ui;\n\t}\n\n\tpick<T extends IQuickPickItem, O extends IPickOptions<T>>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options: O = <O>{}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> {\n\t\ttype R = (O extends { canPickMany: true } ? T[] : T) | undefined;\n\t\treturn new Promise<R>((doResolve, reject) => {\n\t\t\tlet resolve = (result: R) => {\n\t\t\t\tresolve = doResolve;\n\t\t\t\tif (options.onKeyMods) {\n\t\t\t\t\toptions.onKeyMods(input.keyMods);\n\t\t\t\t}\n\t\t\t\tdoResolve(result);\n\t\t\t};\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\tresolve(undefined);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst input = this.createQuickPick<T>();\n\t\t\tlet activeItem: T | undefined;\n\t\t\tconst disposables = [\n\t\t\t\tinput,\n\t\t\t\tinput.onDidAccept(() => {\n\t\t\t\t\tif (input.canSelectMany) {\n\t\t\t\t\t\tresolve(<R>input.selectedItems.slice());\n\t\t\t\t\t\tinput.hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst result = input.activeItems[0];\n\t\t\t\t\t\tif (result) {\n\t\t\t\t\t\t\tresolve(<R>result);\n\t\t\t\t\t\t\tinput.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tinput.onDidChangeActive(items => {\n\t\t\t\t\tconst focused = items[0];\n\t\t\t\t\tif (focused && options.onDidFocus) {\n\t\t\t\t\t\toptions.onDidFocus(focused);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tinput.onDidChangeSelection(items => {\n\t\t\t\t\tif (!input.canSelectMany) {\n\t\t\t\t\t\tconst result = items[0];\n\t\t\t\t\t\tif (result) {\n\t\t\t\t\t\t\tresolve(<R>result);\n\t\t\t\t\t\t\tinput.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tinput.onDidTriggerItemButton(event => options.onDidTriggerItemButton && options.onDidTriggerItemButton({\n\t\t\t\t\t...event,\n\t\t\t\t\tremoveItem: () => {\n\t\t\t\t\t\tconst index = input.items.indexOf(event.item);\n\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\tconst items = input.items.slice();\n\t\t\t\t\t\t\tconst removed = items.splice(index, 1);\n\t\t\t\t\t\t\tconst activeItems = input.activeItems.filter(activeItem => activeItem !== removed[0]);\n\t\t\t\t\t\t\tconst keepScrollPositionBefore = input.keepScrollPosition;\n\t\t\t\t\t\t\tinput.keepScrollPosition = true;\n\t\t\t\t\t\t\tinput.items = items;\n\t\t\t\t\t\t\tif (activeItems) {\n\t\t\t\t\t\t\t\tinput.activeItems = activeItems;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinput.keepScrollPosition = keepScrollPositionBefore;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})),\n\t\t\t\tinput.onDidChangeValue(value => {\n\t\t\t\t\tif (activeItem && !value && (input.activeItems.length !== 1 || input.activeItems[0] !== activeItem)) {\n\t\t\t\t\t\tinput.activeItems = [activeItem];\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttoken.onCancellationRequested(() => {\n\t\t\t\t\tinput.hide();\n\t\t\t\t}),\n\t\t\t\tinput.onDidHide(() => {\n\t\t\t\t\tdispose(disposables);\n\t\t\t\t\tresolve(undefined);\n\t\t\t\t}),\n\t\t\t];\n\t\t\tinput.title = options.title;\n\t\t\tinput.canSelectMany = !!options.canPickMany;\n\t\t\tinput.placeholder = options.placeHolder;\n\t\t\tinput.ignoreFocusOut = !!options.ignoreFocusLost;\n\t\t\tinput.matchOnDescription = !!options.matchOnDescription;\n\t\t\tinput.matchOnDetail = !!options.matchOnDetail;\n\t\t\tinput.matchOnLabel = (options.matchOnLabel === undefined) || options.matchOnLabel; // default to true\n\t\t\tinput.autoFocusOnList = (options.autoFocusOnList === undefined) || options.autoFocusOnList; // default to true\n\t\t\tinput.quickNavigate = options.quickNavigate;\n\t\t\tinput.contextKey = options.contextKey;\n\t\t\tinput.busy = true;\n\t\t\tPromise.all([picks, options.activeItem])\n\t\t\t\t.then(([items, _activeItem]) => {\n\t\t\t\t\tactiveItem = _activeItem;\n\t\t\t\t\tinput.busy = false;\n\t\t\t\t\tinput.items = items;\n\t\t\t\t\tif (input.canSelectMany) {\n\t\t\t\t\t\tinput.selectedItems = items.filter(item => item.type !== 'separator' && item.picked) as T[];\n\t\t\t\t\t}\n\t\t\t\t\tif (activeItem) {\n\t\t\t\t\t\tinput.activeItems = [activeItem];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tinput.show();\n\t\t\tPromise.resolve(picks).then(undefined, err => {\n\t\t\t\treject(err);\n\t\t\t\tinput.hide();\n\t\t\t});\n\t\t});\n\t}\n\n\tcreateQuickPick<T extends IQuickPickItem>(): IQuickPick<T> {\n\t\tconst ui = this.getUI();\n\t\treturn new QuickPick<T>(ui);\n\t}\n\n\tprivate show(controller: QuickInput) {\n\t\tconst ui = this.getUI();\n\t\tthis.onShowEmitter.fire();\n\t\tconst oldController = this.controller;\n\t\tthis.controller = controller;\n\t\tif (oldController) {\n\t\t\toldController.didHide();\n\t\t}\n\n\t\tthis.setEnabled(true);\n\t\tui.leftActionBar.clear();\n\t\tui.title.textContent = '';\n\t\tui.description1.textContent = '';\n\t\tui.description2.textContent = '';\n\t\tui.rightActionBar.clear();\n\t\tui.checkAll.checked = false;\n\t\t// ui.inputBox.value = ''; Avoid triggering an event.\n\t\tui.inputBox.placeholder = '';\n\t\tui.inputBox.password = false;\n\t\tui.inputBox.showDecoration(Severity.Ignore);\n\t\tui.visibleCount.setCount(0);\n\t\tui.count.setCount(0);\n\t\tdom.reset(ui.message);\n\t\tui.progressBar.stop();\n\t\tui.list.setElements([]);\n\t\tui.list.matchOnDescription = false;\n\t\tui.list.matchOnDetail = false;\n\t\tui.list.matchOnLabel = true;\n\t\tui.list.sortByLabel = true;\n\t\tui.ignoreFocusOut = false;\n\t\tthis.setComboboxAccessibility(false);\n\t\tui.inputBox.ariaLabel = '';\n\n\t\tconst backKeybindingLabel = this.options.backKeybindingLabel();\n\t\tbackButton.tooltip = backKeybindingLabel ? localize('quickInput.backWithKeybinding', \"Back ({0})\", backKeybindingLabel) : localize('quickInput.back', \"Back\");\n\n\t\tui.container.style.display = '';\n\t\tthis.updateLayout();\n\t\tui.inputBox.setFocus();\n\t}\n\n\tprivate setVisibilities(visibilities: Visibilities) {\n\t\tconst ui = this.getUI();\n\t\tui.title.style.display = visibilities.title ? '' : 'none';\n\t\tui.description1.style.display = visibilities.description && (visibilities.inputBox || visibilities.checkAll) ? '' : 'none';\n\t\tui.description2.style.display = visibilities.description && !(visibilities.inputBox || visibilities.checkAll) ? '' : 'none';\n\t\tui.checkAll.style.display = visibilities.checkAll ? '' : 'none';\n\t\tui.filterContainer.style.display = visibilities.inputBox ? '' : 'none';\n\t\tui.visibleCountContainer.style.display = visibilities.visibleCount ? '' : 'none';\n\t\tui.countContainer.style.display = visibilities.count ? '' : 'none';\n\t\tui.okContainer.style.display = visibilities.ok ? '' : 'none';\n\t\tui.customButtonContainer.style.display = visibilities.customButton ? '' : 'none';\n\t\tui.message.style.display = visibilities.message ? '' : 'none';\n\t\tui.progressBar.getContainer().style.display = visibilities.progressBar ? '' : 'none';\n\t\tui.list.display(!!visibilities.list);\n\t\tui.container.classList[visibilities.checkBox ? 'add' : 'remove']('show-checkboxes');\n\t\tthis.updateLayout(); // TODO\n\t}\n\n\tprivate setComboboxAccessibility(enabled: boolean) {\n\t\tif (enabled !== this.comboboxAccessibility) {\n\t\t\tconst ui = this.getUI();\n\t\t\tthis.comboboxAccessibility = enabled;\n\t\t\tif (this.comboboxAccessibility) {\n\t\t\t\tui.inputBox.setAttribute('role', 'combobox');\n\t\t\t\tui.inputBox.setAttribute('aria-haspopup', 'true');\n\t\t\t\tui.inputBox.setAttribute('aria-autocomplete', 'list');\n\t\t\t\tui.inputBox.setAttribute('aria-activedescendant', ui.list.getActiveDescendant() || '');\n\t\t\t} else {\n\t\t\t\tui.inputBox.removeAttribute('role');\n\t\t\t\tui.inputBox.removeAttribute('aria-haspopup');\n\t\t\t\tui.inputBox.removeAttribute('aria-autocomplete');\n\t\t\t\tui.inputBox.removeAttribute('aria-activedescendant');\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setEnabled(enabled: boolean) {\n\t\tif (enabled !== this.enabled) {\n\t\t\tthis.enabled = enabled;\n\t\t\tfor (const item of this.getUI().leftActionBar.viewItems) {\n\t\t\t\t(item as ActionViewItem).getAction().enabled = enabled;\n\t\t\t}\n\t\t\tfor (const item of this.getUI().rightActionBar.viewItems) {\n\t\t\t\t(item as ActionViewItem).getAction().enabled = enabled;\n\t\t\t}\n\t\t\tthis.getUI().checkAll.disabled = !enabled;\n\t\t\t// this.getUI().inputBox.enabled = enabled; Avoid loosing focus.\n\t\t\tthis.getUI().ok.enabled = enabled;\n\t\t\tthis.getUI().list.enabled = enabled;\n\t\t}\n\t}\n\n\thide(reason?: QuickInputHideReason) {\n\t\tconst controller = this.controller;\n\t\tif (controller) {\n\t\t\tconst focusChanged = !this.ui?.container.contains(document.activeElement);\n\t\t\tthis.controller = null;\n\t\t\tthis.onHideEmitter.fire();\n\t\t\tthis.getUI().container.style.display = 'none';\n\t\t\tif (!focusChanged) {\n\t\t\t\tlet currentElement = this.previousFocusElement;\n\t\t\t\twhile (currentElement && !currentElement.offsetParent) {\n\t\t\t\t\tcurrentElement = withNullAsUndefined(currentElement.parentElement);\n\t\t\t\t}\n\t\t\t\tif (currentElement?.offsetParent) {\n\t\t\t\t\tcurrentElement.focus();\n\t\t\t\t\tthis.previousFocusElement = undefined;\n\t\t\t\t} else {\n\t\t\t\t\tthis.options.returnFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontroller.didHide(reason);\n\t\t}\n\t}\n\n\tlayout(dimension: dom.IDimension, titleBarOffset: number): void {\n\t\tthis.dimension = dimension;\n\t\tthis.titleBarOffset = titleBarOffset;\n\t\tthis.updateLayout();\n\t}\n\n\tprivate updateLayout() {\n\t\tif (this.ui) {\n\t\t\tthis.ui.container.style.top = `${this.titleBarOffset}px`;\n\n\t\t\tconst style = this.ui.container.style;\n\t\t\tconst width = Math.min(this.dimension!.width * 0.62 /* golden cut */, QuickInputController.MAX_WIDTH);\n\t\t\tstyle.width = width + 'px';\n\t\t\tstyle.marginLeft = '-' + (width / 2) + 'px';\n\n\t\t\tthis.ui.inputBox.layout();\n\t\t\tthis.ui.list.layout(this.dimension && this.dimension.height * 0.4);\n\t\t}\n\t}\n\n\tapplyStyles(styles: IQuickInputStyles) {\n\t\tthis.styles = styles;\n\t\tthis.updateStyles();\n\t}\n\n\tprivate updateStyles() {\n\t\tif (this.ui) {\n\t\t\tconst {\n\t\t\t\tquickInputTitleBackground,\n\t\t\t\tquickInputBackground,\n\t\t\t\tquickInputForeground,\n\t\t\t\tcontrastBorder,\n\t\t\t\twidgetShadow,\n\t\t\t} = this.styles.widget;\n\t\t\tthis.ui.titleBar.style.backgroundColor = quickInputTitleBackground ? quickInputTitleBackground.toString() : '';\n\t\t\tthis.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : '';\n\t\t\tthis.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : '';\n\t\t\tthis.ui.container.style.border = contrastBorder ? `1px solid ${contrastBorder}` : '';\n\t\t\tthis.ui.container.style.boxShadow = widgetShadow ? `0 0 8px 2px ${widgetShadow}` : '';\n\t\t\tthis.ui.inputBox.style(this.styles.inputBox);\n\t\t\tthis.ui.count.style(this.styles.countBadge);\n\t\t\tthis.ui.ok.style(this.styles.button);\n\t\t\tthis.ui.customButton.style(this.styles.button);\n\t\t\tthis.ui.progressBar.style(this.styles.progressBar);\n\t\t\tthis.ui.list.style(this.styles.list);\n\n\t\t\tconst content: string[] = [];\n\t\t\tif (this.styles.list.pickerGroupBorder) {\n\t\t\t\tcontent.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`);\n\t\t\t}\n\t\t\tif (this.styles.list.pickerGroupForeground) {\n\t\t\t\tcontent.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis.styles.keybindingLabel.keybindingLabelBackground ||\n\t\t\t\tthis.styles.keybindingLabel.keybindingLabelBorder ||\n\t\t\t\tthis.styles.keybindingLabel.keybindingLabelBottomBorder ||\n\t\t\t\tthis.styles.keybindingLabel.keybindingLabelShadow ||\n\t\t\t\tthis.styles.keybindingLabel.keybindingLabelForeground\n\t\t\t) {\n\t\t\t\tcontent.push('.quick-input-list .monaco-keybinding > .monaco-keybinding-key {');\n\t\t\t\tif (this.styles.keybindingLabel.keybindingLabelBackground) {\n\t\t\t\t\tcontent.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`);\n\t\t\t\t}\n\t\t\t\tif (this.styles.keybindingLabel.keybindingLabelBorder) {\n\t\t\t\t\t// Order matters here. `border-color` must come before `border-bottom-color`.\n\t\t\t\t\tcontent.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`);\n\t\t\t\t}\n\t\t\t\tif (this.styles.keybindingLabel.keybindingLabelBottomBorder) {\n\t\t\t\t\tcontent.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`);\n\t\t\t\t}\n\t\t\t\tif (this.styles.keybindingLabel.keybindingLabelShadow) {\n\t\t\t\t\tcontent.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`);\n\t\t\t\t}\n\t\t\t\tif (this.styles.keybindingLabel.keybindingLabelForeground) {\n\t\t\t\t\tcontent.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`);\n\t\t\t\t}\n\t\t\t\tcontent.push('}');\n\t\t\t}\n\n\t\t\tconst newStyles = content.join('\\n');\n\t\t\tif (newStyles !== this.ui.styleSheet.textContent) {\n\t\t\t\tthis.ui.styleSheet.textContent = newStyles;\n\t\t\t}\n\t\t}\n\t}\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 * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { Action } from 'vs/base/common/actions';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { EndOfLineSequence, ITextModel } from 'vs/editor/common/model';\n\nexport interface IDiffLinesChange {\n\treadonly originalStartLineNumber: number;\n\treadonly originalEndLineNumber: number;\n\treadonly modifiedStartLineNumber: number;\n\treadonly modifiedEndLineNumber: number;\n\treadonly originalModel: ITextModel;\n\tviewLineCounts: number[] | null;\n}\n\nexport class InlineDiffMargin extends Disposable {\n\tprivate readonly _diffActions: HTMLElement;\n\n\tprivate _visibility: boolean = false;\n\n\tget visibility(): boolean {\n\t\treturn this._visibility;\n\t}\n\n\tset visibility(_visibility: boolean) {\n\t\tif (this._visibility !== _visibility) {\n\t\t\tthis._visibility = _visibility;\n\n\t\t\tif (_visibility) {\n\t\t\t\tthis._diffActions.style.visibility = 'visible';\n\t\t\t} else {\n\t\t\t\tthis._diffActions.style.visibility = 'hidden';\n\t\t\t}\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly _viewZoneId: string,\n\t\tprivate readonly _marginDomNode: HTMLElement,\n\t\tpublic readonly editor: CodeEditorWidget,\n\t\tpublic readonly diff: IDiffLinesChange,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\n\t\t// make sure the diff margin shows above overlay.\n\t\tthis._marginDomNode.style.zIndex = '10';\n\n\t\tthis._diffActions = document.createElement('div');\n\t\tthis._diffActions.className = Codicon.lightBulb.classNames + ' lightbulb-glyph';\n\t\tthis._diffActions.style.position = 'absolute';\n\t\tconst lineHeight = editor.getOption(EditorOption.lineHeight);\n\t\tconst lineFeed = editor.getModel()!.getEOL();\n\t\tthis._diffActions.style.right = '0px';\n\t\tthis._diffActions.style.visibility = 'hidden';\n\t\tthis._diffActions.style.height = `${lineHeight}px`;\n\t\tthis._diffActions.style.lineHeight = `${lineHeight}px`;\n\t\tthis._marginDomNode.appendChild(this._diffActions);\n\n\t\tconst actions: Action[] = [];\n\t\tconst isDeletion = diff.modifiedEndLineNumber === 0;\n\n\t\t// default action\n\t\tactions.push(new Action(\n\t\t\t'diff.clipboard.copyDeletedContent',\n\t\t\tisDeletion\n\t\t\t\t? (diff.originalEndLineNumber > diff.modifiedStartLineNumber\n\t\t\t\t\t? nls.localize('diff.clipboard.copyDeletedLinesContent.label', \"Copy deleted lines\")\n\t\t\t\t\t: nls.localize('diff.clipboard.copyDeletedLinesContent.single.label', \"Copy deleted line\"))\n\t\t\t\t: (diff.originalEndLineNumber > diff.modifiedStartLineNumber\n\t\t\t\t\t? nls.localize('diff.clipboard.copyChangedLinesContent.label', \"Copy changed lines\")\n\t\t\t\t\t: nls.localize('diff.clipboard.copyChangedLinesContent.single.label', \"Copy changed line\")),\n\t\t\tundefined,\n\t\t\ttrue,\n\t\t\tasync () => {\n\t\t\t\tconst range = new Range(diff.originalStartLineNumber, 1, diff.originalEndLineNumber + 1, 1);\n\t\t\t\tconst deletedText = diff.originalModel.getValueInRange(range);\n\t\t\t\tawait this._clipboardService.writeText(deletedText);\n\t\t\t}\n\t\t));\n\n\t\tlet currentLineNumberOffset = 0;\n\t\tlet copyLineAction: Action | undefined = undefined;\n\t\tif (diff.originalEndLineNumber > diff.modifiedStartLineNumber) {\n\t\t\tcopyLineAction = new Action(\n\t\t\t\t'diff.clipboard.copyDeletedLineContent',\n\t\t\t\tisDeletion\n\t\t\t\t\t? nls.localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\", diff.originalStartLineNumber)\n\t\t\t\t\t: nls.localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\", diff.originalStartLineNumber),\n\t\t\t\tundefined,\n\t\t\t\ttrue,\n\t\t\t\tasync () => {\n\t\t\t\t\tconst lineContent = diff.originalModel.getLineContent(diff.originalStartLineNumber + currentLineNumberOffset);\n\t\t\t\t\tif (lineContent === '') {\n\t\t\t\t\t\t// empty line\n\t\t\t\t\t\tconst eof = diff.originalModel.getEndOfLineSequence();\n\t\t\t\t\t\tawait this._clipboardService.writeText(eof === EndOfLineSequence.LF ? '\\n' : '\\r\\n');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait this._clipboardService.writeText(lineContent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tactions.push(copyLineAction);\n\t\t}\n\n\t\tconst readOnly = editor.getOption(EditorOption.readOnly);\n\t\tif (!readOnly) {\n\t\t\tactions.push(new Action('diff.inline.revertChange', nls.localize('diff.inline.revertChange.label', \"Revert this change\"), undefined, true, async () => {\n\t\t\t\tconst range = new Range(diff.originalStartLineNumber, 1, diff.originalEndLineNumber, diff.originalModel.getLineMaxColumn(diff.originalEndLineNumber));\n\t\t\t\tconst deletedText = diff.originalModel.getValueInRange(range);\n\t\t\t\tif (diff.modifiedEndLineNumber === 0) {\n\t\t\t\t\t// deletion only\n\t\t\t\t\tconst column = editor.getModel()!.getLineMaxColumn(diff.modifiedStartLineNumber);\n\t\t\t\t\teditor.executeEdits('diffEditor', [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trange: new Range(diff.modifiedStartLineNumber, column, diff.modifiedStartLineNumber, column),\n\t\t\t\t\t\t\ttext: lineFeed + deletedText\n\t\t\t\t\t\t}\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\tconst column = editor.getModel()!.getLineMaxColumn(diff.modifiedEndLineNumber);\n\t\t\t\t\teditor.executeEdits('diffEditor', [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trange: new Range(diff.modifiedStartLineNumber, 1, diff.modifiedEndLineNumber, column),\n\t\t\t\t\t\t\ttext: deletedText\n\t\t\t\t\t\t}\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t}));\n\t\t}\n\n\t\tconst showContextMenu = (x: number, y: number) => {\n\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\tgetAnchor: () => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\tgetActions: () => {\n\t\t\t\t\tif (copyLineAction) {\n\t\t\t\t\t\tcopyLineAction.label =\n\t\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t\t? nls.localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\", diff.originalStartLineNumber + currentLineNumberOffset)\n\t\t\t\t\t\t\t\t: nls.localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\", diff.originalStartLineNumber + currentLineNumberOffset);\n\t\t\t\t\t}\n\t\t\t\t\treturn actions;\n\t\t\t\t},\n\t\t\t\tautoSelectFirstItem: true\n\t\t\t});\n\t\t};\n\n\t\tthis._register(dom.addStandardDisposableListener(this._diffActions, 'mousedown', e => {\n\t\t\tconst { top, height } = dom.getDomNodePagePosition(this._diffActions);\n\t\t\tconst pad = Math.floor(lineHeight / 3);\n\t\t\te.preventDefault();\n\n\t\t\tshowContextMenu(e.posx, top + height + pad);\n\n\t\t}));\n\n\t\tthis._register(editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tif (e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\t\tconst viewZoneId = e.target.detail.viewZoneId;\n\n\t\t\t\tif (viewZoneId === this._viewZoneId) {\n\t\t\t\t\tthis.visibility = true;\n\t\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\t} else {\n\t\t\t\t\tthis.visibility = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.visibility = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(editor.onMouseDown((e: IEditorMouseEvent) => {\n\t\t\tif (!e.event.rightButton) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\t\tconst viewZoneId = e.target.detail.viewZoneId;\n\n\t\t\t\tif (viewZoneId === this._viewZoneId) {\n\t\t\t\t\te.event.preventDefault();\n\t\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\t\tshowContextMenu(e.event.posx, e.event.posy + lineHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number {\n\t\tconst { top } = dom.getDomNodePagePosition(marginDomNode);\n\t\tconst offset = y - top;\n\t\tconst lineNumberOffset = Math.floor(offset / lineHeight);\n\t\tconst newTop = lineNumberOffset * lineHeight;\n\t\tthis._diffActions.style.top = `${newTop}px`;\n\t\tif (this.diff.viewLineCounts) {\n\t\t\tlet acc = 0;\n\t\t\tfor (let i = 0; i < this.diff.viewLineCounts.length; i++) {\n\t\t\t\tacc += this.diff.viewLineCounts[i];\n\t\t\t\tif (lineNumberOffset < acc) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lineNumberOffset;\n\t}\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 * as nls from 'vs/nls';\nimport * as platform from 'vs/base/common/platform';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { Constants } from 'vs/base/common/uint';\nimport { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport * as arrays from 'vs/base/common/arrays';\nimport * as objects from 'vs/base/common/objects';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';\n\n//#region typed options\n\n/**\n * Configuration options for auto closing quotes and brackets\n */\nexport type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';\n\n/**\n * Configuration options for auto wrapping quotes and brackets\n */\nexport type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never';\n\n/**\n * Configuration options for typing over closing quotes or brackets\n */\nexport type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never';\n\n/**\n * Configuration options for auto indentation in the editor\n */\nexport const enum EditorAutoIndentStrategy {\n\tNone = 0,\n\tKeep = 1,\n\tBrackets = 2,\n\tAdvanced = 3,\n\tFull = 4\n}\n\n/**\n * Configuration options for the editor.\n */\nexport interface IEditorOptions {\n\t/**\n\t * This editor is used inside a diff editor.\n\t */\n\tinDiffEditor?: boolean;\n\t/**\n\t * The aria label for the editor's textarea (when it is focused).\n\t */\n\tariaLabel?: string;\n\t/**\n\t * The `tabindex` property of the editor's textarea\n\t */\n\ttabIndex?: number;\n\t/**\n\t * Render vertical lines at the specified columns.\n\t * Defaults to empty array.\n\t */\n\trulers?: (number | IRulerOption)[];\n\t/**\n\t * A string containing the word separators used when doing word navigation.\n\t * Defaults to `~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?\n\t */\n\twordSeparators?: string;\n\t/**\n\t * Enable Linux primary clipboard.\n\t * Defaults to true.\n\t */\n\tselectionClipboard?: boolean;\n\t/**\n\t * Control the rendering of line numbers.\n\t * If it is a function, it will be invoked when rendering a line number and the return value will be rendered.\n\t * Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function).\n\t * Otherwise, line numbers will not be rendered.\n\t * Defaults to `on`.\n\t */\n\tlineNumbers?: LineNumbersType;\n\t/**\n\t * Controls the minimal number of visible leading and trailing lines surrounding the cursor.\n\t * Defaults to 0.\n\t*/\n\tcursorSurroundingLines?: number;\n\t/**\n\t * Controls when `cursorSurroundingLines` should be enforced\n\t * Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed\n\t * by mouse.\n\t*/\n\tcursorSurroundingLinesStyle?: 'default' | 'all';\n\t/**\n\t * Render last line number when the file ends with a newline.\n\t * Defaults to true.\n\t*/\n\trenderFinalNewline?: boolean;\n\t/**\n\t * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).\n\t * Defaults to 'prompt'.\n\t */\n\tunusualLineTerminators?: 'auto' | 'off' | 'prompt';\n\t/**\n\t * Should the corresponding line be selected when clicking on the line number?\n\t * Defaults to true.\n\t */\n\tselectOnLineNumbers?: boolean;\n\t/**\n\t * Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits.\n\t * Defaults to 5.\n\t */\n\tlineNumbersMinChars?: number;\n\t/**\n\t * Enable the rendering of the glyph margin.\n\t * Defaults to true in vscode and to false in monaco-editor.\n\t */\n\tglyphMargin?: boolean;\n\t/**\n\t * The width reserved for line decorations (in px).\n\t * Line decorations are placed between line numbers and the editor content.\n\t * You can pass in a string in the format floating point followed by \"ch\". e.g. 1.3ch.\n\t * Defaults to 10.\n\t */\n\tlineDecorationsWidth?: number | string;\n\t/**\n\t * When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle.\n\t * This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport.\n\t * Defaults to 30 (px).\n\t */\n\trevealHorizontalRightPadding?: number;\n\t/**\n\t * Render the editor selection with rounded borders.\n\t * Defaults to true.\n\t */\n\troundedSelection?: boolean;\n\t/**\n\t * Class name to be added to the editor.\n\t */\n\textraEditorClassName?: string;\n\t/**\n\t * Should the editor be read only. See also `domReadOnly`.\n\t * Defaults to false.\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * Should the textarea used for input use the DOM `readonly` attribute.\n\t * Defaults to false.\n\t */\n\tdomReadOnly?: boolean;\n\t/**\n\t * Enable linked editing.\n\t * Defaults to false.\n\t */\n\tlinkedEditing?: boolean;\n\t/**\n\t * deprecated, use linkedEditing instead\n\t */\n\trenameOnType?: boolean;\n\t/**\n\t * Should the editor render validation decorations.\n\t * Defaults to editable.\n\t */\n\trenderValidationDecorations?: 'editable' | 'on' | 'off';\n\t/**\n\t * Control the behavior and rendering of the scrollbars.\n\t */\n\tscrollbar?: IEditorScrollbarOptions;\n\t/**\n\t * Control the behavior and rendering of the minimap.\n\t */\n\tminimap?: IEditorMinimapOptions;\n\t/**\n\t * Control the behavior of the find widget.\n\t */\n\tfind?: IEditorFindOptions;\n\t/**\n\t * Display overflow widgets as `fixed`.\n\t * Defaults to `false`.\n\t */\n\tfixedOverflowWidgets?: boolean;\n\t/**\n\t * The number of vertical lanes the overview ruler should render.\n\t * Defaults to 3.\n\t */\n\toverviewRulerLanes?: number;\n\t/**\n\t * Controls if a border should be drawn around the overview ruler.\n\t * Defaults to `true`.\n\t */\n\toverviewRulerBorder?: boolean;\n\t/**\n\t * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'.\n\t * Defaults to 'blink'.\n\t */\n\tcursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';\n\t/**\n\t * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl.\n\t * Defaults to false.\n\t */\n\tmouseWheelZoom?: boolean;\n\t/**\n\t * Control the mouse pointer style, either 'text' or 'default' or 'copy'\n\t * Defaults to 'text'\n\t */\n\tmouseStyle?: 'text' | 'default' | 'copy';\n\t/**\n\t * Enable smooth caret animation.\n\t * Defaults to false.\n\t */\n\tcursorSmoothCaretAnimation?: boolean;\n\t/**\n\t * Control the cursor style, either 'block' or 'line'.\n\t * Defaults to 'line'.\n\t */\n\tcursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';\n\t/**\n\t * Control the width of the cursor when cursorStyle is set to 'line'\n\t */\n\tcursorWidth?: number;\n\t/**\n\t * Enable font ligatures.\n\t * Defaults to false.\n\t */\n\tfontLigatures?: boolean | string;\n\t/**\n\t * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.\n\t * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.\n\t * Defaults to false.\n\t */\n\tdisableLayerHinting?: boolean;\n\t/**\n\t * Disable the optimizations for monospace fonts.\n\t * Defaults to false.\n\t */\n\tdisableMonospaceOptimizations?: boolean;\n\t/**\n\t * Should the cursor be hidden in the overview ruler.\n\t * Defaults to false.\n\t */\n\thideCursorInOverviewRuler?: boolean;\n\t/**\n\t * Enable that scrolling can go one screen size after the last line.\n\t * Defaults to true.\n\t */\n\tscrollBeyondLastLine?: boolean;\n\t/**\n\t * Enable that scrolling can go beyond the last column by a number of columns.\n\t * Defaults to 5.\n\t */\n\tscrollBeyondLastColumn?: number;\n\t/**\n\t * Enable that the editor animates scrolling to a position.\n\t * Defaults to false.\n\t */\n\tsmoothScrolling?: boolean;\n\t/**\n\t * Enable that the editor will install an interval to check if its container dom node size has changed.\n\t * Enabling this might have a severe performance impact.\n\t * Defaults to false.\n\t */\n\tautomaticLayout?: boolean;\n\t/**\n\t * Control the wrapping of the editor.\n\t * When `wordWrap` = \"off\", the lines will never wrap.\n\t * When `wordWrap` = \"on\", the lines will wrap at the viewport width.\n\t * When `wordWrap` = \"wordWrapColumn\", the lines will wrap at `wordWrapColumn`.\n\t * When `wordWrap` = \"bounded\", the lines will wrap at min(viewport width, wordWrapColumn).\n\t * Defaults to \"off\".\n\t */\n\twordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';\n\t/**\n\t * Override the `wordWrap` setting.\n\t */\n\twordWrapOverride1?: 'off' | 'on' | 'inherit';\n\t/**\n\t * Override the `wordWrapOverride1` setting.\n\t */\n\twordWrapOverride2?: 'off' | 'on' | 'inherit';\n\t/**\n\t * Control the wrapping of the editor.\n\t * When `wordWrap` = \"off\", the lines will never wrap.\n\t * When `wordWrap` = \"on\", the lines will wrap at the viewport width.\n\t * When `wordWrap` = \"wordWrapColumn\", the lines will wrap at `wordWrapColumn`.\n\t * When `wordWrap` = \"bounded\", the lines will wrap at min(viewport width, wordWrapColumn).\n\t * Defaults to 80.\n\t */\n\twordWrapColumn?: number;\n\t/**\n\t * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'.\n\t * Defaults to 'same' in vscode and to 'none' in monaco-editor.\n\t */\n\twrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';\n\t/**\n\t * Controls the wrapping strategy to use.\n\t * Defaults to 'simple'.\n\t */\n\twrappingStrategy?: 'simple' | 'advanced';\n\t/**\n\t * Configure word wrapping characters. A break will be introduced before these characters.\n\t */\n\twordWrapBreakBeforeCharacters?: string;\n\t/**\n\t * Configure word wrapping characters. A break will be introduced after these characters.\n\t */\n\twordWrapBreakAfterCharacters?: string;\n\t/**\n\t * Performance guard: Stop rendering a line after x characters.\n\t * Defaults to 10000.\n\t * Use -1 to never stop rendering\n\t */\n\tstopRenderingLineAfter?: number;\n\t/**\n\t * Configure the editor's hover.\n\t */\n\thover?: IEditorHoverOptions;\n\t/**\n\t * Enable detecting links and making them clickable.\n\t * Defaults to true.\n\t */\n\tlinks?: boolean;\n\t/**\n\t * Enable inline color decorators and color picker rendering.\n\t */\n\tcolorDecorators?: boolean;\n\t/**\n\t * Control the behaviour of comments in the editor.\n\t */\n\tcomments?: IEditorCommentsOptions;\n\t/**\n\t * Enable custom contextmenu.\n\t * Defaults to true.\n\t */\n\tcontextmenu?: boolean;\n\t/**\n\t * A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.\n\t * Defaults to 1.\n\t */\n\tmouseWheelScrollSensitivity?: number;\n\t/**\n\t * FastScrolling mulitplier speed when pressing `Alt`\n\t * Defaults to 5.\n\t */\n\tfastScrollSensitivity?: number;\n\t/**\n\t * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.\n\t * Defaults to true.\n\t */\n\tscrollPredominantAxis?: boolean;\n\t/**\n\t * Enable that the selection with the mouse and keys is doing column selection.\n\t * Defaults to false.\n\t */\n\tcolumnSelection?: boolean;\n\t/**\n\t * The modifier to be used to add multiple cursors with the mouse.\n\t * Defaults to 'alt'\n\t */\n\tmultiCursorModifier?: 'ctrlCmd' | 'alt';\n\t/**\n\t * Merge overlapping selections.\n\t * Defaults to true\n\t */\n\tmultiCursorMergeOverlapping?: boolean;\n\t/**\n\t * Configure the behaviour when pasting a text with the line count equal to the cursor count.\n\t * Defaults to 'spread'.\n\t */\n\tmultiCursorPaste?: 'spread' | 'full';\n\t/**\n\t * Configure the editor's accessibility support.\n\t * Defaults to 'auto'. It is best to leave this to 'auto'.\n\t */\n\taccessibilitySupport?: 'auto' | 'off' | 'on';\n\t/**\n\t * Controls the number of lines in the editor that can be read out by a screen reader\n\t */\n\taccessibilityPageSize?: number;\n\t/**\n\t * Suggest options.\n\t */\n\tsuggest?: ISuggestOptions;\n\tinlineSuggest?: IInlineSuggestOptions;\n\t/**\n\t * Smart select options.\n\t */\n\tsmartSelect?: ISmartSelectOptions;\n\t/**\n\t *\n\t */\n\tgotoLocation?: IGotoLocationOptions;\n\t/**\n\t * Enable quick suggestions (shadow suggestions)\n\t * Defaults to true.\n\t */\n\tquickSuggestions?: boolean | IQuickSuggestionsOptions;\n\t/**\n\t * Quick suggestions show delay (in ms)\n\t * Defaults to 10 (ms)\n\t */\n\tquickSuggestionsDelay?: number;\n\t/**\n\t * Controls the spacing around the editor.\n\t */\n\tpadding?: IEditorPaddingOptions;\n\t/**\n\t * Parameter hint options.\n\t */\n\tparameterHints?: IEditorParameterHintOptions;\n\t/**\n\t * Options for auto closing brackets.\n\t * Defaults to language defined behavior.\n\t */\n\tautoClosingBrackets?: EditorAutoClosingStrategy;\n\t/**\n\t * Options for auto closing quotes.\n\t * Defaults to language defined behavior.\n\t */\n\tautoClosingQuotes?: EditorAutoClosingStrategy;\n\t/**\n\t * Options for pressing backspace near quotes or bracket pairs.\n\t */\n\tautoClosingDelete?: EditorAutoClosingEditStrategy;\n\t/**\n\t * Options for typing over closing quotes or brackets.\n\t */\n\tautoClosingOvertype?: EditorAutoClosingEditStrategy;\n\t/**\n\t * Options for auto surrounding.\n\t * Defaults to always allowing auto surrounding.\n\t */\n\tautoSurround?: EditorAutoSurroundStrategy;\n\t/**\n\t * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.\n\t * Defaults to advanced.\n\t */\n\tautoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';\n\t/**\n\t * Emulate selection behaviour of tab characters when using spaces for indentation.\n\t * This means selection will stick to tab stops.\n\t */\n\tstickyTabStops?: boolean;\n\t/**\n\t * Enable format on type.\n\t * Defaults to false.\n\t */\n\tformatOnType?: boolean;\n\t/**\n\t * Enable format on paste.\n\t * Defaults to false.\n\t */\n\tformatOnPaste?: boolean;\n\t/**\n\t * Controls if the editor should allow to move selections via drag and drop.\n\t * Defaults to false.\n\t */\n\tdragAndDrop?: boolean;\n\t/**\n\t * Enable the suggestion box to pop-up on trigger characters.\n\t * Defaults to true.\n\t */\n\tsuggestOnTriggerCharacters?: boolean;\n\t/**\n\t * Accept suggestions on ENTER.\n\t * Defaults to 'on'.\n\t */\n\tacceptSuggestionOnEnter?: 'on' | 'smart' | 'off';\n\t/**\n\t * Accept suggestions on provider defined characters.\n\t * Defaults to true.\n\t */\n\tacceptSuggestionOnCommitCharacter?: boolean;\n\t/**\n\t * Enable snippet suggestions. Default to 'true'.\n\t */\n\tsnippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';\n\t/**\n\t * Copying without a selection copies the current line.\n\t */\n\temptySelectionClipboard?: boolean;\n\t/**\n\t * Syntax highlighting is copied.\n\t */\n\tcopyWithSyntaxHighlighting?: boolean;\n\t/**\n\t * The history mode for suggestions.\n\t */\n\tsuggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';\n\t/**\n\t * The font size for the suggest widget.\n\t * Defaults to the editor font size.\n\t */\n\tsuggestFontSize?: number;\n\t/**\n\t * The line height for the suggest widget.\n\t * Defaults to the editor line height.\n\t */\n\tsuggestLineHeight?: number;\n\t/**\n\t * Enable tab completion.\n\t */\n\ttabCompletion?: 'on' | 'off' | 'onlySnippets';\n\t/**\n\t * Enable selection highlight.\n\t * Defaults to true.\n\t */\n\tselectionHighlight?: boolean;\n\t/**\n\t * Enable semantic occurrences highlight.\n\t * Defaults to true.\n\t */\n\toccurrencesHighlight?: boolean;\n\t/**\n\t * Show code lens\n\t * Defaults to true.\n\t */\n\tcodeLens?: boolean;\n\t/**\n\t * Code lens font family. Defaults to editor font family.\n\t */\n\tcodeLensFontFamily?: string;\n\t/**\n\t * Code lens font size. Default to 90% of the editor font size\n\t */\n\tcodeLensFontSize?: number;\n\t/**\n\t * Control the behavior and rendering of the code action lightbulb.\n\t */\n\tlightbulb?: IEditorLightbulbOptions;\n\t/**\n\t * Timeout for running code actions on save.\n\t */\n\tcodeActionsOnSaveTimeout?: number;\n\t/**\n\t * Enable code folding.\n\t * Defaults to true.\n\t */\n\tfolding?: boolean;\n\t/**\n\t * Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy.\n\t * Defaults to 'auto'.\n\t */\n\tfoldingStrategy?: 'auto' | 'indentation';\n\t/**\n\t * Enable highlight for folded regions.\n\t * Defaults to true.\n\t */\n\tfoldingHighlight?: boolean;\n\t/**\n\t * Auto fold imports folding regions.\n\t * Defaults to true.\n\t */\n\tfoldingImportsByDefault?: boolean;\n\t/**\n\t * Maximum number of foldable regions.\n\t * Defaults to 5000.\n\t */\n\tfoldingMaximumRegions?: number;\n\t/**\n\t * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.\n\t * Defaults to 'mouseover'.\n\t */\n\tshowFoldingControls?: 'always' | 'mouseover';\n\t/**\n\t * Controls whether clicking on the empty content after a folded line will unfold the line.\n\t * Defaults to false.\n\t */\n\tunfoldOnClickAfterEndOfLine?: boolean;\n\t/**\n\t * Enable highlighting of matching brackets.\n\t * Defaults to 'always'.\n\t */\n\tmatchBrackets?: 'never' | 'near' | 'always';\n\t/**\n\t * Enable rendering of whitespace.\n\t * Defaults to 'selection'.\n\t */\n\trenderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';\n\t/**\n\t * Enable rendering of control characters.\n\t * Defaults to true.\n\t */\n\trenderControlCharacters?: boolean;\n\t/**\n\t * Enable rendering of current line highlight.\n\t * Defaults to all.\n\t */\n\trenderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';\n\t/**\n\t * Control if the current line highlight should be rendered only the editor is focused.\n\t * Defaults to false.\n\t */\n\trenderLineHighlightOnlyWhenFocus?: boolean;\n\t/**\n\t * Inserting and deleting whitespace follows tab stops.\n\t */\n\tuseTabStops?: boolean;\n\t/**\n\t * The font family\n\t */\n\tfontFamily?: string;\n\t/**\n\t * The font weight\n\t */\n\tfontWeight?: string;\n\t/**\n\t * The font size\n\t */\n\tfontSize?: number;\n\t/**\n\t * The line height\n\t */\n\tlineHeight?: number;\n\t/**\n\t * The letter spacing\n\t */\n\tletterSpacing?: number;\n\t/**\n\t * Controls fading out of unused variables.\n\t */\n\tshowUnused?: boolean;\n\t/**\n\t * Controls whether to focus the inline editor in the peek widget by default.\n\t * Defaults to false.\n\t */\n\tpeekWidgetDefaultFocus?: 'tree' | 'editor';\n\t/**\n\t * Controls whether the definition link opens element in the peek widget.\n\t * Defaults to false.\n\t */\n\tdefinitionLinkOpensInPeek?: boolean;\n\t/**\n\t * Controls strikethrough deprecated variables.\n\t */\n\tshowDeprecated?: boolean;\n\t/**\n\t * Control the behavior and rendering of the inline hints.\n\t */\n\tinlayHints?: IEditorInlayHintsOptions;\n\t/**\n\t * Control if the editor should use shadow DOM.\n\t */\n\tuseShadowDOM?: boolean;\n\t/**\n\t * Controls the behavior of editor guides.\n\t*/\n\tguides?: IGuidesOptions;\n\n\t/**\n\t * Controls the behavior of the unicode highlight feature\n\t * (by default, ambiguous and invisible characters are highlighted).\n\t */\n\tunicodeHighlight?: IUnicodeHighlightOptions;\n\n\t/**\n\t * Configures bracket pair colorization (disabled by default).\n\t*/\n\tbracketPairColorization?: IBracketPairColorizationOptions;\n}\n\n/**\n * @internal\n * The width of the minimap gutter, in pixels.\n */\nexport const MINIMAP_GUTTER_WIDTH = 8;\n\nexport interface IDiffEditorBaseOptions {\n\t/**\n\t * Allow the user to resize the diff editor split view.\n\t * Defaults to true.\n\t */\n\tenableSplitViewResizing?: boolean;\n\t/**\n\t * Render the differences in two side-by-side editors.\n\t * Defaults to true.\n\t */\n\trenderSideBySide?: boolean;\n\t/**\n\t * Timeout in milliseconds after which diff computation is cancelled.\n\t * Defaults to 5000.\n\t */\n\tmaxComputationTime?: number;\n\t/**\n\t * Maximum supported file size in MB.\n\t * Defaults to 50.\n\t */\n\tmaxFileSize?: number;\n\t/**\n\t * Compute the diff by ignoring leading/trailing whitespace\n\t * Defaults to true.\n\t */\n\tignoreTrimWhitespace?: boolean;\n\t/**\n\t * Render +/- indicators for added/deleted changes.\n\t * Defaults to true.\n\t */\n\trenderIndicators?: boolean;\n\t/**\n\t * Original model should be editable?\n\t * Defaults to false.\n\t */\n\toriginalEditable?: boolean;\n\t/**\n\t * Should the diff editor enable code lens?\n\t * Defaults to false.\n\t */\n\tdiffCodeLens?: boolean;\n\t/**\n\t * Is the diff editor should render overview ruler\n\t * Defaults to true\n\t */\n\trenderOverviewRuler?: boolean;\n\t/**\n\t * Control the wrapping of the diff editor.\n\t */\n\tdiffWordWrap?: 'off' | 'on' | 'inherit';\n}\n\n/**\n * Configuration options for the diff editor.\n */\nexport interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions {\n}\n\n/**\n * @internal\n */\nexport type ValidDiffEditorBaseOptions = Readonly<Required<IDiffEditorBaseOptions>>;\n\n//#endregion\n\n/**\n * An event describing that the configuration of the editor has changed.\n */\nexport class ConfigurationChangedEvent {\n\tprivate readonly _values: boolean[];\n\t/**\n\t * @internal\n\t */\n\tconstructor(values: boolean[]) {\n\t\tthis._values = values;\n\t}\n\tpublic hasChanged(id: EditorOption): boolean {\n\t\treturn this._values[id];\n\t}\n}\n\n/**\n * All computed editor options.\n */\nexport interface IComputedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\n//#region IEditorOption\n\n/**\n * @internal\n */\nexport interface IEnvironmentalOptions {\n\treadonly memory: ComputeOptionsMemory | null;\n\treadonly outerWidth: number;\n\treadonly outerHeight: number;\n\treadonly fontInfo: FontInfo;\n\treadonly extraEditorClassName: string;\n\treadonly isDominatedByLongLines: boolean;\n\treadonly viewLineCount: number;\n\treadonly lineNumbersDigitCount: number;\n\treadonly emptySelectionClipboard: boolean;\n\treadonly pixelRatio: number;\n\treadonly tabFocusMode: boolean;\n\treadonly accessibilitySupport: AccessibilitySupport;\n}\n\n/**\n * @internal\n */\nexport class ComputeOptionsMemory {\n\n\tpublic stableMinimapLayoutInput: IMinimapLayoutInput | null;\n\tpublic stableFitMaxMinimapScale: number;\n\tpublic stableFitRemainingWidth: number;\n\n\tconstructor() {\n\t\tthis.stableMinimapLayoutInput = null;\n\t\tthis.stableFitMaxMinimapScale = 0;\n\t\tthis.stableFitRemainingWidth = 0;\n\t}\n}\n\nexport interface IEditorOption<K extends EditorOption, V> {\n\treadonly id: K;\n\treadonly name: string;\n\tdefaultValue: V;\n\t/**\n\t * @internal\n\t */\n\treadonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;\n\t/**\n\t * @internal\n\t */\n\tvalidate(input: any): V;\n\t/**\n\t * @internal\n\t */\n\tcompute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;\n\n\t/**\n\t * Might modify `value`.\n\t*/\n\tapplyUpdate(value: V, update: V): ApplyUpdateResult<V>;\n}\n\n/**\n * @internal\n */\ntype PossibleKeyName0<V> = { [K in keyof IEditorOptions]: IEditorOptions[K] extends V | undefined ? K : never }[keyof IEditorOptions];\n/**\n * @internal\n */\ntype PossibleKeyName<V> = NonNullable<PossibleKeyName0<V>>;\n\n/**\n * @internal\n */\nabstract class BaseEditorOption<K extends EditorOption, T, V> implements IEditorOption<K, V> {\n\n\tpublic readonly id: K;\n\tpublic readonly name: string;\n\tpublic readonly defaultValue: V;\n\tpublic readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;\n\n\tconstructor(id: K, name: PossibleKeyName<T>, defaultValue: V, schema?: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema }) {\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t\tthis.defaultValue = defaultValue;\n\t\tthis.schema = schema;\n\t}\n\n\tpublic applyUpdate(value: V, update: V): ApplyUpdateResult<V> {\n\t\treturn applyUpdate(value, update);\n\t}\n\n\tpublic abstract validate(input: any): V;\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {\n\t\treturn value;\n\t}\n}\n\nexport class ApplyUpdateResult<T> {\n\tconstructor(\n\t\tpublic readonly newValue: T,\n\t\tpublic readonly didChange: boolean\n\t) { }\n}\n\nfunction applyUpdate<T>(value: T, update: T): ApplyUpdateResult<T> {\n\tif (typeof value !== 'object' || typeof update !== 'object' || !value || !update) {\n\t\treturn new ApplyUpdateResult(update, value !== update);\n\t}\n\tif (Array.isArray(value) || Array.isArray(update)) {\n\t\tconst arrayEquals = Array.isArray(value) && Array.isArray(update) && arrays.equals(value, update);\n\t\treturn new ApplyUpdateResult(update, arrayEquals);\n\t}\n\tlet didChange = false;\n\tfor (const key in update) {\n\t\tif ((update as T & object).hasOwnProperty(key)) {\n\t\t\tconst result = applyUpdate(value[key], update[key]);\n\t\t\tif (result.didChange) {\n\t\t\t\tvalue[key] = result.newValue;\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t}\n\treturn new ApplyUpdateResult(value, didChange);\n}\n\n/**\n * @internal\n */\nabstract class ComputedEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {\n\n\tpublic readonly id: K;\n\tpublic readonly name: '_never_';\n\tpublic readonly defaultValue: V;\n\tpublic readonly schema: IConfigurationPropertySchema | undefined = undefined;\n\n\tconstructor(id: K) {\n\t\tthis.id = id;\n\t\tthis.name = '_never_';\n\t\tthis.defaultValue = <any>undefined;\n\t}\n\n\tpublic applyUpdate(value: V, update: V): ApplyUpdateResult<V> {\n\t\treturn applyUpdate(value, update);\n\t}\n\n\tpublic validate(input: any): V {\n\t\treturn this.defaultValue;\n\t}\n\n\tpublic abstract compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;\n}\n\nclass SimpleEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {\n\n\tpublic readonly id: K;\n\tpublic readonly name: PossibleKeyName<V>;\n\tpublic readonly defaultValue: V;\n\tpublic readonly schema: IConfigurationPropertySchema | undefined;\n\n\tconstructor(id: K, name: PossibleKeyName<V>, defaultValue: V, schema?: IConfigurationPropertySchema) {\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t\tthis.defaultValue = defaultValue;\n\t\tthis.schema = schema;\n\t}\n\n\tpublic applyUpdate(value: V, update: V): ApplyUpdateResult<V> {\n\t\treturn applyUpdate(value, update);\n\t}\n\n\tpublic validate(input: any): V {\n\t\tif (typeof input === 'undefined') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\treturn input as any;\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {\n\t\treturn value;\n\t}\n}\n\n/**\n * @internal\n */\nexport function boolean(value: any, defaultValue: boolean): boolean {\n\tif (typeof value === 'undefined') {\n\t\treturn defaultValue;\n\t}\n\tif (value === 'false') {\n\t\t// treat the string 'false' as false\n\t\treturn false;\n\t}\n\treturn Boolean(value);\n}\n\nclass EditorBooleanOption<K extends EditorOption> extends SimpleEditorOption<K, boolean> {\n\n\tconstructor(id: K, name: PossibleKeyName<boolean>, defaultValue: boolean, schema: IConfigurationPropertySchema | undefined = undefined) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'boolean';\n\t\t\tschema.default = defaultValue;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t}\n\n\tpublic override validate(input: any): boolean {\n\t\treturn boolean(input, this.defaultValue);\n\t}\n}\n\n/**\n * @internal\n */\nexport function clampedInt<T>(value: any, defaultValue: T, minimum: number, maximum: number): number | T {\n\tif (typeof value === 'undefined') {\n\t\treturn defaultValue;\n\t}\n\tlet r = parseInt(value, 10);\n\tif (isNaN(r)) {\n\t\treturn defaultValue;\n\t}\n\tr = Math.max(minimum, r);\n\tr = Math.min(maximum, r);\n\treturn r | 0;\n}\n\nclass EditorIntOption<K extends EditorOption> extends SimpleEditorOption<K, number> {\n\n\tpublic static clampedInt<T>(value: any, defaultValue: T, minimum: number, maximum: number): number | T {\n\t\treturn clampedInt(value, defaultValue, minimum, maximum);\n\t}\n\n\tpublic readonly minimum: number;\n\tpublic readonly maximum: number;\n\n\tconstructor(id: K, name: PossibleKeyName<number>, defaultValue: number, minimum: number, maximum: number, schema: IConfigurationPropertySchema | undefined = undefined) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'integer';\n\t\t\tschema.default = defaultValue;\n\t\t\tschema.minimum = minimum;\n\t\t\tschema.maximum = maximum;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t\tthis.minimum = minimum;\n\t\tthis.maximum = maximum;\n\t}\n\n\tpublic override validate(input: any): number {\n\t\treturn EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum);\n\t}\n}\n\nclass EditorFloatOption<K extends EditorOption> extends SimpleEditorOption<K, number> {\n\n\tpublic static clamp(n: number, min: number, max: number): number {\n\t\tif (n < min) {\n\t\t\treturn min;\n\t\t}\n\t\tif (n > max) {\n\t\t\treturn max;\n\t\t}\n\t\treturn n;\n\t}\n\n\tpublic static float(value: any, defaultValue: number): number {\n\t\tif (typeof value === 'number') {\n\t\t\treturn value;\n\t\t}\n\t\tif (typeof value === 'undefined') {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tconst r = parseFloat(value);\n\t\treturn (isNaN(r) ? defaultValue : r);\n\t}\n\n\tpublic readonly validationFn: (value: number) => number;\n\n\tconstructor(id: K, name: PossibleKeyName<number>, defaultValue: number, validationFn: (value: number) => number, schema?: IConfigurationPropertySchema) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'number';\n\t\t\tschema.default = defaultValue;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t\tthis.validationFn = validationFn;\n\t}\n\n\tpublic override validate(input: any): number {\n\t\treturn this.validationFn(EditorFloatOption.float(input, this.defaultValue));\n\t}\n}\n\nclass EditorStringOption<K extends EditorOption> extends SimpleEditorOption<K, string> {\n\n\tpublic static string(value: any, defaultValue: string): string {\n\t\tif (typeof value !== 'string') {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}\n\n\tconstructor(id: K, name: PossibleKeyName<string>, defaultValue: string, schema: IConfigurationPropertySchema | undefined = undefined) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'string';\n\t\t\tschema.default = defaultValue;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t}\n\n\tpublic override validate(input: any): string {\n\t\treturn EditorStringOption.string(input, this.defaultValue);\n\t}\n}\n\n/**\n * @internal\n */\nexport function stringSet<T>(value: T | undefined, defaultValue: T, allowedValues: ReadonlyArray<T>): T {\n\tif (typeof value !== 'string') {\n\t\treturn defaultValue;\n\t}\n\tif (allowedValues.indexOf(value) === -1) {\n\t\treturn defaultValue;\n\t}\n\treturn value;\n}\n\nclass EditorStringEnumOption<K extends EditorOption, V extends string> extends SimpleEditorOption<K, V> {\n\n\tprivate readonly _allowedValues: ReadonlyArray<V>;\n\n\tconstructor(id: K, name: PossibleKeyName<V>, defaultValue: V, allowedValues: ReadonlyArray<V>, schema: IConfigurationPropertySchema | undefined = undefined) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'string';\n\t\t\tschema.enum = <any>allowedValues;\n\t\t\tschema.default = defaultValue;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t\tthis._allowedValues = allowedValues;\n\t}\n\n\tpublic override validate(input: any): V {\n\t\treturn stringSet<V>(input, this.defaultValue, this._allowedValues);\n\t}\n}\n\nclass EditorEnumOption<K extends EditorOption, T extends string, V> extends BaseEditorOption<K, T, V> {\n\n\tprivate readonly _allowedValues: T[];\n\tprivate readonly _convert: (value: T) => V;\n\n\tconstructor(id: K, name: PossibleKeyName<T>, defaultValue: V, defaultStringValue: string, allowedValues: T[], convert: (value: T) => V, schema: IConfigurationPropertySchema | undefined = undefined) {\n\t\tif (typeof schema !== 'undefined') {\n\t\t\tschema.type = 'string';\n\t\t\tschema.enum = allowedValues;\n\t\t\tschema.default = defaultStringValue;\n\t\t}\n\t\tsuper(id, name, defaultValue, schema);\n\t\tthis._allowedValues = allowedValues;\n\t\tthis._convert = convert;\n\t}\n\n\tpublic validate(input: any): V {\n\t\tif (typeof input !== 'string') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tif (this._allowedValues.indexOf(<T>input) === -1) {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\treturn this._convert(<any>input);\n\t}\n}\n\n//#endregion\n\n//#region autoIndent\n\nfunction _autoIndentFromString(autoIndent: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'): EditorAutoIndentStrategy {\n\tswitch (autoIndent) {\n\t\tcase 'none': return EditorAutoIndentStrategy.None;\n\t\tcase 'keep': return EditorAutoIndentStrategy.Keep;\n\t\tcase 'brackets': return EditorAutoIndentStrategy.Brackets;\n\t\tcase 'advanced': return EditorAutoIndentStrategy.Advanced;\n\t\tcase 'full': return EditorAutoIndentStrategy.Full;\n\t}\n}\n\n//#endregion\n\n//#region accessibilitySupport\n\nclass EditorAccessibilitySupport extends BaseEditorOption<EditorOption.accessibilitySupport, 'auto' | 'off' | 'on', AccessibilitySupport> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.accessibilitySupport, 'accessibilitySupport', AccessibilitySupport.Unknown,\n\t\t\t{\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['auto', 'on', 'off'],\n\t\t\t\tenumDescriptions: [\n\t\t\t\t\tnls.localize('accessibilitySupport.auto', \"The editor will use platform APIs to detect when a Screen Reader is attached.\"),\n\t\t\t\t\tnls.localize('accessibilitySupport.on', \"The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled.\"),\n\t\t\t\t\tnls.localize('accessibilitySupport.off', \"The editor will never be optimized for usage with a Screen Reader.\"),\n\t\t\t\t],\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: nls.localize('accessibilitySupport', \"Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.\")\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(input: any): AccessibilitySupport {\n\t\tswitch (input) {\n\t\t\tcase 'auto': return AccessibilitySupport.Unknown;\n\t\t\tcase 'off': return AccessibilitySupport.Disabled;\n\t\t\tcase 'on': return AccessibilitySupport.Enabled;\n\t\t}\n\t\treturn this.defaultValue;\n\t}\n\n\tpublic override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: AccessibilitySupport): AccessibilitySupport {\n\t\tif (value === AccessibilitySupport.Unknown) {\n\t\t\t// The editor reads the `accessibilitySupport` from the environment\n\t\t\treturn env.accessibilitySupport;\n\t\t}\n\t\treturn value;\n\t}\n}\n\n//#endregion\n\n//#region comments\n\n/**\n * Configuration options for editor comments\n */\nexport interface IEditorCommentsOptions {\n\t/**\n\t * Insert a space after the line comment token and inside the block comments tokens.\n\t * Defaults to true.\n\t */\n\tinsertSpace?: boolean;\n\t/**\n\t * Ignore empty lines when inserting line comments.\n\t * Defaults to true.\n\t */\n\tignoreEmptyLines?: boolean;\n}\n\n/**\n * @internal\n */\nexport type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;\n\nclass EditorComments extends BaseEditorOption<EditorOption.comments, IEditorCommentsOptions, EditorCommentsOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorCommentsOptions = {\n\t\t\tinsertSpace: true,\n\t\t\tignoreEmptyLines: true,\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.comments, 'comments', defaults,\n\t\t\t{\n\t\t\t\t'editor.comments.insertSpace': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.insertSpace,\n\t\t\t\t\tdescription: nls.localize('comments.insertSpace', \"Controls whether a space character is inserted when commenting.\")\n\t\t\t\t},\n\t\t\t\t'editor.comments.ignoreEmptyLines': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.ignoreEmptyLines,\n\t\t\t\t\tdescription: nls.localize('comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.')\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorCommentsOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorCommentsOptions;\n\t\treturn {\n\t\t\tinsertSpace: boolean(input.insertSpace, this.defaultValue.insertSpace),\n\t\t\tignoreEmptyLines: boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region cursorBlinking\n\n/**\n * The kind of animation in which the editor's cursor should be rendered.\n */\nexport const enum TextEditorCursorBlinkingStyle {\n\t/**\n\t * Hidden\n\t */\n\tHidden = 0,\n\t/**\n\t * Blinking\n\t */\n\tBlink = 1,\n\t/**\n\t * Blinking with smooth fading\n\t */\n\tSmooth = 2,\n\t/**\n\t * Blinking with prolonged filled state and smooth fading\n\t */\n\tPhase = 3,\n\t/**\n\t * Expand collapse animation on the y axis\n\t */\n\tExpand = 4,\n\t/**\n\t * No-Blinking\n\t */\n\tSolid = 5\n}\n\nfunction _cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'): TextEditorCursorBlinkingStyle {\n\tswitch (cursorBlinkingStyle) {\n\t\tcase 'blink': return TextEditorCursorBlinkingStyle.Blink;\n\t\tcase 'smooth': return TextEditorCursorBlinkingStyle.Smooth;\n\t\tcase 'phase': return TextEditorCursorBlinkingStyle.Phase;\n\t\tcase 'expand': return TextEditorCursorBlinkingStyle.Expand;\n\t\tcase 'solid': return TextEditorCursorBlinkingStyle.Solid;\n\t}\n}\n\n//#endregion\n\n//#region cursorStyle\n\n/**\n * The style in which the editor's cursor should be rendered.\n */\nexport enum TextEditorCursorStyle {\n\t/**\n\t * As a vertical line (sitting between two characters).\n\t */\n\tLine = 1,\n\t/**\n\t * As a block (sitting on top of a character).\n\t */\n\tBlock = 2,\n\t/**\n\t * As a horizontal line (sitting under a character).\n\t */\n\tUnderline = 3,\n\t/**\n\t * As a thin vertical line (sitting between two characters).\n\t */\n\tLineThin = 4,\n\t/**\n\t * As an outlined block (sitting on top of a character).\n\t */\n\tBlockOutline = 5,\n\t/**\n\t * As a thin horizontal line (sitting under a character).\n\t */\n\tUnderlineThin = 6\n}\n\nfunction _cursorStyleFromString(cursorStyle: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'): TextEditorCursorStyle {\n\tswitch (cursorStyle) {\n\t\tcase 'line': return TextEditorCursorStyle.Line;\n\t\tcase 'block': return TextEditorCursorStyle.Block;\n\t\tcase 'underline': return TextEditorCursorStyle.Underline;\n\t\tcase 'line-thin': return TextEditorCursorStyle.LineThin;\n\t\tcase 'block-outline': return TextEditorCursorStyle.BlockOutline;\n\t\tcase 'underline-thin': return TextEditorCursorStyle.UnderlineThin;\n\t}\n}\n\n//#endregion\n\n//#region editorClassName\n\nclass EditorClassName extends ComputedEditorOption<EditorOption.editorClassName, string> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.editorClassName);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: string): string {\n\t\tconst classNames = ['monaco-editor'];\n\t\tif (options.get(EditorOption.extraEditorClassName)) {\n\t\t\tclassNames.push(options.get(EditorOption.extraEditorClassName));\n\t\t}\n\t\tif (env.extraEditorClassName) {\n\t\t\tclassNames.push(env.extraEditorClassName);\n\t\t}\n\t\tif (options.get(EditorOption.mouseStyle) === 'default') {\n\t\t\tclassNames.push('mouse-default');\n\t\t} else if (options.get(EditorOption.mouseStyle) === 'copy') {\n\t\t\tclassNames.push('mouse-copy');\n\t\t}\n\n\t\tif (options.get(EditorOption.showUnused)) {\n\t\t\tclassNames.push('showUnused');\n\t\t}\n\n\t\tif (options.get(EditorOption.showDeprecated)) {\n\t\t\tclassNames.push('showDeprecated');\n\t\t}\n\n\t\treturn classNames.join(' ');\n\t}\n}\n\n//#endregion\n\n//#region emptySelectionClipboard\n\nclass EditorEmptySelectionClipboard extends EditorBooleanOption<EditorOption.emptySelectionClipboard> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.emptySelectionClipboard, 'emptySelectionClipboard', true,\n\t\t\t{ description: nls.localize('emptySelectionClipboard', \"Controls whether copying without a selection copies the current line.\") }\n\t\t);\n\t}\n\n\tpublic override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: boolean): boolean {\n\t\treturn value && env.emptySelectionClipboard;\n\t}\n}\n\n//#endregion\n\n//#region find\n\n/**\n * Configuration options for editor find widget\n */\nexport interface IEditorFindOptions {\n\t/**\n\t* Controls whether the cursor should move to find matches while typing.\n\t*/\n\tcursorMoveOnType?: boolean;\n\t/**\n\t * Controls if we seed search string in the Find Widget with editor selection.\n\t */\n\tseedSearchStringFromSelection?: 'never' | 'always' | 'selection';\n\t/**\n\t * Controls if Find in Selection flag is turned on in the editor.\n\t */\n\tautoFindInSelection?: 'never' | 'always' | 'multiline';\n\t/*\n\t * Controls whether the Find Widget should add extra lines on top of the editor.\n\t */\n\taddExtraSpaceOnTop?: boolean;\n\t/**\n\t * @internal\n\t * Controls if the Find Widget should read or modify the shared find clipboard on macOS\n\t */\n\tglobalFindClipboard?: boolean;\n\t/**\n\t * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found\n\t */\n\tloop?: boolean;\n}\n\n/**\n * @internal\n */\nexport type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;\n\nclass EditorFind extends BaseEditorOption<EditorOption.find, IEditorFindOptions, EditorFindOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorFindOptions = {\n\t\t\tcursorMoveOnType: true,\n\t\t\tseedSearchStringFromSelection: 'always',\n\t\t\tautoFindInSelection: 'never',\n\t\t\tglobalFindClipboard: false,\n\t\t\taddExtraSpaceOnTop: true,\n\t\t\tloop: true\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.find, 'find', defaults,\n\t\t\t{\n\t\t\t\t'editor.find.cursorMoveOnType': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.cursorMoveOnType,\n\t\t\t\t\tdescription: nls.localize('find.cursorMoveOnType', \"Controls whether the cursor should jump to find matches while typing.\")\n\t\t\t\t},\n\t\t\t\t'editor.find.seedSearchStringFromSelection': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['never', 'always', 'selection'],\n\t\t\t\t\tdefault: defaults.seedSearchStringFromSelection,\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('editor.find.seedSearchStringFromSelection.never', 'Never seed search string from the editor selection.'),\n\t\t\t\t\t\tnls.localize('editor.find.seedSearchStringFromSelection.always', 'Always seed search string from the editor selection, including word at cursor position.'),\n\t\t\t\t\t\tnls.localize('editor.find.seedSearchStringFromSelection.selection', 'Only seed search string from the editor selection.')\n\t\t\t\t\t],\n\t\t\t\t\tdescription: nls.localize('find.seedSearchStringFromSelection', \"Controls whether the search string in the Find Widget is seeded from the editor selection.\")\n\t\t\t\t},\n\t\t\t\t'editor.find.autoFindInSelection': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['never', 'always', 'multiline'],\n\t\t\t\t\tdefault: defaults.autoFindInSelection,\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in Selection automatically (default).'),\n\t\t\t\t\t\tnls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in Selection automatically.'),\n\t\t\t\t\t\tnls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in Selection automatically when multiple lines of content are selected.')\n\t\t\t\t\t],\n\t\t\t\t\tdescription: nls.localize('find.autoFindInSelection', \"Controls the condition for turning on Find in Selection automatically.\")\n\t\t\t\t},\n\t\t\t\t'editor.find.globalFindClipboard': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.globalFindClipboard,\n\t\t\t\t\tdescription: nls.localize('find.globalFindClipboard', \"Controls whether the Find Widget should read or modify the shared find clipboard on macOS.\"),\n\t\t\t\t\tincluded: platform.isMacintosh\n\t\t\t\t},\n\t\t\t\t'editor.find.addExtraSpaceOnTop': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.addExtraSpaceOnTop,\n\t\t\t\t\tdescription: nls.localize('find.addExtraSpaceOnTop', \"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.\")\n\t\t\t\t},\n\t\t\t\t'editor.find.loop': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.loop,\n\t\t\t\t\tdescription: nls.localize('find.loop', \"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.\")\n\t\t\t\t},\n\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorFindOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorFindOptions;\n\t\treturn {\n\t\t\tcursorMoveOnType: boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType),\n\t\t\tseedSearchStringFromSelection: typeof _input.seedSearchStringFromSelection === 'boolean'\n\t\t\t\t? (_input.seedSearchStringFromSelection ? 'always' : 'never')\n\t\t\t\t: stringSet<'never' | 'always' | 'selection'>(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ['never', 'always', 'selection']),\n\t\t\tautoFindInSelection: typeof _input.autoFindInSelection === 'boolean'\n\t\t\t\t? (_input.autoFindInSelection ? 'always' : 'never')\n\t\t\t\t: stringSet<'never' | 'always' | 'multiline'>(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ['never', 'always', 'multiline']),\n\t\t\tglobalFindClipboard: boolean(input.globalFindClipboard, this.defaultValue.globalFindClipboard),\n\t\t\taddExtraSpaceOnTop: boolean(input.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop),\n\t\t\tloop: boolean(input.loop, this.defaultValue.loop),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region fontLigatures\n\n/**\n * @internal\n */\nexport class EditorFontLigatures extends BaseEditorOption<EditorOption.fontLigatures, boolean | string, string> {\n\n\tpublic static OFF = '\"liga\" off, \"calt\" off';\n\tpublic static ON = '\"liga\" on, \"calt\" on';\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.fontLigatures, 'fontLigatures', EditorFontLigatures.OFF,\n\t\t\t{\n\t\t\t\tanyOf: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdescription: nls.localize('fontLigatures', \"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: nls.localize('fontFeatureSettings', \"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.\")\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tdescription: nls.localize('fontLigaturesGeneral', \"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.\"),\n\t\t\t\tdefault: false\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(input: any): string {\n\t\tif (typeof input === 'undefined') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tif (typeof input === 'string') {\n\t\t\tif (input === 'false') {\n\t\t\t\treturn EditorFontLigatures.OFF;\n\t\t\t}\n\t\t\tif (input === 'true') {\n\t\t\t\treturn EditorFontLigatures.ON;\n\t\t\t}\n\t\t\treturn input;\n\t\t}\n\t\tif (Boolean(input)) {\n\t\t\treturn EditorFontLigatures.ON;\n\t\t}\n\t\treturn EditorFontLigatures.OFF;\n\t}\n}\n\n//#endregion\n\n//#region fontInfo\n\nclass EditorFontInfo extends ComputedEditorOption<EditorOption.fontInfo, FontInfo> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.fontInfo);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: FontInfo): FontInfo {\n\t\treturn env.fontInfo;\n\t}\n}\n\n//#endregion\n\n//#region fontSize\n\nclass EditorFontSize extends SimpleEditorOption<EditorOption.fontSize, number> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.fontSize, 'fontSize', EDITOR_FONT_DEFAULTS.fontSize,\n\t\t\t{\n\t\t\t\ttype: 'number',\n\t\t\t\tminimum: 6,\n\t\t\t\tmaximum: 100,\n\t\t\t\tdefault: EDITOR_FONT_DEFAULTS.fontSize,\n\t\t\t\tdescription: nls.localize('fontSize', \"Controls the font size in pixels.\")\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic override validate(input: any): number {\n\t\tconst r = EditorFloatOption.float(input, this.defaultValue);\n\t\tif (r === 0) {\n\t\t\treturn EDITOR_FONT_DEFAULTS.fontSize;\n\t\t}\n\t\treturn EditorFloatOption.clamp(r, 6, 100);\n\t}\n\tpublic override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {\n\t\t// The final fontSize respects the editor zoom level.\n\t\t// So take the result from env.fontInfo\n\t\treturn env.fontInfo.fontSize;\n\t}\n}\n\n//#endregion\n\n//#region fontWeight\n\nclass EditorFontWeight extends BaseEditorOption<EditorOption.fontWeight, string, string> {\n\tprivate static SUGGESTION_VALUES = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\n\tprivate static MINIMUM_VALUE = 1;\n\tprivate static MAXIMUM_VALUE = 1000;\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.fontWeight, 'fontWeight', EDITOR_FONT_DEFAULTS.fontWeight,\n\t\t\t{\n\t\t\t\tanyOf: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tminimum: EditorFontWeight.MINIMUM_VALUE,\n\t\t\t\t\t\tmaximum: EditorFontWeight.MAXIMUM_VALUE,\n\t\t\t\t\t\terrorMessage: nls.localize('fontWeightErrorMessage', \"Only \\\"normal\\\" and \\\"bold\\\" keywords or numbers between 1 and 1000 are allowed.\")\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tpattern: '^(normal|bold|1000|[1-9][0-9]{0,2})$'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tenum: EditorFontWeight.SUGGESTION_VALUES\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tdefault: EDITOR_FONT_DEFAULTS.fontWeight,\n\t\t\t\tdescription: nls.localize('fontWeight', \"Controls the font weight. Accepts \\\"normal\\\" and \\\"bold\\\" keywords or numbers between 1 and 1000.\")\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(input: any): string {\n\t\tif (input === 'normal' || input === 'bold') {\n\t\t\treturn input;\n\t\t}\n\t\treturn String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, EditorFontWeight.MINIMUM_VALUE, EditorFontWeight.MAXIMUM_VALUE));\n\t}\n}\n\n//#endregion\n\n//#region gotoLocation\n\nexport type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';\n\n/**\n * Configuration options for go to location\n */\nexport interface IGotoLocationOptions {\n\n\tmultiple?: GoToLocationValues;\n\n\tmultipleDefinitions?: GoToLocationValues;\n\tmultipleTypeDefinitions?: GoToLocationValues;\n\tmultipleDeclarations?: GoToLocationValues;\n\tmultipleImplementations?: GoToLocationValues;\n\tmultipleReferences?: GoToLocationValues;\n\n\talternativeDefinitionCommand?: string;\n\talternativeTypeDefinitionCommand?: string;\n\talternativeDeclarationCommand?: string;\n\talternativeImplementationCommand?: string;\n\talternativeReferenceCommand?: string;\n}\n\n/**\n * @internal\n */\nexport type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;\n\nclass EditorGoToLocation extends BaseEditorOption<EditorOption.gotoLocation, IGotoLocationOptions, GoToLocationOptions> {\n\n\tconstructor() {\n\t\tconst defaults: GoToLocationOptions = {\n\t\t\tmultiple: 'peek',\n\t\t\tmultipleDefinitions: 'peek',\n\t\t\tmultipleTypeDefinitions: 'peek',\n\t\t\tmultipleDeclarations: 'peek',\n\t\t\tmultipleImplementations: 'peek',\n\t\t\tmultipleReferences: 'peek',\n\t\t\talternativeDefinitionCommand: 'editor.action.goToReferences',\n\t\t\talternativeTypeDefinitionCommand: 'editor.action.goToReferences',\n\t\t\talternativeDeclarationCommand: 'editor.action.goToReferences',\n\t\t\talternativeImplementationCommand: '',\n\t\t\talternativeReferenceCommand: '',\n\t\t};\n\t\tconst jsonSubset: IJSONSchema = {\n\t\t\ttype: 'string',\n\t\t\tenum: ['peek', 'gotoAndPeek', 'goto'],\n\t\t\tdefault: defaults.multiple,\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'),\n\t\t\t\tnls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'),\n\t\t\t\tnls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others')\n\t\t\t]\n\t\t};\n\t\tconst alternativeCommandOptions = ['', 'editor.action.referenceSearch.trigger', 'editor.action.goToReferences', 'editor.action.peekImplementation', 'editor.action.goToImplementation', 'editor.action.peekTypeDefinition', 'editor.action.goToTypeDefinition', 'editor.action.peekDeclaration', 'editor.action.revealDeclaration', 'editor.action.peekDefinition', 'editor.action.revealDefinitionAside', 'editor.action.revealDefinition'];\n\t\tsuper(\n\t\t\tEditorOption.gotoLocation, 'gotoLocation', defaults,\n\t\t\t{\n\t\t\t\t'editor.gotoLocation.multiple': {\n\t\t\t\t\tdeprecationMessage: nls.localize('editor.gotoLocation.multiple.deprecated', \"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.\"),\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.multipleDefinitions': {\n\t\t\t\t\tdescription: nls.localize('editor.editor.gotoLocation.multipleDefinitions', \"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.\"),\n\t\t\t\t\t...jsonSubset,\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.multipleTypeDefinitions': {\n\t\t\t\t\tdescription: nls.localize('editor.editor.gotoLocation.multipleTypeDefinitions', \"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.\"),\n\t\t\t\t\t...jsonSubset,\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.multipleDeclarations': {\n\t\t\t\t\tdescription: nls.localize('editor.editor.gotoLocation.multipleDeclarations', \"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.\"),\n\t\t\t\t\t...jsonSubset,\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.multipleImplementations': {\n\t\t\t\t\tdescription: nls.localize('editor.editor.gotoLocation.multipleImplemenattions', \"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.\"),\n\t\t\t\t\t...jsonSubset,\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.multipleReferences': {\n\t\t\t\t\tdescription: nls.localize('editor.editor.gotoLocation.multipleReferences', \"Controls the behavior the 'Go to References'-command when multiple target locations exist.\"),\n\t\t\t\t\t...jsonSubset,\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.alternativeDefinitionCommand': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.alternativeDefinitionCommand,\n\t\t\t\t\tenum: alternativeCommandOptions,\n\t\t\t\t\tdescription: nls.localize('alternativeDefinitionCommand', \"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.\")\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.alternativeTypeDefinitionCommand': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.alternativeTypeDefinitionCommand,\n\t\t\t\t\tenum: alternativeCommandOptions,\n\t\t\t\t\tdescription: nls.localize('alternativeTypeDefinitionCommand', \"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.\")\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.alternativeDeclarationCommand': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.alternativeDeclarationCommand,\n\t\t\t\t\tenum: alternativeCommandOptions,\n\t\t\t\t\tdescription: nls.localize('alternativeDeclarationCommand', \"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.\")\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.alternativeImplementationCommand': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.alternativeImplementationCommand,\n\t\t\t\t\tenum: alternativeCommandOptions,\n\t\t\t\t\tdescription: nls.localize('alternativeImplementationCommand', \"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.\")\n\t\t\t\t},\n\t\t\t\t'editor.gotoLocation.alternativeReferenceCommand': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.alternativeReferenceCommand,\n\t\t\t\t\tenum: alternativeCommandOptions,\n\t\t\t\t\tdescription: nls.localize('alternativeReferenceCommand', \"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): GoToLocationOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IGotoLocationOptions;\n\t\treturn {\n\t\t\tmultiple: stringSet<GoToLocationValues>(input.multiple, this.defaultValue.multiple!, ['peek', 'gotoAndPeek', 'goto']),\n\t\t\tmultipleDefinitions: input.multipleDefinitions ?? stringSet<GoToLocationValues>(input.multipleDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n\t\t\tmultipleTypeDefinitions: input.multipleTypeDefinitions ?? stringSet<GoToLocationValues>(input.multipleTypeDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n\t\t\tmultipleDeclarations: input.multipleDeclarations ?? stringSet<GoToLocationValues>(input.multipleDeclarations, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n\t\t\tmultipleImplementations: input.multipleImplementations ?? stringSet<GoToLocationValues>(input.multipleImplementations, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n\t\t\tmultipleReferences: input.multipleReferences ?? stringSet<GoToLocationValues>(input.multipleReferences, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n\t\t\talternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand),\n\t\t\talternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand),\n\t\t\talternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand),\n\t\t\talternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand),\n\t\t\talternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region hover\n\n/**\n * Configuration options for editor hover\n */\nexport interface IEditorHoverOptions {\n\t/**\n\t * Enable the hover.\n\t * Defaults to true.\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Delay for showing the hover.\n\t * Defaults to 300.\n\t */\n\tdelay?: number;\n\t/**\n\t * Is the hover sticky such that it can be clicked and its contents selected?\n\t * Defaults to true.\n\t */\n\tsticky?: boolean;\n\t/**\n\t * Should the hover be shown above the line if possible?\n\t * Defaults to false.\n\t */\n\tabove?: boolean;\n}\n\n/**\n * @internal\n */\nexport type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;\n\nclass EditorHover extends BaseEditorOption<EditorOption.hover, IEditorHoverOptions, EditorHoverOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorHoverOptions = {\n\t\t\tenabled: true,\n\t\t\tdelay: 300,\n\t\t\tsticky: true,\n\t\t\tabove: true,\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.hover, 'hover', defaults,\n\t\t\t{\n\t\t\t\t'editor.hover.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('hover.enabled', \"Controls whether the hover is shown.\")\n\t\t\t\t},\n\t\t\t\t'editor.hover.delay': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.delay,\n\t\t\t\t\tminimum: 0,\n\t\t\t\t\tmaximum: 10000,\n\t\t\t\t\tdescription: nls.localize('hover.delay', \"Controls the delay in milliseconds after which the hover is shown.\")\n\t\t\t\t},\n\t\t\t\t'editor.hover.sticky': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.sticky,\n\t\t\t\t\tdescription: nls.localize('hover.sticky', \"Controls whether the hover should remain visible when mouse is moved over it.\")\n\t\t\t\t},\n\t\t\t\t'editor.hover.above': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.above,\n\t\t\t\t\tdescription: nls.localize('hover.above', \"Prefer showing hovers above the line, if there's space.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorHoverOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorHoverOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled),\n\t\t\tdelay: EditorIntOption.clampedInt(input.delay, this.defaultValue.delay, 0, 10000),\n\t\t\tsticky: boolean(input.sticky, this.defaultValue.sticky),\n\t\t\tabove: boolean(input.above, this.defaultValue.above),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region layoutInfo\n\n/**\n * A description for the overview ruler position.\n */\nexport interface OverviewRulerPosition {\n\t/**\n\t * Width of the overview ruler\n\t */\n\treadonly width: number;\n\t/**\n\t * Height of the overview ruler\n\t */\n\treadonly height: number;\n\t/**\n\t * Top position for the overview ruler\n\t */\n\treadonly top: number;\n\t/**\n\t * Right position for the overview ruler\n\t */\n\treadonly right: number;\n}\n\nexport const enum RenderMinimap {\n\tNone = 0,\n\tText = 1,\n\tBlocks = 2,\n}\n\n/**\n * The internal layout details of the editor.\n */\nexport interface EditorLayoutInfo {\n\n\t/**\n\t * Full editor width.\n\t */\n\treadonly width: number;\n\t/**\n\t * Full editor height.\n\t */\n\treadonly height: number;\n\n\t/**\n\t * Left position for the glyph margin.\n\t */\n\treadonly glyphMarginLeft: number;\n\t/**\n\t * The width of the glyph margin.\n\t */\n\treadonly glyphMarginWidth: number;\n\n\t/**\n\t * Left position for the line numbers.\n\t */\n\treadonly lineNumbersLeft: number;\n\t/**\n\t * The width of the line numbers.\n\t */\n\treadonly lineNumbersWidth: number;\n\n\t/**\n\t * Left position for the line decorations.\n\t */\n\treadonly decorationsLeft: number;\n\t/**\n\t * The width of the line decorations.\n\t */\n\treadonly decorationsWidth: number;\n\n\t/**\n\t * Left position for the content (actual text)\n\t */\n\treadonly contentLeft: number;\n\t/**\n\t * The width of the content (actual text)\n\t */\n\treadonly contentWidth: number;\n\n\t/**\n\t * Layout information for the minimap\n\t */\n\treadonly minimap: EditorMinimapLayoutInfo;\n\n\t/**\n\t * The number of columns (of typical characters) fitting on a viewport line.\n\t */\n\treadonly viewportColumn: number;\n\n\treadonly isWordWrapMinified: boolean;\n\treadonly isViewportWrapping: boolean;\n\treadonly wrappingColumn: number;\n\n\t/**\n\t * The width of the vertical scrollbar.\n\t */\n\treadonly verticalScrollbarWidth: number;\n\t/**\n\t * The height of the horizontal scrollbar.\n\t */\n\treadonly horizontalScrollbarHeight: number;\n\n\t/**\n\t * The position of the overview ruler.\n\t */\n\treadonly overviewRuler: OverviewRulerPosition;\n}\n\n/**\n * The internal layout details of the editor.\n */\nexport interface EditorMinimapLayoutInfo {\n\treadonly renderMinimap: RenderMinimap;\n\treadonly minimapLeft: number;\n\treadonly minimapWidth: number;\n\treadonly minimapHeightIsEditorHeight: boolean;\n\treadonly minimapIsSampling: boolean;\n\treadonly minimapScale: number;\n\treadonly minimapLineHeight: number;\n\treadonly minimapCanvasInnerWidth: number;\n\treadonly minimapCanvasInnerHeight: number;\n\treadonly minimapCanvasOuterWidth: number;\n\treadonly minimapCanvasOuterHeight: number;\n}\n\n/**\n * @internal\n */\nexport interface EditorLayoutInfoComputerEnv {\n\treadonly memory: ComputeOptionsMemory | null;\n\treadonly outerWidth: number;\n\treadonly outerHeight: number;\n\treadonly isDominatedByLongLines: boolean;\n\treadonly lineHeight: number;\n\treadonly viewLineCount: number;\n\treadonly lineNumbersDigitCount: number;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly maxDigitWidth: number;\n\treadonly pixelRatio: number;\n}\n\n/**\n * @internal\n */\nexport interface IMinimapLayoutInput {\n\treadonly outerWidth: number;\n\treadonly outerHeight: number;\n\treadonly lineHeight: number;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly pixelRatio: number;\n\treadonly scrollBeyondLastLine: boolean;\n\treadonly minimap: Readonly<Required<IEditorMinimapOptions>>;\n\treadonly verticalScrollbarWidth: number;\n\treadonly viewLineCount: number;\n\treadonly remainingWidth: number;\n\treadonly isViewportWrapping: boolean;\n}\n\n/**\n * @internal\n */\nexport class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.layoutInfo, EditorLayoutInfo> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.layoutInfo);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorLayoutInfo): EditorLayoutInfo {\n\t\treturn EditorLayoutInfoComputer.computeLayout(options, {\n\t\t\tmemory: env.memory,\n\t\t\touterWidth: env.outerWidth,\n\t\t\touterHeight: env.outerHeight,\n\t\t\tisDominatedByLongLines: env.isDominatedByLongLines,\n\t\t\tlineHeight: env.fontInfo.lineHeight,\n\t\t\tviewLineCount: env.viewLineCount,\n\t\t\tlineNumbersDigitCount: env.lineNumbersDigitCount,\n\t\t\ttypicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth,\n\t\t\tmaxDigitWidth: env.fontInfo.maxDigitWidth,\n\t\t\tpixelRatio: env.pixelRatio\n\t\t});\n\t}\n\n\tpublic static computeContainedMinimapLineCount(input: {\n\t\tviewLineCount: number;\n\t\tscrollBeyondLastLine: boolean;\n\t\theight: number;\n\t\tlineHeight: number;\n\t\tpixelRatio: number;\n\t}): { typicalViewportLineCount: number; extraLinesBeyondLastLine: number; desiredRatio: number; minimapLineCount: number } {\n\t\tconst typicalViewportLineCount = input.height / input.lineHeight;\n\t\tconst extraLinesBeyondLastLine = input.scrollBeyondLastLine ? (typicalViewportLineCount - 1) : 0;\n\t\tconst desiredRatio = (input.viewLineCount + extraLinesBeyondLastLine) / (input.pixelRatio * input.height);\n\t\tconst minimapLineCount = Math.floor(input.viewLineCount / desiredRatio);\n\t\treturn { typicalViewportLineCount, extraLinesBeyondLastLine, desiredRatio, minimapLineCount };\n\t}\n\n\tprivate static _computeMinimapLayout(input: IMinimapLayoutInput, memory: ComputeOptionsMemory): EditorMinimapLayoutInfo {\n\t\tconst outerWidth = input.outerWidth;\n\t\tconst outerHeight = input.outerHeight;\n\t\tconst pixelRatio = input.pixelRatio;\n\n\t\tif (!input.minimap.enabled) {\n\t\t\treturn {\n\t\t\t\trenderMinimap: RenderMinimap.None,\n\t\t\t\tminimapLeft: 0,\n\t\t\t\tminimapWidth: 0,\n\t\t\t\tminimapHeightIsEditorHeight: false,\n\t\t\t\tminimapIsSampling: false,\n\t\t\t\tminimapScale: 1,\n\t\t\t\tminimapLineHeight: 1,\n\t\t\t\tminimapCanvasInnerWidth: 0,\n\t\t\t\tminimapCanvasInnerHeight: Math.floor(pixelRatio * outerHeight),\n\t\t\t\tminimapCanvasOuterWidth: 0,\n\t\t\t\tminimapCanvasOuterHeight: outerHeight,\n\t\t\t};\n\t\t}\n\n\t\t// Can use memory if only the `viewLineCount` and `remainingWidth` have changed\n\t\tconst stableMinimapLayoutInput = memory.stableMinimapLayoutInput;\n\t\tconst couldUseMemory = (\n\t\t\tstableMinimapLayoutInput\n\t\t\t// && input.outerWidth === lastMinimapLayoutInput.outerWidth !!! INTENTIONAL OMITTED\n\t\t\t&& input.outerHeight === stableMinimapLayoutInput.outerHeight\n\t\t\t&& input.lineHeight === stableMinimapLayoutInput.lineHeight\n\t\t\t&& input.typicalHalfwidthCharacterWidth === stableMinimapLayoutInput.typicalHalfwidthCharacterWidth\n\t\t\t&& input.pixelRatio === stableMinimapLayoutInput.pixelRatio\n\t\t\t&& input.scrollBeyondLastLine === stableMinimapLayoutInput.scrollBeyondLastLine\n\t\t\t&& input.minimap.enabled === stableMinimapLayoutInput.minimap.enabled\n\t\t\t&& input.minimap.side === stableMinimapLayoutInput.minimap.side\n\t\t\t&& input.minimap.size === stableMinimapLayoutInput.minimap.size\n\t\t\t&& input.minimap.showSlider === stableMinimapLayoutInput.minimap.showSlider\n\t\t\t&& input.minimap.renderCharacters === stableMinimapLayoutInput.minimap.renderCharacters\n\t\t\t&& input.minimap.maxColumn === stableMinimapLayoutInput.minimap.maxColumn\n\t\t\t&& input.minimap.scale === stableMinimapLayoutInput.minimap.scale\n\t\t\t&& input.verticalScrollbarWidth === stableMinimapLayoutInput.verticalScrollbarWidth\n\t\t\t// && input.viewLineCount === lastMinimapLayoutInput.viewLineCount !!! INTENTIONAL OMITTED\n\t\t\t// && input.remainingWidth === lastMinimapLayoutInput.remainingWidth !!! INTENTIONAL OMITTED\n\t\t\t&& input.isViewportWrapping === stableMinimapLayoutInput.isViewportWrapping\n\t\t);\n\n\t\tconst lineHeight = input.lineHeight;\n\t\tconst typicalHalfwidthCharacterWidth = input.typicalHalfwidthCharacterWidth;\n\t\tconst scrollBeyondLastLine = input.scrollBeyondLastLine;\n\t\tconst minimapRenderCharacters = input.minimap.renderCharacters;\n\t\tlet minimapScale = (pixelRatio >= 2 ? Math.round(input.minimap.scale * 2) : input.minimap.scale);\n\t\tconst minimapMaxColumn = input.minimap.maxColumn;\n\t\tconst minimapSize = input.minimap.size;\n\t\tconst minimapSide = input.minimap.side;\n\t\tconst verticalScrollbarWidth = input.verticalScrollbarWidth;\n\t\tconst viewLineCount = input.viewLineCount;\n\t\tconst remainingWidth = input.remainingWidth;\n\t\tconst isViewportWrapping = input.isViewportWrapping;\n\n\t\tconst baseCharHeight = minimapRenderCharacters ? 2 : 3;\n\t\tlet minimapCanvasInnerHeight = Math.floor(pixelRatio * outerHeight);\n\t\tconst minimapCanvasOuterHeight = minimapCanvasInnerHeight / pixelRatio;\n\t\tlet minimapHeightIsEditorHeight = false;\n\t\tlet minimapIsSampling = false;\n\t\tlet minimapLineHeight = baseCharHeight * minimapScale;\n\t\tlet minimapCharWidth = minimapScale / pixelRatio;\n\t\tlet minimapWidthMultiplier: number = 1;\n\n\t\tif (minimapSize === 'fill' || minimapSize === 'fit') {\n\t\t\tconst { typicalViewportLineCount, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({\n\t\t\t\tviewLineCount: viewLineCount,\n\t\t\t\tscrollBeyondLastLine: scrollBeyondLastLine,\n\t\t\t\theight: outerHeight,\n\t\t\t\tlineHeight: lineHeight,\n\t\t\t\tpixelRatio: pixelRatio\n\t\t\t});\n\t\t\t// ratio is intentionally not part of the layout to avoid the layout changing all the time\n\t\t\t// when doing sampling\n\t\t\tconst ratio = viewLineCount / minimapLineCount;\n\n\t\t\tif (ratio > 1) {\n\t\t\t\tminimapHeightIsEditorHeight = true;\n\t\t\t\tminimapIsSampling = true;\n\t\t\t\tminimapScale = 1;\n\t\t\t\tminimapLineHeight = 1;\n\t\t\t\tminimapCharWidth = minimapScale / pixelRatio;\n\t\t\t} else {\n\t\t\t\tlet fitBecomesFill = false;\n\t\t\t\tlet maxMinimapScale = minimapScale + 1;\n\n\t\t\t\tif (minimapSize === 'fit') {\n\t\t\t\t\tconst effectiveMinimapHeight = Math.ceil((viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight);\n\t\t\t\t\tif (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {\n\t\t\t\t\t\t// There is a loop when using `fit` and viewport wrapping:\n\t\t\t\t\t\t// - view line count impacts minimap layout\n\t\t\t\t\t\t// - minimap layout impacts viewport width\n\t\t\t\t\t\t// - viewport width impacts view line count\n\t\t\t\t\t\t// To break the loop, once we go to a smaller minimap scale, we try to stick with it.\n\t\t\t\t\t\tfitBecomesFill = true;\n\t\t\t\t\t\tmaxMinimapScale = memory.stableFitMaxMinimapScale;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfitBecomesFill = (effectiveMinimapHeight > minimapCanvasInnerHeight);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (minimapSize === 'fill' || fitBecomesFill) {\n\t\t\t\t\tminimapHeightIsEditorHeight = true;\n\t\t\t\t\tconst configuredMinimapScale = minimapScale;\n\t\t\t\t\tminimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio)));\n\t\t\t\t\tif (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {\n\t\t\t\t\t\t// There is a loop when using `fill` and viewport wrapping:\n\t\t\t\t\t\t// - view line count impacts minimap layout\n\t\t\t\t\t\t// - minimap layout impacts viewport width\n\t\t\t\t\t\t// - viewport width impacts view line count\n\t\t\t\t\t\t// To break the loop, once we go to a smaller minimap scale, we try to stick with it.\n\t\t\t\t\t\tmaxMinimapScale = memory.stableFitMaxMinimapScale;\n\t\t\t\t\t}\n\t\t\t\t\tminimapScale = Math.min(maxMinimapScale, Math.max(1, Math.floor(minimapLineHeight / baseCharHeight)));\n\t\t\t\t\tif (minimapScale > configuredMinimapScale) {\n\t\t\t\t\t\tminimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale);\n\t\t\t\t\t}\n\t\t\t\t\tminimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier;\n\t\t\t\t\tminimapCanvasInnerHeight = Math.ceil((Math.max(typicalViewportLineCount, viewLineCount + extraLinesBeyondLastLine)) * minimapLineHeight);\n\t\t\t\t\tif (isViewportWrapping) {\n\t\t\t\t\t\t// remember for next time\n\t\t\t\t\t\tmemory.stableMinimapLayoutInput = input;\n\t\t\t\t\t\tmemory.stableFitRemainingWidth = remainingWidth;\n\t\t\t\t\t\tmemory.stableFitMaxMinimapScale = minimapScale;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmemory.stableMinimapLayoutInput = null;\n\t\t\t\t\t\tmemory.stableFitRemainingWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Given:\n\t\t// (leaving 2px for the cursor to have space after the last character)\n\t\t// viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth\n\t\t// minimapWidth = viewportColumn * minimapCharWidth\n\t\t// contentWidth = remainingWidth - minimapWidth\n\t\t// What are good values for contentWidth and minimapWidth ?\n\n\t\t// minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth\n\t\t// typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t// typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t// (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t// minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)\n\n\t\tconst minimapMaxWidth = Math.floor(minimapMaxColumn * minimapCharWidth);\n\t\tconst minimapWidth = Math.min(minimapMaxWidth, Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))) + MINIMAP_GUTTER_WIDTH);\n\n\t\tlet minimapCanvasInnerWidth = Math.floor(pixelRatio * minimapWidth);\n\t\tconst minimapCanvasOuterWidth = minimapCanvasInnerWidth / pixelRatio;\n\t\tminimapCanvasInnerWidth = Math.floor(minimapCanvasInnerWidth * minimapWidthMultiplier);\n\n\t\tconst renderMinimap = (minimapRenderCharacters ? RenderMinimap.Text : RenderMinimap.Blocks);\n\t\tconst minimapLeft = (minimapSide === 'left' ? 0 : (outerWidth - minimapWidth - verticalScrollbarWidth));\n\n\t\treturn {\n\t\t\trenderMinimap,\n\t\t\tminimapLeft,\n\t\t\tminimapWidth,\n\t\t\tminimapHeightIsEditorHeight,\n\t\t\tminimapIsSampling,\n\t\t\tminimapScale,\n\t\t\tminimapLineHeight,\n\t\t\tminimapCanvasInnerWidth,\n\t\t\tminimapCanvasInnerHeight,\n\t\t\tminimapCanvasOuterWidth,\n\t\t\tminimapCanvasOuterHeight,\n\t\t};\n\t}\n\n\tpublic static computeLayout(options: IComputedEditorOptions, env: EditorLayoutInfoComputerEnv): EditorLayoutInfo {\n\t\tconst outerWidth = env.outerWidth | 0;\n\t\tconst outerHeight = env.outerHeight | 0;\n\t\tconst lineHeight = env.lineHeight | 0;\n\t\tconst lineNumbersDigitCount = env.lineNumbersDigitCount | 0;\n\t\tconst typicalHalfwidthCharacterWidth = env.typicalHalfwidthCharacterWidth;\n\t\tconst maxDigitWidth = env.maxDigitWidth;\n\t\tconst pixelRatio = env.pixelRatio;\n\t\tconst viewLineCount = env.viewLineCount;\n\n\t\tconst wordWrapOverride2 = options.get(EditorOption.wordWrapOverride2);\n\t\tconst wordWrapOverride1 = (wordWrapOverride2 === 'inherit' ? options.get(EditorOption.wordWrapOverride1) : wordWrapOverride2);\n\t\tconst wordWrap = (wordWrapOverride1 === 'inherit' ? options.get(EditorOption.wordWrap) : wordWrapOverride1);\n\n\t\tconst wordWrapColumn = options.get(EditorOption.wordWrapColumn);\n\t\tconst accessibilitySupport = options.get(EditorOption.accessibilitySupport);\n\t\tconst isDominatedByLongLines = env.isDominatedByLongLines;\n\n\t\tconst showGlyphMargin = options.get(EditorOption.glyphMargin);\n\t\tconst showLineNumbers = (options.get(EditorOption.lineNumbers).renderType !== RenderLineNumbersType.Off);\n\t\tconst lineNumbersMinChars = options.get(EditorOption.lineNumbersMinChars);\n\t\tconst scrollBeyondLastLine = options.get(EditorOption.scrollBeyondLastLine);\n\t\tconst minimap = options.get(EditorOption.minimap);\n\n\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\tconst verticalScrollbarWidth = scrollbar.verticalScrollbarSize;\n\t\tconst verticalScrollbarHasArrows = scrollbar.verticalHasArrows;\n\t\tconst scrollbarArrowSize = scrollbar.arrowSize;\n\t\tconst horizontalScrollbarHeight = scrollbar.horizontalScrollbarSize;\n\n\t\tconst rawLineDecorationsWidth = options.get(EditorOption.lineDecorationsWidth);\n\t\tconst folding = options.get(EditorOption.folding);\n\n\t\tlet lineDecorationsWidth: number;\n\t\tif (typeof rawLineDecorationsWidth === 'string' && /^\\d+(\\.\\d+)?ch$/.test(rawLineDecorationsWidth)) {\n\t\t\tconst multiple = parseFloat(rawLineDecorationsWidth.substr(0, rawLineDecorationsWidth.length - 2));\n\t\t\tlineDecorationsWidth = EditorIntOption.clampedInt(multiple * typicalHalfwidthCharacterWidth, 0, 0, 1000);\n\t\t} else {\n\t\t\tlineDecorationsWidth = EditorIntOption.clampedInt(rawLineDecorationsWidth, 0, 0, 1000);\n\t\t}\n\t\tif (folding) {\n\t\t\tlineDecorationsWidth += 16;\n\t\t}\n\n\t\tlet lineNumbersWidth = 0;\n\t\tif (showLineNumbers) {\n\t\t\tconst digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars);\n\t\t\tlineNumbersWidth = Math.round(digitCount * maxDigitWidth);\n\t\t}\n\n\t\tlet glyphMarginWidth = 0;\n\t\tif (showGlyphMargin) {\n\t\t\tglyphMarginWidth = lineHeight;\n\t\t}\n\n\t\tlet glyphMarginLeft = 0;\n\t\tlet lineNumbersLeft = glyphMarginLeft + glyphMarginWidth;\n\t\tlet decorationsLeft = lineNumbersLeft + lineNumbersWidth;\n\t\tlet contentLeft = decorationsLeft + lineDecorationsWidth;\n\n\t\tconst remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth;\n\n\t\tlet isWordWrapMinified = false;\n\t\tlet isViewportWrapping = false;\n\t\tlet wrappingColumn = -1;\n\n\t\tif (accessibilitySupport !== AccessibilitySupport.Enabled) {\n\t\t\t// See https://github.com/microsoft/vscode/issues/27766\n\t\t\t// Never enable wrapping when a screen reader is attached\n\t\t\t// because arrow down etc. will not move the cursor in the way\n\t\t\t// a screen reader expects.\n\t\t\tif (wordWrapOverride1 === 'inherit' && isDominatedByLongLines) {\n\t\t\t\t// Force viewport width wrapping if model is dominated by long lines\n\t\t\t\tisWordWrapMinified = true;\n\t\t\t\tisViewportWrapping = true;\n\t\t\t} else if (wordWrap === 'on' || wordWrap === 'bounded') {\n\t\t\t\tisViewportWrapping = true;\n\t\t\t} else if (wordWrap === 'wordWrapColumn') {\n\t\t\t\twrappingColumn = wordWrapColumn;\n\t\t\t}\n\t\t}\n\n\t\tconst minimapLayout = EditorLayoutInfoComputer._computeMinimapLayout({\n\t\t\touterWidth: outerWidth,\n\t\t\touterHeight: outerHeight,\n\t\t\tlineHeight: lineHeight,\n\t\t\ttypicalHalfwidthCharacterWidth: typicalHalfwidthCharacterWidth,\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tscrollBeyondLastLine: scrollBeyondLastLine,\n\t\t\tminimap: minimap,\n\t\t\tverticalScrollbarWidth: verticalScrollbarWidth,\n\t\t\tviewLineCount: viewLineCount,\n\t\t\tremainingWidth: remainingWidth,\n\t\t\tisViewportWrapping: isViewportWrapping,\n\t\t}, env.memory || new ComputeOptionsMemory());\n\n\t\tif (minimapLayout.renderMinimap !== RenderMinimap.None && minimapLayout.minimapLeft === 0) {\n\t\t\t// the minimap is rendered to the left, so move everything to the right\n\t\t\tglyphMarginLeft += minimapLayout.minimapWidth;\n\t\t\tlineNumbersLeft += minimapLayout.minimapWidth;\n\t\t\tdecorationsLeft += minimapLayout.minimapWidth;\n\t\t\tcontentLeft += minimapLayout.minimapWidth;\n\t\t}\n\t\tconst contentWidth = remainingWidth - minimapLayout.minimapWidth;\n\n\t\t// (leaving 2px for the cursor to have space after the last character)\n\t\tconst viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth));\n\n\t\tconst verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0);\n\n\t\tif (isViewportWrapping) {\n\t\t\t// compute the actual wrappingColumn\n\t\t\twrappingColumn = Math.max(1, viewportColumn);\n\t\t\tif (wordWrap === 'bounded') {\n\t\t\t\twrappingColumn = Math.min(wrappingColumn, wordWrapColumn);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\twidth: outerWidth,\n\t\t\theight: outerHeight,\n\n\t\t\tglyphMarginLeft: glyphMarginLeft,\n\t\t\tglyphMarginWidth: glyphMarginWidth,\n\n\t\t\tlineNumbersLeft: lineNumbersLeft,\n\t\t\tlineNumbersWidth: lineNumbersWidth,\n\n\t\t\tdecorationsLeft: decorationsLeft,\n\t\t\tdecorationsWidth: lineDecorationsWidth,\n\n\t\t\tcontentLeft: contentLeft,\n\t\t\tcontentWidth: contentWidth,\n\n\t\t\tminimap: minimapLayout,\n\n\t\t\tviewportColumn: viewportColumn,\n\n\t\t\tisWordWrapMinified: isWordWrapMinified,\n\t\t\tisViewportWrapping: isViewportWrapping,\n\t\t\twrappingColumn: wrappingColumn,\n\n\t\t\tverticalScrollbarWidth: verticalScrollbarWidth,\n\t\t\thorizontalScrollbarHeight: horizontalScrollbarHeight,\n\n\t\t\toverviewRuler: {\n\t\t\t\ttop: verticalArrowSize,\n\t\t\t\twidth: verticalScrollbarWidth,\n\t\t\t\theight: (outerHeight - 2 * verticalArrowSize),\n\t\t\t\tright: 0\n\t\t\t}\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region lightbulb\n\n/**\n * Configuration options for editor lightbulb\n */\nexport interface IEditorLightbulbOptions {\n\t/**\n\t * Enable the lightbulb code action.\n\t * Defaults to true.\n\t */\n\tenabled?: boolean;\n}\n\n/**\n * @internal\n */\nexport type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;\n\nclass EditorLightbulb extends BaseEditorOption<EditorOption.lightbulb, IEditorLightbulbOptions, EditorLightbulbOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorLightbulbOptions = { enabled: true };\n\t\tsuper(\n\t\t\tEditorOption.lightbulb, 'lightbulb', defaults,\n\t\t\t{\n\t\t\t\t'editor.lightbulb.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('codeActions', \"Enables the code action lightbulb in the editor.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorLightbulbOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorLightbulbOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled)\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region inlayHints\n\n/**\n * Configuration options for editor inlayHints\n */\nexport interface IEditorInlayHintsOptions {\n\t/**\n\t * Enable the inline hints.\n\t * Defaults to true.\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Font size of inline hints.\n\t * Default to 90% of the editor font size.\n\t */\n\tfontSize?: number;\n\n\t/**\n\t * Font family of inline hints.\n\t * Defaults to editor font family.\n\t */\n\tfontFamily?: string;\n}\n\n/**\n * @internal\n */\nexport type EditorInlayHintsOptions = Readonly<Required<IEditorInlayHintsOptions>>;\n\nclass EditorInlayHints extends BaseEditorOption<EditorOption.inlayHints, IEditorInlayHintsOptions, EditorInlayHintsOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorInlayHintsOptions = { enabled: true, fontSize: 0, fontFamily: '' };\n\t\tsuper(\n\t\t\tEditorOption.inlayHints, 'inlayHints', defaults,\n\t\t\t{\n\t\t\t\t'editor.inlayHints.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('inlayHints.enable', \"Enables the inlay hints in the editor.\")\n\t\t\t\t},\n\t\t\t\t'editor.inlayHints.fontSize': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.fontSize,\n\t\t\t\t\tmarkdownDescription: nls.localize('inlayHints.fontSize', \"Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.\")\n\t\t\t\t},\n\t\t\t\t'editor.inlayHints.fontFamily': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: defaults.fontFamily,\n\t\t\t\t\tmarkdownDescription: nls.localize('inlayHints.fontFamily', \"Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorInlayHintsOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorInlayHintsOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled),\n\t\t\tfontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100),\n\t\t\tfontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily)\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region lineHeight\n\nclass EditorLineHeight extends EditorFloatOption<EditorOption.lineHeight> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.lineHeight, 'lineHeight',\n\t\t\tEDITOR_FONT_DEFAULTS.lineHeight,\n\t\t\tx => EditorFloatOption.clamp(x, 0, 150),\n\t\t\t{ markdownDescription: nls.localize('lineHeight', \"Controls the line height. \\n - Use 0 to automatically compute the line height from the font size.\\n - Values between 0 and 8 will be used as a multiplier with the font size.\\n - Values greater than or equal to 8 will be used as effective values.\") }\n\t\t);\n\t}\n\n\tpublic override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {\n\t\t// The lineHeight is computed from the fontSize if it is 0.\n\t\t// Moreover, the final lineHeight respects the editor zoom level.\n\t\t// So take the result from env.fontInfo\n\t\treturn env.fontInfo.lineHeight;\n\t}\n}\n\n//#endregion\n\n//#region minimap\n\n/**\n * Configuration options for editor minimap\n */\nexport interface IEditorMinimapOptions {\n\t/**\n\t * Enable the rendering of the minimap.\n\t * Defaults to true.\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Control the side of the minimap in editor.\n\t * Defaults to 'right'.\n\t */\n\tside?: 'right' | 'left';\n\t/**\n\t * Control the minimap rendering mode.\n\t * Defaults to 'actual'.\n\t */\n\tsize?: 'proportional' | 'fill' | 'fit';\n\t/**\n\t * Control the rendering of the minimap slider.\n\t * Defaults to 'mouseover'.\n\t */\n\tshowSlider?: 'always' | 'mouseover';\n\t/**\n\t * Render the actual text on a line (as opposed to color blocks).\n\t * Defaults to true.\n\t */\n\trenderCharacters?: boolean;\n\t/**\n\t * Limit the width of the minimap to render at most a certain number of columns.\n\t * Defaults to 120.\n\t */\n\tmaxColumn?: number;\n\t/**\n\t * Relative size of the font in the minimap. Defaults to 1.\n\t */\n\tscale?: number;\n}\n\n/**\n * @internal\n */\nexport type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;\n\nclass EditorMinimap extends BaseEditorOption<EditorOption.minimap, IEditorMinimapOptions, EditorMinimapOptions> {\n\n\tconstructor() {\n\t\tconst defaults: EditorMinimapOptions = {\n\t\t\tenabled: true,\n\t\t\tsize: 'proportional',\n\t\t\tside: 'right',\n\t\t\tshowSlider: 'mouseover',\n\t\t\trenderCharacters: true,\n\t\t\tmaxColumn: 120,\n\t\t\tscale: 1,\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.minimap, 'minimap', defaults,\n\t\t\t{\n\t\t\t\t'editor.minimap.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('minimap.enabled', \"Controls whether the minimap is shown.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.size': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['proportional', 'fill', 'fit'],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('minimap.size.proportional', \"The minimap has the same size as the editor contents (and might scroll).\"),\n\t\t\t\t\t\tnls.localize('minimap.size.fill', \"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).\"),\n\t\t\t\t\t\tnls.localize('minimap.size.fit', \"The minimap will shrink as necessary to never be larger than the editor (no scrolling).\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: defaults.size,\n\t\t\t\t\tdescription: nls.localize('minimap.size', \"Controls the size of the minimap.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.side': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['left', 'right'],\n\t\t\t\t\tdefault: defaults.side,\n\t\t\t\t\tdescription: nls.localize('minimap.side', \"Controls the side where to render the minimap.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.showSlider': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['always', 'mouseover'],\n\t\t\t\t\tdefault: defaults.showSlider,\n\t\t\t\t\tdescription: nls.localize('minimap.showSlider', \"Controls when the minimap slider is shown.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.scale': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.scale,\n\t\t\t\t\tminimum: 1,\n\t\t\t\t\tmaximum: 3,\n\t\t\t\t\tenum: [1, 2, 3],\n\t\t\t\t\tdescription: nls.localize('minimap.scale', \"Scale of content drawn in the minimap: 1, 2 or 3.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.renderCharacters': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.renderCharacters,\n\t\t\t\t\tdescription: nls.localize('minimap.renderCharacters', \"Render the actual characters on a line as opposed to color blocks.\")\n\t\t\t\t},\n\t\t\t\t'editor.minimap.maxColumn': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.maxColumn,\n\t\t\t\t\tdescription: nls.localize('minimap.maxColumn', \"Limit the width of the minimap to render at most a certain number of columns.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): EditorMinimapOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorMinimapOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled),\n\t\t\tsize: stringSet<'proportional' | 'fill' | 'fit'>(input.size, this.defaultValue.size, ['proportional', 'fill', 'fit']),\n\t\t\tside: stringSet<'right' | 'left'>(input.side, this.defaultValue.side, ['right', 'left']),\n\t\t\tshowSlider: stringSet<'always' | 'mouseover'>(input.showSlider, this.defaultValue.showSlider, ['always', 'mouseover']),\n\t\t\trenderCharacters: boolean(input.renderCharacters, this.defaultValue.renderCharacters),\n\t\t\tscale: EditorIntOption.clampedInt(input.scale, 1, 1, 3),\n\t\t\tmaxColumn: EditorIntOption.clampedInt(input.maxColumn, this.defaultValue.maxColumn, 1, 10000),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region multiCursorModifier\n\nfunction _multiCursorModifierFromString(multiCursorModifier: 'ctrlCmd' | 'alt'): 'altKey' | 'metaKey' | 'ctrlKey' {\n\tif (multiCursorModifier === 'ctrlCmd') {\n\t\treturn (platform.isMacintosh ? 'metaKey' : 'ctrlKey');\n\t}\n\treturn 'altKey';\n}\n\n//#endregion\n\n//#region padding\n\n/**\n * Configuration options for editor padding\n */\nexport interface IEditorPaddingOptions {\n\t/**\n\t * Spacing between top edge of editor and first line.\n\t */\n\ttop?: number;\n\t/**\n\t * Spacing between bottom edge of editor and last line.\n\t */\n\tbottom?: number;\n}\n\n/**\n * @internal\n */\nexport type InternalEditorPaddingOptions = Readonly<Required<IEditorPaddingOptions>>;\n\nclass EditorPadding extends BaseEditorOption<EditorOption.padding, IEditorPaddingOptions, InternalEditorPaddingOptions> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.padding, 'padding', { top: 0, bottom: 0 },\n\t\t\t{\n\t\t\t\t'editor.padding.top': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 0,\n\t\t\t\t\tminimum: 0,\n\t\t\t\t\tmaximum: 1000,\n\t\t\t\t\tdescription: nls.localize('padding.top', \"Controls the amount of space between the top edge of the editor and the first line.\")\n\t\t\t\t},\n\t\t\t\t'editor.padding.bottom': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 0,\n\t\t\t\t\tminimum: 0,\n\t\t\t\t\tmaximum: 1000,\n\t\t\t\t\tdescription: nls.localize('padding.bottom', \"Controls the amount of space between the bottom edge of the editor and the last line.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalEditorPaddingOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorPaddingOptions;\n\n\t\treturn {\n\t\t\ttop: EditorIntOption.clampedInt(input.top, 0, 0, 1000),\n\t\t\tbottom: EditorIntOption.clampedInt(input.bottom, 0, 0, 1000)\n\t\t};\n\t}\n}\n//#endregion\n\n//#region parameterHints\n\n/**\n * Configuration options for parameter hints\n */\nexport interface IEditorParameterHintOptions {\n\t/**\n\t * Enable parameter hints.\n\t * Defaults to true.\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Enable cycling of parameter hints.\n\t * Defaults to false.\n\t */\n\tcycle?: boolean;\n}\n\n/**\n * @internal\n */\nexport type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;\n\nclass EditorParameterHints extends BaseEditorOption<EditorOption.parameterHints, IEditorParameterHintOptions, InternalParameterHintOptions> {\n\n\tconstructor() {\n\t\tconst defaults: InternalParameterHintOptions = {\n\t\t\tenabled: true,\n\t\t\tcycle: false\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.parameterHints, 'parameterHints', defaults,\n\t\t\t{\n\t\t\t\t'editor.parameterHints.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('parameterHints.enabled', \"Enables a pop-up that shows parameter documentation and type information as you type.\")\n\t\t\t\t},\n\t\t\t\t'editor.parameterHints.cycle': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.cycle,\n\t\t\t\t\tdescription: nls.localize('parameterHints.cycle', \"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalParameterHintOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorParameterHintOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled),\n\t\t\tcycle: boolean(input.cycle, this.defaultValue.cycle)\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region pixelRatio\n\nclass EditorPixelRatio extends ComputedEditorOption<EditorOption.pixelRatio, number> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.pixelRatio);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: number): number {\n\t\treturn env.pixelRatio;\n\t}\n}\n\n//#endregion\n\n//#region quickSuggestions\n\n/**\n * Configuration options for quick suggestions\n */\nexport interface IQuickSuggestionsOptions {\n\tother?: boolean;\n\tcomments?: boolean;\n\tstrings?: boolean;\n}\n\n/**\n * @internal\n */\nexport type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;\n\nclass EditorQuickSuggestions extends BaseEditorOption<EditorOption.quickSuggestions, boolean | IQuickSuggestionsOptions, ValidQuickSuggestionsOptions> {\n\n\tpublic override readonly defaultValue: Readonly<Required<IQuickSuggestionsOptions>>;\n\n\tconstructor() {\n\t\tconst defaults: ValidQuickSuggestionsOptions = {\n\t\t\tother: true,\n\t\t\tcomments: false,\n\t\t\tstrings: false\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.quickSuggestions, 'quickSuggestions', defaults,\n\t\t\t{\n\t\t\t\tanyOf: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tstrings: {\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: defaults.strings,\n\t\t\t\t\t\t\t\tdescription: nls.localize('quickSuggestions.strings', \"Enable quick suggestions inside strings.\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomments: {\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: defaults.comments,\n\t\t\t\t\t\t\t\tdescription: nls.localize('quickSuggestions.comments', \"Enable quick suggestions inside comments.\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tother: {\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: defaults.other,\n\t\t\t\t\t\t\t\tdescription: nls.localize('quickSuggestions.other', \"Enable quick suggestions outside of strings and comments.\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tdefault: defaults,\n\t\t\t\tdescription: nls.localize('quickSuggestions', \"Controls whether suggestions should automatically show up while typing.\")\n\t\t\t}\n\t\t);\n\t\tthis.defaultValue = defaults;\n\t}\n\n\tpublic validate(_input: any): ValidQuickSuggestionsOptions {\n\t\tif (typeof _input === 'boolean') {\n\t\t\treturn _input;\n\t\t}\n\t\tif (_input && typeof _input === 'object') {\n\t\t\tconst input = _input as IQuickSuggestionsOptions;\n\t\t\tconst opts = {\n\t\t\t\tother: boolean(input.other, this.defaultValue.other),\n\t\t\t\tcomments: boolean(input.comments, this.defaultValue.comments),\n\t\t\t\tstrings: boolean(input.strings, this.defaultValue.strings),\n\t\t\t};\n\t\t\tif (opts.other && opts.comments && opts.strings) {\n\t\t\t\treturn true; // all on\n\t\t\t} else if (!opts.other && !opts.comments && !opts.strings) {\n\t\t\t\treturn false; // all off\n\t\t\t} else {\n\t\t\t\treturn opts;\n\t\t\t}\n\t\t}\n\t\treturn this.defaultValue;\n\t}\n}\n\n//#endregion\n\n//#region renderLineNumbers\n\nexport type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);\n\nexport const enum RenderLineNumbersType {\n\tOff = 0,\n\tOn = 1,\n\tRelative = 2,\n\tInterval = 3,\n\tCustom = 4\n}\n\nexport interface InternalEditorRenderLineNumbersOptions {\n\treadonly renderType: RenderLineNumbersType;\n\treadonly renderFn: ((lineNumber: number) => string) | null;\n}\n\nclass EditorRenderLineNumbersOption extends BaseEditorOption<EditorOption.lineNumbers, LineNumbersType, InternalEditorRenderLineNumbersOptions> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.lineNumbers, 'lineNumbers', { renderType: RenderLineNumbersType.On, renderFn: null },\n\t\t\t{\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['off', 'on', 'relative', 'interval'],\n\t\t\t\tenumDescriptions: [\n\t\t\t\t\tnls.localize('lineNumbers.off', \"Line numbers are not rendered.\"),\n\t\t\t\t\tnls.localize('lineNumbers.on', \"Line numbers are rendered as absolute number.\"),\n\t\t\t\t\tnls.localize('lineNumbers.relative', \"Line numbers are rendered as distance in lines to cursor position.\"),\n\t\t\t\t\tnls.localize('lineNumbers.interval', \"Line numbers are rendered every 10 lines.\")\n\t\t\t\t],\n\t\t\t\tdefault: 'on',\n\t\t\t\tdescription: nls.localize('lineNumbers', \"Controls the display of line numbers.\")\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(lineNumbers: any): InternalEditorRenderLineNumbersOptions {\n\t\tlet renderType: RenderLineNumbersType = this.defaultValue.renderType;\n\t\tlet renderFn: ((lineNumber: number) => string) | null = this.defaultValue.renderFn;\n\n\t\tif (typeof lineNumbers !== 'undefined') {\n\t\t\tif (typeof lineNumbers === 'function') {\n\t\t\t\trenderType = RenderLineNumbersType.Custom;\n\t\t\t\trenderFn = lineNumbers;\n\t\t\t} else if (lineNumbers === 'interval') {\n\t\t\t\trenderType = RenderLineNumbersType.Interval;\n\t\t\t} else if (lineNumbers === 'relative') {\n\t\t\t\trenderType = RenderLineNumbersType.Relative;\n\t\t\t} else if (lineNumbers === 'on') {\n\t\t\t\trenderType = RenderLineNumbersType.On;\n\t\t\t} else {\n\t\t\t\trenderType = RenderLineNumbersType.Off;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trenderType,\n\t\t\trenderFn\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region renderValidationDecorations\n\n/**\n * @internal\n */\nexport function filterValidationDecorations(options: IComputedEditorOptions): boolean {\n\tconst renderValidationDecorations = options.get(EditorOption.renderValidationDecorations);\n\tif (renderValidationDecorations === 'editable') {\n\t\treturn options.get(EditorOption.readOnly);\n\t}\n\treturn renderValidationDecorations === 'on' ? false : true;\n}\n\n//#endregion\n\n//#region rulers\n\nexport interface IRulerOption {\n\treadonly column: number;\n\treadonly color: string | null;\n}\n\nclass EditorRulers extends BaseEditorOption<EditorOption.rulers, (number | IRulerOption)[], IRulerOption[]> {\n\n\tconstructor() {\n\t\tconst defaults: IRulerOption[] = [];\n\t\tconst columnSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', \"Number of monospace characters at which this editor ruler will render.\") };\n\t\tsuper(\n\t\t\tEditorOption.rulers, 'rulers', defaults,\n\t\t\t{\n\t\t\t\ttype: 'array',\n\t\t\t\titems: {\n\t\t\t\t\tanyOf: [\n\t\t\t\t\t\tcolumnSchema,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: [\n\t\t\t\t\t\t\t\t'object'\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\tcolumn: columnSchema,\n\t\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\tdescription: nls.localize('rulers.color', \"Color of this editor ruler.\"),\n\t\t\t\t\t\t\t\t\tformat: 'color-hex'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\tdefault: defaults,\n\t\t\t\tdescription: nls.localize('rulers', \"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.\")\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(input: any): IRulerOption[] {\n\t\tif (Array.isArray(input)) {\n\t\t\tconst rulers: IRulerOption[] = [];\n\t\t\tfor (let _element of input) {\n\t\t\t\tif (typeof _element === 'number') {\n\t\t\t\t\trulers.push({\n\t\t\t\t\t\tcolumn: EditorIntOption.clampedInt(_element, 0, 0, 10000),\n\t\t\t\t\t\tcolor: null\n\t\t\t\t\t});\n\t\t\t\t} else if (_element && typeof _element === 'object') {\n\t\t\t\t\tconst element = _element as IRulerOption;\n\t\t\t\t\trulers.push({\n\t\t\t\t\t\tcolumn: EditorIntOption.clampedInt(element.column, 0, 0, 10000),\n\t\t\t\t\t\tcolor: element.color\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\trulers.sort((a, b) => a.column - b.column);\n\t\t\treturn rulers;\n\t\t}\n\t\treturn this.defaultValue;\n\t}\n}\n\n//#endregion\n\n//#region scrollbar\n\n/**\n * Configuration options for editor scrollbars\n */\nexport interface IEditorScrollbarOptions {\n\t/**\n\t * The size of arrows (if displayed).\n\t * Defaults to 11.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\tarrowSize?: number;\n\t/**\n\t * Render vertical scrollbar.\n\t * Defaults to 'auto'.\n\t */\n\tvertical?: 'auto' | 'visible' | 'hidden';\n\t/**\n\t * Render horizontal scrollbar.\n\t * Defaults to 'auto'.\n\t */\n\thorizontal?: 'auto' | 'visible' | 'hidden';\n\t/**\n\t * Cast horizontal and vertical shadows when the content is scrolled.\n\t * Defaults to true.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\tuseShadows?: boolean;\n\t/**\n\t * Render arrows at the top and bottom of the vertical scrollbar.\n\t * Defaults to false.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\tverticalHasArrows?: boolean;\n\t/**\n\t * Render arrows at the left and right of the horizontal scrollbar.\n\t * Defaults to false.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\thorizontalHasArrows?: boolean;\n\t/**\n\t * Listen to mouse wheel events and react to them by scrolling.\n\t * Defaults to true.\n\t */\n\thandleMouseWheel?: boolean;\n\t/**\n\t * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events).\n\t * Defaults to true.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\talwaysConsumeMouseWheel?: boolean;\n\t/**\n\t * Height in pixels for the horizontal scrollbar.\n\t * Defaults to 10 (px).\n\t */\n\thorizontalScrollbarSize?: number;\n\t/**\n\t * Width in pixels for the vertical scrollbar.\n\t * Defaults to 10 (px).\n\t */\n\tverticalScrollbarSize?: number;\n\t/**\n\t * Width in pixels for the vertical slider.\n\t * Defaults to `verticalScrollbarSize`.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\tverticalSliderSize?: number;\n\t/**\n\t * Height in pixels for the horizontal slider.\n\t * Defaults to `horizontalScrollbarSize`.\n\t * **NOTE**: This option cannot be updated using `updateOptions()`\n\t */\n\thorizontalSliderSize?: number;\n\t/**\n\t * Scroll gutter clicks move by page vs jump to position.\n\t * Defaults to false.\n\t */\n\tscrollByPage?: boolean;\n}\n\nexport interface InternalEditorScrollbarOptions {\n\treadonly arrowSize: number;\n\treadonly vertical: ScrollbarVisibility;\n\treadonly horizontal: ScrollbarVisibility;\n\treadonly useShadows: boolean;\n\treadonly verticalHasArrows: boolean;\n\treadonly horizontalHasArrows: boolean;\n\treadonly handleMouseWheel: boolean;\n\treadonly alwaysConsumeMouseWheel: boolean;\n\treadonly horizontalScrollbarSize: number;\n\treadonly horizontalSliderSize: number;\n\treadonly verticalScrollbarSize: number;\n\treadonly verticalSliderSize: number;\n\treadonly scrollByPage: boolean;\n}\n\nfunction _scrollbarVisibilityFromString(visibility: string | undefined, defaultValue: ScrollbarVisibility): ScrollbarVisibility {\n\tif (typeof visibility !== 'string') {\n\t\treturn defaultValue;\n\t}\n\tswitch (visibility) {\n\t\tcase 'hidden': return ScrollbarVisibility.Hidden;\n\t\tcase 'visible': return ScrollbarVisibility.Visible;\n\t\tdefault: return ScrollbarVisibility.Auto;\n\t}\n}\n\nclass EditorScrollbar extends BaseEditorOption<EditorOption.scrollbar, IEditorScrollbarOptions, InternalEditorScrollbarOptions> {\n\n\tconstructor() {\n\t\tconst defaults: InternalEditorScrollbarOptions = {\n\t\t\tvertical: ScrollbarVisibility.Auto,\n\t\t\thorizontal: ScrollbarVisibility.Auto,\n\t\t\tarrowSize: 11,\n\t\t\tuseShadows: true,\n\t\t\tverticalHasArrows: false,\n\t\t\thorizontalHasArrows: false,\n\t\t\thorizontalScrollbarSize: 12,\n\t\t\thorizontalSliderSize: 12,\n\t\t\tverticalScrollbarSize: 14,\n\t\t\tverticalSliderSize: 14,\n\t\t\thandleMouseWheel: true,\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t\tscrollByPage: false\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.scrollbar, 'scrollbar', defaults,\n\t\t\t{\n\t\t\t\t'editor.scrollbar.vertical': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['auto', 'visible', 'hidden'],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('scrollbar.vertical.auto', \"The vertical scrollbar will be visible only when necessary.\"),\n\t\t\t\t\t\tnls.localize('scrollbar.vertical.visible', \"The vertical scrollbar will always be visible.\"),\n\t\t\t\t\t\tnls.localize('scrollbar.vertical.fit', \"The vertical scrollbar will always be hidden.\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\tdescription: nls.localize('scrollbar.vertical', \"Controls the visibility of the vertical scrollbar.\")\n\t\t\t\t},\n\t\t\t\t'editor.scrollbar.horizontal': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['auto', 'visible', 'hidden'],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('scrollbar.horizontal.auto', \"The horizontal scrollbar will be visible only when necessary.\"),\n\t\t\t\t\t\tnls.localize('scrollbar.horizontal.visible', \"The horizontal scrollbar will always be visible.\"),\n\t\t\t\t\t\tnls.localize('scrollbar.horizontal.fit', \"The horizontal scrollbar will always be hidden.\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\tdescription: nls.localize('scrollbar.horizontal', \"Controls the visibility of the horizontal scrollbar.\")\n\t\t\t\t},\n\t\t\t\t'editor.scrollbar.verticalScrollbarSize': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.verticalScrollbarSize,\n\t\t\t\t\tdescription: nls.localize('scrollbar.verticalScrollbarSize', \"The width of the vertical scrollbar.\")\n\t\t\t\t},\n\t\t\t\t'editor.scrollbar.horizontalScrollbarSize': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: defaults.horizontalScrollbarSize,\n\t\t\t\t\tdescription: nls.localize('scrollbar.horizontalScrollbarSize', \"The height of the horizontal scrollbar.\")\n\t\t\t\t},\n\t\t\t\t'editor.scrollbar.scrollByPage': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.scrollByPage,\n\t\t\t\t\tdescription: nls.localize('scrollbar.scrollByPage', \"Controls whether clicks scroll by page or jump to click position.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalEditorScrollbarOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IEditorScrollbarOptions;\n\t\tconst horizontalScrollbarSize = EditorIntOption.clampedInt(input.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1000);\n\t\tconst verticalScrollbarSize = EditorIntOption.clampedInt(input.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1000);\n\t\treturn {\n\t\t\tarrowSize: EditorIntOption.clampedInt(input.arrowSize, this.defaultValue.arrowSize, 0, 1000),\n\t\t\tvertical: _scrollbarVisibilityFromString(input.vertical, this.defaultValue.vertical),\n\t\t\thorizontal: _scrollbarVisibilityFromString(input.horizontal, this.defaultValue.horizontal),\n\t\t\tuseShadows: boolean(input.useShadows, this.defaultValue.useShadows),\n\t\t\tverticalHasArrows: boolean(input.verticalHasArrows, this.defaultValue.verticalHasArrows),\n\t\t\thorizontalHasArrows: boolean(input.horizontalHasArrows, this.defaultValue.horizontalHasArrows),\n\t\t\thandleMouseWheel: boolean(input.handleMouseWheel, this.defaultValue.handleMouseWheel),\n\t\t\talwaysConsumeMouseWheel: boolean(input.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel),\n\t\t\thorizontalScrollbarSize: horizontalScrollbarSize,\n\t\t\thorizontalSliderSize: EditorIntOption.clampedInt(input.horizontalSliderSize, horizontalScrollbarSize, 0, 1000),\n\t\t\tverticalScrollbarSize: verticalScrollbarSize,\n\t\t\tverticalSliderSize: EditorIntOption.clampedInt(input.verticalSliderSize, verticalScrollbarSize, 0, 1000),\n\t\t\tscrollByPage: boolean(input.scrollByPage, this.defaultValue.scrollByPage),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region UnicodeHighlight\n\nexport type InUntrustedWorkspace = 'inUntrustedWorkspace';\n\n/**\n * @internal\n*/\nexport const inUntrustedWorkspace: InUntrustedWorkspace = 'inUntrustedWorkspace';\n\n/**\n * Configuration options for unicode highlighting.\n */\nexport interface IUnicodeHighlightOptions {\n\n\t/**\n\t * Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.\n\t */\n\tnonBasicASCII?: boolean | InUntrustedWorkspace;\n\n\t/**\n\t * Controls whether characters that just reserve space or have no width at all are highlighted.\n\t */\n\tinvisibleCharacters?: boolean;\n\n\t/**\n\t * Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.\n\t */\n\tambiguousCharacters?: boolean;\n\n\t/**\n\t * Controls whether characters in comments should also be subject to unicode highlighting.\n\t */\n\tincludeComments?: boolean | InUntrustedWorkspace;\n\n\t/**\n\t * Controls whether characters in strings should also be subject to unicode highlighting.\n\t */\n\tincludeStrings?: boolean | InUntrustedWorkspace;\n\n\t/**\n\t * Defines allowed characters that are not being highlighted.\n\t */\n\tallowedCharacters?: Record<string, true>;\n\n\t/**\n\t * Unicode characters that are common in allowed locales are not being highlighted.\n\t */\n\tallowedLocales?: Record<string | '_os' | '_vscode', true>;\n}\n\n/**\n * @internal\n */\nexport type InternalUnicodeHighlightOptions = Required<Readonly<IUnicodeHighlightOptions>>;\n\n/**\n * @internal\n */\nexport const unicodeHighlightConfigKeys = {\n\tallowedCharacters: 'editor.unicodeHighlight.allowedCharacters',\n\tinvisibleCharacters: 'editor.unicodeHighlight.invisibleCharacters',\n\tnonBasicASCII: 'editor.unicodeHighlight.nonBasicASCII',\n\tambiguousCharacters: 'editor.unicodeHighlight.ambiguousCharacters',\n\tincludeComments: 'editor.unicodeHighlight.includeComments',\n\tincludeStrings: 'editor.unicodeHighlight.includeStrings',\n\tallowedLocales: 'editor.unicodeHighlight.allowedLocales',\n};\n\nclass UnicodeHighlight extends BaseEditorOption<EditorOption.unicodeHighlighting, IUnicodeHighlightOptions, InternalUnicodeHighlightOptions> {\n\tconstructor() {\n\t\tconst defaults: InternalUnicodeHighlightOptions = {\n\t\t\tnonBasicASCII: inUntrustedWorkspace,\n\t\t\tinvisibleCharacters: true,\n\t\t\tambiguousCharacters: true,\n\t\t\tincludeComments: inUntrustedWorkspace,\n\t\t\tincludeStrings: true,\n\t\t\tallowedCharacters: {},\n\t\t\tallowedLocales: { _os: true, _vscode: true },\n\t\t};\n\n\t\tsuper(\n\t\t\tEditorOption.unicodeHighlighting, 'unicodeHighlight', defaults,\n\t\t\t{\n\t\t\t\t[unicodeHighlightConfigKeys.nonBasicASCII]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: ['boolean', 'string'],\n\t\t\t\t\tenum: [true, false, inUntrustedWorkspace],\n\t\t\t\t\tdefault: defaults.nonBasicASCII,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.nonBasicASCII', \"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.\")\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.invisibleCharacters]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.invisibleCharacters,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.invisibleCharacters', \"Controls whether characters that just reserve space or have no width at all are highlighted.\")\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.ambiguousCharacters]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.ambiguousCharacters,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.ambiguousCharacters', \"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.\")\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.includeComments]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: ['boolean', 'string'],\n\t\t\t\t\tenum: [true, false, inUntrustedWorkspace],\n\t\t\t\t\tdefault: defaults.includeComments,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.includeComments', \"Controls whether characters in comments should also be subject to unicode highlighting.\")\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.includeStrings]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: ['boolean', 'string'],\n\t\t\t\t\tenum: [true, false, inUntrustedWorkspace],\n\t\t\t\t\tdefault: defaults.includeStrings,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.includeStrings', \"Controls whether characters in strings should also be subject to unicode highlighting.\")\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.allowedCharacters]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tdefault: defaults.allowedCharacters,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.allowedCharacters', \"Defines allowed characters that are not being highlighted.\"),\n\t\t\t\t\tadditionalProperties: {\n\t\t\t\t\t\ttype: 'boolean'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t[unicodeHighlightConfigKeys.allowedLocales]: {\n\t\t\t\t\trestricted: true,\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tadditionalProperties: {\n\t\t\t\t\t\ttype: 'boolean'\n\t\t\t\t\t},\n\t\t\t\t\tdefault: defaults.allowedLocales,\n\t\t\t\t\tdescription: nls.localize('unicodeHighlight.allowedLocales', \"Unicode characters that are common in allowed locales are not being highlighted.\")\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic override applyUpdate(value: Required<Readonly<IUnicodeHighlightOptions>>, update: Required<Readonly<IUnicodeHighlightOptions>>): ApplyUpdateResult<Required<Readonly<IUnicodeHighlightOptions>>> {\n\t\tlet didChange = false;\n\t\tif (update.allowedCharacters) {\n\t\t\t// Treat allowedCharacters atomically\n\t\t\tif (!objects.equals(value.allowedCharacters, update.allowedCharacters)) {\n\t\t\t\tvalue = { ...value, allowedCharacters: update.allowedCharacters };\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t\tif (update.allowedLocales) {\n\t\t\t// Treat allowedLocales atomically\n\t\t\tif (!objects.equals(value.allowedLocales, update.allowedLocales)) {\n\t\t\t\tvalue = { ...value, allowedLocales: update.allowedLocales };\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\n\t\tconst result = super.applyUpdate(value, update);\n\t\tif (didChange) {\n\t\t\treturn new ApplyUpdateResult(result.newValue, true);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic validate(_input: any): InternalUnicodeHighlightOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IUnicodeHighlightOptions;\n\t\treturn {\n\t\t\tnonBasicASCII: primitiveSet<boolean | InUntrustedWorkspace>(input.nonBasicASCII, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n\t\t\tinvisibleCharacters: boolean(input.invisibleCharacters, this.defaultValue.invisibleCharacters),\n\t\t\tambiguousCharacters: boolean(input.ambiguousCharacters, this.defaultValue.ambiguousCharacters),\n\t\t\tincludeComments: primitiveSet<boolean | InUntrustedWorkspace>(input.includeComments, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n\t\t\tincludeStrings: primitiveSet<boolean | InUntrustedWorkspace>(input.includeStrings, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n\t\t\tallowedCharacters: this.validateBooleanMap(_input.allowedCharacters, this.defaultValue.allowedCharacters),\n\t\t\tallowedLocales: this.validateBooleanMap(_input.allowedLocales, this.defaultValue.allowedLocales),\n\t\t};\n\t}\n\n\tprivate validateBooleanMap(map: unknown, defaultValue: Record<string, true>): Record<string, true> {\n\t\tif ((typeof map !== 'object') || !map) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tconst result: Record<string, true> = {};\n\t\tfor (const [key, value] of Object.entries(map)) {\n\t\t\tif (value === true) {\n\t\t\t\tresult[key] = true;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\n//#endregion\n\n//#region inlineSuggest\n\nexport interface IInlineSuggestOptions {\n\t/**\n\t * Enable or disable the rendering of automatic inline completions.\n\t*/\n\tenabled?: boolean;\n\n\t/**\n\t * Configures the mode.\n\t * Use `prefix` to only show ghost text if the text to replace is a prefix of the suggestion text.\n\t * Use `subword` to only show ghost text if the replace text is a subword of the suggestion text.\n\t * Use `subwordSmart` to only show ghost text if the replace text is a subword of the suggestion text, but the subword must start after the cursor position.\n\t * Defaults to `prefix`.\n\t*/\n\tmode?: 'prefix' | 'subword' | 'subwordSmart';\n}\n\n/**\n * @internal\n */\nexport type InternalInlineSuggestOptions = Readonly<Required<IInlineSuggestOptions>>;\n\n/**\n * Configuration options for inline suggestions\n */\nclass InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, IInlineSuggestOptions, InternalInlineSuggestOptions> {\n\tconstructor() {\n\t\tconst defaults: InternalInlineSuggestOptions = {\n\t\t\tenabled: true,\n\t\t\tmode: 'subwordSmart'\n\t\t};\n\n\t\tsuper(\n\t\t\tEditorOption.inlineSuggest, 'inlineSuggest', defaults,\n\t\t\t{\n\t\t\t\t'editor.inlineSuggest.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('inlineSuggest.enabled', \"Controls whether to automatically show inline suggestions in the editor.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalInlineSuggestOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IInlineSuggestOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled),\n\t\t\tmode: stringSet(input.mode, this.defaultValue.mode, ['prefix', 'subword', 'subwordSmart']),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region bracketPairColorization\n\nexport interface IBracketPairColorizationOptions {\n\t/**\n\t * Enable or disable bracket pair colorization.\n\t*/\n\tenabled?: boolean;\n}\n\n/**\n * @internal\n */\nexport type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;\n\n/**\n * Configuration options for inline suggestions\n */\nclass BracketPairColorization extends BaseEditorOption<EditorOption.bracketPairColorization, IBracketPairColorizationOptions, InternalBracketPairColorizationOptions> {\n\tconstructor() {\n\t\tconst defaults: InternalBracketPairColorizationOptions = {\n\t\t\tenabled: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled\n\t\t};\n\n\t\tsuper(\n\t\t\tEditorOption.bracketPairColorization, 'bracketPairColorization', defaults,\n\t\t\t{\n\t\t\t\t'editor.bracketPairColorization.enabled': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.enabled,\n\t\t\t\t\tdescription: nls.localize('bracketPairColorization.enabled', \"Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalBracketPairColorizationOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IBracketPairColorizationOptions;\n\t\treturn {\n\t\t\tenabled: boolean(input.enabled, this.defaultValue.enabled)\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region guides\n\nexport interface IGuidesOptions {\n\t/**\n\t * Enable rendering of bracket pair guides.\n\t * Defaults to false.\n\t*/\n\tbracketPairs?: boolean | 'active';\n\n\t/**\n\t * Enable rendering of vertical bracket pair guides.\n\t * Defaults to 'active'.\n\t */\n\tbracketPairsHorizontal?: boolean | 'active';\n\n\t/**\n\t * Enable highlighting of the active bracket pair.\n\t * Defaults to true.\n\t*/\n\thighlightActiveBracketPair?: boolean;\n\n\t/**\n\t * Enable rendering of indent guides.\n\t * Defaults to true.\n\t */\n\tindentation?: boolean;\n\n\t/**\n\t * Enable highlighting of the active indent guide.\n\t * Defaults to true.\n\t */\n\thighlightActiveIndentation?: boolean;\n}\n\n/**\n * @internal\n */\nexport type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;\n\n/**\n * Configuration options for inline suggestions\n */\nclass GuideOptions extends BaseEditorOption<EditorOption.guides, IGuidesOptions, InternalGuidesOptions> {\n\tconstructor() {\n\t\tconst defaults: InternalGuidesOptions = {\n\t\t\tbracketPairs: false,\n\t\t\tbracketPairsHorizontal: 'active',\n\t\t\thighlightActiveBracketPair: true,\n\n\t\t\tindentation: true,\n\t\t\thighlightActiveIndentation: true\n\t\t};\n\n\t\tsuper(\n\t\t\tEditorOption.guides, 'guides', defaults,\n\t\t\t{\n\t\t\t\t'editor.guides.bracketPairs': {\n\t\t\t\t\ttype: ['boolean', 'string'],\n\t\t\t\t\tenum: [true, 'active', false],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairs.true', \"Enables bracket pair guides.\"),\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairs.active', \"Enables bracket pair guides only for the active bracket pair.\"),\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairs.false', \"Disables bracket pair guides.\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: defaults.bracketPairs,\n\t\t\t\t\tdescription: nls.localize('editor.guides.bracketPairs', \"Controls whether bracket pair guides are enabled or not.\")\n\t\t\t\t},\n\t\t\t\t'editor.guides.bracketPairsHorizontal': {\n\t\t\t\t\ttype: ['boolean', 'string'],\n\t\t\t\t\tenum: [true, 'active', false],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairsHorizontal.true', \"Enables horizontal guides as addition to vertical bracket pair guides.\"),\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairsHorizontal.active', \"Enables horizontal guides only for the active bracket pair.\"),\n\t\t\t\t\t\tnls.localize('editor.guides.bracketPairsHorizontal.false', \"Disables horizontal bracket pair guides.\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: defaults.bracketPairsHorizontal,\n\t\t\t\t\tdescription: nls.localize('editor.guides.bracketPairsHorizontal', \"Controls whether horizontal bracket pair guides are enabled or not.\")\n\t\t\t\t},\n\t\t\t\t'editor.guides.highlightActiveBracketPair': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.highlightActiveBracketPair,\n\t\t\t\t\tdescription: nls.localize('editor.guides.highlightActiveBracketPair', \"Controls whether the editor should highlight the active bracket pair.\")\n\t\t\t\t},\n\t\t\t\t'editor.guides.indentation': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.indentation,\n\t\t\t\t\tdescription: nls.localize('editor.guides.indentation', \"Controls whether the editor should render indent guides.\")\n\t\t\t\t},\n\t\t\t\t'editor.guides.highlightActiveIndentation': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.highlightActiveIndentation,\n\t\t\t\t\tdescription: nls.localize('editor.guides.highlightActiveIndentation', \"Controls whether the editor should highlight the active indent guide.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalGuidesOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as IGuidesOptions;\n\t\treturn {\n\t\t\tbracketPairs: primitiveSet(input.bracketPairs, this.defaultValue.bracketPairs, [true, false, 'active']),\n\t\t\tbracketPairsHorizontal: primitiveSet(input.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, [true, false, 'active']),\n\t\t\thighlightActiveBracketPair: boolean(input.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),\n\n\t\t\tindentation: boolean(input.indentation, this.defaultValue.indentation),\n\t\t\thighlightActiveIndentation: boolean(input.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation),\n\t\t};\n\t}\n}\n\nfunction primitiveSet<T extends string | boolean>(value: unknown, defaultValue: T, allowedValues: T[]): T {\n\tconst idx = allowedValues.indexOf(value as any);\n\tif (idx === -1) {\n\t\treturn defaultValue;\n\t}\n\treturn allowedValues[idx];\n}\n\n//#endregion\n\n//#region suggest\n\n/**\n * Configuration options for editor suggest widget\n */\nexport interface ISuggestOptions {\n\t/**\n\t * Overwrite word ends on accept. Default to false.\n\t */\n\tinsertMode?: 'insert' | 'replace';\n\t/**\n\t * Enable graceful matching. Defaults to true.\n\t */\n\tfilterGraceful?: boolean;\n\t/**\n\t * Prevent quick suggestions when a snippet is active. Defaults to true.\n\t */\n\tsnippetsPreventQuickSuggestions?: boolean;\n\t/**\n\t * Favors words that appear close to the cursor.\n\t */\n\tlocalityBonus?: boolean;\n\t/**\n\t * Enable using global storage for remembering suggestions.\n\t */\n\tshareSuggestSelections?: boolean;\n\t/**\n\t * Enable or disable icons in suggestions. Defaults to true.\n\t */\n\tshowIcons?: boolean;\n\t/**\n\t * Enable or disable the suggest status bar.\n\t */\n\tshowStatusBar?: boolean;\n\t/**\n\t * Enable or disable the rendering of the suggestion preview.\n\t */\n\tpreview?: boolean;\n\t/**\n\t * Configures the mode of the preview.\n\t*/\n\tpreviewMode?: 'prefix' | 'subword' | 'subwordSmart';\n\t/**\n\t * Show details inline with the label. Defaults to true.\n\t */\n\tshowInlineDetails?: boolean;\n\t/**\n\t * Show method-suggestions.\n\t */\n\tshowMethods?: boolean;\n\t/**\n\t * Show function-suggestions.\n\t */\n\tshowFunctions?: boolean;\n\t/**\n\t * Show constructor-suggestions.\n\t */\n\tshowConstructors?: boolean;\n\t/**\n\t * Show deprecated-suggestions.\n\t */\n\tshowDeprecated?: boolean;\n\t/**\n\t * Show field-suggestions.\n\t */\n\tshowFields?: boolean;\n\t/**\n\t * Show variable-suggestions.\n\t */\n\tshowVariables?: boolean;\n\t/**\n\t * Show class-suggestions.\n\t */\n\tshowClasses?: boolean;\n\t/**\n\t * Show struct-suggestions.\n\t */\n\tshowStructs?: boolean;\n\t/**\n\t * Show interface-suggestions.\n\t */\n\tshowInterfaces?: boolean;\n\t/**\n\t * Show module-suggestions.\n\t */\n\tshowModules?: boolean;\n\t/**\n\t * Show property-suggestions.\n\t */\n\tshowProperties?: boolean;\n\t/**\n\t * Show event-suggestions.\n\t */\n\tshowEvents?: boolean;\n\t/**\n\t * Show operator-suggestions.\n\t */\n\tshowOperators?: boolean;\n\t/**\n\t * Show unit-suggestions.\n\t */\n\tshowUnits?: boolean;\n\t/**\n\t * Show value-suggestions.\n\t */\n\tshowValues?: boolean;\n\t/**\n\t * Show constant-suggestions.\n\t */\n\tshowConstants?: boolean;\n\t/**\n\t * Show enum-suggestions.\n\t */\n\tshowEnums?: boolean;\n\t/**\n\t * Show enumMember-suggestions.\n\t */\n\tshowEnumMembers?: boolean;\n\t/**\n\t * Show keyword-suggestions.\n\t */\n\tshowKeywords?: boolean;\n\t/**\n\t * Show text-suggestions.\n\t */\n\tshowWords?: boolean;\n\t/**\n\t * Show color-suggestions.\n\t */\n\tshowColors?: boolean;\n\t/**\n\t * Show file-suggestions.\n\t */\n\tshowFiles?: boolean;\n\t/**\n\t * Show reference-suggestions.\n\t */\n\tshowReferences?: boolean;\n\t/**\n\t * Show folder-suggestions.\n\t */\n\tshowFolders?: boolean;\n\t/**\n\t * Show typeParameter-suggestions.\n\t */\n\tshowTypeParameters?: boolean;\n\t/**\n\t * Show issue-suggestions.\n\t */\n\tshowIssues?: boolean;\n\t/**\n\t * Show user-suggestions.\n\t */\n\tshowUsers?: boolean;\n\t/**\n\t * Show snippet-suggestions.\n\t */\n\tshowSnippets?: boolean;\n}\n\n/**\n * @internal\n */\nexport type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;\n\nclass EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptions, InternalSuggestOptions> {\n\n\tconstructor() {\n\t\tconst defaults: InternalSuggestOptions = {\n\t\t\tinsertMode: 'insert',\n\t\t\tfilterGraceful: true,\n\t\t\tsnippetsPreventQuickSuggestions: true,\n\t\t\tlocalityBonus: false,\n\t\t\tshareSuggestSelections: false,\n\t\t\tshowIcons: true,\n\t\t\tshowStatusBar: false,\n\t\t\tpreview: false,\n\t\t\tpreviewMode: 'subwordSmart',\n\t\t\tshowInlineDetails: true,\n\t\t\tshowMethods: true,\n\t\t\tshowFunctions: true,\n\t\t\tshowConstructors: true,\n\t\t\tshowDeprecated: true,\n\t\t\tshowFields: true,\n\t\t\tshowVariables: true,\n\t\t\tshowClasses: true,\n\t\t\tshowStructs: true,\n\t\t\tshowInterfaces: true,\n\t\t\tshowModules: true,\n\t\t\tshowProperties: true,\n\t\t\tshowEvents: true,\n\t\t\tshowOperators: true,\n\t\t\tshowUnits: true,\n\t\t\tshowValues: true,\n\t\t\tshowConstants: true,\n\t\t\tshowEnums: true,\n\t\t\tshowEnumMembers: true,\n\t\t\tshowKeywords: true,\n\t\t\tshowWords: true,\n\t\t\tshowColors: true,\n\t\t\tshowFiles: true,\n\t\t\tshowReferences: true,\n\t\t\tshowFolders: true,\n\t\t\tshowTypeParameters: true,\n\t\t\tshowSnippets: true,\n\t\t\tshowUsers: true,\n\t\t\tshowIssues: true,\n\t\t};\n\t\tsuper(\n\t\t\tEditorOption.suggest, 'suggest', defaults,\n\t\t\t{\n\t\t\t\t'editor.suggest.insertMode': {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tenum: ['insert', 'replace'],\n\t\t\t\t\tenumDescriptions: [\n\t\t\t\t\t\tnls.localize('suggest.insertMode.insert', \"Insert suggestion without overwriting text right of the cursor.\"),\n\t\t\t\t\t\tnls.localize('suggest.insertMode.replace', \"Insert suggestion and overwrite text right of the cursor.\"),\n\t\t\t\t\t],\n\t\t\t\t\tdefault: defaults.insertMode,\n\t\t\t\t\tdescription: nls.localize('suggest.insertMode', \"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.filterGraceful': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.filterGraceful,\n\t\t\t\t\tdescription: nls.localize('suggest.filterGraceful', \"Controls whether filtering and sorting suggestions accounts for small typos.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.localityBonus': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.localityBonus,\n\t\t\t\t\tdescription: nls.localize('suggest.localityBonus', \"Controls whether sorting favors words that appear close to the cursor.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.shareSuggestSelections': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.shareSuggestSelections,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.shareSuggestSelections', \"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.snippetsPreventQuickSuggestions': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.snippetsPreventQuickSuggestions,\n\t\t\t\t\tdescription: nls.localize('suggest.snippetsPreventQuickSuggestions', \"Controls whether an active snippet prevents quick suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showIcons': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.showIcons,\n\t\t\t\t\tdescription: nls.localize('suggest.showIcons', \"Controls whether to show or hide icons in suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showStatusBar': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.showStatusBar,\n\t\t\t\t\tdescription: nls.localize('suggest.showStatusBar', \"Controls the visibility of the status bar at the bottom of the suggest widget.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.preview': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.preview,\n\t\t\t\t\tdescription: nls.localize('suggest.preview', \"Controls whether to preview the suggestion outcome in the editor.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showInlineDetails': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: defaults.showInlineDetails,\n\t\t\t\t\tdescription: nls.localize('suggest.showInlineDetails', \"Controls whether suggest details show inline with the label or only in the details widget\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.maxVisibleSuggestions': {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdeprecationMessage: nls.localize('suggest.maxVisibleSuggestions.dep', \"This setting is deprecated. The suggest widget can now be resized.\"),\n\t\t\t\t},\n\t\t\t\t'editor.suggest.filteredTypes': {\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tdeprecationMessage: nls.localize('deprecated', \"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showMethods': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showMethods', \"When enabled IntelliSense shows `method`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showFunctions': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showFunctions', \"When enabled IntelliSense shows `function`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showConstructors': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showConstructors', \"When enabled IntelliSense shows `constructor`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showDeprecated': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showDeprecated', \"When enabled IntelliSense shows `deprecated`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showFields': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showFields', \"When enabled IntelliSense shows `field`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showVariables': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showVariables', \"When enabled IntelliSense shows `variable`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showClasses': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showClasss', \"When enabled IntelliSense shows `class`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showStructs': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showStructs', \"When enabled IntelliSense shows `struct`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showInterfaces': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showInterfaces', \"When enabled IntelliSense shows `interface`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showModules': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showModules', \"When enabled IntelliSense shows `module`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showProperties': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showPropertys', \"When enabled IntelliSense shows `property`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showEvents': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showEvents', \"When enabled IntelliSense shows `event`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showOperators': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showOperators', \"When enabled IntelliSense shows `operator`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showUnits': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showUnits', \"When enabled IntelliSense shows `unit`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showValues': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showValues', \"When enabled IntelliSense shows `value`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showConstants': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showConstants', \"When enabled IntelliSense shows `constant`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showEnums': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showEnums', \"When enabled IntelliSense shows `enum`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showEnumMembers': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showEnumMembers', \"When enabled IntelliSense shows `enumMember`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showKeywords': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showKeywords', \"When enabled IntelliSense shows `keyword`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showWords': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showTexts', \"When enabled IntelliSense shows `text`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showColors': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showColors', \"When enabled IntelliSense shows `color`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showFiles': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showFiles', \"When enabled IntelliSense shows `file`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showReferences': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showReferences', \"When enabled IntelliSense shows `reference`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showCustomcolors': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showCustomcolors', \"When enabled IntelliSense shows `customcolor`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showFolders': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showFolders', \"When enabled IntelliSense shows `folder`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showTypeParameters': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showTypeParameters', \"When enabled IntelliSense shows `typeParameter`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showSnippets': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showSnippets', \"When enabled IntelliSense shows `snippet`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showUsers': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showUsers', \"When enabled IntelliSense shows `user`-suggestions.\")\n\t\t\t\t},\n\t\t\t\t'editor.suggest.showIssues': {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('editor.suggest.showIssues', \"When enabled IntelliSense shows `issues`-suggestions.\")\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(_input: any): InternalSuggestOptions {\n\t\tif (!_input || typeof _input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\tconst input = _input as ISuggestOptions;\n\t\treturn {\n\t\t\tinsertMode: stringSet(input.insertMode, this.defaultValue.insertMode, ['insert', 'replace']),\n\t\t\tfilterGraceful: boolean(input.filterGraceful, this.defaultValue.filterGraceful),\n\t\t\tsnippetsPreventQuickSuggestions: boolean(input.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful),\n\t\t\tlocalityBonus: boolean(input.localityBonus, this.defaultValue.localityBonus),\n\t\t\tshareSuggestSelections: boolean(input.shareSuggestSelections, this.defaultValue.shareSuggestSelections),\n\t\t\tshowIcons: boolean(input.showIcons, this.defaultValue.showIcons),\n\t\t\tshowStatusBar: boolean(input.showStatusBar, this.defaultValue.showStatusBar),\n\t\t\tpreview: boolean(input.preview, this.defaultValue.preview),\n\t\t\tpreviewMode: stringSet(input.previewMode, this.defaultValue.previewMode, ['prefix', 'subword', 'subwordSmart']),\n\t\t\tshowInlineDetails: boolean(input.showInlineDetails, this.defaultValue.showInlineDetails),\n\t\t\tshowMethods: boolean(input.showMethods, this.defaultValue.showMethods),\n\t\t\tshowFunctions: boolean(input.showFunctions, this.defaultValue.showFunctions),\n\t\t\tshowConstructors: boolean(input.showConstructors, this.defaultValue.showConstructors),\n\t\t\tshowDeprecated: boolean(input.showDeprecated, this.defaultValue.showDeprecated),\n\t\t\tshowFields: boolean(input.showFields, this.defaultValue.showFields),\n\t\t\tshowVariables: boolean(input.showVariables, this.defaultValue.showVariables),\n\t\t\tshowClasses: boolean(input.showClasses, this.defaultValue.showClasses),\n\t\t\tshowStructs: boolean(input.showStructs, this.defaultValue.showStructs),\n\t\t\tshowInterfaces: boolean(input.showInterfaces, this.defaultValue.showInterfaces),\n\t\t\tshowModules: boolean(input.showModules, this.defaultValue.showModules),\n\t\t\tshowProperties: boolean(input.showProperties, this.defaultValue.showProperties),\n\t\t\tshowEvents: boolean(input.showEvents, this.defaultValue.showEvents),\n\t\t\tshowOperators: boolean(input.showOperators, this.defaultValue.showOperators),\n\t\t\tshowUnits: boolean(input.showUnits, this.defaultValue.showUnits),\n\t\t\tshowValues: boolean(input.showValues, this.defaultValue.showValues),\n\t\t\tshowConstants: boolean(input.showConstants, this.defaultValue.showConstants),\n\t\t\tshowEnums: boolean(input.showEnums, this.defaultValue.showEnums),\n\t\t\tshowEnumMembers: boolean(input.showEnumMembers, this.defaultValue.showEnumMembers),\n\t\t\tshowKeywords: boolean(input.showKeywords, this.defaultValue.showKeywords),\n\t\t\tshowWords: boolean(input.showWords, this.defaultValue.showWords),\n\t\t\tshowColors: boolean(input.showColors, this.defaultValue.showColors),\n\t\t\tshowFiles: boolean(input.showFiles, this.defaultValue.showFiles),\n\t\t\tshowReferences: boolean(input.showReferences, this.defaultValue.showReferences),\n\t\t\tshowFolders: boolean(input.showFolders, this.defaultValue.showFolders),\n\t\t\tshowTypeParameters: boolean(input.showTypeParameters, this.defaultValue.showTypeParameters),\n\t\t\tshowSnippets: boolean(input.showSnippets, this.defaultValue.showSnippets),\n\t\t\tshowUsers: boolean(input.showUsers, this.defaultValue.showUsers),\n\t\t\tshowIssues: boolean(input.showIssues, this.defaultValue.showIssues),\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region smart select\n\nexport interface ISmartSelectOptions {\n\tselectLeadingAndTrailingWhitespace?: boolean;\n}\n\n/**\n * @internal\n */\nexport type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;\n\nclass SmartSelect extends BaseEditorOption<EditorOption.smartSelect, ISmartSelectOptions, SmartSelectOptions> {\n\n\tconstructor() {\n\t\tsuper(\n\t\t\tEditorOption.smartSelect, 'smartSelect',\n\t\t\t{\n\t\t\t\tselectLeadingAndTrailingWhitespace: true\n\t\t\t},\n\t\t\t{\n\t\t\t\t'editor.smartSelect.selectLeadingAndTrailingWhitespace': {\n\t\t\t\t\tdescription: nls.localize('selectLeadingAndTrailingWhitespace', \"Whether leading and trailing whitespace should always be selected.\"),\n\t\t\t\t\tdefault: true,\n\t\t\t\t\ttype: 'boolean'\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validate(input: any): Readonly<Required<ISmartSelectOptions>> {\n\t\tif (!input || typeof input !== 'object') {\n\t\t\treturn this.defaultValue;\n\t\t}\n\t\treturn {\n\t\t\tselectLeadingAndTrailingWhitespace: boolean((input as ISmartSelectOptions).selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace)\n\t\t};\n\t}\n}\n\n//#endregion\n\n//#region tabFocusMode\n\nclass EditorTabFocusMode extends ComputedEditorOption<EditorOption.tabFocusMode, boolean> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.tabFocusMode);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: boolean): boolean {\n\t\tconst readOnly = options.get(EditorOption.readOnly);\n\t\treturn (readOnly ? true : env.tabFocusMode);\n\t}\n}\n\n//#endregion\n\n//#region wrappingIndent\n\n/**\n * Describes how to indent wrapped lines.\n */\nexport const enum WrappingIndent {\n\t/**\n\t * No indentation => wrapped lines begin at column 1.\n\t */\n\tNone = 0,\n\t/**\n\t * Same => wrapped lines get the same indentation as the parent.\n\t */\n\tSame = 1,\n\t/**\n\t * Indent => wrapped lines get +1 indentation toward the parent.\n\t */\n\tIndent = 2,\n\t/**\n\t * DeepIndent => wrapped lines get +2 indentation toward the parent.\n\t */\n\tDeepIndent = 3\n}\n\nfunction _wrappingIndentFromString(wrappingIndent: 'none' | 'same' | 'indent' | 'deepIndent'): WrappingIndent {\n\tswitch (wrappingIndent) {\n\t\tcase 'none': return WrappingIndent.None;\n\t\tcase 'same': return WrappingIndent.Same;\n\t\tcase 'indent': return WrappingIndent.Indent;\n\t\tcase 'deepIndent': return WrappingIndent.DeepIndent;\n\t}\n}\n\n//#endregion\n\n//#region wrappingInfo\n\nexport interface EditorWrappingInfo {\n\treadonly isDominatedByLongLines: boolean;\n\treadonly isWordWrapMinified: boolean;\n\treadonly isViewportWrapping: boolean;\n\treadonly wrappingColumn: number;\n}\n\nclass EditorWrappingInfoComputer extends ComputedEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo> {\n\n\tconstructor() {\n\t\tsuper(EditorOption.wrappingInfo);\n\t}\n\n\tpublic compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorWrappingInfo): EditorWrappingInfo {\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\treturn {\n\t\t\tisDominatedByLongLines: env.isDominatedByLongLines,\n\t\t\tisWordWrapMinified: layoutInfo.isWordWrapMinified,\n\t\t\tisViewportWrapping: layoutInfo.isViewportWrapping,\n\t\t\twrappingColumn: layoutInfo.wrappingColumn,\n\t\t};\n\t}\n}\n\n//#endregion\n\nconst DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\nconst DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\nconst DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', \\'monospace\\', monospace';\n\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n\tfontFamily: (\n\t\tplatform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)\n\t),\n\tfontWeight: 'normal',\n\tfontSize: (\n\t\tplatform.isMacintosh ? 12 : 14\n\t),\n\tlineHeight: 0,\n\tletterSpacing: 0,\n};\n\n/**\n * @internal\n */\nexport const editorOptionsRegistry: IEditorOption<EditorOption, any>[] = [];\n\nfunction register<K extends EditorOption, V>(option: IEditorOption<K, V>): IEditorOption<K, V> {\n\teditorOptionsRegistry[option.id] = option;\n\treturn option;\n}\n\nexport const enum EditorOption {\n\tacceptSuggestionOnCommitCharacter,\n\tacceptSuggestionOnEnter,\n\taccessibilitySupport,\n\taccessibilityPageSize,\n\tariaLabel,\n\tautoClosingBrackets,\n\tautoClosingDelete,\n\tautoClosingOvertype,\n\tautoClosingQuotes,\n\tautoIndent,\n\tautomaticLayout,\n\tautoSurround,\n\tbracketPairColorization,\n\tguides,\n\tcodeLens,\n\tcodeLensFontFamily,\n\tcodeLensFontSize,\n\tcolorDecorators,\n\tcolumnSelection,\n\tcomments,\n\tcontextmenu,\n\tcopyWithSyntaxHighlighting,\n\tcursorBlinking,\n\tcursorSmoothCaretAnimation,\n\tcursorStyle,\n\tcursorSurroundingLines,\n\tcursorSurroundingLinesStyle,\n\tcursorWidth,\n\tdisableLayerHinting,\n\tdisableMonospaceOptimizations,\n\tdomReadOnly,\n\tdragAndDrop,\n\temptySelectionClipboard,\n\textraEditorClassName,\n\tfastScrollSensitivity,\n\tfind,\n\tfixedOverflowWidgets,\n\tfolding,\n\tfoldingStrategy,\n\tfoldingHighlight,\n\tfoldingImportsByDefault,\n\tfoldingMaximumRegions,\n\tunfoldOnClickAfterEndOfLine,\n\tfontFamily,\n\tfontInfo,\n\tfontLigatures,\n\tfontSize,\n\tfontWeight,\n\tformatOnPaste,\n\tformatOnType,\n\tglyphMargin,\n\tgotoLocation,\n\thideCursorInOverviewRuler,\n\thover,\n\tinDiffEditor,\n\tinlineSuggest,\n\tletterSpacing,\n\tlightbulb,\n\tlineDecorationsWidth,\n\tlineHeight,\n\tlineNumbers,\n\tlineNumbersMinChars,\n\tlinkedEditing,\n\tlinks,\n\tmatchBrackets,\n\tminimap,\n\tmouseStyle,\n\tmouseWheelScrollSensitivity,\n\tmouseWheelZoom,\n\tmultiCursorMergeOverlapping,\n\tmultiCursorModifier,\n\tmultiCursorPaste,\n\toccurrencesHighlight,\n\toverviewRulerBorder,\n\toverviewRulerLanes,\n\tpadding,\n\tparameterHints,\n\tpeekWidgetDefaultFocus,\n\tdefinitionLinkOpensInPeek,\n\tquickSuggestions,\n\tquickSuggestionsDelay,\n\treadOnly,\n\trenameOnType,\n\trenderControlCharacters,\n\trenderFinalNewline,\n\trenderLineHighlight,\n\trenderLineHighlightOnlyWhenFocus,\n\trenderValidationDecorations,\n\trenderWhitespace,\n\trevealHorizontalRightPadding,\n\troundedSelection,\n\trulers,\n\tscrollbar,\n\tscrollBeyondLastColumn,\n\tscrollBeyondLastLine,\n\tscrollPredominantAxis,\n\tselectionClipboard,\n\tselectionHighlight,\n\tselectOnLineNumbers,\n\tshowFoldingControls,\n\tshowUnused,\n\tsnippetSuggestions,\n\tsmartSelect,\n\tsmoothScrolling,\n\tstickyTabStops,\n\tstopRenderingLineAfter,\n\tsuggest,\n\tsuggestFontSize,\n\tsuggestLineHeight,\n\tsuggestOnTriggerCharacters,\n\tsuggestSelection,\n\ttabCompletion,\n\ttabIndex,\n\tunicodeHighlighting,\n\tunusualLineTerminators,\n\tuseShadowDOM,\n\tuseTabStops,\n\twordSeparators,\n\twordWrap,\n\twordWrapBreakAfterCharacters,\n\twordWrapBreakBeforeCharacters,\n\twordWrapColumn,\n\twordWrapOverride1,\n\twordWrapOverride2,\n\twrappingIndent,\n\twrappingStrategy,\n\tshowDeprecated,\n\tinlayHints,\n\t// Leave these at the end (because they have dependencies!)\n\teditorClassName,\n\tpixelRatio,\n\ttabFocusMode,\n\tlayoutInfo,\n\twrappingInfo,\n}\n\nexport const EditorOptions = {\n\tacceptSuggestionOnCommitCharacter: register(new EditorBooleanOption(\n\t\tEditorOption.acceptSuggestionOnCommitCharacter, 'acceptSuggestionOnCommitCharacter', true,\n\t\t{ markdownDescription: nls.localize('acceptSuggestionOnCommitCharacter', \"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.\") }\n\t)),\n\tacceptSuggestionOnEnter: register(new EditorStringEnumOption(\n\t\tEditorOption.acceptSuggestionOnEnter, 'acceptSuggestionOnEnter',\n\t\t'on' as 'on' | 'smart' | 'off',\n\t\t['on', 'smart', 'off'] as const,\n\t\t{\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('acceptSuggestionOnEnterSmart', \"Only accept a suggestion with `Enter` when it makes a textual change.\"),\n\t\t\t\t''\n\t\t\t],\n\t\t\tmarkdownDescription: nls.localize('acceptSuggestionOnEnter', \"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.\")\n\t\t}\n\t)),\n\taccessibilitySupport: register(new EditorAccessibilitySupport()),\n\taccessibilityPageSize: register(new EditorIntOption(EditorOption.accessibilityPageSize, 'accessibilityPageSize', 10, 1, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{\n\t\t\tdescription: nls.localize('accessibilityPageSize', \"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.\")\n\t\t})),\n\tariaLabel: register(new EditorStringOption(\n\t\tEditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', \"Editor content\")\n\t)),\n\tautoClosingBrackets: register(new EditorStringEnumOption(\n\t\tEditorOption.autoClosingBrackets, 'autoClosingBrackets',\n\t\t'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',\n\t\t['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('editor.autoClosingBrackets.languageDefined', \"Use language configurations to determine when to autoclose brackets.\"),\n\t\t\t\tnls.localize('editor.autoClosingBrackets.beforeWhitespace', \"Autoclose brackets only when the cursor is to the left of whitespace.\"),\n\t\t\t\t'',\n\t\t\t],\n\t\t\tdescription: nls.localize('autoClosingBrackets', \"Controls whether the editor should automatically close brackets after the user adds an opening bracket.\")\n\t\t}\n\t)),\n\tautoClosingDelete: register(new EditorStringEnumOption(\n\t\tEditorOption.autoClosingDelete, 'autoClosingDelete',\n\t\t'auto' as 'always' | 'auto' | 'never',\n\t\t['always', 'auto', 'never'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('editor.autoClosingDelete.auto', \"Remove adjacent closing quotes or brackets only if they were automatically inserted.\"),\n\t\t\t\t'',\n\t\t\t],\n\t\t\tdescription: nls.localize('autoClosingDelete', \"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.\")\n\t\t}\n\t)),\n\tautoClosingOvertype: register(new EditorStringEnumOption(\n\t\tEditorOption.autoClosingOvertype, 'autoClosingOvertype',\n\t\t'auto' as 'always' | 'auto' | 'never',\n\t\t['always', 'auto', 'never'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('editor.autoClosingOvertype.auto', \"Type over closing quotes or brackets only if they were automatically inserted.\"),\n\t\t\t\t'',\n\t\t\t],\n\t\t\tdescription: nls.localize('autoClosingOvertype', \"Controls whether the editor should type over closing quotes or brackets.\")\n\t\t}\n\t)),\n\tautoClosingQuotes: register(new EditorStringEnumOption(\n\t\tEditorOption.autoClosingQuotes, 'autoClosingQuotes',\n\t\t'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',\n\t\t['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('editor.autoClosingQuotes.languageDefined', \"Use language configurations to determine when to autoclose quotes.\"),\n\t\t\t\tnls.localize('editor.autoClosingQuotes.beforeWhitespace', \"Autoclose quotes only when the cursor is to the left of whitespace.\"),\n\t\t\t\t'',\n\t\t\t],\n\t\t\tdescription: nls.localize('autoClosingQuotes', \"Controls whether the editor should automatically close quotes after the user adds an opening quote.\")\n\t\t}\n\t)),\n\tautoIndent: register(new EditorEnumOption(\n\t\tEditorOption.autoIndent, 'autoIndent',\n\t\tEditorAutoIndentStrategy.Full, 'full',\n\t\t['none', 'keep', 'brackets', 'advanced', 'full'],\n\t\t_autoIndentFromString,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('editor.autoIndent.none', \"The editor will not insert indentation automatically.\"),\n\t\t\t\tnls.localize('editor.autoIndent.keep', \"The editor will keep the current line's indentation.\"),\n\t\t\t\tnls.localize('editor.autoIndent.brackets', \"The editor will keep the current line's indentation and honor language defined brackets.\"),\n\t\t\t\tnls.localize('editor.autoIndent.advanced', \"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.\"),\n\t\t\t\tnls.localize('editor.autoIndent.full', \"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('autoIndent', \"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.\")\n\t\t}\n\t)),\n\tautomaticLayout: register(new EditorBooleanOption(\n\t\tEditorOption.automaticLayout, 'automaticLayout', false,\n\t)),\n\tautoSurround: register(new EditorStringEnumOption(\n\t\tEditorOption.autoSurround, 'autoSurround',\n\t\t'languageDefined' as 'languageDefined' | 'quotes' | 'brackets' | 'never',\n\t\t['languageDefined', 'quotes', 'brackets', 'never'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('editor.autoSurround.languageDefined', \"Use language configurations to determine when to automatically surround selections.\"),\n\t\t\t\tnls.localize('editor.autoSurround.quotes', \"Surround with quotes but not brackets.\"),\n\t\t\t\tnls.localize('editor.autoSurround.brackets', \"Surround with brackets but not quotes.\"),\n\t\t\t\t''\n\t\t\t],\n\t\t\tdescription: nls.localize('autoSurround', \"Controls whether the editor should automatically surround selections when typing quotes or brackets.\")\n\t\t}\n\t)),\n\tbracketPairColorization: register(new BracketPairColorization()),\n\tbracketPairGuides: register(new GuideOptions()),\n\tstickyTabStops: register(new EditorBooleanOption(\n\t\tEditorOption.stickyTabStops, 'stickyTabStops', false,\n\t\t{ description: nls.localize('stickyTabStops', \"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.\") }\n\t)),\n\tcodeLens: register(new EditorBooleanOption(\n\t\tEditorOption.codeLens, 'codeLens', true,\n\t\t{ description: nls.localize('codeLens', \"Controls whether the editor shows CodeLens.\") }\n\t)),\n\tcodeLensFontFamily: register(new EditorStringOption(\n\t\tEditorOption.codeLensFontFamily, 'codeLensFontFamily', '',\n\t\t{ description: nls.localize('codeLensFontFamily', \"Controls the font family for CodeLens.\") }\n\t)),\n\tcodeLensFontSize: register(new EditorIntOption(EditorOption.codeLensFontSize, 'codeLensFontSize', 0, 0, 100, {\n\t\ttype: 'number',\n\t\tdefault: 0,\n\t\tminimum: 0,\n\t\tmaximum: 100,\n\t\tmarkdownDescription: nls.localize('codeLensFontSize', \"Controls the font size in pixels for CodeLens. When set to `0`, 90% of `#editor.fontSize#` is used.\")\n\t})),\n\tcolorDecorators: register(new EditorBooleanOption(\n\t\tEditorOption.colorDecorators, 'colorDecorators', true,\n\t\t{ description: nls.localize('colorDecorators', \"Controls whether the editor should render the inline color decorators and color picker.\") }\n\t)),\n\tcolumnSelection: register(new EditorBooleanOption(\n\t\tEditorOption.columnSelection, 'columnSelection', false,\n\t\t{ description: nls.localize('columnSelection', \"Enable that the selection with the mouse and keys is doing column selection.\") }\n\t)),\n\tcomments: register(new EditorComments()),\n\tcontextmenu: register(new EditorBooleanOption(\n\t\tEditorOption.contextmenu, 'contextmenu', true,\n\t)),\n\tcopyWithSyntaxHighlighting: register(new EditorBooleanOption(\n\t\tEditorOption.copyWithSyntaxHighlighting, 'copyWithSyntaxHighlighting', true,\n\t\t{ description: nls.localize('copyWithSyntaxHighlighting', \"Controls whether syntax highlighting should be copied into the clipboard.\") }\n\t)),\n\tcursorBlinking: register(new EditorEnumOption(\n\t\tEditorOption.cursorBlinking, 'cursorBlinking',\n\t\tTextEditorCursorBlinkingStyle.Blink, 'blink',\n\t\t['blink', 'smooth', 'phase', 'expand', 'solid'],\n\t\t_cursorBlinkingStyleFromString,\n\t\t{ description: nls.localize('cursorBlinking', \"Control the cursor animation style.\") }\n\t)),\n\tcursorSmoothCaretAnimation: register(new EditorBooleanOption(\n\t\tEditorOption.cursorSmoothCaretAnimation, 'cursorSmoothCaretAnimation', false,\n\t\t{ description: nls.localize('cursorSmoothCaretAnimation', \"Controls whether the smooth caret animation should be enabled.\") }\n\t)),\n\tcursorStyle: register(new EditorEnumOption(\n\t\tEditorOption.cursorStyle, 'cursorStyle',\n\t\tTextEditorCursorStyle.Line, 'line',\n\t\t['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'],\n\t\t_cursorStyleFromString,\n\t\t{ description: nls.localize('cursorStyle', \"Controls the cursor style.\") }\n\t)),\n\tcursorSurroundingLines: register(new EditorIntOption(\n\t\tEditorOption.cursorSurroundingLines, 'cursorSurroundingLines',\n\t\t0, 0, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{ description: nls.localize('cursorSurroundingLines', \"Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.\") }\n\t)),\n\tcursorSurroundingLinesStyle: register(new EditorStringEnumOption(\n\t\tEditorOption.cursorSurroundingLinesStyle, 'cursorSurroundingLinesStyle',\n\t\t'default' as 'default' | 'all',\n\t\t['default', 'all'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('cursorSurroundingLinesStyle.default', \"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.\"),\n\t\t\t\tnls.localize('cursorSurroundingLinesStyle.all', \"`cursorSurroundingLines` is enforced always.\")\n\t\t\t],\n\t\t\tdescription: nls.localize('cursorSurroundingLinesStyle', \"Controls when `cursorSurroundingLines` should be enforced.\")\n\t\t}\n\t)),\n\tcursorWidth: register(new EditorIntOption(\n\t\tEditorOption.cursorWidth, 'cursorWidth',\n\t\t0, 0, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{ markdownDescription: nls.localize('cursorWidth', \"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.\") }\n\t)),\n\tdisableLayerHinting: register(new EditorBooleanOption(\n\t\tEditorOption.disableLayerHinting, 'disableLayerHinting', false,\n\t)),\n\tdisableMonospaceOptimizations: register(new EditorBooleanOption(\n\t\tEditorOption.disableMonospaceOptimizations, 'disableMonospaceOptimizations', false\n\t)),\n\tdomReadOnly: register(new EditorBooleanOption(\n\t\tEditorOption.domReadOnly, 'domReadOnly', false,\n\t)),\n\tdragAndDrop: register(new EditorBooleanOption(\n\t\tEditorOption.dragAndDrop, 'dragAndDrop', true,\n\t\t{ description: nls.localize('dragAndDrop', \"Controls whether the editor should allow moving selections via drag and drop.\") }\n\t)),\n\temptySelectionClipboard: register(new EditorEmptySelectionClipboard()),\n\textraEditorClassName: register(new EditorStringOption(\n\t\tEditorOption.extraEditorClassName, 'extraEditorClassName', '',\n\t)),\n\tfastScrollSensitivity: register(new EditorFloatOption(\n\t\tEditorOption.fastScrollSensitivity, 'fastScrollSensitivity',\n\t\t5, x => (x <= 0 ? 5 : x),\n\t\t{ markdownDescription: nls.localize('fastScrollSensitivity', \"Scrolling speed multiplier when pressing `Alt`.\") }\n\t)),\n\tfind: register(new EditorFind()),\n\tfixedOverflowWidgets: register(new EditorBooleanOption(\n\t\tEditorOption.fixedOverflowWidgets, 'fixedOverflowWidgets', false,\n\t)),\n\tfolding: register(new EditorBooleanOption(\n\t\tEditorOption.folding, 'folding', true,\n\t\t{ description: nls.localize('folding', \"Controls whether the editor has code folding enabled.\") }\n\t)),\n\tfoldingStrategy: register(new EditorStringEnumOption(\n\t\tEditorOption.foldingStrategy, 'foldingStrategy',\n\t\t'auto' as 'auto' | 'indentation',\n\t\t['auto', 'indentation'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('foldingStrategy.auto', \"Use a language-specific folding strategy if available, else the indentation-based one.\"),\n\t\t\t\tnls.localize('foldingStrategy.indentation', \"Use the indentation-based folding strategy.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('foldingStrategy', \"Controls the strategy for computing folding ranges.\")\n\t\t}\n\t)),\n\tfoldingHighlight: register(new EditorBooleanOption(\n\t\tEditorOption.foldingHighlight, 'foldingHighlight', true,\n\t\t{ description: nls.localize('foldingHighlight', \"Controls whether the editor should highlight folded ranges.\") }\n\t)),\n\tfoldingImportsByDefault: register(new EditorBooleanOption(\n\t\tEditorOption.foldingImportsByDefault, 'foldingImportsByDefault', false,\n\t\t{ description: nls.localize('foldingImportsByDefault', \"Controls whether the editor automatically collapses import ranges.\") }\n\t)),\n\tfoldingMaximumRegions: register(new EditorIntOption(\n\t\tEditorOption.foldingMaximumRegions, 'foldingMaximumRegions',\n\t\t5000, 10, 65000, // limit must be less than foldingRanges MAX_FOLDING_REGIONS\n\t\t{ description: nls.localize('foldingMaximumRegions', \"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.\") }\n\t)),\n\tunfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(\n\t\tEditorOption.unfoldOnClickAfterEndOfLine, 'unfoldOnClickAfterEndOfLine', false,\n\t\t{ description: nls.localize('unfoldOnClickAfterEndOfLine', \"Controls whether clicking on the empty content after a folded line will unfold the line.\") }\n\t)),\n\tfontFamily: register(new EditorStringOption(\n\t\tEditorOption.fontFamily, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily,\n\t\t{ description: nls.localize('fontFamily', \"Controls the font family.\") }\n\t)),\n\tfontInfo: register(new EditorFontInfo()),\n\tfontLigatures2: register(new EditorFontLigatures()),\n\tfontSize: register(new EditorFontSize()),\n\tfontWeight: register(new EditorFontWeight()),\n\tformatOnPaste: register(new EditorBooleanOption(\n\t\tEditorOption.formatOnPaste, 'formatOnPaste', false,\n\t\t{ description: nls.localize('formatOnPaste', \"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.\") }\n\t)),\n\tformatOnType: register(new EditorBooleanOption(\n\t\tEditorOption.formatOnType, 'formatOnType', false,\n\t\t{ description: nls.localize('formatOnType', \"Controls whether the editor should automatically format the line after typing.\") }\n\t)),\n\tglyphMargin: register(new EditorBooleanOption(\n\t\tEditorOption.glyphMargin, 'glyphMargin', true,\n\t\t{ description: nls.localize('glyphMargin', \"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.\") }\n\t)),\n\tgotoLocation: register(new EditorGoToLocation()),\n\thideCursorInOverviewRuler: register(new EditorBooleanOption(\n\t\tEditorOption.hideCursorInOverviewRuler, 'hideCursorInOverviewRuler', false,\n\t\t{ description: nls.localize('hideCursorInOverviewRuler', \"Controls whether the cursor should be hidden in the overview ruler.\") }\n\t)),\n\thover: register(new EditorHover()),\n\tinDiffEditor: register(new EditorBooleanOption(\n\t\tEditorOption.inDiffEditor, 'inDiffEditor', false\n\t)),\n\tletterSpacing: register(new EditorFloatOption(\n\t\tEditorOption.letterSpacing, 'letterSpacing',\n\t\tEDITOR_FONT_DEFAULTS.letterSpacing, x => EditorFloatOption.clamp(x, -5, 20),\n\t\t{ description: nls.localize('letterSpacing', \"Controls the letter spacing in pixels.\") }\n\t)),\n\tlightbulb: register(new EditorLightbulb()),\n\tlineDecorationsWidth: register(new SimpleEditorOption(EditorOption.lineDecorationsWidth, 'lineDecorationsWidth', 10 as number | string)),\n\tlineHeight: register(new EditorLineHeight()),\n\tlineNumbers: register(new EditorRenderLineNumbersOption()),\n\tlineNumbersMinChars: register(new EditorIntOption(\n\t\tEditorOption.lineNumbersMinChars, 'lineNumbersMinChars',\n\t\t5, 1, 300\n\t)),\n\tlinkedEditing: register(new EditorBooleanOption(\n\t\tEditorOption.linkedEditing, 'linkedEditing', false,\n\t\t{ description: nls.localize('linkedEditing', \"Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.\") }\n\t)),\n\tlinks: register(new EditorBooleanOption(\n\t\tEditorOption.links, 'links', true,\n\t\t{ description: nls.localize('links', \"Controls whether the editor should detect links and make them clickable.\") }\n\t)),\n\tmatchBrackets: register(new EditorStringEnumOption(\n\t\tEditorOption.matchBrackets, 'matchBrackets',\n\t\t'always' as 'never' | 'near' | 'always',\n\t\t['always', 'near', 'never'] as const,\n\t\t{ description: nls.localize('matchBrackets', \"Highlight matching brackets.\") }\n\t)),\n\tminimap: register(new EditorMinimap()),\n\tmouseStyle: register(new EditorStringEnumOption(\n\t\tEditorOption.mouseStyle, 'mouseStyle',\n\t\t'text' as 'text' | 'default' | 'copy',\n\t\t['text', 'default', 'copy'] as const,\n\t)),\n\tmouseWheelScrollSensitivity: register(new EditorFloatOption(\n\t\tEditorOption.mouseWheelScrollSensitivity, 'mouseWheelScrollSensitivity',\n\t\t1, x => (x === 0 ? 1 : x),\n\t\t{ markdownDescription: nls.localize('mouseWheelScrollSensitivity', \"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.\") }\n\t)),\n\tmouseWheelZoom: register(new EditorBooleanOption(\n\t\tEditorOption.mouseWheelZoom, 'mouseWheelZoom', false,\n\t\t{ markdownDescription: nls.localize('mouseWheelZoom', \"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.\") }\n\t)),\n\tmultiCursorMergeOverlapping: register(new EditorBooleanOption(\n\t\tEditorOption.multiCursorMergeOverlapping, 'multiCursorMergeOverlapping', true,\n\t\t{ description: nls.localize('multiCursorMergeOverlapping', \"Merge multiple cursors when they are overlapping.\") }\n\t)),\n\tmultiCursorModifier: register(new EditorEnumOption(\n\t\tEditorOption.multiCursorModifier, 'multiCursorModifier',\n\t\t'altKey', 'alt',\n\t\t['ctrlCmd', 'alt'],\n\t\t_multiCursorModifierFromString,\n\t\t{\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\tnls.localize('multiCursorModifier.ctrlCmd', \"Maps to `Control` on Windows and Linux and to `Command` on macOS.\"),\n\t\t\t\tnls.localize('multiCursorModifier.alt', \"Maps to `Alt` on Windows and Linux and to `Option` on macOS.\")\n\t\t\t],\n\t\t\tmarkdownDescription: nls.localize({\n\t\t\t\tkey: 'multiCursorModifier',\n\t\t\t\tcomment: [\n\t\t\t\t\t'- `ctrlCmd` refers to a value the setting can take and should not be localized.',\n\t\t\t\t\t'- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'\n\t\t\t\t]\n\t\t\t}, \"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).\")\n\t\t}\n\t)),\n\tmultiCursorPaste: register(new EditorStringEnumOption(\n\t\tEditorOption.multiCursorPaste, 'multiCursorPaste',\n\t\t'spread' as 'spread' | 'full',\n\t\t['spread', 'full'] as const,\n\t\t{\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\tnls.localize('multiCursorPaste.spread', \"Each cursor pastes a single line of the text.\"),\n\t\t\t\tnls.localize('multiCursorPaste.full', \"Each cursor pastes the full text.\")\n\t\t\t],\n\t\t\tmarkdownDescription: nls.localize('multiCursorPaste', \"Controls pasting when the line count of the pasted text matches the cursor count.\")\n\t\t}\n\t)),\n\toccurrencesHighlight: register(new EditorBooleanOption(\n\t\tEditorOption.occurrencesHighlight, 'occurrencesHighlight', true,\n\t\t{ description: nls.localize('occurrencesHighlight', \"Controls whether the editor should highlight semantic symbol occurrences.\") }\n\t)),\n\toverviewRulerBorder: register(new EditorBooleanOption(\n\t\tEditorOption.overviewRulerBorder, 'overviewRulerBorder', true,\n\t\t{ description: nls.localize('overviewRulerBorder', \"Controls whether a border should be drawn around the overview ruler.\") }\n\t)),\n\toverviewRulerLanes: register(new EditorIntOption(\n\t\tEditorOption.overviewRulerLanes, 'overviewRulerLanes',\n\t\t3, 0, 3\n\t)),\n\tpadding: register(new EditorPadding()),\n\tparameterHints: register(new EditorParameterHints()),\n\tpeekWidgetDefaultFocus: register(new EditorStringEnumOption(\n\t\tEditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus',\n\t\t'tree' as 'tree' | 'editor',\n\t\t['tree', 'editor'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('peekWidgetDefaultFocus.tree', \"Focus the tree when opening peek\"),\n\t\t\t\tnls.localize('peekWidgetDefaultFocus.editor', \"Focus the editor when opening peek\")\n\t\t\t],\n\t\t\tdescription: nls.localize('peekWidgetDefaultFocus', \"Controls whether to focus the inline editor or the tree in the peek widget.\")\n\t\t}\n\t)),\n\tdefinitionLinkOpensInPeek: register(new EditorBooleanOption(\n\t\tEditorOption.definitionLinkOpensInPeek, 'definitionLinkOpensInPeek', false,\n\t\t{ description: nls.localize('definitionLinkOpensInPeek', \"Controls whether the Go to Definition mouse gesture always opens the peek widget.\") }\n\t)),\n\tquickSuggestions: register(new EditorQuickSuggestions()),\n\tquickSuggestionsDelay: register(new EditorIntOption(\n\t\tEditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay',\n\t\t10, 0, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{ description: nls.localize('quickSuggestionsDelay', \"Controls the delay in milliseconds after which quick suggestions will show up.\") }\n\t)),\n\treadOnly: register(new EditorBooleanOption(\n\t\tEditorOption.readOnly, 'readOnly', false,\n\t)),\n\trenameOnType: register(new EditorBooleanOption(\n\t\tEditorOption.renameOnType, 'renameOnType', false,\n\t\t{ description: nls.localize('renameOnType', \"Controls whether the editor auto renames on type.\"), markdownDeprecationMessage: nls.localize('renameOnTypeDeprecate', \"Deprecated, use `editor.linkedEditing` instead.\") }\n\t)),\n\trenderControlCharacters: register(new EditorBooleanOption(\n\t\tEditorOption.renderControlCharacters, 'renderControlCharacters', true,\n\t\t{ description: nls.localize('renderControlCharacters', \"Controls whether the editor should render control characters.\"), restricted: true }\n\t)),\n\trenderFinalNewline: register(new EditorBooleanOption(\n\t\tEditorOption.renderFinalNewline, 'renderFinalNewline', true,\n\t\t{ description: nls.localize('renderFinalNewline', \"Render last line number when the file ends with a newline.\") }\n\t)),\n\trenderLineHighlight: register(new EditorStringEnumOption(\n\t\tEditorOption.renderLineHighlight, 'renderLineHighlight',\n\t\t'line' as 'none' | 'gutter' | 'line' | 'all',\n\t\t['none', 'gutter', 'line', 'all'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\tnls.localize('renderLineHighlight.all', \"Highlights both the gutter and the current line.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('renderLineHighlight', \"Controls how the editor should render the current line highlight.\")\n\t\t}\n\t)),\n\trenderLineHighlightOnlyWhenFocus: register(new EditorBooleanOption(\n\t\tEditorOption.renderLineHighlightOnlyWhenFocus, 'renderLineHighlightOnlyWhenFocus', false,\n\t\t{ description: nls.localize('renderLineHighlightOnlyWhenFocus', \"Controls if the editor should render the current line highlight only when the editor is focused.\") }\n\t)),\n\trenderValidationDecorations: register(new EditorStringEnumOption(\n\t\tEditorOption.renderValidationDecorations, 'renderValidationDecorations',\n\t\t'editable' as 'editable' | 'on' | 'off',\n\t\t['editable', 'on', 'off'] as const\n\t)),\n\trenderWhitespace: register(new EditorStringEnumOption(\n\t\tEditorOption.renderWhitespace, 'renderWhitespace',\n\t\t'selection' as 'selection' | 'none' | 'boundary' | 'trailing' | 'all',\n\t\t['none', 'boundary', 'selection', 'trailing', 'all'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\t'',\n\t\t\t\tnls.localize('renderWhitespace.boundary', \"Render whitespace characters except for single spaces between words.\"),\n\t\t\t\tnls.localize('renderWhitespace.selection', \"Render whitespace characters only on selected text.\"),\n\t\t\t\tnls.localize('renderWhitespace.trailing', \"Render only trailing whitespace characters.\"),\n\t\t\t\t''\n\t\t\t],\n\t\t\tdescription: nls.localize('renderWhitespace', \"Controls how the editor should render whitespace characters.\")\n\t\t}\n\t)),\n\trevealHorizontalRightPadding: register(new EditorIntOption(\n\t\tEditorOption.revealHorizontalRightPadding, 'revealHorizontalRightPadding',\n\t\t30, 0, 1000,\n\t)),\n\troundedSelection: register(new EditorBooleanOption(\n\t\tEditorOption.roundedSelection, 'roundedSelection', true,\n\t\t{ description: nls.localize('roundedSelection', \"Controls whether selections should have rounded corners.\") }\n\t)),\n\trulers: register(new EditorRulers()),\n\tscrollbar: register(new EditorScrollbar()),\n\tscrollBeyondLastColumn: register(new EditorIntOption(\n\t\tEditorOption.scrollBeyondLastColumn, 'scrollBeyondLastColumn',\n\t\t5, 0, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{ description: nls.localize('scrollBeyondLastColumn', \"Controls the number of extra characters beyond which the editor will scroll horizontally.\") }\n\t)),\n\tscrollBeyondLastLine: register(new EditorBooleanOption(\n\t\tEditorOption.scrollBeyondLastLine, 'scrollBeyondLastLine', true,\n\t\t{ description: nls.localize('scrollBeyondLastLine', \"Controls whether the editor will scroll beyond the last line.\") }\n\t)),\n\tscrollPredominantAxis: register(new EditorBooleanOption(\n\t\tEditorOption.scrollPredominantAxis, 'scrollPredominantAxis', true,\n\t\t{ description: nls.localize('scrollPredominantAxis', \"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.\") }\n\t)),\n\tselectionClipboard: register(new EditorBooleanOption(\n\t\tEditorOption.selectionClipboard, 'selectionClipboard', true,\n\t\t{\n\t\t\tdescription: nls.localize('selectionClipboard', \"Controls whether the Linux primary clipboard should be supported.\"),\n\t\t\tincluded: platform.isLinux\n\t\t}\n\t)),\n\tselectionHighlight: register(new EditorBooleanOption(\n\t\tEditorOption.selectionHighlight, 'selectionHighlight', true,\n\t\t{ description: nls.localize('selectionHighlight', \"Controls whether the editor should highlight matches similar to the selection.\") }\n\t)),\n\tselectOnLineNumbers: register(new EditorBooleanOption(\n\t\tEditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true,\n\t)),\n\tshowFoldingControls: register(new EditorStringEnumOption(\n\t\tEditorOption.showFoldingControls, 'showFoldingControls',\n\t\t'mouseover' as 'always' | 'mouseover',\n\t\t['always', 'mouseover'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('showFoldingControls.always', \"Always show the folding controls.\"),\n\t\t\t\tnls.localize('showFoldingControls.mouseover', \"Only show the folding controls when the mouse is over the gutter.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('showFoldingControls', \"Controls when the folding controls on the gutter are shown.\")\n\t\t}\n\t)),\n\tshowUnused: register(new EditorBooleanOption(\n\t\tEditorOption.showUnused, 'showUnused', true,\n\t\t{ description: nls.localize('showUnused', \"Controls fading out of unused code.\") }\n\t)),\n\tshowDeprecated: register(new EditorBooleanOption(\n\t\tEditorOption.showDeprecated, 'showDeprecated', true,\n\t\t{ description: nls.localize('showDeprecated', \"Controls strikethrough deprecated variables.\") }\n\t)),\n\tinlayHints: register(new EditorInlayHints()),\n\tsnippetSuggestions: register(new EditorStringEnumOption(\n\t\tEditorOption.snippetSuggestions, 'snippetSuggestions',\n\t\t'inline' as 'top' | 'bottom' | 'inline' | 'none',\n\t\t['top', 'bottom', 'inline', 'none'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('snippetSuggestions.top', \"Show snippet suggestions on top of other suggestions.\"),\n\t\t\t\tnls.localize('snippetSuggestions.bottom', \"Show snippet suggestions below other suggestions.\"),\n\t\t\t\tnls.localize('snippetSuggestions.inline', \"Show snippets suggestions with other suggestions.\"),\n\t\t\t\tnls.localize('snippetSuggestions.none', \"Do not show snippet suggestions.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('snippetSuggestions', \"Controls whether snippets are shown with other suggestions and how they are sorted.\")\n\t\t}\n\t)),\n\tsmartSelect: register(new SmartSelect()),\n\tsmoothScrolling: register(new EditorBooleanOption(\n\t\tEditorOption.smoothScrolling, 'smoothScrolling', false,\n\t\t{ description: nls.localize('smoothScrolling', \"Controls whether the editor will scroll using an animation.\") }\n\t)),\n\tstopRenderingLineAfter: register(new EditorIntOption(\n\t\tEditorOption.stopRenderingLineAfter, 'stopRenderingLineAfter',\n\t\t10000, -1, Constants.MAX_SAFE_SMALL_INTEGER,\n\t)),\n\tsuggest: register(new EditorSuggest()),\n\tinlineSuggest: register(new InlineEditorSuggest()),\n\tsuggestFontSize: register(new EditorIntOption(\n\t\tEditorOption.suggestFontSize, 'suggestFontSize',\n\t\t0, 0, 1000,\n\t\t{ markdownDescription: nls.localize('suggestFontSize', \"Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.\") }\n\t)),\n\tsuggestLineHeight: register(new EditorIntOption(\n\t\tEditorOption.suggestLineHeight, 'suggestLineHeight',\n\t\t0, 0, 1000,\n\t\t{ markdownDescription: nls.localize('suggestLineHeight', \"Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.\") }\n\t)),\n\tsuggestOnTriggerCharacters: register(new EditorBooleanOption(\n\t\tEditorOption.suggestOnTriggerCharacters, 'suggestOnTriggerCharacters', true,\n\t\t{ description: nls.localize('suggestOnTriggerCharacters', \"Controls whether suggestions should automatically show up when typing trigger characters.\") }\n\t)),\n\tsuggestSelection: register(new EditorStringEnumOption(\n\t\tEditorOption.suggestSelection, 'suggestSelection',\n\t\t'first' as 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix',\n\t\t['first', 'recentlyUsed', 'recentlyUsedByPrefix'] as const,\n\t\t{\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\tnls.localize('suggestSelection.first', \"Always select the first suggestion.\"),\n\t\t\t\tnls.localize('suggestSelection.recentlyUsed', \"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.\"),\n\t\t\t\tnls.localize('suggestSelection.recentlyUsedByPrefix', \"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('suggestSelection', \"Controls how suggestions are pre-selected when showing the suggest list.\")\n\t\t}\n\t)),\n\ttabCompletion: register(new EditorStringEnumOption(\n\t\tEditorOption.tabCompletion, 'tabCompletion',\n\t\t'off' as 'on' | 'off' | 'onlySnippets',\n\t\t['on', 'off', 'onlySnippets'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('tabCompletion.on', \"Tab complete will insert the best matching suggestion when pressing tab.\"),\n\t\t\t\tnls.localize('tabCompletion.off', \"Disable tab completions.\"),\n\t\t\t\tnls.localize('tabCompletion.onlySnippets', \"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('tabCompletion', \"Enables tab completions.\")\n\t\t}\n\t)),\n\ttabIndex: register(new EditorIntOption(\n\t\tEditorOption.tabIndex, 'tabIndex',\n\t\t0, -1, Constants.MAX_SAFE_SMALL_INTEGER\n\t)),\n\tunicodeHighlight: register(new UnicodeHighlight()),\n\tunusualLineTerminators: register(new EditorStringEnumOption(\n\t\tEditorOption.unusualLineTerminators, 'unusualLineTerminators',\n\t\t'prompt' as 'auto' | 'off' | 'prompt',\n\t\t['auto', 'off', 'prompt'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('unusualLineTerminators.auto', \"Unusual line terminators are automatically removed.\"),\n\t\t\t\tnls.localize('unusualLineTerminators.off', \"Unusual line terminators are ignored.\"),\n\t\t\t\tnls.localize('unusualLineTerminators.prompt', \"Unusual line terminators prompt to be removed.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('unusualLineTerminators', \"Remove unusual line terminators that might cause problems.\")\n\t\t}\n\t)),\n\tuseShadowDOM: register(new EditorBooleanOption(\n\t\tEditorOption.useShadowDOM, 'useShadowDOM', true\n\t)),\n\tuseTabStops: register(new EditorBooleanOption(\n\t\tEditorOption.useTabStops, 'useTabStops', true,\n\t\t{ description: nls.localize('useTabStops', \"Inserting and deleting whitespace follows tab stops.\") }\n\t)),\n\twordSeparators: register(new EditorStringOption(\n\t\tEditorOption.wordSeparators, 'wordSeparators', USUAL_WORD_SEPARATORS,\n\t\t{ description: nls.localize('wordSeparators', \"Characters that will be used as word separators when doing word related navigations or operations.\") }\n\t)),\n\twordWrap: register(new EditorStringEnumOption(\n\t\tEditorOption.wordWrap, 'wordWrap',\n\t\t'off' as 'off' | 'on' | 'wordWrapColumn' | 'bounded',\n\t\t['off', 'on', 'wordWrapColumn', 'bounded'] as const,\n\t\t{\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\tnls.localize('wordWrap.off', \"Lines will never wrap.\"),\n\t\t\t\tnls.localize('wordWrap.on', \"Lines will wrap at the viewport width.\"),\n\t\t\t\tnls.localize({\n\t\t\t\t\tkey: 'wordWrap.wordWrapColumn',\n\t\t\t\t\tcomment: [\n\t\t\t\t\t\t'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n\t\t\t\t\t]\n\t\t\t\t}, \"Lines will wrap at `#editor.wordWrapColumn#`.\"),\n\t\t\t\tnls.localize({\n\t\t\t\t\tkey: 'wordWrap.bounded',\n\t\t\t\t\tcomment: [\n\t\t\t\t\t\t'- viewport means the edge of the visible window size.',\n\t\t\t\t\t\t'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n\t\t\t\t\t]\n\t\t\t\t}, \"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize({\n\t\t\t\tkey: 'wordWrap',\n\t\t\t\tcomment: [\n\t\t\t\t\t'- \\'off\\', \\'on\\', \\'wordWrapColumn\\' and \\'bounded\\' refer to values the setting can take and should not be localized.',\n\t\t\t\t\t'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n\t\t\t\t]\n\t\t\t}, \"Controls how lines should wrap.\")\n\t\t}\n\t)),\n\twordWrapBreakAfterCharacters: register(new EditorStringOption(\n\t\tEditorOption.wordWrapBreakAfterCharacters, 'wordWrapBreakAfterCharacters',\n\t\t// allow-any-unicode-next-line\n\t\t' \\t})]?|/&.,;¢°′″‰℃ã€ã€‚ï½¡ï½¤ï¿ ï¼Œï¼Žï¼šï¼›ï¼Ÿï¼ï¼…・・ã‚ゞヽヾーァィゥェォッャュョヮヵヶããƒã…ã‡ã‰ã£ã‚ƒã‚…ょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャï½ï½®ï½¯ï½°â€ã€‰ã€‹ã€ã€ã€‘〕)]ï½ï½£',\n\t)),\n\twordWrapBreakBeforeCharacters: register(new EditorStringOption(\n\t\tEditorOption.wordWrapBreakBeforeCharacters, 'wordWrapBreakBeforeCharacters',\n\t\t// allow-any-unicode-next-line\n\t\t'([{‘“〈《「『ã€ã€”([{「£¥$£¥++'\n\t)),\n\twordWrapColumn: register(new EditorIntOption(\n\t\tEditorOption.wordWrapColumn, 'wordWrapColumn',\n\t\t80, 1, Constants.MAX_SAFE_SMALL_INTEGER,\n\t\t{\n\t\t\tmarkdownDescription: nls.localize({\n\t\t\t\tkey: 'wordWrapColumn',\n\t\t\t\tcomment: [\n\t\t\t\t\t'- `editor.wordWrap` refers to a different setting and should not be localized.',\n\t\t\t\t\t'- \\'wordWrapColumn\\' and \\'bounded\\' refer to values the different setting can take and should not be localized.'\n\t\t\t\t]\n\t\t\t}, \"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.\")\n\t\t}\n\t)),\n\twordWrapOverride1: register(new EditorStringEnumOption(\n\t\tEditorOption.wordWrapOverride1, 'wordWrapOverride1',\n\t\t'inherit' as 'off' | 'on' | 'inherit',\n\t\t['off', 'on', 'inherit'] as const\n\t)),\n\twordWrapOverride2: register(new EditorStringEnumOption(\n\t\tEditorOption.wordWrapOverride2, 'wordWrapOverride2',\n\t\t'inherit' as 'off' | 'on' | 'inherit',\n\t\t['off', 'on', 'inherit'] as const\n\t)),\n\twrappingIndent: register(new EditorEnumOption(\n\t\tEditorOption.wrappingIndent, 'wrappingIndent',\n\t\tWrappingIndent.Same, 'same',\n\t\t['none', 'same', 'indent', 'deepIndent'],\n\t\t_wrappingIndentFromString,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('wrappingIndent.none', \"No indentation. Wrapped lines begin at column 1.\"),\n\t\t\t\tnls.localize('wrappingIndent.same', \"Wrapped lines get the same indentation as the parent.\"),\n\t\t\t\tnls.localize('wrappingIndent.indent', \"Wrapped lines get +1 indentation toward the parent.\"),\n\t\t\t\tnls.localize('wrappingIndent.deepIndent', \"Wrapped lines get +2 indentation toward the parent.\"),\n\t\t\t],\n\t\t\tdescription: nls.localize('wrappingIndent', \"Controls the indentation of wrapped lines.\"),\n\t\t}\n\t)),\n\twrappingStrategy: register(new EditorStringEnumOption(\n\t\tEditorOption.wrappingStrategy, 'wrappingStrategy',\n\t\t'simple' as 'simple' | 'advanced',\n\t\t['simple', 'advanced'] as const,\n\t\t{\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('wrappingStrategy.simple', \"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.\"),\n\t\t\t\tnls.localize('wrappingStrategy.advanced', \"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.\")\n\t\t\t],\n\t\t\tdescription: nls.localize('wrappingStrategy', \"Controls the algorithm that computes wrapping points.\")\n\t\t}\n\t)),\n\n\t// Leave these at the end (because they have dependencies!)\n\teditorClassName: register(new EditorClassName()),\n\tpixelRatio: register(new EditorPixelRatio()),\n\ttabFocusMode: register(new EditorTabFocusMode()),\n\tlayoutInfo: register(new EditorLayoutInfoComputer()),\n\twrappingInfo: register(new EditorWrappingInfoComputer())\n};\n\ntype EditorOptionsType = typeof EditorOptions;\ntype FindEditorOptionsKeyById<T extends EditorOption> = { [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never }[keyof EditorOptionsType];\ntype ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never;\nexport type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;\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 * as browser from 'vs/base/browser/browser';\nimport { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo } from 'vs/editor/common/config/fontInfo';\n\nexport function applyFontInfo(domNode: FastDomNode<HTMLElement> | HTMLElement, fontInfo: BareFontInfo): void {\n\tif (domNode instanceof FastDomNode) {\n\t\tdomNode.setFontFamily(fontInfo.getMassagedFontFamily(browser.isSafari ? EDITOR_FONT_DEFAULTS.fontFamily : null));\n\t\tdomNode.setFontWeight(fontInfo.fontWeight);\n\t\tdomNode.setFontSize(fontInfo.fontSize);\n\t\tdomNode.setFontFeatureSettings(fontInfo.fontFeatureSettings);\n\t\tdomNode.setLineHeight(fontInfo.lineHeight);\n\t\tdomNode.setLetterSpacing(fontInfo.letterSpacing);\n\t} else {\n\t\tdomNode.style.fontFamily = fontInfo.getMassagedFontFamily(browser.isSafari ? EDITOR_FONT_DEFAULTS.fontFamily : null);\n\t\tdomNode.style.fontWeight = fontInfo.fontWeight;\n\t\tdomNode.style.fontSize = fontInfo.fontSize + 'px';\n\t\tdomNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings;\n\t\tdomNode.style.lineHeight = fontInfo.lineHeight + 'px';\n\t\tdomNode.style.letterSpacing = fontInfo.letterSpacing + 'px';\n\t}\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 { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { BareFontInfo } from 'vs/editor/common/config/fontInfo';\n\nexport const enum CharWidthRequestType {\n\tRegular = 0,\n\tItalic = 1,\n\tBold = 2\n}\n\nexport class CharWidthRequest {\n\n\tpublic readonly chr: string;\n\tpublic readonly type: CharWidthRequestType;\n\tpublic width: number;\n\n\tconstructor(chr: string, type: CharWidthRequestType) {\n\t\tthis.chr = chr;\n\t\tthis.type = type;\n\t\tthis.width = 0;\n\t}\n\n\tpublic fulfill(width: number) {\n\t\tthis.width = width;\n\t}\n}\n\nclass DomCharWidthReader {\n\n\tprivate readonly _bareFontInfo: BareFontInfo;\n\tprivate readonly _requests: CharWidthRequest[];\n\n\tprivate _container: HTMLElement | null;\n\tprivate _testElements: HTMLSpanElement[] | null;\n\n\tconstructor(bareFontInfo: BareFontInfo, requests: CharWidthRequest[]) {\n\t\tthis._bareFontInfo = bareFontInfo;\n\t\tthis._requests = requests;\n\n\t\tthis._container = null;\n\t\tthis._testElements = null;\n\t}\n\n\tpublic read(): void {\n\t\t// Create a test container with all these test elements\n\t\tthis._createDomElements();\n\n\t\t// Add the container to the DOM\n\t\tdocument.body.appendChild(this._container!);\n\n\t\t// Read character widths\n\t\tthis._readFromDomElements();\n\n\t\t// Remove the container from the DOM\n\t\tdocument.body.removeChild(this._container!);\n\n\t\tthis._container = null;\n\t\tthis._testElements = null;\n\t}\n\n\tprivate _createDomElements(): void {\n\t\tconst container = document.createElement('div');\n\t\tcontainer.style.position = 'absolute';\n\t\tcontainer.style.top = '-50000px';\n\t\tcontainer.style.width = '50000px';\n\n\t\tconst regularDomNode = document.createElement('div');\n\t\tapplyFontInfo(regularDomNode, this._bareFontInfo);\n\t\tcontainer.appendChild(regularDomNode);\n\n\t\tconst boldDomNode = document.createElement('div');\n\t\tapplyFontInfo(boldDomNode, this._bareFontInfo);\n\t\tboldDomNode.style.fontWeight = 'bold';\n\t\tcontainer.appendChild(boldDomNode);\n\n\t\tconst italicDomNode = document.createElement('div');\n\t\tapplyFontInfo(italicDomNode, this._bareFontInfo);\n\t\titalicDomNode.style.fontStyle = 'italic';\n\t\tcontainer.appendChild(italicDomNode);\n\n\t\tconst testElements: HTMLSpanElement[] = [];\n\t\tfor (const request of this._requests) {\n\n\t\t\tlet parent: HTMLElement;\n\t\t\tif (request.type === CharWidthRequestType.Regular) {\n\t\t\t\tparent = regularDomNode;\n\t\t\t}\n\t\t\tif (request.type === CharWidthRequestType.Bold) {\n\t\t\t\tparent = boldDomNode;\n\t\t\t}\n\t\t\tif (request.type === CharWidthRequestType.Italic) {\n\t\t\t\tparent = italicDomNode;\n\t\t\t}\n\n\t\t\tparent!.appendChild(document.createElement('br'));\n\n\t\t\tconst testElement = document.createElement('span');\n\t\t\tDomCharWidthReader._render(testElement, request);\n\t\t\tparent!.appendChild(testElement);\n\n\t\t\ttestElements.push(testElement);\n\t\t}\n\n\t\tthis._container = container;\n\t\tthis._testElements = testElements;\n\t}\n\n\tprivate static _render(testElement: HTMLElement, request: CharWidthRequest): void {\n\t\tif (request.chr === ' ') {\n\t\t\tlet htmlString = '\\u00a0';\n\t\t\t// Repeat character 256 (2^8) times\n\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\thtmlString += htmlString;\n\t\t\t}\n\t\t\ttestElement.innerText = htmlString;\n\t\t} else {\n\t\t\tlet testString = request.chr;\n\t\t\t// Repeat character 256 (2^8) times\n\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\ttestString += testString;\n\t\t\t}\n\t\t\ttestElement.textContent = testString;\n\t\t}\n\t}\n\n\tprivate _readFromDomElements(): void {\n\t\tfor (let i = 0, len = this._requests.length; i < len; i++) {\n\t\t\tconst request = this._requests[i];\n\t\t\tconst testElement = this._testElements![i];\n\n\t\t\trequest.fulfill(testElement.offsetWidth / 256);\n\t\t}\n\t}\n}\n\nexport function readCharWidths(bareFontInfo: BareFontInfo, requests: CharWidthRequest[]): void {\n\tconst reader = new DomCharWidthReader(bareFontInfo, requests);\n\treader.read();\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 * as browser from 'vs/base/browser/browser';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { CharWidthRequest, CharWidthRequestType, readCharWidths } from 'vs/editor/browser/config/charWidthReader';\nimport { EditorFontLigatures } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';\n\nclass FontMeasurementsImpl extends Disposable {\n\n\tprivate _cache: FontMeasurementsCache;\n\tprivate _evictUntrustedReadingsTimeout: number;\n\n\tprivate readonly _onDidChange = this._register(new Emitter<void>());\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._cache = new FontMeasurementsCache();\n\t\tthis._evictUntrustedReadingsTimeout = -1;\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._evictUntrustedReadingsTimeout !== -1) {\n\t\t\twindow.clearTimeout(this._evictUntrustedReadingsTimeout);\n\t\t\tthis._evictUntrustedReadingsTimeout = -1;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t/**\n\t * Clear all cached font information and trigger a change event.\n\t */\n\tpublic clearAllFontInfos(): void {\n\t\tthis._cache = new FontMeasurementsCache();\n\t\tthis._onDidChange.fire();\n\t}\n\n\tprivate _writeToCache(item: BareFontInfo, value: FontInfo): void {\n\t\tthis._cache.put(item, value);\n\n\t\tif (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) {\n\t\t\t// Try reading again after some time\n\t\t\tthis._evictUntrustedReadingsTimeout = window.setTimeout(() => {\n\t\t\t\tthis._evictUntrustedReadingsTimeout = -1;\n\t\t\t\tthis._evictUntrustedReadings();\n\t\t\t}, 5000);\n\t\t}\n\t}\n\n\tprivate _evictUntrustedReadings(): void {\n\t\tconst values = this._cache.getValues();\n\t\tlet somethingRemoved = false;\n\t\tfor (const item of values) {\n\t\t\tif (!item.isTrusted) {\n\t\t\t\tsomethingRemoved = true;\n\t\t\t\tthis._cache.remove(item);\n\t\t\t}\n\t\t}\n\t\tif (somethingRemoved) {\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n\n\t/**\n\t * Read font information.\n\t */\n\tpublic readFontInfo(bareFontInfo: BareFontInfo): FontInfo {\n\t\tif (!this._cache.has(bareFontInfo)) {\n\t\t\tlet readConfig = this._actualReadFontInfo(bareFontInfo);\n\n\t\t\tif (readConfig.typicalHalfwidthCharacterWidth <= 2 || readConfig.typicalFullwidthCharacterWidth <= 2 || readConfig.spaceWidth <= 2 || readConfig.maxDigitWidth <= 2) {\n\t\t\t\t// Hey, it's Bug 14341 ... we couldn't read\n\t\t\t\treadConfig = new FontInfo({\n\t\t\t\t\tpixelRatio: browser.PixelRatio.value,\n\t\t\t\t\tfontFamily: readConfig.fontFamily,\n\t\t\t\t\tfontWeight: readConfig.fontWeight,\n\t\t\t\t\tfontSize: readConfig.fontSize,\n\t\t\t\t\tfontFeatureSettings: readConfig.fontFeatureSettings,\n\t\t\t\t\tlineHeight: readConfig.lineHeight,\n\t\t\t\t\tletterSpacing: readConfig.letterSpacing,\n\t\t\t\t\tisMonospace: readConfig.isMonospace,\n\t\t\t\t\ttypicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5),\n\t\t\t\t\ttypicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5),\n\t\t\t\t\tcanUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow,\n\t\t\t\t\tspaceWidth: Math.max(readConfig.spaceWidth, 5),\n\t\t\t\t\tmiddotWidth: Math.max(readConfig.middotWidth, 5),\n\t\t\t\t\twsmiddotWidth: Math.max(readConfig.wsmiddotWidth, 5),\n\t\t\t\t\tmaxDigitWidth: Math.max(readConfig.maxDigitWidth, 5),\n\t\t\t\t}, false);\n\t\t\t}\n\n\t\t\tthis._writeToCache(bareFontInfo, readConfig);\n\t\t}\n\t\treturn this._cache.get(bareFontInfo);\n\t}\n\n\tprivate _createRequest(chr: string, type: CharWidthRequestType, all: CharWidthRequest[], monospace: CharWidthRequest[] | null): CharWidthRequest {\n\t\tconst result = new CharWidthRequest(chr, type);\n\t\tall.push(result);\n\t\tif (monospace) {\n\t\t\tmonospace.push(result);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _actualReadFontInfo(bareFontInfo: BareFontInfo): FontInfo {\n\t\tconst all: CharWidthRequest[] = [];\n\t\tconst monospace: CharWidthRequest[] = [];\n\n\t\tconst typicalHalfwidthCharacter = this._createRequest('n', CharWidthRequestType.Regular, all, monospace);\n\t\tconst typicalFullwidthCharacter = this._createRequest('\\uff4d', CharWidthRequestType.Regular, all, null);\n\t\tconst space = this._createRequest(' ', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit0 = this._createRequest('0', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit1 = this._createRequest('1', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit2 = this._createRequest('2', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit3 = this._createRequest('3', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit4 = this._createRequest('4', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit5 = this._createRequest('5', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit6 = this._createRequest('6', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit7 = this._createRequest('7', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit8 = this._createRequest('8', CharWidthRequestType.Regular, all, monospace);\n\t\tconst digit9 = this._createRequest('9', CharWidthRequestType.Regular, all, monospace);\n\n\t\t// monospace test: used for whitespace rendering\n\t\tconst rightwardsArrow = this._createRequest('→', CharWidthRequestType.Regular, all, monospace);\n\t\tconst halfwidthRightwardsArrow = this._createRequest('ï¿«', CharWidthRequestType.Regular, all, null);\n\n\t\t// U+00B7 - MIDDLE DOT\n\t\tconst middot = this._createRequest('·', CharWidthRequestType.Regular, all, monospace);\n\n\t\t// U+2E31 - WORD SEPARATOR MIDDLE DOT\n\t\tconst wsmiddotWidth = this._createRequest(String.fromCharCode(0x2E31), CharWidthRequestType.Regular, all, null);\n\n\t\t// monospace test: some characters\n\t\tconst monospaceTestChars = '|/-_ilm%';\n\t\tfor (let i = 0, len = monospaceTestChars.length; i < len; i++) {\n\t\t\tthis._createRequest(monospaceTestChars.charAt(i), CharWidthRequestType.Regular, all, monospace);\n\t\t\tthis._createRequest(monospaceTestChars.charAt(i), CharWidthRequestType.Italic, all, monospace);\n\t\t\tthis._createRequest(monospaceTestChars.charAt(i), CharWidthRequestType.Bold, all, monospace);\n\t\t}\n\n\t\treadCharWidths(bareFontInfo, all);\n\n\t\tconst maxDigitWidth = Math.max(digit0.width, digit1.width, digit2.width, digit3.width, digit4.width, digit5.width, digit6.width, digit7.width, digit8.width, digit9.width);\n\n\t\tlet isMonospace = (bareFontInfo.fontFeatureSettings === EditorFontLigatures.OFF);\n\t\tconst referenceWidth = monospace[0].width;\n\t\tfor (let i = 1, len = monospace.length; isMonospace && i < len; i++) {\n\t\t\tconst diff = referenceWidth - monospace[i].width;\n\t\t\tif (diff < -0.001 || diff > 0.001) {\n\t\t\t\tisMonospace = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet canUseHalfwidthRightwardsArrow = true;\n\t\tif (isMonospace && halfwidthRightwardsArrow.width !== referenceWidth) {\n\t\t\t// using a halfwidth rightwards arrow would break monospace...\n\t\t\tcanUseHalfwidthRightwardsArrow = false;\n\t\t}\n\t\tif (halfwidthRightwardsArrow.width > rightwardsArrow.width) {\n\t\t\t// using a halfwidth rightwards arrow would paint a larger arrow than a regular rightwards arrow\n\t\t\tcanUseHalfwidthRightwardsArrow = false;\n\t\t}\n\n\t\treturn new FontInfo({\n\t\t\tpixelRatio: browser.PixelRatio.value,\n\t\t\tfontFamily: bareFontInfo.fontFamily,\n\t\t\tfontWeight: bareFontInfo.fontWeight,\n\t\t\tfontSize: bareFontInfo.fontSize,\n\t\t\tfontFeatureSettings: bareFontInfo.fontFeatureSettings,\n\t\t\tlineHeight: bareFontInfo.lineHeight,\n\t\t\tletterSpacing: bareFontInfo.letterSpacing,\n\t\t\tisMonospace: isMonospace,\n\t\t\ttypicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width,\n\t\t\ttypicalFullwidthCharacterWidth: typicalFullwidthCharacter.width,\n\t\t\tcanUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow,\n\t\t\tspaceWidth: space.width,\n\t\t\tmiddotWidth: middot.width,\n\t\t\twsmiddotWidth: wsmiddotWidth.width,\n\t\t\tmaxDigitWidth: maxDigitWidth\n\t\t}, true);\n\t}\n}\n\nclass FontMeasurementsCache {\n\n\tprivate readonly _keys: { [key: string]: BareFontInfo };\n\tprivate readonly _values: { [key: string]: FontInfo };\n\n\tconstructor() {\n\t\tthis._keys = Object.create(null);\n\t\tthis._values = Object.create(null);\n\t}\n\n\tpublic has(item: BareFontInfo): boolean {\n\t\tconst itemId = item.getId();\n\t\treturn !!this._values[itemId];\n\t}\n\n\tpublic get(item: BareFontInfo): FontInfo {\n\t\tconst itemId = item.getId();\n\t\treturn this._values[itemId];\n\t}\n\n\tpublic put(item: BareFontInfo, value: FontInfo): void {\n\t\tconst itemId = item.getId();\n\t\tthis._keys[itemId] = item;\n\t\tthis._values[itemId] = value;\n\t}\n\n\tpublic remove(item: BareFontInfo): void {\n\t\tconst itemId = item.getId();\n\t\tdelete this._keys[itemId];\n\t\tdelete this._values[itemId];\n\t}\n\n\tpublic getValues(): FontInfo[] {\n\t\treturn Object.keys(this._keys).map(id => this._values[id]);\n\t}\n}\n\nexport const FontMeasurements = new FontMeasurementsImpl();\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 { WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { createStringBuilder, IStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { LineInjectedText } from 'vs/editor/common/textModelEvents';\nimport { InjectedTextOptions } from 'vs/editor/common/model';\nimport { ILineBreaksComputer, ILineBreaksComputerFactory, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData';\n\nconst ttPolicy = window.trustedTypes?.createPolicy('domLineBreaksComputer', { createHTML: value => value });\n\nexport class DOMLineBreaksComputerFactory implements ILineBreaksComputerFactory {\n\n\tpublic static create(): DOMLineBreaksComputerFactory {\n\t\treturn new DOMLineBreaksComputerFactory();\n\t}\n\n\tconstructor() {\n\t}\n\n\tpublic createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer {\n\t\tconst requests: string[] = [];\n\t\tconst injectedTexts: (LineInjectedText[] | null)[] = [];\n\t\treturn {\n\t\t\taddRequest: (lineText: string, injectedText: LineInjectedText[] | null, previousLineBreakData: ModelLineProjectionData | null) => {\n\t\t\t\trequests.push(lineText);\n\t\t\t\tinjectedTexts.push(injectedText);\n\t\t\t},\n\t\t\tfinalize: () => {\n\t\t\t\treturn createLineBreaks(requests, fontInfo, tabSize, wrappingColumn, wrappingIndent, injectedTexts);\n\t\t\t}\n\t\t};\n\t}\n}\n\nfunction createLineBreaks(requests: string[], fontInfo: FontInfo, tabSize: number, firstLineBreakColumn: number, wrappingIndent: WrappingIndent, injectedTextsPerLine: (LineInjectedText[] | null)[]): (ModelLineProjectionData | null)[] {\n\tfunction createEmptyLineBreakWithPossiblyInjectedText(requestIdx: number): ModelLineProjectionData | null {\n\t\tconst injectedTexts = injectedTextsPerLine[requestIdx];\n\t\tif (injectedTexts) {\n\t\t\tconst lineText = LineInjectedText.applyInjectedText(requests[requestIdx], injectedTexts);\n\n\t\t\tconst injectionOptions = injectedTexts.map(t => t.options);\n\t\t\tconst injectionOffsets = injectedTexts.map(text => text.column - 1);\n\n\t\t\t// creating a `LineBreakData` with an invalid `breakOffsetsVisibleColumn` is OK\n\t\t\t// because `breakOffsetsVisibleColumn` will never be used because it contains injected text\n\t\t\treturn new ModelLineProjectionData(injectionOffsets, injectionOptions, [lineText.length], [], 0);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tif (firstLineBreakColumn === -1) {\n\t\tconst result: (ModelLineProjectionData | null)[] = [];\n\t\tfor (let i = 0, len = requests.length; i < len; i++) {\n\t\t\tresult[i] = createEmptyLineBreakWithPossiblyInjectedText(i);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconst overallWidth = Math.round(firstLineBreakColumn * fontInfo.typicalHalfwidthCharacterWidth);\n\tconst additionalIndent = (wrappingIndent === WrappingIndent.DeepIndent ? 2 : wrappingIndent === WrappingIndent.Indent ? 1 : 0);\n\tconst additionalIndentSize = Math.round(tabSize * additionalIndent);\n\tconst additionalIndentLength = Math.ceil(fontInfo.spaceWidth * additionalIndentSize);\n\n\tconst containerDomNode = document.createElement('div');\n\tapplyFontInfo(containerDomNode, fontInfo);\n\n\tconst sb = createStringBuilder(10000);\n\tconst firstNonWhitespaceIndices: number[] = [];\n\tconst wrappedTextIndentLengths: number[] = [];\n\tconst renderLineContents: string[] = [];\n\tconst allCharOffsets: number[][] = [];\n\tconst allVisibleColumns: number[][] = [];\n\tfor (let i = 0; i < requests.length; i++) {\n\t\tconst lineContent = LineInjectedText.applyInjectedText(requests[i], injectedTextsPerLine[i]);\n\n\t\tlet firstNonWhitespaceIndex = 0;\n\t\tlet wrappedTextIndentLength = 0;\n\t\tlet width = overallWidth;\n\n\t\tif (wrappingIndent !== WrappingIndent.None) {\n\t\t\tfirstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\t\t\tif (firstNonWhitespaceIndex === -1) {\n\t\t\t\t// all whitespace line\n\t\t\t\tfirstNonWhitespaceIndex = 0;\n\n\t\t\t} else {\n\t\t\t\t// Track existing indent\n\n\t\t\t\tfor (let i = 0; i < firstNonWhitespaceIndex; i++) {\n\t\t\t\t\tconst charWidth = (\n\t\t\t\t\t\tlineContent.charCodeAt(i) === CharCode.Tab\n\t\t\t\t\t\t\t? (tabSize - (wrappedTextIndentLength % tabSize))\n\t\t\t\t\t\t\t: 1\n\t\t\t\t\t);\n\t\t\t\t\twrappedTextIndentLength += charWidth;\n\t\t\t\t}\n\n\t\t\t\tconst indentWidth = Math.ceil(fontInfo.spaceWidth * wrappedTextIndentLength);\n\n\t\t\t\t// Force sticking to beginning of line if no character would fit except for the indentation\n\t\t\t\tif (indentWidth + fontInfo.typicalFullwidthCharacterWidth > overallWidth) {\n\t\t\t\t\tfirstNonWhitespaceIndex = 0;\n\t\t\t\t\twrappedTextIndentLength = 0;\n\t\t\t\t} else {\n\t\t\t\t\twidth = overallWidth - indentWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst renderLineContent = lineContent.substr(firstNonWhitespaceIndex);\n\t\tconst tmp = renderLine(renderLineContent, wrappedTextIndentLength, tabSize, width, sb, additionalIndentLength);\n\t\tfirstNonWhitespaceIndices[i] = firstNonWhitespaceIndex;\n\t\twrappedTextIndentLengths[i] = wrappedTextIndentLength;\n\t\trenderLineContents[i] = renderLineContent;\n\t\tallCharOffsets[i] = tmp[0];\n\t\tallVisibleColumns[i] = tmp[1];\n\t}\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy?.createHTML(html) ?? html;\n\tcontainerDomNode.innerHTML = trustedhtml as string;\n\n\tcontainerDomNode.style.position = 'absolute';\n\tcontainerDomNode.style.top = '10000';\n\tcontainerDomNode.style.wordWrap = 'break-word';\n\tdocument.body.appendChild(containerDomNode);\n\n\tconst range = document.createRange();\n\tconst lineDomNodes = Array.prototype.slice.call(containerDomNode.children, 0);\n\n\tconst result: (ModelLineProjectionData | null)[] = [];\n\tfor (let i = 0; i < requests.length; i++) {\n\t\tconst lineDomNode = lineDomNodes[i];\n\t\tconst breakOffsets: number[] | null = readLineBreaks(range, lineDomNode, renderLineContents[i], allCharOffsets[i]);\n\t\tif (breakOffsets === null) {\n\t\t\tresult[i] = createEmptyLineBreakWithPossiblyInjectedText(i);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst firstNonWhitespaceIndex = firstNonWhitespaceIndices[i];\n\t\tconst wrappedTextIndentLength = wrappedTextIndentLengths[i] + additionalIndentSize;\n\t\tconst visibleColumns = allVisibleColumns[i];\n\n\t\tconst breakOffsetsVisibleColumn: number[] = [];\n\t\tfor (let j = 0, len = breakOffsets.length; j < len; j++) {\n\t\t\tbreakOffsetsVisibleColumn[j] = visibleColumns[breakOffsets[j]];\n\t\t}\n\n\t\tif (firstNonWhitespaceIndex !== 0) {\n\t\t\t// All break offsets are relative to the renderLineContent, make them absolute again\n\t\t\tfor (let j = 0, len = breakOffsets.length; j < len; j++) {\n\t\t\t\tbreakOffsets[j] += firstNonWhitespaceIndex;\n\t\t\t}\n\t\t}\n\n\t\tlet injectionOptions: InjectedTextOptions[] | null;\n\t\tlet injectionOffsets: number[] | null;\n\t\tconst curInjectedTexts = injectedTextsPerLine[i];\n\t\tif (curInjectedTexts) {\n\t\t\tinjectionOptions = curInjectedTexts.map(t => t.options);\n\t\t\tinjectionOffsets = curInjectedTexts.map(text => text.column - 1);\n\t\t} else {\n\t\t\tinjectionOptions = null;\n\t\t\tinjectionOffsets = null;\n\t\t}\n\n\t\tresult[i] = new ModelLineProjectionData(injectionOffsets, injectionOptions, breakOffsets, breakOffsetsVisibleColumn, wrappedTextIndentLength);\n\t}\n\n\tdocument.body.removeChild(containerDomNode);\n\treturn result;\n}\n\nconst enum Constants {\n\tSPAN_MODULO_LIMIT = 16384\n}\n\nfunction renderLine(lineContent: string, initialVisibleColumn: number, tabSize: number, width: number, sb: IStringBuilder, wrappingIndentLength: number): [number[], number[]] {\n\n\tif (wrappingIndentLength !== 0) {\n\t\tconst hangingOffset = String(wrappingIndentLength);\n\t\tsb.appendASCIIString('<div style=\"text-indent: -');\n\t\tsb.appendASCIIString(hangingOffset);\n\t\tsb.appendASCIIString('px; padding-left: ');\n\t\tsb.appendASCIIString(hangingOffset);\n\t\tsb.appendASCIIString('px; box-sizing: border-box; width:');\n\t} else {\n\t\tsb.appendASCIIString('<div style=\"width:');\n\t}\n\tsb.appendASCIIString(String(width));\n\tsb.appendASCIIString('px;\">');\n\t// if (containsRTL) {\n\t// \tsb.appendASCIIString('\" dir=\"ltr');\n\t// }\n\n\tconst len = lineContent.length;\n\tlet visibleColumn = initialVisibleColumn;\n\tlet charOffset = 0;\n\tconst charOffsets: number[] = [];\n\tconst visibleColumns: number[] = [];\n\tlet nextCharCode = (0 < len ? lineContent.charCodeAt(0) : CharCode.Null);\n\n\tsb.appendASCIIString('<span>');\n\tfor (let charIndex = 0; charIndex < len; charIndex++) {\n\t\tif (charIndex !== 0 && charIndex % Constants.SPAN_MODULO_LIMIT === 0) {\n\t\t\tsb.appendASCIIString('</span><span>');\n\t\t}\n\t\tcharOffsets[charIndex] = charOffset;\n\t\tvisibleColumns[charIndex] = visibleColumn;\n\t\tconst charCode = nextCharCode;\n\t\tnextCharCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : CharCode.Null);\n\t\tlet producedCharacters = 1;\n\t\tlet charWidth = 1;\n\t\tswitch (charCode) {\n\t\t\tcase CharCode.Tab:\n\t\t\t\tproducedCharacters = (tabSize - (visibleColumn % tabSize));\n\t\t\t\tcharWidth = producedCharacters;\n\t\t\t\tfor (let space = 1; space <= producedCharacters; space++) {\n\t\t\t\t\tif (space < producedCharacters) {\n\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t} else {\n\t\t\t\t\t\tsb.appendASCII(CharCode.Space);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Space:\n\t\t\t\tif (nextCharCode === CharCode.Space) {\n\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t} else {\n\t\t\t\t\tsb.appendASCII(CharCode.Space);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.LessThan:\n\t\t\t\tsb.appendASCIIString('<');\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.GreaterThan:\n\t\t\t\tsb.appendASCIIString('>');\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Ampersand:\n\t\t\t\tsb.appendASCIIString('&');\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Null:\n\t\t\t\tsb.appendASCIIString('�');\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.UTF8_BOM:\n\t\t\tcase CharCode.LINE_SEPARATOR:\n\t\t\tcase CharCode.PARAGRAPH_SEPARATOR:\n\t\t\tcase CharCode.NEXT_LINE:\n\t\t\t\tsb.write1(0xFFFD);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif (strings.isFullWidthCharacter(charCode)) {\n\t\t\t\t\tcharWidth++;\n\t\t\t\t}\n\t\t\t\tif (charCode < 32) {\n\t\t\t\t\tsb.write1(9216 + charCode);\n\t\t\t\t} else {\n\t\t\t\t\tsb.write1(charCode);\n\t\t\t\t}\n\t\t}\n\n\t\tcharOffset += producedCharacters;\n\t\tvisibleColumn += charWidth;\n\t}\n\tsb.appendASCIIString('</span>');\n\n\tcharOffsets[lineContent.length] = charOffset;\n\tvisibleColumns[lineContent.length] = visibleColumn;\n\n\tsb.appendASCIIString('</div>');\n\n\treturn [charOffsets, visibleColumns];\n}\n\nfunction readLineBreaks(range: Range, lineDomNode: HTMLDivElement, lineContent: string, charOffsets: number[]): number[] | null {\n\tif (lineContent.length <= 1) {\n\t\treturn null;\n\t}\n\tconst spans = <HTMLSpanElement[]>Array.prototype.slice.call(lineDomNode.children, 0);\n\n\tconst breakOffsets: number[] = [];\n\ttry {\n\t\tdiscoverBreaks(range, spans, charOffsets, 0, null, lineContent.length - 1, null, breakOffsets);\n\t} catch (err) {\n\t\tconsole.log(err);\n\t\treturn null;\n\t}\n\n\tif (breakOffsets.length === 0) {\n\t\treturn null;\n\t}\n\n\tbreakOffsets.push(lineContent.length);\n\treturn breakOffsets;\n}\n\nfunction discoverBreaks(range: Range, spans: HTMLSpanElement[], charOffsets: number[], low: number, lowRects: DOMRectList | null, high: number, highRects: DOMRectList | null, result: number[]): void {\n\tif (low === high) {\n\t\treturn;\n\t}\n\n\tlowRects = lowRects || readClientRect(range, spans, charOffsets[low], charOffsets[low + 1]);\n\thighRects = highRects || readClientRect(range, spans, charOffsets[high], charOffsets[high + 1]);\n\n\tif (Math.abs(lowRects[0].top - highRects[0].top) <= 0.1) {\n\t\t// same line\n\t\treturn;\n\t}\n\n\t// there is at least one line break between these two offsets\n\tif (low + 1 === high) {\n\t\t// the two characters are adjacent, so the line break must be exactly between them\n\t\tresult.push(high);\n\t\treturn;\n\t}\n\n\tconst mid = low + ((high - low) / 2) | 0;\n\tconst midRects = readClientRect(range, spans, charOffsets[mid], charOffsets[mid + 1]);\n\tdiscoverBreaks(range, spans, charOffsets, low, lowRects, mid, midRects, result);\n\tdiscoverBreaks(range, spans, charOffsets, mid, midRects, high, highRects, result);\n}\n\nfunction readClientRect(range: Range, spans: HTMLSpanElement[], startOffset: number, endOffset: number): DOMRectList {\n\trange.setStart(spans[(startOffset / Constants.SPAN_MODULO_LIMIT) | 0].firstChild!, startOffset % Constants.SPAN_MODULO_LIMIT);\n\trange.setEnd(spans[(endOffset / Constants.SPAN_MODULO_LIMIT) | 0].firstChild!, endOffset % Constants.SPAN_MODULO_LIMIT);\n\treturn range.getClientRects();\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { IVisibleLine, IVisibleLinesHost, VisibleLinesCollection } from 'vs/editor/browser/view/viewLayer';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { IStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nexport class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOverlayLine> {\n\n\tprivate readonly _visibleLines: VisibleLinesCollection<ViewOverlayLine>;\n\tprotected readonly domNode: FastDomNode<HTMLElement>;\n\tprivate _dynamicOverlays: DynamicViewOverlay[];\n\tprivate _isFocused: boolean;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tthis._visibleLines = new VisibleLinesCollection<ViewOverlayLine>(this);\n\t\tthis.domNode = this._visibleLines.domNode;\n\n\t\tthis._dynamicOverlays = [];\n\t\tthis._isFocused = false;\n\n\t\tthis.domNode.setClassName('view-overlays');\n\t}\n\n\tpublic override shouldRender(): boolean {\n\t\tif (super.shouldRender()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (let i = 0, len = this._dynamicOverlays.length; i < len; i++) {\n\t\t\tconst dynamicOverlay = this._dynamicOverlays[i];\n\t\t\tif (dynamicOverlay.shouldRender()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\n\t\tfor (let i = 0, len = this._dynamicOverlays.length; i < len; i++) {\n\t\t\tconst dynamicOverlay = this._dynamicOverlays[i];\n\t\t\tdynamicOverlay.dispose();\n\t\t}\n\t\tthis._dynamicOverlays = [];\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this.domNode;\n\t}\n\n\t// ---- begin IVisibleLinesHost\n\n\tpublic createVisibleLine(): ViewOverlayLine {\n\t\treturn new ViewOverlayLine(this._context.configuration, this._dynamicOverlays);\n\t}\n\n\t// ---- end IVisibleLinesHost\n\n\tpublic addDynamicOverlay(overlay: DynamicViewOverlay): void {\n\t\tthis._dynamicOverlays.push(overlay);\n\t}\n\n\t// ----- event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis._visibleLines.onConfigurationChanged(e);\n\t\tconst startLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst endLineNumber = this._visibleLines.getEndLineNumber();\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst line = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\tline.onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn this._visibleLines.onFlushed(e);\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis._isFocused = e.isFocused;\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._visibleLines.onLinesChanged(e);\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn this._visibleLines.onLinesDeleted(e);\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn this._visibleLines.onLinesInserted(e);\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn this._visibleLines.onScrollChanged(e) || true;\n\t}\n\tpublic override onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._visibleLines.onTokensChanged(e);\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn this._visibleLines.onZonesChanged(e);\n\t}\n\n\t// ----- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst toRender = this._dynamicOverlays.filter(overlay => overlay.shouldRender());\n\n\t\tfor (let i = 0, len = toRender.length; i < len; i++) {\n\t\t\tconst dynamicOverlay = toRender[i];\n\t\t\tdynamicOverlay.prepareRender(ctx);\n\t\t\tdynamicOverlay.onDidRender();\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\t// Overwriting to bypass `shouldRender` flag\n\t\tthis._viewOverlaysRender(ctx);\n\n\t\tthis.domNode.toggleClassName('focused', this._isFocused);\n\t}\n\n\t_viewOverlaysRender(ctx: RestrictedRenderingContext): void {\n\t\tthis._visibleLines.renderLines(ctx.viewportData);\n\t}\n}\n\nexport class ViewOverlayLine implements IVisibleLine {\n\n\tprivate readonly _configuration: IEditorConfiguration;\n\tprivate readonly _dynamicOverlays: DynamicViewOverlay[];\n\tprivate _domNode: FastDomNode<HTMLElement> | null;\n\tprivate _renderedContent: string | null;\n\tprivate _lineHeight: number;\n\n\tconstructor(configuration: IEditorConfiguration, dynamicOverlays: DynamicViewOverlay[]) {\n\t\tthis._configuration = configuration;\n\t\tthis._lineHeight = this._configuration.options.get(EditorOption.lineHeight);\n\t\tthis._dynamicOverlays = dynamicOverlays;\n\n\t\tthis._domNode = null;\n\t\tthis._renderedContent = null;\n\t}\n\n\tpublic getDomNode(): HTMLElement | null {\n\t\tif (!this._domNode) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._domNode.domNode;\n\t}\n\tpublic setDomNode(domNode: HTMLElement): void {\n\t\tthis._domNode = createFastDomNode(domNode);\n\t}\n\n\tpublic onContentChanged(): void {\n\t\t// Nothing\n\t}\n\tpublic onTokensChanged(): void {\n\t\t// Nothing\n\t}\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tthis._lineHeight = this._configuration.options.get(EditorOption.lineHeight);\n\t}\n\n\tpublic renderLine(lineNumber: number, deltaTop: number, viewportData: ViewportData, sb: IStringBuilder): boolean {\n\t\tlet result = '';\n\t\tfor (let i = 0, len = this._dynamicOverlays.length; i < len; i++) {\n\t\t\tconst dynamicOverlay = this._dynamicOverlays[i];\n\t\t\tresult += dynamicOverlay.render(viewportData.startLineNumber, lineNumber);\n\t\t}\n\n\t\tif (this._renderedContent === result) {\n\t\t\t// No rendering needed\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._renderedContent = result;\n\n\t\tsb.appendASCIIString('<div style=\"position:absolute;top:');\n\t\tsb.appendASCIIString(String(deltaTop));\n\t\tsb.appendASCIIString('px;width:100%;height:');\n\t\tsb.appendASCIIString(String(this._lineHeight));\n\t\tsb.appendASCIIString('px;\">');\n\t\tsb.appendASCIIString(result);\n\t\tsb.appendASCIIString('</div>');\n\n\t\treturn true;\n\t}\n\n\tpublic layoutLine(lineNumber: number, deltaTop: number): void {\n\t\tif (this._domNode) {\n\t\t\tthis._domNode.setTop(deltaTop);\n\t\t\tthis._domNode.setHeight(this._lineHeight);\n\t\t}\n\t}\n}\n\nexport class ContentViewOverlays extends ViewOverlays {\n\n\tprivate _contentWidth: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\n\t\tthis.domNode.setHeight(0);\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\treturn super.onConfigurationChanged(e) || true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn super.onScrollChanged(e) || e.scrollWidthChanged;\n\t}\n\n\t// --- end event handlers\n\n\toverride _viewOverlaysRender(ctx: RestrictedRenderingContext): void {\n\t\tsuper._viewOverlaysRender(ctx);\n\n\t\tthis.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth));\n\t}\n}\n\nexport class MarginViewOverlays extends ViewOverlays {\n\n\tprivate _contentLeft: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis.domNode.setClassName('margin-view-overlays');\n\t\tthis.domNode.setWidth(1);\n\n\t\tapplyFontInfo(this.domNode, options.get(EditorOption.fontInfo));\n\t}\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tapplyFontInfo(this.domNode, options.get(EditorOption.fontInfo));\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\treturn super.onConfigurationChanged(e) || true;\n\t}\n\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn super.onScrollChanged(e) || e.scrollHeightChanged;\n\t}\n\n\toverride _viewOverlaysRender(ctx: RestrictedRenderingContext): void {\n\t\tsuper._viewOverlaysRender(ctx);\n\t\tconst height = Math.min(ctx.scrollHeight, 1000000);\n\t\tthis.domNode.setHeight(height);\n\t\tthis.domNode.setWidth(this._contentLeft);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport * as strings from 'vs/base/common/strings';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { TextEditorCursorStyle, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor';\n\nexport interface IViewCursorRenderData {\n\tdomNode: HTMLElement;\n\tposition: Position;\n\tcontentLeft: number;\n\twidth: number;\n\theight: number;\n}\n\nclass ViewCursorRenderData {\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number,\n\t\tpublic readonly textContent: string,\n\t\tpublic readonly textContentClassName: string\n\t) { }\n}\n\nexport class ViewCursor {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\n\tprivate _cursorStyle: TextEditorCursorStyle;\n\tprivate _lineCursorWidth: number;\n\tprivate _lineHeight: number;\n\tprivate _typicalHalfwidthCharacterWidth: number;\n\n\tprivate _isVisible: boolean;\n\n\tprivate _position: Position;\n\n\tprivate _lastRenderedContent: string;\n\tprivate _renderData: ViewCursorRenderData | null;\n\n\tconstructor(context: ViewContext) {\n\t\tthis._context = context;\n\t\tconst options = this._context.configuration.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis._cursorStyle = options.get(EditorOption.cursorStyle);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._lineCursorWidth = Math.min(options.get(EditorOption.cursorWidth), this._typicalHalfwidthCharacterWidth);\n\n\t\tthis._isVisible = true;\n\n\t\t// Create the dom node\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tthis._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);\n\t\tthis._domNode.setHeight(this._lineHeight);\n\t\tthis._domNode.setTop(0);\n\t\tthis._domNode.setLeft(0);\n\t\tapplyFontInfo(this._domNode, fontInfo);\n\t\tthis._domNode.setDisplay('none');\n\n\t\tthis._position = new Position(1, 1);\n\n\t\tthis._lastRenderedContent = '';\n\t\tthis._renderData = null;\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): Position {\n\t\treturn this._position;\n\t}\n\n\tpublic show(): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._domNode.setVisibility('inherit');\n\t\t\tthis._isVisible = true;\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (this._isVisible) {\n\t\t\tthis._domNode.setVisibility('hidden');\n\t\t\tthis._isVisible = false;\n\t\t}\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis._cursorStyle = options.get(EditorOption.cursorStyle);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._lineCursorWidth = Math.min(options.get(EditorOption.cursorWidth), this._typicalHalfwidthCharacterWidth);\n\t\tapplyFontInfo(this._domNode, fontInfo);\n\n\t\treturn true;\n\t}\n\n\tpublic onCursorPositionChanged(position: Position): boolean {\n\t\tthis._position = position;\n\t\treturn true;\n\t}\n\n\t/**\n\t * If `this._position` is inside a grapheme, returns the position where the grapheme starts.\n\t * Also returns the next grapheme.\n\t */\n\tprivate _getGraphemeAwarePosition(): [Position, string] {\n\t\tconst { lineNumber, column } = this._position;\n\t\tconst lineContent = this._context.viewModel.getLineContent(lineNumber);\n\t\tconst [startOffset, endOffset] = strings.getCharContainingOffset(lineContent, column - 1);\n\t\treturn [new Position(lineNumber, startOffset + 1), lineContent.substring(startOffset, endOffset)];\n\t}\n\n\tprivate _prepareRender(ctx: RenderingContext): ViewCursorRenderData | null {\n\t\tlet textContent = '';\n\t\tconst [position, nextGrapheme] = this._getGraphemeAwarePosition();\n\n\t\tif (this._cursorStyle === TextEditorCursorStyle.Line || this._cursorStyle === TextEditorCursorStyle.LineThin) {\n\t\t\tconst visibleRange = ctx.visibleRangeForPosition(position);\n\t\t\tif (!visibleRange || visibleRange.outsideRenderedLine) {\n\t\t\t\t// Outside viewport\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet width: number;\n\t\t\tif (this._cursorStyle === TextEditorCursorStyle.Line) {\n\t\t\t\twidth = dom.computeScreenAwareSize(this._lineCursorWidth > 0 ? this._lineCursorWidth : 2);\n\t\t\t\tif (width > 2) {\n\t\t\t\t\ttextContent = nextGrapheme;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twidth = dom.computeScreenAwareSize(1);\n\t\t\t}\n\n\t\t\tlet left = visibleRange.left;\n\t\t\tif (width >= 2 && left >= 1) {\n\t\t\t\t// try to center cursor\n\t\t\t\tleft -= 1;\n\t\t\t}\n\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.bigNumbersDelta;\n\t\t\treturn new ViewCursorRenderData(top, left, width, this._lineHeight, textContent, '');\n\t\t}\n\n\t\tconst visibleRangeForCharacter = ctx.linesVisibleRangesForRange(new Range(position.lineNumber, position.column, position.lineNumber, position.column + nextGrapheme.length), false);\n\t\tif (!visibleRangeForCharacter || visibleRangeForCharacter.length === 0) {\n\t\t\t// Outside viewport\n\t\t\treturn null;\n\t\t}\n\n\t\tconst firstVisibleRangeForCharacter = visibleRangeForCharacter[0];\n\t\tif (firstVisibleRangeForCharacter.outsideRenderedLine || firstVisibleRangeForCharacter.ranges.length === 0) {\n\t\t\t// Outside viewport\n\t\t\treturn null;\n\t\t}\n\n\t\tconst range = firstVisibleRangeForCharacter.ranges[0];\n\t\tconst width = range.width < 1 ? this._typicalHalfwidthCharacterWidth : range.width;\n\n\t\tlet textContentClassName = '';\n\t\tif (this._cursorStyle === TextEditorCursorStyle.Block) {\n\t\t\tconst lineData = this._context.viewModel.getViewLineData(position.lineNumber);\n\t\t\ttextContent = nextGrapheme;\n\t\t\tconst tokenIndex = lineData.tokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\ttextContentClassName = lineData.tokens.getClassName(tokenIndex);\n\t\t}\n\n\t\tlet top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.bigNumbersDelta;\n\t\tlet height = this._lineHeight;\n\n\t\t// Underline might interfere with clicking\n\t\tif (this._cursorStyle === TextEditorCursorStyle.Underline || this._cursorStyle === TextEditorCursorStyle.UnderlineThin) {\n\t\t\ttop += this._lineHeight - 2;\n\t\t\theight = 2;\n\t\t}\n\n\t\treturn new ViewCursorRenderData(top, range.left, width, height, textContent, textContentClassName);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRender(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): IViewCursorRenderData | null {\n\t\tif (!this._renderData) {\n\t\t\tthis._domNode.setDisplay('none');\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._lastRenderedContent !== this._renderData.textContent) {\n\t\t\tthis._lastRenderedContent = this._renderData.textContent;\n\t\t\tthis._domNode.domNode.textContent = this._lastRenderedContent;\n\t\t}\n\n\t\tthis._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`);\n\n\t\tthis._domNode.setDisplay('block');\n\t\tthis._domNode.setTop(this._renderData.top);\n\t\tthis._domNode.setLeft(this._renderData.left);\n\t\tthis._domNode.setWidth(this._renderData.width);\n\t\tthis._domNode.setLineHeight(this._renderData.height);\n\t\tthis._domNode.setHeight(this._renderData.height);\n\n\t\treturn {\n\t\t\tdomNode: this._domNode.domNode,\n\t\t\tposition: this._position,\n\t\t\tcontentLeft: this._renderData.left,\n\t\t\theight: this._renderData.height,\n\t\t\twidth: 2\n\t\t};\n\t}\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { IModelDecoration, ITextModel, PositionAffinity } from 'vs/editor/common/model';\nimport { IViewModelLines } from 'vs/editor/common/viewModel/viewModelLines';\nimport { ICoordinatesConverter, InlineDecoration, InlineDecorationType, ViewModelDecoration } from 'vs/editor/common/viewModel';\nimport { filterValidationDecorations } from 'vs/editor/common/config/editorOptions';\nimport { StandardTokenType } from 'vs/editor/common/languages';\n\nexport interface IDecorationsViewportData {\n\t/**\n\t * decorations in the viewport.\n\t */\n\treadonly decorations: ViewModelDecoration[];\n\t/**\n\t * inline decorations grouped by each line in the viewport.\n\t */\n\treadonly inlineDecorations: InlineDecoration[][];\n}\n\nexport class ViewModelDecorations implements IDisposable {\n\n\tprivate readonly editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly _linesCollection: IViewModelLines;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tprivate _decorationsCache: { [decorationId: string]: ViewModelDecoration };\n\n\tprivate _cachedModelDecorationsResolver: IDecorationsViewportData | null;\n\tprivate _cachedModelDecorationsResolverViewRange: Range | null;\n\n\tconstructor(editorId: number, model: ITextModel, configuration: IEditorConfiguration, linesCollection: IViewModelLines, coordinatesConverter: ICoordinatesConverter) {\n\t\tthis.editorId = editorId;\n\t\tthis.model = model;\n\t\tthis.configuration = configuration;\n\t\tthis._linesCollection = linesCollection;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tprivate _clearCachedModelDecorationsResolver(): void {\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onModelDecorationsChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onLineMappingChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tprivate _getOrCreateViewModelDecoration(modelDecoration: IModelDecoration): ViewModelDecoration {\n\t\tconst id = modelDecoration.id;\n\t\tlet r = this._decorationsCache[id];\n\t\tif (!r) {\n\t\t\tconst modelRange = modelDecoration.range;\n\t\t\tconst options = modelDecoration.options;\n\t\t\tlet viewRange: Range;\n\t\t\tif (options.isWholeLine) {\n\t\t\t\tconst start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1), PositionAffinity.Left);\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)), PositionAffinity.Right);\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\t// For backwards compatibility reasons, we want injected text before any decoration.\n\t\t\t\t// Thus, move decorations to the right.\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange, PositionAffinity.Right);\n\t\t\t}\n\t\t\tr = new ViewModelDecoration(viewRange, options);\n\t\t\tthis._decorationsCache[id] = r;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic getDecorationsViewportData(viewRange: Range): IDecorationsViewportData {\n\t\tlet cacheIsValid = (this._cachedModelDecorationsResolver !== null);\n\t\tcacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));\n\t\tif (!cacheIsValid) {\n\t\t\tthis._cachedModelDecorationsResolver = this._getDecorationsViewportData(viewRange);\n\t\t\tthis._cachedModelDecorationsResolverViewRange = viewRange;\n\t\t}\n\t\treturn this._cachedModelDecorationsResolver!;\n\t}\n\n\tprivate _getDecorationsViewportData(viewportRange: Range): IDecorationsViewportData {\n\t\tconst modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, filterValidationDecorations(this.configuration.options));\n\n\t\tconst startLineNumber = viewportRange.startLineNumber;\n\t\tconst endLineNumber = viewportRange.endLineNumber;\n\n\t\tconst decorationsInViewport: ViewModelDecoration[] = [];\n\t\tlet decorationsInViewportLen = 0;\n\t\tconst inlineDecorations: InlineDecoration[][] = [];\n\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\tinlineDecorations[j - startLineNumber] = [];\n\t\t}\n\n\t\tfor (let i = 0, len = modelDecorations.length; i < len; i++) {\n\t\t\tconst modelDecoration = modelDecorations[i];\n\t\t\tconst decorationOptions = modelDecoration.options;\n\n\t\t\tif (!isModelDecorationVisible(this.model, modelDecoration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tconst viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tconst inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tconst intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tconst intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);\n\t\t\t\tfor (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {\n\t\t\t\t\tinlineDecorations[j - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.beforeContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn),\n\t\t\t\t\t\tdecorationOptions.beforeContentClassName,\n\t\t\t\t\t\tInlineDecorationType.Before\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.afterContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn),\n\t\t\t\t\t\tdecorationOptions.afterContentClassName,\n\t\t\t\t\t\tInlineDecorationType.After\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdecorations: decorationsInViewport,\n\t\t\tinlineDecorations: inlineDecorations\n\t\t};\n\t}\n}\n\nexport function isModelDecorationVisible(model: ITextModel, decoration: IModelDecoration): boolean {\n\tif (decoration.options.hideInCommentTokens && isModelDecorationInComment(model, decoration)) {\n\t\treturn false;\n\t}\n\n\tif (decoration.options.hideInStringTokens && isModelDecorationInString(model, decoration)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport function isModelDecorationInComment(model: ITextModel, decoration: IModelDecoration): boolean {\n\treturn testTokensInRange(\n\t\tmodel,\n\t\tdecoration.range,\n\t\t(tokenType) => tokenType === StandardTokenType.Comment\n\t);\n}\n\nexport function isModelDecorationInString(model: ITextModel, decoration: IModelDecoration): boolean {\n\treturn testTokensInRange(\n\t\tmodel,\n\t\tdecoration.range,\n\t\t(tokenType) => tokenType === StandardTokenType.String\n\t);\n}\n\n/**\n * Calls the callback for every token that intersects the range.\n * If the callback returns `false`, iteration stops and `false` is returned.\n * Otherwise, `true` is returned.\n */\nfunction testTokensInRange(model: ITextModel, range: Range, callback: (tokenType: StandardTokenType) => boolean): boolean {\n\tfor (let lineNumber = range.startLineNumber; lineNumber <= range.endLineNumber; lineNumber++) {\n\t\tconst lineTokens = model.getLineTokens(lineNumber);\n\t\tconst isFirstLine = lineNumber === range.startLineNumber;\n\t\tconst isEndLine = lineNumber === range.endLineNumber;\n\n\t\tlet tokenIdx = isFirstLine ? lineTokens.findTokenIndexAtOffset(range.startColumn - 1) : 0;\n\t\twhile (tokenIdx < lineTokens.getCount()) {\n\t\t\tif (isEndLine) {\n\t\t\t\tconst startOffset = lineTokens.getStartOffset(tokenIdx);\n\t\t\t\tif (startOffset > range.endColumn - 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst callbackResult = callback(lineTokens.getStandardTokenType(tokenIdx));\n\t\t\tif (!callbackResult) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ttokenIdx++;\n\t\t}\n\t}\n\treturn true;\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 * as nls from 'vs/nls';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { EndOfLineSequence, ICursorStateComputer, IValidEditOperation, ITextModel } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { IUndoRedoService, IResourceUndoRedoElement, UndoRedoElementType, IWorkspaceUndoRedoElement } from 'vs/platform/undoRedo/common/undoRedo';\nimport { URI } from 'vs/base/common/uri';\nimport { TextChange, compressConsecutiveTextChanges } from 'vs/editor/common/core/textChange';\nimport * as buffer from 'vs/base/common/buffer';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { basename } from 'vs/base/common/resources';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\n\nfunction uriGetComparisonKey(resource: URI): string {\n\treturn resource.toString();\n}\n\nexport class SingleModelEditStackData {\n\n\tpublic static create(model: ITextModel, beforeCursorState: Selection[] | null): SingleModelEditStackData {\n\t\tconst alternativeVersionId = model.getAlternativeVersionId();\n\t\tconst eol = getModelEOL(model);\n\t\treturn new SingleModelEditStackData(\n\t\t\talternativeVersionId,\n\t\t\talternativeVersionId,\n\t\t\teol,\n\t\t\teol,\n\t\t\tbeforeCursorState,\n\t\t\tbeforeCursorState,\n\t\t\t[]\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly beforeVersionId: number,\n\t\tpublic afterVersionId: number,\n\t\tpublic readonly beforeEOL: EndOfLineSequence,\n\t\tpublic afterEOL: EndOfLineSequence,\n\t\tpublic readonly beforeCursorState: Selection[] | null,\n\t\tpublic afterCursorState: Selection[] | null,\n\t\tpublic changes: TextChange[]\n\t) { }\n\n\tpublic append(model: ITextModel, textChanges: TextChange[], afterEOL: EndOfLineSequence, afterVersionId: number, afterCursorState: Selection[] | null): void {\n\t\tif (textChanges.length > 0) {\n\t\t\tthis.changes = compressConsecutiveTextChanges(this.changes, textChanges);\n\t\t}\n\t\tthis.afterEOL = afterEOL;\n\t\tthis.afterVersionId = afterVersionId;\n\t\tthis.afterCursorState = afterCursorState;\n\t}\n\n\tprivate static _writeSelectionsSize(selections: Selection[] | null): number {\n\t\treturn 4 + 4 * 4 * (selections ? selections.length : 0);\n\t}\n\n\tprivate static _writeSelections(b: Uint8Array, selections: Selection[] | null, offset: number): number {\n\t\tbuffer.writeUInt32BE(b, (selections ? selections.length : 0), offset); offset += 4;\n\t\tif (selections) {\n\t\t\tfor (const selection of selections) {\n\t\t\t\tbuffer.writeUInt32BE(b, selection.selectionStartLineNumber, offset); offset += 4;\n\t\t\t\tbuffer.writeUInt32BE(b, selection.selectionStartColumn, offset); offset += 4;\n\t\t\t\tbuffer.writeUInt32BE(b, selection.positionLineNumber, offset); offset += 4;\n\t\t\t\tbuffer.writeUInt32BE(b, selection.positionColumn, offset); offset += 4;\n\t\t\t}\n\t\t}\n\t\treturn offset;\n\t}\n\n\tprivate static _readSelections(b: Uint8Array, offset: number, dest: Selection[]): number {\n\t\tconst count = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tconst selectionStartLineNumber = buffer.readUInt32BE(b, offset); offset += 4;\n\t\t\tconst selectionStartColumn = buffer.readUInt32BE(b, offset); offset += 4;\n\t\t\tconst positionLineNumber = buffer.readUInt32BE(b, offset); offset += 4;\n\t\t\tconst positionColumn = buffer.readUInt32BE(b, offset); offset += 4;\n\t\t\tdest.push(new Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn));\n\t\t}\n\t\treturn offset;\n\t}\n\n\tpublic serialize(): ArrayBuffer {\n\t\tlet necessarySize = (\n\t\t\t+ 4 // beforeVersionId\n\t\t\t+ 4 // afterVersionId\n\t\t\t+ 1 // beforeEOL\n\t\t\t+ 1 // afterEOL\n\t\t\t+ SingleModelEditStackData._writeSelectionsSize(this.beforeCursorState)\n\t\t\t+ SingleModelEditStackData._writeSelectionsSize(this.afterCursorState)\n\t\t\t+ 4 // change count\n\t\t);\n\t\tfor (const change of this.changes) {\n\t\t\tnecessarySize += change.writeSize();\n\t\t}\n\n\t\tconst b = new Uint8Array(necessarySize);\n\t\tlet offset = 0;\n\t\tbuffer.writeUInt32BE(b, this.beforeVersionId, offset); offset += 4;\n\t\tbuffer.writeUInt32BE(b, this.afterVersionId, offset); offset += 4;\n\t\tbuffer.writeUInt8(b, this.beforeEOL, offset); offset += 1;\n\t\tbuffer.writeUInt8(b, this.afterEOL, offset); offset += 1;\n\t\toffset = SingleModelEditStackData._writeSelections(b, this.beforeCursorState, offset);\n\t\toffset = SingleModelEditStackData._writeSelections(b, this.afterCursorState, offset);\n\t\tbuffer.writeUInt32BE(b, this.changes.length, offset); offset += 4;\n\t\tfor (const change of this.changes) {\n\t\t\toffset = change.write(b, offset);\n\t\t}\n\t\treturn b.buffer;\n\t}\n\n\tpublic static deserialize(source: ArrayBuffer): SingleModelEditStackData {\n\t\tconst b = new Uint8Array(source);\n\t\tlet offset = 0;\n\t\tconst beforeVersionId = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tconst afterVersionId = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tconst beforeEOL = buffer.readUInt8(b, offset); offset += 1;\n\t\tconst afterEOL = buffer.readUInt8(b, offset); offset += 1;\n\t\tconst beforeCursorState: Selection[] = [];\n\t\toffset = SingleModelEditStackData._readSelections(b, offset, beforeCursorState);\n\t\tconst afterCursorState: Selection[] = [];\n\t\toffset = SingleModelEditStackData._readSelections(b, offset, afterCursorState);\n\t\tconst changeCount = buffer.readUInt32BE(b, offset); offset += 4;\n\t\tconst changes: TextChange[] = [];\n\t\tfor (let i = 0; i < changeCount; i++) {\n\t\t\toffset = TextChange.read(b, offset, changes);\n\t\t}\n\t\treturn new SingleModelEditStackData(\n\t\t\tbeforeVersionId,\n\t\t\tafterVersionId,\n\t\t\tbeforeEOL,\n\t\t\tafterEOL,\n\t\t\tbeforeCursorState,\n\t\t\tafterCursorState,\n\t\t\tchanges\n\t\t);\n\t}\n}\n\nexport interface IUndoRedoDelegate {\n\tprepareUndoRedo(element: MultiModelEditStackElement): Promise<IDisposable> | IDisposable | void;\n}\n\nexport class SingleModelEditStackElement implements IResourceUndoRedoElement {\n\n\tpublic model: ITextModel | URI;\n\tprivate _data: SingleModelEditStackData | ArrayBuffer;\n\n\tpublic get type(): UndoRedoElementType.Resource {\n\t\treturn UndoRedoElementType.Resource;\n\t}\n\n\tpublic get resource(): URI {\n\t\tif (URI.isUri(this.model)) {\n\t\t\treturn this.model;\n\t\t}\n\t\treturn this.model.uri;\n\t}\n\n\tpublic get label(): string {\n\t\treturn nls.localize('edit', \"Typing\");\n\t}\n\n\tconstructor(model: ITextModel, beforeCursorState: Selection[] | null) {\n\t\tthis.model = model;\n\t\tthis._data = SingleModelEditStackData.create(model, beforeCursorState);\n\t}\n\n\tpublic toString(): string {\n\t\tconst data = (this._data instanceof SingleModelEditStackData ? this._data : SingleModelEditStackData.deserialize(this._data));\n\t\treturn data.changes.map(change => change.toString()).join(', ');\n\t}\n\n\tpublic matchesResource(resource: URI): boolean {\n\t\tconst uri = (URI.isUri(this.model) ? this.model : this.model.uri);\n\t\treturn (uri.toString() === resource.toString());\n\t}\n\n\tpublic setModel(model: ITextModel | URI): void {\n\t\tthis.model = model;\n\t}\n\n\tpublic canAppend(model: ITextModel): boolean {\n\t\treturn (this.model === model && this._data instanceof SingleModelEditStackData);\n\t}\n\n\tpublic append(model: ITextModel, textChanges: TextChange[], afterEOL: EndOfLineSequence, afterVersionId: number, afterCursorState: Selection[] | null): void {\n\t\tif (this._data instanceof SingleModelEditStackData) {\n\t\t\tthis._data.append(model, textChanges, afterEOL, afterVersionId, afterCursorState);\n\t\t}\n\t}\n\n\tpublic close(): void {\n\t\tif (this._data instanceof SingleModelEditStackData) {\n\t\t\tthis._data = this._data.serialize();\n\t\t}\n\t}\n\n\tpublic open(): void {\n\t\tif (!(this._data instanceof SingleModelEditStackData)) {\n\t\t\tthis._data = SingleModelEditStackData.deserialize(this._data);\n\t\t}\n\t}\n\n\tpublic undo(): void {\n\t\tif (URI.isUri(this.model)) {\n\t\t\t// don't have a model\n\t\t\tthrow new Error(`Invalid SingleModelEditStackElement`);\n\t\t}\n\t\tif (this._data instanceof SingleModelEditStackData) {\n\t\t\tthis._data = this._data.serialize();\n\t\t}\n\t\tconst data = SingleModelEditStackData.deserialize(this._data);\n\t\tthis.model._applyUndo(data.changes, data.beforeEOL, data.beforeVersionId, data.beforeCursorState);\n\t}\n\n\tpublic redo(): void {\n\t\tif (URI.isUri(this.model)) {\n\t\t\t// don't have a model\n\t\t\tthrow new Error(`Invalid SingleModelEditStackElement`);\n\t\t}\n\t\tif (this._data instanceof SingleModelEditStackData) {\n\t\t\tthis._data = this._data.serialize();\n\t\t}\n\t\tconst data = SingleModelEditStackData.deserialize(this._data);\n\t\tthis.model._applyRedo(data.changes, data.afterEOL, data.afterVersionId, data.afterCursorState);\n\t}\n\n\tpublic heapSize(): number {\n\t\tif (this._data instanceof SingleModelEditStackData) {\n\t\t\tthis._data = this._data.serialize();\n\t\t}\n\t\treturn this._data.byteLength + 168/*heap overhead*/;\n\t}\n}\n\nexport class MultiModelEditStackElement implements IWorkspaceUndoRedoElement {\n\n\tpublic readonly type = UndoRedoElementType.Workspace;\n\tpublic readonly label: string;\n\tprivate _isOpen: boolean;\n\n\tprivate readonly _editStackElementsArr: SingleModelEditStackElement[];\n\tprivate readonly _editStackElementsMap: Map<string, SingleModelEditStackElement>;\n\n\tprivate _delegate: IUndoRedoDelegate | null;\n\n\tpublic get resources(): readonly URI[] {\n\t\treturn this._editStackElementsArr.map(editStackElement => editStackElement.resource);\n\t}\n\n\tconstructor(\n\t\tlabel: string,\n\t\teditStackElements: SingleModelEditStackElement[]\n\t) {\n\t\tthis.label = label;\n\t\tthis._isOpen = true;\n\t\tthis._editStackElementsArr = editStackElements.slice(0);\n\t\tthis._editStackElementsMap = new Map<string, SingleModelEditStackElement>();\n\t\tfor (const editStackElement of this._editStackElementsArr) {\n\t\t\tconst key = uriGetComparisonKey(editStackElement.resource);\n\t\t\tthis._editStackElementsMap.set(key, editStackElement);\n\t\t}\n\t\tthis._delegate = null;\n\t}\n\n\tpublic prepareUndoRedo(): Promise<IDisposable> | IDisposable | void {\n\t\tif (this._delegate) {\n\t\t\treturn this._delegate.prepareUndoRedo(this);\n\t\t}\n\t}\n\n\tpublic matchesResource(resource: URI): boolean {\n\t\tconst key = uriGetComparisonKey(resource);\n\t\treturn (this._editStackElementsMap.has(key));\n\t}\n\n\tpublic setModel(model: ITextModel | URI): void {\n\t\tconst key = uriGetComparisonKey(URI.isUri(model) ? model : model.uri);\n\t\tif (this._editStackElementsMap.has(key)) {\n\t\t\tthis._editStackElementsMap.get(key)!.setModel(model);\n\t\t}\n\t}\n\n\tpublic canAppend(model: ITextModel): boolean {\n\t\tif (!this._isOpen) {\n\t\t\treturn false;\n\t\t}\n\t\tconst key = uriGetComparisonKey(model.uri);\n\t\tif (this._editStackElementsMap.has(key)) {\n\t\t\tconst editStackElement = this._editStackElementsMap.get(key)!;\n\t\t\treturn editStackElement.canAppend(model);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic append(model: ITextModel, textChanges: TextChange[], afterEOL: EndOfLineSequence, afterVersionId: number, afterCursorState: Selection[] | null): void {\n\t\tconst key = uriGetComparisonKey(model.uri);\n\t\tconst editStackElement = this._editStackElementsMap.get(key)!;\n\t\teditStackElement.append(model, textChanges, afterEOL, afterVersionId, afterCursorState);\n\t}\n\n\tpublic close(): void {\n\t\tthis._isOpen = false;\n\t}\n\n\tpublic open(): void {\n\t\t// cannot reopen\n\t}\n\n\tpublic undo(): void {\n\t\tthis._isOpen = false;\n\n\t\tfor (const editStackElement of this._editStackElementsArr) {\n\t\t\teditStackElement.undo();\n\t\t}\n\t}\n\n\tpublic redo(): void {\n\t\tfor (const editStackElement of this._editStackElementsArr) {\n\t\t\teditStackElement.redo();\n\t\t}\n\t}\n\n\tpublic heapSize(resource: URI): number {\n\t\tconst key = uriGetComparisonKey(resource);\n\t\tif (this._editStackElementsMap.has(key)) {\n\t\t\tconst editStackElement = this._editStackElementsMap.get(key)!;\n\t\t\treturn editStackElement.heapSize();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic split(): IResourceUndoRedoElement[] {\n\t\treturn this._editStackElementsArr;\n\t}\n\n\tpublic toString(): string {\n\t\tlet result: string[] = [];\n\t\tfor (const editStackElement of this._editStackElementsArr) {\n\t\t\tresult.push(`${basename(editStackElement.resource)}: ${editStackElement}`);\n\t\t}\n\t\treturn `{${result.join(', ')}}`;\n\t}\n}\n\nexport type EditStackElement = SingleModelEditStackElement | MultiModelEditStackElement;\n\nfunction getModelEOL(model: ITextModel): EndOfLineSequence {\n\tconst eol = model.getEOL();\n\tif (eol === '\\n') {\n\t\treturn EndOfLineSequence.LF;\n\t} else {\n\t\treturn EndOfLineSequence.CRLF;\n\t}\n}\n\nexport function isEditStackElement(element: IResourceUndoRedoElement | IWorkspaceUndoRedoElement | null): element is EditStackElement {\n\tif (!element) {\n\t\treturn false;\n\t}\n\treturn ((element instanceof SingleModelEditStackElement) || (element instanceof MultiModelEditStackElement));\n}\n\nexport class EditStack {\n\n\tprivate readonly _model: TextModel;\n\tprivate readonly _undoRedoService: IUndoRedoService;\n\n\tconstructor(model: TextModel, undoRedoService: IUndoRedoService) {\n\t\tthis._model = model;\n\t\tthis._undoRedoService = undoRedoService;\n\t}\n\n\tpublic pushStackElement(): void {\n\t\tconst lastElement = this._undoRedoService.getLastElement(this._model.uri);\n\t\tif (isEditStackElement(lastElement)) {\n\t\t\tlastElement.close();\n\t\t}\n\t}\n\n\tpublic popStackElement(): void {\n\t\tconst lastElement = this._undoRedoService.getLastElement(this._model.uri);\n\t\tif (isEditStackElement(lastElement)) {\n\t\t\tlastElement.open();\n\t\t}\n\t}\n\n\tpublic clear(): void {\n\t\tthis._undoRedoService.removeElements(this._model.uri);\n\t}\n\n\tprivate _getOrCreateEditStackElement(beforeCursorState: Selection[] | null): EditStackElement {\n\t\tconst lastElement = this._undoRedoService.getLastElement(this._model.uri);\n\t\tif (isEditStackElement(lastElement) && lastElement.canAppend(this._model)) {\n\t\t\treturn lastElement;\n\t\t}\n\t\tconst newElement = new SingleModelEditStackElement(this._model, beforeCursorState);\n\t\tthis._undoRedoService.pushElement(newElement);\n\t\treturn newElement;\n\t}\n\n\tpublic pushEOL(eol: EndOfLineSequence): void {\n\t\tconst editStackElement = this._getOrCreateEditStackElement(null);\n\t\tthis._model.setEOL(eol);\n\t\teditStackElement.append(this._model, [], getModelEOL(this._model), this._model.getAlternativeVersionId(), null);\n\t}\n\n\tpublic pushEditOperation(beforeCursorState: Selection[] | null, editOperations: ISingleEditOperation[], cursorStateComputer: ICursorStateComputer | null): Selection[] | null {\n\t\tconst editStackElement = this._getOrCreateEditStackElement(beforeCursorState);\n\t\tconst inverseEditOperations = this._model.applyEdits(editOperations, true);\n\t\tconst afterCursorState = EditStack._computeCursorState(cursorStateComputer, inverseEditOperations);\n\t\tconst textChanges = inverseEditOperations.map((op, index) => ({ index: index, textChange: op.textChange }));\n\t\ttextChanges.sort((a, b) => {\n\t\t\tif (a.textChange.oldPosition === b.textChange.oldPosition) {\n\t\t\t\treturn a.index - b.index;\n\t\t\t}\n\t\t\treturn a.textChange.oldPosition - b.textChange.oldPosition;\n\t\t});\n\t\teditStackElement.append(this._model, textChanges.map(op => op.textChange), getModelEOL(this._model), this._model.getAlternativeVersionId(), afterCursorState);\n\t\treturn afterCursorState;\n\t}\n\n\tprivate static _computeCursorState(cursorStateComputer: ICursorStateComputer | null, inverseEditOperations: IValidEditOperation[]): Selection[] | null {\n\t\ttry {\n\t\t\treturn cursorStateComputer ? cursorStateComputer(inverseEditOperations) : null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn null;\n\t\t}\n\t}\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 * as nls from 'vs/nls';\n\nexport namespace AccessibilityHelpNLS {\n\texport const noSelection = nls.localize(\"noSelection\", \"No selection\");\n\texport const singleSelectionRange = nls.localize(\"singleSelectionRange\", \"Line {0}, Column {1} ({2} selected)\");\n\texport const singleSelection = nls.localize(\"singleSelection\", \"Line {0}, Column {1}\");\n\texport const multiSelectionRange = nls.localize(\"multiSelectionRange\", \"{0} selections ({1} characters selected)\");\n\texport const multiSelection = nls.localize(\"multiSelection\", \"{0} selections\");\n\texport const emergencyConfOn = nls.localize(\"emergencyConfOn\", \"Now changing the setting `accessibilitySupport` to 'on'.\");\n\texport const openingDocs = nls.localize(\"openingDocs\", \"Now opening the Editor Accessibility documentation page.\");\n\texport const readonlyDiffEditor = nls.localize(\"readonlyDiffEditor\", \" in a read-only pane of a diff editor.\");\n\texport const editableDiffEditor = nls.localize(\"editableDiffEditor\", \" in a pane of a diff editor.\");\n\texport const readonlyEditor = nls.localize(\"readonlyEditor\", \" in a read-only code editor\");\n\texport const editableEditor = nls.localize(\"editableEditor\", \" in a code editor\");\n\texport const changeConfigToOnMac = nls.localize(\"changeConfigToOnMac\", \"To configure the editor to be optimized for usage with a Screen Reader press Command+E now.\");\n\texport const changeConfigToOnWinLinux = nls.localize(\"changeConfigToOnWinLinux\", \"To configure the editor to be optimized for usage with a Screen Reader press Control+E now.\");\n\texport const auto_on = nls.localize(\"auto_on\", \"The editor is configured to be optimized for usage with a Screen Reader.\");\n\texport const auto_off = nls.localize(\"auto_off\", \"The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time.\");\n\texport const tabFocusModeOnMsg = nls.localize(\"tabFocusModeOnMsg\", \"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}.\");\n\texport const tabFocusModeOnMsgNoKb = nls.localize(\"tabFocusModeOnMsgNoKb\", \"Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.\");\n\texport const tabFocusModeOffMsg = nls.localize(\"tabFocusModeOffMsg\", \"Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}.\");\n\texport const tabFocusModeOffMsgNoKb = nls.localize(\"tabFocusModeOffMsgNoKb\", \"Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding.\");\n\texport const openDocMac = nls.localize(\"openDocMac\", \"Press Command+H now to open a browser window with more information related to editor accessibility.\");\n\texport const openDocWinLinux = nls.localize(\"openDocWinLinux\", \"Press Control+H now to open a browser window with more information related to editor accessibility.\");\n\texport const outroMsg = nls.localize(\"outroMsg\", \"You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape.\");\n\texport const showAccessibilityHelpAction = nls.localize(\"showAccessibilityHelpAction\", \"Show Accessibility Help\");\n}\n\nexport namespace InspectTokensNLS {\n\texport const inspectTokensAction = nls.localize('inspectTokens', \"Developer: Inspect Tokens\");\n}\n\nexport namespace GoToLineNLS {\n\texport const gotoLineActionLabel = nls.localize('gotoLineActionLabel', \"Go to Line/Column...\");\n}\n\nexport namespace QuickHelpNLS {\n\texport const helpQuickAccessActionLabel = nls.localize('helpQuickAccess', \"Show all Quick Access Providers\");\n}\n\nexport namespace QuickCommandNLS {\n\texport const quickCommandActionLabel = nls.localize('quickCommandActionLabel', \"Command Palette\");\n\texport const quickCommandHelp = nls.localize('quickCommandActionHelp', \"Show And Run Commands\");\n}\n\nexport namespace QuickOutlineNLS {\n\texport const quickOutlineActionLabel = nls.localize('quickOutlineActionLabel', \"Go to Symbol...\");\n\texport const quickOutlineByCategoryActionLabel = nls.localize('quickOutlineByCategoryActionLabel', \"Go to Symbol by Category...\");\n}\n\nexport namespace StandaloneCodeEditorNLS {\n\texport const editorViewAccessibleLabel = nls.localize('editorViewAccessibleLabel', \"Editor content\");\n\texport const accessibilityHelpMessage = nls.localize('accessibilityHelpMessage', \"Press Alt+F1 for Accessibility Options.\");\n}\n\nexport namespace ToggleHighContrastNLS {\n\texport const toggleHighContrast = nls.localize('toggleHighContrast', \"Toggle High Contrast Theme\");\n}\n\nexport namespace StandaloneServicesNLS {\n\texport const bulkEditServiceSummary = nls.localize('bulkEditServiceSummary', \"Made {0} edits in {1} files\");\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IMatch } from 'vs/base/common/filters';\nimport { defaultGenerator } from 'vs/base/common/idGenerator';\nimport { dispose, IDisposable, IReference } from 'vs/base/common/lifecycle';\nimport { ResourceMap } from 'vs/base/common/map';\nimport { basename, extUri } from 'vs/base/common/resources';\nimport * as strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/base/common/uint';\nimport { URI } from 'vs/base/common/uri';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Location, LocationLink } from 'vs/editor/common/languages';\nimport { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { localize } from 'vs/nls';\n\nexport class OneReference {\n\n\treadonly id: string = defaultGenerator.nextId();\n\n\tprivate _range?: IRange;\n\n\tconstructor(\n\t\treadonly isProviderFirst: boolean,\n\t\treadonly parent: FileReferences,\n\t\treadonly link: LocationLink,\n\t\tprivate _rangeCallback: (ref: OneReference) => void\n\t) { }\n\n\tget uri() {\n\t\treturn this.link.uri;\n\t}\n\n\tget range(): IRange {\n\t\treturn this._range ?? this.link.targetSelectionRange ?? this.link.range;\n\t}\n\n\tset range(value: IRange) {\n\t\tthis._range = value;\n\t\tthis._rangeCallback(this);\n\t}\n\n\tget ariaMessage(): string {\n\n\t\tconst preview = this.parent.getPreview(this)?.preview(this.range);\n\n\t\tif (!preview) {\n\t\t\treturn localize(\n\t\t\t\t'aria.oneReference', \"symbol in {0} on line {1} at column {2}\",\n\t\t\t\tbasename(this.uri), this.range.startLineNumber, this.range.startColumn\n\t\t\t);\n\t\t} else {\n\t\t\treturn localize(\n\t\t\t\t{ key: 'aria.oneReference.preview', comment: ['Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code'] }, \"symbol in {0} on line {1} at column {2}, {3}\",\n\t\t\t\tbasename(this.uri), this.range.startLineNumber, this.range.startColumn, preview.value\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport class FilePreview implements IDisposable {\n\n\tconstructor(\n\t\tprivate readonly _modelReference: IReference<ITextEditorModel>\n\t) { }\n\n\tdispose(): void {\n\t\tthis._modelReference.dispose();\n\t}\n\n\tpreview(range: IRange, n: number = 8): { value: string; highlight: IMatch } | undefined {\n\t\tconst model = this._modelReference.object.textEditorModel;\n\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { startLineNumber, startColumn, endLineNumber, endColumn } = range;\n\t\tconst word = model.getWordUntilPosition({ lineNumber: startLineNumber, column: startColumn - n });\n\t\tconst beforeRange = new Range(startLineNumber, word.startColumn, startLineNumber, startColumn);\n\t\tconst afterRange = new Range(endLineNumber, endColumn, endLineNumber, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tconst before = model.getValueInRange(beforeRange).replace(/^\\s+/, '');\n\t\tconst inside = model.getValueInRange(range);\n\t\tconst after = model.getValueInRange(afterRange).replace(/\\s+$/, '');\n\n\t\treturn {\n\t\t\tvalue: before + inside + after,\n\t\t\thighlight: { start: before.length, end: before.length + inside.length }\n\t\t};\n\t}\n}\n\nexport class FileReferences implements IDisposable {\n\n\treadonly children: OneReference[] = [];\n\n\tprivate _previews = new ResourceMap<FilePreview>();\n\n\tconstructor(\n\t\treadonly parent: ReferencesModel,\n\t\treadonly uri: URI\n\t) { }\n\n\tdispose(): void {\n\t\tdispose(this._previews.values());\n\t\tthis._previews.clear();\n\t}\n\n\tgetPreview(child: OneReference): FilePreview | undefined {\n\t\treturn this._previews.get(child.uri);\n\t}\n\n\tget ariaMessage(): string {\n\t\tconst len = this.children.length;\n\t\tif (len === 1) {\n\t\t\treturn localize('aria.fileReferences.1', \"1 symbol in {0}, full path {1}\", basename(this.uri), this.uri.fsPath);\n\t\t} else {\n\t\t\treturn localize('aria.fileReferences.N', \"{0} symbols in {1}, full path {2}\", len, basename(this.uri), this.uri.fsPath);\n\t\t}\n\t}\n\n\tasync resolve(textModelResolverService: ITextModelService): Promise<FileReferences> {\n\t\tif (this._previews.size !== 0) {\n\t\t\treturn this;\n\t\t}\n\t\tfor (let child of this.children) {\n\t\t\tif (this._previews.has(child.uri)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst ref = await textModelResolverService.createModelReference(child.uri);\n\t\t\t\tthis._previews.set(child.uri, new FilePreview(ref));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport class ReferencesModel implements IDisposable {\n\n\tprivate readonly _links: LocationLink[];\n\tprivate readonly _title: string;\n\n\treadonly groups: FileReferences[] = [];\n\treadonly references: OneReference[] = [];\n\n\treadonly _onDidChangeReferenceRange = new Emitter<OneReference>();\n\treadonly onDidChangeReferenceRange: Event<OneReference> = this._onDidChangeReferenceRange.event;\n\n\tconstructor(links: LocationLink[], title: string) {\n\t\tthis._links = links;\n\t\tthis._title = title;\n\n\t\t// grouping and sorting\n\t\tconst [providersFirst] = links;\n\t\tlinks.sort(ReferencesModel._compareReferences);\n\n\t\tlet current: FileReferences | undefined;\n\t\tfor (let link of links) {\n\t\t\tif (!current || !extUri.isEqual(current.uri, link.uri, true)) {\n\t\t\t\t// new group\n\t\t\t\tcurrent = new FileReferences(this, link.uri);\n\t\t\t\tthis.groups.push(current);\n\t\t\t}\n\n\t\t\t// append, check for equality first!\n\t\t\tif (current.children.length === 0 || ReferencesModel._compareReferences(link, current.children[current.children.length - 1]) !== 0) {\n\n\t\t\t\tconst oneRef = new OneReference(\n\t\t\t\t\tprovidersFirst === link,\n\t\t\t\t\tcurrent,\n\t\t\t\t\tlink,\n\t\t\t\t\tref => this._onDidChangeReferenceRange.fire(ref)\n\t\t\t\t);\n\t\t\t\tthis.references.push(oneRef);\n\t\t\t\tcurrent.children.push(oneRef);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tdispose(this.groups);\n\t\tthis._onDidChangeReferenceRange.dispose();\n\t\tthis.groups.length = 0;\n\t}\n\n\tclone(): ReferencesModel {\n\t\treturn new ReferencesModel(this._links, this._title);\n\t}\n\n\tget title(): string {\n\t\treturn this._title;\n\t}\n\n\tget isEmpty(): boolean {\n\t\treturn this.groups.length === 0;\n\t}\n\n\tget ariaMessage(): string {\n\t\tif (this.isEmpty) {\n\t\t\treturn localize('aria.result.0', \"No results found\");\n\t\t} else if (this.references.length === 1) {\n\t\t\treturn localize('aria.result.1', \"Found 1 symbol in {0}\", this.references[0].uri.fsPath);\n\t\t} else if (this.groups.length === 1) {\n\t\t\treturn localize('aria.result.n1', \"Found {0} symbols in {1}\", this.references.length, this.groups[0].uri.fsPath);\n\t\t} else {\n\t\t\treturn localize('aria.result.nm', \"Found {0} symbols in {1} files\", this.references.length, this.groups.length);\n\t\t}\n\t}\n\n\tnextOrPreviousReference(reference: OneReference, next: boolean): OneReference {\n\n\t\tlet { parent } = reference;\n\n\t\tlet idx = parent.children.indexOf(reference);\n\t\tlet childCount = parent.children.length;\n\t\tlet groupCount = parent.parent.groups.length;\n\n\t\tif (groupCount === 1 || next && idx + 1 < childCount || !next && idx > 0) {\n\t\t\t// cycling within one file\n\t\t\tif (next) {\n\t\t\t\tidx = (idx + 1) % childCount;\n\t\t\t} else {\n\t\t\t\tidx = (idx + childCount - 1) % childCount;\n\t\t\t}\n\t\t\treturn parent.children[idx];\n\t\t}\n\n\t\tidx = parent.parent.groups.indexOf(parent);\n\t\tif (next) {\n\t\t\tidx = (idx + 1) % groupCount;\n\t\t\treturn parent.parent.groups[idx].children[0];\n\t\t} else {\n\t\t\tidx = (idx + groupCount - 1) % groupCount;\n\t\t\treturn parent.parent.groups[idx].children[parent.parent.groups[idx].children.length - 1];\n\t\t}\n\t}\n\n\tnearestReference(resource: URI, position: Position): OneReference | undefined {\n\n\t\tconst nearest = this.references.map((ref, idx) => {\n\t\t\treturn {\n\t\t\t\tidx,\n\t\t\t\tprefixLen: strings.commonPrefixLength(ref.uri.toString(), resource.toString()),\n\t\t\t\toffsetDist: Math.abs(ref.range.startLineNumber - position.lineNumber) * 100 + Math.abs(ref.range.startColumn - position.column)\n\t\t\t};\n\t\t}).sort((a, b) => {\n\t\t\tif (a.prefixLen > b.prefixLen) {\n\t\t\t\treturn -1;\n\t\t\t} else if (a.prefixLen < b.prefixLen) {\n\t\t\t\treturn 1;\n\t\t\t} else if (a.offsetDist < b.offsetDist) {\n\t\t\t\treturn -1;\n\t\t\t} else if (a.offsetDist > b.offsetDist) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t})[0];\n\n\t\tif (nearest) {\n\t\t\treturn this.references[nearest.idx];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\treferenceAt(resource: URI, position: Position): OneReference | undefined {\n\t\tfor (const ref of this.references) {\n\t\t\tif (ref.uri.toString() === resource.toString()) {\n\t\t\t\tif (Range.containsPosition(ref.range, position)) {\n\t\t\t\t\treturn ref;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tfirstReference(): OneReference | undefined {\n\t\tfor (const ref of this.references) {\n\t\t\tif (ref.isProviderFirst) {\n\t\t\t\treturn ref;\n\t\t\t}\n\t\t}\n\t\treturn this.references[0];\n\t}\n\n\tprivate static _compareReferences(a: Location, b: Location): number {\n\t\treturn extUri.compare(a.uri, b.uri) || Range.compareRangesUsingStarts(a.range, b.range);\n\t}\n}\n","\nimport { URI } from 'vs/base/common/uri';\n\nexport interface IEditorModel {\n\n\t/**\n\t * Dispose associated resources\n\t */\n\tdispose(): void;\n}\n\nexport interface IBaseUntypedEditorInput {\n}\n\nexport interface IBaseResourceEditorInput extends IBaseUntypedEditorInput {\n}\n\nexport interface IBaseTextResourceEditorInput extends IBaseResourceEditorInput {\n}\n\nexport interface IResourceEditorInput extends IBaseResourceEditorInput {\n\n\t/**\n\t * The resource URI of the resource to open.\n\t */\n\treadonly resource: URI;\n}\n\nexport interface ITextResourceEditorInput extends IResourceEditorInput, IBaseTextResourceEditorInput {\n\n\t/**\n\t * Optional options to use when opening the text input.\n\t */\n\toptions?: ITextEditorOptions;\n}\n\nexport enum EditorOpenSource {\n\n\t/**\n\t * Default: the editor is opening via a programmatic call\n\t * to the editor service API.\n\t */\n\tAPI,\n\n\t/**\n\t * Indicates that a user action triggered the opening, e.g.\n\t * via mouse or keyboard use.\n\t */\n\tUSER\n}\n\nexport interface IEditorOptions {\n\n\t/**\n\t * Tells the editor to not receive keyboard focus when the editor is being opened.\n\t *\n\t * Will also not activate the group the editor opens in unless the group is already\n\t * the active one. This behaviour can be overridden via the `activation` option.\n\t */\n\tpreserveFocus?: boolean;\n\n\t/**\n\t * Will reveal the editor if it is already opened and visible in any of the opened editor groups.\n\t *\n\t * Note that this option is just a hint that might be ignored if the user wants to open an editor explicitly\n\t * to the side of another one or into a specific editor group.\n\t */\n\trevealIfVisible?: boolean;\n\n\t/**\n\t * Will reveal the editor if it is already opened (even when not visible) in any of the opened editor groups.\n\t *\n\t * Note that this option is just a hint that might be ignored if the user wants to open an editor explicitly\n\t * to the side of another one or into a specific editor group.\n\t */\n\trevealIfOpened?: boolean;\n\n\t/**\n\t * An editor that is pinned remains in the editor stack even when another editor is being opened.\n\t * An editor that is not pinned will always get replaced by another editor that is not pinned.\n\t */\n\tpinned?: boolean;\n\n\t/**\n\t * A optional hint to signal in which context the editor opens.\n\t *\n\t * If configured to be `EditorOpenSource.USER`, this hint can be\n\t * used in various places to control the experience. For example,\n\t * if the editor to open fails with an error, a notification could\n\t * inform about this in a modal dialog. If the editor opened through\n\t * some background task, the notification would show in the background,\n\t * not as a modal dialog.\n\t */\n\tsource?: EditorOpenSource;\n}\n\nexport interface ITextEditorSelection {\n\treadonly startLineNumber: number;\n\treadonly startColumn: number;\n\treadonly endLineNumber?: number;\n\treadonly endColumn?: number;\n}\n\nexport const enum TextEditorSelectionRevealType {\n\t/**\n\t * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically.\n\t */\n\tCenter = 0,\n\n\t/**\n\t * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.\n\t */\n\tCenterIfOutsideViewport = 1,\n\n\t/**\n\t * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, but not quite at the top.\n\t */\n\tNearTop = 2,\n\n\t/**\n\t * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, but not quite at the top.\n\t * Only if it lies outside the viewport\n\t */\n\tNearTopIfOutsideViewport = 3,\n}\n\nexport const enum TextEditorSelectionSource {\n\n\t/**\n\t * Programmatic source indicates a selection change that\n\t * was not triggered by the user via keyboard or mouse\n\t * but through text editor APIs.\n\t */\n\tPROGRAMMATIC = 'api',\n\n\t/**\n\t * Navigation source indicates a selection change that\n\t * was caused via some command or UI component such as\n\t * an outline tree.\n\t */\n\tNAVIGATION = 'code.navigation',\n\n\t/**\n\t * Jump source indicates a selection change that\n\t * was caused from within the text editor to another\n\t * location in the same or different text editor such\n\t * as \"Go to definition\".\n\t */\n\tJUMP = 'code.jump'\n}\n\nexport interface ITextEditorOptions extends IEditorOptions {\n\n\t/**\n\t * Text editor selection.\n\t */\n\tselection?: ITextEditorSelection;\n\n\t/**\n\t * Option to control the text editor selection reveal type.\n\t * Defaults to TextEditorSelectionRevealType.Center\n\t */\n\tselectionRevealType?: TextEditorSelectionRevealType;\n\n\t/**\n\t * Source of the call that caused the selection.\n\t */\n\tselectionSource?: TextEditorSelectionSource | string;\n}\n","\n\n/**\n * **!Do not construct directly!**\n *\n * **!Only static methods because it gets serialized!**\n *\n * This represents the \"canonical\" version for an extension identifier. Extension ids\n * have to be case-insensitive (due to the marketplace), but we must ensure case\n * preservation because the extension API is already public at this time.\n *\n * For example, given an extension with the publisher `\"Hello\"` and the name `\"World\"`,\n * its canonical extension identifier is `\"Hello.World\"`. This extension could be\n * referenced in some other extension's dependencies using the string `\"hello.world\"`.\n *\n * To make matters more complicated, an extension can optionally have an UUID. When two\n * extensions have the same UUID, they are considered equal even if their identifier is different.\n */\nexport class ExtensionIdentifier {\n\tpublic readonly value: string;\n\tprivate readonly _lower: string;\n\n\tconstructor(value: string) {\n\t\tthis.value = value;\n\t\tthis._lower = value.toLowerCase();\n\t}\n\n\t/**\n\t * Gives the value by which to index (for equality).\n\t */\n\tpublic static toKey(id: ExtensionIdentifier | string): string {\n\t\tif (typeof id === 'string') {\n\t\t\treturn id.toLowerCase();\n\t\t}\n\t\treturn id._lower;\n\t}\n}\n","\n\n//#endregion\n\n//#region Utilities\n\nexport enum FileKind {\n\tFILE,\n\tFOLDER,\n\tROOT_FOLDER\n}\n\n//#endregion\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 { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\n\nexport function showHistoryKeybindingHint(keybindingService: IKeybindingService): boolean {\n\treturn keybindingService.lookupKeybinding('history.showPrevious')?.getElectronAccelerator() === 'Up' && keybindingService.lookupKeybinding('history.showNext')?.getElectronAccelerator() === 'Down';\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\nexport class SyncDescriptor<T> {\n\n\treadonly ctor: any;\n\treadonly staticArguments: any[];\n\treadonly supportsDelayedInstantiation: boolean;\n\n\tconstructor(ctor: new (...args: any[]) => T, staticArguments: any[] = [], supportsDelayedInstantiation: boolean = false) {\n\t\tthis.ctor = ctor;\n\t\tthis.staticArguments = staticArguments;\n\t\tthis.supportsDelayedInstantiation = supportsDelayedInstantiation;\n\t}\n}\n\nexport interface SyncDescriptor0<T> {\n\treadonly ctor: new () => T;\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 { SyncDescriptor } from './descriptors';\nimport { BrandedService, ServiceIdentifier } from './instantiation';\n\nconst _registry: [ServiceIdentifier<any>, SyncDescriptor<any>][] = [];\n\nexport function registerSingleton<T, Services extends BrandedService[]>(id: ServiceIdentifier<T>, ctor: new (...services: Services) => T, supportsDelayedInstantiation?: boolean): void;\nexport function registerSingleton<T, Services extends BrandedService[]>(id: ServiceIdentifier<T>, descriptor: SyncDescriptor<any>): void;\nexport function registerSingleton<T, Services extends BrandedService[]>(id: ServiceIdentifier<T>, ctorOrDescriptor: { new(...services: Services): T } | SyncDescriptor<any>, supportsDelayedInstantiation?: boolean): void {\n\tif (!(ctorOrDescriptor instanceof SyncDescriptor)) {\n\t\tctorOrDescriptor = new SyncDescriptor<T>(ctorOrDescriptor as new (...args: any[]) => T, [], supportsDelayedInstantiation);\n\t}\n\n\t_registry.push([id, ctorOrDescriptor]);\n}\n\nexport function getSingletonServiceDescriptors(): [ServiceIdentifier<any>, SyncDescriptor<any>][] {\n\treturn _registry;\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\nexport class Node<T> {\n\n\treadonly data: T;\n\treadonly incoming = new Map<string, Node<T>>();\n\treadonly outgoing = new Map<string, Node<T>>();\n\n\tconstructor(data: T) {\n\t\tthis.data = data;\n\t}\n}\n\nexport class Graph<T> {\n\n\tprivate readonly _nodes = new Map<string, Node<T>>();\n\n\tconstructor(private readonly _hashFn: (element: T) => string) {\n\t\t// empty\n\t}\n\n\troots(): Node<T>[] {\n\t\tconst ret: Node<T>[] = [];\n\t\tfor (let node of this._nodes.values()) {\n\t\t\tif (node.outgoing.size === 0) {\n\t\t\t\tret.push(node);\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\tinsertEdge(from: T, to: T): void {\n\t\tconst fromNode = this.lookupOrInsertNode(from);\n\t\tconst toNode = this.lookupOrInsertNode(to);\n\n\t\tfromNode.outgoing.set(this._hashFn(to), toNode);\n\t\ttoNode.incoming.set(this._hashFn(from), fromNode);\n\t}\n\n\tremoveNode(data: T): void {\n\t\tconst key = this._hashFn(data);\n\t\tthis._nodes.delete(key);\n\t\tfor (let node of this._nodes.values()) {\n\t\t\tnode.outgoing.delete(key);\n\t\t\tnode.incoming.delete(key);\n\t\t}\n\t}\n\n\tlookupOrInsertNode(data: T): Node<T> {\n\t\tconst key = this._hashFn(data);\n\t\tlet node = this._nodes.get(key);\n\n\t\tif (!node) {\n\t\t\tnode = new Node(data);\n\t\t\tthis._nodes.set(key, node);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this._nodes.size === 0;\n\t}\n\n\ttoString(): string {\n\t\tlet data: string[] = [];\n\t\tfor (let [key, value] of this._nodes) {\n\t\t\tdata.push(`${key}, (incoming)[${[...value.incoming.keys()].join(', ')}], (outgoing)[${[...value.outgoing.keys()].join(',')}]`);\n\n\t\t}\n\t\treturn data.join('\\n');\n\t}\n\n\t/**\n\t * This is brute force and slow and **only** be used\n\t * to trouble shoot.\n\t */\n\tfindCycleSlow() {\n\t\tfor (let [id, node] of this._nodes) {\n\t\t\tconst seen = new Set<string>([id]);\n\t\t\tconst res = this._findCycle(node, seen);\n\t\t\tif (res) {\n\t\t\t\treturn res;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate _findCycle(node: Node<T>, seen: Set<string>): string | undefined {\n\t\tfor (let [id, outgoing] of node.outgoing) {\n\t\t\tif (seen.has(id)) {\n\t\t\t\treturn [...seen, id].join(' -> ');\n\t\t\t}\n\t\t\tseen.add(id);\n\t\t\tconst value = this._findCycle(outgoing, seen);\n\t\t\tif (value) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tseen.delete(id);\n\t\t}\n\t\treturn undefined;\n\t}\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 * as descriptors from './descriptors';\nimport { ServiceCollection } from './serviceCollection';\n\n// ------ internal util\n\nexport namespace _util {\n\n\texport const serviceIds = new Map<string, ServiceIdentifier<any>>();\n\n\texport const DI_TARGET = '$di$target';\n\texport const DI_DEPENDENCIES = '$di$dependencies';\n\n\texport function getServiceDependencies(ctor: any): { id: ServiceIdentifier<any>; index: number }[] {\n\t\treturn ctor[DI_DEPENDENCIES] || [];\n\t}\n}\n\n// --- interfaces ------\n\nexport type BrandedService = { _serviceBrand: undefined };\n\nexport interface IConstructorSignature<T, Args extends any[] = []> {\n\tnew <Services extends BrandedService[]>(...args: [...Args, ...Services]): T;\n}\n\nexport interface ServicesAccessor {\n\tget<T>(id: ServiceIdentifier<T>): T;\n}\n\nexport const IInstantiationService = createDecorator<IInstantiationService>('instantiationService');\n\n/**\n * Given a list of arguments as a tuple, attempt to extract the leading, non-service arguments\n * to their own tuple.\n */\ntype GetLeadingNonServiceArgs<Args> =\n\tArgs extends [...BrandedService[]] ? []\n\t: Args extends [infer A, ...BrandedService[]] ? [A]\n\t: Args extends [infer A, ...infer R] ? [A, ...GetLeadingNonServiceArgs<R>]\n\t: never;\n\nexport interface IInstantiationService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Synchronously creates an instance that is denoted by the descriptor\n\t */\n\tcreateInstance<T>(descriptor: descriptors.SyncDescriptor0<T>): T;\n\tcreateInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(ctor: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;\n\n\t/**\n\t * Calls a function with a service accessor.\n\t */\n\tinvokeFunction<R, TS extends any[] = []>(fn: (accessor: ServicesAccessor, ...args: TS) => R, ...args: TS): R;\n\n\t/**\n\t * Creates a child of this service which inherits all current services\n\t * and adds/overwrites the given services.\n\t */\n\tcreateChild(services: ServiceCollection): IInstantiationService;\n}\n\n\n/**\n * Identifies a service of type `T`.\n */\nexport interface ServiceIdentifier<T> {\n\t(...args: any[]): void;\n\ttype: T;\n}\n\nfunction storeServiceDependency(id: Function, target: Function, index: number): void {\n\tif ((target as any)[_util.DI_TARGET] === target) {\n\t\t(target as any)[_util.DI_DEPENDENCIES].push({ id, index });\n\t} else {\n\t\t(target as any)[_util.DI_DEPENDENCIES] = [{ id, index }];\n\t\t(target as any)[_util.DI_TARGET] = target;\n\t}\n}\n\n/**\n * The *only* valid way to create a {{ServiceIdentifier}}.\n */\nexport function createDecorator<T>(serviceId: string): ServiceIdentifier<T> {\n\n\tif (_util.serviceIds.has(serviceId)) {\n\t\treturn _util.serviceIds.get(serviceId)!;\n\t}\n\n\tconst id = <any>function (target: Function, key: string, index: number): any {\n\t\tif (arguments.length !== 3) {\n\t\t\tthrow new Error('@IServiceName-decorator can only be used to decorate a parameter');\n\t\t}\n\t\tstoreServiceDependency(id, target, index);\n\t};\n\n\tid.toString = () => serviceId;\n\n\t_util.serviceIds.set(serviceId, id);\n\treturn id;\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { TextEdit, WorkspaceEdit, WorkspaceEditMetadata, WorkspaceFileEdit, WorkspaceFileEditOptions, WorkspaceTextEdit } from 'vs/editor/common/languages';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { URI } from 'vs/base/common/uri';\nimport { isObject } from 'vs/base/common/types';\n\nexport const IBulkEditService = createDecorator<IBulkEditService>('IWorkspaceEditService');\n\nfunction isWorkspaceFileEdit(thing: any): thing is WorkspaceFileEdit {\n\treturn isObject(thing) && (Boolean((<WorkspaceFileEdit>thing).newUri) || Boolean((<WorkspaceFileEdit>thing).oldUri));\n}\n\nfunction isWorkspaceTextEdit(thing: any): thing is WorkspaceTextEdit {\n\treturn isObject(thing) && URI.isUri((<WorkspaceTextEdit>thing).resource) && isObject((<WorkspaceTextEdit>thing).edit);\n}\n\nexport class ResourceEdit {\n\n\tprotected constructor(readonly metadata?: WorkspaceEditMetadata) { }\n\n\tstatic convert(edit: WorkspaceEdit): ResourceEdit[] {\n\n\n\t\treturn edit.edits.map(edit => {\n\t\t\tif (isWorkspaceTextEdit(edit)) {\n\t\t\t\treturn new ResourceTextEdit(edit.resource, edit.edit, edit.modelVersionId, edit.metadata);\n\t\t\t}\n\t\t\tif (isWorkspaceFileEdit(edit)) {\n\t\t\t\treturn new ResourceFileEdit(edit.oldUri, edit.newUri, edit.options, edit.metadata);\n\t\t\t}\n\t\t\tthrow new Error('Unsupported edit');\n\t\t});\n\t}\n}\n\nexport class ResourceTextEdit extends ResourceEdit {\n\tconstructor(\n\t\treadonly resource: URI,\n\t\treadonly textEdit: TextEdit,\n\t\treadonly versionId?: number,\n\t\tmetadata?: WorkspaceEditMetadata\n\t) {\n\t\tsuper(metadata);\n\t}\n}\n\nexport class ResourceFileEdit extends ResourceEdit {\n\tconstructor(\n\t\treadonly oldResource: URI | undefined,\n\t\treadonly newResource: URI | undefined,\n\t\treadonly options?: WorkspaceFileEditOptions,\n\t\tmetadata?: WorkspaceEditMetadata\n\t) {\n\t\tsuper(metadata);\n\t}\n}\n\nexport interface IBulkEditOptions {\n\teditor?: ICodeEditor;\n\tshowPreview?: boolean;\n\tlabel?: string;\n\tquotableLabel?: string;\n}\n\nexport interface IBulkEditResult {\n\tariaSummary: string;\n}\n\nexport interface IBulkEditService {\n\treadonly _serviceBrand: undefined;\n\n\thasPreviewHandler(): boolean;\n\n\tapply(edit: ResourceEdit[], options?: IBulkEditOptions): Promise<IBulkEditResult>;\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 'vs/base/common/event';\nimport { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { ITextResourceEditorInput } from 'vs/platform/editor/common/editor';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { URI } from 'vs/base/common/uri';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\treadonly _serviceBrand: undefined;\n\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\treadonly onCodeEditorRemove: Event<ICodeEditor>;\n\n\treadonly onDiffEditorAdd: Event<IDiffEditor>;\n\treadonly onDiffEditorRemove: Event<IDiffEditor>;\n\n\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\tlistCodeEditors(): readonly ICodeEditor[];\n\n\taddDiffEditor(editor: IDiffEditor): void;\n\tremoveDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): readonly IDiffEditor[];\n\n\t/**\n\t * Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.\n\t */\n\tgetFocusedCodeEditor(): ICodeEditor | null;\n\tremoveDecorationType(key: string): void;\n\n\tsetModelProperty(resource: URI, key: string, value: any): void;\n\tgetModelProperty(resource: URI, key: string): any;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: ITextResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\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 'vs/base/common/event';\nimport { URI } from 'vs/base/common/uri';\nimport { ILanguageIdCodec } from 'vs/editor/common/languages';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\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 a language is needed for the first time.\n\t */\n\tonDidEncounterLanguage: 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","/*---------------------------------------------------------------------------------------------\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 { URI } from 'vs/base/common/uri';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IDiffComputationResult } from 'vs/editor/common/diff/diffComputer';\nimport { IInplaceReplaceSupportResult, TextEdit } from 'vs/editor/common/languages';\nimport { UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ID_EDITOR_WORKER_SERVICE = 'editorWorkerService';\nexport const IEditorWorkerService = createDecorator<IEditorWorkerService>(ID_EDITOR_WORKER_SERVICE);\n\nexport interface IEditorWorkerService {\n\treadonly _serviceBrand: undefined;\n\n\tcanComputeUnicodeHighlights(uri: URI): boolean;\n\tcomputedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise<IUnicodeHighlightsResult>;\n\n\tcomputeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null>;\n\n\tcomputeMoreMinimalEdits(resource: URI, edits: TextEdit[] | null | undefined): Promise<TextEdit[] | undefined>;\n\n\tcanComputeWordRanges(resource: URI): boolean;\n\tcomputeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null>;\n\n\tcanNavigateValueSet(resource: URI): boolean;\n\tnavigateValueSet(resource: URI, range: IRange, up: boolean): Promise<IInplaceReplaceSupportResult | null>;\n}\n\nexport interface IUnicodeHighlightsResult {\n\tranges: IRange[];\n\thasMore: boolean;\n\tnonBasicAsciiCharacterCount: number;\n\tinvisibleCharacterCount: number;\n\tambiguousCharacterCount: 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 { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, DocumentHighlightProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, LinkedEditingRangeProvider, LinkProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider } from 'vs/editor/common/languages';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ILanguageFeaturesService = createDecorator<ILanguageFeaturesService>('ILanguageFeaturesService');\n\nexport interface ILanguageFeaturesService {\n\n\treadonly _serviceBrand: undefined;\n\n\treadonly referenceProvider: LanguageFeatureRegistry<ReferenceProvider>;\n\n\treadonly definitionProvider: LanguageFeatureRegistry<DefinitionProvider>;\n\n\treadonly typeDefinitionProvider: LanguageFeatureRegistry<TypeDefinitionProvider>;\n\n\treadonly declarationProvider: LanguageFeatureRegistry<DeclarationProvider>;\n\n\treadonly implementationProvider: LanguageFeatureRegistry<ImplementationProvider>;\n\n\treadonly codeActionProvider: LanguageFeatureRegistry<CodeActionProvider>;\n\n\treadonly renameProvider: LanguageFeatureRegistry<RenameProvider>;\n\n\treadonly documentFormattingEditProvider: LanguageFeatureRegistry<DocumentFormattingEditProvider>;\n\n\treadonly documentRangeFormattingEditProvider: LanguageFeatureRegistry<DocumentRangeFormattingEditProvider>;\n\n\treadonly onTypeFormattingEditProvider: LanguageFeatureRegistry<OnTypeFormattingEditProvider>;\n\n\treadonly documentSymbolProvider: LanguageFeatureRegistry<DocumentSymbolProvider>;\n\n\treadonly inlayHintsProvider: LanguageFeatureRegistry<InlayHintsProvider>;\n\n\treadonly colorProvider: LanguageFeatureRegistry<DocumentColorProvider>;\n\n\treadonly codeLensProvider: LanguageFeatureRegistry<CodeLensProvider>;\n\n\treadonly signatureHelpProvider: LanguageFeatureRegistry<SignatureHelpProvider>;\n\n\treadonly hoverProvider: LanguageFeatureRegistry<HoverProvider>;\n\n\treadonly documentHighlightProvider: LanguageFeatureRegistry<DocumentHighlightProvider>;\n\n\treadonly documentRangeSemanticTokensProvider: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>;\n\n\treadonly documentSemanticTokensProvider: LanguageFeatureRegistry<DocumentSemanticTokensProvider>;\n\n\treadonly selectionRangeProvider: LanguageFeatureRegistry<SelectionRangeProvider>;\n\n\treadonly foldingRangeProvider: LanguageFeatureRegistry<FoldingRangeProvider>;\n\n\treadonly linkProvider: LanguageFeatureRegistry<LinkProvider>;\n\n\treadonly inlineCompletionsProvider: LanguageFeatureRegistry<InlineCompletionsProvider>;\n\n\treadonly completionProvider: LanguageFeatureRegistry<CompletionItemProvider>;\n\n\treadonly linkedEditingRangeProvider: LanguageFeatureRegistry<LinkedEditingRangeProvider>;\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 { URI } from 'vs/base/common/uri';\nimport { LanguageFeatureRegistry, NotebooTypeResolver } from 'vs/editor/common/languageFeatureRegistry';\nimport { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, DocumentHighlightProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, LinkedEditingRangeProvider, LinkProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider } from 'vs/editor/common/languages';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\n\nexport class LanguageFeaturesService implements ILanguageFeaturesService {\n\n\tdeclare _serviceBrand: undefined;\n\n\treadonly referenceProvider = new LanguageFeatureRegistry<ReferenceProvider>(this._score.bind(this));\n\treadonly renameProvider = new LanguageFeatureRegistry<RenameProvider>(this._score.bind(this));\n\treadonly codeActionProvider = new LanguageFeatureRegistry<CodeActionProvider>(this._score.bind(this));\n\treadonly definitionProvider = new LanguageFeatureRegistry<DefinitionProvider>(this._score.bind(this));\n\treadonly typeDefinitionProvider = new LanguageFeatureRegistry<TypeDefinitionProvider>(this._score.bind(this));\n\treadonly declarationProvider = new LanguageFeatureRegistry<DeclarationProvider>(this._score.bind(this));\n\treadonly implementationProvider = new LanguageFeatureRegistry<ImplementationProvider>(this._score.bind(this));\n\treadonly documentSymbolProvider = new LanguageFeatureRegistry<DocumentSymbolProvider>(this._score.bind(this));\n\treadonly inlayHintsProvider = new LanguageFeatureRegistry<InlayHintsProvider>(this._score.bind(this));\n\treadonly colorProvider = new LanguageFeatureRegistry<DocumentColorProvider>(this._score.bind(this));\n\treadonly codeLensProvider = new LanguageFeatureRegistry<CodeLensProvider>(this._score.bind(this));\n\treadonly documentFormattingEditProvider = new LanguageFeatureRegistry<DocumentFormattingEditProvider>(this._score.bind(this));\n\treadonly documentRangeFormattingEditProvider = new LanguageFeatureRegistry<DocumentRangeFormattingEditProvider>(this._score.bind(this));\n\treadonly onTypeFormattingEditProvider = new LanguageFeatureRegistry<OnTypeFormattingEditProvider>(this._score.bind(this));\n\treadonly signatureHelpProvider = new LanguageFeatureRegistry<SignatureHelpProvider>(this._score.bind(this));\n\treadonly hoverProvider = new LanguageFeatureRegistry<HoverProvider>(this._score.bind(this));\n\treadonly documentHighlightProvider = new LanguageFeatureRegistry<DocumentHighlightProvider>(this._score.bind(this));\n\treadonly selectionRangeProvider = new LanguageFeatureRegistry<SelectionRangeProvider>(this._score.bind(this));\n\treadonly foldingRangeProvider = new LanguageFeatureRegistry<FoldingRangeProvider>(this._score.bind(this));\n\treadonly linkProvider = new LanguageFeatureRegistry<LinkProvider>(this._score.bind(this));\n\treadonly inlineCompletionsProvider = new LanguageFeatureRegistry<InlineCompletionsProvider>(this._score.bind(this));\n\treadonly completionProvider = new LanguageFeatureRegistry<CompletionItemProvider>(this._score.bind(this));\n\treadonly linkedEditingRangeProvider = new LanguageFeatureRegistry<LinkedEditingRangeProvider>(this._score.bind(this));\n\treadonly documentRangeSemanticTokensProvider = new LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>(this._score.bind(this));\n\treadonly documentSemanticTokensProvider = new LanguageFeatureRegistry<DocumentSemanticTokensProvider>(this._score.bind(this));\n\n\n\tprivate _notebookTypeResolver?: NotebooTypeResolver;\n\n\tprivate _score(uri: URI): string | undefined {\n\t\treturn this._notebookTypeResolver?.(uri);\n\t}\n\n}\n\nregisterSingleton(ILanguageFeaturesService, LanguageFeaturesService, true);\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 { IModelDecoration } from 'vs/editor/common/model';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IMarker } from 'vs/platform/markers/common/markers';\nimport { URI } from 'vs/base/common/uri';\n\nexport const IMarkerDecorationsService = createDecorator<IMarkerDecorationsService>('markerDecorationsService');\n\nexport interface IMarkerDecorationsService {\n\treadonly _serviceBrand: undefined;\n\n\tgetMarker(uri: URI, decoration: IModelDecoration): IMarker | null;\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 'vs/base/common/event';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model';\nimport { ILanguageSelection } from 'vs/editor/common/languages/language';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages';\nimport { SemanticTokensProviderStyling } from 'vs/editor/common/services/semanticTokensProviderStyling';\n\nexport const IModelService = createDecorator<IModelService>('modelService');\n\nexport type DocumentTokensProvider = DocumentSemanticTokensProvider | DocumentRangeSemanticTokensProvider;\n\nexport interface IModelService {\n\treadonly _serviceBrand: undefined;\n\n\tcreateModel(value: string | ITextBufferFactory, languageSelection: ILanguageSelection | null, resource?: URI, isForSimpleWidget?: boolean): ITextModel;\n\n\tsetMode(model: ITextModel, languageSelection: ILanguageSelection): void;\n\n\tgetModels(): ITextModel[];\n\n\tgetCreationOptions(language: string, resource: URI, isForSimpleWidget: boolean): ITextModelCreationOptions;\n\n\tgetModel(resource: URI): ITextModel | null;\n\n\tgetSemanticTokensProviderStyling(provider: DocumentTokensProvider): SemanticTokensProviderStyling;\n\n\tonModelAdded: Event<ITextModel>;\n\n\tonModelRemoved: Event<ITextModel>;\n\n\tonModelLanguageChanged: Event<{ model: ITextModel; oldLanguageId: string }>;\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 { IReference } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IEditorModel } from 'vs/platform/editor/common/editor';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ITextModelService = createDecorator<ITextModelService>('textModelService');\n\nexport interface ITextModelService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Provided a resource URI, it will return a model reference\n\t * which should be disposed once not needed anymore.\n\t */\n\tcreateModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>>;\n}\n\nexport interface ITextEditorModel extends IEditorModel {\n\n\t/**\n\t * Provides access to the underlying `ITextModel`.\n\t */\n\treadonly textEditorModel: ITextModel | null;\n}\n\nexport interface IResolvedTextEditorModel extends ITextEditorModel {\n\n\t/**\n\t * Same as ITextEditorModel#textEditorModel, but never null.\n\t */\n\treadonly textEditorModel: ITextModel;\n}\n","\nimport { URI } from 'vs/base/common/uri';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ITextResourceConfigurationService = createDecorator<ITextResourceConfigurationService>('textResourceConfigurationService');\n\nexport interface ITextResourceConfigurationChangeEvent {\n\n\t/**\n\t * All affected keys. Also includes language overrides and keys changed under language overrides.\n\t */\n\treadonly affectedKeys: string[];\n\n\t/**\n\t * Returns `true` if the given section has changed for the given resource.\n\t *\n\t * Example: To check if the configuration section has changed for a given resource use `e.affectsConfiguration(resource, section)`.\n\t *\n\t * @param resource Resource for which the configuration has to be checked.\n\t * @param section Section of the configuration\n\t */\n\taffectsConfiguration(resource: URI, section: string): boolean;\n}\n\nexport interface ITextResourceConfigurationService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Fetches the value of the section for the given resource by applying language overrides.\n\t * Value can be of native type or an object keyed off the section name.\n\t *\n\t * @param resource - Resource for which the configuration has to be fetched.\n\t * @param position - Position in the resource for which configuration has to be fetched.\n\t * @param section - Section of the configuraion.\n\t *\n\t */\n\tgetValue<T>(resource: URI | undefined, section?: string): T;\n\tgetValue<T>(resource: URI | undefined, position?: IPosition, section?: string): T;\n\n}\n\nexport const ITextResourcePropertiesService = createDecorator<ITextResourcePropertiesService>('textResourcePropertiesService');\n\nexport interface ITextResourcePropertiesService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Returns the End of Line characters for the given resource\n\t */\n\tgetEOL(resource: URI, language?: string): string;\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 { Color } from 'vs/base/common/color';\nimport { ITokenThemeRule, TokenTheme } from 'vs/editor/common/languages/supports/tokenization';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport const IStandaloneThemeService = createDecorator<IStandaloneThemeService>('themeService');\n\nexport type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black';\nexport type IColors = { [colorId: string]: string };\n\nexport interface IStandaloneThemeData {\n\tbase: BuiltinTheme;\n\tinherit: boolean;\n\trules: ITokenThemeRule[];\n\tencodedTokensColors?: string[];\n\tcolors: IColors;\n}\n\nexport interface IStandaloneTheme extends IColorTheme {\n\ttokenTheme: TokenTheme;\n\tthemeName: string;\n}\n\nexport interface IStandaloneThemeService extends IThemeService {\n\treadonly _serviceBrand: undefined;\n\n\tsetTheme(themeName: string): void;\n\n\tsetAutoDetectHighContrast(autoDetectHighContrast: boolean): void;\n\n\tdefineTheme(themeName: string, themeData: IStandaloneThemeData): void;\n\n\tgetColorTheme(): IStandaloneTheme;\n\n\tsetColorMapOverride(colorMapOverride: Color[] | null): void;\n\n}\n","\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IClipboardService = createDecorator<IClipboardService>('clipboardService');\n\nexport interface IClipboardService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Writes text to the system clipboard.\n\t */\n\twriteText(text: string, type?: string): Promise<void>;\n\n\t/**\n\t * Reads the content of the clipboard in plain text\n\t */\n\treadText(type?: string): Promise<string>;\n\n\t/**\n\t * Reads text from the system find pasteboard.\n\t */\n\treadFindText(): Promise<string>;\n\n\t/**\n\t * Writes text to the system find pasteboard.\n\t */\n\twriteFindText(text: string): Promise<void>;\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { TypeConstraint, validateConstraints } from 'vs/base/common/types';\nimport { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ICommandService = createDecorator<ICommandService>('commandService');\n\nexport interface ICommandEvent {\n\tcommandId: string;\n\targs: any[];\n}\n\nexport interface ICommandService {\n\treadonly _serviceBrand: undefined;\n\tonWillExecuteCommand: Event<ICommandEvent>;\n\tonDidExecuteCommand: Event<ICommandEvent>;\n\texecuteCommand<T = any>(commandId: string, ...args: any[]): Promise<T | undefined>;\n}\n\nexport type ICommandsMap = Map<string, ICommand>;\n\nexport interface ICommandHandler {\n\t(accessor: ServicesAccessor, ...args: any[]): void;\n}\n\nexport interface ICommand {\n\tid: string;\n\thandler: ICommandHandler;\n\tdescription?: ICommandHandlerDescription | null;\n}\n\nexport interface ICommandHandlerDescription {\n\treadonly description: string;\n\treadonly args: ReadonlyArray<{\n\t\treadonly name: string;\n\t\treadonly isOptional?: boolean;\n\t\treadonly description?: string;\n\t\treadonly constraint?: TypeConstraint;\n\t\treadonly schema?: IJSONSchema;\n\t}>;\n}\n\nexport interface ICommandRegistry {\n\tregisterCommand(id: string, command: ICommandHandler): IDisposable;\n\tregisterCommand(command: ICommand): IDisposable;\n\tregisterCommandAlias(oldId: string, newId: string): IDisposable;\n\tgetCommand(id: string): ICommand | undefined;\n}\n\nexport const CommandsRegistry: ICommandRegistry = new class implements ICommandRegistry {\n\n\tprivate readonly _commands = new Map<string, LinkedList<ICommand>>();\n\n\tprivate readonly _onDidRegisterCommand = new Emitter<string>();\n\treadonly onDidRegisterCommand: Event<string> = this._onDidRegisterCommand.event;\n\n\tregisterCommand(idOrCommand: string | ICommand, handler?: ICommandHandler): IDisposable {\n\n\t\tif (!idOrCommand) {\n\t\t\tthrow new Error(`invalid command`);\n\t\t}\n\n\t\tif (typeof idOrCommand === 'string') {\n\t\t\tif (!handler) {\n\t\t\t\tthrow new Error(`invalid command`);\n\t\t\t}\n\t\t\treturn this.registerCommand({ id: idOrCommand, handler });\n\t\t}\n\n\t\t// add argument validation if rich command metadata is provided\n\t\tif (idOrCommand.description) {\n\t\t\tconst constraints: Array<TypeConstraint | undefined> = [];\n\t\t\tfor (let arg of idOrCommand.description.args) {\n\t\t\t\tconstraints.push(arg.constraint);\n\t\t\t}\n\t\t\tconst actualHandler = idOrCommand.handler;\n\t\t\tidOrCommand.handler = function (accessor, ...args: any[]) {\n\t\t\t\tvalidateConstraints(args, constraints);\n\t\t\t\treturn actualHandler(accessor, ...args);\n\t\t\t};\n\t\t}\n\n\t\t// find a place to store the command\n\t\tconst { id } = idOrCommand;\n\n\t\tlet commands = this._commands.get(id);\n\t\tif (!commands) {\n\t\t\tcommands = new LinkedList<ICommand>();\n\t\t\tthis._commands.set(id, commands);\n\t\t}\n\n\t\tlet removeFn = commands.unshift(idOrCommand);\n\n\t\tlet ret = toDisposable(() => {\n\t\t\tremoveFn();\n\t\t\tconst command = this._commands.get(id);\n\t\t\tif (command?.isEmpty()) {\n\t\t\t\tthis._commands.delete(id);\n\t\t\t}\n\t\t});\n\n\t\t// tell the world about this command\n\t\tthis._onDidRegisterCommand.fire(id);\n\n\t\treturn ret;\n\t}\n\n\tregisterCommandAlias(oldId: string, newId: string): IDisposable {\n\t\treturn CommandsRegistry.registerCommand(oldId, (accessor, ...args) => accessor.get(ICommandService).executeCommand(newId, ...args));\n\t}\n\n\tgetCommand(id: string): ICommand | undefined {\n\t\tconst list = this._commands.get(id);\n\t\tif (!list || list.isEmpty()) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn Iterable.first(list);\n\t}\n\n\tgetCommands(): ICommandsMap {\n\t\tconst result = new Map<string, ICommand>();\n\t\tfor (const key of this._commands.keys()) {\n\t\t\tconst command = this.getCommand(key);\n\t\t\tif (command) {\n\t\t\t\tresult.set(key, command);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n};\n\nexport const NullCommandService: ICommandService = {\n\t_serviceBrand: undefined,\n\tonWillExecuteCommand: () => Disposable.None,\n\tonDidExecuteCommand: () => Disposable.None,\n\texecuteCommand() {\n\t\treturn Promise.resolve(undefined);\n\t}\n};\n\nCommandsRegistry.registerCommand('noop', () => { });\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend, DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { assertType } from 'vs/base/common/types';\nimport { VSBuffer } from 'vs/base/common/buffer';\nimport { encodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto';\nimport { Range } from 'vs/editor/common/core/range';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport function isSemanticTokens(v: SemanticTokens | SemanticTokensEdits): v is SemanticTokens {\n\treturn v && !!((<SemanticTokens>v).data);\n}\n\nexport function isSemanticTokensEdits(v: SemanticTokens | SemanticTokensEdits): v is SemanticTokensEdits {\n\treturn v && Array.isArray((<SemanticTokensEdits>v).edits);\n}\n\nexport class DocumentSemanticTokensResult {\n\tconstructor(\n\t\tpublic readonly provider: DocumentSemanticTokensProvider,\n\t\tpublic readonly tokens: SemanticTokens | SemanticTokensEdits | null,\n\t\tpublic readonly error: any\n\t) { }\n}\n\nexport function hasDocumentSemanticTokensProvider(registry: LanguageFeatureRegistry<DocumentSemanticTokensProvider>, model: ITextModel): boolean {\n\treturn registry.has(model);\n}\n\nfunction getDocumentSemanticTokensProviders(registry: LanguageFeatureRegistry<DocumentSemanticTokensProvider>, model: ITextModel): DocumentSemanticTokensProvider[] {\n\tconst groups = registry.orderedGroups(model);\n\treturn (groups.length > 0 ? groups[0] : []);\n}\n\nexport async function getDocumentSemanticTokens(registry: LanguageFeatureRegistry<DocumentSemanticTokensProvider>, model: ITextModel, lastProvider: DocumentSemanticTokensProvider | null, lastResultId: string | null, token: CancellationToken): Promise<DocumentSemanticTokensResult | null> {\n\tconst providers = getDocumentSemanticTokensProviders(registry, model);\n\n\t// Get tokens from all providers at the same time.\n\tconst results = await Promise.all(providers.map(async (provider) => {\n\t\tlet result: SemanticTokens | SemanticTokensEdits | null | undefined;\n\t\tlet error: any = null;\n\t\ttry {\n\t\t\tresult = await provider.provideDocumentSemanticTokens(model, (provider === lastProvider ? lastResultId : null), token);\n\t\t} catch (err) {\n\t\t\terror = err;\n\t\t\tresult = null;\n\t\t}\n\n\t\tif (!result || (!isSemanticTokens(result) && !isSemanticTokensEdits(result))) {\n\t\t\tresult = null;\n\t\t}\n\n\t\treturn new DocumentSemanticTokensResult(provider, result, error);\n\t}));\n\n\t// Try to return the first result with actual tokens or\n\t// the first result which threw an error (!!)\n\tfor (const result of results) {\n\t\tif (result.error) {\n\t\t\tthrow result.error;\n\t\t}\n\t\tif (result.tokens) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t// Return the first result, even if it doesn't have tokens\n\tif (results.length > 0) {\n\t\treturn results[0];\n\t}\n\n\treturn null;\n}\n\nfunction _getDocumentSemanticTokensProviderHighestGroup(registry: LanguageFeatureRegistry<DocumentSemanticTokensProvider>, model: ITextModel): DocumentSemanticTokensProvider[] | null {\n\tconst result = registry.orderedGroups(model);\n\treturn (result.length > 0 ? result[0] : null);\n}\n\nclass DocumentRangeSemanticTokensResult {\n\tconstructor(\n\t\tpublic readonly provider: DocumentRangeSemanticTokensProvider,\n\t\tpublic readonly tokens: SemanticTokens | null,\n\t) { }\n}\n\nexport function hasDocumentRangeSemanticTokensProvider(providers: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>, model: ITextModel): boolean {\n\treturn providers.has(model);\n}\n\nfunction getDocumentRangeSemanticTokensProviders(providers: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>, model: ITextModel): DocumentRangeSemanticTokensProvider[] {\n\tconst groups = providers.orderedGroups(model);\n\treturn (groups.length > 0 ? groups[0] : []);\n}\n\nexport async function getDocumentRangeSemanticTokens(registry: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>, model: ITextModel, range: Range, token: CancellationToken): Promise<DocumentRangeSemanticTokensResult | null> {\n\tconst providers = getDocumentRangeSemanticTokensProviders(registry, model);\n\n\t// Get tokens from all providers at the same time.\n\tconst results = await Promise.all(providers.map(async (provider) => {\n\t\tlet result: SemanticTokens | null | undefined;\n\t\ttry {\n\t\t\tresult = await provider.provideDocumentRangeSemanticTokens(model, range, token);\n\t\t} catch (err) {\n\t\t\tonUnexpectedExternalError(err);\n\t\t\tresult = null;\n\t\t}\n\n\t\tif (!result || !isSemanticTokens(result)) {\n\t\t\tresult = null;\n\t\t}\n\n\t\treturn new DocumentRangeSemanticTokensResult(provider, result);\n\t}));\n\n\t// Try to return the first result with actual tokens\n\tfor (const result of results) {\n\t\tif (result.tokens) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t// Return the first result, even if it doesn't have tokens\n\tif (results.length > 0) {\n\t\treturn results[0];\n\t}\n\n\treturn null;\n}\n\nCommandsRegistry.registerCommand('_provideDocumentSemanticTokensLegend', async (accessor, ...args): Promise<SemanticTokensLegend | undefined> => {\n\tconst [uri] = args;\n\tassertType(uri instanceof URI);\n\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn undefined;\n\t}\n\tconst { documentSemanticTokensProvider } = accessor.get(ILanguageFeaturesService);\n\n\tconst providers = _getDocumentSemanticTokensProviderHighestGroup(documentSemanticTokensProvider, model);\n\tif (!providers) {\n\t\t// there is no provider => fall back to a document range semantic tokens provider\n\t\treturn accessor.get(ICommandService).executeCommand('_provideDocumentRangeSemanticTokensLegend', uri);\n\t}\n\n\treturn providers[0].getLegend();\n});\n\nCommandsRegistry.registerCommand('_provideDocumentSemanticTokens', async (accessor, ...args): Promise<VSBuffer | undefined> => {\n\tconst [uri] = args;\n\tassertType(uri instanceof URI);\n\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn undefined;\n\t}\n\tconst { documentSemanticTokensProvider } = accessor.get(ILanguageFeaturesService);\n\tif (!hasDocumentSemanticTokensProvider(documentSemanticTokensProvider, model)) {\n\t\t// there is no provider => fall back to a document range semantic tokens provider\n\t\treturn accessor.get(ICommandService).executeCommand('_provideDocumentRangeSemanticTokens', uri, model.getFullModelRange());\n\t}\n\n\tconst r = await getDocumentSemanticTokens(documentSemanticTokensProvider, model, null, null, CancellationToken.None);\n\tif (!r) {\n\t\treturn undefined;\n\t}\n\n\tconst { provider, tokens } = r;\n\n\tif (!tokens || !isSemanticTokens(tokens)) {\n\t\treturn undefined;\n\t}\n\n\tconst buff = encodeSemanticTokensDto({\n\t\tid: 0,\n\t\ttype: 'full',\n\t\tdata: tokens.data\n\t});\n\tif (tokens.resultId) {\n\t\tprovider.releaseDocumentSemanticTokens(tokens.resultId);\n\t}\n\treturn buff;\n});\n\nCommandsRegistry.registerCommand('_provideDocumentRangeSemanticTokensLegend', async (accessor, ...args): Promise<SemanticTokensLegend | undefined> => {\n\tconst [uri, range] = args;\n\tassertType(uri instanceof URI);\n\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn undefined;\n\t}\n\tconst { documentRangeSemanticTokensProvider } = accessor.get(ILanguageFeaturesService);\n\tconst providers = getDocumentRangeSemanticTokensProviders(documentRangeSemanticTokensProvider, model);\n\tif (providers.length === 0) {\n\t\t// no providers\n\t\treturn undefined;\n\t}\n\n\tif (providers.length === 1) {\n\t\t// straight forward case, just a single provider\n\t\treturn providers[0].getLegend();\n\t}\n\n\tif (!range || !Range.isIRange(range)) {\n\t\t// if no range is provided, we cannot support multiple providers\n\t\t// as we cannot fall back to the one which would give results\n\t\t// => return the first legend for backwards compatibility and print a warning\n\t\tconsole.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`);\n\t\treturn providers[0].getLegend();\n\t}\n\n\tconst result = await getDocumentRangeSemanticTokens(documentRangeSemanticTokensProvider, model, Range.lift(range), CancellationToken.None);\n\tif (!result) {\n\t\treturn undefined;\n\t}\n\n\treturn result.provider.getLegend();\n});\n\nCommandsRegistry.registerCommand('_provideDocumentRangeSemanticTokens', async (accessor, ...args): Promise<VSBuffer | undefined> => {\n\tconst [uri, range] = args;\n\tassertType(uri instanceof URI);\n\tassertType(Range.isIRange(range));\n\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn undefined;\n\t}\n\tconst { documentRangeSemanticTokensProvider } = accessor.get(ILanguageFeaturesService);\n\n\tconst result = await getDocumentRangeSemanticTokens(documentRangeSemanticTokensProvider, model, Range.lift(range), CancellationToken.None);\n\tif (!result || !result.tokens) {\n\t\t// there is no provider or it didn't return tokens\n\t\treturn undefined;\n\t}\n\n\treturn encodeSemanticTokensDto({\n\t\tid: 0,\n\t\ttype: 'full',\n\t\tdata: result.tokens.data\n\t});\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CodeLens, CodeLensList, CodeLensProvider } from 'vs/editor/common/languages';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport interface CodeLensItem {\n\tsymbol: CodeLens;\n\tprovider: CodeLensProvider;\n}\n\nexport class CodeLensModel {\n\n\tlenses: CodeLensItem[] = [];\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t}\n\n\tget isDisposed(): boolean {\n\t\treturn this._disposables.isDisposed;\n\t}\n\n\tadd(list: CodeLensList, provider: CodeLensProvider): void {\n\t\tthis._disposables.add(list);\n\t\tfor (const symbol of list.lenses) {\n\t\t\tthis.lenses.push({ symbol, provider });\n\t\t}\n\t}\n}\n\nexport async function getCodeLensModel(registry: LanguageFeatureRegistry<CodeLensProvider>, model: ITextModel, token: CancellationToken): Promise<CodeLensModel> {\n\n\tconst provider = registry.ordered(model);\n\tconst providerRanks = new Map<CodeLensProvider, number>();\n\tconst result = new CodeLensModel();\n\n\tconst promises = provider.map(async (provider, i) => {\n\n\t\tproviderRanks.set(provider, i);\n\n\t\ttry {\n\t\t\tconst list = await Promise.resolve(provider.provideCodeLenses(model, token));\n\t\t\tif (list) {\n\t\t\t\tresult.add(list, provider);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tonUnexpectedExternalError(err);\n\t\t}\n\t});\n\n\tawait Promise.all(promises);\n\n\tresult.lenses = result.lenses.sort((a, b) => {\n\t\t// sort by lineNumber, provider-rank, and column\n\t\tif (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) {\n\t\t\treturn -1;\n\t\t} else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) {\n\t\t\treturn 1;\n\t\t} else if ((providerRanks.get(a.provider)!) < (providerRanks.get(b.provider)!)) {\n\t\t\treturn -1;\n\t\t} else if ((providerRanks.get(a.provider)!) > (providerRanks.get(b.provider)!)) {\n\t\t\treturn 1;\n\t\t} else if (a.symbol.range.startColumn < b.symbol.range.startColumn) {\n\t\t\treturn -1;\n\t\t} else if (a.symbol.range.startColumn > b.symbol.range.startColumn) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t});\n\treturn result;\n}\n\nCommandsRegistry.registerCommand('_executeCodeLensProvider', function (accessor, ...args: [URI, number | undefined | null]) {\n\tlet [uri, itemResolveCount] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(typeof itemResolveCount === 'number' || !itemResolveCount);\n\n\tconst { codeLensProvider } = accessor.get(ILanguageFeaturesService);\n\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst result: CodeLens[] = [];\n\tconst disposables = new DisposableStore();\n\treturn getCodeLensModel(codeLensProvider, model, CancellationToken.None).then(value => {\n\n\t\tdisposables.add(value);\n\t\tlet resolve: Promise<any>[] = [];\n\n\t\tfor (const item of value.lenses) {\n\t\t\tif (itemResolveCount === undefined || itemResolveCount === null || Boolean(item.symbol.command)) {\n\t\t\t\tresult.push(item.symbol);\n\t\t\t} else if (itemResolveCount-- > 0 && item.provider.resolveCodeLens) {\n\t\t\t\tresolve.push(Promise.resolve(item.provider.resolveCodeLens(model, item.symbol, CancellationToken.None)).then(symbol => result.push(symbol || item.symbol)));\n\t\t\t}\n\t\t}\n\n\t\treturn Promise.all(resolve);\n\n\t}).then(() => {\n\t\treturn result;\n\t}).finally(() => {\n\t\t// make sure to return results, then (on next tick)\n\t\t// dispose the results\n\t\tsetTimeout(() => disposables.dispose(), 100);\n\t});\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { illegalArgument } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DocumentColorProvider, IColorInformation, IColorPresentation } from 'vs/editor/common/languages';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\n\n\nexport interface IColorData {\n\tcolorInfo: IColorInformation;\n\tprovider: DocumentColorProvider;\n}\n\nexport function getColors(registry: LanguageFeatureRegistry<DocumentColorProvider>, model: ITextModel, token: CancellationToken): Promise<IColorData[]> {\n\tconst colors: IColorData[] = [];\n\tconst providers = registry.ordered(model).reverse();\n\tconst promises = providers.map(provider => Promise.resolve(provider.provideDocumentColors(model, token)).then(result => {\n\t\tif (Array.isArray(result)) {\n\t\t\tfor (let colorInfo of result) {\n\t\t\t\tcolors.push({ colorInfo, provider });\n\t\t\t}\n\t\t}\n\t}));\n\n\treturn Promise.all(promises).then(() => colors);\n}\n\nexport function getColorPresentations(model: ITextModel, colorInfo: IColorInformation, provider: DocumentColorProvider, token: CancellationToken): Promise<IColorPresentation[] | null | undefined> {\n\treturn Promise.resolve(provider.provideColorPresentations(model, colorInfo, token));\n}\n\nCommandsRegistry.registerCommand('_executeDocumentColorProvider', function (accessor, ...args) {\n\n\tconst [resource] = args;\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument();\n\t}\n\tconst { colorProvider: colorProviderRegistry } = accessor.get(ILanguageFeaturesService);\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst rawCIs: { range: IRange; color: [number, number, number, number] }[] = [];\n\tconst providers = colorProviderRegistry.ordered(model).reverse();\n\tconst promises = providers.map(provider => Promise.resolve(provider.provideDocumentColors(model, CancellationToken.None)).then(result => {\n\t\tif (Array.isArray(result)) {\n\t\t\tfor (let ci of result) {\n\t\t\t\trawCIs.push({ range: ci.range, color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha] });\n\t\t\t}\n\t\t}\n\t}));\n\n\treturn Promise.all(promises).then(() => rawCIs);\n});\n\n\nCommandsRegistry.registerCommand('_executeColorPresentationProvider', function (accessor, ...args) {\n\n\tconst [color, context] = args;\n\tconst { uri, range } = context;\n\tif (!(uri instanceof URI) || !Array.isArray(color) || color.length !== 4 || !Range.isIRange(range)) {\n\t\tthrow illegalArgument();\n\t}\n\tconst [red, green, blue, alpha] = color;\n\n\tconst { colorProvider: colorProviderRegistry } = accessor.get(ILanguageFeaturesService);\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst colorInfo = {\n\t\trange,\n\t\tcolor: { red, green, blue, alpha }\n\t};\n\n\tconst presentations: IColorPresentation[] = [];\n\tconst providers = colorProviderRegistry.ordered(model).reverse();\n\tconst promises = providers.map(provider => Promise.resolve(provider.provideColorPresentations(model, colorInfo, CancellationToken.None)).then(result => {\n\t\tif (Array.isArray(result)) {\n\t\t\tpresentations.push(...result);\n\t\t}\n\t}));\n\treturn Promise.all(promises).then(() => presentations);\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 { coalesce } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { DisposableStore, isDisposable } from 'vs/base/common/lifecycle';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ILink, ILinksList, LinkProvider } from 'vs/editor/common/languages';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class Link implements ILink {\n\n\tprivate _link: ILink;\n\tprivate readonly _provider: LinkProvider;\n\n\tconstructor(link: ILink, provider: LinkProvider) {\n\t\tthis._link = link;\n\t\tthis._provider = provider;\n\t}\n\n\ttoJSON(): ILink {\n\t\treturn {\n\t\t\trange: this.range,\n\t\t\turl: this.url,\n\t\t\ttooltip: this.tooltip\n\t\t};\n\t}\n\n\tget range(): IRange {\n\t\treturn this._link.range;\n\t}\n\n\tget url(): URI | string | undefined {\n\t\treturn this._link.url;\n\t}\n\n\tget tooltip(): string | undefined {\n\t\treturn this._link.tooltip;\n\t}\n\n\tasync resolve(token: CancellationToken): Promise<URI | string> {\n\t\tif (this._link.url) {\n\t\t\treturn this._link.url;\n\t\t}\n\n\t\tif (typeof this._provider.resolveLink === 'function') {\n\t\t\treturn Promise.resolve(this._provider.resolveLink(this._link, token)).then(value => {\n\t\t\t\tthis._link = value || this._link;\n\t\t\t\tif (this._link.url) {\n\t\t\t\t\t// recurse\n\t\t\t\t\treturn this.resolve(token);\n\t\t\t\t}\n\n\t\t\t\treturn Promise.reject(new Error('missing'));\n\t\t\t});\n\t\t}\n\n\t\treturn Promise.reject(new Error('missing'));\n\t}\n}\n\nexport class LinksList {\n\n\treadonly links: Link[];\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\tconstructor(tuples: [ILinksList, LinkProvider][]) {\n\n\t\tlet links: Link[] = [];\n\t\tfor (const [list, provider] of tuples) {\n\t\t\t// merge all links\n\t\t\tconst newLinks = list.links.map(link => new Link(link, provider));\n\t\t\tlinks = LinksList._union(links, newLinks);\n\t\t\t// register disposables\n\t\t\tif (isDisposable(list)) {\n\t\t\t\tthis._disposables.add(list);\n\t\t\t}\n\t\t}\n\t\tthis.links = links;\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis.links.length = 0;\n\t}\n\n\tprivate static _union(oldLinks: Link[], newLinks: Link[]): Link[] {\n\t\t// reunite oldLinks with newLinks and remove duplicates\n\t\tlet result: Link[] = [];\n\t\tlet oldIndex: number;\n\t\tlet oldLen: number;\n\t\tlet newIndex: number;\n\t\tlet newLen: number;\n\n\t\tfor (oldIndex = 0, newIndex = 0, oldLen = oldLinks.length, newLen = newLinks.length; oldIndex < oldLen && newIndex < newLen;) {\n\t\t\tconst oldLink = oldLinks[oldIndex];\n\t\t\tconst newLink = newLinks[newIndex];\n\n\t\t\tif (Range.areIntersectingOrTouching(oldLink.range, newLink.range)) {\n\t\t\t\t// Remove the oldLink\n\t\t\t\toldIndex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst comparisonResult = Range.compareRangesUsingStarts(oldLink.range, newLink.range);\n\n\t\t\tif (comparisonResult < 0) {\n\t\t\t\t// oldLink is before\n\t\t\t\tresult.push(oldLink);\n\t\t\t\toldIndex++;\n\t\t\t} else {\n\t\t\t\t// newLink is before\n\t\t\t\tresult.push(newLink);\n\t\t\t\tnewIndex++;\n\t\t\t}\n\t\t}\n\n\t\tfor (; oldIndex < oldLen; oldIndex++) {\n\t\t\tresult.push(oldLinks[oldIndex]);\n\t\t}\n\t\tfor (; newIndex < newLen; newIndex++) {\n\t\t\tresult.push(newLinks[newIndex]);\n\t\t}\n\n\t\treturn result;\n\t}\n\n}\n\nexport function getLinks(providers: LanguageFeatureRegistry<LinkProvider>, model: ITextModel, token: CancellationToken): Promise<LinksList> {\n\n\tconst lists: [ILinksList, LinkProvider][] = [];\n\n\t// ask all providers for links in parallel\n\tconst promises = providers.ordered(model).reverse().map((provider, i) => {\n\t\treturn Promise.resolve(provider.provideLinks(model, token)).then(result => {\n\t\t\tif (result) {\n\t\t\t\tlists[i] = [result, provider];\n\t\t\t}\n\t\t}, onUnexpectedExternalError);\n\t});\n\n\treturn Promise.all(promises).then(() => {\n\t\tconst result = new LinksList(coalesce(lists));\n\t\tif (!token.isCancellationRequested) {\n\t\t\treturn result;\n\t\t}\n\t\tresult.dispose();\n\t\treturn new LinksList([]);\n\t});\n}\n\n\nCommandsRegistry.registerCommand('_executeLinkProvider', async (accessor, ...args): Promise<ILink[]> => {\n\tlet [uri, resolveCount] = args;\n\tassertType(uri instanceof URI);\n\n\tif (typeof resolveCount !== 'number') {\n\t\tresolveCount = 0;\n\t}\n\n\tconst { linkProvider } = accessor.get(ILanguageFeaturesService);\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn [];\n\t}\n\tconst list = await getLinks(linkProvider, model, CancellationToken.None);\n\tif (!list) {\n\t\treturn [];\n\t}\n\n\t// resolve links\n\tfor (let i = 0; i < Math.min(resolveCount, list.links.length); i++) {\n\t\tawait list.links[i].resolve(CancellationToken.None);\n\t}\n\n\tconst result = list.links.slice(0);\n\tlist.dispose();\n\treturn result;\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 'vs/base/common/event';\nimport { URI, UriComponents } from 'vs/base/common/uri';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IConfigurationService = createDecorator<IConfigurationService>('configurationService');\n\nexport interface IConfigurationOverrides {\n\toverrideIdentifier?: string | null;\n\tresource?: URI | null;\n}\n\nexport type IConfigurationUpdateOverrides = Omit<IConfigurationOverrides, 'overrideIdentifier'> & { overrideIdentifiers?: string[] | null };\n\nexport const enum ConfigurationTarget {\n\tUSER = 1,\n\tUSER_LOCAL,\n\tUSER_REMOTE,\n\tWORKSPACE,\n\tWORKSPACE_FOLDER,\n\tDEFAULT,\n\tMEMORY\n}\n\nexport interface IConfigurationChange {\n\tkeys: string[];\n\toverrides: [string, string[]][];\n}\n\nexport interface IConfigurationChangeEvent {\n\n\treadonly source: ConfigurationTarget;\n\treadonly affectedKeys: string[];\n\treadonly change: IConfigurationChange;\n\n\taffectsConfiguration(configuration: string, overrides?: IConfigurationOverrides): boolean;\n}\n\nexport interface IConfigurationValue<T> {\n\n\treadonly defaultValue?: T;\n\treadonly userValue?: T;\n\treadonly userLocalValue?: T;\n\treadonly userRemoteValue?: T;\n\treadonly workspaceValue?: T;\n\treadonly workspaceFolderValue?: T;\n\treadonly memoryValue?: T;\n\treadonly value?: T;\n\n\treadonly default?: { value?: T; override?: T };\n\treadonly user?: { value?: T; override?: T };\n\treadonly userLocal?: { value?: T; override?: T };\n\treadonly userRemote?: { value?: T; override?: T };\n\treadonly workspace?: { value?: T; override?: T };\n\treadonly workspaceFolder?: { value?: T; override?: T };\n\treadonly memory?: { value?: T; override?: T };\n\n\treadonly overrideIdentifiers?: string[];\n}\n\nexport interface IConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidChangeConfiguration: Event<IConfigurationChangeEvent>;\n\n\t/**\n\t * Fetches the value of the section for the given overrides.\n\t * Value can be of native type or an object keyed off the section name.\n\t *\n\t * @param section - Section of the configuraion. Can be `null` or `undefined`.\n\t * @param overrides - Overrides that has to be applied while fetching\n\t *\n\t */\n\tgetValue<T>(): T;\n\tgetValue<T>(section: string): T;\n\tgetValue<T>(overrides: IConfigurationOverrides): T;\n\tgetValue<T>(section: string, overrides: IConfigurationOverrides): T;\n\n\t/**\n\t * Update a configuration value.\n\t *\n\t * Use `target` to update the configuration in a specific `ConfigurationTarget`.\n\t *\n\t * Use `overrides` to update the configuration for a resource or for override identifiers or both.\n\t *\n\t * Passing a resource through overrides will update the configuration in the workspace folder containing that resource.\n\t *\n\t * *Note 1:* Updating configuraiton to a default value will remove the configuration from the requested target. If not target is passed, it will be removed from all writeable targets.\n\t *\n\t * *Note 2:* Use `undefined` value to remove the configuration from the given target. If not target is passed, it will be removed from all writeable targets.\n\t *\n\t * Use `donotNotifyError` and set it to `true` to surpresss errors.\n\t *\n\t * @param key setting to be updated\n\t * @param value The new value\n\t */\n\tupdateValue(key: string, value: any): Promise<void>;\n\tupdateValue(key: string, value: any, target: ConfigurationTarget): Promise<void>;\n\tupdateValue(key: string, value: any, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides): Promise<void>;\n\tupdateValue(key: string, value: any, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides, target: ConfigurationTarget, donotNotifyError?: boolean): Promise<void>;\n\n\tinspect<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<Readonly<T>>;\n}\n\nexport interface IConfigurationModel {\n\tcontents: any;\n\tkeys: string[];\n\toverrides: IOverrides[];\n}\n\nexport interface IOverrides {\n\tkeys: string[];\n\tcontents: any;\n\tidentifiers: string[];\n}\n\nexport interface IConfigurationData {\n\tdefaults: IConfigurationModel;\n\tuser: IConfigurationModel;\n\tworkspace: IConfigurationModel;\n\tfolders: [UriComponents, IConfigurationModel][];\n}\n\nexport function toValuesTree(properties: { [qualifiedKey: string]: any }, conflictReporter: (message: string) => void): any {\n\tconst root = Object.create(null);\n\n\tfor (let key in properties) {\n\t\taddToValueTree(root, key, properties[key], conflictReporter);\n\t}\n\n\treturn root;\n}\n\nexport function addToValueTree(settingsTreeRoot: any, key: string, value: any, conflictReporter: (message: string) => void): void {\n\tconst segments = key.split('.');\n\tconst last = segments.pop()!;\n\n\tlet curr = settingsTreeRoot;\n\tfor (let i = 0; i < segments.length; i++) {\n\t\tlet s = segments[i];\n\t\tlet obj = curr[s];\n\t\tswitch (typeof obj) {\n\t\t\tcase 'undefined':\n\t\t\t\tobj = curr[s] = Object.create(null);\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconflictReporter(`Ignoring ${key} as ${segments.slice(0, i + 1).join('.')} is ${JSON.stringify(obj)}`);\n\t\t\t\treturn;\n\t\t}\n\t\tcurr = obj;\n\t}\n\n\tif (typeof curr === 'object' && curr !== null) {\n\t\ttry {\n\t\t\tcurr[last] = value; // workaround https://github.com/microsoft/vscode/issues/13606\n\t\t} catch (e) {\n\t\t\tconflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`);\n\t\t}\n\t} else {\n\t\tconflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`);\n\t}\n}\n\nexport function removeFromValueTree(valueTree: any, key: string): void {\n\tconst segments = key.split('.');\n\tdoRemoveFromValueTree(valueTree, segments);\n}\n\nfunction doRemoveFromValueTree(valueTree: any, segments: string[]): void {\n\tconst first = segments.shift()!;\n\tif (segments.length === 0) {\n\t\t// Reached last segment\n\t\tdelete valueTree[first];\n\t\treturn;\n\t}\n\n\tif (Object.keys(valueTree).indexOf(first) !== -1) {\n\t\tconst value = valueTree[first];\n\t\tif (typeof value === 'object' && !Array.isArray(value)) {\n\t\t\tdoRemoveFromValueTree(value, segments);\n\t\t\tif (Object.keys(value).length === 0) {\n\t\t\t\tdelete valueTree[first];\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * A helper function to get the configuration value with a specific settings path (e.g. config.some.setting)\n */\nexport function getConfigurationValue<T>(config: any, settingPath: string, defaultValue?: T): T {\n\tfunction accessSetting(config: any, path: string[]): any {\n\t\tlet current = config;\n\t\tfor (const component of path) {\n\t\t\tif (typeof current !== 'object' || current === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcurrent = current[component];\n\t\t}\n\t\treturn <T>current;\n\t}\n\n\tconst path = settingPath.split('.');\n\tconst result = accessSetting(config, path);\n\n\treturn typeof result === 'undefined' ? defaultValue : result;\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from 'vs/editor/common/core/wordHelper';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IndentAction, IndentationRule, LanguageConfiguration, CompleteEnterAction, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration';\nimport { createScopedLineTokens, ScopedLineTokens } from 'vs/editor/common/languages/supports';\nimport { CharacterPairSupport } from 'vs/editor/common/languages/supports/characterPair';\nimport { BracketElectricCharacterSupport } from 'vs/editor/common/languages/supports/electricCharacter';\nimport { IndentConsts, IndentRulesSupport } from 'vs/editor/common/languages/supports/indentRules';\nimport { OnEnterSupport } from 'vs/editor/common/languages/supports/onEnter';\nimport { RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets';\nimport { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\n\n/**\n * Interface used to support insertion of mode specific comments.\n */\nexport interface ICommentsConfiguration {\n\tlineCommentToken?: string;\n\tblockCommentStartToken?: string;\n\tblockCommentEndToken?: string;\n}\n\nexport interface IVirtualModel {\n\tgetLineTokens(lineNumber: number): LineTokens;\n\tgetLanguageId(): string;\n\tgetLanguageIdAtPosition(lineNumber: number, column: number): string;\n\tgetLineContent(lineNumber: number): string;\n}\n\nexport interface IIndentConverter {\n\tshiftIndent(indentation: string): string;\n\tunshiftIndent(indentation: string): string;\n\tnormalizeIndentation?(indentation: string): string;\n}\n\nexport interface ILanguageConfigurationService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidChange: Event<LanguageConfigurationServiceChangeEvent>;\n\tgetLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration;\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 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(LanguageConfigurationRegistry.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 getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\tlet result = this.configurations.get(languageId);\n\t\tif (!result) {\n\t\t\tresult = computeConfig(languageId, 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\tconfigurationService: IConfigurationService,\n\tlanguageService: ILanguageService,\n): ResolvedLanguageConfiguration {\n\tlet languageConfig = LanguageConfigurationRegistry.getLanguageConfiguration(languageId);\n\n\tif (!languageConfig) {\n\t\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\t\tthrow new Error(`Language id \"${languageId}\" is not configured nor known`);\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 class LanguageConfigurationChangeEvent {\n\tconstructor(public readonly languageId: string) { }\n}\n\nexport class LanguageConfigurationRegistryImpl {\n\tprivate readonly _entries = new Map<string, ComposedLanguageConfiguration>();\n\n\tprivate readonly _onDidChange = new Emitter<LanguageConfigurationChangeEvent>();\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\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 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\tpublic getComments(languageId: string): ICommentsConfiguration | null {\n\t\tconst value = this.getLanguageConfiguration(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.comments || null;\n\t}\n\n\t// begin Indent Rules\n\n\tpublic getIndentRulesSupport(languageId: string): IndentRulesSupport | null {\n\t\tconst value = this.getLanguageConfiguration(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.indentRulesSupport || null;\n\t}\n\n\t/**\n\t * Get nearest preceding line which doesn't match unIndentPattern or contains all whitespace.\n\t * Result:\n\t * -1: run into the boundary of embedded languages\n\t * 0: every line above are invalid\n\t * else: nearest preceding line of the same language\n\t */\n\tprivate getPrecedingValidLine(model: IVirtualModel, lineNumber: number, indentRulesSupport: IndentRulesSupport) {\n\t\tconst languageId = model.getLanguageIdAtPosition(lineNumber, 0);\n\t\tif (lineNumber > 1) {\n\t\t\tlet lastLineNumber: number;\n\t\t\tlet resultLineNumber = -1;\n\n\t\t\tfor (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\n\t\t\t\tif (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageId) {\n\t\t\t\t\treturn resultLineNumber;\n\t\t\t\t}\n\t\t\t\tconst text = model.getLineContent(lastLineNumber);\n\t\t\t\tif (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\n\t\t\t\t\tresultLineNumber = lastLineNumber;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treturn lastLineNumber;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Get inherited indentation from above lines.\n\t * 1. Find the nearest preceding line which doesn't match unIndentedLinePattern.\n\t * 2. If this line matches indentNextLinePattern or increaseIndentPattern, it means that the indent level of `lineNumber` should be 1 greater than this line.\n\t * 3. If this line doesn't match any indent rules\n\t * a. check whether the line above it matches indentNextLinePattern\n\t * b. If not, the indent level of this line is the result\n\t * c. If so, it means the indent of this line is *temporary*, go upward utill we find a line whose indent is not temporary (the same workflow a -> b -> c).\n\t * 4. Otherwise, we fail to get an inherited indent from aboves. Return null and we should not touch the indent of `lineNumber`\n\t *\n\t * This function only return the inherited indent based on above lines, it doesn't check whether current line should decrease or not.\n\t */\n\tpublic getInheritIndentForLine(autoIndent: EditorAutoIndentStrategy, model: IVirtualModel, lineNumber: number, honorIntentialIndent: boolean = true): { indentation: string; action: IndentAction | null; line?: number } | null {\n\t\tif (autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indentRulesSupport = this.getIndentRulesSupport(model.getLanguageId());\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (lineNumber <= 1) {\n\t\t\treturn {\n\t\t\t\tindentation: '',\n\t\t\t\taction: null\n\t\t\t};\n\t\t}\n\n\t\tconst precedingUnIgnoredLine = this.getPrecedingValidLine(model, lineNumber, indentRulesSupport);\n\t\tif (precedingUnIgnoredLine < 0) {\n\t\t\treturn null;\n\t\t} else if (precedingUnIgnoredLine < 1) {\n\t\t\treturn {\n\t\t\t\tindentation: '',\n\t\t\t\taction: null\n\t\t\t};\n\t\t}\n\n\t\tconst precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine);\n\t\tif (indentRulesSupport.shouldIncrease(precedingUnIgnoredLineContent) || indentRulesSupport.shouldIndentNextLine(precedingUnIgnoredLineContent)) {\n\t\t\treturn {\n\t\t\t\tindentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent),\n\t\t\t\taction: IndentAction.Indent,\n\t\t\t\tline: precedingUnIgnoredLine\n\t\t\t};\n\t\t} else if (indentRulesSupport.shouldDecrease(precedingUnIgnoredLineContent)) {\n\t\t\treturn {\n\t\t\t\tindentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent),\n\t\t\t\taction: null,\n\t\t\t\tline: precedingUnIgnoredLine\n\t\t\t};\n\t\t} else {\n\t\t\t// precedingUnIgnoredLine can not be ignored.\n\t\t\t// it doesn't increase indent of following lines\n\t\t\t// it doesn't increase just next line\n\t\t\t// so current line is not affect by precedingUnIgnoredLine\n\t\t\t// and then we should get a correct inheritted indentation from above lines\n\t\t\tif (precedingUnIgnoredLine === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tindentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)),\n\t\t\t\t\taction: null,\n\t\t\t\t\tline: precedingUnIgnoredLine\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst previousLine = precedingUnIgnoredLine - 1;\n\n\t\t\tconst previousLineIndentMetadata = indentRulesSupport.getIndentMetadata(model.getLineContent(previousLine));\n\t\t\tif (!(previousLineIndentMetadata & (IndentConsts.INCREASE_MASK | IndentConsts.DECREASE_MASK)) &&\n\t\t\t\t(previousLineIndentMetadata & IndentConsts.INDENT_NEXTLINE_MASK)) {\n\t\t\t\tlet stopLine = 0;\n\t\t\t\tfor (let i = previousLine - 1; i > 0; i--) {\n\t\t\t\t\tif (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstopLine = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tindentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)),\n\t\t\t\t\taction: null,\n\t\t\t\t\tline: stopLine + 1\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (honorIntentialIndent) {\n\t\t\t\treturn {\n\t\t\t\t\tindentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)),\n\t\t\t\t\taction: null,\n\t\t\t\t\tline: precedingUnIgnoredLine\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// search from precedingUnIgnoredLine until we find one whose indent is not temporary\n\t\t\t\tfor (let i = precedingUnIgnoredLine; i > 0; i--) {\n\t\t\t\t\tconst lineContent = model.getLineContent(i);\n\t\t\t\t\tif (indentRulesSupport.shouldIncrease(lineContent)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tindentation: strings.getLeadingWhitespace(lineContent),\n\t\t\t\t\t\t\taction: IndentAction.Indent,\n\t\t\t\t\t\t\tline: i\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (indentRulesSupport.shouldIndentNextLine(lineContent)) {\n\t\t\t\t\t\tlet stopLine = 0;\n\t\t\t\t\t\tfor (let j = i - 1; j > 0; j--) {\n\t\t\t\t\t\t\tif (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstopLine = j;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tindentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)),\n\t\t\t\t\t\t\taction: null,\n\t\t\t\t\t\t\tline: stopLine + 1\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (indentRulesSupport.shouldDecrease(lineContent)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tindentation: strings.getLeadingWhitespace(lineContent),\n\t\t\t\t\t\t\taction: null,\n\t\t\t\t\t\t\tline: i\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tindentation: strings.getLeadingWhitespace(model.getLineContent(1)),\n\t\t\t\t\taction: null,\n\t\t\t\t\tline: 1\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getGoodIndentForLine(autoIndent: EditorAutoIndentStrategy, virtualModel: IVirtualModel, languageId: string, lineNumber: number, indentConverter: IIndentConverter): string | null {\n\t\tif (autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst richEditSupport = this.getLanguageConfiguration(languageId);\n\t\tif (!richEditSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indentRulesSupport = this.getIndentRulesSupport(languageId);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indent = this.getInheritIndentForLine(autoIndent, virtualModel, lineNumber);\n\t\tconst lineContent = virtualModel.getLineContent(lineNumber);\n\n\t\tif (indent) {\n\t\t\tconst inheritLine = indent.line;\n\t\t\tif (inheritLine !== undefined) {\n\t\t\t\tconst enterResult = richEditSupport.onEnter(autoIndent, '', virtualModel.getLineContent(inheritLine), '');\n\n\t\t\t\tif (enterResult) {\n\t\t\t\t\tlet indentation = strings.getLeadingWhitespace(virtualModel.getLineContent(inheritLine));\n\n\t\t\t\t\tif (enterResult.removeText) {\n\t\t\t\t\t\tindentation = indentation.substring(0, indentation.length - enterResult.removeText);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(enterResult.indentAction === IndentAction.Indent) ||\n\t\t\t\t\t\t(enterResult.indentAction === IndentAction.IndentOutdent)\n\t\t\t\t\t) {\n\t\t\t\t\t\tindentation = indentConverter.shiftIndent(indentation);\n\t\t\t\t\t} else if (enterResult.indentAction === IndentAction.Outdent) {\n\t\t\t\t\t\tindentation = indentConverter.unshiftIndent(indentation);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (indentRulesSupport.shouldDecrease(lineContent)) {\n\t\t\t\t\t\tindentation = indentConverter.unshiftIndent(indentation);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (enterResult.appendText) {\n\t\t\t\t\t\tindentation += enterResult.appendText;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn strings.getLeadingWhitespace(indentation);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (indentRulesSupport.shouldDecrease(lineContent)) {\n\t\t\t\tif (indent.action === IndentAction.Indent) {\n\t\t\t\t\treturn indent.indentation;\n\t\t\t\t} else {\n\t\t\t\t\treturn indentConverter.unshiftIndent(indent.indentation);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (indent.action === IndentAction.Indent) {\n\t\t\t\t\treturn indentConverter.shiftIndent(indent.indentation);\n\t\t\t\t} else {\n\t\t\t\t\treturn indent.indentation;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getIndentForEnter(autoIndent: EditorAutoIndentStrategy, model: ITextModel, range: Range, indentConverter: IIndentConverter): { beforeEnter: string; afterEnter: string } | null {\n\t\tif (autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn null;\n\t\t}\n\t\tmodel.forceTokenization(range.startLineNumber);\n\t\tconst lineTokens = model.getLineTokens(range.startLineNumber);\n\t\tconst scopedLineTokens = createScopedLineTokens(lineTokens, range.startColumn - 1);\n\t\tconst scopedLineText = scopedLineTokens.getLineContent();\n\n\t\tlet embeddedLanguage = false;\n\t\tlet beforeEnterText: string;\n\t\tif (scopedLineTokens.firstCharOffset > 0 && lineTokens.getLanguageId(0) !== scopedLineTokens.languageId) {\n\t\t\t// we are in the embeded language content\n\t\t\tembeddedLanguage = true; // if embeddedLanguage is true, then we don't touch the indentation of current line\n\t\t\tbeforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t} else {\n\t\t\tbeforeEnterText = lineTokens.getLineContent().substring(0, range.startColumn - 1);\n\t\t}\n\n\t\tlet afterEnterText: string;\n\t\tif (range.isEmpty()) {\n\t\t\tafterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t} else {\n\t\t\tconst endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn);\n\t\t\tafterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t}\n\n\t\tconst indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst beforeEnterResult = beforeEnterText;\n\t\tconst beforeEnterIndent = strings.getLeadingWhitespace(beforeEnterText);\n\n\t\tconst virtualModel: IVirtualModel = {\n\t\t\tgetLineTokens: (lineNumber: number) => {\n\t\t\t\treturn model.getLineTokens(lineNumber);\n\t\t\t},\n\t\t\tgetLanguageId: () => {\n\t\t\t\treturn model.getLanguageId();\n\t\t\t},\n\t\t\tgetLanguageIdAtPosition: (lineNumber: number, column: number) => {\n\t\t\t\treturn model.getLanguageIdAtPosition(lineNumber, column);\n\t\t\t},\n\t\t\tgetLineContent: (lineNumber: number) => {\n\t\t\t\tif (lineNumber === range.startLineNumber) {\n\t\t\t\t\treturn beforeEnterResult;\n\t\t\t\t} else {\n\t\t\t\t\treturn model.getLineContent(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst currentLineIndent = strings.getLeadingWhitespace(lineTokens.getLineContent());\n\t\tconst afterEnterAction = this.getInheritIndentForLine(autoIndent, virtualModel, range.startLineNumber + 1);\n\t\tif (!afterEnterAction) {\n\t\t\tconst beforeEnter = embeddedLanguage ? currentLineIndent : beforeEnterIndent;\n\t\t\treturn {\n\t\t\t\tbeforeEnter: beforeEnter,\n\t\t\t\tafterEnter: beforeEnter\n\t\t\t};\n\t\t}\n\n\t\tlet afterEnterIndent = embeddedLanguage ? currentLineIndent : afterEnterAction.indentation;\n\n\t\tif (afterEnterAction.action === IndentAction.Indent) {\n\t\t\tafterEnterIndent = indentConverter.shiftIndent(afterEnterIndent);\n\t\t}\n\n\t\tif (indentRulesSupport.shouldDecrease(afterEnterText)) {\n\t\t\tafterEnterIndent = indentConverter.unshiftIndent(afterEnterIndent);\n\t\t}\n\n\t\treturn {\n\t\t\tbeforeEnter: embeddedLanguage ? currentLineIndent : beforeEnterIndent,\n\t\t\tafterEnter: afterEnterIndent\n\t\t};\n\t}\n\n\t/**\n\t * We should always allow intentional indentation. It means, if users change the indentation of `lineNumber` and the content of\n\t * this line doesn't match decreaseIndentPattern, we should not adjust the indentation.\n\t */\n\tpublic getIndentActionForType(autoIndent: EditorAutoIndentStrategy, model: ITextModel, range: Range, ch: string, indentConverter: IIndentConverter): string | null {\n\t\tif (autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn null;\n\t\t}\n\t\tconst scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn);\n\n\t\tif (scopedLineTokens.firstCharOffset) {\n\t\t\t// this line has mixed languages and indentation rules will not work\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst scopedLineText = scopedLineTokens.getLineContent();\n\t\tconst beforeTypeText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\n\t\t// selection support\n\t\tlet afterTypeText: string;\n\t\tif (range.isEmpty()) {\n\t\t\tafterTypeText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t} else {\n\t\t\tconst endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn);\n\t\t\tafterTypeText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t}\n\n\t\t// If previous content already matches decreaseIndentPattern, it means indentation of this line should already be adjusted\n\t\t// Users might change the indentation by purpose and we should honor that instead of readjusting.\n\t\tif (!indentRulesSupport.shouldDecrease(beforeTypeText + afterTypeText) && indentRulesSupport.shouldDecrease(beforeTypeText + ch + afterTypeText)) {\n\t\t\t// after typing `ch`, the content matches decreaseIndentPattern, we should adjust the indent to a good manner.\n\t\t\t// 1. Get inherited indent action\n\t\t\tconst r = this.getInheritIndentForLine(autoIndent, model, range.startLineNumber, false);\n\t\t\tif (!r) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet indentation = r.indentation;\n\t\t\tif (r.action !== IndentAction.Indent) {\n\t\t\t\tindentation = indentConverter.unshiftIndent(indentation);\n\t\t\t}\n\n\t\t\treturn indentation;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getIndentMetadata(model: ITextModel, lineNumber: number): number | null {\n\t\tconst indentRulesSupport = this.getIndentRulesSupport(model.getLanguageId());\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\t\tif (lineNumber < 1 || lineNumber > model.getLineCount()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn indentRulesSupport.getIndentMetadata(model.getLineContent(lineNumber));\n\t}\n\n\t// end Indent Rules\n\n\t// begin onEnter\n\n\tpublic getEnterAction(autoIndent: EditorAutoIndentStrategy, model: ITextModel, range: Range): CompleteEnterAction | null {\n\t\tconst scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn);\n\t\tconst richEditSupport = this.getLanguageConfiguration(scopedLineTokens.languageId);\n\t\tif (!richEditSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst scopedLineText = scopedLineTokens.getLineContent();\n\t\tconst beforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\n\t\t// selection support\n\t\tlet afterEnterText: string;\n\t\tif (range.isEmpty()) {\n\t\t\tafterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t} else {\n\t\t\tconst endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn);\n\t\t\tafterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\t}\n\n\t\tlet previousLineText = '';\n\t\tif (range.startLineNumber > 1 && scopedLineTokens.firstCharOffset === 0) {\n\t\t\t// This is not the first line and the entire line belongs to this mode\n\t\t\tconst oneLineAboveScopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber - 1);\n\t\t\tif (oneLineAboveScopedLineTokens.languageId === scopedLineTokens.languageId) {\n\t\t\t\t// The line above ends with text belonging to the same mode\n\t\t\t\tpreviousLineText = oneLineAboveScopedLineTokens.getLineContent();\n\t\t\t}\n\t\t}\n\n\t\tconst enterResult = richEditSupport.onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText);\n\t\tif (!enterResult) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indentAction = enterResult.indentAction;\n\t\tlet appendText = enterResult.appendText;\n\t\tconst removeText = enterResult.removeText || 0;\n\n\t\t// Here we add `\\t` to appendText first because enterAction is leveraging appendText and removeText to change indentation.\n\t\tif (!appendText) {\n\t\t\tif (\n\t\t\t\t(indentAction === IndentAction.Indent) ||\n\t\t\t\t(indentAction === IndentAction.IndentOutdent)\n\t\t\t) {\n\t\t\t\tappendText = '\\t';\n\t\t\t} else {\n\t\t\t\tappendText = '';\n\t\t\t}\n\t\t} else if (indentAction === IndentAction.Indent) {\n\t\t\tappendText = '\\t' + appendText;\n\t\t}\n\n\t\tlet indentation = this.getIndentationAtPosition(model, range.startLineNumber, range.startColumn);\n\t\tif (removeText) {\n\t\t\tindentation = indentation.substring(0, indentation.length - removeText);\n\t\t}\n\n\t\treturn {\n\t\t\tindentAction: indentAction,\n\t\t\tappendText: appendText,\n\t\t\tremoveText: removeText,\n\t\t\tindentation: indentation\n\t\t};\n\t}\n\n\tpublic getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\t\tconst lineText = model.getLineContent(lineNumber);\n\t\tlet indentation = strings.getLeadingWhitespace(lineText);\n\t\tif (indentation.length > column - 1) {\n\t\t\tindentation = indentation.substring(0, column - 1);\n\t\t}\n\t\treturn indentation;\n\t}\n\n\tprivate getScopedLineTokens(model: ITextModel, lineNumber: number, columnNumber?: number): ScopedLineTokens {\n\t\tmodel.forceTokenization(lineNumber);\n\t\tconst lineTokens = model.getLineTokens(lineNumber);\n\t\tconst column = (typeof columnNumber === 'undefined' ? model.getLineMaxColumn(lineNumber) - 1 : columnNumber - 1);\n\t\treturn createScopedLineTokens(lineTokens, column);\n\t}\n}\n\n/**\n * @deprecated Use ILanguageConfigurationService instead.\n*/\nexport const LanguageConfigurationRegistry = new LanguageConfigurationRegistryImpl();\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 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\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\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\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(): string {\n\t\treturn this.characterPair.getAutoCloseBeforeSet();\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\tcomments.lineCommentToken = commentRule.lineComment;\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);\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\n\nexport interface IShiftCommandOpts {\n\tisUnshift: boolean;\n\ttabSize: number;\n\tindentSize: number;\n\tinsertSpaces: boolean;\n\tuseTabStops: boolean;\n\tautoIndent: EditorAutoIndentStrategy;\n}\n\nconst repeatCache: { [str: string]: string[] } = Object.create(null);\nexport function cachedStringRepeat(str: string, count: number): string {\n\tif (count <= 0) {\n\t\treturn '';\n\t}\n\tif (!repeatCache[str]) {\n\t\trepeatCache[str] = ['', str];\n\t}\n\tconst cache = repeatCache[str];\n\tfor (let i = cache.length; i <= count; i++) {\n\t\tcache[i] = cache[i - 1] + str;\n\t}\n\treturn cache[count];\n}\n\nexport class ShiftCommand implements ICommand {\n\n\tpublic static unshiftIndent(line: string, column: number, tabSize: number, indentSize: number, insertSpaces: boolean): string {\n\t\t// Determine the visible column where the content starts\n\t\tconst contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(line, column, tabSize);\n\n\t\tif (insertSpaces) {\n\t\t\tconst indent = cachedStringRepeat(' ', indentSize);\n\t\t\tconst desiredTabStop = CursorColumns.prevIndentTabStop(contentStartVisibleColumn, indentSize);\n\t\t\tconst indentCount = desiredTabStop / indentSize; // will be an integer\n\t\t\treturn cachedStringRepeat(indent, indentCount);\n\t\t} else {\n\t\t\tconst indent = '\\t';\n\t\t\tconst desiredTabStop = CursorColumns.prevRenderTabStop(contentStartVisibleColumn, tabSize);\n\t\t\tconst indentCount = desiredTabStop / tabSize; // will be an integer\n\t\t\treturn cachedStringRepeat(indent, indentCount);\n\t\t}\n\t}\n\n\tpublic static shiftIndent(line: string, column: number, tabSize: number, indentSize: number, insertSpaces: boolean): string {\n\t\t// Determine the visible column where the content starts\n\t\tconst contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(line, column, tabSize);\n\n\t\tif (insertSpaces) {\n\t\t\tconst indent = cachedStringRepeat(' ', indentSize);\n\t\t\tconst desiredTabStop = CursorColumns.nextIndentTabStop(contentStartVisibleColumn, indentSize);\n\t\t\tconst indentCount = desiredTabStop / indentSize; // will be an integer\n\t\t\treturn cachedStringRepeat(indent, indentCount);\n\t\t} else {\n\t\t\tconst indent = '\\t';\n\t\t\tconst desiredTabStop = CursorColumns.nextRenderTabStop(contentStartVisibleColumn, tabSize);\n\t\t\tconst indentCount = desiredTabStop / tabSize; // will be an integer\n\t\t\treturn cachedStringRepeat(indent, indentCount);\n\t\t}\n\t}\n\n\tprivate readonly _opts: IShiftCommandOpts;\n\tprivate readonly _selection: Selection;\n\tprivate _selectionId: string | null;\n\tprivate _useLastEditRangeForCursorEndPosition: boolean;\n\tprivate _selectionStartColumnStaysPut: boolean;\n\n\tconstructor(range: Selection, opts: IShiftCommandOpts) {\n\t\tthis._opts = opts;\n\t\tthis._selection = range;\n\t\tthis._selectionId = null;\n\t\tthis._useLastEditRangeForCursorEndPosition = false;\n\t\tthis._selectionStartColumnStaysPut = false;\n\t}\n\n\tprivate _addEditOperation(builder: IEditOperationBuilder, range: Range, text: string) {\n\t\tif (this._useLastEditRangeForCursorEndPosition) {\n\t\t\tbuilder.addTrackedEditOperation(range, text);\n\t\t} else {\n\t\t\tbuilder.addEditOperation(range, text);\n\t\t}\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tconst startLine = this._selection.startLineNumber;\n\n\t\tlet endLine = this._selection.endLineNumber;\n\t\tif (this._selection.endColumn === 1 && startLine !== endLine) {\n\t\t\tendLine = endLine - 1;\n\t\t}\n\n\t\tconst { tabSize, indentSize, insertSpaces } = this._opts;\n\t\tconst shouldIndentEmptyLines = (startLine === endLine);\n\n\t\tif (this._opts.useTabStops) {\n\t\t\t// if indenting or outdenting on a whitespace only line\n\t\t\tif (this._selection.isEmpty()) {\n\t\t\t\tif (/^\\s*$/.test(model.getLineContent(startLine))) {\n\t\t\t\t\tthis._useLastEditRangeForCursorEndPosition = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// keep track of previous line's \"miss-alignment\"\n\t\t\tlet previousLineExtraSpaces = 0, extraSpaces = 0;\n\t\t\tfor (let lineNumber = startLine; lineNumber <= endLine; lineNumber++, previousLineExtraSpaces = extraSpaces) {\n\t\t\t\textraSpaces = 0;\n\t\t\t\tconst lineText = model.getLineContent(lineNumber);\n\t\t\t\tlet indentationEndIndex = strings.firstNonWhitespaceIndex(lineText);\n\n\t\t\t\tif (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) {\n\t\t\t\t\t// empty line or line with no leading whitespace => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) {\n\t\t\t\t\t// do not indent empty lines => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (indentationEndIndex === -1) {\n\t\t\t\t\t// the entire line is whitespace\n\t\t\t\t\tindentationEndIndex = lineText.length;\n\t\t\t\t}\n\n\t\t\t\tif (lineNumber > 1) {\n\t\t\t\t\tconst contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(lineText, indentationEndIndex + 1, tabSize);\n\t\t\t\t\tif (contentStartVisibleColumn % indentSize !== 0) {\n\t\t\t\t\t\t// The current line is \"miss-aligned\", so let's see if this is expected...\n\t\t\t\t\t\t// This can only happen when it has trailing commas in the indent\n\t\t\t\t\t\tif (model.isCheapToTokenize(lineNumber - 1)) {\n\t\t\t\t\t\t\tconst enterAction = LanguageConfigurationRegistry.getEnterAction(this._opts.autoIndent, model, new Range(lineNumber - 1, model.getLineMaxColumn(lineNumber - 1), lineNumber - 1, model.getLineMaxColumn(lineNumber - 1)));\n\t\t\t\t\t\t\tif (enterAction) {\n\t\t\t\t\t\t\t\textraSpaces = previousLineExtraSpaces;\n\t\t\t\t\t\t\t\tif (enterAction.appendText) {\n\t\t\t\t\t\t\t\t\tfor (let j = 0, lenJ = enterAction.appendText.length; j < lenJ && extraSpaces < indentSize; j++) {\n\t\t\t\t\t\t\t\t\t\tif (enterAction.appendText.charCodeAt(j) === CharCode.Space) {\n\t\t\t\t\t\t\t\t\t\t\textraSpaces++;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (enterAction.removeText) {\n\t\t\t\t\t\t\t\t\textraSpaces = Math.max(0, extraSpaces - enterAction.removeText);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Act as if `prefixSpaces` is not part of the indentation\n\t\t\t\t\t\t\t\tfor (let j = 0; j < extraSpaces; j++) {\n\t\t\t\t\t\t\t\t\tif (indentationEndIndex === 0 || lineText.charCodeAt(indentationEndIndex - 1) !== CharCode.Space) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tindentationEndIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tif (this._opts.isUnshift && indentationEndIndex === 0) {\n\t\t\t\t\t// line with no leading whitespace => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet desiredIndent: string;\n\t\t\t\tif (this._opts.isUnshift) {\n\t\t\t\t\tdesiredIndent = ShiftCommand.unshiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces);\n\t\t\t\t} else {\n\t\t\t\t\tdesiredIndent = ShiftCommand.shiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces);\n\t\t\t\t}\n\n\t\t\t\tthis._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), desiredIndent);\n\t\t\t\tif (lineNumber === startLine && !this._selection.isEmpty()) {\n\t\t\t\t\t// Force the startColumn to stay put because we're inserting after it\n\t\t\t\t\tthis._selectionStartColumnStaysPut = (this._selection.startColumn <= indentationEndIndex + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t\t// if indenting or outdenting on a whitespace only line\n\t\t\tif (!this._opts.isUnshift && this._selection.isEmpty() && model.getLineLength(startLine) === 0) {\n\t\t\t\tthis._useLastEditRangeForCursorEndPosition = true;\n\t\t\t}\n\n\t\t\tconst oneIndent = (insertSpaces ? cachedStringRepeat(' ', indentSize) : '\\t');\n\n\t\t\tfor (let lineNumber = startLine; lineNumber <= endLine; lineNumber++) {\n\t\t\t\tconst lineText = model.getLineContent(lineNumber);\n\t\t\t\tlet indentationEndIndex = strings.firstNonWhitespaceIndex(lineText);\n\n\t\t\t\tif (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) {\n\t\t\t\t\t// empty line or line with no leading whitespace => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) {\n\t\t\t\t\t// do not indent empty lines => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (indentationEndIndex === -1) {\n\t\t\t\t\t// the entire line is whitespace\n\t\t\t\t\tindentationEndIndex = lineText.length;\n\t\t\t\t}\n\n\t\t\t\tif (this._opts.isUnshift && indentationEndIndex === 0) {\n\t\t\t\t\t// line with no leading whitespace => nothing to do\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this._opts.isUnshift) {\n\n\t\t\t\t\tindentationEndIndex = Math.min(indentationEndIndex, indentSize);\n\t\t\t\t\tfor (let i = 0; i < indentationEndIndex; i++) {\n\t\t\t\t\t\tconst chr = lineText.charCodeAt(i);\n\t\t\t\t\t\tif (chr === CharCode.Tab) {\n\t\t\t\t\t\t\tindentationEndIndex = i + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), '');\n\t\t\t\t} else {\n\t\t\t\t\tthis._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, 1), oneIndent);\n\t\t\t\t\tif (lineNumber === startLine && !this._selection.isEmpty()) {\n\t\t\t\t\t\t// Force the startColumn to stay put because we're inserting after it\n\t\t\t\t\t\tthis._selectionStartColumnStaysPut = (this._selection.startColumn === 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._selectionId = builder.trackSelection(this._selection);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tif (this._useLastEditRangeForCursorEndPosition) {\n\t\t\tconst lastOp = helper.getInverseEditOperations()[0];\n\t\t\treturn new Selection(lastOp.range.endLineNumber, lastOp.range.endColumn, lastOp.range.endLineNumber, lastOp.range.endColumn);\n\t\t}\n\t\tconst result = helper.getTrackedSelection(this._selectionId!);\n\n\t\tif (this._selectionStartColumnStaysPut) {\n\t\t\t// The selection start should not move\n\t\t\tconst initialStartColumn = this._selection.startColumn;\n\t\t\tconst resultStartColumn = result.startColumn;\n\t\t\tif (resultStartColumn <= initialStartColumn) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tif (result.getDirection() === SelectionDirection.LTR) {\n\t\t\t\treturn new Selection(result.startLineNumber, initialStartColumn, result.endLineNumber, result.endColumn);\n\t\t\t}\n\t\t\treturn new Selection(result.endLineNumber, result.endColumn, result.startLineNumber, initialStartColumn);\n\t\t}\n\n\t\treturn result;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport * as strings from 'vs/base/common/strings';\nimport { ReplaceCommand, ReplaceCommandWithOffsetCursorState, ReplaceCommandWithoutChangingPosition, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand';\nimport { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';\nimport { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/cursorCommon';\nimport { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ICommand, ICursorStateComputerData } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { EnterAction, IndentAction, StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { IElectricAction } from 'vs/editor/common/languages/supports/electricCharacter';\nimport { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\nimport { createScopedLineTokens } from 'vs/editor/common/languages/supports';\n\nexport class TypeOperations {\n\n\tpublic static indent(config: CursorConfiguration, model: ICursorSimpleModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: false,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t});\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: true,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t});\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static shiftIndent(config: CursorConfiguration, indentation: string, count?: number): string {\n\t\tcount = count || 1;\n\t\treturn ShiftCommand.shiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces);\n\t}\n\n\tpublic static unshiftIndent(config: CursorConfiguration, indentation: string, count?: number): string {\n\t\tcount = count || 1;\n\t\treturn ShiftCommand.unshiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces);\n\t}\n\n\tprivate static _distributedPaste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string[]): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ReplaceCommand(selections[i], text[i]);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: true\n\t\t});\n\t}\n\n\tprivate static _simplePaste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tconst position = selection.getPosition();\n\n\t\t\tif (pasteOnNewLine && !selection.isEmpty()) {\n\t\t\t\tpasteOnNewLine = false;\n\t\t\t}\n\t\t\tif (pasteOnNewLine && text.indexOf('\\n') !== text.length - 1) {\n\t\t\t\tpasteOnNewLine = false;\n\t\t\t}\n\n\t\t\tif (pasteOnNewLine) {\n\t\t\t\t// Paste entire line at the beginning of line\n\t\t\t\tconst typeSelection = new Range(position.lineNumber, 1, position.lineNumber, 1);\n\t\t\t\tcommands[i] = new ReplaceCommandThatPreservesSelection(typeSelection, text, selection, true);\n\t\t\t} else {\n\t\t\t\tcommands[i] = new ReplaceCommand(selection, text);\n\t\t\t}\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: true\n\t\t});\n\t}\n\n\tprivate static _distributePasteToCursors(config: CursorConfiguration, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[]): string[] | null {\n\t\tif (pasteOnNewLine) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (selections.length === 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (multicursorText && multicursorText.length === selections.length) {\n\t\t\treturn multicursorText;\n\t\t}\n\n\t\tif (config.multiCursorPaste === 'spread') {\n\t\t\t// Try to spread the pasted text in case the line count matches the cursor count\n\t\t\t// Remove trailing \\n if present\n\t\t\tif (text.charCodeAt(text.length - 1) === CharCode.LineFeed) {\n\t\t\t\ttext = text.substr(0, text.length - 1);\n\t\t\t}\n\t\t\t// Remove trailing \\r if present\n\t\t\tif (text.charCodeAt(text.length - 1) === CharCode.CarriageReturn) {\n\t\t\t\ttext = text.substr(0, text.length - 1);\n\t\t\t}\n\t\t\tconst lines = strings.splitLines(text);\n\t\t\tif (lines.length === selections.length) {\n\t\t\t\treturn lines;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[]): EditOperationResult {\n\t\tconst distributedPaste = this._distributePasteToCursors(config, selections, text, pasteOnNewLine, multicursorText);\n\n\t\tif (distributedPaste) {\n\t\t\tselections = selections.sort(Range.compareRangesUsingStarts);\n\t\t\treturn this._distributedPaste(config, model, selections, distributedPaste);\n\t\t} else {\n\t\t\treturn this._simplePaste(config, model, selections, text, pasteOnNewLine);\n\t\t}\n\t}\n\n\tprivate static _goodIndentForLine(config: CursorConfiguration, model: ITextModel, lineNumber: number): string | null {\n\t\tlet action: IndentAction | EnterAction | null = null;\n\t\tlet indentation: string = '';\n\n\t\tconst expectedIndentAction = LanguageConfigurationRegistry.getInheritIndentForLine(config.autoIndent, model, lineNumber, false);\n\t\tif (expectedIndentAction) {\n\t\t\taction = expectedIndentAction.action;\n\t\t\tindentation = expectedIndentAction.indentation;\n\t\t} else if (lineNumber > 1) {\n\t\t\tlet lastLineNumber: number;\n\t\t\tfor (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\n\t\t\t\tconst lineText = model.getLineContent(lastLineNumber);\n\t\t\t\tconst nonWhitespaceIdx = strings.lastNonWhitespaceIndex(lineText);\n\t\t\t\tif (nonWhitespaceIdx >= 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastLineNumber < 1) {\n\t\t\t\t// No previous line with content found\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst maxColumn = model.getLineMaxColumn(lastLineNumber);\n\t\t\tconst expectedEnterAction = LanguageConfigurationRegistry.getEnterAction(config.autoIndent, model, new Range(lastLineNumber, maxColumn, lastLineNumber, maxColumn));\n\t\t\tif (expectedEnterAction) {\n\t\t\t\tindentation = expectedEnterAction.indentation + expectedEnterAction.appendText;\n\t\t\t}\n\t\t}\n\n\t\tif (action) {\n\t\t\tif (action === IndentAction.Indent) {\n\t\t\t\tindentation = TypeOperations.shiftIndent(config, indentation);\n\t\t\t}\n\n\t\t\tif (action === IndentAction.Outdent) {\n\t\t\t\tindentation = TypeOperations.unshiftIndent(config, indentation);\n\t\t\t}\n\n\t\t\tindentation = config.normalizeIndentation(indentation);\n\t\t}\n\n\t\tif (!indentation) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn indentation;\n\t}\n\n\tprivate static _replaceJumpToNextIndent(config: CursorConfiguration, model: ICursorSimpleModel, selection: Selection, insertsAutoWhitespace: boolean): ReplaceCommand {\n\t\tlet typeText = '';\n\n\t\tconst position = selection.getStartPosition();\n\t\tif (config.insertSpaces) {\n\t\t\tconst visibleColumnFromColumn = config.visibleColumnFromColumn(model, position);\n\t\t\tconst indentSize = config.indentSize;\n\t\t\tconst spacesCnt = indentSize - (visibleColumnFromColumn % indentSize);\n\t\t\tfor (let i = 0; i < spacesCnt; i++) {\n\t\t\t\ttypeText += ' ';\n\t\t\t}\n\t\t} else {\n\t\t\ttypeText = '\\t';\n\t\t}\n\n\t\treturn new ReplaceCommand(selection, typeText, insertsAutoWhitespace);\n\t}\n\n\tpublic static tab(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tif (selection.isEmpty()) {\n\n\t\t\t\tconst lineText = model.getLineContent(selection.startLineNumber);\n\n\t\t\t\tif (/^\\s*$/.test(lineText) && model.isCheapToTokenize(selection.startLineNumber)) {\n\t\t\t\t\tlet goodIndent = this._goodIndentForLine(config, model, selection.startLineNumber);\n\t\t\t\t\tgoodIndent = goodIndent || '\\t';\n\t\t\t\t\tconst possibleTypeText = config.normalizeIndentation(goodIndent);\n\t\t\t\t\tif (!lineText.startsWith(possibleTypeText)) {\n\t\t\t\t\t\tcommands[i] = new ReplaceCommand(new Range(selection.startLineNumber, 1, selection.startLineNumber, lineText.length + 1), possibleTypeText, true);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcommands[i] = this._replaceJumpToNextIndent(config, model, selection, true);\n\t\t\t} else {\n\t\t\t\tif (selection.startLineNumber === selection.endLineNumber) {\n\t\t\t\t\tconst lineMaxColumn = model.getLineMaxColumn(selection.startLineNumber);\n\t\t\t\t\tif (selection.startColumn !== 1 || selection.endColumn !== lineMaxColumn) {\n\t\t\t\t\t\t// This is a single line selection that is not the entire line\n\t\t\t\t\t\tcommands[i] = this._replaceJumpToNextIndent(config, model, selection, false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcommands[i] = new ShiftCommand(selection, {\n\t\t\t\t\tisUnshift: false,\n\t\t\t\t\ttabSize: config.tabSize,\n\t\t\t\t\tindentSize: config.indentSize,\n\t\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\t\tautoIndent: config.autoIndent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static compositionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): EditOperationResult {\n\t\tconst commands = selections.map(selection => this._compositionType(model, selection, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta));\n\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\tshouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, EditOperationType.TypingOther),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tprivate static _compositionType(model: ITextModel, selection: Selection, text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): ICommand | null {\n\t\tif (!selection.isEmpty()) {\n\t\t\t// looks like https://github.com/microsoft/vscode/issues/2773\n\t\t\t// where a cursor operation occurred before a canceled composition\n\t\t\t// => ignore composition\n\t\t\treturn null;\n\t\t}\n\t\tconst pos = selection.getPosition();\n\t\tconst startColumn = Math.max(1, pos.column - replacePrevCharCnt);\n\t\tconst endColumn = Math.min(model.getLineMaxColumn(pos.lineNumber), pos.column + replaceNextCharCnt);\n\t\tconst range = new Range(pos.lineNumber, startColumn, pos.lineNumber, endColumn);\n\t\tconst oldText = model.getValueInRange(range);\n\t\tif (oldText === text && positionDelta === 0) {\n\t\t\t// => ignore composition that doesn't do anything\n\t\t\treturn null;\n\t\t}\n\t\treturn new ReplaceCommandWithOffsetCursorState(range, text, 0, positionDelta);\n\t}\n\n\tprivate static _typeCommand(range: Range, text: string, keepPosition: boolean): ICommand {\n\t\tif (keepPosition) {\n\t\t\treturn new ReplaceCommandWithoutChangingPosition(range, text, true);\n\t\t} else {\n\t\t\treturn new ReplaceCommand(range, text, true);\n\t\t}\n\t}\n\n\tprivate static _enter(config: CursorConfiguration, model: ITextModel, keepPosition: boolean, range: Range): ICommand {\n\t\tif (config.autoIndent === EditorAutoIndentStrategy.None) {\n\t\t\treturn TypeOperations._typeCommand(range, '\\n', keepPosition);\n\t\t}\n\t\tif (!model.isCheapToTokenize(range.getStartPosition().lineNumber) || config.autoIndent === EditorAutoIndentStrategy.Keep) {\n\t\t\tconst lineText = model.getLineContent(range.startLineNumber);\n\t\t\tconst indentation = strings.getLeadingWhitespace(lineText).substring(0, range.startColumn - 1);\n\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(indentation), keepPosition);\n\t\t}\n\n\t\tconst r = LanguageConfigurationRegistry.getEnterAction(config.autoIndent, model, range);\n\t\tif (r) {\n\t\t\tif (r.indentAction === IndentAction.None) {\n\t\t\t\t// Nothing special\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition);\n\n\t\t\t} else if (r.indentAction === IndentAction.Indent) {\n\t\t\t\t// Indent once\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition);\n\n\t\t\t} else if (r.indentAction === IndentAction.IndentOutdent) {\n\t\t\t\t// Ultra special\n\t\t\t\tconst normalIndent = config.normalizeIndentation(r.indentation);\n\t\t\t\tconst increasedIndent = config.normalizeIndentation(r.indentation + r.appendText);\n\n\t\t\t\tconst typeText = '\\n' + increasedIndent + '\\n' + normalIndent;\n\n\t\t\t\tif (keepPosition) {\n\t\t\t\t\treturn new ReplaceCommandWithoutChangingPosition(range, typeText, true);\n\t\t\t\t} else {\n\t\t\t\t\treturn new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length, true);\n\t\t\t\t}\n\t\t\t} else if (r.indentAction === IndentAction.Outdent) {\n\t\t\t\tconst actualIndentation = TypeOperations.unshiftIndent(config, r.indentation);\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(actualIndentation + r.appendText), keepPosition);\n\t\t\t}\n\t\t}\n\n\t\tconst lineText = model.getLineContent(range.startLineNumber);\n\t\tconst indentation = strings.getLeadingWhitespace(lineText).substring(0, range.startColumn - 1);\n\n\t\tif (config.autoIndent >= EditorAutoIndentStrategy.Full) {\n\t\t\tconst ir = LanguageConfigurationRegistry.getIndentForEnter(config.autoIndent, model, range, {\n\t\t\t\tunshiftIndent: (indent) => {\n\t\t\t\t\treturn TypeOperations.unshiftIndent(config, indent);\n\t\t\t\t},\n\t\t\t\tshiftIndent: (indent) => {\n\t\t\t\t\treturn TypeOperations.shiftIndent(config, indent);\n\t\t\t\t},\n\t\t\t\tnormalizeIndentation: (indent) => {\n\t\t\t\t\treturn config.normalizeIndentation(indent);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (ir) {\n\t\t\t\tlet oldEndViewColumn = config.visibleColumnFromColumn(model, range.getEndPosition());\n\t\t\t\tconst oldEndColumn = range.endColumn;\n\t\t\t\tconst newLineContent = model.getLineContent(range.endLineNumber);\n\t\t\t\tconst firstNonWhitespace = strings.firstNonWhitespaceIndex(newLineContent);\n\t\t\t\tif (firstNonWhitespace >= 0) {\n\t\t\t\t\trange = range.setEndPosition(range.endLineNumber, Math.max(range.endColumn, firstNonWhitespace + 1));\n\t\t\t\t} else {\n\t\t\t\t\trange = range.setEndPosition(range.endLineNumber, model.getLineMaxColumn(range.endLineNumber));\n\t\t\t\t}\n\n\t\t\t\tif (keepPosition) {\n\t\t\t\t\treturn new ReplaceCommandWithoutChangingPosition(range, '\\n' + config.normalizeIndentation(ir.afterEnter), true);\n\t\t\t\t} else {\n\t\t\t\t\tlet offset = 0;\n\t\t\t\t\tif (oldEndColumn <= firstNonWhitespace + 1) {\n\t\t\t\t\t\tif (!config.insertSpaces) {\n\t\t\t\t\t\t\toldEndViewColumn = Math.ceil(oldEndViewColumn / config.indentSize);\n\t\t\t\t\t\t}\n\t\t\t\t\t\toffset = Math.min(oldEndViewColumn + 1 - config.normalizeIndentation(ir.afterEnter).length - 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\treturn new ReplaceCommandWithOffsetCursorState(range, '\\n' + config.normalizeIndentation(ir.afterEnter), 0, offset, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(indentation), keepPosition);\n\t}\n\n\tprivate static _isAutoIndentType(config: CursorConfiguration, model: ITextModel, selections: Selection[]): boolean {\n\t\tif (config.autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tif (!model.isCheapToTokenize(selections[i].getEndPosition().lineNumber)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate static _runAutoIndentType(config: CursorConfiguration, model: ITextModel, range: Range, ch: string): ICommand | null {\n\t\tconst currentIndentation = LanguageConfigurationRegistry.getIndentationAtPosition(model, range.startLineNumber, range.startColumn);\n\t\tconst actualIndentation = LanguageConfigurationRegistry.getIndentActionForType(config.autoIndent, model, range, ch, {\n\t\t\tshiftIndent: (indentation) => {\n\t\t\t\treturn TypeOperations.shiftIndent(config, indentation);\n\t\t\t},\n\t\t\tunshiftIndent: (indentation) => {\n\t\t\t\treturn TypeOperations.unshiftIndent(config, indentation);\n\t\t\t},\n\t\t});\n\n\t\tif (actualIndentation === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (actualIndentation !== config.normalizeIndentation(currentIndentation)) {\n\t\t\tconst firstNonWhitespace = model.getLineFirstNonWhitespaceColumn(range.startLineNumber);\n\t\t\tif (firstNonWhitespace === 0) {\n\t\t\t\treturn TypeOperations._typeCommand(\n\t\t\t\t\tnew Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn),\n\t\t\t\t\tconfig.normalizeIndentation(actualIndentation) + ch,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn TypeOperations._typeCommand(\n\t\t\t\t\tnew Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn),\n\t\t\t\t\tconfig.normalizeIndentation(actualIndentation) +\n\t\t\t\t\tmodel.getLineContent(range.startLineNumber).substring(firstNonWhitespace - 1, range.startColumn - 1) + ch,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _isAutoClosingOvertype(config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): boolean {\n\t\tif (config.autoClosingOvertype === 'never') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!config.autoClosingPairs.autoClosingPairsCloseSingleChar.has(ch)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst position = selection.getPosition();\n\t\t\tconst lineText = model.getLineContent(position.lineNumber);\n\t\t\tconst afterCharacter = lineText.charAt(position.column - 1);\n\n\t\t\tif (afterCharacter !== ch) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Do not over-type quotes after a backslash\n\t\t\tconst chIsQuote = isQuote(ch);\n\t\t\tconst beforeCharacter = position.column > 2 ? lineText.charCodeAt(position.column - 2) : CharCode.Null;\n\t\t\tif (beforeCharacter === CharCode.Backslash && chIsQuote) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Must over-type a closing character typed by the editor\n\t\t\tif (config.autoClosingOvertype === 'auto') {\n\t\t\t\tlet found = false;\n\t\t\t\tfor (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) {\n\t\t\t\t\tconst autoClosedCharacter = autoClosedCharacters[j];\n\t\t\t\t\tif (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate static _runAutoClosingOvertype(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tconst position = selection.getPosition();\n\t\t\tconst typeSelection = new Range(position.lineNumber, position.column, position.lineNumber, position.column + 1);\n\t\t\tcommands[i] = new ReplaceCommand(typeSelection, ch);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\tshouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, EditOperationType.TypingOther),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tprivate static _isBeforeClosingBrace(config: CursorConfiguration, lineAfter: string) {\n\t\t// If the start of lineAfter can be interpretted as both a starting or ending brace, default to returning false\n\t\tconst nextChar = lineAfter.charAt(0);\n\t\tconst potentialStartingBraces = config.autoClosingPairs.autoClosingPairsOpenByStart.get(nextChar) || [];\n\t\tconst potentialClosingBraces = config.autoClosingPairs.autoClosingPairsCloseByStart.get(nextChar) || [];\n\n\t\tconst isBeforeStartingBrace = potentialStartingBraces.some(x => lineAfter.startsWith(x.open));\n\t\tconst isBeforeClosingBrace = potentialClosingBraces.some(x => lineAfter.startsWith(x.close));\n\n\t\treturn !isBeforeStartingBrace && isBeforeClosingBrace;\n\t}\n\n\t/**\n\t * Determine if typing `ch` at all `positions` in the `model` results in an\n\t * auto closing open sequence being typed.\n\t *\n\t * Auto closing open sequences can consist of multiple characters, which\n\t * can lead to ambiguities. In such a case, the longest auto-closing open\n\t * sequence is returned.\n\t */\n\tprivate static _findAutoClosingPairOpen(config: CursorConfiguration, model: ITextModel, positions: Position[], ch: string): StandardAutoClosingPairConditional | null {\n\t\tconst candidates = config.autoClosingPairs.autoClosingPairsOpenByEnd.get(ch);\n\t\tif (!candidates) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Determine which auto-closing pair it is\n\t\tlet result: StandardAutoClosingPairConditional | null = null;\n\t\tfor (const candidate of candidates) {\n\t\t\tif (result === null || candidate.open.length > result.open.length) {\n\t\t\t\tlet candidateIsMatch = true;\n\t\t\t\tfor (const position of positions) {\n\t\t\t\t\tconst relevantText = model.getValueInRange(new Range(position.lineNumber, position.column - candidate.open.length + 1, position.lineNumber, position.column));\n\t\t\t\t\tif (relevantText + ch !== candidate.open) {\n\t\t\t\t\t\tcandidateIsMatch = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (candidateIsMatch) {\n\t\t\t\t\tresult = candidate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Find another auto-closing pair that is contained by the one passed in.\n\t *\n\t * e.g. when having [(,)] and [(*,*)] as auto-closing pairs\n\t * this method will find [(,)] as a containment pair for [(*,*)]\n\t */\n\tprivate static _findContainedAutoClosingPair(config: CursorConfiguration, pair: StandardAutoClosingPairConditional): StandardAutoClosingPairConditional | null {\n\t\tif (pair.open.length <= 1) {\n\t\t\treturn null;\n\t\t}\n\t\tconst lastChar = pair.close.charAt(pair.close.length - 1);\n\t\t// get candidates with the same last character as close\n\t\tconst candidates = config.autoClosingPairs.autoClosingPairsCloseByEnd.get(lastChar) || [];\n\t\tlet result: StandardAutoClosingPairConditional | null = null;\n\t\tfor (const candidate of candidates) {\n\t\t\tif (candidate.open !== pair.open && pair.open.includes(candidate.open) && pair.close.endsWith(candidate.close)) {\n\t\t\t\tif (!result || candidate.open.length > result.open.length) {\n\t\t\t\t\tresult = candidate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _getAutoClosingPairClose(config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string, chIsAlreadyTyped: boolean): string | null {\n\t\tconst chIsQuote = isQuote(ch);\n\t\tconst autoCloseConfig = (chIsQuote ? config.autoClosingQuotes : config.autoClosingBrackets);\n\t\tconst shouldAutoCloseBefore = (chIsQuote ? config.shouldAutoCloseBefore.quote : config.shouldAutoCloseBefore.bracket);\n\n\t\tif (autoCloseConfig === 'never') {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (const selection of selections) {\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t// This method is called both when typing (regularly) and when composition ends\n\t\t// This means that we need to work with a text buffer where sometimes `ch` is not\n\t\t// there (it is being typed right now) or with a text buffer where `ch` has already been typed\n\t\t//\n\t\t// In order to avoid adding checks for `chIsAlreadyTyped` in all places, we will work\n\t\t// with two conceptual positions, the position before `ch` and the position after `ch`\n\t\t//\n\t\tconst positions: { lineNumber: number; beforeColumn: number; afterColumn: number }[] = selections.map((s) => {\n\t\t\tconst position = s.getPosition();\n\t\t\tif (chIsAlreadyTyped) {\n\t\t\t\treturn { lineNumber: position.lineNumber, beforeColumn: position.column - ch.length, afterColumn: position.column };\n\t\t\t} else {\n\t\t\t\treturn { lineNumber: position.lineNumber, beforeColumn: position.column, afterColumn: position.column };\n\t\t\t}\n\t\t});\n\n\n\t\t// Find the longest auto-closing open pair in case of multiple ending in `ch`\n\t\t// e.g. when having [f\",\"] and [\",\"], it picks [f\",\"] if the character before is f\n\t\tconst pair = this._findAutoClosingPairOpen(config, model, positions.map(p => new Position(p.lineNumber, p.beforeColumn)), ch);\n\t\tif (!pair) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Sometimes, it is possible to have two auto-closing pairs that have a containment relationship\n\t\t// e.g. when having [(,)] and [(*,*)]\n\t\t// - when typing (, the resulting state is (|)\n\t\t// - when typing *, the desired resulting state is (*|*), not (*|*))\n\t\tconst containedPair = this._findContainedAutoClosingPair(config, pair);\n\t\tconst containedPairClose = containedPair ? containedPair.close : '';\n\t\tlet isContainedPairPresent = true;\n\n\t\tfor (const position of positions) {\n\t\t\tconst { lineNumber, beforeColumn, afterColumn } = position;\n\t\t\tconst lineText = model.getLineContent(lineNumber);\n\t\t\tconst lineBefore = lineText.substring(0, beforeColumn - 1);\n\t\t\tconst lineAfter = lineText.substring(afterColumn - 1);\n\n\t\t\tif (!lineAfter.startsWith(containedPairClose)) {\n\t\t\t\tisContainedPairPresent = false;\n\t\t\t}\n\n\t\t\t// Only consider auto closing the pair if an allowed character follows or if another autoclosed pair closing brace follows\n\t\t\tif (lineAfter.length > 0) {\n\t\t\t\tconst characterAfter = lineAfter.charAt(0);\n\t\t\t\tconst isBeforeCloseBrace = TypeOperations._isBeforeClosingBrace(config, lineAfter);\n\n\t\t\t\tif (!isBeforeCloseBrace && !shouldAutoCloseBefore(characterAfter)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Do not auto-close ' or \" after a word character\n\t\t\tif (pair.open.length === 1 && (ch === '\\'' || ch === '\"') && autoCloseConfig !== 'always') {\n\t\t\t\tconst wordSeparators = getMapForWordSeparators(config.wordSeparators);\n\t\t\t\tif (lineBefore.length > 0) {\n\t\t\t\t\tconst characterBefore = lineBefore.charCodeAt(lineBefore.length - 1);\n\t\t\t\t\tif (wordSeparators.get(characterBefore) === WordCharacterClass.Regular) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!model.isCheapToTokenize(lineNumber)) {\n\t\t\t\t// Do not force tokenization\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tmodel.forceTokenization(lineNumber);\n\t\t\tconst lineTokens = model.getLineTokens(lineNumber);\n\t\t\tconst scopedLineTokens = createScopedLineTokens(lineTokens, beforeColumn - 1);\n\t\t\tif (!pair.shouldAutoClose(scopedLineTokens, beforeColumn - scopedLineTokens.firstCharOffset)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Typing for example a quote could either start a new string, in which case auto-closing is desirable\n\t\t\t// or it could end a previously started string, in which case auto-closing is not desirable\n\t\t\t//\n\t\t\t// In certain cases, it is really not possible to look at the previous token to determine\n\t\t\t// what would happen. That's why we do something really unusual, we pretend to type a different\n\t\t\t// character and ask the tokenizer what the outcome of doing that is: after typing a neutral\n\t\t\t// character, are we in a string (i.e. the quote would most likely end a string) or not?\n\t\t\t//\n\t\t\tconst neutralCharacter = pair.findNeutralCharacter();\n\t\t\tif (neutralCharacter) {\n\t\t\t\tconst tokenType = model.getTokenTypeIfInsertingCharacter(lineNumber, beforeColumn, neutralCharacter);\n\t\t\t\tif (!pair.isOK(tokenType)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isContainedPairPresent) {\n\t\t\treturn pair.close.substring(0, pair.close.length - containedPairClose.length);\n\t\t} else {\n\t\t\treturn pair.close;\n\t\t}\n\t}\n\n\tprivate static _runAutoClosingOpenCharType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string, chIsAlreadyTyped: boolean, autoClosingPairClose: string): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tcommands[i] = new TypeWithAutoClosingCommand(selection, ch, !chIsAlreadyTyped, autoClosingPairClose);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tprivate static _shouldSurroundChar(config: CursorConfiguration, ch: string): boolean {\n\t\tif (isQuote(ch)) {\n\t\t\treturn (config.autoSurround === 'quotes' || config.autoSurround === 'languageDefined');\n\t\t} else {\n\t\t\t// Character is a bracket\n\t\t\treturn (config.autoSurround === 'brackets' || config.autoSurround === 'languageDefined');\n\t\t}\n\t}\n\n\tprivate static _isSurroundSelectionType(config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): boolean {\n\t\tif (!TypeOperations._shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isTypingAQuoteCharacter = isQuote(ch);\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet selectionContainsOnlyWhitespace = true;\n\n\t\t\tfor (let lineNumber = selection.startLineNumber; lineNumber <= selection.endLineNumber; lineNumber++) {\n\t\t\t\tconst lineText = model.getLineContent(lineNumber);\n\t\t\t\tconst startIndex = (lineNumber === selection.startLineNumber ? selection.startColumn - 1 : 0);\n\t\t\t\tconst endIndex = (lineNumber === selection.endLineNumber ? selection.endColumn - 1 : lineText.length);\n\t\t\t\tconst selectedText = lineText.substring(startIndex, endIndex);\n\t\t\t\tif (/[^ \\t]/.test(selectedText)) {\n\t\t\t\t\t// this selected text contains something other than whitespace\n\t\t\t\t\tselectionContainsOnlyWhitespace = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (selectionContainsOnlyWhitespace) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (isTypingAQuoteCharacter && selection.startLineNumber === selection.endLineNumber && selection.startColumn + 1 === selection.endColumn) {\n\t\t\t\tconst selectionText = model.getValueInRange(selection);\n\t\t\t\tif (isQuote(selectionText)) {\n\t\t\t\t\t// Typing a quote character on top of another quote character\n\t\t\t\t\t// => disable surround selection type\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate static _runSurroundSelectionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tconst closeCharacter = config.surroundingPairs[ch];\n\t\t\tcommands[i] = new SurroundSelectionCommand(selection, ch, closeCharacter);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: true\n\t\t});\n\t}\n\n\tprivate static _isTypeInterceptorElectricChar(config: CursorConfiguration, model: ITextModel, selections: Selection[]) {\n\t\tif (selections.length === 1 && model.isCheapToTokenize(selections[0].getEndPosition().lineNumber)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate static _typeInterceptorElectricChar(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selection: Selection, ch: string): EditOperationResult | null {\n\t\tif (!config.electricChars.hasOwnProperty(ch) || !selection.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst position = selection.getPosition();\n\t\tmodel.forceTokenization(position.lineNumber);\n\t\tconst lineTokens = model.getLineTokens(position.lineNumber);\n\n\t\tlet electricAction: IElectricAction | null;\n\t\ttry {\n\t\t\telectricAction = config.onElectricCharacter(ch, lineTokens, position.column);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!electricAction) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (electricAction.matchOpenBracket) {\n\t\t\tconst endColumn = (lineTokens.getLineContent() + ch).lastIndexOf(electricAction.matchOpenBracket) + 1;\n\t\t\tconst match = model.bracketPairs.findMatchingBracketUp(electricAction.matchOpenBracket, {\n\t\t\t\tlineNumber: position.lineNumber,\n\t\t\t\tcolumn: endColumn\n\t\t\t}, 500 /* give at most 500ms to compute */);\n\n\t\t\tif (match) {\n\t\t\t\tif (match.startLineNumber === position.lineNumber) {\n\t\t\t\t\t// matched something on the same line => no change in indentation\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst matchLine = model.getLineContent(match.startLineNumber);\n\t\t\t\tconst matchLineIndentation = strings.getLeadingWhitespace(matchLine);\n\t\t\t\tconst newIndentation = config.normalizeIndentation(matchLineIndentation);\n\n\t\t\t\tconst lineText = model.getLineContent(position.lineNumber);\n\t\t\t\tconst lineFirstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(position.lineNumber) || position.column;\n\n\t\t\t\tconst prefix = lineText.substring(lineFirstNonBlankColumn - 1, position.column - 1);\n\t\t\t\tconst typeText = newIndentation + prefix + ch;\n\n\t\t\t\tconst typeSelection = new Range(position.lineNumber, 1, position.lineNumber, position.column);\n\n\t\t\t\tconst command = new ReplaceCommand(typeSelection, typeText);\n\t\t\t\treturn new EditOperationResult(getTypingOperation(typeText, prevEditOperationType), [command], {\n\t\t\t\t\tshouldPushStackElementBefore: false,\n\t\t\t\t\tshouldPushStackElementAfter: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * This is very similar with typing, but the character is already in the text buffer!\n\t */\n\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selectionsWhenCompositionStarted: Selection[] | null, selections: Selection[], autoClosedCharacters: Range[]): EditOperationResult | null {\n\t\tif (!selectionsWhenCompositionStarted || Selection.selectionsArrEqual(selectionsWhenCompositionStarted, selections)) {\n\t\t\t// no content was typed\n\t\t\treturn null;\n\t\t}\n\n\t\tlet ch: string | null = null;\n\t\t// extract last typed character\n\t\tfor (const selection of selections) {\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst position = selection.getPosition();\n\t\t\tconst currentChar = model.getValueInRange(new Range(position.lineNumber, position.column - 1, position.lineNumber, position.column));\n\t\t\tif (ch === null) {\n\t\t\t\tch = currentChar;\n\t\t\t} else if (ch !== currentChar) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!ch) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) {\n\t\t\t// Unfortunately, the close character is at this point \"doubled\", so we need to delete it...\n\t\t\tconst commands = selections.map(s => new ReplaceCommand(new Range(s.positionLineNumber, s.positionColumn, s.positionLineNumber, s.positionColumn + 1), '', false));\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosingPairClose = this._getAutoClosingPairClose(config, model, selections, ch, true);\n\t\tif (autoClosingPairClose !== null) {\n\t\t\treturn this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, true, autoClosingPairClose);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static typeWithInterceptors(isDoingComposition: boolean, prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): EditOperationResult {\n\n\t\tif (!isDoingComposition && ch === '\\n') {\n\t\t\tconst commands: ICommand[] = [];\n\t\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\t\tcommands[i] = TypeOperations._enter(config, model, false, selections[i]);\n\t\t\t}\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false,\n\t\t\t});\n\t\t}\n\n\t\tif (!isDoingComposition && this._isAutoIndentType(config, model, selections)) {\n\t\t\tconst commands: Array<ICommand | null> = [];\n\t\t\tlet autoIndentFails = false;\n\t\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\t\tcommands[i] = this._runAutoIndentType(config, model, selections[i], ch);\n\t\t\t\tif (!commands[i]) {\n\t\t\t\t\tautoIndentFails = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!autoIndentFails) {\n\t\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\t\tshouldPushStackElementAfter: false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (!isDoingComposition && this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) {\n\t\t\treturn this._runAutoClosingOvertype(prevEditOperationType, config, model, selections, ch);\n\t\t}\n\n\t\tif (!isDoingComposition) {\n\t\t\tconst autoClosingPairClose = this._getAutoClosingPairClose(config, model, selections, ch, false);\n\t\t\tif (autoClosingPairClose) {\n\t\t\t\treturn this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, false, autoClosingPairClose);\n\t\t\t}\n\t\t}\n\n\t\tif (this._isSurroundSelectionType(config, model, selections, ch)) {\n\t\t\treturn this._runSurroundSelectionType(prevEditOperationType, config, model, selections, ch);\n\t\t}\n\n\t\t// Electric characters make sense only when dealing with a single cursor,\n\t\t// as multiple cursors typing brackets for example would interfer with bracket matching\n\t\tif (!isDoingComposition && this._isTypeInterceptorElectricChar(config, model, selections)) {\n\t\t\tconst r = this._typeInterceptorElectricChar(prevEditOperationType, config, model, selections[0], ch);\n\t\t\tif (r) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\t// A simple character type\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ReplaceCommand(selections[i], ch);\n\t\t}\n\n\t\tconst opType = getTypingOperation(ch, prevEditOperationType);\n\t\treturn new EditOperationResult(opType, commands, {\n\t\t\tshouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tpublic static typeWithoutInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], str: string): EditOperationResult {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ReplaceCommand(selections[i], str);\n\t\t}\n\t\tconst opType = getTypingOperation(str, prevEditOperationType);\n\t\treturn new EditOperationResult(opType, commands, {\n\t\t\tshouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tpublic static lineInsertBefore(config: CursorConfiguration, model: ITextModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tlet lineNumber = selections[i].positionLineNumber;\n\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tcommands[i] = new ReplaceCommandWithoutChangingPosition(new Range(1, 1, 1, 1), '\\n');\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t\tconst column = model.getLineMaxColumn(lineNumber);\n\n\t\t\t\tcommands[i] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column));\n\t\t\t}\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static lineInsertAfter(config: CursorConfiguration, model: ITextModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst lineNumber = selections[i].positionLineNumber;\n\t\t\tconst column = model.getLineMaxColumn(lineNumber);\n\t\t\tcommands[i] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column));\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static lineBreakInsert(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = this._enter(config, model, true, selections[i]);\n\t\t}\n\t\treturn commands;\n\t}\n}\n\nexport class TypeWithAutoClosingCommand extends ReplaceCommandWithOffsetCursorState {\n\n\tprivate readonly _openCharacter: string;\n\tprivate readonly _closeCharacter: string;\n\tpublic closeCharacterRange: Range | null;\n\tpublic enclosingRange: Range | null;\n\n\tconstructor(selection: Selection, openCharacter: string, insertOpenCharacter: boolean, closeCharacter: string) {\n\t\tsuper(selection, (insertOpenCharacter ? openCharacter : '') + closeCharacter, 0, -closeCharacter.length);\n\t\tthis._openCharacter = openCharacter;\n\t\tthis._closeCharacter = closeCharacter;\n\t\tthis.closeCharacterRange = null;\n\t\tthis.enclosingRange = null;\n\t}\n\n\tpublic override computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tconst inverseEditOperations = helper.getInverseEditOperations();\n\t\tconst range = inverseEditOperations[0].range;\n\t\tthis.closeCharacterRange = new Range(range.startLineNumber, range.endColumn - this._closeCharacter.length, range.endLineNumber, range.endColumn);\n\t\tthis.enclosingRange = new Range(range.startLineNumber, range.endColumn - this._openCharacter.length - this._closeCharacter.length, range.endLineNumber, range.endColumn);\n\t\treturn super.computeCursorState(model, helper);\n\t}\n}\n\nfunction getTypingOperation(typedText: string, previousTypingOperation: EditOperationType): EditOperationType {\n\tif (typedText === ' ') {\n\t\treturn previousTypingOperation === EditOperationType.TypingFirstSpace\n\t\t\t|| previousTypingOperation === EditOperationType.TypingConsecutiveSpace\n\t\t\t? EditOperationType.TypingConsecutiveSpace\n\t\t\t: EditOperationType.TypingFirstSpace;\n\t}\n\n\treturn EditOperationType.TypingOther;\n}\n\nfunction shouldPushStackElementBetween(previousTypingOperation: EditOperationType, typingOperation: EditOperationType): boolean {\n\tif (isTypingOperation(previousTypingOperation) && !isTypingOperation(typingOperation)) {\n\t\t// Always set an undo stop before non-type operations\n\t\treturn true;\n\t}\n\tif (previousTypingOperation === EditOperationType.TypingFirstSpace) {\n\t\t// `abc |d`: No undo stop\n\t\t// `abc |d`: Undo stop\n\t\treturn false;\n\t}\n\t// Insert undo stop between different operation types\n\treturn normalizeOperationType(previousTypingOperation) !== normalizeOperationType(typingOperation);\n}\n\nfunction normalizeOperationType(type: EditOperationType): EditOperationType | 'space' {\n\treturn (type === EditOperationType.TypingConsecutiveSpace || type === EditOperationType.TypingFirstSpace)\n\t\t? 'space'\n\t\t: type;\n}\n\nfunction isTypingOperation(type: EditOperationType): boolean {\n\treturn type === EditOperationType.TypingOther\n\t\t|| type === EditOperationType.TypingFirstSpace\n\t\t|| type === EditOperationType.TypingConsecutiveSpace;\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorCollection } from 'vs/editor/common/cursor/cursorCollection';\nimport { CursorConfiguration, CursorState, EditOperationResult, EditOperationType, IColumnSelectData, PartialCursorState, ICursorSimpleModel } from 'vs/editor/common/cursorCommon';\nimport { CursorContext } from 'vs/editor/common/cursor/cursorContext';\nimport { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { TypeOperations, TypeWithAutoClosingCommand } from 'vs/editor/common/cursor/cursorTypeOperations';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range, IRange } from 'vs/editor/common/core/range';\nimport { ISelection, Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ITextModel, TrackedRangeStickiness, IModelDeltaDecoration, ICursorStateComputer, IIdentifiedSingleEditOperation, IValidEditOperation } from 'vs/editor/common/model';\nimport { RawContentChangedType, ModelRawContentChangedEvent, ModelInjectedTextChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { VerticalRevealType, ViewCursorStateChangedEvent, ViewRevealRangeRequestEvent } from 'vs/editor/common/viewEvents';\nimport { dispose, Disposable } from 'vs/base/common/lifecycle';\nimport { ICoordinatesConverter } from 'vs/editor/common/viewModel';\nimport { CursorStateChangedEvent, ViewModelEventsCollector } from 'vs/editor/common/viewModelEventDispatcher';\n\nexport class CursorsController extends Disposable {\n\n\tpublic static readonly MAX_CURSOR_COUNT = 10000;\n\n\tprivate readonly _model: ITextModel;\n\tprivate _knownModelVersionId: number;\n\tprivate readonly _viewModel: ICursorSimpleModel;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\tpublic context: CursorContext;\n\tprivate _cursors: CursorCollection;\n\n\tprivate _hasFocus: boolean;\n\tprivate _isHandling: boolean;\n\tprivate _isDoingComposition: boolean;\n\tprivate _selectionsWhenCompositionStarted: Selection[] | null;\n\tprivate _columnSelectData: IColumnSelectData | null;\n\tprivate _autoClosedActions: AutoClosedAction[];\n\tprivate _prevEditOperationType: EditOperationType;\n\n\tconstructor(model: ITextModel, viewModel: ICursorSimpleModel, coordinatesConverter: ICoordinatesConverter, cursorConfig: CursorConfiguration) {\n\t\tsuper();\n\t\tthis._model = model;\n\t\tthis._knownModelVersionId = this._model.getVersionId();\n\t\tthis._viewModel = viewModel;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis.context = new CursorContext(this._model, this._viewModel, this._coordinatesConverter, cursorConfig);\n\t\tthis._cursors = new CursorCollection(this.context);\n\n\t\tthis._hasFocus = false;\n\t\tthis._isHandling = false;\n\t\tthis._isDoingComposition = false;\n\t\tthis._selectionsWhenCompositionStarted = null;\n\t\tthis._columnSelectData = null;\n\t\tthis._autoClosedActions = [];\n\t\tthis._prevEditOperationType = EditOperationType.Other;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._cursors.dispose();\n\t\tthis._autoClosedActions = dispose(this._autoClosedActions);\n\t\tsuper.dispose();\n\t}\n\n\tpublic updateConfiguration(cursorConfig: CursorConfiguration): void {\n\t\tthis.context = new CursorContext(this._model, this._viewModel, this._coordinatesConverter, cursorConfig);\n\t\tthis._cursors.updateContext(this.context);\n\t}\n\n\tpublic onLineMappingChanged(eventsCollector: ViewModelEventsCollector): void {\n\t\tif (this._knownModelVersionId !== this._model.getVersionId()) {\n\t\t\t// There are model change events that I didn't yet receive.\n\t\t\t//\n\t\t\t// This can happen when editing the model, and the view model receives the change events first,\n\t\t\t// and the view model emits line mapping changed events, all before the cursor gets a chance to\n\t\t\t// recover from markers.\n\t\t\t//\n\t\t\t// The model change listener above will be called soon and we'll ensure a valid cursor state there.\n\t\t\treturn;\n\t\t}\n\t\t// Ensure valid state\n\t\tthis.setStates(eventsCollector, 'viewModel', CursorChangeReason.NotSet, this.getCursorStates());\n\t}\n\n\tpublic setHasFocus(hasFocus: boolean): void {\n\t\tthis._hasFocus = hasFocus;\n\t}\n\n\tprivate _validateAutoClosedActions(): void {\n\t\tif (this._autoClosedActions.length > 0) {\n\t\t\tconst selections: Range[] = this._cursors.getSelections();\n\t\t\tfor (let i = 0; i < this._autoClosedActions.length; i++) {\n\t\t\t\tconst autoClosedAction = this._autoClosedActions[i];\n\t\t\t\tif (!autoClosedAction.isValid(selections)) {\n\t\t\t\t\tautoClosedAction.dispose();\n\t\t\t\t\tthis._autoClosedActions.splice(i, 1);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// ------ some getters/setters\n\n\tpublic getPrimaryCursorState(): CursorState {\n\t\treturn this._cursors.getPrimaryCursor();\n\t}\n\n\tpublic getLastAddedCursorIndex(): number {\n\t\treturn this._cursors.getLastAddedCursorIndex();\n\t}\n\n\tpublic getCursorStates(): CursorState[] {\n\t\treturn this._cursors.getAll();\n\t}\n\n\tpublic setStates(eventsCollector: ViewModelEventsCollector, source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean {\n\t\tlet reachedMaxCursorCount = false;\n\t\tif (states !== null && states.length > CursorsController.MAX_CURSOR_COUNT) {\n\t\t\tstates = states.slice(0, CursorsController.MAX_CURSOR_COUNT);\n\t\t\treachedMaxCursorCount = true;\n\t\t}\n\n\t\tconst oldState = CursorModelState.from(this._model, this);\n\n\t\tthis._cursors.setStates(states);\n\t\tthis._cursors.normalize();\n\t\tthis._columnSelectData = null;\n\n\t\tthis._validateAutoClosedActions();\n\n\t\treturn this._emitStateChangedIfNecessary(eventsCollector, source, reason, oldState, reachedMaxCursorCount);\n\t}\n\n\tpublic setCursorColumnSelectData(columnSelectData: IColumnSelectData): void {\n\t\tthis._columnSelectData = columnSelectData;\n\t}\n\n\tpublic revealPrimary(eventsCollector: ViewModelEventsCollector, source: string | null | undefined, minimalReveal: boolean, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void {\n\t\tconst viewPositions = this._cursors.getViewPositions();\n\n\t\tlet revealViewRange: Range | null = null;\n\t\tlet revealViewSelections: Selection[] | null = null;\n\t\tif (viewPositions.length > 1) {\n\t\t\trevealViewSelections = this._cursors.getViewSelections();\n\t\t} else {\n\t\t\trevealViewRange = Range.fromPositions(viewPositions[0], viewPositions[0]);\n\t\t}\n\n\t\teventsCollector.emitViewEvent(new ViewRevealRangeRequestEvent(source, minimalReveal, revealViewRange, revealViewSelections, verticalType, revealHorizontal, scrollType));\n\t}\n\n\tpublic saveState(): editorCommon.ICursorState[] {\n\n\t\tconst result: editorCommon.ICursorState[] = [];\n\n\t\tconst selections = this._cursors.getSelections();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\n\t\t\tresult.push({\n\t\t\t\tinSelectionMode: !selection.isEmpty(),\n\t\t\t\tselectionStart: {\n\t\t\t\t\tlineNumber: selection.selectionStartLineNumber,\n\t\t\t\t\tcolumn: selection.selectionStartColumn,\n\t\t\t\t},\n\t\t\t\tposition: {\n\t\t\t\t\tlineNumber: selection.positionLineNumber,\n\t\t\t\t\tcolumn: selection.positionColumn,\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic restoreState(eventsCollector: ViewModelEventsCollector, states: editorCommon.ICursorState[]): void {\n\n\t\tconst desiredSelections: ISelection[] = [];\n\n\t\tfor (let i = 0, len = states.length; i < len; i++) {\n\t\t\tconst state = states[i];\n\n\t\t\tlet positionLineNumber = 1;\n\t\t\tlet positionColumn = 1;\n\n\t\t\t// Avoid missing properties on the literal\n\t\t\tif (state.position && state.position.lineNumber) {\n\t\t\t\tpositionLineNumber = state.position.lineNumber;\n\t\t\t}\n\t\t\tif (state.position && state.position.column) {\n\t\t\t\tpositionColumn = state.position.column;\n\t\t\t}\n\n\t\t\tlet selectionStartLineNumber = positionLineNumber;\n\t\t\tlet selectionStartColumn = positionColumn;\n\n\t\t\t// Avoid missing properties on the literal\n\t\t\tif (state.selectionStart && state.selectionStart.lineNumber) {\n\t\t\t\tselectionStartLineNumber = state.selectionStart.lineNumber;\n\t\t\t}\n\t\t\tif (state.selectionStart && state.selectionStart.column) {\n\t\t\t\tselectionStartColumn = state.selectionStart.column;\n\t\t\t}\n\n\t\t\tdesiredSelections.push({\n\t\t\t\tselectionStartLineNumber: selectionStartLineNumber,\n\t\t\t\tselectionStartColumn: selectionStartColumn,\n\t\t\t\tpositionLineNumber: positionLineNumber,\n\t\t\t\tpositionColumn: positionColumn\n\t\t\t});\n\t\t}\n\n\t\tthis.setStates(eventsCollector, 'restoreState', CursorChangeReason.NotSet, CursorState.fromModelSelections(desiredSelections));\n\t\tthis.revealPrimary(eventsCollector, 'restoreState', false, VerticalRevealType.Simple, true, editorCommon.ScrollType.Immediate);\n\t}\n\n\tpublic onModelContentChanged(eventsCollector: ViewModelEventsCollector, e: ModelRawContentChangedEvent | ModelInjectedTextChangedEvent): void {\n\t\tif (e instanceof ModelInjectedTextChangedEvent) {\n\t\t\t// If injected texts change, the view positions of all cursors need to be updated.\n\t\t\tif (this._isHandling) {\n\t\t\t\t// The view positions will be updated when handling finishes\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// setStates might remove markers, which could trigger a decoration change.\n\t\t\t// If there are injected text decorations for that line, `onModelContentChanged` is emitted again\n\t\t\t// and an endless recursion happens.\n\t\t\t// _isHandling prevents that.\n\t\t\tthis._isHandling = true;\n\t\t\ttry {\n\t\t\t\tthis.setStates(eventsCollector, 'modelChange', CursorChangeReason.NotSet, this.getCursorStates());\n\t\t\t} finally {\n\t\t\t\tthis._isHandling = false;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._knownModelVersionId = e.versionId;\n\t\t\tif (this._isHandling) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hadFlushEvent = e.containsEvent(RawContentChangedType.Flush);\n\t\t\tthis._prevEditOperationType = EditOperationType.Other;\n\n\t\t\tif (hadFlushEvent) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._cursors.dispose();\n\t\t\t\tthis._cursors = new CursorCollection(this.context);\n\t\t\t\tthis._validateAutoClosedActions();\n\t\t\t\tthis._emitStateChangedIfNecessary(eventsCollector, 'model', CursorChangeReason.ContentFlush, null, false);\n\t\t\t} else {\n\t\t\t\tif (this._hasFocus && e.resultingSelection && e.resultingSelection.length > 0) {\n\t\t\t\t\tconst cursorState = CursorState.fromModelSelections(e.resultingSelection);\n\t\t\t\t\tif (this.setStates(eventsCollector, 'modelChange', e.isUndoing ? CursorChangeReason.Undo : e.isRedoing ? CursorChangeReason.Redo : CursorChangeReason.RecoverFromMarkers, cursorState)) {\n\t\t\t\t\t\tthis.revealPrimary(eventsCollector, 'modelChange', false, VerticalRevealType.Simple, true, editorCommon.ScrollType.Smooth);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst selectionsFromMarkers = this._cursors.readSelectionFromMarkers();\n\t\t\t\t\tthis.setStates(eventsCollector, 'modelChange', CursorChangeReason.RecoverFromMarkers, CursorState.fromModelSelections(selectionsFromMarkers));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getSelection(): Selection {\n\t\treturn this._cursors.getPrimaryCursor().modelState.selection;\n\t}\n\n\tpublic getTopMostViewPosition(): Position {\n\t\treturn this._cursors.getTopMostViewPosition();\n\t}\n\n\tpublic getBottomMostViewPosition(): Position {\n\t\treturn this._cursors.getBottomMostViewPosition();\n\t}\n\n\tpublic getCursorColumnSelectData(): IColumnSelectData {\n\t\tif (this._columnSelectData) {\n\t\t\treturn this._columnSelectData;\n\t\t}\n\t\tconst primaryCursor = this._cursors.getPrimaryCursor();\n\t\tconst viewSelectionStart = primaryCursor.viewState.selectionStart.getStartPosition();\n\t\tconst viewPosition = primaryCursor.viewState.position;\n\t\treturn {\n\t\t\tisReal: false,\n\t\t\tfromViewLineNumber: viewSelectionStart.lineNumber,\n\t\t\tfromViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, viewSelectionStart),\n\t\t\ttoViewLineNumber: viewPosition.lineNumber,\n\t\t\ttoViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, viewPosition),\n\t\t};\n\t}\n\n\tpublic getSelections(): Selection[] {\n\t\treturn this._cursors.getSelections();\n\t}\n\n\tpublic setSelections(eventsCollector: ViewModelEventsCollector, source: string | null | undefined, selections: readonly ISelection[], reason: CursorChangeReason): void {\n\t\tthis.setStates(eventsCollector, source, reason, CursorState.fromModelSelections(selections));\n\t}\n\n\tpublic getPrevEditOperationType(): EditOperationType {\n\t\treturn this._prevEditOperationType;\n\t}\n\n\tpublic setPrevEditOperationType(type: EditOperationType): void {\n\t\tthis._prevEditOperationType = type;\n\t}\n\n\t// ------ auxiliary handling logic\n\n\tprivate _pushAutoClosedAction(autoClosedCharactersRanges: Range[], autoClosedEnclosingRanges: Range[]): void {\n\t\tconst autoClosedCharactersDeltaDecorations: IModelDeltaDecoration[] = [];\n\t\tconst autoClosedEnclosingDeltaDecorations: IModelDeltaDecoration[] = [];\n\n\t\tfor (let i = 0, len = autoClosedCharactersRanges.length; i < len; i++) {\n\t\t\tautoClosedCharactersDeltaDecorations.push({\n\t\t\t\trange: autoClosedCharactersRanges[i],\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'auto-closed-character',\n\t\t\t\t\tinlineClassName: 'auto-closed-character',\n\t\t\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t\t\t\t}\n\t\t\t});\n\t\t\tautoClosedEnclosingDeltaDecorations.push({\n\t\t\t\trange: autoClosedEnclosingRanges[i],\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'auto-closed-enclosing',\n\t\t\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosedCharactersDecorations = this._model.deltaDecorations([], autoClosedCharactersDeltaDecorations);\n\t\tconst autoClosedEnclosingDecorations = this._model.deltaDecorations([], autoClosedEnclosingDeltaDecorations);\n\t\tthis._autoClosedActions.push(new AutoClosedAction(this._model, autoClosedCharactersDecorations, autoClosedEnclosingDecorations));\n\t}\n\n\tprivate _executeEditOperation(opResult: EditOperationResult | null): void {\n\n\t\tif (!opResult) {\n\t\t\t// Nothing to execute\n\t\t\treturn;\n\t\t}\n\n\t\tif (opResult.shouldPushStackElementBefore) {\n\t\t\tthis._model.pushStackElement();\n\t\t}\n\n\t\tconst result = CommandExecutor.executeCommands(this._model, this._cursors.getSelections(), opResult.commands);\n\t\tif (result) {\n\t\t\t// The commands were applied correctly\n\t\t\tthis._interpretCommandResult(result);\n\n\t\t\t// Check for auto-closing closed characters\n\t\t\tconst autoClosedCharactersRanges: Range[] = [];\n\t\t\tconst autoClosedEnclosingRanges: Range[] = [];\n\n\t\t\tfor (let i = 0; i < opResult.commands.length; i++) {\n\t\t\t\tconst command = opResult.commands[i];\n\t\t\t\tif (command instanceof TypeWithAutoClosingCommand && command.enclosingRange && command.closeCharacterRange) {\n\t\t\t\t\tautoClosedCharactersRanges.push(command.closeCharacterRange);\n\t\t\t\t\tautoClosedEnclosingRanges.push(command.enclosingRange);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (autoClosedCharactersRanges.length > 0) {\n\t\t\t\tthis._pushAutoClosedAction(autoClosedCharactersRanges, autoClosedEnclosingRanges);\n\t\t\t}\n\n\t\t\tthis._prevEditOperationType = opResult.type;\n\t\t}\n\n\t\tif (opResult.shouldPushStackElementAfter) {\n\t\t\tthis._model.pushStackElement();\n\t\t}\n\t}\n\n\tprivate _interpretCommandResult(cursorState: Selection[] | null): void {\n\t\tif (!cursorState || cursorState.length === 0) {\n\t\t\tcursorState = this._cursors.readSelectionFromMarkers();\n\t\t}\n\n\t\tthis._columnSelectData = null;\n\t\tthis._cursors.setSelections(cursorState);\n\t\tthis._cursors.normalize();\n\t}\n\n\t// -----------------------------------------------------------------------------------------------------------\n\t// ----- emitting events\n\n\tprivate _emitStateChangedIfNecessary(eventsCollector: ViewModelEventsCollector, source: string | null | undefined, reason: CursorChangeReason, oldState: CursorModelState | null, reachedMaxCursorCount: boolean): boolean {\n\t\tconst newState = CursorModelState.from(this._model, this);\n\t\tif (newState.equals(oldState)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst selections = this._cursors.getSelections();\n\t\tconst viewSelections = this._cursors.getViewSelections();\n\n\t\t// Let the view get the event first.\n\t\teventsCollector.emitViewEvent(new ViewCursorStateChangedEvent(viewSelections, selections));\n\n\t\t// Only after the view has been notified, let the rest of the world know...\n\t\tif (!oldState\n\t\t\t|| oldState.cursorState.length !== newState.cursorState.length\n\t\t\t|| newState.cursorState.some((newCursorState, i) => !newCursorState.modelState.equals(oldState.cursorState[i].modelState))\n\t\t) {\n\t\t\tconst oldSelections = oldState ? oldState.cursorState.map(s => s.modelState.selection) : null;\n\t\t\tconst oldModelVersionId = oldState ? oldState.modelVersionId : 0;\n\t\t\teventsCollector.emitOutgoingEvent(new CursorStateChangedEvent(oldSelections, selections, oldModelVersionId, newState.modelVersionId, source || 'keyboard', reason, reachedMaxCursorCount));\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// -----------------------------------------------------------------------------------------------------------\n\t// ----- handlers beyond this point\n\n\tprivate _findAutoClosingPairs(edits: IIdentifiedSingleEditOperation[]): [number, number][] | null {\n\t\tif (!edits.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst indices: [number, number][] = [];\n\t\tfor (let i = 0, len = edits.length; i < len; i++) {\n\t\t\tconst edit = edits[i];\n\t\t\tif (!edit.text || edit.text.indexOf('\\n') >= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst m = edit.text.match(/([)\\]}>'\"`])([^)\\]}>'\"`]*)$/);\n\t\t\tif (!m) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst closeChar = m[1];\n\n\t\t\tconst autoClosingPairsCandidates = this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(closeChar);\n\t\t\tif (!autoClosingPairsCandidates || autoClosingPairsCandidates.length !== 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst openChar = autoClosingPairsCandidates[0].open;\n\t\t\tconst closeCharIndex = edit.text.length - m[2].length - 1;\n\t\t\tconst openCharIndex = edit.text.lastIndexOf(openChar, closeCharIndex - 1);\n\t\t\tif (openCharIndex === -1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tindices.push([openCharIndex, closeCharIndex]);\n\t\t}\n\n\t\treturn indices;\n\t}\n\n\tpublic executeEdits(eventsCollector: ViewModelEventsCollector, source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): void {\n\t\tlet autoClosingIndices: [number, number][] | null = null;\n\t\tif (source === 'snippet') {\n\t\t\tautoClosingIndices = this._findAutoClosingPairs(edits);\n\t\t}\n\n\t\tif (autoClosingIndices) {\n\t\t\tedits[0]._isTracked = true;\n\t\t}\n\t\tconst autoClosedCharactersRanges: Range[] = [];\n\t\tconst autoClosedEnclosingRanges: Range[] = [];\n\t\tconst selections = this._model.pushEditOperations(this.getSelections(), edits, (undoEdits) => {\n\t\t\tif (autoClosingIndices) {\n\t\t\t\tfor (let i = 0, len = autoClosingIndices.length; i < len; i++) {\n\t\t\t\t\tconst [openCharInnerIndex, closeCharInnerIndex] = autoClosingIndices[i];\n\t\t\t\t\tconst undoEdit = undoEdits[i];\n\t\t\t\t\tconst lineNumber = undoEdit.range.startLineNumber;\n\t\t\t\t\tconst openCharIndex = undoEdit.range.startColumn - 1 + openCharInnerIndex;\n\t\t\t\t\tconst closeCharIndex = undoEdit.range.startColumn - 1 + closeCharInnerIndex;\n\n\t\t\t\t\tautoClosedCharactersRanges.push(new Range(lineNumber, closeCharIndex + 1, lineNumber, closeCharIndex + 2));\n\t\t\t\t\tautoClosedEnclosingRanges.push(new Range(lineNumber, openCharIndex + 1, lineNumber, closeCharIndex + 2));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst selections = cursorStateComputer(undoEdits);\n\t\t\tif (selections) {\n\t\t\t\t// Don't recover the selection from markers because\n\t\t\t\t// we know what it should be.\n\t\t\t\tthis._isHandling = true;\n\t\t\t}\n\n\t\t\treturn selections;\n\t\t});\n\t\tif (selections) {\n\t\t\tthis._isHandling = false;\n\t\t\tthis.setSelections(eventsCollector, source, selections, CursorChangeReason.NotSet);\n\t\t}\n\t\tif (autoClosedCharactersRanges.length > 0) {\n\t\t\tthis._pushAutoClosedAction(autoClosedCharactersRanges, autoClosedEnclosingRanges);\n\t\t}\n\t}\n\n\tprivate _executeEdit(callback: () => void, eventsCollector: ViewModelEventsCollector, source: string | null | undefined, cursorChangeReason: CursorChangeReason = CursorChangeReason.NotSet): void {\n\t\tif (this.context.cursorConfig.readOnly) {\n\t\t\t// we cannot edit when read only...\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldState = CursorModelState.from(this._model, this);\n\t\tthis._cursors.stopTrackingSelections();\n\t\tthis._isHandling = true;\n\n\t\ttry {\n\t\t\tthis._cursors.ensureValidState();\n\t\t\tcallback();\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t}\n\n\t\tthis._isHandling = false;\n\t\tthis._cursors.startTrackingSelections();\n\t\tthis._validateAutoClosedActions();\n\t\tif (this._emitStateChangedIfNecessary(eventsCollector, source, cursorChangeReason, oldState, false)) {\n\t\t\tthis.revealPrimary(eventsCollector, source, false, VerticalRevealType.Simple, true, editorCommon.ScrollType.Smooth);\n\t\t}\n\t}\n\n\tpublic setIsDoingComposition(isDoingComposition: boolean): void {\n\t\tthis._isDoingComposition = isDoingComposition;\n\t}\n\n\tpublic getAutoClosedCharacters(): Range[] {\n\t\treturn AutoClosedAction.getAllAutoClosedCharacters(this._autoClosedActions);\n\t}\n\n\tpublic startComposition(eventsCollector: ViewModelEventsCollector): void {\n\t\tthis._selectionsWhenCompositionStarted = this.getSelections().slice(0);\n\t}\n\n\tpublic endComposition(eventsCollector: ViewModelEventsCollector, source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tif (source === 'keyboard') {\n\t\t\t\t// composition finishes, let's check if we need to auto complete if necessary.\n\t\t\t\tthis._executeEditOperation(TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this._selectionsWhenCompositionStarted, this.getSelections(), this.getAutoClosedCharacters()));\n\t\t\t\tthis._selectionsWhenCompositionStarted = null;\n\t\t\t}\n\t\t}, eventsCollector, source);\n\t}\n\n\tpublic type(eventsCollector: ViewModelEventsCollector, text: string, source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tif (source === 'keyboard') {\n\t\t\t\t// If this event is coming straight from the keyboard, look for electric characters and enter\n\n\t\t\t\tconst len = text.length;\n\t\t\t\tlet offset = 0;\n\t\t\t\twhile (offset < len) {\n\t\t\t\t\tconst charLength = strings.nextCharLength(text, offset);\n\t\t\t\t\tconst chr = text.substr(offset, charLength);\n\n\t\t\t\t\t// Here we must interpret each typed character individually\n\t\t\t\t\tthis._executeEditOperation(TypeOperations.typeWithInterceptors(this._isDoingComposition, this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), this.getAutoClosedCharacters(), chr));\n\n\t\t\t\t\toffset += charLength;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tthis._executeEditOperation(TypeOperations.typeWithoutInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), text));\n\t\t\t}\n\t\t}, eventsCollector, source);\n\t}\n\n\tpublic compositionType(eventsCollector: ViewModelEventsCollector, text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number, source?: string | null | undefined): void {\n\t\tif (text.length === 0 && replacePrevCharCnt === 0 && replaceNextCharCnt === 0) {\n\t\t\t// this edit is a no-op\n\t\t\tif (positionDelta !== 0) {\n\t\t\t\t// but it still wants to move the cursor\n\t\t\t\tconst newSelections = this.getSelections().map(selection => {\n\t\t\t\t\tconst position = selection.getPosition();\n\t\t\t\t\treturn new Selection(position.lineNumber, position.column + positionDelta, position.lineNumber, position.column + positionDelta);\n\t\t\t\t});\n\t\t\t\tthis.setSelections(eventsCollector, source, newSelections, CursorChangeReason.NotSet);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._executeEdit(() => {\n\t\t\tthis._executeEditOperation(TypeOperations.compositionType(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), text, replacePrevCharCnt, replaceNextCharCnt, positionDelta));\n\t\t}, eventsCollector, source);\n\t}\n\n\tpublic paste(eventsCollector: ViewModelEventsCollector, text: string, pasteOnNewLine: boolean, multicursorText?: string[] | null | undefined, source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tthis._executeEditOperation(TypeOperations.paste(this.context.cursorConfig, this._model, this.getSelections(), text, pasteOnNewLine, multicursorText || []));\n\t\t}, eventsCollector, source, CursorChangeReason.Paste);\n\t}\n\n\tpublic cut(eventsCollector: ViewModelEventsCollector, source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tthis._executeEditOperation(DeleteOperations.cut(this.context.cursorConfig, this._model, this.getSelections()));\n\t\t}, eventsCollector, source);\n\t}\n\n\tpublic executeCommand(eventsCollector: ViewModelEventsCollector, command: editorCommon.ICommand, source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tthis._cursors.killSecondaryCursors();\n\n\t\t\tthis._executeEditOperation(new EditOperationResult(EditOperationType.Other, [command], {\n\t\t\t\tshouldPushStackElementBefore: false,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t}));\n\t\t}, eventsCollector, source);\n\t}\n\n\tpublic executeCommands(eventsCollector: ViewModelEventsCollector, commands: editorCommon.ICommand[], source?: string | null | undefined): void {\n\t\tthis._executeEdit(() => {\n\t\t\tthis._executeEditOperation(new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\t\tshouldPushStackElementBefore: false,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t}));\n\t\t}, eventsCollector, source);\n\t}\n}\n\n/**\n * A snapshot of the cursor and the model state\n */\nclass CursorModelState {\n\tpublic static from(model: ITextModel, cursor: CursorsController): CursorModelState {\n\t\treturn new CursorModelState(model.getVersionId(), cursor.getCursorStates());\n\t}\n\n\tconstructor(\n\t\tpublic readonly modelVersionId: number,\n\t\tpublic readonly cursorState: CursorState[],\n\t) {\n\t}\n\n\tpublic equals(other: CursorModelState | null): boolean {\n\t\tif (!other) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.modelVersionId !== other.modelVersionId) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.cursorState.length !== other.cursorState.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0, len = this.cursorState.length; i < len; i++) {\n\t\t\tif (!this.cursorState[i].equals(other.cursorState[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nclass AutoClosedAction {\n\n\tpublic static getAllAutoClosedCharacters(autoClosedActions: AutoClosedAction[]): Range[] {\n\t\tlet autoClosedCharacters: Range[] = [];\n\t\tfor (const autoClosedAction of autoClosedActions) {\n\t\t\tautoClosedCharacters = autoClosedCharacters.concat(autoClosedAction.getAutoClosedCharactersRanges());\n\t\t}\n\t\treturn autoClosedCharacters;\n\t}\n\n\tprivate readonly _model: ITextModel;\n\n\tprivate _autoClosedCharactersDecorations: string[];\n\tprivate _autoClosedEnclosingDecorations: string[];\n\n\tconstructor(model: ITextModel, autoClosedCharactersDecorations: string[], autoClosedEnclosingDecorations: string[]) {\n\t\tthis._model = model;\n\t\tthis._autoClosedCharactersDecorations = autoClosedCharactersDecorations;\n\t\tthis._autoClosedEnclosingDecorations = autoClosedEnclosingDecorations;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._autoClosedCharactersDecorations = this._model.deltaDecorations(this._autoClosedCharactersDecorations, []);\n\t\tthis._autoClosedEnclosingDecorations = this._model.deltaDecorations(this._autoClosedEnclosingDecorations, []);\n\t}\n\n\tpublic getAutoClosedCharactersRanges(): Range[] {\n\t\tconst result: Range[] = [];\n\t\tfor (let i = 0; i < this._autoClosedCharactersDecorations.length; i++) {\n\t\t\tconst decorationRange = this._model.getDecorationRange(this._autoClosedCharactersDecorations[i]);\n\t\t\tif (decorationRange) {\n\t\t\t\tresult.push(decorationRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic isValid(selections: Range[]): boolean {\n\t\tconst enclosingRanges: Range[] = [];\n\t\tfor (let i = 0; i < this._autoClosedEnclosingDecorations.length; i++) {\n\t\t\tconst decorationRange = this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);\n\t\t\tif (decorationRange) {\n\t\t\t\tenclosingRanges.push(decorationRange);\n\t\t\t\tif (decorationRange.startLineNumber !== decorationRange.endLineNumber) {\n\t\t\t\t\t// Stop tracking if the range becomes multiline...\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tenclosingRanges.sort(Range.compareRangesUsingStarts);\n\n\t\tselections.sort(Range.compareRangesUsingStarts);\n\n\t\tfor (let i = 0; i < selections.length; i++) {\n\t\t\tif (i >= enclosingRanges.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!enclosingRanges[i].strictContainsRange(selections[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n\ninterface IExecContext {\n\treadonly model: ITextModel;\n\treadonly selectionsBefore: Selection[];\n\treadonly trackedRanges: string[];\n\treadonly trackedRangesDirection: SelectionDirection[];\n}\n\ninterface ICommandData {\n\toperations: IIdentifiedSingleEditOperation[];\n\thadTrackedEditOperation: boolean;\n}\n\ninterface ICommandsData {\n\toperations: IIdentifiedSingleEditOperation[];\n\thadTrackedEditOperation: boolean;\n}\n\nclass CommandExecutor {\n\n\tpublic static executeCommands(model: ITextModel, selectionsBefore: Selection[], commands: (editorCommon.ICommand | null)[]): Selection[] | null {\n\n\t\tconst ctx: IExecContext = {\n\t\t\tmodel: model,\n\t\t\tselectionsBefore: selectionsBefore,\n\t\t\ttrackedRanges: [],\n\t\t\ttrackedRangesDirection: []\n\t\t};\n\n\t\tconst result = this._innerExecuteCommands(ctx, commands);\n\n\t\tfor (let i = 0, len = ctx.trackedRanges.length; i < len; i++) {\n\t\t\tctx.model._setTrackedRange(ctx.trackedRanges[i], null, TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _innerExecuteCommands(ctx: IExecContext, commands: (editorCommon.ICommand | null)[]): Selection[] | null {\n\n\t\tif (this._arrayIsEmpty(commands)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst commandsData = this._getEditOperations(ctx, commands);\n\t\tif (commandsData.operations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rawOperations = commandsData.operations;\n\n\t\tconst loserCursorsMap = this._getLoserCursorMap(rawOperations);\n\t\tif (loserCursorsMap.hasOwnProperty('0')) {\n\t\t\t// These commands are very messed up\n\t\t\tconsole.warn('Ignoring commands');\n\t\t\treturn null;\n\t\t}\n\n\t\t// Remove operations belonging to losing cursors\n\t\tconst filteredOperations: IIdentifiedSingleEditOperation[] = [];\n\t\tfor (let i = 0, len = rawOperations.length; i < len; i++) {\n\t\t\tif (!loserCursorsMap.hasOwnProperty(rawOperations[i].identifier!.major.toString())) {\n\t\t\t\tfilteredOperations.push(rawOperations[i]);\n\t\t\t}\n\t\t}\n\n\t\t// TODO@Alex: find a better way to do this.\n\t\t// give the hint that edit operations are tracked to the model\n\t\tif (commandsData.hadTrackedEditOperation && filteredOperations.length > 0) {\n\t\t\tfilteredOperations[0]._isTracked = true;\n\t\t}\n\t\tlet selectionsAfter = ctx.model.pushEditOperations(ctx.selectionsBefore, filteredOperations, (inverseEditOperations: IValidEditOperation[]): Selection[] => {\n\t\t\tconst groupedInverseEditOperations: IValidEditOperation[][] = [];\n\t\t\tfor (let i = 0; i < ctx.selectionsBefore.length; i++) {\n\t\t\t\tgroupedInverseEditOperations[i] = [];\n\t\t\t}\n\t\t\tfor (const op of inverseEditOperations) {\n\t\t\t\tif (!op.identifier) {\n\t\t\t\t\t// perhaps auto whitespace trim edits\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tgroupedInverseEditOperations[op.identifier.major].push(op);\n\t\t\t}\n\t\t\tconst minorBasedSorter = (a: IValidEditOperation, b: IValidEditOperation) => {\n\t\t\t\treturn a.identifier!.minor - b.identifier!.minor;\n\t\t\t};\n\t\t\tconst cursorSelections: Selection[] = [];\n\t\t\tfor (let i = 0; i < ctx.selectionsBefore.length; i++) {\n\t\t\t\tif (groupedInverseEditOperations[i].length > 0) {\n\t\t\t\t\tgroupedInverseEditOperations[i].sort(minorBasedSorter);\n\t\t\t\t\tcursorSelections[i] = commands[i]!.computeCursorState(ctx.model, {\n\t\t\t\t\t\tgetInverseEditOperations: () => {\n\t\t\t\t\t\t\treturn groupedInverseEditOperations[i];\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tgetTrackedSelection: (id: string) => {\n\t\t\t\t\t\t\tconst idx = parseInt(id, 10);\n\t\t\t\t\t\t\tconst range = ctx.model._getTrackedRange(ctx.trackedRanges[idx])!;\n\t\t\t\t\t\t\tif (ctx.trackedRangesDirection[idx] === SelectionDirection.LTR) {\n\t\t\t\t\t\t\t\treturn new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn new Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tcursorSelections[i] = ctx.selectionsBefore[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cursorSelections;\n\t\t});\n\t\tif (!selectionsAfter) {\n\t\t\tselectionsAfter = ctx.selectionsBefore;\n\t\t}\n\n\t\t// Extract losing cursors\n\t\tconst losingCursors: number[] = [];\n\t\tfor (let losingCursorIndex in loserCursorsMap) {\n\t\t\tif (loserCursorsMap.hasOwnProperty(losingCursorIndex)) {\n\t\t\t\tlosingCursors.push(parseInt(losingCursorIndex, 10));\n\t\t\t}\n\t\t}\n\n\t\t// Sort losing cursors descending\n\t\tlosingCursors.sort((a: number, b: number): number => {\n\t\t\treturn b - a;\n\t\t});\n\n\t\t// Remove losing cursors\n\t\tfor (const losingCursor of losingCursors) {\n\t\t\tselectionsAfter.splice(losingCursor, 1);\n\t\t}\n\n\t\treturn selectionsAfter;\n\t}\n\n\tprivate static _arrayIsEmpty(commands: (editorCommon.ICommand | null)[]): boolean {\n\t\tfor (let i = 0, len = commands.length; i < len; i++) {\n\t\t\tif (commands[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate static _getEditOperations(ctx: IExecContext, commands: (editorCommon.ICommand | null)[]): ICommandsData {\n\t\tlet operations: IIdentifiedSingleEditOperation[] = [];\n\t\tlet hadTrackedEditOperation: boolean = false;\n\n\t\tfor (let i = 0, len = commands.length; i < len; i++) {\n\t\t\tconst command = commands[i];\n\t\t\tif (command) {\n\t\t\t\tconst r = this._getEditOperationsFromCommand(ctx, i, command);\n\t\t\t\toperations = operations.concat(r.operations);\n\t\t\t\thadTrackedEditOperation = hadTrackedEditOperation || r.hadTrackedEditOperation;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\toperations: operations,\n\t\t\thadTrackedEditOperation: hadTrackedEditOperation\n\t\t};\n\t}\n\n\tprivate static _getEditOperationsFromCommand(ctx: IExecContext, majorIdentifier: number, command: editorCommon.ICommand): ICommandData {\n\t\t// This method acts as a transaction, if the command fails\n\t\t// everything it has done is ignored\n\t\tconst operations: IIdentifiedSingleEditOperation[] = [];\n\t\tlet operationMinor = 0;\n\n\t\tconst addEditOperation = (range: IRange, text: string | null, forceMoveMarkers: boolean = false) => {\n\t\t\tif (Range.isEmpty(range) && text === '') {\n\t\t\t\t// This command wants to add a no-op => no thank you\n\t\t\t\treturn;\n\t\t\t}\n\t\t\toperations.push({\n\t\t\t\tidentifier: {\n\t\t\t\t\tmajor: majorIdentifier,\n\t\t\t\t\tminor: operationMinor++\n\t\t\t\t},\n\t\t\t\trange: range,\n\t\t\t\ttext: text,\n\t\t\t\tforceMoveMarkers: forceMoveMarkers,\n\t\t\t\tisAutoWhitespaceEdit: command.insertsAutoWhitespace\n\t\t\t});\n\t\t};\n\n\t\tlet hadTrackedEditOperation = false;\n\t\tconst addTrackedEditOperation = (selection: IRange, text: string | null, forceMoveMarkers?: boolean) => {\n\t\t\thadTrackedEditOperation = true;\n\t\t\taddEditOperation(selection, text, forceMoveMarkers);\n\t\t};\n\n\t\tconst trackSelection = (_selection: ISelection, trackPreviousOnEmpty?: boolean) => {\n\t\t\tconst selection = Selection.liftSelection(_selection);\n\t\t\tlet stickiness: TrackedRangeStickiness;\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tif (typeof trackPreviousOnEmpty === 'boolean') {\n\t\t\t\t\tif (trackPreviousOnEmpty) {\n\t\t\t\t\t\tstickiness = TrackedRangeStickiness.GrowsOnlyWhenTypingBefore;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstickiness = TrackedRangeStickiness.GrowsOnlyWhenTypingAfter;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Try to lock it with surrounding text\n\t\t\t\t\tconst maxLineColumn = ctx.model.getLineMaxColumn(selection.startLineNumber);\n\t\t\t\t\tif (selection.startColumn === maxLineColumn) {\n\t\t\t\t\t\tstickiness = TrackedRangeStickiness.GrowsOnlyWhenTypingBefore;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstickiness = TrackedRangeStickiness.GrowsOnlyWhenTypingAfter;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstickiness = TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;\n\t\t\t}\n\n\t\t\tconst l = ctx.trackedRanges.length;\n\t\t\tconst id = ctx.model._setTrackedRange(null, selection, stickiness);\n\t\t\tctx.trackedRanges[l] = id;\n\t\t\tctx.trackedRangesDirection[l] = selection.getDirection();\n\t\t\treturn l.toString();\n\t\t};\n\n\t\tconst editOperationBuilder: editorCommon.IEditOperationBuilder = {\n\t\t\taddEditOperation: addEditOperation,\n\t\t\taddTrackedEditOperation: addTrackedEditOperation,\n\t\t\ttrackSelection: trackSelection\n\t\t};\n\n\t\ttry {\n\t\t\tcommand.getEditOperations(ctx.model, editOperationBuilder);\n\t\t} catch (e) {\n\t\t\t// TODO@Alex use notification service if this should be user facing\n\t\t\t// e.friendlyMessage = nls.localize('corrupt.commands', \"Unexpected exception while executing command.\");\n\t\t\tonUnexpectedError(e);\n\t\t\treturn {\n\t\t\t\toperations: [],\n\t\t\t\thadTrackedEditOperation: false\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\toperations: operations,\n\t\t\thadTrackedEditOperation: hadTrackedEditOperation\n\t\t};\n\t}\n\n\tprivate static _getLoserCursorMap(operations: IIdentifiedSingleEditOperation[]): { [index: string]: boolean } {\n\t\t// This is destructive on the array\n\t\toperations = operations.slice(0);\n\n\t\t// Sort operations with last one first\n\t\toperations.sort((a: IIdentifiedSingleEditOperation, b: IIdentifiedSingleEditOperation): number => {\n\t\t\t// Note the minus!\n\t\t\treturn -(Range.compareRangesUsingEnds(a.range, b.range));\n\t\t});\n\n\t\t// Operations can not overlap!\n\t\tconst loserCursorsMap: { [index: string]: boolean } = {};\n\n\t\tfor (let i = 1; i < operations.length; i++) {\n\t\t\tconst previousOp = operations[i - 1];\n\t\t\tconst currentOp = operations[i];\n\n\t\t\tif (Range.getStartPosition(previousOp.range).isBefore(Range.getEndPosition(currentOp.range))) {\n\n\t\t\t\tlet loserMajor: number;\n\n\t\t\t\tif (previousOp.identifier!.major > currentOp.identifier!.major) {\n\t\t\t\t\t// previousOp loses the battle\n\t\t\t\t\tloserMajor = previousOp.identifier!.major;\n\t\t\t\t} else {\n\t\t\t\t\tloserMajor = currentOp.identifier!.major;\n\t\t\t\t}\n\n\t\t\t\tloserCursorsMap[loserMajor.toString()] = true;\n\n\t\t\t\tfor (let j = 0; j < operations.length; j++) {\n\t\t\t\t\tif (operations[j].identifier!.major === loserMajor) {\n\t\t\t\t\t\toperations.splice(j, 1);\n\t\t\t\t\t\tif (j < i) {\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (i > 0) {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn loserCursorsMap;\n\t}\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/base/common/uint';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ILanguageConfigurationService, LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { BlockCommentCommand } from 'vs/editor/contrib/comment/browser/blockCommentCommand';\n\nexport interface IInsertionPoint {\n\tignore: boolean;\n\tcommentStrOffset: number;\n}\n\nexport interface ILinePreflightData {\n\tignore: boolean;\n\tcommentStr: string;\n\tcommentStrOffset: number;\n\tcommentStrLength: number;\n}\n\nexport interface IPreflightDataSupported {\n\tsupported: true;\n\tshouldRemoveComments: boolean;\n\tlines: ILinePreflightData[];\n}\nexport interface IPreflightDataUnsupported {\n\tsupported: false;\n}\nexport type IPreflightData = IPreflightDataSupported | IPreflightDataUnsupported;\n\nexport interface ISimpleModel {\n\tgetLineContent(lineNumber: number): string;\n}\n\nexport const enum Type {\n\tToggle = 0,\n\tForceAdd = 1,\n\tForceRemove = 2\n}\n\nexport class LineCommentCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _tabSize: number;\n\tprivate readonly _type: Type;\n\tprivate readonly _insertSpace: boolean;\n\tprivate readonly _ignoreEmptyLines: boolean;\n\tprivate _selectionId: string | null;\n\tprivate _deltaColumn: number;\n\tprivate _moveEndPositionDown: boolean;\n\tprivate _ignoreFirstLine: boolean;\n\n\tconstructor(\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService,\n\t\tselection: Selection,\n\t\ttabSize: number,\n\t\ttype: Type,\n\t\tinsertSpace: boolean,\n\t\tignoreEmptyLines: boolean,\n\t\tignoreFirstLine?: boolean,\n\t) {\n\t\tthis._selection = selection;\n\t\tthis._tabSize = tabSize;\n\t\tthis._type = type;\n\t\tthis._insertSpace = insertSpace;\n\t\tthis._selectionId = null;\n\t\tthis._deltaColumn = 0;\n\t\tthis._moveEndPositionDown = false;\n\t\tthis._ignoreEmptyLines = ignoreEmptyLines;\n\t\tthis._ignoreFirstLine = ignoreFirstLine || false;\n\t}\n\n\t/**\n\t * Do an initial pass over the lines and gather info about the line comment string.\n\t * Returns null if any of the lines doesn't support a line comment string.\n\t */\n\tprivate static _gatherPreflightCommentStrings(model: ITextModel, startLineNumber: number, endLineNumber: number, languageConfigurationService: ILanguageConfigurationService): ILinePreflightData[] | null {\n\n\t\tmodel.tokenizeIfCheap(startLineNumber);\n\t\tconst languageId = model.getLanguageIdAtPosition(startLineNumber, 1);\n\n\t\tconst config = languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tconst commentStr = (config ? config.lineCommentToken : null);\n\t\tif (!commentStr) {\n\t\t\t// Mode does not support line comments\n\t\t\treturn null;\n\t\t}\n\n\t\tlet lines: ILinePreflightData[] = [];\n\t\tfor (let i = 0, lineCount = endLineNumber - startLineNumber + 1; i < lineCount; i++) {\n\t\t\tlines[i] = {\n\t\t\t\tignore: false,\n\t\t\t\tcommentStr: commentStr,\n\t\t\t\tcommentStrOffset: 0,\n\t\t\t\tcommentStrLength: commentStr.length\n\t\t\t};\n\t\t}\n\n\t\treturn lines;\n\t}\n\n\t/**\n\t * Analyze lines and decide which lines are relevant and what the toggle should do.\n\t * Also, build up several offsets and lengths useful in the generation of editor operations.\n\t */\n\tpublic static _analyzeLines(type: Type, insertSpace: boolean, model: ISimpleModel, lines: ILinePreflightData[], startLineNumber: number, ignoreEmptyLines: boolean, ignoreFirstLine: boolean, languageConfigurationService: ILanguageConfigurationService): IPreflightData {\n\t\tlet onlyWhitespaceLines = true;\n\n\t\tlet shouldRemoveComments: boolean;\n\t\tif (type === Type.Toggle) {\n\t\t\tshouldRemoveComments = true;\n\t\t} else if (type === Type.ForceAdd) {\n\t\t\tshouldRemoveComments = false;\n\t\t} else {\n\t\t\tshouldRemoveComments = true;\n\t\t}\n\n\t\tfor (let i = 0, lineCount = lines.length; i < lineCount; i++) {\n\t\t\tconst lineData = lines[i];\n\t\t\tconst lineNumber = startLineNumber + i;\n\n\t\t\tif (lineNumber === startLineNumber && ignoreFirstLine) {\n\t\t\t\t// first line ignored\n\t\t\t\tlineData.ignore = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\t\tconst lineContentStartOffset = strings.firstNonWhitespaceIndex(lineContent);\n\n\t\t\tif (lineContentStartOffset === -1) {\n\t\t\t\t// Empty or whitespace only line\n\t\t\t\tlineData.ignore = ignoreEmptyLines;\n\t\t\t\tlineData.commentStrOffset = lineContent.length;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tonlyWhitespaceLines = false;\n\t\t\tlineData.ignore = false;\n\t\t\tlineData.commentStrOffset = lineContentStartOffset;\n\n\t\t\tif (shouldRemoveComments && !BlockCommentCommand._haystackHasNeedleAtOffset(lineContent, lineData.commentStr, lineContentStartOffset)) {\n\t\t\t\tif (type === Type.Toggle) {\n\t\t\t\t\t// Every line so far has been a line comment, but this one is not\n\t\t\t\t\tshouldRemoveComments = false;\n\t\t\t\t} else if (type === Type.ForceAdd) {\n\t\t\t\t\t// Will not happen\n\t\t\t\t} else {\n\t\t\t\t\tlineData.ignore = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (shouldRemoveComments && insertSpace) {\n\t\t\t\t// Remove a following space if present\n\t\t\t\tconst commentStrEndOffset = lineContentStartOffset + lineData.commentStrLength;\n\t\t\t\tif (commentStrEndOffset < lineContent.length && lineContent.charCodeAt(commentStrEndOffset) === CharCode.Space) {\n\t\t\t\t\tlineData.commentStrLength += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === Type.Toggle && onlyWhitespaceLines) {\n\t\t\t// For only whitespace lines, we insert comments\n\t\t\tshouldRemoveComments = false;\n\n\t\t\t// Also, no longer ignore them\n\t\t\tfor (let i = 0, lineCount = lines.length; i < lineCount; i++) {\n\t\t\t\tlines[i].ignore = false;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsupported: true,\n\t\t\tshouldRemoveComments: shouldRemoveComments,\n\t\t\tlines: lines\n\t\t};\n\t}\n\n\t/**\n\t * Analyze all lines and decide exactly what to do => not supported | insert line comments | remove line comments\n\t */\n\tpublic static _gatherPreflightData(type: Type, insertSpace: boolean, model: ITextModel, startLineNumber: number, endLineNumber: number, ignoreEmptyLines: boolean, ignoreFirstLine: boolean, languageConfigurationService: ILanguageConfigurationService): IPreflightData {\n\t\tconst lines = LineCommentCommand._gatherPreflightCommentStrings(model, startLineNumber, endLineNumber, languageConfigurationService);\n\t\tif (lines === null) {\n\t\t\treturn {\n\t\t\t\tsupported: false\n\t\t\t};\n\t\t}\n\n\t\treturn LineCommentCommand._analyzeLines(type, insertSpace, model, lines, startLineNumber, ignoreEmptyLines, ignoreFirstLine, languageConfigurationService);\n\t}\n\n\t/**\n\t * Given a successful analysis, execute either insert line comments, either remove line comments\n\t */\n\tprivate _executeLineComments(model: ISimpleModel, builder: IEditOperationBuilder, data: IPreflightDataSupported, s: Selection): void {\n\n\t\tlet ops: ISingleEditOperation[];\n\n\t\tif (data.shouldRemoveComments) {\n\t\t\tops = LineCommentCommand._createRemoveLineCommentsOperations(data.lines, s.startLineNumber);\n\t\t} else {\n\t\t\tLineCommentCommand._normalizeInsertionPoint(model, data.lines, s.startLineNumber, this._tabSize);\n\t\t\tops = this._createAddLineCommentsOperations(data.lines, s.startLineNumber);\n\t\t}\n\n\t\tconst cursorPosition = new Position(s.positionLineNumber, s.positionColumn);\n\n\t\tfor (let i = 0, len = ops.length; i < len; i++) {\n\t\t\tbuilder.addEditOperation(ops[i].range, ops[i].text);\n\t\t\tif (Range.isEmpty(ops[i].range) && Range.getStartPosition(ops[i].range).equals(cursorPosition)) {\n\t\t\t\tconst lineContent = model.getLineContent(cursorPosition.lineNumber);\n\t\t\t\tif (lineContent.length + 1 === cursorPosition.column) {\n\t\t\t\t\tthis._deltaColumn = (ops[i].text || '').length;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._selectionId = builder.trackSelection(s);\n\t}\n\n\tprivate _attemptRemoveBlockComment(model: ITextModel, s: Selection, startToken: string, endToken: string): ISingleEditOperation[] | null {\n\t\tlet startLineNumber = s.startLineNumber;\n\t\tlet endLineNumber = s.endLineNumber;\n\n\t\tlet startTokenAllowedBeforeColumn = endToken.length + Math.max(\n\t\t\tmodel.getLineFirstNonWhitespaceColumn(s.startLineNumber),\n\t\t\ts.startColumn\n\t\t);\n\n\t\tlet startTokenIndex = model.getLineContent(startLineNumber).lastIndexOf(startToken, startTokenAllowedBeforeColumn - 1);\n\t\tlet endTokenIndex = model.getLineContent(endLineNumber).indexOf(endToken, s.endColumn - 1 - startToken.length);\n\n\t\tif (startTokenIndex !== -1 && endTokenIndex === -1) {\n\t\t\tendTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length);\n\t\t\tendLineNumber = startLineNumber;\n\t\t}\n\n\t\tif (startTokenIndex === -1 && endTokenIndex !== -1) {\n\t\t\tstartTokenIndex = model.getLineContent(endLineNumber).lastIndexOf(startToken, endTokenIndex);\n\t\t\tstartLineNumber = endLineNumber;\n\t\t}\n\n\t\tif (s.isEmpty() && (startTokenIndex === -1 || endTokenIndex === -1)) {\n\t\t\tstartTokenIndex = model.getLineContent(startLineNumber).indexOf(startToken);\n\t\t\tif (startTokenIndex !== -1) {\n\t\t\t\tendTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length);\n\t\t\t}\n\t\t}\n\n\t\t// We have to adjust to possible inner white space.\n\t\t// For Space after startToken, add Space to startToken - range math will work out.\n\t\tif (startTokenIndex !== -1 && model.getLineContent(startLineNumber).charCodeAt(startTokenIndex + startToken.length) === CharCode.Space) {\n\t\t\tstartToken += ' ';\n\t\t}\n\n\t\t// For Space before endToken, add Space before endToken and shift index one left.\n\t\tif (endTokenIndex !== -1 && model.getLineContent(endLineNumber).charCodeAt(endTokenIndex - 1) === CharCode.Space) {\n\t\t\tendToken = ' ' + endToken;\n\t\t\tendTokenIndex -= 1;\n\t\t}\n\n\t\tif (startTokenIndex !== -1 && endTokenIndex !== -1) {\n\t\t\treturn BlockCommentCommand._createRemoveBlockCommentOperations(\n\t\t\t\tnew Range(startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Given an unsuccessful analysis, delegate to the block comment command\n\t */\n\tprivate _executeBlockComment(model: ITextModel, builder: IEditOperationBuilder, s: Selection): void {\n\t\tmodel.tokenizeIfCheap(s.startLineNumber);\n\t\tlet languageId = model.getLanguageIdAtPosition(s.startLineNumber, 1);\n\t\tlet config = LanguageConfigurationRegistry.getComments(languageId);\n\t\tif (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) {\n\t\t\t// Mode does not support block comments\n\t\t\treturn;\n\t\t}\n\n\t\tconst startToken = config.blockCommentStartToken;\n\t\tconst endToken = config.blockCommentEndToken;\n\n\t\tlet ops = this._attemptRemoveBlockComment(model, s, startToken, endToken);\n\t\tif (!ops) {\n\t\t\tif (s.isEmpty()) {\n\t\t\t\tconst lineContent = model.getLineContent(s.startLineNumber);\n\t\t\t\tlet firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\t\t\t\tif (firstNonWhitespaceIndex === -1) {\n\t\t\t\t\t// Line is empty or contains only whitespace\n\t\t\t\t\tfirstNonWhitespaceIndex = lineContent.length;\n\t\t\t\t}\n\t\t\t\tops = BlockCommentCommand._createAddBlockCommentOperations(\n\t\t\t\t\tnew Range(s.startLineNumber, firstNonWhitespaceIndex + 1, s.startLineNumber, lineContent.length + 1),\n\t\t\t\t\tstartToken,\n\t\t\t\t\tendToken,\n\t\t\t\t\tthis._insertSpace\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tops = BlockCommentCommand._createAddBlockCommentOperations(\n\t\t\t\t\tnew Range(s.startLineNumber, model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)),\n\t\t\t\t\tstartToken,\n\t\t\t\t\tendToken,\n\t\t\t\t\tthis._insertSpace\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (ops.length === 1) {\n\t\t\t\t// Leave cursor after token and Space\n\t\t\t\tthis._deltaColumn = startToken.length + 1;\n\t\t\t}\n\t\t}\n\t\tthis._selectionId = builder.trackSelection(s);\n\t\tfor (const op of ops) {\n\t\t\tbuilder.addEditOperation(op.range, op.text);\n\t\t}\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\n\t\tlet s = this._selection;\n\t\tthis._moveEndPositionDown = false;\n\n\t\tif (s.startLineNumber === s.endLineNumber && this._ignoreFirstLine) {\n\t\t\tbuilder.addEditOperation(new Range(s.startLineNumber, model.getLineMaxColumn(s.startLineNumber), s.startLineNumber + 1, 1), s.startLineNumber === model.getLineCount() ? '' : '\\n');\n\t\t\tthis._selectionId = builder.trackSelection(s);\n\t\t\treturn;\n\t\t}\n\n\t\tif (s.startLineNumber < s.endLineNumber && s.endColumn === 1) {\n\t\t\tthis._moveEndPositionDown = true;\n\t\t\ts = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1));\n\t\t}\n\n\t\tconst data = LineCommentCommand._gatherPreflightData(\n\t\t\tthis._type,\n\t\t\tthis._insertSpace,\n\t\t\tmodel,\n\t\t\ts.startLineNumber,\n\t\t\ts.endLineNumber,\n\t\t\tthis._ignoreEmptyLines,\n\t\t\tthis._ignoreFirstLine,\n\t\t\tthis.languageConfigurationService\n\t\t);\n\n\t\tif (data.supported) {\n\t\t\treturn this._executeLineComments(model, builder, data, s);\n\t\t}\n\n\t\treturn this._executeBlockComment(model, builder, s);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tlet result = helper.getTrackedSelection(this._selectionId!);\n\n\t\tif (this._moveEndPositionDown) {\n\t\t\tresult = result.setEndPosition(result.endLineNumber + 1, 1);\n\t\t}\n\n\t\treturn new Selection(\n\t\t\tresult.selectionStartLineNumber,\n\t\t\tresult.selectionStartColumn + this._deltaColumn,\n\t\t\tresult.positionLineNumber,\n\t\t\tresult.positionColumn + this._deltaColumn\n\t\t);\n\t}\n\n\t/**\n\t * Generate edit operations in the remove line comment case\n\t */\n\tpublic static _createRemoveLineCommentsOperations(lines: ILinePreflightData[], startLineNumber: number): ISingleEditOperation[] {\n\t\tlet res: ISingleEditOperation[] = [];\n\n\t\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\t\tconst lineData = lines[i];\n\n\t\t\tif (lineData.ignore) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tres.push(EditOperation.delete(new Range(\n\t\t\t\tstartLineNumber + i, lineData.commentStrOffset + 1,\n\t\t\t\tstartLineNumber + i, lineData.commentStrOffset + lineData.commentStrLength + 1\n\t\t\t)));\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Generate edit operations in the add line comment case\n\t */\n\tprivate _createAddLineCommentsOperations(lines: ILinePreflightData[], startLineNumber: number): ISingleEditOperation[] {\n\t\tlet res: ISingleEditOperation[] = [];\n\t\tconst afterCommentStr = this._insertSpace ? ' ' : '';\n\n\n\t\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\t\tconst lineData = lines[i];\n\n\t\t\tif (lineData.ignore) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tres.push(EditOperation.insert(new Position(startLineNumber + i, lineData.commentStrOffset + 1), lineData.commentStr + afterCommentStr));\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tprivate static nextVisibleColumn(currentVisibleColumn: number, tabSize: number, isTab: boolean, columnSize: number): number {\n\t\tif (isTab) {\n\t\t\treturn currentVisibleColumn + (tabSize - (currentVisibleColumn % tabSize));\n\t\t}\n\t\treturn currentVisibleColumn + columnSize;\n\t}\n\n\t/**\n\t * Adjust insertion points to have them vertically aligned in the add line comment case\n\t */\n\tpublic static _normalizeInsertionPoint(model: ISimpleModel, lines: IInsertionPoint[], startLineNumber: number, tabSize: number): void {\n\t\tlet minVisibleColumn = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tlet j: number;\n\t\tlet lenJ: number;\n\n\t\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\t\tif (lines[i].ignore) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst lineContent = model.getLineContent(startLineNumber + i);\n\n\t\t\tlet currentVisibleColumn = 0;\n\t\t\tfor (let j = 0, lenJ = lines[i].commentStrOffset; currentVisibleColumn < minVisibleColumn && j < lenJ; j++) {\n\t\t\t\tcurrentVisibleColumn = LineCommentCommand.nextVisibleColumn(currentVisibleColumn, tabSize, lineContent.charCodeAt(j) === CharCode.Tab, 1);\n\t\t\t}\n\n\t\t\tif (currentVisibleColumn < minVisibleColumn) {\n\t\t\t\tminVisibleColumn = currentVisibleColumn;\n\t\t\t}\n\t\t}\n\n\t\tminVisibleColumn = Math.floor(minVisibleColumn / tabSize) * tabSize;\n\n\t\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\t\tif (lines[i].ignore) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst lineContent = model.getLineContent(startLineNumber + i);\n\n\t\t\tlet currentVisibleColumn = 0;\n\t\t\tfor (j = 0, lenJ = lines[i].commentStrOffset; currentVisibleColumn < minVisibleColumn && j < lenJ; j++) {\n\t\t\t\tcurrentVisibleColumn = LineCommentCommand.nextVisibleColumn(currentVisibleColumn, tabSize, lineContent.charCodeAt(j) === CharCode.Tab, 1);\n\t\t\t}\n\n\t\t\tif (currentVisibleColumn > minVisibleColumn) {\n\t\t\t\tlines[i].commentStrOffset = j - 1;\n\t\t\t} else {\n\t\t\t\tlines[i].commentStrOffset = j;\n\t\t\t}\n\t\t}\n\t}\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 * as strings from 'vs/base/common/strings';\nimport { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';\nimport { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CompleteEnterAction, IndentAction } from 'vs/editor/common/languages/languageConfiguration';\nimport { IIndentConverter, LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { IndentConsts } from 'vs/editor/common/languages/supports/indentRules';\nimport * as indentUtils from 'vs/editor/contrib/indentation/browser/indentUtils';\n\nexport class MoveLinesCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _isMovingDown: boolean;\n\tprivate readonly _autoIndent: EditorAutoIndentStrategy;\n\n\tprivate _selectionId: string | null;\n\tprivate _moveEndPositionDown?: boolean;\n\tprivate _moveEndLineSelectionShrink: boolean;\n\n\tconstructor(selection: Selection, isMovingDown: boolean, autoIndent: EditorAutoIndentStrategy) {\n\t\tthis._selection = selection;\n\t\tthis._isMovingDown = isMovingDown;\n\t\tthis._autoIndent = autoIndent;\n\t\tthis._selectionId = null;\n\t\tthis._moveEndLineSelectionShrink = false;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\n\t\tlet modelLineCount = model.getLineCount();\n\n\t\tif (this._isMovingDown && this._selection.endLineNumber === modelLineCount) {\n\t\t\tthis._selectionId = builder.trackSelection(this._selection);\n\t\t\treturn;\n\t\t}\n\t\tif (!this._isMovingDown && this._selection.startLineNumber === 1) {\n\t\t\tthis._selectionId = builder.trackSelection(this._selection);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._moveEndPositionDown = false;\n\t\tlet s = this._selection;\n\n\t\tif (s.startLineNumber < s.endLineNumber && s.endColumn === 1) {\n\t\t\tthis._moveEndPositionDown = true;\n\t\t\ts = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1));\n\t\t}\n\n\t\tconst { tabSize, indentSize, insertSpaces } = model.getOptions();\n\t\tlet indentConverter = this.buildIndentConverter(tabSize, indentSize, insertSpaces);\n\t\tlet virtualModel = {\n\t\t\tgetLineTokens: (lineNumber: number) => {\n\t\t\t\treturn model.getLineTokens(lineNumber);\n\t\t\t},\n\t\t\tgetLanguageId: () => {\n\t\t\t\treturn model.getLanguageId();\n\t\t\t},\n\t\t\tgetLanguageIdAtPosition: (lineNumber: number, column: number) => {\n\t\t\t\treturn model.getLanguageIdAtPosition(lineNumber, column);\n\t\t\t},\n\t\t\tgetLineContent: null as unknown as (lineNumber: number) => string,\n\t\t};\n\n\t\tif (s.startLineNumber === s.endLineNumber && model.getLineMaxColumn(s.startLineNumber) === 1) {\n\t\t\t// Current line is empty\n\t\t\tlet lineNumber = s.startLineNumber;\n\t\t\tlet otherLineNumber = (this._isMovingDown ? lineNumber + 1 : lineNumber - 1);\n\n\t\t\tif (model.getLineMaxColumn(otherLineNumber) === 1) {\n\t\t\t\t// Other line number is empty too, so no editing is needed\n\t\t\t\t// Add a no-op to force running by the model\n\t\t\t\tbuilder.addEditOperation(new Range(1, 1, 1, 1), null);\n\t\t\t} else {\n\t\t\t\t// Type content from other line number on line number\n\t\t\t\tbuilder.addEditOperation(new Range(lineNumber, 1, lineNumber, 1), model.getLineContent(otherLineNumber));\n\n\t\t\t\t// Remove content from other line number\n\t\t\t\tbuilder.addEditOperation(new Range(otherLineNumber, 1, otherLineNumber, model.getLineMaxColumn(otherLineNumber)), null);\n\t\t\t}\n\t\t\t// Track selection at the other line number\n\t\t\ts = new Selection(otherLineNumber, 1, otherLineNumber, 1);\n\n\t\t} else {\n\n\t\t\tlet movingLineNumber: number;\n\t\t\tlet movingLineText: string;\n\n\t\t\tif (this._isMovingDown) {\n\t\t\t\tmovingLineNumber = s.endLineNumber + 1;\n\t\t\t\tmovingLineText = model.getLineContent(movingLineNumber);\n\t\t\t\t// Delete line that needs to be moved\n\t\t\t\tbuilder.addEditOperation(new Range(movingLineNumber - 1, model.getLineMaxColumn(movingLineNumber - 1), movingLineNumber, model.getLineMaxColumn(movingLineNumber)), null);\n\n\t\t\t\tlet insertingText = movingLineText;\n\n\t\t\t\tif (this.shouldAutoIndent(model, s)) {\n\t\t\t\t\tlet movingLineMatchResult = this.matchEnterRule(model, indentConverter, tabSize, movingLineNumber, s.startLineNumber - 1);\n\t\t\t\t\t// if s.startLineNumber - 1 matches onEnter rule, we still honor that.\n\t\t\t\t\tif (movingLineMatchResult !== null) {\n\t\t\t\t\t\tlet oldIndentation = strings.getLeadingWhitespace(model.getLineContent(movingLineNumber));\n\t\t\t\t\t\tlet newSpaceCnt = movingLineMatchResult + indentUtils.getSpaceCnt(oldIndentation, tabSize);\n\t\t\t\t\t\tlet newIndentation = indentUtils.generateIndent(newSpaceCnt, tabSize, insertSpaces);\n\t\t\t\t\t\tinsertingText = newIndentation + this.trimLeft(movingLineText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// no enter rule matches, let's check indentatin rules then.\n\t\t\t\t\t\tvirtualModel.getLineContent = (lineNumber: number) => {\n\t\t\t\t\t\t\tif (lineNumber === s.startLineNumber) {\n\t\t\t\t\t\t\t\treturn model.getLineContent(movingLineNumber);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn model.getLineContent(lineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tlet indentOfMovingLine = LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(\n\t\t\t\t\t\t\tmovingLineNumber, 1), s.startLineNumber, indentConverter);\n\t\t\t\t\t\tif (indentOfMovingLine !== null) {\n\t\t\t\t\t\t\tlet oldIndentation = strings.getLeadingWhitespace(model.getLineContent(movingLineNumber));\n\t\t\t\t\t\t\tlet newSpaceCnt = indentUtils.getSpaceCnt(indentOfMovingLine, tabSize);\n\t\t\t\t\t\t\tlet oldSpaceCnt = indentUtils.getSpaceCnt(oldIndentation, tabSize);\n\t\t\t\t\t\t\tif (newSpaceCnt !== oldSpaceCnt) {\n\t\t\t\t\t\t\t\tlet newIndentation = indentUtils.generateIndent(newSpaceCnt, tabSize, insertSpaces);\n\t\t\t\t\t\t\t\tinsertingText = newIndentation + this.trimLeft(movingLineText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add edit operations for moving line first to make sure it's executed after we make indentation change\n\t\t\t\t\t// to s.startLineNumber\n\t\t\t\t\tbuilder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\\n');\n\n\t\t\t\t\tlet ret = this.matchEnterRuleMovingDown(model, indentConverter, tabSize, s.startLineNumber, movingLineNumber, insertingText);\n\n\t\t\t\t\t// check if the line being moved before matches onEnter rules, if so let's adjust the indentation by onEnter rules.\n\t\t\t\t\tif (ret !== null) {\n\t\t\t\t\t\tif (ret !== 0) {\n\t\t\t\t\t\t\tthis.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// it doesn't match onEnter rules, let's check indentation rules then.\n\t\t\t\t\t\tvirtualModel.getLineContent = (lineNumber: number) => {\n\t\t\t\t\t\t\tif (lineNumber === s.startLineNumber) {\n\t\t\t\t\t\t\t\treturn insertingText;\n\t\t\t\t\t\t\t} else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) {\n\t\t\t\t\t\t\t\treturn model.getLineContent(lineNumber - 1);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn model.getLineContent(lineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tlet newIndentatOfMovingBlock = LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(\n\t\t\t\t\t\t\tmovingLineNumber, 1), s.startLineNumber + 1, indentConverter);\n\n\t\t\t\t\t\tif (newIndentatOfMovingBlock !== null) {\n\t\t\t\t\t\t\tconst oldIndentation = strings.getLeadingWhitespace(model.getLineContent(s.startLineNumber));\n\t\t\t\t\t\t\tconst newSpaceCnt = indentUtils.getSpaceCnt(newIndentatOfMovingBlock, tabSize);\n\t\t\t\t\t\t\tconst oldSpaceCnt = indentUtils.getSpaceCnt(oldIndentation, tabSize);\n\t\t\t\t\t\t\tif (newSpaceCnt !== oldSpaceCnt) {\n\t\t\t\t\t\t\t\tconst spaceCntOffset = newSpaceCnt - oldSpaceCnt;\n\n\t\t\t\t\t\t\t\tthis.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Insert line that needs to be moved before\n\t\t\t\t\tbuilder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\\n');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmovingLineNumber = s.startLineNumber - 1;\n\t\t\t\tmovingLineText = model.getLineContent(movingLineNumber);\n\n\t\t\t\t// Delete line that needs to be moved\n\t\t\t\tbuilder.addEditOperation(new Range(movingLineNumber, 1, movingLineNumber + 1, 1), null);\n\n\t\t\t\t// Insert line that needs to be moved after\n\t\t\t\tbuilder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\\n' + movingLineText);\n\n\t\t\t\tif (this.shouldAutoIndent(model, s)) {\n\t\t\t\t\tvirtualModel.getLineContent = (lineNumber: number) => {\n\t\t\t\t\t\tif (lineNumber === movingLineNumber) {\n\t\t\t\t\t\t\treturn model.getLineContent(s.startLineNumber);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn model.getLineContent(lineNumber);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tlet ret = this.matchEnterRule(model, indentConverter, tabSize, s.startLineNumber, s.startLineNumber - 2);\n\t\t\t\t\t// check if s.startLineNumber - 2 matches onEnter rules, if so adjust the moving block by onEnter rules.\n\t\t\t\t\tif (ret !== null) {\n\t\t\t\t\t\tif (ret !== 0) {\n\t\t\t\t\t\t\tthis.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// it doesn't match any onEnter rule, let's check indentation rules then.\n\t\t\t\t\t\tlet indentOfFirstLine = LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(s.startLineNumber, 1), movingLineNumber, indentConverter);\n\t\t\t\t\t\tif (indentOfFirstLine !== null) {\n\t\t\t\t\t\t\t// adjust the indentation of the moving block\n\t\t\t\t\t\t\tlet oldIndent = strings.getLeadingWhitespace(model.getLineContent(s.startLineNumber));\n\t\t\t\t\t\t\tlet newSpaceCnt = indentUtils.getSpaceCnt(indentOfFirstLine, tabSize);\n\t\t\t\t\t\t\tlet oldSpaceCnt = indentUtils.getSpaceCnt(oldIndent, tabSize);\n\t\t\t\t\t\t\tif (newSpaceCnt !== oldSpaceCnt) {\n\t\t\t\t\t\t\t\tlet spaceCntOffset = newSpaceCnt - oldSpaceCnt;\n\n\t\t\t\t\t\t\t\tthis.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._selectionId = builder.trackSelection(s);\n\t}\n\n\tprivate buildIndentConverter(tabSize: number, indentSize: number, insertSpaces: boolean): IIndentConverter {\n\t\treturn {\n\t\t\tshiftIndent: (indentation) => {\n\t\t\t\treturn ShiftCommand.shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces);\n\t\t\t},\n\t\t\tunshiftIndent: (indentation) => {\n\t\t\t\treturn ShiftCommand.unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate parseEnterResult(model: ITextModel, indentConverter: IIndentConverter, tabSize: number, line: number, enter: CompleteEnterAction | null) {\n\t\tif (enter) {\n\t\t\tlet enterPrefix = enter.indentation;\n\n\t\t\tif (enter.indentAction === IndentAction.None) {\n\t\t\t\tenterPrefix = enter.indentation + enter.appendText;\n\t\t\t} else if (enter.indentAction === IndentAction.Indent) {\n\t\t\t\tenterPrefix = enter.indentation + enter.appendText;\n\t\t\t} else if (enter.indentAction === IndentAction.IndentOutdent) {\n\t\t\t\tenterPrefix = enter.indentation;\n\t\t\t} else if (enter.indentAction === IndentAction.Outdent) {\n\t\t\t\tenterPrefix = indentConverter.unshiftIndent(enter.indentation) + enter.appendText;\n\t\t\t}\n\t\t\tlet movingLineText = model.getLineContent(line);\n\t\t\tif (this.trimLeft(movingLineText).indexOf(this.trimLeft(enterPrefix)) >= 0) {\n\t\t\t\tlet oldIndentation = strings.getLeadingWhitespace(model.getLineContent(line));\n\t\t\t\tlet newIndentation = strings.getLeadingWhitespace(enterPrefix);\n\t\t\t\tlet indentMetadataOfMovelingLine = LanguageConfigurationRegistry.getIndentMetadata(model, line);\n\t\t\t\tif (indentMetadataOfMovelingLine !== null && indentMetadataOfMovelingLine & IndentConsts.DECREASE_MASK) {\n\t\t\t\t\tnewIndentation = indentConverter.unshiftIndent(newIndentation);\n\t\t\t\t}\n\t\t\t\tlet newSpaceCnt = indentUtils.getSpaceCnt(newIndentation, tabSize);\n\t\t\t\tlet oldSpaceCnt = indentUtils.getSpaceCnt(oldIndentation, tabSize);\n\t\t\t\treturn newSpaceCnt - oldSpaceCnt;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t *\n\t * @param model\n\t * @param indentConverter\n\t * @param tabSize\n\t * @param line the line moving down\n\t * @param futureAboveLineNumber the line which will be at the `line` position\n\t * @param futureAboveLineText\n\t */\n\tprivate matchEnterRuleMovingDown(model: ITextModel, indentConverter: IIndentConverter, tabSize: number, line: number, futureAboveLineNumber: number, futureAboveLineText: string) {\n\t\tif (strings.lastNonWhitespaceIndex(futureAboveLineText) >= 0) {\n\t\t\t// break\n\t\t\tlet maxColumn = model.getLineMaxColumn(futureAboveLineNumber);\n\t\t\tlet enter = LanguageConfigurationRegistry.getEnterAction(this._autoIndent, model, new Range(futureAboveLineNumber, maxColumn, futureAboveLineNumber, maxColumn));\n\t\t\treturn this.parseEnterResult(model, indentConverter, tabSize, line, enter);\n\t\t} else {\n\t\t\t// go upwards, starting from `line - 1`\n\t\t\tlet validPrecedingLine = line - 1;\n\t\t\twhile (validPrecedingLine >= 1) {\n\t\t\t\tlet lineContent = model.getLineContent(validPrecedingLine);\n\t\t\t\tlet nonWhitespaceIdx = strings.lastNonWhitespaceIndex(lineContent);\n\n\t\t\t\tif (nonWhitespaceIdx >= 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvalidPrecedingLine--;\n\t\t\t}\n\n\t\t\tif (validPrecedingLine < 1 || line > model.getLineCount()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet maxColumn = model.getLineMaxColumn(validPrecedingLine);\n\t\t\tlet enter = LanguageConfigurationRegistry.getEnterAction(this._autoIndent, model, new Range(validPrecedingLine, maxColumn, validPrecedingLine, maxColumn));\n\t\t\treturn this.parseEnterResult(model, indentConverter, tabSize, line, enter);\n\t\t}\n\t}\n\n\tprivate matchEnterRule(model: ITextModel, indentConverter: IIndentConverter, tabSize: number, line: number, oneLineAbove: number, previousLineText?: string) {\n\t\tlet validPrecedingLine = oneLineAbove;\n\t\twhile (validPrecedingLine >= 1) {\n\t\t\t// ship empty lines as empty lines just inherit indentation\n\t\t\tlet lineContent;\n\t\t\tif (validPrecedingLine === oneLineAbove && previousLineText !== undefined) {\n\t\t\t\tlineContent = previousLineText;\n\t\t\t} else {\n\t\t\t\tlineContent = model.getLineContent(validPrecedingLine);\n\t\t\t}\n\n\t\t\tlet nonWhitespaceIdx = strings.lastNonWhitespaceIndex(lineContent);\n\t\t\tif (nonWhitespaceIdx >= 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvalidPrecedingLine--;\n\t\t}\n\n\t\tif (validPrecedingLine < 1 || line > model.getLineCount()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet maxColumn = model.getLineMaxColumn(validPrecedingLine);\n\t\tlet enter = LanguageConfigurationRegistry.getEnterAction(this._autoIndent, model, new Range(validPrecedingLine, maxColumn, validPrecedingLine, maxColumn));\n\t\treturn this.parseEnterResult(model, indentConverter, tabSize, line, enter);\n\t}\n\n\tprivate trimLeft(str: string) {\n\t\treturn str.replace(/^\\s+/, '');\n\t}\n\n\tprivate shouldAutoIndent(model: ITextModel, selection: Selection) {\n\t\tif (this._autoIndent < EditorAutoIndentStrategy.Full) {\n\t\t\treturn false;\n\t\t}\n\t\t// if it's not easy to tokenize, we stop auto indent.\n\t\tif (!model.isCheapToTokenize(selection.startLineNumber)) {\n\t\t\treturn false;\n\t\t}\n\t\tlet languageAtSelectionStart = model.getLanguageIdAtPosition(selection.startLineNumber, 1);\n\t\tlet languageAtSelectionEnd = model.getLanguageIdAtPosition(selection.endLineNumber, 1);\n\n\t\tif (languageAtSelectionStart !== languageAtSelectionEnd) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (LanguageConfigurationRegistry.getIndentRulesSupport(languageAtSelectionStart) === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate getIndentEditsOfMovingBlock(model: ITextModel, builder: IEditOperationBuilder, s: Selection, tabSize: number, insertSpaces: boolean, offset: number) {\n\t\tfor (let i = s.startLineNumber; i <= s.endLineNumber; i++) {\n\t\t\tlet lineContent = model.getLineContent(i);\n\t\t\tlet originalIndent = strings.getLeadingWhitespace(lineContent);\n\t\t\tlet originalSpacesCnt = indentUtils.getSpaceCnt(originalIndent, tabSize);\n\t\t\tlet newSpacesCnt = originalSpacesCnt + offset;\n\t\t\tlet newIndent = indentUtils.generateIndent(newSpacesCnt, tabSize, insertSpaces);\n\n\t\t\tif (newIndent !== originalIndent) {\n\t\t\t\tbuilder.addEditOperation(new Range(i, 1, i, originalIndent.length + 1), newIndent);\n\n\t\t\t\tif (i === s.endLineNumber && s.endColumn <= originalIndent.length + 1 && newIndent === '') {\n\t\t\t\t\t// as users select part of the original indent white spaces\n\t\t\t\t\t// when we adjust the indentation of endLine, we should adjust the cursor position as well.\n\t\t\t\t\tthis._moveEndLineSelectionShrink = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tlet result = helper.getTrackedSelection(this._selectionId!);\n\n\t\tif (this._moveEndPositionDown) {\n\t\t\tresult = result.setEndPosition(result.endLineNumber + 1, 1);\n\t\t}\n\n\t\tif (this._moveEndLineSelectionShrink && result.startLineNumber < result.endLineNumber) {\n\t\t\tresult = result.setEndPosition(result.endLineNumber, 2);\n\t\t}\n\n\t\treturn result;\n\t}\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 'vs/base/common/event';\nimport { isChrome, isEdge, isFirefox, isLinux, isMacintosh, isSafari, isWeb, isWindows } from 'vs/base/common/platform';\nimport { isFalsyOrWhitespace } from 'vs/base/common/strings';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nconst CONSTANT_VALUES = new Map<string, boolean>();\nCONSTANT_VALUES.set('false', false);\nCONSTANT_VALUES.set('true', true);\nCONSTANT_VALUES.set('isMac', isMacintosh);\nCONSTANT_VALUES.set('isLinux', isLinux);\nCONSTANT_VALUES.set('isWindows', isWindows);\nCONSTANT_VALUES.set('isWeb', isWeb);\nCONSTANT_VALUES.set('isMacNative', isMacintosh && !isWeb);\nCONSTANT_VALUES.set('isEdge', isEdge);\nCONSTANT_VALUES.set('isFirefox', isFirefox);\nCONSTANT_VALUES.set('isChrome', isChrome);\nCONSTANT_VALUES.set('isSafari', isSafari);\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\nexport const enum ContextKeyExprType {\n\tFalse = 0,\n\tTrue = 1,\n\tDefined = 2,\n\tNot = 3,\n\tEquals = 4,\n\tNotEquals = 5,\n\tAnd = 6,\n\tRegex = 7,\n\tNotRegex = 8,\n\tOr = 9,\n\tIn = 10,\n\tNotIn = 11,\n\tGreater = 12,\n\tGreaterEquals = 13,\n\tSmaller = 14,\n\tSmallerEquals = 15,\n}\n\nexport interface IContextKeyExpression {\n\n}\n\nexport type ContextKeyExpression = (\n\tContextKeyFalseExpr | ContextKeyTrueExpr | ContextKeyDefinedExpr | ContextKeyNotExpr\n\t| ContextKeyEqualsExpr | ContextKeyNotEqualsExpr | ContextKeyRegexExpr\n\t| ContextKeyNotRegexExpr | ContextKeyAndExpr | ContextKeyOrExpr | ContextKeyInExpr\n\t| ContextKeyNotInExpr | ContextKeyGreaterExpr | ContextKeyGreaterEqualsExpr\n\t| ContextKeySmallerExpr | ContextKeySmallerEqualsExpr\n);\n\nexport abstract class ContextKeyExpr {\n\tpublic static has(key: string): ContextKeyExpression {\n\t\treturn ContextKeyDefinedExpr.create(key);\n\t}\n\tpublic static equals(key: string, value: any): ContextKeyExpression {\n\t\treturn ContextKeyEqualsExpr.create(key, value);\n\t}\n\tpublic static regex(key: string, value: RegExp): ContextKeyExpression {\n\t\treturn ContextKeyRegexExpr.create(key, value);\n\t}\n\tpublic static not(key: string): ContextKeyExpression {\n\t\treturn ContextKeyNotExpr.create(key);\n\t}\n\tpublic static and(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined {\n\t\treturn ContextKeyAndExpr.create(expr, null);\n\t}\n\tpublic static or(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined {\n\t\treturn ContextKeyOrExpr.create(expr, null, true);\n\t}\n\n\tpublic static deserialize(serialized: string | null | undefined, strict: boolean = false): ContextKeyExpression | undefined {\n\t\tif (!serialized) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this._deserializeOrExpression(serialized, strict);\n\t}\n\n\tprivate static _deserializeOrExpression(serialized: string, strict: boolean): ContextKeyExpression | undefined {\n\t\tlet pieces = serialized.split('||');\n\t\treturn ContextKeyOrExpr.create(pieces.map(p => this._deserializeAndExpression(p, strict)), null, true);\n\t}\n\n\tprivate static _deserializeAndExpression(serialized: string, strict: boolean): ContextKeyExpression | undefined {\n\t\tlet pieces = serialized.split('&&');\n\t\treturn ContextKeyAndExpr.create(pieces.map(p => this._deserializeOne(p, strict)), null);\n\t}\n\n\tprivate static _deserializeOne(serializedOne: string, strict: boolean): ContextKeyExpression {\n\t\tserializedOne = serializedOne.trim();\n\n\t\tif (serializedOne.indexOf('!=') >= 0) {\n\t\t\tlet pieces = serializedOne.split('!=');\n\t\t\treturn ContextKeyNotEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict));\n\t\t}\n\n\t\tif (serializedOne.indexOf('==') >= 0) {\n\t\t\tlet pieces = serializedOne.split('==');\n\t\t\treturn ContextKeyEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict));\n\t\t}\n\n\t\tif (serializedOne.indexOf('=~') >= 0) {\n\t\t\tlet pieces = serializedOne.split('=~');\n\t\t\treturn ContextKeyRegexExpr.create(pieces[0].trim(), this._deserializeRegexValue(pieces[1], strict));\n\t\t}\n\n\t\tif (serializedOne.indexOf(' in ') >= 0) {\n\t\t\tlet pieces = serializedOne.split(' in ');\n\t\t\treturn ContextKeyInExpr.create(pieces[0].trim(), pieces[1].trim());\n\t\t}\n\n\t\tif (/^[^<=>]+>=[^<=>]+$/.test(serializedOne)) {\n\t\t\tconst pieces = serializedOne.split('>=');\n\t\t\treturn ContextKeyGreaterEqualsExpr.create(pieces[0].trim(), pieces[1].trim());\n\t\t}\n\n\t\tif (/^[^<=>]+>[^<=>]+$/.test(serializedOne)) {\n\t\t\tconst pieces = serializedOne.split('>');\n\t\t\treturn ContextKeyGreaterExpr.create(pieces[0].trim(), pieces[1].trim());\n\t\t}\n\n\t\tif (/^[^<=>]+<=[^<=>]+$/.test(serializedOne)) {\n\t\t\tconst pieces = serializedOne.split('<=');\n\t\t\treturn ContextKeySmallerEqualsExpr.create(pieces[0].trim(), pieces[1].trim());\n\t\t}\n\n\t\tif (/^[^<=>]+<[^<=>]+$/.test(serializedOne)) {\n\t\t\tconst pieces = serializedOne.split('<');\n\t\t\treturn ContextKeySmallerExpr.create(pieces[0].trim(), pieces[1].trim());\n\t\t}\n\n\t\tif (/^\\!\\s*/.test(serializedOne)) {\n\t\t\treturn ContextKeyNotExpr.create(serializedOne.substr(1).trim());\n\t\t}\n\n\t\treturn ContextKeyDefinedExpr.create(serializedOne);\n\t}\n\n\tprivate static _deserializeValue(serializedValue: string, strict: boolean): any {\n\t\tserializedValue = serializedValue.trim();\n\n\t\tif (serializedValue === 'true') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (serializedValue === 'false') {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet m = /^'([^']*)'$/.exec(serializedValue);\n\t\tif (m) {\n\t\t\treturn m[1].trim();\n\t\t}\n\n\t\treturn serializedValue;\n\t}\n\n\tprivate static _deserializeRegexValue(serializedValue: string, strict: boolean): RegExp | null {\n\n\t\tif (isFalsyOrWhitespace(serializedValue)) {\n\t\t\tif (strict) {\n\t\t\t\tthrow new Error('missing regexp-value for =~-expression');\n\t\t\t} else {\n\t\t\t\tconsole.warn('missing regexp-value for =~-expression');\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tlet start = serializedValue.indexOf('/');\n\t\tlet end = serializedValue.lastIndexOf('/');\n\t\tif (start === end || start < 0 /* || to < 0 */) {\n\t\t\tif (strict) {\n\t\t\t\tthrow new Error(`bad regexp-value '${serializedValue}', missing /-enclosure`);\n\t\t\t} else {\n\t\t\t\tconsole.warn(`bad regexp-value '${serializedValue}', missing /-enclosure`);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = serializedValue.slice(start + 1, end);\n\t\tlet caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : '';\n\t\ttry {\n\t\t\treturn new RegExp(value, caseIgnoreFlag);\n\t\t} catch (e) {\n\t\t\tif (strict) {\n\t\t\t\tthrow new Error(`bad regexp-value '${serializedValue}', parse error: ${e}`);\n\t\t\t} else {\n\t\t\t\tconsole.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\nexport function expressionsAreEqualWithConstantSubstitution(a: ContextKeyExpression | null | undefined, b: ContextKeyExpression | null | undefined): boolean {\n\tconst aExpr = a ? a.substituteConstants() : undefined;\n\tconst bExpr = b ? b.substituteConstants() : undefined;\n\tif (!aExpr && !bExpr) {\n\t\treturn true;\n\t}\n\tif (!aExpr || !bExpr) {\n\t\treturn false;\n\t}\n\treturn aExpr.equals(bExpr);\n}\n\nfunction cmp(a: ContextKeyExpression, b: ContextKeyExpression): number {\n\treturn a.cmp(b);\n}\n\nexport class ContextKeyFalseExpr implements IContextKeyExpression {\n\tpublic static INSTANCE = new ContextKeyFalseExpr();\n\n\tpublic readonly type = ContextKeyExprType.False;\n\n\tprotected constructor() {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\treturn this.type - other.type;\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\treturn (other.type === this.type);\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn false;\n\t}\n\n\tpublic serialize(): string {\n\t\treturn 'false';\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\treturn ContextKeyTrueExpr.INSTANCE;\n\t}\n}\n\nexport class ContextKeyTrueExpr implements IContextKeyExpression {\n\tpublic static INSTANCE = new ContextKeyTrueExpr();\n\n\tpublic readonly type = ContextKeyExprType.True;\n\n\tprotected constructor() {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\treturn this.type - other.type;\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\treturn (other.type === this.type);\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn true;\n\t}\n\n\tpublic serialize(): string {\n\t\treturn 'true';\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\treturn ContextKeyFalseExpr.INSTANCE;\n\t}\n}\n\nexport class ContextKeyDefinedExpr implements IContextKeyExpression {\n\tpublic static create(key: string, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\tconst constantValue = CONSTANT_VALUES.get(key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\treturn constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;\n\t\t}\n\t\treturn new ContextKeyDefinedExpr(key, negated);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Defined;\n\n\tprotected constructor(\n\t\treadonly key: string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp1(this.key, other.key);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst constantValue = CONSTANT_VALUES.get(this.key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\treturn constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn (!!context.getValue(this.key));\n\t}\n\n\tpublic serialize(): string {\n\t\treturn this.key;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyNotExpr.create(this.key, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyEqualsExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\tif (typeof value === 'boolean') {\n\t\t\treturn (value ? ContextKeyDefinedExpr.create(key, negated) : ContextKeyNotExpr.create(key, negated));\n\t\t}\n\t\tconst constantValue = CONSTANT_VALUES.get(key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\tconst trueValue = constantValue ? 'true' : 'false';\n\t\t\treturn (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);\n\t\t}\n\t\treturn new ContextKeyEqualsExpr(key, value, negated);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Equals;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: any,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst constantValue = CONSTANT_VALUES.get(this.key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\tconst trueValue = constantValue ? 'true' : 'false';\n\t\t\treturn (this.value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\t// Intentional ==\n\t\t// eslint-disable-next-line eqeqeq\n\t\treturn (context.getValue(this.key) == this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} == '${this.value}'`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyNotEqualsExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyInExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, valueKey: string): ContextKeyInExpr {\n\t\treturn new ContextKeyInExpr(key, valueKey);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.In;\n\tprivate negated: ContextKeyExpression | null = null;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly valueKey: string,\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.valueKey, other.key, other.valueKey);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.valueKey === other.valueKey);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tconst source = context.getValue(this.valueKey);\n\n\t\tconst item = context.getValue(this.key);\n\n\t\tif (Array.isArray(source)) {\n\t\t\treturn (source.indexOf(item) >= 0);\n\t\t}\n\n\t\tif (typeof item === 'string' && typeof source === 'object' && source !== null) {\n\t\t\treturn hasOwnProperty.call(source, item);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} in '${this.valueKey}'`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key, this.valueKey];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyNotInExpr.create(this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyNotInExpr implements IContextKeyExpression {\n\n\tpublic static create(actual: ContextKeyInExpr): ContextKeyNotInExpr {\n\t\treturn new ContextKeyNotInExpr(actual);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.NotIn;\n\n\tprivate constructor(private readonly _actual: ContextKeyInExpr) {\n\t\t//\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn this._actual.cmp(other._actual);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn this._actual.equals(other._actual);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn !this._actual.evaluate(context);\n\t}\n\n\tpublic serialize(): string {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn this._actual.keys();\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\treturn this._actual;\n\t}\n}\n\nexport class ContextKeyNotEqualsExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\tif (typeof value === 'boolean') {\n\t\t\tif (value) {\n\t\t\t\treturn ContextKeyNotExpr.create(key, negated);\n\t\t\t}\n\t\t\treturn ContextKeyDefinedExpr.create(key, negated);\n\t\t}\n\t\tconst constantValue = CONSTANT_VALUES.get(key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\tconst falseValue = constantValue ? 'true' : 'false';\n\t\t\treturn (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n\t\t}\n\t\treturn new ContextKeyNotEqualsExpr(key, value, negated);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.NotEquals;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: any,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst constantValue = CONSTANT_VALUES.get(this.key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\tconst falseValue = constantValue ? 'true' : 'false';\n\t\t\treturn (this.value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\t// Intentional !=\n\t\t// eslint-disable-next-line eqeqeq\n\t\treturn (context.getValue(this.key) != this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} != '${this.value}'`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyEqualsExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyNotExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\tconst constantValue = CONSTANT_VALUES.get(key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\treturn (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n\t\t}\n\t\treturn new ContextKeyNotExpr(key, negated);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Not;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp1(this.key, other.key);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst constantValue = CONSTANT_VALUES.get(this.key);\n\t\tif (typeof constantValue === 'boolean') {\n\t\t\treturn (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn (!context.getValue(this.key));\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `!${this.key}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyDefinedExpr.create(this.key, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nfunction withFloatOrStr<T extends ContextKeyExpression>(value: any, callback: (value: number | string) => T): T | ContextKeyFalseExpr {\n\tif (typeof value === 'string') {\n\t\tconst n = parseFloat(value);\n\t\tif (!isNaN(n)) {\n\t\t\tvalue = n;\n\t\t}\n\t}\n\tif (typeof value === 'string' || typeof value === 'number') {\n\t\treturn callback(value);\n\t}\n\treturn ContextKeyFalseExpr.INSTANCE;\n}\n\nexport class ContextKeyGreaterExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, _value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\treturn withFloatOrStr(_value, (value) => new ContextKeyGreaterExpr(key, value, negated));\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Greater;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: number | string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) { }\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\treturn (parseFloat(<any>context.getValue(this.key)) > this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} > ${this.value}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeySmallerEqualsExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyGreaterEqualsExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, _value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\treturn withFloatOrStr(_value, (value) => new ContextKeyGreaterEqualsExpr(key, value, negated));\n\t}\n\n\tpublic readonly type = ContextKeyExprType.GreaterEquals;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: number | string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) { }\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\treturn (parseFloat(<any>context.getValue(this.key)) >= this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} >= ${this.value}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeySmallerExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeySmallerExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, _value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\treturn withFloatOrStr(_value, (value) => new ContextKeySmallerExpr(key, value, negated));\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Smaller;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: number | string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\treturn (parseFloat(<any>context.getValue(this.key)) < this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} < ${this.value}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyGreaterEqualsExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeySmallerEqualsExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, _value: any, negated: ContextKeyExpression | null = null): ContextKeyExpression {\n\t\treturn withFloatOrStr(_value, (value) => new ContextKeySmallerEqualsExpr(key, value, negated));\n\t}\n\n\tpublic readonly type = ContextKeyExprType.SmallerEquals;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly value: number | string,\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn cmp2(this.key, this.value, other.key, other.value);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\treturn (parseFloat(<any>context.getValue(this.key)) <= this.value);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn `${this.key} <= ${this.value}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyGreaterExpr.create(this.key, this.value, this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyRegexExpr implements IContextKeyExpression {\n\n\tpublic static create(key: string, regexp: RegExp | null): ContextKeyRegexExpr {\n\t\treturn new ContextKeyRegexExpr(key, regexp);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Regex;\n\tprivate negated: ContextKeyExpression | null = null;\n\n\tprivate constructor(\n\t\tprivate readonly key: string,\n\t\tprivate readonly regexp: RegExp | null\n\t) {\n\t\t//\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\tif (this.key < other.key) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (this.key > other.key) {\n\t\t\treturn 1;\n\t\t}\n\t\tconst thisSource = this.regexp ? this.regexp.source : '';\n\t\tconst otherSource = other.regexp ? other.regexp.source : '';\n\t\tif (thisSource < otherSource) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (thisSource > otherSource) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\tconst thisSource = this.regexp ? this.regexp.source : '';\n\t\t\tconst otherSource = other.regexp ? other.regexp.source : '';\n\t\t\treturn (this.key === other.key && thisSource === otherSource);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tlet value = context.getValue<any>(this.key);\n\t\treturn this.regexp ? this.regexp.test(value) : false;\n\t}\n\n\tpublic serialize(): string {\n\t\tconst value = this.regexp\n\t\t\t? `/${this.regexp.source}/${this.regexp.ignoreCase ? 'i' : ''}`\n\t\t\t: '/invalid/';\n\t\treturn `${this.key} =~ ${value}`;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tthis.negated = ContextKeyNotRegexExpr.create(this);\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport class ContextKeyNotRegexExpr implements IContextKeyExpression {\n\n\tpublic static create(actual: ContextKeyRegexExpr): ContextKeyExpression {\n\t\treturn new ContextKeyNotRegexExpr(actual);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.NotRegex;\n\n\tprivate constructor(private readonly _actual: ContextKeyRegexExpr) {\n\t\t//\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\treturn this._actual.cmp(other._actual);\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\treturn this._actual.equals(other._actual);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\treturn this;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn !this._actual.evaluate(context);\n\t}\n\n\tpublic serialize(): string {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn this._actual.keys();\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\treturn this._actual;\n\t}\n}\n\n/**\n * @returns the same instance if nothing changed.\n */\nfunction eliminateConstantsInArray(arr: ContextKeyExpression[]): (ContextKeyExpression | undefined)[] {\n\t// Allocate array only if there is a difference\n\tlet newArr: (ContextKeyExpression | undefined)[] | null = null;\n\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\tconst newExpr = arr[i].substituteConstants();\n\n\t\tif (arr[i] !== newExpr) {\n\t\t\t// something has changed!\n\n\t\t\t// allocate array on first difference\n\t\t\tif (newArr === null) {\n\t\t\t\tnewArr = [];\n\t\t\t\tfor (let j = 0; j < i; j++) {\n\t\t\t\t\tnewArr[j] = arr[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (newArr !== null) {\n\t\t\tnewArr[i] = newExpr;\n\t\t}\n\t}\n\n\tif (newArr === null) {\n\t\treturn arr;\n\t}\n\treturn newArr;\n}\n\nclass ContextKeyAndExpr implements IContextKeyExpression {\n\n\tpublic static create(_expr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null): ContextKeyExpression | undefined {\n\t\treturn ContextKeyAndExpr._normalizeArr(_expr, negated);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.And;\n\n\tprivate constructor(\n\t\tpublic readonly expr: ContextKeyExpression[],\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\tif (this.expr.length < other.expr.length) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (this.expr.length > other.expr.length) {\n\t\t\treturn 1;\n\t\t}\n\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\tconst r = cmp(this.expr[i], other.expr[i]);\n\t\t\tif (r !== 0) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\tif (this.expr.length !== other.expr.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\t\tif (!this.expr[i].equals(other.expr[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst exprArr = eliminateConstantsInArray(this.expr);\n\t\tif (exprArr === this.expr) {\n\t\t\t// no change\n\t\t\treturn this;\n\t\t}\n\t\treturn ContextKeyAndExpr.create(exprArr, this.negated);\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\tif (!this.expr[i].evaluate(context)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate static _normalizeArr(arr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null): ContextKeyExpression | undefined {\n\t\tconst expr: ContextKeyExpression[] = [];\n\t\tlet hasTrue = false;\n\n\t\tfor (const e of arr) {\n\t\t\tif (!e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (e.type === ContextKeyExprType.True) {\n\t\t\t\t// anything && true ==> anything\n\t\t\t\thasTrue = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (e.type === ContextKeyExprType.False) {\n\t\t\t\t// anything && false ==> false\n\t\t\t\treturn ContextKeyFalseExpr.INSTANCE;\n\t\t\t}\n\n\t\t\tif (e.type === ContextKeyExprType.And) {\n\t\t\t\texpr.push(...e.expr);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\texpr.push(e);\n\t\t}\n\n\t\tif (expr.length === 0 && hasTrue) {\n\t\t\treturn ContextKeyTrueExpr.INSTANCE;\n\t\t}\n\n\t\tif (expr.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (expr.length === 1) {\n\t\t\treturn expr[0];\n\t\t}\n\n\t\texpr.sort(cmp);\n\n\t\t// eliminate duplicate terms\n\t\tfor (let i = 1; i < expr.length; i++) {\n\t\t\tif (expr[i - 1].equals(expr[i])) {\n\t\t\t\texpr.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tif (expr.length === 1) {\n\t\t\treturn expr[0];\n\t\t}\n\n\t\t// We must distribute any OR expression because we don't support parens\n\t\t// OR extensions will be at the end (due to sorting rules)\n\t\twhile (expr.length > 1) {\n\t\t\tconst lastElement = expr[expr.length - 1];\n\t\t\tif (lastElement.type !== ContextKeyExprType.Or) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// pop the last element\n\t\t\texpr.pop();\n\n\t\t\t// pop the second to last element\n\t\t\tconst secondToLastElement = expr.pop()!;\n\n\t\t\tconst isFinished = (expr.length === 0);\n\n\t\t\t// distribute `lastElement` over `secondToLastElement`\n\t\t\tconst resultElement = ContextKeyOrExpr.create(\n\t\t\t\tlastElement.expr.map(el => ContextKeyAndExpr.create([el, secondToLastElement], null)),\n\t\t\t\tnull,\n\t\t\t\tisFinished\n\t\t\t);\n\n\t\t\tif (resultElement) {\n\t\t\t\texpr.push(resultElement);\n\t\t\t\texpr.sort(cmp);\n\t\t\t}\n\t\t}\n\n\t\tif (expr.length === 1) {\n\t\t\treturn expr[0];\n\t\t}\n\n\t\treturn new ContextKeyAndExpr(expr, negated);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn this.expr.map(e => e.serialize()).join(' && ');\n\t}\n\n\tpublic keys(): string[] {\n\t\tconst result: string[] = [];\n\t\tfor (let expr of this.expr) {\n\t\t\tresult.push(...expr.keys());\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tconst result: ContextKeyExpression[] = [];\n\t\t\tfor (let expr of this.expr) {\n\t\t\t\tresult.push(expr.negate());\n\t\t\t}\n\t\t\tthis.negated = ContextKeyOrExpr.create(result, this, true)!;\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nclass ContextKeyOrExpr implements IContextKeyExpression {\n\n\tpublic static create(_expr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null, extraRedundantCheck: boolean): ContextKeyExpression | undefined {\n\t\treturn ContextKeyOrExpr._normalizeArr(_expr, negated, extraRedundantCheck);\n\t}\n\n\tpublic readonly type = ContextKeyExprType.Or;\n\n\tprivate constructor(\n\t\tpublic readonly expr: ContextKeyExpression[],\n\t\tprivate negated: ContextKeyExpression | null\n\t) {\n\t}\n\n\tpublic cmp(other: ContextKeyExpression): number {\n\t\tif (other.type !== this.type) {\n\t\t\treturn this.type - other.type;\n\t\t}\n\t\tif (this.expr.length < other.expr.length) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (this.expr.length > other.expr.length) {\n\t\t\treturn 1;\n\t\t}\n\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\tconst r = cmp(this.expr[i], other.expr[i]);\n\t\t\tif (r !== 0) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpression): boolean {\n\t\tif (other.type === this.type) {\n\t\t\tif (this.expr.length !== other.expr.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\t\tif (!this.expr[i].equals(other.expr[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic substituteConstants(): ContextKeyExpression | undefined {\n\t\tconst exprArr = eliminateConstantsInArray(this.expr);\n\t\tif (exprArr === this.expr) {\n\t\t\t// no change\n\t\t\treturn this;\n\t\t}\n\t\treturn ContextKeyOrExpr.create(exprArr, this.negated, false);\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\tfor (let i = 0, len = this.expr.length; i < len; i++) {\n\t\t\tif (this.expr[i].evaluate(context)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate static _normalizeArr(arr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null, extraRedundantCheck: boolean): ContextKeyExpression | undefined {\n\t\tlet expr: ContextKeyExpression[] = [];\n\t\tlet hasFalse = false;\n\n\t\tif (arr) {\n\t\t\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\t\t\tconst e = arr[i];\n\t\t\t\tif (!e) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (e.type === ContextKeyExprType.False) {\n\t\t\t\t\t// anything || false ==> anything\n\t\t\t\t\thasFalse = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (e.type === ContextKeyExprType.True) {\n\t\t\t\t\t// anything || true ==> true\n\t\t\t\t\treturn ContextKeyTrueExpr.INSTANCE;\n\t\t\t\t}\n\n\t\t\t\tif (e.type === ContextKeyExprType.Or) {\n\t\t\t\t\texpr = expr.concat(e.expr);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\texpr.push(e);\n\t\t\t}\n\n\t\t\tif (expr.length === 0 && hasFalse) {\n\t\t\t\treturn ContextKeyFalseExpr.INSTANCE;\n\t\t\t}\n\n\t\t\texpr.sort(cmp);\n\t\t}\n\n\t\tif (expr.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (expr.length === 1) {\n\t\t\treturn expr[0];\n\t\t}\n\n\t\t// eliminate duplicate terms\n\t\tfor (let i = 1; i < expr.length; i++) {\n\t\t\tif (expr[i - 1].equals(expr[i])) {\n\t\t\t\texpr.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tif (expr.length === 1) {\n\t\t\treturn expr[0];\n\t\t}\n\n\t\t// eliminate redundant terms\n\t\tif (extraRedundantCheck) {\n\t\t\tfor (let i = 0; i < expr.length; i++) {\n\t\t\t\tfor (let j = i + 1; j < expr.length; j++) {\n\t\t\t\t\tif (implies(expr[i], expr[j])) {\n\t\t\t\t\t\texpr.splice(j, 1);\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.length === 1) {\n\t\t\t\treturn expr[0];\n\t\t\t}\n\t\t}\n\n\t\treturn new ContextKeyOrExpr(expr, negated);\n\t}\n\n\tpublic serialize(): string {\n\t\treturn this.expr.map(e => e.serialize()).join(' || ');\n\t}\n\n\tpublic keys(): string[] {\n\t\tconst result: string[] = [];\n\t\tfor (let expr of this.expr) {\n\t\t\tresult.push(...expr.keys());\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic negate(): ContextKeyExpression {\n\t\tif (!this.negated) {\n\t\t\tlet result: ContextKeyExpression[] = [];\n\t\t\tfor (let expr of this.expr) {\n\t\t\t\tresult.push(expr.negate());\n\t\t\t}\n\n\t\t\t// We don't support parens, so here we distribute the AND over the OR terminals\n\t\t\t// We always take the first 2 AND pairs and distribute them\n\t\t\twhile (result.length > 1) {\n\t\t\t\tconst LEFT = result.shift()!;\n\t\t\t\tconst RIGHT = result.shift()!;\n\n\t\t\t\tconst all: ContextKeyExpression[] = [];\n\t\t\t\tfor (const left of getTerminals(LEFT)) {\n\t\t\t\t\tfor (const right of getTerminals(RIGHT)) {\n\t\t\t\t\t\tall.push(ContextKeyAndExpr.create([left, right], null)!);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst isFinished = (result.length === 0);\n\t\t\t\tresult.unshift(ContextKeyOrExpr.create(all, null, isFinished)!);\n\t\t\t}\n\n\t\t\tthis.negated = result[0];\n\t\t}\n\t\treturn this.negated;\n\t}\n}\n\nexport interface ContextKeyInfo {\n\treadonly key: string;\n\treadonly type?: string;\n\treadonly description?: string;\n}\n\nexport class RawContextKey<T> extends ContextKeyDefinedExpr {\n\n\tprivate static _info: ContextKeyInfo[] = [];\n\n\tstatic all(): IterableIterator<ContextKeyInfo> {\n\t\treturn RawContextKey._info.values();\n\t}\n\n\tprivate readonly _defaultValue: T | undefined;\n\n\tconstructor(key: string, defaultValue: T | undefined, metaOrHide?: string | true | { type: string; description: string }) {\n\t\tsuper(key, null);\n\t\tthis._defaultValue = defaultValue;\n\n\t\t// collect all context keys into a central place\n\t\tif (typeof metaOrHide === 'object') {\n\t\t\tRawContextKey._info.push({ ...metaOrHide, key });\n\t\t} else if (metaOrHide !== true) {\n\t\t\tRawContextKey._info.push({ key, description: metaOrHide, type: defaultValue !== null && defaultValue !== undefined ? typeof defaultValue : undefined });\n\t\t}\n\t}\n\n\tpublic bindTo(target: IContextKeyService): IContextKey<T> {\n\t\treturn target.createKey(this.key, this._defaultValue);\n\t}\n\n\tpublic getValue(target: IContextKeyService): T | undefined {\n\t\treturn target.getContextKeyValue<T>(this.key);\n\t}\n\n\tpublic toNegated(): ContextKeyExpression {\n\t\treturn this.negate();\n\t}\n\n\tpublic isEqualTo(value: any): ContextKeyExpression {\n\t\treturn ContextKeyEqualsExpr.create(this.key, value);\n\t}\n}\n\nexport interface IContext {\n\tgetValue<T>(key: string): T | undefined;\n}\n\nexport interface IContextKey<T> {\n\tset(value: T): void;\n\treset(): void;\n\tget(): T | undefined;\n}\n\nexport interface IContextKeyServiceTarget {\n\tparentElement: IContextKeyServiceTarget | null;\n\tsetAttribute(attr: string, value: string): void;\n\tremoveAttribute(attr: string): void;\n\thasAttribute(attr: string): boolean;\n\tgetAttribute(attr: string): string | null;\n}\n\nexport const IContextKeyService = createDecorator<IContextKeyService>('contextKeyService');\n\nexport interface IReadableSet<T> {\n\thas(value: T): boolean;\n}\n\nexport interface IContextKeyChangeEvent {\n\taffectsSome(keys: IReadableSet<string>): boolean;\n}\n\nexport interface IContextKeyService {\n\treadonly _serviceBrand: undefined;\n\tdispose(): void;\n\n\tonDidChangeContext: Event<IContextKeyChangeEvent>;\n\tbufferChangeEvents(callback: Function): void;\n\n\tcreateKey<T>(key: string, defaultValue: T | undefined): IContextKey<T>;\n\tcontextMatchesRules(rules: ContextKeyExpression | undefined): boolean;\n\tgetContextKeyValue<T>(key: string): T | undefined;\n\n\tcreateScoped(target: IContextKeyServiceTarget): IContextKeyService;\n\tgetContext(target: IContextKeyServiceTarget | null): IContext;\n}\n\nexport const SET_CONTEXT_COMMAND_ID = 'setContext';\n\nfunction cmp1(key1: string, key2: string): number {\n\tif (key1 < key2) {\n\t\treturn -1;\n\t}\n\tif (key1 > key2) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nfunction cmp2(key1: string, value1: any, key2: string, value2: any): number {\n\tif (key1 < key2) {\n\t\treturn -1;\n\t}\n\tif (key1 > key2) {\n\t\treturn 1;\n\t}\n\tif (value1 < value2) {\n\t\treturn -1;\n\t}\n\tif (value1 > value2) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Returns true if it is provable `p` implies `q`.\n */\nexport function implies(p: ContextKeyExpression, q: ContextKeyExpression): boolean {\n\n\tif (q.type === ContextKeyExprType.And && (p.type !== ContextKeyExprType.Or && p.type !== ContextKeyExprType.And)) {\n\t\t// covers the case: A implies A && B\n\t\tfor (const qTerm of q.expr) {\n\t\t\tif (p.equals(qTerm)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst notP = p.negate();\n\tconst expr = getTerminals(notP).concat(getTerminals(q));\n\texpr.sort(cmp);\n\n\tfor (let i = 0; i < expr.length; i++) {\n\t\tconst a = expr[i];\n\t\tconst notA = a.negate();\n\t\tfor (let j = i + 1; j < expr.length; j++) {\n\t\t\tconst b = expr[j];\n\t\t\tif (notA.equals(b)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction getTerminals(node: ContextKeyExpression) {\n\tif (node.type === ContextKeyExprType.Or) {\n\t\treturn node.expr;\n\t}\n\treturn [node];\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 * as nls from 'vs/nls';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\n\nexport namespace EditorContextKeys {\n\n\texport const editorSimpleInput = new RawContextKey<boolean>('editorSimpleInput', false, true);\n\t/**\n\t * A context key that is set when the editor's text has focus (cursor is blinking).\n\t * Is false when focus is in simple editor widgets (repl input, scm commit input).\n\t */\n\texport const editorTextFocus = new RawContextKey<boolean>('editorTextFocus', false, nls.localize('editorTextFocus', \"Whether the editor text has focus (cursor is blinking)\"));\n\t/**\n\t * A context key that is set when the editor's text or an editor's widget has focus.\n\t */\n\texport const focus = new RawContextKey<boolean>('editorFocus', false, nls.localize('editorFocus', \"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)\"));\n\n\t/**\n\t * A context key that is set when any editor input has focus (regular editor, repl input...).\n\t */\n\texport const textInputFocus = new RawContextKey<boolean>('textInputFocus', false, nls.localize('textInputFocus', \"Whether an editor or a rich text input has focus (cursor is blinking)\"));\n\n\texport const readOnly = new RawContextKey<boolean>('editorReadonly', false, nls.localize('editorReadonly', \"Whether the editor is read only\"));\n\texport const inDiffEditor = new RawContextKey<boolean>('inDiffEditor', false, nls.localize('inDiffEditor', \"Whether the context is a diff editor\"));\n\texport const columnSelection = new RawContextKey<boolean>('editorColumnSelection', false, nls.localize('editorColumnSelection', \"Whether `editor.columnSelection` is enabled\"));\n\texport const writable = readOnly.toNegated();\n\texport const hasNonEmptySelection = new RawContextKey<boolean>('editorHasSelection', false, nls.localize('editorHasSelection', \"Whether the editor has text selected\"));\n\texport const hasOnlyEmptySelection = hasNonEmptySelection.toNegated();\n\texport const hasMultipleSelections = new RawContextKey<boolean>('editorHasMultipleSelections', false, nls.localize('editorHasMultipleSelections', \"Whether the editor has multiple selections\"));\n\texport const hasSingleSelection = hasMultipleSelections.toNegated();\n\texport const tabMovesFocus = new RawContextKey<boolean>('editorTabMovesFocus', false, nls.localize('editorTabMovesFocus', \"Whether `Tab` will move focus out of the editor\"));\n\texport const tabDoesNotMoveFocus = tabMovesFocus.toNegated();\n\texport const isInWalkThroughSnippet = new RawContextKey<boolean>('isInEmbeddedEditor', false, true);\n\texport const canUndo = new RawContextKey<boolean>('canUndo', false, true);\n\texport const canRedo = new RawContextKey<boolean>('canRedo', false, true);\n\n\texport const hoverVisible = new RawContextKey<boolean>('editorHoverVisible', false, nls.localize('editorHoverVisible', \"Whether the editor hover is visible\"));\n\n\t/**\n\t * A context key that is set when an editor is part of a larger editor, like notebooks or\n\t * (future) a diff editor\n\t */\n\texport const inCompositeEditor = new RawContextKey<boolean>('inCompositeEditor', undefined, nls.localize('inCompositeEditor', \"Whether the editor is part of a larger editor (e.g. notebooks)\"));\n\texport const notInCompositeEditor = inCompositeEditor.toNegated();\n\n\t// -- mode context keys\n\texport const languageId = new RawContextKey<string>('editorLangId', '', nls.localize('editorLangId', \"The language identifier of the editor\"));\n\texport const hasCompletionItemProvider = new RawContextKey<boolean>('editorHasCompletionItemProvider', false, nls.localize('editorHasCompletionItemProvider', \"Whether the editor has a completion item provider\"));\n\texport const hasCodeActionsProvider = new RawContextKey<boolean>('editorHasCodeActionsProvider', false, nls.localize('editorHasCodeActionsProvider', \"Whether the editor has a code actions provider\"));\n\texport const hasCodeLensProvider = new RawContextKey<boolean>('editorHasCodeLensProvider', false, nls.localize('editorHasCodeLensProvider', \"Whether the editor has a code lens provider\"));\n\texport const hasDefinitionProvider = new RawContextKey<boolean>('editorHasDefinitionProvider', false, nls.localize('editorHasDefinitionProvider', \"Whether the editor has a definition provider\"));\n\texport const hasDeclarationProvider = new RawContextKey<boolean>('editorHasDeclarationProvider', false, nls.localize('editorHasDeclarationProvider', \"Whether the editor has a declaration provider\"));\n\texport const hasImplementationProvider = new RawContextKey<boolean>('editorHasImplementationProvider', false, nls.localize('editorHasImplementationProvider', \"Whether the editor has an implementation provider\"));\n\texport const hasTypeDefinitionProvider = new RawContextKey<boolean>('editorHasTypeDefinitionProvider', false, nls.localize('editorHasTypeDefinitionProvider', \"Whether the editor has a type definition provider\"));\n\texport const hasHoverProvider = new RawContextKey<boolean>('editorHasHoverProvider', false, nls.localize('editorHasHoverProvider', \"Whether the editor has a hover provider\"));\n\texport const hasDocumentHighlightProvider = new RawContextKey<boolean>('editorHasDocumentHighlightProvider', false, nls.localize('editorHasDocumentHighlightProvider', \"Whether the editor has a document highlight provider\"));\n\texport const hasDocumentSymbolProvider = new RawContextKey<boolean>('editorHasDocumentSymbolProvider', false, nls.localize('editorHasDocumentSymbolProvider', \"Whether the editor has a document symbol provider\"));\n\texport const hasReferenceProvider = new RawContextKey<boolean>('editorHasReferenceProvider', false, nls.localize('editorHasReferenceProvider', \"Whether the editor has a reference provider\"));\n\texport const hasRenameProvider = new RawContextKey<boolean>('editorHasRenameProvider', false, nls.localize('editorHasRenameProvider', \"Whether the editor has a rename provider\"));\n\texport const hasSignatureHelpProvider = new RawContextKey<boolean>('editorHasSignatureHelpProvider', false, nls.localize('editorHasSignatureHelpProvider', \"Whether the editor has a signature help provider\"));\n\texport const hasInlayHintsProvider = new RawContextKey<boolean>('editorHasInlayHintsProvider', false, nls.localize('editorHasInlayHintsProvider', \"Whether the editor has an inline hints provider\"));\n\n\t// -- mode context keys: formatting\n\texport const hasDocumentFormattingProvider = new RawContextKey<boolean>('editorHasDocumentFormattingProvider', false, nls.localize('editorHasDocumentFormattingProvider', \"Whether the editor has a document formatting provider\"));\n\texport const hasDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasDocumentSelectionFormattingProvider', false, nls.localize('editorHasDocumentSelectionFormattingProvider', \"Whether the editor has a document selection formatting provider\"));\n\texport const hasMultipleDocumentFormattingProvider = new RawContextKey<boolean>('editorHasMultipleDocumentFormattingProvider', false, nls.localize('editorHasMultipleDocumentFormattingProvider', \"Whether the editor has multiple document formatting providers\"));\n\texport const hasMultipleDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasMultipleDocumentSelectionFormattingProvider', false, nls.localize('editorHasMultipleDocumentSelectionFormattingProvider', \"Whether the editor has multiple document selection formatting providers\"));\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport const Context = {\n\tVisible: new RawContextKey<boolean>('parameterHintsVisible', false),\n\tMultipleSignatures: new RawContextKey<boolean>('parameterHintsMultipleSignatures', false),\n};\n\nexport async function provideSignatureHelp(\n\tregistry: LanguageFeatureRegistry<languages.SignatureHelpProvider>,\n\tmodel: ITextModel,\n\tposition: Position,\n\tcontext: languages.SignatureHelpContext,\n\ttoken: CancellationToken\n): Promise<languages.SignatureHelpResult | undefined> {\n\n\tconst supports = registry.ordered(model);\n\n\tfor (const support of supports) {\n\t\ttry {\n\t\t\tconst result = await support.provideSignatureHelp(model, position, token, context);\n\t\t\tif (result) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tonUnexpectedExternalError(err);\n\t\t}\n\t}\n\treturn undefined;\n}\n\nCommandsRegistry.registerCommand('_executeSignatureHelpProvider', async (accessor, ...args: [URI, IPosition, string?]) => {\n\tconst [uri, position, triggerCharacter] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Position.isIPosition(position));\n\tassertType(typeof triggerCharacter === 'string' || !triggerCharacter);\n\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\n\t\tconst result = await provideSignatureHelp(languageFeaturesService.signatureHelpProvider, ref.object.textEditorModel, Position.lift(position), {\n\t\t\ttriggerKind: languages.SignatureHelpTriggerKind.Invoke,\n\t\t\tisRetrigger: false,\n\t\t\ttriggerCharacter,\n\t\t}, CancellationToken.None);\n\n\t\tif (!result) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tsetTimeout(() => result.dispose(), 0);\n\t\treturn result.value;\n\n\t} finally {\n\t\tref.dispose();\n\t}\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 { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport * as languages from 'vs/editor/common/languages';\nimport { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\n\nexport interface TriggerContext {\n\treadonly triggerKind: languages.SignatureHelpTriggerKind;\n\treadonly triggerCharacter?: string;\n}\n\nnamespace ParameterHintState {\n\texport const enum Type {\n\t\tDefault,\n\t\tActive,\n\t\tPending,\n\t}\n\n\texport const Default = { type: Type.Default } as const;\n\n\texport class Pending {\n\t\treadonly type = Type.Pending;\n\t\tconstructor(\n\t\t\treadonly request: CancelablePromise<languages.SignatureHelpResult | undefined | null>,\n\t\t\treadonly previouslyActiveHints: languages.SignatureHelp | undefined,\n\t\t) { }\n\t}\n\n\texport class Active {\n\t\treadonly type = Type.Active;\n\t\tconstructor(\n\t\t\treadonly hints: languages.SignatureHelp\n\t\t) { }\n\t}\n\n\texport type State = typeof Default | Pending | Active;\n}\n\nexport class ParameterHintsModel extends Disposable {\n\n\tprivate static readonly DEFAULT_DELAY = 120; // ms\n\n\tprivate readonly _onChangedHints = this._register(new Emitter<languages.SignatureHelp | undefined>());\n\tpublic readonly onChangedHints = this._onChangedHints.event;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly providers: LanguageFeatureRegistry<languages.SignatureHelpProvider>;\n\tprivate triggerOnType = false;\n\tprivate _state: ParameterHintState.State = ParameterHintState.Default;\n\tprivate _pendingTriggers: TriggerContext[] = [];\n\tprivate readonly _lastSignatureHelpResult = this._register(new MutableDisposable<languages.SignatureHelpResult>());\n\tprivate triggerChars = new CharacterSet();\n\tprivate retriggerChars = new CharacterSet();\n\n\tprivate readonly throttledDelayer: Delayer<boolean>;\n\tprivate triggerId = 0;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tproviders: LanguageFeatureRegistry<languages.SignatureHelpProvider>,\n\t\tdelay: number = ParameterHintsModel.DEFAULT_DELAY\n\t) {\n\t\tsuper();\n\n\t\tthis.editor = editor;\n\t\tthis.providers = providers;\n\n\t\tthis.throttledDelayer = new Delayer(delay);\n\n\t\tthis._register(this.editor.onDidBlurEditorWidget(() => this.cancel()));\n\t\tthis._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange()));\n\t\tthis._register(this.editor.onDidChangeModel(e => this.onModelChanged()));\n\t\tthis._register(this.editor.onDidChangeModelLanguage(_ => this.onModelChanged()));\n\t\tthis._register(this.editor.onDidChangeCursorSelection(e => this.onCursorChange(e)));\n\t\tthis._register(this.editor.onDidChangeModelContent(e => this.onModelContentChange()));\n\t\tthis._register(this.providers.onDidChange(this.onModelChanged, this));\n\t\tthis._register(this.editor.onDidType(text => this.onDidType(text)));\n\n\t\tthis.onEditorConfigurationChange();\n\t\tthis.onModelChanged();\n\t}\n\n\tprivate get state() { return this._state; }\n\tprivate set state(value: ParameterHintState.State) {\n\t\tif (this._state.type === ParameterHintState.Type.Pending) {\n\t\t\tthis._state.request.cancel();\n\t\t}\n\t\tthis._state = value;\n\t}\n\n\tcancel(silent: boolean = false): void {\n\t\tthis.state = ParameterHintState.Default;\n\n\t\tthis.throttledDelayer.cancel();\n\n\t\tif (!silent) {\n\t\t\tthis._onChangedHints.fire(undefined);\n\t\t}\n\t}\n\n\ttrigger(context: TriggerContext, delay?: number): void {\n\t\tconst model = this.editor.getModel();\n\t\tif (!model || !this.providers.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst triggerId = ++this.triggerId;\n\n\t\tthis._pendingTriggers.push(context);\n\t\tthis.throttledDelayer.trigger(() => {\n\t\t\treturn this.doTrigger(triggerId);\n\t\t}, delay)\n\t\t\t.catch(onUnexpectedError);\n\t}\n\n\tpublic next(): void {\n\t\tif (this.state.type !== ParameterHintState.Type.Active) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst length = this.state.hints.signatures.length;\n\t\tconst activeSignature = this.state.hints.activeSignature;\n\t\tconst last = (activeSignature % length) === (length - 1);\n\t\tconst cycle = this.editor.getOption(EditorOption.parameterHints).cycle;\n\n\t\t// If there is only one signature, or we're on last signature of list\n\t\tif ((length < 2 || last) && !cycle) {\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateActiveSignature(last && cycle ? 0 : activeSignature + 1);\n\t}\n\n\tpublic previous(): void {\n\t\tif (this.state.type !== ParameterHintState.Type.Active) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst length = this.state.hints.signatures.length;\n\t\tconst activeSignature = this.state.hints.activeSignature;\n\t\tconst first = activeSignature === 0;\n\t\tconst cycle = this.editor.getOption(EditorOption.parameterHints).cycle;\n\n\t\t// If there is only one signature, or we're on first signature of list\n\t\tif ((length < 2 || first) && !cycle) {\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateActiveSignature(first && cycle ? length - 1 : activeSignature - 1);\n\t}\n\n\tprivate updateActiveSignature(activeSignature: number) {\n\t\tif (this.state.type !== ParameterHintState.Type.Active) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.state = new ParameterHintState.Active({ ...this.state.hints, activeSignature });\n\t\tthis._onChangedHints.fire(this.state.hints);\n\t}\n\n\tprivate async doTrigger(triggerId: number): Promise<boolean> {\n\t\tconst isRetrigger = this.state.type === ParameterHintState.Type.Active || this.state.type === ParameterHintState.Type.Pending;\n\t\tconst activeSignatureHelp = this.getLastActiveHints();\n\t\tthis.cancel(true);\n\n\t\tif (this._pendingTriggers.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context: TriggerContext = this._pendingTriggers.reduce(mergeTriggerContexts);\n\t\tthis._pendingTriggers = [];\n\n\t\tconst triggerContext = {\n\t\t\ttriggerKind: context.triggerKind,\n\t\t\ttriggerCharacter: context.triggerCharacter,\n\t\t\tisRetrigger: isRetrigger,\n\t\t\tactiveSignatureHelp: activeSignatureHelp\n\t\t};\n\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tconst position = this.editor.getPosition();\n\n\t\tthis.state = new ParameterHintState.Pending(\n\t\t\tcreateCancelablePromise(token => provideSignatureHelp(this.providers, model, position, triggerContext, token)),\n\t\t\tactiveSignatureHelp);\n\n\t\ttry {\n\t\t\tconst result = await this.state.request;\n\n\t\t\t// Check that we are still resolving the correct signature help\n\t\t\tif (triggerId !== this.triggerId) {\n\t\t\t\tresult?.dispose();\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!result || !result.value.signatures || result.value.signatures.length === 0) {\n\t\t\t\tresult?.dispose();\n\t\t\t\tthis._lastSignatureHelpResult.clear();\n\t\t\t\tthis.cancel();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tthis.state = new ParameterHintState.Active(result.value);\n\t\t\t\tthis._lastSignatureHelpResult.value = result;\n\t\t\t\tthis._onChangedHints.fire(this.state.hints);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (triggerId === this.triggerId) {\n\t\t\t\tthis.state = ParameterHintState.Default;\n\t\t\t}\n\t\t\tonUnexpectedError(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate getLastActiveHints(): languages.SignatureHelp | undefined {\n\t\tswitch (this.state.type) {\n\t\t\tcase ParameterHintState.Type.Active: return this.state.hints;\n\t\t\tcase ParameterHintState.Type.Pending: return this.state.previouslyActiveHints;\n\t\t\tdefault: return undefined;\n\t\t}\n\t}\n\n\tprivate get isTriggered(): boolean {\n\t\treturn this.state.type === ParameterHintState.Type.Active\n\t\t\t|| this.state.type === ParameterHintState.Type.Pending\n\t\t\t|| this.throttledDelayer.isTriggered();\n\t}\n\n\tprivate onModelChanged(): void {\n\t\tthis.cancel();\n\n\t\t// Update trigger characters\n\t\tthis.triggerChars = new CharacterSet();\n\t\tthis.retriggerChars = new CharacterSet();\n\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const support of this.providers.ordered(model)) {\n\t\t\tfor (const ch of support.signatureHelpTriggerCharacters || []) {\n\t\t\t\tthis.triggerChars.add(ch.charCodeAt(0));\n\n\t\t\t\t// All trigger characters are also considered retrigger characters\n\t\t\t\tthis.retriggerChars.add(ch.charCodeAt(0));\n\t\t\t}\n\n\t\t\tfor (const ch of support.signatureHelpRetriggerCharacters || []) {\n\t\t\t\tthis.retriggerChars.add(ch.charCodeAt(0));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onDidType(text: string) {\n\t\tif (!this.triggerOnType) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lastCharIndex = text.length - 1;\n\t\tconst triggerCharCode = text.charCodeAt(lastCharIndex);\n\n\t\tif (this.triggerChars.has(triggerCharCode) || this.isTriggered && this.retriggerChars.has(triggerCharCode)) {\n\t\t\tthis.trigger({\n\t\t\t\ttriggerKind: languages.SignatureHelpTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: text.charAt(lastCharIndex),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate onCursorChange(e: ICursorSelectionChangedEvent): void {\n\t\tif (e.source === 'mouse') {\n\t\t\tthis.cancel();\n\t\t} else if (this.isTriggered) {\n\t\t\tthis.trigger({ triggerKind: languages.SignatureHelpTriggerKind.ContentChange });\n\t\t}\n\t}\n\n\tprivate onModelContentChange(): void {\n\t\tif (this.isTriggered) {\n\t\t\tthis.trigger({ triggerKind: languages.SignatureHelpTriggerKind.ContentChange });\n\t\t}\n\t}\n\n\tprivate onEditorConfigurationChange(): void {\n\t\tthis.triggerOnType = this.editor.getOption(EditorOption.parameterHints).enabled;\n\n\t\tif (!this.triggerOnType) {\n\t\t\tthis.cancel();\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.cancel(true);\n\t\tsuper.dispose();\n\t}\n}\n\nfunction mergeTriggerContexts(previous: TriggerContext, current: TriggerContext) {\n\tswitch (current.triggerKind) {\n\t\tcase languages.SignatureHelpTriggerKind.Invoke:\n\t\t\t// Invoke overrides previous triggers.\n\t\t\treturn current;\n\n\t\tcase languages.SignatureHelpTriggerKind.ContentChange:\n\t\t\t// Ignore content changes triggers\n\t\t\treturn previous;\n\n\t\tcase languages.SignatureHelpTriggerKind.TriggerCharacter:\n\t\tdefault:\n\t\t\treturn current;\n\t}\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { CompletionModel } from './completionModel';\nimport { ISelectedSuggestion } from './suggestWidget';\n\nexport class SuggestAlternatives {\n\n\tstatic readonly OtherSuggestions = new RawContextKey<boolean>('hasOtherSuggestions', false);\n\n\tprivate readonly _ckOtherSuggestions: IContextKey<boolean>;\n\n\tprivate _index: number = 0;\n\tprivate _model: CompletionModel | undefined;\n\tprivate _acceptNext: ((selected: ISelectedSuggestion) => any) | undefined;\n\tprivate _listener: IDisposable | undefined;\n\tprivate _ignore: boolean | undefined;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tthis._ckOtherSuggestions = SuggestAlternatives.OtherSuggestions.bindTo(contextKeyService);\n\t}\n\n\tdispose(): void {\n\t\tthis.reset();\n\t}\n\n\treset(): void {\n\t\tthis._ckOtherSuggestions.reset();\n\t\tthis._listener?.dispose();\n\t\tthis._model = undefined;\n\t\tthis._acceptNext = undefined;\n\t\tthis._ignore = false;\n\t}\n\n\tset({ model, index }: ISelectedSuggestion, acceptNext: (selected: ISelectedSuggestion) => any): void {\n\n\t\t// no suggestions -> nothing to do\n\t\tif (model.items.length === 0) {\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\n\t\t// no alternative suggestions -> nothing to do\n\t\tlet nextIndex = SuggestAlternatives._moveIndex(true, model, index);\n\t\tif (nextIndex === index) {\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._acceptNext = acceptNext;\n\t\tthis._model = model;\n\t\tthis._index = index;\n\t\tthis._listener = this._editor.onDidChangeCursorPosition(() => {\n\t\t\tif (!this._ignore) {\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t});\n\t\tthis._ckOtherSuggestions.set(true);\n\t}\n\n\tprivate static _moveIndex(fwd: boolean, model: CompletionModel, index: number): number {\n\t\tlet newIndex = index;\n\t\twhile (true) {\n\t\t\tnewIndex = (newIndex + model.items.length + (fwd ? +1 : -1)) % model.items.length;\n\t\t\tif (newIndex === index) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!model.items[newIndex].completion.additionalTextEdits) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn newIndex;\n\t}\n\n\tnext(): void {\n\t\tthis._move(true);\n\t}\n\n\tprev(): void {\n\t\tthis._move(false);\n\t}\n\n\tprivate _move(fwd: boolean): void {\n\t\tif (!this._model) {\n\t\t\t// nothing to reason about\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis._ignore = true;\n\t\t\tthis._index = SuggestAlternatives._moveIndex(fwd, this._model, this._index);\n\t\t\tthis._acceptNext!({ index: this._index, item: this._model.items[this._index], model: this._model });\n\t\t} finally {\n\t\t\tthis._ignore = false;\n\t\t}\n\t}\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\n\nexport class WordContextKey {\n\n\tstatic readonly AtEnd = new RawContextKey<boolean>('atEndOfWord', false);\n\n\tprivate readonly _ckAtEnd: IContextKey<boolean>;\n\tprivate readonly _configListener: IDisposable;\n\n\tprivate _enabled: boolean = false;\n\tprivate _selectionListener?: IDisposable;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t) {\n\n\t\tthis._ckAtEnd = WordContextKey.AtEnd.bindTo(contextKeyService);\n\t\tthis._configListener = this._editor.onDidChangeConfiguration(e => e.hasChanged(EditorOption.tabCompletion) && this._update());\n\t\tthis._update();\n\t}\n\n\tdispose(): void {\n\t\tthis._configListener.dispose();\n\t\tthis._selectionListener?.dispose();\n\t\tthis._ckAtEnd.reset();\n\t}\n\n\tprivate _update(): void {\n\t\t// only update this when tab completions are enabled\n\t\tconst enabled = this._editor.getOption(EditorOption.tabCompletion) === 'on';\n\t\tif (this._enabled === enabled) {\n\t\t\treturn;\n\t\t}\n\t\tthis._enabled = enabled;\n\n\t\tif (this._enabled) {\n\t\t\tconst checkForWordEnd = () => {\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\tthis._ckAtEnd.set(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\tconst selection = this._editor.getSelection();\n\t\t\t\tconst word = model.getWordAtPosition(selection.getStartPosition());\n\t\t\t\tif (!word) {\n\t\t\t\t\tthis._ckAtEnd.set(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._ckAtEnd.set(word.endColumn === selection.getStartPosition().column);\n\t\t\t};\n\t\t\tthis._selectionListener = this._editor.onDidChangeCursorSelection(checkForWordEnd);\n\t\t\tcheckForWordEnd();\n\n\t\t} else if (this._selectionListener) {\n\t\t\tthis._ckAtEnd.reset();\n\t\t\tthis._selectionListener.dispose();\n\t\t\tthis._selectionListener = undefined;\n\t\t}\n\t}\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 'vs/base/common/event';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IAccessibilityService = createDecorator<IAccessibilityService>('accessibilityService');\n\nexport interface IAccessibilityService {\n\treadonly _serviceBrand: undefined;\n\n\treadonly onDidChangeScreenReaderOptimized: Event<void>;\n\tisScreenReaderOptimized(): boolean;\n\tgetAccessibilitySupport(): AccessibilitySupport;\n}\n\nexport const enum AccessibilitySupport {\n\t/**\n\t * This should be the browser case where it is not known if a screen reader is attached or no.\n\t */\n\tUnknown = 0,\n\n\tDisabled = 1,\n\n\tEnabled = 2\n}\n\nexport const CONTEXT_ACCESSIBILITY_MODE_ENABLED = new RawContextKey<boolean>('accessibilityModeEnabled', false);\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 * as browser from 'vs/base/browser/browser';\nimport * as arrays from 'vs/base/common/arrays';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as objects from 'vs/base/common/objects';\nimport * as platform from 'vs/base/common/platform';\nimport { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver';\nimport { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements';\nimport { migrateOptions } from 'vs/editor/browser/config/migrateOptions';\nimport { TabFocus } from 'vs/editor/browser/config/tabFocus';\nimport { ComputeOptionsMemory, ConfigurationChangedEvent, EditorOption, editorOptionsRegistry, FindComputedEditorOptionValueById, IComputedEditorOptions, IEditorOptions, IEnvironmentalOptions } from 'vs/editor/common/config/editorOptions';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\nimport { BareFontInfo, FontInfo, IValidatedEditorOptions } from 'vs/editor/common/config/fontInfo';\nimport { IDimension } from 'vs/editor/common/core/dimension';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { AccessibilitySupport, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\n\nexport interface IEditorConstructionOptions extends IEditorOptions {\n\t/**\n\t * The initial editor dimension (to avoid measuring the container).\n\t */\n\tdimension?: IDimension;\n\t/**\n\t * Place overflow widgets inside an external DOM node.\n\t * Defaults to an internal DOM node.\n\t */\n\toverflowWidgetsDomNode?: HTMLElement;\n}\n\nexport class EditorConfiguration extends Disposable implements IEditorConfiguration {\n\n\tprivate _onDidChange = this._register(new Emitter<ConfigurationChangedEvent>());\n\tpublic readonly onDidChange: Event<ConfigurationChangedEvent> = this._onDidChange.event;\n\n\tprivate _onDidChangeFast = this._register(new Emitter<ConfigurationChangedEvent>());\n\tpublic readonly onDidChangeFast: Event<ConfigurationChangedEvent> = this._onDidChangeFast.event;\n\n\tpublic readonly isSimpleWidget: boolean;\n\tprivate readonly _containerObserver: ElementSizeObserver;\n\n\tprivate _isDominatedByLongLines: boolean = false;\n\tprivate _viewLineCount: number = 1;\n\tprivate _lineNumbersDigitCount: number = 1;\n\tprivate _reservedHeight: number = 0;\n\n\tprivate readonly _computeOptionsMemory: ComputeOptionsMemory = new ComputeOptionsMemory();\n\t/**\n\t * Raw options as they were passed in and merged with all calls to `updateOptions`.\n\t */\n\tprivate readonly _rawOptions: IEditorOptions;\n\t/**\n\t * Validated version of `_rawOptions`.\n\t */\n\tprivate _validatedOptions: ValidatedEditorOptions;\n\t/**\n\t * Complete options which are a combination of passed in options and env values.\n\t */\n\tpublic options: ComputedEditorOptions;\n\n\tconstructor(\n\t\tisSimpleWidget: boolean,\n\t\toptions: Readonly<IEditorConstructionOptions>,\n\t\tcontainer: HTMLElement | null,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\t\tthis.isSimpleWidget = isSimpleWidget;\n\t\tthis._containerObserver = this._register(new ElementSizeObserver(container, options.dimension));\n\n\t\tthis._rawOptions = deepCloneAndMigrateOptions(options);\n\t\tthis._validatedOptions = EditorOptionsUtil.validateOptions(this._rawOptions);\n\t\tthis.options = this._computeOptions();\n\n\t\tif (this.options.get(EditorOption.automaticLayout)) {\n\t\t\tthis._containerObserver.startObserving();\n\t\t}\n\n\t\tthis._register(EditorZoom.onDidChangeZoomLevel(() => this._recomputeOptions()));\n\t\tthis._register(TabFocus.onDidChangeTabFocus(() => this._recomputeOptions()));\n\t\tthis._register(this._containerObserver.onDidChange(() => this._recomputeOptions()));\n\t\tthis._register(FontMeasurements.onDidChange(() => this._recomputeOptions()));\n\t\tthis._register(browser.PixelRatio.onDidChange(() => this._recomputeOptions()));\n\t\tthis._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions()));\n\t}\n\n\tprivate _recomputeOptions(): void {\n\t\tconst newOptions = this._computeOptions();\n\t\tconst changeEvent = EditorOptionsUtil.checkEquals(this.options, newOptions);\n\t\tif (changeEvent === null) {\n\t\t\t// nothing changed!\n\t\t\treturn;\n\t\t}\n\n\t\tthis.options = newOptions;\n\t\tthis._onDidChangeFast.fire(changeEvent);\n\t\tthis._onDidChange.fire(changeEvent);\n\t}\n\n\tprivate _computeOptions(): ComputedEditorOptions {\n\t\tconst partialEnv = this._readEnvConfiguration();\n\t\tconst bareFontInfo = BareFontInfo.createFromValidatedSettings(this._validatedOptions, partialEnv.pixelRatio, this.isSimpleWidget);\n\t\tconst fontInfo = this._readFontInfo(bareFontInfo);\n\t\tconst env: IEnvironmentalOptions = {\n\t\t\tmemory: this._computeOptionsMemory,\n\t\t\touterWidth: partialEnv.outerWidth,\n\t\t\touterHeight: partialEnv.outerHeight - this._reservedHeight,\n\t\t\tfontInfo: fontInfo,\n\t\t\textraEditorClassName: partialEnv.extraEditorClassName,\n\t\t\tisDominatedByLongLines: this._isDominatedByLongLines,\n\t\t\tviewLineCount: this._viewLineCount,\n\t\t\tlineNumbersDigitCount: this._lineNumbersDigitCount,\n\t\t\temptySelectionClipboard: partialEnv.emptySelectionClipboard,\n\t\t\tpixelRatio: partialEnv.pixelRatio,\n\t\t\ttabFocusMode: TabFocus.getTabFocusMode(),\n\t\t\taccessibilitySupport: partialEnv.accessibilitySupport\n\t\t};\n\t\treturn EditorOptionsUtil.computeOptions(this._validatedOptions, env);\n\t}\n\n\tprotected _readEnvConfiguration(): IEnvConfiguration {\n\t\treturn {\n\t\t\textraEditorClassName: getExtraEditorClassName(),\n\t\t\touterWidth: this._containerObserver.getWidth(),\n\t\t\touterHeight: this._containerObserver.getHeight(),\n\t\t\temptySelectionClipboard: browser.isWebKit || browser.isFirefox,\n\t\t\tpixelRatio: browser.PixelRatio.value,\n\t\t\taccessibilitySupport: (\n\t\t\t\tthis._accessibilityService.isScreenReaderOptimized()\n\t\t\t\t\t? AccessibilitySupport.Enabled\n\t\t\t\t\t: this._accessibilityService.getAccessibilitySupport()\n\t\t\t)\n\t\t};\n\t}\n\n\tprotected _readFontInfo(bareFontInfo: BareFontInfo): FontInfo {\n\t\treturn FontMeasurements.readFontInfo(bareFontInfo);\n\t}\n\n\tpublic getRawOptions(): IEditorOptions {\n\t\treturn this._rawOptions;\n\t}\n\n\tpublic updateOptions(_newOptions: Readonly<IEditorOptions>): void {\n\t\tconst newOptions = deepCloneAndMigrateOptions(_newOptions);\n\n\t\tconst didChange = EditorOptionsUtil.applyUpdate(this._rawOptions, newOptions);\n\t\tif (!didChange) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._validatedOptions = EditorOptionsUtil.validateOptions(this._rawOptions);\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic observeContainer(dimension?: IDimension): void {\n\t\tthis._containerObserver.observe(dimension);\n\t}\n\n\tpublic setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {\n\t\tif (this._isDominatedByLongLines === isDominatedByLongLines) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isDominatedByLongLines = isDominatedByLongLines;\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic setModelLineCount(modelLineCount: number): void {\n\t\tconst lineNumbersDigitCount = digitCount(modelLineCount);\n\t\tif (this._lineNumbersDigitCount === lineNumbersDigitCount) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lineNumbersDigitCount = lineNumbersDigitCount;\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic setViewLineCount(viewLineCount: number): void {\n\t\tif (this._viewLineCount === viewLineCount) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewLineCount = viewLineCount;\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic setReservedHeight(reservedHeight: number) {\n\t\tif (this._reservedHeight === reservedHeight) {\n\t\t\treturn;\n\t\t}\n\t\tthis._reservedHeight = reservedHeight;\n\t\tthis._recomputeOptions();\n\t}\n}\n\nfunction digitCount(n: number): number {\n\tlet r = 0;\n\twhile (n) {\n\t\tn = Math.floor(n / 10);\n\t\tr++;\n\t}\n\treturn r ? r : 1;\n}\n\nfunction getExtraEditorClassName(): string {\n\tlet extra = '';\n\tif (!browser.isSafari && !browser.isWebkitWebView) {\n\t\t// Use user-select: none in all browsers except Safari and native macOS WebView\n\t\textra += 'no-user-select ';\n\t}\n\tif (browser.isSafari) {\n\t\t// See https://github.com/microsoft/vscode/issues/108822\n\t\textra += 'no-minimap-shadow ';\n\t}\n\tif (platform.isMacintosh) {\n\t\textra += 'mac ';\n\t}\n\treturn extra;\n}\n\nexport interface IEnvConfiguration {\n\textraEditorClassName: string;\n\touterWidth: number;\n\touterHeight: number;\n\temptySelectionClipboard: boolean;\n\tpixelRatio: number;\n\taccessibilitySupport: AccessibilitySupport;\n}\n\nclass ValidatedEditorOptions implements IValidatedEditorOptions {\n\tprivate readonly _values: any[] = [];\n\tpublic _read<T>(option: EditorOption): T {\n\t\treturn this._values[option];\n\t}\n\tpublic get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T> {\n\t\treturn this._values[id];\n\t}\n\tpublic _write<T>(option: EditorOption, value: T): void {\n\t\tthis._values[option] = value;\n\t}\n}\n\nexport class ComputedEditorOptions implements IComputedEditorOptions {\n\tprivate readonly _values: any[] = [];\n\tpublic _read<T>(id: EditorOption): T {\n\t\tif (id >= this._values.length) {\n\t\t\tthrow new Error('Cannot read uninitialized value');\n\t\t}\n\t\treturn this._values[id];\n\t}\n\tpublic get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T> {\n\t\treturn this._read(id);\n\t}\n\tpublic _write<T>(id: EditorOption, value: T): void {\n\t\tthis._values[id] = value;\n\t}\n}\n\nclass EditorOptionsUtil {\n\n\tpublic static validateOptions(options: IEditorOptions): ValidatedEditorOptions {\n\t\tconst result = new ValidatedEditorOptions();\n\t\tfor (const editorOption of editorOptionsRegistry) {\n\t\t\tconst value = (editorOption.name === '_never_' ? undefined : (options as any)[editorOption.name]);\n\t\t\tresult._write(editorOption.id, editorOption.validate(value));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static computeOptions(options: ValidatedEditorOptions, env: IEnvironmentalOptions): ComputedEditorOptions {\n\t\tconst result = new ComputedEditorOptions();\n\t\tfor (const editorOption of editorOptionsRegistry) {\n\t\t\tresult._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id)));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _deepEquals<T>(a: T, b: T): boolean {\n\t\tif (typeof a !== 'object' || typeof b !== 'object' || !a || !b) {\n\t\t\treturn a === b;\n\t\t}\n\t\tif (Array.isArray(a) || Array.isArray(b)) {\n\t\t\treturn (Array.isArray(a) && Array.isArray(b) ? arrays.equals(a, b) : false);\n\t\t}\n\t\tif (Object.keys(a).length !== Object.keys(b).length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (const key in a) {\n\t\t\tif (!EditorOptionsUtil._deepEquals(a[key], b[key])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static checkEquals(a: ComputedEditorOptions, b: ComputedEditorOptions): ConfigurationChangedEvent | null {\n\t\tconst result: boolean[] = [];\n\t\tlet somethingChanged = false;\n\t\tfor (const editorOption of editorOptionsRegistry) {\n\t\t\tconst changed = !EditorOptionsUtil._deepEquals(a._read(editorOption.id), b._read(editorOption.id));\n\t\t\tresult[editorOption.id] = changed;\n\t\t\tif (changed) {\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\treturn (somethingChanged ? new ConfigurationChangedEvent(result) : null);\n\t}\n\n\t/**\n\t * Returns true if something changed.\n\t * Modifies `options`.\n\t*/\n\tpublic static applyUpdate(options: IEditorOptions, update: Readonly<IEditorOptions>): boolean {\n\t\tlet changed = false;\n\t\tfor (const editorOption of editorOptionsRegistry) {\n\t\t\tif (update.hasOwnProperty(editorOption.name)) {\n\t\t\t\tconst result = editorOption.applyUpdate((options as any)[editorOption.name], (update as any)[editorOption.name]);\n\t\t\t\t(options as any)[editorOption.name] = result.newValue;\n\t\t\t\tchanged = changed || result.didChange;\n\t\t\t}\n\t\t}\n\t\treturn changed;\n\t}\n}\n\nfunction deepCloneAndMigrateOptions(_options: Readonly<IEditorOptions>): IEditorOptions {\n\tconst options = objects.deepClone(_options);\n\tmigrateOptions(options);\n\treturn options;\n}\n","\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { AccessibilitySupport, CONTEXT_ACCESSIBILITY_MODE_ENABLED, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\n\nexport class AccessibilityService extends Disposable implements IAccessibilityService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _accessibilityModeEnabledContext: IContextKey<boolean>;\n\tprotected _accessibilitySupport = AccessibilitySupport.Unknown;\n\tprotected readonly _onDidChangeScreenReaderOptimized = new Emitter<void>();\n\n\tconstructor(\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService protected readonly _configurationService: IConfigurationService,\n\t) {\n\t\tsuper();\n\t\tthis._accessibilityModeEnabledContext = CONTEXT_ACCESSIBILITY_MODE_ENABLED.bindTo(this._contextKeyService);\n\t\tconst updateContextKey = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());\n\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('editor.accessibilitySupport')) {\n\t\t\t\tupdateContextKey();\n\t\t\t\tthis._onDidChangeScreenReaderOptimized.fire();\n\t\t\t}\n\t\t}));\n\t\tupdateContextKey();\n\t\tthis.onDidChangeScreenReaderOptimized(() => updateContextKey());\n\t}\n\n\tget onDidChangeScreenReaderOptimized(): Event<void> {\n\t\treturn this._onDidChangeScreenReaderOptimized.event;\n\t}\n\n\tisScreenReaderOptimized(): boolean {\n\t\tconst config = this._configurationService.getValue('editor.accessibilitySupport');\n\t\treturn config === 'on' || (config === 'auto' && this._accessibilitySupport === AccessibilitySupport.Enabled);\n\t}\n\n\tgetAccessibilitySupport(): AccessibilitySupport {\n\t\treturn this._accessibilitySupport;\n\t}\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 { Emitter, PauseableEmitter } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { TernarySearchTree } from 'vs/base/common/map';\nimport { localize } from 'vs/nls';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ContextKeyExpression, ContextKeyInfo, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IReadableSet, RawContextKey, SET_CONTEXT_COMMAND_ID } from 'vs/platform/contextkey/common/contextkey';\n\nconst KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context';\n\nexport class Context implements IContext {\n\n\tprotected _parent: Context | null;\n\tprotected _value: { [key: string]: any };\n\tprotected _id: number;\n\n\tconstructor(id: number, parent: Context | null) {\n\t\tthis._id = id;\n\t\tthis._parent = parent;\n\t\tthis._value = Object.create(null);\n\t\tthis._value['_contextId'] = id;\n\t}\n\n\tpublic setValue(key: string, value: any): boolean {\n\t\t// console.log('SET ' + key + ' = ' + value + ' ON ' + this._id);\n\t\tif (this._value[key] !== value) {\n\t\t\tthis._value[key] = value;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic removeValue(key: string): boolean {\n\t\t// console.log('REMOVE ' + key + ' FROM ' + this._id);\n\t\tif (key in this._value) {\n\t\t\tdelete this._value[key];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic getValue<T>(key: string): T | undefined {\n\t\tconst ret = this._value[key];\n\t\tif (typeof ret === 'undefined' && this._parent) {\n\t\t\treturn this._parent.getValue<T>(key);\n\t\t}\n\t\treturn ret;\n\t}\n}\n\nclass NullContext extends Context {\n\n\tstatic readonly INSTANCE = new NullContext();\n\n\tconstructor() {\n\t\tsuper(-1, null);\n\t}\n\n\tpublic override setValue(key: string, value: any): boolean {\n\t\treturn false;\n\t}\n\n\tpublic override removeValue(key: string): boolean {\n\t\treturn false;\n\t}\n\n\tpublic override getValue<T>(key: string): T | undefined {\n\t\treturn undefined;\n\t}\n}\n\nclass ConfigAwareContextValuesContainer extends Context {\n\tprivate static readonly _keyPrefix = 'config.';\n\n\tprivate readonly _values = TernarySearchTree.forConfigKeys<any>();\n\tprivate readonly _listener: IDisposable;\n\n\tconstructor(\n\t\tid: number,\n\t\tprivate readonly _configurationService: IConfigurationService,\n\t\temitter: Emitter<IContextKeyChangeEvent>\n\t) {\n\t\tsuper(id, null);\n\n\t\tthis._listener = this._configurationService.onDidChangeConfiguration(event => {\n\t\t\tif (event.source === ConfigurationTarget.DEFAULT) {\n\t\t\t\t// new setting, reset everything\n\t\t\t\tconst allKeys = Array.from(Iterable.map(this._values, ([k]) => k));\n\t\t\t\tthis._values.clear();\n\t\t\t\temitter.fire(new ArrayContextKeyChangeEvent(allKeys));\n\t\t\t} else {\n\t\t\t\tconst changedKeys: string[] = [];\n\t\t\t\tfor (const configKey of event.affectedKeys) {\n\t\t\t\t\tconst contextKey = `config.${configKey}`;\n\n\t\t\t\t\tconst cachedItems = this._values.findSuperstr(contextKey);\n\t\t\t\t\tif (cachedItems !== undefined) {\n\t\t\t\t\t\tchangedKeys.push(...Iterable.map(cachedItems, ([key]) => key));\n\t\t\t\t\t\tthis._values.deleteSuperstr(contextKey);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this._values.has(contextKey)) {\n\t\t\t\t\t\tchangedKeys.push(contextKey);\n\t\t\t\t\t\tthis._values.delete(contextKey);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\temitter.fire(new ArrayContextKeyChangeEvent(changedKeys));\n\t\t\t}\n\t\t});\n\t}\n\n\tdispose(): void {\n\t\tthis._listener.dispose();\n\t}\n\n\toverride getValue(key: string): any {\n\n\t\tif (key.indexOf(ConfigAwareContextValuesContainer._keyPrefix) !== 0) {\n\t\t\treturn super.getValue(key);\n\t\t}\n\n\t\tif (this._values.has(key)) {\n\t\t\treturn this._values.get(key);\n\t\t}\n\n\t\tconst configKey = key.substr(ConfigAwareContextValuesContainer._keyPrefix.length);\n\t\tconst configValue = this._configurationService.getValue(configKey);\n\t\tlet value: any = undefined;\n\t\tswitch (typeof configValue) {\n\t\t\tcase 'number':\n\t\t\tcase 'boolean':\n\t\t\tcase 'string':\n\t\t\t\tvalue = configValue;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (Array.isArray(configValue)) {\n\t\t\t\t\tvalue = JSON.stringify(configValue);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = configValue;\n\t\t\t\t}\n\t\t}\n\n\t\tthis._values.set(key, value);\n\t\treturn value;\n\t}\n\n\toverride setValue(key: string, value: any): boolean {\n\t\treturn super.setValue(key, value);\n\t}\n\n\toverride removeValue(key: string): boolean {\n\t\treturn super.removeValue(key);\n\t}\n}\n\nclass ContextKey<T> implements IContextKey<T> {\n\n\tprivate _service: AbstractContextKeyService;\n\tprivate _key: string;\n\tprivate _defaultValue: T | undefined;\n\n\tconstructor(service: AbstractContextKeyService, key: string, defaultValue: T | undefined) {\n\t\tthis._service = service;\n\t\tthis._key = key;\n\t\tthis._defaultValue = defaultValue;\n\t\tthis.reset();\n\t}\n\n\tpublic set(value: T): void {\n\t\tthis._service.setContext(this._key, value);\n\t}\n\n\tpublic reset(): void {\n\t\tif (typeof this._defaultValue === 'undefined') {\n\t\t\tthis._service.removeContext(this._key);\n\t\t} else {\n\t\t\tthis._service.setContext(this._key, this._defaultValue);\n\t\t}\n\t}\n\n\tpublic get(): T | undefined {\n\t\treturn this._service.getContextKeyValue<T>(this._key);\n\t}\n}\n\nclass SimpleContextKeyChangeEvent implements IContextKeyChangeEvent {\n\tconstructor(readonly key: string) { }\n\taffectsSome(keys: IReadableSet<string>): boolean {\n\t\treturn keys.has(this.key);\n\t}\n}\n\nclass ArrayContextKeyChangeEvent implements IContextKeyChangeEvent {\n\tconstructor(readonly keys: string[]) { }\n\taffectsSome(keys: IReadableSet<string>): boolean {\n\t\tfor (const key of this.keys) {\n\t\t\tif (keys.has(key)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nclass CompositeContextKeyChangeEvent implements IContextKeyChangeEvent {\n\tconstructor(readonly events: IContextKeyChangeEvent[]) { }\n\taffectsSome(keys: IReadableSet<string>): boolean {\n\t\tfor (const e of this.events) {\n\t\t\tif (e.affectsSome(keys)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport abstract class AbstractContextKeyService implements IContextKeyService {\n\tdeclare _serviceBrand: undefined;\n\n\tprotected _isDisposed: boolean;\n\tprotected _myContextId: number;\n\n\tprotected _onDidChangeContext = new PauseableEmitter<IContextKeyChangeEvent>({ merge: input => new CompositeContextKeyChangeEvent(input) });\n\treadonly onDidChangeContext = this._onDidChangeContext.event;\n\n\tconstructor(myContextId: number) {\n\t\tthis._isDisposed = false;\n\t\tthis._myContextId = myContextId;\n\t}\n\n\tabstract dispose(): void;\n\n\tpublic createKey<T>(key: string, defaultValue: T | undefined): IContextKey<T> {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error(`AbstractContextKeyService has been disposed`);\n\t\t}\n\t\treturn new ContextKey(this, key, defaultValue);\n\t}\n\n\n\tbufferChangeEvents(callback: Function): void {\n\t\tthis._onDidChangeContext.pause();\n\t\ttry {\n\t\t\tcallback();\n\t\t} finally {\n\t\t\tthis._onDidChangeContext.resume();\n\t\t}\n\t}\n\n\tpublic createScoped(domNode: IContextKeyServiceTarget): IContextKeyService {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error(`AbstractContextKeyService has been disposed`);\n\t\t}\n\t\treturn new ScopedContextKeyService(this, domNode);\n\t}\n\n\tpublic contextMatchesRules(rules: ContextKeyExpression | undefined): boolean {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error(`AbstractContextKeyService has been disposed`);\n\t\t}\n\t\tconst context = this.getContextValuesContainer(this._myContextId);\n\t\tconst result = (rules ? rules.evaluate(context) : true);\n\t\t// console.group(rules.serialize() + ' -> ' + result);\n\t\t// rules.keys().forEach(key => { console.log(key, ctx[key]); });\n\t\t// console.groupEnd();\n\t\treturn result;\n\t}\n\n\tpublic getContextKeyValue<T>(key: string): T | undefined {\n\t\tif (this._isDisposed) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.getContextValuesContainer(this._myContextId).getValue<T>(key);\n\t}\n\n\tpublic setContext(key: string, value: any): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tconst myContext = this.getContextValuesContainer(this._myContextId);\n\t\tif (!myContext) {\n\t\t\treturn;\n\t\t}\n\t\tif (myContext.setValue(key, value)) {\n\t\t\tthis._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key));\n\t\t}\n\t}\n\n\tpublic removeContext(key: string): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.getContextValuesContainer(this._myContextId).removeValue(key)) {\n\t\t\tthis._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key));\n\t\t}\n\t}\n\n\tpublic getContext(target: IContextKeyServiceTarget | null): IContext {\n\t\tif (this._isDisposed) {\n\t\t\treturn NullContext.INSTANCE;\n\t\t}\n\t\treturn this.getContextValuesContainer(findContextAttr(target));\n\t}\n\n\tpublic abstract getContextValuesContainer(contextId: number): Context;\n\tpublic abstract createChildContext(parentContextId?: number): number;\n\tpublic abstract disposeContext(contextId: number): void;\n}\n\nexport class ContextKeyService extends AbstractContextKeyService implements IContextKeyService {\n\n\tprivate _lastContextId: number;\n\tprivate readonly _contexts = new Map<number, Context>();\n\n\tprivate readonly _toDispose = new DisposableStore();\n\n\tconstructor(@IConfigurationService configurationService: IConfigurationService) {\n\t\tsuper(0);\n\t\tthis._lastContextId = 0;\n\n\n\t\tconst myContext = new ConfigAwareContextValuesContainer(this._myContextId, configurationService, this._onDidChangeContext);\n\t\tthis._contexts.set(this._myContextId, myContext);\n\t\tthis._toDispose.add(myContext);\n\n\t\t// Uncomment this to see the contexts continuously logged\n\t\t// let lastLoggedValue: string | null = null;\n\t\t// setInterval(() => {\n\t\t// \tlet values = Object.keys(this._contexts).map((key) => this._contexts[key]);\n\t\t// \tlet logValue = values.map(v => JSON.stringify(v._value, null, '\\t')).join('\\n');\n\t\t// \tif (lastLoggedValue !== logValue) {\n\t\t// \t\tlastLoggedValue = logValue;\n\t\t// \t\tconsole.log(lastLoggedValue);\n\t\t// \t}\n\t\t// }, 2000);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._onDidChangeContext.dispose();\n\t\tthis._isDisposed = true;\n\t\tthis._toDispose.dispose();\n\t}\n\n\tpublic getContextValuesContainer(contextId: number): Context {\n\t\tif (this._isDisposed) {\n\t\t\treturn NullContext.INSTANCE;\n\t\t}\n\t\treturn this._contexts.get(contextId) || NullContext.INSTANCE;\n\t}\n\n\tpublic createChildContext(parentContextId: number = this._myContextId): number {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error(`ContextKeyService has been disposed`);\n\t\t}\n\t\tlet id = (++this._lastContextId);\n\t\tthis._contexts.set(id, new Context(id, this.getContextValuesContainer(parentContextId)));\n\t\treturn id;\n\t}\n\n\tpublic disposeContext(contextId: number): void {\n\t\tif (!this._isDisposed) {\n\t\t\tthis._contexts.delete(contextId);\n\t\t}\n\t}\n}\n\nclass ScopedContextKeyService extends AbstractContextKeyService {\n\n\tprivate _parent: AbstractContextKeyService;\n\tprivate _domNode: IContextKeyServiceTarget;\n\n\tprivate readonly _parentChangeListener = new MutableDisposable();\n\n\tconstructor(parent: AbstractContextKeyService, domNode: IContextKeyServiceTarget) {\n\t\tsuper(parent.createChildContext());\n\t\tthis._parent = parent;\n\t\tthis._updateParentChangeListener();\n\n\t\tthis._domNode = domNode;\n\t\tif (this._domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)) {\n\t\t\tlet extraInfo = '';\n\t\t\tif ((this._domNode as HTMLElement).classList) {\n\t\t\t\textraInfo = Array.from((this._domNode as HTMLElement).classList.values()).join(', ');\n\t\t\t}\n\n\t\t\tconsole.error(`Element already has context attribute${extraInfo ? ': ' + extraInfo : ''}`);\n\t\t}\n\t\tthis._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR, String(this._myContextId));\n\t}\n\n\tprivate _updateParentChangeListener(): void {\n\t\t// Forward parent events to this listener. Parent will change.\n\t\tthis._parentChangeListener.value = this._parent.onDidChangeContext(this._onDidChangeContext.fire, this._onDidChangeContext);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onDidChangeContext.dispose();\n\t\tthis._parent.disposeContext(this._myContextId);\n\t\tthis._parentChangeListener.dispose();\n\t\tthis._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR);\n\t\tthis._isDisposed = true;\n\t}\n\n\tpublic getContextValuesContainer(contextId: number): Context {\n\t\tif (this._isDisposed) {\n\t\t\treturn NullContext.INSTANCE;\n\t\t}\n\t\treturn this._parent.getContextValuesContainer(contextId);\n\t}\n\n\tpublic createChildContext(parentContextId: number = this._myContextId): number {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error(`ScopedContextKeyService has been disposed`);\n\t\t}\n\t\treturn this._parent.createChildContext(parentContextId);\n\t}\n\n\tpublic disposeContext(contextId: number): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._parent.disposeContext(contextId);\n\t}\n}\n\nfunction findContextAttr(domNode: IContextKeyServiceTarget | null): number {\n\twhile (domNode) {\n\t\tif (domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)) {\n\t\t\tconst attr = domNode.getAttribute(KEYBINDING_CONTEXT_ATTR);\n\t\t\tif (attr) {\n\t\t\t\treturn parseInt(attr, 10);\n\t\t\t}\n\t\t\treturn NaN;\n\t\t}\n\t\tdomNode = domNode.parentElement;\n\t}\n\treturn 0;\n}\n\nCommandsRegistry.registerCommand(SET_CONTEXT_COMMAND_ID, function (accessor, contextKey: any, contextValue: any) {\n\taccessor.get(IContextKeyService).createKey(String(contextKey), contextValue);\n});\n\nCommandsRegistry.registerCommand({\n\tid: 'getContextKeyInfo',\n\thandler() {\n\t\treturn [...RawContextKey.all()].sort((a, b) => a.key.localeCompare(b.key));\n\t},\n\tdescription: {\n\t\tdescription: localize('getContextKeyInfo', \"A command that returns information about context keys\"),\n\t\targs: []\n\t}\n});\n\nCommandsRegistry.registerCommand('_generateContextKeyInfo', function () {\n\tconst result: ContextKeyInfo[] = [];\n\tconst seen = new Set<string>();\n\tfor (let info of RawContextKey.all()) {\n\t\tif (!seen.has(info.key)) {\n\t\t\tseen.add(info.key);\n\t\t\tresult.push(info);\n\t\t}\n\t}\n\tresult.sort((a, b) => a.key.localeCompare(b.key));\n\tconsole.log(JSON.stringify(result, undefined, 2));\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 { isIOS, isLinux, isMacintosh, isWeb, isWindows } from 'vs/base/common/platform';\nimport { localize } from 'vs/nls';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\n\nexport const IsMacContext = new RawContextKey<boolean>('isMac', isMacintosh, localize('isMac', \"Whether the operating system is macOS\"));\nexport const IsLinuxContext = new RawContextKey<boolean>('isLinux', isLinux, localize('isLinux', \"Whether the operating system is Linux\"));\nexport const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindows, localize('isWindows', \"Whether the operating system is Windows\"));\n\nexport const IsWebContext = new RawContextKey<boolean>('isWeb', isWeb, localize('isWeb', \"Whether the platform is a web browser\"));\nexport const IsMacNativeContext = new RawContextKey<boolean>('isMacNative', isMacintosh && !isWeb, localize('isMacNative', \"Whether the operating system is macOS on a non-browser platform\"));\nexport const IsIOSContext = new RawContextKey<boolean>('isIOS', isIOS, localize('isIOS', \"Whether the operating system is iOS\"));\n\nexport const IsDevelopmentContext = new RawContextKey<boolean>('isDevelopment', false, true);\n\nexport const InputFocusedContextKey = 'inputFocus';\nexport const InputFocusedContext = new RawContextKey<boolean>(InputFocusedContextKey, false, localize('inputFocus', \"Whether keyboard focus is inside an input box\"));\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 { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { AnchorAlignment, AnchorAxisAlignment, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IContextViewService = createDecorator<IContextViewService>('contextViewService');\n\nexport interface IContextViewService extends IContextViewProvider {\n\n\treadonly _serviceBrand: undefined;\n\n\tshowContextView(delegate: IContextViewDelegate, container?: HTMLElement, shadowRoot?: boolean): IDisposable;\n\thideContextView(data?: any): void;\n\tgetContextViewElement(): HTMLElement;\n}\n\nexport interface IContextViewDelegate {\n\n\tcanRelayout?: boolean; // Default: true\n\n\tgetAnchor(): HTMLElement | { x: number; y: number; width?: number; height?: number };\n\trender(container: HTMLElement): IDisposable;\n\tonHide?(data?: any): void;\n\tfocus?(): void;\n\tanchorAlignment?: AnchorAlignment;\n\tanchorAxisAlignment?: AnchorAxisAlignment;\n}\n\nexport const IContextMenuService = createDecorator<IContextMenuService>('contextMenuService');\n\nexport interface IContextMenuService {\n\n\treadonly _serviceBrand: undefined;\n\n\tshowContextMenu(delegate: IContextMenuDelegate): void;\n}\n","\nimport Severity from 'vs/base/common/severity';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport interface IConfirmation {\n\ttitle?: string;\n\tmessage: string;\n\tdetail?: string;\n\tprimaryButton?: string;\n\tsecondaryButton?: string;\n}\n\nexport interface IConfirmationResult {\n\n\t/**\n\t * Will be true if the dialog was confirmed with the primary button\n\t * pressed.\n\t */\n\tconfirmed: boolean;\n\n\t/**\n\t * This will only be defined if the confirmation was created\n\t * with the checkbox option defined.\n\t */\n\tcheckboxChecked?: boolean;\n}\n\nexport interface IShowResult {\n\n\t/**\n\t * Selected choice index. If the user refused to choose,\n\t * then a promise with index of `cancelId` option is returned. If there is no such\n\t * option then promise with index `0` is returned.\n\t */\n\tchoice: number;\n}\n\nexport const IDialogService = createDecorator<IDialogService>('dialogService');\n\nexport interface IDialogOptions {\n\tcancelId?: number;\n}\n\n/**\n * A service to bring up modal dialogs.\n *\n * Note: use the `INotificationService.prompt()` method for a non-modal way to ask\n * the user for input.\n */\nexport interface IDialogService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Ask the user for confirmation with a modal dialog.\n\t */\n\tconfirm(confirmation: IConfirmation): Promise<IConfirmationResult>;\n\n\t/**\n\t * Present a modal dialog to the user.\n\t *\n\t * @returns A promise with the selected choice index. If the user refused to choose,\n\t * then a promise with index of `cancelId` option is returned. If there is no such\n\t * option then promise with index `0` is returned.\n\t */\n\tshow(severity: Severity, message: string, buttons?: string[], options?: IDialogOptions): Promise<IShowResult>;\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 { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';\nimport { SyncDescriptor } from './descriptors';\n\nexport class ServiceCollection {\n\n\tprivate _entries = new Map<ServiceIdentifier<any>, any>();\n\n\tconstructor(...entries: [ServiceIdentifier<any>, any][]) {\n\t\tfor (let [id, service] of entries) {\n\t\t\tthis.set(id, service);\n\t\t}\n\t}\n\n\tset<T>(id: ServiceIdentifier<T>, instanceOrDescriptor: T | SyncDescriptor<T>): T | SyncDescriptor<T> {\n\t\tconst result = this._entries.get(id);\n\t\tthis._entries.set(id, instanceOrDescriptor);\n\t\treturn result;\n\t}\n\n\tget<T>(id: ServiceIdentifier<T>): T | SyncDescriptor<T> {\n\t\treturn this._entries.get(id);\n\t}\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 { IdleValue } from 'vs/base/common/async';\nimport { illegalState } from 'vs/base/common/errors';\nimport { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';\nimport { Graph } from 'vs/platform/instantiation/common/graph';\nimport { IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from 'vs/platform/instantiation/common/instantiation';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\n\n// TRACING\nconst _enableTracing = false;\n\nclass CyclicDependencyError extends Error {\n\tconstructor(graph: Graph<any>) {\n\t\tsuper('cyclic dependency between services');\n\t\tthis.message = graph.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: \\n${graph.toString()}`;\n\t}\n}\n\nexport class InstantiationService implements IInstantiationService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _services: ServiceCollection;\n\tprivate readonly _strict: boolean;\n\tprivate readonly _parent?: InstantiationService;\n\n\tconstructor(services: ServiceCollection = new ServiceCollection(), strict: boolean = false, parent?: InstantiationService) {\n\t\tthis._services = services;\n\t\tthis._strict = strict;\n\t\tthis._parent = parent;\n\n\t\tthis._services.set(IInstantiationService, this);\n\t}\n\n\tcreateChild(services: ServiceCollection): IInstantiationService {\n\t\treturn new InstantiationService(services, this._strict, this);\n\t}\n\n\tinvokeFunction<R, TS extends any[] = []>(fn: (accessor: ServicesAccessor, ...args: TS) => R, ...args: TS): R {\n\t\tlet _trace = Trace.traceInvocation(fn);\n\t\tlet _done = false;\n\t\ttry {\n\t\t\tconst accessor: ServicesAccessor = {\n\t\t\t\tget: <T>(id: ServiceIdentifier<T>) => {\n\n\t\t\t\t\tif (_done) {\n\t\t\t\t\t\tthrow illegalState('service accessor is only valid during the invocation of its target method');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = this._getOrCreateServiceInstance(id, _trace);\n\t\t\t\t\tif (!result) {\n\t\t\t\t\t\tthrow new Error(`[invokeFunction] unknown service '${id}'`);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn fn(accessor, ...args);\n\t\t} finally {\n\t\t\t_done = true;\n\t\t\t_trace.stop();\n\t\t}\n\t}\n\n\tcreateInstance(ctorOrDescriptor: any | SyncDescriptor<any>, ...rest: any[]): any {\n\t\tlet _trace: Trace;\n\t\tlet result: any;\n\t\tif (ctorOrDescriptor instanceof SyncDescriptor) {\n\t\t\t_trace = Trace.traceCreation(ctorOrDescriptor.ctor);\n\t\t\tresult = this._createInstance(ctorOrDescriptor.ctor, ctorOrDescriptor.staticArguments.concat(rest), _trace);\n\t\t} else {\n\t\t\t_trace = Trace.traceCreation(ctorOrDescriptor);\n\t\t\tresult = this._createInstance(ctorOrDescriptor, rest, _trace);\n\t\t}\n\t\t_trace.stop();\n\t\treturn result;\n\t}\n\n\tprivate _createInstance<T>(ctor: any, args: any[] = [], _trace: Trace): T {\n\n\t\t// arguments defined by service decorators\n\t\tlet serviceDependencies = _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index);\n\t\tlet serviceArgs: any[] = [];\n\t\tfor (const dependency of serviceDependencies) {\n\t\t\tlet service = this._getOrCreateServiceInstance(dependency.id, _trace);\n\t\t\tif (!service) {\n\t\t\t\tthis._throwIfStrict(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`, false);\n\t\t\t}\n\t\t\tserviceArgs.push(service);\n\t\t}\n\n\t\tlet firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length;\n\n\t\t// check for argument mismatches, adjust static args if needed\n\t\tif (args.length !== firstServiceArgPos) {\n\t\t\tconsole.warn(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`);\n\n\t\t\tlet delta = firstServiceArgPos - args.length;\n\t\t\tif (delta > 0) {\n\t\t\t\targs = args.concat(new Array(delta));\n\t\t\t} else {\n\t\t\t\targs = args.slice(0, firstServiceArgPos);\n\t\t\t}\n\t\t}\n\n\t\t// now create the instance\n\t\treturn <T>new ctor(...[...args, ...serviceArgs]);\n\t}\n\n\tprivate _setServiceInstance<T>(id: ServiceIdentifier<T>, instance: T): void {\n\t\tif (this._services.get(id) instanceof SyncDescriptor) {\n\t\t\tthis._services.set(id, instance);\n\t\t} else if (this._parent) {\n\t\t\tthis._parent._setServiceInstance(id, instance);\n\t\t} else {\n\t\t\tthrow new Error('illegalState - setting UNKNOWN service instance');\n\t\t}\n\t}\n\n\tprivate _getServiceInstanceOrDescriptor<T>(id: ServiceIdentifier<T>): T | SyncDescriptor<T> {\n\t\tlet instanceOrDesc = this._services.get(id);\n\t\tif (!instanceOrDesc && this._parent) {\n\t\t\treturn this._parent._getServiceInstanceOrDescriptor(id);\n\t\t} else {\n\t\t\treturn instanceOrDesc;\n\t\t}\n\t}\n\n\tprotected _getOrCreateServiceInstance<T>(id: ServiceIdentifier<T>, _trace: Trace): T {\n\t\tlet thing = this._getServiceInstanceOrDescriptor(id);\n\t\tif (thing instanceof SyncDescriptor) {\n\t\t\treturn this._safeCreateAndCacheServiceInstance(id, thing, _trace.branch(id, true));\n\t\t} else {\n\t\t\t_trace.branch(id, false);\n\t\t\treturn thing;\n\t\t}\n\t}\n\n\tprivate readonly _activeInstantiations = new Set<ServiceIdentifier<any>>();\n\n\n\tprivate _safeCreateAndCacheServiceInstance<T>(id: ServiceIdentifier<T>, desc: SyncDescriptor<T>, _trace: Trace): T {\n\t\tif (this._activeInstantiations.has(id)) {\n\t\t\tthrow new Error(`illegal state - RECURSIVELY instantiating service '${id}'`);\n\t\t}\n\t\tthis._activeInstantiations.add(id);\n\t\ttry {\n\t\t\treturn this._createAndCacheServiceInstance(id, desc, _trace);\n\t\t} finally {\n\t\t\tthis._activeInstantiations.delete(id);\n\t\t}\n\t}\n\n\tprivate _createAndCacheServiceInstance<T>(id: ServiceIdentifier<T>, desc: SyncDescriptor<T>, _trace: Trace): T {\n\n\t\ttype Triple = { id: ServiceIdentifier<any>; desc: SyncDescriptor<any>; _trace: Trace };\n\t\tconst graph = new Graph<Triple>(data => data.id.toString());\n\n\t\tlet cycleCount = 0;\n\t\tconst stack = [{ id, desc, _trace }];\n\t\twhile (stack.length) {\n\t\t\tconst item = stack.pop()!;\n\t\t\tgraph.lookupOrInsertNode(item);\n\n\t\t\t// a weak but working heuristic for cycle checks\n\t\t\tif (cycleCount++ > 1000) {\n\t\t\t\tthrow new CyclicDependencyError(graph);\n\t\t\t}\n\n\t\t\t// check all dependencies for existence and if they need to be created first\n\t\t\tfor (let dependency of _util.getServiceDependencies(item.desc.ctor)) {\n\n\t\t\t\tlet instanceOrDesc = this._getServiceInstanceOrDescriptor(dependency.id);\n\t\t\t\tif (!instanceOrDesc) {\n\t\t\t\t\tthis._throwIfStrict(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`, true);\n\t\t\t\t}\n\n\t\t\t\tif (instanceOrDesc instanceof SyncDescriptor) {\n\t\t\t\t\tconst d = { id: dependency.id, desc: instanceOrDesc, _trace: item._trace.branch(dependency.id, true) };\n\t\t\t\t\tgraph.insertEdge(item, d);\n\t\t\t\t\tstack.push(d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\tconst roots = graph.roots();\n\n\t\t\t// if there is no more roots but still\n\t\t\t// nodes in the graph we have a cycle\n\t\t\tif (roots.length === 0) {\n\t\t\t\tif (!graph.isEmpty()) {\n\t\t\t\t\tthrow new CyclicDependencyError(graph);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (const { data } of roots) {\n\t\t\t\t// Repeat the check for this still being a service sync descriptor. That's because\n\t\t\t\t// instantiating a dependency might have side-effect and recursively trigger instantiation\n\t\t\t\t// so that some dependencies are now fullfilled already.\n\t\t\t\tconst instanceOrDesc = this._getServiceInstanceOrDescriptor(data.id);\n\t\t\t\tif (instanceOrDesc instanceof SyncDescriptor) {\n\t\t\t\t\t// create instance and overwrite the service collections\n\t\t\t\t\tconst instance = this._createServiceInstanceWithOwner(data.id, data.desc.ctor, data.desc.staticArguments, data.desc.supportsDelayedInstantiation, data._trace);\n\t\t\t\t\tthis._setServiceInstance(data.id, instance);\n\t\t\t\t}\n\t\t\t\tgraph.removeNode(data);\n\t\t\t}\n\t\t}\n\t\treturn <T>this._getServiceInstanceOrDescriptor(id);\n\t}\n\n\tprivate _createServiceInstanceWithOwner<T>(id: ServiceIdentifier<T>, ctor: any, args: any[] = [], supportsDelayedInstantiation: boolean, _trace: Trace): T {\n\t\tif (this._services.get(id) instanceof SyncDescriptor) {\n\t\t\treturn this._createServiceInstance(ctor, args, supportsDelayedInstantiation, _trace);\n\t\t} else if (this._parent) {\n\t\t\treturn this._parent._createServiceInstanceWithOwner(id, ctor, args, supportsDelayedInstantiation, _trace);\n\t\t} else {\n\t\t\tthrow new Error(`illegalState - creating UNKNOWN service instance ${ctor.name}`);\n\t\t}\n\t}\n\n\tprivate _createServiceInstance<T>(ctor: any, args: any[] = [], _supportsDelayedInstantiation: boolean, _trace: Trace): T {\n\t\tif (!_supportsDelayedInstantiation) {\n\t\t\t// eager instantiation\n\t\t\treturn this._createInstance(ctor, args, _trace);\n\n\t\t} else {\n\t\t\t// Return a proxy object that's backed by an idle value. That\n\t\t\t// strategy is to instantiate services in our idle time or when actually\n\t\t\t// needed but not when injected into a consumer\n\t\t\tconst idle = new IdleValue<any>(() => this._createInstance<T>(ctor, args, _trace));\n\t\t\treturn <T>new Proxy(Object.create(null), {\n\t\t\t\tget(target: any, key: PropertyKey): any {\n\t\t\t\t\tif (key in target) {\n\t\t\t\t\t\treturn target[key];\n\t\t\t\t\t}\n\t\t\t\t\tlet obj = idle.value;\n\t\t\t\t\tlet prop = obj[key];\n\t\t\t\t\tif (typeof prop !== 'function') {\n\t\t\t\t\t\treturn prop;\n\t\t\t\t\t}\n\t\t\t\t\tprop = prop.bind(obj);\n\t\t\t\t\ttarget[key] = prop;\n\t\t\t\t\treturn prop;\n\t\t\t\t},\n\t\t\t\tset(_target: T, p: PropertyKey, value: any): boolean {\n\t\t\t\t\tidle.value[p] = value;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _throwIfStrict(msg: string, printWarning: boolean): void {\n\t\tif (printWarning) {\n\t\t\tconsole.warn(printWarning);\n\t\t}\n\t\tif (this._strict) {\n\t\t\tthrow new Error(msg);\n\t\t}\n\t}\n}\n\n//#region -- tracing ---\n\nconst enum TraceType {\n\tCreation, Invocation, Branch\n}\n\nexport class Trace {\n\n\tprivate static readonly _None = new class extends Trace {\n\t\tconstructor() { super(-1, null); }\n\t\toverride stop() { }\n\t\toverride branch() { return this; }\n\t};\n\n\tstatic traceInvocation(ctor: any): Trace {\n\t\treturn !_enableTracing ? Trace._None : new Trace(TraceType.Invocation, ctor.name || (ctor.toString() as string).substring(0, 42).replace(/\\n/g, ''));\n\t}\n\n\tstatic traceCreation(ctor: any): Trace {\n\t\treturn !_enableTracing ? Trace._None : new Trace(TraceType.Creation, ctor.name);\n\t}\n\n\tprivate static _totals: number = 0;\n\tprivate readonly _start: number = Date.now();\n\tprivate readonly _dep: [ServiceIdentifier<any>, boolean, Trace?][] = [];\n\n\tprivate constructor(\n\t\treadonly type: TraceType,\n\t\treadonly name: string | null\n\t) { }\n\n\tbranch(id: ServiceIdentifier<any>, first: boolean): Trace {\n\t\tlet child = new Trace(TraceType.Branch, id.toString());\n\t\tthis._dep.push([id, first, child]);\n\t\treturn child;\n\t}\n\n\tstop() {\n\t\tlet dur = Date.now() - this._start;\n\t\tTrace._totals += dur;\n\n\t\tlet causedCreation = false;\n\n\t\tfunction printChild(n: number, trace: Trace) {\n\t\t\tlet res: string[] = [];\n\t\t\tlet prefix = new Array(n + 1).join('\\t');\n\t\t\tfor (const [id, first, child] of trace._dep) {\n\t\t\t\tif (first && child) {\n\t\t\t\t\tcausedCreation = true;\n\t\t\t\t\tres.push(`${prefix}CREATES -> ${id}`);\n\t\t\t\t\tlet nested = printChild(n + 1, child);\n\t\t\t\t\tif (nested) {\n\t\t\t\t\t\tres.push(nested);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres.push(`${prefix}uses -> ${id}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res.join('\\n');\n\t\t}\n\n\t\tlet lines = [\n\t\t\t`${this.type === TraceType.Creation ? 'CREATE' : 'CALL'} ${this.name}`,\n\t\t\t`${printChild(1, this)}`,\n\t\t\t`DONE, took ${dur.toFixed(2)}ms (grand total ${Trace._totals.toFixed(2)}ms)`\n\t\t];\n\n\t\tif (dur > 2 || causedCreation) {\n\t\t\tconsole.log(lines.join('\\n'));\n\t\t}\n\t}\n}\n\n//#endregion\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 { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';\nimport { IntervalTimer, TimeoutTimer } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { KeybindingModifier, ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keybindings';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport * as nls from 'vs/nls';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey';\nimport { IKeybindingEvent, IKeybindingService, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';\nimport { IResolveResult, KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\n\ninterface CurrentChord {\n\tkeypress: string;\n\tlabel: string | null;\n}\n\nconst HIGH_FREQ_COMMANDS = /^(cursor|delete)/;\n\nexport abstract class AbstractKeybindingService extends Disposable implements IKeybindingService {\n\tpublic _serviceBrand: undefined;\n\n\tprotected readonly _onDidUpdateKeybindings: Emitter<IKeybindingEvent> = this._register(new Emitter<IKeybindingEvent>());\n\tget onDidUpdateKeybindings(): Event<IKeybindingEvent> {\n\t\treturn this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : Event.None; // Sinon stubbing walks properties on prototype\n\t}\n\n\tprivate _currentChord: CurrentChord | null;\n\tprivate _currentChordChecker: IntervalTimer;\n\tprivate _currentChordStatusMessage: IDisposable | null;\n\tprivate _ignoreSingleModifiers: KeybindingModifierSet;\n\tprivate _currentSingleModifier: KeybindingModifier | null;\n\tprivate _currentSingleModifierClearTimeout: TimeoutTimer;\n\n\tprotected _logging: boolean;\n\n\tconstructor(\n\t\tprivate _contextKeyService: IContextKeyService,\n\t\tprotected _commandService: ICommandService,\n\t\tprotected _telemetryService: ITelemetryService,\n\t\tprivate _notificationService: INotificationService,\n\t\tprotected _logService: ILogService,\n\t) {\n\t\tsuper();\n\n\t\tthis._currentChord = null;\n\t\tthis._currentChordChecker = new IntervalTimer();\n\t\tthis._currentChordStatusMessage = null;\n\t\tthis._ignoreSingleModifiers = KeybindingModifierSet.EMPTY;\n\t\tthis._currentSingleModifier = null;\n\t\tthis._currentSingleModifierClearTimeout = new TimeoutTimer();\n\t\tthis._logging = false;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprotected abstract _getResolver(): KeybindingResolver;\n\tprotected abstract _documentHasFocus(): boolean;\n\tpublic abstract resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;\n\n\tprotected _log(str: string): void {\n\t\tif (this._logging) {\n\t\t\tthis._logService.info(`[KeybindingService]: ${str}`);\n\t\t}\n\t}\n\n\tpublic getKeybindings(): readonly ResolvedKeybindingItem[] {\n\t\treturn this._getResolver().getKeybindings();\n\t}\n\n\tpublic lookupKeybinding(commandId: string, context?: IContextKeyService): ResolvedKeybinding | undefined {\n\t\tconst result = this._getResolver().lookupPrimaryKeybinding(commandId, context || this._contextKeyService);\n\t\tif (!result) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn result.resolvedKeybinding;\n\t}\n\n\tpublic dispatchEvent(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {\n\t\treturn this._dispatch(e, target);\n\t}\n\n\tpublic softDispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): IResolveResult | null {\n\t\tconst keybinding = this.resolveKeyboardEvent(e);\n\t\tif (keybinding.isChord()) {\n\t\t\tconsole.warn('Unexpected keyboard event mapped to a chord');\n\t\t\treturn null;\n\t\t}\n\t\tconst [firstPart,] = keybinding.getDispatchParts();\n\t\tif (firstPart === null) {\n\t\t\t// cannot be dispatched, probably only modifier keys\n\t\t\treturn null;\n\t\t}\n\n\t\tconst contextValue = this._contextKeyService.getContext(target);\n\t\tconst currentChord = this._currentChord ? this._currentChord.keypress : null;\n\t\treturn this._getResolver().resolve(contextValue, currentChord, firstPart);\n\t}\n\n\tprivate _enterChordMode(firstPart: string, keypressLabel: string | null): void {\n\t\tthis._currentChord = {\n\t\t\tkeypress: firstPart,\n\t\t\tlabel: keypressLabel\n\t\t};\n\t\tthis._currentChordStatusMessage = this._notificationService.status(nls.localize('first.chord', \"({0}) was pressed. Waiting for second key of chord...\", keypressLabel));\n\t\tconst chordEnterTime = Date.now();\n\t\tthis._currentChordChecker.cancelAndSet(() => {\n\n\t\t\tif (!this._documentHasFocus()) {\n\t\t\t\t// Focus has been lost => leave chord mode\n\t\t\t\tthis._leaveChordMode();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Date.now() - chordEnterTime > 5000) {\n\t\t\t\t// 5 seconds elapsed => leave chord mode\n\t\t\t\tthis._leaveChordMode();\n\t\t\t}\n\n\t\t}, 500);\n\t}\n\n\tprivate _leaveChordMode(): void {\n\t\tif (this._currentChordStatusMessage) {\n\t\t\tthis._currentChordStatusMessage.dispose();\n\t\t\tthis._currentChordStatusMessage = null;\n\t\t}\n\t\tthis._currentChordChecker.cancel();\n\t\tthis._currentChord = null;\n\t}\n\n\tprotected _dispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {\n\t\treturn this._doDispatch(this.resolveKeyboardEvent(e), target, /*isSingleModiferChord*/false);\n\t}\n\n\tprotected _singleModifierDispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {\n\t\tconst keybinding = this.resolveKeyboardEvent(e);\n\t\tconst [singleModifier,] = keybinding.getSingleModifierDispatchParts();\n\n\t\tif (singleModifier) {\n\n\t\t\tif (this._ignoreSingleModifiers.has(singleModifier)) {\n\t\t\t\tthis._log(`+ Ignoring single modifier ${singleModifier} due to it being pressed together with other keys.`);\n\t\t\t\tthis._ignoreSingleModifiers = KeybindingModifierSet.EMPTY;\n\t\t\t\tthis._currentSingleModifierClearTimeout.cancel();\n\t\t\t\tthis._currentSingleModifier = null;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis._ignoreSingleModifiers = KeybindingModifierSet.EMPTY;\n\n\t\t\tif (this._currentSingleModifier === null) {\n\t\t\t\t// we have a valid `singleModifier`, store it for the next keyup, but clear it in 300ms\n\t\t\t\tthis._log(`+ Storing single modifier for possible chord ${singleModifier}.`);\n\t\t\t\tthis._currentSingleModifier = singleModifier;\n\t\t\t\tthis._currentSingleModifierClearTimeout.cancelAndSet(() => {\n\t\t\t\t\tthis._log(`+ Clearing single modifier due to 300ms elapsed.`);\n\t\t\t\t\tthis._currentSingleModifier = null;\n\t\t\t\t}, 300);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (singleModifier === this._currentSingleModifier) {\n\t\t\t\t// bingo!\n\t\t\t\tthis._log(`/ Dispatching single modifier chord ${singleModifier} ${singleModifier}`);\n\t\t\t\tthis._currentSingleModifierClearTimeout.cancel();\n\t\t\t\tthis._currentSingleModifier = null;\n\t\t\t\treturn this._doDispatch(keybinding, target, /*isSingleModiferChord*/true);\n\t\t\t}\n\n\t\t\tthis._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${singleModifier}`);\n\t\t\tthis._currentSingleModifierClearTimeout.cancel();\n\t\t\tthis._currentSingleModifier = null;\n\t\t\treturn false;\n\t\t}\n\n\t\t// When pressing a modifier and holding it pressed with any other modifier or key combination,\n\t\t// the pressed modifiers should no longer be considered for single modifier dispatch.\n\t\tconst [firstPart,] = keybinding.getParts();\n\t\tthis._ignoreSingleModifiers = new KeybindingModifierSet(firstPart);\n\n\t\tif (this._currentSingleModifier !== null) {\n\t\t\tthis._log(`+ Clearing single modifier due to other key up.`);\n\t\t}\n\t\tthis._currentSingleModifierClearTimeout.cancel();\n\t\tthis._currentSingleModifier = null;\n\t\treturn false;\n\t}\n\n\tprivate _doDispatch(keybinding: ResolvedKeybinding, target: IContextKeyServiceTarget, isSingleModiferChord = false): boolean {\n\t\tlet shouldPreventDefault = false;\n\n\t\tif (keybinding.isChord()) {\n\t\t\tconsole.warn('Unexpected keyboard event mapped to a chord');\n\t\t\treturn false;\n\t\t}\n\n\t\tlet firstPart: string | null = null; // the first keybinding i.e. Ctrl+K\n\t\tlet currentChord: string | null = null;// the \"second\" keybinding i.e. Ctrl+K \"Ctrl+D\"\n\n\t\tif (isSingleModiferChord) {\n\t\t\tconst [dispatchKeyname,] = keybinding.getSingleModifierDispatchParts();\n\t\t\tfirstPart = dispatchKeyname;\n\t\t\tcurrentChord = dispatchKeyname;\n\t\t} else {\n\t\t\t[firstPart,] = keybinding.getDispatchParts();\n\t\t\tcurrentChord = this._currentChord ? this._currentChord.keypress : null;\n\t\t}\n\n\t\tif (firstPart === null) {\n\t\t\tthis._log(`\\\\ Keyboard event cannot be dispatched in keydown phase.`);\n\t\t\t// cannot be dispatched, probably only modifier keys\n\t\t\treturn shouldPreventDefault;\n\t\t}\n\n\t\tconst contextValue = this._contextKeyService.getContext(target);\n\t\tconst keypressLabel = keybinding.getLabel();\n\t\tconst resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart);\n\n\t\tthis._logService.trace('KeybindingService#dispatch', keypressLabel, resolveResult?.commandId);\n\n\t\tif (resolveResult && resolveResult.enterChord) {\n\t\t\tshouldPreventDefault = true;\n\t\t\tthis._enterChordMode(firstPart, keypressLabel);\n\t\t\treturn shouldPreventDefault;\n\t\t}\n\n\t\tif (this._currentChord) {\n\t\t\tif (!resolveResult || !resolveResult.commandId) {\n\t\t\t\tthis._notificationService.status(nls.localize('missing.chord', \"The key combination ({0}, {1}) is not a command.\", this._currentChord.label, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });\n\t\t\t\tshouldPreventDefault = true;\n\t\t\t}\n\t\t}\n\n\t\tthis._leaveChordMode();\n\n\t\tif (resolveResult && resolveResult.commandId) {\n\t\t\tif (!resolveResult.bubble) {\n\t\t\t\tshouldPreventDefault = true;\n\t\t\t}\n\t\t\tif (typeof resolveResult.commandArgs === 'undefined') {\n\t\t\t\tthis._commandService.executeCommand(resolveResult.commandId).then(undefined, err => this._notificationService.warn(err));\n\t\t\t} else {\n\t\t\t\tthis._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(undefined, err => this._notificationService.warn(err));\n\t\t\t}\n\t\t\tif (!HIGH_FREQ_COMMANDS.test(resolveResult.commandId)) {\n\t\t\t\tthis._telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });\n\t\t\t}\n\t\t}\n\n\t\treturn shouldPreventDefault;\n\t}\n\n\tmightProducePrintableCharacter(event: IKeyboardEvent): boolean {\n\t\tif (event.ctrlKey || event.metaKey) {\n\t\t\t// ignore ctrl/cmd-combination but not shift/alt-combinatios\n\t\t\treturn false;\n\t\t}\n\t\t// weak check for certain ranges. this is properly implemented in a subclass\n\t\t// with access to the KeyboardMapperFactory.\n\t\tif ((event.keyCode >= KeyCode.KeyA && event.keyCode <= KeyCode.KeyZ)\n\t\t\t|| (event.keyCode >= KeyCode.Digit0 && event.keyCode <= KeyCode.Digit9)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n\nclass KeybindingModifierSet {\n\n\tpublic static EMPTY = new KeybindingModifierSet(null);\n\n\tprivate readonly _ctrlKey: boolean;\n\tprivate readonly _shiftKey: boolean;\n\tprivate readonly _altKey: boolean;\n\tprivate readonly _metaKey: boolean;\n\n\tconstructor(source: ResolvedKeybindingPart | null) {\n\t\tthis._ctrlKey = source ? source.ctrlKey : false;\n\t\tthis._shiftKey = source ? source.shiftKey : false;\n\t\tthis._altKey = source ? source.altKey : false;\n\t\tthis._metaKey = source ? source.metaKey : false;\n\t}\n\n\thas(modifier: KeybindingModifier) {\n\t\tswitch (modifier) {\n\t\t\tcase 'ctrl': return this._ctrlKey;\n\t\t\tcase 'shift': return this._shiftKey;\n\t\t\tcase 'alt': return this._altKey;\n\t\t\tcase 'meta': return this._metaKey;\n\t\t}\n\t}\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 { illegalArgument } from 'vs/base/common/errors';\nimport { AriaLabelProvider, ElectronAcceleratorLabelProvider, UILabelProvider } from 'vs/base/common/keybindingLabels';\nimport { IBaseKeybinding, KeybindingModifier, ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keybindings';\nimport { OperatingSystem } from 'vs/base/common/platform';\n\nexport abstract class BaseResolvedKeybinding<T extends IBaseKeybinding> extends ResolvedKeybinding {\n\n\tprotected readonly _os: OperatingSystem;\n\tprotected readonly _parts: T[];\n\n\tconstructor(os: OperatingSystem, parts: T[]) {\n\t\tsuper();\n\t\tif (parts.length === 0) {\n\t\t\tthrow illegalArgument(`parts`);\n\t\t}\n\t\tthis._os = os;\n\t\tthis._parts = parts;\n\t}\n\n\tpublic getLabel(): string | null {\n\t\treturn UILabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getLabel(keybinding));\n\t}\n\n\tpublic getAriaLabel(): string | null {\n\t\treturn AriaLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getAriaLabel(keybinding));\n\t}\n\n\tpublic getElectronAccelerator(): string | null {\n\t\tif (this._parts.length > 1) {\n\t\t\t// [Electron Accelerators] Electron cannot handle chords\n\t\t\treturn null;\n\t\t}\n\t\tif (this._parts[0].isDuplicateModifierCase()) {\n\t\t\t// [Electron Accelerators] Electron cannot handle modifier only keybindings\n\t\t\t// e.g. \"shift shift\"\n\t\t\treturn null;\n\t\t}\n\t\treturn ElectronAcceleratorLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getElectronAccelerator(keybinding));\n\t}\n\n\tpublic isChord(): boolean {\n\t\treturn (this._parts.length > 1);\n\t}\n\n\tpublic getParts(): ResolvedKeybindingPart[] {\n\t\treturn this._parts.map((keybinding) => this._getPart(keybinding));\n\t}\n\n\tprivate _getPart(keybinding: T): ResolvedKeybindingPart {\n\t\treturn new ResolvedKeybindingPart(\n\t\t\tkeybinding.ctrlKey,\n\t\t\tkeybinding.shiftKey,\n\t\t\tkeybinding.altKey,\n\t\t\tkeybinding.metaKey,\n\t\t\tthis._getLabel(keybinding),\n\t\t\tthis._getAriaLabel(keybinding)\n\t\t);\n\t}\n\n\tpublic getDispatchParts(): (string | null)[] {\n\t\treturn this._parts.map((keybinding) => this._getDispatchPart(keybinding));\n\t}\n\n\tpublic getSingleModifierDispatchParts(): (KeybindingModifier | null)[] {\n\t\treturn this._parts.map((keybinding) => this._getSingleModifierDispatchPart(keybinding));\n\t}\n\n\tprotected abstract _getLabel(keybinding: T): string | null;\n\tprotected abstract _getAriaLabel(keybinding: T): string | null;\n\tprotected abstract _getElectronAccelerator(keybinding: T): string | null;\n\tprotected abstract _getDispatchPart(keybinding: T): string | null;\n\tprotected abstract _getSingleModifierDispatchPart(keybinding: T): KeybindingModifier | null;\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 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IResolveResult } from 'vs/platform/keybinding/common/keybindingResolver';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\n\nexport const enum KeybindingSource {\n\tDefault = 1,\n\tUser\n}\n\nexport interface IKeybindingEvent {\n\tsource: KeybindingSource;\n}\n\nexport interface IKeyboardEvent {\n\treadonly _standardKeyboardEventBrand: true;\n\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly keyCode: KeyCode;\n}\n\nexport const IKeybindingService = createDecorator<IKeybindingService>('keybindingService');\n\nexport interface IKeybindingService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidUpdateKeybindings: Event<IKeybindingEvent>;\n\n\t/**\n\t * Resolve and dispatch `keyboardEvent` and invoke the command.\n\t */\n\tdispatchEvent(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean;\n\n\t/**\n\t * Resolve and dispatch `keyboardEvent`, but do not invoke the command or change inner state.\n\t */\n\tsoftDispatch(keyboardEvent: IKeyboardEvent, target: IContextKeyServiceTarget): IResolveResult | null;\n\n\t/**\n\t * Look up the preferred (last defined) keybinding for a command.\n\t * @returns The preferred keybinding or null if the command is not bound.\n\t */\n\tlookupKeybinding(commandId: string, context?: IContextKeyService): ResolvedKeybinding | undefined;\n\n\tgetKeybindings(): readonly ResolvedKeybindingItem[];\n\n\t/**\n\t * Will the given key event produce a character that's rendered on screen, e.g. in a\n\t * text box. *Note* that the results of this function can be incorrect.\n\t */\n\tmightProducePrintableCharacter(event: IKeyboardEvent): boolean;\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 { implies, ContextKeyExpression, ContextKeyExprType, IContext, IContextKeyService, expressionsAreEqualWithConstantSubstitution } from 'vs/platform/contextkey/common/contextkey';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\n\nexport interface IResolveResult {\n\t/** Whether the resolved keybinding is entering a chord */\n\tenterChord: boolean;\n\t/** Whether the resolved keybinding is leaving (and executing) a chord */\n\tleaveChord: boolean;\n\tcommandId: string | null;\n\tcommandArgs: any;\n\tbubble: boolean;\n}\n\nexport class KeybindingResolver {\n\tprivate readonly _log: (str: string) => void;\n\tprivate readonly _defaultKeybindings: ResolvedKeybindingItem[];\n\tprivate readonly _keybindings: ResolvedKeybindingItem[];\n\tprivate readonly _defaultBoundCommands: Map<string, boolean>;\n\tprivate readonly _map: Map<string, ResolvedKeybindingItem[]>;\n\tprivate readonly _lookupMap: Map<string, ResolvedKeybindingItem[]>;\n\n\tconstructor(\n\t\tdefaultKeybindings: ResolvedKeybindingItem[],\n\t\toverrides: ResolvedKeybindingItem[],\n\t\tlog: (str: string) => void\n\t) {\n\t\tthis._log = log;\n\t\tthis._defaultKeybindings = defaultKeybindings;\n\n\t\tthis._defaultBoundCommands = new Map<string, boolean>();\n\t\tfor (const defaultKeybinding of defaultKeybindings) {\n\t\t\tconst command = defaultKeybinding.command;\n\t\t\tif (command && command.charAt(0) !== '-') {\n\t\t\t\tthis._defaultBoundCommands.set(command, true);\n\t\t\t}\n\t\t}\n\n\t\tthis._map = new Map<string, ResolvedKeybindingItem[]>();\n\t\tthis._lookupMap = new Map<string, ResolvedKeybindingItem[]>();\n\n\t\tthis._keybindings = KeybindingResolver.handleRemovals(([] as ResolvedKeybindingItem[]).concat(defaultKeybindings).concat(overrides));\n\t\tfor (let i = 0, len = this._keybindings.length; i < len; i++) {\n\t\t\tlet k = this._keybindings[i];\n\t\t\tif (k.keypressParts.length === 0) {\n\t\t\t\t// unbound\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (k.when && k.when.type === ContextKeyExprType.False) {\n\t\t\t\t// when condition is false\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// TODO@chords\n\t\t\tthis._addKeyPress(k.keypressParts[0], k);\n\t\t}\n\t}\n\n\tprivate static _isTargetedForRemoval(defaultKb: ResolvedKeybindingItem, keypressFirstPart: string | null, keypressChordPart: string | null, when: ContextKeyExpression | undefined): boolean {\n\t\t// TODO@chords\n\t\tif (keypressFirstPart && defaultKb.keypressParts[0] !== keypressFirstPart) {\n\t\t\treturn false;\n\t\t}\n\t\t// TODO@chords\n\t\tif (keypressChordPart && defaultKb.keypressParts[1] !== keypressChordPart) {\n\t\t\treturn false;\n\t\t}\n\t\tif (when) {\n\t\t\tif (!defaultKb.when) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!expressionsAreEqualWithConstantSubstitution(when, defaultKb.when)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Looks for rules containing \"-commandId\" and removes them.\n\t */\n\tpublic static handleRemovals(rules: ResolvedKeybindingItem[]): ResolvedKeybindingItem[] {\n\t\t// Do a first pass and construct a hash-map for removals\n\t\tconst removals = new Map<string, ResolvedKeybindingItem[]>();\n\t\tfor (let i = 0, len = rules.length; i < len; i++) {\n\t\t\tconst rule = rules[i];\n\t\t\tif (rule.command && rule.command.charAt(0) === '-') {\n\t\t\t\tconst command = rule.command.substring(1);\n\t\t\t\tif (!removals.has(command)) {\n\t\t\t\t\tremovals.set(command, [rule]);\n\t\t\t\t} else {\n\t\t\t\t\tremovals.get(command)!.push(rule);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (removals.size === 0) {\n\t\t\t// There are no removals\n\t\t\treturn rules;\n\t\t}\n\n\t\t// Do a second pass and keep only non-removed keybindings\n\t\tconst result: ResolvedKeybindingItem[] = [];\n\t\tfor (let i = 0, len = rules.length; i < len; i++) {\n\t\t\tconst rule = rules[i];\n\n\t\t\tif (!rule.command || rule.command.length === 0) {\n\t\t\t\tresult.push(rule);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (rule.command.charAt(0) === '-') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst commandRemovals = removals.get(rule.command);\n\t\t\tif (!commandRemovals || !rule.isDefault) {\n\t\t\t\tresult.push(rule);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet isRemoved = false;\n\t\t\tfor (const commandRemoval of commandRemovals) {\n\t\t\t\t// TODO@chords\n\t\t\t\tconst keypressFirstPart = commandRemoval.keypressParts[0];\n\t\t\t\tconst keypressChordPart = commandRemoval.keypressParts[1];\n\t\t\t\tconst when = commandRemoval.when;\n\t\t\t\tif (this._isTargetedForRemoval(rule, keypressFirstPart, keypressChordPart, when)) {\n\t\t\t\t\tisRemoved = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isRemoved) {\n\t\t\t\tresult.push(rule);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _addKeyPress(keypress: string, item: ResolvedKeybindingItem): void {\n\n\t\tconst conflicts = this._map.get(keypress);\n\n\t\tif (typeof conflicts === 'undefined') {\n\t\t\t// There is no conflict so far\n\t\t\tthis._map.set(keypress, [item]);\n\t\t\tthis._addToLookupMap(item);\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = conflicts.length - 1; i >= 0; i--) {\n\t\t\tlet conflict = conflicts[i];\n\n\t\t\tif (conflict.command === item.command) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst conflictIsChord = (conflict.keypressParts.length > 1);\n\t\t\tconst itemIsChord = (item.keypressParts.length > 1);\n\n\t\t\t// TODO@chords\n\t\t\tif (conflictIsChord && itemIsChord && conflict.keypressParts[1] !== item.keypressParts[1]) {\n\t\t\t\t// The conflict only shares the chord start with this command\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (KeybindingResolver.whenIsEntirelyIncluded(conflict.when, item.when)) {\n\t\t\t\t// `item` completely overwrites `conflict`\n\t\t\t\t// Remove conflict from the lookupMap\n\t\t\t\tthis._removeFromLookupMap(conflict);\n\t\t\t}\n\t\t}\n\n\t\tconflicts.push(item);\n\t\tthis._addToLookupMap(item);\n\t}\n\n\tprivate _addToLookupMap(item: ResolvedKeybindingItem): void {\n\t\tif (!item.command) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet arr = this._lookupMap.get(item.command);\n\t\tif (typeof arr === 'undefined') {\n\t\t\tarr = [item];\n\t\t\tthis._lookupMap.set(item.command, arr);\n\t\t} else {\n\t\t\tarr.push(item);\n\t\t}\n\t}\n\n\tprivate _removeFromLookupMap(item: ResolvedKeybindingItem): void {\n\t\tif (!item.command) {\n\t\t\treturn;\n\t\t}\n\t\tlet arr = this._lookupMap.get(item.command);\n\t\tif (typeof arr === 'undefined') {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\t\tif (arr[i] === item) {\n\t\t\t\tarr.splice(i, 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if it is provable `a` implies `b`.\n\t */\n\tpublic static whenIsEntirelyIncluded(a: ContextKeyExpression | null | undefined, b: ContextKeyExpression | null | undefined): boolean {\n\t\tif (!b || b.type === ContextKeyExprType.True) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!a || a.type === ContextKeyExprType.True) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn implies(a, b);\n\t}\n\n\tpublic getKeybindings(): readonly ResolvedKeybindingItem[] {\n\t\treturn this._keybindings;\n\t}\n\n\tpublic lookupPrimaryKeybinding(commandId: string, context: IContextKeyService): ResolvedKeybindingItem | null {\n\t\tconst items = this._lookupMap.get(commandId);\n\t\tif (typeof items === 'undefined' || items.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tif (items.length === 1) {\n\t\t\treturn items[0];\n\t\t}\n\n\t\tfor (let i = items.length - 1; i >= 0; i--) {\n\t\t\tconst item = items[i];\n\t\t\tif (context.contextMatchesRules(item.when)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\n\t\treturn items[items.length - 1];\n\t}\n\n\tpublic resolve(context: IContext, currentChord: string | null, keypress: string): IResolveResult | null {\n\t\tthis._log(`| Resolving ${keypress}${currentChord ? ` chorded from ${currentChord}` : ``}`);\n\t\tlet lookupMap: ResolvedKeybindingItem[] | null = null;\n\n\t\tif (currentChord !== null) {\n\t\t\t// Fetch all chord bindings for `currentChord`\n\n\t\t\tconst candidates = this._map.get(currentChord);\n\t\t\tif (typeof candidates === 'undefined') {\n\t\t\t\t// No chords starting with `currentChord`\n\t\t\t\tthis._log(`\\\\ No keybinding entries.`);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlookupMap = [];\n\t\t\tfor (let i = 0, len = candidates.length; i < len; i++) {\n\t\t\t\tlet candidate = candidates[i];\n\t\t\t\t// TODO@chords\n\t\t\t\tif (candidate.keypressParts[1] === keypress) {\n\t\t\t\t\tlookupMap.push(candidate);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst candidates = this._map.get(keypress);\n\t\t\tif (typeof candidates === 'undefined') {\n\t\t\t\t// No bindings with `keypress`\n\t\t\t\tthis._log(`\\\\ No keybinding entries.`);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlookupMap = candidates;\n\t\t}\n\n\t\tlet result = this._findCommand(context, lookupMap);\n\t\tif (!result) {\n\t\t\tthis._log(`\\\\ From ${lookupMap.length} keybinding entries, no when clauses matched the context.`);\n\t\t\treturn null;\n\t\t}\n\n\t\t// TODO@chords\n\t\tif (currentChord === null && result.keypressParts.length > 1 && result.keypressParts[1] !== null) {\n\t\t\tthis._log(`\\\\ From ${lookupMap.length} keybinding entries, matched chord, when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`);\n\t\t\treturn {\n\t\t\t\tenterChord: true,\n\t\t\t\tleaveChord: false,\n\t\t\t\tcommandId: null,\n\t\t\t\tcommandArgs: null,\n\t\t\t\tbubble: false\n\t\t\t};\n\t\t}\n\n\t\tthis._log(`\\\\ From ${lookupMap.length} keybinding entries, matched ${result.command}, when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`);\n\t\treturn {\n\t\t\tenterChord: false,\n\t\t\tleaveChord: result.keypressParts.length > 1,\n\t\t\tcommandId: result.command,\n\t\t\tcommandArgs: result.commandArgs,\n\t\t\tbubble: result.bubble\n\t\t};\n\t}\n\n\tprivate _findCommand(context: IContext, matches: ResolvedKeybindingItem[]): ResolvedKeybindingItem | null {\n\t\tfor (let i = matches.length - 1; i >= 0; i--) {\n\t\t\tlet k = matches[i];\n\n\t\t\tif (!KeybindingResolver._contextMatchesRules(context, k.when)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn k;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _contextMatchesRules(context: IContext, rules: ContextKeyExpression | null | undefined): boolean {\n\t\tif (!rules) {\n\t\t\treturn true;\n\t\t}\n\t\treturn rules.evaluate(context);\n\t}\n}\n\nfunction printWhenExplanation(when: ContextKeyExpression | undefined): string {\n\tif (!when) {\n\t\treturn `no when condition`;\n\t}\n\treturn `${when.serialize()}`;\n}\n\nfunction printSourceExplanation(kb: ResolvedKeybindingItem): string {\n\treturn (\n\t\tkb.extensionId\n\t\t\t? (kb.isBuiltinExtension ? `built-in extension ${kb.extensionId}` : `user extension ${kb.extensionId}`)\n\t\t\t: (kb.isDefault ? `built-in` : `user`)\n\t);\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 { CharCode } from 'vs/base/common/charCode';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';\n\nexport class ResolvedKeybindingItem {\n\t_resolvedKeybindingItemBrand: void = undefined;\n\n\tpublic readonly resolvedKeybinding: ResolvedKeybinding | undefined;\n\tpublic readonly keypressParts: string[];\n\tpublic readonly bubble: boolean;\n\tpublic readonly command: string | null;\n\tpublic readonly commandArgs: any;\n\tpublic readonly when: ContextKeyExpression | undefined;\n\tpublic readonly isDefault: boolean;\n\tpublic readonly extensionId: string | null;\n\tpublic readonly isBuiltinExtension: boolean;\n\n\tconstructor(resolvedKeybinding: ResolvedKeybinding | undefined, command: string | null, commandArgs: any, when: ContextKeyExpression | undefined, isDefault: boolean, extensionId: string | null, isBuiltinExtension: boolean) {\n\t\tthis.resolvedKeybinding = resolvedKeybinding;\n\t\tthis.keypressParts = resolvedKeybinding ? removeElementsAfterNulls(resolvedKeybinding.getDispatchParts()) : [];\n\t\tif (resolvedKeybinding && this.keypressParts.length === 0) {\n\t\t\t// handle possible single modifier chord keybindings\n\t\t\tthis.keypressParts = removeElementsAfterNulls(resolvedKeybinding.getSingleModifierDispatchParts());\n\t\t}\n\t\tthis.bubble = (command ? command.charCodeAt(0) === CharCode.Caret : false);\n\t\tthis.command = this.bubble ? command!.substr(1) : command;\n\t\tthis.commandArgs = commandArgs;\n\t\tthis.when = when;\n\t\tthis.isDefault = isDefault;\n\t\tthis.extensionId = extensionId;\n\t\tthis.isBuiltinExtension = isBuiltinExtension;\n\t}\n}\n\nexport function removeElementsAfterNulls<T>(arr: (T | null)[]): T[] {\n\tlet result: T[] = [];\n\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\tconst element = arr[i];\n\t\tif (!element) {\n\t\t\t// stop processing at first encountered null\n\t\t\treturn result;\n\t\t}\n\t\tresult.push(element);\n\t}\n\treturn result;\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 { KeyCode, KeyCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, ScanCode } from 'vs/base/common/keyCodes';\nimport { ChordKeybinding, Keybinding, KeybindingModifier, SimpleKeybinding, ScanCodeBinding } from 'vs/base/common/keybindings';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport { BaseResolvedKeybinding } from 'vs/platform/keybinding/common/baseResolvedKeybinding';\nimport { removeElementsAfterNulls } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\n\n/**\n * Do not instantiate. Use KeybindingService to get a ResolvedKeybinding seeded with information about the current kb layout.\n */\nexport class USLayoutResolvedKeybinding extends BaseResolvedKeybinding<SimpleKeybinding> {\n\n\tconstructor(actual: Keybinding, os: OperatingSystem) {\n\t\tsuper(os, actual.parts);\n\t}\n\n\tprivate _keyCodeToUILabel(keyCode: KeyCode): string {\n\t\tif (this._os === OperatingSystem.Macintosh) {\n\t\t\tswitch (keyCode) {\n\t\t\t\tcase KeyCode.LeftArrow:\n\t\t\t\t\treturn 'â†';\n\t\t\t\tcase KeyCode.UpArrow:\n\t\t\t\t\treturn '↑';\n\t\t\t\tcase KeyCode.RightArrow:\n\t\t\t\t\treturn '→';\n\t\t\t\tcase KeyCode.DownArrow:\n\t\t\t\t\treturn '↓';\n\t\t\t}\n\t\t}\n\t\treturn KeyCodeUtils.toString(keyCode);\n\t}\n\n\tprotected _getLabel(keybinding: SimpleKeybinding): string | null {\n\t\tif (keybinding.isDuplicateModifierCase()) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._keyCodeToUILabel(keybinding.keyCode);\n\t}\n\n\tprotected _getAriaLabel(keybinding: SimpleKeybinding): string | null {\n\t\tif (keybinding.isDuplicateModifierCase()) {\n\t\t\treturn '';\n\t\t}\n\t\treturn KeyCodeUtils.toString(keybinding.keyCode);\n\t}\n\n\tprotected _getElectronAccelerator(keybinding: SimpleKeybinding): string | null {\n\t\treturn KeyCodeUtils.toElectronAccelerator(keybinding.keyCode);\n\t}\n\n\tprotected _getDispatchPart(keybinding: SimpleKeybinding): string | null {\n\t\treturn USLayoutResolvedKeybinding.getDispatchStr(keybinding);\n\t}\n\n\tpublic static getDispatchStr(keybinding: SimpleKeybinding): string | null {\n\t\tif (keybinding.isModifierKey()) {\n\t\t\treturn null;\n\t\t}\n\t\tlet result = '';\n\n\t\tif (keybinding.ctrlKey) {\n\t\t\tresult += 'ctrl+';\n\t\t}\n\t\tif (keybinding.shiftKey) {\n\t\t\tresult += 'shift+';\n\t\t}\n\t\tif (keybinding.altKey) {\n\t\t\tresult += 'alt+';\n\t\t}\n\t\tif (keybinding.metaKey) {\n\t\t\tresult += 'meta+';\n\t\t}\n\t\tresult += KeyCodeUtils.toString(keybinding.keyCode);\n\n\t\treturn result;\n\t}\n\n\tprotected _getSingleModifierDispatchPart(keybinding: SimpleKeybinding): KeybindingModifier | null {\n\t\tif (keybinding.keyCode === KeyCode.Ctrl && !keybinding.shiftKey && !keybinding.altKey && !keybinding.metaKey) {\n\t\t\treturn 'ctrl';\n\t\t}\n\t\tif (keybinding.keyCode === KeyCode.Shift && !keybinding.ctrlKey && !keybinding.altKey && !keybinding.metaKey) {\n\t\t\treturn 'shift';\n\t\t}\n\t\tif (keybinding.keyCode === KeyCode.Alt && !keybinding.ctrlKey && !keybinding.shiftKey && !keybinding.metaKey) {\n\t\t\treturn 'alt';\n\t\t}\n\t\tif (keybinding.keyCode === KeyCode.Meta && !keybinding.ctrlKey && !keybinding.shiftKey && !keybinding.altKey) {\n\t\t\treturn 'meta';\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * *NOTE*: Check return value for `KeyCode.Unknown`.\n\t */\n\tprivate static _scanCodeToKeyCode(scanCode: ScanCode): KeyCode {\n\t\tconst immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];\n\t\tif (immutableKeyCode !== KeyCode.DependsOnKbLayout) {\n\t\t\treturn immutableKeyCode;\n\t\t}\n\n\t\tswitch (scanCode) {\n\t\t\tcase ScanCode.KeyA: return KeyCode.KeyA;\n\t\t\tcase ScanCode.KeyB: return KeyCode.KeyB;\n\t\t\tcase ScanCode.KeyC: return KeyCode.KeyC;\n\t\t\tcase ScanCode.KeyD: return KeyCode.KeyD;\n\t\t\tcase ScanCode.KeyE: return KeyCode.KeyE;\n\t\t\tcase ScanCode.KeyF: return KeyCode.KeyF;\n\t\t\tcase ScanCode.KeyG: return KeyCode.KeyG;\n\t\t\tcase ScanCode.KeyH: return KeyCode.KeyH;\n\t\t\tcase ScanCode.KeyI: return KeyCode.KeyI;\n\t\t\tcase ScanCode.KeyJ: return KeyCode.KeyJ;\n\t\t\tcase ScanCode.KeyK: return KeyCode.KeyK;\n\t\t\tcase ScanCode.KeyL: return KeyCode.KeyL;\n\t\t\tcase ScanCode.KeyM: return KeyCode.KeyM;\n\t\t\tcase ScanCode.KeyN: return KeyCode.KeyN;\n\t\t\tcase ScanCode.KeyO: return KeyCode.KeyO;\n\t\t\tcase ScanCode.KeyP: return KeyCode.KeyP;\n\t\t\tcase ScanCode.KeyQ: return KeyCode.KeyQ;\n\t\t\tcase ScanCode.KeyR: return KeyCode.KeyR;\n\t\t\tcase ScanCode.KeyS: return KeyCode.KeyS;\n\t\t\tcase ScanCode.KeyT: return KeyCode.KeyT;\n\t\t\tcase ScanCode.KeyU: return KeyCode.KeyU;\n\t\t\tcase ScanCode.KeyV: return KeyCode.KeyV;\n\t\t\tcase ScanCode.KeyW: return KeyCode.KeyW;\n\t\t\tcase ScanCode.KeyX: return KeyCode.KeyX;\n\t\t\tcase ScanCode.KeyY: return KeyCode.KeyY;\n\t\t\tcase ScanCode.KeyZ: return KeyCode.KeyZ;\n\t\t\tcase ScanCode.Digit1: return KeyCode.Digit1;\n\t\t\tcase ScanCode.Digit2: return KeyCode.Digit2;\n\t\t\tcase ScanCode.Digit3: return KeyCode.Digit3;\n\t\t\tcase ScanCode.Digit4: return KeyCode.Digit4;\n\t\t\tcase ScanCode.Digit5: return KeyCode.Digit5;\n\t\t\tcase ScanCode.Digit6: return KeyCode.Digit6;\n\t\t\tcase ScanCode.Digit7: return KeyCode.Digit7;\n\t\t\tcase ScanCode.Digit8: return KeyCode.Digit8;\n\t\t\tcase ScanCode.Digit9: return KeyCode.Digit9;\n\t\t\tcase ScanCode.Digit0: return KeyCode.Digit0;\n\t\t\tcase ScanCode.Minus: return KeyCode.Minus;\n\t\t\tcase ScanCode.Equal: return KeyCode.Equal;\n\t\t\tcase ScanCode.BracketLeft: return KeyCode.BracketLeft;\n\t\t\tcase ScanCode.BracketRight: return KeyCode.BracketRight;\n\t\t\tcase ScanCode.Backslash: return KeyCode.Backslash;\n\t\t\tcase ScanCode.IntlHash: return KeyCode.Unknown; // missing\n\t\t\tcase ScanCode.Semicolon: return KeyCode.Semicolon;\n\t\t\tcase ScanCode.Quote: return KeyCode.Quote;\n\t\t\tcase ScanCode.Backquote: return KeyCode.Backquote;\n\t\t\tcase ScanCode.Comma: return KeyCode.Comma;\n\t\t\tcase ScanCode.Period: return KeyCode.Period;\n\t\t\tcase ScanCode.Slash: return KeyCode.Slash;\n\t\t\tcase ScanCode.IntlBackslash: return KeyCode.IntlBackslash;\n\t\t}\n\t\treturn KeyCode.Unknown;\n\t}\n\n\tprivate static _resolveSimpleUserBinding(binding: SimpleKeybinding | ScanCodeBinding | null): SimpleKeybinding | null {\n\t\tif (!binding) {\n\t\t\treturn null;\n\t\t}\n\t\tif (binding instanceof SimpleKeybinding) {\n\t\t\treturn binding;\n\t\t}\n\t\tconst keyCode = this._scanCodeToKeyCode(binding.scanCode);\n\t\tif (keyCode === KeyCode.Unknown) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new SimpleKeybinding(binding.ctrlKey, binding.shiftKey, binding.altKey, binding.metaKey, keyCode);\n\t}\n\n\tpublic static resolveUserBinding(input: (SimpleKeybinding | ScanCodeBinding)[], os: OperatingSystem): USLayoutResolvedKeybinding[] {\n\t\tconst parts: SimpleKeybinding[] = removeElementsAfterNulls(input.map(keybinding => this._resolveSimpleUserBinding(keybinding)));\n\t\tif (parts.length > 0) {\n\t\t\treturn [new USLayoutResolvedKeybinding(new ChordKeybinding(parts), os)];\n\t\t}\n\t\treturn [];\n\t}\n}\n","\nimport { URI } from 'vs/base/common/uri';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ILabelService = createDecorator<ILabelService>('labelService');\n\nexport interface ILabelService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Gets the human readable label for a uri.\n\t * If `relative` is passed returns a label relative to the workspace root that the uri belongs to.\n\t * If `noPrefix` is passed does not tildify the label and also does not prepand the root name for relative labels in a multi root scenario.\n\t * If `separator` is passed, will use that over the defined path separator of the formatter.\n\t */\n\tgetUriLabel(resource: URI, options?: { relative?: boolean; noPrefix?: boolean; endWithSeparator?: boolean; separator?: '/' | '\\\\' }): string;\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 { IDimension } from 'vs/base/browser/dom';\nimport { Event } from 'vs/base/common/event';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ILayoutService = createDecorator<ILayoutService>('layoutService');\n\nexport interface ILayoutService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * The dimensions of the container.\n\t */\n\treadonly dimension: IDimension;\n\n\t/**\n\t * Does the application have a single container?\n\t */\n\treadonly hasContainer: boolean;\n\n\t/**\n\t * Container of the application.\n\t */\n\treadonly container: HTMLElement;\n\n\t/**\n\t * An offset to use for positioning elements inside the container.\n\t */\n\treadonly offset?: { top: number };\n\n\t/**\n\t * An event that is emitted when the container is layed out. The\n\t * event carries the dimensions of the container as part of it.\n\t */\n\treadonly onDidLayout: Event<IDimension>;\n\n\t/**\n\t * Focus the primary component of the container.\n\t */\n\tfocus(): void;\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 * as dom from 'vs/base/browser/dom';\nimport { Event } from 'vs/base/common/event';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\n\nclass StandaloneLayoutService implements ILayoutService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tpublic onDidLayout = Event.None;\n\n\tprivate _dimension?: dom.IDimension;\n\tget dimension(): dom.IDimension {\n\t\tif (!this._dimension) {\n\t\t\tthis._dimension = dom.getClientArea(window.document.body);\n\t\t}\n\n\t\treturn this._dimension;\n\t}\n\n\tget hasContainer(): boolean {\n\t\treturn false;\n\t}\n\n\tget container(): HTMLElement {\n\t\t// On a page, multiple editors can be created. Therefore, there are multiple containers, not\n\t\t// just a single one. Please use `ICodeEditorService` to get the current focused code editor\n\t\t// and use its container if necessary. You can also instantiate `EditorScopedLayoutService`\n\t\t// which implements `ILayoutService` but is not a part of the service collection because\n\t\t// it is code editor instance specific.\n\t\tthrow new Error(`ILayoutService.container is not available in the standalone editor!`);\n\t}\n\n\tfocus(): void {\n\t\tthis._codeEditorService.getFocusedCodeEditor()?.focus();\n\t}\n\n\tconstructor(\n\t\t@ICodeEditorService private _codeEditorService: ICodeEditorService\n\t) { }\n}\n\nexport class EditorScopedLayoutService extends StandaloneLayoutService {\n\toverride get hasContainer(): boolean {\n\t\treturn false;\n\t}\n\toverride get container(): HTMLElement {\n\t\treturn this._container;\n\t}\n\tconstructor(\n\t\tprivate _container: HTMLElement,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t) {\n\t\tsuper(codeEditorService);\n\t}\n}\n\nregisterSingleton(ILayoutService, StandaloneLayoutService);\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 { ContextView, ContextViewDOMPosition } from 'vs/base/browser/ui/contextview/contextview';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { IContextViewDelegate, IContextViewService } from './contextView';\n\nexport class ContextViewService extends Disposable implements IContextViewService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate currentViewDisposable: IDisposable = Disposable.None;\n\tprivate contextView: ContextView;\n\tprivate container: HTMLElement | null;\n\n\tconstructor(\n\t\t@ILayoutService readonly layoutService: ILayoutService\n\t) {\n\t\tsuper();\n\n\t\tthis.container = layoutService.hasContainer ? layoutService.container : null;\n\t\tthis.contextView = this._register(new ContextView(this.container, ContextViewDOMPosition.ABSOLUTE));\n\t\tthis.layout();\n\n\t\tthis._register(layoutService.onDidLayout(() => this.layout()));\n\t}\n\n\t// ContextView\n\n\tprivate setContainer(container: HTMLElement, domPosition?: ContextViewDOMPosition): void {\n\t\tthis.contextView.setContainer(container, domPosition || ContextViewDOMPosition.ABSOLUTE);\n\t}\n\n\tshowContextView(delegate: IContextViewDelegate, container?: HTMLElement, shadowRoot?: boolean): IDisposable {\n\t\tif (container) {\n\t\t\tif (container !== this.container) {\n\t\t\t\tthis.container = container;\n\t\t\t\tthis.setContainer(container, shadowRoot ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.layoutService.hasContainer && this.container !== this.layoutService.container) {\n\t\t\t\tthis.container = this.layoutService.container;\n\t\t\t\tthis.setContainer(this.container, ContextViewDOMPosition.ABSOLUTE);\n\t\t\t}\n\t\t}\n\n\t\tthis.contextView.show(delegate);\n\n\t\tconst disposable = toDisposable(() => {\n\t\t\tif (this.currentViewDisposable === disposable) {\n\t\t\t\tthis.hideContextView();\n\t\t\t}\n\t\t});\n\n\t\tthis.currentViewDisposable = disposable;\n\t\treturn disposable;\n\t}\n\n\tgetContextViewElement(): HTMLElement {\n\t\treturn this.contextView.getViewElement();\n\t}\n\n\tlayout(): void {\n\t\tthis.contextView.layout();\n\t}\n\n\thideContextView(data?: any): void {\n\t\tthis.contextView.hide(data);\n\t}\n}\n","\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ILogService = createDecorator<ILogService>('logService');\n\nexport enum LogLevel {\n\tTrace,\n\tDebug,\n\tInfo,\n\tWarning,\n\tError,\n\tCritical,\n\tOff\n}\n\nexport const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;\n\nexport interface ILogger extends IDisposable {\n\tgetLevel(): LogLevel;\n\n\ttrace(message: string, ...args: any[]): void;\n\tdebug(message: string, ...args: any[]): void;\n\tinfo(message: string, ...args: any[]): void;\n\terror(message: string | Error, ...args: any[]): void;\n}\n\nexport interface ILogService extends ILogger {\n\treadonly _serviceBrand: undefined;\n}\n\nexport abstract class AbstractLogger extends Disposable {\n\n\tprivate level: LogLevel = DEFAULT_LOG_LEVEL;\n\tprivate readonly _onDidChangeLogLevel: Emitter<LogLevel> = this._register(new Emitter<LogLevel>());\n\n\tsetLevel(level: LogLevel): void {\n\t\tif (this.level !== level) {\n\t\t\tthis.level = level;\n\t\t\tthis._onDidChangeLogLevel.fire(this.level);\n\t\t}\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.level;\n\t}\n\n}\n\nexport class ConsoleLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {\n\t\tsuper();\n\t\tthis.setLevel(logLevel);\n\t}\n\n\ttrace(message: string, ...args: any[]): void {\n\t\tif (this.getLevel() <= LogLevel.Trace) {\n\t\t\tconsole.log('%cTRACE', 'color: #888', message, ...args);\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: any[]): void {\n\t\tif (this.getLevel() <= LogLevel.Debug) {\n\t\t\tconsole.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: any[]): void {\n\t\tif (this.getLevel() <= LogLevel.Info) {\n\t\t\tconsole.log('%c INFO', 'color: #33f', message, ...args);\n\t\t}\n\t}\n\n\terror(message: string, ...args: any[]): void {\n\t\tif (this.getLevel() <= LogLevel.Error) {\n\t\t\tconsole.log('%c ERR', 'color: #f33', message, ...args);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\t// noop\n\t}\n}\n\nexport class LogService extends Disposable implements ILogService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tconstructor(private logger: ILogger) {\n\t\tsuper();\n\t\tthis._register(logger);\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.logger.getLevel();\n\t}\n\n\ttrace(message: string, ...args: any[]): void {\n\t\tthis.logger.trace(message, ...args);\n\t}\n\n\tdebug(message: string, ...args: any[]): void {\n\t\tthis.logger.debug(message, ...args);\n\t}\n\n\tinfo(message: string, ...args: any[]): void {\n\t\tthis.logger.info(message, ...args);\n\t}\n\n\terror(message: string | Error, ...args: any[]): void {\n\t\tthis.logger.error(message, ...args);\n\t}\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 { IntervalTimer, timeout } from 'vs/base/common/async';\nimport { Disposable, IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { SimpleWorkerClient, logOnceWebWorkerWarning, IWorkerClient } from 'vs/base/common/worker/simpleWorker';\nimport { DefaultWorkerFactory } from 'vs/base/browser/defaultWorkerFactory';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { IDiffComputationResult } from 'vs/editor/common/diff/diffComputer';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker';\nimport { IEditorWorkerService, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration';\nimport { regExpFlags } from 'vs/base/common/strings';\nimport { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { canceled } from 'vs/base/common/errors';\nimport { UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter';\nimport { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\n/**\n * Stop syncing a model to the worker if it was not needed for 1 min.\n */\nconst STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000;\n\n/**\n * Stop the worker if it was not needed for 5 min.\n */\nconst STOP_WORKER_DELTA_TIME_MS = 5 * 60 * 1000;\n\nfunction canSyncModel(modelService: IModelService, resource: URI): boolean {\n\tconst model = modelService.getModel(resource);\n\tif (!model) {\n\t\treturn false;\n\t}\n\tif (model.isTooLargeForSyncing()) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nexport class EditorWorkerService extends Disposable implements IEditorWorkerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _modelService: IModelService;\n\tprivate readonly _workerManager: WorkerManager;\n\tprivate readonly _logService: ILogService;\n\n\tconstructor(\n\t\t@IModelService modelService: IModelService,\n\t\t@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,\n\t\t@ILogService logService: ILogService,\n\t\t@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._workerManager = this._register(new WorkerManager(this._modelService, languageConfigurationService));\n\t\tthis._logService = logService;\n\n\t\t// register default link-provider and default completions-provider\n\t\tthis._register(languageFeaturesService.linkProvider.register({ language: '*', hasAccessToAllModels: true }, {\n\t\t\tprovideLinks: (model, token) => {\n\t\t\t\tif (!canSyncModel(this._modelService, model.uri)) {\n\t\t\t\t\treturn Promise.resolve({ links: [] }); // File too large\n\t\t\t\t}\n\t\t\t\treturn this._workerManager.withWorker().then(client => client.computeLinks(model.uri)).then(links => {\n\t\t\t\t\treturn links && { links };\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\t\tthis._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, languageConfigurationService)));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic canComputeUnicodeHighlights(uri: URI): boolean {\n\t\treturn canSyncModel(this._modelService, uri);\n\t}\n\n\tpublic computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise<IUnicodeHighlightsResult> {\n\t\treturn this._workerManager.withWorker().then(client => client.computedUnicodeHighlights(uri, options, range));\n\t}\n\n\tpublic computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {\n\t\treturn this._workerManager.withWorker().then(client => client.computeDiff(original, modified, ignoreTrimWhitespace, maxComputationTime));\n\t}\n\n\tpublic computeMoreMinimalEdits(resource: URI, edits: languages.TextEdit[] | null | undefined): Promise<languages.TextEdit[] | undefined> {\n\t\tif (isNonEmptyArray(edits)) {\n\t\t\tif (!canSyncModel(this._modelService, resource)) {\n\t\t\t\treturn Promise.resolve(edits); // File too large\n\t\t\t}\n\t\t\tconst sw = StopWatch.create(true);\n\t\t\tconst result = this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits));\n\t\t\tresult.finally(() => this._logService.trace('FORMAT#computeMoreMinimalEdits', resource.toString(true), sw.elapsed()));\n\t\t\treturn Promise.race([result, timeout(1000).then(() => edits)]);\n\n\t\t} else {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\t}\n\n\tpublic canNavigateValueSet(resource: URI): boolean {\n\t\treturn (canSyncModel(this._modelService, resource));\n\t}\n\n\tpublic navigateValueSet(resource: URI, range: IRange, up: boolean): Promise<languages.IInplaceReplaceSupportResult | null> {\n\t\treturn this._workerManager.withWorker().then(client => client.navigateValueSet(resource, range, up));\n\t}\n\n\tcanComputeWordRanges(resource: URI): boolean {\n\t\treturn canSyncModel(this._modelService, resource);\n\t}\n\n\tcomputeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> {\n\t\treturn this._workerManager.withWorker().then(client => client.computeWordRanges(resource, range));\n\t}\n}\n\nclass WordBasedCompletionItemProvider implements languages.CompletionItemProvider {\n\n\tprivate readonly _workerManager: WorkerManager;\n\tprivate readonly _configurationService: ITextResourceConfigurationService;\n\tprivate readonly _modelService: IModelService;\n\n\treadonly _debugDisplayName = 'wordbasedCompletions';\n\n\tconstructor(\n\t\tworkerManager: WorkerManager,\n\t\tconfigurationService: ITextResourceConfigurationService,\n\t\tmodelService: IModelService,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._workerManager = workerManager;\n\t\tthis._configurationService = configurationService;\n\t\tthis._modelService = modelService;\n\t}\n\n\tasync provideCompletionItems(model: ITextModel, position: Position): Promise<languages.CompletionList | undefined> {\n\t\ttype WordBasedSuggestionsConfig = {\n\t\t\twordBasedSuggestions?: boolean;\n\t\t\twordBasedSuggestionsMode?: 'currentDocument' | 'matchingDocuments' | 'allDocuments';\n\t\t};\n\t\tconst config = this._configurationService.getValue<WordBasedSuggestionsConfig>(model.uri, position, 'editor');\n\t\tif (!config.wordBasedSuggestions) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst models: URI[] = [];\n\t\tif (config.wordBasedSuggestionsMode === 'currentDocument') {\n\t\t\t// only current file and only if not too large\n\t\t\tif (canSyncModel(this._modelService, model.uri)) {\n\t\t\t\tmodels.push(model.uri);\n\t\t\t}\n\t\t} else {\n\t\t\t// either all files or files of same language\n\t\t\tfor (const candidate of this._modelService.getModels()) {\n\t\t\t\tif (!canSyncModel(this._modelService, candidate.uri)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (candidate === model) {\n\t\t\t\t\tmodels.unshift(candidate.uri);\n\n\t\t\t\t} else if (config.wordBasedSuggestionsMode === 'allDocuments' || candidate.getLanguageId() === model.getLanguageId()) {\n\t\t\t\t\tmodels.push(candidate.uri);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (models.length === 0) {\n\t\t\treturn undefined; // File too large, no other files\n\t\t}\n\n\t\tconst wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n\t\tconst word = model.getWordAtPosition(position);\n\t\tconst replace = !word ? Range.fromPositions(position) : new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n\t\tconst insert = replace.setEndPosition(position.lineNumber, position.column);\n\n\t\tconst client = await this._workerManager.withWorker();\n\t\tconst data = await client.textualSuggest(models, word?.word, wordDefRegExp);\n\t\tif (!data) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tduration: data.duration,\n\t\t\tsuggestions: data.words.map((word): languages.CompletionItem => {\n\t\t\t\treturn {\n\t\t\t\t\tkind: languages.CompletionItemKind.Text,\n\t\t\t\t\tlabel: word,\n\t\t\t\t\tinsertText: word,\n\t\t\t\t\trange: { insert, replace }\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t}\n}\n\nclass WorkerManager extends Disposable {\n\n\tprivate readonly _modelService: IModelService;\n\tprivate _editorWorkerClient: EditorWorkerClient | null;\n\tprivate _lastWorkerUsedTime: number;\n\n\tconstructor(modelService: IModelService, private readonly languageConfigurationService: ILanguageConfigurationService) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._editorWorkerClient = null;\n\t\tthis._lastWorkerUsedTime = (new Date()).getTime();\n\n\t\tconst stopWorkerInterval = this._register(new IntervalTimer());\n\t\tstopWorkerInterval.cancelAndSet(() => this._checkStopIdleWorker(), Math.round(STOP_WORKER_DELTA_TIME_MS / 2));\n\n\t\tthis._register(this._modelService.onModelRemoved(_ => this._checkStopEmptyWorker()));\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._editorWorkerClient) {\n\t\t\tthis._editorWorkerClient.dispose();\n\t\t\tthis._editorWorkerClient = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t/**\n\t * Check if the model service has no more models and stop the worker if that is the case.\n\t */\n\tprivate _checkStopEmptyWorker(): void {\n\t\tif (!this._editorWorkerClient) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst models = this._modelService.getModels();\n\t\tif (models.length === 0) {\n\t\t\t// There are no more models => nothing possible for me to do\n\t\t\tthis._editorWorkerClient.dispose();\n\t\t\tthis._editorWorkerClient = null;\n\t\t}\n\t}\n\n\t/**\n\t * Check if the worker has been idle for a while and then stop it.\n\t */\n\tprivate _checkStopIdleWorker(): void {\n\t\tif (!this._editorWorkerClient) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst timeSinceLastWorkerUsedTime = (new Date()).getTime() - this._lastWorkerUsedTime;\n\t\tif (timeSinceLastWorkerUsedTime > STOP_WORKER_DELTA_TIME_MS) {\n\t\t\tthis._editorWorkerClient.dispose();\n\t\t\tthis._editorWorkerClient = null;\n\t\t}\n\t}\n\n\tpublic withWorker(): Promise<EditorWorkerClient> {\n\t\tthis._lastWorkerUsedTime = (new Date()).getTime();\n\t\tif (!this._editorWorkerClient) {\n\t\t\tthis._editorWorkerClient = new EditorWorkerClient(this._modelService, false, 'editorWorkerService', this.languageConfigurationService);\n\t\t}\n\t\treturn Promise.resolve(this._editorWorkerClient);\n\t}\n}\n\nclass EditorModelManager extends Disposable {\n\n\tprivate readonly _proxy: EditorSimpleWorker;\n\tprivate readonly _modelService: IModelService;\n\tprivate _syncedModels: { [modelUrl: string]: IDisposable } = Object.create(null);\n\tprivate _syncedModelsLastUsedTime: { [modelUrl: string]: number } = Object.create(null);\n\n\tconstructor(proxy: EditorSimpleWorker, modelService: IModelService, keepIdleModels: boolean) {\n\t\tsuper();\n\t\tthis._proxy = proxy;\n\t\tthis._modelService = modelService;\n\n\t\tif (!keepIdleModels) {\n\t\t\tconst timer = new IntervalTimer();\n\t\t\ttimer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2));\n\t\t\tthis._register(timer);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tfor (let modelUrl in this._syncedModels) {\n\t\t\tdispose(this._syncedModels[modelUrl]);\n\t\t}\n\t\tthis._syncedModels = Object.create(null);\n\t\tthis._syncedModelsLastUsedTime = Object.create(null);\n\t\tsuper.dispose();\n\t}\n\n\tpublic ensureSyncedResources(resources: URI[], forceLargeModels: boolean): void {\n\t\tfor (const resource of resources) {\n\t\t\tconst resourceStr = resource.toString();\n\n\t\t\tif (!this._syncedModels[resourceStr]) {\n\t\t\t\tthis._beginModelSync(resource, forceLargeModels);\n\t\t\t}\n\t\t\tif (this._syncedModels[resourceStr]) {\n\t\t\t\tthis._syncedModelsLastUsedTime[resourceStr] = (new Date()).getTime();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkStopModelSync(): void {\n\t\tconst currentTime = (new Date()).getTime();\n\n\t\tconst toRemove: string[] = [];\n\t\tfor (let modelUrl in this._syncedModelsLastUsedTime) {\n\t\t\tconst elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl];\n\t\t\tif (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) {\n\t\t\t\ttoRemove.push(modelUrl);\n\t\t\t}\n\t\t}\n\n\t\tfor (const e of toRemove) {\n\t\t\tthis._stopModelSync(e);\n\t\t}\n\t}\n\n\tprivate _beginModelSync(resource: URI, forceLargeModels: boolean): void {\n\t\tconst model = this._modelService.getModel(resource);\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tif (!forceLargeModels && model.isTooLargeForSyncing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst modelUrl = resource.toString();\n\n\t\tthis._proxy.acceptNewModel({\n\t\t\turl: model.uri.toString(),\n\t\t\tlines: model.getLinesContent(),\n\t\t\tEOL: model.getEOL(),\n\t\t\tversionId: model.getVersionId()\n\t\t});\n\n\t\tconst toDispose = new DisposableStore();\n\t\ttoDispose.add(model.onDidChangeContent((e) => {\n\t\t\tthis._proxy.acceptModelChanged(modelUrl.toString(), e);\n\t\t}));\n\t\ttoDispose.add(model.onWillDispose(() => {\n\t\t\tthis._stopModelSync(modelUrl);\n\t\t}));\n\t\ttoDispose.add(toDisposable(() => {\n\t\t\tthis._proxy.acceptRemovedModel(modelUrl);\n\t\t}));\n\n\t\tthis._syncedModels[modelUrl] = toDispose;\n\t}\n\n\tprivate _stopModelSync(modelUrl: string): void {\n\t\tconst toDispose = this._syncedModels[modelUrl];\n\t\tdelete this._syncedModels[modelUrl];\n\t\tdelete this._syncedModelsLastUsedTime[modelUrl];\n\t\tdispose(toDispose);\n\t}\n}\n\nclass SynchronousWorkerClient<T extends IDisposable> implements IWorkerClient<T> {\n\tprivate readonly _instance: T;\n\tprivate readonly _proxyObj: Promise<T>;\n\n\tconstructor(instance: T) {\n\t\tthis._instance = instance;\n\t\tthis._proxyObj = Promise.resolve(this._instance);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._instance.dispose();\n\t}\n\n\tpublic getProxyObject(): Promise<T> {\n\t\treturn this._proxyObj;\n\t}\n}\n\nexport interface IEditorWorkerClient {\n\tfhr(method: string, args: any[]): Promise<any>;\n}\n\nexport class EditorWorkerHost implements IEditorWorkerHost {\n\n\tprivate readonly _workerClient: IEditorWorkerClient;\n\n\tconstructor(workerClient: IEditorWorkerClient) {\n\t\tthis._workerClient = workerClient;\n\t}\n\n\t// foreign host request\n\tpublic fhr(method: string, args: any[]): Promise<any> {\n\t\treturn this._workerClient.fhr(method, args);\n\t}\n}\n\nexport class EditorWorkerClient extends Disposable implements IEditorWorkerClient {\n\n\tprivate readonly _modelService: IModelService;\n\tprivate readonly _keepIdleModels: boolean;\n\tprotected _worker: IWorkerClient<EditorSimpleWorker> | null;\n\tprotected readonly _workerFactory: DefaultWorkerFactory;\n\tprivate _modelManager: EditorModelManager | null;\n\tprivate _disposed = false;\n\n\tconstructor(\n\t\tmodelService: IModelService,\n\t\tkeepIdleModels: boolean,\n\t\tlabel: string | undefined,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._keepIdleModels = keepIdleModels;\n\t\tthis._workerFactory = new DefaultWorkerFactory(label);\n\t\tthis._worker = null;\n\t\tthis._modelManager = null;\n\t}\n\n\t// foreign host request\n\tpublic fhr(method: string, args: any[]): Promise<any> {\n\t\tthrow new Error(`Not implemented!`);\n\t}\n\n\tprivate _getOrCreateWorker(): IWorkerClient<EditorSimpleWorker> {\n\t\tif (!this._worker) {\n\t\t\ttry {\n\t\t\t\tthis._worker = this._register(new SimpleWorkerClient<EditorSimpleWorker, EditorWorkerHost>(\n\t\t\t\t\tthis._workerFactory,\n\t\t\t\t\t'vs/editor/common/services/editorSimpleWorker',\n\t\t\t\t\tnew EditorWorkerHost(this)\n\t\t\t\t));\n\t\t\t} catch (err) {\n\t\t\t\tlogOnceWebWorkerWarning(err);\n\t\t\t\tthis._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null));\n\t\t\t}\n\t\t}\n\t\treturn this._worker;\n\t}\n\n\tprotected _getProxy(): Promise<EditorSimpleWorker> {\n\t\treturn this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {\n\t\t\tlogOnceWebWorkerWarning(err);\n\t\t\tthis._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null));\n\t\t\treturn this._getOrCreateWorker().getProxyObject();\n\t\t});\n\t}\n\n\tprivate _getOrCreateModelManager(proxy: EditorSimpleWorker): EditorModelManager {\n\t\tif (!this._modelManager) {\n\t\t\tthis._modelManager = this._register(new EditorModelManager(proxy, this._modelService, this._keepIdleModels));\n\t\t}\n\t\treturn this._modelManager;\n\t}\n\n\tprotected async _withSyncedResources(resources: URI[], forceLargeModels: boolean = false): Promise<EditorSimpleWorker> {\n\t\tif (this._disposed) {\n\t\t\treturn Promise.reject(canceled());\n\t\t}\n\t\treturn this._getProxy().then((proxy) => {\n\t\t\tthis._getOrCreateModelManager(proxy).ensureSyncedResources(resources, forceLargeModels);\n\t\t\treturn proxy;\n\t\t});\n\t}\n\n\tpublic computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise<IUnicodeHighlightsResult> {\n\t\treturn this._withSyncedResources([uri]).then(proxy => {\n\t\t\treturn proxy.computeUnicodeHighlights(uri.toString(), options, range);\n\t\t});\n\t}\n\n\tpublic computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {\n\t\treturn this._withSyncedResources([original, modified], /* forceLargeModels */true).then(proxy => {\n\t\t\treturn proxy.computeDiff(original.toString(), modified.toString(), ignoreTrimWhitespace, maxComputationTime);\n\t\t});\n\t}\n\n\tpublic computeMoreMinimalEdits(resource: URI, edits: languages.TextEdit[]): Promise<languages.TextEdit[]> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\treturn proxy.computeMoreMinimalEdits(resource.toString(), edits);\n\t\t});\n\t}\n\n\tpublic computeLinks(resource: URI): Promise<languages.ILink[] | null> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\treturn proxy.computeLinks(resource.toString());\n\t\t});\n\t}\n\n\tpublic async textualSuggest(resources: URI[], leadingWord: string | undefined, wordDefRegExp: RegExp): Promise<{ words: string[]; duration: number } | null> {\n\t\tconst proxy = await this._withSyncedResources(resources);\n\t\tconst wordDef = wordDefRegExp.source;\n\t\tconst wordDefFlags = regExpFlags(wordDefRegExp);\n\t\treturn proxy.textualSuggest(resources.map(r => r.toString()), leadingWord, wordDef, wordDefFlags);\n\t}\n\n\tcomputeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\tconst model = this._modelService.getModel(resource);\n\t\t\tif (!model) {\n\t\t\t\treturn Promise.resolve(null);\n\t\t\t}\n\t\t\tconst wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n\t\t\tconst wordDef = wordDefRegExp.source;\n\t\t\tconst wordDefFlags = regExpFlags(wordDefRegExp);\n\t\t\treturn proxy.computeWordRanges(resource.toString(), range, wordDef, wordDefFlags);\n\t\t});\n\t}\n\n\tpublic navigateValueSet(resource: URI, range: IRange, up: boolean): Promise<languages.IInplaceReplaceSupportResult | null> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\tconst model = this._modelService.getModel(resource);\n\t\t\tif (!model) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n\t\t\tconst wordDef = wordDefRegExp.source;\n\t\t\tconst wordDefFlags = regExpFlags(wordDefRegExp);\n\t\t\treturn proxy.navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags);\n\t\t});\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._disposed = true;\n\t}\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 { URI } from 'vs/base/common/uri';\nimport { EditorWorkerClient } from 'vs/editor/browser/services/editorWorkerService';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport * as types from 'vs/base/common/types';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\n\n/**\n * Create a new web worker that has model syncing capabilities built in.\n * Specify an AMD module to load that will `create` an object that will be proxied.\n */\nexport function createWebWorker<T>(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker<T> {\n\treturn new MonacoWebWorkerImpl<T>(modelService, languageConfigurationService, opts);\n}\n\n/**\n * A web worker that can provide a proxy to an arbitrary file.\n */\nexport interface MonacoWebWorker<T> {\n\t/**\n\t * Terminate the web worker, thus invalidating the returned proxy.\n\t */\n\tdispose(): void;\n\t/**\n\t * Get a proxy to the arbitrary loaded code.\n\t */\n\tgetProxy(): Promise<T>;\n\t/**\n\t * Synchronize (send) the models at `resources` to the web worker,\n\t * making them available in the monaco.worker.getMirrorModels().\n\t */\n\twithSyncedResources(resources: URI[]): Promise<T>;\n}\n\nexport interface IWebWorkerOptions {\n\t/**\n\t * The AMD moduleId to load.\n\t * It should export a function `create` that should return the exported proxy.\n\t */\n\tmoduleId: string;\n\t/**\n\t * The data to send over when calling create on the module.\n\t */\n\tcreateData?: any;\n\t/**\n\t * A label to be used to identify the web worker for debugging purposes.\n\t */\n\tlabel?: string;\n\t/**\n\t * An object that can be used by the web worker to make calls back to the main thread.\n\t */\n\thost?: any;\n\t/**\n\t * Keep idle models.\n\t * Defaults to false, which means that idle models will stop syncing after a while.\n\t */\n\tkeepIdleModels?: boolean;\n}\n\nclass MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {\n\n\tprivate readonly _foreignModuleId: string;\n\tprivate readonly _foreignModuleHost: { [method: string]: Function } | null;\n\tprivate _foreignModuleCreateData: any | null;\n\tprivate _foreignProxy: Promise<T> | null;\n\n\tconstructor(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions) {\n\t\tsuper(modelService, opts.keepIdleModels || false, opts.label, languageConfigurationService);\n\t\tthis._foreignModuleId = opts.moduleId;\n\t\tthis._foreignModuleCreateData = opts.createData || null;\n\t\tthis._foreignModuleHost = opts.host || null;\n\t\tthis._foreignProxy = null;\n\t}\n\n\t// foreign host request\n\tpublic override fhr(method: string, args: any[]): Promise<any> {\n\t\tif (!this._foreignModuleHost || typeof this._foreignModuleHost[method] !== 'function') {\n\t\t\treturn Promise.reject(new Error('Missing method ' + method + ' or missing main thread foreign host.'));\n\t\t}\n\n\t\ttry {\n\t\t\treturn Promise.resolve(this._foreignModuleHost[method].apply(this._foreignModuleHost, args));\n\t\t} catch (e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n\n\tprivate _getForeignProxy(): Promise<T> {\n\t\tif (!this._foreignProxy) {\n\t\t\tthis._foreignProxy = this._getProxy().then((proxy) => {\n\t\t\t\tconst foreignHostMethods = this._foreignModuleHost ? types.getAllMethodNames(this._foreignModuleHost) : [];\n\t\t\t\treturn proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData, foreignHostMethods).then((foreignMethods) => {\n\t\t\t\t\tthis._foreignModuleCreateData = null;\n\n\t\t\t\t\tconst proxyMethodRequest = (method: string, args: any[]): Promise<any> => {\n\t\t\t\t\t\treturn proxy.fmr(method, args);\n\t\t\t\t\t};\n\n\t\t\t\t\tconst createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => Promise<any>): () => Promise<any> => {\n\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\tconst args = Array.prototype.slice.call(arguments, 0);\n\t\t\t\t\t\t\treturn proxyMethodRequest(method, args);\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\n\t\t\t\t\tconst foreignProxy = {} as T;\n\t\t\t\t\tfor (const foreignMethod of foreignMethods) {\n\t\t\t\t\t\t(<any>foreignProxy)[foreignMethod] = createProxyMethod(foreignMethod, proxyMethodRequest);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn foreignProxy;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\treturn this._foreignProxy;\n\t}\n\n\tpublic getProxy(): Promise<T> {\n\t\treturn this._getForeignProxy();\n\t}\n\n\tpublic withSyncedResources(resources: URI[]): Promise<T> {\n\t\treturn this._withSyncedResources(resources).then(_ => this.getProxy());\n\t}\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 { doHash } from 'vs/base/common/hash';\nimport { LRUCache } from 'vs/base/common/map';\nimport { clamp, MovingAverage, SlidingWindowAverage } from 'vs/base/common/numbers';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { ILogService } from 'vs/platform/log/common/log';\n\n\nexport const ILanguageFeatureDebounceService = createDecorator<ILanguageFeatureDebounceService>('ILanguageFeatureDebounceService');\n\nexport interface ILanguageFeatureDebounceService {\n\n\treadonly _serviceBrand: undefined;\n\n\tfor(feature: LanguageFeatureRegistry<object>, debugName: string, config?: { min?: number; max?: number; salt?: string }): IFeatureDebounceInformation;\n}\n\nexport interface IFeatureDebounceInformation {\n\tget(model: ITextModel): number;\n\tupdate(model: ITextModel, value: number): number;\n\tdefault(): number;\n}\n\nnamespace IdentityHash {\n\tconst _hashes = new WeakMap<object, number>();\n\tlet pool = 0;\n\texport function of(obj: object): number {\n\t\tlet value = _hashes.get(obj);\n\t\tif (value === undefined) {\n\t\t\tvalue = ++pool;\n\t\t\t_hashes.set(obj, value);\n\t\t}\n\t\treturn value;\n\t}\n}\n\nclass FeatureDebounceInformation implements IFeatureDebounceInformation {\n\n\tprivate readonly _cache = new LRUCache<string, SlidingWindowAverage>(50, 0.7);\n\n\tconstructor(\n\t\tprivate readonly _logService: ILogService,\n\t\tprivate readonly _name: string,\n\t\tprivate readonly _registry: LanguageFeatureRegistry<object>,\n\t\tprivate readonly _default: number,\n\t\tprivate readonly _min: number,\n\t\tprivate readonly _max: number,\n\t) { }\n\n\tprivate _key(model: ITextModel): string {\n\t\treturn model.id + this._registry.all(model).reduce((hashVal, obj) => doHash(IdentityHash.of(obj), hashVal), 0);\n\t}\n\n\tget(model: ITextModel): number {\n\t\tconst key = this._key(model);\n\t\tconst avg = this._cache.get(key);\n\t\treturn avg\n\t\t\t? clamp(avg.value, this._min, this._max)\n\t\t\t: this.default();\n\t}\n\n\tupdate(model: ITextModel, value: number): number {\n\t\tconst key = this._key(model);\n\t\tlet avg = this._cache.get(key);\n\t\tif (!avg) {\n\t\t\tavg = new SlidingWindowAverage(6);\n\t\t\tthis._cache.set(key, avg);\n\t\t}\n\t\tconst newValue = clamp(avg.update(value), this._min, this._max);\n\t\tthis._logService.trace(`[DEBOUNCE: ${this._name}] for ${model.uri.toString()} is ${newValue}ms`);\n\t\treturn newValue;\n\t}\n\n\tprivate _overall(): number {\n\t\tconst result = new MovingAverage();\n\t\tfor (const [, avg] of this._cache) {\n\t\t\tresult.update(avg.value);\n\t\t}\n\t\treturn result.value;\n\t}\n\n\tdefault() {\n\t\tconst value = (this._overall() | 0) || this._default;\n\t\treturn clamp(value, this._min, this._max);\n\t}\n}\n\n\nexport class LanguageFeatureDebounceService implements ILanguageFeatureDebounceService {\n\n\tdeclare _serviceBrand: undefined;\n\n\tprivate readonly _data = new Map<string, FeatureDebounceInformation>();\n\n\tconstructor(@ILogService private readonly _logService: ILogService) {\n\n\t}\n\n\tfor(feature: LanguageFeatureRegistry<object>, name: string, config?: { min?: number; max?: number; key?: string }): IFeatureDebounceInformation {\n\t\tconst min = config?.min ?? 50;\n\t\tconst max = config?.max ?? min ** 2;\n\t\tconst extra = config?.key ?? undefined;\n\t\tconst key = `${IdentityHash.of(feature)},${min}${extra ? ',' + extra : ''}`;\n\t\tlet info = this._data.get(key);\n\t\tif (!info) {\n\t\t\tinfo = new FeatureDebounceInformation(\n\t\t\t\tthis._logService,\n\t\t\t\tname,\n\t\t\t\tfeature,\n\t\t\t\t(this._overallAverage() | 0) || (min * 1.5), // default is overall default or derived from min-value\n\t\t\t\tmin,\n\t\t\t\tmax\n\t\t\t);\n\t\t\tthis._data.set(key, info);\n\t\t}\n\t\treturn info;\n\t}\n\n\tprivate _overallAverage(): number {\n\t\t// Average of all language features. Not a great value but an approximation\n\t\tlet result = new MovingAverage();\n\t\tfor (let info of this._data.values()) {\n\t\t\tresult.update(info.default());\n\t\t}\n\t\treturn result.value;\n\t}\n}\n\nregisterSingleton(ILanguageFeatureDebounceService, LanguageFeatureDebounceService, true);\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 { equals } from 'vs/base/common/arrays';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { LRUCache } from 'vs/base/common/map';\nimport { URI } from 'vs/base/common/uri';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DocumentSymbol, DocumentSymbolProvider } from 'vs/editor/common/languages';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport abstract class TreeElement {\n\n\tabstract id: string;\n\tabstract children: Map<string, TreeElement>;\n\tabstract parent: TreeElement | undefined;\n\n\tremove(): void {\n\t\tif (this.parent) {\n\t\t\tthis.parent.children.delete(this.id);\n\t\t}\n\t}\n\n\tstatic findId(candidate: DocumentSymbol | string, container: TreeElement): string {\n\t\t// complex id-computation which contains the origin/extension,\n\t\t// the parent path, and some dedupe logic when names collide\n\t\tlet candidateId: string;\n\t\tif (typeof candidate === 'string') {\n\t\t\tcandidateId = `${container.id}/${candidate}`;\n\t\t} else {\n\t\t\tcandidateId = `${container.id}/${candidate.name}`;\n\t\t\tif (container.children.get(candidateId) !== undefined) {\n\t\t\t\tcandidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`;\n\t\t\t}\n\t\t}\n\n\t\tlet id = candidateId;\n\t\tfor (let i = 0; container.children.get(id) !== undefined; i++) {\n\t\t\tid = `${candidateId}_${i}`;\n\t\t}\n\n\t\treturn id;\n\t}\n\n\tstatic empty(element: TreeElement): boolean {\n\t\treturn element.children.size === 0;\n\t}\n}\n\nexport class OutlineElement extends TreeElement {\n\n\tchildren = new Map<string, OutlineElement>();\n\n\tconstructor(\n\t\treadonly id: string,\n\t\tpublic parent: TreeElement | undefined,\n\t\treadonly symbol: DocumentSymbol\n\t) {\n\t\tsuper();\n\t}\n}\n\nexport class OutlineGroup extends TreeElement {\n\n\tchildren = new Map<string, OutlineElement>();\n\n\tconstructor(\n\t\treadonly id: string,\n\t\tpublic parent: TreeElement | undefined,\n\t\treadonly label: string,\n\t\treadonly order: number,\n\t) {\n\t\tsuper();\n\t}\n}\n\nexport class OutlineModel extends TreeElement {\n\n\tstatic create(registry: LanguageFeatureRegistry<DocumentSymbolProvider>, textModel: ITextModel, token: CancellationToken): Promise<OutlineModel> {\n\n\t\tconst cts = new CancellationTokenSource(token);\n\t\tconst result = new OutlineModel(textModel.uri);\n\t\tconst provider = registry.ordered(textModel);\n\t\tconst promises = provider.map((provider, index) => {\n\n\t\t\tlet id = TreeElement.findId(`provider_${index}`, result);\n\t\t\tlet group = new OutlineGroup(id, result, provider.displayName ?? 'Unknown Outline Provider', index);\n\n\t\t\treturn Promise.resolve(provider.provideDocumentSymbols(textModel, cts.token)).then(result => {\n\t\t\t\tfor (const info of result || []) {\n\t\t\t\t\tOutlineModel._makeOutlineElement(info, group);\n\t\t\t\t}\n\t\t\t\treturn group;\n\t\t\t}, err => {\n\t\t\t\tonUnexpectedExternalError(err);\n\t\t\t\treturn group;\n\t\t\t}).then(group => {\n\t\t\t\tif (!TreeElement.empty(group)) {\n\t\t\t\t\tresult._groups.set(id, group);\n\t\t\t\t} else {\n\t\t\t\t\tgroup.remove();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tconst listener = registry.onDidChange(() => {\n\t\t\tconst newProvider = registry.ordered(textModel);\n\t\t\tif (!equals(newProvider, provider)) {\n\t\t\t\tcts.cancel();\n\t\t\t}\n\t\t});\n\n\t\treturn Promise.all(promises).then(() => {\n\t\t\tif (cts.token.isCancellationRequested && !token.isCancellationRequested) {\n\t\t\t\treturn OutlineModel.create(registry, textModel, token);\n\t\t\t} else {\n\t\t\t\treturn result._compact();\n\t\t\t}\n\t\t}).finally(() => {\n\t\t\tlistener.dispose();\n\t\t});\n\t}\n\n\tprivate static _makeOutlineElement(info: DocumentSymbol, container: OutlineGroup | OutlineElement): void {\n\t\tlet id = TreeElement.findId(info, container);\n\t\tlet res = new OutlineElement(id, container, info);\n\t\tif (info.children) {\n\t\t\tfor (const childInfo of info.children) {\n\t\t\t\tOutlineModel._makeOutlineElement(childInfo, res);\n\t\t\t}\n\t\t}\n\t\tcontainer.children.set(res.id, res);\n\t}\n\n\treadonly id = 'root';\n\treadonly parent = undefined;\n\n\tprotected _groups = new Map<string, OutlineGroup>();\n\tchildren = new Map<string, OutlineGroup | OutlineElement>();\n\n\tprotected constructor(readonly uri: URI) {\n\t\tsuper();\n\n\t\tthis.id = 'root';\n\t\tthis.parent = undefined;\n\t}\n\n\tprivate _compact(): this {\n\t\tlet count = 0;\n\t\tfor (const [key, group] of this._groups) {\n\t\t\tif (group.children.size === 0) { // empty\n\t\t\t\tthis._groups.delete(key);\n\t\t\t} else {\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t}\n\t\tif (count !== 1) {\n\t\t\t//\n\t\t\tthis.children = this._groups;\n\t\t} else {\n\t\t\t// adopt all elements of the first group\n\t\t\tlet group = Iterable.first(this._groups.values())!;\n\t\t\tfor (let [, child] of group.children) {\n\t\t\t\tchild.parent = this;\n\t\t\t\tthis.children.set(child.id, child);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tgetTopLevelSymbols(): DocumentSymbol[] {\n\t\tconst roots: DocumentSymbol[] = [];\n\t\tfor (const child of this.children.values()) {\n\t\t\tif (child instanceof OutlineElement) {\n\t\t\t\troots.push(child.symbol);\n\t\t\t} else {\n\t\t\t\troots.push(...Iterable.map(child.children.values(), child => child.symbol));\n\t\t\t}\n\t\t}\n\t\treturn roots.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range));\n\t}\n\n\tasListOfDocumentSymbols(): DocumentSymbol[] {\n\t\tconst roots = this.getTopLevelSymbols();\n\t\tconst bucket: DocumentSymbol[] = [];\n\t\tOutlineModel._flattenDocumentSymbols(bucket, roots, '');\n\t\treturn bucket.sort((a, b) =>\n\t\t\tPosition.compare(Range.getStartPosition(a.range), Range.getStartPosition(b.range)) || Position.compare(Range.getEndPosition(b.range), Range.getEndPosition(a.range))\n\t\t);\n\t}\n\n\tprivate static _flattenDocumentSymbols(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideContainerLabel: string): void {\n\t\tfor (const entry of entries) {\n\t\t\tbucket.push({\n\t\t\t\tkind: entry.kind,\n\t\t\t\ttags: entry.tags,\n\t\t\t\tname: entry.name,\n\t\t\t\tdetail: entry.detail,\n\t\t\t\tcontainerName: entry.containerName || overrideContainerLabel,\n\t\t\t\trange: entry.range,\n\t\t\t\tselectionRange: entry.selectionRange,\n\t\t\t\tchildren: undefined, // we flatten it...\n\t\t\t});\n\n\t\t\t// Recurse over children\n\t\t\tif (entry.children) {\n\t\t\t\tOutlineModel._flattenDocumentSymbols(bucket, entry.children, entry.name);\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nexport const IOutlineModelService = createDecorator<IOutlineModelService>('IOutlineModelService');\n\nexport interface IOutlineModelService {\n\t_serviceBrand: undefined;\n\tgetOrCreate(model: ITextModel, token: CancellationToken): Promise<OutlineModel>;\n}\n\ninterface CacheEntry {\n\tversionId: number;\n\tprovider: DocumentSymbolProvider[];\n\n\tpromiseCnt: number;\n\tsource: CancellationTokenSource;\n\tpromise: Promise<OutlineModel>;\n\tmodel: OutlineModel | undefined;\n}\n\nexport class OutlineModelService implements IOutlineModelService {\n\n\tdeclare _serviceBrand: undefined;\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly _cache = new LRUCache<string, CacheEntry>(10, 0.7);\n\n\tconstructor(\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService debounces: ILanguageFeatureDebounceService,\n\t\t@IModelService modelService: IModelService\n\t) {\n\t\tthis._debounceInformation = debounces.for(_languageFeaturesService.documentSymbolProvider, 'DocumentSymbols', { min: 350 });\n\n\t\t// don't cache outline models longer than their text model\n\t\tthis._disposables.add(modelService.onModelRemoved(textModel => {\n\t\t\tthis._cache.delete(textModel.id);\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t}\n\n\tasync getOrCreate(textModel: ITextModel, token: CancellationToken): Promise<OutlineModel> {\n\n\t\tconst registry = this._languageFeaturesService.documentSymbolProvider;\n\t\tconst provider = registry.ordered(textModel);\n\n\t\tlet data = this._cache.get(textModel.id);\n\t\tif (!data || data.versionId !== textModel.getVersionId() || !equals(data.provider, provider)) {\n\t\t\tlet source = new CancellationTokenSource();\n\t\t\tdata = {\n\t\t\t\tversionId: textModel.getVersionId(),\n\t\t\t\tprovider,\n\t\t\t\tpromiseCnt: 0,\n\t\t\t\tsource,\n\t\t\t\tpromise: OutlineModel.create(registry, textModel, source.token),\n\t\t\t\tmodel: undefined,\n\t\t\t};\n\t\t\tthis._cache.set(textModel.id, data);\n\n\t\t\tconst now = Date.now();\n\t\t\tdata.promise.then(outlineModel => {\n\t\t\t\tdata!.model = outlineModel;\n\t\t\t\tthis._debounceInformation.update(textModel, Date.now() - now);\n\t\t\t}).catch(_err => {\n\t\t\t\tthis._cache.delete(textModel.id);\n\t\t\t});\n\t\t}\n\n\t\tif (data.model) {\n\t\t\t// resolved -> return data\n\t\t\treturn data.model;\n\t\t}\n\n\t\t// increase usage counter\n\t\tdata.promiseCnt += 1;\n\n\t\tconst listener = token.onCancellationRequested(() => {\n\t\t\t// last -> cancel provider request, remove cached promise\n\t\t\tif (--data!.promiseCnt === 0) {\n\t\t\t\tdata!.source.cancel();\n\t\t\t\tthis._cache.delete(textModel.id);\n\t\t\t}\n\t\t});\n\n\t\ttry {\n\t\t\treturn await data.promise;\n\t\t} finally {\n\t\t\tlistener.dispose();\n\t\t}\n\t}\n}\n\nregisterSingleton(IOutlineModelService, OutlineModelService, true);\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\n\nCommandsRegistry.registerCommand('_executeDocumentSymbolProvider', async function (accessor, ...args) {\n\tconst [resource] = args;\n\tassertType(URI.isUri(resource));\n\n\tconst outlineService = accessor.get(IOutlineModelService);\n\tconst modelService = accessor.get(ITextModelService);\n\n\tconst reference = await modelService.createModelReference(resource);\n\ttry {\n\t\treturn (await outlineService.getOrCreate(reference.object.textEditorModel, CancellationToken.None)).getTopLevelSymbols();\n\t} finally {\n\t\treference.dispose();\n\t}\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 { isSafari, isWebkitWebView } from 'vs/base/browser/browser';\nimport { $, addDisposableListener } from 'vs/base/browser/dom';\nimport { DeferredPromise } from 'vs/base/common/async';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { ILogService } from 'vs/platform/log/common/log';\n\nexport class BrowserClipboardService extends Disposable implements IClipboardService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly mapTextToType = new Map<string, string>(); // unsupported in web (only in-memory)\n\n\tconstructor(\n\t\t@ILayoutService private readonly layoutService: ILayoutService,\n\t\t@ILogService private readonly logService: ILogService) {\n\t\tsuper();\n\t\tif (isSafari || isWebkitWebView) {\n\t\t\tthis.installWebKitWriteTextWorkaround();\n\t\t}\n\t}\n\n\tprivate webKitPendingClipboardWritePromise: DeferredPromise<string> | undefined;\n\n\t// In Safari, it has the following note:\n\t//\n\t// \"The request to write to the clipboard must be triggered during a user gesture.\n\t// A call to clipboard.write or clipboard.writeText outside the scope of a user\n\t// gesture(such as \"click\" or \"touch\" event handlers) will result in the immediate\n\t// rejection of the promise returned by the API call.\"\n\t// From: https://webkit.org/blog/10855/async-clipboard-api/\n\t//\n\t// Since extensions run in a web worker, and handle gestures in an asynchronous way,\n\t// they are not classified by Safari as \"in response to a user gesture\" and will reject.\n\t//\n\t// This function sets up some handlers to work around that behavior.\n\tprivate installWebKitWriteTextWorkaround(): void {\n\t\tconst handler = () => {\n\t\t\tconst currentWritePromise = new DeferredPromise<string>();\n\n\t\t\t// Cancel the previous promise since we just created a new one in response to this new event\n\t\t\tif (this.webKitPendingClipboardWritePromise && !this.webKitPendingClipboardWritePromise.isSettled) {\n\t\t\t\tthis.webKitPendingClipboardWritePromise.cancel();\n\t\t\t}\n\t\t\tthis.webKitPendingClipboardWritePromise = currentWritePromise;\n\n\t\t\t// The ctor of ClipboardItem allows you to pass in a promise that will resolve to a string.\n\t\t\t// This allows us to pass in a Promise that will either be cancelled by another event or\n\t\t\t// resolved with the contents of the first call to this.writeText.\n\t\t\t// see https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem#parameters\n\t\t\tnavigator.clipboard.write([new ClipboardItem({\n\t\t\t\t'text/plain': currentWritePromise.p,\n\t\t\t})]).catch(async err => {\n\t\t\t\tif (!(err instanceof Error) || err.name !== 'NotAllowedError' || !currentWritePromise.isRejected) {\n\t\t\t\t\tthis.logService.error(err);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.layoutService.hasContainer) {\n\t\t\tthis._register(addDisposableListener(this.layoutService.container, 'click', handler));\n\t\t\tthis._register(addDisposableListener(this.layoutService.container, 'keydown', handler));\n\t\t}\n\t}\n\n\tasync writeText(text: string, type?: string): Promise<void> {\n\n\t\t// With type: only in-memory is supported\n\t\tif (type) {\n\t\t\tthis.mapTextToType.set(type, text);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.webKitPendingClipboardWritePromise) {\n\t\t\t// For Safari, we complete this Promise which allows the call to `navigator.clipboard.write()`\n\t\t\t// above to resolve and successfully copy to the clipboard. If we let this continue, Safari\n\t\t\t// would throw an error because this call stack doesn't appear to originate from a user gesture.\n\t\t\treturn this.webKitPendingClipboardWritePromise.complete(text);\n\t\t}\n\n\t\t// Guard access to navigator.clipboard with try/catch\n\t\t// as we have seen DOMExceptions in certain browsers\n\t\t// due to security policies.\n\t\ttry {\n\t\t\treturn await navigator.clipboard.writeText(text);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\n\t\t// Fallback to textarea and execCommand solution\n\n\t\tconst activeElement = document.activeElement;\n\n\t\tconst textArea: HTMLTextAreaElement = document.body.appendChild($('textarea', { 'aria-hidden': true }));\n\t\ttextArea.style.height = '1px';\n\t\ttextArea.style.width = '1px';\n\t\ttextArea.style.position = 'absolute';\n\n\t\ttextArea.value = text;\n\t\ttextArea.focus();\n\t\ttextArea.select();\n\n\t\tdocument.execCommand('copy');\n\n\t\tif (activeElement instanceof HTMLElement) {\n\t\t\tactiveElement.focus();\n\t\t}\n\n\t\tdocument.body.removeChild(textArea);\n\n\t\treturn;\n\t}\n\n\tasync readText(type?: string): Promise<string> {\n\n\t\t// With type: only in-memory is supported\n\t\tif (type) {\n\t\t\treturn this.mapTextToType.get(type) || '';\n\t\t}\n\n\t\t// Guard access to navigator.clipboard with try/catch\n\t\t// as we have seen DOMExceptions in certain browsers\n\t\t// due to security policies.\n\t\ttry {\n\t\t\treturn await navigator.clipboard.readText();\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\n\t\t\treturn '';\n\t\t}\n\t}\n\n\tprivate findText = ''; // unsupported in web (only in-memory)\n\n\tasync readFindText(): Promise<string> {\n\t\treturn this.findText;\n\t}\n\n\tasync writeFindText(text: string): Promise<void> {\n\t\tthis.findText = text;\n\t}\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 'vs/base/common/event';\nimport Severity from 'vs/base/common/severity';\nimport { URI } from 'vs/base/common/uri';\nimport { localize } from 'vs/nls';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport interface IMarkerService {\n\treadonly _serviceBrand: undefined;\n\n\tchangeOne(owner: string, resource: URI, markers: IMarkerData[]): void;\n\n\tremove(owner: string, resources: URI[]): void;\n\n\tread(filter?: { owner?: string; resource?: URI; severities?: number; take?: number }): IMarker[];\n\n\treadonly onMarkerChanged: Event<readonly URI[]>;\n}\n\n/**\n *\n */\nexport interface IRelatedInformation {\n\tresource: URI;\n\tmessage: string;\n\tstartLineNumber: number;\n\tstartColumn: number;\n\tendLineNumber: number;\n\tendColumn: number;\n}\n\nexport const enum MarkerTag {\n\tUnnecessary = 1,\n\tDeprecated = 2\n}\n\nexport enum MarkerSeverity {\n\tHint = 1,\n\tInfo = 2,\n\tWarning = 4,\n\tError = 8,\n}\n\nexport namespace MarkerSeverity {\n\n\texport function compare(a: MarkerSeverity, b: MarkerSeverity): number {\n\t\treturn b - a;\n\t}\n\n\tconst _displayStrings: { [value: number]: string } = Object.create(null);\n\t_displayStrings[MarkerSeverity.Error] = localize('sev.error', \"Error\");\n\t_displayStrings[MarkerSeverity.Warning] = localize('sev.warning', \"Warning\");\n\t_displayStrings[MarkerSeverity.Info] = localize('sev.info', \"Info\");\n\n\texport function toString(a: MarkerSeverity): string {\n\t\treturn _displayStrings[a] || '';\n\t}\n\n\texport function fromSeverity(severity: Severity): MarkerSeverity {\n\t\tswitch (severity) {\n\t\t\tcase Severity.Error: return MarkerSeverity.Error;\n\t\t\tcase Severity.Warning: return MarkerSeverity.Warning;\n\t\t\tcase Severity.Info: return MarkerSeverity.Info;\n\t\t\tcase Severity.Ignore: return MarkerSeverity.Hint;\n\t\t}\n\t}\n\n\texport function toSeverity(severity: MarkerSeverity): Severity {\n\t\tswitch (severity) {\n\t\t\tcase MarkerSeverity.Error: return Severity.Error;\n\t\t\tcase MarkerSeverity.Warning: return Severity.Warning;\n\t\t\tcase MarkerSeverity.Info: return Severity.Info;\n\t\t\tcase MarkerSeverity.Hint: return Severity.Ignore;\n\t\t}\n\t}\n}\n\n/**\n * A structure defining a problem/warning/etc.\n */\nexport interface IMarkerData {\n\tcode?: string | { value: string; target: URI };\n\tseverity: MarkerSeverity;\n\tmessage: string;\n\tsource?: string;\n\tstartLineNumber: number;\n\tstartColumn: number;\n\tendLineNumber: number;\n\tendColumn: number;\n\trelatedInformation?: IRelatedInformation[];\n\ttags?: MarkerTag[];\n}\n\nexport interface IMarker {\n\towner: string;\n\tresource: URI;\n\tseverity: MarkerSeverity;\n\tcode?: string | { value: string; target: URI };\n\tmessage: string;\n\tsource?: string;\n\tstartLineNumber: number;\n\tstartColumn: number;\n\tendLineNumber: number;\n\tendColumn: number;\n\trelatedInformation?: IRelatedInformation[];\n\ttags?: MarkerTag[];\n}\n\nexport interface MarkerStatistics {\n\terrors: number;\n\twarnings: number;\n\tinfos: number;\n\tunknowns: number;\n}\n\nexport namespace IMarkerData {\n\tconst emptyString = '';\n\texport function makeKey(markerData: IMarkerData): string {\n\t\treturn makeKeyOptionalMessage(markerData, true);\n\t}\n\n\texport function makeKeyOptionalMessage(markerData: IMarkerData, useMessage: boolean): string {\n\t\tlet result: string[] = [emptyString];\n\t\tif (markerData.source) {\n\t\t\tresult.push(markerData.source.replace('¦', '\\\\¦'));\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.code) {\n\t\t\tif (typeof markerData.code === 'string') {\n\t\t\t\tresult.push(markerData.code.replace('¦', '\\\\¦'));\n\t\t\t} else {\n\t\t\t\tresult.push(markerData.code.value.replace('¦', '\\\\¦'));\n\t\t\t}\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.severity !== undefined && markerData.severity !== null) {\n\t\t\tresult.push(MarkerSeverity.toString(markerData.severity));\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\n\t\t// Modifed to not include the message as part of the marker key to work around\n\t\t// https://github.com/microsoft/vscode/issues/77475\n\t\tif (markerData.message && useMessage) {\n\t\t\tresult.push(markerData.message.replace('¦', '\\\\¦'));\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.startLineNumber !== undefined && markerData.startLineNumber !== null) {\n\t\t\tresult.push(markerData.startLineNumber.toString());\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.startColumn !== undefined && markerData.startColumn !== null) {\n\t\t\tresult.push(markerData.startColumn.toString());\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.endLineNumber !== undefined && markerData.endLineNumber !== null) {\n\t\t\tresult.push(markerData.endLineNumber.toString());\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tif (markerData.endColumn !== undefined && markerData.endColumn !== null) {\n\t\t\tresult.push(markerData.endColumn.toString());\n\t\t} else {\n\t\t\tresult.push(emptyString);\n\t\t}\n\t\tresult.push(emptyString);\n\t\treturn result.join('¦');\n\t}\n}\n\nexport const IMarkerService = createDecorator<IMarkerService>('markerService');\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 { binarySearch } from 'vs/base/common/arrays';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { compare } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\n\nexport class MarkerCoordinate {\n\tconstructor(\n\t\treadonly marker: IMarker,\n\t\treadonly index: number,\n\t\treadonly total: number\n\t) { }\n}\n\nexport class MarkerList {\n\n\tprivate readonly _onDidChange = new Emitter<void>();\n\treadonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate readonly _resourceFilter?: (uri: URI) => boolean;\n\tprivate readonly _dispoables = new DisposableStore();\n\n\tprivate _markers: IMarker[] = [];\n\tprivate _nextIdx: number = -1;\n\n\tconstructor(\n\t\tresourceFilter: URI | ((uri: URI) => boolean) | undefined,\n\t\t@IMarkerService private readonly _markerService: IMarkerService,\n\t\t@IConfigurationService private readonly _configService: IConfigurationService,\n\t) {\n\t\tif (URI.isUri(resourceFilter)) {\n\t\t\tthis._resourceFilter = uri => uri.toString() === resourceFilter.toString();\n\t\t} else if (resourceFilter) {\n\t\t\tthis._resourceFilter = resourceFilter;\n\t\t}\n\n\t\tconst compareOrder = this._configService.getValue<string>('problems.sortOrder');\n\t\tconst compareMarker = (a: IMarker, b: IMarker): number => {\n\t\t\tlet res = compare(a.resource.toString(), b.resource.toString());\n\t\t\tif (res === 0) {\n\t\t\t\tif (compareOrder === 'position') {\n\t\t\t\t\tres = Range.compareRangesUsingStarts(a, b) || MarkerSeverity.compare(a.severity, b.severity);\n\t\t\t\t} else {\n\t\t\t\t\tres = MarkerSeverity.compare(a.severity, b.severity) || Range.compareRangesUsingStarts(a, b);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t};\n\n\t\tconst updateMarker = () => {\n\t\t\tthis._markers = this._markerService.read({\n\t\t\t\tresource: URI.isUri(resourceFilter) ? resourceFilter : undefined,\n\t\t\t\tseverities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info\n\t\t\t});\n\t\t\tif (typeof resourceFilter === 'function') {\n\t\t\t\tthis._markers = this._markers.filter(m => this._resourceFilter!(m.resource));\n\t\t\t}\n\t\t\tthis._markers.sort(compareMarker);\n\t\t};\n\n\t\tupdateMarker();\n\n\t\tthis._dispoables.add(_markerService.onMarkerChanged(uris => {\n\t\t\tif (!this._resourceFilter || uris.some(uri => this._resourceFilter!(uri))) {\n\t\t\t\tupdateMarker();\n\t\t\t\tthis._nextIdx = -1;\n\t\t\t\tthis._onDidChange.fire();\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._dispoables.dispose();\n\t\tthis._onDidChange.dispose();\n\t}\n\n\tmatches(uri: URI | undefined) {\n\t\tif (!this._resourceFilter && !uri) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!this._resourceFilter || !uri) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this._resourceFilter(uri);\n\t}\n\n\tget selected(): MarkerCoordinate | undefined {\n\t\tconst marker = this._markers[this._nextIdx];\n\t\treturn marker && new MarkerCoordinate(marker, this._nextIdx + 1, this._markers.length);\n\t}\n\n\tprivate _initIdx(model: ITextModel, position: Position, fwd: boolean): void {\n\t\tlet found = false;\n\n\t\tlet idx = this._markers.findIndex(marker => marker.resource.toString() === model.uri.toString());\n\t\tif (idx < 0) {\n\t\t\tidx = binarySearch(this._markers, <any>{ resource: model.uri }, (a, b) => compare(a.resource.toString(), b.resource.toString()));\n\t\t\tif (idx < 0) {\n\t\t\t\tidx = ~idx;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = idx; i < this._markers.length; i++) {\n\t\t\tlet range = Range.lift(this._markers[i]);\n\n\t\t\tif (range.isEmpty()) {\n\t\t\t\tconst word = model.getWordAtPosition(range.getStartPosition());\n\t\t\t\tif (word) {\n\t\t\t\t\trange = new Range(range.startLineNumber, word.startColumn, range.startLineNumber, word.endColumn);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (position && (range.containsPosition(position) || position.isBeforeOrEqual(range.getStartPosition()))) {\n\t\t\t\tthis._nextIdx = i;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (this._markers[i].resource.toString() !== model.uri.toString()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!found) {\n\t\t\t// after the last change\n\t\t\tthis._nextIdx = fwd ? 0 : this._markers.length - 1;\n\t\t}\n\t\tif (this._nextIdx < 0) {\n\t\t\tthis._nextIdx = this._markers.length - 1;\n\t\t}\n\t}\n\n\tresetIndex() {\n\t\tthis._nextIdx = -1;\n\t}\n\n\tmove(fwd: boolean, model: ITextModel, position: Position): boolean {\n\t\tif (this._markers.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet oldIdx = this._nextIdx;\n\t\tif (this._nextIdx === -1) {\n\t\t\tthis._initIdx(model, position, fwd);\n\t\t} else if (fwd) {\n\t\t\tthis._nextIdx = (this._nextIdx + 1) % this._markers.length;\n\t\t} else if (!fwd) {\n\t\t\tthis._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length;\n\t\t}\n\n\t\tif (oldIdx !== this._nextIdx) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfind(uri: URI, position: Position): MarkerCoordinate | undefined {\n\t\tlet idx = this._markers.findIndex(marker => marker.resource.toString() === uri.toString());\n\t\tif (idx < 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tfor (; idx < this._markers.length; idx++) {\n\t\t\tif (Range.containsPosition(this._markers[idx], position)) {\n\t\t\t\treturn new MarkerCoordinate(this._markers[idx], idx + 1, this._markers.length);\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n}\n\nexport const IMarkerNavigationService = createDecorator<IMarkerNavigationService>('IMarkerNavigationService');\n\nexport interface IMarkerNavigationService {\n\treadonly _serviceBrand: undefined;\n\tgetMarkerList(resource: URI | undefined): MarkerList;\n}\n\nexport interface IMarkerListProvider {\n\tgetMarkerList(resource: URI | undefined): MarkerList | undefined;\n}\n\nclass MarkerNavigationService implements IMarkerNavigationService, IMarkerListProvider {\n\n\treadonly _serviceBrand: undefined;\n\n\tprivate readonly _provider = new LinkedList<IMarkerListProvider>();\n\n\tconstructor(\n\t\t@IMarkerService private readonly _markerService: IMarkerService,\n\t\t@IConfigurationService private readonly _configService: IConfigurationService,\n\t) { }\n\n\tgetMarkerList(resource: URI | undefined): MarkerList {\n\t\tfor (let provider of this._provider) {\n\t\t\tconst result = provider.getMarkerList(resource);\n\t\t\tif (result) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t// default\n\t\treturn new MarkerList(resource, this._markerService, this._configService);\n\t}\n}\n\nregisterSingleton(IMarkerNavigationService, MarkerNavigationService, true);\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 { isFalsyOrEmpty } from 'vs/base/common/arrays';\nimport { DebounceEmitter } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { ResourceMap } from 'vs/base/common/map';\nimport { Schemas } from 'vs/base/common/network';\nimport { URI } from 'vs/base/common/uri';\nimport { IMarker, IMarkerData, IMarkerService, MarkerSeverity, MarkerStatistics } from './markers';\n\nclass DoubleResourceMap<V>{\n\n\tprivate _byResource = new ResourceMap<Map<string, V>>();\n\tprivate _byOwner = new Map<string, ResourceMap<V>>();\n\n\tset(resource: URI, owner: string, value: V) {\n\t\tlet ownerMap = this._byResource.get(resource);\n\t\tif (!ownerMap) {\n\t\t\townerMap = new Map();\n\t\t\tthis._byResource.set(resource, ownerMap);\n\t\t}\n\t\townerMap.set(owner, value);\n\n\t\tlet resourceMap = this._byOwner.get(owner);\n\t\tif (!resourceMap) {\n\t\t\tresourceMap = new ResourceMap();\n\t\t\tthis._byOwner.set(owner, resourceMap);\n\t\t}\n\t\tresourceMap.set(resource, value);\n\t}\n\n\tget(resource: URI, owner: string): V | undefined {\n\t\tlet ownerMap = this._byResource.get(resource);\n\t\treturn ownerMap?.get(owner);\n\t}\n\n\tdelete(resource: URI, owner: string): boolean {\n\t\tlet removedA = false;\n\t\tlet removedB = false;\n\t\tlet ownerMap = this._byResource.get(resource);\n\t\tif (ownerMap) {\n\t\t\tremovedA = ownerMap.delete(owner);\n\t\t}\n\t\tlet resourceMap = this._byOwner.get(owner);\n\t\tif (resourceMap) {\n\t\t\tremovedB = resourceMap.delete(resource);\n\t\t}\n\t\tif (removedA !== removedB) {\n\t\t\tthrow new Error('illegal state');\n\t\t}\n\t\treturn removedA && removedB;\n\t}\n\n\tvalues(key?: URI | string): Iterable<V> {\n\t\tif (typeof key === 'string') {\n\t\t\treturn this._byOwner.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\t\tif (URI.isUri(key)) {\n\t\t\treturn this._byResource.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\n\t\treturn Iterable.map(Iterable.concat(...this._byOwner.values()), map => map[1]);\n\t}\n}\n\nclass MarkerStats implements MarkerStatistics {\n\n\terrors: number = 0;\n\tinfos: number = 0;\n\twarnings: number = 0;\n\tunknowns: number = 0;\n\n\tprivate readonly _data = new ResourceMap<MarkerStatistics>();\n\tprivate readonly _service: IMarkerService;\n\tprivate readonly _subscription: IDisposable;\n\n\tconstructor(service: IMarkerService) {\n\t\tthis._service = service;\n\t\tthis._subscription = service.onMarkerChanged(this._update, this);\n\t}\n\n\tdispose(): void {\n\t\tthis._subscription.dispose();\n\t}\n\n\tprivate _update(resources: readonly URI[]): void {\n\t\tfor (const resource of resources) {\n\t\t\tconst oldStats = this._data.get(resource);\n\t\t\tif (oldStats) {\n\t\t\t\tthis._substract(oldStats);\n\t\t\t}\n\t\t\tconst newStats = this._resourceStats(resource);\n\t\t\tthis._add(newStats);\n\t\t\tthis._data.set(resource, newStats);\n\t\t}\n\t}\n\n\tprivate _resourceStats(resource: URI): MarkerStatistics {\n\t\tconst result: MarkerStatistics = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };\n\n\t\t// TODO this is a hack\n\t\tif (resource.scheme === Schemas.inMemory || resource.scheme === Schemas.walkThrough || resource.scheme === Schemas.walkThroughSnippet) {\n\t\t\treturn result;\n\t\t}\n\n\t\tfor (const { severity } of this._service.read({ resource })) {\n\t\t\tif (severity === MarkerSeverity.Error) {\n\t\t\t\tresult.errors += 1;\n\t\t\t} else if (severity === MarkerSeverity.Warning) {\n\t\t\t\tresult.warnings += 1;\n\t\t\t} else if (severity === MarkerSeverity.Info) {\n\t\t\t\tresult.infos += 1;\n\t\t\t} else {\n\t\t\t\tresult.unknowns += 1;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _substract(op: MarkerStatistics) {\n\t\tthis.errors -= op.errors;\n\t\tthis.warnings -= op.warnings;\n\t\tthis.infos -= op.infos;\n\t\tthis.unknowns -= op.unknowns;\n\t}\n\n\tprivate _add(op: MarkerStatistics) {\n\t\tthis.errors += op.errors;\n\t\tthis.warnings += op.warnings;\n\t\tthis.infos += op.infos;\n\t\tthis.unknowns += op.unknowns;\n\t}\n}\n\nexport class MarkerService implements IMarkerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onMarkerChanged = new DebounceEmitter<readonly URI[]>({\n\t\tdelay: 0,\n\t\tmerge: MarkerService._merge\n\t});\n\n\treadonly onMarkerChanged = this._onMarkerChanged.event;\n\n\tprivate readonly _data = new DoubleResourceMap<IMarker[]>();\n\tprivate readonly _stats = new MarkerStats(this);\n\n\tdispose(): void {\n\t\tthis._stats.dispose();\n\t\tthis._onMarkerChanged.dispose();\n\t}\n\n\tremove(owner: string, resources: URI[]): void {\n\t\tfor (const resource of resources || []) {\n\t\t\tthis.changeOne(owner, resource, []);\n\t\t}\n\t}\n\n\tchangeOne(owner: string, resource: URI, markerData: IMarkerData[]): void {\n\n\t\tif (isFalsyOrEmpty(markerData)) {\n\t\t\t// remove marker for this (owner,resource)-tuple\n\t\t\tconst removed = this._data.delete(resource, owner);\n\t\t\tif (removed) {\n\t\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// insert marker for this (owner,resource)-tuple\n\t\t\tconst markers: IMarker[] = [];\n\t\t\tfor (const data of markerData) {\n\t\t\t\tconst marker = MarkerService._toMarker(owner, resource, data);\n\t\t\t\tif (marker) {\n\t\t\t\t\tmarkers.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._data.set(resource, owner, markers);\n\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t}\n\t}\n\n\tprivate static _toMarker(owner: string, resource: URI, data: IMarkerData): IMarker | undefined {\n\t\tlet {\n\t\t\tcode, severity,\n\t\t\tmessage, source,\n\t\t\tstartLineNumber, startColumn, endLineNumber, endColumn,\n\t\t\trelatedInformation,\n\t\t\ttags,\n\t\t} = data;\n\n\t\tif (!message) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// santize data\n\t\tstartLineNumber = startLineNumber > 0 ? startLineNumber : 1;\n\t\tstartColumn = startColumn > 0 ? startColumn : 1;\n\t\tendLineNumber = endLineNumber >= startLineNumber ? endLineNumber : startLineNumber;\n\t\tendColumn = endColumn > 0 ? endColumn : startColumn;\n\n\t\treturn {\n\t\t\tresource,\n\t\t\towner,\n\t\t\tcode,\n\t\t\tseverity,\n\t\t\tmessage,\n\t\t\tsource,\n\t\t\tstartLineNumber,\n\t\t\tstartColumn,\n\t\t\tendLineNumber,\n\t\t\tendColumn,\n\t\t\trelatedInformation,\n\t\t\ttags,\n\t\t};\n\t}\n\n\tread(filter: { owner?: string; resource?: URI; severities?: number; take?: number } = Object.create(null)): IMarker[] {\n\n\t\tlet { owner, resource, severities, take } = filter;\n\n\t\tif (!take || take < 0) {\n\t\t\ttake = -1;\n\t\t}\n\n\t\tif (owner && resource) {\n\t\t\t// exactly one owner AND resource\n\t\t\tconst data = this._data.get(resource, owner);\n\t\t\tif (!data) {\n\t\t\t\treturn [];\n\t\t\t} else {\n\t\t\t\tconst result: IMarker[] = [];\n\t\t\t\tfor (const marker of data) {\n\t\t\t\t\tif (MarkerService._accept(marker, severities)) {\n\t\t\t\t\t\tconst newLen = result.push(marker);\n\t\t\t\t\t\tif (take > 0 && newLen === take) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t} else if (!owner && !resource) {\n\t\t\t// all\n\t\t\tconst result: IMarker[] = [];\n\t\t\tfor (let markers of this._data.values()) {\n\t\t\t\tfor (let data of markers) {\n\t\t\t\t\tif (MarkerService._accept(data, severities)) {\n\t\t\t\t\t\tconst newLen = result.push(data);\n\t\t\t\t\t\tif (take > 0 && newLen === take) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\t// of one resource OR owner\n\t\t\tconst iterable = this._data.values(resource ?? owner!);\n\t\t\tconst result: IMarker[] = [];\n\t\t\tfor (const markers of iterable) {\n\t\t\t\tfor (const data of markers) {\n\t\t\t\t\tif (MarkerService._accept(data, severities)) {\n\t\t\t\t\t\tconst newLen = result.push(data);\n\t\t\t\t\t\tif (take > 0 && newLen === take) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate static _accept(marker: IMarker, severities?: number): boolean {\n\t\treturn severities === undefined || (severities & marker.severity) === marker.severity;\n\t}\n\n\t// --- event debounce logic\n\n\tprivate static _merge(all: (readonly URI[])[]): URI[] {\n\t\tconst set = new ResourceMap<boolean>();\n\t\tfor (let array of all) {\n\t\t\tfor (let item of array) {\n\t\t\t\tset.set(item, true);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(set.keys());\n\t}\n}\n","\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport BaseSeverity from 'vs/base/common/severity';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport import Severity = BaseSeverity;\n\nexport const INotificationService = createDecorator<INotificationService>('notificationService');\n\nexport type NotificationMessage = string | Error;\n\nexport interface INotificationProperties {\n\n\t/**\n\t * Sticky notifications are not automatically removed after a certain timeout. By\n\t * default, notifications with primary actions and severity error are always sticky.\n\t */\n\treadonly sticky?: boolean;\n}\n\nexport interface INotification extends INotificationProperties {\n\n\t/**\n\t * The severity of the notification. Either `Info`, `Warning` or `Error`.\n\t */\n\treadonly severity: Severity;\n\n\t/**\n\t * The message of the notification. This can either be a `string` or `Error`. Messages\n\t * can optionally include links in the format: `[text](link)`\n\t */\n\treadonly message: NotificationMessage;\n\n\t/**\n\t * The source of the notification appears as additional information.\n\t */\n\treadonly source?: string | { label: string; id: string };\n}\n\nexport interface INotificationHandle {\n}\n\nexport interface IStatusMessageOptions {\n\n\t/**\n\t * An optional timeout after which the status message is to be hidden. By default\n\t * the status message will not hide until another status message is displayed.\n\t */\n\treadonly hideAfter?: number;\n}\n\n/**\n * A service to bring up notifications and non-modal prompts.\n *\n * Note: use the `IDialogService` for a modal way to ask the user for input.\n */\nexport interface INotificationService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Show the provided notification to the user. The returned `INotificationHandle`\n\t * can be used to control the notification afterwards.\n\t *\n\t * **Note:** If your intent is to show a message with actions to the user, consider\n\t * the `INotificationService.prompt()` method instead which are optimized for\n\t * this usecase and much easier to use!\n\t *\n\t * @returns a handle on the notification to e.g. hide it or update message, buttons, etc.\n\t */\n\tnotify(notification: INotification): INotificationHandle;\n\n\t/**\n\t * A convenient way of reporting infos. Use the `INotificationService.notify`\n\t * method if you need more control over the notification.\n\t */\n\tinfo(message: NotificationMessage | NotificationMessage[]): void;\n\n\t/**\n\t * A convenient way of reporting warnings. Use the `INotificationService.notify`\n\t * method if you need more control over the notification.\n\t */\n\twarn(message: NotificationMessage | NotificationMessage[]): void;\n\n\t/**\n\t * A convenient way of reporting errors. Use the `INotificationService.notify`\n\t * method if you need more control over the notification.\n\t */\n\terror(message: NotificationMessage | NotificationMessage[]): void;\n\n\t/**\n\t * Shows a status message in the status area with the provided text.\n\t *\n\t * @param message the message to show as status\n\t * @param options provides some optional configuration options\n\t *\n\t * @returns a disposable to hide the status message\n\t */\n\tstatus(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable;\n}\n\nexport class NoOpNotification implements INotificationHandle {\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { IEditorOptions, ITextEditorSelection } from 'vs/platform/editor/common/editor';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IOpenerService = createDecorator<IOpenerService>('openerService');\n\nexport type OpenInternalOptions = {\n\n\t/**\n\t * Signals that the intent is to open an editor to the side\n\t * of the currently active editor.\n\t */\n\treadonly openToSide?: boolean;\n\n\t/**\n\t * Extra editor options to apply in case an editor is used to open.\n\t */\n\treadonly editorOptions?: IEditorOptions;\n\n\t/**\n\t * Signals that the editor to open was triggered through a user\n\t * action, such as keyboard or mouse usage.\n\t */\n\treadonly fromUserGesture?: boolean;\n\n\t/**\n\t * Allow command links to be handled.\n\t */\n\treadonly allowCommands?: boolean;\n};\n\nexport type OpenExternalOptions = {\n\treadonly openExternal?: boolean;\n\treadonly allowTunneling?: boolean;\n\treadonly allowContributedOpeners?: boolean | string;\n};\n\nexport type OpenOptions = OpenInternalOptions & OpenExternalOptions;\n\nexport type ResolveExternalUriOptions = { readonly allowTunneling?: boolean };\n\nexport interface IResolvedExternalUri extends IDisposable {\n\tresolved: URI;\n}\n\nexport interface IOpener {\n\topen(resource: URI | string, options?: OpenInternalOptions | OpenExternalOptions): Promise<boolean>;\n}\n\nexport interface IExternalOpener {\n\topenExternal(href: string, ctx: { sourceUri: URI; preferredOpenerId?: string }, token: CancellationToken): Promise<boolean>;\n\tdispose?(): void;\n}\n\nexport interface IValidator {\n\tshouldOpen(resource: URI | string): Promise<boolean>;\n}\n\nexport interface IExternalUriResolver {\n\tresolveExternalUri(resource: URI, options?: OpenOptions): Promise<{ resolved: URI; dispose(): void } | undefined>;\n}\n\nexport interface IOpenerService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Register a participant that can handle the open() call.\n\t */\n\tregisterOpener(opener: IOpener): IDisposable;\n\n\t/**\n\t * Register a participant that can validate if the URI resource be opened.\n\t * Validators are run before openers.\n\t */\n\tregisterValidator(validator: IValidator): IDisposable;\n\n\t/**\n\t * Register a participant that can resolve an external URI resource to be opened.\n\t */\n\tregisterExternalUriResolver(resolver: IExternalUriResolver): IDisposable;\n\n\t/**\n\t * Sets the handler for opening externally. If not provided,\n\t * a default handler will be used.\n\t */\n\tsetDefaultExternalOpener(opener: IExternalOpener): void;\n\n\t/**\n\t * Registers a new opener external resources openers.\n\t */\n\tregisterExternalOpener(opener: IExternalOpener): IDisposable;\n\n\t/**\n\t * Opens a resource, like a webaddress, a document uri, or executes command.\n\t *\n\t * @param resource A resource\n\t * @return A promise that resolves when the opening is done.\n\t */\n\topen(resource: URI | string, options?: OpenInternalOptions | OpenExternalOptions): Promise<boolean>;\n\n\t/**\n\t * Resolve a resource to its external form.\n\t * @throws whenever resolvers couldn't resolve this resource externally.\n\t */\n\tresolveExternalUri(resource: URI, options?: ResolveExternalUriOptions): Promise<IResolvedExternalUri>;\n}\n\nexport const NullOpenerService = Object.freeze({\n\t_serviceBrand: undefined,\n\tregisterOpener() { return Disposable.None; },\n\tregisterValidator() { return Disposable.None; },\n\tregisterExternalUriResolver() { return Disposable.None; },\n\tsetDefaultExternalOpener() { },\n\tregisterExternalOpener() { return Disposable.None; },\n\tasync open() { return false; },\n\tasync resolveExternalUri(uri: URI) { return { resolved: uri, dispose() { } }; },\n} as IOpenerService);\n\nexport function matchesScheme(target: URI | string, scheme: string): boolean {\n\tif (URI.isUri(target)) {\n\t\treturn equalsIgnoreCase(target.scheme, scheme);\n\t} else {\n\t\treturn startsWithIgnoreCase(target, scheme + ':');\n\t}\n}\n\nexport function matchesSomeScheme(target: URI | string, ...schemes: string[]): boolean {\n\treturn schemes.some(scheme => matchesScheme(target, scheme));\n}\n\n/**\n * file:///some/file.js#73\n * file:///some/file.js#L73\n * file:///some/file.js#73,84\n * file:///some/file.js#L73,84\n * file:///some/file.js#73-83\n * file:///some/file.js#L73-L83\n * file:///some/file.js#73,84-83,52\n * file:///some/file.js#L73,84-L83,52\n */\nexport function extractSelection(uri: URI): { selection: ITextEditorSelection | undefined; uri: URI } {\n\tlet selection: ITextEditorSelection | undefined = undefined;\n\tconst match = /^L?(\\d+)(?:,(\\d+))?(-L?(\\d+)(?:,(\\d+))?)?/.exec(uri.fragment);\n\tif (match) {\n\t\tselection = {\n\t\t\tstartLineNumber: parseInt(match[1]),\n\t\t\tstartColumn: match[2] ? parseInt(match[2]) : 1,\n\t\t\tendLineNumber: match[4] ? parseInt(match[4]) : undefined,\n\t\t\tendColumn: match[4] ? (match[5] ? parseInt(match[5]) : 1) : undefined\n\t\t};\n\t\turi = uri.with({ fragment: '' });\n\t}\n\treturn { selection, uri };\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 * as dom from 'vs/base/browser/dom';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { ResourceMap } from 'vs/base/common/map';\nimport { parse } from 'vs/base/common/marshalling';\nimport { Schemas } from 'vs/base/common/network';\nimport { normalizePath } from 'vs/base/common/resources';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { EditorOpenSource } from 'vs/platform/editor/common/editor';\nimport { extractSelection, IExternalOpener, IExternalUriResolver, IOpener, IOpenerService, IResolvedExternalUri, IValidator, matchesScheme, matchesSomeScheme, OpenOptions, ResolveExternalUriOptions } from 'vs/platform/opener/common/opener';\n\nclass CommandOpener implements IOpener {\n\n\tconstructor(@ICommandService private readonly _commandService: ICommandService) { }\n\n\tasync open(target: URI | string, options?: OpenOptions): Promise<boolean> {\n\t\tif (!matchesScheme(target, Schemas.command)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!options?.allowCommands) {\n\t\t\t// silently ignore commands when command-links are disabled, also\n\t\t\t// surpress other openers by returning TRUE\n\t\t\treturn true;\n\t\t}\n\t\t// run command or bail out if command isn't known\n\t\tif (typeof target === 'string') {\n\t\t\ttarget = URI.parse(target);\n\t\t}\n\t\t// execute as command\n\t\tlet args: any = [];\n\t\ttry {\n\t\t\targs = parse(decodeURIComponent(target.query));\n\t\t} catch {\n\t\t\t// ignore and retry\n\t\t\ttry {\n\t\t\t\targs = parse(target.query);\n\t\t\t} catch {\n\t\t\t\t// ignore error\n\t\t\t}\n\t\t}\n\t\tif (!Array.isArray(args)) {\n\t\t\targs = [args];\n\t\t}\n\t\tawait this._commandService.executeCommand(target.path, ...args);\n\t\treturn true;\n\t}\n}\n\nclass EditorOpener implements IOpener {\n\n\tconstructor(@ICodeEditorService private readonly _editorService: ICodeEditorService) { }\n\n\tasync open(target: URI | string, options: OpenOptions) {\n\t\tif (typeof target === 'string') {\n\t\t\ttarget = URI.parse(target);\n\t\t}\n\t\tconst { selection, uri } = extractSelection(target);\n\t\ttarget = uri;\n\n\t\tif (target.scheme === Schemas.file) {\n\t\t\ttarget = normalizePath(target); // workaround for non-normalized paths (https://github.com/microsoft/vscode/issues/12954)\n\t\t}\n\n\t\tawait this._editorService.openCodeEditor(\n\t\t\t{\n\t\t\t\tresource: target,\n\t\t\t\toptions: {\n\t\t\t\t\tselection,\n\t\t\t\t\tsource: options?.fromUserGesture ? EditorOpenSource.USER : EditorOpenSource.API,\n\t\t\t\t\t...options?.editorOptions\n\t\t\t\t}\n\t\t\t},\n\t\t\tthis._editorService.getFocusedCodeEditor(),\n\t\t\toptions?.openToSide\n\t\t);\n\n\t\treturn true;\n\t}\n}\n\nexport class OpenerService implements IOpenerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _openers = new LinkedList<IOpener>();\n\tprivate readonly _validators = new LinkedList<IValidator>();\n\tprivate readonly _resolvers = new LinkedList<IExternalUriResolver>();\n\tprivate readonly _resolvedUriTargets = new ResourceMap<URI>(uri => uri.with({ path: null, fragment: null, query: null }).toString());\n\n\tprivate _defaultExternalOpener: IExternalOpener;\n\tprivate readonly _externalOpeners = new LinkedList<IExternalOpener>();\n\n\tconstructor(\n\t\t@ICodeEditorService editorService: ICodeEditorService,\n\t\t@ICommandService commandService: ICommandService\n\t) {\n\t\t// Default external opener is going through window.open()\n\t\tthis._defaultExternalOpener = {\n\t\t\topenExternal: async href => {\n\t\t\t\t// ensure to open HTTP/HTTPS links into new windows\n\t\t\t\t// to not trigger a navigation. Any other link is\n\t\t\t\t// safe to be set as HREF to prevent a blank window\n\t\t\t\t// from opening.\n\t\t\t\tif (matchesSomeScheme(href, Schemas.http, Schemas.https)) {\n\t\t\t\t\tdom.windowOpenNoOpener(href);\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = href;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\n\t\t// Default opener: any external, maito, http(s), command, and catch-all-editors\n\t\tthis._openers.push({\n\t\t\topen: async (target: URI | string, options?: OpenOptions) => {\n\t\t\t\tif (options?.openExternal || matchesSomeScheme(target, Schemas.mailto, Schemas.http, Schemas.https, Schemas.vsls)) {\n\t\t\t\t\t// open externally\n\t\t\t\t\tawait this._doOpenExternal(target, options);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tthis._openers.push(new CommandOpener(commandService));\n\t\tthis._openers.push(new EditorOpener(editorService));\n\t}\n\n\tregisterOpener(opener: IOpener): IDisposable {\n\t\tconst remove = this._openers.unshift(opener);\n\t\treturn { dispose: remove };\n\t}\n\n\tregisterValidator(validator: IValidator): IDisposable {\n\t\tconst remove = this._validators.push(validator);\n\t\treturn { dispose: remove };\n\t}\n\n\tregisterExternalUriResolver(resolver: IExternalUriResolver): IDisposable {\n\t\tconst remove = this._resolvers.push(resolver);\n\t\treturn { dispose: remove };\n\t}\n\n\tsetDefaultExternalOpener(externalOpener: IExternalOpener): void {\n\t\tthis._defaultExternalOpener = externalOpener;\n\t}\n\n\tregisterExternalOpener(opener: IExternalOpener): IDisposable {\n\t\tconst remove = this._externalOpeners.push(opener);\n\t\treturn { dispose: remove };\n\t}\n\n\tasync open(target: URI | string, options?: OpenOptions): Promise<boolean> {\n\t\t// check with contributed validators\n\t\tconst targetURI = typeof target === 'string' ? URI.parse(target) : target;\n\t\t// validate against the original URI that this URI resolves to, if one exists\n\t\tconst validationTarget = this._resolvedUriTargets.get(targetURI) ?? target;\n\t\tfor (const validator of this._validators) {\n\t\t\tif (!(await validator.shouldOpen(validationTarget))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// check with contributed openers\n\t\tfor (const opener of this._openers) {\n\t\t\tconst handled = await opener.open(target, options);\n\t\t\tif (handled) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tasync resolveExternalUri(resource: URI, options?: ResolveExternalUriOptions): Promise<IResolvedExternalUri> {\n\t\tfor (const resolver of this._resolvers) {\n\t\t\ttry {\n\t\t\t\tconst result = await resolver.resolveExternalUri(resource, options);\n\t\t\t\tif (result) {\n\t\t\t\t\tif (!this._resolvedUriTargets.has(result.resolved)) {\n\t\t\t\t\t\tthis._resolvedUriTargets.set(result.resolved, resource);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// noop\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error('Could not resolve external URI: ' + resource.toString());\n\t}\n\n\tprivate async _doOpenExternal(resource: URI | string, options: OpenOptions | undefined): Promise<boolean> {\n\n\t\t//todo@jrieken IExternalUriResolver should support `uri: URI | string`\n\t\tconst uri = typeof resource === 'string' ? URI.parse(resource) : resource;\n\t\tlet externalUri: URI;\n\n\t\ttry {\n\t\t\texternalUri = (await this.resolveExternalUri(uri, options)).resolved;\n\t\t} catch {\n\t\t\texternalUri = uri;\n\t\t}\n\n\t\tlet href: string;\n\t\tif (typeof resource === 'string' && uri.toString() === externalUri.toString()) {\n\t\t\t// open the url-string AS IS\n\t\t\thref = resource;\n\t\t} else {\n\t\t\t// open URI using the toString(noEncode)+encodeURI-trick\n\t\t\thref = encodeURI(externalUri.toString(true));\n\t\t}\n\n\t\tif (options?.allowContributedOpeners) {\n\t\t\tconst preferredOpenerId = typeof options?.allowContributedOpeners === 'string' ? options?.allowContributedOpeners : undefined;\n\t\t\tfor (const opener of this._externalOpeners) {\n\t\t\t\tconst didOpen = await opener.openExternal(href, {\n\t\t\t\t\tsourceUri: uri,\n\t\t\t\t\tpreferredOpenerId,\n\t\t\t\t}, CancellationToken.None);\n\t\t\t\tif (didOpen) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this._defaultExternalOpener.openExternal(href, { sourceUri: uri }, CancellationToken.None);\n\t}\n\n\tdispose() {\n\t\tthis._validators.clear();\n\t}\n}\n","\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport interface IProgressIndicator {\n\n\t/**\n\t * Show progress customized with the provided flags.\n\t */\n\tshow(infinite: true, delay?: number): IProgressRunner;\n\tshow(total: number, delay?: number): IProgressRunner;\n\n\t/**\n\t * Indicate progress for the duration of the provided promise. Progress will stop in\n\t * any case of promise completion, error or cancellation.\n\t */\n\tshowWhile(promise: Promise<unknown>, delay?: number): Promise<void>;\n}\n\nexport interface IProgressRunner {\n\ttotal(value: number): void;\n\tworked(value: number): void;\n\tdone(): void;\n}\n\nexport const emptyProgressRunner: IProgressRunner = Object.freeze({\n\ttotal() { },\n\tworked() { },\n\tdone() { }\n});\n\nexport interface IProgress<T> {\n\treport(item: T): void;\n}\n\nexport class Progress<T> implements IProgress<T> {\n\n\tstatic readonly None: IProgress<unknown> = Object.freeze({ report() { } });\n\n\tprivate _value?: T;\n\n\tconstructor(private callback: (data: T) => void) { }\n\n\treport(item: T) {\n\t\tthis._value = item;\n\t\tthis.callback(this._value);\n\t}\n}\n\nexport const IEditorProgressService = createDecorator<IEditorProgressService>('editorProgressService');\n\n/**\n * A progress service that will report progress local to the editor triggered from.\n */\nexport interface IEditorProgressService extends IProgressIndicator {\n\n\treadonly _serviceBrand: undefined;\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 { timeout } from 'vs/base/common/async';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { IKeyMods, IQuickPickDidAcceptEvent, IQuickPickSeparator } from 'vs/base/parts/quickinput/common/quickInput';\nimport { IQuickAccessProvider } from 'vs/platform/quickinput/common/quickAccess';\nimport { IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\n\nexport enum TriggerAction {\n\n\t/**\n\t * Do nothing after the button was clicked.\n\t */\n\tNO_ACTION,\n\n\t/**\n\t * Close the picker.\n\t */\n\tCLOSE_PICKER,\n\n\t/**\n\t * Update the results of the picker.\n\t */\n\tREFRESH_PICKER,\n\n\t/**\n\t * Remove the item from the picker.\n\t */\n\tREMOVE_ITEM\n}\n\nexport interface IPickerQuickAccessItem extends IQuickPickItem {\n\n\t/**\n\t* A method that will be executed when the pick item is accepted from\n\t* the picker. The picker will close automatically before running this.\n\t*\n\t* @param keyMods the state of modifier keys when the item was accepted.\n\t* @param event the underlying event that caused the accept to trigger.\n\t*/\n\taccept?(keyMods: IKeyMods, event: IQuickPickDidAcceptEvent): void;\n\n\t/**\n\t * A method that will be executed when a button of the pick item was\n\t * clicked on.\n\t *\n\t * @param buttonIndex index of the button of the item that\n\t * was clicked.\n\t *\n\t * @param the state of modifier keys when the button was triggered.\n\t *\n\t * @returns a value that indicates what should happen after the trigger\n\t * which can be a `Promise` for long running operations.\n\t */\n\ttrigger?(buttonIndex: number, keyMods: IKeyMods): TriggerAction | Promise<TriggerAction>;\n}\n\nexport interface IPickerQuickAccessProviderOptions<T extends IPickerQuickAccessItem> {\n\n\t/**\n\t * Enables support for opening picks in the background via gesture.\n\t */\n\tcanAcceptInBackground?: boolean;\n\n\t/**\n\t * Enables to show a pick entry when no results are returned from a search.\n\t */\n\tnoResultsPick?: T;\n}\n\nexport type Pick<T> = T | IQuickPickSeparator;\nexport type PicksWithActive<T> = { items: readonly Pick<T>[]; active?: T };\nexport type Picks<T> = readonly Pick<T>[] | PicksWithActive<T>;\nexport type FastAndSlowPicks<T> = { picks: Picks<T>; additionalPicks: Promise<Picks<T>> };\n\nfunction isPicksWithActive<T>(obj: unknown): obj is PicksWithActive<T> {\n\tconst candidate = obj as PicksWithActive<T>;\n\n\treturn Array.isArray(candidate.items);\n}\n\nfunction isFastAndSlowPicks<T>(obj: unknown): obj is FastAndSlowPicks<T> {\n\tconst candidate = obj as FastAndSlowPicks<T>;\n\n\treturn !!candidate.picks && candidate.additionalPicks instanceof Promise;\n}\n\nexport abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem> extends Disposable implements IQuickAccessProvider {\n\n\tprivate static FAST_PICKS_RACE_DELAY = 200; // timeout before we accept fast results before slow results are present\n\n\tconstructor(private prefix: string, protected options?: IPickerQuickAccessProviderOptions<T>) {\n\t\tsuper();\n\t}\n\n\tprovide(picker: IQuickPick<T>, token: CancellationToken): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Set initial picks and update on type\n\t\tlet picksCts: CancellationTokenSource | undefined = undefined;\n\t\tconst picksDisposable = disposables.add(new MutableDisposable());\n\t\tconst updatePickerItems = async () => {\n\t\t\tconst picksDisposables = picksDisposable.value = new DisposableStore();\n\n\t\t\t// Cancel any previous ask for picks and busy\n\t\t\tpicksCts?.dispose(true);\n\t\t\tpicker.busy = false;\n\n\t\t\t// Create new cancellation source for this run\n\t\t\tpicksCts = new CancellationTokenSource(token);\n\n\t\t\t// Collect picks and support both long running and short or combined\n\t\t\tconst picksToken = picksCts.token;\n\t\t\tconst picksFilter = picker.value.substr(this.prefix.length).trim();\n\t\t\tconst providedPicks = this._getPicks(picksFilter, picksDisposables, picksToken);\n\n\t\t\tconst applyPicks = (picks: Picks<T>, skipEmpty?: boolean): boolean => {\n\t\t\t\tlet items: readonly Pick<T>[];\n\t\t\t\tlet activeItem: T | undefined = undefined;\n\n\t\t\t\tif (isPicksWithActive(picks)) {\n\t\t\t\t\titems = picks.items;\n\t\t\t\t\tactiveItem = picks.active;\n\t\t\t\t} else {\n\t\t\t\t\titems = picks;\n\t\t\t\t}\n\n\t\t\t\tif (items.length === 0) {\n\t\t\t\t\tif (skipEmpty) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (picksFilter.length > 0 && this.options?.noResultsPick) {\n\t\t\t\t\t\titems = [this.options.noResultsPick];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpicker.items = items;\n\t\t\t\tif (activeItem) {\n\t\t\t\t\tpicker.activeItems = [activeItem];\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// No Picks\n\t\t\tif (providedPicks === null) {\n\t\t\t\t// Ignore\n\t\t\t}\n\n\t\t\t// Fast and Slow Picks\n\t\t\telse if (isFastAndSlowPicks(providedPicks)) {\n\t\t\t\tlet fastPicksApplied = false;\n\t\t\t\tlet slowPicksApplied = false;\n\n\t\t\t\tawait Promise.all([\n\n\t\t\t\t\t// Fast Picks: to reduce amount of flicker, we race against\n\t\t\t\t\t// the slow picks over 500ms and then set the fast picks.\n\t\t\t\t\t// If the slow picks are faster, we reduce the flicker by\n\t\t\t\t\t// only setting the items once.\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\tawait timeout(PickerQuickAccessProvider.FAST_PICKS_RACE_DELAY);\n\t\t\t\t\t\tif (picksToken.isCancellationRequested) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!slowPicksApplied) {\n\t\t\t\t\t\t\tfastPicksApplied = applyPicks(providedPicks.picks, true /* skip over empty to reduce flicker */);\n\t\t\t\t\t\t}\n\t\t\t\t\t})(),\n\n\t\t\t\t\t// Slow Picks: we await the slow picks and then set them at\n\t\t\t\t\t// once together with the fast picks, but only if we actually\n\t\t\t\t\t// have additional results.\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\tpicker.busy = true;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst awaitedAdditionalPicks = await providedPicks.additionalPicks;\n\t\t\t\t\t\t\tif (picksToken.isCancellationRequested) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet picks: readonly Pick<T>[];\n\t\t\t\t\t\t\tlet activePick: Pick<T> | undefined = undefined;\n\t\t\t\t\t\t\tif (isPicksWithActive(providedPicks.picks)) {\n\t\t\t\t\t\t\t\tpicks = providedPicks.picks.items;\n\t\t\t\t\t\t\t\tactivePick = providedPicks.picks.active;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpicks = providedPicks.picks;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet additionalPicks: readonly Pick<T>[];\n\t\t\t\t\t\t\tlet additionalActivePick: Pick<T> | undefined = undefined;\n\t\t\t\t\t\t\tif (isPicksWithActive(awaitedAdditionalPicks)) {\n\t\t\t\t\t\t\t\tadditionalPicks = awaitedAdditionalPicks.items;\n\t\t\t\t\t\t\t\tadditionalActivePick = awaitedAdditionalPicks.active;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tadditionalPicks = awaitedAdditionalPicks;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (additionalPicks.length > 0 || !fastPicksApplied) {\n\t\t\t\t\t\t\t\t// If we do not have any activePick or additionalActivePick\n\t\t\t\t\t\t\t\t// we try to preserve the currently active pick from the\n\t\t\t\t\t\t\t\t// fast results. This fixes an issue where the user might\n\t\t\t\t\t\t\t\t// have made a pick active before the additional results\n\t\t\t\t\t\t\t\t// kick in.\n\t\t\t\t\t\t\t\t// See https://github.com/microsoft/vscode/issues/102480\n\t\t\t\t\t\t\t\tlet fallbackActivePick: Pick<T> | undefined = undefined;\n\t\t\t\t\t\t\t\tif (!activePick && !additionalActivePick) {\n\t\t\t\t\t\t\t\t\tconst fallbackActivePickCandidate = picker.activeItems[0];\n\t\t\t\t\t\t\t\t\tif (fallbackActivePickCandidate && picks.indexOf(fallbackActivePickCandidate) !== -1) {\n\t\t\t\t\t\t\t\t\t\tfallbackActivePick = fallbackActivePickCandidate;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tapplyPicks({\n\t\t\t\t\t\t\t\t\titems: [...picks, ...additionalPicks],\n\t\t\t\t\t\t\t\t\tactive: activePick || additionalActivePick || fallbackActivePick\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (!picksToken.isCancellationRequested) {\n\t\t\t\t\t\t\t\tpicker.busy = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tslowPicksApplied = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t})()\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// Fast Picks\n\t\t\telse if (!(providedPicks instanceof Promise)) {\n\t\t\t\tapplyPicks(providedPicks);\n\t\t\t}\n\n\t\t\t// Slow Picks\n\t\t\telse {\n\t\t\t\tpicker.busy = true;\n\t\t\t\ttry {\n\t\t\t\t\tconst awaitedPicks = await providedPicks;\n\t\t\t\t\tif (picksToken.isCancellationRequested) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tapplyPicks(awaitedPicks);\n\t\t\t\t} finally {\n\t\t\t\t\tif (!picksToken.isCancellationRequested) {\n\t\t\t\t\t\tpicker.busy = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerItems()));\n\t\tupdatePickerItems();\n\n\t\t// Accept the pick on accept and hide picker\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (typeof item?.accept === 'function') {\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide(); // hide picker unless we accept in background\n\t\t\t\t}\n\n\t\t\t\titem.accept(picker.keyMods, event);\n\t\t\t}\n\t\t}));\n\n\t\t// Trigger the pick with button index if button triggered\n\t\tdisposables.add(picker.onDidTriggerItemButton(async ({ button, item }) => {\n\t\t\tif (typeof item.trigger === 'function') {\n\t\t\t\tconst buttonIndex = item.buttons?.indexOf(button) ?? -1;\n\t\t\t\tif (buttonIndex >= 0) {\n\t\t\t\t\tconst result = item.trigger(buttonIndex, picker.keyMods);\n\t\t\t\t\tconst action = (typeof result === 'number') ? result : await result;\n\n\t\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (action) {\n\t\t\t\t\t\tcase TriggerAction.NO_ACTION:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TriggerAction.CLOSE_PICKER:\n\t\t\t\t\t\t\tpicker.hide();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TriggerAction.REFRESH_PICKER:\n\t\t\t\t\t\t\tupdatePickerItems();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TriggerAction.REMOVE_ITEM: {\n\t\t\t\t\t\t\tconst index = picker.items.indexOf(item);\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tconst items = picker.items.slice();\n\t\t\t\t\t\t\t\tconst removed = items.splice(index, 1);\n\t\t\t\t\t\t\t\tconst activeItems = picker.activeItems.filter(activeItem => activeItem !== removed[0]);\n\t\t\t\t\t\t\t\tconst keepScrollPositionBefore = picker.keepScrollPosition;\n\t\t\t\t\t\t\t\tpicker.keepScrollPosition = true;\n\t\t\t\t\t\t\t\tpicker.items = items;\n\t\t\t\t\t\t\t\tif (activeItems) {\n\t\t\t\t\t\t\t\t\tpicker.activeItems = activeItems;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpicker.keepScrollPosition = keepScrollPositionBefore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Returns an array of picks and separators as needed. If the picks are resolved\n\t * long running, the provided cancellation token should be used to cancel the\n\t * operation when the token signals this.\n\t *\n\t * The implementor is responsible for filtering and sorting the picks given the\n\t * provided `filter`.\n\t *\n\t * @param filter a filter to apply to the picks.\n\t * @param disposables can be used to register disposables that should be cleaned\n\t * up when the picker closes.\n\t * @param token for long running tasks, implementors need to check on cancellation\n\t * through this token.\n\t * @returns the picks either directly, as promise or combined fast and slow results.\n\t * Pickers can return `null` to signal that no change in picks is needed.\n\t */\n\tprotected abstract _getPicks(filter: string, disposables: DisposableStore, token: CancellationToken): Picks<T> | Promise<Picks<T>> | FastAndSlowPicks<T> | null;\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { IPickOptions, IQuickPick, IQuickPickItem, QuickPickInput } from 'vs/base/parts/quickinput/common/quickInput';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';\n\nexport * from 'vs/base/parts/quickinput/common/quickInput';\n\nexport const IQuickInputService = createDecorator<IQuickInputService>('quickInputService');\n\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n\nexport interface IQuickInputService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Provides access to the quick access providers.\n\t */\n\treadonly quickAccess: IQuickAccessController;\n\n\t/**\n\t * Opens the quick input box for selecting items and returns a promise\n\t * with the user selected item(s) if any.\n\t */\n\tpick<T extends IQuickPickItem>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options?: IPickOptions<T> & { canPickMany: true }, token?: CancellationToken): Promise<T[] | undefined>;\n\tpick<T extends IQuickPickItem>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options?: IPickOptions<T> & { canPickMany: false }, token?: CancellationToken): Promise<T | undefined>;\n\tpick<T extends IQuickPickItem>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options?: Omit<IPickOptions<T>, 'canPickMany'>, token?: CancellationToken): Promise<T | undefined>;\n\n\t/**\n\t * Provides raw access to the quick pick controller.\n\t */\n\tcreateQuickPick<T extends IQuickPickItem>(): IQuickPick<T>;\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 * as Assert from 'vs/base/common/assert';\nimport * as Types from 'vs/base/common/types';\n\nexport interface IRegistry {\n\n\t/**\n\t * Adds the extension functions and properties defined by data to the\n\t * platform. The provided id must be unique.\n\t * @param id a unique identifier\n\t * @param data a contribution\n\t */\n\tadd(id: string, data: any): void;\n\n\t/**\n\t * Returns the extension functions and properties defined by the specified key or null.\n\t * @param id an extension identifier\n\t */\n\tas<T>(id: string): T;\n}\n\nclass RegistryImpl implements IRegistry {\n\n\tprivate readonly data = new Map<string, any>();\n\n\tpublic add(id: string, data: any): void {\n\t\tAssert.ok(Types.isString(id));\n\t\tAssert.ok(Types.isObject(data));\n\t\tAssert.ok(!this.data.has(id), 'There is already an extension with this id');\n\n\t\tthis.data.set(id, data);\n\t}\n\n\tpublic as(id: string): any {\n\t\treturn this.data.get(id) || null;\n\t}\n}\n\nexport const Registry: IRegistry = new RegistryImpl();\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 } from 'vs/base/common/event';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport * as platform from 'vs/platform/registry/common/platform';\n\nexport const Extensions = {\n\tJSONContribution: 'base.contributions.json'\n};\n\nexport interface IJSONContributionRegistry {\n\n\t/**\n\t * Register a schema to the registry.\n\t */\n\tregisterSchema(uri: string, unresolvedSchemaContent: IJSONSchema): void;\n\n\n\t/**\n\t * Notifies all listeners that the content of the given schema has changed.\n\t * @param uri The id of the schema\n\t */\n\tnotifySchemaChanged(uri: string): void;\n}\n\n\n\nfunction normalizeId(id: string) {\n\tif (id.length > 0 && id.charAt(id.length - 1) === '#') {\n\t\treturn id.substring(0, id.length - 1);\n\t}\n\treturn id;\n}\n\n\n\nclass JSONContributionRegistry implements IJSONContributionRegistry {\n\n\tprivate schemasById: { [id: string]: IJSONSchema };\n\n\tprivate readonly _onDidChangeSchema = new Emitter<string>();\n\n\tconstructor() {\n\t\tthis.schemasById = {};\n\t}\n\n\tpublic registerSchema(uri: string, unresolvedSchemaContent: IJSONSchema): void {\n\t\tthis.schemasById[normalizeId(uri)] = unresolvedSchemaContent;\n\t\tthis._onDidChangeSchema.fire(uri);\n\t}\n\n\tpublic notifySchemaChanged(uri: string): void {\n\t\tthis._onDidChangeSchema.fire(uri);\n\t}\n\n}\n\nconst jsonContributionRegistry = new JSONContributionRegistry();\nplatform.Registry.add(Extensions.JSONContribution, jsonContributionRegistry);\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 { distinct } from 'vs/base/common/arrays';\nimport { IStringDictionary } from 'vs/base/common/collections';\nimport { Emitter } from 'vs/base/common/event';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport * as types from 'vs/base/common/types';\nimport * as nls from 'vs/nls';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport const Extensions = {\n\tConfiguration: 'base.contributions.configuration'\n};\n\nexport interface IConfigurationRegistry {\n\n\t/**\n\t * Register a configuration to the registry.\n\t */\n\tregisterConfiguration(configuration: IConfigurationNode): void;\n\n\t/**\n\t * Register multiple default configurations to the registry.\n\t */\n\tregisterDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[]): void;\n\n\t/**\n\t * Returns all configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\n\t/**\n\t * Register the identifiers for editor configurations\n\t */\n\tregisterOverrideIdentifiers(identifiers: string[]): void;\n}\n\nexport const enum ConfigurationScope {\n\t/**\n\t * Application specific configuration, which can be configured only in local user settings.\n\t */\n\tAPPLICATION = 1,\n\t/**\n\t * Machine specific configuration, which can be configured only in local and remote user settings.\n\t */\n\tMACHINE,\n\t/**\n\t * Window specific configuration, which can be configured in the user or workspace settings.\n\t */\n\tWINDOW,\n\t/**\n\t * Resource specific configuration, which can be configured in the user, workspace or folder settings.\n\t */\n\tRESOURCE,\n\t/**\n\t * Resource specific configuration that can be configured in language specific settings\n\t */\n\tLANGUAGE_OVERRIDABLE,\n\t/**\n\t * Machine specific configuration that can also be configured in workspace or folder settings.\n\t */\n\tMACHINE_OVERRIDABLE,\n}\n\nexport interface IConfigurationPropertySchema extends IJSONSchema {\n\n\tscope?: ConfigurationScope;\n\n\t/**\n\t * When restricted, value of this configuration will be read only from trusted sources.\n\t * For eg., If the workspace is not trusted, then the value of this configuration is not read from workspace settings file.\n\t */\n\trestricted?: boolean;\n\n\t/**\n\t * When `false` this property is excluded from the registry. Default is to include.\n\t */\n\tincluded?: boolean;\n}\n\nexport interface IExtensionInfo {\n}\n\nexport interface IConfigurationNode {\n\tid?: string;\n\torder?: number;\n\ttype?: string | string[];\n\ttitle?: string;\n\tproperties?: IStringDictionary<IConfigurationPropertySchema>;\n\tallOf?: IConfigurationNode[];\n\tscope?: ConfigurationScope;\n\textensionInfo?: IExtensionInfo;\n\trestrictedProperties?: string[];\n}\n\nexport interface IConfigurationDefaults {\n\toverrides: IStringDictionary<any>;\n\tsource?: IExtensionInfo | string;\n}\n\nexport type IRegisteredConfigurationPropertySchema = IConfigurationPropertySchema & {\n\tdefaultDefaultValue?: any;\n\tsource?: IExtensionInfo;\n\tdefaultValueSource?: IExtensionInfo | string;\n};\n\nexport type IConfigurationDefaultOverride = { value: any; source?: IExtensionInfo | string };\n\nexport const allSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const applicationSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineOverridableSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const windowSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const resourceSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\n\nexport const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';\n\nconst contributionRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\n\nclass ConfigurationRegistry implements IConfigurationRegistry {\n\n\tprivate readonly configurationDefaultsOverrides: Map<string, IConfigurationDefaultOverride>;\n\tprivate readonly defaultLanguageConfigurationOverridesNode: IConfigurationNode;\n\tprivate readonly configurationContributors: IConfigurationNode[];\n\tprivate readonly configurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly excludedConfigurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly resourceLanguageSettingsSchema: IJSONSchema;\n\tprivate readonly overrideIdentifiers = new Set<string>();\n\n\tprivate readonly _onDidSchemaChange = new Emitter<void>();\n\n\tprivate readonly _onDidUpdateConfiguration = new Emitter<{ properties: string[]; defaultsOverrides?: boolean }>();\n\n\tconstructor() {\n\t\tthis.configurationDefaultsOverrides = new Map<string, IConfigurationDefaultOverride>();\n\t\tthis.defaultLanguageConfigurationOverridesNode = {\n\t\t\tid: 'defaultOverrides',\n\t\t\ttitle: nls.localize('defaultLanguageConfigurationOverrides.title', \"Default Language Configuration Overrides\"),\n\t\t\tproperties: {}\n\t\t};\n\t\tthis.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];\n\t\tthis.resourceLanguageSettingsSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowTrailingCommas: true, allowComments: true };\n\t\tthis.configurationProperties = {};\n\t\tthis.excludedConfigurationProperties = {};\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis.registerOverridePropertyPatternKey();\n\t}\n\n\tpublic registerConfiguration(configuration: IConfigurationNode, validate: boolean = true): void {\n\t\tthis.registerConfigurations([configuration], validate);\n\t}\n\n\tpublic registerConfigurations(configurations: IConfigurationNode[], validate: boolean = true): void {\n\t\tconst properties = this.doRegisterConfigurations(configurations, validate);\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties });\n\t}\n\n\tpublic registerDefaultConfigurations(configurationDefaults: IConfigurationDefaults[]): void {\n\t\tconst properties: string[] = [];\n\t\tconst overrideIdentifiers: string[] = [];\n\n\t\tfor (const { overrides, source } of configurationDefaults) {\n\t\t\tfor (const key in overrides) {\n\t\t\t\tproperties.push(key);\n\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tconst defaultValue = { ...(this.configurationDefaultsOverrides.get(key)?.value || {}), ...overrides[key] };\n\t\t\t\t\tthis.configurationDefaultsOverrides.set(key, { source, value: defaultValue });\n\t\t\t\t\tconst property: IRegisteredConfigurationPropertySchema = {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tdefault: defaultValue,\n\t\t\t\t\t\tdescription: nls.localize('defaultLanguageConfiguration.description', \"Configure settings to be overridden for {0} language.\", key),\n\t\t\t\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\t\t\t\tdefaultDefaultValue: defaultValue,\n\t\t\t\t\t\tsource: types.isString(source) ? undefined : source,\n\t\t\t\t\t};\n\t\t\t\t\toverrideIdentifiers.push(...overrideIdentifiersFromKey(key));\n\t\t\t\t\tthis.configurationProperties[key] = property;\n\t\t\t\t\tthis.defaultLanguageConfigurationOverridesNode.properties![key] = property;\n\t\t\t\t} else {\n\t\t\t\t\tthis.configurationDefaultsOverrides.set(key, { value: overrides[key], source });\n\t\t\t\t\tconst property = this.configurationProperties[key];\n\t\t\t\t\tif (property) {\n\t\t\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\t\t\t\t\t\tthis.updateSchema(key, property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.registerOverrideIdentifiers(overrideIdentifiers);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });\n\t}\n\n\tpublic registerOverrideIdentifiers(overrideIdentifiers: string[]): void {\n\t\tfor (const overrideIdentifier of overrideIdentifiers) {\n\t\t\tthis.overrideIdentifiers.add(overrideIdentifier);\n\t\t}\n\t\tthis.updateOverridePropertyPatternKey();\n\t}\n\n\tprivate doRegisterConfigurations(configurations: IConfigurationNode[], validate: boolean): string[] {\n\t\tconst properties: string[] = [];\n\t\tconfigurations.forEach(configuration => {\n\t\t\tproperties.push(...this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties)); // fills in defaults\n\t\t\tthis.configurationContributors.push(configuration);\n\t\t\tthis.registerJSONConfiguration(configuration);\n\t\t});\n\t\treturn properties;\n\t}\n\n\tprivate validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, extensionInfo: IExtensionInfo | undefined, restrictedProperties: string[] | undefined, scope: ConfigurationScope = ConfigurationScope.WINDOW): string[] {\n\t\tscope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;\n\t\tlet propertyKeys: string[] = [];\n\t\tlet properties = configuration.properties;\n\t\tif (properties) {\n\t\t\tfor (let key in properties) {\n\t\t\t\tif (validate && validateProperty(key)) {\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst property: IRegisteredConfigurationPropertySchema = properties[key];\n\t\t\t\tproperty.source = extensionInfo;\n\n\t\t\t\t// update default value\n\t\t\t\tproperty.defaultDefaultValue = properties[key].default;\n\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\n\t\t\t\t// update scope\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tproperty.scope = undefined; // No scope for overridable properties `[${identifier}]`\n\t\t\t\t} else {\n\t\t\t\t\tproperty.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope;\n\t\t\t\t\tproperty.restricted = types.isUndefinedOrNull(property.restricted) ? !!restrictedProperties?.includes(key) : property.restricted;\n\t\t\t\t}\n\n\t\t\t\t// Add to properties maps\n\t\t\t\t// Property is included by default if 'included' is unspecified\n\t\t\t\tif (properties[key].hasOwnProperty('included') && !properties[key].included) {\n\t\t\t\t\tthis.excludedConfigurationProperties[key] = properties[key];\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tthis.configurationProperties[key] = properties[key];\n\t\t\t\t}\n\n\t\t\t\tif (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) {\n\t\t\t\t\t// If not set, default deprecationMessage to the markdown source\n\t\t\t\t\tproperties[key].deprecationMessage = properties[key].markdownDeprecationMessage;\n\t\t\t\t}\n\n\t\t\t\tpropertyKeys.push(key);\n\t\t\t}\n\t\t}\n\t\tlet subNodes = configuration.allOf;\n\t\tif (subNodes) {\n\t\t\tfor (let node of subNodes) {\n\t\t\t\tpropertyKeys.push(...this.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope));\n\t\t\t}\n\t\t}\n\t\treturn propertyKeys;\n\t}\n\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema> {\n\t\treturn this.configurationProperties;\n\t}\n\n\tprivate registerJSONConfiguration(configuration: IConfigurationNode) {\n\t\tconst register = (configuration: IConfigurationNode) => {\n\t\t\tlet properties = configuration.properties;\n\t\t\tif (properties) {\n\t\t\t\tfor (const key in properties) {\n\t\t\t\t\tthis.updateSchema(key, properties[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet subNodes = configuration.allOf;\n\t\t\tif (subNodes) {\n\t\t\t\tsubNodes.forEach(register);\n\t\t\t}\n\t\t};\n\t\tregister(configuration);\n\t}\n\n\tprivate updateSchema(key: string, property: IConfigurationPropertySchema): void {\n\t\tallSettings.properties[key] = property;\n\t\tswitch (property.scope) {\n\t\t\tcase ConfigurationScope.APPLICATION:\n\t\t\t\tapplicationSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE:\n\t\t\t\tmachineSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE_OVERRIDABLE:\n\t\t\t\tmachineOverridableSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.WINDOW:\n\t\t\t\twindowSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.RESOURCE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.LANGUAGE_OVERRIDABLE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tthis.resourceLanguageSettingsSchema.properties![key] = property;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate updateOverridePropertyPatternKey(): void {\n\t\tfor (const overrideIdentifier of this.overrideIdentifiers.values()) {\n\t\t\tconst overrideIdentifierProperty = `[${overrideIdentifier}]`;\n\t\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\t};\n\t\t\tthis.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);\n\t\t\tallSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tapplicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\twindowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tresourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t}\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate registerOverridePropertyPatternKey(): void {\n\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\ttype: 'object',\n\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t};\n\t\tallSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tapplicationSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineOverridableSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\twindowSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tresourceSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate updatePropertyDefaultValue(key: string, property: IRegisteredConfigurationPropertySchema): void {\n\t\tconst configurationdefaultOverride = this.configurationDefaultsOverrides.get(key);\n\t\tlet defaultValue = configurationdefaultOverride?.value;\n\t\tlet defaultSource = configurationdefaultOverride?.source;\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = property.defaultDefaultValue;\n\t\t\tdefaultSource = undefined;\n\t\t}\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = getDefaultValue(property.type);\n\t\t}\n\t\tproperty.default = defaultValue;\n\t\tproperty.defaultValueSource = defaultSource;\n\t}\n}\n\nconst OVERRIDE_IDENTIFIER_PATTERN = `\\\\[([^\\\\]]+)\\\\]`;\nconst OVERRIDE_IDENTIFIER_REGEX = new RegExp(OVERRIDE_IDENTIFIER_PATTERN, 'g');\nexport const OVERRIDE_PROPERTY_PATTERN = `^(${OVERRIDE_IDENTIFIER_PATTERN})+$`;\nexport const OVERRIDE_PROPERTY_REGEX = new RegExp(OVERRIDE_PROPERTY_PATTERN);\n\nexport function overrideIdentifiersFromKey(key: string): string[] {\n\tconst identifiers: string[] = [];\n\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\tlet matches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\twhile (matches?.length) {\n\t\t\tconst identifier = matches[1].trim();\n\t\t\tif (identifier) {\n\t\t\t\tidentifiers.push(identifier);\n\t\t\t}\n\t\t\tmatches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\t}\n\t}\n\treturn distinct(identifiers);\n}\n\nexport function getDefaultValue(type: string | string[] | undefined): any {\n\tconst t = Array.isArray(type) ? (<string[]>type)[0] : <string>type;\n\tswitch (t) {\n\t\tcase 'boolean':\n\t\t\treturn false;\n\t\tcase 'integer':\n\t\tcase 'number':\n\t\t\treturn 0;\n\t\tcase 'string':\n\t\t\treturn '';\n\t\tcase 'array':\n\t\t\treturn [];\n\t\tcase 'object':\n\t\t\treturn {};\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nconst configurationRegistry = new ConfigurationRegistry();\nRegistry.add(Extensions.Configuration, configurationRegistry);\n\nexport function validateProperty(property: string): string | null {\n\tif (!property.trim()) {\n\t\treturn nls.localize('config.property.empty', \"Cannot register an empty property\");\n\t}\n\tif (OVERRIDE_PROPERTY_REGEX.test(property)) {\n\t\treturn nls.localize('config.property.languageDefault', \"Cannot register '{0}'. This matches property pattern '\\\\\\\\[.*\\\\\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.\", property);\n\t}\n\tif (configurationRegistry.getConfigurationProperties()[property] !== undefined) {\n\t\treturn nls.localize('config.property.duplicate', \"Cannot register '{0}'. This property is already registered.\", property);\n\t}\n\treturn null;\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 { editorOptionsRegistry } from 'vs/editor/common/config/editorOptions';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';\nimport * as nls from 'vs/nls';\nimport { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationPropertySchema, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport const editorConfigurationBaseNode = Object.freeze<IConfigurationNode>({\n\tid: 'editor',\n\torder: 5,\n\ttype: 'object',\n\ttitle: nls.localize('editorConfigurationTitle', \"Editor\"),\n\tscope: ConfigurationScope.LANGUAGE_OVERRIDABLE,\n});\n\nconst editorConfiguration: IConfigurationNode = {\n\t...editorConfigurationBaseNode,\n\tproperties: {\n\t\t'editor.tabSize': {\n\t\t\ttype: 'number',\n\t\t\tdefault: EDITOR_MODEL_DEFAULTS.tabSize,\n\t\t\tminimum: 1,\n\t\t\tmarkdownDescription: nls.localize('tabSize', \"The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.\")\n\t\t},\n\t\t// 'editor.indentSize': {\n\t\t// \t'anyOf': [\n\t\t// \t\t{\n\t\t// \t\t\ttype: 'string',\n\t\t// \t\t\tenum: ['tabSize']\n\t\t// \t\t},\n\t\t// \t\t{\n\t\t// \t\t\ttype: 'number',\n\t\t// \t\t\tminimum: 1\n\t\t// \t\t}\n\t\t// \t],\n\t\t// \tdefault: 'tabSize',\n\t\t// \tmarkdownDescription: nls.localize('indentSize', \"The number of spaces used for indentation or 'tabSize' to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.\")\n\t\t// },\n\t\t'editor.insertSpaces': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: EDITOR_MODEL_DEFAULTS.insertSpaces,\n\t\t\tmarkdownDescription: nls.localize('insertSpaces', \"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.\")\n\t\t},\n\t\t'editor.detectIndentation': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: EDITOR_MODEL_DEFAULTS.detectIndentation,\n\t\t\tmarkdownDescription: nls.localize('detectIndentation', \"Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.\")\n\t\t},\n\t\t'editor.trimAutoWhitespace': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,\n\t\t\tdescription: nls.localize('trimAutoWhitespace', \"Remove trailing auto inserted whitespace.\")\n\t\t},\n\t\t'editor.largeFileOptimizations': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: EDITOR_MODEL_DEFAULTS.largeFileOptimizations,\n\t\t\tdescription: nls.localize('largeFileOptimizations', \"Special handling for large files to disable certain memory intensive features.\")\n\t\t},\n\t\t'editor.wordBasedSuggestions': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('wordBasedSuggestions', \"Controls whether completions should be computed based on words in the document.\")\n\t\t},\n\t\t'editor.wordBasedSuggestionsMode': {\n\t\t\tenum: ['currentDocument', 'matchingDocuments', 'allDocuments'],\n\t\t\tdefault: 'matchingDocuments',\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('wordBasedSuggestionsMode.currentDocument', 'Only suggest words from the active document.'),\n\t\t\t\tnls.localize('wordBasedSuggestionsMode.matchingDocuments', 'Suggest words from all open documents of the same language.'),\n\t\t\t\tnls.localize('wordBasedSuggestionsMode.allDocuments', 'Suggest words from all open documents.')\n\t\t\t],\n\t\t\tdescription: nls.localize('wordBasedSuggestionsMode', \"Controls from which documents word based completions are computed.\")\n\t\t},\n\t\t'editor.semanticHighlighting.enabled': {\n\t\t\tenum: [true, false, 'configuredByTheme'],\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('semanticHighlighting.true', 'Semantic highlighting enabled for all color themes.'),\n\t\t\t\tnls.localize('semanticHighlighting.false', 'Semantic highlighting disabled for all color themes.'),\n\t\t\t\tnls.localize('semanticHighlighting.configuredByTheme', 'Semantic highlighting is configured by the current color theme\\'s `semanticHighlighting` setting.')\n\t\t\t],\n\t\t\tdefault: 'configuredByTheme',\n\t\t\tdescription: nls.localize('semanticHighlighting.enabled', \"Controls whether the semanticHighlighting is shown for the languages that support it.\")\n\t\t},\n\t\t'editor.stablePeek': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tmarkdownDescription: nls.localize('stablePeek', \"Keep peek editors open even when double clicking their content or when hitting `Escape`.\")\n\t\t},\n\t\t'editor.maxTokenizationLineLength': {\n\t\t\ttype: 'integer',\n\t\t\tdefault: 20_000,\n\t\t\tdescription: nls.localize('maxTokenizationLineLength', \"Lines above this length will not be tokenized for performance reasons\")\n\t\t},\n\t\t'editor.language.brackets': {\n\t\t\ttype: 'array',\n\t\t\tdefault: false, // We want to distinguish the empty array from not configured.\n\t\t\tdescription: nls.localize('schema.brackets', 'Defines the bracket symbols that increase or decrease the indentation.'),\n\t\t\titems: {\n\t\t\t\ttype: 'array',\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: nls.localize('schema.openBracket', 'The opening bracket character or string sequence.')\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: nls.localize('schema.closeBracket', 'The closing bracket character or string sequence.')\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t'editor.language.colorizedBracketPairs': {\n\t\t\ttype: 'array',\n\t\t\tdefault: false, // We want to distinguish the empty array from not configured.\n\t\t\tdescription: nls.localize('schema.colorizedBracketPairs', 'Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled.'),\n\t\t\titems: {\n\t\t\t\ttype: 'array',\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: nls.localize('schema.openBracket', 'The opening bracket character or string sequence.')\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: nls.localize('schema.closeBracket', 'The closing bracket character or string sequence.')\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t'diffEditor.maxComputationTime': {\n\t\t\ttype: 'number',\n\t\t\tdefault: 5000,\n\t\t\tdescription: nls.localize('maxComputationTime', \"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.\")\n\t\t},\n\t\t'diffEditor.maxFileSize': {\n\t\t\ttype: 'number',\n\t\t\tdefault: 50,\n\t\t\tdescription: nls.localize('maxFileSize', \"Maximum file size in MB for which to compute diffs. Use 0 for no limit.\")\n\t\t},\n\t\t'diffEditor.renderSideBySide': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('sideBySide', \"Controls whether the diff editor shows the diff side by side or inline.\")\n\t\t},\n\t\t'diffEditor.ignoreTrimWhitespace': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('ignoreTrimWhitespace', \"When enabled, the diff editor ignores changes in leading or trailing whitespace.\")\n\t\t},\n\t\t'diffEditor.renderIndicators': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('renderIndicators', \"Controls whether the diff editor shows +/- indicators for added/removed changes.\")\n\t\t},\n\t\t'diffEditor.codeLens': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: nls.localize('codeLens', \"Controls whether the editor shows CodeLens.\")\n\t\t},\n\t\t'diffEditor.wordWrap': {\n\t\t\ttype: 'string',\n\t\t\tenum: ['off', 'on', 'inherit'],\n\t\t\tdefault: 'inherit',\n\t\t\tmarkdownEnumDescriptions: [\n\t\t\t\tnls.localize('wordWrap.off', \"Lines will never wrap.\"),\n\t\t\t\tnls.localize('wordWrap.on', \"Lines will wrap at the viewport width.\"),\n\t\t\t\tnls.localize('wordWrap.inherit', \"Lines will wrap according to the `#editor.wordWrap#` setting.\"),\n\t\t\t]\n\t\t}\n\t}\n};\n\nfunction isConfigurationPropertySchema(x: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema }): x is IConfigurationPropertySchema {\n\treturn (typeof x.type !== 'undefined' || typeof x.anyOf !== 'undefined');\n}\n\n// Add properties from the Editor Option Registry\nfor (const editorOption of editorOptionsRegistry) {\n\tconst schema = editorOption.schema;\n\tif (typeof schema !== 'undefined') {\n\t\tif (isConfigurationPropertySchema(schema)) {\n\t\t\t// This is a single schema contribution\n\t\t\teditorConfiguration.properties![`editor.${editorOption.name}`] = schema;\n\t\t} else {\n\t\t\tfor (const key in schema) {\n\t\t\t\tif (Object.hasOwnProperty.call(schema, key)) {\n\t\t\t\t\teditorConfiguration.properties![key] = schema[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nlet cachedEditorConfigurationKeys: { [key: string]: boolean } | null = null;\nfunction getEditorConfigurationKeys(): { [key: string]: boolean } {\n\tif (cachedEditorConfigurationKeys === null) {\n\t\tcachedEditorConfigurationKeys = <{ [key: string]: boolean }>Object.create(null);\n\t\tObject.keys(editorConfiguration.properties!).forEach((prop) => {\n\t\t\tcachedEditorConfigurationKeys![prop] = true;\n\t\t});\n\t}\n\treturn cachedEditorConfigurationKeys;\n}\n\nexport function isEditorConfigurationKey(key: string): boolean {\n\tconst editorConfigurationKeys = getEditorConfigurationKeys();\n\treturn (editorConfigurationKeys[`editor.${key}`] || false);\n}\n\nexport function isDiffEditorConfigurationKey(key: string): boolean {\n\tconst editorConfigurationKeys = getEditorConfigurationKeys();\n\treturn (editorConfigurationKeys[`diffEditor.${key}`] || false);\n}\n\nconst configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);\nconfigurationRegistry.registerConfiguration(editorConfiguration);\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 * as nls from 'vs/nls';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { ILanguageExtensionPoint } from 'vs/editor/common/languages/language';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Mimes } from 'vs/base/common/mime';\nimport { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';\n\n// Define extension point ids\nexport const Extensions = {\n\tModesRegistry: 'editor.modesRegistry'\n};\n\nexport class EditorModesRegistry {\n\n\tprivate readonly _languages: ILanguageExtensionPoint[];\n\n\tprivate readonly _onDidChangeLanguages = new Emitter<void>();\n\tpublic readonly onDidChangeLanguages: Event<void> = this._onDidChangeLanguages.event;\n\n\tconstructor() {\n\t\tthis._languages = [];\n\t}\n\n\tpublic registerLanguage(def: ILanguageExtensionPoint): IDisposable {\n\t\tthis._languages.push(def);\n\t\tthis._onDidChangeLanguages.fire(undefined);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0, len = this._languages.length; i < len; i++) {\n\t\t\t\t\tif (this._languages[i] === def) {\n\t\t\t\t\t\tthis._languages.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic getLanguages(): ReadonlyArray<ILanguageExtensionPoint> {\n\t\treturn this._languages;\n\t}\n}\n\nexport const ModesRegistry = new EditorModesRegistry();\nRegistry.add(Extensions.ModesRegistry, ModesRegistry);\n\nexport const PLAINTEXT_LANGUAGE_ID = 'plaintext';\nexport const PLAINTEXT_EXTENSION = '.txt';\n\nModesRegistry.registerLanguage({\n\tid: PLAINTEXT_LANGUAGE_ID,\n\textensions: [PLAINTEXT_EXTENSION],\n\taliases: [nls.localize('plainText.alias', \"Plain Text\"), 'text'],\n\tmimetypes: [Mimes.text]\n});\n\nLanguageConfigurationRegistry.register(PLAINTEXT_LANGUAGE_ID, {\n\tbrackets: [\n\t\t['(', ')'],\n\t\t['[', ']'],\n\t\t['{', '}'],\n\t],\n\tsurroundingPairs: [\n\t\t{ open: '{', close: '}' },\n\t\t{ open: '[', close: ']' },\n\t\t{ open: '(', close: ')' },\n\t\t{ open: '<', close: '>' },\n\t\t{ open: '\\\"', close: '\\\"' },\n\t\t{ open: '\\'', close: '\\'' },\n\t\t{ open: '`', close: '`' },\n\t],\n\tcolorizedBracketPairs: [],\n\tfolding: {\n\t\toffSide: true\n\t}\n}, 0);\n\nRegistry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)\n\t.registerDefaultConfigurations([{\n\t\toverrides: {\n\t\t\t'[plaintext]': {\n\t\t\t\t'editor.unicodeHighlight.ambiguousCharacters': false,\n\t\t\t\t'editor.unicodeHighlight.invisibleCharacters': false\n\t\t\t}\n\t\t}\n\t}]);\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 { Schemas } from 'vs/base/common/network';\nimport { DataUri } from 'vs/base/common/resources';\nimport { URI as uri } from 'vs/base/common/uri';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { FileKind } from 'vs/platform/files/common/files';\n\nconst fileIconDirectoryRegex = /(?:\\/|^)(?:([^\\/]+)\\/)?([^\\/]+)$/;\n\nexport function getIconClasses(modelService: IModelService, languageService: ILanguageService, resource: uri | undefined, fileKind?: FileKind): string[] {\n\n\t// we always set these base classes even if we do not have a path\n\tconst classes = fileKind === FileKind.ROOT_FOLDER ? ['rootfolder-icon'] : fileKind === FileKind.FOLDER ? ['folder-icon'] : ['file-icon'];\n\tif (resource) {\n\n\t\t// Get the path and name of the resource. For data-URIs, we need to parse specially\n\t\tlet name: string | undefined;\n\t\tif (resource.scheme === Schemas.data) {\n\t\t\tconst metadata = DataUri.parseMetaData(resource);\n\t\t\tname = metadata.get(DataUri.META_DATA_LABEL);\n\t\t} else {\n\t\t\tconst match = resource.path.match(fileIconDirectoryRegex);\n\t\t\tif (match) {\n\t\t\t\tname = cssEscape(match[2].toLowerCase());\n\t\t\t\tif (match[1]) {\n\t\t\t\t\tclasses.push(`${cssEscape(match[1].toLowerCase())}-name-dir-icon`); // parent directory\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tname = cssEscape(resource.authority.toLowerCase());\n\t\t\t}\n\t\t}\n\n\t\t// Folders\n\t\tif (fileKind === FileKind.FOLDER) {\n\t\t\tclasses.push(`${name}-name-folder-icon`);\n\t\t}\n\n\t\t// Files\n\t\telse {\n\n\t\t\t// Name & Extension(s)\n\t\t\tif (name) {\n\t\t\t\tclasses.push(`${name}-name-file-icon`);\n\t\t\t\tclasses.push(`name-file-icon`); // extra segment to increase file-name score\n\t\t\t\t// Avoid doing an explosive combination of extensions for very long filenames\n\t\t\t\t// (most file systems do not allow files > 255 length) with lots of `.` characters\n\t\t\t\t// https://github.com/microsoft/vscode/issues/116199\n\t\t\t\tif (name.length <= 255) {\n\t\t\t\t\tconst dotSegments = name.split('.');\n\t\t\t\t\tfor (let i = 1; i < dotSegments.length; i++) {\n\t\t\t\t\t\tclasses.push(`${dotSegments.slice(i).join('.')}-ext-file-icon`); // add each combination of all found extensions if more than one\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclasses.push(`ext-file-icon`); // extra segment to increase file-ext score\n\t\t\t}\n\n\t\t\t// Detected Mode\n\t\t\tconst detectedLanguageId = detectLanguageId(modelService, languageService, resource);\n\t\t\tif (detectedLanguageId) {\n\t\t\t\tclasses.push(`${cssEscape(detectedLanguageId)}-lang-file-icon`);\n\t\t\t}\n\t\t}\n\t}\n\treturn classes;\n}\n\nfunction detectLanguageId(modelService: IModelService, languageService: ILanguageService, resource: uri): string | null {\n\tif (!resource) {\n\t\treturn null; // we need a resource at least\n\t}\n\n\tlet languageId: string | null = null;\n\n\t// Data URI: check for encoded metadata\n\tif (resource.scheme === Schemas.data) {\n\t\tconst metadata = DataUri.parseMetaData(resource);\n\t\tconst mime = metadata.get(DataUri.META_DATA_MIME);\n\n\t\tif (mime) {\n\t\t\tlanguageId = languageService.getLanguageIdByMimeType(mime);\n\t\t}\n\t}\n\n\t// Any other URI: check for model if existing\n\telse {\n\t\tconst model = modelService.getModel(resource);\n\t\tif (model) {\n\t\t\tlanguageId = model.getLanguageId();\n\t\t}\n\t}\n\n\t// only take if the language id is specific (aka no just plain text)\n\tif (languageId && languageId !== PLAINTEXT_LANGUAGE_ID) {\n\t\treturn languageId;\n\t}\n\n\t// otherwise fallback to path based detection\n\treturn languageService.guessLanguageIdByFilepathOrFirstLine(resource);\n}\n\nexport function cssEscape(str: string): string {\n\treturn str.replace(/[\\11\\12\\14\\15\\40]/g, '/'); // HTML class names can not contain certain whitespace characters, use / instead, which doesn't exist in file names.\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 { coalesce } from 'vs/base/common/arrays';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { regExpLeadsToEndlessLoop } from 'vs/base/common/strings';\nimport { clearPlatformLanguageAssociations, getMimeTypes, registerPlatformLanguageAssociation } from 'vs/editor/common/services/languagesAssociations';\nimport { URI } from 'vs/base/common/uri';\nimport { ILanguageIdCodec, LanguageId } from 'vs/editor/common/languages';\nimport { ModesRegistry, PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageExtensionPoint, ILanguageIcon } from 'vs/editor/common/languages/language';\nimport { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst NULL_LANGUAGE_ID = 'vs.editor.nullLanguage';\n\nLanguageConfigurationRegistry.register(NULL_LANGUAGE_ID, {});\n\nexport interface IResolvedLanguage {\n\tidentifier: string;\n\tname: string | null;\n\tmimetypes: string[];\n\taliases: string[];\n\textensions: string[];\n\tfilenames: string[];\n\tconfigurationFiles: URI[];\n\ticons: ILanguageIcon[];\n}\n\nexport class LanguageIdCodec implements ILanguageIdCodec {\n\n\tprivate _nextLanguageId: number;\n\tprivate readonly _languageIdToLanguage: string[] = [];\n\tprivate readonly _languageToLanguageId = new Map<string, number>();\n\n\tconstructor() {\n\t\tthis._register(NULL_LANGUAGE_ID, LanguageId.Null);\n\t\tthis._register(PLAINTEXT_LANGUAGE_ID, LanguageId.PlainText);\n\t\tthis._nextLanguageId = 2;\n\t}\n\n\tprivate _register(language: string, languageId: LanguageId): void {\n\t\tthis._languageIdToLanguage[languageId] = language;\n\t\tthis._languageToLanguageId.set(language, languageId);\n\t}\n\n\tpublic register(language: string): void {\n\t\tif (this._languageToLanguageId.has(language)) {\n\t\t\treturn;\n\t\t}\n\t\tconst languageId = this._nextLanguageId++;\n\t\tthis._register(language, languageId);\n\t}\n\n\tpublic encodeLanguageId(languageId: string): LanguageId {\n\t\treturn this._languageToLanguageId.get(languageId) || LanguageId.Null;\n\t}\n\n\tpublic decodeLanguageId(languageId: LanguageId): string {\n\t\treturn this._languageIdToLanguage[languageId] || NULL_LANGUAGE_ID;\n\t}\n}\n\nexport class LanguagesRegistry extends Disposable {\n\n\tstatic instanceCount = 0;\n\n\tprivate readonly _onDidChange: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate readonly _warnOnOverwrite: boolean;\n\tpublic readonly languageIdCodec: LanguageIdCodec;\n\tprivate _dynamicLanguages: ILanguageExtensionPoint[];\n\tprivate _languages: { [id: string]: IResolvedLanguage };\n\tprivate _mimeTypesMap: { [mimeType: string]: string };\n\tprivate _nameMap: { [name: string]: string };\n\tprivate _lowercaseNameMap: { [name: string]: string };\n\n\tconstructor(useModesRegistry = true, warnOnOverwrite = false) {\n\t\tsuper();\n\t\tLanguagesRegistry.instanceCount++;\n\n\t\tthis._warnOnOverwrite = warnOnOverwrite;\n\t\tthis.languageIdCodec = new LanguageIdCodec();\n\t\tthis._dynamicLanguages = [];\n\t\tthis._languages = {};\n\t\tthis._mimeTypesMap = {};\n\t\tthis._nameMap = {};\n\t\tthis._lowercaseNameMap = {};\n\n\t\tif (useModesRegistry) {\n\t\t\tthis._initializeFromRegistry();\n\t\t\tthis._register(ModesRegistry.onDidChangeLanguages((m) => {\n\t\t\t\tthis._initializeFromRegistry();\n\t\t\t}));\n\t\t}\n\t}\n\n\toverride dispose() {\n\t\tLanguagesRegistry.instanceCount--;\n\t\tsuper.dispose();\n\t}\n\n\tprivate _initializeFromRegistry(): void {\n\t\tthis._languages = {};\n\t\tthis._mimeTypesMap = {};\n\t\tthis._nameMap = {};\n\t\tthis._lowercaseNameMap = {};\n\n\t\tclearPlatformLanguageAssociations();\n\t\tconst desc = (<ILanguageExtensionPoint[]>[]).concat(ModesRegistry.getLanguages()).concat(this._dynamicLanguages);\n\t\tthis._registerLanguages(desc);\n\t}\n\n\t_registerLanguages(desc: ILanguageExtensionPoint[]): void {\n\n\t\tfor (const d of desc) {\n\t\t\tthis._registerLanguage(d);\n\t\t}\n\n\t\t// Rebuild fast path maps\n\t\tthis._mimeTypesMap = {};\n\t\tthis._nameMap = {};\n\t\tthis._lowercaseNameMap = {};\n\t\tObject.keys(this._languages).forEach((langId) => {\n\t\t\tconst language = this._languages[langId];\n\t\t\tif (language.name) {\n\t\t\t\tthis._nameMap[language.name] = language.identifier;\n\t\t\t}\n\t\t\tlanguage.aliases.forEach((alias) => {\n\t\t\t\tthis._lowercaseNameMap[alias.toLowerCase()] = language.identifier;\n\t\t\t});\n\t\t\tlanguage.mimetypes.forEach((mimetype) => {\n\t\t\t\tthis._mimeTypesMap[mimetype] = language.identifier;\n\t\t\t});\n\t\t});\n\n\t\tRegistry.as<IConfigurationRegistry>(Extensions.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds());\n\n\t\tthis._onDidChange.fire();\n\t}\n\n\tprivate _registerLanguage(lang: ILanguageExtensionPoint): void {\n\t\tconst langId = lang.id;\n\n\t\tlet resolvedLanguage: IResolvedLanguage;\n\t\tif (hasOwnProperty.call(this._languages, langId)) {\n\t\t\tresolvedLanguage = this._languages[langId];\n\t\t} else {\n\t\t\tthis.languageIdCodec.register(langId);\n\t\t\tresolvedLanguage = {\n\t\t\t\tidentifier: langId,\n\t\t\t\tname: null,\n\t\t\t\tmimetypes: [],\n\t\t\t\taliases: [],\n\t\t\t\textensions: [],\n\t\t\t\tfilenames: [],\n\t\t\t\tconfigurationFiles: [],\n\t\t\t\ticons: []\n\t\t\t};\n\t\t\tthis._languages[langId] = resolvedLanguage;\n\t\t}\n\n\t\tthis._mergeLanguage(resolvedLanguage, lang);\n\t}\n\n\tprivate _mergeLanguage(resolvedLanguage: IResolvedLanguage, lang: ILanguageExtensionPoint): void {\n\t\tconst langId = lang.id;\n\n\t\tlet primaryMime: string | null = null;\n\n\t\tif (Array.isArray(lang.mimetypes) && lang.mimetypes.length > 0) {\n\t\t\tresolvedLanguage.mimetypes.push(...lang.mimetypes);\n\t\t\tprimaryMime = lang.mimetypes[0];\n\t\t}\n\n\t\tif (!primaryMime) {\n\t\t\tprimaryMime = `text/x-${langId}`;\n\t\t\tresolvedLanguage.mimetypes.push(primaryMime);\n\t\t}\n\n\t\tif (Array.isArray(lang.extensions)) {\n\t\t\tif (lang.configuration) {\n\t\t\t\t// insert first as this appears to be the 'primary' language definition\n\t\t\t\tresolvedLanguage.extensions = lang.extensions.concat(resolvedLanguage.extensions);\n\t\t\t} else {\n\t\t\t\tresolvedLanguage.extensions = resolvedLanguage.extensions.concat(lang.extensions);\n\t\t\t}\n\t\t\tfor (let extension of lang.extensions) {\n\t\t\t\tregisterPlatformLanguageAssociation({ id: langId, mime: primaryMime, extension: extension }, this._warnOnOverwrite);\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(lang.filenames)) {\n\t\t\tfor (let filename of lang.filenames) {\n\t\t\t\tregisterPlatformLanguageAssociation({ id: langId, mime: primaryMime, filename: filename }, this._warnOnOverwrite);\n\t\t\t\tresolvedLanguage.filenames.push(filename);\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(lang.filenamePatterns)) {\n\t\t\tfor (let filenamePattern of lang.filenamePatterns) {\n\t\t\t\tregisterPlatformLanguageAssociation({ id: langId, mime: primaryMime, filepattern: filenamePattern }, this._warnOnOverwrite);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof lang.firstLine === 'string' && lang.firstLine.length > 0) {\n\t\t\tlet firstLineRegexStr = lang.firstLine;\n\t\t\tif (firstLineRegexStr.charAt(0) !== '^') {\n\t\t\t\tfirstLineRegexStr = '^' + firstLineRegexStr;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst firstLineRegex = new RegExp(firstLineRegexStr);\n\t\t\t\tif (!regExpLeadsToEndlessLoop(firstLineRegex)) {\n\t\t\t\t\tregisterPlatformLanguageAssociation({ id: langId, mime: primaryMime, firstline: firstLineRegex }, this._warnOnOverwrite);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// Most likely, the regex was bad\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\n\t\tresolvedLanguage.aliases.push(langId);\n\n\t\tlet langAliases: Array<string | null> | null = null;\n\t\tif (typeof lang.aliases !== 'undefined' && Array.isArray(lang.aliases)) {\n\t\t\tif (lang.aliases.length === 0) {\n\t\t\t\t// signal that this language should not get a name\n\t\t\t\tlangAliases = [null];\n\t\t\t} else {\n\t\t\t\tlangAliases = lang.aliases;\n\t\t\t}\n\t\t}\n\n\t\tif (langAliases !== null) {\n\t\t\tfor (const langAlias of langAliases) {\n\t\t\t\tif (!langAlias || langAlias.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresolvedLanguage.aliases.push(langAlias);\n\t\t\t}\n\t\t}\n\n\t\tconst containsAliases = (langAliases !== null && langAliases.length > 0);\n\t\tif (containsAliases && langAliases![0] === null) {\n\t\t\t// signal that this language should not get a name\n\t\t} else {\n\t\t\tconst bestName = (containsAliases ? langAliases![0] : null) || langId;\n\t\t\tif (containsAliases || !resolvedLanguage.name) {\n\t\t\t\tresolvedLanguage.name = bestName;\n\t\t\t}\n\t\t}\n\n\t\tif (lang.configuration) {\n\t\t\tresolvedLanguage.configurationFiles.push(lang.configuration);\n\t\t}\n\n\t\tif (lang.icon) {\n\t\t\tresolvedLanguage.icons.push(lang.icon);\n\t\t}\n\t}\n\n\tpublic isRegisteredLanguageId(languageId: string | null | undefined): boolean {\n\t\tif (!languageId) {\n\t\t\treturn false;\n\t\t}\n\t\treturn hasOwnProperty.call(this._languages, languageId);\n\t}\n\n\tpublic getRegisteredLanguageIds(): string[] {\n\t\treturn Object.keys(this._languages);\n\t}\n\n\tpublic getLanguageIdByLanguageName(languageName: string): string | null {\n\t\tconst languageNameLower = languageName.toLowerCase();\n\t\tif (!hasOwnProperty.call(this._lowercaseNameMap, languageNameLower)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._lowercaseNameMap[languageNameLower];\n\t}\n\n\tpublic getLanguageIdByMimeType(mimeType: string | null | undefined): string | null {\n\t\tif (!mimeType) {\n\t\t\treturn null;\n\t\t}\n\t\tif (hasOwnProperty.call(this._mimeTypesMap, mimeType)) {\n\t\t\treturn this._mimeTypesMap[mimeType];\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic guessLanguageIdByFilepathOrFirstLine(resource: URI | null, firstLine?: string): string[] {\n\t\tif (!resource && !firstLine) {\n\t\t\treturn [];\n\t\t}\n\t\tconst mimeTypes = getMimeTypes(resource, firstLine);\n\t\treturn coalesce(mimeTypes.map(mimeType => this.getLanguageIdByMimeType(mimeType)));\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry';\nimport { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language';\nimport { firstOrDefault } from 'vs/base/common/arrays';\nimport { ILanguageIdCodec, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\n\nexport class LanguageService extends Disposable implements ILanguageService {\n\tpublic _serviceBrand: undefined;\n\n\tstatic instanceCount = 0;\n\n\tprivate readonly _encounteredLanguages: Set<string>;\n\tprotected readonly _registry: LanguagesRegistry;\n\tpublic readonly languageIdCodec: ILanguageIdCodec;\n\n\tprivate readonly _onDidEncounterLanguage = this._register(new Emitter<string>());\n\tpublic readonly onDidEncounterLanguage: Event<string> = this._onDidEncounterLanguage.event;\n\n\tprotected readonly _onDidChange = this._register(new Emitter<void>({ leakWarningThreshold: 200 /* https://github.com/microsoft/vscode/issues/119968 */ }));\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tconstructor(warnOnOverwrite = false) {\n\t\tsuper();\n\t\tLanguageService.instanceCount++;\n\t\tthis._encounteredLanguages = new Set<string>();\n\t\tthis._registry = this._register(new LanguagesRegistry(true, warnOnOverwrite));\n\t\tthis.languageIdCodec = this._registry.languageIdCodec;\n\t\tthis._register(this._registry.onDidChange(() => this._onDidChange.fire()));\n\t}\n\n\tpublic override dispose(): void {\n\t\tLanguageService.instanceCount--;\n\t\tsuper.dispose();\n\t}\n\n\tpublic isRegisteredLanguageId(languageId: string | null | undefined): boolean {\n\t\treturn this._registry.isRegisteredLanguageId(languageId);\n\t}\n\n\tpublic getLanguageIdByLanguageName(languageName: string): string | null {\n\t\treturn this._registry.getLanguageIdByLanguageName(languageName);\n\t}\n\n\tpublic getLanguageIdByMimeType(mimeType: string | null | undefined): string | null {\n\t\treturn this._registry.getLanguageIdByMimeType(mimeType);\n\t}\n\n\tpublic guessLanguageIdByFilepathOrFirstLine(resource: URI | null, firstLine?: string): string | null {\n\t\tconst languageIds = this._registry.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);\n\t\treturn firstOrDefault(languageIds, null);\n\t}\n\n\tpublic createById(languageId: string | null | undefined): ILanguageSelection {\n\t\treturn new LanguageSelection(this.onDidChange, () => {\n\t\t\treturn this._createAndGetLanguageIdentifier(languageId);\n\t\t});\n\t}\n\n\tpublic createByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection {\n\t\treturn new LanguageSelection(this.onDidChange, () => {\n\t\t\tconst languageId = this.guessLanguageIdByFilepathOrFirstLine(resource, firstLine);\n\t\t\treturn this._createAndGetLanguageIdentifier(languageId);\n\t\t});\n\t}\n\n\tprivate _createAndGetLanguageIdentifier(languageId: string | null | undefined): string {\n\t\tif (!languageId || !this.isRegisteredLanguageId(languageId)) {\n\t\t\t// Fall back to plain text if language is unknown\n\t\t\tlanguageId = PLAINTEXT_LANGUAGE_ID;\n\t\t}\n\n\t\tif (!this._encounteredLanguages.has(languageId)) {\n\t\t\tthis._encounteredLanguages.add(languageId);\n\n\t\t\t// Ensure tokenizers are created\n\t\t\tTokenizationRegistry.getOrCreate(languageId);\n\n\t\t\t// Fire event\n\t\t\tthis._onDidEncounterLanguage.fire(languageId);\n\t\t}\n\n\t\treturn languageId;\n\t}\n}\n\nclass LanguageSelection implements ILanguageSelection {\n\n\tpublic languageId: string;\n\n\tprivate _listener: IDisposable | null = null;\n\tprivate _emitter: Emitter<string> | null = null;\n\n\tconstructor(\n\t\tprivate readonly _onDidChangeLanguages: Event<void>,\n\t\tprivate readonly _selector: () => string\n\t) {\n\t\tthis.languageId = this._selector();\n\t}\n\n\tprivate _dispose(): void {\n\t\tif (this._listener) {\n\t\t\tthis._listener.dispose();\n\t\t\tthis._listener = null;\n\t\t}\n\t\tif (this._emitter) {\n\t\t\tthis._emitter.dispose();\n\t\t\tthis._emitter = null;\n\t\t}\n\t}\n\n\tpublic get onDidChange(): Event<string> {\n\t\tif (!this._listener) {\n\t\t\tthis._listener = this._onDidChangeLanguages(() => this._evaluate());\n\t\t}\n\t\tif (!this._emitter) {\n\t\t\tthis._emitter = new Emitter<string>({\n\t\t\t\tonLastListenerRemove: () => {\n\t\t\t\t\tthis._dispose();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this._emitter.event;\n\t}\n\n\tprivate _evaluate(): void {\n\t\tconst languageId = this._selector();\n\t\tif (languageId === this.languageId) {\n\t\t\t// no change\n\t\t\treturn;\n\t\t}\n\t\tthis.languageId = languageId;\n\t\tif (this._emitter) {\n\t\t\tthis._emitter.fire(this.languageId);\n\t\t}\n\t}\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 { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { renderMarkdown, MarkdownRenderOptions, MarkedOptions } from 'vs/base/browser/markdownRenderer';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { tokenizeToString } from 'vs/editor/common/languages/textToHtmlTokenizer';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Emitter } from 'vs/base/common/event';\nimport { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\n\nexport interface IMarkdownRenderResult extends IDisposable {\n\telement: HTMLElement;\n}\n\nexport interface IMarkdownRendererOptions {\n\teditor?: ICodeEditor;\n\tcodeBlockFontFamily?: string;\n}\n\n/**\n * Markdown renderer that can render codeblocks with the editor mechanics. This\n * renderer should always be preferred.\n */\nexport class MarkdownRenderer {\n\n\tprivate static _ttpTokenizer = window.trustedTypes?.createPolicy('tokenizeToString', {\n\t\tcreateHTML(html: string) {\n\t\t\treturn html;\n\t\t}\n\t});\n\n\tprivate readonly _onDidRenderAsync = new Emitter<void>();\n\treadonly onDidRenderAsync = this._onDidRenderAsync.event;\n\n\tconstructor(\n\t\tprivate readonly _options: IMarkdownRendererOptions,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t) { }\n\n\tdispose(): void {\n\t\tthis._onDidRenderAsync.dispose();\n\t}\n\n\trender(markdown: IMarkdownString | undefined, options?: MarkdownRenderOptions, markedOptions?: MarkedOptions): IMarkdownRenderResult {\n\t\tif (!markdown) {\n\t\t\tconst element = document.createElement('span');\n\t\t\treturn { element, dispose: () => { } };\n\t\t}\n\n\t\tconst disposables = new DisposableStore();\n\t\tconst rendered = disposables.add(renderMarkdown(markdown, { ...this._getRenderOptions(markdown, disposables), ...options }, markedOptions));\n\t\treturn {\n\t\t\telement: rendered.element,\n\t\t\tdispose: () => disposables.dispose()\n\t\t};\n\t}\n\n\tprotected _getRenderOptions(markdown: IMarkdownString, disposeables: DisposableStore): MarkdownRenderOptions {\n\t\treturn {\n\t\t\tcodeBlockRenderer: async (languageAlias, value) => {\n\t\t\t\t// In markdown,\n\t\t\t\t// it is possible that we stumble upon language aliases (e.g.js instead of javascript)\n\t\t\t\t// it is possible no alias is given in which case we fall back to the current editor lang\n\t\t\t\tlet languageId: string | undefined | null;\n\t\t\t\tif (languageAlias) {\n\t\t\t\t\tlanguageId = this._languageService.getLanguageIdByLanguageName(languageAlias);\n\t\t\t\t} else if (this._options.editor) {\n\t\t\t\t\tlanguageId = this._options.editor.getModel()?.getLanguageId();\n\t\t\t\t}\n\t\t\t\tif (!languageId) {\n\t\t\t\t\tlanguageId = PLAINTEXT_LANGUAGE_ID;\n\t\t\t\t}\n\t\t\t\tconst html = await tokenizeToString(this._languageService, value, languageId);\n\n\t\t\t\tconst element = document.createElement('span');\n\n\t\t\t\telement.innerHTML = (MarkdownRenderer._ttpTokenizer?.createHTML(html) ?? html) as string;\n\n\t\t\t\t// use \"good\" font\n\t\t\t\tif (this._options.editor) {\n\t\t\t\t\tconst fontInfo = this._options.editor.getOption(EditorOption.fontInfo);\n\t\t\t\t\tapplyFontInfo(element, fontInfo);\n\t\t\t\t} else if (this._options.codeBlockFontFamily) {\n\t\t\t\t\telement.style.fontFamily = this._options.codeBlockFontFamily;\n\t\t\t\t}\n\n\t\t\t\treturn element;\n\t\t\t},\n\t\t\tasyncRenderCallback: () => this._onDidRenderAsync.fire(),\n\t\t\tactionHandler: {\n\t\t\t\tcallback: (content) => this._openerService.open(content, { fromUserGesture: true, allowContributedOpeners: true, allowCommands: markdown.isTrusted }).catch(onUnexpectedError),\n\t\t\t\tdisposables: disposeables\n\t\t\t}\n\t\t};\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { asArray } from 'vs/base/common/arrays';\nimport { IMarkdownString, isEmptyMarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/browser/hoverOperation';\nimport { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';\nimport { HoverWidget } from 'vs/base/browser/ui/hover/hoverWidget';\n\nconst $ = dom.$;\n\nexport interface IHoverMessage {\n\tvalue: IMarkdownString;\n}\n\nexport class MarginHoverWidget extends Disposable implements IOverlayWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _markdownRenderer: MarkdownRenderer;\n\tprivate readonly _computer: MarginHoverComputer;\n\tprivate readonly _hoverOperation: HoverOperation<IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tlanguageService: ILanguageService,\n\t\topenerService: IOpenerService = NullOpenerService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget());\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._markdownRenderer = this._register(new MarkdownRenderer({ editor: this._editor }, languageService, openerService));\n\t\tthis._computer = new MarginHoverComputer(this._editor);\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, this._computer));\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tthis._withResult(result.value);\n\t\t}));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn MarginHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed);\n\t\t}\n\t}\n\n\tpublic startShowingAt(lineNumber: number): void {\n\t\tif (this._computer.lineNumber === lineNumber) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hoverOperation.cancel();\n\n\t\tthis.hide();\n\n\t\tthis._computer.lineNumber = lineNumber;\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._computer.lineNumber = -1;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: IHoverMessage[]): void {\n\t\tthis._messages = result;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(this._computer.lineNumber, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRenderer.render(msg.value));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\n\t\tthis._hover.containerDomNode.style.left = `${editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth}px`;\n\t\tthis._hover.containerDomNode.style.top = `${Math.max(Math.round(top), 0)}px`;\n\t}\n}\n\nclass MarginHoverComputer implements IHoverComputer<IHoverMessage> {\n\n\tprivate _lineNumber: number = -1;\n\n\tpublic get lineNumber(): number {\n\t\treturn this._lineNumber;\n\t}\n\n\tpublic set lineNumber(value: number) {\n\t\tthis._lineNumber = value;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) {\n\t}\n\n\tpublic computeSync(): IHoverMessage[] {\n\n\t\tconst toHoverMessage = (contents: IMarkdownString): IHoverMessage => {\n\t\t\treturn {\n\t\t\t\tvalue: contents\n\t\t\t};\n\t\t};\n\n\t\tconst lineDecorations = this._editor.getLineDecorations(this._lineNumber);\n\n\t\tconst result: IHoverMessage[] = [];\n\t\tif (!lineDecorations) {\n\t\t\treturn result;\n\t\t}\n\n\t\tfor (const d of lineDecorations) {\n\t\t\tif (!d.options.glyphMarginClassName) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst hoverMessage = d.options.glyphMarginHoverMessage;\n\t\t\tif (!hoverMessage || isEmptyMarkdownString(hoverMessage)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresult.push(...asArray(hoverMessage).map(toHoverMessage));\n\t\t}\n\n\t\treturn result;\n\t}\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 { isSafari } from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ICodeEditor, IOverlayWidget } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { ResizableHTMLElement } from 'vs/editor/contrib/suggest/browser/resizable';\nimport * as nls from 'vs/nls';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { CompletionItem } from './suggest';\n\nexport function canExpandCompletionItem(item: CompletionItem | undefined): boolean {\n\treturn !!item && Boolean(item.completion.documentation || item.completion.detail && item.completion.detail !== item.completion.label);\n}\n\nexport class SuggestDetailsWidget {\n\n\treadonly domNode: HTMLDivElement;\n\n\tprivate readonly _onDidClose = new Emitter<void>();\n\treadonly onDidClose: Event<void> = this._onDidClose.event;\n\n\tprivate readonly _onDidChangeContents = new Emitter<this>();\n\treadonly onDidChangeContents: Event<this> = this._onDidChangeContents.event;\n\n\tprivate readonly _close: HTMLElement;\n\tprivate readonly _scrollbar: DomScrollableElement;\n\tprivate readonly _body: HTMLElement;\n\tprivate readonly _header: HTMLElement;\n\tprivate readonly _type: HTMLElement;\n\tprivate readonly _docs: HTMLElement;\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate readonly _markdownRenderer: MarkdownRenderer;\n\tprivate readonly _renderDisposeable = new DisposableStore();\n\tprivate _borderWidth: number = 1;\n\tprivate _size = new dom.Dimension(330, 0);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService instaService: IInstantiationService,\n\t) {\n\t\tthis.domNode = dom.$('.suggest-details');\n\t\tthis.domNode.classList.add('no-docs');\n\n\t\tthis._markdownRenderer = instaService.createInstance(MarkdownRenderer, { editor: _editor });\n\n\t\tthis._body = dom.$('.body');\n\n\t\tthis._scrollbar = new DomScrollableElement(this._body, {});\n\t\tdom.append(this.domNode, this._scrollbar.getDomNode());\n\t\tthis._disposables.add(this._scrollbar);\n\n\t\tthis._header = dom.append(this._body, dom.$('.header'));\n\t\tthis._close = dom.append(this._header, dom.$('span' + Codicon.close.cssSelector));\n\t\tthis._close.title = nls.localize('details.close', \"Close\");\n\t\tthis._type = dom.append(this._header, dom.$('p.type'));\n\n\t\tthis._docs = dom.append(this._body, dom.$('p.docs'));\n\n\t\tthis._configureFont();\n\n\t\tthis._disposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._configureFont();\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._renderDisposeable.dispose();\n\t}\n\n\tprivate _configureFont(): void {\n\t\tconst options = this._editor.getOptions();\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst fontFamily = fontInfo.getMassagedFontFamily(isSafari ? EDITOR_FONT_DEFAULTS.fontFamily : null);\n\t\tconst fontSize = options.get(EditorOption.suggestFontSize) || fontInfo.fontSize;\n\t\tconst lineHeight = options.get(EditorOption.suggestLineHeight) || fontInfo.lineHeight;\n\t\tconst fontWeight = fontInfo.fontWeight;\n\t\tconst fontSizePx = `${fontSize}px`;\n\t\tconst lineHeightPx = `${lineHeight}px`;\n\n\t\tthis.domNode.style.fontSize = fontSizePx;\n\t\tthis.domNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\tthis.domNode.style.fontWeight = fontWeight;\n\t\tthis.domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings;\n\t\tthis._type.style.fontFamily = fontFamily;\n\t\tthis._close.style.height = lineHeightPx;\n\t\tthis._close.style.width = lineHeightPx;\n\t}\n\n\tgetLayoutInfo() {\n\t\tconst lineHeight = this._editor.getOption(EditorOption.suggestLineHeight) || this._editor.getOption(EditorOption.fontInfo).lineHeight;\n\t\tconst borderWidth = this._borderWidth;\n\t\tconst borderHeight = borderWidth * 2;\n\t\treturn {\n\t\t\tlineHeight,\n\t\t\tborderWidth,\n\t\t\tborderHeight,\n\t\t\tverticalPadding: 22,\n\t\t\thorizontalPadding: 14\n\t\t};\n\t}\n\n\n\trenderLoading(): void {\n\t\tthis._type.textContent = nls.localize('loading', \"Loading...\");\n\t\tthis._docs.textContent = '';\n\t\tthis.domNode.classList.remove('no-docs', 'no-type');\n\t\tthis.layout(this.size.width, this.getLayoutInfo().lineHeight * 2);\n\t\tthis._onDidChangeContents.fire(this);\n\t}\n\n\trenderItem(item: CompletionItem, explainMode: boolean): void {\n\t\tthis._renderDisposeable.clear();\n\n\t\tlet { detail, documentation } = item.completion;\n\n\t\tif (explainMode) {\n\t\t\tlet md = '';\n\t\t\tmd += `score: ${item.score[0]}\\n`;\n\t\t\tmd += `prefix: ${item.word ?? '(no prefix)'}\\n`;\n\t\t\tmd += `word: ${item.completion.filterText ? item.completion.filterText + ' (filterText)' : item.textLabel}\\n`;\n\t\t\tmd += `distance: ${item.distance} (localityBonus-setting)\\n`;\n\t\t\tmd += `index: ${item.idx}, based on ${item.completion.sortText && `sortText: \"${item.completion.sortText}\"` || 'label'}\\n`;\n\t\t\tmd += `commit_chars: ${item.completion.commitCharacters?.join('')}\\n`;\n\t\t\tdocumentation = new MarkdownString().appendCodeblock('empty', md);\n\t\t\tdetail = `Provider: ${item.provider._debugDisplayName}`;\n\t\t}\n\n\t\tif (!explainMode && !canExpandCompletionItem(item)) {\n\t\t\tthis.clearContents();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.classList.remove('no-docs', 'no-type');\n\n\t\t// --- details\n\n\t\tif (detail) {\n\t\t\tconst cappedDetail = detail.length > 100000 ? `${detail.substr(0, 100000)}…` : detail;\n\t\t\tthis._type.textContent = cappedDetail;\n\t\t\tthis._type.title = cappedDetail;\n\t\t\tdom.show(this._type);\n\t\t\tthis._type.classList.toggle('auto-wrap', !/\\r?\\n^\\s+/gmi.test(cappedDetail));\n\t\t} else {\n\t\t\tdom.clearNode(this._type);\n\t\t\tthis._type.title = '';\n\t\t\tdom.hide(this._type);\n\t\t\tthis.domNode.classList.add('no-type');\n\t\t}\n\n\t\t// --- documentation\n\t\tdom.clearNode(this._docs);\n\t\tif (typeof documentation === 'string') {\n\t\t\tthis._docs.classList.remove('markdown-docs');\n\t\t\tthis._docs.textContent = documentation;\n\n\t\t} else if (documentation) {\n\t\t\tthis._docs.classList.add('markdown-docs');\n\t\t\tdom.clearNode(this._docs);\n\t\t\tconst renderedContents = this._markdownRenderer.render(documentation);\n\t\t\tthis._docs.appendChild(renderedContents.element);\n\t\t\tthis._renderDisposeable.add(renderedContents);\n\t\t\tthis._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(() => {\n\t\t\t\tthis.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight);\n\t\t\t\tthis._onDidChangeContents.fire(this);\n\t\t\t}));\n\t\t}\n\n\t\tthis.domNode.style.userSelect = 'text';\n\t\tthis.domNode.tabIndex = -1;\n\n\t\tthis._close.onmousedown = e => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t};\n\t\tthis._close.onclick = e => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._onDidClose.fire();\n\t\t};\n\n\t\tthis._body.scrollTop = 0;\n\n\t\tthis.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight);\n\t\tthis._onDidChangeContents.fire(this);\n\t}\n\n\tclearContents() {\n\t\tthis.domNode.classList.add('no-docs');\n\t\tthis._type.textContent = '';\n\t\tthis._docs.textContent = '';\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tlayout(width: number, height: number): void {\n\t\tconst newSize = new dom.Dimension(width, height);\n\t\tif (!dom.Dimension.equals(newSize, this._size)) {\n\t\t\tthis._size = newSize;\n\t\t\tdom.size(this.domNode, width, height);\n\t\t}\n\t\tthis._scrollbar.scanDomNode();\n\t}\n\n\tscrollDown(much = 8): void {\n\t\tthis._body.scrollTop += much;\n\t}\n\n\tscrollUp(much = 8): void {\n\t\tthis._body.scrollTop -= much;\n\t}\n\n\tscrollTop(): void {\n\t\tthis._body.scrollTop = 0;\n\t}\n\n\tscrollBottom(): void {\n\t\tthis._body.scrollTop = this._body.scrollHeight;\n\t}\n\n\tpageDown(): void {\n\t\tthis.scrollDown(80);\n\t}\n\n\tpageUp(): void {\n\t\tthis.scrollUp(80);\n\t}\n\n\tset borderWidth(width: number) {\n\t\tthis._borderWidth = width;\n\t}\n\n\tget borderWidth() {\n\t\treturn this._borderWidth;\n\t}\n}\n\ninterface TopLeftPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport class SuggestDetailsOverlay implements IOverlayWidget {\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _resizable: ResizableHTMLElement;\n\n\tprivate _added: boolean = false;\n\tprivate _anchorBox?: dom.IDomNodePagePosition;\n\tprivate _preferAlignAtTop: boolean = true;\n\tprivate _userSize?: dom.Dimension;\n\tprivate _topLeft?: TopLeftPosition;\n\n\tconstructor(\n\t\treadonly widget: SuggestDetailsWidget,\n\t\tprivate readonly _editor: ICodeEditor\n\t) {\n\n\t\tthis._resizable = new ResizableHTMLElement();\n\t\tthis._resizable.domNode.classList.add('suggest-details-container');\n\t\tthis._resizable.domNode.appendChild(widget.domNode);\n\t\tthis._resizable.enableSashes(false, true, true, false);\n\n\t\tlet topLeftNow: TopLeftPosition | undefined;\n\t\tlet sizeNow: dom.Dimension | undefined;\n\t\tlet deltaTop: number = 0;\n\t\tlet deltaLeft: number = 0;\n\t\tthis._disposables.add(this._resizable.onDidWillResize(() => {\n\t\t\ttopLeftNow = this._topLeft;\n\t\t\tsizeNow = this._resizable.size;\n\t\t}));\n\n\t\tthis._disposables.add(this._resizable.onDidResize(e => {\n\t\t\tif (topLeftNow && sizeNow) {\n\t\t\t\tthis.widget.layout(e.dimension.width, e.dimension.height);\n\n\t\t\t\tlet updateTopLeft = false;\n\t\t\t\tif (e.west) {\n\t\t\t\t\tdeltaLeft = sizeNow.width - e.dimension.width;\n\t\t\t\t\tupdateTopLeft = true;\n\t\t\t\t}\n\t\t\t\tif (e.north) {\n\t\t\t\t\tdeltaTop = sizeNow.height - e.dimension.height;\n\t\t\t\t\tupdateTopLeft = true;\n\t\t\t\t}\n\t\t\t\tif (updateTopLeft) {\n\t\t\t\t\tthis._applyTopLeft({\n\t\t\t\t\t\ttop: topLeftNow.top + deltaTop,\n\t\t\t\t\t\tleft: topLeftNow.left + deltaLeft,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (e.done) {\n\t\t\t\ttopLeftNow = undefined;\n\t\t\t\tsizeNow = undefined;\n\t\t\t\tdeltaTop = 0;\n\t\t\t\tdeltaLeft = 0;\n\t\t\t\tthis._userSize = e.dimension;\n\t\t\t}\n\t\t}));\n\n\t\tthis._disposables.add(this.widget.onDidChangeContents(() => {\n\t\t\tif (this._anchorBox) {\n\t\t\t\tthis._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, this._preferAlignAtTop);\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._resizable.dispose();\n\t\tthis._disposables.dispose();\n\t\tthis.hide();\n\t}\n\n\tgetId(): string {\n\t\treturn 'suggest.details';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._resizable.domNode;\n\t}\n\n\tgetPosition(): null {\n\t\treturn null;\n\t}\n\n\tshow(): void {\n\t\tif (!this._added) {\n\t\t\tthis._editor.addOverlayWidget(this);\n\t\t\tthis.getDomNode().style.position = 'fixed';\n\t\t\tthis._added = true;\n\t\t}\n\t}\n\n\thide(sessionEnded: boolean = false): void {\n\t\tthis._resizable.clearSashHoverState();\n\n\t\tif (this._added) {\n\t\t\tthis._editor.removeOverlayWidget(this);\n\t\t\tthis._added = false;\n\t\t\tthis._anchorBox = undefined;\n\t\t\tthis._topLeft = undefined;\n\t\t}\n\t\tif (sessionEnded) {\n\t\t\tthis._userSize = undefined;\n\t\t\tthis.widget.clearContents();\n\t\t}\n\t}\n\n\tplaceAtAnchor(anchor: HTMLElement, preferAlignAtTop: boolean) {\n\t\tconst anchorBox = anchor.getBoundingClientRect();\n\t\tthis._anchorBox = anchorBox;\n\t\tthis._preferAlignAtTop = preferAlignAtTop;\n\t\tthis._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, preferAlignAtTop);\n\t}\n\n\t_placeAtAnchor(anchorBox: dom.IDomNodePagePosition, size: dom.Dimension, preferAlignAtTop: boolean) {\n\t\tconst bodyBox = dom.getClientArea(document.body);\n\n\t\tconst info = this.widget.getLayoutInfo();\n\n\t\tconst defaultMinSize = new dom.Dimension(220, 2 * info.lineHeight);\n\t\tconst defaultTop = anchorBox.top;\n\n\t\ttype Placement = { top: number; left: number; fit: number; maxSizeTop: dom.Dimension; maxSizeBottom: dom.Dimension; minSize: dom.Dimension };\n\n\t\t// EAST\n\t\tconst eastPlacement: Placement = (function () {\n\t\t\tconst width = bodyBox.width - (anchorBox.left + anchorBox.width + info.borderWidth + info.horizontalPadding);\n\t\t\tconst left = -info.borderWidth + anchorBox.left + anchorBox.width;\n\t\t\tconst maxSizeTop = new dom.Dimension(width, bodyBox.height - anchorBox.top - info.borderHeight - info.verticalPadding);\n\t\t\tconst maxSizeBottom = maxSizeTop.with(undefined, anchorBox.top + anchorBox.height - info.borderHeight - info.verticalPadding);\n\t\t\treturn { top: defaultTop, left, fit: width - size.width, maxSizeTop, maxSizeBottom, minSize: defaultMinSize.with(Math.min(width, defaultMinSize.width)) };\n\t\t})();\n\n\t\t// WEST\n\t\tconst westPlacement: Placement = (function () {\n\t\t\tconst width = anchorBox.left - info.borderWidth - info.horizontalPadding;\n\t\t\tconst left = Math.max(info.horizontalPadding, anchorBox.left - size.width - info.borderWidth);\n\t\t\tconst maxSizeTop = new dom.Dimension(width, bodyBox.height - anchorBox.top - info.borderHeight - info.verticalPadding);\n\t\t\tconst maxSizeBottom = maxSizeTop.with(undefined, anchorBox.top + anchorBox.height - info.borderHeight - info.verticalPadding);\n\t\t\treturn { top: defaultTop, left, fit: width - size.width, maxSizeTop, maxSizeBottom, minSize: defaultMinSize.with(Math.min(width, defaultMinSize.width)) };\n\t\t})();\n\n\t\t// SOUTH\n\t\tconst southPacement: Placement = (function () {\n\t\t\tconst left = anchorBox.left;\n\t\t\tconst top = -info.borderWidth + anchorBox.top + anchorBox.height;\n\t\t\tconst maxSizeBottom = new dom.Dimension(anchorBox.width - info.borderHeight, bodyBox.height - anchorBox.top - anchorBox.height - info.verticalPadding);\n\t\t\treturn { top, left, fit: maxSizeBottom.height - size.height, maxSizeBottom, maxSizeTop: maxSizeBottom, minSize: defaultMinSize.with(maxSizeBottom.width) };\n\t\t})();\n\n\t\t// take first placement that fits or the first with \"least bad\" fit\n\t\tconst placements = [eastPlacement, westPlacement, southPacement];\n\t\tconst placement = placements.find(p => p.fit >= 0) ?? placements.sort((a, b) => b.fit - a.fit)[0];\n\n\t\t// top/bottom placement\n\t\tconst bottom = anchorBox.top + anchorBox.height - info.borderHeight;\n\t\tlet alignAtTop: boolean;\n\t\tlet height = size.height;\n\t\tconst maxHeight = Math.max(placement.maxSizeTop.height, placement.maxSizeBottom.height);\n\t\tif (height > maxHeight) {\n\t\t\theight = maxHeight;\n\t\t}\n\t\tlet maxSize: dom.Dimension;\n\t\tif (preferAlignAtTop) {\n\t\t\tif (height <= placement.maxSizeTop.height) {\n\t\t\t\talignAtTop = true;\n\t\t\t\tmaxSize = placement.maxSizeTop;\n\t\t\t} else {\n\t\t\t\talignAtTop = false;\n\t\t\t\tmaxSize = placement.maxSizeBottom;\n\t\t\t}\n\t\t} else {\n\t\t\tif (height <= placement.maxSizeBottom.height) {\n\t\t\t\talignAtTop = false;\n\t\t\t\tmaxSize = placement.maxSizeBottom;\n\t\t\t} else {\n\t\t\t\talignAtTop = true;\n\t\t\t\tmaxSize = placement.maxSizeTop;\n\t\t\t}\n\t\t}\n\n\t\tthis._applyTopLeft({ left: placement.left, top: alignAtTop ? placement.top : bottom - height });\n\t\tthis.getDomNode().style.position = 'fixed';\n\n\t\tthis._resizable.enableSashes(!alignAtTop, placement === eastPlacement, alignAtTop, placement !== eastPlacement);\n\n\t\tthis._resizable.minSize = placement.minSize;\n\t\tthis._resizable.maxSize = maxSize;\n\t\tthis._resizable.layout(height, Math.min(maxSize.width, size.width));\n\t\tthis.widget.layout(this._resizable.size.width, this._resizable.size.height);\n\t}\n\n\tprivate _applyTopLeft(topLeft: TopLeftPosition): void {\n\t\tthis._topLeft = topLeft;\n\t\tthis.getDomNode().style.left = `${this._topLeft.left}px`;\n\t\tthis.getDomNode().style.top = `${this._topLeft.top}px`;\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { IStringDictionary } from 'vs/base/common/collections';\nimport { ResourceMap } from 'vs/base/common/map';\nimport * as objects from 'vs/base/common/objects';\nimport * as types from 'vs/base/common/types';\nimport { URI, UriComponents } from 'vs/base/common/uri';\nimport { addToValueTree, ConfigurationTarget, getConfigurationValue, IConfigurationChange, IConfigurationChangeEvent, IConfigurationData, IConfigurationModel, IConfigurationOverrides, IConfigurationUpdateOverrides, IConfigurationValue, IOverrides, removeFromValueTree, toValuesTree } from 'vs/platform/configuration/common/configuration';\nimport { Extensions, IConfigurationRegistry, overrideIdentifiersFromKey, OVERRIDE_PROPERTY_REGEX } from 'vs/platform/configuration/common/configurationRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { Workspace } from 'vs/platform/workspace/common/workspace';\n\nexport class ConfigurationModel implements IConfigurationModel {\n\n\tprivate isFrozen: boolean = false;\n\tprivate readonly overrideConfigurations = new Map<string, ConfigurationModel>();\n\n\tconstructor(\n\t\tprivate readonly _contents: any = {},\n\t\tprivate readonly _keys: string[] = [],\n\t\tprivate readonly _overrides: IOverrides[] = []\n\t) {\n\t}\n\n\tget contents(): any {\n\t\treturn this.checkAndFreeze(this._contents);\n\t}\n\n\tget overrides(): IOverrides[] {\n\t\treturn this.checkAndFreeze(this._overrides);\n\t}\n\n\tget keys(): string[] {\n\t\treturn this.checkAndFreeze(this._keys);\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this._keys.length === 0 && Object.keys(this._contents).length === 0 && this._overrides.length === 0;\n\t}\n\n\tgetValue<V>(section: string | undefined): V {\n\t\treturn section ? getConfigurationValue<any>(this.contents, section) : this.contents;\n\t}\n\n\tgetOverrideValue<V>(section: string | undefined, overrideIdentifier: string): V | undefined {\n\t\tconst overrideContents = this.getContentsForOverrideIdentifer(overrideIdentifier);\n\t\treturn overrideContents\n\t\t\t? section ? getConfigurationValue<any>(overrideContents, section) : overrideContents\n\t\t\t: undefined;\n\t}\n\n\toverride(identifier: string): ConfigurationModel {\n\t\tlet overrideConfigurationModel = this.overrideConfigurations.get(identifier);\n\t\tif (!overrideConfigurationModel) {\n\t\t\toverrideConfigurationModel = this.createOverrideConfigurationModel(identifier);\n\t\t\tthis.overrideConfigurations.set(identifier, overrideConfigurationModel);\n\t\t}\n\t\treturn overrideConfigurationModel;\n\t}\n\n\tmerge(...others: ConfigurationModel[]): ConfigurationModel {\n\t\tconst contents = objects.deepClone(this.contents);\n\t\tconst overrides = objects.deepClone(this.overrides);\n\t\tconst keys = [...this.keys];\n\n\t\tfor (const other of others) {\n\t\t\tthis.mergeContents(contents, other.contents);\n\n\t\t\tfor (const otherOverride of other.overrides) {\n\t\t\t\tconst [override] = overrides.filter(o => arrays.equals(o.identifiers, otherOverride.identifiers));\n\t\t\t\tif (override) {\n\t\t\t\t\tthis.mergeContents(override.contents, otherOverride.contents);\n\t\t\t\t\toverride.keys.push(...otherOverride.keys);\n\t\t\t\t\toverride.keys = arrays.distinct(override.keys);\n\t\t\t\t} else {\n\t\t\t\t\toverrides.push(objects.deepClone(otherOverride));\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const key of other.keys) {\n\t\t\t\tif (keys.indexOf(key) === -1) {\n\t\t\t\t\tkeys.push(key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new ConfigurationModel(contents, keys, overrides);\n\t}\n\n\tfreeze(): ConfigurationModel {\n\t\tthis.isFrozen = true;\n\t\treturn this;\n\t}\n\n\tprivate createOverrideConfigurationModel(identifier: string): ConfigurationModel {\n\t\tconst overrideContents = this.getContentsForOverrideIdentifer(identifier);\n\n\t\tif (!overrideContents || typeof overrideContents !== 'object' || !Object.keys(overrideContents).length) {\n\t\t\t// If there are no valid overrides, return self\n\t\t\treturn this;\n\t\t}\n\n\t\tlet contents: any = {};\n\t\tfor (const key of arrays.distinct([...Object.keys(this.contents), ...Object.keys(overrideContents)])) {\n\n\t\t\tlet contentsForKey = this.contents[key];\n\t\t\tlet overrideContentsForKey = overrideContents[key];\n\n\t\t\t// If there are override contents for the key, clone and merge otherwise use base contents\n\t\t\tif (overrideContentsForKey) {\n\t\t\t\t// Clone and merge only if base contents and override contents are of type object otherwise just override\n\t\t\t\tif (typeof contentsForKey === 'object' && typeof overrideContentsForKey === 'object') {\n\t\t\t\t\tcontentsForKey = objects.deepClone(contentsForKey);\n\t\t\t\t\tthis.mergeContents(contentsForKey, overrideContentsForKey);\n\t\t\t\t} else {\n\t\t\t\t\tcontentsForKey = overrideContentsForKey;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcontents[key] = contentsForKey;\n\t\t}\n\n\t\treturn new ConfigurationModel(contents, this.keys, this.overrides);\n\t}\n\n\tprivate mergeContents(source: any, target: any): void {\n\t\tfor (const key of Object.keys(target)) {\n\t\t\tif (key in source) {\n\t\t\t\tif (types.isObject(source[key]) && types.isObject(target[key])) {\n\t\t\t\t\tthis.mergeContents(source[key], target[key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsource[key] = objects.deepClone(target[key]);\n\t\t}\n\t}\n\n\tprivate checkAndFreeze<T>(data: T): T {\n\t\tif (this.isFrozen && !Object.isFrozen(data)) {\n\t\t\treturn objects.deepFreeze(data);\n\t\t}\n\t\treturn data;\n\t}\n\n\tprivate getContentsForOverrideIdentifer(identifier: string): any {\n\t\tlet contentsForIdentifierOnly: IStringDictionary<any> | null = null;\n\t\tlet contents: IStringDictionary<any> | null = null;\n\t\tconst mergeContents = (contentsToMerge: any) => {\n\t\t\tif (contentsToMerge) {\n\t\t\t\tif (contents) {\n\t\t\t\t\tthis.mergeContents(contents, contentsToMerge);\n\t\t\t\t} else {\n\t\t\t\t\tcontents = objects.deepClone(contentsToMerge);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tfor (const override of this.overrides) {\n\t\t\tif (arrays.equals(override.identifiers, [identifier])) {\n\t\t\t\tcontentsForIdentifierOnly = override.contents;\n\t\t\t} else if (override.identifiers.includes(identifier)) {\n\t\t\t\tmergeContents(override.contents);\n\t\t\t}\n\t\t}\n\t\t// Merge contents of the identifier only at the end to take precedence.\n\t\tmergeContents(contentsForIdentifierOnly);\n\t\treturn contents;\n\t}\n\n\ttoJSON(): IConfigurationModel {\n\t\treturn {\n\t\t\tcontents: this.contents,\n\t\t\toverrides: this.overrides,\n\t\t\tkeys: this.keys\n\t\t};\n\t}\n\n\t// Update methods\n\n\tpublic setValue(key: string, value: any) {\n\t\tthis.addKey(key);\n\t\taddToValueTree(this.contents, key, value, e => { throw new Error(e); });\n\t}\n\n\tpublic removeValue(key: string): void {\n\t\tif (this.removeKey(key)) {\n\t\t\tremoveFromValueTree(this.contents, key);\n\t\t}\n\t}\n\n\tprivate addKey(key: string): void {\n\t\tlet index = this.keys.length;\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tif (key.indexOf(this.keys[i]) === 0) {\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\tthis.keys.splice(index, 1, key);\n\t}\n\n\tprivate removeKey(key: string): boolean {\n\t\tlet index = this.keys.indexOf(key);\n\t\tif (index !== -1) {\n\t\t\tthis.keys.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport class DefaultConfigurationModel extends ConfigurationModel {\n\n\tconstructor(configurationDefaultsOverrides: IStringDictionary<any> = {}) {\n\t\tconst properties = Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurationProperties();\n\t\tconst keys = Object.keys(properties);\n\t\tconst contents: any = Object.create(null);\n\t\tconst overrides: IOverrides[] = [];\n\n\t\tfor (const key in properties) {\n\t\t\tconst defaultOverrideValue = configurationDefaultsOverrides[key];\n\t\t\tconst value = defaultOverrideValue !== undefined ? defaultOverrideValue : properties[key].default;\n\t\t\taddToValueTree(contents, key, value, message => console.error(`Conflict in default settings: ${message}`));\n\t\t}\n\t\tfor (const key of Object.keys(contents)) {\n\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\toverrides.push({\n\t\t\t\t\tidentifiers: overrideIdentifiersFromKey(key),\n\t\t\t\t\tkeys: Object.keys(contents[key]),\n\t\t\t\t\tcontents: toValuesTree(contents[key], message => console.error(`Conflict in default settings file: ${message}`)),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tsuper(contents, keys, overrides);\n\t}\n}\n\n\nexport class Configuration {\n\n\tprivate _workspaceConsolidatedConfiguration: ConfigurationModel | null = null;\n\tprivate _foldersConsolidatedConfigurations: ResourceMap<ConfigurationModel> = new ResourceMap<ConfigurationModel>();\n\n\tconstructor(\n\t\tprivate _defaultConfiguration: ConfigurationModel,\n\t\tprivate _localUserConfiguration: ConfigurationModel,\n\t\tprivate _remoteUserConfiguration: ConfigurationModel = new ConfigurationModel(),\n\t\tprivate _workspaceConfiguration: ConfigurationModel = new ConfigurationModel(),\n\t\tprivate _folderConfigurations: ResourceMap<ConfigurationModel> = new ResourceMap<ConfigurationModel>(),\n\t\tprivate _memoryConfiguration: ConfigurationModel = new ConfigurationModel(),\n\t\tprivate _memoryConfigurationByResource: ResourceMap<ConfigurationModel> = new ResourceMap<ConfigurationModel>(),\n\t\tprivate _freeze: boolean = true) {\n\t}\n\n\tgetValue(section: string | undefined, overrides: IConfigurationOverrides, workspace: Workspace | undefined): any {\n\t\tconst consolidateConfigurationModel = this.getConsolidateConfigurationModel(overrides, workspace);\n\t\treturn consolidateConfigurationModel.getValue(section);\n\t}\n\n\tupdateValue(key: string, value: any, overrides: IConfigurationUpdateOverrides = {}): void {\n\t\tlet memoryConfiguration: ConfigurationModel | undefined;\n\t\tif (overrides.resource) {\n\t\t\tmemoryConfiguration = this._memoryConfigurationByResource.get(overrides.resource);\n\t\t\tif (!memoryConfiguration) {\n\t\t\t\tmemoryConfiguration = new ConfigurationModel();\n\t\t\t\tthis._memoryConfigurationByResource.set(overrides.resource, memoryConfiguration);\n\t\t\t}\n\t\t} else {\n\t\t\tmemoryConfiguration = this._memoryConfiguration;\n\t\t}\n\n\t\tif (value === undefined) {\n\t\t\tmemoryConfiguration.removeValue(key);\n\t\t} else {\n\t\t\tmemoryConfiguration.setValue(key, value);\n\t\t}\n\n\t\tif (!overrides.resource) {\n\t\t\tthis._workspaceConsolidatedConfiguration = null;\n\t\t}\n\t}\n\n\tinspect<C>(key: string, overrides: IConfigurationOverrides, workspace: Workspace | undefined): IConfigurationValue<C> {\n\t\tconst consolidateConfigurationModel = this.getConsolidateConfigurationModel(overrides, workspace);\n\t\tconst folderConfigurationModel = this.getFolderConfigurationModelForResource(overrides.resource, workspace);\n\t\tconst memoryConfigurationModel = overrides.resource ? this._memoryConfigurationByResource.get(overrides.resource) || this._memoryConfiguration : this._memoryConfiguration;\n\n\t\tconst defaultValue = overrides.overrideIdentifier ? this._defaultConfiguration.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : this._defaultConfiguration.freeze().getValue<C>(key);\n\t\tconst userValue = overrides.overrideIdentifier ? this.userConfiguration.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : this.userConfiguration.freeze().getValue<C>(key);\n\t\tconst userLocalValue = overrides.overrideIdentifier ? this.localUserConfiguration.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : this.localUserConfiguration.freeze().getValue<C>(key);\n\t\tconst userRemoteValue = overrides.overrideIdentifier ? this.remoteUserConfiguration.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : this.remoteUserConfiguration.freeze().getValue<C>(key);\n\t\tconst workspaceValue = workspace ? overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : this._workspaceConfiguration.freeze().getValue<C>(key) : undefined; //Check on workspace exists or not because _workspaceConfiguration is never null\n\t\tconst workspaceFolderValue = folderConfigurationModel ? overrides.overrideIdentifier ? folderConfigurationModel.freeze().override(overrides.overrideIdentifier).getValue<C>(key) : folderConfigurationModel.freeze().getValue<C>(key) : undefined;\n\t\tconst memoryValue = overrides.overrideIdentifier ? memoryConfigurationModel.override(overrides.overrideIdentifier).getValue<C>(key) : memoryConfigurationModel.getValue<C>(key);\n\t\tconst value = consolidateConfigurationModel.getValue<C>(key);\n\t\tconst overrideIdentifiers: string[] = arrays.distinct(arrays.flatten(consolidateConfigurationModel.overrides.map(override => override.identifiers))).filter(overrideIdentifier => consolidateConfigurationModel.getOverrideValue(key, overrideIdentifier) !== undefined);\n\n\t\treturn {\n\t\t\tdefaultValue: defaultValue,\n\t\t\tuserValue: userValue,\n\t\t\tuserLocalValue: userLocalValue,\n\t\t\tuserRemoteValue: userRemoteValue,\n\t\t\tworkspaceValue: workspaceValue,\n\t\t\tworkspaceFolderValue: workspaceFolderValue,\n\t\t\tmemoryValue: memoryValue,\n\t\t\tvalue,\n\n\t\t\tdefault: defaultValue !== undefined ? { value: this._defaultConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._defaultConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tuser: userValue !== undefined ? { value: this.userConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.userConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tuserLocal: userLocalValue !== undefined ? { value: this.localUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.localUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tuserRemote: userRemoteValue !== undefined ? { value: this.remoteUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.remoteUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tworkspace: workspaceValue !== undefined ? { value: this._workspaceConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tworkspaceFolder: workspaceFolderValue !== undefined ? { value: folderConfigurationModel?.freeze().getValue(key), override: overrides.overrideIdentifier ? folderConfigurationModel?.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\t\t\tmemory: memoryValue !== undefined ? { value: memoryConfigurationModel.getValue(key), override: overrides.overrideIdentifier ? memoryConfigurationModel.getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,\n\n\t\t\toverrideIdentifiers: overrideIdentifiers.length ? overrideIdentifiers : undefined\n\t\t};\n\t}\n\n\tprivate _userConfiguration: ConfigurationModel | null = null;\n\tget userConfiguration(): ConfigurationModel {\n\t\tif (!this._userConfiguration) {\n\t\t\tthis._userConfiguration = this._remoteUserConfiguration.isEmpty() ? this._localUserConfiguration : this._localUserConfiguration.merge(this._remoteUserConfiguration);\n\t\t\tif (this._freeze) {\n\t\t\t\tthis._userConfiguration.freeze();\n\t\t\t}\n\t\t}\n\t\treturn this._userConfiguration;\n\t}\n\n\tget localUserConfiguration(): ConfigurationModel {\n\t\treturn this._localUserConfiguration;\n\t}\n\n\tget remoteUserConfiguration(): ConfigurationModel {\n\t\treturn this._remoteUserConfiguration;\n\t}\n\n\tprivate getConsolidateConfigurationModel(overrides: IConfigurationOverrides, workspace: Workspace | undefined): ConfigurationModel {\n\t\tlet configurationModel = this.getConsolidatedConfigurationModelForResource(overrides, workspace);\n\t\treturn overrides.overrideIdentifier ? configurationModel.override(overrides.overrideIdentifier) : configurationModel;\n\t}\n\n\tprivate getConsolidatedConfigurationModelForResource({ resource }: IConfigurationOverrides, workspace: Workspace | undefined): ConfigurationModel {\n\t\tlet consolidateConfiguration = this.getWorkspaceConsolidatedConfiguration();\n\n\t\tif (workspace && resource) {\n\t\t\tconst root = workspace.getFolder(resource);\n\t\t\tif (root) {\n\t\t\t\tconsolidateConfiguration = this.getFolderConsolidatedConfiguration(root.uri) || consolidateConfiguration;\n\t\t\t}\n\t\t\tconst memoryConfigurationForResource = this._memoryConfigurationByResource.get(resource);\n\t\t\tif (memoryConfigurationForResource) {\n\t\t\t\tconsolidateConfiguration = consolidateConfiguration.merge(memoryConfigurationForResource);\n\t\t\t}\n\t\t}\n\n\t\treturn consolidateConfiguration;\n\t}\n\n\tprivate getWorkspaceConsolidatedConfiguration(): ConfigurationModel {\n\t\tif (!this._workspaceConsolidatedConfiguration) {\n\t\t\tthis._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(this.userConfiguration, this._workspaceConfiguration, this._memoryConfiguration);\n\t\t\tif (this._freeze) {\n\t\t\t\tthis._workspaceConfiguration = this._workspaceConfiguration.freeze();\n\t\t\t}\n\t\t}\n\t\treturn this._workspaceConsolidatedConfiguration;\n\t}\n\n\tprivate getFolderConsolidatedConfiguration(folder: URI): ConfigurationModel {\n\t\tlet folderConsolidatedConfiguration = this._foldersConsolidatedConfigurations.get(folder);\n\t\tif (!folderConsolidatedConfiguration) {\n\t\t\tconst workspaceConsolidateConfiguration = this.getWorkspaceConsolidatedConfiguration();\n\t\t\tconst folderConfiguration = this._folderConfigurations.get(folder);\n\t\t\tif (folderConfiguration) {\n\t\t\t\tfolderConsolidatedConfiguration = workspaceConsolidateConfiguration.merge(folderConfiguration);\n\t\t\t\tif (this._freeze) {\n\t\t\t\t\tfolderConsolidatedConfiguration = folderConsolidatedConfiguration.freeze();\n\t\t\t\t}\n\t\t\t\tthis._foldersConsolidatedConfigurations.set(folder, folderConsolidatedConfiguration);\n\t\t\t} else {\n\t\t\t\tfolderConsolidatedConfiguration = workspaceConsolidateConfiguration;\n\t\t\t}\n\t\t}\n\t\treturn folderConsolidatedConfiguration;\n\t}\n\n\tprivate getFolderConfigurationModelForResource(resource: URI | null | undefined, workspace: Workspace | undefined): ConfigurationModel | undefined {\n\t\tif (workspace && resource) {\n\t\t\tconst root = workspace.getFolder(resource);\n\t\t\tif (root) {\n\t\t\t\treturn this._folderConfigurations.get(root.uri);\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\ttoData(): IConfigurationData {\n\t\treturn {\n\t\t\tdefaults: {\n\t\t\t\tcontents: this._defaultConfiguration.contents,\n\t\t\t\toverrides: this._defaultConfiguration.overrides,\n\t\t\t\tkeys: this._defaultConfiguration.keys\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\tcontents: this.userConfiguration.contents,\n\t\t\t\toverrides: this.userConfiguration.overrides,\n\t\t\t\tkeys: this.userConfiguration.keys\n\t\t\t},\n\t\t\tworkspace: {\n\t\t\t\tcontents: this._workspaceConfiguration.contents,\n\t\t\t\toverrides: this._workspaceConfiguration.overrides,\n\t\t\t\tkeys: this._workspaceConfiguration.keys\n\t\t\t},\n\t\t\tfolders: [...this._folderConfigurations.keys()].reduce<[UriComponents, IConfigurationModel][]>((result, folder) => {\n\t\t\t\tconst { contents, overrides, keys } = this._folderConfigurations.get(folder)!;\n\t\t\t\tresult.push([folder, { contents, overrides, keys }]);\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t};\n\t}\n\n\tstatic parse(data: IConfigurationData): Configuration {\n\t\tconst defaultConfiguration = this.parseConfigurationModel(data.defaults);\n\t\tconst userConfiguration = this.parseConfigurationModel(data.user);\n\t\tconst workspaceConfiguration = this.parseConfigurationModel(data.workspace);\n\t\tconst folders: ResourceMap<ConfigurationModel> = data.folders.reduce((result, value) => {\n\t\t\tresult.set(URI.revive(value[0]), this.parseConfigurationModel(value[1]));\n\t\t\treturn result;\n\t\t}, new ResourceMap<ConfigurationModel>());\n\t\treturn new Configuration(defaultConfiguration, userConfiguration, new ConfigurationModel(), workspaceConfiguration, folders, new ConfigurationModel(), new ResourceMap<ConfigurationModel>(), false);\n\t}\n\n\tprivate static parseConfigurationModel(model: IConfigurationModel): ConfigurationModel {\n\t\treturn new ConfigurationModel(model.contents, model.keys, model.overrides).freeze();\n\t}\n\n}\n\nexport class ConfigurationChangeEvent implements IConfigurationChangeEvent {\n\n\tprivate readonly affectedKeysTree: any;\n\treadonly affectedKeys: string[];\n\tsource!: ConfigurationTarget;\n\tsourceConfig: any;\n\n\tconstructor(readonly change: IConfigurationChange, private readonly previous: { workspace?: Workspace; data: IConfigurationData } | undefined, private readonly currentConfiguraiton: Configuration, private readonly currentWorkspace?: Workspace) {\n\t\tconst keysSet = new Set<string>();\n\t\tchange.keys.forEach(key => keysSet.add(key));\n\t\tchange.overrides.forEach(([, keys]) => keys.forEach(key => keysSet.add(key)));\n\t\tthis.affectedKeys = [...keysSet.values()];\n\n\t\tconst configurationModel = new ConfigurationModel();\n\t\tthis.affectedKeys.forEach(key => configurationModel.setValue(key, {}));\n\t\tthis.affectedKeysTree = configurationModel.contents;\n\t}\n\n\tprivate _previousConfiguration: Configuration | undefined = undefined;\n\tget previousConfiguration(): Configuration | undefined {\n\t\tif (!this._previousConfiguration && this.previous) {\n\t\t\tthis._previousConfiguration = Configuration.parse(this.previous.data);\n\t\t}\n\t\treturn this._previousConfiguration;\n\t}\n\n\taffectsConfiguration(section: string, overrides?: IConfigurationOverrides): boolean {\n\t\tif (this.doesAffectedKeysTreeContains(this.affectedKeysTree, section)) {\n\t\t\tif (overrides) {\n\t\t\t\tconst value1 = this.previousConfiguration ? this.previousConfiguration.getValue(section, overrides, this.previous?.workspace) : undefined;\n\t\t\t\tconst value2 = this.currentConfiguraiton.getValue(section, overrides, this.currentWorkspace);\n\t\t\t\treturn !objects.equals(value1, value2);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate doesAffectedKeysTreeContains(affectedKeysTree: any, section: string): boolean {\n\t\tlet requestedTree = toValuesTree({ [section]: true }, () => { });\n\n\t\tlet key;\n\t\twhile (typeof requestedTree === 'object' && (key = Object.keys(requestedTree)[0])) { // Only one key should present, since we added only one property\n\t\t\taffectedKeysTree = affectedKeysTree[key];\n\t\t\tif (!affectedKeysTree) {\n\t\t\t\treturn false; // Requested tree is not found\n\t\t\t}\n\t\t\trequestedTree = requestedTree[key];\n\t\t}\n\t\treturn true;\n\t}\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 { KeyCode } from 'vs/base/common/keyCodes';\nimport { createKeybinding, Keybinding, SimpleKeybinding, ScanCodeBinding } from 'vs/base/common/keybindings';\nimport { OperatingSystem, OS } from 'vs/base/common/platform';\nimport { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport interface IKeybindingItem {\n\tkeybinding: (SimpleKeybinding | ScanCodeBinding)[];\n\tcommand: string;\n\tcommandArgs?: any;\n\twhen: ContextKeyExpression | null | undefined;\n\tweight1: number;\n\tweight2: number;\n\textensionId: string | null;\n\tisBuiltinExtension: boolean;\n}\n\nexport interface IKeybindings {\n\tprimary?: number;\n\tsecondary?: number[];\n\twin?: {\n\t\tprimary: number;\n\t\tsecondary?: number[];\n\t};\n\tlinux?: {\n\t\tprimary: number;\n\t\tsecondary?: number[];\n\t};\n\tmac?: {\n\t\tprimary: number;\n\t\tsecondary?: number[];\n\t};\n}\n\nexport interface IKeybindingRule extends IKeybindings {\n\tid: string;\n\tweight: number;\n\targs?: any;\n\twhen?: ContextKeyExpression | null | undefined;\n}\n\nexport const enum KeybindingWeight {\n\tEditorCore = 0,\n\tEditorContrib = 100,\n\tWorkbenchContrib = 200,\n\tBuiltinExtension = 300,\n\tExternalExtension = 400\n}\n\nexport interface ICommandAndKeybindingRule extends IKeybindingRule {\n\thandler: ICommandHandler;\n}\n\nexport interface IKeybindingsRegistry {\n\tregisterKeybindingRule(rule: IKeybindingRule): void;\n\tregisterCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void;\n\tgetDefaultKeybindings(): IKeybindingItem[];\n}\n\nclass KeybindingsRegistryImpl implements IKeybindingsRegistry {\n\n\tprivate _coreKeybindings: IKeybindingItem[];\n\tprivate _extensionKeybindings: IKeybindingItem[];\n\tprivate _cachedMergedKeybindings: IKeybindingItem[] | null;\n\n\tconstructor() {\n\t\tthis._coreKeybindings = [];\n\t\tthis._extensionKeybindings = [];\n\t\tthis._cachedMergedKeybindings = null;\n\t}\n\n\t/**\n\t * Take current platform into account and reduce to primary & secondary.\n\t */\n\tprivate static bindToCurrentPlatform(kb: IKeybindings): { primary?: number; secondary?: number[] } {\n\t\tif (OS === OperatingSystem.Windows) {\n\t\t\tif (kb && kb.win) {\n\t\t\t\treturn kb.win;\n\t\t\t}\n\t\t} else if (OS === OperatingSystem.Macintosh) {\n\t\t\tif (kb && kb.mac) {\n\t\t\t\treturn kb.mac;\n\t\t\t}\n\t\t} else {\n\t\t\tif (kb && kb.linux) {\n\t\t\t\treturn kb.linux;\n\t\t\t}\n\t\t}\n\n\t\treturn kb;\n\t}\n\n\tpublic registerKeybindingRule(rule: IKeybindingRule): void {\n\t\tconst actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform(rule);\n\n\t\tif (actualKb && actualKb.primary) {\n\t\t\tconst kk = createKeybinding(actualKb.primary, OS);\n\t\t\tif (kk) {\n\t\t\t\tthis._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, 0, rule.when);\n\t\t\t}\n\t\t}\n\n\t\tif (actualKb && Array.isArray(actualKb.secondary)) {\n\t\t\tfor (let i = 0, len = actualKb.secondary.length; i < len; i++) {\n\t\t\t\tconst k = actualKb.secondary[i];\n\t\t\t\tconst kk = createKeybinding(k, OS);\n\t\t\t\tif (kk) {\n\t\t\t\t\tthis._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, -i - 1, rule.when);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void {\n\t\tthis.registerKeybindingRule(desc);\n\t\tCommandsRegistry.registerCommand(desc);\n\t}\n\n\tprivate static _mightProduceChar(keyCode: KeyCode): boolean {\n\t\tif (keyCode >= KeyCode.Digit0 && keyCode <= KeyCode.Digit9) {\n\t\t\treturn true;\n\t\t}\n\t\tif (keyCode >= KeyCode.KeyA && keyCode <= KeyCode.KeyZ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\tkeyCode === KeyCode.Semicolon\n\t\t\t|| keyCode === KeyCode.Equal\n\t\t\t|| keyCode === KeyCode.Comma\n\t\t\t|| keyCode === KeyCode.Minus\n\t\t\t|| keyCode === KeyCode.Period\n\t\t\t|| keyCode === KeyCode.Slash\n\t\t\t|| keyCode === KeyCode.Backquote\n\t\t\t|| keyCode === KeyCode.ABNT_C1\n\t\t\t|| keyCode === KeyCode.ABNT_C2\n\t\t\t|| keyCode === KeyCode.BracketLeft\n\t\t\t|| keyCode === KeyCode.Backslash\n\t\t\t|| keyCode === KeyCode.BracketRight\n\t\t\t|| keyCode === KeyCode.Quote\n\t\t\t|| keyCode === KeyCode.OEM_8\n\t\t\t|| keyCode === KeyCode.IntlBackslash\n\t\t);\n\t}\n\n\tprivate _assertNoCtrlAlt(keybinding: SimpleKeybinding, commandId: string): void {\n\t\tif (keybinding.ctrlKey && keybinding.altKey && !keybinding.metaKey) {\n\t\t\tif (KeybindingsRegistryImpl._mightProduceChar(keybinding.keyCode)) {\n\t\t\t\tconsole.warn('Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ', keybinding, ' for ', commandId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _registerDefaultKeybinding(keybinding: Keybinding, commandId: string, commandArgs: any, weight1: number, weight2: number, when: ContextKeyExpression | null | undefined): void {\n\t\tif (OS === OperatingSystem.Windows) {\n\t\t\tthis._assertNoCtrlAlt(keybinding.parts[0], commandId);\n\t\t}\n\t\tthis._coreKeybindings.push({\n\t\t\tkeybinding: keybinding.parts,\n\t\t\tcommand: commandId,\n\t\t\tcommandArgs: commandArgs,\n\t\t\twhen: when,\n\t\t\tweight1: weight1,\n\t\t\tweight2: weight2,\n\t\t\textensionId: null,\n\t\t\tisBuiltinExtension: false\n\t\t});\n\t\tthis._cachedMergedKeybindings = null;\n\t}\n\n\tpublic getDefaultKeybindings(): IKeybindingItem[] {\n\t\tif (!this._cachedMergedKeybindings) {\n\t\t\tthis._cachedMergedKeybindings = (<IKeybindingItem[]>[]).concat(this._coreKeybindings).concat(this._extensionKeybindings);\n\t\t\tthis._cachedMergedKeybindings.sort(sorter);\n\t\t}\n\t\treturn this._cachedMergedKeybindings.slice(0);\n\t}\n}\nexport const KeybindingsRegistry: IKeybindingsRegistry = new KeybindingsRegistryImpl();\n\n// Define extension point ids\nexport const Extensions = {\n\tEditorModes: 'platform.keybindingsRegistry'\n};\nRegistry.add(Extensions.EditorModes, KeybindingsRegistry);\n\nfunction sorter(a: IKeybindingItem, b: IKeybindingItem): number {\n\tif (a.weight1 !== b.weight1) {\n\t\treturn a.weight1 - b.weight1;\n\t}\n\tif (a.command < b.command) {\n\t\treturn -1;\n\t}\n\tif (a.command > b.command) {\n\t\treturn 1;\n\t}\n\treturn a.weight2 - b.weight2;\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 { IHistoryNavigationWidget } from 'vs/base/browser/history';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { FindInput, IFindInputOptions } from 'vs/base/browser/ui/findinput/findInput';\nimport { IReplaceInputOptions, ReplaceInput } from 'vs/base/browser/ui/findinput/replaceInput';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, IContextKeyServiceTarget, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { localize } from 'vs/nls';\n\nexport const historyNavigationVisible = new RawContextKey<boolean>('suggestWidgetVisible', false, localize('suggestWidgetVisible', \"Whether suggestion are visible\"));\n\nexport const HistoryNavigationWidgetContext = 'historyNavigationWidget';\nconst HistoryNavigationForwardsEnablementContext = 'historyNavigationForwardsEnabled';\nconst HistoryNavigationBackwardsEnablementContext = 'historyNavigationBackwardsEnabled';\n\nfunction bindContextScopedWidget(contextKeyService: IContextKeyService, widget: IContextScopedWidget, contextKey: string): void {\n\tnew RawContextKey<IContextScopedWidget>(contextKey, widget).bindTo(contextKeyService);\n}\n\nfunction createWidgetScopedContextKeyService(contextKeyService: IContextKeyService, widget: IContextScopedWidget): IContextKeyService {\n\treturn contextKeyService.createScoped(widget.target);\n}\n\nfunction getContextScopedWidget<T extends IContextScopedWidget>(contextKeyService: IContextKeyService, contextKey: string): T | undefined {\n\treturn contextKeyService.getContext(document.activeElement).getValue(contextKey);\n}\n\ninterface IContextScopedWidget {\n\treadonly target: IContextKeyServiceTarget;\n}\n\nexport interface IContextScopedHistoryNavigationWidget extends IContextScopedWidget {\n\thistoryNavigator: IHistoryNavigationWidget;\n}\n\nexport interface IHistoryNavigationContext {\n\tscopedContextKeyService: IContextKeyService;\n\thistoryNavigationForwardsEnablement: IContextKey<boolean>;\n\thistoryNavigationBackwardsEnablement: IContextKey<boolean>;\n}\n\nexport function createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService: IContextKeyService, widget: IContextScopedHistoryNavigationWidget): IHistoryNavigationContext {\n\tconst scopedContextKeyService = createWidgetScopedContextKeyService(contextKeyService, widget);\n\tbindContextScopedWidget(scopedContextKeyService, widget, HistoryNavigationWidgetContext);\n\tconst historyNavigationForwardsEnablement = new RawContextKey<boolean>(HistoryNavigationForwardsEnablementContext, true).bindTo(scopedContextKeyService);\n\tconst historyNavigationBackwardsEnablement = new RawContextKey<boolean>(HistoryNavigationBackwardsEnablementContext, true).bindTo(scopedContextKeyService);\n\treturn {\n\t\tscopedContextKeyService,\n\t\thistoryNavigationForwardsEnablement,\n\t\thistoryNavigationBackwardsEnablement,\n\t};\n}\n\nexport class ContextScopedFindInput extends FindInput {\n\n\tconstructor(container: HTMLElement | null, contextViewProvider: IContextViewProvider, options: IFindInputOptions,\n\t\t@IContextKeyService contextKeyService: IContextKeyService, showFindOptions: boolean = false\n\t) {\n\t\tsuper(container, contextViewProvider, showFindOptions, options);\n\t\tthis._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, <IContextScopedHistoryNavigationWidget>{ target: this.inputBox.element, historyNavigator: this.inputBox }).scopedContextKeyService);\n\t}\n}\n\nexport class ContextScopedReplaceInput extends ReplaceInput {\n\n\tconstructor(container: HTMLElement | null, contextViewProvider: IContextViewProvider | undefined, options: IReplaceInputOptions,\n\t\t@IContextKeyService contextKeyService: IContextKeyService, showReplaceOptions: boolean = false\n\t) {\n\t\tsuper(container, contextViewProvider, showReplaceOptions, options);\n\t\tthis._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, <IContextScopedHistoryNavigationWidget>{ target: this.inputBox.element, historyNavigator: this.inputBox }).scopedContextKeyService);\n\t}\n\n}\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'history.showPrevious',\n\tweight: KeybindingWeight.WorkbenchContrib,\n\twhen: ContextKeyExpr.and(\n\t\tContextKeyExpr.has(HistoryNavigationWidgetContext),\n\t\tContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext, true),\n\t\thistoryNavigationVisible.isEqualTo(false),\n\t),\n\tprimary: KeyCode.UpArrow,\n\tsecondary: [KeyMod.Alt | KeyCode.UpArrow],\n\thandler: (accessor) => {\n\t\tconst widget = getContextScopedWidget<IContextScopedHistoryNavigationWidget>(accessor.get(IContextKeyService), HistoryNavigationWidgetContext);\n\t\tif (widget) {\n\t\t\tconst historyInputBox: IHistoryNavigationWidget = widget.historyNavigator;\n\t\t\thistoryInputBox.showPreviousValue();\n\t\t}\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'history.showNext',\n\tweight: KeybindingWeight.WorkbenchContrib,\n\twhen: ContextKeyExpr.and(\n\t\tContextKeyExpr.has(HistoryNavigationWidgetContext),\n\t\tContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext, true),\n\t\thistoryNavigationVisible.isEqualTo(false),\n\t),\n\tprimary: KeyCode.DownArrow,\n\tsecondary: [KeyMod.Alt | KeyCode.DownArrow],\n\thandler: (accessor) => {\n\t\tconst widget = getContextScopedWidget<IContextScopedHistoryNavigationWidget>(accessor.get(IContextKeyService), HistoryNavigationWidgetContext);\n\t\tif (widget) {\n\t\t\tconst historyInputBox: IHistoryNavigationWidget = widget.historyNavigator;\n\t\t\thistoryInputBox.showNextValue();\n\t\t}\n\t}\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 { coalesce } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ItemActivation } from 'vs/base/parts/quickinput/common/quickInput';\nimport { IQuickNavigateConfiguration, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport interface IQuickAccessOptions {\n\n\t/**\n\t * Allows to enable quick navigate support in quick input.\n\t */\n\tquickNavigateConfiguration?: IQuickNavigateConfiguration;\n\n\t/**\n\t * Allows to configure a different item activation strategy.\n\t * By default the first item in the list will get activated.\n\t */\n\titemActivation?: ItemActivation;\n\n\t/**\n\t * Whether to take the input value as is and not restore it\n\t * from any existing value if quick access is visible.\n\t */\n\tpreserveValue?: boolean;\n}\n\nexport interface IQuickAccessController {\n\n\t/**\n\t * Open the quick access picker with the optional value prefilled.\n\t */\n\tshow(value?: string, options?: IQuickAccessOptions): void;\n}\n\nexport enum DefaultQuickAccessFilterValue {\n\n\t/**\n\t * Keep the value as it is given to quick access.\n\t */\n\tPRESERVE = 0,\n\n\t/**\n\t * Use the value that was used last time something was accepted from the picker.\n\t */\n\tLAST = 1\n}\n\nexport interface IQuickAccessProvider {\n\n\t/**\n\t * Allows to set a default filter value when the provider opens. This can be:\n\t * - `undefined` to not specify any default value\n\t * - `DefaultFilterValues.PRESERVE` to use the value that was last typed\n\t * - `string` for the actual value to use\n\t *\n\t * Note: the default filter will only be used if quick access was opened with\n\t * the exact prefix of the provider. Otherwise the filter value is preserved.\n\t */\n\treadonly defaultFilterValue?: string | DefaultQuickAccessFilterValue;\n\n\t/**\n\t * Called whenever a prefix was typed into quick pick that matches the provider.\n\t *\n\t * @param picker the picker to use for showing provider results. The picker is\n\t * automatically shown after the method returns, no need to call `show()`.\n\t * @param token providers have to check the cancellation token everytime after\n\t * a long running operation or from event handlers because it could be that the\n\t * picker has been closed or changed meanwhile. The token can be used to find out\n\t * that the picker was closed without picking an entry (e.g. was canceled by the user).\n\t * @return a disposable that will automatically be disposed when the picker\n\t * closes or is replaced by another picker.\n\t */\n\tprovide(picker: IQuickPick<IQuickPickItem>, token: CancellationToken): IDisposable;\n}\n\nexport interface IQuickAccessProviderHelp {\n\n\t/**\n\t * The prefix to show for the help entry. If not provided,\n\t * the prefix used for registration will be taken.\n\t */\n\tprefix?: string;\n\n\t/**\n\t * A description text to help understand the intent of the provider.\n\t */\n\tdescription: string;\n\n\t/**\n\t * Separation between provider for editors and global ones.\n\t */\n\tneedsEditor: boolean;\n}\n\nexport interface IQuickAccessProviderDescriptor {\n\n\t/**\n\t * The actual provider that will be instantiated as needed.\n\t */\n\treadonly ctor: { new(...services: any /* TS BrandedService but no clue how to type this properly */[]): IQuickAccessProvider };\n\n\t/**\n\t * The prefix for quick access picker to use the provider for.\n\t */\n\treadonly prefix: string;\n\n\t/**\n\t * A placeholder to use for the input field when the provider is active.\n\t * This will also be read out by screen readers and thus helps for\n\t * accessibility.\n\t */\n\treadonly placeholder?: string;\n\n\t/**\n\t * Documentation for the provider in the quick access help.\n\t */\n\treadonly helpEntries: IQuickAccessProviderHelp[];\n\n\t/**\n\t * A context key that will be set automatically when the\n\t * picker for the provider is showing.\n\t */\n\treadonly contextKey?: string;\n}\n\nexport const Extensions = {\n\tQuickaccess: 'workbench.contributions.quickaccess'\n};\n\nexport interface IQuickAccessRegistry {\n\n\t/**\n\t * Registers a quick access provider to the platform.\n\t */\n\tregisterQuickAccessProvider(provider: IQuickAccessProviderDescriptor): IDisposable;\n\n\t/**\n\t * Get all registered quick access providers.\n\t */\n\tgetQuickAccessProviders(): IQuickAccessProviderDescriptor[];\n\n\t/**\n\t * Get a specific quick access provider for a given prefix.\n\t */\n\tgetQuickAccessProvider(prefix: string): IQuickAccessProviderDescriptor | undefined;\n}\n\nexport class QuickAccessRegistry implements IQuickAccessRegistry {\n\tprivate providers: IQuickAccessProviderDescriptor[] = [];\n\tprivate defaultProvider: IQuickAccessProviderDescriptor | undefined = undefined;\n\n\tregisterQuickAccessProvider(provider: IQuickAccessProviderDescriptor): IDisposable {\n\n\t\t// Extract the default provider when no prefix is present\n\t\tif (provider.prefix.length === 0) {\n\t\t\tthis.defaultProvider = provider;\n\t\t} else {\n\t\t\tthis.providers.push(provider);\n\t\t}\n\n\t\t// sort the providers by decreasing prefix length, such that longer\n\t\t// prefixes take priority: 'ext' vs 'ext install' - the latter should win\n\t\tthis.providers.sort((providerA, providerB) => providerB.prefix.length - providerA.prefix.length);\n\n\t\treturn toDisposable(() => {\n\t\t\tthis.providers.splice(this.providers.indexOf(provider), 1);\n\n\t\t\tif (this.defaultProvider === provider) {\n\t\t\t\tthis.defaultProvider = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tgetQuickAccessProviders(): IQuickAccessProviderDescriptor[] {\n\t\treturn coalesce([this.defaultProvider, ...this.providers]);\n\t}\n\n\tgetQuickAccessProvider(prefix: string): IQuickAccessProviderDescriptor | undefined {\n\t\tconst result = prefix ? (this.providers.find(provider => prefix.startsWith(provider.prefix)) || undefined) : undefined;\n\n\t\treturn result || this.defaultProvider;\n\t}\n}\n\nRegistry.add(Extensions.Quickaccess, new QuickAccessRegistry());\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 { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { localize } from 'vs/nls';\nimport { Extensions, IQuickAccessProvider, IQuickAccessRegistry } from 'vs/platform/quickinput/common/quickAccess';\nimport { IQuickInputService, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\ninterface IHelpQuickAccessPickItem extends IQuickPickItem {\n\tprefix: string;\n}\n\nexport class HelpQuickAccessProvider implements IQuickAccessProvider {\n\n\tstatic PREFIX = '?';\n\n\tprivate readonly registry = Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess);\n\n\tconstructor(@IQuickInputService private readonly quickInputService: IQuickInputService) { }\n\n\tprovide(picker: IQuickPick<IHelpQuickAccessPickItem>): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Open a picker with the selected value if picked\n\t\tdisposables.add(picker.onDidAccept(() => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tthis.quickInputService.quickAccess.show(item.prefix, { preserveValue: true });\n\t\t\t}\n\t\t}));\n\n\t\t// Also open a picker when we detect the user typed the exact\n\t\t// name of a provider (e.g. `?term` for terminals)\n\t\tdisposables.add(picker.onDidChangeValue(value => {\n\t\t\tconst providerDescriptor = this.registry.getQuickAccessProvider(value.substr(HelpQuickAccessProvider.PREFIX.length));\n\t\t\tif (providerDescriptor && providerDescriptor.prefix && providerDescriptor.prefix !== HelpQuickAccessProvider.PREFIX) {\n\t\t\t\tthis.quickInputService.quickAccess.show(providerDescriptor.prefix, { preserveValue: true });\n\t\t\t}\n\t\t}));\n\n\t\t// Fill in all providers separated by editor/global scope\n\t\tconst { editorProviders, globalProviders } = this.getQuickAccessProviders();\n\t\tpicker.items = editorProviders.length === 0 || globalProviders.length === 0 ?\n\n\t\t\t// Without groups\n\t\t\t[\n\t\t\t\t...(editorProviders.length === 0 ? globalProviders : editorProviders)\n\t\t\t] :\n\n\t\t\t// With groups\n\t\t\t[\n\t\t\t\t{ label: localize('globalCommands', \"global commands\"), type: 'separator' },\n\t\t\t\t...globalProviders,\n\t\t\t\t{ label: localize('editorCommands', \"editor commands\"), type: 'separator' },\n\t\t\t\t...editorProviders\n\t\t\t];\n\n\t\treturn disposables;\n\t}\n\n\tprivate getQuickAccessProviders(): { editorProviders: IHelpQuickAccessPickItem[]; globalProviders: IHelpQuickAccessPickItem[] } {\n\t\tconst globalProviders: IHelpQuickAccessPickItem[] = [];\n\t\tconst editorProviders: IHelpQuickAccessPickItem[] = [];\n\n\t\tfor (const provider of this.registry.getQuickAccessProviders().sort((providerA, providerB) => providerA.prefix.localeCompare(providerB.prefix))) {\n\t\t\tif (provider.prefix === HelpQuickAccessProvider.PREFIX) {\n\t\t\t\tcontinue; // exclude help which is already active\n\t\t\t}\n\n\t\t\tfor (const helpEntry of provider.helpEntries) {\n\t\t\t\tconst prefix = helpEntry.prefix || provider.prefix;\n\t\t\t\tconst label = prefix || '\\u2026' /* ... */;\n\n\t\t\t\t(helpEntry.needsEditor ? editorProviders : globalProviders).push({\n\t\t\t\t\tprefix,\n\t\t\t\t\tlabel,\n\t\t\t\t\tariaLabel: localize('helpPickAriaLabel', \"{0}, {1}\", label, helpEntry.description),\n\t\t\t\t\tdescription: helpEntry.description\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn { editorProviders, globalProviders };\n\t}\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 { Registry } from 'vs/platform/registry/common/platform';\nimport { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';\nimport { QuickHelpNLS } from 'vs/editor/common/standaloneStrings';\nimport { HelpQuickAccessProvider } from 'vs/platform/quickinput/browser/helpQuickAccess';\n\nRegistry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({\n\tctor: HelpQuickAccessProvider,\n\tprefix: '',\n\thelpEntries: [{ description: QuickHelpNLS.helpQuickAccessActionLabel, needsEditor: true }]\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 { DeferredPromise } from 'vs/base/common/async';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { once } from 'vs/base/common/functional';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { DefaultQuickAccessFilterValue, Extensions, IQuickAccessController, IQuickAccessOptions, IQuickAccessProvider, IQuickAccessProviderDescriptor, IQuickAccessRegistry } from 'vs/platform/quickinput/common/quickAccess';\nimport { IQuickInputService, IQuickPick, IQuickPickItem, ItemActivation } from 'vs/platform/quickinput/common/quickInput';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport class QuickAccessController extends Disposable implements IQuickAccessController {\n\n\tprivate readonly registry = Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess);\n\tprivate readonly mapProviderToDescriptor = new Map<IQuickAccessProviderDescriptor, IQuickAccessProvider>();\n\n\tprivate readonly lastAcceptedPickerValues = new Map<IQuickAccessProviderDescriptor, string>();\n\n\tprivate visibleQuickAccess: {\n\t\tpicker: IQuickPick<IQuickPickItem>;\n\t\tdescriptor: IQuickAccessProviderDescriptor | undefined;\n\t\tvalue: string;\n\t} | undefined = undefined;\n\n\tconstructor(\n\t\t@IQuickInputService private readonly quickInputService: IQuickInputService,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\t}\n\n\tshow(value = '', options?: IQuickAccessOptions): void {\n\t\tthis.doShowOrPick(value, false, options);\n\t}\n\n\tprivate doShowOrPick(value: string, pick: true, options?: IQuickAccessOptions): Promise<IQuickPickItem[] | undefined>;\n\tprivate doShowOrPick(value: string, pick: false, options?: IQuickAccessOptions): void;\n\tprivate doShowOrPick(value: string, pick: boolean, options?: IQuickAccessOptions): Promise<IQuickPickItem[] | undefined> | void {\n\n\t\t// Find provider for the value to show\n\t\tconst [provider, descriptor] = this.getOrInstantiateProvider(value);\n\n\t\t// Return early if quick access is already showing on that same prefix\n\t\tconst visibleQuickAccess = this.visibleQuickAccess;\n\t\tconst visibleDescriptor = visibleQuickAccess?.descriptor;\n\t\tif (visibleQuickAccess && descriptor && visibleDescriptor === descriptor) {\n\n\t\t\t// Apply value only if it is more specific than the prefix\n\t\t\t// from the provider and we are not instructed to preserve\n\t\t\tif (value !== descriptor.prefix && !options?.preserveValue) {\n\t\t\t\tvisibleQuickAccess.picker.value = value;\n\t\t\t}\n\n\t\t\t// Always adjust selection\n\t\t\tthis.adjustValueSelection(visibleQuickAccess.picker, descriptor, options);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Rewrite the filter value based on certain rules unless disabled\n\t\tif (descriptor && !options?.preserveValue) {\n\t\t\tlet newValue: string | undefined = undefined;\n\n\t\t\t// If we have a visible provider with a value, take it's filter value but\n\t\t\t// rewrite to new provider prefix in case they differ\n\t\t\tif (visibleQuickAccess && visibleDescriptor && visibleDescriptor !== descriptor) {\n\t\t\t\tconst newValueCandidateWithoutPrefix = visibleQuickAccess.value.substr(visibleDescriptor.prefix.length);\n\t\t\t\tif (newValueCandidateWithoutPrefix) {\n\t\t\t\t\tnewValue = `${descriptor.prefix}${newValueCandidateWithoutPrefix}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise, take a default value as instructed\n\t\t\tif (!newValue) {\n\t\t\t\tconst defaultFilterValue = provider?.defaultFilterValue;\n\t\t\t\tif (defaultFilterValue === DefaultQuickAccessFilterValue.LAST) {\n\t\t\t\t\tnewValue = this.lastAcceptedPickerValues.get(descriptor);\n\t\t\t\t} else if (typeof defaultFilterValue === 'string') {\n\t\t\t\t\tnewValue = `${descriptor.prefix}${defaultFilterValue}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof newValue === 'string') {\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t}\n\n\t\t// Create a picker for the provider to use with the initial value\n\t\t// and adjust the filtering to exclude the prefix from filtering\n\t\tconst disposables = new DisposableStore();\n\t\tconst picker = disposables.add(this.quickInputService.createQuickPick());\n\t\tpicker.value = value;\n\t\tthis.adjustValueSelection(picker, descriptor, options);\n\t\tpicker.placeholder = descriptor?.placeholder;\n\t\tpicker.quickNavigate = options?.quickNavigateConfiguration;\n\t\tpicker.hideInput = !!picker.quickNavigate && !visibleQuickAccess; // only hide input if there was no picker opened already\n\t\tif (typeof options?.itemActivation === 'number' || options?.quickNavigateConfiguration) {\n\t\t\tpicker.itemActivation = options?.itemActivation ?? ItemActivation.SECOND /* quick nav is always second */;\n\t\t}\n\t\tpicker.contextKey = descriptor?.contextKey;\n\t\tpicker.filterValue = (value: string) => value.substring(descriptor ? descriptor.prefix.length : 0);\n\t\tif (descriptor?.placeholder) {\n\t\t\tpicker.ariaLabel = descriptor?.placeholder;\n\t\t}\n\n\t\t// Pick mode: setup a promise that can be resolved\n\t\t// with the selected items and prevent execution\n\t\tlet pickPromise: DeferredPromise<IQuickPickItem[]> | undefined = undefined;\n\t\tif (pick) {\n\t\t\tpickPromise = new DeferredPromise<IQuickPickItem[]>();\n\t\t\tdisposables.add(once(picker.onWillAccept)(e => {\n\t\t\t\te.veto();\n\t\t\t\tpicker.hide();\n\t\t\t}));\n\t\t}\n\n\t\t// Register listeners\n\t\tdisposables.add(this.registerPickerListeners(picker, provider, descriptor, value));\n\n\t\t// Ask provider to fill the picker as needed if we have one\n\t\t// and pass over a cancellation token that will indicate when\n\t\t// the picker is hiding without a pick being made.\n\t\tconst cts = disposables.add(new CancellationTokenSource());\n\t\tif (provider) {\n\t\t\tdisposables.add(provider.provide(picker, cts.token));\n\t\t}\n\n\t\t// Finally, trigger disposal and cancellation when the picker\n\t\t// hides depending on items selected or not.\n\t\tonce(picker.onDidHide)(() => {\n\t\t\tif (picker.selectedItems.length === 0) {\n\t\t\t\tcts.cancel();\n\t\t\t}\n\n\t\t\t// Start to dispose once picker hides\n\t\t\tdisposables.dispose();\n\n\t\t\t// Resolve pick promise with selected items\n\t\t\tpickPromise?.complete(picker.selectedItems.slice(0));\n\t\t});\n\n\t\t// Finally, show the picker. This is important because a provider\n\t\t// may not call this and then our disposables would leak that rely\n\t\t// on the onDidHide event.\n\t\tpicker.show();\n\n\t\t// Pick mode: return with promise\n\t\tif (pick) {\n\t\t\treturn pickPromise?.p;\n\t\t}\n\t}\n\n\tprivate adjustValueSelection(picker: IQuickPick<IQuickPickItem>, descriptor?: IQuickAccessProviderDescriptor, options?: IQuickAccessOptions): void {\n\t\tlet valueSelection: [number, number];\n\n\t\t// Preserve: just always put the cursor at the end\n\t\tif (options?.preserveValue) {\n\t\t\tvalueSelection = [picker.value.length, picker.value.length];\n\t\t}\n\n\t\t// Otherwise: select the value up until the prefix\n\t\telse {\n\t\t\tvalueSelection = [descriptor?.prefix.length ?? 0, picker.value.length];\n\t\t}\n\n\t\tpicker.valueSelection = valueSelection;\n\t}\n\n\tprivate registerPickerListeners(picker: IQuickPick<IQuickPickItem>, provider: IQuickAccessProvider | undefined, descriptor: IQuickAccessProviderDescriptor | undefined, value: string): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Remember as last visible picker and clean up once picker get's disposed\n\t\tconst visibleQuickAccess = this.visibleQuickAccess = { picker, descriptor, value };\n\t\tdisposables.add(toDisposable(() => {\n\t\t\tif (visibleQuickAccess === this.visibleQuickAccess) {\n\t\t\t\tthis.visibleQuickAccess = undefined;\n\t\t\t}\n\t\t}));\n\n\t\t// Whenever the value changes, check if the provider has\n\t\t// changed and if so - re-create the picker from the beginning\n\t\tdisposables.add(picker.onDidChangeValue(value => {\n\t\t\tconst [providerForValue] = this.getOrInstantiateProvider(value);\n\t\t\tif (providerForValue !== provider) {\n\t\t\t\tthis.show(value, { preserveValue: true } /* do not rewrite value from user typing! */);\n\t\t\t} else {\n\t\t\t\tvisibleQuickAccess.value = value; // remember the value in our visible one\n\t\t\t}\n\t\t}));\n\n\t\t// Remember picker input for future use when accepting\n\t\tif (descriptor) {\n\t\t\tdisposables.add(picker.onDidAccept(() => {\n\t\t\t\tthis.lastAcceptedPickerValues.set(descriptor, picker.value);\n\t\t\t}));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate getOrInstantiateProvider(value: string): [IQuickAccessProvider | undefined, IQuickAccessProviderDescriptor | undefined] {\n\t\tconst providerDescriptor = this.registry.getQuickAccessProvider(value);\n\t\tif (!providerDescriptor) {\n\t\t\treturn [undefined, undefined];\n\t\t}\n\n\t\tlet provider = this.mapProviderToDescriptor.get(providerDescriptor);\n\t\tif (!provider) {\n\t\t\tprovider = this.instantiationService.createInstance(providerDescriptor.ctor);\n\t\t\tthis.mapProviderToDescriptor.set(providerDescriptor, provider);\n\t\t}\n\n\t\treturn [provider, providerDescriptor];\n\t}\n}\n","\nimport { Emitter, Event, PauseableEmitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { isUndefinedOrNull } from 'vs/base/common/types';\nimport { InMemoryStorageDatabase, IStorage, Storage } from 'vs/base/parts/storage/common/storage';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nconst TARGET_KEY = '__$__targetStorageMarker';\n\nexport const IStorageService = createDecorator<IStorageService>('storageService');\n\nexport enum WillSaveStateReason {\n\n\t/**\n\t * No specific reason to save state.\n\t */\n\tNONE,\n\n\t/**\n\t * A hint that the workbench is about to shutdown.\n\t */\n\tSHUTDOWN\n}\n\nexport interface IWillSaveStateEvent {\n\treason: WillSaveStateReason;\n}\n\nexport interface IStorageService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Emitted when the storage is about to persist. This is the right time\n\t * to persist data to ensure it is stored before the application shuts\n\t * down.\n\t *\n\t * The will save state event allows to optionally ask for the reason of\n\t * saving the state, e.g. to find out if the state is saved due to a\n\t * shutdown.\n\t *\n\t * Note: this event may be fired many times, not only on shutdown to prevent\n\t * loss of state in situations where the shutdown is not sufficient to\n\t * persist the data properly.\n\t */\n\treadonly onWillSaveState: Event<IWillSaveStateEvent>;\n\n\t/**\n\t * Retrieve an element stored with the given key from storage. Use\n\t * the provided `defaultValue` if the element is `null` or `undefined`.\n\t *\n\t * @param scope allows to define the scope of the storage operation\n\t * to either the current workspace only or all workspaces.\n\t */\n\tget(key: string, scope: StorageScope, fallbackValue: string): string;\n\tget(key: string, scope: StorageScope, fallbackValue?: string): string | undefined;\n\n\t/**\n\t * Retrieve an element stored with the given key from storage. Use\n\t * the provided `defaultValue` if the element is `null` or `undefined`.\n\t * The element will be converted to a `boolean`.\n\t *\n\t * @param scope allows to define the scope of the storage operation\n\t * to either the current workspace only or all workspaces.\n\t */\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined;\n\n\t/**\n\t * Retrieve an element stored with the given key from storage. Use\n\t * the provided `defaultValue` if the element is `null` or `undefined`.\n\t * The element will be converted to a `number` using `parseInt` with a\n\t * base of `10`.\n\t *\n\t * @param scope allows to define the scope of the storage operation\n\t * to either the current workspace only or all workspaces.\n\t */\n\tgetNumber(key: string, scope: StorageScope, fallbackValue: number): number;\n\tgetNumber(key: string, scope: StorageScope, fallbackValue?: number): number | undefined;\n\n\t/**\n\t * Store a value under the given key to storage. The value will be\n\t * converted to a `string`. Storing either `undefined` or `null` will\n\t * remove the entry under the key.\n\t *\n\t * @param scope allows to define the scope of the storage operation\n\t * to either the current workspace only or all workspaces.\n\t *\n\t * @param target allows to define the target of the storage operation\n\t * to either the current machine or user.\n\t */\n\tstore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope, target: StorageTarget): void;\n\n\t/**\n\t * Delete an element stored under the provided key from storage.\n\t *\n\t * The scope argument allows to define the scope of the storage\n\t * operation to either the current workspace only or all workspaces.\n\t */\n\tremove(key: string, scope: StorageScope): void;\n}\n\nexport const enum StorageScope {\n\n\t/**\n\t * The stored data will be scoped to all workspaces.\n\t */\n\tGLOBAL,\n\n\t/**\n\t * The stored data will be scoped to the current workspace.\n\t */\n\tWORKSPACE\n}\n\nexport const enum StorageTarget {\n\n\t/**\n\t * The stored data is user specific and applies across machines.\n\t */\n\tUSER,\n\n\t/**\n\t * The stored data is machine specific.\n\t */\n\tMACHINE\n}\n\nexport interface IStorageValueChangeEvent {\n\n\t/**\n\t * The scope for the storage entry that changed\n\t * or was removed.\n\t */\n\treadonly scope: StorageScope;\n\n\t/**\n\t * The `key` of the storage entry that was changed\n\t * or was removed.\n\t */\n\treadonly key: string;\n\n\t/**\n\t * The `target` can be `undefined` if a key is being\n\t * removed.\n\t */\n\treadonly target: StorageTarget | undefined;\n}\n\nexport interface IStorageTargetChangeEvent {\n\n\t/**\n\t * The scope for the target that changed. Listeners\n\t * should use `keys(scope, target)` to get an updated\n\t * list of keys for the given `scope` and `target`.\n\t */\n\treadonly scope: StorageScope;\n}\n\ninterface IKeyTargets {\n\t[key: string]: StorageTarget;\n}\n\nexport interface IStorageServiceOptions {\n\tflushInterval: number;\n}\n\nexport abstract class AbstractStorageService extends Disposable implements IStorageService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate static DEFAULT_FLUSH_INTERVAL = 60 * 1000; // every minute\n\n\tprivate readonly _onDidChangeValue = this._register(new PauseableEmitter<IStorageValueChangeEvent>());\n\n\tprivate readonly _onDidChangeTarget = this._register(new PauseableEmitter<IStorageTargetChangeEvent>());\n\n\tprivate readonly _onWillSaveState = this._register(new Emitter<IWillSaveStateEvent>());\n\treadonly onWillSaveState = this._onWillSaveState.event;\n\n\tconstructor(private readonly options: IStorageServiceOptions = { flushInterval: AbstractStorageService.DEFAULT_FLUSH_INTERVAL }) {\n\t\tsuper();\n\t}\n\n\tprotected emitDidChangeValue(scope: StorageScope, key: string): void {\n\n\t\t// Specially handle `TARGET_KEY`\n\t\tif (key === TARGET_KEY) {\n\n\t\t\t// Clear our cached version which is now out of date\n\t\t\tif (scope === StorageScope.GLOBAL) {\n\t\t\t\tthis._globalKeyTargets = undefined;\n\t\t\t} else if (scope === StorageScope.WORKSPACE) {\n\t\t\t\tthis._workspaceKeyTargets = undefined;\n\t\t\t}\n\n\t\t\t// Emit as `didChangeTarget` event\n\t\t\tthis._onDidChangeTarget.fire({ scope });\n\t\t}\n\n\t\t// Emit any other key to outside\n\t\telse {\n\t\t\tthis._onDidChangeValue.fire({ scope, key, target: this.getKeyTargets(scope)[key] });\n\t\t}\n\t}\n\n\tget(key: string, scope: StorageScope, fallbackValue: string): string;\n\tget(key: string, scope: StorageScope): string | undefined;\n\tget(key: string, scope: StorageScope, fallbackValue?: string): string | undefined {\n\t\treturn this.getStorage(scope)?.get(key, fallbackValue);\n\t}\n\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, scope: StorageScope): boolean | undefined;\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined {\n\t\treturn this.getStorage(scope)?.getBoolean(key, fallbackValue);\n\t}\n\n\tgetNumber(key: string, scope: StorageScope, fallbackValue: number): number;\n\tgetNumber(key: string, scope: StorageScope): number | undefined;\n\tgetNumber(key: string, scope: StorageScope, fallbackValue?: number): number | undefined {\n\t\treturn this.getStorage(scope)?.getNumber(key, fallbackValue);\n\t}\n\n\tstore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope, target: StorageTarget): void {\n\n\t\t// We remove the key for undefined/null values\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\tthis.remove(key, scope);\n\t\t\treturn;\n\t\t}\n\n\t\t// Update our datastructures but send events only after\n\t\tthis.withPausedEmitters(() => {\n\n\t\t\t// Update key-target map\n\t\t\tthis.updateKeyTarget(key, scope, target);\n\n\t\t\t// Store actual value\n\t\t\tthis.getStorage(scope)?.set(key, value);\n\t\t});\n\t}\n\n\tremove(key: string, scope: StorageScope): void {\n\n\t\t// Update our datastructures but send events only after\n\t\tthis.withPausedEmitters(() => {\n\n\t\t\t// Update key-target map\n\t\t\tthis.updateKeyTarget(key, scope, undefined);\n\n\t\t\t// Remove actual key\n\t\t\tthis.getStorage(scope)?.delete(key);\n\t\t});\n\t}\n\n\tprivate withPausedEmitters(fn: Function): void {\n\n\t\t// Pause emitters\n\t\tthis._onDidChangeValue.pause();\n\t\tthis._onDidChangeTarget.pause();\n\n\t\ttry {\n\t\t\tfn();\n\t\t} finally {\n\n\t\t\t// Resume emitters\n\t\t\tthis._onDidChangeValue.resume();\n\t\t\tthis._onDidChangeTarget.resume();\n\t\t}\n\t}\n\n\tprivate updateKeyTarget(key: string, scope: StorageScope, target: StorageTarget | undefined): void {\n\n\t\t// Add\n\t\tconst keyTargets = this.getKeyTargets(scope);\n\t\tif (typeof target === 'number') {\n\t\t\tif (keyTargets[key] !== target) {\n\t\t\t\tkeyTargets[key] = target;\n\t\t\t\tthis.getStorage(scope)?.set(TARGET_KEY, JSON.stringify(keyTargets));\n\t\t\t}\n\t\t}\n\n\t\t// Remove\n\t\telse {\n\t\t\tif (typeof keyTargets[key] === 'number') {\n\t\t\t\tdelete keyTargets[key];\n\t\t\t\tthis.getStorage(scope)?.set(TARGET_KEY, JSON.stringify(keyTargets));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _workspaceKeyTargets: IKeyTargets | undefined = undefined;\n\tprivate get workspaceKeyTargets(): IKeyTargets {\n\t\tif (!this._workspaceKeyTargets) {\n\t\t\tthis._workspaceKeyTargets = this.loadKeyTargets(StorageScope.WORKSPACE);\n\t\t}\n\n\t\treturn this._workspaceKeyTargets;\n\t}\n\n\tprivate _globalKeyTargets: IKeyTargets | undefined = undefined;\n\tprivate get globalKeyTargets(): IKeyTargets {\n\t\tif (!this._globalKeyTargets) {\n\t\t\tthis._globalKeyTargets = this.loadKeyTargets(StorageScope.GLOBAL);\n\t\t}\n\n\t\treturn this._globalKeyTargets;\n\t}\n\n\tprivate getKeyTargets(scope: StorageScope): IKeyTargets {\n\t\treturn scope === StorageScope.GLOBAL ? this.globalKeyTargets : this.workspaceKeyTargets;\n\t}\n\n\tprivate loadKeyTargets(scope: StorageScope): { [key: string]: StorageTarget } {\n\t\tconst keysRaw = this.get(TARGET_KEY, scope);\n\t\tif (keysRaw) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(keysRaw);\n\t\t\t} catch (error) {\n\t\t\t\t// Fail gracefully\n\t\t\t}\n\t\t}\n\n\t\treturn Object.create(null);\n\t}\n\n\tprotected abstract getStorage(scope: StorageScope): IStorage | undefined;\n}\n\nexport class InMemoryStorageService extends AbstractStorageService {\n\n\tprivate readonly globalStorage = this._register(new Storage(new InMemoryStorageDatabase()));\n\tprivate readonly workspaceStorage = this._register(new Storage(new InMemoryStorageDatabase()));\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._register(this.workspaceStorage.onDidChangeStorage(key => this.emitDidChangeValue(StorageScope.WORKSPACE, key)));\n\t\tthis._register(this.globalStorage.onDidChangeStorage(key => this.emitDidChangeValue(StorageScope.GLOBAL, key)));\n\t}\n\n\tprotected getStorage(scope: StorageScope): IStorage {\n\t\treturn scope === StorageScope.GLOBAL ? this.globalStorage : this.workspaceStorage;\n\t}\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 { runWhenIdle } from 'vs/base/common/async';\nimport { once } from 'vs/base/common/functional';\nimport { LRUCache } from 'vs/base/common/map';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CodeLens, CodeLensList, CodeLensProvider } from 'vs/editor/common/languages';\nimport { CodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage';\n\nexport const ICodeLensCache = createDecorator<ICodeLensCache>('ICodeLensCache');\n\nexport interface ICodeLensCache {\n\treadonly _serviceBrand: undefined;\n\tput(model: ITextModel, data: CodeLensModel): void;\n\tget(model: ITextModel): CodeLensModel | undefined;\n\tdelete(model: ITextModel): void;\n}\n\ninterface ISerializedCacheData {\n\tlineCount: number;\n\tlines: number[];\n}\n\nclass CacheItem {\n\n\tconstructor(\n\t\treadonly lineCount: number,\n\t\treadonly data: CodeLensModel\n\t) { }\n}\n\nexport class CodeLensCache implements ICodeLensCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _fakeProvider = new class implements CodeLensProvider {\n\t\tprovideCodeLenses(): CodeLensList {\n\t\t\tthrow new Error('not supported');\n\t\t}\n\t};\n\n\tprivate readonly _cache = new LRUCache<string, CacheItem>(20, 0.75);\n\n\tconstructor(@IStorageService storageService: IStorageService) {\n\n\t\t// remove old data\n\t\tconst oldkey = 'codelens/cache';\n\t\trunWhenIdle(() => storageService.remove(oldkey, StorageScope.WORKSPACE));\n\n\t\t// restore lens data on start\n\t\tconst key = 'codelens/cache2';\n\t\tconst raw = storageService.get(key, StorageScope.WORKSPACE, '{}');\n\t\tthis._deserialize(raw);\n\n\t\t// store lens data on shutdown\n\t\tonce(storageService.onWillSaveState)(e => {\n\t\t\tif (e.reason === WillSaveStateReason.SHUTDOWN) {\n\t\t\t\tstorageService.store(key, this._serialize(), StorageScope.WORKSPACE, StorageTarget.MACHINE);\n\t\t\t}\n\t\t});\n\t}\n\n\tput(model: ITextModel, data: CodeLensModel): void {\n\t\t// create a copy of the model that is without command-ids\n\t\t// but with comand-labels\n\t\tconst copyItems = data.lenses.map(item => {\n\t\t\treturn <CodeLens>{\n\t\t\t\trange: item.symbol.range,\n\t\t\t\tcommand: item.symbol.command && { id: '', title: item.symbol.command?.title },\n\t\t\t};\n\t\t});\n\t\tconst copyModel = new CodeLensModel();\n\t\tcopyModel.add({ lenses: copyItems, dispose: () => { } }, this._fakeProvider);\n\n\t\tconst item = new CacheItem(model.getLineCount(), copyModel);\n\t\tthis._cache.set(model.uri.toString(), item);\n\t}\n\n\tget(model: ITextModel) {\n\t\tconst item = this._cache.get(model.uri.toString());\n\t\treturn item && item.lineCount === model.getLineCount() ? item.data : undefined;\n\t}\n\n\tdelete(model: ITextModel): void {\n\t\tthis._cache.delete(model.uri.toString());\n\t}\n\n\t// --- persistence\n\n\tprivate _serialize(): string {\n\t\tconst data: Record<string, ISerializedCacheData> = Object.create(null);\n\t\tfor (const [key, value] of this._cache) {\n\t\t\tconst lines = new Set<number>();\n\t\t\tfor (const d of value.data.lenses) {\n\t\t\t\tlines.add(d.symbol.range.startLineNumber);\n\t\t\t}\n\t\t\tdata[key] = {\n\t\t\t\tlineCount: value.lineCount,\n\t\t\t\tlines: [...lines.values()]\n\t\t\t};\n\t\t}\n\t\treturn JSON.stringify(data);\n\t}\n\n\tprivate _deserialize(raw: string): void {\n\t\ttry {\n\t\t\tconst data: Record<string, ISerializedCacheData> = JSON.parse(raw);\n\t\t\tfor (const key in data) {\n\t\t\t\tconst element = data[key];\n\t\t\t\tconst lenses: CodeLens[] = [];\n\t\t\t\tfor (const line of element.lines) {\n\t\t\t\t\tlenses.push({ range: new Range(line, 1, line, 11) });\n\t\t\t\t}\n\n\t\t\t\tconst model = new CodeLensModel();\n\t\t\t\tmodel.add({ lenses, dispose() { } }, this._fakeProvider);\n\t\t\t\tthis._cache.set(key, new CacheItem(element.lineCount, model));\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore...\n\t\t}\n\t}\n}\n\nregisterSingleton(ICodeLensCache, CodeLensCache);\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\n\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { LRUCache, TernarySearchTree } from 'vs/base/common/map';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CompletionItemKind, CompletionItemKinds } from 'vs/editor/common/languages';\nimport { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage';\n\nexport abstract class Memory {\n\n\tconstructor(readonly name: MemMode) { }\n\n\tselect(model: ITextModel, pos: IPosition, items: CompletionItem[]): number {\n\t\tif (items.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tlet topScore = items[0].score[0];\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst { score, completion: suggestion } = items[i];\n\t\t\tif (score[0] !== topScore) {\n\t\t\t\t// stop when leaving the group of top matches\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (suggestion.preselect) {\n\t\t\t\t// stop when seeing an auto-select-item\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tabstract memorize(model: ITextModel, pos: IPosition, item: CompletionItem): void;\n\n\tabstract toJSON(): object | undefined;\n\n\tabstract fromJSON(data: object): void;\n}\n\nexport class NoMemory extends Memory {\n\n\tconstructor() {\n\t\tsuper('first');\n\t}\n\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void {\n\t\t// no-op\n\t}\n\n\ttoJSON() {\n\t\treturn undefined;\n\t}\n\n\tfromJSON() {\n\t\t//\n\t}\n}\n\nexport interface MemItem {\n\ttype: string | CompletionItemKind;\n\tinsertText: string;\n\ttouch: number;\n}\n\nexport class LRUMemory extends Memory {\n\n\tconstructor() {\n\t\tsuper('recentlyUsed');\n\t}\n\n\tprivate _cache = new LRUCache<string, MemItem>(300, 0.66);\n\tprivate _seq = 0;\n\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void {\n\t\tconst key = `${model.getLanguageId()}/${item.textLabel}`;\n\t\tthis._cache.set(key, {\n\t\t\ttouch: this._seq++,\n\t\t\ttype: item.completion.kind,\n\t\t\tinsertText: item.completion.insertText\n\t\t});\n\t}\n\n\toverride select(model: ITextModel, pos: IPosition, items: CompletionItem[]): number {\n\n\t\tif (items.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst lineSuffix = model.getLineContent(pos.lineNumber).substr(pos.column - 10, pos.column - 1);\n\t\tif (/\\s$/.test(lineSuffix)) {\n\t\t\treturn super.select(model, pos, items);\n\t\t}\n\n\t\tlet topScore = items[0].score[0];\n\t\tlet indexPreselect = -1;\n\t\tlet indexRecency = -1;\n\t\tlet seq = -1;\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tif (items[i].score[0] !== topScore) {\n\t\t\t\t// consider only top items\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst key = `${model.getLanguageId()}/${items[i].textLabel}`;\n\t\t\tconst item = this._cache.peek(key);\n\t\t\tif (item && item.touch > seq && item.type === items[i].completion.kind && item.insertText === items[i].completion.insertText) {\n\t\t\t\tseq = item.touch;\n\t\t\t\tindexRecency = i;\n\t\t\t}\n\t\t\tif (items[i].completion.preselect && indexPreselect === -1) {\n\t\t\t\t// stop when seeing an auto-select-item\n\t\t\t\treturn indexPreselect = i;\n\t\t\t}\n\t\t}\n\t\tif (indexRecency !== -1) {\n\t\t\treturn indexRecency;\n\t\t} else if (indexPreselect !== -1) {\n\t\t\treturn indexPreselect;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\ttoJSON(): object {\n\t\treturn this._cache.toJSON();\n\t}\n\n\tfromJSON(data: [string, MemItem][]): void {\n\t\tthis._cache.clear();\n\t\tlet seq = 0;\n\t\tfor (const [key, value] of data) {\n\t\t\tvalue.touch = seq;\n\t\t\tvalue.type = typeof value.type === 'number' ? value.type : CompletionItemKinds.fromString(value.type);\n\t\t\tthis._cache.set(key, value);\n\t\t}\n\t\tthis._seq = this._cache.size;\n\t}\n}\n\n\nexport class PrefixMemory extends Memory {\n\n\tconstructor() {\n\t\tsuper('recentlyUsedByPrefix');\n\t}\n\n\tprivate _trie = TernarySearchTree.forStrings<MemItem>();\n\tprivate _seq = 0;\n\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void {\n\t\tconst { word } = model.getWordUntilPosition(pos);\n\t\tconst key = `${model.getLanguageId()}/${word}`;\n\t\tthis._trie.set(key, {\n\t\t\ttype: item.completion.kind,\n\t\t\tinsertText: item.completion.insertText,\n\t\t\ttouch: this._seq++\n\t\t});\n\t}\n\n\toverride select(model: ITextModel, pos: IPosition, items: CompletionItem[]): number {\n\t\tlet { word } = model.getWordUntilPosition(pos);\n\t\tif (!word) {\n\t\t\treturn super.select(model, pos, items);\n\t\t}\n\t\tlet key = `${model.getLanguageId()}/${word}`;\n\t\tlet item = this._trie.get(key);\n\t\tif (!item) {\n\t\t\titem = this._trie.findSubstr(key);\n\t\t}\n\t\tif (item) {\n\t\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\t\tlet { kind, insertText } = items[i].completion;\n\t\t\t\tif (kind === item.type && insertText === item.insertText) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn super.select(model, pos, items);\n\t}\n\n\ttoJSON(): object {\n\n\t\tlet entries: [string, MemItem][] = [];\n\t\tthis._trie.forEach((value, key) => entries.push([key, value]));\n\n\t\t// sort by last recently used (touch), then\n\t\t// take the top 200 item and normalize their\n\t\t// touch\n\t\tentries\n\t\t\t.sort((a, b) => -(a[1].touch - b[1].touch))\n\t\t\t.forEach((value, i) => value[1].touch = i);\n\n\t\treturn entries.slice(0, 200);\n\t}\n\n\tfromJSON(data: [string, MemItem][]): void {\n\t\tthis._trie.clear();\n\t\tif (data.length > 0) {\n\t\t\tthis._seq = data[0][1].touch + 1;\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tvalue.type = typeof value.type === 'number' ? value.type : CompletionItemKinds.fromString(value.type);\n\t\t\t\tthis._trie.set(key, value);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type MemMode = 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';\n\nexport class SuggestMemoryService implements ISuggestMemoryService {\n\n\tprivate static readonly _strategyCtors = new Map<MemMode, { new(): Memory }>([\n\t\t['recentlyUsedByPrefix', PrefixMemory],\n\t\t['recentlyUsed', LRUMemory],\n\t\t['first', NoMemory]\n\t]);\n\n\tprivate static readonly _storagePrefix = 'suggest/memories';\n\n\treadonly _serviceBrand: undefined;\n\n\n\tprivate readonly _persistSoon: RunOnceScheduler;\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate _strategy?: Memory;\n\n\tconstructor(\n\t\t@IStorageService private readonly _storageService: IStorageService,\n\t\t@IConfigurationService private readonly _configService: IConfigurationService,\n\t) {\n\t\tthis._persistSoon = new RunOnceScheduler(() => this._saveState(), 500);\n\t\tthis._disposables.add(_storageService.onWillSaveState(e => {\n\t\t\tif (e.reason === WillSaveStateReason.SHUTDOWN) {\n\t\t\t\tthis._saveState();\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._persistSoon.dispose();\n\t}\n\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void {\n\t\tthis._withStrategy(model, pos).memorize(model, pos, item);\n\t\tthis._persistSoon.schedule();\n\t}\n\n\tselect(model: ITextModel, pos: IPosition, items: CompletionItem[]): number {\n\t\treturn this._withStrategy(model, pos).select(model, pos, items);\n\t}\n\n\tprivate _withStrategy(model: ITextModel, pos: IPosition): Memory {\n\n\t\tconst mode = this._configService.getValue<MemMode>('editor.suggestSelection', {\n\t\t\toverrideIdentifier: model.getLanguageIdAtPosition(pos.lineNumber, pos.column),\n\t\t\tresource: model.uri\n\t\t});\n\n\t\tif (this._strategy?.name !== mode) {\n\n\t\t\tthis._saveState();\n\t\t\tconst ctor = SuggestMemoryService._strategyCtors.get(mode) || NoMemory;\n\t\t\tthis._strategy = new ctor();\n\n\t\t\ttry {\n\t\t\t\tconst share = this._configService.getValue<boolean>('editor.suggest.shareSuggestSelections');\n\t\t\t\tconst scope = share ? StorageScope.GLOBAL : StorageScope.WORKSPACE;\n\t\t\t\tconst raw = this._storageService.get(`${SuggestMemoryService._storagePrefix}/${mode}`, scope);\n\t\t\t\tif (raw) {\n\t\t\t\t\tthis._strategy.fromJSON(JSON.parse(raw));\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// things can go wrong with JSON...\n\t\t\t}\n\t\t}\n\n\t\treturn this._strategy;\n\t}\n\n\tprivate _saveState() {\n\t\tif (this._strategy) {\n\t\t\tconst share = this._configService.getValue<boolean>('editor.suggest.shareSuggestSelections');\n\t\t\tconst scope = share ? StorageScope.GLOBAL : StorageScope.WORKSPACE;\n\t\t\tconst raw = JSON.stringify(this._strategy);\n\t\t\tthis._storageService.store(`${SuggestMemoryService._storagePrefix}/${this._strategy.name}`, raw, scope, StorageTarget.MACHINE);\n\t\t}\n\t}\n}\n\n\nexport const ISuggestMemoryService = createDecorator<ISuggestMemoryService>('ISuggestMemories');\n\nexport interface ISuggestMemoryService {\n\treadonly _serviceBrand: undefined;\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void;\n\tselect(model: ITextModel, pos: IPosition, items: CompletionItem[]): number;\n}\n\nregisterSingleton(ISuggestMemoryService, SuggestMemoryService, true);\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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';\n\nexport const ITelemetryService = createDecorator<ITelemetryService>('telemetryService');\n\nexport interface ITelemetryService {\n\n\treadonly _serviceBrand: undefined;\n\n\tpublicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>, anonymizeFilePaths?: boolean): Promise<void>;\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 { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { toErrorMessage } from 'vs/base/common/errorMessage';\nimport { isCancellationError } from 'vs/base/common/errors';\nimport { matchesContiguousSubString, matchesPrefix, matchesWords, or } from 'vs/base/common/filters';\nimport { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { LRUCache } from 'vs/base/common/map';\nimport Severity from 'vs/base/common/severity';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { localize } from 'vs/nls';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider } from 'vs/platform/quickinput/browser/pickerQuickAccess';\nimport { IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\n\nexport interface ICommandQuickPick extends IPickerQuickAccessItem {\n\tcommandId: string;\n\tcommandAlias?: string;\n}\n\nexport interface ICommandsQuickAccessOptions extends IPickerQuickAccessProviderOptions<ICommandQuickPick> {\n\tshowAlias: boolean;\n}\n\nexport abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider<ICommandQuickPick> implements IDisposable {\n\n\tstatic PREFIX = '>';\n\n\tprivate static WORD_FILTER = or(matchesPrefix, matchesWords, matchesContiguousSubString);\n\n\tprivate readonly commandsHistory = this._register(this.instantiationService.createInstance(CommandsHistory));\n\n\tprotected override readonly options: ICommandsQuickAccessOptions;\n\n\tconstructor(\n\t\toptions: ICommandsQuickAccessOptions,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly commandService: ICommandService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IDialogService private readonly dialogService: IDialogService\n\t) {\n\t\tsuper(AbstractCommandsQuickAccessProvider.PREFIX, options);\n\n\t\tthis.options = options;\n\t}\n\n\tprotected async _getPicks(filter: string, disposables: DisposableStore, token: CancellationToken): Promise<Array<ICommandQuickPick | IQuickPickSeparator>> {\n\n\t\t// Ask subclass for all command picks\n\t\tconst allCommandPicks = await this.getCommandPicks(disposables, token);\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Filter\n\t\tconst filteredCommandPicks: ICommandQuickPick[] = [];\n\t\tfor (const commandPick of allCommandPicks) {\n\t\t\tconst labelHighlights = withNullAsUndefined(AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.label));\n\t\t\tconst aliasHighlights = commandPick.commandAlias ? withNullAsUndefined(AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.commandAlias)) : undefined;\n\n\t\t\t// Add if matching in label or alias\n\t\t\tif (labelHighlights || aliasHighlights) {\n\t\t\t\tcommandPick.highlights = {\n\t\t\t\t\tlabel: labelHighlights,\n\t\t\t\t\tdetail: this.options.showAlias ? aliasHighlights : undefined\n\t\t\t\t};\n\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\n\t\t\t// Also add if we have a 100% command ID match\n\t\t\telse if (filter === commandPick.commandId) {\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\t\t}\n\n\t\t// Add description to commands that have duplicate labels\n\t\tconst mapLabelToCommand = new Map<string, ICommandQuickPick>();\n\t\tfor (const commandPick of filteredCommandPicks) {\n\t\t\tconst existingCommandForLabel = mapLabelToCommand.get(commandPick.label);\n\t\t\tif (existingCommandForLabel) {\n\t\t\t\tcommandPick.description = commandPick.commandId;\n\t\t\t\texistingCommandForLabel.description = existingCommandForLabel.commandId;\n\t\t\t} else {\n\t\t\t\tmapLabelToCommand.set(commandPick.label, commandPick);\n\t\t\t}\n\t\t}\n\n\t\t// Sort by MRU order and fallback to name otherwise\n\t\tfilteredCommandPicks.sort((commandPickA, commandPickB) => {\n\t\t\tconst commandACounter = this.commandsHistory.peek(commandPickA.commandId);\n\t\t\tconst commandBCounter = this.commandsHistory.peek(commandPickB.commandId);\n\n\t\t\tif (commandACounter && commandBCounter) {\n\t\t\t\treturn commandACounter > commandBCounter ? -1 : 1; // use more recently used command before older\n\t\t\t}\n\n\t\t\tif (commandACounter) {\n\t\t\t\treturn -1; // first command was used, so it wins over the non used one\n\t\t\t}\n\n\t\t\tif (commandBCounter) {\n\t\t\t\treturn 1; // other command was used so it wins over the command\n\t\t\t}\n\n\t\t\t// both commands were never used, so we sort by name\n\t\t\treturn commandPickA.label.localeCompare(commandPickB.label);\n\t\t});\n\n\t\tconst commandPicks: Array<ICommandQuickPick | IQuickPickSeparator> = [];\n\n\t\tlet addSeparator = false;\n\t\tfor (let i = 0; i < filteredCommandPicks.length; i++) {\n\t\t\tconst commandPick = filteredCommandPicks[i];\n\t\t\tconst keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);\n\t\t\tconst ariaLabel = keybinding ?\n\t\t\t\tlocalize('commandPickAriaLabelWithKeybinding', \"{0}, {1}\", commandPick.label, keybinding.getAriaLabel()) :\n\t\t\t\tcommandPick.label;\n\n\t\t\t// Separator: recently used\n\t\t\tif (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('recentlyUsed', \"recently used\") });\n\t\t\t\taddSeparator = true;\n\t\t\t}\n\n\t\t\t// Separator: other commands\n\t\t\tif (i !== 0 && addSeparator && !this.commandsHistory.peek(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('morecCommands', \"other commands\") });\n\t\t\t\taddSeparator = false; // only once\n\t\t\t}\n\n\t\t\t// Command\n\t\t\tcommandPicks.push({\n\t\t\t\t...commandPick,\n\t\t\t\tariaLabel,\n\t\t\t\tdetail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined,\n\t\t\t\tkeybinding,\n\t\t\t\taccept: async () => {\n\n\t\t\t\t\t// Add to history\n\t\t\t\t\tthis.commandsHistory.push(commandPick.commandId);\n\n\t\t\t\t\t// Telementry\n\t\t\t\t\tthis.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', {\n\t\t\t\t\t\tid: commandPick.commandId,\n\t\t\t\t\t\tfrom: 'quick open'\n\t\t\t\t\t});\n\n\t\t\t\t\t// Run\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.commandService.executeCommand(commandPick.commandId);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (!isCancellationError(error)) {\n\t\t\t\t\t\t\tthis.dialogService.show(Severity.Error, localize('canNotRun', \"Command '{0}' resulted in an error ({1})\", commandPick.label, toErrorMessage(error)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn commandPicks;\n\t}\n\n\t/**\n\t * Subclasses to provide the actual command entries.\n\t */\n\tprotected abstract getCommandPicks(disposables: DisposableStore, token: CancellationToken): Promise<Array<ICommandQuickPick>>;\n}\n\ninterface ISerializedCommandHistory {\n\tusesLRU?: boolean;\n\tentries: { key: string; value: number }[];\n}\n\ninterface ICommandsQuickAccessConfiguration {\n\tworkbench: {\n\t\tcommandPalette: {\n\t\t\thistory: number;\n\t\t\tpreserveInput: boolean;\n\t\t};\n\t};\n}\n\nexport class CommandsHistory extends Disposable {\n\n\tstatic readonly DEFAULT_COMMANDS_HISTORY_LENGTH = 50;\n\n\tprivate static readonly PREF_KEY_CACHE = 'commandPalette.mru.cache';\n\tprivate static readonly PREF_KEY_COUNTER = 'commandPalette.mru.counter';\n\n\tprivate static cache: LRUCache<string, number> | undefined;\n\tprivate static counter = 1;\n\n\tprivate configuredCommandsHistoryLength = 0;\n\n\tconstructor(\n\t\t@IStorageService private readonly storageService: IStorageService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t\tsuper();\n\n\t\tthis.updateConfiguration();\n\t\tthis.load();\n\n\t\tthis.registerListeners();\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(() => this.updateConfiguration()));\n\t}\n\n\tprivate updateConfiguration(): void {\n\t\tthis.configuredCommandsHistoryLength = CommandsHistory.getConfiguredCommandHistoryLength(this.configurationService);\n\n\t\tif (CommandsHistory.cache && CommandsHistory.cache.limit !== this.configuredCommandsHistoryLength) {\n\t\t\tCommandsHistory.cache.limit = this.configuredCommandsHistoryLength;\n\n\t\t\tCommandsHistory.saveState(this.storageService);\n\t\t}\n\t}\n\n\tprivate load(): void {\n\t\tconst raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE, StorageScope.GLOBAL);\n\t\tlet serializedCache: ISerializedCommandHistory | undefined;\n\t\tif (raw) {\n\t\t\ttry {\n\t\t\t\tserializedCache = JSON.parse(raw);\n\t\t\t} catch (error) {\n\t\t\t\t// invalid data\n\t\t\t}\n\t\t}\n\n\t\tconst cache = CommandsHistory.cache = new LRUCache<string, number>(this.configuredCommandsHistoryLength, 1);\n\t\tif (serializedCache) {\n\t\t\tlet entries: { key: string; value: number }[];\n\t\t\tif (serializedCache.usesLRU) {\n\t\t\t\tentries = serializedCache.entries;\n\t\t\t} else {\n\t\t\t\tentries = serializedCache.entries.sort((a, b) => a.value - b.value);\n\t\t\t}\n\t\t\tentries.forEach(entry => cache.set(entry.key, entry.value));\n\t\t}\n\n\t\tCommandsHistory.counter = this.storageService.getNumber(CommandsHistory.PREF_KEY_COUNTER, StorageScope.GLOBAL, CommandsHistory.counter);\n\t}\n\n\tpush(commandId: string): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tCommandsHistory.cache.set(commandId, CommandsHistory.counter++); // set counter to command\n\n\t\tCommandsHistory.saveState(this.storageService);\n\t}\n\n\tpeek(commandId: string): number | undefined {\n\t\treturn CommandsHistory.cache?.peek(commandId);\n\t}\n\n\tstatic saveState(storageService: IStorageService): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst serializedCache: ISerializedCommandHistory = { usesLRU: true, entries: [] };\n\t\tCommandsHistory.cache.forEach((value, key) => serializedCache.entries.push({ key, value }));\n\n\t\tstorageService.store(CommandsHistory.PREF_KEY_CACHE, JSON.stringify(serializedCache), StorageScope.GLOBAL, StorageTarget.USER);\n\t\tstorageService.store(CommandsHistory.PREF_KEY_COUNTER, CommandsHistory.counter, StorageScope.GLOBAL, StorageTarget.USER);\n\t}\n\n\tstatic getConfiguredCommandHistoryLength(configurationService: IConfigurationService): number {\n\t\tconst config = <ICommandsQuickAccessConfiguration>configurationService.getValue();\n\n\t\tconst configuredCommandHistoryLength = config.workbench?.commandPalette?.history;\n\t\tif (typeof configuredCommandHistoryLength === 'number') {\n\t\t\treturn configuredCommandHistoryLength;\n\t\t}\n\n\t\treturn CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH;\n\t}\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 { stripIcons } from 'vs/base/common/iconLabels';\nimport { IEditor } from 'vs/editor/common/editorCommon';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { AbstractCommandsQuickAccessProvider, ICommandQuickPick, ICommandsQuickAccessOptions } from 'vs/platform/quickinput/browser/commandsQuickAccess';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\n\nexport abstract class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAccessProvider {\n\n\tconstructor(\n\t\toptions: ICommandsQuickAccessOptions,\n\t\tinstantiationService: IInstantiationService,\n\t\tkeybindingService: IKeybindingService,\n\t\tcommandService: ICommandService,\n\t\ttelemetryService: ITelemetryService,\n\t\tdialogService: IDialogService\n\t) {\n\t\tsuper(options, instantiationService, keybindingService, commandService, telemetryService, dialogService);\n\t}\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\tprotected getCodeEditorCommandPicks(): ICommandQuickPick[] {\n\t\tconst activeTextEditorControl = this.activeTextEditorControl;\n\t\tif (!activeTextEditorControl) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst editorCommandPicks: ICommandQuickPick[] = [];\n\t\tfor (const editorAction of activeTextEditorControl.getSupportedActions()) {\n\t\t\teditorCommandPicks.push({\n\t\t\t\tcommandId: editorAction.id,\n\t\t\t\tcommandAlias: editorAction.alias,\n\t\t\t\tlabel: stripIcons(editorAction.label) || editorAction.id,\n\t\t\t});\n\t\t}\n\n\t\treturn editorCommandPicks;\n\t}\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';\nimport { assertNever } from 'vs/base/common/types';\nimport * as nls from 'vs/nls';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';\nimport * as platform from 'vs/platform/registry/common/platform';\nimport { IColorTheme } from 'vs/platform/theme/common/themeService';\n\n// ------ API types\n\nexport type ColorIdentifier = string;\n\nexport interface ColorContribution {\n\treadonly id: ColorIdentifier;\n\treadonly description: string;\n\treadonly defaults: ColorDefaults | null;\n\treadonly needsTransparency: boolean;\n\treadonly deprecationMessage: string | undefined;\n}\n\n/**\n * Returns the css variable name for the given color identifier. Dots (`.`) are replaced with hyphens (`-`) and\n * everything is prefixed with `--vscode-`.\n *\n * @sample `editorSuggestWidget.background` is `--vscode-editorSuggestWidget-background`.\n */\nexport function asCssVariableName(colorIdent: ColorIdentifier): string {\n\treturn `--vscode-${colorIdent.replace(/\\./g, '-')}`;\n}\n\nexport const enum ColorTransformType {\n\tDarken,\n\tLighten,\n\tTransparent,\n\tOneOf,\n\tLessProminent,\n\tIfDefinedThenElse\n}\n\nexport type ColorTransform =\n\t| { op: ColorTransformType.Darken; value: ColorValue; factor: number }\n\t| { op: ColorTransformType.Lighten; value: ColorValue; factor: number }\n\t| { op: ColorTransformType.Transparent; value: ColorValue; factor: number }\n\t| { op: ColorTransformType.OneOf; values: readonly ColorValue[] }\n\t| { op: ColorTransformType.LessProminent; value: ColorValue; background: ColorValue; factor: number; transparency: number }\n\t| { op: ColorTransformType.IfDefinedThenElse; if: ColorIdentifier; then: ColorValue; else: ColorValue };\n\nexport interface ColorDefaults {\n\tlight: ColorValue | null;\n\tdark: ColorValue | null;\n\thc: ColorValue | null;\n}\n\n/**\n * A Color Value is either a color literal, a reference to an other color or a derived color\n */\nexport type ColorValue = Color | string | ColorIdentifier | ColorTransform;\n\n// color registry\nexport const Extensions = {\n\tColorContribution: 'base.contributions.colors'\n};\n\nexport interface IColorRegistry {\n\n\t/**\n\t * Get all color contributions\n\t */\n\tgetColors(): ColorContribution[];\n\n\t/**\n\t * Gets the default color of the given id\n\t */\n\tresolveDefaultColor(id: ColorIdentifier, theme: IColorTheme): Color | undefined;\n\n}\n\nclass ColorRegistry implements IColorRegistry {\n\n\tprivate readonly _onDidChangeSchema = new Emitter<void>();\n\treadonly onDidChangeSchema: Event<void> = this._onDidChangeSchema.event;\n\n\tprivate colorsById: { [key: string]: ColorContribution };\n\tprivate colorSchema: IJSONSchema & { properties: IJSONSchemaMap } = { type: 'object', properties: {} };\n\tprivate colorReferenceSchema: IJSONSchema & { enum: string[]; enumDescriptions: string[] } = { type: 'string', enum: [], enumDescriptions: [] };\n\n\tconstructor() {\n\t\tthis.colorsById = {};\n\t}\n\n\tpublic registerColor(id: string, defaults: ColorDefaults | null, description: string, needsTransparency = false, deprecationMessage?: string): ColorIdentifier {\n\t\tlet colorContribution: ColorContribution = { id, description, defaults, needsTransparency, deprecationMessage };\n\t\tthis.colorsById[id] = colorContribution;\n\t\tlet propertySchema: IJSONSchema = { type: 'string', description, format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] };\n\t\tif (deprecationMessage) {\n\t\t\tpropertySchema.deprecationMessage = deprecationMessage;\n\t\t}\n\t\tthis.colorSchema.properties[id] = propertySchema;\n\t\tthis.colorReferenceSchema.enum.push(id);\n\t\tthis.colorReferenceSchema.enumDescriptions.push(description);\n\n\t\tthis._onDidChangeSchema.fire();\n\t\treturn id;\n\t}\n\n\tpublic getColors(): ColorContribution[] {\n\t\treturn Object.keys(this.colorsById).map(id => this.colorsById[id]);\n\t}\n\n\tpublic resolveDefaultColor(id: ColorIdentifier, theme: IColorTheme): Color | undefined {\n\t\tconst colorDesc = this.colorsById[id];\n\t\tif (colorDesc && colorDesc.defaults) {\n\t\t\tconst colorValue = colorDesc.defaults[theme.type];\n\t\t\treturn resolveColorValue(colorValue, theme);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic getColorSchema(): IJSONSchema {\n\t\treturn this.colorSchema;\n\t}\n\n\tpublic toString() {\n\t\tlet sorter = (a: string, b: string) => {\n\t\t\tlet cat1 = a.indexOf('.') === -1 ? 0 : 1;\n\t\t\tlet cat2 = b.indexOf('.') === -1 ? 0 : 1;\n\t\t\tif (cat1 !== cat2) {\n\t\t\t\treturn cat1 - cat2;\n\t\t\t}\n\t\t\treturn a.localeCompare(b);\n\t\t};\n\n\t\treturn Object.keys(this.colorsById).sort(sorter).map(k => `- \\`${k}\\`: ${this.colorsById[k].description}`).join('\\n');\n\t}\n\n}\n\nconst colorRegistry = new ColorRegistry();\nplatform.Registry.add(Extensions.ColorContribution, colorRegistry);\n\nexport function registerColor(id: string, defaults: ColorDefaults | null, description: string, needsTransparency?: boolean, deprecationMessage?: string): ColorIdentifier {\n\treturn colorRegistry.registerColor(id, defaults, description, needsTransparency, deprecationMessage);\n}\n\n// ----- base colors\n\nexport const foreground = registerColor('foreground', { dark: '#CCCCCC', light: '#616161', hc: '#FFFFFF' }, nls.localize('foreground', \"Overall foreground color. This color is only used if not overridden by a component.\"));\nexport const errorForeground = registerColor('errorForeground', { dark: '#F48771', light: '#A1260D', hc: '#F48771' }, nls.localize('errorForeground', \"Overall foreground color for error messages. This color is only used if not overridden by a component.\"));\nexport const descriptionForeground = registerColor('descriptionForeground', { light: '#717171', dark: transparent(foreground, 0.7), hc: transparent(foreground, 0.7) }, nls.localize('descriptionForeground', \"Foreground color for description text providing additional information, for example for a label.\"));\nexport const iconForeground = registerColor('icon.foreground', { dark: '#C5C5C5', light: '#424242', hc: '#FFFFFF' }, nls.localize('iconForeground', \"The default color for icons in the workbench.\"));\n\nexport const focusBorder = registerColor('focusBorder', { dark: '#007FD4', light: '#0090F1', hc: '#F38518' }, nls.localize('focusBorder', \"Overall border color for focused elements. This color is only used if not overridden by a component.\"));\n\nexport const contrastBorder = registerColor('contrastBorder', { light: null, dark: null, hc: '#6FC3DF' }, nls.localize('contrastBorder', \"An extra border around elements to separate them from others for greater contrast.\"));\nexport const activeContrastBorder = registerColor('contrastActiveBorder', { light: null, dark: null, hc: focusBorder }, nls.localize('activeContrastBorder', \"An extra border around active elements to separate them from others for greater contrast.\"));\n\nexport const selectionBackground = registerColor('selection.background', { light: null, dark: null, hc: null }, nls.localize('selectionBackground', \"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.\"));\n\n// ------ text colors\n\nexport const textSeparatorForeground = registerColor('textSeparator.foreground', { light: '#0000002e', dark: '#ffffff2e', hc: Color.black }, nls.localize('textSeparatorForeground', \"Color for text separators.\"));\nexport const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, nls.localize('textLinkForeground', \"Foreground color for links in text.\"));\nexport const textLinkActiveForeground = registerColor('textLink.activeForeground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, nls.localize('textLinkActiveForeground', \"Foreground color for links in text when clicked on and on mouse hover.\"));\nexport const textPreformatForeground = registerColor('textPreformat.foreground', { light: '#A31515', dark: '#D7BA7D', hc: '#D7BA7D' }, nls.localize('textPreformatForeground', \"Foreground color for preformatted text segments.\"));\nexport const textBlockQuoteBackground = registerColor('textBlockQuote.background', { light: '#7f7f7f1a', dark: '#7f7f7f1a', hc: null }, nls.localize('textBlockQuoteBackground', \"Background color for block quotes in text.\"));\nexport const textBlockQuoteBorder = registerColor('textBlockQuote.border', { light: '#007acc80', dark: '#007acc80', hc: Color.white }, nls.localize('textBlockQuoteBorder', \"Border color for block quotes in text.\"));\nexport const textCodeBlockBackground = registerColor('textCodeBlock.background', { light: '#dcdcdc66', dark: '#0a0a0a66', hc: Color.black }, nls.localize('textCodeBlockBackground', \"Background color for code blocks in text.\"));\n\n// ----- widgets\nexport const widgetShadow = registerColor('widget.shadow', { dark: transparent(Color.black, .36), light: transparent(Color.black, .16), hc: null }, nls.localize('widgetShadow', 'Shadow color of widgets such as find/replace inside the editor.'));\n\nexport const inputBackground = registerColor('input.background', { dark: '#3C3C3C', light: Color.white, hc: Color.black }, nls.localize('inputBoxBackground', \"Input box background.\"));\nexport const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hc: foreground }, nls.localize('inputBoxForeground', \"Input box foreground.\"));\nexport const inputBorder = registerColor('input.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('inputBoxBorder', \"Input box border.\"));\nexport const inputActiveOptionBorder = registerColor('inputOption.activeBorder', { dark: '#007ACC00', light: '#007ACC00', hc: contrastBorder }, nls.localize('inputBoxActiveOptionBorder', \"Border color of activated options in input fields.\"));\nexport const inputActiveOptionHoverBackground = registerColor('inputOption.hoverBackground', { dark: '#5a5d5e80', light: '#b8b8b850', hc: null }, nls.localize('inputOption.hoverBackground', \"Background color of activated options in input fields.\"));\nexport const inputActiveOptionBackground = registerColor('inputOption.activeBackground', { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hc: Color.transparent }, nls.localize('inputOption.activeBackground', \"Background hover color of options in input fields.\"));\nexport const inputActiveOptionForeground = registerColor('inputOption.activeForeground', { dark: Color.white, light: Color.black, hc: null }, nls.localize('inputOption.activeForeground', \"Foreground color of activated options in input fields.\"));\nexport const inputPlaceholderForeground = registerColor('input.placeholderForeground', { light: transparent(foreground, 0.5), dark: transparent(foreground, 0.5), hc: transparent(foreground, 0.7) }, nls.localize('inputPlaceholderForeground', \"Input box foreground color for placeholder text.\"));\n\nexport const inputValidationInfoBackground = registerColor('inputValidation.infoBackground', { dark: '#063B49', light: '#D6ECF2', hc: Color.black }, nls.localize('inputValidationInfoBackground', \"Input validation background color for information severity.\"));\nexport const inputValidationInfoForeground = registerColor('inputValidation.infoForeground', { dark: null, light: null, hc: null }, nls.localize('inputValidationInfoForeground', \"Input validation foreground color for information severity.\"));\nexport const inputValidationInfoBorder = registerColor('inputValidation.infoBorder', { dark: '#007acc', light: '#007acc', hc: contrastBorder }, nls.localize('inputValidationInfoBorder', \"Input validation border color for information severity.\"));\nexport const inputValidationWarningBackground = registerColor('inputValidation.warningBackground', { dark: '#352A05', light: '#F6F5D2', hc: Color.black }, nls.localize('inputValidationWarningBackground', \"Input validation background color for warning severity.\"));\nexport const inputValidationWarningForeground = registerColor('inputValidation.warningForeground', { dark: null, light: null, hc: null }, nls.localize('inputValidationWarningForeground', \"Input validation foreground color for warning severity.\"));\nexport const inputValidationWarningBorder = registerColor('inputValidation.warningBorder', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('inputValidationWarningBorder', \"Input validation border color for warning severity.\"));\nexport const inputValidationErrorBackground = registerColor('inputValidation.errorBackground', { dark: '#5A1D1D', light: '#F2DEDE', hc: Color.black }, nls.localize('inputValidationErrorBackground', \"Input validation background color for error severity.\"));\nexport const inputValidationErrorForeground = registerColor('inputValidation.errorForeground', { dark: null, light: null, hc: null }, nls.localize('inputValidationErrorForeground', \"Input validation foreground color for error severity.\"));\nexport const inputValidationErrorBorder = registerColor('inputValidation.errorBorder', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, nls.localize('inputValidationErrorBorder', \"Input validation border color for error severity.\"));\n\nexport const selectBackground = registerColor('dropdown.background', { dark: '#3C3C3C', light: Color.white, hc: Color.black }, nls.localize('dropdownBackground', \"Dropdown background.\"));\nexport const selectListBackground = registerColor('dropdown.listBackground', { dark: null, light: null, hc: Color.black }, nls.localize('dropdownListBackground', \"Dropdown list background.\"));\nexport const selectForeground = registerColor('dropdown.foreground', { dark: '#F0F0F0', light: null, hc: Color.white }, nls.localize('dropdownForeground', \"Dropdown foreground.\"));\nexport const selectBorder = registerColor('dropdown.border', { dark: selectBackground, light: '#CECECE', hc: contrastBorder }, nls.localize('dropdownBorder', \"Dropdown border.\"));\n\nexport const simpleCheckboxBackground = registerColor('checkbox.background', { dark: selectBackground, light: selectBackground, hc: selectBackground }, nls.localize('checkbox.background', \"Background color of checkbox widget.\"));\nexport const simpleCheckboxForeground = registerColor('checkbox.foreground', { dark: selectForeground, light: selectForeground, hc: selectForeground }, nls.localize('checkbox.foreground', \"Foreground color of checkbox widget.\"));\nexport const simpleCheckboxBorder = registerColor('checkbox.border', { dark: selectBorder, light: selectBorder, hc: selectBorder }, nls.localize('checkbox.border', \"Border color of checkbox widget.\"));\n\nexport const buttonForeground = registerColor('button.foreground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('buttonForeground', \"Button foreground color.\"));\nexport const buttonBackground = registerColor('button.background', { dark: '#0E639C', light: '#007ACC', hc: null }, nls.localize('buttonBackground', \"Button background color.\"));\nexport const buttonHoverBackground = registerColor('button.hoverBackground', { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hc: null }, nls.localize('buttonHoverBackground', \"Button background color when hovering.\"));\nexport const buttonBorder = registerColor('button.border', { dark: contrastBorder, light: contrastBorder, hc: contrastBorder }, nls.localize('buttonBorder', \"Button border color.\"));\n\nexport const buttonSecondaryForeground = registerColor('button.secondaryForeground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('buttonSecondaryForeground', \"Secondary button foreground color.\"));\nexport const buttonSecondaryBackground = registerColor('button.secondaryBackground', { dark: '#3A3D41', light: '#5F6A79', hc: null }, nls.localize('buttonSecondaryBackground', \"Secondary button background color.\"));\nexport const buttonSecondaryHoverBackground = registerColor('button.secondaryHoverBackground', { dark: lighten(buttonSecondaryBackground, 0.2), light: darken(buttonSecondaryBackground, 0.2), hc: null }, nls.localize('buttonSecondaryHoverBackground', \"Secondary button background color when hovering.\"));\n\nexport const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hc: Color.black }, nls.localize('badgeBackground', \"Badge background color. Badges are small information labels, e.g. for search results count.\"));\nexport const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: '#333', hc: Color.white }, nls.localize('badgeForeground', \"Badge foreground color. Badges are small information labels, e.g. for search results count.\"));\n\nexport const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hc: null }, nls.localize('scrollbarShadow', \"Scrollbar shadow to indicate that the view is scrolled.\"));\nexport const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hc: transparent(contrastBorder, 0.6) }, nls.localize('scrollbarSliderBackground', \"Scrollbar slider background color.\"));\nexport const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hc: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', \"Scrollbar slider background color when hovering.\"));\nexport const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.activeBackground', { dark: Color.fromHex('#BFBFBF').transparent(0.4), light: Color.fromHex('#000000').transparent(0.6), hc: contrastBorder }, nls.localize('scrollbarSliderActiveBackground', \"Scrollbar slider background color when clicked on.\"));\n\nexport const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hc: contrastBorder }, nls.localize('progressBarBackground', \"Background color of the progress bar that can show for long running operations.\"));\n\nexport const editorErrorBackground = registerColor('editorError.background', { dark: null, light: null, hc: null }, nls.localize('editorError.background', 'Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorErrorForeground = registerColor('editorError.foreground', { dark: '#F14C4C', light: '#E51400', hc: null }, nls.localize('editorError.foreground', 'Foreground color of error squigglies in the editor.'));\nexport const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hc: Color.fromHex('#E47777').transparent(0.8) }, nls.localize('errorBorder', 'Border color of error boxes in the editor.'));\n\nexport const editorWarningBackground = registerColor('editorWarning.background', { dark: null, light: null, hc: null }, nls.localize('editorWarning.background', 'Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#BF8803', hc: null }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.'));\nexport const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#FFCC00').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning boxes in the editor.'));\n\nexport const editorInfoBackground = registerColor('editorInfo.background', { dark: null, light: null, hc: null }, nls.localize('editorInfo.background', 'Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#3794FF', light: '#1a85ff', hc: '#3794FF' }, nls.localize('editorInfo.foreground', 'Foreground color of info squigglies in the editor.'));\nexport const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#3794FF').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info boxes in the editor.'));\n\nexport const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, nls.localize('editorHint.foreground', 'Foreground color of hint squigglies in the editor.'));\nexport const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hc: Color.fromHex('#eeeeee').transparent(0.8) }, nls.localize('hintBorder', 'Border color of hint boxes in the editor.'));\n\nexport const sashHoverBorder = registerColor('sash.hoverBorder', { dark: focusBorder, light: focusBorder, hc: focusBorder }, nls.localize('sashActiveBorder', \"Border color of active sashes.\"));\n\n/**\n * Editor background color.\n * Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254\n * we are *not* using the color white (or #ffffff, rgba(255,255,255)) but something very close to white.\n */\nexport const editorBackground = registerColor('editor.background', { light: '#fffffe', dark: '#1E1E1E', hc: Color.black }, nls.localize('editorBackground', \"Editor background color.\"));\n\n/**\n * Editor foreground color.\n */\nexport const editorForeground = registerColor('editor.foreground', { light: '#333333', dark: '#BBBBBB', hc: Color.white }, nls.localize('editorForeground', \"Editor default foreground color.\"));\n\n/**\n * Editor widgets\n */\nexport const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#252526', light: '#F3F3F3', hc: '#0C141F' }, nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.'));\nexport const editorWidgetForeground = registerColor('editorWidget.foreground', { dark: foreground, light: foreground, hc: foreground }, nls.localize('editorWidgetForeground', 'Foreground color of editor widgets, such as find/replace.'));\n\nexport const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, nls.localize('editorWidgetBorder', 'Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.'));\n\nexport const editorWidgetResizeBorder = registerColor('editorWidget.resizeBorder', { light: null, dark: null, hc: null }, nls.localize('editorWidgetResizeBorder', \"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.\"));\n\n/**\n * Quick pick widget\n */\nexport const quickInputBackground = registerColor('quickInput.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('pickerBackground', \"Quick picker background color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const quickInputForeground = registerColor('quickInput.foreground', { dark: editorWidgetForeground, light: editorWidgetForeground, hc: editorWidgetForeground }, nls.localize('pickerForeground', \"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const quickInputTitleBackground = registerColor('quickInputTitle.background', { dark: new Color(new RGBA(255, 255, 255, 0.105)), light: new Color(new RGBA(0, 0, 0, 0.06)), hc: '#000000' }, nls.localize('pickerTitleBackground', \"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: Color.white }, nls.localize('pickerGroupForeground', \"Quick picker color for grouping labels.\"));\nexport const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: Color.white }, nls.localize('pickerGroupBorder', \"Quick picker color for grouping borders.\"));\n\n/**\n * Keybinding label\n */\nexport const keybindingLabelBackground = registerColor('keybindingLabel.background', { dark: new Color(new RGBA(128, 128, 128, 0.17)), light: new Color(new RGBA(221, 221, 221, 0.4)), hc: Color.transparent }, nls.localize('keybindingLabelBackground', \"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelForeground = registerColor('keybindingLabel.foreground', { dark: Color.fromHex('#CCCCCC'), light: Color.fromHex('#555555'), hc: Color.white }, nls.localize('keybindingLabelForeground', \"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelBorder = registerColor('keybindingLabel.border', { dark: new Color(new RGBA(51, 51, 51, 0.6)), light: new Color(new RGBA(204, 204, 204, 0.4)), hc: new Color(new RGBA(111, 195, 223)) }, nls.localize('keybindingLabelBorder', \"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelBottomBorder = registerColor('keybindingLabel.bottomBorder', { dark: new Color(new RGBA(68, 68, 68, 0.6)), light: new Color(new RGBA(187, 187, 187, 0.4)), hc: new Color(new RGBA(111, 195, 223)) }, nls.localize('keybindingLabelBottomBorder', \"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.\"));\n\n/**\n * Editor selection colors.\n */\nexport const editorSelectionBackground = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, nls.localize('editorSelectionBackground', \"Color of the editor selection.\"));\nexport const editorSelectionForeground = registerColor('editor.selectionForeground', { light: null, dark: null, hc: '#000000' }, nls.localize('editorSelectionForeground', \"Color of the selected text for high contrast.\"));\nexport const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hc: transparent(editorSelectionBackground, 0.5) }, nls.localize('editorInactiveSelection', \"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hc: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorSelectionHighlightBorder = registerColor('editor.selectionHighlightBorder', { light: null, dark: null, hc: activeContrastBorder }, nls.localize('editorSelectionHighlightBorder', \"Border color for regions with the same content as the selection.\"));\n\n\n/**\n * Editor find match colors.\n */\nexport const editorFindMatch = registerColor('editor.findMatchBackground', { light: '#A8AC94', dark: '#515C6A', hc: null }, nls.localize('editorFindMatch', \"Color of the current search match.\"));\nexport const editorFindMatchHighlight = registerColor('editor.findMatchHighlightBackground', { light: '#EA5C0055', dark: '#EA5C0055', hc: null }, nls.localize('findMatchHighlight', \"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground', { dark: '#3a3d4166', light: '#b4b4b44d', hc: null }, nls.localize('findRangeHighlight', \"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorFindMatchBorder = registerColor('editor.findMatchBorder', { light: null, dark: null, hc: activeContrastBorder }, nls.localize('editorFindMatchBorder', \"Border color of the current search match.\"));\nexport const editorFindMatchHighlightBorder = registerColor('editor.findMatchHighlightBorder', { light: null, dark: null, hc: activeContrastBorder }, nls.localize('findMatchHighlightBorder', \"Border color of the other search matches.\"));\nexport const editorFindRangeHighlightBorder = registerColor('editor.findRangeHighlightBorder', { dark: null, light: null, hc: transparent(activeContrastBorder, 0.4) }, nls.localize('findRangeHighlightBorder', \"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.\"), true);\n\n/**\n * Search Editor query match colors.\n *\n * Distinct from normal editor find match to allow for better differentiation\n */\nexport const searchEditorFindMatch = registerColor('searchEditor.findMatchBackground', { light: transparent(editorFindMatchHighlight, 0.66), dark: transparent(editorFindMatchHighlight, 0.66), hc: editorFindMatchHighlight }, nls.localize('searchEditor.queryMatch', \"Color of the Search Editor query matches.\"));\nexport const searchEditorFindMatchBorder = registerColor('searchEditor.findMatchBorder', { light: transparent(editorFindMatchHighlightBorder, 0.66), dark: transparent(editorFindMatchHighlightBorder, 0.66), hc: editorFindMatchHighlightBorder }, nls.localize('searchEditor.editorFindMatchBorder', \"Border color of the Search Editor query matches.\"));\n\n/**\n * Editor hover\n */\nexport const editorHoverHighlight = registerColor('editor.hoverHighlightBackground', { light: '#ADD6FF26', dark: '#264f7840', hc: '#ADD6FF26' }, nls.localize('hoverHighlight', 'Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorHoverBackground = registerColor('editorHoverWidget.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('hoverBackground', 'Background color of the editor hover.'));\nexport const editorHoverForeground = registerColor('editorHoverWidget.foreground', { light: editorWidgetForeground, dark: editorWidgetForeground, hc: editorWidgetForeground }, nls.localize('hoverForeground', 'Foreground color of the editor hover.'));\nexport const editorHoverBorder = registerColor('editorHoverWidget.border', { light: editorWidgetBorder, dark: editorWidgetBorder, hc: editorWidgetBorder }, nls.localize('hoverBorder', 'Border color of the editor hover.'));\nexport const editorHoverStatusBarBackground = registerColor('editorHoverWidget.statusBarBackground', { dark: lighten(editorHoverBackground, 0.2), light: darken(editorHoverBackground, 0.05), hc: editorWidgetBackground }, nls.localize('statusBarBackground', \"Background color of the editor hover status bar.\"));\n/**\n * Editor link colors\n */\nexport const editorActiveLinkForeground = registerColor('editorLink.activeForeground', { dark: '#4E94CE', light: Color.blue, hc: Color.cyan }, nls.localize('activeLinkForeground', 'Color of active links.'));\n\n/**\n * Inline hints\n */\nexport const editorInlayHintForeground = registerColor('editorInlayHint.foreground', { dark: transparent(badgeForeground, .8), light: transparent(badgeForeground, .8), hc: badgeForeground }, nls.localize('editorInlayHintForeground', 'Foreground color of inline hints'));\nexport const editorInlayHintBackground = registerColor('editorInlayHint.background', { dark: transparent(badgeBackground, .6), light: transparent(badgeBackground, .3), hc: badgeBackground }, nls.localize('editorInlayHintBackground', 'Background color of inline hints'));\nexport const editorInlayHintTypeForeground = registerColor('editorInlayHint.typeForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hc: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundTypes', 'Foreground color of inline hints for types'));\nexport const editorInlayHintTypeBackground = registerColor('editorInlayHint.typeBackground', { dark: editorInlayHintBackground, light: editorInlayHintBackground, hc: editorInlayHintBackground }, nls.localize('editorInlayHintBackgroundTypes', 'Background color of inline hints for types'));\nexport const editorInlayHintParameterForeground = registerColor('editorInlayHint.parameterForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hc: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundParameter', 'Foreground color of inline hints for parameters'));\nexport const editorInlayHintParameterBackground = registerColor('editorInlayHint.parameterBackground', { dark: editorInlayHintBackground, light: editorInlayHintBackground, hc: editorInlayHintBackground }, nls.localize('editorInlayHintBackgroundParameter', 'Background color of inline hints for parameters'));\n\n/**\n * Editor lighbulb icon colors\n */\nexport const editorLightBulbForeground = registerColor('editorLightBulb.foreground', { dark: '#FFCC00', light: '#DDB100', hc: '#FFCC00' }, nls.localize('editorLightBulbForeground', \"The color used for the lightbulb actions icon.\"));\nexport const editorLightBulbAutoFixForeground = registerColor('editorLightBulbAutoFix.foreground', { dark: '#75BEFF', light: '#007ACC', hc: '#75BEFF' }, nls.localize('editorLightBulbAutoFixForeground', \"The color used for the lightbulb auto fix actions icon.\"));\n\n/**\n * Diff Editor Colors\n */\nexport const defaultInsertColor = new Color(new RGBA(155, 185, 85, 0.2));\nexport const defaultRemoveColor = new Color(new RGBA(255, 0, 0, 0.2));\n\nexport const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: defaultInsertColor, light: defaultInsertColor, hc: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hc: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.'), true);\n\nexport const diffInsertedLine = registerColor('diffEditor.insertedLineBackground', { dark: null, light: null, hc: null }, nls.localize('diffEditorInsertedLines', 'Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffRemovedLine = registerColor('diffEditor.removedLineBackground', { dark: null, light: null, hc: null }, nls.localize('diffEditorRemovedLines', 'Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.'), true);\n\nexport const diffInsertedLineGutter = registerColor('diffEditorGutter.insertedLineBackground', { dark: null, light: null, hc: null }, nls.localize('diffEditorInsertedLineGutter', 'Background color for the margin where lines got inserted.'));\nexport const diffRemovedLineGutter = registerColor('diffEditorGutter.removedLineBackground', { dark: null, light: null, hc: null }, nls.localize('diffEditorRemovedLineGutter', 'Background color for the margin where lines got removed.'));\n\nexport const diffOverviewRulerInserted = registerColor('diffEditorOverview.insertedForeground', { dark: null, light: null, hc: null }, nls.localize('diffEditorOverviewInserted', 'Diff overview ruler foreground for inserted content.'));\nexport const diffOverviewRulerRemoved = registerColor('diffEditorOverview.removedForeground', { dark: null, light: null, hc: null }, nls.localize('diffEditorOverviewRemoved', 'Diff overview ruler foreground for removed content.'));\n\nexport const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hc: '#33ff2eff' }, nls.localize('diffEditorInsertedOutline', 'Outline color for the text that got inserted.'));\nexport const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hc: '#FF008F' }, nls.localize('diffEditorRemovedOutline', 'Outline color for text that got removed.'));\n\nexport const diffBorder = registerColor('diffEditor.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('diffEditorBorder', 'Border color between the two text editors.'));\nexport const diffDiagonalFill = registerColor('diffEditor.diagonalFill', { dark: '#cccccc33', light: '#22222233', hc: null }, nls.localize('diffDiagonalFill', \"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.\"));\n\n/**\n * List and tree colors\n */\nexport const listFocusBackground = registerColor('list.focusBackground', { dark: null, light: null, hc: null }, nls.localize('listFocusBackground', \"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listFocusForeground = registerColor('list.focusForeground', { dark: null, light: null, hc: null }, nls.localize('listFocusForeground', \"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listFocusOutline = registerColor('list.focusOutline', { dark: focusBorder, light: focusBorder, hc: activeContrastBorder }, nls.localize('listFocusOutline', \"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionBackground = registerColor('list.activeSelectionBackground', { dark: '#094771', light: '#0060C0', hc: null }, nls.localize('listActiveSelectionBackground', \"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: Color.white, light: Color.white, hc: null }, nls.localize('listActiveSelectionForeground', \"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionIconForeground = registerColor('list.activeSelectionIconForeground', { dark: null, light: null, hc: null }, nls.localize('listActiveSelectionIconForeground', \"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#37373D', light: '#E4E6F1', hc: null }, nls.localize('listInactiveSelectionBackground', \"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionForeground', \"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionIconForeground = registerColor('list.inactiveSelectionIconForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionIconForeground', \"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: null, light: null, hc: null }, nls.localize('listInactiveFocusBackground', \"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveFocusOutline = registerColor('list.inactiveFocusOutline', { dark: null, light: null, hc: null }, nls.localize('listInactiveFocusOutline', \"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hc: null }, nls.localize('listHoverBackground', \"List/Tree background when hovering over items using the mouse.\"));\nexport const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hc: null }, nls.localize('listHoverForeground', \"List/Tree foreground when hovering over items using the mouse.\"));\nexport const listDropBackground = registerColor('list.dropBackground', { dark: '#062F4A', light: '#D6EBFF', hc: null }, nls.localize('listDropBackground', \"List/Tree drag and drop background when moving items around using the mouse.\"));\nexport const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#18A3FF', light: '#0066BF', hc: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.'));\nexport const listFocusHighlightForeground = registerColor('list.focusHighlightForeground', { dark: listHighlightForeground, light: ifDefinedThenElse(listActiveSelectionBackground, listHighlightForeground, '#9DDDFF'), hc: listHighlightForeground }, nls.localize('listFocusHighlightForeground', 'List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.'));\nexport const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hc: '#B89500' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.'));\nexport const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hc: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.'));\nexport const listWarningForeground = registerColor('list.warningForeground', { dark: '#CCA700', light: '#855F00', hc: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.'));\nexport const listFilterWidgetBackground = registerColor('listFilterWidget.background', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listFilterWidgetBackground', 'Background color of the type filter widget in lists and trees.'));\nexport const listFilterWidgetOutline = registerColor('listFilterWidget.outline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listFilterWidgetOutline', 'Outline color of the type filter widget in lists and trees.'));\nexport const listFilterWidgetNoMatchesOutline = registerColor('listFilterWidget.noMatchesOutline', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, nls.localize('listFilterWidgetNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.'));\nexport const listFilterMatchHighlight = registerColor('list.filterMatchBackground', { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hc: null }, nls.localize('listFilterMatchHighlight', 'Background color of the filtered match.'));\nexport const listFilterMatchHighlightBorder = registerColor('list.filterMatchBorder', { dark: editorFindMatchHighlightBorder, light: editorFindMatchHighlightBorder, hc: contrastBorder }, nls.localize('listFilterMatchHighlightBorder', 'Border color of the filtered match.'));\nexport const treeIndentGuidesStroke = registerColor('tree.indentGuidesStroke', { dark: '#585858', light: '#a9a9a9', hc: '#a9a9a9' }, nls.localize('treeIndentGuidesStroke', \"Tree stroke color for the indentation guides.\"));\nexport const tableColumnsBorder = registerColor('tree.tableColumnsBorder', { dark: '#CCCCCC20', light: '#61616120', hc: null }, nls.localize('tableColumnsBorder', \"Table border color between columns.\"));\nexport const tableOddRowsBackgroundColor = registerColor('tree.tableOddRowsBackground', { dark: transparent(foreground, 0.04), light: transparent(foreground, 0.04), hc: null }, nls.localize('tableOddRowsBackgroundColor', \"Background color for odd table rows.\"));\nexport const listDeemphasizedForeground = registerColor('list.deemphasizedForeground', { dark: '#8C8C8C', light: '#8E8E90', hc: '#A7A8A9' }, nls.localize('listDeemphasizedForeground', \"List/Tree foreground color for items that are deemphasized. \"));\n\n/**\n * Quick pick widget (dependent on List and tree colors)\n */\nexport const _deprecatedQuickInputListFocusBackground = registerColor('quickInput.list.focusBackground', { dark: null, light: null, hc: null }, '', undefined, nls.localize('quickInput.list.focusBackground deprecation', \"Please use quickInputList.focusBackground instead\"));\nexport const quickInputListFocusForeground = registerColor('quickInputList.focusForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hc: listActiveSelectionForeground }, nls.localize('quickInput.listFocusForeground', \"Quick picker foreground color for the focused item.\"));\nexport const quickInputListFocusIconForeground = registerColor('quickInputList.focusIconForeground', { dark: listActiveSelectionIconForeground, light: listActiveSelectionIconForeground, hc: listActiveSelectionIconForeground }, nls.localize('quickInput.listFocusIconForeground', \"Quick picker icon foreground color for the focused item.\"));\nexport const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', { dark: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), light: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), hc: null }, nls.localize('quickInput.listFocusBackground', \"Quick picker background color for the focused item.\"));\n\n/**\n * Menu colors\n */\nexport const menuBorder = registerColor('menu.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('menuBorder', \"Border color of menus.\"));\nexport const menuForeground = registerColor('menu.foreground', { dark: selectForeground, light: foreground, hc: selectForeground }, nls.localize('menuForeground', \"Foreground color of menu items.\"));\nexport const menuBackground = registerColor('menu.background', { dark: selectBackground, light: selectBackground, hc: selectBackground }, nls.localize('menuBackground', \"Background color of menu items.\"));\nexport const menuSelectionForeground = registerColor('menu.selectionForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hc: listActiveSelectionForeground }, nls.localize('menuSelectionForeground', \"Foreground color of the selected menu item in menus.\"));\nexport const menuSelectionBackground = registerColor('menu.selectionBackground', { dark: listActiveSelectionBackground, light: listActiveSelectionBackground, hc: listActiveSelectionBackground }, nls.localize('menuSelectionBackground', \"Background color of the selected menu item in menus.\"));\nexport const menuSelectionBorder = registerColor('menu.selectionBorder', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('menuSelectionBorder', \"Border color of the selected menu item in menus.\"));\nexport const menuSeparatorBackground = registerColor('menu.separatorBackground', { dark: '#BBBBBB', light: '#888888', hc: contrastBorder }, nls.localize('menuSeparatorBackground', \"Color of a separator menu item in menus.\"));\n\n/**\n * Toolbar colors\n */\nexport const toolbarHoverBackground = registerColor('toolbar.hoverBackground', { dark: '#5a5d5e50', light: '#b8b8b850', hc: null }, nls.localize('toolbarHoverBackground', \"Toolbar background when hovering over actions using the mouse\"));\nexport const toolbarHoverOutline = registerColor('toolbar.hoverOutline', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('toolbarHoverOutline', \"Toolbar outline when hovering over actions using the mouse\"));\nexport const toolbarActiveBackground = registerColor('toolbar.activeBackground', { dark: lighten(toolbarHoverBackground, 0.1), light: darken(toolbarHoverBackground, 0.1), hc: null }, nls.localize('toolbarActiveBackground', \"Toolbar background when holding the mouse over actions\"));\n\n/**\n * Snippet placeholder colors\n */\nexport const snippetTabstopHighlightBackground = registerColor('editor.snippetTabstopHighlightBackground', { dark: new Color(new RGBA(124, 124, 124, 0.3)), light: new Color(new RGBA(10, 50, 100, 0.2)), hc: new Color(new RGBA(124, 124, 124, 0.3)) }, nls.localize('snippetTabstopHighlightBackground', \"Highlight background color of a snippet tabstop.\"));\nexport const snippetTabstopHighlightBorder = registerColor('editor.snippetTabstopHighlightBorder', { dark: null, light: null, hc: null }, nls.localize('snippetTabstopHighlightBorder', \"Highlight border color of a snippet tabstop.\"));\nexport const snippetFinalTabstopHighlightBackground = registerColor('editor.snippetFinalTabstopHighlightBackground', { dark: null, light: null, hc: null }, nls.localize('snippetFinalTabstopHighlightBackground', \"Highlight background color of the final tabstop of a snippet.\"));\nexport const snippetFinalTabstopHighlightBorder = registerColor('editor.snippetFinalTabstopHighlightBorder', { dark: '#525252', light: new Color(new RGBA(10, 50, 100, 0.5)), hc: '#525252' }, nls.localize('snippetFinalTabstopHighlightBorder', \"Highlight border color of the final tabstop of a snippet.\"));\n\n/**\n * Breadcrumb colors\n */\nexport const breadcrumbsForeground = registerColor('breadcrumb.foreground', { light: transparent(foreground, 0.8), dark: transparent(foreground, 0.8), hc: transparent(foreground, 0.8) }, nls.localize('breadcrumbsFocusForeground', \"Color of focused breadcrumb items.\"));\nexport const breadcrumbsBackground = registerColor('breadcrumb.background', { light: editorBackground, dark: editorBackground, hc: editorBackground }, nls.localize('breadcrumbsBackground', \"Background color of breadcrumb items.\"));\nexport const breadcrumbsFocusForeground = registerColor('breadcrumb.focusForeground', { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hc: lighten(foreground, 0.1) }, nls.localize('breadcrumbsFocusForeground', \"Color of focused breadcrumb items.\"));\nexport const breadcrumbsActiveSelectionForeground = registerColor('breadcrumb.activeSelectionForeground', { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hc: lighten(foreground, 0.1) }, nls.localize('breadcrumbsSelectedForegound', \"Color of selected breadcrumb items.\"));\nexport const breadcrumbsPickerBackground = registerColor('breadcrumbPicker.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('breadcrumbsSelectedBackground', \"Background color of breadcrumb item picker.\"));\n\n/**\n * Merge-conflict colors\n */\n\nconst headerTransparency = 0.5;\nconst currentBaseColor = Color.fromHex('#40C8AE').transparent(headerTransparency);\nconst incomingBaseColor = Color.fromHex('#40A6FF').transparent(headerTransparency);\nconst commonBaseColor = Color.fromHex('#606060').transparent(0.4);\nconst contentTransparency = 0.4;\nconst rulerTransparency = 1;\n\nexport const mergeCurrentHeaderBackground = registerColor('merge.currentHeaderBackground', { dark: currentBaseColor, light: currentBaseColor, hc: null }, nls.localize('mergeCurrentHeaderBackground', 'Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCurrentContentBackground = registerColor('merge.currentContentBackground', { dark: transparent(mergeCurrentHeaderBackground, contentTransparency), light: transparent(mergeCurrentHeaderBackground, contentTransparency), hc: transparent(mergeCurrentHeaderBackground, contentTransparency) }, nls.localize('mergeCurrentContentBackground', 'Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeIncomingHeaderBackground = registerColor('merge.incomingHeaderBackground', { dark: incomingBaseColor, light: incomingBaseColor, hc: null }, nls.localize('mergeIncomingHeaderBackground', 'Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeIncomingContentBackground = registerColor('merge.incomingContentBackground', { dark: transparent(mergeIncomingHeaderBackground, contentTransparency), light: transparent(mergeIncomingHeaderBackground, contentTransparency), hc: transparent(mergeIncomingHeaderBackground, contentTransparency) }, nls.localize('mergeIncomingContentBackground', 'Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCommonHeaderBackground = registerColor('merge.commonHeaderBackground', { dark: commonBaseColor, light: commonBaseColor, hc: null }, nls.localize('mergeCommonHeaderBackground', 'Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCommonContentBackground = registerColor('merge.commonContentBackground', { dark: transparent(mergeCommonHeaderBackground, contentTransparency), light: transparent(mergeCommonHeaderBackground, contentTransparency), hc: transparent(mergeCommonHeaderBackground, contentTransparency) }, nls.localize('mergeCommonContentBackground', 'Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\n\nexport const mergeBorder = registerColor('merge.border', { dark: null, light: null, hc: '#C3DF6F' }, nls.localize('mergeBorder', 'Border color on headers and the splitter in inline merge-conflicts.'));\n\nexport const overviewRulerCurrentContentForeground = registerColor('editorOverviewRuler.currentContentForeground', { dark: transparent(mergeCurrentHeaderBackground, rulerTransparency), light: transparent(mergeCurrentHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerCurrentContentForeground', 'Current overview ruler foreground for inline merge-conflicts.'));\nexport const overviewRulerIncomingContentForeground = registerColor('editorOverviewRuler.incomingContentForeground', { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerIncomingContentForeground', 'Incoming overview ruler foreground for inline merge-conflicts.'));\nexport const overviewRulerCommonContentForeground = registerColor('editorOverviewRuler.commonContentForeground', { dark: transparent(mergeCommonHeaderBackground, rulerTransparency), light: transparent(mergeCommonHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerCommonContentForeground', 'Common ancestor overview ruler foreground for inline merge-conflicts.'));\n\nexport const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', { dark: '#d186167e', light: '#d186167e', hc: '#AB5A00' }, nls.localize('overviewRulerFindMatchForeground', 'Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.'), true);\n\nexport const overviewRulerSelectionHighlightForeground = registerColor('editorOverviewRuler.selectionHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hc: '#A0A0A0CC' }, nls.localize('overviewRulerSelectionHighlightForeground', 'Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.'), true);\n\n\nexport const minimapFindMatch = registerColor('minimap.findMatchHighlight', { light: '#d18616', dark: '#d18616', hc: '#AB5A00' }, nls.localize('minimapFindMatchHighlight', 'Minimap marker color for find matches.'), true);\nexport const minimapSelectionOccurrenceHighlight = registerColor('minimap.selectionOccurrenceHighlight', { light: '#c9c9c9', dark: '#676767', hc: '#ffffff' }, nls.localize('minimapSelectionOccurrenceHighlight', 'Minimap marker color for repeating editor selections.'), true);\nexport const minimapSelection = registerColor('minimap.selectionHighlight', { light: '#ADD6FF', dark: '#264F78', hc: '#ffffff' }, nls.localize('minimapSelectionHighlight', 'Minimap marker color for the editor selection.'), true);\nexport const minimapError = registerColor('minimap.errorHighlight', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('minimapError', 'Minimap marker color for errors.'));\nexport const minimapWarning = registerColor('minimap.warningHighlight', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Minimap marker color for warnings.'));\nexport const minimapBackground = registerColor('minimap.background', { dark: null, light: null, hc: null }, nls.localize('minimapBackground', \"Minimap background color.\"));\nexport const minimapForegroundOpacity = registerColor('minimap.foregroundOpacity', { dark: Color.fromHex('#000f'), light: Color.fromHex('#000f'), hc: Color.fromHex('#000f') }, nls.localize('minimapForegroundOpacity', 'Opacity of foreground elements rendered in the minimap. For example, \"#000000c0\" will render the elements with 75% opacity.'));\n\nexport const minimapSliderBackground = registerColor('minimapSlider.background', { light: transparent(scrollbarSliderBackground, 0.5), dark: transparent(scrollbarSliderBackground, 0.5), hc: transparent(scrollbarSliderBackground, 0.5) }, nls.localize('minimapSliderBackground', \"Minimap slider background color.\"));\nexport const minimapSliderHoverBackground = registerColor('minimapSlider.hoverBackground', { light: transparent(scrollbarSliderHoverBackground, 0.5), dark: transparent(scrollbarSliderHoverBackground, 0.5), hc: transparent(scrollbarSliderHoverBackground, 0.5) }, nls.localize('minimapSliderHoverBackground', \"Minimap slider background color when hovering.\"));\nexport const minimapSliderActiveBackground = registerColor('minimapSlider.activeBackground', { light: transparent(scrollbarSliderActiveBackground, 0.5), dark: transparent(scrollbarSliderActiveBackground, 0.5), hc: transparent(scrollbarSliderActiveBackground, 0.5) }, nls.localize('minimapSliderActiveBackground', \"Minimap slider background color when clicked on.\"));\n\nexport const problemsErrorIconForeground = registerColor('problemsErrorIcon.foreground', { dark: editorErrorForeground, light: editorErrorForeground, hc: editorErrorForeground }, nls.localize('problemsErrorIconForeground', \"The color used for the problems error icon.\"));\nexport const problemsWarningIconForeground = registerColor('problemsWarningIcon.foreground', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningForeground }, nls.localize('problemsWarningIconForeground', \"The color used for the problems warning icon.\"));\nexport const problemsInfoIconForeground = registerColor('problemsInfoIcon.foreground', { dark: editorInfoForeground, light: editorInfoForeground, hc: editorInfoForeground }, nls.localize('problemsInfoIconForeground', \"The color used for the problems info icon.\"));\n\n/**\n * Chart colors\n */\nexport const chartsForeground = registerColor('charts.foreground', { dark: foreground, light: foreground, hc: foreground }, nls.localize('chartsForeground', \"The foreground color used in charts.\"));\nexport const chartsLines = registerColor('charts.lines', { dark: transparent(foreground, .5), light: transparent(foreground, .5), hc: transparent(foreground, .5) }, nls.localize('chartsLines', \"The color used for horizontal lines in charts.\"));\nexport const chartsRed = registerColor('charts.red', { dark: editorErrorForeground, light: editorErrorForeground, hc: editorErrorForeground }, nls.localize('chartsRed', \"The red color used in chart visualizations.\"));\nexport const chartsBlue = registerColor('charts.blue', { dark: editorInfoForeground, light: editorInfoForeground, hc: editorInfoForeground }, nls.localize('chartsBlue', \"The blue color used in chart visualizations.\"));\nexport const chartsYellow = registerColor('charts.yellow', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningForeground }, nls.localize('chartsYellow', \"The yellow color used in chart visualizations.\"));\nexport const chartsOrange = registerColor('charts.orange', { dark: minimapFindMatch, light: minimapFindMatch, hc: minimapFindMatch }, nls.localize('chartsOrange', \"The orange color used in chart visualizations.\"));\nexport const chartsGreen = registerColor('charts.green', { dark: '#89D185', light: '#388A34', hc: '#89D185' }, nls.localize('chartsGreen', \"The green color used in chart visualizations.\"));\nexport const chartsPurple = registerColor('charts.purple', { dark: '#B180D7', light: '#652D90', hc: '#B180D7' }, nls.localize('chartsPurple', \"The purple color used in chart visualizations.\"));\n\n// ----- color functions\n\nexport function executeTransform(transform: ColorTransform, theme: IColorTheme) {\n\tswitch (transform.op) {\n\t\tcase ColorTransformType.Darken:\n\t\t\treturn resolveColorValue(transform.value, theme)?.darken(transform.factor);\n\n\t\tcase ColorTransformType.Lighten:\n\t\t\treturn resolveColorValue(transform.value, theme)?.lighten(transform.factor);\n\n\t\tcase ColorTransformType.Transparent:\n\t\t\treturn resolveColorValue(transform.value, theme)?.transparent(transform.factor);\n\n\t\tcase ColorTransformType.OneOf:\n\t\t\tfor (const candidate of transform.values) {\n\t\t\t\tconst color = resolveColorValue(candidate, theme);\n\t\t\t\tif (color) {\n\t\t\t\t\treturn color;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\n\t\tcase ColorTransformType.IfDefinedThenElse:\n\t\t\treturn resolveColorValue(theme.defines(transform.if) ? transform.then : transform.else, theme);\n\n\t\tcase ColorTransformType.LessProminent: {\n\t\t\tconst from = resolveColorValue(transform.value, theme);\n\t\t\tif (!from) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst backgroundColor = resolveColorValue(transform.background, theme);\n\t\t\tif (!backgroundColor) {\n\t\t\t\treturn from.transparent(transform.factor * transform.transparency);\n\t\t\t}\n\n\t\t\treturn from.isDarkerThan(backgroundColor)\n\t\t\t\t? Color.getLighterColor(from, backgroundColor, transform.factor).transparent(transform.transparency)\n\t\t\t\t: Color.getDarkerColor(from, backgroundColor, transform.factor).transparent(transform.transparency);\n\t\t}\n\t\tdefault:\n\t\t\tthrow assertNever(transform);\n\t}\n}\n\nexport function darken(colorValue: ColorValue, factor: number): ColorTransform {\n\treturn { op: ColorTransformType.Darken, value: colorValue, factor };\n}\n\nexport function lighten(colorValue: ColorValue, factor: number): ColorTransform {\n\treturn { op: ColorTransformType.Lighten, value: colorValue, factor };\n}\n\nexport function transparent(colorValue: ColorValue, factor: number): ColorTransform {\n\treturn { op: ColorTransformType.Transparent, value: colorValue, factor };\n}\n\nexport function oneOf(...colorValues: ColorValue[]): ColorTransform {\n\treturn { op: ColorTransformType.OneOf, values: colorValues };\n}\n\nexport function ifDefinedThenElse(ifArg: ColorIdentifier, thenArg: ColorValue, elseArg: ColorValue): ColorTransform {\n\treturn { op: ColorTransformType.IfDefinedThenElse, if: ifArg, then: thenArg, else: elseArg };\n}\n\nfunction lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, factor: number, transparency: number): ColorTransform {\n\treturn { op: ColorTransformType.LessProminent, value: colorValue, background: backgroundColorValue, factor, transparency };\n}\n\n// ----- implementation\n\n/**\n * @param colorValue Resolve a color value in the context of a theme\n */\nexport function resolveColorValue(colorValue: ColorValue | null, theme: IColorTheme): Color | undefined {\n\tif (colorValue === null) {\n\t\treturn undefined;\n\t} else if (typeof colorValue === 'string') {\n\t\tif (colorValue[0] === '#') {\n\t\t\treturn Color.fromHex(colorValue);\n\t\t}\n\t\treturn theme.getColor(colorValue);\n\t} else if (colorValue instanceof Color) {\n\t\treturn colorValue;\n\t} else if (typeof colorValue === 'object') {\n\t\treturn executeTransform(colorValue, theme);\n\t}\n\treturn undefined;\n}\n\nexport const workbenchColorsSchemaId = 'vscode://schemas/workbench-colors';\n\nlet schemaRegistry = platform.Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\nschemaRegistry.registerSchema(workbenchColorsSchemaId, colorRegistry.getColorSchema());\n\nconst delayer = new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(workbenchColorsSchemaId), 200);\ncolorRegistry.onDidChangeSchema(() => {\n\tif (!delayer.isScheduled()) {\n\t\tdelayer.schedule();\n\t}\n});\n\n// setTimeout(_ => console.log(colorRegistry.toString()), 5000);\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 * as dom from 'vs/base/browser/dom';\nimport { GlobalMouseMoveMonitor } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { asCssVariableName } from 'vs/platform/theme/common/colorRegistry';\nimport { ThemeColor } from 'vs/platform/theme/common/themeService';\n\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n\t_pageCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n\n\tpublic toClientCoordinates(): ClientCoordinates {\n\t\treturn new ClientCoordinates(this.x - dom.StandardWindow.scrollX, this.y - dom.StandardWindow.scrollY);\n\t}\n}\n\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n\t_clientCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly clientX: number,\n\t\tpublic readonly clientY: number\n\t) { }\n\n\tpublic toPageCoordinates(): PageCoordinates {\n\t\treturn new PageCoordinates(this.clientX + dom.StandardWindow.scrollX, this.clientY + dom.StandardWindow.scrollY);\n\t}\n}\n\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n\t_editorPagePositionBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n/**\n * Coordinates relative to the the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n\t_positionRelativeToEditorBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n}\n\nexport function createEditorPagePosition(editorViewDomNode: HTMLElement): EditorPagePosition {\n\tconst editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n\treturn new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\n\nexport function createCoordinatesRelativeToEditor(editorViewDomNode: HTMLElement, editorPagePosition: EditorPagePosition, pos: PageCoordinates) {\n\t// The editor's page position is read from the DOM using getBoundingClientRect().\n\t//\n\t// getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n\t// reflect the unscaled size. We can use this difference to detect a transform:scale()\n\t// and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n\t//\n\t// This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n\t// and computing the effective transformation matrix using getComputedStyle(element).transform.\n\t//\n\tconst scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n\tconst scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n\n\t// Adjust mouse offsets if editor appears to be scaled via transforms\n\tconst relativeX = (pos.x - editorPagePosition.x) / scaleX;\n\tconst relativeY = (pos.y - editorPagePosition.y) / scaleY;\n\treturn new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\n\nexport class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void = undefined;\n\n\t/**\n\t * Coordinates relative to the whole document.\n\t */\n\tpublic readonly pos: PageCoordinates;\n\n\t/**\n\t * Editor's coordinates relative to the whole document.\n\t */\n\tpublic readonly editorPos: EditorPagePosition;\n\n\t/**\n\t * Coordinates relative to the (top;left) of the editor.\n\t * *NOTE*: These coordinates are preferred because they take into account transformations applied to the editor.\n\t * *NOTE*: These coordinates could be negative if the mouse position is outside the editor.\n\t */\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\n\tconstructor(e: MouseEvent, editorViewDomNode: HTMLElement) {\n\t\tsuper(e);\n\t\tthis.pos = new PageCoordinates(this.posx, this.posy);\n\t\tthis.editorPos = createEditorPagePosition(editorViewDomNode);\n\t\tthis.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n\t}\n}\n\nexport interface EditorMouseEventMerger {\n\t(lastEvent: EditorMouseEvent | null, currentEvent: EditorMouseEvent): EditorMouseEvent;\n}\n\nexport class EditorMouseEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, this._editorViewDomNode);\n\t}\n\n\tpublic onContextMenu(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'contextmenu', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'mouseup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'mousedown', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableNonBubblingMouseOutListener(target, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseMoveThrottled(target: HTMLElement, callback: (e: EditorMouseEvent) => void, merger: EditorMouseEventMerger, minimumTimeMs: number): IDisposable {\n\t\tconst myMerger: dom.IEventMerger<EditorMouseEvent, MouseEvent> = (lastEvent: EditorMouseEvent | null, currentEvent: MouseEvent): EditorMouseEvent => {\n\t\t\treturn merger(lastEvent, this._create(currentEvent));\n\t\t};\n\t\treturn dom.addDisposableThrottledListener<EditorMouseEvent, MouseEvent>(target, 'mousemove', callback, myMerger, minimumTimeMs);\n\t}\n}\n\nexport class EditorPointerEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, this._editorViewDomNode);\n\t}\n\n\tpublic onPointerUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerdown', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableNonBubblingPointerOutListener(target, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerMoveThrottled(target: HTMLElement, callback: (e: EditorMouseEvent) => void, merger: EditorMouseEventMerger, minimumTimeMs: number): IDisposable {\n\t\tconst myMerger: dom.IEventMerger<EditorMouseEvent, MouseEvent> = (lastEvent: EditorMouseEvent | null, currentEvent: MouseEvent): EditorMouseEvent => {\n\t\t\treturn merger(lastEvent, this._create(currentEvent));\n\t\t};\n\t\treturn dom.addDisposableThrottledListener<EditorMouseEvent, MouseEvent>(target, 'pointermove', callback, myMerger, minimumTimeMs);\n\t}\n}\n\nexport class GlobalEditorMouseMoveMonitor extends Disposable {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\tprivate readonly _globalMouseMoveMonitor: GlobalMouseMoveMonitor<EditorMouseEvent>;\n\tprivate _keydownListener: IDisposable | null;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tsuper();\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t\tthis._globalMouseMoveMonitor = this._register(new GlobalMouseMoveMonitor<EditorMouseEvent>());\n\t\tthis._keydownListener = null;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: HTMLElement,\n\t\tinitialButtons: number,\n\t\tmerger: EditorMouseEventMerger,\n\t\tmouseMoveCallback: (e: EditorMouseEvent) => void,\n\t\tonStopCallback: (browserEvent?: MouseEvent | KeyboardEvent) => void\n\t): void {\n\n\t\t// Add a <<capture>> keydown event listener that will cancel the monitoring\n\t\t// if something other than a modifier key is pressed\n\t\tthis._keydownListener = dom.addStandardDisposableListener(<any>document, 'keydown', (e) => {\n\t\t\tconst kb = e.toKeybinding();\n\t\t\tif (kb.isModifierKey()) {\n\t\t\t\t// Allow modifier keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._globalMouseMoveMonitor.stopMonitoring(true, e.browserEvent);\n\t\t}, true);\n\n\t\tconst myMerger: dom.IEventMerger<EditorMouseEvent, MouseEvent> = (lastEvent: EditorMouseEvent | null, currentEvent: MouseEvent): EditorMouseEvent => {\n\t\t\treturn merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode));\n\t\t};\n\n\t\tthis._globalMouseMoveMonitor.startMonitoring(initialElement, initialButtons, myMerger, mouseMoveCallback, (e) => {\n\t\t\tthis._keydownListener!.dispose();\n\t\t\tonStopCallback(e);\n\t\t});\n\t}\n\n\tpublic stopMonitoring(): void {\n\t\tthis._globalMouseMoveMonitor.stopMonitoring(true);\n\t}\n}\n\n\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n\tprivate static _idPool = 0;\n\tprivate readonly _instanceId = ++DynamicCssRules._idPool;\n\tprivate _counter = 0;\n\tprivate readonly _rules = new Map<string, RefCountedCssRule>();\n\n\t// We delay garbage collection so that hanging rules can be reused.\n\tprivate readonly _garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n\n\tconstructor(private readonly _editor: ICodeEditor) {\n\t}\n\n\tpublic createClassNameRef(options: CssProperties): ClassNameReference {\n\t\tconst rule = this.getOrCreateRule(options);\n\t\trule.increaseRefCount();\n\n\t\treturn {\n\t\t\tclassName: rule.className,\n\t\t\tdispose: () => {\n\t\t\t\trule.decreaseRefCount();\n\t\t\t\tthis._garbageCollectionScheduler.schedule();\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate getOrCreateRule(properties: CssProperties): RefCountedCssRule {\n\t\tconst key = this.computeUniqueKey(properties);\n\t\tlet existingRule = this._rules.get(key);\n\t\tif (!existingRule) {\n\t\t\tconst counter = this._counter++;\n\t\t\texistingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`,\n\t\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t\t: undefined,\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tthis._rules.set(key, existingRule);\n\t\t}\n\t\treturn existingRule;\n\t}\n\n\tprivate computeUniqueKey(properties: CssProperties): string {\n\t\treturn JSON.stringify(properties);\n\t}\n\n\tprivate garbageCollect() {\n\t\tfor (const rule of this._rules.values()) {\n\t\t\tif (!rule.hasReferences()) {\n\t\t\t\tthis._rules.delete(rule.key);\n\t\t\t\trule.dispose();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClassNameReference extends IDisposable {\n\tclassName: string;\n}\n\nexport interface CssProperties {\n\tborderRadius?: string;\n\tfontSize?: string;\n\tfontFamily?: string;\n\ttextDecoration?: string;\n\tcolor?: string | ThemeColor;\n\tbackgroundColor?: string | ThemeColor;\n\tverticalAlign?: string;\n\tcursor?: string;\n\tpadding?: string;\n\twidth?: string;\n\tdisplay?: string;\n}\n\nclass RefCountedCssRule {\n\tprivate _referenceCount: number = 0;\n\tprivate _styleElement: HTMLStyleElement;\n\n\tconstructor(\n\t\tpublic readonly key: string,\n\t\tpublic readonly className: string,\n\t\t_containerElement: HTMLElement | undefined,\n\t\tpublic readonly properties: CssProperties,\n\t) {\n\t\tthis._styleElement = dom.createStyleSheet(\n\t\t\t_containerElement\n\t\t);\n\n\t\tthis._styleElement.textContent = this.getCssText(this.className, this.properties);\n\t}\n\n\tprivate getCssText(className: string, properties: CssProperties): string {\n\t\tlet str = `.${className} {`;\n\t\tfor (const prop in properties) {\n\t\t\tconst value = (properties as any)[prop] as string | ThemeColor;\n\t\t\tlet cssValue;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tcssValue = `var(${asCssVariableName(value.id)})`;\n\t\t\t} else {\n\t\t\t\tcssValue = value;\n\t\t\t}\n\n\t\t\tconst cssPropName = camelToDashes(prop);\n\t\t\tstr += `\\n\\t${cssPropName}: ${cssValue};`;\n\t\t}\n\t\tstr += `\\n}`;\n\t\treturn str;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._styleElement.remove();\n\t}\n\n\tpublic increaseRefCount(): void {\n\t\tthis._referenceCount++;\n\t}\n\n\tpublic decreaseRefCount(): void {\n\t\tthis._referenceCount--;\n\t}\n\n\tpublic hasReferences(): boolean {\n\t\treturn this._referenceCount > 0;\n\t}\n}\n\nfunction camelToDashes(str: string): string {\n\treturn str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n\t\t.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\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 { Color } from 'vs/base/common/color';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IThemable, styleFn } from 'vs/base/common/styler';\nimport { activeContrastBorder, badgeBackground, badgeForeground, ColorIdentifier, ColorValue, contrastBorder, listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground, listDropBackground, listFilterWidgetBackground, listFilterWidgetNoMatchesOutline, listFilterWidgetOutline, listFocusBackground, listFocusForeground, listFocusOutline, listHoverBackground, listHoverForeground, listInactiveFocusBackground, listInactiveFocusOutline, listInactiveSelectionBackground, listInactiveSelectionForeground, listInactiveSelectionIconForeground, menuBackground, menuBorder, menuForeground, menuSelectionBackground, menuSelectionBorder, menuSelectionForeground, menuSeparatorBackground, resolveColorValue, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, tableColumnsBorder, tableOddRowsBackgroundColor, treeIndentGuidesStroke, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport interface IStyleOverrides {\n\t[color: string]: ColorIdentifier | undefined;\n}\n\nexport interface IColorMapping {\n\t[optionsKey: string]: ColorValue | undefined;\n}\n\nexport interface IComputedStyles {\n\t[color: string]: Color | undefined;\n}\n\nexport function computeStyles(theme: IColorTheme, styleMap: IColorMapping): IComputedStyles {\n\tconst styles = Object.create(null) as IComputedStyles;\n\tfor (let key in styleMap) {\n\t\tconst value = styleMap[key];\n\t\tif (value) {\n\t\t\tstyles[key] = resolveColorValue(value, theme);\n\t\t}\n\t}\n\n\treturn styles;\n}\n\nexport function attachStyler<T extends IColorMapping>(themeService: IThemeService, styleMap: T, widgetOrCallback: IThemable | styleFn): IDisposable {\n\tfunction applyStyles(): void {\n\t\tconst styles = computeStyles(themeService.getColorTheme(), styleMap);\n\n\t\tif (typeof widgetOrCallback === 'function') {\n\t\t\twidgetOrCallback(styles);\n\t\t} else {\n\t\t\twidgetOrCallback.style(styles);\n\t\t}\n\t}\n\n\tapplyStyles();\n\n\treturn themeService.onDidColorThemeChange(applyStyles);\n}\n\nexport interface IBadgeStyleOverrides extends IStyleOverrides {\n\tbadgeBackground?: ColorIdentifier;\n\tbadgeForeground?: ColorIdentifier;\n}\n\nexport function attachBadgeStyler(widget: IThemable, themeService: IThemeService, style?: IBadgeStyleOverrides): IDisposable {\n\treturn attachStyler(themeService, {\n\t\tbadgeBackground: style?.badgeBackground || badgeBackground,\n\t\tbadgeForeground: style?.badgeForeground || badgeForeground,\n\t\tbadgeBorder: contrastBorder\n\t} as IBadgeStyleOverrides, widget);\n}\n\nexport function attachListStyler(widget: IThemable, themeService: IThemeService, overrides?: IColorMapping): IDisposable {\n\treturn attachStyler(themeService, { ...defaultListStyles, ...(overrides || {}) }, widget);\n}\n\nexport const defaultListStyles: IColorMapping = {\n\tlistFocusBackground,\n\tlistFocusForeground,\n\tlistFocusOutline,\n\tlistActiveSelectionBackground,\n\tlistActiveSelectionForeground,\n\tlistActiveSelectionIconForeground,\n\tlistFocusAndSelectionBackground: listActiveSelectionBackground,\n\tlistFocusAndSelectionForeground: listActiveSelectionForeground,\n\tlistInactiveSelectionBackground,\n\tlistInactiveSelectionIconForeground,\n\tlistInactiveSelectionForeground,\n\tlistInactiveFocusBackground,\n\tlistInactiveFocusOutline,\n\tlistHoverBackground,\n\tlistHoverForeground,\n\tlistDropBackground,\n\tlistSelectionOutline: activeContrastBorder,\n\tlistHoverOutline: activeContrastBorder,\n\tlistFilterWidgetBackground,\n\tlistFilterWidgetOutline,\n\tlistFilterWidgetNoMatchesOutline,\n\tlistMatchesShadow: widgetShadow,\n\ttreeIndentGuidesStroke,\n\ttableColumnsBorder,\n\ttableOddRowsBackgroundColor\n};\n\nexport interface IMenuStyleOverrides extends IColorMapping {\n\tshadowColor?: ColorIdentifier;\n\tborderColor?: ColorIdentifier;\n\tforegroundColor?: ColorIdentifier;\n\tbackgroundColor?: ColorIdentifier;\n\tselectionForegroundColor?: ColorIdentifier;\n\tselectionBackgroundColor?: ColorIdentifier;\n\tselectionBorderColor?: ColorIdentifier;\n\tseparatorColor?: ColorIdentifier;\n}\n\nexport const defaultMenuStyles = <IMenuStyleOverrides>{\n\tshadowColor: widgetShadow,\n\tborderColor: menuBorder,\n\tforegroundColor: menuForeground,\n\tbackgroundColor: menuBackground,\n\tselectionForegroundColor: menuSelectionForeground,\n\tselectionBackgroundColor: menuSelectionBackground,\n\tselectionBorderColor: menuSelectionBorder,\n\tseparatorColor: menuSeparatorBackground,\n\tscrollbarShadow: scrollbarShadow,\n\tscrollbarSliderBackground: scrollbarSliderBackground,\n\tscrollbarSliderHoverBackground: scrollbarSliderHoverBackground,\n\tscrollbarSliderActiveBackground: scrollbarSliderActiveBackground\n};\n\nexport function attachMenuStyler(widget: IThemable, themeService: IThemeService, style?: IMenuStyleOverrides): IDisposable {\n\treturn attachStyler(themeService, { ...defaultMenuStyles, ...style }, widget);\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 { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { $, addDisposableListener, EventType, isHTMLElement } from 'vs/base/browser/dom';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Menu } from 'vs/base/browser/ui/menu/menu';\nimport { ActionRunner, IRunEvent, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';\nimport { isCancellationError } from 'vs/base/common/errors';\nimport { combinedDisposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport 'vs/css!./contextMenuHandler';\nimport { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { attachMenuStyler } from 'vs/platform/theme/common/styler';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\n\nexport interface IContextMenuHandlerOptions {\n\tblockMouse: boolean;\n}\n\nexport class ContextMenuHandler {\n\tprivate focusToReturn: HTMLElement | null = null;\n\tprivate block: HTMLElement | null = null;\n\tprivate options: IContextMenuHandlerOptions = { blockMouse: true };\n\n\tconstructor(\n\t\tprivate contextViewService: IContextViewService,\n\t\tprivate telemetryService: ITelemetryService,\n\t\tprivate notificationService: INotificationService,\n\t\tprivate keybindingService: IKeybindingService,\n\t\tprivate themeService: IThemeService\n\t) { }\n\n\tconfigure(options: IContextMenuHandlerOptions): void {\n\t\tthis.options = options;\n\t}\n\n\tshowContextMenu(delegate: IContextMenuDelegate): void {\n\t\tconst actions = delegate.getActions();\n\t\tif (!actions.length) {\n\t\t\treturn; // Don't render an empty context menu\n\t\t}\n\n\t\tthis.focusToReturn = document.activeElement as HTMLElement;\n\n\t\tlet menu: Menu | undefined;\n\n\t\tlet shadowRootElement = isHTMLElement(delegate.domForShadowRoot) ? delegate.domForShadowRoot : undefined;\n\t\tthis.contextViewService.showContextView({\n\t\t\tgetAnchor: () => delegate.getAnchor(),\n\t\t\tcanRelayout: false,\n\t\t\tanchorAlignment: delegate.anchorAlignment,\n\t\t\tanchorAxisAlignment: delegate.anchorAxisAlignment,\n\n\t\t\trender: (container) => {\n\t\t\t\tlet className = delegate.getMenuClassName ? delegate.getMenuClassName() : '';\n\n\t\t\t\tif (className) {\n\t\t\t\t\tcontainer.className += ' ' + className;\n\t\t\t\t}\n\n\t\t\t\t// Render invisible div to block mouse interaction in the rest of the UI\n\t\t\t\tif (this.options.blockMouse) {\n\t\t\t\t\tthis.block = container.appendChild($('.context-view-block'));\n\t\t\t\t\tthis.block.style.position = 'fixed';\n\t\t\t\t\tthis.block.style.cursor = 'initial';\n\t\t\t\t\tthis.block.style.left = '0';\n\t\t\t\t\tthis.block.style.top = '0';\n\t\t\t\t\tthis.block.style.width = '100%';\n\t\t\t\t\tthis.block.style.height = '100%';\n\t\t\t\t\tthis.block.style.zIndex = '-1';\n\n\t\t\t\t\t// TODO@Steven: this is never getting disposed\n\t\t\t\t\taddDisposableListener(this.block, EventType.MOUSE_DOWN, e => e.stopPropagation());\n\t\t\t\t}\n\n\t\t\t\tconst menuDisposables = new DisposableStore();\n\n\t\t\t\tconst actionRunner = delegate.actionRunner || new ActionRunner();\n\t\t\t\tactionRunner.onBeforeRun(this.onActionRun, this, menuDisposables);\n\t\t\t\tactionRunner.onDidRun(this.onDidActionRun, this, menuDisposables);\n\t\t\t\tmenu = new Menu(container, actions, {\n\t\t\t\t\tactionViewItemProvider: delegate.getActionViewItem,\n\t\t\t\t\tcontext: delegate.getActionsContext ? delegate.getActionsContext() : null,\n\t\t\t\t\tactionRunner,\n\t\t\t\t\tgetKeyBinding: delegate.getKeyBinding ? delegate.getKeyBinding : action => this.keybindingService.lookupKeybinding(action.id)\n\t\t\t\t});\n\n\t\t\t\tmenuDisposables.add(attachMenuStyler(menu, this.themeService));\n\n\t\t\t\tmenu.onDidCancel(() => this.contextViewService.hideContextView(true), null, menuDisposables);\n\t\t\t\tmenu.onDidBlur(() => this.contextViewService.hideContextView(true), null, menuDisposables);\n\t\t\t\tmenuDisposables.add(addDisposableListener(window, EventType.BLUR, () => this.contextViewService.hideContextView(true)));\n\t\t\t\tmenuDisposables.add(addDisposableListener(window, EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\t\t\tif (e.defaultPrevented) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet event = new StandardMouseEvent(e);\n\t\t\t\t\tlet element: HTMLElement | null = event.target;\n\n\t\t\t\t\t// Don't do anything as we are likely creating a context menu\n\t\t\t\t\tif (event.rightButton) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (element) {\n\t\t\t\t\t\tif (element === container) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement = element.parentElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.contextViewService.hideContextView(true);\n\t\t\t\t}));\n\n\t\t\t\treturn combinedDisposable(menuDisposables, menu);\n\t\t\t},\n\n\t\t\tfocus: () => {\n\t\t\t\tif (menu) {\n\t\t\t\t\tmenu.focus(!!delegate.autoSelectFirstItem);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonHide: (didCancel?: boolean) => {\n\t\t\t\tif (delegate.onHide) {\n\t\t\t\t\tdelegate.onHide(!!didCancel);\n\t\t\t\t}\n\n\t\t\t\tif (this.block) {\n\t\t\t\t\tthis.block.remove();\n\t\t\t\t\tthis.block = null;\n\t\t\t\t}\n\n\t\t\t\tif (this.focusToReturn) {\n\t\t\t\t\tthis.focusToReturn.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}, shadowRootElement, !!shadowRootElement);\n\t}\n\n\tprivate onActionRun(e: IRunEvent): void {\n\t\tthis.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: e.action.id, from: 'contextMenu' });\n\n\t\tthis.contextViewService.hideContextView(false);\n\n\t\t// Restore focus here\n\t\tif (this.focusToReturn) {\n\t\t\tthis.focusToReturn.focus();\n\t\t}\n\t}\n\n\tprivate onDidActionRun(e: IRunEvent): void {\n\t\tif (e.error && !isCancellationError(e.error)) {\n\t\t\tthis.notificationService.error(e.error);\n\t\t}\n\t}\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\n/**\n * Color scheme used by the OS and by color themes.\n */\nexport enum ColorScheme {\n\tDARK = 'dark',\n\tLIGHT = 'light',\n\tHIGH_CONTRAST = 'hc'\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 * as browser from 'vs/base/browser/browser';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport * as platform from 'vs/base/common/platform';\nimport { IVisibleLine } from 'vs/editor/browser/view/viewLayer';\nimport { RangeUtil } from 'vs/editor/browser/viewParts/lines/rangeUtil';\nimport { IStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { FloatHorizontalRange, VisibleRanges } from 'vs/editor/browser/view/renderingContext';\nimport { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { CharacterMapping, ForeignElementType, RenderLineInput, renderViewLine, LineRange, DomPosition } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { InlineDecorationType } from 'vs/editor/common/viewModel';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\nimport { EditorOption, EditorFontLigatures } from 'vs/editor/common/config/editorOptions';\n\nconst canUseFastRenderedViewLine = (function () {\n\tif (platform.isNative) {\n\t\t// In VSCode we know very well when the zoom level changes\n\t\treturn true;\n\t}\n\n\tif (platform.isLinux || browser.isFirefox || browser.isSafari) {\n\t\t// On Linux, it appears that zooming affects char widths (in pixels), which is unexpected.\n\t\t// --\n\t\t// Even though we read character widths correctly, having read them at a specific zoom level\n\t\t// does not mean they are the same at the current zoom level.\n\t\t// --\n\t\t// This could be improved if we ever figure out how to get an event when browsers zoom,\n\t\t// but until then we have to stick with reading client rects.\n\t\t// --\n\t\t// The same has been observed with Firefox on Windows7\n\t\t// --\n\t\t// The same has been oversved with Safari\n\t\treturn false;\n\t}\n\n\treturn true;\n})();\n\nlet monospaceAssumptionsAreValid = true;\n\nexport class DomReadingContext {\n\n\tprivate readonly _domNode: HTMLElement;\n\tprivate _clientRectDeltaLeft: number;\n\tprivate _clientRectScale: number;\n\tprivate _clientRectRead: boolean;\n\n\tprivate readClientRect(): void {\n\t\tif (!this._clientRectRead) {\n\t\t\tthis._clientRectRead = true;\n\t\t\tconst rect = this._domNode.getBoundingClientRect();\n\t\t\tthis._clientRectDeltaLeft = rect.left;\n\t\t\tthis._clientRectScale = rect.width / this._domNode.offsetWidth;\n\t\t}\n\t}\n\n\tpublic get clientRectDeltaLeft(): number {\n\t\tif (!this._clientRectRead) {\n\t\t\tthis.readClientRect();\n\t\t}\n\t\treturn this._clientRectDeltaLeft;\n\t}\n\n\tpublic get clientRectScale(): number {\n\t\tif (!this._clientRectRead) {\n\t\t\tthis.readClientRect();\n\t\t}\n\t\treturn this._clientRectScale;\n\t}\n\n\tpublic readonly endNode: HTMLElement;\n\n\tconstructor(domNode: HTMLElement, endNode: HTMLElement) {\n\t\tthis._domNode = domNode;\n\t\tthis._clientRectDeltaLeft = 0;\n\t\tthis._clientRectScale = 1;\n\t\tthis._clientRectRead = false;\n\t\tthis.endNode = endNode;\n\t}\n\n}\n\nexport class ViewLineOptions {\n\tpublic readonly themeType: ColorScheme;\n\tpublic readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';\n\tpublic readonly renderControlCharacters: boolean;\n\tpublic readonly spaceWidth: number;\n\tpublic readonly middotWidth: number;\n\tpublic readonly wsmiddotWidth: number;\n\tpublic readonly useMonospaceOptimizations: boolean;\n\tpublic readonly canUseHalfwidthRightwardsArrow: boolean;\n\tpublic readonly lineHeight: number;\n\tpublic readonly stopRenderingLineAfter: number;\n\tpublic readonly fontLigatures: string;\n\n\tconstructor(config: IEditorConfiguration, themeType: ColorScheme) {\n\t\tthis.themeType = themeType;\n\t\tconst options = config.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tthis.renderWhitespace = options.get(EditorOption.renderWhitespace);\n\t\tthis.renderControlCharacters = options.get(EditorOption.renderControlCharacters);\n\t\tthis.spaceWidth = fontInfo.spaceWidth;\n\t\tthis.middotWidth = fontInfo.middotWidth;\n\t\tthis.wsmiddotWidth = fontInfo.wsmiddotWidth;\n\t\tthis.useMonospaceOptimizations = (\n\t\t\tfontInfo.isMonospace\n\t\t\t&& !options.get(EditorOption.disableMonospaceOptimizations)\n\t\t);\n\t\tthis.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow;\n\t\tthis.lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis.stopRenderingLineAfter = options.get(EditorOption.stopRenderingLineAfter);\n\t\tthis.fontLigatures = options.get(EditorOption.fontLigatures);\n\t}\n\n\tpublic equals(other: ViewLineOptions): boolean {\n\t\treturn (\n\t\t\tthis.themeType === other.themeType\n\t\t\t&& this.renderWhitespace === other.renderWhitespace\n\t\t\t&& this.renderControlCharacters === other.renderControlCharacters\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.useMonospaceOptimizations === other.useMonospaceOptimizations\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.stopRenderingLineAfter === other.stopRenderingLineAfter\n\t\t\t&& this.fontLigatures === other.fontLigatures\n\t\t);\n\t}\n}\n\nexport class ViewLine implements IVisibleLine {\n\n\tpublic static readonly CLASS_NAME = 'view-line';\n\n\tprivate _options: ViewLineOptions;\n\tprivate _isMaybeInvalid: boolean;\n\tprivate _renderedViewLine: IRenderedViewLine | null;\n\n\tconstructor(options: ViewLineOptions) {\n\t\tthis._options = options;\n\t\tthis._isMaybeInvalid = true;\n\t\tthis._renderedViewLine = null;\n\t}\n\n\t// --- begin IVisibleLineData\n\n\tpublic getDomNode(): HTMLElement | null {\n\t\tif (this._renderedViewLine && this._renderedViewLine.domNode) {\n\t\t\treturn this._renderedViewLine.domNode.domNode;\n\t\t}\n\t\treturn null;\n\t}\n\tpublic setDomNode(domNode: HTMLElement): void {\n\t\tif (this._renderedViewLine) {\n\t\t\tthis._renderedViewLine.domNode = createFastDomNode(domNode);\n\t\t} else {\n\t\t\tthrow new Error('I have no rendered view line to set the dom node to...');\n\t\t}\n\t}\n\n\tpublic onContentChanged(): void {\n\t\tthis._isMaybeInvalid = true;\n\t}\n\tpublic onTokensChanged(): void {\n\t\tthis._isMaybeInvalid = true;\n\t}\n\tpublic onDecorationsChanged(): void {\n\t\tthis._isMaybeInvalid = true;\n\t}\n\tpublic onOptionsChanged(newOptions: ViewLineOptions): void {\n\t\tthis._isMaybeInvalid = true;\n\t\tthis._options = newOptions;\n\t}\n\tpublic onSelectionChanged(): boolean {\n\t\tif (this._options.themeType === ColorScheme.HIGH_CONTRAST || this._options.renderWhitespace === 'selection') {\n\t\t\tthis._isMaybeInvalid = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic renderLine(lineNumber: number, deltaTop: number, viewportData: ViewportData, sb: IStringBuilder): boolean {\n\t\tif (this._isMaybeInvalid === false) {\n\t\t\t// it appears that nothing relevant has changed\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._isMaybeInvalid = false;\n\n\t\tconst lineData = viewportData.getViewLineRenderingData(lineNumber);\n\t\tconst options = this._options;\n\t\tconst actualInlineDecorations = LineDecoration.filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn);\n\n\t\t// Only send selection information when needed for rendering whitespace\n\t\tlet selectionsOnLine: LineRange[] | null = null;\n\t\tif (options.themeType === ColorScheme.HIGH_CONTRAST || this._options.renderWhitespace === 'selection') {\n\t\t\tconst selections = viewportData.selections;\n\t\t\tfor (const selection of selections) {\n\n\t\t\t\tif (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) {\n\t\t\t\t\t// Selection does not intersect line\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst startColumn = (selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn);\n\t\t\t\tconst endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn);\n\n\t\t\t\tif (startColumn < endColumn) {\n\t\t\t\t\tif (options.themeType === ColorScheme.HIGH_CONTRAST || this._options.renderWhitespace !== 'selection') {\n\t\t\t\t\t\tactualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', InlineDecorationType.Regular));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!selectionsOnLine) {\n\t\t\t\t\t\t\tselectionsOnLine = [];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tselectionsOnLine.push(new LineRange(startColumn - 1, endColumn - 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst renderLineInput = new RenderLineInput(\n\t\t\toptions.useMonospaceOptimizations,\n\t\t\toptions.canUseHalfwidthRightwardsArrow,\n\t\t\tlineData.content,\n\t\t\tlineData.continuesWithWrappedLine,\n\t\t\tlineData.isBasicASCII,\n\t\t\tlineData.containsRTL,\n\t\t\tlineData.minColumn - 1,\n\t\t\tlineData.tokens,\n\t\t\tactualInlineDecorations,\n\t\t\tlineData.tabSize,\n\t\t\tlineData.startVisibleColumn,\n\t\t\toptions.spaceWidth,\n\t\t\toptions.middotWidth,\n\t\t\toptions.wsmiddotWidth,\n\t\t\toptions.stopRenderingLineAfter,\n\t\t\toptions.renderWhitespace,\n\t\t\toptions.renderControlCharacters,\n\t\t\toptions.fontLigatures !== EditorFontLigatures.OFF,\n\t\t\tselectionsOnLine\n\t\t);\n\n\t\tif (this._renderedViewLine && this._renderedViewLine.input.equals(renderLineInput)) {\n\t\t\t// no need to do anything, we have the same render input\n\t\t\treturn false;\n\t\t}\n\n\t\tsb.appendASCIIString('<div style=\"top:');\n\t\tsb.appendASCIIString(String(deltaTop));\n\t\tsb.appendASCIIString('px;height:');\n\t\tsb.appendASCIIString(String(this._options.lineHeight));\n\t\tsb.appendASCIIString('px;\" class=\"');\n\t\tsb.appendASCIIString(ViewLine.CLASS_NAME);\n\t\tsb.appendASCIIString('\">');\n\n\t\tconst output = renderViewLine(renderLineInput, sb);\n\n\t\tsb.appendASCIIString('</div>');\n\n\t\tlet renderedViewLine: IRenderedViewLine | null = null;\n\t\tif (monospaceAssumptionsAreValid && canUseFastRenderedViewLine && lineData.isBasicASCII && options.useMonospaceOptimizations && output.containsForeignElements === ForeignElementType.None) {\n\t\t\tif (lineData.content.length < 300 && renderLineInput.lineTokens.getCount() < 100) {\n\t\t\t\t// Browser rounding errors have been observed in Chrome and IE, so using the fast\n\t\t\t\t// view line only for short lines. Please test before removing the length check...\n\t\t\t\t// ---\n\t\t\t\t// Another rounding error has been observed on Linux in VSCode, where <span> width\n\t\t\t\t// rounding errors add up to an observable large number...\n\t\t\t\t// ---\n\t\t\t\t// Also see another example of rounding errors on Windows in\n\t\t\t\t// https://github.com/microsoft/vscode/issues/33178\n\t\t\t\trenderedViewLine = new FastRenderedViewLine(\n\t\t\t\t\tthis._renderedViewLine ? this._renderedViewLine.domNode : null,\n\t\t\t\t\trenderLineInput,\n\t\t\t\t\toutput.characterMapping\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!renderedViewLine) {\n\t\t\trenderedViewLine = createRenderedLine(\n\t\t\t\tthis._renderedViewLine ? this._renderedViewLine.domNode : null,\n\t\t\t\trenderLineInput,\n\t\t\t\toutput.characterMapping,\n\t\t\t\toutput.containsRTL,\n\t\t\t\toutput.containsForeignElements\n\t\t\t);\n\t\t}\n\n\t\tthis._renderedViewLine = renderedViewLine;\n\n\t\treturn true;\n\t}\n\n\tpublic layoutLine(lineNumber: number, deltaTop: number): void {\n\t\tif (this._renderedViewLine && this._renderedViewLine.domNode) {\n\t\t\tthis._renderedViewLine.domNode.setTop(deltaTop);\n\t\t\tthis._renderedViewLine.domNode.setHeight(this._options.lineHeight);\n\t\t}\n\t}\n\n\t// --- end IVisibleLineData\n\n\tpublic getWidth(): number {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._renderedViewLine.getWidth();\n\t}\n\n\tpublic getWidthIsFast(): boolean {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn true;\n\t\t}\n\t\treturn this._renderedViewLine.getWidthIsFast();\n\t}\n\n\tpublic needsMonospaceFontCheck(): boolean {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (this._renderedViewLine instanceof FastRenderedViewLine);\n\t}\n\n\tpublic monospaceAssumptionsAreValid(): boolean {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn monospaceAssumptionsAreValid;\n\t\t}\n\t\tif (this._renderedViewLine instanceof FastRenderedViewLine) {\n\t\t\treturn this._renderedViewLine.monospaceAssumptionsAreValid();\n\t\t}\n\t\treturn monospaceAssumptionsAreValid;\n\t}\n\n\tpublic onMonospaceAssumptionsInvalidated(): void {\n\t\tif (this._renderedViewLine && this._renderedViewLine instanceof FastRenderedViewLine) {\n\t\t\tthis._renderedViewLine = this._renderedViewLine.toSlowRenderedLine();\n\t\t}\n\t}\n\n\tpublic getVisibleRangesForRange(lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): VisibleRanges | null {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn null;\n\t\t}\n\n\t\tstartColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, startColumn));\n\t\tendColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, endColumn));\n\n\t\tconst stopRenderingLineAfter = this._renderedViewLine.input.stopRenderingLineAfter;\n\t\tlet outsideRenderedLine = false;\n\n\t\tif (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1 && endColumn > stopRenderingLineAfter + 1) {\n\t\t\t// This range is obviously not visible\n\t\t\toutsideRenderedLine = true;\n\t\t}\n\n\t\tif (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1) {\n\t\t\tstartColumn = stopRenderingLineAfter + 1;\n\t\t}\n\n\t\tif (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter + 1) {\n\t\t\tendColumn = stopRenderingLineAfter + 1;\n\t\t}\n\n\t\tconst horizontalRanges = this._renderedViewLine.getVisibleRangesForRange(lineNumber, startColumn, endColumn, context);\n\t\tif (horizontalRanges && horizontalRanges.length > 0) {\n\t\t\treturn new VisibleRanges(outsideRenderedLine, horizontalRanges);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getColumnOfNodeOffset(lineNumber: number, spanNode: HTMLElement, offset: number): number {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn this._renderedViewLine.getColumnOfNodeOffset(lineNumber, spanNode, offset);\n\t}\n}\n\ninterface IRenderedViewLine {\n\tdomNode: FastDomNode<HTMLElement> | null;\n\treadonly input: RenderLineInput;\n\tgetWidth(): number;\n\tgetWidthIsFast(): boolean;\n\tgetVisibleRangesForRange(lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null;\n\tgetColumnOfNodeOffset(lineNumber: number, spanNode: HTMLElement, offset: number): number;\n}\n\n/**\n * A rendered line which is guaranteed to contain only regular ASCII and is rendered with a monospace font.\n */\nclass FastRenderedViewLine implements IRenderedViewLine {\n\n\tpublic domNode: FastDomNode<HTMLElement> | null;\n\tpublic readonly input: RenderLineInput;\n\n\tprivate readonly _characterMapping: CharacterMapping;\n\tprivate readonly _charWidth: number;\n\n\tconstructor(domNode: FastDomNode<HTMLElement> | null, renderLineInput: RenderLineInput, characterMapping: CharacterMapping) {\n\t\tthis.domNode = domNode;\n\t\tthis.input = renderLineInput;\n\n\t\tthis._characterMapping = characterMapping;\n\t\tthis._charWidth = renderLineInput.spaceWidth;\n\t}\n\n\tpublic getWidth(): number {\n\t\treturn Math.round(this._getCharPosition(this._characterMapping.length));\n\t}\n\n\tpublic getWidthIsFast(): boolean {\n\t\treturn true;\n\t}\n\n\tpublic monospaceAssumptionsAreValid(): boolean {\n\t\tif (!this.domNode) {\n\t\t\treturn monospaceAssumptionsAreValid;\n\t\t}\n\t\tconst expectedWidth = this.getWidth();\n\t\tconst actualWidth = (<HTMLSpanElement>this.domNode.domNode.firstChild).offsetWidth;\n\t\tif (Math.abs(expectedWidth - actualWidth) >= 2) {\n\t\t\t// more than 2px off\n\t\t\tconsole.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`);\n\t\t\tmonospaceAssumptionsAreValid = false;\n\t\t}\n\t\treturn monospaceAssumptionsAreValid;\n\t}\n\n\tpublic toSlowRenderedLine(): RenderedViewLine {\n\t\treturn createRenderedLine(this.domNode, this.input, this._characterMapping, false, ForeignElementType.None);\n\t}\n\n\tpublic getVisibleRangesForRange(lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null {\n\t\tconst startPosition = this._getCharPosition(startColumn);\n\t\tconst endPosition = this._getCharPosition(endColumn);\n\t\treturn [new FloatHorizontalRange(startPosition, endPosition - startPosition)];\n\t}\n\n\tprivate _getCharPosition(column: number): number {\n\t\tconst charOffset = this._characterMapping.getAbsoluteOffset(column);\n\t\treturn this._charWidth * charOffset;\n\t}\n\n\tpublic getColumnOfNodeOffset(lineNumber: number, spanNode: HTMLElement, offset: number): number {\n\t\tconst spanNodeTextContentLength = spanNode.textContent!.length;\n\n\t\tlet spanIndex = -1;\n\t\twhile (spanNode) {\n\t\t\tspanNode = <HTMLElement>spanNode.previousSibling;\n\t\t\tspanIndex++;\n\t\t}\n\n\t\treturn this._characterMapping.getColumn(new DomPosition(spanIndex, offset), spanNodeTextContentLength);\n\t}\n}\n\n/**\n * Every time we render a line, we save what we have rendered in an instance of this class.\n */\nclass RenderedViewLine implements IRenderedViewLine {\n\n\tpublic domNode: FastDomNode<HTMLElement> | null;\n\tpublic readonly input: RenderLineInput;\n\n\tprotected readonly _characterMapping: CharacterMapping;\n\tprivate readonly _isWhitespaceOnly: boolean;\n\tprivate readonly _containsForeignElements: ForeignElementType;\n\tprivate _cachedWidth: number;\n\n\t/**\n\t * This is a map that is used only when the line is guaranteed to have no RTL text.\n\t */\n\tprivate readonly _pixelOffsetCache: Float32Array | null;\n\n\tconstructor(domNode: FastDomNode<HTMLElement> | null, renderLineInput: RenderLineInput, characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType) {\n\t\tthis.domNode = domNode;\n\t\tthis.input = renderLineInput;\n\t\tthis._characterMapping = characterMapping;\n\t\tthis._isWhitespaceOnly = /^\\s*$/.test(renderLineInput.lineContent);\n\t\tthis._containsForeignElements = containsForeignElements;\n\t\tthis._cachedWidth = -1;\n\n\t\tthis._pixelOffsetCache = null;\n\t\tif (!containsRTL || this._characterMapping.length === 0 /* the line is empty */) {\n\t\t\tthis._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));\n\t\t\tfor (let column = 0, len = this._characterMapping.length; column <= len; column++) {\n\t\t\t\tthis._pixelOffsetCache[column] = -1;\n\t\t\t}\n\t\t}\n\t}\n\n\t// --- Reading from the DOM methods\n\n\tprotected _getReadingTarget(myDomNode: FastDomNode<HTMLElement>): HTMLElement {\n\t\treturn <HTMLSpanElement>myDomNode.domNode.firstChild;\n\t}\n\n\t/**\n\t * Width of the line in pixels\n\t */\n\tpublic getWidth(): number {\n\t\tif (!this.domNode) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this._cachedWidth === -1) {\n\t\t\tthis._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth;\n\t\t}\n\t\treturn this._cachedWidth;\n\t}\n\n\tpublic getWidthIsFast(): boolean {\n\t\tif (this._cachedWidth === -1) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Visible ranges for a model range\n\t */\n\tpublic getVisibleRangesForRange(lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null {\n\t\tif (!this.domNode) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this._pixelOffsetCache !== null) {\n\t\t\t// the text is LTR\n\t\t\tconst startOffset = this._readPixelOffset(this.domNode, lineNumber, startColumn, context);\n\t\t\tif (startOffset === -1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst endOffset = this._readPixelOffset(this.domNode, lineNumber, endColumn, context);\n\t\t\tif (endOffset === -1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn [new FloatHorizontalRange(startOffset, endOffset - startOffset)];\n\t\t}\n\n\t\treturn this._readVisibleRangesForRange(this.domNode, lineNumber, startColumn, endColumn, context);\n\t}\n\n\tprotected _readVisibleRangesForRange(domNode: FastDomNode<HTMLElement>, lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null {\n\t\tif (startColumn === endColumn) {\n\t\t\tconst pixelOffset = this._readPixelOffset(domNode, lineNumber, startColumn, context);\n\t\t\tif (pixelOffset === -1) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn [new FloatHorizontalRange(pixelOffset, 0)];\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._readRawVisibleRangesForRange(domNode, startColumn, endColumn, context);\n\t\t}\n\t}\n\n\tprotected _readPixelOffset(domNode: FastDomNode<HTMLElement>, lineNumber: number, column: number, context: DomReadingContext): number {\n\t\tif (this._characterMapping.length === 0) {\n\t\t\t// This line has no content\n\t\t\tif (this._containsForeignElements === ForeignElementType.None) {\n\t\t\t\t// We can assume the line is really empty\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (this._containsForeignElements === ForeignElementType.After) {\n\t\t\t\t// We have foreign elements after the (empty) line\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (this._containsForeignElements === ForeignElementType.Before) {\n\t\t\t\t// We have foreign elements before the (empty) line\n\t\t\t\treturn this.getWidth();\n\t\t\t}\n\t\t\t// We have foreign elements before & after the (empty) line\n\t\t\tconst readingTarget = this._getReadingTarget(domNode);\n\t\t\tif (readingTarget.firstChild) {\n\t\t\t\treturn (<HTMLSpanElement>readingTarget.firstChild).offsetWidth;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tif (this._pixelOffsetCache !== null) {\n\t\t\t// the text is LTR\n\n\t\t\tconst cachedPixelOffset = this._pixelOffsetCache[column];\n\t\t\tif (cachedPixelOffset !== -1) {\n\t\t\t\treturn cachedPixelOffset;\n\t\t\t}\n\n\t\t\tconst result = this._actualReadPixelOffset(domNode, lineNumber, column, context);\n\t\t\tthis._pixelOffsetCache[column] = result;\n\t\t\treturn result;\n\t\t}\n\n\t\treturn this._actualReadPixelOffset(domNode, lineNumber, column, context);\n\t}\n\n\tprivate _actualReadPixelOffset(domNode: FastDomNode<HTMLElement>, lineNumber: number, column: number, context: DomReadingContext): number {\n\t\tif (this._characterMapping.length === 0) {\n\t\t\t// This line has no content\n\t\t\tconst r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), 0, 0, 0, 0, context.clientRectDeltaLeft, context.clientRectScale, context.endNode);\n\t\t\tif (!r || r.length === 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn r[0].left;\n\t\t}\n\n\t\tif (column === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === ForeignElementType.None) {\n\t\t\t// This branch helps in the case of whitespace only lines which have a width set\n\t\t\treturn this.getWidth();\n\t\t}\n\n\t\tconst domPosition = this._characterMapping.getDomPosition(column);\n\n\t\tconst r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context.clientRectDeltaLeft, context.clientRectScale, context.endNode);\n\t\tif (!r || r.length === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tconst result = r[0].left;\n\t\tif (this.input.isBasicASCII) {\n\t\t\tconst charOffset = this._characterMapping.getAbsoluteOffset(column);\n\t\t\tconst expectedResult = Math.round(this.input.spaceWidth * charOffset);\n\t\t\tif (Math.abs(expectedResult - result) <= 1) {\n\t\t\t\treturn expectedResult;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _readRawVisibleRangesForRange(domNode: FastDomNode<HTMLElement>, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null {\n\n\t\tif (startColumn === 1 && endColumn === this._characterMapping.length) {\n\t\t\t// This branch helps IE with bidi text & gives a performance boost to other browsers when reading visible ranges for an entire line\n\n\t\t\treturn [new FloatHorizontalRange(0, this.getWidth())];\n\t\t}\n\n\t\tconst startDomPosition = this._characterMapping.getDomPosition(startColumn);\n\t\tconst endDomPosition = this._characterMapping.getDomPosition(endColumn);\n\n\t\treturn RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), startDomPosition.partIndex, startDomPosition.charIndex, endDomPosition.partIndex, endDomPosition.charIndex, context.clientRectDeltaLeft, context.clientRectScale, context.endNode);\n\t}\n\n\t/**\n\t * Returns the column for the text found at a specific offset inside a rendered dom node\n\t */\n\tpublic getColumnOfNodeOffset(lineNumber: number, spanNode: HTMLElement, offset: number): number {\n\t\tconst spanNodeTextContentLength = spanNode.textContent!.length;\n\n\t\tlet spanIndex = -1;\n\t\twhile (spanNode) {\n\t\t\tspanNode = <HTMLElement>spanNode.previousSibling;\n\t\t\tspanIndex++;\n\t\t}\n\n\t\treturn this._characterMapping.getColumn(new DomPosition(spanIndex, offset), spanNodeTextContentLength);\n\t}\n}\n\nclass WebKitRenderedViewLine extends RenderedViewLine {\n\tprotected override _readVisibleRangesForRange(domNode: FastDomNode<HTMLElement>, lineNumber: number, startColumn: number, endColumn: number, context: DomReadingContext): FloatHorizontalRange[] | null {\n\t\tconst output = super._readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context);\n\n\t\tif (!output || output.length === 0 || startColumn === endColumn || (startColumn === 1 && endColumn === this._characterMapping.length)) {\n\t\t\treturn output;\n\t\t}\n\n\t\t// WebKit is buggy and returns an expanded range (to contain words in some cases)\n\t\t// The last client rect is enlarged (I think)\n\t\tif (!this.input.containsRTL) {\n\t\t\t// This is an attempt to patch things up\n\t\t\t// Find position of last column\n\t\t\tconst endPixelOffset = this._readPixelOffset(domNode, lineNumber, endColumn, context);\n\t\t\tif (endPixelOffset !== -1) {\n\t\t\t\tconst lastRange = output[output.length - 1];\n\t\t\t\tif (lastRange.left < endPixelOffset) {\n\t\t\t\t\t// Trim down the width of the last visible range to not go after the last column's position\n\t\t\t\t\tlastRange.width = endPixelOffset - lastRange.left;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n}\n\nconst createRenderedLine: (domNode: FastDomNode<HTMLElement> | null, renderLineInput: RenderLineInput, characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType) => RenderedViewLine = (function () {\n\tif (browser.isWebKit) {\n\t\treturn createWebKitRenderedLine;\n\t}\n\treturn createNormalRenderedLine;\n})();\n\nfunction createWebKitRenderedLine(domNode: FastDomNode<HTMLElement> | null, renderLineInput: RenderLineInput, characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType): RenderedViewLine {\n\treturn new WebKitRenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements);\n}\n\nfunction createNormalRenderedLine(domNode: FastDomNode<HTMLElement> | null, renderLineInput: RenderLineInput, characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType): RenderedViewLine {\n\treturn new RenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements);\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 { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler';\nimport { IMouseTargetContentEmptyData, IMouseTargetMarginData, IMouseTarget, IMouseTargetContentEmpty, IMouseTargetContentText, IMouseTargetContentWidget, IMouseTargetMargin, IMouseTargetOutsideEditor, IMouseTargetOverlayWidget, IMouseTargetScrollbar, IMouseTargetTextarea, IMouseTargetUnknown, IMouseTargetViewZone, IMouseTargetContentTextData, IMouseTargetViewZoneData, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { ClientCoordinates, EditorMouseEvent, EditorPagePosition, PageCoordinates, CoordinatesRelativeToEditor } from 'vs/editor/browser/editorDom';\nimport { PartFingerprint, PartFingerprints } from 'vs/editor/browser/view/viewPart';\nimport { ViewLine } from 'vs/editor/browser/viewParts/lines/viewLine';\nimport { IViewCursorRenderData } from 'vs/editor/browser/viewParts/viewCursors/viewCursor';\nimport { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range as EditorRange } from 'vs/editor/common/core/range';\nimport { HorizontalPosition } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport { IViewModel } from 'vs/editor/common/viewModel';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport * as dom from 'vs/base/browser/dom';\nimport { AtomicTabMoveOperations, Direction } from 'vs/editor/common/cursor/cursorAtomicMoveOperations';\nimport { PositionAffinity } from 'vs/editor/common/model';\nimport { InjectedText } from 'vs/editor/common/modelLineProjectionData';\n\nconst enum HitTestResultType {\n\tUnknown,\n\tContent,\n}\n\nclass UnknownHitTestResult {\n\treadonly type = HitTestResultType.Unknown;\n\tconstructor(\n\t\treadonly hitTarget: Element | null = null\n\t) { }\n}\n\nclass ContentHitTestResult {\n\treadonly type = HitTestResultType.Content;\n\tconstructor(\n\t\treadonly position: Position,\n\t\treadonly spanNode: HTMLElement,\n\t\treadonly injectedText: InjectedText | null,\n\t) { }\n}\n\ntype HitTestResult = UnknownHitTestResult | ContentHitTestResult;\n\nnamespace HitTestResult {\n\texport function createFromDOMInfo(ctx: HitTestContext, spanNode: HTMLElement, offset: number): HitTestResult {\n\t\tconst position = ctx.getPositionFromDOMInfo(spanNode, offset);\n\t\tif (position) {\n\t\t\treturn new ContentHitTestResult(position, spanNode, null);\n\t\t}\n\t\treturn new UnknownHitTestResult(spanNode);\n\t}\n}\n\nexport class PointerHandlerLastRenderData {\n\tconstructor(\n\t\tpublic readonly lastViewCursorsRenderData: IViewCursorRenderData[],\n\t\tpublic readonly lastTextareaPosition: Position | null\n\t) { }\n}\n\nexport class MouseTarget {\n\n\tprivate static _deduceRage(position: Position): EditorRange;\n\tprivate static _deduceRage(position: Position, range: EditorRange | null): EditorRange;\n\tprivate static _deduceRage(position: Position | null): EditorRange | null;\n\tprivate static _deduceRage(position: Position | null, range: EditorRange | null = null): EditorRange | null {\n\t\tif (!range && position) {\n\t\t\treturn new EditorRange(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\t}\n\t\treturn range ?? null;\n\t}\n\tpublic static createUnknown(element: Element | null, mouseColumn: number, position: Position | null): IMouseTargetUnknown {\n\t\treturn { type: MouseTargetType.UNKNOWN, element, mouseColumn, position, range: this._deduceRage(position) };\n\t}\n\tpublic static createTextarea(element: Element | null, mouseColumn: number): IMouseTargetTextarea {\n\t\treturn { type: MouseTargetType.TEXTAREA, element, mouseColumn, position: null, range: null };\n\t}\n\tpublic static createMargin(type: MouseTargetType.GUTTER_GLYPH_MARGIN | MouseTargetType.GUTTER_LINE_NUMBERS | MouseTargetType.GUTTER_LINE_DECORATIONS, element: Element | null, mouseColumn: number, position: Position, range: EditorRange, detail: IMouseTargetMarginData): IMouseTargetMargin {\n\t\treturn { type, element, mouseColumn, position, range, detail };\n\t}\n\tpublic static createViewZone(type: MouseTargetType.GUTTER_VIEW_ZONE | MouseTargetType.CONTENT_VIEW_ZONE, element: Element | null, mouseColumn: number, position: Position, detail: IMouseTargetViewZoneData): IMouseTargetViewZone {\n\t\treturn { type, element, mouseColumn, position, range: this._deduceRage(position), detail };\n\t}\n\tpublic static createContentText(element: Element | null, mouseColumn: number, position: Position, range: EditorRange | null, detail: IMouseTargetContentTextData): IMouseTargetContentText {\n\t\treturn { type: MouseTargetType.CONTENT_TEXT, element, mouseColumn, position, range: this._deduceRage(position, range), detail };\n\t}\n\tpublic static createContentEmpty(element: Element | null, mouseColumn: number, position: Position, detail: IMouseTargetContentEmptyData): IMouseTargetContentEmpty {\n\t\treturn { type: MouseTargetType.CONTENT_EMPTY, element, mouseColumn, position, range: this._deduceRage(position), detail };\n\t}\n\tpublic static createContentWidget(element: Element | null, mouseColumn: number, detail: string): IMouseTargetContentWidget {\n\t\treturn { type: MouseTargetType.CONTENT_WIDGET, element, mouseColumn, position: null, range: null, detail };\n\t}\n\tpublic static createScrollbar(element: Element | null, mouseColumn: number, position: Position): IMouseTargetScrollbar {\n\t\treturn { type: MouseTargetType.SCROLLBAR, element, mouseColumn, position, range: this._deduceRage(position) };\n\t}\n\tpublic static createOverlayWidget(element: Element | null, mouseColumn: number, detail: string): IMouseTargetOverlayWidget {\n\t\treturn { type: MouseTargetType.OVERLAY_WIDGET, element, mouseColumn, position: null, range: null, detail };\n\t}\n\tpublic static createOutsideEditor(mouseColumn: number, position: Position): IMouseTargetOutsideEditor {\n\t\treturn { type: MouseTargetType.OUTSIDE_EDITOR, element: null, mouseColumn, position, range: this._deduceRage(position) };\n\t}\n\n\tprivate static _typeToString(type: MouseTargetType): string {\n\t\tif (type === MouseTargetType.TEXTAREA) {\n\t\t\treturn 'TEXTAREA';\n\t\t}\n\t\tif (type === MouseTargetType.GUTTER_GLYPH_MARGIN) {\n\t\t\treturn 'GUTTER_GLYPH_MARGIN';\n\t\t}\n\t\tif (type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\treturn 'GUTTER_LINE_NUMBERS';\n\t\t}\n\t\tif (type === MouseTargetType.GUTTER_LINE_DECORATIONS) {\n\t\t\treturn 'GUTTER_LINE_DECORATIONS';\n\t\t}\n\t\tif (type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\treturn 'GUTTER_VIEW_ZONE';\n\t\t}\n\t\tif (type === MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn 'CONTENT_TEXT';\n\t\t}\n\t\tif (type === MouseTargetType.CONTENT_EMPTY) {\n\t\t\treturn 'CONTENT_EMPTY';\n\t\t}\n\t\tif (type === MouseTargetType.CONTENT_VIEW_ZONE) {\n\t\t\treturn 'CONTENT_VIEW_ZONE';\n\t\t}\n\t\tif (type === MouseTargetType.CONTENT_WIDGET) {\n\t\t\treturn 'CONTENT_WIDGET';\n\t\t}\n\t\tif (type === MouseTargetType.OVERVIEW_RULER) {\n\t\t\treturn 'OVERVIEW_RULER';\n\t\t}\n\t\tif (type === MouseTargetType.SCROLLBAR) {\n\t\t\treturn 'SCROLLBAR';\n\t\t}\n\t\tif (type === MouseTargetType.OVERLAY_WIDGET) {\n\t\t\treturn 'OVERLAY_WIDGET';\n\t\t}\n\t\treturn 'UNKNOWN';\n\t}\n\n\tpublic static toString(target: IMouseTarget): string {\n\t\treturn this._typeToString(target.type) + ': ' + target.position + ' - ' + target.range + ' - ' + JSON.stringify((<any>target).detail);\n\t}\n}\n\nclass ElementPath {\n\n\tpublic static isTextArea(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length === 2\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[1] === PartFingerprint.TextArea\n\t\t);\n\t}\n\n\tpublic static isChildOfViewLines(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 4\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[3] === PartFingerprint.ViewLines\n\t\t);\n\t}\n\n\tpublic static isStrictChildOfViewLines(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length > 4\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[3] === PartFingerprint.ViewLines\n\t\t);\n\t}\n\n\tpublic static isChildOfScrollableElement(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 2\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[1] === PartFingerprint.ScrollableElement\n\t\t);\n\t}\n\n\tpublic static isChildOfMinimap(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 2\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[1] === PartFingerprint.Minimap\n\t\t);\n\t}\n\n\tpublic static isChildOfContentWidgets(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 4\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[3] === PartFingerprint.ContentWidgets\n\t\t);\n\t}\n\n\tpublic static isChildOfOverflowingContentWidgets(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 1\n\t\t\t&& path[0] === PartFingerprint.OverflowingContentWidgets\n\t\t);\n\t}\n\n\tpublic static isChildOfOverlayWidgets(path: Uint8Array): boolean {\n\t\treturn (\n\t\t\tpath.length >= 2\n\t\t\t&& path[0] === PartFingerprint.OverflowGuard\n\t\t\t&& path[1] === PartFingerprint.OverlayWidgets\n\t\t);\n\t}\n}\n\nexport class HitTestContext {\n\n\tpublic readonly viewModel: IViewModel;\n\tpublic readonly layoutInfo: EditorLayoutInfo;\n\tpublic readonly viewDomNode: HTMLElement;\n\tpublic readonly lineHeight: number;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly lastRenderData: PointerHandlerLastRenderData;\n\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewHelper: IPointerHandlerHelper;\n\n\tconstructor(context: ViewContext, viewHelper: IPointerHandlerHelper, lastRenderData: PointerHandlerLastRenderData) {\n\t\tthis.viewModel = context.viewModel;\n\t\tconst options = context.configuration.options;\n\t\tthis.layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis.viewDomNode = viewHelper.viewDomNode;\n\t\tthis.lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\tthis.lastRenderData = lastRenderData;\n\t\tthis._context = context;\n\t\tthis._viewHelper = viewHelper;\n\t}\n\n\tpublic getZoneAtCoord(mouseVerticalOffset: number): IMouseTargetViewZoneData | null {\n\t\treturn HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset);\n\t}\n\n\tpublic static getZoneAtCoord(context: ViewContext, mouseVerticalOffset: number): IMouseTargetViewZoneData | null {\n\t\t// The target is either a view zone or the empty space after the last view-line\n\t\tconst viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset);\n\n\t\tif (viewZoneWhitespace) {\n\t\t\tconst viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2;\n\t\t\tconst lineCount = context.viewModel.getLineCount();\n\t\t\tlet positionBefore: Position | null = null;\n\t\t\tlet position: Position | null;\n\t\t\tlet positionAfter: Position | null = null;\n\n\t\t\tif (viewZoneWhitespace.afterLineNumber !== lineCount) {\n\t\t\t\t// There are more lines after this view zone\n\t\t\t\tpositionAfter = new Position(viewZoneWhitespace.afterLineNumber + 1, 1);\n\t\t\t}\n\t\t\tif (viewZoneWhitespace.afterLineNumber > 0) {\n\t\t\t\t// There are more lines above this view zone\n\t\t\t\tpositionBefore = new Position(viewZoneWhitespace.afterLineNumber, context.viewModel.getLineMaxColumn(viewZoneWhitespace.afterLineNumber));\n\t\t\t}\n\n\t\t\tif (positionAfter === null) {\n\t\t\t\tposition = positionBefore;\n\t\t\t} else if (positionBefore === null) {\n\t\t\t\tposition = positionAfter;\n\t\t\t} else if (mouseVerticalOffset < viewZoneMiddle) {\n\t\t\t\tposition = positionBefore;\n\t\t\t} else {\n\t\t\t\tposition = positionAfter;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tviewZoneId: viewZoneWhitespace.id,\n\t\t\t\tafterLineNumber: viewZoneWhitespace.afterLineNumber,\n\t\t\t\tpositionBefore: positionBefore,\n\t\t\t\tpositionAfter: positionAfter,\n\t\t\t\tposition: position!\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getFullLineRangeAtCoord(mouseVerticalOffset: number): { range: EditorRange; isAfterLines: boolean } {\n\t\tif (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) {\n\t\t\t// Below the last line\n\t\t\tconst lineNumber = this._context.viewModel.getLineCount();\n\t\t\tconst maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);\n\t\t\treturn {\n\t\t\t\trange: new EditorRange(lineNumber, maxLineColumn, lineNumber, maxLineColumn),\n\t\t\t\tisAfterLines: true\n\t\t\t};\n\t\t}\n\n\t\tconst lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);\n\t\tconst maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);\n\t\treturn {\n\t\t\trange: new EditorRange(lineNumber, 1, lineNumber, maxLineColumn),\n\t\t\tisAfterLines: false\n\t\t};\n\t}\n\n\tpublic getLineNumberAtVerticalOffset(mouseVerticalOffset: number): number {\n\t\treturn this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);\n\t}\n\n\tpublic isAfterLines(mouseVerticalOffset: number): boolean {\n\t\treturn this._context.viewLayout.isAfterLines(mouseVerticalOffset);\n\t}\n\n\tpublic isInTopPadding(mouseVerticalOffset: number): boolean {\n\t\treturn this._context.viewLayout.isInTopPadding(mouseVerticalOffset);\n\t}\n\n\tpublic isInBottomPadding(mouseVerticalOffset: number): boolean {\n\t\treturn this._context.viewLayout.isInBottomPadding(mouseVerticalOffset);\n\t}\n\n\tpublic getVerticalOffsetForLineNumber(lineNumber: number): number {\n\t\treturn this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber);\n\t}\n\n\tpublic findAttribute(element: Element, attr: string): string | null {\n\t\treturn HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode);\n\t}\n\n\tprivate static _findAttribute(element: Element, attr: string, stopAt: Element): string | null {\n\t\twhile (element && element !== document.body) {\n\t\t\tif (element.hasAttribute && element.hasAttribute(attr)) {\n\t\t\t\treturn element.getAttribute(attr);\n\t\t\t}\n\t\t\tif (element === stopAt) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telement = <Element>element.parentNode;\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getLineWidth(lineNumber: number): number {\n\t\treturn this._viewHelper.getLineWidth(lineNumber);\n\t}\n\n\tpublic visibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null {\n\t\treturn this._viewHelper.visibleRangeForPosition(lineNumber, column);\n\t}\n\n\tpublic getPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null {\n\t\treturn this._viewHelper.getPositionFromDOMInfo(spanNode, offset);\n\t}\n\n\tpublic getCurrentScrollTop(): number {\n\t\treturn this._context.viewLayout.getCurrentScrollTop();\n\t}\n\n\tpublic getCurrentScrollLeft(): number {\n\t\treturn this._context.viewLayout.getCurrentScrollLeft();\n\t}\n}\n\nabstract class BareHitTestRequest {\n\n\tpublic readonly editorPos: EditorPagePosition;\n\tpublic readonly pos: PageCoordinates;\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\tpublic readonly mouseVerticalOffset: number;\n\tpublic readonly isInMarginArea: boolean;\n\tpublic readonly isInContentArea: boolean;\n\tpublic readonly mouseContentHorizontalOffset: number;\n\n\tprotected readonly mouseColumn: number;\n\n\tconstructor(ctx: HitTestContext, editorPos: EditorPagePosition, pos: PageCoordinates, relativePos: CoordinatesRelativeToEditor) {\n\t\tthis.editorPos = editorPos;\n\t\tthis.pos = pos;\n\t\tthis.relativePos = relativePos;\n\n\t\tthis.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + this.relativePos.y);\n\t\tthis.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + this.relativePos.x - ctx.layoutInfo.contentLeft;\n\t\tthis.isInMarginArea = (this.relativePos.x < ctx.layoutInfo.contentLeft && this.relativePos.x >= ctx.layoutInfo.glyphMarginLeft);\n\t\tthis.isInContentArea = !this.isInMarginArea;\n\t\tthis.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth));\n\t}\n}\n\nclass HitTestRequest extends BareHitTestRequest {\n\tprivate readonly _ctx: HitTestContext;\n\tpublic readonly target: Element | null;\n\tpublic readonly targetPath: Uint8Array;\n\n\tconstructor(ctx: HitTestContext, editorPos: EditorPagePosition, pos: PageCoordinates, relativePos: CoordinatesRelativeToEditor, target: Element | null) {\n\t\tsuper(ctx, editorPos, pos, relativePos);\n\t\tthis._ctx = ctx;\n\n\t\tif (target) {\n\t\t\tthis.target = target;\n\t\t\tthis.targetPath = PartFingerprints.collect(target, ctx.viewDomNode);\n\t\t} else {\n\t\t\tthis.target = null;\n\t\t\tthis.targetPath = new Uint8Array(0);\n\t\t}\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\\n\\ttarget: ${this.target ? (<HTMLElement>this.target).outerHTML : null}`;\n\t}\n\n\tprivate _getMouseColumn(position: Position | null = null): number {\n\t\tif (position && position.column < this._ctx.viewModel.getLineMaxColumn(position.lineNumber)) {\n\t\t\t// Most likely, the line contains foreign decorations...\n\t\t\treturn CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(position.lineNumber), position.column, this._ctx.viewModel.model.getOptions().tabSize) + 1;\n\t\t}\n\t\treturn this.mouseColumn;\n\t}\n\n\tpublic fulfillUnknown(position: Position | null = null): IMouseTargetUnknown {\n\t\treturn MouseTarget.createUnknown(this.target, this._getMouseColumn(position), position);\n\t}\n\tpublic fulfillTextarea(): IMouseTargetTextarea {\n\t\treturn MouseTarget.createTextarea(this.target, this._getMouseColumn());\n\t}\n\tpublic fulfillMargin(type: MouseTargetType.GUTTER_GLYPH_MARGIN | MouseTargetType.GUTTER_LINE_NUMBERS | MouseTargetType.GUTTER_LINE_DECORATIONS, position: Position, range: EditorRange, detail: IMouseTargetMarginData): IMouseTargetMargin {\n\t\treturn MouseTarget.createMargin(type, this.target, this._getMouseColumn(position), position, range, detail);\n\t}\n\tpublic fulfillViewZone(type: MouseTargetType.GUTTER_VIEW_ZONE | MouseTargetType.CONTENT_VIEW_ZONE, position: Position, detail: IMouseTargetViewZoneData): IMouseTargetViewZone {\n\t\treturn MouseTarget.createViewZone(type, this.target, this._getMouseColumn(position), position, detail);\n\t}\n\tpublic fulfillContentText(position: Position, range: EditorRange | null, detail: IMouseTargetContentTextData): IMouseTargetContentText {\n\t\treturn MouseTarget.createContentText(this.target, this._getMouseColumn(position), position, range, detail);\n\t}\n\tpublic fulfillContentEmpty(position: Position, detail: IMouseTargetContentEmptyData): IMouseTargetContentEmpty {\n\t\treturn MouseTarget.createContentEmpty(this.target, this._getMouseColumn(position), position, detail);\n\t}\n\tpublic fulfillContentWidget(detail: string): IMouseTargetContentWidget {\n\t\treturn MouseTarget.createContentWidget(this.target, this._getMouseColumn(), detail);\n\t}\n\tpublic fulfillScrollbar(position: Position): IMouseTargetScrollbar {\n\t\treturn MouseTarget.createScrollbar(this.target, this._getMouseColumn(position), position);\n\t}\n\tpublic fulfillOverlayWidget(detail: string): IMouseTargetOverlayWidget {\n\t\treturn MouseTarget.createOverlayWidget(this.target, this._getMouseColumn(), detail);\n\t}\n\n\tpublic withTarget(target: Element | null): HitTestRequest {\n\t\treturn new HitTestRequest(this._ctx, this.editorPos, this.pos, this.relativePos, target);\n\t}\n}\n\ninterface ResolvedHitTestRequest extends HitTestRequest {\n\treadonly target: Element;\n}\n\nconst EMPTY_CONTENT_AFTER_LINES: IMouseTargetContentEmptyData = { isAfterLines: true };\n\nfunction createEmptyContentDataInLines(horizontalDistanceToText: number): IMouseTargetContentEmptyData {\n\treturn {\n\t\tisAfterLines: false,\n\t\thorizontalDistanceToText: horizontalDistanceToText\n\t};\n}\n\nexport class MouseTargetFactory {\n\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewHelper: IPointerHandlerHelper;\n\n\tconstructor(context: ViewContext, viewHelper: IPointerHandlerHelper) {\n\t\tthis._context = context;\n\t\tthis._viewHelper = viewHelper;\n\t}\n\n\tpublic mouseTargetIsWidget(e: EditorMouseEvent): boolean {\n\t\tconst t = <Element>e.target;\n\t\tconst path = PartFingerprints.collect(t, this._viewHelper.viewDomNode);\n\n\t\t// Is it a content widget?\n\t\tif (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Is it an overlay widget?\n\t\tif (ElementPath.isChildOfOverlayWidgets(path)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic createMouseTarget(lastRenderData: PointerHandlerLastRenderData, editorPos: EditorPagePosition, pos: PageCoordinates, relativePos: CoordinatesRelativeToEditor, target: HTMLElement | null): IMouseTarget {\n\t\tconst ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData);\n\t\tconst request = new HitTestRequest(ctx, editorPos, pos, relativePos, target);\n\t\ttry {\n\t\t\tconst r = MouseTargetFactory._createMouseTarget(ctx, request, false);\n\t\t\t// console.log(MouseTarget.toString(r));\n\t\t\treturn r;\n\t\t} catch (err) {\n\t\t\t// console.log(err);\n\t\t\treturn request.fulfillUnknown();\n\t\t}\n\t}\n\n\tprivate static _createMouseTarget(ctx: HitTestContext, request: HitTestRequest, domHitTestExecuted: boolean): IMouseTarget {\n\n\t\t// console.log(`${domHitTestExecuted ? '=>' : ''}CAME IN REQUEST: ${request}`);\n\n\t\t// First ensure the request has a target\n\t\tif (request.target === null) {\n\t\t\tif (domHitTestExecuted) {\n\t\t\t\t// Still no target... and we have already executed hit test...\n\t\t\t\treturn request.fulfillUnknown();\n\t\t\t}\n\n\t\t\tconst hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n\n\t\t\tif (hitTestResult.type === HitTestResultType.Content) {\n\t\t\t\treturn MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);\n\t\t\t}\n\n\t\t\treturn this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true);\n\t\t}\n\n\t\t// we know for a fact that request.target is not null\n\t\tconst resolvedRequest = <ResolvedHitTestRequest>request;\n\n\t\tlet result: IMouseTarget | null = null;\n\n\t\tresult = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestMargin(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest);\n\t\tresult = result || MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest, domHitTestExecuted);\n\t\tresult = result || MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest);\n\n\t\treturn (result || request.fulfillUnknown());\n\t}\n\n\tprivate static _hitTestContentWidget(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\t// Is it a content widget?\n\t\tif (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) {\n\t\t\tconst widgetId = ctx.findAttribute(request.target, 'widgetId');\n\t\t\tif (widgetId) {\n\t\t\t\treturn request.fulfillContentWidget(widgetId);\n\t\t\t} else {\n\t\t\t\treturn request.fulfillUnknown();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestOverlayWidget(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\t// Is it an overlay widget?\n\t\tif (ElementPath.isChildOfOverlayWidgets(request.targetPath)) {\n\t\t\tconst widgetId = ctx.findAttribute(request.target, 'widgetId');\n\t\t\tif (widgetId) {\n\t\t\t\treturn request.fulfillOverlayWidget(widgetId);\n\t\t\t} else {\n\t\t\t\treturn request.fulfillUnknown();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestViewCursor(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\n\t\tif (request.target) {\n\t\t\t// Check if we've hit a painted cursor\n\t\t\tconst lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;\n\n\t\t\tfor (const d of lastViewCursorsRenderData) {\n\n\t\t\t\tif (request.target === d.domNode) {\n\t\t\t\t\treturn request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (request.isInContentArea) {\n\t\t\t// Edge has a bug when hit-testing the exact position of a cursor,\n\t\t\t// instead of returning the correct dom node, it returns the\n\t\t\t// first or last rendered view line dom node, therefore help it out\n\t\t\t// and first check if we are on top of a cursor\n\n\t\t\tconst lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;\n\t\t\tconst mouseContentHorizontalOffset = request.mouseContentHorizontalOffset;\n\t\t\tconst mouseVerticalOffset = request.mouseVerticalOffset;\n\n\t\t\tfor (const d of lastViewCursorsRenderData) {\n\n\t\t\t\tif (mouseContentHorizontalOffset < d.contentLeft) {\n\t\t\t\t\t// mouse position is to the left of the cursor\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (mouseContentHorizontalOffset > d.contentLeft + d.width) {\n\t\t\t\t\t// mouse position is to the right of the cursor\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber);\n\n\t\t\t\tif (\n\t\t\t\t\tcursorVerticalOffset <= mouseVerticalOffset\n\t\t\t\t\t&& mouseVerticalOffset <= cursorVerticalOffset + d.height\n\t\t\t\t) {\n\t\t\t\t\treturn request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestViewZone(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\tconst viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset);\n\t\tif (viewZoneData) {\n\t\t\tconst mouseTargetType = (request.isInContentArea ? MouseTargetType.CONTENT_VIEW_ZONE : MouseTargetType.GUTTER_VIEW_ZONE);\n\t\t\treturn request.fulfillViewZone(mouseTargetType, viewZoneData.position, viewZoneData);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestTextArea(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\t// Is it the textarea?\n\t\tif (ElementPath.isTextArea(request.targetPath)) {\n\t\t\tif (ctx.lastRenderData.lastTextareaPosition) {\n\t\t\t\treturn request.fulfillContentText(ctx.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false, injectedText: null });\n\t\t\t}\n\t\t\treturn request.fulfillTextarea();\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestMargin(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\tif (request.isInMarginArea) {\n\t\t\tconst res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset);\n\t\t\tconst pos = res.range.getStartPosition();\n\t\t\tlet offset = Math.abs(request.relativePos.x);\n\t\t\tconst detail: IMouseTargetMarginData = {\n\t\t\t\tisAfterLines: res.isAfterLines,\n\t\t\t\tglyphMarginLeft: ctx.layoutInfo.glyphMarginLeft,\n\t\t\t\tglyphMarginWidth: ctx.layoutInfo.glyphMarginWidth,\n\t\t\t\tlineNumbersWidth: ctx.layoutInfo.lineNumbersWidth,\n\t\t\t\toffsetX: offset\n\t\t\t};\n\n\t\t\toffset -= ctx.layoutInfo.glyphMarginLeft;\n\n\t\t\tif (offset <= ctx.layoutInfo.glyphMarginWidth) {\n\t\t\t\t// On the glyph margin\n\t\t\t\treturn request.fulfillMargin(MouseTargetType.GUTTER_GLYPH_MARGIN, pos, res.range, detail);\n\t\t\t}\n\t\t\toffset -= ctx.layoutInfo.glyphMarginWidth;\n\n\t\t\tif (offset <= ctx.layoutInfo.lineNumbersWidth) {\n\t\t\t\t// On the line numbers\n\t\t\t\treturn request.fulfillMargin(MouseTargetType.GUTTER_LINE_NUMBERS, pos, res.range, detail);\n\t\t\t}\n\t\t\toffset -= ctx.layoutInfo.lineNumbersWidth;\n\n\t\t\t// On the line decorations\n\t\t\treturn request.fulfillMargin(MouseTargetType.GUTTER_LINE_DECORATIONS, pos, res.range, detail);\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestViewLines(ctx: HitTestContext, request: ResolvedHitTestRequest, domHitTestExecuted: boolean): IMouseTarget | null {\n\t\tif (!ElementPath.isChildOfViewLines(request.targetPath)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (ctx.isInTopPadding(request.mouseVerticalOffset)) {\n\t\t\treturn request.fulfillContentEmpty(new Position(1, 1), EMPTY_CONTENT_AFTER_LINES);\n\t\t}\n\n\t\t// Check if it is below any lines and any view zones\n\t\tif (ctx.isAfterLines(request.mouseVerticalOffset) || ctx.isInBottomPadding(request.mouseVerticalOffset)) {\n\t\t\t// This most likely indicates it happened after the last view-line\n\t\t\tconst lineCount = ctx.viewModel.getLineCount();\n\t\t\tconst maxLineColumn = ctx.viewModel.getLineMaxColumn(lineCount);\n\t\t\treturn request.fulfillContentEmpty(new Position(lineCount, maxLineColumn), EMPTY_CONTENT_AFTER_LINES);\n\t\t}\n\n\t\tif (domHitTestExecuted) {\n\t\t\t// Check if we are hitting a view-line (can happen in the case of inline decorations on empty lines)\n\t\t\t// See https://github.com/microsoft/vscode/issues/46942\n\t\t\tif (ElementPath.isStrictChildOfViewLines(request.targetPath)) {\n\t\t\t\tconst lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\t\t\tif (ctx.viewModel.getLineLength(lineNumber) === 0) {\n\t\t\t\t\tconst lineWidth = ctx.getLineWidth(lineNumber);\n\t\t\t\t\tconst detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n\t\t\t\t\treturn request.fulfillContentEmpty(new Position(lineNumber, 1), detail);\n\t\t\t\t}\n\n\t\t\t\tconst lineWidth = ctx.getLineWidth(lineNumber);\n\t\t\t\tif (request.mouseContentHorizontalOffset >= lineWidth) {\n\t\t\t\t\tconst detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n\t\t\t\t\tconst pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));\n\t\t\t\t\treturn request.fulfillContentEmpty(pos, detail);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We have already executed hit test...\n\t\t\treturn request.fulfillUnknown();\n\t\t}\n\n\t\tconst hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n\n\t\tif (hitTestResult.type === HitTestResultType.Content) {\n\t\t\treturn MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);\n\t\t}\n\n\t\treturn this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true);\n\t}\n\n\tprivate static _hitTestMinimap(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\tif (ElementPath.isChildOfMinimap(request.targetPath)) {\n\t\t\tconst possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\t\tconst maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n\t\t\treturn request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestScrollbarSlider(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\tif (ElementPath.isChildOfScrollableElement(request.targetPath)) {\n\t\t\tif (request.target && request.target.nodeType === 1) {\n\t\t\t\tconst className = request.target.className;\n\t\t\t\tif (className && /\\b(slider|scrollbar)\\b/.test(className)) {\n\t\t\t\t\tconst possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\t\t\t\tconst maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n\t\t\t\t\treturn request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestScrollbar(ctx: HitTestContext, request: ResolvedHitTestRequest): IMouseTarget | null {\n\t\t// Is it the overview ruler?\n\t\t// Is it a child of the scrollable element?\n\t\tif (ElementPath.isChildOfScrollableElement(request.targetPath)) {\n\t\t\tconst possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\t\tconst maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n\t\t\treturn request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getMouseColumn(relativePos: CoordinatesRelativeToEditor): number {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + relativePos.x - layoutInfo.contentLeft;\n\t\treturn MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth);\n\t}\n\n\tpublic static _getMouseColumn(mouseContentHorizontalOffset: number, typicalHalfwidthCharacterWidth: number): number {\n\t\tif (mouseContentHorizontalOffset < 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tconst chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth);\n\t\treturn (chars + 1);\n\t}\n\n\tprivate static createMouseTargetFromHitTestPosition(ctx: HitTestContext, request: HitTestRequest, spanNode: HTMLElement, pos: Position, injectedText: InjectedText | null): IMouseTarget {\n\t\tconst lineNumber = pos.lineNumber;\n\t\tconst column = pos.column;\n\n\t\tconst lineWidth = ctx.getLineWidth(lineNumber);\n\n\t\tif (request.mouseContentHorizontalOffset > lineWidth) {\n\t\t\tconst detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n\t\t\treturn request.fulfillContentEmpty(pos, detail);\n\t\t}\n\n\t\tconst visibleRange = ctx.visibleRangeForPosition(lineNumber, column);\n\n\t\tif (!visibleRange) {\n\t\t\treturn request.fulfillUnknown(pos);\n\t\t}\n\n\t\tconst columnHorizontalOffset = visibleRange.left;\n\n\t\tif (request.mouseContentHorizontalOffset === columnHorizontalOffset) {\n\t\t\treturn request.fulfillContentText(pos, null, { mightBeForeignElement: !!injectedText, injectedText });\n\t\t}\n\n\t\t// Let's define a, b, c and check if the offset is in between them...\n\t\tinterface OffsetColumn { offset: number; column: number }\n\n\t\tconst points: OffsetColumn[] = [];\n\t\tpoints.push({ offset: visibleRange.left, column: column });\n\t\tif (column > 1) {\n\t\t\tconst visibleRange = ctx.visibleRangeForPosition(lineNumber, column - 1);\n\t\t\tif (visibleRange) {\n\t\t\t\tpoints.push({ offset: visibleRange.left, column: column - 1 });\n\t\t\t}\n\t\t}\n\t\tconst lineMaxColumn = ctx.viewModel.getLineMaxColumn(lineNumber);\n\t\tif (column < lineMaxColumn) {\n\t\t\tconst visibleRange = ctx.visibleRangeForPosition(lineNumber, column + 1);\n\t\t\tif (visibleRange) {\n\t\t\t\tpoints.push({ offset: visibleRange.left, column: column + 1 });\n\t\t\t}\n\t\t}\n\n\t\tpoints.sort((a, b) => a.offset - b.offset);\n\n\t\tconst mouseCoordinates = request.pos.toClientCoordinates();\n\t\tconst spanNodeClientRect = spanNode.getBoundingClientRect();\n\t\tconst mouseIsOverSpanNode = (spanNodeClientRect.left <= mouseCoordinates.clientX && mouseCoordinates.clientX <= spanNodeClientRect.right);\n\n\t\tfor (let i = 1; i < points.length; i++) {\n\t\t\tconst prev = points[i - 1];\n\t\t\tconst curr = points[i];\n\t\t\tif (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) {\n\t\t\t\tconst rng = new EditorRange(lineNumber, prev.column, lineNumber, curr.column);\n\t\t\t\treturn request.fulfillContentText(pos, rng, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText, injectedText });\n\t\t\t}\n\t\t}\n\t\treturn request.fulfillContentText(pos, null, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText, injectedText });\n\t}\n\n\t/**\n\t * Most probably WebKit browsers and Edge\n\t */\n\tprivate static _doHitTestWithCaretRangeFromPoint(ctx: HitTestContext, request: BareHitTestRequest): HitTestResult {\n\n\t\t// In Chrome, especially on Linux it is possible to click between lines,\n\t\t// so try to adjust the `hity` below so that it lands in the center of a line\n\t\tconst lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\tconst lineVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber);\n\t\tconst lineCenteredVerticalOffset = lineVerticalOffset + Math.floor(ctx.lineHeight / 2);\n\t\tlet adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset);\n\n\t\tif (adjustedPageY <= request.editorPos.y) {\n\t\t\tadjustedPageY = request.editorPos.y + 1;\n\t\t}\n\t\tif (adjustedPageY >= request.editorPos.y + request.editorPos.height) {\n\t\t\tadjustedPageY = request.editorPos.y + request.editorPos.height - 1;\n\t\t}\n\n\t\tconst adjustedPage = new PageCoordinates(request.pos.x, adjustedPageY);\n\n\t\tconst r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates());\n\t\tif (r.type === HitTestResultType.Content) {\n\t\t\treturn r;\n\t\t}\n\n\t\t// Also try to hit test without the adjustment (for the edge cases that we are near the top or bottom)\n\t\treturn this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates());\n\t}\n\n\tprivate static _actualDoHitTestWithCaretRangeFromPoint(ctx: HitTestContext, coords: ClientCoordinates): HitTestResult {\n\t\tconst shadowRoot = dom.getShadowRoot(ctx.viewDomNode);\n\t\tlet range: Range;\n\t\tif (shadowRoot) {\n\t\t\tif (typeof (<any>shadowRoot).caretRangeFromPoint === 'undefined') {\n\t\t\t\trange = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);\n\t\t\t} else {\n\t\t\t\trange = (<any>shadowRoot).caretRangeFromPoint(coords.clientX, coords.clientY);\n\t\t\t}\n\t\t} else {\n\t\t\trange = (<any>document).caretRangeFromPoint(coords.clientX, coords.clientY);\n\t\t}\n\n\t\tif (!range || !range.startContainer) {\n\t\t\treturn new UnknownHitTestResult();\n\t\t}\n\n\t\t// Chrome always hits a TEXT_NODE, while Edge sometimes hits a token span\n\t\tconst startContainer = range.startContainer;\n\n\t\tif (startContainer.nodeType === startContainer.TEXT_NODE) {\n\t\t\t// startContainer is expected to be the token text\n\t\t\tconst parent1 = startContainer.parentNode; // expected to be the token span\n\t\t\tconst parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span\n\t\t\tconst parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div\n\t\t\tconst parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? (<HTMLElement>parent3).className : null;\n\n\t\t\tif (parent3ClassName === ViewLine.CLASS_NAME) {\n\t\t\t\treturn HitTestResult.createFromDOMInfo(ctx, <HTMLElement>parent1, range.startOffset);\n\t\t\t} else {\n\t\t\t\treturn new UnknownHitTestResult(<HTMLElement>startContainer.parentNode);\n\t\t\t}\n\t\t} else if (startContainer.nodeType === startContainer.ELEMENT_NODE) {\n\t\t\t// startContainer is expected to be the token span\n\t\t\tconst parent1 = startContainer.parentNode; // expected to be the view line container span\n\t\t\tconst parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line div\n\t\t\tconst parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? (<HTMLElement>parent2).className : null;\n\n\t\t\tif (parent2ClassName === ViewLine.CLASS_NAME) {\n\t\t\t\treturn HitTestResult.createFromDOMInfo(ctx, <HTMLElement>startContainer, (<HTMLElement>startContainer).textContent!.length);\n\t\t\t} else {\n\t\t\t\treturn new UnknownHitTestResult(<HTMLElement>startContainer);\n\t\t\t}\n\t\t}\n\n\t\treturn new UnknownHitTestResult();\n\t}\n\n\t/**\n\t * Most probably Gecko\n\t */\n\tprivate static _doHitTestWithCaretPositionFromPoint(ctx: HitTestContext, coords: ClientCoordinates): HitTestResult {\n\t\tconst hitResult: { offsetNode: Node; offset: number } = (<any>document).caretPositionFromPoint(coords.clientX, coords.clientY);\n\n\t\tif (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) {\n\t\t\t// offsetNode is expected to be the token text\n\t\t\tconst parent1 = hitResult.offsetNode.parentNode; // expected to be the token span\n\t\t\tconst parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span\n\t\t\tconst parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div\n\t\t\tconst parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? (<HTMLElement>parent3).className : null;\n\n\t\t\tif (parent3ClassName === ViewLine.CLASS_NAME) {\n\t\t\t\treturn HitTestResult.createFromDOMInfo(ctx, <HTMLElement>hitResult.offsetNode.parentNode, hitResult.offset);\n\t\t\t} else {\n\t\t\t\treturn new UnknownHitTestResult(<HTMLElement>hitResult.offsetNode.parentNode);\n\t\t\t}\n\t\t}\n\n\t\t// For inline decorations, Gecko sometimes returns the `<span>` of the line and the offset is the `<span>` with the inline decoration\n\t\t// Some other times, it returns the `<span>` with the inline decoration\n\t\tif (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) {\n\t\t\tconst parent1 = hitResult.offsetNode.parentNode;\n\t\t\tconst parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? (<HTMLElement>parent1).className : null;\n\t\t\tconst parent2 = parent1 ? parent1.parentNode : null;\n\t\t\tconst parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? (<HTMLElement>parent2).className : null;\n\n\t\t\tif (parent1ClassName === ViewLine.CLASS_NAME) {\n\t\t\t\t// it returned the `<span>` of the line and the offset is the `<span>` with the inline decoration\n\t\t\t\tconst tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)];\n\t\t\t\tif (tokenSpan) {\n\t\t\t\t\treturn HitTestResult.createFromDOMInfo(ctx, <HTMLElement>tokenSpan, 0);\n\t\t\t\t}\n\t\t\t} else if (parent2ClassName === ViewLine.CLASS_NAME) {\n\t\t\t\t// it returned the `<span>` with the inline decoration\n\t\t\t\treturn HitTestResult.createFromDOMInfo(ctx, <HTMLElement>hitResult.offsetNode, 0);\n\t\t\t}\n\t\t}\n\n\t\treturn new UnknownHitTestResult(<HTMLElement>hitResult.offsetNode);\n\t}\n\n\tprivate static _snapToSoftTabBoundary(position: Position, viewModel: IViewModel): Position {\n\t\tconst lineContent = viewModel.getLineContent(position.lineNumber);\n\t\tconst { tabSize } = viewModel.model.getOptions();\n\t\tconst newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, position.column - 1, tabSize, Direction.Nearest);\n\t\tif (newPosition !== -1) {\n\t\t\treturn new Position(position.lineNumber, newPosition + 1);\n\t\t}\n\t\treturn position;\n\t}\n\n\tprivate static _doHitTest(ctx: HitTestContext, request: BareHitTestRequest): HitTestResult {\n\n\t\tlet result: HitTestResult = new UnknownHitTestResult();\n\t\tif (typeof (<any>document).caretRangeFromPoint === 'function') {\n\t\t\tresult = this._doHitTestWithCaretRangeFromPoint(ctx, request);\n\t\t} else if ((<any>document).caretPositionFromPoint) {\n\t\t\tresult = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates());\n\t\t}\n\t\tif (result.type === HitTestResultType.Content) {\n\t\t\tconst injectedText = ctx.viewModel.getInjectedTextAt(result.position);\n\n\t\t\tconst normalizedPosition = ctx.viewModel.normalizePosition(result.position, PositionAffinity.None);\n\t\t\tif (injectedText || !normalizedPosition.equals(result.position)) {\n\t\t\t\tresult = new ContentHitTestResult(normalizedPosition, result.spanNode, injectedText);\n\t\t\t}\n\t\t}\n\t\t// Snap to the nearest soft tab boundary if atomic soft tabs are enabled.\n\t\tif (result.type === HitTestResultType.Content && ctx.stickyTabStops) {\n\t\t\tresult = new ContentHitTestResult(this._snapToSoftTabBoundary(result.position, ctx.viewModel), result.spanNode, result.injectedText);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nexport function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number): Range {\n\tconst range = document.createRange();\n\n\t// Get the element under the point\n\tlet el: Element | null = (<any>shadowRoot).elementFromPoint(x, y);\n\n\tif (el !== null) {\n\t\t// Get the last child of the element until its firstChild is a text node\n\t\t// This assumes that the pointer is on the right of the line, out of the tokens\n\t\t// and that we want to get the offset of the last token of the line\n\t\twhile (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE && el.lastChild && el.lastChild.firstChild) {\n\t\t\tel = <Element>el.lastChild;\n\t\t}\n\n\t\t// Grab its rect\n\t\tconst rect = el.getBoundingClientRect();\n\n\t\t// And its font\n\t\tconst font = window.getComputedStyle(el, null).getPropertyValue('font');\n\n\t\t// And also its txt content\n\t\tconst text = (el as any).innerText;\n\n\t\t// Position the pixel cursor at the left of the element\n\t\tlet pixelCursor = rect.left;\n\t\tlet offset = 0;\n\t\tlet step: number;\n\n\t\t// If the point is on the right of the box put the cursor after the last character\n\t\tif (x > rect.left + rect.width) {\n\t\t\toffset = text.length;\n\t\t} else {\n\t\t\tconst charWidthReader = CharWidthReader.getInstance();\n\t\t\t// Goes through all the characters of the innerText, and checks if the x of the point\n\t\t\t// belongs to the character.\n\t\t\tfor (let i = 0; i < text.length + 1; i++) {\n\t\t\t\t// The step is half the width of the character\n\t\t\t\tstep = charWidthReader.getCharWidth(text.charAt(i), font) / 2;\n\t\t\t\t// Move to the center of the character\n\t\t\t\tpixelCursor += step;\n\t\t\t\t// If the x of the point is smaller that the position of the cursor, the point is over that character\n\t\t\t\tif (x < pixelCursor) {\n\t\t\t\t\toffset = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Move between the current character and the next\n\t\t\t\tpixelCursor += step;\n\t\t\t}\n\t\t}\n\n\t\t// Creates a range with the text node of the element and set the offset found\n\t\trange.setStart(el.firstChild!, offset);\n\t\trange.setEnd(el.firstChild!, offset);\n\t}\n\n\treturn range;\n}\n\nclass CharWidthReader {\n\tprivate static _INSTANCE: CharWidthReader | null = null;\n\n\tpublic static getInstance(): CharWidthReader {\n\t\tif (!CharWidthReader._INSTANCE) {\n\t\t\tCharWidthReader._INSTANCE = new CharWidthReader();\n\t\t}\n\t\treturn CharWidthReader._INSTANCE;\n\t}\n\n\tprivate readonly _cache: { [cacheKey: string]: number };\n\tprivate readonly _canvas: HTMLCanvasElement;\n\n\tprivate constructor() {\n\t\tthis._cache = {};\n\t\tthis._canvas = document.createElement('canvas');\n\t}\n\n\tpublic getCharWidth(char: string, font: string): number {\n\t\tconst cacheKey = char + font;\n\t\tif (this._cache[cacheKey]) {\n\t\t\treturn this._cache[cacheKey];\n\t\t}\n\n\t\tconst context = this._canvas.getContext('2d')!;\n\t\tcontext.font = font;\n\t\tconst metrics = context.measureText(char);\n\t\tconst width = metrics.width;\n\t\tthis._cache[cacheKey] = width;\n\t\treturn width;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { StandardWheelEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget';\nimport { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorMouseMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor } from 'vs/editor/browser/editorDom';\nimport { ViewController } from 'vs/editor/browser/view/viewController';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { HorizontalPosition } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n/**\n * Merges mouse events when mouse move events are throttled\n */\nexport function createMouseMoveEventMerger(mouseTargetFactory: MouseTargetFactory | null) {\n\treturn function (lastEvent: EditorMouseEvent | null, currentEvent: EditorMouseEvent): EditorMouseEvent {\n\t\tlet targetIsWidget = false;\n\t\tif (mouseTargetFactory) {\n\t\t\ttargetIsWidget = mouseTargetFactory.mouseTargetIsWidget(currentEvent);\n\t\t}\n\t\tif (!targetIsWidget) {\n\t\t\tcurrentEvent.preventDefault();\n\t\t}\n\t\treturn currentEvent;\n\t};\n}\n\nexport interface IPointerHandlerHelper {\n\tviewDomNode: HTMLElement;\n\tlinesContentDomNode: HTMLElement;\n\n\tfocusTextArea(): void;\n\tdispatchTextAreaEvent(event: CustomEvent): void;\n\n\t/**\n\t * Get the last rendered information for cursors & textarea.\n\t */\n\tgetLastRenderData(): PointerHandlerLastRenderData;\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;\n\tshouldSuppressMouseDownOnWidget(widgetId: string): boolean;\n\n\t/**\n\t * Decode a position from a rendered dom node\n\t */\n\tgetPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null;\n\n\tvisibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tstatic readonly MOUSE_MOVE_MINIMUM_TIME = 100; // ms\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprotected readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: number;\n\tprivate _height: number;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\n\t\tthis._context = context;\n\t\tthis.viewController = viewController;\n\t\tthis.viewHelper = viewHelper;\n\t\tthis.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n\n\t\tthis._mouseDownOperation = this._register(new MouseDownOperation(\n\t\t\tthis._context,\n\t\t\tthis.viewController,\n\t\t\tthis.viewHelper,\n\t\t\t(e, testEventTarget) => this._createMouseTarget(e, testEventTarget),\n\t\t\t(e) => this._getMouseColumn(e)\n\t\t));\n\n\t\tthis.lastMouseLeaveTime = -1;\n\t\tthis._height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\n\t\tconst mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n\n\t\tthis._register(mouseEvents.onMouseMoveThrottled(this.viewHelper.viewDomNode,\n\t\t\t(e) => this._onMouseMove(e),\n\t\t\tcreateMouseMoveEventMerger(this.mouseTargetFactory), MouseHandler.MOUSE_MOVE_MINIMUM_TIME));\n\n\t\tthis._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\n\t\tthis._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\n\t\tthis._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e)));\n\n\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\tthis.viewController.emitMouseWheel(browserEvent);\n\n\t\t\tif (!this._context.configuration.options.get(EditorOption.mouseWheelZoom)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tconst doMouseWheelZoom = (\n\t\t\t\tplatform.isMacintosh\n\t\t\t\t\t// on macOS we support cmd + two fingers scroll (`metaKey` set)\n\t\t\t\t\t// and also the two fingers pinch gesture (`ctrKey` set)\n\t\t\t\t\t? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t\t\t: (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t);\n\t\t\tif (doMouseWheelZoom) {\n\t\t\t\tconst zoomLevel: number = EditorZoom.getZoomLevel();\n\t\t\t\tconst delta = e.deltaY > 0 ? 1 : -1;\n\t\t\t\tEditorZoom.setZoomLevel(zoomLevel + delta);\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t};\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t// layout change\n\t\t\tconst height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\t\t\tif (this._height !== height) {\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._mouseDownOperation.onHeightChanged();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onScrollChanged();\n\t\treturn false;\n\t}\n\t// --- end event handlers\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst clientPos = new ClientCoordinates(clientX, clientY);\n\t\tconst pos = clientPos.toPageCoordinates();\n\t\tconst editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n\n\t\tif (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget {\n\t\tlet target = e.target;\n\t\tif (!this.viewHelper.viewDomNode.contains(target)) {\n\t\t\tconst shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n\t\t\tif (shadowRoot) {\n\t\t\t\ttarget = (<any>shadowRoot).elementsFromPoint(e.posx, e.posy).find(\n\t\t\t\t\t(el: Element) => this.viewHelper.viewDomNode.contains(el)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.relativePos);\n\t}\n\n\tprotected _onContextMenu(e: EditorMouseEvent, testEventTarget: boolean): void {\n\t\tthis.viewController.emitContextMenu({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, testEventTarget)\n\t\t});\n\t}\n\n\tpublic _onMouseMove(e: EditorMouseEvent): void {\n\t\tif (this._mouseDownOperation.isActive()) {\n\t\t\t// In selection/drag operation\n\t\t\treturn;\n\t\t}\n\t\tconst actualMouseMoveTime = e.timestamp;\n\t\tif (actualMouseMoveTime < this.lastMouseLeaveTime) {\n\t\t\t// Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewController.emitMouseMove({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tpublic _onMouseLeave(e: EditorMouseEvent): void {\n\t\tthis.lastMouseLeaveTime = (new Date()).getTime();\n\t\tthis.viewController.emitMouseLeave({\n\t\t\tevent: e,\n\t\t\ttarget: null\n\t\t});\n\t}\n\n\tpublic _onMouseUp(e: EditorMouseEvent): void {\n\t\tthis.viewController.emitMouseUp({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tpublic _onMouseDown(e: EditorMouseEvent): void {\n\t\tconst t = this._createMouseTarget(e, true);\n\n\t\tconst targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers);\n\t\tconst targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET);\n\n\t\tlet shouldHandle = e.leftButton || e.middleButton;\n\t\tif (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n\t\t\tshouldHandle = false;\n\t\t}\n\n\t\tconst focus = () => {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t};\n\n\t\tif (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n\t\t\tfocus();\n\t\t\tthis._mouseDownOperation.start(t.type, e);\n\n\t\t} else if (targetIsGutter) {\n\t\t\t// Do not steal focus\n\t\t\te.preventDefault();\n\t\t} else if (targetIsViewZone) {\n\t\t\tconst viewZoneData = t.detail;\n\t\t\tif (this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\tfocus();\n\t\t\t\tthis._mouseDownOperation.start(t.type, e);\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t} else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) {\n\t\t\tfocus();\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tthis.viewController.emitMouseDown({\n\t\t\tevent: e,\n\t\t\ttarget: t\n\t\t});\n\t}\n}\n\nclass MouseDownOperation extends Disposable {\n\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewController: ViewController;\n\tprivate readonly _viewHelper: IPointerHandlerHelper;\n\tprivate readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget;\n\tprivate readonly _getMouseColumn: (e: EditorMouseEvent) => number;\n\n\tprivate readonly _mouseMoveMonitor: GlobalEditorMouseMoveMonitor;\n\tprivate readonly _onScrollTimeout: TimeoutTimer;\n\tprivate readonly _mouseState: MouseDownState;\n\n\tprivate _currentSelection: Selection;\n\tprivate _isActive: boolean;\n\tprivate _lastMouseEvent: EditorMouseEvent | null;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewController: ViewController,\n\t\tviewHelper: IPointerHandlerHelper,\n\t\tcreateMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget,\n\t\tgetMouseColumn: (e: EditorMouseEvent) => number\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._viewController = viewController;\n\t\tthis._viewHelper = viewHelper;\n\t\tthis._createMouseTarget = createMouseTarget;\n\t\tthis._getMouseColumn = getMouseColumn;\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode));\n\t\tthis._onScrollTimeout = this._register(new TimeoutTimer());\n\t\tthis._mouseState = new MouseDownState();\n\n\t\tthis._currentSelection = new Selection(1, 1, 1, 1);\n\t\tthis._isActive = false;\n\t\tthis._lastMouseEvent = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic isActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\tprivate _onMouseDownThenMove(e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._mouseState.setModifiers(e);\n\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\tthis._viewController.emitMouseDrag({\n\t\t\t\tevent: e,\n\t\t\t\ttarget: position\n\t\t\t});\n\t\t} else {\n\t\t\tthis._dispatchMouse(position, true);\n\t\t}\n\t}\n\n\tpublic start(targetType: MouseTargetType, e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tthis._mouseState.setStartButtons(e);\n\t\tthis._mouseState.setModifiers(e);\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position || !position.position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.trySetCount(e.detail, position.position);\n\n\t\t// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n\t\te.detail = this._mouseState.count;\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (!options.get(EditorOption.readOnly)\n\t\t\t&& options.get(EditorOption.dragAndDrop)\n\t\t\t&& !options.get(EditorOption.columnSelection)\n\t\t\t&& !this._mouseState.altKey // we don't support multiple mouse\n\t\t\t&& e.detail < 2 // only single click on a selection can work\n\t\t\t&& !this._isActive // the mouse is not down yet\n\t\t\t&& !this._currentSelection.isEmpty() // we don't drag single cursor\n\t\t\t&& (position.type === MouseTargetType.CONTENT_TEXT) // single click on text\n\t\t\t&& position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n\t\t) {\n\t\t\tthis._mouseState.isDragAndDrop = true;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\te.target,\n\t\t\t\te.buttons,\n\t\t\t\tcreateMouseMoveEventMerger(null),\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t(browserEvent?: MouseEvent | KeyboardEvent) => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, true);\n\n\t\t\t\t\tif (browserEvent && browserEvent instanceof KeyboardEvent) {\n\t\t\t\t\t\t// cancel\n\t\t\t\t\t\tthis._viewController.emitMouseDropCanceled();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\t\t\t\t\t\t\ttarget: (position ? this._createMouseTarget(this._lastMouseEvent!, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._stop();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.isDragAndDrop = false;\n\t\tthis._dispatchMouse(position, e.shiftKey);\n\n\t\tif (!this._isActive) {\n\t\t\tthis._isActive = true;\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\te.target,\n\t\t\t\te.buttons,\n\t\t\t\tcreateMouseMoveEventMerger(null),\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => this._stop()\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _stop(): void {\n\t\tthis._isActive = false;\n\t\tthis._onScrollTimeout.cancel();\n\t}\n\n\tpublic onHeightChanged(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onScrollChanged(): void {\n\t\tif (!this._isActive) {\n\t\t\treturn;\n\t\t}\n\t\tthis._onScrollTimeout.setIfNotSet(() => {\n\t\t\tif (!this._lastMouseEvent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst position = this._findMousePosition(this._lastMouseEvent, false);\n\t\t\tif (!position) {\n\t\t\t\t// Ignoring because position is unknown\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\t\t// Ignoring because users are dragging the text\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dispatchMouse(position, true);\n\t\t}, 10);\n\t}\n\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void {\n\t\tthis._currentSelection = e.selections[0];\n\t}\n\n\tprivate _getPositionOutsideEditor(e: EditorMouseEvent): IMouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.viewModel;\n\t\tconst viewLayout = this._context.viewLayout;\n\n\t\tconst mouseColumn = this._getMouseColumn(e);\n\n\t\tif (e.posy < editorContent.y) {\n\t\t\tconst verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - (editorContent.y - e.posy), 0);\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1));\n\t\t}\n\n\t\tif (e.posy > editorContent.y + editorContent.height) {\n\t\t\tconst verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)));\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n\n\t\tif (e.posx < editorContent.x) {\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1));\n\t\t}\n\n\t\tif (e.posx > editorContent.x + editorContent.width) {\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMousePosition(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget | null {\n\t\tconst positionOutsideEditor = this._getPositionOutsideEditor(e);\n\t\tif (positionOutsideEditor) {\n\t\t\treturn positionOutsideEditor;\n\t\t}\n\n\t\tconst t = this._createMouseTarget(e, testEventTarget);\n\t\tconst hintedPosition = t.position;\n\t\tif (!hintedPosition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IMouseTargetViewZoneData): Position | null {\n\t\t// Force position on view zones to go above or below depending on where selection started from\n\t\tconst selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n\t\tconst positionBefore = viewZoneData.positionBefore;\n\t\tconst positionAfter = viewZoneData.positionAfter;\n\n\t\tif (positionBefore && positionAfter) {\n\t\t\tif (positionBefore.isBefore(selectionStart)) {\n\t\t\t\treturn positionBefore;\n\t\t\t} else {\n\t\t\t\treturn positionAfter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _dispatchMouse(position: IMouseTarget, inSelectionMode: boolean): void {\n\t\tif (!position.position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewController.dispatchMouse({\n\t\t\tposition: position.position,\n\t\t\tmouseColumn: position.mouseColumn,\n\t\t\tstartedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n\n\t\t\tinSelectionMode: inSelectionMode,\n\t\t\tmouseDownCount: this._mouseState.count,\n\t\t\taltKey: this._mouseState.altKey,\n\t\t\tctrlKey: this._mouseState.ctrlKey,\n\t\t\tmetaKey: this._mouseState.metaKey,\n\t\t\tshiftKey: this._mouseState.shiftKey,\n\n\t\t\tleftButton: this._mouseState.leftButton,\n\t\t\tmiddleButton: this._mouseState.middleButton,\n\n\t\t\tonInjectedText: position.type === MouseTargetType.CONTENT_TEXT && position.detail.injectedText !== null\n\t\t});\n\t}\n}\n\nclass MouseDownState {\n\n\tprivate static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n\n\tprivate _altKey: boolean;\n\tpublic get altKey(): boolean { return this._altKey; }\n\n\tprivate _ctrlKey: boolean;\n\tpublic get ctrlKey(): boolean { return this._ctrlKey; }\n\n\tprivate _metaKey: boolean;\n\tpublic get metaKey(): boolean { return this._metaKey; }\n\n\tprivate _shiftKey: boolean;\n\tpublic get shiftKey(): boolean { return this._shiftKey; }\n\n\tprivate _leftButton: boolean;\n\tpublic get leftButton(): boolean { return this._leftButton; }\n\n\tprivate _middleButton: boolean;\n\tpublic get middleButton(): boolean { return this._middleButton; }\n\n\tprivate _startedOnLineNumbers: boolean;\n\tpublic get startedOnLineNumbers(): boolean { return this._startedOnLineNumbers; }\n\n\tprivate _lastMouseDownPosition: Position | null;\n\tprivate _lastMouseDownPositionEqualCount: number;\n\tprivate _lastMouseDownCount: number;\n\tprivate _lastSetMouseDownCountTime: number;\n\tpublic isDragAndDrop: boolean;\n\n\tconstructor() {\n\t\tthis._altKey = false;\n\t\tthis._ctrlKey = false;\n\t\tthis._metaKey = false;\n\t\tthis._shiftKey = false;\n\t\tthis._leftButton = false;\n\t\tthis._middleButton = false;\n\t\tthis._startedOnLineNumbers = false;\n\t\tthis._lastMouseDownPosition = null;\n\t\tthis._lastMouseDownPositionEqualCount = 0;\n\t\tthis._lastMouseDownCount = 0;\n\t\tthis._lastSetMouseDownCountTime = 0;\n\t\tthis.isDragAndDrop = false;\n\t}\n\n\tpublic get count(): number {\n\t\treturn this._lastMouseDownCount;\n\t}\n\n\tpublic setModifiers(source: EditorMouseEvent) {\n\t\tthis._altKey = source.altKey;\n\t\tthis._ctrlKey = source.ctrlKey;\n\t\tthis._metaKey = source.metaKey;\n\t\tthis._shiftKey = source.shiftKey;\n\t}\n\n\tpublic setStartButtons(source: EditorMouseEvent) {\n\t\tthis._leftButton = source.leftButton;\n\t\tthis._middleButton = source.middleButton;\n\t}\n\n\tpublic setStartedOnLineNumbers(startedOnLineNumbers: boolean): void {\n\t\tthis._startedOnLineNumbers = startedOnLineNumbers;\n\t}\n\n\tpublic trySetCount(setMouseDownCount: number, newMouseDownPosition: Position): void {\n\t\t// a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tconst currentTime = (new Date()).getTime();\n\t\tif (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n\t\t\tsetMouseDownCount = 1;\n\t\t}\n\t\tthis._lastSetMouseDownCountTime = currentTime;\n\n\t\t// b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tif (setMouseDownCount > this._lastMouseDownCount + 1) {\n\t\t\tsetMouseDownCount = this._lastMouseDownCount + 1;\n\t\t}\n\n\t\t// c. Invalidate multiple clicking if the logical position is different\n\t\tif (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n\t\t\tthis._lastMouseDownPositionEqualCount++;\n\t\t} else {\n\t\t\tthis._lastMouseDownPositionEqualCount = 1;\n\t\t}\n\t\tthis._lastMouseDownPosition = newMouseDownPosition;\n\n\t\t// Finally set the lastMouseDownCount\n\t\tthis._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport * as platform from 'vs/base/common/platform';\nimport { EventType, Gesture, GestureEvent } from 'vs/base/browser/touch';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IPointerHandlerHelper, MouseHandler, createMouseMoveEventMerger } from 'vs/editor/browser/controller/mouseHandler';\nimport { IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorMouseEvent, EditorPointerEventFactory } from 'vs/editor/browser/editorDom';\nimport { ViewController } from 'vs/editor/browser/view/viewController';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport { BrowserFeatures } from 'vs/base/browser/canIUse';\nimport { TextAreaSyntethicEvents } from 'vs/editor/browser/controller/textAreaInput';\n\n/**\n * Currently only tested on iOS 13/ iPadOS.\n */\nexport class PointerEventHandler extends MouseHandler {\n\tprivate _lastPointerType: string;\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper(context, viewController, viewHelper);\n\n\t\tthis._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Tap, (e) => this.onTap(e)));\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Change, (e) => this.onChange(e)));\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Contextmenu, (e: MouseEvent) => this._onContextMenu(new EditorMouseEvent(e, this.viewHelper.viewDomNode), false)));\n\n\t\tthis._lastPointerType = 'mouse';\n\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, 'pointerdown', (e: any) => {\n\t\t\tconst pointerType = <any>e.pointerType;\n\t\t\tif (pointerType === 'mouse') {\n\t\t\t\tthis._lastPointerType = 'mouse';\n\t\t\t\treturn;\n\t\t\t} else if (pointerType === 'touch') {\n\t\t\t\tthis._lastPointerType = 'touch';\n\t\t\t} else {\n\t\t\t\tthis._lastPointerType = 'pen';\n\t\t\t}\n\t\t}));\n\n\t\t// PonterEvents\n\t\tconst pointerEvents = new EditorPointerEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(pointerEvents.onPointerMoveThrottled(this.viewHelper.viewDomNode,\n\t\t\t(e) => this._onMouseMove(e),\n\t\t\tcreateMouseMoveEventMerger(this.mouseTargetFactory), MouseHandler.MOUSE_MOVE_MINIMUM_TIME));\n\t\tthis._register(pointerEvents.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\t\tthis._register(pointerEvents.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\t\tthis._register(pointerEvents.onPointerDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e)));\n\t}\n\n\tprivate onTap(event: GestureEvent): void {\n\t\tif (!event.initialTarget || !this.viewHelper.linesContentDomNode.contains(<any>event.initialTarget)) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tthis.viewHelper.focusTextArea();\n\t\tconst target = this._createMouseTarget(new EditorMouseEvent(event, this.viewHelper.viewDomNode), false);\n\n\t\tif (target.position) {\n\t\t\t// this.viewController.moveTo(target.position);\n\t\t\tthis.viewController.dispatchMouse({\n\t\t\t\tposition: target.position,\n\t\t\t\tmouseColumn: target.position.column,\n\t\t\t\tstartedOnLineNumbers: false,\n\t\t\t\tmouseDownCount: event.tapCount,\n\t\t\t\tinSelectionMode: false,\n\t\t\t\taltKey: false,\n\t\t\t\tctrlKey: false,\n\t\t\t\tmetaKey: false,\n\t\t\t\tshiftKey: false,\n\n\t\t\t\tleftButton: false,\n\t\t\t\tmiddleButton: false,\n\t\t\t\tonInjectedText: target.type === MouseTargetType.CONTENT_TEXT && target.detail.injectedText !== null\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate onChange(e: GestureEvent): void {\n\t\tif (this._lastPointerType === 'touch') {\n\t\t\tthis._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);\n\t\t}\n\t}\n\n\tpublic override _onMouseDown(e: EditorMouseEvent): void {\n\t\tif ((e.browserEvent as any).pointerType === 'touch') {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper._onMouseDown(e);\n\t}\n}\n\nclass TouchHandler extends MouseHandler {\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper(context, viewController, viewHelper);\n\n\t\tthis._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));\n\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Tap, (e) => this.onTap(e)));\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Change, (e) => this.onChange(e)));\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Contextmenu, (e: MouseEvent) => this._onContextMenu(new EditorMouseEvent(e, this.viewHelper.viewDomNode), false)));\n\t}\n\n\tprivate onTap(event: GestureEvent): void {\n\t\tevent.preventDefault();\n\n\t\tthis.viewHelper.focusTextArea();\n\n\t\tconst target = this._createMouseTarget(new EditorMouseEvent(event, this.viewHelper.viewDomNode), false);\n\n\t\tif (target.position) {\n\t\t\t// Send the tap event also to the <textarea> (for input purposes)\n\t\t\tconst event = document.createEvent('CustomEvent');\n\t\t\tevent.initEvent(TextAreaSyntethicEvents.Tap, false, true);\n\t\t\tthis.viewHelper.dispatchTextAreaEvent(event);\n\n\t\t\tthis.viewController.moveTo(target.position);\n\t\t}\n\t}\n\n\tprivate onChange(e: GestureEvent): void {\n\t\tthis._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);\n\t}\n}\n\nexport class PointerHandler extends Disposable {\n\tprivate readonly handler: MouseHandler;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\t\tif ((platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.handler = this._register(new PointerEventHandler(context, viewController, viewHelper));\n\t\t} else if (window.TouchEvent) {\n\t\t\tthis.handler = this._register(new TouchHandler(context, viewController, viewHelper));\n\t\t} else {\n\t\t\tthis.handler = this._register(new MouseHandler(context, viewController, viewHelper));\n\t\t}\n\t}\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\treturn this.handler.getTargetAtClientPoint(clientX, clientY);\n\t}\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 'vs/css!./viewLines';\nimport * as platform from 'vs/base/common/platform';\nimport { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { IVisibleLinesHost, VisibleLinesCollection } from 'vs/editor/browser/view/viewLayer';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { DomReadingContext, ViewLine, ViewLineOptions } from 'vs/editor/browser/viewParts/lines/viewLine';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IViewLines, LineVisibleRanges, VisibleRanges, HorizontalPosition, HorizontalRange } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { Viewport } from 'vs/editor/common/viewModel';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Constants } from 'vs/base/common/uint';\nimport { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor';\n\nclass LastRenderedData {\n\n\tprivate _currentVisibleRange: Range;\n\n\tconstructor() {\n\t\tthis._currentVisibleRange = new Range(1, 1, 1, 1);\n\t}\n\n\tpublic getCurrentVisibleRange(): Range {\n\t\treturn this._currentVisibleRange;\n\t}\n\n\tpublic setCurrentVisibleRange(currentVisibleRange: Range): void {\n\t\tthis._currentVisibleRange = currentVisibleRange;\n\t}\n}\n\nclass HorizontalRevealRangeRequest {\n\tpublic readonly type = 'range';\n\tpublic readonly minLineNumber: number;\n\tpublic readonly maxLineNumber: number;\n\n\tconstructor(\n\t\tpublic readonly minimalReveal: boolean,\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly startColumn: number,\n\t\tpublic readonly endColumn: number,\n\t\tpublic readonly startScrollTop: number,\n\t\tpublic readonly stopScrollTop: number,\n\t\tpublic readonly scrollType: ScrollType\n\t) {\n\t\tthis.minLineNumber = lineNumber;\n\t\tthis.maxLineNumber = lineNumber;\n\t}\n}\n\nclass HorizontalRevealSelectionsRequest {\n\tpublic readonly type = 'selections';\n\tpublic readonly minLineNumber: number;\n\tpublic readonly maxLineNumber: number;\n\n\tconstructor(\n\t\tpublic readonly minimalReveal: boolean,\n\t\tpublic readonly selections: Selection[],\n\t\tpublic readonly startScrollTop: number,\n\t\tpublic readonly stopScrollTop: number,\n\t\tpublic readonly scrollType: ScrollType\n\t) {\n\t\tlet minLineNumber = selections[0].startLineNumber;\n\t\tlet maxLineNumber = selections[0].endLineNumber;\n\t\tfor (let i = 1, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tminLineNumber = Math.min(minLineNumber, selection.startLineNumber);\n\t\t\tmaxLineNumber = Math.max(maxLineNumber, selection.endLineNumber);\n\t\t}\n\t\tthis.minLineNumber = minLineNumber;\n\t\tthis.maxLineNumber = maxLineNumber;\n\t}\n}\n\ntype HorizontalRevealRequest = HorizontalRevealRangeRequest | HorizontalRevealSelectionsRequest;\n\nexport class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>, IViewLines {\n\t/**\n\t * Adds this amount of pixels to the right of lines (no-one wants to type near the edge of the viewport)\n\t */\n\tprivate static readonly HORIZONTAL_EXTRA_PX = 30;\n\n\tprivate readonly _linesContent: FastDomNode<HTMLElement>;\n\tprivate readonly _textRangeRestingSpot: HTMLElement;\n\tprivate readonly _visibleLines: VisibleLinesCollection<ViewLine>;\n\tprivate readonly domNode: FastDomNode<HTMLElement>;\n\n\t// --- config\n\tprivate _lineHeight: number;\n\tprivate _typicalHalfwidthCharacterWidth: number;\n\tprivate _isViewportWrapping: boolean;\n\tprivate _revealHorizontalRightPadding: number;\n\tprivate _horizontalScrollbarHeight: number;\n\tprivate _cursorSurroundingLines: number;\n\tprivate _cursorSurroundingLinesStyle: 'default' | 'all';\n\tprivate _canUseLayerHinting: boolean;\n\tprivate _viewLineOptions: ViewLineOptions;\n\n\t// --- width\n\tprivate _maxLineWidth: number;\n\tprivate readonly _asyncUpdateLineWidths: RunOnceScheduler;\n\tprivate readonly _asyncCheckMonospaceFontAssumptions: RunOnceScheduler;\n\n\tprivate _horizontalRevealRequest: HorizontalRevealRequest | null;\n\tprivate readonly _lastRenderedData: LastRenderedData;\n\n\tconstructor(context: ViewContext, linesContent: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._linesContent = linesContent;\n\t\tthis._textRangeRestingSpot = document.createElement('div');\n\t\tthis._visibleLines = new VisibleLinesCollection(this);\n\t\tthis.domNode = this._visibleLines.domNode;\n\n\t\tconst conf = this._context.configuration;\n\t\tconst options = this._context.configuration.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._isViewportWrapping = wrappingInfo.isViewportWrapping;\n\t\tthis._revealHorizontalRightPadding = options.get(EditorOption.revealHorizontalRightPadding);\n\t\tthis._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;\n\t\tthis._cursorSurroundingLines = options.get(EditorOption.cursorSurroundingLines);\n\t\tthis._cursorSurroundingLinesStyle = options.get(EditorOption.cursorSurroundingLinesStyle);\n\t\tthis._canUseLayerHinting = !options.get(EditorOption.disableLayerHinting);\n\t\tthis._viewLineOptions = new ViewLineOptions(conf, this._context.theme.type);\n\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ViewLines);\n\t\tthis.domNode.setClassName(`view-lines ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);\n\t\tapplyFontInfo(this.domNode, fontInfo);\n\n\t\t// --- width & height\n\t\tthis._maxLineWidth = 0;\n\t\tthis._asyncUpdateLineWidths = new RunOnceScheduler(() => {\n\t\t\tthis._updateLineWidthsSlow();\n\t\t}, 200);\n\t\tthis._asyncCheckMonospaceFontAssumptions = new RunOnceScheduler(() => {\n\t\t\tthis._checkMonospaceFontAssumptions();\n\t\t}, 2000);\n\n\t\tthis._lastRenderedData = new LastRenderedData();\n\n\t\tthis._horizontalRevealRequest = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._asyncUpdateLineWidths.dispose();\n\t\tthis._asyncCheckMonospaceFontAssumptions.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this.domNode;\n\t}\n\n\t// ---- begin IVisibleLinesHost\n\n\tpublic createVisibleLine(): ViewLine {\n\t\treturn new ViewLine(this._viewLineOptions);\n\t}\n\n\t// ---- end IVisibleLinesHost\n\n\t// ---- begin view event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis._visibleLines.onConfigurationChanged(e);\n\t\tif (e.hasChanged(EditorOption.wrappingInfo)) {\n\t\t\tthis._maxLineWidth = 0;\n\t\t}\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._isViewportWrapping = wrappingInfo.isViewportWrapping;\n\t\tthis._revealHorizontalRightPadding = options.get(EditorOption.revealHorizontalRightPadding);\n\t\tthis._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;\n\t\tthis._cursorSurroundingLines = options.get(EditorOption.cursorSurroundingLines);\n\t\tthis._cursorSurroundingLinesStyle = options.get(EditorOption.cursorSurroundingLinesStyle);\n\t\tthis._canUseLayerHinting = !options.get(EditorOption.disableLayerHinting);\n\t\tapplyFontInfo(this.domNode, fontInfo);\n\n\t\tthis._onOptionsMaybeChanged();\n\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tthis._maxLineWidth = 0;\n\t\t}\n\n\t\treturn true;\n\t}\n\tprivate _onOptionsMaybeChanged(): boolean {\n\t\tconst conf = this._context.configuration;\n\n\t\tconst newViewLineOptions = new ViewLineOptions(conf, this._context.theme.type);\n\t\tif (!this._viewLineOptions.equals(newViewLineOptions)) {\n\t\t\tthis._viewLineOptions = newViewLineOptions;\n\n\t\t\tconst startLineNumber = this._visibleLines.getStartLineNumber();\n\t\t\tconst endLineNumber = this._visibleLines.getEndLineNumber();\n\t\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\t\tconst line = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\t\tline.onOptionsChanged(this._viewLineOptions);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\tlet r = false;\n\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\tr = this._visibleLines.getVisibleLine(lineNumber).onSelectionChanged() || r;\n\t\t}\n\t\treturn r;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\tif (true/*e.inlineDecorationsChanged*/) {\n\t\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\t\tthis._visibleLines.getVisibleLine(lineNumber).onDecorationsChanged();\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tconst shouldRender = this._visibleLines.onFlushed(e);\n\t\tthis._maxLineWidth = 0;\n\t\treturn shouldRender;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._visibleLines.onLinesChanged(e);\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn this._visibleLines.onLinesDeleted(e);\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn this._visibleLines.onLinesInserted(e);\n\t}\n\tpublic override onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean {\n\t\t// Using the future viewport here in order to handle multiple\n\t\t// incoming reveal range requests that might all desire to be animated\n\t\tconst desiredScrollTop = this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(), e.source, e.minimalReveal, e.range, e.selections, e.verticalType);\n\n\t\tif (desiredScrollTop === -1) {\n\t\t\t// marker to abort the reveal range request\n\t\t\treturn false;\n\t\t}\n\n\t\t// validate the new desired scroll top\n\t\tlet newScrollPosition = this._context.viewLayout.validateScrollPosition({ scrollTop: desiredScrollTop });\n\n\t\tif (e.revealHorizontal) {\n\t\t\tif (e.range && e.range.startLineNumber !== e.range.endLineNumber) {\n\t\t\t\t// Two or more lines? => scroll to base (That's how you see most of the two lines)\n\t\t\t\tnewScrollPosition = {\n\t\t\t\t\tscrollTop: newScrollPosition.scrollTop,\n\t\t\t\t\tscrollLeft: 0\n\t\t\t\t};\n\t\t\t} else if (e.range) {\n\t\t\t\t// We don't necessarily know the horizontal offset of this range since the line might not be in the view...\n\t\t\t\tthis._horizontalRevealRequest = new HorizontalRevealRangeRequest(e.minimalReveal, e.range.startLineNumber, e.range.startColumn, e.range.endColumn, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType);\n\t\t\t} else if (e.selections && e.selections.length > 0) {\n\t\t\t\tthis._horizontalRevealRequest = new HorizontalRevealSelectionsRequest(e.minimalReveal, e.selections, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._horizontalRevealRequest = null;\n\t\t}\n\n\t\tconst scrollTopDelta = Math.abs(this._context.viewLayout.getCurrentScrollTop() - newScrollPosition.scrollTop);\n\t\tconst scrollType = (scrollTopDelta <= this._lineHeight ? ScrollType.Immediate : e.scrollType);\n\t\tthis._context.viewModel.viewLayout.setScrollPosition(newScrollPosition, scrollType);\n\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tif (this._horizontalRevealRequest && e.scrollLeftChanged) {\n\t\t\t// cancel any outstanding horizontal reveal request if someone else scrolls horizontally.\n\t\t\tthis._horizontalRevealRequest = null;\n\t\t}\n\t\tif (this._horizontalRevealRequest && e.scrollTopChanged) {\n\t\t\tconst min = Math.min(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);\n\t\t\tconst max = Math.max(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);\n\t\t\tif (e.scrollTop < min || e.scrollTop > max) {\n\t\t\t\t// cancel any outstanding horizontal reveal request if someone else scrolls vertically.\n\t\t\t\tthis._horizontalRevealRequest = null;\n\t\t\t}\n\t\t}\n\t\tthis.domNode.setWidth(e.scrollWidth);\n\t\treturn this._visibleLines.onScrollChanged(e) || true;\n\t}\n\n\tpublic override onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._visibleLines.onTokensChanged(e);\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\tthis._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth);\n\t\treturn this._visibleLines.onZonesChanged(e);\n\t}\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\treturn this._onOptionsMaybeChanged();\n\t}\n\n\t// ---- end view event handlers\n\n\t// ----------- HELPERS FOR OTHERS\n\n\tpublic getPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null {\n\t\tconst viewLineDomNode = this._getViewLineDomNode(spanNode);\n\t\tif (viewLineDomNode === null) {\n\t\t\t// Couldn't find view line node\n\t\t\treturn null;\n\t\t}\n\t\tconst lineNumber = this._getLineNumberFor(viewLineDomNode);\n\n\t\tif (lineNumber === -1) {\n\t\t\t// Couldn't find view line node\n\t\t\treturn null;\n\t\t}\n\n\t\tif (lineNumber < 1 || lineNumber > this._context.viewModel.getLineCount()) {\n\t\t\t// lineNumber is outside range\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._context.viewModel.getLineMaxColumn(lineNumber) === 1) {\n\t\t\t// Line is empty\n\t\t\treturn new Position(lineNumber, 1);\n\t\t}\n\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\tif (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n\t\t\t// Couldn't find line\n\t\t\treturn null;\n\t\t}\n\n\t\tlet column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(lineNumber, spanNode, offset);\n\t\tconst minColumn = this._context.viewModel.getLineMinColumn(lineNumber);\n\t\tif (column < minColumn) {\n\t\t\tcolumn = minColumn;\n\t\t}\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _getViewLineDomNode(node: HTMLElement | null): HTMLElement | null {\n\t\twhile (node && node.nodeType === 1) {\n\t\t\tif (node.className === ViewLine.CLASS_NAME) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tnode = node.parentElement;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * @returns the line number of this view line dom node.\n\t */\n\tprivate _getLineNumberFor(domNode: HTMLElement): number {\n\t\tconst startLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst endLineNumber = this._visibleLines.getEndLineNumber();\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst line = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\tif (domNode === line.getDomNode()) {\n\t\t\t\treturn lineNumber;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tpublic getLineWidth(lineNumber: number): number {\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\tif (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n\t\t\t// Couldn't find line\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this._visibleLines.getVisibleLine(lineNumber).getWidth();\n\t}\n\n\tpublic linesVisibleRangesForRange(_range: Range, includeNewLines: boolean): LineVisibleRanges[] | null {\n\t\tif (this.shouldRender()) {\n\t\t\t// Cannot read from the DOM because it is dirty\n\t\t\t// i.e. the model & the dom are out of sync, so I'd be reading something stale\n\t\t\treturn null;\n\t\t}\n\n\t\tconst originalEndLineNumber = _range.endLineNumber;\n\t\tconst range = Range.intersectRanges(_range, this._lastRenderedData.getCurrentVisibleRange());\n\t\tif (!range) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet visibleRanges: LineVisibleRanges[] = [], visibleRangesLen = 0;\n\t\tconst domReadingContext = new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot);\n\n\t\tlet nextLineModelLineNumber: number = 0;\n\t\tif (includeNewLines) {\n\t\t\tnextLineModelLineNumber = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(range.startLineNumber, 1)).lineNumber;\n\t\t}\n\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\tfor (let lineNumber = range.startLineNumber; lineNumber <= range.endLineNumber; lineNumber++) {\n\n\t\t\tif (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst startColumn = lineNumber === range.startLineNumber ? range.startColumn : 1;\n\t\t\tconst endColumn = lineNumber === range.endLineNumber ? range.endColumn : this._context.viewModel.getLineMaxColumn(lineNumber);\n\t\t\tconst visibleRangesForLine = this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(lineNumber, startColumn, endColumn, domReadingContext);\n\n\t\t\tif (!visibleRangesForLine) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (includeNewLines && lineNumber < originalEndLineNumber) {\n\t\t\t\tconst currentLineModelLineNumber = nextLineModelLineNumber;\n\t\t\t\tnextLineModelLineNumber = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber + 1, 1)).lineNumber;\n\n\t\t\t\tif (currentLineModelLineNumber !== nextLineModelLineNumber) {\n\t\t\t\t\tvisibleRangesForLine.ranges[visibleRangesForLine.ranges.length - 1].width += this._typicalHalfwidthCharacterWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvisibleRanges[visibleRangesLen++] = new LineVisibleRanges(visibleRangesForLine.outsideRenderedLine, lineNumber, HorizontalRange.from(visibleRangesForLine.ranges));\n\t\t}\n\n\t\tif (visibleRangesLen === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn visibleRanges;\n\t}\n\n\tprivate _visibleRangesForLineRange(lineNumber: number, startColumn: number, endColumn: number): VisibleRanges | null {\n\t\tif (this.shouldRender()) {\n\t\t\t// Cannot read from the DOM because it is dirty\n\t\t\t// i.e. the model & the dom are out of sync, so I'd be reading something stale\n\t\t\treturn null;\n\t\t}\n\n\t\tif (lineNumber < this._visibleLines.getStartLineNumber() || lineNumber > this._visibleLines.getEndLineNumber()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(lineNumber, startColumn, endColumn, new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot));\n\t}\n\n\tpublic visibleRangeForPosition(position: Position): HorizontalPosition | null {\n\t\tconst visibleRanges = this._visibleRangesForLineRange(position.lineNumber, position.column, position.column);\n\t\tif (!visibleRanges) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new HorizontalPosition(visibleRanges.outsideRenderedLine, visibleRanges.ranges[0].left);\n\t}\n\n\t// --- implementation\n\n\tpublic updateLineWidths(): void {\n\t\tthis._updateLineWidths(false);\n\t}\n\n\t/**\n\t * Updates the max line width if it is fast to compute.\n\t * Returns true if all lines were taken into account.\n\t * Returns false if some lines need to be reevaluated (in a slow fashion).\n\t */\n\tprivate _updateLineWidthsFast(): boolean {\n\t\treturn this._updateLineWidths(true);\n\t}\n\n\tprivate _updateLineWidthsSlow(): void {\n\t\tthis._updateLineWidths(false);\n\t}\n\n\tprivate _updateLineWidths(fast: boolean): boolean {\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\n\t\tlet localMaxLineWidth = 1;\n\t\tlet allWidthsComputed = true;\n\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\tconst visibleLine = this._visibleLines.getVisibleLine(lineNumber);\n\n\t\t\tif (fast && !visibleLine.getWidthIsFast()) {\n\t\t\t\t// Cannot compute width in a fast way for this line\n\t\t\t\tallWidthsComputed = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlocalMaxLineWidth = Math.max(localMaxLineWidth, visibleLine.getWidth());\n\t\t}\n\n\t\tif (allWidthsComputed && rendStartLineNumber === 1 && rendEndLineNumber === this._context.viewModel.getLineCount()) {\n\t\t\t// we know the max line width for all the lines\n\t\t\tthis._maxLineWidth = 0;\n\t\t}\n\n\t\tthis._ensureMaxLineWidth(localMaxLineWidth);\n\n\t\treturn allWidthsComputed;\n\t}\n\n\tprivate _checkMonospaceFontAssumptions(): void {\n\t\t// Problems with monospace assumptions are more apparent for longer lines,\n\t\t// as small rounding errors start to sum up, so we will select the longest\n\t\t// line for a closer inspection\n\t\tlet longestLineNumber = -1;\n\t\tlet longestWidth = -1;\n\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\tconst visibleLine = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\tif (visibleLine.needsMonospaceFontCheck()) {\n\t\t\t\tconst lineWidth = visibleLine.getWidth();\n\t\t\t\tif (lineWidth > longestWidth) {\n\t\t\t\t\tlongestWidth = lineWidth;\n\t\t\t\t\tlongestLineNumber = lineNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (longestLineNumber === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._visibleLines.getVisibleLine(longestLineNumber).monospaceAssumptionsAreValid()) {\n\t\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\t\tconst visibleLine = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\t\tvisibleLine.onMonospaceAssumptionsInvalidated();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic prepareRender(): void {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic render(): void {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tpublic renderText(viewportData: ViewportData): void {\n\t\t// (1) render lines - ensures lines are in the DOM\n\t\tthis._visibleLines.renderLines(viewportData);\n\t\tthis._lastRenderedData.setCurrentVisibleRange(viewportData.visibleRange);\n\t\tthis.domNode.setWidth(this._context.viewLayout.getScrollWidth());\n\t\tthis.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1000000));\n\n\t\t// (2) compute horizontal scroll position:\n\t\t// - this must happen after the lines are in the DOM since it might need a line that rendered just now\n\t\t// - it might change `scrollWidth` and `scrollLeft`\n\t\tif (this._horizontalRevealRequest) {\n\n\t\t\tconst horizontalRevealRequest = this._horizontalRevealRequest;\n\n\t\t\t// Check that we have the line that contains the horizontal range in the viewport\n\t\t\tif (viewportData.startLineNumber <= horizontalRevealRequest.minLineNumber && horizontalRevealRequest.maxLineNumber <= viewportData.endLineNumber) {\n\n\t\t\t\tthis._horizontalRevealRequest = null;\n\n\t\t\t\t// allow `visibleRangesForRange2` to work\n\t\t\t\tthis.onDidRender();\n\n\t\t\t\t// compute new scroll position\n\t\t\t\tconst newScrollLeft = this._computeScrollLeftToReveal(horizontalRevealRequest);\n\n\t\t\t\tif (newScrollLeft) {\n\t\t\t\t\tif (!this._isViewportWrapping) {\n\t\t\t\t\t\t// ensure `scrollWidth` is large enough\n\t\t\t\t\t\tthis._ensureMaxLineWidth(newScrollLeft.maxHorizontalOffset);\n\t\t\t\t\t}\n\t\t\t\t\t// set `scrollLeft`\n\t\t\t\t\tthis._context.viewModel.viewLayout.setScrollPosition({\n\t\t\t\t\t\tscrollLeft: newScrollLeft.scrollLeft\n\t\t\t\t\t}, horizontalRevealRequest.scrollType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update max line width (not so important, it is just so the horizontal scrollbar doesn't get too small)\n\t\tif (!this._updateLineWidthsFast()) {\n\t\t\t// Computing the width of some lines would be slow => delay it\n\t\t\tthis._asyncUpdateLineWidths.schedule();\n\t\t}\n\n\t\tif (platform.isLinux && !this._asyncCheckMonospaceFontAssumptions.isScheduled()) {\n\t\t\tconst rendStartLineNumber = this._visibleLines.getStartLineNumber();\n\t\t\tconst rendEndLineNumber = this._visibleLines.getEndLineNumber();\n\t\t\tfor (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {\n\t\t\t\tconst visibleLine = this._visibleLines.getVisibleLine(lineNumber);\n\t\t\t\tif (visibleLine.needsMonospaceFontCheck()) {\n\t\t\t\t\tthis._asyncCheckMonospaceFontAssumptions.schedule();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// (3) handle scrolling\n\t\tthis._linesContent.setLayerHinting(this._canUseLayerHinting);\n\t\tthis._linesContent.setContain('strict');\n\t\tconst adjustedScrollTop = this._context.viewLayout.getCurrentScrollTop() - viewportData.bigNumbersDelta;\n\t\tthis._linesContent.setTop(-adjustedScrollTop);\n\t\tthis._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft());\n\t}\n\n\t// --- width\n\n\tprivate _ensureMaxLineWidth(lineWidth: number): void {\n\t\tconst iLineWidth = Math.ceil(lineWidth);\n\t\tif (this._maxLineWidth < iLineWidth) {\n\t\t\tthis._maxLineWidth = iLineWidth;\n\t\t\tthis._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth);\n\t\t}\n\t}\n\n\tprivate _computeScrollTopToRevealRange(viewport: Viewport, source: string | null | undefined, minimalReveal: boolean, range: Range | null, selections: Selection[] | null, verticalType: viewEvents.VerticalRevealType): number {\n\t\tconst viewportStartY = viewport.top;\n\t\tconst viewportHeight = viewport.height;\n\t\tconst viewportEndY = viewportStartY + viewportHeight;\n\t\tlet boxIsSingleRange: boolean;\n\t\tlet boxStartY: number;\n\t\tlet boxEndY: number;\n\n\t\tif (selections && selections.length > 0) {\n\t\t\tlet minLineNumber = selections[0].startLineNumber;\n\t\t\tlet maxLineNumber = selections[0].endLineNumber;\n\t\t\tfor (let i = 1, len = selections.length; i < len; i++) {\n\t\t\t\tconst selection = selections[i];\n\t\t\t\tminLineNumber = Math.min(minLineNumber, selection.startLineNumber);\n\t\t\t\tmaxLineNumber = Math.max(maxLineNumber, selection.endLineNumber);\n\t\t\t}\n\t\t\tboxIsSingleRange = false;\n\t\t\tboxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(minLineNumber);\n\t\t\tboxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(maxLineNumber) + this._lineHeight;\n\t\t} else if (range) {\n\t\t\tboxIsSingleRange = true;\n\t\t\tboxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.startLineNumber);\n\t\t\tboxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.endLineNumber) + this._lineHeight;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\n\t\tconst shouldIgnoreScrollOff = (source === 'mouse' || minimalReveal) && this._cursorSurroundingLinesStyle === 'default';\n\n\t\tif (!shouldIgnoreScrollOff) {\n\t\t\tconst context = Math.min((viewportHeight / this._lineHeight) / 2, this._cursorSurroundingLines);\n\t\t\tboxStartY -= context * this._lineHeight;\n\t\t\tboxEndY += Math.max(0, (context - 1)) * this._lineHeight;\n\t\t} else {\n\t\t\tif (!minimalReveal) {\n\t\t\t\t// Reveal one more line above (this case is hit when dragging)\n\t\t\t\tboxStartY -= this._lineHeight;\n\t\t\t}\n\t\t}\n\n\t\tif (verticalType === viewEvents.VerticalRevealType.Simple || verticalType === viewEvents.VerticalRevealType.Bottom) {\n\t\t\t// Reveal one line more when the last line would be covered by the scrollbar - arrow down case or revealing a line explicitly at bottom\n\t\t\tboxEndY += (minimalReveal ? this._horizontalScrollbarHeight : this._lineHeight);\n\t\t}\n\n\t\tlet newScrollTop: number;\n\n\t\tif (boxEndY - boxStartY > viewportHeight) {\n\t\t\t// the box is larger than the viewport ... scroll to its top\n\t\t\tif (!boxIsSingleRange) {\n\t\t\t\t// do not reveal multiple cursors if there are more than fit the viewport\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tnewScrollTop = boxStartY;\n\t\t} else if (verticalType === viewEvents.VerticalRevealType.NearTop || verticalType === viewEvents.VerticalRevealType.NearTopIfOutsideViewport) {\n\t\t\tif (verticalType === viewEvents.VerticalRevealType.NearTopIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) {\n\t\t\t\t// Box is already in the viewport... do nothing\n\t\t\t\tnewScrollTop = viewportStartY;\n\t\t\t} else {\n\t\t\t\t// We want a gap that is 20% of the viewport, but with a minimum of 5 lines\n\t\t\t\tconst desiredGapAbove = Math.max(5 * this._lineHeight, viewportHeight * 0.2);\n\t\t\t\t// Try to scroll just above the box with the desired gap\n\t\t\t\tconst desiredScrollTop = boxStartY - desiredGapAbove;\n\t\t\t\t// But ensure that the box is not pushed out of viewport\n\t\t\t\tconst minScrollTop = boxEndY - viewportHeight;\n\t\t\t\tnewScrollTop = Math.max(minScrollTop, desiredScrollTop);\n\t\t\t}\n\t\t} else if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) {\n\t\t\tif (verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) {\n\t\t\t\t// Box is already in the viewport... do nothing\n\t\t\t\tnewScrollTop = viewportStartY;\n\t\t\t} else {\n\t\t\t\t// Box is outside the viewport... center it\n\t\t\t\tconst boxMiddleY = (boxStartY + boxEndY) / 2;\n\t\t\t\tnewScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2);\n\t\t\t}\n\t\t} else {\n\t\t\tnewScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === viewEvents.VerticalRevealType.Top, verticalType === viewEvents.VerticalRevealType.Bottom);\n\t\t}\n\n\t\treturn newScrollTop;\n\t}\n\n\tprivate _computeScrollLeftToReveal(horizontalRevealRequest: HorizontalRevealRequest): { scrollLeft: number; maxHorizontalOffset: number } | null {\n\n\t\tconst viewport = this._context.viewLayout.getCurrentViewport();\n\t\tconst viewportStartX = viewport.left;\n\t\tconst viewportEndX = viewportStartX + viewport.width;\n\n\t\tlet boxStartX = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tlet boxEndX = 0;\n\t\tif (horizontalRevealRequest.type === 'range') {\n\t\t\tconst visibleRanges = this._visibleRangesForLineRange(horizontalRevealRequest.lineNumber, horizontalRevealRequest.startColumn, horizontalRevealRequest.endColumn);\n\t\t\tif (!visibleRanges) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tfor (const visibleRange of visibleRanges.ranges) {\n\t\t\t\tboxStartX = Math.min(boxStartX, Math.round(visibleRange.left));\n\t\t\t\tboxEndX = Math.max(boxEndX, Math.round(visibleRange.left + visibleRange.width));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const selection of horizontalRevealRequest.selections) {\n\t\t\t\tif (selection.startLineNumber !== selection.endLineNumber) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst visibleRanges = this._visibleRangesForLineRange(selection.startLineNumber, selection.startColumn, selection.endColumn);\n\t\t\t\tif (!visibleRanges) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tfor (const visibleRange of visibleRanges.ranges) {\n\t\t\t\t\tboxStartX = Math.min(boxStartX, Math.round(visibleRange.left));\n\t\t\t\t\tboxEndX = Math.max(boxEndX, Math.round(visibleRange.left + visibleRange.width));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!horizontalRevealRequest.minimalReveal) {\n\t\t\tboxStartX = Math.max(0, boxStartX - ViewLines.HORIZONTAL_EXTRA_PX);\n\t\t\tboxEndX += this._revealHorizontalRightPadding;\n\t\t}\n\n\t\tif (horizontalRevealRequest.type === 'selections' && boxEndX - boxStartX > viewport.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst newScrollLeft = this._computeMinimumScrolling(viewportStartX, viewportEndX, boxStartX, boxEndX);\n\t\treturn {\n\t\t\tscrollLeft: newScrollLeft,\n\t\t\tmaxHorizontalOffset: boxEndX\n\t\t};\n\t}\n\n\tprivate _computeMinimumScrolling(viewportStart: number, viewportEnd: number, boxStart: number, boxEnd: number, revealAtStart?: boolean, revealAtEnd?: boolean): number {\n\t\tviewportStart = viewportStart | 0;\n\t\tviewportEnd = viewportEnd | 0;\n\t\tboxStart = boxStart | 0;\n\t\tboxEnd = boxEnd | 0;\n\t\trevealAtStart = !!revealAtStart;\n\t\trevealAtEnd = !!revealAtEnd;\n\n\t\tconst viewportLength = viewportEnd - viewportStart;\n\t\tconst boxLength = boxEnd - boxStart;\n\n\t\tif (boxLength < viewportLength) {\n\t\t\t// The box would fit in the viewport\n\n\t\t\tif (revealAtStart) {\n\t\t\t\treturn boxStart;\n\t\t\t}\n\n\t\t\tif (revealAtEnd) {\n\t\t\t\treturn Math.max(0, boxEnd - viewportLength);\n\t\t\t}\n\n\t\t\tif (boxStart < viewportStart) {\n\t\t\t\t// The box is above the viewport\n\t\t\t\treturn boxStart;\n\t\t\t} else if (boxEnd > viewportEnd) {\n\t\t\t\t// The box is below the viewport\n\t\t\t\treturn Math.max(0, boxEnd - viewportLength);\n\t\t\t}\n\t\t} else {\n\t\t\t// The box would not fit in the viewport\n\t\t\t// Reveal the beginning of the box\n\t\t\treturn boxStart;\n\t\t}\n\n\t\treturn viewportStart;\n\t}\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 { Codicon, CSSIcon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport * as platform from 'vs/platform/registry/common/platform';\nimport { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';\nimport { IconContribution, IconDefinition } from 'vs/platform/theme/common/iconRegistry';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\n\nexport const IThemeService = createDecorator<IThemeService>('themeService');\n\nexport interface ThemeColor {\n\tid: string;\n}\n\nexport namespace ThemeColor {\n\texport function isThemeColor(obj: any): obj is ThemeColor {\n\t\treturn obj && typeof obj === 'object' && typeof (<ThemeColor>obj).id === 'string';\n\t}\n}\n\nexport function themeColorFromId(id: ColorIdentifier) {\n\treturn { id };\n}\n\n// theme icon\nexport interface ThemeIcon {\n\treadonly id: string;\n\treadonly color?: ThemeColor;\n}\n\nexport namespace ThemeIcon {\n\texport function isThemeIcon(obj: any): obj is ThemeIcon {\n\t\treturn obj && typeof obj === 'object' && typeof (<ThemeIcon>obj).id === 'string' && (typeof (<ThemeIcon>obj).color === 'undefined' || ThemeColor.isThemeColor((<ThemeIcon>obj).color));\n\t}\n\n\tconst _regexFromString = new RegExp(`^\\\\$\\\\((${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?)\\\\)$`);\n\n\texport function fromString(str: string): ThemeIcon | undefined {\n\t\tconst match = _regexFromString.exec(str);\n\t\tif (!match) {\n\t\t\treturn undefined;\n\t\t}\n\t\tlet [, name] = match;\n\t\treturn { id: name };\n\t}\n\n\texport function fromId(id: string): ThemeIcon {\n\t\treturn { id };\n\t}\n\n\texport function modify(icon: ThemeIcon, modifier: 'disabled' | 'spin' | undefined): ThemeIcon {\n\t\tlet id = icon.id;\n\t\tconst tildeIndex = id.lastIndexOf('~');\n\t\tif (tildeIndex !== -1) {\n\t\t\tid = id.substring(0, tildeIndex);\n\t\t}\n\t\tif (modifier) {\n\t\t\tid = `${id}~${modifier}`;\n\t\t}\n\t\treturn { id };\n\t}\n\n\texport function getModifier(icon: ThemeIcon): string | undefined {\n\t\tconst tildeIndex = icon.id.lastIndexOf('~');\n\t\tif (tildeIndex !== -1) {\n\t\t\treturn icon.id.substring(tildeIndex + 1);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\texport function isEqual(ti1: ThemeIcon, ti2: ThemeIcon): boolean {\n\t\treturn ti1.id === ti2.id && ti1.color?.id === ti2.color?.id;\n\t}\n\n\texport function asThemeIcon(codicon: Codicon, color?: string): ThemeIcon {\n\t\treturn { id: codicon.id, color: color ? themeColorFromId(color) : undefined };\n\t}\n\n\texport const asClassNameArray: (icon: ThemeIcon) => string[] = CSSIcon.asClassNameArray;\n\texport const asClassName: (icon: ThemeIcon) => string = CSSIcon.asClassName;\n\texport const asCSSSelector: (icon: ThemeIcon) => string = CSSIcon.asCSSSelector;\n}\n\nexport function getThemeTypeSelector(type: ColorScheme): string {\n\tswitch (type) {\n\t\tcase ColorScheme.DARK: return 'vs-dark';\n\t\tcase ColorScheme.HIGH_CONTRAST: return 'hc-black';\n\t\tdefault: return 'vs';\n\t}\n}\n\nexport interface ITokenStyle {\n\treadonly foreground: number | undefined;\n\treadonly bold: boolean | undefined;\n\treadonly underline: boolean | undefined;\n\treadonly strikethrough: boolean | undefined;\n\treadonly italic: boolean | undefined;\n}\n\nexport interface IColorTheme {\n\n\treadonly type: ColorScheme;\n\n\t/**\n\t * Resolves the color of the given color identifier. If the theme does not\n\t * specify the color, the default color is returned unless <code>useDefault</code> is set to false.\n\t * @param color the id of the color\n\t * @param useDefault specifies if the default color should be used. If not set, the default is used.\n\t */\n\tgetColor(color: ColorIdentifier, useDefault?: boolean): Color | undefined;\n\n\t/**\n\t * Returns whether the theme defines a value for the color. If not, that means the\n\t * default color will be used.\n\t */\n\tdefines(color: ColorIdentifier): boolean;\n\n\t/**\n\t * Returns the token style for a given classification. The result uses the <code>MetadataConsts</code> format\n\t */\n\tgetTokenStyleMetadata(type: string, modifiers: string[], modelLanguage: string): ITokenStyle | undefined;\n\n\t/**\n\t * Defines whether semantic highlighting should be enabled for the theme.\n\t */\n\treadonly semanticHighlighting: boolean;\n}\n\nexport interface IFileIconTheme {\n\treadonly hasFileIcons: boolean;\n\treadonly hasFolderIcons: boolean;\n\treadonly hidesExplorerArrows: boolean;\n}\n\nexport interface IProductIconTheme {\n\t/**\n\t * Resolves the definition for the given icon as defined by the theme.\n\t *\n\t * @param iconContribution The icon\n\t */\n\tgetIcon(iconContribution: IconContribution): IconDefinition | undefined;\n}\n\n\nexport interface ICssStyleCollector {\n\taddRule(rule: string): void;\n}\n\nexport interface IThemingParticipant {\n\t(theme: IColorTheme, collector: ICssStyleCollector, environment: IEnvironmentService): void;\n}\n\nexport interface IThemeService {\n\treadonly _serviceBrand: undefined;\n\n\tgetColorTheme(): IColorTheme;\n\n\treadonly onDidColorThemeChange: Event<IColorTheme>;\n\n\tgetFileIconTheme(): IFileIconTheme;\n\n\tgetProductIconTheme(): IProductIconTheme;\n\n\treadonly onDidProductIconThemeChange: Event<IProductIconTheme>;\n\n}\n\n// static theming participant\nexport const Extensions = {\n\tThemingContribution: 'base.contributions.theming'\n};\n\nexport interface IThemingRegistry {\n\n\tgetThemingParticipants(): IThemingParticipant[];\n}\n\nclass ThemingRegistry implements IThemingRegistry {\n\tprivate themingParticipants: IThemingParticipant[] = [];\n\tprivate readonly onThemingParticipantAddedEmitter: Emitter<IThemingParticipant>;\n\n\tconstructor() {\n\t\tthis.themingParticipants = [];\n\t\tthis.onThemingParticipantAddedEmitter = new Emitter<IThemingParticipant>();\n\t}\n\n\tpublic onColorThemeChange(participant: IThemingParticipant): IDisposable {\n\t\tthis.themingParticipants.push(participant);\n\t\tthis.onThemingParticipantAddedEmitter.fire(participant);\n\t\treturn toDisposable(() => {\n\t\t\tconst idx = this.themingParticipants.indexOf(participant);\n\t\t\tthis.themingParticipants.splice(idx, 1);\n\t\t});\n\t}\n\n\tpublic getThemingParticipants(): IThemingParticipant[] {\n\t\treturn this.themingParticipants;\n\t}\n}\n\nlet themingRegistry = new ThemingRegistry();\nplatform.Registry.add(Extensions.ThemingContribution, themingRegistry);\n\nexport function registerThemingParticipant(participant: IThemingParticipant): IDisposable {\n\treturn themingRegistry.onColorThemeChange(participant);\n}\n\n/**\n * Utility base class for all themable components.\n */\nexport class Themable extends Disposable {\n\tprotected theme: IColorTheme;\n\n\tconstructor(\n\t\tprotected themeService: IThemeService\n\t) {\n\t\tsuper();\n\n\t\tthis.theme = themeService.getColorTheme();\n\n\t\t// Hook up to theme changes\n\t\tthis._register(this.themeService.onDidColorThemeChange(theme => this.onThemeChange(theme)));\n\t}\n\n\tprotected onThemeChange(theme: IColorTheme): void {\n\t\tthis.theme = theme;\n\n\t\tthis.updateStyles();\n\t}\n\n\tprotected updateStyles(): void {\n\t\t// Subclasses to override\n\t}\n}\n","\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IResourceEditorInput } from 'vs/platform/editor/common/editor';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;\n\n\tprivate readonly _onCodeEditorRemove: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());\n\tpublic readonly onCodeEditorRemove: Event<ICodeEditor> = this._onCodeEditorRemove.event;\n\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorAdd: Event<IDiffEditor> = this._onDiffEditorAdd.event;\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\tpublic readonly onDiffEditorRemove: Event<IDiffEditor> = this._onDiffEditorRemove.event;\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor };\n\tprotected _globalStyleSheet: GlobalStyleSheet | null;\n\tprivate readonly _decorationOptionProviders = new Map<string, IModelDecorationOptionsProvider>();\n\n\tconstructor(\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(null);\n\t\tthis._globalStyleSheet = null;\n\t}\n\n\taddCodeEditor(editor: ICodeEditor): void {\n\t\tthis._codeEditors[editor.getId()] = editor;\n\t\tthis._onCodeEditorAdd.fire(editor);\n\t}\n\n\tremoveCodeEditor(editor: ICodeEditor): void {\n\t\tif (delete this._codeEditors[editor.getId()]) {\n\t\t\tthis._onCodeEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistCodeEditors(): ICodeEditor[] {\n\t\treturn Object.keys(this._codeEditors).map(id => this._codeEditors[id]);\n\t}\n\n\taddDiffEditor(editor: IDiffEditor): void {\n\t\tthis._diffEditors[editor.getId()] = editor;\n\t\tthis._onDiffEditorAdd.fire(editor);\n\t}\n\n\tremoveDiffEditor(editor: IDiffEditor): void {\n\t\tif (delete this._diffEditors[editor.getId()]) {\n\t\t\tthis._onDiffEditorRemove.fire(editor);\n\t\t}\n\t}\n\n\tlistDiffEditors(): IDiffEditor[] {\n\t\treturn Object.keys(this._diffEditors).map(id => this._diffEditors[id]);\n\t}\n\n\tgetFocusedCodeEditor(): ICodeEditor | null {\n\t\tlet editorWithWidgetFocus: ICodeEditor | null = null;\n\n\t\tconst editors = this.listCodeEditors();\n\t\tfor (const editor of editors) {\n\n\t\t\tif (editor.hasTextFocus()) {\n\t\t\t\t// bingo!\n\t\t\t\treturn editor;\n\t\t\t}\n\n\t\t\tif (editor.hasWidgetFocus()) {\n\t\t\t\teditorWithWidgetFocus = editor;\n\t\t\t}\n\t\t}\n\n\t\treturn editorWithWidgetFocus;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders.get(key);\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tthis._decorationOptionProviders.delete(key);\n\t\t\t\tprovider.dispose();\n\t\t\t\tthis.listCodeEditors().forEach((ed) => ed.removeDecorations(key));\n\t\t\t}\n\t\t}\n\t}\n\tprivate readonly _modelProperties = new Map<string, Map<string, any>>();\n\n\tpublic setModelProperty(resource: URI, key: string, value: any): void {\n\t\tconst key1 = resource.toString();\n\t\tlet dest: Map<string, any>;\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tdest = this._modelProperties.get(key1)!;\n\t\t} else {\n\t\t\tdest = new Map<string, any>();\n\t\t\tthis._modelProperties.set(key1, dest);\n\t\t}\n\n\t\tdest.set(key, value);\n\t}\n\n\tpublic getModelProperty(resource: URI, key: string): any {\n\t\tconst key1 = resource.toString();\n\t\tif (this._modelProperties.has(key1)) {\n\t\t\tconst innerMap = this._modelProperties.get(key1)!;\n\t\t\treturn innerMap.get(key);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\tabstract openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n}\n\nexport class GlobalStyleSheet {\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\n\tconstructor(styleSheet: HTMLStyleElement) {\n\t\tthis._styleSheet = styleSheet;\n\t}\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: 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 * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { IOverviewRulerLayoutInfo, SmoothScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { ScrollableElementChangeOptions, ScrollableElementCreationOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { INewScrollPosition, ScrollType } from 'vs/editor/common/editorCommon';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { registerThemingParticipant, getThemeTypeSelector } from 'vs/platform/theme/common/themeService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry';\n\nexport class EditorScrollbar extends ViewPart {\n\n\tprivate readonly scrollbar: SmoothScrollableElement;\n\tprivate readonly scrollbarDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tlinesContent: FastDomNode<HTMLElement>,\n\t\tviewDomNode: FastDomNode<HTMLElement>,\n\t\toverflowGuardDomNode: FastDomNode<HTMLElement>\n\t) {\n\t\tsuper(context);\n\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\tconst mouseWheelScrollSensitivity = options.get(EditorOption.mouseWheelScrollSensitivity);\n\t\tconst fastScrollSensitivity = options.get(EditorOption.fastScrollSensitivity);\n\t\tconst scrollPredominantAxis = options.get(EditorOption.scrollPredominantAxis);\n\n\t\tconst scrollbarOptions: ScrollableElementCreationOptions = {\n\t\t\tlistenOnDomNode: viewDomNode.domNode,\n\t\t\tclassName: 'editor-scrollable' + ' ' + getThemeTypeSelector(context.theme.type),\n\t\t\tuseShadows: false,\n\t\t\tlazyRender: true,\n\n\t\t\tvertical: scrollbar.vertical,\n\t\t\thorizontal: scrollbar.horizontal,\n\t\t\tverticalHasArrows: scrollbar.verticalHasArrows,\n\t\t\thorizontalHasArrows: scrollbar.horizontalHasArrows,\n\t\t\tverticalScrollbarSize: scrollbar.verticalScrollbarSize,\n\t\t\tverticalSliderSize: scrollbar.verticalSliderSize,\n\t\t\thorizontalScrollbarSize: scrollbar.horizontalScrollbarSize,\n\t\t\thorizontalSliderSize: scrollbar.horizontalSliderSize,\n\t\t\thandleMouseWheel: scrollbar.handleMouseWheel,\n\t\t\talwaysConsumeMouseWheel: scrollbar.alwaysConsumeMouseWheel,\n\t\t\tarrowSize: scrollbar.arrowSize,\n\t\t\tmouseWheelScrollSensitivity: mouseWheelScrollSensitivity,\n\t\t\tfastScrollSensitivity: fastScrollSensitivity,\n\t\t\tscrollPredominantAxis: scrollPredominantAxis,\n\t\t\tscrollByPage: scrollbar.scrollByPage,\n\t\t};\n\n\t\tthis.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.getScrollable()));\n\t\tPartFingerprints.write(this.scrollbar.getDomNode(), PartFingerprint.ScrollableElement);\n\n\t\tthis.scrollbarDomNode = createFastDomNode(this.scrollbar.getDomNode());\n\t\tthis.scrollbarDomNode.setPosition('absolute');\n\t\tthis._setLayout();\n\n\t\t// When having a zone widget that calls .focus() on one of its dom elements,\n\t\t// the browser will try desperately to reveal that dom node, unexpectedly\n\t\t// changing the .scrollTop of this.linesContent\n\n\t\tconst onBrowserDesperateReveal = (domNode: HTMLElement, lookAtScrollTop: boolean, lookAtScrollLeft: boolean) => {\n\t\t\tconst newScrollPosition: INewScrollPosition = {};\n\n\t\t\tif (lookAtScrollTop) {\n\t\t\t\tconst deltaTop = domNode.scrollTop;\n\t\t\t\tif (deltaTop) {\n\t\t\t\t\tnewScrollPosition.scrollTop = this._context.viewLayout.getCurrentScrollTop() + deltaTop;\n\t\t\t\t\tdomNode.scrollTop = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lookAtScrollLeft) {\n\t\t\t\tconst deltaLeft = domNode.scrollLeft;\n\t\t\t\tif (deltaLeft) {\n\t\t\t\t\tnewScrollPosition.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + deltaLeft;\n\t\t\t\t\tdomNode.scrollLeft = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._context.viewModel.viewLayout.setScrollPosition(newScrollPosition, ScrollType.Immediate);\n\t\t};\n\n\t\t// I've seen this happen both on the view dom node & on the lines content dom node.\n\t\tthis._register(dom.addDisposableListener(viewDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(viewDomNode.domNode, true, true)));\n\t\tthis._register(dom.addDisposableListener(linesContent.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(linesContent.domNode, true, false)));\n\t\tthis._register(dom.addDisposableListener(overflowGuardDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(overflowGuardDomNode.domNode, true, false)));\n\t\tthis._register(dom.addDisposableListener(this.scrollbarDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(this.scrollbarDomNode.domNode, true, false)));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _setLayout(): void {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis.scrollbarDomNode.setLeft(layoutInfo.contentLeft);\n\n\t\tconst minimap = options.get(EditorOption.minimap);\n\t\tconst side = minimap.side;\n\t\tif (side === 'right') {\n\t\t\tthis.scrollbarDomNode.setWidth(layoutInfo.contentWidth + layoutInfo.minimap.minimapWidth);\n\t\t} else {\n\t\t\tthis.scrollbarDomNode.setWidth(layoutInfo.contentWidth);\n\t\t}\n\t\tthis.scrollbarDomNode.setHeight(layoutInfo.height);\n\t}\n\n\tpublic getOverviewRulerLayoutInfo(): IOverviewRulerLayoutInfo {\n\t\treturn this.scrollbar.getOverviewRulerLayoutInfo();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this.scrollbarDomNode;\n\t}\n\n\tpublic delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void {\n\t\tthis.scrollbar.delegateVerticalScrollbarMouseDown(browserEvent);\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (\n\t\t\te.hasChanged(EditorOption.scrollbar)\n\t\t\t|| e.hasChanged(EditorOption.mouseWheelScrollSensitivity)\n\t\t\t|| e.hasChanged(EditorOption.fastScrollSensitivity)\n\t\t) {\n\t\t\tconst options = this._context.configuration.options;\n\t\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\t\tconst mouseWheelScrollSensitivity = options.get(EditorOption.mouseWheelScrollSensitivity);\n\t\t\tconst fastScrollSensitivity = options.get(EditorOption.fastScrollSensitivity);\n\t\t\tconst scrollPredominantAxis = options.get(EditorOption.scrollPredominantAxis);\n\t\t\tconst newOpts: ScrollableElementChangeOptions = {\n\t\t\t\tvertical: scrollbar.vertical,\n\t\t\t\thorizontal: scrollbar.horizontal,\n\t\t\t\tverticalScrollbarSize: scrollbar.verticalScrollbarSize,\n\t\t\t\thorizontalScrollbarSize: scrollbar.horizontalScrollbarSize,\n\t\t\t\tscrollByPage: scrollbar.scrollByPage,\n\t\t\t\thandleMouseWheel: scrollbar.handleMouseWheel,\n\t\t\t\tmouseWheelScrollSensitivity: mouseWheelScrollSensitivity,\n\t\t\t\tfastScrollSensitivity: fastScrollSensitivity,\n\t\t\t\tscrollPredominantAxis: scrollPredominantAxis\n\t\t\t};\n\t\t\tthis.scrollbar.updateOptions(newOpts);\n\t\t}\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tthis._setLayout();\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\tthis.scrollbar.updateClassName('editor-scrollable' + ' ' + getThemeTypeSelector(this._context.theme.type));\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to do\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tthis.scrollbar.renderNow();\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\n\t// Scrollbars\n\tconst scrollbarShadowColor = theme.getColor(scrollbarShadow);\n\tif (scrollbarShadowColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tbox-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tbox-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\tbox-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset;\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground);\n\tif (scrollbarSliderBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\tbackground: ${scrollbarSliderBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground);\n\tif (scrollbarSliderHoverBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\tbackground: ${scrollbarSliderHoverBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground);\n\tif (scrollbarSliderActiveBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\tbackground: ${scrollbarSliderActiveBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\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 'vs/css!./minimap';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { IDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { ILine, RenderedLinesCollection } from 'vs/editor/browser/view/viewLayer';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { RenderMinimap, EditorOption, MINIMAP_GUTTER_WIDTH, EditorLayoutInfoComputer } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { RGBA8 } from 'vs/editor/common/core/rgba';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { ColorId } from 'vs/editor/common/languages';\nimport { MinimapCharRenderer } from 'vs/editor/browser/viewParts/minimap/minimapCharRenderer';\nimport { Constants } from 'vs/editor/browser/viewParts/minimap/minimapCharSheet';\nimport { MinimapTokensColorTracker } from 'vs/editor/common/viewModel/minimapTokensColorTracker';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport { EditorTheme } from 'vs/editor/common/editorTheme';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewLineData, ViewModelDecoration } from 'vs/editor/common/viewModel';\nimport { minimapSelection, scrollbarShadow, minimapBackground, minimapSliderBackground, minimapSliderHoverBackground, minimapSliderActiveBackground, minimapForegroundOpacity } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { ModelDecorationMinimapOptions } from 'vs/editor/common/model/textModel';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Color } from 'vs/base/common/color';\nimport { GestureEvent, EventType, Gesture } from 'vs/base/browser/touch';\nimport { MinimapCharRendererFactory } from 'vs/editor/browser/viewParts/minimap/minimapCharRendererFactory';\nimport { MinimapPosition, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { once } from 'vs/base/common/functional';\n\n/**\n * The orthogonal distance to the slider at which dragging \"resets\". This implements \"snapping\"\n */\nconst MOUSE_DRAG_RESET_DISTANCE = 140;\n\nconst GUTTER_DECORATION_WIDTH = 2;\n\nclass MinimapOptions {\n\n\tpublic readonly renderMinimap: RenderMinimap;\n\n\tpublic readonly size: 'proportional' | 'fill' | 'fit';\n\n\tpublic readonly minimapHeightIsEditorHeight: boolean;\n\n\tpublic readonly scrollBeyondLastLine: boolean;\n\n\tpublic readonly showSlider: 'always' | 'mouseover';\n\n\tpublic readonly pixelRatio: number;\n\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\n\tpublic readonly lineHeight: number;\n\n\t/**\n\t * container dom node left position (in CSS px)\n\t */\n\tpublic readonly minimapLeft: number;\n\t/**\n\t * container dom node width (in CSS px)\n\t */\n\tpublic readonly minimapWidth: number;\n\t/**\n\t * container dom node height (in CSS px)\n\t */\n\tpublic readonly minimapHeight: number;\n\n\t/**\n\t * canvas backing store width (in device px)\n\t */\n\tpublic readonly canvasInnerWidth: number;\n\t/**\n\t * canvas backing store height (in device px)\n\t */\n\tpublic readonly canvasInnerHeight: number;\n\n\t/**\n\t * canvas width (in CSS px)\n\t */\n\tpublic readonly canvasOuterWidth: number;\n\t/**\n\t * canvas height (in CSS px)\n\t */\n\tpublic readonly canvasOuterHeight: number;\n\n\tpublic readonly isSampling: boolean;\n\tpublic readonly editorHeight: number;\n\tpublic readonly fontScale: number;\n\tpublic readonly minimapLineHeight: number;\n\tpublic readonly minimapCharWidth: number;\n\n\tpublic readonly charRenderer: () => MinimapCharRenderer;\n\tpublic readonly defaultBackgroundColor: RGBA8;\n\tpublic readonly backgroundColor: RGBA8;\n\t/**\n\t * foreground alpha: integer in [0-255]\n\t */\n\tpublic readonly foregroundAlpha: number;\n\n\tconstructor(configuration: IEditorConfiguration, theme: EditorTheme, tokensColorTracker: MinimapTokensColorTracker) {\n\t\tconst options = configuration.options;\n\t\tconst pixelRatio = options.get(EditorOption.pixelRatio);\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst minimapLayout = layoutInfo.minimap;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst minimapOpts = options.get(EditorOption.minimap);\n\n\t\tthis.renderMinimap = minimapLayout.renderMinimap;\n\t\tthis.size = minimapOpts.size;\n\t\tthis.minimapHeightIsEditorHeight = minimapLayout.minimapHeightIsEditorHeight;\n\t\tthis.scrollBeyondLastLine = options.get(EditorOption.scrollBeyondLastLine);\n\t\tthis.showSlider = minimapOpts.showSlider;\n\t\tthis.pixelRatio = pixelRatio;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis.minimapLeft = minimapLayout.minimapLeft;\n\t\tthis.minimapWidth = minimapLayout.minimapWidth;\n\t\tthis.minimapHeight = layoutInfo.height;\n\n\t\tthis.canvasInnerWidth = minimapLayout.minimapCanvasInnerWidth;\n\t\tthis.canvasInnerHeight = minimapLayout.minimapCanvasInnerHeight;\n\t\tthis.canvasOuterWidth = minimapLayout.minimapCanvasOuterWidth;\n\t\tthis.canvasOuterHeight = minimapLayout.minimapCanvasOuterHeight;\n\n\t\tthis.isSampling = minimapLayout.minimapIsSampling;\n\t\tthis.editorHeight = layoutInfo.height;\n\t\tthis.fontScale = minimapLayout.minimapScale;\n\t\tthis.minimapLineHeight = minimapLayout.minimapLineHeight;\n\t\tthis.minimapCharWidth = Constants.BASE_CHAR_WIDTH * this.fontScale;\n\n\t\tthis.charRenderer = once(() => MinimapCharRendererFactory.create(this.fontScale, fontInfo.fontFamily));\n\t\tthis.defaultBackgroundColor = tokensColorTracker.getColor(ColorId.DefaultBackground);\n\t\tthis.backgroundColor = MinimapOptions._getMinimapBackground(theme, this.defaultBackgroundColor);\n\t\tthis.foregroundAlpha = MinimapOptions._getMinimapForegroundOpacity(theme);\n\t}\n\n\tprivate static _getMinimapBackground(theme: EditorTheme, defaultBackgroundColor: RGBA8): RGBA8 {\n\t\tconst themeColor = theme.getColor(minimapBackground);\n\t\tif (themeColor) {\n\t\t\treturn new RGBA8(themeColor.rgba.r, themeColor.rgba.g, themeColor.rgba.b, Math.round(255 * themeColor.rgba.a));\n\t\t}\n\t\treturn defaultBackgroundColor;\n\t}\n\n\tprivate static _getMinimapForegroundOpacity(theme: EditorTheme): number {\n\t\tconst themeColor = theme.getColor(minimapForegroundOpacity);\n\t\tif (themeColor) {\n\t\t\treturn RGBA8._clamp(Math.round(255 * themeColor.rgba.a));\n\t\t}\n\t\treturn 255;\n\t}\n\n\tpublic equals(other: MinimapOptions): boolean {\n\t\treturn (this.renderMinimap === other.renderMinimap\n\t\t\t&& this.size === other.size\n\t\t\t&& this.minimapHeightIsEditorHeight === other.minimapHeightIsEditorHeight\n\t\t\t&& this.scrollBeyondLastLine === other.scrollBeyondLastLine\n\t\t\t&& this.showSlider === other.showSlider\n\t\t\t&& this.pixelRatio === other.pixelRatio\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.minimapLeft === other.minimapLeft\n\t\t\t&& this.minimapWidth === other.minimapWidth\n\t\t\t&& this.minimapHeight === other.minimapHeight\n\t\t\t&& this.canvasInnerWidth === other.canvasInnerWidth\n\t\t\t&& this.canvasInnerHeight === other.canvasInnerHeight\n\t\t\t&& this.canvasOuterWidth === other.canvasOuterWidth\n\t\t\t&& this.canvasOuterHeight === other.canvasOuterHeight\n\t\t\t&& this.isSampling === other.isSampling\n\t\t\t&& this.editorHeight === other.editorHeight\n\t\t\t&& this.fontScale === other.fontScale\n\t\t\t&& this.minimapLineHeight === other.minimapLineHeight\n\t\t\t&& this.minimapCharWidth === other.minimapCharWidth\n\t\t\t&& this.defaultBackgroundColor && this.defaultBackgroundColor.equals(other.defaultBackgroundColor)\n\t\t\t&& this.backgroundColor && this.backgroundColor.equals(other.backgroundColor)\n\t\t\t&& this.foregroundAlpha === other.foregroundAlpha\n\t\t);\n\t}\n}\n\nclass MinimapLayout {\n\n\t/**\n\t * The given editor scrollTop (input).\n\t */\n\tpublic readonly scrollTop: number;\n\n\t/**\n\t* The given editor scrollHeight (input).\n\t*/\n\tpublic readonly scrollHeight: number;\n\n\tpublic readonly sliderNeeded: boolean;\n\tprivate readonly _computedSliderRatio: number;\n\n\t/**\n\t * slider dom node top (in CSS px)\n\t */\n\tpublic readonly sliderTop: number;\n\t/**\n\t * slider dom node height (in CSS px)\n\t */\n\tpublic readonly sliderHeight: number;\n\n\t/**\n\t * minimap render start line number.\n\t */\n\tpublic readonly startLineNumber: number;\n\t/**\n\t * minimap render end line number.\n\t */\n\tpublic readonly endLineNumber: number;\n\n\tconstructor(\n\t\tscrollTop: number,\n\t\tscrollHeight: number,\n\t\tsliderNeeded: boolean,\n\t\tcomputedSliderRatio: number,\n\t\tsliderTop: number,\n\t\tsliderHeight: number,\n\t\tstartLineNumber: number,\n\t\tendLineNumber: number\n\t) {\n\t\tthis.scrollTop = scrollTop;\n\t\tthis.scrollHeight = scrollHeight;\n\t\tthis.sliderNeeded = sliderNeeded;\n\t\tthis._computedSliderRatio = computedSliderRatio;\n\t\tthis.sliderTop = sliderTop;\n\t\tthis.sliderHeight = sliderHeight;\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumber = endLineNumber;\n\t}\n\n\t/**\n\t * Compute a desired `scrollPosition` such that the slider moves by `delta`.\n\t */\n\tpublic getDesiredScrollTopFromDelta(delta: number): number {\n\t\treturn Math.round(this.scrollTop + delta / this._computedSliderRatio);\n\t}\n\n\tpublic getDesiredScrollTopFromTouchLocation(pageY: number): number {\n\t\treturn Math.round((pageY - this.sliderHeight / 2) / this._computedSliderRatio);\n\t}\n\n\tpublic static create(\n\t\toptions: MinimapOptions,\n\t\tviewportStartLineNumber: number,\n\t\tviewportEndLineNumber: number,\n\t\tviewportStartLineNumberVerticalOffset: number,\n\t\tviewportHeight: number,\n\t\tviewportContainsWhitespaceGaps: boolean,\n\t\tlineCount: number,\n\t\trealLineCount: number,\n\t\tscrollTop: number,\n\t\tscrollHeight: number,\n\t\tpreviousLayout: MinimapLayout | null\n\t): MinimapLayout {\n\t\tconst pixelRatio = options.pixelRatio;\n\t\tconst minimapLineHeight = options.minimapLineHeight;\n\t\tconst minimapLinesFitting = Math.floor(options.canvasInnerHeight / minimapLineHeight);\n\t\tconst lineHeight = options.lineHeight;\n\n\t\tif (options.minimapHeightIsEditorHeight) {\n\t\t\tconst logicalScrollHeight = (\n\t\t\t\trealLineCount * options.lineHeight\n\t\t\t\t+ (options.scrollBeyondLastLine ? viewportHeight - options.lineHeight : 0)\n\t\t\t);\n\t\t\tconst sliderHeight = Math.max(1, Math.floor(viewportHeight * viewportHeight / logicalScrollHeight));\n\t\t\tconst maxMinimapSliderTop = Math.max(0, options.minimapHeight - sliderHeight);\n\t\t\t// The slider can move from 0 to `maxMinimapSliderTop`\n\t\t\t// in the same way `scrollTop` can move from 0 to `scrollHeight` - `viewportHeight`.\n\t\t\tconst computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight);\n\t\t\tconst sliderTop = (scrollTop * computedSliderRatio);\n\t\t\tconst sliderNeeded = (maxMinimapSliderTop > 0);\n\t\t\tconst maxLinesFitting = Math.floor(options.canvasInnerHeight / options.minimapLineHeight);\n\t\t\treturn new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, 1, Math.min(lineCount, maxLinesFitting));\n\t\t}\n\n\t\t// The visible line count in a viewport can change due to a number of reasons:\n\t\t// a) with the same viewport width, different scroll positions can result in partial lines being visible:\n\t\t// e.g. for a line height of 20, and a viewport height of 600\n\t\t// * scrollTop = 0 => visible lines are [1, 30]\n\t\t// * scrollTop = 10 => visible lines are [1, 31] (with lines 1 and 31 partially visible)\n\t\t// * scrollTop = 20 => visible lines are [2, 31]\n\t\t// b) whitespace gaps might make their way in the viewport (which results in a decrease in the visible line count)\n\t\t// c) we could be in the scroll beyond last line case (which also results in a decrease in the visible line count, down to possibly only one line being visible)\n\n\t\t// We must first establish a desirable slider height.\n\t\tlet sliderHeight: number;\n\t\tif (viewportContainsWhitespaceGaps && viewportEndLineNumber !== lineCount) {\n\t\t\t// case b) from above: there are whitespace gaps in the viewport.\n\t\t\t// In this case, the height of the slider directly reflects the visible line count.\n\t\t\tconst viewportLineCount = viewportEndLineNumber - viewportStartLineNumber + 1;\n\t\t\tsliderHeight = Math.floor(viewportLineCount * minimapLineHeight / pixelRatio);\n\t\t} else {\n\t\t\t// The slider has a stable height\n\t\t\tconst expectedViewportLineCount = viewportHeight / lineHeight;\n\t\t\tsliderHeight = Math.floor(expectedViewportLineCount * minimapLineHeight / pixelRatio);\n\t\t}\n\n\t\tlet maxMinimapSliderTop: number;\n\t\tif (options.scrollBeyondLastLine) {\n\t\t\t// The minimap slider, when dragged all the way down, will contain the last line at its top\n\t\t\tmaxMinimapSliderTop = (lineCount - 1) * minimapLineHeight / pixelRatio;\n\t\t} else {\n\t\t\t// The minimap slider, when dragged all the way down, will contain the last line at its bottom\n\t\t\tmaxMinimapSliderTop = Math.max(0, lineCount * minimapLineHeight / pixelRatio - sliderHeight);\n\t\t}\n\t\tmaxMinimapSliderTop = Math.min(options.minimapHeight - sliderHeight, maxMinimapSliderTop);\n\n\t\t// The slider can move from 0 to `maxMinimapSliderTop`\n\t\t// in the same way `scrollTop` can move from 0 to `scrollHeight` - `viewportHeight`.\n\t\tconst computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight);\n\t\tconst sliderTop = (scrollTop * computedSliderRatio);\n\n\t\tlet extraLinesAtTheBottom = 0;\n\t\tif (options.scrollBeyondLastLine) {\n\t\t\tconst expectedViewportLineCount = viewportHeight / lineHeight;\n\t\t\textraLinesAtTheBottom = expectedViewportLineCount - 1;\n\t\t}\n\t\tif (minimapLinesFitting >= lineCount + extraLinesAtTheBottom) {\n\t\t\t// All lines fit in the minimap\n\t\t\tconst startLineNumber = 1;\n\t\t\tconst endLineNumber = lineCount;\n\t\t\tconst sliderNeeded = (maxMinimapSliderTop > 0);\n\t\t\treturn new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber);\n\t\t} else {\n\t\t\tlet startLineNumber = Math.max(1, Math.floor(viewportStartLineNumber - sliderTop * pixelRatio / minimapLineHeight));\n\n\t\t\t// Avoid flickering caused by a partial viewport start line\n\t\t\t// by being consistent w.r.t. the previous layout decision\n\t\t\tif (previousLayout && previousLayout.scrollHeight === scrollHeight) {\n\t\t\t\tif (previousLayout.scrollTop > scrollTop) {\n\t\t\t\t\t// Scrolling up => never increase `startLineNumber`\n\t\t\t\t\tstartLineNumber = Math.min(startLineNumber, previousLayout.startLineNumber);\n\t\t\t\t}\n\t\t\t\tif (previousLayout.scrollTop < scrollTop) {\n\t\t\t\t\t// Scrolling down => never decrease `startLineNumber`\n\t\t\t\t\tstartLineNumber = Math.max(startLineNumber, previousLayout.startLineNumber);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst endLineNumber = Math.min(lineCount, startLineNumber + minimapLinesFitting - 1);\n\t\t\tconst partialLine = (scrollTop - viewportStartLineNumberVerticalOffset) / lineHeight;\n\t\t\tconst sliderTopAligned = (viewportStartLineNumber - startLineNumber + partialLine) * minimapLineHeight / pixelRatio;\n\n\t\t\treturn new MinimapLayout(scrollTop, scrollHeight, true, computedSliderRatio, sliderTopAligned, sliderHeight, startLineNumber, endLineNumber);\n\t\t}\n\t}\n}\n\nclass MinimapLine implements ILine {\n\n\tpublic static readonly INVALID = new MinimapLine(-1);\n\n\tdy: number;\n\n\tconstructor(dy: number) {\n\t\tthis.dy = dy;\n\t}\n\n\tpublic onContentChanged(): void {\n\t\tthis.dy = -1;\n\t}\n\n\tpublic onTokensChanged(): void {\n\t\tthis.dy = -1;\n\t}\n}\n\nclass RenderData {\n\t/**\n\t * last rendered layout.\n\t */\n\tpublic readonly renderedLayout: MinimapLayout;\n\tprivate readonly _imageData: ImageData;\n\tprivate readonly _renderedLines: RenderedLinesCollection<MinimapLine>;\n\n\tconstructor(\n\t\trenderedLayout: MinimapLayout,\n\t\timageData: ImageData,\n\t\tlines: MinimapLine[]\n\t) {\n\t\tthis.renderedLayout = renderedLayout;\n\t\tthis._imageData = imageData;\n\t\tthis._renderedLines = new RenderedLinesCollection(\n\t\t\t() => MinimapLine.INVALID\n\t\t);\n\t\tthis._renderedLines._set(renderedLayout.startLineNumber, lines);\n\t}\n\n\t/**\n\t * Check if the current RenderData matches accurately the new desired layout and no painting is needed.\n\t */\n\tpublic linesEquals(layout: MinimapLayout): boolean {\n\t\tif (!this.scrollEquals(layout)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst tmp = this._renderedLines._get();\n\t\tconst lines = tmp.lines;\n\t\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\t\tif (lines[i].dy === -1) {\n\t\t\t\t// This line is invalid\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Check if the current RenderData matches the new layout's scroll position\n\t */\n\tpublic scrollEquals(layout: MinimapLayout): boolean {\n\t\treturn this.renderedLayout.startLineNumber === layout.startLineNumber\n\t\t\t&& this.renderedLayout.endLineNumber === layout.endLineNumber;\n\t}\n\n\t_get(): { imageData: ImageData; rendLineNumberStart: number; lines: MinimapLine[] } {\n\t\tconst tmp = this._renderedLines._get();\n\t\treturn {\n\t\t\timageData: this._imageData,\n\t\t\trendLineNumberStart: tmp.rendLineNumberStart,\n\t\t\tlines: tmp.lines\n\t\t};\n\t}\n\n\tpublic onLinesChanged(changeFromLineNumber: number, changeToLineNumber: number): boolean {\n\t\treturn this._renderedLines.onLinesChanged(changeFromLineNumber, changeToLineNumber);\n\t}\n\tpublic onLinesDeleted(deleteFromLineNumber: number, deleteToLineNumber: number): void {\n\t\tthis._renderedLines.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber);\n\t}\n\tpublic onLinesInserted(insertFromLineNumber: number, insertToLineNumber: number): void {\n\t\tthis._renderedLines.onLinesInserted(insertFromLineNumber, insertToLineNumber);\n\t}\n\tpublic onTokensChanged(ranges: { fromLineNumber: number; toLineNumber: number }[]): boolean {\n\t\treturn this._renderedLines.onTokensChanged(ranges);\n\t}\n}\n\n/**\n * Some sort of double buffering.\n *\n * Keeps two buffers around that will be rotated for painting.\n * Always gives a buffer that is filled with the background color.\n */\nclass MinimapBuffers {\n\n\tprivate readonly _backgroundFillData: Uint8ClampedArray;\n\tprivate readonly _buffers: [ImageData, ImageData];\n\tprivate _lastUsedBuffer: number;\n\n\tconstructor(ctx: CanvasRenderingContext2D, WIDTH: number, HEIGHT: number, background: RGBA8) {\n\t\tthis._backgroundFillData = MinimapBuffers._createBackgroundFillData(WIDTH, HEIGHT, background);\n\t\tthis._buffers = [\n\t\t\tctx.createImageData(WIDTH, HEIGHT),\n\t\t\tctx.createImageData(WIDTH, HEIGHT)\n\t\t];\n\t\tthis._lastUsedBuffer = 0;\n\t}\n\n\tpublic getBuffer(): ImageData {\n\t\t// rotate buffers\n\t\tthis._lastUsedBuffer = 1 - this._lastUsedBuffer;\n\t\tconst result = this._buffers[this._lastUsedBuffer];\n\n\t\t// fill with background color\n\t\tresult.data.set(this._backgroundFillData);\n\n\t\treturn result;\n\t}\n\n\tprivate static _createBackgroundFillData(WIDTH: number, HEIGHT: number, background: RGBA8): Uint8ClampedArray {\n\t\tconst backgroundR = background.r;\n\t\tconst backgroundG = background.g;\n\t\tconst backgroundB = background.b;\n\t\tconst backgroundA = background.a;\n\n\t\tconst result = new Uint8ClampedArray(WIDTH * HEIGHT * 4);\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < HEIGHT; i++) {\n\t\t\tfor (let j = 0; j < WIDTH; j++) {\n\t\t\t\tresult[offset] = backgroundR;\n\t\t\t\tresult[offset + 1] = backgroundG;\n\t\t\t\tresult[offset + 2] = backgroundB;\n\t\t\t\tresult[offset + 3] = backgroundA;\n\t\t\t\toffset += 4;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\nexport interface IMinimapModel {\n\treadonly tokensColorTracker: MinimapTokensColorTracker;\n\treadonly options: MinimapOptions;\n\n\tgetLineCount(): number;\n\tgetRealLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): (ViewLineData | null)[];\n\tgetSelections(): Selection[];\n\tgetMinimapDecorationsInViewport(startLineNumber: number, endLineNumber: number): ViewModelDecoration[];\n\tgetOptions(): TextModelResolvedOptions;\n\trevealLineNumber(lineNumber: number): void;\n\tsetScrollTop(scrollTop: number): void;\n}\n\ninterface IMinimapRenderingContext {\n\treadonly viewportContainsWhitespaceGaps: boolean;\n\n\treadonly scrollWidth: number;\n\treadonly scrollHeight: number;\n\n\treadonly viewportStartLineNumber: number;\n\treadonly viewportEndLineNumber: number;\n\treadonly viewportStartLineNumberVerticalOffset: number;\n\n\treadonly scrollTop: number;\n\treadonly scrollLeft: number;\n\n\treadonly viewportWidth: number;\n\treadonly viewportHeight: number;\n}\n\ninterface SamplingStateLinesDeletedEvent {\n\ttype: 'deleted';\n\t_oldIndex: number;\n\tdeleteFromLineNumber: number;\n\tdeleteToLineNumber: number;\n}\n\ninterface SamplingStateLinesInsertedEvent {\n\ttype: 'inserted';\n\t_i: number;\n\tinsertFromLineNumber: number;\n\tinsertToLineNumber: number;\n}\n\ninterface SamplingStateFlushEvent {\n\ttype: 'flush';\n}\n\ntype SamplingStateEvent = SamplingStateLinesInsertedEvent | SamplingStateLinesDeletedEvent | SamplingStateFlushEvent;\n\nclass MinimapSamplingState {\n\n\tpublic static compute(options: MinimapOptions, viewLineCount: number, oldSamplingState: MinimapSamplingState | null): [MinimapSamplingState | null, SamplingStateEvent[]] {\n\t\tif (options.renderMinimap === RenderMinimap.None || !options.isSampling) {\n\t\t\treturn [null, []];\n\t\t}\n\n\t\t// ratio is intentionally not part of the layout to avoid the layout changing all the time\n\t\t// so we need to recompute it again...\n\t\tconst pixelRatio = options.pixelRatio;\n\t\tconst lineHeight = options.lineHeight;\n\t\tconst scrollBeyondLastLine = options.scrollBeyondLastLine;\n\t\tconst { minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({\n\t\t\tviewLineCount: viewLineCount,\n\t\t\tscrollBeyondLastLine: scrollBeyondLastLine,\n\t\t\theight: options.editorHeight,\n\t\t\tlineHeight: lineHeight,\n\t\t\tpixelRatio: pixelRatio\n\t\t});\n\t\tconst ratio = viewLineCount / minimapLineCount;\n\t\tconst halfRatio = ratio / 2;\n\n\t\tif (!oldSamplingState || oldSamplingState.minimapLines.length === 0) {\n\t\t\tconst result: number[] = [];\n\t\t\tresult[0] = 1;\n\t\t\tif (minimapLineCount > 1) {\n\t\t\t\tfor (let i = 0, lastIndex = minimapLineCount - 1; i < lastIndex; i++) {\n\t\t\t\t\tresult[i] = Math.round(i * ratio + halfRatio);\n\t\t\t\t}\n\t\t\t\tresult[minimapLineCount - 1] = viewLineCount;\n\t\t\t}\n\t\t\treturn [new MinimapSamplingState(ratio, result), []];\n\t\t}\n\n\t\tconst oldMinimapLines = oldSamplingState.minimapLines;\n\t\tconst oldLength = oldMinimapLines.length;\n\t\tconst result: number[] = [];\n\t\tlet oldIndex = 0;\n\t\tlet oldDeltaLineCount = 0;\n\t\tlet minViewLineNumber = 1;\n\t\tconst MAX_EVENT_COUNT = 10; // generate at most 10 events, if there are more than 10 changes, just flush all previous data\n\t\tlet events: SamplingStateEvent[] = [];\n\t\tlet lastEvent: SamplingStateEvent | null = null;\n\t\tfor (let i = 0; i < minimapLineCount; i++) {\n\t\t\tconst fromViewLineNumber = Math.max(minViewLineNumber, Math.round(i * ratio));\n\t\t\tconst toViewLineNumber = Math.max(fromViewLineNumber, Math.round((i + 1) * ratio));\n\n\t\t\twhile (oldIndex < oldLength && oldMinimapLines[oldIndex] < fromViewLineNumber) {\n\t\t\t\tif (events.length < MAX_EVENT_COUNT) {\n\t\t\t\t\tconst oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;\n\t\t\t\t\tif (lastEvent && lastEvent.type === 'deleted' && lastEvent._oldIndex === oldIndex - 1) {\n\t\t\t\t\t\tlastEvent.deleteToLineNumber++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastEvent = { type: 'deleted', _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber };\n\t\t\t\t\t\tevents.push(lastEvent);\n\t\t\t\t\t}\n\t\t\t\t\toldDeltaLineCount--;\n\t\t\t\t}\n\t\t\t\toldIndex++;\n\t\t\t}\n\n\t\t\tlet selectedViewLineNumber: number;\n\t\t\tif (oldIndex < oldLength && oldMinimapLines[oldIndex] <= toViewLineNumber) {\n\t\t\t\t// reuse the old sampled line\n\t\t\t\tselectedViewLineNumber = oldMinimapLines[oldIndex];\n\t\t\t\toldIndex++;\n\t\t\t} else {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tselectedViewLineNumber = 1;\n\t\t\t\t} else if (i + 1 === minimapLineCount) {\n\t\t\t\t\tselectedViewLineNumber = viewLineCount;\n\t\t\t\t} else {\n\t\t\t\t\tselectedViewLineNumber = Math.round(i * ratio + halfRatio);\n\t\t\t\t}\n\t\t\t\tif (events.length < MAX_EVENT_COUNT) {\n\t\t\t\t\tconst oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;\n\t\t\t\t\tif (lastEvent && lastEvent.type === 'inserted' && lastEvent._i === i - 1) {\n\t\t\t\t\t\tlastEvent.insertToLineNumber++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastEvent = { type: 'inserted', _i: i, insertFromLineNumber: oldMinimapLineNumber, insertToLineNumber: oldMinimapLineNumber };\n\t\t\t\t\t\tevents.push(lastEvent);\n\t\t\t\t\t}\n\t\t\t\t\toldDeltaLineCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult[i] = selectedViewLineNumber;\n\t\t\tminViewLineNumber = selectedViewLineNumber;\n\t\t}\n\n\t\tif (events.length < MAX_EVENT_COUNT) {\n\t\t\twhile (oldIndex < oldLength) {\n\t\t\t\tconst oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;\n\t\t\t\tif (lastEvent && lastEvent.type === 'deleted' && lastEvent._oldIndex === oldIndex - 1) {\n\t\t\t\t\tlastEvent.deleteToLineNumber++;\n\t\t\t\t} else {\n\t\t\t\t\tlastEvent = { type: 'deleted', _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber };\n\t\t\t\t\tevents.push(lastEvent);\n\t\t\t\t}\n\t\t\t\toldDeltaLineCount--;\n\t\t\t\toldIndex++;\n\t\t\t}\n\t\t} else {\n\t\t\t// too many events, just give up\n\t\t\tevents = [{ type: 'flush' }];\n\t\t}\n\n\t\treturn [new MinimapSamplingState(ratio, result), events];\n\t}\n\n\tconstructor(\n\t\tpublic readonly samplingRatio: number,\n\t\tpublic readonly minimapLines: number[]\n\t) {\n\t}\n\n\tpublic modelLineToMinimapLine(lineNumber: number): number {\n\t\treturn Math.min(this.minimapLines.length, Math.max(1, Math.round(lineNumber / this.samplingRatio)));\n\t}\n\n\t/**\n\t * Will return null if the model line ranges are not intersecting with a sampled model line.\n\t */\n\tpublic modelLineRangeToMinimapLineRange(fromLineNumber: number, toLineNumber: number): [number, number] | null {\n\t\tlet fromLineIndex = this.modelLineToMinimapLine(fromLineNumber) - 1;\n\t\twhile (fromLineIndex > 0 && this.minimapLines[fromLineIndex - 1] >= fromLineNumber) {\n\t\t\tfromLineIndex--;\n\t\t}\n\t\tlet toLineIndex = this.modelLineToMinimapLine(toLineNumber) - 1;\n\t\twhile (toLineIndex + 1 < this.minimapLines.length && this.minimapLines[toLineIndex + 1] <= toLineNumber) {\n\t\t\ttoLineIndex++;\n\t\t}\n\t\tif (fromLineIndex === toLineIndex) {\n\t\t\tconst sampledLineNumber = this.minimapLines[fromLineIndex];\n\t\t\tif (sampledLineNumber < fromLineNumber || sampledLineNumber > toLineNumber) {\n\t\t\t\t// This line is not part of the sampled lines ==> nothing to do\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn [fromLineIndex + 1, toLineIndex + 1];\n\t}\n\n\t/**\n\t * Will always return a range, even if it is not intersecting with a sampled model line.\n\t */\n\tpublic decorationLineRangeToMinimapLineRange(startLineNumber: number, endLineNumber: number): [number, number] {\n\t\tlet minimapLineStart = this.modelLineToMinimapLine(startLineNumber);\n\t\tlet minimapLineEnd = this.modelLineToMinimapLine(endLineNumber);\n\t\tif (startLineNumber !== endLineNumber && minimapLineEnd === minimapLineStart) {\n\t\t\tif (minimapLineEnd === this.minimapLines.length) {\n\t\t\t\tif (minimapLineStart > 1) {\n\t\t\t\t\tminimapLineStart--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tminimapLineEnd++;\n\t\t\t}\n\t\t}\n\t\treturn [minimapLineStart, minimapLineEnd];\n\t}\n\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): [number, number] {\n\t\t// have the mapping be sticky\n\t\tconst deletedLineCount = e.toLineNumber - e.fromLineNumber + 1;\n\t\tlet changeStartIndex = this.minimapLines.length;\n\t\tlet changeEndIndex = 0;\n\t\tfor (let i = this.minimapLines.length - 1; i >= 0; i--) {\n\t\t\tif (this.minimapLines[i] < e.fromLineNumber) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (this.minimapLines[i] <= e.toLineNumber) {\n\t\t\t\t// this line got deleted => move to previous available\n\t\t\t\tthis.minimapLines[i] = Math.max(1, e.fromLineNumber - 1);\n\t\t\t\tchangeStartIndex = Math.min(changeStartIndex, i);\n\t\t\t\tchangeEndIndex = Math.max(changeEndIndex, i);\n\t\t\t} else {\n\t\t\t\tthis.minimapLines[i] -= deletedLineCount;\n\t\t\t}\n\t\t}\n\t\treturn [changeStartIndex, changeEndIndex];\n\t}\n\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): void {\n\t\t// have the mapping be sticky\n\t\tconst insertedLineCount = e.toLineNumber - e.fromLineNumber + 1;\n\t\tfor (let i = this.minimapLines.length - 1; i >= 0; i--) {\n\t\t\tif (this.minimapLines[i] < e.fromLineNumber) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.minimapLines[i] += insertedLineCount;\n\t\t}\n\t}\n}\n\nexport class Minimap extends ViewPart implements IMinimapModel {\n\n\tpublic readonly tokensColorTracker: MinimapTokensColorTracker;\n\n\tprivate _selections: Selection[];\n\tprivate _minimapSelections: Selection[] | null;\n\n\tpublic options: MinimapOptions;\n\n\tprivate _samplingState: MinimapSamplingState | null;\n\tprivate _shouldCheckSampling: boolean;\n\n\tprivate _actual: InnerMinimap;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tthis.tokensColorTracker = MinimapTokensColorTracker.getInstance();\n\n\t\tthis._selections = [];\n\t\tthis._minimapSelections = null;\n\n\t\tthis.options = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker);\n\t\tconst [samplingState,] = MinimapSamplingState.compute(this.options, this._context.viewModel.getLineCount(), null);\n\t\tthis._samplingState = samplingState;\n\t\tthis._shouldCheckSampling = false;\n\n\t\tthis._actual = new InnerMinimap(context.theme, this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._actual.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._actual.getDomNode();\n\t}\n\n\tprivate _onOptionsMaybeChanged(): boolean {\n\t\tconst opts = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker);\n\t\tif (this.options.equals(opts)) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.options = opts;\n\t\tthis._recreateLineSampling();\n\t\tthis._actual.onDidChangeOptions();\n\t\treturn true;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn this._onOptionsMaybeChanged();\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections;\n\t\tthis._minimapSelections = null;\n\t\treturn this._actual.onSelectionChanged();\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\tif (e.affectsMinimap) {\n\t\t\treturn this._actual.onDecorationsChanged();\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tif (this._samplingState) {\n\t\t\tthis._shouldCheckSampling = true;\n\t\t}\n\t\treturn this._actual.onFlushed();\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tif (this._samplingState) {\n\t\t\tconst minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber, e.toLineNumber);\n\t\t\tif (minimapLineRange) {\n\t\t\t\treturn this._actual.onLinesChanged(minimapLineRange[0], minimapLineRange[1]);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._actual.onLinesChanged(e.fromLineNumber, e.toLineNumber);\n\t\t}\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tif (this._samplingState) {\n\t\t\tconst [changeStartIndex, changeEndIndex] = this._samplingState.onLinesDeleted(e);\n\t\t\tif (changeStartIndex <= changeEndIndex) {\n\t\t\t\tthis._actual.onLinesChanged(changeStartIndex + 1, changeEndIndex + 1);\n\t\t\t}\n\t\t\tthis._shouldCheckSampling = true;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn this._actual.onLinesDeleted(e.fromLineNumber, e.toLineNumber);\n\t\t}\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tif (this._samplingState) {\n\t\t\tthis._samplingState.onLinesInserted(e);\n\t\t\tthis._shouldCheckSampling = true;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn this._actual.onLinesInserted(e.fromLineNumber, e.toLineNumber);\n\t\t}\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn this._actual.onScrollChanged();\n\t}\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\tthis._actual.onThemeChanged();\n\t\tthis._onOptionsMaybeChanged();\n\t\treturn true;\n\t}\n\tpublic override onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\tif (this._samplingState) {\n\t\t\tconst ranges: { fromLineNumber: number; toLineNumber: number }[] = [];\n\t\t\tfor (const range of e.ranges) {\n\t\t\t\tconst minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(range.fromLineNumber, range.toLineNumber);\n\t\t\t\tif (minimapLineRange) {\n\t\t\t\t\tranges.push({ fromLineNumber: minimapLineRange[0], toLineNumber: minimapLineRange[1] });\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ranges.length) {\n\t\t\t\treturn this._actual.onTokensChanged(ranges);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._actual.onTokensChanged(e.ranges);\n\t\t}\n\t}\n\tpublic override onTokensColorsChanged(e: viewEvents.ViewTokensColorsChangedEvent): boolean {\n\t\tthis._onOptionsMaybeChanged();\n\t\treturn this._actual.onTokensColorsChanged();\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn this._actual.onZonesChanged();\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (this._shouldCheckSampling) {\n\t\t\tthis._shouldCheckSampling = false;\n\t\t\tthis._recreateLineSampling();\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tlet viewportStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tlet viewportEndLineNumber = ctx.visibleRange.endLineNumber;\n\n\t\tif (this._samplingState) {\n\t\t\tviewportStartLineNumber = this._samplingState.modelLineToMinimapLine(viewportStartLineNumber);\n\t\t\tviewportEndLineNumber = this._samplingState.modelLineToMinimapLine(viewportEndLineNumber);\n\t\t}\n\n\t\tconst minimapCtx: IMinimapRenderingContext = {\n\t\t\tviewportContainsWhitespaceGaps: (ctx.viewportData.whitespaceViewportData.length > 0),\n\n\t\t\tscrollWidth: ctx.scrollWidth,\n\t\t\tscrollHeight: ctx.scrollHeight,\n\n\t\t\tviewportStartLineNumber: viewportStartLineNumber,\n\t\t\tviewportEndLineNumber: viewportEndLineNumber,\n\t\t\tviewportStartLineNumberVerticalOffset: ctx.getVerticalOffsetForLineNumber(viewportStartLineNumber),\n\n\t\t\tscrollTop: ctx.scrollTop,\n\t\t\tscrollLeft: ctx.scrollLeft,\n\n\t\t\tviewportWidth: ctx.viewportWidth,\n\t\t\tviewportHeight: ctx.viewportHeight,\n\t\t};\n\t\tthis._actual.render(minimapCtx);\n\t}\n\n\t//#region IMinimapModel\n\n\tprivate _recreateLineSampling(): void {\n\t\tthis._minimapSelections = null;\n\n\t\tconst wasSampling = Boolean(this._samplingState);\n\t\tconst [samplingState, events] = MinimapSamplingState.compute(this.options, this._context.viewModel.getLineCount(), this._samplingState);\n\t\tthis._samplingState = samplingState;\n\n\t\tif (wasSampling && this._samplingState) {\n\t\t\t// was sampling, is sampling\n\t\t\tfor (const event of events) {\n\t\t\t\tswitch (event.type) {\n\t\t\t\t\tcase 'deleted':\n\t\t\t\t\t\tthis._actual.onLinesDeleted(event.deleteFromLineNumber, event.deleteToLineNumber);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'inserted':\n\t\t\t\t\t\tthis._actual.onLinesInserted(event.insertFromLineNumber, event.insertToLineNumber);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'flush':\n\t\t\t\t\t\tthis._actual.onFlushed();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getLineCount(): number {\n\t\tif (this._samplingState) {\n\t\t\treturn this._samplingState.minimapLines.length;\n\t\t}\n\t\treturn this._context.viewModel.getLineCount();\n\t}\n\n\tpublic getRealLineCount(): number {\n\t\treturn this._context.viewModel.getLineCount();\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\tif (this._samplingState) {\n\t\t\treturn this._context.viewModel.getLineContent(this._samplingState.minimapLines[lineNumber - 1]);\n\t\t}\n\t\treturn this._context.viewModel.getLineContent(lineNumber);\n\t}\n\n\tpublic getLineMaxColumn(lineNumber: number): number {\n\t\tif (this._samplingState) {\n\t\t\treturn this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[lineNumber - 1]);\n\t\t}\n\t\treturn this._context.viewModel.getLineMaxColumn(lineNumber);\n\t}\n\n\tpublic getMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): (ViewLineData | null)[] {\n\t\tif (this._samplingState) {\n\t\t\tconst result: (ViewLineData | null)[] = [];\n\t\t\tfor (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) {\n\t\t\t\tif (needed[lineIndex]) {\n\t\t\t\t\tresult[lineIndex] = this._context.viewModel.getViewLineData(this._samplingState.minimapLines[startLineNumber + lineIndex - 1]);\n\t\t\t\t} else {\n\t\t\t\t\tresult[lineIndex] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\treturn this._context.viewModel.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed).data;\n\t}\n\n\tpublic getSelections(): Selection[] {\n\t\tif (this._minimapSelections === null) {\n\t\t\tif (this._samplingState) {\n\t\t\t\tthis._minimapSelections = [];\n\t\t\t\tfor (const selection of this._selections) {\n\t\t\t\t\tconst [minimapLineStart, minimapLineEnd] = this._samplingState.decorationLineRangeToMinimapLineRange(selection.startLineNumber, selection.endLineNumber);\n\t\t\t\t\tthis._minimapSelections.push(new Selection(minimapLineStart, selection.startColumn, minimapLineEnd, selection.endColumn));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._minimapSelections = this._selections;\n\t\t\t}\n\t\t}\n\t\treturn this._minimapSelections;\n\t}\n\n\tpublic getMinimapDecorationsInViewport(startLineNumber: number, endLineNumber: number): ViewModelDecoration[] {\n\t\tlet visibleRange: Range;\n\t\tif (this._samplingState) {\n\t\t\tconst modelStartLineNumber = this._samplingState.minimapLines[startLineNumber - 1];\n\t\t\tconst modelEndLineNumber = this._samplingState.minimapLines[endLineNumber - 1];\n\t\t\tvisibleRange = new Range(modelStartLineNumber, 1, modelEndLineNumber, this._context.viewModel.getLineMaxColumn(modelEndLineNumber));\n\t\t} else {\n\t\t\tvisibleRange = new Range(startLineNumber, 1, endLineNumber, this._context.viewModel.getLineMaxColumn(endLineNumber));\n\t\t}\n\t\tconst decorations = this._context.viewModel.getDecorationsInViewport(visibleRange);\n\n\t\tif (this._samplingState) {\n\t\t\tconst result: ViewModelDecoration[] = [];\n\t\t\tfor (const decoration of decorations) {\n\t\t\t\tif (!decoration.options.minimap) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst range = decoration.range;\n\t\t\t\tconst minimapStartLineNumber = this._samplingState.modelLineToMinimapLine(range.startLineNumber);\n\t\t\t\tconst minimapEndLineNumber = this._samplingState.modelLineToMinimapLine(range.endLineNumber);\n\t\t\t\tresult.push(new ViewModelDecoration(new Range(minimapStartLineNumber, range.startColumn, minimapEndLineNumber, range.endColumn), decoration.options));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\treturn decorations;\n\t}\n\n\tpublic getOptions(): TextModelResolvedOptions {\n\t\treturn this._context.viewModel.model.getOptions();\n\t}\n\n\tpublic revealLineNumber(lineNumber: number): void {\n\t\tif (this._samplingState) {\n\t\t\tlineNumber = this._samplingState.minimapLines[lineNumber - 1];\n\t\t}\n\t\tthis._context.viewModel.revealRange(\n\t\t\t'mouse',\n\t\t\tfalse,\n\t\t\tnew Range(lineNumber, 1, lineNumber, 1),\n\t\t\tviewEvents.VerticalRevealType.Center,\n\t\t\tScrollType.Smooth\n\t\t);\n\t}\n\n\tpublic setScrollTop(scrollTop: number): void {\n\t\tthis._context.viewModel.viewLayout.setScrollPosition({\n\t\t\tscrollTop: scrollTop\n\t\t}, ScrollType.Immediate);\n\t}\n\n\t//#endregion\n}\n\nclass InnerMinimap extends Disposable {\n\n\tprivate readonly _theme: EditorTheme;\n\tprivate readonly _model: IMinimapModel;\n\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _shadow: FastDomNode<HTMLElement>;\n\tprivate readonly _canvas: FastDomNode<HTMLCanvasElement>;\n\tprivate readonly _decorationsCanvas: FastDomNode<HTMLCanvasElement>;\n\tprivate readonly _slider: FastDomNode<HTMLElement>;\n\tprivate readonly _sliderHorizontal: FastDomNode<HTMLElement>;\n\tprivate readonly _mouseDownListener: IDisposable;\n\tprivate readonly _sliderMouseMoveMonitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData>;\n\tprivate readonly _sliderMouseDownListener: IDisposable;\n\tprivate readonly _gestureDisposable: IDisposable;\n\tprivate readonly _sliderTouchStartListener: IDisposable;\n\tprivate readonly _sliderTouchMoveListener: IDisposable;\n\tprivate readonly _sliderTouchEndListener: IDisposable;\n\n\tprivate _lastRenderData: RenderData | null;\n\tprivate _selectionColor: Color | undefined;\n\tprivate _renderDecorations: boolean = false;\n\tprivate _gestureInProgress: boolean = false;\n\tprivate _buffers: MinimapBuffers | null;\n\n\tconstructor(\n\t\ttheme: EditorTheme,\n\t\tmodel: IMinimapModel\n\t) {\n\t\tsuper();\n\n\t\tthis._theme = theme;\n\t\tthis._model = model;\n\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\n\t\tthis._selectionColor = this._theme.getColor(minimapSelection);\n\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this._domNode, PartFingerprint.Minimap);\n\t\tthis._domNode.setClassName(this._getMinimapDomNodeClassName());\n\t\tthis._domNode.setPosition('absolute');\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._shadow = createFastDomNode(document.createElement('div'));\n\t\tthis._shadow.setClassName('minimap-shadow-hidden');\n\t\tthis._domNode.appendChild(this._shadow);\n\n\t\tthis._canvas = createFastDomNode(document.createElement('canvas'));\n\t\tthis._canvas.setPosition('absolute');\n\t\tthis._canvas.setLeft(0);\n\t\tthis._domNode.appendChild(this._canvas);\n\n\t\tthis._decorationsCanvas = createFastDomNode(document.createElement('canvas'));\n\t\tthis._decorationsCanvas.setPosition('absolute');\n\t\tthis._decorationsCanvas.setClassName('minimap-decorations-layer');\n\t\tthis._decorationsCanvas.setLeft(0);\n\t\tthis._domNode.appendChild(this._decorationsCanvas);\n\n\t\tthis._slider = createFastDomNode(document.createElement('div'));\n\t\tthis._slider.setPosition('absolute');\n\t\tthis._slider.setClassName('minimap-slider');\n\t\tthis._slider.setLayerHinting(true);\n\t\tthis._slider.setContain('strict');\n\t\tthis._domNode.appendChild(this._slider);\n\n\t\tthis._sliderHorizontal = createFastDomNode(document.createElement('div'));\n\t\tthis._sliderHorizontal.setPosition('absolute');\n\t\tthis._sliderHorizontal.setClassName('minimap-slider-horizontal');\n\t\tthis._slider.appendChild(this._sliderHorizontal);\n\n\t\tthis._applyLayout();\n\n\t\tthis._mouseDownListener = dom.addStandardDisposableListener(this._domNode.domNode, 'mousedown', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst renderMinimap = this._model.options.renderMinimap;\n\t\t\tif (renderMinimap === RenderMinimap.None) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._lastRenderData) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._model.options.size !== 'proportional') {\n\t\t\t\tif (e.leftButton && this._lastRenderData) {\n\t\t\t\t\t// pretend the click occurred in the center of the slider\n\t\t\t\t\tconst position = dom.getDomNodePagePosition(this._slider.domNode);\n\t\t\t\t\tconst initialPosY = position.top + position.height / 2;\n\t\t\t\t\tthis._startSliderDragging(e.buttons, e.posx, initialPosY, e.posy, this._lastRenderData.renderedLayout);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst minimapLineHeight = this._model.options.minimapLineHeight;\n\t\t\tconst internalOffsetY = (this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight) * e.browserEvent.offsetY;\n\t\t\tconst lineIndex = Math.floor(internalOffsetY / minimapLineHeight);\n\n\t\t\tlet lineNumber = lineIndex + this._lastRenderData.renderedLayout.startLineNumber;\n\t\t\tlineNumber = Math.min(lineNumber, this._model.getLineCount());\n\n\t\t\tthis._model.revealLineNumber(lineNumber);\n\t\t});\n\n\t\tthis._sliderMouseMoveMonitor = new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>();\n\n\t\tthis._sliderMouseDownListener = dom.addStandardDisposableListener(this._slider.domNode, 'mousedown', (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (e.leftButton && this._lastRenderData) {\n\t\t\t\tthis._startSliderDragging(e.buttons, e.posx, e.posy, e.posy, this._lastRenderData.renderedLayout);\n\t\t\t}\n\t\t});\n\n\t\tthis._gestureDisposable = Gesture.addTarget(this._domNode.domNode);\n\t\tthis._sliderTouchStartListener = dom.addDisposableListener(this._domNode.domNode, EventType.Start, (e: GestureEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (this._lastRenderData) {\n\t\t\t\tthis._slider.toggleClassName('active', true);\n\t\t\t\tthis._gestureInProgress = true;\n\t\t\t\tthis.scrollDueToTouchEvent(e);\n\t\t\t}\n\t\t}, { passive: false });\n\n\t\tthis._sliderTouchMoveListener = dom.addDisposableListener(this._domNode.domNode, EventType.Change, (e: GestureEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (this._lastRenderData && this._gestureInProgress) {\n\t\t\t\tthis.scrollDueToTouchEvent(e);\n\t\t\t}\n\t\t}, { passive: false });\n\n\t\tthis._sliderTouchEndListener = dom.addStandardDisposableListener(this._domNode.domNode, EventType.End, (e: GestureEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._gestureInProgress = false;\n\t\t\tthis._slider.toggleClassName('active', false);\n\t\t});\n\t}\n\n\tprivate _startSliderDragging(initialButtons: number, initialPosX: number, initialPosY: number, posy: number, initialSliderState: MinimapLayout): void {\n\t\tthis._slider.toggleClassName('active', true);\n\n\t\tconst handleMouseMove = (posy: number, posx: number) => {\n\t\t\tconst mouseOrthogonalDelta = Math.abs(posx - initialPosX);\n\n\t\t\tif (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) {\n\t\t\t\t// The mouse has wondered away from the scrollbar => reset dragging\n\t\t\t\tthis._model.setScrollTop(initialSliderState.scrollTop);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseDelta = posy - initialPosY;\n\t\t\tthis._model.setScrollTop(initialSliderState.getDesiredScrollTopFromDelta(mouseDelta));\n\t\t};\n\n\t\tif (posy !== initialPosY) {\n\t\t\thandleMouseMove(posy, initialPosX);\n\t\t}\n\n\t\tthis._sliderMouseMoveMonitor.startMonitoring(\n\t\t\tthis._slider.domNode,\n\t\t\tinitialButtons,\n\t\t\tstandardMouseMoveMerger,\n\t\t\t(mouseMoveData: IStandardMouseMoveEventData) => handleMouseMove(mouseMoveData.posy, mouseMoveData.posx),\n\t\t\t() => {\n\t\t\t\tthis._slider.toggleClassName('active', false);\n\t\t\t}\n\t\t);\n\t}\n\n\tprivate scrollDueToTouchEvent(touch: GestureEvent) {\n\t\tconst startY = this._domNode.domNode.getBoundingClientRect().top;\n\t\tconst scrollTop = this._lastRenderData!.renderedLayout.getDesiredScrollTopFromTouchLocation(touch.pageY - startY);\n\t\tthis._model.setScrollTop(scrollTop);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._mouseDownListener.dispose();\n\t\tthis._sliderMouseMoveMonitor.dispose();\n\t\tthis._sliderMouseDownListener.dispose();\n\t\tthis._gestureDisposable.dispose();\n\t\tthis._sliderTouchStartListener.dispose();\n\t\tthis._sliderTouchMoveListener.dispose();\n\t\tthis._sliderTouchEndListener.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tprivate _getMinimapDomNodeClassName(): string {\n\t\tif (this._model.options.showSlider === 'always') {\n\t\t\treturn 'minimap slider-always';\n\t\t}\n\t\treturn 'minimap slider-mouseover';\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\tprivate _applyLayout(): void {\n\t\tthis._domNode.setLeft(this._model.options.minimapLeft);\n\t\tthis._domNode.setWidth(this._model.options.minimapWidth);\n\t\tthis._domNode.setHeight(this._model.options.minimapHeight);\n\t\tthis._shadow.setHeight(this._model.options.minimapHeight);\n\n\t\tthis._canvas.setWidth(this._model.options.canvasOuterWidth);\n\t\tthis._canvas.setHeight(this._model.options.canvasOuterHeight);\n\t\tthis._canvas.domNode.width = this._model.options.canvasInnerWidth;\n\t\tthis._canvas.domNode.height = this._model.options.canvasInnerHeight;\n\n\t\tthis._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth);\n\t\tthis._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight);\n\t\tthis._decorationsCanvas.domNode.width = this._model.options.canvasInnerWidth;\n\t\tthis._decorationsCanvas.domNode.height = this._model.options.canvasInnerHeight;\n\n\t\tthis._slider.setWidth(this._model.options.minimapWidth);\n\t}\n\n\tprivate _getBuffer(): ImageData | null {\n\t\tif (!this._buffers) {\n\t\t\tif (this._model.options.canvasInnerWidth > 0 && this._model.options.canvasInnerHeight > 0) {\n\t\t\t\tthis._buffers = new MinimapBuffers(\n\t\t\t\t\tthis._canvas.domNode.getContext('2d')!,\n\t\t\t\t\tthis._model.options.canvasInnerWidth,\n\t\t\t\t\tthis._model.options.canvasInnerHeight,\n\t\t\t\t\tthis._model.options.backgroundColor\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this._buffers ? this._buffers.getBuffer() : null;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onDidChangeOptions(): void {\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\n\t\tthis._applyLayout();\n\t\tthis._domNode.setClassName(this._getMinimapDomNodeClassName());\n\t}\n\tpublic onSelectionChanged(): boolean {\n\t\tthis._renderDecorations = true;\n\t\treturn true;\n\t}\n\tpublic onDecorationsChanged(): boolean {\n\t\tthis._renderDecorations = true;\n\t\treturn true;\n\t}\n\tpublic onFlushed(): boolean {\n\t\tthis._lastRenderData = null;\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(changeFromLineNumber: number, changeToLineNumber: number): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\treturn this._lastRenderData.onLinesChanged(changeFromLineNumber, changeToLineNumber);\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onLinesDeleted(deleteFromLineNumber: number, deleteToLineNumber: number): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\tthis._lastRenderData.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(insertFromLineNumber: number, insertToLineNumber: number): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\tthis._lastRenderData.onLinesInserted(insertFromLineNumber, insertToLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(): boolean {\n\t\tthis._renderDecorations = true;\n\t\treturn true;\n\t}\n\tpublic onThemeChanged(): boolean {\n\t\tthis._selectionColor = this._theme.getColor(minimapSelection);\n\t\tthis._renderDecorations = true;\n\t\treturn true;\n\t}\n\tpublic onTokensChanged(ranges: { fromLineNumber: number; toLineNumber: number }[]): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\treturn this._lastRenderData.onTokensChanged(ranges);\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onTokensColorsChanged(): boolean {\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\n\t\treturn true;\n\t}\n\tpublic onZonesChanged(): boolean {\n\t\tthis._lastRenderData = null;\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tpublic render(renderingCtx: IMinimapRenderingContext): void {\n\t\tconst renderMinimap = this._model.options.renderMinimap;\n\t\tif (renderMinimap === RenderMinimap.None) {\n\t\t\tthis._shadow.setClassName('minimap-shadow-hidden');\n\t\t\tthis._sliderHorizontal.setWidth(0);\n\t\t\tthis._sliderHorizontal.setHeight(0);\n\t\t\treturn;\n\t\t}\n\t\tif (renderingCtx.scrollLeft + renderingCtx.viewportWidth >= renderingCtx.scrollWidth) {\n\t\t\tthis._shadow.setClassName('minimap-shadow-hidden');\n\t\t} else {\n\t\t\tthis._shadow.setClassName('minimap-shadow-visible');\n\t\t}\n\n\t\tconst layout = MinimapLayout.create(\n\t\t\tthis._model.options,\n\t\t\trenderingCtx.viewportStartLineNumber,\n\t\t\trenderingCtx.viewportEndLineNumber,\n\t\t\trenderingCtx.viewportStartLineNumberVerticalOffset,\n\t\t\trenderingCtx.viewportHeight,\n\t\t\trenderingCtx.viewportContainsWhitespaceGaps,\n\t\t\tthis._model.getLineCount(),\n\t\t\tthis._model.getRealLineCount(),\n\t\t\trenderingCtx.scrollTop,\n\t\t\trenderingCtx.scrollHeight,\n\t\t\tthis._lastRenderData ? this._lastRenderData.renderedLayout : null\n\t\t);\n\t\tthis._slider.setDisplay(layout.sliderNeeded ? 'block' : 'none');\n\t\tthis._slider.setTop(layout.sliderTop);\n\t\tthis._slider.setHeight(layout.sliderHeight);\n\n\t\t// Compute horizontal slider coordinates\n\t\tthis._sliderHorizontal.setLeft(0);\n\t\tthis._sliderHorizontal.setWidth(this._model.options.minimapWidth);\n\t\tthis._sliderHorizontal.setTop(0);\n\t\tthis._sliderHorizontal.setHeight(layout.sliderHeight);\n\n\t\tthis.renderDecorations(layout);\n\t\tthis._lastRenderData = this.renderLines(layout);\n\t}\n\n\tprivate renderDecorations(layout: MinimapLayout) {\n\t\tif (this._renderDecorations) {\n\t\t\tthis._renderDecorations = false;\n\t\t\tconst selections = this._model.getSelections();\n\t\t\tselections.sort(Range.compareRangesUsingStarts);\n\n\t\t\tconst decorations = this._model.getMinimapDecorationsInViewport(layout.startLineNumber, layout.endLineNumber);\n\t\t\tdecorations.sort((a, b) => (a.options.zIndex || 0) - (b.options.zIndex || 0));\n\n\t\t\tconst { canvasInnerWidth, canvasInnerHeight } = this._model.options;\n\t\t\tconst lineHeight = this._model.options.minimapLineHeight;\n\t\t\tconst characterWidth = this._model.options.minimapCharWidth;\n\t\t\tconst tabSize = this._model.getOptions().tabSize;\n\t\t\tconst canvasContext = this._decorationsCanvas.domNode.getContext('2d')!;\n\n\t\t\tcanvasContext.clearRect(0, 0, canvasInnerWidth, canvasInnerHeight);\n\n\t\t\t// We first need to render line highlights and then render decorations on top of those.\n\t\t\t// But we need to pick a single color for each line, and use that as a line highlight.\n\t\t\t// This needs to be the color of the decoration with the highest `zIndex`, but priority\n\t\t\t// is given to the selection.\n\n\t\t\tconst highlightedLines = new ContiguousLineMap<boolean>(layout.startLineNumber, layout.endLineNumber, false);\n\t\t\tthis._renderSelectionLineHighlights(canvasContext, selections, highlightedLines, layout, lineHeight);\n\t\t\tthis._renderDecorationsLineHighlights(canvasContext, decorations, highlightedLines, layout, lineHeight);\n\n\t\t\tconst lineOffsetMap = new ContiguousLineMap<number[] | null>(layout.startLineNumber, layout.endLineNumber, null);\n\t\t\tthis._renderSelectionsHighlights(canvasContext, selections, lineOffsetMap, layout, lineHeight, tabSize, characterWidth, canvasInnerWidth);\n\t\t\tthis._renderDecorationsHighlights(canvasContext, decorations, lineOffsetMap, layout, lineHeight, tabSize, characterWidth, canvasInnerWidth);\n\t\t}\n\t}\n\n\tprivate _renderSelectionLineHighlights(\n\t\tcanvasContext: CanvasRenderingContext2D,\n\t\tselections: Selection[],\n\t\thighlightedLines: ContiguousLineMap<boolean>,\n\t\tlayout: MinimapLayout,\n\t\tlineHeight: number\n\t): void {\n\t\tif (!this._selectionColor || this._selectionColor.isTransparent()) {\n\t\t\treturn;\n\t\t}\n\n\t\tcanvasContext.fillStyle = this._selectionColor.transparent(0.5).toString();\n\n\t\tlet y1 = 0;\n\t\tlet y2 = 0;\n\n\t\tfor (const selection of selections) {\n\t\t\tconst startLineNumber = Math.max(layout.startLineNumber, selection.startLineNumber);\n\t\t\tconst endLineNumber = Math.min(layout.endLineNumber, selection.endLineNumber);\n\t\t\tif (startLineNumber > endLineNumber) {\n\t\t\t\t// entirely outside minimap's viewport\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let line = startLineNumber; line <= endLineNumber; line++) {\n\t\t\t\thighlightedLines.set(line, true);\n\t\t\t}\n\n\t\t\tconst yy1 = (startLineNumber - layout.startLineNumber) * lineHeight;\n\t\t\tconst yy2 = (endLineNumber - layout.startLineNumber) * lineHeight + lineHeight;\n\n\t\t\tif (y2 >= yy1) {\n\t\t\t\t// merge into previous\n\t\t\t\ty2 = yy2;\n\t\t\t} else {\n\t\t\t\tif (y2 > y1) {\n\t\t\t\t\t// flush\n\t\t\t\t\tcanvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);\n\t\t\t\t}\n\t\t\t\ty1 = yy1;\n\t\t\t\ty2 = yy2;\n\t\t\t}\n\t\t}\n\n\t\tif (y2 > y1) {\n\t\t\t// flush\n\t\t\tcanvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);\n\t\t}\n\t}\n\n\tprivate _renderDecorationsLineHighlights(\n\t\tcanvasContext: CanvasRenderingContext2D,\n\t\tdecorations: ViewModelDecoration[],\n\t\thighlightedLines: ContiguousLineMap<boolean>,\n\t\tlayout: MinimapLayout,\n\t\tlineHeight: number\n\t): void {\n\n\t\tconst highlightColors = new Map<string, string>();\n\n\t\t// Loop backwards to hit first decorations with higher `zIndex`\n\t\tfor (let i = decorations.length - 1; i >= 0; i--) {\n\t\t\tconst decoration = decorations[i];\n\n\t\t\tconst minimapOptions = <ModelDecorationMinimapOptions | null | undefined>decoration.options.minimap;\n\t\t\tif (!minimapOptions || minimapOptions.position !== MinimapPosition.Inline) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst startLineNumber = Math.max(layout.startLineNumber, decoration.range.startLineNumber);\n\t\t\tconst endLineNumber = Math.min(layout.endLineNumber, decoration.range.endLineNumber);\n\t\t\tif (startLineNumber > endLineNumber) {\n\t\t\t\t// entirely outside minimap's viewport\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst decorationColor = minimapOptions.getColor(this._theme.value);\n\t\t\tif (!decorationColor || decorationColor.isTransparent()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet highlightColor = highlightColors.get(decorationColor.toString());\n\t\t\tif (!highlightColor) {\n\t\t\t\thighlightColor = decorationColor.transparent(0.5).toString();\n\t\t\t\thighlightColors.set(decorationColor.toString(), highlightColor);\n\t\t\t}\n\n\t\t\tcanvasContext.fillStyle = highlightColor;\n\t\t\tfor (let line = startLineNumber; line <= endLineNumber; line++) {\n\t\t\t\tif (highlightedLines.has(line)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thighlightedLines.set(line, true);\n\t\t\t\tconst y = (startLineNumber - layout.startLineNumber) * lineHeight;\n\t\t\t\tcanvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y, canvasContext.canvas.width, lineHeight);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _renderSelectionsHighlights(\n\t\tcanvasContext: CanvasRenderingContext2D,\n\t\tselections: Selection[],\n\t\tlineOffsetMap: ContiguousLineMap<number[] | null>,\n\t\tlayout: MinimapLayout,\n\t\tlineHeight: number,\n\t\ttabSize: number,\n\t\tcharacterWidth: number,\n\t\tcanvasInnerWidth: number\n\t): void {\n\t\tif (!this._selectionColor || this._selectionColor.isTransparent()) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const selection of selections) {\n\t\t\tconst startLineNumber = Math.max(layout.startLineNumber, selection.startLineNumber);\n\t\t\tconst endLineNumber = Math.min(layout.endLineNumber, selection.endLineNumber);\n\t\t\tif (startLineNumber > endLineNumber) {\n\t\t\t\t// entirely outside minimap's viewport\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let line = startLineNumber; line <= endLineNumber; line++) {\n\t\t\t\tthis.renderDecorationOnLine(canvasContext, lineOffsetMap, selection, this._selectionColor, layout, line, lineHeight, lineHeight, tabSize, characterWidth, canvasInnerWidth);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _renderDecorationsHighlights(\n\t\tcanvasContext: CanvasRenderingContext2D,\n\t\tdecorations: ViewModelDecoration[],\n\t\tlineOffsetMap: ContiguousLineMap<number[] | null>,\n\t\tlayout: MinimapLayout,\n\t\tlineHeight: number,\n\t\ttabSize: number,\n\t\tcharacterWidth: number,\n\t\tcanvasInnerWidth: number\n\t): void {\n\t\t// Loop forwards to hit first decorations with lower `zIndex`\n\t\tfor (const decoration of decorations) {\n\n\t\t\tconst minimapOptions = <ModelDecorationMinimapOptions | null | undefined>decoration.options.minimap;\n\t\t\tif (!minimapOptions) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst startLineNumber = Math.max(layout.startLineNumber, decoration.range.startLineNumber);\n\t\t\tconst endLineNumber = Math.min(layout.endLineNumber, decoration.range.endLineNumber);\n\t\t\tif (startLineNumber > endLineNumber) {\n\t\t\t\t// entirely outside minimap's viewport\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst decorationColor = minimapOptions.getColor(this._theme.value);\n\t\t\tif (!decorationColor || decorationColor.isTransparent()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let line = startLineNumber; line <= endLineNumber; line++) {\n\t\t\t\tswitch (minimapOptions.position) {\n\n\t\t\t\t\tcase MinimapPosition.Inline:\n\t\t\t\t\t\tthis.renderDecorationOnLine(canvasContext, lineOffsetMap, decoration.range, decorationColor, layout, line, lineHeight, lineHeight, tabSize, characterWidth, canvasInnerWidth);\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase MinimapPosition.Gutter: {\n\t\t\t\t\t\tconst y = (line - layout.startLineNumber) * lineHeight;\n\t\t\t\t\t\tconst x = 2;\n\t\t\t\t\t\tthis.renderDecoration(canvasContext, decorationColor, x, y, GUTTER_DECORATION_WIDTH, lineHeight);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate renderDecorationOnLine(\n\t\tcanvasContext: CanvasRenderingContext2D,\n\t\tlineOffsetMap: ContiguousLineMap<number[] | null>,\n\t\tdecorationRange: Range,\n\t\tdecorationColor: Color | undefined,\n\t\tlayout: MinimapLayout,\n\t\tlineNumber: number,\n\t\theight: number,\n\t\tlineHeight: number,\n\t\ttabSize: number,\n\t\tcharWidth: number,\n\t\tcanvasInnerWidth: number\n\t): void {\n\t\tconst y = (lineNumber - layout.startLineNumber) * lineHeight;\n\n\t\t// Skip rendering the line if it's vertically outside our viewport\n\t\tif (y + height < 0 || y > this._model.options.canvasInnerHeight) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { startLineNumber, endLineNumber } = decorationRange;\n\t\tconst startColumn = (startLineNumber === lineNumber ? decorationRange.startColumn : 1);\n\t\tconst endColumn = (endLineNumber === lineNumber ? decorationRange.endColumn : this._model.getLineMaxColumn(lineNumber));\n\n\t\tconst x1 = this.getXOffsetForPosition(lineOffsetMap, lineNumber, startColumn, tabSize, charWidth, canvasInnerWidth);\n\t\tconst x2 = this.getXOffsetForPosition(lineOffsetMap, lineNumber, endColumn, tabSize, charWidth, canvasInnerWidth);\n\n\t\tthis.renderDecoration(canvasContext, decorationColor, x1, y, x2 - x1, height);\n\t}\n\n\tprivate getXOffsetForPosition(\n\t\tlineOffsetMap: ContiguousLineMap<number[] | null>,\n\t\tlineNumber: number,\n\t\tcolumn: number,\n\t\ttabSize: number,\n\t\tcharWidth: number,\n\t\tcanvasInnerWidth: number\n\t): number {\n\t\tif (column === 1) {\n\t\t\treturn MINIMAP_GUTTER_WIDTH;\n\t\t}\n\n\t\tconst minimumXOffset = (column - 1) * charWidth;\n\t\tif (minimumXOffset >= canvasInnerWidth) {\n\t\t\t// there is no need to look at actual characters,\n\t\t\t// as this column is certainly after the minimap width\n\t\t\treturn canvasInnerWidth;\n\t\t}\n\n\t\t// Cache line offset data so that it is only read once per line\n\t\tlet lineIndexToXOffset = lineOffsetMap.get(lineNumber);\n\t\tif (!lineIndexToXOffset) {\n\t\t\tconst lineData = this._model.getLineContent(lineNumber);\n\t\t\tlineIndexToXOffset = [MINIMAP_GUTTER_WIDTH];\n\t\t\tlet prevx = MINIMAP_GUTTER_WIDTH;\n\t\t\tfor (let i = 1; i < lineData.length + 1; i++) {\n\t\t\t\tconst charCode = lineData.charCodeAt(i - 1);\n\t\t\t\tconst dx = charCode === CharCode.Tab\n\t\t\t\t\t? tabSize * charWidth\n\t\t\t\t\t: strings.isFullWidthCharacter(charCode)\n\t\t\t\t\t\t? 2 * charWidth\n\t\t\t\t\t\t: charWidth;\n\n\t\t\t\tconst x = prevx + dx;\n\t\t\t\tif (x >= canvasInnerWidth) {\n\t\t\t\t\t// no need to keep on going, as we've hit the canvas width\n\t\t\t\t\tlineIndexToXOffset[i] = canvasInnerWidth;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlineIndexToXOffset[i] = x;\n\t\t\t\tprevx = x;\n\t\t\t}\n\n\t\t\tlineOffsetMap.set(lineNumber, lineIndexToXOffset);\n\t\t}\n\n\t\tif (column - 1 < lineIndexToXOffset.length) {\n\t\t\treturn lineIndexToXOffset[column - 1];\n\t\t}\n\t\t// goes over the canvas width\n\t\treturn canvasInnerWidth;\n\t}\n\n\tprivate renderDecoration(canvasContext: CanvasRenderingContext2D, decorationColor: Color | undefined, x: number, y: number, width: number, height: number) {\n\t\tcanvasContext.fillStyle = decorationColor && decorationColor.toString() || '';\n\t\tcanvasContext.fillRect(x, y, width, height);\n\t}\n\n\tprivate renderLines(layout: MinimapLayout): RenderData | null {\n\t\tconst startLineNumber = layout.startLineNumber;\n\t\tconst endLineNumber = layout.endLineNumber;\n\t\tconst minimapLineHeight = this._model.options.minimapLineHeight;\n\n\t\t// Check if nothing changed w.r.t. lines from last frame\n\t\tif (this._lastRenderData && this._lastRenderData.linesEquals(layout)) {\n\t\t\tconst _lastData = this._lastRenderData._get();\n\t\t\t// Nice!! Nothing changed from last frame\n\t\t\treturn new RenderData(layout, _lastData.imageData, _lastData.lines);\n\t\t}\n\n\t\t// Oh well!! We need to repaint some lines...\n\n\t\tconst imageData = this._getBuffer();\n\t\tif (!imageData) {\n\t\t\t// 0 width or 0 height canvas, nothing to do\n\t\t\treturn null;\n\t\t}\n\n\t\t// Render untouched lines by using last rendered data.\n\t\tconst [_dirtyY1, _dirtyY2, needed] = InnerMinimap._renderUntouchedLines(\n\t\t\timageData,\n\t\t\tstartLineNumber,\n\t\t\tendLineNumber,\n\t\t\tminimapLineHeight,\n\t\t\tthis._lastRenderData\n\t\t);\n\n\t\t// Fetch rendering info from view model for rest of lines that need rendering.\n\t\tconst lineInfo = this._model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed);\n\t\tconst tabSize = this._model.getOptions().tabSize;\n\t\tconst defaultBackground = this._model.options.defaultBackgroundColor;\n\t\tconst background = this._model.options.backgroundColor;\n\t\tconst foregroundAlpha = this._model.options.foregroundAlpha;\n\t\tconst tokensColorTracker = this._model.tokensColorTracker;\n\t\tconst useLighterFont = tokensColorTracker.backgroundIsLight();\n\t\tconst renderMinimap = this._model.options.renderMinimap;\n\t\tconst charRenderer = this._model.options.charRenderer();\n\t\tconst fontScale = this._model.options.fontScale;\n\t\tconst minimapCharWidth = this._model.options.minimapCharWidth;\n\n\t\tconst baseCharHeight = (renderMinimap === RenderMinimap.Text ? Constants.BASE_CHAR_HEIGHT : Constants.BASE_CHAR_HEIGHT + 1);\n\t\tconst renderMinimapLineHeight = baseCharHeight * fontScale;\n\t\tconst innerLinePadding = (minimapLineHeight > renderMinimapLineHeight ? Math.floor((minimapLineHeight - renderMinimapLineHeight) / 2) : 0);\n\n\t\t// Render the rest of lines\n\t\tconst backgroundA = background.a / 255;\n\t\tconst renderBackground = new RGBA8(\n\t\t\tMath.round((background.r - defaultBackground.r) * backgroundA + defaultBackground.r),\n\t\t\tMath.round((background.g - defaultBackground.g) * backgroundA + defaultBackground.g),\n\t\t\tMath.round((background.b - defaultBackground.b) * backgroundA + defaultBackground.b),\n\t\t\t255\n\t\t);\n\t\tlet dy = 0;\n\t\tconst renderedLines: MinimapLine[] = [];\n\t\tfor (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) {\n\t\t\tif (needed[lineIndex]) {\n\t\t\t\tInnerMinimap._renderLine(\n\t\t\t\t\timageData,\n\t\t\t\t\trenderBackground,\n\t\t\t\t\tbackground.a,\n\t\t\t\t\tuseLighterFont,\n\t\t\t\t\trenderMinimap,\n\t\t\t\t\tminimapCharWidth,\n\t\t\t\t\ttokensColorTracker,\n\t\t\t\t\tforegroundAlpha,\n\t\t\t\t\tcharRenderer,\n\t\t\t\t\tdy,\n\t\t\t\t\tinnerLinePadding,\n\t\t\t\t\ttabSize,\n\t\t\t\t\tlineInfo[lineIndex]!,\n\t\t\t\t\tfontScale,\n\t\t\t\t\tminimapLineHeight\n\t\t\t\t);\n\t\t\t}\n\t\t\trenderedLines[lineIndex] = new MinimapLine(dy);\n\t\t\tdy += minimapLineHeight;\n\t\t}\n\n\t\tconst dirtyY1 = (_dirtyY1 === -1 ? 0 : _dirtyY1);\n\t\tconst dirtyY2 = (_dirtyY2 === -1 ? imageData.height : _dirtyY2);\n\t\tconst dirtyHeight = dirtyY2 - dirtyY1;\n\n\t\t// Finally, paint to the canvas\n\t\tconst ctx = this._canvas.domNode.getContext('2d')!;\n\t\tctx.putImageData(imageData, 0, 0, 0, dirtyY1, imageData.width, dirtyHeight);\n\n\t\t// Save rendered data for reuse on next frame if possible\n\t\treturn new RenderData(\n\t\t\tlayout,\n\t\t\timageData,\n\t\t\trenderedLines\n\t\t);\n\t}\n\n\tprivate static _renderUntouchedLines(\n\t\ttarget: ImageData,\n\t\tstartLineNumber: number,\n\t\tendLineNumber: number,\n\t\tminimapLineHeight: number,\n\t\tlastRenderData: RenderData | null,\n\t): [number, number, boolean[]] {\n\n\t\tconst needed: boolean[] = [];\n\t\tif (!lastRenderData) {\n\t\t\tfor (let i = 0, len = endLineNumber - startLineNumber + 1; i < len; i++) {\n\t\t\t\tneeded[i] = true;\n\t\t\t}\n\t\t\treturn [-1, -1, needed];\n\t\t}\n\n\t\tconst _lastData = lastRenderData._get();\n\t\tconst lastTargetData = _lastData.imageData.data;\n\t\tconst lastStartLineNumber = _lastData.rendLineNumberStart;\n\t\tconst lastLines = _lastData.lines;\n\t\tconst lastLinesLength = lastLines.length;\n\t\tconst WIDTH = target.width;\n\t\tconst targetData = target.data;\n\n\t\tconst maxDestPixel = (endLineNumber - startLineNumber + 1) * minimapLineHeight * WIDTH * 4;\n\t\tlet dirtyPixel1 = -1; // the pixel offset up to which all the data is equal to the prev frame\n\t\tlet dirtyPixel2 = -1; // the pixel offset after which all the data is equal to the prev frame\n\n\t\tlet copySourceStart = -1;\n\t\tlet copySourceEnd = -1;\n\t\tlet copyDestStart = -1;\n\t\tlet copyDestEnd = -1;\n\n\t\tlet dest_dy = 0;\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\t\tconst lastLineIndex = lineNumber - lastStartLineNumber;\n\t\t\tconst source_dy = (lastLineIndex >= 0 && lastLineIndex < lastLinesLength ? lastLines[lastLineIndex].dy : -1);\n\n\t\t\tif (source_dy === -1) {\n\t\t\t\tneeded[lineIndex] = true;\n\t\t\t\tdest_dy += minimapLineHeight;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst sourceStart = source_dy * WIDTH * 4;\n\t\t\tconst sourceEnd = (source_dy + minimapLineHeight) * WIDTH * 4;\n\t\t\tconst destStart = dest_dy * WIDTH * 4;\n\t\t\tconst destEnd = (dest_dy + minimapLineHeight) * WIDTH * 4;\n\n\t\t\tif (copySourceEnd === sourceStart && copyDestEnd === destStart) {\n\t\t\t\t// contiguous zone => extend copy request\n\t\t\t\tcopySourceEnd = sourceEnd;\n\t\t\t\tcopyDestEnd = destEnd;\n\t\t\t} else {\n\t\t\t\tif (copySourceStart !== -1) {\n\t\t\t\t\t// flush existing copy request\n\t\t\t\t\ttargetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart);\n\t\t\t\t\tif (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) {\n\t\t\t\t\t\tdirtyPixel1 = copySourceEnd;\n\t\t\t\t\t}\n\t\t\t\t\tif (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) {\n\t\t\t\t\t\tdirtyPixel2 = copySourceStart;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcopySourceStart = sourceStart;\n\t\t\t\tcopySourceEnd = sourceEnd;\n\t\t\t\tcopyDestStart = destStart;\n\t\t\t\tcopyDestEnd = destEnd;\n\t\t\t}\n\n\t\t\tneeded[lineIndex] = false;\n\t\t\tdest_dy += minimapLineHeight;\n\t\t}\n\n\t\tif (copySourceStart !== -1) {\n\t\t\t// flush existing copy request\n\t\t\ttargetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart);\n\t\t\tif (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) {\n\t\t\t\tdirtyPixel1 = copySourceEnd;\n\t\t\t}\n\t\t\tif (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) {\n\t\t\t\tdirtyPixel2 = copySourceStart;\n\t\t\t}\n\t\t}\n\n\t\tconst dirtyY1 = (dirtyPixel1 === -1 ? -1 : dirtyPixel1 / (WIDTH * 4));\n\t\tconst dirtyY2 = (dirtyPixel2 === -1 ? -1 : dirtyPixel2 / (WIDTH * 4));\n\n\t\treturn [dirtyY1, dirtyY2, needed];\n\t}\n\n\tprivate static _renderLine(\n\t\ttarget: ImageData,\n\t\tbackgroundColor: RGBA8,\n\t\tbackgroundAlpha: number,\n\t\tuseLighterFont: boolean,\n\t\trenderMinimap: RenderMinimap,\n\t\tcharWidth: number,\n\t\tcolorTracker: MinimapTokensColorTracker,\n\t\tforegroundAlpha: number,\n\t\tminimapCharRenderer: MinimapCharRenderer,\n\t\tdy: number,\n\t\tinnerLinePadding: number,\n\t\ttabSize: number,\n\t\tlineData: ViewLineData,\n\t\tfontScale: number,\n\t\tminimapLineHeight: number\n\t): void {\n\t\tconst content = lineData.content;\n\t\tconst tokens = lineData.tokens;\n\t\tconst maxDx = target.width - charWidth;\n\t\tconst force1pxHeight = (minimapLineHeight === 1);\n\n\t\tlet dx = MINIMAP_GUTTER_WIDTH;\n\t\tlet charIndex = 0;\n\t\tlet tabsCharDelta = 0;\n\n\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\tconst tokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\tconst tokenColorId = tokens.getForeground(tokenIndex);\n\t\t\tconst tokenColor = colorTracker.getColor(tokenColorId);\n\n\t\t\tfor (; charIndex < tokenEndIndex; charIndex++) {\n\t\t\t\tif (dx > maxDx) {\n\t\t\t\t\t// hit edge of minimap\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst charCode = content.charCodeAt(charIndex);\n\n\t\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\t\tconst insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\n\t\t\t\t\ttabsCharDelta += insertSpacesCount - 1;\n\t\t\t\t\t// No need to render anything since tab is invisible\n\t\t\t\t\tdx += insertSpacesCount * charWidth;\n\t\t\t\t} else if (charCode === CharCode.Space) {\n\t\t\t\t\t// No need to render anything since space is invisible\n\t\t\t\t\tdx += charWidth;\n\t\t\t\t} else {\n\t\t\t\t\t// Render twice for a full width character\n\t\t\t\t\tconst count = strings.isFullWidthCharacter(charCode) ? 2 : 1;\n\n\t\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\t\tif (renderMinimap === RenderMinimap.Blocks) {\n\t\t\t\t\t\t\tminimapCharRenderer.blockRenderChar(target, dx, dy + innerLinePadding, tokenColor, foregroundAlpha, backgroundColor, backgroundAlpha, force1pxHeight);\n\t\t\t\t\t\t} else { // RenderMinimap.Text\n\t\t\t\t\t\t\tminimapCharRenderer.renderChar(target, dx, dy + innerLinePadding, charCode, tokenColor, foregroundAlpha, backgroundColor, backgroundAlpha, fontScale, useLighterFont, force1pxHeight);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdx += charWidth;\n\n\t\t\t\t\t\tif (dx > maxDx) {\n\t\t\t\t\t\t\t// hit edge of minimap\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass ContiguousLineMap<T> {\n\n\tprivate readonly _startLineNumber: number;\n\tprivate readonly _endLineNumber: number;\n\tprivate readonly _defaultValue: T;\n\tprivate readonly _values: T[];\n\n\tconstructor(startLineNumber: number, endLineNumber: number, defaultValue: T) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._endLineNumber = endLineNumber;\n\t\tthis._defaultValue = defaultValue;\n\t\tthis._values = [];\n\t\tfor (let i = 0, count = this._endLineNumber - this._startLineNumber + 1; i < count; i++) {\n\t\t\tthis._values[i] = defaultValue;\n\t\t}\n\t}\n\n\tpublic has(lineNumber: number): boolean {\n\t\treturn (this.get(lineNumber) !== this._defaultValue);\n\t}\n\n\tpublic set(lineNumber: number, value: T): void {\n\t\tif (lineNumber < this._startLineNumber || lineNumber > this._endLineNumber) {\n\t\t\treturn;\n\t\t}\n\t\tthis._values[lineNumber - this._startLineNumber] = value;\n\t}\n\n\tpublic get(lineNumber: number): T {\n\t\tif (lineNumber < this._startLineNumber || lineNumber > this._endLineNumber) {\n\t\t\treturn this._defaultValue;\n\t\t}\n\t\treturn this._values[lineNumber - this._startLineNumber];\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst sliderBackground = theme.getColor(minimapSliderBackground);\n\tif (sliderBackground) {\n\t\tcollector.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${sliderBackground}; }`);\n\t}\n\tconst sliderHoverBackground = theme.getColor(minimapSliderHoverBackground);\n\tif (sliderHoverBackground) {\n\t\tcollector.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${sliderHoverBackground}; }`);\n\t}\n\tconst sliderActiveBackground = theme.getColor(minimapSliderActiveBackground);\n\tif (sliderActiveBackground) {\n\t\tcollector.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${sliderActiveBackground}; }`);\n\t}\n\tconst shadow = theme.getColor(scrollbarShadow);\n\tif (shadow) {\n\t\tcollector.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${shadow} -6px 0 6px -6px inset; }`);\n\t}\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 'vs/css!./scrollDecoration';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\n\nexport class ScrollDecorationViewPart extends ViewPart {\n\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\tprivate _scrollTop: number;\n\tprivate _width: number;\n\tprivate _shouldShow: boolean;\n\tprivate _useShadows: boolean;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tthis._scrollTop = 0;\n\t\tthis._width = 0;\n\t\tthis._updateWidth();\n\t\tthis._shouldShow = false;\n\t\tconst options = this._context.configuration.options;\n\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\tthis._useShadows = scrollbar.useShadows;\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _updateShouldShow(): boolean {\n\t\tconst newShouldShow = (this._useShadows && this._scrollTop > 0);\n\t\tif (this._shouldShow !== newShouldShow) {\n\t\t\tthis._shouldShow = newShouldShow;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\tprivate _updateWidth(): void {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tif (layoutInfo.minimap.renderMinimap === 0 || (layoutInfo.minimap.minimapWidth > 0 && layoutInfo.minimap.minimapLeft === 0)) {\n\t\t\tthis._width = layoutInfo.width;\n\t\t} else {\n\t\t\tthis._width = layoutInfo.width - layoutInfo.minimap.minimapWidth - layoutInfo.verticalScrollbarWidth;\n\t\t}\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst scrollbar = options.get(EditorOption.scrollbar);\n\t\tthis._useShadows = scrollbar.useShadows;\n\t\tthis._updateWidth();\n\t\tthis._updateShouldShow();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tthis._scrollTop = e.scrollTop;\n\t\treturn this._updateShouldShow();\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tthis._domNode.setWidth(this._width);\n\t\tthis._domNode.setClassName(this._shouldShow ? 'scroll-decoration' : '');\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst shadow = theme.getColor(scrollbarShadow);\n\tif (shadow) {\n\t\tcollector.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${shadow} 0 6px 6px -6px inset; }`);\n\t}\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 'vs/css!./selections';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { Range } from 'vs/editor/common/core/range';\nimport { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { editorInactiveSelection, editorSelectionBackground, editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nconst enum CornerStyle {\n\tEXTERN,\n\tINTERN,\n\tFLAT\n}\n\ninterface IVisibleRangeEndPointStyle {\n\ttop: CornerStyle;\n\tbottom: CornerStyle;\n}\n\nclass HorizontalRangeWithStyle {\n\tpublic left: number;\n\tpublic width: number;\n\tpublic startStyle: IVisibleRangeEndPointStyle | null;\n\tpublic endStyle: IVisibleRangeEndPointStyle | null;\n\n\tconstructor(other: HorizontalRange) {\n\t\tthis.left = other.left;\n\t\tthis.width = other.width;\n\t\tthis.startStyle = null;\n\t\tthis.endStyle = null;\n\t}\n}\n\nclass LineVisibleRangesWithStyle {\n\tpublic lineNumber: number;\n\tpublic ranges: HorizontalRangeWithStyle[];\n\n\tconstructor(lineNumber: number, ranges: HorizontalRangeWithStyle[]) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.ranges = ranges;\n\t}\n}\n\nfunction toStyledRange(item: HorizontalRange): HorizontalRangeWithStyle {\n\treturn new HorizontalRangeWithStyle(item);\n}\n\nfunction toStyled(item: LineVisibleRanges): LineVisibleRangesWithStyle {\n\treturn new LineVisibleRangesWithStyle(item.lineNumber, item.ranges.map(toStyledRange));\n}\n\nexport class SelectionsOverlay extends DynamicViewOverlay {\n\n\tprivate static readonly SELECTION_CLASS_NAME = 'selected-text';\n\tprivate static readonly SELECTION_TOP_LEFT = 'top-left-radius';\n\tprivate static readonly SELECTION_BOTTOM_LEFT = 'bottom-left-radius';\n\tprivate static readonly SELECTION_TOP_RIGHT = 'top-right-radius';\n\tprivate static readonly SELECTION_BOTTOM_RIGHT = 'bottom-right-radius';\n\tprivate static readonly EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background';\n\n\tprivate static readonly ROUNDED_PIECE_WIDTH = 10;\n\n\tprivate readonly _context: ViewContext;\n\tprivate _lineHeight: number;\n\tprivate _roundedSelection: boolean;\n\tprivate _typicalHalfwidthCharacterWidth: number;\n\tprivate _selections: Range[];\n\tprivate _renderResult: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._roundedSelection = options.get(EditorOption.roundedSelection);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\tthis._selections = [];\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._roundedSelection = options.get(EditorOption.roundedSelection);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\treturn true;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections.slice(0);\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;//e.inlineDecorationsChanged;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tprivate _visibleRangesHaveGaps(linesVisibleRanges: LineVisibleRangesWithStyle[]): boolean {\n\n\t\tfor (let i = 0, len = linesVisibleRanges.length; i < len; i++) {\n\t\t\tconst lineVisibleRanges = linesVisibleRanges[i];\n\n\t\t\tif (lineVisibleRanges.ranges.length > 1) {\n\t\t\t\t// There are two ranges on the same line\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate _enrichVisibleRangesWithStyle(viewport: Range, linesVisibleRanges: LineVisibleRangesWithStyle[], previousFrame: LineVisibleRangesWithStyle[] | null): void {\n\t\tconst epsilon = this._typicalHalfwidthCharacterWidth / 4;\n\t\tlet previousFrameTop: HorizontalRangeWithStyle | null = null;\n\t\tlet previousFrameBottom: HorizontalRangeWithStyle | null = null;\n\n\t\tif (previousFrame && previousFrame.length > 0 && linesVisibleRanges.length > 0) {\n\n\t\t\tconst topLineNumber = linesVisibleRanges[0].lineNumber;\n\t\t\tif (topLineNumber === viewport.startLineNumber) {\n\t\t\t\tfor (let i = 0; !previousFrameTop && i < previousFrame.length; i++) {\n\t\t\t\t\tif (previousFrame[i].lineNumber === topLineNumber) {\n\t\t\t\t\t\tpreviousFrameTop = previousFrame[i].ranges[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bottomLineNumber = linesVisibleRanges[linesVisibleRanges.length - 1].lineNumber;\n\t\t\tif (bottomLineNumber === viewport.endLineNumber) {\n\t\t\t\tfor (let i = previousFrame.length - 1; !previousFrameBottom && i >= 0; i--) {\n\t\t\t\t\tif (previousFrame[i].lineNumber === bottomLineNumber) {\n\t\t\t\t\t\tpreviousFrameBottom = previousFrame[i].ranges[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (previousFrameTop && !previousFrameTop.startStyle) {\n\t\t\t\tpreviousFrameTop = null;\n\t\t\t}\n\t\t\tif (previousFrameBottom && !previousFrameBottom.startStyle) {\n\t\t\t\tpreviousFrameBottom = null;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0, len = linesVisibleRanges.length; i < len; i++) {\n\t\t\t// We know for a fact that there is precisely one range on each line\n\t\t\tconst curLineRange = linesVisibleRanges[i].ranges[0];\n\t\t\tconst curLeft = curLineRange.left;\n\t\t\tconst curRight = curLineRange.left + curLineRange.width;\n\n\t\t\tconst startStyle = {\n\t\t\t\ttop: CornerStyle.EXTERN,\n\t\t\t\tbottom: CornerStyle.EXTERN\n\t\t\t};\n\n\t\t\tconst endStyle = {\n\t\t\t\ttop: CornerStyle.EXTERN,\n\t\t\t\tbottom: CornerStyle.EXTERN\n\t\t\t};\n\n\t\t\tif (i > 0) {\n\t\t\t\t// Look above\n\t\t\t\tconst prevLeft = linesVisibleRanges[i - 1].ranges[0].left;\n\t\t\t\tconst prevRight = linesVisibleRanges[i - 1].ranges[0].left + linesVisibleRanges[i - 1].ranges[0].width;\n\n\t\t\t\tif (abs(curLeft - prevLeft) < epsilon) {\n\t\t\t\t\tstartStyle.top = CornerStyle.FLAT;\n\t\t\t\t} else if (curLeft > prevLeft) {\n\t\t\t\t\tstartStyle.top = CornerStyle.INTERN;\n\t\t\t\t}\n\n\t\t\t\tif (abs(curRight - prevRight) < epsilon) {\n\t\t\t\t\tendStyle.top = CornerStyle.FLAT;\n\t\t\t\t} else if (prevLeft < curRight && curRight < prevRight) {\n\t\t\t\t\tendStyle.top = CornerStyle.INTERN;\n\t\t\t\t}\n\t\t\t} else if (previousFrameTop) {\n\t\t\t\t// Accept some hiccups near the viewport edges to save on repaints\n\t\t\t\tstartStyle.top = previousFrameTop.startStyle!.top;\n\t\t\t\tendStyle.top = previousFrameTop.endStyle!.top;\n\t\t\t}\n\n\t\t\tif (i + 1 < len) {\n\t\t\t\t// Look below\n\t\t\t\tconst nextLeft = linesVisibleRanges[i + 1].ranges[0].left;\n\t\t\t\tconst nextRight = linesVisibleRanges[i + 1].ranges[0].left + linesVisibleRanges[i + 1].ranges[0].width;\n\n\t\t\t\tif (abs(curLeft - nextLeft) < epsilon) {\n\t\t\t\t\tstartStyle.bottom = CornerStyle.FLAT;\n\t\t\t\t} else if (nextLeft < curLeft && curLeft < nextRight) {\n\t\t\t\t\tstartStyle.bottom = CornerStyle.INTERN;\n\t\t\t\t}\n\n\t\t\t\tif (abs(curRight - nextRight) < epsilon) {\n\t\t\t\t\tendStyle.bottom = CornerStyle.FLAT;\n\t\t\t\t} else if (curRight < nextRight) {\n\t\t\t\t\tendStyle.bottom = CornerStyle.INTERN;\n\t\t\t\t}\n\t\t\t} else if (previousFrameBottom) {\n\t\t\t\t// Accept some hiccups near the viewport edges to save on repaints\n\t\t\t\tstartStyle.bottom = previousFrameBottom.startStyle!.bottom;\n\t\t\t\tendStyle.bottom = previousFrameBottom.endStyle!.bottom;\n\t\t\t}\n\n\t\t\tcurLineRange.startStyle = startStyle;\n\t\t\tcurLineRange.endStyle = endStyle;\n\t\t}\n\t}\n\n\tprivate _getVisibleRangesWithStyle(selection: Range, ctx: RenderingContext, previousFrame: LineVisibleRangesWithStyle[] | null): LineVisibleRangesWithStyle[] {\n\t\tconst _linesVisibleRanges = ctx.linesVisibleRangesForRange(selection, true) || [];\n\t\tconst linesVisibleRanges = _linesVisibleRanges.map(toStyled);\n\t\tconst visibleRangesHaveGaps = this._visibleRangesHaveGaps(linesVisibleRanges);\n\n\t\tif (!visibleRangesHaveGaps && this._roundedSelection) {\n\t\t\tthis._enrichVisibleRangesWithStyle(ctx.visibleRange, linesVisibleRanges, previousFrame);\n\t\t}\n\n\t\t// The visible ranges are sorted TOP-BOTTOM and LEFT-RIGHT\n\t\treturn linesVisibleRanges;\n\t}\n\n\tprivate _createSelectionPiece(top: number, height: string, className: string, left: number, width: number): string {\n\t\treturn (\n\t\t\t'<div class=\"cslr '\n\t\t\t+ className\n\t\t\t+ '\" style=\"top:'\n\t\t\t+ top.toString()\n\t\t\t+ 'px;left:'\n\t\t\t+ left.toString()\n\t\t\t+ 'px;width:'\n\t\t\t+ width.toString()\n\t\t\t+ 'px;height:'\n\t\t\t+ height\n\t\t\t+ 'px;\"></div>'\n\t\t);\n\t}\n\n\tprivate _actualRenderOneSelection(output2: [string, string][], visibleStartLineNumber: number, hasMultipleSelections: boolean, visibleRanges: LineVisibleRangesWithStyle[]): void {\n\t\tif (visibleRanges.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst visibleRangesHaveStyle = !!visibleRanges[0].ranges[0].startStyle;\n\t\tconst fullLineHeight = (this._lineHeight).toString();\n\t\tconst reducedLineHeight = (this._lineHeight - 1).toString();\n\n\t\tconst firstLineNumber = visibleRanges[0].lineNumber;\n\t\tconst lastLineNumber = visibleRanges[visibleRanges.length - 1].lineNumber;\n\n\t\tfor (let i = 0, len = visibleRanges.length; i < len; i++) {\n\t\t\tconst lineVisibleRanges = visibleRanges[i];\n\t\t\tconst lineNumber = lineVisibleRanges.lineNumber;\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\n\t\t\tconst lineHeight = hasMultipleSelections ? (lineNumber === lastLineNumber || lineNumber === firstLineNumber ? reducedLineHeight : fullLineHeight) : fullLineHeight;\n\t\t\tconst top = hasMultipleSelections ? (lineNumber === firstLineNumber ? 1 : 0) : 0;\n\n\t\t\tlet innerCornerOutput = '';\n\t\t\tlet restOfSelectionOutput = '';\n\n\t\t\tfor (let j = 0, lenJ = lineVisibleRanges.ranges.length; j < lenJ; j++) {\n\t\t\t\tconst visibleRange = lineVisibleRanges.ranges[j];\n\n\t\t\t\tif (visibleRangesHaveStyle) {\n\t\t\t\t\tconst startStyle = visibleRange.startStyle!;\n\t\t\t\t\tconst endStyle = visibleRange.endStyle!;\n\t\t\t\t\tif (startStyle.top === CornerStyle.INTERN || startStyle.bottom === CornerStyle.INTERN) {\n\t\t\t\t\t\t// Reverse rounded corner to the left\n\n\t\t\t\t\t\t// First comes the selection (blue layer)\n\t\t\t\t\t\tinnerCornerOutput += this._createSelectionPiece(top, lineHeight, SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left - SelectionsOverlay.ROUNDED_PIECE_WIDTH, SelectionsOverlay.ROUNDED_PIECE_WIDTH);\n\n\t\t\t\t\t\t// Second comes the background (white layer) with inverse border radius\n\t\t\t\t\t\tlet className = SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;\n\t\t\t\t\t\tif (startStyle.top === CornerStyle.INTERN) {\n\t\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_TOP_RIGHT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (startStyle.bottom === CornerStyle.INTERN) {\n\t\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_BOTTOM_RIGHT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinnerCornerOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left - SelectionsOverlay.ROUNDED_PIECE_WIDTH, SelectionsOverlay.ROUNDED_PIECE_WIDTH);\n\t\t\t\t\t}\n\t\t\t\t\tif (endStyle.top === CornerStyle.INTERN || endStyle.bottom === CornerStyle.INTERN) {\n\t\t\t\t\t\t// Reverse rounded corner to the right\n\n\t\t\t\t\t\t// First comes the selection (blue layer)\n\t\t\t\t\t\tinnerCornerOutput += this._createSelectionPiece(top, lineHeight, SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left + visibleRange.width, SelectionsOverlay.ROUNDED_PIECE_WIDTH);\n\n\t\t\t\t\t\t// Second comes the background (white layer) with inverse border radius\n\t\t\t\t\t\tlet className = SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;\n\t\t\t\t\t\tif (endStyle.top === CornerStyle.INTERN) {\n\t\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_TOP_LEFT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endStyle.bottom === CornerStyle.INTERN) {\n\t\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_BOTTOM_LEFT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinnerCornerOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left + visibleRange.width, SelectionsOverlay.ROUNDED_PIECE_WIDTH);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet className = SelectionsOverlay.SELECTION_CLASS_NAME;\n\t\t\t\tif (visibleRangesHaveStyle) {\n\t\t\t\t\tconst startStyle = visibleRange.startStyle!;\n\t\t\t\t\tconst endStyle = visibleRange.endStyle!;\n\t\t\t\t\tif (startStyle.top === CornerStyle.EXTERN) {\n\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_TOP_LEFT;\n\t\t\t\t\t}\n\t\t\t\t\tif (startStyle.bottom === CornerStyle.EXTERN) {\n\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_BOTTOM_LEFT;\n\t\t\t\t\t}\n\t\t\t\t\tif (endStyle.top === CornerStyle.EXTERN) {\n\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_TOP_RIGHT;\n\t\t\t\t\t}\n\t\t\t\t\tif (endStyle.bottom === CornerStyle.EXTERN) {\n\t\t\t\t\t\tclassName += ' ' + SelectionsOverlay.SELECTION_BOTTOM_RIGHT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trestOfSelectionOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left, visibleRange.width);\n\t\t\t}\n\n\t\t\toutput2[lineIndex][0] += innerCornerOutput;\n\t\t\toutput2[lineIndex][1] += restOfSelectionOutput;\n\t\t}\n\t}\n\n\tprivate _previousFrameVisibleRangesWithStyle: (LineVisibleRangesWithStyle[] | null)[] = [];\n\tpublic prepareRender(ctx: RenderingContext): void {\n\n\t\t// Build HTML for inner corners separate from HTML for the rest of selections,\n\t\t// as the inner corner HTML can interfere with that of other selections.\n\t\t// In final render, make sure to place the inner corner HTML before the rest of selection HTML. See issue #77777.\n\t\tconst output: [string, string][] = [];\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\toutput[lineIndex] = ['', ''];\n\t\t}\n\n\t\tconst thisFrameVisibleRangesWithStyle: (LineVisibleRangesWithStyle[] | null)[] = [];\n\t\tfor (let i = 0, len = this._selections.length; i < len; i++) {\n\t\t\tconst selection = this._selections[i];\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tthisFrameVisibleRangesWithStyle[i] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst visibleRangesWithStyle = this._getVisibleRangesWithStyle(selection, ctx, this._previousFrameVisibleRangesWithStyle[i]);\n\t\t\tthisFrameVisibleRangesWithStyle[i] = visibleRangesWithStyle;\n\t\t\tthis._actualRenderOneSelection(output, visibleStartLineNumber, this._selections.length > 1, visibleRangesWithStyle);\n\t\t}\n\n\t\tthis._previousFrameVisibleRangesWithStyle = thisFrameVisibleRangesWithStyle;\n\t\tthis._renderResult = output.map(([internalCorners, restOfSelection]) => internalCorners + restOfSelection);\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex < 0 || lineIndex >= this._renderResult.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineIndex];\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst editorSelectionColor = theme.getColor(editorSelectionBackground);\n\tif (editorSelectionColor) {\n\t\tcollector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`);\n\t}\n\tconst editorInactiveSelectionColor = theme.getColor(editorInactiveSelection);\n\tif (editorInactiveSelectionColor) {\n\t\tcollector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`);\n\t}\n\tconst editorSelectionForegroundColor = theme.getColor(editorSelectionForeground);\n\tif (editorSelectionForegroundColor && !editorSelectionForegroundColor.isTransparent()) {\n\t\tcollector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`);\n\t}\n});\n\nfunction abs(n: number): number {\n\treturn n < 0 ? -n : 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 * as nls from 'vs/nls';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { activeContrastBorder, editorBackground, editorForeground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder, contrastBorder, editorFindMatchHighlight } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\n/**\n * Definition of the editor colors\n */\nexport const editorLineHighlight = registerColor('editor.lineHighlightBackground', { dark: null, light: null, hc: null }, nls.localize('lineHighlight', 'Background color for the highlight of line at the cursor position.'));\nexport const editorLineHighlightBorder = registerColor('editor.lineHighlightBorder', { dark: '#282828', light: '#eeeeee', hc: '#f38518' }, nls.localize('lineHighlightBorderBox', 'Background color for the border around the line at the cursor position.'));\nexport const editorRangeHighlight = registerColor('editor.rangeHighlightBackground', { dark: '#ffffff0b', light: '#fdff0033', hc: null }, nls.localize('rangeHighlight', 'Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorRangeHighlightBorder = registerColor('editor.rangeHighlightBorder', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('rangeHighlightBorder', 'Background color of the border around highlighted ranges.'), true);\nexport const editorSymbolHighlight = registerColor('editor.symbolHighlightBackground', { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hc: null }, nls.localize('symbolHighlight', 'Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorSymbolHighlightBorder = registerColor('editor.symbolHighlightBorder', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('symbolHighlightBorder', 'Background color of the border around highlighted symbols.'), true);\n\nexport const editorCursorForeground = registerColor('editorCursor.foreground', { dark: '#AEAFAD', light: Color.black, hc: Color.white }, nls.localize('caret', 'Color of the editor cursor.'));\nexport const editorCursorBackground = registerColor('editorCursor.background', null, nls.localize('editorCursorBackground', 'The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.'));\nexport const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hc: '#e3e4e229' }, nls.localize('editorWhitespaces', 'Color of whitespace characters in the editor.'));\nexport const editorIndentGuides = registerColor('editorIndentGuide.background', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, nls.localize('editorIndentGuides', 'Color of the editor indentation guides.'));\nexport const editorActiveIndentGuides = registerColor('editorIndentGuide.activeBackground', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, nls.localize('editorActiveIndentGuide', 'Color of the active editor indentation guides.'));\nexport const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#858585', light: '#237893', hc: Color.white }, nls.localize('editorLineNumbers', 'Color of editor line numbers.'));\n\nconst deprecatedEditorActiveLineNumber = registerColor('editorActiveLineNumber.foreground', { dark: '#c6c6c6', light: '#0B216F', hc: activeContrastBorder }, nls.localize('editorActiveLineNumber', 'Color of editor active line number'), false, nls.localize('deprecatedEditorActiveLineNumber', 'Id is deprecated. Use \\'editorLineNumber.activeForeground\\' instead.'));\nexport const editorActiveLineNumber = registerColor('editorLineNumber.activeForeground', { dark: deprecatedEditorActiveLineNumber, light: deprecatedEditorActiveLineNumber, hc: deprecatedEditorActiveLineNumber }, nls.localize('editorActiveLineNumber', 'Color of editor active line number'));\n\nexport const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hc: Color.white }, nls.localize('editorRuler', 'Color of the editor rulers.'));\n\nexport const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#919191', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor CodeLens'));\n\nexport const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hc: '#0064001a' }, nls.localize('editorBracketMatchBackground', 'Background color behind matching brackets'));\nexport const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: contrastBorder }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes'));\n\nexport const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hc: '#7f7f7f4d' }, nls.localize('editorOverviewRulerBorder', 'Color of the overview ruler border.'));\nexport const editorOverviewRulerBackground = registerColor('editorOverviewRuler.background', null, nls.localize('editorOverviewRulerBackground', 'Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.'));\n\nexport const editorGutter = registerColor('editorGutter.background', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.'));\n\nexport const editorUnnecessaryCodeBorder = registerColor('editorUnnecessaryCode.border', { dark: null, light: null, hc: Color.fromHex('#fff').transparent(0.8) }, nls.localize('unnecessaryCodeBorder', 'Border color of unnecessary (unused) source code in the editor.'));\nexport const editorUnnecessaryCodeOpacity = registerColor('editorUnnecessaryCode.opacity', { dark: Color.fromHex('#000a'), light: Color.fromHex('#0007'), hc: null }, nls.localize('unnecessaryCodeOpacity', 'Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the \\'editorUnnecessaryCode.border\\' theme color to underline unnecessary code instead of fading it out.'));\n\nexport const ghostTextBorder = registerColor('editorGhostText.border', { dark: null, light: null, hc: Color.fromHex('#fff').transparent(0.8) }, nls.localize('editorGhostTextBorder', 'Border color of ghost text in the editor.'));\nexport const ghostTextForeground = registerColor('editorGhostText.foreground', { dark: Color.fromHex('#ffffff56'), light: Color.fromHex('#0007'), hc: null }, nls.localize('editorGhostTextForeground', 'Foreground color of the ghost text in the editor.'));\nexport const ghostTextBackground = registerColor('editorGhostText.background', { dark: null, light: null, hc: null }, nls.localize('editorGhostTextBackground', 'Background color of the ghost text in the editor.'));\n\nconst rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6));\nexport const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hc: rulerRangeDefault }, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('overviewRuleError', 'Overview ruler marker color for errors.'));\nexport const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Overview ruler marker color for warnings.'));\nexport const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: editorInfoForeground, light: editorInfoForeground, hc: editorInfoBorder }, nls.localize('overviewRuleInfo', 'Overview ruler marker color for infos.'));\n\nexport const editorBracketHighlightingForeground1 = registerColor('editorBracketHighlight.foreground1', { dark: '#FFD700', light: '#0431FAFF', hc: '#FFD700' }, nls.localize('editorBracketHighlightForeground1', 'Foreground color of brackets (1). Requires enabling bracket pair colorization.'));\nexport const editorBracketHighlightingForeground2 = registerColor('editorBracketHighlight.foreground2', { dark: '#DA70D6', light: '#319331FF', hc: '#DA70D6' }, nls.localize('editorBracketHighlightForeground2', 'Foreground color of brackets (2). Requires enabling bracket pair colorization.'));\nexport const editorBracketHighlightingForeground3 = registerColor('editorBracketHighlight.foreground3', { dark: '#179FFF', light: '#7B3814FF', hc: '#87CEFA' }, nls.localize('editorBracketHighlightForeground3', 'Foreground color of brackets (3). Requires enabling bracket pair colorization.'));\nexport const editorBracketHighlightingForeground4 = registerColor('editorBracketHighlight.foreground4', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketHighlightForeground4', 'Foreground color of brackets (4). Requires enabling bracket pair colorization.'));\nexport const editorBracketHighlightingForeground5 = registerColor('editorBracketHighlight.foreground5', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketHighlightForeground5', 'Foreground color of brackets (5). Requires enabling bracket pair colorization.'));\nexport const editorBracketHighlightingForeground6 = registerColor('editorBracketHighlight.foreground6', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketHighlightForeground6', 'Foreground color of brackets (6). Requires enabling bracket pair colorization.'));\n\nexport const editorBracketHighlightingUnexpectedBracketForeground = registerColor('editorBracketHighlight.unexpectedBracket.foreground', { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('editorBracketHighlightUnexpectedBracketForeground', 'Foreground color of unexpected brackets.'));\n\nexport const editorBracketPairGuideBackground1 = registerColor('editorBracketPairGuide.background1', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background1', 'Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideBackground2 = registerColor('editorBracketPairGuide.background2', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background2', 'Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideBackground3 = registerColor('editorBracketPairGuide.background3', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background3', 'Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideBackground4 = registerColor('editorBracketPairGuide.background4', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background4', 'Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideBackground5 = registerColor('editorBracketPairGuide.background5', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background5', 'Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideBackground6 = registerColor('editorBracketPairGuide.background6', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.background6', 'Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.'));\n\nexport const editorBracketPairGuideActiveBackground1 = registerColor('editorBracketPairGuide.activeBackground1', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground1', 'Background color of active bracket pair guides (1). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideActiveBackground2 = registerColor('editorBracketPairGuide.activeBackground2', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground2', 'Background color of active bracket pair guides (2). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideActiveBackground3 = registerColor('editorBracketPairGuide.activeBackground3', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground3', 'Background color of active bracket pair guides (3). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideActiveBackground4 = registerColor('editorBracketPairGuide.activeBackground4', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground4', 'Background color of active bracket pair guides (4). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideActiveBackground5 = registerColor('editorBracketPairGuide.activeBackground5', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground5', 'Background color of active bracket pair guides (5). Requires enabling bracket pair guides.'));\nexport const editorBracketPairGuideActiveBackground6 = registerColor('editorBracketPairGuide.activeBackground6', { dark: '#00000000', light: '#00000000', hc: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground6', 'Background color of active bracket pair guides (6). Requires enabling bracket pair guides.'));\n\nexport const editorUnicodeHighlightBorder = registerColor('editorUnicodeHighlight.border', { dark: '#BD9B03', light: '#CEA33D', hc: '#ff0000' }, nls.localize('editorUnicodeHighlight.border', 'Border color used to highlight unicode characters.'));\n\n\n// contains all color rules that used to defined in editor/browser/widget/editor.css\nregisterThemingParticipant((theme, collector) => {\n\tconst background = theme.getColor(editorBackground);\n\tif (background) {\n\t\tcollector.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${background}; }`);\n\t}\n\n\tconst foreground = theme.getColor(editorForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${foreground}; }`);\n\t}\n\n\tconst gutter = theme.getColor(editorGutter);\n\tif (gutter) {\n\t\tcollector.addRule(`.monaco-editor .margin { background-color: ${gutter}; }`);\n\t}\n\n\tconst rangeHighlight = theme.getColor(editorRangeHighlight);\n\tif (rangeHighlight) {\n\t\tcollector.addRule(`.monaco-editor .rangeHighlight { background-color: ${rangeHighlight}; }`);\n\t}\n\n\tconst rangeHighlightBorder = theme.getColor(editorRangeHighlightBorder);\n\tif (rangeHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .rangeHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${rangeHighlightBorder}; }`);\n\t}\n\n\tconst symbolHighlight = theme.getColor(editorSymbolHighlight);\n\tif (symbolHighlight) {\n\t\tcollector.addRule(`.monaco-editor .symbolHighlight { background-color: ${symbolHighlight}; }`);\n\t}\n\n\tconst symbolHighlightBorder = theme.getColor(editorSymbolHighlightBorder);\n\tif (symbolHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .symbolHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${symbolHighlightBorder}; }`);\n\t}\n\n\tconst invisibles = theme.getColor(editorWhitespaces);\n\tif (invisibles) {\n\t\tcollector.addRule(`.monaco-editor .mtkw { color: ${invisibles} !important; }`);\n\t\tcollector.addRule(`.monaco-editor .mtkz { color: ${invisibles} !important; }`);\n\t}\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 'vs/css!./currentLineHighlight';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport * as arrays from 'vs/base/common/arrays';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nexport abstract class AbstractLineHighlightOverlay extends DynamicViewOverlay {\n\tprivate readonly _context: ViewContext;\n\tprotected _lineHeight: number;\n\tprotected _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';\n\tprotected _contentLeft: number;\n\tprotected _contentWidth: number;\n\tprotected _selectionIsEmpty: boolean;\n\tprotected _renderLineHighlightOnlyWhenFocus: boolean;\n\tprotected _focused: boolean;\n\tprivate _cursorLineNumbers: number[];\n\tprivate _selections: Selection[];\n\tprivate _renderData: string[] | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._renderLineHighlight = options.get(EditorOption.renderLineHighlight);\n\t\tthis._renderLineHighlightOnlyWhenFocus = options.get(EditorOption.renderLineHighlightOnlyWhenFocus);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._selectionIsEmpty = true;\n\t\tthis._focused = false;\n\t\tthis._cursorLineNumbers = [1];\n\t\tthis._selections = [new Selection(1, 1, 1, 1)];\n\t\tthis._renderData = null;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\tprivate _readFromSelections(): boolean {\n\t\tlet hasChanged = false;\n\n\t\tconst cursorsLineNumbers = this._selections.map(s => s.positionLineNumber);\n\t\tcursorsLineNumbers.sort((a, b) => a - b);\n\t\tif (!arrays.equals(this._cursorLineNumbers, cursorsLineNumbers)) {\n\t\t\tthis._cursorLineNumbers = cursorsLineNumbers;\n\t\t\thasChanged = true;\n\t\t}\n\n\t\tconst selectionIsEmpty = this._selections.every(s => s.isEmpty());\n\t\tif (this._selectionIsEmpty !== selectionIsEmpty) {\n\t\t\tthis._selectionIsEmpty = selectionIsEmpty;\n\t\t\thasChanged = true;\n\t\t}\n\n\t\treturn hasChanged;\n\t}\n\n\t// --- begin event handlers\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\treturn this._readFromSelections();\n\t}\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._renderLineHighlight = options.get(EditorOption.renderLineHighlight);\n\t\tthis._renderLineHighlightOnlyWhenFocus = options.get(EditorOption.renderLineHighlightOnlyWhenFocus);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\treturn true;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections;\n\t\treturn this._readFromSelections();\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollWidthChanged || e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tif (!this._renderLineHighlightOnlyWhenFocus) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._focused = e.isFocused;\n\t\treturn true;\n\t}\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (!this._shouldRenderThis()) {\n\t\t\tthis._renderData = null;\n\t\t\treturn;\n\t\t}\n\t\tconst renderedLine = this._renderOne(ctx);\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst len = this._cursorLineNumbers.length;\n\t\tlet index = 0;\n\t\tconst renderData: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\twhile (index < len && this._cursorLineNumbers[index] < lineNumber) {\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tif (index < len && this._cursorLineNumbers[index] === lineNumber) {\n\t\t\t\trenderData[lineIndex] = renderedLine;\n\t\t\t} else {\n\t\t\t\trenderData[lineIndex] = '';\n\t\t\t}\n\t\t}\n\t\tthis._renderData = renderData;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderData) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex >= this._renderData.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderData[lineIndex];\n\t}\n\n\tprotected _shouldRenderInMargin(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'gutter' || this._renderLineHighlight === 'all')\n\t\t\t&& (!this._renderLineHighlightOnlyWhenFocus || this._focused)\n\t\t);\n\t}\n\n\tprotected _shouldRenderInContent(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'line' || this._renderLineHighlight === 'all')\n\t\t\t&& this._selectionIsEmpty\n\t\t\t&& (!this._renderLineHighlightOnlyWhenFocus || this._focused)\n\t\t);\n\t}\n\n\tprotected abstract _shouldRenderThis(): boolean;\n\tprotected abstract _shouldRenderOther(): boolean;\n\tprotected abstract _renderOne(ctx: RenderingContext): string;\n}\n\nexport class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay {\n\n\tprotected _renderOne(ctx: RenderingContext): string {\n\t\tconst className = 'current-line' + (this._shouldRenderOther() ? ' current-line-both' : '');\n\t\treturn `<div class=\"${className}\" style=\"width:${Math.max(ctx.scrollWidth, this._contentWidth)}px; height:${this._lineHeight}px;\"></div>`;\n\t}\n\tprotected _shouldRenderThis(): boolean {\n\t\treturn this._shouldRenderInContent();\n\t}\n\tprotected _shouldRenderOther(): boolean {\n\t\treturn this._shouldRenderInMargin();\n\t}\n}\n\nexport class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOverlay {\n\tprotected _renderOne(ctx: RenderingContext): string {\n\t\tconst className = 'current-line' + (this._shouldRenderInMargin() ? ' current-line-margin' : '') + (this._shouldRenderOther() ? ' current-line-margin-both' : '');\n\t\treturn `<div class=\"${className}\" style=\"width:${this._contentLeft}px; height:${this._lineHeight}px;\"></div>`;\n\t}\n\tprotected _shouldRenderThis(): boolean {\n\t\treturn true;\n\t}\n\tprotected _shouldRenderOther(): boolean {\n\t\treturn this._shouldRenderInContent();\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst lineHighlight = theme.getColor(editorLineHighlight);\n\tif (lineHighlight) {\n\t\tcollector.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${lineHighlight}; }`);\n\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`);\n\t}\n\tif (!lineHighlight || lineHighlight.isTransparent() || theme.defines(editorLineHighlightBorder)) {\n\t\tconst lineHighlightBorder = theme.getColor(editorLineHighlightBorder);\n\t\tif (lineHighlightBorder) {\n\t\t\tcollector.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${lineHighlightBorder}; }`);\n\t\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`);\n\t\t\tif (theme.type === 'hc') {\n\t\t\t\tcollector.addRule(`.monaco-editor .view-overlays .current-line { border-width: 1px; }`);\n\t\t\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }`);\n\t\t\t}\n\t\t}\n\t}\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 'vs/css!./indentGuides';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { editorActiveIndentGuides, editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketPairGuideActiveBackground1, editorBracketPairGuideActiveBackground2, editorBracketPairGuideActiveBackground3, editorBracketPairGuideActiveBackground4, editorBracketPairGuideActiveBackground5, editorBracketPairGuideActiveBackground6, editorBracketPairGuideBackground1, editorBracketPairGuideBackground2, editorBracketPairGuideBackground3, editorBracketPairGuideBackground4, editorBracketPairGuideBackground5, editorBracketPairGuideBackground6, editorIndentGuides } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { EditorOption, InternalGuidesOptions } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ArrayQueue } from 'vs/base/common/arrays';\nimport { Color } from 'vs/base/common/color';\nimport { isDefined } from 'vs/base/common/types';\nimport { BracketPairGuidesClassNames } from 'vs/editor/common/model/guidesTextModelPart';\nimport { IndentGuide, HorizontalGuidesState } from 'vs/editor/common/textModelGuides';\n\nexport class IndentGuidesOverlay extends DynamicViewOverlay {\n\n\tprivate readonly _context: ViewContext;\n\tprivate _primaryPosition: Position | null;\n\tprivate _lineHeight: number;\n\tprivate _spaceWidth: number;\n\tprivate _renderResult: string[] | null;\n\tprivate _maxIndentLeft: number;\n\tprivate _bracketPairGuideOptions: InternalGuidesOptions;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._primaryPosition = null;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._spaceWidth = fontInfo.spaceWidth;\n\t\tthis._maxIndentLeft = wrappingInfo.wrappingColumn === -1 ? -1 : (wrappingInfo.wrappingColumn * fontInfo.typicalHalfwidthCharacterWidth);\n\t\tthis._bracketPairGuideOptions = options.get(EditorOption.guides);\n\n\t\tthis._renderResult = null;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._spaceWidth = fontInfo.spaceWidth;\n\t\tthis._maxIndentLeft = wrappingInfo.wrappingColumn === -1 ? -1 : (wrappingInfo.wrappingColumn * fontInfo.typicalHalfwidthCharacterWidth);\n\t\tthis._bracketPairGuideOptions = options.get(EditorOption.guides);\n\n\t\treturn true;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst selection = e.selections[0];\n\t\tconst newPosition = selection.getPosition();\n\t\tif (!this._primaryPosition?.equals(newPosition)) {\n\t\t\tthis._primaryPosition = newPosition;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;// || e.scrollWidthChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLanguageConfigurationChanged(e: viewEvents.ViewLanguageConfigurationEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (!this._bracketPairGuideOptions.indentation && this._bracketPairGuideOptions.bracketPairs === false) {\n\t\t\tthis._renderResult = null;\n\t\t\treturn;\n\t\t}\n\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst scrollWidth = ctx.scrollWidth;\n\t\tconst lineHeight = this._lineHeight;\n\n\t\tconst activeCursorPosition = this._primaryPosition;\n\n\t\tconst indents = this.getGuidesByLine(\n\t\t\tvisibleStartLineNumber,\n\t\t\tvisibleEndLineNumber,\n\t\t\tactiveCursorPosition\n\t\t);\n\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\tconst indent = indents[lineIndex];\n\t\t\tlet result = '';\n\t\t\tconst leftOffset = ctx.visibleRangeForPosition(new Position(lineNumber, 1))?.left ?? 0;\n\t\t\tfor (const guide of indent) {\n\t\t\t\tconst left = leftOffset + (guide.visibleColumn - 1) * this._spaceWidth;\n\t\t\t\tif (left > scrollWidth || (this._maxIndentLeft > 0 && left > this._maxIndentLeft)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst className = guide.horizontalLine ? (guide.horizontalLine.top ? 'horizontal-top' : 'horizontal-bottom') : 'vertical';\n\n\t\t\t\tconst width = guide.horizontalLine\n\t\t\t\t\t? (ctx.visibleRangeForPosition(\n\t\t\t\t\t\tnew Position(lineNumber, guide.horizontalLine.endColumn)\n\t\t\t\t\t)?.left ?? (left + this._spaceWidth)) - left\n\t\t\t\t\t: this._spaceWidth;\n\n\t\t\t\tresult += `<div class=\"core-guide ${guide.className} ${className}\" style=\"left:${left}px;height:${lineHeight}px;width:${width}px\"></div>`;\n\t\t\t}\n\t\t\toutput[lineIndex] = result;\n\t\t}\n\t\tthis._renderResult = output;\n\t}\n\n\tprivate getGuidesByLine(\n\t\tvisibleStartLineNumber: number,\n\t\tvisibleEndLineNumber: number,\n\t\tactiveCursorPosition: Position | null\n\t): IndentGuide[][] {\n\t\tconst bracketGuides = this._bracketPairGuideOptions.bracketPairs !== false\n\t\t\t? this._context.viewModel.getBracketGuidesInRangeByLine(\n\t\t\t\tvisibleStartLineNumber,\n\t\t\t\tvisibleEndLineNumber,\n\t\t\t\tactiveCursorPosition,\n\t\t\t\t{\n\t\t\t\t\thighlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair,\n\t\t\t\t\thorizontalGuides: this._bracketPairGuideOptions.bracketPairsHorizontal === true\n\t\t\t\t\t\t? HorizontalGuidesState.Enabled\n\t\t\t\t\t\t: this._bracketPairGuideOptions.bracketPairsHorizontal === 'active'\n\t\t\t\t\t\t\t? HorizontalGuidesState.EnabledForActive\n\t\t\t\t\t\t\t: HorizontalGuidesState.Disabled,\n\t\t\t\t\tincludeInactive: this._bracketPairGuideOptions.bracketPairs === true,\n\t\t\t\t}\n\t\t\t)\n\t\t\t: null;\n\n\t\tconst indentGuides = this._bracketPairGuideOptions.indentation\n\t\t\t? this._context.viewModel.getLinesIndentGuides(\n\t\t\t\tvisibleStartLineNumber,\n\t\t\t\tvisibleEndLineNumber\n\t\t\t)\n\t\t\t: null;\n\n\t\tlet activeIndentStartLineNumber = 0;\n\t\tlet activeIndentEndLineNumber = 0;\n\t\tlet activeIndentLevel = 0;\n\n\t\tif (this._bracketPairGuideOptions.highlightActiveIndentation && activeCursorPosition) {\n\t\t\tconst activeIndentInfo = this._context.viewModel.getActiveIndentGuide(activeCursorPosition.lineNumber, visibleStartLineNumber, visibleEndLineNumber);\n\t\t\tactiveIndentStartLineNumber = activeIndentInfo.startLineNumber;\n\t\t\tactiveIndentEndLineNumber = activeIndentInfo.endLineNumber;\n\t\t\tactiveIndentLevel = activeIndentInfo.indent;\n\t\t}\n\n\t\tconst { indentSize } = this._context.viewModel.model.getOptions();\n\n\t\tconst result: IndentGuide[][] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineGuides = new Array<IndentGuide>();\n\t\t\tresult.push(lineGuides);\n\n\t\t\tconst bracketGuidesInLine = bracketGuides ? bracketGuides[lineNumber - visibleStartLineNumber] : [];\n\t\t\tconst bracketGuidesInLineQueue = new ArrayQueue(bracketGuidesInLine);\n\n\t\t\tconst indentGuidesInLine = indentGuides ? indentGuides[lineNumber - visibleStartLineNumber] : [];\n\n\t\t\tfor (let indentLvl = 1; indentLvl <= indentGuidesInLine; indentLvl++) {\n\t\t\t\tconst indentGuide = (indentLvl - 1) * indentSize + 1;\n\t\t\t\tconst isActive =\n\t\t\t\t\t// Disable active indent guide if there are bracket guides.\n\t\t\t\t\tbracketGuidesInLine.length === 0 &&\n\t\t\t\t\tactiveIndentStartLineNumber <= lineNumber &&\n\t\t\t\t\tlineNumber <= activeIndentEndLineNumber &&\n\t\t\t\t\tindentLvl === activeIndentLevel;\n\t\t\t\tlineGuides.push(...bracketGuidesInLineQueue.takeWhile(g => g.visibleColumn < indentGuide) || []);\n\t\t\t\tconst peeked = bracketGuidesInLineQueue.peek();\n\t\t\t\tif (!peeked || peeked.visibleColumn !== indentGuide || peeked.horizontalLine) {\n\t\t\t\t\tlineGuides.push(\n\t\t\t\t\t\tnew IndentGuide(\n\t\t\t\t\t\t\tindentGuide,\n\t\t\t\t\t\t\tisActive ? 'core-guide-indent-active' : 'core-guide-indent',\n\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlineGuides.push(...bracketGuidesInLineQueue.takeWhile(g => true) || []);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex < 0 || lineIndex >= this._renderResult.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineIndex];\n\t}\n}\n\nfunction transparentToUndefined(color: Color | undefined): Color | undefined {\n\tif (color && color.isTransparent()) {\n\t\treturn undefined;\n\t}\n\treturn color;\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst editorIndentGuidesColor = theme.getColor(editorIndentGuides);\n\tif (editorIndentGuidesColor) {\n\t\tcollector.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${editorIndentGuidesColor} inset; }`);\n\t}\n\tconst editorActiveIndentGuidesColor = theme.getColor(editorActiveIndentGuides) || editorIndentGuidesColor;\n\tif (editorActiveIndentGuidesColor) {\n\t\tcollector.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${editorActiveIndentGuidesColor} inset; }`);\n\t}\n\n\tconst colors = [\n\t\t{ bracketColor: editorBracketHighlightingForeground1, guideColor: editorBracketPairGuideBackground1, guideColorActive: editorBracketPairGuideActiveBackground1 },\n\t\t{ bracketColor: editorBracketHighlightingForeground2, guideColor: editorBracketPairGuideBackground2, guideColorActive: editorBracketPairGuideActiveBackground2 },\n\t\t{ bracketColor: editorBracketHighlightingForeground3, guideColor: editorBracketPairGuideBackground3, guideColorActive: editorBracketPairGuideActiveBackground3 },\n\t\t{ bracketColor: editorBracketHighlightingForeground4, guideColor: editorBracketPairGuideBackground4, guideColorActive: editorBracketPairGuideActiveBackground4 },\n\t\t{ bracketColor: editorBracketHighlightingForeground5, guideColor: editorBracketPairGuideBackground5, guideColorActive: editorBracketPairGuideActiveBackground5 },\n\t\t{ bracketColor: editorBracketHighlightingForeground6, guideColor: editorBracketPairGuideBackground6, guideColorActive: editorBracketPairGuideActiveBackground6 }\n\t];\n\tconst colorProvider = new BracketPairGuidesClassNames();\n\n\n\tconst colorValues = colors\n\t\t.map(c => {\n\t\t\tconst bracketColor = theme.getColor(c.bracketColor);\n\t\t\tconst guideColor = theme.getColor(c.guideColor);\n\t\t\tconst guideColorActive = theme.getColor(c.guideColorActive);\n\n\t\t\tconst effectiveGuideColor = transparentToUndefined(transparentToUndefined(guideColor) ?? bracketColor?.transparent(0.3));\n\t\t\tconst effectiveGuideColorActive = transparentToUndefined(transparentToUndefined(guideColorActive) ?? bracketColor);\n\n\t\t\tif (!effectiveGuideColor || !effectiveGuideColorActive) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tguideColor: effectiveGuideColor,\n\t\t\t\tguideColorActive: effectiveGuideColorActive,\n\t\t\t};\n\t\t})\n\t\t.filter(isDefined);\n\n\tif (colorValues.length > 0) {\n\t\tfor (let level = 0; level < 30; level++) {\n\t\t\tconst colors = colorValues[level % colorValues.length];\n\t\t\tcollector.addRule(`.monaco-editor .${colorProvider.getInlineClassNameOfLevel(level).replace(/ /g, '.')} { --guide-color: ${colors.guideColor}; --guide-color-active: ${colors.guideColorActive}; }`);\n\t\t}\n\n\t\tcollector.addRule(`.monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }`);\n\t\tcollector.addRule(`.monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }`);\n\t\tcollector.addRule(`.monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }`);\n\n\t\tcollector.addRule(`.monaco-editor .vertical.${colorProvider.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`);\n\t\tcollector.addRule(`.monaco-editor .horizontal-top.${colorProvider.activeClassName} { border-top: 1px solid var(--guide-color-active); }`);\n\t\tcollector.addRule(`.monaco-editor .horizontal-bottom.${colorProvider.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`);\n\t}\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 'vs/css!./lineNumbers';\nimport * as platform from 'vs/base/common/platform';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { RenderLineNumbersType, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { editorActiveLineNumber, editorLineNumbers } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class LineNumbersOverlay extends DynamicViewOverlay {\n\n\tpublic static readonly CLASS_NAME = 'line-numbers';\n\n\tprivate readonly _context: ViewContext;\n\n\tprivate _lineHeight!: number;\n\tprivate _renderLineNumbers!: RenderLineNumbersType;\n\tprivate _renderCustomLineNumbers!: ((lineNumber: number) => string) | null;\n\tprivate _renderFinalNewline!: boolean;\n\tprivate _lineNumbersLeft!: number;\n\tprivate _lineNumbersWidth!: number;\n\tprivate _lastCursorModelPosition: Position;\n\tprivate _renderResult: string[] | null;\n\tprivate _activeLineNumber: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\n\t\tthis._readConfig();\n\n\t\tthis._lastCursorModelPosition = new Position(1, 1);\n\t\tthis._renderResult = null;\n\t\tthis._activeLineNumber = 1;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tprivate _readConfig(): void {\n\t\tconst options = this._context.configuration.options;\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\tthis._renderLineNumbers = lineNumbers.renderType;\n\t\tthis._renderCustomLineNumbers = lineNumbers.renderFn;\n\t\tthis._renderFinalNewline = options.get(EditorOption.renderFinalNewline);\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tthis._lineNumbersLeft = layoutInfo.lineNumbersLeft;\n\t\tthis._lineNumbersWidth = layoutInfo.lineNumbersWidth;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tthis._renderResult = null;\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis._readConfig();\n\t\treturn true;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst primaryViewPosition = e.selections[0].getPosition();\n\t\tthis._lastCursorModelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(primaryViewPosition);\n\n\t\tlet shouldRender = false;\n\t\tif (this._activeLineNumber !== primaryViewPosition.lineNumber) {\n\t\t\tthis._activeLineNumber = primaryViewPosition.lineNumber;\n\t\t\tshouldRender = true;\n\t\t}\n\t\tif (this._renderLineNumbers === RenderLineNumbersType.Relative || this._renderLineNumbers === RenderLineNumbersType.Interval) {\n\t\t\tshouldRender = true;\n\t\t}\n\t\treturn shouldRender;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\tprivate _getLineRenderLineNumber(viewLineNumber: number): string {\n\t\tconst modelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(viewLineNumber, 1));\n\t\tif (modelPosition.column !== 1) {\n\t\t\treturn '';\n\t\t}\n\t\tconst modelLineNumber = modelPosition.lineNumber;\n\n\t\tif (this._renderCustomLineNumbers) {\n\t\t\treturn this._renderCustomLineNumbers(modelLineNumber);\n\t\t}\n\n\t\tif (this._renderLineNumbers === RenderLineNumbersType.Relative) {\n\t\t\tconst diff = Math.abs(this._lastCursorModelPosition.lineNumber - modelLineNumber);\n\t\t\tif (diff === 0) {\n\t\t\t\treturn '<span class=\"relative-current-line-number\">' + modelLineNumber + '</span>';\n\t\t\t}\n\t\t\treturn String(diff);\n\t\t}\n\n\t\tif (this._renderLineNumbers === RenderLineNumbersType.Interval) {\n\t\t\tif (this._lastCursorModelPosition.lineNumber === modelLineNumber) {\n\t\t\t\treturn String(modelLineNumber);\n\t\t\t}\n\t\t\tif (modelLineNumber % 10 === 0) {\n\t\t\t\treturn String(modelLineNumber);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\treturn String(modelLineNumber);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (this._renderLineNumbers === RenderLineNumbersType.Off) {\n\t\t\tthis._renderResult = null;\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineHeightClassName = (platform.isLinux ? (this._lineHeight % 2 === 0 ? ' lh-even' : ' lh-odd') : '');\n\t\tconst visibleStartLineNumber = ctx.visibleRange.startLineNumber;\n\t\tconst visibleEndLineNumber = ctx.visibleRange.endLineNumber;\n\t\tconst common = '<div class=\"' + LineNumbersOverlay.CLASS_NAME + lineHeightClassName + '\" style=\"left:' + this._lineNumbersLeft + 'px;width:' + this._lineNumbersWidth + 'px;\">';\n\n\t\tconst lineCount = this._context.viewModel.getLineCount();\n\t\tconst output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\n\t\t\tif (!this._renderFinalNewline) {\n\t\t\t\tif (lineNumber === lineCount && this._context.viewModel.getLineLength(lineNumber) === 0) {\n\t\t\t\t\t// Do not render last (empty) line\n\t\t\t\t\toutput[lineIndex] = '';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst renderLineNumber = this._getLineRenderLineNumber(lineNumber);\n\n\t\t\tif (renderLineNumber) {\n\t\t\t\tif (lineNumber === this._activeLineNumber) {\n\t\t\t\t\toutput[lineIndex] = (\n\t\t\t\t\t\t'<div class=\"active-line-number ' + LineNumbersOverlay.CLASS_NAME + lineHeightClassName + '\" style=\"left:' + this._lineNumbersLeft + 'px;width:' + this._lineNumbersWidth + 'px;\">'\n\t\t\t\t\t\t+ renderLineNumber\n\t\t\t\t\t\t+ '</div>'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\toutput[lineIndex] = (\n\t\t\t\t\t\tcommon\n\t\t\t\t\t\t+ renderLineNumber\n\t\t\t\t\t\t+ '</div>'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput[lineIndex] = '';\n\t\t\t}\n\t\t}\n\n\t\tthis._renderResult = output;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (!this._renderResult) {\n\t\t\treturn '';\n\t\t}\n\t\tconst lineIndex = lineNumber - startLineNumber;\n\t\tif (lineIndex < 0 || lineIndex >= this._renderResult.length) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this._renderResult[lineIndex];\n\t}\n}\n\n// theming\n\nregisterThemingParticipant((theme, collector) => {\n\tconst lineNumbers = theme.getColor(editorLineNumbers);\n\tif (lineNumbers) {\n\t\tcollector.addRule(`.monaco-editor .line-numbers { color: ${lineNumbers}; }`);\n\t}\n\tconst activeLineNumber = theme.getColor(editorActiveLineNumber);\n\tif (activeLineNumber) {\n\t\tcollector.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${activeLineNumber}; }`);\n\t}\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 'vs/css!./textAreaHandler';\nimport * as nls from 'vs/nls';\nimport * as browser from 'vs/base/browser/browser';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { CopyOptions, ICompositionData, IPasteData, ITextAreaInputHost, TextAreaInput, ClipboardDataToCopy, TextAreaWrapper } from 'vs/editor/browser/controller/textAreaInput';\nimport { ISimpleModel, ITypeData, PagedScreenReaderStrategy, TextAreaState, _debugComposition } from 'vs/editor/browser/controller/textAreaState';\nimport { ViewController } from 'vs/editor/browser/view/viewController';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers';\nimport { Margin } from 'vs/editor/browser/viewParts/margin/margin';\nimport { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo } from 'vs/editor/common/config/fontInfo';\nimport { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { EndOfLinePreference } from 'vs/editor/common/model';\nimport { RenderingContext, RestrictedRenderingContext, HorizontalPosition } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { IEditorAriaOptions } from 'vs/editor/browser/editorBrowser';\nimport { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor';\nimport { ColorId, ITokenPresentation, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { Color } from 'vs/base/common/color';\n\nexport interface IVisibleRangeProvider {\n\tvisibleRangeForPosition(position: Position): HorizontalPosition | null;\n}\n\nclass VisibleTextAreaData {\n\t_visibleTextAreaBrand: void = undefined;\n\n\tpublic startPosition: Position | null = null;\n\tpublic endPosition: Position | null = null;\n\n\tpublic visibleTextareaStart: HorizontalPosition | null = null;\n\tpublic visibleTextareaEnd: HorizontalPosition | null = null;\n\n\t/**\n\t * When doing composition, the currently composed text might be split up into\n\t * multiple tokens, then merged again into a single token, etc. Here we attempt\n\t * to keep the presentation of the <textarea> stable by using the previous used\n\t * style if multiple tokens come into play. This avoids flickering.\n\t */\n\tprivate _previousPresentation: ITokenPresentation | null = null;\n\n\tconstructor(\n\t\tprivate readonly _context: ViewContext,\n\t\tpublic readonly modelLineNumber: number,\n\t\tpublic readonly distanceToModelLineStart: number,\n\t\tpublic readonly widthOfHiddenLineTextBefore: number,\n\t\tpublic readonly distanceToModelLineEnd: number,\n\t) {\n\t}\n\n\tprepareRender(visibleRangeProvider: IVisibleRangeProvider): void {\n\t\tconst startModelPosition = new Position(this.modelLineNumber, this.distanceToModelLineStart + 1);\n\t\tconst endModelPosition = new Position(this.modelLineNumber, this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber) - this.distanceToModelLineEnd);\n\n\t\tthis.startPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(startModelPosition);\n\t\tthis.endPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(endModelPosition);\n\n\t\tif (this.startPosition.lineNumber === this.endPosition.lineNumber) {\n\t\t\tthis.visibleTextareaStart = visibleRangeProvider.visibleRangeForPosition(this.startPosition);\n\t\t\tthis.visibleTextareaEnd = visibleRangeProvider.visibleRangeForPosition(this.endPosition);\n\t\t} else {\n\t\t\t// TODO: what if the view positions are not on the same line?\n\t\t\tthis.visibleTextareaStart = null;\n\t\t\tthis.visibleTextareaEnd = null;\n\t\t}\n\t}\n\n\tdefinePresentation(tokenPresentation: ITokenPresentation | null): ITokenPresentation {\n\t\tif (!this._previousPresentation) {\n\t\t\t// To avoid flickering, once set, always reuse a presentation throughout the entire IME session\n\t\t\tif (tokenPresentation) {\n\t\t\t\tthis._previousPresentation = tokenPresentation;\n\t\t\t} else {\n\t\t\t\tthis._previousPresentation = {\n\t\t\t\t\tforeground: ColorId.DefaultForeground,\n\t\t\t\t\titalic: false,\n\t\t\t\t\tbold: false,\n\t\t\t\t\tunderline: false,\n\t\t\t\t\tstrikethrough: false,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn this._previousPresentation;\n\t}\n}\n\nconst canUseZeroSizeTextarea = (browser.isFirefox);\n\nexport class TextAreaHandler extends ViewPart {\n\n\tprivate readonly _viewController: ViewController;\n\tprivate readonly _visibleRangeProvider: IVisibleRangeProvider;\n\tprivate _scrollLeft: number;\n\tprivate _scrollTop: number;\n\n\tprivate _accessibilitySupport!: AccessibilitySupport;\n\tprivate _accessibilityPageSize!: number;\n\tprivate _contentLeft: number;\n\tprivate _contentWidth: number;\n\tprivate _contentHeight: number;\n\tprivate _fontInfo: BareFontInfo;\n\tprivate _lineHeight: number;\n\tprivate _emptySelectionClipboard: boolean;\n\tprivate _copyWithSyntaxHighlighting: boolean;\n\n\t/**\n\t * Defined only when the text area is visible (composition case).\n\t */\n\tprivate _visibleTextArea: VisibleTextAreaData | null;\n\tprivate _selections: Selection[];\n\tprivate _modelSelections: Selection[];\n\n\t/**\n\t * The position at which the textarea was rendered.\n\t * This is useful for hit-testing and determining the mouse position.\n\t */\n\tprivate _lastRenderPosition: Position | null;\n\n\tpublic readonly textArea: FastDomNode<HTMLTextAreaElement>;\n\tpublic readonly textAreaCover: FastDomNode<HTMLElement>;\n\tprivate readonly _textAreaInput: TextAreaInput;\n\n\tconstructor(context: ViewContext, viewController: ViewController, visibleRangeProvider: IVisibleRangeProvider) {\n\t\tsuper(context);\n\n\t\tthis._viewController = viewController;\n\t\tthis._visibleRangeProvider = visibleRangeProvider;\n\t\tthis._scrollLeft = 0;\n\t\tthis._scrollTop = 0;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._setAccessibilityOptions(options);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentHeight = layoutInfo.height;\n\t\tthis._fontInfo = options.get(EditorOption.fontInfo);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\n\t\tthis._visibleTextArea = null;\n\t\tthis._selections = [new Selection(1, 1, 1, 1)];\n\t\tthis._modelSelections = [new Selection(1, 1, 1, 1)];\n\t\tthis._lastRenderPosition = null;\n\n\t\t// Text Area (The focus will always be in the textarea when the cursor is blinking)\n\t\tthis.textArea = createFastDomNode(document.createElement('textarea'));\n\t\tPartFingerprints.write(this.textArea, PartFingerprint.TextArea);\n\t\tthis.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);\n\t\tthis.textArea.setAttribute('wrap', 'off');\n\t\tthis.textArea.setAttribute('autocorrect', 'off');\n\t\tthis.textArea.setAttribute('autocapitalize', 'off');\n\t\tthis.textArea.setAttribute('autocomplete', 'off');\n\t\tthis.textArea.setAttribute('spellcheck', 'false');\n\t\tthis.textArea.setAttribute('aria-label', this._getAriaLabel(options));\n\t\tthis.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex)));\n\t\tthis.textArea.setAttribute('role', 'textbox');\n\t\tthis.textArea.setAttribute('aria-roledescription', nls.localize('editor', \"editor\"));\n\t\tthis.textArea.setAttribute('aria-multiline', 'true');\n\t\tthis.textArea.setAttribute('aria-haspopup', 'false');\n\t\tthis.textArea.setAttribute('aria-autocomplete', 'both');\n\n\t\tif (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {\n\t\t\tthis.textArea.setAttribute('readonly', 'true');\n\t\t}\n\n\t\tthis.textAreaCover = createFastDomNode(document.createElement('div'));\n\t\tthis.textAreaCover.setPosition('absolute');\n\n\t\tconst simpleModel: ISimpleModel = {\n\t\t\tgetLineCount: (): number => {\n\t\t\t\treturn this._context.viewModel.getLineCount();\n\t\t\t},\n\t\t\tgetLineMaxColumn: (lineNumber: number): number => {\n\t\t\t\treturn this._context.viewModel.getLineMaxColumn(lineNumber);\n\t\t\t},\n\t\t\tgetValueInRange: (range: Range, eol: EndOfLinePreference): string => {\n\t\t\t\treturn this._context.viewModel.getValueInRange(range, eol);\n\t\t\t}\n\t\t};\n\n\t\tconst textAreaInputHost: ITextAreaInputHost = {\n\t\t\tgetDataToCopy: (): ClipboardDataToCopy => {\n\t\t\t\tconst rawTextToCopy = this._context.viewModel.getPlainTextToCopy(this._modelSelections, this._emptySelectionClipboard, platform.isWindows);\n\t\t\t\tconst newLineCharacter = this._context.viewModel.model.getEOL();\n\n\t\t\t\tconst isFromEmptySelection = (this._emptySelectionClipboard && this._modelSelections.length === 1 && this._modelSelections[0].isEmpty());\n\t\t\t\tconst multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null);\n\t\t\t\tconst text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);\n\n\t\t\t\tlet html: string | null | undefined = undefined;\n\t\t\t\tlet mode: string | null = null;\n\t\t\t\tif (CopyOptions.forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) {\n\t\t\t\t\tconst richText = this._context.viewModel.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard);\n\t\t\t\t\tif (richText) {\n\t\t\t\t\t\thtml = richText.html;\n\t\t\t\t\t\tmode = richText.mode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tisFromEmptySelection,\n\t\t\t\t\tmulticursorText,\n\t\t\t\t\ttext,\n\t\t\t\t\thtml,\n\t\t\t\t\tmode\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetScreenReaderContent: (currentState: TextAreaState): TextAreaState => {\n\t\t\t\tif (this._accessibilitySupport === AccessibilitySupport.Disabled) {\n\t\t\t\t\t// We know for a fact that a screen reader is not attached\n\t\t\t\t\t// On OSX, we write the character before the cursor to allow for \"long-press\" composition\n\t\t\t\t\t// Also on OSX, we write the word before the cursor to allow for the Accessibility Keyboard to give good hints\n\t\t\t\t\tif (platform.isMacintosh) {\n\t\t\t\t\t\tconst selection = this._selections[0];\n\t\t\t\t\t\tif (selection.isEmpty()) {\n\t\t\t\t\t\t\tconst position = selection.getStartPosition();\n\n\t\t\t\t\t\t\tlet textBefore = this._getWordBeforePosition(position);\n\t\t\t\t\t\t\tif (textBefore.length === 0) {\n\t\t\t\t\t\t\t\ttextBefore = this._getCharacterBeforePosition(position);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (textBefore.length > 0) {\n\t\t\t\t\t\t\t\treturn new TextAreaState(textBefore, textBefore.length, textBefore.length, position, position);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn TextAreaState.EMPTY;\n\t\t\t\t}\n\n\t\t\t\tif (browser.isAndroid) {\n\t\t\t\t\t// when tapping in the editor on a word, Android enters composition mode.\n\t\t\t\t\t// in the `compositionstart` event we cannot clear the textarea, because\n\t\t\t\t\t// it then forgets to ever send a `compositionend`.\n\t\t\t\t\t// we therefore only write the current word in the textarea\n\t\t\t\t\tconst selection = this._selections[0];\n\t\t\t\t\tif (selection.isEmpty()) {\n\t\t\t\t\t\tconst position = selection.getStartPosition();\n\t\t\t\t\t\tconst [wordAtPosition, positionOffsetInWord] = this._getAndroidWordAtPosition(position);\n\t\t\t\t\t\tif (wordAtPosition.length > 0) {\n\t\t\t\t\t\t\treturn new TextAreaState(wordAtPosition, positionOffsetInWord, positionOffsetInWord, position, position);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn TextAreaState.EMPTY;\n\t\t\t\t}\n\n\t\t\t\treturn PagedScreenReaderStrategy.fromEditorSelection(currentState, simpleModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === AccessibilitySupport.Unknown);\n\t\t\t},\n\n\t\t\tdeduceModelPosition: (viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position => {\n\t\t\t\treturn this._context.viewModel.deduceModelPositionRelativeToViewPosition(viewAnchorPosition, deltaOffset, lineFeedCnt);\n\t\t\t}\n\t\t};\n\n\t\tconst textAreaWrapper = this._register(new TextAreaWrapper(this.textArea.domNode));\n\t\tthis._textAreaInput = this._register(new TextAreaInput(textAreaInputHost, textAreaWrapper, platform.OS, browser));\n\n\t\tthis._register(this._textAreaInput.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tthis._viewController.emitKeyDown(e);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onKeyUp((e: IKeyboardEvent) => {\n\t\t\tthis._viewController.emitKeyUp(e);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onPaste((e: IPasteData) => {\n\t\t\tlet pasteOnNewLine = false;\n\t\t\tlet multicursorText: string[] | null = null;\n\t\t\tlet mode: string | null = null;\n\t\t\tif (e.metadata) {\n\t\t\t\tpasteOnNewLine = (this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection);\n\t\t\t\tmulticursorText = (typeof e.metadata.multicursorText !== 'undefined' ? e.metadata.multicursorText : null);\n\t\t\t\tmode = e.metadata.mode;\n\t\t\t}\n\t\t\tthis._viewController.paste(e.text, pasteOnNewLine, multicursorText, mode);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCut(() => {\n\t\t\tthis._viewController.cut();\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onType((e: ITypeData) => {\n\t\t\tif (e.replacePrevCharCnt || e.replaceNextCharCnt || e.positionDelta) {\n\t\t\t\t// must be handled through the new command\n\t\t\t\tif (_debugComposition) {\n\t\t\t\t\tconsole.log(` => compositionType: <<${e.text}>>, ${e.replacePrevCharCnt}, ${e.replaceNextCharCnt}, ${e.positionDelta}`);\n\t\t\t\t}\n\t\t\t\tthis._viewController.compositionType(e.text, e.replacePrevCharCnt, e.replaceNextCharCnt, e.positionDelta);\n\t\t\t} else {\n\t\t\t\tif (_debugComposition) {\n\t\t\t\t\tconsole.log(` => type: <<${e.text}>>`);\n\t\t\t\t}\n\t\t\t\tthis._viewController.type(e.text);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onSelectionChangeRequest((modelSelection: Selection) => {\n\t\t\tthis._viewController.setSelection(modelSelection);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCompositionStart((e) => {\n\n\t\t\t// The textarea might contain some content when composition starts.\n\t\t\t//\n\t\t\t// When we make the textarea visible, it always has a height of 1 line,\n\t\t\t// so we don't need to worry too much about content on lines above or below\n\t\t\t// the selection.\n\t\t\t//\n\t\t\t// However, the text on the current line needs to be made visible because\n\t\t\t// some IME methods allow to move to other glyphs on the current line\n\t\t\t// (by pressing arrow keys).\n\t\t\t//\n\t\t\t// (1) The textarea might contain only some parts of the current line,\n\t\t\t// like the word before the selection. Also, the content inside the textarea\n\t\t\t// can grow or shrink as composition occurs. We therefore anchor the textarea\n\t\t\t// in terms of distance to a certain line start and line end.\n\t\t\t//\n\t\t\t// (2) Also, we should not make \\t characters visible, because their rendering\n\t\t\t// inside the <textarea> will not align nicely with our rendering. We therefore\n\t\t\t// will hide (if necessary) some of the leading text on the current line.\n\n\t\t\tconst ta = this.textArea.domNode;\n\t\t\tconst modelSelection = this._modelSelections[0];\n\n\t\t\tconst { distanceToModelLineStart, widthOfHiddenTextBefore } = (() => {\n\t\t\t\t// Find the text that is on the current line before the selection\n\t\t\t\tconst textBeforeSelection = ta.value.substring(0, Math.min(ta.selectionStart, ta.selectionEnd));\n\t\t\t\tconst lineFeedOffset1 = textBeforeSelection.lastIndexOf('\\n');\n\t\t\t\tconst lineTextBeforeSelection = textBeforeSelection.substring(lineFeedOffset1 + 1);\n\n\t\t\t\t// We now search to see if we should hide some part of it (if it contains \\t)\n\t\t\t\tconst tabOffset1 = lineTextBeforeSelection.lastIndexOf('\\t');\n\t\t\t\tconst desiredVisibleBeforeCharCount = lineTextBeforeSelection.length - tabOffset1 - 1;\n\t\t\t\tconst startModelPosition = modelSelection.getStartPosition();\n\t\t\t\tconst visibleBeforeCharCount = Math.min(startModelPosition.column - 1, desiredVisibleBeforeCharCount);\n\t\t\t\tconst distanceToModelLineStart = startModelPosition.column - 1 - visibleBeforeCharCount;\n\t\t\t\tconst hiddenLineTextBefore = lineTextBeforeSelection.substring(0, lineTextBeforeSelection.length - visibleBeforeCharCount);\n\t\t\t\tconst widthOfHiddenTextBefore = measureText(hiddenLineTextBefore, this._fontInfo);\n\n\t\t\t\treturn { distanceToModelLineStart, widthOfHiddenTextBefore };\n\t\t\t})();\n\n\t\t\tconst { distanceToModelLineEnd } = (() => {\n\t\t\t\t// Find the text that is on the current line after the selection\n\t\t\t\tconst textAfterSelection = ta.value.substring(Math.max(ta.selectionStart, ta.selectionEnd));\n\t\t\t\tconst lineFeedOffset2 = textAfterSelection.indexOf('\\n');\n\t\t\t\tconst lineTextAfterSelection = lineFeedOffset2 === -1 ? textAfterSelection : textAfterSelection.substring(0, lineFeedOffset2);\n\n\t\t\t\tconst tabOffset2 = lineTextAfterSelection.indexOf('\\t');\n\t\t\t\tconst desiredVisibleAfterCharCount = (tabOffset2 === -1 ? lineTextAfterSelection.length : lineTextAfterSelection.length - tabOffset2 - 1);\n\t\t\t\tconst endModelPosition = modelSelection.getEndPosition();\n\t\t\t\tconst visibleAfterCharCount = Math.min(this._context.viewModel.model.getLineMaxColumn(endModelPosition.lineNumber) - endModelPosition.column, desiredVisibleAfterCharCount);\n\t\t\t\tconst distanceToModelLineEnd = this._context.viewModel.model.getLineMaxColumn(endModelPosition.lineNumber) - endModelPosition.column - visibleAfterCharCount;\n\n\t\t\t\treturn { distanceToModelLineEnd };\n\t\t\t})();\n\n\t\t\t// Scroll to reveal the location in the editor where composition occurs\n\t\t\tthis._context.viewModel.revealRange(\n\t\t\t\t'keyboard',\n\t\t\t\ttrue,\n\t\t\t\tRange.fromPositions(this._selections[0].getStartPosition()),\n\t\t\t\tviewEvents.VerticalRevealType.Simple,\n\t\t\t\tScrollType.Immediate\n\t\t\t);\n\n\t\t\tthis._visibleTextArea = new VisibleTextAreaData(\n\t\t\t\tthis._context,\n\t\t\t\tmodelSelection.startLineNumber,\n\t\t\t\tdistanceToModelLineStart,\n\t\t\t\twidthOfHiddenTextBefore,\n\t\t\t\tdistanceToModelLineEnd,\n\t\t\t);\n\n\t\t\tthis._visibleTextArea.prepareRender(this._visibleRangeProvider);\n\t\t\tthis._render();\n\n\t\t\t// Show the textarea\n\t\t\tthis.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`);\n\n\t\t\tthis._viewController.compositionStart();\n\t\t\tthis._context.viewModel.onCompositionStart();\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCompositionUpdate((e: ICompositionData) => {\n\t\t\tif (!this._visibleTextArea) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._visibleTextArea.prepareRender(this._visibleRangeProvider);\n\t\t\tthis._render();\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCompositionEnd(() => {\n\n\t\t\tthis._visibleTextArea = null;\n\t\t\tthis._render();\n\n\t\t\tthis.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);\n\t\t\tthis._viewController.compositionEnd();\n\t\t\tthis._context.viewModel.onCompositionEnd();\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onFocus(() => {\n\t\t\tthis._context.viewModel.setHasFocus(true);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onBlur(() => {\n\t\t\tthis._context.viewModel.setHasFocus(false);\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _getAndroidWordAtPosition(position: Position): [string, number] {\n\t\tconst ANDROID_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\",.<>/?';\n\t\tconst lineContent = this._context.viewModel.getLineContent(position.lineNumber);\n\t\tconst wordSeparators = getMapForWordSeparators(ANDROID_WORD_SEPARATORS);\n\n\t\tlet goingLeft = true;\n\t\tlet startColumn = position.column;\n\t\tlet goingRight = true;\n\t\tlet endColumn = position.column;\n\t\tlet distance = 0;\n\t\twhile (distance < 50 && (goingLeft || goingRight)) {\n\t\t\tif (goingLeft && startColumn <= 1) {\n\t\t\t\tgoingLeft = false;\n\t\t\t}\n\t\t\tif (goingLeft) {\n\t\t\t\tconst charCode = lineContent.charCodeAt(startColumn - 2);\n\t\t\t\tconst charClass = wordSeparators.get(charCode);\n\t\t\t\tif (charClass !== WordCharacterClass.Regular) {\n\t\t\t\t\tgoingLeft = false;\n\t\t\t\t} else {\n\t\t\t\t\tstartColumn--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (goingRight && endColumn > lineContent.length) {\n\t\t\t\tgoingRight = false;\n\t\t\t}\n\t\t\tif (goingRight) {\n\t\t\t\tconst charCode = lineContent.charCodeAt(endColumn - 1);\n\t\t\t\tconst charClass = wordSeparators.get(charCode);\n\t\t\t\tif (charClass !== WordCharacterClass.Regular) {\n\t\t\t\t\tgoingRight = false;\n\t\t\t\t} else {\n\t\t\t\t\tendColumn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdistance++;\n\t\t}\n\n\t\treturn [lineContent.substring(startColumn - 1, endColumn - 1), position.column - startColumn];\n\t}\n\n\tprivate _getWordBeforePosition(position: Position): string {\n\t\tconst lineContent = this._context.viewModel.getLineContent(position.lineNumber);\n\t\tconst wordSeparators = getMapForWordSeparators(this._context.configuration.options.get(EditorOption.wordSeparators));\n\n\t\tlet column = position.column;\n\t\tlet distance = 0;\n\t\twhile (column > 1) {\n\t\t\tconst charCode = lineContent.charCodeAt(column - 2);\n\t\t\tconst charClass = wordSeparators.get(charCode);\n\t\t\tif (charClass !== WordCharacterClass.Regular || distance > 50) {\n\t\t\t\treturn lineContent.substring(column - 1, position.column - 1);\n\t\t\t}\n\t\t\tdistance++;\n\t\t\tcolumn--;\n\t\t}\n\t\treturn lineContent.substring(0, position.column - 1);\n\t}\n\n\tprivate _getCharacterBeforePosition(position: Position): string {\n\t\tif (position.column > 1) {\n\t\t\tconst lineContent = this._context.viewModel.getLineContent(position.lineNumber);\n\t\t\tconst charBefore = lineContent.charAt(position.column - 2);\n\t\t\tif (!strings.isHighSurrogate(charBefore.charCodeAt(0))) {\n\t\t\t\treturn charBefore;\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}\n\n\tprivate _getAriaLabel(options: IComputedEditorOptions): string {\n\t\tconst accessibilitySupport = options.get(EditorOption.accessibilitySupport);\n\t\tif (accessibilitySupport === AccessibilitySupport.Disabled) {\n\t\t\treturn nls.localize('accessibilityOffAriaLabel', \"The editor is not accessible at this time. Press {0} for options.\", platform.isLinux ? 'Shift+Alt+F1' : 'Alt+F1');\n\t\t}\n\t\treturn options.get(EditorOption.ariaLabel);\n\t}\n\n\tprivate _setAccessibilityOptions(options: IComputedEditorOptions): void {\n\t\tthis._accessibilitySupport = options.get(EditorOption.accessibilitySupport);\n\t\tconst accessibilityPageSize = options.get(EditorOption.accessibilityPageSize);\n\t\tif (this._accessibilitySupport === AccessibilitySupport.Enabled && accessibilityPageSize === EditorOptions.accessibilityPageSize.defaultValue) {\n\t\t\t// If a screen reader is attached and the default value is not set we shuold automatically increase the page size to 500 for a better experience\n\t\t\tthis._accessibilityPageSize = 500;\n\t\t} else {\n\t\t\tthis._accessibilityPageSize = accessibilityPageSize;\n\t\t}\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis._setAccessibilityOptions(options);\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentHeight = layoutInfo.height;\n\t\tthis._fontInfo = options.get(EditorOption.fontInfo);\n\t\tthis._lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.textArea.setAttribute('aria-label', this._getAriaLabel(options));\n\t\tthis.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex)));\n\n\t\tif (e.hasChanged(EditorOption.domReadOnly) || e.hasChanged(EditorOption.readOnly)) {\n\t\t\tif (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {\n\t\t\t\tthis.textArea.setAttribute('readonly', 'true');\n\t\t\t} else {\n\t\t\t\tthis.textArea.removeAttribute('readonly');\n\t\t\t}\n\t\t}\n\n\t\tif (e.hasChanged(EditorOption.accessibilitySupport)) {\n\t\t\tthis._textAreaInput.writeScreenReaderContent('strategy changed');\n\t\t}\n\n\t\treturn true;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections.slice(0);\n\t\tthis._modelSelections = e.modelSelections.slice(0);\n\t\tthis._textAreaInput.writeScreenReaderContent('selection changed');\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tthis._scrollLeft = e.scrollLeft;\n\t\tthis._scrollTop = e.scrollTop;\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\t// --- begin view API\n\n\tpublic isFocused(): boolean {\n\t\treturn this._textAreaInput.isFocused();\n\t}\n\n\tpublic focusTextArea(): void {\n\t\tthis._textAreaInput.focusTextArea();\n\t}\n\n\tpublic getLastRenderData(): Position | null {\n\t\treturn this._lastRenderPosition;\n\t}\n\n\tpublic setAriaOptions(options: IEditorAriaOptions): void {\n\t\tif (options.activeDescendant) {\n\t\t\tthis.textArea.setAttribute('aria-haspopup', 'true');\n\t\t\tthis.textArea.setAttribute('aria-autocomplete', 'list');\n\t\t\tthis.textArea.setAttribute('aria-activedescendant', options.activeDescendant);\n\t\t} else {\n\t\t\tthis.textArea.setAttribute('aria-haspopup', 'false');\n\t\t\tthis.textArea.setAttribute('aria-autocomplete', 'both');\n\t\t\tthis.textArea.removeAttribute('aria-activedescendant');\n\t\t}\n\t\tif (options.role) {\n\t\t\tthis.textArea.setAttribute('role', options.role);\n\t\t}\n\t}\n\n\t// --- end view API\n\n\tprivate _primaryCursorPosition: Position = new Position(1, 1);\n\tprivate _primaryCursorVisibleRange: HorizontalPosition | null = null;\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._primaryCursorPosition = new Position(this._selections[0].positionLineNumber, this._selections[0].positionColumn);\n\t\tthis._primaryCursorVisibleRange = ctx.visibleRangeForPosition(this._primaryCursorPosition);\n\t\tif (this._visibleTextArea) {\n\t\t\tthis._visibleTextArea.prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tthis._textAreaInput.writeScreenReaderContent('render');\n\t\tthis._render();\n\t}\n\n\tprivate _render(): void {\n\t\tif (this._visibleTextArea) {\n\t\t\t// The text area is visible for composition reasons\n\n\t\t\tconst visibleStart = this._visibleTextArea.visibleTextareaStart;\n\t\t\tconst visibleEnd = this._visibleTextArea.visibleTextareaEnd;\n\t\t\tconst startPosition = this._visibleTextArea.startPosition;\n\t\t\tconst endPosition = this._visibleTextArea.endPosition;\n\t\t\tif (startPosition && endPosition && visibleStart && visibleEnd && visibleEnd.left >= this._scrollLeft && visibleStart.left <= this._scrollLeft + this._contentWidth) {\n\t\t\t\tconst top = (this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber) - this._scrollTop);\n\t\t\t\tconst lineCount = this._newlinecount(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart));\n\n\t\t\t\tlet scrollLeft = this._visibleTextArea.widthOfHiddenLineTextBefore;\n\t\t\t\tlet left = (this._contentLeft + visibleStart.left - this._scrollLeft);\n\t\t\t\t// See https://github.com/microsoft/vscode/issues/141725#issuecomment-1050670841\n\t\t\t\t// Here we are adding +1 to avoid flickering that might be caused by having a width that is too small.\n\t\t\t\t// This could be caused by rounding errors that might only show up with certain font families.\n\t\t\t\t// In other words, a pixel might be lost when doing something like\n\t\t\t\t// `Math.round(end) - Math.round(start)`\n\t\t\t\t// vs\n\t\t\t\t// `Math.round(end - start)`\n\t\t\t\tlet width = visibleEnd.left - visibleStart.left + 1;\n\t\t\t\tif (left < this._contentLeft) {\n\t\t\t\t\t// the textarea would be rendered on top of the margin,\n\t\t\t\t\t// so reduce its width. We use the same technique as\n\t\t\t\t\t// for hiding text before\n\t\t\t\t\tconst delta = (this._contentLeft - left);\n\t\t\t\t\tleft += delta;\n\t\t\t\t\tscrollLeft += delta;\n\t\t\t\t\twidth -= delta;\n\t\t\t\t}\n\t\t\t\tif (width > this._contentWidth) {\n\t\t\t\t\t// the textarea would be wider than the content width,\n\t\t\t\t\t// so reduce its width.\n\t\t\t\t\twidth = this._contentWidth;\n\t\t\t\t}\n\n\t\t\t\t// Try to render the textarea with the color/font style to match the text under it\n\t\t\t\tconst viewLineData = this._context.viewModel.getViewLineData(startPosition.lineNumber);\n\t\t\t\tconst startTokenIndex = viewLineData.tokens.findTokenIndexAtOffset(startPosition.column - 1);\n\t\t\t\tconst endTokenIndex = viewLineData.tokens.findTokenIndexAtOffset(endPosition.column - 1);\n\t\t\t\tconst textareaSpansSingleToken = (startTokenIndex === endTokenIndex);\n\t\t\t\tconst presentation = this._visibleTextArea.definePresentation(\n\t\t\t\t\t(textareaSpansSingleToken ? viewLineData.tokens.getPresentation(startTokenIndex) : null)\n\t\t\t\t);\n\n\t\t\t\tthis.textArea.domNode.scrollTop = lineCount * this._lineHeight;\n\t\t\t\tthis.textArea.domNode.scrollLeft = scrollLeft;\n\n\t\t\t\tthis._doRender({\n\t\t\t\t\tlastRenderPosition: null,\n\t\t\t\t\ttop: top,\n\t\t\t\t\tleft: left,\n\t\t\t\t\twidth: width,\n\t\t\t\t\theight: this._lineHeight,\n\t\t\t\t\tuseCover: false,\n\t\t\t\t\tcolor: (TokenizationRegistry.getColorMap() || [])[presentation.foreground],\n\t\t\t\t\titalic: presentation.italic,\n\t\t\t\t\tbold: presentation.bold,\n\t\t\t\t\tunderline: presentation.underline,\n\t\t\t\t\tstrikethrough: presentation.strikethrough\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._primaryCursorVisibleRange) {\n\t\t\t// The primary cursor is outside the viewport => place textarea to the top left\n\t\t\tthis._renderAtTopLeft();\n\t\t\treturn;\n\t\t}\n\n\t\tconst left = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft;\n\t\tif (left < this._contentLeft || left > this._contentLeft + this._contentWidth) {\n\t\t\t// cursor is outside the viewport\n\t\t\tthis._renderAtTopLeft();\n\t\t\treturn;\n\t\t}\n\n\t\tconst top = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop;\n\t\tif (top < 0 || top > this._contentHeight) {\n\t\t\t// cursor is outside the viewport\n\t\t\tthis._renderAtTopLeft();\n\t\t\treturn;\n\t\t}\n\n\t\t// The primary cursor is in the viewport (at least vertically) => place textarea on the cursor\n\n\t\tif (platform.isMacintosh) {\n\t\t\t// For the popup emoji input, we will make the text area as high as the line height\n\t\t\t// We will also make the fontSize and lineHeight the correct dimensions to help with the placement of these pickers\n\t\t\tthis._doRender({\n\t\t\t\tlastRenderPosition: this._primaryCursorPosition,\n\t\t\t\ttop: top,\n\t\t\t\tleft: left,\n\t\t\t\twidth: (canUseZeroSizeTextarea ? 0 : 1),\n\t\t\t\theight: this._lineHeight,\n\t\t\t\tuseCover: false\n\t\t\t});\n\t\t\t// In case the textarea contains a word, we're going to try to align the textarea's cursor\n\t\t\t// with our cursor by scrolling the textarea as much as possible\n\t\t\tthis.textArea.domNode.scrollLeft = this._primaryCursorVisibleRange.left;\n\t\t\tconst lineCount = this._newlinecount(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart));\n\t\t\tthis.textArea.domNode.scrollTop = lineCount * this._lineHeight;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._doRender({\n\t\t\tlastRenderPosition: this._primaryCursorPosition,\n\t\t\ttop: top,\n\t\t\tleft: left,\n\t\t\twidth: (canUseZeroSizeTextarea ? 0 : 1),\n\t\t\theight: (canUseZeroSizeTextarea ? 0 : 1),\n\t\t\tuseCover: false\n\t\t});\n\t}\n\n\tprivate _newlinecount(text: string): number {\n\t\tlet result = 0;\n\t\tlet startIndex = -1;\n\t\tdo {\n\t\t\tstartIndex = text.indexOf('\\n', startIndex + 1);\n\t\t\tif (startIndex === -1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tresult++;\n\t\t} while (true);\n\t\treturn result;\n\t}\n\n\tprivate _renderAtTopLeft(): void {\n\t\t// (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea)\n\t\t// specifically, when doing Korean IME, setting the textarea to 0x0 breaks IME badly.\n\t\tthis._doRender({\n\t\t\tlastRenderPosition: null,\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: (canUseZeroSizeTextarea ? 0 : 1),\n\t\t\theight: (canUseZeroSizeTextarea ? 0 : 1),\n\t\t\tuseCover: true\n\t\t});\n\t}\n\n\tprivate _doRender(renderData: IRenderData): void {\n\t\tthis._lastRenderPosition = renderData.lastRenderPosition;\n\n\t\tconst ta = this.textArea;\n\t\tconst tac = this.textAreaCover;\n\n\t\tapplyFontInfo(ta, this._fontInfo);\n\t\tta.setTop(renderData.top);\n\t\tta.setLeft(renderData.left);\n\t\tta.setWidth(renderData.width);\n\t\tta.setHeight(renderData.height);\n\n\t\tta.setColor(renderData.color ? Color.Format.CSS.formatHex(renderData.color) : '');\n\t\tta.setFontStyle(renderData.italic ? 'italic' : '');\n\t\tif (renderData.bold) {\n\t\t\t// fontWeight is also set by `applyFontInfo`, so only overwrite it if necessary\n\t\t\tta.setFontWeight('bold');\n\t\t}\n\t\tta.setTextDecoration(`${renderData.underline ? ' underline' : ''}${renderData.strikethrough ? ' line-through' : ''}`);\n\n\t\ttac.setTop(renderData.useCover ? renderData.top : 0);\n\t\ttac.setLeft(renderData.useCover ? renderData.left : 0);\n\t\ttac.setWidth(renderData.useCover ? renderData.width : 0);\n\t\ttac.setHeight(renderData.useCover ? renderData.height : 0);\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (options.get(EditorOption.glyphMargin)) {\n\t\t\ttac.setClassName('monaco-editor-background textAreaCover ' + Margin.OUTER_CLASS_NAME);\n\t\t} else {\n\t\t\tif (options.get(EditorOption.lineNumbers).renderType !== RenderLineNumbersType.Off) {\n\t\t\t\ttac.setClassName('monaco-editor-background textAreaCover ' + LineNumbersOverlay.CLASS_NAME);\n\t\t\t} else {\n\t\t\t\ttac.setClassName('monaco-editor-background textAreaCover');\n\t\t\t}\n\t\t}\n\t}\n}\n\ninterface IRenderData {\n\tlastRenderPosition: Position | null;\n\ttop: number;\n\tleft: number;\n\twidth: number;\n\theight: number;\n\tuseCover: boolean;\n\n\tcolor?: Color | null;\n\titalic?: boolean;\n\tbold?: boolean;\n\tunderline?: boolean;\n\tstrikethrough?: boolean;\n}\n\nfunction measureText(text: string, fontInfo: BareFontInfo): number {\n\tif (text.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst container = document.createElement('div');\n\tcontainer.style.position = 'absolute';\n\tcontainer.style.top = '-50000px';\n\tcontainer.style.width = '50000px';\n\n\tconst regularDomNode = document.createElement('span');\n\tapplyFontInfo(regularDomNode, fontInfo);\n\tregularDomNode.style.whiteSpace = 'pre'; // just like the textarea\n\tregularDomNode.append(text);\n\tcontainer.appendChild(regularDomNode);\n\n\tdocument.body.appendChild(container);\n\n\tconst res = regularDomNode.offsetWidth;\n\n\tdocument.body.removeChild(container);\n\n\treturn res;\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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { Color } from 'vs/base/common/color';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { TokenizationRegistry } from 'vs/editor/common/languages';\nimport { editorCursorForeground, editorOverviewRulerBorder, editorOverviewRulerBackground } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport { EditorTheme } from 'vs/editor/common/editorTheme';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { OverviewRulerDecorationsGroup } from 'vs/editor/common/viewModel';\n\nclass Settings {\n\n\tpublic readonly lineHeight: number;\n\tpublic readonly pixelRatio: number;\n\tpublic readonly overviewRulerLanes: number;\n\n\tpublic readonly renderBorder: boolean;\n\tpublic readonly borderColor: string | null;\n\n\tpublic readonly hideCursor: boolean;\n\tpublic readonly cursorColor: string | null;\n\n\tpublic readonly themeType: 'light' | 'dark' | 'hc';\n\tpublic readonly backgroundColor: string | null;\n\n\tpublic readonly top: number;\n\tpublic readonly right: number;\n\tpublic readonly domWidth: number;\n\tpublic readonly domHeight: number;\n\tpublic readonly canvasWidth: number;\n\tpublic readonly canvasHeight: number;\n\n\tpublic readonly x: number[];\n\tpublic readonly w: number[];\n\n\tconstructor(config: IEditorConfiguration, theme: EditorTheme) {\n\t\tconst options = config.options;\n\t\tthis.lineHeight = options.get(EditorOption.lineHeight);\n\t\tthis.pixelRatio = options.get(EditorOption.pixelRatio);\n\t\tthis.overviewRulerLanes = options.get(EditorOption.overviewRulerLanes);\n\n\t\tthis.renderBorder = options.get(EditorOption.overviewRulerBorder);\n\t\tconst borderColor = theme.getColor(editorOverviewRulerBorder);\n\t\tthis.borderColor = borderColor ? borderColor.toString() : null;\n\n\t\tthis.hideCursor = options.get(EditorOption.hideCursorInOverviewRuler);\n\t\tconst cursorColor = theme.getColor(editorCursorForeground);\n\t\tthis.cursorColor = cursorColor ? cursorColor.transparent(0.7).toString() : null;\n\n\t\tthis.themeType = theme.type;\n\n\t\tconst minimapOpts = options.get(EditorOption.minimap);\n\t\tconst minimapEnabled = minimapOpts.enabled;\n\t\tconst minimapSide = minimapOpts.side;\n\t\tconst backgroundColor = minimapEnabled\n\t\t\t? theme.getColor(editorOverviewRulerBackground) || TokenizationRegistry.getDefaultBackground()\n\t\t\t: null;\n\n\t\tif (backgroundColor === null || minimapSide === 'left') {\n\t\t\tthis.backgroundColor = null;\n\t\t} else {\n\t\t\tthis.backgroundColor = Color.Format.CSS.formatHex(backgroundColor);\n\t\t}\n\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst position = layoutInfo.overviewRuler;\n\t\tthis.top = position.top;\n\t\tthis.right = position.right;\n\t\tthis.domWidth = position.width;\n\t\tthis.domHeight = position.height;\n\t\tif (this.overviewRulerLanes === 0) {\n\t\t\t// overview ruler is off\n\t\t\tthis.canvasWidth = 0;\n\t\t\tthis.canvasHeight = 0;\n\t\t} else {\n\t\t\tthis.canvasWidth = (this.domWidth * this.pixelRatio) | 0;\n\t\t\tthis.canvasHeight = (this.domHeight * this.pixelRatio) | 0;\n\t\t}\n\n\t\tconst [x, w] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes);\n\t\tthis.x = x;\n\t\tthis.w = w;\n\t}\n\n\tprivate _initLanes(canvasLeftOffset: number, canvasWidth: number, laneCount: number): [number[], number[]] {\n\t\tconst remainingWidth = canvasWidth - canvasLeftOffset;\n\n\t\tif (laneCount >= 3) {\n\t\t\tconst leftWidth = Math.floor(remainingWidth / 3);\n\t\t\tconst rightWidth = Math.floor(remainingWidth / 3);\n\t\t\tconst centerWidth = remainingWidth - leftWidth - rightWidth;\n\t\t\tconst leftOffset = canvasLeftOffset;\n\t\t\tconst centerOffset = leftOffset + leftWidth;\n\t\t\tconst rightOffset = leftOffset + leftWidth + centerWidth;\n\n\t\t\treturn [\n\t\t\t\t[\n\t\t\t\t\t0,\n\t\t\t\t\tleftOffset, // Left\n\t\t\t\t\tcenterOffset, // Center\n\t\t\t\t\tleftOffset, // Left | Center\n\t\t\t\t\trightOffset, // Right\n\t\t\t\t\tleftOffset, // Left | Right\n\t\t\t\t\tcenterOffset, // Center | Right\n\t\t\t\t\tleftOffset, // Left | Center | Right\n\t\t\t\t], [\n\t\t\t\t\t0,\n\t\t\t\t\tleftWidth, // Left\n\t\t\t\t\tcenterWidth, // Center\n\t\t\t\t\tleftWidth + centerWidth, // Left | Center\n\t\t\t\t\trightWidth, // Right\n\t\t\t\t\tleftWidth + centerWidth + rightWidth, // Left | Right\n\t\t\t\t\tcenterWidth + rightWidth, // Center | Right\n\t\t\t\t\tleftWidth + centerWidth + rightWidth, // Left | Center | Right\n\t\t\t\t]\n\t\t\t];\n\t\t} else if (laneCount === 2) {\n\t\t\tconst leftWidth = Math.floor(remainingWidth / 2);\n\t\t\tconst rightWidth = remainingWidth - leftWidth;\n\t\t\tconst leftOffset = canvasLeftOffset;\n\t\t\tconst rightOffset = leftOffset + leftWidth;\n\n\t\t\treturn [\n\t\t\t\t[\n\t\t\t\t\t0,\n\t\t\t\t\tleftOffset, // Left\n\t\t\t\t\tleftOffset, // Center\n\t\t\t\t\tleftOffset, // Left | Center\n\t\t\t\t\trightOffset, // Right\n\t\t\t\t\tleftOffset, // Left | Right\n\t\t\t\t\tleftOffset, // Center | Right\n\t\t\t\t\tleftOffset, // Left | Center | Right\n\t\t\t\t], [\n\t\t\t\t\t0,\n\t\t\t\t\tleftWidth, // Left\n\t\t\t\t\tleftWidth, // Center\n\t\t\t\t\tleftWidth, // Left | Center\n\t\t\t\t\trightWidth, // Right\n\t\t\t\t\tleftWidth + rightWidth, // Left | Right\n\t\t\t\t\tleftWidth + rightWidth, // Center | Right\n\t\t\t\t\tleftWidth + rightWidth, // Left | Center | Right\n\t\t\t\t]\n\t\t\t];\n\t\t} else {\n\t\t\tconst offset = canvasLeftOffset;\n\t\t\tconst width = remainingWidth;\n\n\t\t\treturn [\n\t\t\t\t[\n\t\t\t\t\t0,\n\t\t\t\t\toffset, // Left\n\t\t\t\t\toffset, // Center\n\t\t\t\t\toffset, // Left | Center\n\t\t\t\t\toffset, // Right\n\t\t\t\t\toffset, // Left | Right\n\t\t\t\t\toffset, // Center | Right\n\t\t\t\t\toffset, // Left | Center | Right\n\t\t\t\t], [\n\t\t\t\t\t0,\n\t\t\t\t\twidth, // Left\n\t\t\t\t\twidth, // Center\n\t\t\t\t\twidth, // Left | Center\n\t\t\t\t\twidth, // Right\n\t\t\t\t\twidth, // Left | Right\n\t\t\t\t\twidth, // Center | Right\n\t\t\t\t\twidth, // Left | Center | Right\n\t\t\t\t]\n\t\t\t];\n\t\t}\n\t}\n\n\tpublic equals(other: Settings): boolean {\n\t\treturn (\n\t\t\tthis.lineHeight === other.lineHeight\n\t\t\t&& this.pixelRatio === other.pixelRatio\n\t\t\t&& this.overviewRulerLanes === other.overviewRulerLanes\n\t\t\t&& this.renderBorder === other.renderBorder\n\t\t\t&& this.borderColor === other.borderColor\n\t\t\t&& this.hideCursor === other.hideCursor\n\t\t\t&& this.cursorColor === other.cursorColor\n\t\t\t&& this.themeType === other.themeType\n\t\t\t&& this.backgroundColor === other.backgroundColor\n\t\t\t&& this.top === other.top\n\t\t\t&& this.right === other.right\n\t\t\t&& this.domWidth === other.domWidth\n\t\t\t&& this.domHeight === other.domHeight\n\t\t\t&& this.canvasWidth === other.canvasWidth\n\t\t\t&& this.canvasHeight === other.canvasHeight\n\t\t);\n\t}\n}\n\nconst enum Constants {\n\tMIN_DECORATION_HEIGHT = 6\n}\n\nconst enum OverviewRulerLane {\n\tLeft = 1,\n\tCenter = 2,\n\tRight = 4,\n\tFull = 7\n}\n\nexport class DecorationsOverviewRuler extends ViewPart {\n\n\tprivate readonly _tokensColorTrackerListener: IDisposable;\n\tprivate readonly _domNode: FastDomNode<HTMLCanvasElement>;\n\tprivate _settings!: Settings;\n\tprivate _cursorPositions: Position[];\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tthis._domNode = createFastDomNode(document.createElement('canvas'));\n\t\tthis._domNode.setClassName('decorationsOverviewRuler');\n\t\tthis._domNode.setPosition('absolute');\n\t\tthis._domNode.setLayerHinting(true);\n\t\tthis._domNode.setContain('strict');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._updateSettings(false);\n\n\t\tthis._tokensColorTrackerListener = TokenizationRegistry.onDidChange((e) => {\n\t\t\tif (e.changedColorMap) {\n\t\t\t\tthis._updateSettings(true);\n\t\t\t}\n\t\t});\n\n\t\tthis._cursorPositions = [];\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._tokensColorTrackerListener.dispose();\n\t}\n\n\tprivate _updateSettings(renderNow: boolean): boolean {\n\t\tconst newSettings = new Settings(this._context.configuration, this._context.theme);\n\t\tif (this._settings && this._settings.equals(newSettings)) {\n\t\t\t// nothing to do\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._settings = newSettings;\n\n\t\tthis._domNode.setTop(this._settings.top);\n\t\tthis._domNode.setRight(this._settings.right);\n\t\tthis._domNode.setWidth(this._settings.domWidth);\n\t\tthis._domNode.setHeight(this._settings.domHeight);\n\t\tthis._domNode.domNode.width = this._settings.canvasWidth;\n\t\tthis._domNode.domNode.height = this._settings.canvasHeight;\n\n\t\tif (renderNow) {\n\t\t\tthis._render();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn this._updateSettings(false);\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._cursorPositions = [];\n\t\tfor (let i = 0, len = e.selections.length; i < len; i++) {\n\t\t\tthis._cursorPositions[i] = e.selections[i].getPosition();\n\t\t}\n\t\tthis._cursorPositions.sort(Position.compare);\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\tif (e.affectsOverviewRuler) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollHeightChanged;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\treturn this._updateSettings(false);\n\t}\n\n\t// ---- end view event handlers\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode.domNode;\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tpublic render(editorCtx: RestrictedRenderingContext): void {\n\t\tthis._render();\n\t}\n\n\tprivate _render(): void {\n\t\tif (this._settings.overviewRulerLanes === 0) {\n\t\t\t// overview ruler is off\n\t\t\tthis._domNode.setBackgroundColor(this._settings.backgroundColor ? this._settings.backgroundColor : '');\n\t\t\tthis._domNode.setDisplay('none');\n\t\t\treturn;\n\t\t}\n\t\tthis._domNode.setDisplay('block');\n\t\tconst canvasWidth = this._settings.canvasWidth;\n\t\tconst canvasHeight = this._settings.canvasHeight;\n\t\tconst lineHeight = this._settings.lineHeight;\n\t\tconst viewLayout = this._context.viewLayout;\n\t\tconst outerHeight = this._context.viewLayout.getScrollHeight();\n\t\tconst heightRatio = canvasHeight / outerHeight;\n\t\tconst decorations = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);\n\n\t\tconst minDecorationHeight = (Constants.MIN_DECORATION_HEIGHT * this._settings.pixelRatio) | 0;\n\t\tconst halfMinDecorationHeight = (minDecorationHeight / 2) | 0;\n\n\t\tconst canvasCtx = this._domNode.domNode.getContext('2d')!;\n\t\tif (this._settings.backgroundColor === null) {\n\t\t\tcanvasCtx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t} else {\n\t\t\tcanvasCtx.fillStyle = this._settings.backgroundColor;\n\t\t\tcanvasCtx.fillRect(0, 0, canvasWidth, canvasHeight);\n\t\t}\n\n\t\tconst x = this._settings.x;\n\t\tconst w = this._settings.w;\n\n\t\tdecorations.sort(OverviewRulerDecorationsGroup.cmp);\n\n\t\tfor (const decorationGroup of decorations) {\n\t\t\tconst color = decorationGroup.color;\n\t\t\tconst decorationGroupData = decorationGroup.data;\n\n\t\t\tcanvasCtx.fillStyle = color;\n\n\t\t\tlet prevLane = 0;\n\t\t\tlet prevY1 = 0;\n\t\t\tlet prevY2 = 0;\n\t\t\tfor (let i = 0, len = decorationGroupData.length / 3; i < len; i++) {\n\t\t\t\tconst lane = decorationGroupData[3 * i];\n\t\t\t\tconst startLineNumber = decorationGroupData[3 * i + 1];\n\t\t\t\tconst endLineNumber = decorationGroupData[3 * i + 2];\n\n\t\t\t\tlet y1 = (viewLayout.getVerticalOffsetForLineNumber(startLineNumber) * heightRatio) | 0;\n\t\t\t\tlet y2 = ((viewLayout.getVerticalOffsetForLineNumber(endLineNumber) + lineHeight) * heightRatio) | 0;\n\t\t\t\tconst height = y2 - y1;\n\t\t\t\tif (height < minDecorationHeight) {\n\t\t\t\t\tlet yCenter = ((y1 + y2) / 2) | 0;\n\t\t\t\t\tif (yCenter < halfMinDecorationHeight) {\n\t\t\t\t\t\tyCenter = halfMinDecorationHeight;\n\t\t\t\t\t} else if (yCenter + halfMinDecorationHeight > canvasHeight) {\n\t\t\t\t\t\tyCenter = canvasHeight - halfMinDecorationHeight;\n\t\t\t\t\t}\n\t\t\t\t\ty1 = yCenter - halfMinDecorationHeight;\n\t\t\t\t\ty2 = yCenter + halfMinDecorationHeight;\n\t\t\t\t}\n\n\t\t\t\tif (y1 > prevY2 + 1 || lane !== prevLane) {\n\t\t\t\t\t// flush prev\n\t\t\t\t\tif (i !== 0) {\n\t\t\t\t\t\tcanvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1);\n\t\t\t\t\t}\n\t\t\t\t\tprevLane = lane;\n\t\t\t\t\tprevY1 = y1;\n\t\t\t\t\tprevY2 = y2;\n\t\t\t\t} else {\n\t\t\t\t\t// merge into prev\n\t\t\t\t\tif (y2 > prevY2) {\n\t\t\t\t\t\tprevY2 = y2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcanvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1);\n\t\t}\n\n\t\t// Draw cursors\n\t\tif (!this._settings.hideCursor && this._settings.cursorColor) {\n\t\t\tconst cursorHeight = (2 * this._settings.pixelRatio) | 0;\n\t\t\tconst halfCursorHeight = (cursorHeight / 2) | 0;\n\t\t\tconst cursorX = this._settings.x[OverviewRulerLane.Full];\n\t\t\tconst cursorW = this._settings.w[OverviewRulerLane.Full];\n\t\t\tcanvasCtx.fillStyle = this._settings.cursorColor;\n\n\t\t\tlet prevY1 = -100;\n\t\t\tlet prevY2 = -100;\n\t\t\tfor (let i = 0, len = this._cursorPositions.length; i < len; i++) {\n\t\t\t\tconst cursor = this._cursorPositions[i];\n\n\t\t\t\tlet yCenter = (viewLayout.getVerticalOffsetForLineNumber(cursor.lineNumber) * heightRatio) | 0;\n\t\t\t\tif (yCenter < halfCursorHeight) {\n\t\t\t\t\tyCenter = halfCursorHeight;\n\t\t\t\t} else if (yCenter + halfCursorHeight > canvasHeight) {\n\t\t\t\t\tyCenter = canvasHeight - halfCursorHeight;\n\t\t\t\t}\n\t\t\t\tconst y1 = yCenter - halfCursorHeight;\n\t\t\t\tconst y2 = y1 + cursorHeight;\n\n\t\t\t\tif (y1 > prevY2 + 1) {\n\t\t\t\t\t// flush prev\n\t\t\t\t\tif (i !== 0) {\n\t\t\t\t\t\tcanvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1);\n\t\t\t\t\t}\n\t\t\t\t\tprevY1 = y1;\n\t\t\t\t\tprevY2 = y2;\n\t\t\t\t} else {\n\t\t\t\t\t// merge into prev\n\t\t\t\t\tif (y2 > prevY2) {\n\t\t\t\t\t\tprevY2 = y2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcanvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1);\n\t\t}\n\n\t\tif (this._settings.renderBorder && this._settings.borderColor && this._settings.overviewRulerLanes > 0) {\n\t\t\tcanvasCtx.beginPath();\n\t\t\tcanvasCtx.lineWidth = 1;\n\t\t\tcanvasCtx.strokeStyle = this._settings.borderColor;\n\t\t\tcanvasCtx.moveTo(0, 0);\n\t\t\tcanvasCtx.lineTo(0, canvasHeight);\n\t\t\tcanvasCtx.stroke();\n\n\t\t\tcanvasCtx.moveTo(0, 0);\n\t\t\tcanvasCtx.lineTo(canvasWidth, 0);\n\t\t\tcanvasCtx.stroke();\n\t\t}\n\t}\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 'vs/css!./rulers';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { editorRuler } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { EditorOption, IRulerOption } from 'vs/editor/common/config/editorOptions';\n\nexport class Rulers extends ViewPart {\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _renderedRulers: FastDomNode<HTMLElement>[];\n\tprivate _rulers: IRulerOption[];\n\tprivate _typicalHalfwidthCharacterWidth: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\t\tthis.domNode = createFastDomNode<HTMLElement>(document.createElement('div'));\n\t\tthis.domNode.setAttribute('role', 'presentation');\n\t\tthis.domNode.setAttribute('aria-hidden', 'true');\n\t\tthis.domNode.setClassName('view-rulers');\n\t\tthis._renderedRulers = [];\n\t\tconst options = this._context.configuration.options;\n\t\tthis._rulers = options.get(EditorOption.rulers);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\t\tthis._rulers = options.get(EditorOption.rulers);\n\t\tthis._typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollHeightChanged;\n\t}\n\n\t// --- end event handlers\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\t// Nothing to read\n\t}\n\n\tprivate _ensureRulersCount(): void {\n\t\tconst currentCount = this._renderedRulers.length;\n\t\tconst desiredCount = this._rulers.length;\n\n\t\tif (currentCount === desiredCount) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (currentCount < desiredCount) {\n\t\t\tconst { tabSize } = this._context.viewModel.model.getOptions();\n\t\t\tconst rulerWidth = tabSize;\n\t\t\tlet addCount = desiredCount - currentCount;\n\t\t\twhile (addCount > 0) {\n\t\t\t\tconst node = createFastDomNode(document.createElement('div'));\n\t\t\t\tnode.setClassName('view-ruler');\n\t\t\t\tnode.setWidth(rulerWidth);\n\t\t\t\tthis.domNode.appendChild(node);\n\t\t\t\tthis._renderedRulers.push(node);\n\t\t\t\taddCount--;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet removeCount = currentCount - desiredCount;\n\t\twhile (removeCount > 0) {\n\t\t\tconst node = this._renderedRulers.pop()!;\n\t\t\tthis.domNode.removeChild(node);\n\t\t\tremoveCount--;\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\n\t\tthis._ensureRulersCount();\n\n\t\tfor (let i = 0, len = this._rulers.length; i < len; i++) {\n\t\t\tconst node = this._renderedRulers[i];\n\t\t\tconst ruler = this._rulers[i];\n\n\t\t\tnode.setBoxShadow(ruler.color ? `1px 0 0 0 ${ruler.color} inset` : ``);\n\t\t\tnode.setHeight(Math.min(ctx.scrollHeight, 1000000));\n\t\t\tnode.setLeft(ruler.column * this._typicalHalfwidthCharacterWidth);\n\t\t}\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst rulerColor = theme.getColor(editorRuler);\n\tif (rulerColor) {\n\t\tcollector.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${rulerColor} inset; }`);\n\t}\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 'vs/css!./viewCursors';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IntervalTimer, TimeoutTimer } from 'vs/base/common/async';\nimport { ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { IViewCursorRenderData, ViewCursor } from 'vs/editor/browser/viewParts/viewCursors/viewCursor';\nimport { TextEditorCursorBlinkingStyle, TextEditorCursorStyle, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { editorCursorBackground, editorCursorForeground } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class ViewCursors extends ViewPart {\n\n\tstatic readonly BLINK_INTERVAL = 500;\n\n\tprivate _readOnly: boolean;\n\tprivate _cursorBlinking: TextEditorCursorBlinkingStyle;\n\tprivate _cursorStyle: TextEditorCursorStyle;\n\tprivate _cursorSmoothCaretAnimation: boolean;\n\tprivate _selectionIsEmpty: boolean;\n\tprivate _isComposingInput: boolean;\n\n\tprivate _isVisible: boolean;\n\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\n\tprivate readonly _startCursorBlinkAnimation: TimeoutTimer;\n\tprivate readonly _cursorFlatBlinkInterval: IntervalTimer;\n\tprivate _blinkingEnabled: boolean;\n\n\tprivate _editorHasFocus: boolean;\n\n\tprivate readonly _primaryCursor: ViewCursor;\n\tprivate readonly _secondaryCursors: ViewCursor[];\n\tprivate _renderData: IViewCursorRenderData[];\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tconst options = this._context.configuration.options;\n\t\tthis._readOnly = options.get(EditorOption.readOnly);\n\t\tthis._cursorBlinking = options.get(EditorOption.cursorBlinking);\n\t\tthis._cursorStyle = options.get(EditorOption.cursorStyle);\n\t\tthis._cursorSmoothCaretAnimation = options.get(EditorOption.cursorSmoothCaretAnimation);\n\t\tthis._selectionIsEmpty = true;\n\t\tthis._isComposingInput = false;\n\n\t\tthis._isVisible = false;\n\n\t\tthis._primaryCursor = new ViewCursor(this._context);\n\t\tthis._secondaryCursors = [];\n\t\tthis._renderData = [];\n\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t\tthis._updateDomClassName();\n\n\t\tthis._domNode.appendChild(this._primaryCursor.getDomNode());\n\n\t\tthis._startCursorBlinkAnimation = new TimeoutTimer();\n\t\tthis._cursorFlatBlinkInterval = new IntervalTimer();\n\n\t\tthis._blinkingEnabled = false;\n\n\t\tthis._editorHasFocus = false;\n\t\tthis._updateBlinking();\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._startCursorBlinkAnimation.dispose();\n\t\tthis._cursorFlatBlinkInterval.dispose();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\t// --- begin event handlers\n\tpublic override onCompositionStart(e: viewEvents.ViewCompositionStartEvent): boolean {\n\t\tthis._isComposingInput = true;\n\t\tthis._updateBlinking();\n\t\treturn true;\n\t}\n\tpublic override onCompositionEnd(e: viewEvents.ViewCompositionEndEvent): boolean {\n\t\tthis._isComposingInput = false;\n\t\tthis._updateBlinking();\n\t\treturn true;\n\t}\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst options = this._context.configuration.options;\n\n\t\tthis._readOnly = options.get(EditorOption.readOnly);\n\t\tthis._cursorBlinking = options.get(EditorOption.cursorBlinking);\n\t\tthis._cursorStyle = options.get(EditorOption.cursorStyle);\n\t\tthis._cursorSmoothCaretAnimation = options.get(EditorOption.cursorSmoothCaretAnimation);\n\n\t\tthis._updateBlinking();\n\t\tthis._updateDomClassName();\n\n\t\tthis._primaryCursor.onConfigurationChanged(e);\n\t\tfor (let i = 0, len = this._secondaryCursors.length; i < len; i++) {\n\t\t\tthis._secondaryCursors[i].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tprivate _onCursorPositionChanged(position: Position, secondaryPositions: Position[]): void {\n\t\tthis._primaryCursor.onCursorPositionChanged(position);\n\t\tthis._updateBlinking();\n\n\t\tif (this._secondaryCursors.length < secondaryPositions.length) {\n\t\t\t// Create new cursors\n\t\t\tconst addCnt = secondaryPositions.length - this._secondaryCursors.length;\n\t\t\tfor (let i = 0; i < addCnt; i++) {\n\t\t\t\tconst newCursor = new ViewCursor(this._context);\n\t\t\t\tthis._domNode.domNode.insertBefore(newCursor.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling);\n\t\t\t\tthis._secondaryCursors.push(newCursor);\n\t\t\t}\n\t\t} else if (this._secondaryCursors.length > secondaryPositions.length) {\n\t\t\t// Remove some cursors\n\t\t\tconst removeCnt = this._secondaryCursors.length - secondaryPositions.length;\n\t\t\tfor (let i = 0; i < removeCnt; i++) {\n\t\t\t\tthis._domNode.removeChild(this._secondaryCursors[0].getDomNode());\n\t\t\t\tthis._secondaryCursors.splice(0, 1);\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < secondaryPositions.length; i++) {\n\t\t\tthis._secondaryCursors[i].onCursorPositionChanged(secondaryPositions[i]);\n\t\t}\n\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst positions: Position[] = [];\n\t\tfor (let i = 0, len = e.selections.length; i < len; i++) {\n\t\t\tpositions[i] = e.selections[i].getPosition();\n\t\t}\n\t\tthis._onCursorPositionChanged(positions[0], positions.slice(1));\n\n\t\tconst selectionIsEmpty = e.selections[0].isEmpty();\n\t\tif (this._selectionIsEmpty !== selectionIsEmpty) {\n\t\t\tthis._selectionIsEmpty = selectionIsEmpty;\n\t\t\tthis._updateDomClassName();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis._editorHasFocus = e.isFocused;\n\t\tthis._updateBlinking();\n\t\treturn false;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\tconst shouldRender = (position: Position) => {\n\t\t\tfor (let i = 0, len = e.ranges.length; i < len; i++) {\n\t\t\t\tif (e.ranges[i].fromLineNumber <= position.lineNumber && position.lineNumber <= e.ranges[i].toLineNumber) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t\tif (shouldRender(this._primaryCursor.getPosition())) {\n\t\t\treturn true;\n\t\t}\n\t\tfor (const secondaryCursor of this._secondaryCursors) {\n\t\t\tif (shouldRender(secondaryCursor.getPosition())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// --- end event handlers\n\n\t// ---- blinking logic\n\n\tprivate _getCursorBlinking(): TextEditorCursorBlinkingStyle {\n\t\tif (this._isComposingInput) {\n\t\t\t// avoid double cursors\n\t\t\treturn TextEditorCursorBlinkingStyle.Hidden;\n\t\t}\n\t\tif (!this._editorHasFocus) {\n\t\t\treturn TextEditorCursorBlinkingStyle.Hidden;\n\t\t}\n\t\tif (this._readOnly) {\n\t\t\treturn TextEditorCursorBlinkingStyle.Solid;\n\t\t}\n\t\treturn this._cursorBlinking;\n\t}\n\n\tprivate _updateBlinking(): void {\n\t\tthis._startCursorBlinkAnimation.cancel();\n\t\tthis._cursorFlatBlinkInterval.cancel();\n\n\t\tconst blinkingStyle = this._getCursorBlinking();\n\n\t\t// hidden and solid are special as they involve no animations\n\t\tconst isHidden = (blinkingStyle === TextEditorCursorBlinkingStyle.Hidden);\n\t\tconst isSolid = (blinkingStyle === TextEditorCursorBlinkingStyle.Solid);\n\n\t\tif (isHidden) {\n\t\t\tthis._hide();\n\t\t} else {\n\t\t\tthis._show();\n\t\t}\n\n\t\tthis._blinkingEnabled = false;\n\t\tthis._updateDomClassName();\n\n\t\tif (!isHidden && !isSolid) {\n\t\t\tif (blinkingStyle === TextEditorCursorBlinkingStyle.Blink) {\n\t\t\t\t// flat blinking is handled by JavaScript to save battery life due to Chromium step timing issue https://bugs.chromium.org/p/chromium/issues/detail?id=361587\n\t\t\t\tthis._cursorFlatBlinkInterval.cancelAndSet(() => {\n\t\t\t\t\tif (this._isVisible) {\n\t\t\t\t\t\tthis._hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._show();\n\t\t\t\t\t}\n\t\t\t\t}, ViewCursors.BLINK_INTERVAL);\n\t\t\t} else {\n\t\t\t\tthis._startCursorBlinkAnimation.setIfNotSet(() => {\n\t\t\t\t\tthis._blinkingEnabled = true;\n\t\t\t\t\tthis._updateDomClassName();\n\t\t\t\t}, ViewCursors.BLINK_INTERVAL);\n\t\t\t}\n\t\t}\n\t}\n\t// --- end blinking logic\n\n\tprivate _updateDomClassName(): void {\n\t\tthis._domNode.setClassName(this._getClassName());\n\t}\n\n\tprivate _getClassName(): string {\n\t\tlet result = 'cursors-layer';\n\t\tif (!this._selectionIsEmpty) {\n\t\t\tresult += ' has-selection';\n\t\t}\n\t\tswitch (this._cursorStyle) {\n\t\t\tcase TextEditorCursorStyle.Line:\n\t\t\t\tresult += ' cursor-line-style';\n\t\t\t\tbreak;\n\t\t\tcase TextEditorCursorStyle.Block:\n\t\t\t\tresult += ' cursor-block-style';\n\t\t\t\tbreak;\n\t\t\tcase TextEditorCursorStyle.Underline:\n\t\t\t\tresult += ' cursor-underline-style';\n\t\t\t\tbreak;\n\t\t\tcase TextEditorCursorStyle.LineThin:\n\t\t\t\tresult += ' cursor-line-thin-style';\n\t\t\t\tbreak;\n\t\t\tcase TextEditorCursorStyle.BlockOutline:\n\t\t\t\tresult += ' cursor-block-outline-style';\n\t\t\t\tbreak;\n\t\t\tcase TextEditorCursorStyle.UnderlineThin:\n\t\t\t\tresult += ' cursor-underline-thin-style';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tresult += ' cursor-line-style';\n\t\t}\n\t\tif (this._blinkingEnabled) {\n\t\t\tswitch (this._getCursorBlinking()) {\n\t\t\t\tcase TextEditorCursorBlinkingStyle.Blink:\n\t\t\t\t\tresult += ' cursor-blink';\n\t\t\t\t\tbreak;\n\t\t\t\tcase TextEditorCursorBlinkingStyle.Smooth:\n\t\t\t\t\tresult += ' cursor-smooth';\n\t\t\t\t\tbreak;\n\t\t\t\tcase TextEditorCursorBlinkingStyle.Phase:\n\t\t\t\t\tresult += ' cursor-phase';\n\t\t\t\t\tbreak;\n\t\t\t\tcase TextEditorCursorBlinkingStyle.Expand:\n\t\t\t\t\tresult += ' cursor-expand';\n\t\t\t\t\tbreak;\n\t\t\t\tcase TextEditorCursorBlinkingStyle.Solid:\n\t\t\t\t\tresult += ' cursor-solid';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tresult += ' cursor-solid';\n\t\t\t}\n\t\t} else {\n\t\t\tresult += ' cursor-solid';\n\t\t}\n\t\tif (this._cursorSmoothCaretAnimation) {\n\t\t\tresult += ' cursor-smooth-caret-animation';\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _show(): void {\n\t\tthis._primaryCursor.show();\n\t\tfor (let i = 0, len = this._secondaryCursors.length; i < len; i++) {\n\t\t\tthis._secondaryCursors[i].show();\n\t\t}\n\t\tthis._isVisible = true;\n\t}\n\n\tprivate _hide(): void {\n\t\tthis._primaryCursor.hide();\n\t\tfor (let i = 0, len = this._secondaryCursors.length; i < len; i++) {\n\t\t\tthis._secondaryCursors[i].hide();\n\t\t}\n\t\tthis._isVisible = false;\n\t}\n\n\t// ---- IViewPart implementation\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._primaryCursor.prepareRender(ctx);\n\t\tfor (let i = 0, len = this._secondaryCursors.length; i < len; i++) {\n\t\t\tthis._secondaryCursors[i].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst renderData: IViewCursorRenderData[] = [];\n\t\tlet renderDataLen = 0;\n\n\t\tconst primaryRenderData = this._primaryCursor.render(ctx);\n\t\tif (primaryRenderData) {\n\t\t\trenderData[renderDataLen++] = primaryRenderData;\n\t\t}\n\n\t\tfor (let i = 0, len = this._secondaryCursors.length; i < len; i++) {\n\t\t\tconst secondaryRenderData = this._secondaryCursors[i].render(ctx);\n\t\t\tif (secondaryRenderData) {\n\t\t\t\trenderData[renderDataLen++] = secondaryRenderData;\n\t\t\t}\n\t\t}\n\n\t\tthis._renderData = renderData;\n\t}\n\n\tpublic getLastRenderData(): IViewCursorRenderData[] {\n\t\treturn this._renderData;\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst caret = theme.getColor(editorCursorForeground);\n\tif (caret) {\n\t\tlet caretBackground = theme.getColor(editorCursorBackground);\n\t\tif (!caretBackground) {\n\t\t\tcaretBackground = caret.opposite();\n\t\t}\n\t\tcollector.addRule(`.monaco-editor .inputarea.ime-input { caret-color: ${caret}; }`);\n\t\tcollector.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${caret}; border-color: ${caret}; color: ${caretBackground}; }`);\n\t\tif (theme.type === 'hc') {\n\t\t\tcollector.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${caretBackground}; border-right: 1px solid ${caretBackground}; }`);\n\t\t}\n\t}\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 { Color } from 'vs/base/common/color';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { Range } from 'vs/editor/common/core/range';\nimport { BracketPairColorizationOptions, IModelDecoration } from 'vs/editor/common/model';\nimport { BracketInfo } from 'vs/editor/common/textModelBracketPairs';\nimport { DecorationProvider } from 'vs/editor/common/model/decorationProvider';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport {\n\teditorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketHighlightingUnexpectedBracketForeground } from 'vs/editor/common/core/editorColorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { IModelOptionsChangedEvent } from 'vs/editor/common/textModelEvents';\n\nexport class ColorizedBracketPairsDecorationProvider extends Disposable implements DecorationProvider {\n\tprivate colorizationOptions: BracketPairColorizationOptions;\n\tprivate readonly colorProvider = new ColorProvider();\n\n\tprivate readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tconstructor(private readonly textModel: TextModel) {\n\t\tsuper();\n\n\t\tthis.colorizationOptions = textModel.getOptions().bracketPairColorizationOptions;\n\n\t\tthis._register(textModel.bracketPairs.onDidChange(e => {\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t}));\n\t}\n\n\t//#region TextModel events\n\n\tpublic handleDidChangeOptions(e: IModelOptionsChangedEvent): void {\n\t\tthis.colorizationOptions = this.textModel.getOptions().bracketPairColorizationOptions;\n\t}\n\n\t//#endregion\n\n\tgetDecorationsInRange(range: Range, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\tif (ownerId === undefined) {\n\t\t\treturn [];\n\t\t}\n\t\tif (!this.colorizationOptions.enabled) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst result = new Array<IModelDecoration>();\n\t\tconst bracketsInRange = this.textModel.bracketPairs.getBracketsInRange(range);\n\t\tfor (const bracket of bracketsInRange) {\n\t\t\tresult.push({\n\t\t\t\tid: `bracket${bracket.range.toString()}-${bracket.nestingLevel}`,\n\t\t\t\toptions: { description: 'BracketPairColorization', inlineClassName: this.colorProvider.getInlineClassName(bracket) },\n\t\t\t\townerId: 0,\n\t\t\t\trange: bracket.range\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\tif (ownerId === undefined) {\n\t\t\treturn [];\n\t\t}\n\t\tif (!this.colorizationOptions.enabled) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this.getDecorationsInRange(\n\t\t\tnew Range(1, 1, this.textModel.getLineCount(), 1),\n\t\t\townerId,\n\t\t\tfilterOutValidation\n\t\t);\n\t}\n}\n\nclass ColorProvider {\n\tpublic readonly unexpectedClosingBracketClassName = 'unexpected-closing-bracket';\n\n\tgetInlineClassName(bracket: BracketInfo): string {\n\t\tif (bracket.isInvalid) {\n\t\t\treturn this.unexpectedClosingBracketClassName;\n\t\t}\n\t\treturn this.getInlineClassNameOfLevel(bracket.nestingLevel);\n\t}\n\n\tgetInlineClassNameOfLevel(level: number): string {\n\t\t// To support a dynamic amount of colors up to 6 colors,\n\t\t// we use a number that is a lcm of all numbers from 1 to 6.\n\t\treturn `bracket-highlighting-${level % 30}`;\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst colors = [\n\t\teditorBracketHighlightingForeground1,\n\t\teditorBracketHighlightingForeground2,\n\t\teditorBracketHighlightingForeground3,\n\t\teditorBracketHighlightingForeground4,\n\t\teditorBracketHighlightingForeground5,\n\t\teditorBracketHighlightingForeground6\n\t];\n\tconst colorProvider = new ColorProvider();\n\n\tcollector.addRule(`.monaco-editor .${colorProvider.unexpectedClosingBracketClassName} { color: ${theme.getColor(editorBracketHighlightingUnexpectedBracketForeground)}; }`);\n\n\tconst colorValues = colors\n\t\t.map(c => theme.getColor(c))\n\t\t.filter((c): c is Color => !!c)\n\t\t.filter(c => !c.isTransparent());\n\n\tfor (let level = 0; level < 30; level++) {\n\t\tconst color = colorValues[level % colorValues.length];\n\t\tcollector.addRule(`.monaco-editor .${colorProvider.getInlineClassNameOfLevel(level)} { color: ${color}; }`);\n\t}\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 { IMarkerService, IMarker, MarkerSeverity, MarkerTag } from 'vs/platform/markers/common/markers';\nimport { Disposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { IModelDeltaDecoration, ITextModel, IModelDecorationOptions, TrackedRangeStickiness, OverviewRulerLane, IModelDecoration, MinimapPosition, IModelDecorationMinimapOptions } from 'vs/editor/common/model';\nimport { ClassName } from 'vs/editor/common/model/intervalTree';\nimport { themeColorFromId, ThemeColor } from 'vs/platform/theme/common/themeService';\nimport { overviewRulerWarning, overviewRulerInfo, overviewRulerError } from 'vs/editor/common/core/editorColorRegistry';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations';\nimport { Schemas } from 'vs/base/common/network';\nimport { Emitter } from 'vs/base/common/event';\nimport { minimapWarning, minimapError } from 'vs/platform/theme/common/colorRegistry';\nimport { ResourceMap } from 'vs/base/common/map';\n\n\nclass MarkerDecorations extends Disposable {\n\n\tprivate readonly _markersData: Map<string, IMarker> = new Map<string, IMarker>();\n\n\tconstructor(\n\t\treadonly model: ITextModel\n\t) {\n\t\tsuper();\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis.model.deltaDecorations([...this._markersData.keys()], []);\n\t\t\tthis._markersData.clear();\n\t\t}));\n\t}\n\n\tpublic update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): boolean {\n\t\tconst oldIds = [...this._markersData.keys()];\n\t\tthis._markersData.clear();\n\t\tconst ids = this.model.deltaDecorations(oldIds, newDecorations);\n\t\tfor (let index = 0; index < ids.length; index++) {\n\t\t\tthis._markersData.set(ids[index], markers[index]);\n\t\t}\n\t\treturn oldIds.length !== 0 || ids.length !== 0;\n\t}\n\n\tgetMarker(decoration: IModelDecoration): IMarker | undefined {\n\t\treturn this._markersData.get(decoration.id);\n\t}\n}\n\nexport class MarkerDecorationsService extends Disposable implements IMarkerDecorationsService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onDidChangeMarker = this._register(new Emitter<ITextModel>());\n\n\tprivate readonly _markerDecorations = new ResourceMap<MarkerDecorations>();\n\n\tconstructor(\n\t\t@IModelService modelService: IModelService,\n\t\t@IMarkerService private readonly _markerService: IMarkerService\n\t) {\n\t\tsuper();\n\t\tmodelService.getModels().forEach(model => this._onModelAdded(model));\n\t\tthis._register(modelService.onModelAdded(this._onModelAdded, this));\n\t\tthis._register(modelService.onModelRemoved(this._onModelRemoved, this));\n\t\tthis._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this));\n\t}\n\n\toverride dispose() {\n\t\tsuper.dispose();\n\t\tthis._markerDecorations.forEach(value => value.dispose());\n\t\tthis._markerDecorations.clear();\n\t}\n\n\tgetMarker(uri: URI, decoration: IModelDecoration): IMarker | null {\n\t\tconst markerDecorations = this._markerDecorations.get(uri);\n\t\treturn markerDecorations ? (markerDecorations.getMarker(decoration) || null) : null;\n\t}\n\n\tprivate _handleMarkerChange(changedResources: readonly URI[]): void {\n\t\tchangedResources.forEach((resource) => {\n\t\t\tconst markerDecorations = this._markerDecorations.get(resource);\n\t\t\tif (markerDecorations) {\n\t\t\t\tthis._updateDecorations(markerDecorations);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _onModelAdded(model: ITextModel): void {\n\t\tconst markerDecorations = new MarkerDecorations(model);\n\t\tthis._markerDecorations.set(model.uri, markerDecorations);\n\t\tthis._updateDecorations(markerDecorations);\n\t}\n\n\tprivate _onModelRemoved(model: ITextModel): void {\n\t\tconst markerDecorations = this._markerDecorations.get(model.uri);\n\t\tif (markerDecorations) {\n\t\t\tmarkerDecorations.dispose();\n\t\t\tthis._markerDecorations.delete(model.uri);\n\t\t}\n\n\t\t// clean up markers for internal, transient models\n\t\tif (model.uri.scheme === Schemas.inMemory\n\t\t\t|| model.uri.scheme === Schemas.internal\n\t\t\t|| model.uri.scheme === Schemas.vscode) {\n\t\t\tif (this._markerService) {\n\t\t\t\tthis._markerService.read({ resource: model.uri }).map(marker => marker.owner).forEach(owner => this._markerService.remove(owner, [model.uri]));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _updateDecorations(markerDecorations: MarkerDecorations): void {\n\t\t// Limit to the first 500 errors/warnings\n\t\tconst markers = this._markerService.read({ resource: markerDecorations.model.uri, take: 500 });\n\t\tconst newModelDecorations: IModelDeltaDecoration[] = markers.map((marker) => {\n\t\t\treturn {\n\t\t\t\trange: this._createDecorationRange(markerDecorations.model, marker),\n\t\t\t\toptions: this._createDecorationOption(marker)\n\t\t\t};\n\t\t});\n\t\tif (markerDecorations.update(markers, newModelDecorations)) {\n\t\t\tthis._onDidChangeMarker.fire(markerDecorations.model);\n\t\t}\n\t}\n\n\tprivate _createDecorationRange(model: ITextModel, rawMarker: IMarker): Range {\n\n\t\tlet ret = Range.lift(rawMarker);\n\n\t\tif (rawMarker.severity === MarkerSeverity.Hint && !this._hasMarkerTag(rawMarker, MarkerTag.Unnecessary) && !this._hasMarkerTag(rawMarker, MarkerTag.Deprecated)) {\n\t\t\t// * never render hints on multiple lines\n\t\t\t// * make enough space for three dots\n\t\t\tret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2);\n\t\t}\n\n\t\tret = model.validateRange(ret);\n\n\t\tif (ret.isEmpty()) {\n\t\t\tconst maxColumn = model.getLineLastNonWhitespaceColumn(ret.startLineNumber) ||\n\t\t\t\tmodel.getLineMaxColumn(ret.startLineNumber);\n\n\t\t\tif (maxColumn === 1 || ret.endColumn >= maxColumn) {\n\t\t\t\t// empty line or behind eol\n\t\t\t\t// keep the range as is, it will be rendered 1ch wide\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\tconst word = model.getWordAtPosition(ret.getStartPosition());\n\t\t\tif (word) {\n\t\t\t\tret = new Range(ret.startLineNumber, word.startColumn, ret.endLineNumber, word.endColumn);\n\t\t\t}\n\t\t} else if (rawMarker.endColumn === Number.MAX_VALUE && rawMarker.startColumn === 1 && ret.startLineNumber === ret.endLineNumber) {\n\t\t\tlet minColumn = model.getLineFirstNonWhitespaceColumn(rawMarker.startLineNumber);\n\t\t\tif (minColumn < ret.endColumn) {\n\t\t\t\tret = new Range(ret.startLineNumber, minColumn, ret.endLineNumber, ret.endColumn);\n\t\t\t\trawMarker.startColumn = minColumn;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate _createDecorationOption(marker: IMarker): IModelDecorationOptions {\n\n\t\tlet className: string | undefined;\n\t\tlet color: ThemeColor | undefined = undefined;\n\t\tlet zIndex: number;\n\t\tlet inlineClassName: string | undefined = undefined;\n\t\tlet minimap: IModelDecorationMinimapOptions | undefined;\n\n\t\tswitch (marker.severity) {\n\t\t\tcase MarkerSeverity.Hint:\n\t\t\t\tif (this._hasMarkerTag(marker, MarkerTag.Deprecated)) {\n\t\t\t\t\tclassName = undefined;\n\t\t\t\t} else if (this._hasMarkerTag(marker, MarkerTag.Unnecessary)) {\n\t\t\t\t\tclassName = ClassName.EditorUnnecessaryDecoration;\n\t\t\t\t} else {\n\t\t\t\t\tclassName = ClassName.EditorHintDecoration;\n\t\t\t\t}\n\t\t\t\tzIndex = 0;\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Warning:\n\t\t\t\tclassName = ClassName.EditorWarningDecoration;\n\t\t\t\tcolor = themeColorFromId(overviewRulerWarning);\n\t\t\t\tzIndex = 20;\n\t\t\t\tminimap = {\n\t\t\t\t\tcolor: themeColorFromId(minimapWarning),\n\t\t\t\t\tposition: MinimapPosition.Inline\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Info:\n\t\t\t\tclassName = ClassName.EditorInfoDecoration;\n\t\t\t\tcolor = themeColorFromId(overviewRulerInfo);\n\t\t\t\tzIndex = 10;\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Error:\n\t\t\tdefault:\n\t\t\t\tclassName = ClassName.EditorErrorDecoration;\n\t\t\t\tcolor = themeColorFromId(overviewRulerError);\n\t\t\t\tzIndex = 30;\n\t\t\t\tminimap = {\n\t\t\t\t\tcolor: themeColorFromId(minimapError),\n\t\t\t\t\tposition: MinimapPosition.Inline\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (marker.tags) {\n\t\t\tif (marker.tags.indexOf(MarkerTag.Unnecessary) !== -1) {\n\t\t\t\tinlineClassName = ClassName.EditorUnnecessaryInlineDecoration;\n\t\t\t}\n\t\t\tif (marker.tags.indexOf(MarkerTag.Deprecated) !== -1) {\n\t\t\t\tinlineClassName = ClassName.EditorDeprecatedInlineDecoration;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdescription: 'marker-decoration',\n\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\t\tclassName,\n\t\t\tshowIfCollapsed: true,\n\t\t\toverviewRuler: {\n\t\t\t\tcolor,\n\t\t\t\tposition: OverviewRulerLane.Right\n\t\t\t},\n\t\t\tminimap,\n\t\t\tzIndex,\n\t\t\tinlineClassName,\n\t\t};\n\t}\n\n\tprivate _hasMarkerTag(marker: IMarker, tag: MarkerTag): boolean {\n\t\tif (marker.tags) {\n\t\t\treturn marker.tags.indexOf(tag) >= 0;\n\t\t}\n\t\treturn false;\n\t}\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 { SemanticTokensLegend, TokenMetadata, FontStyle, MetadataConsts, SemanticTokens } from 'vs/editor/common/languages';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { ILogService, LogLevel } from 'vs/platform/log/common/log';\nimport { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\n\nexport const enum SemanticTokensProviderStylingConstants {\n\tNO_STYLING = 0b01111111111111111111111111111111\n}\n\nexport class SemanticTokensProviderStyling {\n\n\tprivate readonly _hashTable: HashTable;\n\tprivate _hasWarnedOverlappingTokens: boolean;\n\n\tconstructor(\n\t\tprivate readonly _legend: SemanticTokensLegend,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@ILogService private readonly _logService: ILogService\n\t) {\n\t\tthis._hashTable = new HashTable();\n\t\tthis._hasWarnedOverlappingTokens = false;\n\t}\n\n\tpublic getMetadata(tokenTypeIndex: number, tokenModifierSet: number, languageId: string): number {\n\t\tconst encodedLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId);\n\t\tconst entry = this._hashTable.get(tokenTypeIndex, tokenModifierSet, encodedLanguageId);\n\t\tlet metadata: number;\n\t\tif (entry) {\n\t\t\tmetadata = entry.metadata;\n\t\t\tif (this._logService.getLevel() === LogLevel.Trace) {\n\t\t\t\tthis._logService.trace(`SemanticTokensProviderStyling [CACHED] ${tokenTypeIndex} / ${tokenModifierSet}: foreground ${TokenMetadata.getForeground(metadata)}, fontStyle ${TokenMetadata.getFontStyle(metadata).toString(2)}`);\n\t\t\t}\n\t\t} else {\n\t\t\tlet tokenType = this._legend.tokenTypes[tokenTypeIndex];\n\t\t\tconst tokenModifiers: string[] = [];\n\t\t\tif (tokenType) {\n\t\t\t\tlet modifierSet = tokenModifierSet;\n\t\t\t\tfor (let modifierIndex = 0; modifierSet > 0 && modifierIndex < this._legend.tokenModifiers.length; modifierIndex++) {\n\t\t\t\t\tif (modifierSet & 1) {\n\t\t\t\t\t\ttokenModifiers.push(this._legend.tokenModifiers[modifierIndex]);\n\t\t\t\t\t}\n\t\t\t\t\tmodifierSet = modifierSet >> 1;\n\t\t\t\t}\n\t\t\t\tif (modifierSet > 0 && this._logService.getLevel() === LogLevel.Trace) {\n\t\t\t\t\tthis._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${tokenModifierSet.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`);\n\t\t\t\t\ttokenModifiers.push('not-in-legend');\n\t\t\t\t}\n\n\t\t\t\tconst tokenStyle = this._themeService.getColorTheme().getTokenStyleMetadata(tokenType, tokenModifiers, languageId);\n\t\t\t\tif (typeof tokenStyle === 'undefined') {\n\t\t\t\t\tmetadata = SemanticTokensProviderStylingConstants.NO_STYLING;\n\t\t\t\t} else {\n\t\t\t\t\tmetadata = 0;\n\t\t\t\t\tif (typeof tokenStyle.italic !== 'undefined') {\n\t\t\t\t\t\tconst italicBit = (tokenStyle.italic ? FontStyle.Italic : 0) << MetadataConsts.FONT_STYLE_OFFSET;\n\t\t\t\t\t\tmetadata |= italicBit | MetadataConsts.SEMANTIC_USE_ITALIC;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof tokenStyle.bold !== 'undefined') {\n\t\t\t\t\t\tconst boldBit = (tokenStyle.bold ? FontStyle.Bold : 0) << MetadataConsts.FONT_STYLE_OFFSET;\n\t\t\t\t\t\tmetadata |= boldBit | MetadataConsts.SEMANTIC_USE_BOLD;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof tokenStyle.underline !== 'undefined') {\n\t\t\t\t\t\tconst underlineBit = (tokenStyle.underline ? FontStyle.Underline : 0) << MetadataConsts.FONT_STYLE_OFFSET;\n\t\t\t\t\t\tmetadata |= underlineBit | MetadataConsts.SEMANTIC_USE_UNDERLINE;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof tokenStyle.strikethrough !== 'undefined') {\n\t\t\t\t\t\tconst strikethroughBit = (tokenStyle.strikethrough ? FontStyle.Strikethrough : 0) << MetadataConsts.FONT_STYLE_OFFSET;\n\t\t\t\t\t\tmetadata |= strikethroughBit | MetadataConsts.SEMANTIC_USE_STRIKETHROUGH;\n\t\t\t\t\t}\n\t\t\t\t\tif (tokenStyle.foreground) {\n\t\t\t\t\t\tconst foregroundBits = (tokenStyle.foreground) << MetadataConsts.FOREGROUND_OFFSET;\n\t\t\t\t\t\tmetadata |= foregroundBits | MetadataConsts.SEMANTIC_USE_FOREGROUND;\n\t\t\t\t\t}\n\t\t\t\t\tif (metadata === 0) {\n\t\t\t\t\t\t// Nothing!\n\t\t\t\t\t\tmetadata = SemanticTokensProviderStylingConstants.NO_STYLING;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._logService.getLevel() === LogLevel.Trace) {\n\t\t\t\t\tthis._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${tokenTypeIndex} for legend: ${JSON.stringify(this._legend.tokenTypes)}`);\n\t\t\t\t}\n\t\t\t\tmetadata = SemanticTokensProviderStylingConstants.NO_STYLING;\n\t\t\t\ttokenType = 'not-in-legend';\n\t\t\t}\n\t\t\tthis._hashTable.add(tokenTypeIndex, tokenModifierSet, encodedLanguageId, metadata);\n\n\t\t\tif (this._logService.getLevel() === LogLevel.Trace) {\n\t\t\t\tthis._logService.trace(`SemanticTokensProviderStyling ${tokenTypeIndex} (${tokenType}) / ${tokenModifierSet} (${tokenModifiers.join(' ')}): foreground ${TokenMetadata.getForeground(metadata)}, fontStyle ${TokenMetadata.getFontStyle(metadata).toString(2)}`);\n\t\t\t}\n\t\t}\n\n\t\treturn metadata;\n\t}\n\n\tpublic warnOverlappingSemanticTokens(lineNumber: number, startColumn: number): void {\n\t\tif (!this._hasWarnedOverlappingTokens) {\n\t\t\tthis._hasWarnedOverlappingTokens = true;\n\t\t\tconsole.warn(`Overlapping semantic tokens detected at lineNumber ${lineNumber}, column ${startColumn}`);\n\t\t}\n\t}\n\n}\n\nconst enum SemanticColoringConstants {\n\t/**\n\t * Let's aim at having 8KB buffers if possible...\n\t * So that would be 8192 / (5 * 4) = 409.6 tokens per area\n\t */\n\tDesiredTokensPerArea = 400,\n\n\t/**\n\t * Try to keep the total number of areas under 1024 if possible,\n\t * simply compensate by having more tokens per area...\n\t */\n\tDesiredMaxAreas = 1024,\n}\n\nexport function toMultilineTokens2(tokens: SemanticTokens, styling: SemanticTokensProviderStyling, languageId: string): SparseMultilineTokens[] {\n\tconst srcData = tokens.data;\n\tconst tokenCount = (tokens.data.length / 5) | 0;\n\tconst tokensPerArea = Math.max(Math.ceil(tokenCount / SemanticColoringConstants.DesiredMaxAreas), SemanticColoringConstants.DesiredTokensPerArea);\n\tconst result: SparseMultilineTokens[] = [];\n\n\tlet tokenIndex = 0;\n\tlet lastLineNumber = 1;\n\tlet lastStartCharacter = 0;\n\twhile (tokenIndex < tokenCount) {\n\t\tconst tokenStartIndex = tokenIndex;\n\t\tlet tokenEndIndex = Math.min(tokenStartIndex + tokensPerArea, tokenCount);\n\n\t\t// Keep tokens on the same line in the same area...\n\t\tif (tokenEndIndex < tokenCount) {\n\n\t\t\tlet smallTokenEndIndex = tokenEndIndex;\n\t\t\twhile (smallTokenEndIndex - 1 > tokenStartIndex && srcData[5 * smallTokenEndIndex] === 0) {\n\t\t\t\tsmallTokenEndIndex--;\n\t\t\t}\n\n\t\t\tif (smallTokenEndIndex - 1 === tokenStartIndex) {\n\t\t\t\t// there are so many tokens on this line that our area would be empty, we must now go right\n\t\t\t\tlet bigTokenEndIndex = tokenEndIndex;\n\t\t\t\twhile (bigTokenEndIndex + 1 < tokenCount && srcData[5 * bigTokenEndIndex] === 0) {\n\t\t\t\t\tbigTokenEndIndex++;\n\t\t\t\t}\n\t\t\t\ttokenEndIndex = bigTokenEndIndex;\n\t\t\t} else {\n\t\t\t\ttokenEndIndex = smallTokenEndIndex;\n\t\t\t}\n\t\t}\n\n\t\tlet destData = new Uint32Array((tokenEndIndex - tokenStartIndex) * 4);\n\t\tlet destOffset = 0;\n\t\tlet areaLine = 0;\n\t\tlet prevLineNumber = 0;\n\t\tlet prevStartCharacter = 0;\n\t\tlet prevEndCharacter = 0;\n\t\twhile (tokenIndex < tokenEndIndex) {\n\t\t\tconst srcOffset = 5 * tokenIndex;\n\t\t\tconst deltaLine = srcData[srcOffset];\n\t\t\tconst deltaCharacter = srcData[srcOffset + 1];\n\t\t\t// Casting both `lineNumber` and `startCharacter` here to uint32 using `|0`\n\t\t\t// to do checks below with the actual value that will be inserted in the Uint32Array result\n\t\t\tconst lineNumber = (lastLineNumber + deltaLine) | 0;\n\t\t\tconst startCharacter = (deltaLine === 0 ? (lastStartCharacter + deltaCharacter) | 0 : deltaCharacter);\n\t\t\tconst length = srcData[srcOffset + 2];\n\t\t\tconst tokenTypeIndex = srcData[srcOffset + 3];\n\t\t\tconst tokenModifierSet = srcData[srcOffset + 4];\n\t\t\tconst metadata = styling.getMetadata(tokenTypeIndex, tokenModifierSet, languageId);\n\n\t\t\tif (metadata !== SemanticTokensProviderStylingConstants.NO_STYLING) {\n\t\t\t\tif (areaLine === 0) {\n\t\t\t\t\tareaLine = lineNumber;\n\t\t\t\t}\n\t\t\t\tif (prevLineNumber === lineNumber && prevEndCharacter > startCharacter) {\n\t\t\t\t\tstyling.warnOverlappingSemanticTokens(lineNumber, startCharacter + 1);\n\t\t\t\t\tif (prevStartCharacter < startCharacter) {\n\t\t\t\t\t\t// the previous token survives after the overlapping one\n\t\t\t\t\t\tdestData[destOffset - 4 + 2] = startCharacter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the previous token is entirely covered by the overlapping one\n\t\t\t\t\t\tdestOffset -= 4;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdestData[destOffset] = lineNumber - areaLine;\n\t\t\t\tdestData[destOffset + 1] = startCharacter;\n\t\t\t\tdestData[destOffset + 2] = startCharacter + length;\n\t\t\t\tdestData[destOffset + 3] = metadata;\n\t\t\t\tdestOffset += 4;\n\n\t\t\t\tprevLineNumber = lineNumber;\n\t\t\t\tprevStartCharacter = startCharacter;\n\t\t\t\tprevEndCharacter = startCharacter + length;\n\t\t\t}\n\n\t\t\tlastLineNumber = lineNumber;\n\t\t\tlastStartCharacter = startCharacter;\n\t\t\ttokenIndex++;\n\t\t}\n\n\t\tif (destOffset !== destData.length) {\n\t\t\tdestData = destData.subarray(0, destOffset);\n\t\t}\n\n\t\tconst tokens = SparseMultilineTokens.create(areaLine, destData);\n\t\tresult.push(tokens);\n\t}\n\n\treturn result;\n}\n\nclass HashTableEntry {\n\tpublic readonly tokenTypeIndex: number;\n\tpublic readonly tokenModifierSet: number;\n\tpublic readonly languageId: number;\n\tpublic readonly metadata: number;\n\tpublic next: HashTableEntry | null;\n\n\tconstructor(tokenTypeIndex: number, tokenModifierSet: number, languageId: number, metadata: number) {\n\t\tthis.tokenTypeIndex = tokenTypeIndex;\n\t\tthis.tokenModifierSet = tokenModifierSet;\n\t\tthis.languageId = languageId;\n\t\tthis.metadata = metadata;\n\t\tthis.next = null;\n\t}\n}\n\nclass HashTable {\n\n\tprivate static _SIZES = [3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143];\n\n\tprivate _elementsCount: number;\n\tprivate _currentLengthIndex: number;\n\tprivate _currentLength: number;\n\tprivate _growCount: number;\n\tprivate _elements: (HashTableEntry | null)[];\n\n\tconstructor() {\n\t\tthis._elementsCount = 0;\n\t\tthis._currentLengthIndex = 0;\n\t\tthis._currentLength = HashTable._SIZES[this._currentLengthIndex];\n\t\tthis._growCount = Math.round(this._currentLengthIndex + 1 < HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0);\n\t\tthis._elements = [];\n\t\tHashTable._nullOutEntries(this._elements, this._currentLength);\n\t}\n\n\tprivate static _nullOutEntries(entries: (HashTableEntry | null)[], length: number): void {\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tentries[i] = null;\n\t\t}\n\t}\n\n\tprivate _hash2(n1: number, n2: number): number {\n\t\treturn (((n1 << 5) - n1) + n2) | 0; // n1 * 31 + n2, keep as int32\n\t}\n\n\tprivate _hashFunc(tokenTypeIndex: number, tokenModifierSet: number, languageId: number): number {\n\t\treturn this._hash2(this._hash2(tokenTypeIndex, tokenModifierSet), languageId) % this._currentLength;\n\t}\n\n\tpublic get(tokenTypeIndex: number, tokenModifierSet: number, languageId: number): HashTableEntry | null {\n\t\tconst hash = this._hashFunc(tokenTypeIndex, tokenModifierSet, languageId);\n\n\t\tlet p = this._elements[hash];\n\t\twhile (p) {\n\t\t\tif (p.tokenTypeIndex === tokenTypeIndex && p.tokenModifierSet === tokenModifierSet && p.languageId === languageId) {\n\t\t\t\treturn p;\n\t\t\t}\n\t\t\tp = p.next;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic add(tokenTypeIndex: number, tokenModifierSet: number, languageId: number, metadata: number): void {\n\t\tthis._elementsCount++;\n\t\tif (this._growCount !== 0 && this._elementsCount >= this._growCount) {\n\t\t\t// expand!\n\t\t\tconst oldElements = this._elements;\n\n\t\t\tthis._currentLengthIndex++;\n\t\t\tthis._currentLength = HashTable._SIZES[this._currentLengthIndex];\n\t\t\tthis._growCount = Math.round(this._currentLengthIndex + 1 < HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0);\n\t\t\tthis._elements = [];\n\t\t\tHashTable._nullOutEntries(this._elements, this._currentLength);\n\n\t\t\tfor (const first of oldElements) {\n\t\t\t\tlet p = first;\n\t\t\t\twhile (p) {\n\t\t\t\t\tconst oldNext = p.next;\n\t\t\t\t\tp.next = null;\n\t\t\t\t\tthis._add(p);\n\t\t\t\t\tp = oldNext;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._add(new HashTableEntry(tokenTypeIndex, tokenModifierSet, languageId, metadata));\n\t}\n\n\tprivate _add(element: HashTableEntry): void {\n\t\tconst hash = this._hashFunc(element.tokenTypeIndex, element.tokenModifierSet, element.languageId);\n\t\telement.next = this._elements[hash];\n\t\tthis._elements[hash] = element;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { Gesture } from 'vs/base/browser/touch';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./lightBulbWidget';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { computeIndentLevel } from 'vs/editor/common/model/utils';\nimport { CodeActionSet } from 'vs/editor/contrib/codeAction/browser/codeAction';\nimport { CodeActionTrigger } from 'vs/editor/contrib/codeAction/browser/types';\nimport * as nls from 'vs/nls';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { editorBackground, editorLightBulbAutoFixForeground, editorLightBulbForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nnamespace LightBulbState {\n\n\texport const enum Type {\n\t\tHidden,\n\t\tShowing,\n\t}\n\n\texport const Hidden = { type: Type.Hidden } as const;\n\n\texport class Showing {\n\t\treadonly type = Type.Showing;\n\n\t\tconstructor(\n\t\t\tpublic readonly actions: CodeActionSet,\n\t\t\tpublic readonly trigger: CodeActionTrigger,\n\t\t\tpublic readonly editorPosition: IPosition,\n\t\t\tpublic readonly widgetPosition: IContentWidgetPosition,\n\t\t) { }\n\t}\n\n\texport type State = typeof Hidden | Showing;\n}\n\n\nexport class LightBulbWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly _posPref = [ContentWidgetPositionPreference.EXACT];\n\n\tprivate readonly _domNode: HTMLDivElement;\n\n\tprivate readonly _onClick = this._register(new Emitter<{ x: number; y: number; actions: CodeActionSet; trigger: CodeActionTrigger }>());\n\tpublic readonly onClick = this._onClick.event;\n\n\tprivate _state: LightBulbState.State = LightBulbState.Hidden;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _quickFixActionId: string,\n\t\tprivate readonly _preferredFixActionId: string,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tsuper();\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = Codicon.lightBulb.classNames;\n\n\t\tthis._editor.addContentWidget(this);\n\n\t\tthis._register(this._editor.onDidChangeModelContent(_ => {\n\t\t\t// cancel when the line in question has been removed\n\t\t\tconst editorModel = this._editor.getModel();\n\t\t\tif (this.state.type !== LightBulbState.Type.Showing || !editorModel || this.state.editorPosition.lineNumber >= editorModel.getLineCount()) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\n\t\tGesture.ignoreTarget(this._domNode);\n\t\tthis._register(dom.addStandardDisposableGenericMouseDownListener(this._domNode, e => {\n\t\t\tif (this.state.type !== LightBulbState.Type.Showing) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure that focus / cursor location is not lost when clicking widget icon\n\t\t\tthis._editor.focus();\n\t\t\te.preventDefault();\n\t\t\t// a bit of extra work to make sure the menu\n\t\t\t// doesn't cover the line-text\n\t\t\tconst { top, height } = dom.getDomNodePagePosition(this._domNode);\n\t\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\n\t\t\tlet pad = Math.floor(lineHeight / 3);\n\t\t\tif (this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber) {\n\t\t\t\tpad += lineHeight;\n\t\t\t}\n\n\t\t\tthis._onClick.fire({\n\t\t\t\tx: e.posx,\n\t\t\t\ty: top + height + pad,\n\t\t\t\tactions: this.state.actions,\n\t\t\t\ttrigger: this.state.trigger,\n\t\t\t});\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(this._domNode, 'mouseenter', (e: MouseEvent) => {\n\t\t\tif ((e.buttons & 1) !== 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// mouse enters lightbulb while the primary/left button\n\t\t\t// is being pressed -> hide the lightbulb and block future\n\t\t\t// showings until mouse is released\n\t\t\tthis.hide();\n\t\t\tconst monitor = new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>();\n\t\t\tmonitor.startMonitoring(<HTMLElement>e.target, e.buttons, standardMouseMoveMerger, () => { }, () => {\n\t\t\t\tmonitor.dispose();\n\t\t\t});\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeConfiguration(e => {\n\t\t\t// hide when told to do so\n\t\t\tif (e.hasChanged(EditorOption.lightbulb) && !this._editor.getOption(EditorOption.lightbulb).enabled) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateLightBulbTitleAndIcon();\n\t\tthis._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon, this));\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tgetId(): string {\n\t\treturn 'LightBulbWidget';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\treturn this._state.type === LightBulbState.Type.Showing ? this._state.widgetPosition : null;\n\t}\n\n\tpublic update(actions: CodeActionSet, trigger: CodeActionTrigger, atPosition: IPosition) {\n\t\tif (actions.validActions.length <= 0) {\n\t\t\treturn this.hide();\n\t\t}\n\n\t\tconst options = this._editor.getOptions();\n\t\tif (!options.get(EditorOption.lightbulb).enabled) {\n\t\t\treturn this.hide();\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn this.hide();\n\t\t}\n\n\t\tconst { lineNumber, column } = model.validatePosition(atPosition);\n\n\t\tconst tabSize = model.getOptions().tabSize;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tconst indent = computeIndentLevel(lineContent, tabSize);\n\t\tconst lineHasSpace = fontInfo.spaceWidth * indent > 22;\n\t\tconst isFolded = (lineNumber: number) => {\n\t\t\treturn lineNumber > 2 && this._editor.getTopForLineNumber(lineNumber) === this._editor.getTopForLineNumber(lineNumber - 1);\n\t\t};\n\n\t\tlet effectiveLineNumber = lineNumber;\n\t\tif (!lineHasSpace) {\n\t\t\tif (lineNumber > 1 && !isFolded(lineNumber - 1)) {\n\t\t\t\teffectiveLineNumber -= 1;\n\t\t\t} else if (!isFolded(lineNumber + 1)) {\n\t\t\t\teffectiveLineNumber += 1;\n\t\t\t} else if (column * fontInfo.spaceWidth < 22) {\n\t\t\t\t// cannot show lightbulb above/below and showing\n\t\t\t\t// it inline would overlay the cursor...\n\t\t\t\treturn this.hide();\n\t\t\t}\n\t\t}\n\n\t\tthis.state = new LightBulbState.Showing(actions, trigger, atPosition, {\n\t\t\tposition: { lineNumber: effectiveLineNumber, column: 1 },\n\t\t\tpreference: LightBulbWidget._posPref\n\t\t});\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\tpublic hide(): void {\n\t\tthis.state = LightBulbState.Hidden;\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\tprivate get state(): LightBulbState.State { return this._state; }\n\n\tprivate set state(value) {\n\t\tthis._state = value;\n\t\tthis._updateLightBulbTitleAndIcon();\n\t}\n\n\tprivate _updateLightBulbTitleAndIcon(): void {\n\t\tif (this.state.type === LightBulbState.Type.Showing && this.state.actions.hasAutoFix) {\n\t\t\t// update icon\n\t\t\tthis._domNode.classList.remove(...Codicon.lightBulb.classNamesArray);\n\t\t\tthis._domNode.classList.add(...Codicon.lightbulbAutofix.classNamesArray);\n\n\t\t\tconst preferredKb = this._keybindingService.lookupKeybinding(this._preferredFixActionId);\n\t\t\tif (preferredKb) {\n\t\t\t\tthis.title = nls.localize('preferredcodeActionWithKb', \"Show Code Actions. Preferred Quick Fix Available ({0})\", preferredKb.getLabel());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// update icon\n\t\tthis._domNode.classList.remove(...Codicon.lightbulbAutofix.classNamesArray);\n\t\tthis._domNode.classList.add(...Codicon.lightBulb.classNamesArray);\n\n\t\tconst kb = this._keybindingService.lookupKeybinding(this._quickFixActionId);\n\t\tif (kb) {\n\t\t\tthis.title = nls.localize('codeActionWithKb', \"Show Code Actions ({0})\", kb.getLabel());\n\t\t} else {\n\t\t\tthis.title = nls.localize('codeAction', \"Show Code Actions\");\n\t\t}\n\t}\n\n\tprivate set title(value: string) {\n\t\tthis._domNode.title = value;\n\t}\n}\n\nregisterThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {\n\n\tconst editorBackgroundColor = theme.getColor(editorBackground)?.transparent(0.7);\n\n\t// Lightbulb Icon\n\tconst editorLightBulbForegroundColor = theme.getColor(editorLightBulbForeground);\n\tif (editorLightBulbForegroundColor) {\n\t\tcollector.addRule(`\n\t\t.monaco-editor .contentWidgets ${Codicon.lightBulb.cssSelector} {\n\t\t\tcolor: ${editorLightBulbForegroundColor};\n\t\t\tbackground-color: ${editorBackgroundColor};\n\t\t}`);\n\t}\n\n\t// Lightbulb Auto Fix Icon\n\tconst editorLightBulbAutoFixForegroundColor = theme.getColor(editorLightBulbAutoFixForeground);\n\tif (editorLightBulbAutoFixForegroundColor) {\n\t\tcollector.addRule(`\n\t\t.monaco-editor .contentWidgets ${Codicon.lightbulbAutofix.cssSelector} {\n\t\t\tcolor: ${editorLightBulbAutoFixForegroundColor};\n\t\t\tbackground-color: ${editorBackgroundColor};\n\t\t}`);\n\t}\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 { PixelRatio } from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Color, HSVA, RGBA } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./colorPicker';\nimport { ColorPickerModel } from 'vs/editor/contrib/colorPicker/browser/colorPickerModel';\nimport { IEditorHoverColorPickerWidget } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { localize } from 'vs/nls';\nimport { editorHoverBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nconst $ = dom.$;\n\nexport class ColorPickerHeader extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate readonly pickedColorNode: HTMLElement;\n\tprivate backgroundColor: Color;\n\n\tconstructor(container: HTMLElement, private readonly model: ColorPickerModel, themeService: IThemeService) {\n\t\tsuper();\n\n\t\tthis.domNode = $('.colorpicker-header');\n\t\tdom.append(container, this.domNode);\n\n\t\tthis.pickedColorNode = dom.append(this.domNode, $('.picked-color'));\n\n\t\tconst tooltip = localize('clickToToggleColorOptions', \"Click to toggle color options (rgb/hsl/hex)\");\n\t\tthis.pickedColorNode.setAttribute('title', tooltip);\n\n\t\tconst colorBox = dom.append(this.domNode, $('.original-color'));\n\t\tcolorBox.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || '';\n\n\t\tthis.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white;\n\t\tthis._register(registerThemingParticipant((theme, collector) => {\n\t\t\tthis.backgroundColor = theme.getColor(editorHoverBackground) || Color.white;\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(this.pickedColorNode, dom.EventType.CLICK, () => this.model.selectNextColorPresentation()));\n\t\tthis._register(dom.addDisposableListener(colorBox, dom.EventType.CLICK, () => {\n\t\t\tthis.model.color = this.model.originalColor;\n\t\t\tthis.model.flushColor();\n\t\t}));\n\t\tthis._register(model.onDidChangeColor(this.onDidChangeColor, this));\n\t\tthis._register(model.onDidChangePresentation(this.onDidChangePresentation, this));\n\t\tthis.pickedColorNode.style.backgroundColor = Color.Format.CSS.format(model.color) || '';\n\t\tthis.pickedColorNode.classList.toggle('light', model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter());\n\n\t\tthis.onDidChangeColor(this.model.color);\n\t}\n\n\tprivate onDidChangeColor(color: Color): void {\n\t\tthis.pickedColorNode.style.backgroundColor = Color.Format.CSS.format(color) || '';\n\t\tthis.pickedColorNode.classList.toggle('light', color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : color.isLighter());\n\t\tthis.onDidChangePresentation();\n\t}\n\n\tprivate onDidChangePresentation(): void {\n\t\tthis.pickedColorNode.textContent = this.model.presentation ? this.model.presentation.label : '';\n\t\tthis.pickedColorNode.prepend($('.codicon.codicon-color-mode'));\n\t}\n}\n\nexport class ColorPickerBody extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate readonly saturationBox: SaturationBox;\n\tprivate readonly hueStrip: Strip;\n\tprivate readonly opacityStrip: Strip;\n\n\tconstructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {\n\t\tsuper();\n\n\t\tthis.domNode = $('.colorpicker-body');\n\t\tdom.append(container, this.domNode);\n\n\t\tthis.saturationBox = new SaturationBox(this.domNode, this.model, this.pixelRatio);\n\t\tthis._register(this.saturationBox);\n\t\tthis._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange, this));\n\t\tthis._register(this.saturationBox.onColorFlushed(this.flushColor, this));\n\n\t\tthis.opacityStrip = new OpacityStrip(this.domNode, this.model);\n\t\tthis._register(this.opacityStrip);\n\t\tthis._register(this.opacityStrip.onDidChange(this.onDidOpacityChange, this));\n\t\tthis._register(this.opacityStrip.onColorFlushed(this.flushColor, this));\n\n\t\tthis.hueStrip = new HueStrip(this.domNode, this.model);\n\t\tthis._register(this.hueStrip);\n\t\tthis._register(this.hueStrip.onDidChange(this.onDidHueChange, this));\n\t\tthis._register(this.hueStrip.onColorFlushed(this.flushColor, this));\n\t}\n\n\tprivate flushColor(): void {\n\t\tthis.model.flushColor();\n\t}\n\n\tprivate onDidSaturationValueChange({ s, v }: { s: number; v: number }): void {\n\t\tconst hsva = this.model.color.hsva;\n\t\tthis.model.color = new Color(new HSVA(hsva.h, s, v, hsva.a));\n\t}\n\n\tprivate onDidOpacityChange(a: number): void {\n\t\tconst hsva = this.model.color.hsva;\n\t\tthis.model.color = new Color(new HSVA(hsva.h, hsva.s, hsva.v, a));\n\t}\n\n\tprivate onDidHueChange(value: number): void {\n\t\tconst hsva = this.model.color.hsva;\n\t\tconst h = (1 - value) * 360;\n\n\t\tthis.model.color = new Color(new HSVA(h === 360 ? 0 : h, hsva.s, hsva.v, hsva.a));\n\t}\n\n\tlayout(): void {\n\t\tthis.saturationBox.layout();\n\t\tthis.opacityStrip.layout();\n\t\tthis.hueStrip.layout();\n\t}\n}\n\nclass SaturationBox extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate readonly selection: HTMLElement;\n\tprivate readonly canvas: HTMLCanvasElement;\n\tprivate width!: number;\n\tprivate height!: number;\n\n\tprivate monitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData> | null;\n\tprivate readonly _onDidChange = new Emitter<{ s: number; v: number }>();\n\treadonly onDidChange: Event<{ s: number; v: number }> = this._onDidChange.event;\n\n\tprivate readonly _onColorFlushed = new Emitter<void>();\n\treadonly onColorFlushed: Event<void> = this._onColorFlushed.event;\n\n\tconstructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {\n\t\tsuper();\n\n\t\tthis.domNode = $('.saturation-wrap');\n\t\tdom.append(container, this.domNode);\n\n\t\t// Create canvas, draw selected color\n\t\tthis.canvas = document.createElement('canvas');\n\t\tthis.canvas.className = 'saturation-box';\n\t\tdom.append(this.domNode, this.canvas);\n\n\t\t// Add selection circle\n\t\tthis.selection = $('.saturation-selection');\n\t\tdom.append(this.domNode, this.selection);\n\n\t\tthis.layout();\n\n\t\tthis._register(dom.addDisposableGenericMouseDownListener(this.domNode, e => this.onMouseDown(e)));\n\t\tthis._register(this.model.onDidChangeColor(this.onDidChangeColor, this));\n\t\tthis.monitor = null;\n\t}\n\n\tprivate onMouseDown(e: MouseEvent): void {\n\t\tthis.monitor = this._register(new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>());\n\t\tconst origin = dom.getDomNodePagePosition(this.domNode);\n\n\t\tif (e.target !== this.selection) {\n\t\t\tthis.onDidChangePosition(e.offsetX, e.offsetY);\n\t\t}\n\n\t\tthis.monitor.startMonitoring(<HTMLElement>e.target, e.buttons, standardMouseMoveMerger, event => this.onDidChangePosition(event.posx - origin.left, event.posy - origin.top), () => null);\n\n\t\tconst mouseUpListener = dom.addDisposableGenericMouseUpListener(document, () => {\n\t\t\tthis._onColorFlushed.fire();\n\t\t\tmouseUpListener.dispose();\n\t\t\tif (this.monitor) {\n\t\t\t\tthis.monitor.stopMonitoring(true);\n\t\t\t\tthis.monitor = null;\n\t\t\t}\n\t\t}, true);\n\t}\n\n\tprivate onDidChangePosition(left: number, top: number): void {\n\t\tconst s = Math.max(0, Math.min(1, left / this.width));\n\t\tconst v = Math.max(0, Math.min(1, 1 - (top / this.height)));\n\n\t\tthis.paintSelection(s, v);\n\t\tthis._onDidChange.fire({ s, v });\n\t}\n\n\tlayout(): void {\n\t\tthis.width = this.domNode.offsetWidth;\n\t\tthis.height = this.domNode.offsetHeight;\n\t\tthis.canvas.width = this.width * this.pixelRatio;\n\t\tthis.canvas.height = this.height * this.pixelRatio;\n\t\tthis.paint();\n\n\t\tconst hsva = this.model.color.hsva;\n\t\tthis.paintSelection(hsva.s, hsva.v);\n\t}\n\n\tprivate paint(): void {\n\t\tconst hsva = this.model.color.hsva;\n\t\tconst saturatedColor = new Color(new HSVA(hsva.h, 1, 1, 1));\n\t\tconst ctx = this.canvas.getContext('2d')!;\n\n\t\tconst whiteGradient = ctx.createLinearGradient(0, 0, this.canvas.width, 0);\n\t\twhiteGradient.addColorStop(0, 'rgba(255, 255, 255, 1)');\n\t\twhiteGradient.addColorStop(0.5, 'rgba(255, 255, 255, 0.5)');\n\t\twhiteGradient.addColorStop(1, 'rgba(255, 255, 255, 0)');\n\n\t\tconst blackGradient = ctx.createLinearGradient(0, 0, 0, this.canvas.height);\n\t\tblackGradient.addColorStop(0, 'rgba(0, 0, 0, 0)');\n\t\tblackGradient.addColorStop(1, 'rgba(0, 0, 0, 1)');\n\n\t\tctx.rect(0, 0, this.canvas.width, this.canvas.height);\n\t\tctx.fillStyle = Color.Format.CSS.format(saturatedColor)!;\n\t\tctx.fill();\n\t\tctx.fillStyle = whiteGradient;\n\t\tctx.fill();\n\t\tctx.fillStyle = blackGradient;\n\t\tctx.fill();\n\t}\n\n\tprivate paintSelection(s: number, v: number): void {\n\t\tthis.selection.style.left = `${s * this.width}px`;\n\t\tthis.selection.style.top = `${this.height - v * this.height}px`;\n\t}\n\n\tprivate onDidChangeColor(): void {\n\t\tif (this.monitor && this.monitor.isMonitoring()) {\n\t\t\treturn;\n\t\t}\n\t\tthis.paint();\n\t}\n}\n\nabstract class Strip extends Disposable {\n\n\tprotected domNode: HTMLElement;\n\tprotected overlay: HTMLElement;\n\tprotected slider: HTMLElement;\n\tprivate height!: number;\n\n\tprivate readonly _onDidChange = new Emitter<number>();\n\treadonly onDidChange: Event<number> = this._onDidChange.event;\n\n\tprivate readonly _onColorFlushed = new Emitter<void>();\n\treadonly onColorFlushed: Event<void> = this._onColorFlushed.event;\n\n\tconstructor(container: HTMLElement, protected model: ColorPickerModel) {\n\t\tsuper();\n\t\tthis.domNode = dom.append(container, $('.strip'));\n\t\tthis.overlay = dom.append(this.domNode, $('.overlay'));\n\t\tthis.slider = dom.append(this.domNode, $('.slider'));\n\t\tthis.slider.style.top = `0px`;\n\n\t\tthis._register(dom.addDisposableGenericMouseDownListener(this.domNode, e => this.onMouseDown(e)));\n\t\tthis.layout();\n\t}\n\n\tlayout(): void {\n\t\tthis.height = this.domNode.offsetHeight - this.slider.offsetHeight;\n\n\t\tconst value = this.getValue(this.model.color);\n\t\tthis.updateSliderPosition(value);\n\t}\n\n\tprivate onMouseDown(e: MouseEvent): void {\n\t\tconst monitor = this._register(new GlobalMouseMoveMonitor<IStandardMouseMoveEventData>());\n\t\tconst origin = dom.getDomNodePagePosition(this.domNode);\n\t\tthis.domNode.classList.add('grabbing');\n\n\t\tif (e.target !== this.slider) {\n\t\t\tthis.onDidChangeTop(e.offsetY);\n\t\t}\n\n\t\tmonitor.startMonitoring(<HTMLElement>e.target, e.buttons, standardMouseMoveMerger, event => this.onDidChangeTop(event.posy - origin.top), () => null);\n\n\t\tconst mouseUpListener = dom.addDisposableGenericMouseUpListener(document, () => {\n\t\t\tthis._onColorFlushed.fire();\n\t\t\tmouseUpListener.dispose();\n\t\t\tmonitor.stopMonitoring(true);\n\t\t\tthis.domNode.classList.remove('grabbing');\n\t\t}, true);\n\t}\n\n\tprivate onDidChangeTop(top: number): void {\n\t\tconst value = Math.max(0, Math.min(1, 1 - (top / this.height)));\n\n\t\tthis.updateSliderPosition(value);\n\t\tthis._onDidChange.fire(value);\n\t}\n\n\tprivate updateSliderPosition(value: number): void {\n\t\tthis.slider.style.top = `${(1 - value) * this.height}px`;\n\t}\n\n\tprotected abstract getValue(color: Color): number;\n}\n\nclass OpacityStrip extends Strip {\n\n\tconstructor(container: HTMLElement, model: ColorPickerModel) {\n\t\tsuper(container, model);\n\t\tthis.domNode.classList.add('opacity-strip');\n\n\t\tthis._register(model.onDidChangeColor(this.onDidChangeColor, this));\n\t\tthis.onDidChangeColor(this.model.color);\n\t}\n\n\tprivate onDidChangeColor(color: Color): void {\n\t\tconst { r, g, b } = color.rgba;\n\t\tconst opaque = new Color(new RGBA(r, g, b, 1));\n\t\tconst transparent = new Color(new RGBA(r, g, b, 0));\n\n\t\tthis.overlay.style.background = `linear-gradient(to bottom, ${opaque} 0%, ${transparent} 100%)`;\n\t}\n\n\tprotected getValue(color: Color): number {\n\t\treturn color.hsva.a;\n\t}\n}\n\nclass HueStrip extends Strip {\n\n\tconstructor(container: HTMLElement, model: ColorPickerModel) {\n\t\tsuper(container, model);\n\t\tthis.domNode.classList.add('hue-strip');\n\t}\n\n\tprotected getValue(color: Color): number {\n\t\treturn 1 - (color.hsva.h / 360);\n\t}\n}\n\nexport class ColorPickerWidget extends Widget implements IEditorHoverColorPickerWidget {\n\n\tbody: ColorPickerBody;\n\n\tconstructor(container: Node, readonly model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService) {\n\t\tsuper();\n\n\t\tthis._register(PixelRatio.onDidChange(() => this.layout()));\n\n\t\tconst element = $('.colorpicker-widget');\n\t\tcontainer.appendChild(element);\n\n\t\tconst header = new ColorPickerHeader(element, this.model, themeService);\n\t\tthis.body = new ColorPickerBody(element, this.model, this.pixelRatio);\n\n\t\tthis._register(header);\n\t\tthis._register(this.body);\n\t}\n\n\tlayout(): void {\n\t\tthis.body.layout();\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';\nimport { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';\nimport { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';\nimport { IAsyncDataSource, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree';\nimport { createMatches, FuzzyScore, IMatch } from 'vs/base/common/filters';\nimport { getBaseLabel } from 'vs/base/common/labels';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { basename, dirname } from 'vs/base/common/resources';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { localize } from 'vs/nls';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { attachBadgeStyler } from 'vs/platform/theme/common/styler';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { FileReferences, OneReference, ReferencesModel } from '../referencesModel';\n\n//#region data source\n\nexport type TreeElement = FileReferences | OneReference;\n\nexport class DataSource implements IAsyncDataSource<ReferencesModel | FileReferences, TreeElement> {\n\n\tconstructor(@ITextModelService private readonly _resolverService: ITextModelService) { }\n\n\thasChildren(element: ReferencesModel | FileReferences | TreeElement): boolean {\n\t\tif (element instanceof ReferencesModel) {\n\t\t\treturn true;\n\t\t}\n\t\tif (element instanceof FileReferences) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgetChildren(element: ReferencesModel | FileReferences | TreeElement): TreeElement[] | Promise<TreeElement[]> {\n\t\tif (element instanceof ReferencesModel) {\n\t\t\treturn element.groups;\n\t\t}\n\n\t\tif (element instanceof FileReferences) {\n\t\t\treturn element.resolve(this._resolverService).then(val => {\n\t\t\t\t// if (element.failure) {\n\t\t\t\t// \t// refresh the element on failure so that\n\t\t\t\t// \t// we can update its rendering\n\t\t\t\t// \treturn tree.refresh(element).then(() => val.children);\n\t\t\t\t// }\n\t\t\t\treturn val.children;\n\t\t\t});\n\t\t}\n\n\t\tthrow new Error('bad tree');\n\t}\n}\n\n//#endregion\n\nexport class Delegate implements IListVirtualDelegate<TreeElement> {\n\tgetHeight(): number {\n\t\treturn 23;\n\t}\n\tgetTemplateId(element: FileReferences | OneReference): string {\n\t\tif (element instanceof FileReferences) {\n\t\t\treturn FileReferencesRenderer.id;\n\t\t} else {\n\t\t\treturn OneReferenceRenderer.id;\n\t\t}\n\t}\n}\n\nexport class StringRepresentationProvider implements IKeyboardNavigationLabelProvider<TreeElement> {\n\n\tconstructor(@IKeybindingService private readonly _keybindingService: IKeybindingService) { }\n\n\tgetKeyboardNavigationLabel(element: TreeElement): { toString(): string } {\n\t\tif (element instanceof OneReference) {\n\t\t\tconst parts = element.parent.getPreview(element)?.preview(element.range);\n\t\t\tif (parts) {\n\t\t\t\treturn parts.value;\n\t\t\t}\n\t\t}\n\t\t// FileReferences or unresolved OneReference\n\t\treturn basename(element.uri);\n\t}\n}\n\nexport class IdentityProvider implements IIdentityProvider<TreeElement> {\n\n\tgetId(element: TreeElement): { toString(): string } {\n\t\treturn element instanceof OneReference ? element.id : element.uri;\n\t}\n}\n\n//#region render: File\n\nclass FileReferencesTemplate extends Disposable {\n\n\treadonly file: IconLabel;\n\treadonly badge: CountBadge;\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\t@ILabelService private readonly _uriLabel: ILabelService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tconst parent = document.createElement('div');\n\t\tparent.classList.add('reference-file');\n\t\tthis.file = this._register(new IconLabel(parent, { supportHighlights: true }));\n\n\t\tthis.badge = new CountBadge(dom.append(parent, dom.$('.count')));\n\t\tthis._register(attachBadgeStyler(this.badge, themeService));\n\n\t\tcontainer.appendChild(parent);\n\t}\n\n\tset(element: FileReferences, matches: IMatch[]) {\n\t\tlet parent = dirname(element.uri);\n\t\tthis.file.setLabel(getBaseLabel(element.uri), this._uriLabel.getUriLabel(parent, { relative: true }), { title: this._uriLabel.getUriLabel(element.uri), matches });\n\t\tconst len = element.children.length;\n\t\tthis.badge.setCount(len);\n\t\tif (len > 1) {\n\t\t\tthis.badge.setTitleFormat(localize('referencesCount', \"{0} references\", len));\n\t\t} else {\n\t\t\tthis.badge.setTitleFormat(localize('referenceCount', \"{0} reference\", len));\n\t\t}\n\t}\n}\n\nexport class FileReferencesRenderer implements ITreeRenderer<FileReferences, FuzzyScore, FileReferencesTemplate> {\n\n\tstatic readonly id = 'FileReferencesRenderer';\n\n\treadonly templateId: string = FileReferencesRenderer.id;\n\n\tconstructor(@IInstantiationService private readonly _instantiationService: IInstantiationService) { }\n\n\trenderTemplate(container: HTMLElement): FileReferencesTemplate {\n\t\treturn this._instantiationService.createInstance(FileReferencesTemplate, container);\n\t}\n\trenderElement(node: ITreeNode<FileReferences, FuzzyScore>, index: number, template: FileReferencesTemplate): void {\n\t\ttemplate.set(node.element, createMatches(node.filterData));\n\t}\n\tdisposeTemplate(templateData: FileReferencesTemplate): void {\n\t\ttemplateData.dispose();\n\t}\n}\n\n//#endregion\n\n//#region render: Reference\nclass OneReferenceTemplate {\n\n\treadonly label: HighlightedLabel;\n\n\tconstructor(container: HTMLElement) {\n\t\tthis.label = new HighlightedLabel(container);\n\t}\n\n\tset(element: OneReference, score?: FuzzyScore): void {\n\t\tconst preview = element.parent.getPreview(element)?.preview(element.range);\n\t\tif (!preview || !preview.value) {\n\t\t\t// this means we FAILED to resolve the document or the value is the empty string\n\t\t\tthis.label.set(`${basename(element.uri)}:${element.range.startLineNumber + 1}:${element.range.startColumn + 1}`);\n\t\t} else {\n\t\t\t// render search match as highlight unless\n\t\t\t// we have score, then render the score\n\t\t\tconst { value, highlight } = preview;\n\t\t\tif (score && !FuzzyScore.isDefault(score)) {\n\t\t\t\tthis.label.element.classList.toggle('referenceMatch', false);\n\t\t\t\tthis.label.set(value, createMatches(score));\n\t\t\t} else {\n\t\t\t\tthis.label.element.classList.toggle('referenceMatch', true);\n\t\t\t\tthis.label.set(value, [highlight]);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class OneReferenceRenderer implements ITreeRenderer<OneReference, FuzzyScore, OneReferenceTemplate> {\n\n\tstatic readonly id = 'OneReferenceRenderer';\n\n\treadonly templateId: string = OneReferenceRenderer.id;\n\n\trenderTemplate(container: HTMLElement): OneReferenceTemplate {\n\t\treturn new OneReferenceTemplate(container);\n\t}\n\trenderElement(node: ITreeNode<OneReference, FuzzyScore>, index: number, templateData: OneReferenceTemplate): void {\n\t\ttemplateData.set(node.element, node.filterData);\n\t}\n\tdisposeTemplate(): void {\n\t}\n}\n\n//#endregion\n\n\nexport class AccessibilityProvider implements IListAccessibilityProvider<FileReferences | OneReference> {\n\n\tgetWidgetAriaLabel(): string {\n\t\treturn localize('treeAriaLabel', \"References\");\n\t}\n\n\tgetAriaLabel(element: FileReferences | OneReference): string | null {\n\t\treturn element.ariaMessage;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport 'vs/css!./ghostText';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { createStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport { IModelDeltaDecoration, PositionAffinity } from 'vs/editor/common/model';\nimport { ILanguageIdCodec } from 'vs/editor/common/languages';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ghostTextBackground, ghostTextBorder, ghostTextForeground } from 'vs/editor/common/core/editorColorRegistry';\nimport { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { InlineDecorationType } from 'vs/editor/common/viewModel';\nimport { GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nconst ttPolicy = window.trustedTypes?.createPolicy('editorGhostText', { createHTML: value => value });\n\nexport class GhostTextWidget extends Disposable {\n\tprivate disposed = false;\n\tprivate readonly partsWidget = this._register(this.instantiationService.createInstance(DecorationsWidget, this.editor));\n\tprivate readonly additionalLinesWidget = this._register(new AdditionalLinesWidget(this.editor, this.languageService.languageIdCodec));\n\tprivate viewMoreContentWidget: ViewMoreLinesContentWidget | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\tprivate readonly model: GhostTextWidgetModel,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t\t@ILanguageService private readonly languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(this.editor.onDidChangeConfiguration((e) => {\n\t\t\tif (\n\t\t\t\te.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t\t) {\n\t\t\t\tthis.update();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis.disposed = true;\n\t\t\tthis.update();\n\n\t\t\tthis.viewMoreContentWidget?.dispose();\n\t\t\tthis.viewMoreContentWidget = undefined;\n\t\t}));\n\n\t\tthis._register(model.onDidChange(() => {\n\t\t\tthis.update();\n\t\t}));\n\t\tthis.update();\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn (this.additionalLinesWidget.viewZoneId === viewZoneId);\n\t}\n\n\tprivate update(): void {\n\t\tconst ghostText = this.model.ghostText;\n\n\t\tif (!this.editor.hasModel() || !ghostText || this.disposed) {\n\t\t\tthis.partsWidget.clear();\n\t\t\tthis.additionalLinesWidget.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tconst inlineTexts = new Array<InsertedInlineText>();\n\t\tconst additionalLines = new Array<LineData>();\n\n\t\tfunction addToAdditionalLines(lines: readonly string[], className: string | undefined) {\n\t\t\tif (additionalLines.length > 0) {\n\t\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\t\tif (className) {\n\t\t\t\t\tlastLine.decorations.push(new LineDecoration(lastLine.content.length + 1, lastLine.content.length + 1 + lines[0].length, className, InlineDecorationType.Regular));\n\t\t\t\t}\n\t\t\t\tlastLine.content += lines[0];\n\n\t\t\t\tlines = lines.slice(1);\n\t\t\t}\n\t\t\tfor (const line of lines) {\n\t\t\t\tadditionalLines.push({\n\t\t\t\t\tcontent: line,\n\t\t\t\t\tdecorations: className ? [new LineDecoration(1, line.length + 1, className, InlineDecorationType.Regular)] : []\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst textBufferLine = this.editor.getModel().getLineContent(ghostText.lineNumber);\n\t\tthis.editor.getModel().getLineTokens(ghostText.lineNumber);\n\n\t\tlet hiddenTextStartColumn: number | undefined = undefined;\n\t\tlet lastIdx = 0;\n\t\tfor (const part of ghostText.parts) {\n\t\t\tlet lines = part.lines;\n\t\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\t\tinlineTexts.push({\n\t\t\t\t\tcolumn: part.column,\n\t\t\t\t\ttext: lines[0],\n\t\t\t\t\tpreview: part.preview,\n\t\t\t\t});\n\t\t\t\tlines = lines.slice(1);\n\t\t\t} else {\n\t\t\t\taddToAdditionalLines([textBufferLine.substring(lastIdx, part.column - 1)], undefined);\n\t\t\t}\n\n\t\t\tif (lines.length > 0) {\n\t\t\t\taddToAdditionalLines(lines, 'ghost-text');\n\t\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlastIdx = part.column - 1;\n\t\t}\n\t\tif (hiddenTextStartColumn !== undefined) {\n\t\t\taddToAdditionalLines([textBufferLine.substring(lastIdx)], undefined);\n\t\t}\n\n\t\tthis.partsWidget.setParts(ghostText.lineNumber, inlineTexts,\n\t\t\thiddenTextStartColumn !== undefined ? { column: hiddenTextStartColumn, length: textBufferLine.length + 1 - hiddenTextStartColumn } : undefined);\n\t\tthis.additionalLinesWidget.updateLines(ghostText.lineNumber, additionalLines, ghostText.additionalReservedLineCount);\n\n\t\tif (ghostText.parts.some(p => p.lines.length < 0)) {\n\t\t\t// Not supported at the moment, condition is always false.\n\t\t\tthis.viewMoreContentWidget = this.renderViewMoreLines(\n\t\t\t\tnew Position(ghostText.lineNumber, this.editor.getModel()!.getLineMaxColumn(ghostText.lineNumber)),\n\t\t\t\t'', 0\n\t\t\t);\n\t\t} else {\n\t\t\tthis.viewMoreContentWidget?.dispose();\n\t\t\tthis.viewMoreContentWidget = undefined;\n\t\t}\n\t}\n\n\tprivate renderViewMoreLines(position: Position, firstLineText: string, remainingLinesLength: number): ViewMoreLinesContentWidget {\n\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\tconst domNode = document.createElement('div');\n\t\tdomNode.className = 'suggest-preview-additional-widget';\n\t\tapplyFontInfo(domNode, fontInfo);\n\n\t\tconst spacer = document.createElement('span');\n\t\tspacer.className = 'content-spacer';\n\t\tspacer.append(firstLineText);\n\t\tdomNode.append(spacer);\n\n\t\tconst newline = document.createElement('span');\n\t\tnewline.className = 'content-newline suggest-preview-text';\n\t\tnewline.append('⎠');\n\t\tdomNode.append(newline);\n\n\t\tconst disposableStore = new DisposableStore();\n\n\t\tconst button = document.createElement('div');\n\t\tbutton.className = 'button suggest-preview-text';\n\t\tbutton.append(`+${remainingLinesLength} lines…`);\n\n\t\tdisposableStore.add(dom.addStandardDisposableListener(button, 'mousedown', (e) => {\n\t\t\tthis.model?.setExpanded(true);\n\t\t\te.preventDefault();\n\t\t\tthis.editor.focus();\n\t\t}));\n\n\t\tdomNode.append(button);\n\t\treturn new ViewMoreLinesContentWidget(this.editor, position, domNode, disposableStore);\n\t}\n}\n\ninterface HiddenText {\n\tcolumn: number;\n\tlength: number;\n}\n\ninterface InsertedInlineText {\n\tcolumn: number;\n\ttext: string;\n\tpreview: boolean;\n}\n\nclass DecorationsWidget implements IDisposable {\n\tprivate decorationIds: string[] = [];\n\tprivate disposableStore: DisposableStore = new DisposableStore();\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor\n\t) {\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.clear();\n\t\tthis.disposableStore.dispose();\n\t}\n\n\tpublic clear(): void {\n\t\tthis.editor.deltaDecorations(this.decorationIds, []);\n\t\tthis.disposableStore.clear();\n\t}\n\n\tpublic setParts(lineNumber: number, parts: InsertedInlineText[], hiddenText?: HiddenText): void {\n\t\tthis.disposableStore.clear();\n\n\t\tconst textModel = this.editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hiddenTextDecorations = new Array<IModelDeltaDecoration>();\n\t\tif (hiddenText) {\n\t\t\thiddenTextDecorations.push({\n\t\t\t\trange: Range.fromPositions(new Position(lineNumber, hiddenText.column), new Position(lineNumber, hiddenText.column + hiddenText.length)),\n\t\t\t\toptions: {\n\t\t\t\t\tinlineClassName: 'ghost-text-hidden',\n\t\t\t\t\tdescription: 'ghost-text-hidden'\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis.decorationIds = this.editor.deltaDecorations(this.decorationIds, parts.map<IModelDeltaDecoration>(p => {\n\t\t\treturn ({\n\t\t\t\trange: Range.fromPositions(new Position(lineNumber, p.column)),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'ghost-text',\n\t\t\t\t\tafter: { content: p.text, inlineClassName: p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration' },\n\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t}\n\t\t\t});\n\t\t}).concat(hiddenTextDecorations));\n\t}\n}\n\nclass AdditionalLinesWidget implements IDisposable {\n\tprivate _viewZoneId: string | undefined = undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneId; }\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\tprivate readonly languageIdCodec: ILanguageIdCodec\n\t) { }\n\n\tpublic dispose(): void {\n\t\tthis.clear();\n\t}\n\n\tpublic clear(): void {\n\t\tthis.editor.changeViewZones((changeAccessor) => {\n\t\t\tif (this._viewZoneId) {\n\t\t\t\tchangeAccessor.removeZone(this._viewZoneId);\n\t\t\t\tthis._viewZoneId = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this.editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis.editor.changeViewZones((changeAccessor) => {\n\t\t\tif (this._viewZoneId) {\n\t\t\t\tchangeAccessor.removeZone(this._viewZoneId);\n\t\t\t\tthis._viewZoneId = undefined;\n\t\t\t}\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this.editor.getOptions(), this.languageIdCodec);\n\n\t\t\t\tthis._viewZoneId = changeAccessor.addZone({\n\t\t\t\t\tafterLineNumber: lineNumber,\n\t\t\t\t\theightInLines: heightInLines,\n\t\t\t\t\tdomNode,\n\t\t\t\t\tafterColumnAffinity: PositionAffinity.Right\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}\n\ninterface LineData {\n\tcontent: string;\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, languageIdCodec: ILanguageIdCodec): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tconst sb = createStringBuilder(10000);\n\tsb.appendASCIIString('<div class=\"suggest-preview-text\">');\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst line = lineData.content;\n\t\tsb.appendASCIIString('<div class=\"view-line');\n\t\tsb.appendASCIIString('\" style=\"top:');\n\t\tsb.appendASCIIString(String(i * lineHeight));\n\t\tsb.appendASCIIString('px;width:1000000px;\">');\n\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\t\tconst lineTokens = LineTokens.createEmpty(line, languageIdCodec);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull\n\t\t), sb);\n\n\t\tsb.appendASCIIString('</div>');\n\t}\n\tsb.appendASCIIString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nclass ViewMoreLinesContentWidget extends Disposable implements IContentWidget {\n\treadonly allowEditorOverflow = false;\n\treadonly suppressMouseDown = false;\n\n\tconstructor(\n\t\tprivate editor: ICodeEditor,\n\t\tprivate position: Position,\n\t\tprivate domNode: HTMLElement,\n\t\tdisposableStore: DisposableStore\n\t) {\n\t\tsuper();\n\t\tthis._register(disposableStore);\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis.editor.removeContentWidget(this);\n\t\t}));\n\t\tthis.editor.addContentWidget(this);\n\t}\n\n\tgetId(): string {\n\t\treturn 'editor.widget.viewMoreLinesWidget';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\treturn {\n\t\t\tposition: this.position,\n\t\t\tpreference: [ContentWidgetPositionPreference.EXACT]\n\t\t};\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst foreground = theme.getColor(ghostTextForeground);\n\tif (foreground) {\n\t\t// `!important` ensures that other decorations don't cause a style conflict (#132017).\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration { color: ${foreground.toString()} !important; }`);\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${foreground.toString()} !important; }`);\n\t\tcollector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { color: ${foreground.toString()} !important; }`);\n\t}\n\n\tconst background = theme.getColor(ghostTextBackground);\n\tif (background) {\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration { background-color: ${background.toString()}; }`);\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration-preview { background-color: ${background.toString()}; }`);\n\t\tcollector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { background-color: ${background.toString()}; }`);\n\t}\n\n\tconst border = theme.getColor(ghostTextBorder);\n\tif (border) {\n\t\tcollector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${border}; }`);\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${border}; }`);\n\t\tcollector.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${border}; }`);\n\t}\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Event } from 'vs/base/common/event';\nimport { once } from 'vs/base/common/functional';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { getCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IDiffEditor, IEditor, ScrollType } from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from 'vs/editor/common/model';\nimport { overviewRulerRangeHighlight } from 'vs/editor/common/core/editorColorRegistry';\nimport { IQuickAccessProvider } from 'vs/platform/quickinput/common/quickAccess';\nimport { IKeyMods, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\nimport { themeColorFromId } from 'vs/platform/theme/common/themeService';\n\ninterface IEditorLineDecoration {\n\trangeHighlightId: string;\n\toverviewRulerDecorationId: string;\n}\n\nexport interface IEditorNavigationQuickAccessOptions {\n\tcanAcceptInBackground?: boolean;\n}\n\nexport interface IQuickAccessTextEditorContext {\n\n\t/**\n\t * The current active editor.\n\t */\n\treadonly editor: IEditor;\n\n\t/**\n\t * If defined, allows to restore the original view state\n\t * the text editor had before quick access opened.\n\t */\n\trestoreViewState?: () => void;\n}\n\n/**\n * A reusable quick access provider for the editor with support\n * for adding decorations for navigating in the currently active file\n * (for example \"Go to line\", \"Go to symbol\").\n */\nexport abstract class AbstractEditorNavigationQuickAccessProvider implements IQuickAccessProvider {\n\n\tconstructor(protected options?: IEditorNavigationQuickAccessOptions) { }\n\n\t//#region Provider methods\n\n\tprovide(picker: IQuickPick<IQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Provide based on current active editor\n\t\tconst pickerDisposable = disposables.add(new MutableDisposable());\n\t\tpickerDisposable.value = this.doProvide(picker, token);\n\n\t\t// Re-create whenever the active editor changes\n\t\tdisposables.add(this.onDidActiveTextEditorControlChange(() => {\n\n\t\t\t// Clear old\n\t\t\tpickerDisposable.value = undefined;\n\n\t\t\t// Add new\n\t\t\tpickerDisposable.value = this.doProvide(picker, token);\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprivate doProvide(picker: IQuickPick<IQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// With text control\n\t\tconst editor = this.activeTextEditorControl;\n\t\tif (editor && this.canProvideWithTextEditor(editor)) {\n\t\t\tconst context: IQuickAccessTextEditorContext = { editor };\n\n\t\t\t// Restore any view state if this picker was closed\n\t\t\t// without actually going to a line\n\t\t\tconst codeEditor = getCodeEditor(editor);\n\t\t\tif (codeEditor) {\n\n\t\t\t\t// Remember view state and update it when the cursor position\n\t\t\t\t// changes even later because it could be that the user has\n\t\t\t\t// configured quick access to remain open when focus is lost and\n\t\t\t\t// we always want to restore the current location.\n\t\t\t\tlet lastKnownEditorViewState = withNullAsUndefined(editor.saveViewState());\n\t\t\t\tdisposables.add(codeEditor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tlastKnownEditorViewState = withNullAsUndefined(editor.saveViewState());\n\t\t\t\t}));\n\n\t\t\t\tcontext.restoreViewState = () => {\n\t\t\t\t\tif (lastKnownEditorViewState && editor === this.activeTextEditorControl) {\n\t\t\t\t\t\teditor.restoreViewState(lastKnownEditorViewState);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdisposables.add(once(token.onCancellationRequested)(() => context.restoreViewState?.()));\n\t\t\t}\n\n\t\t\t// Clean up decorations on dispose\n\t\t\tdisposables.add(toDisposable(() => this.clearDecorations(editor)));\n\n\t\t\t// Ask subclass for entries\n\t\t\tdisposables.add(this.provideWithTextEditor(context, picker, token));\n\t\t}\n\n\t\t// Without text control\n\t\telse {\n\t\t\tdisposables.add(this.provideWithoutTextEditor(picker, token));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Subclasses to implement if they can operate on the text editor.\n\t */\n\tprotected canProvideWithTextEditor(editor: IEditor): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when an editor is active.\n\t */\n\tprotected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IQuickPickItem>, token: CancellationToken): IDisposable;\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when no editor is active.\n\t */\n\tprotected abstract provideWithoutTextEditor(picker: IQuickPick<IQuickPickItem>, token: CancellationToken): IDisposable;\n\n\tprotected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void {\n\t\teditor.setSelection(options.range);\n\t\teditor.revealRangeInCenter(options.range, ScrollType.Smooth);\n\t\tif (!options.preserveFocus) {\n\t\t\teditor.focus();\n\t\t}\n\t}\n\n\tprotected getModel(editor: IEditor | IDiffEditor): ITextModel | undefined {\n\t\treturn isDiffEditor(editor) ?\n\t\t\teditor.getModel()?.modified :\n\t\t\teditor.getModel() as ITextModel;\n\t}\n\n\t//#endregion\n\n\n\t//#region Editor access\n\n\t/**\n\t * Subclasses to provide an event when the active editor control changes.\n\t */\n\tprotected abstract readonly onDidActiveTextEditorControlChange: Event<void>;\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\t//#endregion\n\n\n\t//#region Decorations Utils\n\n\tprivate rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;\n\n\tprotected addDecorations(editor: IEditor, range: IRange): void {\n\t\teditor.changeDecorations(changeAccessor => {\n\n\t\t\t// Reset old decorations if any\n\t\t\tconst deleteDecorations: string[] = [];\n\t\t\tif (this.rangeHighlightDecorationId) {\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId);\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId);\n\n\t\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t\t}\n\n\t\t\t// Add new decorations for the range\n\t\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\n\t\t\t\t// highlight the entire line on the range\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight',\n\t\t\t\t\t\tclassName: 'rangeHighlight',\n\t\t\t\t\t\tisWholeLine: true\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// also add overview ruler highlight\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight-overview',\n\t\t\t\t\t\toverviewRuler: {\n\t\t\t\t\t\t\tcolor: themeColorFromId(overviewRulerRangeHighlight),\n\t\t\t\t\t\t\tposition: OverviewRulerLane.Full\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tconst [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations);\n\n\t\t\tthis.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId };\n\t\t});\n\t}\n\n\tprotected clearDecorations(editor: IEditor): void {\n\t\tconst rangeHighlightDecorationId = this.rangeHighlightDecorationId;\n\t\tif (rangeHighlightDecorationId) {\n\t\t\teditor.changeDecorations(changeAccessor => {\n\t\t\t\tchangeAccessor.deltaDecorations([\n\t\t\t\t\trangeHighlightDecorationId.overviewRulerDecorationId,\n\t\t\t\t\trangeHighlightDecorationId.rangeHighlightId\n\t\t\t\t], []);\n\t\t\t});\n\n\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t}\n\t}\n\n\t//#endregion\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { getCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IEditor, ScrollType } from 'vs/editor/common/editorCommon';\nimport { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess';\nimport { localize } from 'vs/nls';\nimport { IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\n\ninterface IGotoLineQuickPickItem extends IQuickPickItem, Partial<IPosition> { }\n\nexport abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic PREFIX = ':';\n\n\tconstructor() {\n\t\tsuper({ canAcceptInBackground: true });\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoLineQuickPickItem>): IDisposable {\n\t\tconst label = localize('cannotRunGotoLine', \"Open a text editor first to go to a line.\");\n\n\t\tpicker.items = [{ label }];\n\t\tpicker.ariaLabel = label;\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoLineQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto line once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tif (!this.isValidLineNumber(editor, item.lineNumber)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// React to picker changes\n\t\tconst updatePickerAndEditor = () => {\n\t\t\tconst position = this.parsePosition(editor, picker.value.trim().substr(AbstractGotoLineQuickAccessProvider.PREFIX.length));\n\t\t\tconst label = this.getPickLabel(editor, position.lineNumber, position.column);\n\n\t\t\t// Picker\n\t\t\tpicker.items = [{\n\t\t\t\tlineNumber: position.lineNumber,\n\t\t\t\tcolumn: position.column,\n\t\t\t\tlabel\n\t\t\t}];\n\n\t\t\t// ARIA Label\n\t\t\tpicker.ariaLabel = label;\n\n\t\t\t// Clear decorations for invalid range\n\t\t\tif (!this.isValidLineNumber(editor, position.lineNumber)) {\n\t\t\t\tthis.clearDecorations(editor);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reveal\n\t\t\tconst range = this.toRange(position.lineNumber, position.column);\n\t\t\teditor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t\t// Decorate\n\t\t\tthis.addDecorations(editor, range);\n\t\t};\n\t\tupdatePickerAndEditor();\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerAndEditor()));\n\n\t\t// Adjust line number visibility as needed\n\t\tconst codeEditor = getCodeEditor(editor);\n\t\tif (codeEditor) {\n\t\t\tconst options = codeEditor.getOptions();\n\t\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\t\tif (lineNumbers.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tcodeEditor.updateOptions({ lineNumbers: 'on' });\n\n\t\t\t\tdisposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: 'relative' })));\n\t\t\t}\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate toRange(lineNumber = 1, column = 1): IRange {\n\t\treturn {\n\t\t\tstartLineNumber: lineNumber,\n\t\t\tstartColumn: column,\n\t\t\tendLineNumber: lineNumber,\n\t\t\tendColumn: column\n\t\t};\n\t}\n\n\tprivate parsePosition(editor: IEditor, value: string): IPosition {\n\n\t\t// Support line-col formats of `line,col`, `line:col`, `line#col`\n\t\tconst numbers = value.split(/,|:|#/).map(part => parseInt(part, 10)).filter(part => !isNaN(part));\n\t\tconst endLine = this.lineCount(editor) + 1;\n\n\t\treturn {\n\t\t\tlineNumber: numbers[0] > 0 ? numbers[0] : endLine + numbers[0],\n\t\t\tcolumn: numbers[1]\n\t\t};\n\t}\n\n\tprivate getPickLabel(editor: IEditor, lineNumber: number, column: number | undefined): string {\n\n\t\t// Location valid: indicate this as picker label\n\t\tif (this.isValidLineNumber(editor, lineNumber)) {\n\t\t\tif (this.isValidColumn(editor, lineNumber, column)) {\n\t\t\t\treturn localize('gotoLineColumnLabel', \"Go to line {0} and character {1}.\", lineNumber, column);\n\t\t\t}\n\n\t\t\treturn localize('gotoLineLabel', \"Go to line {0}.\", lineNumber);\n\t\t}\n\n\t\t// Location invalid: show generic label\n\t\tconst position = editor.getPosition() || { lineNumber: 1, column: 1 };\n\t\tconst lineCount = this.lineCount(editor);\n\t\tif (lineCount > 1) {\n\t\t\treturn localize('gotoLineLabelEmptyWithLimit', \"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.\", position.lineNumber, position.column, lineCount);\n\t\t}\n\n\t\treturn localize('gotoLineLabelEmpty', \"Current Line: {0}, Character: {1}. Type a line number to navigate to.\", position.lineNumber, position.column);\n\t}\n\n\tprivate isValidLineNumber(editor: IEditor, lineNumber: number | undefined): boolean {\n\t\tif (!lineNumber || typeof lineNumber !== 'number') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn lineNumber > 0 && lineNumber <= this.lineCount(editor);\n\t}\n\n\tprivate isValidColumn(editor: IEditor, lineNumber: number, column: number | undefined): boolean {\n\t\tif (!column || typeof column !== 'number') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst positionCandidate = { lineNumber, column };\n\n\t\treturn model.validatePosition(positionCandidate).equals(positionCandidate);\n\t}\n\n\tprivate lineCount(editor: IEditor): number {\n\t\treturn this.getModel(editor)?.getLineCount() ?? 0;\n\t}\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 { DeferredPromise } from 'vs/base/common/async';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { IMatch } from 'vs/base/common/filters';\nimport { IPreparedQuery, pieceToQuery, prepareQuery, scoreFuzzy2 } from 'vs/base/common/fuzzyScorer';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { format, trim } from 'vs/base/common/strings';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DocumentSymbol, SymbolKind, SymbolKinds, SymbolTag } from 'vs/editor/common/languages';\nimport { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel';\nimport { AbstractEditorNavigationQuickAccessProvider, IEditorNavigationQuickAccessOptions, IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess';\nimport { localize } from 'vs/nls';\nimport { IQuickPick, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport interface IGotoSymbolQuickPickItem extends IQuickPickItem {\n\tkind: SymbolKind;\n\tindex: number;\n\tscore?: number;\n\trange?: { decoration: IRange; selection: IRange };\n}\n\nexport interface IGotoSymbolQuickAccessProviderOptions extends IEditorNavigationQuickAccessOptions {\n\topenSideBySideDirection?: () => undefined | 'right' | 'down';\n}\n\nexport abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic PREFIX = '@';\n\tstatic SCOPE_PREFIX = ':';\n\tstatic PREFIX_BY_CATEGORY = `${AbstractGotoSymbolQuickAccessProvider.PREFIX}${AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX}`;\n\n\tprotected override readonly options: IGotoSymbolQuickAccessProviderOptions;\n\n\tconstructor(\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IOutlineModelService private readonly _outlineModelService: IOutlineModelService,\n\t\toptions: IGotoSymbolQuickAccessProviderOptions = Object.create(null)\n\t) {\n\t\tsuper(options);\n\n\t\tthis.options = options;\n\t\tthis.options.canAcceptInBackground = true;\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoSymbolQuickPickItem>): IDisposable {\n\t\tthis.provideLabelPick(picker, localize('cannotRunGotoSymbolWithoutEditor', \"To go to a symbol, first open a text editor with symbol information.\"));\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoSymbolQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn Disposable.None;\n\t\t}\n\n\t\t// Provide symbols from model if available in registry\n\t\tif (this._languageFeaturesService.documentSymbolProvider.has(model)) {\n\t\t\treturn this.doProvideWithEditorSymbols(context, model, picker, token);\n\t\t}\n\n\t\t// Otherwise show an entry for a model without registry\n\t\t// But give a chance to resolve the symbols at a later\n\t\t// point if possible\n\t\treturn this.doProvideWithoutEditorSymbols(context, model, picker, token);\n\t}\n\n\tprivate doProvideWithoutEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick<IGotoSymbolQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Generic pick for not having any symbol information\n\t\tthis.provideLabelPick(picker, localize('cannotRunGotoSymbolWithoutSymbolProvider', \"The active text editor does not provide symbol information.\"));\n\n\t\t// Wait for changes to the registry and see if eventually\n\t\t// we do get symbols. This can happen if the picker is opened\n\t\t// very early after the model has loaded but before the\n\t\t// language registry is ready.\n\t\t// https://github.com/microsoft/vscode/issues/70607\n\t\t(async () => {\n\t\t\tconst result = await this.waitForLanguageSymbolRegistry(model, disposables);\n\t\t\tif (!result || token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdisposables.add(this.doProvideWithEditorSymbols(context, model, picker, token));\n\t\t})();\n\n\t\treturn disposables;\n\t}\n\n\tprivate provideLabelPick(picker: IQuickPick<IGotoSymbolQuickPickItem>, label: string): void {\n\t\tpicker.items = [{ label, index: 0, kind: SymbolKind.String }];\n\t\tpicker.ariaLabel = label;\n\t}\n\n\tprotected async waitForLanguageSymbolRegistry(model: ITextModel, disposables: DisposableStore): Promise<boolean> {\n\t\tif (this._languageFeaturesService.documentSymbolProvider.has(model)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst symbolProviderRegistryPromise = new DeferredPromise<boolean>();\n\n\t\t// Resolve promise when registry knows model\n\t\tconst symbolProviderListener = disposables.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => {\n\t\t\tif (this._languageFeaturesService.documentSymbolProvider.has(model)) {\n\t\t\t\tsymbolProviderListener.dispose();\n\n\t\t\t\tsymbolProviderRegistryPromise.complete(true);\n\t\t\t}\n\t\t}));\n\n\t\t// Resolve promise when we get disposed too\n\t\tdisposables.add(toDisposable(() => symbolProviderRegistryPromise.complete(false)));\n\n\t\treturn symbolProviderRegistryPromise.p;\n\t}\n\n\tprivate doProvideWithEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick<IGotoSymbolQuickPickItem>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto symbol once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item && item.range) {\n\t\t\t\tthis.gotoLocation(context, { range: item.range.selection, keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Goto symbol side by side if enabled\n\t\tdisposables.add(picker.onDidTriggerItemButton(({ item }) => {\n\t\t\tif (item && item.range) {\n\t\t\t\tthis.gotoLocation(context, { range: item.range.selection, keyMods: picker.keyMods, forceSideBySide: true });\n\n\t\t\t\tpicker.hide();\n\t\t\t}\n\t\t}));\n\n\t\t// Resolve symbols from document once and reuse this\n\t\t// request for all filtering and typing then on\n\t\tconst symbolsPromise = this.getDocumentSymbols(model, token);\n\n\t\t// Set initial picks and update on type\n\t\tlet picksCts: CancellationTokenSource | undefined = undefined;\n\t\tconst updatePickerItems = async () => {\n\n\t\t\t// Cancel any previous ask for picks and busy\n\t\t\tpicksCts?.dispose(true);\n\t\t\tpicker.busy = false;\n\n\t\t\t// Create new cancellation source for this run\n\t\t\tpicksCts = new CancellationTokenSource(token);\n\n\t\t\t// Collect symbol picks\n\t\t\tpicker.busy = true;\n\t\t\ttry {\n\t\t\t\tconst query = prepareQuery(picker.value.substr(AbstractGotoSymbolQuickAccessProvider.PREFIX.length).trim());\n\t\t\t\tconst items = await this.doGetSymbolPicks(symbolsPromise, query, undefined, picksCts.token);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (items.length > 0) {\n\t\t\t\t\tpicker.items = items;\n\t\t\t\t} else {\n\t\t\t\t\tif (query.original.length > 0) {\n\t\t\t\t\t\tthis.provideLabelPick(picker, localize('noMatchingSymbolResults', \"No matching editor symbols\"));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.provideLabelPick(picker, localize('noSymbolResults', \"No editor symbols\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (!token.isCancellationRequested) {\n\t\t\t\t\tpicker.busy = false;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerItems()));\n\t\tupdatePickerItems();\n\n\t\t// Reveal and decorate when active item changes\n\t\t// However, ignore the very first event so that\n\t\t// opening the picker is not immediately revealing\n\t\t// and decorating the first entry.\n\t\tlet ignoreFirstActiveEvent = true;\n\t\tdisposables.add(picker.onDidChangeActive(() => {\n\t\t\tconst [item] = picker.activeItems;\n\t\t\tif (item && item.range) {\n\t\t\t\tif (ignoreFirstActiveEvent) {\n\t\t\t\t\tignoreFirstActiveEvent = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Reveal\n\t\t\t\teditor.revealRangeInCenter(item.range.selection, ScrollType.Smooth);\n\n\t\t\t\t// Decorate\n\t\t\t\tthis.addDecorations(editor, item.range.decoration);\n\t\t\t}\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprotected async doGetSymbolPicks(symbolsPromise: Promise<DocumentSymbol[]>, query: IPreparedQuery, options: { extraContainerLabel?: string } | undefined, token: CancellationToken): Promise<Array<IGotoSymbolQuickPickItem | IQuickPickSeparator>> {\n\t\tconst symbols = await symbolsPromise;\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst filterBySymbolKind = query.original.indexOf(AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX) === 0;\n\t\tconst filterPos = filterBySymbolKind ? 1 : 0;\n\n\t\t// Split between symbol and container query\n\t\tlet symbolQuery: IPreparedQuery;\n\t\tlet containerQuery: IPreparedQuery | undefined;\n\t\tif (query.values && query.values.length > 1) {\n\t\t\tsymbolQuery = pieceToQuery(query.values[0]); \t\t // symbol: only match on first part\n\t\t\tcontainerQuery = pieceToQuery(query.values.slice(1)); // container: match on all but first parts\n\t\t} else {\n\t\t\tsymbolQuery = query;\n\t\t}\n\n\t\t// Convert to symbol picks and apply filtering\n\t\tconst filteredSymbolPicks: IGotoSymbolQuickPickItem[] = [];\n\t\tfor (let index = 0; index < symbols.length; index++) {\n\t\t\tconst symbol = symbols[index];\n\n\t\t\tconst symbolLabel = trim(symbol.name);\n\t\t\tconst symbolLabelWithIcon = `$(${SymbolKinds.toIcon(symbol.kind).id}) ${symbolLabel}`;\n\t\t\tconst symbolLabelIconOffset = symbolLabelWithIcon.length - symbolLabel.length;\n\n\t\t\tlet containerLabel = symbol.containerName;\n\t\t\tif (options?.extraContainerLabel) {\n\t\t\t\tif (containerLabel) {\n\t\t\t\t\tcontainerLabel = `${options.extraContainerLabel} • ${containerLabel}`;\n\t\t\t\t} else {\n\t\t\t\t\tcontainerLabel = options.extraContainerLabel;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet symbolScore: number | undefined = undefined;\n\t\t\tlet symbolMatches: IMatch[] | undefined = undefined;\n\n\t\t\tlet containerScore: number | undefined = undefined;\n\t\t\tlet containerMatches: IMatch[] | undefined = undefined;\n\n\t\t\tif (query.original.length > filterPos) {\n\n\t\t\t\t// First: try to score on the entire query, it is possible that\n\t\t\t\t// the symbol matches perfectly (e.g. searching for \"change log\"\n\t\t\t\t// can be a match on a markdown symbol \"change log\"). In that\n\t\t\t\t// case we want to skip the container query altogether.\n\t\t\t\tlet skipContainerQuery = false;\n\t\t\t\tif (symbolQuery !== query) {\n\t\t\t\t\t[symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, { ...query, values: undefined /* disable multi-query support */ }, filterPos, symbolLabelIconOffset);\n\t\t\t\t\tif (typeof symbolScore === 'number') {\n\t\t\t\t\t\tskipContainerQuery = true; // since we consumed the query, skip any container matching\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Otherwise: score on the symbol query and match on the container later\n\t\t\t\tif (typeof symbolScore !== 'number') {\n\t\t\t\t\t[symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, symbolQuery, filterPos, symbolLabelIconOffset);\n\t\t\t\t\tif (typeof symbolScore !== 'number') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Score by container if specified\n\t\t\t\tif (!skipContainerQuery && containerQuery) {\n\t\t\t\t\tif (containerLabel && containerQuery.original.length > 0) {\n\t\t\t\t\t\t[containerScore, containerMatches] = scoreFuzzy2(containerLabel, containerQuery);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof containerScore !== 'number') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof symbolScore === 'number') {\n\t\t\t\t\t\tsymbolScore += containerScore; // boost symbolScore by containerScore\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst deprecated = symbol.tags && symbol.tags.indexOf(SymbolTag.Deprecated) >= 0;\n\n\t\t\tfilteredSymbolPicks.push({\n\t\t\t\tindex,\n\t\t\t\tkind: symbol.kind,\n\t\t\t\tscore: symbolScore,\n\t\t\t\tlabel: symbolLabelWithIcon,\n\t\t\t\tariaLabel: symbolLabel,\n\t\t\t\tdescription: containerLabel,\n\t\t\t\thighlights: deprecated ? undefined : {\n\t\t\t\t\tlabel: symbolMatches,\n\t\t\t\t\tdescription: containerMatches\n\t\t\t\t},\n\t\t\t\trange: {\n\t\t\t\t\tselection: Range.collapseToStart(symbol.selectionRange),\n\t\t\t\t\tdecoration: symbol.range\n\t\t\t\t},\n\t\t\t\tstrikethrough: deprecated,\n\t\t\t\tbuttons: (() => {\n\t\t\t\t\tconst openSideBySideDirection = this.options?.openSideBySideDirection ? this.options?.openSideBySideDirection() : undefined;\n\t\t\t\t\tif (!openSideBySideDirection) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonClass: openSideBySideDirection === 'right' ? Codicon.splitHorizontal.classNames : Codicon.splitVertical.classNames,\n\t\t\t\t\t\t\ttooltip: openSideBySideDirection === 'right' ? localize('openToSide', \"Open to the Side\") : localize('openToBottom', \"Open to the Bottom\")\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\t\t\t\t})()\n\t\t\t});\n\t\t}\n\n\t\t// Sort by score\n\t\tconst sortedFilteredSymbolPicks = filteredSymbolPicks.sort((symbolA, symbolB) => filterBySymbolKind ?\n\t\t\tthis.compareByKindAndScore(symbolA, symbolB) :\n\t\t\tthis.compareByScore(symbolA, symbolB)\n\t\t);\n\n\t\t// Add separator for types\n\t\t// - @ only total number of symbols\n\t\t// - @: grouped by symbol kind\n\t\tlet symbolPicks: Array<IGotoSymbolQuickPickItem | IQuickPickSeparator> = [];\n\t\tif (filterBySymbolKind) {\n\t\t\tlet lastSymbolKind: SymbolKind | undefined = undefined;\n\t\t\tlet lastSeparator: IQuickPickSeparator | undefined = undefined;\n\t\t\tlet lastSymbolKindCounter = 0;\n\n\t\t\tfunction updateLastSeparatorLabel(): void {\n\t\t\t\tif (lastSeparator && typeof lastSymbolKind === 'number' && lastSymbolKindCounter > 0) {\n\t\t\t\t\tlastSeparator.label = format(NLS_SYMBOL_KIND_CACHE[lastSymbolKind] || FALLBACK_NLS_SYMBOL_KIND, lastSymbolKindCounter);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const symbolPick of sortedFilteredSymbolPicks) {\n\n\t\t\t\t// Found new kind\n\t\t\t\tif (lastSymbolKind !== symbolPick.kind) {\n\n\t\t\t\t\t// Update last separator with number of symbols we found for kind\n\t\t\t\t\tupdateLastSeparatorLabel();\n\n\t\t\t\t\tlastSymbolKind = symbolPick.kind;\n\t\t\t\t\tlastSymbolKindCounter = 1;\n\n\t\t\t\t\t// Add new separator for new kind\n\t\t\t\t\tlastSeparator = { type: 'separator' };\n\t\t\t\t\tsymbolPicks.push(lastSeparator);\n\t\t\t\t}\n\n\t\t\t\t// Existing kind, keep counting\n\t\t\t\telse {\n\t\t\t\t\tlastSymbolKindCounter++;\n\t\t\t\t}\n\n\t\t\t\t// Add to final result\n\t\t\t\tsymbolPicks.push(symbolPick);\n\t\t\t}\n\n\t\t\t// Update last separator with number of symbols we found for kind\n\t\t\tupdateLastSeparatorLabel();\n\t\t} else if (sortedFilteredSymbolPicks.length > 0) {\n\t\t\tsymbolPicks = [\n\t\t\t\t{ label: localize('symbols', \"symbols ({0})\", filteredSymbolPicks.length), type: 'separator' },\n\t\t\t\t...sortedFilteredSymbolPicks\n\t\t\t];\n\t\t}\n\n\t\treturn symbolPicks;\n\t}\n\n\tprivate compareByScore(symbolA: IGotoSymbolQuickPickItem, symbolB: IGotoSymbolQuickPickItem): number {\n\t\tif (typeof symbolA.score !== 'number' && typeof symbolB.score === 'number') {\n\t\t\treturn 1;\n\t\t} else if (typeof symbolA.score === 'number' && typeof symbolB.score !== 'number') {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (typeof symbolA.score === 'number' && typeof symbolB.score === 'number') {\n\t\t\tif (symbolA.score > symbolB.score) {\n\t\t\t\treturn -1;\n\t\t\t} else if (symbolA.score < symbolB.score) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tif (symbolA.index < symbolB.index) {\n\t\t\treturn -1;\n\t\t} else if (symbolA.index > symbolB.index) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate compareByKindAndScore(symbolA: IGotoSymbolQuickPickItem, symbolB: IGotoSymbolQuickPickItem): number {\n\t\tconst kindA = NLS_SYMBOL_KIND_CACHE[symbolA.kind] || FALLBACK_NLS_SYMBOL_KIND;\n\t\tconst kindB = NLS_SYMBOL_KIND_CACHE[symbolB.kind] || FALLBACK_NLS_SYMBOL_KIND;\n\n\t\t// Sort by type first if scoped search\n\t\tconst result = kindA.localeCompare(kindB);\n\t\tif (result === 0) {\n\t\t\treturn this.compareByScore(symbolA, symbolB);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected async getDocumentSymbols(document: ITextModel, token: CancellationToken): Promise<DocumentSymbol[]> {\n\t\tconst model = await this._outlineModelService.getOrCreate(document, token);\n\t\treturn token.isCancellationRequested ? [] : model.asListOfDocumentSymbols();\n\t}\n}\n\n// #region NLS Helpers\n\nconst FALLBACK_NLS_SYMBOL_KIND = localize('property', \"properties ({0})\");\nconst NLS_SYMBOL_KIND_CACHE: { [type: number]: string } = {\n\t[SymbolKind.Method]: localize('method', \"methods ({0})\"),\n\t[SymbolKind.Function]: localize('function', \"functions ({0})\"),\n\t[SymbolKind.Constructor]: localize('_constructor', \"constructors ({0})\"),\n\t[SymbolKind.Variable]: localize('variable', \"variables ({0})\"),\n\t[SymbolKind.Class]: localize('class', \"classes ({0})\"),\n\t[SymbolKind.Struct]: localize('struct', \"structs ({0})\"),\n\t[SymbolKind.Event]: localize('event', \"events ({0})\"),\n\t[SymbolKind.Operator]: localize('operator', \"operators ({0})\"),\n\t[SymbolKind.Interface]: localize('interface', \"interfaces ({0})\"),\n\t[SymbolKind.Namespace]: localize('namespace', \"namespaces ({0})\"),\n\t[SymbolKind.Package]: localize('package', \"packages ({0})\"),\n\t[SymbolKind.TypeParameter]: localize('typeParameter', \"type parameters ({0})\"),\n\t[SymbolKind.Module]: localize('modules', \"modules ({0})\"),\n\t[SymbolKind.Property]: localize('property', \"properties ({0})\"),\n\t[SymbolKind.Enum]: localize('enum', \"enumerations ({0})\"),\n\t[SymbolKind.EnumMember]: localize('enumMember', \"enumeration members ({0})\"),\n\t[SymbolKind.String]: localize('string', \"strings ({0})\"),\n\t[SymbolKind.File]: localize('file', \"files ({0})\"),\n\t[SymbolKind.Array]: localize('array', \"arrays ({0})\"),\n\t[SymbolKind.Number]: localize('number', \"numbers ({0})\"),\n\t[SymbolKind.Boolean]: localize('boolean', \"booleans ({0})\"),\n\t[SymbolKind.Object]: localize('object', \"objects ({0})\"),\n\t[SymbolKind.Key]: localize('key', \"keys ({0})\"),\n\t[SymbolKind.Field]: localize('field', \"fields ({0})\"),\n\t[SymbolKind.Constant]: localize('constant', \"constants ({0})\")\n};\n\n//#endregion\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport 'vs/css!./renameInputField';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { localize } from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { editorWidgetBackground, inputBackground, inputBorder, inputForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('renameInputVisible', false, localize('renameInputVisible', \"Whether the rename input widget is visible\"));\n\nexport interface RenameInputFieldResult {\n\tnewName: string;\n\twantsPreview?: boolean;\n}\n\nexport class RenameInputField implements IContentWidget {\n\n\tprivate _position?: Position;\n\tprivate _domNode?: HTMLElement;\n\tprivate _input?: HTMLInputElement;\n\tprivate _label?: HTMLDivElement;\n\tprivate _visible?: boolean;\n\tprivate readonly _visibleContextKey: IContextKey<boolean>;\n\tprivate readonly _disposables = new DisposableStore();\n\n\treadonly allowEditorOverflow: boolean = true;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _acceptKeybindings: [string, string],\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t) {\n\t\tthis._visibleContextKey = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService);\n\n\t\tthis._editor.addContentWidget(this);\n\n\t\tthis._disposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\n\t\tthis._disposables.add(_themeService.onDidColorThemeChange(this._updateStyles, this));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tgetId(): string {\n\t\treturn '__renameInputWidget';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\tif (!this._domNode) {\n\t\t\tthis._domNode = document.createElement('div');\n\t\t\tthis._domNode.className = 'monaco-editor rename-box';\n\n\t\t\tthis._input = document.createElement('input');\n\t\t\tthis._input.className = 'rename-input';\n\t\t\tthis._input.type = 'text';\n\t\t\tthis._input.setAttribute('aria-label', localize('renameAriaLabel', \"Rename input. Type new name and press Enter to commit.\"));\n\t\t\tthis._domNode.appendChild(this._input);\n\n\t\t\tthis._label = document.createElement('div');\n\t\t\tthis._label.className = 'rename-label';\n\t\t\tthis._domNode.appendChild(this._label);\n\t\t\tconst updateLabel = () => {\n\t\t\t\tconst [accept, preview] = this._acceptKeybindings;\n\t\t\t\tthis._keybindingService.lookupKeybinding(accept);\n\t\t\t\tthis._label!.innerText = localize({ key: 'label', comment: ['placeholders are keybindings, e.g \"F2 to Rename, Shift+F2 to Preview\"'] }, \"{0} to Rename, {1} to Preview\", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel());\n\t\t\t};\n\t\t\tupdateLabel();\n\t\t\tthis._disposables.add(this._keybindingService.onDidUpdateKeybindings(updateLabel));\n\n\t\t\tthis._updateFont();\n\t\t\tthis._updateStyles(this._themeService.getColorTheme());\n\t\t}\n\t\treturn this._domNode;\n\t}\n\n\tprivate _updateStyles(theme: IColorTheme): void {\n\t\tif (!this._input || !this._domNode) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst widgetShadowColor = theme.getColor(widgetShadow);\n\t\tthis._domNode.style.backgroundColor = String(theme.getColor(editorWidgetBackground) ?? '');\n\t\tthis._domNode.style.boxShadow = widgetShadowColor ? ` 0 0 8px 2px ${widgetShadowColor}` : '';\n\t\tthis._domNode.style.color = String(theme.getColor(inputForeground) ?? '');\n\n\t\tthis._input.style.backgroundColor = String(theme.getColor(inputBackground) ?? '');\n\t\t// this._input.style.color = String(theme.getColor(inputForeground) ?? '');\n\t\tconst border = theme.getColor(inputBorder);\n\t\tthis._input.style.borderWidth = border ? '1px' : '0px';\n\t\tthis._input.style.borderStyle = border ? 'solid' : 'none';\n\t\tthis._input.style.borderColor = border?.toString() ?? 'none';\n\t}\n\n\tprivate _updateFont(): void {\n\t\tif (!this._input || !this._label) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._input.style.fontFamily = fontInfo.fontFamily;\n\t\tthis._input.style.fontWeight = fontInfo.fontWeight;\n\t\tthis._input.style.fontSize = `${fontInfo.fontSize}px`;\n\n\t\tthis._label.style.fontSize = `${fontInfo.fontSize * 0.8}px`;\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (!this._visible) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._position!,\n\t\t\tpreference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tafterRender(position: ContentWidgetPositionPreference | null): void {\n\t\tif (!position) {\n\t\t\t// cancel rename when input widget isn't rendered anymore\n\t\t\tthis.cancelInput(true);\n\t\t}\n\t}\n\n\n\tprivate _currentAcceptInput?: (wantsPreview: boolean) => void;\n\tprivate _currentCancelInput?: (focusEditor: boolean) => void;\n\n\tacceptInput(wantsPreview: boolean): void {\n\t\tif (this._currentAcceptInput) {\n\t\t\tthis._currentAcceptInput(wantsPreview);\n\t\t}\n\t}\n\n\tcancelInput(focusEditor: boolean): void {\n\t\tif (this._currentCancelInput) {\n\t\t\tthis._currentCancelInput(focusEditor);\n\t\t}\n\t}\n\n\tgetInput(where: IRange, value: string, selectionStart: number, selectionEnd: number, supportPreview: boolean, token: CancellationToken): Promise<RenameInputFieldResult | boolean> {\n\n\t\tthis._domNode!.classList.toggle('preview', supportPreview);\n\n\t\tthis._position = new Position(where.startLineNumber, where.startColumn);\n\t\tthis._input!.value = value;\n\t\tthis._input!.setAttribute('selectionStart', selectionStart.toString());\n\t\tthis._input!.setAttribute('selectionEnd', selectionEnd.toString());\n\t\tthis._input!.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20);\n\n\t\tconst disposeOnDone = new DisposableStore();\n\n\t\treturn new Promise<RenameInputFieldResult | boolean>(resolve => {\n\n\t\t\tthis._currentCancelInput = (focusEditor) => {\n\t\t\t\tthis._currentAcceptInput = undefined;\n\t\t\t\tthis._currentCancelInput = undefined;\n\t\t\t\tresolve(focusEditor);\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tthis._currentAcceptInput = (wantsPreview) => {\n\t\t\t\tif (this._input!.value.trim().length === 0 || this._input!.value === value) {\n\t\t\t\t\t// empty or whitespace only or not changed\n\t\t\t\t\tthis.cancelInput(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._currentAcceptInput = undefined;\n\t\t\t\tthis._currentCancelInput = undefined;\n\t\t\t\tresolve({\n\t\t\t\t\tnewName: this._input!.value,\n\t\t\t\t\twantsPreview: supportPreview && wantsPreview\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tdisposeOnDone.add(token.onCancellationRequested(() => this.cancelInput(true)));\n\t\t\tdisposeOnDone.add(this._editor.onDidBlurEditorWidget(() => this.cancelInput(false)));\n\n\t\t\tthis._show();\n\n\t\t}).finally(() => {\n\t\t\tdisposeOnDone.dispose();\n\t\t\tthis._hide();\n\t\t});\n\t}\n\n\tprivate _show(): void {\n\t\tthis._editor.revealLineInCenterIfOutsideViewport(this._position!.lineNumber, ScrollType.Smooth);\n\t\tthis._visible = true;\n\t\tthis._visibleContextKey.set(true);\n\t\tthis._editor.layoutContentWidget(this);\n\n\t\tsetTimeout(() => {\n\t\t\tthis._input!.focus();\n\t\t\tthis._input!.setSelectionRange(\n\t\t\t\tparseInt(this._input!.getAttribute('selectionStart')!),\n\t\t\t\tparseInt(this._input!.getAttribute('selectionEnd')!));\n\t\t}, 100);\n\t}\n\n\tprivate _hide(): void {\n\t\tthis._visible = false;\n\t\tthis._visibleContextKey.reset();\n\t\tthis._editor.layoutContentWidget(this);\n\t}\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 { Codicon } from 'vs/base/common/codicons';\nimport { localize } from 'vs/nls';\nimport { foreground, registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport const SYMBOL_ICON_ARRAY_FOREGROUND = registerColor('symbolIcon.arrayForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.arrayForeground', 'The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_BOOLEAN_FOREGROUND = registerColor('symbolIcon.booleanForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.booleanForeground', 'The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_CLASS_FOREGROUND = registerColor('symbolIcon.classForeground', {\n\tdark: '#EE9D28',\n\tlight: '#D67E00',\n\thc: '#EE9D28'\n}, localize('symbolIcon.classForeground', 'The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_COLOR_FOREGROUND = registerColor('symbolIcon.colorForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.colorForeground', 'The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_CONSTANT_FOREGROUND = registerColor('symbolIcon.constantForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.constantForeground', 'The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_CONSTRUCTOR_FOREGROUND = registerColor('symbolIcon.constructorForeground', {\n\tdark: '#B180D7',\n\tlight: '#652D90',\n\thc: '#B180D7'\n}, localize('symbolIcon.constructorForeground', 'The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_ENUMERATOR_FOREGROUND = registerColor('symbolIcon.enumeratorForeground', {\n\tdark: '#EE9D28',\n\tlight: '#D67E00',\n\thc: '#EE9D28'\n}, localize('symbolIcon.enumeratorForeground', 'The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND = registerColor('symbolIcon.enumeratorMemberForeground', {\n\tdark: '#75BEFF',\n\tlight: '#007ACC',\n\thc: '#75BEFF'\n}, localize('symbolIcon.enumeratorMemberForeground', 'The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_EVENT_FOREGROUND = registerColor('symbolIcon.eventForeground', {\n\tdark: '#EE9D28',\n\tlight: '#D67E00',\n\thc: '#EE9D28'\n}, localize('symbolIcon.eventForeground', 'The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_FIELD_FOREGROUND = registerColor('symbolIcon.fieldForeground', {\n\tdark: '#75BEFF',\n\tlight: '#007ACC',\n\thc: '#75BEFF'\n}, localize('symbolIcon.fieldForeground', 'The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_FILE_FOREGROUND = registerColor('symbolIcon.fileForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.fileForeground', 'The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_FOLDER_FOREGROUND = registerColor('symbolIcon.folderForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.folderForeground', 'The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_FUNCTION_FOREGROUND = registerColor('symbolIcon.functionForeground', {\n\tdark: '#B180D7',\n\tlight: '#652D90',\n\thc: '#B180D7'\n}, localize('symbolIcon.functionForeground', 'The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_INTERFACE_FOREGROUND = registerColor('symbolIcon.interfaceForeground', {\n\tdark: '#75BEFF',\n\tlight: '#007ACC',\n\thc: '#75BEFF'\n}, localize('symbolIcon.interfaceForeground', 'The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_KEY_FOREGROUND = registerColor('symbolIcon.keyForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.keyForeground', 'The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_KEYWORD_FOREGROUND = registerColor('symbolIcon.keywordForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.keywordForeground', 'The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_METHOD_FOREGROUND = registerColor('symbolIcon.methodForeground', {\n\tdark: '#B180D7',\n\tlight: '#652D90',\n\thc: '#B180D7'\n}, localize('symbolIcon.methodForeground', 'The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_MODULE_FOREGROUND = registerColor('symbolIcon.moduleForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.moduleForeground', 'The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_NAMESPACE_FOREGROUND = registerColor('symbolIcon.namespaceForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.namespaceForeground', 'The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_NULL_FOREGROUND = registerColor('symbolIcon.nullForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.nullForeground', 'The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_NUMBER_FOREGROUND = registerColor('symbolIcon.numberForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.numberForeground', 'The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_OBJECT_FOREGROUND = registerColor('symbolIcon.objectForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.objectForeground', 'The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_OPERATOR_FOREGROUND = registerColor('symbolIcon.operatorForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.operatorForeground', 'The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_PACKAGE_FOREGROUND = registerColor('symbolIcon.packageForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.packageForeground', 'The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_PROPERTY_FOREGROUND = registerColor('symbolIcon.propertyForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.propertyForeground', 'The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_REFERENCE_FOREGROUND = registerColor('symbolIcon.referenceForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.referenceForeground', 'The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_SNIPPET_FOREGROUND = registerColor('symbolIcon.snippetForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.snippetForeground', 'The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_STRING_FOREGROUND = registerColor('symbolIcon.stringForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.stringForeground', 'The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_STRUCT_FOREGROUND = registerColor('symbolIcon.structForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.structForeground', 'The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_TEXT_FOREGROUND = registerColor('symbolIcon.textForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.textForeground', 'The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_TYPEPARAMETER_FOREGROUND = registerColor('symbolIcon.typeParameterForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.typeParameterForeground', 'The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_UNIT_FOREGROUND = registerColor('symbolIcon.unitForeground', {\n\tdark: foreground,\n\tlight: foreground,\n\thc: foreground\n}, localize('symbolIcon.unitForeground', 'The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nexport const SYMBOL_ICON_VARIABLE_FOREGROUND = registerColor('symbolIcon.variableForeground', {\n\tdark: '#75BEFF',\n\tlight: '#007ACC',\n\thc: '#75BEFF'\n}, localize('symbolIcon.variableForeground', 'The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.'));\n\nregisterThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {\n\n\tconst symbolIconArrayColor = theme.getColor(SYMBOL_ICON_ARRAY_FOREGROUND);\n\tif (symbolIconArrayColor) {\n\t\tcollector.addRule(`${Codicon.symbolArray.cssSelector} { color: ${symbolIconArrayColor}; }`);\n\t}\n\n\tconst symbolIconBooleanColor = theme.getColor(SYMBOL_ICON_BOOLEAN_FOREGROUND);\n\tif (symbolIconBooleanColor) {\n\t\tcollector.addRule(`${Codicon.symbolBoolean.cssSelector} { color: ${symbolIconBooleanColor}; }`);\n\t}\n\n\tconst symbolIconClassColor = theme.getColor(SYMBOL_ICON_CLASS_FOREGROUND);\n\tif (symbolIconClassColor) {\n\t\tcollector.addRule(`${Codicon.symbolClass.cssSelector} { color: ${symbolIconClassColor}; }`);\n\t}\n\n\tconst symbolIconMethodColor = theme.getColor(SYMBOL_ICON_METHOD_FOREGROUND);\n\tif (symbolIconMethodColor) {\n\t\tcollector.addRule(`${Codicon.symbolMethod.cssSelector} { color: ${symbolIconMethodColor}; }`);\n\t}\n\n\tconst symbolIconColorColor = theme.getColor(SYMBOL_ICON_COLOR_FOREGROUND);\n\tif (symbolIconColorColor) {\n\t\tcollector.addRule(`${Codicon.symbolColor.cssSelector} { color: ${symbolIconColorColor}; }`);\n\t}\n\n\tconst symbolIconConstantColor = theme.getColor(SYMBOL_ICON_CONSTANT_FOREGROUND);\n\tif (symbolIconConstantColor) {\n\t\tcollector.addRule(`${Codicon.symbolConstant.cssSelector} { color: ${symbolIconConstantColor}; }`);\n\t}\n\n\tconst symbolIconConstructorColor = theme.getColor(SYMBOL_ICON_CONSTRUCTOR_FOREGROUND);\n\tif (symbolIconConstructorColor) {\n\t\tcollector.addRule(`${Codicon.symbolConstructor.cssSelector} { color: ${symbolIconConstructorColor}; }`);\n\t}\n\n\tconst symbolIconEnumeratorColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_FOREGROUND);\n\tif (symbolIconEnumeratorColor) {\n\t\tcollector.addRule(`\n\t\t\t${Codicon.symbolValue.cssSelector},${Codicon.symbolEnum.cssSelector} { color: ${symbolIconEnumeratorColor}; }`);\n\t}\n\n\tconst symbolIconEnumeratorMemberColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND);\n\tif (symbolIconEnumeratorMemberColor) {\n\t\tcollector.addRule(`${Codicon.symbolEnumMember.cssSelector} { color: ${symbolIconEnumeratorMemberColor}; }`);\n\t}\n\n\tconst symbolIconEventColor = theme.getColor(SYMBOL_ICON_EVENT_FOREGROUND);\n\tif (symbolIconEventColor) {\n\t\tcollector.addRule(`${Codicon.symbolEvent.cssSelector} { color: ${symbolIconEventColor}; }`);\n\t}\n\n\tconst symbolIconFieldColor = theme.getColor(SYMBOL_ICON_FIELD_FOREGROUND);\n\tif (symbolIconFieldColor) {\n\t\tcollector.addRule(`${Codicon.symbolField.cssSelector} { color: ${symbolIconFieldColor}; }`);\n\t}\n\n\tconst symbolIconFileColor = theme.getColor(SYMBOL_ICON_FILE_FOREGROUND);\n\tif (symbolIconFileColor) {\n\t\tcollector.addRule(`${Codicon.symbolFile.cssSelector} { color: ${symbolIconFileColor}; }`);\n\t}\n\n\tconst symbolIconFolderColor = theme.getColor(SYMBOL_ICON_FOLDER_FOREGROUND);\n\tif (symbolIconFolderColor) {\n\t\tcollector.addRule(`${Codicon.symbolFolder.cssSelector} { color: ${symbolIconFolderColor}; }`);\n\t}\n\n\tconst symbolIconFunctionColor = theme.getColor(SYMBOL_ICON_FUNCTION_FOREGROUND);\n\tif (symbolIconFunctionColor) {\n\t\tcollector.addRule(`${Codicon.symbolFunction.cssSelector} { color: ${symbolIconFunctionColor}; }`);\n\t}\n\n\tconst symbolIconInterfaceColor = theme.getColor(SYMBOL_ICON_INTERFACE_FOREGROUND);\n\tif (symbolIconInterfaceColor) {\n\t\tcollector.addRule(`${Codicon.symbolInterface.cssSelector} { color: ${symbolIconInterfaceColor}; }`);\n\t}\n\n\tconst symbolIconKeyColor = theme.getColor(SYMBOL_ICON_KEY_FOREGROUND);\n\tif (symbolIconKeyColor) {\n\t\tcollector.addRule(`${Codicon.symbolKey.cssSelector} { color: ${symbolIconKeyColor}; }`);\n\t}\n\n\tconst symbolIconKeywordColor = theme.getColor(SYMBOL_ICON_KEYWORD_FOREGROUND);\n\tif (symbolIconKeywordColor) {\n\t\tcollector.addRule(`${Codicon.symbolKeyword.cssSelector} { color: ${symbolIconKeywordColor}; }`);\n\t}\n\n\tconst symbolIconModuleColor = theme.getColor(SYMBOL_ICON_MODULE_FOREGROUND);\n\tif (symbolIconModuleColor) {\n\t\tcollector.addRule(`${Codicon.symbolModule.cssSelector} { color: ${symbolIconModuleColor}; }`);\n\t}\n\n\tconst outlineNamespaceColor = theme.getColor(SYMBOL_ICON_NAMESPACE_FOREGROUND);\n\tif (outlineNamespaceColor) {\n\t\tcollector.addRule(`${Codicon.symbolNamespace.cssSelector} { color: ${outlineNamespaceColor}; }`);\n\t}\n\n\tconst symbolIconNullColor = theme.getColor(SYMBOL_ICON_NULL_FOREGROUND);\n\tif (symbolIconNullColor) {\n\t\tcollector.addRule(`${Codicon.symbolNull.cssSelector} { color: ${symbolIconNullColor}; }`);\n\t}\n\n\tconst symbolIconNumberColor = theme.getColor(SYMBOL_ICON_NUMBER_FOREGROUND);\n\tif (symbolIconNumberColor) {\n\t\tcollector.addRule(`${Codicon.symbolNumber.cssSelector} { color: ${symbolIconNumberColor}; }`);\n\t}\n\n\tconst symbolIconObjectColor = theme.getColor(SYMBOL_ICON_OBJECT_FOREGROUND);\n\tif (symbolIconObjectColor) {\n\t\tcollector.addRule(`${Codicon.symbolObject.cssSelector} { color: ${symbolIconObjectColor}; }`);\n\t}\n\n\tconst symbolIconOperatorColor = theme.getColor(SYMBOL_ICON_OPERATOR_FOREGROUND);\n\tif (symbolIconOperatorColor) {\n\t\tcollector.addRule(`${Codicon.symbolOperator.cssSelector} { color: ${symbolIconOperatorColor}; }`);\n\t}\n\n\tconst symbolIconPackageColor = theme.getColor(SYMBOL_ICON_PACKAGE_FOREGROUND);\n\tif (symbolIconPackageColor) {\n\t\tcollector.addRule(`${Codicon.symbolPackage.cssSelector} { color: ${symbolIconPackageColor}; }`);\n\t}\n\n\tconst symbolIconPropertyColor = theme.getColor(SYMBOL_ICON_PROPERTY_FOREGROUND);\n\tif (symbolIconPropertyColor) {\n\t\tcollector.addRule(`${Codicon.symbolProperty.cssSelector} { color: ${symbolIconPropertyColor}; }`);\n\t}\n\n\tconst symbolIconReferenceColor = theme.getColor(SYMBOL_ICON_REFERENCE_FOREGROUND);\n\tif (symbolIconReferenceColor) {\n\t\tcollector.addRule(`${Codicon.symbolReference.cssSelector} { color: ${symbolIconReferenceColor}; }`);\n\t}\n\n\tconst symbolIconSnippetColor = theme.getColor(SYMBOL_ICON_SNIPPET_FOREGROUND);\n\tif (symbolIconSnippetColor) {\n\t\tcollector.addRule(`${Codicon.symbolSnippet.cssSelector} { color: ${symbolIconSnippetColor}; }`);\n\t}\n\n\tconst symbolIconStringColor = theme.getColor(SYMBOL_ICON_STRING_FOREGROUND);\n\tif (symbolIconStringColor) {\n\t\tcollector.addRule(`${Codicon.symbolString.cssSelector} { color: ${symbolIconStringColor}; }`);\n\t}\n\n\tconst symbolIconStructColor = theme.getColor(SYMBOL_ICON_STRUCT_FOREGROUND);\n\tif (symbolIconStructColor) {\n\t\tcollector.addRule(`${Codicon.symbolStruct.cssSelector} { color: ${symbolIconStructColor}; }`);\n\t}\n\n\tconst symbolIconTextColor = theme.getColor(SYMBOL_ICON_TEXT_FOREGROUND);\n\tif (symbolIconTextColor) {\n\t\tcollector.addRule(`${Codicon.symbolText.cssSelector} { color: ${symbolIconTextColor}; }`);\n\t}\n\n\tconst symbolIconTypeParameterColor = theme.getColor(SYMBOL_ICON_TYPEPARAMETER_FOREGROUND);\n\tif (symbolIconTypeParameterColor) {\n\t\tcollector.addRule(`${Codicon.symbolTypeParameter.cssSelector} { color: ${symbolIconTypeParameterColor}; }`);\n\t}\n\n\tconst symbolIconUnitColor = theme.getColor(SYMBOL_ICON_UNIT_FOREGROUND);\n\tif (symbolIconUnitColor) {\n\t\tcollector.addRule(`${Codicon.symbolUnit.cssSelector} { color: ${symbolIconUnitColor}; }`);\n\t}\n\n\tconst symbolIconVariableColor = theme.getColor(SYMBOL_ICON_VARIABLE_FOREGROUND);\n\tif (symbolIconVariableColor) {\n\t\tcollector.addRule(`${Codicon.symbolVariable.cssSelector} { color: ${symbolIconVariableColor}; }`);\n\t}\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 { windowOpenNoOpener } from 'vs/base/browser/dom';\nimport { Schemas } from 'vs/base/common/network';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { AbstractCodeEditorService } from 'vs/editor/browser/services/abstractCodeEditorService';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IResourceEditorInput, ITextResourceEditorInput } from 'vs/platform/editor/common/editor';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport class StandaloneCodeEditorService extends AbstractCodeEditorService {\n\n\tprivate readonly _editorIsOpen: IContextKey<boolean>;\n\tprivate _activeCodeEditor: ICodeEditor | null;\n\n\tconstructor(\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper(themeService);\n\t\tthis.onCodeEditorAdd(() => this._checkContextKey());\n\t\tthis.onCodeEditorRemove(() => this._checkContextKey());\n\t\tthis._editorIsOpen = contextKeyService.createKey('editorIsOpen', false);\n\t\tthis._activeCodeEditor = null;\n\t}\n\n\tprivate _checkContextKey(): void {\n\t\tlet hasCodeEditor = false;\n\t\tfor (const editor of this.listCodeEditors()) {\n\t\t\tif (!editor.isSimpleWidget) {\n\t\t\t\thasCodeEditor = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis._editorIsOpen.set(hasCodeEditor);\n\t}\n\n\tpublic setActiveCodeEditor(activeCodeEditor: ICodeEditor | null): void {\n\t\tthis._activeCodeEditor = activeCodeEditor;\n\t}\n\n\tpublic getActiveCodeEditor(): ICodeEditor | null {\n\t\treturn this._activeCodeEditor;\n\t}\n\n\tpublic openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {\n\t\tif (!source) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn Promise.resolve(this.doOpenEditor(source, input));\n\t}\n\n\tprivate doOpenEditor(editor: ICodeEditor, input: ITextResourceEditorInput): ICodeEditor | null {\n\t\tconst model = this.findModel(editor, input.resource);\n\t\tif (!model) {\n\t\t\tif (input.resource) {\n\n\t\t\t\tconst schema = input.resource.scheme;\n\t\t\t\tif (schema === Schemas.http || schema === Schemas.https) {\n\t\t\t\t\t// This is a fully qualified http or https URL\n\t\t\t\t\twindowOpenNoOpener(input.resource.toString());\n\t\t\t\t\treturn editor;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tconst selection = <IRange>(input.options ? input.options.selection : null);\n\t\tif (selection) {\n\t\t\tif (typeof selection.endLineNumber === 'number' && typeof selection.endColumn === 'number') {\n\t\t\t\teditor.setSelection(selection);\n\t\t\t\teditor.revealRangeInCenter(selection, ScrollType.Immediate);\n\t\t\t} else {\n\t\t\t\tconst pos = {\n\t\t\t\t\tlineNumber: selection.startLineNumber,\n\t\t\t\t\tcolumn: selection.startColumn\n\t\t\t\t};\n\t\t\t\teditor.setPosition(pos);\n\t\t\t\teditor.revealPositionInCenter(pos, ScrollType.Immediate);\n\t\t\t}\n\t\t}\n\n\t\treturn editor;\n\t}\n\n\tprivate findModel(editor: ICodeEditor, resource: URI): ITextModel | null {\n\t\tconst model = editor.getModel();\n\t\tif (model && model.uri.toString() !== resource.toString()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn model;\n\t}\n}\n\nregisterSingleton(ICodeEditorService, StandaloneCodeEditorService);\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 { editorActiveIndentGuides, editorIndentGuides } from 'vs/editor/common/core/editorColorRegistry';\nimport { IStandaloneThemeData } from 'vs/editor/standalone/common/standaloneTheme';\nimport { editorBackground, editorForeground, editorInactiveSelection, editorSelectionHighlight } from 'vs/platform/theme/common/colorRegistry';\n\n/* -------------------------------- Begin vs theme -------------------------------- */\nexport const vs: IStandaloneThemeData = {\n\tbase: 'vs',\n\tinherit: false,\n\trules: [\n\t\t{ token: '', foreground: '000000', background: 'fffffe' },\n\t\t{ token: 'invalid', foreground: 'cd3131' },\n\t\t{ token: 'emphasis', fontStyle: 'italic' },\n\t\t{ token: 'strong', fontStyle: 'bold' },\n\n\t\t{ token: 'variable', foreground: '001188' },\n\t\t{ token: 'variable.predefined', foreground: '4864AA' },\n\t\t{ token: 'constant', foreground: 'dd0000' },\n\t\t{ token: 'comment', foreground: '008000' },\n\t\t{ token: 'number', foreground: '098658' },\n\t\t{ token: 'number.hex', foreground: '3030c0' },\n\t\t{ token: 'regexp', foreground: '800000' },\n\t\t{ token: 'annotation', foreground: '808080' },\n\t\t{ token: 'type', foreground: '008080' },\n\n\t\t{ token: 'delimiter', foreground: '000000' },\n\t\t{ token: 'delimiter.html', foreground: '383838' },\n\t\t{ token: 'delimiter.xml', foreground: '0000FF' },\n\n\t\t{ token: 'tag', foreground: '800000' },\n\t\t{ token: 'tag.id.pug', foreground: '4F76AC' },\n\t\t{ token: 'tag.class.pug', foreground: '4F76AC' },\n\t\t{ token: 'meta.scss', foreground: '800000' },\n\t\t{ token: 'metatag', foreground: 'e00000' },\n\t\t{ token: 'metatag.content.html', foreground: 'FF0000' },\n\t\t{ token: 'metatag.html', foreground: '808080' },\n\t\t{ token: 'metatag.xml', foreground: '808080' },\n\t\t{ token: 'metatag.php', fontStyle: 'bold' },\n\n\t\t{ token: 'key', foreground: '863B00' },\n\t\t{ token: 'string.key.json', foreground: 'A31515' },\n\t\t{ token: 'string.value.json', foreground: '0451A5' },\n\n\t\t{ token: 'attribute.name', foreground: 'FF0000' },\n\t\t{ token: 'attribute.value', foreground: '0451A5' },\n\t\t{ token: 'attribute.value.number', foreground: '098658' },\n\t\t{ token: 'attribute.value.unit', foreground: '098658' },\n\t\t{ token: 'attribute.value.html', foreground: '0000FF' },\n\t\t{ token: 'attribute.value.xml', foreground: '0000FF' },\n\n\t\t{ token: 'string', foreground: 'A31515' },\n\t\t{ token: 'string.html', foreground: '0000FF' },\n\t\t{ token: 'string.sql', foreground: 'FF0000' },\n\t\t{ token: 'string.yaml', foreground: '0451A5' },\n\n\t\t{ token: 'keyword', foreground: '0000FF' },\n\t\t{ token: 'keyword.json', foreground: '0451A5' },\n\t\t{ token: 'keyword.flow', foreground: 'AF00DB' },\n\t\t{ token: 'keyword.flow.scss', foreground: '0000FF' },\n\n\t\t{ token: 'operator.scss', foreground: '666666' },\n\t\t{ token: 'operator.sql', foreground: '778899' },\n\t\t{ token: 'operator.swift', foreground: '666666' },\n\t\t{ token: 'predefined.sql', foreground: 'C700C7' },\n\t],\n\tcolors: {\n\t\t[editorBackground]: '#FFFFFE',\n\t\t[editorForeground]: '#000000',\n\t\t[editorInactiveSelection]: '#E5EBF1',\n\t\t[editorIndentGuides]: '#D3D3D3',\n\t\t[editorActiveIndentGuides]: '#939393',\n\t\t[editorSelectionHighlight]: '#ADD6FF4D'\n\t}\n};\n/* -------------------------------- End vs theme -------------------------------- */\n\n\n/* -------------------------------- Begin vs-dark theme -------------------------------- */\nexport const vs_dark: IStandaloneThemeData = {\n\tbase: 'vs-dark',\n\tinherit: false,\n\trules: [\n\t\t{ token: '', foreground: 'D4D4D4', background: '1E1E1E' },\n\t\t{ token: 'invalid', foreground: 'f44747' },\n\t\t{ token: 'emphasis', fontStyle: 'italic' },\n\t\t{ token: 'strong', fontStyle: 'bold' },\n\n\t\t{ token: 'variable', foreground: '74B0DF' },\n\t\t{ token: 'variable.predefined', foreground: '4864AA' },\n\t\t{ token: 'variable.parameter', foreground: '9CDCFE' },\n\t\t{ token: 'constant', foreground: '569CD6' },\n\t\t{ token: 'comment', foreground: '608B4E' },\n\t\t{ token: 'number', foreground: 'B5CEA8' },\n\t\t{ token: 'number.hex', foreground: '5BB498' },\n\t\t{ token: 'regexp', foreground: 'B46695' },\n\t\t{ token: 'annotation', foreground: 'cc6666' },\n\t\t{ token: 'type', foreground: '3DC9B0' },\n\n\t\t{ token: 'delimiter', foreground: 'DCDCDC' },\n\t\t{ token: 'delimiter.html', foreground: '808080' },\n\t\t{ token: 'delimiter.xml', foreground: '808080' },\n\n\t\t{ token: 'tag', foreground: '569CD6' },\n\t\t{ token: 'tag.id.pug', foreground: '4F76AC' },\n\t\t{ token: 'tag.class.pug', foreground: '4F76AC' },\n\t\t{ token: 'meta.scss', foreground: 'A79873' },\n\t\t{ token: 'meta.tag', foreground: 'CE9178' },\n\t\t{ token: 'metatag', foreground: 'DD6A6F' },\n\t\t{ token: 'metatag.content.html', foreground: '9CDCFE' },\n\t\t{ token: 'metatag.html', foreground: '569CD6' },\n\t\t{ token: 'metatag.xml', foreground: '569CD6' },\n\t\t{ token: 'metatag.php', fontStyle: 'bold' },\n\n\t\t{ token: 'key', foreground: '9CDCFE' },\n\t\t{ token: 'string.key.json', foreground: '9CDCFE' },\n\t\t{ token: 'string.value.json', foreground: 'CE9178' },\n\n\t\t{ token: 'attribute.name', foreground: '9CDCFE' },\n\t\t{ token: 'attribute.value', foreground: 'CE9178' },\n\t\t{ token: 'attribute.value.number.css', foreground: 'B5CEA8' },\n\t\t{ token: 'attribute.value.unit.css', foreground: 'B5CEA8' },\n\t\t{ token: 'attribute.value.hex.css', foreground: 'D4D4D4' },\n\n\t\t{ token: 'string', foreground: 'CE9178' },\n\t\t{ token: 'string.sql', foreground: 'FF0000' },\n\n\t\t{ token: 'keyword', foreground: '569CD6' },\n\t\t{ token: 'keyword.flow', foreground: 'C586C0' },\n\t\t{ token: 'keyword.json', foreground: 'CE9178' },\n\t\t{ token: 'keyword.flow.scss', foreground: '569CD6' },\n\n\t\t{ token: 'operator.scss', foreground: '909090' },\n\t\t{ token: 'operator.sql', foreground: '778899' },\n\t\t{ token: 'operator.swift', foreground: '909090' },\n\t\t{ token: 'predefined.sql', foreground: 'FF00FF' },\n\t],\n\tcolors: {\n\t\t[editorBackground]: '#1E1E1E',\n\t\t[editorForeground]: '#D4D4D4',\n\t\t[editorInactiveSelection]: '#3A3D41',\n\t\t[editorIndentGuides]: '#404040',\n\t\t[editorActiveIndentGuides]: '#707070',\n\t\t[editorSelectionHighlight]: '#ADD6FF26'\n\t}\n};\n/* -------------------------------- End vs-dark theme -------------------------------- */\n\n\n\n/* -------------------------------- Begin hc-black theme -------------------------------- */\nexport const hc_black: IStandaloneThemeData = {\n\tbase: 'hc-black',\n\tinherit: false,\n\trules: [\n\t\t{ token: '', foreground: 'FFFFFF', background: '000000' },\n\t\t{ token: 'invalid', foreground: 'f44747' },\n\t\t{ token: 'emphasis', fontStyle: 'italic' },\n\t\t{ token: 'strong', fontStyle: 'bold' },\n\n\t\t{ token: 'variable', foreground: '1AEBFF' },\n\t\t{ token: 'variable.parameter', foreground: '9CDCFE' },\n\t\t{ token: 'constant', foreground: '569CD6' },\n\t\t{ token: 'comment', foreground: '608B4E' },\n\t\t{ token: 'number', foreground: 'FFFFFF' },\n\t\t{ token: 'regexp', foreground: 'C0C0C0' },\n\t\t{ token: 'annotation', foreground: '569CD6' },\n\t\t{ token: 'type', foreground: '3DC9B0' },\n\n\t\t{ token: 'delimiter', foreground: 'FFFF00' },\n\t\t{ token: 'delimiter.html', foreground: 'FFFF00' },\n\n\t\t{ token: 'tag', foreground: '569CD6' },\n\t\t{ token: 'tag.id.pug', foreground: '4F76AC' },\n\t\t{ token: 'tag.class.pug', foreground: '4F76AC' },\n\t\t{ token: 'meta', foreground: 'D4D4D4' },\n\t\t{ token: 'meta.tag', foreground: 'CE9178' },\n\t\t{ token: 'metatag', foreground: '569CD6' },\n\t\t{ token: 'metatag.content.html', foreground: '1AEBFF' },\n\t\t{ token: 'metatag.html', foreground: '569CD6' },\n\t\t{ token: 'metatag.xml', foreground: '569CD6' },\n\t\t{ token: 'metatag.php', fontStyle: 'bold' },\n\n\t\t{ token: 'key', foreground: '9CDCFE' },\n\t\t{ token: 'string.key', foreground: '9CDCFE' },\n\t\t{ token: 'string.value', foreground: 'CE9178' },\n\n\t\t{ token: 'attribute.name', foreground: '569CD6' },\n\t\t{ token: 'attribute.value', foreground: '3FF23F' },\n\n\t\t{ token: 'string', foreground: 'CE9178' },\n\t\t{ token: 'string.sql', foreground: 'FF0000' },\n\n\t\t{ token: 'keyword', foreground: '569CD6' },\n\t\t{ token: 'keyword.flow', foreground: 'C586C0' },\n\n\t\t{ token: 'operator.sql', foreground: '778899' },\n\t\t{ token: 'operator.swift', foreground: '909090' },\n\t\t{ token: 'predefined.sql', foreground: 'FF00FF' },\n\t],\n\tcolors: {\n\t\t[editorBackground]: '#000000',\n\t\t[editorForeground]: '#FFFFFF',\n\t\t[editorIndentGuides]: '#FFFFFF',\n\t\t[editorActiveIndentGuides]: '#FFFFFF',\n\t}\n};\n/* -------------------------------- End hc-black theme -------------------------------- */\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 { IAction, Separator, SubmenuAction } from 'vs/base/common/actions';\nimport { CSSIcon } from 'vs/base/common/codicons';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { ICommandAction, ICommandActionTitle, Icon, ILocalizedString } from 'vs/platform/action/common/action';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nexport interface IMenuItem {\n\tcommand: ICommandAction;\n\talt?: ICommandAction;\n\twhen?: ContextKeyExpression;\n\tgroup?: 'navigation' | string;\n\torder?: number;\n}\n\nexport interface ISubmenuItem {\n\ttitle: string | ICommandActionTitle;\n\tsubmenu: MenuId;\n\ticon?: Icon;\n\twhen?: ContextKeyExpression;\n\tgroup?: 'navigation' | string;\n\torder?: number;\n\trememberDefaultAction?: boolean;\t// for dropdown menu: if true the last executed action is remembered as the default action\n}\n\nexport function isIMenuItem(item: IMenuItem | ISubmenuItem): item is IMenuItem {\n\treturn (item as IMenuItem).command !== undefined;\n}\n\nexport class MenuId {\n\n\tprivate static _idPool = 0;\n\n\tstatic readonly CommandPalette = new MenuId('CommandPalette');\n\tstatic readonly DebugBreakpointsContext = new MenuId('DebugBreakpointsContext');\n\tstatic readonly DebugCallStackContext = new MenuId('DebugCallStackContext');\n\tstatic readonly DebugConsoleContext = new MenuId('DebugConsoleContext');\n\tstatic readonly DebugVariablesContext = new MenuId('DebugVariablesContext');\n\tstatic readonly DebugWatchContext = new MenuId('DebugWatchContext');\n\tstatic readonly DebugToolBar = new MenuId('DebugToolBar');\n\tstatic readonly EditorContext = new MenuId('EditorContext');\n\tstatic readonly SimpleEditorContext = new MenuId('SimpleEditorContext');\n\tstatic readonly EditorContextCopy = new MenuId('EditorContextCopy');\n\tstatic readonly EditorContextPeek = new MenuId('EditorContextPeek');\n\tstatic readonly EditorTitle = new MenuId('EditorTitle');\n\tstatic readonly EditorTitleRun = new MenuId('EditorTitleRun');\n\tstatic readonly EditorTitleContext = new MenuId('EditorTitleContext');\n\tstatic readonly EmptyEditorGroup = new MenuId('EmptyEditorGroup');\n\tstatic readonly EmptyEditorGroupContext = new MenuId('EmptyEditorGroupContext');\n\tstatic readonly ExplorerContext = new MenuId('ExplorerContext');\n\tstatic readonly ExtensionContext = new MenuId('ExtensionContext');\n\tstatic readonly GlobalActivity = new MenuId('GlobalActivity');\n\tstatic readonly LayoutControlMenuSubmenu = new MenuId('LayoutControlMenuSubmenu');\n\tstatic readonly LayoutControlMenu = new MenuId('LayoutControlMenu');\n\tstatic readonly MenubarMainMenu = new MenuId('MenubarMainMenu');\n\tstatic readonly MenubarAppearanceMenu = new MenuId('MenubarAppearanceMenu');\n\tstatic readonly MenubarDebugMenu = new MenuId('MenubarDebugMenu');\n\tstatic readonly MenubarEditMenu = new MenuId('MenubarEditMenu');\n\tstatic readonly MenubarCopy = new MenuId('MenubarCopy');\n\tstatic readonly MenubarFileMenu = new MenuId('MenubarFileMenu');\n\tstatic readonly MenubarGoMenu = new MenuId('MenubarGoMenu');\n\tstatic readonly MenubarHelpMenu = new MenuId('MenubarHelpMenu');\n\tstatic readonly MenubarLayoutMenu = new MenuId('MenubarLayoutMenu');\n\tstatic readonly MenubarNewBreakpointMenu = new MenuId('MenubarNewBreakpointMenu');\n\tstatic readonly MenubarPanelAlignmentMenu = new MenuId('MenubarPanelAlignmentMenu');\n\tstatic readonly MenubarPanelPositionMenu = new MenuId('MenubarPanelPositionMenu');\n\tstatic readonly MenubarPreferencesMenu = new MenuId('MenubarPreferencesMenu');\n\tstatic readonly MenubarRecentMenu = new MenuId('MenubarRecentMenu');\n\tstatic readonly MenubarSelectionMenu = new MenuId('MenubarSelectionMenu');\n\tstatic readonly MenubarSwitchEditorMenu = new MenuId('MenubarSwitchEditorMenu');\n\tstatic readonly MenubarSwitchGroupMenu = new MenuId('MenubarSwitchGroupMenu');\n\tstatic readonly MenubarTerminalMenu = new MenuId('MenubarTerminalMenu');\n\tstatic readonly MenubarViewMenu = new MenuId('MenubarViewMenu');\n\tstatic readonly MenubarHomeMenu = new MenuId('MenubarHomeMenu');\n\tstatic readonly OpenEditorsContext = new MenuId('OpenEditorsContext');\n\tstatic readonly ProblemsPanelContext = new MenuId('ProblemsPanelContext');\n\tstatic readonly SCMChangeContext = new MenuId('SCMChangeContext');\n\tstatic readonly SCMResourceContext = new MenuId('SCMResourceContext');\n\tstatic readonly SCMResourceFolderContext = new MenuId('SCMResourceFolderContext');\n\tstatic readonly SCMResourceGroupContext = new MenuId('SCMResourceGroupContext');\n\tstatic readonly SCMSourceControl = new MenuId('SCMSourceControl');\n\tstatic readonly SCMTitle = new MenuId('SCMTitle');\n\tstatic readonly SearchContext = new MenuId('SearchContext');\n\tstatic readonly StatusBarWindowIndicatorMenu = new MenuId('StatusBarWindowIndicatorMenu');\n\tstatic readonly StatusBarRemoteIndicatorMenu = new MenuId('StatusBarRemoteIndicatorMenu');\n\tstatic readonly TestItem = new MenuId('TestItem');\n\tstatic readonly TestItemGutter = new MenuId('TestItemGutter');\n\tstatic readonly TestPeekElement = new MenuId('TestPeekElement');\n\tstatic readonly TestPeekTitle = new MenuId('TestPeekTitle');\n\tstatic readonly TouchBarContext = new MenuId('TouchBarContext');\n\tstatic readonly TitleBarContext = new MenuId('TitleBarContext');\n\tstatic readonly TunnelContext = new MenuId('TunnelContext');\n\tstatic readonly TunnelPrivacy = new MenuId('TunnelPrivacy');\n\tstatic readonly TunnelProtocol = new MenuId('TunnelProtocol');\n\tstatic readonly TunnelPortInline = new MenuId('TunnelInline');\n\tstatic readonly TunnelTitle = new MenuId('TunnelTitle');\n\tstatic readonly TunnelLocalAddressInline = new MenuId('TunnelLocalAddressInline');\n\tstatic readonly TunnelOriginInline = new MenuId('TunnelOriginInline');\n\tstatic readonly ViewItemContext = new MenuId('ViewItemContext');\n\tstatic readonly ViewContainerTitle = new MenuId('ViewContainerTitle');\n\tstatic readonly ViewContainerTitleContext = new MenuId('ViewContainerTitleContext');\n\tstatic readonly ViewTitle = new MenuId('ViewTitle');\n\tstatic readonly ViewTitleContext = new MenuId('ViewTitleContext');\n\tstatic readonly CommentThreadTitle = new MenuId('CommentThreadTitle');\n\tstatic readonly CommentThreadActions = new MenuId('CommentThreadActions');\n\tstatic readonly CommentTitle = new MenuId('CommentTitle');\n\tstatic readonly CommentActions = new MenuId('CommentActions');\n\tstatic readonly InteractiveToolbar = new MenuId('InteractiveToolbar');\n\tstatic readonly InteractiveCellTitle = new MenuId('InteractiveCellTitle');\n\tstatic readonly InteractiveCellExecute = new MenuId('InteractiveCellExecute');\n\tstatic readonly InteractiveInputExecute = new MenuId('InteractiveInputExecute');\n\tstatic readonly NotebookToolbar = new MenuId('NotebookToolbar');\n\tstatic readonly NotebookCellTitle = new MenuId('NotebookCellTitle');\n\tstatic readonly NotebookCellInsert = new MenuId('NotebookCellInsert');\n\tstatic readonly NotebookCellBetween = new MenuId('NotebookCellBetween');\n\tstatic readonly NotebookCellListTop = new MenuId('NotebookCellTop');\n\tstatic readonly NotebookCellExecute = new MenuId('NotebookCellExecute');\n\tstatic readonly NotebookCellExecutePrimary = new MenuId('NotebookCellExecutePrimary');\n\tstatic readonly NotebookDiffCellInputTitle = new MenuId('NotebookDiffCellInputTitle');\n\tstatic readonly NotebookDiffCellMetadataTitle = new MenuId('NotebookDiffCellMetadataTitle');\n\tstatic readonly NotebookDiffCellOutputsTitle = new MenuId('NotebookDiffCellOutputsTitle');\n\tstatic readonly NotebookOutputToolbar = new MenuId('NotebookOutputToolbar');\n\tstatic readonly NotebookEditorLayoutConfigure = new MenuId('NotebookEditorLayoutConfigure');\n\tstatic readonly BulkEditTitle = new MenuId('BulkEditTitle');\n\tstatic readonly BulkEditContext = new MenuId('BulkEditContext');\n\tstatic readonly TimelineItemContext = new MenuId('TimelineItemContext');\n\tstatic readonly TimelineTitle = new MenuId('TimelineTitle');\n\tstatic readonly TimelineTitleContext = new MenuId('TimelineTitleContext');\n\tstatic readonly AccountsContext = new MenuId('AccountsContext');\n\tstatic readonly PanelTitle = new MenuId('PanelTitle');\n\tstatic readonly AuxiliaryBarTitle = new MenuId('AuxiliaryBarTitle');\n\tstatic readonly TerminalInstanceContext = new MenuId('TerminalInstanceContext');\n\tstatic readonly TerminalEditorInstanceContext = new MenuId('TerminalEditorInstanceContext');\n\tstatic readonly TerminalNewDropdownContext = new MenuId('TerminalNewDropdownContext');\n\tstatic readonly TerminalTabContext = new MenuId('TerminalTabContext');\n\tstatic readonly TerminalTabEmptyAreaContext = new MenuId('TerminalTabEmptyAreaContext');\n\tstatic readonly TerminalInlineTabContext = new MenuId('TerminalInlineTabContext');\n\tstatic readonly WebviewContext = new MenuId('WebviewContext');\n\tstatic readonly InlineCompletionsActions = new MenuId('InlineCompletionsActions');\n\tstatic readonly NewFile = new MenuId('NewFile');\n\n\treadonly id: number;\n\treadonly _debugName: string;\n\n\tconstructor(debugName: string) {\n\t\tthis.id = MenuId._idPool++;\n\t\tthis._debugName = debugName;\n\t}\n}\n\nexport interface IMenuActionOptions {\n\targ?: any;\n\tshouldForwardArgs?: boolean;\n\trenderShortTitle?: boolean;\n}\n\nexport interface IMenu extends IDisposable {\n\treadonly onDidChange: Event<IMenu>;\n\tgetActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][];\n}\n\nexport const IMenuService = createDecorator<IMenuService>('menuService');\n\nexport interface IMenuCreateOptions {\n\temitEventsForSubmenuChanges?: boolean;\n\teventDebounceDelay?: number;\n}\n\nexport interface IMenuService {\n\n\treadonly _serviceBrand: undefined;\n\n\tcreateMenu(id: MenuId, contextKeyService: IContextKeyService, options?: IMenuCreateOptions): IMenu;\n}\n\nexport type ICommandsMap = Map<string, ICommandAction>;\n\nexport interface IMenuRegistryChangeEvent {\n\thas(id: MenuId): boolean;\n}\n\nexport interface IMenuRegistry {\n\treadonly onDidChangeMenu: Event<IMenuRegistryChangeEvent>;\n\tappendMenuItems(items: Iterable<{ id: MenuId; item: IMenuItem | ISubmenuItem }>): IDisposable;\n\tappendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable;\n\tgetMenuItems(loc: MenuId): Array<IMenuItem | ISubmenuItem>;\n}\n\nexport const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry {\n\n\tprivate readonly _commands = new Map<string, ICommandAction>();\n\tprivate readonly _menuItems = new Map<MenuId, LinkedList<IMenuItem | ISubmenuItem>>();\n\tprivate readonly _onDidChangeMenu = new Emitter<IMenuRegistryChangeEvent>();\n\n\treadonly onDidChangeMenu: Event<IMenuRegistryChangeEvent> = this._onDidChangeMenu.event;\n\n\taddCommand(command: ICommandAction): IDisposable {\n\t\treturn this.addCommands(Iterable.single(command));\n\t}\n\n\tprivate readonly _commandPaletteChangeEvent: IMenuRegistryChangeEvent = {\n\t\thas: id => id === MenuId.CommandPalette\n\t};\n\n\taddCommands(commands: Iterable<ICommandAction>): IDisposable {\n\t\tfor (const command of commands) {\n\t\t\tthis._commands.set(command.id, command);\n\t\t}\n\t\tthis._onDidChangeMenu.fire(this._commandPaletteChangeEvent);\n\t\treturn toDisposable(() => {\n\t\t\tlet didChange = false;\n\t\t\tfor (const command of commands) {\n\t\t\t\tdidChange = this._commands.delete(command.id) || didChange;\n\t\t\t}\n\t\t\tif (didChange) {\n\t\t\t\tthis._onDidChangeMenu.fire(this._commandPaletteChangeEvent);\n\t\t\t}\n\t\t});\n\t}\n\n\tgetCommand(id: string): ICommandAction | undefined {\n\t\treturn this._commands.get(id);\n\t}\n\n\tgetCommands(): ICommandsMap {\n\t\tconst map = new Map<string, ICommandAction>();\n\t\tthis._commands.forEach((value, key) => map.set(key, value));\n\t\treturn map;\n\t}\n\n\tappendMenuItem(id: MenuId, item: IMenuItem | ISubmenuItem): IDisposable {\n\t\treturn this.appendMenuItems(Iterable.single({ id, item }));\n\t}\n\n\tappendMenuItems(items: Iterable<{ id: MenuId; item: IMenuItem | ISubmenuItem }>): IDisposable {\n\n\t\tconst changedIds = new Set<MenuId>();\n\t\tconst toRemove = new LinkedList<Function>();\n\n\t\tfor (const { id, item } of items) {\n\t\t\tlet list = this._menuItems.get(id);\n\t\t\tif (!list) {\n\t\t\t\tlist = new LinkedList();\n\t\t\t\tthis._menuItems.set(id, list);\n\t\t\t}\n\t\t\ttoRemove.push(list.push(item));\n\t\t\tchangedIds.add(id);\n\t\t}\n\n\t\tthis._onDidChangeMenu.fire(changedIds);\n\n\t\treturn toDisposable(() => {\n\t\t\tif (toRemove.size > 0) {\n\t\t\t\tfor (let fn of toRemove) {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t\tthis._onDidChangeMenu.fire(changedIds);\n\t\t\t\ttoRemove.clear();\n\t\t\t}\n\t\t});\n\t}\n\n\tgetMenuItems(id: MenuId): Array<IMenuItem | ISubmenuItem> {\n\t\tlet result: Array<IMenuItem | ISubmenuItem>;\n\t\tif (this._menuItems.has(id)) {\n\t\t\tresult = [...this._menuItems.get(id)!];\n\t\t} else {\n\t\t\tresult = [];\n\t\t}\n\t\tif (id === MenuId.CommandPalette) {\n\t\t\t// CommandPalette is special because it shows\n\t\t\t// all commands by default\n\t\t\tthis._appendImplicitItems(result);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _appendImplicitItems(result: Array<IMenuItem | ISubmenuItem>) {\n\t\tconst set = new Set<string>();\n\n\t\tfor (const item of result) {\n\t\t\tif (isIMenuItem(item)) {\n\t\t\t\tset.add(item.command.id);\n\t\t\t\tif (item.alt) {\n\t\t\t\t\tset.add(item.alt.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._commands.forEach((command, id) => {\n\t\t\tif (!set.has(id)) {\n\t\t\t\tresult.push({ command });\n\t\t\t}\n\t\t});\n\t}\n};\n\nexport class SubmenuItemAction extends SubmenuAction {\n\n\tconstructor(\n\t\treadonly item: ISubmenuItem,\n\t\tprivate readonly _menuService: IMenuService,\n\t\tprivate readonly _contextKeyService: IContextKeyService,\n\t\tprivate readonly _options?: IMenuActionOptions\n\t) {\n\t\tsuper(`submenuitem.${item.submenu.id}`, typeof item.title === 'string' ? item.title : item.title.value, [], 'submenu');\n\t}\n\n\toverride get actions(): readonly IAction[] {\n\t\tconst result: IAction[] = [];\n\t\tconst menu = this._menuService.createMenu(this.item.submenu, this._contextKeyService);\n\t\tconst groups = menu.getActions(this._options);\n\t\tmenu.dispose();\n\t\tfor (const [, actions] of groups) {\n\t\t\tif (actions.length > 0) {\n\t\t\t\tresult.push(...actions);\n\t\t\t\tresult.push(new Separator());\n\t\t\t}\n\t\t}\n\t\tif (result.length) {\n\t\t\tresult.pop(); // remove last separator\n\t\t}\n\t\treturn result;\n\t}\n}\n\n// implements IAction, does NOT extend Action, so that no one\n// subscribes to events of Action or modified properties\nexport class MenuItemAction implements IAction {\n\n\treadonly item: ICommandAction;\n\treadonly alt: MenuItemAction | undefined;\n\n\tprivate readonly _options: IMenuActionOptions | undefined;\n\n\treadonly id: string;\n\treadonly label: string;\n\treadonly tooltip: string;\n\treadonly class: string | undefined;\n\treadonly enabled: boolean;\n\treadonly checked?: boolean;\n\n\tconstructor(\n\t\titem: ICommandAction,\n\t\talt: ICommandAction | undefined,\n\t\toptions: IMenuActionOptions | undefined,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICommandService private _commandService: ICommandService\n\t) {\n\t\tthis.id = item.id;\n\t\tthis.label = options?.renderShortTitle && item.shortTitle\n\t\t\t? (typeof item.shortTitle === 'string' ? item.shortTitle : item.shortTitle.value)\n\t\t\t: (typeof item.title === 'string' ? item.title : item.title.value);\n\t\tthis.tooltip = (typeof item.tooltip === 'string' ? item.tooltip : item.tooltip?.value) ?? '';\n\t\tthis.enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition);\n\t\tthis.checked = undefined;\n\n\t\tif (item.toggled) {\n\t\t\tconst toggled = ((item.toggled as { condition: ContextKeyExpression }).condition ? item.toggled : { condition: item.toggled }) as {\n\t\t\t\tcondition: ContextKeyExpression; icon?: Icon; tooltip?: string | ILocalizedString; title?: string | ILocalizedString;\n\t\t\t};\n\t\t\tthis.checked = contextKeyService.contextMatchesRules(toggled.condition);\n\t\t\tif (this.checked && toggled.tooltip) {\n\t\t\t\tthis.tooltip = typeof toggled.tooltip === 'string' ? toggled.tooltip : toggled.tooltip.value;\n\t\t\t}\n\n\t\t\tif (toggled.title) {\n\t\t\t\tthis.label = typeof toggled.title === 'string' ? toggled.title : toggled.title.value;\n\t\t\t}\n\t\t}\n\n\t\tthis.item = item;\n\t\tthis.alt = alt ? new MenuItemAction(alt, undefined, options, contextKeyService, _commandService) : undefined;\n\t\tthis._options = options;\n\t\tif (ThemeIcon.isThemeIcon(item.icon)) {\n\t\t\tthis.class = CSSIcon.asClassName(item.icon);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\t// there is NOTHING to dispose and the MenuItemAction should\n\t\t// never have anything to dispose as it is a convenience type\n\t\t// to bridge into the rendering world.\n\t}\n\n\trun(...args: any[]): Promise<void> {\n\t\tlet runArgs: any[] = [];\n\n\t\tif (this._options?.arg) {\n\t\t\trunArgs = [...runArgs, this._options.arg];\n\t\t}\n\n\t\tif (this._options?.shouldForwardArgs) {\n\t\t\trunArgs = [...runArgs, ...args];\n\t\t}\n\n\t\treturn this._commandService.executeCommand(this.id, ...runArgs);\n\t}\n}\n//#endregion\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 * as nls from 'vs/nls';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IEditorContribution, IDiffEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';\nimport { ServicesAccessor as InstantiationServicesAccessor, BrandedService, IInstantiationService, IConstructorSignature } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindings, KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { withNullAsUndefined, assertType } from 'vs/base/common/types';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { KeyMod, KeyCode } from 'vs/base/common/keyCodes';\nimport { ILogService } from 'vs/platform/log/common/log';\n\n\nexport type ServicesAccessor = InstantiationServicesAccessor;\nexport type IEditorContributionCtor = IConstructorSignature<IEditorContribution, [ICodeEditor]>;\nexport type IDiffEditorContributionCtor = IConstructorSignature<IDiffEditorContribution, [IDiffEditor]>;\n\nexport interface IEditorContributionDescription {\n\tid: string;\n\tctor: IEditorContributionCtor;\n}\n\nexport interface IDiffEditorContributionDescription {\n\tctor: IDiffEditorContributionCtor;\n}\n\n//#region Command\n\nexport interface ICommandKeybindingsOptions extends IKeybindings {\n\tkbExpr?: ContextKeyExpression | null;\n\tweight: number;\n\t/**\n\t * the default keybinding arguments\n\t */\n\targs?: any;\n}\nexport interface ICommandMenuOptions {\n\tmenuId: MenuId;\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n\ttitle: string;\n\ticon?: ThemeIcon;\n}\nexport interface ICommandOptions {\n\tid: string;\n\tprecondition: ContextKeyExpression | undefined;\n\tkbOpts?: ICommandKeybindingsOptions | ICommandKeybindingsOptions[];\n\tdescription?: ICommandHandlerDescription;\n\tmenuOpts?: ICommandMenuOptions | ICommandMenuOptions[];\n}\nexport abstract class Command {\n\tpublic readonly id: string;\n\tpublic readonly precondition: ContextKeyExpression | undefined;\n\tprivate readonly _kbOpts: ICommandKeybindingsOptions | ICommandKeybindingsOptions[] | undefined;\n\tprivate readonly _menuOpts: ICommandMenuOptions | ICommandMenuOptions[] | undefined;\n\tprivate readonly _description: ICommandHandlerDescription | undefined;\n\n\tconstructor(opts: ICommandOptions) {\n\t\tthis.id = opts.id;\n\t\tthis.precondition = opts.precondition;\n\t\tthis._kbOpts = opts.kbOpts;\n\t\tthis._menuOpts = opts.menuOpts;\n\t\tthis._description = opts.description;\n\t}\n\n\tpublic register(): void {\n\n\t\tif (Array.isArray(this._menuOpts)) {\n\t\t\tthis._menuOpts.forEach(this._registerMenuItem, this);\n\t\t} else if (this._menuOpts) {\n\t\t\tthis._registerMenuItem(this._menuOpts);\n\t\t}\n\n\t\tif (this._kbOpts) {\n\t\t\tconst kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];\n\t\t\tfor (const kbOpts of kbOptsArr) {\n\t\t\t\tlet kbWhen = kbOpts.kbExpr;\n\t\t\t\tif (this.precondition) {\n\t\t\t\t\tif (kbWhen) {\n\t\t\t\t\t\tkbWhen = ContextKeyExpr.and(kbWhen, this.precondition);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkbWhen = this.precondition;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst desc = {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\tweight: kbOpts.weight,\n\t\t\t\t\targs: kbOpts.args,\n\t\t\t\t\twhen: kbWhen,\n\t\t\t\t\tprimary: kbOpts.primary,\n\t\t\t\t\tsecondary: kbOpts.secondary,\n\t\t\t\t\twin: kbOpts.win,\n\t\t\t\t\tlinux: kbOpts.linux,\n\t\t\t\t\tmac: kbOpts.mac,\n\t\t\t\t};\n\n\t\t\t\tKeybindingsRegistry.registerKeybindingRule(desc);\n\t\t\t}\n\t\t}\n\n\t\tCommandsRegistry.registerCommand({\n\t\t\tid: this.id,\n\t\t\thandler: (accessor, args) => this.runCommand(accessor, args),\n\t\t\tdescription: this._description\n\t\t});\n\t}\n\n\tprivate _registerMenuItem(item: ICommandMenuOptions): void {\n\t\tMenuRegistry.appendMenuItem(item.menuId, {\n\t\t\tgroup: item.group,\n\t\t\tcommand: {\n\t\t\t\tid: this.id,\n\t\t\t\ttitle: item.title,\n\t\t\t\ticon: item.icon,\n\t\t\t\tprecondition: this.precondition\n\t\t\t},\n\t\t\twhen: item.when,\n\t\t\torder: item.order\n\t\t});\n\t}\n\n\tpublic abstract runCommand(accessor: ServicesAccessor, args: any): void | Promise<void>;\n}\n\n//#endregion Command\n\n//#region MultiplexingCommand\n\n/**\n * Potential override for a command.\n *\n * @return `true` if the command was successfully run. This stops other overrides from being executed.\n */\nexport type CommandImplementation = (accessor: ServicesAccessor, args: unknown) => boolean | Promise<void>;\n\ninterface ICommandImplementationRegistration {\n\tpriority: number;\n\tname: string;\n\timplementation: CommandImplementation;\n}\n\nexport class MultiCommand extends Command {\n\n\tprivate readonly _implementations: ICommandImplementationRegistration[] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, name: string, implementation: CommandImplementation): IDisposable {\n\t\tthis._implementations.push({ priority, name, implementation });\n\t\tthis._implementations.sort((a, b) => b.priority - a.priority);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i].implementation === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);\n\t\tfor (const impl of this._implementations) {\n\t\t\tconst result = impl.implementation(accessor, args);\n\t\t\tif (result) {\n\t\t\t\tlogService.trace(`Command '${this.id}' was handled by '${impl.name}'.`);\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tlogService.trace(`The Command '${this.id}' was not handled by any implementation.`);\n\t}\n}\n\n//#endregion\n\n/**\n * A command that delegates to another command's implementation.\n *\n * This lets different commands be registered but share the same implementation\n */\nexport class ProxyCommand extends Command {\n\tconstructor(\n\t\tprivate readonly command: Command,\n\t\topts: ICommandOptions\n\t) {\n\t\tsuper(opts);\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\treturn this.command.runCommand(accessor, args);\n\t}\n}\n\n//#region EditorCommand\n\nexport interface IContributionCommandOptions<T> extends ICommandOptions {\n\thandler: (controller: T, args: any) => void;\n}\nexport interface EditorControllerCommand<T extends IEditorContribution> {\n\tnew(opts: IContributionCommandOptions<T>): EditorCommand;\n}\nexport abstract class EditorCommand extends Command {\n\n\t/**\n\t * Create a command class that is bound to a certain editor contribution.\n\t */\n\tpublic static bindToContribution<T extends IEditorContribution>(controllerGetter: (editor: ICodeEditor) => T | null): EditorControllerCommand<T> {\n\t\treturn class EditorControllerCommandImpl extends EditorCommand {\n\t\t\tprivate readonly _callback: (controller: T, args: any) => void;\n\n\t\t\tconstructor(opts: IContributionCommandOptions<T>) {\n\t\t\t\tsuper(opts);\n\n\t\t\t\tthis._callback = opts.handler;\n\t\t\t}\n\n\t\t\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\t\t\tconst controller = controllerGetter(editor);\n\t\t\t\tif (controller) {\n\t\t\t\t\tthis._callback(controller, args);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\n\t\t// Find the editor with text focus or active\n\t\tconst editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n\t\tif (!editor) {\n\t\t\t// well, at least we tried...\n\t\t\treturn;\n\t\t}\n\n\t\treturn editor.invokeWithinContext((editorAccessor) => {\n\t\t\tconst kbService = editorAccessor.get(IContextKeyService);\n\t\t\tif (!kbService.contextMatchesRules(withNullAsUndefined(this.precondition))) {\n\t\t\t\t// precondition does not hold\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn this.runEditorCommand(editorAccessor, editor!, args);\n\t\t});\n\t}\n\n\tpublic abstract runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\n//#endregion EditorCommand\n\n//#region EditorAction\n\nexport interface IEditorActionContextMenuOptions {\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n\tmenuId?: MenuId;\n}\nexport interface IActionOptions extends ICommandOptions {\n\tlabel: string;\n\talias: string;\n\tcontextMenuOpts?: IEditorActionContextMenuOptions | IEditorActionContextMenuOptions[];\n}\n\nexport abstract class EditorAction extends EditorCommand {\n\n\tprivate static convertOptions(opts: IActionOptions): ICommandOptions {\n\n\t\tlet menuOpts: ICommandMenuOptions[];\n\t\tif (Array.isArray(opts.menuOpts)) {\n\t\t\tmenuOpts = opts.menuOpts;\n\t\t} else if (opts.menuOpts) {\n\t\t\tmenuOpts = [opts.menuOpts];\n\t\t} else {\n\t\t\tmenuOpts = [];\n\t\t}\n\n\t\tfunction withDefaults(item: Partial<ICommandMenuOptions>): ICommandMenuOptions {\n\t\t\tif (!item.menuId) {\n\t\t\t\titem.menuId = MenuId.EditorContext;\n\t\t\t}\n\t\t\tif (!item.title) {\n\t\t\t\titem.title = opts.label;\n\t\t\t}\n\t\t\titem.when = ContextKeyExpr.and(opts.precondition, item.when);\n\t\t\treturn <ICommandMenuOptions>item;\n\t\t}\n\n\t\tif (Array.isArray(opts.contextMenuOpts)) {\n\t\t\tmenuOpts.push(...opts.contextMenuOpts.map(withDefaults));\n\t\t} else if (opts.contextMenuOpts) {\n\t\t\tmenuOpts.push(withDefaults(opts.contextMenuOpts));\n\t\t}\n\n\t\topts.menuOpts = menuOpts;\n\t\treturn <ICommandOptions>opts;\n\t}\n\n\tpublic readonly label: string;\n\tpublic readonly alias: string;\n\n\tconstructor(opts: IActionOptions) {\n\t\tsuper(EditorAction.convertOptions(opts));\n\t\tthis.label = opts.label;\n\t\tthis.alias = opts.alias;\n\t}\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\tthis.reportTelemetry(accessor, editor);\n\t\treturn this.run(accessor, editor, args || {});\n\t}\n\n\tprotected reportTelemetry(accessor: ServicesAccessor, editor: ICodeEditor) {\n\t\ttype EditorActionInvokedClassification = {\n\t\t\tname: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\t\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\t};\n\t\ttype EditorActionInvokedEvent = {\n\t\t\tname: string;\n\t\t\tid: string;\n\t\t};\n\t\taccessor.get(ITelemetryService).publicLog2<EditorActionInvokedEvent, EditorActionInvokedClassification>('editorActionInvoked', { name: this.label, id: this.id });\n\t}\n\n\tpublic abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\nexport type EditorActionImplementation = (accessor: ServicesAccessor, editor: ICodeEditor, args: any) => boolean | Promise<void>;\n\nexport class MultiEditorAction extends EditorAction {\n\n\tprivate readonly _implementations: [number, EditorActionImplementation][] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, implementation: EditorActionImplementation): IDisposable {\n\t\tthis._implementations.push([priority, implementation]);\n\t\tthis._implementations.sort((a, b) => b[0] - a[0]);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i][1] === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\tfor (const impl of this._implementations) {\n\t\t\tconst result = impl[1](accessor, editor, args);\n\t\t\tif (result) {\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\n}\n\n//#endregion\n\n// --- Registration of commands and actions\n\n\nexport function registerModelAndPositionCommand(id: string, handler: (accessor: ServicesAccessor, model: ITextModel, position: Position, ...args: any[]) => any) {\n\tCommandsRegistry.registerCommand(id, function (accessor, ...args) {\n\n\t\tconst instaService = accessor.get(IInstantiationService);\n\n\t\tconst [resource, position] = args;\n\t\tassertType(URI.isUri(resource));\n\t\tassertType(Position.isIPosition(position));\n\n\t\tconst model = accessor.get(IModelService).getModel(resource);\n\t\tif (model) {\n\t\t\tconst editorPosition = Position.lift(position);\n\t\t\treturn instaService.invokeFunction(handler, model, editorPosition, ...args.slice(2));\n\t\t}\n\n\t\treturn accessor.get(ITextModelService).createModelReference(resource).then(reference => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = instaService.invokeFunction(handler, reference.object.textEditorModel, Position.lift(position), args.slice(2));\n\t\t\t\t\tresolve(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\treference.dispose();\n\t\t\t});\n\t\t});\n\t});\n}\n\nexport function registerEditorCommand<T extends EditorCommand>(editorCommand: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand);\n\treturn editorCommand;\n}\n\nexport function registerEditorAction<T extends EditorAction>(ctor: { new(): T }): T {\n\tconst action = new ctor();\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerMultiEditorAction<T extends MultiEditorAction>(action: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerInstantiatedEditorAction(editorAction: EditorAction): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);\n}\n\nexport function registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor);\n}\n\nexport namespace EditorExtensionsRegistry {\n\n\texport function getEditorCommand(commandId: string): EditorCommand {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorCommand(commandId);\n\t}\n\n\texport function getEditorActions(): EditorAction[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorActions();\n\t}\n\n\texport function getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions();\n\t}\n\n\texport function getSomeEditorContributions(ids: string[]): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0);\n\t}\n\n\texport function getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getDiffEditorContributions();\n\t}\n}\n\n// Editor extension points\nconst Extensions = {\n\tEditorCommonContributions: 'editor.contributions'\n};\n\nclass EditorContributionRegistry {\n\n\tpublic static readonly INSTANCE = new EditorContributionRegistry();\n\n\tprivate readonly editorContributions: IEditorContributionDescription[];\n\tprivate readonly diffEditorContributions: IDiffEditorContributionDescription[];\n\tprivate readonly editorActions: EditorAction[];\n\tprivate readonly editorCommands: { [commandId: string]: EditorCommand };\n\n\tconstructor() {\n\t\tthis.editorContributions = [];\n\t\tthis.diffEditorContributions = [];\n\t\tthis.editorActions = [];\n\t\tthis.editorCommands = Object.create(null);\n\t}\n\n\tpublic registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }): void {\n\t\tthis.editorContributions.push({ id, ctor: ctor as IEditorContributionCtor });\n\t}\n\n\tpublic getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn this.editorContributions.slice(0);\n\t}\n\n\tpublic getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn this.diffEditorContributions.slice(0);\n\t}\n\n\tpublic registerEditorAction(action: EditorAction) {\n\t\taction.register();\n\t\tthis.editorActions.push(action);\n\t}\n\n\tpublic getEditorActions(): EditorAction[] {\n\t\treturn this.editorActions.slice(0);\n\t}\n\n\tpublic registerEditorCommand(editorCommand: EditorCommand) {\n\t\teditorCommand.register();\n\t\tthis.editorCommands[editorCommand.id] = editorCommand;\n\t}\n\n\tpublic getEditorCommand(commandId: string): EditorCommand {\n\t\treturn (this.editorCommands[commandId] || null);\n\t}\n\n}\nRegistry.add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE);\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const UndoCommand = registerCommand(new MultiCommand({\n\tid: 'undo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyZ\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, \"&&Undo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('undo', \"Undo\"),\n\t\torder: 1\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined }));\n\nexport const RedoCommand = registerCommand(new MultiCommand({\n\tid: 'redo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyY,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ],\n\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ }\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, \"&&Redo\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('redo', \"Redo\"),\n\t\torder: 1\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined }));\n\nexport const SelectAllCommand = registerCommand(new MultiCommand({\n\tid: 'editor.action.selectAll',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyA\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\tgroup: '1_basic',\n\t\ttitle: nls.localize({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, \"&&Select All\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('selectAll', \"Select All\"),\n\t\torder: 1\n\t}]\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 * as nls from 'vs/nls';\nimport { isFirefox } from 'vs/base/browser/browser';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport * as types from 'vs/base/common/types';\nimport { status } from 'vs/base/browser/ui/aria/aria';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Command, EditorCommand, ICommandOptions, registerEditorCommand, MultiCommand, UndoCommand, RedoCommand, SelectAllCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ColumnSelection, IColumnSelectResult } from 'vs/editor/common/cursor/cursorColumnSelection';\nimport { CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from 'vs/editor/common/cursorCommon';\nimport { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { CursorMove as CursorMove_, CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands';\nimport { TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Handler, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { VerticalRevealType } from 'vs/editor/common/viewEvents';\nimport { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IViewModel } from 'vs/editor/common/viewModel';\n\nconst CORE_WEIGHT = KeybindingWeight.EditorCore;\n\nexport abstract class CoreEditorCommand extends EditorCommand {\n\tpublic runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): void {\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (!viewModel) {\n\t\t\t// the editor has no view => has no cursors\n\t\t\treturn;\n\t\t}\n\t\tthis.runCoreEditorCommand(viewModel, args || {});\n\t}\n\n\tpublic abstract runCoreEditorCommand(viewModel: IViewModel, args: any): void;\n}\n\nexport namespace EditorScroll_ {\n\n\tconst isEditorScrollArgs = function (arg: any): boolean {\n\t\tif (!types.isObject(arg)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst scrollArg: RawArguments = arg;\n\n\t\tif (!types.isString(scrollArg.to)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(scrollArg.by) && !types.isString(scrollArg.by)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(scrollArg.value) && !types.isNumber(scrollArg.value)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(scrollArg.revealCursor) && !types.isBoolean(scrollArg.revealCursor)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\texport const description = <ICommandHandlerDescription>{\n\t\tdescription: 'Scroll editor in the given direction',\n\t\targs: [\n\t\t\t{\n\t\t\t\tname: 'Editor scroll argument object',\n\t\t\t\tdescription: `Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage'\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t`,\n\t\t\t\tconstraint: isEditorScrollArgs,\n\t\t\t\tschema: {\n\t\t\t\t\t'type': 'object',\n\t\t\t\t\t'required': ['to'],\n\t\t\t\t\t'properties': {\n\t\t\t\t\t\t'to': {\n\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t'enum': ['up', 'down']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'by': {\n\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t'enum': ['line', 'wrappedLine', 'page', 'halfPage']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'value': {\n\t\t\t\t\t\t\t'type': 'number',\n\t\t\t\t\t\t\t'default': 1\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'revealCursor': {\n\t\t\t\t\t\t\t'type': 'boolean',\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\n\t/**\n\t * Directions in the view for editor scroll command.\n\t */\n\texport const RawDirection = {\n\t\tUp: 'up',\n\t\tDown: 'down',\n\t};\n\n\t/**\n\t * Units for editor scroll 'by' argument\n\t */\n\texport const RawUnit = {\n\t\tLine: 'line',\n\t\tWrappedLine: 'wrappedLine',\n\t\tPage: 'page',\n\t\tHalfPage: 'halfPage'\n\t};\n\n\t/**\n\t * Arguments for editor scroll command\n\t */\n\texport interface RawArguments {\n\t\tto: string;\n\t\tby?: string;\n\t\tvalue?: number;\n\t\trevealCursor?: boolean;\n\t\tselect?: boolean;\n\t}\n\n\texport function parse(args: RawArguments): ParsedArguments | null {\n\t\tlet direction: Direction;\n\t\tswitch (args.to) {\n\t\t\tcase RawDirection.Up:\n\t\t\t\tdirection = Direction.Up;\n\t\t\t\tbreak;\n\t\t\tcase RawDirection.Down:\n\t\t\t\tdirection = Direction.Down;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Illegal arguments\n\t\t\t\treturn null;\n\t\t}\n\n\t\tlet unit: Unit;\n\t\tswitch (args.by) {\n\t\t\tcase RawUnit.Line:\n\t\t\t\tunit = Unit.Line;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.WrappedLine:\n\t\t\t\tunit = Unit.WrappedLine;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.Page:\n\t\t\t\tunit = Unit.Page;\n\t\t\t\tbreak;\n\t\t\tcase RawUnit.HalfPage:\n\t\t\t\tunit = Unit.HalfPage;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tunit = Unit.WrappedLine;\n\t\t}\n\n\t\tconst value = Math.floor(args.value || 1);\n\t\tconst revealCursor = !!args.revealCursor;\n\n\t\treturn {\n\t\t\tdirection: direction,\n\t\t\tunit: unit,\n\t\t\tvalue: value,\n\t\t\trevealCursor: revealCursor,\n\t\t\tselect: (!!args.select)\n\t\t};\n\t}\n\n\texport interface ParsedArguments {\n\t\tdirection: Direction;\n\t\tunit: Unit;\n\t\tvalue: number;\n\t\trevealCursor: boolean;\n\t\tselect: boolean;\n\t}\n\n\texport const enum Direction {\n\t\tUp = 1,\n\t\tDown = 2\n\t}\n\n\texport const enum Unit {\n\t\tLine = 1,\n\t\tWrappedLine = 2,\n\t\tPage = 3,\n\t\tHalfPage = 4\n\t}\n}\n\nexport namespace RevealLine_ {\n\n\tconst isRevealLineArgs = function (arg: any): boolean {\n\t\tif (!types.isObject(arg)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst reveaLineArg: RawArguments = arg;\n\n\t\tif (!types.isNumber(reveaLineArg.lineNumber) && !types.isString(reveaLineArg.lineNumber)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!types.isUndefined(reveaLineArg.at) && !types.isString(reveaLineArg.at)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\texport const description = <ICommandHandlerDescription>{\n\t\tdescription: 'Reveal the given line at the given logical position',\n\t\targs: [\n\t\t\t{\n\t\t\t\tname: 'Reveal line argument object',\n\t\t\t\tdescription: `Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t\\`\\`\\`\n\t\t\t\t`,\n\t\t\t\tconstraint: isRevealLineArgs,\n\t\t\t\tschema: {\n\t\t\t\t\t'type': 'object',\n\t\t\t\t\t'required': ['lineNumber'],\n\t\t\t\t\t'properties': {\n\t\t\t\t\t\t'lineNumber': {\n\t\t\t\t\t\t\t'type': ['number', 'string'],\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'at': {\n\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t'enum': ['top', 'center', 'bottom']\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\n\t/**\n\t * Arguments for reveal line command\n\t */\n\texport interface RawArguments {\n\t\tlineNumber?: number | string;\n\t\tat?: string;\n\t}\n\n\t/**\n\t * Values for reveal line 'at' argument\n\t */\n\texport const RawAtArgument = {\n\t\tTop: 'top',\n\t\tCenter: 'center',\n\t\tBottom: 'bottom'\n\t};\n}\n\nabstract class EditorOrNativeTextInputCommand {\n\n\tconstructor(target: MultiCommand) {\n\t\t// 1. handle case when focus is in editor.\n\t\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: any) => {\n\t\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\t\treturn this._runEditorCommand(accessor, focusedEditor, args);\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\t// 2. handle case when focus is in some other `input` / `textarea`.\n\t\ttarget.addImplementation(1000, 'generic-dom-input-textarea', (accessor: ServicesAccessor, args: any) => {\n\t\t\t// Only if focused on an element that allows for entering text\n\t\t\tconst activeElement = <HTMLElement>document.activeElement;\n\t\t\tif (activeElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) {\n\t\t\t\tthis.runDOMCommand();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\t// 3. (default) handle case when focus is somewhere else.\n\t\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: any) => {\n\t\t\t// Redirecting to active editor\n\t\t\tconst activeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor();\n\t\t\tif (activeEditor) {\n\t\t\t\tactiveEditor.focus();\n\t\t\t\treturn this._runEditorCommand(accessor, activeEditor, args);\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tpublic _runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): boolean | Promise<void> {\n\t\tconst result = this.runEditorCommand(accessor, editor, args);\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic abstract runDOMCommand(): void;\n\tpublic abstract runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\nexport namespace CoreNavigationCommands {\n\n\tclass BaseMoveToCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _minimalReveal: boolean;\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { minimalReveal: boolean; inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._minimalReveal = opts.minimalReveal;\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tconst cursorStateChanged = viewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.moveTo(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition)\n\t\t\t\t]\n\t\t\t);\n\t\t\tif (cursorStateChanged) {\n\t\t\t\tviewModel.revealPrimaryCursor(args.source, true, this._minimalReveal);\n\t\t\t}\n\t\t}\n\t}\n\n\texport const MoveTo: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({\n\t\tid: '_moveTo',\n\t\tminimalReveal: true,\n\t\tinSelectionMode: false,\n\t\tprecondition: undefined\n\t}));\n\n\texport const MoveToSelect: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({\n\t\tid: '_moveToSelect',\n\t\tminimalReveal: false,\n\t\tinSelectionMode: true,\n\t\tprecondition: undefined\n\t}));\n\n\tabstract class ColumnSelectCommand extends CoreEditorCommand {\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tconst result = this._getColumnSelectResult(viewModel, viewModel.getPrimaryCursorState(), viewModel.getCursorColumnSelectData(), args);\n\t\t\tviewModel.setCursorStates(args.source, CursorChangeReason.Explicit, result.viewStates.map((viewState) => CursorState.fromViewState(viewState)));\n\t\t\tviewModel.setCursorColumnSelectData({\n\t\t\t\tisReal: true,\n\t\t\t\tfromViewLineNumber: result.fromLineNumber,\n\t\t\t\tfromViewVisualColumn: result.fromVisualColumn,\n\t\t\t\ttoViewLineNumber: result.toLineNumber,\n\t\t\t\ttoViewVisualColumn: result.toVisualColumn\n\t\t\t});\n\t\t\tif (result.reversed) {\n\t\t\t\tviewModel.revealTopMostCursor(args.source);\n\t\t\t} else {\n\t\t\t\tviewModel.revealBottomMostCursor(args.source);\n\t\t\t}\n\t\t}\n\n\t\tprotected abstract _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult;\n\n\t}\n\n\texport const ColumnSelect: CoreEditorCommand = registerEditorCommand(new class extends ColumnSelectCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'columnSelect',\n\t\t\t\tprecondition: undefined\n\t\t\t});\n\t\t}\n\n\t\tprotected _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\n\t\t\t// validate `args`\n\t\t\tconst validatedPosition = viewModel.model.validatePosition(args.position);\n\t\t\tconst validatedViewPosition = viewModel.coordinatesConverter.validateViewPosition(new Position(args.viewPosition.lineNumber, args.viewPosition.column), validatedPosition);\n\n\t\t\tconst fromViewLineNumber = args.doColumnSelect ? prevColumnSelectData.fromViewLineNumber : validatedViewPosition.lineNumber;\n\t\t\tconst fromViewVisualColumn = args.doColumnSelect ? prevColumnSelectData.fromViewVisualColumn : args.mouseColumn - 1;\n\t\t\treturn ColumnSelection.columnSelect(viewModel.cursorConfig, viewModel, fromViewLineNumber, fromViewVisualColumn, validatedViewPosition.lineNumber, args.mouseColumn - 1);\n\t\t}\n\t});\n\n\texport const CursorColumnSelectLeft: CoreEditorCommand = registerEditorCommand(new class extends ColumnSelectCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cursorColumnSelectLeft',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,\n\t\t\t\t\tlinux: { primary: 0 }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tprotected _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectLeft(viewModel.cursorConfig, viewModel, prevColumnSelectData);\n\t\t}\n\t});\n\n\texport const CursorColumnSelectRight: CoreEditorCommand = registerEditorCommand(new class extends ColumnSelectCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cursorColumnSelectRight',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,\n\t\t\t\t\tlinux: { primary: 0 }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tprotected _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectRight(viewModel.cursorConfig, viewModel, prevColumnSelectData);\n\t\t}\n\t});\n\n\tclass ColumnSelectUpCommand extends ColumnSelectCommand {\n\n\t\tprivate readonly _isPaged: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { isPaged: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._isPaged = opts.isPaged;\n\t\t}\n\n\t\tprotected _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectUp(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged);\n\t\t}\n\t}\n\n\texport const CursorColumnSelectUp: CoreEditorCommand = registerEditorCommand(new ColumnSelectUpCommand({\n\t\tisPaged: false,\n\t\tid: 'cursorColumnSelectUp',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,\n\t\t\tlinux: { primary: 0 }\n\t\t}\n\t}));\n\n\texport const CursorColumnSelectPageUp: CoreEditorCommand = registerEditorCommand(new ColumnSelectUpCommand({\n\t\tisPaged: true,\n\t\tid: 'cursorColumnSelectPageUp',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.PageUp,\n\t\t\tlinux: { primary: 0 }\n\t\t}\n\t}));\n\n\tclass ColumnSelectDownCommand extends ColumnSelectCommand {\n\n\t\tprivate readonly _isPaged: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { isPaged: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._isPaged = opts.isPaged;\n\t\t}\n\n\t\tprotected _getColumnSelectResult(viewModel: IViewModel, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectDown(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged);\n\t\t}\n\t}\n\n\texport const CursorColumnSelectDown: CoreEditorCommand = registerEditorCommand(new ColumnSelectDownCommand({\n\t\tisPaged: false,\n\t\tid: 'cursorColumnSelectDown',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,\n\t\t\tlinux: { primary: 0 }\n\t\t}\n\t}));\n\n\texport const CursorColumnSelectPageDown: CoreEditorCommand = registerEditorCommand(new ColumnSelectDownCommand({\n\t\tisPaged: true,\n\t\tid: 'cursorColumnSelectPageDown',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.PageDown,\n\t\t\tlinux: { primary: 0 }\n\t\t}\n\t}));\n\n\texport class CursorMoveImpl extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cursorMove',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tdescription: CursorMove_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst parsed = CursorMove_.parse(args);\n\t\t\tif (!parsed) {\n\t\t\t\t// illegal arguments\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._runCursorMove(viewModel, args.source, parsed);\n\t\t}\n\n\t\tprivate _runCursorMove(viewModel: IViewModel, source: string | null | undefined, args: CursorMove_.ParsedArguments): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\tsource,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveImpl._move(viewModel, viewModel.getCursorStates(), args)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(source, true);\n\t\t}\n\n\t\tprivate static _move(viewModel: IViewModel, cursors: CursorState[], args: CursorMove_.ParsedArguments): PartialCursorState[] | null {\n\t\t\tconst inSelectionMode = args.select;\n\t\t\tconst value = args.value;\n\n\t\t\tswitch (args.direction) {\n\t\t\t\tcase CursorMove_.Direction.Left:\n\t\t\t\tcase CursorMove_.Direction.Right:\n\t\t\t\tcase CursorMove_.Direction.Up:\n\t\t\t\tcase CursorMove_.Direction.Down:\n\t\t\t\tcase CursorMove_.Direction.PrevBlankLine:\n\t\t\t\tcase CursorMove_.Direction.NextBlankLine:\n\t\t\t\tcase CursorMove_.Direction.WrappedLineStart:\n\t\t\t\tcase CursorMove_.Direction.WrappedLineFirstNonWhitespaceCharacter:\n\t\t\t\tcase CursorMove_.Direction.WrappedLineColumnCenter:\n\t\t\t\tcase CursorMove_.Direction.WrappedLineEnd:\n\t\t\t\tcase CursorMove_.Direction.WrappedLineLastNonWhitespaceCharacter:\n\t\t\t\t\treturn CursorMoveCommands.simpleMove(viewModel, cursors, args.direction, inSelectionMode, value, args.unit);\n\n\t\t\t\tcase CursorMove_.Direction.ViewPortTop:\n\t\t\t\tcase CursorMove_.Direction.ViewPortBottom:\n\t\t\t\tcase CursorMove_.Direction.ViewPortCenter:\n\t\t\t\tcase CursorMove_.Direction.ViewPortIfOutside:\n\t\t\t\t\treturn CursorMoveCommands.viewportMove(viewModel, cursors, args.direction, inSelectionMode, value);\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\n\texport const CursorMove: CursorMoveImpl = registerEditorCommand(new CursorMoveImpl());\n\n\tconst enum Constants {\n\t\tPAGE_SIZE_MARKER = -1\n\t}\n\n\tclass CursorMoveBasedCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _staticArgs: CursorMove_.SimpleMoveArguments;\n\n\t\tconstructor(opts: ICommandOptions & { args: CursorMove_.SimpleMoveArguments }) {\n\t\t\tsuper(opts);\n\t\t\tthis._staticArgs = opts.args;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, dynamicArgs: any): void {\n\t\t\tlet args = this._staticArgs;\n\t\t\tif (this._staticArgs.value === Constants.PAGE_SIZE_MARKER) {\n\t\t\t\t// -1 is a marker for page size\n\t\t\t\targs = {\n\t\t\t\t\tdirection: this._staticArgs.direction,\n\t\t\t\t\tunit: this._staticArgs.unit,\n\t\t\t\t\tselect: this._staticArgs.select,\n\t\t\t\t\tvalue: dynamicArgs.pageSize || viewModel.cursorConfig.pageSize\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\tdynamicArgs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.simpleMove(viewModel, viewModel.getCursorStates(), args.direction, args.select, args.value, args.unit)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(dynamicArgs.source, true);\n\t\t}\n\t}\n\n\texport const CursorLeft: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Left,\n\t\t\tunit: CursorMove_.Unit.None,\n\t\t\tselect: false,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorLeft',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.LeftArrow,\n\t\t\tmac: { primary: KeyCode.LeftArrow, secondary: [KeyMod.WinCtrl | KeyCode.KeyB] }\n\t\t}\n\t}));\n\n\texport const CursorLeftSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Left,\n\t\t\tunit: CursorMove_.Unit.None,\n\t\t\tselect: true,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorLeftSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.LeftArrow\n\t\t}\n\t}));\n\n\texport const CursorRight: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Right,\n\t\t\tunit: CursorMove_.Unit.None,\n\t\t\tselect: false,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorRight',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.RightArrow,\n\t\t\tmac: { primary: KeyCode.RightArrow, secondary: [KeyMod.WinCtrl | KeyCode.KeyF] }\n\t\t}\n\t}));\n\n\texport const CursorRightSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Right,\n\t\t\tunit: CursorMove_.Unit.None,\n\t\t\tselect: true,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorRightSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.RightArrow\n\t\t}\n\t}));\n\n\texport const CursorUp: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Up,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: false,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorUp',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.UpArrow,\n\t\t\tmac: { primary: KeyCode.UpArrow, secondary: [KeyMod.WinCtrl | KeyCode.KeyP] }\n\t\t}\n\t}));\n\n\texport const CursorUpSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Up,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: true,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorUpSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.UpArrow,\n\t\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow],\n\t\t\tmac: { primary: KeyMod.Shift | KeyCode.UpArrow },\n\t\t\tlinux: { primary: KeyMod.Shift | KeyCode.UpArrow }\n\t\t}\n\t}));\n\n\texport const CursorPageUp: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Up,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: false,\n\t\t\tvalue: Constants.PAGE_SIZE_MARKER\n\t\t},\n\t\tid: 'cursorPageUp',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.PageUp\n\t\t}\n\t}));\n\n\texport const CursorPageUpSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Up,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: true,\n\t\t\tvalue: Constants.PAGE_SIZE_MARKER\n\t\t},\n\t\tid: 'cursorPageUpSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.PageUp\n\t\t}\n\t}));\n\n\texport const CursorDown: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Down,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: false,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorDown',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.DownArrow,\n\t\t\tmac: { primary: KeyCode.DownArrow, secondary: [KeyMod.WinCtrl | KeyCode.KeyN] }\n\t\t}\n\t}));\n\n\texport const CursorDownSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Down,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: true,\n\t\t\tvalue: 1\n\t\t},\n\t\tid: 'cursorDownSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.DownArrow,\n\t\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow],\n\t\t\tmac: { primary: KeyMod.Shift | KeyCode.DownArrow },\n\t\t\tlinux: { primary: KeyMod.Shift | KeyCode.DownArrow }\n\t\t}\n\t}));\n\n\texport const CursorPageDown: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Down,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: false,\n\t\t\tvalue: Constants.PAGE_SIZE_MARKER\n\t\t},\n\t\tid: 'cursorPageDown',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.PageDown\n\t\t}\n\t}));\n\n\texport const CursorPageDownSelect: CoreEditorCommand = registerEditorCommand(new CursorMoveBasedCommand({\n\t\targs: {\n\t\t\tdirection: CursorMove_.Direction.Down,\n\t\t\tunit: CursorMove_.Unit.WrappedLine,\n\t\t\tselect: true,\n\t\t\tvalue: Constants.PAGE_SIZE_MARKER\n\t\t},\n\t\tid: 'cursorPageDownSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.PageDown\n\t\t}\n\t}));\n\n\texport const CreateCursor: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'createCursor',\n\t\t\t\tprecondition: undefined\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tlet newState: PartialCursorState;\n\t\t\tif (args.wholeLine) {\n\t\t\t\tnewState = CursorMoveCommands.line(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition);\n\t\t\t} else {\n\t\t\t\tnewState = CursorMoveCommands.moveTo(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition);\n\t\t\t}\n\n\t\t\tconst states: PartialCursorState[] = viewModel.getCursorStates();\n\n\t\t\t// Check if we should remove a cursor (sort of like a toggle)\n\t\t\tif (states.length > 1) {\n\t\t\t\tconst newModelPosition = (newState.modelState ? newState.modelState.position : null);\n\t\t\t\tconst newViewPosition = (newState.viewState ? newState.viewState.position : null);\n\n\t\t\t\tfor (let i = 0, len = states.length; i < len; i++) {\n\t\t\t\t\tconst state = states[i];\n\n\t\t\t\t\tif (newModelPosition && !state.modelState!.selection.containsPosition(newModelPosition)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newViewPosition && !state.viewState!.selection.containsPosition(newViewPosition)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// => Remove the cursor\n\t\t\t\t\tstates.splice(i, 1);\n\n\t\t\t\t\tviewModel.model.pushStackElement();\n\t\t\t\t\tviewModel.setCursorStates(\n\t\t\t\t\t\targs.source,\n\t\t\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t\t\tstates\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// => Add the new cursor\n\t\t\tstates.push(newState);\n\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tstates\n\t\t\t);\n\t\t}\n\t});\n\n\texport const LastCursorMoveToSelect: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: '_lastCursorMoveToSelect',\n\t\t\t\tprecondition: undefined\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst lastAddedCursorIndex = viewModel.getLastAddedCursorIndex();\n\n\t\t\tconst states = viewModel.getCursorStates();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.moveTo(viewModel, states[lastAddedCursorIndex], true, args.position, args.viewPosition);\n\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tnewStates\n\t\t\t);\n\t\t}\n\t});\n\n\tclass HomeCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToBeginningOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t}\n\n\texport const CursorHome: CoreEditorCommand = registerEditorCommand(new HomeCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorHome',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.Home,\n\t\t\tmac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow] }\n\t\t}\n\t}));\n\n\texport const CursorHomeSelect: CoreEditorCommand = registerEditorCommand(new HomeCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorHomeSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.Home,\n\t\t\tmac: { primary: KeyMod.Shift | KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow] }\n\t\t}\n\t}));\n\n\tclass LineStartCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tthis._exec(viewModel.getCursorStates())\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\n\t\tprivate _exec(cursors: CursorState[]): PartialCursorState[] {\n\t\t\tconst result: PartialCursorState[] = [];\n\t\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\t\tconst cursor = cursors[i];\n\t\t\t\tconst lineNumber = cursor.modelState.position.lineNumber;\n\t\t\t\tresult[i] = CursorState.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, 1, 0));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\texport const CursorLineStart: CoreEditorCommand = registerEditorCommand(new LineStartCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorLineStart',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: 0,\n\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyA }\n\t\t}\n\t}));\n\n\texport const CursorLineStartSelect: CoreEditorCommand = registerEditorCommand(new LineStartCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorLineStartSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: 0,\n\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyA }\n\t\t}\n\t}));\n\n\tclass EndCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToEndOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode, args.sticky || false)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t}\n\n\texport const CursorEnd: CoreEditorCommand = registerEditorCommand(new EndCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorEnd',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\targs: { sticky: false },\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyCode.End,\n\t\t\tmac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow] }\n\t\t},\n\t\tdescription: {\n\t\t\tdescription: `Go to End`,\n\t\t\targs: [{\n\t\t\t\tname: 'args',\n\t\t\t\tschema: {\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\t'sticky': {\n\t\t\t\t\t\t\tdescription: nls.localize('stickydesc', \"Stick to the end even when going to longer lines\"),\n\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\tdefault: false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}]\n\t\t}\n\t}));\n\n\texport const CursorEndSelect: CoreEditorCommand = registerEditorCommand(new EndCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorEndSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\targs: { sticky: false },\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.Shift | KeyCode.End,\n\t\t\tmac: { primary: KeyMod.Shift | KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow] }\n\t\t},\n\t\tdescription: {\n\t\t\tdescription: `Select to End`,\n\t\t\targs: [{\n\t\t\t\tname: 'args',\n\t\t\t\tschema: {\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\t'sticky': {\n\t\t\t\t\t\t\tdescription: nls.localize('stickydesc', \"Stick to the end even when going to longer lines\"),\n\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\tdefault: false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}]\n\t\t}\n\t}));\n\n\tclass LineEndCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tthis._exec(viewModel, viewModel.getCursorStates())\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\n\t\tprivate _exec(viewModel: IViewModel, cursors: CursorState[]): PartialCursorState[] {\n\t\t\tconst result: PartialCursorState[] = [];\n\t\t\tfor (let i = 0, len = cursors.length; i < len; i++) {\n\t\t\t\tconst cursor = cursors[i];\n\t\t\t\tconst lineNumber = cursor.modelState.position.lineNumber;\n\t\t\t\tconst maxColumn = viewModel.model.getLineMaxColumn(lineNumber);\n\t\t\t\tresult[i] = CursorState.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, maxColumn, 0));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\texport const CursorLineEnd: CoreEditorCommand = registerEditorCommand(new LineEndCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorLineEnd',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: 0,\n\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyE }\n\t\t}\n\t}));\n\n\texport const CursorLineEndSelect: CoreEditorCommand = registerEditorCommand(new LineEndCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorLineEndSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: 0,\n\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyE }\n\t\t}\n\t}));\n\n\tclass TopCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToBeginningOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t}\n\n\texport const CursorTop: CoreEditorCommand = registerEditorCommand(new TopCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorTop',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Home,\n\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow }\n\t\t}\n\t}));\n\n\texport const CursorTopSelect: CoreEditorCommand = registerEditorCommand(new TopCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorTopSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Home,\n\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow }\n\t\t}\n\t}));\n\n\tclass BottomCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToEndOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t}\n\n\texport const CursorBottom: CoreEditorCommand = registerEditorCommand(new BottomCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'cursorBottom',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.End,\n\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow }\n\t\t}\n\t}));\n\n\texport const CursorBottomSelect: CoreEditorCommand = registerEditorCommand(new BottomCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorBottomSelect',\n\t\tprecondition: undefined,\n\t\tkbOpts: {\n\t\t\tweight: CORE_WEIGHT,\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.End,\n\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow }\n\t\t}\n\t}));\n\n\texport class EditorScrollImpl extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'editorScroll',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tdescription: EditorScroll_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst parsed = EditorScroll_.parse(args);\n\t\t\tif (!parsed) {\n\t\t\t\t// illegal arguments\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._runEditorScroll(viewModel, args.source, parsed);\n\t\t}\n\n\t\t_runEditorScroll(viewModel: IViewModel, source: string | null | undefined, args: EditorScroll_.ParsedArguments): void {\n\n\t\t\tconst desiredScrollTop = this._computeDesiredScrollTop(viewModel, args);\n\n\t\t\tif (args.revealCursor) {\n\t\t\t\t// must ensure cursor is in new visible range\n\t\t\t\tconst desiredVisibleViewRange = viewModel.getCompletelyVisibleViewRangeAtScrollTop(desiredScrollTop);\n\t\t\t\tviewModel.setCursorStates(\n\t\t\t\t\tsource,\n\t\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t\t[\n\t\t\t\t\t\tCursorMoveCommands.findPositionInViewportIfOutside(viewModel, viewModel.getPrimaryCursorState(), desiredVisibleViewRange, args.select)\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tviewModel.viewLayout.setScrollPosition({ scrollTop: desiredScrollTop }, ScrollType.Smooth);\n\t\t}\n\n\t\tprivate _computeDesiredScrollTop(viewModel: IViewModel, args: EditorScroll_.ParsedArguments): number {\n\n\t\t\tif (args.unit === EditorScroll_.Unit.Line) {\n\t\t\t\t// scrolling by model lines\n\t\t\t\tconst visibleViewRange = viewModel.getCompletelyVisibleViewRange();\n\t\t\t\tconst visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange);\n\n\t\t\t\tlet desiredTopModelLineNumber: number;\n\t\t\t\tif (args.direction === EditorScroll_.Direction.Up) {\n\t\t\t\t\t// must go x model lines up\n\t\t\t\t\tdesiredTopModelLineNumber = Math.max(1, visibleModelRange.startLineNumber - args.value);\n\t\t\t\t} else {\n\t\t\t\t\t// must go x model lines down\n\t\t\t\t\tdesiredTopModelLineNumber = Math.min(viewModel.model.getLineCount(), visibleModelRange.startLineNumber + args.value);\n\t\t\t\t}\n\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(new Position(desiredTopModelLineNumber, 1));\n\t\t\t\treturn viewModel.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber);\n\t\t\t}\n\n\t\t\tlet noOfLines: number;\n\t\t\tif (args.unit === EditorScroll_.Unit.Page) {\n\t\t\t\tnoOfLines = viewModel.cursorConfig.pageSize * args.value;\n\t\t\t} else if (args.unit === EditorScroll_.Unit.HalfPage) {\n\t\t\t\tnoOfLines = Math.round(viewModel.cursorConfig.pageSize / 2) * args.value;\n\t\t\t} else {\n\t\t\t\tnoOfLines = args.value;\n\t\t\t}\n\t\t\tconst deltaLines = (args.direction === EditorScroll_.Direction.Up ? -1 : 1) * noOfLines;\n\t\t\treturn viewModel.viewLayout.getCurrentScrollTop() + deltaLines * viewModel.cursorConfig.lineHeight;\n\t\t}\n\t}\n\n\texport const EditorScroll: EditorScrollImpl = registerEditorCommand(new EditorScrollImpl());\n\n\texport const ScrollLineUp: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'scrollLineUp',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.UpArrow,\n\t\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.PageUp }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\trunCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(viewModel, args.source, {\n\t\t\t\tdirection: EditorScroll_.Direction.Up,\n\t\t\t\tunit: EditorScroll_.Unit.WrappedLine,\n\t\t\t\tvalue: 1,\n\t\t\t\trevealCursor: false,\n\t\t\t\tselect: false\n\t\t\t});\n\t\t}\n\t});\n\n\texport const ScrollPageUp: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'scrollPageUp',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.PageUp,\n\t\t\t\t\twin: { primary: KeyMod.Alt | KeyCode.PageUp },\n\t\t\t\t\tlinux: { primary: KeyMod.Alt | KeyCode.PageUp }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\trunCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(viewModel, args.source, {\n\t\t\t\tdirection: EditorScroll_.Direction.Up,\n\t\t\t\tunit: EditorScroll_.Unit.Page,\n\t\t\t\tvalue: 1,\n\t\t\t\trevealCursor: false,\n\t\t\t\tselect: false\n\t\t\t});\n\t\t}\n\t});\n\n\texport const ScrollLineDown: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'scrollLineDown',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.DownArrow,\n\t\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.PageDown }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\trunCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(viewModel, args.source, {\n\t\t\t\tdirection: EditorScroll_.Direction.Down,\n\t\t\t\tunit: EditorScroll_.Unit.WrappedLine,\n\t\t\t\tvalue: 1,\n\t\t\t\trevealCursor: false,\n\t\t\t\tselect: false\n\t\t\t});\n\t\t}\n\t});\n\n\texport const ScrollPageDown: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'scrollPageDown',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.PageDown,\n\t\t\t\t\twin: { primary: KeyMod.Alt | KeyCode.PageDown },\n\t\t\t\t\tlinux: { primary: KeyMod.Alt | KeyCode.PageDown }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\trunCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(viewModel, args.source, {\n\t\t\t\tdirection: EditorScroll_.Direction.Down,\n\t\t\t\tunit: EditorScroll_.Unit.Page,\n\t\t\t\tvalue: 1,\n\t\t\t\trevealCursor: false,\n\t\t\t\tselect: false\n\t\t\t});\n\t\t}\n\t});\n\n\tclass WordCommand extends CoreEditorCommand {\n\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.word(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position)\n\t\t\t\t]\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t}\n\n\texport const WordSelect: CoreEditorCommand = registerEditorCommand(new WordCommand({\n\t\tinSelectionMode: false,\n\t\tid: '_wordSelect',\n\t\tprecondition: undefined\n\t}));\n\n\texport const WordSelectDrag: CoreEditorCommand = registerEditorCommand(new WordCommand({\n\t\tinSelectionMode: true,\n\t\tid: '_wordSelectDrag',\n\t\tprecondition: undefined\n\t}));\n\n\texport const LastCursorWordSelect: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'lastCursorWordSelect',\n\t\t\t\tprecondition: undefined\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst lastAddedCursorIndex = viewModel.getLastAddedCursorIndex();\n\n\t\t\tconst states = viewModel.getCursorStates();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tconst lastAddedState = states[lastAddedCursorIndex];\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.word(viewModel, lastAddedState, lastAddedState.modelState.hasSelection(), args.position);\n\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tnewStates\n\t\t\t);\n\t\t}\n\t});\n\n\tclass LineCommand extends CoreEditorCommand {\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.line(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition)\n\t\t\t\t]\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, false);\n\t\t}\n\t}\n\n\texport const LineSelect: CoreEditorCommand = registerEditorCommand(new LineCommand({\n\t\tinSelectionMode: false,\n\t\tid: '_lineSelect',\n\t\tprecondition: undefined\n\t}));\n\n\texport const LineSelectDrag: CoreEditorCommand = registerEditorCommand(new LineCommand({\n\t\tinSelectionMode: true,\n\t\tid: '_lineSelectDrag',\n\t\tprecondition: undefined\n\t}));\n\n\tclass LastCursorLineCommand extends CoreEditorCommand {\n\t\tprivate readonly _inSelectionMode: boolean;\n\n\t\tconstructor(opts: ICommandOptions & { inSelectionMode: boolean }) {\n\t\t\tsuper(opts);\n\t\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst lastAddedCursorIndex = viewModel.getLastAddedCursorIndex();\n\n\t\t\tconst states = viewModel.getCursorStates();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.line(viewModel, states[lastAddedCursorIndex], this._inSelectionMode, args.position, args.viewPosition);\n\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tnewStates\n\t\t\t);\n\t\t}\n\t}\n\n\texport const LastCursorLineSelect: CoreEditorCommand = registerEditorCommand(new LastCursorLineCommand({\n\t\tinSelectionMode: false,\n\t\tid: 'lastCursorLineSelect',\n\t\tprecondition: undefined\n\t}));\n\n\texport const LastCursorLineSelectDrag: CoreEditorCommand = registerEditorCommand(new LastCursorLineCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'lastCursorLineSelectDrag',\n\t\tprecondition: undefined\n\t}));\n\n\texport const CancelSelection: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cancelSelection',\n\t\t\t\tprecondition: EditorContextKeys.hasNonEmptySelection,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyCode.Escape,\n\t\t\t\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.cancelSelection(viewModel, viewModel.getPrimaryCursorState())\n\t\t\t\t]\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t}\n\t});\n\n\texport const RemoveSecondaryCursors: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'removeSecondaryCursors',\n\t\t\t\tprecondition: EditorContextKeys.hasMultipleSelections,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT + 1,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyCode.Escape,\n\t\t\t\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tviewModel.getPrimaryCursorState()\n\t\t\t\t]\n\t\t\t);\n\t\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t\t\tstatus(nls.localize('removedCursor', \"Removed secondary cursors\"));\n\t\t}\n\t});\n\n\texport const RevealLine: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'revealLine',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tdescription: RevealLine_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tconst revealLineArg = <RevealLine_.RawArguments>args;\n\t\t\tconst lineNumberArg = revealLineArg.lineNumber || 0;\n\t\t\tlet lineNumber = typeof lineNumberArg === 'number' ? (lineNumberArg + 1) : (parseInt(lineNumberArg) + 1);\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tlineNumber = 1;\n\t\t\t}\n\t\t\tconst lineCount = viewModel.model.getLineCount();\n\t\t\tif (lineNumber > lineCount) {\n\t\t\t\tlineNumber = lineCount;\n\t\t\t}\n\n\t\t\tconst range = new Range(\n\t\t\t\tlineNumber, 1,\n\t\t\t\tlineNumber, viewModel.model.getLineMaxColumn(lineNumber)\n\t\t\t);\n\n\t\t\tlet revealAt = VerticalRevealType.Simple;\n\t\t\tif (revealLineArg.at) {\n\t\t\t\tswitch (revealLineArg.at) {\n\t\t\t\t\tcase RevealLine_.RawAtArgument.Top:\n\t\t\t\t\t\trevealAt = VerticalRevealType.Top;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RevealLine_.RawAtArgument.Center:\n\t\t\t\t\t\trevealAt = VerticalRevealType.Center;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RevealLine_.RawAtArgument.Bottom:\n\t\t\t\t\t\trevealAt = VerticalRevealType.Bottom;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst viewRange = viewModel.coordinatesConverter.convertModelRangeToViewRange(range);\n\n\t\t\tviewModel.revealRange(args.source, false, viewRange, revealAt, ScrollType.Smooth);\n\t\t}\n\t});\n\n\texport const SelectAll = new class extends EditorOrNativeTextInputCommand {\n\t\tconstructor() {\n\t\t\tsuper(SelectAllCommand);\n\t\t}\n\t\tpublic runDOMCommand(): void {\n\t\t\tif (isFirefox) {\n\t\t\t\t(<HTMLInputElement>document.activeElement).focus();\n\t\t\t\t(<HTMLInputElement>document.activeElement).select();\n\t\t\t}\n\n\t\t\tdocument.execCommand('selectAll');\n\t\t}\n\t\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tif (!viewModel) {\n\t\t\t\t// the editor has no view => has no cursors\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.runCoreEditorCommand(viewModel, args);\n\t\t}\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\t'keyboard',\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.selectAll(viewModel, viewModel.getPrimaryCursorState())\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}();\n\n\texport const SetSelection: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'setSelection',\n\t\t\t\tprecondition: undefined\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(viewModel: IViewModel, args: any): void {\n\t\t\tviewModel.model.pushStackElement();\n\t\t\tviewModel.setCursorStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorState.fromModelSelection(args.selection)\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t});\n}\n\nconst columnSelectionCondition = ContextKeyExpr.and(\n\tEditorContextKeys.textInputFocus,\n\tEditorContextKeys.columnSelection\n);\nfunction registerColumnSelection(id: string, keybinding: number): void {\n\tKeybindingsRegistry.registerKeybindingRule({\n\t\tid: id,\n\t\tprimary: keybinding,\n\t\twhen: columnSelectionCondition,\n\t\tweight: CORE_WEIGHT + 1\n\t});\n}\n\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectLeft.id, KeyMod.Shift | KeyCode.LeftArrow);\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectRight.id, KeyMod.Shift | KeyCode.RightArrow);\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectUp.id, KeyMod.Shift | KeyCode.UpArrow);\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectPageUp.id, KeyMod.Shift | KeyCode.PageUp);\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectDown.id, KeyMod.Shift | KeyCode.DownArrow);\nregisterColumnSelection(CoreNavigationCommands.CursorColumnSelectPageDown.id, KeyMod.Shift | KeyCode.PageDown);\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport namespace CoreEditingCommands {\n\n\texport abstract class CoreEditingCommand extends EditorCommand {\n\t\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tif (!viewModel) {\n\t\t\t\t// the editor has no view => has no cursors\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.runCoreEditingCommand(editor, viewModel, args || {});\n\t\t}\n\n\t\tpublic abstract runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void;\n\t}\n\n\texport const LineBreakInsert: EditorCommand = registerEditorCommand(new class extends CoreEditingCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'lineBreakInsert',\n\t\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: 0,\n\t\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyO }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.lineBreakInsert(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)));\n\t\t}\n\t});\n\n\texport const Outdent: EditorCommand = registerEditorCommand(new class extends CoreEditingCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'outdent',\n\t\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: ContextKeyExpr.and(\n\t\t\t\t\t\tEditorContextKeys.editorTextFocus,\n\t\t\t\t\t\tEditorContextKeys.tabDoesNotMoveFocus\n\t\t\t\t\t),\n\t\t\t\t\tprimary: KeyMod.Shift | KeyCode.Tab\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.outdent(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)));\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t});\n\n\texport const Tab: EditorCommand = registerEditorCommand(new class extends CoreEditingCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'tab',\n\t\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: ContextKeyExpr.and(\n\t\t\t\t\t\tEditorContextKeys.editorTextFocus,\n\t\t\t\t\t\tEditorContextKeys.tabDoesNotMoveFocus\n\t\t\t\t\t),\n\t\t\t\t\tprimary: KeyCode.Tab\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.tab(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)));\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t});\n\n\texport const DeleteLeft: EditorCommand = registerEditorCommand(new class extends CoreEditingCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'deleteLeft',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyCode.Backspace,\n\t\t\t\t\tsecondary: [KeyMod.Shift | KeyCode.Backspace],\n\t\t\t\t\tmac: { primary: KeyCode.Backspace, secondary: [KeyMod.Shift | KeyCode.Backspace, KeyMod.WinCtrl | KeyCode.KeyH, KeyMod.WinCtrl | KeyCode.Backspace] }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void {\n\t\t\tconst [shouldPushStackElementBefore, commands] = DeleteOperations.deleteLeft(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection), viewModel.getCursorAutoClosedCharacters());\n\t\t\tif (shouldPushStackElementBefore) {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t}\n\t\t\teditor.executeCommands(this.id, commands);\n\t\t\tviewModel.setPrevEditOperationType(EditOperationType.DeletingLeft);\n\t\t}\n\t});\n\n\texport const DeleteRight: EditorCommand = registerEditorCommand(new class extends CoreEditingCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'deleteRight',\n\t\t\t\tprecondition: undefined,\n\t\t\t\tkbOpts: {\n\t\t\t\t\tweight: CORE_WEIGHT,\n\t\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\t\tprimary: KeyCode.Delete,\n\t\t\t\t\tmac: { primary: KeyCode.Delete, secondary: [KeyMod.WinCtrl | KeyCode.KeyD, KeyMod.WinCtrl | KeyCode.Delete] }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, viewModel: IViewModel, args: any): void {\n\t\t\tconst [shouldPushStackElementBefore, commands] = DeleteOperations.deleteRight(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection));\n\t\t\tif (shouldPushStackElementBefore) {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t}\n\t\t\teditor.executeCommands(this.id, commands);\n\t\t\tviewModel.setPrevEditOperationType(EditOperationType.DeletingRight);\n\t\t}\n\t});\n\n\texport const Undo = new class extends EditorOrNativeTextInputCommand {\n\t\tconstructor() {\n\t\t\tsuper(UndoCommand);\n\t\t}\n\t\tpublic runDOMCommand(): void {\n\t\t\tdocument.execCommand('undo');\n\t\t}\n\t\tpublic runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\t\tif (!editor.hasModel() || editor.getOption(EditorOption.readOnly) === true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn editor.getModel().undo();\n\t\t}\n\t}();\n\n\texport const Redo = new class extends EditorOrNativeTextInputCommand {\n\t\tconstructor() {\n\t\t\tsuper(RedoCommand);\n\t\t}\n\t\tpublic runDOMCommand(): void {\n\t\t\tdocument.execCommand('redo');\n\t\t}\n\t\tpublic runEditorCommand(accessor: ServicesAccessor | null, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\t\tif (!editor.hasModel() || editor.getOption(EditorOption.readOnly) === true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn editor.getModel().redo();\n\t\t}\n\t}();\n}\n\n/**\n * A command that will invoke a command on the focused editor.\n */\nclass EditorHandlerCommand extends Command {\n\n\tprivate readonly _handlerId: string;\n\n\tconstructor(id: string, handlerId: string, description?: ICommandHandlerDescription) {\n\t\tsuper({\n\t\t\tid: id,\n\t\t\tprecondition: undefined,\n\t\t\tdescription: description\n\t\t});\n\t\tthis._handlerId = handlerId;\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void {\n\t\tconst editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\teditor.trigger('keyboard', this._handlerId, args);\n\t}\n}\n\nfunction registerOverwritableCommand(handlerId: string, description?: ICommandHandlerDescription): void {\n\tregisterCommand(new EditorHandlerCommand('default:' + handlerId, handlerId));\n\tregisterCommand(new EditorHandlerCommand(handlerId, handlerId, description));\n}\n\nregisterOverwritableCommand(Handler.Type, {\n\tdescription: `Type`,\n\targs: [{\n\t\tname: 'args',\n\t\tschema: {\n\t\t\t'type': 'object',\n\t\t\t'required': ['text'],\n\t\t\t'properties': {\n\t\t\t\t'text': {\n\t\t\t\t\t'type': 'string'\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t}]\n});\nregisterOverwritableCommand(Handler.ReplacePreviousChar);\nregisterOverwritableCommand(Handler.CompositionType);\nregisterOverwritableCommand(Handler.CompositionStart);\nregisterOverwritableCommand(Handler.CompositionEnd);\nregisterOverwritableCommand(Handler.Paste);\nregisterOverwritableCommand(Handler.Cut);\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 { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\n\nexport class MarkerDecorationsContribution implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.markerDecorations';\n\n\tconstructor(\n\t\t_editor: ICodeEditor,\n\t\t@IMarkerDecorationsService _markerDecorationsService: IMarkerDecorationsService\n\t) {\n\t\t// Doesn't do anything, just requires `IMarkerDecorationsService` to make sure it gets instantiated\n\t}\n\n\tdispose(): void {\n\t}\n}\n\nregisterEditorContribution(MarkerDecorationsContribution.ID, MarkerDecorationsContribution);\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { CoreNavigationCommands } from 'vs/editor/browser/coreCommands';\nimport { IEditorMouseEvent, IPartialEditorMouseEvent } from 'vs/editor/browser/editorBrowser';\nimport { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { IViewModel } from 'vs/editor/common/viewModel';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport * as platform from 'vs/base/common/platform';\n\nexport interface IMouseDispatchData {\n\tposition: Position;\n\t/**\n\t * Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).\n\t */\n\tmouseColumn: number;\n\tstartedOnLineNumbers: boolean;\n\n\tinSelectionMode: boolean;\n\tmouseDownCount: number;\n\taltKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n\n\tleftButton: boolean;\n\tmiddleButton: boolean;\n\tonInjectedText: boolean;\n}\n\nexport interface ICommandDelegate {\n\tpaste(text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null): void;\n\ttype(text: string): void;\n\tcompositionType(text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): void;\n\tstartComposition(): void;\n\tendComposition(): void;\n\tcut(): void;\n}\n\nexport class ViewController {\n\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly viewModel: IViewModel;\n\tprivate readonly userInputEvents: ViewUserInputEvents;\n\tprivate readonly commandDelegate: ICommandDelegate;\n\n\tconstructor(\n\t\tconfiguration: IEditorConfiguration,\n\t\tviewModel: IViewModel,\n\t\tuserInputEvents: ViewUserInputEvents,\n\t\tcommandDelegate: ICommandDelegate\n\t) {\n\t\tthis.configuration = configuration;\n\t\tthis.viewModel = viewModel;\n\t\tthis.userInputEvents = userInputEvents;\n\t\tthis.commandDelegate = commandDelegate;\n\t}\n\n\tpublic paste(text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null): void {\n\t\tthis.commandDelegate.paste(text, pasteOnNewLine, multicursorText, mode);\n\t}\n\n\tpublic type(text: string): void {\n\t\tthis.commandDelegate.type(text);\n\t}\n\n\tpublic compositionType(text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): void {\n\t\tthis.commandDelegate.compositionType(text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t}\n\n\tpublic compositionStart(): void {\n\t\tthis.commandDelegate.startComposition();\n\t}\n\n\tpublic compositionEnd(): void {\n\t\tthis.commandDelegate.endComposition();\n\t}\n\n\tpublic cut(): void {\n\t\tthis.commandDelegate.cut();\n\t}\n\n\tpublic setSelection(modelSelection: Selection): void {\n\t\tCoreNavigationCommands.SetSelection.runCoreEditorCommand(this.viewModel, {\n\t\t\tsource: 'keyboard',\n\t\t\tselection: modelSelection\n\t\t});\n\t}\n\n\tprivate _validateViewColumn(viewPosition: Position): Position {\n\t\tconst minColumn = this.viewModel.getLineMinColumn(viewPosition.lineNumber);\n\t\tif (viewPosition.column < minColumn) {\n\t\t\treturn new Position(viewPosition.lineNumber, minColumn);\n\t\t}\n\t\treturn viewPosition;\n\t}\n\n\tprivate _hasMulticursorModifier(data: IMouseDispatchData): boolean {\n\t\tswitch (this.configuration.options.get(EditorOption.multiCursorModifier)) {\n\t\t\tcase 'altKey':\n\t\t\t\treturn data.altKey;\n\t\t\tcase 'ctrlKey':\n\t\t\t\treturn data.ctrlKey;\n\t\t\tcase 'metaKey':\n\t\t\t\treturn data.metaKey;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate _hasNonMulticursorModifier(data: IMouseDispatchData): boolean {\n\t\tswitch (this.configuration.options.get(EditorOption.multiCursorModifier)) {\n\t\t\tcase 'altKey':\n\t\t\t\treturn data.ctrlKey || data.metaKey;\n\t\t\tcase 'ctrlKey':\n\t\t\t\treturn data.altKey || data.metaKey;\n\t\t\tcase 'metaKey':\n\t\t\t\treturn data.ctrlKey || data.altKey;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic dispatchMouse(data: IMouseDispatchData): void {\n\t\tconst options = this.configuration.options;\n\t\tconst selectionClipboardIsOn = (platform.isLinux && options.get(EditorOption.selectionClipboard));\n\t\tconst columnSelection = options.get(EditorOption.columnSelection);\n\t\tif (data.middleButton && !selectionClipboardIsOn) {\n\t\t\tthis._columnSelect(data.position, data.mouseColumn, data.inSelectionMode);\n\t\t} else if (data.startedOnLineNumbers) {\n\t\t\t// If the dragging started on the gutter, then have operations work on the entire line\n\t\t\tif (this._hasMulticursorModifier(data)) {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tthis._lastCursorLineSelect(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._createCursor(data.position, true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tthis._lineSelectDrag(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._lineSelect(data.position);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (data.mouseDownCount >= 4) {\n\t\t\tthis._selectAll();\n\t\t} else if (data.mouseDownCount === 3) {\n\t\t\tif (this._hasMulticursorModifier(data)) {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tthis._lastCursorLineSelectDrag(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._lastCursorLineSelect(data.position);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tthis._lineSelectDrag(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._lineSelect(data.position);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (data.mouseDownCount === 2) {\n\t\t\tif (!data.onInjectedText) {\n\t\t\t\tif (this._hasMulticursorModifier(data)) {\n\t\t\t\t\tthis._lastCursorWordSelect(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\t\tthis._wordSelectDrag(data.position);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._wordSelect(data.position);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._hasMulticursorModifier(data)) {\n\t\t\t\tif (!this._hasNonMulticursorModifier(data)) {\n\t\t\t\t\tif (data.shiftKey) {\n\t\t\t\t\t\tthis._columnSelect(data.position, data.mouseColumn, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Do multi-cursor operations only when purely alt is pressed\n\t\t\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\t\t\tthis._lastCursorMoveToSelect(data.position);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._createCursor(data.position, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tif (data.altKey) {\n\t\t\t\t\t\tthis._columnSelect(data.position, data.mouseColumn, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (columnSelection) {\n\t\t\t\t\t\t\tthis._columnSelect(data.position, data.mouseColumn, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._moveToSelect(data.position);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.moveTo(data.position);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _usualArgs(viewPosition: Position) {\n\t\tviewPosition = this._validateViewColumn(viewPosition);\n\t\treturn {\n\t\t\tsource: 'mouse',\n\t\t\tposition: this._convertViewToModelPosition(viewPosition),\n\t\t\tviewPosition: viewPosition\n\t\t};\n\t}\n\n\tpublic moveTo(viewPosition: Position): void {\n\t\tCoreNavigationCommands.MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _moveToSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _columnSelect(viewPosition: Position, mouseColumn: number, doColumnSelect: boolean): void {\n\t\tviewPosition = this._validateViewColumn(viewPosition);\n\t\tCoreNavigationCommands.ColumnSelect.runCoreEditorCommand(this.viewModel, {\n\t\t\tsource: 'mouse',\n\t\t\tposition: this._convertViewToModelPosition(viewPosition),\n\t\t\tviewPosition: viewPosition,\n\t\t\tmouseColumn: mouseColumn,\n\t\t\tdoColumnSelect: doColumnSelect\n\t\t});\n\t}\n\n\tprivate _createCursor(viewPosition: Position, wholeLine: boolean): void {\n\t\tviewPosition = this._validateViewColumn(viewPosition);\n\t\tCoreNavigationCommands.CreateCursor.runCoreEditorCommand(this.viewModel, {\n\t\t\tsource: 'mouse',\n\t\t\tposition: this._convertViewToModelPosition(viewPosition),\n\t\t\tviewPosition: viewPosition,\n\t\t\twholeLine: wholeLine\n\t\t});\n\t}\n\n\tprivate _lastCursorMoveToSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _wordSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _wordSelectDrag(viewPosition: Position): void {\n\t\tCoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorWordSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lineSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lineSelectDrag(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorLineSelect(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorLineSelectDrag(viewPosition: Position): void {\n\t\tCoreNavigationCommands.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _selectAll(): void {\n\t\tCoreNavigationCommands.SelectAll.runCoreEditorCommand(this.viewModel, { source: 'mouse' });\n\t}\n\n\t// ----------------------\n\n\tprivate _convertViewToModelPosition(viewPosition: Position): Position {\n\t\treturn this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(viewPosition);\n\t}\n\n\tpublic emitKeyDown(e: IKeyboardEvent): void {\n\t\tthis.userInputEvents.emitKeyDown(e);\n\t}\n\n\tpublic emitKeyUp(e: IKeyboardEvent): void {\n\t\tthis.userInputEvents.emitKeyUp(e);\n\t}\n\n\tpublic emitContextMenu(e: IEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitContextMenu(e);\n\t}\n\n\tpublic emitMouseMove(e: IEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseMove(e);\n\t}\n\n\tpublic emitMouseLeave(e: IPartialEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseLeave(e);\n\t}\n\n\tpublic emitMouseUp(e: IEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseUp(e);\n\t}\n\n\tpublic emitMouseDown(e: IEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseDown(e);\n\t}\n\n\tpublic emitMouseDrag(e: IEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseDrag(e);\n\t}\n\n\tpublic emitMouseDrop(e: IPartialEditorMouseEvent): void {\n\t\tthis.userInputEvents.emitMouseDrop(e);\n\t}\n\n\tpublic emitMouseDropCanceled(): void {\n\t\tthis.userInputEvents.emitMouseDropCanceled();\n\t}\n\n\tpublic emitMouseWheel(e: IMouseWheelEvent): void {\n\t\tthis.userInputEvents.emitMouseWheel(e);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler';\nimport { PointerHandler } from 'vs/editor/browser/controller/pointerHandler';\nimport { IVisibleRangeProvider, TextAreaHandler } from 'vs/editor/browser/controller/textAreaHandler';\nimport { IContentWidget, IContentWidgetPosition, IOverlayWidget, IOverlayWidgetPosition, IMouseTarget, IViewZoneChangeAccessor, IEditorAriaOptions } from 'vs/editor/browser/editorBrowser';\nimport { ICommandDelegate, ViewController } from 'vs/editor/browser/view/viewController';\nimport { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents';\nimport { ContentViewOverlays, MarginViewOverlays } from 'vs/editor/browser/view/viewOverlays';\nimport { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';\nimport { ViewContentWidgets } from 'vs/editor/browser/viewParts/contentWidgets/contentWidgets';\nimport { CurrentLineHighlightOverlay, CurrentLineMarginHighlightOverlay } from 'vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight';\nimport { DecorationsOverlay } from 'vs/editor/browser/viewParts/decorations/decorations';\nimport { EditorScrollbar } from 'vs/editor/browser/viewParts/editorScrollbar/editorScrollbar';\nimport { GlyphMarginOverlay } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin';\nimport { IndentGuidesOverlay } from 'vs/editor/browser/viewParts/indentGuides/indentGuides';\nimport { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers';\nimport { ViewLines } from 'vs/editor/browser/viewParts/lines/viewLines';\nimport { LinesDecorationsOverlay } from 'vs/editor/browser/viewParts/linesDecorations/linesDecorations';\nimport { Margin } from 'vs/editor/browser/viewParts/margin/margin';\nimport { MarginViewLineDecorationsOverlay } from 'vs/editor/browser/viewParts/marginDecorations/marginDecorations';\nimport { Minimap } from 'vs/editor/browser/viewParts/minimap/minimap';\nimport { ViewOverlayWidgets } from 'vs/editor/browser/viewParts/overlayWidgets/overlayWidgets';\nimport { DecorationsOverviewRuler } from 'vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler';\nimport { OverviewRuler } from 'vs/editor/browser/viewParts/overviewRuler/overviewRuler';\nimport { Rulers } from 'vs/editor/browser/viewParts/rulers/rulers';\nimport { ScrollDecorationViewPart } from 'vs/editor/browser/viewParts/scrollDecoration/scrollDecoration';\nimport { SelectionsOverlay } from 'vs/editor/browser/viewParts/selections/selections';\nimport { ViewCursors } from 'vs/editor/browser/viewParts/viewCursors/viewCursors';\nimport { ViewZones } from 'vs/editor/browser/viewParts/viewZones/viewZones';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { RenderingContext } from 'vs/editor/browser/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/viewModel/viewContext';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\nimport { IViewModel } from 'vs/editor/common/viewModel';\nimport { getThemeTypeSelector, IColorTheme } from 'vs/platform/theme/common/themeService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget';\n\n\nexport interface IContentWidgetData {\n\twidget: IContentWidget;\n\tposition: IContentWidgetPosition | null;\n}\n\nexport interface IOverlayWidgetData {\n\twidget: IOverlayWidget;\n\tposition: IOverlayWidgetPosition | null;\n}\n\nexport class View extends ViewEventHandler {\n\n\tprivate readonly _scrollbar: EditorScrollbar;\n\tprivate readonly _context: ViewContext;\n\tprivate _selections: Selection[];\n\n\t// The view lines\n\tprivate readonly _viewLines: ViewLines;\n\n\t// These are parts, but we must do some API related calls on them, so we keep a reference\n\tprivate readonly _viewZones: ViewZones;\n\tprivate readonly _contentWidgets: ViewContentWidgets;\n\tprivate readonly _overlayWidgets: ViewOverlayWidgets;\n\tprivate readonly _viewCursors: ViewCursors;\n\tprivate readonly _viewParts: ViewPart[];\n\n\tprivate readonly _textAreaHandler: TextAreaHandler;\n\tprivate readonly _pointerHandler: PointerHandler;\n\n\t// Dom nodes\n\tprivate readonly _linesContent: FastDomNode<HTMLElement>;\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _overflowGuardContainer: FastDomNode<HTMLElement>;\n\n\t// Actual mutable state\n\tprivate _renderAnimationFrame: IDisposable | null;\n\n\tconstructor(\n\t\tcommandDelegate: ICommandDelegate,\n\t\tconfiguration: IEditorConfiguration,\n\t\tcolorTheme: IColorTheme,\n\t\tmodel: IViewModel,\n\t\tuserInputEvents: ViewUserInputEvents,\n\t\toverflowWidgetsDomNode: HTMLElement | undefined\n\t) {\n\t\tsuper();\n\t\tthis._selections = [new Selection(1, 1, 1, 1)];\n\t\tthis._renderAnimationFrame = null;\n\n\t\tconst viewController = new ViewController(configuration, model, userInputEvents, commandDelegate);\n\n\t\t// The view context is passed on to most classes (basically to reduce param. counts in ctors)\n\t\tthis._context = new ViewContext(configuration, colorTheme, model);\n\n\t\t// Ensure the view is the first event handler in order to update the layout\n\t\tthis._context.addEventHandler(this);\n\n\t\tthis._viewParts = [];\n\n\t\t// Keyboard handler\n\t\tthis._textAreaHandler = new TextAreaHandler(this._context, viewController, this._createTextAreaHandlerHelper());\n\t\tthis._viewParts.push(this._textAreaHandler);\n\n\t\t// These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.)\n\t\tthis._linesContent = createFastDomNode(document.createElement('div'));\n\t\tthis._linesContent.setClassName('lines-content' + ' monaco-editor-background');\n\t\tthis._linesContent.setPosition('absolute');\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tthis.domNode.setClassName(this._getEditorClassName());\n\t\t// Set role 'code' for better screen reader support https://github.com/microsoft/vscode/issues/93438\n\t\tthis.domNode.setAttribute('role', 'code');\n\n\t\tthis._overflowGuardContainer = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this._overflowGuardContainer, PartFingerprint.OverflowGuard);\n\t\tthis._overflowGuardContainer.setClassName('overflow-guard');\n\n\t\tthis._scrollbar = new EditorScrollbar(this._context, this._linesContent, this.domNode, this._overflowGuardContainer);\n\t\tthis._viewParts.push(this._scrollbar);\n\n\t\t// View Lines\n\t\tthis._viewLines = new ViewLines(this._context, this._linesContent);\n\n\t\t// View Zones\n\t\tthis._viewZones = new ViewZones(this._context);\n\t\tthis._viewParts.push(this._viewZones);\n\n\t\t// Decorations overview ruler\n\t\tconst decorationsOverviewRuler = new DecorationsOverviewRuler(this._context);\n\t\tthis._viewParts.push(decorationsOverviewRuler);\n\n\n\t\tconst scrollDecoration = new ScrollDecorationViewPart(this._context);\n\t\tthis._viewParts.push(scrollDecoration);\n\n\t\tconst contentViewOverlays = new ContentViewOverlays(this._context);\n\t\tthis._viewParts.push(contentViewOverlays);\n\t\tcontentViewOverlays.addDynamicOverlay(new CurrentLineHighlightOverlay(this._context));\n\t\tcontentViewOverlays.addDynamicOverlay(new SelectionsOverlay(this._context));\n\t\tcontentViewOverlays.addDynamicOverlay(new IndentGuidesOverlay(this._context));\n\t\tcontentViewOverlays.addDynamicOverlay(new DecorationsOverlay(this._context));\n\n\t\tconst marginViewOverlays = new MarginViewOverlays(this._context);\n\t\tthis._viewParts.push(marginViewOverlays);\n\t\tmarginViewOverlays.addDynamicOverlay(new CurrentLineMarginHighlightOverlay(this._context));\n\t\tmarginViewOverlays.addDynamicOverlay(new GlyphMarginOverlay(this._context));\n\t\tmarginViewOverlays.addDynamicOverlay(new MarginViewLineDecorationsOverlay(this._context));\n\t\tmarginViewOverlays.addDynamicOverlay(new LinesDecorationsOverlay(this._context));\n\t\tmarginViewOverlays.addDynamicOverlay(new LineNumbersOverlay(this._context));\n\n\t\tconst margin = new Margin(this._context);\n\t\tmargin.getDomNode().appendChild(this._viewZones.marginDomNode);\n\t\tmargin.getDomNode().appendChild(marginViewOverlays.getDomNode());\n\t\tthis._viewParts.push(margin);\n\n\t\t// Content widgets\n\t\tthis._contentWidgets = new ViewContentWidgets(this._context, this.domNode);\n\t\tthis._viewParts.push(this._contentWidgets);\n\n\t\tthis._viewCursors = new ViewCursors(this._context);\n\t\tthis._viewParts.push(this._viewCursors);\n\n\t\t// Overlay widgets\n\t\tthis._overlayWidgets = new ViewOverlayWidgets(this._context);\n\t\tthis._viewParts.push(this._overlayWidgets);\n\n\t\tconst rulers = new Rulers(this._context);\n\t\tthis._viewParts.push(rulers);\n\n\t\tconst minimap = new Minimap(this._context);\n\t\tthis._viewParts.push(minimap);\n\n\t\t// -------------- Wire dom nodes up\n\n\t\tif (decorationsOverviewRuler) {\n\t\t\tconst overviewRulerData = this._scrollbar.getOverviewRulerLayoutInfo();\n\t\t\toverviewRulerData.parent.insertBefore(decorationsOverviewRuler.getDomNode(), overviewRulerData.insertBefore);\n\t\t}\n\n\t\tthis._linesContent.appendChild(contentViewOverlays.getDomNode());\n\t\tthis._linesContent.appendChild(rulers.domNode);\n\t\tthis._linesContent.appendChild(this._viewZones.domNode);\n\t\tthis._linesContent.appendChild(this._viewLines.getDomNode());\n\t\tthis._linesContent.appendChild(this._contentWidgets.domNode);\n\t\tthis._linesContent.appendChild(this._viewCursors.getDomNode());\n\t\tthis._overflowGuardContainer.appendChild(margin.getDomNode());\n\t\tthis._overflowGuardContainer.appendChild(this._scrollbar.getDomNode());\n\t\tthis._overflowGuardContainer.appendChild(scrollDecoration.getDomNode());\n\t\tthis._overflowGuardContainer.appendChild(this._textAreaHandler.textArea);\n\t\tthis._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover);\n\t\tthis._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode());\n\t\tthis._overflowGuardContainer.appendChild(minimap.getDomNode());\n\t\tthis.domNode.appendChild(this._overflowGuardContainer);\n\n\t\tif (overflowWidgetsDomNode) {\n\t\t\toverflowWidgetsDomNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode);\n\t\t}\n\n\t\tthis._applyLayout();\n\n\t\t// Pointer handler\n\t\tthis._pointerHandler = this._register(new PointerHandler(this._context, viewController, this._createPointerHandlerHelper()));\n\t}\n\n\tprivate _flushAccumulatedAndRenderNow(): void {\n\t\tthis._renderNow();\n\t}\n\n\tprivate _createPointerHandlerHelper(): IPointerHandlerHelper {\n\t\treturn {\n\t\t\tviewDomNode: this.domNode.domNode,\n\t\t\tlinesContentDomNode: this._linesContent.domNode,\n\n\t\t\tfocusTextArea: () => {\n\t\t\t\tthis.focus();\n\t\t\t},\n\n\t\t\tdispatchTextAreaEvent: (event: CustomEvent) => {\n\t\t\t\tthis._textAreaHandler.textArea.domNode.dispatchEvent(event);\n\t\t\t},\n\n\t\t\tgetLastRenderData: (): PointerHandlerLastRenderData => {\n\t\t\t\tconst lastViewCursorsRenderData = this._viewCursors.getLastRenderData() || [];\n\t\t\t\tconst lastTextareaPosition = this._textAreaHandler.getLastRenderData();\n\t\t\t\treturn new PointerHandlerLastRenderData(lastViewCursorsRenderData, lastTextareaPosition);\n\t\t\t},\n\t\t\tshouldSuppressMouseDownOnViewZone: (viewZoneId: string) => {\n\t\t\t\treturn this._viewZones.shouldSuppressMouseDownOnViewZone(viewZoneId);\n\t\t\t},\n\t\t\tshouldSuppressMouseDownOnWidget: (widgetId: string) => {\n\t\t\t\treturn this._contentWidgets.shouldSuppressMouseDownOnWidget(widgetId);\n\t\t\t},\n\t\t\tgetPositionFromDOMInfo: (spanNode: HTMLElement, offset: number) => {\n\t\t\t\tthis._flushAccumulatedAndRenderNow();\n\t\t\t\treturn this._viewLines.getPositionFromDOMInfo(spanNode, offset);\n\t\t\t},\n\n\t\t\tvisibleRangeForPosition: (lineNumber: number, column: number) => {\n\t\t\t\tthis._flushAccumulatedAndRenderNow();\n\t\t\t\treturn this._viewLines.visibleRangeForPosition(new Position(lineNumber, column));\n\t\t\t},\n\n\t\t\tgetLineWidth: (lineNumber: number) => {\n\t\t\t\tthis._flushAccumulatedAndRenderNow();\n\t\t\t\treturn this._viewLines.getLineWidth(lineNumber);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _createTextAreaHandlerHelper(): IVisibleRangeProvider {\n\t\treturn {\n\t\t\tvisibleRangeForPosition: (position: Position) => {\n\t\t\t\tthis._flushAccumulatedAndRenderNow();\n\t\t\t\treturn this._viewLines.visibleRangeForPosition(position);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _applyLayout(): void {\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tthis.domNode.setWidth(layoutInfo.width);\n\t\tthis.domNode.setHeight(layoutInfo.height);\n\n\t\tthis._overflowGuardContainer.setWidth(layoutInfo.width);\n\t\tthis._overflowGuardContainer.setHeight(layoutInfo.height);\n\n\t\tthis._linesContent.setWidth(1000000);\n\t\tthis._linesContent.setHeight(1000000);\n\t}\n\n\tprivate _getEditorClassName() {\n\t\tconst focused = this._textAreaHandler.isFocused() ? ' focused' : '';\n\t\treturn this._context.configuration.options.get(EditorOption.editorClassName) + ' ' + getThemeTypeSelector(this._context.theme.type) + focused;\n\t}\n\n\t// --- begin event handlers\n\tpublic override handleEvents(events: viewEvents.ViewEvent[]): void {\n\t\tsuper.handleEvents(events);\n\t\tthis._scheduleRender();\n\t}\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis.domNode.setClassName(this._getEditorClassName());\n\t\tthis._applyLayout();\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections;\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis.domNode.setClassName(this._getEditorClassName());\n\t\treturn false;\n\t}\n\tpublic override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\tthis._context.theme.update(e.theme);\n\t\tthis.domNode.setClassName(this._getEditorClassName());\n\t\treturn false;\n\t}\n\n\t// --- end event handlers\n\n\tpublic override dispose(): void {\n\t\tif (this._renderAnimationFrame !== null) {\n\t\t\tthis._renderAnimationFrame.dispose();\n\t\t\tthis._renderAnimationFrame = null;\n\t\t}\n\n\t\tthis._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove();\n\n\t\tthis._context.removeEventHandler(this);\n\n\t\tthis._viewLines.dispose();\n\n\t\t// Destroy view parts\n\t\tfor (const viewPart of this._viewParts) {\n\t\t\tviewPart.dispose();\n\t\t}\n\n\t\tsuper.dispose();\n\t}\n\n\tprivate _scheduleRender(): void {\n\t\tif (this._renderAnimationFrame === null) {\n\t\t\tthis._renderAnimationFrame = dom.runAtThisOrScheduleAtNextAnimationFrame(this._onRenderScheduled.bind(this), 100);\n\t\t}\n\t}\n\n\tprivate _onRenderScheduled(): void {\n\t\tthis._renderAnimationFrame = null;\n\t\tthis._flushAccumulatedAndRenderNow();\n\t}\n\n\tprivate _renderNow(): void {\n\t\tsafeInvokeNoArg(() => this._actualRender());\n\t}\n\n\tprivate _getViewPartsToRender(): ViewPart[] {\n\t\tconst result: ViewPart[] = [];\n\t\tlet resultLen = 0;\n\t\tfor (const viewPart of this._viewParts) {\n\t\t\tif (viewPart.shouldRender()) {\n\t\t\t\tresult[resultLen++] = viewPart;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _actualRender(): void {\n\t\tif (!dom.isInDOM(this.domNode.domNode)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet viewPartsToRender = this._getViewPartsToRender();\n\n\t\tif (!this._viewLines.shouldRender() && viewPartsToRender.length === 0) {\n\t\t\t// Nothing to render\n\t\t\treturn;\n\t\t}\n\n\t\tconst partialViewportData = this._context.viewLayout.getLinesViewportData();\n\t\tthis._context.viewModel.setViewport(partialViewportData.startLineNumber, partialViewportData.endLineNumber, partialViewportData.centeredLineNumber);\n\n\t\tconst viewportData = new ViewportData(\n\t\t\tthis._selections,\n\t\t\tpartialViewportData,\n\t\t\tthis._context.viewLayout.getWhitespaceViewportData(),\n\t\t\tthis._context.viewModel\n\t\t);\n\n\t\tif (this._contentWidgets.shouldRender()) {\n\t\t\t// Give the content widgets a chance to set their max width before a possible synchronous layout\n\t\t\tthis._contentWidgets.onBeforeRender(viewportData);\n\t\t}\n\n\t\tif (this._viewLines.shouldRender()) {\n\t\t\tthis._viewLines.renderText(viewportData);\n\t\t\tthis._viewLines.onDidRender();\n\n\t\t\t// Rendering of viewLines might cause scroll events to occur, so collect view parts to render again\n\t\t\tviewPartsToRender = this._getViewPartsToRender();\n\t\t}\n\n\t\tconst renderingContext = new RenderingContext(this._context.viewLayout, viewportData, this._viewLines);\n\n\t\t// Render the rest of the parts\n\t\tfor (const viewPart of viewPartsToRender) {\n\t\t\tviewPart.prepareRender(renderingContext);\n\t\t}\n\n\t\tfor (const viewPart of viewPartsToRender) {\n\t\t\tviewPart.render(renderingContext);\n\t\t\tviewPart.onDidRender();\n\t\t}\n\t}\n\n\t// --- BEGIN CodeEditor helpers\n\n\tpublic delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void {\n\t\tthis._scrollbar.delegateVerticalScrollbarMouseDown(browserEvent);\n\t}\n\n\tpublic restoreState(scrollPosition: { scrollLeft: number; scrollTop: number }): void {\n\t\tthis._context.viewModel.viewLayout.setScrollPosition({ scrollTop: scrollPosition.scrollTop }, ScrollType.Immediate);\n\t\tthis._context.viewModel.tokenizeViewport();\n\t\tthis._renderNow();\n\t\tthis._viewLines.updateLineWidths();\n\t\tthis._context.viewModel.viewLayout.setScrollPosition({ scrollLeft: scrollPosition.scrollLeft }, ScrollType.Immediate);\n\t}\n\n\tpublic getOffsetForColumn(modelLineNumber: number, modelColumn: number): number {\n\t\tconst modelPosition = this._context.viewModel.model.validatePosition({\n\t\t\tlineNumber: modelLineNumber,\n\t\t\tcolumn: modelColumn\n\t\t});\n\t\tconst viewPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition);\n\t\tthis._flushAccumulatedAndRenderNow();\n\t\tconst visibleRange = this._viewLines.visibleRangeForPosition(new Position(viewPosition.lineNumber, viewPosition.column));\n\t\tif (!visibleRange) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn visibleRange.left;\n\t}\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst mouseTarget = this._pointerHandler.getTargetAtClientPoint(clientX, clientY);\n\t\tif (!mouseTarget) {\n\t\t\treturn null;\n\t\t}\n\t\treturn ViewUserInputEvents.convertViewToModelMouseTarget(mouseTarget, this._context.viewModel.coordinatesConverter);\n\t}\n\n\tpublic createOverviewRuler(cssClassName: string): OverviewRuler {\n\t\treturn new OverviewRuler(this._context, cssClassName);\n\t}\n\n\tpublic change(callback: (changeAccessor: IViewZoneChangeAccessor) => any): void {\n\t\tthis._viewZones.changeViewZones(callback);\n\t\tthis._scheduleRender();\n\t}\n\n\tpublic render(now: boolean, everything: boolean): void {\n\t\tif (everything) {\n\t\t\t// Force everything to render...\n\t\t\tthis._viewLines.forceShouldRender();\n\t\t\tfor (const viewPart of this._viewParts) {\n\t\t\t\tviewPart.forceShouldRender();\n\t\t\t}\n\t\t}\n\t\tif (now) {\n\t\t\tthis._flushAccumulatedAndRenderNow();\n\t\t} else {\n\t\t\tthis._scheduleRender();\n\t\t}\n\t}\n\n\tpublic focus(): void {\n\t\tthis._textAreaHandler.focusTextArea();\n\t}\n\n\tpublic isFocused(): boolean {\n\t\treturn this._textAreaHandler.isFocused();\n\t}\n\n\tpublic setAriaOptions(options: IEditorAriaOptions): void {\n\t\tthis._textAreaHandler.setAriaOptions(options);\n\t}\n\n\tpublic addContentWidget(widgetData: IContentWidgetData): void {\n\t\tthis._contentWidgets.addWidget(widgetData.widget);\n\t\tthis.layoutContentWidget(widgetData);\n\t\tthis._scheduleRender();\n\t}\n\n\tpublic layoutContentWidget(widgetData: IContentWidgetData): void {\n\t\tlet newRange = widgetData.position ? widgetData.position.range || null : null;\n\t\tif (newRange === null) {\n\t\t\tconst newPosition = widgetData.position ? widgetData.position.position : null;\n\t\t\tif (newPosition !== null) {\n\t\t\t\tnewRange = new Range(newPosition.lineNumber, newPosition.column, newPosition.lineNumber, newPosition.column);\n\t\t\t}\n\t\t}\n\t\tconst newPreference = widgetData.position ? widgetData.position.preference : null;\n\t\tthis._contentWidgets.setWidgetPosition(widgetData.widget, newRange, newPreference);\n\t\tthis._scheduleRender();\n\t}\n\n\tpublic removeContentWidget(widgetData: IContentWidgetData): void {\n\t\tthis._contentWidgets.removeWidget(widgetData.widget);\n\t\tthis._scheduleRender();\n\t}\n\n\tpublic addOverlayWidget(widgetData: IOverlayWidgetData): void {\n\t\tthis._overlayWidgets.addWidget(widgetData.widget);\n\t\tthis.layoutOverlayWidget(widgetData);\n\t\tthis._scheduleRender();\n\t}\n\n\tpublic layoutOverlayWidget(widgetData: IOverlayWidgetData): void {\n\t\tconst newPreference = widgetData.position ? widgetData.position.preference : null;\n\t\tconst shouldRender = this._overlayWidgets.setWidgetPosition(widgetData.widget, newPreference);\n\t\tif (shouldRender) {\n\t\t\tthis._scheduleRender();\n\t\t}\n\t}\n\n\tpublic removeOverlayWidget(widgetData: IOverlayWidgetData): void {\n\t\tthis._overlayWidgets.removeWidget(widgetData.widget);\n\t\tthis._scheduleRender();\n\t}\n\n\t// --- END CodeEditor helpers\n\n}\n\nfunction safeInvokeNoArg(func: Function): any {\n\ttry {\n\t\treturn func();\n\t} catch (e) {\n\t\tonUnexpectedError(e);\n\t}\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./anchorSelect';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { localize } from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport const SelectionAnchorSet = new RawContextKey('selectionAnchorSet', false);\n\nclass SelectionAnchorController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.selectionAnchorController';\n\n\tstatic get(editor: ICodeEditor): SelectionAnchorController | null {\n\t\treturn editor.getContribution<SelectionAnchorController>(SelectionAnchorController.ID);\n\t}\n\n\tprivate decorationId: string | undefined;\n\tprivate selectionAnchorSetContextKey: IContextKey<boolean>;\n\tprivate modelChangeListener: IDisposable;\n\n\tconstructor(\n\t\tprivate editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tthis.selectionAnchorSetContextKey = SelectionAnchorSet.bindTo(contextKeyService);\n\t\tthis.modelChangeListener = editor.onDidChangeModel(() => this.selectionAnchorSetContextKey.reset());\n\t}\n\n\tsetSelectionAnchor(): void {\n\t\tif (this.editor.hasModel()) {\n\t\t\tconst position = this.editor.getPosition();\n\t\t\tconst previousDecorations = this.decorationId ? [this.decorationId] : [];\n\t\t\tconst newDecorationId = this.editor.deltaDecorations(previousDecorations, [{\n\t\t\t\trange: Selection.fromPositions(position, position),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'selection-anchor',\n\t\t\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\t\t\t\thoverMessage: new MarkdownString().appendText(localize('selectionAnchor', \"Selection Anchor\")),\n\t\t\t\t\tclassName: 'selection-anchor'\n\t\t\t\t}\n\t\t\t}]);\n\t\t\tthis.decorationId = newDecorationId[0];\n\t\t\tthis.selectionAnchorSetContextKey.set(!!this.decorationId);\n\t\t\talert(localize('anchorSet', \"Anchor set at {0}:{1}\", position.lineNumber, position.column));\n\t\t}\n\t}\n\n\tgoToSelectionAnchor(): void {\n\t\tif (this.editor.hasModel() && this.decorationId) {\n\t\t\tconst anchorPosition = this.editor.getModel().getDecorationRange(this.decorationId);\n\t\t\tif (anchorPosition) {\n\t\t\t\tthis.editor.setPosition(anchorPosition.getStartPosition());\n\t\t\t}\n\t\t}\n\t}\n\n\tselectFromAnchorToCursor(): void {\n\t\tif (this.editor.hasModel() && this.decorationId) {\n\t\t\tconst start = this.editor.getModel().getDecorationRange(this.decorationId);\n\t\t\tif (start) {\n\t\t\t\tconst end = this.editor.getPosition();\n\t\t\t\tthis.editor.setSelection(Selection.fromPositions(start.getStartPosition(), end));\n\t\t\t\tthis.cancelSelectionAnchor();\n\t\t\t}\n\t\t}\n\t}\n\n\tcancelSelectionAnchor(): void {\n\t\tif (this.decorationId) {\n\t\t\tthis.editor.deltaDecorations([this.decorationId], []);\n\t\t\tthis.decorationId = undefined;\n\t\t\tthis.selectionAnchorSetContextKey.set(false);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.cancelSelectionAnchor();\n\t\tthis.modelChangeListener.dispose();\n\t}\n}\n\nclass SetSelectionAnchor extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.setSelectionAnchor',\n\t\t\tlabel: localize('setSelectionAnchor', \"Set Selection Anchor\"),\n\t\t\talias: 'Set Selection Anchor',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyB),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tSelectionAnchorController.get(editor)?.setSelectionAnchor();\n\t}\n}\n\nclass GoToSelectionAnchor extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.goToSelectionAnchor',\n\t\t\tlabel: localize('goToSelectionAnchor', \"Go to Selection Anchor\"),\n\t\t\talias: 'Go to Selection Anchor',\n\t\t\tprecondition: SelectionAnchorSet,\n\t\t});\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tSelectionAnchorController.get(editor)?.goToSelectionAnchor();\n\t}\n}\n\nclass SelectFromAnchorToCursor extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.selectFromAnchorToCursor',\n\t\t\tlabel: localize('selectFromAnchorToCursor', \"Select from Anchor to Cursor\"),\n\t\t\talias: 'Select from Anchor to Cursor',\n\t\t\tprecondition: SelectionAnchorSet,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyK),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tSelectionAnchorController.get(editor)?.selectFromAnchorToCursor();\n\t}\n}\n\nclass CancelSelectionAnchor extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.cancelSelectionAnchor',\n\t\t\tlabel: localize('cancelSelectionAnchor', \"Cancel Selection Anchor\"),\n\t\t\talias: 'Cancel Selection Anchor',\n\t\t\tprecondition: SelectionAnchorSet,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyCode.Escape,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tSelectionAnchorController.get(editor)?.cancelSelectionAnchor();\n\t}\n}\n\nregisterEditorContribution(SelectionAnchorController.ID, SelectionAnchorController);\nregisterEditorAction(SetSelectionAnchor);\nregisterEditorAction(GoToSelectionAnchor);\nregisterEditorAction(SelectFromAnchorToCursor);\nregisterEditorAction(CancelSelectionAnchor);\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { MoveCaretCommand } from 'vs/editor/contrib/caretOperations/browser/moveCaretCommand';\nimport * as nls from 'vs/nls';\n\nclass MoveCaretAction extends EditorAction {\n\n\tprivate readonly left: boolean;\n\n\tconstructor(left: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\n\t\tthis.left = left;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tconst selections = editor.getSelections();\n\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new MoveCaretCommand(selection, this.left));\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nclass MoveCaretLeftAction extends MoveCaretAction {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.moveCarretLeftAction',\n\t\t\tlabel: nls.localize('caret.moveLeft', \"Move Selected Text Left\"),\n\t\t\talias: 'Move Selected Text Left',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nclass MoveCaretRightAction extends MoveCaretAction {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.moveCarretRightAction',\n\t\t\tlabel: nls.localize('caret.moveRight', \"Move Selected Text Right\"),\n\t\t\talias: 'Move Selected Text Right',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nregisterEditorAction(MoveCaretLeftAction);\nregisterEditorAction(MoveCaretRightAction);\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';\nimport { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport * as nls from 'vs/nls';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nclass TransposeLettersAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transposeLetters',\n\t\t\tlabel: nls.localize('transposeLetters.label', \"Transpose Letters\"),\n\t\t\talias: 'Transpose Letters',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.WinCtrl | KeyCode.KeyT\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet model = editor.getModel();\n\t\tlet commands: ICommand[] = [];\n\t\tlet selections = editor.getSelections();\n\n\t\tfor (let selection of selections) {\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet lineNumber = selection.startLineNumber;\n\t\t\tlet column = selection.startColumn;\n\n\t\t\tlet lastColumn = model.getLineMaxColumn(lineNumber);\n\n\t\t\tif (lineNumber === 1 && (column === 1 || (column === 2 && lastColumn === 2))) {\n\t\t\t\t// at beginning of file, nothing to do\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// handle special case: when at end of line, transpose left two chars\n\t\t\t// otherwise, transpose left and right chars\n\t\t\tlet endPosition = (column === lastColumn) ?\n\t\t\t\tselection.getPosition() :\n\t\t\t\tMoveOperations.rightPosition(model, selection.getPosition().lineNumber, selection.getPosition().column);\n\n\t\t\tlet middlePosition = MoveOperations.leftPosition(model, endPosition);\n\t\t\tlet beginPosition = MoveOperations.leftPosition(model, middlePosition);\n\n\t\t\tlet leftChar = model.getValueInRange(Range.fromPositions(beginPosition, middlePosition));\n\t\t\tlet rightChar = model.getValueInRange(Range.fromPositions(middlePosition, endPosition));\n\n\t\t\tlet replaceRange = Range.fromPositions(beginPosition, endPosition);\n\t\t\tcommands.push(new ReplaceCommand(replaceRange, rightChar + leftChar));\n\t\t}\n\n\t\tif (commands.length > 0) {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, commands);\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t}\n}\n\nregisterEditorAction(TransposeLettersAction);\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 * as browser from 'vs/base/browser/browser';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport * as platform from 'vs/base/common/platform';\nimport { CopyOptions, InMemoryClipboardMetadataManager } from 'vs/editor/browser/controller/textAreaInput';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Command, EditorAction, MultiCommand, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Handler } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport * as nls from 'vs/nls';\nimport { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\n\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCutAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind cut keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyX,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}]\n})) : undefined;\n\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCopyAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind copy keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyC,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}]\n})) : undefined;\n\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: { value: nls.localize('copy as', \"Copy As\"), original: 'Copy As', }, group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: { value: nls.localize('copy as', \"Copy As\"), original: 'Copy As', }, group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\n\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardPasteAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind paste keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyV,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\torder: 4\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}]\n})) : undefined;\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n\t\t\tlabel: nls.localize('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy With Syntax Highlighting\"),\n\t\t\talias: 'Copy With Syntax Highlighting',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\teditor.focus();\n\t\tdocument.execCommand('copy');\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nfunction registerExecCommandImpl(target: MultiCommand | undefined, browserCommand: 'cut' | 'copy'): void {\n\tif (!target) {\n\t\treturn;\n\t}\n\n\t// 1. handle case when focus is in editor.\n\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: any) => {\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\t// Do not execute if there is no selection and empty selection clipboard is off\n\t\t\tconst emptySelectionClipboard = focusedEditor.getOption(EditorOption.emptySelectionClipboard);\n\t\t\tconst selection = focusedEditor.getSelection();\n\t\t\tif (selection && selection.isEmpty() && !emptySelectionClipboard) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tdocument.execCommand(browserCommand);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. (default) handle case when focus is somewhere else.\n\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: any) => {\n\t\tdocument.execCommand(browserCommand);\n\t\treturn true;\n\t});\n}\n\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\n\nif (PasteAction) {\n\t// 1. Paste: handle case when focus is in editor.\n\tPasteAction.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: any) => {\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = codeEditorService.getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\tconst result = document.execCommand('paste');\n\t\t\t// Use the clipboard service if document.execCommand('paste') was not successful\n\t\t\tif (!result && platform.isWeb) {\n\t\t\t\treturn (async () => {\n\t\t\t\t\tconst clipboardText = await clipboardService.readText();\n\t\t\t\t\tif (clipboardText !== '') {\n\t\t\t\t\t\tconst metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n\t\t\t\t\t\tlet pasteOnNewLine = false;\n\t\t\t\t\t\tlet multicursorText: string[] | null = null;\n\t\t\t\t\t\tlet mode: string | null = null;\n\t\t\t\t\t\tif (metadata) {\n\t\t\t\t\t\t\tpasteOnNewLine = (focusedEditor.getOption(EditorOption.emptySelectionClipboard) && !!metadata.isFromEmptySelection);\n\t\t\t\t\t\t\tmulticursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n\t\t\t\t\t\t\tmode = metadata.mode;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfocusedEditor.trigger('keyboard', Handler.Paste, {\n\t\t\t\t\t\t\ttext: clipboardText,\n\t\t\t\t\t\t\tpasteOnNewLine,\n\t\t\t\t\t\t\tmulticursorText,\n\t\t\t\t\t\t\tmode\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. Paste: (default) handle case when focus is somewhere else.\n\tPasteAction.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: any) => {\n\t\tdocument.execCommand('paste');\n\t\treturn true;\n\t});\n}\n\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\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 { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { BlockCommentCommand } from 'vs/editor/contrib/comment/browser/blockCommentCommand';\nimport { LineCommentCommand, Type } from 'vs/editor/contrib/comment/browser/lineCommentCommand';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nabstract class CommentLineAction extends EditorAction {\n\n\tprivate readonly _type: Type;\n\n\tconstructor(type: Type, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._type = type;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = editor.getModel();\n\t\tconst commands: ICommand[] = [];\n\t\tconst modelOptions = model.getOptions();\n\t\tconst commentsOptions = editor.getOption(EditorOption.comments);\n\n\t\tconst selections = editor.getSelections().map((selection, index) => ({ selection, index, ignoreFirstLine: false }));\n\t\tselections.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection));\n\n\t\t// Remove selections that would result in copying the same line\n\t\tlet prev = selections[0];\n\t\tfor (let i = 1; i < selections.length; i++) {\n\t\t\tconst curr = selections[i];\n\t\t\tif (prev.selection.endLineNumber === curr.selection.startLineNumber) {\n\t\t\t\t// these two selections would copy the same line\n\t\t\t\tif (prev.index < curr.index) {\n\t\t\t\t\t// prev wins\n\t\t\t\t\tcurr.ignoreFirstLine = true;\n\t\t\t\t} else {\n\t\t\t\t\t// curr wins\n\t\t\t\t\tprev.ignoreFirstLine = true;\n\t\t\t\t\tprev = curr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new LineCommentCommand(\n\t\t\t\tlanguageConfigurationService,\n\t\t\t\tselection.selection,\n\t\t\t\tmodelOptions.tabSize,\n\t\t\t\tthis._type,\n\t\t\t\tcommentsOptions.insertSpace,\n\t\t\t\tcommentsOptions.ignoreEmptyLines,\n\t\t\t\tselection.ignoreFirstLine\n\t\t\t));\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n\n}\n\nclass ToggleCommentLineAction extends CommentLineAction {\n\tconstructor() {\n\t\tsuper(Type.Toggle, {\n\t\t\tid: 'editor.action.commentLine',\n\t\t\tlabel: nls.localize('comment.line', \"Toggle Line Comment\"),\n\t\t\talias: 'Toggle Line Comment',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Slash,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '5_insert',\n\t\t\t\ttitle: nls.localize({ key: 'miToggleLineComment', comment: ['&& denotes a mnemonic'] }, \"&&Toggle Line Comment\"),\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass AddLineCommentAction extends CommentLineAction {\n\tconstructor() {\n\t\tsuper(Type.ForceAdd, {\n\t\t\tid: 'editor.action.addCommentLine',\n\t\t\tlabel: nls.localize('comment.line.add', \"Add Line Comment\"),\n\t\t\talias: 'Add Line Comment',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyC),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass RemoveLineCommentAction extends CommentLineAction {\n\tconstructor() {\n\t\tsuper(Type.ForceRemove, {\n\t\t\tid: 'editor.action.removeCommentLine',\n\t\t\tlabel: nls.localize('comment.line.remove', \"Remove Line Comment\"),\n\t\t\talias: 'Remove Line Comment',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyU),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass BlockCommentAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.blockComment',\n\t\t\tlabel: nls.localize('comment.block', \"Toggle Block Comment\"),\n\t\t\talias: 'Toggle Block Comment',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyA,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyA },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '5_insert',\n\t\t\t\ttitle: nls.localize({ key: 'miToggleBlockComment', comment: ['&& denotes a mnemonic'] }, \"Toggle &&Block Comment\"),\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst commentsOptions = editor.getOption(EditorOption.comments);\n\t\tconst commands: ICommand[] = [];\n\t\tconst selections = editor.getSelections();\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new BlockCommentCommand(selection, commentsOptions.insertSpace, languageConfigurationService));\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nregisterEditorAction(ToggleCommentLineAction);\nregisterEditorAction(AddLineCommentAction);\nregisterEditorAction(RemoveLineCommentAction);\nregisterEditorAction(BlockCommentAction);\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { IAnchor } from 'vs/base/browser/ui/contextview/contextview';\nimport { IAction, Separator, SubmenuAction } from 'vs/base/common/actions';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { isIOS } from 'vs/base/common/platform';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as nls from 'vs/nls';\nimport { IMenuService, MenuId, SubmenuItemAction } from 'vs/platform/actions/common/actions';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class ContextMenuController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.contextmenu';\n\n\tpublic static get(editor: ICodeEditor): ContextMenuController | null {\n\t\treturn editor.getContribution<ContextMenuController>(ContextMenuController.ID);\n\t}\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate _contextMenuIsBeingShownCount: number = 0;\n\tprivate readonly _editor: ICodeEditor;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IMenuService private readonly _menuService: IMenuService\n\t) {\n\t\tthis._editor = editor;\n\n\t\tthis._toDispose.add(this._editor.onContextMenu((e: IEditorMouseEvent) => this._onContextMenu(e)));\n\t\tthis._toDispose.add(this._editor.onMouseWheel((e: IMouseWheelEvent) => {\n\t\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\t\tconst view = this._contextViewService.getContextViewElement();\n\t\t\t\tconst target = e.srcElement as HTMLElement;\n\n\t\t\t\t// Event triggers on shadow root host first\n\t\t\t\t// Check if the context view is under this host before hiding it #103169\n\t\t\t\tif (!(target.shadowRoot && dom.getShadowRoot(view) === target.shadowRoot)) {\n\t\t\t\t\tthis._contextViewService.hideContextView();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tif (e.keyCode === KeyCode.ContextMenu) {\n\t\t\t\t// Chrome is funny like that\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tthis.showContextMenu();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onContextMenu(e: IEditorMouseEvent): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\tthis._editor.focus();\n\t\t\t// Ensure the cursor is at the position of the mouse click\n\t\t\tif (e.target.position && !this._editor.getSelection().containsPosition(e.target.position)) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\n\t\tif (e.target.type === MouseTargetType.OVERLAY_WIDGET) {\n\t\t\treturn; // allow native menu on widgets to support right click on input field for example in find\n\t\t}\n\t\tif (e.target.type === MouseTargetType.CONTENT_TEXT && e.target.detail.injectedText) {\n\t\t\treturn; // allow native menu on injected text\n\t\t}\n\n\t\te.event.preventDefault();\n\t\te.event.stopPropagation();\n\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT && e.target.type !== MouseTargetType.CONTENT_EMPTY && e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\treturn; // only support mouse click into text or native context menu key for now\n\t\t}\n\n\t\t// Ensure the editor gets focus if it hasn't, so the right events are being sent to other contributions\n\t\tthis._editor.focus();\n\n\t\t// Ensure the cursor is at the position of the mouse click\n\t\tif (e.target.position) {\n\t\t\tlet hasSelectionAtPosition = false;\n\t\t\tfor (const selection of this._editor.getSelections()) {\n\t\t\t\tif (selection.containsPosition(e.target.position)) {\n\t\t\t\t\thasSelectionAtPosition = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasSelectionAtPosition) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t}\n\n\t\t// Unless the user triggerd the context menu through Shift+F10, use the mouse position as menu position\n\t\tlet anchor: IAnchor | null = null;\n\t\tif (e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\tanchor = { x: e.event.posx - 1, width: 2, y: e.event.posy - 1, height: 2 };\n\t\t}\n\n\t\t// Show the context menu\n\t\tthis.showContextMenu(anchor);\n\t}\n\n\tpublic showContextMenu(anchor?: IAnchor | null): void {\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._contextMenuService) {\n\t\t\tthis._editor.focus();\n\t\t\treturn;\t// We need the context menu service to function\n\t\t}\n\n\t\t// Find actions available for menu\n\t\tconst menuActions = this._getMenuActions(this._editor.getModel(),\n\t\t\tthis._editor.isSimpleWidget ? MenuId.SimpleEditorContext : MenuId.EditorContext);\n\n\t\t// Show menu if we have actions to show\n\t\tif (menuActions.length > 0) {\n\t\t\tthis._doShowContextMenu(menuActions, anchor);\n\t\t}\n\t}\n\n\tprivate _getMenuActions(model: ITextModel, menuId: MenuId): IAction[] {\n\t\tconst result: IAction[] = [];\n\n\t\t// get menu groups\n\t\tconst menu = this._menuService.createMenu(menuId, this._contextKeyService);\n\t\tconst groups = menu.getActions({ arg: model.uri });\n\t\tmenu.dispose();\n\n\t\t// translate them into other actions\n\t\tfor (let group of groups) {\n\t\t\tconst [, actions] = group;\n\t\t\tlet addedItems = 0;\n\t\t\tfor (const action of actions) {\n\t\t\t\tif (action instanceof SubmenuItemAction) {\n\t\t\t\t\tconst subActions = this._getMenuActions(model, action.item.submenu);\n\t\t\t\t\tif (subActions.length > 0) {\n\t\t\t\t\t\tresult.push(new SubmenuAction(action.id, action.label, subActions));\n\t\t\t\t\t\taddedItems++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(action);\n\t\t\t\t\taddedItems++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (addedItems) {\n\t\t\t\tresult.push(new Separator());\n\t\t\t}\n\t\t}\n\n\t\tif (result.length) {\n\t\t\tresult.pop(); // remove last separator\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _doShowContextMenu(actions: IAction[], anchor: IAnchor | null = null): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disable hover\n\t\tconst oldHoverSetting = this._editor.getOption(EditorOption.hover);\n\t\tthis._editor.updateOptions({\n\t\t\thover: {\n\t\t\t\tenabled: false\n\t\t\t}\n\t\t});\n\n\t\tif (!anchor) {\n\t\t\t// Ensure selection is visible\n\t\t\tthis._editor.revealPosition(this._editor.getPosition(), ScrollType.Immediate);\n\n\t\t\tthis._editor.render();\n\t\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(this._editor.getPosition());\n\n\t\t\t// Translate to absolute editor position\n\t\t\tconst editorCoords = dom.getDomNodePagePosition(this._editor.getDomNode());\n\t\t\tconst posx = editorCoords.left + cursorCoords.left;\n\t\t\tconst posy = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\t\tanchor = { x: posx, y: posy };\n\t\t}\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\n\t\t// Show menu\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getDomNode() : undefined,\n\n\t\t\tgetAnchor: () => anchor!,\n\n\t\t\tgetActions: () => actions,\n\n\t\t\tgetActionViewItem: (action) => {\n\t\t\t\tconst keybinding = this._keybindingFor(action);\n\t\t\t\tif (keybinding) {\n\t\t\t\t\treturn new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });\n\t\t\t\t}\n\n\t\t\t\tconst customActionViewItem = <any>action;\n\t\t\t\tif (typeof customActionViewItem.getActionViewItem === 'function') {\n\t\t\t\t\treturn customActionViewItem.getActionViewItem();\n\t\t\t\t}\n\n\t\t\t\treturn new ActionViewItem(action, action, { icon: true, label: true, isMenu: true });\n\t\t\t},\n\n\t\t\tgetKeyBinding: (action): ResolvedKeybinding | undefined => {\n\t\t\t\treturn this._keybindingFor(action);\n\t\t\t},\n\n\t\t\tonHide: (wasCancelled: boolean) => {\n\t\t\t\tthis._contextMenuIsBeingShownCount--;\n\t\t\t\tthis._editor.focus();\n\t\t\t\tthis._editor.updateOptions({\n\t\t\t\t\thover: oldHoverSetting\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _keybindingFor(action: IAction): ResolvedKeybinding | undefined {\n\t\treturn this._keybindingService.lookupKeybinding(action.id);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\tthis._contextViewService.hideContextView();\n\t\t}\n\n\t\tthis._toDispose.dispose();\n\t}\n}\n\nclass ShowContextMenu extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showContextMenu',\n\t\t\tlabel: nls.localize('action.showContextMenu.label', \"Show Editor Context Menu\"),\n\t\t\talias: 'Show Editor Context Menu',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F10,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tContextMenuController.get(editor)?.showContextMenu();\n\t}\n}\n\nregisterEditorContribution(ContextMenuController.ID, ContextMenuController);\nregisterEditorAction(ShowContextMenu);\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport * as nls from 'vs/nls';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nclass CursorState {\n\treadonly selections: readonly Selection[];\n\n\tconstructor(selections: readonly Selection[]) {\n\t\tthis.selections = selections;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\tconst thisLen = this.selections.length;\n\t\tconst otherLen = other.selections.length;\n\t\tif (thisLen !== otherLen) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < thisLen; i++) {\n\t\t\tif (!this.selections[i].equalsSelection(other.selections[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nclass StackElement {\n\tconstructor(\n\t\tpublic readonly cursorState: CursorState,\n\t\tpublic readonly scrollTop: number,\n\t\tpublic readonly scrollLeft: number\n\t) { }\n}\n\nexport class CursorUndoRedoController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.cursorUndoRedoController';\n\n\tpublic static get(editor: ICodeEditor): CursorUndoRedoController | null {\n\t\treturn editor.getContribution<CursorUndoRedoController>(CursorUndoRedoController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _isCursorUndoRedo: boolean;\n\n\tprivate _undoStack: StackElement[];\n\tprivate _redoStack: StackElement[];\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._isCursorUndoRedo = false;\n\n\t\tthis._undoStack = [];\n\t\tthis._redoStack = [];\n\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis._undoStack = [];\n\t\t\tthis._redoStack = [];\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tthis._undoStack = [];\n\t\t\tthis._redoStack = [];\n\t\t}));\n\t\tthis._register(editor.onDidChangeCursorSelection((e) => {\n\t\t\tif (this._isCursorUndoRedo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!e.oldSelections) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.oldModelVersionId !== e.modelVersionId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst prevState = new CursorState(e.oldSelections);\n\t\t\tconst isEqualToLastUndoStack = (this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(prevState));\n\t\t\tif (!isEqualToLastUndoStack) {\n\t\t\t\tthis._undoStack.push(new StackElement(prevState, editor.getScrollTop(), editor.getScrollLeft()));\n\t\t\t\tthis._redoStack = [];\n\t\t\t\tif (this._undoStack.length > 50) {\n\t\t\t\t\t// keep the cursor undo stack bounded\n\t\t\t\t\tthis._undoStack.shift();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic cursorUndo(): void {\n\t\tif (!this._editor.hasModel() || this._undoStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._redoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft()));\n\t\tthis._applyState(this._undoStack.pop()!);\n\t}\n\n\tpublic cursorRedo(): void {\n\t\tif (!this._editor.hasModel() || this._redoStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._undoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft()));\n\t\tthis._applyState(this._redoStack.pop()!);\n\t}\n\n\tprivate _applyState(stackElement: StackElement): void {\n\t\tthis._isCursorUndoRedo = true;\n\t\tthis._editor.setSelections(stackElement.cursorState.selections);\n\t\tthis._editor.setScrollPosition({\n\t\t\tscrollTop: stackElement.scrollTop,\n\t\t\tscrollLeft: stackElement.scrollLeft\n\t\t});\n\t\tthis._isCursorUndoRedo = false;\n\t}\n}\n\nexport class CursorUndo extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'cursorUndo',\n\t\t\tlabel: nls.localize('cursor.undo', \"Cursor Undo\"),\n\t\t\talias: 'Cursor Undo',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyU,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tCursorUndoRedoController.get(editor)?.cursorUndo();\n\t}\n}\n\nexport class CursorRedo extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'cursorRedo',\n\t\t\tlabel: nls.localize('cursor.redo', \"Cursor Redo\"),\n\t\t\talias: 'Cursor Redo',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tCursorUndoRedoController.get(editor)?.cursorRedo();\n\t}\n}\n\nregisterEditorContribution(CursorUndoRedoController.ID, CursorUndoRedoController);\nregisterEditorAction(CursorUndo);\nregisterEditorAction(CursorRedo);\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 { KeyCode } from 'vs/base/common/keyCodes';\nimport { EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { localize } from 'vs/nls';\n\n\nconst IEditorCancellationTokens = createDecorator<IEditorCancellationTokens>('IEditorCancelService');\n\ninterface IEditorCancellationTokens {\n\treadonly _serviceBrand: undefined;\n\tadd(editor: ICodeEditor, cts: CancellationTokenSource): () => void;\n\tcancel(editor: ICodeEditor): void;\n}\n\nconst ctxCancellableOperation = new RawContextKey('cancellableOperation', false, localize('cancellableOperation', 'Whether the editor runs a cancellable operation, e.g. like \\'Peek References\\''));\n\nregisterSingleton(IEditorCancellationTokens, class implements IEditorCancellationTokens {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _tokens = new WeakMap<ICodeEditor, { key: IContextKey<boolean>; tokens: LinkedList<CancellationTokenSource> }>();\n\n\tadd(editor: ICodeEditor, cts: CancellationTokenSource): () => void {\n\t\tlet data = this._tokens.get(editor);\n\t\tif (!data) {\n\t\t\tdata = editor.invokeWithinContext(accessor => {\n\t\t\t\tconst key = ctxCancellableOperation.bindTo(accessor.get(IContextKeyService));\n\t\t\t\tconst tokens = new LinkedList<CancellationTokenSource>();\n\t\t\t\treturn { key, tokens };\n\t\t\t});\n\t\t\tthis._tokens.set(editor, data);\n\t\t}\n\n\t\tlet removeFn: Function | undefined;\n\n\t\tdata.key.set(true);\n\t\tremoveFn = data.tokens.push(cts);\n\n\t\treturn () => {\n\t\t\t// remove w/o cancellation\n\t\t\tif (removeFn) {\n\t\t\t\tremoveFn();\n\t\t\t\tdata!.key.set(!data!.tokens.isEmpty());\n\t\t\t\tremoveFn = undefined;\n\t\t\t}\n\t\t};\n\t}\n\n\tcancel(editor: ICodeEditor): void {\n\t\tconst data = this._tokens.get(editor);\n\t\tif (!data) {\n\t\t\treturn;\n\t\t}\n\t\t// remove with cancellation\n\t\tconst cts = data.tokens.pop();\n\t\tif (cts) {\n\t\t\tcts.cancel();\n\t\t\tdata.key.set(!data.tokens.isEmpty());\n\t\t}\n\t}\n\n}, true);\n\nexport class EditorKeybindingCancellationTokenSource extends CancellationTokenSource {\n\n\tprivate readonly _unregister: Function;\n\n\tconstructor(readonly editor: ICodeEditor, parent?: CancellationToken) {\n\t\tsuper(parent);\n\t\tthis._unregister = editor.invokeWithinContext(accessor => accessor.get(IEditorCancellationTokens).add(editor, this));\n\t}\n\n\toverride dispose(): void {\n\t\tthis._unregister();\n\t\tsuper.dispose();\n\t}\n}\n\nregisterEditorCommand(new class extends EditorCommand {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.cancelOperation',\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib,\n\t\t\t\tprimary: KeyCode.Escape\n\t\t\t},\n\t\t\tprecondition: ctxCancellableOperation\n\t\t});\n\t}\n\n\trunEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\taccessor.get(IEditorCancellationTokens).cancel(editor);\n\t}\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 * as strings from 'vs/base/common/strings';\nimport { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range, IRange } from 'vs/editor/common/core/range';\nimport { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';\nimport { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { EditorKeybindingCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/keybindingCancellation';\n\nexport const enum CodeEditorStateFlag {\n\tValue = 1,\n\tSelection = 2,\n\tPosition = 4,\n\tScroll = 8\n}\n\nexport class EditorState {\n\n\tprivate readonly flags: number;\n\n\tprivate readonly position: Position | null;\n\tprivate readonly selection: Range | null;\n\tprivate readonly modelVersionId: string | null;\n\tprivate readonly scrollLeft: number;\n\tprivate readonly scrollTop: number;\n\n\tconstructor(editor: ICodeEditor, flags: number) {\n\t\tthis.flags = flags;\n\n\t\tif ((this.flags & CodeEditorStateFlag.Value) !== 0) {\n\t\t\tconst model = editor.getModel();\n\t\t\tthis.modelVersionId = model ? strings.format('{0}#{1}', model.uri.toString(), model.getVersionId()) : null;\n\t\t} else {\n\t\t\tthis.modelVersionId = null;\n\t\t}\n\t\tif ((this.flags & CodeEditorStateFlag.Position) !== 0) {\n\t\t\tthis.position = editor.getPosition();\n\t\t} else {\n\t\t\tthis.position = null;\n\t\t}\n\t\tif ((this.flags & CodeEditorStateFlag.Selection) !== 0) {\n\t\t\tthis.selection = editor.getSelection();\n\t\t} else {\n\t\t\tthis.selection = null;\n\t\t}\n\t\tif ((this.flags & CodeEditorStateFlag.Scroll) !== 0) {\n\t\t\tthis.scrollLeft = editor.getScrollLeft();\n\t\t\tthis.scrollTop = editor.getScrollTop();\n\t\t} else {\n\t\t\tthis.scrollLeft = -1;\n\t\t\tthis.scrollTop = -1;\n\t\t}\n\t}\n\n\tprivate _equals(other: any): boolean {\n\n\t\tif (!(other instanceof EditorState)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst state = <EditorState>other;\n\n\t\tif (this.modelVersionId !== state.modelVersionId) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.scrollLeft !== state.scrollLeft || this.scrollTop !== state.scrollTop) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this.position && state.position || this.position && !state.position || this.position && state.position && !this.position.equals(state.position)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this.selection && state.selection || this.selection && !state.selection || this.selection && state.selection && !this.selection.equalsRange(state.selection)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic validate(editor: ICodeEditor): boolean {\n\t\treturn this._equals(new EditorState(editor, this.flags));\n\t}\n}\n\n/**\n * A cancellation token source that cancels when the editor changes as expressed\n * by the provided flags\n * @param range If provided, changes in position and selection within this range will not trigger cancellation\n */\nexport class EditorStateCancellationTokenSource extends EditorKeybindingCancellationTokenSource implements IDisposable {\n\n\tprivate readonly _listener = new DisposableStore();\n\n\tconstructor(editor: IActiveCodeEditor, flags: CodeEditorStateFlag, range?: IRange, parent?: CancellationToken) {\n\t\tsuper(editor, parent);\n\n\t\tif (flags & CodeEditorStateFlag.Position) {\n\t\t\tthis._listener.add(editor.onDidChangeCursorPosition(e => {\n\t\t\t\tif (!range || !Range.containsPosition(range, e.position)) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Selection) {\n\t\t\tthis._listener.add(editor.onDidChangeCursorSelection(e => {\n\t\t\t\tif (!range || !Range.containsRange(range, e.selection)) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Scroll) {\n\t\t\tthis._listener.add(editor.onDidScrollChange(_ => this.cancel()));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Value) {\n\t\t\tthis._listener.add(editor.onDidChangeModel(_ => this.cancel()));\n\t\t\tthis._listener.add(editor.onDidChangeModelContent(_ => this.cancel()));\n\t\t}\n\t}\n\n\toverride dispose() {\n\t\tthis._listener.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\n/**\n * A cancellation token source that cancels when the provided model changes\n */\nexport class TextModelCancellationTokenSource extends CancellationTokenSource implements IDisposable {\n\n\tprivate _listener: IDisposable;\n\n\tconstructor(model: ITextModel, parent?: CancellationToken) {\n\t\tsuper(parent);\n\t\tthis._listener = model.onDidChangeContent(() => this.cancel());\n\t}\n\n\toverride dispose() {\n\t\tthis._listener.dispose();\n\t\tsuper.dispose();\n\t}\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 { coalesce, equals, flatten, isNonEmptyArray } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { illegalArgument, isCancellationError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { TextModelCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { IProgress, Progress } from 'vs/platform/progress/common/progress';\nimport { CodeActionFilter, CodeActionKind, CodeActionTrigger, filtersAction, mayIncludeActionsOfKind } from './types';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport const codeActionCommandId = 'editor.action.codeAction';\nexport const refactorCommandId = 'editor.action.refactor';\nexport const sourceActionCommandId = 'editor.action.sourceAction';\nexport const organizeImportsCommandId = 'editor.action.organizeImports';\nexport const fixAllCommandId = 'editor.action.fixAll';\n\nexport class CodeActionItem {\n\n\tconstructor(\n\t\treadonly action: languages.CodeAction,\n\t\treadonly provider: languages.CodeActionProvider | undefined,\n\t) { }\n\n\tasync resolve(token: CancellationToken): Promise<this> {\n\t\tif (this.provider?.resolveCodeAction && !this.action.edit) {\n\t\t\tlet action: languages.CodeAction | undefined | null;\n\t\t\ttry {\n\t\t\t\taction = await this.provider.resolveCodeAction(this.action, token);\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedExternalError(err);\n\t\t\t}\n\t\t\tif (action) {\n\t\t\t\tthis.action.edit = action.edit;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport interface CodeActionSet extends IDisposable {\n\treadonly validActions: readonly CodeActionItem[];\n\treadonly allActions: readonly CodeActionItem[];\n\treadonly hasAutoFix: boolean;\n\n\treadonly documentation: readonly languages.Command[];\n}\n\nclass ManagedCodeActionSet extends Disposable implements CodeActionSet {\n\n\tprivate static codeActionsComparator({ action: a }: CodeActionItem, { action: b }: CodeActionItem): number {\n\t\tif (a.isPreferred && !b.isPreferred) {\n\t\t\treturn -1;\n\t\t} else if (!a.isPreferred && b.isPreferred) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (isNonEmptyArray(a.diagnostics)) {\n\t\t\tif (isNonEmptyArray(b.diagnostics)) {\n\t\t\t\treturn a.diagnostics[0].message.localeCompare(b.diagnostics[0].message);\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (isNonEmptyArray(b.diagnostics)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\t// both have no diagnostics\n\t\t}\n\t}\n\n\tpublic readonly validActions: readonly CodeActionItem[];\n\tpublic readonly allActions: readonly CodeActionItem[];\n\n\tpublic constructor(\n\t\tactions: readonly CodeActionItem[],\n\t\tpublic readonly documentation: readonly languages.Command[],\n\t\tdisposables: DisposableStore,\n\t) {\n\t\tsuper();\n\t\tthis._register(disposables);\n\t\tthis.allActions = [...actions].sort(ManagedCodeActionSet.codeActionsComparator);\n\t\tthis.validActions = this.allActions.filter(({ action }) => !action.disabled);\n\t}\n\n\tpublic get hasAutoFix() {\n\t\treturn this.validActions.some(({ action: fix }) => !!fix.kind && CodeActionKind.QuickFix.contains(new CodeActionKind(fix.kind)) && !!fix.isPreferred);\n\t}\n}\n\n\nconst emptyCodeActionsResponse = { actions: [] as CodeActionItem[], documentation: undefined };\n\nexport function getCodeActions(\n\tregistry: LanguageFeatureRegistry<languages.CodeActionProvider>,\n\tmodel: ITextModel,\n\trangeOrSelection: Range | Selection,\n\ttrigger: CodeActionTrigger,\n\tprogress: IProgress<languages.CodeActionProvider>,\n\ttoken: CancellationToken,\n): Promise<CodeActionSet> {\n\tconst filter = trigger.filter || {};\n\n\tconst codeActionContext: languages.CodeActionContext = {\n\t\tonly: filter.include?.value,\n\t\ttrigger: trigger.type,\n\t};\n\n\tconst cts = new TextModelCancellationTokenSource(model, token);\n\tconst providers = getCodeActionProviders(registry, model, filter);\n\n\tconst disposables = new DisposableStore();\n\tconst promises = providers.map(async provider => {\n\t\ttry {\n\t\t\tprogress.report(provider);\n\t\t\tconst providedCodeActions = await provider.provideCodeActions(model, rangeOrSelection, codeActionContext, cts.token);\n\t\t\tif (providedCodeActions) {\n\t\t\t\tdisposables.add(providedCodeActions);\n\t\t\t}\n\n\t\t\tif (cts.token.isCancellationRequested) {\n\t\t\t\treturn emptyCodeActionsResponse;\n\t\t\t}\n\n\t\t\tconst filteredActions = (providedCodeActions?.actions || []).filter(action => action && filtersAction(filter, action));\n\t\t\tconst documentation = getDocumentation(provider, filteredActions, filter.include);\n\t\t\treturn {\n\t\t\t\tactions: filteredActions.map(action => new CodeActionItem(action, provider)),\n\t\t\t\tdocumentation\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tif (isCancellationError(err)) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tonUnexpectedExternalError(err);\n\t\t\treturn emptyCodeActionsResponse;\n\t\t}\n\t});\n\n\tconst listener = registry.onDidChange(() => {\n\t\tconst newProviders = registry.all(model);\n\t\tif (!equals(newProviders, providers)) {\n\t\t\tcts.cancel();\n\t\t}\n\t});\n\n\treturn Promise.all(promises).then(actions => {\n\t\tconst allActions = flatten(actions.map(x => x.actions));\n\t\tconst allDocumentation = coalesce(actions.map(x => x.documentation));\n\t\treturn new ManagedCodeActionSet(allActions, allDocumentation, disposables);\n\t})\n\t\t.finally(() => {\n\t\t\tlistener.dispose();\n\t\t\tcts.dispose();\n\t\t});\n}\n\nfunction getCodeActionProviders(\n\tregistry: LanguageFeatureRegistry<languages.CodeActionProvider>,\n\tmodel: ITextModel,\n\tfilter: CodeActionFilter\n) {\n\treturn registry.all(model)\n\t\t// Don't include providers that we know will not return code actions of interest\n\t\t.filter(provider => {\n\t\t\tif (!provider.providedCodeActionKinds) {\n\t\t\t\t// We don't know what type of actions this provider will return.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn provider.providedCodeActionKinds.some(kind => mayIncludeActionsOfKind(filter, new CodeActionKind(kind)));\n\t\t});\n}\n\nfunction getDocumentation(\n\tprovider: languages.CodeActionProvider,\n\tprovidedCodeActions: readonly languages.CodeAction[],\n\tonly?: CodeActionKind\n): languages.Command | undefined {\n\tif (!provider.documentation) {\n\t\treturn undefined;\n\t}\n\n\tconst documentation = provider.documentation.map(entry => ({ kind: new CodeActionKind(entry.kind), command: entry.command }));\n\n\tif (only) {\n\t\tlet currentBest: { readonly kind: CodeActionKind; readonly command: languages.Command } | undefined;\n\t\tfor (const entry of documentation) {\n\t\t\tif (entry.kind.contains(only)) {\n\t\t\t\tif (!currentBest) {\n\t\t\t\t\tcurrentBest = entry;\n\t\t\t\t} else {\n\t\t\t\t\t// Take best match\n\t\t\t\t\tif (currentBest.kind.contains(entry.kind)) {\n\t\t\t\t\t\tcurrentBest = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (currentBest) {\n\t\t\treturn currentBest?.command;\n\t\t}\n\t}\n\n\t// Otherwise, check to see if any of the provided actions match.\n\tfor (const action of providedCodeActions) {\n\t\tif (!action.kind) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const entry of documentation) {\n\t\t\tif (entry.kind.contains(new CodeActionKind(action.kind))) {\n\t\t\t\treturn entry.command;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nCommandsRegistry.registerCommand('_executeCodeActionProvider', async function (accessor, resource: URI, rangeOrSelection: Range | Selection, kind?: string, itemResolveCount?: number): Promise<ReadonlyArray<languages.CodeAction>> {\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst { codeActionProvider } = accessor.get(ILanguageFeaturesService);\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst validatedRangeOrSelection = Selection.isISelection(rangeOrSelection)\n\t\t? Selection.liftSelection(rangeOrSelection)\n\t\t: Range.isIRange(rangeOrSelection)\n\t\t\t? model.validateRange(rangeOrSelection)\n\t\t\t: undefined;\n\n\tif (!validatedRangeOrSelection) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst include = typeof kind === 'string' ? new CodeActionKind(kind) : undefined;\n\tconst codeActionSet = await getCodeActions(\n\t\tcodeActionProvider,\n\t\tmodel,\n\t\tvalidatedRangeOrSelection,\n\t\t{ type: languages.CodeActionTriggerType.Invoke, filter: { includeSourceActions: true, include } },\n\t\tProgress.None,\n\t\tCancellationToken.None);\n\n\tconst resolving: Promise<any>[] = [];\n\tconst resolveCount = Math.min(codeActionSet.validActions.length, typeof itemResolveCount === 'number' ? itemResolveCount : 0);\n\tfor (let i = 0; i < resolveCount; i++) {\n\t\tresolving.push(codeActionSet.validActions[i].resolve(CancellationToken.None));\n\t}\n\n\ttry {\n\t\tawait Promise.all(resolving);\n\t\treturn codeActionSet.validActions.map(item => item.action);\n\t} finally {\n\t\tsetTimeout(() => codeActionSet.dispose(), 100);\n\t}\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 { getDomNodePagePosition } from 'vs/base/browser/dom';\nimport { IAnchor } from 'vs/base/browser/ui/contextview/contextview';\nimport { Action, IAction, Separator } from 'vs/base/common/actions';\nimport { canceled } from 'vs/base/common/errors';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { Lazy } from 'vs/base/common/lazy';\nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { CodeAction, Command } from 'vs/editor/common/languages';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { codeActionCommandId, CodeActionItem, CodeActionSet, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction';\nimport { CodeActionAutoApply, CodeActionCommandArgs, CodeActionKind, CodeActionTrigger } from 'vs/editor/contrib/codeAction/browser/types';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\n\ninterface CodeActionWidgetDelegate {\n\tonSelectCodeAction: (action: CodeActionItem) => Promise<any>;\n}\n\ninterface ResolveCodeActionKeybinding {\n\treadonly kind: CodeActionKind;\n\treadonly preferred: boolean;\n\treadonly resolvedKeybinding: ResolvedKeybinding;\n}\n\nclass CodeActionAction extends Action {\n\tconstructor(\n\t\tpublic readonly action: CodeAction,\n\t\tcallback: () => Promise<void>,\n\t) {\n\t\tsuper(action.command ? action.command.id : action.title, stripNewlines(action.title), undefined, !action.disabled, callback);\n\t}\n}\n\nfunction stripNewlines(str: string): string {\n\treturn str.replace(/\\r\\n|\\r|\\n/g, ' ');\n}\n\nexport interface CodeActionShowOptions {\n\treadonly includeDisabledActions: boolean;\n}\n\nexport class CodeActionMenu extends Disposable {\n\n\tprivate _visible: boolean = false;\n\tprivate readonly _showingActions = this._register(new MutableDisposable<CodeActionSet>());\n\n\tprivate readonly _keybindingResolver: CodeActionKeybindingResolver;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _delegate: CodeActionWidgetDelegate,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\n\t\tthis._keybindingResolver = new CodeActionKeybindingResolver({\n\t\t\tgetKeybindings: () => keybindingService.getKeybindings()\n\t\t});\n\t}\n\n\tget isVisible(): boolean {\n\t\treturn this._visible;\n\t}\n\n\tpublic async show(trigger: CodeActionTrigger, codeActions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise<void> {\n\t\tconst actionsToShow = options.includeDisabledActions ? codeActions.allActions : codeActions.validActions;\n\t\tif (!actionsToShow.length) {\n\t\t\tthis._visible = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getDomNode()) {\n\t\t\t// cancel when editor went off-dom\n\t\t\tthis._visible = false;\n\t\t\tthrow canceled();\n\t\t}\n\n\t\tthis._visible = true;\n\t\tthis._showingActions.value = codeActions;\n\n\t\tconst menuActions = this.getMenuActions(trigger, actionsToShow, codeActions.documentation);\n\n\t\tconst anchor = Position.isIPosition(at) ? this._toCoords(at) : at || { x: 0, y: 0 };\n\t\tconst resolver = this._keybindingResolver.getResolver();\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM);\n\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getDomNode()! : undefined,\n\t\t\tgetAnchor: () => anchor,\n\t\t\tgetActions: () => menuActions,\n\t\t\tonHide: () => {\n\t\t\t\tthis._visible = false;\n\t\t\t\tthis._editor.focus();\n\t\t\t},\n\t\t\tautoSelectFirstItem: true,\n\t\t\tgetKeyBinding: action => action instanceof CodeActionAction ? resolver(action.action) : undefined,\n\t\t});\n\t}\n\n\tprivate getMenuActions(\n\t\ttrigger: CodeActionTrigger,\n\t\tactionsToShow: readonly CodeActionItem[],\n\t\tdocumentation: readonly Command[]\n\t): IAction[] {\n\t\tconst toCodeActionAction = (item: CodeActionItem): CodeActionAction => new CodeActionAction(item.action, () => this._delegate.onSelectCodeAction(item));\n\n\t\tconst result: IAction[] = actionsToShow\n\t\t\t.map(toCodeActionAction);\n\n\t\tconst allDocumentation: Command[] = [...documentation];\n\n\t\tconst model = this._editor.getModel();\n\t\tif (model && result.length) {\n\t\t\tfor (const provider of this._languageFeaturesService.codeActionProvider.all(model)) {\n\t\t\t\tif (provider._getAdditionalMenuItems) {\n\t\t\t\t\tallDocumentation.push(...provider._getAdditionalMenuItems({ trigger: trigger.type, only: trigger.filter?.include?.value }, actionsToShow.map(item => item.action)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (allDocumentation.length) {\n\t\t\tresult.push(new Separator(), ...allDocumentation.map(command => toCodeActionAction(new CodeActionItem({\n\t\t\t\ttitle: command.title,\n\t\t\t\tcommand: command,\n\t\t\t}, undefined))));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _toCoords(position: IPosition): { x: number; y: number } {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn { x: 0, y: 0 };\n\t\t}\n\t\tthis._editor.revealPosition(position, ScrollType.Immediate);\n\t\tthis._editor.render();\n\n\t\t// Translate to absolute editor position\n\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(position);\n\t\tconst editorCoords = getDomNodePagePosition(this._editor.getDomNode());\n\t\tconst x = editorCoords.left + cursorCoords.left;\n\t\tconst y = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\treturn { x, y };\n\t}\n}\n\nexport class CodeActionKeybindingResolver {\n\tprivate static readonly codeActionCommands: readonly string[] = [\n\t\trefactorCommandId,\n\t\tcodeActionCommandId,\n\t\tsourceActionCommandId,\n\t\torganizeImportsCommandId,\n\t\tfixAllCommandId\n\t];\n\n\tconstructor(\n\t\tprivate readonly _keybindingProvider: {\n\t\t\tgetKeybindings(): readonly ResolvedKeybindingItem[];\n\t\t},\n\t) { }\n\n\tpublic getResolver(): (action: CodeAction) => ResolvedKeybinding | undefined {\n\t\t// Lazy since we may not actually ever read the value\n\t\tconst allCodeActionBindings = new Lazy<readonly ResolveCodeActionKeybinding[]>(() =>\n\t\t\tthis._keybindingProvider.getKeybindings()\n\t\t\t\t.filter(item => CodeActionKeybindingResolver.codeActionCommands.indexOf(item.command!) >= 0)\n\t\t\t\t.filter(item => item.resolvedKeybinding)\n\t\t\t\t.map((item): ResolveCodeActionKeybinding => {\n\t\t\t\t\t// Special case these commands since they come built-in with VS Code and don't use 'commandArgs'\n\t\t\t\t\tlet commandArgs = item.commandArgs;\n\t\t\t\t\tif (item.command === organizeImportsCommandId) {\n\t\t\t\t\t\tcommandArgs = { kind: CodeActionKind.SourceOrganizeImports.value };\n\t\t\t\t\t} else if (item.command === fixAllCommandId) {\n\t\t\t\t\t\tcommandArgs = { kind: CodeActionKind.SourceFixAll.value };\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tresolvedKeybinding: item.resolvedKeybinding!,\n\t\t\t\t\t\t...CodeActionCommandArgs.fromUser(commandArgs, {\n\t\t\t\t\t\t\tkind: CodeActionKind.None,\n\t\t\t\t\t\t\tapply: CodeActionAutoApply.Never\n\t\t\t\t\t\t})\n\t\t\t\t\t};\n\t\t\t\t}));\n\n\t\treturn (action) => {\n\t\t\tif (action.kind) {\n\t\t\t\tconst binding = this.bestKeybindingForCodeAction(action, allCodeActionBindings.getValue());\n\t\t\t\treturn binding?.resolvedKeybinding;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprivate bestKeybindingForCodeAction(\n\t\taction: CodeAction,\n\t\tcandidates: readonly ResolveCodeActionKeybinding[],\n\t): ResolveCodeActionKeybinding | undefined {\n\t\tif (!action.kind) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst kind = new CodeActionKind(action.kind);\n\n\t\treturn candidates\n\t\t\t.filter(candidate => candidate.kind.contains(kind))\n\t\t\t.filter(candidate => {\n\t\t\t\tif (candidate.preferred) {\n\t\t\t\t\t// If the candidate keybinding only applies to preferred actions, the this action must also be preferred\n\t\t\t\t\treturn action.isPreferred;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t.reduceRight((currentBest, candidate) => {\n\t\t\t\tif (!currentBest) {\n\t\t\t\t\treturn candidate;\n\t\t\t\t}\n\t\t\t\t// Select the more specific binding\n\t\t\t\treturn currentBest.kind.contains(candidate.kind) ? candidate : currentBest;\n\t\t\t}, undefined as ResolveCodeActionKeybinding | undefined);\n\t}\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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from 'vs/base/common/async';\nimport { isCancellationError } from 'vs/base/common/errors';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { isEqual } from 'vs/base/common/resources';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { CodeActionProvider, CodeActionTriggerType } from 'vs/editor/common/languages';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { IEditorProgressService, Progress } from 'vs/platform/progress/common/progress';\nimport { CodeActionSet, getCodeActions } from './codeAction';\nimport { CodeActionTrigger } from './types';\n\nexport const SUPPORTED_CODE_ACTIONS = new RawContextKey<string>('supportedCodeAction', '');\n\nexport type TriggeredCodeAction = undefined | {\n\treadonly selection: Selection;\n\treadonly trigger: CodeActionTrigger;\n\treadonly position: Position;\n};\n\nclass CodeActionOracle extends Disposable {\n\n\tprivate readonly _autoTriggerTimer = this._register(new TimeoutTimer());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _markerService: IMarkerService,\n\t\tprivate readonly _signalChange: (triggered: TriggeredCodeAction) => void,\n\t\tprivate readonly _delay: number = 250,\n\t) {\n\t\tsuper();\n\t\tthis._register(this._markerService.onMarkerChanged(e => this._onMarkerChanges(e)));\n\t\tthis._register(this._editor.onDidChangeCursorPosition(() => this._onCursorChange()));\n\t}\n\n\tpublic trigger(trigger: CodeActionTrigger): TriggeredCodeAction {\n\t\tconst selection = this._getRangeOfSelectionUnlessWhitespaceEnclosed(trigger);\n\t\treturn this._createEventAndSignalChange(trigger, selection);\n\t}\n\n\tprivate _onMarkerChanges(resources: readonly URI[]): void {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (resources.some(resource => isEqual(resource, model.uri))) {\n\t\t\tthis._autoTriggerTimer.cancelAndSet(() => {\n\t\t\t\tthis.trigger({ type: CodeActionTriggerType.Auto });\n\t\t\t}, this._delay);\n\t\t}\n\t}\n\n\tprivate _onCursorChange(): void {\n\t\tthis._autoTriggerTimer.cancelAndSet(() => {\n\t\t\tthis.trigger({ type: CodeActionTriggerType.Auto });\n\t\t}, this._delay);\n\t}\n\n\tprivate _getRangeOfMarker(selection: Selection): Range | undefined {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\t\tfor (const marker of this._markerService.read({ resource: model.uri })) {\n\t\t\tconst markerRange = model.validateRange(marker);\n\t\t\tif (Range.intersectRanges(markerRange, selection)) {\n\t\t\t\treturn Range.lift(markerRange);\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate _getRangeOfSelectionUnlessWhitespaceEnclosed(trigger: CodeActionTrigger): Selection | undefined {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\tconst selection = this._editor.getSelection();\n\t\tif (selection.isEmpty() && trigger.type === CodeActionTriggerType.Auto) {\n\t\t\tconst { lineNumber, column } = selection.getPosition();\n\t\t\tconst line = model.getLineContent(lineNumber);\n\t\t\tif (line.length === 0) {\n\t\t\t\t// empty line\n\t\t\t\treturn undefined;\n\t\t\t} else if (column === 1) {\n\t\t\t\t// look only right\n\t\t\t\tif (/\\s/.test(line[0])) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t} else if (column === model.getLineMaxColumn(lineNumber)) {\n\t\t\t\t// look only left\n\t\t\t\tif (/\\s/.test(line[line.length - 1])) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// look left and right\n\t\t\t\tif (/\\s/.test(line[column - 2]) && /\\s/.test(line[column - 1])) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn selection;\n\t}\n\n\tprivate _createEventAndSignalChange(trigger: CodeActionTrigger, selection: Selection | undefined): TriggeredCodeAction {\n\t\tconst model = this._editor.getModel();\n\t\tif (!selection || !model) {\n\t\t\t// cancel\n\t\t\tthis._signalChange(undefined);\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst markerRange = this._getRangeOfMarker(selection);\n\t\tconst position = markerRange ? markerRange.getStartPosition() : selection.getStartPosition();\n\n\t\tconst e: TriggeredCodeAction = {\n\t\t\ttrigger,\n\t\t\tselection,\n\t\t\tposition\n\t\t};\n\t\tthis._signalChange(e);\n\t\treturn e;\n\t}\n}\n\nexport namespace CodeActionsState {\n\n\texport const enum Type {\n\t\tEmpty,\n\t\tTriggered,\n\t}\n\n\texport const Empty = { type: Type.Empty } as const;\n\n\texport class Triggered {\n\t\treadonly type = Type.Triggered;\n\n\t\tpublic readonly actions: Promise<CodeActionSet>;\n\n\t\tconstructor(\n\t\t\tpublic readonly trigger: CodeActionTrigger,\n\t\t\tpublic readonly rangeOrSelection: Range | Selection,\n\t\t\tpublic readonly position: Position,\n\t\t\tprivate readonly _cancellablePromise: CancelablePromise<CodeActionSet>,\n\t\t) {\n\t\t\tthis.actions = _cancellablePromise.catch((e): CodeActionSet => {\n\t\t\t\tif (isCancellationError(e)) {\n\t\t\t\t\treturn emptyCodeActionSet;\n\t\t\t\t}\n\t\t\t\tthrow e;\n\t\t\t});\n\t\t}\n\n\t\tpublic cancel() {\n\t\t\tthis._cancellablePromise.cancel();\n\t\t}\n\t}\n\n\texport type State = typeof Empty | Triggered;\n}\n\nconst emptyCodeActionSet: CodeActionSet = {\n\tallActions: [],\n\tvalidActions: [],\n\tdispose: () => { },\n\tdocumentation: [],\n\thasAutoFix: false\n};\n\nexport class CodeActionModel extends Disposable {\n\n\tprivate readonly _codeActionOracle = this._register(new MutableDisposable<CodeActionOracle>());\n\tprivate _state: CodeActionsState.State = CodeActionsState.Empty;\n\tprivate readonly _supportedCodeActions: IContextKey<string>;\n\n\tprivate readonly _onDidChangeState = this._register(new Emitter<CodeActionsState.State>());\n\tpublic readonly onDidChangeState = this._onDidChangeState.event;\n\n\t#isDisposed = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _registry: LanguageFeatureRegistry<CodeActionProvider>,\n\t\tprivate readonly _markerService: IMarkerService,\n\t\tcontextKeyService: IContextKeyService,\n\t\tprivate readonly _progressService?: IEditorProgressService\n\t) {\n\t\tsuper();\n\t\tthis._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService);\n\n\t\tthis._register(this._editor.onDidChangeModel(() => this._update()));\n\t\tthis._register(this._editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._register(this._registry.onDidChange(() => this._update()));\n\n\t\tthis._update();\n\t}\n\n\toverride dispose(): void {\n\t\tif (this.#isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#isDisposed = true;\n\n\t\tsuper.dispose();\n\t\tthis.setState(CodeActionsState.Empty, true);\n\t}\n\n\tprivate _update(): void {\n\t\tif (this.#isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._codeActionOracle.value = undefined;\n\n\t\tthis.setState(CodeActionsState.Empty);\n\n\t\tconst model = this._editor.getModel();\n\t\tif (model\n\t\t\t&& this._registry.has(model)\n\t\t\t&& !this._editor.getOption(EditorOption.readOnly)\n\t\t) {\n\t\t\tconst supportedActions: string[] = [];\n\t\t\tfor (const provider of this._registry.all(model)) {\n\t\t\t\tif (Array.isArray(provider.providedCodeActionKinds)) {\n\t\t\t\t\tsupportedActions.push(...provider.providedCodeActionKinds);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._supportedCodeActions.set(supportedActions.join(' '));\n\n\t\t\tthis._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, trigger => {\n\t\t\t\tif (!trigger) {\n\t\t\t\t\tthis.setState(CodeActionsState.Empty);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst actions = createCancelablePromise(token => getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token));\n\t\t\t\tif (trigger.trigger.type === CodeActionTriggerType.Invoke) {\n\t\t\t\t\tthis._progressService?.showWhile(actions, 250);\n\t\t\t\t}\n\n\t\t\t\tthis.setState(new CodeActionsState.Triggered(trigger.trigger, trigger.selection, trigger.position, actions));\n\n\t\t\t}, undefined);\n\t\t\tthis._codeActionOracle.value.trigger({ type: CodeActionTriggerType.Auto });\n\t\t} else {\n\t\t\tthis._supportedCodeActions.reset();\n\t\t}\n\t}\n\n\tpublic trigger(trigger: CodeActionTrigger) {\n\t\tif (this._codeActionOracle.value) {\n\t\t\tthis._codeActionOracle.value.trigger(trigger);\n\t\t}\n\t}\n\n\tprivate setState(newState: CodeActionsState.State, skipNotify?: boolean) {\n\t\tif (newState === this._state) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Cancel old request\n\t\tif (this._state.type === CodeActionsState.Type.Triggered) {\n\t\t\tthis._state.cancel();\n\t\t}\n\n\t\tthis._state = newState;\n\n\t\tif (!skipNotify && !this.#isDisposed) {\n\t\t\tthis._onDidChangeState.fire(newState);\n\t\t}\n\t}\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\nimport * as nls from 'vs/nls';\n\nclass EditorFontZoomIn extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.fontZoomIn',\n\t\t\tlabel: nls.localize('EditorFontZoomIn.label', \"Editor Font Zoom In\"),\n\t\t\talias: 'Editor Font Zoom In',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tEditorZoom.setZoomLevel(EditorZoom.getZoomLevel() + 1);\n\t}\n}\n\nclass EditorFontZoomOut extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.fontZoomOut',\n\t\t\tlabel: nls.localize('EditorFontZoomOut.label', \"Editor Font Zoom Out\"),\n\t\t\talias: 'Editor Font Zoom Out',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tEditorZoom.setZoomLevel(EditorZoom.getZoomLevel() - 1);\n\t}\n}\n\nclass EditorFontZoomReset extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.fontZoomReset',\n\t\t\tlabel: nls.localize('EditorFontZoomReset.label', \"Editor Font Zoom Reset\"),\n\t\t\talias: 'Editor Font Zoom Reset',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tEditorZoom.setZoomLevel(0);\n\t}\n}\n\nregisterEditorAction(EditorFontZoomIn);\nregisterEditorAction(EditorFontZoomOut);\nregisterEditorAction(EditorFontZoomReset);\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { asArray, isNonEmptyArray } from 'vs/base/common/arrays';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { Iterable } from 'vs/base/common/iterator';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource, TextModelCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { IActiveCodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, FormattingOptions, TextEdit } from 'vs/editor/common/languages';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { FormattingEdit } from 'vs/editor/contrib/format/browser/formattingEdit';\nimport * as nls from 'vs/nls';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IProgress } from 'vs/platform/progress/common/progress';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\n\nexport function alertFormattingEdits(edits: ISingleEditOperation[]): void {\n\n\tedits = edits.filter(edit => edit.range);\n\tif (!edits.length) {\n\t\treturn;\n\t}\n\n\tlet { range } = edits[0];\n\tfor (let i = 1; i < edits.length; i++) {\n\t\trange = Range.plusRange(range, edits[i].range);\n\t}\n\tconst { startLineNumber, endLineNumber } = range;\n\tif (startLineNumber === endLineNumber) {\n\t\tif (edits.length === 1) {\n\t\t\talert(nls.localize('hint11', \"Made 1 formatting edit on line {0}\", startLineNumber));\n\t\t} else {\n\t\t\talert(nls.localize('hintn1', \"Made {0} formatting edits on line {1}\", edits.length, startLineNumber));\n\t\t}\n\t} else {\n\t\tif (edits.length === 1) {\n\t\t\talert(nls.localize('hint1n', \"Made 1 formatting edit between lines {0} and {1}\", startLineNumber, endLineNumber));\n\t\t} else {\n\t\t\talert(nls.localize('hintnn', \"Made {0} formatting edits between lines {1} and {2}\", edits.length, startLineNumber, endLineNumber));\n\t\t}\n\t}\n}\n\nexport function getRealAndSyntheticDocumentFormattersOrdered(\n\tdocumentFormattingEditProvider: LanguageFeatureRegistry<DocumentFormattingEditProvider>,\n\tdocumentRangeFormattingEditProvider: LanguageFeatureRegistry<DocumentRangeFormattingEditProvider>,\n\tmodel: ITextModel\n): DocumentFormattingEditProvider[] {\n\tconst result: DocumentFormattingEditProvider[] = [];\n\tconst seen = new Set<string>();\n\n\t// (1) add all document formatter\n\tconst docFormatter = documentFormattingEditProvider.ordered(model);\n\tfor (const formatter of docFormatter) {\n\t\tresult.push(formatter);\n\t\tif (formatter.extensionId) {\n\t\t\tseen.add(ExtensionIdentifier.toKey(formatter.extensionId));\n\t\t}\n\t}\n\n\t// (2) add all range formatter as document formatter (unless the same extension already did that)\n\tconst rangeFormatter = documentRangeFormattingEditProvider.ordered(model);\n\tfor (const formatter of rangeFormatter) {\n\t\tif (formatter.extensionId) {\n\t\t\tif (seen.has(ExtensionIdentifier.toKey(formatter.extensionId))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseen.add(ExtensionIdentifier.toKey(formatter.extensionId));\n\t\t}\n\t\tresult.push({\n\t\t\tdisplayName: formatter.displayName,\n\t\t\textensionId: formatter.extensionId,\n\t\t\tprovideDocumentFormattingEdits(model, options, token) {\n\t\t\t\treturn formatter.provideDocumentRangeFormattingEdits(model, model.getFullModelRange(), options, token);\n\t\t\t}\n\t\t});\n\t}\n\treturn result;\n}\n\nexport const enum FormattingMode {\n\tExplicit = 1,\n\tSilent = 2\n}\n\nexport interface IFormattingEditProviderSelector {\n\t<T extends (DocumentFormattingEditProvider | DocumentRangeFormattingEditProvider)>(formatter: T[], document: ITextModel, mode: FormattingMode): Promise<T | undefined>;\n}\n\nexport abstract class FormattingConflicts {\n\n\tprivate static readonly _selectors = new LinkedList<IFormattingEditProviderSelector>();\n\n\tstatic setFormatterSelector(selector: IFormattingEditProviderSelector): IDisposable {\n\t\tconst remove = FormattingConflicts._selectors.unshift(selector);\n\t\treturn { dispose: remove };\n\t}\n\n\tstatic async select<T extends (DocumentFormattingEditProvider | DocumentRangeFormattingEditProvider)>(formatter: T[], document: ITextModel, mode: FormattingMode): Promise<T | undefined> {\n\t\tif (formatter.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst selector = Iterable.first(FormattingConflicts._selectors);\n\t\tif (selector) {\n\t\t\treturn await selector(formatter, document, mode);\n\t\t}\n\t\treturn undefined;\n\t}\n}\n\nexport async function formatDocumentRangesWithSelectedProvider(\n\taccessor: ServicesAccessor,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\trangeOrRanges: Range | Range[],\n\tmode: FormattingMode,\n\tprogress: IProgress<DocumentRangeFormattingEditProvider>,\n\ttoken: CancellationToken\n): Promise<void> {\n\n\tconst instaService = accessor.get(IInstantiationService);\n\tconst { documentRangeFormattingEditProvider: documentRangeFormattingEditProviderRegistry } = accessor.get(ILanguageFeaturesService);\n\tconst model = isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel;\n\tconst provider = documentRangeFormattingEditProviderRegistry.ordered(model);\n\tconst selected = await FormattingConflicts.select(provider, model, mode);\n\tif (selected) {\n\t\tprogress.report(selected);\n\t\tawait instaService.invokeFunction(formatDocumentRangesWithProvider, selected, editorOrModel, rangeOrRanges, token);\n\t}\n}\n\nexport async function formatDocumentRangesWithProvider(\n\taccessor: ServicesAccessor,\n\tprovider: DocumentRangeFormattingEditProvider,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\trangeOrRanges: Range | Range[],\n\ttoken: CancellationToken\n): Promise<boolean> {\n\tconst workerService = accessor.get(IEditorWorkerService);\n\n\tlet model: ITextModel;\n\tlet cts: CancellationTokenSource;\n\tif (isCodeEditor(editorOrModel)) {\n\t\tmodel = editorOrModel.getModel();\n\t\tcts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, undefined, token);\n\t} else {\n\t\tmodel = editorOrModel;\n\t\tcts = new TextModelCancellationTokenSource(editorOrModel, token);\n\t}\n\n\t// make sure that ranges don't overlap nor touch each other\n\tlet ranges: Range[] = [];\n\tlet len = 0;\n\tfor (let range of asArray(rangeOrRanges).sort(Range.compareRangesUsingStarts)) {\n\t\tif (len > 0 && Range.areIntersectingOrTouching(ranges[len - 1], range)) {\n\t\t\tranges[len - 1] = Range.fromPositions(ranges[len - 1].getStartPosition(), range.getEndPosition());\n\t\t} else {\n\t\t\tlen = ranges.push(range);\n\t\t}\n\t}\n\n\tconst computeEdits = async (range: Range) => {\n\t\treturn (await provider.provideDocumentRangeFormattingEdits(\n\t\t\tmodel,\n\t\t\trange,\n\t\t\tmodel.getFormattingOptions(),\n\t\t\tcts.token\n\t\t)) || [];\n\t};\n\n\tconst hasIntersectingEdit = (a: TextEdit[], b: TextEdit[]) => {\n\t\tif (!a.length || !b.length) {\n\t\t\treturn false;\n\t\t}\n\t\t// quick exit if the list of ranges are completely unrelated [O(n)]\n\t\tconst mergedA = a.reduce((acc, val) => { return Range.plusRange(acc, val.range); }, a[0].range);\n\t\tif (!b.some(x => { return Range.intersectRanges(mergedA, x.range); })) {\n\t\t\treturn false;\n\t\t}\n\t\t// fallback to a complete check [O(n^2)]\n\t\tfor (let edit of a) {\n\t\t\tfor (let otherEdit of b) {\n\t\t\t\tif (Range.intersectRanges(edit.range, otherEdit.range)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n\n\tconst allEdits: TextEdit[] = [];\n\tconst rawEditsList: TextEdit[][] = [];\n\ttry {\n\t\tfor (let range of ranges) {\n\t\t\tif (cts.token.isCancellationRequested) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\trawEditsList.push(await computeEdits(range));\n\t\t}\n\n\t\tfor (let i = 0; i < ranges.length; ++i) {\n\t\t\tfor (let j = i + 1; j < ranges.length; ++j) {\n\t\t\t\tif (cts.token.isCancellationRequested) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (hasIntersectingEdit(rawEditsList[i], rawEditsList[j])) {\n\t\t\t\t\t// Merge ranges i and j into a single range, recompute the associated edits\n\t\t\t\t\tconst mergedRange = Range.plusRange(ranges[i], ranges[j]);\n\t\t\t\t\tconst edits = await computeEdits(mergedRange);\n\t\t\t\t\tranges.splice(j, 1);\n\t\t\t\t\tranges.splice(i, 1);\n\t\t\t\t\tranges.push(mergedRange);\n\t\t\t\t\trawEditsList.splice(j, 1);\n\t\t\t\t\trawEditsList.splice(i, 1);\n\t\t\t\t\trawEditsList.push(edits);\n\t\t\t\t\t// Restart scanning\n\t\t\t\t\ti = 0;\n\t\t\t\t\tj = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let rawEdits of rawEditsList) {\n\t\t\tif (cts.token.isCancellationRequested) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst minimalEdits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\t\t\tif (minimalEdits) {\n\t\t\t\tallEdits.push(...minimalEdits);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tcts.dispose();\n\t}\n\n\tif (allEdits.length === 0) {\n\t\treturn false;\n\t}\n\n\tif (isCodeEditor(editorOrModel)) {\n\t\t// use editor to apply edits\n\t\tFormattingEdit.execute(editorOrModel, allEdits, true);\n\t\talertFormattingEdits(allEdits);\n\t\teditorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), ScrollType.Immediate);\n\n\t} else {\n\t\t// use model to apply edits\n\t\tconst [{ range }] = allEdits;\n\t\tconst initialSelection = new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t\tmodel.pushEditOperations([initialSelection], allEdits.map(edit => {\n\t\t\treturn {\n\t\t\t\ttext: edit.text,\n\t\t\t\trange: Range.lift(edit.range),\n\t\t\t\tforceMoveMarkers: true\n\t\t\t};\n\t\t}), undoEdits => {\n\t\t\tfor (const { range } of undoEdits) {\n\t\t\t\tif (Range.areIntersectingOrTouching(range, initialSelection)) {\n\t\t\t\t\treturn [new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t});\n\t}\n\n\treturn true;\n}\n\nexport async function formatDocumentWithSelectedProvider(\n\taccessor: ServicesAccessor,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\tmode: FormattingMode,\n\tprogress: IProgress<DocumentFormattingEditProvider>,\n\ttoken: CancellationToken\n): Promise<void> {\n\n\tconst instaService = accessor.get(IInstantiationService);\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst model = isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel;\n\tconst provider = getRealAndSyntheticDocumentFormattersOrdered(languageFeaturesService.documentFormattingEditProvider, languageFeaturesService.documentRangeFormattingEditProvider, model);\n\tconst selected = await FormattingConflicts.select(provider, model, mode);\n\tif (selected) {\n\t\tprogress.report(selected);\n\t\tawait instaService.invokeFunction(formatDocumentWithProvider, selected, editorOrModel, mode, token);\n\t}\n}\n\nexport async function formatDocumentWithProvider(\n\taccessor: ServicesAccessor,\n\tprovider: DocumentFormattingEditProvider,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\tmode: FormattingMode,\n\ttoken: CancellationToken\n): Promise<boolean> {\n\tconst workerService = accessor.get(IEditorWorkerService);\n\n\tlet model: ITextModel;\n\tlet cts: CancellationTokenSource;\n\tif (isCodeEditor(editorOrModel)) {\n\t\tmodel = editorOrModel.getModel();\n\t\tcts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, undefined, token);\n\t} else {\n\t\tmodel = editorOrModel;\n\t\tcts = new TextModelCancellationTokenSource(editorOrModel, token);\n\t}\n\n\tlet edits: TextEdit[] | undefined;\n\ttry {\n\t\tconst rawEdits = await provider.provideDocumentFormattingEdits(\n\t\t\tmodel,\n\t\t\tmodel.getFormattingOptions(),\n\t\t\tcts.token\n\t\t);\n\n\t\tedits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\n\t\tif (cts.token.isCancellationRequested) {\n\t\t\treturn true;\n\t\t}\n\n\t} finally {\n\t\tcts.dispose();\n\t}\n\n\tif (!edits || edits.length === 0) {\n\t\treturn false;\n\t}\n\n\tif (isCodeEditor(editorOrModel)) {\n\t\t// use editor to apply edits\n\t\tFormattingEdit.execute(editorOrModel, edits, mode !== FormattingMode.Silent);\n\n\t\tif (mode !== FormattingMode.Silent) {\n\t\t\talertFormattingEdits(edits);\n\t\t\teditorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), ScrollType.Immediate);\n\t\t}\n\n\t} else {\n\t\t// use model to apply edits\n\t\tconst [{ range }] = edits;\n\t\tconst initialSelection = new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t\tmodel.pushEditOperations([initialSelection], edits.map(edit => {\n\t\t\treturn {\n\t\t\t\ttext: edit.text,\n\t\t\t\trange: Range.lift(edit.range),\n\t\t\t\tforceMoveMarkers: true\n\t\t\t};\n\t\t}), undoEdits => {\n\t\t\tfor (const { range } of undoEdits) {\n\t\t\t\tif (Range.areIntersectingOrTouching(range, initialSelection)) {\n\t\t\t\t\treturn [new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t});\n\t}\n\n\treturn true;\n}\n\nexport async function getDocumentRangeFormattingEditsUntilResult(\n\tworkerService: IEditorWorkerService,\n\tlanguageFeaturesService: ILanguageFeaturesService,\n\tmodel: ITextModel,\n\trange: Range,\n\toptions: FormattingOptions,\n\ttoken: CancellationToken\n): Promise<TextEdit[] | undefined> {\n\n\tconst providers = languageFeaturesService.documentRangeFormattingEditProvider.ordered(model);\n\tfor (const provider of providers) {\n\t\tlet rawEdits = await Promise.resolve(provider.provideDocumentRangeFormattingEdits(model, range, options, token)).catch(onUnexpectedExternalError);\n\t\tif (isNonEmptyArray(rawEdits)) {\n\t\t\treturn await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\t\t}\n\t}\n\treturn undefined;\n}\n\nexport async function getDocumentFormattingEditsUntilResult(\n\tworkerService: IEditorWorkerService,\n\tlanguageFeaturesService: ILanguageFeaturesService,\n\tmodel: ITextModel,\n\toptions: FormattingOptions,\n\ttoken: CancellationToken\n): Promise<TextEdit[] | undefined> {\n\n\tconst providers = getRealAndSyntheticDocumentFormattersOrdered(languageFeaturesService.documentFormattingEditProvider, languageFeaturesService.documentRangeFormattingEditProvider, model);\n\tfor (const provider of providers) {\n\t\tlet rawEdits = await Promise.resolve(provider.provideDocumentFormattingEdits(model, options, token)).catch(onUnexpectedExternalError);\n\t\tif (isNonEmptyArray(rawEdits)) {\n\t\t\treturn await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\t\t}\n\t}\n\treturn undefined;\n}\n\nexport function getOnTypeFormattingEdits(\n\tworkerService: IEditorWorkerService,\n\tlanguageFeaturesService: ILanguageFeaturesService,\n\tmodel: ITextModel,\n\tposition: Position,\n\tch: string,\n\toptions: FormattingOptions,\n\ttoken: CancellationToken\n): Promise<TextEdit[] | null | undefined> {\n\n\tconst providers = languageFeaturesService.onTypeFormattingEditProvider.ordered(model);\n\n\tif (providers.length === 0) {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tif (providers[0].autoFormatTriggerCharacters.indexOf(ch) < 0) {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\treturn Promise.resolve(providers[0].provideOnTypeFormattingEdits(model, position, ch, options, token)).catch(onUnexpectedExternalError).then(edits => {\n\t\treturn workerService.computeMoreMinimalEdits(model.uri, edits);\n\t});\n}\n\nCommandsRegistry.registerCommand('_executeFormatRangeProvider', async function (accessor, ...args) {\n\tconst [resource, range, options] = args;\n\tassertType(URI.isUri(resource));\n\tassertType(Range.isIRange(range));\n\n\tconst resolverService = accessor.get(ITextModelService);\n\tconst workerService = accessor.get(IEditorWorkerService);\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst reference = await resolverService.createModelReference(resource);\n\ttry {\n\t\treturn getDocumentRangeFormattingEditsUntilResult(workerService, languageFeaturesService, reference.object.textEditorModel, Range.lift(range), options, CancellationToken.None);\n\t} finally {\n\t\treference.dispose();\n\t}\n});\n\nCommandsRegistry.registerCommand('_executeFormatDocumentProvider', async function (accessor, ...args) {\n\tconst [resource, options] = args;\n\tassertType(URI.isUri(resource));\n\n\tconst resolverService = accessor.get(ITextModelService);\n\tconst workerService = accessor.get(IEditorWorkerService);\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst reference = await resolverService.createModelReference(resource);\n\ttry {\n\t\treturn getDocumentFormattingEditsUntilResult(workerService, languageFeaturesService, reference.object.textEditorModel, options, CancellationToken.None);\n\t} finally {\n\t\treference.dispose();\n\t}\n});\n\nCommandsRegistry.registerCommand('_executeFormatOnTypeProvider', async function (accessor, ...args) {\n\tconst [resource, position, ch, options] = args;\n\tassertType(URI.isUri(resource));\n\tassertType(Position.isIPosition(position));\n\tassertType(typeof ch === 'string');\n\n\tconst resolverService = accessor.get(ITextModelService);\n\tconst workerService = accessor.get(IEditorWorkerService);\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst reference = await resolverService.createModelReference(resource);\n\ttry {\n\t\treturn getOnTypeFormattingEdits(workerService, languageFeaturesService, reference.object.textEditorModel, Position.lift(position), ch, options, CancellationToken.None);\n\t} finally {\n\t\treference.dispose();\n\t}\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 { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { alertFormattingEdits, formatDocumentRangesWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode, getOnTypeFormattingEdits } from 'vs/editor/contrib/format/browser/format';\nimport { FormattingEdit } from 'vs/editor/contrib/format/browser/formattingEdit';\nimport * as nls from 'vs/nls';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IEditorProgressService, Progress } from 'vs/platform/progress/common/progress';\n\nclass FormatOnType implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.autoFormat';\n\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorWorkerService private readonly _workerService: IEditorWorkerService\n\t) {\n\n\t\tthis._disposables.add(_languageFeaturesService.onTypeFormattingEditProvider.onDidChange(this._update, this));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.formatOnType)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._sessionDisposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\n\t\t// clean up\n\t\tthis._sessionDisposables.clear();\n\n\t\t// we are disabled\n\t\tif (!this._editor.getOption(EditorOption.formatOnType)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// no model\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\n\t\t// no support\n\t\tconst [support] = this._languageFeaturesService.onTypeFormattingEditProvider.ordered(model);\n\t\tif (!support || !support.autoFormatTriggerCharacters) {\n\t\t\treturn;\n\t\t}\n\n\t\t// register typing listeners that will trigger the format\n\t\tlet triggerChars = new CharacterSet();\n\t\tfor (let ch of support.autoFormatTriggerCharacters) {\n\t\t\ttriggerChars.add(ch.charCodeAt(0));\n\t\t}\n\t\tthis._sessionDisposables.add(this._editor.onDidType((text: string) => {\n\t\t\tlet lastCharCode = text.charCodeAt(text.length - 1);\n\t\t\tif (triggerChars.has(lastCharCode)) {\n\t\t\t\tthis._trigger(String.fromCharCode(lastCharCode));\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _trigger(ch: string): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getSelections().length > 1 || !this._editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tconst cts = new CancellationTokenSource();\n\n\t\t// install a listener that checks if edits happens before the\n\t\t// position on which we format right now. If so, we won't\n\t\t// apply the format edits\n\t\tconst unbind = this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\t// cancel only once\n\t\t\t\tcts.cancel();\n\t\t\t\tunbind.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (let i = 0, len = e.changes.length; i < len; i++) {\n\t\t\t\tconst change = e.changes[i];\n\t\t\t\tif (change.range.endLineNumber <= position.lineNumber) {\n\t\t\t\t\t// cancel only once\n\t\t\t\t\tcts.cancel();\n\t\t\t\t\tunbind.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tgetOnTypeFormattingEdits(\n\t\t\tthis._workerService,\n\t\t\tthis._languageFeaturesService,\n\t\t\tmodel,\n\t\t\tposition,\n\t\t\tch,\n\t\t\tmodel.getFormattingOptions(),\n\t\t\tcts.token\n\t\t).then(edits => {\n\t\t\tif (cts.token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isNonEmptyArray(edits)) {\n\t\t\t\tFormattingEdit.execute(this._editor, edits, true);\n\t\t\t\talertFormattingEdits(edits);\n\t\t\t}\n\t\t}).finally(() => {\n\t\t\tunbind.dispose();\n\t\t});\n\t}\n}\n\nclass FormatOnPaste implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.formatOnPaste';\n\n\tprivate readonly _callOnDispose = new DisposableStore();\n\tprivate readonly _callOnModel = new DisposableStore();\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t) {\n\t\tthis._callOnDispose.add(editor.onDidChangeConfiguration(() => this._update()));\n\t\tthis._callOnDispose.add(editor.onDidChangeModel(() => this._update()));\n\t\tthis._callOnDispose.add(editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._callOnDispose.add(_languageFeaturesService.documentRangeFormattingEditProvider.onDidChange(this._update, this));\n\t}\n\n\tdispose(): void {\n\t\tthis._callOnDispose.dispose();\n\t\tthis._callOnModel.dispose();\n\t}\n\n\tprivate _update(): void {\n\n\t\t// clean up\n\t\tthis._callOnModel.clear();\n\n\t\t// we are disabled\n\t\tif (!this.editor.getOption(EditorOption.formatOnPaste)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// no model\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// no formatter\n\t\tif (!this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._callOnModel.add(this.editor.onDidPaste(({ range }) => this._trigger(range)));\n\t}\n\n\tprivate _trigger(range: Range): void {\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.editor.getSelections().length > 1) {\n\t\t\treturn;\n\t\t}\n\t\tthis._instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider, this.editor, range, FormattingMode.Silent, Progress.None, CancellationToken.None).catch(onUnexpectedError);\n\t}\n}\n\nclass FormatDocumentAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.formatDocument',\n\t\t\tlabel: nls.localize('formatDocument.label', \"Format Document\"),\n\t\t\talias: 'Format Document',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.notInCompositeEditor, EditorContextKeys.writable, EditorContextKeys.hasDocumentFormattingProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyF,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyI },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 1.3\n\t\t\t}\n\t\t});\n\t}\n\n\tasync run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tif (editor.hasModel()) {\n\t\t\tconst instaService = accessor.get(IInstantiationService);\n\t\t\tconst progressService = accessor.get(IEditorProgressService);\n\t\t\tawait progressService.showWhile(\n\t\t\t\tinstaService.invokeFunction(formatDocumentWithSelectedProvider, editor, FormattingMode.Explicit, Progress.None, CancellationToken.None),\n\t\t\t\t250\n\t\t\t);\n\t\t}\n\t}\n}\n\nclass FormatSelectionAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.formatSelection',\n\t\t\tlabel: nls.localize('formatSelection.label', \"Format Selection\"),\n\t\t\talias: 'Format Selection',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasDocumentSelectionFormattingProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyF),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\twhen: EditorContextKeys.hasNonEmptySelection,\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 1.31\n\t\t\t}\n\t\t});\n\t}\n\n\tasync run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst instaService = accessor.get(IInstantiationService);\n\t\tconst model = editor.getModel();\n\n\t\tconst ranges = editor.getSelections().map(range => {\n\t\t\treturn range.isEmpty()\n\t\t\t\t? new Range(range.startLineNumber, 1, range.startLineNumber, model.getLineMaxColumn(range.startLineNumber))\n\t\t\t\t: range;\n\t\t});\n\n\t\tconst progressService = accessor.get(IEditorProgressService);\n\t\tawait progressService.showWhile(\n\t\t\tinstaService.invokeFunction(formatDocumentRangesWithSelectedProvider, editor, ranges, FormattingMode.Explicit, Progress.None, CancellationToken.None),\n\t\t\t250\n\t\t);\n\t}\n}\n\nregisterEditorContribution(FormatOnType.ID, FormatOnType);\nregisterEditorContribution(FormatOnPaste.ID, FormatOnPaste);\nregisterEditorAction(FormatDocumentAction);\nregisterEditorAction(FormatSelectionAction);\n\n// this is the old format action that does both (format document OR format selection)\n// and we keep it here such that existing keybinding configurations etc will still work\nCommandsRegistry.registerCommand('editor.action.format', async accessor => {\n\tconst editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\tif (!editor || !editor.hasModel()) {\n\t\treturn;\n\t}\n\tconst commandService = accessor.get(ICommandService);\n\tif (editor.getSelection().isEmpty()) {\n\t\tawait commandService.executeCommand('editor.action.formatDocument');\n\t} else {\n\t\tawait commandService.executeCommand('editor.action.formatSelection');\n\t}\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DeclarationProvider, DefinitionProvider, ImplementationProvider, LocationLink, ProviderResult, ReferenceProvider, TypeDefinitionProvider } from 'vs/editor/common/languages';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nfunction getLocationLinks<T>(\n\tmodel: ITextModel,\n\tposition: Position,\n\tregistry: LanguageFeatureRegistry<T>,\n\tprovide: (provider: T, model: ITextModel, position: Position) => ProviderResult<LocationLink | LocationLink[]>\n): Promise<LocationLink[]> {\n\tconst provider = registry.ordered(model);\n\n\t// get results\n\tconst promises = provider.map((provider): Promise<LocationLink | LocationLink[] | undefined> => {\n\t\treturn Promise.resolve(provide(provider, model, position)).then(undefined, err => {\n\t\t\tonUnexpectedExternalError(err);\n\t\t\treturn undefined;\n\t\t});\n\t});\n\n\treturn Promise.all(promises).then(values => {\n\t\tconst result: LocationLink[] = [];\n\t\tfor (let value of values) {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tresult.push(...value);\n\t\t\t} else if (value) {\n\t\t\t\tresult.push(value);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t});\n}\n\nexport function getDefinitionsAtPosition(registry: LanguageFeatureRegistry<DefinitionProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getLocationLinks(model, position, registry, (provider, model, position) => {\n\t\treturn provider.provideDefinition(model, position, token);\n\t});\n}\n\nexport function getDeclarationsAtPosition(registry: LanguageFeatureRegistry<DeclarationProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getLocationLinks(model, position, registry, (provider, model, position) => {\n\t\treturn provider.provideDeclaration(model, position, token);\n\t});\n}\n\nexport function getImplementationsAtPosition(registry: LanguageFeatureRegistry<ImplementationProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getLocationLinks(model, position, registry, (provider, model, position) => {\n\t\treturn provider.provideImplementation(model, position, token);\n\t});\n}\n\nexport function getTypeDefinitionsAtPosition(registry: LanguageFeatureRegistry<TypeDefinitionProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getLocationLinks(model, position, registry, (provider, model, position) => {\n\t\treturn provider.provideTypeDefinition(model, position, token);\n\t});\n}\n\nexport function getReferencesAtPosition(registry: LanguageFeatureRegistry<ReferenceProvider>, model: ITextModel, position: Position, compact: boolean, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getLocationLinks(model, position, registry, async (provider, model, position) => {\n\t\tconst result = await provider.provideReferences(model, position, { includeDeclaration: true }, token);\n\t\tif (!compact || !result || result.length !== 2) {\n\t\t\treturn result;\n\t\t}\n\t\tconst resultWithoutDeclaration = await provider.provideReferences(model, position, { includeDeclaration: false }, token);\n\t\tif (resultWithoutDeclaration && resultWithoutDeclaration.length === 1) {\n\t\t\treturn resultWithoutDeclaration;\n\t\t}\n\t\treturn result;\n\t});\n}\n\n// -- API commands ----\n\nasync function _sortedAndDeduped(callback: () => Promise<LocationLink[]>): Promise<LocationLink[]> {\n\tconst rawLinks = await callback();\n\tconst model = new ReferencesModel(rawLinks, '');\n\tconst modelLinks = model.references.map(ref => ref.link);\n\tmodel.dispose();\n\treturn modelLinks;\n}\n\nregisterModelAndPositionCommand('_executeDefinitionProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, CancellationToken.None);\n\treturn _sortedAndDeduped(() => promise);\n});\n\nregisterModelAndPositionCommand('_executeTypeDefinitionProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, CancellationToken.None);\n\treturn _sortedAndDeduped(() => promise);\n});\n\nregisterModelAndPositionCommand('_executeDeclarationProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, CancellationToken.None);\n\treturn _sortedAndDeduped(() => promise);\n});\n\nregisterModelAndPositionCommand('_executeReferenceProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, CancellationToken.None);\n\treturn _sortedAndDeduped(() => promise);\n});\n\nregisterModelAndPositionCommand('_executeImplementationProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\tconst promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, CancellationToken.None);\n\treturn _sortedAndDeduped(() => promise);\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 { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { combinedDisposable, DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { isEqual } from 'vs/base/common/resources';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { Range } from 'vs/editor/common/core/range';\nimport { OneReference, ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel';\nimport { localize } from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\n\nexport const ctxHasSymbols = new RawContextKey('hasSymbols', false, localize('hasSymbols', \"Whether there are symbol locations that can be navigated via keyboard-only.\"));\n\nexport const ISymbolNavigationService = createDecorator<ISymbolNavigationService>('ISymbolNavigationService');\n\nexport interface ISymbolNavigationService {\n\treadonly _serviceBrand: undefined;\n\treset(): void;\n\tput(anchor: OneReference): void;\n\trevealNext(source: ICodeEditor): Promise<any>;\n}\n\nclass SymbolNavigationService implements ISymbolNavigationService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _ctxHasSymbols: IContextKey<boolean>;\n\n\tprivate _currentModel?: ReferencesModel = undefined;\n\tprivate _currentIdx: number = -1;\n\tprivate _currentState?: IDisposable;\n\tprivate _currentMessage?: IDisposable;\n\tprivate _ignoreEditorChange: boolean = false;\n\n\tconstructor(\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICodeEditorService private readonly _editorService: ICodeEditorService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t) {\n\t\tthis._ctxHasSymbols = ctxHasSymbols.bindTo(contextKeyService);\n\t}\n\n\treset(): void {\n\t\tthis._ctxHasSymbols.reset();\n\t\tthis._currentState?.dispose();\n\t\tthis._currentMessage?.dispose();\n\t\tthis._currentModel = undefined;\n\t\tthis._currentIdx = -1;\n\t}\n\n\tput(anchor: OneReference): void {\n\t\tconst refModel = anchor.parent.parent;\n\n\t\tif (refModel.references.length <= 1) {\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._currentModel = refModel;\n\t\tthis._currentIdx = refModel.references.indexOf(anchor);\n\t\tthis._ctxHasSymbols.set(true);\n\t\tthis._showMessage();\n\n\t\tconst editorState = new EditorState(this._editorService);\n\t\tconst listener = editorState.onDidChange(_ => {\n\n\t\t\tif (this._ignoreEditorChange) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst editor = this._editorService.getActiveCodeEditor();\n\t\t\tif (!editor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = editor.getModel();\n\t\t\tconst position = editor.getPosition();\n\t\t\tif (!model || !position) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet seenUri: boolean = false;\n\t\t\tlet seenPosition: boolean = false;\n\t\t\tfor (const reference of refModel.references) {\n\t\t\t\tif (isEqual(reference.uri, model.uri)) {\n\t\t\t\t\tseenUri = true;\n\t\t\t\t\tseenPosition = seenPosition || Range.containsPosition(reference.range, position);\n\t\t\t\t} else if (seenUri) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!seenUri || !seenPosition) {\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t});\n\n\t\tthis._currentState = combinedDisposable(editorState, listener);\n\t}\n\n\trevealNext(source: ICodeEditor): Promise<any> {\n\t\tif (!this._currentModel) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\t// get next result and advance\n\t\tthis._currentIdx += 1;\n\t\tthis._currentIdx %= this._currentModel.references.length;\n\t\tconst reference = this._currentModel.references[this._currentIdx];\n\n\t\t// status\n\t\tthis._showMessage();\n\n\t\t// open editor, ignore events while that happens\n\t\tthis._ignoreEditorChange = true;\n\t\treturn this._editorService.openCodeEditor({\n\t\t\tresource: reference.uri,\n\t\t\toptions: {\n\t\t\t\tselection: Range.collapseToStart(reference.range),\n\t\t\t\tselectionRevealType: TextEditorSelectionRevealType.NearTopIfOutsideViewport\n\t\t\t}\n\t\t}, source).finally(() => {\n\t\t\tthis._ignoreEditorChange = false;\n\t\t});\n\n\t}\n\n\tprivate _showMessage(): void {\n\n\t\tthis._currentMessage?.dispose();\n\n\t\tconst kb = this._keybindingService.lookupKeybinding('editor.gotoNextSymbolFromResult');\n\t\tconst message = kb\n\t\t\t? localize('location.kb', \"Symbol {0} of {1}, {2} for next\", this._currentIdx + 1, this._currentModel!.references.length, kb.getLabel())\n\t\t\t: localize('location', \"Symbol {0} of {1}\", this._currentIdx + 1, this._currentModel!.references.length);\n\n\t\tthis._currentMessage = this._notificationService.status(message);\n\t}\n}\n\nregisterSingleton(ISymbolNavigationService, SymbolNavigationService, true);\n\nregisterEditorCommand(new class extends EditorCommand {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.gotoNextSymbolFromResult',\n\t\t\tprecondition: ctxHasSymbols,\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib,\n\t\t\t\tprimary: KeyCode.F12\n\t\t\t}\n\t\t});\n\t}\n\n\trunEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor): void | Promise<void> {\n\t\treturn accessor.get(ISymbolNavigationService).revealNext(editor);\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'editor.gotoNextSymbolFromResult.cancel',\n\tweight: KeybindingWeight.EditorContrib,\n\twhen: ctxHasSymbols,\n\tprimary: KeyCode.Escape,\n\thandler(accessor) {\n\t\taccessor.get(ISymbolNavigationService).reset();\n\t}\n});\n\n//\n\nclass EditorState {\n\n\tprivate readonly _listener = new Map<ICodeEditor, IDisposable>();\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate readonly _onDidChange = new Emitter<{ editor: ICodeEditor }>();\n\treadonly onDidChange: Event<{ editor: ICodeEditor }> = this._onDidChange.event;\n\n\tconstructor(@ICodeEditorService editorService: ICodeEditorService) {\n\t\tthis._disposables.add(editorService.onCodeEditorRemove(this._onDidRemoveEditor, this));\n\t\tthis._disposables.add(editorService.onCodeEditorAdd(this._onDidAddEditor, this));\n\t\teditorService.listCodeEditors().forEach(this._onDidAddEditor, this);\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._onDidChange.dispose();\n\t\tdispose(this._listener.values());\n\t}\n\n\tprivate _onDidAddEditor(editor: ICodeEditor): void {\n\t\tthis._listener.set(editor, combinedDisposable(\n\t\t\teditor.onDidChangeCursorPosition(_ => this._onDidChange.fire({ editor })),\n\t\t\teditor.onDidChangeModelContent(_ => this._onDidChange.fire({ editor })),\n\t\t));\n\t}\n\n\tprivate _onDidRemoveEditor(editor: ICodeEditor): void {\n\t\tthis._listener.get(editor)?.dispose();\n\t\tthis._listener.delete(editor);\n\t}\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 { AsyncIterableObject } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Hover, HoverProvider } from 'vs/editor/common/languages';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class HoverProviderResult {\n\tconstructor(\n\t\tpublic readonly provider: HoverProvider,\n\t\tpublic readonly hover: Hover,\n\t\tpublic readonly ordinal: number\n\t) { }\n}\n\nasync function executeProvider(provider: HoverProvider, ordinal: number, model: ITextModel, position: Position, token: CancellationToken): Promise<HoverProviderResult | undefined> {\n\ttry {\n\t\tconst result = await Promise.resolve(provider.provideHover(model, position, token));\n\t\tif (result && isValid(result)) {\n\t\t\treturn new HoverProviderResult(provider, result, ordinal);\n\t\t}\n\t} catch (err) {\n\t\tonUnexpectedExternalError(err);\n\t}\n\treturn undefined;\n}\n\nexport function getHover(registry: LanguageFeatureRegistry<HoverProvider>, model: ITextModel, position: Position, token: CancellationToken): AsyncIterableObject<HoverProviderResult> {\n\tconst providers = registry.ordered(model);\n\tconst promises = providers.map((provider, index) => executeProvider(provider, index, model, position, token));\n\treturn AsyncIterableObject.fromPromises(promises).coalesce();\n}\n\nexport function getHoverPromise(registry: LanguageFeatureRegistry<HoverProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<Hover[]> {\n\treturn getHover(registry, model, position, token).map(item => item.hover).toPromise();\n}\n\nregisterModelAndPositionCommand('_executeHoverProvider', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\treturn getHoverPromise(languageFeaturesService.hoverProvider, model, position, CancellationToken.None);\n});\n\nfunction isValid(result: Hover) {\n\tconst hasRange = (typeof result.range !== 'undefined');\n\tconst hasHtmlContent = typeof result.contents !== 'undefined' && result.contents && result.contents.length > 0;\n\treturn hasRange && hasHtmlContent;\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 * as dom from 'vs/base/browser/dom';\nimport { asArray } from 'vs/base/common/arrays';\nimport { AsyncIterableObject } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IMarkdownString, isEmptyMarkdownString, MarkdownString } from 'vs/base/common/htmlContent';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration } from 'vs/editor/common/model';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { getHover } from 'vs/editor/contrib/hover/browser/getHover';\nimport { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport * as nls from 'vs/nls';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nconst $ = dom.$;\n\nexport class MarkdownHover implements IHoverPart {\n\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<MarkdownHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly contents: IMarkdownString[],\n\t\tpublic readonly ordinal: number\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n}\n\nexport class MarkdownHoverParticipant implements IEditorHoverParticipant<MarkdownHover> {\n\n\tpublic readonly hoverOrdinal: number = 2;\n\n\tconstructor(\n\t\tprotected readonly _editor: ICodeEditor,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService protected readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) { }\n\n\tpublic createLoadingMessage(anchor: HoverAnchor): MarkdownHover | null {\n\t\treturn new MarkdownHover(this, anchor.range, [new MarkdownString().appendText(nls.localize('modesContentHover.loading', \"Loading...\"))], 2000);\n\t}\n\n\tpublic computeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): MarkdownHover[] {\n\t\tif (!this._editor.hasModel() || anchor.type !== HoverAnchorType.Range) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst lineNumber = anchor.range.startLineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tconst result: MarkdownHover[] = [];\n\n\t\tlet index = 1000;\n\n\t\tconst lineLength = model.getLineLength(lineNumber);\n\t\tconst languageId = model.getLanguageIdAtPosition(anchor.range.startLineNumber, anchor.range.startColumn);\n\t\tconst maxTokenizationLineLength = this._configurationService.getValue<number>('editor.maxTokenizationLineLength', {\n\t\t\toverrideIdentifier: languageId\n\t\t});\n\t\tif (typeof maxTokenizationLineLength === 'number' && lineLength >= maxTokenizationLineLength) {\n\t\t\tresult.push(new MarkdownHover(this, anchor.range, [{\n\t\t\t\tvalue: nls.localize('too many characters', \"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.\")\n\t\t\t}], index++));\n\t\t}\n\n\t\tfor (const d of lineDecorations) {\n\t\t\tconst startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1;\n\t\t\tconst endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn;\n\n\t\t\tconst hoverMessage = d.options.hoverMessage;\n\t\t\tif (!hoverMessage || isEmptyMarkdownString(hoverMessage)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst range = new Range(anchor.range.startLineNumber, startColumn, anchor.range.startLineNumber, endColumn);\n\t\t\tresult.push(new MarkdownHover(this, range, asArray(hoverMessage), index++));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic computeAsync(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject<MarkdownHover> {\n\t\tif (!this._editor.hasModel() || anchor.type !== HoverAnchorType.Range) {\n\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!this._languageFeaturesService.hoverProvider.has(model)) {\n\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t}\n\n\t\tconst position = new Position(anchor.range.startLineNumber, anchor.range.startColumn);\n\t\treturn getHover(this._languageFeaturesService.hoverProvider, model, position, token)\n\t\t\t.filter(item => !isEmptyMarkdownString(item.hover.contents))\n\t\t\t.map(item => {\n\t\t\t\tconst rng = item.hover.range ? Range.lift(item.hover.range) : anchor.range;\n\t\t\t\treturn new MarkdownHover(this, rng, item.hover.contents, item.ordinal);\n\t\t\t});\n\t}\n\n\tpublic renderHoverParts(context: IEditorHoverRenderContext, hoverParts: MarkdownHover[]): IDisposable {\n\t\treturn renderMarkdownHovers(context, hoverParts, this._editor, this._languageService, this._openerService);\n\t}\n}\n\nexport function renderMarkdownHovers(\n\tcontext: IEditorHoverRenderContext,\n\thoverParts: MarkdownHover[],\n\teditor: ICodeEditor,\n\tlanguageService: ILanguageService,\n\topenerService: IOpenerService,\n): IDisposable {\n\n\t// Sort hover parts to keep them stable since they might come in async, out-of-order\n\thoverParts.sort((a, b) => a.ordinal - b.ordinal);\n\n\tconst disposables = new DisposableStore();\n\tfor (const hoverPart of hoverParts) {\n\t\tfor (const contents of hoverPart.contents) {\n\t\t\tif (isEmptyMarkdownString(contents)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderer = disposables.add(new MarkdownRenderer({ editor }, languageService, openerService));\n\t\t\tdisposables.add(renderer.onDidRenderAsync(() => {\n\t\t\t\thoverContentsElement.className = 'hover-contents code-hover-contents';\n\t\t\t\tcontext.onContentsChanged();\n\t\t\t}));\n\t\t\tconst renderedContents = disposables.add(renderer.render(contents));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tcontext.fragment.appendChild(markdownHoverElement);\n\t\t}\n\t}\n\treturn disposables;\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 { DisposableStore } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';\nimport { EditorAutoIndentStrategy, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorStateComputerData, IEditOperationBuilder, IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { EndOfLineSequence, ITextModel } from 'vs/editor/common/model';\nimport { StandardTokenType, TextEdit } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService, LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { IndentConsts } from 'vs/editor/common/languages/supports/indentRules';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport * as indentUtils from 'vs/editor/contrib/indentation/browser/indentUtils';\nimport * as nls from 'vs/nls';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\nimport { normalizeIndentation } from 'vs/editor/common/core/indentation';\n\nexport function getReindentEditOperations(model: ITextModel, languageConfigurationService: ILanguageConfigurationService, startLineNumber: number, endLineNumber: number, inheritedIndent?: string): ISingleEditOperation[] {\n\tif (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) {\n\t\t// Model is empty\n\t\treturn [];\n\t}\n\n\tconst indentationRules = languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).indentationRules;\n\tif (!indentationRules) {\n\t\treturn [];\n\t}\n\n\tendLineNumber = Math.min(endLineNumber, model.getLineCount());\n\n\t// Skip `unIndentedLinePattern` lines\n\twhile (startLineNumber <= endLineNumber) {\n\t\tif (!indentationRules.unIndentedLinePattern) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlet text = model.getLineContent(startLineNumber);\n\t\tif (!indentationRules.unIndentedLinePattern.test(text)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tstartLineNumber++;\n\t}\n\n\tif (startLineNumber > endLineNumber - 1) {\n\t\treturn [];\n\t}\n\n\tconst { tabSize, indentSize, insertSpaces } = model.getOptions();\n\tconst shiftIndent = (indentation: string, count?: number) => {\n\t\tcount = count || 1;\n\t\treturn ShiftCommand.shiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces);\n\t};\n\tconst unshiftIndent = (indentation: string, count?: number) => {\n\t\tcount = count || 1;\n\t\treturn ShiftCommand.unshiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces);\n\t};\n\tlet indentEdits: ISingleEditOperation[] = [];\n\n\t// indentation being passed to lines below\n\tlet globalIndent: string;\n\n\t// Calculate indentation for the first line\n\t// If there is no passed-in indentation, we use the indentation of the first line as base.\n\tlet currentLineText = model.getLineContent(startLineNumber);\n\tlet adjustedLineContent = currentLineText;\n\tif (inheritedIndent !== undefined && inheritedIndent !== null) {\n\t\tglobalIndent = inheritedIndent;\n\t\tlet oldIndentation = strings.getLeadingWhitespace(currentLineText);\n\n\t\tadjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length);\n\t\tif (indentationRules.decreaseIndentPattern && indentationRules.decreaseIndentPattern.test(adjustedLineContent)) {\n\t\t\tglobalIndent = unshiftIndent(globalIndent);\n\t\t\tadjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length);\n\n\t\t}\n\t\tif (currentLineText !== adjustedLineContent) {\n\t\t\tindentEdits.push(EditOperation.replaceMove(new Selection(startLineNumber, 1, startLineNumber, oldIndentation.length + 1), normalizeIndentation(globalIndent, indentSize, insertSpaces)));\n\t\t}\n\t} else {\n\t\tglobalIndent = strings.getLeadingWhitespace(currentLineText);\n\t}\n\n\t// idealIndentForNextLine doesn't equal globalIndent when there is a line matching `indentNextLinePattern`.\n\tlet idealIndentForNextLine: string = globalIndent;\n\n\tif (indentationRules.increaseIndentPattern && indentationRules.increaseIndentPattern.test(adjustedLineContent)) {\n\t\tidealIndentForNextLine = shiftIndent(idealIndentForNextLine);\n\t\tglobalIndent = shiftIndent(globalIndent);\n\t}\n\telse if (indentationRules.indentNextLinePattern && indentationRules.indentNextLinePattern.test(adjustedLineContent)) {\n\t\tidealIndentForNextLine = shiftIndent(idealIndentForNextLine);\n\t}\n\n\tstartLineNumber++;\n\n\t// Calculate indentation adjustment for all following lines\n\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\tlet text = model.getLineContent(lineNumber);\n\t\tlet oldIndentation = strings.getLeadingWhitespace(text);\n\t\tlet adjustedLineContent = idealIndentForNextLine + text.substring(oldIndentation.length);\n\n\t\tif (indentationRules.decreaseIndentPattern && indentationRules.decreaseIndentPattern.test(adjustedLineContent)) {\n\t\t\tidealIndentForNextLine = unshiftIndent(idealIndentForNextLine);\n\t\t\tglobalIndent = unshiftIndent(globalIndent);\n\t\t}\n\n\t\tif (oldIndentation !== idealIndentForNextLine) {\n\t\t\tindentEdits.push(EditOperation.replaceMove(new Selection(lineNumber, 1, lineNumber, oldIndentation.length + 1), normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces)));\n\t\t}\n\n\t\t// calculate idealIndentForNextLine\n\t\tif (indentationRules.unIndentedLinePattern && indentationRules.unIndentedLinePattern.test(text)) {\n\t\t\t// In reindent phase, if the line matches `unIndentedLinePattern` we inherit indentation from above lines\n\t\t\t// but don't change globalIndent and idealIndentForNextLine.\n\t\t\tcontinue;\n\t\t} else if (indentationRules.increaseIndentPattern && indentationRules.increaseIndentPattern.test(adjustedLineContent)) {\n\t\t\tglobalIndent = shiftIndent(globalIndent);\n\t\t\tidealIndentForNextLine = globalIndent;\n\t\t} else if (indentationRules.indentNextLinePattern && indentationRules.indentNextLinePattern.test(adjustedLineContent)) {\n\t\t\tidealIndentForNextLine = shiftIndent(idealIndentForNextLine);\n\t\t} else {\n\t\t\tidealIndentForNextLine = globalIndent;\n\t\t}\n\t}\n\n\treturn indentEdits;\n}\n\nexport class IndentationToSpacesAction extends EditorAction {\n\tpublic static readonly ID = 'editor.action.indentationToSpaces';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: IndentationToSpacesAction.ID,\n\t\t\tlabel: nls.localize('indentationToSpaces', \"Convert Indentation to Spaces\"),\n\t\t\talias: 'Convert Indentation to Spaces',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tlet modelOpts = model.getOptions();\n\t\tlet selection = editor.getSelection();\n\t\tif (!selection) {\n\t\t\treturn;\n\t\t}\n\t\tconst command = new IndentationToSpacesCommand(selection, modelOpts.tabSize);\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, [command]);\n\t\teditor.pushUndoStop();\n\n\t\tmodel.updateOptions({\n\t\t\tinsertSpaces: true\n\t\t});\n\t}\n}\n\nexport class IndentationToTabsAction extends EditorAction {\n\tpublic static readonly ID = 'editor.action.indentationToTabs';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: IndentationToTabsAction.ID,\n\t\t\tlabel: nls.localize('indentationToTabs', \"Convert Indentation to Tabs\"),\n\t\t\talias: 'Convert Indentation to Tabs',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tlet modelOpts = model.getOptions();\n\t\tlet selection = editor.getSelection();\n\t\tif (!selection) {\n\t\t\treturn;\n\t\t}\n\t\tconst command = new IndentationToTabsCommand(selection, modelOpts.tabSize);\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, [command]);\n\t\teditor.pushUndoStop();\n\n\t\tmodel.updateOptions({\n\t\t\tinsertSpaces: false\n\t\t});\n\t}\n}\n\nexport class ChangeIndentationSizeAction extends EditorAction {\n\n\tconstructor(private readonly insertSpaces: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\tconst modelService = accessor.get(IModelService);\n\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst creationOpts = modelService.getCreationOptions(model.getLanguageId(), model.uri, model.isForSimpleWidget);\n\t\tconst picks = [1, 2, 3, 4, 5, 6, 7, 8].map(n => ({\n\t\t\tid: n.toString(),\n\t\t\tlabel: n.toString(),\n\t\t\t// add description for tabSize value set in the configuration\n\t\t\tdescription: n === creationOpts.tabSize ? nls.localize('configuredTabSize', \"Configured Tab Size\") : undefined\n\t\t}));\n\n\t\t// auto focus the tabSize set for the current editor\n\t\tconst autoFocusIndex = Math.min(model.getOptions().tabSize - 1, 7);\n\n\t\tsetTimeout(() => {\n\t\t\tquickInputService.pick(picks, { placeHolder: nls.localize({ key: 'selectTabWidth', comment: ['Tab corresponds to the tab key'] }, \"Select Tab Size for Current File\"), activeItem: picks[autoFocusIndex] }).then(pick => {\n\t\t\t\tif (pick) {\n\t\t\t\t\tif (model && !model.isDisposed()) {\n\t\t\t\t\t\tmodel.updateOptions({\n\t\t\t\t\t\t\ttabSize: parseInt(pick.label, 10),\n\t\t\t\t\t\t\tinsertSpaces: this.insertSpaces\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 50/* quick input is sensitive to being opened so soon after another */);\n\t}\n}\n\nexport class IndentUsingTabs extends ChangeIndentationSizeAction {\n\n\tpublic static readonly ID = 'editor.action.indentUsingTabs';\n\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: IndentUsingTabs.ID,\n\t\t\tlabel: nls.localize('indentUsingTabs', \"Indent Using Tabs\"),\n\t\t\talias: 'Indent Using Tabs',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class IndentUsingSpaces extends ChangeIndentationSizeAction {\n\n\tpublic static readonly ID = 'editor.action.indentUsingSpaces';\n\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: IndentUsingSpaces.ID,\n\t\t\tlabel: nls.localize('indentUsingSpaces', \"Indent Using Spaces\"),\n\t\t\talias: 'Indent Using Spaces',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class DetectIndentation extends EditorAction {\n\n\tpublic static readonly ID = 'editor.action.detectIndentation';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DetectIndentation.ID,\n\t\t\tlabel: nls.localize('detectIndentation', \"Detect Indentation from Content\"),\n\t\t\talias: 'Detect Indentation from Content',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst modelService = accessor.get(IModelService);\n\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst creationOpts = modelService.getCreationOptions(model.getLanguageId(), model.uri, model.isForSimpleWidget);\n\t\tmodel.detectIndentation(creationOpts.insertSpaces, creationOpts.tabSize);\n\t}\n}\n\nexport class ReindentLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.reindentlines',\n\t\t\tlabel: nls.localize('editor.reindentlines', \"Reindent Lines\"),\n\t\t\talias: 'Reindent Lines',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tlet edits = getReindentEditOperations(model, languageConfigurationService, 1, model.getLineCount());\n\t\tif (edits.length > 0) {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeEdits(this.id, edits);\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t}\n}\n\nexport class ReindentSelectedLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.reindentselectedlines',\n\t\t\tlabel: nls.localize('editor.reindentselectedlines', \"Reindent Selected Lines\"),\n\t\t\talias: 'Reindent Selected Lines',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\n\t\tlet model = editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet selections = editor.getSelections();\n\t\tif (selections === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet edits: ISingleEditOperation[] = [];\n\n\t\tfor (let selection of selections) {\n\t\t\tlet startLineNumber = selection.startLineNumber;\n\t\t\tlet endLineNumber = selection.endLineNumber;\n\n\t\t\tif (startLineNumber !== endLineNumber && selection.endColumn === 1) {\n\t\t\t\tendLineNumber--;\n\t\t\t}\n\n\t\t\tif (startLineNumber === 1) {\n\t\t\t\tif (startLineNumber === endLineNumber) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstartLineNumber--;\n\t\t\t}\n\n\t\t\tlet editOperations = getReindentEditOperations(model, languageConfigurationService, startLineNumber, endLineNumber);\n\t\t\tedits.push(...editOperations);\n\t\t}\n\n\t\tif (edits.length > 0) {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeEdits(this.id, edits);\n\t\t\teditor.pushUndoStop();\n\t\t}\n\t}\n}\n\nexport class AutoIndentOnPasteCommand implements ICommand {\n\n\tprivate readonly _edits: { range: IRange; text: string; eol?: EndOfLineSequence }[];\n\n\tprivate readonly _initialSelection: Selection;\n\tprivate _selectionId: string | null;\n\n\tconstructor(edits: TextEdit[], initialSelection: Selection) {\n\t\tthis._initialSelection = initialSelection;\n\t\tthis._edits = [];\n\t\tthis._selectionId = null;\n\n\t\tfor (let edit of edits) {\n\t\t\tif (edit.range && typeof edit.text === 'string') {\n\t\t\t\tthis._edits.push(edit as { range: IRange; text: string; eol?: EndOfLineSequence });\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tfor (let edit of this._edits) {\n\t\t\tbuilder.addEditOperation(Range.lift(edit.range), edit.text);\n\t\t}\n\n\t\tlet selectionIsSet = false;\n\t\tif (Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty()) {\n\t\t\tif (this._edits[0].range.startColumn === this._initialSelection.endColumn &&\n\t\t\t\tthis._edits[0].range.startLineNumber === this._initialSelection.endLineNumber) {\n\t\t\t\tselectionIsSet = true;\n\t\t\t\tthis._selectionId = builder.trackSelection(this._initialSelection, true);\n\t\t\t} else if (this._edits[0].range.endColumn === this._initialSelection.startColumn &&\n\t\t\t\tthis._edits[0].range.endLineNumber === this._initialSelection.startLineNumber) {\n\t\t\t\tselectionIsSet = true;\n\t\t\t\tthis._selectionId = builder.trackSelection(this._initialSelection, false);\n\t\t\t}\n\t\t}\n\n\t\tif (!selectionIsSet) {\n\t\t\tthis._selectionId = builder.trackSelection(this._initialSelection);\n\t\t}\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this._selectionId!);\n\t}\n}\n\nexport class AutoIndentOnPaste implements IEditorContribution {\n\tpublic static readonly ID = 'editor.contrib.autoIndentOnPaste';\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly callOnDispose = new DisposableStore();\n\tprivate readonly callOnModel = new DisposableStore();\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis.editor = editor;\n\n\t\tthis.callOnDispose.add(editor.onDidChangeConfiguration(() => this.update()));\n\t\tthis.callOnDispose.add(editor.onDidChangeModel(() => this.update()));\n\t\tthis.callOnDispose.add(editor.onDidChangeModelLanguage(() => this.update()));\n\t}\n\n\tprivate update(): void {\n\n\t\t// clean up\n\t\tthis.callOnModel.clear();\n\n\t\t// we are disabled\n\t\tif (this.editor.getOption(EditorOption.autoIndent) < EditorAutoIndentStrategy.Full || this.editor.getOption(EditorOption.formatOnPaste)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// no model\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.callOnModel.add(this.editor.onDidPaste(({ range }) => {\n\t\t\tthis.trigger(range);\n\t\t}));\n\t}\n\n\tprivate trigger(range: Range): void {\n\t\tlet selections = this.editor.getSelections();\n\t\tif (selections === null || selections.length > 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!model.isCheapToTokenize(range.getStartPosition().lineNumber)) {\n\t\t\treturn;\n\t\t}\n\t\tconst autoIndent = this.editor.getOption(EditorOption.autoIndent);\n\t\tconst { tabSize, indentSize, insertSpaces } = model.getOptions();\n\t\tlet textEdits: TextEdit[] = [];\n\n\t\tlet indentConverter = {\n\t\t\tshiftIndent: (indentation: string) => {\n\t\t\t\treturn ShiftCommand.shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces);\n\t\t\t},\n\t\t\tunshiftIndent: (indentation: string) => {\n\t\t\t\treturn ShiftCommand.unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces);\n\t\t\t}\n\t\t};\n\n\t\tlet startLineNumber = range.startLineNumber;\n\n\t\twhile (startLineNumber <= range.endLineNumber) {\n\t\t\tif (this.shouldIgnoreLine(model, startLineNumber)) {\n\t\t\t\tstartLineNumber++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (startLineNumber > range.endLineNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet firstLineText = model.getLineContent(startLineNumber);\n\t\tif (!/\\S/.test(firstLineText.substring(0, range.startColumn - 1))) {\n\t\t\tconst indentOfFirstLine = LanguageConfigurationRegistry.getGoodIndentForLine(autoIndent, model, model.getLanguageId(), startLineNumber, indentConverter);\n\n\t\t\tif (indentOfFirstLine !== null) {\n\t\t\t\tlet oldIndentation = strings.getLeadingWhitespace(firstLineText);\n\t\t\t\tlet newSpaceCnt = indentUtils.getSpaceCnt(indentOfFirstLine, tabSize);\n\t\t\t\tlet oldSpaceCnt = indentUtils.getSpaceCnt(oldIndentation, tabSize);\n\n\t\t\t\tif (newSpaceCnt !== oldSpaceCnt) {\n\t\t\t\t\tlet newIndent = indentUtils.generateIndent(newSpaceCnt, tabSize, insertSpaces);\n\t\t\t\t\ttextEdits.push({\n\t\t\t\t\t\trange: new Range(startLineNumber, 1, startLineNumber, oldIndentation.length + 1),\n\t\t\t\t\t\ttext: newIndent\n\t\t\t\t\t});\n\t\t\t\t\tfirstLineText = newIndent + firstLineText.substr(oldIndentation.length);\n\t\t\t\t} else {\n\t\t\t\t\tlet indentMetadata = LanguageConfigurationRegistry.getIndentMetadata(model, startLineNumber);\n\n\t\t\t\t\tif (indentMetadata === 0 || indentMetadata === IndentConsts.UNINDENT_MASK) {\n\t\t\t\t\t\t// we paste content into a line where only contains whitespaces\n\t\t\t\t\t\t// after pasting, the indentation of the first line is already correct\n\t\t\t\t\t\t// the first line doesn't match any indentation rule\n\t\t\t\t\t\t// then no-op.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst firstLineNumber = startLineNumber;\n\n\t\t// ignore empty or ignored lines\n\t\twhile (startLineNumber < range.endLineNumber) {\n\t\t\tif (!/\\S/.test(model.getLineContent(startLineNumber + 1))) {\n\t\t\t\tstartLineNumber++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (startLineNumber !== range.endLineNumber) {\n\t\t\tlet virtualModel = {\n\t\t\t\tgetLineTokens: (lineNumber: number) => {\n\t\t\t\t\treturn model.getLineTokens(lineNumber);\n\t\t\t\t},\n\t\t\t\tgetLanguageId: () => {\n\t\t\t\t\treturn model.getLanguageId();\n\t\t\t\t},\n\t\t\t\tgetLanguageIdAtPosition: (lineNumber: number, column: number) => {\n\t\t\t\t\treturn model.getLanguageIdAtPosition(lineNumber, column);\n\t\t\t\t},\n\t\t\t\tgetLineContent: (lineNumber: number) => {\n\t\t\t\t\tif (lineNumber === firstLineNumber) {\n\t\t\t\t\t\treturn firstLineText;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn model.getLineContent(lineNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tlet indentOfSecondLine = LanguageConfigurationRegistry.getGoodIndentForLine(autoIndent, virtualModel, model.getLanguageId(), startLineNumber + 1, indentConverter);\n\t\t\tif (indentOfSecondLine !== null) {\n\t\t\t\tlet newSpaceCntOfSecondLine = indentUtils.getSpaceCnt(indentOfSecondLine, tabSize);\n\t\t\t\tlet oldSpaceCntOfSecondLine = indentUtils.getSpaceCnt(strings.getLeadingWhitespace(model.getLineContent(startLineNumber + 1)), tabSize);\n\n\t\t\t\tif (newSpaceCntOfSecondLine !== oldSpaceCntOfSecondLine) {\n\t\t\t\t\tlet spaceCntOffset = newSpaceCntOfSecondLine - oldSpaceCntOfSecondLine;\n\t\t\t\t\tfor (let i = startLineNumber + 1; i <= range.endLineNumber; i++) {\n\t\t\t\t\t\tlet lineContent = model.getLineContent(i);\n\t\t\t\t\t\tlet originalIndent = strings.getLeadingWhitespace(lineContent);\n\t\t\t\t\t\tlet originalSpacesCnt = indentUtils.getSpaceCnt(originalIndent, tabSize);\n\t\t\t\t\t\tlet newSpacesCnt = originalSpacesCnt + spaceCntOffset;\n\t\t\t\t\t\tlet newIndent = indentUtils.generateIndent(newSpacesCnt, tabSize, insertSpaces);\n\n\t\t\t\t\t\tif (newIndent !== originalIndent) {\n\t\t\t\t\t\t\ttextEdits.push({\n\t\t\t\t\t\t\t\trange: new Range(i, 1, i, originalIndent.length + 1),\n\t\t\t\t\t\t\t\ttext: newIndent\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (textEdits.length > 0) {\n\t\t\tthis.editor.pushUndoStop();\n\t\t\tlet cmd = new AutoIndentOnPasteCommand(textEdits, this.editor.getSelection()!);\n\t\t\tthis.editor.executeCommand('autoIndentOnPaste', cmd);\n\t\t\tthis.editor.pushUndoStop();\n\t\t}\n\t}\n\n\tprivate shouldIgnoreLine(model: ITextModel, lineNumber: number): boolean {\n\t\tmodel.forceTokenization(lineNumber);\n\t\tlet nonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\tif (nonWhitespaceColumn === 0) {\n\t\t\treturn true;\n\t\t}\n\t\tlet tokens = model.getLineTokens(lineNumber);\n\t\tif (tokens.getCount() > 0) {\n\t\t\tlet firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhitespaceColumn);\n\t\t\tif (firstNonWhitespaceTokenIndex >= 0 && tokens.getStandardTokenType(firstNonWhitespaceTokenIndex) === StandardTokenType.Comment) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.callOnDispose.dispose();\n\t\tthis.callOnModel.dispose();\n\t}\n}\n\nfunction getIndentationEditOperations(model: ITextModel, builder: IEditOperationBuilder, tabSize: number, tabsToSpaces: boolean): void {\n\tif (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) {\n\t\t// Model is empty\n\t\treturn;\n\t}\n\n\tlet spaces = '';\n\tfor (let i = 0; i < tabSize; i++) {\n\t\tspaces += ' ';\n\t}\n\n\tlet spacesRegExp = new RegExp(spaces, 'gi');\n\n\tfor (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) {\n\t\tlet lastIndentationColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\tif (lastIndentationColumn === 0) {\n\t\t\tlastIndentationColumn = model.getLineMaxColumn(lineNumber);\n\t\t}\n\n\t\tif (lastIndentationColumn === 1) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst originalIndentationRange = new Range(lineNumber, 1, lineNumber, lastIndentationColumn);\n\t\tconst originalIndentation = model.getValueInRange(originalIndentationRange);\n\t\tconst newIndentation = (\n\t\t\ttabsToSpaces\n\t\t\t\t? originalIndentation.replace(/\\t/ig, spaces)\n\t\t\t\t: originalIndentation.replace(spacesRegExp, '\\t')\n\t\t);\n\n\t\tbuilder.addEditOperation(originalIndentationRange, newIndentation);\n\t}\n}\n\nexport class IndentationToSpacesCommand implements ICommand {\n\n\tprivate selectionId: string | null = null;\n\n\tconstructor(private readonly selection: Selection, private tabSize: number) { }\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tthis.selectionId = builder.trackSelection(this.selection);\n\t\tgetIndentationEditOperations(model, builder, this.tabSize, true);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this.selectionId!);\n\t}\n}\n\nexport class IndentationToTabsCommand implements ICommand {\n\n\tprivate selectionId: string | null = null;\n\n\tconstructor(private readonly selection: Selection, private tabSize: number) { }\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tthis.selectionId = builder.trackSelection(this.selection);\n\t\tgetIndentationEditOperations(model, builder, this.tabSize, false);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\treturn helper.getTrackedSelection(this.selectionId!);\n\t}\n}\n\nregisterEditorContribution(AutoIndentOnPaste.ID, AutoIndentOnPaste);\nregisterEditorAction(IndentationToSpacesAction);\nregisterEditorAction(IndentationToTabsAction);\nregisterEditorAction(IndentUsingTabs);\nregisterEditorAction(IndentUsingSpaces);\nregisterEditorAction(DetectIndentation);\nregisterEditorAction(ReindentLinesAction);\nregisterEditorAction(ReindentSelectedLinesAction);\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 { CancelablePromise, createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { commonPrefixLength, commonSuffixLength } from 'vs/base/common/strings';\nimport { CoreEditingCommands } from 'vs/editor/browser/coreCommands';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { EditOperation } from 'vs/editor/common/core/editOperation';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider, InlineCompletionTriggerKind } from 'vs/editor/common/languages';\nimport { BaseGhostTextWidgetModel, GhostText, GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { inlineSuggestCommitId } from 'vs/editor/contrib/inlineCompletions/browser/consts';\nimport { SharedInlineCompletionCache } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextModel';\nimport { inlineCompletionToGhostText, NormalizedInlineCompletion } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionToGhostText';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { fixBracketsInLine } from 'vs/editor/common/model/bracketPairsTextModelPart/fixBrackets';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\n\nexport class InlineCompletionsModel\n\textends Disposable\n\timplements GhostTextWidgetModel {\n\tprotected readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tpublic readonly completionSession = this._register(\n\t\tnew MutableDisposable<InlineCompletionsSession>()\n\t);\n\n\tprivate active: boolean = false;\n\tprivate disposed = false;\n\tprivate readonly debounceValue = this.debounceService.for(\n\t\tthis.languageFeaturesService.inlineCompletionsProvider,\n\t\t'InlineCompletionsDebounce',\n\t\t{ min: 50, max: 200 }\n\t);\n\n\tconstructor(\n\t\tprivate readonly editor: IActiveCodeEditor,\n\t\tprivate readonly cache: SharedInlineCompletionCache,\n\t\t@ICommandService private readonly commandService: ICommandService,\n\t\t@ILanguageConfigurationService\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService\n\t\tprivate readonly languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService\n\t\tprivate readonly debounceService: ILanguageFeatureDebounceService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(\n\t\t\tcommandService.onDidExecuteCommand((e) => {\n\t\t\t\t// These commands don't trigger onDidType.\n\t\t\t\tconst commands = new Set([\n\t\t\t\t\tCoreEditingCommands.Tab.id,\n\t\t\t\t\tCoreEditingCommands.DeleteLeft.id,\n\t\t\t\t\tCoreEditingCommands.DeleteRight.id,\n\t\t\t\t\tinlineSuggestCommitId,\n\t\t\t\t\t'acceptSelectedSuggestion',\n\t\t\t\t]);\n\t\t\t\tif (commands.has(e.commandId) && editor.hasTextFocus()) {\n\t\t\t\t\tthis.handleUserInput();\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tthis._register(\n\t\t\tthis.editor.onDidType((e) => {\n\t\t\t\tthis.handleUserInput();\n\t\t\t})\n\t\t);\n\n\t\tthis._register(\n\t\t\tthis.editor.onDidChangeCursorPosition((e) => {\n\t\t\t\tif (this.session && !this.session.isValid) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tthis._register(\n\t\t\ttoDisposable(() => {\n\t\t\t\tthis.disposed = true;\n\t\t\t})\n\t\t);\n\n\t\tthis._register(\n\t\t\tthis.editor.onDidBlurEditorWidget(() => {\n\t\t\t\tthis.hide();\n\t\t\t})\n\t\t);\n\t}\n\n\tprivate handleUserInput() {\n\t\tif (this.session && !this.session.isValid) {\n\t\t\tthis.hide();\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tif (this.disposed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Wait for the cursor update that happens in the same iteration loop iteration\n\t\t\tthis.startSessionIfTriggered();\n\t\t}, 0);\n\t}\n\n\tprivate get session(): InlineCompletionsSession | undefined {\n\t\treturn this.completionSession.value;\n\t}\n\n\tpublic get ghostText(): GhostText | undefined {\n\t\treturn this.session?.ghostText;\n\t}\n\n\tpublic get minReservedLineCount(): number {\n\t\treturn this.session ? this.session.minReservedLineCount : 0;\n\t}\n\n\tpublic setExpanded(expanded: boolean): void {\n\t\tthis.session?.setExpanded(expanded);\n\t}\n\n\tpublic setActive(active: boolean) {\n\t\tthis.active = active;\n\t\tif (active) {\n\t\t\tthis.session?.scheduleAutomaticUpdate();\n\t\t}\n\t}\n\n\tprivate startSessionIfTriggered(): void {\n\t\tconst suggestOptions = this.editor.getOption(EditorOption.inlineSuggest);\n\t\tif (!suggestOptions.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.session && this.session.isValid) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.trigger(InlineCompletionTriggerKind.Automatic);\n\t}\n\n\tpublic trigger(triggerKind: InlineCompletionTriggerKind): void {\n\t\tif (this.completionSession.value) {\n\t\t\tif (triggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\t\tvoid this.completionSession.value.ensureUpdateWithExplicitContext();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.completionSession.value = new InlineCompletionsSession(\n\t\t\tthis.editor,\n\t\t\tthis.editor.getPosition(),\n\t\t\t() => this.active,\n\t\t\tthis.commandService,\n\t\t\tthis.cache,\n\t\t\ttriggerKind,\n\t\t\tthis.languageConfigurationService,\n\t\t\tthis.languageFeaturesService.inlineCompletionsProvider,\n\t\t\tthis.debounceValue\n\t\t);\n\t\tthis.completionSession.value.takeOwnership(\n\t\t\tthis.completionSession.value.onDidChange(() => {\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t})\n\t\t);\n\t}\n\n\tpublic hide(): void {\n\t\tthis.completionSession.clear();\n\t\tthis.onDidChangeEmitter.fire();\n\t}\n\n\tpublic commitCurrentSuggestion(): void {\n\t\t// Don't dispose the session, so that after committing, more suggestions are shown.\n\t\tthis.session?.commitCurrentCompletion();\n\t}\n\n\tpublic showNext(): void {\n\t\tthis.session?.showNextInlineCompletion();\n\t}\n\n\tpublic showPrevious(): void {\n\t\tthis.session?.showPreviousInlineCompletion();\n\t}\n\n\tpublic async hasMultipleInlineCompletions(): Promise<boolean> {\n\t\tconst result = await this.session?.hasMultipleInlineCompletions();\n\t\treturn result !== undefined ? result : false;\n\t}\n}\n\nexport class InlineCompletionsSession extends BaseGhostTextWidgetModel {\n\tpublic readonly minReservedLineCount = 0;\n\n\tprivate readonly updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\n\tprivate readonly updateSoon = this._register(new RunOnceScheduler(() => {\n\t\tlet triggerKind = this.initialTriggerKind;\n\t\t// All subsequent triggers are automatic.\n\t\tthis.initialTriggerKind = InlineCompletionTriggerKind.Automatic;\n\t\treturn this.update(triggerKind);\n\t}, 50));\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tprivate readonly triggerPosition: Position,\n\t\tprivate readonly shouldUpdate: () => boolean,\n\t\tprivate readonly commandService: ICommandService,\n\t\tprivate readonly cache: SharedInlineCompletionCache,\n\t\tprivate initialTriggerKind: InlineCompletionTriggerKind,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService,\n\t\tprivate readonly registry: LanguageFeatureRegistry<InlineCompletionsProvider>,\n\t\tprivate readonly debounce: IFeatureDebounceInformation,\n\t) {\n\t\tsuper(editor);\n\n\t\tlet lastCompletionItem: InlineCompletion | undefined = undefined;\n\t\tthis._register(this.onDidChange(() => {\n\t\t\tconst currentCompletion = this.currentCompletion;\n\t\t\tif (currentCompletion && currentCompletion.sourceInlineCompletion !== lastCompletionItem) {\n\t\t\t\tlastCompletionItem = currentCompletion.sourceInlineCompletion;\n\n\t\t\t\tconst provider = currentCompletion.sourceProvider;\n\t\t\t\tif (provider.handleItemDidShow) {\n\t\t\t\t\tprovider.handleItemDidShow(currentCompletion.sourceInlineCompletions, lastCompletionItem);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis.cache.clear();\n\t\t}));\n\n\t\tthis._register(this.editor.onDidChangeCursorPosition((e) => {\n\t\t\tif (this.cache.value) {\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.editor.onDidChangeModelContent((e) => {\n\t\t\tthis.scheduleAutomaticUpdate();\n\t\t}));\n\n\t\tthis._register(this.registry.onDidChange(() => {\n\t\t\tthis.updateSoon.schedule(this.debounce.get(this.editor.getModel()));\n\t\t}));\n\n\t\tthis.scheduleAutomaticUpdate();\n\t}\n\n\t//#region Selection\n\n\t// We use a semantic id to track the selection even if the cache changes.\n\tprivate currentlySelectedCompletionId: string | undefined = undefined;\n\n\tprivate fixAndGetIndexOfCurrentSelection(): number {\n\t\tif (!this.currentlySelectedCompletionId || !this.cache.value) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.cache.value.completions.length === 0) {\n\t\t\t// don't reset the selection in this case\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst idx = this.cache.value.completions.findIndex(v => v.semanticId === this.currentlySelectedCompletionId);\n\t\tif (idx === -1) {\n\t\t\t// Reset the selection so that the selection does not jump back when it appears again\n\t\t\tthis.currentlySelectedCompletionId = undefined;\n\t\t\treturn 0;\n\t\t}\n\t\treturn idx;\n\t}\n\n\tprivate get currentCachedCompletion(): CachedInlineCompletion | undefined {\n\t\tif (!this.cache.value) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.cache.value.completions[this.fixAndGetIndexOfCurrentSelection()];\n\t}\n\n\tpublic async showNextInlineCompletion(): Promise<void> {\n\t\tawait this.ensureUpdateWithExplicitContext();\n\n\t\tconst completions = this.cache.value?.completions || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.fixAndGetIndexOfCurrentSelection() + 1) % completions.length;\n\t\t\tthis.currentlySelectedCompletionId = completions[newIdx].semanticId;\n\t\t} else {\n\t\t\tthis.currentlySelectedCompletionId = undefined;\n\t\t}\n\t\tthis.onDidChangeEmitter.fire();\n\t}\n\n\tpublic async showPreviousInlineCompletion(): Promise<void> {\n\t\tawait this.ensureUpdateWithExplicitContext();\n\n\t\tconst completions = this.cache.value?.completions || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.fixAndGetIndexOfCurrentSelection() + completions.length - 1) % completions.length;\n\t\t\tthis.currentlySelectedCompletionId = completions[newIdx].semanticId;\n\t\t} else {\n\t\t\tthis.currentlySelectedCompletionId = undefined;\n\t\t}\n\t\tthis.onDidChangeEmitter.fire();\n\t}\n\n\tpublic async ensureUpdateWithExplicitContext(): Promise<void> {\n\t\tif (this.updateOperation.value) {\n\t\t\t// Restart or wait for current update operation\n\t\t\tif (this.updateOperation.value.triggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\t\tawait this.updateOperation.value.promise;\n\t\t\t} else {\n\t\t\t\tawait this.update(InlineCompletionTriggerKind.Explicit);\n\t\t\t}\n\t\t} else if (this.cache.value?.triggerKind !== InlineCompletionTriggerKind.Explicit) {\n\t\t\t// Refresh cache\n\t\t\tawait this.update(InlineCompletionTriggerKind.Explicit);\n\t\t}\n\t}\n\n\tpublic async hasMultipleInlineCompletions(): Promise<boolean> {\n\t\tawait this.ensureUpdateWithExplicitContext();\n\t\treturn (this.cache.value?.completions.length || 0) > 1;\n\t}\n\n\t//#endregion\n\n\tpublic get ghostText(): GhostText | undefined {\n\t\tconst currentCompletion = this.currentCompletion;\n\t\tconst mode = this.editor.getOptions().get(EditorOption.inlineSuggest).mode;\n\t\treturn currentCompletion ? inlineCompletionToGhostText(currentCompletion, this.editor.getModel(), mode, this.editor.getPosition()) : undefined;\n\t}\n\n\tget currentCompletion(): TrackedInlineCompletion | undefined {\n\t\tconst completion = this.currentCachedCompletion;\n\t\tif (!completion) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn completion.toLiveInlineCompletion();\n\t}\n\n\tget isValid(): boolean {\n\t\treturn this.editor.getPosition().lineNumber === this.triggerPosition.lineNumber;\n\t}\n\n\tpublic scheduleAutomaticUpdate(): void {\n\t\t// Since updateSoon debounces, starvation can happen.\n\t\t// To prevent stale cache, we clear the current update operation.\n\t\tthis.updateOperation.clear();\n\t\tthis.updateSoon.schedule(this.debounce.get(this.editor.getModel()));\n\t}\n\n\tprivate async update(triggerKind: InlineCompletionTriggerKind): Promise<void> {\n\t\tif (!this.shouldUpdate()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = this.editor.getPosition();\n\n\t\tconst startTime = new Date();\n\n\t\tconst promise = createCancelablePromise(async token => {\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await provideInlineCompletions(this.registry, position,\n\t\t\t\t\tthis.editor.getModel(),\n\t\t\t\t\t{ triggerKind, selectedSuggestionInfo: undefined },\n\t\t\t\t\ttoken,\n\t\t\t\t\tthis.languageConfigurationService\n\t\t\t\t);\n\n\t\t\t\tconst endTime = new Date();\n\t\t\t\tthis.debounce.update(this.editor.getModel(), endTime.getTime() - startTime.getTime());\n\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.cache.setValue(\n\t\t\t\tthis.editor,\n\t\t\t\tresult,\n\t\t\t\ttriggerKind\n\t\t\t);\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t});\n\t\tconst operation = new UpdateOperation(promise, triggerKind);\n\t\tthis.updateOperation.value = operation;\n\t\tawait promise;\n\t\tif (this.updateOperation.value === operation) {\n\t\t\tthis.updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic takeOwnership(disposable: IDisposable): void {\n\t\tthis._register(disposable);\n\t}\n\n\tpublic commitCurrentCompletion(): void {\n\t\tif (!this.ghostText) {\n\t\t\t// No ghost text was shown for this completion.\n\t\t\t// Thus, we don't want to commit anything.\n\t\t\treturn;\n\t\t}\n\t\tconst completion = this.currentCompletion;\n\t\tif (completion) {\n\t\t\tthis.commit(completion);\n\t\t}\n\t}\n\n\tpublic commit(completion: TrackedInlineCompletion): void {\n\t\t// Mark the cache as stale, but don't dispose it yet,\n\t\t// otherwise command args might get disposed.\n\t\tconst cache = this.cache.clearAndLeak();\n\n\t\tthis.editor.executeEdits(\n\t\t\t'inlineSuggestion.accept',\n\t\t\t[\n\t\t\t\tEditOperation.replaceMove(completion.range, completion.text)\n\t\t\t]\n\t\t);\n\t\tif (completion.command) {\n\t\t\tthis.commandService\n\t\t\t\t.executeCommand(completion.command.id, ...(completion.command.arguments || []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tcache?.dispose();\n\t\t\t\t})\n\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t} else {\n\t\t\tcache?.dispose();\n\t\t}\n\n\t\tthis.onDidChangeEmitter.fire();\n\t}\n}\n\nexport class UpdateOperation implements IDisposable {\n\tconstructor(public readonly promise: CancelablePromise<void>, public readonly triggerKind: InlineCompletionTriggerKind) {\n\t}\n\n\tdispose() {\n\t\tthis.promise.cancel();\n\t}\n}\n\n/**\n * The cache keeps itself in sync with the editor.\n * It also owns the completions result and disposes it when the cache is diposed.\n*/\nexport class SynchronizedInlineCompletionsCache extends Disposable {\n\tpublic readonly completions: readonly CachedInlineCompletion[];\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tcompletionsSource: TrackedInlineCompletions,\n\t\tonChange: () => void,\n\t\tpublic readonly triggerKind: InlineCompletionTriggerKind,\n\t) {\n\t\tsuper();\n\n\t\tconst decorationIds = editor.deltaDecorations(\n\t\t\t[],\n\t\t\tcompletionsSource.items.map(i => ({\n\t\t\t\trange: i.range,\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'inline-completion-tracking-range'\n\t\t\t\t},\n\t\t\t}))\n\t\t);\n\t\tthis._register(toDisposable(() => {\n\t\t\teditor.deltaDecorations(decorationIds, []);\n\t\t}));\n\n\t\tthis.completions = completionsSource.items.map((c, idx) => new CachedInlineCompletion(c, decorationIds[idx]));\n\n\t\tthis._register(editor.onDidChangeModelContent(() => {\n\t\t\tlet hasChanged = false;\n\t\t\tconst model = editor.getModel();\n\t\t\tfor (const c of this.completions) {\n\t\t\t\tconst newRange = model.getDecorationRange(c.decorationId);\n\t\t\t\tif (!newRange) {\n\t\t\t\t\tonUnexpectedError(new Error('Decoration has no range'));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!c.synchronizedRange.equalsRange(newRange)) {\n\t\t\t\t\thasChanged = true;\n\t\t\t\t\tc.synchronizedRange = newRange;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasChanged) {\n\t\t\t\tonChange();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(completionsSource);\n\t}\n}\n\nclass CachedInlineCompletion {\n\tpublic readonly semanticId: string = JSON.stringify({\n\t\ttext: this.inlineCompletion.text,\n\t\tstartLine: this.inlineCompletion.range.startLineNumber,\n\t\tstartColumn: this.inlineCompletion.range.startColumn,\n\t\tcommand: this.inlineCompletion.command\n\t});\n\n\t/**\n\t * The range, synchronized with text model changes.\n\t*/\n\tpublic synchronizedRange: Range;\n\n\tconstructor(\n\t\tpublic readonly inlineCompletion: TrackedInlineCompletion,\n\t\tpublic readonly decorationId: string,\n\t) {\n\t\tthis.synchronizedRange = inlineCompletion.range;\n\t}\n\n\tpublic toLiveInlineCompletion(): TrackedInlineCompletion | undefined {\n\t\treturn {\n\t\t\ttext: this.inlineCompletion.text,\n\t\t\trange: this.synchronizedRange,\n\t\t\tcommand: this.inlineCompletion.command,\n\t\t\tsourceProvider: this.inlineCompletion.sourceProvider,\n\t\t\tsourceInlineCompletions: this.inlineCompletion.sourceInlineCompletions,\n\t\t\tsourceInlineCompletion: this.inlineCompletion.sourceInlineCompletion,\n\t\t};\n\t}\n}\n\n/**\n * A normalized inline completion that tracks which inline completion it has been constructed from.\n*/\nexport interface TrackedInlineCompletion extends NormalizedInlineCompletion {\n\tsourceProvider: InlineCompletionsProvider;\n\n\t/**\n\t * A reference to the original inline completion this inline completion has been constructed from.\n\t * Used for event data to ensure referential equality.\n\t*/\n\tsourceInlineCompletion: InlineCompletion;\n\n\t/**\n\t * A reference to the original inline completion list this inline completion has been constructed from.\n\t * Used for event data to ensure referential equality.\n\t*/\n\tsourceInlineCompletions: InlineCompletions;\n}\n\n/**\n * Contains no duplicated items.\n*/\nexport interface TrackedInlineCompletions extends InlineCompletions<TrackedInlineCompletion> {\n\tdispose(): void;\n}\n\nfunction getDefaultRange(position: Position, model: ITextModel): Range {\n\tconst word = model.getWordAtPosition(position);\n\tconst maxColumn = model.getLineMaxColumn(position.lineNumber);\n\t// By default, always replace up until the end of the current line.\n\t// This default might be subject to change!\n\treturn word\n\t\t? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n\t\t: Range.fromPositions(position, position.with(undefined, maxColumn));\n}\n\nexport async function provideInlineCompletions(\n\tregistry: LanguageFeatureRegistry<InlineCompletionsProvider>,\n\tposition: Position,\n\tmodel: ITextModel,\n\tcontext: InlineCompletionContext,\n\ttoken: CancellationToken = CancellationToken.None,\n\tlanguageConfigurationService?: ILanguageConfigurationService\n): Promise<TrackedInlineCompletions> {\n\tconst defaultReplaceRange = getDefaultRange(position, model);\n\n\tconst providers = registry.all(model);\n\tconst results = await Promise.all(\n\t\tproviders.map(\n\t\t\tasync provider => {\n\t\t\t\tconst completions = await Promise.resolve(provider.provideInlineCompletions(model, position, context, token)).catch(onUnexpectedExternalError);\n\t\t\t\treturn ({\n\t\t\t\t\tcompletions,\n\t\t\t\t\tprovider,\n\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\tif (completions) {\n\t\t\t\t\t\t\tprovider.freeInlineCompletions(completions);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t)\n\t);\n\n\tconst itemsByHash = new Map<string, TrackedInlineCompletion>();\n\tfor (const result of results) {\n\t\tconst completions = result.completions;\n\t\tif (completions) {\n\t\t\tfor (const item of completions.items) {\n\t\t\t\tconst range = item.range ? Range.lift(item.range) : defaultReplaceRange;\n\n\t\t\t\tif (range.startLineNumber !== range.endLineNumber) {\n\t\t\t\t\t// Ignore invalid ranges.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst text =\n\t\t\t\t\tlanguageConfigurationService && item.completeBracketPairs\n\t\t\t\t\t\t? closeBrackets(\n\t\t\t\t\t\t\titem.text,\n\t\t\t\t\t\t\trange.getStartPosition(),\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tlanguageConfigurationService\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: item.text;\n\n\t\t\t\tconst trackedItem: TrackedInlineCompletion = ({\n\t\t\t\t\ttext,\n\t\t\t\t\trange,\n\t\t\t\t\tcommand: item.command,\n\t\t\t\t\tsourceProvider: result.provider,\n\t\t\t\t\tsourceInlineCompletions: completions,\n\t\t\t\t\tsourceInlineCompletion: item\n\t\t\t\t});\n\n\t\t\t\titemsByHash.set(JSON.stringify({ text, range: item.range }), trackedItem);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\titems: [...itemsByHash.values()],\n\t\tdispose: () => {\n\t\t\tfor (const result of results) {\n\t\t\t\tresult.dispose();\n\t\t\t}\n\t\t},\n\t};\n}\n\nfunction closeBrackets(text: string, position: Position, model: ITextModel, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst lineStart = model.getLineContent(position.lineNumber).substring(0, position.column - 1);\n\tconst newLine = lineStart + text;\n\n\tconst newTokens = model.tokenizeLineWithEdit(position, newLine.length - (position.column - 1), text);\n\tconst slicedTokens = newTokens?.sliceAndInflate(position.column - 1, newLine.length, 0);\n\tif (!slicedTokens) {\n\t\treturn text;\n\t}\n\n\tconsole.log(slicedTokens);\n\tconst newText = fixBracketsInLine(slicedTokens, languageConfigurationService);\n\n\treturn newText;\n}\n\n/**\n * Shrinks the range if the text has a suffix/prefix that agrees with the text buffer.\n * E.g. text buffer: `ab[cdef]ghi`, [...] is the replace range, `cxyzf` is the new text.\n * Then the minimized inline completion has range `abc[de]fghi` and text `xyz`.\n */\nexport function minimizeInlineCompletion(model: ITextModel, inlineCompletion: NormalizedInlineCompletion): NormalizedInlineCompletion;\nexport function minimizeInlineCompletion(model: ITextModel, inlineCompletion: NormalizedInlineCompletion | undefined): NormalizedInlineCompletion | undefined;\nexport function minimizeInlineCompletion(model: ITextModel, inlineCompletion: NormalizedInlineCompletion | undefined): NormalizedInlineCompletion | undefined {\n\tif (!inlineCompletion) {\n\t\treturn inlineCompletion;\n\t}\n\tconst valueToReplace = model.getValueInRange(inlineCompletion.range);\n\tconst commonPrefixLen = commonPrefixLength(valueToReplace, inlineCompletion.text);\n\tconst startOffset = model.getOffsetAt(inlineCompletion.range.getStartPosition()) + commonPrefixLen;\n\tconst start = model.getPositionAt(startOffset);\n\n\tconst remainingValueToReplace = valueToReplace.substr(commonPrefixLen);\n\tconst commonSuffixLen = commonSuffixLength(remainingValueToReplace, inlineCompletion.text);\n\tconst end = model.getPositionAt(Math.max(startOffset, model.getOffsetAt(inlineCompletion.range.getEndPosition()) - commonSuffixLen));\n\n\treturn {\n\t\trange: Range.fromPositions(start, end),\n\t\ttext: inlineCompletion.text.substr(commonPrefixLen, inlineCompletion.text.length - commonPrefixLen - commonSuffixLen),\n\t};\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport * as nls from 'vs/nls';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class ExpandLineSelectionAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'expandLineSelection',\n\t\t\tlabel: nls.localize('expandLineSelection', \"Expand Line Selection\"),\n\t\t\talias: 'Expand Line Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyL\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\targs = args || {};\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst viewModel = editor._getViewModel();\n\t\tviewModel.model.pushStackElement();\n\t\tviewModel.setCursorStates(\n\t\t\targs.source,\n\t\t\tCursorChangeReason.Explicit,\n\t\t\tCursorMoveCommands.expandLineSelection(viewModel, viewModel.getCursorStates())\n\t\t);\n\t\tviewModel.revealPrimaryCursor(args.source, true);\n\t}\n}\n\nregisterEditorAction(ExpandLineSelectionAction);\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 { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { CoreEditingCommands } from 'vs/editor/browser/coreCommands';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection, ReplaceCommandThatSelectsText } from 'vs/editor/common/commands/replaceCommand';\nimport { TrimTrailingWhitespaceCommand } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CopyLinesCommand } from 'vs/editor/contrib/linesOperations/browser/copyLinesCommand';\nimport { MoveLinesCommand } from 'vs/editor/contrib/linesOperations/browser/moveLinesCommand';\nimport { SortLinesCommand } from 'vs/editor/contrib/linesOperations/browser/sortLinesCommand';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\n// copy lines\n\nabstract class AbstractCopyLinesAction extends EditorAction {\n\n\tprivate readonly down: boolean;\n\n\tconstructor(down: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.down = down;\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections().map((selection, index) => ({ selection, index, ignore: false }));\n\t\tselections.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection));\n\n\t\t// Remove selections that would result in copying the same line\n\t\tlet prev = selections[0];\n\t\tfor (let i = 1; i < selections.length; i++) {\n\t\t\tconst curr = selections[i];\n\t\t\tif (prev.selection.endLineNumber === curr.selection.startLineNumber) {\n\t\t\t\t// these two selections would copy the same line\n\t\t\t\tif (prev.index < curr.index) {\n\t\t\t\t\t// prev wins\n\t\t\t\t\tcurr.ignore = true;\n\t\t\t\t} else {\n\t\t\t\t\t// curr wins\n\t\t\t\t\tprev.ignore = true;\n\t\t\t\t\tprev = curr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new CopyLinesCommand(selection.selection, this.down, selection.ignore));\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nclass CopyLinesUpAction extends AbstractCopyLinesAction {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.copyLinesUpAction',\n\t\t\tlabel: nls.localize('lines.copyUp', \"Copy Line Up\"),\n\t\t\talias: 'Copy Line Up',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '2_line',\n\t\t\t\ttitle: nls.localize({ key: 'miCopyLinesUp', comment: ['&& denotes a mnemonic'] }, \"&&Copy Line Up\"),\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass CopyLinesDownAction extends AbstractCopyLinesAction {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.copyLinesDownAction',\n\t\t\tlabel: nls.localize('lines.copyDown', \"Copy Line Down\"),\n\t\t\talias: 'Copy Line Down',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '2_line',\n\t\t\t\ttitle: nls.localize({ key: 'miCopyLinesDown', comment: ['&& denotes a mnemonic'] }, \"Co&&py Line Down\"),\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class DuplicateSelectionAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.duplicateSelection',\n\t\t\tlabel: nls.localize('duplicateSelection', \"Duplicate Selection\"),\n\t\t\talias: 'Duplicate Selection',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '2_line',\n\t\t\t\ttitle: nls.localize({ key: 'miDuplicateSelection', comment: ['&& denotes a mnemonic'] }, \"&&Duplicate Selection\"),\n\t\t\t\torder: 5\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tconst selections = editor.getSelections();\n\t\tconst model = editor.getModel();\n\n\t\tfor (const selection of selections) {\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tcommands.push(new CopyLinesCommand(selection, true));\n\t\t\t} else {\n\t\t\t\tconst insertSelection = new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn);\n\t\t\t\tcommands.push(new ReplaceCommandThatSelectsText(insertSelection, model.getValueInRange(selection)));\n\t\t\t}\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\n// move lines\n\nabstract class AbstractMoveLinesAction extends EditorAction {\n\n\tprivate readonly down: boolean;\n\n\tconstructor(down: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.down = down;\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\n\t\tlet commands: ICommand[] = [];\n\t\tlet selections = editor.getSelections() || [];\n\t\tconst autoIndent = editor.getOption(EditorOption.autoIndent);\n\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new MoveLinesCommand(selection, this.down, autoIndent));\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nclass MoveLinesUpAction extends AbstractMoveLinesAction {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.moveLinesUpAction',\n\t\t\tlabel: nls.localize('lines.moveUp', \"Move Line Up\"),\n\t\t\talias: 'Move Line Up',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.UpArrow,\n\t\t\t\tlinux: { primary: KeyMod.Alt | KeyCode.UpArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '2_line',\n\t\t\t\ttitle: nls.localize({ key: 'miMoveLinesUp', comment: ['&& denotes a mnemonic'] }, \"Mo&&ve Line Up\"),\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass MoveLinesDownAction extends AbstractMoveLinesAction {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.moveLinesDownAction',\n\t\t\tlabel: nls.localize('lines.moveDown', \"Move Line Down\"),\n\t\t\talias: 'Move Line Down',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.DownArrow,\n\t\t\t\tlinux: { primary: KeyMod.Alt | KeyCode.DownArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '2_line',\n\t\t\t\ttitle: nls.localize({ key: 'miMoveLinesDown', comment: ['&& denotes a mnemonic'] }, \"Move &&Line Down\"),\n\t\t\t\torder: 4\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport abstract class AbstractSortLinesAction extends EditorAction {\n\tprivate readonly descending: boolean;\n\n\tconstructor(descending: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.descending = descending;\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst selections = editor.getSelections() || [];\n\n\t\tfor (const selection of selections) {\n\t\t\tif (!SortLinesCommand.canRun(editor.getModel(), selection, this.descending)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new SortLinesCommand(selections[i], this.descending);\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nexport class SortLinesAscendingAction extends AbstractSortLinesAction {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.sortLinesAscending',\n\t\t\tlabel: nls.localize('lines.sortAscending', \"Sort Lines Ascending\"),\n\t\t\talias: 'Sort Lines Ascending',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class SortLinesDescendingAction extends AbstractSortLinesAction {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.sortLinesDescending',\n\t\t\tlabel: nls.localize('lines.sortDescending', \"Sort Lines Descending\"),\n\t\t\talias: 'Sort Lines Descending',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class DeleteDuplicateLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.removeDuplicateLines',\n\t\t\tlabel: nls.localize('lines.deleteDuplicates', \"Delete Duplicate Lines\"),\n\t\t\talias: 'Delete Duplicate Lines',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet model: ITextModel = editor.getModel();\n\t\tif (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet edits: ISingleEditOperation[] = [];\n\t\tlet endCursorState: Selection[] = [];\n\n\t\tlet linesDeleted = 0;\n\n\t\tfor (let selection of editor.getSelections()) {\n\t\t\tlet uniqueLines = new Set();\n\t\t\tlet lines = [];\n\n\t\t\tfor (let i = selection.startLineNumber; i <= selection.endLineNumber; i++) {\n\t\t\t\tlet line = model.getLineContent(i);\n\n\t\t\t\tif (uniqueLines.has(line)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlines.push(line);\n\t\t\t\tuniqueLines.add(line);\n\t\t\t}\n\n\n\t\t\tlet selectionToReplace = new Selection(\n\t\t\t\tselection.startLineNumber,\n\t\t\t\t1,\n\t\t\t\tselection.endLineNumber,\n\t\t\t\tmodel.getLineMaxColumn(selection.endLineNumber)\n\t\t\t);\n\n\t\t\tlet adjustedSelectionStart = selection.startLineNumber - linesDeleted;\n\t\t\tlet finalSelection = new Selection(\n\t\t\t\tadjustedSelectionStart,\n\t\t\t\t1,\n\t\t\t\tadjustedSelectionStart + lines.length - 1,\n\t\t\t\tlines[lines.length - 1].length\n\t\t\t);\n\n\t\t\tedits.push(EditOperation.replace(selectionToReplace, lines.join('\\n')));\n\t\t\tendCursorState.push(finalSelection);\n\n\t\t\tlinesDeleted += (selection.endLineNumber - selection.startLineNumber + 1) - lines.length;\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeEdits(this.id, edits, endCursorState);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nexport class TrimTrailingWhitespaceAction extends EditorAction {\n\n\tpublic static readonly ID = 'editor.action.trimTrailingWhitespace';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: TrimTrailingWhitespaceAction.ID,\n\t\t\tlabel: nls.localize('lines.trimTrailingWhitespace', \"Trim Trailing Whitespace\"),\n\t\t\talias: 'Trim Trailing Whitespace',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyX),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\n\t\tlet cursors: Position[] = [];\n\t\tif (args.reason === 'auto-save') {\n\t\t\t// See https://github.com/editorconfig/editorconfig-vscode/issues/47\n\t\t\t// It is very convenient for the editor config extension to invoke this action.\n\t\t\t// So, if we get a reason:'auto-save' passed in, let's preserve cursor positions.\n\t\t\tcursors = (editor.getSelections() || []).map(s => new Position(s.positionLineNumber, s.positionColumn));\n\t\t}\n\n\t\tlet selection = editor.getSelection();\n\t\tif (selection === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet command = new TrimTrailingWhitespaceCommand(selection, cursors);\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, [command]);\n\t\teditor.pushUndoStop();\n\t}\n}\n\n// delete lines\n\ninterface IDeleteLinesOperation {\n\tstartLineNumber: number;\n\tendLineNumber: number;\n\tpositionColumn: number;\n}\n\nexport class DeleteLinesAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.deleteLines',\n\t\t\tlabel: nls.localize('lines.delete', \"Delete Line\"),\n\t\t\talias: 'Delete Line',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyK,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet ops = this._getLinesToRemove(editor);\n\n\t\tlet model: ITextModel = editor.getModel();\n\t\tif (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) {\n\t\t\t// Model is empty\n\t\t\treturn;\n\t\t}\n\n\t\tlet linesDeleted = 0;\n\t\tlet edits: ISingleEditOperation[] = [];\n\t\tlet cursorState: Selection[] = [];\n\t\tfor (let i = 0, len = ops.length; i < len; i++) {\n\t\t\tconst op = ops[i];\n\n\t\t\tlet startLineNumber = op.startLineNumber;\n\t\t\tlet endLineNumber = op.endLineNumber;\n\n\t\t\tlet startColumn = 1;\n\t\t\tlet endColumn = model.getLineMaxColumn(endLineNumber);\n\t\t\tif (endLineNumber < model.getLineCount()) {\n\t\t\t\tendLineNumber += 1;\n\t\t\t\tendColumn = 1;\n\t\t\t} else if (startLineNumber > 1) {\n\t\t\t\tstartLineNumber -= 1;\n\t\t\t\tstartColumn = model.getLineMaxColumn(startLineNumber);\n\t\t\t}\n\n\t\t\tedits.push(EditOperation.replace(new Selection(startLineNumber, startColumn, endLineNumber, endColumn), ''));\n\t\t\tcursorState.push(new Selection(startLineNumber - linesDeleted, op.positionColumn, startLineNumber - linesDeleted, op.positionColumn));\n\t\t\tlinesDeleted += (op.endLineNumber - op.startLineNumber + 1);\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeEdits(this.id, edits, cursorState);\n\t\teditor.pushUndoStop();\n\t}\n\n\tprivate _getLinesToRemove(editor: IActiveCodeEditor): IDeleteLinesOperation[] {\n\t\t// Construct delete operations\n\t\tlet operations: IDeleteLinesOperation[] = editor.getSelections().map((s) => {\n\n\t\t\tlet endLineNumber = s.endLineNumber;\n\t\t\tif (s.startLineNumber < s.endLineNumber && s.endColumn === 1) {\n\t\t\t\tendLineNumber -= 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstartLineNumber: s.startLineNumber,\n\t\t\t\tselectionStartColumn: s.selectionStartColumn,\n\t\t\t\tendLineNumber: endLineNumber,\n\t\t\t\tpositionColumn: s.positionColumn\n\t\t\t};\n\t\t});\n\n\t\t// Sort delete operations\n\t\toperations.sort((a, b) => {\n\t\t\tif (a.startLineNumber === b.startLineNumber) {\n\t\t\t\treturn a.endLineNumber - b.endLineNumber;\n\t\t\t}\n\t\t\treturn a.startLineNumber - b.startLineNumber;\n\t\t});\n\n\t\t// Merge delete operations which are adjacent or overlapping\n\t\tlet mergedOperations: IDeleteLinesOperation[] = [];\n\t\tlet previousOperation = operations[0];\n\t\tfor (let i = 1; i < operations.length; i++) {\n\t\t\tif (previousOperation.endLineNumber + 1 >= operations[i].startLineNumber) {\n\t\t\t\t// Merge current operations into the previous one\n\t\t\t\tpreviousOperation.endLineNumber = operations[i].endLineNumber;\n\t\t\t} else {\n\t\t\t\t// Push previous operation\n\t\t\t\tmergedOperations.push(previousOperation);\n\t\t\t\tpreviousOperation = operations[i];\n\t\t\t}\n\t\t}\n\t\t// Push the last operation\n\t\tmergedOperations.push(previousOperation);\n\n\t\treturn mergedOperations;\n\t}\n}\n\nexport class IndentLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.indentLines',\n\t\t\tlabel: nls.localize('lines.indent', \"Indent Line\"),\n\t\t\talias: 'Indent Line',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.BracketRight,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (!viewModel) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.indent(viewModel.cursorConfig, editor.getModel(), editor.getSelections()));\n\t\teditor.pushUndoStop();\n\t}\n}\n\nclass OutdentLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.outdentLines',\n\t\t\tlabel: nls.localize('lines.outdent', \"Outdent Line\"),\n\t\t\talias: 'Outdent Line',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.BracketLeft,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tCoreEditingCommands.Outdent.runEditorCommand(_accessor, editor, null);\n\t}\n}\n\nexport class InsertLineBeforeAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.insertLineBefore',\n\t\t\tlabel: nls.localize('lines.insertBefore', \"Insert Line Above\"),\n\t\t\talias: 'Insert Line Above',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (!viewModel) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.lineInsertBefore(viewModel.cursorConfig, editor.getModel(), editor.getSelections()));\n\t}\n}\n\nexport class InsertLineAfterAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.insertLineAfter',\n\t\t\tlabel: nls.localize('lines.insertAfter', \"Insert Line Below\"),\n\t\t\talias: 'Insert Line Below',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Enter,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (!viewModel) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.lineInsertAfter(viewModel.cursorConfig, editor.getModel(), editor.getSelections()));\n\t}\n}\n\nexport abstract class AbstractDeleteAllToBoundaryAction extends EditorAction {\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst primaryCursor = editor.getSelection();\n\n\t\tlet rangesToDelete = this._getRangesToDelete(editor);\n\t\t// merge overlapping selections\n\t\tlet effectiveRanges: Range[] = [];\n\n\t\tfor (let i = 0, count = rangesToDelete.length - 1; i < count; i++) {\n\t\t\tlet range = rangesToDelete[i];\n\t\t\tlet nextRange = rangesToDelete[i + 1];\n\n\t\t\tif (Range.intersectRanges(range, nextRange) === null) {\n\t\t\t\teffectiveRanges.push(range);\n\t\t\t} else {\n\t\t\t\trangesToDelete[i + 1] = Range.plusRange(range, nextRange);\n\t\t\t}\n\t\t}\n\n\t\teffectiveRanges.push(rangesToDelete[rangesToDelete.length - 1]);\n\n\t\tlet endCursorState = this._getEndCursorState(primaryCursor, effectiveRanges);\n\n\t\tlet edits: ISingleEditOperation[] = effectiveRanges.map(range => {\n\t\t\treturn EditOperation.replace(range, '');\n\t\t});\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeEdits(this.id, edits, endCursorState);\n\t\teditor.pushUndoStop();\n\t}\n\n\t/**\n\t * Compute the cursor state after the edit operations were applied.\n\t */\n\tprotected abstract _getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[];\n\n\tprotected abstract _getRangesToDelete(editor: IActiveCodeEditor): Range[];\n}\n\nexport class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'deleteAllLeft',\n\t\t\tlabel: nls.localize('lines.deleteAllLeft', \"Delete All Left\"),\n\t\t\talias: 'Delete All Left',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\t_getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {\n\t\tlet endPrimaryCursor: Selection | null = null;\n\t\tlet endCursorState: Selection[] = [];\n\t\tlet deletedLines = 0;\n\n\t\trangesToDelete.forEach(range => {\n\t\t\tlet endCursor;\n\t\t\tif (range.endColumn === 1 && deletedLines > 0) {\n\t\t\t\tlet newStartLine = range.startLineNumber - deletedLines;\n\t\t\t\tendCursor = new Selection(newStartLine, range.startColumn, newStartLine, range.startColumn);\n\t\t\t} else {\n\t\t\t\tendCursor = new Selection(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\n\t\t\t}\n\n\t\t\tdeletedLines += range.endLineNumber - range.startLineNumber;\n\n\t\t\tif (range.intersectRanges(primaryCursor)) {\n\t\t\t\tendPrimaryCursor = endCursor;\n\t\t\t} else {\n\t\t\t\tendCursorState.push(endCursor);\n\t\t\t}\n\t\t});\n\n\t\tif (endPrimaryCursor) {\n\t\t\tendCursorState.unshift(endPrimaryCursor);\n\t\t}\n\n\t\treturn endCursorState;\n\t}\n\n\t_getRangesToDelete(editor: IActiveCodeEditor): Range[] {\n\t\tlet selections = editor.getSelections();\n\t\tif (selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet rangesToDelete: Range[] = selections;\n\t\tlet model = editor.getModel();\n\n\t\tif (model === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\trangesToDelete.sort(Range.compareRangesUsingStarts);\n\t\trangesToDelete = rangesToDelete.map(selection => {\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tif (selection.startColumn === 1) {\n\t\t\t\t\tlet deleteFromLine = Math.max(1, selection.startLineNumber - 1);\n\t\t\t\t\tlet deleteFromColumn = selection.startLineNumber === 1 ? 1 : model.getLineContent(deleteFromLine).length + 1;\n\t\t\t\t\treturn new Range(deleteFromLine, deleteFromColumn, selection.startLineNumber, 1);\n\t\t\t\t} else {\n\t\t\t\t\treturn new Range(selection.startLineNumber, 1, selection.startLineNumber, selection.startColumn);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn new Range(selection.startLineNumber, 1, selection.endLineNumber, selection.endColumn);\n\t\t\t}\n\t\t});\n\n\t\treturn rangesToDelete;\n\t}\n}\n\nexport class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'deleteAllRight',\n\t\t\tlabel: nls.localize('lines.deleteAllRight', \"Delete All Right\"),\n\t\t\talias: 'Delete All Right',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyK, secondary: [KeyMod.CtrlCmd | KeyCode.Delete] },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\t_getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {\n\t\tlet endPrimaryCursor: Selection | null = null;\n\t\tlet endCursorState: Selection[] = [];\n\t\tfor (let i = 0, len = rangesToDelete.length, offset = 0; i < len; i++) {\n\t\t\tlet range = rangesToDelete[i];\n\t\t\tlet endCursor = new Selection(range.startLineNumber - offset, range.startColumn, range.startLineNumber - offset, range.startColumn);\n\n\t\t\tif (range.intersectRanges(primaryCursor)) {\n\t\t\t\tendPrimaryCursor = endCursor;\n\t\t\t} else {\n\t\t\t\tendCursorState.push(endCursor);\n\t\t\t}\n\t\t}\n\n\t\tif (endPrimaryCursor) {\n\t\t\tendCursorState.unshift(endPrimaryCursor);\n\t\t}\n\n\t\treturn endCursorState;\n\t}\n\n\t_getRangesToDelete(editor: IActiveCodeEditor): Range[] {\n\t\tlet model = editor.getModel();\n\t\tif (model === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet selections = editor.getSelections();\n\n\t\tif (selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet rangesToDelete: Range[] = selections.map((sel) => {\n\t\t\tif (sel.isEmpty()) {\n\t\t\t\tconst maxColumn = model.getLineMaxColumn(sel.startLineNumber);\n\n\t\t\t\tif (sel.startColumn === maxColumn) {\n\t\t\t\t\treturn new Range(sel.startLineNumber, sel.startColumn, sel.startLineNumber + 1, 1);\n\t\t\t\t} else {\n\t\t\t\t\treturn new Range(sel.startLineNumber, sel.startColumn, sel.startLineNumber, maxColumn);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sel;\n\t\t});\n\n\t\trangesToDelete.sort(Range.compareRangesUsingStarts);\n\t\treturn rangesToDelete;\n\t}\n}\n\nexport class JoinLinesAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.joinLines',\n\t\t\tlabel: nls.localize('lines.joinLines', \"Join Lines\"),\n\t\t\talias: 'Join Lines',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyJ },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet selections = editor.getSelections();\n\t\tif (selections === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet primaryCursor = editor.getSelection();\n\t\tif (primaryCursor === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tselections.sort(Range.compareRangesUsingStarts);\n\t\tlet reducedSelections: Selection[] = [];\n\n\t\tlet lastSelection = selections.reduce((previousValue, currentValue) => {\n\t\t\tif (previousValue.isEmpty()) {\n\t\t\t\tif (previousValue.endLineNumber === currentValue.startLineNumber) {\n\t\t\t\t\tif (primaryCursor!.equalsSelection(previousValue)) {\n\t\t\t\t\t\tprimaryCursor = currentValue;\n\t\t\t\t\t}\n\t\t\t\t\treturn currentValue;\n\t\t\t\t}\n\n\t\t\t\tif (currentValue.startLineNumber > previousValue.endLineNumber + 1) {\n\t\t\t\t\treducedSelections.push(previousValue);\n\t\t\t\t\treturn currentValue;\n\t\t\t\t} else {\n\t\t\t\t\treturn new Selection(previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentValue.startLineNumber > previousValue.endLineNumber) {\n\t\t\t\t\treducedSelections.push(previousValue);\n\t\t\t\t\treturn currentValue;\n\t\t\t\t} else {\n\t\t\t\t\treturn new Selection(previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treducedSelections.push(lastSelection);\n\n\t\tlet model = editor.getModel();\n\t\tif (model === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet edits: ISingleEditOperation[] = [];\n\t\tlet endCursorState: Selection[] = [];\n\t\tlet endPrimaryCursor = primaryCursor;\n\t\tlet lineOffset = 0;\n\n\t\tfor (let i = 0, len = reducedSelections.length; i < len; i++) {\n\t\t\tlet selection = reducedSelections[i];\n\t\t\tlet startLineNumber = selection.startLineNumber;\n\t\t\tlet startColumn = 1;\n\t\t\tlet columnDeltaOffset = 0;\n\t\t\tlet endLineNumber: number,\n\t\t\t\tendColumn: number;\n\n\t\t\tlet selectionEndPositionOffset = model.getLineContent(selection.endLineNumber).length - selection.endColumn;\n\n\t\t\tif (selection.isEmpty() || selection.startLineNumber === selection.endLineNumber) {\n\t\t\t\tlet position = selection.getStartPosition();\n\t\t\t\tif (position.lineNumber < model.getLineCount()) {\n\t\t\t\t\tendLineNumber = startLineNumber + 1;\n\t\t\t\t\tendColumn = model.getLineMaxColumn(endLineNumber);\n\t\t\t\t} else {\n\t\t\t\t\tendLineNumber = position.lineNumber;\n\t\t\t\t\tendColumn = model.getLineMaxColumn(position.lineNumber);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tendLineNumber = selection.endLineNumber;\n\t\t\t\tendColumn = model.getLineMaxColumn(endLineNumber);\n\t\t\t}\n\n\t\t\tlet trimmedLinesContent = model.getLineContent(startLineNumber);\n\n\t\t\tfor (let i = startLineNumber + 1; i <= endLineNumber; i++) {\n\t\t\t\tlet lineText = model.getLineContent(i);\n\t\t\t\tlet firstNonWhitespaceIdx = model.getLineFirstNonWhitespaceColumn(i);\n\n\t\t\t\tif (firstNonWhitespaceIdx >= 1) {\n\t\t\t\t\tlet insertSpace = true;\n\t\t\t\t\tif (trimmedLinesContent === '') {\n\t\t\t\t\t\tinsertSpace = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (insertSpace && (trimmedLinesContent.charAt(trimmedLinesContent.length - 1) === ' ' ||\n\t\t\t\t\t\ttrimmedLinesContent.charAt(trimmedLinesContent.length - 1) === '\\t')) {\n\t\t\t\t\t\tinsertSpace = false;\n\t\t\t\t\t\ttrimmedLinesContent = trimmedLinesContent.replace(/[\\s\\uFEFF\\xA0]+$/g, ' ');\n\t\t\t\t\t}\n\n\t\t\t\t\tlet lineTextWithoutIndent = lineText.substr(firstNonWhitespaceIdx - 1);\n\n\t\t\t\t\ttrimmedLinesContent += (insertSpace ? ' ' : '') + lineTextWithoutIndent;\n\n\t\t\t\t\tif (insertSpace) {\n\t\t\t\t\t\tcolumnDeltaOffset = lineTextWithoutIndent.length + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumnDeltaOffset = lineTextWithoutIndent.length;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcolumnDeltaOffset = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet deleteSelection = new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\n\t\t\tif (!deleteSelection.isEmpty()) {\n\t\t\t\tlet resultSelection: Selection;\n\n\t\t\t\tif (selection.isEmpty()) {\n\t\t\t\t\tedits.push(EditOperation.replace(deleteSelection, trimmedLinesContent));\n\t\t\t\t\tresultSelection = new Selection(deleteSelection.startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1, startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1);\n\t\t\t\t} else {\n\t\t\t\t\tif (selection.startLineNumber === selection.endLineNumber) {\n\t\t\t\t\t\tedits.push(EditOperation.replace(deleteSelection, trimmedLinesContent));\n\t\t\t\t\t\tresultSelection = new Selection(selection.startLineNumber - lineOffset, selection.startColumn,\n\t\t\t\t\t\t\tselection.endLineNumber - lineOffset, selection.endColumn);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tedits.push(EditOperation.replace(deleteSelection, trimmedLinesContent));\n\t\t\t\t\t\tresultSelection = new Selection(selection.startLineNumber - lineOffset, selection.startColumn,\n\t\t\t\t\t\t\tselection.startLineNumber - lineOffset, trimmedLinesContent.length - selectionEndPositionOffset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Range.intersectRanges(deleteSelection, primaryCursor) !== null) {\n\t\t\t\t\tendPrimaryCursor = resultSelection;\n\t\t\t\t} else {\n\t\t\t\t\tendCursorState.push(resultSelection);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlineOffset += deleteSelection.endLineNumber - deleteSelection.startLineNumber;\n\t\t}\n\n\t\tendCursorState.unshift(endPrimaryCursor);\n\t\teditor.pushUndoStop();\n\t\teditor.executeEdits(this.id, edits, endCursorState);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nexport class TransposeAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transpose',\n\t\t\tlabel: nls.localize('editor.transpose', \"Transpose characters around the cursor\"),\n\t\t\talias: 'Transpose characters around the cursor',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet selections = editor.getSelections();\n\t\tif (selections === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet model = editor.getModel();\n\t\tif (model === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet commands: ICommand[] = [];\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tlet selection = selections[i];\n\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet cursor = selection.getStartPosition();\n\t\t\tlet maxColumn = model.getLineMaxColumn(cursor.lineNumber);\n\n\t\t\tif (cursor.column >= maxColumn) {\n\t\t\t\tif (cursor.lineNumber === model.getLineCount()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The cursor is at the end of current line and current line is not empty\n\t\t\t\t// then we transpose the character before the cursor and the line break if there is any following line.\n\t\t\t\tlet deleteSelection = new Range(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1);\n\t\t\t\tlet chars = model.getValueInRange(deleteSelection).split('').reverse().join('');\n\n\t\t\t\tcommands.push(new ReplaceCommand(new Selection(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1), chars));\n\t\t\t} else {\n\t\t\t\tlet deleteSelection = new Range(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber, cursor.column + 1);\n\t\t\t\tlet chars = model.getValueInRange(deleteSelection).split('').reverse().join('');\n\t\t\t\tcommands.push(new ReplaceCommandThatPreservesSelection(deleteSelection, chars,\n\t\t\t\t\tnew Selection(cursor.lineNumber, cursor.column + 1, cursor.lineNumber, cursor.column + 1)));\n\t\t\t}\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nexport abstract class AbstractCaseAction extends EditorAction {\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst selections = editor.getSelections();\n\t\tif (selections === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = editor.getModel();\n\t\tif (model === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst wordSeparators = editor.getOption(EditorOption.wordSeparators);\n\t\tconst textEdits: ISingleEditOperation[] = [];\n\n\t\tfor (const selection of selections) {\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\tconst cursor = selection.getStartPosition();\n\t\t\t\tconst word = editor.getConfiguredWordAtPosition(cursor);\n\n\t\t\t\tif (!word) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst wordRange = new Range(cursor.lineNumber, word.startColumn, cursor.lineNumber, word.endColumn);\n\t\t\t\tconst text = model.getValueInRange(wordRange);\n\t\t\t\ttextEdits.push(EditOperation.replace(wordRange, this._modifyText(text, wordSeparators)));\n\t\t\t} else {\n\t\t\t\tconst text = model.getValueInRange(selection);\n\t\t\t\ttextEdits.push(EditOperation.replace(selection, this._modifyText(text, wordSeparators)));\n\t\t\t}\n\t\t}\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeEdits(this.id, textEdits);\n\t\teditor.pushUndoStop();\n\t}\n\n\tprotected abstract _modifyText(text: string, wordSeparators: string): string;\n}\n\nexport class UpperCaseAction extends AbstractCaseAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transformToUppercase',\n\t\t\tlabel: nls.localize('editor.transformToUppercase', \"Transform to Uppercase\"),\n\t\t\talias: 'Transform to Uppercase',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tprotected _modifyText(text: string, wordSeparators: string): string {\n\t\treturn text.toLocaleUpperCase();\n\t}\n}\n\nexport class LowerCaseAction extends AbstractCaseAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transformToLowercase',\n\t\t\tlabel: nls.localize('editor.transformToLowercase', \"Transform to Lowercase\"),\n\t\t\talias: 'Transform to Lowercase',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tprotected _modifyText(text: string, wordSeparators: string): string {\n\t\treturn text.toLocaleLowerCase();\n\t}\n}\n\nclass BackwardsCompatibleRegExp {\n\n\tprivate _actual: RegExp | null;\n\tprivate _evaluated: boolean;\n\n\tconstructor(\n\t\tprivate readonly _pattern: string,\n\t\tprivate readonly _flags: string\n\t) {\n\t\tthis._actual = null;\n\t\tthis._evaluated = false;\n\t}\n\n\tpublic get(): RegExp | null {\n\t\tif (!this._evaluated) {\n\t\t\tthis._evaluated = true;\n\t\t\ttry {\n\t\t\t\tthis._actual = new RegExp(this._pattern, this._flags);\n\t\t\t} catch (err) {\n\t\t\t\t// this browser does not support this regular expression\n\t\t\t}\n\t\t}\n\t\treturn this._actual;\n\t}\n\n\tpublic isSupported(): boolean {\n\t\treturn (this.get() !== null);\n\t}\n}\n\nexport class TitleCaseAction extends AbstractCaseAction {\n\n\tpublic static titleBoundary = new BackwardsCompatibleRegExp('(^|[^\\\\p{L}\\\\p{N}\\']|((^|\\\\P{L})\\'))\\\\p{L}', 'gmu');\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transformToTitlecase',\n\t\t\tlabel: nls.localize('editor.transformToTitlecase', \"Transform to Title Case\"),\n\t\t\talias: 'Transform to Title Case',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tprotected _modifyText(text: string, wordSeparators: string): string {\n\t\tconst titleBoundary = TitleCaseAction.titleBoundary.get();\n\t\tif (!titleBoundary) {\n\t\t\t// cannot support this\n\t\t\treturn text;\n\t\t}\n\t\treturn text\n\t\t\t.toLocaleLowerCase()\n\t\t\t.replace(titleBoundary, (b) => b.toLocaleUpperCase());\n\t}\n}\n\nexport class SnakeCaseAction extends AbstractCaseAction {\n\n\tpublic static caseBoundary = new BackwardsCompatibleRegExp('(\\\\p{Ll})(\\\\p{Lu})', 'gmu');\n\tpublic static singleLetters = new BackwardsCompatibleRegExp('(\\\\p{Lu}|\\\\p{N})(\\\\p{Lu})(\\\\p{Ll})', 'gmu');\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.transformToSnakecase',\n\t\t\tlabel: nls.localize('editor.transformToSnakecase', \"Transform to Snake Case\"),\n\t\t\talias: 'Transform to Snake Case',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tprotected _modifyText(text: string, wordSeparators: string): string {\n\t\tconst caseBoundary = SnakeCaseAction.caseBoundary.get();\n\t\tconst singleLetters = SnakeCaseAction.singleLetters.get();\n\t\tif (!caseBoundary || !singleLetters) {\n\t\t\t// cannot support this\n\t\t\treturn text;\n\t\t}\n\t\treturn (text\n\t\t\t.replace(caseBoundary, '$1_$2')\n\t\t\t.replace(singleLetters, '$1_$2$3')\n\t\t\t.toLocaleLowerCase()\n\t\t);\n\t}\n}\n\nregisterEditorAction(CopyLinesUpAction);\nregisterEditorAction(CopyLinesDownAction);\nregisterEditorAction(DuplicateSelectionAction);\nregisterEditorAction(MoveLinesUpAction);\nregisterEditorAction(MoveLinesDownAction);\nregisterEditorAction(SortLinesAscendingAction);\nregisterEditorAction(SortLinesDescendingAction);\nregisterEditorAction(DeleteDuplicateLinesAction);\nregisterEditorAction(TrimTrailingWhitespaceAction);\nregisterEditorAction(DeleteLinesAction);\nregisterEditorAction(IndentLinesAction);\nregisterEditorAction(OutdentLinesAction);\nregisterEditorAction(InsertLineBeforeAction);\nregisterEditorAction(InsertLineAfterAction);\nregisterEditorAction(DeleteAllLeftAction);\nregisterEditorAction(DeleteAllRightAction);\nregisterEditorAction(JoinLinesAction);\nregisterEditorAction(TransposeAction);\nregisterEditorAction(UpperCaseAction);\nregisterEditorAction(LowerCaseAction);\n\nif (SnakeCaseAction.caseBoundary.isSupported() && SnakeCaseAction.singleLetters.isSupported()) {\n\tregisterEditorAction(SnakeCaseAction);\n}\nif (TitleCaseAction.titleBoundary.isSupported()) {\n\tregisterEditorAction(TitleCaseAction);\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./messageController';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorCommand, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport * as nls from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class MessageController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.messageController';\n\n\tstatic readonly MESSAGE_VISIBLE = new RawContextKey<boolean>('messageVisible', false, nls.localize('messageVisible', 'Whether the editor is currently showing an inline message'));\n\n\tstatic get(editor: ICodeEditor): MessageController | null {\n\t\treturn editor.getContribution<MessageController>(MessageController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _visible: IContextKey<boolean>;\n\tprivate readonly _messageWidget = new MutableDisposable<MessageWidget>();\n\tprivate readonly _messageListeners = new DisposableStore();\n\tprivate readonly _editorListener: IDisposable;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\n\t\tthis._editor = editor;\n\t\tthis._visible = MessageController.MESSAGE_VISIBLE.bindTo(contextKeyService);\n\t\tthis._editorListener = this._editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit());\n\t}\n\n\tdispose(): void {\n\t\tthis._editorListener.dispose();\n\t\tthis._messageListeners.dispose();\n\t\tthis._messageWidget.dispose();\n\t\tthis._visible.reset();\n\t}\n\n\tshowMessage(message: string, position: IPosition): void {\n\n\t\talert(message);\n\n\t\tthis._visible.set(true);\n\t\tthis._messageWidget.clear();\n\t\tthis._messageListeners.clear();\n\t\tthis._messageWidget.value = new MessageWidget(this._editor, position, message);\n\n\t\t// close on blur, cursor, model change, dispose\n\t\tthis._messageListeners.add(this._editor.onDidBlurEditorText(() => this.closeMessage()));\n\t\tthis._messageListeners.add(this._editor.onDidChangeCursorPosition(() => this.closeMessage()));\n\t\tthis._messageListeners.add(this._editor.onDidDispose(() => this.closeMessage()));\n\t\tthis._messageListeners.add(this._editor.onDidChangeModel(() => this.closeMessage()));\n\n\t\t// 3sec\n\t\tthis._messageListeners.add(new TimeoutTimer(() => this.closeMessage(), 3000));\n\n\t\t// close on mouse move\n\t\tlet bounds: Range;\n\t\tthis._messageListeners.add(this._editor.onMouseMove(e => {\n\t\t\t// outside the text area\n\t\t\tif (!e.target.position) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!bounds) {\n\t\t\t\t// define bounding box around position and first mouse occurance\n\t\t\t\tbounds = new Range(position.lineNumber - 3, 1, e.target.position.lineNumber + 3, 1);\n\t\t\t} else if (!bounds.containsPosition(e.target.position)) {\n\t\t\t\t// check if position is still in bounds\n\t\t\t\tthis.closeMessage();\n\t\t\t}\n\t\t}));\n\t}\n\n\tcloseMessage(): void {\n\t\tthis._visible.reset();\n\t\tthis._messageListeners.clear();\n\t\tif (this._messageWidget.value) {\n\t\t\tthis._messageListeners.add(MessageWidget.fadeOut(this._messageWidget.value));\n\t\t}\n\t}\n\n\tprivate _onDidAttemptReadOnlyEdit(): void {\n\t\tif (this._editor.hasModel()) {\n\t\t\tthis.showMessage(nls.localize('editor.readonly', \"Cannot edit in read-only editor\"), this._editor.getPosition());\n\t\t}\n\t}\n}\n\nconst MessageCommand = EditorCommand.bindToContribution<MessageController>(MessageController.get);\n\n\nregisterEditorCommand(new MessageCommand({\n\tid: 'leaveEditorMessage',\n\tprecondition: MessageController.MESSAGE_VISIBLE,\n\thandler: c => c.closeMessage(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 30,\n\t\tprimary: KeyCode.Escape\n\t}\n}));\n\nclass MessageWidget implements IContentWidget {\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\treadonly allowEditorOverflow = true;\n\treadonly suppressMouseDown = false;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _position: IPosition;\n\tprivate readonly _domNode: HTMLDivElement;\n\n\tstatic fadeOut(messageWidget: MessageWidget): IDisposable {\n\t\tlet handle: any;\n\t\tconst dispose = () => {\n\t\t\tmessageWidget.dispose();\n\t\t\tclearTimeout(handle);\n\t\t\tmessageWidget.getDomNode().removeEventListener('animationend', dispose);\n\t\t};\n\t\thandle = setTimeout(dispose, 110);\n\t\tmessageWidget.getDomNode().addEventListener('animationend', dispose);\n\t\tmessageWidget.getDomNode().classList.add('fadeOut');\n\t\treturn { dispose };\n\t}\n\n\tconstructor(editor: ICodeEditor, { lineNumber, column }: IPosition, text: string) {\n\n\t\tthis._editor = editor;\n\t\tthis._editor.revealLinesInCenterIfOutsideViewport(lineNumber, lineNumber, ScrollType.Smooth);\n\t\tthis._position = { lineNumber, column: column - 1 };\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.classList.add('monaco-editor-overlaymessage');\n\n\t\tconst anchorTop = document.createElement('div');\n\t\tanchorTop.classList.add('anchor', 'top');\n\t\tthis._domNode.appendChild(anchorTop);\n\n\t\tconst message = document.createElement('div');\n\t\tmessage.classList.add('message');\n\t\tmessage.textContent = text;\n\t\tthis._domNode.appendChild(message);\n\n\t\tconst anchorBottom = document.createElement('div');\n\t\tanchorBottom.classList.add('anchor', 'below');\n\t\tthis._domNode.appendChild(anchorBottom);\n\n\t\tthis._editor.addContentWidget(this);\n\t\tthis._domNode.classList.add('fadeIn');\n\t}\n\n\tdispose() {\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tgetId(): string {\n\t\treturn 'messageoverlay';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tgetPosition(): IContentWidgetPosition {\n\t\treturn { position: this._position, preference: [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW] };\n\t}\n\n\tafterRender(position: ContentWidgetPositionPreference | null): void {\n\t\tthis._domNode.classList.toggle('below', position === ContentWidgetPositionPreference.BELOW);\n\t}\n\n}\n\nregisterEditorContribution(MessageController.ID, MessageController);\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 { IAnchor } from 'vs/base/browser/ui/contextview/contextview';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Lazy } from 'vs/base/common/lazy';\nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { CodeActionTriggerType } from 'vs/editor/common/languages';\nimport { CodeActionItem, CodeActionSet } from 'vs/editor/contrib/codeAction/browser/codeAction';\nimport { MessageController } from 'vs/editor/contrib/message/browser/messageController';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { CodeActionMenu, CodeActionShowOptions } from './codeActionMenu';\nimport { CodeActionsState } from './codeActionModel';\nimport { LightBulbWidget } from './lightBulbWidget';\nimport { CodeActionAutoApply, CodeActionTrigger } from './types';\n\nexport class CodeActionUi extends Disposable {\n\n\tprivate readonly _codeActionWidget: Lazy<CodeActionMenu>;\n\tprivate readonly _lightBulbWidget: Lazy<LightBulbWidget>;\n\tprivate readonly _activeCodeActions = this._register(new MutableDisposable<CodeActionSet>());\n\n\t#disposed = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tquickFixActionId: string,\n\t\tpreferredFixActionId: string,\n\t\tprivate readonly delegate: {\n\t\t\tapplyCodeAction: (action: CodeActionItem, regtriggerAfterApply: boolean) => Promise<void>;\n\t\t},\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._codeActionWidget = new Lazy(() => {\n\t\t\treturn this._register(instantiationService.createInstance(CodeActionMenu, this._editor, {\n\t\t\t\tonSelectCodeAction: async (action) => {\n\t\t\t\t\tthis.delegate.applyCodeAction(action, /* retrigger */ true);\n\t\t\t\t}\n\t\t\t}));\n\t\t});\n\n\t\tthis._lightBulbWidget = new Lazy(() => {\n\t\t\tconst widget = this._register(instantiationService.createInstance(LightBulbWidget, this._editor, quickFixActionId, preferredFixActionId));\n\t\t\tthis._register(widget.onClick(e => this.showCodeActionList(e.trigger, e.actions, e, { includeDisabledActions: false })));\n\t\t\treturn widget;\n\t\t});\n\t}\n\n\toverride dispose() {\n\t\tthis.#disposed = true;\n\t\tsuper.dispose();\n\t}\n\n\tpublic async update(newState: CodeActionsState.State): Promise<void> {\n\t\tif (newState.type !== CodeActionsState.Type.Triggered) {\n\t\t\tthis._lightBulbWidget.rawValue?.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tlet actions: CodeActionSet;\n\t\ttry {\n\t\t\tactions = await newState.actions;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lightBulbWidget.getValue().update(actions, newState.trigger, newState.position);\n\n\t\tif (newState.trigger.type === CodeActionTriggerType.Invoke) {\n\t\t\tif (newState.trigger.filter?.include) { // Triggered for specific scope\n\t\t\t\t// Check to see if we want to auto apply.\n\n\t\t\t\tconst validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions);\n\t\t\t\tif (validActionToApply) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis._lightBulbWidget.getValue().hide();\n\t\t\t\t\t\tawait this.delegate.applyCodeAction(validActionToApply, false);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check to see if there is an action that we would have applied were it not invalid\n\t\t\t\tif (newState.trigger.context) {\n\t\t\t\t\tconst invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions);\n\t\t\t\t\tif (invalidAction && invalidAction.action.disabled) {\n\t\t\t\t\t\tMessageController.get(this._editor)?.showMessage(invalidAction.action.disabled, newState.trigger.context.position);\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst includeDisabledActions = !!newState.trigger.filter?.include;\n\t\t\tif (newState.trigger.context) {\n\t\t\t\tif (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) {\n\t\t\t\t\tMessageController.get(this._editor)?.showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position);\n\t\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t\t\tactions.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._activeCodeActions.value = actions;\n\t\t\tthis._codeActionWidget.getValue().show(newState.trigger, actions, newState.position, { includeDisabledActions });\n\t\t} else {\n\t\t\t// auto magically triggered\n\t\t\tif (this._codeActionWidget.getValue().isVisible) {\n\t\t\t\t// TODO: Figure out if we should update the showing menu?\n\t\t\t\tactions.dispose();\n\t\t\t} else {\n\t\t\t\tthis._activeCodeActions.value = actions;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getInvalidActionThatWouldHaveBeenApplied(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.allActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length === 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.allActions.length === 1)\n\t\t) {\n\t\t\treturn actions.allActions.find(({ action }) => action.disabled);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate tryGetValidActionToApply(trigger: CodeActionTrigger, actions: CodeActionSet): CodeActionItem | undefined {\n\t\tif (!actions.validActions.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ((trigger.autoApply === CodeActionAutoApply.First && actions.validActions.length > 0)\n\t\t\t|| (trigger.autoApply === CodeActionAutoApply.IfSingle && actions.validActions.length === 1)\n\t\t) {\n\t\t\treturn actions.validActions[0];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async showCodeActionList(trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise<void> {\n\t\tthis._codeActionWidget.getValue().show(trigger, actions, at, options);\n\t}\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 { IAnchor } from 'vs/base/browser/ui/contextview/contextview';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Lazy } from 'vs/base/common/lazy';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { IBulkEditService, ResourceEdit } from 'vs/editor/browser/services/bulkEditService';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CodeActionTriggerType } from 'vs/editor/common/languages';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { codeActionCommandId, CodeActionItem, CodeActionSet, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction';\nimport { CodeActionUi } from 'vs/editor/contrib/codeAction/browser/codeActionUi';\nimport { MessageController } from 'vs/editor/contrib/message/browser/messageController';\nimport * as nls from 'vs/nls';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IEditorProgressService } from 'vs/platform/progress/common/progress';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { CodeActionModel, CodeActionsState, SUPPORTED_CODE_ACTIONS } from './codeActionModel';\nimport { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTrigger } from './types';\n\nfunction contextKeyForSupportedActions(kind: CodeActionKind) {\n\treturn ContextKeyExpr.regex(\n\t\tSUPPORTED_CODE_ACTIONS.keys()[0],\n\t\tnew RegExp('(\\\\s|^)' + escapeRegExpCharacters(kind.value) + '\\\\b'));\n}\n\nconst argsSchema: IJSONSchema = {\n\ttype: 'object',\n\tdefaultSnippets: [{ body: { kind: '' } }],\n\tproperties: {\n\t\t'kind': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.kind', \"Kind of the code action to run.\"),\n\t\t},\n\t\t'apply': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.apply', \"Controls when the returned actions are applied.\"),\n\t\t\tdefault: CodeActionAutoApply.IfSingle,\n\t\t\tenum: [CodeActionAutoApply.First, CodeActionAutoApply.IfSingle, CodeActionAutoApply.Never],\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('args.schema.apply.first', \"Always apply the first returned code action.\"),\n\t\t\t\tnls.localize('args.schema.apply.ifSingle', \"Apply the first returned code action if it is the only one.\"),\n\t\t\t\tnls.localize('args.schema.apply.never', \"Do not apply the returned code actions.\"),\n\t\t\t]\n\t\t},\n\t\t'preferred': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: nls.localize('args.schema.preferred', \"Controls if only preferred code actions should be returned.\"),\n\t\t}\n\t}\n};\n\nexport class QuickFixController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.quickFixController';\n\n\tpublic static get(editor: ICodeEditor): QuickFixController | null {\n\t\treturn editor.getContribution<QuickFixController>(QuickFixController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _model: CodeActionModel;\n\tprivate readonly _ui: Lazy<CodeActionUi>;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerService markerService: IMarkerService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IEditorProgressService progressService: IEditorProgressService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService));\n\t\tthis._register(this._model.onDidChangeState(newState => this.update(newState)));\n\n\t\tthis._ui = new Lazy(() =>\n\t\t\tthis._register(new CodeActionUi(editor, QuickFixAction.Id, AutoFixAction.Id, {\n\t\t\t\tapplyCodeAction: async (action, retrigger) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this._applyCodeAction(action);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (retrigger) {\n\t\t\t\t\t\t\tthis._trigger({ type: CodeActionTriggerType.Auto, filter: {} });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this._instantiationService))\n\t\t);\n\t}\n\n\tprivate update(newState: CodeActionsState.State): void {\n\t\tthis._ui.getValue().update(newState);\n\t}\n\n\tpublic showCodeActions(trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition) {\n\t\treturn this._ui.getValue().showCodeActionList(trigger, actions, at, { includeDisabledActions: false });\n\t}\n\n\tpublic manualTriggerAtCurrentPosition(\n\t\tnotAvailableMessage: string,\n\t\tfilter?: CodeActionFilter,\n\t\tautoApply?: CodeActionAutoApply\n\t): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tMessageController.get(this._editor)?.closeMessage();\n\t\tconst triggerPosition = this._editor.getPosition();\n\t\tthis._trigger({ type: CodeActionTriggerType.Invoke, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } });\n\t}\n\n\tprivate _trigger(trigger: CodeActionTrigger) {\n\t\treturn this._model.trigger(trigger);\n\t}\n\n\tprivate _applyCodeAction(action: CodeActionItem): Promise<void> {\n\t\treturn this._instantiationService.invokeFunction(applyCodeAction, action, this._editor);\n\t}\n}\n\nexport async function applyCodeAction(\n\taccessor: ServicesAccessor,\n\titem: CodeActionItem,\n\teditor?: ICodeEditor,\n): Promise<void> {\n\tconst bulkEditService = accessor.get(IBulkEditService);\n\tconst commandService = accessor.get(ICommandService);\n\tconst telemetryService = accessor.get(ITelemetryService);\n\tconst notificationService = accessor.get(INotificationService);\n\n\ttype ApplyCodeActionEvent = {\n\t\tcodeActionTitle: string;\n\t\tcodeActionKind: string | undefined;\n\t\tcodeActionIsPreferred: boolean;\n\t};\n\ttype ApplyCodeEventClassification = {\n\t\tcodeActionTitle: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\tcodeActionKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\tcodeActionIsPreferred: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t};\n\n\ttelemetryService.publicLog2<ApplyCodeActionEvent, ApplyCodeEventClassification>('codeAction.applyCodeAction', {\n\t\tcodeActionTitle: item.action.title,\n\t\tcodeActionKind: item.action.kind,\n\t\tcodeActionIsPreferred: !!item.action.isPreferred,\n\t});\n\n\tawait item.resolve(CancellationToken.None);\n\n\tif (item.action.edit) {\n\t\tawait bulkEditService.apply(ResourceEdit.convert(item.action.edit), { editor, label: item.action.title });\n\t}\n\n\tif (item.action.command) {\n\t\ttry {\n\t\t\tawait commandService.executeCommand(item.action.command.id, ...(item.action.command.arguments || []));\n\t\t} catch (err) {\n\t\t\tconst message = asMessage(err);\n\t\t\tnotificationService.error(\n\t\t\t\ttypeof message === 'string'\n\t\t\t\t\t? message\n\t\t\t\t\t: nls.localize('applyCodeActionFailed', \"An unknown error occurred while applying the code action\"));\n\t\t}\n\t}\n}\n\nfunction asMessage(err: any): string | undefined {\n\tif (typeof err === 'string') {\n\t\treturn err;\n\t} else if (err instanceof Error && typeof err.message === 'string') {\n\t\treturn err.message;\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\nfunction triggerCodeActionsForEditorSelection(\n\teditor: ICodeEditor,\n\tnotAvailableMessage: string,\n\tfilter: CodeActionFilter | undefined,\n\tautoApply: CodeActionAutoApply | undefined\n): void {\n\tif (editor.hasModel()) {\n\t\tconst controller = QuickFixController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.manualTriggerAtCurrentPosition(notAvailableMessage, filter, autoApply);\n\t\t}\n\t}\n}\n\nexport class QuickFixAction extends EditorAction {\n\n\tstatic readonly Id = 'editor.action.quickFix';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: QuickFixAction.Id,\n\t\t\tlabel: nls.localize('quickfix.trigger.label', \"Quick Fix...\"),\n\t\t\talias: 'Quick Fix...',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Period,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"), undefined, undefined);\n\t}\n}\n\nexport class CodeActionCommand extends EditorCommand {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: codeActionCommandId,\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tdescription: {\n\t\t\t\tdescription: 'Trigger a code action',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema, }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic runEditorCommand(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs: any) {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Empty,\n\t\t\tapply: CodeActionAutoApply.IfSingle,\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred.kind', \"No preferred code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage.kind', \"No code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred', \"No preferred code actions available\")\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage', \"No code actions available\"),\n\t\t\t{\n\t\t\t\tinclude: args.kind,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\n\nexport class RefactorAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: refactorCommandId,\n\t\t\tlabel: nls.localize('refactor.label', \"Refactor...\"),\n\t\t\talias: 'Refactor...',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyR,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyR\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Refactor)),\n\t\t\t},\n\t\t\tdescription: {\n\t\t\t\tdescription: 'Refactor...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs: any): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Refactor,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred.kind', \"No preferred refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage.kind', \"No refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred', \"No preferred refactorings available\")\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage', \"No refactorings available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Refactor.contains(args.kind) ? args.kind : CodeActionKind.None,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\nexport class SourceAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: sourceActionCommandId,\n\t\t\tlabel: nls.localize('source.label', \"Source Action...\"),\n\t\t\talias: 'Source Action...',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2.1,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Source)),\n\t\t\t},\n\t\t\tdescription: {\n\t\t\t\tdescription: 'Source Action...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs: any): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Source,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred.kind', \"No preferred source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage.kind', \"No source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred', \"No preferred source actions available\")\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage', \"No source actions available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Source.contains(args.kind) ? args.kind : CodeActionKind.None,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\nexport class OrganizeImportsAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: organizeImportsCommandId,\n\t\t\tlabel: nls.localize('organizeImports.label', \"Organize Imports\"),\n\t\t\talias: 'Organize Imports',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyO,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.organize.noneMessage', \"No organize imports action available\"),\n\t\t\t{ include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle);\n\t}\n}\n\nexport class FixAllAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: fixAllCommandId,\n\t\t\tlabel: nls.localize('fixAll.label', \"Fix All\"),\n\t\t\talias: 'Fix All',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceFixAll))\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('fixAll.noneMessage', \"No fix all action available\"),\n\t\t\t{ include: CodeActionKind.SourceFixAll, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle);\n\t}\n}\n\nexport class AutoFixAction extends EditorAction {\n\n\tstatic readonly Id = 'editor.action.autoFix';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: AutoFixAction.Id,\n\t\t\tlabel: nls.localize('autoFix.label', \"Auto Fix...\"),\n\t\t\talias: 'Auto Fix...',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.QuickFix)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.Period,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Period\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.autoFix.noneMessage', \"No auto fixes available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.QuickFix,\n\t\t\t\tonlyIncludePreferredActions: true\n\t\t\t},\n\t\t\tCodeActionAutoApply.IfSingle);\n\t}\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 { registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, QuickFixController, RefactorAction, SourceAction } from 'vs/editor/contrib/codeAction/browser/codeActionCommands';\n\n\nregisterEditorContribution(QuickFixController.ID, QuickFixController);\nregisterEditorAction(QuickFixAction);\nregisterEditorAction(RefactorAction);\nregisterEditorAction(SourceAction);\nregisterEditorAction(OrganizeImportsAction);\nregisterEditorAction(AutoFixAction);\nregisterEditorAction(FixAllAction);\nregisterEditorCommand(new CodeActionCommand());\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { IdleValue, raceCancellation } from 'vs/base/common/async';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { IBulkEditService, ResourceEdit } from 'vs/editor/browser/services/bulkEditService';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Rejection, RenameLocation, RenameProvider, WorkspaceEdit } from 'vs/editor/common/languages';\nimport { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration';\nimport { MessageController } from 'vs/editor/contrib/message/browser/messageController';\nimport * as nls from 'vs/nls';\nimport { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IEditorProgressService } from 'vs/platform/progress/common/progress';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { CONTEXT_RENAME_INPUT_VISIBLE, RenameInputField } from './renameInputField';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nclass RenameSkeleton {\n\n\tprivate readonly _providers: RenameProvider[];\n\tprivate _providerRenameIdx: number = 0;\n\n\tconstructor(\n\t\tprivate readonly model: ITextModel,\n\t\tprivate readonly position: Position,\n\t\tregistry: LanguageFeatureRegistry<RenameProvider>\n\t) {\n\t\tthis._providers = registry.ordered(model);\n\t}\n\n\thasProvider() {\n\t\treturn this._providers.length > 0;\n\t}\n\n\tasync resolveRenameLocation(token: CancellationToken): Promise<RenameLocation & Rejection | undefined> {\n\n\t\tconst rejects: string[] = [];\n\n\t\tfor (this._providerRenameIdx = 0; this._providerRenameIdx < this._providers.length; this._providerRenameIdx++) {\n\t\t\tconst provider = this._providers[this._providerRenameIdx];\n\t\t\tif (!provider.resolveRenameLocation) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet res = await provider.resolveRenameLocation(this.model, this.position, token);\n\t\t\tif (!res) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (res.rejectReason) {\n\t\t\t\trejects.push(res.rejectReason);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tconst word = this.model.getWordAtPosition(this.position);\n\t\tif (!word) {\n\t\t\treturn {\n\t\t\t\trange: Range.fromPositions(this.position),\n\t\t\t\ttext: '',\n\t\t\t\trejectReason: rejects.length > 0 ? rejects.join('\\n') : undefined\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\trange: new Range(this.position.lineNumber, word.startColumn, this.position.lineNumber, word.endColumn),\n\t\t\ttext: word.word,\n\t\t\trejectReason: rejects.length > 0 ? rejects.join('\\n') : undefined\n\t\t};\n\t}\n\n\tasync provideRenameEdits(newName: string, token: CancellationToken): Promise<WorkspaceEdit & Rejection> {\n\t\treturn this._provideRenameEdits(newName, this._providerRenameIdx, [], token);\n\t}\n\n\tprivate async _provideRenameEdits(newName: string, i: number, rejects: string[], token: CancellationToken): Promise<WorkspaceEdit & Rejection> {\n\t\tconst provider = this._providers[i];\n\t\tif (!provider) {\n\t\t\treturn {\n\t\t\t\tedits: [],\n\t\t\t\trejectReason: rejects.join('\\n')\n\t\t\t};\n\t\t}\n\n\t\tconst result = await provider.provideRenameEdits(this.model, this.position, newName, token);\n\t\tif (!result) {\n\t\t\treturn this._provideRenameEdits(newName, i + 1, rejects.concat(nls.localize('no result', \"No result.\")), token);\n\t\t} else if (result.rejectReason) {\n\t\t\treturn this._provideRenameEdits(newName, i + 1, rejects.concat(result.rejectReason), token);\n\t\t}\n\t\treturn result;\n\t}\n}\n\nexport async function rename(registry: LanguageFeatureRegistry<RenameProvider>, model: ITextModel, position: Position, newName: string): Promise<WorkspaceEdit & Rejection> {\n\tconst skeleton = new RenameSkeleton(model, position, registry);\n\tconst loc = await skeleton.resolveRenameLocation(CancellationToken.None);\n\tif (loc?.rejectReason) {\n\t\treturn { edits: [], rejectReason: loc.rejectReason };\n\t}\n\treturn skeleton.provideRenameEdits(newName, CancellationToken.None);\n}\n\n// --- register actions and commands\n\nclass RenameController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.renameController';\n\n\tstatic get(editor: ICodeEditor): RenameController | null {\n\t\treturn editor.getContribution<RenameController>(RenameController.ID);\n\t}\n\n\tprivate readonly _renameInputField: IdleValue<RenameInputField>;\n\tprivate readonly _dispoableStore = new DisposableStore();\n\tprivate _cts: CancellationTokenSource = new CancellationTokenSource();\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@IEditorProgressService private readonly _progressService: IEditorProgressService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@ITextResourceConfigurationService private readonly _configService: ITextResourceConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tthis._renameInputField = this._dispoableStore.add(new IdleValue(() => this._dispoableStore.add(this._instaService.createInstance(RenameInputField, this.editor, ['acceptRenameInput', 'acceptRenameInputWithPreview']))));\n\t}\n\n\tdispose(): void {\n\t\tthis._dispoableStore.dispose();\n\t\tthis._cts.dispose(true);\n\t}\n\n\tasync run(): Promise<void> {\n\n\t\tthis._cts.dispose(true);\n\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst position = this.editor.getPosition();\n\t\tconst skeleton = new RenameSkeleton(this.editor.getModel(), position, this._languageFeaturesService.renameProvider);\n\n\t\tif (!skeleton.hasProvider()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._cts = new EditorStateCancellationTokenSource(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value);\n\n\t\t// resolve rename location\n\t\tlet loc: RenameLocation & Rejection | undefined;\n\t\ttry {\n\t\t\tconst resolveLocationOperation = skeleton.resolveRenameLocation(this._cts.token);\n\t\t\tthis._progressService.showWhile(resolveLocationOperation, 250);\n\t\t\tloc = await resolveLocationOperation;\n\t\t} catch (e) {\n\t\t\tMessageController.get(this.editor)?.showMessage(e || nls.localize('resolveRenameLocationFailed', \"An unknown error occurred while resolving rename location\"), position);\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (!loc) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (loc.rejectReason) {\n\t\t\tMessageController.get(this.editor)?.showMessage(loc.rejectReason, position);\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._cts.token.isCancellationRequested) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._cts.dispose();\n\t\tthis._cts = new EditorStateCancellationTokenSource(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value, loc.range);\n\n\t\t// do rename at location\n\t\tlet selection = this.editor.getSelection();\n\t\tlet selectionStart = 0;\n\t\tlet selectionEnd = loc.text.length;\n\n\t\tif (!Range.isEmpty(selection) && !Range.spansMultipleLines(selection) && Range.containsRange(loc.range, selection)) {\n\t\t\tselectionStart = Math.max(0, selection.startColumn - loc.range.startColumn);\n\t\t\tselectionEnd = Math.min(loc.range.endColumn, selection.endColumn) - loc.range.startColumn;\n\t\t}\n\n\t\tconst supportPreview = this._bulkEditService.hasPreviewHandler() && this._configService.getValue<boolean>(this.editor.getModel().uri, 'editor.rename.enablePreview');\n\t\tconst inputFieldResult = await this._renameInputField.value.getInput(loc.range, loc.text, selectionStart, selectionEnd, supportPreview, this._cts.token);\n\n\t\t// no result, only hint to focus the editor or not\n\t\tif (typeof inputFieldResult === 'boolean') {\n\t\t\tif (inputFieldResult) {\n\t\t\t\tthis.editor.focus();\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis.editor.focus();\n\n\t\tconst renameOperation = raceCancellation(skeleton.provideRenameEdits(inputFieldResult.newName, this._cts.token), this._cts.token).then(async renameResult => {\n\n\t\t\tif (!renameResult || !this.editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (renameResult.rejectReason) {\n\t\t\t\tthis._notificationService.info(renameResult.rejectReason);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// collapse selection to active end\n\t\t\tthis.editor.setSelection(Range.fromPositions(this.editor.getSelection().getPosition()));\n\n\t\t\tthis._bulkEditService.apply(ResourceEdit.convert(renameResult), {\n\t\t\t\teditor: this.editor,\n\t\t\t\tshowPreview: inputFieldResult.wantsPreview,\n\t\t\t\tlabel: nls.localize('label', \"Renaming '{0}'\", loc?.text),\n\t\t\t\tquotableLabel: nls.localize('quotableLabel', \"Renaming {0}\", loc?.text),\n\t\t\t}).then(result => {\n\t\t\t\tif (result.ariaSummary) {\n\t\t\t\t\talert(nls.localize('aria', \"Successfully renamed '{0}' to '{1}'. Summary: {2}\", loc!.text, inputFieldResult.newName, result.ariaSummary));\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\tthis._notificationService.error(nls.localize('rename.failedApply', \"Rename failed to apply edits\"));\n\t\t\t\tthis._logService.error(err);\n\t\t\t});\n\n\t\t}, err => {\n\t\t\tthis._notificationService.error(nls.localize('rename.failed', \"Rename failed to compute edits\"));\n\t\t\tthis._logService.error(err);\n\t\t});\n\n\t\tthis._progressService.showWhile(renameOperation, 250);\n\t\treturn renameOperation;\n\n\t}\n\n\tacceptRenameInput(wantsPreview: boolean): void {\n\t\tthis._renameInputField.value.acceptInput(wantsPreview);\n\t}\n\n\tcancelRenameInput(): void {\n\t\tthis._renameInputField.value.cancelInput(true);\n\t}\n}\n\n// ---- action implementation\n\nexport class RenameAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.rename',\n\t\t\tlabel: nls.localize('rename.label', \"Rename Symbol\"),\n\t\t\talias: 'Rename Symbol',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyCode.F2,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 1.1\n\t\t\t}\n\t\t});\n\t}\n\n\toverride runCommand(accessor: ServicesAccessor, args: [URI, IPosition]): void | Promise<void> {\n\t\tconst editorService = accessor.get(ICodeEditorService);\n\t\tconst [uri, pos] = Array.isArray(args) && args || [undefined, undefined];\n\n\t\tif (URI.isUri(uri) && Position.isIPosition(pos)) {\n\t\t\treturn editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then(editor => {\n\t\t\t\tif (!editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\teditor.setPosition(pos);\n\t\t\t\teditor.invokeWithinContext(accessor => {\n\t\t\t\t\tthis.reportTelemetry(accessor, editor);\n\t\t\t\t\treturn this.run(accessor, editor);\n\t\t\t\t});\n\t\t\t}, onUnexpectedError);\n\t\t}\n\n\t\treturn super.runCommand(accessor, args);\n\t}\n\n\trun(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = RenameController.get(editor);\n\t\tif (controller) {\n\t\t\treturn controller.run();\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n}\n\nregisterEditorContribution(RenameController.ID, RenameController);\nregisterEditorAction(RenameAction);\n\nconst RenameCommand = EditorCommand.bindToContribution<RenameController>(RenameController.get);\n\nregisterEditorCommand(new RenameCommand({\n\tid: 'acceptRenameInput',\n\tprecondition: CONTEXT_RENAME_INPUT_VISIBLE,\n\thandler: x => x.acceptRenameInput(false),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 99,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.Enter\n\t}\n}));\n\nregisterEditorCommand(new RenameCommand({\n\tid: 'acceptRenameInputWithPreview',\n\tprecondition: ContextKeyExpr.and(CONTEXT_RENAME_INPUT_VISIBLE, ContextKeyExpr.has('config.editor.rename.enablePreview')),\n\thandler: x => x.acceptRenameInput(true),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 99,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyMod.Shift + KeyCode.Enter\n\t}\n}));\n\nregisterEditorCommand(new RenameCommand({\n\tid: 'cancelRenameInput',\n\tprecondition: CONTEXT_RENAME_INPUT_VISIBLE,\n\thandler: x => x.cancelRenameInput(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 99,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\n\n// ---- api bridge command\n\nregisterModelAndPositionCommand('_executeDocumentRenameProvider', function (accessor, model, position, ...args) {\n\tconst [newName] = args;\n\tassertType(typeof newName === 'string');\n\tconst { renameProvider } = accessor.get(ILanguageFeaturesService);\n\treturn rename(renameProvider, model, position, newName);\n});\n\nregisterModelAndPositionCommand('_executePrepareRename', async function (accessor, model, position) {\n\tconst { renameProvider } = accessor.get(ILanguageFeaturesService);\n\tconst skeleton = new RenameSkeleton(model, position, renameProvider);\n\tconst loc = await skeleton.resolveRenameLocation(CancellationToken.None);\n\tif (loc?.rejectReason) {\n\t\tthrow new Error(loc.rejectReason);\n\t}\n\treturn loc;\n});\n\n\n//todo@jrieken use editor options world\nRegistry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({\n\tid: 'editor',\n\tproperties: {\n\t\t'editor.rename.enablePreview': {\n\t\t\tscope: ConfigurationScope.LANGUAGE_OVERRIDABLE,\n\t\t\tdescription: nls.localize('enablePreview', \"Enable/disable the ability to preview changes before renaming\"),\n\t\t\tdefault: true,\n\t\t\ttype: 'boolean'\n\t\t}\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/bracketSelections';\nimport { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/wordSelections';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\n\nclass SelectionRanges {\n\n\tconstructor(\n\t\treadonly index: number,\n\t\treadonly ranges: Range[]\n\t) { }\n\n\tmov(fwd: boolean): SelectionRanges {\n\t\tlet index = this.index + (fwd ? 1 : -1);\n\t\tif (index < 0 || index >= this.ranges.length) {\n\t\t\treturn this;\n\t\t}\n\t\tconst res = new SelectionRanges(index, this.ranges);\n\t\tif (res.ranges[index].equalsRange(this.ranges[this.index])) {\n\t\t\t// next range equals this range, retry with next-next\n\t\t\treturn res.mov(fwd);\n\t\t}\n\t\treturn res;\n\t}\n}\n\nclass SmartSelectController implements IEditorContribution {\n\n\tstatic readonly ID = 'editor.contrib.smartSelectController';\n\n\tstatic get(editor: ICodeEditor): SmartSelectController | null {\n\t\treturn editor.getContribution<SmartSelectController>(SmartSelectController.ID);\n\t}\n\n\tprivate _state?: SelectionRanges[];\n\tprivate _selectionListener?: IDisposable;\n\tprivate _ignoreSelection: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) { }\n\n\tdispose(): void {\n\t\tthis._selectionListener?.dispose();\n\t}\n\n\tasync run(forward: boolean): Promise<void> {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = this._editor.getSelections();\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!this._state) {\n\n\t\t\tawait provideSelectionRanges(this._languageFeaturesService.selectionRangeProvider, model, selections.map(s => s.getPosition()), this._editor.getOption(EditorOption.smartSelect), CancellationToken.None).then(ranges => {\n\t\t\t\tif (!arrays.isNonEmptyArray(ranges) || ranges.length !== selections.length) {\n\t\t\t\t\t// invalid result\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!this._editor.hasModel() || !arrays.equals(this._editor.getSelections(), selections, (a, b) => a.equalsSelection(b))) {\n\t\t\t\t\t// invalid editor state\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < ranges.length; i++) {\n\t\t\t\t\tranges[i] = ranges[i].filter(range => {\n\t\t\t\t\t\t// filter ranges inside the selection\n\t\t\t\t\t\treturn range.containsPosition(selections[i].getStartPosition()) && range.containsPosition(selections[i].getEndPosition());\n\t\t\t\t\t});\n\t\t\t\t\t// prepend current selection\n\t\t\t\t\tranges[i].unshift(selections[i]);\n\t\t\t\t}\n\n\n\t\t\t\tthis._state = ranges.map(ranges => new SelectionRanges(0, ranges));\n\n\t\t\t\t// listen to caret move and forget about state\n\t\t\t\tthis._selectionListener?.dispose();\n\t\t\t\tthis._selectionListener = this._editor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tif (!this._ignoreSelection) {\n\t\t\t\t\t\tthis._selectionListener?.dispose();\n\t\t\t\t\t\tthis._state = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (!this._state) {\n\t\t\t// no state\n\t\t\treturn;\n\t\t}\n\t\tthis._state = this._state.map(state => state.mov(forward));\n\t\tconst newSelections = this._state.map(state => Selection.fromPositions(state.ranges[state.index].getStartPosition(), state.ranges[state.index].getEndPosition()));\n\t\tthis._ignoreSelection = true;\n\t\ttry {\n\t\t\tthis._editor.setSelections(newSelections);\n\t\t} finally {\n\t\t\tthis._ignoreSelection = false;\n\t\t}\n\t}\n}\n\nabstract class AbstractSmartSelect extends EditorAction {\n\n\tprivate readonly _forward: boolean;\n\n\tconstructor(forward: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._forward = forward;\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tlet controller = SmartSelectController.get(editor);\n\t\tif (controller) {\n\t\t\tawait controller.run(this._forward);\n\t\t}\n\t}\n}\n\nclass GrowSelectionAction extends AbstractSmartSelect {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.smartSelect.expand',\n\t\t\tlabel: nls.localize('smartSelect.expand', \"Expand Selection\"),\n\t\t\talias: 'Expand Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow,\n\t\t\t\t\tsecondary: [KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow],\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '1_basic',\n\t\t\t\ttitle: nls.localize({ key: 'miSmartSelectGrow', comment: ['&& denotes a mnemonic'] }, \"&&Expand Selection\"),\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n}\n\n// renamed command id\nCommandsRegistry.registerCommandAlias('editor.action.smartSelect.grow', 'editor.action.smartSelect.expand');\n\nclass ShrinkSelectionAction extends AbstractSmartSelect {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.smartSelect.shrink',\n\t\t\tlabel: nls.localize('smartSelect.shrink', \"Shrink Selection\"),\n\t\t\talias: 'Shrink Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow,\n\t\t\t\t\tsecondary: [KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow],\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '1_basic',\n\t\t\t\ttitle: nls.localize({ key: 'miSmartSelectShrink', comment: ['&& denotes a mnemonic'] }, \"&&Shrink Selection\"),\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n}\n\nregisterEditorContribution(SmartSelectController.ID, SmartSelectController);\nregisterEditorAction(GrowSelectionAction);\nregisterEditorAction(ShrinkSelectionAction);\n\nexport interface SelectionRangesOptions {\n\tselectLeadingAndTrailingWhitespace: boolean;\n}\n\nexport async function provideSelectionRanges(registry: LanguageFeatureRegistry<languages.SelectionRangeProvider>, model: ITextModel, positions: Position[], options: SelectionRangesOptions, token: CancellationToken): Promise<Range[][]> {\n\n\tconst providers = registry.all(model)\n\t\t.concat(new WordSelectionRangeProvider()); // ALWAYS have word based selection range\n\n\tif (providers.length === 1) {\n\t\t// add word selection and bracket selection when no provider exists\n\t\tproviders.unshift(new BracketSelectionRangeProvider());\n\t}\n\n\tlet work: Promise<any>[] = [];\n\tlet allRawRanges: Range[][] = [];\n\n\tfor (const provider of providers) {\n\n\t\twork.push(Promise.resolve(provider.provideSelectionRanges(model, positions, token)).then(allProviderRanges => {\n\t\t\tif (arrays.isNonEmptyArray(allProviderRanges) && allProviderRanges.length === positions.length) {\n\t\t\t\tfor (let i = 0; i < positions.length; i++) {\n\t\t\t\t\tif (!allRawRanges[i]) {\n\t\t\t\t\t\tallRawRanges[i] = [];\n\t\t\t\t\t}\n\t\t\t\t\tfor (const oneProviderRanges of allProviderRanges[i]) {\n\t\t\t\t\t\tif (Range.isIRange(oneProviderRanges.range) && Range.containsPosition(oneProviderRanges.range, positions[i])) {\n\t\t\t\t\t\t\tallRawRanges[i].push(Range.lift(oneProviderRanges.range));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, onUnexpectedExternalError));\n\t}\n\n\tawait Promise.all(work);\n\n\treturn allRawRanges.map(oneRawRanges => {\n\n\t\tif (oneRawRanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// sort all by start/end position\n\t\toneRawRanges.sort((a, b) => {\n\t\t\tif (Position.isBefore(a.getStartPosition(), b.getStartPosition())) {\n\t\t\t\treturn 1;\n\t\t\t} else if (Position.isBefore(b.getStartPosition(), a.getStartPosition())) {\n\t\t\t\treturn -1;\n\t\t\t} else if (Position.isBefore(a.getEndPosition(), b.getEndPosition())) {\n\t\t\t\treturn -1;\n\t\t\t} else if (Position.isBefore(b.getEndPosition(), a.getEndPosition())) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\n\t\t// remove ranges that don't contain the former range or that are equal to the\n\t\t// former range\n\t\tlet oneRanges: Range[] = [];\n\t\tlet last: Range | undefined;\n\t\tfor (const range of oneRawRanges) {\n\t\t\tif (!last || (Range.containsRange(range, last) && !Range.equalsRange(range, last))) {\n\t\t\t\toneRanges.push(range);\n\t\t\t\tlast = range;\n\t\t\t}\n\t\t}\n\n\t\tif (!options.selectLeadingAndTrailingWhitespace) {\n\t\t\treturn oneRanges;\n\t\t}\n\n\t\t// add ranges that expand trivia at line starts and ends whenever a range\n\t\t// wraps onto the a new line\n\t\tlet oneRangesWithTrivia: Range[] = [oneRanges[0]];\n\t\tfor (let i = 1; i < oneRanges.length; i++) {\n\t\t\tconst prev = oneRanges[i - 1];\n\t\t\tconst cur = oneRanges[i];\n\t\t\tif (cur.startLineNumber !== prev.startLineNumber || cur.endLineNumber !== prev.endLineNumber) {\n\t\t\t\t// add line/block range without leading/failing whitespace\n\t\t\t\tconst rangeNoWhitespace = new Range(prev.startLineNumber, model.getLineFirstNonWhitespaceColumn(prev.startLineNumber), prev.endLineNumber, model.getLineLastNonWhitespaceColumn(prev.endLineNumber));\n\t\t\t\tif (rangeNoWhitespace.containsRange(prev) && !rangeNoWhitespace.equalsRange(prev) && cur.containsRange(rangeNoWhitespace) && !cur.equalsRange(rangeNoWhitespace)) {\n\t\t\t\t\toneRangesWithTrivia.push(rangeNoWhitespace);\n\t\t\t\t}\n\t\t\t\t// add line/block range\n\t\t\t\tconst rangeFull = new Range(prev.startLineNumber, 1, prev.endLineNumber, model.getLineMaxColumn(prev.endLineNumber));\n\t\t\t\tif (rangeFull.containsRange(prev) && !rangeFull.equalsRange(rangeNoWhitespace) && cur.containsRange(rangeFull) && !cur.equalsRange(rangeFull)) {\n\t\t\t\t\toneRangesWithTrivia.push(rangeFull);\n\t\t\t\t}\n\t\t\t}\n\t\t\toneRangesWithTrivia.push(cur);\n\t\t}\n\t\treturn oneRangesWithTrivia;\n\t});\n}\n\n\nCommandsRegistry.registerCommand('_executeSelectionRangeProvider', async function (accessor, ...args) {\n\n\tconst [resource, positions] = args;\n\tassertType(URI.isUri(resource));\n\n\tconst registry = accessor.get(ILanguageFeaturesService).selectionRangeProvider;\n\tconst reference = await accessor.get(ITextModelService).createModelReference(resource);\n\n\ttry {\n\t\treturn provideSelectionRanges(registry, reference.object.textEditorModel, positions, { selectLeadingAndTrailingWhitespace: true }, CancellationToken.None);\n\t} finally {\n\t\treference.dispose();\n\t}\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { canceled, isCancellationError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { FuzzyScore } from 'vs/base/common/filters';\nimport { DisposableStore, IDisposable, isDisposable } from 'vs/base/common/lifecycle';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser';\nimport { localize } from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { historyNavigationVisible } from 'vs/platform/history/browser/contextScopedHistoryWidget';\n\nexport const Context = {\n\tVisible: historyNavigationVisible,\n\tDetailsVisible: new RawContextKey<boolean>('suggestWidgetDetailsVisible', false, localize('suggestWidgetDetailsVisible', \"Whether suggestion details are visible\")),\n\tMultipleSuggestions: new RawContextKey<boolean>('suggestWidgetMultipleSuggestions', false, localize('suggestWidgetMultipleSuggestions', \"Whether there are multiple suggestions to pick from\")),\n\tMakesTextEdit: new RawContextKey('suggestionMakesTextEdit', true, localize('suggestionMakesTextEdit', \"Whether inserting the current suggestion yields in a change or has everything already been typed\")),\n\tAcceptSuggestionsOnEnter: new RawContextKey<boolean>('acceptSuggestionOnEnter', true, localize('acceptSuggestionOnEnter', \"Whether suggestions are inserted when pressing Enter\")),\n\tHasInsertAndReplaceRange: new RawContextKey('suggestionHasInsertAndReplaceRange', false, localize('suggestionHasInsertAndReplaceRange', \"Whether the current suggestion has insert and replace behaviour\")),\n\tInsertMode: new RawContextKey<'insert' | 'replace'>('suggestionInsertMode', undefined, { type: 'string', description: localize('suggestionInsertMode', \"Whether the default behaviour is to insert or replace\") }),\n\tCanResolve: new RawContextKey('suggestionCanResolve', false, localize('suggestionCanResolve', \"Whether the current suggestion supports to resolve further details\")),\n};\n\nexport const suggestWidgetStatusbarMenu = new MenuId('suggestWidgetStatusBar');\n\nexport class CompletionItem {\n\n\t//\n\treadonly editStart: IPosition;\n\treadonly editInsertEnd: IPosition;\n\treadonly editReplaceEnd: IPosition;\n\n\t//\n\treadonly textLabel: string;\n\n\t// perf\n\treadonly labelLow: string;\n\treadonly sortTextLow?: string;\n\treadonly filterTextLow?: string;\n\n\t// validation\n\treadonly isInvalid: boolean = false;\n\n\t// sorting, filtering\n\tscore: FuzzyScore = FuzzyScore.Default;\n\tdistance: number = 0;\n\tidx?: number;\n\tword?: string;\n\n\t// resolving\n\tprivate _isResolved?: boolean;\n\tprivate _resolveCache?: Promise<void>;\n\n\tconstructor(\n\t\treadonly position: IPosition,\n\t\treadonly completion: languages.CompletionItem,\n\t\treadonly container: languages.CompletionList,\n\t\treadonly provider: languages.CompletionItemProvider,\n\t) {\n\t\tthis.textLabel = typeof completion.label === 'string'\n\t\t\t? completion.label\n\t\t\t: completion.label.label;\n\n\t\t// ensure lower-variants (perf)\n\t\tthis.labelLow = this.textLabel.toLowerCase();\n\n\t\t// validate label\n\t\tthis.isInvalid = !this.textLabel;\n\n\t\tthis.sortTextLow = completion.sortText && completion.sortText.toLowerCase();\n\t\tthis.filterTextLow = completion.filterText && completion.filterText.toLowerCase();\n\n\t\t// normalize ranges\n\t\tif (Range.isIRange(completion.range)) {\n\t\t\tthis.editStart = new Position(completion.range.startLineNumber, completion.range.startColumn);\n\t\t\tthis.editInsertEnd = new Position(completion.range.endLineNumber, completion.range.endColumn);\n\t\t\tthis.editReplaceEnd = new Position(completion.range.endLineNumber, completion.range.endColumn);\n\n\t\t\t// validate range\n\t\t\tthis.isInvalid = this.isInvalid\n\t\t\t\t|| Range.spansMultipleLines(completion.range) || completion.range.startLineNumber !== position.lineNumber;\n\n\t\t} else {\n\t\t\tthis.editStart = new Position(completion.range.insert.startLineNumber, completion.range.insert.startColumn);\n\t\t\tthis.editInsertEnd = new Position(completion.range.insert.endLineNumber, completion.range.insert.endColumn);\n\t\t\tthis.editReplaceEnd = new Position(completion.range.replace.endLineNumber, completion.range.replace.endColumn);\n\n\t\t\t// validate ranges\n\t\t\tthis.isInvalid = this.isInvalid\n\t\t\t\t|| Range.spansMultipleLines(completion.range.insert) || Range.spansMultipleLines(completion.range.replace)\n\t\t\t\t|| completion.range.insert.startLineNumber !== position.lineNumber || completion.range.replace.startLineNumber !== position.lineNumber\n\t\t\t\t|| completion.range.insert.startColumn !== completion.range.replace.startColumn;\n\t\t}\n\n\t\t// create the suggestion resolver\n\t\tif (typeof provider.resolveCompletionItem !== 'function') {\n\t\t\tthis._resolveCache = Promise.resolve();\n\t\t\tthis._isResolved = true;\n\t\t}\n\t}\n\n\t// ---- resolving\n\n\tget isResolved(): boolean {\n\t\treturn !!this._isResolved;\n\t}\n\n\tasync resolve(token: CancellationToken) {\n\t\tif (!this._resolveCache) {\n\t\t\tconst sub = token.onCancellationRequested(() => {\n\t\t\t\tthis._resolveCache = undefined;\n\t\t\t\tthis._isResolved = false;\n\t\t\t});\n\t\t\tthis._resolveCache = Promise.resolve(this.provider.resolveCompletionItem!(this.completion, token)).then(value => {\n\t\t\t\tObject.assign(this.completion, value);\n\t\t\t\tthis._isResolved = true;\n\t\t\t\tsub.dispose();\n\t\t\t}, err => {\n\t\t\t\tif (isCancellationError(err)) {\n\t\t\t\t\t// the IPC queue will reject the request with the\n\t\t\t\t\t// cancellation error -> reset cached\n\t\t\t\t\tthis._resolveCache = undefined;\n\t\t\t\t\tthis._isResolved = false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this._resolveCache;\n\t}\n}\n\nexport const enum SnippetSortOrder {\n\tTop, Inline, Bottom\n}\n\nexport class CompletionOptions {\n\n\tstatic readonly default = new CompletionOptions();\n\n\tconstructor(\n\t\treadonly snippetSortOrder = SnippetSortOrder.Bottom,\n\t\treadonly kindFilter = new Set<languages.CompletionItemKind>(),\n\t\treadonly providerFilter = new Set<languages.CompletionItemProvider>(),\n\t\treadonly showDeprecated = true\n\t) { }\n}\n\nlet _snippetSuggestSupport: languages.CompletionItemProvider;\n\nexport function getSnippetSuggestSupport(): languages.CompletionItemProvider {\n\treturn _snippetSuggestSupport;\n}\n\nexport interface CompletionDurationEntry {\n\treadonly providerName: string;\n\treadonly elapsedProvider: number;\n\treadonly elapsedOverall: number;\n}\n\nexport interface CompletionDurations {\n\treadonly entries: readonly CompletionDurationEntry[];\n\treadonly elapsed: number;\n}\n\nexport class CompletionItemModel {\n\tconstructor(\n\t\treadonly items: CompletionItem[],\n\t\treadonly needsClipboard: boolean,\n\t\treadonly durations: CompletionDurations,\n\t\treadonly disposable: IDisposable,\n\t) { }\n}\n\nexport async function provideSuggestionItems(\n\tregistry: LanguageFeatureRegistry<languages.CompletionItemProvider>,\n\tmodel: ITextModel,\n\tposition: Position,\n\toptions: CompletionOptions = CompletionOptions.default,\n\tcontext: languages.CompletionContext = { triggerKind: languages.CompletionTriggerKind.Invoke },\n\ttoken: CancellationToken = CancellationToken.None\n): Promise<CompletionItemModel> {\n\n\tconst sw = new StopWatch(true);\n\tposition = position.clone();\n\n\tconst word = model.getWordAtPosition(position);\n\tconst defaultReplaceRange = word ? new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn) : Range.fromPositions(position);\n\tconst defaultRange = { replace: defaultReplaceRange, insert: defaultReplaceRange.setEndPosition(position.lineNumber, position.column) };\n\n\tconst result: CompletionItem[] = [];\n\tconst disposables = new DisposableStore();\n\tconst durations: CompletionDurationEntry[] = [];\n\tlet needsClipboard = false;\n\n\tconst onCompletionList = (provider: languages.CompletionItemProvider, container: languages.CompletionList | null | undefined, sw: StopWatch): boolean => {\n\t\tlet didAddResult = false;\n\t\tif (!container) {\n\t\t\treturn didAddResult;\n\t\t}\n\t\tfor (let suggestion of container.suggestions) {\n\t\t\tif (!options.kindFilter.has(suggestion.kind)) {\n\t\t\t\t// skip if not showing deprecated suggestions\n\t\t\t\tif (!options.showDeprecated && suggestion?.tags?.includes(languages.CompletionItemTag.Deprecated)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// fill in default range when missing\n\t\t\t\tif (!suggestion.range) {\n\t\t\t\t\tsuggestion.range = defaultRange;\n\t\t\t\t}\n\t\t\t\t// fill in default sortText when missing\n\t\t\t\tif (!suggestion.sortText) {\n\t\t\t\t\tsuggestion.sortText = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.label;\n\t\t\t\t}\n\t\t\t\tif (!needsClipboard && suggestion.insertTextRules && suggestion.insertTextRules & languages.CompletionItemInsertTextRule.InsertAsSnippet) {\n\t\t\t\t\tneedsClipboard = SnippetParser.guessNeedsClipboard(suggestion.insertText);\n\t\t\t\t}\n\t\t\t\tresult.push(new CompletionItem(position, suggestion, container, provider));\n\t\t\t\tdidAddResult = true;\n\t\t\t}\n\t\t}\n\t\tif (isDisposable(container)) {\n\t\t\tdisposables.add(container);\n\t\t}\n\t\tdurations.push({\n\t\t\tproviderName: provider._debugDisplayName ?? 'unknown_provider', elapsedProvider: container.duration ?? -1, elapsedOverall: sw.elapsed()\n\t\t});\n\t\treturn didAddResult;\n\t};\n\n\t// ask for snippets in parallel to asking \"real\" providers. Only do something if configured to\n\t// do so - no snippet filter, no special-providers-only request\n\tconst snippetCompletions = (async () => {\n\t\tif (!_snippetSuggestSupport || options.kindFilter.has(languages.CompletionItemKind.Snippet)) {\n\t\t\treturn;\n\t\t}\n\t\tif (options.providerFilter.size > 0 && !options.providerFilter.has(_snippetSuggestSupport)) {\n\t\t\treturn;\n\t\t}\n\t\tconst sw = new StopWatch(true);\n\t\tconst list = await _snippetSuggestSupport.provideCompletionItems(model, position, context, token);\n\t\tonCompletionList(_snippetSuggestSupport, list, sw);\n\t})();\n\n\t// add suggestions from contributed providers - providers are ordered in groups of\n\t// equal score and once a group produces a result the process stops\n\t// get provider groups, always add snippet suggestion provider\n\tfor (let providerGroup of registry.orderedGroups(model)) {\n\n\t\t// for each support in the group ask for suggestions\n\t\tlet didAddResult = false;\n\t\tawait Promise.all(providerGroup.map(async provider => {\n\t\t\tif (options.providerFilter.size > 0 && !options.providerFilter.has(provider)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst sw = new StopWatch(true);\n\t\t\t\tconst list = await provider.provideCompletionItems(model, position, context, token);\n\t\t\t\tdidAddResult = onCompletionList(provider, list, sw) || didAddResult;\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedExternalError(err);\n\t\t\t}\n\t\t}));\n\n\t\tif (didAddResult || token.isCancellationRequested) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tawait snippetCompletions;\n\n\tif (token.isCancellationRequested) {\n\t\tdisposables.dispose();\n\t\treturn Promise.reject<any>(canceled());\n\t}\n\n\treturn new CompletionItemModel(\n\t\tresult.sort(getSuggestionComparator(options.snippetSortOrder)),\n\t\tneedsClipboard,\n\t\t{ entries: durations, elapsed: sw.elapsed() },\n\t\tdisposables,\n\t);\n}\n\n\nfunction defaultComparator(a: CompletionItem, b: CompletionItem): number {\n\t// check with 'sortText'\n\tif (a.sortTextLow && b.sortTextLow) {\n\t\tif (a.sortTextLow < b.sortTextLow) {\n\t\t\treturn -1;\n\t\t} else if (a.sortTextLow > b.sortTextLow) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\t// check with 'label'\n\tif (a.completion.label < b.completion.label) {\n\t\treturn -1;\n\t} else if (a.completion.label > b.completion.label) {\n\t\treturn 1;\n\t}\n\t// check with 'type'\n\treturn a.completion.kind - b.completion.kind;\n}\n\nfunction snippetUpComparator(a: CompletionItem, b: CompletionItem): number {\n\tif (a.completion.kind !== b.completion.kind) {\n\t\tif (a.completion.kind === languages.CompletionItemKind.Snippet) {\n\t\t\treturn -1;\n\t\t} else if (b.completion.kind === languages.CompletionItemKind.Snippet) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn defaultComparator(a, b);\n}\n\nfunction snippetDownComparator(a: CompletionItem, b: CompletionItem): number {\n\tif (a.completion.kind !== b.completion.kind) {\n\t\tif (a.completion.kind === languages.CompletionItemKind.Snippet) {\n\t\t\treturn 1;\n\t\t} else if (b.completion.kind === languages.CompletionItemKind.Snippet) {\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn defaultComparator(a, b);\n}\n\ninterface Comparator<T> { (a: T, b: T): number }\nconst _snippetComparators = new Map<SnippetSortOrder, Comparator<CompletionItem>>();\n_snippetComparators.set(SnippetSortOrder.Top, snippetUpComparator);\n_snippetComparators.set(SnippetSortOrder.Bottom, snippetDownComparator);\n_snippetComparators.set(SnippetSortOrder.Inline, defaultComparator);\n\nexport function getSuggestionComparator(snippetConfig: SnippetSortOrder): (a: CompletionItem, b: CompletionItem) => number {\n\treturn _snippetComparators.get(snippetConfig)!;\n}\n\nCommandsRegistry.registerCommand('_executeCompletionItemProvider', async (accessor, ...args: [URI, IPosition, string?, number?]) => {\n\tconst [uri, position, triggerCharacter, maxItemsToResolve] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Position.isIPosition(position));\n\tassertType(typeof triggerCharacter === 'string' || !triggerCharacter);\n\tassertType(typeof maxItemsToResolve === 'number' || !maxItemsToResolve);\n\n\tconst { completionProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\n\t\tconst result: languages.CompletionList = {\n\t\t\tincomplete: false,\n\t\t\tsuggestions: []\n\t\t};\n\n\t\tconst resolving: Promise<any>[] = [];\n\t\tconst completions = await provideSuggestionItems(completionProvider, ref.object.textEditorModel, Position.lift(position), undefined, { triggerCharacter, triggerKind: triggerCharacter ? languages.CompletionTriggerKind.TriggerCharacter : languages.CompletionTriggerKind.Invoke });\n\t\tfor (const item of completions.items) {\n\t\t\tif (resolving.length < (maxItemsToResolve ?? 0)) {\n\t\t\t\tresolving.push(item.resolve(CancellationToken.None));\n\t\t\t}\n\t\t\tresult.incomplete = result.incomplete || item.container.incomplete;\n\t\t\tresult.suggestions.push(item.completion);\n\t\t}\n\n\t\ttry {\n\t\t\tawait Promise.all(resolving);\n\t\t\treturn result;\n\t\t} finally {\n\t\t\tsetTimeout(() => completions.disposable.dispose(), 100);\n\t\t}\n\n\t} finally {\n\t\tref.dispose();\n\t}\n\n});\n\ninterface SuggestController extends IEditorContribution {\n\ttriggerSuggest(onlyFrom?: Set<languages.CompletionItemProvider>): void;\n}\n\n\nlet _onlyOnceProvider: languages.CompletionItemProvider | undefined;\nlet _onlyOnceSuggestions: languages.CompletionItem[] = [];\n\nexport function showSimpleSuggestions(accessor: ServicesAccessor, editor: ICodeEditor, suggestions: languages.CompletionItem[]) {\n\n\tconst { completionProvider } = accessor.get(ILanguageFeaturesService);\n\n\tif (!_onlyOnceProvider) {\n\t\t_onlyOnceProvider = new class implements languages.CompletionItemProvider {\n\t\t\tprovideCompletionItems(): languages.CompletionList {\n\t\t\t\tlet suggestions = _onlyOnceSuggestions.slice(0);\n\t\t\t\tlet result = { suggestions };\n\t\t\t\t_onlyOnceSuggestions.length = 0;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t\tcompletionProvider.register('*', _onlyOnceProvider);\n\t}\n\n\tsetTimeout(() => {\n\t\t_onlyOnceSuggestions.push(...suggestions);\n\t\teditor.getContribution<SuggestController>('editor.contrib.suggestController')?.triggerSuggest(\n\t\t\tnew Set<languages.CompletionItemProvider>().add(_onlyOnceProvider!)\n\t\t);\n\t}, 0);\n}\n\nexport interface ISuggestItemPreselector {\n\t/**\n\t * The preselector with highest priority is asked first.\n\t*/\n\treadonly priority: number;\n\n\t/**\n\t * Is called to preselect a suggest item.\n\t * When -1 is returned, item preselectors with lower priority are asked.\n\t*/\n\tselect(model: ITextModel, pos: IPosition, items: CompletionItem[]): number | -1;\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { TabFocus } from 'vs/editor/browser/config/tabFocus';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport * as nls from 'vs/nls';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class ToggleTabFocusModeAction extends EditorAction {\n\n\tpublic static readonly ID = 'editor.action.toggleTabFocusMode';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ToggleTabFocusModeAction.ID,\n\t\t\tlabel: nls.localize({ key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] }, \"Toggle Tab Key Moves Focus\"),\n\t\t\talias: 'Toggle Tab Key Moves Focus',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyM,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyM },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst oldValue = TabFocus.getTabFocusMode();\n\t\tconst newValue = !oldValue;\n\t\tTabFocus.setTabFocusMode(newValue);\n\t\tif (newValue) {\n\t\t\talert(nls.localize('toggle.tabMovesFocus.on', \"Pressing Tab will now move focus to the next focusable element\"));\n\t\t} else {\n\t\t\talert(nls.localize('toggle.tabMovesFocus.off', \"Pressing Tab will now insert the tab character\"));\n\t\t}\n\t}\n}\n\nregisterEditorAction(ToggleTabFocusModeAction);\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 { StopWatch } from 'vs/base/common/stopwatch';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport * as nls from 'vs/nls';\n\nclass ForceRetokenizeAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.forceRetokenize',\n\t\t\tlabel: nls.localize('forceRetokenize', \"Developer: Force Retokenize\"),\n\t\t\talias: 'Developer: Force Retokenize',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tmodel.resetTokenization();\n\t\tconst sw = new StopWatch(true);\n\t\tmodel.forceTokenization(model.getLineCount());\n\t\tsw.stop();\n\t\tconsole.log(`tokenization took ${sw.elapsed()}`);\n\n\t}\n}\n\nregisterEditorAction(ForceRetokenizeAction);\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 { Disposable } from 'vs/base/common/lifecycle';\nimport { basename } from 'vs/base/common/resources';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as nls from 'vs/nls';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\n\nconst ignoreUnusualLineTerminators = 'ignoreUnusualLineTerminators';\n\nfunction writeIgnoreState(codeEditorService: ICodeEditorService, model: ITextModel, state: boolean): void {\n\tcodeEditorService.setModelProperty(model.uri, ignoreUnusualLineTerminators, state);\n}\n\nfunction readIgnoreState(codeEditorService: ICodeEditorService, model: ITextModel): boolean | undefined {\n\treturn codeEditorService.getModelProperty(model.uri, ignoreUnusualLineTerminators);\n}\n\nexport class UnusualLineTerminatorsDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.unusualLineTerminatorsDetector';\n\n\tprivate _config: 'auto' | 'off' | 'prompt';\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IDialogService private readonly _dialogService: IDialogService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService\n\t) {\n\t\tsuper();\n\n\t\tthis._config = this._editor.getOption(EditorOption.unusualLineTerminators);\n\t\tthis._register(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.unusualLineTerminators)) {\n\t\t\t\tthis._config = this._editor.getOption(EditorOption.unusualLineTerminators);\n\t\t\t\tthis._checkForUnusualLineTerminators();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._editor.onDidChangeModel(() => {\n\t\t\tthis._checkForUnusualLineTerminators();\n\t\t}));\n\n\t\tthis._register(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (e.isUndoing) {\n\t\t\t\t// skip checking in case of undoing\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._checkForUnusualLineTerminators();\n\t\t}));\n\t}\n\n\tprivate async _checkForUnusualLineTerminators(): Promise<void> {\n\t\tif (this._config === 'off') {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\tif (!model.mightContainUnusualLineTerminators()) {\n\t\t\treturn;\n\t\t}\n\t\tconst ignoreState = readIgnoreState(this._codeEditorService, model);\n\t\tif (ignoreState === true) {\n\t\t\t// this model should be ignored\n\t\t\treturn;\n\t\t}\n\t\tif (this._editor.getOption(EditorOption.readOnly)) {\n\t\t\t// read only editor => sorry!\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._config === 'auto') {\n\t\t\t// just do it!\n\t\t\tmodel.removeUnusualLineTerminators(this._editor.getSelections());\n\t\t\treturn;\n\t\t}\n\n\t\tconst result = await this._dialogService.confirm({\n\t\t\ttitle: nls.localize('unusualLineTerminators.title', \"Unusual Line Terminators\"),\n\t\t\tmessage: nls.localize('unusualLineTerminators.message', \"Detected unusual line terminators\"),\n\t\t\tdetail: nls.localize('unusualLineTerminators.detail', \"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\\n\\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.\", basename(model.uri)),\n\t\t\tprimaryButton: nls.localize('unusualLineTerminators.fix', \"Remove Unusual Line Terminators\"),\n\t\t\tsecondaryButton: nls.localize('unusualLineTerminators.ignore', \"Ignore\")\n\t\t});\n\n\t\tif (!result.confirmed) {\n\t\t\t// this model should be ignored\n\t\t\twriteIgnoreState(this._codeEditorService, model, true);\n\t\t\treturn;\n\t\t}\n\n\t\tmodel.removeUnusualLineTerminators(this._editor.getSelections());\n\t}\n}\n\nregisterEditorContribution(UnusualLineTerminatorsDetector.ID, UnusualLineTerminatorsDetector);\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, ICommandOptions, registerEditorAction, registerEditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';\nimport { EditorOption, EditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { CursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { DeleteWordContext, WordNavigationType, WordOperations } from 'vs/editor/common/cursor/cursorWordOperations';\nimport { getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport * as nls from 'vs/nls';\nimport { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { IsWindowsContext } from 'vs/platform/contextkey/common/contextkeys';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport interface MoveWordOptions extends ICommandOptions {\n\tinSelectionMode: boolean;\n\twordNavigationType: WordNavigationType;\n}\n\nexport abstract class MoveWordCommand extends EditorCommand {\n\n\tprivate readonly _inSelectionMode: boolean;\n\tprivate readonly _wordNavigationType: WordNavigationType;\n\n\tconstructor(opts: MoveWordOptions) {\n\t\tsuper(opts);\n\t\tthis._inSelectionMode = opts.inSelectionMode;\n\t\tthis._wordNavigationType = opts.wordNavigationType;\n\t}\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst wordSeparators = getMapForWordSeparators(editor.getOption(EditorOption.wordSeparators));\n\t\tconst model = editor.getModel();\n\t\tconst selections = editor.getSelections();\n\n\t\tconst result = selections.map((sel) => {\n\t\t\tconst inPosition = new Position(sel.positionLineNumber, sel.positionColumn);\n\t\t\tconst outPosition = this._move(wordSeparators, model, inPosition, this._wordNavigationType);\n\t\t\treturn this._moveTo(sel, outPosition, this._inSelectionMode);\n\t\t});\n\n\t\tmodel.pushStackElement();\n\t\teditor._getViewModel().setCursorStates('moveWordCommand', CursorChangeReason.Explicit, result.map(r => CursorState.fromModelSelection(r)));\n\t\tif (result.length === 1) {\n\t\t\tconst pos = new Position(result[0].positionLineNumber, result[0].positionColumn);\n\t\t\teditor.revealPosition(pos, ScrollType.Smooth);\n\t\t}\n\t}\n\n\tprivate _moveTo(from: Selection, to: Position, inSelectionMode: boolean): Selection {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new Selection(\n\t\t\t\tfrom.selectionStartLineNumber,\n\t\t\t\tfrom.selectionStartColumn,\n\t\t\t\tto.lineNumber,\n\t\t\t\tto.column\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new Selection(\n\t\t\t\tto.lineNumber,\n\t\t\t\tto.column,\n\t\t\t\tto.lineNumber,\n\t\t\t\tto.column\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected abstract _move(wordSeparators: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position;\n}\n\nexport class WordLeftCommand extends MoveWordCommand {\n\tprotected _move(wordSeparators: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn WordOperations.moveWordLeft(wordSeparators, model, position, wordNavigationType);\n\t}\n}\n\nexport class WordRightCommand extends MoveWordCommand {\n\tprotected _move(wordSeparators: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn WordOperations.moveWordRight(wordSeparators, model, position, wordNavigationType);\n\t}\n}\n\nexport class CursorWordStartLeft extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordStartLeft',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordEndLeft extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordEndLeft',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordLeft extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordStartFast,\n\t\t\tid: 'cursorWordLeft',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()),\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.LeftArrow,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyCode.LeftArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class CursorWordStartLeftSelect extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordStartLeftSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordEndLeftSelect extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordEndLeftSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordLeftSelect extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordStartFast,\n\t\t\tid: 'cursorWordLeftSelect',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()),\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\n// Accessibility navigation commands should only be enabled on windows since they are tuned to what NVDA expects\nexport class CursorWordAccessibilityLeft extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordAccessibility,\n\t\t\tid: 'cursorWordAccessibilityLeft',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tprotected override _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue), model, position, wordNavigationType);\n\t}\n}\n\nexport class CursorWordAccessibilityLeftSelect extends WordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordAccessibility,\n\t\t\tid: 'cursorWordAccessibilityLeftSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tprotected override _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue), model, position, wordNavigationType);\n\t}\n}\n\nexport class CursorWordStartRight extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordStartRight',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordEndRight extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordEndRight',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()),\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.RightArrow,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyCode.RightArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class CursorWordRight extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordRight',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordStartRightSelect extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordStartRightSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordEndRightSelect extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordEndRightSelect',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()),\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class CursorWordRightSelect extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordRightSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n}\n\nexport class CursorWordAccessibilityRight extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordAccessibility,\n\t\t\tid: 'cursorWordAccessibilityRight',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tprotected override _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue), model, position, wordNavigationType);\n\t}\n}\n\nexport class CursorWordAccessibilityRightSelect extends WordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordAccessibility,\n\t\t\tid: 'cursorWordAccessibilityRightSelect',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tprotected override _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue), model, position, wordNavigationType);\n\t}\n}\n\nexport interface DeleteWordOptions extends ICommandOptions {\n\twhitespaceHeuristics: boolean;\n\twordNavigationType: WordNavigationType;\n}\n\nexport abstract class DeleteWordCommand extends EditorCommand {\n\tprivate readonly _whitespaceHeuristics: boolean;\n\tprivate readonly _wordNavigationType: WordNavigationType;\n\n\tconstructor(opts: DeleteWordOptions) {\n\t\tsuper(opts);\n\t\tthis._whitespaceHeuristics = opts.whitespaceHeuristics;\n\t\tthis._wordNavigationType = opts.wordNavigationType;\n\t}\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst wordSeparators = getMapForWordSeparators(editor.getOption(EditorOption.wordSeparators));\n\t\tconst model = editor.getModel();\n\t\tconst selections = editor.getSelections();\n\t\tconst autoClosingBrackets = editor.getOption(EditorOption.autoClosingBrackets);\n\t\tconst autoClosingQuotes = editor.getOption(EditorOption.autoClosingQuotes);\n\t\tconst autoClosingPairs = languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getAutoClosingPairs();\n\t\tconst viewModel = editor._getViewModel();\n\n\t\tconst commands = selections.map((sel) => {\n\t\t\tconst deleteRange = this._delete({\n\t\t\t\twordSeparators,\n\t\t\t\tmodel,\n\t\t\t\tselection: sel,\n\t\t\t\twhitespaceHeuristics: this._whitespaceHeuristics,\n\t\t\t\tautoClosingDelete: editor.getOption(EditorOption.autoClosingDelete),\n\t\t\t\tautoClosingBrackets,\n\t\t\t\tautoClosingQuotes,\n\t\t\t\tautoClosingPairs,\n\t\t\t\tautoClosedCharacters: viewModel.getCursorAutoClosedCharacters()\n\t\t\t}, this._wordNavigationType);\n\t\t\treturn new ReplaceCommand(deleteRange, '');\n\t\t});\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n\n\tprotected abstract _delete(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range;\n}\n\nexport class DeleteWordLeftCommand extends DeleteWordCommand {\n\tprotected _delete(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordOperations.deleteWordLeft(ctx, wordNavigationType);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\treturn new Range(1, 1, 1, 1);\n\t}\n}\n\nexport class DeleteWordRightCommand extends DeleteWordCommand {\n\tprotected _delete(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordOperations.deleteWordRight(ctx, wordNavigationType);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\tconst lineCount = ctx.model.getLineCount();\n\t\tconst maxColumn = ctx.model.getLineMaxColumn(lineCount);\n\t\treturn new Range(lineCount, maxColumn, lineCount, maxColumn);\n\t}\n}\n\nexport class DeleteWordStartLeft extends DeleteWordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: false,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'deleteWordStartLeft',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class DeleteWordEndLeft extends DeleteWordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'deleteWordEndLeft',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class DeleteWordLeft extends DeleteWordLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: true,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'deleteWordLeft',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Backspace,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyCode.Backspace },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class DeleteWordStartRight extends DeleteWordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: false,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'deleteWordStartRight',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class DeleteWordEndRight extends DeleteWordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'deleteWordEndRight',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n}\n\nexport class DeleteWordRight extends DeleteWordRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'deleteWordRight',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Delete,\n\t\t\t\tmac: { primary: KeyMod.Alt | KeyCode.Delete },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class DeleteInsideWord extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'deleteInsideWord',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tlabel: nls.localize('deleteInsideWord', \"Delete Word\"),\n\t\t\talias: 'Delete Word'\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst wordSeparators = getMapForWordSeparators(editor.getOption(EditorOption.wordSeparators));\n\t\tconst model = editor.getModel();\n\t\tconst selections = editor.getSelections();\n\n\t\tconst commands = selections.map((sel) => {\n\t\t\tconst deleteRange = WordOperations.deleteInsideWord(wordSeparators, model, sel);\n\t\t\treturn new ReplaceCommand(deleteRange, '');\n\t\t});\n\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, commands);\n\t\teditor.pushUndoStop();\n\t}\n}\n\nregisterEditorCommand(new CursorWordStartLeft());\nregisterEditorCommand(new CursorWordEndLeft());\nregisterEditorCommand(new CursorWordLeft());\nregisterEditorCommand(new CursorWordStartLeftSelect());\nregisterEditorCommand(new CursorWordEndLeftSelect());\nregisterEditorCommand(new CursorWordLeftSelect());\nregisterEditorCommand(new CursorWordStartRight());\nregisterEditorCommand(new CursorWordEndRight());\nregisterEditorCommand(new CursorWordRight());\nregisterEditorCommand(new CursorWordStartRightSelect());\nregisterEditorCommand(new CursorWordEndRightSelect());\nregisterEditorCommand(new CursorWordRightSelect());\nregisterEditorCommand(new CursorWordAccessibilityLeft());\nregisterEditorCommand(new CursorWordAccessibilityLeftSelect());\nregisterEditorCommand(new CursorWordAccessibilityRight());\nregisterEditorCommand(new CursorWordAccessibilityRightSelect());\nregisterEditorCommand(new DeleteWordStartLeft());\nregisterEditorCommand(new DeleteWordEndLeft());\nregisterEditorCommand(new DeleteWordLeft());\nregisterEditorCommand(new DeleteWordStartRight());\nregisterEditorCommand(new DeleteWordEndRight());\nregisterEditorCommand(new DeleteWordRight());\nregisterEditorAction(DeleteInsideWord);\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { DeleteWordContext, WordNavigationType, WordPartOperations } from 'vs/editor/common/cursor/cursorWordOperations';\nimport { WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DeleteWordCommand, MoveWordCommand } from 'vs/editor/contrib/wordOperations/browser/wordOperations';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class DeleteWordPartLeft extends DeleteWordCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: true,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'deleteWordPartLeft',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Backspace },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _delete(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordPartOperations.deleteWordPartLeft(ctx);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\treturn new Range(1, 1, 1, 1);\n\t}\n}\n\nexport class DeleteWordPartRight extends DeleteWordCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\twhitespaceHeuristics: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'deleteWordPartRight',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Delete },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _delete(ctx: DeleteWordContext, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordPartOperations.deleteWordPartRight(ctx);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\tconst lineCount = ctx.model.getLineCount();\n\t\tconst maxColumn = ctx.model.getLineMaxColumn(lineCount);\n\t\treturn new Range(lineCount, maxColumn, lineCount, maxColumn);\n\t}\n}\n\nexport class WordPartLeftCommand extends MoveWordCommand {\n\tprotected _move(wordSeparators: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn WordPartOperations.moveWordPartLeft(wordSeparators, model, position);\n\t}\n}\nexport class CursorWordPartLeft extends WordPartLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordPartLeft',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.LeftArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n// Register previous id for compatibility purposes\nCommandsRegistry.registerCommandAlias('cursorWordPartStartLeft', 'cursorWordPartLeft');\n\nexport class CursorWordPartLeftSelect extends WordPartLeftCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordStart,\n\t\t\tid: 'cursorWordPartLeftSelect',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n// Register previous id for compatibility purposes\nCommandsRegistry.registerCommandAlias('cursorWordPartStartLeftSelect', 'cursorWordPartLeftSelect');\n\nexport class WordPartRightCommand extends MoveWordCommand {\n\tprotected _move(wordSeparators: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position {\n\t\treturn WordPartOperations.moveWordPartRight(wordSeparators, model, position);\n\t}\n}\nexport class CursorWordPartRight extends WordPartRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: false,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordPartRight',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.RightArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\nexport class CursorWordPartRightSelect extends WordPartRightCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tinSelectionMode: true,\n\t\t\twordNavigationType: WordNavigationType.WordEnd,\n\t\t\tid: 'cursorWordPartRightSelect',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\n\nregisterEditorCommand(new DeleteWordPartLeft());\nregisterEditorCommand(new DeleteWordPartRight());\nregisterEditorCommand(new CursorWordPartLeft());\nregisterEditorCommand(new CursorWordPartLeftSelect());\nregisterEditorCommand(new CursorWordPartRight());\nregisterEditorCommand(new CursorWordPartRightSelect());\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 'vs/css!./accessibilityHelp';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode';\nimport { IStandaloneEditorConstructionOptions } from 'vs/editor/standalone/browser/standaloneCodeEditor';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\n\nconst CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);\n\nclass AccessibilityHelpController extends Disposable\n\timplements IEditorContribution {\n\tpublic static readonly ID = 'editor.contrib.accessibilityHelpController';\n\n\tpublic static get(editor: ICodeEditor): AccessibilityHelpController | null {\n\t\treturn editor.getContribution<AccessibilityHelpController>(\n\t\t\tAccessibilityHelpController.ID\n\t\t);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _widget: AccessibilityHelpWidget;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._widget = this._register(\n\t\t\tinstantiationService.createInstance(AccessibilityHelpWidget, this._editor)\n\t\t);\n\t}\n\n\tpublic show(): void {\n\t\tthis._widget.show();\n\t}\n\n\tpublic hide(): void {\n\t\tthis._widget.hide();\n\t}\n}\n\n\nfunction getSelectionLabel(selections: Selection[] | null, charactersSelected: number): string {\n\tif (!selections || selections.length === 0) {\n\t\treturn AccessibilityHelpNLS.noSelection;\n\t}\n\n\tif (selections.length === 1) {\n\t\tif (charactersSelected) {\n\t\t\treturn strings.format(AccessibilityHelpNLS.singleSelectionRange, selections[0].positionLineNumber, selections[0].positionColumn, charactersSelected);\n\t\t}\n\n\t\treturn strings.format(AccessibilityHelpNLS.singleSelection, selections[0].positionLineNumber, selections[0].positionColumn);\n\t}\n\n\tif (charactersSelected) {\n\t\treturn strings.format(AccessibilityHelpNLS.multiSelectionRange, selections.length, charactersSelected);\n\t}\n\n\tif (selections.length > 0) {\n\t\treturn strings.format(AccessibilityHelpNLS.multiSelection, selections.length);\n\t}\n\n\treturn '';\n}\n\nclass AccessibilityHelpWidget extends Widget implements IOverlayWidget {\n\tprivate static readonly ID = 'editor.contrib.accessibilityHelpWidget';\n\tprivate static readonly WIDTH = 500;\n\tprivate static readonly HEIGHT = 300;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _contentDomNode: FastDomNode<HTMLElement>;\n\tprivate _isVisible: boolean;\n\tprivate readonly _isVisibleKey: IContextKey<boolean>;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(\n\t\t\tthis._contextKeyService\n\t\t);\n\n\t\tthis._domNode = createFastDomNode(document.createElement('div'));\n\t\tthis._domNode.setClassName('accessibilityHelpWidget');\n\t\tthis._domNode.setDisplay('none');\n\t\tthis._domNode.setAttribute('role', 'dialog');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._contentDomNode = createFastDomNode(document.createElement('div'));\n\t\tthis._contentDomNode.setAttribute('role', 'document');\n\t\tthis._domNode.appendChild(this._contentDomNode);\n\n\t\tthis._isVisible = false;\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._layout();\n\t\t\t}\n\t\t}));\n\n\t\t// Intentionally not configurable!\n\t\tthis._register(dom.addStandardDisposableListener(this._contentDomNode.domNode, 'keydown', (e) => {\n\t\t\tif (!this._isVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (e.equals(KeyMod.CtrlCmd | KeyCode.KeyE)) {\n\t\t\t\talert(AccessibilityHelpNLS.emergencyConfOn);\n\n\t\t\t\tthis._editor.updateOptions({\n\t\t\t\t\taccessibilitySupport: 'on'\n\t\t\t\t});\n\n\t\t\t\tdom.clearNode(this._contentDomNode.domNode);\n\t\t\t\tthis._buildContent();\n\t\t\t\tthis._contentDomNode.domNode.focus();\n\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\n\t\t\tif (e.equals(KeyMod.CtrlCmd | KeyCode.KeyH)) {\n\t\t\t\talert(AccessibilityHelpNLS.openingDocs);\n\n\t\t\t\tlet url = (<IStandaloneEditorConstructionOptions>this._editor.getRawOptions()).accessibilityHelpUrl;\n\t\t\t\tif (typeof url === 'undefined') {\n\t\t\t\t\turl = 'https://go.microsoft.com/fwlink/?linkid=852450';\n\t\t\t\t}\n\t\t\t\tthis._openerService.open(URI.parse(url));\n\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis.onblur(this._contentDomNode.domNode, () => {\n\t\t\tthis.hide();\n\t\t});\n\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn AccessibilityHelpWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode.domNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition {\n\t\treturn {\n\t\t\tpreference: null\n\t\t};\n\t}\n\n\tpublic show(): void {\n\t\tif (this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = true;\n\t\tthis._isVisibleKey.set(true);\n\t\tthis._layout();\n\t\tthis._domNode.setDisplay('block');\n\t\tthis._domNode.setAttribute('aria-hidden', 'false');\n\t\tthis._contentDomNode.domNode.tabIndex = 0;\n\t\tthis._buildContent();\n\t\tthis._contentDomNode.domNode.focus();\n\t}\n\n\tprivate _descriptionForCommand(commandId: string, msg: string, noKbMsg: string): string {\n\t\tconst kb = this._keybindingService.lookupKeybinding(commandId);\n\t\tif (kb) {\n\t\t\treturn strings.format(msg, kb.getAriaLabel());\n\t\t}\n\t\treturn strings.format(noKbMsg, commandId);\n\t}\n\n\tprivate _buildContent() {\n\t\tconst options = this._editor.getOptions();\n\n\t\tconst selections = this._editor.getSelections();\n\t\tlet charactersSelected = 0;\n\n\t\tif (selections) {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (model) {\n\t\t\t\tselections.forEach((selection) => {\n\t\t\t\t\tcharactersSelected += model.getValueLengthInRange(selection);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tlet text = getSelectionLabel(selections, charactersSelected);\n\n\t\tif (options.get(EditorOption.inDiffEditor)) {\n\t\t\tif (options.get(EditorOption.readOnly)) {\n\t\t\t\ttext += AccessibilityHelpNLS.readonlyDiffEditor;\n\t\t\t} else {\n\t\t\t\ttext += AccessibilityHelpNLS.editableDiffEditor;\n\t\t\t}\n\t\t} else {\n\t\t\tif (options.get(EditorOption.readOnly)) {\n\t\t\t\ttext += AccessibilityHelpNLS.readonlyEditor;\n\t\t\t} else {\n\t\t\t\ttext += AccessibilityHelpNLS.editableEditor;\n\t\t\t}\n\t\t}\n\n\t\tconst turnOnMessage = (\n\t\t\tplatform.isMacintosh\n\t\t\t\t? AccessibilityHelpNLS.changeConfigToOnMac\n\t\t\t\t: AccessibilityHelpNLS.changeConfigToOnWinLinux\n\t\t);\n\t\tswitch (options.get(EditorOption.accessibilitySupport)) {\n\t\t\tcase AccessibilitySupport.Unknown:\n\t\t\t\ttext += '\\n\\n - ' + turnOnMessage;\n\t\t\t\tbreak;\n\t\t\tcase AccessibilitySupport.Enabled:\n\t\t\t\ttext += '\\n\\n - ' + AccessibilityHelpNLS.auto_on;\n\t\t\t\tbreak;\n\t\t\tcase AccessibilitySupport.Disabled:\n\t\t\t\ttext += '\\n\\n - ' + AccessibilityHelpNLS.auto_off;\n\t\t\t\ttext += ' ' + turnOnMessage;\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\tif (options.get(EditorOption.tabFocusMode)) {\n\t\t\ttext += '\\n\\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOnMsg, AccessibilityHelpNLS.tabFocusModeOnMsgNoKb);\n\t\t} else {\n\t\t\ttext += '\\n\\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOffMsg, AccessibilityHelpNLS.tabFocusModeOffMsgNoKb);\n\t\t}\n\n\t\tconst openDocMessage = (\n\t\t\tplatform.isMacintosh\n\t\t\t\t? AccessibilityHelpNLS.openDocMac\n\t\t\t\t: AccessibilityHelpNLS.openDocWinLinux\n\t\t);\n\n\t\ttext += '\\n\\n - ' + openDocMessage;\n\n\t\ttext += '\\n\\n' + AccessibilityHelpNLS.outroMsg;\n\n\t\tthis._contentDomNode.domNode.appendChild(renderFormattedText(text));\n\t\t// Per https://www.w3.org/TR/wai-aria/roles#document, Authors SHOULD provide a title or label for documents\n\t\tthis._contentDomNode.domNode.setAttribute('aria-label', text);\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._isVisibleKey.reset();\n\t\tthis._domNode.setDisplay('none');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t\tthis._contentDomNode.domNode.tabIndex = -1;\n\t\tdom.clearNode(this._contentDomNode.domNode);\n\n\t\tthis._editor.focus();\n\t}\n\n\tprivate _layout(): void {\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\n\t\tconst w = Math.max(5, Math.min(AccessibilityHelpWidget.WIDTH, editorLayout.width - 40));\n\t\tconst h = Math.max(5, Math.min(AccessibilityHelpWidget.HEIGHT, editorLayout.height - 40));\n\n\t\tthis._domNode.setWidth(w);\n\t\tthis._domNode.setHeight(h);\n\n\t\tconst top = Math.round((editorLayout.height - h) / 2);\n\t\tthis._domNode.setTop(top);\n\n\t\tconst left = Math.round((editorLayout.width - w) / 2);\n\t\tthis._domNode.setLeft(left);\n\t}\n}\n\nclass ShowAccessibilityHelpAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showAccessibilityHelp',\n\t\t\tlabel: AccessibilityHelpNLS.showAccessibilityHelpAction,\n\t\t\talias: 'Show Accessibility Help',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.F1,\n\t\t\t\tweight: KeybindingWeight.EditorContrib,\n\t\t\t\tlinux: {\n\t\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.F1,\n\t\t\t\t\tsecondary: [KeyMod.Alt | KeyCode.F1]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst controller = AccessibilityHelpController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.show();\n\t\t}\n\t}\n}\n\nregisterEditorContribution(AccessibilityHelpController.ID, AccessibilityHelpController);\nregisterEditorAction(ShowAccessibilityHelpAction);\n\nconst AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);\n\nregisterEditorCommand(\n\tnew AccessibilityHelpCommand({\n\t\tid: 'closeAccessibilityHelp',\n\t\tprecondition: CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE,\n\t\thandler: x => x.hide(),\n\t\tkbOpts: {\n\t\t\tweight: KeybindingWeight.EditorContrib + 100,\n\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\tprimary: KeyCode.Escape,\n\t\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t\t}\n\t})\n);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst widgetBackground = theme.getColor(editorWidgetBackground);\n\tif (widgetBackground) {\n\t\tcollector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`);\n\t}\n\tconst widgetForeground = theme.getColor(editorWidgetForeground);\n\tif (widgetForeground) {\n\t\tcollector.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${widgetForeground}; }`);\n\t}\n\n\n\tconst widgetShadowColor = theme.getColor(widgetShadow);\n\tif (widgetShadowColor) {\n\t\tcollector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);\n\t}\n\n\tconst hcBorder = theme.getColor(contrastBorder);\n\tif (hcBorder) {\n\t\tcollector.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`);\n\t}\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 'vs/css!./iPadShowKeyboard';\nimport * as dom from 'vs/base/browser/dom';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { isIOS } from 'vs/base/common/platform';\n\nexport class IPadShowKeyboard extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.iPadShowKeyboard';\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate widget: ShowKeyboardWidget | null;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tthis.widget = null;\n\t\tif (isIOS) {\n\t\t\tthis._register(editor.onDidChangeConfiguration(() => this.update()));\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tprivate update(): void {\n\t\tconst shouldHaveWidget = (!this.editor.getOption(EditorOption.readOnly));\n\n\t\tif (!this.widget && shouldHaveWidget) {\n\n\t\t\tthis.widget = new ShowKeyboardWidget(this.editor);\n\n\t\t} else if (this.widget && !shouldHaveWidget) {\n\n\t\t\tthis.widget.dispose();\n\t\t\tthis.widget = null;\n\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tif (this.widget) {\n\t\t\tthis.widget.dispose();\n\t\t\tthis.widget = null;\n\t\t}\n\t}\n}\n\nclass ShowKeyboardWidget extends Disposable implements IOverlayWidget {\n\n\tprivate static readonly ID = 'editor.contrib.ShowKeyboardWidget';\n\n\tprivate readonly editor: ICodeEditor;\n\n\tprivate readonly _domNode: HTMLElement;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tthis._domNode = document.createElement('textarea');\n\t\tthis._domNode.className = 'iPadShowKeyboard';\n\n\t\tthis._register(dom.addDisposableListener(this._domNode, 'touchstart', (e) => {\n\t\t\tthis.editor.focus();\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(this._domNode, 'focus', (e) => {\n\t\t\tthis.editor.focus();\n\t\t}));\n\n\t\tthis.editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\t// ----- IOverlayWidget API\n\n\tpublic getId(): string {\n\t\treturn ShowKeyboardWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition {\n\t\treturn {\n\t\t\tpreference: OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER\n\t\t};\n\t}\n}\n\nregisterEditorContribution(IPadShowKeyboard.ID, IPadShowKeyboard);\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 'vs/css!./inspectTokens';\nimport { $, append, reset } from 'vs/base/browser/dom';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { Color } from 'vs/base/common/color';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { FontStyle, IState, ITokenizationSupport, StandardTokenType, TokenMetadata, TokenizationRegistry, ILanguageIdCodec, Token } from 'vs/editor/common/languages';\nimport { NullState, nullTokenize, nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { editorHoverBackground, editorHoverBorder, editorHoverForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { InspectTokensNLS } from 'vs/editor/common/standaloneStrings';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\n\n\nclass InspectTokensController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.inspectTokens';\n\n\tpublic static get(editor: ICodeEditor): InspectTokensController | null {\n\t\treturn editor.getContribution<InspectTokensController>(InspectTokensController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _languageService: ILanguageService;\n\tprivate _widget: InspectTokensWidget | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IStandaloneThemeService standaloneColorService: IStandaloneThemeService,\n\t\t@ILanguageService languageService: ILanguageService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._languageService = languageService;\n\t\tthis._widget = null;\n\n\t\tthis._register(this._editor.onDidChangeModel((e) => this.stop()));\n\t\tthis._register(this._editor.onDidChangeModelLanguage((e) => this.stop()));\n\t\tthis._register(TokenizationRegistry.onDidChange((e) => this.stop()));\n\t\tthis._register(this._editor.onKeyUp((e) => e.keyCode === KeyCode.Escape && this.stop()));\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.stop();\n\t\tsuper.dispose();\n\t}\n\n\tpublic launch(): void {\n\t\tif (this._widget) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._widget = new InspectTokensWidget(this._editor, this._languageService);\n\t}\n\n\tpublic stop(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.dispose();\n\t\t\tthis._widget = null;\n\t\t}\n\t}\n}\n\nclass InspectTokens extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inspectTokens',\n\t\t\tlabel: InspectTokensNLS.inspectTokensAction,\n\t\t\talias: 'Developer: Inspect Tokens',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst controller = InspectTokensController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.launch();\n\t\t}\n\t}\n}\n\ninterface ICompleteLineTokenization {\n\tstartState: IState;\n\ttokens1: Token[];\n\ttokens2: Uint32Array;\n\tendState: IState;\n}\n\ninterface IDecodedMetadata {\n\tlanguageId: string;\n\ttokenType: StandardTokenType;\n\tfontStyle: FontStyle;\n\tforeground: Color;\n\tbackground: Color;\n}\n\nfunction renderTokenText(tokenText: string): string {\n\tlet result: string = '';\n\tfor (let charIndex = 0, len = tokenText.length; charIndex < len; charIndex++) {\n\t\tconst charCode = tokenText.charCodeAt(charIndex);\n\t\tswitch (charCode) {\n\t\t\tcase CharCode.Tab:\n\t\t\t\tresult += '\\u2192'; // →\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Space:\n\t\t\t\tresult += '\\u00B7'; // ·\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tresult += String.fromCharCode(charCode);\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction getSafeTokenizationSupport(languageIdCodec: ILanguageIdCodec, languageId: string): ITokenizationSupport {\n\tconst tokenizationSupport = TokenizationRegistry.get(languageId);\n\tif (tokenizationSupport) {\n\t\treturn tokenizationSupport;\n\t}\n\tconst encodedLanguageId = languageIdCodec.encodeLanguageId(languageId);\n\treturn {\n\t\tgetInitialState: () => NullState,\n\t\ttokenize: (line: string, hasEOL: boolean, state: IState) => nullTokenize(languageId, state),\n\t\ttokenizeEncoded: (line: string, hasEOL: boolean, state: IState) => nullTokenizeEncoded(encodedLanguageId, state)\n\t};\n}\n\nclass InspectTokensWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly _ID = 'editor.contrib.inspectTokensWidget';\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tpublic allowEditorOverflow = true;\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _languageService: ILanguageService;\n\tprivate readonly _tokenizationSupport: ITokenizationSupport;\n\tprivate readonly _model: ITextModel;\n\tprivate readonly _domNode: HTMLElement;\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tlanguageService: ILanguageService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._languageService = languageService;\n\t\tthis._model = this._editor.getModel();\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'tokens-inspect-widget';\n\t\tthis._tokenizationSupport = getSafeTokenizationSupport(this._languageService.languageIdCodec, this._model.getLanguageId());\n\t\tthis._compute(this._editor.getPosition());\n\t\tthis._register(this._editor.onDidChangeCursorPosition((e) => this._compute(this._editor.getPosition())));\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._editor.removeContentWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn InspectTokensWidget._ID;\n\t}\n\n\tprivate _compute(position: Position): void {\n\t\tconst data = this._getTokensAtLine(position.lineNumber);\n\n\t\tlet token1Index = 0;\n\t\tfor (let i = data.tokens1.length - 1; i >= 0; i--) {\n\t\t\tconst t = data.tokens1[i];\n\t\t\tif (position.column - 1 >= t.offset) {\n\t\t\t\ttoken1Index = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet token2Index = 0;\n\t\tfor (let i = (data.tokens2.length >>> 1); i >= 0; i--) {\n\t\t\tif (position.column - 1 >= data.tokens2[(i << 1)]) {\n\t\t\t\ttoken2Index = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst lineContent = this._model.getLineContent(position.lineNumber);\n\t\tlet tokenText = '';\n\t\tif (token1Index < data.tokens1.length) {\n\t\t\tconst tokenStartIndex = data.tokens1[token1Index].offset;\n\t\t\tconst tokenEndIndex = token1Index + 1 < data.tokens1.length ? data.tokens1[token1Index + 1].offset : lineContent.length;\n\t\t\ttokenText = lineContent.substring(tokenStartIndex, tokenEndIndex);\n\t\t}\n\t\treset(this._domNode,\n\t\t\t$('h2.tm-token', undefined, renderTokenText(tokenText),\n\t\t\t\t$('span.tm-token-length', undefined, `${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'}`)));\n\n\t\tappend(this._domNode, $('hr.tokens-inspect-separator', { 'style': 'clear:both' }));\n\n\t\tconst metadata = (token2Index << 1) + 1 < data.tokens2.length ? this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]) : null;\n\t\tappend(this._domNode, $('table.tm-metadata-table', undefined,\n\t\t\t$('tbody', undefined,\n\t\t\t\t$('tr', undefined,\n\t\t\t\t\t$('td.tm-metadata-key', undefined, 'language'),\n\t\t\t\t\t$('td.tm-metadata-value', undefined, `${metadata ? metadata.languageId : '-?-'}`)\n\t\t\t\t),\n\t\t\t\t$('tr', undefined,\n\t\t\t\t\t$('td.tm-metadata-key', undefined, 'token type' as string),\n\t\t\t\t\t$('td.tm-metadata-value', undefined, `${metadata ? this._tokenTypeToString(metadata.tokenType) : '-?-'}`)\n\t\t\t\t),\n\t\t\t\t$('tr', undefined,\n\t\t\t\t\t$('td.tm-metadata-key', undefined, 'font style' as string),\n\t\t\t\t\t$('td.tm-metadata-value', undefined, `${metadata ? this._fontStyleToString(metadata.fontStyle) : '-?-'}`)\n\t\t\t\t),\n\t\t\t\t$('tr', undefined,\n\t\t\t\t\t$('td.tm-metadata-key', undefined, 'foreground'),\n\t\t\t\t\t$('td.tm-metadata-value', undefined, `${metadata ? Color.Format.CSS.formatHex(metadata.foreground) : '-?-'}`)\n\t\t\t\t),\n\t\t\t\t$('tr', undefined,\n\t\t\t\t\t$('td.tm-metadata-key', undefined, 'background'),\n\t\t\t\t\t$('td.tm-metadata-value', undefined, `${metadata ? Color.Format.CSS.formatHex(metadata.background) : '-?-'}`)\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\tappend(this._domNode, $('hr.tokens-inspect-separator'));\n\n\t\tif (token1Index < data.tokens1.length) {\n\t\t\tappend(this._domNode, $('span.tm-token-type', undefined, data.tokens1[token1Index].type));\n\t\t}\n\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\tprivate _decodeMetadata(metadata: number): IDecodedMetadata {\n\t\tconst colorMap = TokenizationRegistry.getColorMap()!;\n\t\tconst languageId = TokenMetadata.getLanguageId(metadata);\n\t\tconst tokenType = TokenMetadata.getTokenType(metadata);\n\t\tconst fontStyle = TokenMetadata.getFontStyle(metadata);\n\t\tconst foreground = TokenMetadata.getForeground(metadata);\n\t\tconst background = TokenMetadata.getBackground(metadata);\n\t\treturn {\n\t\t\tlanguageId: this._languageService.languageIdCodec.decodeLanguageId(languageId),\n\t\t\ttokenType: tokenType,\n\t\t\tfontStyle: fontStyle,\n\t\t\tforeground: colorMap[foreground],\n\t\t\tbackground: colorMap[background]\n\t\t};\n\t}\n\n\tprivate _tokenTypeToString(tokenType: StandardTokenType): string {\n\t\tswitch (tokenType) {\n\t\t\tcase StandardTokenType.Other: return 'Other';\n\t\t\tcase StandardTokenType.Comment: return 'Comment';\n\t\t\tcase StandardTokenType.String: return 'String';\n\t\t\tcase StandardTokenType.RegEx: return 'RegEx';\n\t\t\tdefault: return '??';\n\t\t}\n\t}\n\n\tprivate _fontStyleToString(fontStyle: FontStyle): string {\n\t\tlet r = '';\n\t\tif (fontStyle & FontStyle.Italic) {\n\t\t\tr += 'italic ';\n\t\t}\n\t\tif (fontStyle & FontStyle.Bold) {\n\t\t\tr += 'bold ';\n\t\t}\n\t\tif (fontStyle & FontStyle.Underline) {\n\t\t\tr += 'underline ';\n\t\t}\n\t\tif (fontStyle & FontStyle.Strikethrough) {\n\t\t\tr += 'strikethrough ';\n\t\t}\n\t\tif (r.length === 0) {\n\t\t\tr = '---';\n\t\t}\n\t\treturn r;\n\t}\n\n\tprivate _getTokensAtLine(lineNumber: number): ICompleteLineTokenization {\n\t\tconst stateBeforeLine = this._getStateBeforeLine(lineNumber);\n\n\t\tconst tokenizationResult1 = this._tokenizationSupport.tokenize(this._model.getLineContent(lineNumber), true, stateBeforeLine);\n\t\tconst tokenizationResult2 = this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(lineNumber), true, stateBeforeLine);\n\n\t\treturn {\n\t\t\tstartState: stateBeforeLine,\n\t\t\ttokens1: tokenizationResult1.tokens,\n\t\t\ttokens2: tokenizationResult2.tokens,\n\t\t\tendState: tokenizationResult1.endState\n\t\t};\n\t}\n\n\tprivate _getStateBeforeLine(lineNumber: number): IState {\n\t\tlet state: IState = this._tokenizationSupport.getInitialState();\n\n\t\tfor (let i = 1; i < lineNumber; i++) {\n\t\t\tconst tokenizationResult = this._tokenizationSupport.tokenize(this._model.getLineContent(i), true, state);\n\t\t\tstate = tokenizationResult.endState;\n\t\t}\n\n\t\treturn state;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): IContentWidgetPosition {\n\t\treturn {\n\t\t\tposition: this._editor.getPosition(),\n\t\t\tpreference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n}\n\nregisterEditorContribution(InspectTokensController.ID, InspectTokensController);\nregisterEditorAction(InspectTokens);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(editorHoverBorder);\n\tif (border) {\n\t\tconst borderWidth = theme.type === ColorScheme.HIGH_CONTRAST ? 2 : 1;\n\t\tcollector.addRule(`.monaco-editor .tokens-inspect-widget { border: ${borderWidth}px solid ${border}; }`);\n\t\tcollector.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${border}; }`);\n\t}\n\tconst background = theme.getColor(editorHoverBackground);\n\tif (background) {\n\t\tcollector.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${background}; }`);\n\t}\n\tconst foreground = theme.getColor(editorHoverForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor .tokens-inspect-widget { color: ${foreground}; }`);\n\t}\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 { Registry } from 'vs/platform/registry/common/platform';\nimport { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';\nimport { QuickCommandNLS } from 'vs/editor/common/standaloneStrings';\nimport { ICommandQuickPick } from 'vs/platform/quickinput/browser/commandsQuickAccess';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { AbstractEditorCommandsQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/commandsQuickAccess';\nimport { IEditor } from 'vs/editor/common/editorCommon';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { EditorAction, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\n\nexport class StandaloneCommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {\n\n\tprotected get activeTextEditorControl(): IEditor | undefined { return withNullAsUndefined(this.codeEditorService.getFocusedCodeEditor()); }\n\n\tconstructor(\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService private readonly codeEditorService: ICodeEditorService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IDialogService dialogService: IDialogService\n\t) {\n\t\tsuper({ showAlias: false }, instantiationService, keybindingService, commandService, telemetryService, dialogService);\n\t}\n\n\tprotected async getCommandPicks(): Promise<Array<ICommandQuickPick>> {\n\t\treturn this.getCodeEditorCommandPicks();\n\t}\n}\n\nRegistry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({\n\tctor: StandaloneCommandsQuickAccessProvider,\n\tprefix: StandaloneCommandsQuickAccessProvider.PREFIX,\n\thelpEntries: [{ description: QuickCommandNLS.quickCommandHelp, needsEditor: true }]\n});\n\nexport class GotoLineAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.quickCommand',\n\t\t\tlabel: QuickCommandNLS.quickCommandActionLabel,\n\t\t\talias: 'Command Palette',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyCode.F1,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'z_commands',\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n\n\trun(accessor: ServicesAccessor): void {\n\t\taccessor.get(IQuickInputService).quickAccess.show(StandaloneCommandsQuickAccessProvider.PREFIX);\n\t}\n}\n\nregisterEditorAction(GotoLineAction);\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 { AbstractGotoLineQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { GoToLineNLS } from 'vs/editor/common/standaloneStrings';\nimport { Event } from 'vs/base/common/event';\nimport { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { KeyMod, KeyCode } from 'vs/base/common/keyCodes';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\n\nexport class StandaloneGotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {\n\n\tprotected readonly onDidActiveTextEditorControlChange = Event.None;\n\n\tconstructor(@ICodeEditorService private readonly editorService: ICodeEditorService) {\n\t\tsuper();\n\t}\n\n\tprotected get activeTextEditorControl() {\n\t\treturn withNullAsUndefined(this.editorService.getFocusedCodeEditor());\n\t}\n}\n\nRegistry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({\n\tctor: StandaloneGotoLineQuickAccessProvider,\n\tprefix: StandaloneGotoLineQuickAccessProvider.PREFIX,\n\thelpEntries: [{ description: GoToLineNLS.gotoLineActionLabel, needsEditor: true }]\n});\n\nexport class GotoLineAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.gotoLine',\n\t\t\tlabel: GoToLineNLS.gotoLineActionLabel,\n\t\t\talias: 'Go to Line/Column...',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyG,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KeyG },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\trun(accessor: ServicesAccessor): void {\n\t\taccessor.get(IQuickInputService).quickAccess.show(StandaloneGotoLineQuickAccessProvider.PREFIX);\n\t}\n}\n\nregisterEditorAction(GotoLineAction);\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 'vs/base/browser/ui/codicons/codiconStyles'; // The codicon symbol styles are defined here and must be loaded\nimport 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors\nimport { AbstractGotoSymbolQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { QuickOutlineNLS } from 'vs/editor/common/standaloneStrings';\nimport { Event } from 'vs/base/common/event';\nimport { EditorAction, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { KeyMod, KeyCode } from 'vs/base/common/keyCodes';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\nimport { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class StandaloneGotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider {\n\n\tprotected readonly onDidActiveTextEditorControlChange = Event.None;\n\n\tconstructor(\n\t\t@ICodeEditorService private readonly editorService: ICodeEditorService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t\t@IOutlineModelService outlineModelService: IOutlineModelService,\n\t) {\n\t\tsuper(languageFeaturesService, outlineModelService);\n\t}\n\n\tprotected get activeTextEditorControl() {\n\t\treturn withNullAsUndefined(this.editorService.getFocusedCodeEditor());\n\t}\n}\n\nRegistry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({\n\tctor: StandaloneGotoSymbolQuickAccessProvider,\n\tprefix: AbstractGotoSymbolQuickAccessProvider.PREFIX,\n\thelpEntries: [\n\t\t{ description: QuickOutlineNLS.quickOutlineActionLabel, prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX, needsEditor: true },\n\t\t{ description: QuickOutlineNLS.quickOutlineByCategoryActionLabel, prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY, needsEditor: true }\n\t]\n});\n\nexport class GotoLineAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.quickOutline',\n\t\t\tlabel: QuickOutlineNLS.quickOutlineActionLabel,\n\t\t\talias: 'Go to Symbol...',\n\t\t\tprecondition: EditorContextKeys.hasDocumentSymbolProvider,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyO,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n\n\trun(accessor: ServicesAccessor): void {\n\t\taccessor.get(IQuickInputService).quickAccess.show(AbstractGotoSymbolQuickAccessProvider.PREFIX);\n\t}\n}\n\nregisterEditorAction(GotoLineAction);\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { ToggleHighContrastNLS } from 'vs/editor/common/standaloneStrings';\n\nclass ToggleHighContrast extends EditorAction {\n\n\tprivate _originalThemeName: string | null;\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.toggleHighContrast',\n\t\t\tlabel: ToggleHighContrastNLS.toggleHighContrast,\n\t\t\talias: 'Toggle High Contrast Theme',\n\t\t\tprecondition: undefined\n\t\t});\n\t\tthis._originalThemeName = null;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst standaloneThemeService = accessor.get(IStandaloneThemeService);\n\t\tif (this._originalThemeName) {\n\t\t\t// We must toggle back to the integrator's theme\n\t\t\tstandaloneThemeService.setTheme(this._originalThemeName);\n\t\t\tthis._originalThemeName = null;\n\t\t} else {\n\t\t\tthis._originalThemeName = standaloneThemeService.getColorTheme().themeName;\n\t\t\tstandaloneThemeService.setTheme('hc-black');\n\t\t}\n\t}\n}\n\nregisterEditorAction(ToggleHighContrast);\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 { $, addDisposableListener, append, asCSSUrl, EventType, ModifierKeyEmitter, prepend } from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ActionViewItem, BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';\nimport { DropdownMenuActionViewItem, IDropdownMenuActionViewItemOptions } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem';\nimport { ActionRunner, IAction, IRunEvent, Separator, SubmenuAction } from 'vs/base/common/actions';\nimport { UILabelProvider } from 'vs/base/common/keybindingLabels';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { isLinux, isWindows, OS } from 'vs/base/common/platform';\nimport 'vs/css!./menuEntryActionViewItem';\nimport { localize } from 'vs/nls';\nimport { IMenu, IMenuActionOptions, IMenuService, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions';\nimport { ICommandAction, Icon } from 'vs/platform/action/common/action';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nexport function createAndFillInActionBarActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[] }, primaryGroup?: string | ((actionGroup: string) => boolean), primaryMaxCount?: number, shouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean, useSeparatorsInPrimaryActions?: boolean): IDisposable {\n\tconst groups = menu.getActions(options);\n\tconst isPrimaryAction = typeof primaryGroup === 'string' ? (actionGroup: string) => actionGroup === primaryGroup : primaryGroup;\n\n\t// Action bars handle alternative actions on their own so the alternative actions should be ignored\n\tfillInActions(groups, target, false, isPrimaryAction, primaryMaxCount, shouldInlineSubmenu, useSeparatorsInPrimaryActions);\n\treturn asDisposable(groups);\n}\n\nfunction asDisposable(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemAction | SubmenuItemAction>]>): IDisposable {\n\tconst disposables = new DisposableStore();\n\tfor (const [, actions] of groups) {\n\t\tfor (const action of actions) {\n\t\t\tdisposables.add(action);\n\t\t}\n\t}\n\treturn disposables;\n}\n\n\nfunction fillInActions(\n\tgroups: ReadonlyArray<[string, ReadonlyArray<MenuItemAction | SubmenuItemAction>]>, target: IAction[] | { primary: IAction[]; secondary: IAction[] },\n\tuseAlternativeActions: boolean,\n\tisPrimaryAction: (actionGroup: string) => boolean = actionGroup => actionGroup === 'navigation',\n\tprimaryMaxCount: number = Number.MAX_SAFE_INTEGER,\n\tshouldInlineSubmenu: (action: SubmenuAction, group: string, groupSize: number) => boolean = () => false,\n\tuseSeparatorsInPrimaryActions: boolean = false\n): void {\n\n\tlet primaryBucket: IAction[];\n\tlet secondaryBucket: IAction[];\n\tif (Array.isArray(target)) {\n\t\tprimaryBucket = target;\n\t\tsecondaryBucket = target;\n\t} else {\n\t\tprimaryBucket = target.primary;\n\t\tsecondaryBucket = target.secondary;\n\t}\n\n\tconst submenuInfo = new Set<{ group: string; action: SubmenuAction; index: number }>();\n\n\tfor (const [group, actions] of groups) {\n\n\t\tlet target: IAction[];\n\t\tif (isPrimaryAction(group)) {\n\t\t\ttarget = primaryBucket;\n\t\t\tif (target.length > 0 && useSeparatorsInPrimaryActions) {\n\t\t\t\ttarget.push(new Separator());\n\t\t\t}\n\t\t} else {\n\t\t\ttarget = secondaryBucket;\n\t\t\tif (target.length > 0) {\n\t\t\t\ttarget.push(new Separator());\n\t\t\t}\n\t\t}\n\n\t\tfor (let action of actions) {\n\t\t\tif (useAlternativeActions) {\n\t\t\t\taction = action instanceof MenuItemAction && action.alt ? action.alt : action;\n\t\t\t}\n\t\t\tconst newLen = target.push(action);\n\t\t\t// keep submenu info for later inlining\n\t\t\tif (action instanceof SubmenuAction) {\n\t\t\t\tsubmenuInfo.add({ group, action, index: newLen - 1 });\n\t\t\t}\n\t\t}\n\t}\n\n\t// ask the outside if submenu should be inlined or not. only ask when\n\t// there would be enough space\n\tfor (const { group, action, index } of submenuInfo) {\n\t\tconst target = isPrimaryAction(group) ? primaryBucket : secondaryBucket;\n\n\t\t// inlining submenus with length 0 or 1 is easy,\n\t\t// larger submenus need to be checked with the overall limit\n\t\tconst submenuActions = action.actions;\n\t\tif ((submenuActions.length <= 1 || target.length + submenuActions.length - 2 <= primaryMaxCount) && shouldInlineSubmenu(action, group, target.length)) {\n\t\t\ttarget.splice(index, 1, ...submenuActions);\n\t\t}\n\t}\n\n\t// overflow items from the primary group into the secondary bucket\n\tif (primaryBucket !== secondaryBucket && primaryBucket.length > primaryMaxCount) {\n\t\tconst overflow = primaryBucket.splice(primaryMaxCount, primaryBucket.length - primaryMaxCount);\n\t\tsecondaryBucket.unshift(...overflow, new Separator());\n\t}\n}\n\nexport interface IMenuEntryActionViewItemOptions {\n\tdraggable?: boolean;\n}\n\nexport class MenuEntryActionViewItem extends ActionViewItem {\n\n\tprivate _wantsAltCommand: boolean = false;\n\tprivate readonly _itemClassDispose = this._register(new MutableDisposable());\n\tprivate readonly _altKey: ModifierKeyEmitter;\n\n\tconstructor(\n\t\t_action: MenuItemAction,\n\t\toptions: IMenuEntryActionViewItemOptions | undefined,\n\t\t@IKeybindingService protected readonly _keybindingService: IKeybindingService,\n\t\t@INotificationService protected _notificationService: INotificationService,\n\t\t@IContextKeyService protected _contextKeyService: IContextKeyService\n\t) {\n\t\tsuper(undefined, _action, { icon: !!(_action.class || _action.item.icon), label: !_action.class && !_action.item.icon, draggable: options?.draggable });\n\t\tthis._altKey = ModifierKeyEmitter.getInstance();\n\t}\n\n\tprotected get _menuItemAction(): MenuItemAction {\n\t\treturn <MenuItemAction>this._action;\n\t}\n\n\tprotected get _commandAction(): MenuItemAction {\n\t\treturn this._wantsAltCommand && this._menuItemAction.alt || this._menuItemAction;\n\t}\n\n\toverride async onClick(event: MouseEvent): Promise<void> {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\ttry {\n\t\t\tawait this.actionRunner.run(this._commandAction, this._context);\n\t\t} catch (err) {\n\t\t\tthis._notificationService.error(err);\n\t\t}\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\t\tcontainer.classList.add('menu-entry');\n\n\t\tthis._updateItemClass(this._menuItemAction.item);\n\n\t\tlet mouseOver = false;\n\n\t\tlet alternativeKeyDown = this._altKey.keyStatus.altKey || ((isWindows || isLinux) && this._altKey.keyStatus.shiftKey);\n\n\t\tconst updateAltState = () => {\n\t\t\tconst wantsAltCommand = mouseOver && alternativeKeyDown;\n\t\t\tif (wantsAltCommand !== this._wantsAltCommand) {\n\t\t\t\tthis._wantsAltCommand = wantsAltCommand;\n\t\t\t\tthis.updateLabel();\n\t\t\t\tthis.updateTooltip();\n\t\t\t\tthis.updateClass();\n\t\t\t}\n\t\t};\n\n\t\tif (this._menuItemAction.alt) {\n\t\t\tthis._register(this._altKey.event(value => {\n\t\t\t\talternativeKeyDown = value.altKey || ((isWindows || isLinux) && value.shiftKey);\n\t\t\t\tupdateAltState();\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(container, 'mouseleave', _ => {\n\t\t\tmouseOver = false;\n\t\t\tupdateAltState();\n\t\t}));\n\n\t\tthis._register(addDisposableListener(container, 'mouseenter', _ => {\n\t\t\tmouseOver = true;\n\t\t\tupdateAltState();\n\t\t}));\n\t}\n\n\toverride updateLabel(): void {\n\t\tif (this.options.label && this.label) {\n\t\t\tthis.label.textContent = this._commandAction.label;\n\t\t}\n\t}\n\n\toverride updateTooltip(): void {\n\t\tif (this.label) {\n\t\t\tconst keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id, this._contextKeyService);\n\t\t\tconst keybindingLabel = keybinding && keybinding.getLabel();\n\n\t\t\tconst tooltip = this._commandAction.tooltip || this._commandAction.label;\n\t\t\tlet title = keybindingLabel\n\t\t\t\t? localize('titleAndKb', \"{0} ({1})\", tooltip, keybindingLabel)\n\t\t\t\t: tooltip;\n\t\t\tif (!this._wantsAltCommand && this._menuItemAction.alt) {\n\t\t\t\tconst altTooltip = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label;\n\t\t\t\tconst altKeybinding = this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id, this._contextKeyService);\n\t\t\t\tconst altKeybindingLabel = altKeybinding && altKeybinding.getLabel();\n\t\t\t\tconst altTitleSection = altKeybindingLabel\n\t\t\t\t\t? localize('titleAndKb', \"{0} ({1})\", altTooltip, altKeybindingLabel)\n\t\t\t\t\t: altTooltip;\n\t\t\t\ttitle += `\\n[${UILabelProvider.modifierLabels[OS].altKey}] ${altTitleSection}`;\n\t\t\t}\n\t\t\tthis.label.title = title;\n\t\t}\n\t}\n\n\toverride updateClass(): void {\n\t\tif (this.options.icon) {\n\t\t\tif (this._commandAction !== this._menuItemAction) {\n\t\t\t\tif (this._menuItemAction.alt) {\n\t\t\t\t\tthis._updateItemClass(this._menuItemAction.alt.item);\n\t\t\t\t}\n\t\t\t} else if (this._menuItemAction.alt) {\n\t\t\t\tthis._updateItemClass(this._menuItemAction.item);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _updateItemClass(item: ICommandAction): void {\n\t\tthis._itemClassDispose.value = undefined;\n\n\t\tconst { element, label } = this;\n\t\tif (!element || !label) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst icon = this._commandAction.checked && (item.toggled as { icon?: Icon })?.icon ? (item.toggled as { icon: Icon }).icon : item.icon;\n\n\t\tif (!icon) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (ThemeIcon.isThemeIcon(icon)) {\n\t\t\t// theme icons\n\t\t\tconst iconClasses = ThemeIcon.asClassNameArray(icon);\n\t\t\tlabel.classList.add(...iconClasses);\n\t\t\tthis._itemClassDispose.value = toDisposable(() => {\n\t\t\t\tlabel.classList.remove(...iconClasses);\n\t\t\t});\n\n\t\t} else {\n\t\t\t// icon path/url\n\t\t\tif (icon.light) {\n\t\t\t\tlabel.style.setProperty('--menu-entry-icon-light', asCSSUrl(icon.light));\n\t\t\t}\n\t\t\tif (icon.dark) {\n\t\t\t\tlabel.style.setProperty('--menu-entry-icon-dark', asCSSUrl(icon.dark));\n\t\t\t}\n\t\t\tlabel.classList.add('icon');\n\t\t\tthis._itemClassDispose.value = toDisposable(() => {\n\t\t\t\tlabel.classList.remove('icon');\n\t\t\t\tlabel.style.removeProperty('--menu-entry-icon-light');\n\t\t\t\tlabel.style.removeProperty('--menu-entry-icon-dark');\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport class SubmenuEntryActionViewItem extends DropdownMenuActionViewItem {\n\n\tconstructor(\n\t\taction: SubmenuItemAction,\n\t\toptions: IDropdownMenuActionViewItemOptions | undefined,\n\t\t@IContextMenuService contextMenuService: IContextMenuService\n\t) {\n\t\tconst dropdownOptions = Object.assign({}, options ?? Object.create(null), {\n\t\t\tmenuAsChild: options?.menuAsChild ?? false,\n\t\t\tclassNames: options?.classNames ?? (ThemeIcon.isThemeIcon(action.item.icon) ? ThemeIcon.asClassName(action.item.icon) : undefined),\n\t\t});\n\n\t\tsuper(action, { getActions: () => action.actions }, contextMenuService, dropdownOptions);\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\t\tif (this.element) {\n\t\t\tcontainer.classList.add('menu-entry');\n\t\t\tconst { icon } = (<SubmenuItemAction>this._action).item;\n\t\t\tif (icon && !ThemeIcon.isThemeIcon(icon)) {\n\t\t\t\tthis.element.classList.add('icon');\n\t\t\t\tif (icon.light) {\n\t\t\t\t\tthis.element.style.setProperty('--menu-entry-icon-light', asCSSUrl(icon.light));\n\t\t\t\t}\n\t\t\t\tif (icon.dark) {\n\t\t\t\t\tthis.element.style.setProperty('--menu-entry-icon-dark', asCSSUrl(icon.dark));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass DropdownWithDefaultActionViewItem extends BaseActionViewItem {\n\tprivate _defaultAction: ActionViewItem;\n\tprivate _dropdown: DropdownMenuActionViewItem;\n\tprivate _container: HTMLElement | null = null;\n\tprivate _storageKey: string;\n\n\tconstructor(\n\t\tsubmenuAction: SubmenuItemAction,\n\t\toptions: IDropdownMenuActionViewItemOptions | undefined,\n\t\t@IKeybindingService protected readonly _keybindingService: IKeybindingService,\n\t\t@INotificationService protected _notificationService: INotificationService,\n\t\t@IContextMenuService protected _contextMenuService: IContextMenuService,\n\t\t@IMenuService protected _menuService: IMenuService,\n\t\t@IInstantiationService protected _instaService: IInstantiationService,\n\t\t@IStorageService protected _storageService: IStorageService\n\t) {\n\t\tsuper(null, submenuAction);\n\n\t\tthis._storageKey = `${submenuAction.item.submenu._debugName}_lastActionId`;\n\n\t\t// determine default action\n\t\tlet defaultAction: IAction | undefined;\n\t\tlet defaultActionId = _storageService.get(this._storageKey, StorageScope.WORKSPACE);\n\t\tif (defaultActionId) {\n\t\t\tdefaultAction = submenuAction.actions.find(a => defaultActionId === a.id);\n\t\t}\n\t\tif (!defaultAction) {\n\t\t\tdefaultAction = submenuAction.actions[0];\n\t\t}\n\n\t\tthis._defaultAction = this._instaService.createInstance(MenuEntryActionViewItem, <MenuItemAction>defaultAction, undefined);\n\n\t\tconst dropdownOptions = Object.assign({}, options ?? Object.create(null), {\n\t\t\tmenuAsChild: options?.menuAsChild ?? true,\n\t\t\tclassNames: options?.classNames ?? ['codicon', 'codicon-chevron-down'],\n\t\t\tactionRunner: options?.actionRunner ?? new ActionRunner()\n\t\t});\n\n\t\tthis._dropdown = new DropdownMenuActionViewItem(submenuAction, submenuAction.actions, this._contextMenuService, dropdownOptions);\n\t\tthis._dropdown.actionRunner.onDidRun((e: IRunEvent) => {\n\t\t\tif (e.action instanceof MenuItemAction) {\n\t\t\t\tthis.update(e.action);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate update(lastAction: MenuItemAction): void {\n\t\tthis._storageService.store(this._storageKey, lastAction.id, StorageScope.WORKSPACE, StorageTarget.USER);\n\n\t\tthis._defaultAction.dispose();\n\t\tthis._defaultAction = this._instaService.createInstance(MenuEntryActionViewItem, lastAction, undefined);\n\t\tthis._defaultAction.actionRunner = new class extends ActionRunner {\n\t\t\toverride async runAction(action: IAction, context?: unknown): Promise<void> {\n\t\t\t\tawait action.run(undefined);\n\t\t\t}\n\t\t}();\n\n\t\tif (this._container) {\n\t\t\tthis._defaultAction.render(prepend(this._container, $('.action-container')));\n\t\t}\n\t}\n\n\toverride setActionContext(newContext: unknown): void {\n\t\tsuper.setActionContext(newContext);\n\t\tthis._defaultAction.setActionContext(newContext);\n\t\tthis._dropdown.setActionContext(newContext);\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tthis._container = container;\n\t\tsuper.render(this._container);\n\n\t\tthis._container.classList.add('monaco-dropdown-with-default');\n\n\t\tconst primaryContainer = $('.action-container');\n\t\tthis._defaultAction.render(append(this._container, primaryContainer));\n\t\tthis._register(addDisposableListener(primaryContainer, EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.RightArrow)) {\n\t\t\t\tthis._defaultAction.element!.tabIndex = -1;\n\t\t\t\tthis._dropdown.focus();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tconst dropdownContainer = $('.dropdown-action-container');\n\t\tthis._dropdown.render(append(this._container, dropdownContainer));\n\t\tthis._register(addDisposableListener(dropdownContainer, EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.LeftArrow)) {\n\t\t\t\tthis._defaultAction.element!.tabIndex = 0;\n\t\t\t\tthis._dropdown.setFocusable(false);\n\t\t\t\tthis._defaultAction.element?.focus();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\t}\n\n\toverride focus(fromRight?: boolean): void {\n\t\tif (fromRight) {\n\t\t\tthis._dropdown.focus();\n\t\t} else {\n\t\t\tthis._defaultAction.element!.tabIndex = 0;\n\t\t\tthis._defaultAction.element!.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tthis._defaultAction.element!.tabIndex = -1;\n\t\tthis._dropdown.blur();\n\t\tthis._container!.blur();\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tif (focusable) {\n\t\t\tthis._defaultAction.element!.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._defaultAction.element!.tabIndex = -1;\n\t\t\tthis._dropdown.setFocusable(false);\n\t\t}\n\t}\n\n\toverride dispose() {\n\t\tthis._defaultAction.dispose();\n\t\tthis._dropdown.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\n/**\n * Creates action view items for menu actions or submenu actions.\n */\nexport function createActionViewItem(instaService: IInstantiationService, action: IAction, options?: IDropdownMenuActionViewItemOptions): undefined | MenuEntryActionViewItem | SubmenuEntryActionViewItem | BaseActionViewItem {\n\tif (action instanceof MenuItemAction) {\n\t\treturn instaService.createInstance(MenuEntryActionViewItem, action, undefined);\n\t} else if (action instanceof SubmenuItemAction) {\n\t\tif (action.item.rememberDefaultAction) {\n\t\t\treturn instaService.createInstance(DropdownWithDefaultActionViewItem, action, options);\n\t\t} else {\n\t\t\treturn instaService.createInstance(SubmenuEntryActionViewItem, action, options);\n\t\t}\n\t} else {\n\t\treturn undefined;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { ActionBar, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { IAction } from 'vs/base/common/actions';\nimport { ResolvedKeybinding } from 'vs/base/common/keybindings';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { suggestWidgetStatusbarMenu } from 'vs/editor/contrib/suggest/browser/suggest';\nimport { localize } from 'vs/nls';\nimport { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem';\nimport { IMenuService, MenuItemAction } from 'vs/platform/actions/common/actions';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\n\nclass StatusBarViewItem extends MenuEntryActionViewItem {\n\n\toverride updateLabel() {\n\t\tconst kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);\n\t\tif (!kb) {\n\t\t\treturn super.updateLabel();\n\t\t}\n\t\tif (this.label) {\n\t\t\tthis.label.textContent = localize('ddd', '{0} ({1})', this._action.label, StatusBarViewItem.symbolPrintEnter(kb));\n\t\t}\n\t}\n\n\tstatic symbolPrintEnter(kb: ResolvedKeybinding) {\n\t\treturn kb.getLabel()?.replace(/\\benter\\b/gi, '\\u23CE');\n\t}\n}\n\nexport class SuggestWidgetStatus {\n\n\treadonly element: HTMLElement;\n\n\tprivate readonly _leftActions: ActionBar;\n\tprivate readonly _rightActions: ActionBar;\n\tprivate readonly _menuDisposables = new DisposableStore();\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IMenuService private _menuService: IMenuService,\n\t\t@IContextKeyService private _contextKeyService: IContextKeyService,\n\t) {\n\t\tthis.element = dom.append(container, dom.$('.suggest-status-bar'));\n\n\t\tconst actionViewItemProvider = <IActionViewItemProvider>(action => {\n\t\t\treturn action instanceof MenuItemAction ? instantiationService.createInstance(StatusBarViewItem, action, undefined) : undefined;\n\t\t});\n\t\tthis._leftActions = new ActionBar(this.element, { actionViewItemProvider });\n\t\tthis._rightActions = new ActionBar(this.element, { actionViewItemProvider });\n\n\t\tthis._leftActions.domNode.classList.add('left');\n\t\tthis._rightActions.domNode.classList.add('right');\n\t}\n\n\tdispose(): void {\n\t\tthis._menuDisposables.dispose();\n\t\tthis.element.remove();\n\t}\n\n\tshow(): void {\n\t\tconst menu = this._menuService.createMenu(suggestWidgetStatusbarMenu, this._contextKeyService);\n\t\tconst renderMenu = () => {\n\t\t\tconst left: IAction[] = [];\n\t\t\tconst right: IAction[] = [];\n\t\t\tfor (let [group, actions] of menu.getActions()) {\n\t\t\t\tif (group === 'left') {\n\t\t\t\t\tleft.push(...actions);\n\t\t\t\t} else {\n\t\t\t\t\tright.push(...actions);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._leftActions.clear();\n\t\t\tthis._leftActions.push(left);\n\t\t\tthis._rightActions.clear();\n\t\t\tthis._rightActions.push(right);\n\t\t};\n\t\tthis._menuDisposables.add(menu.onDidChange(() => renderMenu()));\n\t\tthis._menuDisposables.add(menu);\n\t}\n\n\thide(): void {\n\t\tthis._menuDisposables.clear();\n\t}\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { IMenu, IMenuActionOptions, IMenuCreateOptions, IMenuItem, IMenuService, isIMenuItem, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction } from 'vs/platform/actions/common/actions';\nimport { ILocalizedString } from 'vs/platform/action/common/action';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\n\nexport class MenuService implements IMenuService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@ICommandService private readonly _commandService: ICommandService\n\t) {\n\t\t//\n\t}\n\n\t/**\n\t * Create a new menu for the given menu identifier. A menu sends events when it's entries\n\t * have changed (placement, enablement, checked-state). By default it does send events for\n\t * sub menu entries. That is more expensive and must be explicitly enabled with the\n\t * `emitEventsForSubmenuChanges` flag.\n\t */\n\tcreateMenu(id: MenuId, contextKeyService: IContextKeyService, options?: IMenuCreateOptions): IMenu {\n\t\treturn new Menu(id, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options }, this._commandService, contextKeyService, this);\n\t}\n}\n\n\ntype MenuItemGroup = [string, Array<IMenuItem | ISubmenuItem>];\n\nclass Menu implements IMenu {\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate readonly _onDidChange: Emitter<IMenu>;\n\treadonly onDidChange: Event<IMenu>;\n\n\tprivate _menuGroups: MenuItemGroup[] = [];\n\tprivate _contextKeys: Set<string> = new Set();\n\n\tconstructor(\n\t\tprivate readonly _id: MenuId,\n\t\tprivate readonly _options: Required<IMenuCreateOptions>,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IMenuService private readonly _menuService: IMenuService\n\t) {\n\t\tthis._build();\n\n\t\t// Rebuild this menu whenever the menu registry reports an event for this MenuId.\n\t\t// This usually happen while code and extensions are loaded and affects the over\n\t\t// structure of the menu\n\t\tconst rebuildMenuSoon = new RunOnceScheduler(() => {\n\t\t\tthis._build();\n\t\t\tthis._onDidChange.fire(this);\n\t\t}, _options.eventDebounceDelay);\n\t\tthis._disposables.add(rebuildMenuSoon);\n\t\tthis._disposables.add(MenuRegistry.onDidChangeMenu(e => {\n\t\t\tif (e.has(_id)) {\n\t\t\t\trebuildMenuSoon.schedule();\n\t\t\t}\n\t\t}));\n\n\t\t// When context keys change we need to check if the menu also has changed. However,\n\t\t// we only do that when someone listens on this menu because (1) context key events are\n\t\t// firing often and (2) menu are often leaked\n\t\tconst contextKeyListener = this._disposables.add(new DisposableStore());\n\t\tconst startContextKeyListener = () => {\n\t\t\tconst fireChangeSoon = new RunOnceScheduler(() => this._onDidChange.fire(this), _options.eventDebounceDelay);\n\t\t\tcontextKeyListener.add(fireChangeSoon);\n\t\t\tcontextKeyListener.add(_contextKeyService.onDidChangeContext(e => {\n\t\t\t\tif (e.affectsSome(this._contextKeys)) {\n\t\t\t\t\tfireChangeSoon.schedule();\n\t\t\t\t}\n\t\t\t}));\n\t\t};\n\n\t\tthis._onDidChange = new Emitter({\n\t\t\t// start/stop context key listener\n\t\t\tonFirstListenerAdd: startContextKeyListener,\n\t\t\tonLastListenerRemove: contextKeyListener.clear.bind(contextKeyListener)\n\t\t});\n\t\tthis.onDidChange = this._onDidChange.event;\n\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables.dispose();\n\t\tthis._onDidChange.dispose();\n\t}\n\n\tprivate _build(): void {\n\n\t\t// reset\n\t\tthis._menuGroups.length = 0;\n\t\tthis._contextKeys.clear();\n\n\t\tconst menuItems = MenuRegistry.getMenuItems(this._id);\n\n\t\tlet group: MenuItemGroup | undefined;\n\t\tmenuItems.sort(Menu._compareMenuItems);\n\n\t\tfor (const item of menuItems) {\n\t\t\t// group by groupId\n\t\t\tconst groupName = item.group || '';\n\t\t\tif (!group || group[0] !== groupName) {\n\t\t\t\tgroup = [groupName, []];\n\t\t\t\tthis._menuGroups.push(group);\n\t\t\t}\n\t\t\tgroup![1].push(item);\n\n\t\t\t// keep keys for eventing\n\t\t\tthis._collectContextKeys(item);\n\t\t}\n\t}\n\n\tprivate _collectContextKeys(item: IMenuItem | ISubmenuItem): void {\n\n\t\tMenu._fillInKbExprKeys(item.when, this._contextKeys);\n\n\t\tif (isIMenuItem(item)) {\n\t\t\t// keep precondition keys for event if applicable\n\t\t\tif (item.command.precondition) {\n\t\t\t\tMenu._fillInKbExprKeys(item.command.precondition, this._contextKeys);\n\t\t\t}\n\t\t\t// keep toggled keys for event if applicable\n\t\t\tif (item.command.toggled) {\n\t\t\t\tconst toggledExpression: ContextKeyExpression = (item.command.toggled as { condition: ContextKeyExpression }).condition || item.command.toggled;\n\t\t\t\tMenu._fillInKbExprKeys(toggledExpression, this._contextKeys);\n\t\t\t}\n\n\t\t} else if (this._options.emitEventsForSubmenuChanges) {\n\t\t\t// recursively collect context keys from submenus so that this\n\t\t\t// menu fires events when context key changes affect submenus\n\t\t\tMenuRegistry.getMenuItems(item.submenu).forEach(this._collectContextKeys, this);\n\t\t}\n\t}\n\n\tgetActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][] {\n\t\tconst result: [string, Array<MenuItemAction | SubmenuItemAction>][] = [];\n\t\tfor (let group of this._menuGroups) {\n\t\t\tconst [id, items] = group;\n\t\t\tconst activeActions: Array<MenuItemAction | SubmenuItemAction> = [];\n\t\t\tfor (const item of items) {\n\t\t\t\tif (this._contextKeyService.contextMatchesRules(item.when)) {\n\t\t\t\t\tconst action = isIMenuItem(item)\n\t\t\t\t\t\t? new MenuItemAction(item.command, item.alt, options, this._contextKeyService, this._commandService)\n\t\t\t\t\t\t: new SubmenuItemAction(item, this._menuService, this._contextKeyService, options);\n\n\t\t\t\t\tactiveActions.push(action);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeActions.length > 0) {\n\t\t\t\tresult.push([id, activeActions]);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _fillInKbExprKeys(exp: ContextKeyExpression | undefined, set: Set<string>): void {\n\t\tif (exp) {\n\t\t\tfor (let key of exp.keys()) {\n\t\t\t\tset.add(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _compareMenuItems(a: IMenuItem | ISubmenuItem, b: IMenuItem | ISubmenuItem): number {\n\n\t\tlet aGroup = a.group;\n\t\tlet bGroup = b.group;\n\n\t\tif (aGroup !== bGroup) {\n\n\t\t\t// Falsy groups come last\n\t\t\tif (!aGroup) {\n\t\t\t\treturn 1;\n\t\t\t} else if (!bGroup) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// 'navigation' group comes first\n\t\t\tif (aGroup === 'navigation') {\n\t\t\t\treturn -1;\n\t\t\t} else if (bGroup === 'navigation') {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// lexical sort for groups\n\t\t\tlet value = aGroup.localeCompare(bGroup);\n\t\t\tif (value !== 0) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\t// sort on priority - default is 0\n\t\tlet aPrio = a.order || 0;\n\t\tlet bPrio = b.order || 0;\n\t\tif (aPrio < bPrio) {\n\t\t\treturn -1;\n\t\t} else if (aPrio > bPrio) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// sort on titles\n\t\treturn Menu._compareTitles(\n\t\t\tisIMenuItem(a) ? a.command.title : a.title,\n\t\t\tisIMenuItem(b) ? b.command.title : b.title\n\t\t);\n\t}\n\n\tprivate static _compareTitles(a: string | ILocalizedString, b: string | ILocalizedString) {\n\t\tconst aStr = typeof a === 'string' ? a : a.original;\n\t\tconst bStr = typeof b === 'string' ? b : b.original;\n\t\treturn aStr.localeCompare(bStr);\n\t}\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 { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { ModifierKeyEmitter } from 'vs/base/browser/dom';\nimport { Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { ContextMenuHandler, IContextMenuHandlerOptions } from './contextMenuHandler';\nimport { IContextMenuService, IContextViewService } from './contextView';\n\nexport class ContextMenuService extends Disposable implements IContextMenuService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate contextMenuHandler: ContextMenuHandler;\n\n\tprivate readonly _onDidShowContextMenu = new Emitter<void>();\n\n\tprivate readonly _onDidHideContextMenu = new Emitter<void>();\n\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IContextViewService contextViewService: IContextViewService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IThemeService themeService: IThemeService\n\t) {\n\t\tsuper();\n\n\t\tthis.contextMenuHandler = new ContextMenuHandler(contextViewService, telemetryService, notificationService, keybindingService, themeService);\n\t}\n\n\tconfigure(options: IContextMenuHandlerOptions): void {\n\t\tthis.contextMenuHandler.configure(options);\n\t}\n\n\t// ContextMenu\n\n\tshowContextMenu(delegate: IContextMenuDelegate): void {\n\t\tthis.contextMenuHandler.showContextMenu({\n\t\t\t...delegate,\n\t\t\tonHide: (didCancel) => {\n\t\t\t\tif (delegate.onHide) {\n\t\t\t\t\tdelegate.onHide(didCancel);\n\t\t\t\t}\n\n\t\t\t\tthis._onDidHideContextMenu.fire();\n\t\t\t}\n\t\t});\n\t\tModifierKeyEmitter.getInstance().resetKeyStatus();\n\t\tthis._onDidShowContextMenu.fire();\n\t}\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 { createStyleSheet } from 'vs/base/browser/dom';\nimport { IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { IPagedListOptions, IPagedRenderer, PagedList } from 'vs/base/browser/ui/list/listPaging';\nimport { DefaultStyleController, IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IMultipleSelectionController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List } from 'vs/base/browser/ui/list/listWidget';\nimport { ITableColumn, ITableRenderer, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';\nimport { ITableOptions, ITableOptionsUpdate, Table } from 'vs/base/browser/ui/table/tableWidget';\nimport { IAbstractTreeOptions, IAbstractTreeOptionsUpdate, IKeyboardNavigationEventFilter, RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree';\nimport { AsyncDataTree, CompressibleAsyncDataTree, IAsyncDataTreeOptions, IAsyncDataTreeOptionsUpdate, ICompressibleAsyncDataTreeOptions, ICompressibleAsyncDataTreeOptionsUpdate, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree';\nimport { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree';\nimport { CompressibleObjectTree, ICompressibleObjectTreeOptions, ICompressibleObjectTreeOptionsUpdate, ICompressibleTreeRenderer, IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree';\nimport { IAsyncDataSource, IDataSource, ITreeEvent, ITreeRenderer } from 'vs/base/browser/ui/tree/tree';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { combinedDisposable, Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { localize } from 'vs/nls';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys';\nimport { IEditorOptions } from 'vs/platform/editor/common/editor';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { attachListStyler, computeStyles, defaultListStyles, IColorMapping } from 'vs/platform/theme/common/styler';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport type ListWidget = List<any> | PagedList<any> | ObjectTree<any, any> | DataTree<any, any, any> | AsyncDataTree<any, any, any> | Table<any>;\nexport type WorkbenchListWidget = WorkbenchList<any> | WorkbenchPagedList<any> | WorkbenchObjectTree<any, any> | WorkbenchCompressibleObjectTree<any, any> | WorkbenchDataTree<any, any, any> | WorkbenchAsyncDataTree<any, any, any> | WorkbenchCompressibleAsyncDataTree<any, any, any> | WorkbenchTable<any>;\n\nexport const IListService = createDecorator<IListService>('listService');\n\nexport interface IListService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Returns the currently focused list widget if any.\n\t */\n\treadonly lastFocusedList: WorkbenchListWidget | undefined;\n}\n\ninterface IRegisteredList {\n\twidget: WorkbenchListWidget;\n\textraContextKeys?: (IContextKey<boolean>)[];\n}\n\nexport class ListService implements IListService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate disposables = new DisposableStore();\n\tprivate lists: IRegisteredList[] = [];\n\tprivate _lastFocusedWidget: WorkbenchListWidget | undefined = undefined;\n\tprivate _hasCreatedStyleController: boolean = false;\n\n\tget lastFocusedList(): WorkbenchListWidget | undefined {\n\t\treturn this._lastFocusedWidget;\n\t}\n\n\tconstructor(@IThemeService private readonly _themeService: IThemeService) { }\n\n\tprivate setLastFocusedList(widget: WorkbenchListWidget | undefined): void {\n\t\tif (widget === this._lastFocusedWidget) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastFocusedWidget?.getHTMLElement().classList.remove('last-focused');\n\t\tthis._lastFocusedWidget = widget;\n\t\tthis._lastFocusedWidget?.getHTMLElement().classList.add('last-focused');\n\t}\n\n\tregister(widget: WorkbenchListWidget, extraContextKeys?: (IContextKey<boolean>)[]): IDisposable {\n\t\tif (!this._hasCreatedStyleController) {\n\t\t\tthis._hasCreatedStyleController = true;\n\t\t\t// create a shared default tree style sheet for performance reasons\n\t\t\tconst styleController = new DefaultStyleController(createStyleSheet(), '');\n\t\t\tthis.disposables.add(attachListStyler(styleController, this._themeService));\n\t\t}\n\n\t\tif (this.lists.some(l => l.widget === widget)) {\n\t\t\tthrow new Error('Cannot register the same widget multiple times');\n\t\t}\n\n\t\t// Keep in our lists list\n\t\tconst registeredList: IRegisteredList = { widget, extraContextKeys };\n\t\tthis.lists.push(registeredList);\n\n\t\t// Check for currently being focused\n\t\tif (widget.getHTMLElement() === document.activeElement) {\n\t\t\tthis.setLastFocusedList(widget);\n\t\t}\n\n\t\treturn combinedDisposable(\n\t\t\twidget.onDidFocus(() => this.setLastFocusedList(widget)),\n\t\t\ttoDisposable(() => this.lists.splice(this.lists.indexOf(registeredList), 1)),\n\t\t\twidget.onDidDispose(() => {\n\t\t\t\tthis.lists = this.lists.filter(l => l !== registeredList);\n\t\t\t\tif (this._lastFocusedWidget === widget) {\n\t\t\t\t\tthis.setLastFocusedList(undefined);\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables.dispose();\n\t}\n}\n\nconst RawWorkbenchListFocusContextKey = new RawContextKey<boolean>('listFocus', true);\nexport const WorkbenchListSupportsMultiSelectContextKey = new RawContextKey<boolean>('listSupportsMultiselect', true);\nexport const WorkbenchListFocusContextKey = ContextKeyExpr.and(RawWorkbenchListFocusContextKey, ContextKeyExpr.not(InputFocusedContextKey));\nexport const WorkbenchListHasSelectionOrFocus = new RawContextKey<boolean>('listHasSelectionOrFocus', false);\nexport const WorkbenchListDoubleSelection = new RawContextKey<boolean>('listDoubleSelection', false);\nexport const WorkbenchListMultiSelection = new RawContextKey<boolean>('listMultiSelection', false);\nexport const WorkbenchListSelectionNavigation = new RawContextKey<boolean>('listSelectionNavigation', false);\nexport const WorkbenchTreeElementCanCollapse = new RawContextKey<boolean>('treeElementCanCollapse', false);\nexport const WorkbenchTreeElementHasParent = new RawContextKey<boolean>('treeElementHasParent', false);\nexport const WorkbenchTreeElementCanExpand = new RawContextKey<boolean>('treeElementCanExpand', false);\nexport const WorkbenchTreeElementHasChild = new RawContextKey<boolean>('treeElementHasChild', false);\nexport const WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation';\n\nfunction createScopedContextKeyService(contextKeyService: IContextKeyService, widget: ListWidget): IContextKeyService {\n\tconst result = contextKeyService.createScoped(widget.getHTMLElement());\n\tRawWorkbenchListFocusContextKey.bindTo(result);\n\treturn result;\n}\n\nconst multiSelectModifierSettingKey = 'workbench.list.multiSelectModifier';\nconst openModeSettingKey = 'workbench.list.openMode';\nconst horizontalScrollingKey = 'workbench.list.horizontalScrolling';\nconst keyboardNavigationSettingKey = 'workbench.list.keyboardNavigation';\nconst automaticKeyboardNavigationSettingKey = 'workbench.list.automaticKeyboardNavigation';\nconst treeIndentKey = 'workbench.tree.indent';\nconst treeRenderIndentGuidesKey = 'workbench.tree.renderIndentGuides';\nconst listSmoothScrolling = 'workbench.list.smoothScrolling';\nconst mouseWheelScrollSensitivityKey = 'workbench.list.mouseWheelScrollSensitivity';\nconst fastScrollSensitivityKey = 'workbench.list.fastScrollSensitivity';\nconst treeExpandMode = 'workbench.tree.expandMode';\n\nfunction useAltAsMultipleSelectionModifier(configurationService: IConfigurationService): boolean {\n\treturn configurationService.getValue(multiSelectModifierSettingKey) === 'alt';\n}\n\nclass MultipleSelectionController<T> extends Disposable implements IMultipleSelectionController<T> {\n\tprivate useAltAsMultipleSelectionModifier: boolean;\n\n\tconstructor(private configurationService: IConfigurationService) {\n\t\tsuper();\n\n\t\tthis.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\n\t\tthis.registerListeners();\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(multiSelectModifierSettingKey)) {\n\t\t\t\tthis.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService);\n\t\t\t}\n\t\t}));\n\t}\n\n\tisSelectionSingleChangeEvent(event: IListMouseEvent<T> | IListTouchEvent<T>): boolean {\n\t\tif (this.useAltAsMultipleSelectionModifier) {\n\t\t\treturn event.browserEvent.altKey;\n\t\t}\n\n\t\treturn isSelectionSingleChangeEvent(event);\n\t}\n\n\tisSelectionRangeChangeEvent(event: IListMouseEvent<T> | IListTouchEvent<T>): boolean {\n\t\treturn isSelectionRangeChangeEvent(event);\n\t}\n}\n\nfunction toWorkbenchListOptions<T>(options: IListOptions<T>, configurationService: IConfigurationService, keybindingService: IKeybindingService): [IListOptions<T>, IDisposable] {\n\tconst disposables = new DisposableStore();\n\tconst result: IListOptions<T> = {\n\t\t...options,\n\t\tkeyboardNavigationDelegate: { mightProducePrintableCharacter(e) { return keybindingService.mightProducePrintableCharacter(e); } },\n\t\tsmoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)),\n\t\tmouseWheelScrollSensitivity: configurationService.getValue<number>(mouseWheelScrollSensitivityKey),\n\t\tfastScrollSensitivity: configurationService.getValue<number>(fastScrollSensitivityKey),\n\t\tmultipleSelectionController: options.multipleSelectionController ?? disposables.add(new MultipleSelectionController(configurationService))\n\t};\n\n\treturn [result, disposables];\n}\n\nexport interface IWorkbenchListOptionsUpdate extends IListOptionsUpdate {\n\treadonly overrideStyles?: IColorMapping;\n}\n\nexport interface IWorkbenchListOptions<T> extends IWorkbenchListOptionsUpdate, IResourceNavigatorOptions, IListOptions<T> {\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchList<T> extends List<T> {\n\n\treadonly contextKeyService: IContextKeyService;\n\tprivate readonly themeService: IThemeService;\n\tprivate listSupportsMultiSelect: IContextKey<boolean>;\n\tprivate listHasSelectionOrFocus: IContextKey<boolean>;\n\tprivate listDoubleSelection: IContextKey<boolean>;\n\tprivate listMultiSelection: IContextKey<boolean>;\n\tprivate horizontalScrolling: boolean | undefined;\n\tprivate _styler: IDisposable | undefined;\n\tprivate _useAltAsMultipleSelectionModifier: boolean;\n\tprivate navigator: ListResourceNavigator<T>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: IListRenderer<T, any>[],\n\t\toptions: IWorkbenchListOptions<T>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService\n\t) {\n\t\tconst horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\tconst [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService);\n\n\t\tsuper(user, container, delegate, renderers,\n\t\t\t{\n\t\t\t\tkeyboardSupport: false,\n\t\t\t\t...computeStyles(themeService.getColorTheme(), defaultListStyles),\n\t\t\t\t...workbenchListOptions,\n\t\t\t\thorizontalScrolling\n\t\t\t}\n\t\t);\n\n\t\tthis.disposables.add(workbenchListOptionsDisposable);\n\n\t\tthis.contextKeyService = createScopedContextKeyService(contextKeyService, this);\n\t\tthis.themeService = themeService;\n\n\t\tthis.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);\n\t\tthis.listSupportsMultiSelect.set(options.multipleSelectionSupport !== false);\n\n\t\tconst listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService);\n\t\tlistSelectionNavigation.set(Boolean(options.selectionNavigation));\n\n\t\tthis.listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService);\n\t\tthis.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);\n\t\tthis.listMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService);\n\t\tthis.horizontalScrolling = options.horizontalScrolling;\n\n\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\n\t\tthis.disposables.add(this.contextKeyService);\n\t\tthis.disposables.add((listService as ListService).register(this));\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tthis.disposables.add(this.onDidChangeSelection(() => {\n\t\t\tconst selection = this.getSelection();\n\t\t\tconst focus = this.getFocus();\n\n\t\t\tthis.contextKeyService.bufferChangeEvents(() => {\n\t\t\t\tthis.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t\t\tthis.listMultiSelection.set(selection.length > 1);\n\t\t\t\tthis.listDoubleSelection.set(selection.length === 2);\n\t\t\t});\n\t\t}));\n\t\tthis.disposables.add(this.onDidChangeFocus(() => {\n\t\t\tconst selection = this.getSelection();\n\t\t\tconst focus = this.getFocus();\n\n\t\t\tthis.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t}));\n\t\tthis.disposables.add(configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(multiSelectModifierSettingKey)) {\n\t\t\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\t\t\t}\n\n\t\t\tlet options: IListOptionsUpdate = {};\n\n\t\t\tif (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === undefined) {\n\t\t\t\tconst horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\t\t\toptions = { ...options, horizontalScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(listSmoothScrolling)) {\n\t\t\t\tconst smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling));\n\t\t\t\toptions = { ...options, smoothScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) {\n\t\t\t\tconst mouseWheelScrollSensitivity = configurationService.getValue<number>(mouseWheelScrollSensitivityKey);\n\t\t\t\toptions = { ...options, mouseWheelScrollSensitivity };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(fastScrollSensitivityKey)) {\n\t\t\t\tconst fastScrollSensitivity = configurationService.getValue<number>(fastScrollSensitivityKey);\n\t\t\t\toptions = { ...options, fastScrollSensitivity };\n\t\t\t}\n\t\t\tif (Object.keys(options).length > 0) {\n\t\t\t\tthis.updateOptions(options);\n\t\t\t}\n\t\t}));\n\n\t\tthis.navigator = new ListResourceNavigator(this, { configurationService, ...options });\n\t\tthis.disposables.add(this.navigator);\n\t}\n\n\toverride updateOptions(options: IWorkbenchListOptionsUpdate): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tif (options.multipleSelectionSupport !== undefined) {\n\t\t\tthis.listSupportsMultiSelect.set(!!options.multipleSelectionSupport);\n\t\t}\n\t}\n\n\tprivate updateStyles(styles: IColorMapping): void {\n\t\tthis._styler?.dispose();\n\t\tthis._styler = attachListStyler(this, this.themeService, styles);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._styler?.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IWorkbenchPagedListOptions<T> extends IWorkbenchListOptionsUpdate, IResourceNavigatorOptions, IPagedListOptions<T> {\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchPagedList<T> extends PagedList<T> {\n\n\treadonly contextKeyService: IContextKeyService;\n\tprivate readonly themeService: IThemeService;\n\tprivate readonly disposables: DisposableStore;\n\tprivate listSupportsMultiSelect: IContextKey<boolean>;\n\tprivate _useAltAsMultipleSelectionModifier: boolean;\n\tprivate horizontalScrolling: boolean | undefined;\n\tprivate _styler: IDisposable | undefined;\n\tprivate navigator: ListResourceNavigator<T>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<number>,\n\t\trenderers: IPagedRenderer<T, any>[],\n\t\toptions: IWorkbenchPagedListOptions<T>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService\n\t) {\n\t\tconst horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\tconst [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService);\n\t\tsuper(user, container, delegate, renderers,\n\t\t\t{\n\t\t\t\tkeyboardSupport: false,\n\t\t\t\t...computeStyles(themeService.getColorTheme(), defaultListStyles),\n\t\t\t\t...workbenchListOptions,\n\t\t\t\thorizontalScrolling\n\t\t\t}\n\t\t);\n\n\t\tthis.disposables = new DisposableStore();\n\t\tthis.disposables.add(workbenchListOptionsDisposable);\n\n\t\tthis.contextKeyService = createScopedContextKeyService(contextKeyService, this);\n\t\tthis.themeService = themeService;\n\n\t\tthis.horizontalScrolling = options.horizontalScrolling;\n\n\t\tthis.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);\n\t\tthis.listSupportsMultiSelect.set(options.multipleSelectionSupport !== false);\n\n\t\tconst listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService);\n\t\tlistSelectionNavigation.set(Boolean(options.selectionNavigation));\n\n\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\n\t\tthis.disposables.add(this.contextKeyService);\n\t\tthis.disposables.add((listService as ListService).register(this));\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.disposables.add(attachListStyler(this, themeService, options.overrideStyles));\n\t\t}\n\n\t\tthis.disposables.add(configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(multiSelectModifierSettingKey)) {\n\t\t\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\t\t\t}\n\n\t\t\tlet options: IListOptionsUpdate = {};\n\n\t\t\tif (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === undefined) {\n\t\t\t\tconst horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\t\t\toptions = { ...options, horizontalScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(listSmoothScrolling)) {\n\t\t\t\tconst smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling));\n\t\t\t\toptions = { ...options, smoothScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) {\n\t\t\t\tconst mouseWheelScrollSensitivity = configurationService.getValue<number>(mouseWheelScrollSensitivityKey);\n\t\t\t\toptions = { ...options, mouseWheelScrollSensitivity };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(fastScrollSensitivityKey)) {\n\t\t\t\tconst fastScrollSensitivity = configurationService.getValue<number>(fastScrollSensitivityKey);\n\t\t\t\toptions = { ...options, fastScrollSensitivity };\n\t\t\t}\n\t\t\tif (Object.keys(options).length > 0) {\n\t\t\t\tthis.updateOptions(options);\n\t\t\t}\n\t\t}));\n\n\t\tthis.navigator = new ListResourceNavigator(this, { configurationService, ...options });\n\t\tthis.disposables.add(this.navigator);\n\t}\n\n\toverride updateOptions(options: IWorkbenchListOptionsUpdate): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tif (options.multipleSelectionSupport !== undefined) {\n\t\t\tthis.listSupportsMultiSelect.set(!!options.multipleSelectionSupport);\n\t\t}\n\t}\n\n\tprivate updateStyles(styles: IColorMapping): void {\n\t\tthis._styler?.dispose();\n\t\tthis._styler = attachListStyler(this, this.themeService, styles);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._styler?.dispose();\n\t\tthis.disposables.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IWorkbenchTableOptionsUpdate extends ITableOptionsUpdate {\n\treadonly overrideStyles?: IColorMapping;\n}\n\nexport interface IWorkbenchTableOptions<T> extends IWorkbenchTableOptionsUpdate, IResourceNavigatorOptions, ITableOptions<T> {\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchTable<TRow> extends Table<TRow> {\n\n\treadonly contextKeyService: IContextKeyService;\n\tprivate readonly themeService: IThemeService;\n\tprivate listSupportsMultiSelect: IContextKey<boolean>;\n\tprivate listHasSelectionOrFocus: IContextKey<boolean>;\n\tprivate listDoubleSelection: IContextKey<boolean>;\n\tprivate listMultiSelection: IContextKey<boolean>;\n\tprivate horizontalScrolling: boolean | undefined;\n\tprivate _styler: IDisposable | undefined;\n\tprivate _useAltAsMultipleSelectionModifier: boolean;\n\tprivate navigator: TableResourceNavigator<TRow>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: ITableVirtualDelegate<TRow>,\n\t\tcolumns: ITableColumn<TRow, any>[],\n\t\trenderers: ITableRenderer<TRow, any>[],\n\t\toptions: IWorkbenchTableOptions<TRow>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService\n\t) {\n\t\tconst horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\tconst [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService);\n\n\t\tsuper(user, container, delegate, columns, renderers,\n\t\t\t{\n\t\t\t\tkeyboardSupport: false,\n\t\t\t\t...computeStyles(themeService.getColorTheme(), defaultListStyles),\n\t\t\t\t...workbenchListOptions,\n\t\t\t\thorizontalScrolling\n\t\t\t}\n\t\t);\n\n\t\tthis.disposables.add(workbenchListOptionsDisposable);\n\n\t\tthis.contextKeyService = createScopedContextKeyService(contextKeyService, this);\n\t\tthis.themeService = themeService;\n\n\t\tthis.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);\n\t\tthis.listSupportsMultiSelect.set(options.multipleSelectionSupport !== false);\n\n\t\tconst listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService);\n\t\tlistSelectionNavigation.set(Boolean(options.selectionNavigation));\n\n\t\tthis.listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService);\n\t\tthis.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);\n\t\tthis.listMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService);\n\t\tthis.horizontalScrolling = options.horizontalScrolling;\n\n\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\n\t\tthis.disposables.add(this.contextKeyService);\n\t\tthis.disposables.add((listService as ListService).register(this));\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tthis.disposables.add(this.onDidChangeSelection(() => {\n\t\t\tconst selection = this.getSelection();\n\t\t\tconst focus = this.getFocus();\n\n\t\t\tthis.contextKeyService.bufferChangeEvents(() => {\n\t\t\t\tthis.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t\t\tthis.listMultiSelection.set(selection.length > 1);\n\t\t\t\tthis.listDoubleSelection.set(selection.length === 2);\n\t\t\t});\n\t\t}));\n\t\tthis.disposables.add(this.onDidChangeFocus(() => {\n\t\t\tconst selection = this.getSelection();\n\t\t\tconst focus = this.getFocus();\n\n\t\t\tthis.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t}));\n\t\tthis.disposables.add(configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(multiSelectModifierSettingKey)) {\n\t\t\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\t\t\t}\n\n\t\t\tlet options: IListOptionsUpdate = {};\n\n\t\t\tif (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === undefined) {\n\t\t\t\tconst horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\t\t\toptions = { ...options, horizontalScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(listSmoothScrolling)) {\n\t\t\t\tconst smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling));\n\t\t\t\toptions = { ...options, smoothScrolling };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) {\n\t\t\t\tconst mouseWheelScrollSensitivity = configurationService.getValue<number>(mouseWheelScrollSensitivityKey);\n\t\t\t\toptions = { ...options, mouseWheelScrollSensitivity };\n\t\t\t}\n\t\t\tif (e.affectsConfiguration(fastScrollSensitivityKey)) {\n\t\t\t\tconst fastScrollSensitivity = configurationService.getValue<number>(fastScrollSensitivityKey);\n\t\t\t\toptions = { ...options, fastScrollSensitivity };\n\t\t\t}\n\t\t\tif (Object.keys(options).length > 0) {\n\t\t\t\tthis.updateOptions(options);\n\t\t\t}\n\t\t}));\n\n\t\tthis.navigator = new TableResourceNavigator(this, { configurationService, ...options });\n\t\tthis.disposables.add(this.navigator);\n\t}\n\n\toverride updateOptions(options: IWorkbenchTableOptionsUpdate): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.updateStyles(options.overrideStyles);\n\t\t}\n\n\t\tif (options.multipleSelectionSupport !== undefined) {\n\t\t\tthis.listSupportsMultiSelect.set(!!options.multipleSelectionSupport);\n\t\t}\n\t}\n\n\tprivate updateStyles(styles: IColorMapping): void {\n\t\tthis._styler?.dispose();\n\t\tthis._styler = attachListStyler(this, this.themeService, styles);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._styler?.dispose();\n\t\tthis.disposables.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IOpenEvent<T> {\n\teditorOptions: IEditorOptions;\n\tsideBySide: boolean;\n\telement: T;\n\tbrowserEvent?: UIEvent;\n}\n\nexport interface IResourceNavigatorOptions {\n\treadonly configurationService?: IConfigurationService;\n\treadonly openOnSingleClick?: boolean;\n}\n\nexport interface SelectionKeyboardEvent extends KeyboardEvent {\n\tpreserveFocus?: boolean;\n\tpinned?: boolean;\n\t__forceEvent?: boolean;\n}\n\nabstract class ResourceNavigator<T> extends Disposable {\n\n\tprivate openOnSingleClick: boolean;\n\n\tprivate readonly _onDidOpen = this._register(new Emitter<IOpenEvent<T | undefined>>());\n\treadonly onDidOpen: Event<IOpenEvent<T | undefined>> = this._onDidOpen.event;\n\n\tconstructor(\n\t\tprotected readonly widget: ListWidget,\n\t\toptions?: IResourceNavigatorOptions\n\t) {\n\t\tsuper();\n\n\t\tthis._register(Event.filter(this.widget.onDidChangeSelection, e => e.browserEvent instanceof KeyboardEvent)(e => this.onSelectionFromKeyboard(e)));\n\t\tthis._register(this.widget.onPointer((e: { browserEvent: MouseEvent; element: T | undefined }) => this.onPointer(e.element, e.browserEvent)));\n\t\tthis._register(this.widget.onMouseDblClick((e: { browserEvent: MouseEvent; element: T | undefined }) => this.onMouseDblClick(e.element, e.browserEvent)));\n\n\t\tif (typeof options?.openOnSingleClick !== 'boolean' && options?.configurationService) {\n\t\t\tthis.openOnSingleClick = options?.configurationService!.getValue(openModeSettingKey) !== 'doubleClick';\n\t\t\tthis._register(options?.configurationService.onDidChangeConfiguration(() => {\n\t\t\t\tthis.openOnSingleClick = options?.configurationService!.getValue(openModeSettingKey) !== 'doubleClick';\n\t\t\t}));\n\t\t} else {\n\t\t\tthis.openOnSingleClick = options?.openOnSingleClick ?? true;\n\t\t}\n\t}\n\n\tprivate onSelectionFromKeyboard(event: ITreeEvent<any>): void {\n\t\tif (event.elements.length !== 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selectionKeyboardEvent = event.browserEvent as SelectionKeyboardEvent;\n\t\tconst preserveFocus = typeof selectionKeyboardEvent.preserveFocus === 'boolean' ? selectionKeyboardEvent.preserveFocus! : true;\n\t\tconst pinned = typeof selectionKeyboardEvent.pinned === 'boolean' ? selectionKeyboardEvent.pinned! : !preserveFocus;\n\t\tconst sideBySide = false;\n\n\t\tthis._open(this.getSelectedElement(), preserveFocus, pinned, sideBySide, event.browserEvent);\n\t}\n\n\tprivate onPointer(element: T | undefined, browserEvent: MouseEvent): void {\n\t\tif (!this.openOnSingleClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isDoubleClick = browserEvent.detail === 2;\n\n\t\tif (isDoubleClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isMiddleClick = browserEvent.button === 1;\n\t\tconst preserveFocus = true;\n\t\tconst pinned = isMiddleClick;\n\t\tconst sideBySide = browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey;\n\n\t\tthis._open(element, preserveFocus, pinned, sideBySide, browserEvent);\n\t}\n\n\tprivate onMouseDblClick(element: T | undefined, browserEvent?: MouseEvent): void {\n\t\tif (!browserEvent) {\n\t\t\treturn;\n\t\t}\n\n\t\t// copied from AbstractTree\n\t\tconst target = browserEvent.target as HTMLElement;\n\t\tconst onTwistie = target.classList.contains('monaco-tl-twistie')\n\t\t\t|| (target.classList.contains('monaco-icon-label') && target.classList.contains('folder-icon') && browserEvent.offsetX < 16);\n\n\t\tif (onTwistie) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst preserveFocus = false;\n\t\tconst pinned = true;\n\t\tconst sideBySide = (browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey);\n\n\t\tthis._open(element, preserveFocus, pinned, sideBySide, browserEvent);\n\t}\n\n\tprivate _open(element: T | undefined, preserveFocus: boolean, pinned: boolean, sideBySide: boolean, browserEvent?: UIEvent): void {\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onDidOpen.fire({\n\t\t\teditorOptions: {\n\t\t\t\tpreserveFocus,\n\t\t\t\tpinned,\n\t\t\t\trevealIfVisible: true\n\t\t\t},\n\t\t\tsideBySide,\n\t\t\telement,\n\t\t\tbrowserEvent\n\t\t});\n\t}\n\n\tabstract getSelectedElement(): T | undefined;\n}\n\nclass ListResourceNavigator<T> extends ResourceNavigator<T> {\n\n\tprotected override readonly widget: List<T> | PagedList<T>;\n\n\tconstructor(\n\t\twidget: List<T> | PagedList<T>,\n\t\toptions: IResourceNavigatorOptions\n\t) {\n\t\tsuper(widget, options);\n\t\tthis.widget = widget;\n\t}\n\n\tgetSelectedElement(): T | undefined {\n\t\treturn this.widget.getSelectedElements()[0];\n\t}\n}\n\nclass TableResourceNavigator<TRow> extends ResourceNavigator<TRow> {\n\n\tprotected override readonly widget!: Table<TRow>;\n\n\tconstructor(\n\t\twidget: Table<TRow>,\n\t\toptions: IResourceNavigatorOptions\n\t) {\n\t\tsuper(widget, options);\n\t}\n\n\tgetSelectedElement(): TRow | undefined {\n\t\treturn this.widget.getSelectedElements()[0];\n\t}\n}\n\nclass TreeResourceNavigator<T, TFilterData> extends ResourceNavigator<T> {\n\n\tprotected override readonly widget!: ObjectTree<T, TFilterData> | CompressibleObjectTree<T, TFilterData> | DataTree<any, T, TFilterData> | AsyncDataTree<any, T, TFilterData> | CompressibleAsyncDataTree<any, T, TFilterData>;\n\n\tconstructor(\n\t\twidget: ObjectTree<T, TFilterData> | CompressibleObjectTree<T, TFilterData> | DataTree<any, T, TFilterData> | AsyncDataTree<any, T, TFilterData> | CompressibleAsyncDataTree<any, T, TFilterData>,\n\t\toptions: IResourceNavigatorOptions\n\t) {\n\t\tsuper(widget, options);\n\t}\n\n\tgetSelectedElement(): T | undefined {\n\t\treturn this.widget.getSelection()[0] ?? undefined;\n\t}\n}\n\nfunction createKeyboardNavigationEventFilter(container: HTMLElement, keybindingService: IKeybindingService): IKeyboardNavigationEventFilter {\n\tlet inChord = false;\n\n\treturn event => {\n\t\tif (event.toKeybinding().isModifierKey()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (inChord) {\n\t\t\tinChord = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tconst result = keybindingService.softDispatch(event, container);\n\n\t\tif (result && result.enterChord) {\n\t\t\tinChord = true;\n\t\t\treturn false;\n\t\t}\n\n\t\tinChord = false;\n\t\treturn true;\n\t};\n}\n\nexport interface IWorkbenchObjectTreeOptions<T, TFilterData> extends IObjectTreeOptions<T, TFilterData>, IResourceNavigatorOptions {\n\treadonly overrideStyles?: IColorMapping;\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void> extends ObjectTree<T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<any, T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\toptions: IWorkbenchObjectTreeOptions<T, TFilterData>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService\n\t) {\n\t\tconst { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchObjectTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(user, container, delegate, renderers, treeOptions);\n\t\tthis.disposables.add(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.add(this.internals);\n\t}\n\n\toverride updateOptions(options: IAbstractTreeOptionsUpdate): void {\n\t\tsuper.updateOptions(options);\n\t\tthis.internals.updateOptions(options);\n\t}\n}\n\nexport interface IWorkbenchCompressibleObjectTreeOptionsUpdate extends ICompressibleObjectTreeOptionsUpdate {\n\treadonly overrideStyles?: IColorMapping;\n}\n\nexport interface IWorkbenchCompressibleObjectTreeOptions<T, TFilterData> extends IWorkbenchCompressibleObjectTreeOptionsUpdate, ICompressibleObjectTreeOptions<T, TFilterData>, IResourceNavigatorOptions {\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilterData = void> extends CompressibleObjectTree<T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<any, T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ICompressibleTreeRenderer<T, TFilterData, any>[],\n\t\toptions: IWorkbenchCompressibleObjectTreeOptions<T, TFilterData>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService\n\t) {\n\t\tconst { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchCompressibleObjectTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(user, container, delegate, renderers, treeOptions);\n\t\tthis.disposables.add(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.add(this.internals);\n\t}\n\n\toverride updateOptions(options: IWorkbenchCompressibleObjectTreeOptionsUpdate = {}): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.internals.updateStyleOverrides(options.overrideStyles);\n\t\t}\n\n\t\tthis.internals.updateOptions(options);\n\t}\n}\n\nexport interface IWorkbenchDataTreeOptionsUpdate extends IAbstractTreeOptionsUpdate {\n\treadonly overrideStyles?: IColorMapping;\n}\n\nexport interface IWorkbenchDataTreeOptions<T, TFilterData> extends IWorkbenchDataTreeOptionsUpdate, IDataTreeOptions<T, TFilterData>, IResourceNavigatorOptions {\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<TInput, T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<TInput, T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\tdataSource: IDataSource<TInput, T>,\n\t\toptions: IWorkbenchDataTreeOptions<T, TFilterData>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService\n\t) {\n\t\tconst { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(user, container, delegate, renderers, dataSource, treeOptions);\n\t\tthis.disposables.add(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.add(this.internals);\n\t}\n\n\toverride updateOptions(options: IWorkbenchDataTreeOptionsUpdate = {}): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.internals.updateStyleOverrides(options.overrideStyles);\n\t\t}\n\n\t\tthis.internals.updateOptions(options);\n\t}\n}\n\nexport interface IWorkbenchAsyncDataTreeOptionsUpdate extends IAsyncDataTreeOptionsUpdate {\n\treadonly overrideStyles?: IColorMapping;\n}\n\nexport interface IWorkbenchAsyncDataTreeOptions<T, TFilterData> extends IWorkbenchAsyncDataTreeOptionsUpdate, IAsyncDataTreeOptions<T, TFilterData>, IResourceNavigatorOptions {\n\treadonly accessibilityProvider: IListAccessibilityProvider<T>;\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends AsyncDataTree<TInput, T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<TInput, T, TFilterData>;\n\tget onDidOpen(): Event<IOpenEvent<T | undefined>> { return this.internals.onDidOpen; }\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<T, TFilterData, any>[],\n\t\tdataSource: IAsyncDataSource<TInput, T>,\n\t\toptions: IWorkbenchAsyncDataTreeOptions<T, TFilterData>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService\n\t) {\n\t\tconst { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchAsyncDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(user, container, delegate, renderers, dataSource, treeOptions);\n\t\tthis.disposables.add(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.add(this.internals);\n\t}\n\n\toverride updateOptions(options: IWorkbenchAsyncDataTreeOptionsUpdate = {}): void {\n\t\tsuper.updateOptions(options);\n\n\t\tif (options.overrideStyles) {\n\t\t\tthis.internals.updateStyleOverrides(options.overrideStyles);\n\t\t}\n\n\t\tthis.internals.updateOptions(options);\n\t}\n}\n\nexport interface IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData> extends ICompressibleAsyncDataTreeOptions<T, TFilterData>, IResourceNavigatorOptions {\n\treadonly overrideStyles?: IColorMapping;\n\treadonly selectionNavigation?: boolean;\n}\n\nexport class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> extends CompressibleAsyncDataTree<TInput, T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<TInput, T, TFilterData>;\n\n\tconstructor(\n\t\tuser: string,\n\t\tcontainer: HTMLElement,\n\t\tvirtualDelegate: IListVirtualDelegate<T>,\n\t\tcompressionDelegate: ITreeCompressionDelegate<T>,\n\t\trenderers: ICompressibleTreeRenderer<T, TFilterData, any>[],\n\t\tdataSource: IAsyncDataSource<TInput, T>,\n\t\toptions: IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService\n\t) {\n\t\tconst { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions);\n\t\tthis.disposables.add(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.add(this.internals);\n\t}\n\n\toverride updateOptions(options: ICompressibleAsyncDataTreeOptionsUpdate): void {\n\t\tsuper.updateOptions(options);\n\t\tthis.internals.updateOptions(options);\n\t}\n}\n\nfunction workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTreeOptions<T, TFilterData> | IAsyncDataTreeOptions<T, TFilterData>>(\n\tcontainer: HTMLElement,\n\toptions: TOptions,\n\tcontextKeyService: IContextKeyService,\n\tconfigurationService: IConfigurationService,\n\tkeybindingService: IKeybindingService,\n\taccessibilityService: IAccessibilityService,\n): { options: TOptions; getAutomaticKeyboardNavigation: () => boolean | undefined; disposable: IDisposable } {\n\tconst getAutomaticKeyboardNavigation = () => {\n\t\t// give priority to the context key value to disable this completely\n\t\tlet automaticKeyboardNavigation = Boolean(contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey));\n\n\t\tif (automaticKeyboardNavigation) {\n\t\t\tautomaticKeyboardNavigation = Boolean(configurationService.getValue(automaticKeyboardNavigationSettingKey));\n\t\t}\n\n\t\treturn automaticKeyboardNavigation;\n\t};\n\n\tconst accessibilityOn = accessibilityService.isScreenReaderOptimized();\n\tconst keyboardNavigation = options.simpleKeyboardNavigation || accessibilityOn ? 'simple' : configurationService.getValue<string>(keyboardNavigationSettingKey);\n\tconst horizontalScrolling = options.horizontalScrolling !== undefined ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey));\n\tconst [workbenchListOptions, disposable] = toWorkbenchListOptions(options, configurationService, keybindingService);\n\tconst additionalScrollHeight = options.additionalScrollHeight;\n\n\treturn {\n\t\tgetAutomaticKeyboardNavigation,\n\t\tdisposable,\n\t\toptions: {\n\t\t\t// ...options, // TODO@Joao why is this not splatted here?\n\t\t\tkeyboardSupport: false,\n\t\t\t...workbenchListOptions,\n\t\t\tindent: typeof configurationService.getValue(treeIndentKey) === 'number' ? configurationService.getValue(treeIndentKey) : undefined,\n\t\t\trenderIndentGuides: configurationService.getValue<RenderIndentGuides>(treeRenderIndentGuidesKey),\n\t\t\tsmoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)),\n\t\t\tautomaticKeyboardNavigation: getAutomaticKeyboardNavigation(),\n\t\t\tsimpleKeyboardNavigation: keyboardNavigation === 'simple',\n\t\t\tfilterOnType: keyboardNavigation === 'filter',\n\t\t\thorizontalScrolling,\n\t\t\tkeyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService),\n\t\t\tadditionalScrollHeight,\n\t\t\thideTwistiesOfChildlessElements: options.hideTwistiesOfChildlessElements,\n\t\t\texpandOnlyOnTwistieClick: options.expandOnlyOnTwistieClick ?? (configurationService.getValue<'singleClick' | 'doubleClick'>(treeExpandMode) === 'doubleClick')\n\t\t} as TOptions\n\t};\n}\n\ninterface IWorkbenchTreeInternalsOptionsUpdate {\n\treadonly multipleSelectionSupport?: boolean;\n}\n\nclass WorkbenchTreeInternals<TInput, T, TFilterData> {\n\n\treadonly contextKeyService: IContextKeyService;\n\tprivate listSupportsMultiSelect: IContextKey<boolean>;\n\tprivate hasSelectionOrFocus: IContextKey<boolean>;\n\tprivate hasDoubleSelection: IContextKey<boolean>;\n\tprivate hasMultiSelection: IContextKey<boolean>;\n\tprivate treeElementCanCollapse: IContextKey<boolean>;\n\tprivate treeElementHasParent: IContextKey<boolean>;\n\tprivate treeElementCanExpand: IContextKey<boolean>;\n\tprivate treeElementHasChild: IContextKey<boolean>;\n\tprivate _useAltAsMultipleSelectionModifier: boolean;\n\tprivate disposables: IDisposable[] = [];\n\tprivate styler: IDisposable | undefined;\n\tprivate navigator: TreeResourceNavigator<T, TFilterData>;\n\n\tget onDidOpen(): Event<IOpenEvent<T | undefined>> { return this.navigator.onDidOpen; }\n\n\tconstructor(\n\t\tprivate tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchCompressibleObjectTree<T, TFilterData> | WorkbenchDataTree<TInput, T, TFilterData> | WorkbenchAsyncDataTree<TInput, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData>,\n\t\toptions: IWorkbenchObjectTreeOptions<T, TFilterData> | IWorkbenchCompressibleObjectTreeOptions<T, TFilterData> | IWorkbenchDataTreeOptions<T, TFilterData> | IWorkbenchAsyncDataTreeOptions<T, TFilterData> | IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>,\n\t\tgetAutomaticKeyboardNavigation: () => boolean | undefined,\n\t\toverrideStyles: IColorMapping | undefined,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IListService listService: IListService,\n\t\t@IThemeService private themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t) {\n\t\tthis.contextKeyService = createScopedContextKeyService(contextKeyService, tree);\n\n\t\tthis.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);\n\t\tthis.listSupportsMultiSelect.set(options.multipleSelectionSupport !== false);\n\n\t\tconst listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService);\n\t\tlistSelectionNavigation.set(Boolean(options.selectionNavigation));\n\n\t\tthis.hasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService);\n\t\tthis.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);\n\t\tthis.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService);\n\n\t\tthis.treeElementCanCollapse = WorkbenchTreeElementCanCollapse.bindTo(this.contextKeyService);\n\t\tthis.treeElementHasParent = WorkbenchTreeElementHasParent.bindTo(this.contextKeyService);\n\t\tthis.treeElementCanExpand = WorkbenchTreeElementCanExpand.bindTo(this.contextKeyService);\n\t\tthis.treeElementHasChild = WorkbenchTreeElementHasChild.bindTo(this.contextKeyService);\n\n\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\n\t\tconst interestingContextKeys = new Set();\n\t\tinterestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationKey);\n\t\tconst updateKeyboardNavigation = () => {\n\t\t\tconst accessibilityOn = accessibilityService.isScreenReaderOptimized();\n\t\t\tconst keyboardNavigation = accessibilityOn ? 'simple' : configurationService.getValue<string>(keyboardNavigationSettingKey);\n\t\t\ttree.updateOptions({\n\t\t\t\tsimpleKeyboardNavigation: keyboardNavigation === 'simple',\n\t\t\t\tfilterOnType: keyboardNavigation === 'filter'\n\t\t\t});\n\t\t};\n\n\t\tthis.updateStyleOverrides(overrideStyles);\n\n\t\tconst updateCollapseContextKeys = () => {\n\t\t\tconst focus = tree.getFocus()[0];\n\n\t\t\tif (!focus) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst node = tree.getNode(focus);\n\t\t\tthis.treeElementCanCollapse.set(node.collapsible && !node.collapsed);\n\t\t\tthis.treeElementHasParent.set(!!tree.getParentElement(focus));\n\t\t\tthis.treeElementCanExpand.set(node.collapsible && node.collapsed);\n\t\t\tthis.treeElementHasChild.set(!!tree.getFirstElementChild(focus));\n\t\t};\n\n\t\tthis.disposables.push(\n\t\t\tthis.contextKeyService,\n\t\t\t(listService as ListService).register(tree),\n\t\t\ttree.onDidChangeSelection(() => {\n\t\t\t\tconst selection = tree.getSelection();\n\t\t\t\tconst focus = tree.getFocus();\n\n\t\t\t\tthis.contextKeyService.bufferChangeEvents(() => {\n\t\t\t\t\tthis.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t\t\t\tthis.hasMultiSelection.set(selection.length > 1);\n\t\t\t\t\tthis.hasDoubleSelection.set(selection.length === 2);\n\t\t\t\t});\n\t\t\t}),\n\t\t\ttree.onDidChangeFocus(() => {\n\t\t\t\tconst selection = tree.getSelection();\n\t\t\t\tconst focus = tree.getFocus();\n\n\t\t\t\tthis.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t\t\tupdateCollapseContextKeys();\n\t\t\t}),\n\t\t\ttree.onDidChangeCollapseState(updateCollapseContextKeys),\n\t\t\ttree.onDidChangeModel(updateCollapseContextKeys),\n\t\t\tconfigurationService.onDidChangeConfiguration(e => {\n\t\t\t\tlet newOptions: IAbstractTreeOptionsUpdate = {};\n\t\t\t\tif (e.affectsConfiguration(multiSelectModifierSettingKey)) {\n\t\t\t\t\tthis._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(treeIndentKey)) {\n\t\t\t\t\tconst indent = configurationService.getValue<number>(treeIndentKey);\n\t\t\t\t\tnewOptions = { ...newOptions, indent };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(treeRenderIndentGuidesKey)) {\n\t\t\t\t\tconst renderIndentGuides = configurationService.getValue<RenderIndentGuides>(treeRenderIndentGuidesKey);\n\t\t\t\t\tnewOptions = { ...newOptions, renderIndentGuides };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(listSmoothScrolling)) {\n\t\t\t\t\tconst smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling));\n\t\t\t\t\tnewOptions = { ...newOptions, smoothScrolling };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(keyboardNavigationSettingKey)) {\n\t\t\t\t\tupdateKeyboardNavigation();\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(automaticKeyboardNavigationSettingKey)) {\n\t\t\t\t\tnewOptions = { ...newOptions, automaticKeyboardNavigation: getAutomaticKeyboardNavigation() };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(horizontalScrollingKey) && options.horizontalScrolling === undefined) {\n\t\t\t\t\tconst horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey));\n\t\t\t\t\tnewOptions = { ...newOptions, horizontalScrolling };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(treeExpandMode) && options.expandOnlyOnTwistieClick === undefined) {\n\t\t\t\t\tnewOptions = { ...newOptions, expandOnlyOnTwistieClick: configurationService.getValue<'singleClick' | 'doubleClick'>(treeExpandMode) === 'doubleClick' };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) {\n\t\t\t\t\tconst mouseWheelScrollSensitivity = configurationService.getValue<number>(mouseWheelScrollSensitivityKey);\n\t\t\t\t\tnewOptions = { ...newOptions, mouseWheelScrollSensitivity };\n\t\t\t\t}\n\t\t\t\tif (e.affectsConfiguration(fastScrollSensitivityKey)) {\n\t\t\t\t\tconst fastScrollSensitivity = configurationService.getValue<number>(fastScrollSensitivityKey);\n\t\t\t\t\tnewOptions = { ...newOptions, fastScrollSensitivity };\n\t\t\t\t}\n\t\t\t\tif (Object.keys(newOptions).length > 0) {\n\t\t\t\t\ttree.updateOptions(newOptions);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tthis.contextKeyService.onDidChangeContext(e => {\n\t\t\t\tif (e.affectsSome(interestingContextKeys)) {\n\t\t\t\t\ttree.updateOptions({ automaticKeyboardNavigation: getAutomaticKeyboardNavigation() });\n\t\t\t\t}\n\t\t\t}),\n\t\t\taccessibilityService.onDidChangeScreenReaderOptimized(() => updateKeyboardNavigation())\n\t\t);\n\n\t\tthis.navigator = new TreeResourceNavigator(tree, { configurationService, ...options });\n\t\tthis.disposables.push(this.navigator);\n\t}\n\n\tupdateOptions(options: IWorkbenchTreeInternalsOptionsUpdate): void {\n\t\tif (options.multipleSelectionSupport !== undefined) {\n\t\t\tthis.listSupportsMultiSelect.set(!!options.multipleSelectionSupport);\n\t\t}\n\t}\n\n\tupdateStyleOverrides(overrideStyles?: IColorMapping): void {\n\t\tdispose(this.styler);\n\t\tthis.styler = overrideStyles ? attachListStyler(this.tree, this.themeService, overrideStyles) : Disposable.None;\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables = dispose(this.disposables);\n\t\tdispose(this.styler);\n\t\tthis.styler = undefined;\n\t}\n}\n\nconst configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);\n\nconfigurationRegistry.registerConfiguration({\n\tid: 'workbench',\n\torder: 7,\n\ttitle: localize('workbenchConfigurationTitle', \"Workbench\"),\n\ttype: 'object',\n\tproperties: {\n\t\t[multiSelectModifierSettingKey]: {\n\t\t\ttype: 'string',\n\t\t\tenum: ['ctrlCmd', 'alt'],\n\t\t\tenumDescriptions: [\n\t\t\t\tlocalize('multiSelectModifier.ctrlCmd', \"Maps to `Control` on Windows and Linux and to `Command` on macOS.\"),\n\t\t\t\tlocalize('multiSelectModifier.alt', \"Maps to `Alt` on Windows and Linux and to `Option` on macOS.\")\n\t\t\t],\n\t\t\tdefault: 'ctrlCmd',\n\t\t\tdescription: localize({\n\t\t\t\tkey: 'multiSelectModifier',\n\t\t\t\tcomment: [\n\t\t\t\t\t'- `ctrlCmd` refers to a value the setting can take and should not be localized.',\n\t\t\t\t\t'- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'\n\t\t\t\t]\n\t\t\t}, \"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.\")\n\t\t},\n\t\t[openModeSettingKey]: {\n\t\t\ttype: 'string',\n\t\t\tenum: ['singleClick', 'doubleClick'],\n\t\t\tdefault: 'singleClick',\n\t\t\tdescription: localize({\n\t\t\t\tkey: 'openModeModifier',\n\t\t\t\tcomment: ['`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized.']\n\t\t\t}, \"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.\")\n\t\t},\n\t\t[horizontalScrollingKey]: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: localize('horizontalScrolling setting', \"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.\")\n\t\t},\n\t\t[treeIndentKey]: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 8,\n\t\t\tminimum: 4,\n\t\t\tmaximum: 40,\n\t\t\tdescription: localize('tree indent setting', \"Controls tree indentation in pixels.\")\n\t\t},\n\t\t[treeRenderIndentGuidesKey]: {\n\t\t\ttype: 'string',\n\t\t\tenum: ['none', 'onHover', 'always'],\n\t\t\tdefault: 'onHover',\n\t\t\tdescription: localize('render tree indent guides', \"Controls whether the tree should render indent guides.\")\n\t\t},\n\t\t[listSmoothScrolling]: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: localize('list smoothScrolling setting', \"Controls whether lists and trees have smooth scrolling.\"),\n\t\t},\n\t\t[mouseWheelScrollSensitivityKey]: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 1,\n\t\t\tdescription: localize('Mouse Wheel Scroll Sensitivity', \"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.\")\n\t\t},\n\t\t[fastScrollSensitivityKey]: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 5,\n\t\t\tdescription: localize('Fast Scroll Sensitivity', \"Scrolling speed multiplier when pressing `Alt`.\")\n\t\t},\n\t\t[keyboardNavigationSettingKey]: {\n\t\t\ttype: 'string',\n\t\t\tenum: ['simple', 'highlight', 'filter'],\n\t\t\tenumDescriptions: [\n\t\t\t\tlocalize('keyboardNavigationSettingKey.simple', \"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes.\"),\n\t\t\t\tlocalize('keyboardNavigationSettingKey.highlight', \"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements.\"),\n\t\t\t\tlocalize('keyboardNavigationSettingKey.filter', \"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.\")\n\t\t\t],\n\t\t\tdefault: 'highlight',\n\t\t\tdescription: localize('keyboardNavigationSettingKey', \"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.\")\n\t\t},\n\t\t[automaticKeyboardNavigationSettingKey]: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tmarkdownDescription: localize('automatic keyboard navigation setting', \"Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.\")\n\t\t},\n\t\t[treeExpandMode]: {\n\t\t\ttype: 'string',\n\t\t\tenum: ['singleClick', 'doubleClick'],\n\t\t\tdefault: 'singleClick',\n\t\t\tdescription: localize('expand mode', \"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.\"),\n\t\t}\n\t}\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 { $, append, EventHelper, EventLike } from 'vs/base/browser/dom';\nimport { DomEmitter } from 'vs/base/browser/event';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch';\nimport { Event } from 'vs/base/common/event';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport interface ILinkDescriptor {\n\treadonly label: string | HTMLElement;\n\treadonly href: string;\n\treadonly title?: string;\n\treadonly tabIndex?: number;\n}\n\nexport interface ILinkOptions {\n\treadonly opener?: (href: string) => void;\n}\n\nexport class Link extends Disposable {\n\n\tprivate el: HTMLAnchorElement;\n\tprivate _enabled: boolean = true;\n\n\tget enabled(): boolean {\n\t\treturn this._enabled;\n\t}\n\n\tset enabled(enabled: boolean) {\n\t\tif (enabled) {\n\t\t\tthis.el.setAttribute('aria-disabled', 'false');\n\t\t\tthis.el.tabIndex = 0;\n\t\t\tthis.el.style.pointerEvents = 'auto';\n\t\t\tthis.el.style.opacity = '1';\n\t\t\tthis.el.style.cursor = 'pointer';\n\t\t\tthis._enabled = false;\n\t\t} else {\n\t\t\tthis.el.setAttribute('aria-disabled', 'true');\n\t\t\tthis.el.tabIndex = -1;\n\t\t\tthis.el.style.pointerEvents = 'none';\n\t\t\tthis.el.style.opacity = '0.4';\n\t\t\tthis.el.style.cursor = 'default';\n\t\t\tthis._enabled = true;\n\t\t}\n\n\t\tthis._enabled = enabled;\n\t}\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate _link: ILinkDescriptor,\n\t\toptions: ILinkOptions = {},\n\t\t@IOpenerService openerService: IOpenerService\n\t) {\n\t\tsuper();\n\n\t\tthis.el = append(container, $('a.monaco-link', {\n\t\t\ttabIndex: _link.tabIndex ?? 0,\n\t\t\thref: _link.href,\n\t\t\ttitle: _link.title\n\t\t}, _link.label));\n\n\t\tthis.el.setAttribute('role', 'button');\n\n\t\tconst onClickEmitter = this._register(new DomEmitter(this.el, 'click'));\n\t\tconst onKeyPress = this._register(new DomEmitter(this.el, 'keypress'));\n\t\tconst onEnterPress = Event.chain(onKeyPress.event)\n\t\t\t.map(e => new StandardKeyboardEvent(e))\n\t\t\t.filter(e => e.keyCode === KeyCode.Enter)\n\t\t\t.event;\n\t\tconst onTap = this._register(new DomEmitter(this.el, TouchEventType.Tap)).event;\n\t\tthis._register(Gesture.addTarget(this.el));\n\t\tconst onOpen = Event.any<EventLike>(onClickEmitter.event, onEnterPress, onTap);\n\n\t\tthis._register(onOpen(e => {\n\t\t\tif (!this.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEventHelper.stop(e, true);\n\n\t\t\tif (options?.opener) {\n\t\t\t\toptions.opener(this._link.href);\n\t\t\t} else {\n\t\t\t\topenerService.open(this._link.href, { allowCommands: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis.enabled = true;\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst textLinkForegroundColor = theme.getColor(textLinkForeground);\n\tif (textLinkForegroundColor) {\n\t\tcollector.addRule(`.monaco-link { color: ${textLinkForegroundColor}; }`);\n\t}\n\n\tconst textLinkActiveForegroundColor = theme.getColor(textLinkActiveForeground);\n\tif (textLinkActiveForegroundColor) {\n\t\tcollector.addRule(`.monaco-link:hover { color: ${textLinkActiveForegroundColor}; }`);\n\t}\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 { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { List } from 'vs/base/browser/ui/list/listWidget';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IQuickInputOptions, IQuickInputStyles, QuickInputController } from 'vs/base/parts/quickinput/browser/quickInput';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { IWorkbenchListOptions, WorkbenchList } from 'vs/platform/list/browser/listService';\nimport { QuickAccessController } from 'vs/platform/quickinput/browser/quickAccess';\nimport { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';\nimport { IPickOptions, IQuickInputService, IQuickPick, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';\nimport { activeContrastBorder, badgeBackground, badgeForeground, buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, inputBackground, inputBorder, inputForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationWarningForeground, keybindingLabelBackground, keybindingLabelBorder, keybindingLabelBottomBorder, keybindingLabelForeground, pickerGroupBorder, pickerGroupForeground, progressBarBackground, quickInputBackground, quickInputForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputTitleBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { computeStyles } from 'vs/platform/theme/common/styler';\nimport { IThemeService, Themable } from 'vs/platform/theme/common/themeService';\n\nexport interface IQuickInputControllerHost extends ILayoutService { }\n\nexport class QuickInputService extends Themable implements IQuickInputService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _controller: QuickInputController | undefined;\n\tprivate get controller(): QuickInputController {\n\t\tif (!this._controller) {\n\t\t\tthis._controller = this._register(this.createController());\n\t\t}\n\n\t\treturn this._controller;\n\t}\n\n\tprivate _quickAccess: IQuickAccessController | undefined;\n\tget quickAccess(): IQuickAccessController {\n\t\tif (!this._quickAccess) {\n\t\t\tthis._quickAccess = this._register(this.instantiationService.createInstance(QuickAccessController));\n\t\t}\n\n\t\treturn this._quickAccess;\n\t}\n\n\tprivate readonly contexts = new Map<string, IContextKey<boolean>>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t\t@IContextKeyService protected readonly contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IAccessibilityService private readonly accessibilityService: IAccessibilityService,\n\t\t@ILayoutService protected readonly layoutService: ILayoutService\n\t) {\n\t\tsuper(themeService);\n\t}\n\n\tprotected createController(host: IQuickInputControllerHost = this.layoutService, options?: Partial<IQuickInputOptions>): QuickInputController {\n\t\tconst defaultOptions: IQuickInputOptions = {\n\t\t\tidPrefix: 'quickInput_', // Constant since there is still only one.\n\t\t\tcontainer: host.container,\n\t\t\tignoreFocusOut: () => false,\n\t\t\tisScreenReaderOptimized: () => this.accessibilityService.isScreenReaderOptimized(),\n\t\t\tbackKeybindingLabel: () => undefined,\n\t\t\tsetContextKey: (id?: string) => this.setContextKey(id),\n\t\t\treturnFocus: () => host.focus(),\n\t\t\tcreateList: <T>(\n\t\t\t\tuser: string,\n\t\t\t\tcontainer: HTMLElement,\n\t\t\t\tdelegate: IListVirtualDelegate<T>,\n\t\t\t\trenderers: IListRenderer<T, any>[],\n\t\t\t\toptions: IWorkbenchListOptions<T>,\n\t\t\t) => this.instantiationService.createInstance(WorkbenchList, user, container, delegate, renderers, options) as List<T>,\n\t\t\tstyles: this.computeStyles()\n\t\t};\n\n\t\tconst controller = this._register(new QuickInputController({\n\t\t\t...defaultOptions,\n\t\t\t...options\n\t\t}));\n\n\t\tcontroller.layout(host.dimension, host.offset?.top ?? 0);\n\n\t\t// Layout changes\n\t\tthis._register(host.onDidLayout(dimension => controller.layout(dimension, host.offset?.top ?? 0)));\n\n\t\t// Context keys\n\t\tthis._register(controller.onShow(() => this.resetContextKeys()));\n\t\tthis._register(controller.onHide(() => this.resetContextKeys()));\n\n\t\treturn controller;\n\t}\n\n\tprivate setContextKey(id?: string) {\n\t\tlet key: IContextKey<boolean> | undefined;\n\t\tif (id) {\n\t\t\tkey = this.contexts.get(id);\n\t\t\tif (!key) {\n\t\t\t\tkey = new RawContextKey<boolean>(id, false)\n\t\t\t\t\t.bindTo(this.contextKeyService);\n\t\t\t\tthis.contexts.set(id, key);\n\t\t\t}\n\t\t}\n\n\t\tif (key && key.get()) {\n\t\t\treturn; // already active context\n\t\t}\n\n\t\tthis.resetContextKeys();\n\n\t\tif (key) {\n\t\t\tkey.set(true);\n\t\t}\n\t}\n\n\tprivate resetContextKeys() {\n\t\tthis.contexts.forEach(context => {\n\t\t\tif (context.get()) {\n\t\t\t\tcontext.reset();\n\t\t\t}\n\t\t});\n\t}\n\n\tpick<T extends IQuickPickItem, O extends IPickOptions<T>>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options: O = <O>{}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> {\n\t\treturn this.controller.pick(picks, options, token);\n\t}\n\n\tcreateQuickPick<T extends IQuickPickItem>(): IQuickPick<T> {\n\t\treturn this.controller.createQuickPick();\n\t}\n\n\tprotected override updateStyles() {\n\t\tthis.controller.applyStyles(this.computeStyles());\n\t}\n\n\tprivate computeStyles(): IQuickInputStyles {\n\t\treturn {\n\t\t\twidget: {\n\t\t\t\t...computeStyles(this.theme, {\n\t\t\t\t\tquickInputBackground,\n\t\t\t\t\tquickInputForeground,\n\t\t\t\t\tquickInputTitleBackground,\n\t\t\t\t\tcontrastBorder,\n\t\t\t\t\twidgetShadow\n\t\t\t\t}),\n\t\t\t},\n\t\t\tinputBox: computeStyles(this.theme, {\n\t\t\t\tinputForeground,\n\t\t\t\tinputBackground,\n\t\t\t\tinputBorder,\n\t\t\t\tinputValidationInfoBackground,\n\t\t\t\tinputValidationInfoForeground,\n\t\t\t\tinputValidationInfoBorder,\n\t\t\t\tinputValidationWarningBackground,\n\t\t\t\tinputValidationWarningForeground,\n\t\t\t\tinputValidationWarningBorder,\n\t\t\t\tinputValidationErrorBackground,\n\t\t\t\tinputValidationErrorForeground,\n\t\t\t\tinputValidationErrorBorder\n\t\t\t}),\n\t\t\tcountBadge: computeStyles(this.theme, {\n\t\t\t\tbadgeBackground,\n\t\t\t\tbadgeForeground,\n\t\t\t\tbadgeBorder: contrastBorder\n\t\t\t}),\n\t\t\tbutton: computeStyles(this.theme, {\n\t\t\t\tbuttonForeground,\n\t\t\t\tbuttonBackground,\n\t\t\t\tbuttonHoverBackground,\n\t\t\t\tbuttonBorder: contrastBorder\n\t\t\t}),\n\t\t\tprogressBar: computeStyles(this.theme, {\n\t\t\t\tprogressBarBackground\n\t\t\t}),\n\t\t\tkeybindingLabel: computeStyles(this.theme, {\n\t\t\t\tkeybindingLabelBackground,\n\t\t\t\tkeybindingLabelForeground,\n\t\t\t\tkeybindingLabelBorder,\n\t\t\t\tkeybindingLabelBottomBorder,\n\t\t\t\tkeybindingLabelShadow: widgetShadow\n\t\t\t}),\n\t\t\tlist: computeStyles(this.theme, {\n\t\t\t\tlistBackground: quickInputBackground,\n\t\t\t\t// Look like focused when inactive.\n\t\t\t\tlistInactiveFocusForeground: quickInputListFocusForeground,\n\t\t\t\tlistInactiveSelectionIconForeground: quickInputListFocusIconForeground,\n\t\t\t\tlistInactiveFocusBackground: quickInputListFocusBackground,\n\t\t\t\tlistFocusOutline: activeContrastBorder,\n\t\t\t\tlistInactiveFocusOutline: activeContrastBorder,\n\t\t\t\tpickerGroupBorder,\n\t\t\t\tpickerGroupForeground\n\t\t\t})\n\t\t};\n\t}\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 'vs/css!./standaloneQuickInput';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IQuickInputService, IQuickPickItem, IQuickPick, IPickOptions, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { EditorScopedLayoutService } from 'vs/editor/standalone/browser/standaloneLayoutService';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { QuickInputController } from 'vs/base/parts/quickinput/browser/quickInput';\nimport { QuickInputService, IQuickInputControllerHost } from 'vs/platform/quickinput/browser/quickInput';\nimport { once } from 'vs/base/common/functional';\nimport { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';\n\nexport class EditorScopedQuickInputService extends QuickInputService {\n\n\tprivate host: IQuickInputControllerHost | undefined = undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService\n\t) {\n\t\tsuper(instantiationService, contextKeyService, themeService, accessibilityService, new EditorScopedLayoutService(editor.getContainerDomNode(), codeEditorService));\n\n\t\t// Use the passed in code editor as host for the quick input widget\n\t\tconst contribution = QuickInputEditorContribution.get(editor);\n\t\tif (contribution) {\n\t\t\tconst widget = contribution.widget;\n\t\t\tthis.host = {\n\t\t\t\t_serviceBrand: undefined,\n\t\t\t\tget hasContainer() { return true; },\n\t\t\t\tget container() { return widget.getDomNode(); },\n\t\t\t\tget dimension() { return editor.getLayoutInfo(); },\n\t\t\t\tget onDidLayout() { return editor.onDidLayoutChange; },\n\t\t\t\tfocus: () => editor.focus()\n\t\t\t};\n\t\t} else {\n\t\t\tthis.host = undefined;\n\t\t}\n\t}\n\n\tprotected override createController(): QuickInputController {\n\t\treturn super.createController(this.host);\n\t}\n}\n\nexport class StandaloneQuickInputService implements IQuickInputService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate mapEditorToService = new Map<ICodeEditor, EditorScopedQuickInputService>();\n\tprivate get activeService(): IQuickInputService {\n\t\tconst editor = this.codeEditorService.getFocusedCodeEditor();\n\t\tif (!editor) {\n\t\t\tthrow new Error('Quick input service needs a focused editor to work.');\n\t\t}\n\n\t\t// Find the quick input implementation for the focused\n\t\t// editor or create it lazily if not yet created\n\t\tlet quickInputService = this.mapEditorToService.get(editor);\n\t\tif (!quickInputService) {\n\t\t\tconst newQuickInputService = quickInputService = this.instantiationService.createInstance(EditorScopedQuickInputService, editor);\n\t\t\tthis.mapEditorToService.set(editor, quickInputService);\n\n\t\t\tonce(editor.onDidDispose)(() => {\n\t\t\t\tnewQuickInputService.dispose();\n\t\t\t\tthis.mapEditorToService.delete(editor);\n\t\t\t});\n\t\t}\n\n\t\treturn quickInputService;\n\t}\n\n\tget quickAccess(): IQuickAccessController { return this.activeService.quickAccess; }\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t\t@ICodeEditorService private readonly codeEditorService: ICodeEditorService\n\t) {\n\t}\n\n\tpick<T extends IQuickPickItem, O extends IPickOptions<T>>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options: O = <O>{}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> {\n\t\treturn (this.activeService as unknown as QuickInputController /* TS fail */).pick(picks, options, token);\n\t}\n\n\tcreateQuickPick<T extends IQuickPickItem>(): IQuickPick<T> {\n\t\treturn this.activeService.createQuickPick();\n\t}\n}\n\nexport class QuickInputEditorContribution implements IEditorContribution {\n\n\tstatic readonly ID = 'editor.controller.quickInput';\n\n\tstatic get(editor: ICodeEditor): QuickInputEditorContribution | null {\n\t\treturn editor.getContribution<QuickInputEditorContribution>(QuickInputEditorContribution.ID);\n\t}\n\n\treadonly widget = new QuickInputEditorWidget(this.editor);\n\n\tconstructor(private editor: ICodeEditor) { }\n\n\tdispose(): void {\n\t\tthis.widget.dispose();\n\t}\n}\n\nexport class QuickInputEditorWidget implements IOverlayWidget {\n\n\tprivate static readonly ID = 'editor.contrib.quickInputWidget';\n\n\tprivate domNode: HTMLElement;\n\n\tconstructor(private codeEditor: ICodeEditor) {\n\t\tthis.domNode = document.createElement('div');\n\n\t\tthis.codeEditor.addOverlayWidget(this);\n\t}\n\n\tgetId(): string {\n\t\treturn QuickInputEditorWidget.ID;\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetPosition(): IOverlayWidgetPosition | null {\n\t\treturn { preference: OverlayWidgetPositionPreference.TOP_CENTER };\n\t}\n\n\tdispose(): void {\n\t\tthis.codeEditor.removeOverlayWidget(this);\n\t}\n}\n\nregisterEditorContribution(QuickInputEditorContribution.ID, QuickInputEditorContribution);\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 { Codicon } from 'vs/base/common/codicons';\nimport Severity from 'vs/base/common/severity';\nimport { problemsErrorIconForeground, problemsInfoIconForeground, problemsWarningIconForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport namespace SeverityIcon {\n\n\texport function className(severity: Severity): string {\n\t\tswitch (severity) {\n\t\t\tcase Severity.Ignore:\n\t\t\t\treturn 'severity-ignore ' + Codicon.info.classNames;\n\t\t\tcase Severity.Info:\n\t\t\t\treturn Codicon.info.classNames;\n\t\t\tcase Severity.Warning:\n\t\t\t\treturn Codicon.warning.classNames;\n\t\t\tcase Severity.Error:\n\t\t\t\treturn Codicon.error.classNames;\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\n\tconst errorIconForeground = theme.getColor(problemsErrorIconForeground);\n\tif (errorIconForeground) {\n\t\tconst errorCodiconSelector = Codicon.error.cssSelector;\n\t\tcollector.addRule(`\n\t\t\t.monaco-editor .zone-widget ${errorCodiconSelector},\n\t\t\t.markers-panel .marker-icon${errorCodiconSelector},\n\t\t\t.text-search-provider-messages .providerMessage ${errorCodiconSelector},\n\t\t\t.extensions-viewlet > .extensions ${errorCodiconSelector} {\n\t\t\t\tcolor: ${errorIconForeground};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst warningIconForeground = theme.getColor(problemsWarningIconForeground);\n\tif (warningIconForeground) {\n\t\tconst warningCodiconSelector = Codicon.warning.cssSelector;\n\t\tcollector.addRule(`\n\t\t\t.monaco-editor .zone-widget ${warningCodiconSelector},\n\t\t\t.markers-panel .marker-icon${warningCodiconSelector},\n\t\t\t.extensions-viewlet > .extensions ${warningCodiconSelector},\n\t\t\t.extension-editor ${warningCodiconSelector},\n\t\t\t.text-search-provider-messages .providerMessage ${warningCodiconSelector},\n\t\t\t.preferences-editor ${warningCodiconSelector} {\n\t\t\t\tcolor: ${warningIconForeground};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst infoIconForeground = theme.getColor(problemsInfoIconForeground);\n\tif (infoIconForeground) {\n\t\tconst infoCodiconSelector = Codicon.info.cssSelector;\n\t\tcollector.addRule(`\n\t\t\t.monaco-editor .zone-widget ${infoCodiconSelector},\n\t\t\t.markers-panel .marker-icon${infoCodiconSelector},\n\t\t\t.extensions-viewlet > .extensions ${infoCodiconSelector},\n\t\t\t.text-search-provider-messages .providerMessage ${infoCodiconSelector},\n\t\t\t.extension-editor ${infoCodiconSelector} {\n\t\t\t\tcolor: ${infoIconForeground};\n\t\t\t}\n\t\t`);\n\t}\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { Codicon, CSSIcon } from 'vs/base/common/codicons';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';\nimport { URI } from 'vs/base/common/uri';\nimport { localize } from 'vs/nls';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';\nimport * as platform from 'vs/platform/registry/common/platform';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\n\n// ------ API types\n\nexport type IconIdentifier = string;\n\n// icon registry\nexport const Extensions = {\n\tIconContribution: 'base.contributions.icons'\n};\n\nexport type IconDefaults = ThemeIcon | IconDefinition;\n\nexport interface IconDefinition {\n\tfont?: IconFontContribution; // undefined for the default font (codicon)\n\tfontCharacter: string;\n}\n\n\nexport interface IconContribution {\n\treadonly id: string;\n\tdescription: string | undefined;\n\tdeprecationMessage?: string;\n\treadonly defaults: IconDefaults;\n}\n\nexport namespace IconContribution {\n\texport function getDefinition(contribution: IconContribution, registry: IIconRegistry): IconDefinition | undefined {\n\t\tlet definition = contribution.defaults;\n\t\twhile (ThemeIcon.isThemeIcon(definition)) {\n\t\t\tconst c = iconRegistry.getIcon(definition.id);\n\t\t\tif (!c) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tdefinition = c.defaults;\n\t\t}\n\t\treturn definition;\n\t}\n}\n\nexport interface IconFontContribution {\n\treadonly id: string;\n\treadonly definition: IconFontDefinition;\n}\n\nexport interface IconFontDefinition {\n\treadonly weight?: string;\n\treadonly style?: string;\n\treadonly src: IconFontSource[];\n}\n\nexport interface IconFontSource {\n\treadonly location: URI;\n\treadonly format: string;\n}\n\nexport interface IIconRegistry {\n\n\treadonly onDidChange: Event<void>;\n\n\t/**\n\t * Get all icon contributions\n\t */\n\tgetIcons(): IconContribution[];\n\n\t/**\n\t * Get the icon for the given id\n\t */\n\tgetIcon(id: IconIdentifier): IconContribution | undefined;\n}\n\nclass IconRegistry implements IIconRegistry {\n\n\tprivate readonly _onDidChange = new Emitter<void>();\n\treadonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate iconsById: { [key: string]: IconContribution };\n\tprivate iconSchema: IJSONSchema & { properties: IJSONSchemaMap } = {\n\t\tdefinitions: {\n\t\t\ticons: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tfontId: { type: 'string', description: localize('iconDefinition.fontId', 'The id of the font to use. If not set, the font that is defined first is used.') },\n\t\t\t\t\tfontCharacter: { type: 'string', description: localize('iconDefinition.fontCharacter', 'The font character associated with the icon definition.') }\n\t\t\t\t},\n\t\t\t\tadditionalProperties: false,\n\t\t\t\tdefaultSnippets: [{ body: { fontCharacter: '\\\\\\\\e030' } }]\n\t\t\t}\n\t\t},\n\t\ttype: 'object',\n\t\tproperties: {}\n\t};\n\tprivate iconReferenceSchema: IJSONSchema & { enum: string[]; enumDescriptions: string[] } = { type: 'string', pattern: `^${CSSIcon.iconNameExpression}$`, enum: [], enumDescriptions: [] };\n\n\tprivate iconFontsById: { [key: string]: IconFontDefinition };\n\n\tconstructor() {\n\t\tthis.iconsById = {};\n\t\tthis.iconFontsById = {};\n\t}\n\n\tpublic registerIcon(id: string, defaults: IconDefaults, description?: string, deprecationMessage?: string): ThemeIcon {\n\t\tconst existing = this.iconsById[id];\n\t\tif (existing) {\n\t\t\tif (description && !existing.description) {\n\t\t\t\texisting.description = description;\n\t\t\t\tthis.iconSchema.properties[id].markdownDescription = `${description} $(${id})`;\n\t\t\t\tconst enumIndex = this.iconReferenceSchema.enum.indexOf(id);\n\t\t\t\tif (enumIndex !== -1) {\n\t\t\t\t\tthis.iconReferenceSchema.enumDescriptions[enumIndex] = description;\n\t\t\t\t}\n\t\t\t\tthis._onDidChange.fire();\n\t\t\t}\n\t\t\treturn existing;\n\t\t}\n\t\tlet iconContribution: IconContribution = { id, description, defaults, deprecationMessage };\n\t\tthis.iconsById[id] = iconContribution;\n\t\tlet propertySchema: IJSONSchema = { $ref: '#/definitions/icons' };\n\t\tif (deprecationMessage) {\n\t\t\tpropertySchema.deprecationMessage = deprecationMessage;\n\t\t}\n\t\tif (description) {\n\t\t\tpropertySchema.markdownDescription = `${description}: $(${id})`;\n\t\t}\n\t\tthis.iconSchema.properties[id] = propertySchema;\n\t\tthis.iconReferenceSchema.enum.push(id);\n\t\tthis.iconReferenceSchema.enumDescriptions.push(description || '');\n\n\t\tthis._onDidChange.fire();\n\t\treturn { id };\n\t}\n\n\tpublic getIcons(): IconContribution[] {\n\t\treturn Object.keys(this.iconsById).map(id => this.iconsById[id]);\n\t}\n\n\tpublic getIcon(id: string): IconContribution | undefined {\n\t\treturn this.iconsById[id];\n\t}\n\n\tpublic getIconSchema(): IJSONSchema {\n\t\treturn this.iconSchema;\n\t}\n\n\tpublic toString() {\n\t\tconst sorter = (i1: IconContribution, i2: IconContribution) => {\n\t\t\treturn i1.id.localeCompare(i2.id);\n\t\t};\n\t\tconst classNames = (i: IconContribution) => {\n\t\t\twhile (ThemeIcon.isThemeIcon(i.defaults)) {\n\t\t\t\ti = this.iconsById[i.defaults.id];\n\t\t\t}\n\t\t\treturn `codicon codicon-${i ? i.id : ''}`;\n\t\t};\n\n\t\tlet reference = [];\n\n\t\treference.push(`| preview | identifier | default codicon ID | description`);\n\t\treference.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`);\n\t\tconst contributions = Object.keys(this.iconsById).map(key => this.iconsById[key]);\n\n\t\tfor (const i of contributions.filter(i => !!i.description).sort(sorter)) {\n\t\t\treference.push(`|<i class=\"${classNames(i)}\"></i>|${i.id}|${ThemeIcon.isThemeIcon(i.defaults) ? i.defaults.id : i.id}|${i.description || ''}|`);\n\t\t}\n\n\t\treference.push(`| preview | identifier `);\n\t\treference.push(`| ----------- | --------------------------------- |`);\n\n\t\tfor (const i of contributions.filter(i => !ThemeIcon.isThemeIcon(i.defaults)).sort(sorter)) {\n\t\t\treference.push(`|<i class=\"${classNames(i)}\"></i>|${i.id}|`);\n\n\t\t}\n\n\t\treturn reference.join('\\n');\n\t}\n\n}\n\nconst iconRegistry = new IconRegistry();\nplatform.Registry.add(Extensions.IconContribution, iconRegistry);\n\nexport function registerIcon(id: string, defaults: IconDefaults, description: string, deprecationMessage?: string): ThemeIcon {\n\treturn iconRegistry.registerIcon(id, defaults, description, deprecationMessage);\n}\n\nexport function getIconRegistry(): IIconRegistry {\n\treturn iconRegistry;\n}\n\nfunction initialize() {\n\tfor (const icon of Codicon.getAll()) {\n\t\ticonRegistry.registerIcon(icon.id, icon.definition, icon.description);\n\t}\n}\ninitialize();\n\nexport const iconsSchemaId = 'vscode://schemas/icons';\n\nlet schemaRegistry = platform.Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\nschemaRegistry.registerSchema(iconsSchemaId, iconRegistry.getIconSchema());\n\nconst delayer = new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(iconsSchemaId), 200);\niconRegistry.onDidChange(() => {\n\tif (!delayer.isScheduled()) {\n\t\tdelayer.schedule();\n\t}\n});\n\n\n//setTimeout(_ => console.log(iconRegistry.toString()), 5000);\n\n\n// common icons\n\nexport const widgetClose = registerIcon('widget-close', Codicon.close, localize('widgetClose', 'Icon for the close action in widgets.'));\n\nexport const gotoPreviousLocation = registerIcon('goto-previous-location', Codicon.arrowUp, localize('previousChangeIcon', 'Icon for goto previous editor location.'));\nexport const gotoNextLocation = registerIcon('goto-next-location', Codicon.arrowDown, localize('nextChangeIcon', 'Icon for goto next editor location.'));\n\nexport const syncing = ThemeIcon.modify(Codicon.sync, 'spin');\nexport const spinningLoading = ThemeIcon.modify(Codicon.loading, 'spin');\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 'vs/css!./media/diffReview';\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Action } from 'vs/base/common/actions';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget';\nimport { IComputedEditorOptions, EditorOption, EditorFontLigatures } from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { editorLineNumbers } from 'vs/editor/common/core/editorColorRegistry';\nimport { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewLineRenderingData } from 'vs/editor/common/viewModel';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { Constants } from 'vs/base/common/uint';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { ILanguageIdCodec } from 'vs/editor/common/languages';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ILineChange } from 'vs/editor/common/diff/diffComputer';\n\nconst DIFF_LINES_PADDING = 3;\n\nconst enum DiffEntryType {\n\tEqual = 0,\n\tInsert = 1,\n\tDelete = 2\n}\n\nclass DiffEntry {\n\treadonly originalLineStart: number;\n\treadonly originalLineEnd: number;\n\treadonly modifiedLineStart: number;\n\treadonly modifiedLineEnd: number;\n\n\tconstructor(originalLineStart: number, originalLineEnd: number, modifiedLineStart: number, modifiedLineEnd: number) {\n\t\tthis.originalLineStart = originalLineStart;\n\t\tthis.originalLineEnd = originalLineEnd;\n\t\tthis.modifiedLineStart = modifiedLineStart;\n\t\tthis.modifiedLineEnd = modifiedLineEnd;\n\t}\n\n\tpublic getType(): DiffEntryType {\n\t\tif (this.originalLineStart === 0) {\n\t\t\treturn DiffEntryType.Insert;\n\t\t}\n\t\tif (this.modifiedLineStart === 0) {\n\t\t\treturn DiffEntryType.Delete;\n\t\t}\n\t\treturn DiffEntryType.Equal;\n\t}\n}\n\nclass Diff {\n\treadonly entries: DiffEntry[];\n\n\tconstructor(entries: DiffEntry[]) {\n\t\tthis.entries = entries;\n\t}\n}\n\nconst diffReviewInsertIcon = registerIcon('diff-review-insert', Codicon.add, nls.localize('diffReviewInsertIcon', 'Icon for \\'Insert\\' in diff review.'));\nconst diffReviewRemoveIcon = registerIcon('diff-review-remove', Codicon.remove, nls.localize('diffReviewRemoveIcon', 'Icon for \\'Remove\\' in diff review.'));\nconst diffReviewCloseIcon = registerIcon('diff-review-close', Codicon.close, nls.localize('diffReviewCloseIcon', 'Icon for \\'Close\\' in diff review.'));\n\nexport class DiffReview extends Disposable {\n\n\tprivate static _ttPolicy = window.trustedTypes?.createPolicy('diffReview', { createHTML: value => value });\n\n\tprivate readonly _diffEditor: DiffEditorWidget;\n\tprivate _isVisible: boolean;\n\tpublic readonly shadow: FastDomNode<HTMLElement>;\n\tprivate readonly _actionBar: ActionBar;\n\tpublic readonly actionBarContainer: FastDomNode<HTMLElement>;\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _content: FastDomNode<HTMLElement>;\n\tprivate readonly scrollbar: DomScrollableElement;\n\tprivate _diffs: Diff[];\n\tprivate _currentDiff: Diff | null;\n\n\tconstructor(\n\t\tdiffEditor: DiffEditorWidget,\n\t\t@ILanguageService private readonly _languageService: ILanguageService\n\t) {\n\t\tsuper();\n\t\tthis._diffEditor = diffEditor;\n\t\tthis._isVisible = false;\n\n\t\tthis.shadow = createFastDomNode(document.createElement('div'));\n\t\tthis.shadow.setClassName('diff-review-shadow');\n\n\t\tthis.actionBarContainer = createFastDomNode(document.createElement('div'));\n\t\tthis.actionBarContainer.setClassName('diff-review-actions');\n\t\tthis._actionBar = this._register(new ActionBar(\n\t\t\tthis.actionBarContainer.domNode\n\t\t));\n\n\t\tthis._actionBar.push(new Action('diffreview.close', nls.localize('label.close', \"Close\"), 'close-diff-review ' + ThemeIcon.asClassName(diffReviewCloseIcon), true, async () => this.hide()), { label: false, icon: true });\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tthis.domNode.setClassName('diff-review monaco-editor-background');\n\n\t\tthis._content = createFastDomNode(document.createElement('div'));\n\t\tthis._content.setClassName('diff-review-content');\n\t\tthis._content.setAttribute('role', 'code');\n\t\tthis.scrollbar = this._register(new DomScrollableElement(this._content.domNode, {}));\n\t\tthis.domNode.domNode.appendChild(this.scrollbar.getDomNode());\n\n\t\tthis._register(diffEditor.onDidUpdateDiff(() => {\n\t\t\tif (!this._isVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._diffs = this._compute();\n\t\t\tthis._render();\n\t\t}));\n\t\tthis._register(diffEditor.getModifiedEditor().onDidChangeCursorPosition(() => {\n\t\t\tif (!this._isVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._render();\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this.domNode.domNode, 'click', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst row = dom.findParentWithClass(e.target, 'diff-review-row');\n\t\t\tif (row) {\n\t\t\t\tthis._goToRow(row);\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this.domNode.domNode, 'keydown', (e) => {\n\t\t\tif (\n\t\t\t\te.equals(KeyCode.DownArrow)\n\t\t\t\t|| e.equals(KeyMod.CtrlCmd | KeyCode.DownArrow)\n\t\t\t\t|| e.equals(KeyMod.Alt | KeyCode.DownArrow)\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis._goToRow(this._getNextRow());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\te.equals(KeyCode.UpArrow)\n\t\t\t\t|| e.equals(KeyMod.CtrlCmd | KeyCode.UpArrow)\n\t\t\t\t|| e.equals(KeyMod.Alt | KeyCode.UpArrow)\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis._goToRow(this._getPrevRow());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\te.equals(KeyCode.Escape)\n\t\t\t\t|| e.equals(KeyMod.CtrlCmd | KeyCode.Escape)\n\t\t\t\t|| e.equals(KeyMod.Alt | KeyCode.Escape)\n\t\t\t\t|| e.equals(KeyMod.Shift | KeyCode.Escape)\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.hide();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\te.equals(KeyCode.Space)\n\t\t\t\t|| e.equals(KeyCode.Enter)\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.accept();\n\t\t\t}\n\t\t}));\n\t\tthis._diffs = [];\n\t\tthis._currentDiff = null;\n\t}\n\n\tpublic prev(): void {\n\t\tlet index = 0;\n\n\t\tif (!this._isVisible) {\n\t\t\tthis._diffs = this._compute();\n\t\t}\n\n\t\tif (this._isVisible) {\n\t\t\tlet currentIndex = -1;\n\t\t\tfor (let i = 0, len = this._diffs.length; i < len; i++) {\n\t\t\t\tif (this._diffs[i] === this._currentDiff) {\n\t\t\t\t\tcurrentIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = (this._diffs.length + currentIndex - 1);\n\t\t} else {\n\t\t\tindex = this._findDiffIndex(this._diffEditor.getPosition()!);\n\t\t}\n\n\t\tif (this._diffs.length === 0) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tindex = index % this._diffs.length;\n\t\tconst entries = this._diffs[index].entries;\n\t\tthis._diffEditor.setPosition(new Position(entries[0].modifiedLineStart, 1));\n\t\tthis._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: Constants.MAX_SAFE_SMALL_INTEGER, endLineNumber: entries[entries.length - 1].modifiedLineEnd });\n\t\tthis._isVisible = true;\n\t\tthis._diffEditor.doLayout();\n\t\tthis._render();\n\t\tthis._goToRow(this._getNextRow());\n\t}\n\n\tpublic next(): void {\n\t\tlet index = 0;\n\n\t\tif (!this._isVisible) {\n\t\t\tthis._diffs = this._compute();\n\t\t}\n\n\t\tif (this._isVisible) {\n\t\t\tlet currentIndex = -1;\n\t\t\tfor (let i = 0, len = this._diffs.length; i < len; i++) {\n\t\t\t\tif (this._diffs[i] === this._currentDiff) {\n\t\t\t\t\tcurrentIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = (currentIndex + 1);\n\t\t} else {\n\t\t\tindex = this._findDiffIndex(this._diffEditor.getPosition()!);\n\t\t}\n\n\t\tif (this._diffs.length === 0) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tindex = index % this._diffs.length;\n\t\tconst entries = this._diffs[index].entries;\n\t\tthis._diffEditor.setPosition(new Position(entries[0].modifiedLineStart, 1));\n\t\tthis._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: Constants.MAX_SAFE_SMALL_INTEGER, endLineNumber: entries[entries.length - 1].modifiedLineEnd });\n\t\tthis._isVisible = true;\n\t\tthis._diffEditor.doLayout();\n\t\tthis._render();\n\t\tthis._goToRow(this._getNextRow());\n\t}\n\n\tprivate accept(): void {\n\t\tlet jumpToLineNumber = -1;\n\t\tconst current = this._getCurrentFocusedRow();\n\t\tif (current) {\n\t\t\tconst lineNumber = parseInt(current.getAttribute('data-line')!, 10);\n\t\t\tif (!isNaN(lineNumber)) {\n\t\t\t\tjumpToLineNumber = lineNumber;\n\t\t\t}\n\t\t}\n\t\tthis.hide();\n\n\t\tif (jumpToLineNumber !== -1) {\n\t\t\tthis._diffEditor.setPosition(new Position(jumpToLineNumber, 1));\n\t\t\tthis._diffEditor.revealPosition(new Position(jumpToLineNumber, 1), ScrollType.Immediate);\n\t\t}\n\t}\n\n\tprivate hide(): void {\n\t\tthis._isVisible = false;\n\t\tthis._diffEditor.updateOptions({ readOnly: false });\n\t\tthis._diffEditor.focus();\n\t\tthis._diffEditor.doLayout();\n\t\tthis._render();\n\t}\n\n\tprivate _getPrevRow(): HTMLElement {\n\t\tconst current = this._getCurrentFocusedRow();\n\t\tif (!current) {\n\t\t\treturn this._getFirstRow();\n\t\t}\n\t\tif (current.previousElementSibling) {\n\t\t\treturn <HTMLElement>current.previousElementSibling;\n\t\t}\n\t\treturn current;\n\t}\n\n\tprivate _getNextRow(): HTMLElement {\n\t\tconst current = this._getCurrentFocusedRow();\n\t\tif (!current) {\n\t\t\treturn this._getFirstRow();\n\t\t}\n\t\tif (current.nextElementSibling) {\n\t\t\treturn <HTMLElement>current.nextElementSibling;\n\t\t}\n\t\treturn current;\n\t}\n\n\tprivate _getFirstRow(): HTMLElement {\n\t\treturn <HTMLElement>this.domNode.domNode.querySelector('.diff-review-row');\n\t}\n\n\tprivate _getCurrentFocusedRow(): HTMLElement | null {\n\t\tconst result = <HTMLElement>document.activeElement;\n\t\tif (result && /diff-review-row/.test(result.className)) {\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _goToRow(row: HTMLElement): void {\n\t\tconst prev = this._getCurrentFocusedRow();\n\t\trow.tabIndex = 0;\n\t\trow.focus();\n\t\tif (prev && prev !== row) {\n\t\t\tprev.tabIndex = -1;\n\t\t}\n\t\tthis.scrollbar.scanDomNode();\n\t}\n\n\tpublic isVisible(): boolean {\n\t\treturn this._isVisible;\n\t}\n\n\tprivate _width: number = 0;\n\n\tpublic layout(top: number, width: number, height: number): void {\n\t\tthis._width = width;\n\t\tthis.shadow.setTop(top - 6);\n\t\tthis.shadow.setWidth(width);\n\t\tthis.shadow.setHeight(this._isVisible ? 6 : 0);\n\t\tthis.domNode.setTop(top);\n\t\tthis.domNode.setWidth(width);\n\t\tthis.domNode.setHeight(height);\n\t\tthis._content.setHeight(height);\n\t\tthis._content.setWidth(width);\n\n\t\tif (this._isVisible) {\n\t\t\tthis.actionBarContainer.setAttribute('aria-hidden', 'false');\n\t\t\tthis.actionBarContainer.setDisplay('block');\n\t\t} else {\n\t\t\tthis.actionBarContainer.setAttribute('aria-hidden', 'true');\n\t\t\tthis.actionBarContainer.setDisplay('none');\n\t\t}\n\t}\n\n\tprivate _compute(): Diff[] {\n\t\tconst lineChanges = this._diffEditor.getLineChanges();\n\t\tif (!lineChanges || lineChanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tconst originalModel = this._diffEditor.getOriginalEditor().getModel();\n\t\tconst modifiedModel = this._diffEditor.getModifiedEditor().getModel();\n\n\t\tif (!originalModel || !modifiedModel) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn DiffReview._mergeAdjacent(lineChanges, originalModel.getLineCount(), modifiedModel.getLineCount());\n\t}\n\n\tprivate static _mergeAdjacent(lineChanges: ILineChange[], originalLineCount: number, modifiedLineCount: number): Diff[] {\n\t\tif (!lineChanges || lineChanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst diffs: Diff[] = [];\n\t\tlet diffsLength = 0;\n\n\t\tfor (let i = 0, len = lineChanges.length; i < len; i++) {\n\t\t\tconst lineChange = lineChanges[i];\n\n\t\t\tconst originalStart = lineChange.originalStartLineNumber;\n\t\t\tconst originalEnd = lineChange.originalEndLineNumber;\n\t\t\tconst modifiedStart = lineChange.modifiedStartLineNumber;\n\t\t\tconst modifiedEnd = lineChange.modifiedEndLineNumber;\n\n\t\t\tconst r: DiffEntry[] = [];\n\t\t\tlet rLength = 0;\n\n\t\t\t// Emit before anchors\n\t\t\t{\n\t\t\t\tconst originalEqualAbove = (originalEnd === 0 ? originalStart : originalStart - 1);\n\t\t\t\tconst modifiedEqualAbove = (modifiedEnd === 0 ? modifiedStart : modifiedStart - 1);\n\n\t\t\t\t// Make sure we don't step into the previous diff\n\t\t\t\tlet minOriginal = 1;\n\t\t\t\tlet minModified = 1;\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tconst prevLineChange = lineChanges[i - 1];\n\n\t\t\t\t\tif (prevLineChange.originalEndLineNumber === 0) {\n\t\t\t\t\t\tminOriginal = prevLineChange.originalStartLineNumber + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tminOriginal = prevLineChange.originalEndLineNumber + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prevLineChange.modifiedEndLineNumber === 0) {\n\t\t\t\t\t\tminModified = prevLineChange.modifiedStartLineNumber + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tminModified = prevLineChange.modifiedEndLineNumber + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet fromOriginal = originalEqualAbove - DIFF_LINES_PADDING + 1;\n\t\t\t\tlet fromModified = modifiedEqualAbove - DIFF_LINES_PADDING + 1;\n\t\t\t\tif (fromOriginal < minOriginal) {\n\t\t\t\t\tconst delta = minOriginal - fromOriginal;\n\t\t\t\t\tfromOriginal = fromOriginal + delta;\n\t\t\t\t\tfromModified = fromModified + delta;\n\t\t\t\t}\n\t\t\t\tif (fromModified < minModified) {\n\t\t\t\t\tconst delta = minModified - fromModified;\n\t\t\t\t\tfromOriginal = fromOriginal + delta;\n\t\t\t\t\tfromModified = fromModified + delta;\n\t\t\t\t}\n\n\t\t\t\tr[rLength++] = new DiffEntry(\n\t\t\t\t\tfromOriginal, originalEqualAbove,\n\t\t\t\t\tfromModified, modifiedEqualAbove\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Emit deleted lines\n\t\t\t{\n\t\t\t\tif (originalEnd !== 0) {\n\t\t\t\t\tr[rLength++] = new DiffEntry(originalStart, originalEnd, 0, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Emit inserted lines\n\t\t\t{\n\t\t\t\tif (modifiedEnd !== 0) {\n\t\t\t\t\tr[rLength++] = new DiffEntry(0, 0, modifiedStart, modifiedEnd);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Emit after anchors\n\t\t\t{\n\t\t\t\tconst originalEqualBelow = (originalEnd === 0 ? originalStart + 1 : originalEnd + 1);\n\t\t\t\tconst modifiedEqualBelow = (modifiedEnd === 0 ? modifiedStart + 1 : modifiedEnd + 1);\n\n\t\t\t\t// Make sure we don't step into the next diff\n\t\t\t\tlet maxOriginal = originalLineCount;\n\t\t\t\tlet maxModified = modifiedLineCount;\n\t\t\t\tif (i + 1 < len) {\n\t\t\t\t\tconst nextLineChange = lineChanges[i + 1];\n\n\t\t\t\t\tif (nextLineChange.originalEndLineNumber === 0) {\n\t\t\t\t\t\tmaxOriginal = nextLineChange.originalStartLineNumber;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmaxOriginal = nextLineChange.originalStartLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nextLineChange.modifiedEndLineNumber === 0) {\n\t\t\t\t\t\tmaxModified = nextLineChange.modifiedStartLineNumber;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmaxModified = nextLineChange.modifiedStartLineNumber - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet toOriginal = originalEqualBelow + DIFF_LINES_PADDING - 1;\n\t\t\t\tlet toModified = modifiedEqualBelow + DIFF_LINES_PADDING - 1;\n\n\t\t\t\tif (toOriginal > maxOriginal) {\n\t\t\t\t\tconst delta = maxOriginal - toOriginal;\n\t\t\t\t\ttoOriginal = toOriginal + delta;\n\t\t\t\t\ttoModified = toModified + delta;\n\t\t\t\t}\n\t\t\t\tif (toModified > maxModified) {\n\t\t\t\t\tconst delta = maxModified - toModified;\n\t\t\t\t\ttoOriginal = toOriginal + delta;\n\t\t\t\t\ttoModified = toModified + delta;\n\t\t\t\t}\n\n\t\t\t\tr[rLength++] = new DiffEntry(\n\t\t\t\t\toriginalEqualBelow, toOriginal,\n\t\t\t\t\tmodifiedEqualBelow, toModified,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdiffs[diffsLength++] = new Diff(r);\n\t\t}\n\n\t\t// Merge adjacent diffs\n\t\tlet curr: DiffEntry[] = diffs[0].entries;\n\t\tconst r: Diff[] = [];\n\t\tlet rLength = 0;\n\t\tfor (let i = 1, len = diffs.length; i < len; i++) {\n\t\t\tconst thisDiff = diffs[i].entries;\n\n\t\t\tconst currLast = curr[curr.length - 1];\n\t\t\tconst thisFirst = thisDiff[0];\n\n\t\t\tif (\n\t\t\t\tcurrLast.getType() === DiffEntryType.Equal\n\t\t\t\t&& thisFirst.getType() === DiffEntryType.Equal\n\t\t\t\t&& thisFirst.originalLineStart <= currLast.originalLineEnd\n\t\t\t) {\n\t\t\t\t// We are dealing with equal lines that overlap\n\n\t\t\t\tcurr[curr.length - 1] = new DiffEntry(\n\t\t\t\t\tcurrLast.originalLineStart, thisFirst.originalLineEnd,\n\t\t\t\t\tcurrLast.modifiedLineStart, thisFirst.modifiedLineEnd\n\t\t\t\t);\n\t\t\t\tcurr = curr.concat(thisDiff.slice(1));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tr[rLength++] = new Diff(curr);\n\t\t\tcurr = thisDiff;\n\t\t}\n\t\tr[rLength++] = new Diff(curr);\n\t\treturn r;\n\t}\n\n\tprivate _findDiffIndex(pos: Position): number {\n\t\tconst lineNumber = pos.lineNumber;\n\t\tfor (let i = 0, len = this._diffs.length; i < len; i++) {\n\t\t\tconst diff = this._diffs[i].entries;\n\t\t\tconst lastModifiedLine = diff[diff.length - 1].modifiedLineEnd;\n\t\t\tif (lineNumber <= lastModifiedLine) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate _render(): void {\n\n\t\tconst originalOptions = this._diffEditor.getOriginalEditor().getOptions();\n\t\tconst modifiedOptions = this._diffEditor.getModifiedEditor().getOptions();\n\n\t\tconst originalModel = this._diffEditor.getOriginalEditor().getModel();\n\t\tconst modifiedModel = this._diffEditor.getModifiedEditor().getModel();\n\n\t\tconst originalModelOpts = originalModel!.getOptions();\n\t\tconst modifiedModelOpts = modifiedModel!.getOptions();\n\n\t\tif (!this._isVisible || !originalModel || !modifiedModel) {\n\t\t\tdom.clearNode(this._content.domNode);\n\t\t\tthis._currentDiff = null;\n\t\t\tthis.scrollbar.scanDomNode();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._diffEditor.updateOptions({ readOnly: true });\n\t\tconst diffIndex = this._findDiffIndex(this._diffEditor.getPosition()!);\n\n\t\tif (this._diffs[diffIndex] === this._currentDiff) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentDiff = this._diffs[diffIndex];\n\n\t\tconst diffs = this._diffs[diffIndex].entries;\n\t\tconst container = document.createElement('div');\n\t\tcontainer.className = 'diff-review-table';\n\t\tcontainer.setAttribute('role', 'list');\n\t\tcontainer.setAttribute('aria-label', 'Difference review. Use \"Stage | Unstage | Revert Selected Ranges\" commands');\n\t\tapplyFontInfo(container, modifiedOptions.get(EditorOption.fontInfo));\n\n\t\tlet minOriginalLine = 0;\n\t\tlet maxOriginalLine = 0;\n\t\tlet minModifiedLine = 0;\n\t\tlet maxModifiedLine = 0;\n\t\tfor (let i = 0, len = diffs.length; i < len; i++) {\n\t\t\tconst diffEntry = diffs[i];\n\t\t\tconst originalLineStart = diffEntry.originalLineStart;\n\t\t\tconst originalLineEnd = diffEntry.originalLineEnd;\n\t\t\tconst modifiedLineStart = diffEntry.modifiedLineStart;\n\t\t\tconst modifiedLineEnd = diffEntry.modifiedLineEnd;\n\n\t\t\tif (originalLineStart !== 0 && ((minOriginalLine === 0 || originalLineStart < minOriginalLine))) {\n\t\t\t\tminOriginalLine = originalLineStart;\n\t\t\t}\n\t\t\tif (originalLineEnd !== 0 && ((maxOriginalLine === 0 || originalLineEnd > maxOriginalLine))) {\n\t\t\t\tmaxOriginalLine = originalLineEnd;\n\t\t\t}\n\t\t\tif (modifiedLineStart !== 0 && ((minModifiedLine === 0 || modifiedLineStart < minModifiedLine))) {\n\t\t\t\tminModifiedLine = modifiedLineStart;\n\t\t\t}\n\t\t\tif (modifiedLineEnd !== 0 && ((maxModifiedLine === 0 || modifiedLineEnd > maxModifiedLine))) {\n\t\t\t\tmaxModifiedLine = modifiedLineEnd;\n\t\t\t}\n\t\t}\n\n\t\tconst header = document.createElement('div');\n\t\theader.className = 'diff-review-row';\n\n\t\tconst cell = document.createElement('div');\n\t\tcell.className = 'diff-review-cell diff-review-summary';\n\t\tconst originalChangedLinesCnt = maxOriginalLine - minOriginalLine + 1;\n\t\tconst modifiedChangedLinesCnt = maxModifiedLine - minModifiedLine + 1;\n\t\tcell.appendChild(document.createTextNode(`${diffIndex + 1}/${this._diffs.length}: @@ -${minOriginalLine},${originalChangedLinesCnt} +${minModifiedLine},${modifiedChangedLinesCnt} @@`));\n\t\theader.setAttribute('data-line', String(minModifiedLine));\n\n\t\tconst getAriaLines = (lines: number) => {\n\t\t\tif (lines === 0) {\n\t\t\t\treturn nls.localize('no_lines_changed', \"no lines changed\");\n\t\t\t} else if (lines === 1) {\n\t\t\t\treturn nls.localize('one_line_changed', \"1 line changed\");\n\t\t\t} else {\n\t\t\t\treturn nls.localize('more_lines_changed', \"{0} lines changed\", lines);\n\t\t\t}\n\t\t};\n\n\t\tconst originalChangedLinesCntAria = getAriaLines(originalChangedLinesCnt);\n\t\tconst modifiedChangedLinesCntAria = getAriaLines(modifiedChangedLinesCnt);\n\t\theader.setAttribute('aria-label', nls.localize({\n\t\t\tkey: 'header',\n\t\t\tcomment: [\n\t\t\t\t'This is the ARIA label for a git diff header.',\n\t\t\t\t'A git diff header looks like this: @@ -154,12 +159,39 @@.',\n\t\t\t\t'That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.',\n\t\t\t\t'Variables 0 and 1 refer to the diff index out of total number of diffs.',\n\t\t\t\t'Variables 2 and 4 will be numbers (a line number).',\n\t\t\t\t'Variables 3 and 5 will be \"no lines changed\", \"1 line changed\" or \"X lines changed\", localized separately.'\n\t\t\t]\n\t\t}, \"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}\", (diffIndex + 1), this._diffs.length, minOriginalLine, originalChangedLinesCntAria, minModifiedLine, modifiedChangedLinesCntAria));\n\t\theader.appendChild(cell);\n\n\t\t// @@ -504,7 +517,7 @@\n\t\theader.setAttribute('role', 'listitem');\n\t\tcontainer.appendChild(header);\n\n\t\tconst lineHeight = modifiedOptions.get(EditorOption.lineHeight);\n\t\tlet modLine = minModifiedLine;\n\t\tfor (let i = 0, len = diffs.length; i < len; i++) {\n\t\t\tconst diffEntry = diffs[i];\n\t\t\tDiffReview._renderSection(container, diffEntry, modLine, lineHeight, this._width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts, this._languageService.languageIdCodec);\n\t\t\tif (diffEntry.modifiedLineStart !== 0) {\n\t\t\t\tmodLine = diffEntry.modifiedLineEnd;\n\t\t\t}\n\t\t}\n\n\t\tdom.clearNode(this._content.domNode);\n\t\tthis._content.domNode.appendChild(container);\n\t\tthis.scrollbar.scanDomNode();\n\t}\n\n\tprivate static _renderSection(\n\t\tdest: HTMLElement, diffEntry: DiffEntry, modLine: number, lineHeight: number, width: number,\n\t\toriginalOptions: IComputedEditorOptions, originalModel: ITextModel, originalModelOpts: TextModelResolvedOptions,\n\t\tmodifiedOptions: IComputedEditorOptions, modifiedModel: ITextModel, modifiedModelOpts: TextModelResolvedOptions,\n\t\tlanguageIdCodec: ILanguageIdCodec\n\t): void {\n\n\t\tconst type = diffEntry.getType();\n\n\t\tlet rowClassName: string = 'diff-review-row';\n\t\tlet lineNumbersExtraClassName: string = '';\n\t\tconst spacerClassName: string = 'diff-review-spacer';\n\t\tlet spacerIcon: ThemeIcon | null = null;\n\t\tswitch (type) {\n\t\t\tcase DiffEntryType.Insert:\n\t\t\t\trowClassName = 'diff-review-row line-insert';\n\t\t\t\tlineNumbersExtraClassName = ' char-insert';\n\t\t\t\tspacerIcon = diffReviewInsertIcon;\n\t\t\t\tbreak;\n\t\t\tcase DiffEntryType.Delete:\n\t\t\t\trowClassName = 'diff-review-row line-delete';\n\t\t\t\tlineNumbersExtraClassName = ' char-delete';\n\t\t\t\tspacerIcon = diffReviewRemoveIcon;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst originalLineStart = diffEntry.originalLineStart;\n\t\tconst originalLineEnd = diffEntry.originalLineEnd;\n\t\tconst modifiedLineStart = diffEntry.modifiedLineStart;\n\t\tconst modifiedLineEnd = diffEntry.modifiedLineEnd;\n\n\t\tconst cnt = Math.max(\n\t\t\tmodifiedLineEnd - modifiedLineStart,\n\t\t\toriginalLineEnd - originalLineStart\n\t\t);\n\n\t\tconst originalLayoutInfo = originalOptions.get(EditorOption.layoutInfo);\n\t\tconst originalLineNumbersWidth = originalLayoutInfo.glyphMarginWidth + originalLayoutInfo.lineNumbersWidth;\n\n\t\tconst modifiedLayoutInfo = modifiedOptions.get(EditorOption.layoutInfo);\n\t\tconst modifiedLineNumbersWidth = 10 + modifiedLayoutInfo.glyphMarginWidth + modifiedLayoutInfo.lineNumbersWidth;\n\n\t\tfor (let i = 0; i <= cnt; i++) {\n\t\t\tconst originalLine = (originalLineStart === 0 ? 0 : originalLineStart + i);\n\t\t\tconst modifiedLine = (modifiedLineStart === 0 ? 0 : modifiedLineStart + i);\n\n\t\t\tconst row = document.createElement('div');\n\t\t\trow.style.minWidth = width + 'px';\n\t\t\trow.className = rowClassName;\n\t\t\trow.setAttribute('role', 'listitem');\n\t\t\tif (modifiedLine !== 0) {\n\t\t\t\tmodLine = modifiedLine;\n\t\t\t}\n\t\t\trow.setAttribute('data-line', String(modLine));\n\n\t\t\tconst cell = document.createElement('div');\n\t\t\tcell.className = 'diff-review-cell';\n\t\t\tcell.style.height = `${lineHeight}px`;\n\t\t\trow.appendChild(cell);\n\n\t\t\tconst originalLineNumber = document.createElement('span');\n\t\t\toriginalLineNumber.style.width = (originalLineNumbersWidth + 'px');\n\t\t\toriginalLineNumber.style.minWidth = (originalLineNumbersWidth + 'px');\n\t\t\toriginalLineNumber.className = 'diff-review-line-number' + lineNumbersExtraClassName;\n\t\t\tif (originalLine !== 0) {\n\t\t\t\toriginalLineNumber.appendChild(document.createTextNode(String(originalLine)));\n\t\t\t} else {\n\t\t\t\toriginalLineNumber.innerText = '\\u00a0';\n\t\t\t}\n\t\t\tcell.appendChild(originalLineNumber);\n\n\t\t\tconst modifiedLineNumber = document.createElement('span');\n\t\t\tmodifiedLineNumber.style.width = (modifiedLineNumbersWidth + 'px');\n\t\t\tmodifiedLineNumber.style.minWidth = (modifiedLineNumbersWidth + 'px');\n\t\t\tmodifiedLineNumber.style.paddingRight = '10px';\n\t\t\tmodifiedLineNumber.className = 'diff-review-line-number' + lineNumbersExtraClassName;\n\t\t\tif (modifiedLine !== 0) {\n\t\t\t\tmodifiedLineNumber.appendChild(document.createTextNode(String(modifiedLine)));\n\t\t\t} else {\n\t\t\t\tmodifiedLineNumber.innerText = '\\u00a0';\n\t\t\t}\n\t\t\tcell.appendChild(modifiedLineNumber);\n\n\t\t\tconst spacer = document.createElement('span');\n\t\t\tspacer.className = spacerClassName;\n\n\t\t\tif (spacerIcon) {\n\t\t\t\tconst spacerCodicon = document.createElement('span');\n\t\t\t\tspacerCodicon.className = ThemeIcon.asClassName(spacerIcon);\n\t\t\t\tspacerCodicon.innerText = '\\u00a0\\u00a0';\n\t\t\t\tspacer.appendChild(spacerCodicon);\n\t\t\t} else {\n\t\t\t\tspacer.innerText = '\\u00a0\\u00a0';\n\t\t\t}\n\t\t\tcell.appendChild(spacer);\n\n\t\t\tlet lineContent: string;\n\t\t\tif (modifiedLine !== 0) {\n\t\t\t\tlet html: string | TrustedHTML = this._renderLine(modifiedModel, modifiedOptions, modifiedModelOpts.tabSize, modifiedLine, languageIdCodec);\n\t\t\t\tif (DiffReview._ttPolicy) {\n\t\t\t\t\thtml = DiffReview._ttPolicy.createHTML(html as string);\n\t\t\t\t}\n\t\t\t\tcell.insertAdjacentHTML('beforeend', html as string);\n\t\t\t\tlineContent = modifiedModel.getLineContent(modifiedLine);\n\t\t\t} else {\n\t\t\t\tlet html: string | TrustedHTML = this._renderLine(originalModel, originalOptions, originalModelOpts.tabSize, originalLine, languageIdCodec);\n\t\t\t\tif (DiffReview._ttPolicy) {\n\t\t\t\t\thtml = DiffReview._ttPolicy.createHTML(html as string);\n\t\t\t\t}\n\t\t\t\tcell.insertAdjacentHTML('beforeend', html as string);\n\t\t\t\tlineContent = originalModel.getLineContent(originalLine);\n\t\t\t}\n\n\t\t\tif (lineContent.length === 0) {\n\t\t\t\tlineContent = nls.localize('blankLine', \"blank\");\n\t\t\t}\n\n\t\t\tlet ariaLabel: string = '';\n\t\t\tswitch (type) {\n\t\t\t\tcase DiffEntryType.Equal:\n\t\t\t\t\tif (originalLine === modifiedLine) {\n\t\t\t\t\t\tariaLabel = nls.localize({ key: 'unchangedLine', comment: ['The placeholders are contents of the line and should not be translated.'] }, \"{0} unchanged line {1}\", lineContent, originalLine);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tariaLabel = nls.localize('equalLine', \"{0} original line {1} modified line {2}\", lineContent, originalLine, modifiedLine);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DiffEntryType.Insert:\n\t\t\t\t\tariaLabel = nls.localize('insertLine', \"+ {0} modified line {1}\", lineContent, modifiedLine);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DiffEntryType.Delete:\n\t\t\t\t\tariaLabel = nls.localize('deleteLine', \"- {0} original line {1}\", lineContent, originalLine);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trow.setAttribute('aria-label', ariaLabel);\n\n\t\t\tdest.appendChild(row);\n\t\t}\n\t}\n\n\tprivate static _renderLine(model: ITextModel, options: IComputedEditorOptions, tabSize: number, lineNumber: number, languageIdCodec: ILanguageIdCodec): string {\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst lineTokens = LineTokens.createEmpty(lineContent, languageIdCodec);\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(lineContent, model.mightContainNonBasicASCII());\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII, model.mightContainRTL());\n\t\tconst r = renderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !options.get(EditorOption.disableMonospaceOptimizations)),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tlineContent,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\t[],\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\toptions.get(EditorOption.stopRenderingLineAfter),\n\t\t\toptions.get(EditorOption.renderWhitespace),\n\t\t\toptions.get(EditorOption.renderControlCharacters),\n\t\t\toptions.get(EditorOption.fontLigatures) !== EditorFontLigatures.OFF,\n\t\t\tnull\n\t\t));\n\n\t\treturn r.html;\n\t}\n}\n\n// theming\n\nregisterThemingParticipant((theme, collector) => {\n\tconst lineNumbers = theme.getColor(editorLineNumbers);\n\tif (lineNumbers) {\n\t\tcollector.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${lineNumbers}; }`);\n\t}\n\n\tconst shadow = theme.getColor(scrollbarShadow);\n\tif (shadow) {\n\t\tcollector.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${shadow} 0 -6px 6px -6px inset; }`);\n\t}\n});\n\nclass DiffReviewNext extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.diffReview.next',\n\t\t\tlabel: nls.localize('editor.action.diffReview.next', \"Go to Next Difference\"),\n\t\t\talias: 'Go to Next Difference',\n\t\t\tprecondition: ContextKeyExpr.has('isInDiffEditor'),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyCode.F7,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst diffEditor = findFocusedDiffEditor(accessor);\n\t\tif (diffEditor) {\n\t\t\tdiffEditor.diffReviewNext();\n\t\t}\n\t}\n}\n\nclass DiffReviewPrev extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.diffReview.prev',\n\t\t\tlabel: nls.localize('editor.action.diffReview.prev', \"Go to Previous Difference\"),\n\t\t\talias: 'Go to Previous Difference',\n\t\t\tprecondition: ContextKeyExpr.has('isInDiffEditor'),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F7,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst diffEditor = findFocusedDiffEditor(accessor);\n\t\tif (diffEditor) {\n\t\t\tdiffEditor.diffReviewPrev();\n\t\t}\n\t}\n}\n\nfunction findFocusedDiffEditor(accessor: ServicesAccessor): DiffEditorWidget | null {\n\tconst codeEditorService = accessor.get(ICodeEditorService);\n\tconst diffEditors = codeEditorService.listDiffEditors();\n\tconst activeCodeEditor = codeEditorService.getActiveCodeEditor();\n\tif (!activeCodeEditor) {\n\t\treturn null;\n\t}\n\n\tfor (let i = 0, len = diffEditors.length; i < len; i++) {\n\t\tconst diffEditor = <DiffEditorWidget>diffEditors[i];\n\t\tif (diffEditor.getModifiedEditor().getId() === activeCodeEditor.getId() || diffEditor.getOriginalEditor().getId() === activeCodeEditor.getId()) {\n\t\t\treturn diffEditor;\n\t\t}\n\t}\n\treturn null;\n}\n\nregisterEditorAction(DiffReviewNext);\nregisterEditorAction(DiffReviewPrev);\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 * as dom from 'vs/base/browser/dom';\nimport * as aria from 'vs/base/browser/ui/aria/aria';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Event } from 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\nimport { assertIsDefined } from 'vs/base/common/types';\nimport 'vs/css!./parameterHints';\nimport { IMarkdownRenderResult, MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport * as languages from 'vs/editor/common/languages';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ParameterHintsModel, TriggerContext } from 'vs/editor/contrib/parameterHints/browser/parameterHintsModel';\nimport { Context } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp';\nimport * as nls from 'vs/nls';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { editorHoverBackground, editorHoverBorder, editorHoverForeground, registerColor, textCodeBlockBackground, textLinkActiveForeground, textLinkForeground, listHighlightForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\nimport { registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nconst $ = dom.$;\n\nconst parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));\nconst parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));\n\nexport class ParameterHintsWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly ID = 'editor.widget.parameterHintsWidget';\n\n\tprivate readonly markdownRenderer: MarkdownRenderer;\n\tprivate readonly renderDisposeables = this._register(new DisposableStore());\n\tprivate readonly model: ParameterHintsModel;\n\tprivate readonly keyVisible: IContextKey<boolean>;\n\tprivate readonly keyMultipleSignatures: IContextKey<boolean>;\n\n\tprivate domNodes?: {\n\t\treadonly element: HTMLElement;\n\t\treadonly signature: HTMLElement;\n\t\treadonly docs: HTMLElement;\n\t\treadonly overloads: HTMLElement;\n\t\treadonly scrollbar: DomScrollableElement;\n\t};\n\n\tprivate visible: boolean = false;\n\tprivate announcedLabel: string | null = null;\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tallowEditorOverflow = true;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IOpenerService openerService: IOpenerService,\n\t\t@ILanguageService languageService: ILanguageService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService\n\t) {\n\t\tsuper();\n\t\tthis.markdownRenderer = this._register(new MarkdownRenderer({ editor }, languageService, openerService));\n\t\tthis.model = this._register(new ParameterHintsModel(editor, languageFeaturesService.signatureHelpProvider));\n\t\tthis.keyVisible = Context.Visible.bindTo(contextKeyService);\n\t\tthis.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);\n\n\t\tthis._register(this.model.onChangedHints(newParameterHints => {\n\t\t\tif (newParameterHints) {\n\t\t\t\tthis.show();\n\t\t\t\tthis.render(newParameterHints);\n\t\t\t} else {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate createParameterHintDOMNodes() {\n\t\tconst element = $('.editor-widget.parameter-hints-widget');\n\t\tconst wrapper = dom.append(element, $('.phwrapper'));\n\t\twrapper.tabIndex = -1;\n\n\t\tconst controls = dom.append(wrapper, $('.controls'));\n\t\tconst previous = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon)));\n\t\tconst overloads = dom.append(controls, $('.overloads'));\n\t\tconst next = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsNextIcon)));\n\n\t\tthis._register(dom.addDisposableListener(previous, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.previous();\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(next, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.next();\n\t\t}));\n\n\t\tconst body = $('.body');\n\t\tconst scrollbar = new DomScrollableElement(body, {});\n\t\tthis._register(scrollbar);\n\t\twrapper.appendChild(scrollbar.getDomNode());\n\n\t\tconst signature = dom.append(body, $('.signature'));\n\t\tconst docs = dom.append(body, $('.docs'));\n\n\t\telement.style.userSelect = 'text';\n\n\t\tthis.domNodes = {\n\t\t\telement,\n\t\t\tsignature,\n\t\t\toverloads,\n\t\t\tdocs,\n\t\t\tscrollbar,\n\t\t};\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.hide();\n\n\t\tthis._register(this.editor.onDidChangeCursorSelection(e => {\n\t\t\tif (this.visible) {\n\t\t\t\tthis.editor.layoutContentWidget(this);\n\t\t\t}\n\t\t}));\n\n\t\tconst updateFont = () => {\n\t\t\tif (!this.domNodes) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\t\tthis.domNodes.element.style.fontSize = `${fontInfo.fontSize}px`;\n\t\t\tthis.domNodes.element.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`;\n\t\t};\n\n\t\tupdateFont();\n\n\t\tthis._register(Event.chain<ConfigurationChangedEvent>(this.editor.onDidChangeConfiguration.bind(this.editor))\n\t\t\t.filter(e => e.hasChanged(EditorOption.fontInfo))\n\t\t\t.on(updateFont, null));\n\n\t\tthis._register(this.editor.onDidLayoutChange(e => this.updateMaxHeight()));\n\t\tthis.updateMaxHeight();\n\t}\n\n\tprivate show(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\n\t\tthis.keyVisible.set(true);\n\t\tthis.visible = true;\n\t\tsetTimeout(() => {\n\t\t\tif (this.domNodes) {\n\t\t\t\tthis.domNodes.element.classList.add('visible');\n\t\t\t}\n\t\t}, 100);\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tprivate hide(): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyVisible.reset();\n\t\tthis.visible = false;\n\t\tthis.announcedLabel = null;\n\t\tif (this.domNodes) {\n\t\t\tthis.domNodes.element.classList.remove('visible');\n\t\t}\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (this.visible) {\n\t\t\treturn {\n\t\t\t\tposition: this.editor.getPosition(),\n\t\t\t\tpreference: [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW]\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate render(hints: languages.SignatureHelp): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst multiple = hints.signatures.length > 1;\n\t\tthis.domNodes.element.classList.toggle('multiple', multiple);\n\t\tthis.keyMultipleSignatures.set(multiple);\n\n\t\tthis.domNodes.signature.innerText = '';\n\t\tthis.domNodes.docs.innerText = '';\n\n\t\tconst signature = hints.signatures[hints.activeSignature];\n\t\tif (!signature) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst code = dom.append(this.domNodes.signature, $('.code'));\n\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\tcode.style.fontSize = `${fontInfo.fontSize}px`;\n\t\tcode.style.fontFamily = fontInfo.fontFamily;\n\n\t\tconst hasParameters = signature.parameters.length > 0;\n\t\tconst activeParameterIndex = signature.activeParameter ?? hints.activeParameter;\n\n\t\tif (!hasParameters) {\n\t\t\tconst label = dom.append(code, $('span'));\n\t\t\tlabel.textContent = signature.label;\n\t\t} else {\n\t\t\tthis.renderParameters(code, signature, activeParameterIndex);\n\t\t}\n\n\t\tconst activeParameter: languages.ParameterInformation | undefined = signature.parameters[activeParameterIndex];\n\t\tif (activeParameter?.documentation) {\n\t\t\tconst documentation = $('span.documentation');\n\t\t\tif (typeof activeParameter.documentation === 'string') {\n\t\t\t\tdocumentation.textContent = activeParameter.documentation;\n\t\t\t} else {\n\t\t\t\tconst renderedContents = this.renderMarkdownDocs(activeParameter.documentation);\n\t\t\t\tdocumentation.appendChild(renderedContents.element);\n\t\t\t}\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, documentation));\n\t\t}\n\n\t\tif (signature.documentation === undefined) {\n\t\t\t/** no op */\n\t\t} else if (typeof signature.documentation === 'string') {\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, signature.documentation));\n\t\t} else {\n\t\t\tconst renderedContents = this.renderMarkdownDocs(signature.documentation);\n\t\t\tdom.append(this.domNodes.docs, renderedContents.element);\n\t\t}\n\n\t\tconst hasDocs = this.hasDocs(signature, activeParameter);\n\n\t\tthis.domNodes.signature.classList.toggle('has-docs', hasDocs);\n\t\tthis.domNodes.docs.classList.toggle('empty', !hasDocs);\n\n\t\tthis.domNodes.overloads.textContent =\n\t\t\tString(hints.activeSignature + 1).padStart(hints.signatures.length.toString().length, '0') + '/' + hints.signatures.length;\n\n\t\tif (activeParameter) {\n\t\t\tlet labelToAnnounce = '';\n\t\t\tconst param = signature.parameters[activeParameterIndex];\n\t\t\tif (Array.isArray(param.label)) {\n\t\t\t\tlabelToAnnounce = signature.label.substring(param.label[0], param.label[1]);\n\t\t\t} else {\n\t\t\t\tlabelToAnnounce = param.label;\n\t\t\t}\n\t\t\tif (param.documentation) {\n\t\t\t\tlabelToAnnounce += typeof param.documentation === 'string' ? `, ${param.documentation}` : `, ${param.documentation.value}`;\n\t\t\t}\n\t\t\tif (signature.documentation) {\n\t\t\t\tlabelToAnnounce += typeof signature.documentation === 'string' ? `, ${signature.documentation}` : `, ${signature.documentation.value}`;\n\t\t\t}\n\n\t\t\t// Select method gets called on every user type while parameter hints are visible.\n\t\t\t// We do not want to spam the user with same announcements, so we only announce if the current parameter changed.\n\n\t\t\tif (this.announcedLabel !== labelToAnnounce) {\n\t\t\t\taria.alert(nls.localize('hint', \"{0}, hint\", labelToAnnounce));\n\t\t\t\tthis.announcedLabel = labelToAnnounce;\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.layoutContentWidget(this);\n\t\tthis.domNodes.scrollbar.scanDomNode();\n\t}\n\n\tprivate renderMarkdownDocs(markdown: IMarkdownString | undefined): IMarkdownRenderResult {\n\t\tconst renderedContents = this.renderDisposeables.add(this.markdownRenderer.render(markdown, {\n\t\t\tasyncRenderCallback: () => {\n\t\t\t\tthis.domNodes?.scrollbar.scanDomNode();\n\t\t\t}\n\t\t}));\n\t\trenderedContents.element.classList.add('markdown-docs');\n\t\treturn renderedContents;\n\t}\n\n\tprivate hasDocs(signature: languages.SignatureInformation, activeParameter: languages.ParameterInformation | undefined): boolean {\n\t\tif (activeParameter && typeof activeParameter.documentation === 'string' && assertIsDefined(activeParameter.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (activeParameter && typeof activeParameter.documentation === 'object' && assertIsDefined(activeParameter.documentation).value.length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'string' && assertIsDefined(signature.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'object' && assertIsDefined(signature.documentation.value).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate renderParameters(parent: HTMLElement, signature: languages.SignatureInformation, activeParameterIndex: number): void {\n\t\tconst [start, end] = this.getParameterLabelOffsets(signature, activeParameterIndex);\n\n\t\tconst beforeSpan = document.createElement('span');\n\t\tbeforeSpan.textContent = signature.label.substring(0, start);\n\n\t\tconst paramSpan = document.createElement('span');\n\t\tparamSpan.textContent = signature.label.substring(start, end);\n\t\tparamSpan.className = 'parameter active';\n\n\t\tconst afterSpan = document.createElement('span');\n\t\tafterSpan.textContent = signature.label.substring(end);\n\n\t\tdom.append(parent, beforeSpan, paramSpan, afterSpan);\n\t}\n\n\tprivate getParameterLabelOffsets(signature: languages.SignatureInformation, paramIdx: number): [number, number] {\n\t\tconst param = signature.parameters[paramIdx];\n\t\tif (!param) {\n\t\t\treturn [0, 0];\n\t\t} else if (Array.isArray(param.label)) {\n\t\t\treturn param.label;\n\t\t} else if (!param.label.length) {\n\t\t\treturn [0, 0];\n\t\t} else {\n\t\t\tconst regex = new RegExp(`(\\\\W|^)${escapeRegExpCharacters(param.label)}(?=\\\\W|$)`, 'g');\n\t\t\tregex.test(signature.label);\n\t\t\tconst idx = regex.lastIndex - param.label.length;\n\t\t\treturn idx >= 0\n\t\t\t\t? [idx, regex.lastIndex]\n\t\t\t\t: [0, 0];\n\t\t}\n\t}\n\n\tnext(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.next();\n\t}\n\n\tprevious(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.previous();\n\t}\n\n\tcancel(): void {\n\t\tthis.model.cancel();\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\t\treturn this.domNodes!.element;\n\t}\n\n\tgetId(): string {\n\t\treturn ParameterHintsWidget.ID;\n\t}\n\n\ttrigger(context: TriggerContext): void {\n\t\tthis.model.trigger(context, 0);\n\t}\n\n\tprivate updateMaxHeight(): void {\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\t\tconst height = Math.max(this.editor.getLayoutInfo().height / 4, 250);\n\t\tconst maxHeight = `${height}px`;\n\t\tthis.domNodes.element.style.maxHeight = maxHeight;\n\t\tconst wrapper = this.domNodes.element.getElementsByClassName('phwrapper') as HTMLCollectionOf<HTMLElement>;\n\t\tif (wrapper.length) {\n\t\t\twrapper[0].style.maxHeight = maxHeight;\n\t\t}\n\t}\n}\n\nexport const editorHoverWidgetHighlightForeground = registerColor('editorHoverWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hc: listHighlightForeground }, nls.localize('editorHoverWidgetHighlightForeground', 'Foreground color of the active item in the parameter hint.'));\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(editorHoverBorder);\n\tif (border) {\n\t\tconst borderWidth = theme.type === ColorScheme.HIGH_CONTRAST ? 2 : 1;\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget { border: ${borderWidth}px solid ${border}; }`);\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${border.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${border.transparent(0.5)}; }`);\n\t}\n\tconst background = theme.getColor(editorHoverBackground);\n\tif (background) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${background}; }`);\n\t}\n\n\tconst link = theme.getColor(textLinkForeground);\n\tif (link) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget a { color: ${link}; }`);\n\t}\n\n\tconst linkHover = theme.getColor(textLinkActiveForeground);\n\tif (linkHover) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget a:hover { color: ${linkHover}; }`);\n\t}\n\n\tconst foreground = theme.getColor(editorHoverForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget { color: ${foreground}; }`);\n\t}\n\n\tconst codeBackground = theme.getColor(textCodeBlockBackground);\n\tif (codeBackground) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${codeBackground}; }`);\n\t}\n\n\tconst parameterHighlightColor = theme.getColor(editorHoverWidgetHighlightForeground);\n\tif (parameterHighlightColor) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget .parameter.active { color: ${parameterHighlightColor}}`);\n\t}\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport * as languages from 'vs/editor/common/languages';\nimport { TriggerContext } from 'vs/editor/contrib/parameterHints/browser/parameterHintsModel';\nimport { Context } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp';\nimport * as nls from 'vs/nls';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ParameterHintsWidget } from './parameterHintsWidget';\n\nclass ParameterHintsController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.controller.parameterHints';\n\n\tpublic static get(editor: ICodeEditor): ParameterHintsController | null {\n\t\treturn editor.getContribution<ParameterHintsController>(ParameterHintsController.ID);\n\t}\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly widget: ParameterHintsWidget;\n\n\tconstructor(editor: ICodeEditor, @IInstantiationService instantiationService: IInstantiationService) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tthis.widget = this._register(instantiationService.createInstance(ParameterHintsWidget, this.editor));\n\t}\n\n\tcancel(): void {\n\t\tthis.widget.cancel();\n\t}\n\n\tprevious(): void {\n\t\tthis.widget.previous();\n\t}\n\n\tnext(): void {\n\t\tthis.widget.next();\n\t}\n\n\ttrigger(context: TriggerContext): void {\n\t\tthis.widget.trigger(context);\n\t}\n}\n\nexport class TriggerParameterHintsAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.triggerParameterHints',\n\t\t\tlabel: nls.localize('parameterHints.trigger.label', \"Trigger Parameter Hints\"),\n\t\t\talias: 'Trigger Parameter Hints',\n\t\t\tprecondition: EditorContextKeys.hasSignatureHelpProvider,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Space,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst controller = ParameterHintsController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.trigger({\n\t\t\t\ttriggerKind: languages.SignatureHelpTriggerKind.Invoke\n\t\t\t});\n\t\t}\n\t}\n}\n\nregisterEditorContribution(ParameterHintsController.ID, ParameterHintsController);\nregisterEditorAction(TriggerParameterHintsAction);\n\nconst weight = KeybindingWeight.EditorContrib + 75;\n\nconst ParameterHintsCommand = EditorCommand.bindToContribution<ParameterHintsController>(ParameterHintsController.get);\n\nregisterEditorCommand(new ParameterHintsCommand({\n\tid: 'closeParameterHints',\n\tprecondition: Context.Visible,\n\thandler: x => x.cancel(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\nregisterEditorCommand(new ParameterHintsCommand({\n\tid: 'showPrevParameterHint',\n\tprecondition: ContextKeyExpr.and(Context.Visible, Context.MultipleSignatures),\n\thandler: x => x.previous(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.UpArrow,\n\t\tsecondary: [KeyMod.Alt | KeyCode.UpArrow],\n\t\tmac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KeyP] }\n\t}\n}));\nregisterEditorCommand(new ParameterHintsCommand({\n\tid: 'showNextParameterHint',\n\tprecondition: ContextKeyExpr.and(Context.Visible, Context.MultipleSignatures),\n\thandler: x => x.next(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.DownArrow,\n\t\tsecondary: [KeyMod.Alt | KeyCode.DownArrow],\n\t\tmac: { primary: KeyCode.DownArrow, secondary: [KeyMod.Alt | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KeyN] }\n\t}\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 { isSafari } from 'vs/base/browser/browser';\nimport { $, append, hide, show } from 'vs/base/browser/dom';\nimport { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { IListRenderer } from 'vs/base/browser/ui/list/list';\nimport { flatten } from 'vs/base/common/arrays';\nimport { Codicon, CSSIcon } from 'vs/base/common/codicons';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { createMatches } from 'vs/base/common/filters';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { CompletionItemKind, CompletionItemKinds, CompletionItemTag } from 'vs/editor/common/languages';\nimport { getIconClasses } from 'vs/editor/common/services/getIconClasses';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport * as nls from 'vs/nls';\nimport { FileKind } from 'vs/platform/files/common/files';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { CompletionItem } from './suggest';\nimport { canExpandCompletionItem } from './suggestWidgetDetails';\n\nexport function getAriaId(index: number): string {\n\treturn `suggest-aria-id:${index}`;\n}\n\nexport const suggestMoreInfoIcon = registerIcon('suggest-more-info', Codicon.chevronRight, nls.localize('suggestMoreInfoIcon', 'Icon for more information in the suggest widget.'));\n\nconst _completionItemColor = new class ColorExtractor {\n\n\tprivate static _regexRelaxed = /(#([\\da-fA-F]{3}){1,2}|(rgb|hsl)a\\(\\s*(\\d{1,3}%?\\s*,\\s*){3}(1|0?\\.\\d+)\\)|(rgb|hsl)\\(\\s*\\d{1,3}%?(\\s*,\\s*\\d{1,3}%?){2}\\s*\\))/;\n\tprivate static _regexStrict = new RegExp(`^${ColorExtractor._regexRelaxed.source}$`, 'i');\n\n\textract(item: CompletionItem, out: string[]): boolean {\n\t\tif (item.textLabel.match(ColorExtractor._regexStrict)) {\n\t\t\tout[0] = item.textLabel;\n\t\t\treturn true;\n\t\t}\n\t\tif (item.completion.detail && item.completion.detail.match(ColorExtractor._regexStrict)) {\n\t\t\tout[0] = item.completion.detail;\n\t\t\treturn true;\n\t\t}\n\t\tif (typeof item.completion.documentation === 'string') {\n\t\t\tconst match = ColorExtractor._regexRelaxed.exec(item.completion.documentation);\n\t\t\tif (match && (match.index === 0 || match.index + match[0].length === item.completion.documentation.length)) {\n\t\t\t\tout[0] = match[0];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n};\n\n\nexport interface ISuggestionTemplateData {\n\troot: HTMLElement;\n\n\t/**\n\t * Flexbox\n\t * < ------------- left ------------ > < --- right -- >\n\t * <icon><label><signature><qualifier> <type><readmore>\n\t */\n\tleft: HTMLElement;\n\tright: HTMLElement;\n\n\ticon: HTMLElement;\n\tcolorspan: HTMLElement;\n\ticonLabel: IconLabel;\n\ticonContainer: HTMLElement;\n\tparametersLabel: HTMLElement;\n\tqualifierLabel: HTMLElement;\n\t/**\n\t * Showing either `CompletionItem#details` or `CompletionItemLabel#type`\n\t */\n\tdetailsLabel: HTMLElement;\n\treadMore: HTMLElement;\n\tdisposables: DisposableStore;\n}\n\nexport class ItemRenderer implements IListRenderer<CompletionItem, ISuggestionTemplateData> {\n\n\tprivate readonly _onDidToggleDetails = new Emitter<void>();\n\treadonly onDidToggleDetails: Event<void> = this._onDidToggleDetails.event;\n\n\treadonly templateId = 'suggestion';\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IModelService private readonly _modelService: IModelService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IThemeService private readonly _themeService: IThemeService\n\t) { }\n\n\tdispose(): void {\n\t\tthis._onDidToggleDetails.dispose();\n\t}\n\n\trenderTemplate(container: HTMLElement): ISuggestionTemplateData {\n\t\tconst data = <ISuggestionTemplateData>Object.create(null);\n\t\tdata.disposables = new DisposableStore();\n\n\t\tdata.root = container;\n\t\tdata.root.classList.add('show-file-icons');\n\n\t\tdata.icon = append(container, $('.icon'));\n\t\tdata.colorspan = append(data.icon, $('span.colorspan'));\n\n\t\tconst text = append(container, $('.contents'));\n\t\tconst main = append(text, $('.main'));\n\n\t\tdata.iconContainer = append(main, $('.icon-label.codicon'));\n\t\tdata.left = append(main, $('span.left'));\n\t\tdata.right = append(main, $('span.right'));\n\n\t\tdata.iconLabel = new IconLabel(data.left, { supportHighlights: true, supportIcons: true });\n\t\tdata.disposables.add(data.iconLabel);\n\n\t\tdata.parametersLabel = append(data.left, $('span.signature-label'));\n\t\tdata.qualifierLabel = append(data.left, $('span.qualifier-label'));\n\t\tdata.detailsLabel = append(data.right, $('span.details-label'));\n\n\t\tdata.readMore = append(data.right, $('span.readMore' + ThemeIcon.asCSSSelector(suggestMoreInfoIcon)));\n\t\tdata.readMore.title = nls.localize('readMore', \"Read More\");\n\n\t\tconst configureFont = () => {\n\t\t\tconst options = this._editor.getOptions();\n\t\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\t\tconst fontFamily = fontInfo.getMassagedFontFamily(isSafari ? EDITOR_FONT_DEFAULTS.fontFamily : null);\n\t\t\tconst fontFeatureSettings = fontInfo.fontFeatureSettings;\n\t\t\tconst fontSize = options.get(EditorOption.suggestFontSize) || fontInfo.fontSize;\n\t\t\tconst lineHeight = options.get(EditorOption.suggestLineHeight) || fontInfo.lineHeight;\n\t\t\tconst fontWeight = fontInfo.fontWeight;\n\t\t\tconst fontSizePx = `${fontSize}px`;\n\t\t\tconst lineHeightPx = `${lineHeight}px`;\n\n\t\t\tdata.root.style.fontSize = fontSizePx;\n\t\t\tdata.root.style.fontWeight = fontWeight;\n\t\t\tmain.style.fontFamily = fontFamily;\n\t\t\tmain.style.fontFeatureSettings = fontFeatureSettings;\n\t\t\tmain.style.lineHeight = lineHeightPx;\n\t\t\tdata.icon.style.height = lineHeightPx;\n\t\t\tdata.icon.style.width = lineHeightPx;\n\t\t\tdata.readMore.style.height = lineHeightPx;\n\t\t\tdata.readMore.style.width = lineHeightPx;\n\t\t};\n\n\t\tconfigureFont();\n\n\t\tdata.disposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.suggestFontSize) || e.hasChanged(EditorOption.suggestLineHeight)) {\n\t\t\t\tconfigureFont();\n\t\t\t}\n\t\t}));\n\n\t\treturn data;\n\t}\n\n\trenderElement(element: CompletionItem, index: number, data: ISuggestionTemplateData): void {\n\t\tconst { completion } = element;\n\t\tdata.root.id = getAriaId(index);\n\t\tdata.colorspan.style.backgroundColor = '';\n\n\t\tconst labelOptions: IIconLabelValueOptions = {\n\t\t\tlabelEscapeNewLines: true,\n\t\t\tmatches: createMatches(element.score)\n\t\t};\n\n\t\tlet color: string[] = [];\n\t\tif (completion.kind === CompletionItemKind.Color && _completionItemColor.extract(element, color)) {\n\t\t\t// special logic for 'color' completion items\n\t\t\tdata.icon.className = 'icon customcolor';\n\t\t\tdata.iconContainer.className = 'icon hide';\n\t\t\tdata.colorspan.style.backgroundColor = color[0];\n\n\t\t} else if (completion.kind === CompletionItemKind.File && this._themeService.getFileIconTheme().hasFileIcons) {\n\t\t\t// special logic for 'file' completion items\n\t\t\tdata.icon.className = 'icon hide';\n\t\t\tdata.iconContainer.className = 'icon hide';\n\t\t\tconst labelClasses = getIconClasses(this._modelService, this._languageService, URI.from({ scheme: 'fake', path: element.textLabel }), FileKind.FILE);\n\t\t\tconst detailClasses = getIconClasses(this._modelService, this._languageService, URI.from({ scheme: 'fake', path: completion.detail }), FileKind.FILE);\n\t\t\tlabelOptions.extraClasses = labelClasses.length > detailClasses.length ? labelClasses : detailClasses;\n\n\t\t} else if (completion.kind === CompletionItemKind.Folder && this._themeService.getFileIconTheme().hasFolderIcons) {\n\t\t\t// special logic for 'folder' completion items\n\t\t\tdata.icon.className = 'icon hide';\n\t\t\tdata.iconContainer.className = 'icon hide';\n\t\t\tlabelOptions.extraClasses = flatten([\n\t\t\t\tgetIconClasses(this._modelService, this._languageService, URI.from({ scheme: 'fake', path: element.textLabel }), FileKind.FOLDER),\n\t\t\t\tgetIconClasses(this._modelService, this._languageService, URI.from({ scheme: 'fake', path: completion.detail }), FileKind.FOLDER)\n\t\t\t]);\n\t\t} else {\n\t\t\t// normal icon\n\t\t\tdata.icon.className = 'icon hide';\n\t\t\tdata.iconContainer.className = '';\n\t\t\tdata.iconContainer.classList.add('suggest-icon', ...CSSIcon.asClassNameArray(CompletionItemKinds.toIcon(completion.kind)));\n\t\t}\n\n\t\tif (completion.tags && completion.tags.indexOf(CompletionItemTag.Deprecated) >= 0) {\n\t\t\tlabelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']);\n\t\t\tlabelOptions.matches = [];\n\t\t}\n\n\t\tdata.iconLabel.setLabel(element.textLabel, undefined, labelOptions);\n\t\tif (typeof completion.label === 'string') {\n\t\t\tdata.parametersLabel.textContent = '';\n\t\t\tdata.detailsLabel.textContent = stripNewLines(completion.detail || '');\n\t\t\tdata.root.classList.add('string-label');\n\t\t} else {\n\t\t\tdata.parametersLabel.textContent = stripNewLines(completion.label.detail || '');\n\t\t\tdata.detailsLabel.textContent = stripNewLines(completion.label.description || '');\n\t\t\tdata.root.classList.remove('string-label');\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).showInlineDetails) {\n\t\t\tshow(data.detailsLabel);\n\t\t} else {\n\t\t\thide(data.detailsLabel);\n\t\t}\n\n\t\tif (canExpandCompletionItem(element)) {\n\t\t\tdata.right.classList.add('can-expand-details');\n\t\t\tshow(data.readMore);\n\t\t\tdata.readMore.onmousedown = e => {\n\t\t\t\te.stopPropagation();\n\t\t\t\te.preventDefault();\n\t\t\t};\n\t\t\tdata.readMore.onclick = e => {\n\t\t\t\te.stopPropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\tthis._onDidToggleDetails.fire();\n\t\t\t};\n\t\t} else {\n\t\t\tdata.right.classList.remove('can-expand-details');\n\t\t\thide(data.readMore);\n\t\t\tdata.readMore.onmousedown = null;\n\t\t\tdata.readMore.onclick = null;\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: ISuggestionTemplateData): void {\n\t\ttemplateData.disposables.dispose();\n\t}\n}\n\nfunction stripNewLines(str: string): string {\n\treturn str.replace(/\\r\\n|\\r|\\n/g, '');\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 *--------------------------------------------------------------------------------------------*/\nimport 'vs/css!./bannerController';\nimport { $, append, clearNode } from 'vs/base/browser/dom';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { Action } from 'vs/base/common/actions';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ILinkDescriptor, Link } from 'vs/platform/opener/browser/link';\nimport { widgetClose } from 'vs/platform/theme/common/iconRegistry';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nconst BANNER_ELEMENT_HEIGHT = 26;\n\nexport class BannerController extends Disposable {\n\tprivate readonly banner: Banner;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis.banner = this._register(this.instantiationService.createInstance(Banner));\n\t}\n\n\tpublic hide() {\n\t\tthis._editor.setBanner(null, 0);\n\t\tthis.banner.clear();\n\t}\n\n\tpublic show(item: IBannerItem) {\n\t\tthis.banner.show({\n\t\t\t...item,\n\t\t\tonClose: () => {\n\t\t\t\tthis.hide();\n\t\t\t\tif (item.onClose) {\n\t\t\t\t\titem.onClose();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis._editor.setBanner(this.banner.element, BANNER_ELEMENT_HEIGHT);\n\t}\n}\n\n// TODO@hediet: Investigate if this can be reused by the workspace banner (bannerPart.ts).\nclass Banner extends Disposable {\n\tpublic element: HTMLElement;\n\n\tprivate readonly markdownRenderer: MarkdownRenderer;\n\n\tprivate messageActionsContainer: HTMLElement | undefined;\n\n\tprivate actionBar: ActionBar | undefined;\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis.markdownRenderer = this.instantiationService.createInstance(MarkdownRenderer, {});\n\n\t\tthis.element = $('div.editor-banner');\n\t\tthis.element.tabIndex = 0;\n\t}\n\n\tprivate getAriaLabel(item: IBannerItem): string | undefined {\n\t\tif (item.ariaLabel) {\n\t\t\treturn item.ariaLabel;\n\t\t}\n\t\tif (typeof item.message === 'string') {\n\t\t\treturn item.message;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate getBannerMessage(message: MarkdownString | string): HTMLElement {\n\t\tif (typeof message === 'string') {\n\t\t\tconst element = $('span');\n\t\t\telement.innerText = message;\n\t\t\treturn element;\n\t\t}\n\n\t\treturn this.markdownRenderer.render(message).element;\n\t}\n\n\tpublic clear() {\n\t\tclearNode(this.element);\n\t}\n\n\tpublic show(item: IBannerItem) {\n\t\t// Clear previous item\n\t\tclearNode(this.element);\n\n\t\t// Banner aria label\n\t\tconst ariaLabel = this.getAriaLabel(item);\n\t\tif (ariaLabel) {\n\t\t\tthis.element.setAttribute('aria-label', ariaLabel);\n\t\t}\n\n\t\t// Icon\n\t\tconst iconContainer = append(this.element, $('div.icon-container'));\n\t\ticonContainer.setAttribute('aria-hidden', 'true');\n\n\t\tif (item.icon) {\n\t\t\ticonContainer.appendChild($(`div${ThemeIcon.asCSSSelector(item.icon)}`));\n\t\t}\n\n\t\t// Message\n\t\tconst messageContainer = append(this.element, $('div.message-container'));\n\t\tmessageContainer.setAttribute('aria-hidden', 'true');\n\t\tmessageContainer.appendChild(this.getBannerMessage(item.message));\n\n\t\t// Message Actions\n\t\tthis.messageActionsContainer = append(this.element, $('div.message-actions-container'));\n\t\tif (item.actions) {\n\t\t\tfor (const action of item.actions) {\n\t\t\t\tthis._register(this.instantiationService.createInstance(Link, this.messageActionsContainer, { ...action, tabIndex: -1 }, {}));\n\t\t\t}\n\t\t}\n\n\t\t// Action\n\t\tconst actionBarContainer = append(this.element, $('div.action-container'));\n\t\tthis.actionBar = this._register(new ActionBar(actionBarContainer));\n\t\tthis.actionBar.push(this._register(\n\t\t\tnew Action(\n\t\t\t\t'banner.close',\n\t\t\t\t'Close Banner',\n\t\t\t\tThemeIcon.asClassName(widgetClose),\n\t\t\t\ttrue,\n\t\t\t\t() => {\n\t\t\t\t\tif (typeof item.onClose === 'function') {\n\t\t\t\t\t\titem.onClose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t), { icon: true, label: false });\n\t\tthis.actionBar.setFocusable(false);\n\t}\n}\n\nexport interface IBannerItem {\n\treadonly id: string;\n\treadonly icon: ThemeIcon | undefined;\n\treadonly message: string | MarkdownString;\n\treadonly actions?: ILinkDescriptor[];\n\treadonly ariaLabel?: string;\n\treadonly onClose?: () => void;\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 { asCSSPropertyValue, asCSSUrl } from 'vs/base/browser/dom';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { getIconRegistry, IconContribution, IconFontDefinition } from 'vs/platform/theme/common/iconRegistry';\nimport { IProductIconTheme, IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nexport interface IIconsStyleSheet {\n\tgetCSS(): string;\n\treadonly onDidChange: Event<void>;\n}\n\nexport function getIconsStyleSheet(themeService: IThemeService | undefined): IIconsStyleSheet {\n\tconst onDidChangeEmmiter = new Emitter<void>();\n\tconst iconRegistry = getIconRegistry();\n\ticonRegistry.onDidChange(() => onDidChangeEmmiter.fire());\n\tthemeService?.onDidProductIconThemeChange(() => onDidChangeEmmiter.fire());\n\n\treturn {\n\t\tonDidChange: onDidChangeEmmiter.event,\n\t\tgetCSS() {\n\t\t\tconst productIconTheme = themeService ? themeService.getProductIconTheme() : new UnthemedProductIconTheme();\n\t\t\tconst usedFontIds: { [id: string]: IconFontDefinition } = {};\n\t\t\tconst formatIconRule = (contribution: IconContribution): string | undefined => {\n\t\t\t\tconst definition = productIconTheme.getIcon(contribution);\n\t\t\t\tif (!definition) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tconst fontContribution = definition.font;\n\t\t\t\tif (fontContribution) {\n\t\t\t\t\tusedFontIds[fontContribution.id] = fontContribution.definition;\n\t\t\t\t\treturn `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; font-family: ${asCSSPropertyValue(fontContribution.id)}; }`;\n\t\t\t\t}\n\t\t\t\t// default font (codicon)\n\t\t\t\treturn `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; }`;\n\t\t\t};\n\n\t\t\tconst rules = [];\n\t\t\tfor (let contribution of iconRegistry.getIcons()) {\n\t\t\t\tconst rule = formatIconRule(contribution);\n\t\t\t\tif (rule) {\n\t\t\t\t\trules.push(rule);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let id in usedFontIds) {\n\t\t\t\tconst definition = usedFontIds[id];\n\t\t\t\tconst fontWeight = definition.weight ? `font-weight: ${definition.weight};` : '';\n\t\t\t\tconst fontStyle = definition.style ? `font-style: ${definition.style};` : '';\n\t\t\t\tconst src = definition.src.map(l => `${asCSSUrl(l.location)} format('${l.format}')`).join(', ');\n\t\t\t\trules.push(`@font-face { src: ${src}; font-family: ${asCSSPropertyValue(id)};${fontWeight}${fontStyle} font-display: block; }`);\n\t\t\t}\n\t\t\treturn rules.join('\\n');\n\t\t}\n\t};\n}\n\nexport class UnthemedProductIconTheme implements IProductIconTheme {\n\tgetIcon(contribution: IconContribution) {\n\t\tconst iconRegistry = getIconRegistry();\n\t\tlet definition = contribution.defaults;\n\t\twhile (ThemeIcon.isThemeIcon(definition)) {\n\t\t\tconst c = iconRegistry.getIcon(definition.id);\n\t\t\tif (!c) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tdefinition = c.defaults;\n\t\t}\n\t\treturn definition;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter } from 'vs/base/common/event';\nimport { FontStyle, TokenizationRegistry, TokenMetadata } from 'vs/editor/common/languages';\nimport { ITokenThemeRule, TokenTheme, generateTokensCSSForColorMap } from 'vs/editor/common/languages/supports/tokenization';\nimport { BuiltinTheme, IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { hc_black, vs, vs_dark } from 'vs/editor/standalone/common/themes';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { asCssVariableName, ColorIdentifier, Extensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry';\nimport { Extensions as ThemingExtensions, ICssStyleCollector, IFileIconTheme, IProductIconTheme, IThemingRegistry, ITokenStyle } from 'vs/platform/theme/common/themeService';\nimport { IDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { ColorScheme } from 'vs/platform/theme/common/theme';\nimport { getIconsStyleSheet, UnthemedProductIconTheme } from 'vs/platform/theme/browser/iconsStyleSheet';\n\nconst VS_THEME_NAME = 'vs';\nconst VS_DARK_THEME_NAME = 'vs-dark';\nconst HC_BLACK_THEME_NAME = 'hc-black';\n\nconst colorRegistry = Registry.as<IColorRegistry>(Extensions.ColorContribution);\nconst themingRegistry = Registry.as<IThemingRegistry>(ThemingExtensions.ThemingContribution);\n\nclass StandaloneTheme implements IStandaloneTheme {\n\n\tpublic readonly id: string;\n\tpublic readonly themeName: string;\n\n\tprivate readonly themeData: IStandaloneThemeData;\n\tprivate colors: Map<string, Color> | null;\n\tprivate readonly defaultColors: { [colorId: string]: Color | undefined };\n\tprivate _tokenTheme: TokenTheme | null;\n\n\tconstructor(name: string, standaloneThemeData: IStandaloneThemeData) {\n\t\tthis.themeData = standaloneThemeData;\n\t\tconst base = standaloneThemeData.base;\n\t\tif (name.length > 0) {\n\t\t\tif (isBuiltinTheme(name)) {\n\t\t\t\tthis.id = name;\n\t\t\t} else {\n\t\t\t\tthis.id = base + ' ' + name;\n\t\t\t}\n\t\t\tthis.themeName = name;\n\t\t} else {\n\t\t\tthis.id = base;\n\t\t\tthis.themeName = base;\n\t\t}\n\t\tthis.colors = null;\n\t\tthis.defaultColors = Object.create(null);\n\t\tthis._tokenTheme = null;\n\t}\n\n\tpublic get base(): string {\n\t\treturn this.themeData.base;\n\t}\n\n\tpublic notifyBaseUpdated() {\n\t\tif (this.themeData.inherit) {\n\t\t\tthis.colors = null;\n\t\t\tthis._tokenTheme = null;\n\t\t}\n\t}\n\n\tprivate getColors(): Map<string, Color> {\n\t\tif (!this.colors) {\n\t\t\tconst colors = new Map<string, Color>();\n\t\t\tfor (let id in this.themeData.colors) {\n\t\t\t\tcolors.set(id, Color.fromHex(this.themeData.colors[id]));\n\t\t\t}\n\t\t\tif (this.themeData.inherit) {\n\t\t\t\tconst baseData = getBuiltinRules(this.themeData.base);\n\t\t\t\tfor (let id in baseData.colors) {\n\t\t\t\t\tif (!colors.has(id)) {\n\t\t\t\t\t\tcolors.set(id, Color.fromHex(baseData.colors[id]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.colors = colors;\n\t\t}\n\t\treturn this.colors;\n\t}\n\n\tpublic getColor(colorId: ColorIdentifier, useDefault?: boolean): Color | undefined {\n\t\tconst color = this.getColors().get(colorId);\n\t\tif (color) {\n\t\t\treturn color;\n\t\t}\n\t\tif (useDefault !== false) {\n\t\t\treturn this.getDefault(colorId);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate getDefault(colorId: ColorIdentifier): Color | undefined {\n\t\tlet color = this.defaultColors[colorId];\n\t\tif (color) {\n\t\t\treturn color;\n\t\t}\n\t\tcolor = colorRegistry.resolveDefaultColor(colorId, this);\n\t\tthis.defaultColors[colorId] = color;\n\t\treturn color;\n\t}\n\n\tpublic defines(colorId: ColorIdentifier): boolean {\n\t\treturn Object.prototype.hasOwnProperty.call(this.getColors(), colorId);\n\t}\n\n\tpublic get type(): ColorScheme {\n\t\tswitch (this.base) {\n\t\t\tcase VS_THEME_NAME: return ColorScheme.LIGHT;\n\t\t\tcase HC_BLACK_THEME_NAME: return ColorScheme.HIGH_CONTRAST;\n\t\t\tdefault: return ColorScheme.DARK;\n\t\t}\n\t}\n\n\tpublic get tokenTheme(): TokenTheme {\n\t\tif (!this._tokenTheme) {\n\t\t\tlet rules: ITokenThemeRule[] = [];\n\t\t\tlet encodedTokensColors: string[] = [];\n\t\t\tif (this.themeData.inherit) {\n\t\t\t\tconst baseData = getBuiltinRules(this.themeData.base);\n\t\t\t\trules = baseData.rules;\n\t\t\t\tif (baseData.encodedTokensColors) {\n\t\t\t\t\tencodedTokensColors = baseData.encodedTokensColors;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Pick up default colors from `editor.foreground` and `editor.background` if available\n\t\t\tconst editorForeground = this.themeData.colors['editor.foreground'];\n\t\t\tconst editorBackground = this.themeData.colors['editor.background'];\n\t\t\tif (editorForeground || editorBackground) {\n\t\t\t\tconst rule: ITokenThemeRule = { token: '' };\n\t\t\t\tif (editorForeground) {\n\t\t\t\t\trule.foreground = editorForeground;\n\t\t\t\t}\n\t\t\t\tif (editorBackground) {\n\t\t\t\t\trule.background = editorBackground;\n\t\t\t\t}\n\t\t\t\trules.push(rule);\n\t\t\t}\n\t\t\trules = rules.concat(this.themeData.rules);\n\t\t\tif (this.themeData.encodedTokensColors) {\n\t\t\t\tencodedTokensColors = this.themeData.encodedTokensColors;\n\t\t\t}\n\t\t\tthis._tokenTheme = TokenTheme.createFromRawTokenTheme(rules, encodedTokensColors);\n\t\t}\n\t\treturn this._tokenTheme;\n\t}\n\n\tpublic getTokenStyleMetadata(type: string, modifiers: string[], modelLanguage: string): ITokenStyle | undefined {\n\t\t// use theme rules match\n\t\tconst style = this.tokenTheme._match([type].concat(modifiers).join('.'));\n\t\tconst metadata = style.metadata;\n\t\tconst foreground = TokenMetadata.getForeground(metadata);\n\t\tconst fontStyle = TokenMetadata.getFontStyle(metadata);\n\t\treturn {\n\t\t\tforeground: foreground,\n\t\t\titalic: Boolean(fontStyle & FontStyle.Italic),\n\t\t\tbold: Boolean(fontStyle & FontStyle.Bold),\n\t\t\tunderline: Boolean(fontStyle & FontStyle.Underline),\n\t\t\tstrikethrough: Boolean(fontStyle & FontStyle.Strikethrough)\n\t\t};\n\t}\n\n\tpublic readonly semanticHighlighting = false;\n}\n\nfunction isBuiltinTheme(themeName: string): themeName is BuiltinTheme {\n\treturn (\n\t\tthemeName === VS_THEME_NAME\n\t\t|| themeName === VS_DARK_THEME_NAME\n\t\t|| themeName === HC_BLACK_THEME_NAME\n\t);\n}\n\nfunction getBuiltinRules(builtinTheme: BuiltinTheme): IStandaloneThemeData {\n\tswitch (builtinTheme) {\n\t\tcase VS_THEME_NAME:\n\t\t\treturn vs;\n\t\tcase VS_DARK_THEME_NAME:\n\t\t\treturn vs_dark;\n\t\tcase HC_BLACK_THEME_NAME:\n\t\t\treturn hc_black;\n\t}\n}\n\nfunction newBuiltInTheme(builtinTheme: BuiltinTheme): StandaloneTheme {\n\tconst themeData = getBuiltinRules(builtinTheme);\n\treturn new StandaloneTheme(builtinTheme, themeData);\n}\n\nexport class StandaloneThemeService extends Disposable implements IStandaloneThemeService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onColorThemeChange = this._register(new Emitter<IStandaloneTheme>());\n\tpublic readonly onDidColorThemeChange = this._onColorThemeChange.event;\n\n\tprivate readonly _onProductIconThemeChange = this._register(new Emitter<IProductIconTheme>());\n\tpublic readonly onDidProductIconThemeChange = this._onProductIconThemeChange.event;\n\n\tprivate readonly _environment: IEnvironmentService = Object.create(null);\n\tprivate readonly _knownThemes: Map<string, StandaloneTheme>;\n\tprivate _autoDetectHighContrast: boolean;\n\tprivate _codiconCSS: string;\n\tprivate _themeCSS: string;\n\tprivate _allCSS: string;\n\tprivate _globalStyleElement: HTMLStyleElement | null;\n\tprivate _styleElements: HTMLStyleElement[];\n\tprivate _colorMapOverride: Color[] | null;\n\tprivate _desiredTheme!: IStandaloneTheme;\n\tprivate _theme!: IStandaloneTheme;\n\n\tprivate _builtInProductIconTheme = new UnthemedProductIconTheme();\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._autoDetectHighContrast = true;\n\n\t\tthis._knownThemes = new Map<string, StandaloneTheme>();\n\t\tthis._knownThemes.set(VS_THEME_NAME, newBuiltInTheme(VS_THEME_NAME));\n\t\tthis._knownThemes.set(VS_DARK_THEME_NAME, newBuiltInTheme(VS_DARK_THEME_NAME));\n\t\tthis._knownThemes.set(HC_BLACK_THEME_NAME, newBuiltInTheme(HC_BLACK_THEME_NAME));\n\n\t\tconst iconsStyleSheet = getIconsStyleSheet(this);\n\n\t\tthis._codiconCSS = iconsStyleSheet.getCSS();\n\t\tthis._themeCSS = '';\n\t\tthis._allCSS = `${this._codiconCSS}\\n${this._themeCSS}`;\n\t\tthis._globalStyleElement = null;\n\t\tthis._styleElements = [];\n\t\tthis._colorMapOverride = null;\n\t\tthis.setTheme(VS_THEME_NAME);\n\n\t\ticonsStyleSheet.onDidChange(() => {\n\t\t\tthis._codiconCSS = iconsStyleSheet.getCSS();\n\t\t\tthis._updateCSS();\n\t\t});\n\n\t\tdom.addMatchMediaChangeListener('(forced-colors: active)', () => {\n\t\t\tthis._updateActualTheme();\n\t\t});\n\t}\n\n\tpublic registerEditorContainer(domNode: HTMLElement): IDisposable {\n\t\tif (dom.isInShadowDOM(domNode)) {\n\t\t\treturn this._registerShadowDomContainer(domNode);\n\t\t}\n\t\treturn this._registerRegularEditorContainer();\n\t}\n\n\tprivate _registerRegularEditorContainer(): IDisposable {\n\t\tif (!this._globalStyleElement) {\n\t\t\tthis._globalStyleElement = dom.createStyleSheet();\n\t\t\tthis._globalStyleElement.className = 'monaco-colors';\n\t\t\tthis._globalStyleElement.textContent = this._allCSS;\n\t\t\tthis._styleElements.push(this._globalStyleElement);\n\t\t}\n\t\treturn Disposable.None;\n\t}\n\n\tprivate _registerShadowDomContainer(domNode: HTMLElement): IDisposable {\n\t\tconst styleElement = dom.createStyleSheet(domNode);\n\t\tstyleElement.className = 'monaco-colors';\n\t\tstyleElement.textContent = this._allCSS;\n\t\tthis._styleElements.push(styleElement);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._styleElements.length; i++) {\n\t\t\t\t\tif (this._styleElements[i] === styleElement) {\n\t\t\t\t\t\tthis._styleElements.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic defineTheme(themeName: string, themeData: IStandaloneThemeData): void {\n\t\tif (!/^[a-z0-9\\-]+$/i.test(themeName)) {\n\t\t\tthrow new Error('Illegal theme name!');\n\t\t}\n\t\tif (!isBuiltinTheme(themeData.base) && !isBuiltinTheme(themeName)) {\n\t\t\tthrow new Error('Illegal theme base!');\n\t\t}\n\t\t// set or replace theme\n\t\tthis._knownThemes.set(themeName, new StandaloneTheme(themeName, themeData));\n\n\t\tif (isBuiltinTheme(themeName)) {\n\t\t\tthis._knownThemes.forEach(theme => {\n\t\t\t\tif (theme.base === themeName) {\n\t\t\t\t\ttheme.notifyBaseUpdated();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (this._theme.themeName === themeName) {\n\t\t\tthis.setTheme(themeName); // refresh theme\n\t\t}\n\t}\n\n\tpublic getColorTheme(): IStandaloneTheme {\n\t\treturn this._theme;\n\t}\n\n\tpublic setColorMapOverride(colorMapOverride: Color[] | null): void {\n\t\tthis._colorMapOverride = colorMapOverride;\n\t\tthis._updateThemeOrColorMap();\n\t}\n\n\tpublic setTheme(themeName: string): void {\n\t\tlet theme: StandaloneTheme;\n\t\tif (this._knownThemes.has(themeName)) {\n\t\t\ttheme = this._knownThemes.get(themeName)!;\n\t\t} else {\n\t\t\ttheme = this._knownThemes.get(VS_THEME_NAME)!;\n\t\t}\n\t\tthis._desiredTheme = theme;\n\t\tthis._updateActualTheme();\n\t}\n\n\tprivate _updateActualTheme(): void {\n\t\tconst theme = (\n\t\t\tthis._autoDetectHighContrast && window.matchMedia(`(forced-colors: active)`).matches\n\t\t\t\t? this._knownThemes.get(HC_BLACK_THEME_NAME)!\n\t\t\t\t: this._desiredTheme\n\t\t);\n\t\tif (this._theme === theme) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\t\tthis._theme = theme;\n\t\tthis._updateThemeOrColorMap();\n\t}\n\n\tpublic setAutoDetectHighContrast(autoDetectHighContrast: boolean): void {\n\t\tthis._autoDetectHighContrast = autoDetectHighContrast;\n\t\tthis._updateActualTheme();\n\t}\n\n\tprivate _updateThemeOrColorMap(): void {\n\t\tconst cssRules: string[] = [];\n\t\tconst hasRule: { [rule: string]: boolean } = {};\n\t\tconst ruleCollector: ICssStyleCollector = {\n\t\t\taddRule: (rule: string) => {\n\t\t\t\tif (!hasRule[rule]) {\n\t\t\t\t\tcssRules.push(rule);\n\t\t\t\t\thasRule[rule] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthemingRegistry.getThemingParticipants().forEach(p => p(this._theme, ruleCollector, this._environment));\n\n\t\tconst colorVariables: string[] = [];\n\t\tfor (const item of colorRegistry.getColors()) {\n\t\t\tconst color = this._theme.getColor(item.id, true);\n\t\t\tif (color) {\n\t\t\t\tcolorVariables.push(`${asCssVariableName(item.id)}: ${color.toString()};`);\n\t\t\t}\n\t\t}\n\t\truleCollector.addRule(`.monaco-editor { ${colorVariables.join('\\n')} }`);\n\n\t\tconst colorMap = this._colorMapOverride || this._theme.tokenTheme.getColorMap();\n\t\truleCollector.addRule(generateTokensCSSForColorMap(colorMap));\n\n\t\tthis._themeCSS = cssRules.join('\\n');\n\t\tthis._updateCSS();\n\n\t\tTokenizationRegistry.setColorMap(colorMap);\n\t\tthis._onColorThemeChange.fire(this._theme);\n\t}\n\n\tprivate _updateCSS(): void {\n\t\tthis._allCSS = `${this._codiconCSS}\\n${this._themeCSS}`;\n\t\tthis._styleElements.forEach(styleElement => styleElement.textContent = this._allCSS);\n\t}\n\n\tpublic getFileIconTheme(): IFileIconTheme {\n\t\treturn {\n\t\t\thasFileIcons: false,\n\t\t\thasFolderIcons: false,\n\t\t\thidesExplorerArrows: false\n\t\t};\n\t}\n\n\tpublic getProductIconTheme(): IProductIconTheme {\n\t\treturn this._builtInProductIconTheme;\n\t}\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IUndoRedoService = createDecorator<IUndoRedoService>('undoRedoService');\n\nexport const enum UndoRedoElementType {\n\tResource,\n\tWorkspace\n}\n\nexport interface IResourceUndoRedoElement {\n\treadonly type: UndoRedoElementType.Resource;\n\treadonly resource: URI;\n\treadonly label: string;\n\t/**\n\t * Show a message to the user confirming when trying to undo this element\n\t */\n\treadonly confirmBeforeUndo?: boolean;\n\tundo(): Promise<void> | void;\n\tredo(): Promise<void> | void;\n}\n\nexport interface IWorkspaceUndoRedoElement {\n\treadonly type: UndoRedoElementType.Workspace;\n\treadonly resources: readonly URI[];\n\treadonly label: string;\n\t/**\n\t * Show a message to the user confirming when trying to undo this element\n\t */\n\treadonly confirmBeforeUndo?: boolean;\n\tundo(): Promise<void> | void;\n\tredo(): Promise<void> | void;\n\n\t/**\n\t * If implemented, indicates that this undo/redo element can be split into multiple per resource elements.\n\t */\n\tsplit?(): IResourceUndoRedoElement[];\n\n\t/**\n\t * If implemented, will be invoked before calling `undo()` or `redo()`.\n\t * This is a good place to prepare everything such that the calls to `undo()` or `redo()` are synchronous.\n\t * If a disposable is returned, it will be invoked to clean things up.\n\t */\n\tprepareUndoRedo?(): Promise<IDisposable> | IDisposable | void;\n}\n\nexport type IUndoRedoElement = IResourceUndoRedoElement | IWorkspaceUndoRedoElement;\n\nexport interface IPastFutureElements {\n\tpast: IUndoRedoElement[];\n\tfuture: IUndoRedoElement[];\n}\n\nexport interface UriComparisonKeyComputer {\n\tgetComparisonKey(uri: URI): string;\n}\n\nexport class ResourceEditStackSnapshot {\n\tconstructor(\n\t\tpublic readonly resource: URI,\n\t\tpublic readonly elements: number[]\n\t) { }\n}\n\nexport class UndoRedoGroup {\n\tprivate static _ID = 0;\n\n\tpublic readonly id: number;\n\tprivate order: number;\n\n\tconstructor() {\n\t\tthis.id = UndoRedoGroup._ID++;\n\t\tthis.order = 1;\n\t}\n\n\tpublic nextOrder(): number {\n\t\tif (this.id === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.order++;\n\t}\n\n\tpublic static None = new UndoRedoGroup();\n}\n\nexport class UndoRedoSource {\n\tprivate static _ID = 0;\n\n\tpublic readonly id: number;\n\tprivate order: number;\n\n\tconstructor() {\n\t\tthis.id = UndoRedoSource._ID++;\n\t\tthis.order = 1;\n\t}\n\n\tpublic nextOrder(): number {\n\t\tif (this.id === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.order++;\n\t}\n\n\tpublic static None = new UndoRedoSource();\n}\n\nexport interface IUndoRedoService {\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Get the hash used internally for a certain URI.\n\t * This uses any registered `UriComparisonKeyComputer`.\n\t */\n\tgetUriComparisonKey(resource: URI): string;\n\n\t/**\n\t * Add a new element to the `undo` stack.\n\t * This will destroy the `redo` stack.\n\t */\n\tpushElement(element: IUndoRedoElement, group?: UndoRedoGroup, source?: UndoRedoSource): void;\n\n\t/**\n\t * Get the last pushed element for a resource.\n\t * If the last pushed element has been undone, returns null.\n\t */\n\tgetLastElement(resource: URI): IUndoRedoElement | null;\n\n\t/**\n\t * Get all the elements associated with a resource.\n\t * This includes the past and the future.\n\t */\n\tgetElements(resource: URI): IPastFutureElements;\n\n\t/**\n\t * Validate or invalidate stack elements associated with a resource.\n\t */\n\tsetElementsValidFlag(resource: URI, isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void;\n\n\t/**\n\t * Remove elements that target `resource`.\n\t */\n\tremoveElements(resource: URI): void;\n\n\t/**\n\t * Create a snapshot of the current elements on the undo-redo stack for a resource.\n\t */\n\tcreateSnapshot(resource: URI): ResourceEditStackSnapshot;\n\t/**\n\t * Attempt (as best as possible) to restore a certain snapshot previously created with `createSnapshot` for a resource.\n\t */\n\trestoreSnapshot(snapshot: ResourceEditStackSnapshot): void;\n\n\tcanUndo(resource: URI | UndoRedoSource): boolean;\n\tundo(resource: URI | UndoRedoSource): Promise<void> | void;\n\n\tcanRedo(resource: URI | UndoRedoSource): boolean;\n\tredo(resource: URI | UndoRedoSource): Promise<void> | void;\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 { ArrayQueue } from 'vs/base/common/arrays';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { Color } from 'vs/base/common/color';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { combinedDisposable, Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/base/common/uint';\nimport { URI } from 'vs/base/common/uri';\nimport { LineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport * as model from 'vs/editor/common/model';\nimport { IBracketPairsTextModelPart } from 'vs/editor/common/textModelBracketPairs';\nimport { BracketPairsTextModelPart } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl';\nimport { ColorizedBracketPairsDecorationProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider';\nimport { EditStack } from 'vs/editor/common/model/editStack';\nimport { GuidesTextModelPart } from 'vs/editor/common/model/guidesTextModelPart';\nimport { IGuidesTextModelPart } from 'vs/editor/common/textModelGuides';\nimport { guessIndentation } from 'vs/editor/common/model/indentationGuesser';\nimport { IntervalNode, IntervalTree, recomputeMaxEnd } from 'vs/editor/common/model/intervalTree';\nimport { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer';\nimport { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder';\nimport { TextChange } from 'vs/editor/common/core/textChange';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent, InternalModelContentChangeEvent, LineInjectedText, ModelInjectedTextChangedEvent, ModelRawChange, ModelRawContentChangedEvent, ModelRawEOLChanged, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/textModelEvents';\nimport { SearchParams, TextModelSearch } from 'vs/editor/common/model/textModelSearch';\nimport { TextModelTokenization } from 'vs/editor/common/model/textModelTokens';\nimport { countEOL } from 'vs/editor/common/core/eolCounter';\nimport { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens';\nimport { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens';\nimport { ContiguousTokensStore } from 'vs/editor/common/tokens/contiguousTokensStore';\nimport { SparseTokensStore } from 'vs/editor/common/tokens/sparseTokensStore';\nimport { getWordAtText, IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { FormattingOptions, StandardTokenType } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService, ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { IColorTheme, ThemeColor } from 'vs/platform/theme/common/themeService';\nimport { IUndoRedoService, ResourceEditStackSnapshot } from 'vs/platform/undoRedo/common/undoRedo';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';\nimport { normalizeIndentation } from 'vs/editor/common/core/indentation';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\n\nfunction createTextBufferBuilder() {\n\treturn new PieceTreeTextBufferBuilder();\n}\n\nexport function createTextBufferFactory(text: string): model.ITextBufferFactory {\n\tconst builder = createTextBufferBuilder();\n\tbuilder.acceptChunk(text);\n\treturn builder.finish();\n}\n\nexport function createTextBuffer(value: string | model.ITextBufferFactory, defaultEOL: model.DefaultEndOfLine): { textBuffer: model.ITextBuffer; disposable: IDisposable } {\n\tconst factory = (typeof value === 'string' ? createTextBufferFactory(value) : value);\n\treturn factory.create(defaultEOL);\n}\n\nlet MODEL_ID = 0;\n\nconst LIMIT_FIND_COUNT = 999;\nexport const LONG_LINE_BOUNDARY = 10000;\n\nclass TextModelSnapshot implements model.ITextSnapshot {\n\n\tprivate readonly _source: model.ITextSnapshot;\n\tprivate _eos: boolean;\n\n\tconstructor(source: model.ITextSnapshot) {\n\t\tthis._source = source;\n\t\tthis._eos = false;\n\t}\n\n\tpublic read(): string | null {\n\t\tif (this._eos) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst result: string[] = [];\n\t\tlet resultCnt = 0;\n\t\tlet resultLength = 0;\n\n\t\tdo {\n\t\t\tconst tmp = this._source.read();\n\n\t\t\tif (tmp === null) {\n\t\t\t\t// end-of-stream\n\t\t\t\tthis._eos = true;\n\t\t\t\tif (resultCnt === 0) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\treturn result.join('');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tmp.length > 0) {\n\t\t\t\tresult[resultCnt++] = tmp;\n\t\t\t\tresultLength += tmp.length;\n\t\t\t}\n\n\t\t\tif (resultLength >= 64 * 1024) {\n\t\t\t\treturn result.join('');\n\t\t\t}\n\t\t} while (true);\n\t}\n}\n\nconst invalidFunc = () => { throw new Error(`Invalid change accessor`); };\n\nconst enum StringOffsetValidationType {\n\t/**\n\t * Even allowed in surrogate pairs\n\t */\n\tRelaxed = 0,\n\t/**\n\t * Not allowed in surrogate pairs\n\t */\n\tSurrogatePairs = 1,\n}\n\nexport const enum BackgroundTokenizationState {\n\tUninitialized = 0,\n\tInProgress = 1,\n\tCompleted = 2,\n}\n\nexport class TextModel extends Disposable implements model.ITextModel, IDecorationsTreesHost {\n\n\tprivate static readonly MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB\n\tprivate static readonly LARGE_FILE_SIZE_THRESHOLD = 20 * 1024 * 1024; // 20 MB;\n\tprivate static readonly LARGE_FILE_LINE_COUNT_THRESHOLD = 300 * 1000; // 300K lines\n\n\tpublic static DEFAULT_CREATION_OPTIONS: model.ITextModelCreationOptions = {\n\t\tisForSimpleWidget: false,\n\t\ttabSize: EDITOR_MODEL_DEFAULTS.tabSize,\n\t\tindentSize: EDITOR_MODEL_DEFAULTS.indentSize,\n\t\tinsertSpaces: EDITOR_MODEL_DEFAULTS.insertSpaces,\n\t\tdetectIndentation: false,\n\t\tdefaultEOL: model.DefaultEndOfLine.LF,\n\t\ttrimAutoWhitespace: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,\n\t\tlargeFileOptimizations: EDITOR_MODEL_DEFAULTS.largeFileOptimizations,\n\t\tbracketPairColorizationOptions: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions,\n\t};\n\n\tpublic static resolveOptions(textBuffer: model.ITextBuffer, options: model.ITextModelCreationOptions): model.TextModelResolvedOptions {\n\t\tif (options.detectIndentation) {\n\t\t\tconst guessedIndentation = guessIndentation(textBuffer, options.tabSize, options.insertSpaces);\n\t\t\treturn new model.TextModelResolvedOptions({\n\t\t\t\ttabSize: guessedIndentation.tabSize,\n\t\t\t\tindentSize: guessedIndentation.tabSize, // TODO@Alex: guess indentSize independent of tabSize\n\t\t\t\tinsertSpaces: guessedIndentation.insertSpaces,\n\t\t\t\ttrimAutoWhitespace: options.trimAutoWhitespace,\n\t\t\t\tdefaultEOL: options.defaultEOL,\n\t\t\t\tbracketPairColorizationOptions: options.bracketPairColorizationOptions,\n\t\t\t});\n\t\t}\n\n\t\treturn new model.TextModelResolvedOptions({\n\t\t\ttabSize: options.tabSize,\n\t\t\tindentSize: options.indentSize,\n\t\t\tinsertSpaces: options.insertSpaces,\n\t\t\ttrimAutoWhitespace: options.trimAutoWhitespace,\n\t\t\tdefaultEOL: options.defaultEOL,\n\t\t\tbracketPairColorizationOptions: options.bracketPairColorizationOptions,\n\t\t});\n\n\t}\n\n\t//#region Events\n\tprivate readonly _onWillDispose: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onWillDispose: Event<void> = this._onWillDispose.event;\n\n\tprivate readonly _onDidChangeDecorations: DidChangeDecorationsEmitter = this._register(new DidChangeDecorationsEmitter(affectedInjectedTextLines => this.handleBeforeFireDecorationsChangedEvent(affectedInjectedTextLines)));\n\tpublic readonly onDidChangeDecorations: Event<IModelDecorationsChangedEvent> = this._onDidChangeDecorations.event;\n\n\tprivate readonly _onDidChangeLanguage: Emitter<IModelLanguageChangedEvent> = this._register(new Emitter<IModelLanguageChangedEvent>());\n\tpublic readonly onDidChangeLanguage: Event<IModelLanguageChangedEvent> = this._onDidChangeLanguage.event;\n\n\tprivate readonly _onDidChangeLanguageConfiguration: Emitter<IModelLanguageConfigurationChangedEvent> = this._register(new Emitter<IModelLanguageConfigurationChangedEvent>());\n\tpublic readonly onDidChangeLanguageConfiguration: Event<IModelLanguageConfigurationChangedEvent> = this._onDidChangeLanguageConfiguration.event;\n\n\tprivate readonly _onDidChangeTokens: Emitter<IModelTokensChangedEvent> = this._register(new Emitter<IModelTokensChangedEvent>());\n\tpublic readonly onDidChangeTokens: Event<IModelTokensChangedEvent> = this._onDidChangeTokens.event;\n\n\tprivate readonly _onDidChangeOptions: Emitter<IModelOptionsChangedEvent> = this._register(new Emitter<IModelOptionsChangedEvent>());\n\tpublic readonly onDidChangeOptions: Event<IModelOptionsChangedEvent> = this._onDidChangeOptions.event;\n\n\tprivate readonly _onDidChangeAttached: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChangeAttached: Event<void> = this._onDidChangeAttached.event;\n\n\tprivate readonly _onDidChangeInjectedText: Emitter<ModelInjectedTextChangedEvent> = this._register(new Emitter<ModelInjectedTextChangedEvent>());\n\n\tprivate readonly _eventEmitter: DidChangeContentEmitter = this._register(new DidChangeContentEmitter());\n\tpublic onDidChangeContent(listener: (e: IModelContentChangedEvent) => void): IDisposable {\n\t\treturn this._eventEmitter.slowEvent((e: InternalModelContentChangeEvent) => listener(e.contentChangedEvent));\n\t}\n\tpublic onDidChangeContentOrInjectedText(listener: (e: ModelRawContentChangedEvent | ModelInjectedTextChangedEvent) => void): IDisposable {\n\t\treturn combinedDisposable(\n\t\t\tthis._eventEmitter.fastEvent(e => listener(e.rawContentChangedEvent)),\n\t\t\tthis._onDidChangeInjectedText.event(e => listener(e))\n\t\t);\n\t}\n\t//#endregion\n\n\tpublic readonly id: string;\n\tpublic readonly isForSimpleWidget: boolean;\n\tprivate readonly _associatedResource: URI;\n\tprivate _attachedEditorCount: number;\n\tprivate _buffer: model.ITextBuffer;\n\tprivate _bufferDisposable: IDisposable;\n\tprivate _options: model.TextModelResolvedOptions;\n\n\tprivate _isDisposed: boolean;\n\tprivate _isDisposing: boolean;\n\tprivate _versionId: number;\n\t/**\n\t * Unlike, versionId, this can go down (via undo) or go to previous values (via redo)\n\t */\n\tprivate _alternativeVersionId: number;\n\tprivate _initialUndoRedoSnapshot: ResourceEditStackSnapshot | null;\n\tprivate readonly _isTooLargeForSyncing: boolean;\n\tprivate readonly _isTooLargeForTokenization: boolean;\n\n\t//#region Editing\n\tprivate readonly _commandManager: EditStack;\n\tprivate _isUndoing: boolean;\n\tprivate _isRedoing: boolean;\n\tprivate _trimAutoWhitespaceLines: number[] | null;\n\t//#endregion\n\n\t//#region Decorations\n\t/**\n\t * Used to workaround broken clients that might attempt using a decoration id generated by a different model.\n\t * It is not globally unique in order to limit it to one character.\n\t */\n\tprivate readonly _instanceId: string;\n\tprivate _lastDecorationId: number;\n\tprivate _decorations: { [decorationId: string]: IntervalNode };\n\tprivate _decorationsTree: DecorationsTrees;\n\tprivate readonly _decorationProvider: ColorizedBracketPairsDecorationProvider;\n\t//#endregion\n\n\t//#region Tokenization\n\tprivate _languageId: string;\n\tprivate readonly _languageRegistryListener: IDisposable;\n\tprivate readonly _tokens: ContiguousTokensStore;\n\tprivate readonly _semanticTokens: SparseTokensStore;\n\tprivate readonly _tokenization: TextModelTokenization;\n\t//#endregion\n\n\tprivate readonly _bracketPairColorizer: BracketPairsTextModelPart;\n\tpublic get bracketPairs(): IBracketPairsTextModelPart { return this._bracketPairColorizer; }\n\n\tprivate readonly _guidesTextModelPart: GuidesTextModelPart;\n\tpublic get guides(): IGuidesTextModelPart { return this._guidesTextModelPart; }\n\n\tprivate _backgroundTokenizationState = BackgroundTokenizationState.Uninitialized;\n\tpublic get backgroundTokenizationState(): BackgroundTokenizationState {\n\t\treturn this._backgroundTokenizationState;\n\t}\n\tprivate handleTokenizationProgress(completed: boolean) {\n\t\tif (this._backgroundTokenizationState === BackgroundTokenizationState.Completed) {\n\t\t\t// We already did a full tokenization and don't go back to progressing.\n\t\t\treturn;\n\t\t}\n\t\tconst newState = completed ? BackgroundTokenizationState.Completed : BackgroundTokenizationState.InProgress;\n\t\tif (this._backgroundTokenizationState !== newState) {\n\t\t\tthis._backgroundTokenizationState = newState;\n\t\t\tthis._bracketPairColorizer.handleDidChangeBackgroundTokenizationState();\n\t\t\tthis._onBackgroundTokenizationStateChanged.fire();\n\t\t}\n\t}\n\n\tprivate readonly _onBackgroundTokenizationStateChanged = this._register(new Emitter<void>());\n\n\tconstructor(\n\t\tsource: string | model.ITextBufferFactory,\n\t\tlanguageId: string,\n\t\tcreationOptions: model.ITextModelCreationOptions,\n\t\tassociatedResource: URI | null = null,\n\t\t@IUndoRedoService private readonly _undoRedoService: IUndoRedoService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t) {\n\t\tsuper();\n\n\t\t// Generate a new unique model id\n\t\tMODEL_ID++;\n\t\tthis.id = '$model' + MODEL_ID;\n\t\tthis.isForSimpleWidget = creationOptions.isForSimpleWidget;\n\t\tif (typeof associatedResource === 'undefined' || associatedResource === null) {\n\t\t\tthis._associatedResource = URI.parse('inmemory://model/' + MODEL_ID);\n\t\t} else {\n\t\t\tthis._associatedResource = associatedResource;\n\t\t}\n\t\tthis._attachedEditorCount = 0;\n\n\t\tconst { textBuffer, disposable } = createTextBuffer(source, creationOptions.defaultEOL);\n\t\tthis._buffer = textBuffer;\n\t\tthis._bufferDisposable = disposable;\n\n\t\tthis._options = TextModel.resolveOptions(this._buffer, creationOptions);\n\n\t\tconst bufferLineCount = this._buffer.getLineCount();\n\t\tconst bufferTextLength = this._buffer.getValueLengthInRange(new Range(1, 1, bufferLineCount, this._buffer.getLineLength(bufferLineCount) + 1), model.EndOfLinePreference.TextDefined);\n\n\t\t// !!! Make a decision in the ctor and permanently respect this decision !!!\n\t\t// If a model is too large at construction time, it will never get tokenized,\n\t\t// under no circumstances.\n\t\tif (creationOptions.largeFileOptimizations) {\n\t\t\tthis._isTooLargeForTokenization = (\n\t\t\t\t(bufferTextLength > TextModel.LARGE_FILE_SIZE_THRESHOLD)\n\t\t\t\t|| (bufferLineCount > TextModel.LARGE_FILE_LINE_COUNT_THRESHOLD)\n\t\t\t);\n\t\t} else {\n\t\t\tthis._isTooLargeForTokenization = false;\n\t\t}\n\n\t\tthis._isTooLargeForSyncing = (bufferTextLength > TextModel.MODEL_SYNC_LIMIT);\n\n\t\tthis._versionId = 1;\n\t\tthis._alternativeVersionId = 1;\n\t\tthis._initialUndoRedoSnapshot = null;\n\n\t\tthis._isDisposed = false;\n\t\tthis._isDisposing = false;\n\n\t\tthis._languageId = languageId;\n\n\t\tthis._languageRegistryListener = this._languageConfigurationService.onDidChange(\n\t\t\te => {\n\t\t\t\tif (e.affects(this._languageId)) {\n\t\t\t\t\tthis._onDidChangeLanguageConfiguration.fire({});\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis._instanceId = strings.singleLetterHash(MODEL_ID);\n\t\tthis._lastDecorationId = 0;\n\t\tthis._decorations = Object.create(null);\n\t\tthis._decorationsTree = new DecorationsTrees();\n\n\t\tthis._commandManager = new EditStack(this, this._undoRedoService);\n\t\tthis._isUndoing = false;\n\t\tthis._isRedoing = false;\n\t\tthis._trimAutoWhitespaceLines = null;\n\n\t\tthis._tokens = new ContiguousTokensStore(this._languageService.languageIdCodec);\n\t\tthis._semanticTokens = new SparseTokensStore(this._languageService.languageIdCodec);\n\t\tthis._tokenization = new TextModelTokenization(this, this._languageService.languageIdCodec);\n\n\t\tthis._bracketPairColorizer = this._register(new BracketPairsTextModelPart(this, this._languageConfigurationService));\n\t\tthis._guidesTextModelPart = this._register(new GuidesTextModelPart(this, this._languageConfigurationService));\n\t\tthis._decorationProvider = this._register(new ColorizedBracketPairsDecorationProvider(this));\n\n\t\tthis._register(this._decorationProvider.onDidChange(() => {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.fire();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._isDisposing = true;\n\t\tthis._onWillDispose.fire();\n\t\tthis._languageRegistryListener.dispose();\n\t\tthis._tokenization.dispose();\n\t\tthis._isDisposed = true;\n\t\tsuper.dispose();\n\t\tthis._bufferDisposable.dispose();\n\t\tthis._isDisposing = false;\n\t\t// Manually release reference to previous text buffer to avoid large leaks\n\t\t// in case someone leaks a TextModel reference\n\t\tconst emptyDisposedTextBuffer = new PieceTreeTextBuffer([], '', '\\n', false, false, true, true);\n\t\temptyDisposedTextBuffer.dispose();\n\t\tthis._buffer = emptyDisposedTextBuffer;\n\t\tthis._bufferDisposable = Disposable.None;\n\t}\n\n\tprivate _assertNotDisposed(): void {\n\t\tif (this._isDisposed) {\n\t\t\tthrow new Error('Model is disposed!');\n\t\t}\n\t}\n\n\tprivate _emitContentChangedEvent(rawChange: ModelRawContentChangedEvent, change: IModelContentChangedEvent): void {\n\t\tif (this._isDisposing) {\n\t\t\t// Do not confuse listeners by emitting any event after disposing\n\t\t\treturn;\n\t\t}\n\t\tthis._bracketPairColorizer.handleDidChangeContent(change);\n\t\tthis._tokenization.handleDidChangeContent(change);\n\t\tthis._eventEmitter.fire(new InternalModelContentChangeEvent(rawChange, change));\n\t}\n\n\tpublic setValue(value: string): void {\n\t\tthis._assertNotDisposed();\n\t\tif (value === null) {\n\t\t\t// There's nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tconst { textBuffer, disposable } = createTextBuffer(value, this._options.defaultEOL);\n\t\tthis._setValueFromTextBuffer(textBuffer, disposable);\n\t}\n\n\tprivate _createContentChanged2(range: Range, rangeOffset: number, rangeLength: number, text: string, isUndoing: boolean, isRedoing: boolean, isFlush: boolean): IModelContentChangedEvent {\n\t\treturn {\n\t\t\tchanges: [{\n\t\t\t\trange: range,\n\t\t\t\trangeOffset: rangeOffset,\n\t\t\t\trangeLength: rangeLength,\n\t\t\t\ttext: text,\n\t\t\t}],\n\t\t\teol: this._buffer.getEOL(),\n\t\t\tversionId: this.getVersionId(),\n\t\t\tisUndoing: isUndoing,\n\t\t\tisRedoing: isRedoing,\n\t\t\tisFlush: isFlush\n\t\t};\n\t}\n\n\tprivate _setValueFromTextBuffer(textBuffer: model.ITextBuffer, textBufferDisposable: IDisposable): void {\n\t\tthis._assertNotDisposed();\n\t\tconst oldFullModelRange = this.getFullModelRange();\n\t\tconst oldModelValueLength = this.getValueLengthInRange(oldFullModelRange);\n\t\tconst endLineNumber = this.getLineCount();\n\t\tconst endColumn = this.getLineMaxColumn(endLineNumber);\n\n\t\tthis._buffer = textBuffer;\n\t\tthis._bufferDisposable.dispose();\n\t\tthis._bufferDisposable = textBufferDisposable;\n\t\tthis._increaseVersionId();\n\n\t\t// Flush all tokens\n\t\tthis._tokens.flush();\n\t\tthis._semanticTokens.flush();\n\n\t\t// Destroy all my decorations\n\t\tthis._decorations = Object.create(null);\n\t\tthis._decorationsTree = new DecorationsTrees();\n\n\t\t// Destroy my edit history and settings\n\t\tthis._commandManager.clear();\n\t\tthis._trimAutoWhitespaceLines = null;\n\n\t\tthis._emitContentChangedEvent(\n\t\t\tnew ModelRawContentChangedEvent(\n\t\t\t\t[\n\t\t\t\t\tnew ModelRawFlush()\n\t\t\t\t],\n\t\t\t\tthis._versionId,\n\t\t\t\tfalse,\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tthis._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, this.getValue(), false, false, true)\n\t\t);\n\t}\n\n\tpublic setEOL(eol: model.EndOfLineSequence): void {\n\t\tthis._assertNotDisposed();\n\t\tconst newEOL = (eol === model.EndOfLineSequence.CRLF ? '\\r\\n' : '\\n');\n\t\tif (this._buffer.getEOL() === newEOL) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldFullModelRange = this.getFullModelRange();\n\t\tconst oldModelValueLength = this.getValueLengthInRange(oldFullModelRange);\n\t\tconst endLineNumber = this.getLineCount();\n\t\tconst endColumn = this.getLineMaxColumn(endLineNumber);\n\n\t\tthis._onBeforeEOLChange();\n\t\tthis._buffer.setEOL(newEOL);\n\t\tthis._increaseVersionId();\n\t\tthis._onAfterEOLChange();\n\n\t\tthis._emitContentChangedEvent(\n\t\t\tnew ModelRawContentChangedEvent(\n\t\t\t\t[\n\t\t\t\t\tnew ModelRawEOLChanged()\n\t\t\t\t],\n\t\t\t\tthis._versionId,\n\t\t\t\tfalse,\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tthis._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, this.getValue(), false, false, false)\n\t\t);\n\t}\n\n\tprivate _onBeforeEOLChange(): void {\n\t\t// Ensure all decorations get their `range` set.\n\t\tthis._decorationsTree.ensureAllNodesHaveRanges(this);\n\t}\n\n\tprivate _onAfterEOLChange(): void {\n\t\t// Transform back `range` to offsets\n\t\tconst versionId = this.getVersionId();\n\t\tconst allDecorations = this._decorationsTree.collectNodesPostOrder();\n\t\tfor (let i = 0, len = allDecorations.length; i < len; i++) {\n\t\t\tconst node = allDecorations[i];\n\t\t\tconst range = node.range!; // the range is defined due to `_onBeforeEOLChange`\n\n\t\t\tconst delta = node.cachedAbsoluteStart - node.start;\n\n\t\t\tconst startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\t\tconst endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn);\n\n\t\t\tnode.cachedAbsoluteStart = startOffset;\n\t\t\tnode.cachedAbsoluteEnd = endOffset;\n\t\t\tnode.cachedVersionId = versionId;\n\n\t\t\tnode.start = startOffset - delta;\n\t\t\tnode.end = endOffset - delta;\n\n\t\t\trecomputeMaxEnd(node);\n\t\t}\n\t}\n\n\tpublic onBeforeAttached(): void {\n\t\tthis._attachedEditorCount++;\n\t\tif (this._attachedEditorCount === 1) {\n\t\t\tthis._tokenization.handleDidChangeAttached();\n\t\t\tthis._onDidChangeAttached.fire(undefined);\n\t\t}\n\t}\n\n\tpublic onBeforeDetached(): void {\n\t\tthis._attachedEditorCount--;\n\t\tif (this._attachedEditorCount === 0) {\n\t\t\tthis._tokenization.handleDidChangeAttached();\n\t\t\tthis._onDidChangeAttached.fire(undefined);\n\t\t}\n\t}\n\n\tpublic isAttachedToEditor(): boolean {\n\t\treturn this._attachedEditorCount > 0;\n\t}\n\n\tpublic getAttachedEditorCount(): number {\n\t\treturn this._attachedEditorCount;\n\t}\n\n\tpublic isTooLargeForSyncing(): boolean {\n\t\treturn this._isTooLargeForSyncing;\n\t}\n\n\tpublic isTooLargeForTokenization(): boolean {\n\t\treturn this._isTooLargeForTokenization;\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\tpublic isDominatedByLongLines(): boolean {\n\t\tthis._assertNotDisposed();\n\t\tif (this.isTooLargeForTokenization()) {\n\t\t\t// Cannot word wrap huge files anyways, so it doesn't really matter\n\t\t\treturn false;\n\t\t}\n\t\tlet smallLineCharCount = 0;\n\t\tlet longLineCharCount = 0;\n\n\t\tconst lineCount = this._buffer.getLineCount();\n\t\tfor (let lineNumber = 1; lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineLength = this._buffer.getLineLength(lineNumber);\n\t\t\tif (lineLength >= LONG_LINE_BOUNDARY) {\n\t\t\t\tlongLineCharCount += lineLength;\n\t\t\t} else {\n\t\t\t\tsmallLineCharCount += lineLength;\n\t\t\t}\n\t\t}\n\n\t\treturn (longLineCharCount > smallLineCharCount);\n\t}\n\n\tpublic get uri(): URI {\n\t\treturn this._associatedResource;\n\t}\n\n\t//#region Options\n\n\tpublic getOptions(): model.TextModelResolvedOptions {\n\t\tthis._assertNotDisposed();\n\t\treturn this._options;\n\t}\n\n\tpublic getFormattingOptions(): FormattingOptions {\n\t\treturn {\n\t\t\ttabSize: this._options.indentSize,\n\t\t\tinsertSpaces: this._options.insertSpaces\n\t\t};\n\t}\n\n\tpublic updateOptions(_newOpts: model.ITextModelUpdateOptions): void {\n\t\tthis._assertNotDisposed();\n\t\tconst tabSize = (typeof _newOpts.tabSize !== 'undefined') ? _newOpts.tabSize : this._options.tabSize;\n\t\tconst indentSize = (typeof _newOpts.indentSize !== 'undefined') ? _newOpts.indentSize : this._options.indentSize;\n\t\tconst insertSpaces = (typeof _newOpts.insertSpaces !== 'undefined') ? _newOpts.insertSpaces : this._options.insertSpaces;\n\t\tconst trimAutoWhitespace = (typeof _newOpts.trimAutoWhitespace !== 'undefined') ? _newOpts.trimAutoWhitespace : this._options.trimAutoWhitespace;\n\t\tconst bracketPairColorizationOptions = (typeof _newOpts.bracketColorizationOptions !== 'undefined') ? _newOpts.bracketColorizationOptions : this._options.bracketPairColorizationOptions;\n\n\t\tconst newOpts = new model.TextModelResolvedOptions({\n\t\t\ttabSize: tabSize,\n\t\t\tindentSize: indentSize,\n\t\t\tinsertSpaces: insertSpaces,\n\t\t\tdefaultEOL: this._options.defaultEOL,\n\t\t\ttrimAutoWhitespace: trimAutoWhitespace,\n\t\t\tbracketPairColorizationOptions,\n\t\t});\n\n\t\tif (this._options.equals(newOpts)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst e = this._options.createChangeEvent(newOpts);\n\t\tthis._options = newOpts;\n\n\t\tthis._bracketPairColorizer.handleDidChangeOptions(e);\n\t\tthis._decorationProvider.handleDidChangeOptions(e);\n\t\tthis._onDidChangeOptions.fire(e);\n\t}\n\n\tpublic detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void {\n\t\tthis._assertNotDisposed();\n\t\tconst guessedIndentation = guessIndentation(this._buffer, defaultTabSize, defaultInsertSpaces);\n\t\tthis.updateOptions({\n\t\t\tinsertSpaces: guessedIndentation.insertSpaces,\n\t\t\ttabSize: guessedIndentation.tabSize,\n\t\t\tindentSize: guessedIndentation.tabSize, // TODO@Alex: guess indentSize independent of tabSize\n\t\t});\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\tthis._assertNotDisposed();\n\t\treturn normalizeIndentation(str, this._options.indentSize, this._options.insertSpaces);\n\t}\n\n\t//#endregion\n\n\t//#region Reading\n\n\tpublic getVersionId(): number {\n\t\tthis._assertNotDisposed();\n\t\treturn this._versionId;\n\t}\n\n\tpublic mightContainRTL(): boolean {\n\t\treturn this._buffer.mightContainRTL();\n\t}\n\n\tpublic mightContainUnusualLineTerminators(): boolean {\n\t\treturn this._buffer.mightContainUnusualLineTerminators();\n\t}\n\n\tpublic removeUnusualLineTerminators(selections: Selection[] | null = null): void {\n\t\tconst matches = this.findMatches(strings.UNUSUAL_LINE_TERMINATORS.source, false, true, false, null, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tthis._buffer.resetMightContainUnusualLineTerminators();\n\t\tthis.pushEditOperations(selections, matches.map(m => ({ range: m.range, text: null })), () => null);\n\t}\n\n\tpublic mightContainNonBasicASCII(): boolean {\n\t\treturn this._buffer.mightContainNonBasicASCII();\n\t}\n\n\tpublic getAlternativeVersionId(): number {\n\t\tthis._assertNotDisposed();\n\t\treturn this._alternativeVersionId;\n\t}\n\n\tpublic getInitialUndoRedoSnapshot(): ResourceEditStackSnapshot | null {\n\t\tthis._assertNotDisposed();\n\t\treturn this._initialUndoRedoSnapshot;\n\t}\n\n\tpublic getOffsetAt(rawPosition: IPosition): number {\n\t\tthis._assertNotDisposed();\n\t\tconst position = this._validatePosition(rawPosition.lineNumber, rawPosition.column, StringOffsetValidationType.Relaxed);\n\t\treturn this._buffer.getOffsetAt(position.lineNumber, position.column);\n\t}\n\n\tpublic getPositionAt(rawOffset: number): Position {\n\t\tthis._assertNotDisposed();\n\t\tconst offset = (Math.min(this._buffer.getLength(), Math.max(0, rawOffset)));\n\t\treturn this._buffer.getPositionAt(offset);\n\t}\n\n\tprivate _increaseVersionId(): void {\n\t\tthis._versionId = this._versionId + 1;\n\t\tthis._alternativeVersionId = this._versionId;\n\t}\n\n\tpublic _overwriteVersionId(versionId: number): void {\n\t\tthis._versionId = versionId;\n\t}\n\n\tpublic _overwriteAlternativeVersionId(newAlternativeVersionId: number): void {\n\t\tthis._alternativeVersionId = newAlternativeVersionId;\n\t}\n\n\tpublic _overwriteInitialUndoRedoSnapshot(newInitialUndoRedoSnapshot: ResourceEditStackSnapshot | null): void {\n\t\tthis._initialUndoRedoSnapshot = newInitialUndoRedoSnapshot;\n\t}\n\n\tpublic getValue(eol?: model.EndOfLinePreference, preserveBOM: boolean = false): string {\n\t\tthis._assertNotDisposed();\n\t\tconst fullModelRange = this.getFullModelRange();\n\t\tconst fullModelValue = this.getValueInRange(fullModelRange, eol);\n\n\t\tif (preserveBOM) {\n\t\t\treturn this._buffer.getBOM() + fullModelValue;\n\t\t}\n\n\t\treturn fullModelValue;\n\t}\n\n\tpublic createSnapshot(preserveBOM: boolean = false): model.ITextSnapshot {\n\t\treturn new TextModelSnapshot(this._buffer.createSnapshot(preserveBOM));\n\t}\n\n\tpublic getValueLength(eol?: model.EndOfLinePreference, preserveBOM: boolean = false): number {\n\t\tthis._assertNotDisposed();\n\t\tconst fullModelRange = this.getFullModelRange();\n\t\tconst fullModelValue = this.getValueLengthInRange(fullModelRange, eol);\n\n\t\tif (preserveBOM) {\n\t\t\treturn this._buffer.getBOM().length + fullModelValue;\n\t\t}\n\n\t\treturn fullModelValue;\n\t}\n\n\tpublic getValueInRange(rawRange: IRange, eol: model.EndOfLinePreference = model.EndOfLinePreference.TextDefined): string {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getValueInRange(this.validateRange(rawRange), eol);\n\t}\n\n\tpublic getValueLengthInRange(rawRange: IRange, eol: model.EndOfLinePreference = model.EndOfLinePreference.TextDefined): number {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getValueLengthInRange(this.validateRange(rawRange), eol);\n\t}\n\n\tpublic getCharacterCountInRange(rawRange: IRange, eol: model.EndOfLinePreference = model.EndOfLinePreference.TextDefined): number {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getCharacterCountInRange(this.validateRange(rawRange), eol);\n\t}\n\n\tpublic getLineCount(): number {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getLineCount();\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\tthis._assertNotDisposed();\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\n\t\treturn this._buffer.getLineContent(lineNumber);\n\t}\n\n\tpublic getLineLength(lineNumber: number): number {\n\t\tthis._assertNotDisposed();\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\n\t\treturn this._buffer.getLineLength(lineNumber);\n\t}\n\n\tpublic getLinesContent(): string[] {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getLinesContent();\n\t}\n\n\tpublic getEOL(): string {\n\t\tthis._assertNotDisposed();\n\t\treturn this._buffer.getEOL();\n\t}\n\n\tpublic getEndOfLineSequence(): model.EndOfLineSequence {\n\t\tthis._assertNotDisposed();\n\t\treturn (\n\t\t\tthis._buffer.getEOL() === '\\n'\n\t\t\t\t? model.EndOfLineSequence.LF\n\t\t\t\t: model.EndOfLineSequence.CRLF\n\t\t);\n\t}\n\n\tpublic getLineMinColumn(lineNumber: number): number {\n\t\tthis._assertNotDisposed();\n\t\treturn 1;\n\t}\n\n\tpublic getLineMaxColumn(lineNumber: number): number {\n\t\tthis._assertNotDisposed();\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\t\treturn this._buffer.getLineLength(lineNumber) + 1;\n\t}\n\n\tpublic getLineFirstNonWhitespaceColumn(lineNumber: number): number {\n\t\tthis._assertNotDisposed();\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\t\treturn this._buffer.getLineFirstNonWhitespaceColumn(lineNumber);\n\t}\n\n\tpublic getLineLastNonWhitespaceColumn(lineNumber: number): number {\n\t\tthis._assertNotDisposed();\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\t\treturn this._buffer.getLineLastNonWhitespaceColumn(lineNumber);\n\t}\n\n\t/**\n\t * Validates `range` is within buffer bounds, but allows it to sit in between surrogate pairs, etc.\n\t * Will try to not allocate if possible.\n\t */\n\tpublic _validateRangeRelaxedNoAllocations(range: IRange): Range {\n\t\tconst linesCount = this._buffer.getLineCount();\n\n\t\tconst initialStartLineNumber = range.startLineNumber;\n\t\tconst initialStartColumn = range.startColumn;\n\t\tlet startLineNumber = Math.floor((typeof initialStartLineNumber === 'number' && !isNaN(initialStartLineNumber)) ? initialStartLineNumber : 1);\n\t\tlet startColumn = Math.floor((typeof initialStartColumn === 'number' && !isNaN(initialStartColumn)) ? initialStartColumn : 1);\n\n\t\tif (startLineNumber < 1) {\n\t\t\tstartLineNumber = 1;\n\t\t\tstartColumn = 1;\n\t\t} else if (startLineNumber > linesCount) {\n\t\t\tstartLineNumber = linesCount;\n\t\t\tstartColumn = this.getLineMaxColumn(startLineNumber);\n\t\t} else {\n\t\t\tif (startColumn <= 1) {\n\t\t\t\tstartColumn = 1;\n\t\t\t} else {\n\t\t\t\tconst maxColumn = this.getLineMaxColumn(startLineNumber);\n\t\t\t\tif (startColumn >= maxColumn) {\n\t\t\t\t\tstartColumn = maxColumn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst initialEndLineNumber = range.endLineNumber;\n\t\tconst initialEndColumn = range.endColumn;\n\t\tlet endLineNumber = Math.floor((typeof initialEndLineNumber === 'number' && !isNaN(initialEndLineNumber)) ? initialEndLineNumber : 1);\n\t\tlet endColumn = Math.floor((typeof initialEndColumn === 'number' && !isNaN(initialEndColumn)) ? initialEndColumn : 1);\n\n\t\tif (endLineNumber < 1) {\n\t\t\tendLineNumber = 1;\n\t\t\tendColumn = 1;\n\t\t} else if (endLineNumber > linesCount) {\n\t\t\tendLineNumber = linesCount;\n\t\t\tendColumn = this.getLineMaxColumn(endLineNumber);\n\t\t} else {\n\t\t\tif (endColumn <= 1) {\n\t\t\t\tendColumn = 1;\n\t\t\t} else {\n\t\t\t\tconst maxColumn = this.getLineMaxColumn(endLineNumber);\n\t\t\t\tif (endColumn >= maxColumn) {\n\t\t\t\t\tendColumn = maxColumn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tinitialStartLineNumber === startLineNumber\n\t\t\t&& initialStartColumn === startColumn\n\t\t\t&& initialEndLineNumber === endLineNumber\n\t\t\t&& initialEndColumn === endColumn\n\t\t\t&& range instanceof Range\n\t\t\t&& !(range instanceof Selection)\n\t\t) {\n\t\t\treturn range;\n\t\t}\n\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t}\n\n\tprivate _isValidPosition(lineNumber: number, column: number, validationType: StringOffsetValidationType): boolean {\n\t\tif (typeof lineNumber !== 'number' || typeof column !== 'number') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isNaN(lineNumber) || isNaN(column)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (lineNumber < 1 || column < 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ((lineNumber | 0) !== lineNumber || (column | 0) !== column) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst lineCount = this._buffer.getLineCount();\n\t\tif (lineNumber > lineCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (column === 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst maxColumn = this.getLineMaxColumn(lineNumber);\n\t\tif (column > maxColumn) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (validationType === StringOffsetValidationType.SurrogatePairs) {\n\t\t\t// !!At this point, column > 1\n\t\t\tconst charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2);\n\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _validatePosition(_lineNumber: number, _column: number, validationType: StringOffsetValidationType): Position {\n\t\tconst lineNumber = Math.floor((typeof _lineNumber === 'number' && !isNaN(_lineNumber)) ? _lineNumber : 1);\n\t\tconst column = Math.floor((typeof _column === 'number' && !isNaN(_column)) ? _column : 1);\n\t\tconst lineCount = this._buffer.getLineCount();\n\n\t\tif (lineNumber < 1) {\n\t\t\treturn new Position(1, 1);\n\t\t}\n\n\t\tif (lineNumber > lineCount) {\n\t\t\treturn new Position(lineCount, this.getLineMaxColumn(lineCount));\n\t\t}\n\n\t\tif (column <= 1) {\n\t\t\treturn new Position(lineNumber, 1);\n\t\t}\n\n\t\tconst maxColumn = this.getLineMaxColumn(lineNumber);\n\t\tif (column >= maxColumn) {\n\t\t\treturn new Position(lineNumber, maxColumn);\n\t\t}\n\n\t\tif (validationType === StringOffsetValidationType.SurrogatePairs) {\n\t\t\t// If the position would end up in the middle of a high-low surrogate pair,\n\t\t\t// we move it to before the pair\n\t\t\t// !!At this point, column > 1\n\t\t\tconst charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2);\n\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\n\t\t\t\treturn new Position(lineNumber, column - 1);\n\t\t\t}\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tpublic validatePosition(position: IPosition): Position {\n\t\tconst validationType = StringOffsetValidationType.SurrogatePairs;\n\t\tthis._assertNotDisposed();\n\n\t\t// Avoid object allocation and cover most likely case\n\t\tif (position instanceof Position) {\n\t\t\tif (this._isValidPosition(position.lineNumber, position.column, validationType)) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn this._validatePosition(position.lineNumber, position.column, validationType);\n\t}\n\n\tprivate _isValidRange(range: Range, validationType: StringOffsetValidationType): boolean {\n\t\tconst startLineNumber = range.startLineNumber;\n\t\tconst startColumn = range.startColumn;\n\t\tconst endLineNumber = range.endLineNumber;\n\t\tconst endColumn = range.endColumn;\n\n\t\tif (!this._isValidPosition(startLineNumber, startColumn, StringOffsetValidationType.Relaxed)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this._isValidPosition(endLineNumber, endColumn, StringOffsetValidationType.Relaxed)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (validationType === StringOffsetValidationType.SurrogatePairs) {\n\t\t\tconst charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0);\n\t\t\tconst charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0);\n\n\t\t\tconst startInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeStart);\n\t\t\tconst endInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeEnd);\n\n\t\t\tif (!startInsideSurrogatePair && !endInsideSurrogatePair) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic validateRange(_range: IRange): Range {\n\t\tconst validationType = StringOffsetValidationType.SurrogatePairs;\n\t\tthis._assertNotDisposed();\n\n\t\t// Avoid object allocation and cover most likely case\n\t\tif ((_range instanceof Range) && !(_range instanceof Selection)) {\n\t\t\tif (this._isValidRange(_range, validationType)) {\n\t\t\t\treturn _range;\n\t\t\t}\n\t\t}\n\n\t\tconst start = this._validatePosition(_range.startLineNumber, _range.startColumn, StringOffsetValidationType.Relaxed);\n\t\tconst end = this._validatePosition(_range.endLineNumber, _range.endColumn, StringOffsetValidationType.Relaxed);\n\n\t\tconst startLineNumber = start.lineNumber;\n\t\tconst startColumn = start.column;\n\t\tconst endLineNumber = end.lineNumber;\n\t\tconst endColumn = end.column;\n\n\t\tif (validationType === StringOffsetValidationType.SurrogatePairs) {\n\t\t\tconst charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0);\n\t\t\tconst charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0);\n\n\t\t\tconst startInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeStart);\n\t\t\tconst endInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeEnd);\n\n\t\t\tif (!startInsideSurrogatePair && !endInsideSurrogatePair) {\n\t\t\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t\t\t}\n\n\t\t\tif (startLineNumber === endLineNumber && startColumn === endColumn) {\n\t\t\t\t// do not expand a collapsed range, simply move it to a valid location\n\t\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn - 1);\n\t\t\t}\n\n\t\t\tif (startInsideSurrogatePair && endInsideSurrogatePair) {\n\t\t\t\t// expand range at both ends\n\t\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn + 1);\n\t\t\t}\n\n\t\t\tif (startInsideSurrogatePair) {\n\t\t\t\t// only expand range at the start\n\t\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn);\n\t\t\t}\n\n\t\t\t// only expand range at the end\n\t\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn + 1);\n\t\t}\n\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t}\n\n\tpublic modifyPosition(rawPosition: IPosition, offset: number): Position {\n\t\tthis._assertNotDisposed();\n\t\tconst candidate = this.getOffsetAt(rawPosition) + offset;\n\t\treturn this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, candidate)));\n\t}\n\n\tpublic getFullModelRange(): Range {\n\t\tthis._assertNotDisposed();\n\t\tconst lineCount = this.getLineCount();\n\t\treturn new Range(1, 1, lineCount, this.getLineMaxColumn(lineCount));\n\t}\n\n\tprivate findMatchesLineByLine(searchRange: Range, searchData: model.SearchData, captureMatches: boolean, limitResultCount: number): model.FindMatch[] {\n\t\treturn this._buffer.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount);\n\t}\n\n\tpublic findMatches(searchString: string, rawSearchScope: any, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount: number = LIMIT_FIND_COUNT): model.FindMatch[] {\n\t\tthis._assertNotDisposed();\n\n\t\tlet searchRanges: Range[] | null = null;\n\n\t\tif (rawSearchScope !== null) {\n\t\t\tif (!Array.isArray(rawSearchScope)) {\n\t\t\t\trawSearchScope = [rawSearchScope];\n\t\t\t}\n\n\t\t\tif (rawSearchScope.every((searchScope: Range) => Range.isIRange(searchScope))) {\n\t\t\t\tsearchRanges = rawSearchScope.map((searchScope: Range) => this.validateRange(searchScope));\n\t\t\t}\n\t\t}\n\n\t\tif (searchRanges === null) {\n\t\t\tsearchRanges = [this.getFullModelRange()];\n\t\t}\n\n\t\tsearchRanges = searchRanges.sort((d1, d2) => d1.startLineNumber - d2.startLineNumber || d1.startColumn - d2.startColumn);\n\n\t\tconst uniqueSearchRanges: Range[] = [];\n\t\tuniqueSearchRanges.push(searchRanges.reduce((prev, curr) => {\n\t\t\tif (Range.areIntersecting(prev, curr)) {\n\t\t\t\treturn prev.plusRange(curr);\n\t\t\t}\n\n\t\t\tuniqueSearchRanges.push(prev);\n\t\t\treturn curr;\n\t\t}));\n\n\t\tlet matchMapper: (value: Range, index: number, array: Range[]) => model.FindMatch[];\n\t\tif (!isRegex && searchString.indexOf('\\n') < 0) {\n\t\t\t// not regex, not multi line\n\t\t\tconst searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators);\n\t\t\tconst searchData = searchParams.parseSearchRequest();\n\n\t\t\tif (!searchData) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tmatchMapper = (searchRange: Range) => this.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount);\n\t\t} else {\n\t\t\tmatchMapper = (searchRange: Range) => TextModelSearch.findMatches(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchRange, captureMatches, limitResultCount);\n\t\t}\n\n\t\treturn uniqueSearchRanges.map(matchMapper).reduce((arr, matches: model.FindMatch[]) => arr.concat(matches), []);\n\t}\n\n\tpublic findNextMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): model.FindMatch | null {\n\t\tthis._assertNotDisposed();\n\t\tconst searchStart = this.validatePosition(rawSearchStart);\n\n\t\tif (!isRegex && searchString.indexOf('\\n') < 0) {\n\t\t\tconst searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators);\n\t\t\tconst searchData = searchParams.parseSearchRequest();\n\t\t\tif (!searchData) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst lineCount = this.getLineCount();\n\t\t\tlet searchRange = new Range(searchStart.lineNumber, searchStart.column, lineCount, this.getLineMaxColumn(lineCount));\n\t\t\tlet ret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1);\n\t\t\tTextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches);\n\t\t\tif (ret.length > 0) {\n\t\t\t\treturn ret[0];\n\t\t\t}\n\n\t\t\tsearchRange = new Range(1, 1, searchStart.lineNumber, this.getLineMaxColumn(searchStart.lineNumber));\n\t\t\tret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1);\n\n\t\t\tif (ret.length > 0) {\n\t\t\t\treturn ret[0];\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn TextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches);\n\t}\n\n\tpublic findPreviousMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): model.FindMatch | null {\n\t\tthis._assertNotDisposed();\n\t\tconst searchStart = this.validatePosition(rawSearchStart);\n\t\treturn TextModelSearch.findPreviousMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches);\n\t}\n\n\t//#endregion\n\n\t//#region Editing\n\n\tpublic pushStackElement(): void {\n\t\tthis._commandManager.pushStackElement();\n\t}\n\n\tpublic popStackElement(): void {\n\t\tthis._commandManager.popStackElement();\n\t}\n\n\tpublic pushEOL(eol: model.EndOfLineSequence): void {\n\t\tconst currentEOL = (this.getEOL() === '\\n' ? model.EndOfLineSequence.LF : model.EndOfLineSequence.CRLF);\n\t\tif (currentEOL === eol) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\tif (this._initialUndoRedoSnapshot === null) {\n\t\t\t\tthis._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri);\n\t\t\t}\n\t\t\tthis._commandManager.pushEOL(eol);\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tprivate _validateEditOperation(rawOperation: model.IIdentifiedSingleEditOperation): model.ValidAnnotatedEditOperation {\n\t\tif (rawOperation instanceof model.ValidAnnotatedEditOperation) {\n\t\t\treturn rawOperation;\n\t\t}\n\t\treturn new model.ValidAnnotatedEditOperation(\n\t\t\trawOperation.identifier || null,\n\t\t\tthis.validateRange(rawOperation.range),\n\t\t\trawOperation.text,\n\t\t\trawOperation.forceMoveMarkers || false,\n\t\t\trawOperation.isAutoWhitespaceEdit || false,\n\t\t\trawOperation._isTracked || false\n\t\t);\n\t}\n\n\tprivate _validateEditOperations(rawOperations: model.IIdentifiedSingleEditOperation[]): model.ValidAnnotatedEditOperation[] {\n\t\tconst result: model.ValidAnnotatedEditOperation[] = [];\n\t\tfor (let i = 0, len = rawOperations.length; i < len; i++) {\n\t\t\tresult[i] = this._validateEditOperation(rawOperations[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic pushEditOperations(beforeCursorState: Selection[] | null, editOperations: model.IIdentifiedSingleEditOperation[], cursorStateComputer: model.ICursorStateComputer | null): Selection[] | null {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\treturn this._pushEditOperations(beforeCursorState, this._validateEditOperations(editOperations), cursorStateComputer);\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tprivate _pushEditOperations(beforeCursorState: Selection[] | null, editOperations: model.ValidAnnotatedEditOperation[], cursorStateComputer: model.ICursorStateComputer | null): Selection[] | null {\n\t\tif (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) {\n\t\t\t// Go through each saved line number and insert a trim whitespace edit\n\t\t\t// if it is safe to do so (no conflicts with other edits).\n\n\t\t\tconst incomingEdits = editOperations.map((op) => {\n\t\t\t\treturn {\n\t\t\t\t\trange: this.validateRange(op.range),\n\t\t\t\t\ttext: op.text\n\t\t\t\t};\n\t\t\t});\n\n\t\t\t// Sometimes, auto-formatters change ranges automatically which can cause undesired auto whitespace trimming near the cursor\n\t\t\t// We'll use the following heuristic: if the edits occur near the cursor, then it's ok to trim auto whitespace\n\t\t\tlet editsAreNearCursors = true;\n\t\t\tif (beforeCursorState) {\n\t\t\t\tfor (let i = 0, len = beforeCursorState.length; i < len; i++) {\n\t\t\t\t\tconst sel = beforeCursorState[i];\n\t\t\t\t\tlet foundEditNearSel = false;\n\t\t\t\t\tfor (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) {\n\t\t\t\t\t\tconst editRange = incomingEdits[j].range;\n\t\t\t\t\t\tconst selIsAbove = editRange.startLineNumber > sel.endLineNumber;\n\t\t\t\t\t\tconst selIsBelow = sel.startLineNumber > editRange.endLineNumber;\n\t\t\t\t\t\tif (!selIsAbove && !selIsBelow) {\n\t\t\t\t\t\t\tfoundEditNearSel = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!foundEditNearSel) {\n\t\t\t\t\t\teditsAreNearCursors = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (editsAreNearCursors) {\n\t\t\t\tfor (let i = 0, len = this._trimAutoWhitespaceLines.length; i < len; i++) {\n\t\t\t\t\tconst trimLineNumber = this._trimAutoWhitespaceLines[i];\n\t\t\t\t\tconst maxLineColumn = this.getLineMaxColumn(trimLineNumber);\n\n\t\t\t\t\tlet allowTrimLine = true;\n\t\t\t\t\tfor (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) {\n\t\t\t\t\t\tconst editRange = incomingEdits[j].range;\n\t\t\t\t\t\tconst editText = incomingEdits[j].text;\n\n\t\t\t\t\t\tif (trimLineNumber < editRange.startLineNumber || trimLineNumber > editRange.endLineNumber) {\n\t\t\t\t\t\t\t// `trimLine` is completely outside this edit\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// At this point:\n\t\t\t\t\t\t// editRange.startLineNumber <= trimLine <= editRange.endLineNumber\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttrimLineNumber === editRange.startLineNumber && editRange.startColumn === maxLineColumn\n\t\t\t\t\t\t\t&& editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(0) === '\\n'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// This edit inserts a new line (and maybe other text) after `trimLine`\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttrimLineNumber === editRange.startLineNumber && editRange.startColumn === 1\n\t\t\t\t\t\t\t&& editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(editText.length - 1) === '\\n'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// This edit inserts a new line (and maybe other text) before `trimLine`\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Looks like we can't trim this line as it would interfere with an incoming edit\n\t\t\t\t\t\tallowTrimLine = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (allowTrimLine) {\n\t\t\t\t\t\tconst trimRange = new Range(trimLineNumber, 1, trimLineNumber, maxLineColumn);\n\t\t\t\t\t\teditOperations.push(new model.ValidAnnotatedEditOperation(null, trimRange, null, false, false, false));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._trimAutoWhitespaceLines = null;\n\t\t}\n\t\tif (this._initialUndoRedoSnapshot === null) {\n\t\t\tthis._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri);\n\t\t}\n\t\treturn this._commandManager.pushEditOperation(beforeCursorState, editOperations, cursorStateComputer);\n\t}\n\n\t_applyUndo(changes: TextChange[], eol: model.EndOfLineSequence, resultingAlternativeVersionId: number, resultingSelection: Selection[] | null): void {\n\t\tconst edits = changes.map<ISingleEditOperation>((change) => {\n\t\t\tconst rangeStart = this.getPositionAt(change.newPosition);\n\t\t\tconst rangeEnd = this.getPositionAt(change.newEnd);\n\t\t\treturn {\n\t\t\t\trange: new Range(rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column),\n\t\t\t\ttext: change.oldText\n\t\t\t};\n\t\t});\n\t\tthis._applyUndoRedoEdits(edits, eol, true, false, resultingAlternativeVersionId, resultingSelection);\n\t}\n\n\t_applyRedo(changes: TextChange[], eol: model.EndOfLineSequence, resultingAlternativeVersionId: number, resultingSelection: Selection[] | null): void {\n\t\tconst edits = changes.map<ISingleEditOperation>((change) => {\n\t\t\tconst rangeStart = this.getPositionAt(change.oldPosition);\n\t\t\tconst rangeEnd = this.getPositionAt(change.oldEnd);\n\t\t\treturn {\n\t\t\t\trange: new Range(rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column),\n\t\t\t\ttext: change.newText\n\t\t\t};\n\t\t});\n\t\tthis._applyUndoRedoEdits(edits, eol, false, true, resultingAlternativeVersionId, resultingSelection);\n\t}\n\n\tprivate _applyUndoRedoEdits(edits: ISingleEditOperation[], eol: model.EndOfLineSequence, isUndoing: boolean, isRedoing: boolean, resultingAlternativeVersionId: number, resultingSelection: Selection[] | null): void {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\tthis._isUndoing = isUndoing;\n\t\t\tthis._isRedoing = isRedoing;\n\t\t\tthis.applyEdits(edits, false);\n\t\t\tthis.setEOL(eol);\n\t\t\tthis._overwriteAlternativeVersionId(resultingAlternativeVersionId);\n\t\t} finally {\n\t\t\tthis._isUndoing = false;\n\t\t\tthis._isRedoing = false;\n\t\t\tthis._eventEmitter.endDeferredEmit(resultingSelection);\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tpublic applyEdits(operations: model.IIdentifiedSingleEditOperation[]): void;\n\tpublic applyEdits(operations: model.IIdentifiedSingleEditOperation[], computeUndoEdits: false): void;\n\tpublic applyEdits(operations: model.IIdentifiedSingleEditOperation[], computeUndoEdits: true): model.IValidEditOperation[];\n\tpublic applyEdits(rawOperations: model.IIdentifiedSingleEditOperation[], computeUndoEdits: boolean = false): void | model.IValidEditOperation[] {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\tconst operations = this._validateEditOperations(rawOperations);\n\t\t\treturn this._doApplyEdits(operations, computeUndoEdits);\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tprivate _doApplyEdits(rawOperations: model.ValidAnnotatedEditOperation[], computeUndoEdits: boolean): void | model.IValidEditOperation[] {\n\n\t\tconst oldLineCount = this._buffer.getLineCount();\n\t\tconst result = this._buffer.applyEdits(rawOperations, this._options.trimAutoWhitespace, computeUndoEdits);\n\t\tconst newLineCount = this._buffer.getLineCount();\n\n\t\tconst contentChanges = result.changes;\n\t\tthis._trimAutoWhitespaceLines = result.trimAutoWhitespaceLineNumbers;\n\n\t\tif (contentChanges.length !== 0) {\n\t\t\t// We do a first pass to update tokens and decorations\n\t\t\t// because we want to read decorations in the second pass\n\t\t\t// where we will emit content change events\n\t\t\t// and we want to read the final decorations\n\t\t\tfor (let i = 0, len = contentChanges.length; i < len; i++) {\n\t\t\t\tconst change = contentChanges[i];\n\t\t\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(change.text);\n\t\t\t\tthis._tokens.acceptEdit(change.range, eolCount, firstLineLength);\n\t\t\t\tthis._semanticTokens.acceptEdit(change.range, eolCount, firstLineLength, lastLineLength, change.text.length > 0 ? change.text.charCodeAt(0) : CharCode.Null);\n\t\t\t\tthis._decorationsTree.acceptReplace(change.rangeOffset, change.rangeLength, change.text.length, change.forceMoveMarkers);\n\t\t\t}\n\n\t\t\tconst rawContentChanges: ModelRawChange[] = [];\n\n\t\t\tthis._increaseVersionId();\n\n\t\t\tlet lineCount = oldLineCount;\n\t\t\tfor (let i = 0, len = contentChanges.length; i < len; i++) {\n\t\t\t\tconst change = contentChanges[i];\n\t\t\t\tconst [eolCount] = countEOL(change.text);\n\t\t\t\tthis._onDidChangeDecorations.fire();\n\n\t\t\t\tconst startLineNumber = change.range.startLineNumber;\n\t\t\t\tconst endLineNumber = change.range.endLineNumber;\n\n\t\t\t\tconst deletingLinesCnt = endLineNumber - startLineNumber;\n\t\t\t\tconst insertingLinesCnt = eolCount;\n\t\t\t\tconst editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt);\n\n\t\t\t\tconst changeLineCountDelta = (insertingLinesCnt - deletingLinesCnt);\n\n\t\t\t\tconst currentEditStartLineNumber = newLineCount - lineCount - changeLineCountDelta + startLineNumber;\n\t\t\t\tconst firstEditLineNumber = currentEditStartLineNumber;\n\t\t\t\tconst lastInsertedLineNumber = currentEditStartLineNumber + insertingLinesCnt;\n\n\t\t\t\tconst decorationsWithInjectedTextInEditedRange = this._decorationsTree.getInjectedTextInInterval(\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.getOffsetAt(new Position(firstEditLineNumber, 1)),\n\t\t\t\t\tthis.getOffsetAt(new Position(lastInsertedLineNumber, this.getLineMaxColumn(lastInsertedLineNumber))),\n\t\t\t\t\t0\n\t\t\t\t);\n\n\n\t\t\t\tconst injectedTextInEditedRange = LineInjectedText.fromDecorations(decorationsWithInjectedTextInEditedRange);\n\t\t\t\tconst injectedTextInEditedRangeQueue = new ArrayQueue(injectedTextInEditedRange);\n\n\t\t\t\tfor (let j = editingLinesCnt; j >= 0; j--) {\n\t\t\t\t\tconst editLineNumber = startLineNumber + j;\n\t\t\t\t\tconst currentEditLineNumber = currentEditStartLineNumber + j;\n\n\t\t\t\t\tinjectedTextInEditedRangeQueue.takeFromEndWhile(r => r.lineNumber > currentEditLineNumber);\n\t\t\t\t\tconst decorationsInCurrentLine = injectedTextInEditedRangeQueue.takeFromEndWhile(r => r.lineNumber === currentEditLineNumber);\n\n\t\t\t\t\trawContentChanges.push(\n\t\t\t\t\t\tnew ModelRawLineChanged(\n\t\t\t\t\t\t\teditLineNumber,\n\t\t\t\t\t\t\tthis.getLineContent(currentEditLineNumber),\n\t\t\t\t\t\t\tdecorationsInCurrentLine\n\t\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\tif (editingLinesCnt < deletingLinesCnt) {\n\t\t\t\t\t// Must delete some lines\n\t\t\t\t\tconst spliceStartLineNumber = startLineNumber + editingLinesCnt;\n\t\t\t\t\trawContentChanges.push(new ModelRawLinesDeleted(spliceStartLineNumber + 1, endLineNumber));\n\t\t\t\t}\n\n\t\t\t\tif (editingLinesCnt < insertingLinesCnt) {\n\t\t\t\t\tconst injectedTextInEditedRangeQueue = new ArrayQueue(injectedTextInEditedRange);\n\t\t\t\t\t// Must insert some lines\n\t\t\t\t\tconst spliceLineNumber = startLineNumber + editingLinesCnt;\n\t\t\t\t\tconst cnt = insertingLinesCnt - editingLinesCnt;\n\t\t\t\t\tconst fromLineNumber = newLineCount - lineCount - cnt + spliceLineNumber + 1;\n\t\t\t\t\tconst injectedTexts: (LineInjectedText[] | null)[] = [];\n\t\t\t\t\tconst newLines: string[] = [];\n\t\t\t\t\tfor (let i = 0; i < cnt; i++) {\n\t\t\t\t\t\tconst lineNumber = fromLineNumber + i;\n\t\t\t\t\t\tnewLines[i] = this.getLineContent(lineNumber);\n\n\t\t\t\t\t\tinjectedTextInEditedRangeQueue.takeWhile(r => r.lineNumber < lineNumber);\n\t\t\t\t\t\tinjectedTexts[i] = injectedTextInEditedRangeQueue.takeWhile(r => r.lineNumber === lineNumber);\n\t\t\t\t\t}\n\n\t\t\t\t\trawContentChanges.push(\n\t\t\t\t\t\tnew ModelRawLinesInserted(\n\t\t\t\t\t\t\tspliceLineNumber + 1,\n\t\t\t\t\t\t\tstartLineNumber + insertingLinesCnt,\n\t\t\t\t\t\t\tnewLines,\n\t\t\t\t\t\t\tinjectedTexts\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlineCount += changeLineCountDelta;\n\t\t\t}\n\n\t\t\tthis._emitContentChangedEvent(\n\t\t\t\tnew ModelRawContentChangedEvent(\n\t\t\t\t\trawContentChanges,\n\t\t\t\t\tthis.getVersionId(),\n\t\t\t\t\tthis._isUndoing,\n\t\t\t\t\tthis._isRedoing\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tchanges: contentChanges,\n\t\t\t\t\teol: this._buffer.getEOL(),\n\t\t\t\t\tversionId: this.getVersionId(),\n\t\t\t\t\tisUndoing: this._isUndoing,\n\t\t\t\t\tisRedoing: this._isRedoing,\n\t\t\t\t\tisFlush: false\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn (result.reverseEdits === null ? undefined : result.reverseEdits);\n\t}\n\n\tpublic undo(): void | Promise<void> {\n\t\treturn this._undoRedoService.undo(this.uri);\n\t}\n\n\tpublic canUndo(): boolean {\n\t\treturn this._undoRedoService.canUndo(this.uri);\n\t}\n\n\tpublic redo(): void | Promise<void> {\n\t\treturn this._undoRedoService.redo(this.uri);\n\t}\n\n\tpublic canRedo(): boolean {\n\t\treturn this._undoRedoService.canRedo(this.uri);\n\t}\n\n\t//#endregion\n\n\t//#region Decorations\n\n\tprivate handleBeforeFireDecorationsChangedEvent(affectedInjectedTextLines: Set<number> | null): void {\n\t\t// This is called before the decoration changed event is fired.\n\n\t\tif (affectedInjectedTextLines === null || affectedInjectedTextLines.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst affectedLines = [...affectedInjectedTextLines];\n\t\tconst lineChangeEvents = affectedLines.map(lineNumber => new ModelRawLineChanged(lineNumber, this.getLineContent(lineNumber), this._getInjectedTextInLine(lineNumber)));\n\n\t\tthis._onDidChangeInjectedText.fire(new ModelInjectedTextChangedEvent(lineChangeEvents));\n\t}\n\n\tpublic changeDecorations<T>(callback: (changeAccessor: model.IModelDecorationsChangeAccessor) => T, ownerId: number = 0): T | null {\n\t\tthis._assertNotDisposed();\n\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\treturn this._changeDecorations(ownerId, callback);\n\t\t} finally {\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tprivate _changeDecorations<T>(ownerId: number, callback: (changeAccessor: model.IModelDecorationsChangeAccessor) => T): T | null {\n\t\tconst changeAccessor: model.IModelDecorationsChangeAccessor = {\n\t\t\taddDecoration: (range: IRange, options: model.IModelDecorationOptions): string => {\n\t\t\t\treturn this._deltaDecorationsImpl(ownerId, [], [{ range: range, options: options }])[0];\n\t\t\t},\n\t\t\tchangeDecoration: (id: string, newRange: IRange): void => {\n\t\t\t\tthis._changeDecorationImpl(id, newRange);\n\t\t\t},\n\t\t\tchangeDecorationOptions: (id: string, options: model.IModelDecorationOptions) => {\n\t\t\t\tthis._changeDecorationOptionsImpl(id, _normalizeOptions(options));\n\t\t\t},\n\t\t\tremoveDecoration: (id: string): void => {\n\t\t\t\tthis._deltaDecorationsImpl(ownerId, [id], []);\n\t\t\t},\n\t\t\tdeltaDecorations: (oldDecorations: string[], newDecorations: model.IModelDeltaDecoration[]): string[] => {\n\t\t\t\tif (oldDecorations.length === 0 && newDecorations.length === 0) {\n\t\t\t\t\t// nothing to do\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn this._deltaDecorationsImpl(ownerId, oldDecorations, newDecorations);\n\t\t\t}\n\t\t};\n\t\tlet result: T | null = null;\n\t\ttry {\n\t\t\tresult = callback(changeAccessor);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t\t// Invalidate change accessor\n\t\tchangeAccessor.addDecoration = invalidFunc;\n\t\tchangeAccessor.changeDecoration = invalidFunc;\n\t\tchangeAccessor.changeDecorationOptions = invalidFunc;\n\t\tchangeAccessor.removeDecoration = invalidFunc;\n\t\tchangeAccessor.deltaDecorations = invalidFunc;\n\t\treturn result;\n\t}\n\n\tpublic deltaDecorations(oldDecorations: string[], newDecorations: model.IModelDeltaDecoration[], ownerId: number = 0): string[] {\n\t\tthis._assertNotDisposed();\n\t\tif (!oldDecorations) {\n\t\t\toldDecorations = [];\n\t\t}\n\t\tif (oldDecorations.length === 0 && newDecorations.length === 0) {\n\t\t\t// nothing to do\n\t\t\treturn [];\n\t\t}\n\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\treturn this._deltaDecorationsImpl(ownerId, oldDecorations, newDecorations);\n\t\t} finally {\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\t_getTrackedRange(id: string): Range | null {\n\t\treturn this.getDecorationRange(id);\n\t}\n\n\t_setTrackedRange(id: string | null, newRange: null, newStickiness: model.TrackedRangeStickiness): null;\n\t_setTrackedRange(id: string | null, newRange: Range, newStickiness: model.TrackedRangeStickiness): string;\n\t_setTrackedRange(id: string | null, newRange: Range | null, newStickiness: model.TrackedRangeStickiness): string | null {\n\t\tconst node = (id ? this._decorations[id] : null);\n\n\t\tif (!node) {\n\t\t\tif (!newRange) {\n\t\t\t\t// node doesn't exist, the request is to delete => nothing to do\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// node doesn't exist, the request is to set => add the tracked range\n\t\t\treturn this._deltaDecorationsImpl(0, [], [{ range: newRange, options: TRACKED_RANGE_OPTIONS[newStickiness] }])[0];\n\t\t}\n\n\t\tif (!newRange) {\n\t\t\t// node exists, the request is to delete => delete node\n\t\t\tthis._decorationsTree.delete(node);\n\t\t\tdelete this._decorations[node.id];\n\t\t\treturn null;\n\t\t}\n\n\t\t// node exists, the request is to set => change the tracked range and its options\n\t\tconst range = this._validateRangeRelaxedNoAllocations(newRange);\n\t\tconst startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\tconst endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn);\n\t\tthis._decorationsTree.delete(node);\n\t\tnode.reset(this.getVersionId(), startOffset, endOffset, range);\n\t\tnode.setOptions(TRACKED_RANGE_OPTIONS[newStickiness]);\n\t\tthis._decorationsTree.insert(node);\n\t\treturn node.id;\n\t}\n\n\tpublic removeAllDecorationsWithOwnerId(ownerId: number): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tconst nodes = this._decorationsTree.collectNodesFromOwner(ownerId);\n\t\tfor (let i = 0, len = nodes.length; i < len; i++) {\n\t\t\tconst node = nodes[i];\n\n\t\t\tthis._decorationsTree.delete(node);\n\t\t\tdelete this._decorations[node.id];\n\t\t}\n\t}\n\n\tpublic getDecorationOptions(decorationId: string): model.IModelDecorationOptions | null {\n\t\tconst node = this._decorations[decorationId];\n\t\tif (!node) {\n\t\t\treturn null;\n\t\t}\n\t\treturn node.options;\n\t}\n\n\tpublic getDecorationRange(decorationId: string): Range | null {\n\t\tconst node = this._decorations[decorationId];\n\t\tif (!node) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._decorationsTree.getNodeRange(this, node);\n\t}\n\n\tpublic getLineDecorations(lineNumber: number, ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this.getLinesDecorations(lineNumber, lineNumber, ownerId, filterOutValidation);\n\t}\n\n\tpublic getLinesDecorations(_startLineNumber: number, _endLineNumber: number, ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tconst lineCount = this.getLineCount();\n\t\tconst startLineNumber = Math.min(lineCount, Math.max(1, _startLineNumber));\n\t\tconst endLineNumber = Math.min(lineCount, Math.max(1, _endLineNumber));\n\t\tconst endColumn = this.getLineMaxColumn(endLineNumber);\n\t\tconst range = new Range(startLineNumber, 1, endLineNumber, endColumn);\n\n\t\tconst decorations = this._getDecorationsInRange(range, ownerId, filterOutValidation);\n\t\tdecorations.push(...this._decorationProvider.getDecorationsInRange(range, ownerId, filterOutValidation));\n\t\treturn decorations;\n\t}\n\n\tpublic getDecorationsInRange(range: IRange, ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tconst validatedRange = this.validateRange(range);\n\n\t\tconst decorations = this._getDecorationsInRange(validatedRange, ownerId, filterOutValidation);\n\t\tdecorations.push(...this._decorationProvider.getDecorationsInRange(validatedRange, ownerId, filterOutValidation));\n\t\treturn decorations;\n\t}\n\n\tpublic getOverviewRulerDecorations(ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\treturn this._decorationsTree.getAll(this, ownerId, filterOutValidation, true);\n\t}\n\n\tpublic getInjectedTextDecorations(ownerId: number = 0): model.IModelDecoration[] {\n\t\treturn this._decorationsTree.getAllInjectedText(this, ownerId);\n\t}\n\n\tprivate _getInjectedTextInLine(lineNumber: number): LineInjectedText[] {\n\t\tconst startOffset = this._buffer.getOffsetAt(lineNumber, 1);\n\t\tconst endOffset = startOffset + this._buffer.getLineLength(lineNumber);\n\n\t\tconst result = this._decorationsTree.getInjectedTextInInterval(this, startOffset, endOffset, 0);\n\t\treturn LineInjectedText.fromDecorations(result).filter(t => t.lineNumber === lineNumber);\n\t}\n\n\tpublic getAllDecorations(ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tlet result = this._decorationsTree.getAll(this, ownerId, filterOutValidation, false);\n\t\tresult = result.concat(this._decorationProvider.getAllDecorations(ownerId, filterOutValidation));\n\t\treturn result;\n\t}\n\n\tprivate _getDecorationsInRange(filterRange: Range, filterOwnerId: number, filterOutValidation: boolean): model.IModelDecoration[] {\n\t\tconst startOffset = this._buffer.getOffsetAt(filterRange.startLineNumber, filterRange.startColumn);\n\t\tconst endOffset = this._buffer.getOffsetAt(filterRange.endLineNumber, filterRange.endColumn);\n\t\treturn this._decorationsTree.getAllInInterval(this, startOffset, endOffset, filterOwnerId, filterOutValidation);\n\t}\n\n\tpublic getRangeAt(start: number, end: number): Range {\n\t\treturn this._buffer.getRangeAt(start, end - start);\n\t}\n\n\tprivate _changeDecorationImpl(decorationId: string, _range: IRange): void {\n\t\tconst node = this._decorations[decorationId];\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.options.after) {\n\t\t\tconst oldRange = this.getDecorationRange(decorationId);\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(oldRange!.endLineNumber);\n\t\t}\n\t\tif (node.options.before) {\n\t\t\tconst oldRange = this.getDecorationRange(decorationId);\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(oldRange!.startLineNumber);\n\t\t}\n\n\t\tconst range = this._validateRangeRelaxedNoAllocations(_range);\n\t\tconst startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\tconst endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn);\n\n\t\tthis._decorationsTree.delete(node);\n\t\tnode.reset(this.getVersionId(), startOffset, endOffset, range);\n\t\tthis._decorationsTree.insert(node);\n\t\tthis._onDidChangeDecorations.checkAffectedAndFire(node.options);\n\n\t\tif (node.options.after) {\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(range.endLineNumber);\n\t\t}\n\t\tif (node.options.before) {\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(range.startLineNumber);\n\t\t}\n\t}\n\n\tprivate _changeDecorationOptionsImpl(decorationId: string, options: ModelDecorationOptions): void {\n\t\tconst node = this._decorations[decorationId];\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nodeWasInOverviewRuler = (node.options.overviewRuler && node.options.overviewRuler.color ? true : false);\n\t\tconst nodeIsInOverviewRuler = (options.overviewRuler && options.overviewRuler.color ? true : false);\n\n\t\tthis._onDidChangeDecorations.checkAffectedAndFire(node.options);\n\t\tthis._onDidChangeDecorations.checkAffectedAndFire(options);\n\n\t\tif (node.options.after || options.after) {\n\t\t\tconst nodeRange = this._decorationsTree.getNodeRange(this, node);\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.endLineNumber);\n\t\t}\n\t\tif (node.options.before || options.before) {\n\t\t\tconst nodeRange = this._decorationsTree.getNodeRange(this, node);\n\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.startLineNumber);\n\t\t}\n\n\t\tif (nodeWasInOverviewRuler !== nodeIsInOverviewRuler) {\n\t\t\t// Delete + Insert due to an overview ruler status change\n\t\t\tthis._decorationsTree.delete(node);\n\t\t\tnode.setOptions(options);\n\t\t\tthis._decorationsTree.insert(node);\n\t\t} else {\n\t\t\tnode.setOptions(options);\n\t\t}\n\t}\n\n\tprivate _deltaDecorationsImpl(ownerId: number, oldDecorationsIds: string[], newDecorations: model.IModelDeltaDecoration[]): string[] {\n\t\tconst versionId = this.getVersionId();\n\n\t\tconst oldDecorationsLen = oldDecorationsIds.length;\n\t\tlet oldDecorationIndex = 0;\n\n\t\tconst newDecorationsLen = newDecorations.length;\n\t\tlet newDecorationIndex = 0;\n\n\t\tconst result = new Array<string>(newDecorationsLen);\n\t\twhile (oldDecorationIndex < oldDecorationsLen || newDecorationIndex < newDecorationsLen) {\n\n\t\t\tlet node: IntervalNode | null = null;\n\n\t\t\tif (oldDecorationIndex < oldDecorationsLen) {\n\t\t\t\t// (1) get ourselves an old node\n\t\t\t\tdo {\n\t\t\t\t\tnode = this._decorations[oldDecorationsIds[oldDecorationIndex++]];\n\t\t\t\t} while (!node && oldDecorationIndex < oldDecorationsLen);\n\n\t\t\t\t// (2) remove the node from the tree (if it exists)\n\t\t\t\tif (node) {\n\t\t\t\t\tif (node.options.after) {\n\t\t\t\t\t\tconst nodeRange = this._decorationsTree.getNodeRange(this, node);\n\t\t\t\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.endLineNumber);\n\t\t\t\t\t}\n\t\t\t\t\tif (node.options.before) {\n\t\t\t\t\t\tconst nodeRange = this._decorationsTree.getNodeRange(this, node);\n\t\t\t\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.startLineNumber);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._decorationsTree.delete(node);\n\n\t\t\t\t\tthis._onDidChangeDecorations.checkAffectedAndFire(node.options);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newDecorationIndex < newDecorationsLen) {\n\t\t\t\t// (3) create a new node if necessary\n\t\t\t\tif (!node) {\n\t\t\t\t\tconst internalDecorationId = (++this._lastDecorationId);\n\t\t\t\t\tconst decorationId = `${this._instanceId};${internalDecorationId}`;\n\t\t\t\t\tnode = new IntervalNode(decorationId, 0, 0);\n\t\t\t\t\tthis._decorations[decorationId] = node;\n\t\t\t\t}\n\n\t\t\t\t// (4) initialize node\n\t\t\t\tconst newDecoration = newDecorations[newDecorationIndex];\n\t\t\t\tconst range = this._validateRangeRelaxedNoAllocations(newDecoration.range);\n\t\t\t\tconst options = _normalizeOptions(newDecoration.options);\n\t\t\t\tconst startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\t\t\tconst endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn);\n\n\t\t\t\tnode.ownerId = ownerId;\n\t\t\t\tnode.reset(versionId, startOffset, endOffset, range);\n\t\t\t\tnode.setOptions(options);\n\n\t\t\t\tif (node.options.after) {\n\t\t\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(range.endLineNumber);\n\t\t\t\t}\n\t\t\t\tif (node.options.before) {\n\t\t\t\t\tthis._onDidChangeDecorations.recordLineAffectedByInjectedText(range.startLineNumber);\n\t\t\t\t}\n\n\t\t\t\tthis._onDidChangeDecorations.checkAffectedAndFire(options);\n\n\t\t\t\tthis._decorationsTree.insert(node);\n\n\t\t\t\tresult[newDecorationIndex] = node.id;\n\n\t\t\t\tnewDecorationIndex++;\n\t\t\t} else {\n\t\t\t\tif (node) {\n\t\t\t\t\tdelete this._decorations[node.id];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic setTokens(tokens: ContiguousMultilineTokens[], backgroundTokenizationCompleted: boolean = false): void {\n\t\tif (tokens.length !== 0) {\n\t\t\tconst ranges: { fromLineNumber: number; toLineNumber: number }[] = [];\n\n\t\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\t\tconst element = tokens[i];\n\t\t\t\tlet minChangedLineNumber = 0;\n\t\t\t\tlet maxChangedLineNumber = 0;\n\t\t\t\tlet hasChange = false;\n\t\t\t\tfor (let lineNumber = element.startLineNumber; lineNumber <= element.endLineNumber; lineNumber++) {\n\t\t\t\t\tif (hasChange) {\n\t\t\t\t\t\tthis._tokens.setTokens(this._languageId, lineNumber - 1, this._buffer.getLineLength(lineNumber), element.getLineTokens(lineNumber), false);\n\t\t\t\t\t\tmaxChangedLineNumber = lineNumber;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst lineHasChange = this._tokens.setTokens(this._languageId, lineNumber - 1, this._buffer.getLineLength(lineNumber), element.getLineTokens(lineNumber), true);\n\t\t\t\t\t\tif (lineHasChange) {\n\t\t\t\t\t\t\thasChange = true;\n\t\t\t\t\t\t\tminChangedLineNumber = lineNumber;\n\t\t\t\t\t\t\tmaxChangedLineNumber = lineNumber;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hasChange) {\n\t\t\t\t\tranges.push({ fromLineNumber: minChangedLineNumber, toLineNumber: maxChangedLineNumber });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ranges.length > 0) {\n\t\t\t\tthis._emitModelTokensChangedEvent({\n\t\t\t\t\ttokenizationSupportChanged: false,\n\t\t\t\t\tsemanticTokensApplied: false,\n\t\t\t\t\tranges: ranges\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tthis.handleTokenizationProgress(backgroundTokenizationCompleted);\n\t}\n\n\tpublic setSemanticTokens(tokens: SparseMultilineTokens[] | null, isComplete: boolean): void {\n\t\tthis._semanticTokens.set(tokens, isComplete);\n\n\t\tthis._emitModelTokensChangedEvent({\n\t\t\ttokenizationSupportChanged: false,\n\t\t\tsemanticTokensApplied: tokens !== null,\n\t\t\tranges: [{ fromLineNumber: 1, toLineNumber: this.getLineCount() }]\n\t\t});\n\t}\n\n\tpublic hasCompleteSemanticTokens(): boolean {\n\t\treturn this._semanticTokens.isComplete();\n\t}\n\n\tpublic hasSomeSemanticTokens(): boolean {\n\t\treturn !this._semanticTokens.isEmpty();\n\t}\n\n\tpublic setPartialSemanticTokens(range: Range, tokens: SparseMultilineTokens[]): void {\n\t\tif (this.hasCompleteSemanticTokens()) {\n\t\t\treturn;\n\t\t}\n\t\tconst changedRange = this.validateRange(this._semanticTokens.setPartial(range, tokens));\n\n\t\tthis._emitModelTokensChangedEvent({\n\t\t\ttokenizationSupportChanged: false,\n\t\t\tsemanticTokensApplied: true,\n\t\t\tranges: [{ fromLineNumber: changedRange.startLineNumber, toLineNumber: changedRange.endLineNumber }]\n\t\t});\n\t}\n\n\tpublic tokenizeViewport(startLineNumber: number, endLineNumber: number): void {\n\t\tstartLineNumber = Math.max(1, startLineNumber);\n\t\tendLineNumber = Math.min(this._buffer.getLineCount(), endLineNumber);\n\t\tthis._tokenization.tokenizeViewport(startLineNumber, endLineNumber);\n\t}\n\n\tpublic clearTokens(): void {\n\t\tthis._tokens.flush();\n\t\tthis._emitModelTokensChangedEvent({\n\t\t\ttokenizationSupportChanged: true,\n\t\t\tsemanticTokensApplied: false,\n\t\t\tranges: [{\n\t\t\t\tfromLineNumber: 1,\n\t\t\t\ttoLineNumber: this._buffer.getLineCount()\n\t\t\t}]\n\t\t});\n\t}\n\n\tprivate _emitModelTokensChangedEvent(e: IModelTokensChangedEvent): void {\n\t\tif (!this._isDisposing) {\n\t\t\tthis._bracketPairColorizer.handleDidChangeTokens(e);\n\t\t\tthis._onDidChangeTokens.fire(e);\n\t\t}\n\t}\n\n\tpublic resetTokenization(): void {\n\t\tthis._tokenization.reset();\n\t}\n\n\tpublic forceTokenization(lineNumber: number): void {\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\n\t\tthis._tokenization.forceTokenization(lineNumber);\n\t}\n\n\tpublic isCheapToTokenize(lineNumber: number): boolean {\n\t\treturn this._tokenization.isCheapToTokenize(lineNumber);\n\t}\n\n\tpublic tokenizeIfCheap(lineNumber: number): void {\n\t\tif (this.isCheapToTokenize(lineNumber)) {\n\t\t\tthis.forceTokenization(lineNumber);\n\t\t}\n\t}\n\n\tpublic getLineTokens(lineNumber: number): LineTokens {\n\t\tif (lineNumber < 1 || lineNumber > this.getLineCount()) {\n\t\t\tthrow new Error('Illegal value for lineNumber');\n\t\t}\n\n\t\treturn this._getLineTokens(lineNumber);\n\t}\n\n\tprivate _getLineTokens(lineNumber: number): LineTokens {\n\t\tconst lineText = this.getLineContent(lineNumber);\n\t\tconst syntacticTokens = this._tokens.getTokens(this._languageId, lineNumber - 1, lineText);\n\t\treturn this._semanticTokens.addSparseTokens(lineNumber, syntacticTokens);\n\t}\n\n\tpublic getLanguageId(): string {\n\t\treturn this._languageId;\n\t}\n\n\tpublic setMode(languageId: string): void {\n\t\tif (this._languageId === languageId) {\n\t\t\t// There's nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tconst e: IModelLanguageChangedEvent = {\n\t\t\toldLanguage: this._languageId,\n\t\t\tnewLanguage: languageId\n\t\t};\n\n\t\tthis._languageId = languageId;\n\n\t\tthis._bracketPairColorizer.handleDidChangeLanguage(e);\n\t\tthis._tokenization.handleDidChangeLanguage(e);\n\t\tthis._onDidChangeLanguage.fire(e);\n\t\tthis._onDidChangeLanguageConfiguration.fire({});\n\t}\n\n\tpublic getLanguageIdAtPosition(lineNumber: number, column: number): string {\n\t\tconst position = this.validatePosition(new Position(lineNumber, column));\n\t\tconst lineTokens = this.getLineTokens(position.lineNumber);\n\t\treturn lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(position.column - 1));\n\t}\n\n\tpublic getTokenTypeIfInsertingCharacter(lineNumber: number, column: number, character: string): StandardTokenType {\n\t\tconst position = this.validatePosition(new Position(lineNumber, column));\n\t\treturn this._tokenization.getTokenTypeIfInsertingCharacter(position, character);\n\t}\n\n\ttokenizeLineWithEdit(position: IPosition, length: number, newText: string): LineTokens | null {\n\t\tconst validatedPosition = this.validatePosition(position);\n\t\treturn this._tokenization.tokenizeLineWithEdit(validatedPosition, length, newText);\n\t}\n\n\tprivate getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {\n\t\treturn this._languageConfigurationService.getLanguageConfiguration(languageId);\n\t}\n\n\t// Having tokens allows implementing additional helper methods\n\n\tpublic getWordAtPosition(_position: IPosition): IWordAtPosition | null {\n\t\tthis._assertNotDisposed();\n\t\tconst position = this.validatePosition(_position);\n\t\tconst lineContent = this.getLineContent(position.lineNumber);\n\t\tconst lineTokens = this._getLineTokens(position.lineNumber);\n\t\tconst tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\n\t\t// (1). First try checking right biased word\n\t\tconst [rbStartOffset, rbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex);\n\t\tconst rightBiasedWord = getWordAtText(\n\t\t\tposition.column,\n\t\t\tthis.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex)).getWordDefinition(),\n\t\t\tlineContent.substring(rbStartOffset, rbEndOffset),\n\t\t\trbStartOffset\n\t\t);\n\t\t// Make sure the result touches the original passed in position\n\t\tif (rightBiasedWord && rightBiasedWord.startColumn <= _position.column && _position.column <= rightBiasedWord.endColumn) {\n\t\t\treturn rightBiasedWord;\n\t\t}\n\n\t\t// (2). Else, if we were at a language boundary, check the left biased word\n\t\tif (tokenIndex > 0 && rbStartOffset === position.column - 1) {\n\t\t\t// edge case, where `position` sits between two tokens belonging to two different languages\n\t\t\tconst [lbStartOffset, lbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex - 1);\n\t\t\tconst leftBiasedWord = getWordAtText(\n\t\t\t\tposition.column,\n\t\t\t\tthis.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex - 1)).getWordDefinition(),\n\t\t\t\tlineContent.substring(lbStartOffset, lbEndOffset),\n\t\t\t\tlbStartOffset\n\t\t\t);\n\t\t\t// Make sure the result touches the original passed in position\n\t\t\tif (leftBiasedWord && leftBiasedWord.startColumn <= _position.column && _position.column <= leftBiasedWord.endColumn) {\n\t\t\t\treturn leftBiasedWord;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _findLanguageBoundaries(lineTokens: LineTokens, tokenIndex: number): [number, number] {\n\t\tconst languageId = lineTokens.getLanguageId(tokenIndex);\n\n\t\t// go left until a different language is hit\n\t\tlet startOffset = 0;\n\t\tfor (let i = tokenIndex; i >= 0 && lineTokens.getLanguageId(i) === languageId; i--) {\n\t\t\tstartOffset = lineTokens.getStartOffset(i);\n\t\t}\n\n\t\t// go right until a different language is hit\n\t\tlet endOffset = lineTokens.getLineContent().length;\n\t\tfor (let i = tokenIndex, tokenCount = lineTokens.getCount(); i < tokenCount && lineTokens.getLanguageId(i) === languageId; i++) {\n\t\t\tendOffset = lineTokens.getEndOffset(i);\n\t\t}\n\n\t\treturn [startOffset, endOffset];\n\t}\n\n\tpublic getWordUntilPosition(position: IPosition): IWordAtPosition {\n\t\tconst wordAtPosition = this.getWordAtPosition(position);\n\t\tif (!wordAtPosition) {\n\t\t\treturn {\n\t\t\t\tword: '',\n\t\t\t\tstartColumn: position.column,\n\t\t\t\tendColumn: position.column\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tword: wordAtPosition.word.substr(0, position.column - wordAtPosition.startColumn),\n\t\t\tstartColumn: wordAtPosition.startColumn,\n\t\t\tendColumn: position.column\n\t\t};\n\t}\n\n\t//#endregion\n\tnormalizePosition(position: Position, affinity: model.PositionAffinity): Position {\n\t\treturn position;\n\t}\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t*/\n\tpublic getLineIndentColumn(lineNumber: number): number {\n\t\t// Columns start with 1.\n\t\treturn indentOfLine(this.getLineContent(lineNumber)) + 1;\n\t}\n}\n\nfunction indentOfLine(line: string): number {\n\tlet indent = 0;\n\tfor (const c of line) {\n\t\tif (c === ' ' || c === '\\t') {\n\t\t\tindent++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn indent;\n}\n\n//#region Decorations\n\nfunction isNodeInOverviewRuler(node: IntervalNode): boolean {\n\treturn (node.options.overviewRuler && node.options.overviewRuler.color ? true : false);\n}\n\nfunction isNodeInjectedText(node: IntervalNode): boolean {\n\treturn !!node.options.after || !!node.options.before;\n}\n\nexport interface IDecorationsTreesHost {\n\tgetVersionId(): number;\n\tgetRangeAt(start: number, end: number): Range;\n}\n\nclass DecorationsTrees {\n\n\t/**\n\t * This tree holds decorations that do not show up in the overview ruler.\n\t */\n\tprivate readonly _decorationsTree0: IntervalTree;\n\n\t/**\n\t * This tree holds decorations that show up in the overview ruler.\n\t */\n\tprivate readonly _decorationsTree1: IntervalTree;\n\n\t/**\n\t * This tree holds decorations that contain injected text.\n\t */\n\tprivate readonly _injectedTextDecorationsTree: IntervalTree;\n\n\tconstructor() {\n\t\tthis._decorationsTree0 = new IntervalTree();\n\t\tthis._decorationsTree1 = new IntervalTree();\n\t\tthis._injectedTextDecorationsTree = new IntervalTree();\n\t}\n\n\tpublic ensureAllNodesHaveRanges(host: IDecorationsTreesHost): void {\n\t\tthis.getAll(host, 0, false, false);\n\t}\n\n\tprivate _ensureNodesHaveRanges(host: IDecorationsTreesHost, nodes: IntervalNode[]): model.IModelDecoration[] {\n\t\tfor (const node of nodes) {\n\t\t\tif (node.range === null) {\n\t\t\t\tnode.range = host.getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd);\n\t\t\t}\n\t\t}\n\t\treturn <model.IModelDecoration[]>nodes;\n\t}\n\n\tpublic getAllInInterval(host: IDecorationsTreesHost, start: number, end: number, filterOwnerId: number, filterOutValidation: boolean): model.IModelDecoration[] {\n\t\tconst versionId = host.getVersionId();\n\t\tconst result = this._intervalSearch(start, end, filterOwnerId, filterOutValidation, versionId);\n\t\treturn this._ensureNodesHaveRanges(host, result);\n\t}\n\n\tprivate _intervalSearch(start: number, end: number, filterOwnerId: number, filterOutValidation: boolean, cachedVersionId: number): IntervalNode[] {\n\t\tconst r0 = this._decorationsTree0.intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId);\n\t\tconst r1 = this._decorationsTree1.intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId);\n\t\tconst r2 = this._injectedTextDecorationsTree.intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId);\n\t\treturn r0.concat(r1).concat(r2);\n\t}\n\n\tpublic getInjectedTextInInterval(host: IDecorationsTreesHost, start: number, end: number, filterOwnerId: number): model.IModelDecoration[] {\n\t\tconst versionId = host.getVersionId();\n\t\tconst result = this._injectedTextDecorationsTree.intervalSearch(start, end, filterOwnerId, false, versionId);\n\t\treturn this._ensureNodesHaveRanges(host, result).filter((i) => i.options.showIfCollapsed || !i.range.isEmpty());\n\t}\n\n\tpublic getAllInjectedText(host: IDecorationsTreesHost, filterOwnerId: number): model.IModelDecoration[] {\n\t\tconst versionId = host.getVersionId();\n\t\tconst result = this._injectedTextDecorationsTree.search(filterOwnerId, false, versionId);\n\t\treturn this._ensureNodesHaveRanges(host, result).filter((i) => i.options.showIfCollapsed || !i.range.isEmpty());\n\t}\n\n\tpublic getAll(host: IDecorationsTreesHost, filterOwnerId: number, filterOutValidation: boolean, overviewRulerOnly: boolean): model.IModelDecoration[] {\n\t\tconst versionId = host.getVersionId();\n\t\tconst result = this._search(filterOwnerId, filterOutValidation, overviewRulerOnly, versionId);\n\t\treturn this._ensureNodesHaveRanges(host, result);\n\t}\n\n\tprivate _search(filterOwnerId: number, filterOutValidation: boolean, overviewRulerOnly: boolean, cachedVersionId: number): IntervalNode[] {\n\t\tif (overviewRulerOnly) {\n\t\t\treturn this._decorationsTree1.search(filterOwnerId, filterOutValidation, cachedVersionId);\n\t\t} else {\n\t\t\tconst r0 = this._decorationsTree0.search(filterOwnerId, filterOutValidation, cachedVersionId);\n\t\t\tconst r1 = this._decorationsTree1.search(filterOwnerId, filterOutValidation, cachedVersionId);\n\t\t\tconst r2 = this._injectedTextDecorationsTree.search(filterOwnerId, filterOutValidation, cachedVersionId);\n\t\t\treturn r0.concat(r1).concat(r2);\n\t\t}\n\t}\n\n\tpublic collectNodesFromOwner(ownerId: number): IntervalNode[] {\n\t\tconst r0 = this._decorationsTree0.collectNodesFromOwner(ownerId);\n\t\tconst r1 = this._decorationsTree1.collectNodesFromOwner(ownerId);\n\t\tconst r2 = this._injectedTextDecorationsTree.collectNodesFromOwner(ownerId);\n\t\treturn r0.concat(r1).concat(r2);\n\t}\n\n\tpublic collectNodesPostOrder(): IntervalNode[] {\n\t\tconst r0 = this._decorationsTree0.collectNodesPostOrder();\n\t\tconst r1 = this._decorationsTree1.collectNodesPostOrder();\n\t\tconst r2 = this._injectedTextDecorationsTree.collectNodesPostOrder();\n\t\treturn r0.concat(r1).concat(r2);\n\t}\n\n\tpublic insert(node: IntervalNode): void {\n\t\tif (isNodeInjectedText(node)) {\n\t\t\tthis._injectedTextDecorationsTree.insert(node);\n\t\t} else if (isNodeInOverviewRuler(node)) {\n\t\t\tthis._decorationsTree1.insert(node);\n\t\t} else {\n\t\t\tthis._decorationsTree0.insert(node);\n\t\t}\n\t}\n\n\tpublic delete(node: IntervalNode): void {\n\t\tif (isNodeInjectedText(node)) {\n\t\t\tthis._injectedTextDecorationsTree.delete(node);\n\t\t} else if (isNodeInOverviewRuler(node)) {\n\t\t\tthis._decorationsTree1.delete(node);\n\t\t} else {\n\t\t\tthis._decorationsTree0.delete(node);\n\t\t}\n\t}\n\n\tpublic getNodeRange(host: IDecorationsTreesHost, node: IntervalNode): Range {\n\t\tconst versionId = host.getVersionId();\n\t\tif (node.cachedVersionId !== versionId) {\n\t\t\tthis._resolveNode(node, versionId);\n\t\t}\n\t\tif (node.range === null) {\n\t\t\tnode.range = host.getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd);\n\t\t}\n\t\treturn node.range;\n\t}\n\n\tprivate _resolveNode(node: IntervalNode, cachedVersionId: number): void {\n\t\tif (isNodeInjectedText(node)) {\n\t\t\tthis._injectedTextDecorationsTree.resolveNode(node, cachedVersionId);\n\t\t} else if (isNodeInOverviewRuler(node)) {\n\t\t\tthis._decorationsTree1.resolveNode(node, cachedVersionId);\n\t\t} else {\n\t\t\tthis._decorationsTree0.resolveNode(node, cachedVersionId);\n\t\t}\n\t}\n\n\tpublic acceptReplace(offset: number, length: number, textLength: number, forceMoveMarkers: boolean): void {\n\t\tthis._decorationsTree0.acceptReplace(offset, length, textLength, forceMoveMarkers);\n\t\tthis._decorationsTree1.acceptReplace(offset, length, textLength, forceMoveMarkers);\n\t\tthis._injectedTextDecorationsTree.acceptReplace(offset, length, textLength, forceMoveMarkers);\n\t}\n}\n\nfunction cleanClassName(className: string): string {\n\treturn className.replace(/[^a-z0-9\\-_]/gi, ' ');\n}\n\nclass DecorationOptions implements model.IDecorationOptions {\n\treadonly color: string | ThemeColor;\n\treadonly darkColor: string | ThemeColor;\n\n\tconstructor(options: model.IDecorationOptions) {\n\t\tthis.color = options.color || '';\n\t\tthis.darkColor = options.darkColor || '';\n\n\t}\n}\n\nexport class ModelDecorationOverviewRulerOptions extends DecorationOptions {\n\treadonly position: model.OverviewRulerLane;\n\tprivate _resolvedColor: string | null;\n\n\tconstructor(options: model.IModelDecorationOverviewRulerOptions) {\n\t\tsuper(options);\n\t\tthis._resolvedColor = null;\n\t\tthis.position = (typeof options.position === 'number' ? options.position : model.OverviewRulerLane.Center);\n\t}\n\n\tpublic getColor(theme: IColorTheme): string {\n\t\tif (!this._resolvedColor) {\n\t\t\tif (theme.type !== 'light' && this.darkColor) {\n\t\t\t\tthis._resolvedColor = this._resolveColor(this.darkColor, theme);\n\t\t\t} else {\n\t\t\t\tthis._resolvedColor = this._resolveColor(this.color, theme);\n\t\t\t}\n\t\t}\n\t\treturn this._resolvedColor;\n\t}\n\n\tpublic invalidateCachedColor(): void {\n\t\tthis._resolvedColor = null;\n\t}\n\n\tprivate _resolveColor(color: string | ThemeColor, theme: IColorTheme): string {\n\t\tif (typeof color === 'string') {\n\t\t\treturn color;\n\t\t}\n\t\tconst c = color ? theme.getColor(color.id) : null;\n\t\tif (!c) {\n\t\t\treturn '';\n\t\t}\n\t\treturn c.toString();\n\t}\n}\n\nexport class ModelDecorationMinimapOptions extends DecorationOptions {\n\treadonly position: model.MinimapPosition;\n\tprivate _resolvedColor: Color | undefined;\n\n\n\tconstructor(options: model.IModelDecorationMinimapOptions) {\n\t\tsuper(options);\n\t\tthis.position = options.position;\n\t}\n\n\tpublic getColor(theme: IColorTheme): Color | undefined {\n\t\tif (!this._resolvedColor) {\n\t\t\tif (theme.type !== 'light' && this.darkColor) {\n\t\t\t\tthis._resolvedColor = this._resolveColor(this.darkColor, theme);\n\t\t\t} else {\n\t\t\t\tthis._resolvedColor = this._resolveColor(this.color, theme);\n\t\t\t}\n\t\t}\n\n\t\treturn this._resolvedColor;\n\t}\n\n\tpublic invalidateCachedColor(): void {\n\t\tthis._resolvedColor = undefined;\n\t}\n\n\tprivate _resolveColor(color: string | ThemeColor, theme: IColorTheme): Color | undefined {\n\t\tif (typeof color === 'string') {\n\t\t\treturn Color.fromHex(color);\n\t\t}\n\t\treturn theme.getColor(color.id);\n\t}\n}\n\nexport class ModelDecorationInjectedTextOptions implements model.InjectedTextOptions {\n\tpublic static from(options: model.InjectedTextOptions): ModelDecorationInjectedTextOptions {\n\t\tif (options instanceof ModelDecorationInjectedTextOptions) {\n\t\t\treturn options;\n\t\t}\n\t\treturn new ModelDecorationInjectedTextOptions(options);\n\t}\n\n\tpublic readonly content: string;\n\treadonly inlineClassName: string | null;\n\treadonly inlineClassNameAffectsLetterSpacing: boolean;\n\treadonly attachedData: unknown | null;\n\treadonly cursorStops: model.InjectedTextCursorStops | null;\n\n\tprivate constructor(options: model.InjectedTextOptions) {\n\t\tthis.content = options.content || '';\n\t\tthis.inlineClassName = options.inlineClassName || null;\n\t\tthis.inlineClassNameAffectsLetterSpacing = options.inlineClassNameAffectsLetterSpacing || false;\n\t\tthis.attachedData = options.attachedData || null;\n\t\tthis.cursorStops = options.cursorStops || null;\n\t}\n}\n\nexport class ModelDecorationOptions implements model.IModelDecorationOptions {\n\n\tpublic static EMPTY: ModelDecorationOptions;\n\n\tpublic static register(options: model.IModelDecorationOptions): ModelDecorationOptions {\n\t\treturn new ModelDecorationOptions(options);\n\t}\n\n\tpublic static createDynamic(options: model.IModelDecorationOptions): ModelDecorationOptions {\n\t\treturn new ModelDecorationOptions(options);\n\t}\n\n\treadonly description: string;\n\treadonly stickiness: model.TrackedRangeStickiness;\n\treadonly zIndex: number;\n\treadonly className: string | null;\n\treadonly hoverMessage: IMarkdownString | IMarkdownString[] | null;\n\treadonly glyphMarginHoverMessage: IMarkdownString | IMarkdownString[] | null;\n\treadonly isWholeLine: boolean;\n\treadonly showIfCollapsed: boolean;\n\treadonly collapseOnReplaceEdit: boolean;\n\treadonly overviewRuler: ModelDecorationOverviewRulerOptions | null;\n\treadonly minimap: ModelDecorationMinimapOptions | null;\n\treadonly glyphMarginClassName: string | null;\n\treadonly linesDecorationsClassName: string | null;\n\treadonly firstLineDecorationClassName: string | null;\n\treadonly marginClassName: string | null;\n\treadonly inlineClassName: string | null;\n\treadonly inlineClassNameAffectsLetterSpacing: boolean;\n\treadonly beforeContentClassName: string | null;\n\treadonly afterContentClassName: string | null;\n\treadonly after: ModelDecorationInjectedTextOptions | null;\n\treadonly before: ModelDecorationInjectedTextOptions | null;\n\treadonly hideInCommentTokens: boolean | null;\n\treadonly hideInStringTokens: boolean | null;\n\n\n\tprivate constructor(options: model.IModelDecorationOptions) {\n\t\tthis.description = options.description;\n\t\tthis.stickiness = options.stickiness || model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges;\n\t\tthis.zIndex = options.zIndex || 0;\n\t\tthis.className = options.className ? cleanClassName(options.className) : null;\n\t\tthis.hoverMessage = options.hoverMessage || null;\n\t\tthis.glyphMarginHoverMessage = options.glyphMarginHoverMessage || null;\n\t\tthis.isWholeLine = options.isWholeLine || false;\n\t\tthis.showIfCollapsed = options.showIfCollapsed || false;\n\t\tthis.collapseOnReplaceEdit = options.collapseOnReplaceEdit || false;\n\t\tthis.overviewRuler = options.overviewRuler ? new ModelDecorationOverviewRulerOptions(options.overviewRuler) : null;\n\t\tthis.minimap = options.minimap ? new ModelDecorationMinimapOptions(options.minimap) : null;\n\t\tthis.glyphMarginClassName = options.glyphMarginClassName ? cleanClassName(options.glyphMarginClassName) : null;\n\t\tthis.linesDecorationsClassName = options.linesDecorationsClassName ? cleanClassName(options.linesDecorationsClassName) : null;\n\t\tthis.firstLineDecorationClassName = options.firstLineDecorationClassName ? cleanClassName(options.firstLineDecorationClassName) : null;\n\t\tthis.marginClassName = options.marginClassName ? cleanClassName(options.marginClassName) : null;\n\t\tthis.inlineClassName = options.inlineClassName ? cleanClassName(options.inlineClassName) : null;\n\t\tthis.inlineClassNameAffectsLetterSpacing = options.inlineClassNameAffectsLetterSpacing || false;\n\t\tthis.beforeContentClassName = options.beforeContentClassName ? cleanClassName(options.beforeContentClassName) : null;\n\t\tthis.afterContentClassName = options.afterContentClassName ? cleanClassName(options.afterContentClassName) : null;\n\t\tthis.after = options.after ? ModelDecorationInjectedTextOptions.from(options.after) : null;\n\t\tthis.before = options.before ? ModelDecorationInjectedTextOptions.from(options.before) : null;\n\t\tthis.hideInCommentTokens = options.hideInCommentTokens ?? false;\n\t\tthis.hideInStringTokens = options.hideInStringTokens ?? false;\n\t}\n}\nModelDecorationOptions.EMPTY = ModelDecorationOptions.register({ description: 'empty' });\n\n/**\n * The order carefully matches the values of the enum.\n */\nconst TRACKED_RANGE_OPTIONS = [\n\tModelDecorationOptions.register({ description: 'tracked-range-always-grows-when-typing-at-edges', stickiness: model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }),\n\tModelDecorationOptions.register({ description: 'tracked-range-never-grows-when-typing-at-edges', stickiness: model.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges }),\n\tModelDecorationOptions.register({ description: 'tracked-range-grows-only-when-typing-before', stickiness: model.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore }),\n\tModelDecorationOptions.register({ description: 'tracked-range-grows-only-when-typing-after', stickiness: model.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter }),\n];\n\nfunction _normalizeOptions(options: model.IModelDecorationOptions): ModelDecorationOptions {\n\tif (options instanceof ModelDecorationOptions) {\n\t\treturn options;\n\t}\n\treturn ModelDecorationOptions.createDynamic(options);\n}\n\nexport class DidChangeDecorationsEmitter extends Disposable {\n\n\tprivate readonly _actual: Emitter<IModelDecorationsChangedEvent> = this._register(new Emitter<IModelDecorationsChangedEvent>());\n\tpublic readonly event: Event<IModelDecorationsChangedEvent> = this._actual.event;\n\n\tprivate _deferredCnt: number;\n\tprivate _shouldFire: boolean;\n\tprivate _affectsMinimap: boolean;\n\tprivate _affectsOverviewRuler: boolean;\n\tprivate _affectedInjectedTextLines: Set<number> | null = null;\n\n\tconstructor(private readonly handleBeforeFire: (affectedInjectedTextLines: Set<number> | null) => void) {\n\t\tsuper();\n\t\tthis._deferredCnt = 0;\n\t\tthis._shouldFire = false;\n\t\tthis._affectsMinimap = false;\n\t\tthis._affectsOverviewRuler = false;\n\t}\n\n\tpublic beginDeferredEmit(): void {\n\t\tthis._deferredCnt++;\n\t}\n\n\tpublic endDeferredEmit(): void {\n\t\tthis._deferredCnt--;\n\t\tif (this._deferredCnt === 0) {\n\t\t\tif (this._shouldFire) {\n\t\t\t\tthis.handleBeforeFire(this._affectedInjectedTextLines);\n\n\t\t\t\tconst event: IModelDecorationsChangedEvent = {\n\t\t\t\t\taffectsMinimap: this._affectsMinimap,\n\t\t\t\t\taffectsOverviewRuler: this._affectsOverviewRuler\n\t\t\t\t};\n\t\t\t\tthis._shouldFire = false;\n\t\t\t\tthis._affectsMinimap = false;\n\t\t\t\tthis._affectsOverviewRuler = false;\n\t\t\t\tthis._actual.fire(event);\n\t\t\t}\n\n\t\t\tthis._affectedInjectedTextLines?.clear();\n\t\t\tthis._affectedInjectedTextLines = null;\n\t\t}\n\t}\n\n\tpublic recordLineAffectedByInjectedText(lineNumber: number): void {\n\t\tif (!this._affectedInjectedTextLines) {\n\t\t\tthis._affectedInjectedTextLines = new Set();\n\t\t}\n\t\tthis._affectedInjectedTextLines.add(lineNumber);\n\t}\n\n\tpublic checkAffectedAndFire(options: ModelDecorationOptions): void {\n\t\tif (!this._affectsMinimap) {\n\t\t\tthis._affectsMinimap = options.minimap && options.minimap.position ? true : false;\n\t\t}\n\t\tif (!this._affectsOverviewRuler) {\n\t\t\tthis._affectsOverviewRuler = options.overviewRuler && options.overviewRuler.color ? true : false;\n\t\t}\n\t\tthis._shouldFire = true;\n\t}\n\n\tpublic fire(): void {\n\t\tthis._affectsMinimap = true;\n\t\tthis._affectsOverviewRuler = true;\n\t\tthis._shouldFire = true;\n\t}\n}\n\n//#endregion\n\nexport class DidChangeContentEmitter extends Disposable {\n\n\t/**\n\t * Both `fastEvent` and `slowEvent` work the same way and contain the same events, but first we invoke `fastEvent` and then `slowEvent`.\n\t */\n\tprivate readonly _fastEmitter: Emitter<InternalModelContentChangeEvent> = this._register(new Emitter<InternalModelContentChangeEvent>());\n\tpublic readonly fastEvent: Event<InternalModelContentChangeEvent> = this._fastEmitter.event;\n\tprivate readonly _slowEmitter: Emitter<InternalModelContentChangeEvent> = this._register(new Emitter<InternalModelContentChangeEvent>());\n\tpublic readonly slowEvent: Event<InternalModelContentChangeEvent> = this._slowEmitter.event;\n\n\tprivate _deferredCnt: number;\n\tprivate _deferredEvent: InternalModelContentChangeEvent | null;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._deferredCnt = 0;\n\t\tthis._deferredEvent = null;\n\t}\n\n\tpublic beginDeferredEmit(): void {\n\t\tthis._deferredCnt++;\n\t}\n\n\tpublic endDeferredEmit(resultingSelection: Selection[] | null = null): void {\n\t\tthis._deferredCnt--;\n\t\tif (this._deferredCnt === 0) {\n\t\t\tif (this._deferredEvent !== null) {\n\t\t\t\tthis._deferredEvent.rawContentChangedEvent.resultingSelection = resultingSelection;\n\t\t\t\tconst e = this._deferredEvent;\n\t\t\t\tthis._deferredEvent = null;\n\t\t\t\tthis._fastEmitter.fire(e);\n\t\t\t\tthis._slowEmitter.fire(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic fire(e: InternalModelContentChangeEvent): void {\n\t\tif (this._deferredCnt > 0) {\n\t\t\tif (this._deferredEvent) {\n\t\t\t\tthis._deferredEvent = this._deferredEvent.merge(e);\n\t\t\t} else {\n\t\t\t\tthis._deferredEvent = e;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._fastEmitter.fire(e);\n\t\tthis._slowEmitter.fire(e);\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, DisposableStore, dispose } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as errors from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { DefaultEndOfLine, EndOfLineSequence, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';\nimport { IModelLanguageChangedEvent, IModelContentChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits } from 'vs/editor/common/languages';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language';\nimport { IModelService, DocumentTokensProvider } from 'vs/editor/common/services/model';\nimport { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { IUndoRedoService, ResourceEditStackSnapshot } from 'vs/platform/undoRedo/common/undoRedo';\nimport { StringSHA1 } from 'vs/base/common/hash';\nimport { isEditStackElement } from 'vs/editor/common/model/editStack';\nimport { Schemas } from 'vs/base/common/network';\nimport { SemanticTokensProviderStyling, toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling';\nimport { getDocumentSemanticTokens, hasDocumentSemanticTokensProvider, isSemanticTokens, isSemanticTokensEdits } from 'vs/editor/common/services/getSemanticTokens';\nimport { equals } from 'vs/base/common/objects';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\n\nexport interface IEditorSemanticHighlightingOptions {\n\tenabled: true | false | 'configuredByTheme';\n}\n\nfunction MODEL_ID(resource: URI): string {\n\treturn resource.toString();\n}\n\nfunction computeModelSha1(model: ITextModel): string {\n\t// compute the sha1\n\tconst shaComputer = new StringSHA1();\n\tconst snapshot = model.createSnapshot();\n\tlet text: string | null;\n\twhile ((text = snapshot.read())) {\n\t\tshaComputer.update(text);\n\t}\n\treturn shaComputer.digest();\n}\n\n\nclass ModelData implements IDisposable {\n\tpublic readonly model: TextModel;\n\n\tprivate _languageSelection: ILanguageSelection | null;\n\tprivate _languageSelectionListener: IDisposable | null;\n\n\tprivate readonly _modelEventListeners = new DisposableStore();\n\n\tconstructor(\n\t\tmodel: TextModel,\n\t\tonWillDispose: (model: ITextModel) => void,\n\t\tonDidChangeLanguage: (model: ITextModel, e: IModelLanguageChangedEvent) => void\n\t) {\n\t\tthis.model = model;\n\n\t\tthis._languageSelection = null;\n\t\tthis._languageSelectionListener = null;\n\n\t\tthis._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model)));\n\t\tthis._modelEventListeners.add(model.onDidChangeLanguage((e) => onDidChangeLanguage(model, e)));\n\t}\n\n\tprivate _disposeLanguageSelection(): void {\n\t\tif (this._languageSelectionListener) {\n\t\t\tthis._languageSelectionListener.dispose();\n\t\t\tthis._languageSelectionListener = null;\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._modelEventListeners.dispose();\n\t\tthis._disposeLanguageSelection();\n\t}\n\n\tpublic setLanguage(languageSelection: ILanguageSelection): void {\n\t\tthis._disposeLanguageSelection();\n\t\tthis._languageSelection = languageSelection;\n\t\tthis._languageSelectionListener = this._languageSelection.onDidChange(() => this.model.setMode(languageSelection.languageId));\n\t\tthis.model.setMode(languageSelection.languageId);\n\t}\n}\n\ninterface IRawEditorConfig {\n\ttabSize?: any;\n\tindentSize?: any;\n\tinsertSpaces?: any;\n\tdetectIndentation?: any;\n\ttrimAutoWhitespace?: any;\n\tlargeFileOptimizations?: any;\n\tbracketPairColorization?: any;\n}\n\ninterface IRawConfig {\n\teol?: any;\n\teditor?: IRawEditorConfig;\n}\n\nconst DEFAULT_EOL = (platform.isLinux || platform.isMacintosh) ? DefaultEndOfLine.LF : DefaultEndOfLine.CRLF;\n\nclass DisposedModelInfo {\n\tconstructor(\n\t\tpublic readonly uri: URI,\n\t\tpublic readonly initialUndoRedoSnapshot: ResourceEditStackSnapshot | null,\n\t\tpublic readonly time: number,\n\t\tpublic readonly sharesUndoRedoStack: boolean,\n\t\tpublic readonly heapSize: number,\n\t\tpublic readonly sha1: string,\n\t\tpublic readonly versionId: number,\n\t\tpublic readonly alternativeVersionId: number,\n\t) { }\n}\n\nexport class ModelService extends Disposable implements IModelService {\n\n\tpublic static MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK = 20 * 1024 * 1024;\n\n\tpublic _serviceBrand: undefined;\n\n\tprivate readonly _onModelAdded: Emitter<ITextModel> = this._register(new Emitter<ITextModel>());\n\tpublic readonly onModelAdded: Event<ITextModel> = this._onModelAdded.event;\n\n\tprivate readonly _onModelRemoved: Emitter<ITextModel> = this._register(new Emitter<ITextModel>());\n\tpublic readonly onModelRemoved: Event<ITextModel> = this._onModelRemoved.event;\n\n\tprivate readonly _onModelModeChanged = this._register(new Emitter<{ model: ITextModel; oldLanguageId: string }>());\n\tpublic readonly onModelLanguageChanged = this._onModelModeChanged.event;\n\n\tprivate _modelCreationOptionsByLanguageAndResource: { [languageAndResource: string]: ITextModelCreationOptions };\n\n\t/**\n\t * All the models known in the system.\n\t */\n\tprivate readonly _models: { [modelId: string]: ModelData };\n\tprivate readonly _disposedModels: Map<string, DisposedModelInfo>;\n\tprivate _disposedModelsHeapSize: number;\n\tprivate readonly _semanticStyling: SemanticStyling;\n\n\tconstructor(\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ITextResourcePropertiesService private readonly _resourcePropertiesService: ITextResourcePropertiesService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IUndoRedoService private readonly _undoRedoService: IUndoRedoService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeatureDebounceService private readonly _languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\t\tthis._modelCreationOptionsByLanguageAndResource = Object.create(null);\n\t\tthis._models = {};\n\t\tthis._disposedModels = new Map<string, DisposedModelInfo>();\n\t\tthis._disposedModelsHeapSize = 0;\n\t\tthis._semanticStyling = this._register(new SemanticStyling(this._themeService, this._languageService, this._logService));\n\n\t\tthis._register(this._configurationService.onDidChangeConfiguration(() => this._updateModelOptions()));\n\t\tthis._updateModelOptions();\n\n\t\tthis._register(new SemanticColoringFeature(this._semanticStyling, this, this._themeService, this._configurationService, this._languageFeatureDebounceService, languageFeaturesService));\n\t}\n\n\tprivate static _readModelOptions(config: IRawConfig, isForSimpleWidget: boolean): ITextModelCreationOptions {\n\t\tlet tabSize = EDITOR_MODEL_DEFAULTS.tabSize;\n\t\tif (config.editor && typeof config.editor.tabSize !== 'undefined') {\n\t\t\tconst parsedTabSize = parseInt(config.editor.tabSize, 10);\n\t\t\tif (!isNaN(parsedTabSize)) {\n\t\t\t\ttabSize = parsedTabSize;\n\t\t\t}\n\t\t\tif (tabSize < 1) {\n\t\t\t\ttabSize = 1;\n\t\t\t}\n\t\t}\n\n\t\tlet indentSize = tabSize;\n\t\tif (config.editor && typeof config.editor.indentSize !== 'undefined' && config.editor.indentSize !== 'tabSize') {\n\t\t\tconst parsedIndentSize = parseInt(config.editor.indentSize, 10);\n\t\t\tif (!isNaN(parsedIndentSize)) {\n\t\t\t\tindentSize = parsedIndentSize;\n\t\t\t}\n\t\t\tif (indentSize < 1) {\n\t\t\t\tindentSize = 1;\n\t\t\t}\n\t\t}\n\n\t\tlet insertSpaces = EDITOR_MODEL_DEFAULTS.insertSpaces;\n\t\tif (config.editor && typeof config.editor.insertSpaces !== 'undefined') {\n\t\t\tinsertSpaces = (config.editor.insertSpaces === 'false' ? false : Boolean(config.editor.insertSpaces));\n\t\t}\n\n\t\tlet newDefaultEOL = DEFAULT_EOL;\n\t\tconst eol = config.eol;\n\t\tif (eol === '\\r\\n') {\n\t\t\tnewDefaultEOL = DefaultEndOfLine.CRLF;\n\t\t} else if (eol === '\\n') {\n\t\t\tnewDefaultEOL = DefaultEndOfLine.LF;\n\t\t}\n\n\t\tlet trimAutoWhitespace = EDITOR_MODEL_DEFAULTS.trimAutoWhitespace;\n\t\tif (config.editor && typeof config.editor.trimAutoWhitespace !== 'undefined') {\n\t\t\ttrimAutoWhitespace = (config.editor.trimAutoWhitespace === 'false' ? false : Boolean(config.editor.trimAutoWhitespace));\n\t\t}\n\n\t\tlet detectIndentation = EDITOR_MODEL_DEFAULTS.detectIndentation;\n\t\tif (config.editor && typeof config.editor.detectIndentation !== 'undefined') {\n\t\t\tdetectIndentation = (config.editor.detectIndentation === 'false' ? false : Boolean(config.editor.detectIndentation));\n\t\t}\n\n\t\tlet largeFileOptimizations = EDITOR_MODEL_DEFAULTS.largeFileOptimizations;\n\t\tif (config.editor && typeof config.editor.largeFileOptimizations !== 'undefined') {\n\t\t\tlargeFileOptimizations = (config.editor.largeFileOptimizations === 'false' ? false : Boolean(config.editor.largeFileOptimizations));\n\t\t}\n\t\tlet bracketPairColorizationOptions = EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions;\n\t\tif (config.editor?.bracketPairColorization && typeof config.editor.bracketPairColorization === 'object') {\n\t\t\tbracketPairColorizationOptions = {\n\t\t\t\tenabled: !!config.editor.bracketPairColorization.enabled\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tisForSimpleWidget: isForSimpleWidget,\n\t\t\ttabSize: tabSize,\n\t\t\tindentSize: indentSize,\n\t\t\tinsertSpaces: insertSpaces,\n\t\t\tdetectIndentation: detectIndentation,\n\t\t\tdefaultEOL: newDefaultEOL,\n\t\t\ttrimAutoWhitespace: trimAutoWhitespace,\n\t\t\tlargeFileOptimizations: largeFileOptimizations,\n\t\t\tbracketPairColorizationOptions\n\t\t};\n\t}\n\n\tprivate _getEOL(resource: URI | undefined, language: string): string {\n\t\tif (resource) {\n\t\t\treturn this._resourcePropertiesService.getEOL(resource, language);\n\t\t}\n\t\tconst eol = this._configurationService.getValue('files.eol', { overrideIdentifier: language });\n\t\tif (eol && typeof eol === 'string' && eol !== 'auto') {\n\t\t\treturn eol;\n\t\t}\n\t\treturn platform.OS === platform.OperatingSystem.Linux || platform.OS === platform.OperatingSystem.Macintosh ? '\\n' : '\\r\\n';\n\t}\n\n\tprivate _shouldRestoreUndoStack(): boolean {\n\t\tconst result = this._configurationService.getValue('files.restoreUndoStack');\n\t\tif (typeof result === 'boolean') {\n\t\t\treturn result;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic getCreationOptions(language: string, resource: URI | undefined, isForSimpleWidget: boolean): ITextModelCreationOptions {\n\t\tlet creationOptions = this._modelCreationOptionsByLanguageAndResource[language + resource];\n\t\tif (!creationOptions) {\n\t\t\tconst editor = this._configurationService.getValue<IRawEditorConfig>('editor', { overrideIdentifier: language, resource });\n\t\t\tconst eol = this._getEOL(resource, language);\n\t\t\tcreationOptions = ModelService._readModelOptions({ editor, eol }, isForSimpleWidget);\n\t\t\tthis._modelCreationOptionsByLanguageAndResource[language + resource] = creationOptions;\n\t\t}\n\t\treturn creationOptions;\n\t}\n\n\tprivate _updateModelOptions(): void {\n\t\tconst oldOptionsByLanguageAndResource = this._modelCreationOptionsByLanguageAndResource;\n\t\tthis._modelCreationOptionsByLanguageAndResource = Object.create(null);\n\n\t\t// Update options on all models\n\t\tconst keys = Object.keys(this._models);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst modelId = keys[i];\n\t\t\tconst modelData = this._models[modelId];\n\t\t\tconst language = modelData.model.getLanguageId();\n\t\t\tconst uri = modelData.model.uri;\n\t\t\tconst oldOptions = oldOptionsByLanguageAndResource[language + uri];\n\t\t\tconst newOptions = this.getCreationOptions(language, uri, modelData.model.isForSimpleWidget);\n\t\t\tModelService._setModelOptionsForModel(modelData.model, newOptions, oldOptions);\n\t\t}\n\t}\n\n\tprivate static _setModelOptionsForModel(model: ITextModel, newOptions: ITextModelCreationOptions, currentOptions: ITextModelCreationOptions): void {\n\t\tif (currentOptions && currentOptions.defaultEOL !== newOptions.defaultEOL && model.getLineCount() === 1) {\n\t\t\tmodel.setEOL(newOptions.defaultEOL === DefaultEndOfLine.LF ? EndOfLineSequence.LF : EndOfLineSequence.CRLF);\n\t\t}\n\n\t\tif (currentOptions\n\t\t\t&& (currentOptions.detectIndentation === newOptions.detectIndentation)\n\t\t\t&& (currentOptions.insertSpaces === newOptions.insertSpaces)\n\t\t\t&& (currentOptions.tabSize === newOptions.tabSize)\n\t\t\t&& (currentOptions.indentSize === newOptions.indentSize)\n\t\t\t&& (currentOptions.trimAutoWhitespace === newOptions.trimAutoWhitespace)\n\t\t\t&& equals(currentOptions.bracketPairColorizationOptions, newOptions.bracketPairColorizationOptions)\n\t\t) {\n\t\t\t// Same indent opts, no need to touch the model\n\t\t\treturn;\n\t\t}\n\n\t\tif (newOptions.detectIndentation) {\n\t\t\tmodel.detectIndentation(newOptions.insertSpaces, newOptions.tabSize);\n\t\t\tmodel.updateOptions({\n\t\t\t\ttrimAutoWhitespace: newOptions.trimAutoWhitespace,\n\t\t\t\tbracketColorizationOptions: newOptions.bracketPairColorizationOptions\n\t\t\t});\n\t\t} else {\n\t\t\tmodel.updateOptions({\n\t\t\t\tinsertSpaces: newOptions.insertSpaces,\n\t\t\t\ttabSize: newOptions.tabSize,\n\t\t\t\tindentSize: newOptions.indentSize,\n\t\t\t\ttrimAutoWhitespace: newOptions.trimAutoWhitespace,\n\t\t\t\tbracketColorizationOptions: newOptions.bracketPairColorizationOptions\n\t\t\t});\n\t\t}\n\t}\n\n\t// --- begin IModelService\n\n\tprivate _insertDisposedModel(disposedModelData: DisposedModelInfo): void {\n\t\tthis._disposedModels.set(MODEL_ID(disposedModelData.uri), disposedModelData);\n\t\tthis._disposedModelsHeapSize += disposedModelData.heapSize;\n\t}\n\n\tprivate _removeDisposedModel(resource: URI): DisposedModelInfo | undefined {\n\t\tconst disposedModelData = this._disposedModels.get(MODEL_ID(resource));\n\t\tif (disposedModelData) {\n\t\t\tthis._disposedModelsHeapSize -= disposedModelData.heapSize;\n\t\t}\n\t\tthis._disposedModels.delete(MODEL_ID(resource));\n\t\treturn disposedModelData;\n\t}\n\n\tprivate _ensureDisposedModelsHeapSize(maxModelsHeapSize: number): void {\n\t\tif (this._disposedModelsHeapSize > maxModelsHeapSize) {\n\t\t\t// we must remove some old undo stack elements to free up some memory\n\t\t\tconst disposedModels: DisposedModelInfo[] = [];\n\t\t\tthis._disposedModels.forEach(entry => {\n\t\t\t\tif (!entry.sharesUndoRedoStack) {\n\t\t\t\t\tdisposedModels.push(entry);\n\t\t\t\t}\n\t\t\t});\n\t\t\tdisposedModels.sort((a, b) => a.time - b.time);\n\t\t\twhile (disposedModels.length > 0 && this._disposedModelsHeapSize > maxModelsHeapSize) {\n\t\t\t\tconst disposedModel = disposedModels.shift()!;\n\t\t\t\tthis._removeDisposedModel(disposedModel.uri);\n\t\t\t\tif (disposedModel.initialUndoRedoSnapshot !== null) {\n\t\t\t\t\tthis._undoRedoService.restoreSnapshot(disposedModel.initialUndoRedoSnapshot);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _createModelData(value: string | ITextBufferFactory, languageId: string, resource: URI | undefined, isForSimpleWidget: boolean): ModelData {\n\t\t// create & save the model\n\t\tconst options = this.getCreationOptions(languageId, resource, isForSimpleWidget);\n\t\tconst model: TextModel = new TextModel(\n\t\t\tvalue,\n\t\t\tlanguageId,\n\t\t\toptions,\n\t\t\tresource,\n\t\t\tthis._undoRedoService,\n\t\t\tthis._languageService,\n\t\t\tthis._languageConfigurationService,\n\t\t);\n\t\tif (resource && this._disposedModels.has(MODEL_ID(resource))) {\n\t\t\tconst disposedModelData = this._removeDisposedModel(resource)!;\n\t\t\tconst elements = this._undoRedoService.getElements(resource);\n\t\t\tconst sha1IsEqual = (computeModelSha1(model) === disposedModelData.sha1);\n\t\t\tif (sha1IsEqual || disposedModelData.sharesUndoRedoStack) {\n\t\t\t\tfor (const element of elements.past) {\n\t\t\t\t\tif (isEditStackElement(element) && element.matchesResource(resource)) {\n\t\t\t\t\t\telement.setModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const element of elements.future) {\n\t\t\t\t\tif (isEditStackElement(element) && element.matchesResource(resource)) {\n\t\t\t\t\t\telement.setModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._undoRedoService.setElementsValidFlag(resource, true, (element) => (isEditStackElement(element) && element.matchesResource(resource)));\n\t\t\t\tif (sha1IsEqual) {\n\t\t\t\t\tmodel._overwriteVersionId(disposedModelData.versionId);\n\t\t\t\t\tmodel._overwriteAlternativeVersionId(disposedModelData.alternativeVersionId);\n\t\t\t\t\tmodel._overwriteInitialUndoRedoSnapshot(disposedModelData.initialUndoRedoSnapshot);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (disposedModelData.initialUndoRedoSnapshot !== null) {\n\t\t\t\t\tthis._undoRedoService.restoreSnapshot(disposedModelData.initialUndoRedoSnapshot);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst modelId = MODEL_ID(model.uri);\n\n\t\tif (this._models[modelId]) {\n\t\t\t// There already exists a model with this id => this is a programmer error\n\t\t\tthrow new Error('ModelService: Cannot add model because it already exists!');\n\t\t}\n\n\t\tconst modelData = new ModelData(\n\t\t\tmodel,\n\t\t\t(model) => this._onWillDispose(model),\n\t\t\t(model, e) => this._onDidChangeLanguage(model, e)\n\t\t);\n\t\tthis._models[modelId] = modelData;\n\n\t\treturn modelData;\n\t}\n\n\tpublic createModel(value: string | ITextBufferFactory, languageSelection: ILanguageSelection | null, resource?: URI, isForSimpleWidget: boolean = false): ITextModel {\n\t\tlet modelData: ModelData;\n\n\t\tif (languageSelection) {\n\t\t\tmodelData = this._createModelData(value, languageSelection.languageId, resource, isForSimpleWidget);\n\t\t\tthis.setMode(modelData.model, languageSelection);\n\t\t} else {\n\t\t\tmodelData = this._createModelData(value, PLAINTEXT_LANGUAGE_ID, resource, isForSimpleWidget);\n\t\t}\n\n\t\tthis._onModelAdded.fire(modelData.model);\n\n\t\treturn modelData.model;\n\t}\n\n\tpublic setMode(model: ITextModel, languageSelection: ILanguageSelection): void {\n\t\tif (!languageSelection) {\n\t\t\treturn;\n\t\t}\n\t\tconst modelData = this._models[MODEL_ID(model.uri)];\n\t\tif (!modelData) {\n\t\t\treturn;\n\t\t}\n\t\tmodelData.setLanguage(languageSelection);\n\t}\n\n\tpublic getModels(): ITextModel[] {\n\t\tconst ret: ITextModel[] = [];\n\n\t\tconst keys = Object.keys(this._models);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst modelId = keys[i];\n\t\t\tret.push(this._models[modelId].model);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tpublic getModel(resource: URI): ITextModel | null {\n\t\tconst modelId = MODEL_ID(resource);\n\t\tconst modelData = this._models[modelId];\n\t\tif (!modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn modelData.model;\n\t}\n\n\tpublic getSemanticTokensProviderStyling(provider: DocumentTokensProvider): SemanticTokensProviderStyling {\n\t\treturn this._semanticStyling.get(provider);\n\t}\n\n\t// --- end IModelService\n\n\tprotected _schemaShouldMaintainUndoRedoElements(resource: URI) {\n\t\treturn (\n\t\t\tresource.scheme === Schemas.file\n\t\t\t|| resource.scheme === Schemas.vscodeRemote\n\t\t\t|| resource.scheme === Schemas.userData\n\t\t\t|| resource.scheme === Schemas.vscodeNotebookCell\n\t\t\t|| resource.scheme === 'fake-fs' // for tests\n\t\t);\n\t}\n\n\tprivate _onWillDispose(model: ITextModel): void {\n\t\tconst modelId = MODEL_ID(model.uri);\n\t\tconst modelData = this._models[modelId];\n\n\t\tconst sharesUndoRedoStack = (this._undoRedoService.getUriComparisonKey(model.uri) !== model.uri.toString());\n\t\tlet maintainUndoRedoStack = false;\n\t\tlet heapSize = 0;\n\t\tif (sharesUndoRedoStack || (this._shouldRestoreUndoStack() && this._schemaShouldMaintainUndoRedoElements(model.uri))) {\n\t\t\tconst elements = this._undoRedoService.getElements(model.uri);\n\t\t\tif (elements.past.length > 0 || elements.future.length > 0) {\n\t\t\t\tfor (const element of elements.past) {\n\t\t\t\t\tif (isEditStackElement(element) && element.matchesResource(model.uri)) {\n\t\t\t\t\t\tmaintainUndoRedoStack = true;\n\t\t\t\t\t\theapSize += element.heapSize(model.uri);\n\t\t\t\t\t\telement.setModel(model.uri); // remove reference from text buffer instance\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const element of elements.future) {\n\t\t\t\t\tif (isEditStackElement(element) && element.matchesResource(model.uri)) {\n\t\t\t\t\t\tmaintainUndoRedoStack = true;\n\t\t\t\t\t\theapSize += element.heapSize(model.uri);\n\t\t\t\t\t\telement.setModel(model.uri); // remove reference from text buffer instance\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst maxMemory = ModelService.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;\n\t\tif (!maintainUndoRedoStack) {\n\t\t\tif (!sharesUndoRedoStack) {\n\t\t\t\tconst initialUndoRedoSnapshot = modelData.model.getInitialUndoRedoSnapshot();\n\t\t\t\tif (initialUndoRedoSnapshot !== null) {\n\t\t\t\t\tthis._undoRedoService.restoreSnapshot(initialUndoRedoSnapshot);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!sharesUndoRedoStack && heapSize > maxMemory) {\n\t\t\t// the undo stack for this file would never fit in the configured memory, so don't bother with it.\n\t\t\tconst initialUndoRedoSnapshot = modelData.model.getInitialUndoRedoSnapshot();\n\t\t\tif (initialUndoRedoSnapshot !== null) {\n\t\t\t\tthis._undoRedoService.restoreSnapshot(initialUndoRedoSnapshot);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._ensureDisposedModelsHeapSize(maxMemory - heapSize);\n\t\t\t// We only invalidate the elements, but they remain in the undo-redo service.\n\t\t\tthis._undoRedoService.setElementsValidFlag(model.uri, false, (element) => (isEditStackElement(element) && element.matchesResource(model.uri)));\n\t\t\tthis._insertDisposedModel(new DisposedModelInfo(model.uri, modelData.model.getInitialUndoRedoSnapshot(), Date.now(), sharesUndoRedoStack, heapSize, computeModelSha1(model), model.getVersionId(), model.getAlternativeVersionId()));\n\t\t}\n\n\t\tdelete this._models[modelId];\n\t\tmodelData.dispose();\n\n\t\t// clean up cache\n\t\tdelete this._modelCreationOptionsByLanguageAndResource[model.getLanguageId() + model.uri];\n\n\t\tthis._onModelRemoved.fire(model);\n\t}\n\n\tprivate _onDidChangeLanguage(model: ITextModel, e: IModelLanguageChangedEvent): void {\n\t\tconst oldLanguageId = e.oldLanguage;\n\t\tconst newLanguageId = model.getLanguageId();\n\t\tconst oldOptions = this.getCreationOptions(oldLanguageId, model.uri, model.isForSimpleWidget);\n\t\tconst newOptions = this.getCreationOptions(newLanguageId, model.uri, model.isForSimpleWidget);\n\t\tModelService._setModelOptionsForModel(model, newOptions, oldOptions);\n\t\tthis._onModelModeChanged.fire({ model, oldLanguageId: oldLanguageId });\n\t}\n}\n\nexport const SEMANTIC_HIGHLIGHTING_SETTING_ID = 'editor.semanticHighlighting';\n\nexport function isSemanticColoringEnabled(model: ITextModel, themeService: IThemeService, configurationService: IConfigurationService): boolean {\n\tconst setting = configurationService.getValue<IEditorSemanticHighlightingOptions>(SEMANTIC_HIGHLIGHTING_SETTING_ID, { overrideIdentifier: model.getLanguageId(), resource: model.uri })?.enabled;\n\tif (typeof setting === 'boolean') {\n\t\treturn setting;\n\t}\n\treturn themeService.getColorTheme().semanticHighlighting;\n}\n\nclass SemanticColoringFeature extends Disposable {\n\n\tprivate readonly _watchers: Record<string, ModelSemanticColoring>;\n\tprivate readonly _semanticStyling: SemanticStyling;\n\n\tconstructor(\n\t\tsemanticStyling: SemanticStyling,\n\t\t@IModelService modelService: IModelService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\t\tthis._watchers = Object.create(null);\n\t\tthis._semanticStyling = semanticStyling;\n\n\t\tconst register = (model: ITextModel) => {\n\t\t\tthis._watchers[model.uri.toString()] = new ModelSemanticColoring(model, this._semanticStyling, themeService, languageFeatureDebounceService, languageFeaturesService);\n\t\t};\n\t\tconst deregister = (model: ITextModel, modelSemanticColoring: ModelSemanticColoring) => {\n\t\t\tmodelSemanticColoring.dispose();\n\t\t\tdelete this._watchers[model.uri.toString()];\n\t\t};\n\t\tconst handleSettingOrThemeChange = () => {\n\t\t\tfor (let model of modelService.getModels()) {\n\t\t\t\tconst curr = this._watchers[model.uri.toString()];\n\t\t\t\tif (isSemanticColoringEnabled(model, themeService, configurationService)) {\n\t\t\t\t\tif (!curr) {\n\t\t\t\t\t\tregister(model);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (curr) {\n\t\t\t\t\t\tderegister(model, curr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._register(modelService.onModelAdded((model) => {\n\t\t\tif (isSemanticColoringEnabled(model, themeService, configurationService)) {\n\t\t\t\tregister(model);\n\t\t\t}\n\t\t}));\n\t\tthis._register(modelService.onModelRemoved((model) => {\n\t\t\tconst curr = this._watchers[model.uri.toString()];\n\t\t\tif (curr) {\n\t\t\t\tderegister(model, curr);\n\t\t\t}\n\t\t}));\n\t\tthis._register(configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)) {\n\t\t\t\thandleSettingOrThemeChange();\n\t\t\t}\n\t\t}));\n\t\tthis._register(themeService.onDidColorThemeChange(handleSettingOrThemeChange));\n\t}\n}\n\nclass SemanticStyling extends Disposable {\n\n\tprivate _caches: WeakMap<DocumentTokensProvider, SemanticTokensProviderStyling>;\n\n\tconstructor(\n\t\tprivate readonly _themeService: IThemeService,\n\t\tprivate readonly _languageService: ILanguageService,\n\t\tprivate readonly _logService: ILogService\n\t) {\n\t\tsuper();\n\t\tthis._caches = new WeakMap<DocumentTokensProvider, SemanticTokensProviderStyling>();\n\t\tthis._register(this._themeService.onDidColorThemeChange(() => {\n\t\t\tthis._caches = new WeakMap<DocumentTokensProvider, SemanticTokensProviderStyling>();\n\t\t}));\n\t}\n\n\tpublic get(provider: DocumentTokensProvider): SemanticTokensProviderStyling {\n\t\tif (!this._caches.has(provider)) {\n\t\t\tthis._caches.set(provider, new SemanticTokensProviderStyling(provider.getLegend(), this._themeService, this._languageService, this._logService));\n\t\t}\n\t\treturn this._caches.get(provider)!;\n\t}\n}\n\nclass SemanticTokensResponse {\n\tconstructor(\n\t\tpublic readonly provider: DocumentSemanticTokensProvider,\n\t\tpublic readonly resultId: string | undefined,\n\t\tpublic readonly data: Uint32Array\n\t) { }\n\n\tpublic dispose(): void {\n\t\tthis.provider.releaseDocumentSemanticTokens(this.resultId);\n\t}\n}\n\nexport class ModelSemanticColoring extends Disposable {\n\n\tpublic static REQUEST_MIN_DELAY = 300;\n\tpublic static REQUEST_MAX_DELAY = 2000;\n\n\tprivate _isDisposed: boolean;\n\tprivate readonly _model: ITextModel;\n\tprivate readonly _semanticStyling: SemanticStyling;\n\tprivate readonly _provider: LanguageFeatureRegistry<DocumentSemanticTokensProvider>;\n\tprivate readonly _debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly _fetchDocumentSemanticTokens: RunOnceScheduler;\n\tprivate _currentDocumentResponse: SemanticTokensResponse | null;\n\tprivate _currentDocumentRequestCancellationTokenSource: CancellationTokenSource | null;\n\tprivate _documentProvidersChangeListeners: IDisposable[];\n\n\tconstructor(\n\t\tmodel: ITextModel,\n\t\tstylingProvider: SemanticStyling,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\n\t\tthis._isDisposed = false;\n\t\tthis._model = model;\n\t\tthis._semanticStyling = stylingProvider;\n\t\tthis._provider = languageFeaturesService.documentSemanticTokensProvider;\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(this._provider, 'DocumentSemanticTokens', { min: ModelSemanticColoring.REQUEST_MIN_DELAY, max: ModelSemanticColoring.REQUEST_MAX_DELAY });\n\t\tthis._fetchDocumentSemanticTokens = this._register(new RunOnceScheduler(() => this._fetchDocumentSemanticTokensNow(), ModelSemanticColoring.REQUEST_MIN_DELAY));\n\t\tthis._currentDocumentResponse = null;\n\t\tthis._currentDocumentRequestCancellationTokenSource = null;\n\t\tthis._documentProvidersChangeListeners = [];\n\n\t\tthis._register(this._model.onDidChangeContent(() => {\n\t\t\tif (!this._fetchDocumentSemanticTokens.isScheduled()) {\n\t\t\t\tthis._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._model.onDidChangeLanguage(() => {\n\t\t\t// clear any outstanding state\n\t\t\tif (this._currentDocumentResponse) {\n\t\t\t\tthis._currentDocumentResponse.dispose();\n\t\t\t\tthis._currentDocumentResponse = null;\n\t\t\t}\n\t\t\tif (this._currentDocumentRequestCancellationTokenSource) {\n\t\t\t\tthis._currentDocumentRequestCancellationTokenSource.cancel();\n\t\t\t\tthis._currentDocumentRequestCancellationTokenSource = null;\n\t\t\t}\n\t\t\tthis._setDocumentSemanticTokens(null, null, null, []);\n\t\t\tthis._fetchDocumentSemanticTokens.schedule(0);\n\t\t}));\n\n\t\tconst bindDocumentChangeListeners = () => {\n\t\t\tdispose(this._documentProvidersChangeListeners);\n\t\t\tthis._documentProvidersChangeListeners = [];\n\t\t\tfor (const provider of this._provider.all(model)) {\n\t\t\t\tif (typeof provider.onDidChange === 'function') {\n\t\t\t\t\tthis._documentProvidersChangeListeners.push(provider.onDidChange(() => this._fetchDocumentSemanticTokens.schedule(0)));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tbindDocumentChangeListeners();\n\t\tthis._register(this._provider.onDidChange(() => {\n\t\t\tbindDocumentChangeListeners();\n\t\t\tthis._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));\n\t\t}));\n\n\t\tthis._register(themeService.onDidColorThemeChange(_ => {\n\t\t\t// clear out existing tokens\n\t\t\tthis._setDocumentSemanticTokens(null, null, null, []);\n\t\t\tthis._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));\n\t\t}));\n\n\t\tthis._fetchDocumentSemanticTokens.schedule(0);\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._currentDocumentResponse) {\n\t\t\tthis._currentDocumentResponse.dispose();\n\t\t\tthis._currentDocumentResponse = null;\n\t\t}\n\t\tif (this._currentDocumentRequestCancellationTokenSource) {\n\t\t\tthis._currentDocumentRequestCancellationTokenSource.cancel();\n\t\t\tthis._currentDocumentRequestCancellationTokenSource = null;\n\t\t}\n\t\tthis._setDocumentSemanticTokens(null, null, null, []);\n\t\tthis._isDisposed = true;\n\n\t\tsuper.dispose();\n\t}\n\n\tprivate _fetchDocumentSemanticTokensNow(): void {\n\t\tif (this._currentDocumentRequestCancellationTokenSource) {\n\t\t\t// there is already a request running, let it finish...\n\t\t\treturn;\n\t\t}\n\n\t\tif (!hasDocumentSemanticTokensProvider(this._provider, this._model)) {\n\t\t\t// there is no provider\n\t\t\tif (this._currentDocumentResponse) {\n\t\t\t\t// there are semantic tokens set\n\t\t\t\tthis._model.setSemanticTokens(null, false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst cancellationTokenSource = new CancellationTokenSource();\n\t\tconst lastProvider = this._currentDocumentResponse ? this._currentDocumentResponse.provider : null;\n\t\tconst lastResultId = this._currentDocumentResponse ? this._currentDocumentResponse.resultId || null : null;\n\t\tconst request = getDocumentSemanticTokens(this._provider, this._model, lastProvider, lastResultId, cancellationTokenSource.token);\n\t\tthis._currentDocumentRequestCancellationTokenSource = cancellationTokenSource;\n\n\t\tconst pendingChanges: IModelContentChangedEvent[] = [];\n\t\tconst contentChangeListener = this._model.onDidChangeContent((e) => {\n\t\t\tpendingChanges.push(e);\n\t\t});\n\n\t\tconst sw = new StopWatch(false);\n\t\trequest.then((res) => {\n\t\t\tthis._debounceInformation.update(this._model, sw.elapsed());\n\t\t\tthis._currentDocumentRequestCancellationTokenSource = null;\n\t\t\tcontentChangeListener.dispose();\n\n\t\t\tif (!res) {\n\t\t\t\tthis._setDocumentSemanticTokens(null, null, null, pendingChanges);\n\t\t\t} else {\n\t\t\t\tconst { provider, tokens } = res;\n\t\t\t\tconst styling = this._semanticStyling.get(provider);\n\t\t\t\tthis._setDocumentSemanticTokens(provider, tokens || null, styling, pendingChanges);\n\t\t\t}\n\t\t}, (err) => {\n\t\t\tconst isExpectedError = err && (errors.isCancellationError(err) || (typeof err.message === 'string' && err.message.indexOf('busy') !== -1));\n\t\t\tif (!isExpectedError) {\n\t\t\t\terrors.onUnexpectedError(err);\n\t\t\t}\n\n\t\t\t// Semantic tokens eats up all errors and considers errors to mean that the result is temporarily not available\n\t\t\t// The API does not have a special error kind to express this...\n\t\t\tthis._currentDocumentRequestCancellationTokenSource = null;\n\t\t\tcontentChangeListener.dispose();\n\n\t\t\tif (pendingChanges.length > 0) {\n\t\t\t\t// More changes occurred while the request was running\n\t\t\t\tif (!this._fetchDocumentSemanticTokens.isScheduled()) {\n\t\t\t\t\tthis._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate static _copy(src: Uint32Array, srcOffset: number, dest: Uint32Array, destOffset: number, length: number): void {\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdest[destOffset + i] = src[srcOffset + i];\n\t\t}\n\t}\n\n\tprivate _setDocumentSemanticTokens(provider: DocumentSemanticTokensProvider | null, tokens: SemanticTokens | SemanticTokensEdits | null, styling: SemanticTokensProviderStyling | null, pendingChanges: IModelContentChangedEvent[]): void {\n\t\tconst currentResponse = this._currentDocumentResponse;\n\t\tconst rescheduleIfNeeded = () => {\n\t\t\tif (pendingChanges.length > 0 && !this._fetchDocumentSemanticTokens.isScheduled()) {\n\t\t\t\tthis._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));\n\t\t\t}\n\t\t};\n\n\t\tif (this._currentDocumentResponse) {\n\t\t\tthis._currentDocumentResponse.dispose();\n\t\t\tthis._currentDocumentResponse = null;\n\t\t}\n\t\tif (this._isDisposed) {\n\t\t\t// disposed!\n\t\t\tif (provider && tokens) {\n\t\t\t\tprovider.releaseDocumentSemanticTokens(tokens.resultId);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (!provider || !styling) {\n\t\t\tthis._model.setSemanticTokens(null, false);\n\t\t\treturn;\n\t\t}\n\t\tif (!tokens) {\n\t\t\tthis._model.setSemanticTokens(null, true);\n\t\t\trescheduleIfNeeded();\n\t\t\treturn;\n\t\t}\n\n\t\tif (isSemanticTokensEdits(tokens)) {\n\t\t\tif (!currentResponse) {\n\t\t\t\t// not possible!\n\t\t\t\tthis._model.setSemanticTokens(null, true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (tokens.edits.length === 0) {\n\t\t\t\t// nothing to do!\n\t\t\t\ttokens = {\n\t\t\t\t\tresultId: tokens.resultId,\n\t\t\t\t\tdata: currentResponse.data\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tlet deltaLength = 0;\n\t\t\t\tfor (const edit of tokens.edits) {\n\t\t\t\t\tdeltaLength += (edit.data ? edit.data.length : 0) - edit.deleteCount;\n\t\t\t\t}\n\n\t\t\t\tconst srcData = currentResponse.data;\n\t\t\t\tconst destData = new Uint32Array(srcData.length + deltaLength);\n\n\t\t\t\tlet srcLastStart = srcData.length;\n\t\t\t\tlet destLastStart = destData.length;\n\t\t\t\tfor (let i = tokens.edits.length - 1; i >= 0; i--) {\n\t\t\t\t\tconst edit = tokens.edits[i];\n\n\t\t\t\t\tconst copyCount = srcLastStart - (edit.start + edit.deleteCount);\n\t\t\t\t\tif (copyCount > 0) {\n\t\t\t\t\t\tModelSemanticColoring._copy(srcData, srcLastStart - copyCount, destData, destLastStart - copyCount, copyCount);\n\t\t\t\t\t\tdestLastStart -= copyCount;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (edit.data) {\n\t\t\t\t\t\tModelSemanticColoring._copy(edit.data, 0, destData, destLastStart - edit.data.length, edit.data.length);\n\t\t\t\t\t\tdestLastStart -= edit.data.length;\n\t\t\t\t\t}\n\n\t\t\t\t\tsrcLastStart = edit.start;\n\t\t\t\t}\n\n\t\t\t\tif (srcLastStart > 0) {\n\t\t\t\t\tModelSemanticColoring._copy(srcData, 0, destData, 0, srcLastStart);\n\t\t\t\t}\n\n\t\t\t\ttokens = {\n\t\t\t\t\tresultId: tokens.resultId,\n\t\t\t\t\tdata: destData\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif (isSemanticTokens(tokens)) {\n\n\t\t\tthis._currentDocumentResponse = new SemanticTokensResponse(provider, tokens.resultId, tokens.data);\n\n\t\t\tconst result = toMultilineTokens2(tokens, styling, this._model.getLanguageId());\n\n\t\t\t// Adjust incoming semantic tokens\n\t\t\tif (pendingChanges.length > 0) {\n\t\t\t\t// More changes occurred while the request was running\n\t\t\t\t// We need to:\n\t\t\t\t// 1. Adjust incoming semantic tokens\n\t\t\t\t// 2. Request them again\n\t\t\t\tfor (const change of pendingChanges) {\n\t\t\t\t\tfor (const area of result) {\n\t\t\t\t\t\tfor (const singleChange of change.changes) {\n\t\t\t\t\t\t\tarea.applyEdit(singleChange.range, singleChange.text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._model.setSemanticTokens(result, true);\n\t\t} else {\n\t\t\tthis._model.setSemanticTokens(null, true);\n\t\t}\n\n\t\trescheduleIfNeeded();\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration, IModelDeltaDecoration, ITextModel, PositionAffinity } from 'vs/editor/common/model';\nimport { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide, IndentGuideHorizontalLine } from 'vs/editor/common/textModelGuides';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { LineInjectedText } from 'vs/editor/common/textModelEvents';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { createModelLineProjection, IModelLineProjection } from 'vs/editor/common/viewModel/modelLineProjection';\nimport { ILineBreaksComputer, ModelLineProjectionData, InjectedText, ILineBreaksComputerFactory } from 'vs/editor/common/modelLineProjectionData';\nimport { ConstantTimePrefixSumComputer } from 'vs/editor/common/model/prefixSumComputer';\nimport { ICoordinatesConverter, ViewLineData } from 'vs/editor/common/viewModel';\n\nexport interface IViewModelLines extends IDisposable {\n\tcreateCoordinatesConverter(): ICoordinatesConverter;\n\n\tsetWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean;\n\tsetTabSize(newTabSize: number): boolean;\n\tgetHiddenAreas(): Range[];\n\tsetHiddenAreas(_ranges: Range[]): boolean;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\tonModelFlushed(): void;\n\tonModelLinesDeleted(versionId: number | null, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null;\n\tonModelLinesInserted(versionId: number | null, fromLineNumber: number, toLineNumber: number, lineBreaks: (ModelLineProjectionData | null)[]): viewEvents.ViewLinesInsertedEvent | null;\n\tonModelLineChanged(versionId: number | null, lineNumber: number, lineBreakData: ModelLineProjectionData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null];\n\tacceptVersionId(versionId: number): void;\n\n\tgetViewLineCount(): number;\n\tgetActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[];\n\tgetViewLinesBracketGuides(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetViewLineContent(viewLineNumber: number): string;\n\tgetViewLineLength(viewLineNumber: number): number;\n\tgetViewLineMinColumn(viewLineNumber: number): number;\n\tgetViewLineMaxColumn(viewLineNumber: number): number;\n\tgetViewLineData(viewLineNumber: number): ViewLineData;\n\tgetViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): Array<ViewLineData | null>;\n\n\tgetDecorationsInRange(range: Range, ownerId: number, filterOutValidation: boolean): IModelDecoration[];\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t*/\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport class ViewModelLinesFromProjectedModel implements IViewModelLines {\n\tprivate readonly _editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate _validModelVersionId: number;\n\n\tprivate readonly _domLineBreaksComputerFactory: ILineBreaksComputerFactory;\n\tprivate readonly _monospaceLineBreaksComputerFactory: ILineBreaksComputerFactory;\n\n\tprivate fontInfo: FontInfo;\n\tprivate tabSize: number;\n\tprivate wrappingColumn: number;\n\tprivate wrappingIndent: WrappingIndent;\n\tprivate wrappingStrategy: 'simple' | 'advanced';\n\n\tprivate modelLineProjections!: IModelLineProjection[];\n\n\t/**\n\t * Reflects the sum of the line counts of all projected model lines.\n\t*/\n\tprivate projectedModelLineLineCounts!: ConstantTimePrefixSumComputer;\n\n\tprivate hiddenAreasDecorationIds!: string[];\n\n\tconstructor(\n\t\teditorId: number,\n\t\tmodel: ITextModel,\n\t\tdomLineBreaksComputerFactory: ILineBreaksComputerFactory,\n\t\tmonospaceLineBreaksComputerFactory: ILineBreaksComputerFactory,\n\t\tfontInfo: FontInfo,\n\t\ttabSize: number,\n\t\twrappingStrategy: 'simple' | 'advanced',\n\t\twrappingColumn: number,\n\t\twrappingIndent: WrappingIndent,\n\t) {\n\t\tthis._editorId = editorId;\n\t\tthis.model = model;\n\t\tthis._validModelVersionId = -1;\n\t\tthis._domLineBreaksComputerFactory = domLineBreaksComputerFactory;\n\t\tthis._monospaceLineBreaksComputerFactory = monospaceLineBreaksComputerFactory;\n\t\tthis.fontInfo = fontInfo;\n\t\tthis.tabSize = tabSize;\n\t\tthis.wrappingStrategy = wrappingStrategy;\n\t\tthis.wrappingColumn = wrappingColumn;\n\t\tthis.wrappingIndent = wrappingIndent;\n\n\t\tthis._constructLines(/*resetHiddenAreas*/true, null);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []);\n\t}\n\n\tpublic createCoordinatesConverter(): ICoordinatesConverter {\n\t\treturn new CoordinatesConverter(this);\n\t}\n\n\tprivate _constructLines(resetHiddenAreas: boolean, previousLineBreaks: ((ModelLineProjectionData | null)[]) | null): void {\n\t\tthis.modelLineProjections = [];\n\n\t\tif (resetHiddenAreas) {\n\t\t\tthis.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []);\n\t\t}\n\n\t\tconst linesContent = this.model.getLinesContent();\n\t\tconst injectedTextDecorations = this.model.getInjectedTextDecorations(this._editorId);\n\t\tconst lineCount = linesContent.length;\n\t\tconst lineBreaksComputer = this.createLineBreaksComputer();\n\n\t\tconst injectedTextQueue = new arrays.ArrayQueue(LineInjectedText.fromDecorations(injectedTextDecorations));\n\t\tfor (let i = 0; i < lineCount; i++) {\n\t\t\tconst lineInjectedText = injectedTextQueue.takeWhile(t => t.lineNumber === i + 1);\n\t\t\tlineBreaksComputer.addRequest(linesContent[i], lineInjectedText, previousLineBreaks ? previousLineBreaks[i] : null);\n\t\t}\n\t\tconst linesBreaks = lineBreaksComputer.finalize();\n\n\t\tconst values: number[] = [];\n\n\t\tconst hiddenAreas = this.hiddenAreasDecorationIds.map((areaId) => this.model.getDecorationRange(areaId)!).sort(Range.compareRangesUsingStarts);\n\t\tlet hiddenAreaStart = 1, hiddenAreaEnd = 0;\n\t\tlet hiddenAreaIdx = -1;\n\t\tlet nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2;\n\n\t\tfor (let i = 0; i < lineCount; i++) {\n\t\t\tconst lineNumber = i + 1;\n\n\t\t\tif (lineNumber === nextLineNumberToUpdateHiddenArea) {\n\t\t\t\thiddenAreaIdx++;\n\t\t\t\thiddenAreaStart = hiddenAreas[hiddenAreaIdx]!.startLineNumber;\n\t\t\t\thiddenAreaEnd = hiddenAreas[hiddenAreaIdx]!.endLineNumber;\n\t\t\t\tnextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2;\n\t\t\t}\n\n\t\t\tconst isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd);\n\t\t\tconst line = createModelLineProjection(linesBreaks[i], !isInHiddenArea);\n\t\t\tvalues[i] = line.getViewLineCount();\n\t\t\tthis.modelLineProjections[i] = line;\n\t\t}\n\n\t\tthis._validModelVersionId = this.model.getVersionId();\n\n\t\tthis.projectedModelLineLineCounts = new ConstantTimePrefixSumComputer(values);\n\t}\n\n\tpublic getHiddenAreas(): Range[] {\n\t\treturn this.hiddenAreasDecorationIds.map(\n\t\t\t(decId) => this.model.getDecorationRange(decId)!\n\t\t);\n\t}\n\n\tpublic setHiddenAreas(_ranges: Range[]): boolean {\n\t\tconst validatedRanges = _ranges.map(r => this.model.validateRange(r));\n\t\tconst newRanges = normalizeLineRanges(validatedRanges);\n\n\t\t// TODO@Martin: Please stop calling this method on each model change!\n\n\t\t// This checks if there really was a change\n\t\tconst oldRanges = this.hiddenAreasDecorationIds.map((areaId) => this.model.getDecorationRange(areaId)!).sort(Range.compareRangesUsingStarts);\n\t\tif (newRanges.length === oldRanges.length) {\n\t\t\tlet hasDifference = false;\n\t\t\tfor (let i = 0; i < newRanges.length; i++) {\n\t\t\t\tif (!newRanges[i].equalsRange(oldRanges[i])) {\n\t\t\t\t\thasDifference = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!hasDifference) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tconst newDecorations = newRanges.map<IModelDeltaDecoration>(\n\t\t\t(r) =>\n\t\t\t({\n\t\t\t\trange: r,\n\t\t\t\toptions: ModelDecorationOptions.EMPTY,\n\t\t\t})\n\t\t);\n\n\t\tthis.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, newDecorations);\n\n\t\tconst hiddenAreas = newRanges;\n\t\tlet hiddenAreaStart = 1, hiddenAreaEnd = 0;\n\t\tlet hiddenAreaIdx = -1;\n\t\tlet nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.modelLineProjections.length + 2;\n\n\t\tlet hasVisibleLine = false;\n\t\tfor (let i = 0; i < this.modelLineProjections.length; i++) {\n\t\t\tconst lineNumber = i + 1;\n\n\t\t\tif (lineNumber === nextLineNumberToUpdateHiddenArea) {\n\t\t\t\thiddenAreaIdx++;\n\t\t\t\thiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber;\n\t\t\t\thiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber;\n\t\t\t\tnextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.modelLineProjections.length + 2;\n\t\t\t}\n\n\t\t\tlet lineChanged = false;\n\t\t\tif (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd) {\n\t\t\t\t// Line should be hidden\n\t\t\t\tif (this.modelLineProjections[i].isVisible()) {\n\t\t\t\t\tthis.modelLineProjections[i] = this.modelLineProjections[i].setVisible(false);\n\t\t\t\t\tlineChanged = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thasVisibleLine = true;\n\t\t\t\t// Line should be visible\n\t\t\t\tif (!this.modelLineProjections[i].isVisible()) {\n\t\t\t\t\tthis.modelLineProjections[i] = this.modelLineProjections[i].setVisible(true);\n\t\t\t\t\tlineChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lineChanged) {\n\t\t\t\tconst newOutputLineCount = this.modelLineProjections[i].getViewLineCount();\n\t\t\t\tthis.projectedModelLineLineCounts.setValue(i, newOutputLineCount);\n\t\t\t}\n\t\t}\n\n\t\tif (!hasVisibleLine) {\n\t\t\t// Cannot have everything be hidden => reveal everything!\n\t\t\tthis.setHiddenAreas([]);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic modelPositionIsVisible(modelLineNumber: number, _modelColumn: number): boolean {\n\t\tif (modelLineNumber < 1 || modelLineNumber > this.modelLineProjections.length) {\n\t\t\t// invalid arguments\n\t\t\treturn false;\n\t\t}\n\t\treturn this.modelLineProjections[modelLineNumber - 1].isVisible();\n\t}\n\n\tpublic getModelLineViewLineCount(modelLineNumber: number): number {\n\t\tif (modelLineNumber < 1 || modelLineNumber > this.modelLineProjections.length) {\n\t\t\t// invalid arguments\n\t\t\treturn 1;\n\t\t}\n\t\treturn this.modelLineProjections[modelLineNumber - 1].getViewLineCount();\n\t}\n\n\tpublic setTabSize(newTabSize: number): boolean {\n\t\tif (this.tabSize === newTabSize) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.tabSize = newTabSize;\n\n\t\tthis._constructLines(/*resetHiddenAreas*/false, null);\n\n\t\treturn true;\n\t}\n\n\tpublic setWrappingSettings(fontInfo: FontInfo, wrappingStrategy: 'simple' | 'advanced', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean {\n\t\tconst equalFontInfo = this.fontInfo.equals(fontInfo);\n\t\tconst equalWrappingStrategy = (this.wrappingStrategy === wrappingStrategy);\n\t\tconst equalWrappingColumn = (this.wrappingColumn === wrappingColumn);\n\t\tconst equalWrappingIndent = (this.wrappingIndent === wrappingIndent);\n\t\tif (equalFontInfo && equalWrappingStrategy && equalWrappingColumn && equalWrappingIndent) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst onlyWrappingColumnChanged = (equalFontInfo && equalWrappingStrategy && !equalWrappingColumn && equalWrappingIndent);\n\n\t\tthis.fontInfo = fontInfo;\n\t\tthis.wrappingStrategy = wrappingStrategy;\n\t\tthis.wrappingColumn = wrappingColumn;\n\t\tthis.wrappingIndent = wrappingIndent;\n\n\t\tlet previousLineBreaks: ((ModelLineProjectionData | null)[]) | null = null;\n\t\tif (onlyWrappingColumnChanged) {\n\t\t\tpreviousLineBreaks = [];\n\t\t\tfor (let i = 0, len = this.modelLineProjections.length; i < len; i++) {\n\t\t\t\tpreviousLineBreaks[i] = this.modelLineProjections[i].getProjectionData();\n\t\t\t}\n\t\t}\n\n\t\tthis._constructLines(/*resetHiddenAreas*/false, previousLineBreaks);\n\n\t\treturn true;\n\t}\n\n\tpublic createLineBreaksComputer(): ILineBreaksComputer {\n\t\tconst lineBreaksComputerFactory = (\n\t\t\tthis.wrappingStrategy === 'advanced'\n\t\t\t\t? this._domLineBreaksComputerFactory\n\t\t\t\t: this._monospaceLineBreaksComputerFactory\n\t\t);\n\t\treturn lineBreaksComputerFactory.createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent);\n\t}\n\n\tpublic onModelFlushed(): void {\n\t\tthis._constructLines(/*resetHiddenAreas*/true, null);\n\t}\n\n\tpublic onModelLinesDeleted(versionId: number | null, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null {\n\t\tif (!versionId || versionId <= this._validModelVersionId) {\n\t\t\t// Here we check for versionId in case the lines were reconstructed in the meantime.\n\t\t\t// We don't want to apply stale change events on top of a newer read model state.\n\t\t\treturn null;\n\t\t}\n\n\t\tconst outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(fromLineNumber - 1) + 1);\n\t\tconst outputToLineNumber = this.projectedModelLineLineCounts.getPrefixSum(toLineNumber);\n\n\t\tthis.modelLineProjections.splice(fromLineNumber - 1, toLineNumber - fromLineNumber + 1);\n\t\tthis.projectedModelLineLineCounts.removeValues(fromLineNumber - 1, toLineNumber - fromLineNumber + 1);\n\n\t\treturn new viewEvents.ViewLinesDeletedEvent(outputFromLineNumber, outputToLineNumber);\n\t}\n\n\tpublic onModelLinesInserted(versionId: number | null, fromLineNumber: number, _toLineNumber: number, lineBreaks: (ModelLineProjectionData | null)[]): viewEvents.ViewLinesInsertedEvent | null {\n\t\tif (!versionId || versionId <= this._validModelVersionId) {\n\t\t\t// Here we check for versionId in case the lines were reconstructed in the meantime.\n\t\t\t// We don't want to apply stale change events on top of a newer read model state.\n\t\t\treturn null;\n\t\t}\n\n\t\t// cannot use this.getHiddenAreas() because those decorations have already seen the effect of this model change\n\t\tconst isInHiddenArea = (fromLineNumber > 2 && !this.modelLineProjections[fromLineNumber - 2].isVisible());\n\n\t\tconst outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(fromLineNumber - 1) + 1);\n\n\t\tlet totalOutputLineCount = 0;\n\t\tconst insertLines: IModelLineProjection[] = [];\n\t\tconst insertPrefixSumValues: number[] = [];\n\n\t\tfor (let i = 0, len = lineBreaks.length; i < len; i++) {\n\t\t\tconst line = createModelLineProjection(lineBreaks[i], !isInHiddenArea);\n\t\t\tinsertLines.push(line);\n\n\t\t\tconst outputLineCount = line.getViewLineCount();\n\t\t\ttotalOutputLineCount += outputLineCount;\n\t\t\tinsertPrefixSumValues[i] = outputLineCount;\n\t\t}\n\n\t\t// TODO@Alex: use arrays.arrayInsert\n\t\tthis.modelLineProjections =\n\t\t\tthis.modelLineProjections.slice(0, fromLineNumber - 1)\n\t\t\t\t.concat(insertLines)\n\t\t\t\t.concat(this.modelLineProjections.slice(fromLineNumber - 1));\n\n\t\tthis.projectedModelLineLineCounts.insertValues(fromLineNumber - 1, insertPrefixSumValues);\n\n\t\treturn new viewEvents.ViewLinesInsertedEvent(outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1);\n\t}\n\n\tpublic onModelLineChanged(versionId: number | null, lineNumber: number, lineBreakData: ModelLineProjectionData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] {\n\t\tif (versionId !== null && versionId <= this._validModelVersionId) {\n\t\t\t// Here we check for versionId in case the lines were reconstructed in the meantime.\n\t\t\t// We don't want to apply stale change events on top of a newer read model state.\n\t\t\treturn [false, null, null, null];\n\t\t}\n\n\t\tconst lineIndex = lineNumber - 1;\n\n\t\tconst oldOutputLineCount = this.modelLineProjections[lineIndex].getViewLineCount();\n\t\tconst isVisible = this.modelLineProjections[lineIndex].isVisible();\n\t\tconst line = createModelLineProjection(lineBreakData, isVisible);\n\t\tthis.modelLineProjections[lineIndex] = line;\n\t\tconst newOutputLineCount = this.modelLineProjections[lineIndex].getViewLineCount();\n\n\t\tlet lineMappingChanged = false;\n\t\tlet changeFrom = 0;\n\t\tlet changeTo = -1;\n\t\tlet insertFrom = 0;\n\t\tlet insertTo = -1;\n\t\tlet deleteFrom = 0;\n\t\tlet deleteTo = -1;\n\n\t\tif (oldOutputLineCount > newOutputLineCount) {\n\t\t\tchangeFrom = this.projectedModelLineLineCounts.getPrefixSum(lineNumber - 1) + 1;\n\t\t\tchangeTo = changeFrom + newOutputLineCount - 1;\n\t\t\tdeleteFrom = changeTo + 1;\n\t\t\tdeleteTo = deleteFrom + (oldOutputLineCount - newOutputLineCount) - 1;\n\t\t\tlineMappingChanged = true;\n\t\t} else if (oldOutputLineCount < newOutputLineCount) {\n\t\t\tchangeFrom = this.projectedModelLineLineCounts.getPrefixSum(lineNumber - 1) + 1;\n\t\t\tchangeTo = changeFrom + oldOutputLineCount - 1;\n\t\t\tinsertFrom = changeTo + 1;\n\t\t\tinsertTo = insertFrom + (newOutputLineCount - oldOutputLineCount) - 1;\n\t\t\tlineMappingChanged = true;\n\t\t} else {\n\t\t\tchangeFrom = this.projectedModelLineLineCounts.getPrefixSum(lineNumber - 1) + 1;\n\t\t\tchangeTo = changeFrom + newOutputLineCount - 1;\n\t\t}\n\n\t\tthis.projectedModelLineLineCounts.setValue(lineIndex, newOutputLineCount);\n\n\t\tconst viewLinesChangedEvent = (changeFrom <= changeTo ? new viewEvents.ViewLinesChangedEvent(changeFrom, changeTo) : null);\n\t\tconst viewLinesInsertedEvent = (insertFrom <= insertTo ? new viewEvents.ViewLinesInsertedEvent(insertFrom, insertTo) : null);\n\t\tconst viewLinesDeletedEvent = (deleteFrom <= deleteTo ? new viewEvents.ViewLinesDeletedEvent(deleteFrom, deleteTo) : null);\n\n\t\treturn [lineMappingChanged, viewLinesChangedEvent, viewLinesInsertedEvent, viewLinesDeletedEvent];\n\t}\n\n\tpublic acceptVersionId(versionId: number): void {\n\t\tthis._validModelVersionId = versionId;\n\t\tif (this.modelLineProjections.length === 1 && !this.modelLineProjections[0].isVisible()) {\n\t\t\t// At least one line must be visible => reset hidden areas\n\t\t\tthis.setHiddenAreas([]);\n\t\t}\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\treturn this.projectedModelLineLineCounts.getTotalSum();\n\t}\n\n\tprivate _toValidViewLineNumber(viewLineNumber: number): number {\n\t\tif (viewLineNumber < 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tconst viewLineCount = this.getViewLineCount();\n\t\tif (viewLineNumber > viewLineCount) {\n\t\t\treturn viewLineCount;\n\t\t}\n\t\treturn viewLineNumber | 0;\n\t}\n\n\tpublic getActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo {\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tminLineNumber = this._toValidViewLineNumber(minLineNumber);\n\t\tmaxLineNumber = this._toValidViewLineNumber(maxLineNumber);\n\n\t\tconst modelPosition = this.convertViewPositionToModelPosition(viewLineNumber, this.getViewLineMinColumn(viewLineNumber));\n\t\tconst modelMinPosition = this.convertViewPositionToModelPosition(minLineNumber, this.getViewLineMinColumn(minLineNumber));\n\t\tconst modelMaxPosition = this.convertViewPositionToModelPosition(maxLineNumber, this.getViewLineMinColumn(maxLineNumber));\n\t\tconst result = this.model.guides.getActiveIndentGuide(modelPosition.lineNumber, modelMinPosition.lineNumber, modelMaxPosition.lineNumber);\n\n\t\tconst viewStartPosition = this.convertModelPositionToViewPosition(result.startLineNumber, 1);\n\t\tconst viewEndPosition = this.convertModelPositionToViewPosition(result.endLineNumber, this.model.getLineMaxColumn(result.endLineNumber));\n\t\treturn {\n\t\t\tstartLineNumber: viewStartPosition.lineNumber,\n\t\t\tendLineNumber: viewEndPosition.lineNumber,\n\t\t\tindent: result.indent\n\t\t};\n\t}\n\n\t// #region ViewLineInfo\n\n\tprivate getViewLineInfo(viewLineNumber: number): ViewLineInfo {\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tconst r = this.projectedModelLineLineCounts.getIndexOf(viewLineNumber - 1);\n\t\tconst lineIndex = r.index;\n\t\tconst remainder = r.remainder;\n\t\treturn new ViewLineInfo(lineIndex + 1, remainder);\n\t}\n\n\tprivate getMinColumnOfViewLine(viewLineInfo: ViewLineInfo): number {\n\t\treturn this.modelLineProjections[viewLineInfo.modelLineNumber - 1].getViewLineMinColumn(\n\t\t\tthis.model,\n\t\t\tviewLineInfo.modelLineNumber,\n\t\t\tviewLineInfo.modelLineWrappedLineIdx\n\t\t);\n\t}\n\n\tprivate getModelStartPositionOfViewLine(viewLineInfo: ViewLineInfo): Position {\n\t\tconst line = this.modelLineProjections[viewLineInfo.modelLineNumber - 1];\n\t\tconst minViewColumn = line.getViewLineMinColumn(\n\t\t\tthis.model,\n\t\t\tviewLineInfo.modelLineNumber,\n\t\t\tviewLineInfo.modelLineWrappedLineIdx\n\t\t);\n\t\tconst column = line.getModelColumnOfViewPosition(\n\t\t\tviewLineInfo.modelLineWrappedLineIdx,\n\t\t\tminViewColumn\n\t\t);\n\t\treturn new Position(viewLineInfo.modelLineNumber, column);\n\t}\n\n\tprivate getModelEndPositionOfViewLine(viewLineInfo: ViewLineInfo): Position {\n\t\tconst line = this.modelLineProjections[viewLineInfo.modelLineNumber - 1];\n\t\tconst maxViewColumn = line.getViewLineMaxColumn(\n\t\t\tthis.model,\n\t\t\tviewLineInfo.modelLineNumber,\n\t\t\tviewLineInfo.modelLineWrappedLineIdx\n\t\t);\n\t\tconst column = line.getModelColumnOfViewPosition(\n\t\t\tviewLineInfo.modelLineWrappedLineIdx,\n\t\t\tmaxViewColumn\n\t\t);\n\t\treturn new Position(viewLineInfo.modelLineNumber, column);\n\t}\n\n\tprivate getViewLineInfosGroupedByModelRanges(viewStartLineNumber: number, viewEndLineNumber: number): ViewLineInfoGroupedByModelRange[] {\n\t\tconst startViewLine = this.getViewLineInfo(viewStartLineNumber);\n\t\tconst endViewLine = this.getViewLineInfo(viewEndLineNumber);\n\n\t\tconst result = new Array<ViewLineInfoGroupedByModelRange>();\n\t\tlet lastVisibleModelPos: Position | null = this.getModelStartPositionOfViewLine(startViewLine);\n\t\tlet viewLines = new Array<ViewLineInfo>();\n\n\t\tfor (let curModelLine = startViewLine.modelLineNumber; curModelLine <= endViewLine.modelLineNumber; curModelLine++) {\n\t\t\tconst line = this.modelLineProjections[curModelLine - 1];\n\n\t\t\tif (line.isVisible()) {\n\t\t\t\tconst startOffset =\n\t\t\t\t\tcurModelLine === startViewLine.modelLineNumber\n\t\t\t\t\t\t? startViewLine.modelLineWrappedLineIdx\n\t\t\t\t\t\t: 0;\n\n\t\t\t\tconst endOffset =\n\t\t\t\t\tcurModelLine === endViewLine.modelLineNumber\n\t\t\t\t\t\t? endViewLine.modelLineWrappedLineIdx + 1\n\t\t\t\t\t\t: line.getViewLineCount();\n\n\t\t\t\tfor (let i = startOffset; i < endOffset; i++) {\n\t\t\t\t\tviewLines.push(new ViewLineInfo(curModelLine, i));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!line.isVisible() && lastVisibleModelPos) {\n\t\t\t\tconst lastVisibleModelPos2 = new Position(curModelLine - 1, this.model.getLineMaxColumn(curModelLine - 1) + 1);\n\n\t\t\t\tconst modelRange = Range.fromPositions(lastVisibleModelPos, lastVisibleModelPos2);\n\t\t\t\tresult.push(new ViewLineInfoGroupedByModelRange(modelRange, viewLines));\n\t\t\t\tviewLines = [];\n\n\t\t\t\tlastVisibleModelPos = null;\n\t\t\t} else if (line.isVisible() && !lastVisibleModelPos) {\n\t\t\t\tlastVisibleModelPos = new Position(curModelLine, 1);\n\t\t\t}\n\t\t}\n\n\t\tif (lastVisibleModelPos) {\n\t\t\tconst modelRange = Range.fromPositions(lastVisibleModelPos, this.getModelEndPositionOfViewLine(endViewLine));\n\t\t\tresult.push(new ViewLineInfoGroupedByModelRange(modelRange, viewLines));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// #endregion\n\n\tpublic getViewLinesBracketGuides(viewStartLineNumber: number, viewEndLineNumber: number, activeViewPosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][] {\n\t\tconst modelActivePosition = activeViewPosition ? this.convertViewPositionToModelPosition(activeViewPosition.lineNumber, activeViewPosition.column) : null;\n\t\tconst resultPerViewLine: IndentGuide[][] = [];\n\n\t\tfor (const group of this.getViewLineInfosGroupedByModelRanges(viewStartLineNumber, viewEndLineNumber)) {\n\t\t\tconst modelRangeStartLineNumber = group.modelRange.startLineNumber;\n\n\t\t\tconst bracketGuidesPerModelLine = this.model.guides.getLinesBracketGuides(\n\t\t\t\tmodelRangeStartLineNumber,\n\t\t\t\tgroup.modelRange.endLineNumber,\n\t\t\t\tmodelActivePosition,\n\t\t\t\toptions\n\t\t\t);\n\n\t\t\tfor (const viewLineInfo of group.viewLines) {\n\t\t\t\tif (viewLineInfo.isWrappedLineContinuation && this.getMinColumnOfViewLine(viewLineInfo) === 1) {\n\t\t\t\t\t// Don't add indent guides when the wrapped line continuation has no wrapping-indentation.\n\t\t\t\t\tresultPerViewLine.push([]);\n\t\t\t\t} else {\n\t\t\t\t\tlet bracketGuides = bracketGuidesPerModelLine[viewLineInfo.modelLineNumber - modelRangeStartLineNumber];\n\n\t\t\t\t\t// visibleColumns stay as they are (this is a bug and needs to be fixed, but it is not a regression)\n\t\t\t\t\t// model-columns must be converted to view-model columns.\n\t\t\t\t\tbracketGuides = bracketGuides.map(g => g.horizontalLine ?\n\t\t\t\t\t\tnew IndentGuide(g.visibleColumn, g.className,\n\t\t\t\t\t\t\tnew IndentGuideHorizontalLine(g.horizontalLine.top,\n\t\t\t\t\t\t\t\tthis.convertModelPositionToViewPosition(viewLineInfo.modelLineNumber, g.horizontalLine.endColumn).column\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) : g);\n\t\t\t\t\tresultPerViewLine.push(bracketGuides);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn resultPerViewLine;\n\t}\n\n\tpublic getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[] {\n\t\t// TODO: Use the same code as in `getViewLinesBracketGuides`.\n\t\t// Future TODO: Merge with `getViewLinesBracketGuides`.\n\t\t// However, this requires more refactoring of indent guides.\n\t\tviewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber);\n\t\tviewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber);\n\n\t\tconst modelStart = this.convertViewPositionToModelPosition(viewStartLineNumber, this.getViewLineMinColumn(viewStartLineNumber));\n\t\tconst modelEnd = this.convertViewPositionToModelPosition(viewEndLineNumber, this.getViewLineMaxColumn(viewEndLineNumber));\n\n\t\tlet result: number[] = [];\n\t\tconst resultRepeatCount: number[] = [];\n\t\tconst resultRepeatOption: IndentGuideRepeatOption[] = [];\n\t\tconst modelStartLineIndex = modelStart.lineNumber - 1;\n\t\tconst modelEndLineIndex = modelEnd.lineNumber - 1;\n\n\t\tlet reqStart: Position | null = null;\n\t\tfor (let modelLineIndex = modelStartLineIndex; modelLineIndex <= modelEndLineIndex; modelLineIndex++) {\n\t\t\tconst line = this.modelLineProjections[modelLineIndex];\n\t\t\tif (line.isVisible()) {\n\t\t\t\tconst viewLineStartIndex = line.getViewLineNumberOfModelPosition(0, modelLineIndex === modelStartLineIndex ? modelStart.column : 1);\n\t\t\t\tconst viewLineEndIndex = line.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(modelLineIndex + 1));\n\t\t\t\tconst count = viewLineEndIndex - viewLineStartIndex + 1;\n\t\t\t\tlet option = IndentGuideRepeatOption.BlockNone;\n\t\t\t\tif (count > 1 && line.getViewLineMinColumn(this.model, modelLineIndex + 1, viewLineEndIndex) === 1) {\n\t\t\t\t\t// wrapped lines should block indent guides\n\t\t\t\t\toption = (viewLineStartIndex === 0 ? IndentGuideRepeatOption.BlockSubsequent : IndentGuideRepeatOption.BlockAll);\n\t\t\t\t}\n\t\t\t\tresultRepeatCount.push(count);\n\t\t\t\tresultRepeatOption.push(option);\n\t\t\t\t// merge into previous request\n\t\t\t\tif (reqStart === null) {\n\t\t\t\t\treqStart = new Position(modelLineIndex + 1, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// hit invisible line => flush request\n\t\t\t\tif (reqStart !== null) {\n\t\t\t\t\tresult = result.concat(this.model.guides.getLinesIndentGuides(reqStart.lineNumber, modelLineIndex));\n\t\t\t\t\treqStart = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (reqStart !== null) {\n\t\t\tresult = result.concat(this.model.guides.getLinesIndentGuides(reqStart.lineNumber, modelEnd.lineNumber));\n\t\t\treqStart = null;\n\t\t}\n\n\t\tconst viewLineCount = viewEndLineNumber - viewStartLineNumber + 1;\n\t\tconst viewIndents = new Array<number>(viewLineCount);\n\t\tlet currIndex = 0;\n\t\tfor (let i = 0, len = result.length; i < len; i++) {\n\t\t\tlet value = result[i];\n\t\t\tconst count = Math.min(viewLineCount - currIndex, resultRepeatCount[i]);\n\t\t\tconst option = resultRepeatOption[i];\n\t\t\tlet blockAtIndex: number;\n\t\t\tif (option === IndentGuideRepeatOption.BlockAll) {\n\t\t\t\tblockAtIndex = 0;\n\t\t\t} else if (option === IndentGuideRepeatOption.BlockSubsequent) {\n\t\t\t\tblockAtIndex = 1;\n\t\t\t} else {\n\t\t\t\tblockAtIndex = count;\n\t\t\t}\n\t\t\tfor (let j = 0; j < count; j++) {\n\t\t\t\tif (j === blockAtIndex) {\n\t\t\t\t\tvalue = 0;\n\t\t\t\t}\n\t\t\t\tviewIndents[currIndex++] = value;\n\t\t\t}\n\t\t}\n\t\treturn viewIndents;\n\t}\n\n\tpublic getViewLineContent(viewLineNumber: number): string {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getViewLineContent(this.model, info.modelLineNumber, info.modelLineWrappedLineIdx);\n\t}\n\n\tpublic getViewLineLength(viewLineNumber: number): number {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getViewLineLength(this.model, info.modelLineNumber, info.modelLineWrappedLineIdx);\n\t}\n\n\tpublic getViewLineMinColumn(viewLineNumber: number): number {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getViewLineMinColumn(this.model, info.modelLineNumber, info.modelLineWrappedLineIdx);\n\t}\n\n\tpublic getViewLineMaxColumn(viewLineNumber: number): number {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getViewLineMaxColumn(this.model, info.modelLineNumber, info.modelLineWrappedLineIdx);\n\t}\n\n\tpublic getViewLineData(viewLineNumber: number): ViewLineData {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getViewLineData(this.model, info.modelLineNumber, info.modelLineWrappedLineIdx);\n\t}\n\n\tpublic getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): ViewLineData[] {\n\n\t\tviewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber);\n\t\tviewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber);\n\n\t\tconst start = this.projectedModelLineLineCounts.getIndexOf(viewStartLineNumber - 1);\n\t\tlet viewLineNumber = viewStartLineNumber;\n\t\tconst startModelLineIndex = start.index;\n\t\tconst startRemainder = start.remainder;\n\n\t\tconst result: ViewLineData[] = [];\n\t\tfor (let modelLineIndex = startModelLineIndex, len = this.model.getLineCount(); modelLineIndex < len; modelLineIndex++) {\n\t\t\tconst line = this.modelLineProjections[modelLineIndex];\n\t\t\tif (!line.isVisible()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst fromViewLineIndex = (modelLineIndex === startModelLineIndex ? startRemainder : 0);\n\t\t\tlet remainingViewLineCount = line.getViewLineCount() - fromViewLineIndex;\n\n\t\t\tlet lastLine = false;\n\t\t\tif (viewLineNumber + remainingViewLineCount > viewEndLineNumber) {\n\t\t\t\tlastLine = true;\n\t\t\t\tremainingViewLineCount = viewEndLineNumber - viewLineNumber + 1;\n\t\t\t}\n\n\t\t\tline.getViewLinesData(this.model, modelLineIndex + 1, fromViewLineIndex, remainingViewLineCount, viewLineNumber - viewStartLineNumber, needed, result);\n\n\t\t\tviewLineNumber += remainingViewLineCount;\n\n\t\t\tif (lastLine) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic validateViewPosition(viewLineNumber: number, viewColumn: number, expectedModelPosition: Position): Position {\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\n\t\tconst r = this.projectedModelLineLineCounts.getIndexOf(viewLineNumber - 1);\n\t\tconst lineIndex = r.index;\n\t\tconst remainder = r.remainder;\n\n\t\tconst line = this.modelLineProjections[lineIndex];\n\n\t\tconst minColumn = line.getViewLineMinColumn(this.model, lineIndex + 1, remainder);\n\t\tconst maxColumn = line.getViewLineMaxColumn(this.model, lineIndex + 1, remainder);\n\t\tif (viewColumn < minColumn) {\n\t\t\tviewColumn = minColumn;\n\t\t}\n\t\tif (viewColumn > maxColumn) {\n\t\t\tviewColumn = maxColumn;\n\t\t}\n\n\t\tconst computedModelColumn = line.getModelColumnOfViewPosition(remainder, viewColumn);\n\t\tconst computedModelPosition = this.model.validatePosition(new Position(lineIndex + 1, computedModelColumn));\n\n\t\tif (computedModelPosition.equals(expectedModelPosition)) {\n\t\t\treturn new Position(viewLineNumber, viewColumn);\n\t\t}\n\n\t\treturn this.convertModelPositionToViewPosition(expectedModelPosition.lineNumber, expectedModelPosition.column);\n\t}\n\n\tpublic validateViewRange(viewRange: Range, expectedModelRange: Range): Range {\n\t\tconst validViewStart = this.validateViewPosition(viewRange.startLineNumber, viewRange.startColumn, expectedModelRange.getStartPosition());\n\t\tconst validViewEnd = this.validateViewPosition(viewRange.endLineNumber, viewRange.endColumn, expectedModelRange.getEndPosition());\n\t\treturn new Range(validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column);\n\t}\n\n\tpublic convertViewPositionToModelPosition(viewLineNumber: number, viewColumn: number): Position {\n\t\tconst info = this.getViewLineInfo(viewLineNumber);\n\n\t\tconst inputColumn = this.modelLineProjections[info.modelLineNumber - 1].getModelColumnOfViewPosition(info.modelLineWrappedLineIdx, viewColumn);\n\t\t// console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn);\n\t\treturn this.model.validatePosition(new Position(info.modelLineNumber, inputColumn));\n\t}\n\n\tpublic convertViewRangeToModelRange(viewRange: Range): Range {\n\t\tconst start = this.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn);\n\t\tconst end = this.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn);\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\tpublic convertModelPositionToViewPosition(_modelLineNumber: number, _modelColumn: number, affinity: PositionAffinity = PositionAffinity.None): Position {\n\n\t\tconst validPosition = this.model.validatePosition(new Position(_modelLineNumber, _modelColumn));\n\t\tconst inputLineNumber = validPosition.lineNumber;\n\t\tconst inputColumn = validPosition.column;\n\n\t\tlet lineIndex = inputLineNumber - 1, lineIndexChanged = false;\n\t\twhile (lineIndex > 0 && !this.modelLineProjections[lineIndex].isVisible()) {\n\t\t\tlineIndex--;\n\t\t\tlineIndexChanged = true;\n\t\t}\n\t\tif (lineIndex === 0 && !this.modelLineProjections[lineIndex].isVisible()) {\n\t\t\t// Could not reach a real line\n\t\t\t// console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + 1 + ',' + 1);\n\t\t\treturn new Position(1, 1);\n\t\t}\n\t\tconst deltaLineNumber = 1 + this.projectedModelLineLineCounts.getPrefixSum(lineIndex);\n\n\t\tlet r: Position;\n\t\tif (lineIndexChanged) {\n\t\t\tr = this.modelLineProjections[lineIndex].getViewPositionOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1), affinity);\n\t\t} else {\n\t\t\tr = this.modelLineProjections[inputLineNumber - 1].getViewPositionOfModelPosition(deltaLineNumber, inputColumn, affinity);\n\t\t}\n\n\t\t// console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + r.lineNumber + ',' + r);\n\t\treturn r;\n\t}\n\n\t/**\n\t * @param affinity The affinity in case of an empty range. Has no effect for non-empty ranges.\n\t*/\n\tpublic convertModelRangeToViewRange(modelRange: Range, affinity: PositionAffinity = PositionAffinity.Left): Range {\n\t\tif (modelRange.isEmpty()) {\n\t\t\tconst start = this.convertModelPositionToViewPosition(modelRange.startLineNumber, modelRange.startColumn, affinity);\n\t\t\treturn Range.fromPositions(start);\n\t\t} else {\n\t\t\tconst start = this.convertModelPositionToViewPosition(modelRange.startLineNumber, modelRange.startColumn, PositionAffinity.Right);\n\t\t\tconst end = this.convertModelPositionToViewPosition(modelRange.endLineNumber, modelRange.endColumn, PositionAffinity.Left);\n\t\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t}\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(modelLineNumber: number, modelColumn: number): number {\n\t\tlet lineIndex = modelLineNumber - 1;\n\t\tif (this.modelLineProjections[lineIndex].isVisible()) {\n\t\t\t// this model line is visible\n\t\t\tconst deltaLineNumber = 1 + this.projectedModelLineLineCounts.getPrefixSum(lineIndex);\n\t\t\treturn this.modelLineProjections[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, modelColumn);\n\t\t}\n\n\t\t// this model line is not visible\n\t\twhile (lineIndex > 0 && !this.modelLineProjections[lineIndex].isVisible()) {\n\t\t\tlineIndex--;\n\t\t}\n\t\tif (lineIndex === 0 && !this.modelLineProjections[lineIndex].isVisible()) {\n\t\t\t// Could not reach a real line\n\t\t\treturn 1;\n\t\t}\n\t\tconst deltaLineNumber = 1 + this.projectedModelLineLineCounts.getPrefixSum(lineIndex);\n\t\treturn this.modelLineProjections[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1));\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId: number, filterOutValidation: boolean): IModelDecoration[] {\n\t\tconst modelStart = this.convertViewPositionToModelPosition(range.startLineNumber, range.startColumn);\n\t\tconst modelEnd = this.convertViewPositionToModelPosition(range.endLineNumber, range.endColumn);\n\n\t\tif (modelEnd.lineNumber - modelStart.lineNumber <= range.endLineNumber - range.startLineNumber) {\n\t\t\t// most likely there are no hidden lines => fast path\n\t\t\t// fetch decorations from column 1 to cover the case of wrapped lines that have whole line decorations at column 1\n\t\t\treturn this.model.getDecorationsInRange(new Range(modelStart.lineNumber, 1, modelEnd.lineNumber, modelEnd.column), ownerId, filterOutValidation);\n\t\t}\n\n\t\tlet result: IModelDecoration[] = [];\n\t\tconst modelStartLineIndex = modelStart.lineNumber - 1;\n\t\tconst modelEndLineIndex = modelEnd.lineNumber - 1;\n\n\t\tlet reqStart: Position | null = null;\n\t\tfor (let modelLineIndex = modelStartLineIndex; modelLineIndex <= modelEndLineIndex; modelLineIndex++) {\n\t\t\tconst line = this.modelLineProjections[modelLineIndex];\n\t\t\tif (line.isVisible()) {\n\t\t\t\t// merge into previous request\n\t\t\t\tif (reqStart === null) {\n\t\t\t\t\treqStart = new Position(modelLineIndex + 1, modelLineIndex === modelStartLineIndex ? modelStart.column : 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// hit invisible line => flush request\n\t\t\t\tif (reqStart !== null) {\n\t\t\t\t\tconst maxLineColumn = this.model.getLineMaxColumn(modelLineIndex);\n\t\t\t\t\tresult = result.concat(this.model.getDecorationsInRange(new Range(reqStart.lineNumber, reqStart.column, modelLineIndex, maxLineColumn), ownerId, filterOutValidation));\n\t\t\t\t\treqStart = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (reqStart !== null) {\n\t\t\tresult = result.concat(this.model.getDecorationsInRange(new Range(reqStart.lineNumber, reqStart.column, modelEnd.lineNumber, modelEnd.column), ownerId, filterOutValidation));\n\t\t\treqStart = null;\n\t\t}\n\n\t\tresult.sort((a, b) => {\n\t\t\tconst res = Range.compareRangesUsingStarts(a.range, b.range);\n\t\t\tif (res === 0) {\n\t\t\t\tif (a.id < b.id) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif (a.id > b.id) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn res;\n\t\t});\n\n\t\t// Eliminate duplicate decorations that might have intersected our visible ranges multiple times\n\t\tlet finalResult: IModelDecoration[] = [], finalResultLen = 0;\n\t\tlet prevDecId: string | null = null;\n\t\tfor (const dec of result) {\n\t\t\tconst decId = dec.id;\n\t\t\tif (prevDecId === decId) {\n\t\t\t\t// skip\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevDecId = decId;\n\t\t\tfinalResult[finalResultLen++] = dec;\n\t\t}\n\n\t\treturn finalResult;\n\t}\n\n\tpublic getInjectedTextAt(position: Position): InjectedText | null {\n\t\tconst info = this.getViewLineInfo(position.lineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].getInjectedTextAt(info.modelLineWrappedLineIdx, position.column);\n\t}\n\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position {\n\t\tconst info = this.getViewLineInfo(position.lineNumber);\n\t\treturn this.modelLineProjections[info.modelLineNumber - 1].normalizePosition(info.modelLineWrappedLineIdx, position, affinity);\n\t}\n\n\tpublic getLineIndentColumn(lineNumber: number): number {\n\t\tconst info = this.getViewLineInfo(lineNumber);\n\t\tif (info.modelLineWrappedLineIdx === 0) {\n\t\t\treturn this.model.getLineIndentColumn(info.modelLineNumber);\n\t\t}\n\n\t\t// wrapped lines have no indentation.\n\t\t// We deliberately don't handle the case that indentation is wrapped\n\t\t// to avoid two view lines reporting indentation for the very same model line.\n\t\treturn 0;\n\t}\n}\n\n/**\n * Overlapping unsorted ranges:\n * [ ) [ ) [ )\n * [ ) [ )\n * ->\n * Non overlapping sorted ranges:\n * [ ) [ ) [ )\n *\n * Note: This function only considers line information! Columns are ignored.\n*/\nfunction normalizeLineRanges(ranges: Range[]): Range[] {\n\tif (ranges.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst sortedRanges = ranges.slice();\n\tsortedRanges.sort(Range.compareRangesUsingStarts);\n\n\tconst result: Range[] = [];\n\tlet currentRangeStart = sortedRanges[0].startLineNumber;\n\tlet currentRangeEnd = sortedRanges[0].endLineNumber;\n\n\tfor (let i = 1, len = sortedRanges.length; i < len; i++) {\n\t\tconst range = sortedRanges[i];\n\n\t\tif (range.startLineNumber > currentRangeEnd + 1) {\n\t\t\tresult.push(new Range(currentRangeStart, 1, currentRangeEnd, 1));\n\t\t\tcurrentRangeStart = range.startLineNumber;\n\t\t\tcurrentRangeEnd = range.endLineNumber;\n\t\t} else if (range.endLineNumber > currentRangeEnd) {\n\t\t\tcurrentRangeEnd = range.endLineNumber;\n\t\t}\n\t}\n\tresult.push(new Range(currentRangeStart, 1, currentRangeEnd, 1));\n\treturn result;\n}\n\n/**\n * Represents a view line. Can be used to efficiently query more information about it.\n */\nclass ViewLineInfo {\n\tpublic get isWrappedLineContinuation(): boolean {\n\t\treturn this.modelLineWrappedLineIdx > 0;\n\t}\n\n\tconstructor(\n\t\tpublic readonly modelLineNumber: number,\n\t\tpublic readonly modelLineWrappedLineIdx: number,\n\t) { }\n}\n\n/**\n * A list of view lines that have a contiguous span in the model.\n*/\nclass ViewLineInfoGroupedByModelRange {\n\tconstructor(public readonly modelRange: Range, public readonly viewLines: ViewLineInfo[]) {\n\t}\n}\n\nclass CoordinatesConverter implements ICoordinatesConverter {\n\tprivate readonly _lines: ViewModelLinesFromProjectedModel;\n\n\tconstructor(lines: ViewModelLinesFromProjectedModel) {\n\t\tthis._lines = lines;\n\t}\n\n\t// View -> Model conversion and related methods\n\n\tpublic convertViewPositionToModelPosition(viewPosition: Position): Position {\n\t\treturn this._lines.convertViewPositionToModelPosition(viewPosition.lineNumber, viewPosition.column);\n\t}\n\n\tpublic convertViewRangeToModelRange(viewRange: Range): Range {\n\t\treturn this._lines.convertViewRangeToModelRange(viewRange);\n\t}\n\n\tpublic validateViewPosition(viewPosition: Position, expectedModelPosition: Position): Position {\n\t\treturn this._lines.validateViewPosition(viewPosition.lineNumber, viewPosition.column, expectedModelPosition);\n\t}\n\n\tpublic validateViewRange(viewRange: Range, expectedModelRange: Range): Range {\n\t\treturn this._lines.validateViewRange(viewRange, expectedModelRange);\n\t}\n\n\t// Model -> View conversion and related methods\n\n\tpublic convertModelPositionToViewPosition(modelPosition: Position, affinity?: PositionAffinity): Position {\n\t\treturn this._lines.convertModelPositionToViewPosition(modelPosition.lineNumber, modelPosition.column, affinity);\n\t}\n\n\tpublic convertModelRangeToViewRange(modelRange: Range, affinity?: PositionAffinity): Range {\n\t\treturn this._lines.convertModelRangeToViewRange(modelRange, affinity);\n\t}\n\n\tpublic modelPositionIsVisible(modelPosition: Position): boolean {\n\t\treturn this._lines.modelPositionIsVisible(modelPosition.lineNumber, modelPosition.column);\n\t}\n\n\tpublic getModelLineViewLineCount(modelLineNumber: number): number {\n\t\treturn this._lines.getModelLineViewLineCount(modelLineNumber);\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(modelLineNumber: number, modelColumn: number): number {\n\t\treturn this._lines.getViewLineNumberOfModelPosition(modelLineNumber, modelColumn);\n\t}\n}\n\nconst enum IndentGuideRepeatOption {\n\tBlockNone = 0,\n\tBlockSubsequent = 1,\n\tBlockAll = 2\n}\n\nexport class ViewModelLinesFromModelAsIs implements IViewModelLines {\n\tpublic readonly model: ITextModel;\n\n\tconstructor(model: ITextModel) {\n\t\tthis.model = model;\n\t}\n\n\tpublic dispose(): void {\n\t}\n\n\tpublic createCoordinatesConverter(): ICoordinatesConverter {\n\t\treturn new IdentityCoordinatesConverter(this);\n\t}\n\n\tpublic getHiddenAreas(): Range[] {\n\t\treturn [];\n\t}\n\n\tpublic setHiddenAreas(_ranges: Range[]): boolean {\n\t\treturn false;\n\t}\n\n\tpublic setTabSize(_newTabSize: number): boolean {\n\t\treturn false;\n\t}\n\n\tpublic setWrappingSettings(_fontInfo: FontInfo, _wrappingStrategy: 'simple' | 'advanced', _wrappingColumn: number, _wrappingIndent: WrappingIndent): boolean {\n\t\treturn false;\n\t}\n\n\tpublic createLineBreaksComputer(): ILineBreaksComputer {\n\t\tconst result: null[] = [];\n\t\treturn {\n\t\t\taddRequest: (lineText: string, injectedText: LineInjectedText[] | null, previousLineBreakData: ModelLineProjectionData | null) => {\n\t\t\t\tresult.push(null);\n\t\t\t},\n\t\t\tfinalize: () => {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic onModelFlushed(): void {\n\t}\n\n\tpublic onModelLinesDeleted(_versionId: number | null, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null {\n\t\treturn new viewEvents.ViewLinesDeletedEvent(fromLineNumber, toLineNumber);\n\t}\n\n\tpublic onModelLinesInserted(_versionId: number | null, fromLineNumber: number, toLineNumber: number, lineBreaks: (ModelLineProjectionData | null)[]): viewEvents.ViewLinesInsertedEvent | null {\n\t\treturn new viewEvents.ViewLinesInsertedEvent(fromLineNumber, toLineNumber);\n\t}\n\n\tpublic onModelLineChanged(_versionId: number | null, lineNumber: number, lineBreakData: ModelLineProjectionData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] {\n\t\treturn [false, new viewEvents.ViewLinesChangedEvent(lineNumber, lineNumber), null, null];\n\t}\n\n\tpublic acceptVersionId(_versionId: number): void {\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\treturn this.model.getLineCount();\n\t}\n\n\tpublic getActiveIndentGuide(viewLineNumber: number, _minLineNumber: number, _maxLineNumber: number): IActiveIndentGuideInfo {\n\t\treturn {\n\t\t\tstartLineNumber: viewLineNumber,\n\t\t\tendLineNumber: viewLineNumber,\n\t\t\tindent: 0\n\t\t};\n\t}\n\n\tpublic getViewLinesBracketGuides(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null): IndentGuide[][] {\n\t\treturn new Array(endLineNumber - startLineNumber + 1).fill([]);\n\t}\n\n\tpublic getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[] {\n\t\tconst viewLineCount = viewEndLineNumber - viewStartLineNumber + 1;\n\t\tconst result = new Array<number>(viewLineCount);\n\t\tfor (let i = 0; i < viewLineCount; i++) {\n\t\t\tresult[i] = 0;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getViewLineContent(viewLineNumber: number): string {\n\t\treturn this.model.getLineContent(viewLineNumber);\n\t}\n\n\tpublic getViewLineLength(viewLineNumber: number): number {\n\t\treturn this.model.getLineLength(viewLineNumber);\n\t}\n\n\tpublic getViewLineMinColumn(viewLineNumber: number): number {\n\t\treturn this.model.getLineMinColumn(viewLineNumber);\n\t}\n\n\tpublic getViewLineMaxColumn(viewLineNumber: number): number {\n\t\treturn this.model.getLineMaxColumn(viewLineNumber);\n\t}\n\n\tpublic getViewLineData(viewLineNumber: number): ViewLineData {\n\t\tconst lineTokens = this.model.getLineTokens(viewLineNumber);\n\t\tconst lineContent = lineTokens.getLineContent();\n\t\treturn new ViewLineData(\n\t\t\tlineContent,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\tlineContent.length + 1,\n\t\t\t0,\n\t\t\tlineTokens.inflate(),\n\t\t\tnull\n\t\t);\n\t}\n\n\tpublic getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): Array<ViewLineData | null> {\n\t\tconst lineCount = this.model.getLineCount();\n\t\tviewStartLineNumber = Math.min(Math.max(1, viewStartLineNumber), lineCount);\n\t\tviewEndLineNumber = Math.min(Math.max(1, viewEndLineNumber), lineCount);\n\n\t\tconst result: Array<ViewLineData | null> = [];\n\t\tfor (let lineNumber = viewStartLineNumber; lineNumber <= viewEndLineNumber; lineNumber++) {\n\t\t\tconst idx = lineNumber - viewStartLineNumber;\n\t\t\tresult[idx] = needed[idx] ? this.getViewLineData(lineNumber) : null;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId: number, filterOutValidation: boolean): IModelDecoration[] {\n\t\treturn this.model.getDecorationsInRange(range, ownerId, filterOutValidation);\n\t}\n\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position {\n\t\treturn this.model.normalizePosition(position, affinity);\n\t}\n\n\tpublic getLineIndentColumn(lineNumber: number): number {\n\t\treturn this.model.getLineIndentColumn(lineNumber);\n\t}\n\n\tpublic getInjectedTextAt(position: Position): InjectedText | null {\n\t\t// Identity lines collection does not support injected text.\n\t\treturn null;\n\t}\n}\n\nclass IdentityCoordinatesConverter implements ICoordinatesConverter {\n\tprivate readonly _lines: ViewModelLinesFromModelAsIs;\n\n\tconstructor(lines: ViewModelLinesFromModelAsIs) {\n\t\tthis._lines = lines;\n\t}\n\n\tprivate _validPosition(pos: Position): Position {\n\t\treturn this._lines.model.validatePosition(pos);\n\t}\n\n\tprivate _validRange(range: Range): Range {\n\t\treturn this._lines.model.validateRange(range);\n\t}\n\n\t// View -> Model conversion and related methods\n\n\tpublic convertViewPositionToModelPosition(viewPosition: Position): Position {\n\t\treturn this._validPosition(viewPosition);\n\t}\n\n\tpublic convertViewRangeToModelRange(viewRange: Range): Range {\n\t\treturn this._validRange(viewRange);\n\t}\n\n\tpublic validateViewPosition(_viewPosition: Position, expectedModelPosition: Position): Position {\n\t\treturn this._validPosition(expectedModelPosition);\n\t}\n\n\tpublic validateViewRange(_viewRange: Range, expectedModelRange: Range): Range {\n\t\treturn this._validRange(expectedModelRange);\n\t}\n\n\t// Model -> View conversion and related methods\n\n\tpublic convertModelPositionToViewPosition(modelPosition: Position): Position {\n\t\treturn this._validPosition(modelPosition);\n\t}\n\n\tpublic convertModelRangeToViewRange(modelRange: Range): Range {\n\t\treturn this._validRange(modelRange);\n\t}\n\n\tpublic modelPositionIsVisible(modelPosition: Position): boolean {\n\t\tconst lineCount = this._lines.model.getLineCount();\n\t\tif (modelPosition.lineNumber < 1 || modelPosition.lineNumber > lineCount) {\n\t\t\t// invalid arguments\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic getModelLineViewLineCount(modelLineNumber: number): number {\n\t\treturn 1;\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(modelLineNumber: number, modelColumn: number): number {\n\t\treturn modelLineNumber;\n\t}\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 { ArrayQueue } from 'vs/base/common/arrays';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Color } from 'vs/base/common/color';\nimport { Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { ConfigurationChangedEvent, EditorOption, EDITOR_FONT_DEFAULTS, filterValidationDecorations } from 'vs/editor/common/config/editorOptions';\nimport { CursorsController } from 'vs/editor/common/cursor/cursor';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ICursorState, IViewState, ScrollType } from 'vs/editor/common/editorCommon';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { EndOfLinePreference, ICursorStateComputer, IIdentifiedSingleEditOperation, ITextModel, PositionAffinity, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide } from 'vs/editor/common/textModelGuides';\nimport { ModelDecorationMinimapOptions, ModelDecorationOptions, ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel';\nimport * as textModelEvents from 'vs/editor/common/textModelEvents';\nimport { ColorId, TokenizationRegistry } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { tokenizeLineToHTML } from 'vs/editor/common/languages/textToHtmlTokenizer';\nimport { EditorTheme } from 'vs/editor/common/editorTheme';\nimport * as viewEvents from 'vs/editor/common/viewEvents';\nimport { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout';\nimport { MinimapTokensColorTracker } from 'vs/editor/common/viewModel/minimapTokensColorTracker';\nimport { ILineBreaksComputer, ILineBreaksComputerFactory, InjectedText } from 'vs/editor/common/modelLineProjectionData';\nimport { ViewEventHandler } from 'vs/editor/common/viewEventHandler';\nimport { ICoordinatesConverter, IViewModel, IWhitespaceChangeAccessor, MinimapLinesRenderingData, OverviewRulerDecorationsGroup, ViewLineData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel';\nimport { ViewModelDecorations } from 'vs/editor/common/viewModel/viewModelDecorations';\nimport { FocusChangedEvent, OutgoingViewModelEvent, ReadOnlyEditAttemptEvent, ScrollChangedEvent, ViewModelEventDispatcher, ViewModelEventsCollector, ViewZonesChangedEvent } from 'vs/editor/common/viewModelEventDispatcher';\nimport { IViewModelLines, ViewModelLinesFromModelAsIs, ViewModelLinesFromProjectedModel } from 'vs/editor/common/viewModel/viewModelLines';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nconst USE_IDENTITY_LINES_COLLECTION = true;\n\nexport class ViewModel extends Disposable implements IViewModel {\n\n\tprivate readonly _editorId: number;\n\tprivate readonly _configuration: IEditorConfiguration;\n\tpublic readonly model: ITextModel;\n\tprivate readonly _eventDispatcher: ViewModelEventDispatcher;\n\tpublic readonly onEvent: Event<OutgoingViewModelEvent>;\n\tpublic cursorConfig: CursorConfiguration;\n\tprivate readonly _tokenizeViewportSoon: RunOnceScheduler;\n\tprivate readonly _updateConfigurationViewLineCount: RunOnceScheduler;\n\tprivate _hasFocus: boolean;\n\tprivate _viewportStartLine: number;\n\tprivate _viewportStartLineTrackedRange: string | null;\n\tprivate _viewportStartLineDelta: number;\n\tprivate readonly _lines: IViewModelLines;\n\tpublic readonly coordinatesConverter: ICoordinatesConverter;\n\tpublic readonly viewLayout: ViewLayout;\n\tprivate readonly _cursor: CursorsController;\n\tprivate readonly _decorations: ViewModelDecorations;\n\n\tconstructor(\n\t\teditorId: number,\n\t\tconfiguration: IEditorConfiguration,\n\t\tmodel: ITextModel,\n\t\tdomLineBreaksComputerFactory: ILineBreaksComputerFactory,\n\t\tmonospaceLineBreaksComputerFactory: ILineBreaksComputerFactory,\n\t\tscheduleAtNextAnimationFrame: (callback: () => void) => IDisposable,\n\t\tprivate readonly languageConfigurationService: ILanguageConfigurationService,\n\t\tprivate readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorId = editorId;\n\t\tthis._configuration = configuration;\n\t\tthis.model = model;\n\t\tthis._eventDispatcher = new ViewModelEventDispatcher();\n\t\tthis.onEvent = this._eventDispatcher.onEvent;\n\t\tthis.cursorConfig = new CursorConfiguration(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService);\n\t\tthis._tokenizeViewportSoon = this._register(new RunOnceScheduler(() => this.tokenizeViewport(), 50));\n\t\tthis._updateConfigurationViewLineCount = this._register(new RunOnceScheduler(() => this._updateConfigurationViewLineCountNow(), 0));\n\t\tthis._hasFocus = false;\n\t\tthis._viewportStartLine = -1;\n\t\tthis._viewportStartLineTrackedRange = null;\n\t\tthis._viewportStartLineDelta = 0;\n\n\t\tif (USE_IDENTITY_LINES_COLLECTION && this.model.isTooLargeForTokenization()) {\n\n\t\t\tthis._lines = new ViewModelLinesFromModelAsIs(this.model);\n\n\t\t} else {\n\t\t\tconst options = this._configuration.options;\n\t\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\t\tconst wrappingStrategy = options.get(EditorOption.wrappingStrategy);\n\t\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\t\tconst wrappingIndent = options.get(EditorOption.wrappingIndent);\n\n\t\t\tthis._lines = new ViewModelLinesFromProjectedModel(\n\t\t\t\tthis._editorId,\n\t\t\t\tthis.model,\n\t\t\t\tdomLineBreaksComputerFactory,\n\t\t\t\tmonospaceLineBreaksComputerFactory,\n\t\t\t\tfontInfo,\n\t\t\t\tthis.model.getOptions().tabSize,\n\t\t\t\twrappingStrategy,\n\t\t\t\twrappingInfo.wrappingColumn,\n\t\t\t\twrappingIndent\n\t\t\t);\n\t\t}\n\n\t\tthis.coordinatesConverter = this._lines.createCoordinatesConverter();\n\n\t\tthis._cursor = this._register(new CursorsController(model, this, this.coordinatesConverter, this.cursorConfig));\n\n\t\tthis.viewLayout = this._register(new ViewLayout(this._configuration, this.getLineCount(), scheduleAtNextAnimationFrame));\n\n\t\tthis._register(this.viewLayout.onDidScroll((e) => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis._tokenizeViewportSoon.schedule();\n\t\t\t}\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewScrollChangedEvent(e));\n\t\t\tthis._eventDispatcher.emitOutgoingEvent(new ScrollChangedEvent(\n\t\t\t\te.oldScrollWidth, e.oldScrollLeft, e.oldScrollHeight, e.oldScrollTop,\n\t\t\t\te.scrollWidth, e.scrollLeft, e.scrollHeight, e.scrollTop\n\t\t\t));\n\t\t}));\n\n\t\tthis._register(this.viewLayout.onDidContentSizeChange((e) => {\n\t\t\tthis._eventDispatcher.emitOutgoingEvent(e);\n\t\t}));\n\n\t\tthis._decorations = new ViewModelDecorations(this._editorId, this.model, this._configuration, this._lines, this.coordinatesConverter);\n\n\t\tthis._registerModelEvents();\n\n\t\tthis._register(this._configuration.onDidChangeFast((e) => {\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\t\t\t\tthis._onConfigurationChanged(eventsCollector, e);\n\t\t\t} finally {\n\t\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(MinimapTokensColorTracker.getInstance().onDidChange(() => {\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewTokensColorsChangedEvent());\n\t\t}));\n\n\t\tthis._register(this._themeService.onDidColorThemeChange((theme) => {\n\t\t\tthis._invalidateDecorationsColorCache();\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewThemeChangedEvent(theme));\n\t\t}));\n\n\t\tthis._updateConfigurationViewLineCountNow();\n\t}\n\n\tpublic override dispose(): void {\n\t\t// First remove listeners, as disposing the lines might end up sending\n\t\t// model decoration changed events ... and we no longer care about them ...\n\t\tsuper.dispose();\n\t\tthis._decorations.dispose();\n\t\tthis._lines.dispose();\n\t\tthis._viewportStartLineTrackedRange = this.model._setTrackedRange(this._viewportStartLineTrackedRange, null, TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges);\n\t\tthis._eventDispatcher.dispose();\n\t}\n\n\tpublic createLineBreaksComputer(): ILineBreaksComputer {\n\t\treturn this._lines.createLineBreaksComputer();\n\t}\n\n\tpublic addViewEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis._eventDispatcher.addViewEventHandler(eventHandler);\n\t}\n\n\tpublic removeViewEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis._eventDispatcher.removeViewEventHandler(eventHandler);\n\t}\n\n\tprivate _updateConfigurationViewLineCountNow(): void {\n\t\tthis._configuration.setViewLineCount(this._lines.getViewLineCount());\n\t}\n\n\tpublic tokenizeViewport(): void {\n\t\tconst linesViewportData = this.viewLayout.getLinesViewportData();\n\t\tconst viewVisibleRange = new Range(\n\t\t\tlinesViewportData.startLineNumber,\n\t\t\tthis.getLineMinColumn(linesViewportData.startLineNumber),\n\t\t\tlinesViewportData.endLineNumber,\n\t\t\tthis.getLineMaxColumn(linesViewportData.endLineNumber)\n\t\t);\n\t\tconst modelVisibleRanges = this._toModelVisibleRanges(viewVisibleRange);\n\n\t\tfor (const modelVisibleRange of modelVisibleRanges) {\n\t\t\tthis.model.tokenizeViewport(modelVisibleRange.startLineNumber, modelVisibleRange.endLineNumber);\n\t\t}\n\t}\n\n\tpublic setHasFocus(hasFocus: boolean): void {\n\t\tthis._hasFocus = hasFocus;\n\t\tthis._cursor.setHasFocus(hasFocus);\n\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewFocusChangedEvent(hasFocus));\n\t\tthis._eventDispatcher.emitOutgoingEvent(new FocusChangedEvent(!hasFocus, hasFocus));\n\t}\n\n\tpublic onCompositionStart(): void {\n\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewCompositionStartEvent());\n\t}\n\n\tpublic onCompositionEnd(): void {\n\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewCompositionEndEvent());\n\t}\n\n\tprivate _onConfigurationChanged(eventsCollector: ViewModelEventsCollector, e: ConfigurationChangedEvent): void {\n\n\t\t// We might need to restore the current centered view range, so save it (if available)\n\t\tlet previousViewportStartModelPosition: Position | null = null;\n\t\tif (this._viewportStartLine !== -1) {\n\t\t\tconst previousViewportStartViewPosition = new Position(this._viewportStartLine, this.getLineMinColumn(this._viewportStartLine));\n\t\t\tpreviousViewportStartModelPosition = this.coordinatesConverter.convertViewPositionToModelPosition(previousViewportStartViewPosition);\n\t\t}\n\t\tlet restorePreviousViewportStart = false;\n\n\t\tconst options = this._configuration.options;\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\t\tconst wrappingStrategy = options.get(EditorOption.wrappingStrategy);\n\t\tconst wrappingInfo = options.get(EditorOption.wrappingInfo);\n\t\tconst wrappingIndent = options.get(EditorOption.wrappingIndent);\n\n\t\tif (this._lines.setWrappingSettings(fontInfo, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent)) {\n\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewFlushedEvent());\n\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));\n\t\t\tthis._cursor.onLineMappingChanged(eventsCollector);\n\t\t\tthis._decorations.onLineMappingChanged();\n\t\t\tthis.viewLayout.onFlushed(this.getLineCount());\n\n\t\t\tif (this.viewLayout.getCurrentScrollTop() !== 0) {\n\t\t\t\t// Never change the scroll position from 0 to something else...\n\t\t\t\trestorePreviousViewportStart = true;\n\t\t\t}\n\n\t\t\tthis._updateConfigurationViewLineCount.schedule();\n\t\t}\n\n\t\tif (e.hasChanged(EditorOption.readOnly)) {\n\t\t\t// Must read again all decorations due to readOnly filtering\n\t\t\tthis._decorations.reset();\n\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));\n\t\t}\n\n\t\teventsCollector.emitViewEvent(new viewEvents.ViewConfigurationChangedEvent(e));\n\t\tthis.viewLayout.onConfigurationChanged(e);\n\n\t\tif (restorePreviousViewportStart && previousViewportStartModelPosition) {\n\t\t\tconst viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(previousViewportStartModelPosition);\n\t\t\tconst viewPositionTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber);\n\t\t\tthis.viewLayout.setScrollPosition({ scrollTop: viewPositionTop + this._viewportStartLineDelta }, ScrollType.Immediate);\n\t\t}\n\n\t\tif (CursorConfiguration.shouldRecreate(e)) {\n\t\t\tthis.cursorConfig = new CursorConfiguration(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService);\n\t\t\tthis._cursor.updateConfiguration(this.cursorConfig);\n\t\t}\n\t}\n\n\tprivate _registerModelEvents(): void {\n\n\t\tthis._register(this.model.onDidChangeContentOrInjectedText((e) => {\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\n\t\t\t\tlet hadOtherModelChange = false;\n\t\t\t\tlet hadModelLineChangeThatChangedLineMapping = false;\n\n\t\t\t\tconst changes = e.changes;\n\t\t\t\tconst versionId = (e instanceof textModelEvents.ModelRawContentChangedEvent ? e.versionId : null);\n\n\t\t\t\t// Do a first pass to compute line mappings, and a second pass to actually interpret them\n\t\t\t\tconst lineBreaksComputer = this._lines.createLineBreaksComputer();\n\t\t\t\tfor (const change of changes) {\n\t\t\t\t\tswitch (change.changeType) {\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.LinesInserted: {\n\t\t\t\t\t\t\tfor (let lineIdx = 0; lineIdx < change.detail.length; lineIdx++) {\n\t\t\t\t\t\t\t\tconst line = change.detail[lineIdx];\n\t\t\t\t\t\t\t\tlet injectedText = change.injectedTexts[lineIdx];\n\t\t\t\t\t\t\t\tif (injectedText) {\n\t\t\t\t\t\t\t\t\tinjectedText = injectedText.filter(element => (!element.ownerId || element.ownerId === this._editorId));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlineBreaksComputer.addRequest(line, injectedText, null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.LineChanged: {\n\t\t\t\t\t\t\tlet injectedText: textModelEvents.LineInjectedText[] | null = null;\n\t\t\t\t\t\t\tif (change.injectedText) {\n\t\t\t\t\t\t\t\tinjectedText = change.injectedText.filter(element => (!element.ownerId || element.ownerId === this._editorId));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlineBreaksComputer.addRequest(change.detail, injectedText, null);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst lineBreaks = lineBreaksComputer.finalize();\n\t\t\t\tconst lineBreakQueue = new ArrayQueue(lineBreaks);\n\n\t\t\t\tfor (const change of changes) {\n\t\t\t\t\tswitch (change.changeType) {\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.Flush: {\n\t\t\t\t\t\t\tthis._lines.onModelFlushed();\n\t\t\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewFlushedEvent());\n\t\t\t\t\t\t\tthis._decorations.reset();\n\t\t\t\t\t\t\tthis.viewLayout.onFlushed(this.getLineCount());\n\t\t\t\t\t\t\thadOtherModelChange = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.LinesDeleted: {\n\t\t\t\t\t\t\tconst linesDeletedEvent = this._lines.onModelLinesDeleted(versionId, change.fromLineNumber, change.toLineNumber);\n\t\t\t\t\t\t\tif (linesDeletedEvent !== null) {\n\t\t\t\t\t\t\t\teventsCollector.emitViewEvent(linesDeletedEvent);\n\t\t\t\t\t\t\t\tthis.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thadOtherModelChange = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.LinesInserted: {\n\t\t\t\t\t\t\tconst insertedLineBreaks = lineBreakQueue.takeCount(change.detail.length);\n\t\t\t\t\t\t\tconst linesInsertedEvent = this._lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, insertedLineBreaks);\n\t\t\t\t\t\t\tif (linesInsertedEvent !== null) {\n\t\t\t\t\t\t\t\teventsCollector.emitViewEvent(linesInsertedEvent);\n\t\t\t\t\t\t\t\tthis.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thadOtherModelChange = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.LineChanged: {\n\t\t\t\t\t\t\tconst changedLineBreakData = lineBreakQueue.dequeue()!;\n\t\t\t\t\t\t\tconst [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] =\n\t\t\t\t\t\t\t\tthis._lines.onModelLineChanged(versionId, change.lineNumber, changedLineBreakData);\n\t\t\t\t\t\t\thadModelLineChangeThatChangedLineMapping = lineMappingChanged;\n\t\t\t\t\t\t\tif (linesChangedEvent) {\n\t\t\t\t\t\t\t\teventsCollector.emitViewEvent(linesChangedEvent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (linesInsertedEvent) {\n\t\t\t\t\t\t\t\teventsCollector.emitViewEvent(linesInsertedEvent);\n\t\t\t\t\t\t\t\tthis.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (linesDeletedEvent) {\n\t\t\t\t\t\t\t\teventsCollector.emitViewEvent(linesDeletedEvent);\n\t\t\t\t\t\t\t\tthis.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase textModelEvents.RawContentChangedType.EOLChanged: {\n\t\t\t\t\t\t\t// Nothing to do. The new version will be accepted below\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (versionId !== null) {\n\t\t\t\t\tthis._lines.acceptVersionId(versionId);\n\t\t\t\t}\n\t\t\t\tthis.viewLayout.onHeightMaybeChanged();\n\n\t\t\t\tif (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) {\n\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));\n\t\t\t\t\tthis._cursor.onLineMappingChanged(eventsCollector);\n\t\t\t\t\tthis._decorations.onLineMappingChanged();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t\t}\n\n\t\t\t// Update the configuration and reset the centered view line\n\t\t\tthis._viewportStartLine = -1;\n\t\t\tthis._configuration.setModelLineCount(this.model.getLineCount());\n\t\t\tthis._updateConfigurationViewLineCountNow();\n\n\t\t\t// Recover viewport\n\t\t\tif (!this._hasFocus && this.model.getAttachedEditorCount() >= 2 && this._viewportStartLineTrackedRange) {\n\t\t\t\tconst modelRange = this.model._getTrackedRange(this._viewportStartLineTrackedRange);\n\t\t\t\tif (modelRange) {\n\t\t\t\t\tconst viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(modelRange.getStartPosition());\n\t\t\t\t\tconst viewPositionTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber);\n\t\t\t\t\tthis.viewLayout.setScrollPosition({ scrollTop: viewPositionTop + this._viewportStartLineDelta }, ScrollType.Immediate);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\t\t\t\tthis._cursor.onModelContentChanged(eventsCollector, e);\n\t\t\t} finally {\n\t\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t\t}\n\n\t\t\tthis._tokenizeViewportSoon.schedule();\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeTokens((e) => {\n\t\t\tconst viewRanges: { fromLineNumber: number; toLineNumber: number }[] = [];\n\t\t\tfor (let j = 0, lenJ = e.ranges.length; j < lenJ; j++) {\n\t\t\t\tconst modelRange = e.ranges[j];\n\t\t\t\tconst viewStartLineNumber = this.coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.fromLineNumber, 1)).lineNumber;\n\t\t\t\tconst viewEndLineNumber = this.coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.toLineNumber, this.model.getLineMaxColumn(modelRange.toLineNumber))).lineNumber;\n\t\t\t\tviewRanges[j] = {\n\t\t\t\t\tfromLineNumber: viewStartLineNumber,\n\t\t\t\t\ttoLineNumber: viewEndLineNumber\n\t\t\t\t};\n\t\t\t}\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewTokensChangedEvent(viewRanges));\n\n\t\t\tif (e.tokenizationSupportChanged) {\n\t\t\t\tthis._tokenizeViewportSoon.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeLanguageConfiguration((e) => {\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewLanguageConfigurationEvent());\n\t\t\tthis.cursorConfig = new CursorConfiguration(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService);\n\t\t\tthis._cursor.updateConfiguration(this.cursorConfig);\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeLanguage((e) => {\n\t\t\tthis.cursorConfig = new CursorConfiguration(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService);\n\t\t\tthis._cursor.updateConfiguration(this.cursorConfig);\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeOptions((e) => {\n\t\t\t// A tab size change causes a line mapping changed event => all view parts will repaint OK, no further event needed here\n\t\t\tif (this._lines.setTabSize(this.model.getOptions().tabSize)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewFlushedEvent());\n\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));\n\t\t\t\t\tthis._cursor.onLineMappingChanged(eventsCollector);\n\t\t\t\t\tthis._decorations.onLineMappingChanged();\n\t\t\t\t\tthis.viewLayout.onFlushed(this.getLineCount());\n\t\t\t\t} finally {\n\t\t\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t\t\t}\n\t\t\t\tthis._updateConfigurationViewLineCount.schedule();\n\t\t\t}\n\n\t\t\tthis.cursorConfig = new CursorConfiguration(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService);\n\t\t\tthis._cursor.updateConfiguration(this.cursorConfig);\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeDecorations((e) => {\n\t\t\tthis._decorations.onModelDecorationsChanged();\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewDecorationsChangedEvent(e));\n\t\t}));\n\t}\n\n\tpublic setHiddenAreas(ranges: Range[]): void {\n\t\tlet lineMappingChanged = false;\n\t\ttry {\n\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\t\t\tlineMappingChanged = this._lines.setHiddenAreas(ranges);\n\t\t\tif (lineMappingChanged) {\n\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewFlushedEvent());\n\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\teventsCollector.emitViewEvent(new viewEvents.ViewDecorationsChangedEvent(null));\n\t\t\t\tthis._cursor.onLineMappingChanged(eventsCollector);\n\t\t\t\tthis._decorations.onLineMappingChanged();\n\t\t\t\tthis.viewLayout.onFlushed(this.getLineCount());\n\t\t\t\tthis.viewLayout.onHeightMaybeChanged();\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t}\n\t\tthis._updateConfigurationViewLineCount.schedule();\n\n\t\tif (lineMappingChanged) {\n\t\t\tthis._eventDispatcher.emitOutgoingEvent(new ViewZonesChangedEvent());\n\t\t}\n\t}\n\n\tpublic getVisibleRangesPlusViewportAboveBelow(): Range[] {\n\t\tconst layoutInfo = this._configuration.options.get(EditorOption.layoutInfo);\n\t\tconst lineHeight = this._configuration.options.get(EditorOption.lineHeight);\n\t\tconst linesAround = Math.max(20, Math.round(layoutInfo.height / lineHeight));\n\t\tconst partialData = this.viewLayout.getLinesViewportData();\n\t\tconst startViewLineNumber = Math.max(1, partialData.completelyVisibleStartLineNumber - linesAround);\n\t\tconst endViewLineNumber = Math.min(this.getLineCount(), partialData.completelyVisibleEndLineNumber + linesAround);\n\n\t\treturn this._toModelVisibleRanges(new Range(\n\t\t\tstartViewLineNumber, this.getLineMinColumn(startViewLineNumber),\n\t\t\tendViewLineNumber, this.getLineMaxColumn(endViewLineNumber)\n\t\t));\n\t}\n\n\tpublic getVisibleRanges(): Range[] {\n\t\tconst visibleViewRange = this.getCompletelyVisibleViewRange();\n\t\treturn this._toModelVisibleRanges(visibleViewRange);\n\t}\n\n\tprivate _toModelVisibleRanges(visibleViewRange: Range): Range[] {\n\t\tconst visibleRange = this.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange);\n\t\tconst hiddenAreas = this._lines.getHiddenAreas();\n\n\t\tif (hiddenAreas.length === 0) {\n\t\t\treturn [visibleRange];\n\t\t}\n\n\t\tconst result: Range[] = [];\n\t\tlet resultLen = 0;\n\t\tlet startLineNumber = visibleRange.startLineNumber;\n\t\tlet startColumn = visibleRange.startColumn;\n\t\tconst endLineNumber = visibleRange.endLineNumber;\n\t\tconst endColumn = visibleRange.endColumn;\n\t\tfor (let i = 0, len = hiddenAreas.length; i < len; i++) {\n\t\t\tconst hiddenStartLineNumber = hiddenAreas[i].startLineNumber;\n\t\t\tconst hiddenEndLineNumber = hiddenAreas[i].endLineNumber;\n\n\t\t\tif (hiddenEndLineNumber < startLineNumber) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hiddenStartLineNumber > endLineNumber) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (startLineNumber < hiddenStartLineNumber) {\n\t\t\t\tresult[resultLen++] = new Range(\n\t\t\t\t\tstartLineNumber, startColumn,\n\t\t\t\t\thiddenStartLineNumber - 1, this.model.getLineMaxColumn(hiddenStartLineNumber - 1)\n\t\t\t\t);\n\t\t\t}\n\t\t\tstartLineNumber = hiddenEndLineNumber + 1;\n\t\t\tstartColumn = 1;\n\t\t}\n\n\t\tif (startLineNumber < endLineNumber || (startLineNumber === endLineNumber && startColumn < endColumn)) {\n\t\t\tresult[resultLen++] = new Range(\n\t\t\t\tstartLineNumber, startColumn,\n\t\t\t\tendLineNumber, endColumn\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic getCompletelyVisibleViewRange(): Range {\n\t\tconst partialData = this.viewLayout.getLinesViewportData();\n\t\tconst startViewLineNumber = partialData.completelyVisibleStartLineNumber;\n\t\tconst endViewLineNumber = partialData.completelyVisibleEndLineNumber;\n\n\t\treturn new Range(\n\t\t\tstartViewLineNumber, this.getLineMinColumn(startViewLineNumber),\n\t\t\tendViewLineNumber, this.getLineMaxColumn(endViewLineNumber)\n\t\t);\n\t}\n\n\tpublic getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range {\n\t\tconst partialData = this.viewLayout.getLinesViewportDataAtScrollTop(scrollTop);\n\t\tconst startViewLineNumber = partialData.completelyVisibleStartLineNumber;\n\t\tconst endViewLineNumber = partialData.completelyVisibleEndLineNumber;\n\n\t\treturn new Range(\n\t\t\tstartViewLineNumber, this.getLineMinColumn(startViewLineNumber),\n\t\t\tendViewLineNumber, this.getLineMaxColumn(endViewLineNumber)\n\t\t);\n\t}\n\n\tpublic saveState(): IViewState {\n\t\tconst compatViewState = this.viewLayout.saveState();\n\n\t\tconst scrollTop = compatViewState.scrollTop;\n\t\tconst firstViewLineNumber = this.viewLayout.getLineNumberAtVerticalOffset(scrollTop);\n\t\tconst firstPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(firstViewLineNumber, this.getLineMinColumn(firstViewLineNumber)));\n\t\tconst firstPositionDeltaTop = this.viewLayout.getVerticalOffsetForLineNumber(firstViewLineNumber) - scrollTop;\n\n\t\treturn {\n\t\t\tscrollLeft: compatViewState.scrollLeft,\n\t\t\tfirstPosition: firstPosition,\n\t\t\tfirstPositionDeltaTop: firstPositionDeltaTop\n\t\t};\n\t}\n\n\tpublic reduceRestoreState(state: IViewState): { scrollLeft: number; scrollTop: number } {\n\t\tif (typeof state.firstPosition === 'undefined') {\n\t\t\t// This is a view state serialized by an older version\n\t\t\treturn this._reduceRestoreStateCompatibility(state);\n\t\t}\n\n\t\tconst modelPosition = this.model.validatePosition(state.firstPosition);\n\t\tconst viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(modelPosition);\n\t\tconst scrollTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber) - state.firstPositionDeltaTop;\n\t\treturn {\n\t\t\tscrollLeft: state.scrollLeft,\n\t\t\tscrollTop: scrollTop\n\t\t};\n\t}\n\n\tprivate _reduceRestoreStateCompatibility(state: IViewState): { scrollLeft: number; scrollTop: number } {\n\t\treturn {\n\t\t\tscrollLeft: state.scrollLeft,\n\t\t\tscrollTop: state.scrollTopWithoutViewZones!\n\t\t};\n\t}\n\n\tprivate getTabSize(): number {\n\t\treturn this.model.getOptions().tabSize;\n\t}\n\n\tpublic getLineCount(): number {\n\t\treturn this._lines.getViewLineCount();\n\t}\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tpublic setViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void {\n\t\tthis._viewportStartLine = startLineNumber;\n\t\tconst position = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(startLineNumber, this.getLineMinColumn(startLineNumber)));\n\t\tthis._viewportStartLineTrackedRange = this.model._setTrackedRange(this._viewportStartLineTrackedRange, new Range(position.lineNumber, position.column, position.lineNumber, position.column), TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges);\n\t\tconst viewportStartLineTop = this.viewLayout.getVerticalOffsetForLineNumber(startLineNumber);\n\t\tconst scrollTop = this.viewLayout.getCurrentScrollTop();\n\t\tthis._viewportStartLineDelta = scrollTop - viewportStartLineTop;\n\t}\n\n\tpublic getActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo {\n\t\treturn this._lines.getActiveIndentGuide(lineNumber, minLineNumber, maxLineNumber);\n\t}\n\n\tpublic getLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[] {\n\t\treturn this._lines.getViewLinesIndentGuides(startLineNumber, endLineNumber);\n\t}\n\n\tpublic getBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][] {\n\t\treturn this._lines.getViewLinesBracketGuides(startLineNumber, endLineNumber, activePosition, options);\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\treturn this._lines.getViewLineContent(lineNumber);\n\t}\n\n\tpublic getLineLength(lineNumber: number): number {\n\t\treturn this._lines.getViewLineLength(lineNumber);\n\t}\n\n\tpublic getLineMinColumn(lineNumber: number): number {\n\t\treturn this._lines.getViewLineMinColumn(lineNumber);\n\t}\n\n\tpublic getLineMaxColumn(lineNumber: number): number {\n\t\treturn this._lines.getViewLineMaxColumn(lineNumber);\n\t}\n\n\tpublic getLineFirstNonWhitespaceColumn(lineNumber: number): number {\n\t\tconst result = strings.firstNonWhitespaceIndex(this.getLineContent(lineNumber));\n\t\tif (result === -1) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn result + 1;\n\t}\n\n\tpublic getLineLastNonWhitespaceColumn(lineNumber: number): number {\n\t\tconst result = strings.lastNonWhitespaceIndex(this.getLineContent(lineNumber));\n\t\tif (result === -1) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn result + 2;\n\t}\n\n\tpublic getDecorationsInViewport(visibleRange: Range): ViewModelDecoration[] {\n\t\treturn this._decorations.getDecorationsViewportData(visibleRange).decorations;\n\t}\n\n\tpublic getInjectedTextAt(viewPosition: Position): InjectedText | null {\n\t\treturn this._lines.getInjectedTextAt(viewPosition);\n\t}\n\n\tpublic getViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData {\n\t\tconst mightContainRTL = this.model.mightContainRTL();\n\t\tconst mightContainNonBasicASCII = this.model.mightContainNonBasicASCII();\n\t\tconst tabSize = this.getTabSize();\n\t\tconst lineData = this._lines.getViewLineData(lineNumber);\n\t\tconst allInlineDecorations = this._decorations.getDecorationsViewportData(visibleRange).inlineDecorations;\n\t\tlet inlineDecorations = allInlineDecorations[lineNumber - visibleRange.startLineNumber];\n\n\t\tif (lineData.inlineDecorations) {\n\t\t\tinlineDecorations = [\n\t\t\t\t...inlineDecorations,\n\t\t\t\t...lineData.inlineDecorations.map(d =>\n\t\t\t\t\td.toInlineDecoration(lineNumber)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\n\t\treturn new ViewLineRenderingData(\n\t\t\tlineData.minColumn,\n\t\t\tlineData.maxColumn,\n\t\t\tlineData.content,\n\t\t\tlineData.continuesWithWrappedLine,\n\t\t\tmightContainRTL,\n\t\t\tmightContainNonBasicASCII,\n\t\t\tlineData.tokens,\n\t\t\tinlineDecorations,\n\t\t\ttabSize,\n\t\t\tlineData.startVisibleColumn\n\t\t);\n\t}\n\n\tpublic getViewLineData(lineNumber: number): ViewLineData {\n\t\treturn this._lines.getViewLineData(lineNumber);\n\t}\n\n\tpublic getMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData {\n\t\tconst result = this._lines.getViewLinesData(startLineNumber, endLineNumber, needed);\n\t\treturn new MinimapLinesRenderingData(\n\t\t\tthis.getTabSize(),\n\t\t\tresult\n\t\t);\n\t}\n\n\tpublic getAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[] {\n\t\tconst decorations = this.model.getOverviewRulerDecorations(this._editorId, filterValidationDecorations(this._configuration.options));\n\t\tconst result = new OverviewRulerDecorations();\n\t\tfor (const decoration of decorations) {\n\t\t\tconst decorationOptions = <ModelDecorationOptions>decoration.options;\n\t\t\tconst opts = decorationOptions.overviewRuler;\n\t\t\tif (!opts) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst lane = <number>opts.position;\n\t\t\tif (lane === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst color = opts.getColor(theme.value);\n\t\t\tconst viewStartLineNumber = this.coordinatesConverter.getViewLineNumberOfModelPosition(decoration.range.startLineNumber, decoration.range.startColumn);\n\t\t\tconst viewEndLineNumber = this.coordinatesConverter.getViewLineNumberOfModelPosition(decoration.range.endLineNumber, decoration.range.endColumn);\n\n\t\t\tresult.accept(color, decorationOptions.zIndex, viewStartLineNumber, viewEndLineNumber, lane);\n\t\t}\n\t\treturn result.asArray;\n\t}\n\n\tprivate _invalidateDecorationsColorCache(): void {\n\t\tconst decorations = this.model.getOverviewRulerDecorations();\n\t\tfor (const decoration of decorations) {\n\t\t\tconst opts1 = <ModelDecorationOverviewRulerOptions>decoration.options.overviewRuler;\n\t\t\tif (opts1) {\n\t\t\t\topts1.invalidateCachedColor();\n\t\t\t}\n\t\t\tconst opts2 = <ModelDecorationMinimapOptions>decoration.options.minimap;\n\t\t\tif (opts2) {\n\t\t\t\topts2.invalidateCachedColor();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getValueInRange(range: Range, eol: EndOfLinePreference): string {\n\t\tconst modelRange = this.coordinatesConverter.convertViewRangeToModelRange(range);\n\t\treturn this.model.getValueInRange(modelRange, eol);\n\t}\n\n\tpublic deduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position {\n\t\tconst modelAnchor = this.coordinatesConverter.convertViewPositionToModelPosition(viewAnchorPosition);\n\t\tif (this.model.getEOL().length === 2) {\n\t\t\t// This model uses CRLF, so the delta must take that into account\n\t\t\tif (deltaOffset < 0) {\n\t\t\t\tdeltaOffset -= lineFeedCnt;\n\t\t\t} else {\n\t\t\t\tdeltaOffset += lineFeedCnt;\n\t\t\t}\n\t\t}\n\n\t\tconst modelAnchorOffset = this.model.getOffsetAt(modelAnchor);\n\t\tconst resultOffset = modelAnchorOffset + deltaOffset;\n\t\treturn this.model.getPositionAt(resultOffset);\n\t}\n\n\tpublic getPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[] {\n\t\tconst newLineCharacter = forceCRLF ? '\\r\\n' : this.model.getEOL();\n\n\t\tmodelRanges = modelRanges.slice(0);\n\t\tmodelRanges.sort(Range.compareRangesUsingStarts);\n\n\t\tlet hasEmptyRange = false;\n\t\tlet hasNonEmptyRange = false;\n\t\tfor (const range of modelRanges) {\n\t\t\tif (range.isEmpty()) {\n\t\t\t\thasEmptyRange = true;\n\t\t\t} else {\n\t\t\t\thasNonEmptyRange = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasNonEmptyRange) {\n\t\t\t// all ranges are empty\n\t\t\tif (!emptySelectionClipboard) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst modelLineNumbers = modelRanges.map((r) => r.startLineNumber);\n\n\t\t\tlet result = '';\n\t\t\tfor (let i = 0; i < modelLineNumbers.length; i++) {\n\t\t\t\tif (i > 0 && modelLineNumbers[i - 1] === modelLineNumbers[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresult += this.model.getLineContent(modelLineNumbers[i]) + newLineCharacter;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tif (hasEmptyRange && emptySelectionClipboard) {\n\t\t\t// mixed empty selections and non-empty selections\n\t\t\tconst result: string[] = [];\n\t\t\tlet prevModelLineNumber = 0;\n\t\t\tfor (const modelRange of modelRanges) {\n\t\t\t\tconst modelLineNumber = modelRange.startLineNumber;\n\t\t\t\tif (modelRange.isEmpty()) {\n\t\t\t\t\tif (modelLineNumber !== prevModelLineNumber) {\n\t\t\t\t\t\tresult.push(this.model.getLineContent(modelLineNumber));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(this.model.getValueInRange(modelRange, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined));\n\t\t\t\t}\n\t\t\t\tprevModelLineNumber = modelLineNumber;\n\t\t\t}\n\t\t\treturn result.length === 1 ? result[0] : result;\n\t\t}\n\n\t\tconst result: string[] = [];\n\t\tfor (const modelRange of modelRanges) {\n\t\t\tif (!modelRange.isEmpty()) {\n\t\t\t\tresult.push(this.model.getValueInRange(modelRange, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined));\n\t\t\t}\n\t\t}\n\t\treturn result.length === 1 ? result[0] : result;\n\t}\n\n\tpublic getRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null {\n\t\tconst languageId = this.model.getLanguageId();\n\t\tif (languageId === PLAINTEXT_LANGUAGE_ID) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (modelRanges.length !== 1) {\n\t\t\t// no multiple selection support at this time\n\t\t\treturn null;\n\t\t}\n\n\t\tlet range = modelRanges[0];\n\t\tif (range.isEmpty()) {\n\t\t\tif (!emptySelectionClipboard) {\n\t\t\t\t// nothing to copy\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst lineNumber = range.startLineNumber;\n\t\t\trange = new Range(lineNumber, this.model.getLineMinColumn(lineNumber), lineNumber, this.model.getLineMaxColumn(lineNumber));\n\t\t}\n\n\t\tconst fontInfo = this._configuration.options.get(EditorOption.fontInfo);\n\t\tconst colorMap = this._getColorMap();\n\t\tconst hasBadChars = (/[:;\\\\\\/<>]/.test(fontInfo.fontFamily));\n\t\tconst useDefaultFontFamily = (hasBadChars || fontInfo.fontFamily === EDITOR_FONT_DEFAULTS.fontFamily);\n\t\tlet fontFamily: string;\n\t\tif (useDefaultFontFamily) {\n\t\t\tfontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n\t\t} else {\n\t\t\tfontFamily = fontInfo.fontFamily;\n\t\t\tfontFamily = fontFamily.replace(/\"/g, '\\'');\n\t\t\tconst hasQuotesOrIsList = /[,']/.test(fontFamily);\n\t\t\tif (!hasQuotesOrIsList) {\n\t\t\t\tconst needsQuotes = /[+ ]/.test(fontFamily);\n\t\t\t\tif (needsQuotes) {\n\t\t\t\t\tfontFamily = `'${fontFamily}'`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfontFamily = `${fontFamily}, ${EDITOR_FONT_DEFAULTS.fontFamily}`;\n\t\t}\n\n\t\treturn {\n\t\t\tmode: languageId,\n\t\t\thtml: (\n\t\t\t\t`<div style=\"`\n\t\t\t\t+ `color: ${colorMap[ColorId.DefaultForeground]};`\n\t\t\t\t+ `background-color: ${colorMap[ColorId.DefaultBackground]};`\n\t\t\t\t+ `font-family: ${fontFamily};`\n\t\t\t\t+ `font-weight: ${fontInfo.fontWeight};`\n\t\t\t\t+ `font-size: ${fontInfo.fontSize}px;`\n\t\t\t\t+ `line-height: ${fontInfo.lineHeight}px;`\n\t\t\t\t+ `white-space: pre;`\n\t\t\t\t+ `\">`\n\t\t\t\t+ this._getHTMLToCopy(range, colorMap)\n\t\t\t\t+ '</div>'\n\t\t\t)\n\t\t};\n\t}\n\n\tprivate _getHTMLToCopy(modelRange: Range, colorMap: string[]): string {\n\t\tconst startLineNumber = modelRange.startLineNumber;\n\t\tconst startColumn = modelRange.startColumn;\n\t\tconst endLineNumber = modelRange.endLineNumber;\n\t\tconst endColumn = modelRange.endColumn;\n\n\t\tconst tabSize = this.getTabSize();\n\n\t\tlet result = '';\n\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tconst lineTokens = this.model.getLineTokens(lineNumber);\n\t\t\tconst lineContent = lineTokens.getLineContent();\n\t\t\tconst startOffset = (lineNumber === startLineNumber ? startColumn - 1 : 0);\n\t\t\tconst endOffset = (lineNumber === endLineNumber ? endColumn - 1 : lineContent.length);\n\n\t\t\tif (lineContent === '') {\n\t\t\t\tresult += '<br>';\n\t\t\t} else {\n\t\t\t\tresult += tokenizeLineToHTML(lineContent, lineTokens.inflate(), colorMap, startOffset, endOffset, tabSize, platform.isWindows);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _getColorMap(): string[] {\n\t\tconst colorMap = TokenizationRegistry.getColorMap();\n\t\tconst result: string[] = ['#000000'];\n\t\tif (colorMap) {\n\t\t\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\t\t\tresult[i] = Color.Format.CSS.formatHex(colorMap[i]);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t//#region cursor operations\n\n\tpublic getPrimaryCursorState(): CursorState {\n\t\treturn this._cursor.getPrimaryCursorState();\n\t}\n\tpublic getLastAddedCursorIndex(): number {\n\t\treturn this._cursor.getLastAddedCursorIndex();\n\t}\n\tpublic getCursorStates(): CursorState[] {\n\t\treturn this._cursor.getCursorStates();\n\t}\n\tpublic setCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean {\n\t\treturn this._withViewEventsCollector(eventsCollector => this._cursor.setStates(eventsCollector, source, reason, states));\n\t}\n\tpublic getCursorColumnSelectData(): IColumnSelectData {\n\t\treturn this._cursor.getCursorColumnSelectData();\n\t}\n\tpublic getCursorAutoClosedCharacters(): Range[] {\n\t\treturn this._cursor.getAutoClosedCharacters();\n\t}\n\tpublic setCursorColumnSelectData(columnSelectData: IColumnSelectData): void {\n\t\tthis._cursor.setCursorColumnSelectData(columnSelectData);\n\t}\n\tpublic getPrevEditOperationType(): EditOperationType {\n\t\treturn this._cursor.getPrevEditOperationType();\n\t}\n\tpublic setPrevEditOperationType(type: EditOperationType): void {\n\t\tthis._cursor.setPrevEditOperationType(type);\n\t}\n\tpublic getSelection(): Selection {\n\t\treturn this._cursor.getSelection();\n\t}\n\tpublic getSelections(): Selection[] {\n\t\treturn this._cursor.getSelections();\n\t}\n\tpublic getPosition(): Position {\n\t\treturn this._cursor.getPrimaryCursorState().modelState.position;\n\t}\n\tpublic setSelections(source: string | null | undefined, selections: readonly ISelection[], reason = CursorChangeReason.NotSet): void {\n\t\tthis._withViewEventsCollector(eventsCollector => this._cursor.setSelections(eventsCollector, source, selections, reason));\n\t}\n\tpublic saveCursorState(): ICursorState[] {\n\t\treturn this._cursor.saveState();\n\t}\n\tpublic restoreCursorState(states: ICursorState[]): void {\n\t\tthis._withViewEventsCollector(eventsCollector => this._cursor.restoreState(eventsCollector, states));\n\t}\n\n\tprivate _executeCursorEdit(callback: (eventsCollector: ViewModelEventsCollector) => void): void {\n\t\tif (this._cursor.context.cursorConfig.readOnly) {\n\t\t\t// we cannot edit when read only...\n\t\t\tthis._eventDispatcher.emitOutgoingEvent(new ReadOnlyEditAttemptEvent());\n\t\t\treturn;\n\t\t}\n\t\tthis._withViewEventsCollector(callback);\n\t}\n\tpublic executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.executeEdits(eventsCollector, source, edits, cursorStateComputer));\n\t}\n\tpublic startComposition(): void {\n\t\tthis._cursor.setIsDoingComposition(true);\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.startComposition(eventsCollector));\n\t}\n\tpublic endComposition(source?: string | null | undefined): void {\n\t\tthis._cursor.setIsDoingComposition(false);\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.endComposition(eventsCollector, source));\n\t}\n\tpublic type(text: string, source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.type(eventsCollector, text, source));\n\t}\n\tpublic compositionType(text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number, source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.compositionType(eventsCollector, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta, source));\n\t}\n\tpublic paste(text: string, pasteOnNewLine: boolean, multicursorText?: string[] | null | undefined, source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.paste(eventsCollector, text, pasteOnNewLine, multicursorText, source));\n\t}\n\tpublic cut(source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.cut(eventsCollector, source));\n\t}\n\tpublic executeCommand(command: ICommand, source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.executeCommand(eventsCollector, command, source));\n\t}\n\tpublic executeCommands(commands: ICommand[], source?: string | null | undefined): void {\n\t\tthis._executeCursorEdit(eventsCollector => this._cursor.executeCommands(eventsCollector, commands, source));\n\t}\n\tpublic revealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal: boolean = false): void {\n\t\tthis._withViewEventsCollector(eventsCollector => this._cursor.revealPrimary(eventsCollector, source, minimalReveal, viewEvents.VerticalRevealType.Simple, revealHorizontal, ScrollType.Smooth));\n\t}\n\tpublic revealTopMostCursor(source: string | null | undefined): void {\n\t\tconst viewPosition = this._cursor.getTopMostViewPosition();\n\t\tconst viewRange = new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column);\n\t\tthis._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new viewEvents.ViewRevealRangeRequestEvent(source, false, viewRange, null, viewEvents.VerticalRevealType.Simple, true, ScrollType.Smooth)));\n\t}\n\tpublic revealBottomMostCursor(source: string | null | undefined): void {\n\t\tconst viewPosition = this._cursor.getBottomMostViewPosition();\n\t\tconst viewRange = new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column);\n\t\tthis._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new viewEvents.ViewRevealRangeRequestEvent(source, false, viewRange, null, viewEvents.VerticalRevealType.Simple, true, ScrollType.Smooth)));\n\t}\n\tpublic revealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: viewEvents.VerticalRevealType, scrollType: ScrollType): void {\n\t\tthis._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new viewEvents.ViewRevealRangeRequestEvent(source, false, viewRange, null, verticalType, revealHorizontal, scrollType)));\n\t}\n\n\t//#endregion\n\n\t//#region viewLayout\n\tpublic changeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void {\n\t\tconst hadAChange = this.viewLayout.changeWhitespace(callback);\n\t\tif (hadAChange) {\n\t\t\tthis._eventDispatcher.emitSingleViewEvent(new viewEvents.ViewZonesChangedEvent());\n\t\t\tthis._eventDispatcher.emitOutgoingEvent(new ViewZonesChangedEvent());\n\t\t}\n\t}\n\t//#endregion\n\n\tprivate _withViewEventsCollector<T>(callback: (eventsCollector: ViewModelEventsCollector) => T): T {\n\t\ttry {\n\t\t\tconst eventsCollector = this._eventDispatcher.beginEmitViewEvents();\n\t\t\treturn callback(eventsCollector);\n\t\t} finally {\n\t\t\tthis._eventDispatcher.endEmitViewEvents();\n\t\t}\n\t}\n\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position {\n\t\treturn this._lines.normalizePosition(position, affinity);\n\t}\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t*/\n\tgetLineIndentColumn(lineNumber: number): number {\n\t\treturn this._lines.getLineIndentColumn(lineNumber);\n\t}\n}\n\nclass OverviewRulerDecorations {\n\n\tprivate readonly _asMap: { [color: string]: OverviewRulerDecorationsGroup } = Object.create(null);\n\treadonly asArray: OverviewRulerDecorationsGroup[] = [];\n\n\tpublic accept(color: string, zIndex: number, startLineNumber: number, endLineNumber: number, lane: number): void {\n\t\tconst prevGroup = this._asMap[color];\n\n\t\tif (prevGroup) {\n\t\t\tconst prevData = prevGroup.data;\n\t\t\tconst prevLane = prevData[prevData.length - 3];\n\t\t\tconst prevEndLineNumber = prevData[prevData.length - 1];\n\t\t\tif (prevLane === lane && prevEndLineNumber + 1 >= startLineNumber) {\n\t\t\t\t// merge into prev\n\t\t\t\tif (endLineNumber > prevEndLineNumber) {\n\t\t\t\t\tprevData[prevData.length - 1] = endLineNumber;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// push\n\t\t\tprevData.push(lane, startLineNumber, endLineNumber);\n\t\t} else {\n\t\t\tconst group = new OverviewRulerDecorationsGroup(color, zIndex, [lane, startLineNumber, endLineNumber]);\n\t\t\tthis._asMap[color] = group;\n\t\t\tthis.asArray.push(group);\n\t\t}\n\t}\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 'vs/editor/browser/services/markerDecorations';\n\nimport 'vs/css!./media/editor';\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { Color } from 'vs/base/common/color';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { Schemas } from 'vs/base/common/network';\nimport { EditorConfiguration, IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { EditorExtensionsRegistry, IEditorContributionDescription } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ICommandDelegate } from 'vs/editor/browser/view/viewController';\nimport { IContentWidgetData, IOverlayWidgetData, View } from 'vs/editor/browser/view';\nimport { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents';\nimport { ConfigurationChangedEvent, EditorLayoutInfo, IEditorOptions, EditorOption, IComputedEditorOptions, FindComputedEditorOptionValueById, filterValidationDecorations } from 'vs/editor/common/config/editorOptions';\nimport { CursorsController } from 'vs/editor/common/cursor/cursor';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { CursorChangeReason, ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\nimport { InternalEditorAction } from 'vs/editor/common/editorAction';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { EndOfLinePreference, IIdentifiedSingleEditOperation, IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, ICursorStateComputer } from 'vs/editor/common/model';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { ClassName } from 'vs/editor/common/model/intervalTree';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity } from 'vs/editor/common/core/editorColorRegistry';\nimport { editorErrorBorder, editorErrorForeground, editorHintBorder, editorHintForeground, editorInfoBorder, editorInfoForeground, editorWarningBorder, editorWarningForeground, editorForeground, editorErrorBackground, editorInfoBackground, editorWarningBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { VerticalRevealType } from 'vs/editor/common/viewEvents';\nimport { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer';\nimport { DOMLineBreaksComputerFactory } from 'vs/editor/browser/view/domLineBreaksComputer';\nimport { WordOperations } from 'vs/editor/common/cursor/cursorWordOperations';\nimport { IEditorWhitespace, IViewModel } from 'vs/editor/common/viewModel';\nimport { OutgoingViewModelEventKind } from 'vs/editor/common/viewModelEventDispatcher';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration';\nimport { IDimension } from 'vs/editor/common/core/dimension';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nlet EDITOR_ID = 0;\n\nexport interface ICodeEditorWidgetOptions {\n\t/**\n\t * Is this a simple widget (not a real code editor)?\n\t * Defaults to false.\n\t */\n\tisSimpleWidget?: boolean;\n\n\t/**\n\t * Contributions to instantiate.\n\t * Defaults to EditorExtensionsRegistry.getEditorContributions().\n\t */\n\tcontributions?: IEditorContributionDescription[];\n\n\t/**\n\t * Telemetry data associated with this CodeEditorWidget.\n\t * Defaults to null.\n\t */\n\ttelemetryData?: object;\n}\n\nclass ModelData {\n\tpublic readonly model: ITextModel;\n\tpublic readonly viewModel: ViewModel;\n\tpublic readonly view: View;\n\tpublic readonly hasRealView: boolean;\n\tpublic readonly listenersToRemove: IDisposable[];\n\n\tconstructor(model: ITextModel, viewModel: ViewModel, view: View, hasRealView: boolean, listenersToRemove: IDisposable[]) {\n\t\tthis.model = model;\n\t\tthis.viewModel = viewModel;\n\t\tthis.view = view;\n\t\tthis.hasRealView = hasRealView;\n\t\tthis.listenersToRemove = listenersToRemove;\n\t}\n\n\tpublic dispose(): void {\n\t\tdispose(this.listenersToRemove);\n\t\tthis.model.onBeforeDetached();\n\t\tif (this.hasRealView) {\n\t\t\tthis.view.dispose();\n\t\t}\n\t\tthis.viewModel.dispose();\n\t}\n}\n\nexport class CodeEditorWidget extends Disposable implements editorBrowser.ICodeEditor {\n\n\t//#region Eventing\n\tprivate readonly _onDidDispose: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidDispose: Event<void> = this._onDidDispose.event;\n\n\tprivate readonly _onDidChangeModelContent: Emitter<IModelContentChangedEvent> = this._register(new Emitter<IModelContentChangedEvent>());\n\tpublic readonly onDidChangeModelContent: Event<IModelContentChangedEvent> = this._onDidChangeModelContent.event;\n\n\tprivate readonly _onDidChangeModelLanguage: Emitter<IModelLanguageChangedEvent> = this._register(new Emitter<IModelLanguageChangedEvent>());\n\tpublic readonly onDidChangeModelLanguage: Event<IModelLanguageChangedEvent> = this._onDidChangeModelLanguage.event;\n\n\tprivate readonly _onDidChangeModelLanguageConfiguration: Emitter<IModelLanguageConfigurationChangedEvent> = this._register(new Emitter<IModelLanguageConfigurationChangedEvent>());\n\tpublic readonly onDidChangeModelLanguageConfiguration: Event<IModelLanguageConfigurationChangedEvent> = this._onDidChangeModelLanguageConfiguration.event;\n\n\tprivate readonly _onDidChangeModelOptions: Emitter<IModelOptionsChangedEvent> = this._register(new Emitter<IModelOptionsChangedEvent>());\n\tpublic readonly onDidChangeModelOptions: Event<IModelOptionsChangedEvent> = this._onDidChangeModelOptions.event;\n\n\tprivate readonly _onDidChangeModelDecorations: Emitter<IModelDecorationsChangedEvent> = this._register(new Emitter<IModelDecorationsChangedEvent>());\n\tpublic readonly onDidChangeModelDecorations: Event<IModelDecorationsChangedEvent> = this._onDidChangeModelDecorations.event;\n\n\tprivate readonly _onDidChangeConfiguration: Emitter<ConfigurationChangedEvent> = this._register(new Emitter<ConfigurationChangedEvent>());\n\tpublic readonly onDidChangeConfiguration: Event<ConfigurationChangedEvent> = this._onDidChangeConfiguration.event;\n\n\tprotected readonly _onDidChangeModel: Emitter<editorCommon.IModelChangedEvent> = this._register(new Emitter<editorCommon.IModelChangedEvent>());\n\tpublic readonly onDidChangeModel: Event<editorCommon.IModelChangedEvent> = this._onDidChangeModel.event;\n\n\tprivate readonly _onDidChangeCursorPosition: Emitter<ICursorPositionChangedEvent> = this._register(new Emitter<ICursorPositionChangedEvent>());\n\tpublic readonly onDidChangeCursorPosition: Event<ICursorPositionChangedEvent> = this._onDidChangeCursorPosition.event;\n\n\tprivate readonly _onDidChangeCursorSelection: Emitter<ICursorSelectionChangedEvent> = this._register(new Emitter<ICursorSelectionChangedEvent>());\n\tpublic readonly onDidChangeCursorSelection: Event<ICursorSelectionChangedEvent> = this._onDidChangeCursorSelection.event;\n\n\tprivate readonly _onDidAttemptReadOnlyEdit: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidAttemptReadOnlyEdit: Event<void> = this._onDidAttemptReadOnlyEdit.event;\n\n\tprivate readonly _onDidLayoutChange: Emitter<EditorLayoutInfo> = this._register(new Emitter<EditorLayoutInfo>());\n\tpublic readonly onDidLayoutChange: Event<EditorLayoutInfo> = this._onDidLayoutChange.event;\n\n\tprivate readonly _editorTextFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());\n\tpublic readonly onDidFocusEditorText: Event<void> = this._editorTextFocus.onDidChangeToTrue;\n\tpublic readonly onDidBlurEditorText: Event<void> = this._editorTextFocus.onDidChangeToFalse;\n\n\tprivate readonly _editorWidgetFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());\n\tpublic readonly onDidFocusEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToTrue;\n\tpublic readonly onDidBlurEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToFalse;\n\n\tprivate readonly _onWillType: Emitter<string> = this._register(new Emitter<string>());\n\tpublic readonly onWillType = this._onWillType.event;\n\n\tprivate readonly _onDidType: Emitter<string> = this._register(new Emitter<string>());\n\tpublic readonly onDidType = this._onDidType.event;\n\n\tprivate readonly _onDidCompositionStart: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidCompositionStart = this._onDidCompositionStart.event;\n\n\tprivate readonly _onDidCompositionEnd: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidCompositionEnd = this._onDidCompositionEnd.event;\n\n\tprivate readonly _onDidPaste: Emitter<editorBrowser.IPasteEvent> = this._register(new Emitter<editorBrowser.IPasteEvent>());\n\tpublic readonly onDidPaste = this._onDidPaste.event;\n\n\tprivate readonly _onMouseUp: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());\n\tpublic readonly onMouseUp: Event<editorBrowser.IEditorMouseEvent> = this._onMouseUp.event;\n\n\tprivate readonly _onMouseDown: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());\n\tpublic readonly onMouseDown: Event<editorBrowser.IEditorMouseEvent> = this._onMouseDown.event;\n\n\tprivate readonly _onMouseDrag: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());\n\tpublic readonly onMouseDrag: Event<editorBrowser.IEditorMouseEvent> = this._onMouseDrag.event;\n\n\tprivate readonly _onMouseDrop: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new Emitter<editorBrowser.IPartialEditorMouseEvent>());\n\tpublic readonly onMouseDrop: Event<editorBrowser.IPartialEditorMouseEvent> = this._onMouseDrop.event;\n\n\tprivate readonly _onMouseDropCanceled: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onMouseDropCanceled: Event<void> = this._onMouseDropCanceled.event;\n\n\tprivate readonly _onContextMenu: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());\n\tpublic readonly onContextMenu: Event<editorBrowser.IEditorMouseEvent> = this._onContextMenu.event;\n\n\tprivate readonly _onMouseMove: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());\n\tpublic readonly onMouseMove: Event<editorBrowser.IEditorMouseEvent> = this._onMouseMove.event;\n\n\tprivate readonly _onMouseLeave: Emitter<editorBrowser.IPartialEditorMouseEvent> = this._register(new Emitter<editorBrowser.IPartialEditorMouseEvent>());\n\tpublic readonly onMouseLeave: Event<editorBrowser.IPartialEditorMouseEvent> = this._onMouseLeave.event;\n\n\tprivate readonly _onMouseWheel: Emitter<IMouseWheelEvent> = this._register(new Emitter<IMouseWheelEvent>());\n\tpublic readonly onMouseWheel: Event<IMouseWheelEvent> = this._onMouseWheel.event;\n\n\tprivate readonly _onKeyUp: Emitter<IKeyboardEvent> = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;\n\n\tprivate readonly _onKeyDown: Emitter<IKeyboardEvent> = this._register(new Emitter<IKeyboardEvent>());\n\tpublic readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;\n\n\tprivate readonly _onDidContentSizeChange: Emitter<editorCommon.IContentSizeChangedEvent> = this._register(new Emitter<editorCommon.IContentSizeChangedEvent>());\n\tpublic readonly onDidContentSizeChange: Event<editorCommon.IContentSizeChangedEvent> = this._onDidContentSizeChange.event;\n\n\tprivate readonly _onDidScrollChange: Emitter<editorCommon.IScrollEvent> = this._register(new Emitter<editorCommon.IScrollEvent>());\n\tpublic readonly onDidScrollChange: Event<editorCommon.IScrollEvent> = this._onDidScrollChange.event;\n\n\tprivate readonly _onDidChangeViewZones: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChangeViewZones: Event<void> = this._onDidChangeViewZones.event;\n\n\tprivate readonly _onDidChangeHiddenAreas: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChangeHiddenAreas: Event<void> = this._onDidChangeHiddenAreas.event;\n\t//#endregion\n\n\tpublic get isSimpleWidget(): boolean {\n\t\treturn this._configuration.isSimpleWidget;\n\t}\n\n\tprivate readonly _telemetryData?: object;\n\n\tprivate readonly _domElement: HTMLElement;\n\tprivate readonly _overflowWidgetsDomNode: HTMLElement | undefined;\n\tprivate readonly _id: number;\n\tprivate readonly _configuration: IEditorConfiguration;\n\n\tprotected _contributions: { [key: string]: editorCommon.IEditorContribution };\n\tprotected _actions: { [key: string]: editorCommon.IEditorAction };\n\n\t// --- Members logically associated to a model\n\tprotected _modelData: ModelData | null;\n\n\tprotected readonly _instantiationService: IInstantiationService;\n\tprotected readonly _contextKeyService: IContextKeyService;\n\tprivate readonly _notificationService: INotificationService;\n\tprotected readonly _codeEditorService: ICodeEditorService;\n\tprivate readonly _commandService: ICommandService;\n\tprivate readonly _themeService: IThemeService;\n\n\tprivate readonly _focusTracker: CodeEditorWidgetFocusTracker;\n\n\tprivate _contentWidgets: { [key: string]: IContentWidgetData };\n\tprivate _overlayWidgets: { [key: string]: IOverlayWidgetData };\n\n\t/**\n\t * map from \"parent\" decoration type to live decoration ids.\n\t */\n\tprivate _decorationTypeKeysToIds: { [decorationTypeKey: string]: string[] };\n\tprivate _decorationTypeSubtypes: { [decorationTypeKey: string]: { [subtype: string]: boolean } };\n\n\tprivate _bannerDomNode: HTMLElement | null = null;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\t_options: Readonly<IEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: ICodeEditorWidgetOptions,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t\t@ILanguageConfigurationService private readonly languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\n\t\tconst options = { ..._options };\n\n\t\tthis._domElement = domElement;\n\t\tthis._overflowWidgetsDomNode = options.overflowWidgetsDomNode;\n\t\tdelete options.overflowWidgetsDomNode;\n\t\tthis._id = (++EDITOR_ID);\n\t\tthis._decorationTypeKeysToIds = {};\n\t\tthis._decorationTypeSubtypes = {};\n\t\tthis._telemetryData = codeEditorWidgetOptions.telemetryData;\n\n\t\tthis._configuration = this._register(this._createConfiguration(codeEditorWidgetOptions.isSimpleWidget || false, options, accessibilityService));\n\t\tthis._register(this._configuration.onDidChange((e) => {\n\t\t\tthis._onDidChangeConfiguration.fire(e);\n\n\t\t\tconst options = this._configuration.options;\n\t\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\t\tthis._onDidLayoutChange.fire(layoutInfo);\n\t\t\t}\n\t\t}));\n\n\t\tthis._contextKeyService = this._register(contextKeyService.createScoped(this._domElement));\n\t\tthis._notificationService = notificationService;\n\t\tthis._codeEditorService = codeEditorService;\n\t\tthis._commandService = commandService;\n\t\tthis._themeService = themeService;\n\t\tthis._register(new EditorContextKeysManager(this, this._contextKeyService));\n\t\tthis._register(new EditorModeContext(this, this._contextKeyService, languageFeaturesService));\n\n\t\tthis._instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]));\n\n\t\tthis._modelData = null;\n\n\t\tthis._contributions = {};\n\t\tthis._actions = {};\n\n\t\tthis._focusTracker = new CodeEditorWidgetFocusTracker(domElement);\n\t\tthis._register(this._focusTracker.onChange(() => {\n\t\t\tthis._editorWidgetFocus.setValue(this._focusTracker.hasFocus());\n\t\t}));\n\n\t\tthis._contentWidgets = {};\n\t\tthis._overlayWidgets = {};\n\n\t\tlet contributions: IEditorContributionDescription[];\n\t\tif (Array.isArray(codeEditorWidgetOptions.contributions)) {\n\t\t\tcontributions = codeEditorWidgetOptions.contributions;\n\t\t} else {\n\t\t\tcontributions = EditorExtensionsRegistry.getEditorContributions();\n\t\t}\n\t\tfor (const desc of contributions) {\n\t\t\tif (this._contributions[desc.id]) {\n\t\t\t\tonUnexpectedError(new Error(`Cannot have two contributions with the same id ${desc.id}`));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst contribution = this._instantiationService.createInstance(desc.ctor, this);\n\t\t\t\tthis._contributions[desc.id] = contribution;\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\n\t\tEditorExtensionsRegistry.getEditorActions().forEach((action) => {\n\t\t\tif (this._actions[action.id]) {\n\t\t\t\tonUnexpectedError(new Error(`Cannot have two actions with the same id ${action.id}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst internalAction = new InternalEditorAction(\n\t\t\t\taction.id,\n\t\t\t\taction.label,\n\t\t\t\taction.alias,\n\t\t\t\twithNullAsUndefined(action.precondition),\n\t\t\t\t(): Promise<void> => {\n\t\t\t\t\treturn this._instantiationService.invokeFunction((accessor) => {\n\t\t\t\t\t\treturn Promise.resolve(action.runEditorCommand(accessor, this, null));\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tthis._contextKeyService\n\t\t\t);\n\t\t\tthis._actions[internalAction.id] = internalAction;\n\t\t});\n\n\t\tthis._codeEditorService.addCodeEditor(this);\n\t}\n\n\tprotected _createConfiguration(isSimpleWidget: boolean, options: Readonly<IEditorConstructionOptions>, accessibilityService: IAccessibilityService): EditorConfiguration {\n\t\treturn new EditorConfiguration(isSimpleWidget, options, this._domElement, accessibilityService);\n\t}\n\n\tpublic getId(): string {\n\t\treturn this.getEditorType() + ':' + this._id;\n\t}\n\n\tpublic getEditorType(): string {\n\t\treturn editorCommon.EditorType.ICodeEditor;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._codeEditorService.removeCodeEditor(this);\n\n\t\tthis._focusTracker.dispose();\n\n\t\tconst keys = Object.keys(this._contributions);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst contributionId = keys[i];\n\t\t\tthis._contributions[contributionId].dispose();\n\t\t}\n\t\tthis._contributions = {};\n\t\tthis._actions = {};\n\t\tthis._contentWidgets = {};\n\t\tthis._overlayWidgets = {};\n\n\t\tthis._removeDecorationTypes();\n\t\tthis._postDetachModelCleanup(this._detachModel());\n\n\t\tthis._onDidDispose.fire();\n\n\t\tsuper.dispose();\n\t}\n\n\tpublic invokeWithinContext<T>(fn: (accessor: ServicesAccessor) => T): T {\n\t\treturn this._instantiationService.invokeFunction(fn);\n\t}\n\n\tpublic updateOptions(newOptions: Readonly<IEditorOptions> | undefined): void {\n\t\tthis._configuration.updateOptions(newOptions || {});\n\t}\n\n\tpublic getOptions(): IComputedEditorOptions {\n\t\treturn this._configuration.options;\n\t}\n\n\tpublic getOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T> {\n\t\treturn this._configuration.options.get(id);\n\t}\n\n\tpublic getRawOptions(): IEditorOptions {\n\t\treturn this._configuration.getRawOptions();\n\t}\n\n\tpublic getOverflowWidgetsDomNode(): HTMLElement | undefined {\n\t\treturn this._overflowWidgetsDomNode;\n\t}\n\n\tpublic getConfiguredWordAtPosition(position: Position): IWordAtPosition | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn WordOperations.getWordAtPosition(this._modelData.model, this._configuration.options.get(EditorOption.wordSeparators), position);\n\t}\n\n\tpublic getValue(options: { preserveBOM: boolean; lineEnding: string } | null = null): string {\n\t\tif (!this._modelData) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst preserveBOM: boolean = (options && options.preserveBOM) ? true : false;\n\t\tlet eolPreference = EndOfLinePreference.TextDefined;\n\t\tif (options && options.lineEnding && options.lineEnding === '\\n') {\n\t\t\teolPreference = EndOfLinePreference.LF;\n\t\t} else if (options && options.lineEnding && options.lineEnding === '\\r\\n') {\n\t\t\teolPreference = EndOfLinePreference.CRLF;\n\t\t}\n\t\treturn this._modelData.model.getValue(eolPreference, preserveBOM);\n\t}\n\n\tpublic setValue(newValue: string): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.model.setValue(newValue);\n\t}\n\n\tpublic getModel(): ITextModel | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.model;\n\t}\n\n\tpublic setModel(_model: ITextModel | editorCommon.IDiffEditorModel | null = null): void {\n\t\tconst model = <ITextModel | null>_model;\n\t\tif (this._modelData === null && model === null) {\n\t\t\t// Current model is the new model\n\t\t\treturn;\n\t\t}\n\t\tif (this._modelData && this._modelData.model === model) {\n\t\t\t// Current model is the new model\n\t\t\treturn;\n\t\t}\n\t\tconst hasTextFocus = this.hasTextFocus();\n\t\tconst detachedModel = this._detachModel();\n\t\tthis._attachModel(model);\n\t\tif (hasTextFocus && this.hasModel()) {\n\t\t\tthis.focus();\n\t\t}\n\n\t\tconst e: editorCommon.IModelChangedEvent = {\n\t\t\toldModelUrl: detachedModel ? detachedModel.uri : null,\n\t\t\tnewModelUrl: model ? model.uri : null\n\t\t};\n\n\t\tthis._removeDecorationTypes();\n\t\tthis._onDidChangeModel.fire(e);\n\t\tthis._postDetachModelCleanup(detachedModel);\n\t}\n\n\tprivate _removeDecorationTypes(): void {\n\t\tthis._decorationTypeKeysToIds = {};\n\t\tif (this._decorationTypeSubtypes) {\n\t\t\tfor (let decorationType in this._decorationTypeSubtypes) {\n\t\t\t\tconst subTypes = this._decorationTypeSubtypes[decorationType];\n\t\t\t\tfor (let subType in subTypes) {\n\t\t\t\t\tthis._removeDecorationType(decorationType + '-' + subType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._decorationTypeSubtypes = {};\n\t\t}\n\t}\n\n\tpublic getVisibleRanges(): Range[] {\n\t\tif (!this._modelData) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._modelData.viewModel.getVisibleRanges();\n\t}\n\n\tpublic getVisibleRangesPlusViewportAboveBelow(): Range[] {\n\t\tif (!this._modelData) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow();\n\t}\n\n\tpublic getWhitespaces(): IEditorWhitespace[] {\n\t\tif (!this._modelData) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getWhitespaces();\n\t}\n\n\tprivate static _getVerticalOffsetForPosition(modelData: ModelData, modelLineNumber: number, modelColumn: number): number {\n\t\tconst modelPosition = modelData.model.validatePosition({\n\t\t\tlineNumber: modelLineNumber,\n\t\t\tcolumn: modelColumn\n\t\t});\n\t\tconst viewPosition = modelData.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition);\n\t\treturn modelData.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber);\n\t}\n\n\tpublic getTopForLineNumber(lineNumber: number): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, lineNumber, 1);\n\t}\n\n\tpublic getTopForPosition(lineNumber: number, column: number): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, lineNumber, column);\n\t}\n\n\tpublic setHiddenAreas(ranges: IRange[]): void {\n\t\tif (this._modelData) {\n\t\t\tthis._modelData.viewModel.setHiddenAreas(ranges.map(r => Range.lift(r)));\n\t\t}\n\t}\n\n\tpublic getVisibleColumnFromPosition(rawPosition: IPosition): number {\n\t\tif (!this._modelData) {\n\t\t\treturn rawPosition.column;\n\t\t}\n\n\t\tconst position = this._modelData.model.validatePosition(rawPosition);\n\t\tconst tabSize = this._modelData.model.getOptions().tabSize;\n\n\t\treturn CursorColumns.visibleColumnFromColumn(this._modelData.model.getLineContent(position.lineNumber), position.column, tabSize) + 1;\n\t}\n\n\tpublic getPosition(): Position | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.viewModel.getPosition();\n\t}\n\n\tpublic setPosition(position: IPosition, source: string = 'api'): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tif (!Position.isIPosition(position)) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\t\tthis._modelData.viewModel.setSelections(source, [{\n\t\t\tselectionStartLineNumber: position.lineNumber,\n\t\t\tselectionStartColumn: position.column,\n\t\t\tpositionLineNumber: position.lineNumber,\n\t\t\tpositionColumn: position.column\n\t\t}]);\n\t}\n\n\tprivate _sendRevealRange(modelRange: Range, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tif (!Range.isIRange(modelRange)) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\t\tconst validatedModelRange = this._modelData.model.validateRange(modelRange);\n\t\tconst viewRange = this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(validatedModelRange);\n\n\t\tthis._modelData.viewModel.revealRange('api', revealHorizontal, viewRange, verticalType, scrollType);\n\t}\n\n\tpublic revealLine(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLine(lineNumber, VerticalRevealType.Simple, scrollType);\n\t}\n\n\tpublic revealLineInCenter(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLine(lineNumber, VerticalRevealType.Center, scrollType);\n\t}\n\n\tpublic revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLine(lineNumber, VerticalRevealType.CenterIfOutsideViewport, scrollType);\n\t}\n\n\tpublic revealLineNearTop(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLine(lineNumber, VerticalRevealType.NearTop, scrollType);\n\t}\n\n\tprivate _revealLine(lineNumber: number, revealType: VerticalRevealType, scrollType: editorCommon.ScrollType): void {\n\t\tif (typeof lineNumber !== 'number') {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\n\t\tthis._sendRevealRange(\n\t\t\tnew Range(lineNumber, 1, lineNumber, 1),\n\t\t\trevealType,\n\t\t\tfalse,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealPosition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealPosition(\n\t\t\tposition,\n\t\t\tVerticalRevealType.Simple,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealPositionInCenter(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealPosition(\n\t\t\tposition,\n\t\t\tVerticalRevealType.Center,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealPosition(\n\t\t\tposition,\n\t\t\tVerticalRevealType.CenterIfOutsideViewport,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealPositionNearTop(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealPosition(\n\t\t\tposition,\n\t\t\tVerticalRevealType.NearTop,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tprivate _revealPosition(position: IPosition, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void {\n\t\tif (!Position.isIPosition(position)) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\n\t\tthis._sendRevealRange(\n\t\t\tnew Range(position.lineNumber, position.column, position.lineNumber, position.column),\n\t\t\tverticalType,\n\t\t\trevealHorizontal,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic getSelection(): Selection | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.viewModel.getSelection();\n\t}\n\n\tpublic getSelections(): Selection[] | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.viewModel.getSelections();\n\t}\n\n\tpublic setSelection(range: IRange, source?: string): void;\n\tpublic setSelection(editorRange: Range, source?: string): void;\n\tpublic setSelection(selection: ISelection, source?: string): void;\n\tpublic setSelection(editorSelection: Selection, source?: string): void;\n\tpublic setSelection(something: any, source: string = 'api'): void {\n\t\tconst isSelection = Selection.isISelection(something);\n\t\tconst isRange = Range.isIRange(something);\n\n\t\tif (!isSelection && !isRange) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\n\t\tif (isSelection) {\n\t\t\tthis._setSelectionImpl(<ISelection>something, source);\n\t\t} else if (isRange) {\n\t\t\t// act as if it was an IRange\n\t\t\tconst selection: ISelection = {\n\t\t\t\tselectionStartLineNumber: something.startLineNumber,\n\t\t\t\tselectionStartColumn: something.startColumn,\n\t\t\t\tpositionLineNumber: something.endLineNumber,\n\t\t\t\tpositionColumn: something.endColumn\n\t\t\t};\n\t\t\tthis._setSelectionImpl(selection, source);\n\t\t}\n\t}\n\n\tprivate _setSelectionImpl(sel: ISelection, source: string): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tconst selection = new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\n\t\tthis._modelData.viewModel.setSelections(source, [selection]);\n\t}\n\n\tpublic revealLines(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLines(\n\t\t\tstartLineNumber,\n\t\t\tendLineNumber,\n\t\t\tVerticalRevealType.Simple,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealLinesInCenter(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLines(\n\t\t\tstartLineNumber,\n\t\t\tendLineNumber,\n\t\t\tVerticalRevealType.Center,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealLinesInCenterIfOutsideViewport(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLines(\n\t\t\tstartLineNumber,\n\t\t\tendLineNumber,\n\t\t\tVerticalRevealType.CenterIfOutsideViewport,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealLinesNearTop(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealLines(\n\t\t\tstartLineNumber,\n\t\t\tendLineNumber,\n\t\t\tVerticalRevealType.NearTop,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tprivate _revealLines(startLineNumber: number, endLineNumber: number, verticalType: VerticalRevealType, scrollType: editorCommon.ScrollType): void {\n\t\tif (typeof startLineNumber !== 'number' || typeof endLineNumber !== 'number') {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\n\t\tthis._sendRevealRange(\n\t\t\tnew Range(startLineNumber, 1, endLineNumber, 1),\n\t\t\tverticalType,\n\t\t\tfalse,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRange(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth, revealVerticalInCenter: boolean = false, revealHorizontal: boolean = true): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\trevealVerticalInCenter ? VerticalRevealType.Center : VerticalRevealType.Simple,\n\t\t\trevealHorizontal,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRangeInCenter(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\tVerticalRevealType.Center,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRangeInCenterIfOutsideViewport(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\tVerticalRevealType.CenterIfOutsideViewport,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\tVerticalRevealType.NearTop,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRangeNearTopIfOutsideViewport(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\tVerticalRevealType.NearTopIfOutsideViewport,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic revealRangeAtTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._revealRange(\n\t\t\trange,\n\t\t\tVerticalRevealType.Top,\n\t\t\ttrue,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tprivate _revealRange(range: IRange, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void {\n\t\tif (!Range.isIRange(range)) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\n\t\tthis._sendRevealRange(\n\t\t\tRange.lift(range),\n\t\t\tverticalType,\n\t\t\trevealHorizontal,\n\t\t\tscrollType\n\t\t);\n\t}\n\n\tpublic setSelections(ranges: readonly ISelection[], source: string = 'api', reason = CursorChangeReason.NotSet): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tif (!ranges || ranges.length === 0) {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\t\tfor (let i = 0, len = ranges.length; i < len; i++) {\n\t\t\tif (!Selection.isISelection(ranges[i])) {\n\t\t\t\tthrow new Error('Invalid arguments');\n\t\t\t}\n\t\t}\n\t\tthis._modelData.viewModel.setSelections(source, ranges, reason);\n\t}\n\n\tpublic getContentWidth(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getContentWidth();\n\t}\n\n\tpublic getScrollWidth(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getScrollWidth();\n\t}\n\tpublic getScrollLeft(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getCurrentScrollLeft();\n\t}\n\n\tpublic getContentHeight(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getContentHeight();\n\t}\n\n\tpublic getScrollHeight(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getScrollHeight();\n\t}\n\tpublic getScrollTop(): number {\n\t\tif (!this._modelData) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.viewModel.viewLayout.getCurrentScrollTop();\n\t}\n\n\tpublic setScrollLeft(newScrollLeft: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Immediate): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tif (typeof newScrollLeft !== 'number') {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\t\tthis._modelData.viewModel.viewLayout.setScrollPosition({\n\t\t\tscrollLeft: newScrollLeft\n\t\t}, scrollType);\n\t}\n\tpublic setScrollTop(newScrollTop: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Immediate): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tif (typeof newScrollTop !== 'number') {\n\t\t\tthrow new Error('Invalid arguments');\n\t\t}\n\t\tthis._modelData.viewModel.viewLayout.setScrollPosition({\n\t\t\tscrollTop: newScrollTop\n\t\t}, scrollType);\n\t}\n\tpublic setScrollPosition(position: editorCommon.INewScrollPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Immediate): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.viewLayout.setScrollPosition(position, scrollType);\n\t}\n\n\tpublic saveViewState(): editorCommon.ICodeEditorViewState | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\tconst contributionsState: { [key: string]: any } = {};\n\n\t\tconst keys = Object.keys(this._contributions);\n\t\tfor (const id of keys) {\n\t\t\tconst contribution = this._contributions[id];\n\t\t\tif (typeof contribution.saveViewState === 'function') {\n\t\t\t\tcontributionsState[id] = contribution.saveViewState();\n\t\t\t}\n\t\t}\n\n\t\tconst cursorState = this._modelData.viewModel.saveCursorState();\n\t\tconst viewState = this._modelData.viewModel.saveState();\n\t\treturn {\n\t\t\tcursorState: cursorState,\n\t\t\tviewState: viewState,\n\t\t\tcontributionsState: contributionsState\n\t\t};\n\t}\n\n\tpublic restoreViewState(s: editorCommon.IEditorViewState | null): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tconst codeEditorState = s as editorCommon.ICodeEditorViewState | null;\n\t\tif (codeEditorState && codeEditorState.cursorState && codeEditorState.viewState) {\n\t\t\tconst cursorState = <any>codeEditorState.cursorState;\n\t\t\tif (Array.isArray(cursorState)) {\n\t\t\t\tif (cursorState.length > 0) {\n\t\t\t\t\tthis._modelData.viewModel.restoreCursorState(<editorCommon.ICursorState[]>cursorState);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Backwards compatibility\n\t\t\t\tthis._modelData.viewModel.restoreCursorState([<editorCommon.ICursorState>cursorState]);\n\t\t\t}\n\n\t\t\tconst contributionsState = codeEditorState.contributionsState || {};\n\t\t\tconst keys = Object.keys(this._contributions);\n\t\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\t\tconst id = keys[i];\n\t\t\t\tconst contribution = this._contributions[id];\n\t\t\t\tif (typeof contribution.restoreViewState === 'function') {\n\t\t\t\t\tcontribution.restoreViewState(contributionsState[id]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst reducedState = this._modelData.viewModel.reduceRestoreState(codeEditorState.viewState);\n\t\t\tthis._modelData.view.restoreState(reducedState);\n\t\t}\n\t}\n\n\tpublic getContribution<T extends editorCommon.IEditorContribution>(id: string): T | null {\n\t\treturn <T>(this._contributions[id] || null);\n\t}\n\n\tpublic getActions(): editorCommon.IEditorAction[] {\n\t\tconst result: editorCommon.IEditorAction[] = [];\n\n\t\tconst keys = Object.keys(this._actions);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tconst id = keys[i];\n\t\t\tresult.push(this._actions[id]);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic getSupportedActions(): editorCommon.IEditorAction[] {\n\t\tlet result = this.getActions();\n\n\t\tresult = result.filter(action => action.isSupported());\n\n\t\treturn result;\n\t}\n\n\tpublic getAction(id: string): editorCommon.IEditorAction {\n\t\treturn this._actions[id] || null;\n\t}\n\n\tpublic trigger(source: string | null | undefined, handlerId: string, payload: any): void {\n\t\tpayload = payload || {};\n\n\t\tswitch (handlerId) {\n\t\t\tcase editorCommon.Handler.CompositionStart:\n\t\t\t\tthis._startComposition();\n\t\t\t\treturn;\n\t\t\tcase editorCommon.Handler.CompositionEnd:\n\t\t\t\tthis._endComposition(source);\n\t\t\t\treturn;\n\t\t\tcase editorCommon.Handler.Type: {\n\t\t\t\tconst args = <Partial<editorCommon.TypePayload>>payload;\n\t\t\t\tthis._type(source, args.text || '');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase editorCommon.Handler.ReplacePreviousChar: {\n\t\t\t\tconst args = <Partial<editorCommon.ReplacePreviousCharPayload>>payload;\n\t\t\t\tthis._compositionType(source, args.text || '', args.replaceCharCnt || 0, 0, 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase editorCommon.Handler.CompositionType: {\n\t\t\t\tconst args = <Partial<editorCommon.CompositionTypePayload>>payload;\n\t\t\t\tthis._compositionType(source, args.text || '', args.replacePrevCharCnt || 0, args.replaceNextCharCnt || 0, args.positionDelta || 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase editorCommon.Handler.Paste: {\n\t\t\t\tconst args = <Partial<editorCommon.PastePayload>>payload;\n\t\t\t\tthis._paste(source, args.text || '', args.pasteOnNewLine || false, args.multicursorText || null, args.mode || null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase editorCommon.Handler.Cut:\n\t\t\t\tthis._cut(source);\n\t\t\t\treturn;\n\t\t}\n\n\t\tconst action = this.getAction(handlerId);\n\t\tif (action) {\n\t\t\tPromise.resolve(action.run()).then(undefined, onUnexpectedError);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._triggerEditorCommand(source, handlerId, payload)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._triggerCommand(handlerId, payload);\n\t}\n\n\tprotected _triggerCommand(handlerId: string, payload: any): void {\n\t\tthis._commandService.executeCommand(handlerId, payload);\n\t}\n\n\tprivate _startComposition(): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.startComposition();\n\t\tthis._onDidCompositionStart.fire();\n\t}\n\n\tprivate _endComposition(source: string | null | undefined): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.endComposition(source);\n\t\tthis._onDidCompositionEnd.fire();\n\t}\n\n\tprivate _type(source: string | null | undefined, text: string): void {\n\t\tif (!this._modelData || text.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (source === 'keyboard') {\n\t\t\tthis._onWillType.fire(text);\n\t\t}\n\t\tthis._modelData.viewModel.type(text, source);\n\t\tif (source === 'keyboard') {\n\t\t\tthis._onDidType.fire(text);\n\t\t}\n\t}\n\n\tprivate _compositionType(source: string | null | undefined, text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.compositionType(text, replacePrevCharCnt, replaceNextCharCnt, positionDelta, source);\n\t}\n\n\tprivate _paste(source: string | null | undefined, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null): void {\n\t\tif (!this._modelData || text.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst startPosition = this._modelData.viewModel.getSelection().getStartPosition();\n\t\tthis._modelData.viewModel.paste(text, pasteOnNewLine, multicursorText, source);\n\t\tconst endPosition = this._modelData.viewModel.getSelection().getStartPosition();\n\t\tif (source === 'keyboard') {\n\t\t\tthis._onDidPaste.fire({\n\t\t\t\trange: new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column),\n\t\t\t\tlanguageId: mode\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cut(source: string | null | undefined): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.cut(source);\n\t}\n\n\tprivate _triggerEditorCommand(source: string | null | undefined, handlerId: string, payload: any): boolean {\n\t\tconst command = EditorExtensionsRegistry.getEditorCommand(handlerId);\n\t\tif (command) {\n\t\t\tpayload = payload || {};\n\t\t\tpayload.source = source;\n\t\t\tthis._instantiationService.invokeFunction((accessor) => {\n\t\t\t\tPromise.resolve(command.runEditorCommand(accessor, this, payload)).then(undefined, onUnexpectedError);\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic _getViewModel(): IViewModel | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.viewModel;\n\t}\n\n\tpublic pushUndoStop(): boolean {\n\t\tif (!this._modelData) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._configuration.options.get(EditorOption.readOnly)) {\n\t\t\t// read only editor => sorry!\n\t\t\treturn false;\n\t\t}\n\t\tthis._modelData.model.pushStackElement();\n\t\treturn true;\n\t}\n\n\tpublic popUndoStop(): boolean {\n\t\tif (!this._modelData) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._configuration.options.get(EditorOption.readOnly)) {\n\t\t\t// read only editor => sorry!\n\t\t\treturn false;\n\t\t}\n\t\tthis._modelData.model.popStackElement();\n\t\treturn true;\n\t}\n\n\tpublic executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean {\n\t\tif (!this._modelData) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._configuration.options.get(EditorOption.readOnly)) {\n\t\t\t// read only editor => sorry!\n\t\t\treturn false;\n\t\t}\n\n\t\tlet cursorStateComputer: ICursorStateComputer;\n\t\tif (!endCursorState) {\n\t\t\tcursorStateComputer = () => null;\n\t\t} else if (Array.isArray(endCursorState)) {\n\t\t\tcursorStateComputer = () => endCursorState;\n\t\t} else {\n\t\t\tcursorStateComputer = endCursorState;\n\t\t}\n\n\t\tthis._modelData.viewModel.executeEdits(source, edits, cursorStateComputer);\n\t\treturn true;\n\t}\n\n\tpublic executeCommand(source: string | null | undefined, command: editorCommon.ICommand): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.executeCommand(command, source);\n\t}\n\n\tpublic executeCommands(source: string | null | undefined, commands: editorCommon.ICommand[]): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.executeCommands(commands, source);\n\t}\n\n\tpublic changeDecorations(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any {\n\t\tif (!this._modelData) {\n\t\t\t// callback will not be called\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.model.changeDecorations(callback, this._id);\n\t}\n\n\tpublic getLineDecorations(lineNumber: number): IModelDecoration[] | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.model.getLineDecorations(lineNumber, this._id, filterValidationDecorations(this._configuration.options));\n\t}\n\n\tpublic getDecorationsInRange(range: Range): IModelDecoration[] | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.model.getDecorationsInRange(range, this._id, filterValidationDecorations(this._configuration.options));\n\t}\n\n\tpublic deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[] {\n\t\tif (!this._modelData) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (oldDecorations.length === 0 && newDecorations.length === 0) {\n\t\t\treturn oldDecorations;\n\t\t}\n\n\t\treturn this._modelData.model.deltaDecorations(oldDecorations, newDecorations, this._id);\n\t}\n\n\tpublic removeDecorations(decorationTypeKey: string): void {\n\t\t// remove decorations for type and sub type\n\t\tconst oldDecorationsIds = this._decorationTypeKeysToIds[decorationTypeKey];\n\t\tif (oldDecorationsIds) {\n\t\t\tthis.deltaDecorations(oldDecorationsIds, []);\n\t\t}\n\t\tif (this._decorationTypeKeysToIds.hasOwnProperty(decorationTypeKey)) {\n\t\t\tdelete this._decorationTypeKeysToIds[decorationTypeKey];\n\t\t}\n\t\tif (this._decorationTypeSubtypes.hasOwnProperty(decorationTypeKey)) {\n\t\t\tdelete this._decorationTypeSubtypes[decorationTypeKey];\n\t\t}\n\t}\n\n\tpublic getLayoutInfo(): EditorLayoutInfo {\n\t\tconst options = this._configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\treturn layoutInfo;\n\t}\n\n\tpublic createOverviewRuler(cssClassName: string): editorBrowser.IOverviewRuler | null {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.view.createOverviewRuler(cssClassName);\n\t}\n\n\tpublic getContainerDomNode(): HTMLElement {\n\t\treturn this._domElement;\n\t}\n\n\tpublic getDomNode(): HTMLElement | null {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.view.domNode.domNode;\n\t}\n\n\tpublic delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.view.delegateVerticalScrollbarMouseDown(browserEvent);\n\t}\n\n\tpublic layout(dimension?: IDimension): void {\n\t\tthis._configuration.observeContainer(dimension);\n\t\tthis.render();\n\t}\n\n\tpublic focus(): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.view.focus();\n\t}\n\n\tpublic hasTextFocus(): boolean {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this._modelData.view.isFocused();\n\t}\n\n\tpublic hasWidgetFocus(): boolean {\n\t\treturn this._focusTracker && this._focusTracker.hasFocus();\n\t}\n\n\tpublic addContentWidget(widget: editorBrowser.IContentWidget): void {\n\t\tconst widgetData: IContentWidgetData = {\n\t\t\twidget: widget,\n\t\t\tposition: widget.getPosition()\n\t\t};\n\n\t\tif (this._contentWidgets.hasOwnProperty(widget.getId())) {\n\t\t\tconsole.warn('Overwriting a content widget with the same id.');\n\t\t}\n\n\t\tthis._contentWidgets[widget.getId()] = widgetData;\n\n\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\tthis._modelData.view.addContentWidget(widgetData);\n\t\t}\n\t}\n\n\tpublic layoutContentWidget(widget: editorBrowser.IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._contentWidgets.hasOwnProperty(widgetId)) {\n\t\t\tconst widgetData = this._contentWidgets[widgetId];\n\t\t\twidgetData.position = widget.getPosition();\n\t\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\t\tthis._modelData.view.layoutContentWidget(widgetData);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic removeContentWidget(widget: editorBrowser.IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._contentWidgets.hasOwnProperty(widgetId)) {\n\t\t\tconst widgetData = this._contentWidgets[widgetId];\n\t\t\tdelete this._contentWidgets[widgetId];\n\t\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\t\tthis._modelData.view.removeContentWidget(widgetData);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic addOverlayWidget(widget: editorBrowser.IOverlayWidget): void {\n\t\tconst widgetData: IOverlayWidgetData = {\n\t\t\twidget: widget,\n\t\t\tposition: widget.getPosition()\n\t\t};\n\n\t\tif (this._overlayWidgets.hasOwnProperty(widget.getId())) {\n\t\t\tconsole.warn('Overwriting an overlay widget with the same id.');\n\t\t}\n\n\t\tthis._overlayWidgets[widget.getId()] = widgetData;\n\n\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\tthis._modelData.view.addOverlayWidget(widgetData);\n\t\t}\n\t}\n\n\tpublic layoutOverlayWidget(widget: editorBrowser.IOverlayWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._overlayWidgets.hasOwnProperty(widgetId)) {\n\t\t\tconst widgetData = this._overlayWidgets[widgetId];\n\t\t\twidgetData.position = widget.getPosition();\n\t\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\t\tthis._modelData.view.layoutOverlayWidget(widgetData);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic removeOverlayWidget(widget: editorBrowser.IOverlayWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._overlayWidgets.hasOwnProperty(widgetId)) {\n\t\t\tconst widgetData = this._overlayWidgets[widgetId];\n\t\t\tdelete this._overlayWidgets[widgetId];\n\t\t\tif (this._modelData && this._modelData.hasRealView) {\n\t\t\t\tthis._modelData.view.removeOverlayWidget(widgetData);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic changeViewZones(callback: (accessor: editorBrowser.IViewZoneChangeAccessor) => void): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.view.change(callback);\n\t}\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): editorBrowser.IMouseTarget | null {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.view.getTargetAtClientPoint(clientX, clientY);\n\t}\n\n\tpublic getScrolledVisiblePosition(rawPosition: IPosition): { top: number; left: number; height: number } | null {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst position = this._modelData.model.validatePosition(rawPosition);\n\t\tconst options = this._configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\n\t\tconst top = CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, position.lineNumber, position.column) - this.getScrollTop();\n\t\tconst left = this._modelData.view.getOffsetForColumn(position.lineNumber, position.column) + layoutInfo.glyphMarginWidth + layoutInfo.lineNumbersWidth + layoutInfo.decorationsWidth - this.getScrollLeft();\n\n\t\treturn {\n\t\t\ttop: top,\n\t\t\tleft: left,\n\t\t\theight: options.get(EditorOption.lineHeight)\n\t\t};\n\t}\n\n\tpublic getOffsetForColumn(lineNumber: number, column: number): number {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._modelData.view.getOffsetForColumn(lineNumber, column);\n\t}\n\n\tpublic render(forceRedraw: boolean = false): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.view.render(true, forceRedraw);\n\t}\n\n\tpublic setAriaOptions(options: editorBrowser.IEditorAriaOptions): void {\n\t\tif (!this._modelData || !this._modelData.hasRealView) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.view.setAriaOptions(options);\n\t}\n\n\tpublic applyFontInfo(target: HTMLElement): void {\n\t\tapplyFontInfo(target, this._configuration.options.get(EditorOption.fontInfo));\n\t}\n\n\tpublic setBanner(domNode: HTMLElement | null, domNodeHeight: number): void {\n\t\tif (this._bannerDomNode && this._domElement.contains(this._bannerDomNode)) {\n\t\t\tthis._domElement.removeChild(this._bannerDomNode);\n\t\t}\n\n\t\tthis._bannerDomNode = domNode;\n\t\tthis._configuration.setReservedHeight(domNode ? domNodeHeight : 0);\n\n\t\tif (this._bannerDomNode) {\n\t\t\tthis._domElement.prepend(this._bannerDomNode);\n\t\t}\n\t}\n\n\tprotected _attachModel(model: ITextModel | null): void {\n\t\tif (!model) {\n\t\t\tthis._modelData = null;\n\t\t\treturn;\n\t\t}\n\n\t\tconst listenersToRemove: IDisposable[] = [];\n\n\t\tthis._domElement.setAttribute('data-mode-id', model.getLanguageId());\n\t\tthis._configuration.setIsDominatedByLongLines(model.isDominatedByLongLines());\n\t\tthis._configuration.setModelLineCount(model.getLineCount());\n\n\t\tmodel.onBeforeAttached();\n\n\t\tconst viewModel = new ViewModel(\n\t\t\tthis._id,\n\t\t\tthis._configuration,\n\t\t\tmodel,\n\t\t\tDOMLineBreaksComputerFactory.create(),\n\t\t\tMonospaceLineBreaksComputerFactory.create(this._configuration.options),\n\t\t\t(callback) => dom.scheduleAtNextAnimationFrame(callback),\n\t\t\tthis.languageConfigurationService,\n\t\t\tthis._themeService\n\t\t);\n\n\t\tlistenersToRemove.push(model.onDidChangeDecorations((e) => this._onDidChangeModelDecorations.fire(e)));\n\t\tlistenersToRemove.push(model.onDidChangeLanguage((e) => {\n\t\t\tthis._domElement.setAttribute('data-mode-id', model.getLanguageId());\n\t\t\tthis._onDidChangeModelLanguage.fire(e);\n\t\t}));\n\t\tlistenersToRemove.push(model.onDidChangeLanguageConfiguration((e) => this._onDidChangeModelLanguageConfiguration.fire(e)));\n\t\tlistenersToRemove.push(model.onDidChangeContent((e) => this._onDidChangeModelContent.fire(e)));\n\t\tlistenersToRemove.push(model.onDidChangeOptions((e) => this._onDidChangeModelOptions.fire(e)));\n\t\t// Someone might destroy the model from under the editor, so prevent any exceptions by setting a null model\n\t\tlistenersToRemove.push(model.onWillDispose(() => this.setModel(null)));\n\n\t\tlistenersToRemove.push(viewModel.onEvent((e) => {\n\t\t\tswitch (e.kind) {\n\t\t\t\tcase OutgoingViewModelEventKind.ContentSizeChanged:\n\t\t\t\t\tthis._onDidContentSizeChange.fire(e);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.FocusChanged:\n\t\t\t\t\tthis._editorTextFocus.setValue(e.hasFocus);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.ScrollChanged:\n\t\t\t\t\tthis._onDidScrollChange.fire(e);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.ViewZonesChanged:\n\t\t\t\t\tthis._onDidChangeViewZones.fire();\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.HiddenAreasChanged:\n\t\t\t\t\tthis._onDidChangeHiddenAreas.fire();\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.ReadOnlyEditAttempt:\n\t\t\t\t\tthis._onDidAttemptReadOnlyEdit.fire();\n\t\t\t\t\tbreak;\n\t\t\t\tcase OutgoingViewModelEventKind.CursorStateChanged: {\n\t\t\t\t\tif (e.reachedMaxCursorCount) {\n\t\t\t\t\t\tthis._notificationService.warn(nls.localize('cursors.maximum', \"The number of cursors has been limited to {0}.\", CursorsController.MAX_CURSOR_COUNT));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst positions: Position[] = [];\n\t\t\t\t\tfor (let i = 0, len = e.selections.length; i < len; i++) {\n\t\t\t\t\t\tpositions[i] = e.selections[i].getPosition();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst e1: ICursorPositionChangedEvent = {\n\t\t\t\t\t\tposition: positions[0],\n\t\t\t\t\t\tsecondaryPositions: positions.slice(1),\n\t\t\t\t\t\treason: e.reason,\n\t\t\t\t\t\tsource: e.source\n\t\t\t\t\t};\n\t\t\t\t\tthis._onDidChangeCursorPosition.fire(e1);\n\n\t\t\t\t\tconst e2: ICursorSelectionChangedEvent = {\n\t\t\t\t\t\tselection: e.selections[0],\n\t\t\t\t\t\tsecondarySelections: e.selections.slice(1),\n\t\t\t\t\t\tmodelVersionId: e.modelVersionId,\n\t\t\t\t\t\toldSelections: e.oldSelections,\n\t\t\t\t\t\toldModelVersionId: e.oldModelVersionId,\n\t\t\t\t\t\tsource: e.source,\n\t\t\t\t\t\treason: e.reason\n\t\t\t\t\t};\n\t\t\t\t\tthis._onDidChangeCursorSelection.fire(e2);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}));\n\n\t\tconst [view, hasRealView] = this._createView(viewModel);\n\t\tif (hasRealView) {\n\t\t\tthis._domElement.appendChild(view.domNode.domNode);\n\n\t\t\tlet keys = Object.keys(this._contentWidgets);\n\t\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\t\tconst widgetId = keys[i];\n\t\t\t\tview.addContentWidget(this._contentWidgets[widgetId]);\n\t\t\t}\n\n\t\t\tkeys = Object.keys(this._overlayWidgets);\n\t\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\t\tconst widgetId = keys[i];\n\t\t\t\tview.addOverlayWidget(this._overlayWidgets[widgetId]);\n\t\t\t}\n\n\t\t\tview.render(false, true);\n\t\t\tview.domNode.domNode.setAttribute('data-uri', model.uri.toString());\n\t\t}\n\n\t\tthis._modelData = new ModelData(model, viewModel, view, hasRealView, listenersToRemove);\n\t}\n\n\tprotected _createView(viewModel: ViewModel): [View, boolean] {\n\t\tlet commandDelegate: ICommandDelegate;\n\t\tif (this.isSimpleWidget) {\n\t\t\tcommandDelegate = {\n\t\t\t\tpaste: (text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => {\n\t\t\t\t\tthis._paste('keyboard', text, pasteOnNewLine, multicursorText, mode);\n\t\t\t\t},\n\t\t\t\ttype: (text: string) => {\n\t\t\t\t\tthis._type('keyboard', text);\n\t\t\t\t},\n\t\t\t\tcompositionType: (text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number) => {\n\t\t\t\t\tthis._compositionType('keyboard', text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t\t\t\t},\n\t\t\t\tstartComposition: () => {\n\t\t\t\t\tthis._startComposition();\n\t\t\t\t},\n\t\t\t\tendComposition: () => {\n\t\t\t\t\tthis._endComposition('keyboard');\n\t\t\t\t},\n\t\t\t\tcut: () => {\n\t\t\t\t\tthis._cut('keyboard');\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\tcommandDelegate = {\n\t\t\t\tpaste: (text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => {\n\t\t\t\t\tconst payload: editorCommon.PastePayload = { text, pasteOnNewLine, multicursorText, mode };\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.Paste, payload);\n\t\t\t\t},\n\t\t\t\ttype: (text: string) => {\n\t\t\t\t\tconst payload: editorCommon.TypePayload = { text };\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.Type, payload);\n\t\t\t\t},\n\t\t\t\tcompositionType: (text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number) => {\n\t\t\t\t\t// Try if possible to go through the existing `replacePreviousChar` command\n\t\t\t\t\tif (replaceNextCharCnt || positionDelta) {\n\t\t\t\t\t\t// must be handled through the new command\n\t\t\t\t\t\tconst payload: editorCommon.CompositionTypePayload = { text, replacePrevCharCnt, replaceNextCharCnt, positionDelta };\n\t\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.CompositionType, payload);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst payload: editorCommon.ReplacePreviousCharPayload = { text, replaceCharCnt: replacePrevCharCnt };\n\t\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.ReplacePreviousChar, payload);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tstartComposition: () => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.CompositionStart, {});\n\t\t\t\t},\n\t\t\t\tendComposition: () => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.CompositionEnd, {});\n\t\t\t\t},\n\t\t\t\tcut: () => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.Cut, {});\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tconst viewUserInputEvents = new ViewUserInputEvents(viewModel.coordinatesConverter);\n\t\tviewUserInputEvents.onKeyDown = (e) => this._onKeyDown.fire(e);\n\t\tviewUserInputEvents.onKeyUp = (e) => this._onKeyUp.fire(e);\n\t\tviewUserInputEvents.onContextMenu = (e) => this._onContextMenu.fire(e);\n\t\tviewUserInputEvents.onMouseMove = (e) => this._onMouseMove.fire(e);\n\t\tviewUserInputEvents.onMouseLeave = (e) => this._onMouseLeave.fire(e);\n\t\tviewUserInputEvents.onMouseDown = (e) => this._onMouseDown.fire(e);\n\t\tviewUserInputEvents.onMouseUp = (e) => this._onMouseUp.fire(e);\n\t\tviewUserInputEvents.onMouseDrag = (e) => this._onMouseDrag.fire(e);\n\t\tviewUserInputEvents.onMouseDrop = (e) => this._onMouseDrop.fire(e);\n\t\tviewUserInputEvents.onMouseDropCanceled = (e) => this._onMouseDropCanceled.fire(e);\n\t\tviewUserInputEvents.onMouseWheel = (e) => this._onMouseWheel.fire(e);\n\n\t\tconst view = new View(\n\t\t\tcommandDelegate,\n\t\t\tthis._configuration,\n\t\t\tthis._themeService.getColorTheme(),\n\t\t\tviewModel,\n\t\t\tviewUserInputEvents,\n\t\t\tthis._overflowWidgetsDomNode\n\t\t);\n\n\t\treturn [view, true];\n\t}\n\n\tprotected _postDetachModelCleanup(detachedModel: ITextModel | null): void {\n\t\tif (detachedModel) {\n\t\t\tdetachedModel.removeAllDecorationsWithOwnerId(this._id);\n\t\t}\n\t}\n\n\tprivate _detachModel(): ITextModel | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\tconst model = this._modelData.model;\n\t\tconst removeDomNode = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null;\n\n\t\tthis._modelData.dispose();\n\t\tthis._modelData = null;\n\n\t\tthis._domElement.removeAttribute('data-mode-id');\n\t\tif (removeDomNode && this._domElement.contains(removeDomNode)) {\n\t\t\tthis._domElement.removeChild(removeDomNode);\n\t\t}\n\t\tif (this._bannerDomNode && this._domElement.contains(this._bannerDomNode)) {\n\t\t\tthis._domElement.removeChild(this._bannerDomNode);\n\t\t}\n\n\t\treturn model;\n\t}\n\n\tprivate _removeDecorationType(key: string): void {\n\t\tthis._codeEditorService.removeDecorationType(key);\n\t}\n\n\tpublic hasModel(): this is editorBrowser.IActiveCodeEditor {\n\t\treturn (this._modelData !== null);\n\t}\n}\n\nconst enum BooleanEventValue {\n\tNotSet,\n\tFalse,\n\tTrue\n}\n\nexport class BooleanEventEmitter extends Disposable {\n\tprivate readonly _onDidChangeToTrue: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChangeToTrue: Event<void> = this._onDidChangeToTrue.event;\n\n\tprivate readonly _onDidChangeToFalse: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidChangeToFalse: Event<void> = this._onDidChangeToFalse.event;\n\n\tprivate _value: BooleanEventValue;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._value = BooleanEventValue.NotSet;\n\t}\n\n\tpublic setValue(_value: boolean) {\n\t\tconst value = (_value ? BooleanEventValue.True : BooleanEventValue.False);\n\t\tif (this._value === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._value = value;\n\t\tif (this._value === BooleanEventValue.True) {\n\t\t\tthis._onDidChangeToTrue.fire();\n\t\t} else if (this._value === BooleanEventValue.False) {\n\t\t\tthis._onDidChangeToFalse.fire();\n\t\t}\n\t}\n}\n\nclass EditorContextKeysManager extends Disposable {\n\n\tprivate readonly _editor: CodeEditorWidget;\n\tprivate readonly _editorSimpleInput: IContextKey<boolean>;\n\tprivate readonly _editorFocus: IContextKey<boolean>;\n\tprivate readonly _textInputFocus: IContextKey<boolean>;\n\tprivate readonly _editorTextFocus: IContextKey<boolean>;\n\tprivate readonly _editorTabMovesFocus: IContextKey<boolean>;\n\tprivate readonly _editorReadonly: IContextKey<boolean>;\n\tprivate readonly _inDiffEditor: IContextKey<boolean>;\n\tprivate readonly _editorColumnSelection: IContextKey<boolean>;\n\tprivate readonly _hasMultipleSelections: IContextKey<boolean>;\n\tprivate readonly _hasNonEmptySelection: IContextKey<boolean>;\n\tprivate readonly _canUndo: IContextKey<boolean>;\n\tprivate readonly _canRedo: IContextKey<boolean>;\n\n\tconstructor(\n\t\teditor: CodeEditorWidget,\n\t\tcontextKeyService: IContextKeyService\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\n\t\tcontextKeyService.createKey('editorId', editor.getId());\n\n\t\tthis._editorSimpleInput = EditorContextKeys.editorSimpleInput.bindTo(contextKeyService);\n\t\tthis._editorFocus = EditorContextKeys.focus.bindTo(contextKeyService);\n\t\tthis._textInputFocus = EditorContextKeys.textInputFocus.bindTo(contextKeyService);\n\t\tthis._editorTextFocus = EditorContextKeys.editorTextFocus.bindTo(contextKeyService);\n\t\tthis._editorTabMovesFocus = EditorContextKeys.tabMovesFocus.bindTo(contextKeyService);\n\t\tthis._editorReadonly = EditorContextKeys.readOnly.bindTo(contextKeyService);\n\t\tthis._inDiffEditor = EditorContextKeys.inDiffEditor.bindTo(contextKeyService);\n\t\tthis._editorColumnSelection = EditorContextKeys.columnSelection.bindTo(contextKeyService);\n\t\tthis._hasMultipleSelections = EditorContextKeys.hasMultipleSelections.bindTo(contextKeyService);\n\t\tthis._hasNonEmptySelection = EditorContextKeys.hasNonEmptySelection.bindTo(contextKeyService);\n\t\tthis._canUndo = EditorContextKeys.canUndo.bindTo(contextKeyService);\n\t\tthis._canRedo = EditorContextKeys.canRedo.bindTo(contextKeyService);\n\n\t\tthis._register(this._editor.onDidChangeConfiguration(() => this._updateFromConfig()));\n\t\tthis._register(this._editor.onDidChangeCursorSelection(() => this._updateFromSelection()));\n\t\tthis._register(this._editor.onDidFocusEditorWidget(() => this._updateFromFocus()));\n\t\tthis._register(this._editor.onDidBlurEditorWidget(() => this._updateFromFocus()));\n\t\tthis._register(this._editor.onDidFocusEditorText(() => this._updateFromFocus()));\n\t\tthis._register(this._editor.onDidBlurEditorText(() => this._updateFromFocus()));\n\t\tthis._register(this._editor.onDidChangeModel(() => this._updateFromModel()));\n\t\tthis._register(this._editor.onDidChangeConfiguration(() => this._updateFromModel()));\n\n\t\tthis._updateFromConfig();\n\t\tthis._updateFromSelection();\n\t\tthis._updateFromFocus();\n\t\tthis._updateFromModel();\n\n\t\tthis._editorSimpleInput.set(this._editor.isSimpleWidget);\n\t}\n\n\tprivate _updateFromConfig(): void {\n\t\tconst options = this._editor.getOptions();\n\n\t\tthis._editorTabMovesFocus.set(options.get(EditorOption.tabFocusMode));\n\t\tthis._editorReadonly.set(options.get(EditorOption.readOnly));\n\t\tthis._inDiffEditor.set(options.get(EditorOption.inDiffEditor));\n\t\tthis._editorColumnSelection.set(options.get(EditorOption.columnSelection));\n\t}\n\n\tprivate _updateFromSelection(): void {\n\t\tconst selections = this._editor.getSelections();\n\t\tif (!selections) {\n\t\t\tthis._hasMultipleSelections.reset();\n\t\t\tthis._hasNonEmptySelection.reset();\n\t\t} else {\n\t\t\tthis._hasMultipleSelections.set(selections.length > 1);\n\t\t\tthis._hasNonEmptySelection.set(selections.some(s => !s.isEmpty()));\n\t\t}\n\t}\n\n\tprivate _updateFromFocus(): void {\n\t\tthis._editorFocus.set(this._editor.hasWidgetFocus() && !this._editor.isSimpleWidget);\n\t\tthis._editorTextFocus.set(this._editor.hasTextFocus() && !this._editor.isSimpleWidget);\n\t\tthis._textInputFocus.set(this._editor.hasTextFocus());\n\t}\n\n\tprivate _updateFromModel(): void {\n\t\tconst model = this._editor.getModel();\n\t\tthis._canUndo.set(Boolean(model && model.canUndo()));\n\t\tthis._canRedo.set(Boolean(model && model.canRedo()));\n\t}\n}\n\nexport class EditorModeContext extends Disposable {\n\n\tprivate readonly _langId: IContextKey<string>;\n\tprivate readonly _hasCompletionItemProvider: IContextKey<boolean>;\n\tprivate readonly _hasCodeActionsProvider: IContextKey<boolean>;\n\tprivate readonly _hasCodeLensProvider: IContextKey<boolean>;\n\tprivate readonly _hasDefinitionProvider: IContextKey<boolean>;\n\tprivate readonly _hasDeclarationProvider: IContextKey<boolean>;\n\tprivate readonly _hasImplementationProvider: IContextKey<boolean>;\n\tprivate readonly _hasTypeDefinitionProvider: IContextKey<boolean>;\n\tprivate readonly _hasHoverProvider: IContextKey<boolean>;\n\tprivate readonly _hasDocumentHighlightProvider: IContextKey<boolean>;\n\tprivate readonly _hasDocumentSymbolProvider: IContextKey<boolean>;\n\tprivate readonly _hasReferenceProvider: IContextKey<boolean>;\n\tprivate readonly _hasRenameProvider: IContextKey<boolean>;\n\tprivate readonly _hasDocumentFormattingProvider: IContextKey<boolean>;\n\tprivate readonly _hasDocumentSelectionFormattingProvider: IContextKey<boolean>;\n\tprivate readonly _hasMultipleDocumentFormattingProvider: IContextKey<boolean>;\n\tprivate readonly _hasMultipleDocumentSelectionFormattingProvider: IContextKey<boolean>;\n\tprivate readonly _hasSignatureHelpProvider: IContextKey<boolean>;\n\tprivate readonly _hasInlayHintsProvider: IContextKey<boolean>;\n\tprivate readonly _isInWalkThrough: IContextKey<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: CodeEditorWidget,\n\t\tprivate readonly _contextKeyService: IContextKeyService,\n\t\tprivate readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\n\t\tthis._langId = EditorContextKeys.languageId.bindTo(_contextKeyService);\n\t\tthis._hasCompletionItemProvider = EditorContextKeys.hasCompletionItemProvider.bindTo(_contextKeyService);\n\t\tthis._hasCodeActionsProvider = EditorContextKeys.hasCodeActionsProvider.bindTo(_contextKeyService);\n\t\tthis._hasCodeLensProvider = EditorContextKeys.hasCodeLensProvider.bindTo(_contextKeyService);\n\t\tthis._hasDefinitionProvider = EditorContextKeys.hasDefinitionProvider.bindTo(_contextKeyService);\n\t\tthis._hasDeclarationProvider = EditorContextKeys.hasDeclarationProvider.bindTo(_contextKeyService);\n\t\tthis._hasImplementationProvider = EditorContextKeys.hasImplementationProvider.bindTo(_contextKeyService);\n\t\tthis._hasTypeDefinitionProvider = EditorContextKeys.hasTypeDefinitionProvider.bindTo(_contextKeyService);\n\t\tthis._hasHoverProvider = EditorContextKeys.hasHoverProvider.bindTo(_contextKeyService);\n\t\tthis._hasDocumentHighlightProvider = EditorContextKeys.hasDocumentHighlightProvider.bindTo(_contextKeyService);\n\t\tthis._hasDocumentSymbolProvider = EditorContextKeys.hasDocumentSymbolProvider.bindTo(_contextKeyService);\n\t\tthis._hasReferenceProvider = EditorContextKeys.hasReferenceProvider.bindTo(_contextKeyService);\n\t\tthis._hasRenameProvider = EditorContextKeys.hasRenameProvider.bindTo(_contextKeyService);\n\t\tthis._hasSignatureHelpProvider = EditorContextKeys.hasSignatureHelpProvider.bindTo(_contextKeyService);\n\t\tthis._hasInlayHintsProvider = EditorContextKeys.hasInlayHintsProvider.bindTo(_contextKeyService);\n\t\tthis._hasDocumentFormattingProvider = EditorContextKeys.hasDocumentFormattingProvider.bindTo(_contextKeyService);\n\t\tthis._hasDocumentSelectionFormattingProvider = EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(_contextKeyService);\n\t\tthis._hasMultipleDocumentFormattingProvider = EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(_contextKeyService);\n\t\tthis._hasMultipleDocumentSelectionFormattingProvider = EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(_contextKeyService);\n\t\tthis._isInWalkThrough = EditorContextKeys.isInWalkThroughSnippet.bindTo(_contextKeyService);\n\n\t\tconst update = () => this._update();\n\n\t\t// update when model/mode changes\n\t\tthis._register(_editor.onDidChangeModel(update));\n\t\tthis._register(_editor.onDidChangeModelLanguage(update));\n\n\t\t// update when registries change\n\t\tthis._register(_languageFeaturesService.completionProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.codeActionProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.codeLensProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.definitionProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.declarationProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.implementationProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.typeDefinitionProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.hoverProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.documentHighlightProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.documentSymbolProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.referenceProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.renameProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.documentFormattingEditProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.documentRangeFormattingEditProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.signatureHelpProvider.onDidChange(update));\n\t\tthis._register(_languageFeaturesService.inlayHintsProvider.onDidChange(update));\n\n\t\tupdate();\n\t}\n\n\toverride dispose() {\n\t\tsuper.dispose();\n\t}\n\n\treset() {\n\t\tthis._contextKeyService.bufferChangeEvents(() => {\n\t\t\tthis._langId.reset();\n\t\t\tthis._hasCompletionItemProvider.reset();\n\t\t\tthis._hasCodeActionsProvider.reset();\n\t\t\tthis._hasCodeLensProvider.reset();\n\t\t\tthis._hasDefinitionProvider.reset();\n\t\t\tthis._hasDeclarationProvider.reset();\n\t\t\tthis._hasImplementationProvider.reset();\n\t\t\tthis._hasTypeDefinitionProvider.reset();\n\t\t\tthis._hasHoverProvider.reset();\n\t\t\tthis._hasDocumentHighlightProvider.reset();\n\t\t\tthis._hasDocumentSymbolProvider.reset();\n\t\t\tthis._hasReferenceProvider.reset();\n\t\t\tthis._hasRenameProvider.reset();\n\t\t\tthis._hasDocumentFormattingProvider.reset();\n\t\t\tthis._hasDocumentSelectionFormattingProvider.reset();\n\t\t\tthis._hasSignatureHelpProvider.reset();\n\t\t\tthis._isInWalkThrough.reset();\n\t\t});\n\t}\n\n\tprivate _update() {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\t\tthis._contextKeyService.bufferChangeEvents(() => {\n\t\t\tthis._langId.set(model.getLanguageId());\n\t\t\tthis._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(model));\n\t\t\tthis._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(model));\n\t\t\tthis._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(model));\n\t\t\tthis._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(model));\n\t\t\tthis._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(model));\n\t\t\tthis._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(model));\n\t\t\tthis._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(model));\n\t\t\tthis._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(model));\n\t\t\tthis._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(model));\n\t\t\tthis._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(model));\n\t\t\tthis._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(model));\n\t\t\tthis._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(model));\n\t\t\tthis._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(model));\n\t\t\tthis._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(model));\n\t\t\tthis._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(model) || this._languageFeaturesService.documentRangeFormattingEditProvider.has(model));\n\t\t\tthis._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(model));\n\t\t\tthis._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(model).length + this._languageFeaturesService.documentRangeFormattingEditProvider.all(model).length > 1);\n\t\t\tthis._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(model).length > 1);\n\t\t\tthis._isInWalkThrough.set(model.uri.scheme === Schemas.walkThroughSnippet);\n\t\t});\n\t}\n}\n\nclass CodeEditorWidgetFocusTracker extends Disposable {\n\n\tprivate _hasFocus: boolean;\n\tprivate readonly _domFocusTracker: dom.IFocusTracker;\n\n\tprivate readonly _onChange: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onChange: Event<void> = this._onChange.event;\n\n\tconstructor(domElement: HTMLElement) {\n\t\tsuper();\n\n\t\tthis._hasFocus = false;\n\t\tthis._domFocusTracker = this._register(dom.trackFocus(domElement));\n\n\t\tthis._register(this._domFocusTracker.onDidFocus(() => {\n\t\t\tthis._hasFocus = true;\n\t\t\tthis._onChange.fire(undefined);\n\t\t}));\n\t\tthis._register(this._domFocusTracker.onDidBlur(() => {\n\t\t\tthis._hasFocus = false;\n\t\t\tthis._onChange.fire(undefined);\n\t\t}));\n\t}\n\n\tpublic hasFocus(): boolean {\n\t\treturn this._hasFocus;\n\t}\n}\n\nconst squigglyStart = encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='`);\nconst squigglyEnd = encodeURIComponent(`'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>`);\n\nfunction getSquigglySVGData(color: Color) {\n\treturn squigglyStart + encodeURIComponent(color.toString()) + squigglyEnd;\n}\n\nconst dotdotdotStart = encodeURIComponent(`<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"3\" width=\"12\"><g fill=\"`);\nconst dotdotdotEnd = encodeURIComponent(`\"><circle cx=\"1\" cy=\"1\" r=\"1\"/><circle cx=\"5\" cy=\"1\" r=\"1\"/><circle cx=\"9\" cy=\"1\" r=\"1\"/></g></svg>`);\n\nfunction getDotDotDotSVGData(color: Color) {\n\treturn dotdotdotStart + encodeURIComponent(color.toString()) + dotdotdotEnd;\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst errorBorderColor = theme.getColor(editorErrorBorder);\n\tif (errorBorderColor) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorErrorDecoration} { border-bottom: 4px double ${errorBorderColor}; }`);\n\t}\n\tconst errorForeground = theme.getColor(editorErrorForeground);\n\tif (errorForeground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorErrorDecoration} { background: url(\"data:image/svg+xml,${getSquigglySVGData(errorForeground)}\") repeat-x bottom left; }`);\n\t}\n\tconst errorBackground = theme.getColor(editorErrorBackground);\n\tif (errorBackground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorErrorDecoration}::before { display: block; content: ''; width: 100%; height: 100%; background: ${errorBackground}; }`);\n\t}\n\n\tconst warningBorderColor = theme.getColor(editorWarningBorder);\n\tif (warningBorderColor) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorWarningDecoration} { border-bottom: 4px double ${warningBorderColor}; }`);\n\t}\n\tconst warningForeground = theme.getColor(editorWarningForeground);\n\tif (warningForeground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorWarningDecoration} { background: url(\"data:image/svg+xml,${getSquigglySVGData(warningForeground)}\") repeat-x bottom left; }`);\n\t}\n\tconst warningBackground = theme.getColor(editorWarningBackground);\n\tif (warningBackground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorWarningDecoration}::before { display: block; content: ''; width: 100%; height: 100%; background: ${warningBackground}; }`);\n\t}\n\n\tconst infoBorderColor = theme.getColor(editorInfoBorder);\n\tif (infoBorderColor) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorInfoDecoration} { border-bottom: 4px double ${infoBorderColor}; }`);\n\t}\n\tconst infoForeground = theme.getColor(editorInfoForeground);\n\tif (infoForeground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorInfoDecoration} { background: url(\"data:image/svg+xml,${getSquigglySVGData(infoForeground)}\") repeat-x bottom left; }`);\n\t}\n\tconst infoBackground = theme.getColor(editorInfoBackground);\n\tif (infoBackground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorInfoDecoration}::before { display: block; content: ''; width: 100%; height: 100%; background: ${infoBackground}; }`);\n\t}\n\n\tconst hintBorderColor = theme.getColor(editorHintBorder);\n\tif (hintBorderColor) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorHintDecoration} { border-bottom: 2px dotted ${hintBorderColor}; }`);\n\t}\n\tconst hintForeground = theme.getColor(editorHintForeground);\n\tif (hintForeground) {\n\t\tcollector.addRule(`.monaco-editor .${ClassName.EditorHintDecoration} { background: url(\"data:image/svg+xml,${getDotDotDotSVGData(hintForeground)}\") no-repeat bottom left; }`);\n\t}\n\n\tconst unnecessaryForeground = theme.getColor(editorUnnecessaryCodeOpacity);\n\tif (unnecessaryForeground) {\n\t\tcollector.addRule(`.monaco-editor.showUnused .${ClassName.EditorUnnecessaryInlineDecoration} { opacity: ${unnecessaryForeground.rgba.a}; }`);\n\t}\n\n\tconst unnecessaryBorder = theme.getColor(editorUnnecessaryCodeBorder);\n\tif (unnecessaryBorder) {\n\t\tcollector.addRule(`.monaco-editor.showUnused .${ClassName.EditorUnnecessaryDecoration} { border-bottom: 2px dashed ${unnecessaryBorder}; }`);\n\t}\n\n\tconst deprecatedForeground = theme.getColor(editorForeground) || 'inherit';\n\tcollector.addRule(`.monaco-editor.showDeprecated .${ClassName.EditorDeprecatedInlineDecoration} { text-decoration: line-through; text-decoration-color: ${deprecatedForeground}}`);\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 'vs/css!./media/diffEditor';\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { ISashEvent, IVerticalSashLayoutProvider, Sash, SashState, Orientation } from 'vs/base/browser/ui/sash/sash';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';\nimport { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { DiffReview } from 'vs/editor/browser/widget/diffReview';\nimport { IDiffEditorOptions, EditorLayoutInfo, EditorOption, EditorOptions, EditorFontLigatures, stringSet as validateStringSetOption, boolean as validateBooleanOption, ValidDiffEditorBaseOptions, clampedInt } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\nimport { IStringBuilder, createStringBuilder } from 'vs/editor/common/core/stringBuilder';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { OverviewRulerZone } from 'vs/editor/common/viewModel/overviewZoneManager';\nimport { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { IEditorWhitespace, InlineDecoration, InlineDecorationType, IViewModel, ViewLineRenderingData } from 'vs/editor/common/viewModel';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { defaultInsertColor, defaultRemoveColor, diffBorder, diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, diffDiagonalFill, diffInsertedLineGutter, diffRemovedLineGutter, diffInsertedLine, diffRemovedLine, diffOverviewRulerInserted, diffOverviewRulerRemoved } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, IThemeService, getThemeTypeSelector, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IDiffLinesChange, InlineDiffMargin } from 'vs/editor/browser/widget/inlineDiffMargin';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { Constants } from 'vs/base/common/uint';\nimport { EditorExtensionsRegistry, IDiffEditorContributionDescription } from 'vs/editor/browser/editorExtensions';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IEditorProgressService, IProgressRunner } from 'vs/platform/progress/common/progress';\nimport { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor';\nimport { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens';\nimport { FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { ILineBreaksComputer } from 'vs/editor/common/modelLineProjectionData';\nimport { IChange, IDiffComputationResult, ILineChange } from 'vs/editor/common/diff/diffComputer';\nimport { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration';\nimport { IDimension } from 'vs/editor/common/core/dimension';\n\nexport interface IDiffCodeEditorWidgetOptions {\n\toriginalEditor?: ICodeEditorWidgetOptions;\n\tmodifiedEditor?: ICodeEditorWidgetOptions;\n}\n\ninterface IEditorDiffDecorations {\n\tdecorations: IModelDeltaDecoration[];\n\toverviewZones: OverviewRulerZone[];\n}\n\ninterface IEditorDiffDecorationsWithZones extends IEditorDiffDecorations {\n\tzones: IMyViewZone[];\n}\n\ninterface IEditorsDiffDecorationsWithZones {\n\toriginal: IEditorDiffDecorationsWithZones;\n\tmodified: IEditorDiffDecorationsWithZones;\n}\n\ninterface IEditorsZones {\n\toriginal: IMyViewZone[];\n\tmodified: IMyViewZone[];\n}\n\nclass VisualEditorState {\n\tprivate _zones: string[];\n\tprivate _inlineDiffMargins: InlineDiffMargin[];\n\tprivate _zonesMap: { [zoneId: string]: boolean };\n\tprivate _decorations: string[];\n\n\tconstructor(\n\t\tprivate _contextMenuService: IContextMenuService,\n\t\tprivate _clipboardService: IClipboardService\n\t) {\n\t\tthis._zones = [];\n\t\tthis._inlineDiffMargins = [];\n\t\tthis._zonesMap = {};\n\t\tthis._decorations = [];\n\t}\n\n\tpublic getForeignViewZones(allViewZones: IEditorWhitespace[]): IEditorWhitespace[] {\n\t\treturn allViewZones.filter((z) => !this._zonesMap[String(z.id)]);\n\t}\n\n\tpublic clean(editor: CodeEditorWidget): void {\n\t\t// (1) View zones\n\t\tif (this._zones.length > 0) {\n\t\t\teditor.changeViewZones((viewChangeAccessor: editorBrowser.IViewZoneChangeAccessor) => {\n\t\t\t\tfor (const zoneId of this._zones) {\n\t\t\t\t\tviewChangeAccessor.removeZone(zoneId);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis._zones = [];\n\t\tthis._zonesMap = {};\n\n\t\t// (2) Model decorations\n\t\tthis._decorations = editor.deltaDecorations(this._decorations, []);\n\t}\n\n\tpublic apply(editor: CodeEditorWidget, overviewRuler: editorBrowser.IOverviewRuler | null, newDecorations: IEditorDiffDecorationsWithZones, restoreScrollState: boolean): void {\n\n\t\tconst scrollState = restoreScrollState ? StableEditorScrollState.capture(editor) : null;\n\n\t\t// view zones\n\t\teditor.changeViewZones((viewChangeAccessor: editorBrowser.IViewZoneChangeAccessor) => {\n\t\t\tfor (const zoneId of this._zones) {\n\t\t\t\tviewChangeAccessor.removeZone(zoneId);\n\t\t\t}\n\t\t\tfor (const inlineDiffMargin of this._inlineDiffMargins) {\n\t\t\t\tinlineDiffMargin.dispose();\n\t\t\t}\n\t\t\tthis._zones = [];\n\t\t\tthis._zonesMap = {};\n\t\t\tthis._inlineDiffMargins = [];\n\t\t\tfor (let i = 0, length = newDecorations.zones.length; i < length; i++) {\n\t\t\t\tconst viewZone = <editorBrowser.IViewZone>newDecorations.zones[i];\n\t\t\t\tviewZone.suppressMouseDown = true;\n\t\t\t\tconst zoneId = viewChangeAccessor.addZone(viewZone);\n\t\t\t\tthis._zones.push(zoneId);\n\t\t\t\tthis._zonesMap[String(zoneId)] = true;\n\n\t\t\t\tif (newDecorations.zones[i].diff && viewZone.marginDomNode) {\n\t\t\t\t\tviewZone.suppressMouseDown = false;\n\t\t\t\t\tif (newDecorations.zones[i].diff?.originalModel.getValueLength() !== 0) {\n\t\t\t\t\t\t// do not contribute diff margin actions for newly created files\n\t\t\t\t\t\tthis._inlineDiffMargins.push(new InlineDiffMargin(zoneId, viewZone.marginDomNode, editor, newDecorations.zones[i].diff!, this._contextMenuService, this._clipboardService));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (scrollState) {\n\t\t\tscrollState.restore(editor);\n\t\t}\n\n\t\t// decorations\n\t\tthis._decorations = editor.deltaDecorations(this._decorations, newDecorations.decorations);\n\n\t\t// overview ruler\n\t\tif (overviewRuler) {\n\t\t\toverviewRuler.setZones(newDecorations.overviewZones);\n\t\t}\n\t}\n}\n\nlet DIFF_EDITOR_ID = 0;\n\n\nconst diffInsertIcon = registerIcon('diff-insert', Codicon.add, nls.localize('diffInsertIcon', 'Line decoration for inserts in the diff editor.'));\nconst diffRemoveIcon = registerIcon('diff-remove', Codicon.remove, nls.localize('diffRemoveIcon', 'Line decoration for removals in the diff editor.'));\nconst ttPolicy = window.trustedTypes?.createPolicy('diffEditorWidget', { createHTML: value => value });\n\nexport class DiffEditorWidget extends Disposable implements editorBrowser.IDiffEditor {\n\n\tprivate static readonly ONE_OVERVIEW_WIDTH = 15;\n\tpublic static readonly ENTIRE_DIFF_OVERVIEW_WIDTH = 30;\n\tprivate static readonly UPDATE_DIFF_DECORATIONS_DELAY = 200; // ms\n\n\tprivate readonly _onDidDispose: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidDispose: Event<void> = this._onDidDispose.event;\n\n\tprivate readonly _onDidUpdateDiff: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidUpdateDiff: Event<void> = this._onDidUpdateDiff.event;\n\n\tprivate readonly _onDidContentSizeChange: Emitter<editorCommon.IContentSizeChangedEvent> = this._register(new Emitter<editorCommon.IContentSizeChangedEvent>());\n\n\tprivate readonly _id: number;\n\tprivate _state: editorBrowser.DiffEditorState;\n\tprivate _updatingDiffProgress: IProgressRunner | null;\n\n\tprivate readonly _domElement: HTMLElement;\n\tprotected readonly _containerDomElement: HTMLElement;\n\tprivate readonly _overviewDomElement: HTMLElement;\n\tprivate readonly _overviewViewportDomElement: FastDomNode<HTMLElement>;\n\n\tprivate readonly _elementSizeObserver: ElementSizeObserver;\n\n\tprivate readonly _originalEditor: CodeEditorWidget;\n\tprivate readonly _originalDomNode: HTMLElement;\n\tprivate readonly _originalEditorState: VisualEditorState;\n\tprivate _originalOverviewRuler: editorBrowser.IOverviewRuler | null;\n\n\tprivate readonly _modifiedEditor: CodeEditorWidget;\n\tprivate readonly _modifiedDomNode: HTMLElement;\n\tprivate readonly _modifiedEditorState: VisualEditorState;\n\tprivate _modifiedOverviewRuler: editorBrowser.IOverviewRuler | null;\n\n\tprivate _currentlyChangingViewZones: boolean;\n\tprivate _beginUpdateDecorationsTimeout: number;\n\tprivate _diffComputationToken: number;\n\tprivate _diffComputationResult: IDiffComputationResult | null;\n\n\tprivate _isVisible: boolean;\n\tprivate _isHandlingScrollEvent: boolean;\n\n\tprivate _options: ValidDiffEditorBaseOptions;\n\n\tprivate _strategy!: DiffEditorWidgetStyle;\n\n\tprivate readonly _updateDecorationsRunner: RunOnceScheduler;\n\n\tprivate readonly _editorWorkerService: IEditorWorkerService;\n\tprivate readonly _contextKeyService: IContextKeyService;\n\tprivate readonly _instantiationService: IInstantiationService;\n\tprivate readonly _codeEditorService: ICodeEditorService;\n\tprivate readonly _themeService: IThemeService;\n\tprivate readonly _notificationService: INotificationService;\n\n\tprivate readonly _reviewPane: DiffReview;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: Readonly<editorBrowser.IDiffEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: IDiffCodeEditorWidgetOptions,\n\t\t@IClipboardService clipboardService: IClipboardService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IEditorProgressService private readonly _editorProgressService: IEditorProgressService\n\t) {\n\t\tsuper();\n\n\t\tthis._editorWorkerService = editorWorkerService;\n\t\tthis._codeEditorService = codeEditorService;\n\t\tthis._contextKeyService = this._register(contextKeyService.createScoped(domElement));\n\t\tthis._instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]));\n\t\tthis._contextKeyService.createKey('isInDiffEditor', true);\n\t\tthis._themeService = themeService;\n\t\tthis._notificationService = notificationService;\n\n\t\tthis._id = (++DIFF_EDITOR_ID);\n\t\tthis._state = editorBrowser.DiffEditorState.Idle;\n\t\tthis._updatingDiffProgress = null;\n\n\t\tthis._domElement = domElement;\n\t\toptions = options || {};\n\n\t\tthis._options = validateDiffEditorOptions(options, {\n\t\t\tenableSplitViewResizing: true,\n\t\t\trenderSideBySide: true,\n\t\t\tmaxComputationTime: 5000,\n\t\t\tmaxFileSize: 50,\n\t\t\tignoreTrimWhitespace: true,\n\t\t\trenderIndicators: true,\n\t\t\toriginalEditable: false,\n\t\t\tdiffCodeLens: false,\n\t\t\trenderOverviewRuler: true,\n\t\t\tdiffWordWrap: 'inherit'\n\t\t});\n\n\t\tif (typeof options.isInEmbeddedEditor !== 'undefined') {\n\t\t\tthis._contextKeyService.createKey('isInEmbeddedDiffEditor', options.isInEmbeddedEditor);\n\t\t} else {\n\t\t\tthis._contextKeyService.createKey('isInEmbeddedDiffEditor', false);\n\t\t}\n\n\t\tthis._updateDecorationsRunner = this._register(new RunOnceScheduler(() => this._updateDecorations(), 0));\n\n\t\tthis._containerDomElement = document.createElement('div');\n\t\tthis._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._options.renderSideBySide);\n\t\tthis._containerDomElement.style.position = 'relative';\n\t\tthis._containerDomElement.style.height = '100%';\n\t\tthis._domElement.appendChild(this._containerDomElement);\n\n\t\tthis._overviewViewportDomElement = createFastDomNode(document.createElement('div'));\n\t\tthis._overviewViewportDomElement.setClassName('diffViewport');\n\t\tthis._overviewViewportDomElement.setPosition('absolute');\n\n\t\tthis._overviewDomElement = document.createElement('div');\n\t\tthis._overviewDomElement.className = 'diffOverview';\n\t\tthis._overviewDomElement.style.position = 'absolute';\n\n\t\tthis._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode);\n\n\t\tthis._register(dom.addStandardDisposableListener(this._overviewDomElement, 'mousedown', (e) => {\n\t\t\tthis._modifiedEditor.delegateVerticalScrollbarMouseDown(e);\n\t\t}));\n\t\tif (this._options.renderOverviewRuler) {\n\t\t\tthis._containerDomElement.appendChild(this._overviewDomElement);\n\t\t}\n\n\t\t// Create left side\n\t\tthis._originalDomNode = document.createElement('div');\n\t\tthis._originalDomNode.className = 'editor original';\n\t\tthis._originalDomNode.style.position = 'absolute';\n\t\tthis._originalDomNode.style.height = '100%';\n\t\tthis._containerDomElement.appendChild(this._originalDomNode);\n\n\t\t// Create right side\n\t\tthis._modifiedDomNode = document.createElement('div');\n\t\tthis._modifiedDomNode.className = 'editor modified';\n\t\tthis._modifiedDomNode.style.position = 'absolute';\n\t\tthis._modifiedDomNode.style.height = '100%';\n\t\tthis._containerDomElement.appendChild(this._modifiedDomNode);\n\n\t\tthis._beginUpdateDecorationsTimeout = -1;\n\t\tthis._currentlyChangingViewZones = false;\n\t\tthis._diffComputationToken = 0;\n\n\t\tthis._originalEditorState = new VisualEditorState(contextMenuService, clipboardService);\n\t\tthis._modifiedEditorState = new VisualEditorState(contextMenuService, clipboardService);\n\n\t\tthis._isVisible = true;\n\t\tthis._isHandlingScrollEvent = false;\n\n\t\tthis._elementSizeObserver = this._register(new ElementSizeObserver(this._containerDomElement, options.dimension));\n\t\tthis._register(this._elementSizeObserver.onDidChange(() => this._onDidContainerSizeChanged()));\n\t\tif (options.automaticLayout) {\n\t\t\tthis._elementSizeObserver.startObserving();\n\t\t}\n\n\t\tthis._diffComputationResult = null;\n\n\t\tthis._originalEditor = this._createLeftHandSideEditor(options, codeEditorWidgetOptions.originalEditor || {});\n\t\tthis._modifiedEditor = this._createRightHandSideEditor(options, codeEditorWidgetOptions.modifiedEditor || {});\n\n\t\tthis._originalOverviewRuler = null;\n\t\tthis._modifiedOverviewRuler = null;\n\n\t\tthis._reviewPane = instantiationService.createInstance(DiffReview, this);\n\t\tthis._containerDomElement.appendChild(this._reviewPane.domNode.domNode);\n\t\tthis._containerDomElement.appendChild(this._reviewPane.shadow.domNode);\n\t\tthis._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode);\n\n\t\tif (this._options.renderSideBySide) {\n\t\t\tthis._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(), this._options.enableSplitViewResizing));\n\t\t} else {\n\t\t\tthis._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._options.enableSplitViewResizing));\n\t\t}\n\n\t\tthis._register(themeService.onDidColorThemeChange(t => {\n\t\t\tif (this._strategy && this._strategy.applyColors(t)) {\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t}\n\t\t\tthis._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._options.renderSideBySide);\n\t\t}));\n\n\t\tconst contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();\n\t\tfor (const desc of contributions) {\n\t\t\ttry {\n\t\t\t\tthis._register(instantiationService.createInstance(desc.ctor, this));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\n\t\tthis._codeEditorService.addDiffEditor(this);\n\t}\n\n\tprivate _setState(newState: editorBrowser.DiffEditorState): void {\n\t\tif (this._state === newState) {\n\t\t\treturn;\n\t\t}\n\t\tthis._state = newState;\n\n\t\tif (this._updatingDiffProgress) {\n\t\t\tthis._updatingDiffProgress.done();\n\t\t\tthis._updatingDiffProgress = null;\n\t\t}\n\n\t\tif (this._state === editorBrowser.DiffEditorState.ComputingDiff) {\n\t\t\tthis._updatingDiffProgress = this._editorProgressService.show(true, 1000);\n\t\t}\n\t}\n\n\tpublic diffReviewNext(): void {\n\t\tthis._reviewPane.next();\n\t}\n\n\tpublic diffReviewPrev(): void {\n\t\tthis._reviewPane.prev();\n\t}\n\n\tprivate static _getClassName(theme: IColorTheme, renderSideBySide: boolean): string {\n\t\tlet result = 'monaco-diff-editor monaco-editor-background ';\n\t\tif (renderSideBySide) {\n\t\t\tresult += 'side-by-side ';\n\t\t}\n\t\tresult += getThemeTypeSelector(theme.type);\n\t\treturn result;\n\t}\n\n\tprivate _recreateOverviewRulers(): void {\n\t\tif (!this._options.renderOverviewRuler) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._originalOverviewRuler) {\n\t\t\tthis._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode());\n\t\t\tthis._originalOverviewRuler.dispose();\n\t\t}\n\t\tif (this._originalEditor.hasModel()) {\n\t\t\tthis._originalOverviewRuler = this._originalEditor.createOverviewRuler('original diffOverviewRuler')!;\n\t\t\tthis._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode());\n\t\t}\n\n\t\tif (this._modifiedOverviewRuler) {\n\t\t\tthis._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode());\n\t\t\tthis._modifiedOverviewRuler.dispose();\n\t\t}\n\t\tif (this._modifiedEditor.hasModel()) {\n\t\t\tthis._modifiedOverviewRuler = this._modifiedEditor.createOverviewRuler('modified diffOverviewRuler')!;\n\t\t\tthis._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode());\n\t\t}\n\n\t\tthis._layoutOverviewRulers();\n\t}\n\n\tprivate _createLeftHandSideEditor(options: Readonly<editorBrowser.IDiffEditorConstructionOptions>, codeEditorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = this._createInnerEditor(this._instantiationService, this._originalDomNode, this._adjustOptionsForLeftHandSide(options), codeEditorWidgetOptions);\n\n\t\tthis._register(editor.onDidScrollChange((e) => {\n\t\t\tif (this._isHandlingScrollEvent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHandlingScrollEvent = true;\n\t\t\tthis._modifiedEditor.setScrollPosition({\n\t\t\t\tscrollLeft: e.scrollLeft,\n\t\t\t\tscrollTop: e.scrollTop\n\t\t\t});\n\t\t\tthis._isHandlingScrollEvent = false;\n\n\t\t\tthis._layoutOverviewViewport();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeViewZones(() => {\n\t\t\tthis._onViewZonesChanged();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (!editor.getModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.wrappingInfo)) {\n\t\t\t\tthis._updateDecorationsRunner.cancel();\n\t\t\t\tthis._updateDecorations();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeHiddenAreas(() => {\n\t\t\tthis._updateDecorationsRunner.cancel();\n\t\t\tthis._updateDecorations();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeModelContent(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._beginUpdateDecorationsSoon();\n\t\t\t}\n\t\t}));\n\n\t\tconst isInDiffLeftEditorKey = this._contextKeyService.createKey<boolean>('isInDiffLeftEditor', editor.hasWidgetFocus());\n\t\tthis._register(editor.onDidFocusEditorWidget(() => isInDiffLeftEditorKey.set(true)));\n\t\tthis._register(editor.onDidBlurEditorWidget(() => isInDiffLeftEditorKey.set(false)));\n\n\t\tthis._register(editor.onDidContentSizeChange(e => {\n\t\t\tconst width = this._originalEditor.getContentWidth() + this._modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH;\n\t\t\tconst height = Math.max(this._modifiedEditor.getContentHeight(), this._originalEditor.getContentHeight());\n\n\t\t\tthis._onDidContentSizeChange.fire({\n\t\t\t\tcontentHeight: height,\n\t\t\t\tcontentWidth: width,\n\t\t\t\tcontentHeightChanged: e.contentHeightChanged,\n\t\t\t\tcontentWidthChanged: e.contentWidthChanged\n\t\t\t});\n\t\t}));\n\n\t\treturn editor;\n\t}\n\n\tprivate _createRightHandSideEditor(options: Readonly<editorBrowser.IDiffEditorConstructionOptions>, codeEditorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = this._createInnerEditor(this._instantiationService, this._modifiedDomNode, this._adjustOptionsForRightHandSide(options), codeEditorWidgetOptions);\n\n\t\tthis._register(editor.onDidScrollChange((e) => {\n\t\t\tif (this._isHandlingScrollEvent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHandlingScrollEvent = true;\n\t\t\tthis._originalEditor.setScrollPosition({\n\t\t\t\tscrollLeft: e.scrollLeft,\n\t\t\t\tscrollTop: e.scrollTop\n\t\t\t});\n\t\t\tthis._isHandlingScrollEvent = false;\n\n\t\t\tthis._layoutOverviewViewport();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeViewZones(() => {\n\t\t\tthis._onViewZonesChanged();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (!editor.getModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.wrappingInfo)) {\n\t\t\t\tthis._updateDecorationsRunner.cancel();\n\t\t\t\tthis._updateDecorations();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeHiddenAreas(() => {\n\t\t\tthis._updateDecorationsRunner.cancel();\n\t\t\tthis._updateDecorations();\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeModelContent(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._beginUpdateDecorationsSoon();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(editor.onDidChangeModelOptions((e) => {\n\t\t\tif (e.tabSize) {\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tconst isInDiffRightEditorKey = this._contextKeyService.createKey<boolean>('isInDiffRightEditor', editor.hasWidgetFocus());\n\t\tthis._register(editor.onDidFocusEditorWidget(() => isInDiffRightEditorKey.set(true)));\n\t\tthis._register(editor.onDidBlurEditorWidget(() => isInDiffRightEditorKey.set(false)));\n\n\t\tthis._register(editor.onDidContentSizeChange(e => {\n\t\t\tconst width = this._originalEditor.getContentWidth() + this._modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH;\n\t\t\tconst height = Math.max(this._modifiedEditor.getContentHeight(), this._originalEditor.getContentHeight());\n\n\t\t\tthis._onDidContentSizeChange.fire({\n\t\t\t\tcontentHeight: height,\n\t\t\t\tcontentWidth: width,\n\t\t\t\tcontentHeightChanged: e.contentHeightChanged,\n\t\t\t\tcontentWidthChanged: e.contentWidthChanged\n\t\t\t});\n\t\t}));\n\n\t\treturn editor;\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorConstructionOptions>, editorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\treturn instantiationService.createInstance(CodeEditorWidget, container, options, editorWidgetOptions);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._codeEditorService.removeDiffEditor(this);\n\n\t\tif (this._beginUpdateDecorationsTimeout !== -1) {\n\t\t\twindow.clearTimeout(this._beginUpdateDecorationsTimeout);\n\t\t\tthis._beginUpdateDecorationsTimeout = -1;\n\t\t}\n\n\t\tthis._cleanViewZonesAndDecorations();\n\n\t\tif (this._originalOverviewRuler) {\n\t\t\tthis._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode());\n\t\t\tthis._originalOverviewRuler.dispose();\n\t\t}\n\t\tif (this._modifiedOverviewRuler) {\n\t\t\tthis._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode());\n\t\t\tthis._modifiedOverviewRuler.dispose();\n\t\t}\n\t\tthis._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode);\n\t\tif (this._options.renderOverviewRuler) {\n\t\t\tthis._containerDomElement.removeChild(this._overviewDomElement);\n\t\t}\n\n\t\tthis._containerDomElement.removeChild(this._originalDomNode);\n\t\tthis._originalEditor.dispose();\n\n\t\tthis._containerDomElement.removeChild(this._modifiedDomNode);\n\t\tthis._modifiedEditor.dispose();\n\n\t\tthis._strategy.dispose();\n\n\t\tthis._containerDomElement.removeChild(this._reviewPane.domNode.domNode);\n\t\tthis._containerDomElement.removeChild(this._reviewPane.shadow.domNode);\n\t\tthis._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode);\n\t\tthis._reviewPane.dispose();\n\n\t\tthis._domElement.removeChild(this._containerDomElement);\n\n\t\tthis._onDidDispose.fire();\n\n\t\tsuper.dispose();\n\t}\n\n\t//------------ begin IDiffEditor methods\n\n\tpublic getId(): string {\n\t\treturn this.getEditorType() + ':' + this._id;\n\t}\n\n\tpublic getEditorType(): string {\n\t\treturn editorCommon.EditorType.IDiffEditor;\n\t}\n\n\tpublic getLineChanges(): ILineChange[] | null {\n\t\tif (!this._diffComputationResult) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._diffComputationResult.changes;\n\t}\n\n\tpublic getOriginalEditor(): editorBrowser.ICodeEditor {\n\t\treturn this._originalEditor;\n\t}\n\n\tpublic getModifiedEditor(): editorBrowser.ICodeEditor {\n\t\treturn this._modifiedEditor;\n\t}\n\n\tpublic updateOptions(_newOptions: Readonly<IDiffEditorOptions>): void {\n\t\tconst newOptions = validateDiffEditorOptions(_newOptions, this._options);\n\t\tconst changed = changedDiffEditorOptions(this._options, newOptions);\n\t\tthis._options = newOptions;\n\n\t\tconst beginUpdateDecorations = (changed.ignoreTrimWhitespace || changed.renderIndicators);\n\t\tconst beginUpdateDecorationsSoon = (this._isVisible && (changed.maxComputationTime || changed.maxFileSize));\n\n\t\tif (beginUpdateDecorations) {\n\t\t\tthis._beginUpdateDecorations();\n\t\t} else if (beginUpdateDecorationsSoon) {\n\t\t\tthis._beginUpdateDecorationsSoon();\n\t\t}\n\n\t\tthis._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(_newOptions));\n\t\tthis._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(_newOptions));\n\n\t\t// enableSplitViewResizing\n\t\tthis._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing);\n\n\t\t// renderSideBySide\n\t\tif (changed.renderSideBySide) {\n\t\t\tif (this._options.renderSideBySide) {\n\t\t\t\tthis._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(), this._options.enableSplitViewResizing));\n\t\t\t} else {\n\t\t\t\tthis._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._options.enableSplitViewResizing));\n\t\t\t}\n\t\t\t// Update class name\n\t\t\tthis._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._options.renderSideBySide);\n\t\t}\n\n\t\t// renderOverviewRuler\n\t\tif (changed.renderOverviewRuler) {\n\t\t\tif (this._options.renderOverviewRuler) {\n\t\t\t\tthis._containerDomElement.appendChild(this._overviewDomElement);\n\t\t\t} else {\n\t\t\t\tthis._containerDomElement.removeChild(this._overviewDomElement);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getModel(): editorCommon.IDiffEditorModel {\n\t\treturn {\n\t\t\toriginal: this._originalEditor.getModel()!,\n\t\t\tmodified: this._modifiedEditor.getModel()!\n\t\t};\n\t}\n\n\tpublic setModel(model: editorCommon.IDiffEditorModel | null): void {\n\t\t// Guard us against partial null model\n\t\tif (model && (!model.original || !model.modified)) {\n\t\t\tthrow new Error(!model.original ? 'DiffEditorWidget.setModel: Original model is null' : 'DiffEditorWidget.setModel: Modified model is null');\n\t\t}\n\n\t\t// Remove all view zones & decorations\n\t\tthis._cleanViewZonesAndDecorations();\n\n\t\t// Update code editor models\n\t\tthis._originalEditor.setModel(model ? model.original : null);\n\t\tthis._modifiedEditor.setModel(model ? model.modified : null);\n\t\tthis._updateDecorationsRunner.cancel();\n\n\t\t// this.originalEditor.onDidChangeModelOptions\n\n\t\tif (model) {\n\t\t\tthis._originalEditor.setScrollTop(0);\n\t\t\tthis._modifiedEditor.setScrollTop(0);\n\t\t}\n\n\t\t// Disable any diff computations that will come in\n\t\tthis._diffComputationResult = null;\n\t\tthis._diffComputationToken++;\n\t\tthis._setState(editorBrowser.DiffEditorState.Idle);\n\n\t\tif (model) {\n\t\t\tthis._recreateOverviewRulers();\n\n\t\t\t// Begin comparing\n\t\t\tthis._beginUpdateDecorations();\n\t\t}\n\n\t\tthis._layoutOverviewViewport();\n\t}\n\n\tpublic getContainerDomNode(): HTMLElement {\n\t\treturn this._domElement;\n\t}\n\n\tpublic getVisibleColumnFromPosition(position: IPosition): number {\n\t\treturn this._modifiedEditor.getVisibleColumnFromPosition(position);\n\t}\n\n\tpublic getPosition(): Position | null {\n\t\treturn this._modifiedEditor.getPosition();\n\t}\n\n\tpublic setPosition(position: IPosition, source: string = 'api'): void {\n\t\tthis._modifiedEditor.setPosition(position, source);\n\t}\n\n\tpublic revealLine(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLine(lineNumber, scrollType);\n\t}\n\n\tpublic revealLineInCenter(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLineInCenter(lineNumber, scrollType);\n\t}\n\n\tpublic revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLineInCenterIfOutsideViewport(lineNumber, scrollType);\n\t}\n\n\tpublic revealLineNearTop(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLineNearTop(lineNumber, scrollType);\n\t}\n\n\tpublic revealPosition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealPosition(position, scrollType);\n\t}\n\n\tpublic revealPositionInCenter(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealPositionInCenter(position, scrollType);\n\t}\n\n\tpublic revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealPositionInCenterIfOutsideViewport(position, scrollType);\n\t}\n\n\tpublic revealPositionNearTop(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealPositionNearTop(position, scrollType);\n\t}\n\n\tpublic getSelection(): Selection | null {\n\t\treturn this._modifiedEditor.getSelection();\n\t}\n\n\tpublic getSelections(): Selection[] | null {\n\t\treturn this._modifiedEditor.getSelections();\n\t}\n\n\tpublic setSelection(range: IRange, source?: string): void;\n\tpublic setSelection(editorRange: Range, source?: string): void;\n\tpublic setSelection(selection: ISelection, source?: string): void;\n\tpublic setSelection(editorSelection: Selection, source?: string): void;\n\tpublic setSelection(something: any, source: string = 'api'): void {\n\t\tthis._modifiedEditor.setSelection(something, source);\n\t}\n\n\tpublic setSelections(ranges: readonly ISelection[], source: string = 'api'): void {\n\t\tthis._modifiedEditor.setSelections(ranges, source);\n\t}\n\n\tpublic revealLines(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLines(startLineNumber, endLineNumber, scrollType);\n\t}\n\n\tpublic revealLinesInCenter(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLinesInCenter(startLineNumber, endLineNumber, scrollType);\n\t}\n\n\tpublic revealLinesInCenterIfOutsideViewport(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType);\n\t}\n\n\tpublic revealLinesNearTop(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealLinesNearTop(startLineNumber, endLineNumber, scrollType);\n\t}\n\n\tpublic revealRange(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth, revealVerticalInCenter: boolean = false, revealHorizontal: boolean = true): void {\n\t\tthis._modifiedEditor.revealRange(range, scrollType, revealVerticalInCenter, revealHorizontal);\n\t}\n\n\tpublic revealRangeInCenter(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealRangeInCenter(range, scrollType);\n\t}\n\n\tpublic revealRangeInCenterIfOutsideViewport(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealRangeInCenterIfOutsideViewport(range, scrollType);\n\t}\n\n\tpublic revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealRangeNearTop(range, scrollType);\n\t}\n\n\tpublic revealRangeNearTopIfOutsideViewport(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealRangeNearTopIfOutsideViewport(range, scrollType);\n\t}\n\n\tpublic revealRangeAtTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void {\n\t\tthis._modifiedEditor.revealRangeAtTop(range, scrollType);\n\t}\n\n\tpublic getSupportedActions(): editorCommon.IEditorAction[] {\n\t\treturn this._modifiedEditor.getSupportedActions();\n\t}\n\n\tpublic saveViewState(): editorCommon.IDiffEditorViewState {\n\t\tconst originalViewState = this._originalEditor.saveViewState();\n\t\tconst modifiedViewState = this._modifiedEditor.saveViewState();\n\t\treturn {\n\t\t\toriginal: originalViewState,\n\t\t\tmodified: modifiedViewState\n\t\t};\n\t}\n\n\tpublic restoreViewState(s: editorCommon.IDiffEditorViewState): void {\n\t\tif (s && s.original && s.modified) {\n\t\t\tconst diffEditorState = <editorCommon.IDiffEditorViewState>s;\n\t\t\tthis._originalEditor.restoreViewState(diffEditorState.original);\n\t\t\tthis._modifiedEditor.restoreViewState(diffEditorState.modified);\n\t\t}\n\t}\n\n\tpublic layout(dimension?: IDimension): void {\n\t\tthis._elementSizeObserver.observe(dimension);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._modifiedEditor.focus();\n\t}\n\n\tpublic hasTextFocus(): boolean {\n\t\treturn this._originalEditor.hasTextFocus() || this._modifiedEditor.hasTextFocus();\n\t}\n\n\tpublic trigger(source: string | null | undefined, handlerId: string, payload: any): void {\n\t\tthis._modifiedEditor.trigger(source, handlerId, payload);\n\t}\n\n\tpublic changeDecorations(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any {\n\t\treturn this._modifiedEditor.changeDecorations(callback);\n\t}\n\n\t//------------ end IDiffEditor methods\n\n\n\n\t//------------ begin layouting methods\n\n\tprivate _onDidContainerSizeChanged(): void {\n\t\tthis._doLayout();\n\t}\n\n\tprivate _getReviewHeight(): number {\n\t\treturn this._reviewPane.isVisible() ? this._elementSizeObserver.getHeight() : 0;\n\t}\n\n\tprivate _layoutOverviewRulers(): void {\n\t\tif (!this._options.renderOverviewRuler) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._originalOverviewRuler || !this._modifiedOverviewRuler) {\n\t\t\treturn;\n\t\t}\n\t\tconst height = this._elementSizeObserver.getHeight();\n\t\tconst reviewHeight = this._getReviewHeight();\n\n\t\tconst freeSpace = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * DiffEditorWidget.ONE_OVERVIEW_WIDTH;\n\t\tconst layoutInfo = this._modifiedEditor.getLayoutInfo();\n\t\tif (layoutInfo) {\n\t\t\tthis._originalOverviewRuler.setLayout({\n\t\t\t\ttop: 0,\n\t\t\t\twidth: DiffEditorWidget.ONE_OVERVIEW_WIDTH,\n\t\t\t\tright: freeSpace + DiffEditorWidget.ONE_OVERVIEW_WIDTH,\n\t\t\t\theight: (height - reviewHeight)\n\t\t\t});\n\t\t\tthis._modifiedOverviewRuler.setLayout({\n\t\t\t\ttop: 0,\n\t\t\t\tright: 0,\n\t\t\t\twidth: DiffEditorWidget.ONE_OVERVIEW_WIDTH,\n\t\t\t\theight: (height - reviewHeight)\n\t\t\t});\n\t\t}\n\t}\n\n\t//------------ end layouting methods\n\n\tprivate _onViewZonesChanged(): void {\n\t\tif (this._currentlyChangingViewZones) {\n\t\t\treturn;\n\t\t}\n\t\tthis._updateDecorationsRunner.schedule();\n\t}\n\n\tprivate _beginUpdateDecorationsSoon(): void {\n\t\t// Clear previous timeout if necessary\n\t\tif (this._beginUpdateDecorationsTimeout !== -1) {\n\t\t\twindow.clearTimeout(this._beginUpdateDecorationsTimeout);\n\t\t\tthis._beginUpdateDecorationsTimeout = -1;\n\t\t}\n\t\tthis._beginUpdateDecorationsTimeout = window.setTimeout(() => this._beginUpdateDecorations(), DiffEditorWidget.UPDATE_DIFF_DECORATIONS_DELAY);\n\t}\n\n\tprivate _lastOriginalWarning: URI | null = null;\n\tprivate _lastModifiedWarning: URI | null = null;\n\n\tprivate static _equals(a: URI | null, b: URI | null): boolean {\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!a || !b) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (a.toString() === b.toString());\n\t}\n\n\tprivate _beginUpdateDecorations(): void {\n\t\tthis._beginUpdateDecorationsTimeout = -1;\n\t\tconst currentOriginalModel = this._originalEditor.getModel();\n\t\tconst currentModifiedModel = this._modifiedEditor.getModel();\n\t\tif (!currentOriginalModel || !currentModifiedModel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent old diff requests to come if a new request has been initiated\n\t\t// The best method would be to call cancel on the Promise, but this is not\n\t\t// yet supported, so using tokens for now.\n\t\tthis._diffComputationToken++;\n\t\tconst currentToken = this._diffComputationToken;\n\n\t\tconst diffLimit = this._options.maxFileSize * 1024 * 1024; // MB\n\t\tconst canSyncModelForDiff = (model: ITextModel): boolean => {\n\t\t\tconst bufferTextLength = model.getValueLength();\n\t\t\treturn (diffLimit === 0 || bufferTextLength <= diffLimit);\n\t\t};\n\n\t\tif (!canSyncModelForDiff(currentOriginalModel) || !canSyncModelForDiff(currentModifiedModel)) {\n\t\t\tif (\n\t\t\t\t!DiffEditorWidget._equals(currentOriginalModel.uri, this._lastOriginalWarning)\n\t\t\t\t|| !DiffEditorWidget._equals(currentModifiedModel.uri, this._lastModifiedWarning)\n\t\t\t) {\n\t\t\t\tthis._lastOriginalWarning = currentOriginalModel.uri;\n\t\t\t\tthis._lastModifiedWarning = currentModifiedModel.uri;\n\t\t\t\tthis._notificationService.warn(nls.localize(\"diff.tooLarge\", \"Cannot compare files because one file is too large.\"));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setState(editorBrowser.DiffEditorState.ComputingDiff);\n\t\tthis._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._options.ignoreTrimWhitespace, this._options.maxComputationTime).then((result) => {\n\t\t\tif (currentToken === this._diffComputationToken\n\t\t\t\t&& currentOriginalModel === this._originalEditor.getModel()\n\t\t\t\t&& currentModifiedModel === this._modifiedEditor.getModel()\n\t\t\t) {\n\t\t\t\tthis._setState(editorBrowser.DiffEditorState.DiffComputed);\n\t\t\t\tthis._diffComputationResult = result;\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t\tthis._onDidUpdateDiff.fire();\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tif (currentToken === this._diffComputationToken\n\t\t\t\t&& currentOriginalModel === this._originalEditor.getModel()\n\t\t\t\t&& currentModifiedModel === this._modifiedEditor.getModel()\n\t\t\t) {\n\t\t\t\tthis._setState(editorBrowser.DiffEditorState.DiffComputed);\n\t\t\t\tthis._diffComputationResult = null;\n\t\t\t\tthis._updateDecorationsRunner.schedule();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _cleanViewZonesAndDecorations(): void {\n\t\tthis._originalEditorState.clean(this._originalEditor);\n\t\tthis._modifiedEditorState.clean(this._modifiedEditor);\n\t}\n\n\tprivate _updateDecorations(): void {\n\t\tif (!this._originalEditor.getModel() || !this._modifiedEditor.getModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineChanges = (this._diffComputationResult ? this._diffComputationResult.changes : []);\n\n\t\tconst foreignOriginal = this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces());\n\t\tconst foreignModified = this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces());\n\n\t\tconst diffDecorations = this._strategy.getEditorsDiffDecorations(lineChanges, this._options.ignoreTrimWhitespace, this._options.renderIndicators, foreignOriginal, foreignModified);\n\n\t\ttry {\n\t\t\tthis._currentlyChangingViewZones = true;\n\t\t\tthis._originalEditorState.apply(this._originalEditor, this._originalOverviewRuler, diffDecorations.original, false);\n\t\t\tthis._modifiedEditorState.apply(this._modifiedEditor, this._modifiedOverviewRuler, diffDecorations.modified, true);\n\t\t} finally {\n\t\t\tthis._currentlyChangingViewZones = false;\n\t\t}\n\t}\n\n\tprivate _adjustOptionsForSubEditor(options: Readonly<editorBrowser.IDiffEditorConstructionOptions>): IEditorConstructionOptions {\n\t\tconst clonedOptions = { ...options };\n\t\tclonedOptions.inDiffEditor = true;\n\t\tclonedOptions.automaticLayout = false;\n\t\t// Clone scrollbar options before changing them\n\t\tclonedOptions.scrollbar = { ...(clonedOptions.scrollbar || {}) };\n\t\tclonedOptions.scrollbar.vertical = 'visible';\n\t\tclonedOptions.folding = false;\n\t\tclonedOptions.codeLens = this._options.diffCodeLens;\n\t\tclonedOptions.fixedOverflowWidgets = true;\n\t\t// clonedOptions.lineDecorationsWidth = '2ch';\n\t\t// Clone minimap options before changing them\n\t\tclonedOptions.minimap = { ...(clonedOptions.minimap || {}) };\n\t\tclonedOptions.minimap.enabled = false;\n\t\treturn clonedOptions;\n\t}\n\n\tprivate _adjustOptionsForLeftHandSide(options: Readonly<editorBrowser.IDiffEditorConstructionOptions>): IEditorConstructionOptions {\n\t\tconst result = this._adjustOptionsForSubEditor(options);\n\t\tif (!this._options.renderSideBySide) {\n\t\t\t// never wrap hidden editor\n\t\t\tresult.wordWrapOverride1 = 'off';\n\t\t\tresult.wordWrapOverride2 = 'off';\n\t\t} else {\n\t\t\tresult.wordWrapOverride1 = this._options.diffWordWrap;\n\t\t}\n\t\tif (options.originalAriaLabel) {\n\t\t\tresult.ariaLabel = options.originalAriaLabel;\n\t\t}\n\t\tresult.readOnly = !this._options.originalEditable;\n\t\tresult.extraEditorClassName = 'original-in-monaco-diff-editor';\n\t\treturn {\n\t\t\t...result,\n\t\t\tdimension: {\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _adjustOptionsForRightHandSide(options: Readonly<editorBrowser.IDiffEditorConstructionOptions>): IEditorConstructionOptions {\n\t\tconst result = this._adjustOptionsForSubEditor(options);\n\t\tif (options.modifiedAriaLabel) {\n\t\t\tresult.ariaLabel = options.modifiedAriaLabel;\n\t\t}\n\n\t\tresult.wordWrapOverride1 = this._options.diffWordWrap;\n\t\tresult.revealHorizontalRightPadding = EditorOptions.revealHorizontalRightPadding.defaultValue + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;\n\t\tresult.scrollbar!.verticalHasArrows = false;\n\t\tresult.extraEditorClassName = 'modified-in-monaco-diff-editor';\n\t\treturn {\n\t\t\t...result,\n\t\t\tdimension: {\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic doLayout(): void {\n\t\tthis._elementSizeObserver.observe();\n\t\tthis._doLayout();\n\t}\n\n\tprivate _doLayout(): void {\n\t\tconst width = this._elementSizeObserver.getWidth();\n\t\tconst height = this._elementSizeObserver.getHeight();\n\t\tconst reviewHeight = this._getReviewHeight();\n\n\t\tconst splitPoint = this._strategy.layout();\n\n\t\tthis._originalDomNode.style.width = splitPoint + 'px';\n\t\tthis._originalDomNode.style.left = '0px';\n\n\t\tthis._modifiedDomNode.style.width = (width - splitPoint) + 'px';\n\t\tthis._modifiedDomNode.style.left = splitPoint + 'px';\n\n\t\tthis._overviewDomElement.style.top = '0px';\n\t\tthis._overviewDomElement.style.height = (height - reviewHeight) + 'px';\n\t\tthis._overviewDomElement.style.width = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH + 'px';\n\t\tthis._overviewDomElement.style.left = (width - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH) + 'px';\n\t\tthis._overviewViewportDomElement.setWidth(DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH);\n\t\tthis._overviewViewportDomElement.setHeight(30);\n\n\t\tthis._originalEditor.layout({ width: splitPoint, height: (height - reviewHeight) });\n\t\tthis._modifiedEditor.layout({ width: width - splitPoint - (this._options.renderOverviewRuler ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0), height: (height - reviewHeight) });\n\n\t\tif (this._originalOverviewRuler || this._modifiedOverviewRuler) {\n\t\t\tthis._layoutOverviewRulers();\n\t\t}\n\n\t\tthis._reviewPane.layout(height - reviewHeight, width, reviewHeight);\n\n\t\tthis._layoutOverviewViewport();\n\t}\n\n\tprivate _layoutOverviewViewport(): void {\n\t\tconst layout = this._computeOverviewViewport();\n\t\tif (!layout) {\n\t\t\tthis._overviewViewportDomElement.setTop(0);\n\t\t\tthis._overviewViewportDomElement.setHeight(0);\n\t\t} else {\n\t\t\tthis._overviewViewportDomElement.setTop(layout.top);\n\t\t\tthis._overviewViewportDomElement.setHeight(layout.height);\n\t\t}\n\t}\n\n\tprivate _computeOverviewViewport(): { height: number; top: number } | null {\n\t\tconst layoutInfo = this._modifiedEditor.getLayoutInfo();\n\t\tif (!layoutInfo) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst scrollTop = this._modifiedEditor.getScrollTop();\n\t\tconst scrollHeight = this._modifiedEditor.getScrollHeight();\n\n\t\tconst computedAvailableSize = Math.max(0, layoutInfo.height);\n\t\tconst computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);\n\t\tconst computedRatio = scrollHeight > 0 ? (computedRepresentableSize / scrollHeight) : 0;\n\n\t\tconst computedSliderSize = Math.max(0, Math.floor(layoutInfo.height * computedRatio));\n\t\tconst computedSliderPosition = Math.floor(scrollTop * computedRatio);\n\n\t\treturn {\n\t\t\theight: computedSliderSize,\n\t\t\ttop: computedSliderPosition\n\t\t};\n\t}\n\n\tprivate _createDataSource(): IDataSource {\n\t\treturn {\n\t\t\tgetWidth: () => {\n\t\t\t\treturn this._elementSizeObserver.getWidth();\n\t\t\t},\n\n\t\t\tgetHeight: () => {\n\t\t\t\treturn (this._elementSizeObserver.getHeight() - this._getReviewHeight());\n\t\t\t},\n\n\t\t\tgetOptions: () => {\n\t\t\t\treturn {\n\t\t\t\t\trenderOverviewRuler: this._options.renderOverviewRuler\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tgetContainerDomNode: () => {\n\t\t\t\treturn this._containerDomElement;\n\t\t\t},\n\n\t\t\trelayoutEditors: () => {\n\t\t\t\tthis._doLayout();\n\t\t\t},\n\n\t\t\tgetOriginalEditor: () => {\n\t\t\t\treturn this._originalEditor;\n\t\t\t},\n\n\t\t\tgetModifiedEditor: () => {\n\t\t\t\treturn this._modifiedEditor;\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _setStrategy(newStrategy: DiffEditorWidgetStyle): void {\n\t\tif (this._strategy) {\n\t\t\tthis._strategy.dispose();\n\t\t}\n\n\t\tthis._strategy = newStrategy;\n\t\tnewStrategy.applyColors(this._themeService.getColorTheme());\n\n\t\tif (this._diffComputationResult) {\n\t\t\tthis._updateDecorations();\n\t\t}\n\n\t\t// Just do a layout, the strategy might need it\n\t\tthis._doLayout();\n\t}\n\n\tprivate _getLineChangeAtOrBeforeLineNumber(lineNumber: number, startLineNumberExtractor: (lineChange: ILineChange) => number): ILineChange | null {\n\t\tconst lineChanges = (this._diffComputationResult ? this._diffComputationResult.changes : []);\n\t\tif (lineChanges.length === 0 || lineNumber < startLineNumberExtractor(lineChanges[0])) {\n\t\t\t// There are no changes or `lineNumber` is before the first change\n\t\t\treturn null;\n\t\t}\n\n\t\tlet min = 0;\n\t\tlet max = lineChanges.length - 1;\n\t\twhile (min < max) {\n\t\t\tconst mid = Math.floor((min + max) / 2);\n\t\t\tconst midStart = startLineNumberExtractor(lineChanges[mid]);\n\t\t\tconst midEnd = (mid + 1 <= max ? startLineNumberExtractor(lineChanges[mid + 1]) : Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\t\tif (lineNumber < midStart) {\n\t\t\t\tmax = mid - 1;\n\t\t\t} else if (lineNumber >= midEnd) {\n\t\t\t\tmin = mid + 1;\n\t\t\t} else {\n\t\t\t\t// HIT!\n\t\t\t\tmin = mid;\n\t\t\t\tmax = mid;\n\t\t\t}\n\t\t}\n\t\treturn lineChanges[min];\n\t}\n\n\tprivate _getEquivalentLineForOriginalLineNumber(lineNumber: number): number {\n\t\tconst lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.originalStartLineNumber);\n\n\t\tif (!lineChange) {\n\t\t\treturn lineNumber;\n\t\t}\n\n\t\tconst originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0);\n\t\tconst modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0);\n\t\tconst lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0);\n\t\tconst lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0);\n\n\n\t\tconst delta = lineNumber - originalEquivalentLineNumber;\n\n\t\tif (delta <= lineChangeOriginalLength) {\n\t\t\treturn modifiedEquivalentLineNumber + Math.min(delta, lineChangeModifiedLength);\n\t\t}\n\n\t\treturn modifiedEquivalentLineNumber + lineChangeModifiedLength - lineChangeOriginalLength + delta;\n\t}\n\n\tprivate _getEquivalentLineForModifiedLineNumber(lineNumber: number): number {\n\t\tconst lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.modifiedStartLineNumber);\n\n\t\tif (!lineChange) {\n\t\t\treturn lineNumber;\n\t\t}\n\n\t\tconst originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0);\n\t\tconst modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0);\n\t\tconst lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0);\n\t\tconst lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0);\n\n\n\t\tconst delta = lineNumber - modifiedEquivalentLineNumber;\n\n\t\tif (delta <= lineChangeModifiedLength) {\n\t\t\treturn originalEquivalentLineNumber + Math.min(delta, lineChangeOriginalLength);\n\t\t}\n\n\t\treturn originalEquivalentLineNumber + lineChangeOriginalLength - lineChangeModifiedLength + delta;\n\t}\n\n\tpublic getDiffLineInformationForOriginal(lineNumber: number): editorBrowser.IDiffLineInformation | null {\n\t\tif (!this._diffComputationResult) {\n\t\t\t// Cannot answer that which I don't know\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tequivalentLineNumber: this._getEquivalentLineForOriginalLineNumber(lineNumber)\n\t\t};\n\t}\n\n\tpublic getDiffLineInformationForModified(lineNumber: number): editorBrowser.IDiffLineInformation | null {\n\t\tif (!this._diffComputationResult) {\n\t\t\t// Cannot answer that which I don't know\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tequivalentLineNumber: this._getEquivalentLineForModifiedLineNumber(lineNumber)\n\t\t};\n\t}\n}\n\ninterface IDataSource {\n\tgetWidth(): number;\n\tgetHeight(): number;\n\tgetOptions(): { renderOverviewRuler: boolean };\n\tgetContainerDomNode(): HTMLElement;\n\trelayoutEditors(): void;\n\n\tgetOriginalEditor(): CodeEditorWidget;\n\tgetModifiedEditor(): CodeEditorWidget;\n}\n\nabstract class DiffEditorWidgetStyle extends Disposable {\n\n\tprotected _dataSource: IDataSource;\n\tprotected _insertColor: Color | null;\n\tprotected _removeColor: Color | null;\n\n\tconstructor(dataSource: IDataSource) {\n\t\tsuper();\n\t\tthis._dataSource = dataSource;\n\t\tthis._insertColor = null;\n\t\tthis._removeColor = null;\n\t}\n\n\tpublic applyColors(theme: IColorTheme): boolean {\n\t\tconst newInsertColor = theme.getColor(diffOverviewRulerInserted) || (theme.getColor(diffInserted) || defaultInsertColor).transparent(2);\n\t\tconst newRemoveColor = theme.getColor(diffOverviewRulerRemoved) || (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2);\n\t\tconst hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);\n\t\tthis._insertColor = newInsertColor;\n\t\tthis._removeColor = newRemoveColor;\n\t\treturn hasChanges;\n\t}\n\n\tpublic getEditorsDiffDecorations(lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalWhitespaces: IEditorWhitespace[], modifiedWhitespaces: IEditorWhitespace[]): IEditorsDiffDecorationsWithZones {\n\t\t// Get view zones\n\t\tmodifiedWhitespaces = modifiedWhitespaces.sort((a, b) => {\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t});\n\t\toriginalWhitespaces = originalWhitespaces.sort((a, b) => {\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t});\n\t\tconst zones = this._getViewZones(lineChanges, originalWhitespaces, modifiedWhitespaces, renderIndicators);\n\n\t\t// Get decorations & overview ruler zones\n\t\tconst originalDecorations = this._getOriginalEditorDecorations(zones, lineChanges, ignoreTrimWhitespace, renderIndicators);\n\t\tconst modifiedDecorations = this._getModifiedEditorDecorations(zones, lineChanges, ignoreTrimWhitespace, renderIndicators);\n\n\t\treturn {\n\t\t\toriginal: {\n\t\t\t\tdecorations: originalDecorations.decorations,\n\t\t\t\toverviewZones: originalDecorations.overviewZones,\n\t\t\t\tzones: zones.original\n\t\t\t},\n\t\t\tmodified: {\n\t\t\t\tdecorations: modifiedDecorations.decorations,\n\t\t\t\toverviewZones: modifiedDecorations.overviewZones,\n\t\t\t\tzones: zones.modified\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected abstract _getViewZones(lineChanges: ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], renderIndicators: boolean): IEditorsZones;\n\tprotected abstract _getOriginalEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations;\n\tprotected abstract _getModifiedEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations;\n\n\tpublic abstract setEnableSplitViewResizing(enableSplitViewResizing: boolean): void;\n\tpublic abstract layout(): number;\n}\n\ninterface IMyViewZone {\n\tshouldNotShrink?: boolean;\n\tafterLineNumber: number;\n\tafterColumn?: number;\n\theightInLines: number;\n\tdomNode: HTMLElement | null;\n\tmarginDomNode?: HTMLElement | null;\n\tdiff?: IDiffLinesChange;\n}\n\nclass ForeignViewZonesIterator {\n\n\tprivate _index: number;\n\tprivate readonly _source: IEditorWhitespace[];\n\tpublic current: IEditorWhitespace | null;\n\n\tconstructor(source: IEditorWhitespace[]) {\n\t\tthis._source = source;\n\t\tthis._index = -1;\n\t\tthis.current = null;\n\t\tthis.advance();\n\t}\n\n\tpublic advance(): void {\n\t\tthis._index++;\n\t\tif (this._index < this._source.length) {\n\t\t\tthis.current = this._source[this._index];\n\t\t} else {\n\t\t\tthis.current = null;\n\t\t}\n\t}\n}\n\nabstract class ViewZonesComputer {\n\n\tconstructor(\n\t\tprivate readonly _lineChanges: ILineChange[],\n\t\tprivate readonly _originalForeignVZ: IEditorWhitespace[],\n\t\tprivate readonly _modifiedForeignVZ: IEditorWhitespace[],\n\t\tprotected readonly _originalEditor: CodeEditorWidget,\n\t\tprotected readonly _modifiedEditor: CodeEditorWidget\n\t) {\n\t}\n\n\tprivate static _getViewLineCount(editor: CodeEditorWidget, startLineNumber: number, endLineNumber: number): number {\n\t\tconst model = editor.getModel();\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (model && viewModel) {\n\t\t\tconst viewRange = getViewRange(model, viewModel, startLineNumber, endLineNumber);\n\t\t\treturn (viewRange.endLineNumber - viewRange.startLineNumber + 1);\n\t\t}\n\n\t\treturn (endLineNumber - startLineNumber + 1);\n\t}\n\n\tpublic getViewZones(): IEditorsZones {\n\t\tconst originalLineHeight = this._originalEditor.getOption(EditorOption.lineHeight);\n\t\tconst modifiedLineHeight = this._modifiedEditor.getOption(EditorOption.lineHeight);\n\t\tconst originalHasWrapping = (this._originalEditor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1);\n\t\tconst modifiedHasWrapping = (this._modifiedEditor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1);\n\t\tconst hasWrapping = (originalHasWrapping || modifiedHasWrapping);\n\t\tconst originalModel = this._originalEditor.getModel()!;\n\t\tconst originalCoordinatesConverter = this._originalEditor._getViewModel()!.coordinatesConverter;\n\t\tconst modifiedCoordinatesConverter = this._modifiedEditor._getViewModel()!.coordinatesConverter;\n\n\t\tconst result: { original: IMyViewZone[]; modified: IMyViewZone[] } = {\n\t\t\toriginal: [],\n\t\t\tmodified: []\n\t\t};\n\n\t\tlet lineChangeModifiedLength: number = 0;\n\t\tlet lineChangeOriginalLength: number = 0;\n\t\tlet originalEquivalentLineNumber: number = 0;\n\t\tlet modifiedEquivalentLineNumber: number = 0;\n\t\tlet originalEndEquivalentLineNumber: number = 0;\n\t\tlet modifiedEndEquivalentLineNumber: number = 0;\n\n\t\tconst sortMyViewZones = (a: IMyViewZone, b: IMyViewZone) => {\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t};\n\n\t\tconst addAndCombineIfPossible = (destination: IMyViewZone[], item: IMyViewZone) => {\n\t\t\tif (item.domNode === null && destination.length > 0) {\n\t\t\t\tconst lastItem = destination[destination.length - 1];\n\t\t\t\tif (lastItem.afterLineNumber === item.afterLineNumber && lastItem.domNode === null) {\n\t\t\t\t\tlastItem.heightInLines += item.heightInLines;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdestination.push(item);\n\t\t};\n\n\t\tconst modifiedForeignVZ = new ForeignViewZonesIterator(this._modifiedForeignVZ);\n\t\tconst originalForeignVZ = new ForeignViewZonesIterator(this._originalForeignVZ);\n\n\t\tlet lastOriginalLineNumber = 1;\n\t\tlet lastModifiedLineNumber = 1;\n\n\t\t// In order to include foreign view zones after the last line change, the for loop will iterate once more after the end of the `lineChanges` array\n\t\tfor (let i = 0, length = this._lineChanges.length; i <= length; i++) {\n\t\t\tconst lineChange = (i < length ? this._lineChanges[i] : null);\n\n\t\t\tif (lineChange !== null) {\n\t\t\t\toriginalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0);\n\t\t\t\tmodifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0);\n\t\t\t\tlineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? ViewZonesComputer._getViewLineCount(this._originalEditor, lineChange.originalStartLineNumber, lineChange.originalEndLineNumber) : 0);\n\t\t\t\tlineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? ViewZonesComputer._getViewLineCount(this._modifiedEditor, lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber) : 0);\n\t\t\t\toriginalEndEquivalentLineNumber = Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber);\n\t\t\t\tmodifiedEndEquivalentLineNumber = Math.max(lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber);\n\t\t\t} else {\n\t\t\t\t// Increase to very large value to get the producing tests of foreign view zones running\n\t\t\t\toriginalEquivalentLineNumber += 10000000 + lineChangeOriginalLength;\n\t\t\t\tmodifiedEquivalentLineNumber += 10000000 + lineChangeModifiedLength;\n\t\t\t\toriginalEndEquivalentLineNumber = originalEquivalentLineNumber;\n\t\t\t\tmodifiedEndEquivalentLineNumber = modifiedEquivalentLineNumber;\n\t\t\t}\n\n\t\t\t// Each step produces view zones, and after producing them, we try to cancel them out, to avoid empty-empty view zone cases\n\t\t\tlet stepOriginal: IMyViewZone[] = [];\n\t\t\tlet stepModified: IMyViewZone[] = [];\n\n\t\t\t// ---------------------------- PRODUCE VIEW ZONES\n\n\t\t\t// [PRODUCE] View zones due to line mapping differences (equal lines but wrapped differently)\n\t\t\tif (hasWrapping) {\n\t\t\t\tlet count: number;\n\t\t\t\tif (lineChange) {\n\t\t\t\t\tif (lineChange.originalEndLineNumber > 0) {\n\t\t\t\t\t\tcount = lineChange.originalStartLineNumber - lastOriginalLineNumber;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcount = lineChange.modifiedStartLineNumber - lastModifiedLineNumber;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// `lastOriginalLineNumber` has not been looked at yet\n\t\t\t\t\tcount = originalModel.getLineCount() - lastOriginalLineNumber + 1;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\tconst originalLineNumber = lastOriginalLineNumber + i;\n\t\t\t\t\tconst modifiedLineNumber = lastModifiedLineNumber + i;\n\n\t\t\t\t\tconst originalViewLineCount = originalCoordinatesConverter.getModelLineViewLineCount(originalLineNumber);\n\t\t\t\t\tconst modifiedViewLineCount = modifiedCoordinatesConverter.getModelLineViewLineCount(modifiedLineNumber);\n\n\t\t\t\t\tif (originalViewLineCount < modifiedViewLineCount) {\n\t\t\t\t\t\tstepOriginal.push({\n\t\t\t\t\t\t\tafterLineNumber: originalLineNumber,\n\t\t\t\t\t\t\theightInLines: modifiedViewLineCount - originalViewLineCount,\n\t\t\t\t\t\t\tdomNode: null,\n\t\t\t\t\t\t\tmarginDomNode: null\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (originalViewLineCount > modifiedViewLineCount) {\n\t\t\t\t\t\tstepModified.push({\n\t\t\t\t\t\t\tafterLineNumber: modifiedLineNumber,\n\t\t\t\t\t\t\theightInLines: originalViewLineCount - modifiedViewLineCount,\n\t\t\t\t\t\t\tdomNode: null,\n\t\t\t\t\t\t\tmarginDomNode: null\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lineChange) {\n\t\t\t\t\tlastOriginalLineNumber = (lineChange.originalEndLineNumber > 0 ? lineChange.originalEndLineNumber : lineChange.originalStartLineNumber) + 1;\n\t\t\t\t\tlastModifiedLineNumber = (lineChange.modifiedEndLineNumber > 0 ? lineChange.modifiedEndLineNumber : lineChange.modifiedStartLineNumber) + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// [PRODUCE] View zone(s) in original-side due to foreign view zone(s) in modified-side\n\t\t\twhile (modifiedForeignVZ.current && modifiedForeignVZ.current.afterLineNumber <= modifiedEndEquivalentLineNumber) {\n\t\t\t\tlet viewZoneLineNumber: number;\n\t\t\t\tif (modifiedForeignVZ.current.afterLineNumber <= modifiedEquivalentLineNumber) {\n\t\t\t\t\tviewZoneLineNumber = originalEquivalentLineNumber - modifiedEquivalentLineNumber + modifiedForeignVZ.current.afterLineNumber;\n\t\t\t\t} else {\n\t\t\t\t\tviewZoneLineNumber = originalEndEquivalentLineNumber;\n\t\t\t\t}\n\n\t\t\t\tlet marginDomNode: HTMLDivElement | null = null;\n\t\t\t\tif (lineChange && lineChange.modifiedStartLineNumber <= modifiedForeignVZ.current.afterLineNumber && modifiedForeignVZ.current.afterLineNumber <= lineChange.modifiedEndLineNumber) {\n\t\t\t\t\tmarginDomNode = this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion();\n\t\t\t\t}\n\n\t\t\t\tstepOriginal.push({\n\t\t\t\t\tafterLineNumber: viewZoneLineNumber,\n\t\t\t\t\theightInLines: modifiedForeignVZ.current.height / modifiedLineHeight,\n\t\t\t\t\tdomNode: null,\n\t\t\t\t\tmarginDomNode: marginDomNode\n\t\t\t\t});\n\t\t\t\tmodifiedForeignVZ.advance();\n\t\t\t}\n\n\t\t\t// [PRODUCE] View zone(s) in modified-side due to foreign view zone(s) in original-side\n\t\t\twhile (originalForeignVZ.current && originalForeignVZ.current.afterLineNumber <= originalEndEquivalentLineNumber) {\n\t\t\t\tlet viewZoneLineNumber: number;\n\t\t\t\tif (originalForeignVZ.current.afterLineNumber <= originalEquivalentLineNumber) {\n\t\t\t\t\tviewZoneLineNumber = modifiedEquivalentLineNumber - originalEquivalentLineNumber + originalForeignVZ.current.afterLineNumber;\n\t\t\t\t} else {\n\t\t\t\t\tviewZoneLineNumber = modifiedEndEquivalentLineNumber;\n\t\t\t\t}\n\t\t\t\tstepModified.push({\n\t\t\t\t\tafterLineNumber: viewZoneLineNumber,\n\t\t\t\t\theightInLines: originalForeignVZ.current.height / originalLineHeight,\n\t\t\t\t\tdomNode: null\n\t\t\t\t});\n\t\t\t\toriginalForeignVZ.advance();\n\t\t\t}\n\n\t\t\tif (lineChange !== null && isChangeOrInsert(lineChange)) {\n\t\t\t\tconst r = this._produceOriginalFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength);\n\t\t\t\tif (r) {\n\t\t\t\t\tstepOriginal.push(r);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lineChange !== null && isChangeOrDelete(lineChange)) {\n\t\t\t\tconst r = this._produceModifiedFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength);\n\t\t\t\tif (r) {\n\t\t\t\t\tstepModified.push(r);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ---------------------------- END PRODUCE VIEW ZONES\n\n\n\t\t\t// ---------------------------- EMIT MINIMAL VIEW ZONES\n\n\t\t\t// [CANCEL & EMIT] Try to cancel view zones out\n\t\t\tlet stepOriginalIndex = 0;\n\t\t\tlet stepModifiedIndex = 0;\n\n\t\t\tstepOriginal = stepOriginal.sort(sortMyViewZones);\n\t\t\tstepModified = stepModified.sort(sortMyViewZones);\n\n\t\t\twhile (stepOriginalIndex < stepOriginal.length && stepModifiedIndex < stepModified.length) {\n\t\t\t\tconst original = stepOriginal[stepOriginalIndex];\n\t\t\t\tconst modified = stepModified[stepModifiedIndex];\n\n\t\t\t\tconst originalDelta = original.afterLineNumber - originalEquivalentLineNumber;\n\t\t\t\tconst modifiedDelta = modified.afterLineNumber - modifiedEquivalentLineNumber;\n\n\t\t\t\tif (originalDelta < modifiedDelta) {\n\t\t\t\t\taddAndCombineIfPossible(result.original, original);\n\t\t\t\t\tstepOriginalIndex++;\n\t\t\t\t} else if (modifiedDelta < originalDelta) {\n\t\t\t\t\taddAndCombineIfPossible(result.modified, modified);\n\t\t\t\t\tstepModifiedIndex++;\n\t\t\t\t} else if (original.shouldNotShrink) {\n\t\t\t\t\taddAndCombineIfPossible(result.original, original);\n\t\t\t\t\tstepOriginalIndex++;\n\t\t\t\t} else if (modified.shouldNotShrink) {\n\t\t\t\t\taddAndCombineIfPossible(result.modified, modified);\n\t\t\t\t\tstepModifiedIndex++;\n\t\t\t\t} else {\n\t\t\t\t\tif (original.heightInLines >= modified.heightInLines) {\n\t\t\t\t\t\t// modified view zone gets removed\n\t\t\t\t\t\toriginal.heightInLines -= modified.heightInLines;\n\t\t\t\t\t\tstepModifiedIndex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// original view zone gets removed\n\t\t\t\t\t\tmodified.heightInLines -= original.heightInLines;\n\t\t\t\t\t\tstepOriginalIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// [EMIT] Remaining original view zones\n\t\t\twhile (stepOriginalIndex < stepOriginal.length) {\n\t\t\t\taddAndCombineIfPossible(result.original, stepOriginal[stepOriginalIndex]);\n\t\t\t\tstepOriginalIndex++;\n\t\t\t}\n\n\t\t\t// [EMIT] Remaining modified view zones\n\t\t\twhile (stepModifiedIndex < stepModified.length) {\n\t\t\t\taddAndCombineIfPossible(result.modified, stepModified[stepModifiedIndex]);\n\t\t\t\tstepModifiedIndex++;\n\t\t\t}\n\n\t\t\t// ---------------------------- END EMIT MINIMAL VIEW ZONES\n\t\t}\n\n\t\treturn {\n\t\t\toriginal: ViewZonesComputer._ensureDomNodes(result.original),\n\t\t\tmodified: ViewZonesComputer._ensureDomNodes(result.modified),\n\t\t};\n\t}\n\n\tprivate static _ensureDomNodes(zones: IMyViewZone[]): IMyViewZone[] {\n\t\treturn zones.map((z) => {\n\t\t\tif (!z.domNode) {\n\t\t\t\tz.domNode = createFakeLinesDiv();\n\t\t\t}\n\t\t\treturn z;\n\t\t});\n\t}\n\n\tprotected abstract _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null;\n\n\tprotected abstract _produceOriginalFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null;\n\n\tprotected abstract _produceModifiedFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null;\n}\n\nfunction createDecoration(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, options: ModelDecorationOptions) {\n\treturn {\n\t\trange: new Range(startLineNumber, startColumn, endLineNumber, endColumn),\n\t\toptions: options\n\t};\n}\n\nconst DECORATIONS = {\n\n\tcharDelete: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-char-delete',\n\t\tclassName: 'char-delete'\n\t}),\n\tcharDeleteWholeLine: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-char-delete-whole-line',\n\t\tclassName: 'char-delete',\n\t\tisWholeLine: true\n\t}),\n\n\tcharInsert: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-char-insert',\n\t\tclassName: 'char-insert'\n\t}),\n\tcharInsertWholeLine: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-char-insert-whole-line',\n\t\tclassName: 'char-insert',\n\t\tisWholeLine: true\n\t}),\n\n\tlineInsert: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-line-insert',\n\t\tclassName: 'line-insert',\n\t\tmarginClassName: 'gutter-insert',\n\t\tisWholeLine: true\n\t}),\n\tlineInsertWithSign: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-line-insert-with-sign',\n\t\tclassName: 'line-insert',\n\t\tlinesDecorationsClassName: 'insert-sign ' + ThemeIcon.asClassName(diffInsertIcon),\n\t\tmarginClassName: 'gutter-insert',\n\t\tisWholeLine: true\n\t}),\n\n\tlineDelete: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-line-delete',\n\t\tclassName: 'line-delete',\n\t\tmarginClassName: 'gutter-delete',\n\t\tisWholeLine: true\n\t}),\n\tlineDeleteWithSign: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-line-delete-with-sign',\n\t\tclassName: 'line-delete',\n\t\tlinesDecorationsClassName: 'delete-sign ' + ThemeIcon.asClassName(diffRemoveIcon),\n\t\tmarginClassName: 'gutter-delete',\n\t\tisWholeLine: true\n\n\t}),\n\tlineDeleteMargin: ModelDecorationOptions.register({\n\t\tdescription: 'diff-editor-line-delete-margin',\n\t\tmarginClassName: 'gutter-delete',\n\t})\n\n};\n\nclass DiffEditorWidgetSideBySide extends DiffEditorWidgetStyle implements IVerticalSashLayoutProvider {\n\n\tstatic readonly MINIMUM_EDITOR_WIDTH = 100;\n\n\tprivate _disableSash: boolean;\n\tprivate readonly _sash: Sash;\n\tprivate _sashRatio: number | null;\n\tprivate _sashPosition: number | null;\n\tprivate _startSashPosition: number | null;\n\n\tconstructor(dataSource: IDataSource, enableSplitViewResizing: boolean) {\n\t\tsuper(dataSource);\n\n\t\tthis._disableSash = (enableSplitViewResizing === false);\n\t\tthis._sashRatio = null;\n\t\tthis._sashPosition = null;\n\t\tthis._startSashPosition = null;\n\t\tthis._sash = this._register(new Sash(this._dataSource.getContainerDomNode(), this, { orientation: Orientation.VERTICAL }));\n\n\t\tif (this._disableSash) {\n\t\t\tthis._sash.state = SashState.Disabled;\n\t\t}\n\n\t\tthis._sash.onDidStart(() => this._onSashDragStart());\n\t\tthis._sash.onDidChange((e: ISashEvent) => this._onSashDrag(e));\n\t\tthis._sash.onDidEnd(() => this._onSashDragEnd());\n\t\tthis._sash.onDidReset(() => this._onSashReset());\n\t}\n\n\tpublic setEnableSplitViewResizing(enableSplitViewResizing: boolean): void {\n\t\tconst newDisableSash = (enableSplitViewResizing === false);\n\t\tif (this._disableSash !== newDisableSash) {\n\t\t\tthis._disableSash = newDisableSash;\n\t\t\tthis._sash.state = this._disableSash ? SashState.Disabled : SashState.Enabled;\n\t\t}\n\t}\n\n\tpublic layout(sashRatio: number | null = this._sashRatio): number {\n\t\tconst w = this._dataSource.getWidth();\n\t\tconst contentWidth = w - (this._dataSource.getOptions().renderOverviewRuler ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0);\n\n\t\tlet sashPosition = Math.floor((sashRatio || 0.5) * contentWidth);\n\t\tconst midPoint = Math.floor(0.5 * contentWidth);\n\n\t\tsashPosition = this._disableSash ? midPoint : sashPosition || midPoint;\n\n\t\tif (contentWidth > DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH * 2) {\n\t\t\tif (sashPosition < DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) {\n\t\t\t\tsashPosition = DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH;\n\t\t\t}\n\n\t\t\tif (sashPosition > contentWidth - DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) {\n\t\t\t\tsashPosition = contentWidth - DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH;\n\t\t\t}\n\t\t} else {\n\t\t\tsashPosition = midPoint;\n\t\t}\n\n\t\tif (this._sashPosition !== sashPosition) {\n\t\t\tthis._sashPosition = sashPosition;\n\t\t}\n\t\tthis._sash.layout();\n\n\t\treturn this._sashPosition;\n\t}\n\n\tprivate _onSashDragStart(): void {\n\t\tthis._startSashPosition = this._sashPosition!;\n\t}\n\n\tprivate _onSashDrag(e: ISashEvent): void {\n\t\tconst w = this._dataSource.getWidth();\n\t\tconst contentWidth = w - (this._dataSource.getOptions().renderOverviewRuler ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0);\n\t\tconst sashPosition = this.layout((this._startSashPosition! + (e.currentX - e.startX)) / contentWidth);\n\n\t\tthis._sashRatio = sashPosition / contentWidth;\n\n\t\tthis._dataSource.relayoutEditors();\n\t}\n\n\tprivate _onSashDragEnd(): void {\n\t\tthis._sash.layout();\n\t}\n\n\tprivate _onSashReset(): void {\n\t\tthis._sashRatio = 0.5;\n\t\tthis._dataSource.relayoutEditors();\n\t\tthis._sash.layout();\n\t}\n\n\tpublic getVerticalSashTop(sash: Sash): number {\n\t\treturn 0;\n\t}\n\n\tpublic getVerticalSashLeft(sash: Sash): number {\n\t\treturn this._sashPosition!;\n\t}\n\n\tpublic getVerticalSashHeight(sash: Sash): number {\n\t\treturn this._dataSource.getHeight();\n\t}\n\n\tprotected _getViewZones(lineChanges: ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[]): IEditorsZones {\n\t\tconst originalEditor = this._dataSource.getOriginalEditor();\n\t\tconst modifiedEditor = this._dataSource.getModifiedEditor();\n\t\tconst c = new SideBySideViewZonesComputer(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor);\n\t\treturn c.getViewZones();\n\t}\n\n\tprotected _getOriginalEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations {\n\t\tconst originalEditor = this._dataSource.getOriginalEditor();\n\t\tconst overviewZoneColor = String(this._removeColor);\n\n\t\tconst result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tconst originalModel = originalEditor.getModel()!;\n\t\tconst originalViewModel = originalEditor._getViewModel()!;\n\n\t\tfor (const lineChange of lineChanges) {\n\n\t\t\tif (isChangeOrDelete(lineChange)) {\n\t\t\t\tresult.decorations.push({\n\t\t\t\t\trange: new Range(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\t\t\toptions: (renderIndicators ? DECORATIONS.lineDeleteWithSign : DECORATIONS.lineDelete)\n\t\t\t\t});\n\t\t\t\tif (!isChangeOrInsert(lineChange) || !lineChange.charChanges) {\n\t\t\t\t\tresult.decorations.push(createDecoration(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER, DECORATIONS.charDeleteWholeLine));\n\t\t\t\t}\n\n\t\t\t\tconst viewRange = getViewRange(originalModel, originalViewModel, lineChange.originalStartLineNumber, lineChange.originalEndLineNumber);\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(viewRange.startLineNumber, viewRange.endLineNumber, /*use endLineNumber*/0, overviewZoneColor));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (const charChange of lineChange.charChanges) {\n\t\t\t\t\t\tif (isChangeOrDelete(charChange)) {\n\t\t\t\t\t\t\tif (ignoreTrimWhitespace) {\n\t\t\t\t\t\t\t\tfor (let lineNumber = charChange.originalStartLineNumber; lineNumber <= charChange.originalEndLineNumber; lineNumber++) {\n\t\t\t\t\t\t\t\t\tlet startColumn: number;\n\t\t\t\t\t\t\t\t\tlet endColumn: number;\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.originalStartLineNumber) {\n\t\t\t\t\t\t\t\t\t\tstartColumn = charChange.originalStartColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstartColumn = originalModel.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.originalEndLineNumber) {\n\t\t\t\t\t\t\t\t\t\tendColumn = charChange.originalEndColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tendColumn = originalModel.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charDelete));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn, DECORATIONS.charDelete));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected _getModifiedEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations {\n\t\tconst modifiedEditor = this._dataSource.getModifiedEditor();\n\t\tconst overviewZoneColor = String(this._insertColor);\n\n\t\tconst result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tconst modifiedModel = modifiedEditor.getModel()!;\n\t\tconst modifiedViewModel = modifiedEditor._getViewModel()!;\n\n\t\tfor (const lineChange of lineChanges) {\n\n\t\t\tif (isChangeOrInsert(lineChange)) {\n\n\t\t\t\tresult.decorations.push({\n\t\t\t\t\trange: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\t\t\toptions: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert)\n\t\t\t\t});\n\t\t\t\tif (!isChangeOrDelete(lineChange) || !lineChange.charChanges) {\n\t\t\t\t\tresult.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER, DECORATIONS.charInsertWholeLine));\n\t\t\t\t}\n\n\t\t\t\tconst viewRange = getViewRange(modifiedModel, modifiedViewModel, lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber);\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(viewRange.startLineNumber, viewRange.endLineNumber,/*use endLineNumber*/0, overviewZoneColor));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (const charChange of lineChange.charChanges) {\n\t\t\t\t\t\tif (isChangeOrInsert(charChange)) {\n\t\t\t\t\t\t\tif (ignoreTrimWhitespace) {\n\t\t\t\t\t\t\t\tfor (let lineNumber = charChange.modifiedStartLineNumber; lineNumber <= charChange.modifiedEndLineNumber; lineNumber++) {\n\t\t\t\t\t\t\t\t\tlet startColumn: number;\n\t\t\t\t\t\t\t\t\tlet endColumn: number;\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.modifiedStartLineNumber) {\n\t\t\t\t\t\t\t\t\t\tstartColumn = charChange.modifiedStartColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstartColumn = modifiedModel.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.modifiedEndLineNumber) {\n\t\t\t\t\t\t\t\t\t\tendColumn = charChange.modifiedEndColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tendColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\nclass SideBySideViewZonesComputer extends ViewZonesComputer {\n\n\tconstructor(\n\t\tlineChanges: ILineChange[],\n\t\toriginalForeignVZ: IEditorWhitespace[],\n\t\tmodifiedForeignVZ: IEditorWhitespace[],\n\t\toriginalEditor: CodeEditorWidget,\n\t\tmodifiedEditor: CodeEditorWidget,\n\t) {\n\t\tsuper(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor);\n\t}\n\n\tprotected _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null {\n\t\treturn null;\n\t}\n\n\tprotected _produceOriginalFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tif (lineChangeModifiedLength > lineChangeOriginalLength) {\n\t\t\treturn {\n\t\t\t\tafterLineNumber: Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber),\n\t\t\t\theightInLines: (lineChangeModifiedLength - lineChangeOriginalLength),\n\t\t\t\tdomNode: null\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected _produceModifiedFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tif (lineChangeOriginalLength > lineChangeModifiedLength) {\n\t\t\treturn {\n\t\t\t\tafterLineNumber: Math.max(lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber),\n\t\t\t\theightInLines: (lineChangeOriginalLength - lineChangeModifiedLength),\n\t\t\t\tdomNode: null\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n}\n\nclass DiffEditorWidgetInline extends DiffEditorWidgetStyle {\n\n\tprivate _decorationsLeft: number;\n\n\tconstructor(dataSource: IDataSource, enableSplitViewResizing: boolean) {\n\t\tsuper(dataSource);\n\n\t\tthis._decorationsLeft = dataSource.getOriginalEditor().getLayoutInfo().decorationsLeft;\n\n\t\tthis._register(dataSource.getOriginalEditor().onDidLayoutChange((layoutInfo: EditorLayoutInfo) => {\n\t\t\tif (this._decorationsLeft !== layoutInfo.decorationsLeft) {\n\t\t\t\tthis._decorationsLeft = layoutInfo.decorationsLeft;\n\t\t\t\tdataSource.relayoutEditors();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic setEnableSplitViewResizing(enableSplitViewResizing: boolean): void {\n\t\t// Nothing to do..\n\t}\n\n\tprotected _getViewZones(lineChanges: ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], renderIndicators: boolean): IEditorsZones {\n\t\tconst originalEditor = this._dataSource.getOriginalEditor();\n\t\tconst modifiedEditor = this._dataSource.getModifiedEditor();\n\t\tconst computer = new InlineViewZonesComputer(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor, renderIndicators);\n\t\treturn computer.getViewZones();\n\t}\n\n\tprotected _getOriginalEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations {\n\t\tconst overviewZoneColor = String(this._removeColor);\n\n\t\tconst result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tconst originalEditor = this._dataSource.getOriginalEditor();\n\t\tconst originalModel = originalEditor.getModel()!;\n\t\tconst originalViewModel = originalEditor._getViewModel()!;\n\t\tlet zoneIndex = 0;\n\n\t\tfor (const lineChange of lineChanges) {\n\n\t\t\t// Add overview zones in the overview ruler\n\t\t\tif (isChangeOrDelete(lineChange)) {\n\t\t\t\tresult.decorations.push({\n\t\t\t\t\trange: new Range(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\t\t\toptions: DECORATIONS.lineDeleteMargin\n\t\t\t\t});\n\n\t\t\t\twhile (zoneIndex < zones.modified.length) {\n\t\t\t\t\tconst zone = zones.modified[zoneIndex];\n\t\t\t\t\tif (zone.diff && zone.diff.originalStartLineNumber >= lineChange.originalStartLineNumber) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tzoneIndex++;\n\t\t\t\t}\n\n\t\t\t\tlet zoneHeightInLines = 0;\n\t\t\t\tif (zoneIndex < zones.modified.length) {\n\t\t\t\t\tconst zone = zones.modified[zoneIndex];\n\t\t\t\t\tif (\n\t\t\t\t\t\tzone.diff\n\t\t\t\t\t\t&& zone.diff.originalStartLineNumber === lineChange.originalStartLineNumber\n\t\t\t\t\t\t&& zone.diff.originalEndLineNumber === lineChange.originalEndLineNumber\n\t\t\t\t\t\t&& zone.diff.modifiedStartLineNumber === lineChange.modifiedStartLineNumber\n\t\t\t\t\t\t&& zone.diff.modifiedEndLineNumber === lineChange.modifiedEndLineNumber\n\t\t\t\t\t) {\n\t\t\t\t\t\tzoneHeightInLines = zone.heightInLines;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst viewRange = getViewRange(originalModel, originalViewModel, lineChange.originalStartLineNumber, lineChange.originalEndLineNumber);\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(viewRange.startLineNumber, viewRange.endLineNumber, zoneHeightInLines, overviewZoneColor));\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected _getModifiedEditorDecorations(zones: IEditorsZones, lineChanges: ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean): IEditorDiffDecorations {\n\t\tconst modifiedEditor = this._dataSource.getModifiedEditor();\n\t\tconst overviewZoneColor = String(this._insertColor);\n\n\t\tconst result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tconst modifiedModel = modifiedEditor.getModel()!;\n\t\tconst modifiedViewModel = modifiedEditor._getViewModel()!;\n\n\t\tfor (const lineChange of lineChanges) {\n\n\t\t\t// Add decorations & overview zones\n\t\t\tif (isChangeOrInsert(lineChange)) {\n\t\t\t\tresult.decorations.push({\n\t\t\t\t\trange: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\t\t\toptions: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert)\n\t\t\t\t});\n\n\t\t\t\tconst viewRange = getViewRange(modifiedModel, modifiedViewModel, lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber);\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(viewRange.startLineNumber, viewRange.endLineNumber, /*use endLineNumber*/0, overviewZoneColor));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (const charChange of lineChange.charChanges) {\n\t\t\t\t\t\tif (isChangeOrInsert(charChange)) {\n\t\t\t\t\t\t\tif (ignoreTrimWhitespace) {\n\t\t\t\t\t\t\t\tfor (let lineNumber = charChange.modifiedStartLineNumber; lineNumber <= charChange.modifiedEndLineNumber; lineNumber++) {\n\t\t\t\t\t\t\t\t\tlet startColumn: number;\n\t\t\t\t\t\t\t\t\tlet endColumn: number;\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.modifiedStartLineNumber) {\n\t\t\t\t\t\t\t\t\t\tstartColumn = charChange.modifiedStartColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstartColumn = modifiedModel.getLineFirstNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (lineNumber === charChange.modifiedEndLineNumber) {\n\t\t\t\t\t\t\t\t\t\tendColumn = charChange.modifiedEndColumn;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tendColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresult.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Constants.MAX_SAFE_SMALL_INTEGER, DECORATIONS.charInsertWholeLine));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic layout(): number {\n\t\t// An editor should not be smaller than 5px\n\t\treturn Math.max(5, this._decorationsLeft);\n\t}\n\n}\n\ninterface InlineModifiedViewZone extends IMyViewZone {\n\tshouldNotShrink: boolean;\n\tafterLineNumber: number;\n\theightInLines: number;\n\tminWidthInPx: number;\n\tdomNode: HTMLElement;\n\tmarginDomNode: HTMLElement;\n\tdiff: IDiffLinesChange;\n}\n\nclass InlineViewZonesComputer extends ViewZonesComputer {\n\n\tprivate readonly _originalModel: ITextModel;\n\tprivate readonly _renderIndicators: boolean;\n\tprivate readonly _pendingLineChange: ILineChange[];\n\tprivate readonly _pendingViewZones: InlineModifiedViewZone[];\n\tprivate readonly _lineBreaksComputer: ILineBreaksComputer;\n\n\tconstructor(\n\t\tlineChanges: ILineChange[],\n\t\toriginalForeignVZ: IEditorWhitespace[],\n\t\tmodifiedForeignVZ: IEditorWhitespace[],\n\t\toriginalEditor: CodeEditorWidget,\n\t\tmodifiedEditor: CodeEditorWidget,\n\t\trenderIndicators: boolean\n\t) {\n\t\tsuper(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor);\n\t\tthis._originalModel = originalEditor.getModel()!;\n\t\tthis._renderIndicators = renderIndicators;\n\t\tthis._pendingLineChange = [];\n\t\tthis._pendingViewZones = [];\n\t\tthis._lineBreaksComputer = this._modifiedEditor._getViewModel()!.createLineBreaksComputer();\n\t}\n\n\tpublic override getViewZones(): IEditorsZones {\n\t\tconst result = super.getViewZones();\n\t\tthis._finalize(result);\n\t\treturn result;\n\t}\n\n\tprotected _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null {\n\t\tconst result = document.createElement('div');\n\t\tresult.className = 'inline-added-margin-view-zone';\n\t\treturn result;\n\t}\n\n\tprotected _produceOriginalFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tconst marginDomNode = document.createElement('div');\n\t\tmarginDomNode.className = 'inline-added-margin-view-zone';\n\n\t\treturn {\n\t\t\tafterLineNumber: Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber),\n\t\t\theightInLines: lineChangeModifiedLength,\n\t\t\tdomNode: document.createElement('div'),\n\t\t\tmarginDomNode: marginDomNode\n\t\t};\n\t}\n\n\tprotected _produceModifiedFromDiff(lineChange: ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tconst domNode = document.createElement('div');\n\t\tdomNode.className = `view-lines line-delete ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`;\n\n\t\tconst marginDomNode = document.createElement('div');\n\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\n\t\tconst viewZone: InlineModifiedViewZone = {\n\t\t\tshouldNotShrink: true,\n\t\t\tafterLineNumber: (lineChange.modifiedEndLineNumber === 0 ? lineChange.modifiedStartLineNumber : lineChange.modifiedStartLineNumber - 1),\n\t\t\theightInLines: lineChangeOriginalLength,\n\t\t\tminWidthInPx: 0,\n\t\t\tdomNode: domNode,\n\t\t\tmarginDomNode: marginDomNode,\n\t\t\tdiff: {\n\t\t\t\toriginalStartLineNumber: lineChange.originalStartLineNumber,\n\t\t\t\toriginalEndLineNumber: lineChange.originalEndLineNumber,\n\t\t\t\tmodifiedStartLineNumber: lineChange.modifiedStartLineNumber,\n\t\t\t\tmodifiedEndLineNumber: lineChange.modifiedEndLineNumber,\n\t\t\t\toriginalModel: this._originalModel,\n\t\t\t\tviewLineCounts: null,\n\t\t\t}\n\t\t};\n\n\t\tfor (let lineNumber = lineChange.originalStartLineNumber; lineNumber <= lineChange.originalEndLineNumber; lineNumber++) {\n\t\t\tthis._lineBreaksComputer.addRequest(this._originalModel.getLineContent(lineNumber), null, null);\n\t\t}\n\n\t\tthis._pendingLineChange.push(lineChange);\n\t\tthis._pendingViewZones.push(viewZone);\n\n\t\treturn viewZone;\n\t}\n\n\tprivate _finalize(result: IEditorsZones): void {\n\t\tconst modifiedEditorOptions = this._modifiedEditor.getOptions();\n\t\tconst tabSize = this._modifiedEditor.getModel()!.getOptions().tabSize;\n\t\tconst fontInfo = modifiedEditorOptions.get(EditorOption.fontInfo);\n\t\tconst disableMonospaceOptimizations = modifiedEditorOptions.get(EditorOption.disableMonospaceOptimizations);\n\t\tconst typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tconst scrollBeyondLastColumn = modifiedEditorOptions.get(EditorOption.scrollBeyondLastColumn);\n\t\tconst mightContainNonBasicASCII = this._originalModel.mightContainNonBasicASCII();\n\t\tconst mightContainRTL = this._originalModel.mightContainRTL();\n\t\tconst lineHeight = modifiedEditorOptions.get(EditorOption.lineHeight);\n\t\tconst layoutInfo = modifiedEditorOptions.get(EditorOption.layoutInfo);\n\t\tconst lineDecorationsWidth = layoutInfo.decorationsWidth;\n\t\tconst stopRenderingLineAfter = modifiedEditorOptions.get(EditorOption.stopRenderingLineAfter);\n\t\tconst renderWhitespace = modifiedEditorOptions.get(EditorOption.renderWhitespace);\n\t\tconst renderControlCharacters = modifiedEditorOptions.get(EditorOption.renderControlCharacters);\n\t\tconst fontLigatures = modifiedEditorOptions.get(EditorOption.fontLigatures);\n\n\t\tconst lineBreaks = this._lineBreaksComputer.finalize();\n\t\tlet lineBreakIndex = 0;\n\n\t\tfor (let i = 0; i < this._pendingLineChange.length; i++) {\n\t\t\tconst lineChange = this._pendingLineChange[i];\n\t\t\tconst viewZone = this._pendingViewZones[i];\n\t\t\tconst domNode = viewZone.domNode;\n\t\t\tapplyFontInfo(domNode, fontInfo);\n\n\t\t\tconst marginDomNode = viewZone.marginDomNode;\n\t\t\tapplyFontInfo(marginDomNode, fontInfo);\n\n\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\tif (lineChange.charChanges) {\n\t\t\t\tfor (const charChange of lineChange.charChanges) {\n\t\t\t\t\tif (isChangeOrDelete(charChange)) {\n\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\tnew Range(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn),\n\t\t\t\t\t\t\t'char-delete',\n\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst hasCharChanges = (decorations.length > 0);\n\n\t\t\tconst sb = createStringBuilder(10000);\n\t\t\tlet maxCharsPerLine = 0;\n\t\t\tlet renderedLineCount = 0;\n\t\t\tlet viewLineCounts: number[] | null = null;\n\t\t\tfor (let lineNumber = lineChange.originalStartLineNumber; lineNumber <= lineChange.originalEndLineNumber; lineNumber++) {\n\t\t\t\tconst lineIndex = lineNumber - lineChange.originalStartLineNumber;\n\t\t\t\tconst lineTokens = this._originalModel.getLineTokens(lineNumber);\n\t\t\t\tconst lineContent = lineTokens.getLineContent();\n\t\t\t\tconst lineBreakData = lineBreaks[lineBreakIndex++];\n\t\t\t\tconst actualDecorations = LineDecoration.filter(decorations, lineNumber, 1, lineContent.length + 1);\n\n\t\t\t\tif (lineBreakData) {\n\t\t\t\t\tlet lastBreakOffset = 0;\n\t\t\t\t\tfor (const breakOffset of lineBreakData.breakOffsets) {\n\t\t\t\t\t\tconst viewLineTokens = lineTokens.sliceAndInflate(lastBreakOffset, breakOffset, 0);\n\t\t\t\t\t\tconst viewLineContent = lineContent.substring(lastBreakOffset, breakOffset);\n\t\t\t\t\t\tmaxCharsPerLine = Math.max(maxCharsPerLine, this._renderOriginalLine(\n\t\t\t\t\t\t\trenderedLineCount++,\n\t\t\t\t\t\t\tviewLineContent,\n\t\t\t\t\t\t\tviewLineTokens,\n\t\t\t\t\t\t\tLineDecoration.extractWrapped(actualDecorations, lastBreakOffset, breakOffset),\n\t\t\t\t\t\t\thasCharChanges,\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t\tfontInfo,\n\t\t\t\t\t\t\tdisableMonospaceOptimizations,\n\t\t\t\t\t\t\tlineHeight,\n\t\t\t\t\t\t\tlineDecorationsWidth,\n\t\t\t\t\t\t\tstopRenderingLineAfter,\n\t\t\t\t\t\t\trenderWhitespace,\n\t\t\t\t\t\t\trenderControlCharacters,\n\t\t\t\t\t\t\tfontLigatures,\n\t\t\t\t\t\t\ttabSize,\n\t\t\t\t\t\t\tsb,\n\t\t\t\t\t\t\tmarginDomNode\n\t\t\t\t\t\t));\n\t\t\t\t\t\tlastBreakOffset = breakOffset;\n\t\t\t\t\t}\n\t\t\t\t\tif (!viewLineCounts) {\n\t\t\t\t\t\tviewLineCounts = [];\n\t\t\t\t\t}\n\t\t\t\t\t// make sure all lines before this one have an entry in `viewLineCounts`\n\t\t\t\t\twhile (viewLineCounts.length < lineIndex) {\n\t\t\t\t\t\tviewLineCounts[viewLineCounts.length] = 1;\n\t\t\t\t\t}\n\t\t\t\t\tviewLineCounts[lineIndex] = lineBreakData.breakOffsets.length;\n\t\t\t\t\tviewZone.heightInLines += (lineBreakData.breakOffsets.length - 1);\n\t\t\t\t\tconst marginDomNode2 = document.createElement('div');\n\t\t\t\t\tmarginDomNode2.className = 'gutter-delete';\n\t\t\t\t\tresult.original.push({\n\t\t\t\t\t\tafterLineNumber: lineNumber,\n\t\t\t\t\t\tafterColumn: 0,\n\t\t\t\t\t\theightInLines: lineBreakData.breakOffsets.length - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\tmarginDomNode: marginDomNode2\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmaxCharsPerLine = Math.max(maxCharsPerLine, this._renderOriginalLine(\n\t\t\t\t\t\trenderedLineCount++,\n\t\t\t\t\t\tlineContent,\n\t\t\t\t\t\tlineTokens,\n\t\t\t\t\t\tactualDecorations,\n\t\t\t\t\t\thasCharChanges,\n\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\tfontInfo,\n\t\t\t\t\t\tdisableMonospaceOptimizations,\n\t\t\t\t\t\tlineHeight,\n\t\t\t\t\t\tlineDecorationsWidth,\n\t\t\t\t\t\tstopRenderingLineAfter,\n\t\t\t\t\t\trenderWhitespace,\n\t\t\t\t\t\trenderControlCharacters,\n\t\t\t\t\t\tfontLigatures,\n\t\t\t\t\t\ttabSize,\n\t\t\t\t\t\tsb,\n\t\t\t\t\t\tmarginDomNode\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t\tmaxCharsPerLine += scrollBeyondLastColumn;\n\n\t\t\tconst html = sb.build();\n\t\t\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\t\t\tdomNode.innerHTML = trustedhtml as string;\n\t\t\tviewZone.minWidthInPx = (maxCharsPerLine * typicalHalfwidthCharacterWidth);\n\n\t\t\tif (viewLineCounts) {\n\t\t\t\t// make sure all lines have an entry in `viewLineCounts`\n\t\t\t\tconst cnt = lineChange.originalEndLineNumber - lineChange.originalStartLineNumber;\n\t\t\t\twhile (viewLineCounts.length <= cnt) {\n\t\t\t\t\tviewLineCounts[viewLineCounts.length] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tviewZone.diff.viewLineCounts = viewLineCounts;\n\t\t}\n\n\t\tresult.original.sort((a, b) => {\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t});\n\t}\n\n\tprivate _renderOriginalLine(\n\t\trenderedLineCount: number,\n\t\tlineContent: string,\n\t\tlineTokens: IViewLineTokens,\n\t\tdecorations: LineDecoration[],\n\t\thasCharChanges: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\tmightContainRTL: boolean,\n\t\tfontInfo: FontInfo,\n\t\tdisableMonospaceOptimizations: boolean,\n\t\tlineHeight: number,\n\t\tlineDecorationsWidth: number,\n\t\tstopRenderingLineAfter: number,\n\t\trenderWhitespace: 'selection' | 'none' | 'boundary' | 'trailing' | 'all',\n\t\trenderControlCharacters: boolean,\n\t\tfontLigatures: string,\n\t\ttabSize: number,\n\t\tsb: IStringBuilder,\n\t\tmarginDomNode: HTMLElement\n\t): number {\n\n\t\tsb.appendASCIIString('<div class=\"view-line');\n\t\tif (!hasCharChanges) {\n\t\t\t// No char changes\n\t\t\tsb.appendASCIIString(' char-delete');\n\t\t}\n\t\tsb.appendASCIIString('\" style=\"top:');\n\t\tsb.appendASCIIString(String(renderedLineCount * lineHeight));\n\t\tsb.appendASCIIString('px;width:1000000px;\">');\n\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(lineContent, mightContainNonBasicASCII);\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII, mightContainRTL);\n\t\tconst output = renderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tlineContent,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tdecorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull // Send no selections, original line cannot be selected\n\t\t), sb);\n\n\t\tsb.appendASCIIString('</div>');\n\n\t\tif (this._renderIndicators) {\n\t\t\tconst marginElement = document.createElement('div');\n\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${renderedLineCount * lineHeight}px;width:${lineDecorationsWidth}px;height:${lineHeight}px;right:0;`);\n\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t}\n\n\t\treturn output.characterMapping.getAbsoluteOffset(output.characterMapping.length);\n\t}\n}\n\nfunction validateDiffWordWrap(value: 'off' | 'on' | 'inherit' | undefined, defaultValue: 'off' | 'on' | 'inherit'): 'off' | 'on' | 'inherit' {\n\treturn validateStringSetOption<'off' | 'on' | 'inherit'>(value, defaultValue, ['off', 'on', 'inherit']);\n}\n\nfunction isChangeOrInsert(lineChange: IChange): boolean {\n\treturn lineChange.modifiedEndLineNumber > 0;\n}\n\nfunction isChangeOrDelete(lineChange: IChange): boolean {\n\treturn lineChange.originalEndLineNumber > 0;\n}\n\nfunction createFakeLinesDiv(): HTMLElement {\n\tconst r = document.createElement('div');\n\tr.className = 'diagonal-fill';\n\treturn r;\n}\n\nfunction getViewRange(model: ITextModel, viewModel: IViewModel, startLineNumber: number, endLineNumber: number): Range {\n\tconst lineCount = model.getLineCount();\n\tstartLineNumber = Math.min(lineCount, Math.max(1, startLineNumber));\n\tendLineNumber = Math.min(lineCount, Math.max(1, endLineNumber));\n\treturn viewModel.coordinatesConverter.convertModelRangeToViewRange(new Range(\n\t\tstartLineNumber, model.getLineMinColumn(startLineNumber),\n\t\tendLineNumber, model.getLineMaxColumn(endLineNumber)\n\t));\n}\n\nfunction validateDiffEditorOptions(options: Readonly<IDiffEditorOptions>, defaults: ValidDiffEditorBaseOptions): ValidDiffEditorBaseOptions {\n\treturn {\n\t\tenableSplitViewResizing: validateBooleanOption(options.enableSplitViewResizing, defaults.enableSplitViewResizing),\n\t\trenderSideBySide: validateBooleanOption(options.renderSideBySide, defaults.renderSideBySide),\n\t\tmaxComputationTime: clampedInt(options.maxComputationTime, defaults.maxComputationTime, 0, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\tmaxFileSize: clampedInt(options.maxFileSize, defaults.maxFileSize, 0, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\tignoreTrimWhitespace: validateBooleanOption(options.ignoreTrimWhitespace, defaults.ignoreTrimWhitespace),\n\t\trenderIndicators: validateBooleanOption(options.renderIndicators, defaults.renderIndicators),\n\t\toriginalEditable: validateBooleanOption(options.originalEditable, defaults.originalEditable),\n\t\tdiffCodeLens: validateBooleanOption(options.diffCodeLens, defaults.diffCodeLens),\n\t\trenderOverviewRuler: validateBooleanOption(options.renderOverviewRuler, defaults.renderOverviewRuler),\n\t\tdiffWordWrap: validateDiffWordWrap(options.diffWordWrap, defaults.diffWordWrap),\n\t};\n}\n\nfunction changedDiffEditorOptions(a: ValidDiffEditorBaseOptions, b: ValidDiffEditorBaseOptions) {\n\treturn {\n\t\tenableSplitViewResizing: (a.enableSplitViewResizing !== b.enableSplitViewResizing),\n\t\trenderSideBySide: (a.renderSideBySide !== b.renderSideBySide),\n\t\tmaxComputationTime: (a.maxComputationTime !== b.maxComputationTime),\n\t\tmaxFileSize: (a.maxFileSize !== b.maxFileSize),\n\t\tignoreTrimWhitespace: (a.ignoreTrimWhitespace !== b.ignoreTrimWhitespace),\n\t\trenderIndicators: (a.renderIndicators !== b.renderIndicators),\n\t\toriginalEditable: (a.originalEditable !== b.originalEditable),\n\t\tdiffCodeLens: (a.diffCodeLens !== b.diffCodeLens),\n\t\trenderOverviewRuler: (a.renderOverviewRuler !== b.renderOverviewRuler),\n\t\tdiffWordWrap: (a.diffWordWrap !== b.diffWordWrap),\n\t};\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst added = theme.getColor(diffInserted);\n\tif (added) {\n\t\tcollector.addRule(`.monaco-editor .char-insert, .monaco-diff-editor .char-insert { background-color: ${added}; }`);\n\t}\n\tconst lineAdded = theme.getColor(diffInsertedLine) || added;\n\tif (lineAdded) {\n\t\tcollector.addRule(`.monaco-editor .line-insert, .monaco-diff-editor .line-insert { background-color: ${lineAdded}; }`);\n\t}\n\tconst gutterAdded = theme.getColor(diffInsertedLineGutter) || lineAdded;\n\tif (gutterAdded) {\n\t\tcollector.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${gutterAdded}; }`);\n\t\tcollector.addRule(`.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert { background-color: ${gutterAdded}; }`);\n\t}\n\n\tconst removed = theme.getColor(diffRemoved);\n\tif (removed) {\n\t\tcollector.addRule(`.monaco-editor .char-delete, .monaco-diff-editor .char-delete { background-color: ${removed}; }`);\n\t}\n\tconst lineRemoved = theme.getColor(diffRemovedLine) || removed;\n\tif (lineRemoved) {\n\t\tcollector.addRule(`.monaco-editor .line-delete, .monaco-diff-editor .line-delete { background-color: ${lineRemoved}; }`);\n\t}\n\tconst gutterRemoved = theme.getColor(diffRemovedLineGutter) || lineRemoved;\n\tif (gutterRemoved) {\n\t\tcollector.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${gutterRemoved}; }`);\n\t\tcollector.addRule(`.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete { background-color: ${gutterRemoved}; }`);\n\t}\n\n\tconst addedOutline = theme.getColor(diffInsertedOutline);\n\tif (addedOutline) {\n\t\tcollector.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${addedOutline}; }`);\n\t}\n\n\tconst removedOutline = theme.getColor(diffRemovedOutline);\n\tif (removedOutline) {\n\t\tcollector.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${removedOutline}; }`);\n\t}\n\n\tconst shadow = theme.getColor(scrollbarShadow);\n\tif (shadow) {\n\t\tcollector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${shadow}; }`);\n\t}\n\n\tconst border = theme.getColor(diffBorder);\n\tif (border) {\n\t\tcollector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${border}; }`);\n\t}\n\n\tconst scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground);\n\tif (scrollbarSliderBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${scrollbarSliderBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground);\n\tif (scrollbarSliderHoverBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${scrollbarSliderHoverBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground);\n\tif (scrollbarSliderActiveBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${scrollbarSliderActiveBackgroundColor};\n\t\t\t}\n\t\t`);\n\t}\n\n\tconst diffDiagonalFillColor = theme.getColor(diffDiagonalFill);\n\tcollector.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${diffDiagonalFillColor} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${diffDiagonalFillColor} 50%, ${diffDiagonalFillColor} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`);\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 * as objects from 'vs/base/common/objects';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { ConfigurationChangedEvent, IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class EmbeddedCodeEditorWidget extends CodeEditorWidget {\n\n\tprivate readonly _parentEditor: ICodeEditor;\n\tprivate readonly _overwriteOptions: IEditorOptions;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: IEditorOptions,\n\t\tparentEditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t\t@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper(domElement, { ...parentEditor.getRawOptions(), overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);\n\n\t\tthis._parentEditor = parentEditor;\n\t\tthis._overwriteOptions = options;\n\n\t\t// Overwrite parent's options\n\t\tsuper.updateOptions(this._overwriteOptions);\n\n\t\tthis._register(parentEditor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => this._onParentConfigurationChanged(e)));\n\t}\n\n\tgetParentEditor(): ICodeEditor {\n\t\treturn this._parentEditor;\n\t}\n\n\tprivate _onParentConfigurationChanged(e: ConfigurationChangedEvent): void {\n\t\tsuper.updateOptions(this._parentEditor.getRawOptions());\n\t\tsuper.updateOptions(this._overwriteOptions);\n\t}\n\n\toverride updateOptions(newOptions: IEditorOptions): void {\n\t\tobjects.mixin(this._overwriteOptions, newOptions, true);\n\t\tsuper.updateOptions(this._overwriteOptions);\n\t}\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./bracketMatching';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/core/editorColorRegistry';\nimport * as nls from 'vs/nls';\nimport { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService';\n\nconst overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.'));\n\nclass JumpToBracketAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.jumpToBracket',\n\t\t\tlabel: nls.localize('smartSelect.jumpBracket', \"Go to Bracket\"),\n\t\t\talias: 'Go to Bracket',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backslash,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tBracketMatchingController.get(editor)?.jumpToBracket();\n\t}\n}\n\nclass SelectToBracketAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.selectToBracket',\n\t\t\tlabel: nls.localize('smartSelect.selectToBracket', \"Select to Bracket\"),\n\t\t\talias: 'Select to Bracket',\n\t\t\tprecondition: undefined,\n\t\t\tdescription: {\n\t\t\t\tdescription: `Select to Bracket`,\n\t\t\t\targs: [{\n\t\t\t\t\tname: 'args',\n\t\t\t\t\tschema: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t'selectBrackets': {\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tlet selectBrackets = true;\n\t\tif (args && args.selectBrackets === false) {\n\t\t\tselectBrackets = false;\n\t\t}\n\t\tBracketMatchingController.get(editor)?.selectToBracket(selectBrackets);\n\t}\n}\n\ntype Brackets = [Range, Range];\n\nclass BracketsData {\n\tpublic readonly position: Position;\n\tpublic readonly brackets: Brackets | null;\n\tpublic readonly options: ModelDecorationOptions;\n\n\tconstructor(position: Position, brackets: Brackets | null, options: ModelDecorationOptions) {\n\t\tthis.position = position;\n\t\tthis.brackets = brackets;\n\t\tthis.options = options;\n\t}\n}\n\nexport class BracketMatchingController extends Disposable implements IEditorContribution {\n\tpublic static readonly ID = 'editor.contrib.bracketMatchingController';\n\n\tpublic static get(editor: ICodeEditor): BracketMatchingController | null {\n\t\treturn editor.getContribution<BracketMatchingController>(BracketMatchingController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate _lastBracketsData: BracketsData[];\n\tprivate _lastVersionId: number;\n\tprivate _decorations: string[];\n\tprivate readonly _updateBracketsSoon: RunOnceScheduler;\n\tprivate _matchBrackets: 'never' | 'near' | 'always';\n\n\tconstructor(\n\t\teditor: ICodeEditor\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._lastBracketsData = [];\n\t\tthis._lastVersionId = 0;\n\t\tthis._decorations = [];\n\t\tthis._updateBracketsSoon = this._register(new RunOnceScheduler(() => this._updateBrackets(), 50));\n\t\tthis._matchBrackets = this._editor.getOption(EditorOption.matchBrackets);\n\n\t\tthis._updateBracketsSoon.schedule();\n\t\tthis._register(editor.onDidChangeCursorPosition((e) => {\n\n\t\t\tif (this._matchBrackets === 'never') {\n\t\t\t\t// Early exit if nothing needs to be done!\n\t\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis._lastBracketsData = [];\n\t\t\tthis._decorations = [];\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelLanguageConfiguration((e) => {\n\t\t\tthis._lastBracketsData = [];\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.matchBrackets)) {\n\t\t\t\tthis._matchBrackets = this._editor.getOption(EditorOption.matchBrackets);\n\t\t\t\tthis._decorations = this._editor.deltaDecorations(this._decorations, []);\n\t\t\t\tthis._lastBracketsData = [];\n\t\t\t\tthis._lastVersionId = 0;\n\t\t\t\tthis._updateBracketsSoon.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(editor.onDidBlurEditorWidget(() => {\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\n\t\tthis._register(editor.onDidFocusEditorWidget(() => {\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t}\n\n\tpublic jumpToBracket(): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst newSelections = this._editor.getSelections().map(selection => {\n\t\t\tconst position = selection.getStartPosition();\n\n\t\t\t// find matching brackets if position is on a bracket\n\t\t\tconst brackets = model.bracketPairs.matchBracket(position);\n\t\t\tlet newCursorPosition: Position | null = null;\n\t\t\tif (brackets) {\n\t\t\t\tif (brackets[0].containsPosition(position)) {\n\t\t\t\t\tnewCursorPosition = brackets[1].getStartPosition();\n\t\t\t\t} else if (brackets[1].containsPosition(position)) {\n\t\t\t\t\tnewCursorPosition = brackets[0].getStartPosition();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// find the enclosing brackets if the position isn't on a matching bracket\n\t\t\t\tconst enclosingBrackets = model.bracketPairs.findEnclosingBrackets(position);\n\t\t\t\tif (enclosingBrackets) {\n\t\t\t\t\tnewCursorPosition = enclosingBrackets[0].getStartPosition();\n\t\t\t\t} else {\n\t\t\t\t\t// no enclosing brackets, try the very first next bracket\n\t\t\t\t\tconst nextBracket = model.bracketPairs.findNextBracket(position);\n\t\t\t\t\tif (nextBracket && nextBracket.range) {\n\t\t\t\t\t\tnewCursorPosition = nextBracket.range.getStartPosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newCursorPosition) {\n\t\t\t\treturn new Selection(newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column);\n\t\t\t}\n\t\t\treturn new Selection(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\t});\n\n\t\tthis._editor.setSelections(newSelections);\n\t\tthis._editor.revealRange(newSelections[0]);\n\t}\n\n\tpublic selectToBracket(selectBrackets: boolean): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst newSelections: Selection[] = [];\n\n\t\tthis._editor.getSelections().forEach(selection => {\n\t\t\tconst position = selection.getStartPosition();\n\t\t\tlet brackets = model.bracketPairs.matchBracket(position);\n\n\t\t\tif (!brackets) {\n\t\t\t\tbrackets = model.bracketPairs.findEnclosingBrackets(position);\n\t\t\t\tif (!brackets) {\n\t\t\t\t\tconst nextBracket = model.bracketPairs.findNextBracket(position);\n\t\t\t\t\tif (nextBracket && nextBracket.range) {\n\t\t\t\t\t\tbrackets = model.bracketPairs.matchBracket(nextBracket.range.getStartPosition());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet selectFrom: Position | null = null;\n\t\t\tlet selectTo: Position | null = null;\n\n\t\t\tif (brackets) {\n\t\t\t\tbrackets.sort(Range.compareRangesUsingStarts);\n\t\t\t\tconst [open, close] = brackets;\n\t\t\t\tselectFrom = selectBrackets ? open.getStartPosition() : open.getEndPosition();\n\t\t\t\tselectTo = selectBrackets ? close.getEndPosition() : close.getStartPosition();\n\n\t\t\t\tif (close.containsPosition(position)) {\n\t\t\t\t\t// select backwards if the cursor was on the closing bracket\n\t\t\t\t\tconst tmp = selectFrom;\n\t\t\t\t\tselectFrom = selectTo;\n\t\t\t\t\tselectTo = tmp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (selectFrom && selectTo) {\n\t\t\t\tnewSelections.push(new Selection(selectFrom.lineNumber, selectFrom.column, selectTo.lineNumber, selectTo.column));\n\t\t\t}\n\t\t});\n\n\t\tif (newSelections.length > 0) {\n\t\t\tthis._editor.setSelections(newSelections);\n\t\t\tthis._editor.revealRange(newSelections[0]);\n\t\t}\n\t}\n\n\tprivate static readonly _DECORATION_OPTIONS_WITH_OVERVIEW_RULER = ModelDecorationOptions.register({\n\t\tdescription: 'bracket-match-overview',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'bracket-match',\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerBracketMatchForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t}\n\t});\n\n\tprivate static readonly _DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = ModelDecorationOptions.register({\n\t\tdescription: 'bracket-match-no-overview',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'bracket-match'\n\t});\n\n\tprivate _updateBrackets(): void {\n\t\tif (this._matchBrackets === 'never') {\n\t\t\treturn;\n\t\t}\n\t\tthis._recomputeBrackets();\n\n\t\tlet newDecorations: IModelDeltaDecoration[] = [], newDecorationsLen = 0;\n\t\tfor (const bracketData of this._lastBracketsData) {\n\t\t\tlet brackets = bracketData.brackets;\n\t\t\tif (brackets) {\n\t\t\t\tnewDecorations[newDecorationsLen++] = { range: brackets[0], options: bracketData.options };\n\t\t\t\tnewDecorations[newDecorationsLen++] = { range: brackets[1], options: bracketData.options };\n\t\t\t}\n\t\t}\n\n\t\tthis._decorations = this._editor.deltaDecorations(this._decorations, newDecorations);\n\t}\n\n\tprivate _recomputeBrackets(): void {\n\t\tif (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {\n\t\t\t// no model or no focus => no brackets!\n\t\t\tthis._lastBracketsData = [];\n\t\t\tthis._lastVersionId = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = this._editor.getSelections();\n\t\tif (selections.length > 100) {\n\t\t\t// no bracket matching for high numbers of selections\n\t\t\tthis._lastBracketsData = [];\n\t\t\tthis._lastVersionId = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst versionId = model.getVersionId();\n\t\tlet previousData: BracketsData[] = [];\n\t\tif (this._lastVersionId === versionId) {\n\t\t\t// use the previous data only if the model is at the same version id\n\t\t\tpreviousData = this._lastBracketsData;\n\t\t}\n\n\t\tlet positions: Position[] = [], positionsLen = 0;\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tlet selection = selections[i];\n\n\t\t\tif (selection.isEmpty()) {\n\t\t\t\t// will bracket match a cursor only if the selection is collapsed\n\t\t\t\tpositions[positionsLen++] = selection.getStartPosition();\n\t\t\t}\n\t\t}\n\n\t\t// sort positions for `previousData` cache hits\n\t\tif (positions.length > 1) {\n\t\t\tpositions.sort(Position.compare);\n\t\t}\n\n\t\tlet newData: BracketsData[] = [], newDataLen = 0;\n\t\tlet previousIndex = 0, previousLen = previousData.length;\n\t\tfor (let i = 0, len = positions.length; i < len; i++) {\n\t\t\tlet position = positions[i];\n\n\t\t\twhile (previousIndex < previousLen && previousData[previousIndex].position.isBefore(position)) {\n\t\t\t\tpreviousIndex++;\n\t\t\t}\n\n\t\t\tif (previousIndex < previousLen && previousData[previousIndex].position.equals(position)) {\n\t\t\t\tnewData[newDataLen++] = previousData[previousIndex];\n\t\t\t} else {\n\t\t\t\tlet brackets = model.bracketPairs.matchBracket(position, 20 /* give at most 20ms to compute */);\n\t\t\t\tlet options = BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;\n\t\t\t\tif (!brackets && this._matchBrackets === 'always') {\n\t\t\t\t\tbrackets = model.bracketPairs.findEnclosingBrackets(position, 20 /* give at most 20ms to compute */);\n\t\t\t\t\toptions = BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER;\n\t\t\t\t}\n\t\t\t\tnewData[newDataLen++] = new BracketsData(position, brackets, options);\n\t\t\t}\n\t\t}\n\n\t\tthis._lastBracketsData = newData;\n\t\tthis._lastVersionId = versionId;\n\t}\n}\n\nregisterEditorContribution(BracketMatchingController.ID, BracketMatchingController);\nregisterEditorAction(SelectToBracketAction);\nregisterEditorAction(JumpToBracketAction);\nregisterThemingParticipant((theme, collector) => {\n\tconst bracketMatchBackground = theme.getColor(editorBracketMatchBackground);\n\tif (bracketMatchBackground) {\n\t\tcollector.addRule(`.monaco-editor .bracket-match { background-color: ${bracketMatchBackground}; }`);\n\t}\n\tconst bracketMatchBorder = theme.getColor(editorBracketMatchBorder);\n\tif (bracketMatchBorder) {\n\t\tcollector.addRule(`.monaco-editor .bracket-match { border: 1px solid ${bracketMatchBorder}; }`);\n\t}\n});\n\n// Go to menu\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '5_infile_nav',\n\tcommand: {\n\t\tid: 'editor.action.jumpToBracket',\n\t\ttitle: nls.localize({ key: 'miGoToBracket', comment: ['&& denotes a mnemonic'] }, \"Go to &&Bracket\")\n\t},\n\torder: 2\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 * as dom from 'vs/base/browser/dom';\nimport { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';\nimport { Constants } from 'vs/base/common/uint';\nimport 'vs/css!./codelensWidget';\nimport { ContentWidgetPositionPreference, IActiveCodeEditor, IContentWidget, IContentWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { CodeLens, Command } from 'vs/editor/common/languages';\nimport { CodeLensItem } from 'vs/editor/contrib/codelens/browser/codelens';\n\nclass CodeLensViewZone implements IViewZone {\n\n\treadonly suppressMouseDown: boolean;\n\treadonly domNode: HTMLElement;\n\n\tafterLineNumber: number;\n\t/**\n\t * We want that this view zone, which reserves space for a code lens appears\n\t * as close as possible to the next line, so we use a very large value here.\n\t */\n\treadonly afterColumn = Constants.MAX_SAFE_SMALL_INTEGER;\n\theightInPx: number;\n\n\tprivate _lastHeight?: number;\n\tprivate readonly _onHeight: () => void;\n\n\tconstructor(afterLineNumber: number, heightInPx: number, onHeight: () => void) {\n\t\tthis.afterLineNumber = afterLineNumber;\n\t\tthis.heightInPx = heightInPx;\n\n\t\tthis._onHeight = onHeight;\n\t\tthis.suppressMouseDown = true;\n\t\tthis.domNode = document.createElement('div');\n\t}\n\n\tonComputedHeight(height: number): void {\n\t\tif (this._lastHeight === undefined) {\n\t\t\tthis._lastHeight = height;\n\t\t} else if (this._lastHeight !== height) {\n\t\t\tthis._lastHeight = height;\n\t\t\tthis._onHeight();\n\t\t}\n\t}\n\n\tisVisible(): boolean {\n\t\treturn this._lastHeight !== 0\n\t\t\t&& this.domNode.hasAttribute('monaco-visible-view-zone');\n\t}\n}\n\nclass CodeLensContentWidget implements IContentWidget {\n\n\tprivate static _idPool: number = 0;\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\treadonly allowEditorOverflow: boolean = false;\n\treadonly suppressMouseDown: boolean = true;\n\n\tprivate readonly _id: string;\n\tprivate readonly _domNode: HTMLElement;\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _commands = new Map<string, Command>();\n\n\tprivate _widgetPosition?: IContentWidgetPosition;\n\tprivate _isEmpty: boolean = true;\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tclassName: string,\n\t\tline: number,\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._id = `codelens.widget-${(CodeLensContentWidget._idPool++)}`;\n\n\t\tthis.updatePosition(line);\n\n\t\tthis._domNode = document.createElement('span');\n\t\tthis._domNode.className = `codelens-decoration ${className}`;\n\t}\n\n\twithCommands(lenses: Array<CodeLens | undefined | null>, animate: boolean): void {\n\t\tthis._commands.clear();\n\n\t\tlet children: HTMLElement[] = [];\n\t\tlet hasSymbol = false;\n\t\tfor (let i = 0; i < lenses.length; i++) {\n\t\t\tconst lens = lenses[i];\n\t\t\tif (!lens) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thasSymbol = true;\n\t\t\tif (lens.command) {\n\t\t\t\tconst title = renderLabelWithIcons(lens.command.title.trim());\n\t\t\t\tif (lens.command.id) {\n\t\t\t\t\tchildren.push(dom.$('a', { id: String(i), title: lens.command.tooltip }, ...title));\n\t\t\t\t\tthis._commands.set(String(i), lens.command);\n\t\t\t\t} else {\n\t\t\t\t\tchildren.push(dom.$('span', { title: lens.command.tooltip }, ...title));\n\t\t\t\t}\n\t\t\t\tif (i + 1 < lenses.length) {\n\t\t\t\t\tchildren.push(dom.$('span', undefined, '\\u00a0|\\u00a0'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!hasSymbol) {\n\t\t\t// symbols but no commands\n\t\t\tdom.reset(this._domNode, dom.$('span', undefined, 'no commands'));\n\n\t\t} else {\n\t\t\t// symbols and commands\n\t\t\tdom.reset(this._domNode, ...children);\n\t\t\tif (this._isEmpty && animate) {\n\t\t\t\tthis._domNode.classList.add('fadein');\n\t\t\t}\n\t\t\tthis._isEmpty = false;\n\t\t}\n\t}\n\n\tgetCommand(link: HTMLLinkElement): Command | undefined {\n\t\treturn link.parentElement === this._domNode\n\t\t\t? this._commands.get(link.id)\n\t\t\t: undefined;\n\t}\n\n\tgetId(): string {\n\t\treturn this._id;\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tupdatePosition(line: number): void {\n\t\tconst column = this._editor.getModel().getLineFirstNonWhitespaceColumn(line);\n\t\tthis._widgetPosition = {\n\t\t\tposition: { lineNumber: line, column: column },\n\t\t\tpreference: [ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\treturn this._widgetPosition || null;\n\t}\n}\n\nexport interface IDecorationIdCallback {\n\t(decorationId: string): void;\n}\n\nexport class CodeLensHelper {\n\n\tprivate readonly _removeDecorations: string[];\n\tprivate readonly _addDecorations: IModelDeltaDecoration[];\n\tprivate readonly _addDecorationsCallbacks: IDecorationIdCallback[];\n\n\tconstructor() {\n\t\tthis._removeDecorations = [];\n\t\tthis._addDecorations = [];\n\t\tthis._addDecorationsCallbacks = [];\n\t}\n\n\taddDecoration(decoration: IModelDeltaDecoration, callback: IDecorationIdCallback): void {\n\t\tthis._addDecorations.push(decoration);\n\t\tthis._addDecorationsCallbacks.push(callback);\n\t}\n\n\tremoveDecoration(decorationId: string): void {\n\t\tthis._removeDecorations.push(decorationId);\n\t}\n\n\tcommit(changeAccessor: IModelDecorationsChangeAccessor): void {\n\t\tlet resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations);\n\t\tfor (let i = 0, len = resultingDecorations.length; i < len; i++) {\n\t\t\tthis._addDecorationsCallbacks[i](resultingDecorations[i]);\n\t\t}\n\t}\n}\n\nexport class CodeLensWidget {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _className: string;\n\tprivate readonly _viewZone: CodeLensViewZone;\n\tprivate readonly _viewZoneId: string;\n\n\tprivate _contentWidget?: CodeLensContentWidget;\n\tprivate _decorationIds: string[];\n\tprivate _data: CodeLensItem[];\n\tprivate _isDisposed: boolean = false;\n\n\tconstructor(\n\t\tdata: CodeLensItem[],\n\t\teditor: IActiveCodeEditor,\n\t\tclassName: string,\n\t\thelper: CodeLensHelper,\n\t\tviewZoneChangeAccessor: IViewZoneChangeAccessor,\n\t\theightInPx: number,\n\t\tupdateCallback: () => void\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._className = className;\n\t\tthis._data = data;\n\n\t\t// create combined range, track all ranges with decorations,\n\t\t// check if there is already something to render\n\t\tthis._decorationIds = [];\n\t\tlet range: Range | undefined;\n\t\tlet lenses: CodeLens[] = [];\n\n\t\tthis._data.forEach((codeLensData, i) => {\n\n\t\t\tif (codeLensData.symbol.command) {\n\t\t\t\tlenses.push(codeLensData.symbol);\n\t\t\t}\n\n\t\t\thelper.addDecoration({\n\t\t\t\trange: codeLensData.symbol.range,\n\t\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t\t}, id => this._decorationIds[i] = id);\n\n\t\t\t// the range contains all lenses on this line\n\t\t\tif (!range) {\n\t\t\t\trange = Range.lift(codeLensData.symbol.range);\n\t\t\t} else {\n\t\t\t\trange = Range.plusRange(range, codeLensData.symbol.range);\n\t\t\t}\n\t\t});\n\n\t\tthis._viewZone = new CodeLensViewZone(range!.startLineNumber - 1, heightInPx, updateCallback);\n\t\tthis._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone);\n\n\t\tif (lenses.length > 0) {\n\t\t\tthis._createContentWidgetIfNecessary();\n\t\t\tthis._contentWidget!.withCommands(lenses, false);\n\t\t}\n\t}\n\n\tprivate _createContentWidgetIfNecessary(): void {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = new CodeLensContentWidget(this._editor, this._className, this._viewZone.afterLineNumber + 1);\n\t\t\tthis._editor.addContentWidget(this._contentWidget);\n\t\t} else {\n\t\t\tthis._editor.layoutContentWidget(this._contentWidget);\n\t\t}\n\t}\n\n\tdispose(helper: CodeLensHelper, viewZoneChangeAccessor?: IViewZoneChangeAccessor): void {\n\t\tthis._decorationIds.forEach(helper.removeDecoration, helper);\n\t\tthis._decorationIds = [];\n\t\tif (viewZoneChangeAccessor) {\n\t\t\tviewZoneChangeAccessor.removeZone(this._viewZoneId);\n\t\t}\n\t\tif (this._contentWidget) {\n\t\t\tthis._editor.removeContentWidget(this._contentWidget);\n\t\t\tthis._contentWidget = undefined;\n\t\t}\n\t\tthis._isDisposed = true;\n\t}\n\n\tisDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\tisValid(): boolean {\n\t\treturn this._decorationIds.some((id, i) => {\n\t\t\tconst range = this._editor.getModel().getDecorationRange(id);\n\t\t\tconst symbol = this._data[i].symbol;\n\t\t\treturn !!(range && Range.isEmpty(symbol.range) === range.isEmpty());\n\t\t});\n\t}\n\n\tupdateCodeLensSymbols(data: CodeLensItem[], helper: CodeLensHelper): void {\n\t\tthis._decorationIds.forEach(helper.removeDecoration, helper);\n\t\tthis._decorationIds = [];\n\t\tthis._data = data;\n\t\tthis._data.forEach((codeLensData, i) => {\n\t\t\thelper.addDecoration({\n\t\t\t\trange: codeLensData.symbol.range,\n\t\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t\t}, id => this._decorationIds[i] = id);\n\t\t});\n\t}\n\n\tupdateHeight(height: number, viewZoneChangeAccessor: IViewZoneChangeAccessor): void {\n\t\tthis._viewZone.heightInPx = height;\n\t\tviewZoneChangeAccessor.layoutZone(this._viewZoneId);\n\t\tif (this._contentWidget) {\n\t\t\tthis._editor.layoutContentWidget(this._contentWidget);\n\t\t}\n\t}\n\n\tcomputeIfNecessary(model: ITextModel): CodeLensItem[] | null {\n\t\tif (!this._viewZone.isVisible()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Read editor current state\n\t\tfor (let i = 0; i < this._decorationIds.length; i++) {\n\t\t\tconst range = model.getDecorationRange(this._decorationIds[i]);\n\t\t\tif (range) {\n\t\t\t\tthis._data[i].symbol.range = range;\n\t\t\t}\n\t\t}\n\t\treturn this._data;\n\t}\n\n\tupdateCommands(symbols: Array<CodeLens | undefined | null>): void {\n\n\t\tthis._createContentWidgetIfNecessary();\n\t\tthis._contentWidget!.withCommands(symbols, true);\n\n\t\tfor (let i = 0; i < this._data.length; i++) {\n\t\t\tconst resolved = symbols[i];\n\t\t\tif (resolved) {\n\t\t\t\tconst { symbol } = this._data[i];\n\t\t\t\tsymbol.command = resolved.command || symbol.command;\n\t\t\t}\n\t\t}\n\t}\n\n\tgetCommand(link: HTMLLinkElement): Command | undefined {\n\t\treturn this._contentWidget?.getCommand(link);\n\t}\n\n\tgetLineNumber(): number {\n\t\tconst range = this._editor.getModel().getDecorationRange(this._decorationIds[0]);\n\t\tif (range) {\n\t\t\treturn range.startLineNumber;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tupdate(viewZoneChangeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this.isValid()) {\n\t\t\tconst range = this._editor.getModel().getDecorationRange(this._decorationIds[0]);\n\t\t\tif (range) {\n\t\t\t\tthis._viewZone.afterLineNumber = range.startLineNumber - 1;\n\t\t\t\tviewZoneChangeAccessor.layoutZone(this._viewZoneId);\n\n\t\t\t\tif (this._contentWidget) {\n\t\t\t\t\tthis._contentWidget.updatePosition(range.startLineNumber);\n\t\t\t\t\tthis._editor.layoutContentWidget(this._contentWidget);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { CancelablePromise, createCancelablePromise, disposableTimeout, RunOnceScheduler } from 'vs/base/common/async';\nimport { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { hash } from 'vs/base/common/hash';\nimport { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';\nimport { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll';\nimport { IActiveCodeEditor, ICodeEditor, IViewZoneChangeAccessor, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IModelDecorationsChangeAccessor } from 'vs/editor/common/model';\nimport { CodeLens, Command } from 'vs/editor/common/languages';\nimport { CodeLensItem, CodeLensModel, getCodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens';\nimport { ICodeLensCache } from 'vs/editor/contrib/codelens/browser/codeLensCache';\nimport { CodeLensHelper, CodeLensWidget } from 'vs/editor/contrib/codelens/browser/codelensWidget';\nimport { localize } from 'vs/nls';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class CodeLensContribution implements IEditorContribution {\n\n\tstatic readonly ID: string = 'css.editor.codeLens';\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _localToDispose = new DisposableStore();\n\tprivate readonly _styleElement: HTMLStyleElement;\n\tprivate readonly _styleClassName: string;\n\tprivate readonly _lenses: CodeLensWidget[] = [];\n\n\tprivate readonly _provideCodeLensDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesDebounce: IFeatureDebounceInformation;\n\tprivate readonly _resolveCodeLensesScheduler: RunOnceScheduler;\n\n\tprivate _getCodeLensModelPromise: CancelablePromise<CodeLensModel> | undefined;\n\tprivate _oldCodeLensModels = new DisposableStore();\n\tprivate _currentCodeLensModel: CodeLensModel | undefined;\n\tprivate _resolveCodeLensesPromise: CancelablePromise<any> | undefined;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService debounceService: ILanguageFeatureDebounceService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@ICodeLensCache private readonly _codeLensCache: ICodeLensCache\n\t) {\n\t\tthis._provideCodeLensDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensProvide', { min: 250 });\n\t\tthis._resolveCodeLensesDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, 'CodeLensResolve', { min: 250, salt: 'resolve' });\n\t\tthis._resolveCodeLensesScheduler = new RunOnceScheduler(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default());\n\n\t\tthis._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange()));\n\t\tthis._disposables.add(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.codeLensFontSize) || e.hasChanged(EditorOption.codeLensFontFamily)) {\n\t\t\t\tthis._updateLensStyle();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.codeLens)) {\n\t\t\t\tthis._onModelChange();\n\t\t\t}\n\t\t}));\n\t\tthis._disposables.add(_languageFeaturesService.codeLensProvider.onDidChange(this._onModelChange, this));\n\t\tthis._onModelChange();\n\n\t\tthis._styleClassName = '_' + hash(this._editor.getId()).toString(16);\n\t\tthis._styleElement = dom.createStyleSheet(\n\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t: undefined\n\t\t);\n\t\tthis._updateLensStyle();\n\t}\n\n\tdispose(): void {\n\t\tthis._localDispose();\n\t\tthis._disposables.dispose();\n\t\tthis._oldCodeLensModels.dispose();\n\t\tthis._currentCodeLensModel?.dispose();\n\t\tthis._styleElement.remove();\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tlet fontSize = this._editor.getOption(EditorOption.codeLensFontSize);\n\t\tlet codeLensHeight: number;\n\t\tif (!fontSize || fontSize < 5) {\n\t\t\tfontSize = (this._editor.getOption(EditorOption.fontSize) * .9) | 0;\n\t\t\tcodeLensHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\t} else {\n\t\t\tcodeLensHeight = (fontSize * Math.max(1.3, this._editor.getOption(EditorOption.lineHeight) / this._editor.getOption(EditorOption.fontSize))) | 0;\n\t\t}\n\t\treturn { codeLensHeight, fontSize };\n\t}\n\n\tprivate _updateLensStyle(): void {\n\n\t\tconst { codeLensHeight, fontSize } = this._getLayoutInfo();\n\t\tconst fontFamily = this._editor.getOption(EditorOption.codeLensFontFamily);\n\t\tconst editorFontInfo = this._editor.getOption(EditorOption.fontInfo);\n\n\t\tconst fontFamilyVar = `--codelens-font-family${this._styleClassName}`;\n\t\tconst fontFeaturesVar = `--codelens-font-features${this._styleClassName}`;\n\n\t\tlet newStyle = `\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${codeLensHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontSize * 0.5)}px; font-feature-settings: var(${fontFeaturesVar}) }\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${codeLensHeight}px; font-size: ${fontSize}px; }\n\t\t`;\n\t\tif (fontFamily) {\n\t\t\tnewStyle += `.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}}`;\n\t\t}\n\t\tthis._styleElement.textContent = newStyle;\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily ?? 'inherit');\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFeaturesVar, editorFontInfo.fontFeatureSettings);\n\n\t\t//\n\t\tthis._editor.changeViewZones(accessor => {\n\t\t\tfor (let lens of this._lenses) {\n\t\t\t\tlens.updateHeight(codeLensHeight, accessor);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _localDispose(): void {\n\t\tthis._getCodeLensModelPromise?.cancel();\n\t\tthis._getCodeLensModelPromise = undefined;\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\t\tthis._localToDispose.clear();\n\t\tthis._oldCodeLensModels.clear();\n\t\tthis._currentCodeLensModel?.dispose();\n\t}\n\n\tprivate _onModelChange(): void {\n\n\t\tthis._localDispose();\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.codeLens)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cachedLenses = this._codeLensCache.get(model);\n\t\tif (cachedLenses) {\n\t\t\tthis._renderCodeLensSymbols(cachedLenses);\n\t\t}\n\n\t\tif (!this._languageFeaturesService.codeLensProvider.has(model)) {\n\t\t\t// no provider -> return but check with\n\t\t\t// cached lenses. they expire after 30 seconds\n\t\t\tif (cachedLenses) {\n\t\t\t\tthis._localToDispose.add(disposableTimeout(() => {\n\t\t\t\t\tconst cachedLensesNow = this._codeLensCache.get(model);\n\t\t\t\t\tif (cachedLenses === cachedLensesNow) {\n\t\t\t\t\t\tthis._codeLensCache.delete(model);\n\t\t\t\t\t\tthis._onModelChange();\n\t\t\t\t\t}\n\t\t\t\t}, 30 * 1000));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const provider of this._languageFeaturesService.codeLensProvider.all(model)) {\n\t\t\tif (typeof provider.onDidChange === 'function') {\n\t\t\t\tlet registration = provider.onDidChange(() => scheduler.schedule());\n\t\t\t\tthis._localToDispose.add(registration);\n\t\t\t}\n\t\t}\n\n\t\tconst scheduler = new RunOnceScheduler(() => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tthis._getCodeLensModelPromise?.cancel();\n\t\t\tthis._getCodeLensModelPromise = createCancelablePromise(token => getCodeLensModel(this._languageFeaturesService.codeLensProvider, model, token));\n\n\t\t\tthis._getCodeLensModelPromise.then(result => {\n\t\t\t\tif (this._currentCodeLensModel) {\n\t\t\t\t\tthis._oldCodeLensModels.add(this._currentCodeLensModel);\n\t\t\t\t}\n\t\t\t\tthis._currentCodeLensModel = result;\n\n\t\t\t\t// cache model to reduce flicker\n\t\t\t\tthis._codeLensCache.put(model, result);\n\n\t\t\t\t// update moving average\n\t\t\t\tconst newDelay = this._provideCodeLensDebounce.update(model, Date.now() - t1);\n\t\t\t\tscheduler.delay = newDelay;\n\n\t\t\t\t// render lenses\n\t\t\t\tthis._renderCodeLensSymbols(result);\n\t\t\t\t// dom.scheduleAtNextAnimationFrame(() => this._resolveCodeLensesInViewport());\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}, onUnexpectedError);\n\n\t\t}, this._provideCodeLensDebounce.get(model));\n\n\t\tthis._localToDispose.add(scheduler);\n\t\tthis._localToDispose.add(toDisposable(() => this._resolveCodeLensesScheduler.cancel()));\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\tlet toDispose: CodeLensWidget[] = [];\n\t\t\t\t\tlet lastLensLineNumber: number = -1;\n\n\t\t\t\t\tthis._lenses.forEach((lens) => {\n\t\t\t\t\t\tif (!lens.isValid() || lastLensLineNumber === lens.getLineNumber()) {\n\t\t\t\t\t\t\t// invalid -> lens collapsed, attach range doesn't exist anymore\n\t\t\t\t\t\t\t// line_number -> lenses should never be on the same line\n\t\t\t\t\t\t\ttoDispose.push(lens);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlens.update(viewZonesAccessor);\n\t\t\t\t\t\t\tlastLensLineNumber = lens.getLineNumber();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tlet helper = new CodeLensHelper();\n\t\t\t\t\ttoDispose.forEach((l) => {\n\t\t\t\t\t\tl.dispose(helper, viewZonesAccessor);\n\t\t\t\t\t\tthis._lenses.splice(this._lenses.indexOf(l), 1);\n\t\t\t\t\t});\n\t\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ask for all references again\n\t\t\tscheduler.schedule();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidFocusEditorWidget(() => {\n\t\t\tscheduler.schedule();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidScrollChange(e => {\n\t\t\tif (e.scrollTopChanged && this._lenses.length > 0) {\n\t\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidLayoutChange(() => {\n\t\t\tthis._resolveCodeLensesInViewportSoon();\n\t\t}));\n\t\tthis._localToDispose.add(toDisposable(() => {\n\t\t\tif (this._editor.getModel()) {\n\t\t\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\t\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\t\t\tthis._editor.changeViewZones(viewZonesAccessor => {\n\t\t\t\t\t\tthis._disposeAllLenses(decorationsAccessor, viewZonesAccessor);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tscrollState.restore(this._editor);\n\t\t\t} else {\n\t\t\t\t// No accessors available\n\t\t\t\tthis._disposeAllLenses(undefined, undefined);\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onMouseDown(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_WIDGET) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet target = e.target.element;\n\t\t\tif (target?.tagName === 'SPAN') {\n\t\t\t\ttarget = target.parentElement;\n\t\t\t}\n\t\t\tif (target?.tagName === 'A') {\n\t\t\t\tfor (const lens of this._lenses) {\n\t\t\t\t\tlet command = lens.getCommand(target as HTMLLinkElement);\n\t\t\t\t\tif (command) {\n\t\t\t\t\t\tthis._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tscheduler.schedule();\n\t}\n\n\tprivate _disposeAllLenses(decChangeAccessor: IModelDecorationsChangeAccessor | undefined, viewZoneChangeAccessor: IViewZoneChangeAccessor | undefined): void {\n\t\tconst helper = new CodeLensHelper();\n\t\tfor (const lens of this._lenses) {\n\t\t\tlens.dispose(helper, viewZoneChangeAccessor);\n\t\t}\n\t\tif (decChangeAccessor) {\n\t\t\thelper.commit(decChangeAccessor);\n\t\t}\n\t\tthis._lenses.length = 0;\n\t}\n\n\tprivate _renderCodeLensSymbols(symbols: CodeLensModel): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet maxLineNumber = this._editor.getModel().getLineCount();\n\t\tlet groups: CodeLensItem[][] = [];\n\t\tlet lastGroup: CodeLensItem[] | undefined;\n\n\t\tfor (let symbol of symbols.lenses) {\n\t\t\tlet line = symbol.symbol.range.startLineNumber;\n\t\t\tif (line < 1 || line > maxLineNumber) {\n\t\t\t\t// invalid code lens\n\t\t\t\tcontinue;\n\t\t\t} else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) {\n\t\t\t\t// on same line as previous\n\t\t\t\tlastGroup.push(symbol);\n\t\t\t} else {\n\t\t\t\t// on later line as previous\n\t\t\t\tlastGroup = [symbol];\n\t\t\t\tgroups.push(lastGroup);\n\t\t\t}\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\t\tconst layoutInfo = this._getLayoutInfo();\n\n\t\tthis._editor.changeDecorations(decorationsAccessor => {\n\t\t\tthis._editor.changeViewZones(viewZoneAccessor => {\n\n\t\t\t\tconst helper = new CodeLensHelper();\n\t\t\t\tlet codeLensIndex = 0;\n\t\t\t\tlet groupsIndex = 0;\n\n\t\t\t\twhile (groupsIndex < groups.length && codeLensIndex < this._lenses.length) {\n\n\t\t\t\t\tlet symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber;\n\t\t\t\t\tlet codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber();\n\n\t\t\t\t\tif (codeLensLineNumber < symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t\t} else if (codeLensLineNumber === symbolsLineNumber) {\n\t\t\t\t\t\tthis._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper);\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, this._styleClassName, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\t\tcodeLensIndex++;\n\t\t\t\t\t\tgroupsIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Delete extra code lenses\n\t\t\t\twhile (codeLensIndex < this._lenses.length) {\n\t\t\t\t\tthis._lenses[codeLensIndex].dispose(helper, viewZoneAccessor);\n\t\t\t\t\tthis._lenses.splice(codeLensIndex, 1);\n\t\t\t\t}\n\n\t\t\t\t// Create extra symbols\n\t\t\t\twhile (groupsIndex < groups.length) {\n\t\t\t\t\tthis._lenses.push(new CodeLensWidget(groups[groupsIndex], <IActiveCodeEditor>this._editor, this._styleClassName, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon()));\n\t\t\t\t\tgroupsIndex++;\n\t\t\t\t}\n\n\t\t\t\thelper.commit(decorationsAccessor);\n\t\t\t});\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _resolveCodeLensesInViewportSoon(): void {\n\t\tconst model = this._editor.getModel();\n\t\tif (model) {\n\t\t\tthis._resolveCodeLensesScheduler.schedule();\n\t\t}\n\t}\n\n\tprivate _resolveCodeLensesInViewport(): void {\n\n\t\tthis._resolveCodeLensesPromise?.cancel();\n\t\tthis._resolveCodeLensesPromise = undefined;\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toResolve: CodeLensItem[][] = [];\n\t\tconst lenses: CodeLensWidget[] = [];\n\t\tthis._lenses.forEach((lens) => {\n\t\t\tconst request = lens.computeIfNecessary(model);\n\t\t\tif (request) {\n\t\t\t\ttoResolve.push(request);\n\t\t\t\tlenses.push(lens);\n\t\t\t}\n\t\t});\n\n\t\tif (toResolve.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst t1 = Date.now();\n\n\t\tconst resolvePromise = createCancelablePromise(token => {\n\n\t\t\tconst promises = toResolve.map((request, i) => {\n\n\t\t\t\tconst resolvedSymbols = new Array<CodeLens | undefined | null>(request.length);\n\t\t\t\tconst promises = request.map((request, i) => {\n\t\t\t\t\tif (!request.symbol.command && typeof request.provider.resolveCodeLens === 'function') {\n\t\t\t\t\t\treturn Promise.resolve(request.provider.resolveCodeLens(model, request.symbol, token)).then(symbol => {\n\t\t\t\t\t\t\tresolvedSymbols[i] = symbol;\n\t\t\t\t\t\t}, onUnexpectedExternalError);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolvedSymbols[i] = request.symbol;\n\t\t\t\t\t\treturn Promise.resolve(undefined);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn Promise.all(promises).then(() => {\n\t\t\t\t\tif (!token.isCancellationRequested && !lenses[i].isDisposed()) {\n\t\t\t\t\t\tlenses[i].updateCommands(resolvedSymbols);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(promises);\n\t\t});\n\t\tthis._resolveCodeLensesPromise = resolvePromise;\n\n\t\tthis._resolveCodeLensesPromise.then(() => {\n\n\t\t\t// update moving average\n\t\t\tconst newDelay = this._resolveCodeLensesDebounce.update(model, Date.now() - t1);\n\t\t\tthis._resolveCodeLensesScheduler.delay = newDelay;\n\n\t\t\tif (this._currentCodeLensModel) { // update the cached state with new resolved items\n\t\t\t\tthis._codeLensCache.put(model, this._currentCodeLensModel);\n\t\t\t}\n\t\t\tthis._oldCodeLensModels.clear(); // dispose old models once we have updated the UI with the current model\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t}, err => {\n\t\t\tonUnexpectedError(err); // can also be cancellation!\n\t\t\tif (resolvePromise === this._resolveCodeLensesPromise) {\n\t\t\t\tthis._resolveCodeLensesPromise = undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\tgetModel(): CodeLensModel | undefined {\n\t\treturn this._currentCodeLensModel;\n\t}\n}\n\nregisterEditorContribution(CodeLensContribution.ID, CodeLensContribution);\n\nregisterEditorAction(class ShowLensesInCurrentLine extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'codelens.showLensesInCurrentLine',\n\t\t\tprecondition: EditorContextKeys.hasCodeLensProvider,\n\t\t\tlabel: localize('showLensOnLine', \"Show CodeLens Commands For Current Line\"),\n\t\t\talias: 'Show CodeLens Commands For Current Line',\n\t\t});\n\t}\n\n\tasync run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\tconst commandService = accessor.get(ICommandService);\n\t\tconst notificationService = accessor.get(INotificationService);\n\n\t\tconst lineNumber = editor.getSelection().positionLineNumber;\n\t\tconst codelensController = editor.getContribution<CodeLensContribution>(CodeLensContribution.ID);\n\t\tif (!codelensController) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = codelensController.getModel();\n\t\tif (!model) {\n\t\t\t// nothing\n\t\t\treturn;\n\t\t}\n\n\t\tconst items: { label: string; command: Command }[] = [];\n\t\tfor (const lens of model.lenses) {\n\t\t\tif (lens.symbol.command && lens.symbol.range.startLineNumber === lineNumber) {\n\t\t\t\titems.push({\n\t\t\t\t\tlabel: lens.symbol.command.title,\n\t\t\t\t\tcommand: lens.symbol.command\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (items.length === 0) {\n\t\t\t// We dont want an empty picker\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = await quickInputService.pick(items, { canPickMany: false });\n\t\tif (!item) {\n\t\t\t// Nothing picked\n\t\t\treturn;\n\t\t}\n\n\t\tif (model.isDisposed) {\n\t\t\t// retry whenever the model has been disposed\n\t\t\treturn await commandService.executeCommand(this.id);\n\t\t}\n\n\t\ttry {\n\t\t\tawait commandService.executeCommand(item.command.id, ...(item.command.arguments || []));\n\t\t} catch (err) {\n\t\t\tnotificationService.error(err);\n\t\t}\n\t}\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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from 'vs/base/common/async';\nimport { RGBA } from 'vs/base/common/color';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { noBreakWhitespace } from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { DynamicCssRules } from 'vs/editor/browser/editorDom';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { getColors, IColorData } from 'vs/editor/contrib/colorPicker/browser/color';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\nconst MAX_DECORATORS = 500;\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate _colorDecoratorIds: ReadonlySet<string> = new Set<string>();\n\n\tprivate _isEnabled: boolean;\n\n\tprivate readonly _ruleFactory = new DynamicCssRules(this._editor);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isEnabled = this.isEnabled();\n\t\t\tthis.onModelChanged();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.onModelChanged()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.onModelChanged()));\n\t\tthis._register(_editor.onDidChangeConfiguration(() => {\n\t\t\tlet prevIsEnabled = this._isEnabled;\n\t\t\tthis._isEnabled = this.isEnabled();\n\t\t\tif (prevIsEnabled !== this._isEnabled) {\n\t\t\t\tif (this._isEnabled) {\n\t\t\t\t\tthis.onModelChanged();\n\t\t\t\t} else {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isEnabled = this.isEnabled();\n\t\tthis.onModelChanged();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate onModelChanged(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate beginCompute(): void {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn Promise.resolve([]);\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\tthis._computePromise.then((colorInfos) => {\n\t\t\tthis.updateDecorations(colorInfos);\n\t\t\tthis.updateColorDecorators(colorInfos);\n\t\t\tthis._computePromise = null;\n\t\t}, onUnexpectedError);\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._decorationsIds = this._editor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t}\n\n\tprivate _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tlet decorations: IModelDeltaDecoration[] = [];\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < MAX_DECORATORS; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tlet color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis._colorDecoratorIds = new Set(this._editor.deltaDecorations([...this._colorDecoratorIds], decorations));\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._decorationsIds = this._editor.deltaDecorations(this._decorationsIds, []);\n\t\tthis._colorDecoratorIds = new Set(this._editor.deltaDecorations([...this._colorDecoratorIds], []));\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecorationId(decorationId: string): boolean {\n\t\treturn this._colorDecoratorIds.has(decorationId);\n\t}\n}\n\nregisterEditorContribution(ColorDetector.ID, ColorDetector);\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 { AsyncIterableObject } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { DocumentColorProvider, IColorInformation } from 'vs/editor/common/languages';\nimport { getColorPresentations } from 'vs/editor/contrib/colorPicker/browser/color';\nimport { ColorDetector } from 'vs/editor/contrib/colorPicker/browser/colorDetector';\nimport { ColorPickerModel } from 'vs/editor/contrib/colorPicker/browser/colorPickerModel';\nimport { ColorPickerWidget } from 'vs/editor/contrib/colorPicker/browser/colorPickerWidget';\nimport { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\n\nexport class ColorHover implements IHoverPart {\n\n\t/**\n\t * Force the hover to always be rendered at this specific range,\n\t * even in the case of multiple hover parts.\n\t */\n\tpublic readonly forceShowAtRange: boolean = true;\n\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<ColorHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly model: ColorPickerModel,\n\t\tpublic readonly provider: DocumentColorProvider\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n}\n\nexport class ColorHoverParticipant implements IEditorHoverParticipant<ColorHover> {\n\n\tpublic readonly hoverOrdinal: number = 1;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) { }\n\n\tpublic computeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): ColorHover[] {\n\t\treturn [];\n\t}\n\n\tpublic computeAsync(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject<ColorHover> {\n\t\treturn AsyncIterableObject.fromPromise(this._computeAsync(anchor, lineDecorations, token));\n\t}\n\n\tprivate async _computeAsync(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): Promise<ColorHover[]> {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn [];\n\t\t}\n\t\tconst colorDetector = ColorDetector.get(this._editor);\n\t\tif (!colorDetector) {\n\t\t\treturn [];\n\t\t}\n\t\tfor (const d of lineDecorations) {\n\t\t\tif (!colorDetector.isColorDecorationId(d.id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst colorData = colorDetector.getColorData(d.range.getStartPosition());\n\t\t\tif (colorData) {\n\t\t\t\tconst colorHover = await this._createColorHover(this._editor.getModel(), colorData.colorInfo, colorData.provider);\n\t\t\t\treturn [colorHover];\n\t\t\t}\n\n\t\t}\n\t\treturn [];\n\t}\n\n\tprivate async _createColorHover(editorModel: ITextModel, colorInfo: IColorInformation, provider: DocumentColorProvider): Promise<ColorHover> {\n\t\tconst originalText = editorModel.getValueInRange(colorInfo.range);\n\t\tconst { red, green, blue, alpha } = colorInfo.color;\n\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\tconst color = new Color(rgba);\n\n\t\tconst colorPresentations = await getColorPresentations(editorModel, colorInfo, provider, CancellationToken.None);\n\t\tconst model = new ColorPickerModel(color, [], 0);\n\t\tmodel.colorPresentations = colorPresentations || [];\n\t\tmodel.guessColorPresentation(color, originalText);\n\n\t\treturn new ColorHover(this, Range.lift(colorInfo.range), model, provider);\n\t}\n\n\tpublic renderHoverParts(context: IEditorHoverRenderContext, hoverParts: ColorHover[]): IDisposable {\n\t\tif (hoverParts.length === 0 || !this._editor.hasModel()) {\n\t\t\treturn Disposable.None;\n\t\t}\n\n\t\tconst disposables = new DisposableStore();\n\t\tconst colorHover = hoverParts[0];\n\t\tconst editorModel = this._editor.getModel();\n\t\tconst model = colorHover.model;\n\t\tconst widget = disposables.add(new ColorPickerWidget(context.fragment, model, this._editor.getOption(EditorOption.pixelRatio), this._themeService));\n\t\tcontext.setColorPicker(widget);\n\n\t\tlet range = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn);\n\n\t\tconst updateEditorModel = () => {\n\t\t\tlet textEdits: ISingleEditOperation[];\n\t\t\tlet newRange: Range;\n\t\t\tif (model.presentation.textEdit) {\n\t\t\t\ttextEdits = [model.presentation.textEdit];\n\t\t\t\tnewRange = new Range(\n\t\t\t\t\tmodel.presentation.textEdit.range.startLineNumber,\n\t\t\t\t\tmodel.presentation.textEdit.range.startColumn,\n\t\t\t\t\tmodel.presentation.textEdit.range.endLineNumber,\n\t\t\t\t\tmodel.presentation.textEdit.range.endColumn\n\t\t\t\t);\n\t\t\t\tconst trackedRange = this._editor.getModel()!._setTrackedRange(null, newRange, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter);\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._editor.executeEdits('colorpicker', textEdits);\n\t\t\t\tnewRange = this._editor.getModel()!._getTrackedRange(trackedRange) || newRange;\n\t\t\t} else {\n\t\t\t\ttextEdits = [{ range, text: model.presentation.label, forceMoveMarkers: false }];\n\t\t\t\tnewRange = range.setEndPosition(range.endLineNumber, range.startColumn + model.presentation.label.length);\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._editor.executeEdits('colorpicker', textEdits);\n\t\t\t}\n\n\t\t\tif (model.presentation.additionalTextEdits) {\n\t\t\t\ttextEdits = [...model.presentation.additionalTextEdits];\n\t\t\t\tthis._editor.executeEdits('colorpicker', textEdits);\n\t\t\t\tcontext.hide();\n\t\t\t}\n\t\t\tthis._editor.pushUndoStop();\n\t\t\trange = newRange;\n\t\t};\n\n\t\tconst updateColorPresentations = (color: Color) => {\n\t\t\treturn getColorPresentations(editorModel, {\n\t\t\t\trange: range,\n\t\t\t\tcolor: {\n\t\t\t\t\tred: color.rgba.r / 255,\n\t\t\t\t\tgreen: color.rgba.g / 255,\n\t\t\t\t\tblue: color.rgba.b / 255,\n\t\t\t\t\talpha: color.rgba.a\n\t\t\t\t}\n\t\t\t}, colorHover.provider, CancellationToken.None).then((colorPresentations) => {\n\t\t\t\tmodel.colorPresentations = colorPresentations || [];\n\t\t\t});\n\t\t};\n\n\t\tdisposables.add(model.onColorFlushed((color: Color) => {\n\t\t\tupdateColorPresentations(color).then(updateEditorModel);\n\t\t}));\n\t\tdisposables.add(model.onDidChangeColor(updateColorPresentations));\n\n\t\treturn disposables;\n\t}\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport 'vs/css!./dnd';\nimport { ICodeEditor, IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorChangeReason } from 'vs/editor/common/cursorEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { DragAndDropCommand } from 'vs/editor/contrib/dnd/browser/dragAndDropCommand';\n\nfunction hasTriggerModifier(e: IKeyboardEvent | IMouseEvent): boolean {\n\tif (isMacintosh) {\n\t\treturn e.altKey;\n\t} else {\n\t\treturn e.ctrlKey;\n\t}\n}\n\nexport class DragAndDropController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.dragAndDrop';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _dragSelection: Selection | null;\n\tprivate _dndDecorationIds: string[];\n\tprivate _mouseDown: boolean;\n\tprivate _modifierPressed: boolean;\n\tstatic readonly TRIGGER_KEY_VALUE = isMacintosh ? KeyCode.Alt : KeyCode.Ctrl;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._register(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._register(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));\n\t\tthis._register(this._editor.onMouseDrag((e: IEditorMouseEvent) => this._onEditorMouseDrag(e)));\n\t\tthis._register(this._editor.onMouseDrop((e: IPartialEditorMouseEvent) => this._onEditorMouseDrop(e)));\n\t\tthis._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled()));\n\t\tthis._register(this._editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e)));\n\t\tthis._register(this._editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e)));\n\t\tthis._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur()));\n\t\tthis._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur()));\n\t\tthis._dndDecorationIds = [];\n\t\tthis._mouseDown = false;\n\t\tthis._modifierPressed = false;\n\t\tthis._dragSelection = null;\n\t}\n\n\tprivate onEditorBlur() {\n\t\tthis._removeDecoration();\n\t\tthis._dragSelection = null;\n\t\tthis._mouseDown = false;\n\t\tthis._modifierPressed = false;\n\t}\n\n\tprivate onEditorKeyDown(e: IKeyboardEvent): void {\n\t\tif (!this._editor.getOption(EditorOption.dragAndDrop) || this._editor.getOption(EditorOption.columnSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hasTriggerModifier(e)) {\n\t\t\tthis._modifierPressed = true;\n\t\t}\n\n\t\tif (this._mouseDown && hasTriggerModifier(e)) {\n\t\t\tthis._editor.updateOptions({\n\t\t\t\tmouseStyle: 'copy'\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate onEditorKeyUp(e: IKeyboardEvent): void {\n\t\tif (!this._editor.getOption(EditorOption.dragAndDrop) || this._editor.getOption(EditorOption.columnSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hasTriggerModifier(e)) {\n\t\t\tthis._modifierPressed = false;\n\t\t}\n\n\t\tif (this._mouseDown && e.keyCode === DragAndDropController.TRIGGER_KEY_VALUE) {\n\t\t\tthis._editor.updateOptions({\n\t\t\t\tmouseStyle: 'default'\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tthis._mouseDown = true;\n\t}\n\n\tprivate _onEditorMouseUp(mouseEvent: IEditorMouseEvent): void {\n\t\tthis._mouseDown = false;\n\t\t// Whenever users release the mouse, the drag and drop operation should finish and the cursor should revert to text.\n\t\tthis._editor.updateOptions({\n\t\t\tmouseStyle: 'text'\n\t\t});\n\t}\n\n\tprivate _onEditorMouseDrag(mouseEvent: IEditorMouseEvent): void {\n\t\tlet target = mouseEvent.target;\n\n\t\tif (this._dragSelection === null) {\n\t\t\tconst selections = this._editor.getSelections() || [];\n\t\t\tlet possibleSelections = selections.filter(selection => target.position && selection.containsPosition(target.position));\n\t\t\tif (possibleSelections.length === 1) {\n\t\t\t\tthis._dragSelection = possibleSelections[0];\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (hasTriggerModifier(mouseEvent.event)) {\n\t\t\tthis._editor.updateOptions({\n\t\t\t\tmouseStyle: 'copy'\n\t\t\t});\n\t\t} else {\n\t\t\tthis._editor.updateOptions({\n\t\t\t\tmouseStyle: 'default'\n\t\t\t});\n\t\t}\n\n\t\tif (target.position) {\n\t\t\tif (this._dragSelection.containsPosition(target.position)) {\n\t\t\t\tthis._removeDecoration();\n\t\t\t} else {\n\t\t\t\tthis.showAt(target.position);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDropCanceled() {\n\t\tthis._editor.updateOptions({\n\t\t\tmouseStyle: 'text'\n\t\t});\n\n\t\tthis._removeDecoration();\n\t\tthis._dragSelection = null;\n\t\tthis._mouseDown = false;\n\t}\n\n\tprivate _onEditorMouseDrop(mouseEvent: IPartialEditorMouseEvent): void {\n\t\tif (mouseEvent.target && (this._hitContent(mouseEvent.target) || this._hitMargin(mouseEvent.target)) && mouseEvent.target.position) {\n\t\t\tlet newCursorPosition = new Position(mouseEvent.target.position.lineNumber, mouseEvent.target.position.column);\n\n\t\t\tif (this._dragSelection === null) {\n\t\t\t\tlet newSelections: Selection[] | null = null;\n\t\t\t\tif (mouseEvent.event.shiftKey) {\n\t\t\t\t\tlet primarySelection = this._editor.getSelection();\n\t\t\t\t\tif (primarySelection) {\n\t\t\t\t\t\tconst { selectionStartLineNumber, selectionStartColumn } = primarySelection;\n\t\t\t\t\t\tnewSelections = [new Selection(selectionStartLineNumber, selectionStartColumn, newCursorPosition.lineNumber, newCursorPosition.column)];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnewSelections = (this._editor.getSelections() || []).map(selection => {\n\t\t\t\t\t\tif (selection.containsPosition(newCursorPosition)) {\n\t\t\t\t\t\t\treturn new Selection(newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn selection;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// Use `mouse` as the source instead of `api` and setting the reason to explicit (to behave like any other mouse operation).\n\t\t\t\t(<CodeEditorWidget>this._editor).setSelections(newSelections || [], 'mouse', CursorChangeReason.Explicit);\n\t\t\t} else if (!this._dragSelection.containsPosition(newCursorPosition) ||\n\t\t\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\thasTriggerModifier(mouseEvent.event) ||\n\t\t\t\t\t\tthis._modifierPressed\n\t\t\t\t\t) && (\n\t\t\t\t\t\tthis._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition)\n\t\t\t\t\t) // we allow users to paste content beside the selection\n\t\t\t\t)) {\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._editor.executeCommand(DragAndDropController.ID, new DragAndDropCommand(this._dragSelection, newCursorPosition, hasTriggerModifier(mouseEvent.event) || this._modifierPressed));\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.updateOptions({\n\t\t\tmouseStyle: 'text'\n\t\t});\n\n\t\tthis._removeDecoration();\n\t\tthis._dragSelection = null;\n\t\tthis._mouseDown = false;\n\t}\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'dnd-target',\n\t\tclassName: 'dnd-target'\n\t});\n\n\tpublic showAt(position: Position): void {\n\t\tlet newDecorations: IModelDeltaDecoration[] = [{\n\t\t\trange: new Range(position.lineNumber, position.column, position.lineNumber, position.column),\n\t\t\toptions: DragAndDropController._DECORATION_OPTIONS\n\t\t}];\n\n\t\tthis._dndDecorationIds = this._editor.deltaDecorations(this._dndDecorationIds, newDecorations);\n\t\tthis._editor.revealPosition(position, ScrollType.Immediate);\n\t}\n\n\tprivate _removeDecoration(): void {\n\t\tthis._dndDecorationIds = this._editor.deltaDecorations(this._dndDecorationIds, []);\n\t}\n\n\tprivate _hitContent(target: IMouseTarget): boolean {\n\t\treturn target.type === MouseTargetType.CONTENT_TEXT ||\n\t\t\ttarget.type === MouseTargetType.CONTENT_EMPTY;\n\t}\n\n\tprivate _hitMargin(target: IMouseTarget): boolean {\n\t\treturn target.type === MouseTargetType.GUTTER_GLYPH_MARGIN ||\n\t\t\ttarget.type === MouseTargetType.GUTTER_LINE_NUMBERS ||\n\t\t\ttarget.type === MouseTargetType.GUTTER_LINE_DECORATIONS;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._removeDecoration();\n\t\tthis._dragSelection = null;\n\t\tthis._mouseDown = false;\n\t\tthis._modifierPressed = false;\n\t\tsuper.dispose();\n\t}\n}\n\nregisterEditorContribution(DragAndDropController.ID, DragAndDropController);\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { FindMatch, IModelDecorationsChangeAccessor, IModelDeltaDecoration, MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { minimapFindMatch, overviewRulerFindMatchForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { themeColorFromId } from 'vs/platform/theme/common/themeService';\n\nexport class FindDecorations implements IDisposable {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate _decorations: string[];\n\tprivate _overviewRulerApproximateDecorations: string[];\n\tprivate _findScopeDecorationIds: string[];\n\tprivate _rangeHighlightDecorationId: string | null;\n\tprivate _highlightedDecorationId: string | null;\n\tprivate _startPosition: Position;\n\n\tconstructor(editor: IActiveCodeEditor) {\n\t\tthis._editor = editor;\n\t\tthis._decorations = [];\n\t\tthis._overviewRulerApproximateDecorations = [];\n\t\tthis._findScopeDecorationIds = [];\n\t\tthis._rangeHighlightDecorationId = null;\n\t\tthis._highlightedDecorationId = null;\n\t\tthis._startPosition = this._editor.getPosition();\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._editor.deltaDecorations(this._allDecorations(), []);\n\n\t\tthis._decorations = [];\n\t\tthis._overviewRulerApproximateDecorations = [];\n\t\tthis._findScopeDecorationIds = [];\n\t\tthis._rangeHighlightDecorationId = null;\n\t\tthis._highlightedDecorationId = null;\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorations = [];\n\t\tthis._overviewRulerApproximateDecorations = [];\n\t\tthis._findScopeDecorationIds = [];\n\t\tthis._rangeHighlightDecorationId = null;\n\t\tthis._highlightedDecorationId = null;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._decorations.length;\n\t}\n\n\t/** @deprecated use getFindScopes to support multiple selections */\n\tpublic getFindScope(): Range | null {\n\t\tif (this._findScopeDecorationIds[0]) {\n\t\t\treturn this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getFindScopes(): Range[] | null {\n\t\tif (this._findScopeDecorationIds.length) {\n\t\t\tconst scopes = this._findScopeDecorationIds.map(findScopeDecorationId =>\n\t\t\t\tthis._editor.getModel().getDecorationRange(findScopeDecorationId)\n\t\t\t).filter(element => !!element);\n\t\t\tif (scopes.length) {\n\t\t\t\treturn scopes as Range[];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getStartPosition(): Position {\n\t\treturn this._startPosition;\n\t}\n\n\tpublic setStartPosition(newStartPosition: Position): void {\n\t\tthis._startPosition = newStartPosition;\n\t\tthis.setCurrentFindMatch(null);\n\t}\n\n\tprivate _getDecorationIndex(decorationId: string): number {\n\t\tconst index = this._decorations.indexOf(decorationId);\n\t\tif (index >= 0) {\n\t\t\treturn index + 1;\n\t\t}\n\t\treturn 1;\n\t}\n\n\tpublic getCurrentMatchesPosition(desiredRange: Range): number {\n\t\tlet candidates = this._editor.getModel().getDecorationsInRange(desiredRange);\n\t\tfor (const candidate of candidates) {\n\t\t\tconst candidateOpts = candidate.options;\n\t\t\tif (candidateOpts === FindDecorations._FIND_MATCH_DECORATION || candidateOpts === FindDecorations._CURRENT_FIND_MATCH_DECORATION) {\n\t\t\t\treturn this._getDecorationIndex(candidate.id);\n\t\t\t}\n\t\t}\n\t\t// We don't know the current match position, so returns zero to show '?' in find widget\n\t\treturn 0;\n\t}\n\n\tpublic setCurrentFindMatch(nextMatch: Range | null): number {\n\t\tlet newCurrentDecorationId: string | null = null;\n\t\tlet matchPosition = 0;\n\t\tif (nextMatch) {\n\t\t\tfor (let i = 0, len = this._decorations.length; i < len; i++) {\n\t\t\t\tlet range = this._editor.getModel().getDecorationRange(this._decorations[i]);\n\t\t\t\tif (nextMatch.equalsRange(range)) {\n\t\t\t\t\tnewCurrentDecorationId = this._decorations[i];\n\t\t\t\t\tmatchPosition = (i + 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this._highlightedDecorationId !== null || newCurrentDecorationId !== null) {\n\t\t\tthis._editor.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => {\n\t\t\t\tif (this._highlightedDecorationId !== null) {\n\t\t\t\t\tchangeAccessor.changeDecorationOptions(this._highlightedDecorationId, FindDecorations._FIND_MATCH_DECORATION);\n\t\t\t\t\tthis._highlightedDecorationId = null;\n\t\t\t\t}\n\t\t\t\tif (newCurrentDecorationId !== null) {\n\t\t\t\t\tthis._highlightedDecorationId = newCurrentDecorationId;\n\t\t\t\t\tchangeAccessor.changeDecorationOptions(this._highlightedDecorationId, FindDecorations._CURRENT_FIND_MATCH_DECORATION);\n\t\t\t\t}\n\t\t\t\tif (this._rangeHighlightDecorationId !== null) {\n\t\t\t\t\tchangeAccessor.removeDecoration(this._rangeHighlightDecorationId);\n\t\t\t\t\tthis._rangeHighlightDecorationId = null;\n\t\t\t\t}\n\t\t\t\tif (newCurrentDecorationId !== null) {\n\t\t\t\t\tlet rng = this._editor.getModel().getDecorationRange(newCurrentDecorationId)!;\n\t\t\t\t\tif (rng.startLineNumber !== rng.endLineNumber && rng.endColumn === 1) {\n\t\t\t\t\t\tlet lineBeforeEnd = rng.endLineNumber - 1;\n\t\t\t\t\t\tlet lineBeforeEndMaxColumn = this._editor.getModel().getLineMaxColumn(lineBeforeEnd);\n\t\t\t\t\t\trng = new Range(rng.startLineNumber, rng.startColumn, lineBeforeEnd, lineBeforeEndMaxColumn);\n\t\t\t\t\t}\n\t\t\t\t\tthis._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations._RANGE_HIGHLIGHT_DECORATION);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn matchPosition;\n\t}\n\n\tpublic set(findMatches: FindMatch[], findScopes: Range[] | null): void {\n\t\tthis._editor.changeDecorations((accessor) => {\n\n\t\t\tlet findMatchesOptions: ModelDecorationOptions = FindDecorations._FIND_MATCH_DECORATION;\n\t\t\tlet newOverviewRulerApproximateDecorations: IModelDeltaDecoration[] = [];\n\n\t\t\tif (findMatches.length > 1000) {\n\t\t\t\t// we go into a mode where the overview ruler gets \"approximate\" decorations\n\t\t\t\t// the reason is that the overview ruler paints all the decorations in the file and we don't want to cause freezes\n\t\t\t\tfindMatchesOptions = FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION;\n\n\t\t\t\t// approximate a distance in lines where matches should be merged\n\t\t\t\tconst lineCount = this._editor.getModel().getLineCount();\n\t\t\t\tconst height = this._editor.getLayoutInfo().height;\n\t\t\t\tconst approxPixelsPerLine = height / lineCount;\n\t\t\t\tconst mergeLinesDelta = Math.max(2, Math.ceil(3 / approxPixelsPerLine));\n\n\t\t\t\t// merge decorations as much as possible\n\t\t\t\tlet prevStartLineNumber = findMatches[0].range.startLineNumber;\n\t\t\t\tlet prevEndLineNumber = findMatches[0].range.endLineNumber;\n\t\t\t\tfor (let i = 1, len = findMatches.length; i < len; i++) {\n\t\t\t\t\tconst range = findMatches[i].range;\n\t\t\t\t\tif (prevEndLineNumber + mergeLinesDelta >= range.startLineNumber) {\n\t\t\t\t\t\tif (range.endLineNumber > prevEndLineNumber) {\n\t\t\t\t\t\t\tprevEndLineNumber = range.endLineNumber;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewOverviewRulerApproximateDecorations.push({\n\t\t\t\t\t\t\trange: new Range(prevStartLineNumber, 1, prevEndLineNumber, 1),\n\t\t\t\t\t\t\toptions: FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION\n\t\t\t\t\t\t});\n\t\t\t\t\t\tprevStartLineNumber = range.startLineNumber;\n\t\t\t\t\t\tprevEndLineNumber = range.endLineNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnewOverviewRulerApproximateDecorations.push({\n\t\t\t\t\trange: new Range(prevStartLineNumber, 1, prevEndLineNumber, 1),\n\t\t\t\t\toptions: FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Find matches\n\t\t\tlet newFindMatchesDecorations: IModelDeltaDecoration[] = new Array<IModelDeltaDecoration>(findMatches.length);\n\t\t\tfor (let i = 0, len = findMatches.length; i < len; i++) {\n\t\t\t\tnewFindMatchesDecorations[i] = {\n\t\t\t\t\trange: findMatches[i].range,\n\t\t\t\t\toptions: findMatchesOptions\n\t\t\t\t};\n\t\t\t}\n\t\t\tthis._decorations = accessor.deltaDecorations(this._decorations, newFindMatchesDecorations);\n\n\t\t\t// Overview ruler approximate decorations\n\t\t\tthis._overviewRulerApproximateDecorations = accessor.deltaDecorations(this._overviewRulerApproximateDecorations, newOverviewRulerApproximateDecorations);\n\n\t\t\t// Range highlight\n\t\t\tif (this._rangeHighlightDecorationId) {\n\t\t\t\taccessor.removeDecoration(this._rangeHighlightDecorationId);\n\t\t\t\tthis._rangeHighlightDecorationId = null;\n\t\t\t}\n\n\t\t\t// Find scope\n\t\t\tif (this._findScopeDecorationIds.length) {\n\t\t\t\tthis._findScopeDecorationIds.forEach(findScopeDecorationId => accessor.removeDecoration(findScopeDecorationId));\n\t\t\t\tthis._findScopeDecorationIds = [];\n\t\t\t}\n\t\t\tif (findScopes?.length) {\n\t\t\t\tthis._findScopeDecorationIds = findScopes.map(findScope => accessor.addDecoration(findScope, FindDecorations._FIND_SCOPE_DECORATION));\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic matchBeforePosition(position: Position): Range | null {\n\t\tif (this._decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tfor (let i = this._decorations.length - 1; i >= 0; i--) {\n\t\t\tlet decorationId = this._decorations[i];\n\t\t\tlet r = this._editor.getModel().getDecorationRange(decorationId);\n\t\t\tif (!r || r.endLineNumber > position.lineNumber) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (r.endLineNumber < position.lineNumber) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tif (r.endColumn > position.column) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\treturn this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length - 1]);\n\t}\n\n\tpublic matchAfterPosition(position: Position): Range | null {\n\t\tif (this._decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tfor (let i = 0, len = this._decorations.length; i < len; i++) {\n\t\t\tlet decorationId = this._decorations[i];\n\t\t\tlet r = this._editor.getModel().getDecorationRange(decorationId);\n\t\t\tif (!r || r.startLineNumber < position.lineNumber) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (r.startLineNumber > position.lineNumber) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tif (r.startColumn < position.column) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\treturn this._editor.getModel().getDecorationRange(this._decorations[0]);\n\t}\n\n\tprivate _allDecorations(): string[] {\n\t\tlet result: string[] = [];\n\t\tresult = result.concat(this._decorations);\n\t\tresult = result.concat(this._overviewRulerApproximateDecorations);\n\t\tif (this._findScopeDecorationIds.length) {\n\t\t\tresult.push(...this._findScopeDecorationIds);\n\t\t}\n\t\tif (this._rangeHighlightDecorationId) {\n\t\t\tresult.push(this._rangeHighlightDecorationId);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'current-find-match',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tzIndex: 13,\n\t\tclassName: 'currentFindMatch',\n\t\tshowIfCollapsed: true,\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerFindMatchForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t},\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapFindMatch),\n\t\t\tposition: MinimapPosition.Inline\n\t\t}\n\t});\n\n\tpublic static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'find-match',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tzIndex: 10,\n\t\tclassName: 'findMatch',\n\t\tshowIfCollapsed: true,\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerFindMatchForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t},\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapFindMatch),\n\t\t\tposition: MinimapPosition.Inline\n\t\t}\n\t});\n\n\tpublic static readonly _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'find-match-no-overview',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'findMatch',\n\t\tshowIfCollapsed: true\n\t});\n\n\tprivate static readonly _FIND_MATCH_ONLY_OVERVIEW_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'find-match-only-overview',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerFindMatchForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t}\n\t});\n\n\tprivate static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'find-range-highlight',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'rangeHighlight',\n\t\tisWholeLine: true\n\t});\n\n\tprivate static readonly _FIND_SCOPE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'find-scope',\n\t\tclassName: 'findScope',\n\t\tisWholeLine: true\n\t});\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 { findFirstInSorted } from 'vs/base/common/arrays';\nimport { RunOnceScheduler, TimeoutTimer } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore, dispose } from 'vs/base/common/lifecycle';\nimport { Constants } from 'vs/base/common/uint';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EndOfLinePreference, FindMatch, ITextModel } from 'vs/editor/common/model';\nimport { SearchParams } from 'vs/editor/common/model/textModelSearch';\nimport { FindDecorations } from 'vs/editor/contrib/find/browser/findDecorations';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/browser/findState';\nimport { ReplaceAllCommand } from 'vs/editor/contrib/find/browser/replaceAllCommand';\nimport { parseReplaceString, ReplacePattern } from 'vs/editor/contrib/find/browser/replacePattern';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('findWidgetVisible', false);\nexport const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated();\n// Keep ContextKey use of 'Focussed' to not break when clauses\nexport const CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey<boolean>('findInputFocussed', false);\nexport const CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey<boolean>('replaceInputFocussed', false);\n\nexport const ToggleCaseSensitiveKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyC,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyW,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyW }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyR,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyR }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyL,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }\n};\nexport const TogglePreserveCaseKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyP,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyP }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\n\tStartFindWithArgs: 'editor.actions.findWithArgs',\n\tNextMatchFindAction: 'editor.action.nextMatchFindAction',\n\tPreviousMatchFindAction: 'editor.action.previousMatchFindAction',\n\tNextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction',\n\tPreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction',\n\tStartFindReplaceAction: 'editor.action.startFindReplaceAction',\n\tCloseFindWidgetCommand: 'closeFindWidget',\n\tToggleCaseSensitiveCommand: 'toggleFindCaseSensitive',\n\tToggleWholeWordCommand: 'toggleFindWholeWord',\n\tToggleRegexCommand: 'toggleFindRegex',\n\tToggleSearchScopeCommand: 'toggleFindInSelection',\n\tTogglePreserveCaseCommand: 'togglePreserveCase',\n\tReplaceOneAction: 'editor.action.replaceOne',\n\tReplaceAllAction: 'editor.action.replaceAll',\n\tSelectAllMatchesAction: 'editor.action.selectAllMatches'\n};\n\nexport const MATCHES_LIMIT = 19999;\nconst RESEARCH_DELAY = 240;\n\nexport class FindModelBoundToEditorModel {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _decorations: FindDecorations;\n\tprivate _ignoreModelContentChanged: boolean;\n\tprivate readonly _startSearchingTimer: TimeoutTimer;\n\n\tprivate readonly _updateDecorationsScheduler: RunOnceScheduler;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, state: FindReplaceState) {\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.add(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => this.research(false), 100);\n\t\tthis._toDispose.add(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\tif (\n\t\t\t\te.reason === CursorChangeReason.Explicit\n\t\t\t\t|| e.reason === CursorChangeReason.Undo\n\t\t\t\t|| e.reason === CursorChangeReason.Redo\n\t\t\t) {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t}\n\t\t}));\n\n\t\tthis._ignoreModelContentChanged = false;\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._ignoreModelContentChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._decorations.reset();\n\t\t\t}\n\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\tthis._updateDecorationsScheduler.schedule();\n\t\t}));\n\n\t\tthis._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis.research(false, this._state.searchScope);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tdispose(this._startSearchingTimer);\n\t\tthis._toDispose.dispose();\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (this._isDisposed) {\n\t\t\t// The find model is disposed during a find state changed event\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// The find model will be disposed momentarily\n\t\t\treturn;\n\t\t}\n\t\tif (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {\n\t\t\tlet model = this._editor.getModel();\n\n\t\t\tif (model.isTooLargeForSyncing()) {\n\t\t\t\tthis._startSearchingTimer.cancel();\n\n\t\t\t\tthis._startSearchingTimer.setIfNotSet(() => {\n\t\t\t\t\tif (e.searchScope) {\n\t\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t\t}\n\t\t\t\t}, RESEARCH_DELAY);\n\t\t\t} else {\n\t\t\t\tif (e.searchScope) {\n\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t} else {\n\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _getSearchRange(model: ITextModel, findScope: Range | null): Range {\n\t\t// If we have set now or before a find scope, use it for computing the search range\n\t\tif (findScope) {\n\t\t\treturn findScope;\n\t\t}\n\n\t\treturn model.getFullModelRange();\n\t}\n\n\tprivate research(moveCursor: boolean, newFindScope?: Range | Range[] | null): void {\n\t\tlet findScopes: Range[] | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tif (newFindScope !== null) {\n\t\t\t\tif (!Array.isArray(newFindScope)) {\n\t\t\t\t\tfindScopes = [newFindScope as Range];\n\t\t\t\t} else {\n\t\t\t\t\tfindScopes = newFindScope;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfindScopes = this._decorations.getFindScopes();\n\t\t}\n\t\tif (findScopes !== null) {\n\t\t\tfindScopes = findScopes.map(findScope => {\n\t\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\t\tlet endLineNumber = findScope.endLineNumber;\n\n\t\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\t\tendLineNumber = endLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber));\n\t\t\t\t}\n\t\t\t\treturn findScope;\n\t\t\t});\n\t\t}\n\n\t\tlet findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScopes);\n\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tlet currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection);\n\t\tif (currentMatchesPosition === 0 && findMatches.length > 0) {\n\t\t\t// current selection is not on top of a match\n\t\t\t// try to find its nearest result from the top of the document\n\t\t\tconst matchAfterSelection = findFirstInSorted(findMatches.map(match => match.range), range => Range.compareRangesUsingStarts(range, editorSelection) >= 0);\n\t\t\tcurrentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition;\n\t\t}\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tcurrentMatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor && this._editor.getOption(EditorOption.find).cursorMoveOnType) {\n\t\t\tthis._moveToNextMatch(this._decorations.getStartPosition());\n\t\t}\n\t}\n\n\tprivate _hasMatches(): boolean {\n\t\treturn (this._state.matchesCount > 0);\n\t}\n\n\tprivate _cannotFind(): boolean {\n\t\tif (!this._hasMatches()) {\n\t\t\tlet findScope = this._decorations.getFindScope();\n\t\t\tif (findScope) {\n\t\t\t\t// Reveal the selection so user is reminded that 'selection find' is on.\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _setCurrentFindMatch(match: Range): void {\n\t\tlet matchesPosition = this._decorations.setCurrentFindMatch(match);\n\t\tthis._state.changeMatchInfo(\n\t\t\tmatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tmatch\n\t\t);\n\n\t\tthis._editor.setSelection(match);\n\t\tthis._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth);\n\t}\n\n\tprivate _prevSearchPosition(before: Position) {\n\t\tlet isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\t\tlet { lineNumber, column } = before;\n\t\tlet model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === 1) {\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tlineNumber = model.getLineCount();\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t}\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t} else {\n\t\t\tcolumn--;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToPrevMatch(before: Position, isRecursed: boolean = false): void {\n\t\tif (!this._state.canNavigateBack()) {\n\t\t\t// we are beyond the first matched find result\n\t\t\t// instead of doing nothing, we should refocus the first item\n\t\t\tconst nextMatchRange = this._decorations.matchAfterPosition(before);\n\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet prevMatchRange = this._decorations.matchBeforePosition(before);\n\n\t\t\tif (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) {\n\t\t\t\tbefore = this._prevSearchPosition(before);\n\t\t\t\tprevMatchRange = this._decorations.matchBeforePosition(before);\n\t\t\t}\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cannotFind()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet findScope = this._decorations.getFindScope();\n\t\tlet searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(before)) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (before.isBefore(searchRange.getStartPosition())) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\tlet { lineNumber, column } = before;\n\t\tlet model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._prevSearchPosition(position);\n\t\t\tprevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\t\t}\n\n\t\tif (!prevMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(prevMatch.range)) {\n\t\t\treturn this._moveToPrevMatch(prevMatch.range.getStartPosition(), true);\n\t\t}\n\n\t\tthis._setCurrentFindMatch(prevMatch.range);\n\t}\n\n\tpublic moveToPrevMatch(): void {\n\t\tthis._moveToPrevMatch(this._editor.getSelection().getStartPosition());\n\t}\n\n\tprivate _nextSearchPosition(after: Position) {\n\t\tlet isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\n\t\tlet { lineNumber, column } = after;\n\t\tlet model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber === model.getLineCount()) {\n\t\t\t\tlineNumber = 1;\n\t\t\t} else {\n\t\t\t\tlineNumber++;\n\t\t\t}\n\t\t\tcolumn = 1;\n\t\t} else {\n\t\t\tcolumn++;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToNextMatch(after: Position): void {\n\t\tif (!this._state.canNavigateForward()) {\n\t\t\t// we are beyond the last matched find result\n\t\t\t// instead of doing nothing, we should refocus the last item\n\t\t\tconst prevMatchRange = this._decorations.matchBeforePosition(after);\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet nextMatchRange = this._decorations.matchAfterPosition(after);\n\n\t\t\tif (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) {\n\t\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\t\tafter = this._nextSearchPosition(after);\n\t\t\t\tnextMatchRange = this._decorations.matchAfterPosition(after);\n\t\t\t}\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet nextMatch = this._getNextMatch(after, false, true);\n\t\tif (nextMatch) {\n\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t}\n\t}\n\n\tprivate _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): FindMatch | null {\n\t\tif (this._cannotFind()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet findScope = this._decorations.getFindScope();\n\t\tlet searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(after)) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (after.isBefore(searchRange.getStartPosition())) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\tlet { lineNumber, column } = after;\n\t\tlet model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\n\t\tif (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._nextSearchPosition(position);\n\t\t\tnextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\t\t}\n\n\t\tif (!nextMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(nextMatch.range)) {\n\t\t\treturn this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true);\n\t\t}\n\n\t\treturn nextMatch;\n\t}\n\n\tpublic moveToNextMatch(): void {\n\t\tthis._moveToNextMatch(this._editor.getSelection().getEndPosition());\n\t}\n\n\tprivate _getReplacePattern(): ReplacePattern {\n\t\tif (this._state.isRegex) {\n\t\t\treturn parseReplaceString(this._state.replaceString);\n\t\t}\n\t\treturn ReplacePattern.fromStaticValue(this._state.replaceString);\n\t}\n\n\tpublic replace(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet replacePattern = this._getReplacePattern();\n\t\tlet selection = this._editor.getSelection();\n\t\tlet nextMatch = this._getNextMatch(selection.getStartPosition(), true, false);\n\t\tif (nextMatch) {\n\t\t\tif (selection.equalsRange(nextMatch.range)) {\n\t\t\t\t// selection sits on a find match => replace it!\n\t\t\t\tlet replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase);\n\n\t\t\t\tlet command = new ReplaceCommand(selection, replaceString);\n\n\t\t\t\tthis._executeEditorCommand('replace', command);\n\n\t\t\t\tthis._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length));\n\t\t\t\tthis.research(true);\n\t\t\t} else {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _findMatches(findScopes: Range[] | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchRanges = (findScopes as [] || [null]).map((scope: Range | null) =>\n\t\t\tFindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)\n\t\t);\n\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches, limitResultCount);\n\t}\n\n\tpublic replaceAll(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\tif (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t// Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches\n\t\t\tthis._largeReplaceAll();\n\t\t} else {\n\t\t\tthis._regularReplaceAll(findScopes);\n\t\t}\n\n\t\tthis.research(false);\n\t}\n\n\tprivate _largeReplaceAll(): void {\n\t\tconst searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null);\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet searchRegex = searchData.regex;\n\t\tif (!searchRegex.multiline) {\n\t\t\tlet mod = 'mu';\n\t\t\tif (searchRegex.ignoreCase) {\n\t\t\t\tmod += 'i';\n\t\t\t}\n\t\t\tif (searchRegex.global) {\n\t\t\t\tmod += 'g';\n\t\t\t}\n\t\t\tsearchRegex = new RegExp(searchRegex.source, mod);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelText = model.getValue(EndOfLinePreference.LF);\n\t\tconst fullModelRange = model.getFullModelRange();\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tlet resultText: string;\n\t\tconst preserveCase = this._state.preserveCase;\n\n\t\tif (replacePattern.hasReplacementPatterns || preserveCase) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments, preserveCase);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase));\n\t\t}\n\n\t\tlet command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection());\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tprivate _regularReplaceAll(findScopes: Range[] | null): void {\n\t\tconst replacePattern = this._getReplacePattern();\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tlet matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tlet replaceStrings: string[] = [];\n\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\treplaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase);\n\t\t}\n\n\t\tlet command = new ReplaceAllCommand(this._editor.getSelection(), matches.map(m => m.range), replaceStrings);\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tpublic selectAllMatches(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet findScopes = this._decorations.getFindScopes();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tlet matches = this._findMatches(findScopes, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tlet selections = matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn));\n\n\t\t// If one of the ranges is the editor selection, then maintain it as primary\n\t\tlet editorSelection = this._editor.getSelection();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tlet sel = selections[i];\n\t\t\tif (sel.equalsRange(editorSelection)) {\n\t\t\t\tselections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.setSelections(selections);\n\t}\n\n\tprivate _executeEditorCommand(source: string, command: ICommand): void {\n\t\ttry {\n\t\t\tthis._ignoreModelContentChanged = true;\n\t\t\tthis._editor.pushUndoStop();\n\t\t\tthis._editor.executeCommand(source, command);\n\t\t\tthis._editor.pushUndoStop();\n\t\t} finally {\n\t\t\tthis._ignoreModelContentChanged = false;\n\t\t}\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { CaseSensitiveCheckbox, RegexCheckbox, WholeWordsCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { FIND_IDS } from 'vs/editor/contrib/find/browser/findModel';\nimport { FindReplaceState } from 'vs/editor/contrib/find/browser/findState';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { contrastBorder, editorWidgetBackground, editorWidgetForeground, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class FindOptionsWidget extends Widget implements IOverlayWidget {\n\n\tprivate static readonly ID = 'editor.contrib.findOptionsWidget';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _keybindingService: IKeybindingService;\n\n\tprivate readonly _domNode: HTMLElement;\n\tprivate readonly regex: RegexCheckbox;\n\tprivate readonly wholeWords: WholeWordsCheckbox;\n\tprivate readonly caseSensitive: CaseSensitiveCheckbox;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tstate: FindReplaceState,\n\t\tkeybindingService: IKeybindingService,\n\t\tthemeService: IThemeService\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._keybindingService = keybindingService;\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'findOptionsWidget';\n\t\tthis._domNode.style.display = 'none';\n\t\tthis._domNode.style.top = '10px';\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\n\t\tconst inputActiveOptionBorderColor = themeService.getColorTheme().getColor(inputActiveOptionBorder);\n\t\tconst inputActiveOptionForegroundColor = themeService.getColorTheme().getColor(inputActiveOptionForeground);\n\t\tconst inputActiveOptionBackgroundColor = themeService.getColorTheme().getColor(inputActiveOptionBackground);\n\n\t\tthis.caseSensitive = this._register(new CaseSensitiveCheckbox({\n\t\t\tappendTitle: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),\n\t\t\tisChecked: this._state.matchCase,\n\t\t\tinputActiveOptionBorder: inputActiveOptionBorderColor,\n\t\t\tinputActiveOptionForeground: inputActiveOptionForegroundColor,\n\t\t\tinputActiveOptionBackground: inputActiveOptionBackgroundColor\n\t\t}));\n\t\tthis._domNode.appendChild(this.caseSensitive.domNode);\n\t\tthis._register(this.caseSensitive.onChange(() => {\n\t\t\tthis._state.change({\n\t\t\t\tmatchCase: this.caseSensitive.checked\n\t\t\t}, false);\n\t\t}));\n\n\t\tthis.wholeWords = this._register(new WholeWordsCheckbox({\n\t\t\tappendTitle: this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),\n\t\t\tisChecked: this._state.wholeWord,\n\t\t\tinputActiveOptionBorder: inputActiveOptionBorderColor,\n\t\t\tinputActiveOptionForeground: inputActiveOptionForegroundColor,\n\t\t\tinputActiveOptionBackground: inputActiveOptionBackgroundColor\n\t\t}));\n\t\tthis._domNode.appendChild(this.wholeWords.domNode);\n\t\tthis._register(this.wholeWords.onChange(() => {\n\t\t\tthis._state.change({\n\t\t\t\twholeWord: this.wholeWords.checked\n\t\t\t}, false);\n\t\t}));\n\n\t\tthis.regex = this._register(new RegexCheckbox({\n\t\t\tappendTitle: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),\n\t\t\tisChecked: this._state.isRegex,\n\t\t\tinputActiveOptionBorder: inputActiveOptionBorderColor,\n\t\t\tinputActiveOptionForeground: inputActiveOptionForegroundColor,\n\t\t\tinputActiveOptionBackground: inputActiveOptionBackgroundColor\n\t\t}));\n\t\tthis._domNode.appendChild(this.regex.domNode);\n\t\tthis._register(this.regex.onChange(() => {\n\t\t\tthis._state.change({\n\t\t\t\tisRegex: this.regex.checked\n\t\t\t}, false);\n\t\t}));\n\n\t\tthis._editor.addOverlayWidget(this);\n\n\t\tthis._register(this._state.onFindReplaceStateChange((e) => {\n\t\t\tlet somethingChanged = false;\n\t\t\tif (e.isRegex) {\n\t\t\t\tthis.regex.checked = this._state.isRegex;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t\tif (e.wholeWord) {\n\t\t\t\tthis.wholeWords.checked = this._state.wholeWord;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t\tif (e.matchCase) {\n\t\t\t\tthis.caseSensitive.checked = this._state.matchCase;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t\tif (!this._state.isRevealed && somethingChanged) {\n\t\t\t\tthis._revealTemporarily();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(dom.addDisposableNonBubblingMouseOutListener(this._domNode, (e) => this._onMouseOut()));\n\t\tthis._register(dom.addDisposableListener(this._domNode, 'mouseover', (e) => this._onMouseOver()));\n\n\t\tthis._applyTheme(themeService.getColorTheme());\n\t\tthis._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this)));\n\t}\n\n\tprivate _keybindingLabelFor(actionId: string): string {\n\t\tlet kb = this._keybindingService.lookupKeybinding(actionId);\n\t\tif (!kb) {\n\t\t\treturn '';\n\t\t}\n\t\treturn ` (${kb.getLabel()})`;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\t// ----- IOverlayWidget API\n\n\tpublic getId(): string {\n\t\treturn FindOptionsWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition {\n\t\treturn {\n\t\t\tpreference: OverlayWidgetPositionPreference.TOP_RIGHT_CORNER\n\t\t};\n\t}\n\n\tpublic highlightFindOptions(): void {\n\t\tthis._revealTemporarily();\n\t}\n\n\tprivate _hideSoon = this._register(new RunOnceScheduler(() => this._hide(), 2000));\n\n\tprivate _revealTemporarily(): void {\n\t\tthis._show();\n\t\tthis._hideSoon.schedule();\n\t}\n\n\tprivate _onMouseOut(): void {\n\t\tthis._hideSoon.schedule();\n\t}\n\n\tprivate _onMouseOver(): void {\n\t\tthis._hideSoon.cancel();\n\t}\n\n\tprivate _isVisible: boolean = false;\n\n\tprivate _show(): void {\n\t\tif (this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = true;\n\t\tthis._domNode.style.display = 'block';\n\t}\n\n\tprivate _hide(): void {\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._domNode.style.display = 'none';\n\t}\n\n\tprivate _applyTheme(theme: IColorTheme) {\n\t\tlet inputStyles = {\n\t\t\tinputActiveOptionBorder: theme.getColor(inputActiveOptionBorder),\n\t\t\tinputActiveOptionForeground: theme.getColor(inputActiveOptionForeground),\n\t\t\tinputActiveOptionBackground: theme.getColor(inputActiveOptionBackground)\n\t\t};\n\t\tthis.caseSensitive.style(inputStyles);\n\t\tthis.wholeWords.style(inputStyles);\n\t\tthis.regex.style(inputStyles);\n\t}\n}\n\n\nregisterThemingParticipant((theme, collector) => {\n\tconst widgetBackground = theme.getColor(editorWidgetBackground);\n\tif (widgetBackground) {\n\t\tcollector.addRule(`.monaco-editor .findOptionsWidget { background-color: ${widgetBackground}; }`);\n\t}\n\n\tconst widgetForeground = theme.getColor(editorWidgetForeground);\n\tif (widgetForeground) {\n\t\tcollector.addRule(`.monaco-editor .findOptionsWidget { color: ${widgetForeground}; }`);\n\t}\n\n\n\tconst widgetShadowColor = theme.getColor(widgetShadow);\n\tif (widgetShadowColor) {\n\t\tcollector.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${widgetShadowColor}; }`);\n\t}\n\n\tconst hcBorder = theme.getColor(contrastBorder);\n\tif (hcBorder) {\n\t\tcollector.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${hcBorder}; }`);\n\t}\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 { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { Range } from 'vs/editor/common/core/range';\nimport { MATCHES_LIMIT } from './findModel';\n\nexport interface FindReplaceStateChangedEvent {\n\tmoveCursor: boolean;\n\tupdateHistory: boolean;\n\n\tsearchString: boolean;\n\treplaceString: boolean;\n\tisRevealed: boolean;\n\tisReplaceRevealed: boolean;\n\tisRegex: boolean;\n\twholeWord: boolean;\n\tmatchCase: boolean;\n\tpreserveCase: boolean;\n\tsearchScope: boolean;\n\tmatchesPosition: boolean;\n\tmatchesCount: boolean;\n\tcurrentMatch: boolean;\n\tloop: boolean;\n\tisSearching: boolean;\n\tfilters: boolean;\n}\n\nexport const enum FindOptionOverride {\n\tNotSet = 0,\n\tTrue = 1,\n\tFalse = 2\n}\n\nexport interface INewFindReplaceState<T extends { update: (value: T) => void } = { update: () => {} }> {\n\tsearchString?: string;\n\treplaceString?: string;\n\tisRevealed?: boolean;\n\tisReplaceRevealed?: boolean;\n\tisRegex?: boolean;\n\tisRegexOverride?: FindOptionOverride;\n\twholeWord?: boolean;\n\twholeWordOverride?: FindOptionOverride;\n\tmatchCase?: boolean;\n\tmatchCaseOverride?: FindOptionOverride;\n\tpreserveCase?: boolean;\n\tpreserveCaseOverride?: FindOptionOverride;\n\tsearchScope?: Range[] | null;\n\tloop?: boolean;\n\tisSearching?: boolean;\n\tfilters?: T;\n}\n\nfunction effectiveOptionValue(override: FindOptionOverride, value: boolean): boolean {\n\tif (override === FindOptionOverride.True) {\n\t\treturn true;\n\t}\n\tif (override === FindOptionOverride.False) {\n\t\treturn false;\n\t}\n\treturn value;\n}\n\nexport class FindReplaceState<T extends { update: (value: T) => void } = { update: () => {} }> extends Disposable {\n\tprivate _searchString: string;\n\tprivate _replaceString: string;\n\tprivate _isRevealed: boolean;\n\tprivate _isReplaceRevealed: boolean;\n\tprivate _isRegex: boolean;\n\tprivate _isRegexOverride: FindOptionOverride;\n\tprivate _wholeWord: boolean;\n\tprivate _wholeWordOverride: FindOptionOverride;\n\tprivate _matchCase: boolean;\n\tprivate _matchCaseOverride: FindOptionOverride;\n\tprivate _preserveCase: boolean;\n\tprivate _preserveCaseOverride: FindOptionOverride;\n\tprivate _searchScope: Range[] | null;\n\tprivate _matchesPosition: number;\n\tprivate _matchesCount: number;\n\tprivate _currentMatch: Range | null;\n\tprivate _loop: boolean;\n\tprivate _isSearching: boolean;\n\tprivate _filters: T | null;\n\tprivate readonly _onFindReplaceStateChange = this._register(new Emitter<FindReplaceStateChangedEvent>());\n\n\tpublic get searchString(): string { return this._searchString; }\n\tpublic get replaceString(): string { return this._replaceString; }\n\tpublic get isRevealed(): boolean { return this._isRevealed; }\n\tpublic get isReplaceRevealed(): boolean { return this._isReplaceRevealed; }\n\tpublic get isRegex(): boolean { return effectiveOptionValue(this._isRegexOverride, this._isRegex); }\n\tpublic get wholeWord(): boolean { return effectiveOptionValue(this._wholeWordOverride, this._wholeWord); }\n\tpublic get matchCase(): boolean { return effectiveOptionValue(this._matchCaseOverride, this._matchCase); }\n\tpublic get preserveCase(): boolean { return effectiveOptionValue(this._preserveCaseOverride, this._preserveCase); }\n\n\tpublic get actualIsRegex(): boolean { return this._isRegex; }\n\tpublic get actualWholeWord(): boolean { return this._wholeWord; }\n\tpublic get actualMatchCase(): boolean { return this._matchCase; }\n\tpublic get actualPreserveCase(): boolean { return this._preserveCase; }\n\n\tpublic get searchScope(): Range[] | null { return this._searchScope; }\n\tpublic get matchesPosition(): number { return this._matchesPosition; }\n\tpublic get matchesCount(): number { return this._matchesCount; }\n\tpublic get currentMatch(): Range | null { return this._currentMatch; }\n\tpublic readonly onFindReplaceStateChange: Event<FindReplaceStateChangedEvent> = this._onFindReplaceStateChange.event;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._searchString = '';\n\t\tthis._replaceString = '';\n\t\tthis._isRevealed = false;\n\t\tthis._isReplaceRevealed = false;\n\t\tthis._isRegex = false;\n\t\tthis._isRegexOverride = FindOptionOverride.NotSet;\n\t\tthis._wholeWord = false;\n\t\tthis._wholeWordOverride = FindOptionOverride.NotSet;\n\t\tthis._matchCase = false;\n\t\tthis._matchCaseOverride = FindOptionOverride.NotSet;\n\t\tthis._preserveCase = false;\n\t\tthis._preserveCaseOverride = FindOptionOverride.NotSet;\n\t\tthis._searchScope = null;\n\t\tthis._matchesPosition = 0;\n\t\tthis._matchesCount = 0;\n\t\tthis._currentMatch = null;\n\t\tthis._loop = true;\n\t\tthis._isSearching = false;\n\t\tthis._filters = null;\n\t}\n\n\tpublic changeMatchInfo(matchesPosition: number, matchesCount: number, currentMatch: Range | undefined): void {\n\t\tlet changeEvent: FindReplaceStateChangedEvent = {\n\t\t\tmoveCursor: false,\n\t\t\tupdateHistory: false,\n\t\t\tsearchString: false,\n\t\t\treplaceString: false,\n\t\t\tisRevealed: false,\n\t\t\tisReplaceRevealed: false,\n\t\t\tisRegex: false,\n\t\t\twholeWord: false,\n\t\t\tmatchCase: false,\n\t\t\tpreserveCase: false,\n\t\t\tsearchScope: false,\n\t\t\tmatchesPosition: false,\n\t\t\tmatchesCount: false,\n\t\t\tcurrentMatch: false,\n\t\t\tloop: false,\n\t\t\tisSearching: false,\n\t\t\tfilters: false\n\t\t};\n\t\tlet somethingChanged = false;\n\n\t\tif (matchesCount === 0) {\n\t\t\tmatchesPosition = 0;\n\t\t}\n\t\tif (matchesPosition > matchesCount) {\n\t\t\tmatchesPosition = matchesCount;\n\t\t}\n\n\t\tif (this._matchesPosition !== matchesPosition) {\n\t\t\tthis._matchesPosition = matchesPosition;\n\t\t\tchangeEvent.matchesPosition = true;\n\t\t\tsomethingChanged = true;\n\t\t}\n\t\tif (this._matchesCount !== matchesCount) {\n\t\t\tthis._matchesCount = matchesCount;\n\t\t\tchangeEvent.matchesCount = true;\n\t\t\tsomethingChanged = true;\n\t\t}\n\n\t\tif (typeof currentMatch !== 'undefined') {\n\t\t\tif (!Range.equalsRange(this._currentMatch, currentMatch)) {\n\t\t\t\tthis._currentMatch = currentMatch;\n\t\t\t\tchangeEvent.currentMatch = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tif (somethingChanged) {\n\t\t\tthis._onFindReplaceStateChange.fire(changeEvent);\n\t\t}\n\t}\n\n\tpublic change(newState: INewFindReplaceState<T>, moveCursor: boolean, updateHistory: boolean = true): void {\n\t\tlet changeEvent: FindReplaceStateChangedEvent = {\n\t\t\tmoveCursor: moveCursor,\n\t\t\tupdateHistory: updateHistory,\n\t\t\tsearchString: false,\n\t\t\treplaceString: false,\n\t\t\tisRevealed: false,\n\t\t\tisReplaceRevealed: false,\n\t\t\tisRegex: false,\n\t\t\twholeWord: false,\n\t\t\tmatchCase: false,\n\t\t\tpreserveCase: false,\n\t\t\tsearchScope: false,\n\t\t\tmatchesPosition: false,\n\t\t\tmatchesCount: false,\n\t\t\tcurrentMatch: false,\n\t\t\tloop: false,\n\t\t\tisSearching: false,\n\t\t\tfilters: false\n\t\t};\n\t\tlet somethingChanged = false;\n\n\t\tconst oldEffectiveIsRegex = this.isRegex;\n\t\tconst oldEffectiveWholeWords = this.wholeWord;\n\t\tconst oldEffectiveMatchCase = this.matchCase;\n\t\tconst oldEffectivePreserveCase = this.preserveCase;\n\n\t\tif (typeof newState.searchString !== 'undefined') {\n\t\t\tif (this._searchString !== newState.searchString) {\n\t\t\t\tthis._searchString = newState.searchString;\n\t\t\t\tchangeEvent.searchString = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\tif (typeof newState.replaceString !== 'undefined') {\n\t\t\tif (this._replaceString !== newState.replaceString) {\n\t\t\t\tthis._replaceString = newState.replaceString;\n\t\t\t\tchangeEvent.replaceString = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\tif (typeof newState.isRevealed !== 'undefined') {\n\t\t\tif (this._isRevealed !== newState.isRevealed) {\n\t\t\t\tthis._isRevealed = newState.isRevealed;\n\t\t\t\tchangeEvent.isRevealed = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\tif (typeof newState.isReplaceRevealed !== 'undefined') {\n\t\t\tif (this._isReplaceRevealed !== newState.isReplaceRevealed) {\n\t\t\t\tthis._isReplaceRevealed = newState.isReplaceRevealed;\n\t\t\t\tchangeEvent.isReplaceRevealed = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\tif (typeof newState.isRegex !== 'undefined') {\n\t\t\tthis._isRegex = newState.isRegex;\n\t\t}\n\t\tif (typeof newState.wholeWord !== 'undefined') {\n\t\t\tthis._wholeWord = newState.wholeWord;\n\t\t}\n\t\tif (typeof newState.matchCase !== 'undefined') {\n\t\t\tthis._matchCase = newState.matchCase;\n\t\t}\n\t\tif (typeof newState.preserveCase !== 'undefined') {\n\t\t\tthis._preserveCase = newState.preserveCase;\n\t\t}\n\t\tif (typeof newState.searchScope !== 'undefined') {\n\t\t\tif (!newState.searchScope?.every((newSearchScope) => {\n\t\t\t\treturn this._searchScope?.some(existingSearchScope => {\n\t\t\t\t\treturn !Range.equalsRange(existingSearchScope, newSearchScope);\n\t\t\t\t});\n\t\t\t})) {\n\t\t\t\tthis._searchScope = newState.searchScope;\n\t\t\t\tchangeEvent.searchScope = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\t\tif (typeof newState.loop !== 'undefined') {\n\t\t\tif (this._loop !== newState.loop) {\n\t\t\t\tthis._loop = newState.loop;\n\t\t\t\tchangeEvent.loop = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tif (typeof newState.isSearching !== 'undefined') {\n\t\t\tif (this._isSearching !== newState.isSearching) {\n\t\t\t\tthis._isSearching = newState.isSearching;\n\t\t\t\tchangeEvent.isSearching = true;\n\t\t\t\tsomethingChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tif (typeof newState.filters !== 'undefined') {\n\t\t\tif (this._filters) {\n\t\t\t\tthis._filters.update(newState.filters);\n\t\t\t} else {\n\t\t\t\tthis._filters = newState.filters;\n\t\t\t}\n\n\t\t\tchangeEvent.filters = true;\n\t\t\tsomethingChanged = true;\n\t\t}\n\n\t\t// Overrides get set when they explicitly come in and get reset anytime something else changes\n\t\tthis._isRegexOverride = (typeof newState.isRegexOverride !== 'undefined' ? newState.isRegexOverride : FindOptionOverride.NotSet);\n\t\tthis._wholeWordOverride = (typeof newState.wholeWordOverride !== 'undefined' ? newState.wholeWordOverride : FindOptionOverride.NotSet);\n\t\tthis._matchCaseOverride = (typeof newState.matchCaseOverride !== 'undefined' ? newState.matchCaseOverride : FindOptionOverride.NotSet);\n\t\tthis._preserveCaseOverride = (typeof newState.preserveCaseOverride !== 'undefined' ? newState.preserveCaseOverride : FindOptionOverride.NotSet);\n\n\t\tif (oldEffectiveIsRegex !== this.isRegex) {\n\t\t\tsomethingChanged = true;\n\t\t\tchangeEvent.isRegex = true;\n\t\t}\n\t\tif (oldEffectiveWholeWords !== this.wholeWord) {\n\t\t\tsomethingChanged = true;\n\t\t\tchangeEvent.wholeWord = true;\n\t\t}\n\t\tif (oldEffectiveMatchCase !== this.matchCase) {\n\t\t\tsomethingChanged = true;\n\t\t\tchangeEvent.matchCase = true;\n\t\t}\n\n\t\tif (oldEffectivePreserveCase !== this.preserveCase) {\n\t\t\tsomethingChanged = true;\n\t\t\tchangeEvent.preserveCase = true;\n\t\t}\n\n\t\tif (somethingChanged) {\n\t\t\tthis._onFindReplaceStateChange.fire(changeEvent);\n\t\t}\n\t}\n\n\tpublic canNavigateBack(): boolean {\n\t\treturn this.canNavigateInLoop() || (this.matchesPosition !== 1);\n\t}\n\n\tpublic canNavigateForward(): boolean {\n\t\treturn this.canNavigateInLoop() || (this.matchesPosition < this.matchesCount);\n\t}\n\n\tprivate canNavigateInLoop(): boolean {\n\t\treturn this._loop || (this.matchesCount >= MATCHES_LIMIT);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { alert as alertFn } from 'vs/base/browser/ui/aria/aria';\nimport { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { FindInput, IFindInputStyles } from 'vs/base/browser/ui/findinput/findInput';\nimport { ReplaceInput } from 'vs/base/browser/ui/findinput/replaceInput';\nimport { IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { ISashEvent, IVerticalSashLayoutProvider, Orientation, Sash } from 'vs/base/browser/ui/sash/sash';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Delayer } from 'vs/base/common/async';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { toDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport 'vs/css!./findWidget';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_REPLACE_INPUT_FOCUSED, FIND_IDS, MATCHES_LIMIT } from 'vs/editor/contrib/find/browser/findModel';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/browser/findState';\nimport * as nls from 'vs/nls';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { ContextScopedFindInput, ContextScopedReplaceInput } from 'vs/platform/history/browser/contextScopedHistoryWidget';\nimport { showHistoryKeybindingHint } from 'vs/platform/history/browser/historyWidgetKeybindingHint';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { contrastBorder, editorFindMatch, editorFindMatchBorder, editorFindMatchHighlight, editorFindMatchHighlightBorder, editorFindRangeHighlight, editorFindRangeHighlightBorder, editorWidgetBackground, editorWidgetBorder, editorWidgetForeground, editorWidgetResizeBorder, errorForeground, focusBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground, inputBackground, inputBorder, inputForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationWarningForeground, toolbarHoverBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { registerIcon, widgetClose } from 'vs/platform/theme/common/iconRegistry';\nimport { IColorTheme, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nconst findSelectionIcon = registerIcon('find-selection', Codicon.selection, nls.localize('findSelectionIcon', 'Icon for \\'Find in Selection\\' in the editor find widget.'));\nconst findCollapsedIcon = registerIcon('find-collapsed', Codicon.chevronRight, nls.localize('findCollapsedIcon', 'Icon to indicate that the editor find widget is collapsed.'));\nconst findExpandedIcon = registerIcon('find-expanded', Codicon.chevronDown, nls.localize('findExpandedIcon', 'Icon to indicate that the editor find widget is expanded.'));\n\nexport const findReplaceIcon = registerIcon('find-replace', Codicon.replace, nls.localize('findReplaceIcon', 'Icon for \\'Replace\\' in the editor find widget.'));\nexport const findReplaceAllIcon = registerIcon('find-replace-all', Codicon.replaceAll, nls.localize('findReplaceAllIcon', 'Icon for \\'Replace All\\' in the editor find widget.'));\nexport const findPreviousMatchIcon = registerIcon('find-previous-match', Codicon.arrowUp, nls.localize('findPreviousMatchIcon', 'Icon for \\'Find Previous\\' in the editor find widget.'));\nexport const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDown, nls.localize('findNextMatchIcon', 'Icon for \\'Find Next\\' in the editor find widget.'));\n\nexport interface IFindController {\n\treplace(): void;\n\treplaceAll(): void;\n\tgetGlobalBufferTerm(): Promise<string>;\n}\n\nconst NLS_FIND_INPUT_LABEL = nls.localize('label.find', \"Find\");\nconst NLS_FIND_INPUT_PLACEHOLDER = nls.localize('placeholder.find', \"Find\");\nconst NLS_PREVIOUS_MATCH_BTN_LABEL = nls.localize('label.previousMatchButton', \"Previous Match\");\nconst NLS_NEXT_MATCH_BTN_LABEL = nls.localize('label.nextMatchButton', \"Next Match\");\nconst NLS_TOGGLE_SELECTION_FIND_TITLE = nls.localize('label.toggleSelectionFind', \"Find in Selection\");\nconst NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', \"Close\");\nconst NLS_REPLACE_INPUT_LABEL = nls.localize('label.replace', \"Replace\");\nconst NLS_REPLACE_INPUT_PLACEHOLDER = nls.localize('placeholder.replace', \"Replace\");\nconst NLS_REPLACE_BTN_LABEL = nls.localize('label.replaceButton', \"Replace\");\nconst NLS_REPLACE_ALL_BTN_LABEL = nls.localize('label.replaceAllButton', \"Replace All\");\nconst NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = nls.localize('label.toggleReplaceButton', \"Toggle Replace\");\nconst NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize('title.matchesCountLimit', \"Only the first {0} results are highlighted, but all find operations work on the entire text.\", MATCHES_LIMIT);\nexport const NLS_MATCHES_LOCATION = nls.localize('label.matchesLocation', \"{0} of {1}\");\nexport const NLS_NO_RESULTS = nls.localize('label.noResults', \"No results\");\n\nconst FIND_WIDGET_INITIAL_WIDTH = 419;\nconst PART_WIDTH = 275;\nconst FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54;\n\nlet MAX_MATCHES_COUNT_WIDTH = 69;\n// let FIND_ALL_CONTROLS_WIDTH = 17/** Find Input margin-left */ + (MAX_MATCHES_COUNT_WIDTH + 3 + 1) /** Match Results */ + 23 /** Button */ * 4 + 2/** sash */;\n\nconst FIND_INPUT_AREA_HEIGHT = 33; // The height of Find Widget when Replace Input is not visible.\nconst ctrlEnterReplaceAllWarningPromptedKey = 'ctrlEnterReplaceAll.windows.donotask';\n\nconst ctrlKeyMod = (platform.isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd);\nexport class FindWidgetViewZone implements IViewZone {\n\tpublic readonly afterLineNumber: number;\n\tpublic heightInPx: number;\n\tpublic readonly suppressMouseDown: boolean;\n\tpublic readonly domNode: HTMLElement;\n\n\tconstructor(afterLineNumber: number) {\n\t\tthis.afterLineNumber = afterLineNumber;\n\n\t\tthis.heightInPx = FIND_INPUT_AREA_HEIGHT;\n\t\tthis.suppressMouseDown = false;\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'dock-find-viewzone';\n\t}\n}\n\nfunction stopPropagationForMultiLineUpwards(event: IKeyboardEvent, value: string, textarea: HTMLTextAreaElement | null) {\n\tconst isMultiline = !!value.match(/\\n/);\n\tif (textarea && isMultiline && textarea.selectionStart > 0) {\n\t\tevent.stopPropagation();\n\t\treturn;\n\t}\n}\n\nfunction stopPropagationForMultiLineDownwards(event: IKeyboardEvent, value: string, textarea: HTMLTextAreaElement | null) {\n\tconst isMultiline = !!value.match(/\\n/);\n\tif (textarea && isMultiline && textarea.selectionEnd < textarea.value.length) {\n\t\tevent.stopPropagation();\n\t\treturn;\n\t}\n}\n\nexport class FindWidget extends Widget implements IOverlayWidget, IVerticalSashLayoutProvider {\n\tprivate static readonly ID = 'editor.contrib.findWidget';\n\tprivate readonly _codeEditor: ICodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _controller: IFindController;\n\tprivate readonly _contextViewProvider: IContextViewProvider;\n\tprivate readonly _keybindingService: IKeybindingService;\n\tprivate readonly _contextKeyService: IContextKeyService;\n\tprivate readonly _storageService: IStorageService;\n\tprivate readonly _notificationService: INotificationService;\n\n\tprivate _domNode!: HTMLElement;\n\tprivate _cachedHeight: number | null = null;\n\tprivate _findInput!: FindInput;\n\tprivate _replaceInput!: ReplaceInput;\n\n\tprivate _toggleReplaceBtn!: SimpleButton;\n\tprivate _matchesCount!: HTMLElement;\n\tprivate _prevBtn!: SimpleButton;\n\tprivate _nextBtn!: SimpleButton;\n\tprivate _toggleSelectionFind!: Checkbox;\n\tprivate _closeBtn!: SimpleButton;\n\tprivate _replaceBtn!: SimpleButton;\n\tprivate _replaceAllBtn!: SimpleButton;\n\n\tprivate _isVisible: boolean;\n\tprivate _isReplaceVisible: boolean;\n\tprivate _ignoreChangeEvent: boolean;\n\tprivate _ctrlEnterReplaceAllWarningPrompted: boolean;\n\n\tprivate readonly _findFocusTracker: dom.IFocusTracker;\n\tprivate readonly _findInputFocused: IContextKey<boolean>;\n\tprivate readonly _replaceFocusTracker: dom.IFocusTracker;\n\tprivate readonly _replaceInputFocused: IContextKey<boolean>;\n\tprivate _viewZone?: FindWidgetViewZone;\n\tprivate _viewZoneId?: string;\n\n\tprivate _resizeSash!: Sash;\n\tprivate _resized!: boolean;\n\tprivate readonly _updateHistoryDelayer: Delayer<void>;\n\n\tconstructor(\n\t\tcodeEditor: ICodeEditor,\n\t\tcontroller: IFindController,\n\t\tstate: FindReplaceState,\n\t\tcontextViewProvider: IContextViewProvider,\n\t\tkeybindingService: IKeybindingService,\n\t\tcontextKeyService: IContextKeyService,\n\t\tthemeService: IThemeService,\n\t\tstorageService: IStorageService,\n\t\tnotificationService: INotificationService,\n\t) {\n\t\tsuper();\n\t\tthis._codeEditor = codeEditor;\n\t\tthis._controller = controller;\n\t\tthis._state = state;\n\t\tthis._contextViewProvider = contextViewProvider;\n\t\tthis._keybindingService = keybindingService;\n\t\tthis._contextKeyService = contextKeyService;\n\t\tthis._storageService = storageService;\n\t\tthis._notificationService = notificationService;\n\n\t\tthis._ctrlEnterReplaceAllWarningPrompted = !!storageService.getBoolean(ctrlEnterReplaceAllWarningPromptedKey, StorageScope.GLOBAL);\n\n\t\tthis._isVisible = false;\n\t\tthis._isReplaceVisible = false;\n\t\tthis._ignoreChangeEvent = false;\n\n\t\tthis._updateHistoryDelayer = new Delayer<void>(500);\n\t\tthis._register(toDisposable(() => this._updateHistoryDelayer.cancel()));\n\t\tthis._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\t\tthis._buildDomNode();\n\t\tthis._updateButtons();\n\t\tthis._tryUpdateWidgetWidth();\n\t\tthis._findInput.inputBox.layout();\n\n\t\tthis._register(this._codeEditor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.readOnly)) {\n\t\t\t\tif (this._codeEditor.getOption(EditorOption.readOnly)) {\n\t\t\t\t\t// Hide replace part if editor becomes read only\n\t\t\t\t\tthis._state.change({ isReplaceRevealed: false }, false);\n\t\t\t\t}\n\t\t\t\tthis._updateButtons();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t\tthis._tryUpdateWidgetWidth();\n\t\t\t}\n\n\t\t\tif (e.hasChanged(EditorOption.accessibilitySupport)) {\n\t\t\t\tthis.updateAccessibilitySupport();\n\t\t\t}\n\n\t\t\tif (e.hasChanged(EditorOption.find)) {\n\t\t\t\tconst addExtraSpaceOnTop = this._codeEditor.getOption(EditorOption.find).addExtraSpaceOnTop;\n\t\t\t\tif (addExtraSpaceOnTop && !this._viewZone) {\n\t\t\t\t\tthis._viewZone = new FindWidgetViewZone(0);\n\t\t\t\t\tthis._showViewZone();\n\t\t\t\t}\n\t\t\t\tif (!addExtraSpaceOnTop && this._viewZone) {\n\t\t\t\t\tthis._removeViewZone();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis.updateAccessibilitySupport();\n\t\tthis._register(this._codeEditor.onDidChangeCursorSelection(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._updateToggleSelectionFindButton();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._codeEditor.onDidFocusEditorWidget(async () => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tlet globalBufferTerm = await this._controller.getGlobalBufferTerm();\n\t\t\t\tif (globalBufferTerm && globalBufferTerm !== this._state.searchString) {\n\t\t\t\t\tthis._state.change({ searchString: globalBufferTerm }, false);\n\t\t\t\t\tthis._findInput.select();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._findInputFocused = CONTEXT_FIND_INPUT_FOCUSED.bindTo(contextKeyService);\n\t\tthis._findFocusTracker = this._register(dom.trackFocus(this._findInput.inputBox.inputElement));\n\t\tthis._register(this._findFocusTracker.onDidFocus(() => {\n\t\t\tthis._findInputFocused.set(true);\n\t\t\tthis._updateSearchScope();\n\t\t}));\n\t\tthis._register(this._findFocusTracker.onDidBlur(() => {\n\t\t\tthis._findInputFocused.set(false);\n\t\t}));\n\n\t\tthis._replaceInputFocused = CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(contextKeyService);\n\t\tthis._replaceFocusTracker = this._register(dom.trackFocus(this._replaceInput.inputBox.inputElement));\n\t\tthis._register(this._replaceFocusTracker.onDidFocus(() => {\n\t\t\tthis._replaceInputFocused.set(true);\n\t\t\tthis._updateSearchScope();\n\t\t}));\n\t\tthis._register(this._replaceFocusTracker.onDidBlur(() => {\n\t\t\tthis._replaceInputFocused.set(false);\n\t\t}));\n\n\t\tthis._codeEditor.addOverlayWidget(this);\n\t\tif (this._codeEditor.getOption(EditorOption.find).addExtraSpaceOnTop) {\n\t\t\tthis._viewZone = new FindWidgetViewZone(0); // Put it before the first line then users can scroll beyond the first line.\n\t\t}\n\n\t\tthis._applyTheme(themeService.getColorTheme());\n\t\tthis._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this)));\n\n\t\tthis._register(this._codeEditor.onDidChangeModel(() => {\n\t\t\tif (!this._isVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._viewZoneId = undefined;\n\t\t}));\n\n\n\t\tthis._register(this._codeEditor.onDidScrollChange((e) => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis._layoutViewZone();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for other scroll changes, layout the viewzone in next tick to avoid ruining current rendering.\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis._layoutViewZone();\n\t\t\t}, 0);\n\t\t}));\n\t}\n\n\t// ----- IOverlayWidget API\n\n\tpublic getId(): string {\n\t\treturn FindWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\tif (this._isVisible) {\n\t\t\treturn {\n\t\t\t\tpreference: OverlayWidgetPositionPreference.TOP_RIGHT_CORNER\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\t// ----- React to state changes\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (e.searchString) {\n\t\t\ttry {\n\t\t\t\tthis._ignoreChangeEvent = true;\n\t\t\t\tthis._findInput.setValue(this._state.searchString);\n\t\t\t} finally {\n\t\t\t\tthis._ignoreChangeEvent = false;\n\t\t\t}\n\t\t\tthis._updateButtons();\n\t\t}\n\t\tif (e.replaceString) {\n\t\t\tthis._replaceInput.inputBox.value = this._state.replaceString;\n\t\t}\n\t\tif (e.isRevealed) {\n\t\t\tif (this._state.isRevealed) {\n\t\t\t\tthis._reveal();\n\t\t\t} else {\n\t\t\t\tthis._hide(true);\n\t\t\t}\n\t\t}\n\t\tif (e.isReplaceRevealed) {\n\t\t\tif (this._state.isReplaceRevealed) {\n\t\t\t\tif (!this._codeEditor.getOption(EditorOption.readOnly) && !this._isReplaceVisible) {\n\t\t\t\t\tthis._isReplaceVisible = true;\n\t\t\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t\t\t\tthis._updateButtons();\n\t\t\t\t\tthis._replaceInput.inputBox.layout();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._isReplaceVisible) {\n\t\t\t\t\tthis._isReplaceVisible = false;\n\t\t\t\t\tthis._updateButtons();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ((e.isRevealed || e.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed)) {\n\t\t\tif (this._tryUpdateHeight()) {\n\t\t\t\tthis._showViewZone();\n\t\t\t}\n\t\t}\n\n\t\tif (e.isRegex) {\n\t\t\tthis._findInput.setRegex(this._state.isRegex);\n\t\t}\n\t\tif (e.wholeWord) {\n\t\t\tthis._findInput.setWholeWords(this._state.wholeWord);\n\t\t}\n\t\tif (e.matchCase) {\n\t\t\tthis._findInput.setCaseSensitive(this._state.matchCase);\n\t\t}\n\t\tif (e.preserveCase) {\n\t\t\tthis._replaceInput.setPreserveCase(this._state.preserveCase);\n\t\t}\n\t\tif (e.searchScope) {\n\t\t\tif (this._state.searchScope) {\n\t\t\t\tthis._toggleSelectionFind.checked = true;\n\t\t\t} else {\n\t\t\t\tthis._toggleSelectionFind.checked = false;\n\t\t\t}\n\t\t\tthis._updateToggleSelectionFindButton();\n\t\t}\n\t\tif (e.searchString || e.matchesCount || e.matchesPosition) {\n\t\t\tlet showRedOutline = (this._state.searchString.length > 0 && this._state.matchesCount === 0);\n\t\t\tthis._domNode.classList.toggle('no-results', showRedOutline);\n\n\t\t\tthis._updateMatchesCount();\n\t\t\tthis._updateButtons();\n\t\t}\n\t\tif (e.searchString || e.currentMatch) {\n\t\t\tthis._layoutViewZone();\n\t\t}\n\t\tif (e.updateHistory) {\n\t\t\tthis._delayedUpdateHistory();\n\t\t}\n\t\tif (e.loop) {\n\t\t\tthis._updateButtons();\n\t\t}\n\t}\n\n\tprivate _delayedUpdateHistory() {\n\t\tthis._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(undefined, onUnexpectedError);\n\t}\n\n\tprivate _updateHistory() {\n\t\tif (this._state.searchString) {\n\t\t\tthis._findInput.inputBox.addToHistory();\n\t\t}\n\t\tif (this._state.replaceString) {\n\t\t\tthis._replaceInput.inputBox.addToHistory();\n\t\t}\n\t}\n\n\tprivate _updateMatchesCount(): void {\n\t\tthis._matchesCount.style.minWidth = MAX_MATCHES_COUNT_WIDTH + 'px';\n\t\tif (this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\tthis._matchesCount.title = NLS_MATCHES_COUNT_LIMIT_TITLE;\n\t\t} else {\n\t\t\tthis._matchesCount.title = '';\n\t\t}\n\n\t\t// remove previous content\n\t\tif (this._matchesCount.firstChild) {\n\t\t\tthis._matchesCount.removeChild(this._matchesCount.firstChild);\n\t\t}\n\n\t\tlet label: string;\n\t\tif (this._state.matchesCount > 0) {\n\t\t\tlet matchesCount: string = String(this._state.matchesCount);\n\t\t\tif (this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t\tmatchesCount += '+';\n\t\t\t}\n\t\t\tlet matchesPosition: string = String(this._state.matchesPosition);\n\t\t\tif (matchesPosition === '0') {\n\t\t\t\tmatchesPosition = '?';\n\t\t\t}\n\t\t\tlabel = strings.format(NLS_MATCHES_LOCATION, matchesPosition, matchesCount);\n\t\t} else {\n\t\t\tlabel = NLS_NO_RESULTS;\n\t\t}\n\n\t\tthis._matchesCount.appendChild(document.createTextNode(label));\n\n\t\talertFn(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString));\n\t\tMAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth);\n\t}\n\n\t// ----- actions\n\n\tprivate _getAriaLabel(label: string, currentMatch: Range | null, searchString: string): string {\n\t\tif (label === NLS_NO_RESULTS) {\n\t\t\treturn searchString === ''\n\t\t\t\t? nls.localize('ariaSearchNoResultEmpty', \"{0} found\", label)\n\t\t\t\t: nls.localize('ariaSearchNoResult', \"{0} found for '{1}'\", label, searchString);\n\t\t}\n\t\tif (currentMatch) {\n\t\t\tconst ariaLabel = nls.localize('ariaSearchNoResultWithLineNum', \"{0} found for '{1}', at {2}\", label, searchString, currentMatch.startLineNumber + ':' + currentMatch.startColumn);\n\t\t\tconst model = this._codeEditor.getModel();\n\t\t\tif (model && (currentMatch.startLineNumber <= model.getLineCount()) && (currentMatch.startLineNumber >= 1)) {\n\t\t\t\tconst lineContent = model.getLineContent(currentMatch.startLineNumber);\n\t\t\t\treturn `${lineContent}, ${ariaLabel}`;\n\t\t\t}\n\n\t\t\treturn ariaLabel;\n\t\t}\n\n\t\treturn nls.localize('ariaSearchNoResultWithLineNumNoCurrentMatch', \"{0} found for '{1}'\", label, searchString);\n\t}\n\n\t/**\n\t * If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find').\n\t * If 'selection find' is OFF we enable the button only if there is a selection.\n\t */\n\tprivate _updateToggleSelectionFindButton(): void {\n\t\tlet selection = this._codeEditor.getSelection();\n\t\tlet isSelection = selection ? (selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn) : false;\n\t\tlet isChecked = this._toggleSelectionFind.checked;\n\n\t\tif (this._isVisible && (isChecked || isSelection)) {\n\t\t\tthis._toggleSelectionFind.enable();\n\t\t} else {\n\t\t\tthis._toggleSelectionFind.disable();\n\t\t}\n\t}\n\n\tprivate _updateButtons(): void {\n\t\tthis._findInput.setEnabled(this._isVisible);\n\t\tthis._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible);\n\t\tthis._updateToggleSelectionFindButton();\n\t\tthis._closeBtn.setEnabled(this._isVisible);\n\n\t\tlet findInputIsNonEmpty = (this._state.searchString.length > 0);\n\t\tlet matchesCount = this._state.matchesCount ? true : false;\n\t\tthis._prevBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateBack());\n\t\tthis._nextBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateForward());\n\t\tthis._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);\n\t\tthis._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);\n\n\t\tthis._domNode.classList.toggle('replaceToggled', this._isReplaceVisible);\n\t\tthis._toggleReplaceBtn.setExpanded(this._isReplaceVisible);\n\n\t\tlet canReplace = !this._codeEditor.getOption(EditorOption.readOnly);\n\t\tthis._toggleReplaceBtn.setEnabled(this._isVisible && canReplace);\n\t}\n\n\tprivate _revealTimeouts: any[] = [];\n\n\tprivate _reveal(): void {\n\t\tthis._revealTimeouts.forEach(e => {\n\t\t\tclearTimeout(e);\n\t\t});\n\n\t\tthis._revealTimeouts = [];\n\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\n\t\t\tconst selection = this._codeEditor.getSelection();\n\n\t\t\tswitch (this._codeEditor.getOption(EditorOption.find).autoFindInSelection) {\n\t\t\t\tcase 'always':\n\t\t\t\t\tthis._toggleSelectionFind.checked = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'never':\n\t\t\t\t\tthis._toggleSelectionFind.checked = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'multiline': {\n\t\t\t\t\tconst isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber;\n\t\t\t\t\tthis._toggleSelectionFind.checked = isSelectionMultipleLine;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tthis._tryUpdateWidgetWidth();\n\t\t\tthis._updateButtons();\n\n\t\t\tthis._revealTimeouts.push(setTimeout(() => {\n\t\t\t\tthis._domNode.classList.add('visible');\n\t\t\t\tthis._domNode.setAttribute('aria-hidden', 'false');\n\t\t\t}, 0));\n\n\t\t\t// validate query again as it's being dismissed when we hide the find widget.\n\t\t\tthis._revealTimeouts.push(setTimeout(() => {\n\t\t\t\tthis._findInput.validate();\n\t\t\t}, 200));\n\n\t\t\tthis._codeEditor.layoutOverlayWidget(this);\n\n\t\t\tlet adjustEditorScrollTop = true;\n\t\t\tif (this._codeEditor.getOption(EditorOption.find).seedSearchStringFromSelection && selection) {\n\t\t\t\tconst domNode = this._codeEditor.getDomNode();\n\t\t\t\tif (domNode) {\n\t\t\t\t\tconst editorCoords = dom.getDomNodePagePosition(domNode);\n\t\t\t\t\tconst startCoords = this._codeEditor.getScrolledVisiblePosition(selection.getStartPosition());\n\t\t\t\t\tconst startLeft = editorCoords.left + (startCoords ? startCoords.left : 0);\n\t\t\t\t\tconst startTop = startCoords ? startCoords.top : 0;\n\n\t\t\t\t\tif (this._viewZone && startTop < this._viewZone.heightInPx) {\n\t\t\t\t\t\tif (selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\t\t\t\tadjustEditorScrollTop = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst leftOfFindWidget = dom.getTopLeftOffset(this._domNode).left;\n\t\t\t\t\t\tif (startLeft > leftOfFindWidget) {\n\t\t\t\t\t\t\tadjustEditorScrollTop = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst endCoords = this._codeEditor.getScrolledVisiblePosition(selection.getEndPosition());\n\t\t\t\t\t\tconst endLeft = editorCoords.left + (endCoords ? endCoords.left : 0);\n\t\t\t\t\t\tif (endLeft > leftOfFindWidget) {\n\t\t\t\t\t\t\tadjustEditorScrollTop = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._showViewZone(adjustEditorScrollTop);\n\t\t}\n\t}\n\n\tprivate _hide(focusTheEditor: boolean): void {\n\t\tthis._revealTimeouts.forEach(e => {\n\t\t\tclearTimeout(e);\n\t\t});\n\n\t\tthis._revealTimeouts = [];\n\n\t\tif (this._isVisible) {\n\t\t\tthis._isVisible = false;\n\n\t\t\tthis._updateButtons();\n\n\t\t\tthis._domNode.classList.remove('visible');\n\t\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t\t\tthis._findInput.clearMessage();\n\t\t\tif (focusTheEditor) {\n\t\t\t\tthis._codeEditor.focus();\n\t\t\t}\n\t\t\tthis._codeEditor.layoutOverlayWidget(this);\n\t\t\tthis._removeViewZone();\n\t\t}\n\t}\n\n\tprivate _layoutViewZone(targetScrollTop?: number) {\n\t\tconst addExtraSpaceOnTop = this._codeEditor.getOption(EditorOption.find).addExtraSpaceOnTop;\n\n\t\tif (!addExtraSpaceOnTop) {\n\t\t\tthis._removeViewZone();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tconst viewZone = this._viewZone;\n\t\tif (this._viewZoneId !== undefined || !viewZone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._codeEditor.changeViewZones((accessor) => {\n\t\t\tviewZone.heightInPx = this._getHeight();\n\t\t\tthis._viewZoneId = accessor.addZone(viewZone);\n\t\t\t// scroll top adjust to make sure the editor doesn't scroll when adding viewzone at the beginning.\n\t\t\tthis._codeEditor.setScrollTop(targetScrollTop || this._codeEditor.getScrollTop() + viewZone.heightInPx);\n\t\t});\n\t}\n\n\tprivate _showViewZone(adjustScroll: boolean = true) {\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst addExtraSpaceOnTop = this._codeEditor.getOption(EditorOption.find).addExtraSpaceOnTop;\n\n\t\tif (!addExtraSpaceOnTop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._viewZone === undefined) {\n\t\t\tthis._viewZone = new FindWidgetViewZone(0);\n\t\t}\n\n\t\tconst viewZone = this._viewZone;\n\n\t\tthis._codeEditor.changeViewZones((accessor) => {\n\t\t\tif (this._viewZoneId !== undefined) {\n\t\t\t\t// the view zone already exists, we need to update the height\n\t\t\t\tconst newHeight = this._getHeight();\n\t\t\t\tif (newHeight === viewZone.heightInPx) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet scrollAdjustment = newHeight - viewZone.heightInPx;\n\t\t\t\tviewZone.heightInPx = newHeight;\n\t\t\t\taccessor.layoutZone(this._viewZoneId);\n\n\t\t\t\tif (adjustScroll) {\n\t\t\t\t\tthis._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tlet scrollAdjustment = this._getHeight();\n\n\t\t\t\t// if the editor has top padding, factor that into the zone height\n\t\t\t\tscrollAdjustment -= this._codeEditor.getOption(EditorOption.padding).top;\n\t\t\t\tif (scrollAdjustment <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tviewZone.heightInPx = scrollAdjustment;\n\t\t\t\tthis._viewZoneId = accessor.addZone(viewZone);\n\n\t\t\t\tif (adjustScroll) {\n\t\t\t\t\tthis._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _removeViewZone() {\n\t\tthis._codeEditor.changeViewZones((accessor) => {\n\t\t\tif (this._viewZoneId !== undefined) {\n\t\t\t\taccessor.removeZone(this._viewZoneId);\n\t\t\t\tthis._viewZoneId = undefined;\n\t\t\t\tif (this._viewZone) {\n\t\t\t\t\tthis._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx);\n\t\t\t\t\tthis._viewZone = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _applyTheme(theme: IColorTheme) {\n\t\tlet inputStyles: IFindInputStyles = {\n\t\t\tinputActiveOptionBorder: theme.getColor(inputActiveOptionBorder),\n\t\t\tinputActiveOptionBackground: theme.getColor(inputActiveOptionBackground),\n\t\t\tinputActiveOptionForeground: theme.getColor(inputActiveOptionForeground),\n\t\t\tinputBackground: theme.getColor(inputBackground),\n\t\t\tinputForeground: theme.getColor(inputForeground),\n\t\t\tinputBorder: theme.getColor(inputBorder),\n\t\t\tinputValidationInfoBackground: theme.getColor(inputValidationInfoBackground),\n\t\t\tinputValidationInfoForeground: theme.getColor(inputValidationInfoForeground),\n\t\t\tinputValidationInfoBorder: theme.getColor(inputValidationInfoBorder),\n\t\t\tinputValidationWarningBackground: theme.getColor(inputValidationWarningBackground),\n\t\t\tinputValidationWarningForeground: theme.getColor(inputValidationWarningForeground),\n\t\t\tinputValidationWarningBorder: theme.getColor(inputValidationWarningBorder),\n\t\t\tinputValidationErrorBackground: theme.getColor(inputValidationErrorBackground),\n\t\t\tinputValidationErrorForeground: theme.getColor(inputValidationErrorForeground),\n\t\t\tinputValidationErrorBorder: theme.getColor(inputValidationErrorBorder),\n\t\t};\n\t\tthis._findInput.style(inputStyles);\n\t\tthis._replaceInput.style(inputStyles);\n\t\tthis._toggleSelectionFind.style(inputStyles);\n\t}\n\n\tprivate _tryUpdateWidgetWidth() {\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tif (!dom.isInDOM(this._domNode)) {\n\t\t\t// the widget is not in the DOM\n\t\t\treturn;\n\t\t}\n\n\t\tconst layoutInfo = this._codeEditor.getLayoutInfo();\n\t\tconst editorContentWidth = layoutInfo.contentWidth;\n\n\t\tif (editorContentWidth <= 0) {\n\t\t\t// for example, diff view original editor\n\t\t\tthis._domNode.classList.add('hiddenEditor');\n\t\t\treturn;\n\t\t} else if (this._domNode.classList.contains('hiddenEditor')) {\n\t\t\tthis._domNode.classList.remove('hiddenEditor');\n\t\t}\n\n\t\tconst editorWidth = layoutInfo.width;\n\t\tconst minimapWidth = layoutInfo.minimap.minimapWidth;\n\t\tlet collapsedFindWidget = false;\n\t\tlet reducedFindWidget = false;\n\t\tlet narrowFindWidget = false;\n\n\t\tif (this._resized) {\n\t\t\tlet widgetWidth = dom.getTotalWidth(this._domNode);\n\n\t\t\tif (widgetWidth > FIND_WIDGET_INITIAL_WIDTH) {\n\t\t\t\t// as the widget is resized by users, we may need to change the max width of the widget as the editor width changes.\n\t\t\t\tthis._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`;\n\t\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth >= editorWidth) {\n\t\t\treducedFindWidget = true;\n\t\t}\n\t\tif (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth) {\n\t\t\tnarrowFindWidget = true;\n\t\t}\n\t\tif (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth + 50) {\n\t\t\tcollapsedFindWidget = true;\n\t\t}\n\t\tthis._domNode.classList.toggle('collapsed-find-widget', collapsedFindWidget);\n\t\tthis._domNode.classList.toggle('narrow-find-widget', narrowFindWidget);\n\t\tthis._domNode.classList.toggle('reduced-find-widget', reducedFindWidget);\n\n\t\tif (!narrowFindWidget && !collapsedFindWidget) {\n\t\t\t// the minimal left offset of findwidget is 15px.\n\t\t\tthis._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`;\n\t\t}\n\n\t\tif (this._resized) {\n\t\t\tthis._findInput.inputBox.layout();\n\t\t\tlet findInputWidth = this._findInput.inputBox.element.clientWidth;\n\t\t\tif (findInputWidth > 0) {\n\t\t\t\tthis._replaceInput.width = findInputWidth;\n\t\t\t}\n\t\t} else if (this._isReplaceVisible) {\n\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t}\n\t}\n\n\tprivate _getHeight(): number {\n\t\tlet totalheight = 0;\n\n\t\t// find input margin top\n\t\ttotalheight += 4;\n\n\t\t// find input height\n\t\ttotalheight += this._findInput.inputBox.height + 2 /** input box border */;\n\n\t\tif (this._isReplaceVisible) {\n\t\t\t// replace input margin\n\t\t\ttotalheight += 4;\n\n\t\t\ttotalheight += this._replaceInput.inputBox.height + 2 /** input box border */;\n\t\t}\n\n\t\t// margin bottom\n\t\ttotalheight += 4;\n\t\treturn totalheight;\n\t}\n\n\tprivate _tryUpdateHeight(): boolean {\n\t\tconst totalHeight = this._getHeight();\n\t\tif (this._cachedHeight !== null && this._cachedHeight === totalHeight) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._cachedHeight = totalHeight;\n\t\tthis._domNode.style.height = `${totalHeight}px`;\n\n\t\treturn true;\n\t}\n\n\t// ----- Public\n\n\tpublic focusFindInput(): void {\n\t\tthis._findInput.select();\n\t\t// Edge browser requires focus() in addition to select()\n\t\tthis._findInput.focus();\n\t}\n\n\tpublic focusReplaceInput(): void {\n\t\tthis._replaceInput.select();\n\t\t// Edge browser requires focus() in addition to select()\n\t\tthis._replaceInput.focus();\n\t}\n\n\tpublic highlightFindOptions(): void {\n\t\tthis._findInput.highlightFindOptions();\n\t}\n\n\tprivate _updateSearchScope(): void {\n\t\tif (!this._codeEditor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._toggleSelectionFind.checked) {\n\t\t\tlet selections = this._codeEditor.getSelections();\n\n\t\t\tselections.map(selection => {\n\t\t\t\tif (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\t\tselection = selection.setEndPosition(\n\t\t\t\t\t\tselection.endLineNumber - 1,\n\t\t\t\t\t\tthis._codeEditor.getModel()!.getLineMaxColumn(selection.endLineNumber - 1)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst currentMatch = this._state.currentMatch;\n\t\t\t\tif (selection.startLineNumber !== selection.endLineNumber) {\n\t\t\t\t\tif (!Range.equalsRange(selection, currentMatch)) {\n\t\t\t\t\t\treturn selection;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}).filter(element => !!element);\n\n\t\t\tif (selections.length) {\n\t\t\t\tthis._state.change({ searchScope: selections as Range[] }, true);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onFindInputMouseDown(e: IMouseEvent): void {\n\t\t// on linux, middle key does pasting.\n\t\tif (e.middleButton) {\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\tprivate _onFindInputKeyDown(e: IKeyboardEvent): void {\n\t\tif (e.equals(ctrlKeyMod | KeyCode.Enter)) {\n\t\t\tif (this._keybindingService.dispatchEvent(e, e.target)) {\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tthis._findInput.inputBox.insertAtCursor('\\n');\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\tif (this._isReplaceVisible) {\n\t\t\t\tthis._replaceInput.focus();\n\t\t\t} else {\n\t\t\t\tthis._findInput.focusOnCaseSensitive();\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyMod.CtrlCmd | KeyCode.DownArrow)) {\n\t\t\tthis._codeEditor.focus();\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyCode.UpArrow)) {\n\t\t\treturn stopPropagationForMultiLineUpwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea'));\n\t\t}\n\n\t\tif (e.equals(KeyCode.DownArrow)) {\n\t\t\treturn stopPropagationForMultiLineDownwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea'));\n\t\t}\n\t}\n\n\tprivate _onReplaceInputKeyDown(e: IKeyboardEvent): void {\n\t\tif (e.equals(ctrlKeyMod | KeyCode.Enter)) {\n\t\t\tif (this._keybindingService.dispatchEvent(e, e.target)) {\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tif (platform.isWindows && platform.isNative && !this._ctrlEnterReplaceAllWarningPrompted) {\n\t\t\t\t\t// this is the first time when users press Ctrl + Enter to replace all\n\t\t\t\t\tthis._notificationService.info(\n\t\t\t\t\t\tnls.localize('ctrlEnter.keybindingChanged',\n\t\t\t\t\t\t\t'Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.')\n\t\t\t\t\t);\n\n\t\t\t\t\tthis._ctrlEnterReplaceAllWarningPrompted = true;\n\t\t\t\t\tthis._storageService.store(ctrlEnterReplaceAllWarningPromptedKey, true, StorageScope.GLOBAL, StorageTarget.USER);\n\t\t\t\t}\n\n\t\t\t\tthis._replaceInput.inputBox.insertAtCursor('\\n');\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\n\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\tthis._findInput.focusOnCaseSensitive();\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyMod.Shift | KeyCode.Tab)) {\n\t\t\tthis._findInput.focus();\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyMod.CtrlCmd | KeyCode.DownArrow)) {\n\t\t\tthis._codeEditor.focus();\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyCode.UpArrow)) {\n\t\t\treturn stopPropagationForMultiLineUpwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea'));\n\t\t}\n\n\t\tif (e.equals(KeyCode.DownArrow)) {\n\t\t\treturn stopPropagationForMultiLineDownwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea'));\n\t\t}\n\t}\n\n\t// ----- sash\n\tpublic getVerticalSashLeft(_sash: Sash): number {\n\t\treturn 0;\n\t}\n\t// ----- initialization\n\n\tprivate _keybindingLabelFor(actionId: string): string {\n\t\tlet kb = this._keybindingService.lookupKeybinding(actionId);\n\t\tif (!kb) {\n\t\t\treturn '';\n\t\t}\n\t\treturn ` (${kb.getLabel()})`;\n\t}\n\n\tprivate _buildDomNode(): void {\n\t\tconst flexibleHeight = true;\n\t\tconst flexibleWidth = true;\n\t\t// Find input\n\t\tthis._findInput = this._register(new ContextScopedFindInput(null, this._contextViewProvider, {\n\t\t\twidth: FIND_INPUT_AREA_WIDTH,\n\t\t\tlabel: NLS_FIND_INPUT_LABEL,\n\t\t\tplaceholder: NLS_FIND_INPUT_PLACEHOLDER,\n\t\t\tappendCaseSensitiveLabel: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),\n\t\t\tappendWholeWordsLabel: this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),\n\t\t\tappendRegexLabel: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),\n\t\t\tvalidation: (value: string): InputBoxMessage | null => {\n\t\t\t\tif (value.length === 0 || !this._findInput.getRegex()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\t// use `g` and `u` which are also used by the TextModel search\n\t\t\t\t\tnew RegExp(value, 'gu');\n\t\t\t\t\treturn null;\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn { content: e.message };\n\t\t\t\t}\n\t\t\t},\n\t\t\tflexibleHeight,\n\t\t\tflexibleWidth,\n\t\t\tflexibleMaxHeight: 118,\n\t\t\tshowHistoryHint: () => showHistoryKeybindingHint(this._keybindingService)\n\t\t}, this._contextKeyService, true));\n\t\tthis._findInput.setRegex(!!this._state.isRegex);\n\t\tthis._findInput.setCaseSensitive(!!this._state.matchCase);\n\t\tthis._findInput.setWholeWords(!!this._state.wholeWord);\n\t\tthis._register(this._findInput.onKeyDown((e) => this._onFindInputKeyDown(e)));\n\t\tthis._register(this._findInput.inputBox.onDidChange(() => {\n\t\t\tif (this._ignoreChangeEvent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._state.change({ searchString: this._findInput.getValue() }, true);\n\t\t}));\n\t\tthis._register(this._findInput.onDidOptionChange(() => {\n\t\t\tthis._state.change({\n\t\t\t\tisRegex: this._findInput.getRegex(),\n\t\t\t\twholeWord: this._findInput.getWholeWords(),\n\t\t\t\tmatchCase: this._findInput.getCaseSensitive()\n\t\t\t}, true);\n\t\t}));\n\t\tthis._register(this._findInput.onCaseSensitiveKeyDown((e) => {\n\t\t\tif (e.equals(KeyMod.Shift | KeyCode.Tab)) {\n\t\t\t\tif (this._isReplaceVisible) {\n\t\t\t\t\tthis._replaceInput.focus();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._findInput.onRegexKeyDown((e) => {\n\t\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\t\tif (this._isReplaceVisible) {\n\t\t\t\t\tthis._replaceInput.focusOnPreserve();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._findInput.inputBox.onDidHeightChange((e) => {\n\t\t\tif (this._tryUpdateHeight()) {\n\t\t\t\tthis._showViewZone();\n\t\t\t}\n\t\t}));\n\t\tif (platform.isLinux) {\n\t\t\tthis._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e)));\n\t\t}\n\n\t\tthis._matchesCount = document.createElement('div');\n\t\tthis._matchesCount.className = 'matchesCount';\n\t\tthis._updateMatchesCount();\n\n\t\t// Previous button\n\t\tthis._prevBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction),\n\t\t\ticon: findPreviousMatchIcon,\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(undefined, onUnexpectedError);\n\t\t\t}\n\t\t}));\n\n\t\t// Next button\n\t\tthis._nextBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.NextMatchFindAction),\n\t\t\ticon: findNextMatchIcon,\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(undefined, onUnexpectedError);\n\t\t\t}\n\t\t}));\n\n\t\tlet findPart = document.createElement('div');\n\t\tfindPart.className = 'find-part';\n\t\tfindPart.appendChild(this._findInput.domNode);\n\t\tconst actionsContainer = document.createElement('div');\n\t\tactionsContainer.className = 'find-actions';\n\t\tfindPart.appendChild(actionsContainer);\n\t\tactionsContainer.appendChild(this._matchesCount);\n\t\tactionsContainer.appendChild(this._prevBtn.domNode);\n\t\tactionsContainer.appendChild(this._nextBtn.domNode);\n\n\t\t// Toggle selection button\n\t\tthis._toggleSelectionFind = this._register(new Checkbox({\n\t\t\ticon: findSelectionIcon,\n\t\t\ttitle: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand),\n\t\t\tisChecked: false\n\t\t}));\n\n\t\tthis._register(this._toggleSelectionFind.onChange(() => {\n\t\t\tif (this._toggleSelectionFind.checked) {\n\t\t\t\tif (this._codeEditor.hasModel()) {\n\t\t\t\t\tlet selections = this._codeEditor.getSelections();\n\t\t\t\t\tselections.map(selection => {\n\t\t\t\t\t\tif (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\t\t\t\tselection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel()!.getLineMaxColumn(selection.endLineNumber - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\t\t\treturn selection;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}).filter(element => !!element);\n\n\t\t\t\t\tif (selections.length) {\n\t\t\t\t\t\tthis._state.change({ searchScope: selections as Range[] }, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._state.change({ searchScope: null }, true);\n\t\t\t}\n\t\t}));\n\n\t\tactionsContainer.appendChild(this._toggleSelectionFind.domNode);\n\n\t\t// Close button\n\t\tthis._closeBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand),\n\t\t\ticon: widgetClose,\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._state.change({ isRevealed: false, searchScope: null }, false);\n\t\t\t},\n\t\t\tonKeyDown: (e) => {\n\t\t\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\t\t\tif (this._isReplaceVisible) {\n\t\t\t\t\t\tif (this._replaceBtn.isEnabled()) {\n\t\t\t\t\t\t\tthis._replaceBtn.focus();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._codeEditor.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tactionsContainer.appendChild(this._closeBtn.domNode);\n\n\t\t// Replace input\n\t\tthis._replaceInput = this._register(new ContextScopedReplaceInput(null, undefined, {\n\t\t\tlabel: NLS_REPLACE_INPUT_LABEL,\n\t\t\tplaceholder: NLS_REPLACE_INPUT_PLACEHOLDER,\n\t\t\tappendPreserveCaseLabel: this._keybindingLabelFor(FIND_IDS.TogglePreserveCaseCommand),\n\t\t\thistory: [],\n\t\t\tflexibleHeight,\n\t\t\tflexibleWidth,\n\t\t\tflexibleMaxHeight: 118,\n\t\t\tshowHistoryHint: () => showHistoryKeybindingHint(this._keybindingService)\n\t\t}, this._contextKeyService, true));\n\t\tthis._replaceInput.setPreserveCase(!!this._state.preserveCase);\n\t\tthis._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e)));\n\t\tthis._register(this._replaceInput.inputBox.onDidChange(() => {\n\t\t\tthis._state.change({ replaceString: this._replaceInput.inputBox.value }, false);\n\t\t}));\n\t\tthis._register(this._replaceInput.inputBox.onDidHeightChange((e) => {\n\t\t\tif (this._isReplaceVisible && this._tryUpdateHeight()) {\n\t\t\t\tthis._showViewZone();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._replaceInput.onDidOptionChange(() => {\n\t\t\tthis._state.change({\n\t\t\t\tpreserveCase: this._replaceInput.getPreserveCase()\n\t\t\t}, true);\n\t\t}));\n\t\tthis._register(this._replaceInput.onPreserveCaseKeyDown((e) => {\n\t\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\t\tif (this._prevBtn.isEnabled()) {\n\t\t\t\t\tthis._prevBtn.focus();\n\t\t\t\t} else if (this._nextBtn.isEnabled()) {\n\t\t\t\t\tthis._nextBtn.focus();\n\t\t\t\t} else if (this._toggleSelectionFind.enabled) {\n\t\t\t\t\tthis._toggleSelectionFind.focus();\n\t\t\t\t} else if (this._closeBtn.isEnabled()) {\n\t\t\t\t\tthis._closeBtn.focus();\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}));\n\n\t\t// Replace one button\n\t\tthis._replaceBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_REPLACE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceOneAction),\n\t\t\ticon: findReplaceIcon,\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._controller.replace();\n\t\t\t},\n\t\t\tonKeyDown: (e) => {\n\t\t\t\tif (e.equals(KeyMod.Shift | KeyCode.Tab)) {\n\t\t\t\t\tthis._closeBtn.focus();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Replace all button\n\t\tthis._replaceAllBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_REPLACE_ALL_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceAllAction),\n\t\t\ticon: findReplaceAllIcon,\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._controller.replaceAll();\n\t\t\t}\n\t\t}));\n\n\t\tlet replacePart = document.createElement('div');\n\t\treplacePart.className = 'replace-part';\n\t\treplacePart.appendChild(this._replaceInput.domNode);\n\n\t\tconst replaceActionsContainer = document.createElement('div');\n\t\treplaceActionsContainer.className = 'replace-actions';\n\t\treplacePart.appendChild(replaceActionsContainer);\n\n\t\treplaceActionsContainer.appendChild(this._replaceBtn.domNode);\n\t\treplaceActionsContainer.appendChild(this._replaceAllBtn.domNode);\n\n\t\t// Toggle replace button\n\t\tthis._toggleReplaceBtn = this._register(new SimpleButton({\n\t\t\tlabel: NLS_TOGGLE_REPLACE_MODE_BTN_LABEL,\n\t\t\tclassName: 'codicon toggle left',\n\t\t\tonTrigger: () => {\n\t\t\t\tthis._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false);\n\t\t\t\tif (this._isReplaceVisible) {\n\t\t\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t\t\t\tthis._replaceInput.inputBox.layout();\n\t\t\t\t}\n\t\t\t\tthis._showViewZone();\n\t\t\t}\n\t\t}));\n\t\tthis._toggleReplaceBtn.setExpanded(this._isReplaceVisible);\n\n\t\t// Widget\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'editor-widget find-widget';\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t\t// We need to set this explicitly, otherwise on IE11, the width inheritence of flex doesn't work.\n\t\tthis._domNode.style.width = `${FIND_WIDGET_INITIAL_WIDTH}px`;\n\n\t\tthis._domNode.appendChild(this._toggleReplaceBtn.domNode);\n\t\tthis._domNode.appendChild(findPart);\n\t\tthis._domNode.appendChild(replacePart);\n\n\t\tthis._resizeSash = new Sash(this._domNode, this, { orientation: Orientation.VERTICAL, size: 2 });\n\t\tthis._resized = false;\n\t\tlet originalWidth = FIND_WIDGET_INITIAL_WIDTH;\n\n\t\tthis._register(this._resizeSash.onDidStart(() => {\n\t\t\toriginalWidth = dom.getTotalWidth(this._domNode);\n\t\t}));\n\n\t\tthis._register(this._resizeSash.onDidChange((evt: ISashEvent) => {\n\t\t\tthis._resized = true;\n\t\t\tlet width = originalWidth + evt.startX - evt.currentX;\n\n\t\t\tif (width < FIND_WIDGET_INITIAL_WIDTH) {\n\t\t\t\t// narrow down the find widget should be handled by CSS.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst maxWidth = parseFloat(dom.getComputedStyle(this._domNode).maxWidth!) || 0;\n\t\t\tif (width > maxWidth) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._domNode.style.width = `${width}px`;\n\t\t\tif (this._isReplaceVisible) {\n\t\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t\t}\n\n\t\t\tthis._findInput.inputBox.layout();\n\t\t\tthis._tryUpdateHeight();\n\t\t}));\n\n\t\tthis._register(this._resizeSash.onDidReset(() => {\n\t\t\t// users double click on the sash\n\t\t\tconst currentWidth = dom.getTotalWidth(this._domNode);\n\n\t\t\tif (currentWidth < FIND_WIDGET_INITIAL_WIDTH) {\n\t\t\t\t// The editor is narrow and the width of the find widget is controlled fully by CSS.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet width = FIND_WIDGET_INITIAL_WIDTH;\n\n\t\t\tif (!this._resized || currentWidth === FIND_WIDGET_INITIAL_WIDTH) {\n\t\t\t\t// 1. never resized before, double click should maximizes it\n\t\t\t\t// 2. users resized it already but its width is the same as default\n\t\t\t\tconst layoutInfo = this._codeEditor.getLayoutInfo();\n\t\t\t\twidth = layoutInfo.width - 28 - layoutInfo.minimap.minimapWidth - 15;\n\t\t\t\tthis._resized = true;\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * no op, the find widget should be shrinked to its default size.\n\t\t\t\t */\n\t\t\t}\n\n\n\t\t\tthis._domNode.style.width = `${width}px`;\n\t\t\tif (this._isReplaceVisible) {\n\t\t\t\tthis._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);\n\t\t\t}\n\n\t\t\tthis._findInput.inputBox.layout();\n\t\t}));\n\t}\n\n\tprivate updateAccessibilitySupport(): void {\n\t\tconst value = this._codeEditor.getOption(EditorOption.accessibilitySupport);\n\t\tthis._findInput.setFocusInputOnOptionClick(value !== AccessibilitySupport.Enabled);\n\t}\n}\n\nexport interface ISimpleButtonOpts {\n\treadonly label: string;\n\treadonly className?: string;\n\treadonly icon?: ThemeIcon;\n\treadonly onTrigger: () => void;\n\treadonly onKeyDown?: (e: IKeyboardEvent) => void;\n}\n\nexport class SimpleButton extends Widget {\n\n\tprivate readonly _opts: ISimpleButtonOpts;\n\tprivate readonly _domNode: HTMLElement;\n\n\tconstructor(opts: ISimpleButtonOpts) {\n\t\tsuper();\n\t\tthis._opts = opts;\n\n\t\tlet className = 'button';\n\t\tif (this._opts.className) {\n\t\t\tclassName = className + ' ' + this._opts.className;\n\t\t}\n\t\tif (this._opts.icon) {\n\t\t\tclassName = className + ' ' + ThemeIcon.asClassName(this._opts.icon);\n\t\t}\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.title = this._opts.label;\n\t\tthis._domNode.tabIndex = 0;\n\t\tthis._domNode.className = className;\n\t\tthis._domNode.setAttribute('role', 'button');\n\t\tthis._domNode.setAttribute('aria-label', this._opts.label);\n\n\t\tthis.onclick(this._domNode, (e) => {\n\t\t\tthis._opts.onTrigger();\n\t\t\te.preventDefault();\n\t\t});\n\n\t\tthis.onkeydown(this._domNode, (e) => {\n\t\t\tif (e.equals(KeyCode.Space) || e.equals(KeyCode.Enter)) {\n\t\t\t\tthis._opts.onTrigger();\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._opts.onKeyDown) {\n\t\t\t\tthis._opts.onKeyDown(e);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic get domNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic isEnabled(): boolean {\n\t\treturn (this._domNode.tabIndex >= 0);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._domNode.focus();\n\t}\n\n\tpublic setEnabled(enabled: boolean): void {\n\t\tthis._domNode.classList.toggle('disabled', !enabled);\n\t\tthis._domNode.setAttribute('aria-disabled', String(!enabled));\n\t\tthis._domNode.tabIndex = enabled ? 0 : -1;\n\t}\n\n\tpublic setExpanded(expanded: boolean): void {\n\t\tthis._domNode.setAttribute('aria-expanded', String(!!expanded));\n\t\tif (expanded) {\n\t\t\tthis._domNode.classList.remove(...ThemeIcon.asClassNameArray(findCollapsedIcon));\n\t\t\tthis._domNode.classList.add(...ThemeIcon.asClassNameArray(findExpandedIcon));\n\t\t} else {\n\t\t\tthis._domNode.classList.remove(...ThemeIcon.asClassNameArray(findExpandedIcon));\n\t\t\tthis._domNode.classList.add(...ThemeIcon.asClassNameArray(findCollapsedIcon));\n\t\t}\n\t}\n}\n\n// theming\n\nregisterThemingParticipant((theme, collector) => {\n\tconst addBackgroundColorRule = (selector: string, color: Color | undefined): void => {\n\t\tif (color) {\n\t\t\tcollector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`);\n\t\t}\n\t};\n\n\taddBackgroundColorRule('.findMatch', theme.getColor(editorFindMatchHighlight));\n\taddBackgroundColorRule('.currentFindMatch', theme.getColor(editorFindMatch));\n\taddBackgroundColorRule('.findScope', theme.getColor(editorFindRangeHighlight));\n\n\tconst widgetBackground = theme.getColor(editorWidgetBackground);\n\taddBackgroundColorRule('.find-widget', widgetBackground);\n\n\tconst widgetShadowColor = theme.getColor(widgetShadow);\n\tif (widgetShadowColor) {\n\t\tcollector.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${widgetShadowColor}; }`);\n\t}\n\n\tconst findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);\n\tif (findMatchHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .findMatch { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);\n\t}\n\n\tconst findMatchBorder = theme.getColor(editorFindMatchBorder);\n\tif (findMatchBorder) {\n\t\tcollector.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${findMatchBorder}; padding: 1px; box-sizing: border-box; }`);\n\t}\n\n\tconst findRangeHighlightBorder = theme.getColor(editorFindRangeHighlightBorder);\n\tif (findRangeHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .findScope { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${findRangeHighlightBorder}; }`);\n\t}\n\n\tconst hcBorder = theme.getColor(contrastBorder);\n\tif (hcBorder) {\n\t\tcollector.addRule(`.monaco-editor .find-widget { border: 1px solid ${hcBorder}; }`);\n\t}\n\n\tconst foreground = theme.getColor(editorWidgetForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor .find-widget { color: ${foreground}; }`);\n\t}\n\n\tconst error = theme.getColor(errorForeground);\n\tif (error) {\n\t\tcollector.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${error}; }`);\n\t}\n\n\tconst resizeBorderBackground = theme.getColor(editorWidgetResizeBorder);\n\tif (resizeBorderBackground) {\n\t\tcollector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${resizeBorderBackground}; }`);\n\t} else {\n\t\tconst border = theme.getColor(editorWidgetBorder);\n\t\tif (border) {\n\t\t\tcollector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${border}; }`);\n\t\t}\n\t}\n\n\t// Action bars\n\tconst toolbarHoverBackgroundColor = theme.getColor(toolbarHoverBackground);\n\tif (toolbarHoverBackgroundColor) {\n\t\tcollector.addRule(`\n\t\t.monaco-editor .find-widget .button:not(.disabled):hover,\n\t\t.monaco-editor .find-widget .codicon-find-selection:hover {\n\t\t\tbackground-color: ${toolbarHoverBackgroundColor} !important;\n\t\t}\n\t`);\n\t}\n\n\t// This rule is used to override the outline color for synthetic-focus find input.\n\tconst focusOutline = theme.getColor(focusBorder);\n\tif (focusOutline) {\n\t\tcollector.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${focusOutline}; }`);\n\n\t}\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 { Delayer } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, MultiEditorAction, registerEditorAction, registerEditorCommand, registerEditorContribution, registerMultiEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_FIND_WIDGET_VISIBLE, CONTEXT_REPLACE_INPUT_FOCUSED, FindModelBoundToEditorModel, FIND_IDS, ToggleCaseSensitiveKeybinding, TogglePreserveCaseKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, ToggleWholeWordKeybinding } from 'vs/editor/contrib/find/browser/findModel';\nimport { FindOptionsWidget } from 'vs/editor/contrib/find/browser/findOptionsWidget';\nimport { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/contrib/find/browser/findState';\nimport { FindWidget, IFindController } from 'vs/editor/contrib/find/browser/findWidget';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nconst SEARCH_STRING_MAX_LENGTH = 524288;\n\nexport function getSelectionSearchString(editor: ICodeEditor, seedSearchStringFromSelection: 'single' | 'multiple' = 'single', seedSearchStringFromNonEmptySelection: boolean = false): string | null {\n\tif (!editor.hasModel()) {\n\t\treturn null;\n\t}\n\n\tconst selection = editor.getSelection();\n\t// if selection spans multiple lines, default search string to empty\n\n\tif ((seedSearchStringFromSelection === 'single' && selection.startLineNumber === selection.endLineNumber)\n\t\t|| seedSearchStringFromSelection === 'multiple') {\n\t\tif (selection.isEmpty()) {\n\t\t\tconst wordAtPosition = editor.getConfiguredWordAtPosition(selection.getStartPosition());\n\t\t\tif (wordAtPosition && (false === seedSearchStringFromNonEmptySelection)) {\n\t\t\t\treturn wordAtPosition.word;\n\t\t\t}\n\t\t} else {\n\t\t\tif (editor.getModel().getValueLengthInRange(selection) < SEARCH_STRING_MAX_LENGTH) {\n\t\t\t\treturn editor.getModel().getValueInRange(selection);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport const enum FindStartFocusAction {\n\tNoFocusChange,\n\tFocusFindInput,\n\tFocusReplaceInput\n}\n\nexport interface IFindStartOptions {\n\tforceRevealReplace: boolean;\n\tseedSearchStringFromSelection: 'none' | 'single' | 'multiple';\n\tseedSearchStringFromNonEmptySelection: boolean;\n\tseedSearchStringFromGlobalClipboard: boolean;\n\tshouldFocus: FindStartFocusAction;\n\tshouldAnimate: boolean;\n\tupdateSearchScope: boolean;\n\tloop: boolean;\n}\n\nexport interface IFindStartArguments {\n\tsearchString?: string;\n\treplaceString?: string;\n\tisRegex?: boolean;\n\tmatchWholeWord?: boolean;\n\tisCaseSensitive?: boolean;\n\tpreserveCase?: boolean;\n\tfindInSelection?: boolean;\n}\n\nexport class CommonFindController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.findController';\n\n\tprotected _editor: ICodeEditor;\n\tprivate readonly _findWidgetVisible: IContextKey<boolean>;\n\tprotected _state: FindReplaceState;\n\tprotected _updateHistoryDelayer: Delayer<void>;\n\tprivate _model: FindModelBoundToEditorModel | null;\n\tprotected readonly _storageService: IStorageService;\n\tprivate readonly _clipboardService: IClipboardService;\n\tprotected readonly _contextKeyService: IContextKeyService;\n\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\tpublic static get(editor: ICodeEditor): CommonFindController | null {\n\t\treturn editor.getContribution<CommonFindController>(CommonFindController.ID);\n\t}\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IStorageService storageService: IStorageService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._findWidgetVisible = CONTEXT_FIND_WIDGET_VISIBLE.bindTo(contextKeyService);\n\t\tthis._contextKeyService = contextKeyService;\n\t\tthis._storageService = storageService;\n\t\tthis._clipboardService = clipboardService;\n\n\t\tthis._updateHistoryDelayer = new Delayer<void>(500);\n\t\tthis._state = this._register(new FindReplaceState());\n\t\tthis.loadQueryState();\n\t\tthis._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis._model = null;\n\n\t\tthis._register(this._editor.onDidChangeModel(() => {\n\t\t\tlet shouldRestartFind = (this._editor.getModel() && this._state.isRevealed);\n\n\t\t\tthis.disposeModel();\n\n\t\t\tthis._state.change({\n\t\t\t\tsearchScope: null,\n\t\t\t\tmatchCase: this._storageService.getBoolean('editor.matchCase', StorageScope.WORKSPACE, false),\n\t\t\t\twholeWord: this._storageService.getBoolean('editor.wholeWord', StorageScope.WORKSPACE, false),\n\t\t\t\tisRegex: this._storageService.getBoolean('editor.isRegex', StorageScope.WORKSPACE, false),\n\t\t\t\tpreserveCase: this._storageService.getBoolean('editor.preserveCase', StorageScope.WORKSPACE, false)\n\t\t\t}, false);\n\n\t\t\tif (shouldRestartFind) {\n\t\t\t\tthis._start({\n\t\t\t\t\tforceRevealReplace: false,\n\t\t\t\t\tseedSearchStringFromSelection: 'none',\n\t\t\t\t\tseedSearchStringFromNonEmptySelection: false,\n\t\t\t\t\tseedSearchStringFromGlobalClipboard: false,\n\t\t\t\t\tshouldFocus: FindStartFocusAction.NoFocusChange,\n\t\t\t\t\tshouldAnimate: false,\n\t\t\t\t\tupdateSearchScope: false,\n\t\t\t\t\tloop: this._editor.getOption(EditorOption.find).loop\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.disposeModel();\n\t\tsuper.dispose();\n\t}\n\n\tprivate disposeModel(): void {\n\t\tif (this._model) {\n\t\t\tthis._model.dispose();\n\t\t\tthis._model = null;\n\t\t}\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tthis.saveQueryState(e);\n\n\t\tif (e.isRevealed) {\n\t\t\tif (this._state.isRevealed) {\n\t\t\t\tthis._findWidgetVisible.set(true);\n\t\t\t} else {\n\t\t\t\tthis._findWidgetVisible.reset();\n\t\t\t\tthis.disposeModel();\n\t\t\t}\n\t\t}\n\t\tif (e.searchString) {\n\t\t\tthis.setGlobalBufferTerm(this._state.searchString);\n\t\t}\n\t}\n\n\tprivate saveQueryState(e: FindReplaceStateChangedEvent) {\n\t\tif (e.isRegex) {\n\t\t\tthis._storageService.store('editor.isRegex', this._state.actualIsRegex, StorageScope.WORKSPACE, StorageTarget.USER);\n\t\t}\n\t\tif (e.wholeWord) {\n\t\t\tthis._storageService.store('editor.wholeWord', this._state.actualWholeWord, StorageScope.WORKSPACE, StorageTarget.USER);\n\t\t}\n\t\tif (e.matchCase) {\n\t\t\tthis._storageService.store('editor.matchCase', this._state.actualMatchCase, StorageScope.WORKSPACE, StorageTarget.USER);\n\t\t}\n\t\tif (e.preserveCase) {\n\t\t\tthis._storageService.store('editor.preserveCase', this._state.actualPreserveCase, StorageScope.WORKSPACE, StorageTarget.USER);\n\t\t}\n\t}\n\n\tprivate loadQueryState() {\n\t\tthis._state.change({\n\t\t\tmatchCase: this._storageService.getBoolean('editor.matchCase', StorageScope.WORKSPACE, this._state.matchCase),\n\t\t\twholeWord: this._storageService.getBoolean('editor.wholeWord', StorageScope.WORKSPACE, this._state.wholeWord),\n\t\t\tisRegex: this._storageService.getBoolean('editor.isRegex', StorageScope.WORKSPACE, this._state.isRegex),\n\t\t\tpreserveCase: this._storageService.getBoolean('editor.preserveCase', StorageScope.WORKSPACE, this._state.preserveCase)\n\t\t}, false);\n\t}\n\n\tpublic isFindInputFocused(): boolean {\n\t\treturn !!CONTEXT_FIND_INPUT_FOCUSED.getValue(this._contextKeyService);\n\t}\n\n\tpublic getState(): FindReplaceState {\n\t\treturn this._state;\n\t}\n\n\tpublic closeFindWidget(): void {\n\t\tthis._state.change({\n\t\t\tisRevealed: false,\n\t\t\tsearchScope: null\n\t\t}, false);\n\t\tthis._editor.focus();\n\t}\n\n\tpublic toggleCaseSensitive(): void {\n\t\tthis._state.change({ matchCase: !this._state.matchCase }, false);\n\t\tif (!this._state.isRevealed) {\n\t\t\tthis.highlightFindOptions();\n\t\t}\n\t}\n\n\tpublic toggleWholeWords(): void {\n\t\tthis._state.change({ wholeWord: !this._state.wholeWord }, false);\n\t\tif (!this._state.isRevealed) {\n\t\t\tthis.highlightFindOptions();\n\t\t}\n\t}\n\n\tpublic toggleRegex(): void {\n\t\tthis._state.change({ isRegex: !this._state.isRegex }, false);\n\t\tif (!this._state.isRevealed) {\n\t\t\tthis.highlightFindOptions();\n\t\t}\n\t}\n\n\tpublic togglePreserveCase(): void {\n\t\tthis._state.change({ preserveCase: !this._state.preserveCase }, false);\n\t\tif (!this._state.isRevealed) {\n\t\t\tthis.highlightFindOptions();\n\t\t}\n\t}\n\n\tpublic toggleSearchScope(): void {\n\t\tif (this._state.searchScope) {\n\t\t\tthis._state.change({ searchScope: null }, true);\n\t\t} else {\n\t\t\tif (this._editor.hasModel()) {\n\t\t\t\tlet selections = this._editor.getSelections();\n\t\t\t\tselections.map(selection => {\n\t\t\t\t\tif (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\t\t\tselection = selection.setEndPosition(\n\t\t\t\t\t\t\tselection.endLineNumber - 1,\n\t\t\t\t\t\t\tthis._editor.getModel()!.getLineMaxColumn(selection.endLineNumber - 1)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\t\treturn selection;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}).filter(element => !!element);\n\n\t\t\t\tif (selections.length) {\n\t\t\t\t\tthis._state.change({ searchScope: selections }, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setSearchString(searchString: string): void {\n\t\tif (this._state.isRegex) {\n\t\t\tsearchString = strings.escapeRegExpCharacters(searchString);\n\t\t}\n\t\tthis._state.change({ searchString: searchString }, false);\n\t}\n\n\tpublic highlightFindOptions(ignoreWhenVisible: boolean = false): void {\n\t\t// overwritten in subclass\n\t}\n\n\tprotected async _start(opts: IFindStartOptions, newState?: INewFindReplaceState): Promise<void> {\n\t\tthis.disposeModel();\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// cannot do anything with an editor that doesn't have a model...\n\t\t\treturn;\n\t\t}\n\n\t\tlet stateChanges: INewFindReplaceState = {\n\t\t\t...newState,\n\t\t\tisRevealed: true\n\t\t};\n\n\t\tif (opts.seedSearchStringFromSelection === 'single') {\n\t\t\tlet selectionSearchString = getSelectionSearchString(this._editor, opts.seedSearchStringFromSelection, opts.seedSearchStringFromNonEmptySelection);\n\t\t\tif (selectionSearchString) {\n\t\t\t\tif (this._state.isRegex) {\n\t\t\t\t\tstateChanges.searchString = strings.escapeRegExpCharacters(selectionSearchString);\n\t\t\t\t} else {\n\t\t\t\t\tstateChanges.searchString = selectionSearchString;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (opts.seedSearchStringFromSelection === 'multiple' && !opts.updateSearchScope) {\n\t\t\tlet selectionSearchString = getSelectionSearchString(this._editor, opts.seedSearchStringFromSelection);\n\t\t\tif (selectionSearchString) {\n\t\t\t\tstateChanges.searchString = selectionSearchString;\n\t\t\t}\n\t\t}\n\n\t\tif (!stateChanges.searchString && opts.seedSearchStringFromGlobalClipboard) {\n\t\t\tlet selectionSearchString = await this.getGlobalBufferTerm();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t// the editor has lost its model in the meantime\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (selectionSearchString) {\n\t\t\t\tstateChanges.searchString = selectionSearchString;\n\t\t\t}\n\t\t}\n\n\t\t// Overwrite isReplaceRevealed\n\t\tif (opts.forceRevealReplace || stateChanges.isReplaceRevealed) {\n\t\t\tstateChanges.isReplaceRevealed = true;\n\t\t} else if (!this._findWidgetVisible.get()) {\n\t\t\tstateChanges.isReplaceRevealed = false;\n\t\t}\n\n\t\tif (opts.updateSearchScope) {\n\t\t\tlet currentSelections = this._editor.getSelections();\n\t\t\tif (currentSelections.some(selection => !selection.isEmpty())) {\n\t\t\t\tstateChanges.searchScope = currentSelections;\n\t\t\t}\n\t\t}\n\n\t\tstateChanges.loop = opts.loop;\n\n\t\tthis._state.change(stateChanges, false);\n\n\t\tif (!this._model) {\n\t\t\tthis._model = new FindModelBoundToEditorModel(this._editor, this._state);\n\t\t}\n\t}\n\n\tpublic start(opts: IFindStartOptions, newState?: INewFindReplaceState): Promise<void> {\n\t\treturn this._start(opts, newState);\n\t}\n\n\tpublic moveToNextMatch(): boolean {\n\t\tif (this._model) {\n\t\t\tthis._model.moveToNextMatch();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic moveToPrevMatch(): boolean {\n\t\tif (this._model) {\n\t\t\tthis._model.moveToPrevMatch();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic replace(): boolean {\n\t\tif (this._model) {\n\t\t\tthis._model.replace();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic replaceAll(): boolean {\n\t\tif (this._model) {\n\t\t\tthis._model.replaceAll();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic selectAllMatches(): boolean {\n\t\tif (this._model) {\n\t\t\tthis._model.selectAllMatches();\n\t\t\tthis._editor.focus();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic async getGlobalBufferTerm(): Promise<string> {\n\t\tif (this._editor.getOption(EditorOption.find).globalFindClipboard\n\t\t\t&& this._editor.hasModel()\n\t\t\t&& !this._editor.getModel().isTooLargeForSyncing()\n\t\t) {\n\t\t\treturn this._clipboardService.readFindText();\n\t\t}\n\t\treturn '';\n\t}\n\n\tpublic setGlobalBufferTerm(text: string): void {\n\t\tif (this._editor.getOption(EditorOption.find).globalFindClipboard\n\t\t\t&& this._editor.hasModel()\n\t\t\t&& !this._editor.getModel().isTooLargeForSyncing()\n\t\t) {\n\t\t\t// intentionally not awaited\n\t\t\tthis._clipboardService.writeFindText(text);\n\t\t}\n\t}\n}\n\nexport class FindController extends CommonFindController implements IFindController {\n\n\tprivate _widget: FindWidget | null;\n\tprivate _findOptionsWidget: FindOptionsWidget | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IContextKeyService _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IStorageService _storageService: IStorageService,\n\t\t@IClipboardService clipboardService: IClipboardService,\n\t) {\n\t\tsuper(editor, _contextKeyService, _storageService, clipboardService);\n\t\tthis._widget = null;\n\t\tthis._findOptionsWidget = null;\n\t}\n\n\tprotected override async _start(opts: IFindStartOptions, newState?: INewFindReplaceState): Promise<void> {\n\t\tif (!this._widget) {\n\t\t\tthis._createFindWidget();\n\t\t}\n\n\t\tconst selection = this._editor.getSelection();\n\t\tlet updateSearchScope = false;\n\n\t\tswitch (this._editor.getOption(EditorOption.find).autoFindInSelection) {\n\t\t\tcase 'always':\n\t\t\t\tupdateSearchScope = true;\n\t\t\t\tbreak;\n\t\t\tcase 'never':\n\t\t\t\tupdateSearchScope = false;\n\t\t\t\tbreak;\n\t\t\tcase 'multiline': {\n\t\t\t\tconst isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber;\n\t\t\t\tupdateSearchScope = isSelectionMultipleLine;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\topts.updateSearchScope = opts.updateSearchScope || updateSearchScope;\n\n\t\tawait super._start(opts, newState);\n\n\t\tif (this._widget) {\n\t\t\tif (opts.shouldFocus === FindStartFocusAction.FocusReplaceInput) {\n\t\t\t\tthis._widget.focusReplaceInput();\n\t\t\t} else if (opts.shouldFocus === FindStartFocusAction.FocusFindInput) {\n\t\t\t\tthis._widget.focusFindInput();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override highlightFindOptions(ignoreWhenVisible: boolean = false): void {\n\t\tif (!this._widget) {\n\t\t\tthis._createFindWidget();\n\t\t}\n\t\tif (this._state.isRevealed && !ignoreWhenVisible) {\n\t\t\tthis._widget!.highlightFindOptions();\n\t\t} else {\n\t\t\tthis._findOptionsWidget!.highlightFindOptions();\n\t\t}\n\t}\n\n\tprivate _createFindWidget() {\n\t\tthis._widget = this._register(new FindWidget(this._editor, this, this._state, this._contextViewService, this._keybindingService, this._contextKeyService, this._themeService, this._storageService, this._notificationService));\n\t\tthis._findOptionsWidget = this._register(new FindOptionsWidget(this._editor, this._state, this._keybindingService, this._themeService));\n\t}\n}\n\nexport const StartFindAction = registerMultiEditorAction(new MultiEditorAction({\n\tid: FIND_IDS.StartFindAction,\n\tlabel: nls.localize('startFindAction', \"Find\"),\n\talias: 'Find',\n\tprecondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),\n\tkbOpts: {\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyF,\n\t\tweight: KeybindingWeight.EditorContrib\n\t},\n\tmenuOpts: {\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '3_find',\n\t\ttitle: nls.localize({ key: 'miFind', comment: ['&& denotes a mnemonic'] }, \"&&Find\"),\n\t\torder: 1\n\t}\n}));\n\nStartFindAction.addImplementation(0, (accessor: ServicesAccessor, editor: ICodeEditor, args: any): boolean | Promise<void> => {\n\tconst controller = CommonFindController.get(editor);\n\tif (!controller) {\n\t\treturn false;\n\t}\n\treturn controller.start({\n\t\tforceRevealReplace: false,\n\t\tseedSearchStringFromSelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',\n\t\tseedSearchStringFromNonEmptySelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',\n\t\tseedSearchStringFromGlobalClipboard: editor.getOption(EditorOption.find).globalFindClipboard,\n\t\tshouldFocus: FindStartFocusAction.FocusFindInput,\n\t\tshouldAnimate: true,\n\t\tupdateSearchScope: false,\n\t\tloop: editor.getOption(EditorOption.find).loop\n\t});\n});\n\nconst findArgDescription = {\n\tdescription: 'Open a new In-Editor Find Widget.',\n\targs: [{\n\t\tname: 'Open a new In-Editor Find Widget args',\n\t\tschema: {\n\t\t\tproperties: {\n\t\t\t\tsearchString: { type: 'string' },\n\t\t\t\treplaceString: { type: 'string' },\n\t\t\t\tregex: { type: 'boolean' },\n\t\t\t\tregexOverride: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdescription: nls.localize('actions.find.isRegexOverride', 'Overrides \"Use Regular Expression\" flag.\\nThe flag will not be saved for the future.\\n0: Do Nothing\\n1: True\\n2: False')\n\t\t\t\t},\n\t\t\t\twholeWord: { type: 'boolean' },\n\t\t\t\twholeWordOverride: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdescription: nls.localize('actions.find.wholeWordOverride', 'Overrides \"Match Whole Word\" flag.\\nThe flag will not be saved for the future.\\n0: Do Nothing\\n1: True\\n2: False')\n\t\t\t\t},\n\t\t\t\tmatchCase: { type: 'boolean' },\n\t\t\t\tmatchCaseOverride: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdescription: nls.localize('actions.find.matchCaseOverride', 'Overrides \"Math Case\" flag.\\nThe flag will not be saved for the future.\\n0: Do Nothing\\n1: True\\n2: False')\n\t\t\t\t},\n\t\t\t\tpreserveCase: { type: 'boolean' },\n\t\t\t\tpreserveCaseOverride: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdescription: nls.localize('actions.find.preserveCaseOverride', 'Overrides \"Preserve Case\" flag.\\nThe flag will not be saved for the future.\\n0: Do Nothing\\n1: True\\n2: False')\n\t\t\t\t},\n\t\t\t\tfindInSelection: { type: 'boolean' },\n\t\t\t}\n\t\t}\n\t}]\n} as const;\n\nexport class StartFindWithArgsAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.StartFindWithArgs,\n\t\t\tlabel: nls.localize('startFindWithArgsAction', \"Find With Arguments\"),\n\t\t\talias: 'Find With Arguments',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tdescription: findArgDescription\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | null, editor: ICodeEditor, args?: IFindStartArguments): Promise<void> {\n\t\tconst controller = CommonFindController.get(editor);\n\t\tif (controller) {\n\t\t\tconst newState: INewFindReplaceState = args ? {\n\t\t\t\tsearchString: args.searchString,\n\t\t\t\treplaceString: args.replaceString,\n\t\t\t\tisReplaceRevealed: args.replaceString !== undefined,\n\t\t\t\tisRegex: args.isRegex,\n\t\t\t\t// isRegexOverride: args.regexOverride,\n\t\t\t\twholeWord: args.matchWholeWord,\n\t\t\t\t// wholeWordOverride: args.wholeWordOverride,\n\t\t\t\tmatchCase: args.isCaseSensitive,\n\t\t\t\t// matchCaseOverride: args.matchCaseOverride,\n\t\t\t\tpreserveCase: args.preserveCase,\n\t\t\t\t// preserveCaseOverride: args.preserveCaseOverride,\n\t\t\t} : {};\n\n\t\t\tawait controller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',\n\t\t\t\tseedSearchStringFromNonEmptySelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',\n\t\t\t\tseedSearchStringFromGlobalClipboard: true,\n\t\t\t\tshouldFocus: FindStartFocusAction.FocusFindInput,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: args?.findInSelection || false,\n\t\t\t\tloop: editor.getOption(EditorOption.find).loop\n\t\t\t}, newState);\n\n\t\t\tcontroller.setGlobalBufferTerm(controller.getState().searchString);\n\t\t}\n\t}\n}\n\nexport class StartFindWithSelectionAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.StartFindWithSelection,\n\t\t\tlabel: nls.localize('startFindWithSelectionAction', \"Find With Selection\"),\n\t\t\talias: 'Find With Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: 0,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyE,\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | null, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = CommonFindController.get(editor);\n\t\tif (controller) {\n\t\t\tawait controller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: 'multiple',\n\t\t\t\tseedSearchStringFromNonEmptySelection: false,\n\t\t\t\tseedSearchStringFromGlobalClipboard: false,\n\t\t\t\tshouldFocus: FindStartFocusAction.NoFocusChange,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false,\n\t\t\t\tloop: editor.getOption(EditorOption.find).loop\n\t\t\t});\n\n\t\t\tcontroller.setGlobalBufferTerm(controller.getState().searchString);\n\t\t}\n\t}\n}\nexport abstract class MatchFindAction extends EditorAction {\n\tpublic async run(accessor: ServicesAccessor | null, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = CommonFindController.get(editor);\n\t\tif (controller && !this._run(controller)) {\n\t\t\tawait controller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',\n\t\t\t\tseedSearchStringFromNonEmptySelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',\n\t\t\t\tseedSearchStringFromGlobalClipboard: true,\n\t\t\t\tshouldFocus: FindStartFocusAction.NoFocusChange,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false,\n\t\t\t\tloop: editor.getOption(EditorOption.find).loop\n\t\t\t});\n\t\t\tthis._run(controller);\n\t\t}\n\t}\n\n\tprotected abstract _run(controller: CommonFindController): boolean;\n}\n\nexport class NextMatchFindAction extends MatchFindAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.NextMatchFindAction,\n\t\t\tlabel: nls.localize('findNextMatchAction', \"Find Next\"),\n\t\t\talias: 'Find Next',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: [{\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyCode.F3,\n\t\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyCode.KeyG, secondary: [KeyCode.F3] },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}, {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_FIND_INPUT_FOCUSED),\n\t\t\t\tprimary: KeyCode.Enter,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}]\n\t\t});\n\t}\n\n\tprotected _run(controller: CommonFindController): boolean {\n\t\tconst result = controller.moveToNextMatch();\n\t\tif (result) {\n\t\t\tcontroller.editor.pushUndoStop();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nexport class PreviousMatchFindAction extends MatchFindAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.PreviousMatchFindAction,\n\t\t\tlabel: nls.localize('findPreviousMatchAction', \"Find Previous\"),\n\t\t\talias: 'Find Previous',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: [{\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F3,\n\t\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyG, secondary: [KeyMod.Shift | KeyCode.F3] },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}, {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_FIND_INPUT_FOCUSED),\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.Enter,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t\t]\n\t\t});\n\t}\n\n\tprotected _run(controller: CommonFindController): boolean {\n\t\treturn controller.moveToPrevMatch();\n\t}\n}\n\nexport abstract class SelectionMatchFindAction extends EditorAction {\n\tpublic async run(accessor: ServicesAccessor | null, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = CommonFindController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst seedSearchStringFromNonEmptySelection = editor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection';\n\t\tlet selectionSearchString = null;\n\t\tif (editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never') {\n\t\t\tselectionSearchString = getSelectionSearchString(editor, 'single', seedSearchStringFromNonEmptySelection);\n\t\t}\n\t\tif (selectionSearchString) {\n\t\t\tcontroller.setSearchString(selectionSearchString);\n\t\t}\n\t\tif (!this._run(controller)) {\n\t\t\tawait controller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',\n\t\t\t\tseedSearchStringFromNonEmptySelection: seedSearchStringFromNonEmptySelection,\n\t\t\t\tseedSearchStringFromGlobalClipboard: false,\n\t\t\t\tshouldFocus: FindStartFocusAction.NoFocusChange,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false,\n\t\t\t\tloop: editor.getOption(EditorOption.find).loop\n\t\t\t});\n\t\t\tthis._run(controller);\n\t\t}\n\t}\n\n\tprotected abstract _run(controller: CommonFindController): boolean;\n}\n\nexport class NextSelectionMatchFindAction extends SelectionMatchFindAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.NextSelectionMatchFindAction,\n\t\t\tlabel: nls.localize('nextSelectionMatchFindAction', \"Find Next Selection\"),\n\t\t\talias: 'Find Next Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.F3,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _run(controller: CommonFindController): boolean {\n\t\treturn controller.moveToNextMatch();\n\t}\n}\n\nexport class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.PreviousSelectionMatchFindAction,\n\t\t\tlabel: nls.localize('previousSelectionMatchFindAction', \"Find Previous Selection\"),\n\t\t\talias: 'Find Previous Selection',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _run(controller: CommonFindController): boolean {\n\t\treturn controller.moveToPrevMatch();\n\t}\n}\n\nexport const StartFindReplaceAction = registerMultiEditorAction(new MultiEditorAction({\n\tid: FIND_IDS.StartFindReplaceAction,\n\tlabel: nls.localize('startReplace', \"Replace\"),\n\talias: 'Replace',\n\tprecondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),\n\tkbOpts: {\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyH,\n\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyF },\n\t\tweight: KeybindingWeight.EditorContrib\n\t},\n\tmenuOpts: {\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '3_find',\n\t\ttitle: nls.localize({ key: 'miReplace', comment: ['&& denotes a mnemonic'] }, \"&&Replace\"),\n\t\torder: 2\n\t}\n}));\n\nStartFindReplaceAction.addImplementation(0, (accessor: ServicesAccessor, editor: ICodeEditor, args: any): boolean | Promise<void> => {\n\tif (!editor.hasModel() || editor.getOption(EditorOption.readOnly)) {\n\t\treturn false;\n\t}\n\tconst controller = CommonFindController.get(editor);\n\tif (!controller) {\n\t\treturn false;\n\t}\n\n\tconst currentSelection = editor.getSelection();\n\tconst findInputFocused = controller.isFindInputFocused();\n\t// we only seed search string from selection when the current selection is single line and not empty,\n\t// + the find input is not focused\n\tconst seedSearchStringFromSelection = !currentSelection.isEmpty()\n\t\t&& currentSelection.startLineNumber === currentSelection.endLineNumber\n\t\t&& (editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never')\n\t\t&& !findInputFocused;\n\t/*\n\t* if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input is still empty, so we should focus the Find Input instead of Replace Input.\n\n\t* findInputFocused true -> seedSearchStringFromSelection false, FocusReplaceInput\n\t* findInputFocused false, seedSearchStringFromSelection true FocusReplaceInput\n\t* findInputFocused false seedSearchStringFromSelection false FocusFindInput\n\t*/\n\tconst shouldFocus = (findInputFocused || seedSearchStringFromSelection) ?\n\t\tFindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput;\n\n\treturn controller.start({\n\t\tforceRevealReplace: true,\n\t\tseedSearchStringFromSelection: seedSearchStringFromSelection ? 'single' : 'none',\n\t\tseedSearchStringFromNonEmptySelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',\n\t\tseedSearchStringFromGlobalClipboard: editor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never',\n\t\tshouldFocus: shouldFocus,\n\t\tshouldAnimate: true,\n\t\tupdateSearchScope: false,\n\t\tloop: editor.getOption(EditorOption.find).loop\n\t});\n});\n\nregisterEditorContribution(CommonFindController.ID, FindController);\n\nregisterEditorAction(StartFindWithArgsAction);\nregisterEditorAction(StartFindWithSelectionAction);\nregisterEditorAction(NextMatchFindAction);\nregisterEditorAction(PreviousMatchFindAction);\nregisterEditorAction(NextSelectionMatchFindAction);\nregisterEditorAction(PreviousSelectionMatchFindAction);\n\nconst FindCommand = EditorCommand.bindToContribution<CommonFindController>(CommonFindController.get);\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.CloseFindWidgetCommand,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.closeFindWidget(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.focus, ContextKeyExpr.not('isComposing')),\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ToggleCaseSensitiveCommand,\n\tprecondition: undefined,\n\thandler: x => x.toggleCaseSensitive(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: ToggleCaseSensitiveKeybinding.primary,\n\t\tmac: ToggleCaseSensitiveKeybinding.mac,\n\t\twin: ToggleCaseSensitiveKeybinding.win,\n\t\tlinux: ToggleCaseSensitiveKeybinding.linux\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ToggleWholeWordCommand,\n\tprecondition: undefined,\n\thandler: x => x.toggleWholeWords(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: ToggleWholeWordKeybinding.primary,\n\t\tmac: ToggleWholeWordKeybinding.mac,\n\t\twin: ToggleWholeWordKeybinding.win,\n\t\tlinux: ToggleWholeWordKeybinding.linux\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ToggleRegexCommand,\n\tprecondition: undefined,\n\thandler: x => x.toggleRegex(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: ToggleRegexKeybinding.primary,\n\t\tmac: ToggleRegexKeybinding.mac,\n\t\twin: ToggleRegexKeybinding.win,\n\t\tlinux: ToggleRegexKeybinding.linux\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ToggleSearchScopeCommand,\n\tprecondition: undefined,\n\thandler: x => x.toggleSearchScope(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: ToggleSearchScopeKeybinding.primary,\n\t\tmac: ToggleSearchScopeKeybinding.mac,\n\t\twin: ToggleSearchScopeKeybinding.win,\n\t\tlinux: ToggleSearchScopeKeybinding.linux\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.TogglePreserveCaseCommand,\n\tprecondition: undefined,\n\thandler: x => x.togglePreserveCase(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: TogglePreserveCaseKeybinding.primary,\n\t\tmac: TogglePreserveCaseKeybinding.mac,\n\t\twin: TogglePreserveCaseKeybinding.win,\n\t\tlinux: TogglePreserveCaseKeybinding.linux\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ReplaceOneAction,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.replace(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Digit1\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ReplaceOneAction,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.replace(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED),\n\t\tprimary: KeyCode.Enter\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ReplaceAllAction,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.replaceAll(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Enter\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.ReplaceAllAction,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.replaceAll(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED),\n\t\tprimary: undefined,\n\t\tmac: {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Enter,\n\t\t}\n\t}\n}));\n\nregisterEditorCommand(new FindCommand({\n\tid: FIND_IDS.SelectAllMatchesAction,\n\tprecondition: CONTEXT_FIND_WIDGET_VISIBLE,\n\thandler: x => x.selectAllMatches(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 5,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyMod.Alt | KeyCode.Enter\n\t}\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 { Codicon } from 'vs/base/common/codicons';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IDecorationProvider } from 'vs/editor/contrib/folding/browser/foldingModel';\nimport { localize } from 'vs/nls';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { ThemeIcon } from 'vs/platform/theme/common/themeService';\n\nexport const foldingExpandedIcon = registerIcon('folding-expanded', Codicon.chevronDown, localize('foldingExpandedIcon', 'Icon for expanded ranges in the editor glyph margin.'));\nexport const foldingCollapsedIcon = registerIcon('folding-collapsed', Codicon.chevronRight, localize('foldingCollapsedIcon', 'Icon for collapsed ranges in the editor glyph margin.'));\nexport class FoldingDecorationProvider implements IDecorationProvider {\n\n\tprivate static readonly COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon)\n\t});\n\n\tprivate static readonly COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-collapsed-highlighted-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tclassName: 'folded-background',\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon)\n\t});\n\n\tprivate static readonly EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-auto-hide-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: ThemeIcon.asClassName(foldingExpandedIcon)\n\t});\n\n\tprivate static readonly EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-expanded-visual-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tisWholeLine: true,\n\t\tfirstLineDecorationClassName: 'alwaysShowFoldIcons ' + ThemeIcon.asClassName(foldingExpandedIcon)\n\t});\n\n\tprivate static readonly HIDDEN_RANGE_DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'folding-hidden-range-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges\n\t});\n\n\tpublic autoHideFoldingControls: boolean = true;\n\n\tpublic showFoldingHighlights: boolean = true;\n\n\tconstructor(private readonly editor: ICodeEditor) {\n\t}\n\n\tgetDecorationOption(isCollapsed: boolean, isHidden: boolean): ModelDecorationOptions {\n\t\tif (isHidden) {\n\t\t\treturn FoldingDecorationProvider.HIDDEN_RANGE_DECORATION;\n\t\t}\n\t\tif (isCollapsed) {\n\t\t\treturn this.showFoldingHighlights ? FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION;\n\t\t} else if (this.autoHideFoldingControls) {\n\t\t\treturn FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION;\n\t\t} else {\n\t\t\treturn FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION;\n\t\t}\n\t}\n\n\tdeltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[] {\n\t\treturn this.editor.deltaDecorations(oldDecorations, newDecorations);\n\t}\n\n\tchangeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T): T {\n\t\treturn this.editor.changeDecorations(callback);\n\t}\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 { CancelablePromise, createCancelablePromise, Delayer, RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\nimport * as types from 'vs/base/common/types';\nimport 'vs/css!./folding';\nimport { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, registerInstantiatedEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents';\nimport { FoldingRangeKind } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { CollapseMemento, FoldingModel, getNextFoldLine, getParentFoldLine as getParentFoldLine, getPreviousFoldLine, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForRest, setCollapseStateForType, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp, toggleCollapseState } from 'vs/editor/contrib/folding/browser/foldingModel';\nimport { HiddenRangeModel } from 'vs/editor/contrib/folding/browser/hiddenRangeModel';\nimport { IndentRangeProvider } from 'vs/editor/contrib/folding/browser/indentRangeProvider';\nimport { ID_INIT_PROVIDER, InitializingRangeProvider } from 'vs/editor/contrib/folding/browser/intializingRangeProvider';\nimport * as nls from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { editorSelectionBackground, iconForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';\nimport { foldingCollapsedIcon, FoldingDecorationProvider, foldingExpandedIcon } from './foldingDecorations';\nimport { FoldingRegion, FoldingRegions } from './foldingRanges';\nimport { ID_SYNTAX_PROVIDER, SyntaxRangeProvider } from './syntaxRangeProvider';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport Severity from 'vs/base/common/severity';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\n\nconst CONTEXT_FOLDING_ENABLED = new RawContextKey<boolean>('foldingEnabled', false);\n\nexport interface RangeProvider {\n\treadonly id: string;\n\tcompute(cancelationToken: CancellationToken, notifyTooMany: (max: number) => void): Promise<FoldingRegions | null>;\n\tdispose(): void;\n}\n\ninterface FoldingStateMemento {\n\tcollapsedRegions?: CollapseMemento;\n\tlineCount?: number;\n\tprovider?: string;\n\tfoldedImports?: boolean;\n}\n\nexport class FoldingController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.folding';\n\n\tpublic static get(editor: ICodeEditor): FoldingController | null {\n\t\treturn editor.getContribution<FoldingController>(FoldingController.ID);\n\t}\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate _isEnabled: boolean;\n\tprivate _useFoldingProviders: boolean;\n\tprivate _unfoldOnClickAfterEndOfLine: boolean;\n\tprivate _restoringViewState: boolean;\n\tprivate _foldingImportsByDefault: boolean;\n\tprivate _currentModelHasFoldedImports: boolean;\n\tprivate _maxFoldingRegions: number;\n\tprivate _notifyTooManyRegions: (m: number) => void;\n\tprivate _tooManyRegionsNotified = false;\n\n\tprivate readonly foldingDecorationProvider: FoldingDecorationProvider;\n\n\tprivate foldingModel: FoldingModel | null;\n\tprivate hiddenRangeModel: HiddenRangeModel | null;\n\n\tprivate rangeProvider: RangeProvider | null;\n\tprivate foldingRegionPromise: CancelablePromise<FoldingRegions | null> | null;\n\n\tprivate foldingStateMemento: FoldingStateMemento | null;\n\n\tprivate foldingModelPromise: Promise<FoldingModel | null> | null;\n\tprivate updateScheduler: Delayer<FoldingModel | null> | null;\n\tprivate readonly updateDebounceInfo: IFeatureDebounceInformation;\n\n\tprivate foldingEnabled: IContextKey<boolean>;\n\tprivate cursorChangedScheduler: RunOnceScheduler | null;\n\n\tprivate readonly localToDispose = this._register(new DisposableStore());\n\tprivate mouseDownInfo: { lineNumber: number; iconClicked: boolean } | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService private readonly contextKeyService: IContextKeyService,\n\t\t@ILanguageConfigurationService private readonly languageConfigurationService: ILanguageConfigurationService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tconst options = this.editor.getOptions();\n\t\tthis._isEnabled = options.get(EditorOption.folding);\n\t\tthis._useFoldingProviders = options.get(EditorOption.foldingStrategy) !== 'indentation';\n\t\tthis._unfoldOnClickAfterEndOfLine = options.get(EditorOption.unfoldOnClickAfterEndOfLine);\n\t\tthis._restoringViewState = false;\n\t\tthis._currentModelHasFoldedImports = false;\n\t\tthis._foldingImportsByDefault = options.get(EditorOption.foldingImportsByDefault);\n\t\tthis._maxFoldingRegions = options.get(EditorOption.foldingMaximumRegions);\n\t\tthis.updateDebounceInfo = languageFeatureDebounceService.for(languageFeaturesService.foldingRangeProvider, 'Folding', { min: 200 });\n\n\t\tthis.foldingModel = null;\n\t\tthis.hiddenRangeModel = null;\n\t\tthis.rangeProvider = null;\n\t\tthis.foldingRegionPromise = null;\n\t\tthis.foldingStateMemento = null;\n\t\tthis.foldingModelPromise = null;\n\t\tthis.updateScheduler = null;\n\t\tthis.cursorChangedScheduler = null;\n\t\tthis.mouseDownInfo = null;\n\n\t\tthis.foldingDecorationProvider = new FoldingDecorationProvider(editor);\n\t\tthis.foldingDecorationProvider.autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';\n\t\tthis.foldingDecorationProvider.showFoldingHighlights = options.get(EditorOption.foldingHighlight);\n\t\tthis.foldingEnabled = CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService);\n\t\tthis.foldingEnabled.set(this._isEnabled);\n\n\t\tthis._notifyTooManyRegions = (maxFoldingRegions: number) => {\n\t\t\t// Message will display once per time vscode runs. Once per file would be tricky.\n\t\t\tif (!this._tooManyRegionsNotified) {\n\t\t\t\tnotificationService.notify({\n\t\t\t\t\tseverity: Severity.Warning,\n\t\t\t\t\tsticky: true,\n\t\t\t\t\tmessage: nls.localize('maximum fold ranges', \"The number of foldable regions is limited to a maximum of {0}. Increase configuration option ['Folding Maximum Regions'](command:workbench.action.openSettings?[\\\"editor.foldingMaximumRegions\\\"]) to enable more.\", maxFoldingRegions)\n\t\t\t\t});\n\t\t\t\tthis._tooManyRegionsNotified = true;\n\t\t\t}\n\t\t};\n\n\t\tthis._register(this.editor.onDidChangeModel(() => this.onModelChanged()));\n\n\t\tthis._register(this.editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.folding)) {\n\t\t\t\tthis._isEnabled = this.editor.getOptions().get(EditorOption.folding);\n\t\t\t\tthis.foldingEnabled.set(this._isEnabled);\n\t\t\t\tthis.onModelChanged();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.foldingMaximumRegions)) {\n\t\t\t\tthis._maxFoldingRegions = this.editor.getOptions().get(EditorOption.foldingMaximumRegions);\n\t\t\t\tthis._tooManyRegionsNotified = false;\n\t\t\t\tthis.onModelChanged();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.showFoldingControls) || e.hasChanged(EditorOption.foldingHighlight)) {\n\t\t\t\tconst options = this.editor.getOptions();\n\t\t\t\tthis.foldingDecorationProvider.autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';\n\t\t\t\tthis.foldingDecorationProvider.showFoldingHighlights = options.get(EditorOption.foldingHighlight);\n\t\t\t\tthis.triggerFoldingModelChanged();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.foldingStrategy)) {\n\t\t\t\tthis._useFoldingProviders = this.editor.getOptions().get(EditorOption.foldingStrategy) !== 'indentation';\n\t\t\t\tthis.onFoldingStrategyChanged();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.unfoldOnClickAfterEndOfLine)) {\n\t\t\t\tthis._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(EditorOption.unfoldOnClickAfterEndOfLine);\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.foldingImportsByDefault)) {\n\t\t\t\tthis._foldingImportsByDefault = this.editor.getOptions().get(EditorOption.foldingImportsByDefault);\n\t\t\t}\n\t\t}));\n\t\tthis.onModelChanged();\n\t}\n\n\t/**\n\t * Store view state.\n\t */\n\tpublic saveViewState(): FoldingStateMemento | undefined {\n\t\tlet model = this.editor.getModel();\n\t\tif (!model || !this._isEnabled || model.isTooLargeForTokenization()) {\n\t\t\treturn {};\n\t\t}\n\t\tif (this.foldingModel) { // disposed ?\n\t\t\tlet collapsedRegions = this.foldingModel.isInitialized ? this.foldingModel.getMemento() : this.hiddenRangeModel!.getMemento();\n\t\t\tlet provider = this.rangeProvider ? this.rangeProvider.id : undefined;\n\t\t\treturn { collapsedRegions, lineCount: model.getLineCount(), provider, foldedImports: this._currentModelHasFoldedImports };\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Restore view state.\n\t */\n\tpublic restoreViewState(state: FoldingStateMemento): void {\n\t\tlet model = this.editor.getModel();\n\t\tif (!model || !this._isEnabled || model.isTooLargeForTokenization() || !this.hiddenRangeModel) {\n\t\t\treturn;\n\t\t}\n\t\tif (!state || state.lineCount !== model.getLineCount()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._currentModelHasFoldedImports = !!state.foldedImports;\n\t\tif (!state.collapsedRegions) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.provider === ID_SYNTAX_PROVIDER || state.provider === ID_INIT_PROVIDER) {\n\t\t\tthis.foldingStateMemento = state;\n\t\t}\n\n\t\tconst collapsedRegions = state.collapsedRegions;\n\t\t// set the hidden ranges right away, before waiting for the folding model.\n\t\tif (this.hiddenRangeModel.applyMemento(collapsedRegions)) {\n\t\t\tconst foldingModel = this.getFoldingModel();\n\t\t\tif (foldingModel) {\n\t\t\t\tfoldingModel.then(foldingModel => {\n\t\t\t\t\tif (foldingModel) {\n\t\t\t\t\t\tthis._restoringViewState = true;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfoldingModel.applyMemento(collapsedRegions);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tthis._restoringViewState = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).then(undefined, onUnexpectedError);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onModelChanged(): void {\n\t\tthis.localToDispose.clear();\n\n\t\tlet model = this.editor.getModel();\n\t\tif (!this._isEnabled || !model || model.isTooLargeForTokenization()) {\n\t\t\t// huge files get no view model, so they cannot support hidden areas\n\t\t\treturn;\n\t\t}\n\n\t\tthis._currentModelHasFoldedImports = false;\n\t\tthis.foldingModel = new FoldingModel(model, this.foldingDecorationProvider);\n\t\tthis.localToDispose.add(this.foldingModel);\n\n\t\tthis.hiddenRangeModel = new HiddenRangeModel(this.foldingModel);\n\t\tthis.localToDispose.add(this.hiddenRangeModel);\n\t\tthis.localToDispose.add(this.hiddenRangeModel.onDidChange(hr => this.onHiddenRangesChanges(hr)));\n\n\t\tthis.updateScheduler = new Delayer<FoldingModel>(this.updateDebounceInfo.get(model));\n\n\t\tthis.cursorChangedScheduler = new RunOnceScheduler(() => this.revealCursor(), 200);\n\t\tthis.localToDispose.add(this.cursorChangedScheduler);\n\t\tthis.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(() => this.onFoldingStrategyChanged()));\n\t\tthis.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); // covers model language changes as well\n\t\tthis.localToDispose.add(this.editor.onDidChangeModelContent(e => this.onDidChangeModelContent(e)));\n\t\tthis.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged()));\n\t\tthis.localToDispose.add(this.editor.onMouseDown(e => this.onEditorMouseDown(e)));\n\t\tthis.localToDispose.add(this.editor.onMouseUp(e => this.onEditorMouseUp(e)));\n\t\tthis.localToDispose.add({\n\t\t\tdispose: () => {\n\t\t\t\tif (this.foldingRegionPromise) {\n\t\t\t\t\tthis.foldingRegionPromise.cancel();\n\t\t\t\t\tthis.foldingRegionPromise = null;\n\t\t\t\t}\n\t\t\t\tif (this.updateScheduler) {\n\t\t\t\t\tthis.updateScheduler.cancel();\n\t\t\t\t}\n\t\t\t\tthis.updateScheduler = null;\n\t\t\t\tthis.foldingModel = null;\n\t\t\t\tthis.foldingModelPromise = null;\n\t\t\t\tthis.hiddenRangeModel = null;\n\t\t\t\tthis.cursorChangedScheduler = null;\n\t\t\t\tthis.foldingStateMemento = null;\n\t\t\t\tif (this.rangeProvider) {\n\t\t\t\t\tthis.rangeProvider.dispose();\n\t\t\t\t}\n\t\t\t\tthis.rangeProvider = null;\n\t\t\t}\n\t\t});\n\t\tthis.triggerFoldingModelChanged();\n\t}\n\n\tprivate onFoldingStrategyChanged() {\n\t\tif (this.rangeProvider) {\n\t\t\tthis.rangeProvider.dispose();\n\t\t}\n\t\tthis.rangeProvider = null;\n\t\tthis.triggerFoldingModelChanged();\n\t}\n\n\tprivate getRangeProvider(editorModel: ITextModel): RangeProvider {\n\t\tif (this.rangeProvider) {\n\t\t\treturn this.rangeProvider;\n\t\t}\n\t\tthis.rangeProvider = new IndentRangeProvider(editorModel, this.languageConfigurationService, this._maxFoldingRegions); // fallback\n\n\t\tif (this._useFoldingProviders && this.foldingModel) {\n\t\t\tlet foldingProviders = this.languageFeaturesService.foldingRangeProvider.ordered(this.foldingModel.textModel);\n\t\t\tif (foldingProviders.length === 0 && this.foldingStateMemento && this.foldingStateMemento.collapsedRegions) {\n\t\t\t\tconst rangeProvider = this.rangeProvider = new InitializingRangeProvider(editorModel, this.foldingStateMemento.collapsedRegions, () => {\n\t\t\t\t\t// if after 30 the InitializingRangeProvider is still not replaced, force a refresh\n\t\t\t\t\tthis.foldingStateMemento = null;\n\t\t\t\t\tthis.onFoldingStrategyChanged();\n\t\t\t\t}, 30000);\n\t\t\t\treturn rangeProvider; // keep memento in case there are still no foldingProviders on the next request.\n\t\t\t} else if (foldingProviders.length > 0) {\n\t\t\t\tthis.rangeProvider = new SyntaxRangeProvider(editorModel, foldingProviders, () => this.triggerFoldingModelChanged(), this._maxFoldingRegions);\n\t\t\t}\n\t\t}\n\t\tthis.foldingStateMemento = null;\n\t\treturn this.rangeProvider;\n\t}\n\n\tpublic getFoldingModel() {\n\t\treturn this.foldingModelPromise;\n\t}\n\n\tprivate onDidChangeModelContent(e: IModelContentChangedEvent) {\n\t\tthis.hiddenRangeModel?.notifyChangeModelContent(e);\n\t\tthis.triggerFoldingModelChanged();\n\t}\n\n\tprivate triggerFoldingModelChanged() {\n\t\tif (this.updateScheduler) {\n\t\t\tif (this.foldingRegionPromise) {\n\t\t\t\tthis.foldingRegionPromise.cancel();\n\t\t\t\tthis.foldingRegionPromise = null;\n\t\t\t}\n\t\t\tthis.foldingModelPromise = this.updateScheduler.trigger(() => {\n\t\t\t\tconst foldingModel = this.foldingModel;\n\t\t\t\tif (!foldingModel) { // null if editor has been disposed, or folding turned off\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst sw = new StopWatch(true);\n\t\t\t\tconst provider = this.getRangeProvider(foldingModel.textModel);\n\t\t\t\tlet foldingRegionPromise = this.foldingRegionPromise = createCancelablePromise(token => provider.compute(token, this._notifyTooManyRegions));\n\t\t\t\treturn foldingRegionPromise.then(foldingRanges => {\n\t\t\t\t\tif (foldingRanges && foldingRegionPromise === this.foldingRegionPromise) { // new request or cancelled in the meantime?\n\t\t\t\t\t\tlet scrollState: StableEditorScrollState | undefined;\n\n\t\t\t\t\t\tif (this._foldingImportsByDefault && !this._currentModelHasFoldedImports) {\n\t\t\t\t\t\t\tconst hasChanges = foldingRanges.setCollapsedAllOfType(FoldingRangeKind.Imports.value, true);\n\t\t\t\t\t\t\tif (hasChanges) {\n\t\t\t\t\t\t\t\tscrollState = StableEditorScrollState.capture(this.editor);\n\t\t\t\t\t\t\t\tthis._currentModelHasFoldedImports = hasChanges;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// some cursors might have moved into hidden regions, make sure they are in expanded regions\n\t\t\t\t\t\tlet selections = this.editor.getSelections();\n\t\t\t\t\t\tlet selectionLineNumbers = selections ? selections.map(s => s.startLineNumber) : [];\n\t\t\t\t\t\tfoldingModel.update(foldingRanges, selectionLineNumbers);\n\n\t\t\t\t\t\tif (scrollState) {\n\t\t\t\t\t\t\tscrollState.restore(this.editor);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// update debounce info\n\t\t\t\t\t\tconst newValue = this.updateDebounceInfo.update(foldingModel.textModel, sw.elapsed());\n\t\t\t\t\t\tif (this.updateScheduler) {\n\t\t\t\t\t\t\tthis.updateScheduler.defaultDelay = newValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn foldingModel;\n\t\t\t\t});\n\t\t\t}).then(undefined, (err) => {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t\treturn null;\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate onHiddenRangesChanges(hiddenRanges: IRange[]) {\n\t\tif (this.hiddenRangeModel && hiddenRanges.length && !this._restoringViewState) {\n\t\t\tlet selections = this.editor.getSelections();\n\t\t\tif (selections) {\n\t\t\t\tif (this.hiddenRangeModel.adjustSelections(selections)) {\n\t\t\t\t\tthis.editor.setSelections(selections);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.editor.setHiddenAreas(hiddenRanges);\n\t}\n\n\tprivate onCursorPositionChanged() {\n\t\tif (this.hiddenRangeModel && this.hiddenRangeModel.hasRanges()) {\n\t\t\tthis.cursorChangedScheduler!.schedule();\n\t\t}\n\t}\n\n\tprivate revealCursor() {\n\t\tconst foldingModel = this.getFoldingModel();\n\t\tif (!foldingModel) {\n\t\t\treturn;\n\t\t}\n\t\tfoldingModel.then(foldingModel => { // null is returned if folding got disabled in the meantime\n\t\t\tif (foldingModel) {\n\t\t\t\tlet selections = this.editor.getSelections();\n\t\t\t\tif (selections && selections.length > 0) {\n\t\t\t\t\tlet toToggle: FoldingRegion[] = [];\n\t\t\t\t\tfor (let selection of selections) {\n\t\t\t\t\t\tlet lineNumber = selection.selectionStartLineNumber;\n\t\t\t\t\t\tif (this.hiddenRangeModel && this.hiddenRangeModel.isHidden(lineNumber)) {\n\t\t\t\t\t\t\ttoToggle.push(...foldingModel.getAllRegionsAtLine(lineNumber, r => r.isCollapsed && lineNumber > r.startLineNumber));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (toToggle.length) {\n\t\t\t\t\t\tfoldingModel.toggleCollapseState(toToggle);\n\t\t\t\t\t\tthis.reveal(selections[0].getPosition());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}).then(undefined, onUnexpectedError);\n\n\t}\n\n\tprivate onEditorMouseDown(e: IEditorMouseEvent): void {\n\t\tthis.mouseDownInfo = null;\n\n\n\t\tif (!this.hiddenRangeModel || !e.target || !e.target.range) {\n\t\t\treturn;\n\t\t}\n\t\tif (!e.event.leftButton && !e.event.middleButton) {\n\t\t\treturn;\n\t\t}\n\t\tconst range = e.target.range;\n\t\tlet iconClicked = false;\n\t\tswitch (e.target.type) {\n\t\t\tcase MouseTargetType.GUTTER_LINE_DECORATIONS: {\n\t\t\t\tconst data = e.target.detail;\n\t\t\t\tconst offsetLeftInGutter = (e.target.element as HTMLElement).offsetLeft;\n\t\t\t\tconst gutterOffsetX = data.offsetX - offsetLeftInGutter;\n\n\t\t\t\t// const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;\n\n\t\t\t\t// TODO@joao TODO@alex TODO@martin this is such that we don't collide with dirty diff\n\t\t\t\tif (gutterOffsetX < 5) { // the whitespace between the border and the real folding icon border is 5px\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ticonClicked = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tif (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges()) {\n\t\t\t\t\tconst data = e.target.detail;\n\t\t\t\t\tif (!data.isAfterLines) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_TEXT: {\n\t\t\t\tif (this.hiddenRangeModel.hasRanges()) {\n\t\t\t\t\tlet model = this.editor.getModel();\n\t\t\t\t\tif (model && range.startColumn === model.getLineMaxColumn(range.startLineNumber)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tthis.mouseDownInfo = { lineNumber: range.startLineNumber, iconClicked };\n\t}\n\n\tprivate onEditorMouseUp(e: IEditorMouseEvent): void {\n\t\tconst foldingModel = this.getFoldingModel();\n\t\tif (!foldingModel || !this.mouseDownInfo || !e.target) {\n\t\t\treturn;\n\t\t}\n\t\tlet lineNumber = this.mouseDownInfo.lineNumber;\n\t\tlet iconClicked = this.mouseDownInfo.iconClicked;\n\n\t\tlet range = e.target.range;\n\t\tif (!range || range.startLineNumber !== lineNumber) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (iconClicked) {\n\t\t\tif (e.target.type !== MouseTargetType.GUTTER_LINE_DECORATIONS) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tlet model = this.editor.getModel();\n\t\t\tif (!model || range.startColumn !== model.getLineMaxColumn(lineNumber)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfoldingModel.then(foldingModel => {\n\t\t\tif (foldingModel) {\n\t\t\t\tlet region = foldingModel.getRegionAtLine(lineNumber);\n\t\t\t\tif (region && region.startLineNumber === lineNumber) {\n\t\t\t\t\tlet isCollapsed = region.isCollapsed;\n\t\t\t\t\tif (iconClicked || isCollapsed) {\n\t\t\t\t\t\tlet surrounding = e.event.altKey;\n\t\t\t\t\t\tlet toToggle = [];\n\t\t\t\t\t\tif (surrounding) {\n\t\t\t\t\t\t\tlet filter = (otherRegion: FoldingRegion) => !otherRegion.containedBy(region!) && !region!.containedBy(otherRegion);\n\t\t\t\t\t\t\tlet toMaybeToggle = foldingModel.getRegionsInside(null, filter);\n\t\t\t\t\t\t\tfor (const r of toMaybeToggle) {\n\t\t\t\t\t\t\t\tif (r.isCollapsed) {\n\t\t\t\t\t\t\t\t\ttoToggle.push(r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if any surrounding regions are folded, unfold those. Otherwise, fold all surrounding\n\t\t\t\t\t\t\tif (toToggle.length === 0) {\n\t\t\t\t\t\t\t\ttoToggle = toMaybeToggle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet recursive = e.event.middleButton || e.event.shiftKey;\n\t\t\t\t\t\t\tif (recursive) {\n\t\t\t\t\t\t\t\tfor (const r of foldingModel.getRegionsInside(region)) {\n\t\t\t\t\t\t\t\t\tif (r.isCollapsed === isCollapsed) {\n\t\t\t\t\t\t\t\t\t\ttoToggle.push(r);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// when recursive, first only collapse all children. If all are already folded or there are no children, also fold parent.\n\t\t\t\t\t\t\tif (isCollapsed || !recursive || toToggle.length === 0) {\n\t\t\t\t\t\t\t\ttoToggle.push(region);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfoldingModel.toggleCollapseState(toToggle);\n\t\t\t\t\t\tthis.reveal({ lineNumber, column: 1 });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}).then(undefined, onUnexpectedError);\n\t}\n\n\tpublic reveal(position: IPosition): void {\n\t\tthis.editor.revealPositionInCenterIfOutsideViewport(position, ScrollType.Smooth);\n\t}\n}\n\nabstract class FoldingAction<T> extends EditorAction {\n\n\tabstract invoke(foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: T, languageConfigurationService: ILanguageConfigurationService): void;\n\n\tpublic override runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: T): void | Promise<void> {\n\t\tconst languageConfigurationService = accessor.get(ILanguageConfigurationService);\n\t\tconst foldingController = FoldingController.get(editor);\n\t\tif (!foldingController) {\n\t\t\treturn;\n\t\t}\n\t\tconst foldingModelPromise = foldingController.getFoldingModel();\n\t\tif (foldingModelPromise) {\n\t\t\tthis.reportTelemetry(accessor, editor);\n\t\t\treturn foldingModelPromise.then(foldingModel => {\n\t\t\t\tif (foldingModel) {\n\t\t\t\t\tthis.invoke(foldingController, foldingModel, editor, args, languageConfigurationService);\n\t\t\t\t\tconst selection = editor.getSelection();\n\t\t\t\t\tif (selection) {\n\t\t\t\t\t\tfoldingController.reveal(selection.getStartPosition());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected getSelectedLines(editor: ICodeEditor) {\n\t\tlet selections = editor.getSelections();\n\t\treturn selections ? selections.map(s => s.startLineNumber) : [];\n\t}\n\n\tprotected getLineNumbers(args: FoldingArguments, editor: ICodeEditor) {\n\t\tif (args && args.selectionLines) {\n\t\t\treturn args.selectionLines.map(l => l + 1); // to 0-bases line numbers\n\t\t}\n\t\treturn this.getSelectedLines(editor);\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, _editor: ICodeEditor): void {\n\t}\n}\n\ninterface FoldingArguments {\n\tlevels?: number;\n\tdirection?: 'up' | 'down';\n\tselectionLines?: number[];\n}\n\nfunction foldingArgumentsConstraint(args: any) {\n\tif (!types.isUndefined(args)) {\n\t\tif (!types.isObject(args)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst foldingArgs: FoldingArguments = args;\n\t\tif (!types.isUndefined(foldingArgs.levels) && !types.isNumber(foldingArgs.levels)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!types.isUndefined(foldingArgs.direction) && !types.isString(foldingArgs.direction)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!types.isUndefined(foldingArgs.selectionLines) && (!types.isArray(foldingArgs.selectionLines) || !foldingArgs.selectionLines.every(types.isNumber))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass UnfoldAction extends FoldingAction<FoldingArguments> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.unfold',\n\t\t\tlabel: nls.localize('unfoldAction.label', \"Unfold\"),\n\t\t\talias: 'Unfold',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketRight,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.BracketRight\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tdescription: {\n\t\t\t\tdescription: 'Unfold the content in the editor',\n\t\t\t\targs: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Unfold editor argument',\n\t\t\t\t\t\tdescription: `Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t`,\n\t\t\t\t\t\tconstraint: foldingArgumentsConstraint,\n\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t'type': 'object',\n\t\t\t\t\t\t\t'properties': {\n\t\t\t\t\t\t\t\t'levels': {\n\t\t\t\t\t\t\t\t\t'type': 'number',\n\t\t\t\t\t\t\t\t\t'default': 1\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'direction': {\n\t\t\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t\t\t'enum': ['up', 'down'],\n\t\t\t\t\t\t\t\t\t'default': 'down'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'selectionLines': {\n\t\t\t\t\t\t\t\t\t'type': 'array',\n\t\t\t\t\t\t\t\t\t'items': {\n\t\t\t\t\t\t\t\t\t\t'type': 'number'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: FoldingArguments): void {\n\t\tlet levels = args && args.levels || 1;\n\t\tlet lineNumbers = this.getLineNumbers(args, editor);\n\t\tif (args && args.direction === 'up') {\n\t\t\tsetCollapseStateLevelsUp(foldingModel, false, levels, lineNumbers);\n\t\t} else {\n\t\t\tsetCollapseStateLevelsDown(foldingModel, false, levels, lineNumbers);\n\t\t}\n\t}\n}\n\nclass UnFoldRecursivelyAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.unfoldRecursively',\n\t\t\tlabel: nls.localize('unFoldRecursivelyAction.label', \"Unfold Recursively\"),\n\t\t\talias: 'Unfold Recursively',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.BracketRight),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, _args: any): void {\n\t\tsetCollapseStateLevelsDown(foldingModel, false, Number.MAX_VALUE, this.getSelectedLines(editor));\n\t}\n}\n\nclass FoldAction extends FoldingAction<FoldingArguments> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.fold',\n\t\t\tlabel: nls.localize('foldAction.label', \"Fold\"),\n\t\t\talias: 'Fold',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketLeft,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.BracketLeft\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tdescription: {\n\t\t\t\tdescription: 'Fold the content in the editor',\n\t\t\t\targs: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Fold editor argument',\n\t\t\t\t\t\tdescription: `Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t`,\n\t\t\t\t\t\tconstraint: foldingArgumentsConstraint,\n\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t'type': 'object',\n\t\t\t\t\t\t\t'properties': {\n\t\t\t\t\t\t\t\t'levels': {\n\t\t\t\t\t\t\t\t\t'type': 'number',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'direction': {\n\t\t\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t\t\t'enum': ['up', 'down'],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'selectionLines': {\n\t\t\t\t\t\t\t\t\t'type': 'array',\n\t\t\t\t\t\t\t\t\t'items': {\n\t\t\t\t\t\t\t\t\t\t'type': 'number'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: FoldingArguments): void {\n\t\tlet lineNumbers = this.getLineNumbers(args, editor);\n\n\t\tconst levels = args && args.levels;\n\t\tconst direction = args && args.direction;\n\n\t\tif (typeof levels !== 'number' && typeof direction !== 'string') {\n\t\t\t// fold the region at the location or if already collapsed, the first uncollapsed parent instead.\n\t\t\tsetCollapseStateUp(foldingModel, true, lineNumbers);\n\t\t} else {\n\t\t\tif (direction === 'up') {\n\t\t\t\tsetCollapseStateLevelsUp(foldingModel, true, levels || 1, lineNumbers);\n\t\t\t} else {\n\t\t\t\tsetCollapseStateLevelsDown(foldingModel, true, levels || 1, lineNumbers);\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nclass ToggleFoldAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.toggleFold',\n\t\t\tlabel: nls.localize('toggleFoldAction.label', \"Toggle Fold\"),\n\t\t\talias: 'Toggle Fold',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyL),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\ttoggleCollapseState(foldingModel, 1, selectedLines);\n\t}\n}\n\n\nclass FoldRecursivelyAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.foldRecursively',\n\t\t\tlabel: nls.localize('foldRecursivelyAction.label', \"Fold Recursively\"),\n\t\t\talias: 'Fold Recursively',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.BracketLeft),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tsetCollapseStateLevelsDown(foldingModel, true, Number.MAX_VALUE, selectedLines);\n\t}\n}\n\nclass FoldAllBlockCommentsAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.foldAllBlockComments',\n\t\t\tlabel: nls.localize('foldAllBlockComments.label', \"Fold All Block Comments\"),\n\t\t\talias: 'Fold All Block Comments',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Slash),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: void, languageConfigurationService: ILanguageConfigurationService): void {\n\t\tif (foldingModel.regions.hasTypes()) {\n\t\t\tsetCollapseStateForType(foldingModel, FoldingRangeKind.Comment.value, true);\n\t\t} else {\n\t\t\tconst editorModel = editor.getModel();\n\t\t\tif (!editorModel) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst comments = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).comments;\n\t\t\tif (comments && comments.blockCommentStartToken) {\n\t\t\t\tlet regExp = new RegExp('^\\\\s*' + escapeRegExpCharacters(comments.blockCommentStartToken));\n\t\t\t\tsetCollapseStateForMatchingLines(foldingModel, regExp, true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass FoldAllRegionsAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.foldAllMarkerRegions',\n\t\t\tlabel: nls.localize('foldAllMarkerRegions.label', \"Fold All Regions\"),\n\t\t\talias: 'Fold All Regions',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Digit8),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: void, languageConfigurationService: ILanguageConfigurationService): void {\n\t\tif (foldingModel.regions.hasTypes()) {\n\t\t\tsetCollapseStateForType(foldingModel, FoldingRangeKind.Region.value, true);\n\t\t} else {\n\t\t\tconst editorModel = editor.getModel();\n\t\t\tif (!editorModel) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst foldingRules = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).foldingRules;\n\t\t\tif (foldingRules && foldingRules.markers && foldingRules.markers.start) {\n\t\t\t\tlet regExp = new RegExp(foldingRules.markers.start);\n\t\t\t\tsetCollapseStateForMatchingLines(foldingModel, regExp, true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass UnfoldAllRegionsAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.unfoldAllMarkerRegions',\n\t\t\tlabel: nls.localize('unfoldAllMarkerRegions.label', \"Unfold All Regions\"),\n\t\t\talias: 'Unfold All Regions',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Digit9),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor, args: void, languageConfigurationService: ILanguageConfigurationService): void {\n\t\tif (foldingModel.regions.hasTypes()) {\n\t\t\tsetCollapseStateForType(foldingModel, FoldingRangeKind.Region.value, false);\n\t\t} else {\n\t\t\tconst editorModel = editor.getModel();\n\t\t\tif (!editorModel) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst foldingRules = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).foldingRules;\n\t\t\tif (foldingRules && foldingRules.markers && foldingRules.markers.start) {\n\t\t\t\tlet regExp = new RegExp(foldingRules.markers.start);\n\t\t\t\tsetCollapseStateForMatchingLines(foldingModel, regExp, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass FoldAllRegionsExceptAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.foldAllExcept',\n\t\t\tlabel: nls.localize('foldAllExcept.label', \"Fold All Regions Except Selected\"),\n\t\t\talias: 'Fold All Regions Except Selected',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Minus),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tsetCollapseStateForRest(foldingModel, true, selectedLines);\n\t}\n\n}\n\nclass UnfoldAllRegionsExceptAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.unfoldAllExcept',\n\t\t\tlabel: nls.localize('unfoldAllExcept.label', \"Unfold All Regions Except Selected\"),\n\t\t\talias: 'Unfold All Regions Except Selected',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Equal),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tsetCollapseStateForRest(foldingModel, false, selectedLines);\n\t}\n}\n\nclass FoldAllAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.foldAll',\n\t\t\tlabel: nls.localize('foldAllAction.label', \"Fold All\"),\n\t\t\talias: 'Fold All',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Digit0),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, _editor: ICodeEditor): void {\n\t\tsetCollapseStateLevelsDown(foldingModel, true);\n\t}\n}\n\nclass UnfoldAllAction extends FoldingAction<void> {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.unfoldAll',\n\t\t\tlabel: nls.localize('unfoldAllAction.label', \"Unfold All\"),\n\t\t\talias: 'Unfold All',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyJ),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, _editor: ICodeEditor): void {\n\t\tsetCollapseStateLevelsDown(foldingModel, false);\n\t}\n}\n\nclass FoldLevelAction extends FoldingAction<void> {\n\tprivate static readonly ID_PREFIX = 'editor.foldLevel';\n\tpublic static readonly ID = (level: number) => FoldLevelAction.ID_PREFIX + level;\n\n\tprivate getFoldingLevel() {\n\t\treturn parseInt(this.id.substr(FoldLevelAction.ID_PREFIX.length));\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tsetCollapseStateAtLevel(foldingModel, this.getFoldingLevel(), true, this.getSelectedLines(editor));\n\t}\n}\n\n/** Action to go to the parent fold of current line */\nclass GotoParentFoldAction extends FoldingAction<void> {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.gotoParentFold',\n\t\t\tlabel: nls.localize('gotoParentFold.label', \"Go to Parent Fold\"),\n\t\t\talias: 'Go to Parent Fold',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tif (selectedLines.length > 0) {\n\t\t\tlet startLineNumber = getParentFoldLine(selectedLines[0], foldingModel);\n\t\t\tif (startLineNumber !== null) {\n\t\t\t\teditor.setSelection({\n\t\t\t\t\tstartLineNumber: startLineNumber,\n\t\t\t\t\tstartColumn: 1,\n\t\t\t\t\tendLineNumber: startLineNumber,\n\t\t\t\t\tendColumn: 1\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Action to go to the previous fold of current line */\nclass GotoPreviousFoldAction extends FoldingAction<void> {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.gotoPreviousFold',\n\t\t\tlabel: nls.localize('gotoPreviousFold.label', \"Go to Previous Folding Range\"),\n\t\t\talias: 'Go to Previous Folding Range',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tif (selectedLines.length > 0) {\n\t\t\tlet startLineNumber = getPreviousFoldLine(selectedLines[0], foldingModel);\n\t\t\tif (startLineNumber !== null) {\n\t\t\t\teditor.setSelection({\n\t\t\t\t\tstartLineNumber: startLineNumber,\n\t\t\t\t\tstartColumn: 1,\n\t\t\t\t\tendLineNumber: startLineNumber,\n\t\t\t\t\tendColumn: 1\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Action to go to the next fold of current line */\nclass GotoNextFoldAction extends FoldingAction<void> {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.gotoNextFold',\n\t\t\tlabel: nls.localize('gotoNextFold.label', \"Go to Next Folding Range\"),\n\t\t\talias: 'Go to Next Folding Range',\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tinvoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {\n\t\tlet selectedLines = this.getSelectedLines(editor);\n\t\tif (selectedLines.length > 0) {\n\t\t\tlet startLineNumber = getNextFoldLine(selectedLines[0], foldingModel);\n\t\t\tif (startLineNumber !== null) {\n\t\t\t\teditor.setSelection({\n\t\t\t\t\tstartLineNumber: startLineNumber,\n\t\t\t\t\tstartColumn: 1,\n\t\t\t\t\tendLineNumber: startLineNumber,\n\t\t\t\t\tendColumn: 1\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterEditorContribution(FoldingController.ID, FoldingController);\nregisterEditorAction(UnfoldAction);\nregisterEditorAction(UnFoldRecursivelyAction);\nregisterEditorAction(FoldAction);\nregisterEditorAction(FoldRecursivelyAction);\nregisterEditorAction(FoldAllAction);\nregisterEditorAction(UnfoldAllAction);\nregisterEditorAction(FoldAllBlockCommentsAction);\nregisterEditorAction(FoldAllRegionsAction);\nregisterEditorAction(UnfoldAllRegionsAction);\nregisterEditorAction(FoldAllRegionsExceptAction);\nregisterEditorAction(UnfoldAllRegionsExceptAction);\nregisterEditorAction(ToggleFoldAction);\nregisterEditorAction(GotoParentFoldAction);\nregisterEditorAction(GotoPreviousFoldAction);\nregisterEditorAction(GotoNextFoldAction);\n\nfor (let i = 1; i <= 7; i++) {\n\tregisterInstantiatedEditorAction(\n\t\tnew FoldLevelAction({\n\t\t\tid: FoldLevelAction.ID(i),\n\t\t\tlabel: nls.localize('foldLevelAction.label', \"Fold Level {0}\", i),\n\t\t\talias: `Fold Level ${i}`,\n\t\t\tprecondition: CONTEXT_FOLDING_ENABLED,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | (KeyCode.Digit0 + i)),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t})\n\t);\n}\n\nexport const foldBackgroundBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hc: null }, nls.localize('foldBackgroundBackground', \"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorFoldForeground = registerColor('editorGutter.foldingControlForeground', { dark: iconForeground, light: iconForeground, hc: iconForeground }, nls.localize('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.'));\n\nregisterThemingParticipant((theme, collector) => {\n\tconst foldBackground = theme.getColor(foldBackgroundBackground);\n\tif (foldBackground) {\n\t\tcollector.addRule(`.monaco-editor .folded-background { background-color: ${foldBackground}; }`);\n\t}\n\n\tconst editorFoldColor = theme.getColor(editorFoldForeground);\n\tif (editorFoldColor) {\n\t\tcollector.addRule(`\n\t\t.monaco-editor .cldr${ThemeIcon.asCSSSelector(foldingExpandedIcon)},\n\t\t.monaco-editor .cldr${ThemeIcon.asCSSSelector(foldingCollapsedIcon)} {\n\t\t\tcolor: ${editorFoldColor} !important;\n\t\t}\n\t\t`);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { HoverAction, HoverWidget } from 'vs/base/browser/ui/hover/hoverWidget';\nimport { coalesce } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';\nimport { Constants } from 'vs/base/common/uint';\nimport { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration, IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { TokenizationRegistry } from 'vs/editor/common/languages';\nimport { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/browser/hoverOperation';\nimport { HoverAnchor, HoverAnchorType, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverColorPickerWidget, IEditorHoverAction, IEditorHoverParticipant, IEditorHoverRenderContext, IEditorHoverStatusBar, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { Context as SuggestContext } from 'vs/editor/contrib/suggest/browser/suggest';\nimport { AsyncIterableObject } from 'vs/base/common/async';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { Emitter } from 'vs/base/common/event';\nimport { IModelDecorationsChangedEvent } from 'vs/editor/common/textModelEvents';\n\nconst $ = dom.$;\n\nexport class ContentHoverController extends Disposable {\n\n\tprivate readonly _participants: IEditorHoverParticipant[];\n\tprivate readonly _widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));\n\tprivate readonly _decorationsChangerListener = this._register(new EditorDecorationsChangerListener(this._editor));\n\tprivate readonly _computer: ContentHoverComputer;\n\tprivate readonly _hoverOperation: HoverOperation<IHoverPart>;\n\n\tprivate _messages: IHoverPart[];\n\tprivate _messagesAreComplete: boolean;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t) {\n\t\tsuper();\n\n\t\tthis._messages = [];\n\t\tthis._messagesAreComplete = false;\n\n\t\t// Instantiate participants and sort them by `hoverOrdinal` which is relevant for rendering order.\n\t\tthis._participants = [];\n\t\tfor (const participant of HoverParticipantRegistry.getAll()) {\n\t\t\tthis._participants.push(this._instantiationService.createInstance(participant, this._editor));\n\t\t}\n\t\tthis._participants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);\n\n\t\tthis._computer = new ContentHoverComputer(this._editor, this._participants);\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, this._computer));\n\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tthis._withResult(result.value, result.isComplete, result.hasLoadingMessage);\n\t\t}));\n\t\tthis._register(this._decorationsChangerListener.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(dom.addStandardDisposableListener(this._widget.getDomNode(), 'keydown', (e) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(TokenizationRegistry.onDidChange(() => {\n\t\t\tif (this._widget.position && this._computer.anchor && this._messages.length > 0) {\n\t\t\t\tthis._widget.clear();\n\t\t\t\tthis._renderMessages(this._computer.anchor, this._messages);\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._widget.position) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\n\t\t\tif (!this._widget.isColorPickerVisible) { // TODO@Michel ensure that displayed text for other decorations is computed even if color picker is in place\n\t\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic maybeShowAt(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst anchorCandidates: HoverAnchor[] = [];\n\n\t\tfor (const participant of this._participants) {\n\t\t\tif (participant.suggestHoverAnchor) {\n\t\t\t\tconst anchor = participant.suggestHoverAnchor(mouseEvent);\n\t\t\t\tif (anchor) {\n\t\t\t\t\tanchorCandidates.push(anchor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst target = mouseEvent.target;\n\n\t\tif (target.type === MouseTargetType.CONTENT_TEXT) {\n\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range));\n\t\t}\n\n\t\tif (target.type === MouseTargetType.CONTENT_EMPTY) {\n\t\t\tconst epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2;\n\t\t\tif (!target.detail.isAfterLines && typeof target.detail.horizontalDistanceToText === 'number' && target.detail.horizontalDistanceToText < epsilon) {\n\t\t\t\t// Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range));\n\t\t\t}\n\t\t}\n\n\t\tif (anchorCandidates.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tanchorCandidates.sort((a, b) => b.priority - a.priority);\n\t\tthis._startShowingAt(anchorCandidates[0], HoverStartMode.Delayed, false);\n\t\treturn true;\n\t}\n\n\tpublic startShowingAtRange(range: Range, mode: HoverStartMode, focus: boolean): void {\n\t\tthis._startShowingAt(new HoverRangeAnchor(0, range), mode, focus);\n\t}\n\n\tprivate _startShowingAt(anchor: HoverAnchor, mode: HoverStartMode, focus: boolean): void {\n\t\tif (this._computer.anchor && this._computer.anchor.equals(anchor)) {\n\t\t\t// We have to show the widget at the exact same range as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hoverOperation.cancel();\n\n\t\tif (this._widget.position) {\n\t\t\t// The range might have changed, but the hover is visible\n\t\t\t// Instead of hiding it completely, filter out messages that are still in the new range and\n\t\t\t// kick off a new computation\n\t\t\tif (!this._computer.anchor || !anchor.canAdoptVisibleHover(this._computer.anchor, this._widget.position)) {\n\t\t\t\tthis.hide();\n\t\t\t} else {\n\t\t\t\tconst filteredMessages = this._messages.filter((m) => m.isValidForHoverAnchor(anchor));\n\t\t\t\tif (filteredMessages.length === 0) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else if (filteredMessages.length === this._messages.length && this._messagesAreComplete) {\n\t\t\t\t\t// no change\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tthis._renderMessages(anchor, filteredMessages);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._computer.anchor = anchor;\n\t\tthis._computer.shouldFocus = focus;\n\t\tthis._hoverOperation.start(mode);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._computer.anchor = null;\n\t\tthis._hoverOperation.cancel();\n\t\tthis._widget.hide();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._widget.isColorPickerVisible;\n\t}\n\n\tprivate _addLoadingMessage(result: IHoverPart[]): IHoverPart[] {\n\t\tif (this._computer.anchor) {\n\t\t\tfor (const participant of this._participants) {\n\t\t\t\tif (participant.createLoadingMessage) {\n\t\t\t\t\tconst loadingMessage = participant.createLoadingMessage(this._computer.anchor);\n\t\t\t\t\tif (loadingMessage) {\n\t\t\t\t\t\treturn result.slice(0).concat([loadingMessage]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _withResult(result: IHoverPart[], isComplete: boolean, hasLoadingMessage: boolean): void {\n\t\tthis._messages = (hasLoadingMessage ? this._addLoadingMessage(result) : result);\n\t\tthis._messagesAreComplete = isComplete;\n\n\t\tif (this._computer.anchor && this._messages.length > 0) {\n\t\t\tthis._renderMessages(this._computer.anchor, this._messages);\n\t\t} else if (isComplete) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(anchor: HoverAnchor, messages: IHoverPart[]): void {\n\t\t// update column from which to show\n\t\tlet renderColumn = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\tlet highlightRange: Range = messages[0].range;\n\t\tlet forceShowAtRange: Range | null = null;\n\t\tfor (const msg of messages) {\n\t\t\trenderColumn = Math.min(renderColumn, msg.range.startColumn);\n\t\t\thighlightRange = Range.plusRange(highlightRange, msg.range);\n\t\t\tif (msg.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = msg.range;\n\t\t\t}\n\t\t}\n\n\t\tconst disposables = new DisposableStore();\n\t\tconst statusBar = disposables.add(new EditorHoverStatusBar(this._keybindingService));\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tlet colorPicker: IEditorHoverColorPickerWidget | null = null;\n\t\tconst context: IEditorHoverRenderContext = {\n\t\t\tfragment,\n\t\t\tstatusBar,\n\t\t\tsetColorPicker: (widget) => colorPicker = widget,\n\t\t\tonContentsChanged: () => this._widget.onContentsChanged(),\n\t\t\thide: () => this.hide()\n\t\t};\n\n\t\tfor (const participant of this._participants) {\n\t\t\tconst hoverParts = messages.filter(msg => msg.owner === participant);\n\t\t\tif (hoverParts.length > 0) {\n\t\t\t\tdisposables.add(participant.renderHoverParts(context, hoverParts));\n\t\t\t}\n\t\t}\n\t\tif (statusBar.hasContent) {\n\t\t\tfragment.appendChild(statusBar.hoverElement);\n\t\t}\n\n\t\tif (fragment.hasChildNodes()) {\n\t\t\tif (highlightRange) {\n\t\t\t\tconst highlightDecorations = this._decorationsChangerListener.deltaDecorations([], [{\n\t\t\t\t\trange: highlightRange,\n\t\t\t\t\toptions: ContentHoverController._DECORATION_OPTIONS\n\t\t\t\t}]);\n\t\t\t\tdisposables.add(toDisposable(() => {\n\t\t\t\t\tthis._decorationsChangerListener.deltaDecorations(highlightDecorations, []);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tthis._widget.showAt(fragment, new ContentHoverVisibleData(\n\t\t\t\tcolorPicker,\n\t\t\t\tforceShowAtRange ? forceShowAtRange.getStartPosition() : new Position(anchor.range.startLineNumber, renderColumn),\n\t\t\t\tforceShowAtRange ? forceShowAtRange : highlightRange,\n\t\t\t\tthis._editor.getOption(EditorOption.hover).above,\n\t\t\t\tthis._computer.shouldFocus,\n\t\t\t\tdisposables\n\t\t\t));\n\t\t} else {\n\t\t\tdisposables.dispose();\n\t\t}\n\t}\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n}\n\n/**\n * Allows listening to `ICodeEditor.onDidChangeModelDecorations` and ignores the change caused by itself.\n */\nclass EditorDecorationsChangerListener extends Disposable {\n\n\tprivate readonly _onDidChangeModelDecorations = this._register(new Emitter<IModelDecorationsChangedEvent>());\n\tpublic readonly onDidChangeModelDecorations = this._onDidChangeModelDecorations.event;\n\n\tprivate _isChangingDecorations: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) {\n\t\tsuper();\n\t\tthis._register(this._editor.onDidChangeModelDecorations((e) => {\n\t\t\tif (this._isChangingDecorations) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onDidChangeModelDecorations.fire(e);\n\t\t}));\n\t}\n\n\tpublic deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[] {\n\t\ttry {\n\t\t\tthis._isChangingDecorations = true;\n\t\t\treturn this._editor.deltaDecorations(oldDecorations, newDecorations);\n\t\t} finally {\n\t\t\tthis._isChangingDecorations = false;\n\t\t}\n\t}\n}\n\nclass ContentHoverVisibleData {\n\tconstructor(\n\t\tpublic readonly colorPicker: IEditorHoverColorPickerWidget | null,\n\t\tpublic readonly showAtPosition: Position,\n\t\tpublic readonly showAtRange: Range,\n\t\tpublic readonly preferAbove: boolean,\n\t\tpublic readonly stoleFocus: boolean,\n\t\tpublic readonly disposables: DisposableStore\n\t) { }\n}\n\nexport class ContentHoverWidget extends Disposable implements IContentWidget {\n\n\tstatic readonly ID = 'editor.contrib.contentHoverWidget';\n\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(this._contextKeyService);\n\tprivate readonly _hover: HoverWidget = this._register(new HoverWidget());\n\n\tprivate _visibleData: ContentHoverVisibleData | null = null;\n\n\t/**\n\t * Returns `null` if the hover is not visible.\n\t */\n\tpublic get position(): Position | null {\n\t\treturn this._visibleData?.showAtPosition ?? null;\n\t}\n\n\tpublic get isColorPickerVisible(): boolean {\n\t\treturn Boolean(this._visibleData?.colorPicker);\n\t}\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => this._layout()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\n\t\tthis._setVisibleData(null);\n\t\tthis._layout();\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._editor.removeContentWidget(this);\n\t\tif (this._visibleData) {\n\t\t\tthis._visibleData.disposables.dispose();\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn ContentHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IContentWidgetPosition | null {\n\t\tif (!this._visibleData) {\n\t\t\treturn null;\n\t\t}\n\t\tlet preferAbove = this._visibleData.preferAbove;\n\t\tif (!preferAbove && this._contextKeyService.getContextKeyValue<boolean>(SuggestContext.Visible.key)) {\n\t\t\t// Prefer rendering above if the suggest widget is visible\n\t\t\tpreferAbove = true;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._visibleData.showAtPosition,\n\t\t\trange: this._visibleData.showAtRange,\n\t\t\tpreference: (\n\t\t\t\tpreferAbove\n\t\t\t\t\t? [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW]\n\t\t\t\t\t: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE]\n\t\t\t),\n\t\t};\n\t}\n\n\tprivate _setVisibleData(visibleData: ContentHoverVisibleData | null): void {\n\t\tif (this._visibleData) {\n\t\t\tthis._visibleData.disposables.dispose();\n\t\t}\n\t\tthis._visibleData = visibleData;\n\t\tthis._hoverVisibleKey.set(!!this._visibleData);\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._visibleData);\n\t}\n\n\tprivate _layout(): void {\n\t\tconst height = Math.max(this._editor.getLayoutInfo().height / 4, 250);\n\t\tconst { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);\n\n\t\tthis._hover.contentsDomNode.style.fontSize = `${fontSize}px`;\n\t\tthis._hover.contentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\tthis._hover.contentsDomNode.style.maxHeight = `${height}px`;\n\t\tthis._hover.contentsDomNode.style.maxWidth = `${Math.max(this._editor.getLayoutInfo().width * 0.66, 500)}px`;\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tpublic showAt(node: DocumentFragment, visibleData: ContentHoverVisibleData): void {\n\t\tthis._setVisibleData(visibleData);\n\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._hover.contentsDomNode.style.paddingBottom = '';\n\t\tthis._updateFont();\n\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis.onContentsChanged();\n\n\t\t// Simply force a synchronous render on the editor\n\t\t// such that the widget does not really render with left = '0px'\n\t\tthis._editor.render();\n\n\t\t// See https://github.com/microsoft/vscode/issues/140339\n\t\t// TODO: Doing a second layout of the hover after force rendering the editor\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis.onContentsChanged();\n\n\t\tif (visibleData.stoleFocus) {\n\t\t\tthis._hover.containerDomNode.focus();\n\t\t}\n\t\tif (visibleData.colorPicker) {\n\t\t\tvisibleData.colorPicker.layout();\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (this._visibleData) {\n\t\t\tconst stoleFocus = this._visibleData.stoleFocus;\n\t\t\tthis._setVisibleData(null);\n\t\t\tthis._editor.layoutContentWidget(this);\n\t\t\tif (stoleFocus) {\n\t\t\t\tthis._editor.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic onContentsChanged(): void {\n\t\tthis._hover.onContentsChanged();\n\n\t\tconst scrollDimensions = this._hover.scrollbar.getScrollDimensions();\n\t\tconst hasHorizontalScrollbar = (scrollDimensions.scrollWidth > scrollDimensions.width);\n\t\tif (hasHorizontalScrollbar) {\n\t\t\t// There is just a horizontal scrollbar\n\t\t\tconst extraBottomPadding = `${this._hover.scrollbar.options.horizontalScrollbarSize}px`;\n\t\t\tif (this._hover.contentsDomNode.style.paddingBottom !== extraBottomPadding) {\n\t\t\t\tthis._hover.contentsDomNode.style.paddingBottom = extraBottomPadding;\n\t\t\t\tthis._editor.layoutContentWidget(this);\n\t\t\t\tthis._hover.onContentsChanged();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic clear(): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t}\n}\n\nclass EditorHoverStatusBar extends Disposable implements IEditorHoverStatusBar {\n\n\tpublic readonly hoverElement: HTMLElement;\n\tprivate readonly actionsElement: HTMLElement;\n\tprivate _hasContent: boolean = false;\n\n\tpublic get hasContent() {\n\t\treturn this._hasContent;\n\t}\n\n\tconstructor(\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t) {\n\t\tsuper();\n\t\tthis.hoverElement = $('div.hover-row.status-bar');\n\t\tthis.actionsElement = dom.append(this.hoverElement, $('div.actions'));\n\t}\n\n\tpublic addAction(actionOptions: { label: string; iconClass?: string; run: (target: HTMLElement) => void; commandId: string }): IEditorHoverAction {\n\t\tconst keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);\n\t\tconst keybindingLabel = keybinding ? keybinding.getLabel() : null;\n\t\tthis._hasContent = true;\n\t\treturn this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel));\n\t}\n\n\tpublic append(element: HTMLElement): HTMLElement {\n\t\tconst result = dom.append(this.actionsElement, element);\n\t\tthis._hasContent = true;\n\t\treturn result;\n\t}\n}\n\nclass ContentHoverComputer implements IHoverComputer<IHoverPart> {\n\n\tprivate _anchor: HoverAnchor | null = null;\n\tpublic get anchor(): HoverAnchor | null { return this._anchor; }\n\tpublic set anchor(value: HoverAnchor | null) { this._anchor = value; }\n\n\tprivate _shouldFocus: boolean = false;\n\tpublic get shouldFocus(): boolean { return this._shouldFocus; }\n\tpublic set shouldFocus(value: boolean) { this._shouldFocus = value; }\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _participants: readonly IEditorHoverParticipant[]\n\t) {\n\t}\n\n\tprivate static _getLineDecorations(editor: IActiveCodeEditor, anchor: HoverAnchor): IModelDecoration[] {\n\t\tif (anchor.type !== HoverAnchorType.Range) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst model = editor.getModel();\n\t\tconst lineNumber = anchor.range.startLineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\treturn editor.getLineDecorations(lineNumber).filter((d) => {\n\t\t\tif (d.options.isWholeLine) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1;\n\t\t\tconst endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn;\n\t\t\tif (d.options.showIfCollapsed) {\n\t\t\t\t// Relax check around `showIfCollapsed` decorations to also include +/- 1 character\n\t\t\t\tif (startColumn > anchor.range.startColumn + 1 || anchor.range.endColumn - 1 > endColumn) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (startColumn > anchor.range.startColumn || anchor.range.endColumn > endColumn) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tpublic computeAsync(token: CancellationToken): AsyncIterableObject<IHoverPart> {\n\t\tconst anchor = this._anchor;\n\n\t\tif (!this._editor.hasModel() || !anchor) {\n\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t}\n\n\t\tconst lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, anchor);\n\t\treturn AsyncIterableObject.merge(\n\t\t\tthis._participants.map((participant) => {\n\t\t\t\tif (!participant.computeAsync) {\n\t\t\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t\t\t}\n\t\t\t\treturn participant.computeAsync(anchor, lineDecorations, token);\n\t\t\t})\n\t\t);\n\t}\n\n\tpublic computeSync(): IHoverPart[] {\n\t\tif (!this._editor.hasModel() || !this._anchor) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, this._anchor);\n\n\t\tlet result: IHoverPart[] = [];\n\t\tfor (const participant of this._participants) {\n\t\t\tresult = result.concat(participant.computeSync(this._anchor, lineDecorations));\n\t\t}\n\n\t\treturn coalesce(result);\n\t}\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 { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IInplaceReplaceSupportResult } from 'vs/editor/common/languages';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { editorBracketMatchBorder } from 'vs/editor/common/core/editorColorRegistry';\nimport * as nls from 'vs/nls';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { InPlaceReplaceCommand } from './inPlaceReplaceCommand';\n\nclass InPlaceReplaceController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.inPlaceReplaceController';\n\n\tstatic get(editor: ICodeEditor): InPlaceReplaceController | null {\n\t\treturn editor.getContribution<InPlaceReplaceController>(InPlaceReplaceController.ID);\n\t}\n\n\tprivate static readonly DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'in-place-replace',\n\t\tclassName: 'valueSetReplacement'\n\t});\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly editorWorkerService: IEditorWorkerService;\n\tprivate decorationIds: string[] = [];\n\tprivate currentRequest?: CancelablePromise<IInplaceReplaceSupportResult | null>;\n\tprivate decorationRemover?: CancelablePromise<void>;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService\n\t) {\n\t\tthis.editor = editor;\n\t\tthis.editorWorkerService = editorWorkerService;\n\t}\n\n\tpublic dispose(): void {\n\t}\n\n\tpublic run(source: string, up: boolean): Promise<void> | undefined {\n\n\t\t// cancel any pending request\n\t\tif (this.currentRequest) {\n\t\t\tthis.currentRequest.cancel();\n\t\t}\n\n\t\tconst editorSelection = this.editor.getSelection();\n\t\tconst model = this.editor.getModel();\n\t\tif (!model || !editorSelection) {\n\t\t\treturn undefined;\n\t\t}\n\t\tlet selection = editorSelection;\n\t\tif (selection.startLineNumber !== selection.endLineNumber) {\n\t\t\t// Can't accept multiline selection\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst state = new EditorState(this.editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);\n\t\tconst modelURI = model.uri;\n\t\tif (!this.editorWorkerService.canNavigateValueSet(modelURI)) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tthis.currentRequest = createCancelablePromise(token => this.editorWorkerService.navigateValueSet(modelURI, selection!, up));\n\n\t\treturn this.currentRequest.then(result => {\n\n\t\t\tif (!result || !result.range || !result.value) {\n\t\t\t\t// No proper result\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!state.validate(this.editor)) {\n\t\t\t\t// state has changed\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Selection\n\t\t\tlet editRange = Range.lift(result.range);\n\t\t\tlet highlightRange = result.range;\n\t\t\tlet diff = result.value.length - (selection!.endColumn - selection!.startColumn);\n\n\t\t\t// highlight\n\t\t\thighlightRange = {\n\t\t\t\tstartLineNumber: highlightRange.startLineNumber,\n\t\t\t\tstartColumn: highlightRange.startColumn,\n\t\t\t\tendLineNumber: highlightRange.endLineNumber,\n\t\t\t\tendColumn: highlightRange.startColumn + result.value.length\n\t\t\t};\n\t\t\tif (diff > 1) {\n\t\t\t\tselection = new Selection(selection!.startLineNumber, selection!.startColumn, selection!.endLineNumber, selection!.endColumn + diff - 1);\n\t\t\t}\n\n\t\t\t// Insert new text\n\t\t\tconst command = new InPlaceReplaceCommand(editRange, selection!, result.value);\n\n\t\t\tthis.editor.pushUndoStop();\n\t\t\tthis.editor.executeCommand(source, command);\n\t\t\tthis.editor.pushUndoStop();\n\n\t\t\t// add decoration\n\t\t\tthis.decorationIds = this.editor.deltaDecorations(this.decorationIds, [{\n\t\t\t\trange: highlightRange,\n\t\t\t\toptions: InPlaceReplaceController.DECORATION\n\t\t\t}]);\n\n\t\t\t// remove decoration after delay\n\t\t\tif (this.decorationRemover) {\n\t\t\t\tthis.decorationRemover.cancel();\n\t\t\t}\n\t\t\tthis.decorationRemover = timeout(350);\n\t\t\tthis.decorationRemover.then(() => this.decorationIds = this.editor.deltaDecorations(this.decorationIds, [])).catch(onUnexpectedError);\n\n\t\t}).catch(onUnexpectedError);\n\t}\n}\n\nclass InPlaceReplaceUp extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inPlaceReplace.up',\n\t\t\tlabel: nls.localize('InPlaceReplaceAction.previous.label', \"Replace with Previous Value\"),\n\t\t\talias: 'Replace with Previous Value',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Comma,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> | undefined {\n\t\tconst controller = InPlaceReplaceController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\t\treturn controller.run(this.id, true);\n\t}\n}\n\nclass InPlaceReplaceDown extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inPlaceReplace.down',\n\t\t\tlabel: nls.localize('InPlaceReplaceAction.next.label', \"Replace with Next Value\"),\n\t\t\talias: 'Replace with Next Value',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Period,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> | undefined {\n\t\tconst controller = InPlaceReplaceController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\t\treturn controller.run(this.id, false);\n\t}\n}\n\nregisterEditorContribution(InPlaceReplaceController.ID, InPlaceReplaceController);\nregisterEditorAction(InPlaceReplaceUp);\nregisterEditorAction(InPlaceReplaceDown);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(editorBracketMatchBorder);\n\tif (border) {\n\t\tcollector.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${border}; }`);\n\t}\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 * as arrays from 'vs/base/common/arrays';\nimport { CancelablePromise, createCancelablePromise, Delayer, first } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { Color } from 'vs/base/common/color';\nimport { isCancellationError, onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { Event } from 'vs/base/common/event';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { LinkedEditingRangeProvider, LinkedEditingRanges } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport * as nls from 'vs/nls';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { StopWatch } from 'vs/base/common/stopwatch';\n\nexport const CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('LinkedEditingInputVisible', false);\n\nconst DECORATION_CLASS_NAME = 'linked-editing-decoration';\n\nexport class LinkedEditingContribution extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.linkedEditing';\n\n\tprivate static readonly DECORATION = ModelDecorationOptions.register({\n\t\tdescription: 'linked-editing',\n\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\tclassName: DECORATION_CLASS_NAME\n\t});\n\n\tstatic get(editor: ICodeEditor): LinkedEditingContribution | null {\n\t\treturn editor.getContribution<LinkedEditingContribution>(LinkedEditingContribution.ID);\n\t}\n\n\tprivate _debounceDuration: number | undefined;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _providers: LanguageFeatureRegistry<LinkedEditingRangeProvider>;\n\tprivate _enabled: boolean;\n\n\tprivate readonly _visibleContextKey: IContextKey<boolean>;\n\tprivate readonly _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _rangeUpdateTriggerPromise: Promise<any> | null;\n\tprivate _rangeSyncTriggerPromise: Promise<any> | null;\n\n\tprivate _currentRequest: CancelablePromise<any> | null;\n\tprivate _currentRequestPosition: Position | null;\n\tprivate _currentRequestModelVersion: number | null;\n\n\tprivate _currentDecorations: string[]; // The one at index 0 is the reference one\n\tprivate _languageWordPattern: RegExp | null;\n\tprivate _currentWordPattern: RegExp | null;\n\tprivate _ignoreChangeEvent: boolean;\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageConfigurationService private readonly languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._providers = languageFeaturesService.linkedEditingRangeProvider;\n\t\tthis._enabled = false;\n\t\tthis._visibleContextKey = CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(contextKeyService);\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(this._providers, 'Linked Editing', { min: 200 });\n\n\t\tthis._currentDecorations = [];\n\t\tthis._languageWordPattern = null;\n\t\tthis._currentWordPattern = null;\n\t\tthis._ignoreChangeEvent = false;\n\t\tthis._localToDispose = this._register(new DisposableStore());\n\n\t\tthis._rangeUpdateTriggerPromise = null;\n\t\tthis._rangeSyncTriggerPromise = null;\n\n\t\tthis._currentRequest = null;\n\t\tthis._currentRequestPosition = null;\n\t\tthis._currentRequestModelVersion = null;\n\n\t\tthis._register(this._editor.onDidChangeModel(() => this.reinitialize(true)));\n\n\t\tthis._register(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.linkedEditing) || e.hasChanged(EditorOption.renameOnType)) {\n\t\t\t\tthis.reinitialize(false);\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._providers.onDidChange(() => this.reinitialize(false)));\n\t\tthis._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize(true)));\n\n\t\tthis.reinitialize(true);\n\t}\n\n\tprivate reinitialize(forceRefresh: boolean) {\n\t\tconst model = this._editor.getModel();\n\t\tconst isEnabled = model !== null && (this._editor.getOption(EditorOption.linkedEditing) || this._editor.getOption(EditorOption.renameOnType)) && this._providers.has(model);\n\t\tif (isEnabled === this._enabled && !forceRefresh) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._enabled = isEnabled;\n\n\t\tthis.clearRanges();\n\t\tthis._localToDispose.clear();\n\n\t\tif (!isEnabled || model === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(\n\t\t\tEvent.runAndSubscribe(\n\t\t\t\tmodel.onDidChangeLanguageConfiguration,\n\t\t\t\t() => {\n\t\t\t\t\tthis._languageWordPattern = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\tconst rangeUpdateScheduler = new Delayer(this._debounceInformation.get(model));\n\t\tconst triggerRangeUpdate = () => {\n\t\t\tthis._rangeUpdateTriggerPromise = rangeUpdateScheduler.trigger(() => this.updateRanges(), this._debounceDuration ?? this._debounceInformation.get(model));\n\t\t};\n\t\tconst rangeSyncScheduler = new Delayer(0);\n\t\tconst triggerRangeSync = (decorations: string[]) => {\n\t\t\tthis._rangeSyncTriggerPromise = rangeSyncScheduler.trigger(() => this._syncRanges(decorations));\n\t\t};\n\t\tthis._localToDispose.add(this._editor.onDidChangeCursorPosition(() => {\n\t\t\ttriggerRangeUpdate();\n\t\t}));\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (!this._ignoreChangeEvent) {\n\t\t\t\tif (this._currentDecorations.length > 0) {\n\t\t\t\t\tconst referenceRange = model.getDecorationRange(this._currentDecorations[0]);\n\t\t\t\t\tif (referenceRange && e.changes.every(c => referenceRange.intersectRanges(c.range))) {\n\t\t\t\t\t\ttriggerRangeSync(this._currentDecorations);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttriggerRangeUpdate();\n\t\t}));\n\t\tthis._localToDispose.add({\n\t\t\tdispose: () => {\n\t\t\t\trangeUpdateScheduler.dispose();\n\t\t\t\trangeSyncScheduler.dispose();\n\t\t\t}\n\t\t});\n\t\tthis.updateRanges();\n\t}\n\n\tprivate _syncRanges(decorations: string[]): void {\n\t\t// dalayed invocation, make sure we're still on\n\t\tif (!this._editor.hasModel() || decorations !== this._currentDecorations || decorations.length === 0) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst referenceRange = model.getDecorationRange(decorations[0]);\n\n\t\tif (!referenceRange || referenceRange.startLineNumber !== referenceRange.endLineNumber) {\n\t\t\treturn this.clearRanges();\n\t\t}\n\n\t\tconst referenceValue = model.getValueInRange(referenceRange);\n\t\tif (this._currentWordPattern) {\n\t\t\tconst match = referenceValue.match(this._currentWordPattern);\n\t\t\tconst matchLength = match ? match[0].length : 0;\n\t\t\tif (matchLength !== referenceValue.length) {\n\t\t\t\treturn this.clearRanges();\n\t\t\t}\n\t\t}\n\n\t\tlet edits: ISingleEditOperation[] = [];\n\t\tfor (let i = 1, len = decorations.length; i < len; i++) {\n\t\t\tconst mirrorRange = model.getDecorationRange(decorations[i]);\n\t\t\tif (!mirrorRange) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (mirrorRange.startLineNumber !== mirrorRange.endLineNumber) {\n\t\t\t\tedits.push({\n\t\t\t\t\trange: mirrorRange,\n\t\t\t\t\ttext: referenceValue\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlet oldValue = model.getValueInRange(mirrorRange);\n\t\t\t\tlet newValue = referenceValue;\n\t\t\t\tlet rangeStartColumn = mirrorRange.startColumn;\n\t\t\t\tlet rangeEndColumn = mirrorRange.endColumn;\n\n\t\t\t\tconst commonPrefixLength = strings.commonPrefixLength(oldValue, newValue);\n\t\t\t\trangeStartColumn += commonPrefixLength;\n\t\t\t\toldValue = oldValue.substr(commonPrefixLength);\n\t\t\t\tnewValue = newValue.substr(commonPrefixLength);\n\n\t\t\t\tconst commonSuffixLength = strings.commonSuffixLength(oldValue, newValue);\n\t\t\t\trangeEndColumn -= commonSuffixLength;\n\t\t\t\toldValue = oldValue.substr(0, oldValue.length - commonSuffixLength);\n\t\t\t\tnewValue = newValue.substr(0, newValue.length - commonSuffixLength);\n\n\t\t\t\tif (rangeStartColumn !== rangeEndColumn || newValue.length !== 0) {\n\t\t\t\t\tedits.push({\n\t\t\t\t\t\trange: new Range(mirrorRange.startLineNumber, rangeStartColumn, mirrorRange.endLineNumber, rangeEndColumn),\n\t\t\t\t\t\ttext: newValue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (edits.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._editor.popUndoStop();\n\t\t\tthis._ignoreChangeEvent = true;\n\t\t\tconst prevEditOperationType = this._editor._getViewModel().getPrevEditOperationType();\n\t\t\tthis._editor.executeEdits('linkedEditing', edits);\n\t\t\tthis._editor._getViewModel().setPrevEditOperationType(prevEditOperationType);\n\t\t} finally {\n\t\t\tthis._ignoreChangeEvent = false;\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.clearRanges();\n\t\tsuper.dispose();\n\t}\n\n\tpublic clearRanges(): void {\n\t\tthis._visibleContextKey.set(false);\n\t\tthis._currentDecorations = this._editor.deltaDecorations(this._currentDecorations, []);\n\t\tif (this._currentRequest) {\n\t\t\tthis._currentRequest.cancel();\n\t\t\tthis._currentRequest = null;\n\t\t\tthis._currentRequestPosition = null;\n\t\t}\n\t}\n\n\tpublic async updateRanges(force = false): Promise<void> {\n\t\tif (!this._editor.hasModel()) {\n\t\t\tthis.clearRanges();\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = this._editor.getPosition();\n\t\tif (!this._enabled && !force || this._editor.getSelections().length > 1) {\n\t\t\t// disabled or multicursor\n\t\t\tthis.clearRanges();\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelVersionId = model.getVersionId();\n\t\tif (this._currentRequestPosition && this._currentRequestModelVersion === modelVersionId) {\n\t\t\tif (position.equals(this._currentRequestPosition)) {\n\t\t\t\treturn; // same position\n\t\t\t}\n\t\t\tif (this._currentDecorations && this._currentDecorations.length > 0) {\n\t\t\t\tconst range = model.getDecorationRange(this._currentDecorations[0]);\n\t\t\t\tif (range && range.containsPosition(position)) {\n\t\t\t\t\treturn; // just moving inside the existing primary range\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._currentRequestPosition = position;\n\t\tthis._currentRequestModelVersion = modelVersionId;\n\t\tconst request = createCancelablePromise(async token => {\n\t\t\ttry {\n\t\t\t\tconst sw = new StopWatch(false);\n\t\t\t\tconst response = await getLinkedEditingRanges(this._providers, model, position, token);\n\t\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\t\tif (request !== this._currentRequest) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._currentRequest = null;\n\t\t\t\tif (modelVersionId !== model.getVersionId()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet ranges: IRange[] = [];\n\t\t\t\tif (response?.ranges) {\n\t\t\t\t\tranges = response.ranges;\n\t\t\t\t}\n\n\t\t\t\tthis._currentWordPattern = response?.wordPattern || this._languageWordPattern;\n\n\t\t\t\tlet foundReferenceRange = false;\n\t\t\t\tfor (let i = 0, len = ranges.length; i < len; i++) {\n\t\t\t\t\tif (Range.containsPosition(ranges[i], position)) {\n\t\t\t\t\t\tfoundReferenceRange = true;\n\t\t\t\t\t\tif (i !== 0) {\n\t\t\t\t\t\t\tconst referenceRange = ranges[i];\n\t\t\t\t\t\t\tranges.splice(i, 1);\n\t\t\t\t\t\t\tranges.unshift(referenceRange);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!foundReferenceRange) {\n\t\t\t\t\t// Cannot do linked editing if the ranges are not where the cursor is...\n\t\t\t\t\tthis.clearRanges();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst decorations: IModelDeltaDecoration[] = ranges.map(range => ({ range: range, options: LinkedEditingContribution.DECORATION }));\n\t\t\t\tthis._visibleContextKey.set(true);\n\t\t\t\tthis._currentDecorations = this._editor.deltaDecorations(this._currentDecorations, decorations);\n\t\t\t} catch (err) {\n\t\t\t\tif (!isCancellationError(err)) {\n\t\t\t\t\tonUnexpectedError(err);\n\t\t\t\t}\n\t\t\t\tif (this._currentRequest === request || !this._currentRequest) {\n\t\t\t\t\t// stop if we are still the latest request\n\t\t\t\t\tthis.clearRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis._currentRequest = request;\n\t\treturn request;\n\t}\n\n\t// private printDecorators(model: ITextModel) {\n\t// \treturn this._currentDecorations.map(d => {\n\t// \t\tconst range = model.getDecorationRange(d);\n\t// \t\tif (range) {\n\t// \t\t\treturn this.printRange(range);\n\t// \t\t}\n\t// \t\treturn 'invalid';\n\t// \t}).join(',');\n\t// }\n\n\t// private printChanges(changes: IModelContentChange[]) {\n\t// \treturn changes.map(c => {\n\t// \t\treturn `${this.printRange(c.range)} - ${c.text}`;\n\t// \t}\n\t// \t).join(',');\n\t// }\n\n\t// private printRange(range: IRange) {\n\t// \treturn `${range.startLineNumber},${range.startColumn}/${range.endLineNumber},${range.endColumn}`;\n\t// }\n}\n\nexport class LinkedEditingAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.linkedEditing',\n\t\t\tlabel: nls.localize('linkedEditing.label', \"Start Linked Editing\"),\n\t\t\talias: 'Start Linked Editing',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F2,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\toverride runCommand(accessor: ServicesAccessor, args: [URI, IPosition]): void | Promise<void> {\n\t\tconst editorService = accessor.get(ICodeEditorService);\n\t\tconst [uri, pos] = Array.isArray(args) && args || [undefined, undefined];\n\n\t\tif (URI.isUri(uri) && Position.isIPosition(pos)) {\n\t\t\treturn editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then(editor => {\n\t\t\t\tif (!editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\teditor.setPosition(pos);\n\t\t\t\teditor.invokeWithinContext(accessor => {\n\t\t\t\t\tthis.reportTelemetry(accessor, editor);\n\t\t\t\t\treturn this.run(accessor, editor);\n\t\t\t\t});\n\t\t\t}, onUnexpectedError);\n\t\t}\n\n\t\treturn super.runCommand(accessor, args);\n\t}\n\n\trun(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = LinkedEditingContribution.get(editor);\n\t\tif (controller) {\n\t\t\treturn Promise.resolve(controller.updateRanges(true));\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n}\n\nconst LinkedEditingCommand = EditorCommand.bindToContribution<LinkedEditingContribution>(LinkedEditingContribution.get);\nregisterEditorCommand(new LinkedEditingCommand({\n\tid: 'cancelLinkedEditingInput',\n\tprecondition: CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE,\n\thandler: x => x.clearRanges(),\n\tkbOpts: {\n\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\tweight: KeybindingWeight.EditorContrib + 99,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\n\n\nfunction getLinkedEditingRanges(providers: LanguageFeatureRegistry<LinkedEditingRangeProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<LinkedEditingRanges | undefined | null> {\n\tconst orderedByScore = providers.ordered(model);\n\n\t// in order of score ask the linked editing range provider\n\t// until someone response with a good result\n\t// (good = not null)\n\treturn first<LinkedEditingRanges | undefined | null>(orderedByScore.map(provider => async () => {\n\t\ttry {\n\t\t\treturn await provider.provideLinkedEditingRanges(model, position, token);\n\t\t} catch (e) {\n\t\t\tonUnexpectedExternalError(e);\n\t\t\treturn undefined;\n\t\t}\n\t}), result => !!result && arrays.isNonEmptyArray(result?.ranges));\n}\n\nexport const editorLinkedEditingBackground = registerColor('editor.linkedEditingBackground', { dark: Color.fromHex('#f00').transparent(0.3), light: Color.fromHex('#f00').transparent(0.3), hc: Color.fromHex('#f00').transparent(0.3) }, nls.localize('editorLinkedEditingBackground', 'Background color when the editor auto renames on type.'));\nregisterThemingParticipant((theme, collector) => {\n\tconst editorLinkedEditingBackgroundColor = theme.getColor(editorLinkedEditingBackground);\n\tif (editorLinkedEditingBackgroundColor) {\n\t\tcollector.addRule(`.monaco-editor .${DECORATION_CLASS_NAME} { background: ${editorLinkedEditingBackgroundColor}; border-left-color: ${editorLinkedEditingBackgroundColor}; }`);\n\t}\n});\n\nregisterModelAndPositionCommand('_executeLinkedEditingProvider', (_accessor, model, position) => {\n\tconst { linkedEditingRangeProvider } = _accessor.get(ILanguageFeaturesService);\n\treturn getLinkedEditingRanges(linkedEditingRangeProvider, model, position, CancellationToken.None);\n});\n\nregisterEditorContribution(LinkedEditingContribution.ID, LinkedEditingContribution);\nregisterEditorAction(LinkedEditingAction);\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 { createCancelablePromise, CancelablePromise, RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { Schemas } from 'vs/base/common/network';\nimport * as platform from 'vs/base/common/platform';\nimport * as resources from 'vs/base/common/resources';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { URI } from 'vs/base/common/uri';\nimport 'vs/css!./links';\nimport { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { LinkProvider } from 'vs/editor/common/languages';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture';\nimport { getLinks, Link, LinksList } from 'vs/editor/contrib/links/browser/getLinks';\nimport * as nls from 'vs/nls';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class LinkDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.linkDetector';\n\n\tpublic static get(editor: ICodeEditor): LinkDetector | null {\n\t\treturn editor.getContribution<LinkDetector>(LinkDetector.ID);\n\t}\n\n\tprivate readonly providers: LanguageFeatureRegistry<LinkProvider>;\n\tprivate readonly debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly computeLinks: RunOnceScheduler;\n\tprivate computePromise: CancelablePromise<LinksList> | null;\n\tprivate activeLinksList: LinksList | null;\n\tprivate activeLinkDecorationId: string | null;\n\tprivate currentOccurrences: { [decorationId: string]: LinkOccurrence };\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IOpenerService private readonly openerService: IOpenerService,\n\t\t@INotificationService private readonly notificationService: INotificationService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\n\t\tthis.providers = this.languageFeaturesService.linkProvider;\n\t\tthis.debounceInformation = languageFeatureDebounceService.for(this.providers, 'Links', { min: 1000, max: 4000 });\n\t\tthis.computeLinks = this._register(new RunOnceScheduler(() => this.computeLinksNow(), 1000));\n\t\tthis.computePromise = null;\n\t\tthis.activeLinksList = null;\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\n\t\tconst clickLinkGesture = this._register(new ClickLinkGesture(editor));\n\n\t\tthis._register(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis._onEditorMouseMove(mouseEvent, keyboardEvent);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onExecute((e) => {\n\t\t\tthis.onEditorMouseUp(e);\n\t\t}));\n\t\tthis._register(clickLinkGesture.onCancel((e) => {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}));\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tif (!e.hasChanged(EditorOption.links)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Remove any links (for the getting disabled case)\n\t\t\tthis.updateDecorations([]);\n\n\t\t\t// Stop any computation (for the getting disabled case)\n\t\t\tthis.stop();\n\n\t\t\t// Start computing (for the getting enabled case)\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tif (!this.editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));\n\t\t}));\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis.currentOccurrences = {};\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelLanguage((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\t\tthis._register(this.providers.onDidChange((e) => {\n\t\t\tthis.stop();\n\t\t\tthis.computeLinks.schedule(0);\n\t\t}));\n\n\t\tthis.computeLinks.schedule(0);\n\t}\n\n\tprivate async computeLinksNow(): Promise<void> {\n\t\tif (!this.editor.hasModel() || !this.editor.getOption(EditorOption.links)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\n\t\tif (!this.providers.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\n\t\tthis.computePromise = createCancelablePromise(token => getLinks(this.providers, model, token));\n\t\ttry {\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tthis.activeLinksList = await this.computePromise;\n\t\t\tthis.debounceInformation.update(model, sw.elapsed());\n\t\t\tif (model.isDisposed()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updateDecorations(this.activeLinksList.links);\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t} finally {\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tprivate updateDecorations(links: Link[]): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tconst oldDecorations: string[] = [];\n\t\tconst keys = Object.keys(this.currentOccurrences);\n\t\tfor (const decorationId of keys) {\n\t\t\tconst occurence = this.currentOccurrences[decorationId];\n\t\t\toldDecorations.push(occurence.decorationId);\n\t\t}\n\n\t\tconst newDecorations: IModelDeltaDecoration[] = [];\n\t\tif (links) {\n\t\t\t// Not sure why this is sometimes null\n\t\t\tfor (const link of links) {\n\t\t\t\tnewDecorations.push(LinkOccurrence.decoration(link, useMetaKey));\n\t\t\t}\n\t\t}\n\n\t\tconst decorations = this.editor.deltaDecorations(oldDecorations, newDecorations);\n\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\t\tfor (let i = 0, len = decorations.length; i < len; i++) {\n\t\t\tconst occurence = new LinkOccurrence(links[i], decorations[i]);\n\t\t\tthis.currentOccurrences[occurence.decorationId] = occurence;\n\t\t}\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey: ClickLinkKeyboardEvent | null): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one\n\t\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.activate(changeAccessor, useMetaKey);\n\t\t\t\t\tthis.activeLinkDecorationId = occurrence.decorationId;\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}\n\t}\n\n\tprivate cleanUpActiveLinkDecoration(): void {\n\t\tconst useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');\n\t\tif (this.activeLinkDecorationId) {\n\t\t\tconst occurrence = this.currentOccurrences[this.activeLinkDecorationId];\n\t\t\tif (occurrence) {\n\t\t\t\tthis.editor.changeDecorations((changeAccessor) => {\n\t\t\t\t\toccurrence.deactivate(changeAccessor, useMetaKey);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.activeLinkDecorationId = null;\n\t\t}\n\t}\n\n\tprivate onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void {\n\t\tif (!this.isEnabled(mouseEvent)) {\n\t\t\treturn;\n\t\t}\n\t\tconst occurrence = this.getLinkOccurrence(mouseEvent.target.position);\n\t\tif (!occurrence) {\n\t\t\treturn;\n\t\t}\n\t\tthis.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier, true /* from user gesture */);\n\t}\n\n\tpublic openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean, fromUserGesture = false): void {\n\n\t\tif (!this.openerService) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { link } = occurrence;\n\n\t\tlink.resolve(CancellationToken.None).then(uri => {\n\n\t\t\t// Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt\n\t\t\tif (typeof uri === 'string' && this.editor.hasModel()) {\n\t\t\t\tconst modelUri = this.editor.getModel().uri;\n\t\t\t\tif (modelUri.scheme === Schemas.file && uri.startsWith(`${Schemas.file}:`)) {\n\t\t\t\t\tconst parsedUri = URI.parse(uri);\n\t\t\t\t\tif (parsedUri.scheme === Schemas.file) {\n\t\t\t\t\t\tconst fsPath = resources.originalFSPath(parsedUri);\n\n\t\t\t\t\t\tlet relativePath: string | null = null;\n\t\t\t\t\t\tif (fsPath.startsWith('/./')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(1)}`;\n\t\t\t\t\t\t} else if (fsPath.startsWith('//./')) {\n\t\t\t\t\t\t\trelativePath = `.${fsPath.substr(2)}`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (relativePath) {\n\t\t\t\t\t\t\turi = resources.joinPath(modelUri, relativePath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.openerService.open(uri, { openToSide, fromUserGesture, allowContributedOpeners: true, allowCommands: true });\n\n\t\t}, err => {\n\t\t\tconst messageOrError =\n\t\t\t\terr instanceof Error ? (<Error>err).message : err;\n\t\t\t// different error cases\n\t\t\tif (messageOrError === 'invalid') {\n\t\t\t\tthis.notificationService.warn(nls.localize('invalid.url', 'Failed to open this link because it is not well-formed: {0}', link.url!.toString()));\n\t\t\t} else if (messageOrError === 'missing') {\n\t\t\t\tthis.notificationService.warn(nls.localize('missing.url', 'Failed to open this link because its target is missing.'));\n\t\t\t} else {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getLinkOccurrence(position: Position | null): LinkOccurrence | null {\n\t\tif (!this.editor.hasModel() || !position) {\n\t\t\treturn null;\n\t\t}\n\t\tconst decorations = this.editor.getModel().getDecorationsInRange({\n\t\t\tstartLineNumber: position.lineNumber,\n\t\t\tstartColumn: position.column,\n\t\t\tendLineNumber: position.lineNumber,\n\t\t\tendColumn: position.column\n\t\t}, 0, true);\n\n\t\tfor (const decoration of decorations) {\n\t\t\tconst currentOccurrence = this.currentOccurrences[decoration.id];\n\t\t\tif (currentOccurrence) {\n\t\t\t\treturn currentOccurrence;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent | null): boolean {\n\t\treturn Boolean(\n\t\t\t(mouseEvent.target.type === MouseTargetType.CONTENT_TEXT)\n\t\t\t&& (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey))\n\t\t);\n\t}\n\n\tprivate stop(): void {\n\t\tthis.computeLinks.cancel();\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList?.dispose();\n\t\t\tthis.activeLinksList = null;\n\t\t}\n\t\tif (this.computePromise) {\n\t\t\tthis.computePromise.cancel();\n\t\t\tthis.computePromise = null;\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.stop();\n\t}\n}\n\nconst decoration = {\n\tgeneral: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link'\n\t}),\n\tactive: ModelDecorationOptions.register({\n\t\tdescription: 'detected-link-active',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active'\n\t})\n};\n\nclass LinkOccurrence {\n\n\tpublic static decoration(link: Link, useMetaKey: boolean): IModelDeltaDecoration {\n\t\treturn {\n\t\t\trange: link.range,\n\t\t\toptions: LinkOccurrence._getOptions(link, useMetaKey, false)\n\t\t};\n\t}\n\n\tprivate static _getOptions(link: Link, useMetaKey: boolean, isActive: boolean): ModelDecorationOptions {\n\t\tconst options = { ... (isActive ? decoration.active : decoration.general) };\n\t\toptions.hoverMessage = getHoverMessage(link, useMetaKey);\n\t\treturn options;\n\t}\n\n\tpublic decorationId: string;\n\tpublic link: Link;\n\n\tconstructor(link: Link, decorationId: string) {\n\t\tthis.link = link;\n\t\tthis.decorationId = decorationId;\n\t}\n\n\tpublic activate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, true));\n\t}\n\n\tpublic deactivate(changeAccessor: IModelDecorationsChangeAccessor, useMetaKey: boolean): void {\n\t\tchangeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, false));\n\t}\n}\n\nfunction getHoverMessage(link: Link, useMetaKey: boolean): MarkdownString {\n\tconst executeCmd = link.url && /^command:/i.test(link.url.toString());\n\n\tconst label = link.tooltip\n\t\t? link.tooltip\n\t\t: executeCmd\n\t\t\t? nls.localize('links.navigate.executeCmd', 'Execute command')\n\t\t\t: nls.localize('links.navigate.follow', 'Follow link');\n\n\tconst kb = useMetaKey\n\t\t? platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.meta.mac', \"cmd + click\")\n\t\t\t: nls.localize('links.navigate.kb.meta', \"ctrl + click\")\n\t\t: platform.isMacintosh\n\t\t\t? nls.localize('links.navigate.kb.alt.mac', \"option + click\")\n\t\t\t: nls.localize('links.navigate.kb.alt', \"alt + click\");\n\n\tif (link.url) {\n\t\tlet nativeLabel = '';\n\t\tif (/^command:/i.test(link.url.toString())) {\n\t\t\t// Don't show complete command arguments in the native tooltip\n\t\t\tconst match = link.url.toString().match(/^command:([^?#]+)/);\n\t\t\tif (match) {\n\t\t\t\tconst commandId = match[1];\n\t\t\t\tconst nativeLabelText = nls.localize('tooltip.explanation', \"Execute command {0}\", commandId);\n\t\t\t\tnativeLabel = ` \"${nativeLabelText}\"`;\n\t\t\t}\n\t\t}\n\t\tconst hoverMessage = new MarkdownString('', true).appendMarkdown(`[${label}](${link.url.toString(true).replace(/ /g, '%20')}${nativeLabel}) (${kb})`);\n\t\treturn hoverMessage;\n\t} else {\n\t\treturn new MarkdownString().appendText(`${label} (${kb})`);\n\t}\n}\n\nclass OpenLinkAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.openLink',\n\t\t\tlabel: nls.localize('label', \"Open Link\"),\n\t\t\talias: 'Open Link',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst linkDetector = LinkDetector.get(editor);\n\t\tif (!linkDetector) {\n\t\t\treturn;\n\t\t}\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections();\n\t\tfor (const sel of selections) {\n\t\t\tconst link = linkDetector.getLinkOccurrence(sel.getEndPosition());\n\t\t\tif (link) {\n\t\t\t\tlinkDetector.openLinkOccurrence(link, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterEditorContribution(LinkDetector.ID, LinkDetector);\nregisterEditorAction(OpenLinkAction);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst activeLinkForeground = theme.getColor(editorActiveLinkForeground);\n\tif (activeLinkForeground) {\n\t\tcollector.addRule(`.monaco-editor .detected-link-active { color: ${activeLinkForeground} !important; }`);\n\t}\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 { status } from 'vs/base/browser/ui/aria/aria';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { Constants } from 'vs/base/common/uint';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorState } from 'vs/editor/common/cursorCommon';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { FindMatch, ITextModel, OverviewRulerLane, TrackedRangeStickiness, MinimapPosition } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { CommonFindController } from 'vs/editor/contrib/find/browser/findController';\nimport { FindOptionOverride, INewFindReplaceState } from 'vs/editor/contrib/find/browser/findState';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { overviewRulerSelectionHighlightForeground, minimapSelectionOccurrenceHighlight } from 'vs/platform/theme/common/colorRegistry';\nimport { themeColorFromId } from 'vs/platform/theme/common/themeService';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nfunction announceCursorChange(previousCursorState: CursorState[], cursorState: CursorState[]): void {\n\tconst cursorDiff = cursorState.filter(cs => !previousCursorState.find(pcs => pcs.equals(cs)));\n\tif (cursorDiff.length >= 1) {\n\t\tconst cursorPositions = cursorDiff.map(cs => `line ${cs.viewState.position.lineNumber} column ${cs.viewState.position.column}`).join(', ');\n\t\tconst msg = cursorDiff.length === 1 ? nls.localize('cursorAdded', \"Cursor added: {0}\", cursorPositions) : nls.localize('cursorsAdded', \"Cursors added: {0}\", cursorPositions);\n\t\tstatus(msg);\n\t}\n}\n\nexport class InsertCursorAbove extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.insertCursorAbove',\n\t\t\tlabel: nls.localize('mutlicursor.insertAbove', \"Add Cursor Above\"),\n\t\t\talias: 'Add Cursor Above',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,\n\t\t\t\tlinux: {\n\t\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,\n\t\t\t\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow]\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miInsertCursorAbove', comment: ['&& denotes a mnemonic'] }, \"&&Add Cursor Above\"),\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet useLogicalLine = true;\n\t\tif (args && args.logicalLine === false) {\n\t\t\tuseLogicalLine = false;\n\t\t}\n\t\tconst viewModel = editor._getViewModel();\n\n\t\tif (viewModel.cursorConfig.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tviewModel.model.pushStackElement();\n\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\tviewModel.setCursorStates(\n\t\t\targs.source,\n\t\t\tCursorChangeReason.Explicit,\n\t\t\tCursorMoveCommands.addCursorUp(viewModel, previousCursorState, useLogicalLine)\n\t\t);\n\t\tviewModel.revealTopMostCursor(args.source);\n\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t}\n}\n\nexport class InsertCursorBelow extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.insertCursorBelow',\n\t\t\tlabel: nls.localize('mutlicursor.insertBelow', \"Add Cursor Below\"),\n\t\t\talias: 'Add Cursor Below',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,\n\t\t\t\tlinux: {\n\t\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,\n\t\t\t\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow]\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miInsertCursorBelow', comment: ['&& denotes a mnemonic'] }, \"A&&dd Cursor Below\"),\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet useLogicalLine = true;\n\t\tif (args && args.logicalLine === false) {\n\t\t\tuseLogicalLine = false;\n\t\t}\n\t\tconst viewModel = editor._getViewModel();\n\n\t\tif (viewModel.cursorConfig.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tviewModel.model.pushStackElement();\n\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\tviewModel.setCursorStates(\n\t\t\targs.source,\n\t\t\tCursorChangeReason.Explicit,\n\t\t\tCursorMoveCommands.addCursorDown(viewModel, previousCursorState, useLogicalLine)\n\t\t);\n\t\tviewModel.revealBottomMostCursor(args.source);\n\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t}\n}\n\nclass InsertCursorAtEndOfEachLineSelected extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.insertCursorAtEndOfEachLineSelected',\n\t\t\tlabel: nls.localize('mutlicursor.insertAtEndOfEachLineSelected', \"Add Cursors to Line Ends\"),\n\t\t\talias: 'Add Cursors to Line Ends',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyI,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miInsertCursorAtEndOfEachLineSelected', comment: ['&& denotes a mnemonic'] }, \"Add C&&ursors to Line Ends\"),\n\t\t\t\torder: 4\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate getCursorsForSelection(selection: Selection, model: ITextModel, result: Selection[]): void {\n\t\tif (selection.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = selection.startLineNumber; i < selection.endLineNumber; i++) {\n\t\t\tlet currentLineMaxColumn = model.getLineMaxColumn(i);\n\t\t\tresult.push(new Selection(i, currentLineMaxColumn, i, currentLineMaxColumn));\n\t\t}\n\t\tif (selection.endColumn > 1) {\n\t\t\tresult.push(new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn));\n\t\t}\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = editor.getModel();\n\t\tconst selections = editor.getSelections();\n\t\tconst viewModel = editor._getViewModel();\n\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\tlet newSelections: Selection[] = [];\n\t\tselections.forEach((sel) => this.getCursorsForSelection(sel, model, newSelections));\n\n\t\tif (newSelections.length > 0) {\n\t\t\teditor.setSelections(newSelections);\n\t\t}\n\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t}\n}\n\nclass InsertCursorAtEndOfLineSelected extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.addCursorsToBottom',\n\t\t\tlabel: nls.localize('mutlicursor.addCursorsToBottom', \"Add Cursors To Bottom\"),\n\t\t\talias: 'Add Cursors To Bottom',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections();\n\t\tconst lineCount = editor.getModel().getLineCount();\n\n\t\tlet newSelections: Selection[] = [];\n\t\tfor (let i = selections[0].startLineNumber; i <= lineCount; i++) {\n\t\t\tnewSelections.push(new Selection(i, selections[0].startColumn, i, selections[0].endColumn));\n\t\t}\n\n\t\tconst viewModel = editor._getViewModel();\n\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\tif (newSelections.length > 0) {\n\t\t\teditor.setSelections(newSelections);\n\t\t}\n\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t}\n}\n\nclass InsertCursorAtTopOfLineSelected extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.addCursorsToTop',\n\t\t\tlabel: nls.localize('mutlicursor.addCursorsToTop', \"Add Cursors To Top\"),\n\t\t\talias: 'Add Cursors To Top',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selections = editor.getSelections();\n\n\t\tlet newSelections: Selection[] = [];\n\t\tfor (let i = selections[0].startLineNumber; i >= 1; i--) {\n\t\t\tnewSelections.push(new Selection(i, selections[0].startColumn, i, selections[0].endColumn));\n\t\t}\n\n\t\tconst viewModel = editor._getViewModel();\n\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\tif (newSelections.length > 0) {\n\t\t\teditor.setSelections(newSelections);\n\t\t}\n\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t}\n}\n\nexport class MultiCursorSessionResult {\n\tconstructor(\n\t\tpublic readonly selections: Selection[],\n\t\tpublic readonly revealRange: Range,\n\t\tpublic readonly revealScrollType: ScrollType\n\t) { }\n}\n\nexport class MultiCursorSession {\n\n\tpublic static create(editor: ICodeEditor, findController: CommonFindController): MultiCursorSession | null {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\t\tconst findState = findController.getState();\n\n\t\t// Find widget owns entirely what we search for if:\n\t\t// - focus is not in the editor (i.e. it is in the find widget)\n\t\t// - and the search widget is visible\n\t\t// - and the search string is non-empty\n\t\tif (!editor.hasTextFocus() && findState.isRevealed && findState.searchString.length > 0) {\n\t\t\t// Find widget owns what is searched for\n\t\t\treturn new MultiCursorSession(editor, findController, false, findState.searchString, findState.wholeWord, findState.matchCase, null);\n\t\t}\n\n\t\t// Otherwise, the selection gives the search text, and the find widget gives the search settings\n\t\t// The exception is the find state disassociation case: when beginning with a single, collapsed selection\n\t\tlet isDisconnectedFromFindController = false;\n\t\tlet wholeWord: boolean;\n\t\tlet matchCase: boolean;\n\t\tconst selections = editor.getSelections();\n\t\tif (selections.length === 1 && selections[0].isEmpty()) {\n\t\t\tisDisconnectedFromFindController = true;\n\t\t\twholeWord = true;\n\t\t\tmatchCase = true;\n\t\t} else {\n\t\t\twholeWord = findState.wholeWord;\n\t\t\tmatchCase = findState.matchCase;\n\t\t}\n\n\t\t// Selection owns what is searched for\n\t\tconst s = editor.getSelection();\n\n\t\tlet searchText: string;\n\t\tlet currentMatch: Selection | null = null;\n\n\t\tif (s.isEmpty()) {\n\t\t\t// selection is empty => expand to current word\n\t\t\tconst word = editor.getConfiguredWordAtPosition(s.getStartPosition());\n\t\t\tif (!word) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tsearchText = word.word;\n\t\t\tcurrentMatch = new Selection(s.startLineNumber, word.startColumn, s.startLineNumber, word.endColumn);\n\t\t} else {\n\t\t\tsearchText = editor.getModel().getValueInRange(s).replace(/\\r\\n/g, '\\n');\n\t\t}\n\n\t\treturn new MultiCursorSession(editor, findController, isDisconnectedFromFindController, searchText, wholeWord, matchCase, currentMatch);\n\t}\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tpublic readonly findController: CommonFindController,\n\t\tpublic readonly isDisconnectedFromFindController: boolean,\n\t\tpublic readonly searchText: string,\n\t\tpublic readonly wholeWord: boolean,\n\t\tpublic readonly matchCase: boolean,\n\t\tpublic currentMatch: Selection | null\n\t) { }\n\n\tpublic addSelectionToNextFindMatch(): MultiCursorSessionResult | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch();\n\t\tif (!nextMatch) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\treturn new MultiCursorSessionResult(allSelections.concat(nextMatch), nextMatch, ScrollType.Smooth);\n\t}\n\n\tpublic moveSelectionToNextFindMatch(): MultiCursorSessionResult | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch();\n\t\tif (!nextMatch) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\treturn new MultiCursorSessionResult(allSelections.slice(0, allSelections.length - 1).concat(nextMatch), nextMatch, ScrollType.Smooth);\n\t}\n\n\tprivate _getNextMatch(): Selection | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.currentMatch) {\n\t\t\tconst result = this.currentMatch;\n\t\t\tthis.currentMatch = null;\n\t\t\treturn result;\n\t\t}\n\n\t\tthis.findController.highlightFindOptions();\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\tconst lastAddedSelection = allSelections[allSelections.length - 1];\n\t\tconst nextMatch = this._editor.getModel().findNextMatch(this.searchText, lastAddedSelection.getEndPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (!nextMatch) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Selection(nextMatch.range.startLineNumber, nextMatch.range.startColumn, nextMatch.range.endLineNumber, nextMatch.range.endColumn);\n\t}\n\n\tpublic addSelectionToPreviousFindMatch(): MultiCursorSessionResult | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst previousMatch = this._getPreviousMatch();\n\t\tif (!previousMatch) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\treturn new MultiCursorSessionResult(allSelections.concat(previousMatch), previousMatch, ScrollType.Smooth);\n\t}\n\n\tpublic moveSelectionToPreviousFindMatch(): MultiCursorSessionResult | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst previousMatch = this._getPreviousMatch();\n\t\tif (!previousMatch) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\treturn new MultiCursorSessionResult(allSelections.slice(0, allSelections.length - 1).concat(previousMatch), previousMatch, ScrollType.Smooth);\n\t}\n\n\tprivate _getPreviousMatch(): Selection | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.currentMatch) {\n\t\t\tconst result = this.currentMatch;\n\t\t\tthis.currentMatch = null;\n\t\t\treturn result;\n\t\t}\n\n\t\tthis.findController.highlightFindOptions();\n\n\t\tconst allSelections = this._editor.getSelections();\n\t\tconst lastAddedSelection = allSelections[allSelections.length - 1];\n\t\tconst previousMatch = this._editor.getModel().findPreviousMatch(this.searchText, lastAddedSelection.getStartPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (!previousMatch) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Selection(previousMatch.range.startLineNumber, previousMatch.range.startColumn, previousMatch.range.endLineNumber, previousMatch.range.endColumn);\n\t}\n\n\tpublic selectAll(): FindMatch[] {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthis.findController.highlightFindOptions();\n\n\t\treturn this._editor.getModel().findMatches(this.searchText, true, false, this.matchCase, this.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t}\n}\n\nexport class MultiCursorSelectionController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.multiCursorController';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _ignoreSelectionChange: boolean;\n\tprivate _session: MultiCursorSession | null;\n\tprivate readonly _sessionDispose = this._register(new DisposableStore());\n\n\tpublic static get(editor: ICodeEditor): MultiCursorSelectionController | null {\n\t\treturn editor.getContribution<MultiCursorSelectionController>(MultiCursorSelectionController.ID);\n\t}\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._ignoreSelectionChange = false;\n\t\tthis._session = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._endSession();\n\t\tsuper.dispose();\n\t}\n\n\tprivate _beginSessionIfNeeded(findController: CommonFindController): void {\n\t\tif (!this._session) {\n\t\t\t// Create a new session\n\t\t\tconst session = MultiCursorSession.create(this._editor, findController);\n\t\t\tif (!session) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._session = session;\n\n\t\t\tconst newState: INewFindReplaceState = { searchString: this._session.searchText };\n\t\t\tif (this._session.isDisconnectedFromFindController) {\n\t\t\t\tnewState.wholeWordOverride = FindOptionOverride.True;\n\t\t\t\tnewState.matchCaseOverride = FindOptionOverride.True;\n\t\t\t\tnewState.isRegexOverride = FindOptionOverride.False;\n\t\t\t}\n\t\t\tfindController.getState().change(newState, false);\n\n\t\t\tthis._sessionDispose.add(this._editor.onDidChangeCursorSelection((e) => {\n\t\t\t\tif (this._ignoreSelectionChange) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._endSession();\n\t\t\t}));\n\t\t\tthis._sessionDispose.add(this._editor.onDidBlurEditorText(() => {\n\t\t\t\tthis._endSession();\n\t\t\t}));\n\t\t\tthis._sessionDispose.add(findController.getState().onFindReplaceStateChange((e) => {\n\t\t\t\tif (e.matchCase || e.wholeWord) {\n\t\t\t\t\tthis._endSession();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _endSession(): void {\n\t\tthis._sessionDispose.clear();\n\t\tif (this._session && this._session.isDisconnectedFromFindController) {\n\t\t\tconst newState: INewFindReplaceState = {\n\t\t\t\twholeWordOverride: FindOptionOverride.NotSet,\n\t\t\t\tmatchCaseOverride: FindOptionOverride.NotSet,\n\t\t\t\tisRegexOverride: FindOptionOverride.NotSet,\n\t\t\t};\n\t\t\tthis._session.findController.getState().change(newState, false);\n\t\t}\n\t\tthis._session = null;\n\t}\n\n\tprivate _setSelections(selections: Selection[]): void {\n\t\tthis._ignoreSelectionChange = true;\n\t\tthis._editor.setSelections(selections);\n\t\tthis._ignoreSelectionChange = false;\n\t}\n\n\tprivate _expandEmptyToWord(model: ITextModel, selection: Selection): Selection {\n\t\tif (!selection.isEmpty()) {\n\t\t\treturn selection;\n\t\t}\n\t\tconst word = this._editor.getConfiguredWordAtPosition(selection.getStartPosition());\n\t\tif (!word) {\n\t\t\treturn selection;\n\t\t}\n\t\treturn new Selection(selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn);\n\t}\n\n\tprivate _applySessionResult(result: MultiCursorSessionResult | null): void {\n\t\tif (!result) {\n\t\t\treturn;\n\t\t}\n\t\tthis._setSelections(result.selections);\n\t\tif (result.revealRange) {\n\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(result.revealRange, result.revealScrollType);\n\t\t}\n\t}\n\n\tpublic getSession(findController: CommonFindController): MultiCursorSession | null {\n\t\treturn this._session;\n\t}\n\n\tpublic addSelectionToNextFindMatch(findController: CommonFindController): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._session) {\n\t\t\t// If there are multiple cursors, handle the case where they do not all select the same text.\n\t\t\tconst allSelections = this._editor.getSelections();\n\t\t\tif (allSelections.length > 1) {\n\t\t\t\tconst findState = findController.getState();\n\t\t\t\tconst matchCase = findState.matchCase;\n\t\t\t\tconst selectionsContainSameText = modelRangesContainSameText(this._editor.getModel(), allSelections, matchCase);\n\t\t\t\tif (!selectionsContainSameText) {\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tlet resultingSelections: Selection[] = [];\n\t\t\t\t\tfor (let i = 0, len = allSelections.length; i < len; i++) {\n\t\t\t\t\t\tresultingSelections[i] = this._expandEmptyToWord(model, allSelections[i]);\n\t\t\t\t\t}\n\t\t\t\t\tthis._editor.setSelections(resultingSelections);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._beginSessionIfNeeded(findController);\n\t\tif (this._session) {\n\t\t\tthis._applySessionResult(this._session.addSelectionToNextFindMatch());\n\t\t}\n\t}\n\n\tpublic addSelectionToPreviousFindMatch(findController: CommonFindController): void {\n\t\tthis._beginSessionIfNeeded(findController);\n\t\tif (this._session) {\n\t\t\tthis._applySessionResult(this._session.addSelectionToPreviousFindMatch());\n\t\t}\n\t}\n\n\tpublic moveSelectionToNextFindMatch(findController: CommonFindController): void {\n\t\tthis._beginSessionIfNeeded(findController);\n\t\tif (this._session) {\n\t\t\tthis._applySessionResult(this._session.moveSelectionToNextFindMatch());\n\t\t}\n\t}\n\n\tpublic moveSelectionToPreviousFindMatch(findController: CommonFindController): void {\n\t\tthis._beginSessionIfNeeded(findController);\n\t\tif (this._session) {\n\t\t\tthis._applySessionResult(this._session.moveSelectionToPreviousFindMatch());\n\t\t}\n\t}\n\n\tpublic selectAll(findController: CommonFindController): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet matches: FindMatch[] | null = null;\n\n\t\tconst findState = findController.getState();\n\n\t\t// Special case: find widget owns entirely what we search for if:\n\t\t// - focus is not in the editor (i.e. it is in the find widget)\n\t\t// - and the search widget is visible\n\t\t// - and the search string is non-empty\n\t\t// - and we're searching for a regex\n\t\tif (findState.isRevealed && findState.searchString.length > 0 && findState.isRegex) {\n\n\t\t\tmatches = this._editor.getModel().findMatches(findState.searchString, true, findState.isRegex, findState.matchCase, findState.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\t} else {\n\n\t\t\tthis._beginSessionIfNeeded(findController);\n\t\t\tif (!this._session) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmatches = this._session.selectAll();\n\t\t}\n\n\t\tif (findState.searchScope) {\n\t\t\tconst states = findState.searchScope;\n\t\t\tlet inSelection: FindMatch[] | null = [];\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tstates.forEach((state) => {\n\t\t\t\t\tif (match.range.endLineNumber <= state.endLineNumber && match.range.startLineNumber >= state.startLineNumber) {\n\t\t\t\t\t\tinSelection!.push(match);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tmatches = inSelection;\n\t\t}\n\n\t\tif (matches.length > 0) {\n\t\t\tconst editorSelection = this._editor.getSelection();\n\t\t\t// Have the primary cursor remain the one where the action was invoked\n\t\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\t\tconst match = matches[i];\n\t\t\t\tconst intersection = match.range.intersectRanges(editorSelection);\n\t\t\t\tif (intersection) {\n\t\t\t\t\t// bingo!\n\t\t\t\t\tmatches[i] = matches[0];\n\t\t\t\t\tmatches[0] = match;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._setSelections(matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn)));\n\t\t}\n\t}\n}\n\nexport abstract class MultiCursorSelectionControllerAction extends EditorAction {\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst multiCursorController = MultiCursorSelectionController.get(editor);\n\t\tif (!multiCursorController) {\n\t\t\treturn;\n\t\t}\n\t\tconst findController = CommonFindController.get(editor);\n\t\tif (!findController) {\n\t\t\treturn;\n\t\t}\n\t\tconst viewModel = editor._getViewModel();\n\t\tif (viewModel) {\n\t\t\tconst previousCursorState = viewModel.getCursorStates();\n\t\t\tthis._run(multiCursorController, findController);\n\t\t\tannounceCursorChange(previousCursorState, viewModel.getCursorStates());\n\t\t}\n\t}\n\n\tprotected abstract _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void;\n}\n\nexport class AddSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.addSelectionToNextFindMatch',\n\t\t\tlabel: nls.localize('addSelectionToNextFindMatch', \"Add Selection To Next Find Match\"),\n\t\t\talias: 'Add Selection To Next Find Match',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyD,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miAddSelectionToNextFindMatch', comment: ['&& denotes a mnemonic'] }, \"Add &&Next Occurrence\"),\n\t\t\t\torder: 5\n\t\t\t}\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.addSelectionToNextFindMatch(findController);\n\t}\n}\n\nexport class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.addSelectionToPreviousFindMatch',\n\t\t\tlabel: nls.localize('addSelectionToPreviousFindMatch', \"Add Selection To Previous Find Match\"),\n\t\t\talias: 'Add Selection To Previous Find Match',\n\t\t\tprecondition: undefined,\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miAddSelectionToPreviousFindMatch', comment: ['&& denotes a mnemonic'] }, \"Add P&&revious Occurrence\"),\n\t\t\t\torder: 6\n\t\t\t}\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.addSelectionToPreviousFindMatch(findController);\n\t}\n}\n\nexport class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.moveSelectionToNextFindMatch',\n\t\t\tlabel: nls.localize('moveSelectionToNextFindMatch', \"Move Last Selection To Next Find Match\"),\n\t\t\talias: 'Move Last Selection To Next Find Match',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyD),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.moveSelectionToNextFindMatch(findController);\n\t}\n}\n\nexport class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.moveSelectionToPreviousFindMatch',\n\t\t\tlabel: nls.localize('moveSelectionToPreviousFindMatch', \"Move Last Selection To Previous Find Match\"),\n\t\t\talias: 'Move Last Selection To Previous Find Match',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.moveSelectionToPreviousFindMatch(findController);\n\t}\n}\n\nexport class SelectHighlightsAction extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.selectHighlights',\n\t\t\tlabel: nls.localize('selectAllOccurrencesOfFindMatch', \"Select All Occurrences of Find Match\"),\n\t\t\talias: 'Select All Occurrences of Find Match',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyL,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\t\t\tgroup: '3_multi',\n\t\t\t\ttitle: nls.localize({ key: 'miSelectHighlights', comment: ['&& denotes a mnemonic'] }, \"Select All &&Occurrences\"),\n\t\t\t\torder: 7\n\t\t\t}\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.selectAll(findController);\n\t}\n}\n\nexport class CompatChangeAll extends MultiCursorSelectionControllerAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.changeAll',\n\t\t\tlabel: nls.localize('changeAll.label', \"Change All Occurrences\"),\n\t\t\talias: 'Change All Occurrences',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.editorTextFocus),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.F2,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 1.2\n\t\t\t}\n\t\t});\n\t}\n\tprotected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {\n\t\tmultiCursorController.selectAll(findController);\n\t}\n}\n\nclass SelectionHighlighterState {\n\tprivate readonly _modelVersionId: number = this._model.getVersionId();\n\tprivate _cachedFindMatches: Range[] | null = null;\n\n\tconstructor(\n\t\tprivate readonly _model: ITextModel,\n\t\tprivate readonly _searchText: string,\n\t\tprivate readonly _matchCase: boolean,\n\t\tprivate readonly _wordSeparators: string | null,\n\t\tprevState: SelectionHighlighterState | null\n\t) {\n\t\tif (prevState\n\t\t\t&& this._model === prevState._model\n\t\t\t&& this._searchText === prevState._searchText\n\t\t\t&& this._matchCase === prevState._matchCase\n\t\t\t&& this._wordSeparators === prevState._wordSeparators\n\t\t\t&& this._modelVersionId === prevState._modelVersionId\n\t\t) {\n\t\t\tthis._cachedFindMatches = prevState._cachedFindMatches;\n\t\t}\n\t}\n\n\tpublic findMatches(): Range[] {\n\t\tif (this._cachedFindMatches === null) {\n\t\t\tthis._cachedFindMatches = this._model.findMatches(this._searchText, true, false, this._matchCase, this._wordSeparators, false).map(m => m.range);\n\t\t\tthis._cachedFindMatches.sort(Range.compareRangesUsingStarts);\n\t\t}\n\t\treturn this._cachedFindMatches;\n\t}\n}\n\nexport class SelectionHighlighter extends Disposable implements IEditorContribution {\n\tpublic static readonly ID = 'editor.contrib.selectionHighlighter';\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate _isEnabled: boolean;\n\tprivate decorations: string[];\n\tprivate readonly updateSoon: RunOnceScheduler;\n\tprivate state: SelectionHighlighterState | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService\n\t) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tthis._isEnabled = editor.getOption(EditorOption.selectionHighlight);\n\t\tthis.decorations = [];\n\t\tthis.updateSoon = this._register(new RunOnceScheduler(() => this._update(), 300));\n\t\tthis.state = null;\n\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tthis._isEnabled = editor.getOption(EditorOption.selectionHighlight);\n\t\t}));\n\t\tthis._register(editor.onDidChangeCursorSelection((e: ICursorSelectionChangedEvent) => {\n\n\t\t\tif (!this._isEnabled) {\n\t\t\t\t// Early exit if nothing needs to be done!\n\t\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (e.selection.isEmpty()) {\n\t\t\t\tif (e.reason === CursorChangeReason.Explicit) {\n\t\t\t\t\tif (this.state) {\n\t\t\t\t\t\t// no longer valid\n\t\t\t\t\t\tthis._setState(null);\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateSoon.schedule();\n\t\t\t\t} else {\n\t\t\t\t\tthis._setState(null);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis._setState(null);\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._isEnabled) {\n\t\t\t\tthis.updateSoon.schedule();\n\t\t\t}\n\t\t}));\n\t\tconst findController = CommonFindController.get(editor);\n\t\tif (findController) {\n\t\t\tthis._register(findController.getState().onFindReplaceStateChange((e) => {\n\t\t\t\tthis._update();\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _update(): void {\n\t\tthis._setState(SelectionHighlighter._createState(this.state, this._isEnabled, this.editor));\n\t}\n\n\tprivate static _createState(oldState: SelectionHighlighterState | null, isEnabled: boolean, editor: ICodeEditor): SelectionHighlighterState | null {\n\t\tif (!isEnabled) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!editor.hasModel()) {\n\t\t\treturn null;\n\t\t}\n\t\tconst s = editor.getSelection();\n\t\tif (s.startLineNumber !== s.endLineNumber) {\n\t\t\t// multiline forbidden for perf reasons\n\t\t\treturn null;\n\t\t}\n\t\tconst multiCursorController = MultiCursorSelectionController.get(editor);\n\t\tif (!multiCursorController) {\n\t\t\treturn null;\n\t\t}\n\t\tconst findController = CommonFindController.get(editor);\n\t\tif (!findController) {\n\t\t\treturn null;\n\t\t}\n\t\tlet r = multiCursorController.getSession(findController);\n\t\tif (!r) {\n\t\t\tconst allSelections = editor.getSelections();\n\t\t\tif (allSelections.length > 1) {\n\t\t\t\tconst findState = findController.getState();\n\t\t\t\tconst matchCase = findState.matchCase;\n\t\t\t\tconst selectionsContainSameText = modelRangesContainSameText(editor.getModel(), allSelections, matchCase);\n\t\t\t\tif (!selectionsContainSameText) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr = MultiCursorSession.create(editor, findController);\n\t\t}\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (r.currentMatch) {\n\t\t\t// This is an empty selection\n\t\t\t// Do not interfere with semantic word highlighting in the no selection case\n\t\t\treturn null;\n\t\t}\n\t\tif (/^[ \\t]+$/.test(r.searchText)) {\n\t\t\t// whitespace only selection\n\t\t\treturn null;\n\t\t}\n\t\tif (r.searchText.length > 200) {\n\t\t\t// very long selection\n\t\t\treturn null;\n\t\t}\n\n\t\t// TODO: better handling of this case\n\t\tconst findState = findController.getState();\n\t\tconst caseSensitive = findState.matchCase;\n\n\t\t// Return early if the find widget shows the exact same matches\n\t\tif (findState.isRevealed) {\n\t\t\tlet findStateSearchString = findState.searchString;\n\t\t\tif (!caseSensitive) {\n\t\t\t\tfindStateSearchString = findStateSearchString.toLowerCase();\n\t\t\t}\n\n\t\t\tlet mySearchString = r.searchText;\n\t\t\tif (!caseSensitive) {\n\t\t\t\tmySearchString = mySearchString.toLowerCase();\n\t\t\t}\n\n\t\t\tif (findStateSearchString === mySearchString && r.matchCase === findState.matchCase && r.wholeWord === findState.wholeWord && !findState.isRegex) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn new SelectionHighlighterState(editor.getModel(), r.searchText, r.matchCase, r.wholeWord ? editor.getOption(EditorOption.wordSeparators) : null, oldState);\n\t}\n\n\tprivate _setState(newState: SelectionHighlighterState | null): void {\n\t\tthis.state = newState;\n\n\t\tif (!this.state) {\n\t\t\tthis.decorations = this.editor.deltaDecorations(this.decorations, []);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tif (model.isTooLargeForTokenization()) {\n\t\t\t// the file is too large, so searching word under cursor in the whole document would be blocking the UI.\n\t\t\treturn;\n\t\t}\n\n\t\tconst allMatches = this.state.findMatches();\n\n\t\tconst selections = this.editor.getSelections();\n\t\tselections.sort(Range.compareRangesUsingStarts);\n\n\t\t// do not overlap with selection (issue #64 and #512)\n\t\tconst matches: Range[] = [];\n\t\tfor (let i = 0, j = 0, len = allMatches.length, lenJ = selections.length; i < len;) {\n\t\t\tconst match = allMatches[i];\n\n\t\t\tif (j >= lenJ) {\n\t\t\t\t// finished all editor selections\n\t\t\t\tmatches.push(match);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tconst cmp = Range.compareRangesUsingStarts(match, selections[j]);\n\t\t\t\tif (cmp < 0) {\n\t\t\t\t\t// match is before sel\n\t\t\t\t\tif (selections[j].isEmpty() || !Range.areIntersecting(match, selections[j])) {\n\t\t\t\t\t\tmatches.push(match);\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t} else if (cmp > 0) {\n\t\t\t\t\t// sel is before match\n\t\t\t\t\tj++;\n\t\t\t\t} else {\n\t\t\t\t\t// sel is equal to match\n\t\t\t\t\ti++;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst hasFindOccurrences = this._languageFeaturesService.documentHighlightProvider.has(model) && this.editor.getOption(EditorOption.occurrencesHighlight);\n\t\tconst decorations = matches.map(r => {\n\t\t\treturn {\n\t\t\t\trange: r,\n\t\t\t\t// Show in overviewRuler only if model has no semantic highlighting\n\t\t\t\toptions: (hasFindOccurrences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW)\n\t\t\t};\n\t\t});\n\n\t\tthis.decorations = this.editor.deltaDecorations(this.decorations, decorations);\n\t}\n\n\tprivate static readonly _SELECTION_HIGHLIGHT_OVERVIEW = ModelDecorationOptions.register({\n\t\tdescription: 'selection-highlight-overview',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'selectionHighlight',\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapSelectionOccurrenceHighlight),\n\t\t\tposition: MinimapPosition.Inline\n\t\t},\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerSelectionHighlightForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t}\n\t});\n\n\tprivate static readonly _SELECTION_HIGHLIGHT = ModelDecorationOptions.register({\n\t\tdescription: 'selection-highlight',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'selectionHighlight',\n\t});\n\n\tpublic override dispose(): void {\n\t\tthis._setState(null);\n\t\tsuper.dispose();\n\t}\n}\n\nfunction modelRangesContainSameText(model: ITextModel, ranges: Range[], matchCase: boolean): boolean {\n\tconst selectedText = getValueInRange(model, ranges[0], !matchCase);\n\tfor (let i = 1, len = ranges.length; i < len; i++) {\n\t\tconst range = ranges[i];\n\t\tif (range.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst thisSelectedText = getValueInRange(model, range, !matchCase);\n\t\tif (selectedText !== thisSelectedText) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction getValueInRange(model: ITextModel, range: Range, toLowerCase: boolean): string {\n\tconst text = model.getValueInRange(range);\n\treturn (toLowerCase ? text.toLowerCase() : text);\n}\n\nregisterEditorContribution(MultiCursorSelectionController.ID, MultiCursorSelectionController);\nregisterEditorContribution(SelectionHighlighter.ID, SelectionHighlighter);\n\nregisterEditorAction(InsertCursorAbove);\nregisterEditorAction(InsertCursorBelow);\nregisterEditorAction(InsertCursorAtEndOfEachLineSelected);\nregisterEditorAction(AddSelectionToNextFindMatchAction);\nregisterEditorAction(AddSelectionToPreviousFindMatchAction);\nregisterEditorAction(MoveSelectionToNextFindMatchAction);\nregisterEditorAction(MoveSelectionToPreviousFindMatchAction);\nregisterEditorAction(SelectHighlightsAction);\nregisterEditorAction(CompatChangeAll);\nregisterEditorAction(InsertCursorAtEndOfLineSelected);\nregisterEditorAction(InsertCursorAtTopOfLineSelected);\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 * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport 'vs/base/browser/ui/codicons/codiconStyles'; // The codicon symbol styles are defined here and must be loaded\nimport { IListEvent, IListGestureEvent, IListMouseEvent } from 'vs/base/browser/ui/list/list';\nimport { List } from 'vs/base/browser/ui/list/listWidget';\nimport { CancelablePromise, createCancelablePromise, disposableTimeout, TimeoutTimer } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { clamp } from 'vs/base/common/numbers';\nimport * as strings from 'vs/base/common/strings';\nimport 'vs/css!./media/suggest';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { SuggestWidgetStatus } from 'vs/editor/contrib/suggest/browser/suggestWidgetStatus';\nimport 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors\nimport * as nls from 'vs/nls';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { activeContrastBorder, editorForeground, editorWidgetBackground, editorWidgetBorder, listFocusHighlightForeground, listHighlightForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry';\nimport { attachListStyler } from 'vs/platform/theme/common/styler';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\nimport { CompletionModel } from './completionModel';\nimport { ResizableHTMLElement } from './resizable';\nimport { CompletionItem, Context as SuggestContext } from './suggest';\nimport { canExpandCompletionItem, SuggestDetailsOverlay, SuggestDetailsWidget } from './suggestWidgetDetails';\nimport { getAriaId, ItemRenderer } from './suggestWidgetRenderer';\n\n/**\n * Suggest widget colors\n */\nexport const editorSuggestWidgetBackground = registerColor('editorSuggestWidget.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('editorSuggestWidgetBackground', 'Background color of the suggest widget.'));\nexport const editorSuggestWidgetBorder = registerColor('editorSuggestWidget.border', { dark: editorWidgetBorder, light: editorWidgetBorder, hc: editorWidgetBorder }, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.'));\nexport const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', { dark: editorForeground, light: editorForeground, hc: editorForeground }, nls.localize('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.'));\nexport const editorSuggestWidgetSelectedForeground = registerColor('editorSuggestWidget.selectedForeground', { dark: quickInputListFocusForeground, light: quickInputListFocusForeground, hc: quickInputListFocusForeground }, nls.localize('editorSuggestWidgetSelectedForeground', 'Foreground color of the selected entry in the suggest widget.'));\nexport const editorSuggestWidgetSelectedIconForeground = registerColor('editorSuggestWidget.selectedIconForeground', { dark: quickInputListFocusIconForeground, light: quickInputListFocusIconForeground, hc: quickInputListFocusIconForeground }, nls.localize('editorSuggestWidgetSelectedIconForeground', 'Icon foreground color of the selected entry in the suggest widget.'));\nexport const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: quickInputListFocusBackground, light: quickInputListFocusBackground, hc: quickInputListFocusBackground }, nls.localize('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.'));\nexport const editorSuggestWidgetHighlightForeground = registerColor('editorSuggestWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hc: listHighlightForeground }, nls.localize('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.'));\nexport const editorSuggestWidgetHighlightFocusForeground = registerColor('editorSuggestWidget.focusHighlightForeground', { dark: listFocusHighlightForeground, light: listFocusHighlightForeground, hc: listFocusHighlightForeground }, nls.localize('editorSuggestWidgetFocusHighlightForeground', 'Color of the match highlights in the suggest widget when an item is focused.'));\nexport const editorSuggestWidgetStatusForeground = registerColor('editorSuggestWidgetStatus.foreground', { dark: transparent(editorSuggestWidgetForeground, .5), light: transparent(editorSuggestWidgetForeground, .5), hc: transparent(editorSuggestWidgetForeground, .5) }, nls.localize('editorSuggestWidgetStatusForeground', 'Foreground color of the suggest widget status.'));\n\nconst enum State {\n\tHidden,\n\tLoading,\n\tEmpty,\n\tOpen,\n\tFrozen,\n\tDetails\n}\n\nexport interface ISelectedSuggestion {\n\titem: CompletionItem;\n\tindex: number;\n\tmodel: CompletionModel;\n}\n\nclass PersistedWidgetSize {\n\n\tprivate readonly _key: string;\n\n\tconstructor(\n\t\tprivate readonly _service: IStorageService,\n\t\teditor: ICodeEditor\n\t) {\n\t\tthis._key = `suggestWidget.size/${editor.getEditorType()}/${editor instanceof EmbeddedCodeEditorWidget}`;\n\t}\n\n\trestore(): dom.Dimension | undefined {\n\t\tconst raw = this._service.get(this._key, StorageScope.GLOBAL) ?? '';\n\t\ttry {\n\t\t\tconst obj = JSON.parse(raw);\n\t\t\tif (dom.Dimension.is(obj)) {\n\t\t\t\treturn dom.Dimension.lift(obj);\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tstore(size: dom.Dimension) {\n\t\tthis._service.store(this._key, JSON.stringify(size), StorageScope.GLOBAL, StorageTarget.MACHINE);\n\t}\n\n\treset(): void {\n\t\tthis._service.remove(this._key, StorageScope.GLOBAL);\n\t}\n}\n\nexport class SuggestWidget implements IDisposable {\n\n\tprivate static LOADING_MESSAGE: string = nls.localize('suggestWidget.loading', \"Loading...\");\n\tprivate static NO_SUGGESTIONS_MESSAGE: string = nls.localize('suggestWidget.noSuggestions', \"No suggestions.\");\n\n\tprivate _state: State = State.Hidden;\n\tprivate _isAuto: boolean = false;\n\tprivate _loadingTimeout?: IDisposable;\n\tprivate _currentSuggestionDetails?: CancelablePromise<void>;\n\tprivate _focusedItem?: CompletionItem;\n\tprivate _ignoreFocusEvents: boolean = false;\n\tprivate _completionModel?: CompletionModel;\n\tprivate _cappedHeight?: { wanted: number; capped: number };\n\tprivate _forceRenderingAbove: boolean = false;\n\tprivate _explainMode: boolean = false;\n\n\treadonly element: ResizableHTMLElement;\n\tprivate readonly _messageElement: HTMLElement;\n\tprivate readonly _listElement: HTMLElement;\n\tprivate readonly _list: List<CompletionItem>;\n\tprivate readonly _status: SuggestWidgetStatus;\n\tprivate readonly _details: SuggestDetailsOverlay;\n\tprivate readonly _contentWidget: SuggestContentWidget;\n\tprivate readonly _persistedSize: PersistedWidgetSize;\n\n\tprivate readonly _ctxSuggestWidgetVisible: IContextKey<boolean>;\n\tprivate readonly _ctxSuggestWidgetDetailsVisible: IContextKey<boolean>;\n\tprivate readonly _ctxSuggestWidgetMultipleSuggestions: IContextKey<boolean>;\n\n\tprivate readonly _showTimeout = new TimeoutTimer();\n\tprivate readonly _disposables = new DisposableStore();\n\n\n\tprivate readonly _onDidSelect = new Emitter<ISelectedSuggestion>();\n\tprivate readonly _onDidFocus = new Emitter<ISelectedSuggestion>();\n\tprivate readonly _onDidHide = new Emitter<this>();\n\tprivate readonly _onDidShow = new Emitter<this>();\n\n\treadonly onDidSelect: Event<ISelectedSuggestion> = this._onDidSelect.event;\n\treadonly onDidFocus: Event<ISelectedSuggestion> = this._onDidFocus.event;\n\treadonly onDidHide: Event<this> = this._onDidHide.event;\n\treadonly onDidShow: Event<this> = this._onDidShow.event;\n\n\tprivate readonly _onDetailsKeydown = new Emitter<IKeyboardEvent>();\n\treadonly onDetailsKeyDown: Event<IKeyboardEvent> = this._onDetailsKeydown.event;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IStorageService private readonly _storageService: IStorageService,\n\t\t@IContextKeyService _contextKeyService: IContextKeyService,\n\t\t@IThemeService _themeService: IThemeService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tthis.element = new ResizableHTMLElement();\n\t\tthis.element.domNode.classList.add('editor-widget', 'suggest-widget');\n\n\t\tthis._contentWidget = new SuggestContentWidget(this, editor);\n\t\tthis._persistedSize = new PersistedWidgetSize(_storageService, editor);\n\n\t\tclass ResizeState {\n\t\t\tconstructor(\n\t\t\t\treadonly persistedSize: dom.Dimension | undefined,\n\t\t\t\treadonly currentSize: dom.Dimension,\n\t\t\t\tpublic persistHeight = false,\n\t\t\t\tpublic persistWidth = false,\n\t\t\t) { }\n\t\t}\n\n\t\tlet state: ResizeState | undefined;\n\t\tthis._disposables.add(this.element.onDidWillResize(() => {\n\t\t\tthis._contentWidget.lockPreference();\n\t\t\tstate = new ResizeState(this._persistedSize.restore(), this.element.size);\n\t\t}));\n\t\tthis._disposables.add(this.element.onDidResize(e => {\n\n\t\t\tthis._resize(e.dimension.width, e.dimension.height);\n\n\t\t\tif (state) {\n\t\t\t\tstate.persistHeight = state.persistHeight || !!e.north || !!e.south;\n\t\t\t\tstate.persistWidth = state.persistWidth || !!e.east || !!e.west;\n\t\t\t}\n\n\t\t\tif (!e.done) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (state) {\n\t\t\t\t// only store width or height value that have changed and also\n\t\t\t\t// only store changes that are above a certain threshold\n\t\t\t\tconst { itemHeight, defaultSize } = this.getLayoutInfo();\n\t\t\t\tconst threshold = Math.round(itemHeight / 2);\n\t\t\t\tlet { width, height } = this.element.size;\n\t\t\t\tif (!state.persistHeight || Math.abs(state.currentSize.height - height) <= threshold) {\n\t\t\t\t\theight = state.persistedSize?.height ?? defaultSize.height;\n\t\t\t\t}\n\t\t\t\tif (!state.persistWidth || Math.abs(state.currentSize.width - width) <= threshold) {\n\t\t\t\t\twidth = state.persistedSize?.width ?? defaultSize.width;\n\t\t\t\t}\n\t\t\t\tthis._persistedSize.store(new dom.Dimension(width, height));\n\t\t\t}\n\n\t\t\t// reset working state\n\t\t\tthis._contentWidget.unlockPreference();\n\t\t\tstate = undefined;\n\t\t}));\n\n\t\tthis._messageElement = dom.append(this.element.domNode, dom.$('.message'));\n\t\tthis._listElement = dom.append(this.element.domNode, dom.$('.tree'));\n\n\t\tconst details = instantiationService.createInstance(SuggestDetailsWidget, this.editor);\n\t\tdetails.onDidClose(this.toggleDetails, this, this._disposables);\n\t\tthis._details = new SuggestDetailsOverlay(details, this.editor);\n\n\t\tconst applyIconStyle = () => this.element.domNode.classList.toggle('no-icons', !this.editor.getOption(EditorOption.suggest).showIcons);\n\t\tapplyIconStyle();\n\n\t\tconst renderer = instantiationService.createInstance(ItemRenderer, this.editor);\n\t\tthis._disposables.add(renderer);\n\t\tthis._disposables.add(renderer.onDidToggleDetails(() => this.toggleDetails()));\n\n\t\tthis._list = new List('SuggestWidget', this._listElement, {\n\t\t\tgetHeight: (_element: CompletionItem): number => this.getLayoutInfo().itemHeight,\n\t\t\tgetTemplateId: (_element: CompletionItem): string => 'suggestion'\n\t\t}, [renderer], {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t\tuseShadows: false,\n\t\t\tmouseSupport: false,\n\t\t\taccessibilityProvider: {\n\t\t\t\tgetRole: () => 'option',\n\t\t\t\tgetWidgetAriaLabel: () => nls.localize('suggest', \"Suggest\"),\n\t\t\t\tgetWidgetRole: () => 'listbox',\n\t\t\t\tgetAriaLabel: (item: CompletionItem) => {\n\n\t\t\t\t\tlet label = item.textLabel;\n\t\t\t\t\tif (typeof item.completion.label !== 'string') {\n\t\t\t\t\t\tconst { detail, description } = item.completion.label;\n\t\t\t\t\t\tif (detail && description) {\n\t\t\t\t\t\t\tlabel = nls.localize('label.full', '{0}{1}, {2}', label, detail, description);\n\t\t\t\t\t\t} else if (detail) {\n\t\t\t\t\t\t\tlabel = nls.localize('label.detail', '{0}{1}', label, detail);\n\t\t\t\t\t\t} else if (description) {\n\t\t\t\t\t\t\tlabel = nls.localize('label.desc', '{0}, {1}', label, description);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!item.isResolved || !this._isDetailsVisible()) {\n\t\t\t\t\t\treturn label;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { documentation, detail } = item.completion;\n\t\t\t\t\tconst docs = strings.format(\n\t\t\t\t\t\t'{0}{1}',\n\t\t\t\t\t\tdetail || '',\n\t\t\t\t\t\tdocumentation ? (typeof documentation === 'string' ? documentation : documentation.value) : '');\n\n\t\t\t\t\treturn nls.localize('ariaCurrenttSuggestionReadDetails', \"{0}, docs: {1}\", label, docs);\n\t\t\t\t},\n\t\t\t}\n\t\t});\n\n\t\tthis._status = instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode);\n\t\tconst applyStatusBarStyle = () => this.element.domNode.classList.toggle('with-status-bar', this.editor.getOption(EditorOption.suggest).showStatusBar);\n\t\tapplyStatusBarStyle();\n\n\t\tthis._disposables.add(attachListStyler(this._list, _themeService, {\n\t\t\tlistInactiveFocusBackground: editorSuggestWidgetSelectedBackground,\n\t\t\tlistInactiveFocusOutline: activeContrastBorder\n\t\t}));\n\t\tthis._disposables.add(_themeService.onDidColorThemeChange(t => this._onThemeChange(t)));\n\t\tthis._onThemeChange(_themeService.getColorTheme());\n\n\t\tthis._disposables.add(this._list.onMouseDown(e => this._onListMouseDownOrTap(e)));\n\t\tthis._disposables.add(this._list.onTap(e => this._onListMouseDownOrTap(e)));\n\t\tthis._disposables.add(this._list.onDidChangeSelection(e => this._onListSelection(e)));\n\t\tthis._disposables.add(this._list.onDidChangeFocus(e => this._onListFocus(e)));\n\t\tthis._disposables.add(this.editor.onDidChangeCursorSelection(() => this._onCursorSelectionChanged()));\n\t\tthis._disposables.add(this.editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.suggest)) {\n\t\t\t\tapplyStatusBarStyle();\n\t\t\t\tapplyIconStyle();\n\t\t\t}\n\t\t}));\n\n\t\tthis._ctxSuggestWidgetVisible = SuggestContext.Visible.bindTo(_contextKeyService);\n\t\tthis._ctxSuggestWidgetDetailsVisible = SuggestContext.DetailsVisible.bindTo(_contextKeyService);\n\t\tthis._ctxSuggestWidgetMultipleSuggestions = SuggestContext.MultipleSuggestions.bindTo(_contextKeyService);\n\n\n\t\tthis._disposables.add(dom.addStandardDisposableListener(this._details.widget.domNode, 'keydown', e => {\n\t\t\tthis._onDetailsKeydown.fire(e);\n\t\t}));\n\n\t\tthis._disposables.add(this.editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t}\n\n\tdispose(): void {\n\t\tthis._details.widget.dispose();\n\t\tthis._details.dispose();\n\t\tthis._list.dispose();\n\t\tthis._status.dispose();\n\t\tthis._disposables.dispose();\n\t\tthis._loadingTimeout?.dispose();\n\t\tthis._showTimeout.dispose();\n\t\tthis._contentWidget.dispose();\n\t\tthis.element.dispose();\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._details.widget.domNode.contains(mouseEvent.target.element)) {\n\t\t\t// Clicking inside details\n\t\t\tthis._details.widget.domNode.focus();\n\t\t} else {\n\t\t\t// Clicking outside details and inside suggest\n\t\t\tif (this.element.domNode.contains(mouseEvent.target.element)) {\n\t\t\t\tthis.editor.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorSelectionChanged(): void {\n\t\tif (this._state !== State.Hidden) {\n\t\t\tthis._contentWidget.layout();\n\t\t}\n\t}\n\n\tprivate _onListMouseDownOrTap(e: IListMouseEvent<CompletionItem> | IListGestureEvent<CompletionItem>): void {\n\t\tif (typeof e.element === 'undefined' || typeof e.index === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\t// prevent stealing browser focus from the editor\n\t\te.browserEvent.preventDefault();\n\t\te.browserEvent.stopPropagation();\n\n\t\tthis._select(e.element, e.index);\n\t}\n\n\tprivate _onListSelection(e: IListEvent<CompletionItem>): void {\n\t\tif (e.elements.length) {\n\t\t\tthis._select(e.elements[0], e.indexes[0]);\n\t\t}\n\t}\n\n\tprivate _select(item: CompletionItem, index: number): void {\n\t\tconst completionModel = this._completionModel;\n\t\tif (completionModel) {\n\t\t\tthis._onDidSelect.fire({ item, index, model: completionModel });\n\t\t\tthis.editor.focus();\n\t\t}\n\t}\n\n\tprivate _onThemeChange(theme: IColorTheme) {\n\t\tthis._details.widget.borderWidth = theme.type === 'hc' ? 2 : 1;\n\t}\n\n\tprivate _onListFocus(e: IListEvent<CompletionItem>): void {\n\t\tif (this._ignoreFocusEvents) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!e.elements.length) {\n\t\t\tif (this._currentSuggestionDetails) {\n\t\t\t\tthis._currentSuggestionDetails.cancel();\n\t\t\t\tthis._currentSuggestionDetails = undefined;\n\t\t\t\tthis._focusedItem = undefined;\n\t\t\t}\n\n\t\t\tthis.editor.setAriaOptions({ activeDescendant: undefined });\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = e.elements[0];\n\t\tconst index = e.indexes[0];\n\n\t\tif (item !== this._focusedItem) {\n\n\t\t\tthis._currentSuggestionDetails?.cancel();\n\t\t\tthis._currentSuggestionDetails = undefined;\n\n\t\t\tthis._focusedItem = item;\n\n\t\t\tthis._list.reveal(index);\n\n\t\t\tthis._currentSuggestionDetails = createCancelablePromise(async token => {\n\t\t\t\tconst loading = disposableTimeout(() => {\n\t\t\t\t\tif (this._isDetailsVisible()) {\n\t\t\t\t\t\tthis.showDetails(true);\n\t\t\t\t\t}\n\t\t\t\t}, 250);\n\t\t\t\tconst sub = token.onCancellationRequested(() => loading.dispose());\n\t\t\t\tconst result = await item.resolve(token);\n\t\t\t\tloading.dispose();\n\t\t\t\tsub.dispose();\n\t\t\t\treturn result;\n\t\t\t});\n\n\t\t\tthis._currentSuggestionDetails.then(() => {\n\t\t\t\tif (index >= this._list.length || item !== this._list.element(index)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// item can have extra information, so re-render\n\t\t\t\tthis._ignoreFocusEvents = true;\n\t\t\t\tthis._list.splice(index, 1, [item]);\n\t\t\t\tthis._list.setFocus([index]);\n\t\t\t\tthis._ignoreFocusEvents = false;\n\n\t\t\t\tif (this._isDetailsVisible()) {\n\t\t\t\t\tthis.showDetails(false);\n\t\t\t\t} else {\n\t\t\t\t\tthis.element.domNode.classList.remove('docs-side');\n\t\t\t\t}\n\n\t\t\t\tthis.editor.setAriaOptions({ activeDescendant: getAriaId(index) });\n\t\t\t}).catch(onUnexpectedError);\n\t\t}\n\n\t\t// emit an event\n\t\tthis._onDidFocus.fire({ item, index, model: this._completionModel });\n\t}\n\n\tprivate _setState(state: State): void {\n\n\t\tif (this._state === state) {\n\t\t\treturn;\n\t\t}\n\t\tthis._state = state;\n\n\t\tthis.element.domNode.classList.toggle('frozen', state === State.Frozen);\n\t\tthis.element.domNode.classList.remove('message');\n\n\t\tswitch (state) {\n\t\t\tcase State.Hidden:\n\t\t\t\tdom.hide(this._messageElement, this._listElement, this._status.element);\n\t\t\t\tthis._details.hide(true);\n\t\t\t\tthis._status.hide();\n\t\t\t\tthis._contentWidget.hide();\n\t\t\t\tthis._ctxSuggestWidgetVisible.reset();\n\t\t\t\tthis._ctxSuggestWidgetMultipleSuggestions.reset();\n\t\t\t\tthis._showTimeout.cancel();\n\t\t\t\tthis.element.domNode.classList.remove('visible');\n\t\t\t\tthis._list.splice(0, this._list.length);\n\t\t\t\tthis._focusedItem = undefined;\n\t\t\t\tthis._cappedHeight = undefined;\n\t\t\t\tthis._explainMode = false;\n\t\t\t\tbreak;\n\t\t\tcase State.Loading:\n\t\t\t\tthis.element.domNode.classList.add('message');\n\t\t\t\tthis._messageElement.textContent = SuggestWidget.LOADING_MESSAGE;\n\t\t\t\tdom.hide(this._listElement, this._status.element);\n\t\t\t\tdom.show(this._messageElement);\n\t\t\t\tthis._details.hide();\n\t\t\t\tthis._show();\n\t\t\t\tthis._focusedItem = undefined;\n\t\t\t\tbreak;\n\t\t\tcase State.Empty:\n\t\t\t\tthis.element.domNode.classList.add('message');\n\t\t\t\tthis._messageElement.textContent = SuggestWidget.NO_SUGGESTIONS_MESSAGE;\n\t\t\t\tdom.hide(this._listElement, this._status.element);\n\t\t\t\tdom.show(this._messageElement);\n\t\t\t\tthis._details.hide();\n\t\t\t\tthis._show();\n\t\t\t\tthis._focusedItem = undefined;\n\t\t\t\tbreak;\n\t\t\tcase State.Open:\n\t\t\t\tdom.hide(this._messageElement);\n\t\t\t\tdom.show(this._listElement, this._status.element);\n\t\t\t\tthis._show();\n\t\t\t\tbreak;\n\t\t\tcase State.Frozen:\n\t\t\t\tdom.hide(this._messageElement);\n\t\t\t\tdom.show(this._listElement, this._status.element);\n\t\t\t\tthis._show();\n\t\t\t\tbreak;\n\t\t\tcase State.Details:\n\t\t\t\tdom.hide(this._messageElement);\n\t\t\t\tdom.show(this._listElement, this._status.element);\n\t\t\t\tthis._details.show();\n\t\t\t\tthis._show();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate _show(): void {\n\t\tthis._status.show();\n\t\tthis._contentWidget.show();\n\t\tthis._layout(this._persistedSize.restore());\n\t\tthis._ctxSuggestWidgetVisible.set(true);\n\n\t\tthis._showTimeout.cancelAndSet(() => {\n\t\t\tthis.element.domNode.classList.add('visible');\n\t\t\tthis._onDidShow.fire(this);\n\t\t}, 100);\n\t}\n\n\tshowTriggered(auto: boolean, delay: number) {\n\t\tif (this._state !== State.Hidden) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contentWidget.setPosition(this.editor.getPosition());\n\t\tthis._isAuto = !!auto;\n\n\t\tif (!this._isAuto) {\n\t\t\tthis._loadingTimeout = disposableTimeout(() => this._setState(State.Loading), delay);\n\t\t}\n\t}\n\n\tshowSuggestions(completionModel: CompletionModel, selectionIndex: number, isFrozen: boolean, isAuto: boolean): void {\n\n\t\tthis._contentWidget.setPosition(this.editor.getPosition());\n\t\tthis._loadingTimeout?.dispose();\n\n\t\tthis._currentSuggestionDetails?.cancel();\n\t\tthis._currentSuggestionDetails = undefined;\n\n\t\tif (this._completionModel !== completionModel) {\n\t\t\tthis._completionModel = completionModel;\n\t\t}\n\n\t\tif (isFrozen && this._state !== State.Empty && this._state !== State.Hidden) {\n\t\t\tthis._setState(State.Frozen);\n\t\t\treturn;\n\t\t}\n\n\t\tconst visibleCount = this._completionModel.items.length;\n\t\tconst isEmpty = visibleCount === 0;\n\t\tthis._ctxSuggestWidgetMultipleSuggestions.set(visibleCount > 1);\n\n\t\tif (isEmpty) {\n\t\t\tthis._setState(isAuto ? State.Hidden : State.Empty);\n\t\t\tthis._completionModel = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusedItem = undefined;\n\t\tthis._list.splice(0, this._list.length, this._completionModel.items);\n\t\tthis._setState(isFrozen ? State.Frozen : State.Open);\n\t\tthis._list.reveal(selectionIndex, 0);\n\t\tthis._list.setFocus([selectionIndex]);\n\n\t\tthis._layout(this.element.size);\n\t\t// Reset focus border\n\t\tthis._details.widget.domNode.classList.remove('focused');\n\t}\n\n\tselectNextPage(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Details:\n\t\t\t\tthis._details.widget.pageDown();\n\t\t\t\treturn true;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusNextPage();\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\tselectNext(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusNext(1, true);\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\tselectLast(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Details:\n\t\t\t\tthis._details.widget.scrollBottom();\n\t\t\t\treturn true;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusLast();\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\tselectPreviousPage(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Details:\n\t\t\t\tthis._details.widget.pageUp();\n\t\t\t\treturn true;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusPreviousPage();\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\tselectPrevious(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusPrevious(1, true);\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tselectFirst(): boolean {\n\t\tswitch (this._state) {\n\t\t\tcase State.Hidden:\n\t\t\t\treturn false;\n\t\t\tcase State.Details:\n\t\t\t\tthis._details.widget.scrollTop();\n\t\t\t\treturn true;\n\t\t\tcase State.Loading:\n\t\t\t\treturn !this._isAuto;\n\t\t\tdefault:\n\t\t\t\tthis._list.focusFirst();\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\tgetFocusedItem(): ISelectedSuggestion | undefined {\n\t\tif (this._state !== State.Hidden\n\t\t\t&& this._state !== State.Empty\n\t\t\t&& this._state !== State.Loading\n\t\t\t&& this._completionModel\n\t\t) {\n\n\t\t\treturn {\n\t\t\t\titem: this._list.getFocusedElements()[0],\n\t\t\t\tindex: this._list.getFocus()[0],\n\t\t\t\tmodel: this._completionModel\n\t\t\t};\n\t\t}\n\t\treturn undefined;\n\t}\n\n\ttoggleDetailsFocus(): void {\n\t\tif (this._state === State.Details) {\n\t\t\tthis._setState(State.Open);\n\t\t\tthis._details.widget.domNode.classList.remove('focused');\n\n\t\t} else if (this._state === State.Open && this._isDetailsVisible()) {\n\t\t\tthis._setState(State.Details);\n\t\t\tthis._details.widget.domNode.classList.add('focused');\n\t\t}\n\t}\n\n\ttoggleDetails(): void {\n\t\tif (this._isDetailsVisible()) {\n\t\t\t// hide details widget\n\t\t\tthis._ctxSuggestWidgetDetailsVisible.set(false);\n\t\t\tthis._setDetailsVisible(false);\n\t\t\tthis._details.hide();\n\t\t\tthis.element.domNode.classList.remove('shows-details');\n\n\t\t} else if ((canExpandCompletionItem(this._list.getFocusedElements()[0]) || this._explainMode) && (this._state === State.Open || this._state === State.Details || this._state === State.Frozen)) {\n\t\t\t// show details widget (iff possible)\n\t\t\tthis._ctxSuggestWidgetDetailsVisible.set(true);\n\t\t\tthis._setDetailsVisible(true);\n\t\t\tthis.showDetails(false);\n\t\t}\n\t}\n\n\tshowDetails(loading: boolean): void {\n\t\tthis._details.show();\n\t\tif (loading) {\n\t\t\tthis._details.widget.renderLoading();\n\t\t} else {\n\t\t\tthis._details.widget.renderItem(this._list.getFocusedElements()[0], this._explainMode);\n\t\t}\n\t\tthis._positionDetails();\n\t\tthis.editor.focus();\n\t\tthis.element.domNode.classList.add('shows-details');\n\t}\n\n\ttoggleExplainMode(): void {\n\t\tif (this._list.getFocusedElements()[0]) {\n\t\t\tthis._explainMode = !this._explainMode;\n\t\t\tif (!this._isDetailsVisible()) {\n\t\t\t\tthis.toggleDetails();\n\t\t\t} else {\n\t\t\t\tthis.showDetails(false);\n\t\t\t}\n\t\t}\n\t}\n\n\tresetPersistedSize(): void {\n\t\tthis._persistedSize.reset();\n\t}\n\n\thideWidget(): void {\n\t\tthis._loadingTimeout?.dispose();\n\t\tthis._setState(State.Hidden);\n\t\tthis._onDidHide.fire(this);\n\t\tthis.element.clearSashHoverState();\n\n\t\t// ensure that a reasonable widget height is persisted so that\n\t\t// accidential \"resize-to-single-items\" cases aren't happening\n\t\tconst dim = this._persistedSize.restore();\n\t\tconst minPersistedHeight = Math.ceil(this.getLayoutInfo().itemHeight * 4.3);\n\t\tif (dim && dim.height < minPersistedHeight) {\n\t\t\tthis._persistedSize.store(dim.with(undefined, minPersistedHeight));\n\t\t}\n\t}\n\n\tisFrozen(): boolean {\n\t\treturn this._state === State.Frozen;\n\t}\n\n\t_afterRender(position: ContentWidgetPositionPreference | null) {\n\t\tif (position === null) {\n\t\t\tif (this._isDetailsVisible()) {\n\t\t\t\tthis._details.hide(); //todo@jrieken soft-hide\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._state === State.Empty || this._state === State.Loading) {\n\t\t\t// no special positioning when widget isn't showing list\n\t\t\treturn;\n\t\t}\n\t\tif (this._isDetailsVisible()) {\n\t\t\tthis._details.show();\n\t\t}\n\t\tthis._positionDetails();\n\t}\n\n\tprivate _layout(size: dom.Dimension | undefined): void {\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.editor.getDomNode()) {\n\t\t\t// happens when running tests\n\t\t\treturn;\n\t\t}\n\n\t\tconst bodyBox = dom.getClientArea(document.body);\n\t\tconst info = this.getLayoutInfo();\n\n\t\tif (!size) {\n\t\t\tsize = info.defaultSize;\n\t\t}\n\n\t\tlet height = size.height;\n\t\tlet width = size.width;\n\n\t\t// status bar\n\t\tthis._status.element.style.lineHeight = `${info.itemHeight}px`;\n\n\t\tif (this._state === State.Empty || this._state === State.Loading) {\n\t\t\t// showing a message only\n\t\t\theight = info.itemHeight + info.borderHeight;\n\t\t\twidth = info.defaultSize.width / 2;\n\t\t\tthis.element.enableSashes(false, false, false, false);\n\t\t\tthis.element.minSize = this.element.maxSize = new dom.Dimension(width, height);\n\t\t\tthis._contentWidget.setPreference(ContentWidgetPositionPreference.BELOW);\n\n\t\t} else {\n\t\t\t// showing items\n\n\t\t\t// width math\n\t\t\tconst maxWidth = bodyBox.width - info.borderHeight - 2 * info.horizontalPadding;\n\t\t\tif (width > maxWidth) {\n\t\t\t\twidth = maxWidth;\n\t\t\t}\n\t\t\tconst preferredWidth = this._completionModel ? this._completionModel.stats.pLabelLen * info.typicalHalfwidthCharacterWidth : width;\n\n\t\t\t// height math\n\t\t\tconst fullHeight = info.statusBarHeight + this._list.contentHeight + info.borderHeight;\n\t\t\tconst minHeight = info.itemHeight + info.statusBarHeight;\n\t\t\tconst editorBox = dom.getDomNodePagePosition(this.editor.getDomNode());\n\t\t\tconst cursorBox = this.editor.getScrolledVisiblePosition(this.editor.getPosition());\n\t\t\tconst cursorBottom = editorBox.top + cursorBox.top + cursorBox.height;\n\t\t\tconst maxHeightBelow = Math.min(bodyBox.height - cursorBottom - info.verticalPadding, fullHeight);\n\t\t\tconst availableSpaceAbove = editorBox.top + cursorBox.top - info.verticalPadding;\n\t\t\tconst maxHeightAbove = Math.min(availableSpaceAbove, fullHeight);\n\t\t\tlet maxHeight = Math.min(Math.max(maxHeightAbove, maxHeightBelow) + info.borderHeight, fullHeight);\n\n\t\t\tif (height === this._cappedHeight?.capped) {\n\t\t\t\t// Restore the old (wanted) height when the current\n\t\t\t\t// height is capped to fit\n\t\t\t\theight = this._cappedHeight.wanted;\n\t\t\t}\n\n\t\t\tif (height < minHeight) {\n\t\t\t\theight = minHeight;\n\t\t\t}\n\t\t\tif (height > maxHeight) {\n\t\t\t\theight = maxHeight;\n\t\t\t}\n\n\t\t\tconst forceRenderingAboveRequiredSpace = 150;\n\t\t\tif (height > maxHeightBelow || (this._forceRenderingAbove && availableSpaceAbove > forceRenderingAboveRequiredSpace)) {\n\t\t\t\tthis._contentWidget.setPreference(ContentWidgetPositionPreference.ABOVE);\n\t\t\t\tthis.element.enableSashes(true, true, false, false);\n\t\t\t\tmaxHeight = maxHeightAbove;\n\t\t\t} else {\n\t\t\t\tthis._contentWidget.setPreference(ContentWidgetPositionPreference.BELOW);\n\t\t\t\tthis.element.enableSashes(false, true, true, false);\n\t\t\t\tmaxHeight = maxHeightBelow;\n\t\t\t}\n\t\t\tthis.element.preferredSize = new dom.Dimension(preferredWidth, info.defaultSize.height);\n\t\t\tthis.element.maxSize = new dom.Dimension(maxWidth, maxHeight);\n\t\t\tthis.element.minSize = new dom.Dimension(220, minHeight);\n\n\t\t\t// Know when the height was capped to fit and remember\n\t\t\t// the wanted height for later. This is required when going\n\t\t\t// left to widen suggestions.\n\t\t\tthis._cappedHeight = height === fullHeight\n\t\t\t\t? { wanted: this._cappedHeight?.wanted ?? size.height, capped: height }\n\t\t\t\t: undefined;\n\t\t}\n\t\tthis._resize(width, height);\n\t}\n\n\tprivate _resize(width: number, height: number): void {\n\n\t\tconst { width: maxWidth, height: maxHeight } = this.element.maxSize;\n\t\twidth = Math.min(maxWidth, width);\n\t\theight = Math.min(maxHeight, height);\n\n\t\tconst { statusBarHeight } = this.getLayoutInfo();\n\t\tthis._list.layout(height - statusBarHeight, width);\n\t\tthis._listElement.style.height = `${height - statusBarHeight}px`;\n\t\tthis.element.layout(height, width);\n\t\tthis._contentWidget.layout();\n\n\t\tthis._positionDetails();\n\t}\n\n\tprivate _positionDetails(): void {\n\t\tif (this._isDetailsVisible()) {\n\t\t\tthis._details.placeAtAnchor(this.element.domNode, this._contentWidget.getPosition()?.preference[0] === ContentWidgetPositionPreference.BELOW);\n\t\t}\n\t}\n\n\tgetLayoutInfo() {\n\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\tconst itemHeight = clamp(this.editor.getOption(EditorOption.suggestLineHeight) || fontInfo.lineHeight, 8, 1000);\n\t\tconst statusBarHeight = !this.editor.getOption(EditorOption.suggest).showStatusBar || this._state === State.Empty || this._state === State.Loading ? 0 : itemHeight;\n\t\tconst borderWidth = this._details.widget.borderWidth;\n\t\tconst borderHeight = 2 * borderWidth;\n\n\t\treturn {\n\t\t\titemHeight,\n\t\t\tstatusBarHeight,\n\t\t\tborderWidth,\n\t\t\tborderHeight,\n\t\t\ttypicalHalfwidthCharacterWidth: fontInfo.typicalHalfwidthCharacterWidth,\n\t\t\tverticalPadding: 22,\n\t\t\thorizontalPadding: 14,\n\t\t\tdefaultSize: new dom.Dimension(430, statusBarHeight + 12 * itemHeight + borderHeight)\n\t\t};\n\t}\n\n\tprivate _isDetailsVisible(): boolean {\n\t\treturn this._storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, false);\n\t}\n\n\tprivate _setDetailsVisible(value: boolean) {\n\t\tthis._storageService.store('expandSuggestionDocs', value, StorageScope.GLOBAL, StorageTarget.USER);\n\t}\n\n\tforceRenderingAbove() {\n\t\tif (!this._forceRenderingAbove) {\n\t\t\tthis._forceRenderingAbove = true;\n\t\t\tthis._layout(this._persistedSize.restore());\n\t\t}\n\t}\n\n\tstopForceRenderingAbove() {\n\t\tthis._forceRenderingAbove = false;\n\t}\n}\n\nexport class SuggestContentWidget implements IContentWidget {\n\n\treadonly allowEditorOverflow = true;\n\treadonly suppressMouseDown = false;\n\n\tprivate _position?: IPosition | null;\n\tprivate _preference?: ContentWidgetPositionPreference;\n\tprivate _preferenceLocked = false;\n\n\tprivate _added: boolean = false;\n\tprivate _hidden: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _widget: SuggestWidget,\n\t\tprivate readonly _editor: ICodeEditor\n\t) { }\n\n\tdispose(): void {\n\t\tif (this._added) {\n\t\t\tthis._added = false;\n\t\t\tthis._editor.removeContentWidget(this);\n\t\t}\n\t}\n\n\tgetId(): string {\n\t\treturn 'editor.widget.suggestWidget';\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._widget.element.domNode;\n\t}\n\n\tshow(): void {\n\t\tthis._hidden = false;\n\t\tif (!this._added) {\n\t\t\tthis._added = true;\n\t\t\tthis._editor.addContentWidget(this);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (!this._hidden) {\n\t\t\tthis._hidden = true;\n\t\t\tthis.layout();\n\t\t}\n\t}\n\n\tlayout(): void {\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (this._hidden || !this._position || !this._preference) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._position,\n\t\t\tpreference: [this._preference]\n\t\t};\n\t}\n\n\tbeforeRender() {\n\t\tconst { height, width } = this._widget.element.size;\n\t\tconst { borderWidth, horizontalPadding } = this._widget.getLayoutInfo();\n\t\treturn new dom.Dimension(width + 2 * borderWidth + horizontalPadding, height + 2 * borderWidth);\n\t}\n\n\tafterRender(position: ContentWidgetPositionPreference | null) {\n\t\tthis._widget._afterRender(position);\n\t}\n\n\tsetPreference(preference: ContentWidgetPositionPreference) {\n\t\tif (!this._preferenceLocked) {\n\t\t\tthis._preference = preference;\n\t\t}\n\t}\n\n\tlockPreference() {\n\t\tthis._preferenceLocked = true;\n\t}\n\n\tunlockPreference() {\n\t\tthis._preferenceLocked = false;\n\t}\n\n\tsetPosition(position: IPosition | null): void {\n\t\tthis._position = position;\n\t}\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 { CancelablePromise, createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { getDocumentRangeSemanticTokens, hasDocumentRangeSemanticTokensProvider } from 'vs/editor/common/services/getSemanticTokens';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { isSemanticColoringEnabled, SEMANTIC_HIGHLIGHTING_SETTING_ID } from 'vs/editor/common/services/modelService';\nimport { toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nclass ViewportSemanticTokensContribution extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.viewportSemanticTokens';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _provider: LanguageFeatureRegistry<DocumentRangeSemanticTokensProvider>;\n\tprivate readonly _debounceInformation: IFeatureDebounceInformation;\n\tprivate readonly _tokenizeViewport: RunOnceScheduler;\n\tprivate _outstandingRequests: CancelablePromise<any>[];\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IModelService private readonly _modelService: IModelService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._provider = languageFeaturesService.documentRangeSemanticTokensProvider;\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(this._provider, 'DocumentRangeSemanticTokens', { min: 100, max: 500 });\n\t\tthis._tokenizeViewport = this._register(new RunOnceScheduler(() => this._tokenizeViewportNow(), 100));\n\t\tthis._outstandingRequests = [];\n\t\tconst scheduleTokenizeViewport = () => {\n\t\t\tif (this._editor.hasModel()) {\n\t\t\t\tthis._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()));\n\t\t\t}\n\t\t};\n\t\tthis._register(this._editor.onDidScrollChange(() => {\n\t\t\tscheduleTokenizeViewport();\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeModel(() => {\n\t\t\tthis._cancelAll();\n\t\t\tscheduleTokenizeViewport();\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeModelContent((e) => {\n\t\t\tthis._cancelAll();\n\t\t\tscheduleTokenizeViewport();\n\t\t}));\n\t\tthis._register(this._provider.onDidChange(() => {\n\t\t\tthis._cancelAll();\n\t\t\tscheduleTokenizeViewport();\n\t\t}));\n\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)) {\n\t\t\t\tthis._cancelAll();\n\t\t\t\tscheduleTokenizeViewport();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._themeService.onDidColorThemeChange(() => {\n\t\t\tthis._cancelAll();\n\t\t\tscheduleTokenizeViewport();\n\t\t}));\n\t}\n\n\tprivate _cancelAll(): void {\n\t\tfor (const request of this._outstandingRequests) {\n\t\t\trequest.cancel();\n\t\t}\n\t\tthis._outstandingRequests = [];\n\t}\n\n\tprivate _removeOutstandingRequest(req: CancelablePromise<any>): void {\n\t\tfor (let i = 0, len = this._outstandingRequests.length; i < len; i++) {\n\t\t\tif (this._outstandingRequests[i] === req) {\n\t\t\t\tthis._outstandingRequests.splice(i, 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _tokenizeViewportNow(): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\tif (model.hasCompleteSemanticTokens()) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isSemanticColoringEnabled(model, this._themeService, this._configurationService)) {\n\t\t\tif (model.hasSomeSemanticTokens()) {\n\t\t\t\tmodel.setSemanticTokens(null, false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (!hasDocumentRangeSemanticTokensProvider(this._provider, model)) {\n\t\t\tif (model.hasSomeSemanticTokens()) {\n\t\t\t\tmodel.setSemanticTokens(null, false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\n\t\tthis._outstandingRequests = this._outstandingRequests.concat(visibleRanges.map(range => this._requestRange(model, range)));\n\t}\n\n\tprivate _requestRange(model: ITextModel, range: Range): CancelablePromise<any> {\n\t\tconst requestVersionId = model.getVersionId();\n\t\tconst request = createCancelablePromise(token => Promise.resolve(getDocumentRangeSemanticTokens(this._provider, model, range, token)));\n\t\tconst sw = new StopWatch(false);\n\t\trequest.then((r) => {\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\tif (!r || !r.tokens || model.isDisposed() || model.getVersionId() !== requestVersionId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { provider, tokens: result } = r;\n\t\t\tconst styling = this._modelService.getSemanticTokensProviderStyling(provider);\n\t\t\tmodel.setPartialSemanticTokens(range, toMultilineTokens2(result, styling, model.getLanguageId()));\n\t\t}).then(() => this._removeOutstandingRequest(request), () => this._removeOutstandingRequest(request));\n\t\treturn request;\n\t}\n}\n\nregisterEditorContribution(ViewportSemanticTokensContribution.ID, ViewportSemanticTokensContribution);\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport * as arrays from 'vs/base/common/arrays';\nimport { CancelablePromise, createCancelablePromise, first, timeout } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, registerEditorContribution, registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IModelDeltaDecoration, ITextModel, MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProvider } from 'vs/editor/common/languages';\nimport * as nls from 'vs/nls';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { activeContrastBorder, editorSelectionHighlight, editorSelectionHighlightBorder, minimapSelectionOccurrenceHighlight, overviewRulerSelectionHighlightForeground, registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nconst editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations.'), true);\nconst editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations.'), true);\nconst editorWordHighlightBorder = registerColor('editor.wordHighlightBorder', { light: null, dark: null, hc: activeContrastBorder }, nls.localize('wordHighlightBorder', 'Border color of a symbol during read-access, like reading a variable.'));\nconst editorWordHighlightStrongBorder = registerColor('editor.wordHighlightStrongBorder', { light: null, dark: null, hc: activeContrastBorder }, nls.localize('wordHighlightStrongBorder', 'Border color of a symbol during write-access, like writing to a variable.'));\nconst overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hc: '#A0A0A0CC' }, nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true);\nconst overviewRulerWordHighlightStrongForeground = registerColor('editorOverviewRuler.wordHighlightStrongForeground', { dark: '#C0A0C0CC', light: '#C0A0C0CC', hc: '#C0A0C0CC' }, nls.localize('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true);\nconst ctxHasWordHighlights = new RawContextKey<boolean>('hasWordHighlights', false);\n\nexport function getOccurrencesAtPosition(registry: LanguageFeatureRegistry<DocumentHighlightProvider>, model: ITextModel, position: Position, token: CancellationToken): Promise<DocumentHighlight[] | null | undefined> {\n\n\tconst orderedByScore = registry.ordered(model);\n\n\t// in order of score ask the occurrences provider\n\t// until someone response with a good result\n\t// (good = none empty array)\n\treturn first<DocumentHighlight[] | null | undefined>(orderedByScore.map(provider => () => {\n\t\treturn Promise.resolve(provider.provideDocumentHighlights(model, position, token))\n\t\t\t.then(undefined, onUnexpectedExternalError);\n\t}), arrays.isNonEmptyArray);\n}\n\ninterface IOccurenceAtPositionRequest {\n\treadonly result: Promise<DocumentHighlight[]>;\n\tisValid(model: ITextModel, selection: Selection, decorationIds: string[]): boolean;\n\tcancel(): void;\n}\n\nabstract class OccurenceAtPositionRequest implements IOccurenceAtPositionRequest {\n\n\tprivate readonly _wordRange: Range | null;\n\tprivate _result: CancelablePromise<DocumentHighlight[]> | null;\n\n\tconstructor(private readonly _model: ITextModel, private readonly _selection: Selection, private readonly _wordSeparators: string) {\n\t\tthis._wordRange = this._getCurrentWordRange(_model, _selection);\n\t\tthis._result = null;\n\t}\n\n\tget result() {\n\t\tif (!this._result) {\n\t\t\tthis._result = createCancelablePromise(token => this._compute(this._model, this._selection, this._wordSeparators, token));\n\t\t}\n\t\treturn this._result;\n\n\t}\n\n\tprotected abstract _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise<DocumentHighlight[]>;\n\n\tprivate _getCurrentWordRange(model: ITextModel, selection: Selection): Range | null {\n\t\tconst word = model.getWordAtPosition(selection.getPosition());\n\t\tif (word) {\n\t\t\treturn new Range(selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic isValid(model: ITextModel, selection: Selection, decorationIds: string[]): boolean {\n\n\t\tconst lineNumber = selection.startLineNumber;\n\t\tconst startColumn = selection.startColumn;\n\t\tconst endColumn = selection.endColumn;\n\t\tconst currentWordRange = this._getCurrentWordRange(model, selection);\n\n\t\tlet requestIsValid = Boolean(this._wordRange && this._wordRange.equalsRange(currentWordRange));\n\n\t\t// Even if we are on a different word, if that word is in the decorations ranges, the request is still valid\n\t\t// (Same symbol)\n\t\tfor (let i = 0, len = decorationIds.length; !requestIsValid && i < len; i++) {\n\t\t\tlet range = model.getDecorationRange(decorationIds[i]);\n\t\t\tif (range && range.startLineNumber === lineNumber) {\n\t\t\t\tif (range.startColumn <= startColumn && range.endColumn >= endColumn) {\n\t\t\t\t\trequestIsValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn requestIsValid;\n\t}\n\n\tpublic cancel(): void {\n\t\tthis.result.cancel();\n\t}\n}\n\nclass SemanticOccurenceAtPositionRequest extends OccurenceAtPositionRequest {\n\n\tprivate readonly _providers: LanguageFeatureRegistry<DocumentHighlightProvider>;\n\n\tconstructor(model: ITextModel, selection: Selection, wordSeparators: string, providers: LanguageFeatureRegistry<DocumentHighlightProvider>) {\n\t\tsuper(model, selection, wordSeparators);\n\t\tthis._providers = providers;\n\t}\n\n\tprotected _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise<DocumentHighlight[]> {\n\t\treturn getOccurrencesAtPosition(this._providers, model, selection.getPosition(), token).then(value => value || []);\n\t}\n}\n\nclass TextualOccurenceAtPositionRequest extends OccurenceAtPositionRequest {\n\n\tprivate readonly _selectionIsEmpty: boolean;\n\n\tconstructor(model: ITextModel, selection: Selection, wordSeparators: string) {\n\t\tsuper(model, selection, wordSeparators);\n\t\tthis._selectionIsEmpty = selection.isEmpty();\n\t}\n\n\tprotected _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise<DocumentHighlight[]> {\n\t\treturn timeout(250, token).then(() => {\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst word = model.getWordAtPosition(selection.getPosition());\n\n\t\t\tif (!word || word.word.length > 1000) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst matches = model.findMatches(word.word, true, false, true, wordSeparators, false);\n\t\t\treturn matches.map(m => {\n\t\t\t\treturn {\n\t\t\t\t\trange: m.range,\n\t\t\t\t\tkind: DocumentHighlightKind.Text\n\t\t\t\t};\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic override isValid(model: ITextModel, selection: Selection, decorationIds: string[]): boolean {\n\t\tconst currentSelectionIsEmpty = selection.isEmpty();\n\t\tif (this._selectionIsEmpty !== currentSelectionIsEmpty) {\n\t\t\treturn false;\n\t\t}\n\t\treturn super.isValid(model, selection, decorationIds);\n\t}\n}\n\nfunction computeOccurencesAtPosition(registry: LanguageFeatureRegistry<DocumentHighlightProvider>, model: ITextModel, selection: Selection, wordSeparators: string): IOccurenceAtPositionRequest {\n\tif (registry.has(model)) {\n\t\treturn new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators, registry);\n\t}\n\treturn new TextualOccurenceAtPositionRequest(model, selection, wordSeparators);\n}\n\nregisterModelAndPositionCommand('_executeDocumentHighlights', (accessor, model, position) => {\n\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\treturn getOccurrencesAtPosition(languageFeaturesService.documentHighlightProvider, model, position, CancellationToken.None);\n});\n\nclass WordHighlighter {\n\n\tprivate readonly editor: IActiveCodeEditor;\n\tprivate readonly providers: LanguageFeatureRegistry<DocumentHighlightProvider>;\n\tprivate occurrencesHighlight: boolean;\n\tprivate readonly model: ITextModel;\n\tprivate _decorationIds: string[];\n\tprivate readonly toUnhook = new DisposableStore();\n\n\tprivate workerRequestTokenId: number = 0;\n\tprivate workerRequest: IOccurenceAtPositionRequest | null;\n\tprivate workerRequestCompleted: boolean = false;\n\tprivate workerRequestValue: DocumentHighlight[] = [];\n\n\tprivate lastCursorPositionChangeTime: number = 0;\n\tprivate renderDecorationsTimer: any = -1;\n\n\tprivate readonly _hasWordHighlights: IContextKey<boolean>;\n\tprivate _ignorePositionChangeEvent: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, providers: LanguageFeatureRegistry<DocumentHighlightProvider>, contextKeyService: IContextKeyService) {\n\t\tthis.editor = editor;\n\t\tthis.providers = providers;\n\t\tthis._hasWordHighlights = ctxHasWordHighlights.bindTo(contextKeyService);\n\t\tthis._ignorePositionChangeEvent = false;\n\t\tthis.occurrencesHighlight = this.editor.getOption(EditorOption.occurrencesHighlight);\n\t\tthis.model = this.editor.getModel();\n\t\tthis.toUnhook.add(editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\n\t\t\tif (this._ignorePositionChangeEvent) {\n\t\t\t\t// We are changing the position => ignore this event\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.occurrencesHighlight) {\n\t\t\t\t// Early exit if nothing needs to be done!\n\t\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onPositionChanged(e);\n\t\t}));\n\t\tthis.toUnhook.add(editor.onDidChangeModelContent((e) => {\n\t\t\tthis._stopAll();\n\t\t}));\n\t\tthis.toUnhook.add(editor.onDidChangeConfiguration((e) => {\n\t\t\tlet newValue = this.editor.getOption(EditorOption.occurrencesHighlight);\n\t\t\tif (this.occurrencesHighlight !== newValue) {\n\t\t\t\tthis.occurrencesHighlight = newValue;\n\t\t\t\tthis._stopAll();\n\t\t\t}\n\t\t}));\n\n\t\tthis._decorationIds = [];\n\t\tthis.workerRequestTokenId = 0;\n\t\tthis.workerRequest = null;\n\t\tthis.workerRequestCompleted = false;\n\n\t\tthis.lastCursorPositionChangeTime = 0;\n\t\tthis.renderDecorationsTimer = -1;\n\t}\n\n\tpublic hasDecorations(): boolean {\n\t\treturn (this._decorationIds.length > 0);\n\t}\n\n\tpublic restore(): void {\n\t\tif (!this.occurrencesHighlight) {\n\t\t\treturn;\n\t\t}\n\t\tthis._run();\n\t}\n\n\tprivate _getSortedHighlights(): Range[] {\n\t\treturn arrays.coalesce(\n\t\t\tthis._decorationIds\n\t\t\t\t.map((id) => this.model.getDecorationRange(id))\n\t\t\t\t.sort(Range.compareRangesUsingStarts)\n\t\t);\n\t}\n\n\tpublic moveNext() {\n\t\tlet highlights = this._getSortedHighlights();\n\t\tlet index = highlights.findIndex((range) => range.containsPosition(this.editor.getPosition()));\n\t\tlet newIndex = ((index + 1) % highlights.length);\n\t\tlet dest = highlights[newIndex];\n\t\ttry {\n\t\t\tthis._ignorePositionChangeEvent = true;\n\t\t\tthis.editor.setPosition(dest.getStartPosition());\n\t\t\tthis.editor.revealRangeInCenterIfOutsideViewport(dest);\n\t\t\tconst word = this._getWord();\n\t\t\tif (word) {\n\t\t\t\tconst lineContent = this.editor.getModel().getLineContent(dest.startLineNumber);\n\t\t\t\talert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._ignorePositionChangeEvent = false;\n\t\t}\n\t}\n\n\tpublic moveBack() {\n\t\tlet highlights = this._getSortedHighlights();\n\t\tlet index = highlights.findIndex((range) => range.containsPosition(this.editor.getPosition()));\n\t\tlet newIndex = ((index - 1 + highlights.length) % highlights.length);\n\t\tlet dest = highlights[newIndex];\n\t\ttry {\n\t\t\tthis._ignorePositionChangeEvent = true;\n\t\t\tthis.editor.setPosition(dest.getStartPosition());\n\t\t\tthis.editor.revealRangeInCenterIfOutsideViewport(dest);\n\t\t\tconst word = this._getWord();\n\t\t\tif (word) {\n\t\t\t\tconst lineContent = this.editor.getModel().getLineContent(dest.startLineNumber);\n\t\t\t\talert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._ignorePositionChangeEvent = false;\n\t\t}\n\t}\n\n\tprivate _removeDecorations(): void {\n\t\tif (this._decorationIds.length > 0) {\n\t\t\t// remove decorations\n\t\t\tthis._decorationIds = this.editor.deltaDecorations(this._decorationIds, []);\n\t\t\tthis._hasWordHighlights.set(false);\n\t\t}\n\t}\n\n\tprivate _stopAll(): void {\n\t\t// Remove any existing decorations\n\t\tthis._removeDecorations();\n\n\t\t// Cancel any renderDecorationsTimer\n\t\tif (this.renderDecorationsTimer !== -1) {\n\t\t\tclearTimeout(this.renderDecorationsTimer);\n\t\t\tthis.renderDecorationsTimer = -1;\n\t\t}\n\n\t\t// Cancel any worker request\n\t\tif (this.workerRequest !== null) {\n\t\t\tthis.workerRequest.cancel();\n\t\t\tthis.workerRequest = null;\n\t\t}\n\n\t\t// Invalidate any worker request callback\n\t\tif (!this.workerRequestCompleted) {\n\t\t\tthis.workerRequestTokenId++;\n\t\t\tthis.workerRequestCompleted = true;\n\t\t}\n\t}\n\n\tprivate _onPositionChanged(e: ICursorPositionChangedEvent): void {\n\n\t\t// disabled\n\t\tif (!this.occurrencesHighlight) {\n\t\t\tthis._stopAll();\n\t\t\treturn;\n\t\t}\n\n\t\t// ignore typing & other\n\t\tif (e.reason !== CursorChangeReason.Explicit) {\n\t\t\tthis._stopAll();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._run();\n\t}\n\n\tprivate _getWord(): IWordAtPosition | null {\n\t\tlet editorSelection = this.editor.getSelection();\n\t\tlet lineNumber = editorSelection.startLineNumber;\n\t\tlet startColumn = editorSelection.startColumn;\n\n\t\treturn this.model.getWordAtPosition({\n\t\t\tlineNumber: lineNumber,\n\t\t\tcolumn: startColumn\n\t\t});\n\t}\n\n\tprivate _run(): void {\n\t\tlet editorSelection = this.editor.getSelection();\n\n\t\t// ignore multiline selection\n\t\tif (editorSelection.startLineNumber !== editorSelection.endLineNumber) {\n\t\t\tthis._stopAll();\n\t\t\treturn;\n\t\t}\n\n\t\tlet startColumn = editorSelection.startColumn;\n\t\tlet endColumn = editorSelection.endColumn;\n\n\t\tconst word = this._getWord();\n\n\t\t// The selection must be inside a word or surround one word at most\n\t\tif (!word || word.startColumn > startColumn || word.endColumn < endColumn) {\n\t\t\tthis._stopAll();\n\t\t\treturn;\n\t\t}\n\n\t\t// All the effort below is trying to achieve this:\n\t\t// - when cursor is moved to a word, trigger immediately a findOccurrences request\n\t\t// - 250ms later after the last cursor move event, render the occurrences\n\t\t// - no flickering!\n\n\t\tconst workerRequestIsValid = (this.workerRequest && this.workerRequest.isValid(this.model, editorSelection, this._decorationIds));\n\n\t\t// There are 4 cases:\n\t\t// a) old workerRequest is valid & completed, renderDecorationsTimer fired\n\t\t// b) old workerRequest is valid & completed, renderDecorationsTimer not fired\n\t\t// c) old workerRequest is valid, but not completed\n\t\t// d) old workerRequest is not valid\n\n\t\t// For a) no action is needed\n\t\t// For c), member 'lastCursorPositionChangeTime' will be used when installing the timer so no action is needed\n\n\t\tthis.lastCursorPositionChangeTime = (new Date()).getTime();\n\n\t\tif (workerRequestIsValid) {\n\t\t\tif (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) {\n\t\t\t\t// case b)\n\t\t\t\t// Delay the firing of renderDecorationsTimer by an extra 250 ms\n\t\t\t\tclearTimeout(this.renderDecorationsTimer);\n\t\t\t\tthis.renderDecorationsTimer = -1;\n\t\t\t\tthis._beginRenderDecorations();\n\t\t\t}\n\t\t} else {\n\t\t\t// case d)\n\t\t\t// Stop all previous actions and start fresh\n\t\t\tthis._stopAll();\n\n\t\t\tlet myRequestId = ++this.workerRequestTokenId;\n\t\t\tthis.workerRequestCompleted = false;\n\n\t\t\tthis.workerRequest = computeOccurencesAtPosition(this.providers, this.model, this.editor.getSelection(), this.editor.getOption(EditorOption.wordSeparators));\n\n\t\t\tthis.workerRequest.result.then(data => {\n\t\t\t\tif (myRequestId === this.workerRequestTokenId) {\n\t\t\t\t\tthis.workerRequestCompleted = true;\n\t\t\t\t\tthis.workerRequestValue = data || [];\n\t\t\t\t\tthis._beginRenderDecorations();\n\t\t\t\t}\n\t\t\t}, onUnexpectedError);\n\t\t}\n\t}\n\n\tprivate _beginRenderDecorations(): void {\n\t\tlet currentTime = (new Date()).getTime();\n\t\tlet minimumRenderTime = this.lastCursorPositionChangeTime + 250;\n\n\t\tif (currentTime >= minimumRenderTime) {\n\t\t\t// Synchronous\n\t\t\tthis.renderDecorationsTimer = -1;\n\t\t\tthis.renderDecorations();\n\t\t} else {\n\t\t\t// Asynchronous\n\t\t\tthis.renderDecorationsTimer = setTimeout(() => {\n\t\t\t\tthis.renderDecorations();\n\t\t\t}, (minimumRenderTime - currentTime));\n\t\t}\n\t}\n\n\tprivate renderDecorations(): void {\n\t\tthis.renderDecorationsTimer = -1;\n\t\tlet decorations: IModelDeltaDecoration[] = [];\n\t\tfor (const info of this.workerRequestValue) {\n\t\t\tif (info.range) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: info.range,\n\t\t\t\t\toptions: WordHighlighter._getDecorationOptions(info.kind)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthis._decorationIds = this.editor.deltaDecorations(this._decorationIds, decorations);\n\t\tthis._hasWordHighlights.set(this.hasDecorations());\n\t}\n\n\tprivate static _getDecorationOptions(kind: DocumentHighlightKind | undefined): ModelDecorationOptions {\n\t\tif (kind === DocumentHighlightKind.Write) {\n\t\t\treturn this._WRITE_OPTIONS;\n\t\t} else if (kind === DocumentHighlightKind.Text) {\n\t\t\treturn this._TEXT_OPTIONS;\n\t\t} else {\n\t\t\treturn this._REGULAR_OPTIONS;\n\t\t}\n\t}\n\n\tprivate static readonly _WRITE_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'word-highlight-strong',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'wordHighlightStrong',\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerWordHighlightStrongForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t},\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapSelectionOccurrenceHighlight),\n\t\t\tposition: MinimapPosition.Inline\n\t\t},\n\t});\n\n\tprivate static readonly _TEXT_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'selection-highlight',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'selectionHighlight',\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerSelectionHighlightForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t},\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapSelectionOccurrenceHighlight),\n\t\t\tposition: MinimapPosition.Inline\n\t\t},\n\t});\n\n\tprivate static readonly _REGULAR_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'word-highlight',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'wordHighlight',\n\t\toverviewRuler: {\n\t\t\tcolor: themeColorFromId(overviewRulerWordHighlightForeground),\n\t\t\tposition: OverviewRulerLane.Center\n\t\t},\n\t\tminimap: {\n\t\t\tcolor: themeColorFromId(minimapSelectionOccurrenceHighlight),\n\t\t\tposition: MinimapPosition.Inline\n\t\t},\n\t});\n\n\tpublic dispose(): void {\n\t\tthis._stopAll();\n\t\tthis.toUnhook.dispose();\n\t}\n}\n\nclass WordHighlighterContribution extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.wordHighlighter';\n\n\tpublic static get(editor: ICodeEditor): WordHighlighterContribution | null {\n\t\treturn editor.getContribution<WordHighlighterContribution>(WordHighlighterContribution.ID);\n\t}\n\n\tprivate wordHighlighter: WordHighlighter | null;\n\n\tconstructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService) {\n\t\tsuper();\n\t\tthis.wordHighlighter = null;\n\t\tconst createWordHighlighterIfPossible = () => {\n\t\t\tif (editor.hasModel()) {\n\t\t\t\tthis.wordHighlighter = new WordHighlighter(editor, languageFeaturesService.documentHighlightProvider, contextKeyService);\n\t\t\t}\n\t\t};\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tif (this.wordHighlighter) {\n\t\t\t\tthis.wordHighlighter.dispose();\n\t\t\t\tthis.wordHighlighter = null;\n\t\t\t}\n\t\t\tcreateWordHighlighterIfPossible();\n\t\t}));\n\t\tcreateWordHighlighterIfPossible();\n\t}\n\n\tpublic saveViewState(): boolean {\n\t\tif (this.wordHighlighter && this.wordHighlighter.hasDecorations()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic moveNext() {\n\t\tif (this.wordHighlighter) {\n\t\t\tthis.wordHighlighter.moveNext();\n\t\t}\n\t}\n\n\tpublic moveBack() {\n\t\tif (this.wordHighlighter) {\n\t\t\tthis.wordHighlighter.moveBack();\n\t\t}\n\t}\n\n\tpublic restoreViewState(state: boolean | undefined): void {\n\t\tif (this.wordHighlighter && state) {\n\t\t\tthis.wordHighlighter.restore();\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this.wordHighlighter) {\n\t\t\tthis.wordHighlighter.dispose();\n\t\t\tthis.wordHighlighter = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n}\n\n\nclass WordHighlightNavigationAction extends EditorAction {\n\n\tprivate readonly _isNext: boolean;\n\n\tconstructor(next: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._isNext = next;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst controller = WordHighlighterContribution.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isNext) {\n\t\t\tcontroller.moveNext();\n\t\t} else {\n\t\t\tcontroller.moveBack();\n\t\t}\n\t}\n}\n\nclass NextWordHighlightAction extends WordHighlightNavigationAction {\n\tconstructor() {\n\t\tsuper(true, {\n\t\t\tid: 'editor.action.wordHighlight.next',\n\t\t\tlabel: nls.localize('wordHighlight.next.label', \"Go to Next Symbol Highlight\"),\n\t\t\talias: 'Go to Next Symbol Highlight',\n\t\t\tprecondition: ctxHasWordHighlights,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyCode.F7,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass PrevWordHighlightAction extends WordHighlightNavigationAction {\n\tconstructor() {\n\t\tsuper(false, {\n\t\t\tid: 'editor.action.wordHighlight.prev',\n\t\t\tlabel: nls.localize('wordHighlight.previous.label', \"Go to Previous Symbol Highlight\"),\n\t\t\talias: 'Go to Previous Symbol Highlight',\n\t\t\tprecondition: ctxHasWordHighlights,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F7,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass TriggerWordHighlightAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.wordHighlight.trigger',\n\t\t\tlabel: nls.localize('wordHighlight.trigger.label', \"Trigger Symbol Highlight\"),\n\t\t\talias: 'Trigger Symbol Highlight',\n\t\t\tprecondition: ctxHasWordHighlights.toNegated(),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tconst controller = WordHighlighterContribution.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontroller.restoreViewState(true);\n\t}\n}\n\nregisterEditorContribution(WordHighlighterContribution.ID, WordHighlighterContribution);\nregisterEditorAction(NextWordHighlightAction);\nregisterEditorAction(PrevWordHighlightAction);\nregisterEditorAction(TriggerWordHighlightAction);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst selectionHighlight = theme.getColor(editorSelectionHighlight);\n\tif (selectionHighlight) {\n\t\tcollector.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${selectionHighlight}; }`);\n\t\tcollector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`);\n\t}\n\n\tconst wordHighlight = theme.getColor(editorWordHighlight);\n\tif (wordHighlight) {\n\t\tcollector.addRule(`.monaco-editor .wordHighlight { background-color: ${wordHighlight}; }`);\n\t}\n\n\tconst wordHighlightStrong = theme.getColor(editorWordHighlightStrong);\n\tif (wordHighlightStrong) {\n\t\tcollector.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`);\n\t}\n\n\tconst selectionHighlightBorder = theme.getColor(editorSelectionHighlightBorder);\n\tif (selectionHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .selectionHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${selectionHighlightBorder}; box-sizing: border-box; }`);\n\t}\n\n\tconst wordHighlightBorder = theme.getColor(editorWordHighlightBorder);\n\tif (wordHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .wordHighlight { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${wordHighlightBorder}; box-sizing: border-box; }`);\n\t}\n\n\tconst wordHighlightStrongBorder = theme.getColor(editorWordHighlightStrongBorder);\n\tif (wordHighlightStrongBorder) {\n\t\tcollector.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${wordHighlightStrongBorder}; box-sizing: border-box; }`);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IHorizontalSashLayoutProvider, ISashEvent, Orientation, Sash, SashState } from 'vs/base/browser/ui/sash/sash';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { IdGenerator } from 'vs/base/common/idGenerator';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport * as objects from 'vs/base/common/objects';\nimport 'vs/css!./zoneWidget';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser';\nimport { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\n\nexport interface IOptions {\n\tshowFrame?: boolean;\n\tshowArrow?: boolean;\n\tframeWidth?: number;\n\tclassName?: string;\n\tisAccessible?: boolean;\n\tisResizeable?: boolean;\n\tframeColor?: Color;\n\tarrowColor?: Color;\n\tkeepEditorSelection?: boolean;\n}\n\nexport interface IStyles {\n\tframeColor?: Color | null;\n\tarrowColor?: Color | null;\n}\n\nconst defaultColor = new Color(new RGBA(0, 122, 204));\n\nconst defaultOptions: IOptions = {\n\tshowArrow: true,\n\tshowFrame: true,\n\tclassName: '',\n\tframeColor: defaultColor,\n\tarrowColor: defaultColor,\n\tkeepEditorSelection: false\n};\n\nconst WIDGET_ID = 'vs.editor.contrib.zoneWidget';\n\nexport class ViewZoneDelegate implements IViewZone {\n\n\tdomNode: HTMLElement;\n\tid: string = ''; // A valid zone id should be greater than 0\n\tafterLineNumber: number;\n\tafterColumn: number;\n\theightInLines: number;\n\n\tprivate readonly _onDomNodeTop: (top: number) => void;\n\tprivate readonly _onComputedHeight: (height: number) => void;\n\n\tconstructor(domNode: HTMLElement, afterLineNumber: number, afterColumn: number, heightInLines: number,\n\t\tonDomNodeTop: (top: number) => void,\n\t\tonComputedHeight: (height: number) => void\n\t) {\n\t\tthis.domNode = domNode;\n\t\tthis.afterLineNumber = afterLineNumber;\n\t\tthis.afterColumn = afterColumn;\n\t\tthis.heightInLines = heightInLines;\n\t\tthis._onDomNodeTop = onDomNodeTop;\n\t\tthis._onComputedHeight = onComputedHeight;\n\t}\n\n\tonDomNodeTop(top: number): void {\n\t\tthis._onDomNodeTop(top);\n\t}\n\n\tonComputedHeight(height: number): void {\n\t\tthis._onComputedHeight(height);\n\t}\n}\n\nexport class OverlayWidgetDelegate implements IOverlayWidget {\n\n\tprivate readonly _id: string;\n\tprivate readonly _domNode: HTMLElement;\n\n\tconstructor(id: string, domNode: HTMLElement) {\n\t\tthis._id = id;\n\t\tthis._domNode = domNode;\n\t}\n\n\tgetId(): string {\n\t\treturn this._id;\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tgetPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n}\n\nclass Arrow {\n\n\tprivate static readonly _IdGenerator = new IdGenerator('.arrow-decoration-');\n\n\tprivate readonly _ruleName = Arrow._IdGenerator.nextId();\n\tprivate _decorations: string[] = [];\n\tprivate _color: string | null = null;\n\tprivate _height: number = -1;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) {\n\t\t//\n\t}\n\n\tdispose(): void {\n\t\tthis.hide();\n\t\tdom.removeCSSRulesContainingSelector(this._ruleName);\n\t}\n\n\tset color(value: string) {\n\t\tif (this._color !== value) {\n\t\t\tthis._color = value;\n\t\t\tthis._updateStyle();\n\t\t}\n\t}\n\n\tset height(value: number) {\n\t\tif (this._height !== value) {\n\t\t\tthis._height = value;\n\t\t\tthis._updateStyle();\n\t\t}\n\t}\n\n\tprivate _updateStyle(): void {\n\t\tdom.removeCSSRulesContainingSelector(this._ruleName);\n\t\tdom.createCSSRule(\n\t\t\t`.monaco-editor ${this._ruleName}`,\n\t\t\t`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `\n\t\t);\n\t}\n\n\tshow(where: IPosition): void {\n\n\t\tif (where.column === 1) {\n\t\t\t// the arrow isn't pretty at column 1 and we need to push it out a little\n\t\t\twhere = { lineNumber: where.lineNumber, column: 2 };\n\t\t}\n\n\t\tthis._decorations = this._editor.deltaDecorations(\n\t\t\tthis._decorations,\n\t\t\t[{ range: Range.fromPositions(where), options: { description: 'zone-widget-arrow', className: this._ruleName, stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } }]\n\t\t);\n\t}\n\n\thide(): void {\n\t\tthis._editor.deltaDecorations(this._decorations, []);\n\t}\n}\n\nexport abstract class ZoneWidget implements IHorizontalSashLayoutProvider {\n\n\tprivate _arrow: Arrow | null = null;\n\tprivate _overlayWidget: OverlayWidgetDelegate | null = null;\n\tprivate _resizeSash: Sash | null = null;\n\tprivate _positionMarkerId: string[] = [];\n\n\tprotected _viewZone: ViewZoneDelegate | null = null;\n\tprotected readonly _disposables = new DisposableStore();\n\n\tcontainer: HTMLElement | null = null;\n\tdomNode: HTMLElement;\n\teditor: ICodeEditor;\n\toptions: IOptions;\n\n\n\tconstructor(editor: ICodeEditor, options: IOptions = {}) {\n\t\tthis.editor = editor;\n\t\tthis.options = objects.deepClone(options);\n\t\tobjects.mixin(this.options, defaultOptions, false);\n\t\tthis.domNode = document.createElement('div');\n\t\tif (!this.options.isAccessible) {\n\t\t\tthis.domNode.setAttribute('aria-hidden', 'true');\n\t\t\tthis.domNode.setAttribute('role', 'presentation');\n\t\t}\n\n\t\tthis._disposables.add(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => {\n\t\t\tconst width = this._getWidth(info);\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis.domNode.style.left = this._getLeft(info) + 'px';\n\t\t\tthis._onWidth(width);\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tif (this._overlayWidget) {\n\t\t\tthis.editor.removeOverlayWidget(this._overlayWidget);\n\t\t\tthis._overlayWidget = null;\n\t\t}\n\n\t\tif (this._viewZone) {\n\t\t\tthis.editor.changeViewZones(accessor => {\n\t\t\t\tif (this._viewZone) {\n\t\t\t\t\taccessor.removeZone(this._viewZone.id);\n\t\t\t\t}\n\t\t\t\tthis._viewZone = null;\n\t\t\t});\n\t\t}\n\n\t\tthis.editor.deltaDecorations(this._positionMarkerId, []);\n\t\tthis._positionMarkerId = [];\n\n\t\tthis._disposables.dispose();\n\t}\n\n\tcreate(): void {\n\n\t\tthis.domNode.classList.add('zone-widget');\n\t\tif (this.options.className) {\n\t\t\tthis.domNode.classList.add(this.options.className);\n\t\t}\n\n\t\tthis.container = document.createElement('div');\n\t\tthis.container.classList.add('zone-widget-container');\n\t\tthis.domNode.appendChild(this.container);\n\t\tif (this.options.showArrow) {\n\t\t\tthis._arrow = new Arrow(this.editor);\n\t\t\tthis._disposables.add(this._arrow);\n\t\t}\n\t\tthis._fillContainer(this.container);\n\t\tthis._initSash();\n\t\tthis._applyStyles();\n\t}\n\n\tstyle(styles: IStyles): void {\n\t\tif (styles.frameColor) {\n\t\t\tthis.options.frameColor = styles.frameColor;\n\t\t}\n\t\tif (styles.arrowColor) {\n\t\t\tthis.options.arrowColor = styles.arrowColor;\n\t\t}\n\t\tthis._applyStyles();\n\t}\n\n\tprotected _applyStyles(): void {\n\t\tif (this.container && this.options.frameColor) {\n\t\t\tlet frameColor = this.options.frameColor.toString();\n\t\t\tthis.container.style.borderTopColor = frameColor;\n\t\t\tthis.container.style.borderBottomColor = frameColor;\n\t\t}\n\t\tif (this._arrow && this.options.arrowColor) {\n\t\t\tlet arrowColor = this.options.arrowColor.toString();\n\t\t\tthis._arrow.color = arrowColor;\n\t\t}\n\t}\n\n\tprivate _getWidth(info: EditorLayoutInfo): number {\n\t\treturn info.width - info.minimap.minimapWidth - info.verticalScrollbarWidth;\n\t}\n\n\tprivate _getLeft(info: EditorLayoutInfo): number {\n\t\t// If minimap is to the left, we move beyond it\n\t\tif (info.minimap.minimapWidth > 0 && info.minimap.minimapLeft === 0) {\n\t\t\treturn info.minimap.minimapWidth;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate _onViewZoneTop(top: number): void {\n\t\tthis.domNode.style.top = top + 'px';\n\t}\n\n\tprivate _onViewZoneHeight(height: number): void {\n\t\tthis.domNode.style.height = `${height}px`;\n\n\t\tif (this.container) {\n\t\t\tlet containerHeight = height - this._decoratingElementsHeight();\n\t\t\tthis.container.style.height = `${containerHeight}px`;\n\t\t\tconst layoutInfo = this.editor.getLayoutInfo();\n\t\t\tthis._doLayout(containerHeight, this._getWidth(layoutInfo));\n\t\t}\n\n\t\tif (this._resizeSash) {\n\t\t\tthis._resizeSash.layout();\n\t\t}\n\t}\n\n\tget position(): Position | undefined {\n\t\tconst [id] = this._positionMarkerId;\n\t\tif (!id) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst range = model.getDecorationRange(id);\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn range.getStartPosition();\n\t}\n\n\tprotected _isShowing: boolean = false;\n\n\tshow(rangeOrPos: IRange | IPosition, heightInLines: number): void {\n\t\tconst range = Range.isIRange(rangeOrPos) ? Range.lift(rangeOrPos) : Range.fromPositions(rangeOrPos);\n\t\tthis._isShowing = true;\n\t\tthis._showImpl(range, heightInLines);\n\t\tthis._isShowing = false;\n\t\tthis._positionMarkerId = this.editor.deltaDecorations(this._positionMarkerId, [{ range, options: ModelDecorationOptions.EMPTY }]);\n\t}\n\n\thide(): void {\n\t\tif (this._viewZone) {\n\t\t\tthis.editor.changeViewZones(accessor => {\n\t\t\t\tif (this._viewZone) {\n\t\t\t\t\taccessor.removeZone(this._viewZone.id);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._viewZone = null;\n\t\t}\n\t\tif (this._overlayWidget) {\n\t\t\tthis.editor.removeOverlayWidget(this._overlayWidget);\n\t\t\tthis._overlayWidget = null;\n\t\t}\n\t\tif (this._arrow) {\n\t\t\tthis._arrow.hide();\n\t\t}\n\t}\n\n\tprivate _decoratingElementsHeight(): number {\n\t\tlet lineHeight = this.editor.getOption(EditorOption.lineHeight);\n\t\tlet result = 0;\n\n\t\tif (this.options.showArrow) {\n\t\t\tlet arrowHeight = Math.round(lineHeight / 3);\n\t\t\tresult += 2 * arrowHeight;\n\t\t}\n\n\t\tif (this.options.showFrame) {\n\t\t\tlet frameThickness = Math.round(lineHeight / 9);\n\t\t\tresult += 2 * frameThickness;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _showImpl(where: Range, heightInLines: number): void {\n\t\tconst position = where.getStartPosition();\n\t\tconst layoutInfo = this.editor.getLayoutInfo();\n\t\tconst width = this._getWidth(layoutInfo);\n\t\tthis.domNode.style.width = `${width}px`;\n\t\tthis.domNode.style.left = this._getLeft(layoutInfo) + 'px';\n\n\t\t// Render the widget as zone (rendering) and widget (lifecycle)\n\t\tconst viewZoneDomNode = document.createElement('div');\n\t\tviewZoneDomNode.style.overflow = 'hidden';\n\t\tconst lineHeight = this.editor.getOption(EditorOption.lineHeight);\n\n\t\t// adjust heightInLines to viewport\n\t\tconst maxHeightInLines = Math.max(12, (this.editor.getLayoutInfo().height / lineHeight) * 0.8);\n\t\theightInLines = Math.min(heightInLines, maxHeightInLines);\n\n\t\tlet arrowHeight = 0;\n\t\tlet frameThickness = 0;\n\n\t\t// Render the arrow one 1/3 of an editor line height\n\t\tif (this._arrow && this.options.showArrow) {\n\t\t\tarrowHeight = Math.round(lineHeight / 3);\n\t\t\tthis._arrow.height = arrowHeight;\n\t\t\tthis._arrow.show(position);\n\t\t}\n\n\t\t// Render the frame as 1/9 of an editor line height\n\t\tif (this.options.showFrame) {\n\t\t\tframeThickness = Math.round(lineHeight / 9);\n\t\t}\n\n\t\t// insert zone widget\n\t\tthis.editor.changeViewZones((accessor: IViewZoneChangeAccessor) => {\n\t\t\tif (this._viewZone) {\n\t\t\t\taccessor.removeZone(this._viewZone.id);\n\t\t\t}\n\t\t\tif (this._overlayWidget) {\n\t\t\t\tthis.editor.removeOverlayWidget(this._overlayWidget);\n\t\t\t\tthis._overlayWidget = null;\n\t\t\t}\n\t\t\tthis.domNode.style.top = '-1000px';\n\t\t\tthis._viewZone = new ViewZoneDelegate(\n\t\t\t\tviewZoneDomNode,\n\t\t\t\tposition.lineNumber,\n\t\t\t\tposition.column,\n\t\t\t\theightInLines,\n\t\t\t\t(top: number) => this._onViewZoneTop(top),\n\t\t\t\t(height: number) => this._onViewZoneHeight(height)\n\t\t\t);\n\t\t\tthis._viewZone.id = accessor.addZone(this._viewZone);\n\t\t\tthis._overlayWidget = new OverlayWidgetDelegate(WIDGET_ID + this._viewZone.id, this.domNode);\n\t\t\tthis.editor.addOverlayWidget(this._overlayWidget);\n\t\t});\n\n\t\tif (this.container && this.options.showFrame) {\n\t\t\tconst width = this.options.frameWidth ? this.options.frameWidth : frameThickness;\n\t\t\tthis.container.style.borderTopWidth = width + 'px';\n\t\t\tthis.container.style.borderBottomWidth = width + 'px';\n\t\t}\n\n\t\tlet containerHeight = heightInLines * lineHeight - this._decoratingElementsHeight();\n\n\t\tif (this.container) {\n\t\t\tthis.container.style.top = arrowHeight + 'px';\n\t\t\tthis.container.style.height = containerHeight + 'px';\n\t\t\tthis.container.style.overflow = 'hidden';\n\t\t}\n\n\t\tthis._doLayout(containerHeight, width);\n\n\t\tif (!this.options.keepEditorSelection) {\n\t\t\tthis.editor.setSelection(where);\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tif (model) {\n\t\t\tconst revealLine = where.endLineNumber + 1;\n\t\t\tif (revealLine <= model.getLineCount()) {\n\t\t\t\t// reveal line below the zone widget\n\t\t\t\tthis.revealLine(revealLine, false);\n\t\t\t} else {\n\t\t\t\t// reveal last line atop\n\t\t\t\tthis.revealLine(model.getLineCount(), true);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected revealLine(lineNumber: number, isLastLine: boolean) {\n\t\tif (isLastLine) {\n\t\t\tthis.editor.revealLineInCenter(lineNumber, ScrollType.Smooth);\n\t\t} else {\n\t\t\tthis.editor.revealLine(lineNumber, ScrollType.Smooth);\n\t\t}\n\t}\n\n\tprotected setCssClass(className: string, classToReplace?: string): void {\n\t\tif (!this.container) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (classToReplace) {\n\t\t\tthis.container.classList.remove(classToReplace);\n\t\t}\n\n\t\tthis.container.classList.add(className);\n\n\t}\n\n\tprotected abstract _fillContainer(container: HTMLElement): void;\n\n\tprotected _onWidth(widthInPixel: number): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected _doLayout(heightInPixel: number, widthInPixel: number): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected _relayout(newHeightInLines: number): void {\n\t\tif (this._viewZone && this._viewZone.heightInLines !== newHeightInLines) {\n\t\t\tthis.editor.changeViewZones(accessor => {\n\t\t\t\tif (this._viewZone) {\n\t\t\t\t\tthis._viewZone.heightInLines = newHeightInLines;\n\t\t\t\t\taccessor.layoutZone(this._viewZone.id);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// --- sash\n\n\tprivate _initSash(): void {\n\t\tif (this._resizeSash) {\n\t\t\treturn;\n\t\t}\n\t\tthis._resizeSash = this._disposables.add(new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL }));\n\n\t\tif (!this.options.isResizeable) {\n\t\t\tthis._resizeSash.state = SashState.Disabled;\n\t\t}\n\n\t\tlet data: { startY: number; heightInLines: number } | undefined;\n\t\tthis._disposables.add(this._resizeSash.onDidStart((e: ISashEvent) => {\n\t\t\tif (this._viewZone) {\n\t\t\t\tdata = {\n\t\t\t\t\tstartY: e.startY,\n\t\t\t\t\theightInLines: this._viewZone.heightInLines,\n\t\t\t\t};\n\t\t\t}\n\t\t}));\n\n\t\tthis._disposables.add(this._resizeSash.onDidEnd(() => {\n\t\t\tdata = undefined;\n\t\t}));\n\n\t\tthis._disposables.add(this._resizeSash.onDidChange((evt: ISashEvent) => {\n\t\t\tif (data) {\n\t\t\t\tlet lineDelta = (evt.currentY - data.startY) / this.editor.getOption(EditorOption.lineHeight);\n\t\t\t\tlet roundedLineDelta = lineDelta < 0 ? Math.ceil(lineDelta) : Math.floor(lineDelta);\n\t\t\t\tlet newHeightInLines = data.heightInLines + roundedLineDelta;\n\n\t\t\t\tif (newHeightInLines > 5 && newHeightInLines < 35) {\n\t\t\t\t\tthis._relayout(newHeightInLines);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tgetHorizontalSashLeft() {\n\t\treturn 0;\n\t}\n\n\tgetHorizontalSashTop() {\n\t\treturn (this.domNode.style.height === null ? 0 : parseInt(this.domNode.style.height)) - (this._decoratingElementsHeight() / 2);\n\t}\n\n\tgetHorizontalSashWidth() {\n\t\tconst layoutInfo = this.editor.getLayoutInfo();\n\t\treturn layoutInfo.width - layoutInfo.minimap.minimapWidth;\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { ActionBar, ActionsOrientation, IActionBarOptions } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { Action } from 'vs/base/common/actions';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as objects from 'vs/base/common/objects';\nimport 'vs/css!./media/peekViewWidget';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { IOptions, IStyles, ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';\nimport * as nls from 'vs/nls';\nimport { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem';\nimport { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { activeContrastBorder, contrastBorder, editorInfoForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry';\n\nexport const IPeekViewService = createDecorator<IPeekViewService>('IPeekViewService');\nexport interface IPeekViewService {\n\treadonly _serviceBrand: undefined;\n\taddExclusiveWidget(editor: ICodeEditor, widget: PeekViewWidget): void;\n}\n\nregisterSingleton(IPeekViewService, class implements IPeekViewService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _widgets = new Map<ICodeEditor, { widget: PeekViewWidget; listener: IDisposable }>();\n\n\taddExclusiveWidget(editor: ICodeEditor, widget: PeekViewWidget): void {\n\t\tconst existing = this._widgets.get(editor);\n\t\tif (existing) {\n\t\t\texisting.listener.dispose();\n\t\t\texisting.widget.dispose();\n\t\t}\n\t\tconst remove = () => {\n\t\t\tconst data = this._widgets.get(editor);\n\t\t\tif (data && data.widget === widget) {\n\t\t\t\tdata.listener.dispose();\n\t\t\t\tthis._widgets.delete(editor);\n\t\t\t}\n\t\t};\n\t\tthis._widgets.set(editor, { widget, listener: widget.onDidClose(remove) });\n\t}\n});\n\nexport namespace PeekContext {\n\texport const inPeekEditor = new RawContextKey<boolean>('inReferenceSearchEditor', true, nls.localize('inReferenceSearchEditor', \"Whether the current code editor is embedded inside peek\"));\n\texport const notInPeekEditor = inPeekEditor.toNegated();\n}\n\nclass PeekContextController implements IEditorContribution {\n\n\tstatic readonly ID = 'editor.contrib.referenceController';\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tif (editor instanceof EmbeddedCodeEditorWidget) {\n\t\t\tPeekContext.inPeekEditor.bindTo(contextKeyService);\n\t\t}\n\t}\n\n\tdispose(): void { }\n}\n\nregisterEditorContribution(PeekContextController.ID, PeekContextController);\n\nexport function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {\n\tlet editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\tif (editor instanceof EmbeddedCodeEditorWidget) {\n\t\treturn editor.getParentEditor();\n\t}\n\treturn editor;\n}\n\nexport interface IPeekViewStyles extends IStyles {\n\theaderBackgroundColor?: Color;\n\tprimaryHeadingColor?: Color;\n\tsecondaryHeadingColor?: Color;\n}\n\nexport type IPeekViewOptions = IOptions & IPeekViewStyles & {\n\tsupportOnTitleClick?: boolean;\n};\n\nconst defaultOptions: IPeekViewOptions = {\n\theaderBackgroundColor: Color.white,\n\tprimaryHeadingColor: Color.fromHex('#333333'),\n\tsecondaryHeadingColor: Color.fromHex('#6c6c6cb3')\n};\n\nexport abstract class PeekViewWidget extends ZoneWidget {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onDidClose = new Emitter<PeekViewWidget>();\n\treadonly onDidClose = this._onDidClose.event;\n\tprivate disposed?: true;\n\n\tprotected _headElement?: HTMLDivElement;\n\tprotected _primaryHeading?: HTMLElement;\n\tprotected _secondaryHeading?: HTMLElement;\n\tprotected _metaHeading?: HTMLElement;\n\tprotected _actionbarWidget?: ActionBar;\n\tprotected _bodyElement?: HTMLDivElement;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\toptions: IPeekViewOptions,\n\t\t@IInstantiationService protected readonly instantiationService: IInstantiationService\n\t) {\n\t\tsuper(editor, options);\n\t\tobjects.mixin(this.options, defaultOptions, false);\n\t}\n\n\toverride dispose(): void {\n\t\tif (!this.disposed) {\n\t\t\tthis.disposed = true; // prevent consumers who dispose on onDidClose from looping\n\t\t\tsuper.dispose();\n\t\t\tthis._onDidClose.fire(this);\n\t\t}\n\t}\n\n\toverride style(styles: IPeekViewStyles): void {\n\t\tlet options = <IPeekViewOptions>this.options;\n\t\tif (styles.headerBackgroundColor) {\n\t\t\toptions.headerBackgroundColor = styles.headerBackgroundColor;\n\t\t}\n\t\tif (styles.primaryHeadingColor) {\n\t\t\toptions.primaryHeadingColor = styles.primaryHeadingColor;\n\t\t}\n\t\tif (styles.secondaryHeadingColor) {\n\t\t\toptions.secondaryHeadingColor = styles.secondaryHeadingColor;\n\t\t}\n\t\tsuper.style(styles);\n\t}\n\n\tprotected override _applyStyles(): void {\n\t\tsuper._applyStyles();\n\t\tlet options = <IPeekViewOptions>this.options;\n\t\tif (this._headElement && options.headerBackgroundColor) {\n\t\t\tthis._headElement.style.backgroundColor = options.headerBackgroundColor.toString();\n\t\t}\n\t\tif (this._primaryHeading && options.primaryHeadingColor) {\n\t\t\tthis._primaryHeading.style.color = options.primaryHeadingColor.toString();\n\t\t}\n\t\tif (this._secondaryHeading && options.secondaryHeadingColor) {\n\t\t\tthis._secondaryHeading.style.color = options.secondaryHeadingColor.toString();\n\t\t}\n\t\tif (this._bodyElement && options.frameColor) {\n\t\t\tthis._bodyElement.style.borderColor = options.frameColor.toString();\n\t\t}\n\t}\n\n\tprotected _fillContainer(container: HTMLElement): void {\n\t\tthis.setCssClass('peekview-widget');\n\n\t\tthis._headElement = dom.$<HTMLDivElement>('.head');\n\t\tthis._bodyElement = dom.$<HTMLDivElement>('.body');\n\n\t\tthis._fillHead(this._headElement);\n\t\tthis._fillBody(this._bodyElement);\n\n\t\tcontainer.appendChild(this._headElement);\n\t\tcontainer.appendChild(this._bodyElement);\n\t}\n\n\tprotected _fillHead(container: HTMLElement, noCloseAction?: boolean): void {\n\t\tconst titleElement = dom.$('.peekview-title');\n\t\tif ((this.options as IPeekViewOptions).supportOnTitleClick) {\n\t\t\ttitleElement.classList.add('clickable');\n\t\t\tdom.addStandardDisposableListener(titleElement, 'click', event => this._onTitleClick(event));\n\t\t}\n\t\tdom.append(this._headElement!, titleElement);\n\n\t\tthis._fillTitleIcon(titleElement);\n\t\tthis._primaryHeading = dom.$('span.filename');\n\t\tthis._secondaryHeading = dom.$('span.dirname');\n\t\tthis._metaHeading = dom.$('span.meta');\n\t\tdom.append(titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);\n\n\t\tconst actionsContainer = dom.$('.peekview-actions');\n\t\tdom.append(this._headElement!, actionsContainer);\n\n\t\tconst actionBarOptions = this._getActionBarOptions();\n\t\tthis._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);\n\t\tthis._disposables.add(this._actionbarWidget);\n\n\t\tif (!noCloseAction) {\n\t\t\tthis._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', \"Close\"), Codicon.close.classNames, true, () => {\n\t\t\t\tthis.dispose();\n\t\t\t\treturn Promise.resolve();\n\t\t\t}), { label: false, icon: true });\n\t\t}\n\t}\n\n\tprotected _fillTitleIcon(container: HTMLElement): void {\n\t}\n\n\tprotected _getActionBarOptions(): IActionBarOptions {\n\t\treturn {\n\t\t\tactionViewItemProvider: createActionViewItem.bind(undefined, this.instantiationService),\n\t\t\torientation: ActionsOrientation.HORIZONTAL\n\t\t};\n\t}\n\n\tprotected _onTitleClick(event: IMouseEvent): void {\n\t\t// implement me if supportOnTitleClick option is set\n\t}\n\n\tsetTitle(primaryHeading: string, secondaryHeading?: string): void {\n\t\tif (this._primaryHeading && this._secondaryHeading) {\n\t\t\tthis._primaryHeading.innerText = primaryHeading;\n\t\t\tthis._primaryHeading.setAttribute('title', primaryHeading);\n\t\t\tif (secondaryHeading) {\n\t\t\t\tthis._secondaryHeading.innerText = secondaryHeading;\n\t\t\t} else {\n\t\t\t\tdom.clearNode(this._secondaryHeading);\n\t\t\t}\n\t\t}\n\t}\n\n\tsetMetaTitle(value: string): void {\n\t\tif (this._metaHeading) {\n\t\t\tif (value) {\n\t\t\t\tthis._metaHeading.innerText = value;\n\t\t\t\tdom.show(this._metaHeading);\n\t\t\t} else {\n\t\t\t\tdom.hide(this._metaHeading);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected abstract _fillBody(container: HTMLElement): void;\n\n\tprotected override _doLayout(heightInPixel: number, widthInPixel: number): void {\n\n\t\tif (!this._isShowing && heightInPixel < 0) {\n\t\t\t// Looks like the view zone got folded away!\n\t\t\tthis.dispose();\n\t\t\treturn;\n\t\t}\n\n\t\tconst headHeight = Math.ceil(this.editor.getOption(EditorOption.lineHeight) * 1.2);\n\t\tconst bodyHeight = Math.round(heightInPixel - (headHeight + 2 /* the border-top/bottom width*/));\n\n\t\tthis._doLayoutHead(headHeight, widthInPixel);\n\t\tthis._doLayoutBody(bodyHeight, widthInPixel);\n\t}\n\n\tprotected _doLayoutHead(heightInPixel: number, widthInPixel: number): void {\n\t\tif (this._headElement) {\n\t\t\tthis._headElement.style.height = `${heightInPixel}px`;\n\t\t\tthis._headElement.style.lineHeight = this._headElement.style.height;\n\t\t}\n\t}\n\n\tprotected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {\n\t\tif (this._bodyElement) {\n\t\t\tthis._bodyElement.style.height = `${heightInPixel}px`;\n\t\t}\n\t}\n}\n\n\nexport const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: transparent(editorInfoForeground, .1), light: transparent(editorInfoForeground, .1), hc: null }, nls.localize('peekViewTitleBackground', 'Background color of the peek view title area.'));\nexport const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: Color.white, light: Color.black, hc: Color.white }, nls.localize('peekViewTitleForeground', 'Color of the peek view title.'));\nexport const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161', hc: '#FFFFFF99' }, nls.localize('peekViewTitleInfoForeground', 'Color of the peek view title info.'));\nexport const peekViewBorder = registerColor('peekView.border', { dark: editorInfoForeground, light: editorInfoForeground, hc: contrastBorder }, nls.localize('peekViewBorder', 'Color of the peek view borders and arrow.'));\n\nexport const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hc: Color.black }, nls.localize('peekViewResultsBackground', 'Background color of the peek view result list.'));\nexport const peekViewResultsMatchForeground = registerColor('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hc: Color.white }, nls.localize('peekViewResultsMatchForeground', 'Foreground color for line nodes in the peek view result list.'));\nexport const peekViewResultsFileForeground = registerColor('peekViewResult.fileForeground', { dark: Color.white, light: '#1E1E1E', hc: Color.white }, nls.localize('peekViewResultsFileForeground', 'Foreground color for file nodes in the peek view result list.'));\nexport const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hc: null }, nls.localize('peekViewResultsSelectionBackground', 'Background color of the selected entry in the peek view result list.'));\nexport const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hc: Color.white }, nls.localize('peekViewResultsSelectionForeground', 'Foreground color of the selected entry in the peek view result list.'));\nexport const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hc: Color.black }, nls.localize('peekViewEditorBackground', 'Background color of the peek view editor.'));\nexport const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', { dark: peekViewEditorBackground, light: peekViewEditorBackground, hc: peekViewEditorBackground }, nls.localize('peekViewEditorGutterBackground', 'Background color of the gutter in the peek view editor.'));\n\nexport const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hc: null }, nls.localize('peekViewResultsMatchHighlight', 'Match highlight color in the peek view result list.'));\nexport const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hc: null }, nls.localize('peekViewEditorMatchHighlight', 'Match highlight color in the peek view editor.'));\nexport const peekViewEditorMatchHighlightBorder = registerColor('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('peekViewEditorMatchHighlightBorder', 'Match highlight border in the peek view editor.'));\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 * as dom from 'vs/base/browser/dom';\nimport { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { IAction } from 'vs/base/common/actions';\nimport { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { getBaseLabel } from 'vs/base/common/labels';\nimport { DisposableStore, dispose } from 'vs/base/common/lifecycle';\nimport { basename } from 'vs/base/common/resources';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { splitLines } from 'vs/base/common/strings';\nimport 'vs/css!./media/gotoErrorWidget';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { peekViewTitleForeground, peekViewTitleInfoForeground, PeekViewWidget } from 'vs/editor/contrib/peekView/browser/peekView';\nimport * as nls from 'vs/nls';\nimport { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';\nimport { IMenuService, MenuId } from 'vs/platform/actions/common/actions';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IMarker, IRelatedInformation, MarkerSeverity } from 'vs/platform/markers/common/markers';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon';\nimport { contrastBorder, editorBackground, editorErrorBorder, editorErrorForeground, editorInfoBorder, editorInfoForeground, editorWarningBorder, editorWarningForeground, oneOf, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\n\nclass MessageWidget {\n\n\tprivate _lines: number = 0;\n\tprivate _longestLineLength: number = 0;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _messageBlock: HTMLDivElement;\n\tprivate readonly _relatedBlock: HTMLDivElement;\n\tprivate readonly _scrollable: ScrollableElement;\n\tprivate readonly _relatedDiagnostics = new WeakMap<HTMLElement, IRelatedInformation>();\n\tprivate readonly _disposables: DisposableStore = new DisposableStore();\n\n\tprivate _codeLink?: HTMLElement;\n\n\tconstructor(\n\t\tparent: HTMLElement,\n\t\teditor: ICodeEditor,\n\t\tonRelatedInformation: (related: IRelatedInformation) => void,\n\t\tprivate readonly _openerService: IOpenerService,\n\t\tprivate readonly _labelService: ILabelService\n\t) {\n\t\tthis._editor = editor;\n\n\t\tconst domNode = document.createElement('div');\n\t\tdomNode.className = 'descriptioncontainer';\n\n\t\tthis._messageBlock = document.createElement('div');\n\t\tthis._messageBlock.classList.add('message');\n\t\tthis._messageBlock.setAttribute('aria-live', 'assertive');\n\t\tthis._messageBlock.setAttribute('role', 'alert');\n\t\tdomNode.appendChild(this._messageBlock);\n\n\t\tthis._relatedBlock = document.createElement('div');\n\t\tdomNode.appendChild(this._relatedBlock);\n\t\tthis._disposables.add(dom.addStandardDisposableListener(this._relatedBlock, 'click', event => {\n\t\t\tevent.preventDefault();\n\t\t\tconst related = this._relatedDiagnostics.get(event.target);\n\t\t\tif (related) {\n\t\t\t\tonRelatedInformation(related);\n\t\t\t}\n\t\t}));\n\n\t\tthis._scrollable = new ScrollableElement(domNode, {\n\t\t\thorizontal: ScrollbarVisibility.Auto,\n\t\t\tvertical: ScrollbarVisibility.Auto,\n\t\t\tuseShadows: false,\n\t\t\thorizontalScrollbarSize: 6,\n\t\t\tverticalScrollbarSize: 6\n\t\t});\n\t\tparent.appendChild(this._scrollable.getDomNode());\n\t\tthis._disposables.add(this._scrollable.onScroll(e => {\n\t\t\tdomNode.style.left = `-${e.scrollLeft}px`;\n\t\t\tdomNode.style.top = `-${e.scrollTop}px`;\n\t\t}));\n\t\tthis._disposables.add(this._scrollable);\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._disposables);\n\t}\n\n\tupdate(marker: IMarker): void {\n\t\tconst { source, message, relatedInformation, code } = marker;\n\t\tlet sourceAndCodeLength = (source?.length || 0) + '()'.length;\n\t\tif (code) {\n\t\t\tif (typeof code === 'string') {\n\t\t\t\tsourceAndCodeLength += code.length;\n\t\t\t} else {\n\t\t\t\tsourceAndCodeLength += code.value.length;\n\t\t\t}\n\t\t}\n\n\t\tconst lines = splitLines(message);\n\t\tthis._lines = lines.length;\n\t\tthis._longestLineLength = 0;\n\t\tfor (const line of lines) {\n\t\t\tthis._longestLineLength = Math.max(line.length + sourceAndCodeLength, this._longestLineLength);\n\t\t}\n\n\t\tdom.clearNode(this._messageBlock);\n\t\tthis._messageBlock.setAttribute('aria-label', this.getAriaLabel(marker));\n\t\tthis._editor.applyFontInfo(this._messageBlock);\n\t\tlet lastLineElement = this._messageBlock;\n\t\tfor (const line of lines) {\n\t\t\tlastLineElement = document.createElement('div');\n\t\t\tlastLineElement.innerText = line;\n\t\t\tif (line === '') {\n\t\t\t\tlastLineElement.style.height = this._messageBlock.style.lineHeight;\n\t\t\t}\n\t\t\tthis._messageBlock.appendChild(lastLineElement);\n\t\t}\n\t\tif (source || code) {\n\t\t\tconst detailsElement = document.createElement('span');\n\t\t\tdetailsElement.classList.add('details');\n\t\t\tlastLineElement.appendChild(detailsElement);\n\t\t\tif (source) {\n\t\t\t\tconst sourceElement = document.createElement('span');\n\t\t\t\tsourceElement.innerText = source;\n\t\t\t\tsourceElement.classList.add('source');\n\t\t\t\tdetailsElement.appendChild(sourceElement);\n\t\t\t}\n\t\t\tif (code) {\n\t\t\t\tif (typeof code === 'string') {\n\t\t\t\t\tconst codeElement = document.createElement('span');\n\t\t\t\t\tcodeElement.innerText = `(${code})`;\n\t\t\t\t\tcodeElement.classList.add('code');\n\t\t\t\t\tdetailsElement.appendChild(codeElement);\n\t\t\t\t} else {\n\t\t\t\t\tthis._codeLink = dom.$('a.code-link');\n\t\t\t\t\tthis._codeLink.setAttribute('href', `${code.target.toString()}`);\n\n\t\t\t\t\tthis._codeLink.onclick = (e) => {\n\t\t\t\t\t\tthis._openerService.open(code.target, { allowCommands: true });\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t};\n\n\t\t\t\t\tconst codeElement = dom.append(this._codeLink, dom.$('span'));\n\t\t\t\t\tcodeElement.innerText = code.value;\n\t\t\t\t\tdetailsElement.appendChild(this._codeLink);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdom.clearNode(this._relatedBlock);\n\t\tthis._editor.applyFontInfo(this._relatedBlock);\n\t\tif (isNonEmptyArray(relatedInformation)) {\n\t\t\tconst relatedInformationNode = this._relatedBlock.appendChild(document.createElement('div'));\n\t\t\trelatedInformationNode.style.paddingTop = `${Math.floor(this._editor.getOption(EditorOption.lineHeight) * 0.66)}px`;\n\t\t\tthis._lines += 1;\n\n\t\t\tfor (const related of relatedInformation) {\n\n\t\t\t\tlet container = document.createElement('div');\n\n\t\t\t\tlet relatedResource = document.createElement('a');\n\t\t\t\trelatedResource.classList.add('filename');\n\t\t\t\trelatedResource.innerText = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `;\n\t\t\t\trelatedResource.title = this._labelService.getUriLabel(related.resource);\n\t\t\t\tthis._relatedDiagnostics.set(relatedResource, related);\n\n\t\t\t\tlet relatedMessage = document.createElement('span');\n\t\t\t\trelatedMessage.innerText = related.message;\n\n\t\t\t\tcontainer.appendChild(relatedResource);\n\t\t\t\tcontainer.appendChild(relatedMessage);\n\n\t\t\t\tthis._lines += 1;\n\t\t\t\trelatedInformationNode.appendChild(container);\n\t\t\t}\n\t\t}\n\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tconst scrollWidth = Math.ceil(fontInfo.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75);\n\t\tconst scrollHeight = fontInfo.lineHeight * this._lines;\n\t\tthis._scrollable.setScrollDimensions({ scrollWidth, scrollHeight });\n\t}\n\n\tlayout(height: number, width: number): void {\n\t\tthis._scrollable.getDomNode().style.height = `${height}px`;\n\t\tthis._scrollable.getDomNode().style.width = `${width}px`;\n\t\tthis._scrollable.setScrollDimensions({ width, height });\n\t}\n\n\tgetHeightInLines(): number {\n\t\treturn Math.min(17, this._lines);\n\t}\n\n\tprivate getAriaLabel(marker: IMarker): string {\n\t\tlet severityLabel = '';\n\t\tswitch (marker.severity) {\n\t\t\tcase MarkerSeverity.Error:\n\t\t\t\tseverityLabel = nls.localize('Error', \"Error\");\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Warning:\n\t\t\t\tseverityLabel = nls.localize('Warning', \"Warning\");\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Info:\n\t\t\t\tseverityLabel = nls.localize('Info', \"Info\");\n\t\t\t\tbreak;\n\t\t\tcase MarkerSeverity.Hint:\n\t\t\t\tseverityLabel = nls.localize('Hint', \"Hint\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\tlet ariaLabel = nls.localize('marker aria', \"{0} at {1}. \", severityLabel, marker.startLineNumber + ':' + marker.startColumn);\n\t\tconst model = this._editor.getModel();\n\t\tif (model && (marker.startLineNumber <= model.getLineCount()) && (marker.startLineNumber >= 1)) {\n\t\t\tconst lineContent = model.getLineContent(marker.startLineNumber);\n\t\t\tariaLabel = `${lineContent}, ${ariaLabel}`;\n\t\t}\n\t\treturn ariaLabel;\n\t}\n}\n\nexport class MarkerNavigationWidget extends PeekViewWidget {\n\n\tstatic readonly TitleMenu = new MenuId('gotoErrorTitleMenu');\n\n\tprivate _parentContainer!: HTMLElement;\n\tprivate _container!: HTMLElement;\n\tprivate _icon!: HTMLElement;\n\tprivate _message!: MessageWidget;\n\tprivate readonly _callOnDispose = new DisposableStore();\n\tprivate _severity: MarkerSeverity;\n\tprivate _backgroundColor?: Color;\n\tprivate readonly _onDidSelectRelatedInformation = new Emitter<IRelatedInformation>();\n\tprivate _heightInPixel!: number;\n\n\treadonly onDidSelectRelatedInformation: Event<IRelatedInformation> = this._onDidSelectRelatedInformation.event;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@ILabelService private readonly _labelService: ILabelService\n\t) {\n\t\tsuper(editor, { showArrow: true, showFrame: true, isAccessible: true, frameWidth: 1 }, instantiationService);\n\t\tthis._severity = MarkerSeverity.Warning;\n\t\tthis._backgroundColor = Color.white;\n\n\t\tthis._applyTheme(_themeService.getColorTheme());\n\t\tthis._callOnDispose.add(_themeService.onDidColorThemeChange(this._applyTheme.bind(this)));\n\n\t\tthis.create();\n\t}\n\n\tprivate _applyTheme(theme: IColorTheme) {\n\t\tthis._backgroundColor = theme.getColor(editorMarkerNavigationBackground);\n\t\tlet colorId = editorMarkerNavigationError;\n\t\tlet headerBackground = editorMarkerNavigationErrorHeader;\n\n\t\tif (this._severity === MarkerSeverity.Warning) {\n\t\t\tcolorId = editorMarkerNavigationWarning;\n\t\t\theaderBackground = editorMarkerNavigationWarningHeader;\n\t\t} else if (this._severity === MarkerSeverity.Info) {\n\t\t\tcolorId = editorMarkerNavigationInfo;\n\t\t\theaderBackground = editorMarkerNavigationInfoHeader;\n\t\t}\n\n\t\tconst frameColor = theme.getColor(colorId);\n\t\tconst headerBg = theme.getColor(headerBackground);\n\n\t\tthis.style({\n\t\t\tarrowColor: frameColor,\n\t\t\tframeColor: frameColor,\n\t\t\theaderBackgroundColor: headerBg,\n\t\t\tprimaryHeadingColor: theme.getColor(peekViewTitleForeground),\n\t\t\tsecondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground)\n\t\t}); // style() will trigger _applyStyles\n\t}\n\n\tprotected override _applyStyles(): void {\n\t\tif (this._parentContainer) {\n\t\t\tthis._parentContainer.style.backgroundColor = this._backgroundColor ? this._backgroundColor.toString() : '';\n\t\t}\n\t\tsuper._applyStyles();\n\t}\n\n\toverride dispose(): void {\n\t\tthis._callOnDispose.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tprotected override _fillHead(container: HTMLElement): void {\n\t\tsuper._fillHead(container);\n\n\t\tthis._disposables.add(this._actionbarWidget!.actionRunner.onBeforeRun(e => this.editor.focus()));\n\n\t\tconst actions: IAction[] = [];\n\t\tconst menu = this._menuService.createMenu(MarkerNavigationWidget.TitleMenu, this._contextKeyService);\n\t\tcreateAndFillInActionBarActions(menu, undefined, actions);\n\t\tthis._actionbarWidget!.push(actions, { label: false, icon: true, index: 0 });\n\t\tmenu.dispose();\n\t}\n\n\tprotected override _fillTitleIcon(container: HTMLElement): void {\n\t\tthis._icon = dom.append(container, dom.$(''));\n\t}\n\n\tprotected _fillBody(container: HTMLElement): void {\n\t\tthis._parentContainer = container;\n\t\tcontainer.classList.add('marker-widget');\n\t\tthis._parentContainer.tabIndex = 0;\n\t\tthis._parentContainer.setAttribute('role', 'tooltip');\n\n\t\tthis._container = document.createElement('div');\n\t\tcontainer.appendChild(this._container);\n\n\t\tthis._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related), this._openerService, this._labelService);\n\t\tthis._disposables.add(this._message);\n\t}\n\n\toverride show(): void {\n\t\tthrow new Error('call showAtMarker');\n\t}\n\n\tshowAtMarker(marker: IMarker, markerIdx: number, markerCount: number): void {\n\t\t// update:\n\t\t// * title\n\t\t// * message\n\t\tthis._container.classList.remove('stale');\n\t\tthis._message.update(marker);\n\n\t\t// update frame color (only applied on 'show')\n\t\tthis._severity = marker.severity;\n\t\tthis._applyTheme(this._themeService.getColorTheme());\n\n\t\t// show\n\t\tlet range = Range.lift(marker);\n\t\tconst editorPosition = this.editor.getPosition();\n\t\tlet position = editorPosition && range.containsPosition(editorPosition) ? editorPosition : range.getStartPosition();\n\t\tsuper.show(position, this.computeRequiredHeight());\n\n\t\tconst model = this.editor.getModel();\n\t\tif (model) {\n\t\t\tconst detail = markerCount > 1\n\t\t\t\t? nls.localize('problems', \"{0} of {1} problems\", markerIdx, markerCount)\n\t\t\t\t: nls.localize('change', \"{0} of {1} problem\", markerIdx, markerCount);\n\t\t\tthis.setTitle(basename(model.uri), detail);\n\t\t}\n\t\tthis._icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(this._severity))}`;\n\n\t\tthis.editor.revealPositionNearTop(position, ScrollType.Smooth);\n\t\tthis.editor.focus();\n\t}\n\n\tupdateMarker(marker: IMarker): void {\n\t\tthis._container.classList.remove('stale');\n\t\tthis._message.update(marker);\n\t}\n\n\tshowStale() {\n\t\tthis._container.classList.add('stale');\n\t\tthis._relayout();\n\t}\n\n\tprotected override _doLayoutBody(heightInPixel: number, widthInPixel: number): void {\n\t\tsuper._doLayoutBody(heightInPixel, widthInPixel);\n\t\tthis._heightInPixel = heightInPixel;\n\t\tthis._message.layout(heightInPixel, widthInPixel);\n\t\tthis._container.style.height = `${heightInPixel}px`;\n\t}\n\n\tpublic override _onWidth(widthInPixel: number): void {\n\t\tthis._message.layout(this._heightInPixel, widthInPixel);\n\t}\n\n\tprotected override _relayout(): void {\n\t\tsuper._relayout(this.computeRequiredHeight());\n\t}\n\n\tprivate computeRequiredHeight() {\n\t\treturn 3 + this._message.getHeightInLines();\n\t}\n}\n\n// theming\n\nlet errorDefault = oneOf(editorErrorForeground, editorErrorBorder);\nlet warningDefault = oneOf(editorWarningForeground, editorWarningBorder);\nlet infoDefault = oneOf(editorInfoForeground, editorInfoBorder);\n\nexport const editorMarkerNavigationError = registerColor('editorMarkerNavigationError.background', { dark: errorDefault, light: errorDefault, hc: contrastBorder }, nls.localize('editorMarkerNavigationError', 'Editor marker navigation widget error color.'));\nexport const editorMarkerNavigationErrorHeader = registerColor('editorMarkerNavigationError.headerBackground', { dark: transparent(editorMarkerNavigationError, .1), light: transparent(editorMarkerNavigationError, .1), hc: null }, nls.localize('editorMarkerNavigationErrorHeaderBackground', 'Editor marker navigation widget error heading background.'));\n\nexport const editorMarkerNavigationWarning = registerColor('editorMarkerNavigationWarning.background', { dark: warningDefault, light: warningDefault, hc: contrastBorder }, nls.localize('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.'));\nexport const editorMarkerNavigationWarningHeader = registerColor('editorMarkerNavigationWarning.headerBackground', { dark: transparent(editorMarkerNavigationWarning, .1), light: transparent(editorMarkerNavigationWarning, .1), hc: '#0C141F' }, nls.localize('editorMarkerNavigationWarningBackground', 'Editor marker navigation widget warning heading background.'));\n\nexport const editorMarkerNavigationInfo = registerColor('editorMarkerNavigationInfo.background', { dark: infoDefault, light: infoDefault, hc: contrastBorder }, nls.localize('editorMarkerNavigationInfo', 'Editor marker navigation widget info color.'));\nexport const editorMarkerNavigationInfoHeader = registerColor('editorMarkerNavigationInfo.headerBackground', { dark: transparent(editorMarkerNavigationInfo, .1), light: transparent(editorMarkerNavigationInfo, .1), hc: null }, nls.localize('editorMarkerNavigationInfoHeaderBackground', 'Editor marker navigation widget info heading background.'));\n\nexport const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.'));\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 { Codicon } from 'vs/base/common/codicons';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, IActionOptions, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IMarkerNavigationService, MarkerList } from 'vs/editor/contrib/gotoError/browser/markerNavigationService';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IMarker } from 'vs/platform/markers/common/markers';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { MarkerNavigationWidget } from './gotoErrorWidget';\n\nexport class MarkerController implements IEditorContribution {\n\n\tstatic readonly ID = 'editor.contrib.markerController';\n\n\tstatic get(editor: ICodeEditor): MarkerController | null {\n\t\treturn editor.getContribution<MarkerController>(MarkerController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate readonly _widgetVisible: IContextKey<boolean>;\n\tprivate readonly _sessionDispoables = new DisposableStore();\n\n\tprivate _model?: MarkerList;\n\tprivate _widget?: MarkerNavigationWidget;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerNavigationService private readonly _markerNavigationService: IMarkerNavigationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@ICodeEditorService private readonly _editorService: ICodeEditorService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._widgetVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService);\n\t}\n\n\tdispose(): void {\n\t\tthis._cleanUp();\n\t\tthis._sessionDispoables.dispose();\n\t}\n\n\tprivate _cleanUp(): void {\n\t\tthis._widgetVisible.reset();\n\t\tthis._sessionDispoables.clear();\n\t\tthis._widget = undefined;\n\t\tthis._model = undefined;\n\t}\n\n\tprivate _getOrCreateModel(uri: URI | undefined): MarkerList {\n\n\t\tif (this._model && this._model.matches(uri)) {\n\t\t\treturn this._model;\n\t\t}\n\t\tlet reusePosition = false;\n\t\tif (this._model) {\n\t\t\treusePosition = true;\n\t\t\tthis._cleanUp();\n\t\t}\n\n\t\tthis._model = this._markerNavigationService.getMarkerList(uri);\n\t\tif (reusePosition) {\n\t\t\tthis._model.move(true, this._editor.getModel()!, this._editor.getPosition()!);\n\t\t}\n\n\t\tthis._widget = this._instantiationService.createInstance(MarkerNavigationWidget, this._editor);\n\t\tthis._widget.onDidClose(() => this.close(), this, this._sessionDispoables);\n\t\tthis._widgetVisible.set(true);\n\n\t\tthis._sessionDispoables.add(this._model);\n\t\tthis._sessionDispoables.add(this._widget);\n\n\t\t// follow cursor\n\t\tthis._sessionDispoables.add(this._editor.onDidChangeCursorPosition(e => {\n\t\t\tif (!this._model?.selected || !Range.containsPosition(this._model?.selected.marker, e.position)) {\n\t\t\t\tthis._model?.resetIndex();\n\t\t\t}\n\t\t}));\n\n\t\t// update markers\n\t\tthis._sessionDispoables.add(this._model.onDidChange(() => {\n\t\t\tif (!this._widget || !this._widget.position || !this._model) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst info = this._model.find(this._editor.getModel()!.uri, this._widget!.position!);\n\t\t\tif (info) {\n\t\t\t\tthis._widget.updateMarker(info.marker);\n\t\t\t} else {\n\t\t\t\tthis._widget.showStale();\n\t\t\t}\n\t\t}));\n\n\t\t// open related\n\t\tthis._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(related => {\n\t\t\tthis._editorService.openCodeEditor({\n\t\t\t\tresource: related.resource,\n\t\t\t\toptions: { pinned: true, revealIfOpened: true, selection: Range.lift(related).collapseToStart() }\n\t\t\t}, this._editor);\n\t\t\tthis.close(false);\n\t\t}));\n\t\tthis._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp()));\n\n\t\treturn this._model;\n\t}\n\n\tclose(focusEditor: boolean = true): void {\n\t\tthis._cleanUp();\n\t\tif (focusEditor) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tshowAtMarker(marker: IMarker): void {\n\t\tif (this._editor.hasModel()) {\n\t\t\tconst model = this._getOrCreateModel(this._editor.getModel().uri);\n\t\t\tmodel.resetIndex();\n\t\t\tmodel.move(true, this._editor.getModel(), new Position(marker.startLineNumber, marker.startColumn));\n\t\t\tif (model.selected) {\n\t\t\t\tthis._widget!.showAtMarker(model.selected.marker, model.selected.index, model.selected.total);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync nagivate(next: boolean, multiFile: boolean) {\n\t\tif (this._editor.hasModel()) {\n\t\t\tconst model = this._getOrCreateModel(multiFile ? undefined : this._editor.getModel().uri);\n\t\t\tmodel.move(next, this._editor.getModel(), this._editor.getPosition());\n\t\t\tif (!model.selected) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (model.selected.marker.resource.toString() !== this._editor.getModel().uri.toString()) {\n\t\t\t\t// show in different editor\n\t\t\t\tthis._cleanUp();\n\t\t\t\tconst otherEditor = await this._editorService.openCodeEditor({\n\t\t\t\t\tresource: model.selected.marker.resource,\n\t\t\t\t\toptions: { pinned: false, revealIfOpened: true, selectionRevealType: TextEditorSelectionRevealType.NearTop, selection: model.selected.marker }\n\t\t\t\t}, this._editor);\n\n\t\t\t\tif (otherEditor) {\n\t\t\t\t\tMarkerController.get(otherEditor)?.close();\n\t\t\t\t\tMarkerController.get(otherEditor)?.nagivate(next, multiFile);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// show in this editor\n\t\t\t\tthis._widget!.showAtMarker(model.selected.marker, model.selected.index, model.selected.total);\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass MarkerNavigationAction extends EditorAction {\n\n\tconstructor(\n\t\tprivate readonly _next: boolean,\n\t\tprivate readonly _multiFile: boolean,\n\t\topts: IActionOptions\n\t) {\n\t\tsuper(opts);\n\t}\n\n\tasync run(_accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tif (editor.hasModel()) {\n\t\t\tMarkerController.get(editor)?.nagivate(this._next, this._multiFile);\n\t\t}\n\t}\n}\n\nexport class NextMarkerAction extends MarkerNavigationAction {\n\tstatic ID: string = 'editor.action.marker.next';\n\tstatic LABEL: string = nls.localize('markerAction.next.label', \"Go to Next Problem (Error, Warning, Info)\");\n\tconstructor() {\n\t\tsuper(true, false, {\n\t\t\tid: NextMarkerAction.ID,\n\t\t\tlabel: NextMarkerAction.LABEL,\n\t\t\talias: 'Go to Next Problem (Error, Warning, Info)',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.F8,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MarkerNavigationWidget.TitleMenu,\n\t\t\t\ttitle: NextMarkerAction.LABEL,\n\t\t\t\ticon: registerIcon('marker-navigation-next', Codicon.arrowDown, nls.localize('nextMarkerIcon', 'Icon for goto next marker.')),\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass PrevMarkerAction extends MarkerNavigationAction {\n\tstatic ID: string = 'editor.action.marker.prev';\n\tstatic LABEL: string = nls.localize('markerAction.previous.label', \"Go to Previous Problem (Error, Warning, Info)\");\n\tconstructor() {\n\t\tsuper(false, false, {\n\t\t\tid: PrevMarkerAction.ID,\n\t\t\tlabel: PrevMarkerAction.LABEL,\n\t\t\talias: 'Go to Previous Problem (Error, Warning, Info)',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.F8,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MarkerNavigationWidget.TitleMenu,\n\t\t\t\ttitle: PrevMarkerAction.LABEL,\n\t\t\t\ticon: registerIcon('marker-navigation-previous', Codicon.arrowUp, nls.localize('previousMarkerIcon', 'Icon for goto previous marker.')),\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass NextMarkerInFilesAction extends MarkerNavigationAction {\n\tconstructor() {\n\t\tsuper(true, true, {\n\t\t\tid: 'editor.action.marker.nextInFiles',\n\t\t\tlabel: nls.localize('markerAction.nextInFiles.label', \"Go to Next Problem in Files (Error, Warning, Info)\"),\n\t\t\talias: 'Go to Next Problem in Files (Error, Warning, Info)',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyCode.F8,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarGoMenu,\n\t\t\t\ttitle: nls.localize({ key: 'miGotoNextProblem', comment: ['&& denotes a mnemonic'] }, \"Next &&Problem\"),\n\t\t\t\tgroup: '6_problem_nav',\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass PrevMarkerInFilesAction extends MarkerNavigationAction {\n\tconstructor() {\n\t\tsuper(false, true, {\n\t\t\tid: 'editor.action.marker.prevInFiles',\n\t\t\tlabel: nls.localize('markerAction.previousInFiles.label', \"Go to Previous Problem in Files (Error, Warning, Info)\"),\n\t\t\talias: 'Go to Previous Problem in Files (Error, Warning, Info)',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F8,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tmenuId: MenuId.MenubarGoMenu,\n\t\t\t\ttitle: nls.localize({ key: 'miGotoPreviousProblem', comment: ['&& denotes a mnemonic'] }, \"Previous &&Problem\"),\n\t\t\t\tgroup: '6_problem_nav',\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n}\n\nregisterEditorContribution(MarkerController.ID, MarkerController);\nregisterEditorAction(NextMarkerAction);\nregisterEditorAction(PrevMarkerAction);\nregisterEditorAction(NextMarkerInFilesAction);\nregisterEditorAction(PrevMarkerInFilesAction);\n\nconst CONTEXT_MARKERS_NAVIGATION_VISIBLE = new RawContextKey<boolean>('markersNavigationVisible', false);\n\nconst MarkerCommand = EditorCommand.bindToContribution<MarkerController>(MarkerController.get);\n\nregisterEditorCommand(new MarkerCommand({\n\tid: 'closeMarkersNavigation',\n\tprecondition: CONTEXT_MARKERS_NAVIGATION_VISIBLE,\n\thandler: x => x.close(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 50,\n\t\tkbExpr: EditorContextKeys.focus,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Orientation } from 'vs/base/browser/ui/sash/sash';\nimport { Sizing, SplitView } from 'vs/base/browser/ui/splitview/splitview';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { FuzzyScore } from 'vs/base/common/filters';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { DisposableStore, dispose, IDisposable, IReference } from 'vs/base/common/lifecycle';\nimport { Schemas } from 'vs/base/common/network';\nimport { basenameOrAuthority, dirname } from 'vs/base/common/resources';\nimport 'vs/css!./referencesWidget';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions, TextModel } from 'vs/editor/common/model/textModel';\nimport { Location } from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { AccessibilityProvider, DataSource, Delegate, FileReferencesRenderer, IdentityProvider, OneReferenceRenderer, StringRepresentationProvider, TreeElement } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesTree';\nimport * as peekView from 'vs/editor/contrib/peekView/browser/peekView';\nimport * as nls from 'vs/nls';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IWorkbenchAsyncDataTreeOptions, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';\nimport { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';\nimport { FileReferences, OneReference, ReferencesModel } from '../referencesModel';\n\nclass DecorationsManager implements IDisposable {\n\n\tprivate static readonly DecorationOptions = ModelDecorationOptions.register({\n\t\tdescription: 'reference-decoration',\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'reference-decoration'\n\t});\n\n\tprivate _decorations = new Map<string, OneReference>();\n\tprivate _decorationIgnoreSet = new Set<string>();\n\tprivate readonly _callOnDispose = new DisposableStore();\n\tprivate readonly _callOnModelChange = new DisposableStore();\n\n\tconstructor(private _editor: ICodeEditor, private _model: ReferencesModel) {\n\t\tthis._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged()));\n\t\tthis._onModelChanged();\n\t}\n\n\tdispose(): void {\n\t\tthis._callOnModelChange.dispose();\n\t\tthis._callOnDispose.dispose();\n\t\tthis.removeDecorations();\n\t}\n\n\tprivate _onModelChanged(): void {\n\t\tthis._callOnModelChange.clear();\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let ref of this._model.references) {\n\t\t\tif (ref.uri.toString() === model.uri.toString()) {\n\t\t\t\tthis._addDecorations(ref.parent);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _addDecorations(reference: FileReferences): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged()));\n\n\t\tconst newDecorations: IModelDeltaDecoration[] = [];\n\t\tconst newDecorationsActualIndex: number[] = [];\n\n\t\tfor (let i = 0, len = reference.children.length; i < len; i++) {\n\t\t\tlet oneReference = reference.children[i];\n\t\t\tif (this._decorationIgnoreSet.has(oneReference.id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (oneReference.uri.toString() !== this._editor.getModel().uri.toString()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnewDecorations.push({\n\t\t\t\trange: oneReference.range,\n\t\t\t\toptions: DecorationsManager.DecorationOptions\n\t\t\t});\n\t\t\tnewDecorationsActualIndex.push(i);\n\t\t}\n\n\t\tconst decorations = this._editor.deltaDecorations([], newDecorations);\n\t\tfor (let i = 0; i < decorations.length; i++) {\n\t\t\tthis._decorations.set(decorations[i], reference.children[newDecorationsActualIndex[i]]);\n\t\t}\n\t}\n\n\tprivate _onDecorationChanged(): void {\n\t\tconst toRemove: string[] = [];\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let [decorationId, reference] of this._decorations) {\n\n\t\t\tconst newRange = model.getDecorationRange(decorationId);\n\n\t\t\tif (!newRange) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet ignore = false;\n\t\t\tif (Range.equalsRange(newRange, reference.range)) {\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif (Range.spansMultipleLines(newRange)) {\n\t\t\t\tignore = true;\n\n\t\t\t} else {\n\t\t\t\tconst lineLength = reference.range.endColumn - reference.range.startColumn;\n\t\t\t\tconst newLineLength = newRange.endColumn - newRange.startColumn;\n\n\t\t\t\tif (lineLength !== newLineLength) {\n\t\t\t\t\tignore = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ignore) {\n\t\t\t\tthis._decorationIgnoreSet.add(reference.id);\n\t\t\t\ttoRemove.push(decorationId);\n\t\t\t} else {\n\t\t\t\treference.range = newRange;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0, len = toRemove.length; i < len; i++) {\n\t\t\tthis._decorations.delete(toRemove[i]);\n\t\t}\n\t\tthis._editor.deltaDecorations(toRemove, []);\n\t}\n\n\tremoveDecorations(): void {\n\t\tthis._editor.deltaDecorations([...this._decorations.keys()], []);\n\t\tthis._decorations.clear();\n\t}\n}\n\nexport class LayoutData {\n\tratio: number = 0.7;\n\theightInLines: number = 18;\n\n\tstatic fromJSON(raw: string): LayoutData {\n\t\tlet ratio: number | undefined;\n\t\tlet heightInLines: number | undefined;\n\t\ttry {\n\t\t\tconst data = <LayoutData>JSON.parse(raw);\n\t\t\tratio = data.ratio;\n\t\t\theightInLines = data.heightInLines;\n\t\t} catch {\n\t\t\t//\n\t\t}\n\t\treturn {\n\t\t\tratio: ratio || 0.7,\n\t\t\theightInLines: heightInLines || 18\n\t\t};\n\t}\n}\n\nexport interface SelectionEvent {\n\treadonly kind: 'goto' | 'show' | 'side' | 'open';\n\treadonly source: 'editor' | 'tree' | 'title';\n\treadonly element?: Location;\n}\n\nclass ReferencesTree extends WorkbenchAsyncDataTree<ReferencesModel | FileReferences, TreeElement, FuzzyScore> { }\n\n/**\n * ZoneWidget that is shown inside the editor\n */\nexport class ReferenceWidget extends peekView.PeekViewWidget {\n\n\tprivate _model?: ReferencesModel;\n\tprivate _decorationsManager?: DecorationsManager;\n\n\tprivate readonly _disposeOnNewModel = new DisposableStore();\n\tprivate readonly _callOnDispose = new DisposableStore();\n\n\tprivate readonly _onDidSelectReference = new Emitter<SelectionEvent>();\n\treadonly onDidSelectReference = this._onDidSelectReference.event;\n\n\tprivate _tree!: ReferencesTree;\n\tprivate _treeContainer!: HTMLElement;\n\tprivate _splitView!: SplitView;\n\tprivate _preview!: ICodeEditor;\n\tprivate _previewModelReference!: IReference<ITextEditorModel>;\n\tprivate _previewNotAvailableMessage!: TextModel;\n\tprivate _previewContainer!: HTMLElement;\n\tprivate _messageContainer!: HTMLElement;\n\tprivate _dim = new dom.Dimension(0, 0);\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tprivate _defaultTreeKeyboardSupport: boolean,\n\t\tpublic layoutData: LayoutData,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@ITextModelService private readonly _textModelResolverService: ITextModelService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@peekView.IPeekViewService private readonly _peekViewService: peekView.IPeekViewService,\n\t\t@ILabelService private readonly _uriLabel: ILabelService,\n\t\t@IUndoRedoService private readonly _undoRedoService: IUndoRedoService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t) {\n\t\tsuper(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true, supportOnTitleClick: true }, _instantiationService);\n\n\t\tthis._applyTheme(themeService.getColorTheme());\n\t\tthis._callOnDispose.add(themeService.onDidColorThemeChange(this._applyTheme.bind(this)));\n\t\tthis._peekViewService.addExclusiveWidget(editor, this);\n\t\tthis.create();\n\t}\n\n\toverride dispose(): void {\n\t\tthis.setModel(undefined);\n\t\tthis._callOnDispose.dispose();\n\t\tthis._disposeOnNewModel.dispose();\n\t\tdispose(this._preview);\n\t\tdispose(this._previewNotAvailableMessage);\n\t\tdispose(this._tree);\n\t\tdispose(this._previewModelReference);\n\t\tthis._splitView.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tprivate _applyTheme(theme: IColorTheme) {\n\t\tconst borderColor = theme.getColor(peekView.peekViewBorder) || Color.transparent;\n\t\tthis.style({\n\t\t\tarrowColor: borderColor,\n\t\t\tframeColor: borderColor,\n\t\t\theaderBackgroundColor: theme.getColor(peekView.peekViewTitleBackground) || Color.transparent,\n\t\t\tprimaryHeadingColor: theme.getColor(peekView.peekViewTitleForeground),\n\t\t\tsecondaryHeadingColor: theme.getColor(peekView.peekViewTitleInfoForeground)\n\t\t});\n\t}\n\n\toverride show(where: IRange) {\n\t\tthis.editor.revealRangeInCenterIfOutsideViewport(where, ScrollType.Smooth);\n\t\tsuper.show(where, this.layoutData.heightInLines || 18);\n\t}\n\n\tfocusOnReferenceTree(): void {\n\t\tthis._tree.domFocus();\n\t}\n\n\tfocusOnPreviewEditor(): void {\n\t\tthis._preview.focus();\n\t}\n\n\tisPreviewEditorFocused(): boolean {\n\t\treturn this._preview.hasTextFocus();\n\t}\n\n\tprotected override _onTitleClick(e: IMouseEvent): void {\n\t\tif (this._preview && this._preview.getModel()) {\n\t\t\tthis._onDidSelectReference.fire({\n\t\t\t\telement: this._getFocusedReference(),\n\t\t\t\tkind: e.ctrlKey || e.metaKey || e.altKey ? 'side' : 'open',\n\t\t\t\tsource: 'title'\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected _fillBody(containerElement: HTMLElement): void {\n\t\tthis.setCssClass('reference-zone-widget');\n\n\t\t// message pane\n\t\tthis._messageContainer = dom.append(containerElement, dom.$('div.messages'));\n\t\tdom.hide(this._messageContainer);\n\n\t\tthis._splitView = new SplitView(containerElement, { orientation: Orientation.HORIZONTAL });\n\n\t\t// editor\n\t\tthis._previewContainer = dom.append(containerElement, dom.$('div.preview.inline'));\n\t\tlet options: IEditorOptions = {\n\t\t\tscrollBeyondLastLine: false,\n\t\t\tscrollbar: {\n\t\t\t\tverticalScrollbarSize: 14,\n\t\t\t\thorizontal: 'auto',\n\t\t\t\tuseShadows: true,\n\t\t\t\tverticalHasArrows: false,\n\t\t\t\thorizontalHasArrows: false,\n\t\t\t\talwaysConsumeMouseWheel: false\n\t\t\t},\n\t\t\toverviewRulerLanes: 2,\n\t\t\tfixedOverflowWidgets: true,\n\t\t\tminimap: {\n\t\t\t\tenabled: false\n\t\t\t}\n\t\t};\n\t\tthis._preview = this._instantiationService.createInstance(EmbeddedCodeEditorWidget, this._previewContainer, options, this.editor);\n\t\tdom.hide(this._previewContainer);\n\t\tthis._previewNotAvailableMessage = new TextModel(nls.localize('missingPreviewMessage', \"no preview available\"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null, this._undoRedoService, this._languageService, this._languageConfigurationService);\n\n\t\t// tree\n\t\tthis._treeContainer = dom.append(containerElement, dom.$('div.ref-tree.inline'));\n\t\tconst treeOptions: IWorkbenchAsyncDataTreeOptions<TreeElement, FuzzyScore> = {\n\t\t\tkeyboardSupport: this._defaultTreeKeyboardSupport,\n\t\t\taccessibilityProvider: new AccessibilityProvider(),\n\t\t\tkeyboardNavigationLabelProvider: this._instantiationService.createInstance(StringRepresentationProvider),\n\t\t\tidentityProvider: new IdentityProvider(),\n\t\t\topenOnSingleClick: true,\n\t\t\tselectionNavigation: true,\n\t\t\toverrideStyles: {\n\t\t\t\tlistBackground: peekView.peekViewResultsBackground\n\t\t\t}\n\t\t};\n\t\tif (this._defaultTreeKeyboardSupport) {\n\t\t\t// the tree will consume `Escape` and prevent the widget from closing\n\t\t\tthis._callOnDispose.add(dom.addStandardDisposableListener(this._treeContainer, 'keydown', (e) => {\n\t\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\t\tthis._keybindingService.dispatchEvent(e, e.target);\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}, true));\n\t\t}\n\t\tthis._tree = this._instantiationService.createInstance(\n\t\t\tReferencesTree,\n\t\t\t'ReferencesWidget',\n\t\t\tthis._treeContainer,\n\t\t\tnew Delegate(),\n\t\t\t[\n\t\t\t\tthis._instantiationService.createInstance(FileReferencesRenderer),\n\t\t\t\tthis._instantiationService.createInstance(OneReferenceRenderer),\n\t\t\t],\n\t\t\tthis._instantiationService.createInstance(DataSource),\n\t\t\ttreeOptions,\n\t\t);\n\n\t\t// split stuff\n\t\tthis._splitView.addView({\n\t\t\tonDidChange: Event.None,\n\t\t\telement: this._previewContainer,\n\t\t\tminimumSize: 200,\n\t\t\tmaximumSize: Number.MAX_VALUE,\n\t\t\tlayout: (width) => {\n\t\t\t\tthis._preview.layout({ height: this._dim.height, width });\n\t\t\t}\n\t\t}, Sizing.Distribute);\n\n\t\tthis._splitView.addView({\n\t\t\tonDidChange: Event.None,\n\t\t\telement: this._treeContainer,\n\t\t\tminimumSize: 100,\n\t\t\tmaximumSize: Number.MAX_VALUE,\n\t\t\tlayout: (width) => {\n\t\t\t\tthis._treeContainer.style.height = `${this._dim.height}px`;\n\t\t\t\tthis._treeContainer.style.width = `${width}px`;\n\t\t\t\tthis._tree.layout(this._dim.height, width);\n\t\t\t}\n\t\t}, Sizing.Distribute);\n\n\t\tthis._disposables.add(this._splitView.onDidSashChange(() => {\n\t\t\tif (this._dim.width) {\n\t\t\t\tthis.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width;\n\t\t\t}\n\t\t}, undefined));\n\n\t\t// listen on selection and focus\n\t\tlet onEvent = (element: any, kind: 'show' | 'goto' | 'side') => {\n\t\t\tif (element instanceof OneReference) {\n\t\t\t\tif (kind === 'show') {\n\t\t\t\t\tthis._revealReference(element, false);\n\t\t\t\t}\n\t\t\t\tthis._onDidSelectReference.fire({ element, kind, source: 'tree' });\n\t\t\t}\n\t\t};\n\t\tthis._tree.onDidOpen(e => {\n\t\t\tif (e.sideBySide) {\n\t\t\t\tonEvent(e.element, 'side');\n\t\t\t} else if (e.editorOptions.pinned) {\n\t\t\t\tonEvent(e.element, 'goto');\n\t\t\t} else {\n\t\t\t\tonEvent(e.element, 'show');\n\t\t\t}\n\t\t});\n\n\t\tdom.hide(this._treeContainer);\n\t}\n\n\tprotected override _onWidth(width: number) {\n\t\tif (this._dim) {\n\t\t\tthis._doLayoutBody(this._dim.height, width);\n\t\t}\n\t}\n\n\tprotected override _doLayoutBody(heightInPixel: number, widthInPixel: number): void {\n\t\tsuper._doLayoutBody(heightInPixel, widthInPixel);\n\t\tthis._dim = new dom.Dimension(widthInPixel, heightInPixel);\n\t\tthis.layoutData.heightInLines = this._viewZone ? this._viewZone.heightInLines : this.layoutData.heightInLines;\n\t\tthis._splitView.layout(widthInPixel);\n\t\tthis._splitView.resizeView(0, widthInPixel * this.layoutData.ratio);\n\t}\n\n\tsetSelection(selection: OneReference): Promise<any> {\n\t\treturn this._revealReference(selection, true).then(() => {\n\t\t\tif (!this._model) {\n\t\t\t\t// disposed\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// show in tree\n\t\t\tthis._tree.setSelection([selection]);\n\t\t\tthis._tree.setFocus([selection]);\n\t\t});\n\t}\n\n\tsetModel(newModel: ReferencesModel | undefined): Promise<any> {\n\t\t// clean up\n\t\tthis._disposeOnNewModel.clear();\n\t\tthis._model = newModel;\n\t\tif (this._model) {\n\t\t\treturn this._onNewModel();\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n\n\tprivate _onNewModel(): Promise<any> {\n\t\tif (!this._model) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tif (this._model.isEmpty) {\n\t\t\tthis.setTitle('');\n\t\t\tthis._messageContainer.innerText = nls.localize('noResults', \"No results\");\n\t\t\tdom.show(this._messageContainer);\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tdom.hide(this._messageContainer);\n\t\tthis._decorationsManager = new DecorationsManager(this._preview, this._model);\n\t\tthis._disposeOnNewModel.add(this._decorationsManager);\n\n\t\t// listen on model changes\n\t\tthis._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(reference => this._tree.rerender(reference)));\n\n\t\t// listen on editor\n\t\tthis._disposeOnNewModel.add(this._preview.onMouseDown(e => {\n\t\t\tconst { event, target } = e;\n\t\t\tif (event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst element = this._getFocusedReference();\n\t\t\tif (!element) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onDidSelectReference.fire({\n\t\t\t\telement: { uri: element.uri, range: target.range! },\n\t\t\t\tkind: (event.ctrlKey || event.metaKey || event.altKey) ? 'side' : 'open',\n\t\t\t\tsource: 'editor'\n\t\t\t});\n\t\t}));\n\n\t\t// make sure things are rendered\n\t\tthis.container!.classList.add('results-loaded');\n\t\tdom.show(this._treeContainer);\n\t\tdom.show(this._previewContainer);\n\t\tthis._splitView.layout(this._dim.width);\n\t\tthis.focusOnReferenceTree();\n\n\t\t// pick input and a reference to begin with\n\t\treturn this._tree.setInput(this._model.groups.length === 1 ? this._model.groups[0] : this._model);\n\t}\n\n\tprivate _getFocusedReference(): OneReference | undefined {\n\t\tconst [element] = this._tree.getFocus();\n\t\tif (element instanceof OneReference) {\n\t\t\treturn element;\n\t\t} else if (element instanceof FileReferences) {\n\t\t\tif (element.children.length > 0) {\n\t\t\t\treturn element.children[0];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tasync revealReference(reference: OneReference): Promise<void> {\n\t\tawait this._revealReference(reference, false);\n\t\tthis._onDidSelectReference.fire({ element: reference, kind: 'goto', source: 'tree' });\n\t}\n\n\tprivate _revealedReference?: OneReference;\n\n\tprivate async _revealReference(reference: OneReference, revealParent: boolean): Promise<void> {\n\n\t\t// check if there is anything to do...\n\t\tif (this._revealedReference === reference) {\n\t\t\treturn;\n\t\t}\n\t\tthis._revealedReference = reference;\n\n\t\t// Update widget header\n\t\tif (reference.uri.scheme !== Schemas.inMemory) {\n\t\t\tthis.setTitle(basenameOrAuthority(reference.uri), this._uriLabel.getUriLabel(dirname(reference.uri)));\n\t\t} else {\n\t\t\tthis.setTitle(nls.localize('peekView.alternateTitle', \"References\"));\n\t\t}\n\n\t\tconst promise = this._textModelResolverService.createModelReference(reference.uri);\n\n\t\tif (this._tree.getInput() === reference.parent) {\n\t\t\tthis._tree.reveal(reference);\n\t\t} else {\n\t\t\tif (revealParent) {\n\t\t\t\tthis._tree.reveal(reference.parent);\n\t\t\t}\n\t\t\tawait this._tree.expand(reference.parent);\n\t\t\tthis._tree.reveal(reference);\n\t\t}\n\n\t\tconst ref = await promise;\n\n\t\tif (!this._model) {\n\t\t\t// disposed\n\t\t\tref.dispose();\n\t\t\treturn;\n\t\t}\n\n\t\tdispose(this._previewModelReference);\n\n\t\t// show in editor\n\t\tconst model = ref.object;\n\t\tif (model) {\n\t\t\tconst scrollType = this._preview.getModel() === model.textEditorModel ? ScrollType.Smooth : ScrollType.Immediate;\n\t\t\tconst sel = Range.lift(reference.range).collapseToStart();\n\t\t\tthis._previewModelReference = ref;\n\t\t\tthis._preview.setModel(model.textEditorModel);\n\t\t\tthis._preview.setSelection(sel);\n\t\t\tthis._preview.revealRangeInCenter(sel, scrollType);\n\t\t} else {\n\t\t\tthis._preview.setModel(this._previewNotAvailableMessage);\n\t\t\tref.dispose();\n\t\t}\n\t}\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 { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { Location } from 'vs/editor/common/languages';\nimport { getOuterEditor, PeekContext } from 'vs/editor/contrib/peekView/browser/peekView';\nimport * as nls from 'vs/nls';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { TextEditorSelectionSource } from 'vs/platform/editor/common/editor';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IListService, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementCanExpand } from 'vs/platform/list/browser/listService';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';\nimport { OneReference, ReferencesModel } from '../referencesModel';\nimport { LayoutData, ReferenceWidget } from './referencesWidget';\n\nexport const ctxReferenceSearchVisible = new RawContextKey<boolean>('referenceSearchVisible', false, nls.localize('referenceSearchVisible', \"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'\"));\n\nexport abstract class ReferencesController implements IEditorContribution {\n\n\tstatic readonly ID = 'editor.contrib.referencesController';\n\n\tprivate readonly _disposables = new DisposableStore();\n\n\tprivate _widget?: ReferenceWidget;\n\tprivate _model?: ReferencesModel;\n\tprivate _peekMode?: boolean;\n\tprivate _requestIdPool = 0;\n\tprivate _ignoreModelChangeEvent = false;\n\n\tprivate readonly _referenceSearchVisible: IContextKey<boolean>;\n\n\tstatic get(editor: ICodeEditor): ReferencesController | null {\n\t\treturn editor.getContribution<ReferencesController>(ReferencesController.ID);\n\t}\n\n\tconstructor(\n\t\tprivate readonly _defaultTreeKeyboardSupport: boolean,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICodeEditorService private readonly _editorService: ICodeEditorService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IStorageService private readonly _storageService: IStorageService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t) {\n\n\t\tthis._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService);\n\t}\n\n\tdispose(): void {\n\t\tthis._referenceSearchVisible.reset();\n\t\tthis._disposables.dispose();\n\t\tthis._widget?.dispose();\n\t\tthis._model?.dispose();\n\t\tthis._widget = undefined;\n\t\tthis._model = undefined;\n\t}\n\n\ttoggleWidget(range: Range, modelPromise: CancelablePromise<ReferencesModel>, peekMode: boolean): void {\n\n\t\t// close current widget and return early is position didn't change\n\t\tlet widgetPosition: Position | undefined;\n\t\tif (this._widget) {\n\t\t\twidgetPosition = this._widget.position;\n\t\t}\n\t\tthis.closeWidget();\n\t\tif (!!widgetPosition && range.containsPosition(widgetPosition)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._peekMode = peekMode;\n\t\tthis._referenceSearchVisible.set(true);\n\n\t\t// close the widget on model/mode changes\n\t\tthis._disposables.add(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); }));\n\t\tthis._disposables.add(this._editor.onDidChangeModel(() => {\n\t\t\tif (!this._ignoreModelChangeEvent) {\n\t\t\t\tthis.closeWidget();\n\t\t\t}\n\t\t}));\n\t\tconst storageKey = 'peekViewLayout';\n\t\tconst data = LayoutData.fromJSON(this._storageService.get(storageKey, StorageScope.GLOBAL, '{}'));\n\t\tthis._widget = this._instantiationService.createInstance(ReferenceWidget, this._editor, this._defaultTreeKeyboardSupport, data);\n\t\tthis._widget.setTitle(nls.localize('labelLoading', \"Loading...\"));\n\t\tthis._widget.show(range);\n\n\t\tthis._disposables.add(this._widget.onDidClose(() => {\n\t\t\tmodelPromise.cancel();\n\t\t\tif (this._widget) {\n\t\t\t\tthis._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.GLOBAL, StorageTarget.MACHINE);\n\t\t\t\tthis._widget = undefined;\n\t\t\t}\n\t\t\tthis.closeWidget();\n\t\t}));\n\n\t\tthis._disposables.add(this._widget.onDidSelectReference(event => {\n\t\t\tlet { element, kind } = event;\n\t\t\tif (!element) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tswitch (kind) {\n\t\t\t\tcase 'open':\n\t\t\t\t\tif (event.source !== 'editor' || !this._configurationService.getValue('editor.stablePeek')) {\n\t\t\t\t\t\t// when stable peek is configured we don't close\n\t\t\t\t\t\t// the peek window on selecting the editor\n\t\t\t\t\t\tthis.openReference(element, false, false);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'side':\n\t\t\t\t\tthis.openReference(element, true, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'goto':\n\t\t\t\t\tif (peekMode) {\n\t\t\t\t\t\tthis._gotoReference(element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.openReference(element, false, true);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}));\n\n\t\tconst requestId = ++this._requestIdPool;\n\n\t\tmodelPromise.then(model => {\n\n\t\t\t// still current request? widget still open?\n\t\t\tif (requestId !== this._requestIdPool || !this._widget) {\n\t\t\t\tmodel.dispose();\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthis._model?.dispose();\n\t\t\tthis._model = model;\n\n\t\t\t// show widget\n\t\t\treturn this._widget.setModel(this._model).then(() => {\n\t\t\t\tif (this._widget && this._model && this._editor.hasModel()) { // might have been closed\n\n\t\t\t\t\t// set title\n\t\t\t\t\tif (!this._model.isEmpty) {\n\t\t\t\t\t\tthis._widget.setMetaTitle(nls.localize('metaTitle.N', \"{0} ({1})\", this._model.title, this._model.references.length));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._widget.setMetaTitle('');\n\t\t\t\t\t}\n\n\t\t\t\t\t// set 'best' selection\n\t\t\t\t\tlet uri = this._editor.getModel().uri;\n\t\t\t\t\tlet pos = new Position(range.startLineNumber, range.startColumn);\n\t\t\t\t\tlet selection = this._model.nearestReference(uri, pos);\n\t\t\t\t\tif (selection) {\n\t\t\t\t\t\treturn this._widget.setSelection(selection).then(() => {\n\t\t\t\t\t\t\tif (this._widget && this._editor.getOption(EditorOption.peekWidgetDefaultFocus) === 'editor') {\n\t\t\t\t\t\t\t\tthis._widget.focusOnPreviewEditor();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t});\n\n\t\t}, error => {\n\t\t\tthis._notificationService.error(error);\n\t\t});\n\t}\n\n\tchangeFocusBetweenPreviewAndReferences() {\n\t\tif (!this._widget) {\n\t\t\t// can be called while still resolving...\n\t\t\treturn;\n\t\t}\n\t\tif (this._widget.isPreviewEditorFocused()) {\n\t\t\tthis._widget.focusOnReferenceTree();\n\t\t} else {\n\t\t\tthis._widget.focusOnPreviewEditor();\n\t\t}\n\t}\n\n\tasync goToNextOrPreviousReference(fwd: boolean) {\n\t\tif (!this._editor.hasModel() || !this._model || !this._widget) {\n\t\t\t// can be called while still resolving...\n\t\t\treturn;\n\t\t}\n\t\tconst currentPosition = this._widget.position;\n\t\tif (!currentPosition) {\n\t\t\treturn;\n\t\t}\n\t\tconst source = this._model.nearestReference(this._editor.getModel().uri, currentPosition);\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\t\tconst target = this._model.nextOrPreviousReference(source, fwd);\n\t\tconst editorFocus = this._editor.hasTextFocus();\n\t\tconst previewEditorFocus = this._widget.isPreviewEditorFocused();\n\t\tawait this._widget.setSelection(target);\n\t\tawait this._gotoReference(target);\n\t\tif (editorFocus) {\n\t\t\tthis._editor.focus();\n\t\t} else if (this._widget && previewEditorFocus) {\n\t\t\tthis._widget.focusOnPreviewEditor();\n\t\t}\n\t}\n\n\tasync revealReference(reference: OneReference): Promise<void> {\n\t\tif (!this._editor.hasModel() || !this._model || !this._widget) {\n\t\t\t// can be called while still resolving...\n\t\t\treturn;\n\t\t}\n\n\t\tawait this._widget.revealReference(reference);\n\t}\n\n\tcloseWidget(focusEditor = true): void {\n\t\tthis._widget?.dispose();\n\t\tthis._model?.dispose();\n\t\tthis._referenceSearchVisible.reset();\n\t\tthis._disposables.clear();\n\t\tthis._widget = undefined;\n\t\tthis._model = undefined;\n\t\tif (focusEditor) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t\tthis._requestIdPool += 1; // Cancel pending requests\n\t}\n\n\tprivate _gotoReference(ref: Location): Promise<any> {\n\t\tif (this._widget) {\n\t\t\tthis._widget.hide();\n\t\t}\n\n\t\tthis._ignoreModelChangeEvent = true;\n\t\tconst range = Range.lift(ref.range).collapseToStart();\n\n\t\treturn this._editorService.openCodeEditor({\n\t\t\tresource: ref.uri,\n\t\t\toptions: { selection: range, selectionSource: TextEditorSelectionSource.JUMP }\n\t\t}, this._editor).then(openedEditor => {\n\t\t\tthis._ignoreModelChangeEvent = false;\n\n\t\t\tif (!openedEditor || !this._widget) {\n\t\t\t\t// something went wrong...\n\t\t\t\tthis.closeWidget();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this._editor === openedEditor) {\n\t\t\t\t//\n\t\t\t\tthis._widget.show(range);\n\t\t\t\tthis._widget.focusOnReferenceTree();\n\n\t\t\t} else {\n\t\t\t\t// we opened a different editor instance which means a different controller instance.\n\t\t\t\t// therefore we stop with this controller and continue with the other\n\t\t\t\tconst other = ReferencesController.get(openedEditor);\n\t\t\t\tconst model = this._model!.clone();\n\n\t\t\t\tthis.closeWidget();\n\t\t\t\topenedEditor.focus();\n\n\t\t\t\tother?.toggleWidget(\n\t\t\t\t\trange,\n\t\t\t\t\tcreateCancelablePromise(_ => Promise.resolve(model)),\n\t\t\t\t\tthis._peekMode ?? false\n\t\t\t\t);\n\t\t\t}\n\n\t\t}, (err) => {\n\t\t\tthis._ignoreModelChangeEvent = false;\n\t\t\tonUnexpectedError(err);\n\t\t});\n\t}\n\n\topenReference(ref: Location, sideBySide: boolean, pinned: boolean): void {\n\t\t// clear stage\n\t\tif (!sideBySide) {\n\t\t\tthis.closeWidget();\n\t\t}\n\n\t\tconst { uri, range } = ref;\n\t\tthis._editorService.openCodeEditor({\n\t\t\tresource: uri,\n\t\t\toptions: { selection: range, selectionSource: TextEditorSelectionSource.JUMP, pinned }\n\t\t}, this._editor, sideBySide);\n\t}\n}\n\nfunction withController(accessor: ServicesAccessor, fn: (controller: ReferencesController) => void): void {\n\tconst outerEditor = getOuterEditor(accessor);\n\tif (!outerEditor) {\n\t\treturn;\n\t}\n\tconst controller = ReferencesController.get(outerEditor);\n\tif (controller) {\n\t\tfn(controller);\n\t}\n}\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'togglePeekWidgetFocus',\n\tweight: KeybindingWeight.EditorContrib,\n\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.F2),\n\twhen: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor),\n\thandler(accessor) {\n\t\twithController(accessor, controller => {\n\t\t\tcontroller.changeFocusBetweenPreviewAndReferences();\n\t\t});\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'goToNextReference',\n\tweight: KeybindingWeight.EditorContrib - 10,\n\tprimary: KeyCode.F4,\n\tsecondary: [KeyCode.F12],\n\twhen: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor),\n\thandler(accessor) {\n\t\twithController(accessor, controller => {\n\t\t\tcontroller.goToNextOrPreviousReference(true);\n\t\t});\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'goToPreviousReference',\n\tweight: KeybindingWeight.EditorContrib - 10,\n\tprimary: KeyMod.Shift | KeyCode.F4,\n\tsecondary: [KeyMod.Shift | KeyCode.F12],\n\twhen: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor),\n\thandler(accessor) {\n\t\twithController(accessor, controller => {\n\t\t\tcontroller.goToNextOrPreviousReference(false);\n\t\t});\n\t}\n});\n\n// commands that aren't needed anymore because there is now ContextKeyExpr.OR\nCommandsRegistry.registerCommandAlias('goToNextReferenceFromEmbeddedEditor', 'goToNextReference');\nCommandsRegistry.registerCommandAlias('goToPreviousReferenceFromEmbeddedEditor', 'goToPreviousReference');\n\n// close\nCommandsRegistry.registerCommandAlias('closeReferenceSearchEditor', 'closeReferenceSearch');\nCommandsRegistry.registerCommand(\n\t'closeReferenceSearch',\n\taccessor => withController(accessor, controller => controller.closeWidget())\n);\nKeybindingsRegistry.registerKeybindingRule({\n\tid: 'closeReferenceSearch',\n\tweight: KeybindingWeight.EditorContrib - 101,\n\tprimary: KeyCode.Escape,\n\tsecondary: [KeyMod.Shift | KeyCode.Escape],\n\twhen: ContextKeyExpr.and(PeekContext.inPeekEditor, ContextKeyExpr.not('config.editor.stablePeek'))\n});\nKeybindingsRegistry.registerKeybindingRule({\n\tid: 'closeReferenceSearch',\n\tweight: KeybindingWeight.WorkbenchContrib + 50,\n\tprimary: KeyCode.Escape,\n\tsecondary: [KeyMod.Shift | KeyCode.Escape],\n\twhen: ContextKeyExpr.and(ctxReferenceSearchVisible, ContextKeyExpr.not('config.editor.stablePeek'))\n});\n\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'revealReference',\n\tweight: KeybindingWeight.WorkbenchContrib,\n\tprimary: KeyCode.Enter,\n\tmac: {\n\t\tprimary: KeyCode.Enter,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.DownArrow]\n\t},\n\twhen: ContextKeyExpr.and(ctxReferenceSearchVisible, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse.negate(), WorkbenchTreeElementCanExpand.negate()),\n\thandler(accessor: ServicesAccessor) {\n\t\tconst listService = accessor.get(IListService);\n\t\tconst focus = <any[]>listService.lastFocusedList?.getFocus();\n\t\tif (Array.isArray(focus) && focus[0] instanceof OneReference) {\n\t\t\twithController(accessor, controller => controller.revealReference(focus[0]));\n\t\t}\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'openReferenceToSide',\n\tweight: KeybindingWeight.EditorContrib,\n\tprimary: KeyMod.CtrlCmd | KeyCode.Enter,\n\tmac: {\n\t\tprimary: KeyMod.WinCtrl | KeyCode.Enter\n\t},\n\twhen: ContextKeyExpr.and(ctxReferenceSearchVisible, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse.negate(), WorkbenchTreeElementCanExpand.negate()),\n\thandler(accessor: ServicesAccessor) {\n\t\tconst listService = accessor.get(IListService);\n\t\tconst focus = <any[]>listService.lastFocusedList?.getFocus();\n\t\tif (Array.isArray(focus) && focus[0] instanceof OneReference) {\n\t\t\twithController(accessor, controller => controller.openReference(focus[0], true, true));\n\t\t}\n\t}\n});\n\nCommandsRegistry.registerCommand('openReference', (accessor) => {\n\tconst listService = accessor.get(IListService);\n\tconst focus = <any[]>listService.lastFocusedList?.getFocus();\n\tif (Array.isArray(focus) && focus[0] instanceof OneReference) {\n\t\twithController(accessor, controller => controller.openReference(focus[0], false, true));\n\t}\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 { isStandalone } from 'vs/base/browser/browser';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { createCancelablePromise, raceCancellation } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { isWeb } from 'vs/base/common/platform';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { IActiveCodeEditor, ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerInstantiatedEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { EditorOption, GoToLocationValues } from 'vs/editor/common/config/editorOptions';\nimport * as corePosition from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { IEditorAction, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { isLocationLink, Location, LocationLink } from 'vs/editor/common/languages';\nimport { ReferencesController } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesController';\nimport { ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel';\nimport { ISymbolNavigationService } from 'vs/editor/contrib/gotoSymbol/browser/symbolNavigation';\nimport { MessageController } from 'vs/editor/contrib/message/browser/messageController';\nimport { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView';\nimport * as nls from 'vs/nls';\nimport { ISubmenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { TextEditorSelectionRevealType, TextEditorSelectionSource } from 'vs/platform/editor/common/editor';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IEditorProgressService } from 'vs/platform/progress/common/progress';\nimport { getDeclarationsAtPosition, getDefinitionsAtPosition, getImplementationsAtPosition, getReferencesAtPosition, getTypeDefinitionsAtPosition } from './goToSymbol';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\n\nMenuRegistry.appendMenuItem(MenuId.EditorContext, <ISubmenuItem>{\n\tsubmenu: MenuId.EditorContextPeek,\n\ttitle: nls.localize('peek.submenu', \"Peek\"),\n\tgroup: 'navigation',\n\torder: 100\n});\n\nexport interface SymbolNavigationActionConfig {\n\topenToSide: boolean;\n\topenInPeek: boolean;\n\tmuteMessage: boolean;\n}\n\n\nconst _goToActionIds = new Set<string>();\n\nfunction registerGoToAction<T extends EditorAction>(ctor: { new(): T }): T {\n\tconst result = new ctor();\n\tregisterInstantiatedEditorAction(result);\n\t_goToActionIds.add(result.id);\n\treturn result;\n}\n\nexport class SymbolNavigationAnchor {\n\n\tstatic is(thing: any): thing is SymbolNavigationAnchor {\n\t\tif (!thing || typeof thing !== 'object') {\n\t\t\treturn false;\n\t\t}\n\t\tif (thing instanceof SymbolNavigationAnchor) {\n\t\t\treturn true;\n\t\t}\n\t\tif (corePosition.Position.isIPosition((<SymbolNavigationAnchor>thing).position) && (<SymbolNavigationAnchor>thing).model) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tconstructor(readonly model: ITextModel, readonly position: corePosition.Position) { }\n}\n\nexport abstract class SymbolNavigationAction extends EditorAction {\n\n\treadonly configuration: SymbolNavigationActionConfig;\n\n\tconstructor(configuration: SymbolNavigationActionConfig, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.configuration = configuration;\n\t}\n\n\trun(accessor: ServicesAccessor, editor: ICodeEditor, arg?: SymbolNavigationAnchor | unknown): Promise<void> {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\t\tconst notificationService = accessor.get(INotificationService);\n\t\tconst editorService = accessor.get(ICodeEditorService);\n\t\tconst progressService = accessor.get(IEditorProgressService);\n\t\tconst symbolNavService = accessor.get(ISymbolNavigationService);\n\t\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\n\t\tconst model = editor.getModel();\n\t\tconst position = editor.getPosition();\n\t\tconst anchor = SymbolNavigationAnchor.is(arg) ? arg : new SymbolNavigationAnchor(model, position);\n\n\t\tconst cts = new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);\n\n\t\tconst promise = raceCancellation(this._getLocationModel(languageFeaturesService, anchor.model, anchor.position, cts.token), cts.token).then(async references => {\n\n\t\t\tif (!references || cts.token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\talert(references.ariaMessage);\n\n\t\t\tlet altAction: IEditorAction | null | undefined;\n\t\t\tif (references.referenceAt(model.uri, position)) {\n\t\t\t\tconst altActionId = this._getAlternativeCommand(editor);\n\t\t\t\tif (altActionId !== this.id && _goToActionIds.has(altActionId)) {\n\t\t\t\t\taltAction = editor.getAction(altActionId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst referenceCount = references.references.length;\n\n\t\t\tif (referenceCount === 0) {\n\t\t\t\t// no result -> show message\n\t\t\t\tif (!this.configuration.muteMessage) {\n\t\t\t\t\tconst info = model.getWordAtPosition(position);\n\t\t\t\t\tMessageController.get(editor)?.showMessage(this._getNoResultFoundMessage(info), position);\n\t\t\t\t}\n\t\t\t} else if (referenceCount === 1 && altAction) {\n\t\t\t\t// already at the only result, run alternative\n\t\t\t\taltAction.run();\n\n\t\t\t} else {\n\t\t\t\t// normal results handling\n\t\t\t\treturn this._onResult(editorService, symbolNavService, editor, references);\n\t\t\t}\n\n\t\t}, (err) => {\n\t\t\t// report an error\n\t\t\tnotificationService.error(err);\n\t\t}).finally(() => {\n\t\t\tcts.dispose();\n\t\t});\n\n\t\tprogressService.showWhile(promise, 250);\n\t\treturn promise;\n\t}\n\n\tprotected abstract _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel | undefined>;\n\n\tprotected abstract _getNoResultFoundMessage(info: IWordAtPosition | null): string;\n\n\tprotected abstract _getAlternativeCommand(editor: IActiveCodeEditor): string;\n\n\tprotected abstract _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues;\n\n\tprivate async _onResult(editorService: ICodeEditorService, symbolNavService: ISymbolNavigationService, editor: IActiveCodeEditor, model: ReferencesModel): Promise<void> {\n\n\t\tconst gotoLocation = this._getGoToPreference(editor);\n\t\tif (!(editor instanceof EmbeddedCodeEditorWidget) && (this.configuration.openInPeek || (gotoLocation === 'peek' && model.references.length > 1))) {\n\t\t\tthis._openInPeek(editor, model);\n\n\t\t} else {\n\t\t\tconst next = model.firstReference()!;\n\t\t\tconst peek = model.references.length > 1 && gotoLocation === 'gotoAndPeek';\n\t\t\tconst targetEditor = await this._openReference(editor, editorService, next, this.configuration.openToSide, !peek);\n\t\t\tif (peek && targetEditor) {\n\t\t\t\tthis._openInPeek(targetEditor, model);\n\t\t\t} else {\n\t\t\t\tmodel.dispose();\n\t\t\t}\n\n\t\t\t// keep remaining locations around when using\n\t\t\t// 'goto'-mode\n\t\t\tif (gotoLocation === 'goto') {\n\t\t\t\tsymbolNavService.put(next);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean, highlight: boolean): Promise<ICodeEditor | undefined> {\n\t\t// range is the target-selection-range when we have one\n\t\t// and the fallback is the 'full' range\n\t\tlet range: IRange | undefined = undefined;\n\t\tif (isLocationLink(reference)) {\n\t\t\trange = reference.targetSelectionRange;\n\t\t}\n\t\tif (!range) {\n\t\t\trange = reference.range;\n\t\t}\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst targetEditor = await editorService.openCodeEditor({\n\t\t\tresource: reference.uri,\n\t\t\toptions: {\n\t\t\t\tselection: Range.collapseToStart(range),\n\t\t\t\tselectionRevealType: TextEditorSelectionRevealType.NearTopIfOutsideViewport,\n\t\t\t\tselectionSource: TextEditorSelectionSource.JUMP\n\t\t\t}\n\t\t}, editor, sideBySide);\n\n\t\tif (!targetEditor) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (highlight) {\n\t\t\tconst modelNow = targetEditor.getModel();\n\t\t\tconst ids = targetEditor.deltaDecorations([], [{ range, options: { description: 'symbol-navigate-action-highlight', className: 'symbolHighlight' } }]);\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (targetEditor.getModel() === modelNow) {\n\t\t\t\t\ttargetEditor.deltaDecorations(ids, []);\n\t\t\t\t}\n\t\t\t}, 350);\n\t\t}\n\n\t\treturn targetEditor;\n\t}\n\n\tprivate _openInPeek(target: ICodeEditor, model: ReferencesModel) {\n\t\tconst controller = ReferencesController.get(target);\n\t\tif (controller && target.hasModel()) {\n\t\t\tcontroller.toggleWidget(target.getSelection(), createCancelablePromise(_ => Promise.resolve(model)), this.configuration.openInPeek);\n\t\t} else {\n\t\t\tmodel.dispose();\n\t\t}\n\t}\n}\n\n//#region --- DEFINITION\n\nexport class DefinitionAction extends SymbolNavigationAction {\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, token), nls.localize('def.title', 'Definitions'));\n\t}\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && info.word\n\t\t\t? nls.localize('noResultWord', \"No definition found for '{0}'\", info.word)\n\t\t\t: nls.localize('generic.noResults', \"No definition found\");\n\t}\n\n\tprotected _getAlternativeCommand(editor: IActiveCodeEditor): string {\n\t\treturn editor.getOption(EditorOption.gotoLocation).alternativeDefinitionCommand;\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn editor.getOption(EditorOption.gotoLocation).multipleDefinitions;\n\t}\n}\n\nconst goToDefinitionKb = isWeb && !isStandalone\n\t? KeyMod.CtrlCmd | KeyCode.F12\n\t: KeyCode.F12;\n\nregisterGoToAction(class GoToDefinitionAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.revealDefinition';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: GoToDefinitionAction.id,\n\t\t\tlabel: nls.localize('actions.goToDecl.label', \"Go to Definition\"),\n\t\t\talias: 'Go to Definition',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasDefinitionProvider,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: goToDefinitionKb,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.1\n\t\t\t}\n\t\t});\n\t\tCommandsRegistry.registerCommandAlias('editor.action.goToDeclaration', GoToDefinitionAction.id);\n\t}\n});\n\nregisterGoToAction(class OpenDefinitionToSideAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.revealDefinitionAside';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: true,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: OpenDefinitionToSideAction.id,\n\t\t\tlabel: nls.localize('actions.goToDeclToSide.label', \"Open Definition to the Side\"),\n\t\t\talias: 'Open Definition to the Side',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasDefinitionProvider,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, goToDefinitionKb),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t\tCommandsRegistry.registerCommandAlias('editor.action.openDeclarationToTheSide', OpenDefinitionToSideAction.id);\n\t}\n});\n\nregisterGoToAction(class PeekDefinitionAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.peekDefinition';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: true,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: PeekDefinitionAction.id,\n\t\t\tlabel: nls.localize('actions.previewDecl.label', \"Peek Definition\"),\n\t\t\talias: 'Peek Definition',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasDefinitionProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.F12,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tmenuId: MenuId.EditorContextPeek,\n\t\t\t\tgroup: 'peek',\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t\tCommandsRegistry.registerCommandAlias('editor.action.previewDeclaration', PeekDefinitionAction.id);\n\t}\n});\n\n//#endregion\n\n//#region --- DECLARATION\n\nclass DeclarationAction extends SymbolNavigationAction {\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, token), nls.localize('decl.title', 'Declarations'));\n\t}\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && info.word\n\t\t\t? nls.localize('decl.noResultWord', \"No declaration found for '{0}'\", info.word)\n\t\t\t: nls.localize('decl.generic.noResults', \"No declaration found\");\n\t}\n\n\tprotected _getAlternativeCommand(editor: IActiveCodeEditor): string {\n\t\treturn editor.getOption(EditorOption.gotoLocation).alternativeDeclarationCommand;\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn editor.getOption(EditorOption.gotoLocation).multipleDeclarations;\n\t}\n}\n\nregisterGoToAction(class GoToDeclarationAction extends DeclarationAction {\n\n\tstatic readonly id = 'editor.action.revealDeclaration';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: GoToDeclarationAction.id,\n\t\t\tlabel: nls.localize('actions.goToDeclaration.label', \"Go to Declaration\"),\n\t\t\talias: 'Go to Declaration',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasDeclarationProvider,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.3\n\t\t\t},\n\t\t});\n\t}\n\n\tprotected override _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && info.word\n\t\t\t? nls.localize('decl.noResultWord', \"No declaration found for '{0}'\", info.word)\n\t\t\t: nls.localize('decl.generic.noResults', \"No declaration found\");\n\t}\n});\n\nregisterGoToAction(class PeekDeclarationAction extends DeclarationAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: true,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: 'editor.action.peekDeclaration',\n\t\t\tlabel: nls.localize('actions.peekDecl.label', \"Peek Declaration\"),\n\t\t\talias: 'Peek Declaration',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasDeclarationProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tmenuId: MenuId.EditorContextPeek,\n\t\t\t\tgroup: 'peek',\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n});\n\n//#endregion\n\n//#region --- TYPE DEFINITION\n\nclass TypeDefinitionAction extends SymbolNavigationAction {\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, token), nls.localize('typedef.title', 'Type Definitions'));\n\t}\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && info.word\n\t\t\t? nls.localize('goToTypeDefinition.noResultWord', \"No type definition found for '{0}'\", info.word)\n\t\t\t: nls.localize('goToTypeDefinition.generic.noResults', \"No type definition found\");\n\t}\n\n\tprotected _getAlternativeCommand(editor: IActiveCodeEditor): string {\n\t\treturn editor.getOption(EditorOption.gotoLocation).alternativeTypeDefinitionCommand;\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn editor.getOption(EditorOption.gotoLocation).multipleTypeDefinitions;\n\t}\n}\n\nregisterGoToAction(class GoToTypeDefinitionAction extends TypeDefinitionAction {\n\n\tpublic static readonly ID = 'editor.action.goToTypeDefinition';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: GoToTypeDefinitionAction.ID,\n\t\t\tlabel: nls.localize('actions.goToTypeDefinition.label', \"Go to Type Definition\"),\n\t\t\talias: 'Go to Type Definition',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasTypeDefinitionProvider,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.4\n\t\t\t}\n\t\t});\n\t}\n});\n\nregisterGoToAction(class PeekTypeDefinitionAction extends TypeDefinitionAction {\n\n\tpublic static readonly ID = 'editor.action.peekTypeDefinition';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: true,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: PeekTypeDefinitionAction.ID,\n\t\t\tlabel: nls.localize('actions.peekTypeDefinition.label', \"Peek Type Definition\"),\n\t\t\talias: 'Peek Type Definition',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasTypeDefinitionProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tmenuId: MenuId.EditorContextPeek,\n\t\t\t\tgroup: 'peek',\n\t\t\t\torder: 4\n\t\t\t}\n\t\t});\n\t}\n});\n\n//#endregion\n\n//#region --- IMPLEMENTATION\n\nclass ImplementationAction extends SymbolNavigationAction {\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, token), nls.localize('impl.title', 'Implementations'));\n\t}\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && info.word\n\t\t\t? nls.localize('goToImplementation.noResultWord', \"No implementation found for '{0}'\", info.word)\n\t\t\t: nls.localize('goToImplementation.generic.noResults', \"No implementation found\");\n\t}\n\n\tprotected _getAlternativeCommand(editor: IActiveCodeEditor): string {\n\t\treturn editor.getOption(EditorOption.gotoLocation).alternativeImplementationCommand;\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn editor.getOption(EditorOption.gotoLocation).multipleImplementations;\n\t}\n}\n\nregisterGoToAction(class GoToImplementationAction extends ImplementationAction {\n\n\tpublic static readonly ID = 'editor.action.goToImplementation';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: GoToImplementationAction.ID,\n\t\t\tlabel: nls.localize('actions.goToImplementation.label', \"Go to Implementations\"),\n\t\t\talias: 'Go to Implementations',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasImplementationProvider,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.F12,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.45\n\t\t\t}\n\t\t});\n\t}\n});\n\nregisterGoToAction(class PeekImplementationAction extends ImplementationAction {\n\n\tpublic static readonly ID = 'editor.action.peekImplementation';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: true,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: PeekImplementationAction.ID,\n\t\t\tlabel: nls.localize('actions.peekImplementation.label', \"Peek Implementations\"),\n\t\t\talias: 'Peek Implementations',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasImplementationProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tmenuId: MenuId.EditorContextPeek,\n\t\t\t\tgroup: 'peek',\n\t\t\t\torder: 5\n\t\t\t}\n\t\t});\n\t}\n});\n\n//#endregion\n\n//#region --- REFERENCES\n\nabstract class ReferencesAction extends SymbolNavigationAction {\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info\n\t\t\t? nls.localize('references.no', \"No references found for '{0}'\", info.word)\n\t\t\t: nls.localize('references.noGeneric', \"No references found\");\n\t}\n\n\tprotected _getAlternativeCommand(editor: IActiveCodeEditor): string {\n\t\treturn editor.getOption(EditorOption.gotoLocation).alternativeReferenceCommand;\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn editor.getOption(EditorOption.gotoLocation).multipleReferences;\n\t}\n}\n\nregisterGoToAction(class GoToReferencesAction extends ReferencesAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: false,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: 'editor.action.goToReferences',\n\t\t\tlabel: nls.localize('goToReferences.label', \"Go to References\"),\n\t\t\talias: 'Go to References',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasReferenceProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F12,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.45\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, true, token), nls.localize('ref.title', 'References'));\n\t}\n});\n\nregisterGoToAction(class PeekReferencesAction extends ReferencesAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\topenToSide: false,\n\t\t\topenInPeek: true,\n\t\t\tmuteMessage: false\n\t\t}, {\n\t\t\tid: 'editor.action.referenceSearch.trigger',\n\t\t\tlabel: nls.localize('references.action.label', \"Peek References\"),\n\t\t\talias: 'Peek References',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasReferenceProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tmenuId: MenuId.EditorContextPeek,\n\t\t\t\tgroup: 'peek',\n\t\t\t\torder: 6\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<ReferencesModel> {\n\t\treturn new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, token), nls.localize('ref.title', 'References'));\n\t}\n});\n\n//#endregion\n\n\n//#region --- GENERIC goto symbols command\n\nclass GenericGoToLocationAction extends SymbolNavigationAction {\n\n\tconstructor(\n\t\tconfig: SymbolNavigationActionConfig,\n\t\tprivate readonly _references: Location[],\n\t\tprivate readonly _gotoMultipleBehaviour: GoToLocationValues | undefined,\n\t) {\n\t\tsuper(config, {\n\t\t\tid: 'editor.action.goToLocation',\n\t\t\tlabel: nls.localize('label.generic', \"Go to Any Symbol\"),\n\t\t\talias: 'Go to Any Symbol',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInWalkThroughSnippet.toNegated()\n\t\t\t),\n\t\t});\n\t}\n\n\tprotected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, _model: ITextModel, _position: corePosition.Position, _token: CancellationToken): Promise<ReferencesModel | undefined> {\n\t\treturn new ReferencesModel(this._references, nls.localize('generic.title', 'Locations'));\n\t}\n\n\tprotected _getNoResultFoundMessage(info: IWordAtPosition | null): string {\n\t\treturn info && nls.localize('generic.noResult', \"No results for '{0}'\", info.word) || '';\n\t}\n\n\tprotected _getGoToPreference(editor: IActiveCodeEditor): GoToLocationValues {\n\t\treturn this._gotoMultipleBehaviour ?? editor.getOption(EditorOption.gotoLocation).multipleReferences;\n\t}\n\n\tprotected _getAlternativeCommand() { return ''; }\n}\n\nCommandsRegistry.registerCommand({\n\tid: 'editor.action.goToLocations',\n\tdescription: {\n\t\tdescription: 'Go to locations from a position in a file',\n\t\targs: [\n\t\t\t{ name: 'uri', description: 'The text document in which to start', constraint: URI },\n\t\t\t{ name: 'position', description: 'The position at which to start', constraint: corePosition.Position.isIPosition },\n\t\t\t{ name: 'locations', description: 'An array of locations.', constraint: Array },\n\t\t\t{ name: 'multiple', description: 'Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto' },\n\t\t\t{ name: 'noResultsMessage', description: 'Human readable message that shows when locations is empty.' },\n\t\t]\n\t},\n\thandler: async (accessor: ServicesAccessor, resource: any, position: any, references: any, multiple?: any, noResultsMessage?: string, openInPeek?: boolean) => {\n\t\tassertType(URI.isUri(resource));\n\t\tassertType(corePosition.Position.isIPosition(position));\n\t\tassertType(Array.isArray(references));\n\t\tassertType(typeof multiple === 'undefined' || typeof multiple === 'string');\n\t\tassertType(typeof openInPeek === 'undefined' || typeof openInPeek === 'boolean');\n\n\t\tconst editorService = accessor.get(ICodeEditorService);\n\t\tconst editor = await editorService.openCodeEditor({ resource }, editorService.getFocusedCodeEditor());\n\n\t\tif (isCodeEditor(editor)) {\n\t\t\teditor.setPosition(position);\n\t\t\teditor.revealPositionInCenterIfOutsideViewport(position, ScrollType.Smooth);\n\n\t\t\treturn editor.invokeWithinContext(accessor => {\n\t\t\t\tconst command = new class extends GenericGoToLocationAction {\n\t\t\t\t\toverride _getNoResultFoundMessage(info: IWordAtPosition | null) {\n\t\t\t\t\t\treturn noResultsMessage || super._getNoResultFoundMessage(info);\n\t\t\t\t\t}\n\t\t\t\t}({\n\t\t\t\t\tmuteMessage: !Boolean(noResultsMessage),\n\t\t\t\t\topenInPeek: Boolean(openInPeek),\n\t\t\t\t\topenToSide: false\n\t\t\t\t}, references, multiple as GoToLocationValues);\n\n\t\t\t\taccessor.get(IInstantiationService).invokeFunction(command.run.bind(command), editor);\n\t\t\t});\n\t\t}\n\t}\n});\n\nCommandsRegistry.registerCommand({\n\tid: 'editor.action.peekLocations',\n\tdescription: {\n\t\tdescription: 'Peek locations from a position in a file',\n\t\targs: [\n\t\t\t{ name: 'uri', description: 'The text document in which to start', constraint: URI },\n\t\t\t{ name: 'position', description: 'The position at which to start', constraint: corePosition.Position.isIPosition },\n\t\t\t{ name: 'locations', description: 'An array of locations.', constraint: Array },\n\t\t\t{ name: 'multiple', description: 'Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto' },\n\t\t]\n\t},\n\thandler: async (accessor: ServicesAccessor, resource: any, position: any, references: any, multiple?: any) => {\n\t\taccessor.get(ICommandService).executeCommand('editor.action.goToLocations', resource, position, references, multiple, undefined, true);\n\t}\n});\n\n//#endregion\n\n\n//#region --- REFERENCE search special commands\n\nCommandsRegistry.registerCommand({\n\tid: 'editor.action.findReferences',\n\thandler: (accessor: ServicesAccessor, resource: any, position: any) => {\n\t\tassertType(URI.isUri(resource));\n\t\tassertType(corePosition.Position.isIPosition(position));\n\n\t\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\treturn codeEditorService.openCodeEditor({ resource }, codeEditorService.getFocusedCodeEditor()).then(control => {\n\t\t\tif (!isCodeEditor(control) || !control.hasModel()) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst controller = ReferencesController.get(control);\n\t\t\tif (!controller) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst references = createCancelablePromise(token => getReferencesAtPosition(languageFeaturesService.referenceProvider, control.getModel(), corePosition.Position.lift(position), false, token).then(references => new ReferencesModel(references, nls.localize('ref.title', 'References'))));\n\t\t\tconst range = new Range(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\t\treturn Promise.resolve(controller.toggleWidget(range, references, false));\n\t\t});\n\t}\n});\n\n// use NEW command\nCommandsRegistry.registerCommandAlias('editor.action.showReferences', 'editor.action.peekLocations');\n\n//#endregion\n\n// -- unconditionally register goto-action\n\nMenuRegistry.appendMenuItems([\n\t{\n\t\tid: MenuId.MenubarGoMenu,\n\t\titem: {\n\t\t\tcommand: {\n\t\t\t\tid: 'editor.action.revealDefinition',\n\t\t\t\ttitle: nls.localize({ key: 'miGotoDefinition', comment: ['&& denotes a mnemonic'] }, \"Go to &&Definition\")\n\t\t\t},\n\t\t\tgroup: '4_symbol_nav',\n\t\t\torder: 2,\n\t\t},\n\t},\n\t{\n\t\tid: MenuId.MenubarGoMenu,\n\t\titem: {\n\t\t\tcommand: {\n\t\t\t\tid: 'editor.action.revealDeclaration',\n\t\t\t\ttitle: nls.localize({ key: 'miGotoDeclaration', comment: ['&& denotes a mnemonic'] }, \"Go to &&Declaration\")\n\t\t\t},\n\t\t\tgroup: '4_symbol_nav',\n\t\t\torder: 3,\n\n\t\t},\n\t},\n\t{\n\t\tid: MenuId.MenubarGoMenu,\n\t\titem: {\n\t\t\tcommand: {\n\t\t\t\tid: 'editor.action.goToTypeDefinition',\n\t\t\t\ttitle: nls.localize({ key: 'miGotoTypeDefinition', comment: ['&& denotes a mnemonic'] }, \"Go to &&Type Definition\")\n\t\t\t},\n\t\t\tgroup: '4_symbol_nav',\n\t\t\torder: 3,\n\t\t},\n\t},\n\t{\n\t\tid: MenuId.MenubarGoMenu,\n\t\titem: {\n\t\t\tcommand: {\n\t\t\t\tid: 'editor.action.goToImplementation',\n\t\t\t\ttitle: nls.localize({ key: 'miGotoImplementation', comment: ['&& denotes a mnemonic'] }, \"Go to &&Implementations\")\n\t\t\t},\n\t\t\tgroup: '4_symbol_nav',\n\t\t\torder: 4,\n\t\t},\n\t},\n\t{\n\t\tid: MenuId.MenubarGoMenu,\n\t\titem: {\n\t\t\tcommand: {\n\t\t\t\tid: 'editor.action.goToReferences',\n\t\t\t\ttitle: nls.localize({ key: 'miGotoReference', comment: ['&& denotes a mnemonic'] }, \"Go to &&References\")\n\t\t\t},\n\t\t\tgroup: '4_symbol_nav',\n\t\t\torder: 5,\n\t\t},\n\t},\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport 'vs/css!./goToDefinitionAtPosition';\nimport { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState';\nimport { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';\nimport { IFoundBracket } from 'vs/editor/common/textModelBracketPairs';\nimport { LocationLink } from 'vs/editor/common/languages';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture';\nimport { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView';\nimport * as nls from 'vs/nls';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { DefinitionAction } from '../goToCommands';\nimport { getDefinitionsAtPosition } from '../goToSymbol';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport class GotoDefinitionAtPositionEditorContribution implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.gotodefinitionatposition';\n\tstatic readonly MAX_SOURCE_PREVIEW_LINES = 8;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly toUnhook = new DisposableStore();\n\tprivate readonly toUnhookForKeyboard = new DisposableStore();\n\tprivate linkDecorations: string[] = [];\n\tprivate currentWordAtPosition: IWordAtPosition | null = null;\n\tprivate previousPromise: CancelablePromise<LocationLink[] | null> | null = null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ITextModelService private readonly textModelResolverService: ITextModelService,\n\t\t@ILanguageService private readonly languageService: ILanguageService,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tthis.editor = editor;\n\n\t\tlet linkGesture = new ClickLinkGesture(editor);\n\t\tthis.toUnhook.add(linkGesture);\n\n\t\tthis.toUnhook.add(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis.startFindDefinitionFromMouse(mouseEvent, withNullAsUndefined(keyboardEvent));\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => {\n\t\t\tif (this.isEnabled(mouseEvent)) {\n\t\t\t\tthis.gotoDefinition(mouseEvent.target.position!, mouseEvent.hasSideBySideModifier).then(() => {\n\t\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\t}, (error: Error) => {\n\t\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\t\tonUnexpectedError(error);\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.toUnhook.add(linkGesture.onCancel(() => {\n\t\t\tthis.removeLinkDecorations();\n\t\t\tthis.currentWordAtPosition = null;\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): GotoDefinitionAtPositionEditorContribution | null {\n\t\treturn editor.getContribution<GotoDefinitionAtPositionEditorContribution>(GotoDefinitionAtPositionEditorContribution.ID);\n\t}\n\n\tstartFindDefinitionFromCursor(position: Position) {\n\t\t// For issue: https://github.com/microsoft/vscode/issues/46257\n\t\t// equivalent to mouse move with meta/ctrl key\n\n\t\t// First find the definition and add decorations\n\t\t// to the editor to be shown with the content hover widget\n\t\treturn this.startFindDefinition(position).then(() => {\n\n\t\t\t// Add listeners for editor cursor move and key down events\n\t\t\t// Dismiss the \"extended\" editor decorations when the user hides\n\t\t\t// the hover widget. There is no event for the widget itself so these\n\t\t\t// serve as a best effort. After removing the link decorations, the hover\n\t\t\t// widget is clean and will only show declarations per next request.\n\t\t\tthis.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => {\n\t\t\t\tthis.currentWordAtPosition = null;\n\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t\t}));\n\n\t\t\tthis.toUnhookForKeyboard.add(this.editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\t\tif (e) {\n\t\t\t\t\tthis.currentWordAtPosition = null;\n\t\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\t\tthis.toUnhookForKeyboard.clear();\n\t\t\t\t}\n\t\t\t}));\n\t\t});\n\t}\n\n\tprivate startFindDefinitionFromMouse(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void {\n\n\t\t// check if we are active and on a content widget\n\t\tif (mouseEvent.target.type === MouseTargetType.CONTENT_WIDGET && this.linkDecorations.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = mouseEvent.target.position!;\n\n\t\tthis.startFindDefinition(position);\n\t}\n\n\tprivate startFindDefinition(position: Position): Promise<number | undefined> {\n\n\t\t// Dispose listeners for updating decorations when using keyboard to show definition hover\n\t\tthis.toUnhookForKeyboard.clear();\n\n\t\t// Find word at mouse position\n\t\tconst word = position ? this.editor.getModel()?.getWordAtPosition(position) : null;\n\t\tif (!word) {\n\t\t\tthis.currentWordAtPosition = null;\n\t\t\tthis.removeLinkDecorations();\n\t\t\treturn Promise.resolve(0);\n\t\t}\n\n\t\t// Return early if word at position is still the same\n\t\tif (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === word.startColumn && this.currentWordAtPosition.endColumn === word.endColumn && this.currentWordAtPosition.word === word.word) {\n\t\t\treturn Promise.resolve(0);\n\t\t}\n\n\t\tthis.currentWordAtPosition = word;\n\n\t\t// Find definition and decorate word if found\n\t\tlet state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll);\n\n\t\tif (this.previousPromise) {\n\t\t\tthis.previousPromise.cancel();\n\t\t\tthis.previousPromise = null;\n\t\t}\n\n\t\tthis.previousPromise = createCancelablePromise(token => this.findDefinition(position, token));\n\n\t\treturn this.previousPromise.then(results => {\n\t\t\tif (!results || !results.length || !state.validate(this.editor)) {\n\t\t\t\tthis.removeLinkDecorations();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Multiple results\n\t\t\tif (results.length > 1) {\n\t\t\t\tthis.addDecoration(\n\t\t\t\t\tnew Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn),\n\t\t\t\t\tnew MarkdownString().appendText(nls.localize('multipleResults', \"Click to show {0} definitions.\", results.length))\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Single result\n\t\t\telse {\n\t\t\t\tlet result = results[0];\n\n\t\t\t\tif (!result.uri) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.textModelResolverService.createModelReference(result.uri).then(ref => {\n\n\t\t\t\t\tif (!ref.object || !ref.object.textEditorModel) {\n\t\t\t\t\t\tref.dispose();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { object: { textEditorModel } } = ref;\n\t\t\t\t\tconst { startLineNumber } = result.range;\n\n\t\t\t\t\tif (startLineNumber < 1 || startLineNumber > textEditorModel.getLineCount()) {\n\t\t\t\t\t\t// invalid range\n\t\t\t\t\t\tref.dispose();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result);\n\n\t\t\t\t\tlet wordRange: Range;\n\t\t\t\t\tif (result.originSelectionRange) {\n\t\t\t\t\t\twordRange = Range.lift(result.originSelectionRange);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twordRange = new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst languageId = this.languageService.guessLanguageIdByFilepathOrFirstLine(textEditorModel.uri);\n\t\t\t\t\tthis.addDecoration(\n\t\t\t\t\t\twordRange,\n\t\t\t\t\t\tnew MarkdownString().appendCodeblock(languageId ? languageId : '', previewValue)\n\t\t\t\t\t);\n\t\t\t\t\tref.dispose();\n\t\t\t\t});\n\t\t\t}\n\t\t}).then(undefined, onUnexpectedError);\n\t}\n\n\tprivate getPreviewValue(textEditorModel: ITextModel, startLineNumber: number, result: LocationLink) {\n\t\tlet rangeToUse = result.targetSelectionRange ? result.range : this.getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber);\n\t\tconst numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber;\n\t\tif (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES) {\n\t\t\trangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber);\n\t\t}\n\n\t\tconst previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse);\n\t\treturn previewValue;\n\t}\n\n\tprivate stripIndentationFromPreviewRange(textEditorModel: ITextModel, startLineNumber: number, previewRange: IRange) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tlet minIndent = startIndent;\n\n\t\tfor (let endLineNumber = startLineNumber + 1; endLineNumber < previewRange.endLineNumber; endLineNumber++) {\n\t\t\tconst endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\t\t\tminIndent = Math.min(minIndent, endIndent);\n\t\t}\n\n\t\tconst previewValue = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\\\s{${minIndent - 1}}`, 'gm'), '').trim();\n\t\treturn previewValue;\n\t}\n\n\tprivate getPreviewRangeBasedOnIndentation(textEditorModel: ITextModel, startLineNumber: number) {\n\t\tconst startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tconst maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES);\n\t\tlet endLineNumber = startLineNumber + 1;\n\n\t\tfor (; endLineNumber < maxLineNumber; endLineNumber++) {\n\t\t\tlet endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber);\n\n\t\t\tif (startIndent === endIndent) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new Range(startLineNumber, 1, endLineNumber + 1, 1);\n\t}\n\n\tprivate getPreviewRangeBasedOnBrackets(textEditorModel: ITextModel, startLineNumber: number) {\n\t\tconst maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES);\n\n\t\tconst brackets: IFoundBracket[] = [];\n\n\t\tlet ignoreFirstEmpty = true;\n\t\tlet currentBracket = textEditorModel.bracketPairs.findNextBracket(new Position(startLineNumber, 1));\n\t\twhile (currentBracket !== null) {\n\n\t\t\tif (brackets.length === 0) {\n\t\t\t\tbrackets.push(currentBracket);\n\t\t\t} else {\n\t\t\t\tconst lastBracket = brackets[brackets.length - 1];\n\t\t\t\tif (lastBracket.open[0] === currentBracket.open[0] && lastBracket.isOpen && !currentBracket.isOpen) {\n\t\t\t\t\tbrackets.pop();\n\t\t\t\t} else {\n\t\t\t\t\tbrackets.push(currentBracket);\n\t\t\t\t}\n\n\t\t\t\tif (brackets.length === 0) {\n\t\t\t\t\tif (ignoreFirstEmpty) {\n\t\t\t\t\t\tignoreFirstEmpty = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new Range(startLineNumber, 1, currentBracket.range.endLineNumber + 1, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst maxColumn = textEditorModel.getLineMaxColumn(startLineNumber);\n\t\t\tlet nextLineNumber = currentBracket.range.endLineNumber;\n\t\t\tlet nextColumn = currentBracket.range.endColumn;\n\t\t\tif (maxColumn === currentBracket.range.endColumn) {\n\t\t\t\tnextLineNumber++;\n\t\t\t\tnextColumn = 1;\n\t\t\t}\n\n\t\t\tif (nextLineNumber > maxLineNumber) {\n\t\t\t\treturn new Range(startLineNumber, 1, maxLineNumber + 1, 1);\n\t\t\t}\n\n\t\t\tcurrentBracket = textEditorModel.bracketPairs.findNextBracket(new Position(nextLineNumber, nextColumn));\n\t\t}\n\n\t\treturn new Range(startLineNumber, 1, maxLineNumber + 1, 1);\n\t}\n\n\tprivate addDecoration(range: Range, hoverMessage: MarkdownString): void {\n\n\t\tconst newDecorations: IModelDeltaDecoration = {\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'goto-definition-link',\n\t\t\t\tinlineClassName: 'goto-definition-link',\n\t\t\t\thoverMessage\n\t\t\t}\n\t\t};\n\n\t\tthis.linkDecorations = this.editor.deltaDecorations(this.linkDecorations, [newDecorations]);\n\t}\n\n\tprivate removeLinkDecorations(): void {\n\t\tif (this.linkDecorations.length > 0) {\n\t\t\tthis.linkDecorations = this.editor.deltaDecorations(this.linkDecorations, []);\n\t\t}\n\t}\n\n\tprivate isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean {\n\t\treturn this.editor.hasModel() &&\n\t\t\tmouseEvent.isNoneOrSingleMouseDown &&\n\t\t\t(mouseEvent.target.type === MouseTargetType.CONTENT_TEXT) &&\n\t\t\t(mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false)) &&\n\t\t\tthis.languageFeaturesService.definitionProvider.has(this.editor.getModel());\n\t}\n\n\tprivate findDefinition(position: Position, token: CancellationToken): Promise<LocationLink[] | null> {\n\t\tconst model = this.editor.getModel();\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, token);\n\t}\n\n\tprivate gotoDefinition(position: Position, openToSide: boolean): Promise<any> {\n\t\tthis.editor.setPosition(position);\n\t\treturn this.editor.invokeWithinContext((accessor) => {\n\t\t\tconst canPeek = !openToSide && this.editor.getOption(EditorOption.definitionLinkOpensInPeek) && !this.isInPeekEditor(accessor);\n\t\t\tconst action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined });\n\t\t\treturn action.run(accessor, this.editor);\n\t\t});\n\t}\n\n\tprivate isInPeekEditor(accessor: ServicesAccessor): boolean | undefined {\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\t\treturn PeekContext.inPeekEditor.getValue(contextKeyService);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.toUnhook.dispose();\n\t}\n}\n\nregisterEditorContribution(GotoDefinitionAtPositionEditorContribution.ID, GotoDefinitionAtPositionEditorContribution);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst activeLinkForeground = theme.getColor(editorActiveLinkForeground);\n\tif (activeLinkForeground) {\n\t\tcollector.addRule(`.monaco-editor .goto-definition-link { color: ${activeLinkForeground} !important; }`);\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { basename } from 'vs/base/common/resources';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration } from 'vs/editor/common/model';\nimport { CodeActionTriggerType } from 'vs/editor/common/languages';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations';\nimport { CodeActionSet, getCodeActions } from 'vs/editor/contrib/codeAction/browser/codeAction';\nimport { QuickFixAction, QuickFixController } from 'vs/editor/contrib/codeAction/browser/codeActionCommands';\nimport { CodeActionKind, CodeActionTrigger } from 'vs/editor/contrib/codeAction/browser/types';\nimport { MarkerController, NextMarkerAction } from 'vs/editor/contrib/gotoError/browser/gotoError';\nimport { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport * as nls from 'vs/nls';\nimport { ITextEditorOptions } from 'vs/platform/editor/common/editor';\nimport { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { Progress } from 'vs/platform/progress/common/progress';\nimport { textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nconst $ = dom.$;\n\nexport class MarkerHover implements IHoverPart {\n\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<MarkerHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly marker: IMarker,\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n}\n\nconst markerCodeActionTrigger: CodeActionTrigger = {\n\ttype: CodeActionTriggerType.Invoke,\n\tfilter: { include: CodeActionKind.QuickFix }\n};\n\nexport class MarkerHoverParticipant implements IEditorHoverParticipant<MarkerHover> {\n\n\tpublic readonly hoverOrdinal: number = 5;\n\n\tprivate recentMarkerCodeActionsInfo: { marker: IMarker; hasCodeActions: boolean } | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IMarkerDecorationsService private readonly _markerDecorationsService: IMarkerDecorationsService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) { }\n\n\tpublic computeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): MarkerHover[] {\n\t\tif (!this._editor.hasModel() || anchor.type !== HoverAnchorType.Range) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst lineNumber = anchor.range.startLineNumber;\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tconst result: MarkerHover[] = [];\n\t\tfor (const d of lineDecorations) {\n\t\t\tconst startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1;\n\t\t\tconst endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn;\n\n\t\t\tconst marker = this._markerDecorationsService.getMarker(model.uri, d);\n\t\t\tif (!marker) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst range = new Range(anchor.range.startLineNumber, startColumn, anchor.range.startLineNumber, endColumn);\n\t\t\tresult.push(new MarkerHover(this, range, marker));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic renderHoverParts(context: IEditorHoverRenderContext, hoverParts: MarkerHover[]): IDisposable {\n\t\tif (!hoverParts.length) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tconst disposables = new DisposableStore();\n\t\thoverParts.forEach(msg => context.fragment.appendChild(this.renderMarkerHover(msg, disposables)));\n\t\tconst markerHoverForStatusbar = hoverParts.length === 1 ? hoverParts[0] : hoverParts.sort((a, b) => MarkerSeverity.compare(a.marker.severity, b.marker.severity))[0];\n\t\tthis.renderMarkerStatusbar(context, markerHoverForStatusbar, disposables);\n\t\treturn disposables;\n\t}\n\n\tprivate renderMarkerHover(markerHover: MarkerHover, disposables: DisposableStore): HTMLElement {\n\t\tconst hoverElement = $('div.hover-row');\n\t\tconst markerElement = dom.append(hoverElement, $('div.marker.hover-contents'));\n\t\tconst { source, message, code, relatedInformation } = markerHover.marker;\n\n\t\tthis._editor.applyFontInfo(markerElement);\n\t\tconst messageElement = dom.append(markerElement, $('span'));\n\t\tmessageElement.style.whiteSpace = 'pre-wrap';\n\t\tmessageElement.innerText = message;\n\n\t\tif (source || code) {\n\t\t\t// Code has link\n\t\t\tif (code && typeof code !== 'string') {\n\t\t\t\tconst sourceAndCodeElement = $('span');\n\t\t\t\tif (source) {\n\t\t\t\t\tconst sourceElement = dom.append(sourceAndCodeElement, $('span'));\n\t\t\t\t\tsourceElement.innerText = source;\n\t\t\t\t}\n\t\t\t\tconst codeLink = dom.append(sourceAndCodeElement, $('a.code-link'));\n\t\t\t\tcodeLink.setAttribute('href', code.target.toString());\n\n\t\t\t\tdisposables.add(dom.addDisposableListener(codeLink, 'click', (e) => {\n\t\t\t\t\tthis._openerService.open(code.target, { allowCommands: true });\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}));\n\n\t\t\t\tconst codeElement = dom.append(codeLink, $('span'));\n\t\t\t\tcodeElement.innerText = code.value;\n\n\t\t\t\tconst detailsElement = dom.append(markerElement, sourceAndCodeElement);\n\t\t\t\tdetailsElement.style.opacity = '0.6';\n\t\t\t\tdetailsElement.style.paddingLeft = '6px';\n\t\t\t} else {\n\t\t\t\tconst detailsElement = dom.append(markerElement, $('span'));\n\t\t\t\tdetailsElement.style.opacity = '0.6';\n\t\t\t\tdetailsElement.style.paddingLeft = '6px';\n\t\t\t\tdetailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`;\n\t\t\t}\n\t\t}\n\n\t\tif (isNonEmptyArray(relatedInformation)) {\n\t\t\tfor (const { message, resource, startLineNumber, startColumn } of relatedInformation) {\n\t\t\t\tconst relatedInfoContainer = dom.append(markerElement, $('div'));\n\t\t\t\trelatedInfoContainer.style.marginTop = '8px';\n\t\t\t\tconst a = dom.append(relatedInfoContainer, $('a'));\n\t\t\t\ta.innerText = `${basename(resource)}(${startLineNumber}, ${startColumn}): `;\n\t\t\t\ta.style.cursor = 'pointer';\n\t\t\t\tdisposables.add(dom.addDisposableListener(a, 'click', (e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tif (this._openerService) {\n\t\t\t\t\t\tthis._openerService.open(resource, {\n\t\t\t\t\t\t\tfromUserGesture: true,\n\t\t\t\t\t\t\teditorOptions: <ITextEditorOptions>{ selection: { startLineNumber, startColumn } }\n\t\t\t\t\t\t}).catch(onUnexpectedError);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tconst messageElement = dom.append<HTMLAnchorElement>(relatedInfoContainer, $('span'));\n\t\t\t\tmessageElement.innerText = message;\n\t\t\t\tthis._editor.applyFontInfo(messageElement);\n\t\t\t}\n\t\t}\n\n\t\treturn hoverElement;\n\t}\n\n\tprivate renderMarkerStatusbar(context: IEditorHoverRenderContext, markerHover: MarkerHover, disposables: DisposableStore): void {\n\t\tif (markerHover.marker.severity === MarkerSeverity.Error || markerHover.marker.severity === MarkerSeverity.Warning || markerHover.marker.severity === MarkerSeverity.Info) {\n\t\t\tcontext.statusBar.addAction({\n\t\t\t\tlabel: nls.localize('view problem', \"View Problem\"),\n\t\t\t\tcommandId: NextMarkerAction.ID,\n\t\t\t\trun: () => {\n\t\t\t\t\tcontext.hide();\n\t\t\t\t\tMarkerController.get(this._editor)?.showAtMarker(markerHover.marker);\n\t\t\t\t\tthis._editor.focus();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.readOnly)) {\n\t\t\tconst quickfixPlaceholderElement = context.statusBar.append($('div'));\n\t\t\tif (this.recentMarkerCodeActionsInfo) {\n\t\t\t\tif (IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker) === IMarkerData.makeKey(markerHover.marker)) {\n\t\t\t\t\tif (!this.recentMarkerCodeActionsInfo.hasCodeActions) {\n\t\t\t\t\t\tquickfixPlaceholderElement.textContent = nls.localize('noQuickFixes', \"No quick fixes available\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.recentMarkerCodeActionsInfo = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst updatePlaceholderDisposable = this.recentMarkerCodeActionsInfo && !this.recentMarkerCodeActionsInfo.hasCodeActions ? Disposable.None : disposables.add(disposableTimeout(() => quickfixPlaceholderElement.textContent = nls.localize('checkingForQuickFixes', \"Checking for quick fixes...\"), 200));\n\t\t\tif (!quickfixPlaceholderElement.textContent) {\n\t\t\t\t// Have some content in here to avoid flickering\n\t\t\t\tquickfixPlaceholderElement.textContent = String.fromCharCode(0xA0); // \n\t\t\t}\n\t\t\tconst codeActionsPromise = this.getCodeActions(markerHover.marker);\n\t\t\tdisposables.add(toDisposable(() => codeActionsPromise.cancel()));\n\t\t\tcodeActionsPromise.then(actions => {\n\t\t\t\tupdatePlaceholderDisposable.dispose();\n\t\t\t\tthis.recentMarkerCodeActionsInfo = { marker: markerHover.marker, hasCodeActions: actions.validActions.length > 0 };\n\n\t\t\t\tif (!this.recentMarkerCodeActionsInfo.hasCodeActions) {\n\t\t\t\t\tactions.dispose();\n\t\t\t\t\tquickfixPlaceholderElement.textContent = nls.localize('noQuickFixes', \"No quick fixes available\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tquickfixPlaceholderElement.style.display = 'none';\n\n\t\t\t\tlet showing = false;\n\t\t\t\tdisposables.add(toDisposable(() => {\n\t\t\t\t\tif (!showing) {\n\t\t\t\t\t\tactions.dispose();\n\t\t\t\t\t}\n\t\t\t\t}));\n\n\t\t\t\tcontext.statusBar.addAction({\n\t\t\t\t\tlabel: nls.localize('quick fixes', \"Quick Fix...\"),\n\t\t\t\t\tcommandId: QuickFixAction.Id,\n\t\t\t\t\trun: (target) => {\n\t\t\t\t\t\tshowing = true;\n\t\t\t\t\t\tconst controller = QuickFixController.get(this._editor);\n\t\t\t\t\t\tconst elementPosition = dom.getDomNodePagePosition(target);\n\t\t\t\t\t\t// Hide the hover pre-emptively, otherwise the editor can close the code actions\n\t\t\t\t\t\t// context menu as well when using keyboard navigation\n\t\t\t\t\t\tcontext.hide();\n\t\t\t\t\t\tcontroller?.showCodeActions(markerCodeActionTrigger, actions, {\n\t\t\t\t\t\t\tx: elementPosition.left + 6,\n\t\t\t\t\t\t\ty: elementPosition.top + elementPosition.height + 6\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, onUnexpectedError);\n\t\t}\n\t}\n\n\tprivate getCodeActions(marker: IMarker): CancelablePromise<CodeActionSet> {\n\t\treturn createCancelablePromise(cancellationToken => {\n\t\t\treturn getCodeActions(\n\t\t\t\tthis._languageFeaturesService.codeActionProvider,\n\t\t\t\tthis._editor.getModel()!,\n\t\t\t\tnew Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn),\n\t\t\t\tmarkerCodeActionTrigger,\n\t\t\t\tProgress.None,\n\t\t\t\tcancellationToken);\n\t\t});\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst linkFg = theme.getColor(textLinkForeground);\n\tif (linkFg) {\n\t\tcollector.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${linkFg}; }`);\n\t}\n\tconst activeLinkFg = theme.getColor(textLinkActiveForeground);\n\tif (activeLinkFg) {\n\t\tcollector.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${activeLinkFg}; }`);\n\t}\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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution, IScrollEvent } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { GotoDefinitionAtPositionEditorContribution } from 'vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition';\nimport { HoverStartMode } from 'vs/editor/contrib/hover/browser/hoverOperation';\nimport { ContentHoverWidget, ContentHoverController } from 'vs/editor/contrib/hover/browser/contentHover';\nimport { MarginHoverWidget } from 'vs/editor/contrib/hover/browser/marginHover';\nimport * as nls from 'vs/nls';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { editorHoverBackground, editorHoverBorder, editorHoverForeground, editorHoverHighlight, editorHoverStatusBarBackground, textCodeBlockBackground, textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { MarkdownHoverParticipant } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant';\nimport { MarkerHoverParticipant } from 'vs/editor/contrib/hover/browser/markerHoverParticipant';\n\nexport class ModesHoverController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.hover';\n\n\tprivate readonly _toUnhook = new DisposableStore();\n\tprivate readonly _didChangeConfigurationHandler: IDisposable;\n\n\tprivate _contentWidget: ContentHoverController | null;\n\tprivate _glyphWidget: MarginHoverWidget | null;\n\n\tprivate _isMouseDown: boolean;\n\tprivate _hoverClicked: boolean;\n\tprivate _isHoverEnabled!: boolean;\n\tprivate _isHoverSticky!: boolean;\n\n\tstatic get(editor: ICodeEditor): ModesHoverController | null {\n\t\treturn editor.getContribution<ModesHoverController>(ModesHoverController.ID);\n\t}\n\n\tconstructor(private readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IContextKeyService _contextKeyService: IContextKeyService\n\t) {\n\t\tthis._isMouseDown = false;\n\t\tthis._hoverClicked = false;\n\t\tthis._contentWidget = null;\n\t\tthis._glyphWidget = null;\n\n\t\tthis._hookEvents();\n\n\t\tthis._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.hover)) {\n\t\t\t\tthis._unhookEvents();\n\t\t\t\tthis._hookEvents();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _hookEvents(): void {\n\t\tconst hideWidgetsEventHandler = () => this._hideWidgets();\n\n\t\tconst hoverOpts = this._editor.getOption(EditorOption.hover);\n\t\tthis._isHoverEnabled = hoverOpts.enabled;\n\t\tthis._isHoverSticky = hoverOpts.sticky;\n\t\tif (this._isHoverEnabled) {\n\t\t\tthis._toUnhook.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\t\tthis._toUnhook.add(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));\n\t\t\tthis._toUnhook.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\t\tthis._toUnhook.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\t} else {\n\t\t\tthis._toUnhook.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\t\tthis._toUnhook.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\t}\n\n\t\tthis._toUnhook.add(this._editor.onMouseLeave(hideWidgetsEventHandler));\n\t\tthis._toUnhook.add(this._editor.onDidChangeModel(hideWidgetsEventHandler));\n\t\tthis._toUnhook.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookEvents(): void {\n\t\tthis._toUnhook.clear();\n\t}\n\n\tprivate _onEditorScrollChanged(e: IScrollEvent): void {\n\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\tthis._hideWidgets();\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tthis._isMouseDown = true;\n\n\t\tconst target = mouseEvent.target;\n\n\t\tif (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) {\n\t\t\tthis._hoverClicked = true;\n\t\t\t// mouse down on top of content hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (target.type === MouseTargetType.OVERLAY_WIDGET && target.detail === MarginHoverWidget.ID) {\n\t\t\t// mouse down on top of overlay hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (target.type !== MouseTargetType.OVERLAY_WIDGET) {\n\t\t\tthis._hoverClicked = false;\n\t\t}\n\n\t\tthis._hideWidgets();\n\t}\n\n\tprivate _onEditorMouseUp(mouseEvent: IEditorMouseEvent): void {\n\t\tthis._isMouseDown = false;\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tconst target = mouseEvent.target;\n\n\t\tif (this._isMouseDown && this._hoverClicked) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isHoverSticky && target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) {\n\t\t\t// mouse moved on top of content hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isHoverSticky && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed) {\n\t\t\t// selected text within content hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t!this._isHoverSticky && target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID\n\t\t\t&& this._contentWidget?.isColorPickerVisible()\n\t\t) {\n\t\t\t// though the hover is not sticky, the color picker needs to.\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isHoverSticky && target.type === MouseTargetType.OVERLAY_WIDGET && target.detail === MarginHoverWidget.ID) {\n\t\t\t// mouse moved on top of overlay hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._isHoverEnabled) {\n\t\t\tthis._hideWidgets();\n\t\t\treturn;\n\t\t}\n\n\t\tconst contentWidget = this._getOrCreateContentWidget();\n\t\tif (contentWidget.maybeShowAt(mouseEvent)) {\n\t\t\tthis._glyphWidget?.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.position) {\n\t\t\tthis._contentWidget?.hide();\n\t\t\tif (!this._glyphWidget) {\n\t\t\t\tthis._glyphWidget = new MarginHoverWidget(this._editor, this._languageService, this._openerService);\n\t\t\t}\n\t\t\tthis._glyphWidget.startShowingAt(target.position.lineNumber);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hideWidgets();\n\t}\n\n\tprivate _onKeyDown(e: IKeyboardEvent): void {\n\t\tif (e.keyCode !== KeyCode.Ctrl && e.keyCode !== KeyCode.Alt && e.keyCode !== KeyCode.Meta && e.keyCode !== KeyCode.Shift) {\n\t\t\t// Do not hide hover when a modifier key is pressed\n\t\t\tthis._hideWidgets();\n\t\t}\n\t}\n\n\tprivate _hideWidgets(): void {\n\t\tif ((this._isMouseDown && this._hoverClicked && this._contentWidget?.isColorPickerVisible())) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hoverClicked = false;\n\t\tthis._glyphWidget?.hide();\n\t\tthis._contentWidget?.hide();\n\t}\n\n\tprivate _getOrCreateContentWidget(): ContentHoverController {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = this._instantiationService.createInstance(ContentHoverController, this._editor);\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._contentWidget?.isColorPickerVisible() || false;\n\t}\n\n\tpublic showContentHover(range: Range, mode: HoverStartMode, focus: boolean): void {\n\t\tthis._getOrCreateContentWidget().startShowingAtRange(range, mode, focus);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._unhookEvents();\n\t\tthis._toUnhook.dispose();\n\t\tthis._didChangeConfigurationHandler.dispose();\n\t\tthis._glyphWidget?.dispose();\n\t\tthis._contentWidget?.dispose();\n\t}\n}\n\nclass ShowHoverAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showHover',\n\t\t\tlabel: nls.localize({\n\t\t\t\tkey: 'showHover',\n\t\t\t\tcomment: [\n\t\t\t\t\t'Label for action that will trigger the showing of a hover in the editor.',\n\t\t\t\t\t'This allows for users to show the hover without using the mouse.'\n\t\t\t\t]\n\t\t\t}, \"Show Hover\"),\n\t\t\talias: 'Show Hover',\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tlet controller = ModesHoverController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tconst position = editor.getPosition();\n\t\tconst range = new Range(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\tconst focus = editor.getOption(EditorOption.accessibilitySupport) === AccessibilitySupport.Enabled;\n\t\tcontroller.showContentHover(range, HoverStartMode.Immediate, focus);\n\t}\n}\n\nclass ShowDefinitionPreviewHoverAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showDefinitionPreviewHover',\n\t\t\tlabel: nls.localize({\n\t\t\t\tkey: 'showDefinitionPreviewHover',\n\t\t\t\tcomment: [\n\t\t\t\t\t'Label for action that will trigger the showing of definition preview hover in the editor.',\n\t\t\t\t\t'This allows for users to show the definition preview hover without using the mouse.'\n\t\t\t\t]\n\t\t\t}, \"Show Definition Preview Hover\"),\n\t\t\talias: 'Show Definition Preview Hover',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst controller = ModesHoverController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tconst position = editor.getPosition();\n\n\t\tif (!position) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst range = new Range(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\tconst goto = GotoDefinitionAtPositionEditorContribution.get(editor);\n\t\tif (!goto) {\n\t\t\treturn;\n\t\t}\n\t\tconst promise = goto.startFindDefinitionFromCursor(position);\n\t\tpromise.then(() => {\n\t\t\tcontroller.showContentHover(range, HoverStartMode.Immediate, true);\n\t\t});\n\t}\n}\n\nregisterEditorContribution(ModesHoverController.ID, ModesHoverController);\nregisterEditorAction(ShowHoverAction);\nregisterEditorAction(ShowDefinitionPreviewHoverAction);\nHoverParticipantRegistry.register(MarkdownHoverParticipant);\nHoverParticipantRegistry.register(MarkerHoverParticipant);\n\n// theming\nregisterThemingParticipant((theme, collector) => {\n\tconst editorHoverHighlightColor = theme.getColor(editorHoverHighlight);\n\tif (editorHoverHighlightColor) {\n\t\tcollector.addRule(`.monaco-editor .hoverHighlight { background-color: ${editorHoverHighlightColor}; }`);\n\t}\n\tconst hoverBackground = theme.getColor(editorHoverBackground);\n\tif (hoverBackground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover { background-color: ${hoverBackground}; }`);\n\t}\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${hoverBorder}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n\tconst link = theme.getColor(textLinkForeground);\n\tif (link) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover a { color: ${link}; }`);\n\t}\n\tconst linkHover = theme.getColor(textLinkActiveForeground);\n\tif (linkHover) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover a:hover { color: ${linkHover}; }`);\n\t}\n\tconst hoverForeground = theme.getColor(editorHoverForeground);\n\tif (hoverForeground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover { color: ${hoverForeground}; }`);\n\t}\n\tconst actionsBackground = theme.getColor(editorHoverStatusBarBackground);\n\tif (actionsBackground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${actionsBackground}; }`);\n\t}\n\tconst codeBackground = theme.getColor(textCodeBlockBackground);\n\tif (codeBackground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-hover code { background-color: ${codeBackground}; }`);\n\t}\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 { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ColorDecorationInjectedTextMarker } from 'vs/editor/contrib/colorPicker/browser/colorDetector';\nimport { ColorHoverParticipant } from 'vs/editor/contrib/colorPicker/browser/colorHoverParticipant';\nimport { ModesHoverController } from 'vs/editor/contrib/hover/browser/hover';\nimport { HoverStartMode } from 'vs/editor/contrib/hover/browser/hoverOperation';\nimport { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes';\n\nexport class ColorContribution extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorContribution'; // ms\n\n\tconstructor(private readonly _editor: ICodeEditor,\n\t) {\n\t\tsuper();\n\t\tthis._register(_editor.onMouseDown((e) => this.onMouseDown(e)));\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate onMouseDown(mouseEvent: IEditorMouseEvent) {\n\t\tconst target = mouseEvent.target;\n\n\t\tif (target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!target.detail.injectedText) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (target.detail.injectedText.options.attachedData !== ColorDecorationInjectedTextMarker) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!target.range) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hoverController = this._editor.getContribution<ModesHoverController>(ModesHoverController.ID);\n\t\tif (!hoverController) {\n\t\t\treturn;\n\t\t}\n\t\tif (!hoverController.isColorPickerVisible()) {\n\t\t\tconst range = new Range(target.range.startLineNumber, target.range.startColumn + 1, target.range.endLineNumber, target.range.endColumn + 1);\n\t\t\thoverController.showContentHover(range, HoverStartMode.Immediate, false);\n\t\t}\n\t}\n}\n\nregisterEditorContribution(ColorContribution.ID, ColorContribution);\nHoverParticipantRegistry.register(ColorHoverParticipant);\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 * as dom from 'vs/base/browser/dom';\nimport { Action, IAction, Separator } from 'vs/base/common/actions';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Location } from 'vs/editor/common/languages';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { DefinitionAction, SymbolNavigationAction, SymbolNavigationAnchor } from 'vs/editor/contrib/gotoSymbol/browser/goToCommands';\nimport { ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture';\nimport { RenderedInlayHintLabelPart } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController';\nimport { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView';\nimport { isIMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { INotificationService, Severity } from 'vs/platform/notification/common/notification';\n\nexport async function showGoToContextMenu(accessor: ServicesAccessor, editor: ICodeEditor, anchor: HTMLElement, part: RenderedInlayHintLabelPart) {\n\n\tconst resolverService = accessor.get(ITextModelService);\n\tconst contextMenuService = accessor.get(IContextMenuService);\n\tconst commandService = accessor.get(ICommandService);\n\tconst instaService = accessor.get(IInstantiationService);\n\tconst notificationService = accessor.get(INotificationService);\n\n\tawait part.item.resolve(CancellationToken.None);\n\n\tif (!part.part.location) {\n\t\treturn;\n\t}\n\n\tconst location: Location = part.part.location;\n\tconst menuActions: IAction[] = [];\n\n\t// from all registered (not active) context menu actions select those\n\t// that are a symbol navigation action\n\tconst filter = new Set(MenuRegistry.getMenuItems(MenuId.EditorContext)\n\t\t.map(item => isIMenuItem(item) ? item.command.id : ''));\n\n\tfor (const delegate of EditorExtensionsRegistry.getEditorActions()) {\n\t\tif (delegate instanceof SymbolNavigationAction && filter.has(delegate.id)) {\n\t\t\tmenuActions.push(new Action(delegate.id, delegate.label, undefined, true, async () => {\n\t\t\t\tconst ref = await resolverService.createModelReference(location.uri);\n\t\t\t\ttry {\n\t\t\t\t\tawait instaService.invokeFunction(delegate.run.bind(delegate), editor, new SymbolNavigationAnchor(ref.object.textEditorModel, Range.getStartPosition(location.range)));\n\t\t\t\t} finally {\n\t\t\t\t\tref.dispose();\n\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tif (part.part.command) {\n\t\tconst { command } = part.part;\n\t\tmenuActions.push(new Separator());\n\t\tmenuActions.push(new Action(command.id, command.title, undefined, true, async () => {\n\t\t\ttry {\n\t\t\t\tawait commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t\t} catch (err) {\n\t\t\t\tnotificationService.notify({\n\t\t\t\t\tseverity: Severity.Error,\n\t\t\t\t\tsource: part.item.provider.displayName,\n\t\t\t\t\tmessage: err\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\t}\n\n\t// show context menu\n\tconst useShadowDOM = editor.getOption(EditorOption.useShadowDOM);\n\tcontextMenuService.showContextMenu({\n\t\tdomForShadowRoot: useShadowDOM ? editor.getDomNode() ?? undefined : undefined,\n\t\tgetAnchor: () => {\n\t\t\tconst box = dom.getDomNodePagePosition(anchor);\n\t\t\treturn { x: box.left, y: box.top + box.height + 8 };\n\t\t},\n\t\tgetActions: () => menuActions,\n\t\tonHide: () => {\n\t\t\teditor.focus();\n\t\t},\n\t\tautoSelectFirstItem: true,\n\t});\n\n}\n\nexport async function goToDefinitionWithLocation(accessor: ServicesAccessor, event: ClickLinkMouseEvent, editor: IActiveCodeEditor, location: Location) {\n\n\tconst resolverService = accessor.get(ITextModelService);\n\tconst ref = await resolverService.createModelReference(location.uri);\n\n\tawait editor.invokeWithinContext(async (accessor) => {\n\n\t\tconst openToSide = event.hasSideBySideModifier;\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\n\t\tconst isInPeek = PeekContext.inPeekEditor.getValue(contextKeyService);\n\t\tconst canPeek = !openToSide && editor.getOption(EditorOption.definitionLinkOpensInPeek) && !isInPeek;\n\n\t\tconst action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined });\n\t\treturn action.run(accessor, editor, { model: ref.object.textEditorModel, position: Range.getStartPosition(location.range) });\n\t});\n\n\tref.dispose();\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { LRUCache } from 'vs/base/common/map';\nimport { IRange } from 'vs/base/common/range';\nimport { assertType } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { ClassNameReference, CssProperties, DynamicCssRules } from 'vs/editor/browser/editorDom';\nimport { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport * as languages from 'vs/editor/common/languages';\nimport { IModelDeltaDecoration, InjectedTextCursorStops, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { ClickLinkGesture, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture';\nimport { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from 'vs/editor/contrib/inlayHints/browser/inlayHints';\nimport { goToDefinitionWithLocation, showGoToContextMenu } from 'vs/editor/contrib/inlayHints/browser/inlayHintsLocations';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { INotificationService, Severity } from 'vs/platform/notification/common/notification';\nimport * as colors from 'vs/platform/theme/common/colorRegistry';\nimport { themeColorFromId } from 'vs/platform/theme/common/themeService';\n\n// --- hint caching service (per session)\n\nclass InlayHintsCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _entries = new LRUCache<string, InlayHintItem[]>(50);\n\n\tget(model: ITextModel): InlayHintItem[] | undefined {\n\t\tconst key = InlayHintsCache._key(model);\n\t\treturn this._entries.get(key);\n\t}\n\n\tset(model: ITextModel, value: InlayHintItem[]): void {\n\t\tconst key = InlayHintsCache._key(model);\n\t\tthis._entries.set(key, value);\n\t}\n\n\tprivate static _key(model: ITextModel): string {\n\t\treturn `${model.uri.toString()}/${model.getVersionId()}`;\n\t}\n}\n\ninterface IInlayHintsCache extends InlayHintsCache { }\nconst IInlayHintsCache = createDecorator<IInlayHintsCache>('IInlayHintsCache');\nregisterSingleton(IInlayHintsCache, InlayHintsCache, true);\n\n// --- rendered label\n\nexport class RenderedInlayHintLabelPart {\n\tconstructor(readonly item: InlayHintItem, readonly index: number) { }\n\n\tget part() {\n\t\tconst label = this.item.hint.label;\n\t\tif (typeof label === 'string') {\n\t\t\treturn { label };\n\t\t} else {\n\t\t\treturn label[this.index];\n\t\t}\n\t}\n}\n\nclass ActiveInlayHintInfo {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, readonly hasTriggerModifier: boolean) { }\n}\n\n// --- controller\n\nexport class InlayHintsController implements IEditorContribution {\n\n\tstatic readonly ID: string = 'editor.contrib.InlayHints';\n\n\tprivate static readonly _MAX_DECORATORS = 1500;\n\n\tstatic get(editor: ICodeEditor): InlayHintsController | undefined {\n\t\treturn editor.getContribution<InlayHintsController>(InlayHintsController.ID) ?? undefined;\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\tprivate readonly _debounceInfo: IFeatureDebounceInformation;\n\tprivate readonly _decorationsMetadata = new Map<string, { item: InlayHintItem; classNameRef: IDisposable }>();\n\tprivate readonly _ruleFactory = new DynamicCssRules(this._editor);\n\n\tprivate _activeInlayHintPart?: ActiveInlayHintInfo;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService _featureDebounce: ILanguageFeatureDebounceService,\n\t\t@IInlayHintsCache private readonly _inlayHintsCache: IInlayHintsCache,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t) {\n\t\tthis._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, 'InlayHint', { min: 25 });\n\t\tthis._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._update();\n\t}\n\n\tdispose(): void {\n\t\tthis._sessionDisposables.dispose();\n\t\tthis._removeAllDecorations();\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tthis._sessionDisposables.clear();\n\t\tthis._removeAllDecorations();\n\n\t\tif (!this._editor.getOption(EditorOption.inlayHints).enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// iff possible, quickly update from cache\n\t\tconst cached = this._inlayHintsCache.get(model);\n\t\tif (cached) {\n\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], cached);\n\t\t}\n\t\tthis._sessionDisposables.add(toDisposable(() => {\n\t\t\t// cache items when switching files etc\n\t\t\tif (!model.isDisposed()) {\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\t\t\t}\n\t\t}));\n\n\t\tlet cts: CancellationTokenSource | undefined;\n\t\tlet watchedProviders = new Set<languages.InlayHintsProvider>();\n\n\t\tconst scheduler = new RunOnceScheduler(async () => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tcts?.dispose(true);\n\t\t\tcts = new CancellationTokenSource();\n\t\t\tconst listener = model.onWillDispose(() => cts?.cancel());\n\n\t\t\ttry {\n\t\t\t\tconst myToken = cts.token;\n\t\t\t\tconst inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), myToken);\n\t\t\t\tscheduler.delay = this._debounceInfo.update(model, Date.now() - t1);\n\t\t\t\tif (myToken.isCancellationRequested) {\n\t\t\t\t\tinlayHints.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// listen to provider changes\n\t\t\t\tfor (const provider of inlayHints.provider) {\n\t\t\t\t\tif (typeof provider.onDidChangeInlayHints === 'function' && !watchedProviders.has(provider)) {\n\t\t\t\t\t\twatchedProviders.add(provider);\n\t\t\t\t\t\tthis._sessionDisposables.add(provider.onDidChangeInlayHints(() => {\n\t\t\t\t\t\t\tif (!scheduler.isScheduled()) { // ignore event when request is already scheduled\n\t\t\t\t\t\t\t\tscheduler.schedule();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._sessionDisposables.add(inlayHints);\n\t\t\t\tthis._updateHintsDecorators(inlayHints.ranges, inlayHints.items);\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\n\t\t\t} finally {\n\t\t\t\tcts.dispose();\n\t\t\t\tlistener.dispose();\n\t\t\t}\n\n\t\t}, this._debounceInfo.get(model));\n\n\t\tthis._sessionDisposables.add(scheduler);\n\t\tthis._sessionDisposables.add(toDisposable(() => cts?.dispose(true)));\n\t\tscheduler.schedule(0);\n\n\t\tthis._sessionDisposables.add(this._editor.onDidScrollChange((e) => {\n\t\t\t// update when scroll position changes\n\t\t\t// uses scrollTopChanged has weak heuristic to differenatiate between scrolling due to\n\t\t\t// typing or due to \"actual\" scrolling\n\t\t\tif (e.scrollTopChanged || !scheduler.isScheduled()) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\t// update less aggressive when typing\n\t\t\tconst delay = Math.max(scheduler.delay, 1250);\n\t\t\tscheduler.schedule(delay);\n\t\t}));\n\n\t\t// mouse gestures\n\t\tthis._sessionDisposables.add(this._installLinkGesture());\n\t\tthis._sessionDisposables.add(this._installDblClickGesture());\n\t\tthis._sessionDisposables.add(this._installContextMenu());\n\t}\n\n\tprivate _installLinkGesture(): IDisposable {\n\n\t\tconst store = new DisposableStore();\n\t\tconst gesture = store.add(new ClickLinkGesture(this._editor));\n\n\t\t// let removeHighlight = () => { };\n\n\t\tconst sessionStore = new DisposableStore();\n\t\tstore.add(sessionStore);\n\n\t\tstore.add(gesture.onMouseMoveOrRelevantKeyDown(e => {\n\t\t\tconst [mouseEvent] = e;\n\t\t\tconst labelPart = this._getInlayHintLabelPart(mouseEvent);\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (!labelPart || !model) {\n\t\t\t\tsessionStore.clear();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// resolve the item\n\t\t\tconst cts = new CancellationTokenSource();\n\t\t\tsessionStore.add(toDisposable(() => cts.dispose(true)));\n\t\t\tlabelPart.item.resolve(cts.token);\n\n\t\t\t// render link => when the modifier is pressed and when there is a command or location\n\t\t\tthis._activeInlayHintPart = labelPart.part.command || labelPart.part.location\n\t\t\t\t? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier)\n\t\t\t\t: undefined;\n\n\t\t\tconst lineNumber = labelPart.item.hint.position.lineNumber;\n\t\t\tconst range = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber));\n\t\t\tconst lineHints = new Set<InlayHintItem>();\n\t\t\tfor (const data of this._decorationsMetadata.values()) {\n\t\t\t\tif (range.containsRange(data.item.anchor.range)) {\n\t\t\t\t\tlineHints.add(data.item);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._updateHintsDecorators([range], Array.from(lineHints));\n\t\t\tsessionStore.add(toDisposable(() => {\n\t\t\t\tthis._activeInlayHintPart = undefined;\n\t\t\t\tthis._updateHintsDecorators([range], Array.from(lineHints));\n\t\t\t}));\n\t\t}));\n\t\tstore.add(gesture.onCancel(() => sessionStore.clear()));\n\t\tstore.add(gesture.onExecute(async e => {\n\t\t\tconst label = this._getInlayHintLabelPart(e);\n\t\t\tif (label) {\n\t\t\t\tconst part = label.part;\n\t\t\t\tif (part.location) {\n\t\t\t\t\t// location -> execute go to def\n\t\t\t\t\tthis._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, part.location);\n\t\t\t\t} else if (languages.Command.is(part.command)) {\n\t\t\t\t\t// command -> execute it\n\t\t\t\t\tawait this._invokeCommand(part.command, label.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\treturn store;\n\t}\n\n\tprivate _installDblClickGesture(): IDisposable {\n\t\treturn this._editor.onMouseUp(async e => {\n\t\t\tif (e.event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (!part) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.event.preventDefault();\n\t\t\tawait part.item.resolve(CancellationToken.None);\n\t\t\tif (part.item.hint.command) {\n\t\t\t\tawait this._invokeCommand(part.item.hint.command, part.item);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _installContextMenu(): IDisposable {\n\t\treturn this._editor.onContextMenu(async e => {\n\t\t\tif (!(e.event.target instanceof HTMLElement)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (part) {\n\t\t\t\tawait this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getInlayHintLabelPart(e: IEditorMouseEvent | ClickLinkMouseEvent): RenderedInlayHintLabelPart | undefined {\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst options = e.target.detail.injectedText?.options;\n\t\tif (options instanceof ModelDecorationInjectedTextOptions && options?.attachedData instanceof RenderedInlayHintLabelPart) {\n\t\t\treturn options.attachedData;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate async _invokeCommand(command: languages.Command, item: InlayHintItem) {\n\t\ttry {\n\t\t\tawait this._commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t} catch (err) {\n\t\t\tthis._notificationService.notify({\n\t\t\t\tseverity: Severity.Error,\n\t\t\t\tsource: item.provider.displayName,\n\t\t\t\tmessage: err\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cacheHintsForFastRestore(model: ITextModel): void {\n\t\tconst items = new Map<InlayHintItem, InlayHintItem>();\n\t\tfor (const [id, obj] of this._decorationsMetadata) {\n\t\t\tif (items.has(obj.item)) {\n\t\t\t\t// an inlay item can be rendered as multiple decorations\n\t\t\t\t// but they will all uses the same range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet value = obj.item;\n\t\t\tconst range = model.getDecorationRange(id);\n\t\t\tif (range) {\n\t\t\t\t// update range with whatever the editor has tweaked it to\n\t\t\t\tconst anchor = new InlayHintAnchor(range, obj.item.anchor.direction);\n\t\t\t\tvalue = obj.item.with({ anchor });\n\t\t\t}\n\t\t\titems.set(obj.item, value);\n\t\t}\n\t\tthis._inlayHintsCache.set(model, Array.from(items.values()));\n\t}\n\n\tprivate _getHintsRanges(): Range[] {\n\t\tconst extra = 30;\n\t\tconst model = this._editor.getModel()!;\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\t\tconst result: Range[] = [];\n\t\tfor (const range of visibleRanges.sort(Range.compareRangesUsingStarts)) {\n\t\t\tconst extendedRange = model.validateRange(new Range(range.startLineNumber - extra, range.startColumn, range.endLineNumber + extra, range.endColumn));\n\t\t\tif (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) {\n\t\t\t\tresult.push(extendedRange);\n\t\t\t} else {\n\t\t\t\tresult[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void {\n\n\t\t// utils to collect/create injected text decorations\n\t\tconst newDecorationsData: { item: InlayHintItem; decoration: IModelDeltaDecoration; classNameRef: IDisposable }[] = [];\n\t\tconst addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart): void => {\n\t\t\tnewDecorationsData.push({\n\t\t\t\titem,\n\t\t\t\tclassNameRef: ref,\n\t\t\t\tdecoration: {\n\t\t\t\t\trange: item.anchor.range,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// className: \"rangeHighlight\", // DEBUG highlight to see to what range a hint is attached\n\t\t\t\t\t\tdescription: 'InlayHint',\n\t\t\t\t\t\tshowIfCollapsed: item.anchor.range.isEmpty(), // \"original\" range is empty\n\t\t\t\t\t\tcollapseOnReplaceEdit: !item.anchor.range.isEmpty(),\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\t\t\t\t\t[item.anchor.direction]: {\n\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\t\tinlineClassName: ref.className,\n\t\t\t\t\t\t\tcursorStops,\n\t\t\t\t\t\t\tattachedData\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst addInjectedWhitespace = (item: InlayHintItem, isLast: boolean): void => {\n\t\t\tconst marginRule = this._ruleFactory.createClassNameRef({\n\t\t\t\twidth: `${(fontSize / 3) | 0}px`,\n\t\t\t\tdisplay: 'inline-block'\n\t\t\t});\n\t\t\taddInjectedText(item, marginRule, '\\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None);\n\t\t};\n\n\n\t\t//\n\t\tconst { fontSize, fontFamily } = this._getLayoutInfo();\n\t\tconst fontFamilyVar = '--code-editorInlayHintsFontFamily';\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily);\n\n\t\tfor (const item of items) {\n\n\t\t\t// whitespace leading the actual label\n\t\t\tif (item.hint.paddingLeft) {\n\t\t\t\taddInjectedWhitespace(item, false);\n\t\t\t}\n\n\t\t\t// the label with its parts\n\t\t\tconst parts: languages.InlayHintLabelPart[] = typeof item.hint.label === 'string'\n\t\t\t\t? [{ label: item.hint.label }]\n\t\t\t\t: item.hint.label;\n\n\t\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\t\tconst part = parts[i];\n\n\t\t\t\tconst isFirst = i === 0;\n\t\t\t\tconst isLast = i === parts.length - 1;\n\n\t\t\t\tconst cssProperties: CssProperties = {\n\t\t\t\t\tfontSize: `${fontSize}px`,\n\t\t\t\t\tfontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,\n\t\t\t\t\tverticalAlign: 'middle',\n\t\t\t\t};\n\n\t\t\t\tif (item.hint.command) {\n\t\t\t\t\t// user pointer whenever an inlay hint has a command\n\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t}\n\n\t\t\t\tthis._fillInColors(cssProperties, item.hint);\n\n\t\t\t\tif ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i) {\n\t\t\t\t\t// active link!\n\t\t\t\t\tcssProperties.textDecoration = 'underline';\n\t\t\t\t\tif (this._activeInlayHintPart.hasTriggerModifier) {\n\t\t\t\t\t\tcssProperties.color = themeColorFromId(colors.editorActiveLinkForeground);\n\t\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isFirst && isLast) {\n\t\t\t\t\t// only element\n\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px`;\n\t\t\t\t} else if (isFirst) {\n\t\t\t\t\t// first element\n\t\t\t\t\tcssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`;\n\t\t\t\t} else if (isLast) {\n\t\t\t\t\t// last element\n\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`;\n\t\t\t\t\tcssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`;\n\t\t\t\t} else {\n\t\t\t\t\tcssProperties.padding = `1px 0 1px 0`;\n\t\t\t\t}\n\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef(cssProperties),\n\t\t\t\t\tfixSpace(part.label),\n\t\t\t\t\tisLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None,\n\t\t\t\t\tnew RenderedInlayHintLabelPart(item, i)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// whitespace trailing the actual label\n\t\t\tif (item.hint.paddingRight) {\n\t\t\t\taddInjectedWhitespace(item, true);\n\t\t\t}\n\n\t\t\tif (newDecorationsData.length > InlayHintsController._MAX_DECORATORS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect all decoration ids that are affected by the ranges\n\t\t// and only update those decorations\n\t\tconst decorationIdsToReplace: string[] = [];\n\t\tfor (const range of ranges) {\n\n\t\t\tfor (const { id } of this._editor.getDecorationsInRange(range) ?? []) {\n\t\t\t\tconst metadata = this._decorationsMetadata.get(id);\n\t\t\t\tif (metadata) {\n\t\t\t\t\tdecorationIdsToReplace.push(id);\n\t\t\t\t\tmetadata.classNameRef.dispose();\n\t\t\t\t\tthis._decorationsMetadata.delete(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst newDecorationIds = this._editor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map(d => d.decoration));\n\t\tfor (let i = 0; i < newDecorationIds.length; i++) {\n\t\t\tconst data = newDecorationsData[i];\n\t\t\tthis._decorationsMetadata.set(newDecorationIds[i], { item: data.item, classNameRef: data.classNameRef });\n\t\t}\n\t}\n\n\tprivate _fillInColors(props: CssProperties, hint: languages.InlayHint): void {\n\t\tif (hint.kind === languages.InlayHintKind.Parameter) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintParameterBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintParameterForeground);\n\t\t} else if (hint.kind === languages.InlayHintKind.Type) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintTypeBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintTypeForeground);\n\t\t} else {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintForeground);\n\t\t}\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tconst editorFontSize = this._editor.getOption(EditorOption.fontSize);\n\t\tlet fontSize = options.fontSize;\n\t\tif (!fontSize || fontSize < 5 || fontSize > editorFontSize) {\n\t\t\tfontSize = (editorFontSize * .9) | 0;\n\t\t}\n\t\tconst fontFamily = options.fontFamily || this._editor.getOption(EditorOption.fontFamily);\n\t\treturn { fontSize, fontFamily };\n\t}\n\n\tprivate _removeAllDecorations(): void {\n\t\tthis._editor.deltaDecorations(Array.from(this._decorationsMetadata.keys()), []);\n\t\tfor (let obj of this._decorationsMetadata.values()) {\n\t\t\tobj.classNameRef.dispose();\n\t\t}\n\t\tthis._decorationsMetadata.clear();\n\t}\n}\n\n\n// Prevents the view from potentially visible whitespace\nfunction fixSpace(str: string): string {\n\tconst noBreakWhitespace = '\\xa0';\n\treturn str.replace(/[ \\t]/g, noBreakWhitespace);\n}\n\n\n\nCommandsRegistry.registerCommand('_executeInlayHintProvider', async (accessor, ...args: [URI, IRange]): Promise<languages.InlayHint[]> => {\n\n\tconst [uri, range] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Range.isIRange(range));\n\n\tconst { inlayHintsProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\t\tconst model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range)], CancellationToken.None);\n\t\tconst result = model.items.map(i => i.hint);\n\t\tsetTimeout(() => model.dispose(), 0); // dispose after sending to ext host\n\t\treturn result;\n\t} finally {\n\t\tref.dispose();\n\t}\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 { AsyncIterableObject } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IMarkdownString, isEmptyMarkdownString, MarkdownString } from 'vs/base/common/htmlContent';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IModelDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel';\nimport { HoverAnchor, HoverForeignElementAnchor, IEditorHoverParticipant } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { getHover } from 'vs/editor/contrib/hover/browser/getHover';\nimport { MarkdownHover, MarkdownHoverParticipant } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant';\nimport { RenderedInlayHintLabelPart, InlayHintsController } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { localize } from 'vs/nls';\nimport * as platform from 'vs/base/common/platform';\nimport { asCommandLink } from 'vs/editor/contrib/inlayHints/browser/inlayHints';\n\nclass InlayHintsHoverAnchor extends HoverForeignElementAnchor {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, owner: InlayHintsHover) {\n\t\tsuper(10, owner, part.item.anchor.range);\n\t}\n}\n\nexport class InlayHintsHover extends MarkdownHoverParticipant implements IEditorHoverParticipant<MarkdownHover> {\n\n\tpublic override readonly hoverOrdinal: number = 6;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ILanguageService languageService: ILanguageService,\n\t\t@IOpenerService openerService: IOpenerService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@ITextModelService private readonly _resolverService: ITextModelService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper(editor, languageService, openerService, configurationService, languageFeaturesService);\n\t}\n\n\tsuggestHoverAnchor(mouseEvent: IEditorMouseEvent): HoverAnchor | null {\n\t\tconst controller = InlayHintsController.get(this._editor);\n\t\tif (!controller) {\n\t\t\treturn null;\n\t\t}\n\t\tif (mouseEvent.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn null;\n\t\t}\n\t\tconst options = mouseEvent.target.detail.injectedText?.options;\n\t\tif (!(options instanceof ModelDecorationInjectedTextOptions && options.attachedData instanceof RenderedInlayHintLabelPart)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new InlayHintsHoverAnchor(options.attachedData, this);\n\t}\n\n\toverride computeSync(): MarkdownHover[] {\n\t\treturn [];\n\t}\n\n\toverride computeAsync(anchor: HoverAnchor, _lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject<MarkdownHover> {\n\t\tif (!(anchor instanceof InlayHintsHoverAnchor)) {\n\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t}\n\n\t\treturn new AsyncIterableObject<MarkdownHover>(async executor => {\n\n\t\t\tconst { part } = anchor;\n\t\t\tawait part.item.resolve(token);\n\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// (1) Inlay Tooltip\n\t\t\tlet itemTooltip: IMarkdownString | undefined;\n\t\t\tif (typeof part.item.hint.tooltip === 'string') {\n\t\t\t\titemTooltip = new MarkdownString().appendText(part.item.hint.tooltip);\n\t\t\t} else if (part.item.hint.tooltip) {\n\t\t\t\titemTooltip = part.item.hint.tooltip;\n\t\t\t}\n\t\t\tif (itemTooltip) {\n\t\t\t\texecutor.emitOne(new MarkdownHover(this, anchor.range, [itemTooltip], 0));\n\t\t\t}\n\n\t\t\t// (2) Inlay Label Part Tooltip\n\t\t\tlet partTooltip: IMarkdownString | undefined;\n\t\t\tif (typeof part.part.tooltip === 'string') {\n\t\t\t\tpartTooltip = new MarkdownString().appendText(part.part.tooltip);\n\t\t\t} else if (part.part.tooltip) {\n\t\t\t\tpartTooltip = part.part.tooltip;\n\t\t\t}\n\t\t\tif (partTooltip) {\n\t\t\t\texecutor.emitOne(new MarkdownHover(this, anchor.range, [partTooltip], 1));\n\t\t\t}\n\n\t\t\t// (2.2) Inlay Label Part Help Hover\n\t\t\tif (part.part.location || part.part.command) {\n\t\t\t\tlet linkHint: MarkdownString | undefined;\n\t\t\t\tconst useMetaKey = this._editor.getOption(EditorOption.multiCursorModifier) === 'altKey';\n\t\t\t\tconst kb = useMetaKey\n\t\t\t\t\t? platform.isMacintosh\n\t\t\t\t\t\t? localize('links.navigate.kb.meta.mac', \"cmd + click\")\n\t\t\t\t\t\t: localize('links.navigate.kb.meta', \"ctrl + click\")\n\t\t\t\t\t: platform.isMacintosh\n\t\t\t\t\t\t? localize('links.navigate.kb.alt.mac', \"option + click\")\n\t\t\t\t\t\t: localize('links.navigate.kb.alt', \"alt + click\");\n\n\t\t\t\tif (part.part.location && part.part.command) {\n\t\t\t\t\tlinkHint = new MarkdownString().appendText(localize('hint.defAndCommand', 'Go to Definition ({0}), right click for more', kb));\n\t\t\t\t} else if (part.part.location) {\n\t\t\t\t\tlinkHint = new MarkdownString().appendText(localize('hint.def', 'Go to Definition ({0})', kb));\n\t\t\t\t} else if (part.part.command) {\n\t\t\t\t\tlinkHint = new MarkdownString(`[${localize('hint.cmd', \"Execute Command\")}](${asCommandLink(part.part.command)} \"${part.part.command.title}\") (${kb})`, { isTrusted: true });\n\t\t\t\t}\n\t\t\t\tif (linkHint) {\n\t\t\t\t\texecutor.emitOne(new MarkdownHover(this, anchor.range, [linkHint], 10000));\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// (3) Inlay Label Part Location tooltip\n\t\t\tconst iterable = await this._resolveInlayHintLabelPartHover(part, token);\n\t\t\tfor await (let item of iterable) {\n\t\t\t\texecutor.emitOne(item);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate async _resolveInlayHintLabelPartHover(part: RenderedInlayHintLabelPart, token: CancellationToken): Promise<AsyncIterableObject<MarkdownHover>> {\n\t\tif (!part.part.location) {\n\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t}\n\t\tconst { uri, range } = part.part.location;\n\t\tconst ref = await this._resolverService.createModelReference(uri);\n\t\ttry {\n\t\t\tconst model = ref.object.textEditorModel;\n\t\t\tif (!this._languageFeaturesService.hoverProvider.has(model)) {\n\t\t\t\treturn AsyncIterableObject.EMPTY;\n\t\t\t}\n\t\t\treturn getHover(this._languageFeaturesService.hoverProvider, model, new Position(range.startLineNumber, range.startColumn), token)\n\t\t\t\t.filter(item => !isEmptyMarkdownString(item.hover.contents))\n\t\t\t\t.map(item => new MarkdownHover(this, part.item.anchor.range, item.hover.contents, 2 + item.ordinal));\n\t\t} finally {\n\t\t\tref.dispose();\n\t\t}\n\t}\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 { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { InlayHintsController } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController';\nimport { InlayHintsHover } from 'vs/editor/contrib/inlayHints/browser/inlayHintsHover';\n\nregisterEditorContribution(InlayHintsController.ID, InlayHintsController);\nHoverParticipantRegistry.register(InlayHintsHover);\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ReferencesController } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesController';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStorageService } from 'vs/platform/storage/common/storage';\n\nexport class StandaloneReferencesController extends ReferencesController {\n\n\tpublic constructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICodeEditorService editorService: ICodeEditorService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IStorageService storageService: IStorageService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t) {\n\t\tsuper(\n\t\t\ttrue,\n\t\t\teditor,\n\t\t\tcontextKeyService,\n\t\t\teditorService,\n\t\t\tnotificationService,\n\t\t\tinstantiationService,\n\t\t\tstorageService,\n\t\t\tconfigurationService\n\t\t);\n\t}\n}\n\nregisterEditorContribution(ReferencesController.ID, StandaloneReferencesController);\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { Disposable, IDisposable, isDisposable } from 'vs/base/common/lifecycle';\nimport { Schemas } from 'vs/base/common/network';\nimport Severity from 'vs/base/common/severity';\nimport { URI } from 'vs/base/common/uri';\nimport * as nls from 'vs/nls';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IPastFutureElements, IResourceUndoRedoElement, IUndoRedoElement, IUndoRedoService, IWorkspaceUndoRedoElement, ResourceEditStackSnapshot, UndoRedoElementType, UndoRedoGroup, UndoRedoSource, UriComparisonKeyComputer } from 'vs/platform/undoRedo/common/undoRedo';\n\nconst DEBUG = false;\n\nfunction getResourceLabel(resource: URI): string {\n\treturn resource.scheme === Schemas.file ? resource.fsPath : resource.path;\n}\n\nlet stackElementCounter = 0;\n\nclass ResourceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Resource;\n\tpublic readonly actual: IUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabel: string;\n\tpublic readonly strResource: string;\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic isValid: boolean;\n\n\tconstructor(actual: IUndoRedoElement, resourceLabel: string, strResource: string, groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis.resourceLabels = [this.resourceLabel];\n\t\tthis.strResources = [this.strResource];\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.isValid = true;\n\t}\n\n\tpublic setValid(isValid: boolean): void {\n\t\tthis.isValid = isValid;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? ' VALID' : 'INVALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\nconst enum RemovedResourceReason {\n\tExternalRemoval = 0,\n\tNoParallelUniverses = 1\n}\n\nclass ResourceReasonPair {\n\tconstructor(\n\t\tpublic readonly resourceLabel: string,\n\t\tpublic readonly reason: RemovedResourceReason\n\t) { }\n}\n\nclass RemovedResources {\n\tprivate readonly elements = new Map<string, ResourceReasonPair>();\n\n\tpublic createMessage(): string {\n\t\tconst externalRemoval: string[] = [];\n\t\tconst noParallelUniverses: string[] = [];\n\t\tfor (const [, element] of this.elements) {\n\t\t\tconst dest = (\n\t\t\t\telement.reason === RemovedResourceReason.ExternalRemoval\n\t\t\t\t\t? externalRemoval\n\t\t\t\t\t: noParallelUniverses\n\t\t\t);\n\t\t\tdest.push(element.resourceLabel);\n\t\t}\n\n\t\tlet messages: string[] = [];\n\t\tif (externalRemoval.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'externalRemoval', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been closed and modified on disk: {0}.\", externalRemoval.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (noParallelUniverses.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'noParallelUniverses', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been modified in an incompatible way: {0}.\", noParallelUniverses.join(', ')\n\t\t\t\t));\n\t\t}\n\t\treturn messages.join('\\n');\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.elements.size;\n\t}\n\n\tpublic has(strResource: string): boolean {\n\t\treturn this.elements.has(strResource);\n\t}\n\n\tpublic set(strResource: string, value: ResourceReasonPair): void {\n\t\tthis.elements.set(strResource, value);\n\t}\n\n\tpublic delete(strResource: string): boolean {\n\t\treturn this.elements.delete(strResource);\n\t}\n}\n\nclass WorkspaceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Workspace;\n\tpublic readonly actual: IWorkspaceUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic removedResources: RemovedResources | null;\n\tpublic invalidatedResources: RemovedResources | null;\n\n\tconstructor(actual: IWorkspaceUndoRedoElement, resourceLabels: string[], strResources: string[], groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabels = resourceLabels;\n\t\tthis.strResources = strResources;\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.removedResources = null;\n\t\tthis.invalidatedResources = null;\n\t}\n\n\tpublic canSplit(): this is WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } } {\n\t\treturn (typeof this.actual.split === 'function');\n\t}\n\n\tpublic removeResource(resourceLabel: string, strResource: string, reason: RemovedResourceReason): void {\n\t\tif (!this.removedResources) {\n\t\t\tthis.removedResources = new RemovedResources();\n\t\t}\n\t\tif (!this.removedResources.has(strResource)) {\n\t\t\tthis.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason));\n\t\t}\n\t}\n\n\tpublic setValid(resourceLabel: string, strResource: string, isValid: boolean): void {\n\t\tif (isValid) {\n\t\t\tif (this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources.delete(strResource);\n\t\t\t\tif (this.invalidatedResources.size === 0) {\n\t\t\t\t\tthis.invalidatedResources = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources = new RemovedResources();\n\t\t\t}\n\t\t\tif (!this.invalidatedResources.has(strResource)) {\n\t\t\t\tthis.invalidatedResources.set(strResource, new ResourceReasonPair(resourceLabel, RemovedResourceReason.ExternalRemoval));\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? 'INVALID' : ' VALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\ntype StackElement = ResourceStackElement | WorkspaceStackElement;\n\nclass ResourceEditStack {\n\tpublic readonly resourceLabel: string;\n\tprivate readonly strResource: string;\n\tprivate _past: StackElement[];\n\tprivate _future: StackElement[];\n\tpublic locked: boolean;\n\tpublic versionId: number;\n\n\tconstructor(resourceLabel: string, strResource: string) {\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.locked = false;\n\t\tthis.versionId = 1;\n\t}\n\n\tpublic dispose(): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic toString(): string {\n\t\tlet result: string[] = [];\n\t\tresult.push(`* ${this.strResource}:`);\n\t\tfor (let i = 0; i < this._past.length; i++) {\n\t\t\tresult.push(` * [UNDO] ${this._past[i]}`);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\tresult.push(` * [REDO] ${this._future[i]}`);\n\t\t}\n\t\treturn result.join('\\n');\n\t}\n\n\tpublic flushAllElements(): void {\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.versionId++;\n\t}\n\n\tprivate _setElementValidFlag(element: StackElement, isValid: boolean): void {\n\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\telement.setValid(this.resourceLabel, this.strResource, isValid);\n\t\t} else {\n\t\t\telement.setValid(isValid);\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic pushElement(element: StackElement): void {\n\t\t// remove the future\n\t\tfor (const futureElement of this._future) {\n\t\t\tif (futureElement.type === UndoRedoElementType.Workspace) {\n\t\t\t\tfutureElement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.NoParallelUniverses);\n\t\t\t}\n\t\t}\n\t\tthis._future = [];\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst elements: number[] = [];\n\n\t\tfor (let i = 0, len = this._past.length; i < len; i++) {\n\t\t\telements.push(this._past[i].id);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\telements.push(this._future[i].id);\n\t\t}\n\n\t\treturn new ResourceEditStackSnapshot(resource, elements);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst snapshotLength = snapshot.elements.length;\n\t\tlet isOK = true;\n\t\tlet snapshotIndex = 0;\n\t\tlet removePastAfter = -1;\n\t\tfor (let i = 0, len = this._past.length; i < len; i++, snapshotIndex++) {\n\t\t\tconst element = this._past[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremovePastAfter = 0;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tlet removeFutureBefore = -1;\n\t\tfor (let i = this._future.length - 1; i >= 0; i--, snapshotIndex++) {\n\t\t\tconst element = this._future[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremoveFutureBefore = i;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tif (removePastAfter !== -1) {\n\t\t\tthis._past = this._past.slice(0, removePastAfter);\n\t\t}\n\t\tif (removeFutureBefore !== -1) {\n\t\t\tthis._future = this._future.slice(removeFutureBefore + 1);\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic getElements(): IPastFutureElements {\n\t\tconst past: IUndoRedoElement[] = [];\n\t\tconst future: IUndoRedoElement[] = [];\n\n\t\tfor (const element of this._past) {\n\t\t\tpast.push(element.actual);\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tfuture.push(element.actual);\n\t\t}\n\n\t\treturn { past, future };\n\t}\n\n\tpublic getClosestPastElement(): StackElement | null {\n\t\tif (this._past.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 1];\n\t}\n\n\tpublic getSecondClosestPastElement(): StackElement | null {\n\t\tif (this._past.length < 2) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 2];\n\t}\n\n\tpublic getClosestFutureElement(): StackElement | null {\n\t\tif (this._future.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._future[this._future.length - 1];\n\t}\n\n\tpublic hasPastElements(): boolean {\n\t\treturn (this._past.length > 0);\n\t}\n\n\tpublic hasFutureElements(): boolean {\n\t\treturn (this._future.length > 0);\n\t}\n\n\tpublic splitPastWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._past.length - 1; j >= 0; j--) {\n\t\t\tif (this._past[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._past[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._past.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic splitFutureWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._future.length - 1; j >= 0; j--) {\n\t\t\tif (this._future[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._future[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._future.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveBackward(element: StackElement): void {\n\t\tthis._past.pop();\n\t\tthis._future.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveForward(element: StackElement): void {\n\t\tthis._future.pop();\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n}\n\nclass EditStackSnapshot {\n\n\tpublic readonly editStacks: ResourceEditStack[];\n\tprivate readonly _versionIds: number[];\n\n\tconstructor(editStacks: ResourceEditStack[]) {\n\t\tthis.editStacks = editStacks;\n\t\tthis._versionIds = [];\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tthis._versionIds[i] = this.editStacks[i].versionId;\n\t\t}\n\t}\n\n\tpublic isValid(): boolean {\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tif (this._versionIds[i] !== this.editStacks[i].versionId) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nconst missingEditStack = new ResourceEditStack('', '');\nmissingEditStack.locked = true;\n\nexport class UndoRedoService implements IUndoRedoService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _editStacks: Map<string, ResourceEditStack>;\n\tprivate readonly _uriComparisonKeyComputers: [string, UriComparisonKeyComputer][];\n\n\tconstructor(\n\t\t@IDialogService private readonly _dialogService: IDialogService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t) {\n\t\tthis._editStacks = new Map<string, ResourceEditStack>();\n\t\tthis._uriComparisonKeyComputers = [];\n\t}\n\n\tpublic getUriComparisonKey(resource: URI): string {\n\t\tfor (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) {\n\t\t\tif (uriComparisonKeyComputer[0] === resource.scheme) {\n\t\t\t\treturn uriComparisonKeyComputer[1].getComparisonKey(resource);\n\t\t\t}\n\t\t}\n\t\treturn resource.toString();\n\t}\n\n\tprivate _print(label: string): void {\n\t\tconsole.log(`------------------------------------`);\n\t\tconsole.log(`AFTER ${label}: `);\n\t\tlet str: string[] = [];\n\t\tfor (const element of this._editStacks) {\n\t\t\tstr.push(element[1].toString());\n\t\t}\n\t\tconsole.log(str.join('\\n'));\n\t}\n\n\tpublic pushElement(element: IUndoRedoElement, group: UndoRedoGroup = UndoRedoGroup.None, source: UndoRedoSource = UndoRedoSource.None): void {\n\t\tif (element.type === UndoRedoElementType.Resource) {\n\t\t\tconst resourceLabel = getResourceLabel(element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(element.resource);\n\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t} else {\n\t\t\tconst seen = new Set<string>();\n\t\t\tconst resourceLabels: string[] = [];\n\t\t\tconst strResources: string[] = [];\n\t\t\tfor (const resource of element.resources) {\n\t\t\t\tconst resourceLabel = getResourceLabel(resource);\n\t\t\t\tconst strResource = this.getUriComparisonKey(resource);\n\n\t\t\t\tif (seen.has(strResource)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tseen.add(strResource);\n\t\t\t\tresourceLabels.push(resourceLabel);\n\t\t\t\tstrResources.push(strResource);\n\t\t\t}\n\n\t\t\tif (resourceLabels.length === 1) {\n\t\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0], group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t} else {\n\t\t\t\tthis._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('pushElement');\n\t\t}\n\t}\n\n\tprivate _pushElement(element: StackElement): void {\n\t\tfor (let i = 0, len = element.strResources.length; i < len; i++) {\n\t\t\tconst resourceLabel = element.resourceLabels[i];\n\t\t\tconst strResource = element.strResources[i];\n\n\t\t\tlet editStack: ResourceEditStack;\n\t\t\tif (this._editStacks.has(strResource)) {\n\t\t\t\teditStack = this._editStacks.get(strResource)!;\n\t\t\t} else {\n\t\t\t\teditStack = new ResourceEditStack(resourceLabel, strResource);\n\t\t\t\tthis._editStacks.set(strResource, editStack);\n\t\t\t}\n\n\t\t\teditStack.pushElement(element);\n\t\t}\n\t}\n\n\tpublic getLastElement(resource: URI): IUndoRedoElement | null {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\tif (editStack.hasFutureElements()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst closestPastElement = editStack.getClosestPastElement();\n\t\t\treturn closestPastElement ? closestPastElement.actual : null;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _splitPastWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitPastWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tprivate _splitFutureWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitFutureWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tpublic removeElements(resource: URI | string): void {\n\t\tconst strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.dispose();\n\t\t\tthis._editStacks.delete(strResource);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('removeElements');\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(resource: URI, isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.setElementsValidFlag(isValid, filter);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('setElementsValidFlag');\n\t\t}\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.createSnapshot(resource);\n\t\t}\n\t\treturn new ResourceEditStackSnapshot(resource, []);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst strResource = this.getUriComparisonKey(snapshot.resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.restoreSnapshot(snapshot);\n\n\t\t\tif (!editStack.hasPastElements() && !editStack.hasFutureElements()) {\n\t\t\t\t// the edit stack is now empty, just remove it entirely\n\t\t\t\teditStack.dispose();\n\t\t\t\tthis._editStacks.delete(strResource);\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('restoreSnapshot');\n\t\t}\n\t}\n\n\tpublic getElements(resource: URI): IPastFutureElements {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.getElements();\n\t\t}\n\t\treturn { past: [], future: [] };\n\t}\n\n\tprivate _findClosestUndoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with the sourceId and with the highest sourceOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder > matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canUndo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasPastElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _onError(err: Error, element: StackElement): void {\n\t\tonUnexpectedError(err);\n\t\t// An error occurred while undoing or redoing => drop the undo/redo stack for all affected resources\n\t\tfor (const strResource of element.strResources) {\n\t\t\tthis.removeElements(strResource);\n\t\t}\n\t\tthis._notificationService.error(err);\n\t}\n\n\tprivate _acquireLocks(editStackSnapshot: EditStackSnapshot): () => void {\n\t\t// first, check if all locks can be acquired\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tthrow new Error('Cannot acquire edit stack lock');\n\t\t\t}\n\t\t}\n\n\t\t// can acquire all locks\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.locked = true;\n\t\t}\n\n\t\treturn () => {\n\t\t\t// release all locks\n\t\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\t\teditStack.locked = false;\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _safeInvokeWithLocks(element: StackElement, invoke: () => Promise<void> | void, editStackSnapshot: EditStackSnapshot, cleanup: IDisposable, continuation: () => Promise<void> | void): Promise<void> | void {\n\t\tconst releaseLocks = this._acquireLocks(editStackSnapshot);\n\n\t\tlet result: Promise<void> | void;\n\t\ttry {\n\t\t\tresult = invoke();\n\t\t} catch (err) {\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\tif (result) {\n\t\t\t// result is Promise<void>\n\t\t\treturn result.then(\n\t\t\t\t() => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn continuation();\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn this._onError(err, element);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\t// result is void\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn continuation();\n\t\t}\n\t}\n\n\tprivate async _invokeWorkspacePrepare(element: WorkspaceStackElement): Promise<IDisposable> {\n\t\tif (typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tconst result = element.actual.prepareUndoRedo();\n\t\tif (typeof result === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _invokeResourcePrepare(element: ResourceStackElement, callback: (disposable: IDisposable) => Promise<void> | void): void | Promise<void> {\n\t\tif (element.actual.type !== UndoRedoElementType.Workspace || typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\t// no preparation needed\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tconst r = element.actual.prepareUndoRedo();\n\t\tif (!r) {\n\t\t\t// nothing to clean up\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tif (isDisposable(r)) {\n\t\t\treturn callback(r);\n\t\t}\n\n\t\treturn r.then((disposable) => {\n\t\t\treturn callback(disposable);\n\t\t});\n\t}\n\n\tprivate _getAffectedEditStacks(element: WorkspaceStackElement): EditStackSnapshot {\n\t\tconst affectedEditStacks: ResourceEditStack[] = [];\n\t\tfor (const strResource of element.strResources) {\n\t\t\taffectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack);\n\t\t}\n\t\treturn new EditStackSnapshot(affectedEditStacks);\n\t}\n\n\tprivate _tryToSplitAndUndo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitPastWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._undo(strResource, 0, true));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last past element in all the impacted resources!\n\t\tconst cannotUndoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestPastElement() !== element) {\n\t\t\t\tcannotUndoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotUndoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because changes were made to {1}\", element.label, cannotUndoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceUndo(strResource: string, element: WorkspaceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceUndo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks, undoConfirmed);\n\t}\n\n\tprivate _isPartOfUndoGroup(element: WorkspaceStackElement): boolean {\n\t\tif (!element.groupId) {\n\t\t\treturn false;\n\t\t}\n\t\t// check that there is at least another element with the same groupId ready to be undone\n\t\tfor (const [, editStack] of this._editStacks) {\n\t\t\tconst pastElement = editStack.getClosestPastElement();\n\t\t\tif (!pastElement) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (pastElement === element) {\n\t\t\t\tconst secondPastElement = editStack.getSecondClosestPastElement();\n\t\t\t\tif (secondPastElement && secondPastElement.groupId === element.groupId) {\n\t\t\t\t\t// there is another element with the same group id in the same stack!\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pastElement.groupId === element.groupId) {\n\t\t\t\t// there is another element with the same group id in another stack!\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate async _confirmAndExecuteWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, undoConfirmed: boolean): Promise<void> {\n\n\t\tif (element.canSplit() && !this._isPartOfUndoGroup(element)) {\n\t\t\t// this element can be split\n\n\t\t\tconst result = await this._dialogService.show(\n\t\t\t\tSeverity.Info,\n\t\t\t\tnls.localize('confirmWorkspace', \"Would you like to undo '{0}' across all files?\", element.label),\n\t\t\t\t[\n\t\t\t\t\tnls.localize({ key: 'ok', comment: ['{0} denotes a number that is > 1'] }, \"Undo in {0} Files\", editStackSnapshot.editStacks.length),\n\t\t\t\t\tnls.localize('nok', \"Undo this File\"),\n\t\t\t\t\tnls.localize('cancel', \"Cancel\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tcancelId: 2\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif (result.choice === 2) {\n\t\t\t\t// choice: cancel\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (result.choice === 1) {\n\t\t\t\t// choice: undo this file\n\t\t\t\tthis._splitPastWorkspaceElement(element, null);\n\t\t\t\treturn this._undo(strResource, 0, true);\n\t\t\t}\n\n\t\t\t// choice: undo in all files\n\n\t\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await)\n\t\t\tconst verificationError1 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*invalidated resources will be checked after the prepare call*/false);\n\t\t\tif (verificationError1) {\n\t\t\t\treturn verificationError1.returnValue;\n\t\t\t}\n\n\t\t\tundoConfirmed = true;\n\t\t}\n\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError2 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError2) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError2.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveBackward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t}\n\n\tprivate _resourceUndo(editStack: ResourceEditStack, element: ResourceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not undo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveBackward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t\t});\n\t}\n\n\tprivate _findClosestUndoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the highest groupOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder > matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueUndoInGroup(groupId: number, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestUndoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._undo(matchedStrResource, 0, undoConfirmed);\n\t\t}\n\t}\n\n\tpublic undo(resourceOrSource: URI | UndoRedoSource): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._undo(matchedStrResource, resourceOrSource.id, false) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._undo(resourceOrSource, 0, false);\n\t\t}\n\t\treturn this._undo(this.getUriComparisonKey(resourceOrSource), 0, false);\n\t}\n\n\tprivate _undo(strResource: string, sourceId: number = 0, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestPastElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure undoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestUndoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be undone before this one\n\t\t\t\treturn this._undo(matchedStrResource, sourceId, undoConfirmed);\n\t\t\t}\n\t\t}\n\n\t\tconst shouldPromptForConfirmation = (element.sourceId !== sourceId || element.confirmBeforeUndo);\n\t\tif (shouldPromptForConfirmation && !undoConfirmed) {\n\t\t\t// Hit a different source or the element asks for prompt before undo, prompt for confirmation\n\t\t\treturn this._confirmAndContinueUndo(strResource, sourceId, element);\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceUndo(strResource, element, undoConfirmed);\n\t\t\t} else {\n\t\t\t\treturn this._resourceUndo(editStack, element, undoConfirmed);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('undo');\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async _confirmAndContinueUndo(strResource: string, sourceId: number, element: StackElement): Promise<void> {\n\t\tconst result = await this._dialogService.show(\n\t\t\tSeverity.Info,\n\t\t\tnls.localize('confirmDifferentSource', \"Would you like to undo '{0}'?\", element.label),\n\t\t\t[\n\t\t\t\tnls.localize('confirmDifferentSource.yes', \"Yes\"),\n\t\t\t\tnls.localize('confirmDifferentSource.no', \"No\"),\n\t\t\t],\n\t\t\t{\n\t\t\t\tcancelId: 1\n\t\t\t}\n\t\t);\n\n\t\tif (result.choice === 1) {\n\t\t\t// choice: cancel\n\t\t\treturn;\n\t\t}\n\n\t\t// choice: undo\n\t\treturn this._undo(strResource, sourceId, true);\n\t}\n\n\tprivate _findClosestRedoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with sourceId and with the lowest sourceOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder < matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canRedo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasFutureElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _tryToSplitAndRedo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitFutureWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._redo(strResource));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last future element in all the impacted resources!\n\t\tconst cannotRedoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestFutureElement() !== element) {\n\t\t\t\tcannotRedoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotRedoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because changes were made to {1}\", element.label, cannotRedoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceRedo(strResource: string, element: WorkspaceStackElement): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._executeWorkspaceRedo(strResource, element, affectedEditStacks);\n\t}\n\n\tprivate async _executeWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot): Promise<void> {\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveForward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup, () => this._continueRedoInGroup(element.groupId));\n\t}\n\n\tprivate _resourceRedo(editStack: ResourceEditStack, element: ResourceStackElement): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not redo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveForward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueRedoInGroup(element.groupId));\n\t\t});\n\t}\n\n\tprivate _findClosestRedoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the lowest groupOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder < matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueRedoInGroup(groupId: number): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestRedoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._redo(matchedStrResource);\n\t\t}\n\t}\n\n\tpublic redo(resourceOrSource: URI | UndoRedoSource | string): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._redo(matchedStrResource) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._redo(resourceOrSource);\n\t\t}\n\t\treturn this._redo(this.getUriComparisonKey(resourceOrSource));\n\t}\n\n\tprivate _redo(strResource: string): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestFutureElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure redoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestRedoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be redone before this one\n\t\t\t\treturn this._redo(matchedStrResource);\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceRedo(strResource, element);\n\t\t\t} else {\n\t\t\t\treturn this._resourceRedo(editStack, element);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('redo');\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass WorkspaceVerificationError {\n\tconstructor(public readonly returnValue: Promise<void> | void) { }\n}\n\nregisterSingleton(IUndoRedoService, UndoRedoService);\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 { localize } from 'vs/nls';\nimport { IWorkspaceFolderProvider } from 'vs/base/common/labels';\nimport { TernarySearchTree } from 'vs/base/common/map';\nimport { URI } from 'vs/base/common/uri';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IWorkspaceContextService = createDecorator<IWorkspaceContextService>('contextService');\n\nexport interface IWorkspaceContextService extends IWorkspaceFolderProvider {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Provides access to the workspace object the window is running with.\n\t * Use `getCompleteWorkspace` to get complete workspace object.\n\t */\n\tgetWorkspace(): IWorkspace;\n}\n\nexport interface IBaseWorkspaceIdentifier {\n\n\t/**\n\t * Every workspace (multi-root, single folder or empty)\n\t * has a unique identifier. It is not possible to open\n\t * a workspace with the same `id` in multiple windows\n\t */\n\treadonly id: string;\n}\n\n/**\n * A single folder workspace identifier is a path to a folder + id.\n */\nexport interface ISingleFolderWorkspaceIdentifier extends IBaseWorkspaceIdentifier {\n\n\t/**\n\t * Folder path as `URI`.\n\t */\n\treadonly uri: URI;\n}\n\n/**\n * A multi-root workspace identifier is a path to a workspace file + id.\n */\nexport interface IWorkspaceIdentifier extends IBaseWorkspaceIdentifier {\n\n\t/**\n\t * Workspace config file path as `URI`.\n\t */\n\tconfigPath: URI;\n}\n\nexport function isSingleFolderWorkspaceIdentifier(obj: unknown): obj is ISingleFolderWorkspaceIdentifier {\n\tconst singleFolderIdentifier = obj as ISingleFolderWorkspaceIdentifier | undefined;\n\n\treturn typeof singleFolderIdentifier?.id === 'string' && URI.isUri(singleFolderIdentifier.uri);\n}\n\nexport function toWorkspaceIdentifier(workspace: IWorkspace): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined {\n\n\t// Multi root\n\tif (workspace.configuration) {\n\t\treturn {\n\t\t\tid: workspace.id,\n\t\t\tconfigPath: workspace.configuration\n\t\t};\n\t}\n\n\t// Single folder\n\tif (workspace.folders.length === 1) {\n\t\treturn {\n\t\t\tid: workspace.id,\n\t\t\turi: workspace.folders[0].uri\n\t\t};\n\t}\n\n\t// Empty workspace\n\treturn undefined;\n}\n\nexport interface IWorkspace {\n\n\t/**\n\t * the unique identifier of the workspace.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * Folders in the workspace.\n\t */\n\treadonly folders: IWorkspaceFolder[];\n\n\t/**\n\t * Transient workspaces are meant to go away after being used\n\t * once, e.g. a window reload of a transient workspace will\n\t * open an empty window.\n\t */\n\treadonly transient?: boolean;\n\n\t/**\n\t * the location of the workspace configuration\n\t */\n\treadonly configuration?: URI | null;\n}\n\nexport interface IWorkspaceFolderData {\n\n\t/**\n\t * The associated URI for this workspace folder.\n\t */\n\treadonly uri: URI;\n\n\t/**\n\t * The name of this workspace folder. Defaults to\n\t * the basename of its [uri-path](#Uri.path)\n\t */\n\treadonly name: string;\n\n\t/**\n\t * The ordinal number of this workspace folder.\n\t */\n\treadonly index: number;\n}\n\nexport interface IWorkspaceFolder extends IWorkspaceFolderData {\n}\n\nexport class Workspace implements IWorkspace {\n\n\tprivate _foldersMap: TernarySearchTree<URI, WorkspaceFolder> = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing);\n\tprivate _folders!: WorkspaceFolder[];\n\n\tconstructor(\n\t\tprivate _id: string,\n\t\tfolders: WorkspaceFolder[],\n\t\tprivate _transient: boolean,\n\t\tprivate _configuration: URI | null,\n\t\tprivate _ignorePathCasing: (key: URI) => boolean,\n\t) {\n\t\tthis.folders = folders;\n\t}\n\n\tget folders(): WorkspaceFolder[] {\n\t\treturn this._folders;\n\t}\n\n\tset folders(folders: WorkspaceFolder[]) {\n\t\tthis._folders = folders;\n\t\tthis.updateFoldersMap();\n\t}\n\n\tget id(): string {\n\t\treturn this._id;\n\t}\n\n\tget transient(): boolean {\n\t\treturn this._transient;\n\t}\n\n\tget configuration(): URI | null {\n\t\treturn this._configuration;\n\t}\n\n\tset configuration(configuration: URI | null) {\n\t\tthis._configuration = configuration;\n\t}\n\n\tgetFolder(resource: URI): IWorkspaceFolder | null {\n\t\tif (!resource) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._foldersMap.findSubstr(resource.with({\n\t\t\tscheme: resource.scheme,\n\t\t\tauthority: resource.authority,\n\t\t\tpath: resource.path\n\t\t})) || null;\n\t}\n\n\tprivate updateFoldersMap(): void {\n\t\tthis._foldersMap = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing);\n\t\tfor (const folder of this.folders) {\n\t\t\tthis._foldersMap.set(folder.uri, folder);\n\t\t}\n\t}\n\n\ttoJSON(): IWorkspace {\n\t\treturn { id: this.id, folders: this.folders, transient: this.transient, configuration: this.configuration };\n\t}\n}\n\nexport interface IRawFileWorkspaceFolder {\n}\n\nexport interface IRawUriWorkspaceFolder {\n}\n\nexport class WorkspaceFolder implements IWorkspaceFolder {\n\n\treadonly uri: URI;\n\treadonly name: string;\n\treadonly index: number;\n\n\tconstructor(\n\t\tdata: IWorkspaceFolderData,\n\t\t/**\n\t\t * Provides access to the original metadata for this workspace\n\t\t * folder. This can be different from the metadata provided in\n\t\t * this class:\n\t\t * - raw paths can be relative\n\t\t * - raw paths are not normalized\n\t\t */\n\t\treadonly raw?: IRawFileWorkspaceFolder | IRawUriWorkspaceFolder\n\t) {\n\t\tthis.uri = data.uri;\n\t\tthis.index = data.index;\n\t\tthis.name = data.name;\n\t}\n\n\ttoJSON(): IWorkspaceFolderData {\n\t\treturn { uri: this.uri, name: this.name, index: this.index };\n\t}\n}\n\nexport const WORKSPACE_EXTENSION = 'code-workspace';\nexport const WORKSPACE_FILTER = [{ name: localize('codeWorkspace', \"Code Workspace\"), extensions: [WORKSPACE_EXTENSION] }];\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 { normalizeDriveLetter } from 'vs/base/common/labels';\nimport * as path from 'vs/base/common/path';\nimport { dirname } from 'vs/base/common/resources';\nimport { commonPrefixLength, getLeadingWhitespace, isFalsyOrWhitespace, splitLines } from 'vs/base/common/strings';\nimport { generateUuid } from 'vs/base/common/uuid';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { Text, Variable, VariableResolver } from 'vs/editor/contrib/snippet/browser/snippetParser';\nimport { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer';\nimport * as nls from 'vs/nls';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { WORKSPACE_EXTENSION, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, IWorkspaceContextService, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';\n\nexport const KnownSnippetVariableNames: { [key: string]: true } = Object.freeze({\n\t'CURRENT_YEAR': true,\n\t'CURRENT_YEAR_SHORT': true,\n\t'CURRENT_MONTH': true,\n\t'CURRENT_DATE': true,\n\t'CURRENT_HOUR': true,\n\t'CURRENT_MINUTE': true,\n\t'CURRENT_SECOND': true,\n\t'CURRENT_DAY_NAME': true,\n\t'CURRENT_DAY_NAME_SHORT': true,\n\t'CURRENT_MONTH_NAME': true,\n\t'CURRENT_MONTH_NAME_SHORT': true,\n\t'CURRENT_SECONDS_UNIX': true,\n\t'SELECTION': true,\n\t'CLIPBOARD': true,\n\t'TM_SELECTED_TEXT': true,\n\t'TM_CURRENT_LINE': true,\n\t'TM_CURRENT_WORD': true,\n\t'TM_LINE_INDEX': true,\n\t'TM_LINE_NUMBER': true,\n\t'TM_FILENAME': true,\n\t'TM_FILENAME_BASE': true,\n\t'TM_DIRECTORY': true,\n\t'TM_FILEPATH': true,\n\t'RELATIVE_FILEPATH': true,\n\t'BLOCK_COMMENT_START': true,\n\t'BLOCK_COMMENT_END': true,\n\t'LINE_COMMENT': true,\n\t'WORKSPACE_NAME': true,\n\t'WORKSPACE_FOLDER': true,\n\t'RANDOM': true,\n\t'RANDOM_HEX': true,\n\t'UUID': true\n});\n\nexport class CompositeSnippetVariableResolver implements VariableResolver {\n\n\tconstructor(private readonly _delegates: VariableResolver[]) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\t\tfor (const delegate of this._delegates) {\n\t\t\tlet value = delegate.resolve(variable);\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n}\n\nexport class SelectionBasedVariableResolver implements VariableResolver {\n\n\tconstructor(\n\t\tprivate readonly _model: ITextModel,\n\t\tprivate readonly _selection: Selection,\n\t\tprivate readonly _selectionIdx: number,\n\t\tprivate readonly _overtypingCapturer: OvertypingCapturer | undefined\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\n\t\tconst { name } = variable;\n\n\t\tif (name === 'SELECTION' || name === 'TM_SELECTED_TEXT') {\n\t\t\tlet value = this._model.getValueInRange(this._selection) || undefined;\n\t\t\tlet isMultiline = this._selection.startLineNumber !== this._selection.endLineNumber;\n\n\t\t\t// If there was no selected text, try to get last overtyped text\n\t\t\tif (!value && this._overtypingCapturer) {\n\t\t\t\tconst info = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);\n\t\t\t\tif (info) {\n\t\t\t\t\tvalue = info.value;\n\t\t\t\t\tisMultiline = info.multiline;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value && isMultiline && variable.snippet) {\n\t\t\t\t// Selection is a multiline string which we indentation we now\n\t\t\t\t// need to adjust. We compare the indentation of this variable\n\t\t\t\t// with the indentation at the editor position and add potential\n\t\t\t\t// extra indentation to the value\n\n\t\t\t\tconst line = this._model.getLineContent(this._selection.startLineNumber);\n\t\t\t\tconst lineLeadingWhitespace = getLeadingWhitespace(line, 0, this._selection.startColumn - 1);\n\n\t\t\t\tlet varLeadingWhitespace = lineLeadingWhitespace;\n\t\t\t\tvariable.snippet.walk(marker => {\n\t\t\t\t\tif (marker === variable) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (marker instanceof Text) {\n\t\t\t\t\t\tvarLeadingWhitespace = getLeadingWhitespace(splitLines(marker.value).pop()!);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\tconst whitespaceCommonLength = commonPrefixLength(varLeadingWhitespace, lineLeadingWhitespace);\n\n\t\t\t\tvalue = value.replace(\n\t\t\t\t\t/(\\r\\n|\\r|\\n)(.*)/g,\n\t\t\t\t\t(m, newline, rest) => `${newline}${varLeadingWhitespace.substr(whitespaceCommonLength)}${rest}`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn value;\n\n\t\t} else if (name === 'TM_CURRENT_LINE') {\n\t\t\treturn this._model.getLineContent(this._selection.positionLineNumber);\n\n\t\t} else if (name === 'TM_CURRENT_WORD') {\n\t\t\tconst info = this._model.getWordAtPosition({\n\t\t\t\tlineNumber: this._selection.positionLineNumber,\n\t\t\t\tcolumn: this._selection.positionColumn\n\t\t\t});\n\t\t\treturn info && info.word || undefined;\n\n\t\t} else if (name === 'TM_LINE_INDEX') {\n\t\t\treturn String(this._selection.positionLineNumber - 1);\n\n\t\t} else if (name === 'TM_LINE_NUMBER') {\n\t\t\treturn String(this._selection.positionLineNumber);\n\t\t}\n\t\treturn undefined;\n\t}\n}\n\nexport class ModelBasedVariableResolver implements VariableResolver {\n\n\tconstructor(\n\t\tprivate readonly _labelService: ILabelService,\n\t\tprivate readonly _model: ITextModel\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\n\t\tconst { name } = variable;\n\n\t\tif (name === 'TM_FILENAME') {\n\t\t\treturn path.basename(this._model.uri.fsPath);\n\n\t\t} else if (name === 'TM_FILENAME_BASE') {\n\t\t\tconst name = path.basename(this._model.uri.fsPath);\n\t\t\tconst idx = name.lastIndexOf('.');\n\t\t\tif (idx <= 0) {\n\t\t\t\treturn name;\n\t\t\t} else {\n\t\t\t\treturn name.slice(0, idx);\n\t\t\t}\n\n\t\t} else if (name === 'TM_DIRECTORY') {\n\t\t\tif (path.dirname(this._model.uri.fsPath) === '.') {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn this._labelService.getUriLabel(dirname(this._model.uri));\n\n\t\t} else if (name === 'TM_FILEPATH') {\n\t\t\treturn this._labelService.getUriLabel(this._model.uri);\n\t\t} else if (name === 'RELATIVE_FILEPATH') {\n\t\t\treturn this._labelService.getUriLabel(this._model.uri, { relative: true, noPrefix: true });\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nexport interface IReadClipboardText {\n\t(): string | undefined;\n}\n\nexport class ClipboardBasedVariableResolver implements VariableResolver {\n\n\tconstructor(\n\t\tprivate readonly _readClipboardText: IReadClipboardText,\n\t\tprivate readonly _selectionIdx: number,\n\t\tprivate readonly _selectionCount: number,\n\t\tprivate readonly _spread: boolean\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\t\tif (variable.name !== 'CLIPBOARD') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst clipboardText = this._readClipboardText();\n\t\tif (!clipboardText) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// `spread` is assigning each cursor a line of the clipboard\n\t\t// text whenever there the line count equals the cursor count\n\t\t// and when enabled\n\t\tif (this._spread) {\n\t\t\tconst lines = clipboardText.split(/\\r\\n|\\n|\\r/).filter(s => !isFalsyOrWhitespace(s));\n\t\t\tif (lines.length === this._selectionCount) {\n\t\t\t\treturn lines[this._selectionIdx];\n\t\t\t}\n\t\t}\n\t\treturn clipboardText;\n\t}\n}\nexport class CommentBasedVariableResolver implements VariableResolver {\n\tconstructor(\n\t\tprivate readonly _model: ITextModel,\n\t\tprivate readonly _selection: Selection\n\t) {\n\t\t//\n\t}\n\tresolve(variable: Variable): string | undefined {\n\t\tconst { name } = variable;\n\t\tconst langId = this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber, this._selection.selectionStartColumn);\n\t\tconst config = LanguageConfigurationRegistry.getComments(langId);\n\t\tif (!config) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (name === 'LINE_COMMENT') {\n\t\t\treturn config.lineCommentToken || undefined;\n\t\t} else if (name === 'BLOCK_COMMENT_START') {\n\t\t\treturn config.blockCommentStartToken || undefined;\n\t\t} else if (name === 'BLOCK_COMMENT_END') {\n\t\t\treturn config.blockCommentEndToken || undefined;\n\t\t}\n\t\treturn undefined;\n\t}\n}\nexport class TimeBasedVariableResolver implements VariableResolver {\n\n\tprivate static readonly dayNames = [nls.localize('Sunday', \"Sunday\"), nls.localize('Monday', \"Monday\"), nls.localize('Tuesday', \"Tuesday\"), nls.localize('Wednesday', \"Wednesday\"), nls.localize('Thursday', \"Thursday\"), nls.localize('Friday', \"Friday\"), nls.localize('Saturday', \"Saturday\")];\n\tprivate static readonly dayNamesShort = [nls.localize('SundayShort', \"Sun\"), nls.localize('MondayShort', \"Mon\"), nls.localize('TuesdayShort', \"Tue\"), nls.localize('WednesdayShort', \"Wed\"), nls.localize('ThursdayShort', \"Thu\"), nls.localize('FridayShort', \"Fri\"), nls.localize('SaturdayShort', \"Sat\")];\n\tprivate static readonly monthNames = [nls.localize('January', \"January\"), nls.localize('February', \"February\"), nls.localize('March', \"March\"), nls.localize('April', \"April\"), nls.localize('May', \"May\"), nls.localize('June', \"June\"), nls.localize('July', \"July\"), nls.localize('August', \"August\"), nls.localize('September', \"September\"), nls.localize('October', \"October\"), nls.localize('November', \"November\"), nls.localize('December', \"December\")];\n\tprivate static readonly monthNamesShort = [nls.localize('JanuaryShort', \"Jan\"), nls.localize('FebruaryShort', \"Feb\"), nls.localize('MarchShort', \"Mar\"), nls.localize('AprilShort', \"Apr\"), nls.localize('MayShort', \"May\"), nls.localize('JuneShort', \"Jun\"), nls.localize('JulyShort', \"Jul\"), nls.localize('AugustShort', \"Aug\"), nls.localize('SeptemberShort', \"Sep\"), nls.localize('OctoberShort', \"Oct\"), nls.localize('NovemberShort', \"Nov\"), nls.localize('DecemberShort', \"Dec\")];\n\n\tprivate readonly _date = new Date();\n\n\tresolve(variable: Variable): string | undefined {\n\t\tconst { name } = variable;\n\n\t\tif (name === 'CURRENT_YEAR') {\n\t\t\treturn String(this._date.getFullYear());\n\t\t} else if (name === 'CURRENT_YEAR_SHORT') {\n\t\t\treturn String(this._date.getFullYear()).slice(-2);\n\t\t} else if (name === 'CURRENT_MONTH') {\n\t\t\treturn String(this._date.getMonth().valueOf() + 1).padStart(2, '0');\n\t\t} else if (name === 'CURRENT_DATE') {\n\t\t\treturn String(this._date.getDate().valueOf()).padStart(2, '0');\n\t\t} else if (name === 'CURRENT_HOUR') {\n\t\t\treturn String(this._date.getHours().valueOf()).padStart(2, '0');\n\t\t} else if (name === 'CURRENT_MINUTE') {\n\t\t\treturn String(this._date.getMinutes().valueOf()).padStart(2, '0');\n\t\t} else if (name === 'CURRENT_SECOND') {\n\t\t\treturn String(this._date.getSeconds().valueOf()).padStart(2, '0');\n\t\t} else if (name === 'CURRENT_DAY_NAME') {\n\t\t\treturn TimeBasedVariableResolver.dayNames[this._date.getDay()];\n\t\t} else if (name === 'CURRENT_DAY_NAME_SHORT') {\n\t\t\treturn TimeBasedVariableResolver.dayNamesShort[this._date.getDay()];\n\t\t} else if (name === 'CURRENT_MONTH_NAME') {\n\t\t\treturn TimeBasedVariableResolver.monthNames[this._date.getMonth()];\n\t\t} else if (name === 'CURRENT_MONTH_NAME_SHORT') {\n\t\t\treturn TimeBasedVariableResolver.monthNamesShort[this._date.getMonth()];\n\t\t} else if (name === 'CURRENT_SECONDS_UNIX') {\n\t\t\treturn String(Math.floor(this._date.getTime() / 1000));\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nexport class WorkspaceBasedVariableResolver implements VariableResolver {\n\tconstructor(\n\t\tprivate readonly _workspaceService: IWorkspaceContextService | undefined,\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\t\tif (!this._workspaceService) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst workspaceIdentifier = toWorkspaceIdentifier(this._workspaceService.getWorkspace());\n\t\tif (!workspaceIdentifier) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (variable.name === 'WORKSPACE_NAME') {\n\t\t\treturn this._resolveWorkspaceName(workspaceIdentifier);\n\t\t} else if (variable.name === 'WORKSPACE_FOLDER') {\n\t\t\treturn this._resoveWorkspacePath(workspaceIdentifier);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\tprivate _resolveWorkspaceName(workspaceIdentifier: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string | undefined {\n\t\tif (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) {\n\t\t\treturn path.basename(workspaceIdentifier.uri.path);\n\t\t}\n\n\t\tlet filename = path.basename(workspaceIdentifier.configPath.path);\n\t\tif (filename.endsWith(WORKSPACE_EXTENSION)) {\n\t\t\tfilename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);\n\t\t}\n\t\treturn filename;\n\t}\n\tprivate _resoveWorkspacePath(workspaceIdentifier: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string | undefined {\n\t\tif (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) {\n\t\t\treturn normalizeDriveLetter(workspaceIdentifier.uri.fsPath);\n\t\t}\n\n\t\tlet filename = path.basename(workspaceIdentifier.configPath.path);\n\t\tlet folderpath = workspaceIdentifier.configPath.fsPath;\n\t\tif (folderpath.endsWith(filename)) {\n\t\t\tfolderpath = folderpath.substr(0, folderpath.length - filename.length - 1);\n\t\t}\n\t\treturn (folderpath ? normalizeDriveLetter(folderpath) : '/');\n\t}\n}\n\nexport class RandomBasedVariableResolver implements VariableResolver {\n\tresolve(variable: Variable): string | undefined {\n\t\tconst { name } = variable;\n\n\t\tif (name === 'RANDOM') {\n\t\t\treturn Math.random().toString().slice(-6);\n\t\t} else if (name === 'RANDOM_HEX') {\n\t\t\treturn Math.random().toString(16).slice(-6);\n\t\t} else if (name === 'UUID') {\n\t\t\treturn generateUuid();\n\t\t}\n\n\t\treturn undefined;\n\t}\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 { groupBy } from 'vs/base/common/arrays';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { dispose } from 'vs/base/common/lifecycle';\nimport { getLeadingWhitespace } from 'vs/base/common/strings';\nimport 'vs/css!./snippetSession';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IIdentifiedSingleEditOperation, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';\nimport { Choice, Marker, Placeholder, SnippetParser, Text, TextmateSnippet } from './snippetParser';\nimport { ClipboardBasedVariableResolver, CommentBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, RandomBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from './snippetVariables';\n\nexport class OneSnippet {\n\n\tprivate _placeholderDecorations?: Map<Placeholder, string>;\n\tprivate _placeholderGroups: Placeholder[][];\n\t_placeholderGroupsIdx: number;\n\t_nestingLevel: number = 1;\n\n\tprivate static readonly _decor = {\n\t\tactive: ModelDecorationOptions.register({ description: 'snippet-placeholder-1', stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }),\n\t\tinactive: ModelDecorationOptions.register({ description: 'snippet-placeholder-2', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }),\n\t\tactiveFinal: ModelDecorationOptions.register({ description: 'snippet-placeholder-3', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }),\n\t\tinactiveFinal: ModelDecorationOptions.register({ description: 'snippet-placeholder-4', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }),\n\t};\n\n\tconstructor(\n\t\tprivate readonly _editor: IActiveCodeEditor, private readonly _snippet: TextmateSnippet,\n\t\tprivate readonly _offset: number, private readonly _snippetLineLeadingWhitespace: string\n\t) {\n\t\tthis._placeholderGroups = groupBy(_snippet.placeholders, Placeholder.compareByIndex);\n\t\tthis._placeholderGroupsIdx = -1;\n\t}\n\n\tdispose(): void {\n\t\tif (this._placeholderDecorations) {\n\t\t\tthis._editor.deltaDecorations([...this._placeholderDecorations.values()], []);\n\t\t}\n\t\tthis._placeholderGroups.length = 0;\n\t}\n\n\tprivate _initDecorations(): void {\n\n\t\tif (this._placeholderDecorations) {\n\t\t\t// already initialized\n\t\t\treturn;\n\t\t}\n\n\t\tthis._placeholderDecorations = new Map<Placeholder, string>();\n\t\tconst model = this._editor.getModel();\n\n\t\tthis._editor.changeDecorations(accessor => {\n\t\t\t// create a decoration for each placeholder\n\t\t\tfor (const placeholder of this._snippet.placeholders) {\n\t\t\t\tconst placeholderOffset = this._snippet.offset(placeholder);\n\t\t\t\tconst placeholderLen = this._snippet.fullLen(placeholder);\n\t\t\t\tconst range = Range.fromPositions(\n\t\t\t\t\tmodel.getPositionAt(this._offset + placeholderOffset),\n\t\t\t\t\tmodel.getPositionAt(this._offset + placeholderOffset + placeholderLen)\n\t\t\t\t);\n\t\t\t\tconst options = placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive;\n\t\t\t\tconst handle = accessor.addDecoration(range, options);\n\t\t\t\tthis._placeholderDecorations!.set(placeholder, handle);\n\t\t\t}\n\t\t});\n\t}\n\n\tmove(fwd: boolean | undefined): Selection[] {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthis._initDecorations();\n\n\t\t// Transform placeholder text if necessary\n\t\tif (this._placeholderGroupsIdx >= 0) {\n\t\t\tlet operations: ISingleEditOperation[] = [];\n\n\t\t\tfor (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) {\n\t\t\t\t// Check if the placeholder has a transformation\n\t\t\t\tif (placeholder.transform) {\n\t\t\t\t\tconst id = this._placeholderDecorations!.get(placeholder)!;\n\t\t\t\t\tconst range = this._editor.getModel().getDecorationRange(id)!;\n\t\t\t\t\tconst currentValue = this._editor.getModel().getValueInRange(range);\n\t\t\t\t\tconst transformedValueLines = placeholder.transform.resolve(currentValue).split(/\\r\\n|\\r|\\n/);\n\t\t\t\t\t// fix indentation for transformed lines\n\t\t\t\t\tfor (let i = 1; i < transformedValueLines.length; i++) {\n\t\t\t\t\t\ttransformedValueLines[i] = this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace + transformedValueLines[i]);\n\t\t\t\t\t}\n\t\t\t\t\toperations.push(EditOperation.replace(range, transformedValueLines.join(this._editor.getModel().getEOL())));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (operations.length > 0) {\n\t\t\t\tthis._editor.executeEdits('snippet.placeholderTransform', operations);\n\t\t\t}\n\t\t}\n\n\t\tlet couldSkipThisPlaceholder = false;\n\t\tif (fwd === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) {\n\t\t\tthis._placeholderGroupsIdx += 1;\n\t\t\tcouldSkipThisPlaceholder = true;\n\n\t\t} else if (fwd === false && this._placeholderGroupsIdx > 0) {\n\t\t\tthis._placeholderGroupsIdx -= 1;\n\t\t\tcouldSkipThisPlaceholder = true;\n\n\t\t} else {\n\t\t\t// the selection of the current placeholder might\n\t\t\t// not acurate any more -> simply restore it\n\t\t}\n\n\t\tconst newSelections = this._editor.getModel().changeDecorations(accessor => {\n\n\t\t\tconst activePlaceholders = new Set<Placeholder>();\n\n\t\t\t// change stickiness to always grow when typing at its edges\n\t\t\t// because these decorations represent the currently active\n\t\t\t// tabstop.\n\t\t\t// Special case #1: reaching the final tabstop\n\t\t\t// Special case #2: placeholders enclosing active placeholders\n\t\t\tconst selections: Selection[] = [];\n\t\t\tfor (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) {\n\t\t\t\tconst id = this._placeholderDecorations!.get(placeholder)!;\n\t\t\t\tconst range = this._editor.getModel().getDecorationRange(id)!;\n\t\t\t\tselections.push(new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn));\n\n\t\t\t\t// consider to skip this placeholder index when the decoration\n\t\t\t\t// range is empty but when the placeholder wasn't. that's a strong\n\t\t\t\t// hint that the placeholder has been deleted. (all placeholder must match this)\n\t\t\t\tcouldSkipThisPlaceholder = couldSkipThisPlaceholder && this._hasPlaceholderBeenCollapsed(placeholder);\n\n\t\t\t\taccessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active);\n\t\t\t\tactivePlaceholders.add(placeholder);\n\n\t\t\t\tfor (const enclosingPlaceholder of this._snippet.enclosingPlaceholders(placeholder)) {\n\t\t\t\t\tconst id = this._placeholderDecorations!.get(enclosingPlaceholder)!;\n\t\t\t\t\taccessor.changeDecorationOptions(id, enclosingPlaceholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active);\n\t\t\t\t\tactivePlaceholders.add(enclosingPlaceholder);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// change stickness to never grow when typing at its edges\n\t\t\t// so that in-active tabstops never grow\n\t\t\tfor (const [placeholder, id] of this._placeholderDecorations!) {\n\t\t\t\tif (!activePlaceholders.has(placeholder)) {\n\t\t\t\t\taccessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn selections;\n\t\t});\n\n\t\treturn !couldSkipThisPlaceholder ? newSelections ?? [] : this.move(fwd);\n\t}\n\n\tprivate _hasPlaceholderBeenCollapsed(placeholder: Placeholder): boolean {\n\t\t// A placeholder is empty when it wasn't empty when authored but\n\t\t// when its tracking decoration is empty. This also applies to all\n\t\t// potential parent placeholders\n\t\tlet marker: Marker | undefined = placeholder;\n\t\twhile (marker) {\n\t\t\tif (marker instanceof Placeholder) {\n\t\t\t\tconst id = this._placeholderDecorations!.get(marker)!;\n\t\t\t\tconst range = this._editor.getModel().getDecorationRange(id)!;\n\t\t\t\tif (range.isEmpty() && marker.toString().length > 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmarker = marker.parent;\n\t\t}\n\t\treturn false;\n\t}\n\n\tget isAtFirstPlaceholder() {\n\t\treturn this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0;\n\t}\n\n\tget isAtLastPlaceholder() {\n\t\treturn this._placeholderGroupsIdx === this._placeholderGroups.length - 1;\n\t}\n\n\tget hasPlaceholder() {\n\t\treturn this._snippet.placeholders.length > 0;\n\t}\n\n\tcomputePossibleSelections() {\n\t\tconst result = new Map<number, Range[]>();\n\t\tfor (const placeholdersWithEqualIndex of this._placeholderGroups) {\n\t\t\tlet ranges: Range[] | undefined;\n\n\t\t\tfor (const placeholder of placeholdersWithEqualIndex) {\n\t\t\t\tif (placeholder.isFinalTabstop) {\n\t\t\t\t\t// ignore those\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!ranges) {\n\t\t\t\t\tranges = [];\n\t\t\t\t\tresult.set(placeholder.index, ranges);\n\t\t\t\t}\n\n\t\t\t\tconst id = this._placeholderDecorations!.get(placeholder)!;\n\t\t\t\tconst range = this._editor.getModel().getDecorationRange(id);\n\t\t\t\tif (!range) {\n\t\t\t\t\t// one of the placeholder lost its decoration and\n\t\t\t\t\t// therefore we bail out and pretend the placeholder\n\t\t\t\t\t// (with its mirrors) doesn't exist anymore.\n\t\t\t\t\tresult.delete(placeholder.index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tranges.push(range);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tget choice(): Choice | undefined {\n\t\treturn this._placeholderGroups[this._placeholderGroupsIdx][0].choice;\n\t}\n\n\tmerge(others: OneSnippet[]): void {\n\n\t\tconst model = this._editor.getModel();\n\t\tthis._nestingLevel *= 10;\n\n\t\tthis._editor.changeDecorations(accessor => {\n\n\t\t\t// For each active placeholder take one snippet and merge it\n\t\t\t// in that the placeholder (can be many for `$1foo$1foo`). Because\n\t\t\t// everything is sorted by editor selection we can simply remove\n\t\t\t// elements from the beginning of the array\n\t\t\tfor (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) {\n\t\t\t\tconst nested = others.shift()!;\n\t\t\t\tconsole.assert(!nested._placeholderDecorations);\n\n\t\t\t\t// Massage placeholder-indicies of the nested snippet to be\n\t\t\t\t// sorted right after the insertion point. This ensures we move\n\t\t\t\t// through the placeholders in the correct order\n\t\t\t\tconst indexLastPlaceholder = nested._snippet.placeholderInfo.last!.index;\n\n\t\t\t\tfor (const nestedPlaceholder of nested._snippet.placeholderInfo.all) {\n\t\t\t\t\tif (nestedPlaceholder.isFinalTabstop) {\n\t\t\t\t\t\tnestedPlaceholder.index = placeholder.index + ((indexLastPlaceholder + 1) / this._nestingLevel);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnestedPlaceholder.index = placeholder.index + (nestedPlaceholder.index / this._nestingLevel);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._snippet.replace(placeholder, nested._snippet.children);\n\n\t\t\t\t// Remove the placeholder at which position are inserting\n\t\t\t\t// the snippet and also remove its decoration.\n\t\t\t\tconst id = this._placeholderDecorations!.get(placeholder)!;\n\t\t\t\taccessor.removeDecoration(id);\n\t\t\t\tthis._placeholderDecorations!.delete(placeholder);\n\n\t\t\t\t// For each *new* placeholder we create decoration to monitor\n\t\t\t\t// how and if it grows/shrinks.\n\t\t\t\tfor (const placeholder of nested._snippet.placeholders) {\n\t\t\t\t\tconst placeholderOffset = nested._snippet.offset(placeholder);\n\t\t\t\t\tconst placeholderLen = nested._snippet.fullLen(placeholder);\n\t\t\t\t\tconst range = Range.fromPositions(\n\t\t\t\t\t\tmodel.getPositionAt(nested._offset + placeholderOffset),\n\t\t\t\t\t\tmodel.getPositionAt(nested._offset + placeholderOffset + placeholderLen)\n\t\t\t\t\t);\n\t\t\t\t\tconst handle = accessor.addDecoration(range, OneSnippet._decor.inactive);\n\t\t\t\t\tthis._placeholderDecorations!.set(placeholder, handle);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Last, re-create the placeholder groups by sorting placeholders by their index.\n\t\t\tthis._placeholderGroups = groupBy(this._snippet.placeholders, Placeholder.compareByIndex);\n\t\t});\n\t}\n}\n\nexport interface ISnippetSessionInsertOptions {\n\toverwriteBefore: number;\n\toverwriteAfter: number;\n\tadjustWhitespace: boolean;\n\tclipboardText: string | undefined;\n\tovertypingCapturer: OvertypingCapturer | undefined;\n}\n\nconst _defaultOptions: ISnippetSessionInsertOptions = {\n\toverwriteBefore: 0,\n\toverwriteAfter: 0,\n\tadjustWhitespace: true,\n\tclipboardText: undefined,\n\tovertypingCapturer: undefined\n};\n\nexport class SnippetSession {\n\n\tstatic adjustWhitespace(model: ITextModel, position: IPosition, snippet: TextmateSnippet, adjustIndentation: boolean, adjustNewlines: boolean): string {\n\t\tconst line = model.getLineContent(position.lineNumber);\n\t\tconst lineLeadingWhitespace = getLeadingWhitespace(line, 0, position.column - 1);\n\n\t\t// the snippet as inserted\n\t\tlet snippetTextString: string | undefined;\n\n\t\tsnippet.walk(marker => {\n\t\t\t// all text elements that are not inside choice\n\t\t\tif (!(marker instanceof Text) || marker.parent instanceof Choice) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst lines = marker.value.split(/\\r\\n|\\r|\\n/);\n\n\t\t\tif (adjustIndentation) {\n\t\t\t\t// adjust indentation of snippet test\n\t\t\t\t// -the snippet-start doesn't get extra-indented (lineLeadingWhitespace), only normalized\n\t\t\t\t// -all N+1 lines get extra-indented and normalized\n\t\t\t\t// -the text start get extra-indented and normalized when following a linebreak\n\t\t\t\tconst offset = snippet.offset(marker);\n\t\t\t\tif (offset === 0) {\n\t\t\t\t\t// snippet start\n\t\t\t\t\tlines[0] = model.normalizeIndentation(lines[0]);\n\n\t\t\t\t} else {\n\t\t\t\t\t// check if text start is after a linebreak\n\t\t\t\t\tsnippetTextString = snippetTextString ?? snippet.toString();\n\t\t\t\t\tlet prevChar = snippetTextString.charCodeAt(offset - 1);\n\t\t\t\t\tif (prevChar === CharCode.LineFeed || prevChar === CharCode.CarriageReturn) {\n\t\t\t\t\t\tlines[0] = model.normalizeIndentation(lineLeadingWhitespace + lines[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (let i = 1; i < lines.length; i++) {\n\t\t\t\t\tlines[i] = model.normalizeIndentation(lineLeadingWhitespace + lines[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst newValue = lines.join(model.getEOL());\n\t\t\tif (newValue !== marker.value) {\n\t\t\t\tmarker.parent.replace(marker, [new Text(newValue)]);\n\t\t\t\tsnippetTextString = undefined;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\n\t\treturn lineLeadingWhitespace;\n\t}\n\n\tstatic adjustSelection(model: ITextModel, selection: Selection, overwriteBefore: number, overwriteAfter: number): Selection {\n\t\tif (overwriteBefore !== 0 || overwriteAfter !== 0) {\n\t\t\t// overwrite[Before|After] is compute using the position, not the whole\n\t\t\t// selection. therefore we adjust the selection around that position\n\t\t\tconst { positionLineNumber, positionColumn } = selection;\n\t\t\tconst positionColumnBefore = positionColumn - overwriteBefore;\n\t\t\tconst positionColumnAfter = positionColumn + overwriteAfter;\n\n\t\t\tconst range = model.validateRange({\n\t\t\t\tstartLineNumber: positionLineNumber,\n\t\t\t\tstartColumn: positionColumnBefore,\n\t\t\t\tendLineNumber: positionLineNumber,\n\t\t\t\tendColumn: positionColumnAfter\n\t\t\t});\n\n\t\t\tselection = Selection.createWithDirection(\n\t\t\t\trange.startLineNumber, range.startColumn,\n\t\t\t\trange.endLineNumber, range.endColumn,\n\t\t\t\tselection.getDirection()\n\t\t\t);\n\t\t}\n\t\treturn selection;\n\t}\n\n\tstatic createEditsAndSnippets(editor: IActiveCodeEditor, template: string, overwriteBefore: number, overwriteAfter: number, enforceFinalTabstop: boolean, adjustWhitespace: boolean, clipboardText: string | undefined, overtypingCapturer: OvertypingCapturer | undefined): { edits: IIdentifiedSingleEditOperation[]; snippets: OneSnippet[] } {\n\t\tconst edits: IIdentifiedSingleEditOperation[] = [];\n\t\tconst snippets: OneSnippet[] = [];\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn { edits, snippets };\n\t\t}\n\t\tconst model = editor.getModel();\n\n\t\tconst workspaceService = editor.invokeWithinContext(accessor => accessor.get(IWorkspaceContextService));\n\t\tconst modelBasedVariableResolver = editor.invokeWithinContext(accessor => new ModelBasedVariableResolver(accessor.get(ILabelService), model));\n\t\tconst readClipboardText = () => clipboardText;\n\n\t\tlet delta = 0;\n\n\t\t// know what text the overwrite[Before|After] extensions\n\t\t// of the primary curser have selected because only when\n\t\t// secondary selections extend to the same text we can grow them\n\t\tlet firstBeforeText = model.getValueInRange(SnippetSession.adjustSelection(model, editor.getSelection(), overwriteBefore, 0));\n\t\tlet firstAfterText = model.getValueInRange(SnippetSession.adjustSelection(model, editor.getSelection(), 0, overwriteAfter));\n\n\t\t// remember the first non-whitespace column to decide if\n\t\t// `keepWhitespace` should be overruled for secondary selections\n\t\tlet firstLineFirstNonWhitespace = model.getLineFirstNonWhitespaceColumn(editor.getSelection().positionLineNumber);\n\n\t\t// sort selections by their start position but remeber\n\t\t// the original index. that allows you to create correct\n\t\t// offset-based selection logic without changing the\n\t\t// primary selection\n\t\tconst indexedSelections = editor.getSelections()\n\t\t\t.map((selection, idx) => ({ selection, idx }))\n\t\t\t.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection));\n\n\t\tfor (const { selection, idx } of indexedSelections) {\n\n\t\t\t// extend selection with the `overwriteBefore` and `overwriteAfter` and then\n\t\t\t// compare if this matches the extensions of the primary selection\n\t\t\tlet extensionBefore = SnippetSession.adjustSelection(model, selection, overwriteBefore, 0);\n\t\t\tlet extensionAfter = SnippetSession.adjustSelection(model, selection, 0, overwriteAfter);\n\t\t\tif (firstBeforeText !== model.getValueInRange(extensionBefore)) {\n\t\t\t\textensionBefore = selection;\n\t\t\t}\n\t\t\tif (firstAfterText !== model.getValueInRange(extensionAfter)) {\n\t\t\t\textensionAfter = selection;\n\t\t\t}\n\n\t\t\t// merge the before and after selection into one\n\t\t\tconst snippetSelection = selection\n\t\t\t\t.setStartPosition(extensionBefore.startLineNumber, extensionBefore.startColumn)\n\t\t\t\t.setEndPosition(extensionAfter.endLineNumber, extensionAfter.endColumn);\n\n\t\t\tconst snippet = new SnippetParser().parse(template, true, enforceFinalTabstop);\n\n\t\t\t// adjust the template string to match the indentation and\n\t\t\t// whitespace rules of this insert location (can be different for each cursor)\n\t\t\t// happens when being asked for (default) or when this is a secondary\n\t\t\t// cursor and the leading whitespace is different\n\t\t\tconst start = snippetSelection.getStartPosition();\n\t\t\tconst snippetLineLeadingWhitespace = SnippetSession.adjustWhitespace(\n\t\t\t\tmodel, start, snippet,\n\t\t\t\tadjustWhitespace || (idx > 0 && firstLineFirstNonWhitespace !== model.getLineFirstNonWhitespaceColumn(selection.positionLineNumber)),\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\tsnippet.resolveVariables(new CompositeSnippetVariableResolver([\n\t\t\t\tmodelBasedVariableResolver,\n\t\t\t\tnew ClipboardBasedVariableResolver(readClipboardText, idx, indexedSelections.length, editor.getOption(EditorOption.multiCursorPaste) === 'spread'),\n\t\t\t\tnew SelectionBasedVariableResolver(model, selection, idx, overtypingCapturer),\n\t\t\t\tnew CommentBasedVariableResolver(model, selection),\n\t\t\t\tnew TimeBasedVariableResolver,\n\t\t\t\tnew WorkspaceBasedVariableResolver(workspaceService),\n\t\t\t\tnew RandomBasedVariableResolver,\n\t\t\t]));\n\n\t\t\tconst offset = model.getOffsetAt(start) + delta;\n\t\t\tdelta += snippet.toString().length - model.getValueLengthInRange(snippetSelection);\n\n\t\t\t// store snippets with the index of their originating selection.\n\t\t\t// that ensures the primiary cursor stays primary despite not being\n\t\t\t// the one with lowest start position\n\t\t\tedits[idx] = EditOperation.replace(snippetSelection, snippet.toString());\n\t\t\tedits[idx].identifier = { major: idx, minor: 0 }; // mark the edit so only our undo edits will be used to generate end cursors\n\t\t\tsnippets[idx] = new OneSnippet(editor, snippet, offset, snippetLineLeadingWhitespace);\n\t\t}\n\n\t\treturn { edits, snippets };\n\t}\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _template: string;\n\tprivate readonly _templateMerges: [number, number, string][] = [];\n\tprivate readonly _options: ISnippetSessionInsertOptions;\n\tprivate _snippets: OneSnippet[] = [];\n\n\tconstructor(editor: IActiveCodeEditor, template: string, options: ISnippetSessionInsertOptions = _defaultOptions) {\n\t\tthis._editor = editor;\n\t\tthis._template = template;\n\t\tthis._options = options;\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._snippets);\n\t}\n\n\t_logInfo(): string {\n\t\treturn `template=\"${this._template}\", merged_templates=\"${this._templateMerges.join(' -> ')}\"`;\n\t}\n\n\tinsert(): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// make insert edit and start with first selections\n\t\tconst { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer);\n\t\tthis._snippets = snippets;\n\n\t\tthis._editor.executeEdits('snippet', edits, undoEdits => {\n\t\t\tif (this._snippets[0].hasPlaceholder) {\n\t\t\t\treturn this._move(true);\n\t\t\t} else {\n\t\t\t\treturn undoEdits\n\t\t\t\t\t.filter(edit => !!edit.identifier) // only use our undo edits\n\t\t\t\t\t.map(edit => Selection.fromPositions(edit.range.getEndPosition()));\n\t\t\t}\n\t\t});\n\t\tthis._editor.revealRange(this._editor.getSelections()[0]);\n\t}\n\n\tmerge(template: string, options: ISnippetSessionInsertOptions = _defaultOptions): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, template]);\n\t\tconst { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, template, options.overwriteBefore, options.overwriteAfter, true, options.adjustWhitespace, options.clipboardText, options.overtypingCapturer);\n\n\t\tthis._editor.executeEdits('snippet', edits, undoEdits => {\n\t\t\tfor (const snippet of this._snippets) {\n\t\t\t\tsnippet.merge(snippets);\n\t\t\t}\n\t\t\tconsole.assert(snippets.length === 0);\n\n\t\t\tif (this._snippets[0].hasPlaceholder) {\n\t\t\t\treturn this._move(undefined);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\tundoEdits\n\t\t\t\t\t\t.filter(edit => !!edit.identifier) // only use our undo edits\n\t\t\t\t\t\t.map(edit => Selection.fromPositions(edit.range.getEndPosition()))\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\n\tnext(): void {\n\t\tconst newSelections = this._move(true);\n\t\tthis._editor.setSelections(newSelections);\n\t\tthis._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition());\n\t}\n\n\tprev(): void {\n\t\tconst newSelections = this._move(false);\n\t\tthis._editor.setSelections(newSelections);\n\t\tthis._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition());\n\t}\n\n\tprivate _move(fwd: boolean | undefined): Selection[] {\n\t\tconst selections: Selection[] = [];\n\t\tfor (const snippet of this._snippets) {\n\t\t\tconst oneSelection = snippet.move(fwd);\n\t\t\tselections.push(...oneSelection);\n\t\t}\n\t\treturn selections;\n\t}\n\n\tget isAtFirstPlaceholder() {\n\t\treturn this._snippets[0].isAtFirstPlaceholder;\n\t}\n\n\tget isAtLastPlaceholder() {\n\t\treturn this._snippets[0].isAtLastPlaceholder;\n\t}\n\n\tget hasPlaceholder() {\n\t\treturn this._snippets[0].hasPlaceholder;\n\t}\n\n\tget choice(): Choice | undefined {\n\t\treturn this._snippets[0].choice;\n\t}\n\n\tisSelectionWithinPlaceholders(): boolean {\n\n\t\tif (!this.hasPlaceholder) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst selections = this._editor.getSelections();\n\t\tif (selections.length < this._snippets.length) {\n\t\t\t// this means we started snippet mode with N\n\t\t\t// selections and have M (N > M) selections.\n\t\t\t// So one snippet is without selection -> cancel\n\t\t\treturn false;\n\t\t}\n\n\t\tlet allPossibleSelections = new Map<number, Range[]>();\n\t\tfor (const snippet of this._snippets) {\n\n\t\t\tconst possibleSelections = snippet.computePossibleSelections();\n\n\t\t\t// for the first snippet find the placeholder (and its ranges)\n\t\t\t// that contain at least one selection. for all remaining snippets\n\t\t\t// the same placeholder (and their ranges) must be used.\n\t\t\tif (allPossibleSelections.size === 0) {\n\t\t\t\tfor (const [index, ranges] of possibleSelections) {\n\t\t\t\t\tranges.sort(Range.compareRangesUsingStarts);\n\t\t\t\t\tfor (const selection of selections) {\n\t\t\t\t\t\tif (ranges[0].containsRange(selection)) {\n\t\t\t\t\t\t\tallPossibleSelections.set(index, []);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (allPossibleSelections.size === 0) {\n\t\t\t\t// return false if we couldn't associate a selection to\n\t\t\t\t// this (the first) snippet\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// add selections from 'this' snippet so that we know all\n\t\t\t// selections for this placeholder\n\t\t\tallPossibleSelections.forEach((array, index) => {\n\t\t\t\tarray.push(...possibleSelections.get(index)!);\n\t\t\t});\n\t\t}\n\n\t\t// sort selections (and later placeholder-ranges). then walk both\n\t\t// arrays and make sure the placeholder-ranges contain the corresponding\n\t\t// selection\n\t\tselections.sort(Range.compareRangesUsingStarts);\n\n\t\tfor (let [index, ranges] of allPossibleSelections) {\n\t\t\tif (ranges.length !== selections.length) {\n\t\t\t\tallPossibleSelections.delete(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tranges.sort(Range.compareRangesUsingStarts);\n\n\t\t\tfor (let i = 0; i < ranges.length; i++) {\n\t\t\t\tif (!ranges[i].containsRange(selections[i])) {\n\t\t\t\t\tallPossibleSelections.delete(index);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// from all possible selections we have deleted those\n\t\t// that don't match with the current selection. if we don't\n\t\t// have any left, we don't have a selection anymore\n\t\treturn allPossibleSelections.size > 0;\n\t}\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorCommand, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CompletionItem, CompletionItemKind } from 'vs/editor/common/languages';\nimport { Choice } from 'vs/editor/contrib/snippet/browser/snippetParser';\nimport { showSimpleSuggestions } from 'vs/editor/contrib/suggest/browser/suggest';\nimport { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer';\nimport { localize } from 'vs/nls';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { SnippetSession } from './snippetSession';\n\nexport interface ISnippetInsertOptions {\n\toverwriteBefore: number;\n\toverwriteAfter: number;\n\tadjustWhitespace: boolean;\n\tundoStopBefore: boolean;\n\tundoStopAfter: boolean;\n\tclipboardText: string | undefined;\n\tovertypingCapturer: OvertypingCapturer | undefined;\n}\n\nconst _defaultOptions: ISnippetInsertOptions = {\n\toverwriteBefore: 0,\n\toverwriteAfter: 0,\n\tundoStopBefore: true,\n\tundoStopAfter: true,\n\tadjustWhitespace: true,\n\tclipboardText: undefined,\n\tovertypingCapturer: undefined\n};\n\nexport class SnippetController2 implements IEditorContribution {\n\n\tpublic static readonly ID = 'snippetController2';\n\n\tstatic get(editor: ICodeEditor): SnippetController2 | null {\n\t\treturn editor.getContribution<SnippetController2>(SnippetController2.ID);\n\t}\n\n\tstatic readonly InSnippetMode = new RawContextKey('inSnippetMode', false, localize('inSnippetMode', \"Whether the editor in current in snippet mode\"));\n\tstatic readonly HasNextTabstop = new RawContextKey('hasNextTabstop', false, localize('hasNextTabstop', \"Whether there is a next tab stop when in snippet mode\"));\n\tstatic readonly HasPrevTabstop = new RawContextKey('hasPrevTabstop', false, localize('hasPrevTabstop', \"Whether there is a previous tab stop when in snippet mode\"));\n\n\tprivate readonly _inSnippet: IContextKey<boolean>;\n\tprivate readonly _hasNextTabstop: IContextKey<boolean>;\n\tprivate readonly _hasPrevTabstop: IContextKey<boolean>;\n\n\tprivate _session?: SnippetSession;\n\tprivate _snippetListener = new DisposableStore();\n\tprivate _modelVersionId: number = -1;\n\tprivate _currentChoice?: Choice;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tthis._inSnippet = SnippetController2.InSnippetMode.bindTo(contextKeyService);\n\t\tthis._hasNextTabstop = SnippetController2.HasNextTabstop.bindTo(contextKeyService);\n\t\tthis._hasPrevTabstop = SnippetController2.HasPrevTabstop.bindTo(contextKeyService);\n\t}\n\n\tdispose(): void {\n\t\tthis._inSnippet.reset();\n\t\tthis._hasPrevTabstop.reset();\n\t\tthis._hasNextTabstop.reset();\n\t\tthis._session?.dispose();\n\t\tthis._snippetListener.dispose();\n\t}\n\n\tinsert(\n\t\ttemplate: string,\n\t\topts?: Partial<ISnippetInsertOptions>\n\t): void {\n\t\t// this is here to find out more about the yet-not-understood\n\t\t// error that sometimes happens when we fail to inserted a nested\n\t\t// snippet\n\t\ttry {\n\t\t\tthis._doInsert(template, typeof opts === 'undefined' ? _defaultOptions : { ..._defaultOptions, ...opts });\n\n\t\t} catch (e) {\n\t\t\tthis.cancel();\n\t\t\tthis._logService.error(e);\n\t\t\tthis._logService.error('snippet_error');\n\t\t\tthis._logService.error('insert_template=', template);\n\t\t\tthis._logService.error('existing_template=', this._session ? this._session._logInfo() : '<no_session>');\n\t\t}\n\t}\n\n\tprivate _doInsert(\n\t\ttemplate: string,\n\t\topts: ISnippetInsertOptions\n\t): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// don't listen while inserting the snippet\n\t\t// as that is the inflight state causing cancelation\n\t\tthis._snippetListener.clear();\n\n\t\tif (opts.undoStopBefore) {\n\t\t\tthis._editor.getModel().pushStackElement();\n\t\t}\n\n\t\tif (!this._session) {\n\t\t\tthis._modelVersionId = this._editor.getModel().getAlternativeVersionId();\n\t\t\tthis._session = new SnippetSession(this._editor, template, opts);\n\t\t\tthis._session.insert();\n\t\t} else {\n\t\t\tthis._session.merge(template, opts);\n\t\t}\n\n\t\tif (opts.undoStopAfter) {\n\t\t\tthis._editor.getModel().pushStackElement();\n\t\t}\n\n\t\tthis._updateState();\n\n\t\tthis._snippetListener.add(this._editor.onDidChangeModelContent(e => e.isFlush && this.cancel()));\n\t\tthis._snippetListener.add(this._editor.onDidChangeModel(() => this.cancel()));\n\t\tthis._snippetListener.add(this._editor.onDidChangeCursorSelection(() => this._updateState()));\n\t}\n\n\tprivate _updateState(): void {\n\t\tif (!this._session || !this._editor.hasModel()) {\n\t\t\t// canceled in the meanwhile\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._modelVersionId === this._editor.getModel().getAlternativeVersionId()) {\n\t\t\t// undo until the 'before' state happened\n\t\t\t// and makes use cancel snippet mode\n\t\t\treturn this.cancel();\n\t\t}\n\n\t\tif (!this._session.hasPlaceholder) {\n\t\t\t// don't listen for selection changes and don't\n\t\t\t// update context keys when the snippet is plain text\n\t\t\treturn this.cancel();\n\t\t}\n\n\t\tif (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders()) {\n\t\t\tthis._editor.getModel().pushStackElement();\n\t\t\treturn this.cancel();\n\t\t}\n\n\t\tthis._inSnippet.set(true);\n\t\tthis._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder);\n\t\tthis._hasNextTabstop.set(!this._session.isAtLastPlaceholder);\n\n\t\tthis._handleChoice();\n\t}\n\n\tprivate _handleChoice(): void {\n\t\tif (!this._session || !this._editor.hasModel()) {\n\t\t\tthis._currentChoice = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tconst { choice } = this._session;\n\t\tif (!choice) {\n\t\t\tthis._currentChoice = undefined;\n\t\t\treturn;\n\t\t}\n\t\tif (this._currentChoice !== choice) {\n\t\t\tthis._currentChoice = choice;\n\n\t\t\tthis._editor.setSelections(this._editor.getSelections()\n\t\t\t\t.map(s => Selection.fromPositions(s.getStartPosition()))\n\t\t\t);\n\n\t\t\tconst [first] = choice.options;\n\n\t\t\tthis._instantiationService.invokeFunction(showSimpleSuggestions, this._editor, choice.options.map((option, i) => {\n\n\t\t\t\t// let before = choice.options.slice(0, i);\n\t\t\t\t// let after = choice.options.slice(i);\n\n\t\t\t\treturn <CompletionItem>{\n\t\t\t\t\tkind: CompletionItemKind.Value,\n\t\t\t\t\tlabel: option.value,\n\t\t\t\t\tinsertText: option.value,\n\t\t\t\t\t// insertText: `\\${1|${after.concat(before).join(',')}|}$0`,\n\t\t\t\t\t// snippetType: 'textmate',\n\t\t\t\t\tsortText: 'a'.repeat(i + 1),\n\t\t\t\t\trange: Range.fromPositions(this._editor.getPosition()!, this._editor.getPosition()!.delta(0, first.value.length))\n\t\t\t\t};\n\t\t\t}));\n\t\t}\n\t}\n\n\tfinish(): void {\n\t\twhile (this._inSnippet.get()) {\n\t\t\tthis.next();\n\t\t}\n\t}\n\n\tcancel(resetSelection: boolean = false): void {\n\t\tthis._inSnippet.reset();\n\t\tthis._hasPrevTabstop.reset();\n\t\tthis._hasNextTabstop.reset();\n\t\tthis._snippetListener.clear();\n\t\tthis._session?.dispose();\n\t\tthis._session = undefined;\n\t\tthis._modelVersionId = -1;\n\t\tif (resetSelection) {\n\t\t\t// reset selection to the primary cursor when being asked\n\t\t\t// for. this happens when explicitly cancelling snippet mode,\n\t\t\t// e.g. when pressing ESC\n\t\t\tthis._editor.setSelections([this._editor.getSelection()!]);\n\t\t}\n\t}\n\n\tprev(): void {\n\t\tif (this._session) {\n\t\t\tthis._session.prev();\n\t\t}\n\t\tthis._updateState();\n\t}\n\n\tnext(): void {\n\t\tif (this._session) {\n\t\t\tthis._session.next();\n\t\t}\n\t\tthis._updateState();\n\t}\n\n\tisInSnippet(): boolean {\n\t\treturn Boolean(this._inSnippet.get());\n\t}\n}\n\n\nregisterEditorContribution(SnippetController2.ID, SnippetController2);\n\nconst CommandCtor = EditorCommand.bindToContribution<SnippetController2>(SnippetController2.get);\n\nregisterEditorCommand(new CommandCtor({\n\tid: 'jumpToNextSnippetPlaceholder',\n\tprecondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasNextTabstop),\n\thandler: ctrl => ctrl.next(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 30,\n\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\tprimary: KeyCode.Tab\n\t}\n}));\nregisterEditorCommand(new CommandCtor({\n\tid: 'jumpToPrevSnippetPlaceholder',\n\tprecondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasPrevTabstop),\n\thandler: ctrl => ctrl.prev(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 30,\n\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\tprimary: KeyMod.Shift | KeyCode.Tab\n\t}\n}));\nregisterEditorCommand(new CommandCtor({\n\tid: 'leaveSnippet',\n\tprecondition: SnippetController2.InSnippetMode,\n\thandler: ctrl => ctrl.cancel(true),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib + 30,\n\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\n\nregisterEditorCommand(new CommandCtor({\n\tid: 'acceptSnippet',\n\tprecondition: SnippetController2.InSnippetMode,\n\thandler: ctrl => ctrl.finish(),\n\t// kbOpts: {\n\t// \tweight: KeybindingWeight.EditorContrib + 30,\n\t// \tkbExpr: EditorContextKeys.textFocus,\n\t// \tprimary: KeyCode.Enter,\n\t// }\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 { TimeoutTimer } from 'vs/base/common/async';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind, StandardTokenType } from 'vs/editor/common/languages';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2';\nimport { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { CompletionModel } from './completionModel';\nimport { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, getSuggestionComparator, provideSuggestionItems, SnippetSortOrder } from './suggest';\nimport { IWordAtPosition } from 'vs/editor/common/core/wordHelper';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly position: IPosition;\n}\n\nexport interface ISuggestEvent {\n\treadonly completionModel: CompletionModel;\n\treadonly isFrozen: boolean;\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n}\n\nexport interface SuggestTriggerContext {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly triggerKind?: CompletionTriggerKind;\n\treadonly triggerCharacter?: string;\n}\n\nexport class LineContext {\n\n\tstatic shouldAutoTrigger(editor: ICodeEditor): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\t\tmodel.tokenizeIfCheap(pos.lineNumber);\n\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (!word) {\n\t\t\treturn false;\n\t\t}\n\t\tif (word.endColumn !== pos.column) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isNaN(Number(word.word))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\treadonly lineNumber: number;\n\treadonly column: number;\n\treadonly leadingLineContent: string;\n\treadonly leadingWord: IWordAtPosition;\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\n\tconstructor(model: ITextModel, position: Position, auto: boolean, shy: boolean) {\n\t\tthis.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\tthis.leadingWord = model.getWordUntilPosition(position);\n\t\tthis.lineNumber = position.lineNumber;\n\t\tthis.column = position.column;\n\t\tthis.auto = auto;\n\t\tthis.shy = shy;\n\t}\n}\n\nexport const enum State {\n\tIdle = 0,\n\tManual = 1,\n\tAuto = 2\n}\n\nfunction isSuggestPreviewEnabled(editor: ICodeEditor): boolean {\n\treturn editor.getOption(EditorOption.suggest).preview;\n}\n\nfunction canShowQuickSuggest(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\n\tconst allowQuickSuggestions = configurationService.getValue('editor.inlineSuggest.allowQuickSuggestions');\n\tif (allowQuickSuggestions !== undefined) {\n\t\t// Use setting if available.\n\t\treturn Boolean(allowQuickSuggestions);\n\t}\n\n\t// Don't allow if inline suggestions are visible and no suggest preview is configured.\n\t// TODO disabled for copilot\n\treturn false && isSuggestPreviewEnabled(editor);\n}\n\nfunction canShowSuggestOnTriggerCharacters(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\n\tconst allowQuickSuggestions = configurationService.getValue('editor.inlineSuggest.allowSuggestOnTriggerCharacters');\n\tif (allowQuickSuggestions !== undefined) {\n\t\t// Use setting if available.\n\t\treturn Boolean(allowQuickSuggestions);\n\t}\n\n\t// Don't allow if inline suggestions are visible and no suggest preview is configured.\n\t// TODO disabled for copilot\n\treturn false && isSuggestPreviewEnabled(editor);\n}\n\nexport class SuggestModel implements IDisposable {\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate _quickSuggestDelay: number = 10;\n\tprivate readonly _triggerCharacterListener = new DisposableStore();\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate _state: State = State.Idle;\n\n\tprivate _requestToken?: CancellationTokenSource;\n\tprivate _context?: LineContext;\n\tprivate _currentSelection: Selection;\n\n\tprivate _completionModel: CompletionModel | undefined;\n\tprivate readonly _completionDisposables = new DisposableStore();\n\tprivate readonly _onDidCancel = new Emitter<ICancelEvent>();\n\tprivate readonly _onDidTrigger = new Emitter<ITriggerEvent>();\n\tprivate readonly _onDidSuggest = new Emitter<ISuggestEvent>();\n\n\treadonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;\n\treadonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;\n\treadonly onDidSuggest: Event<ISuggestEvent> = this._onDidSuggest.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tthis._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1);\n\n\t\t// wire up various listeners\n\t\tthis._toDispose.add(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateQuickSuggest();\n\t\t}));\n\t\tthis._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.add(this._editor.onDidCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidCompositionEnd(() => {\n\t\t\teditorIsComposing = false;\n\t\t\tthis._onCompositionEnd();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorSelection(e => {\n\t\t\t// only trigger suggest when the editor isn't composing a character\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._onCursorChange(e);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't composing a character\n\t\t\t// allow-any-unicode-next-line\n\t\t\t// e.g. ¨ + u makes ü but just ¨ cannot be used for filtering\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._refilterCompletionItems();\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateTriggerCharacters();\n\t\tthis._updateQuickSuggest();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._triggerCharacterListener);\n\t\tdispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]);\n\t\tthis._toDispose.dispose();\n\t\tthis._completionDisposables.dispose();\n\t\tthis.cancel();\n\t}\n\n\t// --- handle configuration & precondition changes\n\n\tprivate _updateQuickSuggest(): void {\n\t\tthis._quickSuggestDelay = this._editor.getOption(EditorOption.quickSuggestionsDelay);\n\n\t\tif (isNaN(this._quickSuggestDelay) || (!this._quickSuggestDelay && this._quickSuggestDelay !== 0) || this._quickSuggestDelay < 0) {\n\t\t\tthis._quickSuggestDelay = 10;\n\t\t}\n\t}\n\n\tprivate _updateTriggerCharacters(): void {\n\t\tthis._triggerCharacterListener.clear();\n\n\t\tif (this._editor.getOption(EditorOption.readOnly)\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getOption(EditorOption.suggestOnTriggerCharacters)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst supportsByTriggerCharacter = new Map<string, Set<CompletionItemProvider>>();\n\t\tfor (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = supportsByTriggerCharacter.get(ch);\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tset.add(getSnippetSuggestSupport());\n\t\t\t\t\tsupportsByTriggerCharacter.set(ch, set);\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\n\t\tconst checkTriggerCharacter = (text?: string) => {\n\n\t\t\tif (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t// don't trigger by trigger characters when this is a case for quick suggest\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!text) {\n\t\t\t\t// came here from the compositionEnd-event\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst model = this._editor.getModel()!;\n\t\t\t\ttext = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\t\t}\n\n\t\t\tlet lastChar = '';\n\t\t\tif (isLowSurrogate(text.charCodeAt(text.length - 1))) {\n\t\t\t\tif (isHighSurrogate(text.charCodeAt(text.length - 2))) {\n\t\t\t\t\tlastChar = text.substr(text.length - 2);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlastChar = text.charAt(text.length - 1);\n\t\t\t}\n\n\t\t\tconst supports = supportsByTriggerCharacter.get(lastChar);\n\t\t\tif (supports) {\n\t\t\t\t// keep existing items that where not computed by the\n\t\t\t\t// supports/providers that want to trigger now\n\t\t\t\tconst existing = this._completionModel\n\t\t\t\t\t? { items: this._completionModel.adopt(supports), clipboardText: this._completionModel.clipboardText }\n\t\t\t\t\t: undefined;\n\t\t\t\tthis.trigger({ auto: true, shy: false, triggerCharacter: lastChar }, Boolean(this._completionModel), supports, existing);\n\t\t\t}\n\t\t};\n\n\t\tthis._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter));\n\t\tthis._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter()));\n\t}\n\n\t// --- trigger/retrigger/cancel suggest\n\n\tget state(): State {\n\t\treturn this._state;\n\t}\n\n\tcancel(retrigger: boolean = false): void {\n\t\tif (this._state !== State.Idle) {\n\t\t\tthis._triggerQuickSuggest.cancel();\n\t\t\tthis._requestToken?.cancel();\n\t\t\tthis._requestToken = undefined;\n\t\t\tthis._state = State.Idle;\n\t\t\tthis._completionModel = undefined;\n\t\t\tthis._context = undefined;\n\t\t\tthis._onDidCancel.fire({ retrigger });\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis._completionDisposables.clear();\n\t}\n\n\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._state !== State.Idle) {\n\t\t\tif (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: this._state === State.Auto, shy: false }, true);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorChange(e: ICursorSelectionChangedEvent): void {\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevSelection = this._currentSelection;\n\t\tthis._currentSelection = this._editor.getSelection();\n\n\t\tif (!e.selection.isEmpty()\n\t\t\t|| (e.reason !== CursorChangeReason.NotSet && e.reason !== CursorChangeReason.Explicit)\n\t\t\t|| (e.source !== 'keyboard' && e.source !== 'deleteLeft')\n\t\t) {\n\t\t\t// Early exit if nothing needs to be done!\n\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (this._state === State.Idle && e.reason === CursorChangeReason.NotSet) {\n\t\t\tif (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor did move RIGHT due to typing -> trigger quick suggest\n\t\t\t\tthis._doTriggerQuickSuggest();\n\t\t\t}\n\n\t\t} else if (this._state !== State.Idle && e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is active and something like cursor keys are used to move\n\t\t\t// the cursor. this means we can refilter at the new position\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _onCompositionEnd(): void {\n\t\t// trigger or refilter when composition ends\n\t\tif (this._state === State.Idle) {\n\t\t\tthis._doTriggerQuickSuggest();\n\t\t} else {\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _doTriggerQuickSuggest(): void {\n\n\t\tif (this._editor.getOption(EditorOption.quickSuggestions) === false) {\n\t\t\t// not enabled\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) {\n\t\t\t// no quick suggestion when in snippet mode\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cancel();\n\n\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\tif (this._state !== State.Idle) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst pos = this._editor.getPosition();\n\t\t\t// validate enabled now\n\t\t\tconst quickSuggestions = this._editor.getOption(EditorOption.quickSuggestions);\n\t\t\tif (quickSuggestions === false) {\n\t\t\t\treturn;\n\t\t\t} else if (quickSuggestions === true) {\n\t\t\t\t// all good\n\t\t\t} else {\n\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\tmodel.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\tconst lineTokens = model.getLineTokens(pos.lineNumber);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\tconst inValidScope = quickSuggestions.other && tokenType === StandardTokenType.Other\n\t\t\t\t\t|| quickSuggestions.comments && tokenType === StandardTokenType.Comment\n\t\t\t\t\t|| quickSuggestions.strings && tokenType === StandardTokenType.String;\n\n\t\t\t\tif (!inValidScope) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\t// do not trigger quick suggestions if inline suggestions are shown\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._languageFeaturesService.completionProvider.has(model)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// we made it till here -> trigger now\n\t\t\tthis.trigger({ auto: true, shy: false });\n\n\t\t}, this._quickSuggestDelay);\n\t}\n\n\tprivate _refilterCompletionItems(): void {\n\t\t// Re-filter suggestions. This MUST run async because filtering/scoring\n\t\t// uses the model content AND the cursor position. The latter is NOT\n\t\t// updated when the document has changed (the event which drives this method)\n\t\t// and therefore a little pause (next mirco task) is needed. See:\n\t\t// https://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context#25933985\n\t\tPromise.resolve().then(() => {\n\t\t\tif (this._state === State.Idle) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst position = this._editor.getPosition();\n\t\t\tconst ctx = new LineContext(model, position, this._state === State.Auto, false);\n\t\t\tthis._onNewContext(ctx);\n\t\t});\n\t}\n\n\ttrigger(context: SuggestTriggerContext, retrigger: boolean = false, onlyFrom?: Set<CompletionItemProvider>, existing?: { items: CompletionItem[]; clipboardText: string | undefined }): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst auto = context.auto;\n\t\tconst ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy);\n\n\t\t// Cancel previous requests, change state & update UI\n\t\tthis.cancel(retrigger);\n\t\tthis._state = auto ? State.Auto : State.Manual;\n\t\tthis._onDidTrigger.fire({ auto, shy: context.shy, position: this._editor.getPosition() });\n\n\t\t// Capture context when request was sent\n\t\tthis._context = ctx;\n\n\t\t// Build context for request\n\t\tlet suggestCtx: CompletionContext = { triggerKind: context.triggerKind ?? CompletionTriggerKind.Invoke };\n\t\tif (context.triggerCharacter) {\n\t\t\tsuggestCtx = {\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: context.triggerCharacter\n\t\t\t};\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst snippetSuggestions = this._editor.getOption(EditorOption.snippetSuggestions);\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (snippetSuggestions) {\n\t\t\tcase 'top':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Top;\n\t\t\t\tbreak;\n\t\t\t// \t↓ that's the default anyways...\n\t\t\t// case 'inline':\n\t\t\t// \tsnippetSortOrder = SnippetSortOrder.Inline;\n\t\t\t// \tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Bottom;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst { itemKind: itemKindFilter, showDeprecated } = SuggestModel._createSuggestFilter(this._editor);\n\t\tconst wordDistance = WordDistance.create(this._editorWorkerService, this._editor);\n\n\t\tconst completions = provideSuggestionItems(\n\t\t\tthis._languageFeaturesService.completionProvider,\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tnew CompletionOptions(snippetSortOrder, itemKindFilter, onlyFrom, showDeprecated),\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([completions, wordDistance]).then(async ([completions, wordDistance]) => {\n\n\t\t\tthis._requestToken?.dispose();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet clipboardText = existing?.clipboardText;\n\t\t\tif (!clipboardText && completions.needsClipboard) {\n\t\t\t\tclipboardText = await this._clipboardService.readText();\n\t\t\t}\n\n\t\t\tif (this._state === State.Idle) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\t\t\tlet items = completions.items;\n\n\t\t\tif (existing) {\n\t\t\t\tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t\titems = items.concat(existing.items).sort(cmpFn);\n\t\t\t}\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy);\n\t\t\tthis._completionModel = new CompletionModel(items, this._context!.column, {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context!.column\n\t\t\t},\n\t\t\t\twordDistance,\n\t\t\t\tthis._editor.getOption(EditorOption.suggest),\n\t\t\t\tthis._editor.getOption(EditorOption.snippetSuggestions),\n\t\t\t\tclipboardText\n\t\t\t);\n\n\t\t\t// store containers so that they can be disposed later\n\t\t\tthis._completionDisposables.add(completions.disposable);\n\n\t\t\tthis._onNewContext(ctx);\n\n\t\t\t// finally report telemetry about durations\n\t\t\tthis._reportDurationsTelemetry(completions.durations);\n\n\t\t}).catch(onUnexpectedError);\n\t}\n\n\tprivate _telemetryGate: number = 0;\n\n\tprivate _reportDurationsTelemetry(durations: CompletionDurations): void {\n\n\t\tif (this._telemetryGate++ % 230 !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\ttype Durations = { data: string };\n\t\t\ttype DurationsClassification = { data: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' } };\n\t\t\tthis._telemetryService.publicLog2<Durations, DurationsClassification>('suggest.durations.json', { data: JSON.stringify(durations) });\n\t\t\tthis._logService.debug('suggest.durations.json', durations);\n\t\t});\n\t}\n\n\tprivate static _createSuggestFilter(editor: ICodeEditor): { itemKind: Set<CompletionItemKind>; showDeprecated: boolean } {\n\t\t// kind filter and snippet sort rules\n\t\tconst result = new Set<CompletionItemKind>();\n\n\t\t// snippet setting\n\t\tconst snippetSuggestions = editor.getOption(EditorOption.snippetSuggestions);\n\t\tif (snippetSuggestions === 'none') {\n\t\t\tresult.add(CompletionItemKind.Snippet);\n\t\t}\n\n\t\t// type setting\n\t\tconst suggestOptions = editor.getOption(EditorOption.suggest);\n\t\tif (!suggestOptions.showMethods) { result.add(CompletionItemKind.Method); }\n\t\tif (!suggestOptions.showFunctions) { result.add(CompletionItemKind.Function); }\n\t\tif (!suggestOptions.showConstructors) { result.add(CompletionItemKind.Constructor); }\n\t\tif (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }\n\t\tif (!suggestOptions.showVariables) { result.add(CompletionItemKind.Variable); }\n\t\tif (!suggestOptions.showClasses) { result.add(CompletionItemKind.Class); }\n\t\tif (!suggestOptions.showStructs) { result.add(CompletionItemKind.Struct); }\n\t\tif (!suggestOptions.showInterfaces) { result.add(CompletionItemKind.Interface); }\n\t\tif (!suggestOptions.showModules) { result.add(CompletionItemKind.Module); }\n\t\tif (!suggestOptions.showProperties) { result.add(CompletionItemKind.Property); }\n\t\tif (!suggestOptions.showEvents) { result.add(CompletionItemKind.Event); }\n\t\tif (!suggestOptions.showOperators) { result.add(CompletionItemKind.Operator); }\n\t\tif (!suggestOptions.showUnits) { result.add(CompletionItemKind.Unit); }\n\t\tif (!suggestOptions.showValues) { result.add(CompletionItemKind.Value); }\n\t\tif (!suggestOptions.showConstants) { result.add(CompletionItemKind.Constant); }\n\t\tif (!suggestOptions.showEnums) { result.add(CompletionItemKind.Enum); }\n\t\tif (!suggestOptions.showEnumMembers) { result.add(CompletionItemKind.EnumMember); }\n\t\tif (!suggestOptions.showKeywords) { result.add(CompletionItemKind.Keyword); }\n\t\tif (!suggestOptions.showWords) { result.add(CompletionItemKind.Text); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Color); }\n\t\tif (!suggestOptions.showFiles) { result.add(CompletionItemKind.File); }\n\t\tif (!suggestOptions.showReferences) { result.add(CompletionItemKind.Reference); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Customcolor); }\n\t\tif (!suggestOptions.showFolders) { result.add(CompletionItemKind.Folder); }\n\t\tif (!suggestOptions.showTypeParameters) { result.add(CompletionItemKind.TypeParameter); }\n\t\tif (!suggestOptions.showSnippets) { result.add(CompletionItemKind.Snippet); }\n\t\tif (!suggestOptions.showUsers) { result.add(CompletionItemKind.User); }\n\t\tif (!suggestOptions.showIssues) { result.add(CompletionItemKind.Issue); }\n\n\t\treturn { itemKind: result, showDeprecated: suggestOptions.showDeprecated };\n\t}\n\n\tprivate _onNewContext(ctx: LineContext): void {\n\n\t\tif (!this._context) {\n\t\t\t// happens when 24x7 IntelliSense is enabled and still in its delay\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.lineNumber !== this._context.lineNumber) {\n\t\t\t// e.g. happens when pressing Enter while IntelliSense is computed\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) {\n\t\t\t// cancel IntelliSense when line start changes\n\t\t\t// happens when the current word gets outdented\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column < this._context.column) {\n\t\t\t// typed -> moved cursor LEFT -> retrigger if still on a word\n\t\t\tif (ctx.leadingWord.word) {\n\t\t\t\tthis.trigger({ auto: this._context.auto, shy: false }, true);\n\t\t\t} else {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\t// happens when IntelliSense is not yet computed\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {\n\t\t\t// started a new word while IntelliSense shows -> retrigger\n\n\t\t\t// Select those providers have not contributed to this completion model and re-trigger completions for\n\t\t\t// them. Also adopt the existing items and merge them into the new completion model\n\t\t\tconst inactiveProvider = new Set(this._languageFeaturesService.completionProvider.all(this._editor.getModel()!));\n\t\t\tfor (let provider of this._completionModel.allProvider) {\n\t\t\t\tinactiveProvider.delete(provider);\n\t\t\t}\n\t\t\tconst items = this._completionModel.adopt(new Set());\n\t\t\tthis.trigger({ auto: this._context.auto, shy: false }, true, inactiveProvider, { items, clipboardText: this._completionModel.clipboardText });\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column > this._context.column && this._completionModel.incomplete.size > 0 && ctx.leadingWord.word.length !== 0) {\n\t\t\t// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger\n\t\t\tconst { incomplete } = this._completionModel;\n\t\t\tconst items = this._completionModel.adopt(incomplete);\n\t\t\tthis.trigger({ auto: this._state === State.Auto, shy: false, triggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions }, true, incomplete, { items, clipboardText: this._completionModel.clipboardText });\n\n\t\t} else {\n\t\t\t// typed -> moved cursor RIGHT -> update UI\n\t\t\tlet oldLineContext = this._completionModel.lineContext;\n\t\t\tlet isFrozen = false;\n\n\t\t\tthis._completionModel.lineContext = {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context.column\n\t\t\t};\n\n\t\t\tif (this._completionModel.items.length === 0) {\n\n\t\t\t\tif (LineContext.shouldAutoTrigger(this._editor) && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) {\n\t\t\t\t\t// retrigger when heading into a new word\n\t\t\t\t\tthis.trigger({ auto: this._context.auto, shy: false }, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this._context.auto) {\n\t\t\t\t\t// freeze when IntelliSense was manually requested\n\t\t\t\t\tthis._completionModel.lineContext = oldLineContext;\n\t\t\t\t\tisFrozen = this._completionModel.items.length > 0;\n\n\t\t\t\t\tif (isFrozen && ctx.leadingWord.word.length === 0) {\n\t\t\t\t\t\t// there were results before but now there aren't\n\t\t\t\t\t\t// and also we are not on a word anymore -> cancel\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// nothing left\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidSuggest.fire({\n\t\t\t\tcompletionModel: this._completionModel,\n\t\t\t\tauto: this._context.auto,\n\t\t\t\tshy: this._context.shy,\n\t\t\t\tisFrozen,\n\t\t\t});\n\t\t}\n\t}\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 { alert } from 'vs/base/browser/ui/aria/aria';\nimport { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { IdleValue } from 'vs/base/common/async';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Event } from 'vs/base/common/event';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { SimpleKeybinding } from 'vs/base/common/keybindings';\nimport { DisposableStore, dispose, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport { assertType, isObject } from 'vs/base/common/types';\nimport { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { EditOperation } from 'vs/editor/common/core/editOperation';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { CompletionItemInsertTextRule, CompletionItemProvider } from 'vs/editor/common/languages';\nimport { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2';\nimport { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser';\nimport { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory';\nimport { WordContextKey } from 'vs/editor/contrib/suggest/browser/wordContextKey';\nimport * as nls from 'vs/nls';\nimport { MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { CompletionItem, Context as SuggestContext, ISuggestItemPreselector, suggestWidgetStatusbarMenu } from './suggest';\nimport { SuggestAlternatives } from './suggestAlternatives';\nimport { CommitCharacterController } from './suggestCommitCharacters';\nimport { State, SuggestModel } from './suggestModel';\nimport { OvertypingCapturer } from './suggestOvertypingCapturer';\nimport { ISelectedSuggestion, SuggestWidget } from './suggestWidget';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { basename, extname } from 'vs/base/common/resources';\nimport { hash } from 'vs/base/common/hash';\n\n// sticky suggest widget which doesn't disappear on focus out and such\nlet _sticky = false;\n// _sticky = Boolean(\"true\"); // done \"weirdly\" so that a lint warning prevents you from pushing this\n\nclass LineSuffix {\n\n\tprivate readonly _marker: string[] | undefined;\n\n\tconstructor(private readonly _model: ITextModel, private readonly _position: IPosition) {\n\t\t// spy on what's happening right of the cursor. two cases:\n\t\t// 1. end of line -> check that it's still end of line\n\t\t// 2. mid of line -> add a marker and compute the delta\n\t\tconst maxColumn = _model.getLineMaxColumn(_position.lineNumber);\n\t\tif (maxColumn !== _position.column) {\n\t\t\tconst offset = _model.getOffsetAt(_position);\n\t\t\tconst end = _model.getPositionAt(offset + 1);\n\t\t\tthis._marker = _model.deltaDecorations([], [{\n\t\t\t\trange: Range.fromPositions(_position, end),\n\t\t\t\toptions: { description: 'suggest-line-suffix', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges }\n\t\t\t}]);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this._marker && !this._model.isDisposed()) {\n\t\t\tthis._model.deltaDecorations(this._marker, []);\n\t\t}\n\t}\n\n\tdelta(position: IPosition): number {\n\t\tif (this._model.isDisposed() || this._position.lineNumber !== position.lineNumber) {\n\t\t\t// bail out early if things seems fishy\n\t\t\treturn 0;\n\t\t}\n\t\t// read the marker (in case suggest was triggered at line end) or compare\n\t\t// the cursor to the line end.\n\t\tif (this._marker) {\n\t\t\tconst range = this._model.getDecorationRange(this._marker[0]);\n\t\t\tconst end = this._model.getOffsetAt(range!.getStartPosition());\n\t\t\treturn end - this._model.getOffsetAt(position);\n\t\t} else {\n\t\t\treturn this._model.getLineMaxColumn(position.lineNumber) - position.column;\n\t\t}\n\t}\n}\n\nconst enum InsertFlags {\n\tNoBeforeUndoStop = 1,\n\tNoAfterUndoStop = 2,\n\tKeepAlternativeSuggestions = 4,\n\tAlternativeOverwriteConfig = 8\n}\n\nexport class SuggestController implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.suggestController';\n\n\tpublic static get(editor: ICodeEditor): SuggestController | null {\n\t\treturn editor.getContribution<SuggestController>(SuggestController.ID);\n\t}\n\n\treadonly editor: ICodeEditor;\n\treadonly model: SuggestModel;\n\treadonly widget: IdleValue<SuggestWidget>;\n\n\tprivate readonly _alternatives: IdleValue<SuggestAlternatives>;\n\tprivate readonly _lineSuffix = new MutableDisposable<LineSuffix>();\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _overtypingCapturer: IdleValue<OvertypingCapturer>;\n\tprivate readonly _selectors = new PriorityRegistry<ISuggestItemPreselector>(s => s.priority);\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ISuggestMemoryService private readonly _memoryService: ISuggestMemoryService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t) {\n\t\tthis.editor = editor;\n\t\tthis.model = _instantiationService.createInstance(SuggestModel, this.editor,);\n\n\t\t// context key: update insert/replace mode\n\t\tconst ctxInsertMode = SuggestContext.InsertMode.bindTo(_contextKeyService);\n\t\tctxInsertMode.set(editor.getOption(EditorOption.suggest).insertMode);\n\t\tthis.model.onDidTrigger(() => ctxInsertMode.set(editor.getOption(EditorOption.suggest).insertMode));\n\n\t\tthis.widget = this._toDispose.add(new IdleValue(() => {\n\n\t\t\tconst widget = this._instantiationService.createInstance(SuggestWidget, this.editor);\n\n\t\t\tthis._toDispose.add(widget);\n\t\t\tthis._toDispose.add(widget.onDidSelect(item => this._insertSuggestion(item, 0), this));\n\n\t\t\t// Wire up logic to accept a suggestion on certain characters\n\t\t\tconst commitCharacterController = new CommitCharacterController(this.editor, widget, item => this._insertSuggestion(item, InsertFlags.NoAfterUndoStop));\n\t\t\tthis._toDispose.add(commitCharacterController);\n\t\t\tthis._toDispose.add(this.model.onDidSuggest(e => {\n\t\t\t\tif (e.completionModel.items.length === 0) {\n\t\t\t\t\tcommitCharacterController.reset();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\t// Wire up makes text edit context key\n\t\t\tconst ctxMakesTextEdit = SuggestContext.MakesTextEdit.bindTo(this._contextKeyService);\n\t\t\tconst ctxHasInsertAndReplace = SuggestContext.HasInsertAndReplaceRange.bindTo(this._contextKeyService);\n\t\t\tconst ctxCanResolve = SuggestContext.CanResolve.bindTo(this._contextKeyService);\n\n\t\t\tthis._toDispose.add(toDisposable(() => {\n\t\t\t\tctxMakesTextEdit.reset();\n\t\t\t\tctxHasInsertAndReplace.reset();\n\t\t\t\tctxCanResolve.reset();\n\t\t\t}));\n\n\t\t\tthis._toDispose.add(widget.onDidFocus(({ item }) => {\n\n\t\t\t\t// (ctx: makesTextEdit)\n\t\t\t\tconst position = this.editor.getPosition()!;\n\t\t\t\tconst startColumn = item.editStart.column;\n\t\t\t\tconst endColumn = position.column;\n\t\t\t\tlet value = true;\n\t\t\t\tif (\n\t\t\t\t\tthis.editor.getOption(EditorOption.acceptSuggestionOnEnter) === 'smart'\n\t\t\t\t\t&& this.model.state === State.Auto\n\t\t\t\t\t&& !item.completion.additionalTextEdits\n\t\t\t\t\t&& !(item.completion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet)\n\t\t\t\t\t&& endColumn - startColumn === item.completion.insertText.length\n\t\t\t\t) {\n\t\t\t\t\tconst oldText = this.editor.getModel()!.getValueInRange({\n\t\t\t\t\t\tstartLineNumber: position.lineNumber,\n\t\t\t\t\t\tstartColumn,\n\t\t\t\t\t\tendLineNumber: position.lineNumber,\n\t\t\t\t\t\tendColumn\n\t\t\t\t\t});\n\t\t\t\t\tvalue = oldText !== item.completion.insertText;\n\t\t\t\t}\n\t\t\t\tctxMakesTextEdit.set(value);\n\n\t\t\t\t// (ctx: hasInsertAndReplaceRange)\n\t\t\t\tctxHasInsertAndReplace.set(!Position.equals(item.editInsertEnd, item.editReplaceEnd));\n\n\t\t\t\t// (ctx: canResolve)\n\t\t\t\tctxCanResolve.set(Boolean(item.provider.resolveCompletionItem) || Boolean(item.completion.documentation) || item.completion.detail !== item.completion.label);\n\t\t\t}));\n\n\t\t\tthis._toDispose.add(widget.onDetailsKeyDown(e => {\n\t\t\t\t// cmd + c on macOS, ctrl + c on Win / Linux\n\t\t\t\tif (\n\t\t\t\t\te.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KeyC)) ||\n\t\t\t\t\t(platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KeyC)))\n\t\t\t\t) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!e.toKeybinding().isModifierKey()) {\n\t\t\t\t\tthis.editor.focus();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\treturn widget;\n\t\t}));\n\n\t\t// Wire up text overtyping capture\n\t\tthis._overtypingCapturer = this._toDispose.add(new IdleValue(() => {\n\t\t\treturn this._toDispose.add(new OvertypingCapturer(this.editor, this.model));\n\t\t}));\n\n\t\tthis._alternatives = this._toDispose.add(new IdleValue(() => {\n\t\t\treturn this._toDispose.add(new SuggestAlternatives(this.editor, this._contextKeyService));\n\t\t}));\n\n\t\tthis._toDispose.add(_instantiationService.createInstance(WordContextKey, editor));\n\n\t\tthis._toDispose.add(this.model.onDidTrigger(e => {\n\t\t\tthis.widget.value.showTriggered(e.auto, e.shy ? 250 : 50);\n\t\t\tthis._lineSuffix.value = new LineSuffix(this.editor.getModel()!, e.position);\n\t\t}));\n\t\tthis._toDispose.add(this.model.onDidSuggest(e => {\n\t\t\tif (!e.shy) {\n\t\t\t\tlet index = -1;\n\t\t\t\tfor (const selector of this._selectors.itemsOrderedByPriorityDesc) {\n\t\t\t\t\tindex = selector.select(this.editor.getModel()!, this.editor.getPosition()!, e.completionModel.items);\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tindex = this._memoryService.select(this.editor.getModel()!, this.editor.getPosition()!, e.completionModel.items);\n\t\t\t\t}\n\t\t\t\tthis.widget.value.showSuggestions(e.completionModel, index, e.isFrozen, e.auto);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this.model.onDidCancel(e => {\n\t\t\tif (!e.retrigger) {\n\t\t\t\tthis.widget.value.hideWidget();\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this.editor.onDidBlurEditorWidget(() => {\n\t\t\tif (!_sticky) {\n\t\t\t\tthis.model.cancel();\n\t\t\t\tthis.model.clear();\n\t\t\t}\n\t\t}));\n\n\t\t// Manage the acceptSuggestionsOnEnter context key\n\t\tlet acceptSuggestionsOnEnter = SuggestContext.AcceptSuggestionsOnEnter.bindTo(_contextKeyService);\n\t\tlet updateFromConfig = () => {\n\t\t\tconst acceptSuggestionOnEnter = this.editor.getOption(EditorOption.acceptSuggestionOnEnter);\n\t\t\tacceptSuggestionsOnEnter.set(acceptSuggestionOnEnter === 'on' || acceptSuggestionOnEnter === 'smart');\n\t\t};\n\t\tthis._toDispose.add(this.editor.onDidChangeConfiguration(() => updateFromConfig()));\n\t\tupdateFromConfig();\n\t}\n\n\tdispose(): void {\n\t\tthis._alternatives.dispose();\n\t\tthis._toDispose.dispose();\n\t\tthis.widget.dispose();\n\t\tthis.model.dispose();\n\t\tthis._lineSuffix.dispose();\n\t}\n\n\tprotected _insertSuggestion(\n\t\tevent: ISelectedSuggestion | undefined,\n\t\tflags: InsertFlags\n\t): void {\n\t\tif (!event || !event.item) {\n\t\t\tthis._alternatives.value.reset();\n\t\t\tthis.model.cancel();\n\t\t\tthis.model.clear();\n\t\t\treturn;\n\t\t}\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst snippetController = SnippetController2.get(this.editor);\n\t\tif (!snippetController) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\t\tconst modelVersionNow = model.getAlternativeVersionId();\n\t\tconst { item } = event;\n\n\t\t//\n\t\tconst tasks: Promise<any>[] = [];\n\t\tconst cts = new CancellationTokenSource();\n\n\t\t// pushing undo stops *before* additional text edits and\n\t\t// *after* the main edit\n\t\tif (!(flags & InsertFlags.NoBeforeUndoStop)) {\n\t\t\tthis.editor.pushUndoStop();\n\t\t}\n\n\t\t// compute overwrite[Before|After] deltas BEFORE applying extra edits\n\t\tconst info = this.getOverwriteInfo(item, Boolean(flags & InsertFlags.AlternativeOverwriteConfig));\n\n\t\t// keep item in memory\n\t\tthis._memoryService.memorize(model, this.editor.getPosition(), item);\n\n\n\t\tif (Array.isArray(item.completion.additionalTextEdits)) {\n\t\t\t// sync additional edits\n\t\t\tconst scrollState = StableEditorScrollState.capture(this.editor);\n\t\t\tthis.editor.executeEdits(\n\t\t\t\t'suggestController.additionalTextEdits.sync',\n\t\t\t\titem.completion.additionalTextEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text))\n\t\t\t);\n\t\t\tscrollState.restoreRelativeVerticalPositionOfCursor(this.editor);\n\n\t\t} else if (!item.isResolved) {\n\t\t\t// async additional edits\n\t\t\tconst sw = new StopWatch(true);\n\t\t\tlet position: IPosition | undefined;\n\n\t\t\tconst docListener = model.onDidChangeContent(e => {\n\t\t\t\tif (e.isFlush) {\n\t\t\t\t\tcts.cancel();\n\t\t\t\t\tdocListener.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor (let change of e.changes) {\n\t\t\t\t\tconst thisPosition = Range.getEndPosition(change.range);\n\t\t\t\t\tif (!position || Position.isBefore(thisPosition, position)) {\n\t\t\t\t\t\tposition = thisPosition;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet oldFlags = flags;\n\t\t\tflags |= InsertFlags.NoAfterUndoStop;\n\t\t\tlet didType = false;\n\t\t\tlet typeListener = this.editor.onWillType(() => {\n\t\t\t\ttypeListener.dispose();\n\t\t\t\tdidType = true;\n\t\t\t\tif (!(oldFlags & InsertFlags.NoAfterUndoStop)) {\n\t\t\t\t\tthis.editor.pushUndoStop();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttasks.push(item.resolve(cts.token).then(() => {\n\t\t\t\tif (!item.completion.additionalTextEdits || cts.token.isCancellationRequested) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (position && item.completion.additionalTextEdits.some(edit => Position.isBefore(position!, Range.getStartPosition(edit.range)))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (didType) {\n\t\t\t\t\tthis.editor.pushUndoStop();\n\t\t\t\t}\n\t\t\t\tconst scrollState = StableEditorScrollState.capture(this.editor);\n\t\t\t\tthis.editor.executeEdits(\n\t\t\t\t\t'suggestController.additionalTextEdits.async',\n\t\t\t\t\titem.completion.additionalTextEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text))\n\t\t\t\t);\n\t\t\t\tscrollState.restoreRelativeVerticalPositionOfCursor(this.editor);\n\t\t\t\tif (didType || !(oldFlags & InsertFlags.NoAfterUndoStop)) {\n\t\t\t\t\tthis.editor.pushUndoStop();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}).then(applied => {\n\t\t\t\tthis._logService.trace('[suggest] async resolving of edits DONE (ms, applied?)', sw.elapsed(), applied);\n\t\t\t\tdocListener.dispose();\n\t\t\t\ttypeListener.dispose();\n\t\t\t}));\n\t\t}\n\n\t\tlet { insertText } = item.completion;\n\t\tif (!(item.completion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet)) {\n\t\t\tinsertText = SnippetParser.escape(insertText);\n\t\t}\n\n\t\tsnippetController.insert(insertText, {\n\t\t\toverwriteBefore: info.overwriteBefore,\n\t\t\toverwriteAfter: info.overwriteAfter,\n\t\t\tundoStopBefore: false,\n\t\t\tundoStopAfter: false,\n\t\t\tadjustWhitespace: !(item.completion.insertTextRules! & CompletionItemInsertTextRule.KeepWhitespace),\n\t\t\tclipboardText: event.model.clipboardText,\n\t\t\tovertypingCapturer: this._overtypingCapturer.value\n\t\t});\n\n\t\tif (!(flags & InsertFlags.NoAfterUndoStop)) {\n\t\t\tthis.editor.pushUndoStop();\n\t\t}\n\n\t\tif (!item.completion.command) {\n\t\t\t// done\n\t\t\tthis.model.cancel();\n\n\t\t} else if (item.completion.command.id === TriggerSuggestAction.id) {\n\t\t\t// retigger\n\t\t\tthis.model.trigger({ auto: true, shy: false }, true);\n\n\t\t} else {\n\t\t\t// exec command, done\n\t\t\ttasks.push(this._commandService.executeCommand(item.completion.command.id, ...(item.completion.command.arguments ? [...item.completion.command.arguments] : [])).catch(onUnexpectedError));\n\t\t\tthis.model.cancel();\n\t\t}\n\n\t\tif (flags & InsertFlags.KeepAlternativeSuggestions) {\n\t\t\tthis._alternatives.value.set(event, next => {\n\n\t\t\t\t// cancel resolving of additional edits\n\t\t\t\tcts.cancel();\n\n\t\t\t\t// this is not so pretty. when inserting the 'next'\n\t\t\t\t// suggestion we undo until we are at the state at\n\t\t\t\t// which we were before inserting the previous suggestion...\n\t\t\t\twhile (model.canUndo()) {\n\t\t\t\t\tif (modelVersionNow !== model.getAlternativeVersionId()) {\n\t\t\t\t\t\tmodel.undo();\n\t\t\t\t\t}\n\t\t\t\t\tthis._insertSuggestion(\n\t\t\t\t\t\tnext,\n\t\t\t\t\t\tInsertFlags.NoBeforeUndoStop | InsertFlags.NoAfterUndoStop | (flags & InsertFlags.AlternativeOverwriteConfig ? InsertFlags.AlternativeOverwriteConfig : 0)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis._alertCompletionItem(item);\n\n\t\t// clear only now - after all tasks are done\n\t\tPromise.all(tasks).finally(() => {\n\t\t\tthis._reportSuggestionAcceptedTelemetry(model, event);\n\n\t\t\tthis.model.clear();\n\t\t\tcts.dispose();\n\t\t});\n\t}\n\n\tprivate _telemetryGate: number = 0;\n\tprivate _reportSuggestionAcceptedTelemetry(model: ITextModel, acceptedSuggestion: ISelectedSuggestion) {\n\t\tif (this._telemetryGate++ % 100 !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttype AcceptedSuggestion = { providerId: string; fileExtension: string; languageId: string; basenameHash: string };\n\t\ttype AcceptedSuggestionClassification = {\n\t\t\tproviderId: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight' };\n\t\t\tbasenameHash: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight' };\n\t\t\tfileExtension: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\t\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight' };\n\t\t};\n\t\t// _debugDisplayName looks like `vscode.css-language-features(/-:)`, where the last bit is the trigger chars\n\t\t// normalize it to just the extension ID and lowercase\n\t\tconst providerId = (acceptedSuggestion.item.provider._debugDisplayName ?? 'unknown').split('(', 1)[0].toLowerCase();\n\t\tthis._telemetryService.publicLog2<AcceptedSuggestion, AcceptedSuggestionClassification>('suggest.acceptedSuggestion', {\n\t\t\tproviderId,\n\t\t\tbasenameHash: hash(basename(model.uri)).toString(16),\n\t\t\tlanguageId: model.getLanguageId(),\n\t\t\tfileExtension: extname(model.uri),\n\t\t});\n\t}\n\n\tgetOverwriteInfo(item: CompletionItem, toggleMode: boolean): { overwriteBefore: number; overwriteAfter: number } {\n\t\tassertType(this.editor.hasModel());\n\n\t\tlet replace = this.editor.getOption(EditorOption.suggest).insertMode === 'replace';\n\t\tif (toggleMode) {\n\t\t\treplace = !replace;\n\t\t}\n\t\tconst overwriteBefore = item.position.column - item.editStart.column;\n\t\tconst overwriteAfter = (replace ? item.editReplaceEnd.column : item.editInsertEnd.column) - item.position.column;\n\t\tconst columnDelta = this.editor.getPosition().column - item.position.column;\n\t\tconst suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0;\n\n\t\treturn {\n\t\t\toverwriteBefore: overwriteBefore + columnDelta,\n\t\t\toverwriteAfter: overwriteAfter + suffixDelta\n\t\t};\n\t}\n\n\tprivate _alertCompletionItem(item: CompletionItem): void {\n\t\tif (isNonEmptyArray(item.completion.additionalTextEdits)) {\n\t\t\tlet msg = nls.localize('aria.alert.snippet', \"Accepting '{0}' made {1} additional edits\", item.textLabel, item.completion.additionalTextEdits.length);\n\t\t\talert(msg);\n\t\t}\n\t}\n\n\ttriggerSuggest(onlyFrom?: Set<CompletionItemProvider>, auto?: boolean): void {\n\t\tif (this.editor.hasModel()) {\n\t\t\tthis.model.trigger({ auto: auto ?? false, shy: false }, false, onlyFrom);\n\t\t\tthis.editor.revealPosition(this.editor.getPosition(), ScrollType.Smooth);\n\t\t\tthis.editor.focus();\n\t\t}\n\t}\n\n\ttriggerSuggestAndAcceptBest(arg: { fallback: string }): void {\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\n\t\t}\n\t\tconst positionNow = this.editor.getPosition();\n\n\t\tconst fallback = () => {\n\t\t\tif (positionNow.equals(this.editor.getPosition()!)) {\n\t\t\t\tthis._commandService.executeCommand(arg.fallback);\n\t\t\t}\n\t\t};\n\n\t\tconst makesTextEdit = (item: CompletionItem): boolean => {\n\t\t\tif (item.completion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet || item.completion.additionalTextEdits) {\n\t\t\t\t// snippet, other editor -> makes edit\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst position = this.editor.getPosition()!;\n\t\t\tconst startColumn = item.editStart.column;\n\t\t\tconst endColumn = position.column;\n\t\t\tif (endColumn - startColumn !== item.completion.insertText.length) {\n\t\t\t\t// unequal lengths -> makes edit\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst textNow = this.editor.getModel()!.getValueInRange({\n\t\t\t\tstartLineNumber: position.lineNumber,\n\t\t\t\tstartColumn,\n\t\t\t\tendLineNumber: position.lineNumber,\n\t\t\t\tendColumn\n\t\t\t});\n\t\t\t// unequal text -> makes edit\n\t\t\treturn textNow !== item.completion.insertText;\n\t\t};\n\n\t\tEvent.once(this.model.onDidTrigger)(_ => {\n\t\t\t// wait for trigger because only then the cancel-event is trustworthy\n\t\t\tlet listener: IDisposable[] = [];\n\n\t\t\tEvent.any<any>(this.model.onDidTrigger, this.model.onDidCancel)(() => {\n\t\t\t\t// retrigger or cancel -> try to type default text\n\t\t\t\tdispose(listener);\n\t\t\t\tfallback();\n\t\t\t}, undefined, listener);\n\n\t\t\tthis.model.onDidSuggest(({ completionModel }) => {\n\t\t\t\tdispose(listener);\n\t\t\t\tif (completionModel.items.length === 0) {\n\t\t\t\t\tfallback();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst index = this._memoryService.select(this.editor.getModel()!, this.editor.getPosition()!, completionModel.items);\n\t\t\t\tconst item = completionModel.items[index];\n\t\t\t\tif (!makesTextEdit(item)) {\n\t\t\t\t\tfallback();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.editor.pushUndoStop();\n\t\t\t\tthis._insertSuggestion({ index, item, model: completionModel }, InsertFlags.KeepAlternativeSuggestions | InsertFlags.NoBeforeUndoStop | InsertFlags.NoAfterUndoStop);\n\n\t\t\t}, undefined, listener);\n\t\t});\n\n\t\tthis.model.trigger({ auto: false, shy: true });\n\t\tthis.editor.revealPosition(positionNow, ScrollType.Smooth);\n\t\tthis.editor.focus();\n\t}\n\n\tacceptSelectedSuggestion(keepAlternativeSuggestions: boolean, alternativeOverwriteConfig: boolean): void {\n\t\tconst item = this.widget.value.getFocusedItem();\n\t\tlet flags = 0;\n\t\tif (keepAlternativeSuggestions) {\n\t\t\tflags |= InsertFlags.KeepAlternativeSuggestions;\n\t\t}\n\t\tif (alternativeOverwriteConfig) {\n\t\t\tflags |= InsertFlags.AlternativeOverwriteConfig;\n\t\t}\n\t\tthis._insertSuggestion(item, flags);\n\t}\n\tacceptNextSuggestion() {\n\t\tthis._alternatives.value.next();\n\t}\n\n\tacceptPrevSuggestion() {\n\t\tthis._alternatives.value.prev();\n\t}\n\n\tcancelSuggestWidget(): void {\n\t\tthis.model.cancel();\n\t\tthis.model.clear();\n\t\tthis.widget.value.hideWidget();\n\t}\n\n\tselectNextSuggestion(): void {\n\t\tthis.widget.value.selectNext();\n\t}\n\n\tselectNextPageSuggestion(): void {\n\t\tthis.widget.value.selectNextPage();\n\t}\n\n\tselectLastSuggestion(): void {\n\t\tthis.widget.value.selectLast();\n\t}\n\n\tselectPrevSuggestion(): void {\n\t\tthis.widget.value.selectPrevious();\n\t}\n\n\tselectPrevPageSuggestion(): void {\n\t\tthis.widget.value.selectPreviousPage();\n\t}\n\n\tselectFirstSuggestion(): void {\n\t\tthis.widget.value.selectFirst();\n\t}\n\n\ttoggleSuggestionDetails(): void {\n\t\tthis.widget.value.toggleDetails();\n\t}\n\n\ttoggleExplainMode(): void {\n\t\tthis.widget.value.toggleExplainMode();\n\t}\n\n\ttoggleSuggestionFocus(): void {\n\t\tthis.widget.value.toggleDetailsFocus();\n\t}\n\n\tresetWidgetSize(): void {\n\t\tthis.widget.value.resetPersistedSize();\n\t}\n\n\tforceRenderingAbove() {\n\t\tthis.widget.value.forceRenderingAbove();\n\t}\n\n\tstopForceRenderingAbove() {\n\t\tif (!this.widget.isInitialized) {\n\t\t\t// This method has no effect if the widget is not initialized yet.\n\t\t\treturn;\n\t\t}\n\t\tthis.widget.value.stopForceRenderingAbove();\n\t}\n\n\tregisterSelector(selector: ISuggestItemPreselector): IDisposable {\n\t\treturn this._selectors.register(selector);\n\t}\n}\n\nclass PriorityRegistry<T> {\n\tprivate readonly _items = new Array<T>();\n\n\tconstructor(private readonly prioritySelector: (item: T) => number) { }\n\n\tregister(value: T): IDisposable {\n\t\tif (this._items.indexOf(value) !== -1) {\n\t\t\tthrow new Error('Value is already registered');\n\t\t}\n\t\tthis._items.push(value);\n\t\tthis._items.sort((s1, s2) => this.prioritySelector(s2) - this.prioritySelector(s1));\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tconst idx = this._items.indexOf(value);\n\t\t\t\tif (idx >= 0) {\n\t\t\t\t\tthis._items.splice(idx, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tget itemsOrderedByPriorityDesc(): readonly T[] {\n\t\treturn this._items;\n\t}\n}\n\nexport class TriggerSuggestAction extends EditorAction {\n\n\tstatic readonly id = 'editor.action.triggerSuggest';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: TriggerSuggestAction.id,\n\t\t\tlabel: nls.localize('suggest.trigger.label', \"Trigger Suggest\"),\n\t\t\talias: 'Trigger Suggest',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCompletionItemProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Space,\n\t\t\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.KeyI],\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.Space, secondary: [KeyMod.Alt | KeyCode.Escape, KeyMod.CtrlCmd | KeyCode.KeyI] },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\trun(_accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tconst controller = SuggestController.get(editor);\n\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\ttype TriggerArgs = { auto: boolean };\n\t\tlet auto: boolean | undefined;\n\t\tif (args && typeof args === 'object') {\n\t\t\tif ((<TriggerArgs>args).auto === true) {\n\t\t\t\tauto = true;\n\t\t\t}\n\t\t}\n\n\t\tcontroller.triggerSuggest(undefined, auto);\n\t}\n}\n\nregisterEditorContribution(SuggestController.ID, SuggestController);\nregisterEditorAction(TriggerSuggestAction);\n\nconst weight = KeybindingWeight.EditorContrib + 90;\n\nconst SuggestCommand = EditorCommand.bindToContribution<SuggestController>(SuggestController.get);\n\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'acceptSelectedSuggestion',\n\tprecondition: SuggestContext.Visible,\n\thandler(x) {\n\t\tx.acceptSelectedSuggestion(true, false);\n\t}\n}));\n\n// normal tab\nKeybindingsRegistry.registerKeybindingRule({\n\tid: 'acceptSelectedSuggestion',\n\twhen: ContextKeyExpr.and(SuggestContext.Visible, EditorContextKeys.textInputFocus),\n\tprimary: KeyCode.Tab,\n\tweight\n});\n\n// accept on enter has special rules\nKeybindingsRegistry.registerKeybindingRule({\n\tid: 'acceptSelectedSuggestion',\n\twhen: ContextKeyExpr.and(SuggestContext.Visible, EditorContextKeys.textInputFocus, SuggestContext.AcceptSuggestionsOnEnter, SuggestContext.MakesTextEdit),\n\tprimary: KeyCode.Enter,\n\tweight,\n});\n\nMenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu, {\n\tcommand: { id: 'acceptSelectedSuggestion', title: nls.localize('accept.insert', \"Insert\") },\n\tgroup: 'left',\n\torder: 1,\n\twhen: SuggestContext.HasInsertAndReplaceRange.toNegated()\n});\nMenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu, {\n\tcommand: { id: 'acceptSelectedSuggestion', title: nls.localize('accept.insert', \"Insert\") },\n\tgroup: 'left',\n\torder: 1,\n\twhen: ContextKeyExpr.and(SuggestContext.HasInsertAndReplaceRange, SuggestContext.InsertMode.isEqualTo('insert'))\n});\nMenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu, {\n\tcommand: { id: 'acceptSelectedSuggestion', title: nls.localize('accept.replace', \"Replace\") },\n\tgroup: 'left',\n\torder: 1,\n\twhen: ContextKeyExpr.and(SuggestContext.HasInsertAndReplaceRange, SuggestContext.InsertMode.isEqualTo('replace'))\n});\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'acceptAlternativeSelectedSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, EditorContextKeys.textInputFocus),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.Shift | KeyCode.Enter,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Tab],\n\t},\n\thandler(x) {\n\t\tx.acceptSelectedSuggestion(false, true);\n\t},\n\tmenuOpts: [{\n\t\tmenuId: suggestWidgetStatusbarMenu,\n\t\tgroup: 'left',\n\t\torder: 2,\n\t\twhen: ContextKeyExpr.and(SuggestContext.HasInsertAndReplaceRange, SuggestContext.InsertMode.isEqualTo('insert')),\n\t\ttitle: nls.localize('accept.replace', \"Replace\")\n\t}, {\n\t\tmenuId: suggestWidgetStatusbarMenu,\n\t\tgroup: 'left',\n\t\torder: 2,\n\t\twhen: ContextKeyExpr.and(SuggestContext.HasInsertAndReplaceRange, SuggestContext.InsertMode.isEqualTo('replace')),\n\t\ttitle: nls.localize('accept.insert', \"Insert\")\n\t}]\n}));\n\n\n// continue to support the old command\nCommandsRegistry.registerCommandAlias('acceptSelectedSuggestionOnEnter', 'acceptSelectedSuggestion');\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'hideSuggestWidget',\n\tprecondition: SuggestContext.Visible,\n\thandler: x => x.cancelSuggestWidget(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.Escape,\n\t\tsecondary: [KeyMod.Shift | KeyCode.Escape]\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectNextSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectNextSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.DownArrow,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.DownArrow],\n\t\tmac: { primary: KeyCode.DownArrow, secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KeyN] }\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectNextPageSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectNextPageSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.PageDown,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.PageDown]\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectLastSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectLastSuggestion()\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectPrevSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectPrevSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.UpArrow,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.UpArrow],\n\t\tmac: { primary: KeyCode.UpArrow, secondary: [KeyMod.CtrlCmd | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KeyP] }\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectPrevPageSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectPrevPageSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.PageUp,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.PageUp]\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'selectFirstSuggestion',\n\tprecondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),\n\thandler: c => c.selectFirstSuggestion()\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'toggleSuggestionDetails',\n\tprecondition: SuggestContext.Visible,\n\thandler: x => x.toggleSuggestionDetails(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.Space,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyCode.KeyI],\n\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.Space, secondary: [KeyMod.CtrlCmd | KeyCode.KeyI] }\n\t},\n\tmenuOpts: [{\n\t\tmenuId: suggestWidgetStatusbarMenu,\n\t\tgroup: 'right',\n\t\torder: 1,\n\t\twhen: ContextKeyExpr.and(SuggestContext.DetailsVisible, SuggestContext.CanResolve),\n\t\ttitle: nls.localize('detail.more', \"show less\")\n\t}, {\n\t\tmenuId: suggestWidgetStatusbarMenu,\n\t\tgroup: 'right',\n\t\torder: 1,\n\t\twhen: ContextKeyExpr.and(SuggestContext.DetailsVisible.toNegated(), SuggestContext.CanResolve),\n\t\ttitle: nls.localize('detail.less', \"show more\")\n\t}]\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'toggleExplainMode',\n\tprecondition: SuggestContext.Visible,\n\thandler: x => x.toggleExplainMode(),\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorContrib,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.Slash,\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'toggleSuggestionFocus',\n\tprecondition: SuggestContext.Visible,\n\thandler: x => x.toggleSuggestionFocus(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Space,\n\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Space }\n\t}\n}));\n\n//#region tab completions\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'insertBestCompletion',\n\tprecondition: ContextKeyExpr.and(\n\t\tEditorContextKeys.textInputFocus,\n\t\tContextKeyExpr.equals('config.editor.tabCompletion', 'on'),\n\t\tWordContextKey.AtEnd,\n\t\tSuggestContext.Visible.toNegated(),\n\t\tSuggestAlternatives.OtherSuggestions.toNegated(),\n\t\tSnippetController2.InSnippetMode.toNegated()\n\t),\n\thandler: (x, arg) => {\n\n\t\tx.triggerSuggestAndAcceptBest(isObject(arg) ? { fallback: 'tab', ...arg } : { fallback: 'tab' });\n\t},\n\tkbOpts: {\n\t\tweight,\n\t\tprimary: KeyCode.Tab\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'insertNextSuggestion',\n\tprecondition: ContextKeyExpr.and(\n\t\tEditorContextKeys.textInputFocus,\n\t\tContextKeyExpr.equals('config.editor.tabCompletion', 'on'),\n\t\tSuggestAlternatives.OtherSuggestions,\n\t\tSuggestContext.Visible.toNegated(),\n\t\tSnippetController2.InSnippetMode.toNegated()\n\t),\n\thandler: x => x.acceptNextSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyCode.Tab\n\t}\n}));\n\nregisterEditorCommand(new SuggestCommand({\n\tid: 'insertPrevSuggestion',\n\tprecondition: ContextKeyExpr.and(\n\t\tEditorContextKeys.textInputFocus,\n\t\tContextKeyExpr.equals('config.editor.tabCompletion', 'on'),\n\t\tSuggestAlternatives.OtherSuggestions,\n\t\tSuggestContext.Visible.toNegated(),\n\t\tSnippetController2.InSnippetMode.toNegated()\n\t),\n\thandler: x => x.acceptPrevSuggestion(),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.Shift | KeyCode.Tab\n\t}\n}));\n\n\nregisterEditorAction(class extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.resetSuggestSize',\n\t\t\tlabel: nls.localize('suggest.reset.label', \"Reset Suggest Widget Size\"),\n\t\t\talias: 'Reset Suggest Widget Size',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\trun(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tSuggestController.get(editor)?.resetWidgetSize();\n\t}\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 { compareBy, findMaxBy, numberComparator } from 'vs/base/common/arrays';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CompletionItemInsertTextRule, CompletionItemKind } from 'vs/editor/common/languages';\nimport { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser';\nimport { SnippetSession } from 'vs/editor/contrib/snippet/browser/snippetSession';\nimport { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest';\nimport { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController';\nimport { minimizeInlineCompletion } from './inlineCompletionsModel';\nimport { NormalizedInlineCompletion, normalizedInlineCompletionsEquals } from './inlineCompletionToGhostText';\n\nexport interface SuggestWidgetState {\n\t/**\n\t * Represents the currently selected item in the suggest widget as inline completion, if possible.\n\t*/\n\tselectedItem: SuggestItemInfo | undefined;\n}\n\nexport interface SuggestItemInfo {\n\tnormalizedInlineCompletion: NormalizedInlineCompletion;\n\tisSnippetText: boolean;\n\tcompletionItemKind: CompletionItemKind;\n}\n\nexport class SuggestWidgetInlineCompletionProvider extends Disposable {\n\tprivate isSuggestWidgetVisible: boolean = false;\n\tprivate isShiftKeyPressed = false;\n\tprivate _isActive = false;\n\tprivate _currentSuggestItemInfo: SuggestItemInfo | undefined = undefined;\n\tprivate readonly onDidChangeEmitter = new Emitter<void>();\n\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\t// This delay fixes a suggest widget issue when typing \".\" immediately restarts the suggestion session.\n\tprivate readonly setInactiveDelayed = this._register(new RunOnceScheduler(() => {\n\t\tif (!this.isSuggestWidgetVisible) {\n\t\t\tif (this._isActive) {\n\t\t\t\tthis._isActive = false;\n\t\t\t\tthis.onDidChangeEmitter.fire();\n\t\t\t}\n\t\t}\n\t}, 100));\n\n\t/**\n\t * Returns undefined if the suggest widget is not active.\n\t*/\n\tget state(): SuggestWidgetState | undefined {\n\t\tif (!this._isActive) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn { selectedItem: this._currentSuggestItemInfo };\n\t}\n\n\tconstructor(\n\t\tprivate readonly editor: IActiveCodeEditor,\n\t\tprivate readonly suggestControllerPreselector: () => NormalizedInlineCompletion | undefined\n\t) {\n\t\tsuper();\n\n\t\t// See the command acceptAlternativeSelectedSuggestion that is bound to shift+tab\n\t\tthis._register(editor.onKeyDown(e => {\n\t\t\tif (e.shiftKey && !this.isShiftKeyPressed) {\n\t\t\t\tthis.isShiftKeyPressed = true;\n\t\t\t\tthis.update(this._isActive);\n\t\t\t}\n\t\t}));\n\t\tthis._register(editor.onKeyUp(e => {\n\t\t\tif (e.shiftKey && this.isShiftKeyPressed) {\n\t\t\t\tthis.isShiftKeyPressed = false;\n\t\t\t\tthis.update(this._isActive);\n\t\t\t}\n\t\t}));\n\n\t\tconst suggestController = SuggestController.get(this.editor);\n\t\tif (suggestController) {\n\t\t\tthis._register(suggestController.registerSelector({\n\t\t\t\tpriority: 100,\n\t\t\t\tselect: (model, pos, suggestItems) => {\n\t\t\t\t\tconst textModel = this.editor.getModel();\n\t\t\t\t\tconst normalizedItemToPreselect = minimizeInlineCompletion(textModel, this.suggestControllerPreselector());\n\t\t\t\t\tif (!normalizedItemToPreselect) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\tconst position = Position.lift(pos);\n\n\t\t\t\t\tconst candidates = suggestItems\n\t\t\t\t\t\t.map((suggestItem, index) => {\n\t\t\t\t\t\t\tconst inlineSuggestItem = suggestionToSuggestItemInfo(suggestController, position, suggestItem, this.isShiftKeyPressed);\n\t\t\t\t\t\t\tconst normalizedSuggestItem = minimizeInlineCompletion(textModel, inlineSuggestItem?.normalizedInlineCompletion);\n\t\t\t\t\t\t\tif (!normalizedSuggestItem) {\n\t\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst valid =\n\t\t\t\t\t\t\t\trangeStartsWith(normalizedItemToPreselect.range, normalizedSuggestItem.range) &&\n\t\t\t\t\t\t\t\tnormalizedItemToPreselect.text.startsWith(normalizedSuggestItem.text);\n\t\t\t\t\t\t\treturn { index, valid, prefixLength: normalizedSuggestItem.text.length, suggestItem };\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter(item => item && item.valid);\n\n\t\t\t\t\tconst result = findMaxBy(\n\t\t\t\t\t\tcandidates,\n\t\t\t\t\t\tcompareBy(s => s!.prefixLength, numberComparator)\n\t\t\t\t\t);\n\t\t\t\t\treturn result ? result.index : - 1;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tlet isBoundToSuggestWidget = false;\n\t\t\tconst bindToSuggestWidget = () => {\n\t\t\t\tif (isBoundToSuggestWidget) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tisBoundToSuggestWidget = true;\n\n\t\t\t\tthis._register(suggestController.widget.value.onDidShow(() => {\n\t\t\t\t\tthis.isSuggestWidgetVisible = true;\n\t\t\t\t\tthis.update(true);\n\t\t\t\t}));\n\t\t\t\tthis._register(suggestController.widget.value.onDidHide(() => {\n\t\t\t\t\tthis.isSuggestWidgetVisible = false;\n\t\t\t\t\tthis.setInactiveDelayed.schedule();\n\t\t\t\t\tthis.update(this._isActive);\n\t\t\t\t}));\n\t\t\t\tthis._register(suggestController.widget.value.onDidFocus(() => {\n\t\t\t\t\tthis.isSuggestWidgetVisible = true;\n\t\t\t\t\tthis.update(true);\n\t\t\t\t}));\n\t\t\t};\n\n\t\t\tthis._register(Event.once(suggestController.model.onDidTrigger)(e => {\n\t\t\t\tbindToSuggestWidget();\n\t\t\t}));\n\t\t}\n\t\tthis.update(this._isActive);\n\t}\n\n\tprivate update(newActive: boolean): void {\n\t\tconst newInlineCompletion = this.getSuggestItemInfo();\n\t\tlet shouldFire = false;\n\t\tif (!suggestItemInfoEquals(this._currentSuggestItemInfo, newInlineCompletion)) {\n\t\t\tthis._currentSuggestItemInfo = newInlineCompletion;\n\t\t\tshouldFire = true;\n\t\t}\n\t\tif (this._isActive !== newActive) {\n\t\t\tthis._isActive = newActive;\n\t\t\tshouldFire = true;\n\t\t}\n\t\tif (shouldFire) {\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t}\n\t}\n\n\tprivate getSuggestItemInfo(): SuggestItemInfo | undefined {\n\t\tconst suggestController = SuggestController.get(this.editor);\n\t\tif (!suggestController) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (!this.isSuggestWidgetVisible) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst focusedItem = suggestController.widget.value.getFocusedItem();\n\t\tif (!focusedItem) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// TODO: item.isResolved\n\t\treturn suggestionToSuggestItemInfo(\n\t\t\tsuggestController,\n\t\t\tthis.editor.getPosition(),\n\t\t\tfocusedItem.item,\n\t\t\tthis.isShiftKeyPressed\n\t\t);\n\t}\n\n\tpublic stopForceRenderingAbove(): void {\n\t\tconst suggestController = SuggestController.get(this.editor);\n\t\tif (suggestController) {\n\t\t\tsuggestController.stopForceRenderingAbove();\n\t\t}\n\t}\n\n\tpublic forceRenderingAbove(): void {\n\t\tconst suggestController = SuggestController.get(this.editor);\n\t\tif (suggestController) {\n\t\t\tsuggestController.forceRenderingAbove();\n\t\t}\n\t}\n}\n\nexport function rangeStartsWith(rangeToTest: Range, prefix: Range): boolean {\n\treturn (\n\t\tprefix.startLineNumber === rangeToTest.startLineNumber &&\n\t\tprefix.startColumn === rangeToTest.startColumn &&\n\t\t(prefix.endLineNumber < rangeToTest.endLineNumber ||\n\t\t\t(prefix.endLineNumber === rangeToTest.endLineNumber &&\n\t\t\t\tprefix.endColumn <= rangeToTest.endColumn))\n\t);\n}\n\nfunction suggestItemInfoEquals(a: SuggestItemInfo | undefined, b: SuggestItemInfo | undefined): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (!a || !b) {\n\t\treturn false;\n\t}\n\treturn a.completionItemKind === b.completionItemKind &&\n\t\ta.isSnippetText === b.isSnippetText &&\n\t\tnormalizedInlineCompletionsEquals(a.normalizedInlineCompletion, b.normalizedInlineCompletion);\n}\n\nfunction suggestionToSuggestItemInfo(suggestController: SuggestController, position: Position, item: CompletionItem, toggleMode: boolean): SuggestItemInfo | undefined {\n\t// additionalTextEdits might not be resolved here, this could be problematic.\n\tif (Array.isArray(item.completion.additionalTextEdits) && item.completion.additionalTextEdits.length > 0) {\n\t\t// cannot represent additional text edits\n\t\treturn {\n\t\t\tcompletionItemKind: item.completion.kind,\n\t\t\tisSnippetText: false,\n\t\t\tnormalizedInlineCompletion: {\n\t\t\t\t// Dummy element, so that space is reserved, but no text is shown\n\t\t\t\trange: Range.fromPositions(position, position),\n\t\t\t\ttext: ''\n\t\t\t},\n\t\t};\n\t}\n\n\tlet { insertText } = item.completion;\n\tlet isSnippetText = false;\n\tif (item.completion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet) {\n\t\tconst snippet = new SnippetParser().parse(insertText);\n\t\tconst model = suggestController.editor.getModel()!;\n\n\t\t// Ignore snippets that are too large.\n\t\t// Adjust whitespace is expensive for them.\n\t\tif (snippet.children.length > 100) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tSnippetSession.adjustWhitespace(model, position, snippet, true, true);\n\t\tinsertText = snippet.toString();\n\t\tisSnippetText = true;\n\t}\n\n\tconst info = suggestController.getOverwriteInfo(item, toggleMode);\n\treturn {\n\t\tisSnippetText,\n\t\tcompletionItemKind: item.completion.kind,\n\t\tnormalizedInlineCompletion: {\n\t\t\ttext: insertText,\n\t\t\trange: Range.fromPositions(\n\t\t\t\tposition.delta(0, -info.overwriteBefore),\n\t\t\t\tposition.delta(0, Math.max(info.overwriteAfter, 0))\n\t\t\t),\n\t\t}\n\t};\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 { createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { InlineCompletionTriggerKind, SelectedSuggestionInfo } from 'vs/editor/common/languages';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { SharedInlineCompletionCache } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextModel';\nimport { BaseGhostTextWidgetModel, GhostText } from './ghostText';\nimport { minimizeInlineCompletion, provideInlineCompletions, UpdateOperation } from './inlineCompletionsModel';\nimport { inlineCompletionToGhostText, NormalizedInlineCompletion } from './inlineCompletionToGhostText';\nimport { SuggestWidgetInlineCompletionProvider } from './suggestWidgetInlineCompletionProvider';\n\nexport class SuggestWidgetPreviewModel extends BaseGhostTextWidgetModel {\n\tprivate readonly suggestionInlineCompletionSource = this._register(\n\t\tnew SuggestWidgetInlineCompletionProvider(\n\t\t\tthis.editor,\n\t\t\t// Use the first cache item (if any) as preselection.\n\t\t\t() => this.cache.value?.completions[0]?.toLiveInlineCompletion()\n\t\t)\n\t);\n\tprivate readonly updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\tprivate readonly updateCacheSoon = this._register(new RunOnceScheduler(() => this.updateCache(), 50));\n\n\tpublic override minReservedLineCount: number = 0;\n\n\tpublic get isActive(): boolean {\n\t\treturn this.suggestionInlineCompletionSource.state !== undefined;\n\t}\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tprivate readonly cache: SharedInlineCompletionCache,\n\t\t@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tsuper(editor);\n\n\t\tthis._register(this.suggestionInlineCompletionSource.onDidChange(() => {\n\t\t\tthis.updateCacheSoon.schedule();\n\n\t\t\tconst suggestWidgetState = this.suggestionInlineCompletionSource.state;\n\t\t\tif (!suggestWidgetState) {\n\t\t\t\tthis.minReservedLineCount = 0;\n\t\t\t}\n\n\t\t\tconst newGhostText = this.ghostText;\n\t\t\tif (newGhostText) {\n\t\t\t\tthis.minReservedLineCount = Math.max(this.minReservedLineCount, sum(newGhostText.parts.map(p => p.lines.length - 1)));\n\t\t\t}\n\n\t\t\tif (this.minReservedLineCount >= 1) {\n\t\t\t\tthis.suggestionInlineCompletionSource.forceRenderingAbove();\n\t\t\t} else {\n\t\t\t\tthis.suggestionInlineCompletionSource.stopForceRenderingAbove();\n\t\t\t}\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t}));\n\n\t\tthis._register(this.cache.onDidChange(() => {\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t}));\n\n\t\tthis._register(this.editor.onDidChangeCursorPosition((e) => {\n\t\t\tthis.minReservedLineCount = 0;\n\t\t\tthis.updateCacheSoon.schedule();\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t}));\n\n\t\tthis._register(toDisposable(() => this.suggestionInlineCompletionSource.stopForceRenderingAbove()));\n\t}\n\n\tprivate isSuggestionPreviewEnabled(): boolean {\n\t\tconst suggestOptions = this.editor.getOption(EditorOption.suggest);\n\t\treturn suggestOptions.preview;\n\t}\n\n\tprivate async updateCache() {\n\t\tconst state = this.suggestionInlineCompletionSource.state;\n\t\tif (!state || !state.selectedItem) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst info: SelectedSuggestionInfo = {\n\t\t\ttext: state.selectedItem.normalizedInlineCompletion.text,\n\t\t\trange: state.selectedItem.normalizedInlineCompletion.range,\n\t\t\tisSnippetText: state.selectedItem.isSnippetText,\n\t\t\tcompletionKind: state.selectedItem.completionItemKind,\n\t\t};\n\n\t\tconst position = this.editor.getPosition();\n\n\t\tconst promise = createCancelablePromise(async token => {\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider, position,\n\t\t\t\t\tthis.editor.getModel(),\n\t\t\t\t\t{ triggerKind: InlineCompletionTriggerKind.Automatic, selectedSuggestionInfo: info },\n\t\t\t\t\ttoken\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.cache.setValue(\n\t\t\t\tthis.editor,\n\t\t\t\tresult,\n\t\t\t\tInlineCompletionTriggerKind.Automatic\n\t\t\t);\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t});\n\t\tconst operation = new UpdateOperation(promise, InlineCompletionTriggerKind.Automatic);\n\t\tthis.updateOperation.value = operation;\n\t\tawait promise;\n\t\tif (this.updateOperation.value === operation) {\n\t\t\tthis.updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic override get ghostText(): GhostText | undefined {\n\t\tconst isSuggestionPreviewEnabled = this.isSuggestionPreviewEnabled();\n\t\tconst augmentedCompletion = minimizeInlineCompletion(this.editor.getModel()!, this.cache.value?.completions[0]?.toLiveInlineCompletion());\n\n\t\tconst suggestWidgetState = this.suggestionInlineCompletionSource.state;\n\t\tconst suggestInlineCompletion = minimizeInlineCompletion(this.editor.getModel()!, suggestWidgetState?.selectedItem?.normalizedInlineCompletion);\n\n\t\tconst isAugmentedCompletionValid = augmentedCompletion\n\t\t\t&& suggestInlineCompletion\n\t\t\t&& augmentedCompletion.text.startsWith(suggestInlineCompletion.text)\n\t\t\t&& augmentedCompletion.range.equalsRange(suggestInlineCompletion.range);\n\n\t\tif (!isSuggestionPreviewEnabled && !isAugmentedCompletionValid) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// If the augmented completion is not valid and there is no suggest inline completion, we still show the augmented completion.\n\t\tconst finalCompletion = isAugmentedCompletionValid ? augmentedCompletion : (suggestInlineCompletion || augmentedCompletion);\n\n\t\tconst inlineCompletionPreviewLength = isAugmentedCompletionValid ? finalCompletion!.text.length - suggestInlineCompletion.text.length : 0;\n\t\tconst newGhostText = this.toGhostText(finalCompletion, inlineCompletionPreviewLength);\n\n\t\treturn newGhostText;\n\t}\n\n\tprivate toGhostText(completion: NormalizedInlineCompletion | undefined, inlineCompletionPreviewLength: number): GhostText | undefined {\n\t\tconst mode = this.editor.getOptions().get(EditorOption.suggest).previewMode;\n\t\treturn completion\n\t\t\t? (\n\t\t\t\tinlineCompletionToGhostText(completion, this.editor.getModel(), mode, this.editor.getPosition(), inlineCompletionPreviewLength) ||\n\t\t\t\t// Show an invisible ghost text to reserve space\n\t\t\t\tnew GhostText(completion.range.endLineNumber, [], this.minReservedLineCount)\n\t\t\t)\n\t\t\t: undefined;\n\t}\n}\n\nfunction sum(arr: number[]): number {\n\treturn arr.reduce((a, b) => a + b, 0);\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 { Emitter } from 'vs/base/common/event';\nimport { Disposable, IReference, MutableDisposable } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { InlineCompletionTriggerKind } from 'vs/editor/common/languages';\nimport { GhostText, GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText';\nimport { InlineCompletionsModel, SynchronizedInlineCompletionsCache, TrackedInlineCompletions } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel';\nimport { SuggestWidgetPreviewModel } from 'vs/editor/contrib/inlineCompletions/browser/suggestWidgetPreviewModel';\nimport { createDisposableRef } from 'vs/editor/contrib/inlineCompletions/browser/utils';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\n\nexport abstract class DelegatingModel extends Disposable implements GhostTextWidgetModel {\n\tprivate readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate hasCachedGhostText = false;\n\tprivate cachedGhostText: GhostText | undefined;\n\n\tprivate readonly currentModelRef = this._register(new MutableDisposable<IReference<GhostTextWidgetModel>>());\n\tprotected get targetModel(): GhostTextWidgetModel | undefined {\n\t\treturn this.currentModelRef.value?.object;\n\t}\n\n\tprotected setTargetModel(model: GhostTextWidgetModel | undefined): void {\n\t\tif (this.currentModelRef.value?.object === model) {\n\t\t\treturn;\n\t\t}\n\t\tthis.currentModelRef.clear();\n\t\tthis.currentModelRef.value = model ? createDisposableRef(model, model.onDidChange(() => {\n\t\t\tthis.hasCachedGhostText = false;\n\t\t\tthis.onDidChangeEmitter.fire();\n\t\t})) : undefined;\n\n\t\tthis.hasCachedGhostText = false;\n\t\tthis.onDidChangeEmitter.fire();\n\t}\n\n\tpublic get ghostText(): GhostText | undefined {\n\t\tif (!this.hasCachedGhostText) {\n\t\t\tthis.cachedGhostText = this.currentModelRef.value?.object?.ghostText;\n\t\t\tthis.hasCachedGhostText = true;\n\t\t}\n\t\treturn this.cachedGhostText;\n\t}\n\n\tpublic setExpanded(expanded: boolean): void {\n\t\tthis.targetModel?.setExpanded(expanded);\n\t}\n\n\tpublic get minReservedLineCount(): number {\n\t\treturn this.targetModel ? this.targetModel.minReservedLineCount : 0;\n\t}\n}\n\n/**\n * A ghost text model that is both driven by inline completions and the suggest widget.\n*/\nexport class GhostTextModel extends DelegatingModel implements GhostTextWidgetModel {\n\tpublic readonly sharedCache = this._register(new SharedInlineCompletionCache());\n\tpublic readonly suggestWidgetAdapterModel = this._register(this.instantiationService.createInstance(SuggestWidgetPreviewModel, this.editor, this.sharedCache));\n\tpublic readonly inlineCompletionsModel = this._register(this.instantiationService.createInstance(InlineCompletionsModel, this.editor, this.sharedCache));\n\n\tpublic get activeInlineCompletionsModel(): InlineCompletionsModel | undefined {\n\t\tif (this.targetModel === this.inlineCompletionsModel) {\n\t\t\treturn this.inlineCompletionsModel;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tconstructor(\n\t\tprivate readonly editor: IActiveCodeEditor,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(this.suggestWidgetAdapterModel.onDidChange(() => {\n\t\t\tthis.updateModel();\n\t\t}));\n\t\tthis.updateModel();\n\t}\n\n\tprivate updateModel(): void {\n\t\tthis.setTargetModel(\n\t\t\tthis.suggestWidgetAdapterModel.isActive\n\t\t\t\t? this.suggestWidgetAdapterModel\n\t\t\t\t: this.inlineCompletionsModel\n\t\t);\n\t\tthis.inlineCompletionsModel.setActive(this.targetModel === this.inlineCompletionsModel);\n\t}\n\n\tpublic shouldShowHoverAt(hoverRange: Range): boolean {\n\t\tconst ghostText = this.activeInlineCompletionsModel?.ghostText;\n\t\tif (ghostText) {\n\t\t\treturn ghostText.parts.some(p => hoverRange.containsPosition(new Position(ghostText.lineNumber, p.column)));\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic triggerInlineCompletion(): void {\n\t\tthis.activeInlineCompletionsModel?.trigger(InlineCompletionTriggerKind.Explicit);\n\t}\n\n\tpublic commitInlineCompletion(): void {\n\t\tthis.activeInlineCompletionsModel?.commitCurrentSuggestion();\n\t}\n\n\tpublic hideInlineCompletion(): void {\n\t\tthis.activeInlineCompletionsModel?.hide();\n\t}\n\n\tpublic showNextInlineCompletion(): void {\n\t\tthis.activeInlineCompletionsModel?.showNext();\n\t}\n\n\tpublic showPreviousInlineCompletion(): void {\n\t\tthis.activeInlineCompletionsModel?.showPrevious();\n\t}\n\n\tpublic async hasMultipleInlineCompletions(): Promise<boolean> {\n\t\tconst result = await this.activeInlineCompletionsModel?.hasMultipleInlineCompletions();\n\t\treturn result !== undefined ? result : false;\n\t}\n}\n\nexport class SharedInlineCompletionCache extends Disposable {\n\tprivate readonly onDidChangeEmitter = new Emitter<void>();\n\tpublic readonly onDidChange = this.onDidChangeEmitter.event;\n\n\tprivate readonly cache = this._register(new MutableDisposable<SynchronizedInlineCompletionsCache>());\n\n\tpublic get value(): SynchronizedInlineCompletionsCache | undefined {\n\t\treturn this.cache.value;\n\t}\n\n\tpublic setValue(editor: IActiveCodeEditor,\n\t\tcompletionsSource: TrackedInlineCompletions,\n\t\ttriggerKind: InlineCompletionTriggerKind\n\t) {\n\t\tthis.cache.value = new SynchronizedInlineCompletionsCache(\n\t\t\teditor,\n\t\t\tcompletionsSource,\n\t\t\t() => this.onDidChangeEmitter.fire(),\n\t\t\ttriggerKind\n\t\t);\n\t}\n\n\tpublic clearAndLeak(): SynchronizedInlineCompletionsCache | undefined {\n\t\treturn this.cache.clearAndLeak();\n\t}\n\n\tpublic clear() {\n\t\tthis.cache.clear();\n\t}\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 { Emitter } from 'vs/base/common/event';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { firstNonWhitespaceIndex } from 'vs/base/common/strings';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, EditorCommand, registerEditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { CursorColumns } from 'vs/editor/common/core/cursorColumns';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { inlineSuggestCommitId } from 'vs/editor/contrib/inlineCompletions/browser/consts';\nimport { GhostTextModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextModel';\nimport { GhostTextWidget } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextWidget';\nimport * as nls from 'vs/nls';\nimport { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class GhostTextController extends Disposable {\n\tpublic static readonly inlineSuggestionVisible = new RawContextKey<boolean>('inlineSuggestionVisible', false, nls.localize('inlineSuggestionVisible', \"Whether an inline suggestion is visible\"));\n\tpublic static readonly inlineSuggestionHasIndentation = new RawContextKey<boolean>('inlineSuggestionHasIndentation', false, nls.localize('inlineSuggestionHasIndentation', \"Whether the inline suggestion starts with whitespace\"));\n\tpublic static readonly inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey<boolean>('inlineSuggestionHasIndentationLessThanTabSize', true, nls.localize('inlineSuggestionHasIndentationLessThanTabSize', \"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab\"));\n\n\tstatic ID = 'editor.contrib.ghostTextController';\n\n\tpublic static get(editor: ICodeEditor): GhostTextController | null {\n\t\treturn editor.getContribution<GhostTextController>(GhostTextController.ID);\n\t}\n\n\tprivate triggeredExplicitly = false;\n\tprotected readonly activeController = this._register(new MutableDisposable<ActiveGhostTextController>());\n\tpublic get activeModel(): GhostTextModel | undefined {\n\t\treturn this.activeController.value?.model;\n\t}\n\n\tprivate readonly activeModelDidChangeEmitter = this._register(new Emitter<void>());\n\n\tconstructor(\n\t\tpublic readonly editor: ICodeEditor,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(this.editor.onDidChangeModel(() => {\n\t\t\tthis.updateModelController();\n\t\t}));\n\t\tthis._register(this.editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.hasChanged(EditorOption.suggest)) {\n\t\t\t\tthis.updateModelController();\n\t\t\t}\n\t\t\tif (e.hasChanged(EditorOption.inlineSuggest)) {\n\t\t\t\tthis.updateModelController();\n\t\t\t}\n\t\t}));\n\t\tthis.updateModelController();\n\t}\n\n\t// Don't call this method when not necessary. It will recreate the activeController.\n\tprivate updateModelController(): void {\n\t\tconst suggestOptions = this.editor.getOption(EditorOption.suggest);\n\t\tconst inlineSuggestOptions = this.editor.getOption(EditorOption.inlineSuggest);\n\n\t\tthis.activeController.value = undefined;\n\t\t// ActiveGhostTextController is only created if one of those settings is set or if the inline completions are triggered explicitly.\n\t\tthis.activeController.value =\n\t\t\tthis.editor.hasModel() && (suggestOptions.preview || inlineSuggestOptions.enabled || this.triggeredExplicitly)\n\t\t\t\t? this.instantiationService.createInstance(\n\t\t\t\t\tActiveGhostTextController,\n\t\t\t\t\tthis.editor\n\t\t\t\t)\n\t\t\t\t: undefined;\n\t\tthis.activeModelDidChangeEmitter.fire();\n\t}\n\n\tpublic shouldShowHoverAt(hoverRange: Range): boolean {\n\t\treturn this.activeModel?.shouldShowHoverAt(hoverRange) || false;\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this.activeController.value?.widget?.shouldShowHoverAtViewZone(viewZoneId) || false;\n\t}\n\n\tpublic trigger(): void {\n\t\tthis.triggeredExplicitly = true;\n\t\tif (!this.activeController.value) {\n\t\t\tthis.updateModelController();\n\t\t}\n\t\tthis.activeModel?.triggerInlineCompletion();\n\t}\n\n\tpublic commit(): void {\n\t\tthis.activeModel?.commitInlineCompletion();\n\t}\n\n\tpublic hide(): void {\n\t\tthis.activeModel?.hideInlineCompletion();\n\t}\n\n\tpublic showNextInlineCompletion(): void {\n\t\tthis.activeModel?.showNextInlineCompletion();\n\t}\n\n\tpublic showPreviousInlineCompletion(): void {\n\t\tthis.activeModel?.showPreviousInlineCompletion();\n\t}\n\n\tpublic async hasMultipleInlineCompletions(): Promise<boolean> {\n\t\tconst result = await this.activeModel?.hasMultipleInlineCompletions();\n\t\treturn result !== undefined ? result : false;\n\t}\n}\n\nclass GhostTextContextKeys {\n\tpublic readonly inlineCompletionVisible = GhostTextController.inlineSuggestionVisible.bindTo(this.contextKeyService);\n\tpublic readonly inlineCompletionSuggestsIndentation = GhostTextController.inlineSuggestionHasIndentation.bindTo(this.contextKeyService);\n\tpublic readonly inlineCompletionSuggestsIndentationLessThanTabSize = GhostTextController.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService);\n\n\tconstructor(private readonly contextKeyService: IContextKeyService) {\n\t}\n}\n\n/**\n * The controller for a text editor with an initialized text model.\n * Must be disposed as soon as the model detaches from the editor.\n*/\nexport class ActiveGhostTextController extends Disposable {\n\tprivate readonly contextKeys = new GhostTextContextKeys(this.contextKeyService);\n\tpublic readonly model = this._register(this.instantiationService.createInstance(GhostTextModel, this.editor));\n\tpublic readonly widget = this._register(this.instantiationService.createInstance(GhostTextWidget, this.editor, this.model));\n\n\tconstructor(\n\t\tprivate readonly editor: IActiveCodeEditor,\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis.contextKeys.inlineCompletionVisible.set(false);\n\t\t\tthis.contextKeys.inlineCompletionSuggestsIndentation.set(false);\n\t\t\tthis.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(true);\n\t\t}));\n\n\t\tthis._register(this.model.onDidChange(() => {\n\t\t\tthis.updateContextKeys();\n\t\t}));\n\t\tthis.updateContextKeys();\n\t}\n\n\tprivate updateContextKeys(): void {\n\t\tthis.contextKeys.inlineCompletionVisible.set(\n\t\t\tthis.model.activeInlineCompletionsModel?.ghostText !== undefined\n\t\t);\n\n\t\tlet startsWithIndentation = false;\n\t\tlet startsWithIndentationLessThanTabSize = true;\n\n\t\tconst ghostText = this.model.inlineCompletionsModel.ghostText;\n\t\tif (!!this.model.activeInlineCompletionsModel && ghostText && ghostText.parts.length > 0) {\n\t\t\tconst { column, lines } = ghostText.parts[0];\n\n\t\t\tconst firstLine = lines[0];\n\n\t\t\tconst indentationEndColumn = this.editor.getModel().getLineIndentColumn(ghostText.lineNumber);\n\t\t\tconst inIndentation = column <= indentationEndColumn;\n\n\t\t\tif (inIndentation) {\n\t\t\t\tlet firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n\t\t\t\tif (firstNonWsIdx === -1) {\n\t\t\t\t\tfirstNonWsIdx = firstLine.length - 1;\n\t\t\t\t}\n\t\t\t\tstartsWithIndentation = firstNonWsIdx > 0;\n\n\t\t\t\tconst tabSize = this.editor.getModel().getOptions().tabSize;\n\t\t\t\tconst visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n\t\t\t\tstartsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n\t\t\t}\n\t\t}\n\n\t\tthis.contextKeys.inlineCompletionSuggestsIndentation.set(startsWithIndentation);\n\t\tthis.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(startsWithIndentationLessThanTabSize);\n\t}\n}\n\nconst GhostTextCommand = EditorCommand.bindToContribution(GhostTextController.get);\n\nexport const commitInlineSuggestionAction = new GhostTextCommand({\n\tid: inlineSuggestCommitId,\n\tprecondition: GhostTextController.inlineSuggestionVisible,\n\thandler(x) {\n\t\tx.commit();\n\t\tx.editor.focus();\n\t}\n});\nregisterEditorCommand(commitInlineSuggestionAction);\nKeybindingsRegistry.registerKeybindingRule({\n\tprimary: KeyCode.Tab,\n\tweight: 200,\n\tid: commitInlineSuggestionAction.id,\n\twhen: ContextKeyExpr.and(\n\t\tcommitInlineSuggestionAction.precondition,\n\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\tGhostTextController.inlineSuggestionHasIndentationLessThanTabSize\n\t),\n});\n\nregisterEditorCommand(new GhostTextCommand({\n\tid: 'editor.action.inlineSuggest.hide',\n\tprecondition: GhostTextController.inlineSuggestionVisible,\n\tkbOpts: {\n\t\tweight: 100,\n\t\tprimary: KeyCode.Escape,\n\t},\n\thandler(x) {\n\t\tx.hide();\n\t}\n}));\n\nexport class ShowNextInlineSuggestionAction extends EditorAction {\n\tpublic static ID = 'editor.action.inlineSuggest.showNext';\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowNextInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize('action.inlineSuggest.showNext', \"Show Next Inline Suggestion\"),\n\t\t\talias: 'Show Next Inline Suggestion',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, GhostTextController.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketRight,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = GhostTextController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.showNextInlineCompletion();\n\t\t\teditor.focus();\n\t\t}\n\t}\n}\n\nexport class ShowPreviousInlineSuggestionAction extends EditorAction {\n\tpublic static ID = 'editor.action.inlineSuggest.showPrevious';\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowPreviousInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize('action.inlineSuggest.showPrevious', \"Show Previous Inline Suggestion\"),\n\t\t\talias: 'Show Previous Inline Suggestion',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, GhostTextController.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketLeft,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = GhostTextController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.showPreviousInlineCompletion();\n\t\t\teditor.focus();\n\t\t}\n\t}\n}\n\nexport class TriggerInlineSuggestionAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.trigger',\n\t\t\tlabel: nls.localize('action.inlineSuggest.trigger', \"Trigger Inline Suggestion\"),\n\t\t\talias: 'Trigger Inline Suggestion',\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = GhostTextController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.trigger();\n\t\t}\n\t}\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 * as dom from 'vs/base/browser/dom';\nimport { MarkdownString } from 'vs/base/common/htmlContent';\nimport { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IModelDecoration } from 'vs/editor/common/model';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { commitInlineSuggestionAction, GhostTextController, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextController';\nimport * as nls from 'vs/nls';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\n\nexport class InlineCompletionsHover implements IHoverPart {\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<InlineCompletionsHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly controller: GhostTextController\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n\n\tpublic hasMultipleSuggestions(): Promise<boolean> {\n\t\treturn this.controller.hasMultipleInlineCompletions();\n\t}\n}\n\nexport class InlineCompletionsHoverParticipant implements IEditorHoverParticipant<InlineCompletionsHover> {\n\n\tpublic readonly hoverOrdinal: number = 3;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@IAccessibilityService private readonly accessibilityService: IAccessibilityService,\n\t) { }\n\n\tsuggestHoverAnchor(mouseEvent: IEditorMouseEvent): HoverAnchor | null {\n\t\tconst controller = GhostTextController.get(this._editor);\n\t\tif (!controller) {\n\t\t\treturn null;\n\t\t}\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.CONTENT_VIEW_ZONE) {\n\t\t\t// handle the case where the mouse is over the view zone\n\t\t\tconst viewZoneData = target.detail;\n\t\t\tif (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, Range.fromPositions(viewZoneData.positionBefore || viewZoneData.position, viewZoneData.positionBefore || viewZoneData.position));\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_EMPTY) {\n\t\t\t// handle the case where the mouse is over the empty portion of a line following ghost text\n\t\t\tif (controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_TEXT) {\n\t\t\t// handle the case where the mouse is directly over ghost text\n\t\t\tconst mightBeForeignElement = target.detail.mightBeForeignElement;\n\t\t\tif (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcomputeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): InlineCompletionsHover[] {\n\t\tconst controller = GhostTextController.get(this._editor);\n\t\tif (controller && controller.shouldShowHoverAt(anchor.range)) {\n\t\t\treturn [new InlineCompletionsHover(this, anchor.range, controller)];\n\t\t}\n\t\treturn [];\n\t}\n\n\trenderHoverParts(context: IEditorHoverRenderContext, hoverParts: InlineCompletionsHover[]): IDisposable {\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst part = hoverParts[0];\n\n\t\tif (this.accessibilityService.isScreenReaderOptimized()) {\n\t\t\tthis.renderScreenReaderText(context, part, disposableStore);\n\t\t}\n\n\t\tconst menu = disposableStore.add(this._menuService.createMenu(\n\t\t\tMenuId.InlineCompletionsActions,\n\t\t\tthis._contextKeyService\n\t\t));\n\n\t\tconst previousAction = context.statusBar.addAction({\n\t\t\tlabel: nls.localize('showNextInlineSuggestion', \"Next\"),\n\t\t\tcommandId: ShowNextInlineSuggestionAction.ID,\n\t\t\trun: () => this._commandService.executeCommand(ShowNextInlineSuggestionAction.ID)\n\t\t});\n\t\tconst nextAction = context.statusBar.addAction({\n\t\t\tlabel: nls.localize('showPreviousInlineSuggestion', \"Previous\"),\n\t\t\tcommandId: ShowPreviousInlineSuggestionAction.ID,\n\t\t\trun: () => this._commandService.executeCommand(ShowPreviousInlineSuggestionAction.ID)\n\t\t});\n\t\tcontext.statusBar.addAction({\n\t\t\tlabel: nls.localize('acceptInlineSuggestion', \"Accept\"),\n\t\t\tcommandId: commitInlineSuggestionAction.id,\n\t\t\trun: () => this._commandService.executeCommand(commitInlineSuggestionAction.id)\n\t\t});\n\n\t\tconst actions = [previousAction, nextAction];\n\t\tfor (const action of actions) {\n\t\t\taction.setEnabled(false);\n\t\t}\n\t\tpart.hasMultipleSuggestions().then(hasMore => {\n\t\t\tfor (const action of actions) {\n\t\t\t\taction.setEnabled(hasMore);\n\t\t\t}\n\t\t});\n\n\t\tfor (const [_, group] of menu.getActions()) {\n\t\t\tfor (const action of group) {\n\t\t\t\tif (action instanceof MenuItemAction) {\n\t\t\t\t\tcontext.statusBar.addAction({\n\t\t\t\t\t\tlabel: action.label,\n\t\t\t\t\t\tcommandId: action.item.id,\n\t\t\t\t\t\trun: () => this._commandService.executeCommand(action.item.id)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn disposableStore;\n\t}\n\n\tprivate renderScreenReaderText(context: IEditorHoverRenderContext, part: InlineCompletionsHover, disposableStore: DisposableStore) {\n\t\tconst $ = dom.$;\n\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\tconst renderer = disposableStore.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService));\n\t\tconst render = (code: string) => {\n\t\t\tdisposableStore.add(renderer.onDidRenderAsync(() => {\n\t\t\t\thoverContentsElement.className = 'hover-contents code-hover-contents';\n\t\t\t\tcontext.onContentsChanged();\n\t\t\t}));\n\n\t\t\tconst inlineSuggestionAvailable = nls.localize('inlineSuggestionFollows', \"Suggestion:\");\n\t\t\tconst renderedContents = disposableStore.add(renderer.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code)));\n\t\t\thoverContentsElement.replaceChildren(renderedContents.element);\n\t\t};\n\n\t\tconst ghostText = part.controller.activeModel?.inlineCompletionsModel?.ghostText;\n\t\tif (ghostText) {\n\t\t\tconst lineText = this._editor.getModel()!.getLineContent(ghostText.lineNumber);\n\t\t\trender(ghostText.renderForScreenReader(lineText));\n\t\t}\n\t\tcontext.fragment.appendChild(markdownHoverElement);\n\t}\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 { registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { GhostTextController, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, TriggerInlineSuggestionAction } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextController';\nimport { InlineCompletionsHoverParticipant } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHoverParticipant';\n\nregisterEditorContribution(GhostTextController.ID, GhostTextController);\nregisterEditorAction(TriggerInlineSuggestionAction);\nregisterEditorAction(ShowNextInlineSuggestionAction);\nregisterEditorAction(ShowPreviousInlineSuggestionAction);\nHoverParticipantRegistry.register(InlineCompletionsHoverParticipant);\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 'vs/base/common/event';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IWorkspaceTrustManagementService = createDecorator<IWorkspaceTrustManagementService>('workspaceTrustManagementService');\n\nexport interface IWorkspaceTrustManagementService {\n\treadonly _serviceBrand: undefined;\n\n\tonDidChangeTrust: Event<boolean>;\n\n\tisWorkspaceTrusted(): boolean;\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 { RunOnceScheduler } from 'vs/base/common/async';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { Codicon } from 'vs/base/common/codicons';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { InvisibleCharacters } from 'vs/base/common/strings';\nimport 'vs/css!./unicodeHighlighter';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { InUntrustedWorkspace, inUntrustedWorkspace, EditorOption, InternalUnicodeHighlightOptions, unicodeHighlightConfigKeys } from 'vs/editor/common/config/editorOptions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { IModelDecoration, IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { UnicodeHighlighterOptions, UnicodeHighlighterReason, UnicodeHighlighterReasonKind, UnicodeTextModelHighlighter } from 'vs/editor/common/services/unicodeTextModelHighlighter';\nimport { IEditorWorkerService, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { isModelDecorationInComment, isModelDecorationInString, isModelDecorationVisible } from 'vs/editor/common/viewModel/viewModelDecorations';\nimport { HoverAnchor, HoverAnchorType, HoverParticipantRegistry, IEditorHoverParticipant, IEditorHoverRenderContext } from 'vs/editor/contrib/hover/browser/hoverTypes';\nimport { MarkdownHover, renderMarkdownHovers } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant';\nimport { BannerController } from 'vs/editor/contrib/unicodeHighlighter/browser/bannerController';\nimport * as nls from 'vs/nls';\nimport { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';\nimport { registerIcon } from 'vs/platform/theme/common/iconRegistry';\nimport { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust';\n\nexport const warningIcon = registerIcon('extensions-warning-message', Codicon.warning, nls.localize('warningIcon', 'Icon shown with a warning message in the extensions editor.'));\n\nexport class UnicodeHighlighter extends Disposable implements IEditorContribution {\n\tpublic static readonly ID = 'editor.contrib.unicodeHighlighter';\n\n\tprivate _highlighter: DocumentUnicodeHighlighter | ViewportUnicodeHighlighter | null = null;\n\tprivate _options: InternalUnicodeHighlightOptions;\n\n\tprivate readonly _bannerController: BannerController;\n\tprivate _bannerClosed: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IWorkspaceTrustManagementService private readonly _workspaceTrustService: IWorkspaceTrustManagementService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._bannerController = this._register(instantiationService.createInstance(BannerController, _editor));\n\n\t\tthis._register(this._editor.onDidChangeModel(() => {\n\t\t\tthis._bannerClosed = false;\n\t\t\tthis._updateHighlighter();\n\t\t}));\n\n\t\tthis._options = _editor.getOption(EditorOption.unicodeHighlighting);\n\n\t\tthis._register(_workspaceTrustService.onDidChangeTrust(e => {\n\t\t\tthis._updateHighlighter();\n\t\t}));\n\n\t\tthis._register(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.unicodeHighlighting)) {\n\t\t\t\tthis._options = _editor.getOption(EditorOption.unicodeHighlighting);\n\t\t\t\tthis._updateHighlighter();\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateHighlighter();\n\t}\n\n\tpublic override dispose(): void {\n\t\tif (this._highlighter) {\n\t\t\tthis._highlighter.dispose();\n\t\t\tthis._highlighter = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\tprivate readonly _updateState = (state: IUnicodeHighlightsResult | null): void => {\n\t\tif (state && state.hasMore) {\n\t\t\tif (this._bannerClosed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This document contains many non-basic ASCII characters.\n\t\t\tconst max = Math.max(state.ambiguousCharacterCount, state.nonBasicAsciiCharacterCount, state.invisibleCharacterCount);\n\n\t\t\tlet data;\n\t\t\tif (state.nonBasicAsciiCharacterCount >= max) {\n\t\t\t\tdata = {\n\t\t\t\t\tmessage: nls.localize('unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters', 'This document contains many non-basic ASCII unicode characters'),\n\t\t\t\t\tcommand: new DisableHighlightingOfNonBasicAsciiCharactersAction(),\n\t\t\t\t};\n\t\t\t} else if (state.ambiguousCharacterCount >= max) {\n\t\t\t\tdata = {\n\t\t\t\t\tmessage: nls.localize('unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters', 'This document contains many ambiguous unicode characters'),\n\t\t\t\t\tcommand: new DisableHighlightingOfAmbiguousCharactersAction(),\n\t\t\t\t};\n\t\t\t} else if (state.invisibleCharacterCount >= max) {\n\t\t\t\tdata = {\n\t\t\t\t\tmessage: nls.localize('unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters', 'This document contains many invisible unicode characters'),\n\t\t\t\t\tcommand: new DisableHighlightingOfInvisibleCharactersAction(),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unreachable');\n\t\t\t}\n\n\t\t\tthis._bannerController.show({\n\t\t\t\tid: 'unicodeHighlightBanner',\n\t\t\t\tmessage: data.message,\n\t\t\t\ticon: warningIcon,\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: data.command.shortLabel,\n\t\t\t\t\t\thref: `command:${data.command.id}`\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tonClose: () => {\n\t\t\t\t\tthis._bannerClosed = true;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tthis._bannerController.hide();\n\t\t}\n\t};\n\n\tprivate _updateHighlighter(): void {\n\t\tthis._updateState(null);\n\n\t\tif (this._highlighter) {\n\t\t\tthis._highlighter.dispose();\n\t\t\tthis._highlighter = null;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst options = resolveOptions(this._workspaceTrustService.isWorkspaceTrusted(), this._options);\n\n\t\tif (\n\t\t\t[\n\t\t\t\toptions.nonBasicASCII,\n\t\t\t\toptions.ambiguousCharacters,\n\t\t\t\toptions.invisibleCharacters,\n\t\t\t].every((option) => option === false)\n\t\t) {\n\t\t\t// Don't do anything if the feature is fully disabled\n\t\t\treturn;\n\t\t}\n\n\t\tconst highlightOptions: UnicodeHighlighterOptions = {\n\t\t\tnonBasicASCII: options.nonBasicASCII,\n\t\t\tambiguousCharacters: options.ambiguousCharacters,\n\t\t\tinvisibleCharacters: options.invisibleCharacters,\n\t\t\tincludeComments: options.includeComments,\n\t\t\tincludeStrings: options.includeStrings,\n\t\t\tallowedCodePoints: Object.keys(options.allowedCharacters).map(c => c.codePointAt(0)!),\n\t\t\tallowedLocales: Object.keys(options.allowedLocales).map(locale => {\n\t\t\t\tif (locale === '_os') {\n\t\t\t\t\tlet osLocale = new Intl.NumberFormat().resolvedOptions().locale;\n\t\t\t\t\treturn osLocale;\n\t\t\t\t} else if (locale === '_vscode') {\n\t\t\t\t\treturn platform.language;\n\t\t\t\t}\n\t\t\t\treturn locale;\n\t\t\t}),\n\t\t};\n\n\t\tif (this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)) {\n\t\t\tthis._highlighter = new DocumentUnicodeHighlighter(this._editor, highlightOptions, this._updateState, this._editorWorkerService);\n\t\t} else {\n\t\t\tthis._highlighter = new ViewportUnicodeHighlighter(this._editor, highlightOptions, this._updateState);\n\t\t}\n\t}\n\n\tpublic getDecorationInfo(decorationId: string): UnicodeHighlighterDecorationInfo | null {\n\t\tif (this._highlighter) {\n\t\t\treturn this._highlighter.getDecorationInfo(decorationId);\n\t\t}\n\t\treturn null;\n\t}\n}\n\nexport interface UnicodeHighlighterDecorationInfo {\n\treason: UnicodeHighlighterReason;\n\tinComment: boolean;\n\tinString: boolean;\n}\n\ntype Resolve<T> =\n\tT extends InUntrustedWorkspace ? never\n\t: T extends 'auto' ? never : T;\n\ntype ResolvedOptions = { [TKey in keyof InternalUnicodeHighlightOptions]: Resolve<InternalUnicodeHighlightOptions[TKey]> };\n\nfunction resolveOptions(trusted: boolean, options: InternalUnicodeHighlightOptions): ResolvedOptions {\n\treturn {\n\t\tnonBasicASCII: options.nonBasicASCII === inUntrustedWorkspace ? !trusted : options.nonBasicASCII,\n\t\tambiguousCharacters: options.ambiguousCharacters,\n\t\tinvisibleCharacters: options.invisibleCharacters,\n\t\tincludeComments: options.includeComments === inUntrustedWorkspace ? !trusted : options.includeComments,\n\t\tincludeStrings: options.includeStrings === inUntrustedWorkspace ? !trusted : options.includeStrings,\n\t\tallowedCharacters: options.allowedCharacters,\n\t\tallowedLocales: options.allowedLocales,\n\t};\n}\n\nclass DocumentUnicodeHighlighter extends Disposable {\n\tprivate readonly _model: ITextModel = this._editor.getModel();\n\tprivate readonly _updateSoon: RunOnceScheduler;\n\tprivate _decorationIds = new Set<string>();\n\n\tconstructor(\n\t\tprivate readonly _editor: IActiveCodeEditor,\n\t\tprivate readonly _options: UnicodeHighlighterOptions,\n\t\tprivate readonly _updateState: (state: IUnicodeHighlightsResult | null) => void,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t) {\n\t\tsuper();\n\t\tthis._updateSoon = this._register(new RunOnceScheduler(() => this._update(), 250));\n\n\t\tthis._register(this._editor.onDidChangeModelContent(() => {\n\t\t\tthis._updateSoon.schedule();\n\t\t}));\n\n\t\tthis._updateSoon.schedule();\n\t}\n\n\tpublic override dispose() {\n\t\tthis._decorationIds = new Set(this._model.deltaDecorations(Array.from(this._decorationIds), []));\n\t\tsuper.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tif (this._model.isDisposed()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._model.mightContainNonBasicASCII()) {\n\t\t\tthis._decorationIds = new Set(this._editor.deltaDecorations(Array.from(this._decorationIds), []));\n\t\t\treturn;\n\t\t}\n\n\t\tconst modelVersionId = this._model.getVersionId();\n\t\tthis._editorWorkerService\n\t\t\t.computedUnicodeHighlights(this._model.uri, this._options)\n\t\t\t.then((info) => {\n\t\t\t\tif (this._model.isDisposed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this._model.getVersionId() !== modelVersionId) {\n\t\t\t\t\t// model changed in the meantime\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._updateState(info);\n\n\t\t\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\t\t\tif (!info.hasMore) {\n\t\t\t\t\t// Don't show decoration if there are too many.\n\t\t\t\t\t// In this case, a banner is shown.\n\t\t\t\t\tfor (const range of info.ranges) {\n\t\t\t\t\t\tdecorations.push({\n\t\t\t\t\t\t\trange: range,\n\t\t\t\t\t\t\toptions: Decorations.instance.getDecorationFromOptions(this._options),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._decorationIds = new Set(this._editor.deltaDecorations(\n\t\t\t\t\tArray.from(this._decorationIds),\n\t\t\t\t\tdecorations\n\t\t\t\t));\n\t\t\t});\n\t}\n\n\tpublic getDecorationInfo(decorationId: string): UnicodeHighlighterDecorationInfo | null {\n\t\tif (!this._decorationIds.has(decorationId)) {\n\t\t\treturn null;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\tconst range = model.getDecorationRange(decorationId)!;\n\t\tconst decoration = {\n\t\t\trange: range,\n\t\t\toptions: Decorations.instance.getDecorationFromOptions(this._options),\n\t\t\tid: decorationId,\n\t\t\townerId: 0,\n\t\t};\n\t\tif (\n\t\t\t!isModelDecorationVisible(model, decoration)\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\tconst text = model.getValueInRange(range);\n\t\treturn {\n\t\t\treason: computeReason(text, this._options)!,\n\t\t\tinComment: isModelDecorationInComment(model, decoration),\n\t\t\tinString: isModelDecorationInString(model, decoration),\n\t\t};\n\t}\n}\n\nclass ViewportUnicodeHighlighter extends Disposable {\n\n\tprivate readonly _model: ITextModel = this._editor.getModel();\n\tprivate readonly _updateSoon: RunOnceScheduler;\n\tprivate _decorationIds = new Set<string>();\n\n\tconstructor(\n\t\tprivate readonly _editor: IActiveCodeEditor,\n\t\tprivate readonly _options: UnicodeHighlighterOptions,\n\t\tprivate readonly _updateState: (state: IUnicodeHighlightsResult | null) => void,\n\t) {\n\t\tsuper();\n\n\t\tthis._updateSoon = this._register(new RunOnceScheduler(() => this._update(), 250));\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tthis._updateSoon.schedule();\n\t\t}));\n\t\tthis._register(this._editor.onDidScrollChange(() => {\n\t\t\tthis._updateSoon.schedule();\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeHiddenAreas(() => {\n\t\t\tthis._updateSoon.schedule();\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeModelContent(() => {\n\t\t\tthis._updateSoon.schedule();\n\t\t}));\n\n\t\tthis._updateSoon.schedule();\n\t}\n\n\tpublic override dispose() {\n\t\tthis._decorationIds = new Set(this._model.deltaDecorations(Array.from(this._decorationIds), []));\n\t\tsuper.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tif (this._model.isDisposed()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._model.mightContainNonBasicASCII()) {\n\t\t\tthis._decorationIds = new Set(this._editor.deltaDecorations(Array.from(this._decorationIds), []));\n\t\t\treturn;\n\t\t}\n\n\t\tconst ranges = this._editor.getVisibleRanges();\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\tconst totalResult: IUnicodeHighlightsResult = {\n\t\t\tranges: [],\n\t\t\tambiguousCharacterCount: 0,\n\t\t\tinvisibleCharacterCount: 0,\n\t\t\tnonBasicAsciiCharacterCount: 0,\n\t\t\thasMore: false,\n\t\t};\n\t\tfor (const range of ranges) {\n\t\t\tconst result = UnicodeTextModelHighlighter.computeUnicodeHighlights(this._model, this._options, range);\n\t\t\tfor (const r of result.ranges) {\n\t\t\t\ttotalResult.ranges.push(r);\n\t\t\t}\n\t\t\ttotalResult.ambiguousCharacterCount += totalResult.ambiguousCharacterCount;\n\t\t\ttotalResult.invisibleCharacterCount += totalResult.invisibleCharacterCount;\n\t\t\ttotalResult.nonBasicAsciiCharacterCount += totalResult.nonBasicAsciiCharacterCount;\n\t\t\ttotalResult.hasMore = totalResult.hasMore || result.hasMore;\n\t\t}\n\n\t\tif (!totalResult.hasMore) {\n\t\t\t// Don't show decorations if there are too many.\n\t\t\t// A banner will be shown instead.\n\t\t\tfor (const range of totalResult.ranges) {\n\t\t\t\tdecorations.push({ range, options: Decorations.instance.getDecorationFromOptions(this._options) });\n\t\t\t}\n\t\t}\n\t\tthis._updateState(totalResult);\n\n\t\tthis._decorationIds = new Set(this._editor.deltaDecorations(Array.from(this._decorationIds), decorations));\n\t}\n\n\tpublic getDecorationInfo(decorationId: string): UnicodeHighlighterDecorationInfo | null {\n\t\tif (!this._decorationIds.has(decorationId)) {\n\t\t\treturn null;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\tconst range = model.getDecorationRange(decorationId)!;\n\t\tconst text = model.getValueInRange(range);\n\t\tconst decoration = {\n\t\t\trange: range,\n\t\t\toptions: Decorations.instance.getDecorationFromOptions(this._options),\n\t\t\tid: decorationId,\n\t\t\townerId: 0,\n\t\t};\n\t\tif (!isModelDecorationVisible(model, decoration)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\treason: computeReason(text, this._options)!,\n\t\t\tinComment: isModelDecorationInComment(model, decoration),\n\t\t\tinString: isModelDecorationInString(model, decoration),\n\t\t};\n\t}\n}\n\nexport class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipant<MarkdownHover> {\n\n\tpublic readonly hoverOrdinal: number = 4;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t) {\n\t}\n\n\tcomputeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): MarkdownHover[] {\n\t\tif (!this._editor.hasModel() || anchor.type !== HoverAnchorType.Range) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\n\t\tconst unicodeHighlighter = this._editor.getContribution<UnicodeHighlighter>(UnicodeHighlighter.ID);\n\t\tif (!unicodeHighlighter) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst result: MarkdownHover[] = [];\n\t\tlet index = 300;\n\t\tfor (const d of lineDecorations) {\n\n\t\t\tconst highlightInfo = unicodeHighlighter.getDecorationInfo(d.id);\n\t\t\tif (!highlightInfo) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst char = model.getValueInRange(d.range);\n\t\t\t// text refers to a single character.\n\t\t\tconst codePoint = char.codePointAt(0)!;\n\n\t\t\tconst codePointStr = formatCodePointMarkdown(codePoint);\n\n\t\t\tlet reason: string;\n\t\t\tswitch (highlightInfo.reason.kind) {\n\t\t\t\tcase UnicodeHighlighterReasonKind.Ambiguous:\n\t\t\t\t\treason = nls.localize(\n\t\t\t\t\t\t'unicodeHighlight.characterIsAmbiguous',\n\t\t\t\t\t\t'The character {0} could be confused with the character {1}, which is more common in source code.',\n\t\t\t\t\t\tcodePointStr,\n\t\t\t\t\t\tformatCodePointMarkdown(highlightInfo.reason.confusableWith.codePointAt(0)!)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase UnicodeHighlighterReasonKind.Invisible:\n\t\t\t\t\treason = nls.localize(\n\t\t\t\t\t\t'unicodeHighlight.characterIsInvisible',\n\t\t\t\t\t\t'The character {0} is invisible.',\n\t\t\t\t\t\tcodePointStr\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase UnicodeHighlighterReasonKind.NonBasicAscii:\n\t\t\t\t\treason = nls.localize(\n\t\t\t\t\t\t'unicodeHighlight.characterIsNonBasicAscii',\n\t\t\t\t\t\t'The character {0} is not a basic ASCII character.',\n\t\t\t\t\t\tcodePointStr\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst adjustSettingsArgs: ShowExcludeOptionsArgs = {\n\t\t\t\tcodePoint: codePoint,\n\t\t\t\treason: highlightInfo.reason,\n\t\t\t\tinComment: highlightInfo.inComment,\n\t\t\t\tinString: highlightInfo.inString,\n\t\t\t};\n\n\t\t\tconst adjustSettings = nls.localize('unicodeHighlight.adjustSettings', 'Adjust settings');\n\t\t\tconst contents: Array<IMarkdownString> = [{\n\t\t\t\tvalue: `${reason} [${adjustSettings}](command:${ShowExcludeOptions.ID}?${encodeURIComponent(JSON.stringify(adjustSettingsArgs))})`,\n\t\t\t\tisTrusted: true,\n\t\t\t}];\n\n\t\t\tresult.push(new MarkdownHover(this, d.range, contents, index++));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic renderHoverParts(context: IEditorHoverRenderContext, hoverParts: MarkdownHover[]): IDisposable {\n\t\treturn renderMarkdownHovers(context, hoverParts, this._editor, this._languageService, this._openerService);\n\t}\n}\n\nfunction codePointToHex(codePoint: number): string {\n\treturn `U+${codePoint.toString(16).padStart(4, '0')}`;\n}\n\nfunction formatCodePointMarkdown(codePoint: number) {\n\tlet value = `\\`${codePointToHex(codePoint)}\\``;\n\tif (!InvisibleCharacters.isInvisibleCharacter(codePoint)) {\n\t\t// Don't render any control characters or any invisible characters, as they cannot be seen anyways.\n\t\tvalue += ` \"${`${renderCodePointAsInlineCode(codePoint)}`}\"`;\n\t}\n\treturn value;\n}\n\nfunction renderCodePointAsInlineCode(codePoint: number): string {\n\tif (codePoint === CharCode.BackTick) {\n\t\treturn '`` ` ``';\n\t}\n\treturn '`' + String.fromCodePoint(codePoint) + '`';\n}\n\nfunction computeReason(char: string, options: UnicodeHighlighterOptions): UnicodeHighlighterReason | null {\n\treturn UnicodeTextModelHighlighter.computeUnicodeHighlightReason(char, options);\n}\n\nclass Decorations {\n\tpublic static readonly instance = new Decorations();\n\n\tprivate readonly map = new Map<string, ModelDecorationOptions>();\n\n\tgetDecorationFromOptions(options: UnicodeHighlighterOptions): ModelDecorationOptions {\n\t\treturn this.getDecoration(!options.includeComments, !options.includeStrings);\n\t}\n\n\tprivate getDecoration(hideInComments: boolean, hideInStrings: boolean): ModelDecorationOptions {\n\t\tconst key = `${hideInComments}${hideInStrings}`;\n\t\tlet options = this.map.get(key);\n\t\tif (!options) {\n\t\t\toptions = ModelDecorationOptions.createDynamic({\n\t\t\t\tdescription: 'unicode-highlight',\n\t\t\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\t\t\tclassName: 'unicode-highlight',\n\t\t\t\tshowIfCollapsed: true,\n\t\t\t\toverviewRuler: null,\n\t\t\t\tminimap: null,\n\t\t\t\thideInCommentTokens: hideInComments,\n\t\t\t\thideInStringTokens: hideInStrings,\n\t\t\t});\n\t\t\tthis.map.set(key, options);\n\t\t}\n\t\treturn options;\n\t}\n}\n\ninterface IDisableUnicodeHighlightAction {\n}\n\nexport class DisableHighlightingInCommentsAction extends EditorAction implements IDisableUnicodeHighlightAction {\n\tpublic readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingInComments.shortLabel', 'Disable Highlight In Comments');\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DisableHighlightingOfAmbiguousCharactersAction.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.disableHighlightingInComments', 'Disable highlighting of characters in comments'),\n\t\t\talias: 'Disable highlighting of characters in comments',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tlet configurationService = accessor?.get(IConfigurationService);\n\t\tif (configurationService) {\n\t\t\tthis.runAction(configurationService);\n\t\t}\n\t}\n\n\tpublic async runAction(configurationService: IConfigurationService): Promise<void> {\n\t\tawait configurationService.updateValue(unicodeHighlightConfigKeys.includeComments, false, ConfigurationTarget.USER);\n\t}\n}\n\nexport class DisableHighlightingInStringsAction extends EditorAction implements IDisableUnicodeHighlightAction {\n\tpublic readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingInStrings.shortLabel', 'Disable Highlight In Strings');\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DisableHighlightingOfAmbiguousCharactersAction.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.disableHighlightingInStrings', 'Disable highlighting of characters in strings'),\n\t\t\talias: 'Disable highlighting of characters in strings',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tlet configurationService = accessor?.get(IConfigurationService);\n\t\tif (configurationService) {\n\t\t\tthis.runAction(configurationService);\n\t\t}\n\t}\n\n\tpublic async runAction(configurationService: IConfigurationService): Promise<void> {\n\t\tawait configurationService.updateValue(unicodeHighlightConfigKeys.includeStrings, false, ConfigurationTarget.USER);\n\t}\n}\n\nexport class DisableHighlightingOfAmbiguousCharactersAction extends EditorAction implements IDisableUnicodeHighlightAction {\n\tpublic static ID = 'editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters';\n\tpublic readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel', 'Disable Ambiguous Highlight');\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DisableHighlightingOfAmbiguousCharactersAction.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters', 'Disable highlighting of ambiguous characters'),\n\t\t\talias: 'Disable highlighting of ambiguous characters',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tlet configurationService = accessor?.get(IConfigurationService);\n\t\tif (configurationService) {\n\t\t\tthis.runAction(configurationService);\n\t\t}\n\t}\n\n\tpublic async runAction(configurationService: IConfigurationService): Promise<void> {\n\t\tawait configurationService.updateValue(unicodeHighlightConfigKeys.ambiguousCharacters, false, ConfigurationTarget.USER);\n\t}\n}\n\nexport class DisableHighlightingOfInvisibleCharactersAction extends EditorAction implements IDisableUnicodeHighlightAction {\n\tpublic static ID = 'editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters';\n\tpublic readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel', 'Disable Invisible Highlight');\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DisableHighlightingOfInvisibleCharactersAction.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.disableHighlightingOfInvisibleCharacters', 'Disable highlighting of invisible characters'),\n\t\t\talias: 'Disable highlighting of invisible characters',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tlet configurationService = accessor?.get(IConfigurationService);\n\t\tif (configurationService) {\n\t\t\tthis.runAction(configurationService);\n\t\t}\n\t}\n\n\tpublic async runAction(configurationService: IConfigurationService): Promise<void> {\n\t\tawait configurationService.updateValue(unicodeHighlightConfigKeys.invisibleCharacters, false, ConfigurationTarget.USER);\n\t}\n}\n\nexport class DisableHighlightingOfNonBasicAsciiCharactersAction extends EditorAction implements IDisableUnicodeHighlightAction {\n\tpublic static ID = 'editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters';\n\tpublic readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel', 'Disable Non ASCII Highlight');\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: DisableHighlightingOfNonBasicAsciiCharactersAction.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters', 'Disable highlighting of non basic ASCII characters'),\n\t\t\talias: 'Disable highlighting of non basic ASCII characters',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tlet configurationService = accessor?.get(IConfigurationService);\n\t\tif (configurationService) {\n\t\t\tthis.runAction(configurationService);\n\t\t}\n\t}\n\n\tpublic async runAction(configurationService: IConfigurationService): Promise<void> {\n\t\tawait configurationService.updateValue(unicodeHighlightConfigKeys.nonBasicASCII, false, ConfigurationTarget.USER);\n\t}\n}\n\ninterface ShowExcludeOptionsArgs {\n\tcodePoint: number;\n\treason: UnicodeHighlighterReason;\n\tinComment: boolean;\n\tinString: boolean;\n}\n\nexport class ShowExcludeOptions extends EditorAction {\n\tpublic static ID = 'editor.action.unicodeHighlight.showExcludeOptions';\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowExcludeOptions.ID,\n\t\t\tlabel: nls.localize('action.unicodeHighlight.showExcludeOptions', \"Show Exclude Options\"),\n\t\t\talias: 'Show Exclude Options',\n\t\t\tprecondition: undefined\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor, args: any): Promise<void> {\n\t\tconst { codePoint, reason, inString, inComment } = args as ShowExcludeOptionsArgs;\n\n\t\tconst char = String.fromCodePoint(codePoint);\n\n\t\tconst quickPickService = accessor!.get(IQuickInputService);\n\t\tconst configurationService = accessor!.get(IConfigurationService);\n\n\t\tinterface ExtendedOptions extends IQuickPickItem {\n\t\t\trun(): Promise<void>;\n\t\t}\n\n\t\tfunction getExcludeCharFromBeingHighlightedLabel(codePoint: number) {\n\t\t\tif (InvisibleCharacters.isInvisibleCharacter(codePoint)) {\n\t\t\t\treturn nls.localize('unicodeHighlight.excludeInvisibleCharFromBeingHighlighted', 'Exclude {0} (invisible character) from being highlighted', codePointToHex(codePoint));\n\t\t\t}\n\t\t\treturn nls.localize('unicodeHighlight.excludeCharFromBeingHighlighted', 'Exclude {0} from being highlighted', `${codePointToHex(codePoint)} \"${char}\"`);\n\t\t}\n\n\t\tconst options: ExtendedOptions[] = [];\n\n\t\tif (reason.kind === UnicodeHighlighterReasonKind.Ambiguous) {\n\t\t\tfor (const locale of reason.notAmbiguousInLocales) {\n\t\t\t\toptions.push({\n\t\t\t\t\tlabel: nls.localize(\"unicodeHighlight.allowCommonCharactersInLanguage\", \"Allow unicode characters that are more common in the language \\\"{0}\\\".\", locale),\n\t\t\t\t\trun: async () => {\n\t\t\t\t\t\texcludeLocaleFromBeingHighlighted(configurationService, [locale]);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\toptions.push(\n\t\t\t{\n\t\t\t\tlabel: getExcludeCharFromBeingHighlightedLabel(codePoint),\n\t\t\t\trun: () => excludeCharFromBeingHighlighted(configurationService, [codePoint])\n\t\t\t}\n\t\t);\n\n\t\tif (inComment) {\n\t\t\tconst action = new DisableHighlightingInCommentsAction();\n\t\t\toptions.push({ label: action.label, run: async () => action.runAction(configurationService) });\n\t\t} else if (inString) {\n\t\t\tconst action = new DisableHighlightingInStringsAction();\n\t\t\toptions.push({ label: action.label, run: async () => action.runAction(configurationService) });\n\t\t}\n\n\t\tif (reason.kind === UnicodeHighlighterReasonKind.Ambiguous) {\n\t\t\tconst action = new DisableHighlightingOfAmbiguousCharactersAction();\n\t\t\toptions.push({ label: action.label, run: async () => action.runAction(configurationService) });\n\t\t} else if (reason.kind === UnicodeHighlighterReasonKind.Invisible) {\n\t\t\tconst action = new DisableHighlightingOfInvisibleCharactersAction();\n\t\t\toptions.push({ label: action.label, run: async () => action.runAction(configurationService) });\n\t\t}\n\t\telse if (reason.kind === UnicodeHighlighterReasonKind.NonBasicAscii) {\n\t\t\tconst action = new DisableHighlightingOfNonBasicAsciiCharactersAction();\n\t\t\toptions.push({ label: action.label, run: async () => action.runAction(configurationService) });\n\t\t} else {\n\t\t\texpectNever(reason);\n\t\t}\n\n\t\tconst result = await quickPickService.pick(\n\t\t\toptions,\n\t\t\t{ title: nls.localize('unicodeHighlight.configureUnicodeHighlightOptions', 'Configure Unicode Highlight Options') }\n\t\t);\n\n\t\tif (result) {\n\t\t\tawait result.run();\n\t\t}\n\t}\n}\n\nasync function excludeCharFromBeingHighlighted(configurationService: IConfigurationService, charCodes: number[]) {\n\tconst existingValue = configurationService.getValue(unicodeHighlightConfigKeys.allowedCharacters);\n\n\tlet value: Record<string, boolean>;\n\tif ((typeof existingValue === 'object') && existingValue) {\n\t\tvalue = existingValue as any;\n\t} else {\n\t\tvalue = {};\n\t}\n\n\tfor (const charCode of charCodes) {\n\t\tvalue[String.fromCodePoint(charCode)] = true;\n\t}\n\n\tawait configurationService.updateValue(unicodeHighlightConfigKeys.allowedCharacters, value, ConfigurationTarget.USER);\n}\n\nasync function excludeLocaleFromBeingHighlighted(configurationService: IConfigurationService, locales: string[]) {\n\tconst existingValue = configurationService.inspect(unicodeHighlightConfigKeys.allowedLocales).user?.value;\n\n\tlet value: Record<string, boolean>;\n\tif ((typeof existingValue === 'object') && existingValue) {\n\t\t// Copy value, as the existing value is read only\n\t\tvalue = Object.assign({}, existingValue as any);\n\t} else {\n\t\tvalue = {};\n\t}\n\n\tfor (const locale of locales) {\n\t\tvalue[locale] = true;\n\t}\n\n\tawait configurationService.updateValue(unicodeHighlightConfigKeys.allowedLocales, value, ConfigurationTarget.USER);\n}\n\nfunction expectNever(value: never) {\n\tthrow new Error(`Unexpected value: ${value}`);\n}\n\nregisterEditorAction(DisableHighlightingOfAmbiguousCharactersAction);\nregisterEditorAction(DisableHighlightingOfInvisibleCharactersAction);\nregisterEditorAction(DisableHighlightingOfNonBasicAsciiCharactersAction);\nregisterEditorAction(ShowExcludeOptions);\nregisterEditorContribution(UnicodeHighlighter.ID, UnicodeHighlighter);\nHoverParticipantRegistry.register(UnicodeHighlighterHoverParticipant);\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 'vs/editor/browser/coreCommands';\nimport 'vs/editor/browser/widget/codeEditorWidget';\nimport 'vs/editor/browser/widget/diffEditorWidget';\nimport 'vs/editor/browser/widget/diffNavigator';\nimport 'vs/editor/contrib/anchorSelect/browser/anchorSelect';\nimport 'vs/editor/contrib/bracketMatching/browser/bracketMatching';\nimport 'vs/editor/contrib/caretOperations/browser/caretOperations';\nimport 'vs/editor/contrib/caretOperations/browser/transpose';\nimport 'vs/editor/contrib/clipboard/browser/clipboard';\nimport 'vs/editor/contrib/codeAction/browser/codeActionContributions';\nimport 'vs/editor/contrib/codelens/browser/codelensController';\nimport 'vs/editor/contrib/colorPicker/browser/colorContributions';\nimport 'vs/editor/contrib/comment/browser/comment';\nimport 'vs/editor/contrib/contextmenu/browser/contextmenu';\nimport 'vs/editor/contrib/cursorUndo/browser/cursorUndo';\nimport 'vs/editor/contrib/dnd/browser/dnd';\nimport 'vs/editor/contrib/find/browser/findController';\nimport 'vs/editor/contrib/folding/browser/folding';\nimport 'vs/editor/contrib/fontZoom/browser/fontZoom';\nimport 'vs/editor/contrib/format/browser/formatActions';\nimport 'vs/editor/contrib/documentSymbols/browser/documentSymbols';\nimport 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsContribution';\nimport 'vs/editor/contrib/gotoSymbol/browser/goToCommands';\nimport 'vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition';\nimport 'vs/editor/contrib/gotoError/browser/gotoError';\nimport 'vs/editor/contrib/hover/browser/hover';\nimport 'vs/editor/contrib/indentation/browser/indentation';\nimport 'vs/editor/contrib/inlayHints/browser/inlayHintsContribution';\nimport 'vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace';\nimport 'vs/editor/contrib/lineSelection/browser/lineSelection';\nimport 'vs/editor/contrib/linesOperations/browser/linesOperations';\nimport 'vs/editor/contrib/linkedEditing/browser/linkedEditing';\nimport 'vs/editor/contrib/links/browser/links';\nimport 'vs/editor/contrib/multicursor/browser/multicursor';\nimport 'vs/editor/contrib/parameterHints/browser/parameterHints';\nimport 'vs/editor/contrib/rename/browser/rename';\nimport 'vs/editor/contrib/smartSelect/browser/smartSelect';\nimport 'vs/editor/contrib/snippet/browser/snippetController2';\nimport 'vs/editor/contrib/suggest/browser/suggestController';\nimport 'vs/editor/contrib/tokenization/browser/tokenization';\nimport 'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode';\nimport 'vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter';\nimport 'vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators';\nimport 'vs/editor/contrib/viewportSemanticTokens/browser/viewportSemanticTokens';\nimport 'vs/editor/contrib/wordHighlighter/browser/wordHighlighter';\nimport 'vs/editor/contrib/wordOperations/browser/wordOperations';\nimport 'vs/editor/contrib/wordPartOperations/browser/wordPartOperations';\n\n// Load up these strings even in VSCode, even if they are not used\n// in order to get them translated\nimport 'vs/editor/common/standaloneStrings';\n\nimport 'vs/base/browser/ui/codicons/codiconStyles'; // The codicons are defined here and must be loaded\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 'vs/editor/common/languages/languageConfigurationRegistry';\nimport 'vs/editor/standalone/browser/standaloneCodeEditorService';\nimport 'vs/editor/standalone/browser/standaloneLayoutService';\nimport 'vs/platform/undoRedo/common/undoRedoService';\nimport 'vs/editor/common/services/languageFeatureDebounce';\n\nimport * as strings from 'vs/base/common/strings';\nimport * as dom from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { ResolvedKeybinding, SimpleKeybinding, createKeybinding } from 'vs/base/common/keybindings';\nimport { IDisposable, IReference, ImmortalReference, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle';\nimport { OS, isLinux, isMacintosh } from 'vs/base/common/platform';\nimport Severity from 'vs/base/common/severity';\nimport { URI } from 'vs/base/common/uri';\nimport { IBulkEditOptions, IBulkEditResult, IBulkEditService, ResourceEdit, ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService';\nimport { isDiffEditorConfigurationKey, isEditorConfigurationKey } from 'vs/editor/common/config/editorConfigurationSchema';\nimport { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation';\nimport { IPosition, Position as Pos } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { ITextResourceConfigurationService, ITextResourcePropertiesService, ITextResourceConfigurationChangeEvent } from 'vs/editor/common/services/textResourceConfiguration';\nimport { CommandsRegistry, ICommandEvent, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationChangeEvent, IConfigurationOverrides, IConfigurationService, IConfigurationValue, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';\nimport { Configuration, ConfigurationModel, DefaultConfigurationModel, ConfigurationChangeEvent } from 'vs/platform/configuration/common/configurationModels';\nimport { IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';\nimport { IConfirmation, IConfirmationResult, IDialogOptions, IDialogService, IShowResult } from 'vs/platform/dialogs/common/dialogs';\nimport { createDecorator, IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';\nimport { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService';\nimport { IKeybindingEvent, IKeybindingService, IKeyboardEvent, KeybindingSource } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver';\nimport { IKeybindingItem, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\nimport { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { INotification, INotificationHandle, INotificationService, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification';\nimport { IProgressRunner, IEditorProgressService } from 'vs/platform/progress/common/progress';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { IWorkspace, IWorkspaceContextService, WorkspaceFolder } from 'vs/platform/workspace/common/workspace';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { StandaloneServicesNLS } from 'vs/editor/common/standaloneStrings';\nimport { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ConsoleLogger, ILogService, LogService } from 'vs/platform/log/common/log';\nimport { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust';\nimport { EditorOption } from 'vs/editor/common/config/editorOptions';\nimport { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { IContextMenuService, IContextViewDelegate, IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';\nimport { LanguageService } from 'vs/editor/common/services/languageService';\nimport { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { getSingletonServiceDescriptors, registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { OpenerService } from 'vs/editor/browser/services/openerService';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { EditorWorkerService } from 'vs/editor/browser/services/editorWorkerService';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { MarkerDecorationsService } from 'vs/editor/common/services/markerDecorationsService';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations';\nimport { ModelService } from 'vs/editor/common/services/modelService';\nimport { StandaloneQuickInputService } from 'vs/editor/standalone/browser/quickInput/standaloneQuickInputService';\nimport { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { AccessibilityService } from 'vs/platform/accessibility/browser/accessibilityService';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { IMenuService } from 'vs/platform/actions/common/actions';\nimport { MenuService } from 'vs/platform/actions/common/menuService';\nimport { BrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';\nimport { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';\nimport { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\nimport { IListService, ListService } from 'vs/platform/list/browser/listService';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { MarkerService } from 'vs/platform/markers/common/markerService';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';\nimport { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage';\n\nimport 'vs/editor/common/services/languageFeaturesService';\n\nclass SimpleModel implements IResolvedTextEditorModel {\n\n\tprivate readonly model: ITextModel;\n\tprivate readonly _onWillDispose: Emitter<void>;\n\n\tconstructor(model: ITextModel) {\n\t\tthis.model = model;\n\t\tthis._onWillDispose = new Emitter<void>();\n\t}\n\n\tpublic get textEditorModel(): ITextModel {\n\t\treturn this.model;\n\t}\n\n\tprivate disposed = false;\n\tpublic dispose(): void {\n\t\tthis.disposed = true;\n\n\t\tthis._onWillDispose.fire();\n\t}\n}\n\nclass StandaloneTextModelService implements ITextModelService {\n\tpublic _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IModelService private readonly modelService: IModelService\n\t) { }\n\n\tpublic createModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>> {\n\t\tconst model = this.modelService.getModel(resource);\n\n\t\tif (!model) {\n\t\t\treturn Promise.reject(new Error(`Model not found`));\n\t\t}\n\n\t\treturn Promise.resolve(new ImmortalReference(new SimpleModel(model)));\n\t}\n}\n\nclass StandaloneEditorProgressService implements IEditorProgressService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate static NULL_PROGRESS_RUNNER: IProgressRunner = {\n\t\tdone: () => { },\n\t\ttotal: () => { },\n\t\tworked: () => { }\n\t};\n\n\tshow(infinite: true, delay?: number): IProgressRunner;\n\tshow(total: number, delay?: number): IProgressRunner;\n\tshow(): IProgressRunner {\n\t\treturn StandaloneEditorProgressService.NULL_PROGRESS_RUNNER;\n\t}\n\n\tasync showWhile(promise: Promise<any>, delay?: number): Promise<void> {\n\t\tawait promise;\n\t}\n}\n\nclass StandaloneDialogService implements IDialogService {\n\n\tpublic _serviceBrand: undefined;\n\n\tpublic confirm(confirmation: IConfirmation): Promise<IConfirmationResult> {\n\t\treturn this.doConfirm(confirmation).then(confirmed => {\n\t\t\treturn {\n\t\t\t\tconfirmed,\n\t\t\t\tcheckboxChecked: false // unsupported\n\t\t\t} as IConfirmationResult;\n\t\t});\n\t}\n\n\tprivate doConfirm(confirmation: IConfirmation): Promise<boolean> {\n\t\tlet messageText = confirmation.message;\n\t\tif (confirmation.detail) {\n\t\t\tmessageText = messageText + '\\n\\n' + confirmation.detail;\n\t\t}\n\n\t\treturn Promise.resolve(window.confirm(messageText));\n\t}\n\n\tpublic show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult> {\n\t\treturn Promise.resolve({ choice: 0 });\n\t}\n}\n\nexport class StandaloneNotificationService implements INotificationService {\n\n\tpublic _serviceBrand: undefined;\n\n\tprivate static readonly NO_OP: INotificationHandle = new NoOpNotification();\n\n\tpublic info(message: string): INotificationHandle {\n\t\treturn this.notify({ severity: Severity.Info, message });\n\t}\n\n\tpublic warn(message: string): INotificationHandle {\n\t\treturn this.notify({ severity: Severity.Warning, message });\n\t}\n\n\tpublic error(error: string | Error): INotificationHandle {\n\t\treturn this.notify({ severity: Severity.Error, message: error });\n\t}\n\n\tpublic notify(notification: INotification): INotificationHandle {\n\t\tswitch (notification.severity) {\n\t\t\tcase Severity.Error:\n\t\t\t\tconsole.error(notification.message);\n\t\t\t\tbreak;\n\t\t\tcase Severity.Warning:\n\t\t\t\tconsole.warn(notification.message);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(notification.message);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn StandaloneNotificationService.NO_OP;\n\t}\n\n\tpublic status(message: string | Error, options?: IStatusMessageOptions): IDisposable {\n\t\treturn Disposable.None;\n\t}\n}\n\nexport class StandaloneCommandService implements ICommandService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _instantiationService: IInstantiationService;\n\n\tprivate readonly _onWillExecuteCommand = new Emitter<ICommandEvent>();\n\tprivate readonly _onDidExecuteCommand = new Emitter<ICommandEvent>();\n\tpublic readonly onWillExecuteCommand: Event<ICommandEvent> = this._onWillExecuteCommand.event;\n\tpublic readonly onDidExecuteCommand: Event<ICommandEvent> = this._onDidExecuteCommand.event;\n\n\tconstructor(\n\t\t@IInstantiationService instantiationService: IInstantiationService\n\t) {\n\t\tthis._instantiationService = instantiationService;\n\t}\n\n\tpublic executeCommand<T>(id: string, ...args: any[]): Promise<T> {\n\t\tconst command = CommandsRegistry.getCommand(id);\n\t\tif (!command) {\n\t\t\treturn Promise.reject(new Error(`command '${id}' not found`));\n\t\t}\n\n\t\ttry {\n\t\t\tthis._onWillExecuteCommand.fire({ commandId: id, args });\n\t\t\tconst result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler, ...args]) as T;\n\n\t\t\tthis._onDidExecuteCommand.fire({ commandId: id, args });\n\t\t\treturn Promise.resolve(result);\n\t\t} catch (err) {\n\t\t\treturn Promise.reject(err);\n\t\t}\n\t}\n}\n\nexport class StandaloneKeybindingService extends AbstractKeybindingService {\n\tprivate _cachedResolver: KeybindingResolver | null;\n\tprivate readonly _dynamicKeybindings: IKeybindingItem[];\n\tprivate readonly _domNodeListeners: DomNodeListeners[];\n\n\tconstructor(\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@ILogService logService: ILogService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService\n\t) {\n\t\tsuper(contextKeyService, commandService, telemetryService, notificationService, logService);\n\n\t\tthis._cachedResolver = null;\n\t\tthis._dynamicKeybindings = [];\n\t\tthis._domNodeListeners = [];\n\n\t\tconst addContainer = (domNode: HTMLElement) => {\n\t\t\tconst disposables = new DisposableStore();\n\n\t\t\t// for standard keybindings\n\t\t\tdisposables.add(dom.addDisposableListener(domNode, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\t\tconst keyEvent = new StandardKeyboardEvent(e);\n\t\t\t\tconst shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target);\n\t\t\t\tif (shouldPreventDefault) {\n\t\t\t\t\tkeyEvent.preventDefault();\n\t\t\t\t\tkeyEvent.stopPropagation();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\t// for single modifier chord keybindings (e.g. shift shift)\n\t\t\tdisposables.add(dom.addDisposableListener(domNode, dom.EventType.KEY_UP, (e: KeyboardEvent) => {\n\t\t\t\tconst keyEvent = new StandardKeyboardEvent(e);\n\t\t\t\tconst shouldPreventDefault = this._singleModifierDispatch(keyEvent, keyEvent.target);\n\t\t\t\tif (shouldPreventDefault) {\n\t\t\t\t\tkeyEvent.preventDefault();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis._domNodeListeners.push(new DomNodeListeners(domNode, disposables));\n\t\t};\n\t\tconst removeContainer = (domNode: HTMLElement) => {\n\t\t\tfor (let i = 0; i < this._domNodeListeners.length; i++) {\n\t\t\t\tconst domNodeListeners = this._domNodeListeners[i];\n\t\t\t\tif (domNodeListeners.domNode === domNode) {\n\t\t\t\t\tthis._domNodeListeners.splice(i, 1);\n\t\t\t\t\tdomNodeListeners.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst addCodeEditor = (codeEditor: ICodeEditor) => {\n\t\t\tif (codeEditor.getOption(EditorOption.inDiffEditor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\taddContainer(codeEditor.getContainerDomNode());\n\t\t};\n\t\tconst removeCodeEditor = (codeEditor: ICodeEditor) => {\n\t\t\tif (codeEditor.getOption(EditorOption.inDiffEditor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveContainer(codeEditor.getContainerDomNode());\n\t\t};\n\t\tthis._register(codeEditorService.onCodeEditorAdd(addCodeEditor));\n\t\tthis._register(codeEditorService.onCodeEditorRemove(removeCodeEditor));\n\t\tcodeEditorService.listCodeEditors().forEach(addCodeEditor);\n\n\t\tconst addDiffEditor = (diffEditor: IDiffEditor) => {\n\t\t\taddContainer(diffEditor.getContainerDomNode());\n\t\t};\n\t\tconst removeDiffEditor = (diffEditor: IDiffEditor) => {\n\t\t\tremoveContainer(diffEditor.getContainerDomNode());\n\t\t};\n\t\tthis._register(codeEditorService.onDiffEditorAdd(addDiffEditor));\n\t\tthis._register(codeEditorService.onDiffEditorRemove(removeDiffEditor));\n\t\tcodeEditorService.listDiffEditors().forEach(addDiffEditor);\n\t}\n\n\tpublic addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpression | undefined): IDisposable {\n\t\tconst keybinding = createKeybinding(_keybinding, OS);\n\n\t\tconst toDispose = new DisposableStore();\n\n\t\tif (keybinding) {\n\t\t\tthis._dynamicKeybindings.push({\n\t\t\t\tkeybinding: keybinding.parts,\n\t\t\t\tcommand: commandId,\n\t\t\t\twhen: when,\n\t\t\t\tweight1: 1000,\n\t\t\t\tweight2: 0,\n\t\t\t\textensionId: null,\n\t\t\t\tisBuiltinExtension: false\n\t\t\t});\n\n\t\t\ttoDispose.add(toDisposable(() => {\n\t\t\t\tfor (let i = 0; i < this._dynamicKeybindings.length; i++) {\n\t\t\t\t\tconst kb = this._dynamicKeybindings[i];\n\t\t\t\t\tif (kb.command === commandId) {\n\t\t\t\t\t\tthis._dynamicKeybindings.splice(i, 1);\n\t\t\t\t\t\tthis.updateResolver({ source: KeybindingSource.Default });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\ttoDispose.add(CommandsRegistry.registerCommand(commandId, handler));\n\n\t\tthis.updateResolver({ source: KeybindingSource.Default });\n\n\t\treturn toDispose;\n\t}\n\n\tprivate updateResolver(event: IKeybindingEvent): void {\n\t\tthis._cachedResolver = null;\n\t\tthis._onDidUpdateKeybindings.fire(event);\n\t}\n\n\tprotected _getResolver(): KeybindingResolver {\n\t\tif (!this._cachedResolver) {\n\t\t\tconst defaults = this._toNormalizedKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true);\n\t\t\tconst overrides = this._toNormalizedKeybindingItems(this._dynamicKeybindings, false);\n\t\t\tthis._cachedResolver = new KeybindingResolver(defaults, overrides, (str) => this._log(str));\n\t\t}\n\t\treturn this._cachedResolver;\n\t}\n\n\tprotected _documentHasFocus(): boolean {\n\t\treturn document.hasFocus();\n\t}\n\n\tprivate _toNormalizedKeybindingItems(items: IKeybindingItem[], isDefault: boolean): ResolvedKeybindingItem[] {\n\t\tconst result: ResolvedKeybindingItem[] = [];\n\t\tlet resultLen = 0;\n\t\tfor (const item of items) {\n\t\t\tconst when = item.when || undefined;\n\t\t\tconst keybinding = item.keybinding;\n\n\t\t\tif (!keybinding) {\n\t\t\t\t// This might be a removal keybinding item in user settings => accept it\n\t\t\t\tresult[resultLen++] = new ResolvedKeybindingItem(undefined, item.command, item.commandArgs, when, isDefault, null, false);\n\t\t\t} else {\n\t\t\t\tconst resolvedKeybindings = USLayoutResolvedKeybinding.resolveUserBinding(keybinding, OS);\n\t\t\t\tfor (const resolvedKeybinding of resolvedKeybindings) {\n\t\t\t\t\tresult[resultLen++] = new ResolvedKeybindingItem(resolvedKeybinding, item.command, item.commandArgs, when, isDefault, null, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding {\n\t\tconst keybinding = new SimpleKeybinding(\n\t\t\tkeyboardEvent.ctrlKey,\n\t\t\tkeyboardEvent.shiftKey,\n\t\t\tkeyboardEvent.altKey,\n\t\t\tkeyboardEvent.metaKey,\n\t\t\tkeyboardEvent.keyCode\n\t\t).toChord();\n\t\treturn new USLayoutResolvedKeybinding(keybinding, OS);\n\t}\n}\n\nclass DomNodeListeners extends Disposable {\n\tconstructor(\n\t\tpublic readonly domNode: HTMLElement,\n\t\tdisposables: DisposableStore\n\t) {\n\t\tsuper();\n\t\tthis._register(disposables);\n\t}\n}\n\nfunction isConfigurationOverrides(thing: any): thing is IConfigurationOverrides {\n\treturn thing\n\t\t&& typeof thing === 'object'\n\t\t&& (!thing.overrideIdentifier || typeof thing.overrideIdentifier === 'string')\n\t\t&& (!thing.resource || thing.resource instanceof URI);\n}\n\nexport class StandaloneConfigurationService implements IConfigurationService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();\n\tpublic readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;\n\n\tprivate readonly _configuration: Configuration;\n\n\tconstructor() {\n\t\tthis._configuration = new Configuration(new DefaultConfigurationModel(), new ConfigurationModel());\n\t}\n\n\tgetValue<T>(): T;\n\tgetValue<T>(section: string): T;\n\tgetValue<T>(overrides: IConfigurationOverrides): T;\n\tgetValue<T>(section: string, overrides: IConfigurationOverrides): T;\n\tgetValue(arg1?: any, arg2?: any): any {\n\t\tconst section = typeof arg1 === 'string' ? arg1 : undefined;\n\t\tconst overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {};\n\t\treturn this._configuration.getValue(section, overrides, undefined);\n\t}\n\n\tpublic updateValues(values: [string, any][]): Promise<void> {\n\t\tconst previous = { data: this._configuration.toData() };\n\n\t\tconst changedKeys: string[] = [];\n\n\t\tfor (const entry of values) {\n\t\t\tconst [key, value] = entry;\n\t\t\tif (this.getValue(key) === value) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._configuration.updateValue(key, value);\n\t\t\tchangedKeys.push(key);\n\t\t}\n\n\t\tif (changedKeys.length > 0) {\n\t\t\tconst configurationChangeEvent = new ConfigurationChangeEvent({ keys: changedKeys, overrides: [] }, previous, this._configuration);\n\t\t\tconfigurationChangeEvent.source = ConfigurationTarget.MEMORY;\n\t\t\tconfigurationChangeEvent.sourceConfig = null;\n\t\t\tthis._onDidChangeConfiguration.fire(configurationChangeEvent);\n\t\t}\n\n\t\treturn Promise.resolve();\n\t}\n\n\tpublic updateValue(key: string, value: any, arg3?: any, arg4?: any): Promise<void> {\n\t\treturn this.updateValues([[key, value]]);\n\t}\n\n\tpublic inspect<C>(key: string, options: IConfigurationOverrides = {}): IConfigurationValue<C> {\n\t\treturn this._configuration.inspect<C>(key, options, undefined);\n\t}\n}\n\nclass StandaloneResourceConfigurationService implements ITextResourceConfigurationService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onDidChangeConfiguration = new Emitter<ITextResourceConfigurationChangeEvent>();\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: StandaloneConfigurationService\n\t) {\n\t\tthis.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tthis._onDidChangeConfiguration.fire({ affectedKeys: e.affectedKeys, affectsConfiguration: (resource: URI, configuration: string) => e.affectsConfiguration(configuration) });\n\t\t});\n\t}\n\n\tgetValue<T>(resource: URI, section?: string): T;\n\tgetValue<T>(resource: URI, position?: IPosition, section?: string): T;\n\tgetValue<T>(resource: any, arg2?: any, arg3?: any) {\n\t\tconst position: IPosition | null = Pos.isIPosition(arg2) ? arg2 : null;\n\t\tconst section: string | undefined = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined);\n\t\tif (typeof section === 'undefined') {\n\t\t\treturn this.configurationService.getValue<T>();\n\t\t}\n\t\treturn this.configurationService.getValue<T>(section);\n\t}\n}\n\nclass StandaloneResourcePropertiesService implements ITextResourcePropertiesService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t}\n\n\tgetEOL(resource: URI, language?: string): string {\n\t\tconst eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource });\n\t\tif (eol && typeof eol === 'string' && eol !== 'auto') {\n\t\t\treturn eol;\n\t\t}\n\t\treturn (isLinux || isMacintosh) ? '\\n' : '\\r\\n';\n\t}\n}\n\nclass StandaloneTelemetryService implements ITelemetryService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tpublic publicLog(eventName: string, data?: any): Promise<void> {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tpublicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>) {\n\t\treturn this.publicLog(eventName, data as any);\n\t}\n}\n\nclass StandaloneWorkspaceContextService implements IWorkspaceContextService {\n\n\tpublic _serviceBrand: undefined;\n\n\tprivate static readonly SCHEME = 'inmemory';\n\n\tprivate readonly workspace: IWorkspace;\n\n\tconstructor() {\n\t\tconst resource = URI.from({ scheme: StandaloneWorkspaceContextService.SCHEME, authority: 'model', path: '/' });\n\t\tthis.workspace = { id: '4064f6ec-cb38-4ad0-af64-ee6467e63c82', folders: [new WorkspaceFolder({ uri: resource, name: '', index: 0 })] };\n\t}\n\n\tpublic getWorkspace(): IWorkspace {\n\t\treturn this.workspace;\n\t}\n}\n\nexport function updateConfigurationService(configurationService: IConfigurationService, source: any, isDiffEditor: boolean): void {\n\tif (!source) {\n\t\treturn;\n\t}\n\tif (!(configurationService instanceof StandaloneConfigurationService)) {\n\t\treturn;\n\t}\n\tconst toUpdate: [string, any][] = [];\n\tObject.keys(source).forEach((key) => {\n\t\tif (isEditorConfigurationKey(key)) {\n\t\t\ttoUpdate.push([`editor.${key}`, source[key]]);\n\t\t}\n\t\tif (isDiffEditor && isDiffEditorConfigurationKey(key)) {\n\t\t\ttoUpdate.push([`diffEditor.${key}`, source[key]]);\n\t\t}\n\t});\n\tif (toUpdate.length > 0) {\n\t\tconfigurationService.updateValues(toUpdate);\n\t}\n}\n\nclass StandaloneBulkEditService implements IBulkEditService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IModelService private readonly _modelService: IModelService\n\t) {\n\t\t//\n\t}\n\n\thasPreviewHandler(): false {\n\t\treturn false;\n\t}\n\n\tasync apply(edits: ResourceEdit[], _options?: IBulkEditOptions): Promise<IBulkEditResult> {\n\n\t\tconst textEdits = new Map<ITextModel, ISingleEditOperation[]>();\n\n\t\tfor (let edit of edits) {\n\t\t\tif (!(edit instanceof ResourceTextEdit)) {\n\t\t\t\tthrow new Error('bad edit - only text edits are supported');\n\t\t\t}\n\t\t\tconst model = this._modelService.getModel(edit.resource);\n\t\t\tif (!model) {\n\t\t\t\tthrow new Error('bad edit - model not found');\n\t\t\t}\n\t\t\tif (typeof edit.versionId === 'number' && model.getVersionId() !== edit.versionId) {\n\t\t\t\tthrow new Error('bad state - model changed in the meantime');\n\t\t\t}\n\t\t\tlet array = textEdits.get(model);\n\t\t\tif (!array) {\n\t\t\t\tarray = [];\n\t\t\t\ttextEdits.set(model, array);\n\t\t\t}\n\t\t\tarray.push(EditOperation.replaceMove(Range.lift(edit.textEdit.range), edit.textEdit.text));\n\t\t}\n\n\n\t\tlet totalEdits = 0;\n\t\tlet totalFiles = 0;\n\t\tfor (const [model, edits] of textEdits) {\n\t\t\tmodel.pushStackElement();\n\t\t\tmodel.pushEditOperations([], edits, () => []);\n\t\t\tmodel.pushStackElement();\n\t\t\ttotalFiles += 1;\n\t\t\ttotalEdits += edits.length;\n\t\t}\n\n\t\treturn {\n\t\t\tariaSummary: strings.format(StandaloneServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles)\n\t\t};\n\t}\n}\n\nclass StandaloneUriLabelService implements ILabelService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tpublic getUriLabel(resource: URI, options?: { relative?: boolean; forceNoTildify?: boolean }): string {\n\t\tif (resource.scheme === 'file') {\n\t\t\treturn resource.fsPath;\n\t\t}\n\t\treturn resource.path;\n\t}\n}\n\n\nclass StandaloneContextViewService extends ContextViewService {\n\n\tconstructor(\n\t\t@ILayoutService layoutService: ILayoutService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t) {\n\t\tsuper(layoutService);\n\t}\n\n\toverride showContextView(delegate: IContextViewDelegate, container?: HTMLElement, shadowRoot?: boolean): IDisposable {\n\t\tif (!container) {\n\t\t\tconst codeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();\n\t\t\tif (codeEditor) {\n\t\t\t\tcontainer = codeEditor.getContainerDomNode();\n\t\t\t}\n\t\t}\n\t\treturn super.showContextView(delegate, container, shadowRoot);\n\t}\n}\n\nclass StandaloneWorkspaceTrustManagementService implements IWorkspaceTrustManagementService {\n\t_serviceBrand: undefined;\n\n\tprivate _neverEmitter = new Emitter<never>();\n\tpublic readonly onDidChangeTrust: Event<boolean> = this._neverEmitter.event;\n\n\tisWorkspaceTrusted(): boolean {\n\t\treturn true;\n\t}\n}\n\nclass StandaloneLanguageService extends LanguageService {\n\tconstructor() {\n\t\tsuper();\n\t}\n}\n\nclass StandaloneLogService extends LogService {\n\tconstructor() {\n\t\tsuper(new ConsoleLogger());\n\t}\n}\n\nclass StandaloneContextMenuService extends ContextMenuService {\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IContextViewService contextViewService: IContextViewService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IThemeService themeService: IThemeService\n\t) {\n\t\tsuper(telemetryService, notificationService, contextViewService, keybindingService, themeService);\n\t\tthis.configure({ blockMouse: false }); // we do not want that in the standalone editor\n\t}\n}\n\nexport interface IEditorOverrideServices {\n\t[index: string]: any;\n}\n\nregisterSingleton(IConfigurationService, StandaloneConfigurationService);\nregisterSingleton(ITextResourceConfigurationService, StandaloneResourceConfigurationService);\nregisterSingleton(ITextResourcePropertiesService, StandaloneResourcePropertiesService);\nregisterSingleton(IWorkspaceContextService, StandaloneWorkspaceContextService);\nregisterSingleton(ILabelService, StandaloneUriLabelService);\nregisterSingleton(ITelemetryService, StandaloneTelemetryService);\nregisterSingleton(IDialogService, StandaloneDialogService);\nregisterSingleton(INotificationService, StandaloneNotificationService);\nregisterSingleton(IMarkerService, MarkerService);\nregisterSingleton(ILanguageService, StandaloneLanguageService);\nregisterSingleton(IStandaloneThemeService, StandaloneThemeService);\nregisterSingleton(ILogService, StandaloneLogService);\nregisterSingleton(IModelService, ModelService);\nregisterSingleton(IMarkerDecorationsService, MarkerDecorationsService);\nregisterSingleton(IContextKeyService, ContextKeyService);\nregisterSingleton(IEditorProgressService, StandaloneEditorProgressService);\nregisterSingleton(IStorageService, InMemoryStorageService);\nregisterSingleton(IEditorWorkerService, EditorWorkerService);\nregisterSingleton(IBulkEditService, StandaloneBulkEditService);\nregisterSingleton(IWorkspaceTrustManagementService, StandaloneWorkspaceTrustManagementService);\nregisterSingleton(ITextModelService, StandaloneTextModelService);\nregisterSingleton(IAccessibilityService, AccessibilityService);\nregisterSingleton(IListService, ListService);\nregisterSingleton(ICommandService, StandaloneCommandService);\nregisterSingleton(IKeybindingService, StandaloneKeybindingService);\nregisterSingleton(IQuickInputService, StandaloneQuickInputService);\nregisterSingleton(IContextViewService, StandaloneContextViewService);\nregisterSingleton(IOpenerService, OpenerService);\nregisterSingleton(IClipboardService, BrowserClipboardService);\nregisterSingleton(IContextMenuService, StandaloneContextMenuService);\nregisterSingleton(IMenuService, MenuService);\n\n/**\n * We don't want to eagerly instantiate services because embedders get a one time chance\n * to override services when they create the first editor.\n */\nexport module StandaloneServices {\n\n\tconst serviceCollection = new ServiceCollection();\n\tfor (const [id, descriptor] of getSingletonServiceDescriptors()) {\n\t\tserviceCollection.set(id, descriptor);\n\t}\n\n\tconst instantiationService = new InstantiationService(serviceCollection, true);\n\tserviceCollection.set(IInstantiationService, instantiationService);\n\n\texport function get<T>(serviceId: ServiceIdentifier<T>): T {\n\t\tconst r = serviceCollection.get(serviceId);\n\t\tif (!r) {\n\t\t\tthrow new Error('Missing service ' + serviceId);\n\t\t}\n\t\tif (r instanceof SyncDescriptor) {\n\t\t\treturn instantiationService.invokeFunction((accessor) => accessor.get(serviceId));\n\t\t} else {\n\t\t\treturn r;\n\t\t}\n\t}\n\n\tlet initialized = false;\n\texport function initialize(overrides: IEditorOverrideServices): IInstantiationService {\n\t\tif (initialized) {\n\t\t\treturn instantiationService;\n\t\t}\n\t\tinitialized = true;\n\n\t\t// Add singletons that were registered after this module loaded\n\t\tfor (const [id, descriptor] of getSingletonServiceDescriptors()) {\n\t\t\tif (!serviceCollection.get(id)) {\n\t\t\t\tserviceCollection.set(id, descriptor);\n\t\t\t}\n\t\t}\n\n\t\t// Initialize the service collection with the overrides, but only if the\n\t\t// service was not instantiated in the meantime.\n\t\tfor (const serviceId in overrides) {\n\t\t\tif (overrides.hasOwnProperty(serviceId)) {\n\t\t\t\tconst serviceIdentifier = createDecorator(serviceId);\n\t\t\t\tconst r = serviceCollection.get(serviceIdentifier);\n\t\t\t\tif (r instanceof SyncDescriptor) {\n\t\t\t\t\tserviceCollection.set(serviceIdentifier, overrides[serviceId]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn instantiationService;\n\t}\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 * as aria from 'vs/base/browser/ui/aria/aria';\nimport { Disposable, IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget';\nimport { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { InternalEditorAction } from 'vs/editor/common/editorAction';\nimport { IModelChangedEvent } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';\nimport { StandaloneKeybindingService, updateConfigurationService } from 'vs/editor/standalone/browser/standaloneServices';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { IMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IEditorProgressService } from 'vs/platform/progress/common/progress';\nimport { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language';\nimport { URI } from 'vs/base/common/uri';\nimport { StandaloneCodeEditorService } from 'vs/editor/standalone/browser/standaloneCodeEditorService';\nimport { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\n\n/**\n * Description of an action contribution\n */\nexport interface IActionDescriptor {\n\t/**\n\t * An unique identifier of the contributed action.\n\t */\n\tid: string;\n\t/**\n\t * A label of the action that will be presented to the user.\n\t */\n\tlabel: string;\n\t/**\n\t * Precondition rule.\n\t */\n\tprecondition?: string;\n\t/**\n\t * An array of keybindings for the action.\n\t */\n\tkeybindings?: number[];\n\t/**\n\t * The keybinding rule (condition on top of precondition).\n\t */\n\tkeybindingContext?: string;\n\t/**\n\t * Control if the action should show up in the context menu and where.\n\t * The context menu of the editor has these default:\n\t * navigation - The navigation group comes first in all cases.\n\t * 1_modification - This group comes next and contains commands that modify your code.\n\t * 9_cutcopypaste - The last default group with the basic editing commands.\n\t * You can also create your own group.\n\t * Defaults to null (don't show in context menu).\n\t */\n\tcontextMenuGroupId?: string;\n\t/**\n\t * Control the order in the context menu group.\n\t */\n\tcontextMenuOrder?: number;\n\t/**\n\t * Method that will be executed when the action is triggered.\n\t * @param editor The editor instance is passed in as a convenience\n\t */\n\trun(editor: ICodeEditor, ...args: any[]): void | Promise<void>;\n}\n\n/**\n * Options which apply for all editors.\n */\nexport interface IGlobalEditorOptions {\n\t/**\n\t * The number of spaces a tab is equal to.\n\t * This setting is overridden based on the file contents when `detectIndentation` is on.\n\t * Defaults to 4.\n\t */\n\ttabSize?: number;\n\t/**\n\t * Insert spaces when pressing `Tab`.\n\t * This setting is overridden based on the file contents when `detectIndentation` is on.\n\t * Defaults to true.\n\t */\n\tinsertSpaces?: boolean;\n\t/**\n\t * Controls whether `tabSize` and `insertSpaces` will be automatically detected when a file is opened based on the file contents.\n\t * Defaults to true.\n\t */\n\tdetectIndentation?: boolean;\n\t/**\n\t * Remove trailing auto inserted whitespace.\n\t * Defaults to true.\n\t */\n\ttrimAutoWhitespace?: boolean;\n\t/**\n\t * Special handling for large files to disable certain memory intensive features.\n\t * Defaults to true.\n\t */\n\tlargeFileOptimizations?: boolean;\n\t/**\n\t * Controls whether completions should be computed based on words in the document.\n\t * Defaults to true.\n\t */\n\twordBasedSuggestions?: boolean;\n\t/**\n\t * Controls whether word based completions should be included from opened documents of the same language or any language.\n\t */\n\twordBasedSuggestionsOnlySameLanguage?: boolean;\n\t/**\n\t * Controls whether the semanticHighlighting is shown for the languages that support it.\n\t * true: semanticHighlighting is enabled for all themes\n\t * false: semanticHighlighting is disabled for all themes\n\t * 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting.\n\t * Defaults to 'byTheme'.\n\t */\n\t'semanticHighlighting.enabled'?: true | false | 'configuredByTheme';\n\t/**\n\t * Keep peek editors open even when double clicking their content or when hitting `Escape`.\n\t * Defaults to false.\n\t */\n\tstablePeek?: boolean;\n\t/**\n\t * Lines above this length will not be tokenized for performance reasons.\n\t * Defaults to 20000.\n\t */\n\tmaxTokenizationLineLength?: number;\n\t/**\n\t * Theme to be used for rendering.\n\t * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.\n\t * You can create custom themes via `monaco.editor.defineTheme`.\n\t * To switch a theme, use `monaco.editor.setTheme`.\n\t * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.\n\t */\n\ttheme?: string;\n\t/**\n\t * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.\n\t * Defaults to true.\n\t */\n\tautoDetectHighContrast?: boolean;\n}\n\n/**\n * The options to create an editor.\n */\nexport interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions, IGlobalEditorOptions {\n\t/**\n\t * The initial model associated with this code editor.\n\t */\n\tmodel?: ITextModel | null;\n\t/**\n\t * The initial value of the auto created model in the editor.\n\t * To not automatically create a model, use `model: null`.\n\t */\n\tvalue?: string;\n\t/**\n\t * The initial language of the auto created model in the editor.\n\t * To not automatically create a model, use `model: null`.\n\t */\n\tlanguage?: string;\n\t/**\n\t * Initial theme to be used for rendering.\n\t * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.\n\t * You can create custom themes via `monaco.editor.defineTheme`.\n\t * To switch a theme, use `monaco.editor.setTheme`.\n\t * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.\n\t */\n\ttheme?: string;\n\t/**\n\t * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.\n\t * Defaults to true.\n\t */\n\tautoDetectHighContrast?: boolean;\n\t/**\n\t * An URL to open when Ctrl+H (Windows and Linux) or Cmd+H (OSX) is pressed in\n\t * the accessibility help dialog in the editor.\n\t *\n\t * Defaults to \"https://go.microsoft.com/fwlink/?linkid=852450\"\n\t */\n\taccessibilityHelpUrl?: string;\n\t/**\n\t * Container element to use for ARIA messages.\n\t * Defaults to document.body.\n\t */\n\tariaContainerElement?: HTMLElement;\n}\n\n/**\n * The options to create a diff editor.\n */\nexport interface IStandaloneDiffEditorConstructionOptions extends IDiffEditorConstructionOptions {\n\t/**\n\t * Initial theme to be used for rendering.\n\t * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.\n\t * You can create custom themes via `monaco.editor.defineTheme`.\n\t * To switch a theme, use `monaco.editor.setTheme`.\n\t * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.\n\t */\n\ttheme?: string;\n\t/**\n\t * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.\n\t * Defaults to true.\n\t */\n\tautoDetectHighContrast?: boolean;\n}\n\nexport interface IStandaloneCodeEditor extends ICodeEditor {\n\tupdateOptions(newOptions: IEditorOptions & IGlobalEditorOptions): void;\n\taddCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;\n\tcreateContextKey<T>(key: string, defaultValue: T): IContextKey<T>;\n\taddAction(descriptor: IActionDescriptor): IDisposable;\n}\n\nexport interface IStandaloneDiffEditor extends IDiffEditor {\n\taddCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;\n\tcreateContextKey<T>(key: string, defaultValue: T): IContextKey<T>;\n\taddAction(descriptor: IActionDescriptor): IDisposable;\n\n\tgetOriginalEditor(): IStandaloneCodeEditor;\n\tgetModifiedEditor(): IStandaloneCodeEditor;\n}\n\nlet LAST_GENERATED_COMMAND_ID = 0;\n\nlet ariaDomNodeCreated = false;\n/**\n * Create ARIA dom node inside parent,\n * or only for the first editor instantiation inside document.body.\n * @param parent container element for ARIA dom node\n */\nfunction createAriaDomNode(parent: HTMLElement | undefined) {\n\tif (!parent) {\n\t\tif (ariaDomNodeCreated) {\n\t\t\treturn;\n\t\t}\n\t\tariaDomNodeCreated = true;\n\t}\n\taria.setARIAContainer(parent || document.body);\n}\n\n/**\n * A code editor to be used both by the standalone editor and the standalone diff editor.\n */\nexport class StandaloneCodeEditor extends CodeEditorWidget implements IStandaloneCodeEditor {\n\n\tprivate readonly _standaloneKeybindingService: StandaloneKeybindingService | null;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\t_options: Readonly<IStandaloneEditorConstructionOptions>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t\t@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tconst options = { ..._options };\n\t\toptions.ariaLabel = options.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel;\n\t\toptions.ariaLabel = options.ariaLabel + ';' + (StandaloneCodeEditorNLS.accessibilityHelpMessage);\n\t\tsuper(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);\n\n\t\tif (keybindingService instanceof StandaloneKeybindingService) {\n\t\t\tthis._standaloneKeybindingService = keybindingService;\n\t\t} else {\n\t\t\tthis._standaloneKeybindingService = null;\n\t\t}\n\n\t\tcreateAriaDomNode(options.ariaContainerElement);\n\t}\n\n\tpublic addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {\n\t\tif (!this._standaloneKeybindingService) {\n\t\t\tconsole.warn('Cannot add command because the editor is configured with an unrecognized KeybindingService');\n\t\t\treturn null;\n\t\t}\n\t\tconst commandId = 'DYNAMIC_' + (++LAST_GENERATED_COMMAND_ID);\n\t\tconst whenExpression = ContextKeyExpr.deserialize(context);\n\t\tthis._standaloneKeybindingService.addDynamicKeybinding(commandId, keybinding, handler, whenExpression);\n\t\treturn commandId;\n\t}\n\n\tpublic createContextKey<T>(key: string, defaultValue: T): IContextKey<T> {\n\t\treturn this._contextKeyService.createKey(key, defaultValue);\n\t}\n\n\tpublic addAction(_descriptor: IActionDescriptor): IDisposable {\n\t\tif ((typeof _descriptor.id !== 'string') || (typeof _descriptor.label !== 'string') || (typeof _descriptor.run !== 'function')) {\n\t\t\tthrow new Error('Invalid action descriptor, `id`, `label` and `run` are required properties!');\n\t\t}\n\t\tif (!this._standaloneKeybindingService) {\n\t\t\tconsole.warn('Cannot add keybinding because the editor is configured with an unrecognized KeybindingService');\n\t\t\treturn Disposable.None;\n\t\t}\n\n\t\t// Read descriptor options\n\t\tconst id = _descriptor.id;\n\t\tconst label = _descriptor.label;\n\t\tconst precondition = ContextKeyExpr.and(\n\t\t\tContextKeyExpr.equals('editorId', this.getId()),\n\t\t\tContextKeyExpr.deserialize(_descriptor.precondition)\n\t\t);\n\t\tconst keybindings = _descriptor.keybindings;\n\t\tconst keybindingsWhen = ContextKeyExpr.and(\n\t\t\tprecondition,\n\t\t\tContextKeyExpr.deserialize(_descriptor.keybindingContext)\n\t\t);\n\t\tconst contextMenuGroupId = _descriptor.contextMenuGroupId || null;\n\t\tconst contextMenuOrder = _descriptor.contextMenuOrder || 0;\n\t\tconst run = (accessor?: ServicesAccessor, ...args: any[]): Promise<void> => {\n\t\t\treturn Promise.resolve(_descriptor.run(this, ...args));\n\t\t};\n\n\n\t\tconst toDispose = new DisposableStore();\n\n\t\t// Generate a unique id to allow the same descriptor.id across multiple editor instances\n\t\tconst uniqueId = this.getId() + ':' + id;\n\n\t\t// Register the command\n\t\ttoDispose.add(CommandsRegistry.registerCommand(uniqueId, run));\n\n\t\t// Register the context menu item\n\t\tif (contextMenuGroupId) {\n\t\t\tconst menuItem: IMenuItem = {\n\t\t\t\tcommand: {\n\t\t\t\t\tid: uniqueId,\n\t\t\t\t\ttitle: label\n\t\t\t\t},\n\t\t\t\twhen: precondition,\n\t\t\t\tgroup: contextMenuGroupId,\n\t\t\t\torder: contextMenuOrder\n\t\t\t};\n\t\t\ttoDispose.add(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem));\n\t\t}\n\n\t\t// Register the keybindings\n\t\tif (Array.isArray(keybindings)) {\n\t\t\tfor (const kb of keybindings) {\n\t\t\t\ttoDispose.add(this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen));\n\t\t\t}\n\t\t}\n\n\t\t// Finally, register an internal editor action\n\t\tconst internalAction = new InternalEditorAction(\n\t\t\tuniqueId,\n\t\t\tlabel,\n\t\t\tlabel,\n\t\t\tprecondition,\n\t\t\trun,\n\t\t\tthis._contextKeyService\n\t\t);\n\n\t\t// Store it under the original id, such that trigger with the original id will work\n\t\tthis._actions[id] = internalAction;\n\t\ttoDispose.add(toDisposable(() => {\n\t\t\tdelete this._actions[id];\n\t\t}));\n\n\t\treturn toDispose;\n\t}\n\n\tprotected override _triggerCommand(handlerId: string, payload: any): void {\n\t\tif (this._codeEditorService instanceof StandaloneCodeEditorService) {\n\t\t\t// Help commands find this editor as the active editor\n\t\t\ttry {\n\t\t\t\tthis._codeEditorService.setActiveCodeEditor(this);\n\t\t\t\tsuper._triggerCommand(handlerId, payload);\n\t\t\t} finally {\n\t\t\t\tthis._codeEditorService.setActiveCodeEditor(null);\n\t\t\t}\n\t\t} else {\n\t\t\tsuper._triggerCommand(handlerId, payload);\n\t\t}\n\t}\n}\n\nexport class StandaloneEditor extends StandaloneCodeEditor implements IStandaloneCodeEditor {\n\n\tprivate readonly _configurationService: IConfigurationService;\n\tprivate readonly _standaloneThemeService: IStandaloneThemeService;\n\tprivate _ownsModel: boolean;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\t_options: Readonly<IStandaloneEditorConstructionOptions> | undefined,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IStandaloneThemeService themeService: IStandaloneThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IAccessibilityService accessibilityService: IAccessibilityService,\n\t\t@IModelService modelService: IModelService,\n\t\t@ILanguageService languageService: ILanguageService,\n\t\t@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,\n\t) {\n\t\tconst options = { ..._options };\n\t\tupdateConfigurationService(configurationService, options, false);\n\t\tconst themeDomRegistration = (<StandaloneThemeService>themeService).registerEditorContainer(domElement);\n\t\tif (typeof options.theme === 'string') {\n\t\t\tthemeService.setTheme(options.theme);\n\t\t}\n\t\tif (typeof options.autoDetectHighContrast !== 'undefined') {\n\t\t\tthemeService.setAutoDetectHighContrast(Boolean(options.autoDetectHighContrast));\n\t\t}\n\t\tconst _model: ITextModel | null | undefined = options.model;\n\t\tdelete options.model;\n\t\tsuper(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);\n\n\t\tthis._configurationService = configurationService;\n\t\tthis._standaloneThemeService = themeService;\n\t\tthis._register(themeDomRegistration);\n\n\t\tlet model: ITextModel | null;\n\t\tif (typeof _model === 'undefined') {\n\t\t\tconst languageId = languageService.getLanguageIdByMimeType(options.language) || options.language || PLAINTEXT_LANGUAGE_ID;\n\t\t\tmodel = createTextModel(modelService, languageService, options.value || '', languageId, undefined);\n\t\t\tthis._ownsModel = true;\n\t\t} else {\n\t\t\tmodel = _model;\n\t\t\tthis._ownsModel = false;\n\t\t}\n\n\t\tthis._attachModel(model);\n\t\tif (model) {\n\t\t\tconst e: IModelChangedEvent = {\n\t\t\t\toldModelUrl: null,\n\t\t\t\tnewModelUrl: model.uri\n\t\t\t};\n\t\t\tthis._onDidChangeModel.fire(e);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic override updateOptions(newOptions: Readonly<IEditorOptions & IGlobalEditorOptions>): void {\n\t\tupdateConfigurationService(this._configurationService, newOptions, false);\n\t\tif (typeof newOptions.theme === 'string') {\n\t\t\tthis._standaloneThemeService.setTheme(newOptions.theme);\n\t\t}\n\t\tif (typeof newOptions.autoDetectHighContrast !== 'undefined') {\n\t\t\tthis._standaloneThemeService.setAutoDetectHighContrast(Boolean(newOptions.autoDetectHighContrast));\n\t\t}\n\t\tsuper.updateOptions(newOptions);\n\t}\n\n\toverride _postDetachModelCleanup(detachedModel: ITextModel): void {\n\t\tsuper._postDetachModelCleanup(detachedModel);\n\t\tif (detachedModel && this._ownsModel) {\n\t\t\tdetachedModel.dispose();\n\t\t\tthis._ownsModel = false;\n\t\t}\n\t}\n}\n\nexport class StandaloneDiffEditor extends DiffEditorWidget implements IStandaloneDiffEditor {\n\n\tprivate readonly _configurationService: IConfigurationService;\n\tprivate readonly _standaloneThemeService: IStandaloneThemeService;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\t_options: Readonly<IStandaloneDiffEditorConstructionOptions> | undefined,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@IStandaloneThemeService themeService: IStandaloneThemeService,\n\t\t@INotificationService notificationService: INotificationService,\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IEditorProgressService editorProgressService: IEditorProgressService,\n\t\t@IClipboardService clipboardService: IClipboardService,\n\t) {\n\t\tconst options = { ..._options };\n\t\tupdateConfigurationService(configurationService, options, true);\n\t\tconst themeDomRegistration = (<StandaloneThemeService>themeService).registerEditorContainer(domElement);\n\t\tif (typeof options.theme === 'string') {\n\t\t\tthemeService.setTheme(options.theme);\n\t\t}\n\t\tif (typeof options.autoDetectHighContrast !== 'undefined') {\n\t\t\tthemeService.setAutoDetectHighContrast(Boolean(options.autoDetectHighContrast));\n\t\t}\n\n\t\tsuper(domElement, options, {}, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, editorProgressService);\n\n\t\tthis._configurationService = configurationService;\n\t\tthis._standaloneThemeService = themeService;\n\n\t\tthis._register(themeDomRegistration);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic override updateOptions(newOptions: Readonly<IDiffEditorOptions & IGlobalEditorOptions>): void {\n\t\tupdateConfigurationService(this._configurationService, newOptions, true);\n\t\tif (typeof newOptions.theme === 'string') {\n\t\t\tthis._standaloneThemeService.setTheme(newOptions.theme);\n\t\t}\n\t\tif (typeof newOptions.autoDetectHighContrast !== 'undefined') {\n\t\t\tthis._standaloneThemeService.setAutoDetectHighContrast(Boolean(newOptions.autoDetectHighContrast));\n\t\t}\n\t\tsuper.updateOptions(newOptions);\n\t}\n\n\tprotected override _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorOptions>): CodeEditorWidget {\n\t\treturn instantiationService.createInstance(StandaloneCodeEditor, container, options);\n\t}\n\n\tpublic override getOriginalEditor(): IStandaloneCodeEditor {\n\t\treturn <StandaloneCodeEditor>super.getOriginalEditor();\n\t}\n\n\tpublic override getModifiedEditor(): IStandaloneCodeEditor {\n\t\treturn <StandaloneCodeEditor>super.getModifiedEditor();\n\t}\n\n\tpublic addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {\n\t\treturn this.getModifiedEditor().addCommand(keybinding, handler, context);\n\t}\n\n\tpublic createContextKey<T>(key: string, defaultValue: T): IContextKey<T> {\n\t\treturn this.getModifiedEditor().createContextKey(key, defaultValue);\n\t}\n\n\tpublic addAction(descriptor: IActionDescriptor): IDisposable {\n\t\treturn this.getModifiedEditor().addAction(descriptor);\n\t}\n}\n\n/**\n * @internal\n */\nexport function createTextModel(modelService: IModelService, languageService: ILanguageService, value: string, languageId: string | undefined, uri: URI | undefined): ITextModel {\n\tvalue = value || '';\n\tif (!languageId) {\n\t\tconst firstLF = value.indexOf('\\n');\n\t\tlet firstLine = value;\n\t\tif (firstLF !== -1) {\n\t\t\tfirstLine = value.substring(0, firstLF);\n\t\t}\n\t\treturn doCreateModel(modelService, value, languageService.createByFilepathOrFirstLine(uri || null, firstLine), uri);\n\t}\n\treturn doCreateModel(modelService, value, languageService.createById(languageId), uri);\n}\n\n/**\n * @internal\n */\nfunction doCreateModel(modelService: IModelService, value: string, languageSelection: ILanguageSelection, uri: URI | undefined): ITextModel {\n\treturn modelService.createModel(value, languageSelection, uri);\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 'vs/css!./standalone-tokens';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { splitLines } from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { DiffNavigator, IDiffNavigator } from 'vs/editor/browser/widget/diffNavigator';\nimport { ApplyUpdateResult, ConfigurationChangedEvent, EditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { EditorType } from 'vs/editor/common/editorCommon';\nimport { FindMatch, ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { NullState, nullTokenize } from 'vs/editor/common/languages/nullTokenize';\nimport { ILanguageService } from 'vs/editor/common/languages/language';\nimport { IModelService } from 'vs/editor/common/services/model';\nimport { createWebWorker as actualCreateWebWorker, IWebWorkerOptions, MonacoWebWorker } from 'vs/editor/browser/services/webWorker';\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\nimport { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer';\nimport { createTextModel, IStandaloneCodeEditor, IStandaloneDiffEditor, IStandaloneDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, StandaloneDiffEditor, StandaloneEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';\nimport { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices';\nimport { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService';\nimport { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { IMarker, IMarkerData, IMarkerService } from 'vs/platform/markers/common/markers';\n\n/**\n * Create a new editor under `domElement`.\n * `domElement` should be empty (not contain other dom nodes).\n * The editor will read the size of `domElement`.\n */\nexport function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor {\n\tconst instantiationService = StandaloneServices.initialize(override || {});\n\treturn instantiationService.createInstance(StandaloneEditor, domElement, options);\n}\n\n/**\n * Emitted when an editor is created.\n * Creating a diff editor might cause this listener to be invoked with the two editors.\n * @event\n */\nexport function onDidCreateEditor(listener: (codeEditor: ICodeEditor) => void): IDisposable {\n\tconst codeEditorService = StandaloneServices.get(ICodeEditorService);\n\treturn codeEditorService.onCodeEditorAdd((editor) => {\n\t\tlistener(<ICodeEditor>editor);\n\t});\n}\n\n/**\n * Create a new diff editor under `domElement`.\n * `domElement` should be empty (not contain other dom nodes).\n * The editor will read the size of `domElement`.\n */\nexport function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor {\n\tconst instantiationService = StandaloneServices.initialize(override || {});\n\treturn instantiationService.createInstance(StandaloneDiffEditor, domElement, options);\n}\n\nexport interface IDiffNavigatorOptions {\n\treadonly followsCaret?: boolean;\n\treadonly ignoreCharChanges?: boolean;\n\treadonly alwaysRevealFirst?: boolean;\n}\n\nexport function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator {\n\treturn new DiffNavigator(diffEditor, opts);\n}\n\n/**\n * Create a new editor model.\n * You can specify the language that should be set for this model or let the language be inferred from the `uri`.\n */\nexport function createModel(value: string, language?: string, uri?: URI): ITextModel {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tconst languageId = languageService.getLanguageIdByMimeType(language) || language;\n\treturn createTextModel(\n\t\tStandaloneServices.get(IModelService),\n\t\tlanguageService,\n\t\tvalue,\n\t\tlanguageId,\n\t\turi\n\t);\n}\n\n/**\n * Change the language for a model.\n */\nexport function setModelLanguage(model: ITextModel, languageId: string): void {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tconst modelService = StandaloneServices.get(IModelService);\n\tmodelService.setMode(model, languageService.createById(languageId));\n}\n\n/**\n * Set the markers for a model.\n */\nexport function setModelMarkers(model: ITextModel, owner: string, markers: IMarkerData[]): void {\n\tif (model) {\n\t\tconst markerService = StandaloneServices.get(IMarkerService);\n\t\tmarkerService.changeOne(owner, model.uri, markers);\n\t}\n}\n\n/**\n * Get markers for owner and/or resource\n *\n * @returns list of markers\n */\nexport function getModelMarkers(filter: { owner?: string; resource?: URI; take?: number }): IMarker[] {\n\tconst markerService = StandaloneServices.get(IMarkerService);\n\treturn markerService.read(filter);\n}\n\n/**\n * Emitted when markers change for a model.\n * @event\n */\nexport function onDidChangeMarkers(listener: (e: readonly URI[]) => void): IDisposable {\n\tconst markerService = StandaloneServices.get(IMarkerService);\n\treturn markerService.onMarkerChanged(listener);\n}\n\n/**\n * Get the model that has `uri` if it exists.\n */\nexport function getModel(uri: URI): ITextModel | null {\n\tconst modelService = StandaloneServices.get(IModelService);\n\treturn modelService.getModel(uri);\n}\n\n/**\n * Get all the created models.\n */\nexport function getModels(): ITextModel[] {\n\tconst modelService = StandaloneServices.get(IModelService);\n\treturn modelService.getModels();\n}\n\n/**\n * Emitted when a model is created.\n * @event\n */\nexport function onDidCreateModel(listener: (model: ITextModel) => void): IDisposable {\n\tconst modelService = StandaloneServices.get(IModelService);\n\treturn modelService.onModelAdded(listener);\n}\n\n/**\n * Emitted right before a model is disposed.\n * @event\n */\nexport function onWillDisposeModel(listener: (model: ITextModel) => void): IDisposable {\n\tconst modelService = StandaloneServices.get(IModelService);\n\treturn modelService.onModelRemoved(listener);\n}\n\n/**\n * Emitted when a different language is set to a model.\n * @event\n */\nexport function onDidChangeModelLanguage(listener: (e: { readonly model: ITextModel; readonly oldLanguage: string }) => void): IDisposable {\n\tconst modelService = StandaloneServices.get(IModelService);\n\treturn modelService.onModelLanguageChanged((e) => {\n\t\tlistener({\n\t\t\tmodel: e.model,\n\t\t\toldLanguage: e.oldLanguageId\n\t\t});\n\t});\n}\n\n/**\n * Create a new web worker that has model syncing capabilities built in.\n * Specify an AMD module to load that will `create` an object that will be proxied.\n */\nexport function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T> {\n\treturn actualCreateWebWorker<T>(StandaloneServices.get(IModelService), StandaloneServices.get(ILanguageConfigurationService), opts);\n}\n\n/**\n * Colorize the contents of `domNode` using attribute `data-lang`.\n */\nexport function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): Promise<void> {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tconst themeService = <StandaloneThemeService>StandaloneServices.get(IStandaloneThemeService);\n\tthemeService.registerEditorContainer(domNode);\n\treturn Colorizer.colorizeElement(themeService, languageService, domNode, options);\n}\n\n/**\n * Colorize `text` using language `languageId`.\n */\nexport function colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string> {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tconst themeService = <StandaloneThemeService>StandaloneServices.get(IStandaloneThemeService);\n\tthemeService.registerEditorContainer(document.body);\n\treturn Colorizer.colorize(languageService, text, languageId, options);\n}\n\n/**\n * Colorize a line in a model.\n */\nexport function colorizeModelLine(model: ITextModel, lineNumber: number, tabSize: number = 4): string {\n\tconst themeService = <StandaloneThemeService>StandaloneServices.get(IStandaloneThemeService);\n\tthemeService.registerEditorContainer(document.body);\n\treturn Colorizer.colorizeModelLine(model, lineNumber, tabSize);\n}\n\n/**\n * @internal\n */\nfunction getSafeTokenizationSupport(language: string): Omit<languages.ITokenizationSupport, 'tokenizeEncoded'> {\n\tconst tokenizationSupport = languages.TokenizationRegistry.get(language);\n\tif (tokenizationSupport) {\n\t\treturn tokenizationSupport;\n\t}\n\treturn {\n\t\tgetInitialState: () => NullState,\n\t\ttokenize: (line: string, hasEOL: boolean, state: languages.IState) => nullTokenize(language, state)\n\t};\n}\n\n/**\n * Tokenize `text` using language `languageId`\n */\nexport function tokenize(text: string, languageId: string): languages.Token[][] {\n\t// Needed in order to get the mode registered for subsequent look-ups\n\tlanguages.TokenizationRegistry.getOrCreate(languageId);\n\n\tconst tokenizationSupport = getSafeTokenizationSupport(languageId);\n\tconst lines = splitLines(text);\n\tconst result: languages.Token[][] = [];\n\tlet state = tokenizationSupport.getInitialState();\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst line = lines[i];\n\t\tconst tokenizationResult = tokenizationSupport.tokenize(line, true, state);\n\n\t\tresult[i] = tokenizationResult.tokens;\n\t\tstate = tokenizationResult.endState;\n\t}\n\treturn result;\n}\n\n/**\n * Define a new theme or update an existing theme.\n */\nexport function defineTheme(themeName: string, themeData: IStandaloneThemeData): void {\n\tconst standaloneThemeService = StandaloneServices.get(IStandaloneThemeService);\n\tstandaloneThemeService.defineTheme(themeName, themeData);\n}\n\n/**\n * Switches to a theme.\n */\nexport function setTheme(themeName: string): void {\n\tconst standaloneThemeService = StandaloneServices.get(IStandaloneThemeService);\n\tstandaloneThemeService.setTheme(themeName);\n}\n\n/**\n * Clears all cached font measurements and triggers re-measurement.\n */\nexport function remeasureFonts(): void {\n\tFontMeasurements.clearAllFontInfos();\n}\n\n/**\n * Register a command.\n */\nexport function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable {\n\treturn CommandsRegistry.registerCommand({ id, handler });\n}\n\n/**\n * @internal\n */\nexport function createMonacoEditorAPI(): typeof monaco.editor {\n\treturn {\n\t\t// methods\n\t\tcreate: <any>create,\n\t\tonDidCreateEditor: <any>onDidCreateEditor,\n\t\tcreateDiffEditor: <any>createDiffEditor,\n\t\tcreateDiffNavigator: <any>createDiffNavigator,\n\n\t\tcreateModel: <any>createModel,\n\t\tsetModelLanguage: <any>setModelLanguage,\n\t\tsetModelMarkers: <any>setModelMarkers,\n\t\tgetModelMarkers: <any>getModelMarkers,\n\t\tonDidChangeMarkers: <any>onDidChangeMarkers,\n\t\tgetModels: <any>getModels,\n\t\tgetModel: <any>getModel,\n\t\tonDidCreateModel: <any>onDidCreateModel,\n\t\tonWillDisposeModel: <any>onWillDisposeModel,\n\t\tonDidChangeModelLanguage: <any>onDidChangeModelLanguage,\n\n\n\t\tcreateWebWorker: <any>createWebWorker,\n\t\tcolorizeElement: <any>colorizeElement,\n\t\tcolorize: <any>colorize,\n\t\tcolorizeModelLine: <any>colorizeModelLine,\n\t\ttokenize: <any>tokenize,\n\t\tdefineTheme: <any>defineTheme,\n\t\tsetTheme: <any>setTheme,\n\t\tremeasureFonts: remeasureFonts,\n\t\tregisterCommand: registerCommand,\n\n\t\t// enums\n\t\tAccessibilitySupport: standaloneEnums.AccessibilitySupport,\n\t\tContentWidgetPositionPreference: standaloneEnums.ContentWidgetPositionPreference,\n\t\tCursorChangeReason: standaloneEnums.CursorChangeReason,\n\t\tDefaultEndOfLine: standaloneEnums.DefaultEndOfLine,\n\t\tEditorAutoIndentStrategy: standaloneEnums.EditorAutoIndentStrategy,\n\t\tEditorOption: standaloneEnums.EditorOption,\n\t\tEndOfLinePreference: standaloneEnums.EndOfLinePreference,\n\t\tEndOfLineSequence: standaloneEnums.EndOfLineSequence,\n\t\tMinimapPosition: standaloneEnums.MinimapPosition,\n\t\tMouseTargetType: standaloneEnums.MouseTargetType,\n\t\tOverlayWidgetPositionPreference: standaloneEnums.OverlayWidgetPositionPreference,\n\t\tOverviewRulerLane: standaloneEnums.OverviewRulerLane,\n\t\tRenderLineNumbersType: standaloneEnums.RenderLineNumbersType,\n\t\tRenderMinimap: standaloneEnums.RenderMinimap,\n\t\tScrollbarVisibility: standaloneEnums.ScrollbarVisibility,\n\t\tScrollType: standaloneEnums.ScrollType,\n\t\tTextEditorCursorBlinkingStyle: standaloneEnums.TextEditorCursorBlinkingStyle,\n\t\tTextEditorCursorStyle: standaloneEnums.TextEditorCursorStyle,\n\t\tTrackedRangeStickiness: standaloneEnums.TrackedRangeStickiness,\n\t\tWrappingIndent: standaloneEnums.WrappingIndent,\n\t\tInjectedTextCursorStops: standaloneEnums.InjectedTextCursorStops,\n\t\tPositionAffinity: standaloneEnums.PositionAffinity,\n\n\t\t// classes\n\t\tConfigurationChangedEvent: <any>ConfigurationChangedEvent,\n\t\tBareFontInfo: <any>BareFontInfo,\n\t\tFontInfo: <any>FontInfo,\n\t\tTextModelResolvedOptions: <any>TextModelResolvedOptions,\n\t\tFindMatch: <any>FindMatch,\n\t\tApplyUpdateResult: <any>ApplyUpdateResult,\n\n\t\t// vars\n\t\tEditorType: EditorType,\n\t\tEditorOptions: <any>EditorOptions\n\n\t};\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Color } from 'vs/base/common/color';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as model from 'vs/editor/common/model';\nimport * as languages from 'vs/editor/common/languages';\nimport { LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/languages/languageConfigurationRegistry';\nimport { ModesRegistry } from 'vs/editor/common/languages/modesRegistry';\nimport { ILanguageExtensionPoint, ILanguageService } from 'vs/editor/common/languages/language';\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\nimport { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices';\nimport { compile } from 'vs/editor/standalone/common/monarch/monarchCompile';\nimport { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer';\nimport { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme';\nimport { IMarkerData, IMarkerService } from 'vs/platform/markers/common/markers';\nimport { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';\nimport { LanguageSelector } from 'vs/editor/common/languageSelector';\n\n/**\n * Register information about a new language.\n */\nexport function register(language: ILanguageExtensionPoint): void {\n\tModesRegistry.registerLanguage(language);\n}\n\n/**\n * Get the information of all the registered languages.\n */\nexport function getLanguages(): ILanguageExtensionPoint[] {\n\tlet result: ILanguageExtensionPoint[] = [];\n\tresult = result.concat(ModesRegistry.getLanguages());\n\treturn result;\n}\n\nexport function getEncodedLanguageId(languageId: string): number {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\treturn languageService.languageIdCodec.encodeLanguageId(languageId);\n}\n\n/**\n * An event emitted when a language is needed for the first time (e.g. a model has it set).\n * @event\n */\nexport function onLanguage(languageId: string, callback: () => void): IDisposable {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tconst disposable = languageService.onDidEncounterLanguage((encounteredLanguageId) => {\n\t\tif (encounteredLanguageId === languageId) {\n\t\t\t// stop listening\n\t\t\tdisposable.dispose();\n\t\t\t// invoke actual listener\n\t\t\tcallback();\n\t\t}\n\t});\n\treturn disposable;\n}\n\n/**\n * Set the editing configuration for a language.\n */\nexport function setLanguageConfiguration(languageId: string, configuration: LanguageConfiguration): IDisposable {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\tthrow new Error(`Cannot set configuration for unknown language ${languageId}`);\n\t}\n\treturn LanguageConfigurationRegistry.register(languageId, configuration, 100);\n}\n\n/**\n * @internal\n */\nexport class EncodedTokenizationSupportAdapter implements languages.ITokenizationSupport {\n\n\tprivate readonly _languageId: string;\n\tprivate readonly _actual: EncodedTokensProvider;\n\n\tconstructor(languageId: string, actual: EncodedTokensProvider) {\n\t\tthis._languageId = languageId;\n\t\tthis._actual = actual;\n\t}\n\n\tpublic getInitialState(): languages.IState {\n\t\treturn this._actual.getInitialState();\n\t}\n\n\tpublic tokenize(line: string, hasEOL: boolean, state: languages.IState): languages.TokenizationResult {\n\t\tif (typeof this._actual.tokenize === 'function') {\n\t\t\treturn TokenizationSupportAdapter.adaptTokenize(this._languageId, <{ tokenize(line: string, state: languages.IState): ILineTokens }>this._actual, line, state);\n\t\t}\n\t\tthrow new Error('Not supported!');\n\t}\n\n\tpublic tokenizeEncoded(line: string, hasEOL: boolean, state: languages.IState): languages.EncodedTokenizationResult {\n\t\tconst result = this._actual.tokenizeEncoded(line, state);\n\t\treturn new languages.EncodedTokenizationResult(result.tokens, result.endState);\n\t}\n}\n\n/**\n * @internal\n */\nexport class TokenizationSupportAdapter implements languages.ITokenizationSupport {\n\n\tconstructor(\n\t\tprivate readonly _languageId: string,\n\t\tprivate readonly _actual: TokensProvider,\n\t\tprivate readonly _languageService: ILanguageService,\n\t\tprivate readonly _standaloneThemeService: IStandaloneThemeService,\n\t) {\n\t}\n\n\tpublic getInitialState(): languages.IState {\n\t\treturn this._actual.getInitialState();\n\t}\n\n\tprivate static _toClassicTokens(tokens: IToken[], language: string): languages.Token[] {\n\t\tconst result: languages.Token[] = [];\n\t\tlet previousStartIndex: number = 0;\n\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\tconst t = tokens[i];\n\t\t\tlet startIndex = t.startIndex;\n\n\t\t\t// Prevent issues stemming from a buggy external tokenizer.\n\t\t\tif (i === 0) {\n\t\t\t\t// Force first token to start at first index!\n\t\t\t\tstartIndex = 0;\n\t\t\t} else if (startIndex < previousStartIndex) {\n\t\t\t\t// Force tokens to be after one another!\n\t\t\t\tstartIndex = previousStartIndex;\n\t\t\t}\n\n\t\t\tresult[i] = new languages.Token(startIndex, t.scopes, language);\n\n\t\t\tpreviousStartIndex = startIndex;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static adaptTokenize(language: string, actual: { tokenize(line: string, state: languages.IState): ILineTokens }, line: string, state: languages.IState): languages.TokenizationResult {\n\t\tconst actualResult = actual.tokenize(line, state);\n\t\tconst tokens = TokenizationSupportAdapter._toClassicTokens(actualResult.tokens, language);\n\n\t\tlet endState: languages.IState;\n\t\t// try to save an object if possible\n\t\tif (actualResult.endState.equals(state)) {\n\t\t\tendState = state;\n\t\t} else {\n\t\t\tendState = actualResult.endState;\n\t\t}\n\n\t\treturn new languages.TokenizationResult(tokens, endState);\n\t}\n\n\tpublic tokenize(line: string, hasEOL: boolean, state: languages.IState): languages.TokenizationResult {\n\t\treturn TokenizationSupportAdapter.adaptTokenize(this._languageId, this._actual, line, state);\n\t}\n\n\tprivate _toBinaryTokens(languageIdCodec: languages.ILanguageIdCodec, tokens: IToken[]): Uint32Array {\n\t\tconst languageId = languageIdCodec.encodeLanguageId(this._languageId);\n\t\tconst tokenTheme = this._standaloneThemeService.getColorTheme().tokenTheme;\n\n\t\tconst result: number[] = [];\n\t\tlet resultLen = 0;\n\t\tlet previousStartIndex: number = 0;\n\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\tconst t = tokens[i];\n\t\t\tconst metadata = tokenTheme.match(languageId, t.scopes);\n\t\t\tif (resultLen > 0 && result[resultLen - 1] === metadata) {\n\t\t\t\t// same metadata\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet startIndex = t.startIndex;\n\n\t\t\t// Prevent issues stemming from a buggy external tokenizer.\n\t\t\tif (i === 0) {\n\t\t\t\t// Force first token to start at first index!\n\t\t\t\tstartIndex = 0;\n\t\t\t} else if (startIndex < previousStartIndex) {\n\t\t\t\t// Force tokens to be after one another!\n\t\t\t\tstartIndex = previousStartIndex;\n\t\t\t}\n\n\t\t\tresult[resultLen++] = startIndex;\n\t\t\tresult[resultLen++] = metadata;\n\n\t\t\tpreviousStartIndex = startIndex;\n\t\t}\n\n\t\tconst actualResult = new Uint32Array(resultLen);\n\t\tfor (let i = 0; i < resultLen; i++) {\n\t\t\tactualResult[i] = result[i];\n\t\t}\n\t\treturn actualResult;\n\t}\n\n\tpublic tokenizeEncoded(line: string, hasEOL: boolean, state: languages.IState): languages.EncodedTokenizationResult {\n\t\tconst actualResult = this._actual.tokenize(line, state);\n\t\tconst tokens = this._toBinaryTokens(this._languageService.languageIdCodec, actualResult.tokens);\n\n\t\tlet endState: languages.IState;\n\t\t// try to save an object if possible\n\t\tif (actualResult.endState.equals(state)) {\n\t\t\tendState = state;\n\t\t} else {\n\t\t\tendState = actualResult.endState;\n\t\t}\n\n\t\treturn new languages.EncodedTokenizationResult(tokens, endState);\n\t}\n}\n\n/**\n * A token.\n */\nexport interface IToken {\n\tstartIndex: number;\n\tscopes: string;\n}\n\n/**\n * The result of a line tokenization.\n */\nexport interface ILineTokens {\n\t/**\n\t * The list of tokens on the line.\n\t */\n\ttokens: IToken[];\n\t/**\n\t * The tokenization end state.\n\t * A pointer will be held to this and the object should not be modified by the tokenizer after the pointer is returned.\n\t */\n\tendState: languages.IState;\n}\n\n/**\n * The result of a line tokenization.\n */\nexport interface IEncodedLineTokens {\n\t/**\n\t * The tokens on the line in a binary, encoded format. Each token occupies two array indices. For token i:\n\t * - at offset 2*i => startIndex\n\t * - at offset 2*i + 1 => metadata\n\t * Meta data is in binary format:\n\t * - -------------------------------------------\n\t * 3322 2222 2222 1111 1111 1100 0000 0000\n\t * 1098 7654 3210 9876 5432 1098 7654 3210\n\t * - -------------------------------------------\n\t * bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL\n\t * - -------------------------------------------\n\t * - L = EncodedLanguageId (8 bits): Use `getEncodedLanguageId` to get the encoded ID of a language.\n\t * - T = StandardTokenType (2 bits): Other = 0, Comment = 1, String = 2, RegEx = 3.\n\t * - F = FontStyle (4 bits): None = 0, Italic = 1, Bold = 2, Underline = 4, Strikethrough = 8.\n\t * - f = foreground ColorId (9 bits)\n\t * - b = background ColorId (9 bits)\n\t * - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors:\n\t * e.g. colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color,\n\t * id = 1 is for the default foreground color, id = 2 for the default background.\n\t */\n\ttokens: Uint32Array;\n\t/**\n\t * The tokenization end state.\n\t * A pointer will be held to this and the object should not be modified by the tokenizer after the pointer is returned.\n\t */\n\tendState: languages.IState;\n}\n\n/**\n * A factory for token providers.\n */\nexport interface TokensProviderFactory {\n\tcreate(): languages.ProviderResult<TokensProvider | EncodedTokensProvider | IMonarchLanguage>;\n}\n\n/**\n * A \"manual\" provider of tokens.\n */\nexport interface TokensProvider {\n\t/**\n\t * The initial state of a language. Will be the state passed in to tokenize the first line.\n\t */\n\tgetInitialState(): languages.IState;\n\t/**\n\t * Tokenize a line given the state at the beginning of the line.\n\t */\n\ttokenize(line: string, state: languages.IState): ILineTokens;\n}\n\n/**\n * A \"manual\" provider of tokens, returning tokens in a binary form.\n */\nexport interface EncodedTokensProvider {\n\t/**\n\t * The initial state of a language. Will be the state passed in to tokenize the first line.\n\t */\n\tgetInitialState(): languages.IState;\n\t/**\n\t * Tokenize a line given the state at the beginning of the line.\n\t */\n\ttokenizeEncoded(line: string, state: languages.IState): IEncodedLineTokens;\n\t/**\n\t * Tokenize a line given the state at the beginning of the line.\n\t */\n\ttokenize?(line: string, state: languages.IState): ILineTokens;\n}\n\nfunction isATokensProvider(provider: TokensProvider | EncodedTokensProvider | IMonarchLanguage): provider is TokensProvider | EncodedTokensProvider {\n\treturn (typeof provider.getInitialState === 'function');\n}\n\nfunction isEncodedTokensProvider(provider: TokensProvider | EncodedTokensProvider): provider is EncodedTokensProvider {\n\treturn 'tokenizeEncoded' in provider;\n}\n\nfunction isThenable<T>(obj: any): obj is Thenable<T> {\n\treturn obj && typeof obj.then === 'function';\n}\n\n/**\n * Change the color map that is used for token colors.\n * Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA\n */\nexport function setColorMap(colorMap: string[] | null): void {\n\tconst standaloneThemeService = StandaloneServices.get(IStandaloneThemeService);\n\tif (colorMap) {\n\t\tconst result: Color[] = [null!];\n\t\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\t\tresult[i] = Color.fromHex(colorMap[i]);\n\t\t}\n\t\tstandaloneThemeService.setColorMapOverride(result);\n\t} else {\n\t\tstandaloneThemeService.setColorMapOverride(null);\n\t}\n}\n\n/**\n * @internal\n */\nfunction createTokenizationSupportAdapter(languageId: string, provider: TokensProvider | EncodedTokensProvider) {\n\tif (isEncodedTokensProvider(provider)) {\n\t\treturn new EncodedTokenizationSupportAdapter(languageId, provider);\n\t} else {\n\t\treturn new TokenizationSupportAdapter(\n\t\t\tlanguageId,\n\t\t\tprovider,\n\t\t\tStandaloneServices.get(ILanguageService),\n\t\t\tStandaloneServices.get(IStandaloneThemeService),\n\t\t);\n\t}\n}\n\n/**\n * Register a tokens provider factory for a language. This tokenizer will be exclusive with a tokenizer\n * set using `setTokensProvider` or one created using `setMonarchTokensProvider`, but will work together\n * with a tokens provider set using `registerDocumentSemanticTokensProvider` or `registerDocumentRangeSemanticTokensProvider`.\n */\nexport function registerTokensProviderFactory(languageId: string, factory: TokensProviderFactory): IDisposable {\n\tconst adaptedFactory: languages.ITokenizationSupportFactory = {\n\t\tcreateTokenizationSupport: async (): Promise<languages.ITokenizationSupport | null> => {\n\t\t\tconst result = await Promise.resolve(factory.create());\n\t\t\tif (!result) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (isATokensProvider(result)) {\n\t\t\t\treturn createTokenizationSupportAdapter(languageId, result);\n\t\t\t}\n\t\t\treturn new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, result));\n\t\t}\n\t};\n\treturn languages.TokenizationRegistry.registerFactory(languageId, adaptedFactory);\n}\n\n/**\n * Set the tokens provider for a language (manual implementation). This tokenizer will be exclusive\n * with a tokenizer created using `setMonarchTokensProvider`, or with `registerTokensProviderFactory`,\n * but will work together with a tokens provider set using `registerDocumentSemanticTokensProvider`\n * or `registerDocumentRangeSemanticTokensProvider`.\n */\nexport function setTokensProvider(languageId: string, provider: TokensProvider | EncodedTokensProvider | Thenable<TokensProvider | EncodedTokensProvider>): IDisposable {\n\tconst languageService = StandaloneServices.get(ILanguageService);\n\tif (!languageService.isRegisteredLanguageId(languageId)) {\n\t\tthrow new Error(`Cannot set tokens provider for unknown language ${languageId}`);\n\t}\n\tif (isThenable<TokensProvider | EncodedTokensProvider>(provider)) {\n\t\treturn registerTokensProviderFactory(languageId, { create: () => provider });\n\t}\n\treturn languages.TokenizationRegistry.register(languageId, createTokenizationSupportAdapter(languageId, provider));\n}\n\n/**\n * Set the tokens provider for a language (monarch implementation). This tokenizer will be exclusive\n * with a tokenizer set using `setTokensProvider`, or with `registerTokensProviderFactory`, but will\n * work together with a tokens provider set using `registerDocumentSemanticTokensProvider` or\n * `registerDocumentRangeSemanticTokensProvider`.\n */\nexport function setMonarchTokensProvider(languageId: string, languageDef: IMonarchLanguage | Thenable<IMonarchLanguage>): IDisposable {\n\tconst create = (languageDef: IMonarchLanguage) => {\n\t\treturn new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, languageDef));\n\t};\n\tif (isThenable<IMonarchLanguage>(languageDef)) {\n\t\treturn registerTokensProviderFactory(languageId, { create: () => languageDef });\n\t}\n\treturn languages.TokenizationRegistry.register(languageId, create(languageDef));\n}\n\n/**\n * Register a reference provider (used by e.g. reference search).\n */\nexport function registerReferenceProvider(languageSelector: LanguageSelector, provider: languages.ReferenceProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.referenceProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a rename provider (used by e.g. rename symbol).\n */\nexport function registerRenameProvider(languageSelector: LanguageSelector, provider: languages.RenameProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.renameProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a signature help provider (used by e.g. parameter hints).\n */\nexport function registerSignatureHelpProvider(languageSelector: LanguageSelector, provider: languages.SignatureHelpProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.signatureHelpProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a hover provider (used by e.g. editor hover).\n */\nexport function registerHoverProvider(languageSelector: LanguageSelector, provider: languages.HoverProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.hoverProvider.register(languageSelector, {\n\t\tprovideHover: (model: model.ITextModel, position: Position, token: CancellationToken): Promise<languages.Hover | undefined> => {\n\t\t\tconst word = model.getWordAtPosition(position);\n\n\t\t\treturn Promise.resolve<languages.Hover | null | undefined>(provider.provideHover(model, position, token)).then((value): languages.Hover | undefined => {\n\t\t\t\tif (!value) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (!value.range && word) {\n\t\t\t\t\tvalue.range = new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n\t\t\t\t}\n\t\t\t\tif (!value.range) {\n\t\t\t\t\tvalue.range = new Range(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t});\n\t\t}\n\t});\n}\n\n/**\n * Register a document symbol provider (used by e.g. outline).\n */\nexport function registerDocumentSymbolProvider(languageSelector: LanguageSelector, provider: languages.DocumentSymbolProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentSymbolProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a document highlight provider (used by e.g. highlight occurrences).\n */\nexport function registerDocumentHighlightProvider(languageSelector: LanguageSelector, provider: languages.DocumentHighlightProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentHighlightProvider.register(languageSelector, provider);\n}\n\n/**\n * Register an linked editing range provider.\n */\nexport function registerLinkedEditingRangeProvider(languageSelector: LanguageSelector, provider: languages.LinkedEditingRangeProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.linkedEditingRangeProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a definition provider (used by e.g. go to definition).\n */\nexport function registerDefinitionProvider(languageSelector: LanguageSelector, provider: languages.DefinitionProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.definitionProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a implementation provider (used by e.g. go to implementation).\n */\nexport function registerImplementationProvider(languageSelector: LanguageSelector, provider: languages.ImplementationProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.implementationProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a type definition provider (used by e.g. go to type definition).\n */\nexport function registerTypeDefinitionProvider(languageSelector: LanguageSelector, provider: languages.TypeDefinitionProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.typeDefinitionProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a code lens provider (used by e.g. inline code lenses).\n */\nexport function registerCodeLensProvider(languageSelector: LanguageSelector, provider: languages.CodeLensProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.codeLensProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a code action provider (used by e.g. quick fix).\n */\nexport function registerCodeActionProvider(languageSelector: LanguageSelector, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.codeActionProvider.register(languageSelector, {\n\t\tprovidedCodeActionKinds: metadata?.providedCodeActionKinds,\n\t\tprovideCodeActions: (model: model.ITextModel, range: Range, context: languages.CodeActionContext, token: CancellationToken): languages.ProviderResult<languages.CodeActionList> => {\n\t\t\tconst markerService = StandaloneServices.get(IMarkerService);\n\t\t\tconst markers = markerService.read({ resource: model.uri }).filter(m => {\n\t\t\t\treturn Range.areIntersectingOrTouching(m, range);\n\t\t\t});\n\t\t\treturn provider.provideCodeActions(model, range, { markers, only: context.only }, token);\n\t\t},\n\t\tresolveCodeAction: provider.resolveCodeAction\n\t});\n}\n\n/**\n * Register a formatter that can handle only entire models.\n */\nexport function registerDocumentFormattingEditProvider(languageSelector: LanguageSelector, provider: languages.DocumentFormattingEditProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentFormattingEditProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a formatter that can handle a range inside a model.\n */\nexport function registerDocumentRangeFormattingEditProvider(languageSelector: LanguageSelector, provider: languages.DocumentRangeFormattingEditProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentRangeFormattingEditProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a formatter than can do formatting as the user types.\n */\nexport function registerOnTypeFormattingEditProvider(languageSelector: LanguageSelector, provider: languages.OnTypeFormattingEditProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.onTypeFormattingEditProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a link provider that can find links in text.\n */\nexport function registerLinkProvider(languageSelector: LanguageSelector, provider: languages.LinkProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.linkProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a completion item provider (use by e.g. suggestions).\n */\nexport function registerCompletionItemProvider(languageSelector: LanguageSelector, provider: languages.CompletionItemProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.completionProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a document color provider (used by Color Picker, Color Decorator).\n */\nexport function registerColorProvider(languageSelector: LanguageSelector, provider: languages.DocumentColorProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.colorProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a folding range provider\n */\nexport function registerFoldingRangeProvider(languageSelector: LanguageSelector, provider: languages.FoldingRangeProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.foldingRangeProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a declaration provider\n */\nexport function registerDeclarationProvider(languageSelector: LanguageSelector, provider: languages.DeclarationProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.declarationProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a selection range provider\n */\nexport function registerSelectionRangeProvider(languageSelector: LanguageSelector, provider: languages.SelectionRangeProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.selectionRangeProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a document semantic tokens provider. A semantic tokens provider will complement and enhance a\n * simple top-down tokenizer. Simple top-down tokenizers can be set either via `setMonarchTokensProvider`\n * or `setTokensProvider`.\n *\n * For the best user experience, register both a semantic tokens provider and a top-down tokenizer.\n */\nexport function registerDocumentSemanticTokensProvider(languageSelector: LanguageSelector, provider: languages.DocumentSemanticTokensProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentSemanticTokensProvider.register(languageSelector, provider);\n}\n\n/**\n * Register a document range semantic tokens provider. A semantic tokens provider will complement and enhance a\n * simple top-down tokenizer. Simple top-down tokenizers can be set either via `setMonarchTokensProvider`\n * or `setTokensProvider`.\n *\n * For the best user experience, register both a semantic tokens provider and a top-down tokenizer.\n */\nexport function registerDocumentRangeSemanticTokensProvider(languageSelector: LanguageSelector, provider: languages.DocumentRangeSemanticTokensProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.documentRangeSemanticTokensProvider.register(languageSelector, provider);\n}\n\n/**\n * Register an inline completions provider.\n */\nexport function registerInlineCompletionsProvider(languageSelector: LanguageSelector, provider: languages.InlineCompletionsProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.inlineCompletionsProvider.register(languageSelector, provider);\n}\n\n/**\n * Register an inlay hints provider.\n */\nexport function registerInlayHintsProvider(languageSelector: LanguageSelector, provider: languages.InlayHintsProvider): IDisposable {\n\tconst languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService);\n\treturn languageFeaturesService.inlayHintsProvider.register(languageSelector, provider);\n}\n\n/**\n * Contains additional diagnostic information about the context in which\n * a [code action](#CodeActionProvider.provideCodeActions) is run.\n */\nexport interface CodeActionContext {\n\n\t/**\n\t * An array of diagnostics.\n\t */\n\treadonly markers: IMarkerData[];\n\n\t/**\n\t * Requested kind of actions to return.\n\t */\n\treadonly only?: string;\n}\n\n/**\n * The code action interface defines the contract between extensions and\n * the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.\n */\nexport interface CodeActionProvider {\n\t/**\n\t * Provide commands for the given document and range.\n\t */\n\tprovideCodeActions(model: model.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): languages.ProviderResult<languages.CodeActionList>;\n\n\t/**\n\t * Given a code action fill in the edit. Will only invoked when missing.\n\t */\n\tresolveCodeAction?(codeAction: languages.CodeAction, token: CancellationToken): languages.ProviderResult<languages.CodeAction>;\n}\n\n\n\n/**\n * Metadata about the type of code actions that a {@link CodeActionProvider} provides.\n */\nexport interface CodeActionProviderMetadata {\n\t/**\n\t * List of code action kinds that a {@link CodeActionProvider} may return.\n\t *\n\t * This list is used to determine if a given `CodeActionProvider` should be invoked or not.\n\t * To avoid unnecessary computation, every `CodeActionProvider` should list use `providedCodeActionKinds`. The\n\t * list of kinds may either be generic, such as `[\"quickfix\", \"refactor\", \"source\"]`, or list out every kind provided,\n\t * such as `[\"quickfix.removeLine\", \"source.fixAll\" ...]`.\n\t */\n\treadonly providedCodeActionKinds?: readonly string[];\n}\n\n/**\n * @internal\n */\nexport function createMonacoLanguagesAPI(): typeof monaco.languages {\n\treturn {\n\t\tregister: <any>register,\n\t\tgetLanguages: <any>getLanguages,\n\t\tonLanguage: <any>onLanguage,\n\t\tgetEncodedLanguageId: <any>getEncodedLanguageId,\n\n\t\t// provider methods\n\t\tsetLanguageConfiguration: <any>setLanguageConfiguration,\n\t\tsetColorMap: setColorMap,\n\t\tregisterTokensProviderFactory: <any>registerTokensProviderFactory,\n\t\tsetTokensProvider: <any>setTokensProvider,\n\t\tsetMonarchTokensProvider: <any>setMonarchTokensProvider,\n\t\tregisterReferenceProvider: <any>registerReferenceProvider,\n\t\tregisterRenameProvider: <any>registerRenameProvider,\n\t\tregisterCompletionItemProvider: <any>registerCompletionItemProvider,\n\t\tregisterSignatureHelpProvider: <any>registerSignatureHelpProvider,\n\t\tregisterHoverProvider: <any>registerHoverProvider,\n\t\tregisterDocumentSymbolProvider: <any>registerDocumentSymbolProvider,\n\t\tregisterDocumentHighlightProvider: <any>registerDocumentHighlightProvider,\n\t\tregisterLinkedEditingRangeProvider: <any>registerLinkedEditingRangeProvider,\n\t\tregisterDefinitionProvider: <any>registerDefinitionProvider,\n\t\tregisterImplementationProvider: <any>registerImplementationProvider,\n\t\tregisterTypeDefinitionProvider: <any>registerTypeDefinitionProvider,\n\t\tregisterCodeLensProvider: <any>registerCodeLensProvider,\n\t\tregisterCodeActionProvider: <any>registerCodeActionProvider,\n\t\tregisterDocumentFormattingEditProvider: <any>registerDocumentFormattingEditProvider,\n\t\tregisterDocumentRangeFormattingEditProvider: <any>registerDocumentRangeFormattingEditProvider,\n\t\tregisterOnTypeFormattingEditProvider: <any>registerOnTypeFormattingEditProvider,\n\t\tregisterLinkProvider: <any>registerLinkProvider,\n\t\tregisterColorProvider: <any>registerColorProvider,\n\t\tregisterFoldingRangeProvider: <any>registerFoldingRangeProvider,\n\t\tregisterDeclarationProvider: <any>registerDeclarationProvider,\n\t\tregisterSelectionRangeProvider: <any>registerSelectionRangeProvider,\n\t\tregisterDocumentSemanticTokensProvider: <any>registerDocumentSemanticTokensProvider,\n\t\tregisterDocumentRangeSemanticTokensProvider: <any>registerDocumentRangeSemanticTokensProvider,\n\t\tregisterInlineCompletionsProvider: <any>registerInlineCompletionsProvider,\n\t\tregisterInlayHintsProvider: <any>registerInlayHintsProvider,\n\n\t\t// enums\n\t\tDocumentHighlightKind: standaloneEnums.DocumentHighlightKind,\n\t\tCompletionItemKind: standaloneEnums.CompletionItemKind,\n\t\tCompletionItemTag: standaloneEnums.CompletionItemTag,\n\t\tCompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule,\n\t\tSymbolKind: standaloneEnums.SymbolKind,\n\t\tSymbolTag: standaloneEnums.SymbolTag,\n\t\tIndentAction: standaloneEnums.IndentAction,\n\t\tCompletionTriggerKind: standaloneEnums.CompletionTriggerKind,\n\t\tSignatureHelpTriggerKind: standaloneEnums.SignatureHelpTriggerKind,\n\t\tInlayHintKind: standaloneEnums.InlayHintKind,\n\t\tInlineCompletionTriggerKind: standaloneEnums.InlineCompletionTriggerKind,\n\n\t\t// classes\n\t\tFoldingRangeKind: languages.FoldingRangeKind,\n\t};\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 { EditorOptions, WrappingIndent, EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions';\nimport { createMonacoBaseAPI } from 'vs/editor/common/services/editorBaseApi';\nimport { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor';\nimport { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages';\nimport { globals } from 'vs/base/common/platform';\nimport { FormattingConflicts } from 'vs/editor/contrib/format/browser/format';\n\n// Set defaults for standalone editor\nEditorOptions.wrappingIndent.defaultValue = WrappingIndent.None;\nEditorOptions.glyphMargin.defaultValue = false;\nEditorOptions.autoIndent.defaultValue = EditorAutoIndentStrategy.Advanced;\nEditorOptions.overviewRulerLanes.defaultValue = 2;\n\n// We need to register a formatter selector which simply picks the first available formatter.\n// See https://github.com/microsoft/monaco-editor/issues/2327\nFormattingConflicts.setFormatterSelector((formatter, document, mode) => Promise.resolve(formatter[0]));\n\nconst api = createMonacoBaseAPI();\napi.editor = createMonacoEditorAPI();\napi.languages = createMonacoLanguagesAPI();\nexport const CancellationTokenSource = api.CancellationTokenSource;\nexport const Emitter = api.Emitter;\nexport const KeyCode = api.KeyCode;\nexport const KeyMod = api.KeyMod;\nexport const Position = api.Position;\nexport const Range = api.Range;\nexport const Selection = api.Selection;\nexport const SelectionDirection = api.SelectionDirection;\nexport const MarkerSeverity = api.MarkerSeverity;\nexport const MarkerTag = api.MarkerTag;\nexport const Uri = api.Uri;\nexport const Token = api.Token;\nexport const editor = api.editor;\nexport const languages = api.languages;\n\nif (globals.MonacoEnvironment?.globalAPI || (typeof define === 'function' && (<any>define).amd)) {\n\tself.monaco = api;\n}\n\nif (typeof self.require !== 'undefined' && typeof self.require.config === 'function') {\n\tself.require.config({\n\t\tignoreDuplicateModules: [\n\t\t\t'vscode-languageserver-types',\n\t\t\t'vscode-languageserver-types/main',\n\t\t\t'vscode-languageserver-textdocument',\n\t\t\t'vscode-languageserver-textdocument/main',\n\t\t\t'vscode-nls',\n\t\t\t'vscode-nls/vscode-nls',\n\t\t\t'jsonc-parser',\n\t\t\t'jsonc-parser/main',\n\t\t\t'vscode-uri',\n\t\t\t'vscode-uri/index',\n\t\t\t'vs/basic-languages/typescript/typescript'\n\t\t]\n\t});\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 'vs/editor/editor.all';\nimport 'vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp';\nimport 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard';\nimport 'vs/editor/standalone/browser/inspectTokens/inspectTokens';\nimport 'vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess';\nimport 'vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess';\nimport 'vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess';\nimport 'vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess';\nimport 'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch';\nimport 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast';\n\nexport * from 'vs/editor/editor.api';\n"],"mappings":"AAAA;;;;;+DAAA,AAAA,WAAA,CACA,GAAA,IAAA,CAAA,UAAA,UAAA,2BAAA,8BAAA,uBAAA,SAAA,+BAAA,sBAAA,yBAAA,iDAAA,uBAAA,iCAAA,+BAAA,wBAAA,wCAAA,qCAAA,0BAAA,2CAAA,wBAAA,uBAAA,6CAAA,8BAAA,kCAAA,yCAAA,qCAAA,qBAAA,uCAAA,6BAAA,0BAAA,+CAAA,uBAAA,8BAAA,wCAAA,2DAAA,0BAAA,sCAAA,uCAAA,qCAAA,mCAAA,+CAAA,yBAAA,iDAAA,2BAAA,2CAAA,gCAAA,yBAAA,+BAAA,yBAAA,kCAAA,qBAAA,yBAAA,kCAAA,8CAAA,mCAAA,4CAAA,2BAAA,4CAAA,0BAAA,0BAAA,6BAAA,wBAAA,gCAAA,4BAAA,sCAAA,uCAAA,iDAAA,6BAAA,oDAAA,6BAAA,iDAAA,sCAAA,6BAAA,qCAAA,uCAAA,wCAAA,yBAAA,0BAAA,qCAAA,8CAAA,qCAAA,2CAAA,2CAAA,qCAAA,4BAAA,sBAAA,2EAAA,6CAAA,yCAAA,yCAAA,oDAAA,yCAAA,4BAAA,wBAAA,sCAAA,mCAAA,4BAAA,6BAAA,4BAAA,yCAAA,4CAAA,2CAAA,sFAAA,4CAAA,8CAAA,gDAAA,yDAAA,8DAAA,4CAAA,oDAAA,4CAAA,8CAAA,+BAAA,wBAAA,yBAAA,sBAAA,0CAAA,+BAAA,qCAAA,0CAAA,mCAAA,gDAAA,mCAAA,mDAAA,sCAAA,0CAAA,oCAAA,+CAAA,kDAAA,+CAAA,uDAAA,qCAAA,iCAAA,2CAA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